Version 0.1.0 0.1.0
authorThierry Florac <thierry.florac@onf.fr>
Wed, 17 Jun 2015 10:00:10 +0200
changeset 69 a361355b55c7
parent 68 fd8fb93e1b6a
child 70 6f485755365f
Version 0.1.0
.installed.cfg
buildout.cfg
setup.py
src/pyams_skin.egg-info/SOURCES.txt
src/pyams_skin.egg-info/requires.txt
src/pyams_skin/configuration.py
src/pyams_skin/configure.zcml
src/pyams_skin/interfaces/__init__.py
src/pyams_skin/interfaces/tinymce.py
src/pyams_skin/interfaces/viewlet.py
src/pyams_skin/locales/fr/LC_MESSAGES/pyams_skin.mo
src/pyams_skin/locales/fr/LC_MESSAGES/pyams_skin.po
src/pyams_skin/locales/pyams_skin.pot
src/pyams_skin/page.py
src/pyams_skin/resources/css/myams.css
src/pyams_skin/resources/css/myams.min.css
src/pyams_skin/resources/js/ext/tinymce/dev/classes/AddOnManager.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/Compat.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/Editor.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/EditorCommands.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/EditorManager.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/EditorObservable.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/EnterKey.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/Env.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/FocusManager.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ForceBlocks.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/Formatter.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/LegacyInput.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/NodeChange.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/Shortcuts.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/UndoManager.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/WindowManager.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/BookmarkManager.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/ControlSelection.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/DOMUtils.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/DomQuery.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/ElementUtils.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/EventUtils.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/Range.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/RangeUtils.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/ScriptLoader.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/Selection.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/Serializer.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/Sizzle.jQuery.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/Sizzle.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/StyleSheetLoader.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/TreeWalker.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/TridentSelection.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/fmt/Preview.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/DomParser.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/Entities.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/Node.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/SaxParser.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/Schema.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/Serializer.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/Styles.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/Writer.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/AbsoluteLayout.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Button.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ButtonGroup.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Checkbox.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Collection.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ColorBox.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ColorButton.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ColorPicker.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ComboBox.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Container.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Control.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/DomUtils.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/DragHelper.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ElementPath.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Factory.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FieldSet.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FilePicker.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FitLayout.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FlexLayout.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FloatPanel.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FlowLayout.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Form.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FormItem.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FormatControls.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/GridLayout.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Iframe.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/KeyboardNavigation.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Label.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Layout.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ListBox.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Menu.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/MenuBar.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/MenuButton.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/MenuItem.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/MessageBox.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Movable.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Panel.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/PanelButton.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Path.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Radio.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Resizable.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ResizeHandle.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Scrollable.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Selector.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Spacer.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/SplitButton.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/StackLayout.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/TabPanel.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/TextBox.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Throbber.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Toolbar.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Tooltip.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Widget.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Window.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/Class.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/Color.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/EventDispatcher.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/I18n.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/JSON.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/JSONP.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/JSONRequest.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/LocalStorage.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/Observable.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/Quirks.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/Tools.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/URI.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/VK.js
src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/XHR.js
src/pyams_skin/resources/js/ext/tinymce/dev/jquery.tinymce.js
src/pyams_skin/resources/js/ext/tinymce/dev/jquery.tinymce.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/langs/fr.js
src/pyams_skin/resources/js/ext/tinymce/dev/langs/fr.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/langs/readme.md
src/pyams_skin/resources/js/ext/tinymce/dev/license.txt
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/advlist/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/advlist/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/anchor/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/anchor/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/autolink/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/autolink/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/autoresize/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/autoresize/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/autosave/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/autosave/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/bbcode/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/bbcode/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/charmap/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/charmap/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/code/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/code/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/colorpicker/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/colorpicker/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/css/dialog.css
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/img/buttons.png
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/img/icons.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/img/items.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/img/menu_arrow.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/img/menu_check.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/img/progress.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/img/tabs.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/tiny_mce_popup.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/utils/editable_selects.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/utils/form_utils.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/utils/mctabs.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/utils/validate.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/contextmenu/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/contextmenu/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/directionality/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/directionality/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-cool.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-cry.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-embarassed.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-foot-in-mouth.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-frown.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-innocent.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-kiss.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-laughing.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-money-mouth.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-sealed.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-smile.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-surprised.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-tongue-out.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-undecided.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-wink.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-yell.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/example/dialog.html
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/example/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/example/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/example_dependency/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/example_dependency/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/fullpage/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/fullpage/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/fullscreen/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/fullscreen/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/hr/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/hr/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/image/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/image/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/importcss/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/importcss/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/insertdatetime/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/insertdatetime/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/layer/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/layer/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/legacyoutput/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/legacyoutput/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/link/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/link/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/lists/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/lists/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/media/moxieplayer.swf
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/media/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/media/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/nonbreaking/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/nonbreaking/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/noneditable/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/noneditable/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/pagebreak/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/pagebreak/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/paste/classes/Clipboard.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/paste/classes/Plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/paste/classes/Quirks.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/paste/classes/Utils.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/paste/classes/WordFilter.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/paste/plugin.dev.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/paste/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/paste/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/preview/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/preview/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/print/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/print/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/save/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/save/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/searchreplace/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/searchreplace/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/spellchecker/classes/DomTextMatcher.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/spellchecker/classes/Plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/spellchecker/plugin.dev.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/spellchecker/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/spellchecker/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/tabfocus/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/tabfocus/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/table/classes/CellSelection.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/table/classes/Dialogs.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/table/classes/Plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/table/classes/Quirks.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/table/classes/TableGrid.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/table/plugin.dev.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/table/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/table/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/template/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/template/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/textcolor/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/textcolor/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/textpattern/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/textpattern/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/css/visualblocks.css
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/address.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/article.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/aside.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/blockquote.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/div.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/dl.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/figure.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/h1.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/h2.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/h3.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/h4.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/h5.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/h6.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/hgroup.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/ol.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/p.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/pre.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/section.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/ul.gif
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualchars/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualchars/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/wordcount/plugin.js
src/pyams_skin/resources/js/ext/tinymce/dev/plugins/wordcount/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/AbsoluteLayout.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Animations.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Button.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/ButtonGroup.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Checkbox.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/ColorBox.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/ColorButton.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/ColorPicker.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/ComboBox.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Container.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Content.Inline.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Content.Objects.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Content.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/FieldSet.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/FitLayout.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/FloatPanel.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/FlowLayout.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Icons.Ie7.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Icons.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Iframe.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Label.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/ListBox.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Menu.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/MenuBar.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/MenuButton.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/MenuItem.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Mixins.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Panel.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Path.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Radio.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Reset.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/ResizeHandle.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Scrollable.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Spacer.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/SplitButton.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/StackLayout.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/TabPanel.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/TextBox.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Throbber.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/TinyMCE.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/ToolTip.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Variables.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Window.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/content.inline.min.css
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/content.min.css
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/readme.md
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/tinymce-small.eot
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/tinymce-small.json
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/tinymce-small.svg
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/tinymce-small.ttf
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/tinymce-small.woff
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/tinymce.eot
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/tinymce.json
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/tinymce.svg
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/tinymce.ttf
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/tinymce.woff
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/img/anchor.gif
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/img/loader.gif
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/img/object.gif
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/img/trans.gif
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/skin.dev.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/skin.ie7.dev.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/skin.ie7.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/skin.ie7.min.css
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/skin.less
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/skin.min.css
src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/skin.modern.dev.less
src/pyams_skin/resources/js/ext/tinymce/dev/themes/modern/theme.js
src/pyams_skin/resources/js/ext/tinymce/dev/themes/modern/theme.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/tinymce.jquery.js
src/pyams_skin/resources/js/ext/tinymce/dev/tinymce.jquery.min.js
src/pyams_skin/resources/js/ext/tinymce/dev/tinymce.js
src/pyams_skin/resources/js/ext/tinymce/dev/tinymce.min.js
src/pyams_skin/resources/js/ext/tinymce/jquery.tinymce.min.js
src/pyams_skin/resources/js/ext/tinymce/langs/fr.js
src/pyams_skin/resources/js/ext/tinymce/langs/readme.md
src/pyams_skin/resources/js/ext/tinymce/license.txt
src/pyams_skin/resources/js/ext/tinymce/plugins/advlist/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/anchor/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/autolink/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/autoresize/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/autosave/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/bbcode/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/charmap/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/code/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/colorpicker/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/contextmenu/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/directionality/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-cool.gif
src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-cry.gif
src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-embarassed.gif
src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-foot-in-mouth.gif
src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-frown.gif
src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-innocent.gif
src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-kiss.gif
src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-laughing.gif
src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-money-mouth.gif
src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-sealed.gif
src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-smile.gif
src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-surprised.gif
src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-tongue-out.gif
src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-undecided.gif
src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-wink.gif
src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-yell.gif
src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/example/dialog.html
src/pyams_skin/resources/js/ext/tinymce/plugins/example/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/example_dependency/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/fullpage/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/fullscreen/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/hr/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/image/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/importcss/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/insertdatetime/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/layer/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/legacyoutput/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/link/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/lists/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/media/moxieplayer.swf
src/pyams_skin/resources/js/ext/tinymce/plugins/media/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/nonbreaking/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/noneditable/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/pagebreak/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/paste/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/preview/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/print/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/save/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/searchreplace/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/spellchecker/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/tabfocus/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/table/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/template/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/textcolor/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/textpattern/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/visualblocks/css/visualblocks.css
src/pyams_skin/resources/js/ext/tinymce/plugins/visualblocks/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/visualchars/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/plugins/wordcount/plugin.min.js
src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/content.inline.min.css
src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/content.min.css
src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/fonts/tinymce-small.eot
src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/fonts/tinymce-small.svg
src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/fonts/tinymce-small.ttf
src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/fonts/tinymce-small.woff
src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/fonts/tinymce.eot
src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/fonts/tinymce.svg
src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/fonts/tinymce.ttf
src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/fonts/tinymce.woff
src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/img/anchor.gif
src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/img/loader.gif
src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/img/object.gif
src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/img/trans.gif
src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/skin.ie7.min.css
src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/skin.min.css
src/pyams_skin/resources/js/ext/tinymce/themes/modern/theme.min.js
src/pyams_skin/resources/js/ext/tinymce/tinymce.min.js
src/pyams_skin/resources/js/myams.js
src/pyams_skin/resources/js/myams.min.js
src/pyams_skin/resources/less/forms.less
src/pyams_skin/resources/less/menus.less
src/pyams_skin/resources/less/modal.less
src/pyams_skin/resources/less/tables.less
src/pyams_skin/resources/less/widgets.less
src/pyams_skin/table.py
src/pyams_skin/templates/header.pt
src/pyams_skin/templates/layout.pt
src/pyams_skin/templates/table.pt
src/pyams_skin/templates/widget-layout.pt
src/pyams_skin/viewlet/shortcuts/__init__.py
src/pyams_skin/viewlet/toolbar/__init__.py
src/pyams_skin/viewlet/toplinks/__init__.py
--- a/.installed.cfg	Wed May 20 15:01:45 2015 +0200
+++ b/.installed.cfg	Wed Jun 17 10:00:10 2015 +0200
@@ -1,31 +1,63 @@
 [buildout]
-installed_develop_eggs = /home/borax/Dropbox/src/PyAMS/pyams_skin/develop-eggs/pyams-skin.egg-link
-parts = i18n pyflakes test package
+installed_develop_eggs = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/develop-eggs/pyams-file.egg-link
+parts = package i18n pyflakes test
+
+[package]
+__buildout_installed__ = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/fanstatic-compile
+	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/pyams_upgrade
+	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/prequest
+	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/pviews
+	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/pshell
+	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/pdistreport
+	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/pcreate
+	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/pserve
+	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/ptweens
+	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/proutes
+__buildout_signature__ = zc.recipe.egg-2.0.1-py3.4.egg setuptools-12.2-py3.4.egg zc.buildout-2.3.1-py3.4.egg
+_b = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin
+_d = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/develop-eggs
+_e = /var/local/env/pyams/eggs
+bin-directory = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin
+develop-eggs-directory = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/develop-eggs
+eggs = fanstatic
+	pyams_file
+	pyams_skin
+	pyams_utils
+	pyams_viewlet
+	pyramid
+	z3c.form
+	z3c.table
+	zope.component
+	zope.componentvocabulary
+	zope.interface
+	zope.traversing
+eggs-directory = /var/local/env/pyams/eggs
+recipe = zc.recipe.egg
 
 [i18n]
-__buildout_installed__ = /home/borax/Dropbox/src/PyAMS/pyams_skin/bin/pybabel
-	/home/borax/Dropbox/src/PyAMS/pyams_skin/bin/polint
-	/home/borax/Dropbox/src/PyAMS/pyams_skin/bin/pot-create
-__buildout_signature__ = zc.recipe.egg-2.0.1-py3.4.egg setuptools-12.0.5-py3.4.egg zc.buildout-2.3.1-py3.4.egg
-_b = /home/borax/Dropbox/src/PyAMS/pyams_skin/bin
-_d = /home/borax/Dropbox/src/PyAMS/pyams_skin/develop-eggs
+__buildout_installed__ = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/pybabel
+	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/polint
+	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/pot-create
+__buildout_signature__ = zc.recipe.egg-2.0.1-py3.4.egg setuptools-12.2-py3.4.egg zc.buildout-2.3.1-py3.4.egg
+_b = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin
+_d = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/develop-eggs
 _e = /var/local/env/pyams/eggs
-bin-directory = /home/borax/Dropbox/src/PyAMS/pyams_skin/bin
-develop-eggs-directory = /home/borax/Dropbox/src/PyAMS/pyams_skin/develop-eggs
+bin-directory = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin
+develop-eggs-directory = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/develop-eggs
 eggs = babel
 	lingua
 eggs-directory = /var/local/env/pyams/eggs
 recipe = zc.recipe.egg
 
 [pyflakes]
-__buildout_installed__ = /home/borax/Dropbox/src/PyAMS/pyams_skin/bin/pyflakes
-	/home/borax/Dropbox/src/PyAMS/pyams_skin/bin/pyflakes
-__buildout_signature__ = zc.recipe.egg-2.0.1-py3.4.egg setuptools-12.0.5-py3.4.egg zc.buildout-2.3.1-py3.4.egg
-_b = /home/borax/Dropbox/src/PyAMS/pyams_skin/bin
-_d = /home/borax/Dropbox/src/PyAMS/pyams_skin/develop-eggs
+__buildout_installed__ = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/pyflakes
+	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/pyflakes
+__buildout_signature__ = zc.recipe.egg-2.0.1-py3.4.egg setuptools-12.2-py3.4.egg zc.buildout-2.3.1-py3.4.egg
+_b = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin
+_d = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/develop-eggs
 _e = /var/local/env/pyams/eggs
-bin-directory = /home/borax/Dropbox/src/PyAMS/pyams_skin/bin
-develop-eggs-directory = /home/borax/Dropbox/src/PyAMS/pyams_skin/develop-eggs
+bin-directory = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin
+develop-eggs-directory = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/develop-eggs
 eggs = pyflakes
 eggs-directory = /var/local/env/pyams/eggs
 entry-points = pyflakes=pyflakes.scripts.pyflakes:main
@@ -34,65 +66,16 @@
 scripts = pyflakes
 
 [test]
-__buildout_installed__ = /home/borax/Dropbox/src/PyAMS/pyams_skin/parts/test
-	/home/borax/Dropbox/src/PyAMS/pyams_skin/bin/test
-__buildout_signature__ = zc.recipe.testrunner-2.0.0-py3.4.egg zc.recipe.egg-2.0.1-py3.4.egg setuptools-12.0.5-py3.4.egg zope.testrunner-4.4.6-py3.4.egg zc.buildout-2.3.1-py3.4.egg zope.interface-4.1.2-py3.4-linux-x86_64.egg zope.exceptions-4.0.7-py3.4.egg six-8ad56e9feeb914de21341cbb261cc34e
-_b = /home/borax/Dropbox/src/PyAMS/pyams_skin/bin
-_d = /home/borax/Dropbox/src/PyAMS/pyams_skin/develop-eggs
+__buildout_installed__ = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/parts/test
+	/home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/test
+__buildout_signature__ = zc.recipe.testrunner-2.0.0-py3.4.egg zc.recipe.egg-2.0.1-py3.4.egg setuptools-12.2-py3.4.egg zope.testrunner-4.4.6-py3.4.egg zc.buildout-2.3.1-py3.4.egg zope.interface-4.1.2-py3.4-linux-x86_64.egg zope.exceptions-4.0.7-py3.4.egg six-e6b62e54b4df360c40dfcbb76c1ecf1a
+_b = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin
+_d = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/develop-eggs
 _e = /var/local/env/pyams/eggs
-bin-directory = /home/borax/Dropbox/src/PyAMS/pyams_skin/bin
-develop-eggs-directory = /home/borax/Dropbox/src/PyAMS/pyams_skin/develop-eggs
+bin-directory = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin
+develop-eggs-directory = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/develop-eggs
 eggs = pyams_skin [test]
 eggs-directory = /var/local/env/pyams/eggs
-location = /home/borax/Dropbox/src/PyAMS/pyams_skin/parts/test
+location = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/parts/test
 recipe = zc.recipe.testrunner
-script = /home/borax/Dropbox/src/PyAMS/pyams_skin/bin/test
-
-[package]
-__buildout_installed__ = /home/borax/Dropbox/src/PyAMS/pyams_skin/bin/fanstatic-compile
-	/home/borax/Dropbox/src/PyAMS/pyams_skin/bin/proutes
-	/home/borax/Dropbox/src/PyAMS/pyams_skin/bin/pserve
-	/home/borax/Dropbox/src/PyAMS/pyams_skin/bin/ptweens
-	/home/borax/Dropbox/src/PyAMS/pyams_skin/bin/pviews
-	/home/borax/Dropbox/src/PyAMS/pyams_skin/bin/prequest
-	/home/borax/Dropbox/src/PyAMS/pyams_skin/bin/pshell
-	/home/borax/Dropbox/src/PyAMS/pyams_skin/bin/pdistreport
-	/home/borax/Dropbox/src/PyAMS/pyams_skin/bin/pcreate
-__buildout_signature__ = zc.recipe.egg-2.0.1-py3.4.egg setuptools-12.0.5-py3.4.egg zc.buildout-2.3.1-py3.4.egg
-_b = /home/borax/Dropbox/src/PyAMS/pyams_skin/bin
-_d = /home/borax/Dropbox/src/PyAMS/pyams_skin/develop-eggs
-_e = /var/local/env/pyams/eggs
-bin-directory = /home/borax/Dropbox/src/PyAMS/pyams_skin/bin
-develop-eggs-directory = /home/borax/Dropbox/src/PyAMS/pyams_skin/develop-eggs
-eggs = pyams_skin
-	fanstatic
-	pyramid
-	z3c.form
-	zope.component
-	zope.interface
-eggs-directory = /var/local/env/pyams/eggs
-recipe = zc.recipe.egg
-
-[buildout]
-parts = pyflakes test package i18n
-
-[buildout]
-parts = test package i18n pyflakes
-
-[buildout]
-parts = package i18n pyflakes test
-
-[buildout]
-installed_develop_eggs = /home/borax/Dropbox/src/PyAMS/pyams_skin/develop-eggs/pyams-skin.egg-link
-
-[buildout]
-parts = i18n pyflakes test package
-
-[buildout]
-parts = pyflakes test package i18n
-
-[buildout]
-parts = test package i18n pyflakes
-
-[buildout]
-parts = package i18n pyflakes test
+script = /home/tflorac/Dropbox/src/PyAMS/pyams_skin/bin/test
--- a/buildout.cfg	Wed May 20 15:01:45 2015 +0200
+++ b/buildout.cfg	Wed Jun 17 10:00:10 2015 +0200
@@ -19,6 +19,7 @@
 src = src
 develop =
     .
+    /var/local/src/pyams/pyams_file
     /var/local/src/pyams/pyams_utils
     /var/local/src/pyams/pyams_viewlet
     /var/local/src/pyams/ext/lingua
@@ -32,8 +33,9 @@
 [package]
 recipe = zc.recipe.egg
 eggs =
+    fanstatic
+    pyams_file
     pyams_skin
-    fanstatic
     pyams_utils
     pyams_viewlet
     pyramid
--- a/setup.py	Wed May 20 15:01:45 2015 +0200
+++ b/setup.py	Wed Jun 17 10:00:10 2015 +0200
@@ -60,6 +60,7 @@
           'setuptools',
           # -*- Extra requirements: -*-
           'fanstatic',
+          'pyams_file',
           'pyams_utils',
           'pyams_viewlet',
           'pyramid',
--- a/src/pyams_skin.egg-info/SOURCES.txt	Wed May 20 15:01:45 2015 +0200
+++ b/src/pyams_skin.egg-info/SOURCES.txt	Wed Jun 17 10:00:10 2015 +0200
@@ -26,7 +26,12 @@
 src/pyams_skin/interfaces/configuration.py
 src/pyams_skin/interfaces/container.py
 src/pyams_skin/interfaces/resources.py
+src/pyams_skin/interfaces/tinymce.py
 src/pyams_skin/interfaces/viewlet.py
+src/pyams_skin/locales/pyams_skin.pot
+src/pyams_skin/locales/fr/LC_MESSAGES/pyams_skin.mo
+src/pyams_skin/locales/fr/LC_MESSAGES/pyams_skin.po
+src/pyams_skin/resources/.dropbox
 src/pyams_skin/resources/css/myams.css
 src/pyams_skin/resources/css/myams.min.css
 src/pyams_skin/resources/css/ext/bootstrap-3.3.2.css
@@ -36,13 +41,16 @@
 src/pyams_skin/resources/css/ext/bootstrap.css.map
 src/pyams_skin/resources/css/ext/font-awesome-4.3.0.css
 src/pyams_skin/resources/css/ext/font-awesome-4.3.0.min.css
+src/pyams_skin/resources/css/ext/jquery-datetimepicker.css
+src/pyams_skin/resources/css/ext/jquery-datetimepicker.min.css
 src/pyams_skin/resources/css/ext/jquery-fancybox-2.1.5.css
 src/pyams_skin/resources/css/ext/jquery-fancybox-2.1.5.min.css
 src/pyams_skin/resources/css/ext/jquery-imgareaselect.css
 src/pyams_skin/resources/css/ext/jquery-imgareaselect.min.css
-src/pyams_skin/resources/css/ext/jquery-imgareaselect.min.min.css
 src/pyams_skin/resources/css/ext/jquery-mCustomScrollbar.css
 src/pyams_skin/resources/css/ext/jquery-mCustomScrollbar.min.css
+src/pyams_skin/resources/css/ext/jquery-minicolors.css
+src/pyams_skin/resources/css/ext/jquery-minicolors.min.css
 src/pyams_skin/resources/css/ext/jquery-tipsy.css
 src/pyams_skin/resources/css/ext/jquery-tipsy.min.css
 src/pyams_skin/resources/css/ext/jquery-ui-1.11.2.css
@@ -121,9 +129,10 @@
 src/pyams_skin/resources/js/ext/bootstrap-slider.min.js
 src/pyams_skin/resources/js/ext/jquery-2.1.3.js
 src/pyams_skin/resources/js/ext/jquery-2.1.3.min.js
+src/pyams_skin/resources/js/ext/jquery-color-2.1.2.js
+src/pyams_skin/resources/js/ext/jquery-color-2.1.2.min.js
 src/pyams_skin/resources/js/ext/jquery-dataTables-1.9.4.js
 src/pyams_skin/resources/js/ext/jquery-dataTables-1.9.4.min.js
-src/pyams_skin/resources/js/ext/jquery-dataTables-1.9.4.min.min.js
 src/pyams_skin/resources/js/ext/jquery-dataTables-autoFill.js
 src/pyams_skin/resources/js/ext/jquery-dataTables-autoFill.min.js
 src/pyams_skin/resources/js/ext/jquery-dataTables-colReorder.js
@@ -150,6 +159,8 @@
 src/pyams_skin/resources/js/ext/jquery-dataTables-scroller.min.js
 src/pyams_skin/resources/js/ext/jquery-dataTables-tableTools.js
 src/pyams_skin/resources/js/ext/jquery-dataTables-tableTools.min.js
+src/pyams_skin/resources/js/ext/jquery-datetimepicker.js
+src/pyams_skin/resources/js/ext/jquery-datetimepicker.min.js
 src/pyams_skin/resources/js/ext/jquery-easypiechart.min.js
 src/pyams_skin/resources/js/ext/jquery-fancybox-2.1.5.js
 src/pyams_skin/resources/js/ext/jquery-fancybox-2.1.5.min.js
@@ -165,6 +176,8 @@
 src/pyams_skin/resources/js/ext/jquery-mCustomScrollbar.js
 src/pyams_skin/resources/js/ext/jquery-mCustomScrollbar.min.js
 src/pyams_skin/resources/js/ext/jquery-maskedinput-1.3.1.min.js
+src/pyams_skin/resources/js/ext/jquery-minicolors.js
+src/pyams_skin/resources/js/ext/jquery-minicolors.min.js
 src/pyams_skin/resources/js/ext/jquery-mousewheel.min.js
 src/pyams_skin/resources/js/ext/jquery-plot-0.7.js
 src/pyams_skin/resources/js/ext/jquery-plot-0.7.min.js
@@ -180,6 +193,8 @@
 src/pyams_skin/resources/js/ext/jquery-scrollTo.min.js
 src/pyams_skin/resources/js/ext/jquery-select2-3.5.2.js
 src/pyams_skin/resources/js/ext/jquery-select2-3.5.2.min.js
+src/pyams_skin/resources/js/ext/jquery-select2-sortable.js
+src/pyams_skin/resources/js/ext/jquery-select2-sortable.min.js
 src/pyams_skin/resources/js/ext/jquery-smartclick.js
 src/pyams_skin/resources/js/ext/jquery-smartclick.min.js
 src/pyams_skin/resources/js/ext/jquery-sparkline-2.1.1.min.js
@@ -193,12 +208,638 @@
 src/pyams_skin/resources/js/ext/jquery-ui-1.11.2.min.js
 src/pyams_skin/resources/js/ext/jquery-validate-1.11.1.js
 src/pyams_skin/resources/js/ext/jquery-validate-1.11.1.min.js
+src/pyams_skin/resources/js/ext/jquery-xmlrpc.js
+src/pyams_skin/resources/js/ext/jquery-xmlrpc.min.js
 src/pyams_skin/resources/js/ext/fancybox-helpers/fancybox-buttons.js
 src/pyams_skin/resources/js/ext/fancybox-helpers/fancybox-buttons.min.js
 src/pyams_skin/resources/js/ext/fancybox-helpers/fancybox-media.js
 src/pyams_skin/resources/js/ext/fancybox-helpers/fancybox-media.min.js
 src/pyams_skin/resources/js/ext/fancybox-helpers/fancybox-thumbs.js
 src/pyams_skin/resources/js/ext/fancybox-helpers/fancybox-thumbs.min.js
+src/pyams_skin/resources/js/ext/tinymce/jquery.tinymce.min.js
+src/pyams_skin/resources/js/ext/tinymce/license.txt
+src/pyams_skin/resources/js/ext/tinymce/tinymce.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/jquery.tinymce.js
+src/pyams_skin/resources/js/ext/tinymce/dev/jquery.tinymce.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/jquery.tinymce.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/license.txt
+src/pyams_skin/resources/js/ext/tinymce/dev/tinymce.jquery.js
+src/pyams_skin/resources/js/ext/tinymce/dev/tinymce.jquery.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/tinymce.jquery.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/tinymce.js
+src/pyams_skin/resources/js/ext/tinymce/dev/tinymce.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/tinymce.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/AddOnManager.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/AddOnManager.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/Compat.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/Compat.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/Editor.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/Editor.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/EditorCommands.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/EditorCommands.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/EditorManager.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/EditorManager.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/EditorObservable.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/EditorObservable.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/EnterKey.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/EnterKey.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/Env.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/Env.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/FocusManager.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/FocusManager.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ForceBlocks.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ForceBlocks.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/Formatter.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/Formatter.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/LegacyInput.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/LegacyInput.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/NodeChange.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/NodeChange.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/Shortcuts.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/Shortcuts.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/UndoManager.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/UndoManager.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/WindowManager.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/WindowManager.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/BookmarkManager.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/BookmarkManager.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/ControlSelection.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/ControlSelection.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/DOMUtils.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/DOMUtils.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/DomQuery.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/DomQuery.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/ElementUtils.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/ElementUtils.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/EventUtils.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/EventUtils.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/Range.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/Range.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/RangeUtils.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/RangeUtils.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/ScriptLoader.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/ScriptLoader.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/Selection.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/Selection.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/Serializer.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/Serializer.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/Sizzle.jQuery.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/Sizzle.jQuery.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/Sizzle.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/Sizzle.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/StyleSheetLoader.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/StyleSheetLoader.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/TreeWalker.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/TreeWalker.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/TridentSelection.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/TridentSelection.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/fmt/Preview.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/fmt/Preview.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/DomParser.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/DomParser.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/Entities.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/Entities.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/Node.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/Node.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/SaxParser.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/SaxParser.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/Schema.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/Schema.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/Serializer.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/Serializer.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/Styles.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/Styles.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/Writer.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/Writer.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/AbsoluteLayout.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/AbsoluteLayout.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Button.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Button.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ButtonGroup.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ButtonGroup.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Checkbox.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Checkbox.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Collection.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Collection.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ColorBox.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ColorBox.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ColorButton.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ColorButton.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ColorPicker.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ColorPicker.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ComboBox.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ComboBox.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Container.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Container.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Control.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Control.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/DomUtils.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/DomUtils.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/DragHelper.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/DragHelper.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ElementPath.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ElementPath.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Factory.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Factory.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FieldSet.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FieldSet.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FilePicker.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FilePicker.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FitLayout.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FitLayout.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FlexLayout.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FlexLayout.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FloatPanel.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FloatPanel.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FlowLayout.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FlowLayout.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Form.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Form.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FormItem.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FormItem.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FormatControls.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FormatControls.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/GridLayout.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/GridLayout.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Iframe.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Iframe.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/KeyboardNavigation.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/KeyboardNavigation.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Label.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Label.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Layout.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Layout.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ListBox.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ListBox.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Menu.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Menu.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/MenuBar.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/MenuBar.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/MenuButton.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/MenuButton.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/MenuItem.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/MenuItem.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/MessageBox.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/MessageBox.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Movable.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Movable.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Panel.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Panel.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/PanelButton.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/PanelButton.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Path.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Path.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Radio.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Radio.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Resizable.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Resizable.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ResizeHandle.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ResizeHandle.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Scrollable.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Scrollable.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Selector.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Selector.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Spacer.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Spacer.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/SplitButton.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/SplitButton.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/StackLayout.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/StackLayout.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/TabPanel.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/TabPanel.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/TextBox.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/TextBox.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Throbber.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Throbber.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Toolbar.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Toolbar.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Tooltip.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Tooltip.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Widget.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Widget.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Window.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Window.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/Class.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/Class.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/Color.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/Color.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/EventDispatcher.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/EventDispatcher.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/I18n.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/I18n.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/JSON.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/JSON.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/JSONP.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/JSONP.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/JSONRequest.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/JSONRequest.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/LocalStorage.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/LocalStorage.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/Observable.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/Observable.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/Quirks.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/Quirks.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/Tools.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/Tools.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/URI.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/URI.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/VK.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/VK.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/XHR.js
+src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/XHR.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/langs/fr.js
+src/pyams_skin/resources/js/ext/tinymce/dev/langs/fr.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/langs/readme.md
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/advlist/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/advlist/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/advlist/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/anchor/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/anchor/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/anchor/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/anchor/plugin.min.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/autolink/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/autolink/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/autolink/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/autolink/plugin.min.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/autoresize/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/autoresize/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/autoresize/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/autoresize/plugin.min.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/autosave/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/autosave/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/autosave/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/autosave/plugin.min.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/bbcode/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/bbcode/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/bbcode/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/bbcode/plugin.min.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/charmap/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/charmap/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/charmap/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/code/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/code/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/code/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/colorpicker/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/colorpicker/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/colorpicker/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/plugin.min.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/tiny_mce_popup.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/tiny_mce_popup.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/css/dialog.css
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/css/dialog.min.css
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/img/buttons.png
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/img/icons.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/img/items.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/img/menu_arrow.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/img/menu_check.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/img/progress.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/img/tabs.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/utils/editable_selects.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/utils/editable_selects.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/utils/form_utils.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/utils/form_utils.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/utils/mctabs.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/utils/mctabs.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/utils/validate.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/utils/validate.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/contextmenu/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/contextmenu/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/contextmenu/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/directionality/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/directionality/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/directionality/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-cool.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-cry.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-embarassed.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-foot-in-mouth.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-frown.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-innocent.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-kiss.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-laughing.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-money-mouth.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-sealed.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-smile.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-surprised.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-tongue-out.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-undecided.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-wink.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-yell.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/example/dialog.html
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/example/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/example/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/example/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/example_dependency/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/example_dependency/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/fullpage/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/fullpage/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/fullpage/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/fullscreen/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/fullscreen/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/fullscreen/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/hr/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/hr/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/hr/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/hr/plugin.min.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/image/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/image/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/image/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/importcss/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/importcss/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/importcss/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/insertdatetime/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/insertdatetime/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/insertdatetime/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/insertdatetime/plugin.min.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/layer/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/layer/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/layer/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/legacyoutput/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/legacyoutput/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/legacyoutput/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/link/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/link/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/link/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/lists/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/lists/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/lists/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/media/moxieplayer.swf
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/media/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/media/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/media/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/nonbreaking/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/nonbreaking/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/nonbreaking/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/nonbreaking/plugin.min.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/noneditable/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/noneditable/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/noneditable/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/noneditable/plugin.min.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/pagebreak/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/pagebreak/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/pagebreak/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/pagebreak/plugin.min.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/paste/plugin.dev.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/paste/plugin.dev.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/paste/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/paste/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/paste/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/paste/classes/Clipboard.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/paste/classes/Clipboard.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/paste/classes/Plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/paste/classes/Plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/paste/classes/Quirks.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/paste/classes/Quirks.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/paste/classes/Utils.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/paste/classes/Utils.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/paste/classes/WordFilter.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/paste/classes/WordFilter.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/preview/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/preview/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/preview/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/preview/plugin.min.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/print/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/print/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/print/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/save/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/save/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/save/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/searchreplace/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/searchreplace/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/searchreplace/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/spellchecker/plugin.dev.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/spellchecker/plugin.dev.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/spellchecker/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/spellchecker/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/spellchecker/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/spellchecker/classes/DomTextMatcher.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/spellchecker/classes/DomTextMatcher.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/spellchecker/classes/Plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/spellchecker/classes/Plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/tabfocus/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/tabfocus/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/tabfocus/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/table/plugin.dev.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/table/plugin.dev.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/table/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/table/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/table/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/table/classes/CellSelection.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/table/classes/CellSelection.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/table/classes/Dialogs.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/table/classes/Dialogs.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/table/classes/Plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/table/classes/Plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/table/classes/Quirks.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/table/classes/Quirks.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/table/classes/TableGrid.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/table/classes/TableGrid.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/template/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/template/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/template/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/textcolor/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/textcolor/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/textcolor/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/textpattern/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/textpattern/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/textpattern/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/textpattern/plugin.min.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/plugin.min.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/css/visualblocks.css
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/css/visualblocks.min.css
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/address.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/article.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/aside.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/blockquote.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/div.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/dl.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/figure.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/h1.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/h2.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/h3.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/h4.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/h5.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/h6.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/hgroup.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/ol.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/p.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/pre.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/section.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/ul.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualchars/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualchars/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualchars/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/wordcount/plugin.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/wordcount/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/plugins/wordcount/plugin.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/AbsoluteLayout.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Animations.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Button.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/ButtonGroup.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Checkbox.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/ColorBox.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/ColorButton.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/ColorPicker.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/ComboBox.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Container.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Content.Inline.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Content.Objects.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Content.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/FieldSet.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/FitLayout.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/FloatPanel.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/FlowLayout.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Icons.Ie7.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Icons.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Iframe.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Label.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/ListBox.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Menu.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/MenuBar.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/MenuButton.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/MenuItem.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Mixins.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Panel.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Path.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Radio.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Reset.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/ResizeHandle.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Scrollable.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Spacer.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/SplitButton.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/StackLayout.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/TabPanel.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/TextBox.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Throbber.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/TinyMCE.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/ToolTip.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Variables.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Window.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/content.inline.min.css
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/content.inline.min.min.css
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/content.min.css
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/content.min.min.css
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/skin.dev.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/skin.ie7.dev.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/skin.ie7.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/skin.ie7.min.css
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/skin.ie7.min.min.css
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/skin.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/skin.min.css
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/skin.min.min.css
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/skin.modern.dev.less
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/readme.md
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/tinymce-small.eot
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/tinymce-small.json
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/tinymce-small.svg
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/tinymce-small.ttf
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/tinymce-small.woff
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/tinymce.eot
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/tinymce.json
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/tinymce.svg
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/tinymce.ttf
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/tinymce.woff
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/img/anchor.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/img/loader.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/img/object.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/img/trans.gif
+src/pyams_skin/resources/js/ext/tinymce/dev/themes/modern/theme.js
+src/pyams_skin/resources/js/ext/tinymce/dev/themes/modern/theme.min.js
+src/pyams_skin/resources/js/ext/tinymce/dev/themes/modern/theme.min.min.js
+src/pyams_skin/resources/js/ext/tinymce/langs/fr.js
+src/pyams_skin/resources/js/ext/tinymce/langs/fr.min.js
+src/pyams_skin/resources/js/ext/tinymce/langs/readme.md
+src/pyams_skin/resources/js/ext/tinymce/plugins/advlist/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/anchor/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/autolink/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/autoresize/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/autosave/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/bbcode/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/charmap/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/code/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/colorpicker/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/contextmenu/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/directionality/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-cool.gif
+src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-cry.gif
+src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-embarassed.gif
+src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-foot-in-mouth.gif
+src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-frown.gif
+src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-innocent.gif
+src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-kiss.gif
+src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-laughing.gif
+src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-money-mouth.gif
+src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-sealed.gif
+src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-smile.gif
+src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-surprised.gif
+src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-tongue-out.gif
+src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-undecided.gif
+src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-wink.gif
+src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-yell.gif
+src/pyams_skin/resources/js/ext/tinymce/plugins/example/dialog.html
+src/pyams_skin/resources/js/ext/tinymce/plugins/example/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/example_dependency/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/fullpage/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/fullscreen/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/hr/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/image/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/importcss/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/insertdatetime/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/layer/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/legacyoutput/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/link/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/lists/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/media/moxieplayer.swf
+src/pyams_skin/resources/js/ext/tinymce/plugins/media/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/nonbreaking/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/noneditable/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/pagebreak/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/paste/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/preview/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/print/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/save/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/searchreplace/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/spellchecker/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/tabfocus/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/table/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/template/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/textcolor/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/textpattern/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/visualblocks/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/visualblocks/css/visualblocks.css
+src/pyams_skin/resources/js/ext/tinymce/plugins/visualblocks/css/visualblocks.min.css
+src/pyams_skin/resources/js/ext/tinymce/plugins/visualchars/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/plugins/wordcount/plugin.min.js
+src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/content.inline.min.css
+src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/content.inline.min.min.css
+src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/content.min.css
+src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/content.min.min.css
+src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/skin.ie7.min.css
+src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/skin.ie7.min.min.css
+src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/skin.min.css
+src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/skin.min.min.css
+src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/fonts/tinymce-small.eot
+src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/fonts/tinymce-small.svg
+src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/fonts/tinymce-small.ttf
+src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/fonts/tinymce-small.woff
+src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/fonts/tinymce.eot
+src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/fonts/tinymce.svg
+src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/fonts/tinymce.ttf
+src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/fonts/tinymce.woff
+src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/img/anchor.gif
+src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/img/loader.gif
+src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/img/object.gif
+src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/img/trans.gif
+src/pyams_skin/resources/js/ext/tinymce/themes/modern/theme.min.js
 src/pyams_skin/resources/js/i18n/myams_fr.js
 src/pyams_skin/resources/js/i18n/myams_fr.min.js
 src/pyams_skin/resources/less/anims.less
@@ -235,6 +876,7 @@
 src/pyams_skin/templates/layout.pt
 src/pyams_skin/templates/modal-layout.pt
 src/pyams_skin/templates/table.pt
+src/pyams_skin/templates/widget-layout.pt
 src/pyams_skin/tests/__init__.py
 src/pyams_skin/tests/test_utilsdocs.py
 src/pyams_skin/tests/test_utilsdocstrings.py
--- a/src/pyams_skin.egg-info/requires.txt	Wed May 20 15:01:45 2015 +0200
+++ b/src/pyams_skin.egg-info/requires.txt	Wed Jun 17 10:00:10 2015 +0200
@@ -1,5 +1,6 @@
 setuptools
 fanstatic
+pyams_file
 pyams_utils
 pyams_viewlet
 pyramid
--- a/src/pyams_skin/configuration.py	Wed May 20 15:01:45 2015 +0200
+++ b/src/pyams_skin/configuration.py	Wed Jun 17 10:00:10 2015 +0200
@@ -17,8 +17,9 @@
 import pkg_resources
 
 # import interfaces
-from pyams_skin.interfaces.configuration import IStaticConfiguration, IConfiguration, SKIN_CONFIGURATION_KEY
-from pyams_utils.interfaces.site import IConfigurationManager, IConfigurationFactory
+from pyams_skin.interfaces.configuration import IStaticConfiguration, IConfiguration, \
+    SKIN_CONFIGURATION_KEY
+from pyams_utils.interfaces.site import IStaticConfigurationManager, IConfigurationManager, IConfigurationFactory
 from pyams_utils.interfaces.tales import ITALESExtension
 from zope.annotation.interfaces import IAnnotations
 from zope.traversing.interfaces import ITraversable
@@ -40,7 +41,7 @@
 from pyams_skin import _
 
 
-@adapter_config(context=(Interface, Interface, Interface), provides=IStaticConfiguration)
+@adapter_config(context=(IStaticConfigurationManager, Interface, Interface), provides=IStaticConfiguration)
 class StaticConfiguration(object):
     """Default static configuration"""
 
@@ -83,8 +84,9 @@
     def render(self, context=None):
         if context is None:
             context = self.context
+        target = get_parent(context, IStaticConfigurationManager)
         registry = self.request.registry
-        return registry.queryMultiAdapter((context, self.request, self.view), IStaticConfiguration)
+        return registry.queryMultiAdapter((target, self.request, self.view), IStaticConfiguration)
 
 
 @implementer(IConfiguration)
--- a/src/pyams_skin/configure.zcml	Wed May 20 15:01:45 2015 +0200
+++ b/src/pyams_skin/configure.zcml	Wed Jun 17 10:00:10 2015 +0200
@@ -27,6 +27,11 @@
 		layer=".layer.IPyAMSLayer" />
 
 	<pyams:layout
+		template="templates/widget-layout.pt"
+		for=".interfaces.IWidgetInnerPage"
+		layer=".layer.IPyAMSLayer" />
+
+	<pyams:layout
 		template="templates/modal-layout.pt"
 		for=".interfaces.IModalPage"
 		layer=".layer.IPyAMSLayer" />
--- a/src/pyams_skin/interfaces/__init__.py	Wed May 20 15:01:45 2015 +0200
+++ b/src/pyams_skin/interfaces/__init__.py	Wed Jun 17 10:00:10 2015 +0200
@@ -77,6 +77,10 @@
     """Inner page marker interface"""
 
 
+class IWidgetInnerPage(IInnerPage):
+    """Inner page with widget marker interface"""
+
+
 class IModalPage(Interface):
     """Modal page marker interface"""
 
@@ -102,8 +106,16 @@
 
     title = TextLine(title='Page title')
 
+    title_badge = TextLine(title="Title badge")
+
+    title_badge_class = TextLine(title="Title badge class")
+
     subtitle = TextLine(title='Page sub-title')
 
+    subtitle_badge = TextLine(title="Sub-title badge")
+
+    subtitle_badge_class = TextLine(title="Sub-title badge class")
+
 
 class IContentHelp(Interface):
     """Content help block"""
@@ -122,6 +134,12 @@
                             vocabulary='PyAMS HTML renderers')
 
 
+class IContentTitle(Interface):
+    """Content title interface"""
+
+    title = Attribute("Content title")
+
+
 class IContentSearch(Interface):
     """Content search interface"""
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/interfaces/tinymce.py	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,27 @@
+#
+# Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net>
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+
+__docformat__ = 'restructuredtext'
+
+
+# import standard library
+
+# import interfaces
+
+# import packages
+from zope.interface import Interface, Attribute
+
+
+class ITinyMCEConfiguration(Interface):
+    """TinyMCE plug-in configuration"""
+
+    configuration = Attribute("TinyMCE editor configuration")
--- a/src/pyams_skin/interfaces/viewlet.py	Wed May 20 15:01:45 2015 +0200
+++ b/src/pyams_skin/interfaces/viewlet.py	Wed Jun 17 10:00:10 2015 +0200
@@ -117,7 +117,7 @@
 
     icon_class = TextLine(title="Shortcut icon class")
 
-    label = Attribute("Shortcut title")
+    label = TextLine(title="Shortcut title")
 
     url = TextLine(title="Shortcut target URL")
 
@@ -247,6 +247,14 @@
 
 
 #
+# Widget title extensions viewlet manager
+#
+
+class IWidgetTitleViewletManager(IViewletManager):
+    """Widget title viewlet manager"""
+
+
+#
 # Toolbar viewlet manager
 #
 
@@ -318,4 +326,4 @@
     """Context actions viewlet manager"""
 
     css_class = TextLine(title="Button CSS class",
-                         default='btn btn-xs btn-primary dropdown-toggle')
+                         default='btn btn-xs btn-default dropdown-toggle')
Binary file src/pyams_skin/locales/fr/LC_MESSAGES/pyams_skin.mo has changed
--- a/src/pyams_skin/locales/fr/LC_MESSAGES/pyams_skin.po	Wed May 20 15:01:45 2015 +0200
+++ b/src/pyams_skin/locales/fr/LC_MESSAGES/pyams_skin.po	Wed Jun 17 10:00:10 2015 +0200
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE 1.0\n"
-"POT-Creation-Date: 2015-03-03 16:35+0100\n"
+"POT-Creation-Date: 2015-06-01 14:43+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -15,41 +15,61 @@
 "Content-Transfer-Encoding: 8bit\n"
 "Generated-By: Lingua 3.8\n"
 
-#: src/pyams_skin/configuration.py:50 src/pyams_skin/configuration.py:53
-#: src/pyams_skin/interfaces/configuration.py:59
-#: src/pyams_skin/interfaces/configuration.py:71
+#: src/pyams_skin/configuration.py:54 src/pyams_skin/configuration.py:57
+#: src/pyams_skin/interfaces/configuration.py:60
+#: src/pyams_skin/interfaces/configuration.py:72
 msgid "Search..."
 msgstr "Rechercher..."
 
-#: src/pyams_skin/table.py:60
+#: src/pyams_skin/table.py:62
 msgid "Container elements"
 msgstr "Contenu"
 
-#: src/pyams_skin/table.py:139
+#: src/pyams_skin/table.py:149
 msgid "Name"
 msgstr "Nom"
 
-#: src/pyams_skin/table.py:149
+#: src/pyams_skin/table.py:171
 msgid "Properties"
 msgstr "Propriétés"
 
-#: src/pyams_skin/table.py:187
+#: src/pyams_skin/table.py:219
+msgid "Actions"
+msgstr "Actions"
+
+#: src/pyams_skin/table.py:240
 msgid "Delete object"
 msgstr "Supprimer l'objet"
 
+#: src/pyams_skin/page.py:75
+msgid "< subtitle >"
+msgstr "< sous-titre >"
+
 #: src/pyams_skin/skin.py:38
 msgid "Default PyAMS skin"
 msgstr "Skin PyAMS par défaut"
 
-#: src/pyams_skin/templates/layout.pt:63
+#: src/pyams_skin/container.py:57
+msgid "No provided object_name argument!"
+msgstr "Argument 'object_name' non fourni !"
+
+#: src/pyams_skin/container.py:61
+msgid "Given plug-in name doesn't exist!"
+msgstr "Le plug-in indiqué n'existe pas !"
+
+#: src/pyams_skin/templates/header.pt:5
+msgid "Back to previous page"
+msgstr "Revenir à la page précédente"
+
+#: src/pyams_skin/templates/layout.pt:62
 msgid "Hide menu"
 msgstr "Masquer le menu"
 
-#: src/pyams_skin/templates/layout.pt:72
+#: src/pyams_skin/templates/layout.pt:71
 msgid "Logout"
 msgstr "Déconnexion"
 
-#: src/pyams_skin/templates/layout.pt:162
+#: src/pyams_skin/templates/layout.pt:164
 msgid ""
 "&lt;span&gt;&lt;i class=&#39;text-warning fa fa-warning&#39;&gt;&lt;/i&gt; "
 "WARNING: this will reset all your widgets status!&lt;/span&gt;"
@@ -62,10 +82,14 @@
 msgid "Management interface"
 msgstr "Panneau de configuration"
 
-#: src/pyams_skin/viewlet/toolbar/__init__.py:92
+#: src/pyams_skin/viewlet/toolbar/__init__.py:98
 msgid "Add..."
 msgstr "Ajouter..."
 
+#: src/pyams_skin/viewlet/toolbar/__init__.py:107
+msgid "Actions..."
+msgstr "Actions..."
+
 #: src/pyams_skin/viewlet/activity/__init__.py:43
 #, python-format
 msgid "Last update: {0}"
@@ -77,30 +101,42 @@
 "&lt;i class=&#39;fa fa-refresh fa-spin&#39;&gt;&lt;/i&gt; Chargement en "
 "cours..."
 
-#: src/pyams_skin/interfaces/configuration.py:123
+#: src/pyams_skin/interfaces/configuration.py:124
 msgid "Title"
 msgstr "Titre"
 
-#: src/pyams_skin/interfaces/configuration.py:124
+#: src/pyams_skin/interfaces/configuration.py:125
 msgid "Application title displayed in title bar"
 msgstr "Titre de l'application affiché dans la barre de menu"
 
-#: src/pyams_skin/interfaces/configuration.py:127
+#: src/pyams_skin/interfaces/configuration.py:128
 msgid "Description"
 msgstr "Description"
 
-#: src/pyams_skin/interfaces/configuration.py:128
+#: src/pyams_skin/interfaces/configuration.py:129
 msgid "Main application description"
 msgstr "Description principale de l'application ou du site"
 
-#: src/pyams_skin/interfaces/configuration.py:131
+#: src/pyams_skin/interfaces/configuration.py:132
 msgid "Author"
 msgstr "Auteur"
 
-#: src/pyams_skin/interfaces/configuration.py:132
+#: src/pyams_skin/interfaces/configuration.py:133
 msgid "Public author name"
 msgstr "Nom public de l'auteur"
 
+#: src/pyams_skin/interfaces/configuration.py:137
+msgid "Browser favourite icon"
+msgstr "Icône des favoris"
+
+#: src/pyams_skin/interfaces/configuration.py:140
+msgid "Logo"
+msgstr "Logo"
+
+#: src/pyams_skin/interfaces/configuration.py:141
+msgid "Image containing application logo"
+msgstr "Image contenant le logo de l'application ou du site"
+
 #: src/pyams_skin/interfaces/__init__.py:61
 msgid "Presentation skin"
 msgstr "Modèle de présentation"
--- a/src/pyams_skin/locales/pyams_skin.pot	Wed May 20 15:01:45 2015 +0200
+++ b/src/pyams_skin/locales/pyams_skin.pot	Wed Jun 17 10:00:10 2015 +0200
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE 1.0\n"
-"POT-Creation-Date: 2015-03-03 16:35+0100\n"
+"POT-Creation-Date: 2015-06-01 14:43+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -16,41 +16,61 @@
 "Content-Transfer-Encoding: 8bit\n"
 "Generated-By: Lingua 3.10.dev0\n"
 
-#: ./src/pyams_skin/configuration.py:50 ./src/pyams_skin/configuration.py:53
-#: ./src/pyams_skin/interfaces/configuration.py:59
-#: ./src/pyams_skin/interfaces/configuration.py:71
+#: ./src/pyams_skin/configuration.py:54 ./src/pyams_skin/configuration.py:57
+#: ./src/pyams_skin/interfaces/configuration.py:60
+#: ./src/pyams_skin/interfaces/configuration.py:72
 msgid "Search..."
 msgstr ""
 
-#: ./src/pyams_skin/table.py:60
+#: ./src/pyams_skin/table.py:62
 msgid "Container elements"
 msgstr ""
 
-#: ./src/pyams_skin/table.py:139
+#: ./src/pyams_skin/table.py:149
 msgid "Name"
 msgstr ""
 
-#: ./src/pyams_skin/table.py:149
+#: ./src/pyams_skin/table.py:171
 msgid "Properties"
 msgstr ""
 
-#: ./src/pyams_skin/table.py:187
+#: ./src/pyams_skin/table.py:219
+msgid "Actions"
+msgstr ""
+
+#: ./src/pyams_skin/table.py:240
 msgid "Delete object"
 msgstr ""
 
+#: ./src/pyams_skin/page.py:75
+msgid "< subtitle >"
+msgstr ""
+
 #: ./src/pyams_skin/skin.py:38
 msgid "Default PyAMS skin"
 msgstr ""
 
-#: ./src/pyams_skin/templates/layout.pt:63
+#: ./src/pyams_skin/container.py:57
+msgid "No provided object_name argument!"
+msgstr ""
+
+#: ./src/pyams_skin/container.py:61
+msgid "Given plug-in name doesn't exist!"
+msgstr ""
+
+#: ./src/pyams_skin/templates/header.pt:5
+msgid "Back to previous page"
+msgstr ""
+
+#: ./src/pyams_skin/templates/layout.pt:62
 msgid "Hide menu"
 msgstr ""
 
-#: ./src/pyams_skin/templates/layout.pt:72
+#: ./src/pyams_skin/templates/layout.pt:71
 msgid "Logout"
 msgstr ""
 
-#: ./src/pyams_skin/templates/layout.pt:162
+#: ./src/pyams_skin/templates/layout.pt:164
 msgid ""
 "&lt;span&gt;&lt;i class=&#39;text-warning fa fa-warning&#39;&gt;&lt;/i&gt; "
 "WARNING: this will reset all your widgets status!&lt;/span&gt;"
@@ -60,10 +80,14 @@
 msgid "Management interface"
 msgstr ""
 
-#: ./src/pyams_skin/viewlet/toolbar/__init__.py:92
+#: ./src/pyams_skin/viewlet/toolbar/__init__.py:98
 msgid "Add..."
 msgstr ""
 
+#: ./src/pyams_skin/viewlet/toolbar/__init__.py:107
+msgid "Actions..."
+msgstr ""
+
 #: ./src/pyams_skin/viewlet/activity/__init__.py:43
 #, python-format
 msgid "Last update: {0}"
@@ -73,30 +97,42 @@
 msgid "&lt;i class=&#39;fa fa-refresh fa-spin&#39;&gt;&lt;/i&gt; Loading..."
 msgstr ""
 
-#: ./src/pyams_skin/interfaces/configuration.py:123
+#: ./src/pyams_skin/interfaces/configuration.py:124
 msgid "Title"
 msgstr ""
 
-#: ./src/pyams_skin/interfaces/configuration.py:124
+#: ./src/pyams_skin/interfaces/configuration.py:125
 msgid "Application title displayed in title bar"
 msgstr ""
 
-#: ./src/pyams_skin/interfaces/configuration.py:127
+#: ./src/pyams_skin/interfaces/configuration.py:128
 msgid "Description"
 msgstr ""
 
-#: ./src/pyams_skin/interfaces/configuration.py:128
+#: ./src/pyams_skin/interfaces/configuration.py:129
 msgid "Main application description"
 msgstr ""
 
-#: ./src/pyams_skin/interfaces/configuration.py:131
+#: ./src/pyams_skin/interfaces/configuration.py:132
 msgid "Author"
 msgstr ""
 
-#: ./src/pyams_skin/interfaces/configuration.py:132
+#: ./src/pyams_skin/interfaces/configuration.py:133
 msgid "Public author name"
 msgstr ""
 
+#: ./src/pyams_skin/interfaces/configuration.py:137
+msgid "Browser favourite icon"
+msgstr ""
+
+#: ./src/pyams_skin/interfaces/configuration.py:140
+msgid "Logo"
+msgstr ""
+
+#: ./src/pyams_skin/interfaces/configuration.py:141
+msgid "Image containing application logo"
+msgstr ""
+
 #: ./src/pyams_skin/interfaces/__init__.py:61
 msgid "Presentation skin"
 msgstr ""
--- a/src/pyams_skin/page.py	Wed May 20 15:01:45 2015 +0200
+++ b/src/pyams_skin/page.py	Wed Jun 17 10:00:10 2015 +0200
@@ -16,12 +16,13 @@
 # import standard library
 
 # import interfaces
-from pyams_skin.interfaces import IInnerPage, IModalPage, IPageHeader
+from pyams_skin.interfaces import IInnerPage, IModalPage, IPageHeader, IContentTitle
 from pyams_skin.layer import IPyAMSLayer
 
 # import packages
 from pyams_pagelet.pagelet import pagelet_config
 from pyams_template.template import template_config
+from pyams_utils.adapter import ContextRequestViewAdapter
 from pyams_viewlet.viewlet import contentprovider_config
 from zope.interface import implementer, Interface
 
@@ -52,3 +53,27 @@
     def update(self):
         registry = self.request.registry
         self.header = registry.queryMultiAdapter((self.context, self.request, self.view), IPageHeader)
+
+
+class DefaultPageHeaderAdapter(ContextRequestViewAdapter):
+    """Default page header adapter"""
+
+    back_url = None
+    back_target = None
+
+    icon_class = 'fa fa-fw'
+
+    @property
+    def title(self):
+        adapter = self.request.registry.queryMultiAdapter((self.context, self.request, self.view), IContentTitle)
+        if adapter is None:
+            adapter = IContentTitle(self.context, None)
+        if adapter is not None:
+            return adapter.title
+
+    title_badge = None
+    title_badge_class = 'badge inbox-badge bg-color-red'
+
+    subtitle = None
+    subtitle_badge = None
+    subtitle_badge_class = 'badge inbox-badge bg-color-red'
--- a/src/pyams_skin/resources/css/myams.css	Wed May 20 15:01:45 2015 +0200
+++ b/src/pyams_skin/resources/css/myams.css	Wed Jun 17 10:00:10 2015 +0200
@@ -5257,7 +5257,7 @@
   margin: 0;
   display: none;
   background: rgba(91, 103, 113, 0.8);
-  padding: 7px 0;
+  padding: 2px 0;
 }
 nav ul ul > li:hover b {
   color: #D5D9E2;
@@ -5266,6 +5266,11 @@
   margin: 0;
   padding: 0;
 }
+nav ul ul li.divider {
+  height: 1px;
+  margin-left: 30px;
+  padding: 0;
+}
 nav ul ul li > a {
   padding-left: 42px;
   font-size: 12px;
@@ -7378,6 +7383,11 @@
   padding: 4px 8px!important;
   line-height: 1.3!important;
 }
+.table-small td,
+.table-small th {
+  padding: 2px 8px!important;
+  line-height: 1.2!important;
+}
 .table-mini td,
 .table-mini th {
   padding: 1px 8px!important;
@@ -8684,6 +8694,10 @@
 .ams-form .form-group {
   padding: 5px 10px;
 }
+.ams-form.form-tight .form-group,
+.ams-form .form-tight .form-group {
+  padding: 1px 10px;
+}
 .ams-form label.checkbox,
 .ams-form label.radio {
   padding-top: 0;
@@ -9114,6 +9128,23 @@
   height: 14px;
   line-height: 1em;
 }
+.ams-form .input span.textarea-widget,
+.ams-form .textarea span.textarea-widget {
+  display: block;
+  width: 100%;
+  min-height: 14px;
+  padding: 4px 0;
+  border-bottom: 1px solid #ccc!important;
+}
+.ams-form .input .i18n-content input[readonly],
+.ams-form .select .i18n-content select[readonly],
+.ams-form .textarea .i18n-content textarea[readonly] {
+  border-width: 0!important;
+}
+.ams-form .input .i18n-content .textarea-widget {
+  display: block;
+  min-height: 12px;
+}
 .ams-form .input input:focus + .tooltip,
 .ams-form .textarea textarea:focus + .tooltip {
   opacity: 1;
@@ -10343,6 +10374,9 @@
   padding: 6px 4px 3px;
   border: 1px solid #fff;
 }
+.mce-edit-area > iframe {
+  min-height: 400px!important;
+}
 .client-form header {
   padding: 15px 13px;
   margin: 0;
@@ -10924,6 +10958,10 @@
   margin-left: 10px;
   float: left;
 }
+.ams-widget > header > h2 + .btn,
+.ams-widget > header > h2 + .btn-group {
+  margin-left: 20px;
+}
 .rtl .ams-widget > header {
   padding: 0 7px 0 0;
 }
@@ -10964,12 +11002,12 @@
   margin: 0;
   padding: 13px 13px 0;
   background-color: #fff !important;
-  border-width: 1px 1px 2px;
+  border-width: 1px;
   border-style: solid;
+  border-color: #ccc!important;
+}
+.ams-widget > header + div {
   border-top: 0;
-  border-right-color: #CCC !important;
-  border-bottom-color: #CCC !important;
-  border-left-color: #CCC !important;
 }
 .ams-widget .widget-body {
   position: relative;
@@ -11940,7 +11978,7 @@
 }
 .select2-container-multi .select2-choices .select2-search-choice {
   padding: 1px 28px 1px 8px;
-  margin: 2px 0 2px 2px;
+  margin: 2px;
   position: relative;
   line-height: 18px;
   color: #fff;
@@ -11965,8 +12003,12 @@
 .select2-container-multi .select2-choices .select2-search-choice.ui-sortable-handle {
   cursor: move;
 }
+.with-icons .select2-container-multi .select2-choices .select2-search-choice.ui-sortable-handle {
+  margin-right: 1px;
+}
 .select2-container-multi.ordered .select2-choices li {
   float: none;
+  cursor: move;
 }
 .select2-container-multi.ordered .select2-choices li.ui-state-highlight {
   margin: 2px 0 2px 2px;
@@ -12065,7 +12107,7 @@
   overflow: hidden;
   padding: 0;
 }
-label.with-icon > i.icon-append + .select2-parent .select2-choices {
+label.with-icon > i.icon-append + .select2-parent > .select2-choices {
   padding-right: 29px;
 }
 .multiselect-container {
@@ -15124,6 +15166,7 @@
   position: fixed;
   width: 100%;
   height: 100%;
+  z-index: 990;
 }
 .modal-dialog.modal-max {
   width: 98%;
@@ -15147,6 +15190,9 @@
     max-width: 450px;
   }
 }
+.modal-dialog .modal-body .modal-viewport {
+  min-height: 140px;
+}
 .modal-dialog .suffix .alert {
   margin-bottom: 0;
   border-radius: 0 0 5px 5px;
--- a/src/pyams_skin/resources/css/myams.min.css	Wed May 20 15:01:45 2015 +0200
+++ b/src/pyams_skin/resources/css/myams.min.css	Wed Jun 17 10:00:10 2015 +0200
@@ -1,1 +1,1 @@
-.txt-color-blue{color:#60747c!important}.txt-color-blueLight{color:#ccdadf!important}.txt-color-blueDark{color:#4c4f53!important}.txt-color-green{color:#356e35!important}.txt-color-greenLight{color:#71843f!important}.txt-color-greenDark{color:#496949!important}.txt-color-red{color:#931313!important}.txt-color-yellow{color:#d4c737!important}.txt-color-yellowLight{color:#fff03d!important}.txt-color-orange{color:#c79121!important}.txt-color-orangeLight{color:#ee9000!important}.txt-color-orangeDark{color:#a57225!important}.txt-color-pink{color:#ac5287!important}.txt-color-pinkDark{color:#a8829f!important}.txt-color-purple{color:#65596b!important}.txt-color-darken{color:#404040!important}.txt-color-silver{color:#b4b4b4!important}.txt-color-lighten{color:#d5e7ec!important}.txt-color-white{color:#dedede!important}.txt-color-grayDark{color:#525252!important}.txt-color-magenta{color:#6e3671!important}.txt-color-teal{color:#568a89!important}.txt-color-redLight{color:#a65858!important}.txt-color-active{color:#3276b1!important}.txt-color-activeBg{color:#cedbf7!important}.bg-color-blue{background-color:#60747c!important}.bg-color-blueLight{background-color:#ccdadf!important}.bg-color-blueDark{background-color:#4c4f53!important}.bg-color-green{background-color:#356e35!important}.bg-color-greenLight{background-color:#71843f!important}.bg-color-greenDark{background-color:#496949!important}.bg-color-red{background-color:#931313!important}.bg-color-yellow{background-color:#d4c737!important}.bg-color-yellowLight{background-color:#fff03d!important}.bg-color-orange{background-color:#c79121!important}.bg-color-orangeLight{background-color:#ee9000!important}.bg-color-orangeDark{background-color:#a57225!important}.bg-color-pink{background-color:#ac5287!important}.bg-color-pinkDark{background-color:#a8829f!important}.bg-color-purple{background-color:#65596b!important}.bg-color-darken{background-color:#404040!important}.bg-color-silver{background-color:#b4b4b4!important}.bg-color-lighten{background-color:#d5e7ec!important}.bg-color-white{background-color:#dedede!important}.bg-color-grayDark{background-color:#525252!important}.bg-color-magenta{background-color:#6e3671!important}.bg-color-teal{background-color:#568a89!important}.bg-color-redLight{background-color:#a65858!important}.bg-color-active{background-color:#3276b1!important}.bg-color-activeBg{background-color:#cedbf7!important}@-webkit-keyframes flash{0%,100%,50%{opacity:1}25%,75%{opacity:0}}@keyframes flash{0%,100%,50%{opacity:1}25%,75%{opacity:0}}@-webkit-keyframes shake{0%,100%{-webkit-transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px)}}@keyframes shake{0%,100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);-ms-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);-ms-transform:translateX(10px);transform:translateX(10px)}}@-webkit-keyframes bounce{0%,100%,20%,50%,80%{-webkit-transform:translateY(0)}40%{-webkit-transform:translateY(-30px)}60%{-webkit-transform:translateY(-15px)}}@keyframes bounce{0%,100%,20%,50%,80%{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}40%{-webkit-transform:translateY(-30px);-ms-transform:translateY(-30px);transform:translateY(-30px)}60%{-webkit-transform:translateY(-15px);-ms-transform:translateY(-15px);transform:translateY(-15px)}}@-webkit-keyframes tada{0%{-webkit-transform:scale(1)}10%,20%{-webkit-transform:scale(0.9) rotate(-3deg)}30%,50%,70%,90%{-webkit-transform:scale(1.1) rotate(3deg)}40%,60%,80%{-webkit-transform:scale(1.1) rotate(-3deg)}100%{-webkit-transform:scale(1) rotate(0)}}@keyframes tada{0%{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}10%,20%{-webkit-transform:scale(0.9) rotate(-3deg);-ms-transform:scale(0.9) rotate(-3deg);transform:scale(0.9) rotate(-3deg)}30%,50%,70%,90%{-webkit-transform:scale(1.1) rotate(3deg);-ms-transform:scale(1.1) rotate(3deg);transform:scale(1.1) rotate(3deg)}40%,60%,80%{-webkit-transform:scale(1.1) rotate(-3deg);-ms-transform:scale(1.1) rotate(-3deg);transform:scale(1.1) rotate(-3deg)}100%{-webkit-transform:scale(1) rotate(0);-ms-transform:scale(1) rotate(0);transform:scale(1) rotate(0)}}@-webkit-keyframes swing{100%,20%,40%,60%,80%{-webkit-transform-origin:top center}20%{-webkit-transform:rotate(15deg)}40%{-webkit-transform:rotate(-10deg)}60%{-webkit-transform:rotate(5deg)}80%{-webkit-transform:rotate(-5deg)}100%{-webkit-transform:rotate(0deg)}}@keyframes swing{20%{-webkit-transform:rotate(15deg);-ms-transform:rotate(15deg);transform:rotate(15deg)}40%{-webkit-transform:rotate(-10deg);-ms-transform:rotate(-10deg);transform:rotate(-10deg)}60%{-webkit-transform:rotate(5deg);-ms-transform:rotate(5deg);transform:rotate(5deg)}80%{-webkit-transform:rotate(-5deg);-ms-transform:rotate(-5deg);transform:rotate(-5deg)}100%{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg)}}@-webkit-keyframes wobble{0%{-webkit-transform:translateX(0)}15%{-webkit-transform:translateX(-25%) rotate(-5deg)}30%{-webkit-transform:translateX(20%) rotate(3deg)}45%{-webkit-transform:translateX(-15%) rotate(-3deg)}60%{-webkit-transform:translateX(10%) rotate(2deg)}75%{-webkit-transform:translateX(-5%) rotate(-1deg)}100%{-webkit-transform:translateX(0)}}@keyframes wobble{0%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}15%{-webkit-transform:translateX(-25%) rotate(-5deg);-ms-transform:translateX(-25%) rotate(-5deg);transform:translateX(-25%) rotate(-5deg)}30%{-webkit-transform:translateX(20%) rotate(3deg);-ms-transform:translateX(20%) rotate(3deg);transform:translateX(20%) rotate(3deg)}45%{-webkit-transform:translateX(-15%) rotate(-3deg);-ms-transform:translateX(-15%) rotate(-3deg);transform:translateX(-15%) rotate(-3deg)}60%{-webkit-transform:translateX(10%) rotate(2deg);-ms-transform:translateX(10%) rotate(2deg);transform:translateX(10%) rotate(2deg)}75%{-webkit-transform:translateX(-5%) rotate(-1deg);-ms-transform:translateX(-5%) rotate(-1deg);transform:translateX(-5%) rotate(-1deg)}100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes pulse{0%{-webkit-transform:scale(1)}50%{-webkit-transform:scale(1.1)}100%{-webkit-transform:scale(1)}}@keyframes pulse{0%{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.1);-ms-transform:scale(1.1);transform:scale(1.1)}100%{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}@-webkit-keyframes flip{0%{-webkit-transform:perspective(400px) translateZ(0) rotateY(0) scale(1);-webkit-animation-timing-function:ease-out}40%{-webkit-transform:perspective(400px) translateZ(150px) rotateY(170deg) scale(1);-webkit-animation-timing-function:ease-out}50%{-webkit-transform:perspective(400px) translateZ(150px) rotateY(190deg) scale(1);-webkit-animation-timing-function:ease-in}80%{-webkit-transform:perspective(400px) translateZ(0) rotateY(360deg) scale(0.95);-webkit-animation-timing-function:ease-in}100%{-webkit-transform:perspective(400px) translateZ(0) rotateY(360deg) scale(1);-webkit-animation-timing-function:ease-in}}@keyframes flip{0%{-webkit-transform:perspective(400px) translateZ(0) rotateY(0) scale(1);-ms-transform:perspective(400px) translateZ(0) rotateY(0) scale(1);transform:perspective(400px) translateZ(0) rotateY(0) scale(1);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}40%{-webkit-transform:perspective(400px) translateZ(150px) rotateY(170deg) scale(1);-ms-transform:perspective(400px) translateZ(150px) rotateY(170deg) scale(1);transform:perspective(400px) translateZ(150px) rotateY(170deg) scale(1);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}50%{-webkit-transform:perspective(400px) translateZ(150px) rotateY(190deg) scale(1);-ms-transform:perspective(400px) translateZ(150px) rotateY(190deg) scale(1);transform:perspective(400px) translateZ(150px) rotateY(190deg) scale(1);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}80%{-webkit-transform:perspective(400px) translateZ(0) rotateY(360deg) scale(0.95);-ms-transform:perspective(400px) translateZ(0) rotateY(360deg) scale(0.95);transform:perspective(400px) translateZ(0) rotateY(360deg) scale(0.95);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}100%{-webkit-transform:perspective(400px) translateZ(0) rotateY(360deg) scale(1);-ms-transform:perspective(400px) translateZ(0) rotateY(360deg) scale(1);transform:perspective(400px) translateZ(0) rotateY(360deg) scale(1);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}}@-webkit-keyframes flipInX{0%{-webkit-transform:perspective(400px) rotateX(90deg);opacity:0}40%{-webkit-transform:perspective(400px) rotateX(-10deg)}70%{-webkit-transform:perspective(400px) rotateX(10deg)}100%{-webkit-transform:perspective(400px) rotateX(0deg);opacity:1}}@keyframes flipInX{0%{-webkit-transform:perspective(400px) rotateX(90deg);-ms-transform:perspective(400px) rotateX(90deg);transform:perspective(400px) rotateX(90deg);opacity:0}40%{-webkit-transform:perspective(400px) rotateX(-10deg);-ms-transform:perspective(400px) rotateX(-10deg);transform:perspective(400px) rotateX(-10deg)}70%{-webkit-transform:perspective(400px) rotateX(10deg);-ms-transform:perspective(400px) rotateX(10deg);transform:perspective(400px) rotateX(10deg)}100%{-webkit-transform:perspective(400px) rotateX(0deg);-ms-transform:perspective(400px) rotateX(0deg);transform:perspective(400px) rotateX(0deg);opacity:1}}@-webkit-keyframes flipOutX{0%{-webkit-transform:perspective(400px) rotateX(0deg);opacity:1}100%{-webkit-transform:perspective(400px) rotateX(90deg);opacity:0}}@keyframes flipOutX{0%{-webkit-transform:perspective(400px) rotateX(0deg);-ms-transform:perspective(400px) rotateX(0deg);transform:perspective(400px) rotateX(0deg);opacity:1}100%{-webkit-transform:perspective(400px) rotateX(90deg);-ms-transform:perspective(400px) rotateX(90deg);transform:perspective(400px) rotateX(90deg);opacity:0}}@-webkit-keyframes flipInY{0%{-webkit-transform:perspective(400px) rotateY(90deg);opacity:0}40%{-webkit-transform:perspective(400px) rotateY(-10deg)}70%{-webkit-transform:perspective(400px) rotateY(10deg)}100%{-webkit-transform:perspective(400px) rotateY(0deg);opacity:1}}@keyframes flipInY{0%{-webkit-transform:perspective(400px) rotateY(90deg);-ms-transform:perspective(400px) rotateY(90deg);transform:perspective(400px) rotateY(90deg);opacity:0}40%{-webkit-transform:perspective(400px) rotateY(-10deg);-ms-transform:perspective(400px) rotateY(-10deg);transform:perspective(400px) rotateY(-10deg)}70%{-webkit-transform:perspective(400px) rotateY(10deg);-ms-transform:perspective(400px) rotateY(10deg);transform:perspective(400px) rotateY(10deg)}100%{-webkit-transform:perspective(400px) rotateY(0deg);-ms-transform:perspective(400px) rotateY(0deg);transform:perspective(400px) rotateY(0deg);opacity:1}}@-webkit-keyframes flipOutY{0%{-webkit-transform:perspective(400px) rotateY(0deg);opacity:1}100%{-webkit-transform:perspective(400px) rotateY(90deg);opacity:0}}@keyframes flipOutY{0%{-webkit-transform:perspective(400px) rotateY(0deg);-ms-transform:perspective(400px) rotateY(0deg);transform:perspective(400px) rotateY(0deg);opacity:1}100%{-webkit-transform:perspective(400px) rotateY(90deg);-ms-transform:perspective(400px) rotateY(90deg);transform:perspective(400px) rotateY(90deg);opacity:0}}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes fadeInUp{0%{opacity:0;-webkit-transform:translateY(20px)}100%{opacity:1;-webkit-transform:translateY(0)}}@keyframes fadeInUp{0%{opacity:0;-webkit-transform:translateY(20px);-ms-transform:translateY(20px);transform:translateY(20px)}100%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes fadeInDown{0%{opacity:0;-webkit-transform:translateY(-20px)}100%{opacity:1;-webkit-transform:translateY(0)}}@keyframes fadeInDown{0%{opacity:0;-webkit-transform:translateY(-20px);-ms-transform:translateY(-20px);transform:translateY(-20px)}100%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes fadeInLeft{0%{opacity:0;-webkit-transform:translateX(-20px)}100%{opacity:1;-webkit-transform:translateX(0)}}@keyframes fadeInLeft{0%{opacity:0;-webkit-transform:translateX(-20px);-ms-transform:translateX(-20px);transform:translateX(-20px)}100%{opacity:1;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes fadeInRight{0%{opacity:0;-webkit-transform:translateX(20px)}100%{opacity:1;-webkit-transform:translateX(0)}}@keyframes fadeInRight{0%{opacity:0;-webkit-transform:translateX(20px);-ms-transform:translateX(20px);transform:translateX(20px)}100%{opacity:1;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0)}}@keyframes fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);-ms-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes fadeInDownBig{0%{opacity:0;-webkit-transform:translateY(-2000px)}100%{opacity:1;-webkit-transform:translateY(0)}}@keyframes fadeInDownBig{0%{opacity:0;-webkit-transform:translateY(-2000px);-ms-transform:translateY(-2000px);transform:translateY(-2000px)}100%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes fadeInLeftBig{0%{opacity:0;-webkit-transform:translateX(-2000px)}100%{opacity:1;-webkit-transform:translateX(0)}}@keyframes fadeInLeftBig{0%{opacity:0;-webkit-transform:translateX(-2000px);-ms-transform:translateX(-2000px);transform:translateX(-2000px)}100%{opacity:1;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes fadeInRightBig{0%{opacity:0;-webkit-transform:translateX(2000px)}100%{opacity:1;-webkit-transform:translateX(0)}}@keyframes fadeInRightBig{0%{opacity:0;-webkit-transform:translateX(2000px);-ms-transform:translateX(2000px);transform:translateX(2000px)}100%{opacity:1;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@-webkit-keyframes fadeOutUp{0%{opacity:1;-webkit-transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(-20px)}}@keyframes fadeOutUp{0%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(-20px);-ms-transform:translateY(-20px);transform:translateY(-20px)}}@-webkit-keyframes fadeOutDown{0%{opacity:1;-webkit-transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(20px)}}@keyframes fadeOutDown{0%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(20px);-ms-transform:translateY(20px);transform:translateY(20px)}}@-webkit-keyframes fadeOutLeft{0%{opacity:1;-webkit-transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(-20px)}}@keyframes fadeOutLeft{0%{opacity:1;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(-20px);-ms-transform:translateX(-20px);transform:translateX(-20px)}}@-webkit-keyframes fadeOutRight{0%{opacity:1;-webkit-transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(20px)}}@keyframes fadeOutRight{0%{opacity:1;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(20px);-ms-transform:translateX(20px);transform:translateX(20px)}}@-webkit-keyframes fadeOutUpBig{0%{opacity:1;-webkit-transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(-2000px)}}@keyframes fadeOutUpBig{0%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(-2000px);-ms-transform:translateY(-2000px);transform:translateY(-2000px)}}@-webkit-keyframes fadeOutDownBig{0%{opacity:1;-webkit-transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(2000px)}}@keyframes fadeOutDownBig{0%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(2000px);-ms-transform:translateY(2000px);transform:translateY(2000px)}}@-webkit-keyframes fadeOutLeftBig{0%{opacity:1;-webkit-transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(-2000px)}}@keyframes fadeOutLeftBig{0%{opacity:1;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(-2000px);-ms-transform:translateX(-2000px);transform:translateX(-2000px)}}@-webkit-keyframes fadeOutRightBig{0%{opacity:1;-webkit-transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(2000px)}}@keyframes fadeOutRightBig{0%{opacity:1;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(2000px);-ms-transform:translateX(2000px);transform:translateX(2000px)}}@-webkit-keyframes bounceIn{0%{opacity:0;-webkit-transform:scale(0.3)}50%{opacity:1;-webkit-transform:scale(1.05)}70%{-webkit-transform:scale(0.9)}100%{-webkit-transform:scale(1)}}@keyframes bounceIn{0%{opacity:0;-webkit-transform:scale(0.3);-ms-transform:scale(0.3);transform:scale(0.3)}50%{opacity:1;-webkit-transform:scale(1.05);-ms-transform:scale(1.05);transform:scale(1.05)}70%{-webkit-transform:scale(0.9);-ms-transform:scale(0.9);transform:scale(0.9)}100%{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}@-webkit-keyframes slideInDown{0%{opacity:0;-webkit-transform:translateY(-2000px)}100%{-webkit-transform:translateY(0)}}@keyframes slideInDown{0%{opacity:0;-webkit-transform:translateY(-2000px);-ms-transform:translateY(-2000px);transform:translateY(-2000px)}100%{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes slideInLeft{0%{opacity:0;-webkit-transform:translateX(-2000px)}100%{-webkit-transform:translateX(0)}}@keyframes slideInLeft{0%{opacity:0;-webkit-transform:translateX(-2000px);-ms-transform:translateX(-2000px);transform:translateX(-2000px)}100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes slideInRight{0%{opacity:0;-webkit-transform:translateX(2000px)}100%{-webkit-transform:translateX(0)}}@keyframes slideInRight{0%{opacity:0;-webkit-transform:translateX(2000px);-ms-transform:translateX(2000px);transform:translateX(2000px)}100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes slideOutLeft{0%{-webkit-transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(-2000px)}}@keyframes slideOutLeft{0%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(-2000px);-ms-transform:translateX(-2000px);transform:translateX(-2000px)}}@-webkit-keyframes slideOutRight{0%{-webkit-transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(2000px)}}@keyframes slideOutRight{0%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(2000px);-ms-transform:translateX(2000px);transform:translateX(2000px)}}@-webkit-keyframes slideOutUp{0%{-webkit-transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(-2000px)}}@keyframes slideOutUp{0%{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(-2000px);-ms-transform:translateY(-2000px);transform:translateY(-2000px)}}@-webkit-keyframes bounceInUp{0%{opacity:0;-webkit-transform:translateY(2000px)}60%{opacity:1;-webkit-transform:translateY(-30px)}80%{-webkit-transform:translateY(10px)}100%{-webkit-transform:translateY(0)}}@keyframes bounceInUp{0%{opacity:0;-webkit-transform:translateY(2000px);-ms-transform:translateY(2000px);transform:translateY(2000px)}60%{opacity:1;-webkit-transform:translateY(-30px);-ms-transform:translateY(-30px);transform:translateY(-30px)}80%{-webkit-transform:translateY(10px);-ms-transform:translateY(10px);transform:translateY(10px)}100%{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes bounceInDown{0%{opacity:0;-webkit-transform:translateY(-2000px)}60%{opacity:1;-webkit-transform:translateY(30px)}80%{-webkit-transform:translateY(-10px)}100%{-webkit-transform:translateY(0)}}@keyframes bounceInDown{0%{opacity:0;-webkit-transform:translateY(-2000px);-ms-transform:translateY(-2000px);transform:translateY(-2000px)}60%{opacity:1;-webkit-transform:translateY(30px);-ms-transform:translateY(30px);transform:translateY(30px)}80%{-webkit-transform:translateY(-10px);-ms-transform:translateY(-10px);transform:translateY(-10px)}100%{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes bounceInLeft{0%{opacity:0;-webkit-transform:translateX(-2000px)}60%{opacity:1;-webkit-transform:translateX(30px)}80%{-webkit-transform:translateX(-10px)}100%{-webkit-transform:translateX(0)}}@keyframes bounceInLeft{0%{opacity:0;-webkit-transform:translateX(-2000px);-ms-transform:translateX(-2000px);transform:translateX(-2000px)}60%{opacity:1;-webkit-transform:translateX(30px);-ms-transform:translateX(30px);transform:translateX(30px)}80%{-webkit-transform:translateX(-10px);-ms-transform:translateX(-10px);transform:translateX(-10px)}100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes bounceInRight{0%{opacity:0;-webkit-transform:translateX(2000px)}60%{opacity:1;-webkit-transform:translateX(-30px)}80%{-webkit-transform:translateX(10px)}100%{-webkit-transform:translateX(0)}}@keyframes bounceInRight{0%{opacity:0;-webkit-transform:translateX(2000px);-ms-transform:translateX(2000px);transform:translateX(2000px)}60%{opacity:1;-webkit-transform:translateX(-30px);-ms-transform:translateX(-30px);transform:translateX(-30px)}80%{-webkit-transform:translateX(10px);-ms-transform:translateX(10px);transform:translateX(10px)}100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes bounceOut{0%{-webkit-transform:scale(1)}25%{-webkit-transform:scale(0.95)}50%{opacity:1;-webkit-transform:scale(1.1)}100%{opacity:0;-webkit-transform:scale(0.3)}}@keyframes bounceOut{0%{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}25%{-webkit-transform:scale(0.95);-ms-transform:scale(0.95);transform:scale(0.95)}50%{opacity:1;-webkit-transform:scale(1.1);-ms-transform:scale(1.1);transform:scale(1.1)}100%{opacity:0;-webkit-transform:scale(0.3);-ms-transform:scale(0.3);transform:scale(0.3)}}@-webkit-keyframes bounceOutUp{0%{-webkit-transform:translateY(0)}20%{opacity:1;-webkit-transform:translateY(20px)}100%{opacity:0;-webkit-transform:translateY(-2000px)}}@keyframes bounceOutUp{0%{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}20%{opacity:1;-webkit-transform:translateY(20px);-ms-transform:translateY(20px);transform:translateY(20px)}100%{opacity:0;-webkit-transform:translateY(-2000px);-ms-transform:translateY(-2000px);transform:translateY(-2000px)}}@-webkit-keyframes bounceOutDown{0%{-webkit-transform:translateY(0)}20%{opacity:1;-webkit-transform:translateY(-20px)}100%{opacity:0;-webkit-transform:translateY(2000px)}}@keyframes bounceOutDown{0%{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}20%{opacity:1;-webkit-transform:translateY(-20px);-ms-transform:translateY(-20px);transform:translateY(-20px)}100%{opacity:0;-webkit-transform:translateY(2000px);-ms-transform:translateY(2000px);transform:translateY(2000px)}}@-webkit-keyframes bounceOutLeft{0%{-webkit-transform:translateX(0)}20%{opacity:1;-webkit-transform:translateX(20px)}100%{opacity:0;-webkit-transform:translateX(-2000px)}}@keyframes bounceOutLeft{0%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}20%{opacity:1;-webkit-transform:translateX(20px);-ms-transform:translateX(20px);transform:translateX(20px)}100%{opacity:0;-webkit-transform:translateX(-2000px);-ms-transform:translateX(-2000px);transform:translateX(-2000px)}}@-webkit-keyframes bounceOutRight{0%{-webkit-transform:translateX(0)}20%{opacity:1;-webkit-transform:translateX(-20px)}100%{opacity:0;-webkit-transform:translateX(2000px)}}@keyframes bounceOutRight{0%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}20%{opacity:1;-webkit-transform:translateX(-20px);-ms-transform:translateX(-20px);transform:translateX(-20px)}100%{opacity:0;-webkit-transform:translateX(2000px);-ms-transform:translateX(2000px);transform:translateX(2000px)}}@-webkit-keyframes rotateIn{0%{-webkit-transform-origin:center center;-webkit-transform:rotate(-200deg);opacity:0}100%{-webkit-transform-origin:center center;-webkit-transform:rotate(0);opacity:1}}@keyframes rotateIn{0%{-webkit-transform-origin:center center;-ms-transform-origin:center center;transform-origin:center center;-webkit-transform:rotate(-200deg);-ms-transform:rotate(-200deg);transform:rotate(-200deg);opacity:0}100%{-webkit-transform-origin:center center;-ms-transform-origin:center center;transform-origin:center center;-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);opacity:1}}@-webkit-keyframes rotateInUpLeft{0%{-webkit-transform-origin:left bottom;-webkit-transform:rotate(90deg);opacity:0}100%{-webkit-transform-origin:left bottom;-webkit-transform:rotate(0);opacity:1}}@keyframes rotateInUpLeft{0%{-webkit-transform-origin:left bottom;-ms-transform-origin:left bottom;transform-origin:left bottom;-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg);opacity:0}100%{-webkit-transform-origin:left bottom;-ms-transform-origin:left bottom;transform-origin:left bottom;-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);opacity:1}}@-webkit-keyframes rotateInDownLeft{0%{-webkit-transform-origin:left bottom;-webkit-transform:rotate(-90deg);opacity:0}100%{-webkit-transform-origin:left bottom;-webkit-transform:rotate(0);opacity:1}}@keyframes rotateInDownLeft{0%{-webkit-transform-origin:left bottom;-ms-transform-origin:left bottom;transform-origin:left bottom;-webkit-transform:rotate(-90deg);-ms-transform:rotate(-90deg);transform:rotate(-90deg);opacity:0}100%{-webkit-transform-origin:left bottom;-ms-transform-origin:left bottom;transform-origin:left bottom;-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);opacity:1}}@-webkit-keyframes rotateInUpRight{0%{-webkit-transform-origin:right bottom;-webkit-transform:rotate(-90deg);opacity:0}100%{-webkit-transform-origin:right bottom;-webkit-transform:rotate(0);opacity:1}}@keyframes rotateInUpRight{0%{-webkit-transform-origin:right bottom;-ms-transform-origin:right bottom;transform-origin:right bottom;-webkit-transform:rotate(-90deg);-ms-transform:rotate(-90deg);transform:rotate(-90deg);opacity:0}100%{-webkit-transform-origin:right bottom;-ms-transform-origin:right bottom;transform-origin:right bottom;-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);opacity:1}}@-webkit-keyframes rotateInDownRight{0%{-webkit-transform-origin:right bottom;-webkit-transform:rotate(90deg);opacity:0}100%{-webkit-transform-origin:right bottom;-webkit-transform:rotate(0);opacity:1}}@keyframes rotateInDownRight{0%{-webkit-transform-origin:right bottom;-ms-transform-origin:right bottom;transform-origin:right bottom;-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg);opacity:0}100%{-webkit-transform-origin:right bottom;-ms-transform-origin:right bottom;transform-origin:right bottom;-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);opacity:1}}@-webkit-keyframes rotateOut{0%{-webkit-transform-origin:center center;-webkit-transform:rotate(0);opacity:1}100%{-webkit-transform-origin:center center;-webkit-transform:rotate(200deg);opacity:0}}@keyframes rotateOut{0%{-webkit-transform-origin:center center;-ms-transform-origin:center center;transform-origin:center center;-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);opacity:1}100%{-webkit-transform-origin:center center;-ms-transform-origin:center center;transform-origin:center center;-webkit-transform:rotate(200deg);-ms-transform:rotate(200deg);transform:rotate(200deg);opacity:0}}@-webkit-keyframes rotateOutUpLeft{0%{-webkit-transform-origin:left bottom;-webkit-transform:rotate(0);opacity:1}100%{-webkit-transform-origin:left bottom;-webkit-transform:rotate(-90deg);opacity:0}}@keyframes rotateOutUpLeft{0%{-webkit-transform-origin:left bottom;-ms-transform-origin:left bottom;transform-origin:left bottom;-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);opacity:1}100%{-webkit-transform-origin:left bottom;-ms-transform-origin:left bottom;transform-origin:left bottom;-webkit-transform:rotate(-90deg);-ms-transform:rotate(-90deg);transform:rotate(-90deg);opacity:0}}@-webkit-keyframes rotateOutDownLeft{0%{-webkit-transform-origin:left bottom;-webkit-transform:rotate(0);opacity:1}100%{-webkit-transform-origin:left bottom;-webkit-transform:rotate(90deg);opacity:0}}@keyframes rotateOutDownLeft{0%{-webkit-transform-origin:left bottom;-ms-transform-origin:left bottom;transform-origin:left bottom;-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);opacity:1}100%{-webkit-transform-origin:left bottom;-ms-transform-origin:left bottom;transform-origin:left bottom;-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg);opacity:0}}@-webkit-keyframes rotateOutUpRight{0%{-webkit-transform-origin:right bottom;-webkit-transform:rotate(0);opacity:1}100%{-webkit-transform-origin:right bottom;-webkit-transform:rotate(90deg);opacity:0}}@keyframes rotateOutUpRight{0%{-webkit-transform-origin:right bottom;-ms-transform-origin:right bottom;transform-origin:right bottom;-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);opacity:1}100%{-webkit-transform-origin:right bottom;-ms-transform-origin:right bottom;transform-origin:right bottom;-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg);opacity:0}}@-webkit-keyframes rotateOutDownRight{0%{-webkit-transform-origin:right bottom;-webkit-transform:rotate(0);opacity:1}100%{-webkit-transform-origin:right bottom;-webkit-transform:rotate(-90deg);opacity:0}}@keyframes rotateOutDownRight{0%{-webkit-transform-origin:right bottom;-ms-transform-origin:right bottom;transform-origin:right bottom;-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);opacity:1}100%{-webkit-transform-origin:right bottom;-ms-transform-origin:right bottom;transform-origin:right bottom;-webkit-transform:rotate(-90deg);-ms-transform:rotate(-90deg);transform:rotate(-90deg);opacity:0}}@-webkit-keyframes hinge{0%{-webkit-transform:rotate(0);-webkit-transform-origin:top left;-webkit-animation-timing-function:ease-in-out}20%,60%{-webkit-transform:rotate(80deg);-webkit-transform-origin:top left;-webkit-animation-timing-function:ease-in-out}40%{-webkit-transform:rotate(60deg);-webkit-transform-origin:top left;-webkit-animation-timing-function:ease-in-out}80%{-webkit-transform:rotate(60deg) translateY(0);opacity:1;-webkit-transform-origin:top left;-webkit-animation-timing-function:ease-in-out}100%{-webkit-transform:translateY(700px);opacity:0}}@keyframes hinge{0%{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);-webkit-transform-origin:top left;-ms-transform-origin:top left;transform-origin:top left;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}20%,60%{-webkit-transform:rotate(80deg);-ms-transform:rotate(80deg);transform:rotate(80deg);-webkit-transform-origin:top left;-ms-transform-origin:top left;transform-origin:top left;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}40%{-webkit-transform:rotate(60deg);-ms-transform:rotate(60deg);transform:rotate(60deg);-webkit-transform-origin:top left;-ms-transform-origin:top left;transform-origin:top left;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}80%{-webkit-transform:rotate(60deg) translateY(0);-ms-transform:rotate(60deg) translateY(0);transform:rotate(60deg) translateY(0);opacity:1;-webkit-transform-origin:top left;-ms-transform-origin:top left;transform-origin:top left;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}100%{-webkit-transform:translateY(700px);-ms-transform:translateY(700px);transform:translateY(700px);opacity:0}}@-webkit-keyframes rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0) rotate(0deg)}}@keyframes rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);-ms-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0) rotate(0deg);-ms-transform:translateX(0) rotate(0deg);transform:translateX(0) rotate(0deg)}}@-webkit-keyframes rollOut{0%{opacity:1;-webkit-transform:translateX(0) rotate(0deg)}100%{opacity:0;-webkit-transform:translateX(100%) rotate(120deg)}}@keyframes rollOut{0%{opacity:1;-webkit-transform:translateX(0) rotate(0deg);-ms-transform:translateX(0) rotate(0deg);transform:translateX(0) rotate(0deg)}100%{opacity:0;-webkit-transform:translateX(100%) rotate(120deg);-ms-transform:translateX(100%) rotate(120deg);transform:translateX(100%) rotate(120deg)}}@-webkit-keyframes lightSpeedIn{0%{-webkit-transform:translateX(100%) skewX(-30deg);opacity:0}60%{-webkit-transform:translateX(-20%) skewX(30deg);opacity:1}80%{-webkit-transform:translateX(0) skewX(-15deg);opacity:1}100%{-webkit-transform:translateX(0) skewX(0deg);opacity:1}}@keyframes lightSpeedIn{0%{-webkit-transform:translateX(100%) skewX(-30deg);-ms-transform:translateX(100%) skewX(-30deg);transform:translateX(100%) skewX(-30deg);opacity:0}60%{-webkit-transform:translateX(-20%) skewX(30deg);-ms-transform:translateX(-20%) skewX(30deg);transform:translateX(-20%) skewX(30deg);opacity:1}80%{-webkit-transform:translateX(0) skewX(-15deg);-ms-transform:translateX(0) skewX(-15deg);transform:translateX(0) skewX(-15deg);opacity:1}100%{-webkit-transform:translateX(0) skewX(0deg);-ms-transform:translateX(0) skewX(0deg);transform:translateX(0) skewX(0deg);opacity:1}}@-webkit-keyframes lightSpeedOut{0%{-webkit-transform:translateX(0) skewX(0deg);opacity:1}100%{-webkit-transform:translateX(100%) skewX(-30deg);opacity:0}}@keyframes lightSpeedOut{0%{-webkit-transform:translateX(0) skewX(0deg);-ms-transform:translateX(0) skewX(0deg);transform:translateX(0) skewX(0deg);opacity:1}100%{-webkit-transform:translateX(100%) skewX(-30deg);-ms-transform:translateX(100%) skewX(-30deg);transform:translateX(100%) skewX(-30deg);opacity:0}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg)}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg)}100%{-ms-transform:rotate(359deg)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);-ms-transform:rotate(359deg);transform:rotate(359deg)}}@-webkit-keyframes loading{0%{background-position:0 -400px}100%{background-position:-7px -400px}}@-ms-keyframes loading{0%{background-position:0 -400px}100%{background-position:-7px -400px}}@keyframes loading{0%{background-position:0 -400px}100%{background-position:-7px -400px}}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-webkit-keyframes pace-spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-ms-keyframes pace-spinner{0%{-ms-transform:rotate(0deg);transform:rotate(0deg)}100%{-ms-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes pace-spinner{0%{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg)}}.animated{-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-fill-mode:both;animation-fill-mode:both}.animated.fast{-webkit-animation-duration:.4s;-ms-animation-duration:.4s;animation-duration:.4s}.animated.hinge{-webkit-animation-duration:2s;animation-duration:2s}.animated.flash{-webkit-animation-name:flash;animation-name:flash}.animated.shake{-webkit-animation-name:shake;animation-name:shake}.animated.bounce{-webkit-animation-name:bounce;animation-name:bounce}.animated.tada{-webkit-animation-name:tada;animation-name:tada}.animated.swing{-webkit-transform-origin:top center;-ms-transform-origin:top center;transform-origin:top center;-webkit-animation-name:swing;animation-name:swing}.animated.wobble{-webkit-animation-name:wobble;animation-name:wobble}.animated.pulse{-webkit-animation-name:pulse;animation-name:pulse}.animated.flip{-webkit-backface-visibility:visible!important;-webkit-animation-name:flip;-ms-backface-visibility:visible!important;backface-visibility:visible!important;animation-name:flip}.animated.flipInX{-webkit-backface-visibility:visible!important;-webkit-animation-name:flipInX;-ms-backface-visibility:visible!important;backface-visibility:visible!important;animation-name:flipInX}.animated.flipOutX{-webkit-animation-name:flipOutX;-webkit-backface-visibility:visible!important;animation-name:flipOutX;-ms-backface-visibility:visible!important;backface-visibility:visible!important}.animated.flipInY{-webkit-backface-visibility:visible!important;-webkit-animation-name:flipInY;-ms-backface-visibility:visible!important;backface-visibility:visible!important;animation-name:flipInY}.animated.flipOutY{-webkit-backface-visibility:visible!important;-webkit-animation-name:flipOutY;-ms-backface-visibility:visible!important;backface-visibility:visible!important;animation-name:flipOutY}.animated.fadeIn{-webkit-animation-name:fadeIn;animation-name:fadeIn}.animated.fadeInUp{-webkit-animation-name:fadeInUp;animation-name:fadeInUp}.animated.fadeInDown{-webkit-animation-name:fadeInDown;animation-name:fadeInDown}.animated.fadeInLeft{-webkit-animation-name:fadeInLeft;animation-name:fadeInLeft}.animated.fadeInRight{-webkit-animation-name:fadeInRight;animation-name:fadeInRight}.animated.fadeInUpBig{-webkit-animation-name:fadeInUpBig;animation-name:fadeInUpBig}.animated.fadeInDownBig{-webkit-animation-name:fadeInDownBig;animation-name:fadeInDownBig}.animated.fadeInLeftBig{-webkit-animation-name:fadeInLeftBig;animation-name:fadeInLeftBig}.animated.fadeInRightBig{-webkit-animation-name:fadeInRightBig;animation-name:fadeInRightBig}.animated.fadeOut{-webkit-animation-name:fadeOut;animation-name:fadeOut}.animated.fadeOutUp{-webkit-animation-name:fadeOutUp;animation-name:fadeOutUp}.animated.fadeOutDown{-webkit-animation-name:fadeOutDown;animation-name:fadeOutDown}.animated.fadeOutLeft{-webkit-animation-name:fadeOutLeft;animation-name:fadeOutLeft}.animated.fadeOutRight{-webkit-animation-name:fadeOutRight;animation-name:fadeOutRight}.animated.fadeOutUpBig{-webkit-animation-name:fadeOutUpBig;animation-name:fadeOutUpBig}.animated.fadeOutDownBig{-webkit-animation-name:fadeOutDownBig;animation-name:fadeOutDownBig}.animated.fadeOutLeftBig{-webkit-animation-name:fadeOutLeftBig;animation-name:fadeOutLeftBig}.animated.fadeOutRightBig{-webkit-animation-name:fadeOutRightBig;animation-name:fadeOutRightBig}.animated.bounceIn{-webkit-animation-name:bounceIn;animation-name:bounceIn}.animated.slideInDown{-webkit-animation-name:slideInDown;animation-name:slideInDown}.animated.slideInLeft{-webkit-animation-name:slideInLeft;animation-name:slideInLeft}.animated.slideInRight{-webkit-animation-name:slideInRight;animation-name:slideInRight}.animated.slideOutLeft{-webkit-animation-name:slideOutLeft;animation-name:slideOutLeft}.animated.slideOutRight{-webkit-animation-name:slideOutRight;animation-name:slideOutRight}.animated.slideOutUp{-webkit-animation-name:slideOutUp;animation-name:slideOutUp}.animated.bounceInUp{-webkit-animation-name:bounceInUp;animation-name:bounceInUp}.animated.bounceInDown{-webkit-animation-name:bounceInDown;animation-name:bounceInDown}.animated.bounceInLeft{-webkit-animation-name:bounceInLeft;animation-name:bounceInLeft}.animated.bounceInRight{-webkit-animation-name:bounceInRight;animation-name:bounceInRight}.animated.bounceOut{-webkit-animation-name:bounceOut;animation-name:bounceOut}.animated.bounceOutUp{-webkit-animation-name:bounceOutUp;animation-name:bounceOutUp}.animated.bounceOutDown{-webkit-animation-name:bounceOutDown;animation-name:bounceOutDown}.animated.bounceOutLeft{-webkit-animation-name:bounceOutLeft;animation-name:bounceOutLeft}.animated.bounceOutRight{-webkit-animation-name:bounceOutRight;animation-name:bounceOutRight}.animated.rotateIn{-webkit-animation-name:rotateIn;animation-name:rotateIn}.animated.rotateInUpLeft{-webkit-animation-name:rotateInUpLeft;animation-name:rotateInUpLeft}.animated.rotateInDownLeft{-webkit-animation-name:rotateInDownLeft;animation-name:rotateInDownLeft}.animated.rotateInUpRight{-webkit-animation-name:rotateInUpRight;animation-name:rotateInUpRight}.animated.rotateInDownRight{-webkit-animation-name:rotateInDownRight;animation-name:rotateInDownRight}.animated.rotateOut{-webkit-animation-name:rotateOut;animation-name:rotateOut}.animated.rotateOutUpLeft{-webkit-animation-name:rotateOutUpLeft;animation-name:rotateOutUpLeft}.animated.rotateOutDownLeft{-webkit-animation-name:rotateOutDownLeft;animation-name:rotateOutDownLeft}.animated.rotateOutUpRight{-webkit-animation-name:rotateOutUpRight;animation-name:rotateOutUpRight}.animated.rotateOutDownRight{-webkit-animation-name:rotateOutDownRight;animation-name:rotateOutDownRight}.animated.rollIn{-webkit-animation-name:rollIn;animation-name:rollIn}.animated.rollOut{-webkit-animation-name:rollOut;animation-name:rollOut}.animated.lightSpeedIn{-webkit-animation-name:lightSpeedIn;animation-name:lightSpeedIn;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out;-webkit-animation-duration:.5s;animation-duration:.5s}.animated.lightSpeedOut{-webkit-animation-name:lightSpeedOut;animation-name:lightSpeedOut;-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in;-webkit-animation-duration:.25s;animation-duration:.25s}.animated.fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}[class*=" bg-"],[class^=bg-]{-webkit-filter:none!important;filter:none!important}.square{display:block;float:left;margin-right:10px;height:20px;width:20px}.fa-stack-1em{width:1em!important;height:1em!important;line-height:1em!important}.icon-color-good{color:#40ac2b}.icon-color-bad{color:#ed1c24}.percent-sign:after{content:" %";line-height:normal}.degree-sign:after{content:" °F";line-height:normal}.ui-state-default .ui-icon[class*=" icon-"]{background:0;margin-left:-12px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-e:before{content:"\f105";font-family:FontAwesome;font-size:14px;display:inline}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-first,.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-button-icon-primary.ui-icon[class*=" icon-"]:before,.ui-button-icon-primary.ui-icon[class^=icon-]:before,.ui-button-icon-secondary.ui-icon[class*=" icon-"]:before,.ui-button-icon-secondary.ui-icon[class^=icon-]:before{font-size:inherit;margin-left:7px!important;margin-left:5px;display:inline;text-decoration:inherit;color:inherit}@font-face{font-family:'Ubuntu';src:url('./fonts/Ubuntu-C.eot');src:url('./fonts/Ubuntu-C.eot?#iefix') format('embedded-opentype'),url('./fonts/Ubuntu-C.woff') format('woff'),url('./fonts/Ubuntu-C.ttf') format('truetype'),url('./fonts/Ubuntu-C.svg') format('svg');font-weight:normal;font-style:normal}@font-face{font-family:'Ubuntu-Light';src:url('./fonts/Ubuntu-L.eot');src:url('./fonts/Ubuntu-L.eot?#iefix') format('embedded-opentype'),url('./fonts/Ubuntu-L.woff') format('woff'),url('./fonts/Ubuntu-L.ttf') format('truetype'),url('./fonts/Ubuntu-L.svg') format('svg');font-weight:normal;font-style:normal}@font-face{font-family:'Ubuntu-Bold';src:url('./fonts/Ubuntu-B.eot');src:url('./fonts/Ubuntu-B.eot?#iefix') format('embedded-opentype'),url('./fonts/Ubuntu-B.woff') format('woff'),url('./fonts/Ubuntu-B.ttf') format('truetype'),url('./fonts/Ubuntu-B.svg') format('svg');font-weight:bold;font-style:normal}html,body{font-family:Ubuntu,Arial,Helvetica,sans-serif}a:active,a:focus,a:hover,button,button:active,button:focus,embed,input::-moz-focus-inner,object{outline:0}.hidden{display:none}.hidden-desktop{display:none!important}.no-visible{visibility:hidden!important}.pull-right{float:right!Important}.pull-left{float:left!Important}.align-top{vertical-align:top!important}.align-base{vertical-align:baseline!important}.opacity-25{opacity:.25!important}.opacity-50{opacity:.5!important}.opacity-75{opacity:.75!important}.opacity-100,.opaque{opacity:1!important}.disabled{color:#fff}.btn-default.disabled{color:#999}xmp{overflow:auto}.text-italic{font-style:italic!important}.text-dashed{text-decoration:line-through}.nowrap{white-space:nowrap}.truncated{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.no-space{margin:0}.no-space>[class*=col-]{margin:0!important;padding-right:0;padding-left:0}.no-margin{margin:0!important}.no-x-margin{margin-left:0!important;margin-right:0!important}.no-y-margin{margin-top:0!important;margin-bottom:0!important}.margin-2{margin:2px!important}.margin-5{margin:5px!important}.margin-10{margin:10px!important}.margin-20{margin:20px!important}.margin-x-2{margin-left:2px!important;margin-right:2px!important}.margin-x-5{margin-left:5px!important;margin-right:5px!important}.margin-x-10{margin-left:10px!important;margin-right:10px!important}.margin-x-20{margin-left:20px!important;margin-right:20px!important}.margin-y-2{margin-top:2px!important;margin-bottom:2px!important}.margin-y-5{margin-top:5px!important;margin-bottom:5px!important}.margin-y-10{margin-top:10px!important;margin-bottom:10px!important}.margin-y-20{margin-top:20px!important;margin-bottom:20px!important}.margin-top-0{margin-top:0!important}.margin-top-2{margin-top:2px!important}.margin-top-5{margin-top:5px!important}.margin-top-10{margin-top:10px!important}.margin-top-20{margin-top:20px!important}.margin-bottom-0{margin-bottom:0!important}.margin-bottom-2{margin-bottom:2px!important}.margin-bottom-5{margin-bottom:5px!important}.margin-bottom-10{margin-bottom:10px!important}.margin-bottom-20{margin-bottom:20px!important}.margin-left-0{margin-left:0!important}.margin-left-2{margin-left:2px!important}.margin-left-5{margin-left:5px!important}.margin-left-10{margin-left:10px!important}.margin-left-20{margin-left:20px!important}.margin-right-0{margin-right:0!important}.margin-right-2{margin-right:2px!important}.margin-right-5{margin-right:5px!important}.margin-right-10{margin-right:10px!important}.margin-right-20{margin-right:20px!important}.shift-topleft-2{margin-top:-2px!important;margin-left:-2px!important}.shift-topleft-4{margin-top:-4px!important;margin-left:-4px!important}.shift-topright-2{margin-top:-2px!important;margin-right:-2px!important}.shift-topright-4{margin-top:-4px!important;margin-right:-4px!important}.shift-bottomleft-2{margin-bottom:-2px!important;margin-left:-2px!important}.shift-bottomleft-4{margin-bottom:-4px!important;margin-left:-4px!important}.shift-bottomright-2{margin-bottom:-2px!important;margin-right:-2px!important}.shift-bottomright-4{margin-bottom:-4px!important;margin-right:-4px!important}.bordered{border:1px solid #ccc}.bordered:hover{border:1px solid #bbb}.bordered.nohover:hover{border-color:#ccc}.no-border,.well[class*=" bg-"].no-border{border-width:0!important}.no-border-transparent{border-color:transparent!important}.no-border-radius{border-radius:0}.border-0{border-width:0!important}.border-1{border-width:1px!important}.radius-4{border-radius:4px!important}.radius-top-4{border-top-left-radius:4px!important;border-top-right-radius:4px!important}.radius-bottom-4{border-bottom-left-radius:4px!important;border-bottom-right-radius:4px!important}.radius-left-4{border-top-left-radius:4px!important;border-bottom-left-radius:4px!important}.radius-right-4{border-top-right-radius:4px!important;border-bottom-right-radius:4px!important}.width-100{width:100px;max-width:100px}.width-200{width:200px;max-width:200px}.width-300{width:300px;max-width:300px}.width-400{width:400px;max-width:400px}.width-500{width:500px;max-width:500px}.padding-5{padding:5px!important}.padding-7{padding:7px!important}.padding-10{padding:10px!important}.padding-20{padding:20px!important}.padding-x-0{padding-left:0!important;padding-right:0!important}.padding-x-5{padding-left:5px!important;padding-right:5px!important}.padding-x-10{padding-left:10px!important;padding-right:10px!important}.padding-x-20{padding-left:20px!important;padding-right:20px!important}.padding-y-0{padding-top:0!important;padding-bottom:0!important}.padding-y-5{padding-top:5px!important;padding-bottom:5px!important}.padding-y-10{padding-top:10px!important;padding-bottom:10px!important}.padding-y-20{padding-top:20px!important;padding-bottom:20px!important}.padding-top-0{padding-top:0!important}.padding-top-5{padding-top:5px!important}.padding-top-10{padding-top:10px!important}.padding-top-20{padding-top:20px!important}.padding-bottom-0{padding-bottom:0!important}.padding-bottom-5{padding-bottom:5px!important}.padding-bottom-10{padding-bottom:10px!important}.padding-bottom-20{padding-bottom:20px!important}.padding-left-0{padding-left:0!important}.padding-left-5{padding-left:5px!important}.padding-left-10{padding-left:10px!important}.padding-left-20{padding-left:20px!important}.padding-right-0{padding-right:0!important}.padding-right-5{padding-right:5px!important}.padding-right-10{padding-right:10px!important}.padding-right-20{padding-right:20px!important}.no-padding{padding:0!important}.no-padding .md-editor,.widget-body.no-padding .cke_chrome{border:0}.no-padding>pre{margin:30px}.no-padding .dataTables_wrapper table,.no-padding>table{border:0!important;margin-bottom:0!important}.no-padding .dataTables_wrapper table tr td:first-child,.no-padding>table tr td:first-child,.no-padding .dataTables_wrapper table tr th:first-child,.no-padding>table tr th:first-child{border-left:0!important}.no-padding .dataTables_wrapper table tr td:last-child,.no-padding>table tr td:last-child,.no-padding .dataTables_wrapper table tr th:last-child,.no-padding>table tr th:last-child{border-right:0!important}.no-padding .dataTables_wrapper table tr:last-child td,.no-padding>table tr:last-child td{border-bottom:0}.no-padding-bottom{padding-bottom:0!important}.no-x-padding{padding-left:0!important;padding-right:0!important}.no-y-padding{padding-top:0!important;padding-bottom:0!important}.no-content-padding{margin:-10px -14px 0 -14px}@media(min-width:768px) and (max-width:880px){.no-content-padding{margin:0 -14px!important}}@media(max-width:767px){.no-content-padding{margin:0 -5px!important}}@media only screen and (min-width:0) and (max-width:679px){.no-content-padding{margin:0 -5px!important}}@media only screen and (min-width:320px) and (max-width:479px){.no-content-padding{margin:0 -5px!important}}.no-height{line-height:0}.clearfix,.inner-space:after{zoom:1}.clearfix:after,.inner-space:after{clear:both}.clearfix:after,.inner-space:after,.clearfix:before,.inner-space:before{display:block;visibility:hidden;overflow:hidden;content:"\0020";height:0;font-size:0;line-height:0}.display-inline{display:inline-block!important}.display-normal{display:inline!important}.hover-transparent{opacity:.5}.hover-transparent:hover{opacity:1}.row-seperator-header{margin:15px 14px 20px;border-bottom:0;display:block;color:#646464;font-size:20px;font-weight:400}.text-align-center,.text-center{text-align:center!important}.text-align-left,.text-left{text-align:left!important}.text-align-right,.text-right{text-align:right!important}.center-canvas,.center-child-canvas>canvas{display:block!important;margin:0 auto!important}.semi-bold{font-weight:400!important}.bold{font-weight:900!important}.ultra-light{font-weight:300!important}.font-xs{font-size:85%!important}.font-sm{font-size:95%!important}.font-md{font-size:130%!important}.font-lg{font-size:160%!important}.font-xl{font-size:200%!important}.font-400{font-size:400%!important}.badge{font-size:11px;padding:4px 6px 1px}.label{padding:.3em .6em .1em}.cursor-pointer{cursor:pointer}.selected{border:1px solid #0091d9!important}tr.selected{background-color:#dcebff}.selected:before{display:block;position:absolute;content:"\f00c";color:#fff;right:4px;font-family:FontAwesome;z-index:1002}tr.selected:before{display:none}.selected:after{width:0;height:0;border-top:35px solid #0091d9;border-left:35px solid rgba(0,0,0,0);position:absolute;display:block;right:0;content:".";top:0;z-index:1001}tr.selected:after{display:none}html{margin:0;padding:0;height:100%;overflow-x:hidden!important;background-color:#e5e2cf}body{margin:0;padding:0;height:100%;overflow:hidden;background-color:#e5e2cf;direction:ltr}body.container{position:relative;padding:0;border-left:1px solid #bfbfbf;border-right:1px solid #bfbfbf;-webkit-box-shadow:0 2px 70px rgba(0,0,0,0.45);box-shadow:0 2px 70px rgba(0,0,0,0.45)}body.nooverflow{position:fixed;overflow:hidden;width:100%}#main{display:block;margin-left:220px;padding:0;min-height:500px;-webkit-transition:all .1s ease-out;transition:all .1s ease-out}@media(max-width:979px){#main{margin-left:0}}#content{padding:10px;position:relative;left:0;-webkit-transition:left .1s ease-out;transition:left .1s ease-out}@media(max-width:767px){#content{padding-left:5px;padding-right:5px}}.page-title{margin:12px 0 15px}.page-title a:hover,.page-title a:active{text-decoration:none}.page-title span{font-size:16px;color:#333;display:inline-block;vertical-align:1px}.page-title span i{padding:0 5px}aside{display:block;width:220px;overflow:hidden;min-height:100%}aside,aside nav li.divider{background:#829db0}#header{display:block;height:49px;position:relative;margin:0;padding:0 13px 0 0;background-color:#f3f3f3;background-image:-webkit-gradient(linear,0 0,0 100%,from(#f3f3f3),to(#e2e2e2));background-image:-webkit-gradient(linear,top left,bottom left,from(#f3f3f3),to(#e2e2e2));background-image:-webkit-linear-gradient(top,#f3f3f3,#e2e2e2);background-image:linear-gradient(to bottom,#f3f3f3,#e2e2e2);background-repeat:repeat-x}@media(max-width:767px){#header{padding-right:5px}}@media only screen and (max-width:679px){#header{padding-right:5px;background:#fff}}#header>div{display:inline-block;vertical-align:middle;height:49px;float:left}#header>div.open{font-weight:700}.fixed-header #header{position:fixed;width:100%;z-index:1001}.container.fixed-header #header{max-width:1164px}.fixed-header #header .ajax-dropdown{z-index:1000}.fixed-header #shortcut{position:fixed}.fixed-header #main{margin-top:49px}#top-links>div{display:inline-block;float:left}@media(min-width:768px) and (max-width:1089px){#top-links>div{display:none}#top-links>div:first-child{display:inline-block}}@media(max-width:767px){#top-links>div{display:none}}.top-menu{display:inline-block;padding:7px 13px 0;position:relative}@media(max-width:767px){.top-menu{display:none}}.top-menu>span{display:block}.top-menu>:first-child{display:block;color:#bfbfbf;font-size:10px;font-weight:700;text-transform:uppercase;text-shadow:0 0 1px #fff;padding-left:0;text-align:left}.top-tabs{display:inline-block;padding:7px 13px 0;position:relative}.top-tabs>span{display:block}.top-tabs>:first-child{display:block;color:#bfbfbf;font-size:10px;font-weight:700;text-transform:uppercase;text-shadow:0 0 1px #fff;padding-left:5px;text-align:left}.top-tabs .nav-tabs li a{padding:2px 10px 3px!important;border-color:#ccc #ccc transparent;box-shadow:0 -2px 3px #ccc;margin-top:3px!important}.top-tabs .nav-tabs li.active a{margin-top:3px!important;padding:2px 10px 3px!important}.top-selector{max-width:97%;white-space:nowrap;background:0;border:0;padding:0;text-align:left;color:#555;font-size:14px;cursor:pointer}.top-selector:hover{color:#333}@media(max-width:979px){#login-info{display:none}}#login-info>span{display:inline-block;height:39px;float:left}#login-info>span .badge{position:absolute;top:-5px;right:-9px;cursor:pointer;background:#0091d9;display:inline-block;font-size:10px;-webkit-box-shadow:inset 1px 1px 0 rgba(0,0,0,0.1),inset 0 -1px 0 rgba(0,0,0,0.07);box-shadow:inset 1px 1px 0 rgba(0,0,0,0.1),inset 0 -1px 0 rgba(0,0,0,0.07);color:#fff;font-weight:700;border-radius:50%;padding:3px;text-align:center;line-height:normal}#login-info span#activity{border-radius:2px;cursor:default!important;display:inline-block;font-weight:700;height:24px;width:24px;padding:2px;text-align:center;text-decoration:none!important;-moz-user-select:none;-webkit-user-select:none;background-color:#f8f8f8;background-image:-webkit-gradient(linear,left top,left bottom,from(#f8f8f8),to(#f1f1f1));background-image:-webkit-gradient(linear,top left,bottom left,from(#f8f8f8),to(#f1f1f1));background-image:-webkit-linear-gradient(top,#f8f8f8,#f1f1f1);background-image:linear-gradient(top,#f8f8f8,#f1f1f1);border:1px solid #bfbfbf;color:#c4bab6;font-size:19px;margin:5px 0 0;position:relative}#login-info span#activity:hover{border:1px solid #bfbfbf;-webkit-transition:all 0s;transition:all 0s;cursor:pointer!important;-webkit-box-shadow:inset 0 0 4px 1px rgba(0,0,0,0.08);box-shadow:inset 0 0 4px 1px rgba(0,0,0,0.08)}.authomatic{display:inline-block;width:21px;height:21px;margin:2px 0!important;padding:3px!important;text-align:center}.authomatic:hover{background-color:#ccc;border-radius:3px}#logo{display:inline-block;width:175px;margin-top:7px;margin-left:9px}@media(min-width:768px) and (max-width:880px){#logo{margin-top:10px}}@media(max-width:767px){#logo{margin-top:10px;margin-left:4px}}@media only screen and (min-width:0) and (max-width:679px){#logo{margin-top:10px;margin-left:4px}}@media only screen and (min-width:320px) and (max-width:479px){#logo{width:135px;margin-top:10px;margin-left:4px}}#logo img{max-width:175px;max-height:36px;padding-left:3px}#logo-group{width:220px}@media only screen and (min-width:480px) and (max-width:1089px){#logo-group{width:175px}}@media only screen and (min-width:320px) and (max-width:479px){#logo-group{width:169px!important}}.uv-icon{position:absolute!important;left:155px!important;top:5px!important;z-index:500!important}@media only screen and (min-width:0) and (max-width:1089px){.uv-icon{left:130px!important}}#activity.active .badge{background:#006fa6!important}.header-search{position:relative}@media(max-width:767px){.header-search{display:none}}.header-search.pull-right{margin-left:6px}@media(max-width:979px){.header-search.pull-right{margin-left:0}}.header-search>input[type=text]{display:block;-webkit-box-sizing:border-box;box-sizing:border-box;-moz-box-sizing:border-box;min-width:200px;width:100%;height:30px;padding:0 10px;outline:0;border-width:1px;border-style:solid;border-radius:0;border-color:#bfbfbf;background:#fff;color:#404040;appearance:normal;-moz-appearance:none;-webkit-appearance:none;margin-top:10px;line-height:normal}@media(min-width:768px) and (max-width:979px){.header-search>input[type=text]{margin-top:9px}}.header-search>button{background:0;border:0;color:#6d6a69;font-size:17px;height:30px;line-height:30px;margin:0;padding:0;position:absolute;right:0;top:10px;width:30px;z-index:2}#search-mobile{display:none}@media(max-width:767px){#search-mobile{display:block}}@media only screen and (min-width:0) and (max-width:679px){#search-mobile{display:block}}@media only screen and (min-width:320px) and (max-width:479px){#search-mobile{margin-left:0}}@media(max-width:767px){.search-mobile .header-search{display:block;position:absolute;top:0;width:100%;height:49px;background:#333;padding:0 2px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;left:0}.search-mobile .header-search>input[type=text]{margin-top:2px;height:45px;border-color:#333;padding-right:75px}.search-mobile .header-search>button{height:29px;line-height:29px;background:#DDD;right:44px}.search-mobile #search-mobile{display:none}.search-mobile #cancel-search-js{display:block}}#cancel-search-js{position:absolute;display:none;background:#a90329;z-index:3;color:#fff;padding:0;right:10px;top:10px;text-align:center;height:29px;line-height:29px;width:30px;font-size:17px;text-decoration:none!important}#left-panel{position:absolute;top:49px;left:0;z-index:1002;-webkit-transition:left .1s ease-out;transition:left .1s ease-out}@media(max-width:979px){#left-panel{left:-220px}}.fixed-navigation #left-panel{position:fixed;z-index:998}@media(max-width:767px){.fixed-navigation #left-panel{position:absolute!important}}#left-panel #ajax-gear{position:absolute;left:calc(49%);top:5px}#left-panel .version{position:absolute;bottom:2px;width:100%;text-align:center;font-size:11px;color:#333}#ribbon{height:40px;background:#6f8696;padding:0 40px 0 13px;position:relative}@media(max-width:767px){#ribbon{padding-left:5px;padding-right:5px}}@media only screen and (min-width:0) and (max-width:679px){#ribbon{border-bottom:1px solid #cfcfcf;border-top:1px solid #e6e6e6;background:#f5f5f5}}#ribbon .breadcrumb{display:inline-block;margin:0;padding:12px 34px 10px 0!important;background:0;vertical-align:top}#ribbon .breadcrumb,#ribbon .breadcrumb a{color:#ddd!important;text-decoration:none!Important}@media only screen and (min-width:0) and (max-width:679px){#ribbon .breadcrumb,#ribbon .breadcrumb a{color:#6d6c6c!important}}#ribbon .breadcrumb>li+li:before{padding:0 1px 0 5px}#ribbon .breadcrumb li:last-child,#ribbon .breadcrumb>.active{color:#eee}@media only screen and (min-width:0) and (max-width:679px){#ribbon .breadcrumb li:last-child,#ribbon .breadcrumb>.active{color:#333!important}}.fixed-ribbon #ribbon{position:fixed;right:0;left:220px;top:49px;z-index:999}@media(max-width:979px){.fixed-ribbon #ribbon{left:0}}.container.fixed-ribbon #ribbon{width:944px;left:590px}.fixed-ribbon #content{padding-top:50px}@media(max-width:767px){.fixed-ribbon #content{padding-top:52px}}.minified.fixed-ribbon #ribbon{left:45px}.hidden-menu.fixed-ribbon #ribbon{left:10px}@media(max-width:979px){.hidden-menu.fixed-ribbon #ribbon{left:220px}}.hidden-ribbon #ribbon{height:1px;min-height:1px;max-height:1px}.hidden-ribbon #ribbon>*{display:none}.ribbon{position:absolute;right:9px;top:-4px}.header-dropdown-list{list-style:none;float:right;position:relative;margin:0;padding-left:10px}.header-dropdown-list>li{display:inline-block;padding-right:5px}.header-dropdown-list>li>.dropdown-toggle{margin-top:16px;display:block}.smart-accordion-default.panel-group .panel+.panel{margin-top:-1px}.smart-accordion-default.panel-group .panel-heading{padding:0}.smart-accordion-default.panel-group .panel-title a{display:block;padding:10px 15px;text-decoration:none!important}.smart-accordion-default .panel-group .panel,.smart-accordion-default .panel-heading{border-radius:0}.smart-accordion-default .panel-default{border-color:#c3c3c3}.smart-accordion-default .panel-default>.panel-heading{background-color:#fcfcfc}.smart-accordion-default .panel-title>a.collapsed>.fa,.smart-accordion-default .panel-title>a>:first-child{display:none}.smart-accordion-default .panel-title>a.collapsed>:first-child{display:inline-block}.no-padding .smart-accordion-default>div{border-left:0!important;border-right:0!important}.no-padding .smart-accordion-default>div:first-child{border-top:0!important}.no-padding .smart-accordion-default>div:last-child{border-bottom:0!important}#logo-group *,.login-info,.login-info *,.minified .menu-item-parent{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.login-info{display:block;font-size:12px;height:39px;color:#333;border:solid transparent;margin:2px 0 0 10px!important;float:right}.login-info a,.login-info strong{text-transform:capitalize;font-size:14px;display:inline-block;color:#333;text-decoration:none;margin-left:5px}.login-info a:hover,.login-info strong{color:#666}.login-info a.btn{margin-top:5px}.login-info a.btn-danger,.login-info a.btn-success,.login-info a.btn-primary{color:#dedede}.login-info span{display:inline-block;padding:0 0 0 10px}.login-info span a.btn-success{margin-top:-10px}.login-info img{width:25px;height:auto;display:inline-block;vertical-align:middle;margin-top:-3px;margin-right:7px;margin-left:0;border-left:3px solid #fff}.minifyme{border-bottom:1px solid #302f2f;background:#454545;color:#a8a8a8;text-align:center;padding:1px 0 0;width:36px;height:28px;display:block;position:absolute;right:-3px;border-radius:5px 0 0 5px;cursor:pointer;margin-top:5px;font-size:19px;-webkit-transition:all .1s linear 0s;transition:all .1s linear 0s}.minifyme:hover{background:#646464;color:#e4e4e4;right:0}.minified .minifyme{right:0;color:#a8a8a8;position:relative;width:100%;border-radius:0;margin:0;height:32px;font-size:23px}.minified .minifyme .fa:before{content:"\f0a9"}.minified #left-panel{width:45px;overflow:visible}@media(max-width:979px){.minified #left-panel{left:0}}.minified #main{margin-left:45px}.minified #left-panel>ul>li,.minified nav>ul>li{overflow:visible}.minified #left-panel>ul>li>ul::before,.minified nav>ul>li>ul::before{border-left:0}.minified #left-panel>ul>li,.minified nav>ul>li,.minified #left-panel>ul>li a,.minified nav>ul>li a{position:relative}.minified #left-panel ul>li>a,.minified nav ul>li>a{padding:12px 11px 10px;display:block}.minified #left-panel>ul>li>a .fa.fa-fw,.minified nav>ul>li>a .fa.fa-fw{display:block;width:auto;text-align:center;padding:0}.minified #left-panel>ul>li>a>i,.minified nav>ul>li>a>i{text-align:center;margin:0;display:block}.minified #left-panel>ul>li.active>a::before,.minified nav>ul>li.active>a::before{content:"\f0d9"}.minified #left-panel ul ul li a,.minified nav ul ul li a{padding-top:5px;padding-bottom:5px;padding-left:14px}.minified #left-panel ul ul li li a,.minified nav ul ul li li a{padding-left:25px}.minified #left-panel>ul ul li::before,.minified nav>ul ul li::before,.minified #left-panel>ul>li>ul::before,.minified nav>ul>li>ul::before{left:12px}.minified #left-panel>ul>li>a .menu-item-parent,.minified nav>ul>li>a .menu-item-parent,.minified #left-panel>ul>li>a>b,.minified nav>ul>li>a>b{display:none}.minified #left-panel>ul>li>a>.menu-item-parent,.minified nav>ul>li>a>.menu-item-parent{display:none;position:absolute;left:40px;top:-3px;width:186px;height:36px;line-height:38px;background-color:#f5f5f5;color:#333;z-index:3;-webkit-box-shadow:2px 1px 2px 0 rgba(0,0,0,0.2);box-shadow:2px 1px 2px 0 rgba(0,0,0,0.2);border-left:1px solid #bfbfbf;border-top:1px solid #d8d4d4;border-bottom:1px solid #fff;padding-left:12px}.minified #left-panel>ul>li>ul,.minified nav>ul>li>ul{display:none!important;position:absolute;left:40px;width:200px;z-index:5;border:1px solid #bfbfbf;min-height:180px;-webkit-box-shadow:1px 1px 2px 0 rgba(0,0,0,0.2);box-shadow:1px 1px 2px 0 rgba(0,0,0,0.2);background:#627685;margin-top:-3px}.minified #left-panel ul>li>ul>li>ul,.minified nav ul>li>ul>li>ul{position:relative;left:13px;border:0;margin-left:-12px;width:197px}.minified #left-panel>ul>li:hover>a>.menu-item-parent,.minified nav>ul>li:hover>a>.menu-item-parent,.minified #left-panel>ul>li:hover>ul,.minified nav>ul>li:hover>ul{display:block!important}.minified #left-panel>ul>li>ul>li,.minified nav>ul>li>ul>li{background-color:rgba(91,103,113,0.8)}.minified #left-panel>ul>li>ul>li>ul>li,.minified nav>ul>li>ul>li>ul>li{background-color:#627685}.minified #left-panel>ul>li>ul>li>a,.minified nav>ul>li>ul>li>a,.minified #left-panel>ul>li>ul>li>ul>li>a,.minified nav>ul>li>ul>li>ul>li>a{padding-top:7px;padding-bottom:7px}.minified #left-panel>ul>li>ul>li>ul>li a,.minified nav>ul>li>ul>li>ul>li a{padding-top:6px;padding-bottom:6px}.minified #left-panel>ul>ul,.minified nav>ul>ul{min-height:100px!important;max-height:180px!important;overflow-y:scroll;overflow-x:hidden;background:#ed1c24!important}.minified #left-panel>ul ul li::before,.minified nav>ul ul li::before{border:0}.minified #left-panel ul ul ul ul li a,.minified nav ul ul ul ul li a{padding-left:45px}.minified #left-panel ul ul ul ul ul li a,.minified nav ul ul ul ul ul li a{padding-left:62px}.minified #left-panel ul ul ul ul ul ul li a,.minified nav ul ul ul ul ul ul li a{padding-left:82px}.minified #left-panel .version{display:none}.minified .slimScrollDiv,.minified .slimScrollDiv>:first-child{overflow:visible!important}.minified .slimScrollBar,.minified .slimScrollRail{display:none}.slimScrollDiv,.slimScrollDiv>:first-child{overflow:hidden}@media(max-width:979px){#hide-menu i,#logout i{color:#6d6a69;font-size:100%}}@media(min-width:0) and (max-width:880px){#hide-menu i,#logout i{font-size:121%}}.hidden-menu #left-panel{left:-210px;z-index:1002}@media(max-width:979px){.hidden-menu #left-panel{left:0}}.hidden-menu #left-panel:hover{left:0}.hidden-menu #main{margin-left:10px}.minified.hidden-menu #main{margin-left:0}@media(max-width:979px){.hidden-menu #main{position:relative;left:210px}}@media(max-width:979px){.hidden-menu #hide-menu i{color:#fff}}@media(min-width:768px) and (max-width:880px){.hidden-menu #hide-menu i::before{content:"\f0c9"}}@media(max-width:767px){.hidden-menu #hide-menu i{color:#fff}.hidden-menu #hide-menu i::before{content:"\f0c9"}}.hidden-menu #hide-menu>:first-child>a{background-color:#e8e8e8;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#5a5a5a),color-stop(100%,#686868));background-image:-webkit-linear-gradient(to bottom,#5a5a5a 0,#686868 100%);background-image:-webkit-gradient(linear,top left,bottom left,from(#5a5a5a),to(#686868));background-image:-webkit-linear-gradient(top,#5a5a5a 0,#686868 100%);background-image:linear-gradient(to bottom,#5a5a5a 0,#686868 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#5A5A5A',endColorstr='#686868',GradientType=0);color:#fff;border-color:#494949;-webkit-box-shadow:inset 0 0 3px 1px rgba(0,0,0,0.15);box-shadow:inset 0 0 3px 1px rgba(0,0,0,0.15)}@media(min-width:768px) and (max-width:979px){.hidden-menu #hide-menu>:first-child>a{margin-top:9px;width:40px}}.hidden-menu #hide-menu>:first-child>a:active{-webkit-box-shadow:inset 0 0 6px 1px rgba(0,0,0,0.2);box-shadow:inset 0 0 6px 1px rgba(0,0,0,0.2)}.hidden-menu .minifyme,.minified #hide-menu{display:none}.no-menu #left-panel{left:-220px;z-index:0}.no-menu #main{margin-left:0}.no-menu #hide-menu{display:none}#shortcut{position:absolute;top:0;left:0;height:auto;width:100%;background-color:#33302f;background-color:rgba(0,0,0,0.85);z-index:1009;display:none;color:#fff;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#shortcut ul{padding:15px 20px 10px;list-style:none;margin:0;-webkit-box-shadow:0 4px 10px rgba(0,0,0,0.3);box-shadow:0 4px 10px rgba(0,0,0,0.3);border-bottom:1px solid #423f3f}#shortcut ul li{display:inline-block;width:auto}#shortcut ul li .ams-metro-tile{margin:0 3px 3px;border:0;border-radius:0}#shortcut ul li .ams-metro-tile:hover{color:#fff;text-decoration:none}#shortcut ul li .ams-metro-tile:active,#shortcut ul li .ams-metro-tile:focus{left:0;top:0}#shortcut .version{position:absolute;right:10px;bottom:10px}.shortcut-on #response-btn{display:none!important}.shortcut-on #left-bar .navbar,.shortcut-on #main .navbar{border:0!important}#sparks{display:block;list-style:none;margin:10px 0 0;padding:0;text-align:right}@media only screen and (min-width:320px) and (max-width:479px){#sparks{text-align:center;background:#e0e0e0;padding:10px 0;margin-bottom:15px}}#sparks li{display:inline-block;border-left:1px dotted #c7c7c7;padding:0 10px;max-height:47px;overflow:hidden;text-align:left;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box}@media only screen and (min-width:320px) and (max-width:479px){#sparks li{padding:0 10px 0 20px}}#sparks li:last-child{padding-right:0}#sparks li:first-child{border-left:0;padding-left:0}#sparks li h5{color:#555;float:left;font-size:11px;font-weight:400;margin:-3px 0 0 0;padding:0;border:0;text-transform:uppercase}#sparks li span{color:#636363;display:block}.sparks-info{min-width:70px}.sparks-info span{font-size:18px;line-height:20px;margin:0;text-transform:none}.sparks-info .sparkline{display:block;float:right;margin:3px 0 0 20px}#heat-fill{display:block;position:relative;margin-bottom:20px;background:#333;height:7px;width:200px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAAABCAIAAAAU3Xa1AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowMDE4MkZGMzMzOTgxMUUzODZBQUNFQUNFOTk0NEUxRiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowMDE4MkZGNDMzOTgxMUUzODZBQUNFQUNFOTk0NEUxRiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjAwMTgyRkYxMzM5ODExRTM4NkFBQ0VBQ0U5OTQ0RTFGIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjAwMTgyRkYyMzM5ODExRTM4NkFBQ0VBQ0U5OTQ0RTFGIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+rG8MDAAAAM5JREFUeNpUUtESwyAIg8ft9v8/W4ElBPWKV1AIiKEeEWVuVlWjINSVONBnirQDxukNgcuyTQsBzLHMDsLIQQw+nIL71JqNJ5GZJXApFNpmtlagQjfS2xGbkFA4Iwu+hu0sK3Wl3nOwNv7TvPrWk3X0eW9dK1pU9hK2eTuWb2ySJmlziutA3iBxmblPNvA5PNsuUpoDY80+Z0SW1IRpDEqwC58C14tsr1f8le8si0aojdADr/1UjaclsFashX8GGkL9wDxtRsV6ft/PX4ABADRzhOVIOJaAAAAAAElFTkSuQmCC)}.fill-a,.fill-b{width:20px;text-align:right;overflow:hidden;text-overflow:ellipsis;display:block;background:#fff;padding-right:4px;position:absolute;left:0;margin-top:-7px;font-weight:700}.fill-b{text-align:left;position:absolute;right:0;left:auto;top:0;width:60px;padding-left:4px;padding-right:0}.cke_top{background:rgba(248,248,248,0.9)!important;background-image:none!important}.MessageBox{width:100%;height:100%;position:fixed;top:0;left:0;background:rgba(0,0,0,0.6);z-index:100000}@media screen and (max-width:450px) and (max-width:767px){.MessageBox{width:100%;height:100%;position:fixed;top:0;left:0;background:rgba(0,0,0,0.6);z-index:100000}}.MessageBoxContainer{top:35%;color:#fff;position:relative;width:100%;background-color:#232323;background-color:rgba(0,0,0,0.8);padding:20px}@media screen and (max-width:450px) and (max-width:767px){.MessageBoxContainer{top:25%;color:#fff;position:relative;width:100%;background-color:#232323}}.MessageBoxContainer input,.MessageBoxContainer select{width:50%;padding:5px}@media screen and (max-width:450px) and (max-width:767px){.MessageBoxContainer input,.MessageBoxContainer select{width:50%;padding:5px}}.MessageBoxMiddle{position:relative;left:20%;width:60%}@media screen and (max-width:450px) and (max-width:767px){.MessageBoxMiddle{position:relative;left:0;width:100%;padding:3px}}.MessageBoxMiddle .MsgTitle{letter-spacing:-1px;font-size:24px;font-weight:300}@media screen and (max-width:450px) and (max-width:767px){.MessageBoxMiddle .MsgTitle{font-size:22px}}.MessageBoxMiddle .pText{font-style:30px}@media screen and (max-width:450px) and (max-width:767px){.MessageBoxMiddle{font-style:10px}}.MessageBoxButtonSection{width:100%;height:30px}@media screen and (max-width:450px) and (max-width:767px){.MessageBoxButtonSection{width:100%;height:30px}}.MessageBoxButtonSection button{float:right;margin-right:7px;padding-left:15px;padding-right:15px;font-size:14px;font-weight:700}@media screen and (max-width:450px) and (max-width:767px){.MessageBoxButtonSection button{float:right;margin-right:5px;padding-left:15px;padding-right:15px}}.LoadingBoxContainer{top:20%;color:#fff;position:relative;width:100%;background-color:#232323}.LoadingBoxContainer .MsgTitle{font-size:26px}.LoadingBoxContainer .pText{font-style:30px}.LoadingBoxMiddle{position:relative;left:20%;width:50%;padding:10px}#LoadingPoints{position:absolute}#divMiniIcons{position:fixed;width:415px;right:10px;bottom:180px;z-index:9999;float:right}#divMiniIcons .cajita{text-align:center;vertical-align:middle;padding:4px 6px;color:#FFF;float:right;cursor:pointer;display:block;background-color:red;font-size:17px;margin-left:4px;margin-top:5px}#divMiniIcons .cajita:active{top:1px;left:1px;position:relative}#divSmallBoxes{position:fixed;right:0;top:0;z-index:9999}@media screen and (max-width:450px) and (max-width:767px){#divSmallBoxes{position:fixed;width:90%;right:0;top:0}}.BigBox{position:fixed;right:10px;bottom:10px;background-color:#004d60;padding:10px 10px 5px;width:390px;height:150px;color:#fff;z-index:99999;box-sizing:content-box;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;border-left:5px solid rgba(0,0,0,0.15);overflow:hidden}.BigBox span{font-size:17px;font-weight:300;letter-spacing:-1px;padding:5px 0!important;display:block}.BigBox p{font-size:13px;margin-top:10px}@media screen and (max-width:450px) and (max-width:767px){.BigBox{width:88%}}.BigBox .bigboxicon{font-size:30px;text-align:left;position:absolute;top:120px;left:6px;z-index:0}.BigBox .bigboxnumber{width:100%;text-align:right;font-size:25px}.SmallBox{position:absolute;right:5px;top:20px;width:420px;color:#fff;z-index:9999;overflow:hidden;border:1px solid transparent}@media screen and (max-width:450px) and (max-width:767px){.SmallBox{width:95%}}.SmallBox:hover{border:1px solid #fff;cursor:pointer}@media screen and (max-width:450px) and (max-width:767px){.SmallBox:hover{-webkit-box-shadow:0 0 10px #888;box-shadow:0 0 10px #888;cursor:pointer}}.SmallBox .foto{font-size:30px;position:absolute;left:20px}.SmallBox .textoFull{width:93%;float:left;padding-left:20px}@media screen and (max-width:450px) and (max-width:767px){.SmallBox .textoFull{width:93%;float:left;padding-left:20px}}.SmallBox .textoFoto{width:78%;margin:3px 20px 3px 80px;float:left}@media screen and (max-width:450px) and (max-width:767px){.SmallBox .textoFoto{width:55%;margin:3px 20px 3px 80px;float:left}}.SmallBox span{font-size:17px;font-weight:300;letter-spacing:-1px;display:block;margin:4px 0}@media screen and (max-width:450px) and (max-width:767px){.SmallBox span{font-size:16px}}.SmallBox p{font-size:13px;margin-top:2px}@media screen and (max-width:450px) and (max-width:767px){.SmallBox p{font-size:12px;margin-top:2px}}.btnClose{position:absolute;right:10px;height:16px;width:15px;cursor:pointer;font-size:18px;opacity:.5;display:block;top:15px}.btnClose:hover{opacity:1}.miniPic{position:absolute;bottom:8px;right:9px}.miniIcon{height:100%;font-size:20px}nav{padding-top:40px}nav ul{width:100%;padding:40px 28px 25px 0;padding:0;margin:0;font-size:13px;line-height:.5em;list-style:none;position:relative;background-color:#627685}nav ul li{overflow:hidden}nav ul li.divider{height:20px;border:0}nav ul li.header{font-family:"Ubuntu-Light",Arial,Helvetica,sans-serif;font-size:14px;font-weight:bold;color:#eee;background-color:#b13510;border-top-color:#d44918;border-bottom-color:#a13812;padding:4px 10px 4px 20px;line-height:18px}nav ul li.header:not(:first-child){margin-top:10px}.minified #left-panel nav ul li.header{padding:5px;color:#b94015;line-height:0;max-height:10px;overflow:hidden}nav ul li a{line-height:normal;font-size:14px;padding:10px 10px 10px 11px;color:#f4e8cf;display:block;font-weight:400;text-decoration:none!important;position:relative}nav ul li a:active{background:#616161!important}nav ul li a:focus{color:#c9c9c9}nav ul li a:hover{color:#fff;text-decoration:none}nav ul li.active>a{background-color:#627685;color:#fff!important;position:relative}nav ul li.active>a:before{content:"\f0d9";font-family:FontAwesome;display:block;height:27px;line-height:14px;width:27px;position:absolute;right:-21px;font-size:20px;color:#eee}nav ul li.active.open>a:before{content:""}nav ul li.active.open>a.active:before{content:"\f0d9"}nav ul li li{border-bottom:0;position:relative}nav ul .active>a{color:#fefefe!important;position:relative}nav ul b{float:right;font-size:14px;margin-top:-1px}nav ul span.menu-item-parent{display:inline-block;margin:0;padding:0}nav ul ul{margin:0;display:none;background:rgba(91,103,113,0.8);padding:7px 0}nav ul ul>li:hover b{color:#d5d9e2}nav ul ul li{margin:0;padding:0}nav ul ul li>a{padding-left:42px;font-size:12px;font-weight:400;outline:0}nav ul ul li>a:hover{background-color:#46545e;color:#fff}nav ul ul li>a.active{margin-left:30px;padding-left:12px;background-color:#296191}.minified nav ul ul li>a.active{margin-left:0}nav ul ul ul{background:0;padding:0}nav ul ul ul li a{color:#bfbfbf;padding:8px 10px 8px 60px;font-size:11px}nav ul ul ul li a:hover{background-color:#46545e;color:#fff}nav ul ul ul li a.active{margin-left:50px;padding-left:10px}nav ul ul ul ul li a{padding-left:90px}nav ul ul ul ul li a.active{margin-left:80px;padding-left:10px}nav ul ul ul ul ul li a{padding-left:110px}nav ul ul ul ul ul li a.active{margin-left:100px;padding-left:10px}nav ul ul ul ul ul ul li a{padding-left:130px}nav ul ul ul ul ul ul li a.active{margin-left:120px;padding-left:10px}nav ul ul b{color:#b3b3b3}nav>ul>li{border-top:1px solid #718999;border-bottom:1px solid #576975}nav>ul>li:hover>ul::before,nav>ul>li:hover>ul>li::before{border-color:#acacac!important}nav>ul>li>a>.badge.pull-right{margin-right:15px}nav>ul>li>a b{position:absolute!important;right:10px;top:10px}nav>ul>li>a>i{margin-right:5px;width:15px;display:inline-block;text-align:center;position:relative}nav>ul>li>a>i>em{font-size:9px;display:block;padding:2px;position:absolute;top:-8px;right:-6px;text-decoration:none;font-style:normal;background:#ed1c24;color:#fff;min-width:13px;border-radius:50%;max-height:13px;line-height:8px;font-weight:700;vertical-align:baseline;white-space:nowrap;text-align:center;border:1px solid rgba(255,255,255,0.1)}nav>ul>li>ul::before{content:"";display:block;position:absolute;z-index:1;left:23px;top:0;bottom:0;border-left:1px solid #7a7a7a}nav>ul>li>ul>li>a,nav>ul>li>ul>li>ul>li>a{padding-top:5px;padding-bottom:5px}nav>ul ul li a i{font-size:14px!important;width:18px!important;text-align:center!important}nav>ul ul li::before{content:"";display:block;position:absolute;width:8px;left:23px;top:13px;border-top:1px solid #7a7a7a;z-index:1}nav>ul ul ul li::before{content:"";display:block;position:absolute;width:18px;left:10px;top:17px;border-top:1px solid transparent}@media(min-width:768px){.navbar-nav>li>a{padding-top:17px;padding-bottom:15px}}.ui-menu{display:block;width:155px;padding:2px;-webkit-box-shadow:0 2px 4px rgba(30,30,100,0.25);box-shadow:0 2px 4px rgba(30,30,100,0.25);background:#fff;border:1px solid rgba(0,0,0,0.2);z-index:1;list-style:none;margin:0;margin-bottom:2em;outline:0}.ui-menu .ui-menu{margin-top:-3px;position:absolute;list-style:none}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style:none;list-style-image:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:400}.ui-menu .ui-menu-item a.ui-corner-all{border-radius:0}.ui-menu .ui-menu-item a.ui-state-active,.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-widget-content{font-weight:700;margin:0;background-color:#428bca;border-color:#357ebd;color:#FFF;display:block;white-space:nowrap}.ui-menu .ui-menu-item a.ui-state-active{padding:1px .4em}.ui-menu .ui-menu-item a .ui-menu-icon{width:auto;height:auto;top:0;left:auto;right:auto;bottom:auto;text-indent:0}.ui-menu .ui-menu-divider{margin:5px -2px 5px -2px;height:0;font-size:0;line-height:0;border-width:1px 0 0}.ui-menu .ui-state-disabled{margin:.4em 0 .2em!important;background:none!important;color:#999!important;font-weight:400!important;cursor:default;line-height:1.5}.ui-menu .ui-state-disabled a{cursor:default}.ui-menu .ui-menu-icons{position:relative}.ui-menu .ui-menu-icons .ui-menu-item a{position:relative;padding-left:2em}.ui-menu .ui-icon{position:absolute;top:.2em;left:.2em}.ui-menu .ui-menu-icon{position:static;float:right}.dropdown-menu>li>a:hover{background-color:#e0e0e0}.open>.dropdown-menu{-webkit-animation-name:flipInX;animation-name:flipInX;-webkit-animation-duration:.4s;animation-duration:.4s;-webkit-animation-fill-mode:both;animation-fill-mode:both}.dropdown-menu .small.divider{margin:3px 0}.dropdown-menu-xs{min-width:37px}.dropdown-menu-xs>li>a{padding:3px 10px}.dropdown-menu-xs>li>a:hover i{color:#fff!important}.dropdown-submenu{position:relative}.dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px}.dropdown-submenu:hover>.dropdown-menu{display:block}.dropdown-submenu>a:after{display:block;content:" ";float:right;width:0;height:0;border-color:transparent;border-style:solid;border-width:5px 0 5px 5px;border-left-color:#bfbfbf;margin-top:5px;margin-right:-10px}.dropdown-submenu:hover>a:after{border-left-color:#fff}.dropdown-submenu.pull-left{float:none}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px}.ajax-dropdown{position:absolute;display:none;z-index:1003;top:48px;left:16px;width:344px;height:435px;border-radius:0;-webkit-box-shadow:0 2px 4px rgba(30,30,100,0.25);box-shadow:0 2px 4px rgba(30,30,100,0.25);padding:10px;background:#fff;border:1px solid #b3b3b3}@media only screen and (min-width:320px) and (max-width:479px){.ajax-dropdown{width:299px;height:320px;left:0;top:49px}}.ajax-dropdown:after,.ajax-dropdown:before{bottom:100%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}.ajax-dropdown:before{border-color:rgba(131,131,131,0);border-bottom-color:#838383;border-width:8px;left:50%;margin-left:-8px}@media only screen and (min-width:320px) and (max-width:479px){.ajax-dropdown:before{margin-left:-14px}}.ajax-dropdown:after{border-color:rgba(255,255,255,0);border-bottom-color:#fff;border-width:7px;left:50%;margin-left:-7px}@media only screen and (min-width:320px) and (max-width:479px){.ajax-dropdown:after{margin-left:-13px}}.ajax-dropdown>:last-child{font-size:13px;display:block;padding:5px 0;line-height:22px;font-weight:400}.ajax-dropdown>:first-child{margin:0 0 3px;padding:0 0 9px}.ajax-dropdown .fa-4x.fa-border{border-width:3px;border-radius:50%;display:block;margin:0 auto;width:46px;text-align:center;color:#d1d1d1;border-color:#d1d1d1}.ajax-dropdown .btn-group .btn{font-weight:700;text-transform:capitalize}.ajax-dropdown .btn-group>:nth-child(2){border-right-width:0;border-left-width:0}.ajax-dropdown .btn-group .btn:active{top:0;left:0}.active+.ajax-dropdown{-webkit-animation-name:flipInY;animation-name:flipInY;-webkit-animation-duration:.7s;animation-duration:.7s;-webkit-animation-fill-mode:both;animation-fill-mode:both}.dropdown-large{position:static!important}.dropdown-menu-large{margin-left:16px;margin-right:16px;padding:20px 0}.dropdown-menu-large>li>ul{padding:0;margin:0}.dropdown-menu-large>li>ul>li{list-style:none}.dropdown-menu-large>li>ul>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.428571429;color:#333;white-space:normal}.dropdown-menu-large>li ul>li>a:focus,.dropdown-menu-large>li ul>li>a:hover{text-decoration:none;color:#262626;background-color:#f5f5f5}.dropdown-menu-large .disabled>a,.dropdown-menu-large .disabled>a:focus,.dropdown-menu-large .disabled>a:hover{color:#999}.dropdown-menu-large .disabled>a:focus,.dropdown-menu-large .disabled>a:hover{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);cursor:not-allowed}.dropdown-menu-large .dropdown-header{color:#428bca;font-size:18px}@media(max-width:768px){.dropdown-menu-large{margin-left:0;margin-right:0}.dropdown-menu-large>li{margin-bottom:30px}.dropdown-menu-large>li:last-child{margin-bottom:0}.dropdown-menu-large .dropdown-header{padding:3px 15px!important}}.wijmo-wijmenu{padding:0 20px;background-color:#222;background-repeat:repeat-x;background-image:-webkit-gradient(linear,top left,bottom left,from(#333),to(#222));background-image:-webkit-linear-gradient(top,#333,#222);background-image:linear-gradient(top,#333,#222);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333',endColorstr='#222222',GradientType=0);-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.25),inset 0 -1px 0 rgba(0,0,0,0.1);box-shadow:0 1px 3px rgba(0,0,0,0.25),inset 0 -1px 0 rgba(0,0,0,0.1)}.wijmo-wijmenu .ui-state-default .wijmo-wijmenu-text{color:#bfbfbf}.wijmo-wijmenu .ui-state-hover{background:#444;background:rgba(255,255,255,0.05)}.wijmo-wijmenu .ui-state-hover .wijmo-wijmenu-text{color:#fff}.wijmo-wijmenu .ui-widget-header h3{position:relative;margin-top:1px;padding:0}.wijmo-wijmenu h3 a{color:#fff;display:block;float:left;font-size:20px;font-weight:200;line-height:1;margin-left:-20px;margin-top:1px;padding:8px 20px 12px}.wijmo-wijmenu h3 a:hover{background-color:rgba(255,255,255,0.05);color:#fff;text-decoration:none}.wijmo-wijmenu .ui-widget-header{border:0}.wijmo-wijmenu .wijmo-wijmenu-parent .wijmo-wijmenu-child{padding:.3em 0}.wijmo-wijmenu .wijmo-wijmenu-item{margin:0;border:0}.wijmo-wijmenu .wijmo-wijmenu-item .wijmo-wijmenu-child{background:#333;border:0;margin:0;padding:6px 0;width:160px;border-radius:0 0 6px 6px;-webkit-box-shadow:0 2px 4px rgba(0,0,0,0.2);box-shadow:0 2px 4px rgba(0,0,0,0.2)}.wijmo-wijmenu a.wijmo-wijmenu-link{margin:0;line-height:19px;padding:10px 10px 11px;border:0;border-radius:0}.wijmo-wijmenu .wijmo-wijmenu-child .wijmo-wijmenu-link{display:block;float:none;padding:4px 15px;width:auto}.wijmo-wijmenu .wijmo-wijmenu-child .wijmo-wijmenu-text{float:none}.wijmo-wijmenu .wijmo-wijmenu-item .wijmo-wijmenu-child .ui-state-hover{background:#191919}.wijmo-wijmenu .wijmo-wijmenu-item .wijmo-wijmenu-separator{padding:5px 0;background-image:none;background-color:#222;border-top:1px solid #444;border-bottom:0;border-left:0;border-right:0}.wijmo-wijmenu .wijmo-wijmenu-item input{-moz-transition:none 0s ease 0s;background-color:rgba(255,255,255,0.3);border:1px solid #111;border-radius:4px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.1) inset,0 1px 0 rgba(255,255,255,0.25);box-shadow:0 1px 2px rgba(0,0,0,0.1) inset,0 1px 0 rgba(255,255,255,0.25);color:rgba(255,255,255,0.75);font-family:Ubuntu,Helvetica,Arial,sans-serif;line-height:1;margin:5px 10px 0;padding:4px 9px;width:100px}.wijmo-wijmenu .wijmo-wijmenu-item input:hover{background-color:rgba(255,255,255,0.5);color:#fff}.wijmo-wijmenu .wijmo-wijmenu-item input:focus{background-color:#fff;border:0 none;-webkit-box-shadow:0 0 3px rgba(0,0,0,0.15);box-shadow:0 0 3px rgba(0,0,0,0.15);color:#404040;outline:0 none;padding:5px 10px;text-shadow:0 1px 0 #fff}.wijmo-wijmenu .ui-state-default{text-shadow:none;-webkit-box-shadow:none;box-shadow:none;color:#bfbfbf;-webkit-filter:none;filter:none}.tabs-below>.nav-tabs,.tabs-left>.nav-tabs,.tabs-right>.nav-tabs{border-bottom:0}.nav-tabs.bordered{background:#fff;border:1px solid #ddd}.nav-tabs.bordered>:first-child a{border-left-width:0!important}.nav-tabs.bordered+.tab-content{border:1px solid #ddd;border-top:0}.nav-tabs>li>a{padding:4px 10px;border-radius:0;color:#333}.nav-tabs>li>a.xsmall{line-height:1.0;padding:3px 8px}.nav-tabs>li>a .label{display:inline-block;font-size:11px;margin-left:5px;opacity:.5}.nav-tabs>li>a .badge{font-size:11px;padding:4px 5px 2px;opacity:.5;margin-left:5px;min-width:17px;font-weight:400}.tabs-left .nav-tabs>li>a .badge{margin-right:5px;margin-left:0}.nav-tabs>li>a>.fa{opacity:.5}.nav-tabs.small>li>a{padding:2px 8px;font-size:90%}.nav-tabs.tiny>li>a{padding:1px 6px;font-size:75%}.nav-tabs>li.active>a{-webkit-box-shadow:0 -2px 0 #3276b1;box-shadow:0 -2px 0 #3276b1;border-top-width:0!important;margin-top:1px!important;font-weight:700}.nav-tabs>li.active>a .badge,.nav-tabs>li.active>a .label,.nav-tabs>li.active>a>.fa{opacity:1}.tabs-left .nav-tabs>li.active>a{-webkit-box-shadow:-2px 0 0 #3276b1;box-shadow:-2px 0 0 #3276b1;border-top-width:1px!important;border-left:0!important;margin-left:1px!important}.tabs-right .nav-tabs>li.active>a{-webkit-box-shadow:2px 0 0 #3276b1;box-shadow:2px 0 0 #57889c;border-top-width:1px!important;border-right:0!important;margin-right:1px!important}.tabs-below .nav-tabs>li.active>a{-webkit-box-shadow:0 2px 0 #3276b1;box-shadow:0 2px 0 #3276b1;border-bottom-width:0!important;border-top:0!important;margin-top:0!important}.tabs-left>.nav-tabs>li,.tabs-right>.nav-tabs>li,.tabs-left>.nav-pills>li,.tabs-right>.nav-pills>li{float:none}.tabs-left>.nav-tabs>li>a,.tabs-right>.nav-tabs>li>a,.tabs-left>.nav-pills>li>a,.tabs-right>.nav-pills>li>a{min-width:74px;margin-right:0;margin-bottom:3px}.tabs-left .nav-pills>li.active>a{border:0!important;box-shadow:none!important;-webkit-box-shadow:none!important}.tabs-left>.nav-pills,.tabs-left>.nav-tabs{float:left;margin-right:19px;border-right:1px solid #ddd}.tabs-left>.nav-pills{border-right:0}.tabs-left>.nav-tabs>li>a{margin-right:-1px}.tabs-left>.nav-tabs>li>a:focus,.tabs-left>.nav-tabs>li>a:hover{border-color:#eee #d5d5d5 #eee #eee}.tabs-left>.nav-tabs .active>a,.tabs-left>.nav-tabs .active>a:focus,.tabs-left>.nav-tabs .active>a:hover{border-color:#d5d5d5 transparent #d5d5d5 #ddd;*border-right-color:#fff}.tabs-left>.tab-content{margin-left:109px}.tabs-right>.nav-tabs{float:right;margin-left:19px;border-left:1px solid #ddd}.tabs-right>.nav-tabs>li>a{margin-left:-1px}.tabs-right>.nav-tabs>li>a:focus,.tabs-right>.nav-tabs>li>a:hover{border-color:#eee #eee #eee #ddd}.tabs-right>.nav-tabs .active>a,.tabs-right>.nav-tabs .active>a:focus,.tabs-right>.nav-tabs .active>a:hover{border-color:#ddd #ddd #ddd transparent;*border-left-color:#fff}.tabs-pull-right.nav-tabs>li,.tabs-pull-right.nav-pills>li{float:right}.tabs-pull-right.nav-tabs>li:first-child>a,.tabs-pull-right.nav-pills>li:first-child>a{margin-right:1px}.tabs-pull-right.bordered.nav-pills>li:first-child>a,.tabs-pull-right.bordered.nav-tabs>li:first-child>a{border-left-width:1px!important;margin-right:0;border-right-width:0}.tabs-below>.nav-tabs{border-top:1px solid #ddd}.tabs-below>.nav-tabs>li{margin-top:-1px;margin-bottom:0}.tabs-below>.nav-tabs>li>a:focus,.tabs-below>.nav-tabs>li>a:hover{border-top-color:#ddd;border-bottom-color:transparent}.tabs-below>.nav-tabs>.active>a,.tabs-below>.nav-tabs>.active>a:focus,.tabs-below>.nav-tabs>.active>a:hover{border-color:transparent #ddd #ddd}.pill-content>.pill-pane,.tab-content>.pill-pane,.pill-content>.tab-pane,.tab-content>.tab-pane{display:none}.pill-content>.active,.tab-content>.active,.pill-content>.active,.tab-content>.active{display:block}.pill-content.transparent,.tab-content.transparent{background-color:transparent}.pill-content.bordered,.tab-content.bordered,.pill-content.bordered:hover,.tab-content.bordered:hover{border-color:#ddd;border-top:0}.ams-widget>header>.nav-tabs.pull-left>li:first-child a{border-left-width:0!important}h1,h2,h3,h4{margin:0;font-family:"Ubuntu-Bold",Arial,Helvetica,Sans-Serif;font-weight:300}h1{letter-spacing:-1px;font-size:24px;margin:10px 0}h1 small{font-size:18px;font-weight:300;letter-spacing:-1px}h2{letter-spacing:-1px;font-size:22px;margin:20px 0 15px;line-height:normal}h3{display:block;font-size:19px;font-weight:400;margin:16px 0 10px;line-height:normal}h4{line-height:normal;font-size:17px;font-weight:300;margin:12px 0 8px}h5{font-size:15px;font-weight:300;margin:10px 0 6px;line-height:normal}h6{font-size:14px;margin:10px 0 4px;font-weight:300;line-height:normal}hr .simple{margin-top:10px;margin-bottom:10px;border-style:dashed}li.nodot{list-style-type:none}img.online{border-left-color:#40ac2b!important}img.busy{border-left-color:#ed1c24!important}img.offline{border-left-color:#ddd!important}img.away{border-left-color:#ffc40d!important}[data-ams-url],[data-ams-click-handler]{cursor:pointer}label{font-weight:400}article.sortable-grid{min-height:30px}.caret{border-top:5px solid;border-right:5px solid transparent;border-left:5px solid transparent}.fixed{position:fixed}@media(max-width:768px){.xs-fixed{position:fixed}}@media(min-width:768px) and (max-width:992px){.sm-fixed{position:fixed}}@media(min-width:992px) and (max-width:1200px){.md-fixed{position:fixed}}@media(min-width:1200px){.lg-fixed{position:fixed}}.outside{position:absolute;left:-9999px}@media(max-width:979px){.visible-tablet{display:inline-block!important}}@media(max-width:979px){.hidden-tablet,.display-inline.hidden-tablet{display:none!important}}@media only screen and (min-width:0) and (max-width:679px){.hidden-tablet{display:none!important}}@media only screen and (min-width:320px) and (max-width:479px){.visible-mobile{display:inline-block!important}}@media only screen and (min-width:320px) and (max-width:479px){.hidden-mobile{display:none!important}}.viewport-y{overflow-y:auto}.viewport-y.viewport-100{max-height:100px}.viewport-y.viewport-200{max-height:200px}.viewport-y.viewport-300{max-height:300px}.viewport-y.viewport-600{max-height:600px}.viewport-y.viewport-400{max-height:400px}.viewport-y.viewport-500{max-height:500px}.viewport-y.viewport-600{max-height:600px}.viewport-x{overflow-x:auto}.viewport-x.viewport-100{max-width:100px}.viewport-x.viewport-200{max-width:200px}.viewport-x.viewport-300{max-width:300px}.viewport-x.viewport-400{max-width:400px}.viewport-x.viewport-500{max-width:500px}.viewport-x.viewport-600{max-width:600px}.height-100{min-height:100px}.height-200{min-height:200px}.height-300{min-height:300px}.height-400{min-height:400px}.height-500{min-height:500px}.height-600{min-height:600px}.lead{font-size:19px}.alert{margin-bottom:20px;margin-top:0;color:#675100;border-width:0;border-left-width:5px;padding:10px;border-radius:0}.alert .close{top:0;right:-5px;line-height:20px}.alert-heading{font-weight:600}.alert-danger{border-color:#963b49;color:#fff;background:#c46a69;text-shadow:none}.alert-warning{border-color:#e5c693;color:#6b6d31;background:#ecdfb0}.alert-success{border-color:#8eb589;color:#296829;background:#cee0cf}.alert-info{border-color:#9cb4c5;color:#346597;background:#d6dde7}.alert ul{margin-left:25px;list-style-position:outside;list-style-type:square}.ams-form>.alert{margin:5px;padding:5px;box-shadow:none!important;-webkit-box-shadow:none!important;border-radius:0!important}.help{font-size:90%;padding:5px!important}.help p{margin:0 0 1px;line-height:1.15}.modal-dialog .help{margin-bottom:5px!important}.well{background:#fbfbfb;border:1px solid #ddd;box-shadow:0 1px 1px #ececec;-webkit-box-shadow:0 1px 1px #ececec;position:relative}.well.well-clean{-webkit-box-shadow:none;box-shadow:none;border-color:transparent}.well.well-glass{-webkit-box-shadow:none;box-shadow:none;border-color:transparent;background-color:rgba(255,255,255,0.25);color:#fff}.well.well-light{background:#fff;border:1px solid #e2e2e2}.widget-body .well{margin-bottom:0}.well.transparent{border:0!important;background:none!important}.ams-widget.well.transparent>div,.ams-widget.well.transparent>div .widget-body{padding:0!important}.well[class*=" bg-"],.well[class^=bg-]{border:1px solid #555!important}.note{margin-top:6px;padding:0 1px;font-size:11px;line-height:15px;color:#999}.subscript{font-size:21px;color:#999}.display-image{margin-top:-60px;margin-right:20px}.terms-body{max-height:400px;overflow:auto}.timeline-seperator{display:block;text-align:center;color:#999;margin:20px 0 0}.timeline-seperator>:first-child{padding:4px 5px;border:1px dashed rgba(0,0,0,0.1);background:#fff;font-size:11px;border-radius:4px}.timeline-seperator .btn,.timeline-seperator .btn+.dropdown-menu{margin-right:15px}.timeline-seperator:after{display:block;content:" ";margin:0 20px;border-bottom:1px dashed rgba(0,0,0,0.1);margin-top:-8px}.progress{position:relative;margin-bottom:20px;overflow:hidden;height:22px;background:#eee;box-shadow:0 1px 0 transparent,0 0 0 1px #e3e3e3 inset;-webkit-box-shadow:0 1px 0 transparent,0 0 0 1px #e3e3e3 inset;border-radius:0}.progress-bar{float:left;width:0;height:100%;font-size:11px;color:#fff;text-align:center;background-color:#57889c;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);font-weight:700;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-image:url(../img/pattern/overlay-pattern.png)}.progress-striped .progress-bar{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-ms-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-danger{background-color:#a90329}.progress-striped .progress-bar-danger{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-bar-success{background-color:#739e73}.progress-striped .progress-bar-success{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#c79121}.progress-striped .progress-bar-warning{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#57889c}.progress-striped .progress-bar-info{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress .bar-info,.progress-info .bar{background:#57889c}.progress-micro{height:3px!important;line-height:3px!important}.progress-xs{height:7px!important;line-height:7px!important}.progress-sm{height:14px!important;line-height:14px!important}.progress-lg{height:30px!important;line-height:30px!important}.progress .progress-bar{position:absolute;overflow:hidden;line-height:20px}.progress .progressbar-back-text{position:absolute;width:100%;height:100%;font-size:12px;line-height:20px;text-align:center}.progress .progressbar-front-text{display:block;width:100%;font-size:12px;line-height:20px;text-align:center}.progress.right .progress-bar{right:0}.progress.right .progressbar-front-text{position:absolute;right:0}.progress.vertical{width:25px;height:100%;min-height:150px;margin-right:20px;display:inline-block;margin-bottom:0}.progress.vertical.bottom{position:relative}.progress.vertical.bottom .progress-bar{position:absolute;bottom:0}.progress.vertical.bottom .progressbar-front-text{position:absolute;bottom:0}.progress.vertical .progress-bar{width:100%;height:0;-webkit-transition:height .6s ease;transition:height .6s ease}.progress.wide-bar{width:40px}.dd{position:relative;display:block;margin:0;padding:0;max-width:600px;list-style:none;font-size:13px;line-height:20px}@media only screen and (min-width:700px){.dd{float:left;width:100%}.dd+.dd{margin-left:2%}}.dd-header.calender-spacer{height:46px;display:block}.dd-list{display:block;position:relative;margin:0;padding:0;list-style:none}.dd-list .dd-list{padding-left:30px}.dd-collapsed .dd-list{display:none}.dd-empty{border:1px dashed #bbb;min-height:100px;background-color:#eee;background-image:-webkit-linear-gradient(45deg,#fff 25%,transparent 25%,transparent 75%,#fff 75%,#fff),-webkit-linear-gradient(45deg,#fff 25%,transparent 25%,transparent 75%,#fff 75%,#fff);background-image:linear-gradient(45deg,#fff 25%,transparent 25%,transparent 75%,#fff 75%,#fff),linear-gradient(45deg,#fff 25%,transparent 25%,transparent 75%,#fff 75%,#fff);-webkit-background-size:60px 60px;background-size:60px 60px;background-position:0 0,30px 30px}.dd-empty,.dd-placeholder{margin:5px 0;padding:0;min-height:30px;background:#f2fbff;border:1px dashed #b6bcbf;-webkit-box-sizing:border-box;box-sizing:border-box;-moz-box-sizing:border-box}.dd-empty,.dd-item,.dd-placeholder{display:block;position:relative;margin:0;padding:0;min-height:20px;font-size:13px;line-height:20px}.dd-handle{display:block;font-size:15px;margin:5px 0;padding:7px 15px;color:#333;text-decoration:none;border:1px solid #cfcfcf;background:#fbfbfb}.dd-handle:hover,.dd-handle:hover+.dd-list .dd-handle{background:#fddfb3!important;border:1px solid #faa937;color:#333!important}.dd-handle>span{font-size:13px;color:#777}.dd-hover>.dd-handle{background:#2ea8e5!important}.dd-item>button{position:relative;cursor:pointer;float:left;width:25px;height:20px;margin:7px 10px;line-height:22px!important;padding:0;text-indent:100%;white-space:nowrap;overflow:hidden;border:0;background:rgba(0,0,0,0);text-align:center;display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:400;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:18px}.dd-item>button:before{content:'\f055';display:block;position:absolute;width:100%;text-align:center;text-indent:0;color:#0091d9}.dd-item>button[data-action=collapse]:before{content:'\f056';color:#a90329}.dd-dragel{position:absolute;pointer-events:none;z-index:9999}.dd-dragel>.dd-item .dd-handle{margin-top:0}.dd-dragel>.dd-item>.dd-handle{border-left-width:4px}.dd-dragel .dd-handle{-webkit-box-shadow:2px 4px 6px 0 rgba(0,0,0,0.1);box-shadow:2px 4px 6px 0 rgba(0,0,0,0.1)}.dd-dragel>li.dd-item.dd3-item{position:relative;top:10px;left:10px;z-index:999}.vertical-bars{padding:0;margin:0}.vertical-bars:after{content:"";display:block;height:0;clear:both}.vertical-bars li{padding:14px 0;width:25%;display:block;float:left;text-align:center}.vertical-bars li:first-child{border-left:0}.vertical-bars>li>.progress.vertical{margin:0 auto;float:none}.vertical-bars>li>.progress.vertical:first-child{margin-left:auto}.bar-holder{padding:18px 15px}.bar-holder:first-child{border-top:0}.bar-holder .progress{margin:0}.pagination.pagination-alt>li>a{box-shadow:none;-webkit-box-shadow:none;border:0;margin-left:-1px}.pagination.pagination-alt>li:first-child>a{padding-left:0}.pagination>li>a,.pagination>li>span{padding:7px 12px 5px;box-shadow:inset 0 -2px 0 rgba(0,0,0,0.05);-webkit-box-shadow:inset 0 -2px 0 rgba(0,0,0,0.05)}.pagination-xs>li>a,.pagination-xs>li>span{padding:5px 9px 3px;font-size:12px}.panel-purple{border-color:#6e587a}.panel-purple>.panel-heading{color:#fff;background-color:#6e587a;border-color:#6e587a}.panel-greenLight{border-color:#71843f}.panel-greenLight>.panel-heading{color:#fff;background-color:#71843f;border-color:#71843f}.panel-greenDark{border-color:#496949}.panel-greenDark>.panel-heading{color:#fff;background-color:#496949;border-color:#496949}.panel-darken{border-color:#333}.panel-darken>.panel-heading{color:#fff;background-color:#404040;border-color:#404040}.panel-pink{border-color:#ac5287}.panel-pink>.panel-heading{color:#fff;background-color:#ac5287;border-color:#ac5287}.panel-green{border-color:#356e35}.panel-green>.panel-heading{color:#fff;background-color:#356e35;border-color:#356e35}.panel-blueLight{border-color:#92a2a8}.panel-blueLight>.panel-heading{color:#fff;background-color:#92a2a8;border-color:#92a2a8}.panel-pinkDark{border-color:#a8829f}.panel-pinkDark>.panel-heading{color:#fff;background-color:#a8829f;border-color:#a8829f}.panel-redLight{border-color:#a65858}.panel-redLight>.panel-heading{color:#fff;background-color:#a65858;border-color:#a65858}.panel-red{border-color:#a90329}.panel-red>.panel-heading{color:#fff;background-color:#a90329;border-color:#a90329}.panel-teal{border-color:#568a89}.panel-teal>.panel-heading{color:#fff;background-color:#568a89;border-color:#568a89}.panel-orange{border-color:#c79121}.panel-orange>.panel-heading{color:#fff;background-color:#c79121;border-color:#c79121}.panel-blueDark{border-color:#4c4f53}.panel-blueDark>.panel-heading{color:#fff;background-color:#4c4f53;border-color:#4c4f53}.panel-magenta{border-color:#6e3671}.panel-magenta>.panel-heading{color:#fff;background-color:#6e3671;border-color:#6e3671}.panel-blue{border-color:#57889c}.panel-blue>.panel-heading{color:#fff;background-color:#57889c;border-color:#57889c}.panel-footer>.btn-block{border-radius:0;border-bottom:0;border-left:0;border-right:0}.notification-body{padding:0 0 0 3px;margin:0;list-style:none}.notification-body *,.notification-body:after *,.notification-body:before *{box-sizing:border-box!important;-webkit-box-sizing:border-box!important;-moz-box-sizing:border-box!important}.notification-body>li{border-bottom:1px solid #e9e9e9;position:relative}.notification-body>li>span{background:#fff;display:block;min-height:25px;overflow:hidden;padding:8px 10px 13px;white-space:normal}.notification-body>li>span:hover{background:#f0f4f7;color:#667f8f}.notification-body>li a.msg{padding-left:50px!important}.notification-body>li a,.notification-body>li a span{display:block;position:relative;overflow:hidden}.notification-body>li a,.notification-body>li a:hover{text-decoration:none}.notification-body>li:hover .progress{background:#fff;box-shadow:0 1px 0 rgba(0,0,0,0),0 0 0 1px #a7a7a7 inset;-webkit-box-shadow:0 1px 0 rgba(0,0,0,0),0 0 0 1px #ccc inset}.notification-body>li:hover .text-muted{color:#333}.notification-body .from{font-size:14px;line-height:normal;color:#333;font-weight:400;margin-right:60px;margin-bottom:6px;height:20px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.notification-body .unread{background:#ffffe0}.notification-body .unread .unread .from{font-weight:700}.notification-body time{position:absolute;top:3px;right:0;font-size:11px;font-weight:400;color:#058dc7}.notification-body .msg-body,.notification-body .subject{font-size:13px;color:#a0a0a0;max-height:35px;width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.notification-body .subject{font-size:13px;color:#333;max-height:22px}.ajax-notifications{height:365px;display:block;overflow:auto;margin-right:-10px;margin-left:-10px;border-bottom:1px solid #cecece;border-top:1px solid #cecece;background:#e9e9e9}@media only screen and (min-width:320px) and (max-width:479px){.ajax-notifications{height:250px}}.ajax-notifications>.alert.alert-transparent{background-color:transparent;border-color:transparent;color:#757575;margin:13px 10px}.ajax-notifications>.alert>:first-child{margin-bottom:10px;font-weight:400}.arrow-box-up:before,.arrow-box-up:after{bottom:100%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}.arrow-box-up:before{border-color:rgba(131,131,131,0);border-bottom-color:#838383;border-width:8px;left:50%;margin-left:-8px}.arrow-box-up:after{border-color:rgba(255,255,255,0);border-bottom-color:#fff;border-width:7px;left:50%;margin-left:-7px}.arrow-box-up-right:before,.arrow-box-up-right:after{bottom:100%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}.arrow-box-up-right:before{border-color:rgba(131,131,131,0);border-bottom-color:#838383;border-width:8px;right:9px;margin-left:-8px}.arrow-box-up-right:after{border-color:rgba(255,255,255,0);border-bottom-color:#fff;border-width:7px;right:10px;margin-left:-7px}.tooltip-inner{padding:5px 10px;font-size:11px;font-family:Ubuntu,Arial,Helvetica,sans-serif;font-weight:700;border-radius:0}.jqstooltip{padding:7px!important;border-radius:3px!important;border:0!important;background-color:#000!important;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box}.jqstooltip .jqsfield{font-family:Ubuntu,Arial,sans-serif;font-size:11px}.dd3-content{display:block;margin:5px 0;padding:6px 10px 8px 40px;font-size:15px;color:#333;text-decoration:none;border:1px solid #cfcfcf;background:#fbfbfb}.dd3-content:hover{color:#2ea8e5;background:#fff}.dd-dragel>.dd3-item>.dd3-content{margin:0}.dd3-item>button{margin-left:38px}.dd3-handle{position:absolute;margin:0;left:0;top:0;cursor:move;width:30px;text-indent:100%;white-space:nowrap;overflow:hidden;border:1px solid #aaa;background:#bfbfbf;background:-webkit-gradient(linear,top left,bottom left,from(#ddd),to(#bbb));background:-webkit-linear-gradient(top,#ddd 0,#bbb 100%);background:linear-gradient(top,#ddd 0,#bbb 100%);display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:18px;padding:8px 15px}.dd3-handle:before{content:'\f0c9';display:block;position:absolute;left:0;top:3px;width:100%;text-align:center;text-indent:0;color:#818181;font-weight:400;line-height:28px}.dd3-handle:hover:before{color:#c27616}.nestable-lists{display:block;clear:both;padding:30px 0;width:100%;border:0;border-top:2px solid #bfbfbf;border-bottom:2px solid #bfbfbf}#nestable-menu{padding:0;margin:10px 0 20px}#nestable-output,#nestable2-output{width:100%;padding:5px}.custom-scroll::-webkit-scrollbar{-webkit-overflow-scrolling:touch;height:10px;width:10px}.custom-scroll::-webkit-scrollbar:hover{background-color:#e9e9e9;border:1px solid #dbdbdb}.custom-scroll::-webkit-scrollbar-button:start:decrement,.custom-scroll::-webkit-scrollbar-button:end:increment{background:0;display:block;height:0}.custom-scroll::-webkit-scrollbar-track{-webkit-background-clip:padding-box;background-clip:padding-box;border:solid transparent}.custom-scroll::-webkit-scrollbar-track-piece{-o-border-radius:0;background-color:transparent;border-radius:0}.custom-scroll::-webkit-scrollbar-thumb{-webkit-box-shadow:inset 1px 1px 0 rgba(0,0,0,0.1),inset 0 -1px 0 rgba(0,0,0,0.07);-webkit-background-clip:padding-box;background-clip:padding-box;background-color:rgba(0,0,0,0.2);border:0;box-shadow:inset 1px 1px 0 rgba(0,0,0,0.1),inset 0 -1px 0 rgba(0,0,0,0.07)}.custom-scroll::-webkit-scrollbar-thumb:vertical,.custom-scroll::-webkit-scrollbar-thumb:horizontal{-o-border-radius:0;background-color:#bfbfbf;border-radius:0}.custom-scroll::-webkit-scrollbar-thumb:active{-webkit-box-shadow:inset 1px 1px 3px rgba(0,0,0,0.33);background-color:rgba(0,0,0,0.44);box-shadow:inset 1px 1px 3px rgba(0,0,0,0.33)}.custom-scroll::-webkit-scrollbar-thumb:hover{background-color:#959595}.air{position:absolute;z-index:5}.air-bottom{bottom:0}.air-top{top:0}.air-top-right{top:0;right:0}.air-top-left{top:0;left:0}.air-bottom-left{bottom:0;left:0}.air-bottom-right{bottom:0;right:0}.tree{min-height:20px;border-radius:4px}.tree li{list-style-type:none;margin:0;padding:3px 0 3px 5px;position:relative}.tree li:after,.tree li:before{content:'';left:-20px;position:absolute;right:auto}.tree li:before{border-left:1px solid #999;bottom:50px;height:100%;top:-5px;width:1px;-webkit-transition:"border-color 0.1s ease 0.1s";transition:"border-color 0.1s ease 0.1s"}.tree li:last-child::before{height:30px}.tree li:after{border-top:1px solid #999;height:20px;top:14px;width:25px}.tree li:hover{background:rgba(0,0,0,0.15)}.tree li>span{border:1px dotted #999;border-radius:5px;display:inline-block;padding:4px 8px;text-decoration:none;-webkit-transition:color .2s ease .1s,background-color .2s ease .1s,border-color .3s ease .2s;transition:color .2s ease .1s,background-color .2s ease .1s,border-color .3s ease .2s}.tree li>span>i{padding-right:4px}.tree li.parent_li>span{padding:7px}.tree li>span{cursor:pointer}.tree li>span:hover,.tree li>span:hover+ul li>span{background:#eee;border:1px solid #94a0b4;color:#000}.tree ul ul{padding-left:34px;padding-top:5px}.tree>ul{padding-left:0}.tree>ul>li:after,.tree>ul>li:before{border:0}.pace{-webkit-pointer-events:none;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.pace-inactive{display:none}.pace .pace-progress{background:#3276b1;position:fixed;z-index:2000;top:0;left:0;height:2px;-webkit-transition:width 1s;transition:width 1s}.pace .pace-progress-inner{display:block;position:absolute;right:0;width:100px;height:100%;-webkit-box-shadow:0 0 10px #29d,0 0 5px #29d;box-shadow:0 0 10px #29d,0 0 5px #29d;opacity:1;-webkit-transform:rotate(3deg) translate(0,-4px);-ms-transform:rotate(3deg) translate(0,-4px);transform:rotate(3deg) translate(0,-4px)}.pace .pace-activity{display:block;position:fixed;z-index:2000;top:63px;right:40px;width:14px;height:14px;border:solid 2px transparent;border-top-color:#29d;border-left-color:#29d;border-radius:10px;-webkit-animation:pace-spinner 400ms linear infinite;-ms-animation:pace-spinner 400ms linear infinite;animation:pace-spinner 400ms linear infinite}.table-full{width:100%}.table-wrap{overflow:auto}.table.has-tickbox thead tr th:first-child{width:18px}.table.has-tickbox.ams-form tbody tr td:first-child .checkbox,.table.has-tickbox.ams-form tbody tr td:first-child .radio,.table.has-tickbox.ams-form thead tr th:first-child .checkbox,.table.has-tickbox.ams-form thead tr th:first-child .radio{padding:0!important}.table-dnd tbody tr.dragging-row td{background-color:#cedbf7!important}.table-dnd tbody tr td:first-child{padding-left:20px!important}.table-dnd tbody td.drag-handle{background:transparent url('../img/vert-drag-handle.png') scroll no-repeat left 50%}.table-tight td,.table-tight th{padding:4px 8px!important;line-height:1.3!important}.table-mini td,.table-mini th{padding:1px 8px!important;line-height:1.1!important}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-width:1px}.table-bordered .no-padding>.table-bordered{border:0!important}.table-bordered .no-padding>.table-bordered tbody tr td:first-child,.table-bordered .no-padding>.table-bordered thead tr td:first-child,.table-bordered .no-padding>.table-bordered thead tr th:first-child{border-left-width:0!important}.table-bordered .no-padding>.table-bordered tbody tr td:last-child,.table-bordered .no-padding>.table-bordered thead tr th:last-child{border-right-width:0!important}.table-bordered .no-padding>.table-bordered tbody tr:last-child td{border-bottom-width:0!important}.no-padding .note-editable .table-bordered{border:1px solid #ddd!important}tr.bordered-bottom th,tr.bordered-bottom td{border-bottom:1px solid #ddd}.table-hover>tbody>tr:hover>td,.table-hover>tbody>tr:hover>th{background-color:#eee}th.checker,td.checker{width:30px}th.actions-menu{width:70px}th.action,td.action{width:26px}.dt-row{padding:4px 10px}.dt-top-row{height:0;line-height:0;position:relative}.dt-bottom-row{background:#fafafa;font-size:11px;overflow:hidden;padding:5px 10px;border-top:1px solid #ccc;-webkit-box-shadow:inset 0 1px #fff;-ms-box-shadow:inset 0 1px #fff;box-shadow:inset 0 1px #fff}.modal-dialog .ams-form .dt-bottom-row{padding:5px 10px!important}.modal-dialog .ams-form .dt-bottom-row .row{margin:0}.dataTables_length{position:absolute;right:13px;top:-35px}.dataTables_length select{width:60px;padding:3px;font-size:13px;border:1px solid #bbb}.dataTables_filter{position:absolute;left:10px;top:-35px}.dataTables_filter input{padding:3px 8px 1px;font-size:13px}.dataTables_filter .form-control{height:28px}.dataTables_filter .input-group{width:180px!important}.dataTables_filter input select{border:1px solid #bbb}.dataTables_paginate{margin:4px 0 0}.dataTables_paginate .pagination{margin:0}.dataTables_paginate .btn-group a{color:#2e5f87}.dataTables_wrapper{position:relative}.dataTables_wrapper table.table{clear:both;max-width:inherit;margin-bottom:0}.dataTables_wrapper table.table thead th{white-space:nowrap;text-overflow:ellipsis;-ms-text-overflow:ellipsis}.dataTables_wrapper table.table thead .sorting,.dataTables_wrapper table.table thead .sorting_asc,.dataTables_wrapper table.table thead .sorting_asc_disabled,.dataTables_wrapper table.table thead .sorting_desc,.dataTables_wrapper table.table thead .sorting_desc_disabled{cursor:pointer;padding-right:20px}.dataTables_wrapper table.table thead .sorting{background:url(../img/datatable/sort_both.png) no-repeat center right}.dataTables_wrapper table.table thead .sorting_asc{background:url(../img/datatable/sort_asc.png) no-repeat center right}.dataTables_wrapper table.table thead .sorting_desc{background:url(../img/datatable/sort_desc.png) no-repeat center right}.dataTables_wrapper table.table thead .sorting_asc_disabled{background:url(../img/datatable/sort_asc_disabled.png) no-repeat center right}.dataTables_wrapper table.table thead .sorting_desc_disabled{background:url(../img/datatable/sort_desc_disabled.png) no-repeat center right}.dataTables_wrapper table.table tbody tr.active th,.dataTables_wrapper table.table tbody tr.active td{background-color:#08C;color:#fff}.dataTables_wrapper table.table tbody tr.active:hover td,.dataTables_wrapper table.table tbody tr.active:hover th{background-color:#0075b0!important}.dataTables_wrapper table.dataTable th:active{outline:0}.dataTables_wrapper .table-striped tbody tr.active:nth-child(odd) td,.dataTables_wrapper .table-striped tbody tr.active:nth-child(odd) th{background-color:#017ebc}.dataTables_wrapper select{min-height:inherit}.dataTables_wrapper table+.row{margin-bottom:0;margin-top:10px}.dataTables_wrapper .dt_actions{float:left;margin-right:20px}.dataTables_wrapper .bottom,.dataTables_wrapper .top{background-color:#f5f5f5;border:1px solid #CCC;padding:15px}.dataTables_wrapper div.DTTT .btn:hover{text-decoration:none!important}.dataTables_wrapper ul.DTTT_dropdown.dropdown-menu a{color:#333!important}.dataTables_wrapper ul.DTTT_dropdown.dropdown-menu li:hover a{background-color:#08c;color:#fff!important}.dataTables_wrapper div.DTTT_print_info.modal{height:150px;margin-top:-75px;text-align:center}.dataTables_wrapper div.DTTT_print_info h6{font-weight:400;font-size:28px;line-height:28px;margin:1em}.dataTables_wrapper div.DTTT_print_info p{font-size:14px;line-height:20px}.dataTables_wrapper div.DTFC_LeftFootWrapper table,.dataTables_wrapper div.DTFC_LeftHeadWrapper table,.dataTables_wrapper table.DTFC_Cloned tr.even{background-color:#fff}.dataTables_wrapper div.DTFC_LeftHeadWrapper table{margin-bottom:0!important;border-top-right-radius:0!important;border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}.dataTables_scrollBody{-webkit-overflow-scrolling:touch}.top .dataTables_info{float:none}div.dt-bottom-row .dataTables_info{float:left;padding-top:10px;font-size:12px}.dataTables_full{width:100%!important}.dataTables_empty{text-align:center!important;font-size:15px;background:#fff!important;padding:20px 0!important;cursor:default}.dataTables_scroll{clear:both}.dataTables_scrollHeadInner table.table-bordered{border-radius:4px 4px 0 0}.dataTables_scrollHeadInner table.table-bordered,.dataTables_scrollHeadInner table.table-bordered thead{border-bottom:0}.dataTables_scrollBody table{border-top:0}.dataTables_processing{position:absolute;top:50%;margin-top:-24px;z-index:100;left:50%;width:250px;margin-left:-125px;border:1px solid #ddd;text-align:center;color:#000;background:#fff;font-size:15px!important;-webkit-box-shadow:0 0 4px rgba(0,0,0,0.2);-ms-box-shadow:0 0 4px rgba(0,0,0,0.2);box-shadow:0 0 4px rgba(0,0,0,0.2);padding:10px 0}.dataTables_wrapper .center{text-align:center}.dataTables_wrapper .details,.dataTables_wrapper .details:hover{background:#ddd!important}.dataTables_wrapper .details table td{background:#fff!important}.dataTables_scrollHeadInner table.table,.dataTables_wrapper .details table.table{margin:0!important}.dataTables_scrollHead table{margin-bottom:0!important;border-bottom-left-radius:0;border-bottom-right-radius:0}.dataTables_scrollHead table thead tr:last-child th:first-child{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}.DTFC_LeftHeadWrapper table thead tr:last-child td:first-child,.DTFC_LeftHeadWrapper table thead tr:last-child th:first-child{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}.DTFC_LeftBodyWrapper table,.dataTables_scrollBody table{border-top:0;margin-bottom:0!important}.DTFC_LeftBodyWrapper tbody tr:first-child td,.DTFC_LeftBodyWrapper tbody tr:first-child th,div.DTFC_LeftFootWrapper table,div.dataTables_scrollBody tbody tr:first-child th,div.dataTables_scrollFoot table{border-top:0}.ColVis{position:absolute;right:83px;top:-35px}.ColVis_collection{position:relative;width:180px;background-color:#fff;border:1px solid rgba(0,0,0,0.2);-webkit-box-shadow:0 2px 4px rgba(0,0,0,0.2);box-shadow:0 2px 4px rgba(0,0,0,0.2);z-index:1102;padding-top:3px;padding-left:10px;list-style-type:none;list-style-position:outside}.ColVis_collection .ColVis_Button{position:relative;margin-right:3px;height:30px;background-color:#fff;border:1px solid #d0d0d0;cursor:hand;padding:3px 5px}.ColVis_collection button.ColVis_Button{padding:4px 12px;height:26px;background-color:#fff;border:0;width:100%;float:none;font-size:12px}.ColVis_collection button.ColVis_Button+button.ColVis_Button{border-top:1px solid #e1e1e1}.ColVis_collection button.ColVis_Button button.ColVis_Button input{margin:0}button.ColVis_Button{padding:4px 5px;text-align:left}button.ColVis_Button::-moz-focus-inner{border:0!important;padding:0}.ColVis_collectionBackground{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#000;z-index:1100}div.ColVis_catcher{position:absolute;z-index:1101}span.ColVis_radio{display:inline-block;width:20px;vertical-align:-2px}.ColVis_text_hover,div.ColVis_collection button.ColVis_Button:hover{background:#f2f2f2;color:#222}table.DTCR_clonedTable{background-color:#fff;z-index:202}div.DTCR_pointer{width:1px;background-color:#0259c4;z-index:201}ul.DTTT_dropdown.dropdown-menu li{position:relative}ul.DTTT_dropdown.dropdown-menu li:hover a{background-color:#f2f2f2;color:#333!important}.table_tools_group{position:absolute;right:83px;top:-37px}.DTTT.btn-group{position:absolute;top:-38px;right:83px}.DTTT_dropdown{z-index:2002}.DTFC_LeftHeadWrapper{border-bottom:1px solid #ddd}div.DTTT_container{position:relative;float:right;margin-bottom:1em}a.DTTT_button,button.DTTT_button,div.DTTT_button{position:relative;float:left;margin-right:3px;padding:5px 8px;border:1px solid #999;cursor:pointer;*cursor:hand;font-size:.88em;color:#000!important;-o-border-radius:2px;border-radius:2px;-webkit-box-shadow:1px 1px 3px #ccc;-ms-box-shadow:1px 1px 3px #ccc;-o-box-shadow:1px 1px 3px #ccc;box-shadow:1px 1px 3px #ccc;background:#fff;background:-webkit-gradient(linear,top left,bottom left,from(#fff),color-stop(89%,#f3f3f3),to(#f9f9f9));background:-webkit-linear-gradient(top,#fff 0,#f3f3f3 89%,#f9f9f9 100%);background:linear-gradient(top,#fff 0,#f3f3f3 89%,#f9f9f9 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff',endColorstr='#f9f9f9',GradientType=0)}a.DTTT_button:hover,button.DTTT_button:hover,div.DTTT_button:hover{border:1px solid #666;text-decoration:none!important;-webkit-box-shadow:1px 1px 3px #999;-ms-box-shadow:1px 1px 3px #999;-o-box-shadow:1px 1px 3px #999;box-shadow:1px 1px 3px #999;background:#f3f3f3;background:-webkit-gradient(linear,top left,bottom left,from(#f3f3f3),color-stop(89%,#e2e2e2),to(#f4f4f4));background:-webkit-linear-gradient(top,#f3f3f3 0,#e2e2e2 89%,#f4f4f4 100%);background:linear-gradient(top,#f3f3f3 0,#e2e2e2 89%,#f4f4f4 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f3f3f3',endColorstr='#f4f4f4',GradientType=0)}button.DTTT_button{height:30px;padding:3px 8px}.DTTT_button embed{outline:0}a.DTTT_disabled,button.DTTT_disabled,div.DTTT_disabled{color:#999;border:1px solid #d0d0d0;background:#fff;background:-webkit-gradient(linear,top left,bottom left,from(#fff),color-stop(89%,#f9f9f9),to(#fafafa));background:-webkit-linear-gradient(top,#fff 0,#f9f9f9 89%,#fafafa 100%);background:linear-gradient(top,#fff 0,#f9f9f9 89%,#fafafa 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff',endColorstr='#fafafa',GradientType=0)}table.DTTT_selectable tbody tr{cursor:pointer;*cursor:hand}table.dataTable tr.DTTT_selected.odd td.sorting_1,table.dataTable tr.DTTT_selected.odd td.sorting_2,table.dataTable tr.DTTT_selected.odd td.sorting_3{background-color:#9fafd1}table.dataTable tr.DTTT_selected.even td.sorting_1,table.dataTable tr.DTTT_selected.even td.sorting_2,table.dataTable tr.DTTT_selected.even td.sorting_3{background-color:#b0bed9}div.DTTT_collection{width:150px;padding:8px 8px 4px;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.4);background-color:#f3f3f3;background-color:rgba(255,255,255,0.3);overflow:hidden;z-index:2002;-o-border-radius:5px;border-radius:5px;-webkit-box-shadow:3px 3px 5px rgba(0,0,0,0.3);-ms-box-shadow:3px 3px 5px rgba(0,0,0,0.3);-o-box-shadow:3px 3px 5px rgba(0,0,0,0.3);box-shadow:3px 3px 5px rgba(0,0,0,0.3)}div.DTTT_collection a.DTTT_button,div.DTTT_collection button.DTTT_button,div.DTTT_collection div.DTTT_button{position:relative;left:0;right:0;display:block;float:none;margin-bottom:4px;-webkit-box-shadow:1px 1px 3px #999;-ms-box-shadow:1px 1px 3px #999;-o-box-shadow:1px 1px 3px #999;box-shadow:1px 1px 3px #999}div.DTTT_collection_background{z-index:2001}.DTTT_print_info{position:fixed;top:50%;left:50%;width:400px;height:150px;margin-left:-200px;margin-top:-75px;text-align:center;color:#333;padding:10px 30px;background:#fff;background:-webkit-gradient(linear,top left,bottom left,from(#fff),color-stop(89%,#f3f3f3),to(#f9f9f9));background:-webkit-linear-gradient(top,#fff 0,#f3f3f3 89%,#f9f9f9 100%);background:linear-gradient(top,#fff 0,#f3f3f3 89%,#f9f9f9 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff',endColorstr='#f9f9f9',GradientType=0);opacity:.95;border:1px solid #000;border:1px solid rgba(0,0,0,0.5);-o-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.5);-ms-box-shadow:0 3px 7px rgba(0,0,0,0.5);-o-box-shadow:0 3px 7px rgba(0,0,0,0.5);box-shadow:0 3px 7px rgba(0,0,0,0.5)}.DTTT_print_info h6{font-weight:400;font-size:28px;line-height:28px;margin:1em}.DTTT_print_info p{font-size:14px;line-height:20px}.form hr{margin-left:-13px;margin-right:-13px;border-color:rgba(0,0,0,0.1);margin-top:20px;margin-bottom:20px}.form fieldset{display:block;border:0;background:rgba(255,255,255,0.9);position:relative}.form header,.form legend{display:block;padding:8px 0;border-bottom:1px dashed rgba(0,0,0,0.2);background:#fff;font-size:16px;font-weight:300;color:#222;margin:25px 0 20px}.no-padding .form header{margin:25px 14px 0}.form header:first-child{margin-top:10px}.form .form-group:last-child,.form .form-group:last-child .note,.form fieldset .form-group:last-child,.form fieldset .form-group:last-child .note{margin-bottom:0}fieldset{position:relative}legend{font-weight:400;margin-top:0;background:0}i.hint{vertical-align:super;opacity:.5}i.hint:hover{opacity:.9!important}.nohints i.hint{display:none}.input-group-addon{padding:6px 10px 5px;border-radius:0;transition:background-color .3s;-webkit-transition:background-color .3s}.input-group-addon .fa{font-size:14px}.input-group-addon .fa-2x,.input-group-addon .fa-lg{font-size:2em}.input-group-addon .fa-3x,.input-group-addon .fa-4x,.input-group-addon .fa-5x{font-size:30px}.input-group-addon .checkbox,.input-group-addon .radio{min-height:0;margin-right:0!important;padding-top:0}.input-group-addon label input[type=checkbox].checkbox+span,.input-group-addon label input[type=checkbox].checkbox+span:before,.input-group-addon label input[type=radio].radiobox+span,.input-group-addon label input[type=radio].radiobox+span:before{margin-right:0}.input-group-addon .onoffswitch,.input-group-addon .onoffswitch-label{margin:0}input[type=text]:focus+.input-group-addon{border-color:#0091d9;background-color:#72a0ce;color:#fff}.has-warning input[type=text]:focus+.input-group-addon{border-color:#7f6a1e;background-color:#cead35;color:#fff}.has-error input[type=text]:focus+.input-group-addon{border-color:#c46a69;background-color:#c46a69;color:#fff}.has-success input[type=text]:focus+.input-group-addon{border-color:#446b46;background-color:#588a5a;color:#fff}.input-icon-left>i{right:auto;left:24px}.input-icon-left .form-control{padding-left:29px}.input-icon-right{position:relative}.input-icon-right .form-control{padding-right:27px}.input-icon-left>i,.input-icon-right>i{position:absolute;right:10px;top:30%;font-size:16px;color:#bfbfbf}.form-actions{display:block;padding:13px 14px 15px;border-top:1px solid rgba(0,0,0,0.1);background:rgba(249,249,249,0.9);margin-top:25px;margin-left:-13px;margin-right:-13px;margin-bottom:-13px;text-align:right}.well .form-actions{margin-left:-19px;margin-right:-19px;margin-bottom:-19px}.well.well-lg .form-actions{margin-left:-24px;margin-right:-24px;margin-bottom:-24px}.well.well-sm .form-actions{margin-left:-9px;margin-right:-9px;margin-bottom:-9px}.popover-content .form-actions{margin:0 -14px -9px;border-radius:0 0 3px 3px;padding:9px 14px}.no-padding .form .form-actions{margin:0;display:block;padding:13px 14px 15px;border-top:1px solid rgba(0,0,0,0.1);background:rgba(248,248,248,0.9);text-align:right;margin-top:25px}:focus{outline:0!important}.filter_column input{padding:0 3px}.filter_column input,.filter_column select{width:100%;color:rgba(0,0,0,0.5);border:1px solid #CCC;border-radius:0;-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)}.uneditable-input:focus,input[type=color]:focus,input[type=date]:focus,input[type=datetime-local]:focus,input[type=datetime]:focus,input[type=email]:focus,input[type=month]:focus,input[type=number]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=time]:focus,input[type=url]:focus,input[type=week]:focus,.filter_column input:focus,.filter_column select:focus,select:focus,textarea:focus{border-color:rgba(82,168,236,0.8);outline:0;outline:thin dotted 9;-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)}.form-control{padding:7px 12px 5px}.form-control,.input-lg,.input-sm,.input-xs{border-radius:0!important}.input-xs{height:24px;padding:3px 10px 1px;font-size:11px;line-height:1.5}.fileinput{padding-top:3px}input[type=checkbox].checkbox,input[type=radio].radiobox{visibility:hidden;position:absolute;z-index:20;width:18px;height:18px}.checkbox input[type=checkbox].checkbox+span,.checkbox input[type=radio].radiobox+span,.checkbox-inline input[type=checkbox].checkbox+span,.checkbox-inline input[type=radio].radiobox+span,.radio input[type=checkbox].checkbox+span,.radio input[type=radio].radiobox+span,.radiobox-inline input[type=checkbox].checkbox+span,.radiobox-inline input[type=radio].radiobox+span{margin-left:-20px}.form-inline .checkbox input[type=checkbox].checkbox+span,.form-inline .checkbox input[type=radio].radiobox+span,.form-inline .checkbox-inline input[type=checkbox].checkbox+span,.form-inline .checkbox-inline input[type=radio].radiobox+span,.form-inline .radio input[type=checkbox].checkbox+span,.form-inline .radio input[type=radio].radiobox+span,.form-inline .radiobox-inline input[type=checkbox].checkbox+span,.form-inline .radiobox-inline input[type=radio].radiobox+span{margin-left:0}input[type=checkbox].checkbox+span,input[type=radio].radiobox+span,label input[type=checkbox].checkbox+span,label input[type=radio].radiobox+span{vertical-align:middle;line-height:20px}input[type=checkbox].checkbox+span,input[type=radio].radiobox+span,input[type=checkbox].checkbox+span:after,input[type=radio].radiobox+span:after,input[type=checkbox].checkbox:before,input[type=radio].radiobox:before{box-sizing:content-box!important;-webkit-box-sizing:content-box!important;-moz-box-sizing:content-box!important}label input[type=checkbox].checkbox+span,label input[type=radio].radiobox+span{position:relative;z-index:19;display:inline-block;margin:0;line-height:17px;min-height:14px;min-width:14px;margin-right:5px}label input[type=checkbox].checkbox+span:hover,label input[type=radio].radiobox+span:hover{cursor:pointer}label input[type=checkbox].checkbox+span:before,label input[type=radio].radiobox+span:before{font-family:FontAwesome;font-size:12px;border-radius:0;content:"\a0";display:inline-block;text-align:center;vertical-align:middle;padding:1px;height:12px;line-height:12px;min-width:12px;margin-right:5px;border:1px solid #bfbfbf;background-color:#f4f4f4;font-weight:400;margin-top:-1px}label input[type=checkbox].checkbox+span:before{content:"\a0"}label input[type=checkbox].checkbox:checked+span{font-weight:700}label input[type=checkbox].checkbox:checked+span:before{content:"\f00c";color:#2e7bcc}label input[type=checkbox].checkbox.style-1+span:before{color:#333;background:#fff;text-shadow:none;-webkit-box-shadow:none!important;box-shadow:none!important;border-width:1px;height:12px;line-height:13px;min-width:12px}label input[type=checkbox].checkbox.style-1:checked+span{font-weight:400}label input[type=checkbox].checkbox.style-1:checked+span:before{color:#333;border-color:#333}label input[type=checkbox].checkbox.style-2+span:before{background:0;border-color:#c1c1c1;-webkit-box-shadow:none;box-shadow:none}label input[type=checkbox].checkbox.style-2:checked+span{font-weight:400}label input[type=checkbox].checkbox.style-2:checked+span:before{content:"\f00c";color:#66665e;border-color:#4d90fe;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNS4xIFdpbmRvd3MiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MUQ0MEM4RUFEQUE4MTFFMkEwMjM5NzlCRjAxM0UwRjciIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MUQ0MEM4RUJEQUE4MTFFMkEwMjM5NzlCRjAxM0UwRjciPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoxRDQwQzhFOERBQTgxMUUyQTAyMzk3OUJGMDEzRTBGNyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDoxRDQwQzhFOURBQTgxMUUyQTAyMzk3OUJGMDEzRTBGNyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PsD/PVAAAAAQSURBVHjaYv7//78vQIABAAlYA05NMPppAAAAAElFTkSuQmCC) #fff}label input[type=checkbox].checkbox.style-3:checked+span:before{color:#fff;border-color:#a90329;background:#a90329}label:active input[type=checkbox].checkbox+span:before{-webkit-box-shadow:inset 0 2px 3px 0 rgba(0,0,0,0.3),0 1px 0 0 rgba(255,255,255,0.4);box-shadow:inset 0 2px 3px 0 rgba(0,0,0,0.3),0 1px 0 0 rgba(255,255,255,0.4)}label:hover input[type=checkbox].checkbox+span:before{color:#2e7bcc;border-color:#2e7bcc}label:hover input[type=checkbox].checkbox.style-1+span:before{border-color:#333}label:hover input[type=checkbox].checkbox.style-2+span:before{-webkit-box-shadow:inset 0 2px 3px 0 rgba(0,0,0,0.1),0 1px 0 0 rgba(255,255,255,0.2);box-shadow:inset 0 2px 3px 0 rgba(0,0,0,0.1),0 1px 0 0 rgba(255,255,255,0.2)}label:hover input[type=checkbox].checkbox.style-2:checked+span:before{-webkit-box-shadow:inset 0 2px 3px 0 rgba(0,0,0,0.3),0 1px 0 0 rgba(255,255,255,0.4);box-shadow:inset 0 2px 3px 0 rgba(0,0,0,0.3),0 1px 0 0 rgba(255,255,255,0.4)}label:hover input[type=checkbox].checkbox.style-3+span:before{color:#fff;border-color:#a90327}label:active input[type=checkbox].checkbox:checked+span:before{color:#fff;background:#2e7bcc;border-color:#2e7bcc}label:active input[type=checkbox].checkbox.style-1:checked+span:before{color:#fff;background:#333;border-color:#333}label:active input[type=checkbox].checkbox.style-2+span:before,label:active input[type=checkbox].checkbox.style-2:checked+span:before{color:#66665e;background:0;border-color:#c1c1c1;-webkit-box-shadow:inset 0 2px 3px 0 rgba(0,0,0,0.3),0 1px 0 0 rgba(255,255,255,0.4);box-shadow:inset 0 2px 3px 0 rgba(0,0,0,0.3),0 1px 0 0 rgba(255,255,255,0.4)}label:active input[type=checkbox].checkbox.style-3:checked+span:before{color:#a90329;background:#fff;border-color:#a90329}label input[type=checkbox][disabled].checkbox+span,label input[type=checkbox][disabled].checkbox:checked+span{color:#a7a7a7;cursor:not-allowed}label input[type=checkbox][disabled].checkbox:checked+span:before{content:"\f00c"}label input[type=checkbox][disabled].checkbox.style-2:checked+span:before{content:"\f00c"}label input[type=checkbox][disabled].checkbox+span:before,label input[type=checkbox][disabled].checkbox:checked+span:before,label input[type=checkbox][disabled].checkbox:checked+span:before{background:#eee!important;border-color:#CCC!important;-webkit-box-shadow:none;color:#a7a7a7;box-shadow:none!important}label:hover input[type=checkbox][disabled].checkbox:checked+span:before{color:#a7a7a7;cursor:not-allowed}label:hover input[type=checkbox][disabled].checkbox:checked+span:before{background:#eee!important;border-color:#CCC!important;-webkit-box-shadow:none;color:#a7a7a7;box-shadow:none!important}label input[type=radio].radiobox+span:before{content:"\a0";border-radius:50%;-webkit-box-shadow:inset 0 2px 3px 0 rgba(0,0,0,0.1),0 1px 0 0 rgba(255,255,255,0.2);box-shadow:inset 0 2px 3px 0 rgba(0,0,0,0.1),0 1px 0 0 rgba(255,255,255,0.2)}label input[type=radio].radiobox:checked+span{font-weight:700}label input[type=radio].radiobox:checked+span:before{content:"\f111";color:#2e7bcc}label input[type=radio].radiobox.style-1+span:before{font-size:9px;background:#fff;text-shadow:none;-webkit-box-shadow:none!important;box-shadow:none!important;border-width:1px;height:13px;line-height:13px;min-width:13px}label input[type=radio].radiobox.style-1:checked+span:before{font-size:10px;color:#333;border-color:#333;background:#fff}label input[type=radio].radiobox.style-1:checked+span{font-weight:400}label input[type=radio].radiobox.style-2:checked+span{font-weight:400}label input[type=radio].radiobox.style-2:checked+span:before{color:#66665e;border-color:#4d90fe;font-size:9px}label input[type=radio].radiobox.style-3:checked+span:before{color:#a90329;border-color:#a90329}label:hover input[type=radio].radiobox+span:before,label:hover input[type=radio].radiobox:checked+span:before{color:#2e7bcc;border-color:#2e7bcc}label:hover input[type=radio].radiobox.style-1+span:before,label:hover input[type=radio].radiobox.style-1:checked+span:before{color:#333;border-color:#333;background:#fff}label:hover input[type=radio].radiobox.style-2:checked+span:before{color:#66665e;border-color:#4d90fe}label:hover input[type=radio].radiobox.style-3+span:before,label:hover input[type=radio].radiobox.style-3:checked+span:before{color:#a90329;border-color:#a90329}label:active input[type=radio].radiobox+span:before{-webkit-box-shadow:inset 0 2px 3px 0 rgba(0,0,0,0.3),0 1px 0 0 rgba(255,255,255,0.4);box-shadow:inset 0 2px 3px 0 rgba(0,0,0,0.3),0 1px 0 0 rgba(255,255,255,0.4)}label input[type=radio][disabled].radiobox+span,label input[type=radio][disabled].radiobox:checked+span,label input[type=radio][disabled].radiobox:checked+span:before{color:#a7a7a7;cursor:not-allowed}label input[type=radio][disabled].radiobox:checked+span:before{content:"\f111"}label input[type=radio][disabled].radiobox+span:before,label input[type=radio][disabled].radiobox:checked+span:before{background:#eee!important;border-color:#CCC!important;-webkit-box-shadow:none;box-shadow:none;color:#a7a7a7}label:active input[type=radio][disabled].radiobox:checked+span:before,label:hover input[type=radio][disabled].radiobox:checked+span:before{background:#eee!important;border-color:#CCC!important;-webkit-box-shadow:none;box-shadow:none;color:#a7a7a7}textarea.clone{position:absolute;visibility:hidden}.textarea-div{background-color:#FFF;border:1px solid #CCC;border-bottom:0;margin:10px 0 0}.textarea-controls{box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:5px;display:block;background-color:#FFF;border:1px solid #CCC;border-top:0;height:43px;line-height:33px;overflow:hidden}.textarea-controls>label{margin:3px 10px 0}.textarea-controls .ams-form .checkbox{padding-left:22px!important}.typearea{cursor:text;overflow-x:hidden;overflow-y:auto;max-height:90px;padding:5px 25px 5px 5px;position:relative;border-bottom:1px solid #EEE}.typearea textarea{width:100%;border-color:transparent!important;box-sizing:border-box;box-shadow:none;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-webkit-box-shadow:none;overflow:hidden;padding:0;margin:0;-webkit-transition:height .2s;transition:height .2s;outline:0;resize:none;min-height:61px}.error-box{max-width:900px;margin:0 auto}.error-text{font-weight:400;color:#fff;letter-spacing:-4px;font-size:700%;margin-bottom:30px;text-shadow:0 1px 0 #ccc,0 2px 0 #bfbfbf,0 3px 0 #bbb,0 4px 0 #b9b9b9,0 5px 0 #aaa,0 6px 1px rgba(0,0,0,0.1),0 0 5px rgba(0,0,0,0.1),0 1px 3px rgba(0,0,0,0.3),0 3px 5px rgba(0,0,0,0.2),0 5px 10px rgba(0,0,0,0.25),0 10px 10px rgba(0,0,0,0.2),0 20px 20px rgba(0,0,0,0.15)}.error-search{width:300px;margin:0 auto 20px}.error-icon-shadow{text-shadow:0 1px 0 #803838,0 2px 0 #a85d5d,0 3px 0 #b86565,0 4px 0 #d86f6f,0 5px 0 #b3a5a5,0 6px 1px rgba(131,51,51,0.1),0 0 5px rgba(102,30,30,0.1),0 1px 3px rgba(95,15,15,0.3),0 3px 5px rgba(100,23,23,0.2),0 5px 10px rgba(114,30,30,0.25),0 10px 10px rgba(94,15,15,0.2),0 20px 20px rgba(121,38,38,0.15)}.form-inline .checkbox,.form-inline .radiobox{padding-left:0}.ams-form{position:relative;margin:0;outline:0;color:#333}.ams-form *,.ams-form :after,.ams-form :before{margin:0;padding:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.ams-form header{display:block;padding:8px 0;border-bottom:1px dashed rgba(0,0,0,0.2);background:#fff;font-size:16px;font-weight:300;color:#232323;margin:10px 14px 0}.modal-dialog .ams-form header{margin:10px -2px 0 0}.ams-form fieldset{display:block;position:relative;padding:10px 15px 5px;border:0;background:rgba(255,255,255,0.9)}.ams-form fieldset[disabled]>section,.ams-form fieldset[disabled]>article,.ams-form fieldset[disabled]>div{opacity:.5}.ams-form fieldset[disabled] LEGEND.checker .checkbox{cursor:pointer}.ams-form fieldset.switched{margin-bottom:0!important}.ams-form fieldset.switched>section,.ams-form fieldset.switched>article,.ams-form fieldset.switched>div{display:none}.ams-form fieldset.switched legend{border-bottom:0}.ams-form fieldset.switched+fieldset{margin-top:0!important}.ams-form fieldset.bordered{margin:10px;border:1px solid rgba(192,192,192,0.8);-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.ams-form fieldset.bordered.switched{border:1px solid transparent}.ams-form fieldset.bordered legend{width:auto;padding:3px 10px 1px;border:1px solid rgba(192,192,192,0.8);-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.ams-form fieldset>fieldset.bordered{margin:10px 0}.ams-form fieldset+fieldset{border-top:1px solid rgba(0,0,0,0.1)}.ams-form legend{padding-top:10px}.ams-form legend.inner,.ams-form legend .inner{font-weight:300;font-size:14.5px!important}.ams-form legend.switcher{cursor:pointer}.ams-form legend.checker,.ams-form legend.switcher{font-weight:300;font-size:16.5px;border:0;padding-bottom:0}.ams-form legend.checker label[for],.ams-form legend.switcher label[for]{cursor:pointer}.ams-form legend .fa{color:#3276b1;font-size:75%}.ams-form legend .fa.fa-stack{font-size:100%;width:1em;height:1em;line-height:1em}.ams-form legend .hint{vertical-align:top;font-size:1em}.ams-form legend label.checkbox{display:inline-block;margin-bottom:0;min-height:18px}.ams-form legend label.checkbox i{position:absolute;left:3px;top:-1px}.ams-form>.modal-viewport>fieldset>legend{padding-top:0}.ams-form section{margin-bottom:10px;position:relative}.ams-form .form-group{padding:5px 10px}.ams-form label.checkbox,.ams-form label.radio{padding-top:0}.ams-form label.input-file img.thumbnail{display:inline-block;margin:4px 10px 0 4px!important;padding:4px!important}.ams-form input.input-lg{height:44px;padding:10px 16px;font-size:17px;line-height:1.33}.ams-form input.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5}.ams-form input.input-xs{height:24px;padding:2px 10px;font-size:11px;line-height:1.5}.ams-form select.input-sm{height:30px;line-height:15px;font-size:12px}.ams-form select.input-sm+i{height:10px}.ams-form select.input-lg{height:44px;line-height:22px;font-size:17px}.ams-form select.input-lg+i{height:11px;top:17px}.ams-form .row{margin:0 -15px}.ams-form .row:after{display:table;content:'';clear:both}.ams-form .col-1{width:8.33%}.ams-form .col-2{width:16.66%}.ams-form .col-3{width:25%}.ams-form .col-4{width:33.33%}.ams-form .col-5{width:41.66%}.ams-form .col-6{width:50%}.ams-form .col-8{width:66.67%}.ams-form .col-9{width:75%}.ams-form .col-10{width:83.33%}.ams-form .col{float:left;min-height:1px;padding-right:15px;padding-left:15px;-webkit-box-sizing:border-box;box-sizing:border-box;-moz-box-sizing:border-box}@media screen and (max-width:600px){.ams-form .col{float:none;width:100%}}@media screen and (max-width:600px){.ams-form .col .label{text-align:left;padding-left:20px}}.ams-form footer{display:block;padding:7px 25px 15px;border-top:1px solid rgba(0,0,0,0.1);background:rgba(248,248,248,0.9)}.ams-form footer:after{display:table;clear:both;content:''}.ams-form footer .btn{float:right;height:31px;margin:10px 0 0 5px;padding:0 22px;font:300 15px/29px Ubuntu,Helvetica,Arial,sans-serif;cursor:pointer}.ams-form footer .btn.btn-info{float:left}.ams-form footer .submit-message{display:inline-block}.ams-form .message{display:none;color:#6fb679}.ams-form .message i{display:block;margin:0 auto 20px;width:81px;height:81px;border:1px solid #6fb679;border-radius:50%;font-size:30px;line-height:81px}.ams-form.submitted fieldset,.ams-form.submitted footer{display:none}.ams-form.submitted .message{display:block;padding:25px 30px;background:rgba(255,255,255,0.9);font:300 18px/27px Ubuntu,Helvetica,Arial,sans-serif;text-align:center}.ams-form .note{margin-top:6px;padding:0 1px;font-size:11px;line-height:15px;color:#999}.ams-form .note a{font-size:13px}.ams-form .note-success{color:#6fb679}.ams-form .control-label{display:block;margin-top:4px;margin-bottom:6px;padding-top:0;line-height:19px;font-weight:400;font-size:13px;color:#666;text-align:right}@media screen and (max-width:992px){.ams-form .control-label{text-align:left;margin-bottom:0}}.ams-form .control-label.col{text-align:right}@media screen and (max-width:600px){.ams-form .control-label.col{text-align:left;padding-left:20px}}.ams-form .control-label span{margin-right:10px}.ams-form .control-label span::after{content:" *";color:transparent}.ams-form .control-label span>.hint{margin-top:-2px}.ams-form .control-label .col{margin:0;padding-top:7px}.ams-form label.input span.textline-field{display:block;margin-top:4px;margin-bottom:6px;padding-top:0;line-height:19px;font-size:13px}.ams-form .required-field .control-label span::after{color:red}.ams-form .tooltip{position:absolute;z-index:99999;left:-9999px;padding:2px 8px 3px;font-size:11px;line-height:16px;font-weight:400;background:rgba(0,0,0,0.9);color:#fff;opacity:0;transition:margin .3s,opacity .3s;-webkit-transition:margin .3s,opacity .3s}.ams-form .tooltip:after{position:absolute;content:''}.ams-form .tooltip-top-right{bottom:100%;margin-bottom:15px}.ams-form .tooltip-top-right:after{top:100%;right:11px;border-top:4px solid rgba(0,0,0,0.9);border-right:4px solid transparent;border-left:4px solid transparent}.ams-form .input input:focus+.tooltip-top-right,.ams-form .textarea textarea:focus+.tooltip-top-right{right:0;left:auto;margin-bottom:5px}.ams-form .tooltip-top-left{bottom:100%;margin-bottom:15px}.ams-form .tooltip-top-left:after{top:100%;left:11px;border-top:4px solid rgba(0,0,0,0.9);border-right:4px solid transparent;border-left:4px solid transparent}.ams-form .input input:focus+.tooltip-top-left,.ams-form .textarea textarea:focus+.tooltip-top-left{right:auto;left:0;margin-bottom:5px}.ams-form .tooltip-right{top:4px;white-space:nowrap;margin-left:15px}.ams-form .tooltip-right:after{top:6px;right:100%;border-top:4px solid transparent;border-right:4px solid rgba(0,0,0,0.9);border-bottom:4px solid transparent}.ams-form .input input:focus+.tooltip-right,.ams-form .textarea textarea:focus+.tooltip-right{left:100%;margin-left:5px}.ams-form .tooltip-left{top:4px;white-space:nowrap;margin-right:15px}.ams-form .tooltip-left:after{top:6px;left:100%;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid rgba(0,0,0,0.9)}.ams-form .input input:focus+.tooltip-left,.ams-form .textarea textarea:focus+.tooltip-left{right:100%;left:auto;margin-right:5px}.ams-form .tooltip-bottom-right{top:100%;margin-top:15px}.ams-form .tooltip-bottom-right:after{bottom:100%;right:11px;border-right:4px solid transparent;border-bottom:4px solid rgba(0,0,0,0.9);border-left:4px solid transparent}.ams-form .input input:focus+.tooltip-bottom-right,.ams-form .textarea textarea:focus+.tooltip-bottom-right{right:0;left:auto;margin-top:5px}.ams-form .tooltip-bottom-left{top:100%;margin-top:15px}.ams-form .tooltip-bottom-left:after{bottom:100%;left:11px;border-right:4px solid transparent;border-bottom:4px solid rgba(0,0,0,0.9);border-left:4px solid transparent}.ams-form .input input:focus+.tooltip-bottom-left,.ams-form .textarea textarea:focus+.tooltip-bottom-left{right:auto;left:0;margin-top:5px}.ams-form .inline-group{margin:0 -30px -4px 0}.ams-form .inline-group:after{content:'';display:table;clear:both}.ams-form .inline-group .checkbox,.ams-form .inline-group .radio{float:left;margin-right:30px}.ams-form .inline-group .checkbox:last-child,.ams-form .inline-group .radio:last-child{margin-bottom:4px}.ams-form .input .inline-group{margin:0 0 -4px 0}.ams-form .btn{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ams-form .button{float:right;height:31px;overflow:hidden;margin:10px 0 0 5px;padding:0 25px;outline:0;border:0;font:300 15px/31px Ubuntu,Helvetica,Arial,sans-serif;text-decoration:none;color:#fff;cursor:pointer;background-color:#3276b1;opacity:.8;transition:opacity .2s;-webkit-transition:opacity .2s}.ams-form .button:hover{opacity:1}.ams-form .button.button-secondary{background-color:#b3b3b3}.ams-form .button,.ams-form .checkbox,.ams-form .input,.ams-form .radio,.ams-form .select,.ams-form .textarea,.ams-form .toggle{display:block;position:relative;font-weight:400}.ams-form .input input,.ams-form .select select,.ams-form .textarea textarea{display:block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;width:100%;height:28px;padding:6px 8px;outline:0;border-width:1px;border-style:solid;border-radius:0;background:#fff;font:13px/16px Ubuntu,Helvetica,Arial,sans-serif;color:#404040;appearance:normal;-moz-appearance:none;-webkit-appearance:none}.ams-form .input input[readonly],.ams-form .select select[readonly],.ams-form .textarea textarea[readonly]{border-bottom:1px solid #ccc!important}.ams-form .input input.display-mode,.ams-form .select select.display-mode,.ams-form .textarea textarea.display-mode{border:0;padding:0;margin-top:2px;margin-bottom:3px;height:14px;line-height:1em}.ams-form .input input:focus+.tooltip,.ams-form .textarea textarea:focus+.tooltip{opacity:1}.ams-form .input .icon-prepend+input,.ams-form .textarea .icon-prepend+textarea{padding-left:37px}.ams-form .input .icon-append+input,.ams-form .textarea .icon-append+textarea{padding-right:37px}.ams-form .input .icon-prepend+.icon-append+input,.ams-form .textarea .icon-prepend+.icon-append+textarea{padding-left:37px}.ams-form .input.with-icons .icon-append-2+input{padding-right:60px}.ams-form .input-file{position:relative}.ams-form .input-file .button{position:absolute;top:3px;right:3px;float:none;height:22px;margin:0;padding:0 14px;font-size:13px;line-height:22px}.ams-form .input-file .button:hover{-webkit-box-shadow:none;box-shadow:none}.ams-form .input-file .button input{position:absolute;top:0;right:0;padding:0;font-size:30px;cursor:pointer;opacity:0}.ams-form .select select{padding:5px}.ams-form .select i{position:absolute;top:9px;right:11px;width:5px;height:11px;background:#fff}.ams-form .select i:before,.ams-form .select i:after{content:'';position:absolute;right:0;border-right:4px solid transparent;border-left:4px solid transparent}.ams-form .select i:before{top:0;border-bottom:4px solid #404040}.ams-form .select i:after{bottom:0;border-top:4px solid #404040}.ams-form .select-widget .selected-option{display:inline-block;padding:4px 8px}.ams-form .select-multiple select{height:auto}.ams-form .textarea textarea{height:auto;resize:none}.ams-form .textarea-resizable textarea{resize:vertical}.ams-form .textarea-expandable textarea{height:31px}.ams-form .textarea-expandable textarea:focus{height:auto}.ams-form .checkbox,.ams-form .radio{margin-bottom:4px;padding-left:25px;line-height:25px;color:#404040;cursor:pointer;font-size:13px}.ams-form .checkbox:last-child,.ams-form .radio:last-child{margin-bottom:0}.ams-form .checkbox i,.ams-form .radio i{display:block;position:absolute;top:3px;left:0;width:17px;height:17px;outline:0;border-width:1px;border-style:solid;background:#FFF}.ams-form .checkbox input,.ams-form .radio input{position:absolute;left:-9999px}.ams-form .checkbox input+i:after,.ams-form .radio input+i:after{position:absolute;opacity:0;transition:opacity .1s;-webkit-transition:opacity .1s}.ams-form .checkbox input:checked+i:after,.ams-form .radio input:checked+i:after{opacity:1}.ams-form .radio input+i:after{background-color:#3276b1}.ams-form .checkbox input+i:after{content:'\f00c';top:-1px;left:1px;width:15px;height:15px;font:400 16px/19px FontAwesome;text-align:center}.ams-form .checkbox input+i:after{color:#3276b1}.ams-form .checkbox input:checked:hover+i:after{content:'\f00d'}.ams-form .checkbox input:checked:disabled:hover+i:after{content:'\f00c'}.ams-form .radio input+i:after{content:'';top:4px;left:4px;width:9px;height:9px;border-radius:50%}.ams-form .checkbox+.checkbox,.ams-form .radio+.radio{margin-top:0}.ams-form.table td .checkbox i,.ams-form.table td .radio i,.ams-form.table th .checkbox i,.ams-form.table th .radio i{top:0!important}.ams-form .inner .checkbox{min-height:13px}.ams-form .inner .checkbox i{width:13px;height:13px}.ams-form .inner .checkbox input+i:after{width:11px;height:11px;font:300 12px/16px FontAwesome}.ams-form .toggle{margin-bottom:4px;padding-right:61px;font-size:15px;line-height:25px;color:#404040;cursor:pointer}.ams-form .toggle:last-child{margin-bottom:0}.ams-form .toggle.state-error input:checked+i{background:#fff0f0}.ams-form .toggle.state-success input:checked+i{background:#f0fff0}.ams-form .toggle input{position:absolute;left:-9999px}.ams-form .toggle input:checked+i:before{right:36px}.ams-form .toggle input:checked+i:after{content:attr(data-swchon-text);text-align:right}.ams-form .toggle i{display:block;position:absolute;content:'';top:4px;right:0;width:49px;height:17px;border-width:1px;border-style:solid;border-radius:12px;background:#fff}.ams-form .toggle i:before{display:block;position:absolute;content:'';z-index:1;top:4px;right:4px;width:9px;height:9px;border-radius:50%;opacity:1;transition:right .2s;-webkit-transition:right .2s;background-color:#3276b1}.ams-form .toggle i:after{position:absolute;content:attr(data-swchoff-text);top:2px;right:8px;left:8px;font-style:normal;font-size:9px;line-height:17px;font-weight:700;text-align:left;color:#5f5f5f}.ams-form .checkbox:hover i,.ams-form .radio:hover i,.ams-form .toggle:hover i{-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.1);box-shadow:inset 0 1px 1px rgba(0,0,0,0.1)}.ams-form .checkbox:active i,.ams-form .radio:active i,.ams-form .toggle:active i{background:#f0f0f0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.1);box-shadow:inset 0 1px 1px rgba(0,0,0,0.1)}.ams-form .checkbox input:checked+i,.ams-form .radio input:checked+i,.ams-form .toggle input:checked+i{border-color:#3276b1}.ams-form .rating{margin-bottom:4px;font-size:13px;line-height:25px;color:#404040}.ams-form .rating:last-child{margin-bottom:0}.ams-form .rating.state-error+em{margin-top:-4px;margin-bottom:4px}.ams-form .rating input{position:absolute;left:-9999px}.ams-form .rating input+label:hover,.ams-form .rating input+label:hover ~ label{color:#3276b1}.ams-form .rating input:checked ~ label{color:#3276b1}.ams-form .rating label{display:block;float:right;height:17px;margin-top:5px;padding:0 2px;font-size:17px;line-height:17px;cursor:pointer;color:#ccc;transition:color .3s;-webkit-transition:color .3s}.ams-form .icon-append,.ams-form .icon-prepend{position:absolute;top:4px;width:20px;height:20px;font-size:14px;line-height:20px;text-align:center;color:#a2a2a2}.ams-form .icon-append.fa-stack .fa-stack-2x,.ams-form .icon-prepend.fa-stack .fa-stack-2x{font-size:1.6em;left:1px}.ams-form .icon-append.fa-stack .fa-stack-1x,.ams-form .icon-prepend.fa-stack .fa-stack-1x{left:1px;top:1px}.ams-form .icon-append{right:4px;padding-left:2px;border-left-width:1px;border-left-style:solid}.ams-form .icon-append-2{right:31px}.ams-form .icon-prepend{left:4px;padding-right:2px;border-right-width:1px;border-right-style:solid}.ams-form .icon-prepend-2{left:31px}.ams-form .checkbox i,.ams-form .icon-append,.ams-form .icon-prepend,.ams-form .input input,.ams-form .radio i,.ams-form .select select,.ams-form .textarea textarea,.ams-form .toggle i{border-color:#ccc;transition:border-color .3s;-webkit-transition:border-color .3s}.ams-form .input.bordered:hover,.ams-form .checkbox:hover i,.ams-form .input:hover input,.ams-form .radio:hover i,.ams-form .select:hover select,.ams-form .textarea:hover textarea,.ams-form .toggle:hover i{border-color:rgba(82,168,236,0.7)}.ams-form .checkbox input:focus+i,.ams-form .input input:focus,.ams-form .radio input:focus+i,.ams-form .select select:focus,.ams-form .textarea textarea:focus,.ams-form .toggle input:focus+i{border-color:rgba(82,168,236,0.7);outline:0;outline:thin dotted 9;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.7);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.7);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.7)}.ams-form .checkbox.state-error i,.ams-form .radio.state-error i,.ams-form .state-error input,.ams-form .state-error select,.ams-form .state-error textarea,.ams-form .toggle.state-error i{background:#fff0f0;border-color:rgba(255,60,60,0.8)!important}.ams-form .checkbox.state-error i:focus,.ams-form .radio.state-error i:focus,.ams-form .state-error input:focus,.ams-form .state-error select:focus,.ams-form .state-error textarea:focus,.ams-form .toggle.state-error i:focus{-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(255,60,60,0.6)!important;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(255,60,60,0.6)!important;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(255,60,60,0.6)!important}.ams-form .state-error .select2-container .select2-choice,.ams-form .state-error .select2-container .select2-choices{border-color:rgba(255,60,60,0.8)!important}.ams-form .state-error .select2-container .select2-choice:focus,.ams-form .state-error .select2-container .select2-choices:focus{-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(255,60,60,0.6)!important;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(255,60,60,0.6)!important;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(255,60,60,0.6)!important}.ams-form .checkbox.state-success i,.ams-form .radio.state-success i,.ams-form .state-success input,.ams-form .state-success select,.ams-form .state-success textarea,.ams-form .toggle.state-success i{background:#f0fff0;border-color:#7dc27d}.ams-form .button.state-disabled,.ams-form .checkbox.state-disabled,.ams-form .input.state-disabled input,.ams-form .radio.state-disabled,.ams-form .select.state-disabled,.ams-form .textarea.state-disabled,.ams-form .toggle.state-disabled{cursor:default!important;opacity:.6!important}.ams-form .checkbox.state-disabled:hover i,.ams-form .input.state-disabled:hover input,.ams-form .radio.state-disabled:hover i,.ams-form .select.state-disabled:hover select,.ams-form .textarea.state-disabled:hover textarea,.ams-form .toggle.state-disabled:hover i{border-color:#e5e5e5!important}.ams-form .state-disabled.checkbox input+i:after,.ams-form .state-disabled.checkbox input:checked+i,.ams-form .state-disabled.radio input+i:after,.ams-form .state-disabled.radio input:checked+i,.ams-form .state-disabled.toggle input:checked+i{border-color:#e5e5e5!important;color:#333!important}.ams-form .ui-widget-content .ui-spinner-input{margin:0;border:0;-webkit-box-shadow:none!important;box-shadow:none!important;height:29px}.ams-form .state-error{color:#d56161}.ams-form .state-error select+i{background:#fff0f0;-webkit-box-shadow:0 0 0 9px #fff0f0;box-shadow:0 0 0 9px #fff0f0}.ams-form .state-error+em{display:block;margin-top:6px;padding:0 1px;font-style:normal;font-size:11px;line-height:15px;color:#d56161}.ams-form .state-success select+i{background:#f0fff0;-webkit-box-shadow:0 0 0 9px #f0fff0;box-shadow:0 0 0 9px #f0fff0}.ams-form .state-disabled.radio input+i:after{background-color:#333}.ams-form .form-tiny .form-group{padding:0 10px}.ams-form .form-tiny .control-label{margin-top:2px;margin-bottom:3px;line-height:14px}.ams-form .form-tiny label.input span.textline-field{margin-top:2px;margin-bottom:3px;line-height:14px}.ams-form .form-nomargin .control-label,.ams-form.form-nomargin .control-label{margin-top:0;margin-bottom:0}.ams-form .form-nomargin label.input span.textline-field,.ams-form.form-nomargin label.input span.textline-field{margin-top:0;margin-bottom:0}.ams-form .form-nopadding .form-group,.ams-form.form-nopadding .form-group{padding:0 10px 1px}.ams-form-modal{position:fixed;z-index:1;display:none;width:400px}.ams-form-modal-overlay{position:fixed;top:0;left:0;display:none;width:100%;height:100%;background:rgba(0,0,0,0.7)}.state-error .icon-append,.state-error .icon-prepend{color:#ed1c24}.editableform{margin-bottom:0}.editableform .control-group{margin-bottom:0;white-space:nowrap}.editableform .editable-date{padding:0;margin:0;float:left}.editableform-loading{background:url(../img/loading.gif) center center no-repeat;height:25px;width:auto;min-width:25px}.editable-buttons{display:inline-block;vertical-align:top;margin-left:7px;zoom:1;*display:inline}.editable-buttons.editable-buttons-bottom{display:block;margin-top:7px;margin-left:0}.editable-buttons .editable-cancel{margin-left:7px}.editable-buttons button.ui-button-icon-only{height:24px;width:30px}.editable-inline .add-on .icon-th{margin-top:3px;margin-left:1px}.editable-inline .editableform-loading{background-position:left 5px}.editable-input{vertical-align:top;display:inline-block;width:auto;white-space:normal;zoom:1;*display:inline}.editable-input .datepicker{top:0;left:0;padding:4px}.editable-input .datepicker:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:rgba(0,0,0,0.2);position:absolute;top:-7px;left:6px}.editable-input .datepicker:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;position:absolute;top:-6px;left:7px}.editable-input .datepicker>div{display:none}.editable-input .datepicker table{width:100%;min-width:214px;margin:0}.editable-input .datepicker thead tr:first-child th{cursor:pointer}.editable-input .datepicker thead tr:first-child th:hover{background:#eee}.editable-input .datepicker td,.editable-input .datepicker th{text-align:center;width:24px;height:20px}.editable-input .datepicker th.switch{width:145px}.editable-input .datepicker th.next,.editable-input .datepicker th.prev{font-size:19.5px}.editable-input .datepicker td span{display:block;width:47px;height:54px;line-height:54px;float:left;margin:2px;cursor:pointer}.editable-input .datepicker td span:hover{background:#eee}.editable-input .datepicker td span.active{background:#3276b1;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);border-radius:3px}.editable-input .datepicker td span.old{color:#555}.editable-input .datepicker td.day:hover{background:#eee;cursor:pointer}.editable-input .datepicker td.day.disabled,.editable-input .datepicker td.new,.editable-input .datepicker td.old{color:#555}.editable-input .datepicker td.active,.editable-input .datepicker td.active:hover{background:#3276b1;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);border-radius:3px}.editable-input .datepicker.prev i,.editable-input .datepicker.next i{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:14px}.editable-input .datepicker.prev i:before{content:"\f060"}.editable-input .datepicker.next i:before{content:"\f061"}.editable-checklist label{white-space:nowrap}.editable-checklist label input[type=checkbox],.editable-checklist label span{vertical-align:middle;margin:0}.editable-wysihtml5{width:566px;height:250px}.editable-pre-wrapped{white-space:pre-wrap}.editable-container.editable-popup{max-width:none!important}.editable-container.popover{width:auto}.editable-container.editable-inline{display:inline-block;vertical-align:middle;width:auto;zoom:1;*display:inline}.editable-container.ui-widget{font-size:inherit;z-index:9990}.editable-click,a.editable-click,a.editable-click:hover{text-decoration:none;border-bottom:dashed 1px #08c}.editable-click.editable-disabled,a.editable-click.editable-disabled,a.editable-click.editable-disabled:hover{color:#585858;cursor:default;border-bottom:0}.editable-empty,.editable-empty:focus,.editable-empty:hover{font-style:italic;color:#D14;text-decoration:none}.editable-unsaved{font-weight:700}.editable-bg-transition{-webkit-transition:background-color 1400ms ease-out;transition:background-color 1400ms ease-out}.form-horizontal .editable{padding-top:5px;display:inline-block}.editable-address{display:block;margin-bottom:5px}.editable-address span{width:70px;display:inline-block}.editable-clear{clear:both;font-size:.9em;text-decoration:none;text-align:right}.editable-clear-x{background:url(../img/clear.png) center center no-repeat;display:block;width:13px;height:13px;position:absolute;opacity:.6;z-index:100;top:50%;right:6px;margin-top:-6px}.editable-clear-x:hover{opacity:1}.editable-error-block{max-width:300px;margin:5px 0 0;width:auto;white-space:normal}.editable-error-block.ui-state-error{padding:3px}.editable-error{color:red}.input-append.date .add-on i,.input-prepend.date .add-on i{display:block;cursor:pointer;width:16px;height:16px}.ui-timepicker-div .ui-widget-header{margin-bottom:8px}.ui-timepicker-div dl{text-align:left}.ui-timepicker-div dl dt{float:left;clear:left;padding:0 0 0 5px}.ui-timepicker-div dl dd{margin:17px 10px 12px 40%}.ui-timepicker-div td{font-size:90%}.ui-tpicker-grid-label{background:0;border:0;margin:0;padding:0}.ui-timepicker-rtl{direction:rtl}.ui-timepicker-rtl dl{text-align:right;padding:0 5px 0 0}.ui-timepicker-rtl dl dt{float:right;clear:right}.ui-timepicker-rtl dl dd{margin:0 40% 10px 10px}#login{background:#fff;overflow:visible}#login .container{border:0}#login #header{margin:0;height:71px;border-bottom:1px solid #eee!important;overflow:hidden;padding:0 30px;-webkit-background-clip:padding-box;border-width:0;min-height:28px;background:#f4f4f4!important;margin-bottom:20px}@media(min-width:768px) and (max-width:880px){#login #header{padding:0 5px!important}}@media only screen and (min-width:0) and (max-width:679px){#login #header{padding:0 5px!important}}#login #header #logo{margin-top:22px;margin-left:0}@media only screen and (min-width:0) and (max-width:679px){#login #header #logo{margin-top:22px}}#login #header #logo img{width:137px}@media only screen and (min-width:0) and (max-width:679px){#login #header #logo img{width:135px}}#login-header-space{float:right;text-align:right;display:block;vertical-align:middle;line-height:71px}#login-header-space>:first-child{font-size:13px;margin-right:14px;vertical-align:-3px;font-weight:400}#login-header-space>*{display:inline-block}#login-header-space .btn{font-weight:700;text-transform:uppercase}#login #main{background:#fff;margin:0}#login .hero{background-image:url(../img/gradient/login.png);background-repeat:no-repeat;background-position:0 137px;height:360px;width:100%;float:left}#login h4.paragraph-header{color:#565656;font-size:15px;font-weight:400;line-height:22px;margin-top:15px;width:270px}#login h5.about-heading{color:#565656;font-size:15px;font-weight:700;line-height:24px;margin:0 0 5px}#login .login-header-big{font-weight:400}#login .login-desc-box-l{min-height:350px;width:50%}#login .login-app-icons{vertical-align:top;margin-top:90px;width:300px}.bootstrapWizard{display:block;list-style:none;padding:0;position:relative;width:100%}.bootstrapWizard a:active,.bootstrapWizard a:focus,.bootstrapWizard a:hover{text-decoration:none}.bootstrapWizard li{display:block;float:left;width:25%;text-align:center;padding-left:0}.bootstrapWizard li:before{border-top:3px solid #55606e;content:"";display:block;font-size:0;overflow:hidden;position:relative;top:11px;right:1px;width:100%;z-index:1}.bootstrapWizard li:first-child:before{left:50%;max-width:50%}.bootstrapWizard li:last-child:before{max-width:50%;width:50%}.bootstrapWizard li .step{background:#b2b5b9;color:#fff;display:inline;font-size:15px;font-weight:700;padding:7px 13px;border:3px solid transparent;border-radius:50%;line-height:normal;position:relative;text-align:center;z-index:2;-webkit-transition:all .1s linear 0s;transition:all .1s linear 0s}.bootstrapWizard li .step i{font-size:10px;font-weight:400;position:relative;top:-1.5px}.bootstrapWizard li.complete .step{background:#0aa66e;padding:1px 6px;border:3px solid #55606e}.bootstrapWizard li.active .step,.bootstrapWizard li.active.complete .step{background:#0091d9;color:#fff;font-weight:700;padding:7px 13px;font-size:15px;border-radius:50%;border:3px solid #55606e}.bootstrapWizard li .title{color:#bfbfbf;display:block;font-size:13px;line-height:15px;max-width:100%;position:relative;table-layout:fixed;text-align:center;top:20px;word-wrap:break-word;z-index:104}.bootstrapWizard li.active .title,.bootstrapWizard li.complete .title{color:#2b3d53}.wizard-actions{display:block;list-style:none;padding:0;position:relative;width:100%}.wizard-actions li{display:inline}.fuelux .wizard{position:relative;overflow:hidden;background-color:#f9f9f9;border:1px solid #d4d4d4;border-radius:4px;*zoom:1;-webkit-box-shadow:0 1px 4px rgba(0,0,0,0.065);box-shadow:0 1px 4px rgba(0,0,0,0.065)}.fuelux .wizard:after,.fuelux .wizard:before{display:table;line-height:0;content:""}.fuelux .wizard:after{clear:both}.fuelux .wizard ul{width:4000px;padding:0;margin:0;list-style:none outside none}.fuelux .wizard ul.previous-disabled li.complete{cursor:default}.fuelux .wizard ul.previous-disabled li.complete:hover{color:#356e35;cursor:default;background:#f3f4f5}.fuelux .wizard ul.previous-disabled li.complete:hover .chevron:before{border-left-color:#f3f4f5}.fuelux .wizard ul li{position:relative;float:left;height:46px;padding:0 20px 0 30px;margin:0;font-size:16px;line-height:46px;color:#999;cursor:default;background:#ededed}.fuelux .wizard ul li:first-child{padding-left:20px;border-radius:4px 0 0 4px}.fuelux .wizard ul li.complete{color:#296829;background:#f3f4f5}.fuelux .wizard ul li.complete:hover{cursor:pointer;background:#e7eff8}.fuelux .wizard ul li.complete:hover .chevron:before{border-left:14px solid #e7eff8}.fuelux .wizard ul li.complete .chevron:before{border-left:14px solid #f3f4f5}.fuelux .wizard ul li.active{color:#3a87ad;background:#f1f6fc}.fuelux .wizard ul li.active .chevron:before{border-left:14px solid #f1f6fc}.fuelux .wizard ul li .chevron{position:absolute;top:0;right:-14px;z-index:1;display:block;border:24px solid transparent;border-right:0;border-left:14px solid #d4d4d4}.fuelux .wizard ul li .chevron:before{position:absolute;top:-24px;right:1px;display:block;border:24px solid transparent;border-right:0;border-left:14px solid #ededed;content:""}.fuelux .wizard ul li .badge{margin-right:8px}.fuelux .wizard .actions{position:absolute;right:0;z-index:2;float:right;padding-right:15px;padding-left:15px;line-height:46px;vertical-align:middle;background-color:#eee;border-left:1px solid #d4d4d4}.fuelux .wizard .actions a{margin-right:8px;font-size:12px;line-height:45px}.fuelux .wizard .actions .btn-prev i{margin-right:5px}.fuelux .wizard .actions .btn-next i{margin-left:5px}.fuelux .fuelux .step-content .step-pane{display:none}.fuelux .fuelux .step-content .active{display:block}.fuelux .fuelux .step-content .active .btn-group .active{display:inline-block}.ams-metro-tile{float:left;display:block;background-color:#fff;width:100px;height:70px;cursor:pointer;-webkit-box-shadow:inset 0 0 1px #FFC;box-shadow:inset 0 0 1px #FFC;border:1px dotted #c5c5c5;text-decoration:none;color:#fff;font-weight:300;font-smooth:always;margin:0 10px 20px 0;padding:5px;position:relative}.ams-metro-tile:hover{z-index:10;-webkit-transform:scale(1.07);-moz-transform:scale(1.07)}.ams-metro-tile.big-cubes{width:120px;height:120px}.ams-metro-tile.double{width:249px}.ams-metro-tile:active{top:1px;left:1px}.ams-metro-tile .iconbox{text-align:center}.ams-metro-tile .iconbox i{display:block;margin:15px auto 0;height:75px}.ams-metro-tile .iconbox span{display:block;text-align:left;line-height:1em}.ams-metro-tile .iconbox span>span{position:absolute;right:-5px;bottom:-10px;border-radius:50%;padding:6px 4px 3px;border:1px solid #fff}.client-form header{padding:15px 13px;margin:0;border-bottom-style:solid;border-bottom-color:rgba(0,0,0,0.1);background:rgba(248,248,248,0.9)}.customfile-button{padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.428571429;text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;border:1px solid #ccc;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.btn,a:link,button{-webkit-tap-highlight-color:rgba(169,3,41,0.5)}button{background-color:#ddd}button:hover{background-color:#ccc}.btns{margin:0;padding:0;list-style:none}.btns>li{display:inline-block;margin-bottom:7px}.btn{padding:6px 12px;border-radius:2px;box-shadow:inset 0 -2px 0 rgba(0,0,0,0.05);-webkit-box-shadow:inset 0 -2px 0 rgba(0,0,0,0.05)}.btn-toolbar .btn{padding:4px}.btn:active{position:relative;top:1px;left:1px}.btn.btn-ribbon{background-color:#5b6771;color:#fff;padding:1px 5px;line-height:20px;vertical-align:middle;height:21px;display:block;border:0;float:left;margin:0 8px 0 0;cursor:pointer}.btn.btn-ribbon>i{font-size:111%}.btn-xs{padding:1px 5px;line-height:1.3em}.btn-sm{padding:3px 10px}.btn-lg{padding:9px 15px}.btn-xl{padding:11px 15px}.btn-circle{width:30px;height:30px;text-align:center;padding:7px 0 5px;font-size:12px;line-height:18px;border-radius:50%}.btn-circle.btn-lg{width:50px;height:50px;padding:9px 15px 7px;font-size:18px;line-height:30px;border-radius:50%}.btn-circle.btn-xl{width:70px;height:70px;padding:11px 15px 9px;font-size:24px;line-height:50px;border-radius:50%}.btn-metro{margin:0 0 20px;padding-top:15px;padding-bottom:15px}.btn-metro>span{display:block;vertical-align:bottom;margin-top:10px;text-transform:uppercase}.btn-metro>span>span.label{position:absolute;top:0;right:0}.btn-label{position:relative;left:-12px;display:inline-block;padding:7px 12px 5px;background:rgba(0,0,0,0.15);border-radius:3px 0 0 3px}.btn-labeled{padding-top:0;padding-bottom:0}.btn-select-tick i{display:none}.btn-select-tick .btn:hover i{opacity:.3;display:block}.btn-select-tick .active i{display:block;opacity:1!important}.btn-header.pull-right{margin-left:6px}@media(min-width:768px) and (max-width:979px){.btn-header a{margin-top:9px!important}}@media(min-width:768px) and (max-width:880px){.btn-header a{margin-top:9px!important;line-height:26px!important}}@media(max-width:767px){.btn-header a{margin-top:5px!important;width:40px!important;height:39px!important;line-height:34px!important}}@media only screen and (min-width:0) and (max-width:679px){.btn-header a{margin-top:5px!important;width:40px!important;height:39px!important;line-height:34px!important}}@media only screen and (min-width:320px) and (max-width:479px){.btn-header a{margin-top:5px!important;width:40px!important;height:39px!important;line-height:34px!important}}.btn-header a>span{font-size:13px;font-weight:400;line-height:30px;height:30px;display:inline-block}@media(min-width:768px) and (max-width:880px){.btn-header.transparent a{border:0!important;background:0;margin-left:0;width:25px!important;-webkit-box-shadow:none!important;box-shadow:none!important}.btn-header.transparent a:hover{color:#a90329}}@media(max-width:767px){.btn-header.transparent a:hover{color:#a90329}}@media only screen and (min-width:0) and (max-width:679px){.btn-header.transparent a{border:0!important;background:0;margin-left:0;width:25px!important;-webkit-box-shadow:none!important;box-shadow:none!important}.btn-header.transparent a:hover{color:#a90329}}@media only screen and (min-width:320px) and (max-width:479px){.btn-header.transparent a{border:0!important;background:0;margin-left:0;width:25px!important;-webkit-box-shadow:none!important;box-shadow:none!important}.btn-header.transparent a:hover{color:#a90329}}.btn-header>:first-child>a{border-radius:2px;cursor:default!important;display:inline-block;font-weight:700;height:30px;min-width:30px;padding:3px;text-align:center;text-decoration:none!important;-moz-user-select:none;-webkit-user-select:none;background-color:#f8f8f8;background-image:-webkit-gradient(linear,left top,left bottom,from(#f8f8f8),to(#f1f1f1));background-image:-webkit-gradient(linear,top left,bottom left,from(#f8f8f8),to(#f1f1f1));background-image:-webkit-linear-gradient(top,#f8f8f8,#f1f1f1);background-image:linear-gradient(top,#f8f8f8,#f1f1f1);border:1px solid #bfbfbf;color:#6d6a69;font-size:17px;margin:10px 0 0}.btn-header>:first-child>a:hover{border:1px solid #bfbfbf;color:#222;-webkit-transition:all 0s;transition:all 0s;cursor:pointer;-webkit-box-shadow:inset 0 0 4px 1px rgba(0,0,0,0.08);box-shadow:inset 0 0 4px 1px rgba(0,0,0,0.08)}.btn-header>:first-child>a:active{background-color:#e8e8e8;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#e8e8e8),color-stop(100%,#ededed));background-image:-webkit-gradient(linear,top left,bottom left,from(#e8e8e8),to(#ededed));background-image:-webkit-linear-gradient(top,#e8e8e8 0,#ededed 100%);background-image:linear-gradient(to bottom,#e8e8e8 0,#ededed 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e8e8e8',endColorstr='#ededed',GradientType=0);-webkit-box-shadow:inset 0 0 3px 1px rgba(0,0,0,0.15);box-shadow:inset 0 0 3px 1px rgba(0,0,0,0.15)}.ribbon-button-alignment{padding-top:10px;display:inline-block}.ribbon-button-alignment.pull-right>.btn.btn-ribbon{margin:0 0 0 8px}.header-btn{margin-top:5px}.widget-header>:first-child{margin:13px 0}.widget-toolbar{display:inline-block;position:relative;float:right;width:auto;height:29px;line-height:29px;border-left:1px solid rgba(0,0,0,0.09);cursor:pointer;padding:0 8px;text-align:center}.widget-toolbar.no-border{border-left:0}.widget-toolbar>:first-child{text-align:left}.widget-toolbar .ams-form label.checkbox,.widget-toolbar .ams-form label.radio{line-height:29px}.widget-toolbar .ams-form .icon-append,.widget-toolbar .ams-form .icon-prepend{top:3px!important}.widget-toolbar.ams-form .icon-append,.widget-toolbar.ams-form .icon-prepend{top:3px!important}.widget-toolbar>.ams-form{margin-top:2px}.widget-toolbar>.ams-form .toggle:last-child{font-size:12px;line-height:29px}.widget-toolbar>.ams-form .checkbox input+i,.widget-toolbar>.ams-form .radio input+i,.widget-toolbar>.ams-form .toggle input+i{border-width:1px;border-color:#c7c7c7!important;margin-top:-1px;-webkit-box-shadow:0 1px 1px #FFF,0 1px 1px #858585 inset;box-shadow:0 1px 1px #FFF,0 1px 1px #858585 inset}.widget-toolbar .btn-group{margin-top:-3px}.widget-toolbar>.btn{margin-top:-3px;font-size:12px!important;padding:1px 8px!important}.widget-toolbar>.label{display:inline-block;vertical-align:middle;margin-top:-3px;text-align:center;font-size:12px;padding:4px 7px}.widget-toolbar>.badge{padding:5px;font-size:14px;border-radius:50%;font-weight:400;min-width:24px;text-align:center!important}.widget-toolbar .progress{width:130px;margin:7px 0 0;height:18px!important;font-size:12px;box-shadow:0 1px 0 rgba(0,0,0,0),0 0 0 1px #d1d1d1 inset;-webkit-box-shadow:0 1px 0 rgba(0,0,0,0),0 0 0 1px #d1d1d1 inset}.widget-toolbar .progress-bar{font-size:12px}.widget-toolbar .pagination{margin:4px 0}.widget-toolbar .pagination>li>a{padding:2px 7px}.widget-toolbar .widget-text-input{max-width:220px}.widget-toolbar input[type=text]{height:28px!important;margin-top:2px}.widget-body.no-padding{padding:0;margin:0}.widget-body.no-padding .alert{margin:5px 5px 0;padding:10px;box-shadow:none!important;-webkit-box-shadow:none!important;border-radius:0!important}.widget-body>table{margin-bottom:0}.widget-body-ajax-loading::before{display:block;position:absolute;content:url(../img/ajax-loader.gif);padding-top:18%;text-align:center;font-weight:700;font-size:16px;color:#fff;background:rgba(255,255,255,0.4);height:100%;z-index:1;width:100%}.widget-body-ajax-loading:hover{cursor:wait!important}.widget-body-toolbar,.ams-form.widget-body-toolbar{display:block;padding:8px 10px;margin:-13px -13px 13px;min-height:42px;border-bottom:1px solid #ccc;background:#fafafa}.no-padding .widget-body-toolbar,.no-padding .ams-form.widget-body-toolbar,.no-padding.widget-body-toolbar,.no-padding.ams-form.widget-body-toolbar{display:block;margin:0}.ams-form .widget-body-toolbar .inline-group,.widget-body-toolbar.ams-form .inline-group{float:left;margin-top:4px}.widget-body-toolbar .btn{vertical-align:middle}.widget-body-toolbar .btn-xs{margin-top:5px}.no-widget-toolbar .widget-body-toolbar{display:none}.widget-content-padding{padding:20px}.widget-content-padding .well{margin-bottom:0}.widget-footer{display:block;position:relative;min-height:32px;vertical-align:middle;margin:0 -13px -13px;padding:5px;border-top:1px solid #e4e4e4;text-align:right;background-color:#f8f7f7}.no-padding .widget-footer{margin:0}.widget-footer.ams-form>label{margin-top:4px;display:block}.ams-widget{position:relative;margin:0 0 15px;padding:0;-khtml-border-radius:0;border-radius:0}.ams-widget header .nav-tabs{border-bottom-color:transparent}.ams-widget header .nav-tabs>li>a{border-radius:0;border:0;padding:5px 15px 4px}.ams-widget header .nav-tabs>li.active>a,.ams-widget header .nav-tabs>li.active>a:focus,.ams-widget header .nav-tabs>li.active>a:hover{color:#555;background-color:#FFF;border:1px solid #c2c2c2;border-bottom-color:transparent;border-top:0;cursor:default}.ams-widget header:first-child .nav-tabs{float:left}.ams-widget header:first-child .nav-tabs li{padding-left:0}.ams-widget header:first-child .nav-tabs li a{color:#333}.ams-widget header:first-child .nav-tabs.pull-right li:last-child a{margin-right:0!important;border-right:0!important}.ams-widget header .nav-pills{margin:3px}.ams-widget header .nav-pills>li>a{padding:3px 5px 4px}.ams-widget header>.btn-group{margin-top:-13px;margin-left:5px}.ams-widget>header{height:30px;padding:0;line-height:40px;color:#333;border:1px solid #c2c2c2;background:#fafafa}.ams-widget>header h2{display:inline-block;position:relative;width:auto;height:100%;margin:0;font-size:14px;line-height:31px;font-weight:400;letter-spacing:0}@media only screen and (min-width:320px) and (max-width:479px){.ams-widget>header h2{width:135px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}}.rtl .ams-widget>header h2{float:right;text-align:right}.ams-widget>header>h2{margin-left:10px;float:left}.rtl .ams-widget>header{padding:0 7px 0 0}.ams-widget>header .widget-icon{display:block;float:left;width:16px;height:16px;margin:10px 10px 0 0;zoom:1;z-index:400}.rtl .ams-widget>header .widget-icon{float:right;margin:10px 0 0 7px}.ams-widget>header>.widget-icon{display:block;position:relative;float:left;margin:0 -10px 0 2px;width:28px;height:28px;font-size:111%;line-height:29px;text-align:center}.ams-widget>header>:first-child.widget-icon{margin-left:0}.ams-widget>div{position:relative;float:left;width:100%;font-size:13px;-khtml-border-radius:0;border-radius:0;margin:0;padding:13px 13px 0;background-color:#fff!important;border-width:1px 1px 2px;border-style:solid;border-top:0;border-right-color:#CCC!important;border-bottom-color:#CCC!important;border-left-color:#CCC!important}.ams-widget .widget-body{position:relative;min-height:100px;padding-bottom:13px}.ams-widget .widget-body.widget-hide-overflow{overflow:hidden}.ams-widget.well{margin:0 0 30px}.ams-widget.well header{display:none}.ams-widget.well>div{border:0!important;box-shadow:none!important;-webkit-box-shadow:none!important}.ams-widget.well.transparent .widget-body.no-padding{margin:0!important}.ams-widget-ctrls{width:auto;float:right;padding:0;margin:0}.ams-widget-ctrls a{display:inline-block;padding:0;margin:0;text-decoration:none;font-size:14px;text-align:center;line-height:29px;color:#333}.ams-widget-ctrls .button-icon{position:relative;float:left;min-width:28px;height:28px;font-family:Ubuntu,Arial,Helvetica,sans-serif;border-left:1px solid rgba(0,0,0,0.09)}.ams-widget-ctrls .button-icon :hover{background-color:rgba(0,0,0,0.05)}.rtl .ams-widget-ctrls .button-icon{margin:0 0 5px 5px}.rtl .ams-widget-ctrls{float:left;padding:10px 0 0 3px;margin:0}.ams-widget-loader{display:none;float:right;width:28px;height:28px;margin:0;text-align:center;line-height:28px;background-repeat:no-repeat;background-position:center center}.rtl .ams-widget-loader{float:left}.ams-widget-editbox{display:none;padding:10px;border-bottom:1px solid #b1b1b1;background-color:#fff;margin:-13px -13px 13px}.no-padding .ams-widget-editbox{margin:0 0 10px}.ams-widget,.ams-widget-editbox,.ams-widget>div{zoom:1}.ams-widget:after,.ams-widget-editbox:after,.ams-widget>div:after{clear:both}.ams-widget:before,.ams-widget-editbox:before,.ams-widget>div:before,.ams-widget:after,.ams-widget-editbox:after,.ams-widget>div:after{display:block;visibility:hidden;overflow:hidden;content:"\0020";height:0;font-size:0;line-height:0}.ui-sortable .ams-widget-sortable>header{cursor:move;line-height:normal;-khtml-border-radius:0;border-radius:0;-webkit-box-shadow:inset 0 -2px 0 rgba(0,0,0,0.05);box-shadow:inset 0 -2px 0 rgba(0,0,0,0.05)}.ui-sortable .ams-widget-sortable.ams-widget-collapsed>header{-khtml-border-radius:0;border-radius:0}.ams-widget-timestamp{margin:10px 0 0;color:#868686;font-size:12px;font-style:italic}.ams-widget-placeholder{margin-bottom:28px;padding:0;background-color:#FFC;border:1px dashed #a7a7a7;-khtml-border-radius:0;border-radius:0;-webkit-box-sizing:border-box;-khtml-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.ams-widget-remove-colors{color:#333!important;padding:0!important;background:none!important}.ams-widget-color-magenta>header{color:#fff;background:#6e3671;border-color:#6e3671!important}.ams-widget-color-magenta .nav-tabs li:not(.active) a,.ams-widget-color-magenta>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-magenta .nav-tabs li a:hover{color:#333!important}.ams-widget-color-pink>header{color:#fff;background:#ac5287;border-color:#ac5287!important}.ams-widget-color-pink .nav-tabs li:not(.active) a,.ams-widget-color-pink>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-pink .nav-tabs li a:hover{color:#333!important}.ams-widget-color-pinkDark>header{color:#fff;background:#a8829f;border-color:#a8829f!important}.ams-widget-color-pinkDark .nav-tabs li:not(.active) a,.ams-widget-color-pinkDark>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-pinkDark .nav-tabs li a:hover{color:#333!important}.ams-widget-color-yellow>header{color:#fff;background:#d4c737;border-color:#d4c737!important}.ams-widget-color-yellow .nav-tabs li:not(.active) a,.ams-widget-color-yellow>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-yellow .nav-tabs li a:hover{color:#333!important}.ams-widget-color-orange>header{color:#fff;background:#c79121;border-color:#c79121!important}.ams-widget-color-orange .nav-tabs li:not(.active) a,.ams-widget-color-orange>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-orange .nav-tabs li a:hover{color:#333!important}.ams-widget-color-orangeDark>header{color:#fff;background:#a57225;border-color:#a57225!important}.ams-widget-color-orangeDark .nav-tabs li:not(.active) a,.ams-widget-color-orangeDark>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-orangeDark .nav-tabs li a:hover{color:#333!important}.ams-widget-color-darken>header{color:#fff;background:#404040;border-color:#404040!important}.ams-widget-color-darken .nav-tabs li:not(.active) a,.ams-widget-color-darken>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-darken .nav-tabs li a:hover{color:#333!important}.ams-widget-color-purple>header{color:#fff;background:#65596b;border-color:#65596b!important}.ams-widget-color-purple .nav-tabs li:not(.active) a,.ams-widget-color-purple>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-purple .nav-tabs li a:hover{color:#333!important}.ams-widget-color-teal>header{color:#fff;background:#568a89;border-color:#568a89!important}.ams-widget-color-teal .nav-tabs li:not(.active) a,.ams-widget-color-teal>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-teal .nav-tabs li a:hover{color:#333!important}.ams-widget-color-blueDark>header{color:#fff;background:#4c4f53;border-color:#4c4f53!important}.ams-widget-color-blueDark .nav-tabs li:not(.active) a,.ams-widget-color-blueDark>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-blueDark .nav-tabs li a:hover{color:#333!important}.ams-widget-color-blue>header{color:#fff;background:#60747c;border-color:#60747c!important}.ams-widget-color-blue .nav-tabs li:not(.active) a,.ams-widget-color-blue>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-blue .nav-tabs li a:hover{color:#333!important}.ams-widget-color-blueLight>header{color:#fff;background:#ccdadf;border-color:#ccdadf!important}.ams-widget-color-blueLight .nav-tabs li:not(.active) a,.ams-widget-color-blueLight>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-blueLight .nav-tabs li a:hover{color:#333!important}.ams-widget-color-red>header{color:#fff;background:#931313;border-color:#931313!important}.ams-widget-color-red .nav-tabs li:not(.active) a,.ams-widget-color-red>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-red .nav-tabs li a:hover{color:#333!important}.ams-widget-color-redLight>header{color:#fff;background:#a65858;border-color:#a65858!important}.ams-widget-color-redLight .nav-tabs li:not(.active) a,.ams-widget-color-redLight>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-redLight .nav-tabs li a:hover{color:#333!important}.ams-widget-color-white>header{color:#c8c8c8;background:#dedede;border-color:#c8c8c8!important}.ams-widget-color-white .nav-tabs li:not(.active) a,.ams-widget-color-white>header>.ams-widget-ctrls a{color:#c8c8c8!important}.ams-widget-color-white .nav-tabs li a:hover{color:#838383!important}.ams-widget-color-greenDark>header{color:#fff;background:#496949;border-color:#496949!important}.ams-widget-color-greenDark .nav-tabs li:not(.active) a,.ams-widget-color-greenDark>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-greenDark .nav-tabs li a:hover{color:#333!important}.ams-widget-color-green>header{color:#fff;background:#356e35;border-color:#356e35!important}.ams-widget-color-green .nav-tabs li:not(.active) a,.ams-widget-color-green>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-green .nav-tabs li a:hover{color:#333!important}.ams-widget-color-greenLight>header{color:#fff;background:#71843f;border-color:#71843f!important}.ams-widget-color-greenLight .nav-tabs li:not(.active) a,.ams-widget-color-greenLight>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-greenLight .nav-tabs li a:hover{color:#333!important}#ams-widget-fullscreen-mode{position:fixed;width:100%;height:100%;top:0;left:0;z-index:99999}#ams-widget-fullscreen-mode .ams-widget{margin:0;-khtml-border-radius:0;border-radius:0}#ams-widget-fullscreen-mode>div{overflow-y:scroll;-khtml-border-radius:0;border-radius:0}#ams-widget-fullscreen-mode>div>header{cursor:default}.onoffswitch{position:relative;width:50px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;margin-top:3px;margin-bottom:3px;margin-left:5px;display:inline-block;vertical-align:middle}.onoffswitch-container{margin-top:4px;margin-left:7px;display:inline-block}.onoffswitch-checkbox{display:none}.onoffswitch-label{display:block;overflow:hidden;cursor:pointer;border:1px solid #626262;border-radius:50px;border-color:#adadad #b3b3b3 #9e9e9e;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.onoffswitch-inner{width:200%;margin-left:-100%;display:block}.onoffswitch-inner:after,.onoffswitch-inner:before{float:left;width:50%;height:15px;padding:0;line-height:17px;font-size:10px;font-family:Ubuntu,Trebuchet,Arial,sans-serif;font-weight:700;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.onoffswitch-inner:before{content:attr(data-swchon-text);text-shadow:0 -1px 0 #333;padding-left:7px;background-color:#3276b1;color:#fff;-webkit-box-shadow:inset 0 2px 6px rgba(0,0,0,0.5),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 6px rgba(0,0,0,0.5),0 1px 2px rgba(0,0,0,0.05);text-align:left}.onoffswitch-inner:after{content:attr(data-swchoff-text);padding-right:7px;text-shadow:0 -1px 0 #fff;background-color:#fff;color:#555;text-align:right;-webkit-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)}.onoffswitch-switch{width:19px;height:19px;margin:-2px;background:#fff;border:1px solid #9a9a9a;border-radius:50px;position:absolute;top:0;bottom:0;right:32px;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;background-color:#f4f4f4;background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#eee));background-image:-webkit-gradient(linear,top left,bottom left,from(#fff),to(#eee));background-image:-webkit-linear-gradient(top,#fff,#eee);background-image:linear-gradient(to bottom,#fff,#eee);background-repeat:repeat-x;-webkit-box-shadow:1px 1px 4px 0 rgba(0,0,0,0.3);box-shadow:1px 1px 4px 0 rgba(0,0,0,0.3)}.onoffswitch-checkbox+.onoffswitch-label .onoffswitch-switch:before,.onoffswitch-checkbox:checked+.onoffswitch-label .onoffswitch-switch:before{content:"\f00d";color:#a90329;display:block;text-align:center;line-height:19px;font-size:10px;text-shadow:0 -1px 0 #fff;font-weight:700;font-family:FontAwesome}.onoffswitch-checkbox:checked+.onoffswitch-label .onoffswitch-switch:before{content:"\f00c";color:#57889c}.onoffswitch-checkbox:checked+.onoffswitch-label .onoffswitch-inner{margin-left:0;display:block}.onoffswitch-checkbox:checked+.onoffswitch-label .onoffswitch-switch{right:0}.onoffswitch-switch:hover{background-color:#eee}.onoffswitch-switch:active{background-color:#eee;-webkit-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)}.onoffswitch-checkbox:checked:disabled+.onoffswitch-label .onoffswitch-inner:before,.onoffswitch-checkbox:disabled+.onoffswitch-label .onoffswitch-inner:after{text-shadow:0 1px 0 #fff;background:#bfbfbf;color:#333}.onoffswitch-checkbox:checked:disabled+.onoffswitch-label .onoffswitch-switch,.onoffswitch-checkbox:disabled+.onoffswitch-label .onoffswitch-switch{background-color:#f4f4f4;background-image:-webkit-gradient(linear,0 0,0 100%,from(#bfbfbf),to(#f4f4f4));background-image:-webkit-gradient(linear,top left,bottom left,from(#bfbfbf),to(#f4f4f4));background-image:-webkit-linear-gradient(top,#bfbfbf,#f4f4f4);background-image:linear-gradient(to bottom,#bfbfbf,#f4f4f4);-webkit-box-shadow:none!important;box-shadow:none!important}.onoffswitch-checkbox:checked:disabled+.onoffswitch-label .onoffswitch-label,.onoffswitch-checkbox:disabled+.onoffswitch-label{border-color:#ababab #999 #878787!important}.onoffswitch-checkbox:checked+.onoffswitch-label{border-color:#3276b1 #2a6395 #255681}.onoffswitch+span,.onoffswitch-title{display:inline-block;vertical-align:middle;margin-top:-5px}label.with-icon .select2-parent{margin-right:27px}label.with-icons .select2-parent{margin-right:54px}.select2-container{margin:0;position:relative;display:inline-block;zoom:1;*display:inline;vertical-align:middle}.select2-container .select2-choice{display:block;height:26px;padding:0 0 0 8px;overflow:hidden;position:relative;border:1px solid #ccc;white-space:nowrap;line-height:26px;color:#444;text-decoration:none;-webkit-background-clip:padding-box;background-clip:padding-box;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#fff}label.bordered .select2-container .select2-choice{border-color:transparent}.select2-container .select2-choice:hover{border:1px solid rgba(82,168,236,0.7)}.select2-container .select2-choice>.select2-chosen{margin-right:26px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.select2-container .select2-choice>.select2-chosen abbr{display:none;width:12px;height:12px;position:absolute;right:24px;top:8px;font-size:1px;text-decoration:none;border:0;cursor:pointer;outline:0}.select2-container .select2-choice>.select2-chosen abbr:hover{cursor:pointer}.select2-container.select2-drop-above .select2-choice{border-bottom-color:#ccc}.select2-container.select2-allowclear .select2-choice .select2-chosen{margin-right:42px}.select2-container.select2-allowclear .select2-choice abbr{display:inline-block}.select2-container .select2-arrow{display:inline-block;width:20px;height:20px;position:absolute;right:3px;top:3px;padding:0 0 0 2px;border-left:1px solid #ccc;line-height:22px;-webkit-background-clip:padding-box}.select2-container .select2-arrow b{width:100%;height:100%;display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:relative;font-size:14px}.select2-container .select2-arrow b:before{content:"\f107";width:100%;height:100%;text-align:center;display:block}.select2-container,.select2-drop,.select2-search,.select2-search input{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.select2-container-active .select2-choice,.select2-container-active .select2-choices{border:1px solid rgba(82,168,236,0.7)!important;outline:0}.select2-drop-mask{border:0;margin:0;padding:0;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:9998;background:#fff;filter:alpha(opacity=0)}.select2-drop{margin-top:-1px;width:100%;position:absolute;z-index:9999;top:100%;background:#fff;color:#000;border:1px solid #ccc;border-top:0;-webkit-box-shadow:0 4px 5px rgba(0,0,0,0.15);box-shadow:0 4px 5px rgba(0,0,0,0.15)}.select2-drop.select2-drop-above{margin-bottom:0;border-top:1px solid rgba(82,168,236,0.7);border-top-width:3px;border-bottom:0;-webkit-box-shadow:0 -4px 5px rgba(0,0,0,0.15);box-shadow:0 -4px 5px rgba(0,0,0,0.15)}.select2-drop.select2-drop-above.select2-drop-active{border-top-width:3px}.select2-drop.select2-drop-above .select2-search input{margin-top:4px}.select2-drop.select2-drop-above .select2-search:before{top:34%}.select2-drop-auto-width{border-top:1px solid #ccc;width:auto}.select2-drop-auto-width .select2-search{padding-top:4px}.select2-drop-active{border:1px solid rgba(82,168,236,0.7);border-top:0;border-bottom-width:3px}.select2-search{display:inline-block;width:100%;min-height:26px;margin:0;padding-left:4px;padding-right:4px;position:relative;z-index:10000;white-space:nowrap}.select2-search:before{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:absolute;content:"\f002";top:25%;right:10px;color:#686868!important}.select2-search input{width:100%;height:auto!important;min-height:26px;padding:4px 20px 3px 5px;margin:0;outline:0;font-size:1em;border:1px solid #aaa;-webkit-box-shadow:none;box-shadow:none;background:#fff;background:-webkit-gradient(linear,left bottom,left top,color-stop(0.85,#fff),color-stop(0.99,#eee));background:-webkit-linear-gradient(center bottom,#fff 85%,#eee 99%);background:-webkit-gradient(linear,top left,bottom left,from(#fff),to(#eee));background:-webkit-linear-gradient(top,#fff 85%,#eee 99%);background:linear-gradient(top,#fff 85%,#eee 99%)}.select2-search input.select2-active{background-origin:padding-box;background:#fff url(../img/select2-spinner.gif) no-repeat right 24px top 50%;background:url(../img/select2-spinner.gif) no-repeat right 24px top 50%,-webkit-gradient(linear,left bottom,left top,color-stop(0.85,#fff),color-stop(0.99,#eee));background:url(../img/select2-spinner.gif) no-repeat right 24px top 50%,-webkit-linear-gradient(center bottom,#fff 85%,#eee 99%);background:url(../img/select2-spinner.gif) no-repeat right 24px top 50%,-webkit-gradient(linear,top left,bottom left,from(#fff),to(#eee));background:url(../img/select2-spinner.gif) no-repeat right 24px top 50%,-webkit-linear-gradient(top,#fff 85%,#eee 99%);background:url(../img/select2-spinner.gif) no-repeat right 24px top 50%,linear-gradient(top,#fff 85%,#eee 99%)}.select2-dropdown-open .select2-choice{border-bottom-color:transparent;-webkit-box-shadow:0 1px 0 #fff inset;box-shadow:0 1px 0 #fff inset;border-bottom-left-radius:0;border-bottom-right-radius:0;background-color:#fff}.select2-dropdown-open.select2-drop-above .select2-choice,.select2-dropdown-open.select2-drop-above .select2-choices{border:1px solid #5d98cc;border-top-color:transparent}.select2-dropdown-open .select2-choice .select2-arrow{background:0;border-left:0;-webkit-filter:none;filter:none}.select2-dropdown-open .select2-choice .select2-arrow b{background-position:-18px 1px}.select2-results{max-height:200px;padding:0 0 0 4px;margin:4px 4px 4px 0;position:relative;overflow-x:hidden;overflow-y:auto;-webkit-tap-highlight-color:rgba(0,0,0,0)}.select2-results .select2-selected{opacity:.5}.select2-results ul.select2-result-sub{margin:0;padding-left:0}.select2-results ul.select2-result-sub>li .select2-result-label{padding-left:20px}.select2-results ul.select2-result-sub ul.select2-result-sub>li .select2-result-label{padding-left:40px}.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub>li .select2-result-label{padding-left:60px}.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub>li .select2-result-label{padding-left:80px}.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub>li .select2-result-label{padding-left:100px}.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub>li .select2-result-label{padding-left:110px}.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub>li .select2-result-label{padding-left:120px}.select2-results li{list-style:none;display:list-item;background-image:none}.select2-results li.select2-result-with-children>.select2-result-label{font-weight:700}.select2-results .select2-result-label{padding:3px 7px 4px;margin:0;cursor:pointer;min-height:1em;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.select2-results .select2-highlighted{background:#3276b1;color:#fff}.select2-results li em{background:#feffde;font-style:normal}.select2-results .select2-highlighted em{background:0}.select2-results .select2-highlighted ul{background:#fff;color:#000}.select2-results .select2-no-results,.select2-results .select2-searching,.select2-results .select2-selection-limit{background:#f4f4f4;display:list-item;padding:3px 5px;opacity:.5}.select2-results-results .select2-disabled{background:#f4f4f4;display:list-item;cursor:default}.select2-results-results .select2-disabled.select2-highlighted{color:#666;background:#f4f4f4;display:list-item;cursor:default}.select2-results-results .select2-selected{display:none}.select2-no-results{padding-left:20px}.select2-no-results:before{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\f05a";margin-right:5px}.select2-more-results{background:#f4f4f4;display:list-item}.select2-more-results.select2-active{background:#f4f4f4 url(../img/select2-spinner.gif) no-repeat 100%}.select2-default{color:#999!important}.select2-container.select2-container-disabled .select2-choice{background-color:#f4f4f4;background-image:none;border:1px solid #ddd;cursor:default}.select2-container.select2-container-disabled .select2-choice .select2-arrow{background-color:#f4f4f4;background-image:none;border-left:0}.select2-container.select2-container-disabled .select2-choice abbr{display:none}.select2-container-multi.select2-container-active .select2-choices{border:1px solid rgba(82,168,236,0.7);outline:0}.select2-container-multi .select2-choices{height:auto!important;height:1%;min-height:26px;margin:0;padding:0;position:relative;border:1px solid #ccc;cursor:text;overflow:hidden;background-color:#fff}label.bordered .select2-container-multi .select2-choices{border-color:transparent}.select2-container-multi .select2-choices:hover{border:1px solid rgba(82,168,236,0.7)!important}label.bordered .select2-container-multi .select2-choices:hover{border-color:transparent!important}.select2-container-multi .select2-choices li{float:left;list-style:none}.select2-container-multi .select2-choices .select2-search-field{margin:0;padding:0;white-space:nowrap}.select2-container-multi .select2-choices .select2-search-field input{max-height:24px;padding:3px 5px;margin:1px 0;font-family:Ubuntu,sans-serif;font-size:100%;color:#666;outline:0;border:0;-webkit-box-shadow:none;box-shadow:none;background:transparent!important}.select2-container-multi .select2-choices .select2-search-field input.select2-active{background:#fff url(../img/select2-spinner.gif) no-repeat 99%!important}.select2-container-multi .select2-choices .select2-search-choice{padding:1px 28px 1px 8px;margin:2px 0 2px 2px;position:relative;line-height:18px;color:#fff;cursor:default;border:1px solid #2a6395;-webkit-background-clip:padding-box;background-clip:padding-box;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#3276b1}.select2-container-multi .select2-choices .select2-search-choice .select2-chosen{cursor:default}.select2-container-multi .select2-choices .select2-search-choice-focus{opacity:.8}.select2-container-multi .select2-choices .select2-search-choice.ui-sortable-handle{cursor:move}.select2-container-multi.ordered .select2-choices li{float:none}.select2-container-multi.ordered .select2-choices li.ui-state-highlight{margin:2px 0 2px 2px;height:20px;background-color:#ddd;border:1px solid #ddd}.select2-container-multi .select2-search-choice-close{display:block;top:0;right:-2px;padding:3px 0 3px 6px}.select2-container-multi .select2-search-choice-close:hover{background:rgba(0,0,0,0.3)}.select2-container-multi.select2-container-disabled .select2-choices{background-color:#f4f4f4;background-image:none;border:1px solid transparent;border-bottom:1px solid #ccc;cursor:default}.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice{padding:1px 5px;border:1px solid #4a90cc;background-image:none;background-color:#86b4dd;cursor:not-allowed}.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close{display:none;background:0}.select2-locked{padding:3px 5px!important}.select2-search-choice-close{display:block;min-width:20px;min-height:14px;position:absolute;right:3px;top:3px;margin:0;padding:0;font-size:15px;text-decoration:none!important;font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.select2-search-choice-close:before{color:#fff;content:"\f057"}.select2-result-selectable .select2-match,.select2-result-unselectable .select2-match{text-decoration:underline}.select2-offscreen,.select2-offscreen:focus{clip:rect(0 0 0 0)!important;width:1px!important;height:1px!important;border:0!important;margin:0!important;padding:0!important;overflow:hidden!important;position:absolute!important;outline:0!important;left:0!important;top:0!important}.select2-display-none{display:none}.select2-measure-scrollbar{position:absolute;top:-10000px;left:-10000px;width:100px;height:100px;overflow:scroll}.select2-hidden-accessible{position:absolute;border:0;clip:rect(0 0 0 0);height:1px;width:1px;margin:-1px;overflow:hidden;padding:0}label.with-icon>i.icon-append+.select2-parent .select2-choices{padding-right:29px}.multiselect-container{position:absolute;list-style-type:none;margin:0;padding:0}.multiselect-container .input-group{margin:5px}.multiselect-container>li{padding:0}.multiselect-container>li>a.multiselect-all label{font-weight:700}.multiselect-container>li>a>label{margin:0;height:100%;cursor:pointer;font-weight:400}.multiselect-container>li>a>label.checkbox,.multiselect-container>li>a>label.radio{margin:0}.multiselect-container>li>a>label>input[type=checkbox]{margin-bottom:5px}.multiselect-container>li>label.multiselect-group{margin:0;padding:3px 20px;height:100%;font-weight:700}.btn-group>.btn-group:nth-child(2)>.multiselect.btn{border-top-left-radius:4px;border-bottom-left-radius:4px}.color-select{list-style:none;margin:0;padding:4px;min-width:166px;max-width:156px;right:-3px}.color-select li{display:block;margin:2px;float:left}.color-select li span{display:block;width:22px;height:22px;padding:0;background:#333;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;border:1px solid rgba(0,0,0,0.1);cursor:pointer}.color-select li span:hover{border:3px solid rgba(0,0,0,0.2)}.widget-toolbar .dropdown-menu.color-select{right:-1px}.color-box{display:block;position:relative;width:22px;height:22px;padding:0;background:#333;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border:1px solid rgba(255,255,255,0.3)!important;cursor:pointer;vertical-align:middle;outline:1px solid rgba(0,0,0,0.1);background:rgba(255,255,255,0.3)!important}.color-box:hover,.open .color-box{outline:1px solid rgba(0,0,0,0.1)!important}.color-box:hover{-webkit-transform:scale(1.07);-moz-transform:scale(1.07)}.color-box:active{top:1px;left:1px}.widget-toolbar>.color-box{margin-top:7px;width:18px;height:18px;outline:1px solid rgba(0,0,0,0.2)}.widget-toolbar>.color-box:active,.widget-toolbar>.color-box:focus,.widget-toolbar>.color-box:hover{outline:1px solid rgba(0,0,0,0.25)!important}.ams-widget #calendar{margin-top:-18px}#calendar-buttons{position:absolute;right:14px;top:5px}#calendar-container{position:relative}#external-events>li{margin:6px 4px 6px 0;display:inline-block}#external-events>li>:first-child{padding:5px 10px 10px;cursor:move;display:block}#external-events>li>:first-child:after{color:#fff;color:rgba(255,255,255,0.7);content:attr(data-description);font-size:11px;font-weight:400;display:block;line-height:0;margin:7px 0;text-transform:lowercase}.fc{direction:ltr;text-align:left}.fc .fc-header-space{padding-left:10px}.fc table,html .fc{font-size:12px}.fc table{border-collapse:collapse;border-spacing:0}.fc th,.fc td{padding:0;vertical-align:top}.fc .ui-resizable-handle{display:block;position:absolute;z-index:99999;overflow:hidden;font-size:300%;line-height:50%}.fc .ui-draggable-dragging .fc-event-bg{display:none}.fc-border-separate thead tr,.fc-border-separate .table thead tr{background-color:#eee;background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#fafafa));background-image:-webkit-linear-gradient(top,#f2f2f2 0,#fafafa 100%);background-image:-linear-gradient(top,#f2f2f2 0,#fafafa 100%);font-size:12px}.fc-border-separate thead tr th{padding:4px;line-height:1.428571429}tr td.fc-first,tr.fc-first th.fc-first{border-left:0}tr.fc-last td{border-bottom:0}.fc-header .fc-button{margin-bottom:1em;vertical-align:top;margin-right:-1px}.fc-header .fc-corner-right{margin-right:1px}.fc-header .ui-corner-right{margin-right:0}.fc-header .fc-state-hover,.fc-header .ui-state-hover{z-index:2}.fc-header .fc-state-down{z-index:3}.fc-header .fc-state-active,.fc-header .ui-state-active{z-index:4}.fc-header td{white-space:nowrap}.fc-header-left{width:25%;text-align:left}.fc-header-center{text-align:center}.fc-header-right{width:25%;text-align:right}.fc-header-title{display:inline-block;vertical-align:top}.fc-header-title h2{margin-top:0;white-space:nowrap}.ams-widget .fc-header-title h2{text-shadow:0 1px 0 #fff;margin-top:-12px;margin-left:10px;font-size:14px;font-weight:700;margin-bottom:0}.fc-content{clear:both}.fc-view{width:100%;overflow:hidden}.fc-widget-content,.fc-widget-header{border:1px solid #ccc;border-right:0}.fc-state-highlight{background:#ffc}.fc-cell-overlay{background:#9cf;opacity:.2;filter:alpha(opacity=20)}.fc-button{position:relative;display:inline-block;cursor:pointer}.fc-button-inner{position:relative;float:left;overflow:hidden}.fc-state-default{border-width:1px 0}.fc-state-default .fc-button-inner{border-width:0 1px}.fc-state-default,.fc-state-default .fc-button-inner{border-style:solid;border-color:#ccc #bbb #aaa;background:#f3f3f3;color:#000}.fc-state-default .fc-button-effect{position:absolute;top:50%;left:0}.fc-state-default .fc-button-effect span{position:absolute;top:-100px;left:0;width:500px;height:100px;border-width:100px 0 0 1px;border-style:solid;border-color:#fff;background:#444;opacity:.09;filter:alpha(opacity=9)}.fc-state-hover .fc-button-inner{border-color:#999}.fc-state-down .fc-button-inner{border-color:#555;background:#777}.fc-state-active .fc-button-inner{border-color:#555;background:#777;color:#fff}.fc-state-disabled{cursor:default}.fc-state-disabled .fc-button-inner{color:#999;border-color:#ddd}.fc-state-disabled .fc-button-effect{display:none}.fc-button-content{position:relative;float:left;height:1.9em;line-height:1.9em;padding:0 .6em;white-space:nowrap}.fc-button-content .fc-icon-wrap{position:relative;float:left;top:50%}.fc-button-content .ui-icon{position:relative;float:left;margin-top:-50%;*margin-top:0;*top:-50%}.fc-event{border-style:solid;border-width:0;font-size:.85em;cursor:default}.fc-rtl .fc-event{text-align:right}.fc-event-draggable,a.fc-event{cursor:pointer}a.fc-event{text-decoration:none}.fc-event-skin{color:#FFF;border-right:0!important;cursor:move}.fc-event-skin .fa:before{display:block;font-size:14px;position:absolute;right:4px;top:3px}.fc-event-inner{position:relative;width:100%;height:100%;border-style:solid;border-width:0;overflow:hidden}.fc-event-hori{border-width:1px 0;margin-bottom:1px}.fc-event-hori .ui-resizable-e{top:0!important;right:-3px!important;width:7px!important;height:100%!important;cursor:e-resize}.fc-event-hori .ui-resizable-w{top:0!important;left:-3px!important;width:7px!important;height:100%!important;cursor:w-resize}.fc-event-hori .ui-resizable-handle{_padding-bottom:14px}.fc-corner-left{margin-left:1px}.fc-corner-left .fc-button-inner,.fc-corner-left .fc-event-inner{margin-left:-1px}.fc-corner-right{margin-right:1px}.fc-corner-right .fc-button-inner,.fc-corner-right .fc-event-inner{margin-right:-1px}.fc-corner-right .fc-event-inner{border-left:6px solid rgba(0,0,0,0.15);padding-left:2px;padding-right:15px}.fc-corner-top{margin-top:1px}.fc-corner-top .fc-event-inner{margin-top:-1px;border-top-width:1px}.fc-corner-bottom{margin-bottom:1px}.fc-corner-bottom .fc-event-inner{margin-bottom:-1px;border-bottom-width:1px}table.fc-table-separate{border-collapse:separate}.fc-table-separate td,.fc-table-separate th{border-width:1px 0 0 1px}.fc-table-separate td.fc-last,.fc-table-separate th.fc-last{border-right-width:1px}.fc-table-separate tr.fc-last td,.fc-table-separate tr.fc-last th{border-bottom-width:1px}.fc-table-separate tbody tr.fc-first td,.fc-table-separate tbody tr.fc-first th{border-top-width:0}.fc-grid th{text-align:center}.fc-grid .fc-day-number{float:right;padding:0 2px}.fc-grid .fc-other-month .fc-day-number{opacity:.3;filter:alpha(opacity=30)}.fc-grid .fc-day-content{clear:both;padding:2px 2px 1px}.fc-grid .fc-event-time{font-weight:700}.fc-rtl .fc-grid .fc-day-number{float:left}.fc-rtl .fc-grid .fc-event-time{float:right}.fc-agenda table{border-collapse:separate}.fc-agenda .fc-agenda-axis{width:50px;padding:0 4px;vertical-align:middle;text-align:right;white-space:nowrap;font-weight:400}.fc-agenda .fc-day-content{padding:2px 2px 1px}.fc-agenda-days th{text-align:center}.fc-agenda-days .fc-agenda-axis{border-right-width:1px}.fc-agenda-days .fc-col0{border-left-width:0}.fc-agenda-allday th{border-width:0 1px}.fc-agenda-allday .fc-day-content{min-height:34px;_height:34px}.fc-agenda-divider-inner{height:2px;overflow:hidden}.fc-widget-header .fc-agenda-divider-inner{background:#eee}.fc-agenda-slots th{border-width:1px 1px 0}.fc-agenda-slots td{border-width:1px 0 0;background:0}.fc-agenda-slots td div{height:20px}.fc-agenda-slots tr.fc-slot0 td,.fc-agenda-slots tr.fc-slot0 th{border-top-width:0}.fc-agenda-slots tr.fc-minor td,.fc-agenda-slots tr.fc-minor th{border-top-style:dotted}.fc-agenda-slots tr.fc-minor th.ui-widget-header{*border-top-style:solid}.fc-event-time,.fc-event-title{padding:3px 0 2px 3px;display:inline-block;line-height:16px;font-weight:700;font-size:11px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.fc-event-vert{border-width:0 1px}.fc-event-vert .fc-event-content,.fc-event-vert .fc-event-head{position:relative;z-index:2;width:100%;overflow:hidden}.fc-event-vert .fc-event-time{white-space:nowrap;font-size:10px}.fc-event-vert .fc-event-bg{position:absolute;z-index:1;top:0;left:0;width:100%;height:100%;background:#fff;opacity:.3;filter:alpha(opacity=30)}.fc-event-vert .ui-resizable-s{bottom:0!important;width:100%!important;height:8px!important;overflow:hidden!important;line-height:8px!important;font-size:11px!important;font-family:monospace;text-align:center;cursor:s-resize}.fc-select-helper .fc-event-bg{display:none}.fc-agenda .ui-resizable-resizing{_overflow:hidden}.colorpicker{padding-left:30px!important}.bootstrap-timepicker{position:relative}.bootstrap-timepicker.pull-right .bootstrap-timepicker-widget.dropdown-menu{left:auto;right:0}.bootstrap-timepicker.pull-right .bootstrap-timepicker-widget.dropdown-menu:before{left:auto;right:12px}.bootstrap-timepicker.pull-right .bootstrap-timepicker-widget.dropdown-menu:after{left:auto;right:13px}.bootstrap-timepicker .add-on{cursor:pointer}.bootstrap-timepicker .add-on i{display:inline-block;width:16px;height:16px}@media(max-width:767px){.bootstrap-timepicker,.bootstrap-timepicker .dropdown-menu{width:100%}}.bootstrap-timepicker-widget.dropdown-menu{padding:4px}.bootstrap-timepicker-widget.dropdown-menu.open{display:inline-block}.bootstrap-timepicker-widget.dropdown-menu:before{border-bottom:7px solid rgba(0,0,0,0.2);border-left:7px solid transparent;border-right:7px solid transparent;content:"";display:inline-block;position:absolute}.bootstrap-timepicker-widget.dropdown-menu:after{border-bottom:6px solid #FFF;border-left:6px solid transparent;border-right:6px solid transparent;content:"";display:inline-block;position:absolute}.bootstrap-timepicker-widget.timepicker-orient-left:before{left:6px}.bootstrap-timepicker-widget.timepicker-orient-left:after{left:7px}.bootstrap-timepicker-widget.timepicker-orient-right:before{right:6px}.bootstrap-timepicker-widget.timepicker-orient-right:after{right:7px}.bootstrap-timepicker-widget.timepicker-orient-top:before{top:-7px}.bootstrap-timepicker-widget.timepicker-orient-top:after{top:-6px}.bootstrap-timepicker-widget.timepicker-orient-bottom:before{bottom:-7px;border-bottom:0;border-top:7px solid #999}.bootstrap-timepicker-widget.timepicker-orient-bottom:after{bottom:-6px;border-bottom:0;border-top:6px solid #fff}.bootstrap-timepicker-widget a.btn,.bootstrap-timepicker-widget input{border-radius:4px}.bootstrap-timepicker-widget table{width:100%;margin:0}.bootstrap-timepicker-widget table table td{text-align:center;height:30px;margin:0;padding:2px}.bootstrap-timepicker-widget table table td:not(.separator){min-width:30px}.bootstrap-timepicker-widget table table td span{width:100%}.bootstrap-timepicker-widget table table td a{border:1px transparent solid;width:100%;display:inline-block;margin:0;padding:8px 0;outline:0;color:#333}.bootstrap-timepicker-widget table table td a:hover{text-decoration:none;background-color:#eee;border-radius:4px;border-color:#ddd}.bootstrap-timepicker-widget table table td a i{margin-top:2px;font-size:18px}.bootstrap-timepicker-widget table table td input{width:25px;margin:0;text-align:center}@media(min-width:767px){.bootstrap-timepicker-widget.modal{width:200px;margin-left:-100px}}.bootstrap-timepicker-widget .modal-content{padding:4px}.note-editor{border:1px solid #a9a9a9}.note-editor.fullscreen{position:fixed;top:0;left:0;z-index:1050;width:100%}.note-editor.fullscreen.fullscreen .note-editable{background-color:#fff}.note-editor.codeview .note-editable,.note-editor.fullscreen .note-resizebar{display:none}.note-editor.codeview .note-codeable{display:block}.note-editor .note-toolbar{padding-bottom:5px;padding-left:5px;margin:0;background-color:#f5f5f5;border-bottom:1px solid #a9a9a9}.note-editor .note-toolbar>.btn-group{margin-top:5px;margin-right:5px;margin-left:0}.note-editor .note-toolbar .note-table .dropdown-menu{min-width:0;padding:5px}.note-editor .note-toolbar .note-table .dropdown-menu .note-dimension-picker{font-size:18px}.note-editor .note-toolbar .note-table .dropdown-menu .note-dimension-picker .note-dimension-picker-mousecatcher{position:absolute!important;z-index:3;width:10em;height:10em;cursor:pointer}.note-editor .note-toolbar .note-table .note-table .dropdown-menu .note-dimension-picker .note-dimension-picker-unhighlighted{position:relative!important;z-index:1;width:5em;height:5em;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIj4+Pjp6ekKlAqjAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKhmnaJzPAAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC) repeat}.note-editor .note-toolbar .note-table .note-table .dropdown-menu .note-dimension-picker .note-dimension-picker-highlighted{position:absolute!important;z-index:2;width:1em;height:1em;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIjd6vvD2f9LKLW+AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKwNDEVT0AAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC) repeat}.note-editor .note-toolbar .note-style blockquote,.note-editor .note-toolbar .note-editor .note-toolbar .note-style h1,.note-editor .note-toolbar .note-editor .note-toolbar .note-style h2,.note-editor .note-toolbar .note-editor .note-toolbar .note-style h3,.note-editor .note-toolbar .note-editor .note-toolbar .note-style h4,.note-editor .note-toolbar .note-editor .note-toolbar .note-style h5,.note-editor .note-toolbar .note-editor .note-toolbar .note-style h6{margin:0}.note-editor .note-toolbar .note-color .dropdown-toggle{width:20px;padding-left:5px}.note-editor .note-toolbar .note-color .dropdown-menu{min-width:290px}.note-editor .note-toolbar .note-color .dropdown-menu .btn-group{margin:0}.note-editor .note-toolbar .note-color .dropdown-menu .btn-group:first-child{margin:0 5px}.note-editor .note-toolbar .note-color .dropdown-menu .btn-group .note-palette-title{margin:2px 7px;font-size:12px;text-align:center;border-bottom:1px solid #eee}.note-editor .note-toolbar .note-color .dropdown-menu .btn-group .note-color-reset{padding:0 3px;margin:5px;font-size:12px;cursor:pointer;border-radius:5px}.note-editor .note-toolbar .note-color .dropdown-menu .btn-group .note-color-reset:hover{background:#eee}.note-editor .note-toolbar .note-para .dropdown-menu{min-width:153px;padding:5px}.note-editor .note-toolbar .note-para .note-para li:first-child{margin-bottom:5px}.note-editor .note-statusbar{background-color:#f5f5f5}.note-editor .note-statusbar .note-resizebar{width:100%;height:8px;cursor:s-resize}.note-editor .note-statusbar .note-resizebar .note-icon-bar{width:20px;margin:1px auto;border-top:1px solid #a9a9a9}.note-editor .note-popover .popover{max-width:none}.note-editor .note-popover .popover .popover-content{padding:5px}.note-editor .note-popover .popover .popover-content a{display:inline-block;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}.note-editor .note-popover .popover .popover-content .btn-group+.btn-group{margin-left:5px}.note-editor .note-popover .popover .arrow{left:20px}.note-editor .note-handle .note-control-selection{position:absolute;display:none;border:1px solid #000}.note-editor .note-handle .note-control-selection>div{position:absolute}.note-editor .note-handle .note-control-selection .note-control-selection-bg{width:100%;height:100%;background-color:#000;-webkit-opacity:.3;-khtml-opacity:.3;-moz-opacity:.3;opacity:.3;-ms-filter:alpha(opacity=30);filter:alpha(opacity=30)}.note-editor .note-handle .note-control-selection .note-control-handle,.note-editor .note-handle .note-control-selection .note-control-holder{width:7px;height:7px;border:1px solid #000}.note-editor .note-handle .note-control-selection .note-control-sizing{width:7px;height:7px;background-color:#fff;border:1px solid #000}.note-editor .note-handle .note-control-selection .note-control-nw{top:-5px;left:-5px;border-right:0;border-bottom:0}.note-editor .note-handle .note-control-selection .note-control-ne{top:-5px;right:-5px;border-bottom:0;border-left:0}.note-editor .note-handle .note-control-selection .note-control-sw{bottom:-5px;left:-5px;border-top:0;border-right:0}.note-editor .note-handle .note-control-selection .note-control-se{right:-5px;bottom:-5px;cursor:se-resize}.note-editor .note-handle .note-control-selection .note-control-selection-info{right:0;bottom:0;padding:5px;margin:5px;font-size:12px;color:#fff;background-color:#000;border-radius:5px;-webkit-opacity:.7;-khtml-opacity:.7;-moz-opacity:.7;opacity:.7;-ms-filter:alpha(opacity=70);filter:alpha(opacity=70)}.note-editor .note-dialog>div{display:none}.note-editor .note-dialog .note-image-dialog .note-dropzone{min-height:200px;font-size:30px;line-height:6;color:#d3d3d3;text-align:center;border:4px dashed #d3d3d3}.note-editor .note-dialog .note-help-dialog{font-size:12px;color:#ccc;background:0;background-color:#222!important;border:0;-webkit-opacity:.9;-khtml-opacity:.9;-moz-opacity:.9;opacity:.9;-ms-filter:alpha(opacity=90);filter:alpha(opacity=90)}.note-editor .note-dialog .note-help-dialog .modal-content{background:0;border:1px solid #fff;border-radius:5px;-webkit-box-shadow:none;box-shadow:none}.note-editor .note-dialog .note-help-dialog a{font-size:12px;color:#fff}.note-editor .note-dialog .note-help-dialog .title{padding-bottom:5px;font-size:14px;font-weight:700;color:#fff;border-bottom:#fff 1px solid}.note-editor .note-dialog .note-help-dialog .modal-close{font-size:14px;color:#dd0;cursor:pointer}.note-editor .note-dialog .note-help-dialog .note-shortcut-layout{width:100%}.note-editor .note-dialog .note-help-dialog .note-shortcut-layout td{vertical-align:top}.note-editor .note-dialog .note-help-dialog .note-shortcut{margin-top:8px}.note-editor .note-dialog .note-help-dialog .note-shortcut th{font-size:13px;color:#dd0;text-align:left}.note-editor .note-dialog .note-help-dialog .note-shortcut th:first-child{min-width:110px;padding-right:10px;font-family:"Courier New";color:#dd0;text-align:right}.note-editor .note-editable{padding:10px;overflow:scroll;outline:0}.note-editor .note-codeable{display:none;width:100%;padding:10px;margin-bottom:0;font-family:Menlo,Monaco,monospace,sans-serif;font-size:14px;color:#ccc;background-color:#222;border:0;border-radius:0;-webkit-box-shadow:none;box-shadow:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;resize:none}.note-editor .dropdown-menu{min-width:90px}.note-editor .dropdown-menu.right{right:0;left:auto}.note-editor .dropdown-menu.right::before{right:9px;left:auto!important}.note-editor .dropdown-menu.right::after{right:10px;left:auto!important}.note-editor .dropdown-menu .dropdown-menu li a i{color:#00bfff;visibility:hidden}.note-editor .dropdown-menu .dropdown-menu li a.checked i{visibility:visible}.note-editor .note-color-palette{line-height:1}.note-editor .note-color-palette div .note-color-btn{width:17px;height:17px;padding:0;margin:0;border:1px solid #fff}.note-editor .note-color-palette div .note-color-btn:hover{border:1px solid #000}.no-padding .note-editor{border:0}.note-editor .note-editable{background-color:rgba(48,126,204,0.05)}.note-editor .note-editable:focus{background-color:#fff}.note-editor .note-statusbar .note-resizebar{border-top:1px solid #dbdbdb}.note-editor .note-statusbar:hover{background:#EEE}.note-editor .note-statusbar:active{background:#eaeaea}.md-editor{display:block;border:1px solid #ddd}.md-editor.active{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(102,175,233,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(102,175,233,0.6)}.md-editor .md-footer,.md-editor>.md-header{display:block;padding:6px 4px;background:#f5f5f5}.md-editor>.md-preview{background:#fff;border-top:1px dashed #ddd;border-bottom:1px dashed #ddd;min-height:10px;padding:10px}.md-editor>textarea{font-family:Monaco,Menlo,Consolas,"Courier New",monospace;font-size:13px;outline:0;outline:thin dotted \9;margin:0;display:block;width:100%;border:0;padding:10px;border-top:1px dashed #ddd;border-bottom:1px dashed #ddd;border-radius:0;-webkit-box-shadow:none;box-shadow:none;background:#eee}.md-editor>textarea:focus{-webkit-box-shadow:none;box-shadow:none;background:#fff}.twitter-typeahead .tt-hint,.twitter-typeahead .tt-query{margin-bottom:0}.tt-dropdown-menu{min-width:160px;margin-top:2px;padding:5px 0;background-color:#fff;border:1px solid #bfbfbf;border:1px solid rgba(0,0,0,0.2);*border-right-width:2px;*border-bottom-width:2px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;background-clip:padding-box}.tt-suggestion{display:block;padding:3px 20px}.tt-suggestion.tt-is-under-cursor{color:#fff;background-color:#0081c2}.tt-suggestion.tt-is-under-cursor a{color:#fff}.tt-suggestion p{margin:0}.dropzone,.dropzone *,.dropzone-previews,.dropzone-previews *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.dropzone .dz-preview,.dropzone-previews .dz-preview{background:rgba(255,255,255,0.8);position:relative;display:inline-block;margin:10px;vertical-align:top;border:1px solid #acacac;padding:6px;-webkit-box-shadow:1px 1px 4px rgba(0,0,0,0.16);box-shadow:1px 1px 4px rgba(0,0,0,0.16);font-size:14px}.dropzone .dz-preview.dz-file-preview,.dropzone-previews .dz-preview.dz-file-preview{display:none}.dropzone .dz-preview .dz-details,.dropzone-previews .dz-preview .dz-details{width:100px;height:100px;position:relative;background:#ebebeb;padding:5px;margin-bottom:22px}.dropzone .dz-preview .dz-details .dz-filename,.dropzone-previews .dz-preview .dz-details .dz-filename{overflow:hidden;height:100%}.dropzone .dz-preview .dz-details img,.dropzone-previews .dz-preview .dz-details img{position:absolute;top:0;left:0;width:100px;height:100px}.dropzone .dz-preview .dz-details .dz-size,.dropzone-previews .dz-preview .dz-details .dz-size{position:absolute;bottom:-28px;left:3px;height:28px;line-height:28px}.dropzone .dz-preview.dz-error .dz-error-mark,.dropzone-previews .dz-preview.dz-error .dz-error-mark,.dropzone .dz-preview.dz-success .dz-success-mark,.dropzone-previews .dz-preview.dz-success .dz-success-mark{display:block;opacity:1;-ms-filter:none;-webkit-filter:none;filter:none}.dropzone .dz-preview:hover .dz-details img,.dropzone-previews .dz-preview:hover .dz-details img{display:none}.dropzone .dz-preview .dz-error-mark,.dropzone-previews .dz-preview .dz-error-mark,.dropzone .dz-preview .dz-success-mark,.dropzone-previews .dz-preview .dz-success-mark{display:block;position:absolute;width:40px;height:40px;font-size:30px;text-align:center;right:-10px;top:-10px;opacity:0;-ms-filter:"alpha(Opacity=0)";filter:alpha(opacity=0);-webkit-transition:opacity .4s ease-in-out;transition:opacity .4s ease-in-out;background-image:url(../img/dropzone/spritemap.png);background-repeat:no-repeat}.dropzone .dz-preview .dz-error-mark span,.dropzone-previews .dz-preview .dz-error-mark span,.dropzone .dz-preview .dz-success-mark span,.dropzone-previews .dz-preview .dz-success-mark span{display:none}.dropzone .dz-preview .dz-success-mark,.dropzone-previews .dz-preview .dz-success-mark{color:#8cc657;background-position:-268px -163px}.dropzone .dz-preview .dz-error-mark,.dropzone-previews .dz-preview .dz-error-mark{color:#ee162d;background-position:-268px -123px}.dropzone .dz-preview.dz-error .dz-progress .dz-upload,.dropzone-previews .dz-preview.dz-error .dz-progress .dz-upload{background:#ee1e2d}.dropzone .dz-preview .dz-progress,.dropzone-previews .dz-preview .dz-progress{position:absolute;top:100px;left:6px;right:6px;height:6px;background:#d7d7d7;display:none}.dropzone .dz-preview .dz-progress .dz-upload,.dropzone-previews .dz-preview .dz-progress .dz-upload{position:absolute;bottom:0;background-color:#8cc657;-webkit-animation:loading .4s linear infinite;-ms-animation:loading .4s linear infinite;animation:loading .4s linear infinite;-webkit-transition:width .3s ease-in-out;transition:width .3s ease-in-out;border-radius:2px;top:0;left:0;width:0;height:100%;background-image:url(../img/dropzone/spritemap.png);background-repeat:repeat-x;background-position:0 -400px}.dropzone .dz-preview.dz-processing .dz-progress,.dropzone-previews .dz-preview.dz-processing .dz-progress{display:block}.dropzone .dz-preview .dz-error-message,.dropzone-previews .dz-preview .dz-error-message{position:absolute;top:-5px;left:-20px;background:rgba(245,245,245,0.8);padding:8px 10px;color:#800;min-width:140px;max-width:500px;z-index:500;display:block;opacity:0;-ms-filter:"alpha(Opacity=0)";filter:alpha(opacity=0);-webkit-transition:opacity .3s ease-in-out;transition:opacity .3s ease-in-out}.dropzone .dz-preview:hover.dz-error .dz-error-message,.dropzone-previews .dz-preview:hover.dz-error .dz-error-message{display:block;opacity:1;-ms-filter:none;-webkit-filter:none;filter:none}.dropzone .dz-preview.dz-image-preview:hover .dz-details img,.dropzone-previews .dz-preview.dz-image-preview:hover .dz-details img{display:block;opacity:.1;-ms-filter:"alpha(Opacity=10)";filter:alpha(opacity=10)}.dropzone .dz-preview.dz-success .dz-progress,.dropzone-previews .dz-preview.dz-success .dz-progress{display:block;opacity:0;-ms-filter:"alpha(Opacity=0)";filter:alpha(opacity=0);-webkit-transition:opacity .4s ease-in-out;transition:opacity .4s ease-in-out}.dropzone a.dz-remove,.dropzone-previews a.dz-remove{background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#fafafa),color-stop(1,#eee));background-image:-webkit-gradient(linear,top left,bottom left,from(#fafafa),to(#eee));background-image:-webkit-linear-gradient(top,#fafafa 0,#eee 100%);background-image:linear-gradient(top,#fafafa 0,#eee 100%);border-radius:2px;border:1px solid #eee;text-decoration:none;display:block;padding:4px 5px;text-align:center;color:#aaa;margin-top:26px}.dropzone a.dz-remove:hover,.dropzone-previews a.dz-remove:hover{color:#666}.dropzone{position:relative;padding:1em;border:1px solid rgba(0,0,0,0.03);min-height:360px;border-radius:3px;background:rgba(0,0,0,0.03);background-image:-webkit-gradient(linear,left top,right bottom,color-stop(0.25,rgba(0,0,0,0.03)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(0,0,0,0.03)),color-stop(0.75,rgba(0,0,0,0.03)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(135deg,rgba(0,0,0,0.03) 25%,transparent 25%,transparent 50%,rgba(0,0,0,0.03) 50%,rgba(0,0,0,0.03) 75%,transparent 75%,transparent);background-image:-webkit-linear-gradient(315deg,rgba(0,0,0,0.03) 25%,transparent 25%,transparent 50%,rgba(0,0,0,0.03) 50%,rgba(0,0,0,0.03) 75%,transparent 75%,transparent);background-image:linear-gradient(135deg,rgba(0,0,0,0.03) 25%,transparent 25%,transparent 50%,rgba(0,0,0,0.03) 50%,rgba(0,0,0,0.03) 75%,transparent 75%,transparent);background-color:#fafcfd;-webkit-background-size:16px 16px;background-size:16px 16px}.dropzone .dz-drag-hover{background:rgba(0,0,0,0.04)}.dropzone.dz-clickable,.dropzone.dz-clickable .dz-message,.dropzone.dz-clickable .dz-message span{cursor:pointer}.dropzone.dz-clickable *{cursor:default}.dropzone .dz-message{opacity:1;-ms-filter:none;-webkit-filter:none;filter:none}.dropzone .dz-drag-hover{background-image:-webkit-gradient(linear,left top,right bottom,color-stop(0.25,rgba(0,0,0,0.03)),color-stop(0.25,rgba(0,0,0,0)),color-stop(0.5,rgba(0,0,0,0)),color-stop(0.5,rgba(0,0,0,0.03)),color-stop(0.75,rgba(0,0,0,0.03)),color-stop(0.75,rgba(0,0,0,0)),to(rgba(0,0,0,0)));background-image:-webkit-linear-gradient(135deg,rgba(0,0,0,0.03) 25%,rgba(0,0,0,0) 25%,rgba(0,0,0,0) 50%,rgba(0,0,0,0.03) 50%,rgba(0,0,0,0.03) 75%,rgba(0,0,0,0) 75%,rgba(0,0,0,0));background-image:-webkit-linear-gradient(315deg,rgba(0,0,0,0.03) 25%,rgba(0,0,0,0) 25%,rgba(0,0,0,0) 50%,rgba(0,0,0,0.03) 50%,rgba(0,0,0,0.03) 75%,rgba(0,0,0,0) 75%,rgba(0,0,0,0));background-image:linear-gradient(135deg,rgba(0,0,0,0.03) 25%,rgba(0,0,0,0) 25%,rgba(0,0,0,0) 50%,rgba(0,0,0,0.03) 50%,rgba(0,0,0,0.03) 75%,rgba(0,0,0,0) 75%,rgba(0,0,0,0));background-color:#fafafa;-webkit-background-size:22px 22px;background-size:22px 22px;border:5px dashed #ccc}.dropzone .dz-default.dz-message{opacity:1;-ms-filter:none;-webkit-filter:none;filter:none;-webkit-transition:opacity .3s ease-in-out;transition:opacity .3s ease-in-out;background-image:url(../img/dropzone/spritemap.png);background-repeat:no-repeat;background-position:0 0;position:absolute;width:428px;height:123px;margin-left:-214px;margin-top:-61.5px;top:50%;left:50%}.dropzone .dz-default.dz-message span{display:none}.dropzone.dz-square .dz-default.dz-message{background-position:0 -123px;width:268px;margin-left:-134px;height:174px;margin-top:-87px}.dropzone.dz-drag-hover .dz-message{opacity:.15;-ms-filter:"alpha(Opacity=15)";filter:alpha(opacity=15)}.dropzone.dz-started .dz-message{display:block;opacity:0;-ms-filter:"alpha(Opacity=0)";filter:alpha(opacity=0)}.irs{position:relative;display:block;height:40px}.irs-line{position:relative;display:block;overflow:hidden;height:8px;top:25px;background:#eee}.irs-line-left,.irs-line-mid,.irs-line-right{position:absolute;display:block;top:0;height:8px}.irs-line-left{left:0;width:10%}.irs-line-mid{left:10%;width:80%}.irs-line-right{right:0;width:10%}.irs-diapason{position:absolute;display:block;left:0;width:100%}.irs-slider{position:absolute;display:block;cursor:default;z-index:1;width:10px;height:22px;top:17px;border:1px solid #fff;background:#858585}.irs-slider:hover{background:#6c6c6c}.irs-slider.single{left:10px}.irs-slider.single:before{position:absolute;display:block;content:"";top:-50%;left:-150%;width:400%;height:200%;background:rgba(0,0,0,0)}.irs-slider.from{left:100px}.irs-slider.from:before{position:absolute;display:block;content:"";top:-50%;left:-300%;width:400%;height:200%;background:rgba(0,0,0,0)}.irs-slider.to{left:300px}.irs-slider.to:before{position:absolute;display:block;content:"";top:-50%;left:0;width:400%;height:200%;background:rgba(0,0,0,0)}.irs-slider.last{z-index:2}.irs-max,.irs-min{color:#999;font-size:12px;line-height:1.333;text-shadow:none;top:0;padding:1px 3px;background:rgba(0,0,0,0.1);border-radius:0}.lt-ie9 .irs-max,.lt-ie9 .irs-min{background:#bfbfbf}.irs-min{position:absolute;display:block;left:0;cursor:default}.irs-max{position:absolute;display:block;right:0;cursor:default}.irs-from,.irs-single,.irs-to{position:absolute;display:block;top:0;left:0;cursor:default;white-space:nowrap}.lt-ie9 .irs-from,.lt-ie9 .irs-single,.lt-ie9 .irs-to{background:#999}.irs-grid{position:absolute;display:none;bottom:0;left:0;width:100%;height:20px}.irs-with-grid{height:60px}.irs-with-grid .irs-grid{display:block}.irs-grid-pol{position:absolute;top:0;left:0;width:1px;height:8px;background:#99a4ac}.irs-grid-pol.small{height:4px}.irs-grid-text{position:absolute;bottom:0;left:0;width:100px;white-space:nowrap;text-align:center;font-size:9px;line-height:9px;color:#99a4ac}.irs-diapason{background:#3276b1;height:8px;top:25px}.irs .irs-from,.irs .irs-single,.irs .irs-to{color:#fff;font-size:10px;line-height:1.333;text-shadow:none;padding:1px 5px;background:rgba(0,0,0,0.4);border-radius:0}#irs-active-slider{background:#686868;-webkit-box-shadow:rgba(0,0,0,0.3) 1px 1px 1px 0;box-shadow:rgba(0,0,0,0.3) 1px 1px 1px 0;width:12px;height:24px;top:16px}.google_maps{width:100%;height:350px;position:relative}.google_maps *{box-sizing:content-box;-webkit-box-sizing:content-box;-moz-box-sizing:content-box}.google_maps img{max-width:none}.slider{margin-top:0;margin-bottom:30px}.slider.slider-vertical{margin-bottom:0;margin-right:5px}.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix{display:block;min-height:0}.ui-helper-clearfix:after,.ui-helper-clearfix:before{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden}* html .ui-helper-clearfix{height:1%}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:alpha(opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;width:16px;height:16px;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget{font-family:Ubuntu,Helvetica,Arial,sans-serif;font-size:13px}.ui-widget :active{outline:0}.ui-widget .ui-widget{font-size:13px}.ui-widget button,.ui-widget input,.ui-widget select,.ui-widget textarea{font-family:Ubuntu,Helvetica,Arial,sans-serif;font-size:inherit}.ui-widget-content{border:1px solid #aaa;background:#fff;color:#404040}.ui-widget-content .ui-icon{background:none!important}.ui-widget-header{font-weight:700;background-color:#f5f5f5;border-color:#DDD;color:#333}.ui-widget-header a{color:#222}.ui-widget-overlay{position:fixed;background:#AAA;width:100%;height:200%;top:0;left:0;z-index:999;opacity:.3;filter:alpha(opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa;opacity:.3;filter:alpha(opacity=30);border-radius:8px}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{color:#333;background-color:#fff;font-weight:400;border:1px solid #ccc}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{text-shadow:none}.ui-state-default,.ui-state-error,.ui-state-highlight{position:relative;border-width:1px;border-style:solid}.ui-state-default p,.ui-state-error p,.ui-state-highlight p{font-size:13px;font-weight:400;line-height:18px;margin:7px 15px}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#2d6987}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{color:#b94a48;background-color:#f2dede;border-color:#eed3d7}.ui-state-error a,.ui-state-error-text,.ui-widget-content .ui-state-error a,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error a,.ui-widget-header .ui-state-error-text{color:#953b39}.ui-state-focus,.ui-state-hover,.ui-widget-content .ui-state-focus,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-focus,.ui-widget-header .ui-state-hover{color:#333;background-color:#ebebeb;border-color:#adadad;text-decoration:none}.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited{color:#333;text-decoration:none}.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #adadad;font-weight:400;color:#333}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#333;text-decoration:none}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:alpha(opacity=35);background-image:none}.ui-state-disabled .ui-icon,.ui-widget-content .ui-state-disabled .ui-icon,.ui-widget-header .ui-state-disabled .ui-icon{filter:alpha(opacity=35)}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:700}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:alpha(opacity=70);font-weight:400}.ui-corner-all{border-radius:0}.ui-corner-left,.ui-corner-tl,.ui-corner-top{border-top-left-radius:4px}.ui-corner-right,.ui-corner-top,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-bl,.ui-corner-bottom,.ui-corner-left{border-bottom-left-radius:4px}.ui-corner-bottom,.ui-corner-br,.ui-corner-right{border-bottom-right-radius:4px}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}input[type=color].ui-autocomplete-loading,input[type=date].ui-autocomplete-loading,input[type=datetime-local].ui-autocomplete-loading,input[type=datetime].ui-autocomplete-loading,input[type=email].ui-autocomplete-loading,input[type=month].ui-autocomplete-loading,input[type=number].ui-autocomplete-loading,input[type=password].ui-autocomplete-loading,input[type=search].ui-autocomplete-loading,input[type=tel].ui-autocomplete-loading,input[type=text].ui-autocomplete-loading,input[type=time].ui-autocomplete-loading,input[type=url].ui-autocomplete-loading,input[type=week].ui-autocomplete-loading{background-image:url(../img/select2-spinner.gif)!important;background-repeat:no-repeat;background-position:99% 50%;padding-right:27px}.ui-btn-lg{padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}.ui-btn-sm,.ui-btn-xs{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.ui-btn-xs{padding:1px 5px}.ui-btn-block{display:block;width:100%;padding-right:0;padding-left:0}.ui-btn-block+.ui-btn-block{margin-top:5px}input[type=button].ui-btn-block,input[type=reset].ui-btn-block,input[type=submit].ui-btn-block{width:100%}.ui-button{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.428571429;text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;border:1px solid #ccc;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.ui-button:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.ui-button:focus,.ui-button:hover{color:#333;background-color:#ebebeb;border-color:#adadad;text-decoration:none}fieldset[disabled] .ui-button,fieldset[disabled] .ui-button.ui-state-active,fieldset[disabled] .ui-button:active,fieldset[disabled] .ui-button:focus,fieldset[disabled] .ui-button:hover,.ui-button.disabled,.ui-button.disabled.active,.ui-button.disabled:active,.ui-button.disabled:focus,.ui-button.disabled:hover,.ui-button[disabled],.ui-button[disabled].active,.ui-button[disabled]:active,.ui-button[disabled]:focus,.ui-button[disabled]:hover{background-color:#fff;border-color:#ccc}.ui-button-text-icon-primary .ui-button-icon-primary{float:left}.ui-button-text-icon-primary{padding:2px 7px 3px}.ui-button-primary{color:#fff;background-color:#428bca;border-color:#357ebd}.ui-button-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.ui-button-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.ui-button-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.ui-button-inverse{color:#fff;background-color:#222;border-color:#080808}.ui-button-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.ui-button-error{color:#fff;background-color:#c43c35;border-color:#882a25}.ui-button-danger:hover,.ui-button-info:hover,.ui-button-inverse:hover,.ui-button-primary:hover,.ui-button-success:hover,.ui-button-warning:hover{text-decoration:none}.ui-button-primary:focus,.ui-button-primary:hover{color:#fff;background-color:#3276b1;border-color:#285e8e}.ui-button-success:hover{color:#fff;background-color:#47a447;border-color:#398439}.ui-button-info:hover{color:#fff;background-color:#39b3d7;border-color:#269abc}.ui-button-danger:hover{color:#fff;background-color:#d2322d;border-color:#ac2925}.ui-button-warning:hover{color:#fff;background-color:#ed9c28;border-color:#d58512}.ui-button-inverse:hover{color:#fff;background-color:#363636;border-color:#000}.ui-button-icon-only{width:2.2em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button-text-icon-primary .ui-button-icon-primary.ui-icon{margin-top:5px}.ui-button .ui-button-text{display:block;line-height:normal}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999px;display:none}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-icons-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon{margin-bottom:0;margin-top:0;top:50%}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px;margin-right:-6px}.ui-button-icons-only .ui-button-icon-primary,.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary{left:.5em}.ui-button-icons-only .ui-button-icon-secondary,.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-state-active{color:#fff;background-color:#428bca;border-color:#357ebd}.ui-buttonset .ui-state-active.ui-state-hover{color:#fff;background-color:#3276b1;border-color:#285e8e}.ui-buttonset .ui-button{margin-left:0;margin-right:-0.4em}button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-slider{position:relative;text-align:left}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{-webkit-filter:inherit;filter:inherit}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:16px;height:18px;cursor:default}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0;color:#fff;background-color:#0e90d2;background-image:-webkit-gradient(linear,0 0,0 100%,from(#149bdf),to(#0480be));background-image:-webkit-gradient(linear,top left,bottom left,from(#149bdf),to(#0480be));background-image:-webkit-linear-gradient(top,#149bdf,#0480be);background-image:linear-gradient(to bottom,#149bdf,#0480be);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf',endColorstr='#ff0480be',GradientType=0);-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width .6s ease;transition:width .6s ease}.ui-slider-horizontal{height:10px;background:#d5d5d5;border:0}.ui-slider-horizontal .ui-slider-handle{top:-0.2em;margin-left:-0.5em;background-color:#fff;border-color:#CCC}.ui-slider-horizontal .ui-slider-handle:focus{background-color:#fff;border-color:#357ebd}.ui-slider-horizontal .ui-slider-handle:hover{background-color:#fff;border-color:#285e8e;outline:0}.ui-slider-horizontal .ui-slider-handle:active{background-color:#428bca;border-color:#3276b1}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-0.3em;margin-left:0;margin-bottom:-0.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-tabs{position:relative;border:0;border-radius:0}.ui-tabs .ui-tabs-panel{display:block;border-radius:0;background:0}.ui-tabs .ui-tabs-nav{margin-bottom:0;border:solid #ddd;border-width:0 0 1px;border-radius:0;background:0}.ui-tabs .ui-tabs-nav li{position:relative;top:0;float:left;margin-bottom:-1px;margin-right:3px;border:0;list-style:none;white-space:nowrap;background:0;-webkit-filter:none;filter:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active:hover{background:#fff;cursor:text}.ui-tabs .ui-tabs-nav li.ui-tabs-active a{border:1px solid #ddd;border-bottom:1px solid #fff;background-color:#fff;color:#555;font-weight:700;border-top-width:0!important;margin-top:1px!important;-webkit-box-shadow:0 -2px 0 #57889c;box-shadow:0 -2px 0 #57889c}.ui-tabs .ui-tabs-nav li a{float:left;padding:8px 12px;font-weight:400;text-decoration:none;outline:0;background:0;border-radius:0;background-color:#f5f5f5;border:1px solid #f5f5f5;border-bottom:1px solid #ddd;color:#838383}.ui-tabs .ui-tabs-nav li a:hover{border:1px solid #f5f5f5;border-bottom:1px solid #ddd;background-color:#f5f5f5}.ui-tabs .ui-tabs-nav li.ui-state-disabled a,.ui-tabs .ui-tabs-nav li.ui-tabs-active a,.ui-tabs .ui-tabs-nav li.ui-tabs-loading a{cursor:text}.ui-tabs .ui-tabs-nav .ui-state-default{border:0;-webkit-box-shadow:none;box-shadow:none}.ui-tabs .ui-tabs-panel{border:1px solid #ddd;margin:0;padding:10px 13px;border-top:0}.ui-tabs .ui-tabs-hide{display:none!important}.ui-tooltip{display:block;font-size:11px;opacity:.8;position:absolute;visibility:visible;z-index:1024;max-width:200px;background:#000;border:1px solid #000;color:#FFF;padding:3px 8px;text-align:center;text-decoration:none;-webkit-box-shadow:inset 0 1px 0 #000;box-shadow:inset 0 1px 0 #000;border-radius:4px}body .ui-tooltip{border-width:1px}.ui-spinner{position:relative;display:inline-block;overflow:hidden;width:100%;padding:0;vertical-align:middle}.ui-spinner-input{margin:0!important;height:30px;padding:6px 24px 6px 12px;border:0;background:0;vertical-align:middle}.ui-spinner-input.spinner-left{padding:6px 12px 6px 24px}.ui-spinner-input.spinner-left+.ui-spinner-button,.ui-spinner-input.spinner-left+.ui-spinner-button+.ui-spinner-button{right:auto;left:0}.ui-spinner-input.spinner-both{padding:6px 30px}.ui-spinner-input.spinner-both+.ui-spinner-button+.ui-spinner-button{left:0;right:auto}.ui-spinner-input.spinner-both+.ui-spinner-button,.ui-spinner-input.spinner-both+.ui-spinner-button+.ui-spinner-button{height:30px;width:25px}.ui-spinner-input.spinner-both+.ui-spinner-up+.ui-spinner-down:before,.ui-spinner-input.spinner-both+.ui-spinner-up:before{margin-top:8px}.ui-spinner-button{width:19px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:0;border-bottom:0;border-right:0}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-down,.ui-spinner-up{background:#739e73;border-radius:0}.ui-spinner-down:before,.ui-spinner-up:before{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\f067";color:#fff;font-size:14px;margin-top:1px}.ui-spinner-down>:first-child,.ui-spinner-up>:first-child{display:none}.ui-spinner-up{top:0}.ui-spinner-up:active,.ui-spinner-up:focus,.ui-spinner-up:hover{background:#5b835b}.ui-spinner-down{bottom:0;background:#c2032f}.ui-spinner-down:before{content:"\f068"}.ui-spinner-down:active,.ui-spinner-down:focus,.ui-spinner-down:hover{background:#77021d}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px}.ui-datepicker{width:20em;padding:.2em .2em 0;display:none;z-index:9999!important}.ui-datepicker-inline{z-index:9000!important}.ui-datepicker-header{position:relative;border:0;font-weight:700;width:100%;padding:4px 0;background-color:#f5f5f5;color:gray}.ui-datepicker-next,.ui-datepicker-prev{position:absolute;top:2px;width:5.6em;height:1.8em;text-align:center;margin-top:2px;cursor:pointer}.ui-datepicker-next>:first-child,.ui-datepicker-prev>:first-child{text-indent:0!important}.ui-datepicker-next span,.ui-datepicker-prev span{display:block;position:absolute;text-align:center;top:50%;margin-top:-8px;width:5.8em}.ui-datepicker-prev{left:2px}.ui-datepicker-next{right:2px}.ui-datepicker-title{margin:0 5.8em;line-height:1.8em;text-align:center}.ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month-year{width:100%}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;border:0;font-weight:700;color:gray}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td:hover{color:#fff}.ui-datepicker td a{margin-bottom:0;border:0}.ui-datepicker td a,.ui-datepicker td span{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker td .ui-state-default{border:0;background:0;margin-bottom:0;padding:5px;color:gray;text-align:center;-webkit-filter:none;filter:none}.ui-datepicker td .ui-state-highlight{color:#fff;background-color:#a90329;text-shadow:0 -1px 0 rgba(0,0,0,0.25);border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-radius:0}.ui-datepicker td .ui-state-active{color:#333;background-color:#ebebeb;margin-bottom:0;font-size:normal;text-shadow:0;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-radius:0}.ui-datepicker td .ui-state-hover{color:#fff;background:#428bca;background-color:#428bca;text-shadow:0 -1px 0 rgba(0,0,0,0.25);border-color:#357ebd;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-radius:0}.ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em;width:auto;overflow:visible}.ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-detepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicket-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-datepicker-cover{display:none;display:block;position:absolute;z-index:-1;-webkit-filter:mask();filter:mask();top:-4px;left:-4px;width:200px;height:200px}.ui-datepicker-today a{background-color:#bfbfbf;cursor:pointer;padding:0 4px;margin-bottom:0}.ui-datepicker-today a:hover{background-color:gray;color:#fff}.ui-progressbar{height:2em;margin-bottom:20px;border:0;overflow:hidden;background-color:#f7f7f7;background-image:-webkit-gradient(linear,0 0,0 100%,from(#f5f5f5),to(#f9f9f9));background-image:-webkit-gradient(linear,top left,bottom left,from(#f5f5f5),to(#f9f9f9));background-image:-webkit-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:linear-gradient(to bottom,#f5f5f5,#f9f9f9);background-repeat:repeat-x;border-radius:0;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5',endColorstr='#fff9f9f9',GradientType=0);-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.ui-progressbar .ui-progressbar-value{margin:0;height:100%;color:#fff;background-color:#428bca;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width .6s ease;transition:width .6s ease}.ui-progressbar .ui-progressbar-overlay{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px;-webkit-animation:progress-bar-stripes 2s linear infinite;-ms-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;z-index:99999;display:block}.ui-resizable-autohide .ui-resizable-handle,.ui-resizable-disabled .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted #000}.ui-accordion{width:100%}.ui-accordion .ui-accordion-li-fix{display:inline}.ui-accordion .ui-accordion-header{display:block;position:relative;margin-top:-2px;border-color:#ddd!important;padding:10px 15px 10px 36px!important;cursor:pointer;min-height:0;background-color:#fbfbfb;border-radius:0;font-size:15px}.ui-accordion .ui-accordion-header-active{border-bottom:0!important}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-noicons{padding-left:.7em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px;text-indent:0!important;background-image:none!important;text-align:center;line-height:normal;left:12px!important;margin-top:-6px!important;font-size:14px!important}.ui-accordion .ui-accordion-content{margin-top:-3px;border-radius:0;border-top:0 none;border-color:#ddd!important;padding:15px;position:relative;top:1px;margin-bottom:2px;overflow:auto;display:none}.ui-accordion .ui-accordion-content-active{display:block}.ui-accordion-header-active+.ui-accordion-content{border-top:1px solid #ddd}.noUi-target *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-touch-callout:none;-ms-touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;cursor:default}.noUi-target *[disabled] .noUi-base{background:#999}.noUi-target *[disabled] .noUi-connect{background:#BBB}.noUi-base{width:100%;height:14px;position:relative;max-width:100%;max-height:100%;border:1px solid #bfbfbf;z-index:1}.noUi-origin-lower{background:#72a8d7}.noUi-handle{background:#858585;height:30px;width:16px;border:1px solid #fff;margin:-8px 0 0 -8px;cursor:default}.noUi-handle:hover{background:#6c6c6c}.noUi-active{cursor:default;-webkit-box-shadow:rgba(0,0,0,0.1) 1px 1px 1px 0;box-shadow:rgba(0,0,0,0.1) 1px 1px 1px 0;background:#686868;height:32px;width:18px;margin:-9px 0 0 -8px;border:0}.noUi-active:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;content:"";display:block;height:100%;border:1px solid #ddd}.noUi-connect{background:#3276b1}.noUi-background{background:#eee;border:0}.noUi-origin{position:absolute;right:0;top:0;bottom:0;z-index:0}.noUi-origin-upper{background:inherit!important}.noUi-z-index{z-index:10}.noUi-vertical{width:10px;height:100%}.noUi-vertical .noUi-origin{bottom:0;left:0}.noUi-vertical .noUi-handle{margin:-8px 0 0 -3px}.noUi-state-tap .noUi-origin{-webkit-transition:left .3s,top .3s;transition:left .3s,top .3s}.modal-backdrop,.modal-backdrop.fade.in{position:fixed;width:100%;height:100%}.modal-dialog.modal-max{width:98%;max-width:98%}@media only screen and (min-width:768px){.modal-dialog.modal-large{width:80%;max-width:900px}}@media only screen and (min-width:768px){.modal-dialog.modal-medium{width:60%;max-width:650px}}@media only screen and (min-width:768px){.modal-dialog.modal-small{width:40%;max-width:450px}}.modal-dialog .suffix .alert{margin-bottom:0;border-radius:0 0 5px 5px}.modal-title img{margin:0 15px 0 0}.modal-overflow .modal-body{overflow:hidden}.ui-dialog{position:absolute;top:0;left:0;padding:0;width:300px;overflow:hidden;-webkit-background-clip:padding-box;background-clip:padding-box;background-color:#fff;border-radius:3px;-webkit-box-shadow:0 5px 15px rgba(0,0,0,0.5);box-shadow:0 5px 15px rgba(0,0,0,0.5);border:1px solid rgba(0,0,0,0.2);outline:medium none;z-index:1050}.ui-dialog .ui-dialog-titlebar{position:relative;padding:0 10px;background:#fff;border-color:#fff;font-size:18px;text-decoration:none;border:0 0 0 1px solid;border-bottom-right-radius:0;border-bottom-left-radius:0;border-bottom:1px solid #ccc;border-bottom-color:#eee}.ui-dialog .ui-dialog-title{float:left;margin:0;color:#404040;font-weight:700;padding:5px;text-overflow:ellipsis;overflow:hidden}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:19px;margin:-16px 4px 0 0;padding:1px;height:18px;font-size:20px;font-weight:700;line-height:13.5px;text-shadow:0 1px 0 #fff;filter:alpha(opacity=25);-khtml-opacity:.25;-moz-opacity:.25;opacity:.25;background:0;border:0;-webkit-box-shadow:none;box-shadow:none}.ui-dialog .ui-dialog-titlebar-close:before{content:"\f00d";font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:13px}.ui-dialog .ui-dialog-titlebar-close:focus,.ui-dialog .ui-dialog-titlebar-close:hover{padding:1px;filter:alpha(opacity=90);-moz-opacity:.9;opacity:.9}.ui-dialog .ui-dialog-titlebar-close span{display:block;margin:1px;text-indent:9999px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:0;overflow:auto}.ui-dialog .ui-dialog-buttonpane{margin:13px 0 0;padding:19px 15px 20px;border-top:1px solid #eee;border-width:1px 0 0;border-radius:0 0 6px 6px;background-image:none;background-color:#fff;-webkit-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff;text-align:right}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:0 .4em 0 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:14px;height:14px;right:3px;bottom:3px}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-dialog-buttonpane .ui-dialog-buttonset .ui-button{color:#fff;background-color:#428bca;border-color:#357ebd}.ui-dialog-buttonpane .ui-dialog-buttonset .ui-button.ui-state-hover{color:#fff;background-color:#3276b1;border-color:#285e8e}.ui-dialog-buttonset .ui-button:not(:first-child){cursor:pointer;display:inline-block;color:#333;background-color:#fff;border:1px solid #ccc;-webkit-transition:.1s linear all;transition:.1s linear all;overflow:visible}.ui-dialog-buttonset .ui-button:not(:first-child) .ui-state-hover{color:#333;background-color:#ebebeb;border-color:#adadad;text-decoration:none}.ui-dialog-buttonset .ui-button.ui-button-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.ui-dialog-buttonset .ui-button.ui-button-info.ui-state-hover{color:#fff;background-color:#39b3d7;border-color:#269abc}.ui-dialog-buttonset .ui-button.ui-button-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.ui-dialog-buttonset .ui-button.ui-button-success.ui-state-hover{color:#fff;background-color:#47a447;border-color:#398439}.ui-dialog-buttonset .ui-button.ui-button-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.ui-dialog-buttonset .ui-button.ui-button-warning.ui-state-hover{color:#fff;background-color:#ed9c28;border-color:#d58512}.ui-dialog-buttonset .ui-button.ui-button-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.ui-dialog-buttonset .ui-button.ui-button-danger.ui-state-hover{color:#fff;background-color:#d2322d;border-color:#ac2925}.ui-dialog-buttonset .ui-button.ui-button-inverse{color:#fff;background-color:#222;border-color:#080808}.ui-dialog-buttonset .ui-button.ui-button-inverse.ui-state-hover{color:#fff;background-color:#363636;border-color:#000}.modal-overflow{position:relative}.modal-overflow .scrollmarker{position:absolute;width:100%;height:20px}.modal-overflow .scrollmarker.top{background:-moz-linear-gradient(top,#3276b1 0,rgba(50,118,177,0.83) 17%,rgba(50,118,177,0) 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#3276b1),color-stop(17%,rgba(50,118,177,0.83)),color-stop(100%,rgba(50,118,177,0)));background:-webkit-linear-gradient(top,#3276b1 0,rgba(50,118,177,0.83) 17%,rgba(50,118,177,0) 100%);background:-o-linear-gradient(top,#3276b1 0,rgba(50,118,177,0.83) 17%,rgba(50,118,177,0) 100%);background:-ms-linear-gradient(top,#3276b1 0,rgba(50,118,177,0.83) 17%,rgba(50,118,177,0) 100%);background:linear-gradient(to bottom,#3276b1 0,rgba(50,118,177,0.83) 17%,rgba(50,118,177,0) 100%)}.modal-overflow .scrollmarker.bottom{background:-moz-linear-gradient(bottom,#3276b1 0,rgba(50,118,177,0.83) 17%,rgba(50,118,177,0) 100%);background:-webkit-gradient(linear,left bottom,left top,color-stop(0%,#3276b1),color-stop(17%,rgba(50,118,177,0.83)),color-stop(100%,rgba(50,118,177,0)));background:-webkit-linear-gradient(bottom,#3276b1 0,rgba(50,118,177,0.83) 17%,rgba(50,118,177,0) 100%);background:-o-linear-gradient(bottom,#3276b1 0,rgba(50,118,177,0.83) 17%,rgba(50,118,177,0) 100%);background:-ms-linear-gradient(bottom,#3276b1 0,rgba(50,118,177,0.83) 17%,rgba(50,118,177,0) 100%);background:linear-gradient(to top,#3276b1 0,rgba(50,118,177,0.83) 17%,rgba(50,118,177,0) 100%)}.pricing-big{border:0!important}.pricing-big .panel-heading{border-radius:5px 5px 0 0}.pricing-big .panel-title{text-transform:capitalize;font-size:18px;padding:20px 0;text-align:center;border-radius:5px 5px 0 0;margin:0;font-weight:700}.pricing-big .the-price{padding:20px 0;background:#333;text-align:center;font-size:24px;font-weight:700;color:#FFF;-webkit-box-shadow:none!important;box-shadow:none!important}.pricing-big .subscript{font-size:18px;color:#999;margin-left:5px}.pricing-big .panel-footer{border-radius:0 0 5px 5px;background-color:#f2f2f2!important}.pricing-big .panel-footer>div{padding:15px 0 10px;display:block;font-size:13px}.pricing-big .panel-footer .btn{padding:15px 0;border-radius:3px;font-weight:700;font-size:14px}.pricing-big .panel-footer .btn span{font-weight:400;font-style:italic}.pricing-big table{background:#fafafa;padding:20px 15px;height:230px;text-align:left}.price-features{background:#fafafa;padding:20px 15px;min-height:230px;font-size:13.5px}.price-features .price-features li+li{margin-top:10px}.superbox *,.superbox :after,.superbox :before{margin:0;padding:0;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-webkit-font-smoothing:antialiased;-moz-font-smoothing:antialiased;-o-font-smoothing:antialiased;font-smoothing:antialiased;text-rendering:optimizeLegibility}.superbox-list{display:inline-block;*display:inline;zoom:1;width:12.5%;padding:5px;position:relative}.superbox-list.active:before{content:"\f0d8";font-family:FontAwesome;display:block;position:absolute;left:43%;bottom:-34px;z-index:2;text-align:center;font-size:45px;color:#222}@media only screen and (min-width:320px){.superbox-list{width:50%}}@media only screen and (min-width:486px){.superbox-list{width:25%}}@media only screen and (min-width:768px){.superbox-list{width:16.66666667%}}@media only screen and (min-width:1025px){.superbox-list{width:12.5%}}@media only screen and (min-width:1824px){.superbox-list{width:12.5%}}.superbox-img{max-width:100%;width:100%;cursor:pointer}.superbox-show{text-align:left;position:relative;background-color:#222;width:100%;float:left;padding:25px 0 12px 25px;display:none;margin:5px 0}.superbox-current-img{max-width:100%;float:left;padding-right:25px;padding-bottom:13px}.superbox-img:hover{opacity:.8}.superbox-float{float:left}.superbox-close{opacity:.7;cursor:pointer;position:absolute;top:15px;right:15px;-webkit-transition:all .1s linear 0s;transition:all .1s linear 0s}.superbox-close:hover{opacity:1}.superbox-imageinfo{display:inline-block;max-width:500px;color:#fff;padding:0 25px 0 0}.superbox-imageinfo span{font-size:13px;color:#a19994;margin-right:-2px;padding-top:10px;display:inline-block;padding-bottom:13px}.superbox-imageinfo>:first-child{margin-bottom:10px;font-weight:700}.superbox-imageinfo span p:last-child{margin-top:30px}.bootstrap-tagsinput{display:block;width:100%;min-height:32px;padding:1px 3px;font-size:13px;line-height:1.428571429;color:#555;vertical-align:middle;background-color:#FFF;border:1px solid #CCC;border-radius:0}.bootstrap-tagsinput>span{border-radius:0!important;font-weight:400;padding:3px 28px 4px 8px;font-size:13px;border:1px solid #285e8e;background:#3276b1}.bootstrap-tagsinput input{border:0;-webkit-box-shadow:none;box-shadow:none;outline:0;background-color:transparent;padding:0;margin:0;width:auto!important;max-width:inherit}.bootstrap-tagsinput input:focus{border:0;-webkit-box-shadow:none;box-shadow:none}.bootstrap-tagsinput .tag{color:#FFF;position:relative;margin:3px 0 3px 2px;display:inline-block}.bootstrap-tagsinput .tag [data-role=remove]{display:block;top:-1px;right:0;padding:3px 4px 3px 5px;width:23px;height:22px;position:absolute;cursor:pointer}.bootstrap-tagsinput .tag [data-role=remove]:after{content:"\f057";font-family:fontAwesome;padding:2px 1px;line-height:17px;font-size:15px;text-align:center}.bootstrap-tagsinput .tag [data-role=remove]:hover{background:rgba(0,0,0,0.3);-webkit-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)}.bootstrap-tagsinput .tag [data-role=remove]:hover:active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.slider{display:inline-block;vertical-align:middle;position:relative}.slider.slider-horizontal{width:100%!important;height:20px}.slider.slider-horizontal .slider-track{height:10px;width:100%;margin-top:-5px;top:50%;left:0}.slider.slider-horizontal .slider-selection{height:100%;top:0;bottom:0}.slider.slider-horizontal .slider-selection+.slider-handle.triangle+.slider-handle.triangle:before{content:"\f0d9"}.slider.slider-horizontal .slider-handle{margin-left:-10px;margin-top:-5px}.slider.slider-horizontal .slider-handle.triangle{width:20px;height:20px;filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);border:0;line-height:21px;color:#797777;text-shadow:0 1px 0 rgba(255,255,255,0.8)}.slider.slider-horizontal .slider-handle.triangle:before{content:"\f0da";font-size:34px}.slider.slider-vertical{height:210px;width:20px}.slider.slider-vertical .slider-track{width:10px;height:100%;margin-left:-5px;left:50%;top:0}.slider.slider-vertical .slider-selection{width:100%;left:0;top:0;bottom:0}.slider.slider-vertical .slider-selection+.slider-handle.triangle+.slider-handle.triangle:before{content:"\f0d8";text-shadow:0 -1px 0 rgba(255,255,255,0.8)}.slider.slider-vertical .slider-handle{margin-left:-5px;margin-top:-10px}.slider.slider-vertical .slider-handle.triangle{width:20px;height:20px;filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);border:0;line-height:21px;color:#797777;text-shadow:0 -1px 0 rgba(255,255,255,0.8)}.slider.slider-vertical .slider-handle.triangle:before{content:"\f0d7";font-size:32px;text-shadow:0 1px 0 rgba(255,255,255,0.8)}.slider input{display:none}.slider .tooltip-inner{white-space:nowrap}.slider-track{position:absolute;cursor:pointer;background:#e5e5e5}.slider-danger+.slider-track>.slider-selection{background:#a90329}.slider-warning+.slider-track>.slider-selection{background:#c79121}.slider-info+.slider-track>.slider-selection{background:#57889c}.slider-success+.slider-track>.slider-selection{background:#739e73}.slider-selection{position:absolute;background:#3276b1}.slider-handle{position:absolute;width:20px;height:20px;border:1px solid #FFF;background:#858585;display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:400;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-align:center;line-height:18px;font-size:10px;color:#ccc;text-shadow:0 1px 0 rgba(77,77,77,0.5);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.slider-handle:before{content:"\f0c9"}.slider-handle.round{border-radius:20px;width:20px;height:20px}.slider-handle.triangle{background:transparent none}.fd-form-element-hidden{display:none}.fd-slider{width:100%;height:20px;margin:0}.fd-slider-vertical{width:20px;height:100%;margin:0 10px 10px 0}.fd-slider,.fd-slider-vertical{display:block;position:relative;text-decoration:none;border:0 none;-moz-user-select:none;-khtml-user-select:none;-webkit-touch-callout:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.fd-slider-inner{display:none}.fd-slider-bar{position:absolute;display:block;z-index:2;height:6px;width:100%;border:1px solid #bbb;border-bottom:1px solid #fff;border-right:1px solid #fff;margin:0;padding:0;overflow:hidden;line-height:4px;top:8px;border-radius:4px;-webkit-background-clip:padding-box;background-clip:padding-box;background-color:#333}.fd-slider-range{position:absolute;display:block;z-index:3;height:6px;margin:0;padding:0 2px 0 0;overflow:hidden;top:9px;border-radius:2px;-webkit-background-clip:padding-box;background-clip:padding-box;background-color:#eee}.fd-slider-handle{position:absolute;display:block;padding:0;margin:0 0 0 1px;z-index:3;top:5px;left:0;width:12px;height:12px;line-height:1px!important;outline:0 none;background:#eee;border:1px solid #aaa;border-radius:12px;-webkit-user-select:none;-webkit-touch-callout:none;-moz-user-select:none;-moz-user-focus:none;-moz-outline:0 none;-ms-user-select:none;user-select:none}.fd-slider-handle:focus{outline:0 none;border:0 none;-moz-user-focus:normal}.fd-slider-handle:before,.fd-slider-handle:after{opacity:0;-webkit-transition-property:opacity;-webkit-transition-duration:1s;-webkit-transition-delay:1s;transition-property:opacity;transition-duration:1s;transition-delay:1s}button.fd-slider-handle:focus::-moz-focus-inner{border-color:transparent}.oldie .fd-slider-handle:after,.oldie .fd-slider-handle:before{display:none}body.fd-slider-drag-horizontal,body.fd-slider-drag-horizontal *,body.fd-slider-drag-vertical,body.fd-slider-drag-vertical *{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.fd-slider-active .fd-slider-handle :before,.fd-slider-focused .fd-slider-handle :before,.fd-slider-hover .fd-slider-handle :before{display:block;position:absolute;top:-21px;left:-8px;margin:0;width:20px;padding:3px;height:14px;line-height:12px;text-align:center;font-size:10px;font-weight:700;color:#fff;text-shadow:1px 1px 1px #1a3a95;background:#2f6ee0;z-index:1;content:attr(aria-valuetext);border-radius:3px;-webkit-background-clip:padding-box;background-clip:padding-box;-webkit-box-shadow:0 0 4px #aaa;box-shadow:0 0 4px #999;opacity:1}.fd-slider-active .fd-slider-handle:after,.fd-slider-focused .fd-slider-handle:after,.fd-slider-hover .fd-slider-handle:after{outline:0;content:"";display:block;position:absolute;top:-9px;left:50%;margin:0 0 0 -5px;background:#2f6ee0;z-index:2;width:10px;height:10px;overflow:hidden;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-o-transform:rotate(45deg);-webkit-box-shadow:0 0 4px #aaa;box-shadow:0 0 4px #aaa;clip:rect(4px,14px,14px,4px);opacity:1}.chart{height:220px;margin:20px 5px 10px 10px}.chart-small{height:100px;width:100%}.chart-large{height:235px;width:100%}.chart-xl{height:297px;width:100%}#flotTip{padding:3px 5px;background-color:#fff;z-index:9999;color:#333;-webkit-box-shadow:0 1px 8px rgba(0,0,0,0.1);box-shadow:0 1px 8px rgba(0,0,0,0.1);font-size:14px;border:1px solid #c1c1c1;-khtml-border-radius:4px;border-radius:4px}#flotTip span{color:#38812d;font-weight:700}.has-legend{margin-top:30px!important}.has-legend-unique{margin-top:19px!important}.legendLabel span{display:block;margin:0 5px}.legendColorBox{padding-left:10px;vertical-align:top;padding-top:5px}.legendColorBox div>div{width:4px;height:4px;border-radius:50%;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box}.morris-hover{position:absolute;z-index:1001}.morris-hover.morris-default-style{border-radius:10px;padding:6px;color:#666;background:rgba(255,255,255,0.8);border:solid 2px rgba(230,230,230,0.8);font-family:Ubuntu,sans-serif;font-size:12px;text-align:center}.morris-hover.morris-default-style .morris-hover-row-label{font-weight:700;margin:.25em 0}.morris-hover.morris-default-style .morris-hover-point{white-space:nowrap;margin:.1em 0}.easyPieChart{position:relative;text-align:center}.easyPieChart canvas{position:absolute;top:0;left:0}.easy-pie-chart{display:inline-block}.easy-pie-chart .percent{color:#444;font-size:12px;font-weight:700}.easy-pie-title{display:inline-block;margin:10px 6px 0;font-size:12px;font-weight:400;text-transform:uppercase;width:100px;height:19px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.easy-pie-title .icon-color-bad,.easy-pie-title .icon-color-good{font-size:18px}.show-stat-buttons{float:left;width:100%}@media(max-width:767px){.show-stat-buttons{padding-left:10px!important;padding-right:10px!important}}@media only screen and (min-width:0) and (max-width:679px){.show-stat-buttons{padding-left:10px!important;padding-right:10px!important}}@media only screen and (min-width:320px) and (max-width:479px){.show-stat-buttons{padding-left:10px!important;padding-right:10px!important}}.show-stats{padding-top:6px!important}.show-stats .progress{height:7px;border-radius:0;margin-top:3px;margin-bottom:15px}.show-stats .show-stat-buttons>:first-child{padding-right:5px}@media(max-width:979px){.show-stats .show-stat-buttons>:first-child{padding-right:13px}}.show-stats .show-stat-buttons>:last-child{padding-left:5px}@media(max-width:979px){.show-stats .show-stat-buttons>:last-child{padding-left:13px}}.show-stat-microcharts{margin-left:-10px;margin-right:-10px}.show-stat-microcharts>div{border-right:1px solid #dadada!important;border-top:1px solid #dadada!important;margin-top:10px!important;height:65px;overflow:hidden;padding:7px 9px}@media(max-width:767px){.show-stat-microcharts>div{margin-top:0!important;border-right:0!important}}@media only screen and (min-width:0) and (max-width:679px){.show-stat-microcharts>div{margin-top:0!important;border-right:0!important}}@media only screen and (min-width:320px) and (max-width:479px){.show-stat-microcharts>div{margin-top:0!important;border-right:0!important}}.show-stat-microcharts>:last-child{border-right:0!important}.show-stat-microcharts .sparkline{margin-top:10px;margin-right:8px;opacity:.7}.show-stat-microcharts .sparkline:hover{opacity:1}.smaller-stat{margin:0;padding:0;list-style:none}.smaller-stat li{margin-top:3px;margin-right:0}.smaller-stat li:first-child{margin-top:8px}.smaller-stat span.label{width:40px;display:block;text-align:left;opacity:.5;cursor:default}.smaller-stat span.label:hover{opacity:1}.jvectormap-label{position:absolute;display:none;border:solid 1px #cdcdcd;border-radius:3px;background:#292929;color:#fff;font-family:Ubuntu,sans-serif,Verdana;font-size:smaller;padding:3px}.jvectormap-zoomin{top:0}.jvectormap-zoomout{top:24px}.jvectormap-zoomin,.jvectormap-zoomout{position:absolute;background:#292929;padding:4px;width:22px;height:22px;cursor:pointer;line-height:10px;text-align:center;font-size:14px;border-radius:2px;box-shadow:inset 0 -2px 0 rgba(0,0,0,0.05);-webkit-box-shadow:inset 0 -2px 0 rgba(0,0,0,0.05);background-color:#fff;border:1px solid #bfbfbf}.jvectormap-zoomin:hover,.jvectormap-zoomout:hover{background:#eee;border-color:#d9d9d9}.vector-map{height:300px;width:100%;padding:10px}#chat-container{position:absolute;width:250px;height:270px;z-index:2;border-left:1px solid #cdcecf;right:-251px;top:0;background:#fff;transition-duration:.25s;-webkit-transition-duration:.25s}#chat-container:hover,#chat-container:hover .chat-list-open-close{border-color:#a7a7a7}#chat-container *,#chat-container :after,#chat-container :before{box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box}#chat-container input[type=text]{box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box}#chat-container.open{right:0;top:0}#chat-container.open .chat-list-open-close i:before{content:"\f00d"!important}#chat-container.open .chat-list-open-close b{display:none}#chat-container .chat-list-open-close{display:block;width:25px;height:25px;border:1px solid #cdcecf;border-right:1px solid #f2f4f8!important;position:absolute;left:-32px;top:7%;border-radius:50% 0 0 50%;padding:3px 1px 3px 5px;font-size:21px;line-height:22px;cursor:pointer;color:#868686;-webkit-box-shadow:inset 0 .2em 0 rgba(0,0,0,0.05);box-shadow:inset 0 .2em 0 rgba(0,0,0,0.05);background:#f2f4f8;text-align:center}#chat-container .chat-list-open-close b{position:absolute;right:0;background:#ed1c24;line-height:9px;height:10px;width:10px;top:3px;border:1px solid #FFF;border-radius:3px;font-size:9px;text-align:center;vertical-align:middle;color:#fff;font-weight:400}#chat-container .chat-list-body{height:217px;overflow-y:scroll;overflow-x:hidden;display:block;padding:0;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;background:#f2f4f8}#chat-container #chat-users{list-style:none;margin:10px 0;padding:0}#chat-container #chat-users li{margin-bottom:3px;margin-left:5px}#chat-container #chat-users li a{display:block;font-size:13px;color:#3d3d3d;text-decoration:none!important;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;padding:3px 8px 3px 3px;line-height:33px;vertical-align:middle}#chat-container #chat-users li a:hover{background:#e0e4ee}#chat-container #chat-users li a img{width:33px;height:auto;margin-right:10px}#chat-container #chat-users li a i{color:#acacac;font-size:8px;line-height:34px;font-style:normal}#chat-container #chat-users li a i.last-online{font-size:12px;letter-spacing:-1px}#chat-container .chat-list-footer{overflow:hidden;border-top:1px solid #CCC;padding:10px;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box}#chat-container .chat-list-footer input[type=text]{border:1px solid #bababa!important}#chat-container .control-group{padding:0}.chat-body{background:#fafafa;background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJod…EiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#fafafa),color-stop(100%,#fff));background:-webkit-linear-gradient(top,#fafafa 0,#fff 100%);background:-webkit-gradient(linear,top left,bottom left,from(#f5fcff),to(#fff));background:-webkit-linear-gradient(top,#f5fcff 0,#fff 100%);background:linear-gradient(to bottom,#f5fcff 0,#fff 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fafafa',endColorstr='#ffffff',GradientType=0);-webkit-box-shadow:inset 2px 2px 5px rgba(0,0,0,0.04);box-shadow:inset 2px 2px 5px rgba(0,0,0,0.04);display:block;height:270px;overflow-y:scroll;overflow-x:hidden;padding:10px;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;border:1px solid #fff;border-top:0}.chat-body ul{margin:0;padding:0}.chat-body li:first-child{margin-top:10px}.chat-body li.message{display:block;position:relative;margin:20px 20px 0}.chat-body li.message img{display:inline-block;border-left:4px solid #fff;position:absolute}.chat-body li.message img.online{border-left-color:#00a300}.chat-body li.message img.offline{border-left-color:#ddd}.chat-body li.message img.busy{border-left-color:#a90329}.chat-body li.message img.away{border-left-color:#ffc40d}.chat-body li.message .message-text{display:inline-block;vertical-align:top;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;padding:0;margin-left:65px;line-height:normal}.chat-body li.message .message-text time{position:absolute;top:1px;right:0;font-size:10px;line-height:10px;color:#afafaf}.chat-body li.message .message-text .chat-file{display:block;margin:3px 0;padding:4px;border:1px dotted #ddd;background:rgba(0,0,0,0.05);border-radius:4px;text-align:right;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box}.chat-body li.message .message-text .chat-file:nth-child(3){margin-top:15px}.chat-body li.message .message-text .chat-file.row-fluid [class*=span]{min-height:10px!important}.chat-body li.message .message-text .chat-file b{font-style:italic;white-space:nowrap;width:250px;overflow:hidden;text-overflow:ellipsis;text-align:left}@media(min-width:768px) and (max-width:880px){.chat-body li.message .message-text .chat-file b{width:150px}}@media only screen and (min-width:320px) and (max-width:479px){.chat-body li.message .message-text .chat-file b{width:150px}}@media(max-width:480px){.chat-body li.message .message-text .chat-file b{width:150px}}.chat-body li.message .message-text a.username{display:block;font-weight:700;margin-bottom:4px;vertical-align:top;line-height:14px;font-size:14px;letter-spacing:-1px;text-decoration:none!important}.chat-footer{border-top:1px solid rgba(0,0,0,0.1);background:rgba(248,248,248,0.9);padding:0 10px 15px;position:relative;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box}.profile-message{background:none!important;height:auto!important;box-shadow:none!important;-webkit-box-shadow:none!important;overflow:hidden}.profile-message li.message.message-reply{margin-left:85px!important;background:#f7f7f7;padding:10px;margin:3px 0 0 20px}.profile-message li.message.message-reply img{width:35px!important}.profile-message li.message.message-reply .message-text{margin-left:45px!important}.profile-message .wall-comment-reply{margin-left:85px;margin-bottom:20px}.cajita img{width:23px;height:23px;padding-left:3px;padding-top:3px}#pageslide{display:none;position:absolute;position:fixed;top:0;height:100%;z-index:999999;width:305px;padding:20px;background-color:#004d60;color:#FFF;-webkit-box-shadow:inset 0 0 5px 5px #222;-moz-shadow:inset 0 0 0 0 #222;box-shadow:inset 0 0 0 0 #222}.purehtml{color:#fff;font-size:16px}#inbox-table{font-size:13px;border-top:0;border-left-color:transparent!important;border-right-color:transparent!important}#inbox-table tbody tr:hover{cursor:pointer;background:#e4e4e4}#inbox-table tr td{border-right:0;border-left:0;line-height:26px;padding:6px 4px 7px!important}#inbox-table .inbox-table-icon{padding-left:15px!important}@media(max-width:979px){#inbox-table .inbox-table-icon{padding-left:10px!important}}#inbox-table tbody tr th{overflow:hidden}#inbox-table.table tbody>tr>td{border-color:#fff!important}#inbox-table .checkbox,#inbox-table .radio{margin-top:-1px;margin-bottom:0}.minified .inbox-badge{border-radius:50%;font-size:9px;padding:2px;position:absolute;top:6px;right:6px;background:#ed1c24;min-width:13px}.inbox-body{position:relative}.inbox-body .table-wrap{background:#fff;padding:10px 14px 7px;position:relative;margin-left:200px}@media(max-width:1024px){.inbox-body .table-wrap{margin-left:0!important}}@media(max-width:979px){.inbox-body .table-wrap{padding:0!important}}.inbox-body.no-content-padding{margin-top:0;background:#fff}.inbox-nav-bar{height:70px;margin-bottom:0;padding:20px 14px;background:#fff}@media(max-width:979px){.inbox-nav-bar{padding-left:5px;padding-right:5px}}@media(min-width:768px) and (max-width:880px){.inbox-nav-bar.no-content-padding{margin-top:-10px!important}}@media(max-width:767px){.inbox-nav-bar.no-content-padding{margin-top:-10px!important}}@media only screen and (min-width:0) and (max-width:679px){.inbox-nav-bar.no-content-padding{margin-top:-10px!important}}@media only screen and (min-width:320px) and (max-width:479px){.inbox-nav-bar.no-content-padding{margin-top:-10px!important}}.inbox-nav-bar .page-title{display:inline-block;margin:0;width:196px;line-height:33px;vertical-align:middle}.inbox-footer{height:52px;padding:15px 14px 0;border-top:1px solid #cecece;background:#2a2725;position:absolute;bottom:-53px;width:100%}.inbox-footer .btn-group,.inbox-paging{margin-left:10px}.inbox-data-attachment,.inbox-table-icon{width:28px;text-align:left;padding-left:12px!important;padding-right:0!important}.inbox-data-from{width:200px}.inbox-data-from>:first-child{width:200px;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.inbox-data-date{width:80px;padding-left:7px!important;padding-right:0!important}.inbox-data-message>:first-child{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;height:27px;color:#8a8a8a}@media(max-width:979px){.inbox-data-message>:first-child{height:50px;overflow:hidden}}.inbox-data-message>:first-child span{color:#111}.inbox-data-message>:first-child span.label{color:#fff}@media(max-width:979px){.inbox-data-message>:first-child>:first-child{display:block!important;font-size:14px}}.inbox-data-message>:first-child>:first-child:after{content:" - "}.inbox-checkbox-triggered{display:inline-block}.inbox-checkbox-triggered>.btn-group{margin-right:10px}.inbox-checkbox-triggered>.btn-group .btn{padding-left:14px;padding-right:14px}@media(max-width:979px){.inbox-checkbox-triggered>.btn-group .btn{padding-left:10px;padding-right:10px}}.inbox-side-bar{height:100%;position:absolute;background:#fff;display:block;width:200px;padding:10px 0 10px 14px}@media(max-width:1024px){.inbox-side-bar{display:none!important}}.inbox-side-bar h6{font-weight:400;font-size:11px;display:block;padding:0 15px;text-transform:uppercase;color:#838383}.inbox-side-bar h6 a{font-size:14px;margin-top:-2px}.inbox-side-bar h6 .tooltip{text-transform:none!important}.inbox-side-bar>.btn{margin-bottom:35px}.inbox-side-bar .input-group{margin-bottom:25px}.inbox-space{display:block;width:185px}.inbox-space>.progress{margin-top:5px}.inbox .inbox-menu-lg{list-style:none;padding:0;margin:0 0 20px}.inbox .inbox-menu-lg .inbox-menu-lg li{display:block;width:100%}.inbox .inbox-menu-lg .inbox-menu-lg li a{display:block;padding:6px 15px 7px;font-size:13px;color:#333}.inbox .inbox-menu-lg .inbox-menu-lg li a:hover{text-decoration:none;background:#f4f4f4}.inbox .inbox-menu-lg .inbox-menu-lg li.active a{font-weight:700;background:#f0f0f0;border-bottom:1px solid #e7e7e7;color:#3276b1}.inbox .inbox-menu-sm{list-style:none;padding:0;margin:0 0 20px}.inbox .inbox-menu-sm .inbox-menu-sm li{display:block;width:100%}.inbox .inbox-menu-sm .inbox-menu-sm li a{display:block;padding:8px 15px 10px;font-size:13px;color:#333}.inbox .inbox-menu-sm .inbox-menu-sm li a:hover{text-decoration:none;background:#f4f4f4}.inbox .inbox-menu-sm .inbox-menu-sm li.active a{font-weight:700;background:#f0f0f0;border-bottom:1px solid #e7e7e7;color:#3276b1}.inbox-info-bar{padding:10px 0;border-bottom:1px solid #bfbfbf}.inbox-info-bar .form-group{margin:0}.inbox-info-bar .form-group input,.inbox-info-bar .select2-container-multi .select2-choices{border-color:#fff!important}.inbox-info-bar .select2-choices>div{display:none}.inbox-info-bar .col-md-1,.inbox-info-bar .col-md-11{padding-left:0;padding-right:0}@media(max-width:1024px){.inbox-info-bar .col-md-1,.inbox-info-bar .col-md-11{padding-left:26px;padding-right:26px}}.inbox-info-bar img{width:35px;height:auto;display:inline-block;vertical-align:middle;margin-right:7px;margin-left:2px;border-left:3px solid #fff}.inbox-info-bar em{position:absolute;top:6px;right:20px;text-align:right;font-style:normal}.inbox-download .inbox-message{padding:15px 4px;border-bottom:1px solid #bfbfbf}.inbox-download-list{list-style:none;margin:5px 0 0;padding:0}.inbox-download-list li{display:inline-block;margin:0 5px 0 0;vertical-align:top}.inbox-download-list li>:first-child{margin-bottom:0;width:150px;overflow:hidden}.inbox-download-list li>:first-child:hover{background:#fff;border-color:silver}.inbox-download-list li>:first-child>:first-child{text-align:center;display:block;color:#d6d6d6}.inbox-download-list li>:first-child>:first-child>.fa{font-size:150px}.inbox-download-list li>:first-child>:first-child>img{max-width:120px}.inbox-compose-footer{padding:10px;background:#f5f5f5;border-bottom:1px solid #a9a9a9}.inbox-compose-footer,.inbox-download,.inbox-info-bar,.inbox-message{margin-right:240px;position:relative}@media(max-width:1280px){.inbox-compose-footer,.inbox-download,.inbox-info-bar,.inbox-message{margin-right:0}}@media(max-width:979px){.inbox-table-icon>:first-child{margin-top:12px}}.unread td{background:#fff}.unread .inbox-data-date>:first-child,.unread .inbox-data-from>:first-child,.unread .inbox-data-message>:first-child>:first-child{font-weight:700}tr.highlight td,tr.unread.highlight td{background:#ffc!important;color:#333}#compose-mail-mini{margin-left:4px}.email-open-header{margin:-10px 0 0 0;font-size:20px;border-bottom:1px solid #bfbfbf;border-top:1px solid #eee;padding:15px 3px}.email-open-header>span{font-size:10px;font-weight:400;padding:3px 5px;letter-spacing:normal;text-transform:uppercase;vertical-align:middle;line-height:33px;background:#acacac}.email-infobox{display:block;width:180px;border-bottom:1px solid #bfbfbf;padding-bottom:0;padding-top:15px;position:absolute;top:65px;right:15px}@media(max-width:1280px){.email-infobox .email-infobox{display:none}}.email-reply-text>div{border-left:1px solid #d6d6d6;padding-left:10px;margin-left:50px;color:#a9a9a9}.email-reply-text>:first-child{padding-left:45px}.profile-pic{text-align:right}.profile-pic>img{border-radius:0;position:relative;border:5px solid #fff;top:-30px;display:inline-block;text-align:right;z-index:4;width:120px;margin-bottom:-30px}.profile-carousel .carousel-inner{max-height:150px}.friends-list li{margin-bottom:10px}.friends-list li img{width:35px;border:1px solid #fff;outline:1px solid #bfbfbf}.search-results{padding:18px 5px}.search-results+.search-results{border-top:1px dashed #e3e3e3}.search-results>:first-child{margin-bottom:4px;font-weight:400}.search-results>:first-child a{text-decoration:underline}.search-results .url{font-style:normal;font-size:14px}.search-results img{display:inline-block;margin-top:4px;margin-right:4px;width:80px}.search-results>div{display:inline-block;vertical-align:top}.search-results .note{margin:0;line-height:normal}.search-results .note a{text-decoration:none!important;color:#333}.search-results .note a:hover{color:#ed1c24}.todo{margin:0;padding:0;min-height:5px;list-style:none}.todo>li{display:block;position:relative;overflow:hidden;border-bottom:1px solid #e7e7e7;margin:0 5px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAQCAYAAADagWXwAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo0RkQ1OEY4NTM4NUIxMUUzQjdCMUMxQzJCQUE3MTMxOCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo0RkQ1OEY4NjM4NUIxMUUzQjdCMUMxQzJCQUE3MTMxOCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjRGRDU4RjgzMzg1QjExRTNCN0IxQzFDMkJBQTcxMzE4IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjRGRDU4Rjg0Mzg1QjExRTNCN0IxQzFDMkJBQTcxMzE4Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+pTD+wgAAACtJREFUeNpimDBhwn8gYABhdDYjiIELMDHgAUwTJ06Ea0VnjxpLO2MBAgwAGYZLegQbQ3UAAAAASUVORK5CYII=) 1px 11px no-repeat}.todo>li:last-child,.todo>li:only-child{border-bottom:0}.todo>li>:first-child{display:block;border-right:1px solid #ffe1eb;height:100%;padding:6px 11px 6px 18px;width:20px;vertical-align:top;position:absolute}.todo>li>:first-child:hover{cursor:move}.todo>li.complete{background:0}.todo>li.complete.complete>:first-child:hover{cursor:default}.todo>li.complete>*{text-decoration:line-through;font-style:italic}.todo>li.ui-sortable-helper{border-top:1px solid #eee;background:rgba(113,132,63,0.1)}.todo>li>p{height:100%;margin-left:52px;border-left:1px solid #ffe1eb;display:inline-block;padding:8px 0 6px 7px;margin-bottom:0;min-height:37px;line-height:normal;font-size:14px;font-weight:500;color:#333}.todo>li>p>span{display:block;line-height:12px;font-size:10px;font-weight:400}.todo>li>p>:first-child{margin-top:-5px;color:#999;margin-bottom:4px}.todo>li>p>.date{color:#bfbfbf}.todo-group-title{margin:0;line-height:31px;padding:0 0 0 10px;background:#fafafa;border-bottom:1px solid #e7e7e7;border-top:1px solid #f4f4f4;color:#999}
\ No newline at end of file
+.txt-color-blue{color:#60747c!important}.txt-color-blueLight{color:#ccdadf!important}.txt-color-blueDark{color:#4c4f53!important}.txt-color-green{color:#356e35!important}.txt-color-greenLight{color:#71843f!important}.txt-color-greenDark{color:#496949!important}.txt-color-red{color:#931313!important}.txt-color-yellow{color:#d4c737!important}.txt-color-yellowLight{color:#fff03d!important}.txt-color-orange{color:#c79121!important}.txt-color-orangeLight{color:#ee9000!important}.txt-color-orangeDark{color:#a57225!important}.txt-color-pink{color:#ac5287!important}.txt-color-pinkDark{color:#a8829f!important}.txt-color-purple{color:#65596b!important}.txt-color-darken{color:#404040!important}.txt-color-silver{color:#b4b4b4!important}.txt-color-lighten{color:#d5e7ec!important}.txt-color-white{color:#dedede!important}.txt-color-grayDark{color:#525252!important}.txt-color-magenta{color:#6e3671!important}.txt-color-teal{color:#568a89!important}.txt-color-redLight{color:#a65858!important}.txt-color-active{color:#3276b1!important}.txt-color-activeBg{color:#cedbf7!important}.bg-color-blue{background-color:#60747c!important}.bg-color-blueLight{background-color:#ccdadf!important}.bg-color-blueDark{background-color:#4c4f53!important}.bg-color-green{background-color:#356e35!important}.bg-color-greenLight{background-color:#71843f!important}.bg-color-greenDark{background-color:#496949!important}.bg-color-red{background-color:#931313!important}.bg-color-yellow{background-color:#d4c737!important}.bg-color-yellowLight{background-color:#fff03d!important}.bg-color-orange{background-color:#c79121!important}.bg-color-orangeLight{background-color:#ee9000!important}.bg-color-orangeDark{background-color:#a57225!important}.bg-color-pink{background-color:#ac5287!important}.bg-color-pinkDark{background-color:#a8829f!important}.bg-color-purple{background-color:#65596b!important}.bg-color-darken{background-color:#404040!important}.bg-color-silver{background-color:#b4b4b4!important}.bg-color-lighten{background-color:#d5e7ec!important}.bg-color-white{background-color:#dedede!important}.bg-color-grayDark{background-color:#525252!important}.bg-color-magenta{background-color:#6e3671!important}.bg-color-teal{background-color:#568a89!important}.bg-color-redLight{background-color:#a65858!important}.bg-color-active{background-color:#3276b1!important}.bg-color-activeBg{background-color:#cedbf7!important}@-webkit-keyframes flash{0%,100%,50%{opacity:1}25%,75%{opacity:0}}@keyframes flash{0%,100%,50%{opacity:1}25%,75%{opacity:0}}@-webkit-keyframes shake{0%,100%{-webkit-transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px)}}@keyframes shake{0%,100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);-ms-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);-ms-transform:translateX(10px);transform:translateX(10px)}}@-webkit-keyframes bounce{0%,100%,20%,50%,80%{-webkit-transform:translateY(0)}40%{-webkit-transform:translateY(-30px)}60%{-webkit-transform:translateY(-15px)}}@keyframes bounce{0%,100%,20%,50%,80%{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}40%{-webkit-transform:translateY(-30px);-ms-transform:translateY(-30px);transform:translateY(-30px)}60%{-webkit-transform:translateY(-15px);-ms-transform:translateY(-15px);transform:translateY(-15px)}}@-webkit-keyframes tada{0%{-webkit-transform:scale(1)}10%,20%{-webkit-transform:scale(0.9) rotate(-3deg)}30%,50%,70%,90%{-webkit-transform:scale(1.1) rotate(3deg)}40%,60%,80%{-webkit-transform:scale(1.1) rotate(-3deg)}100%{-webkit-transform:scale(1) rotate(0)}}@keyframes tada{0%{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}10%,20%{-webkit-transform:scale(0.9) rotate(-3deg);-ms-transform:scale(0.9) rotate(-3deg);transform:scale(0.9) rotate(-3deg)}30%,50%,70%,90%{-webkit-transform:scale(1.1) rotate(3deg);-ms-transform:scale(1.1) rotate(3deg);transform:scale(1.1) rotate(3deg)}40%,60%,80%{-webkit-transform:scale(1.1) rotate(-3deg);-ms-transform:scale(1.1) rotate(-3deg);transform:scale(1.1) rotate(-3deg)}100%{-webkit-transform:scale(1) rotate(0);-ms-transform:scale(1) rotate(0);transform:scale(1) rotate(0)}}@-webkit-keyframes swing{100%,20%,40%,60%,80%{-webkit-transform-origin:top center}20%{-webkit-transform:rotate(15deg)}40%{-webkit-transform:rotate(-10deg)}60%{-webkit-transform:rotate(5deg)}80%{-webkit-transform:rotate(-5deg)}100%{-webkit-transform:rotate(0deg)}}@keyframes swing{20%{-webkit-transform:rotate(15deg);-ms-transform:rotate(15deg);transform:rotate(15deg)}40%{-webkit-transform:rotate(-10deg);-ms-transform:rotate(-10deg);transform:rotate(-10deg)}60%{-webkit-transform:rotate(5deg);-ms-transform:rotate(5deg);transform:rotate(5deg)}80%{-webkit-transform:rotate(-5deg);-ms-transform:rotate(-5deg);transform:rotate(-5deg)}100%{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg)}}@-webkit-keyframes wobble{0%{-webkit-transform:translateX(0)}15%{-webkit-transform:translateX(-25%) rotate(-5deg)}30%{-webkit-transform:translateX(20%) rotate(3deg)}45%{-webkit-transform:translateX(-15%) rotate(-3deg)}60%{-webkit-transform:translateX(10%) rotate(2deg)}75%{-webkit-transform:translateX(-5%) rotate(-1deg)}100%{-webkit-transform:translateX(0)}}@keyframes wobble{0%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}15%{-webkit-transform:translateX(-25%) rotate(-5deg);-ms-transform:translateX(-25%) rotate(-5deg);transform:translateX(-25%) rotate(-5deg)}30%{-webkit-transform:translateX(20%) rotate(3deg);-ms-transform:translateX(20%) rotate(3deg);transform:translateX(20%) rotate(3deg)}45%{-webkit-transform:translateX(-15%) rotate(-3deg);-ms-transform:translateX(-15%) rotate(-3deg);transform:translateX(-15%) rotate(-3deg)}60%{-webkit-transform:translateX(10%) rotate(2deg);-ms-transform:translateX(10%) rotate(2deg);transform:translateX(10%) rotate(2deg)}75%{-webkit-transform:translateX(-5%) rotate(-1deg);-ms-transform:translateX(-5%) rotate(-1deg);transform:translateX(-5%) rotate(-1deg)}100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes pulse{0%{-webkit-transform:scale(1)}50%{-webkit-transform:scale(1.1)}100%{-webkit-transform:scale(1)}}@keyframes pulse{0%{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.1);-ms-transform:scale(1.1);transform:scale(1.1)}100%{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}@-webkit-keyframes flip{0%{-webkit-transform:perspective(400px) translateZ(0) rotateY(0) scale(1);-webkit-animation-timing-function:ease-out}40%{-webkit-transform:perspective(400px) translateZ(150px) rotateY(170deg) scale(1);-webkit-animation-timing-function:ease-out}50%{-webkit-transform:perspective(400px) translateZ(150px) rotateY(190deg) scale(1);-webkit-animation-timing-function:ease-in}80%{-webkit-transform:perspective(400px) translateZ(0) rotateY(360deg) scale(0.95);-webkit-animation-timing-function:ease-in}100%{-webkit-transform:perspective(400px) translateZ(0) rotateY(360deg) scale(1);-webkit-animation-timing-function:ease-in}}@keyframes flip{0%{-webkit-transform:perspective(400px) translateZ(0) rotateY(0) scale(1);-ms-transform:perspective(400px) translateZ(0) rotateY(0) scale(1);transform:perspective(400px) translateZ(0) rotateY(0) scale(1);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}40%{-webkit-transform:perspective(400px) translateZ(150px) rotateY(170deg) scale(1);-ms-transform:perspective(400px) translateZ(150px) rotateY(170deg) scale(1);transform:perspective(400px) translateZ(150px) rotateY(170deg) scale(1);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}50%{-webkit-transform:perspective(400px) translateZ(150px) rotateY(190deg) scale(1);-ms-transform:perspective(400px) translateZ(150px) rotateY(190deg) scale(1);transform:perspective(400px) translateZ(150px) rotateY(190deg) scale(1);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}80%{-webkit-transform:perspective(400px) translateZ(0) rotateY(360deg) scale(0.95);-ms-transform:perspective(400px) translateZ(0) rotateY(360deg) scale(0.95);transform:perspective(400px) translateZ(0) rotateY(360deg) scale(0.95);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}100%{-webkit-transform:perspective(400px) translateZ(0) rotateY(360deg) scale(1);-ms-transform:perspective(400px) translateZ(0) rotateY(360deg) scale(1);transform:perspective(400px) translateZ(0) rotateY(360deg) scale(1);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}}@-webkit-keyframes flipInX{0%{-webkit-transform:perspective(400px) rotateX(90deg);opacity:0}40%{-webkit-transform:perspective(400px) rotateX(-10deg)}70%{-webkit-transform:perspective(400px) rotateX(10deg)}100%{-webkit-transform:perspective(400px) rotateX(0deg);opacity:1}}@keyframes flipInX{0%{-webkit-transform:perspective(400px) rotateX(90deg);-ms-transform:perspective(400px) rotateX(90deg);transform:perspective(400px) rotateX(90deg);opacity:0}40%{-webkit-transform:perspective(400px) rotateX(-10deg);-ms-transform:perspective(400px) rotateX(-10deg);transform:perspective(400px) rotateX(-10deg)}70%{-webkit-transform:perspective(400px) rotateX(10deg);-ms-transform:perspective(400px) rotateX(10deg);transform:perspective(400px) rotateX(10deg)}100%{-webkit-transform:perspective(400px) rotateX(0deg);-ms-transform:perspective(400px) rotateX(0deg);transform:perspective(400px) rotateX(0deg);opacity:1}}@-webkit-keyframes flipOutX{0%{-webkit-transform:perspective(400px) rotateX(0deg);opacity:1}100%{-webkit-transform:perspective(400px) rotateX(90deg);opacity:0}}@keyframes flipOutX{0%{-webkit-transform:perspective(400px) rotateX(0deg);-ms-transform:perspective(400px) rotateX(0deg);transform:perspective(400px) rotateX(0deg);opacity:1}100%{-webkit-transform:perspective(400px) rotateX(90deg);-ms-transform:perspective(400px) rotateX(90deg);transform:perspective(400px) rotateX(90deg);opacity:0}}@-webkit-keyframes flipInY{0%{-webkit-transform:perspective(400px) rotateY(90deg);opacity:0}40%{-webkit-transform:perspective(400px) rotateY(-10deg)}70%{-webkit-transform:perspective(400px) rotateY(10deg)}100%{-webkit-transform:perspective(400px) rotateY(0deg);opacity:1}}@keyframes flipInY{0%{-webkit-transform:perspective(400px) rotateY(90deg);-ms-transform:perspective(400px) rotateY(90deg);transform:perspective(400px) rotateY(90deg);opacity:0}40%{-webkit-transform:perspective(400px) rotateY(-10deg);-ms-transform:perspective(400px) rotateY(-10deg);transform:perspective(400px) rotateY(-10deg)}70%{-webkit-transform:perspective(400px) rotateY(10deg);-ms-transform:perspective(400px) rotateY(10deg);transform:perspective(400px) rotateY(10deg)}100%{-webkit-transform:perspective(400px) rotateY(0deg);-ms-transform:perspective(400px) rotateY(0deg);transform:perspective(400px) rotateY(0deg);opacity:1}}@-webkit-keyframes flipOutY{0%{-webkit-transform:perspective(400px) rotateY(0deg);opacity:1}100%{-webkit-transform:perspective(400px) rotateY(90deg);opacity:0}}@keyframes flipOutY{0%{-webkit-transform:perspective(400px) rotateY(0deg);-ms-transform:perspective(400px) rotateY(0deg);transform:perspective(400px) rotateY(0deg);opacity:1}100%{-webkit-transform:perspective(400px) rotateY(90deg);-ms-transform:perspective(400px) rotateY(90deg);transform:perspective(400px) rotateY(90deg);opacity:0}}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes fadeInUp{0%{opacity:0;-webkit-transform:translateY(20px)}100%{opacity:1;-webkit-transform:translateY(0)}}@keyframes fadeInUp{0%{opacity:0;-webkit-transform:translateY(20px);-ms-transform:translateY(20px);transform:translateY(20px)}100%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes fadeInDown{0%{opacity:0;-webkit-transform:translateY(-20px)}100%{opacity:1;-webkit-transform:translateY(0)}}@keyframes fadeInDown{0%{opacity:0;-webkit-transform:translateY(-20px);-ms-transform:translateY(-20px);transform:translateY(-20px)}100%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes fadeInLeft{0%{opacity:0;-webkit-transform:translateX(-20px)}100%{opacity:1;-webkit-transform:translateX(0)}}@keyframes fadeInLeft{0%{opacity:0;-webkit-transform:translateX(-20px);-ms-transform:translateX(-20px);transform:translateX(-20px)}100%{opacity:1;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes fadeInRight{0%{opacity:0;-webkit-transform:translateX(20px)}100%{opacity:1;-webkit-transform:translateX(0)}}@keyframes fadeInRight{0%{opacity:0;-webkit-transform:translateX(20px);-ms-transform:translateX(20px);transform:translateX(20px)}100%{opacity:1;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0)}}@keyframes fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);-ms-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes fadeInDownBig{0%{opacity:0;-webkit-transform:translateY(-2000px)}100%{opacity:1;-webkit-transform:translateY(0)}}@keyframes fadeInDownBig{0%{opacity:0;-webkit-transform:translateY(-2000px);-ms-transform:translateY(-2000px);transform:translateY(-2000px)}100%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes fadeInLeftBig{0%{opacity:0;-webkit-transform:translateX(-2000px)}100%{opacity:1;-webkit-transform:translateX(0)}}@keyframes fadeInLeftBig{0%{opacity:0;-webkit-transform:translateX(-2000px);-ms-transform:translateX(-2000px);transform:translateX(-2000px)}100%{opacity:1;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes fadeInRightBig{0%{opacity:0;-webkit-transform:translateX(2000px)}100%{opacity:1;-webkit-transform:translateX(0)}}@keyframes fadeInRightBig{0%{opacity:0;-webkit-transform:translateX(2000px);-ms-transform:translateX(2000px);transform:translateX(2000px)}100%{opacity:1;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@-webkit-keyframes fadeOutUp{0%{opacity:1;-webkit-transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(-20px)}}@keyframes fadeOutUp{0%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(-20px);-ms-transform:translateY(-20px);transform:translateY(-20px)}}@-webkit-keyframes fadeOutDown{0%{opacity:1;-webkit-transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(20px)}}@keyframes fadeOutDown{0%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(20px);-ms-transform:translateY(20px);transform:translateY(20px)}}@-webkit-keyframes fadeOutLeft{0%{opacity:1;-webkit-transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(-20px)}}@keyframes fadeOutLeft{0%{opacity:1;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(-20px);-ms-transform:translateX(-20px);transform:translateX(-20px)}}@-webkit-keyframes fadeOutRight{0%{opacity:1;-webkit-transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(20px)}}@keyframes fadeOutRight{0%{opacity:1;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(20px);-ms-transform:translateX(20px);transform:translateX(20px)}}@-webkit-keyframes fadeOutUpBig{0%{opacity:1;-webkit-transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(-2000px)}}@keyframes fadeOutUpBig{0%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(-2000px);-ms-transform:translateY(-2000px);transform:translateY(-2000px)}}@-webkit-keyframes fadeOutDownBig{0%{opacity:1;-webkit-transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(2000px)}}@keyframes fadeOutDownBig{0%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(2000px);-ms-transform:translateY(2000px);transform:translateY(2000px)}}@-webkit-keyframes fadeOutLeftBig{0%{opacity:1;-webkit-transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(-2000px)}}@keyframes fadeOutLeftBig{0%{opacity:1;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(-2000px);-ms-transform:translateX(-2000px);transform:translateX(-2000px)}}@-webkit-keyframes fadeOutRightBig{0%{opacity:1;-webkit-transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(2000px)}}@keyframes fadeOutRightBig{0%{opacity:1;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(2000px);-ms-transform:translateX(2000px);transform:translateX(2000px)}}@-webkit-keyframes bounceIn{0%{opacity:0;-webkit-transform:scale(0.3)}50%{opacity:1;-webkit-transform:scale(1.05)}70%{-webkit-transform:scale(0.9)}100%{-webkit-transform:scale(1)}}@keyframes bounceIn{0%{opacity:0;-webkit-transform:scale(0.3);-ms-transform:scale(0.3);transform:scale(0.3)}50%{opacity:1;-webkit-transform:scale(1.05);-ms-transform:scale(1.05);transform:scale(1.05)}70%{-webkit-transform:scale(0.9);-ms-transform:scale(0.9);transform:scale(0.9)}100%{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}@-webkit-keyframes slideInDown{0%{opacity:0;-webkit-transform:translateY(-2000px)}100%{-webkit-transform:translateY(0)}}@keyframes slideInDown{0%{opacity:0;-webkit-transform:translateY(-2000px);-ms-transform:translateY(-2000px);transform:translateY(-2000px)}100%{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes slideInLeft{0%{opacity:0;-webkit-transform:translateX(-2000px)}100%{-webkit-transform:translateX(0)}}@keyframes slideInLeft{0%{opacity:0;-webkit-transform:translateX(-2000px);-ms-transform:translateX(-2000px);transform:translateX(-2000px)}100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes slideInRight{0%{opacity:0;-webkit-transform:translateX(2000px)}100%{-webkit-transform:translateX(0)}}@keyframes slideInRight{0%{opacity:0;-webkit-transform:translateX(2000px);-ms-transform:translateX(2000px);transform:translateX(2000px)}100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes slideOutLeft{0%{-webkit-transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(-2000px)}}@keyframes slideOutLeft{0%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(-2000px);-ms-transform:translateX(-2000px);transform:translateX(-2000px)}}@-webkit-keyframes slideOutRight{0%{-webkit-transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(2000px)}}@keyframes slideOutRight{0%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(2000px);-ms-transform:translateX(2000px);transform:translateX(2000px)}}@-webkit-keyframes slideOutUp{0%{-webkit-transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(-2000px)}}@keyframes slideOutUp{0%{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(-2000px);-ms-transform:translateY(-2000px);transform:translateY(-2000px)}}@-webkit-keyframes bounceInUp{0%{opacity:0;-webkit-transform:translateY(2000px)}60%{opacity:1;-webkit-transform:translateY(-30px)}80%{-webkit-transform:translateY(10px)}100%{-webkit-transform:translateY(0)}}@keyframes bounceInUp{0%{opacity:0;-webkit-transform:translateY(2000px);-ms-transform:translateY(2000px);transform:translateY(2000px)}60%{opacity:1;-webkit-transform:translateY(-30px);-ms-transform:translateY(-30px);transform:translateY(-30px)}80%{-webkit-transform:translateY(10px);-ms-transform:translateY(10px);transform:translateY(10px)}100%{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes bounceInDown{0%{opacity:0;-webkit-transform:translateY(-2000px)}60%{opacity:1;-webkit-transform:translateY(30px)}80%{-webkit-transform:translateY(-10px)}100%{-webkit-transform:translateY(0)}}@keyframes bounceInDown{0%{opacity:0;-webkit-transform:translateY(-2000px);-ms-transform:translateY(-2000px);transform:translateY(-2000px)}60%{opacity:1;-webkit-transform:translateY(30px);-ms-transform:translateY(30px);transform:translateY(30px)}80%{-webkit-transform:translateY(-10px);-ms-transform:translateY(-10px);transform:translateY(-10px)}100%{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes bounceInLeft{0%{opacity:0;-webkit-transform:translateX(-2000px)}60%{opacity:1;-webkit-transform:translateX(30px)}80%{-webkit-transform:translateX(-10px)}100%{-webkit-transform:translateX(0)}}@keyframes bounceInLeft{0%{opacity:0;-webkit-transform:translateX(-2000px);-ms-transform:translateX(-2000px);transform:translateX(-2000px)}60%{opacity:1;-webkit-transform:translateX(30px);-ms-transform:translateX(30px);transform:translateX(30px)}80%{-webkit-transform:translateX(-10px);-ms-transform:translateX(-10px);transform:translateX(-10px)}100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes bounceInRight{0%{opacity:0;-webkit-transform:translateX(2000px)}60%{opacity:1;-webkit-transform:translateX(-30px)}80%{-webkit-transform:translateX(10px)}100%{-webkit-transform:translateX(0)}}@keyframes bounceInRight{0%{opacity:0;-webkit-transform:translateX(2000px);-ms-transform:translateX(2000px);transform:translateX(2000px)}60%{opacity:1;-webkit-transform:translateX(-30px);-ms-transform:translateX(-30px);transform:translateX(-30px)}80%{-webkit-transform:translateX(10px);-ms-transform:translateX(10px);transform:translateX(10px)}100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes bounceOut{0%{-webkit-transform:scale(1)}25%{-webkit-transform:scale(0.95)}50%{opacity:1;-webkit-transform:scale(1.1)}100%{opacity:0;-webkit-transform:scale(0.3)}}@keyframes bounceOut{0%{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}25%{-webkit-transform:scale(0.95);-ms-transform:scale(0.95);transform:scale(0.95)}50%{opacity:1;-webkit-transform:scale(1.1);-ms-transform:scale(1.1);transform:scale(1.1)}100%{opacity:0;-webkit-transform:scale(0.3);-ms-transform:scale(0.3);transform:scale(0.3)}}@-webkit-keyframes bounceOutUp{0%{-webkit-transform:translateY(0)}20%{opacity:1;-webkit-transform:translateY(20px)}100%{opacity:0;-webkit-transform:translateY(-2000px)}}@keyframes bounceOutUp{0%{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}20%{opacity:1;-webkit-transform:translateY(20px);-ms-transform:translateY(20px);transform:translateY(20px)}100%{opacity:0;-webkit-transform:translateY(-2000px);-ms-transform:translateY(-2000px);transform:translateY(-2000px)}}@-webkit-keyframes bounceOutDown{0%{-webkit-transform:translateY(0)}20%{opacity:1;-webkit-transform:translateY(-20px)}100%{opacity:0;-webkit-transform:translateY(2000px)}}@keyframes bounceOutDown{0%{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}20%{opacity:1;-webkit-transform:translateY(-20px);-ms-transform:translateY(-20px);transform:translateY(-20px)}100%{opacity:0;-webkit-transform:translateY(2000px);-ms-transform:translateY(2000px);transform:translateY(2000px)}}@-webkit-keyframes bounceOutLeft{0%{-webkit-transform:translateX(0)}20%{opacity:1;-webkit-transform:translateX(20px)}100%{opacity:0;-webkit-transform:translateX(-2000px)}}@keyframes bounceOutLeft{0%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}20%{opacity:1;-webkit-transform:translateX(20px);-ms-transform:translateX(20px);transform:translateX(20px)}100%{opacity:0;-webkit-transform:translateX(-2000px);-ms-transform:translateX(-2000px);transform:translateX(-2000px)}}@-webkit-keyframes bounceOutRight{0%{-webkit-transform:translateX(0)}20%{opacity:1;-webkit-transform:translateX(-20px)}100%{opacity:0;-webkit-transform:translateX(2000px)}}@keyframes bounceOutRight{0%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}20%{opacity:1;-webkit-transform:translateX(-20px);-ms-transform:translateX(-20px);transform:translateX(-20px)}100%{opacity:0;-webkit-transform:translateX(2000px);-ms-transform:translateX(2000px);transform:translateX(2000px)}}@-webkit-keyframes rotateIn{0%{-webkit-transform-origin:center center;-webkit-transform:rotate(-200deg);opacity:0}100%{-webkit-transform-origin:center center;-webkit-transform:rotate(0);opacity:1}}@keyframes rotateIn{0%{-webkit-transform-origin:center center;-ms-transform-origin:center center;transform-origin:center center;-webkit-transform:rotate(-200deg);-ms-transform:rotate(-200deg);transform:rotate(-200deg);opacity:0}100%{-webkit-transform-origin:center center;-ms-transform-origin:center center;transform-origin:center center;-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);opacity:1}}@-webkit-keyframes rotateInUpLeft{0%{-webkit-transform-origin:left bottom;-webkit-transform:rotate(90deg);opacity:0}100%{-webkit-transform-origin:left bottom;-webkit-transform:rotate(0);opacity:1}}@keyframes rotateInUpLeft{0%{-webkit-transform-origin:left bottom;-ms-transform-origin:left bottom;transform-origin:left bottom;-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg);opacity:0}100%{-webkit-transform-origin:left bottom;-ms-transform-origin:left bottom;transform-origin:left bottom;-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);opacity:1}}@-webkit-keyframes rotateInDownLeft{0%{-webkit-transform-origin:left bottom;-webkit-transform:rotate(-90deg);opacity:0}100%{-webkit-transform-origin:left bottom;-webkit-transform:rotate(0);opacity:1}}@keyframes rotateInDownLeft{0%{-webkit-transform-origin:left bottom;-ms-transform-origin:left bottom;transform-origin:left bottom;-webkit-transform:rotate(-90deg);-ms-transform:rotate(-90deg);transform:rotate(-90deg);opacity:0}100%{-webkit-transform-origin:left bottom;-ms-transform-origin:left bottom;transform-origin:left bottom;-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);opacity:1}}@-webkit-keyframes rotateInUpRight{0%{-webkit-transform-origin:right bottom;-webkit-transform:rotate(-90deg);opacity:0}100%{-webkit-transform-origin:right bottom;-webkit-transform:rotate(0);opacity:1}}@keyframes rotateInUpRight{0%{-webkit-transform-origin:right bottom;-ms-transform-origin:right bottom;transform-origin:right bottom;-webkit-transform:rotate(-90deg);-ms-transform:rotate(-90deg);transform:rotate(-90deg);opacity:0}100%{-webkit-transform-origin:right bottom;-ms-transform-origin:right bottom;transform-origin:right bottom;-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);opacity:1}}@-webkit-keyframes rotateInDownRight{0%{-webkit-transform-origin:right bottom;-webkit-transform:rotate(90deg);opacity:0}100%{-webkit-transform-origin:right bottom;-webkit-transform:rotate(0);opacity:1}}@keyframes rotateInDownRight{0%{-webkit-transform-origin:right bottom;-ms-transform-origin:right bottom;transform-origin:right bottom;-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg);opacity:0}100%{-webkit-transform-origin:right bottom;-ms-transform-origin:right bottom;transform-origin:right bottom;-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);opacity:1}}@-webkit-keyframes rotateOut{0%{-webkit-transform-origin:center center;-webkit-transform:rotate(0);opacity:1}100%{-webkit-transform-origin:center center;-webkit-transform:rotate(200deg);opacity:0}}@keyframes rotateOut{0%{-webkit-transform-origin:center center;-ms-transform-origin:center center;transform-origin:center center;-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);opacity:1}100%{-webkit-transform-origin:center center;-ms-transform-origin:center center;transform-origin:center center;-webkit-transform:rotate(200deg);-ms-transform:rotate(200deg);transform:rotate(200deg);opacity:0}}@-webkit-keyframes rotateOutUpLeft{0%{-webkit-transform-origin:left bottom;-webkit-transform:rotate(0);opacity:1}100%{-webkit-transform-origin:left bottom;-webkit-transform:rotate(-90deg);opacity:0}}@keyframes rotateOutUpLeft{0%{-webkit-transform-origin:left bottom;-ms-transform-origin:left bottom;transform-origin:left bottom;-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);opacity:1}100%{-webkit-transform-origin:left bottom;-ms-transform-origin:left bottom;transform-origin:left bottom;-webkit-transform:rotate(-90deg);-ms-transform:rotate(-90deg);transform:rotate(-90deg);opacity:0}}@-webkit-keyframes rotateOutDownLeft{0%{-webkit-transform-origin:left bottom;-webkit-transform:rotate(0);opacity:1}100%{-webkit-transform-origin:left bottom;-webkit-transform:rotate(90deg);opacity:0}}@keyframes rotateOutDownLeft{0%{-webkit-transform-origin:left bottom;-ms-transform-origin:left bottom;transform-origin:left bottom;-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);opacity:1}100%{-webkit-transform-origin:left bottom;-ms-transform-origin:left bottom;transform-origin:left bottom;-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg);opacity:0}}@-webkit-keyframes rotateOutUpRight{0%{-webkit-transform-origin:right bottom;-webkit-transform:rotate(0);opacity:1}100%{-webkit-transform-origin:right bottom;-webkit-transform:rotate(90deg);opacity:0}}@keyframes rotateOutUpRight{0%{-webkit-transform-origin:right bottom;-ms-transform-origin:right bottom;transform-origin:right bottom;-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);opacity:1}100%{-webkit-transform-origin:right bottom;-ms-transform-origin:right bottom;transform-origin:right bottom;-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg);opacity:0}}@-webkit-keyframes rotateOutDownRight{0%{-webkit-transform-origin:right bottom;-webkit-transform:rotate(0);opacity:1}100%{-webkit-transform-origin:right bottom;-webkit-transform:rotate(-90deg);opacity:0}}@keyframes rotateOutDownRight{0%{-webkit-transform-origin:right bottom;-ms-transform-origin:right bottom;transform-origin:right bottom;-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);opacity:1}100%{-webkit-transform-origin:right bottom;-ms-transform-origin:right bottom;transform-origin:right bottom;-webkit-transform:rotate(-90deg);-ms-transform:rotate(-90deg);transform:rotate(-90deg);opacity:0}}@-webkit-keyframes hinge{0%{-webkit-transform:rotate(0);-webkit-transform-origin:top left;-webkit-animation-timing-function:ease-in-out}20%,60%{-webkit-transform:rotate(80deg);-webkit-transform-origin:top left;-webkit-animation-timing-function:ease-in-out}40%{-webkit-transform:rotate(60deg);-webkit-transform-origin:top left;-webkit-animation-timing-function:ease-in-out}80%{-webkit-transform:rotate(60deg) translateY(0);opacity:1;-webkit-transform-origin:top left;-webkit-animation-timing-function:ease-in-out}100%{-webkit-transform:translateY(700px);opacity:0}}@keyframes hinge{0%{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);-webkit-transform-origin:top left;-ms-transform-origin:top left;transform-origin:top left;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}20%,60%{-webkit-transform:rotate(80deg);-ms-transform:rotate(80deg);transform:rotate(80deg);-webkit-transform-origin:top left;-ms-transform-origin:top left;transform-origin:top left;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}40%{-webkit-transform:rotate(60deg);-ms-transform:rotate(60deg);transform:rotate(60deg);-webkit-transform-origin:top left;-ms-transform-origin:top left;transform-origin:top left;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}80%{-webkit-transform:rotate(60deg) translateY(0);-ms-transform:rotate(60deg) translateY(0);transform:rotate(60deg) translateY(0);opacity:1;-webkit-transform-origin:top left;-ms-transform-origin:top left;transform-origin:top left;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}100%{-webkit-transform:translateY(700px);-ms-transform:translateY(700px);transform:translateY(700px);opacity:0}}@-webkit-keyframes rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0) rotate(0deg)}}@keyframes rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);-ms-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0) rotate(0deg);-ms-transform:translateX(0) rotate(0deg);transform:translateX(0) rotate(0deg)}}@-webkit-keyframes rollOut{0%{opacity:1;-webkit-transform:translateX(0) rotate(0deg)}100%{opacity:0;-webkit-transform:translateX(100%) rotate(120deg)}}@keyframes rollOut{0%{opacity:1;-webkit-transform:translateX(0) rotate(0deg);-ms-transform:translateX(0) rotate(0deg);transform:translateX(0) rotate(0deg)}100%{opacity:0;-webkit-transform:translateX(100%) rotate(120deg);-ms-transform:translateX(100%) rotate(120deg);transform:translateX(100%) rotate(120deg)}}@-webkit-keyframes lightSpeedIn{0%{-webkit-transform:translateX(100%) skewX(-30deg);opacity:0}60%{-webkit-transform:translateX(-20%) skewX(30deg);opacity:1}80%{-webkit-transform:translateX(0) skewX(-15deg);opacity:1}100%{-webkit-transform:translateX(0) skewX(0deg);opacity:1}}@keyframes lightSpeedIn{0%{-webkit-transform:translateX(100%) skewX(-30deg);-ms-transform:translateX(100%) skewX(-30deg);transform:translateX(100%) skewX(-30deg);opacity:0}60%{-webkit-transform:translateX(-20%) skewX(30deg);-ms-transform:translateX(-20%) skewX(30deg);transform:translateX(-20%) skewX(30deg);opacity:1}80%{-webkit-transform:translateX(0) skewX(-15deg);-ms-transform:translateX(0) skewX(-15deg);transform:translateX(0) skewX(-15deg);opacity:1}100%{-webkit-transform:translateX(0) skewX(0deg);-ms-transform:translateX(0) skewX(0deg);transform:translateX(0) skewX(0deg);opacity:1}}@-webkit-keyframes lightSpeedOut{0%{-webkit-transform:translateX(0) skewX(0deg);opacity:1}100%{-webkit-transform:translateX(100%) skewX(-30deg);opacity:0}}@keyframes lightSpeedOut{0%{-webkit-transform:translateX(0) skewX(0deg);-ms-transform:translateX(0) skewX(0deg);transform:translateX(0) skewX(0deg);opacity:1}100%{-webkit-transform:translateX(100%) skewX(-30deg);-ms-transform:translateX(100%) skewX(-30deg);transform:translateX(100%) skewX(-30deg);opacity:0}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg)}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg)}100%{-ms-transform:rotate(359deg)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);-ms-transform:rotate(359deg);transform:rotate(359deg)}}@-webkit-keyframes loading{0%{background-position:0 -400px}100%{background-position:-7px -400px}}@-ms-keyframes loading{0%{background-position:0 -400px}100%{background-position:-7px -400px}}@keyframes loading{0%{background-position:0 -400px}100%{background-position:-7px -400px}}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-webkit-keyframes pace-spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-ms-keyframes pace-spinner{0%{-ms-transform:rotate(0deg);transform:rotate(0deg)}100%{-ms-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes pace-spinner{0%{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg)}}.animated{-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-fill-mode:both;animation-fill-mode:both}.animated.fast{-webkit-animation-duration:.4s;-ms-animation-duration:.4s;animation-duration:.4s}.animated.hinge{-webkit-animation-duration:2s;animation-duration:2s}.animated.flash{-webkit-animation-name:flash;animation-name:flash}.animated.shake{-webkit-animation-name:shake;animation-name:shake}.animated.bounce{-webkit-animation-name:bounce;animation-name:bounce}.animated.tada{-webkit-animation-name:tada;animation-name:tada}.animated.swing{-webkit-transform-origin:top center;-ms-transform-origin:top center;transform-origin:top center;-webkit-animation-name:swing;animation-name:swing}.animated.wobble{-webkit-animation-name:wobble;animation-name:wobble}.animated.pulse{-webkit-animation-name:pulse;animation-name:pulse}.animated.flip{-webkit-backface-visibility:visible!important;-webkit-animation-name:flip;-ms-backface-visibility:visible!important;backface-visibility:visible!important;animation-name:flip}.animated.flipInX{-webkit-backface-visibility:visible!important;-webkit-animation-name:flipInX;-ms-backface-visibility:visible!important;backface-visibility:visible!important;animation-name:flipInX}.animated.flipOutX{-webkit-animation-name:flipOutX;-webkit-backface-visibility:visible!important;animation-name:flipOutX;-ms-backface-visibility:visible!important;backface-visibility:visible!important}.animated.flipInY{-webkit-backface-visibility:visible!important;-webkit-animation-name:flipInY;-ms-backface-visibility:visible!important;backface-visibility:visible!important;animation-name:flipInY}.animated.flipOutY{-webkit-backface-visibility:visible!important;-webkit-animation-name:flipOutY;-ms-backface-visibility:visible!important;backface-visibility:visible!important;animation-name:flipOutY}.animated.fadeIn{-webkit-animation-name:fadeIn;animation-name:fadeIn}.animated.fadeInUp{-webkit-animation-name:fadeInUp;animation-name:fadeInUp}.animated.fadeInDown{-webkit-animation-name:fadeInDown;animation-name:fadeInDown}.animated.fadeInLeft{-webkit-animation-name:fadeInLeft;animation-name:fadeInLeft}.animated.fadeInRight{-webkit-animation-name:fadeInRight;animation-name:fadeInRight}.animated.fadeInUpBig{-webkit-animation-name:fadeInUpBig;animation-name:fadeInUpBig}.animated.fadeInDownBig{-webkit-animation-name:fadeInDownBig;animation-name:fadeInDownBig}.animated.fadeInLeftBig{-webkit-animation-name:fadeInLeftBig;animation-name:fadeInLeftBig}.animated.fadeInRightBig{-webkit-animation-name:fadeInRightBig;animation-name:fadeInRightBig}.animated.fadeOut{-webkit-animation-name:fadeOut;animation-name:fadeOut}.animated.fadeOutUp{-webkit-animation-name:fadeOutUp;animation-name:fadeOutUp}.animated.fadeOutDown{-webkit-animation-name:fadeOutDown;animation-name:fadeOutDown}.animated.fadeOutLeft{-webkit-animation-name:fadeOutLeft;animation-name:fadeOutLeft}.animated.fadeOutRight{-webkit-animation-name:fadeOutRight;animation-name:fadeOutRight}.animated.fadeOutUpBig{-webkit-animation-name:fadeOutUpBig;animation-name:fadeOutUpBig}.animated.fadeOutDownBig{-webkit-animation-name:fadeOutDownBig;animation-name:fadeOutDownBig}.animated.fadeOutLeftBig{-webkit-animation-name:fadeOutLeftBig;animation-name:fadeOutLeftBig}.animated.fadeOutRightBig{-webkit-animation-name:fadeOutRightBig;animation-name:fadeOutRightBig}.animated.bounceIn{-webkit-animation-name:bounceIn;animation-name:bounceIn}.animated.slideInDown{-webkit-animation-name:slideInDown;animation-name:slideInDown}.animated.slideInLeft{-webkit-animation-name:slideInLeft;animation-name:slideInLeft}.animated.slideInRight{-webkit-animation-name:slideInRight;animation-name:slideInRight}.animated.slideOutLeft{-webkit-animation-name:slideOutLeft;animation-name:slideOutLeft}.animated.slideOutRight{-webkit-animation-name:slideOutRight;animation-name:slideOutRight}.animated.slideOutUp{-webkit-animation-name:slideOutUp;animation-name:slideOutUp}.animated.bounceInUp{-webkit-animation-name:bounceInUp;animation-name:bounceInUp}.animated.bounceInDown{-webkit-animation-name:bounceInDown;animation-name:bounceInDown}.animated.bounceInLeft{-webkit-animation-name:bounceInLeft;animation-name:bounceInLeft}.animated.bounceInRight{-webkit-animation-name:bounceInRight;animation-name:bounceInRight}.animated.bounceOut{-webkit-animation-name:bounceOut;animation-name:bounceOut}.animated.bounceOutUp{-webkit-animation-name:bounceOutUp;animation-name:bounceOutUp}.animated.bounceOutDown{-webkit-animation-name:bounceOutDown;animation-name:bounceOutDown}.animated.bounceOutLeft{-webkit-animation-name:bounceOutLeft;animation-name:bounceOutLeft}.animated.bounceOutRight{-webkit-animation-name:bounceOutRight;animation-name:bounceOutRight}.animated.rotateIn{-webkit-animation-name:rotateIn;animation-name:rotateIn}.animated.rotateInUpLeft{-webkit-animation-name:rotateInUpLeft;animation-name:rotateInUpLeft}.animated.rotateInDownLeft{-webkit-animation-name:rotateInDownLeft;animation-name:rotateInDownLeft}.animated.rotateInUpRight{-webkit-animation-name:rotateInUpRight;animation-name:rotateInUpRight}.animated.rotateInDownRight{-webkit-animation-name:rotateInDownRight;animation-name:rotateInDownRight}.animated.rotateOut{-webkit-animation-name:rotateOut;animation-name:rotateOut}.animated.rotateOutUpLeft{-webkit-animation-name:rotateOutUpLeft;animation-name:rotateOutUpLeft}.animated.rotateOutDownLeft{-webkit-animation-name:rotateOutDownLeft;animation-name:rotateOutDownLeft}.animated.rotateOutUpRight{-webkit-animation-name:rotateOutUpRight;animation-name:rotateOutUpRight}.animated.rotateOutDownRight{-webkit-animation-name:rotateOutDownRight;animation-name:rotateOutDownRight}.animated.rollIn{-webkit-animation-name:rollIn;animation-name:rollIn}.animated.rollOut{-webkit-animation-name:rollOut;animation-name:rollOut}.animated.lightSpeedIn{-webkit-animation-name:lightSpeedIn;animation-name:lightSpeedIn;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out;-webkit-animation-duration:.5s;animation-duration:.5s}.animated.lightSpeedOut{-webkit-animation-name:lightSpeedOut;animation-name:lightSpeedOut;-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in;-webkit-animation-duration:.25s;animation-duration:.25s}.animated.fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}[class*=" bg-"],[class^=bg-]{-webkit-filter:none!important;filter:none!important}.square{display:block;float:left;margin-right:10px;height:20px;width:20px}.fa-stack-1em{width:1em!important;height:1em!important;line-height:1em!important}.icon-color-good{color:#40ac2b}.icon-color-bad{color:#ed1c24}.percent-sign:after{content:" %";line-height:normal}.degree-sign:after{content:" °F";line-height:normal}.ui-state-default .ui-icon[class*=" icon-"]{background:0;margin-left:-12px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-e:before{content:"\f105";font-family:FontAwesome;font-size:14px;display:inline}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-first,.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-button-icon-primary.ui-icon[class*=" icon-"]:before,.ui-button-icon-primary.ui-icon[class^=icon-]:before,.ui-button-icon-secondary.ui-icon[class*=" icon-"]:before,.ui-button-icon-secondary.ui-icon[class^=icon-]:before{font-size:inherit;margin-left:7px!important;margin-left:5px;display:inline;text-decoration:inherit;color:inherit}@font-face{font-family:'Ubuntu';src:url('./fonts/Ubuntu-C.eot');src:url('./fonts/Ubuntu-C.eot?#iefix') format('embedded-opentype'),url('./fonts/Ubuntu-C.woff') format('woff'),url('./fonts/Ubuntu-C.ttf') format('truetype'),url('./fonts/Ubuntu-C.svg') format('svg');font-weight:normal;font-style:normal}@font-face{font-family:'Ubuntu-Light';src:url('./fonts/Ubuntu-L.eot');src:url('./fonts/Ubuntu-L.eot?#iefix') format('embedded-opentype'),url('./fonts/Ubuntu-L.woff') format('woff'),url('./fonts/Ubuntu-L.ttf') format('truetype'),url('./fonts/Ubuntu-L.svg') format('svg');font-weight:normal;font-style:normal}@font-face{font-family:'Ubuntu-Bold';src:url('./fonts/Ubuntu-B.eot');src:url('./fonts/Ubuntu-B.eot?#iefix') format('embedded-opentype'),url('./fonts/Ubuntu-B.woff') format('woff'),url('./fonts/Ubuntu-B.ttf') format('truetype'),url('./fonts/Ubuntu-B.svg') format('svg');font-weight:bold;font-style:normal}html,body{font-family:Ubuntu,Arial,Helvetica,sans-serif}a:active,a:focus,a:hover,button,button:active,button:focus,embed,input::-moz-focus-inner,object{outline:0}.hidden{display:none}.hidden-desktop{display:none!important}.no-visible{visibility:hidden!important}.pull-right{float:right!Important}.pull-left{float:left!Important}.align-top{vertical-align:top!important}.align-base{vertical-align:baseline!important}.opacity-25{opacity:.25!important}.opacity-50{opacity:.5!important}.opacity-75{opacity:.75!important}.opacity-100,.opaque{opacity:1!important}.disabled{color:#fff}.btn-default.disabled{color:#999}xmp{overflow:auto}.text-italic{font-style:italic!important}.text-dashed{text-decoration:line-through}.nowrap{white-space:nowrap}.truncated{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.no-space{margin:0}.no-space>[class*=col-]{margin:0!important;padding-right:0;padding-left:0}.no-margin{margin:0!important}.no-x-margin{margin-left:0!important;margin-right:0!important}.no-y-margin{margin-top:0!important;margin-bottom:0!important}.margin-2{margin:2px!important}.margin-5{margin:5px!important}.margin-10{margin:10px!important}.margin-20{margin:20px!important}.margin-x-2{margin-left:2px!important;margin-right:2px!important}.margin-x-5{margin-left:5px!important;margin-right:5px!important}.margin-x-10{margin-left:10px!important;margin-right:10px!important}.margin-x-20{margin-left:20px!important;margin-right:20px!important}.margin-y-2{margin-top:2px!important;margin-bottom:2px!important}.margin-y-5{margin-top:5px!important;margin-bottom:5px!important}.margin-y-10{margin-top:10px!important;margin-bottom:10px!important}.margin-y-20{margin-top:20px!important;margin-bottom:20px!important}.margin-top-0{margin-top:0!important}.margin-top-2{margin-top:2px!important}.margin-top-5{margin-top:5px!important}.margin-top-10{margin-top:10px!important}.margin-top-20{margin-top:20px!important}.margin-bottom-0{margin-bottom:0!important}.margin-bottom-2{margin-bottom:2px!important}.margin-bottom-5{margin-bottom:5px!important}.margin-bottom-10{margin-bottom:10px!important}.margin-bottom-20{margin-bottom:20px!important}.margin-left-0{margin-left:0!important}.margin-left-2{margin-left:2px!important}.margin-left-5{margin-left:5px!important}.margin-left-10{margin-left:10px!important}.margin-left-20{margin-left:20px!important}.margin-right-0{margin-right:0!important}.margin-right-2{margin-right:2px!important}.margin-right-5{margin-right:5px!important}.margin-right-10{margin-right:10px!important}.margin-right-20{margin-right:20px!important}.shift-topleft-2{margin-top:-2px!important;margin-left:-2px!important}.shift-topleft-4{margin-top:-4px!important;margin-left:-4px!important}.shift-topright-2{margin-top:-2px!important;margin-right:-2px!important}.shift-topright-4{margin-top:-4px!important;margin-right:-4px!important}.shift-bottomleft-2{margin-bottom:-2px!important;margin-left:-2px!important}.shift-bottomleft-4{margin-bottom:-4px!important;margin-left:-4px!important}.shift-bottomright-2{margin-bottom:-2px!important;margin-right:-2px!important}.shift-bottomright-4{margin-bottom:-4px!important;margin-right:-4px!important}.bordered{border:1px solid #ccc}.bordered:hover{border:1px solid #bbb}.bordered.nohover:hover{border-color:#ccc}.no-border,.well[class*=" bg-"].no-border{border-width:0!important}.no-border-transparent{border-color:transparent!important}.no-border-radius{border-radius:0}.border-0{border-width:0!important}.border-1{border-width:1px!important}.radius-4{border-radius:4px!important}.radius-top-4{border-top-left-radius:4px!important;border-top-right-radius:4px!important}.radius-bottom-4{border-bottom-left-radius:4px!important;border-bottom-right-radius:4px!important}.radius-left-4{border-top-left-radius:4px!important;border-bottom-left-radius:4px!important}.radius-right-4{border-top-right-radius:4px!important;border-bottom-right-radius:4px!important}.width-100{width:100px;max-width:100px}.width-200{width:200px;max-width:200px}.width-300{width:300px;max-width:300px}.width-400{width:400px;max-width:400px}.width-500{width:500px;max-width:500px}.padding-5{padding:5px!important}.padding-7{padding:7px!important}.padding-10{padding:10px!important}.padding-20{padding:20px!important}.padding-x-0{padding-left:0!important;padding-right:0!important}.padding-x-5{padding-left:5px!important;padding-right:5px!important}.padding-x-10{padding-left:10px!important;padding-right:10px!important}.padding-x-20{padding-left:20px!important;padding-right:20px!important}.padding-y-0{padding-top:0!important;padding-bottom:0!important}.padding-y-5{padding-top:5px!important;padding-bottom:5px!important}.padding-y-10{padding-top:10px!important;padding-bottom:10px!important}.padding-y-20{padding-top:20px!important;padding-bottom:20px!important}.padding-top-0{padding-top:0!important}.padding-top-5{padding-top:5px!important}.padding-top-10{padding-top:10px!important}.padding-top-20{padding-top:20px!important}.padding-bottom-0{padding-bottom:0!important}.padding-bottom-5{padding-bottom:5px!important}.padding-bottom-10{padding-bottom:10px!important}.padding-bottom-20{padding-bottom:20px!important}.padding-left-0{padding-left:0!important}.padding-left-5{padding-left:5px!important}.padding-left-10{padding-left:10px!important}.padding-left-20{padding-left:20px!important}.padding-right-0{padding-right:0!important}.padding-right-5{padding-right:5px!important}.padding-right-10{padding-right:10px!important}.padding-right-20{padding-right:20px!important}.no-padding{padding:0!important}.no-padding .md-editor,.widget-body.no-padding .cke_chrome{border:0}.no-padding>pre{margin:30px}.no-padding .dataTables_wrapper table,.no-padding>table{border:0!important;margin-bottom:0!important}.no-padding .dataTables_wrapper table tr td:first-child,.no-padding>table tr td:first-child,.no-padding .dataTables_wrapper table tr th:first-child,.no-padding>table tr th:first-child{border-left:0!important}.no-padding .dataTables_wrapper table tr td:last-child,.no-padding>table tr td:last-child,.no-padding .dataTables_wrapper table tr th:last-child,.no-padding>table tr th:last-child{border-right:0!important}.no-padding .dataTables_wrapper table tr:last-child td,.no-padding>table tr:last-child td{border-bottom:0}.no-padding-bottom{padding-bottom:0!important}.no-x-padding{padding-left:0!important;padding-right:0!important}.no-y-padding{padding-top:0!important;padding-bottom:0!important}.no-content-padding{margin:-10px -14px 0 -14px}@media(min-width:768px) and (max-width:880px){.no-content-padding{margin:0 -14px!important}}@media(max-width:767px){.no-content-padding{margin:0 -5px!important}}@media only screen and (min-width:0) and (max-width:679px){.no-content-padding{margin:0 -5px!important}}@media only screen and (min-width:320px) and (max-width:479px){.no-content-padding{margin:0 -5px!important}}.no-height{line-height:0}.clearfix,.inner-space:after{zoom:1}.clearfix:after,.inner-space:after{clear:both}.clearfix:after,.inner-space:after,.clearfix:before,.inner-space:before{display:block;visibility:hidden;overflow:hidden;content:"\0020";height:0;font-size:0;line-height:0}.display-inline{display:inline-block!important}.display-normal{display:inline!important}.hover-transparent{opacity:.5}.hover-transparent:hover{opacity:1}.row-seperator-header{margin:15px 14px 20px;border-bottom:0;display:block;color:#646464;font-size:20px;font-weight:400}.text-align-center,.text-center{text-align:center!important}.text-align-left,.text-left{text-align:left!important}.text-align-right,.text-right{text-align:right!important}.center-canvas,.center-child-canvas>canvas{display:block!important;margin:0 auto!important}.semi-bold{font-weight:400!important}.bold{font-weight:900!important}.ultra-light{font-weight:300!important}.font-xs{font-size:85%!important}.font-sm{font-size:95%!important}.font-md{font-size:130%!important}.font-lg{font-size:160%!important}.font-xl{font-size:200%!important}.font-400{font-size:400%!important}.badge{font-size:11px;padding:4px 6px 1px}.label{padding:.3em .6em .1em}.cursor-pointer{cursor:pointer}.selected{border:1px solid #0091d9!important}tr.selected{background-color:#dcebff}.selected:before{display:block;position:absolute;content:"\f00c";color:#fff;right:4px;font-family:FontAwesome;z-index:1002}tr.selected:before{display:none}.selected:after{width:0;height:0;border-top:35px solid #0091d9;border-left:35px solid rgba(0,0,0,0);position:absolute;display:block;right:0;content:".";top:0;z-index:1001}tr.selected:after{display:none}html{margin:0;padding:0;height:100%;overflow-x:hidden!important;background-color:#e5e2cf}body{margin:0;padding:0;height:100%;overflow:hidden;background-color:#e5e2cf;direction:ltr}body.container{position:relative;padding:0;border-left:1px solid #bfbfbf;border-right:1px solid #bfbfbf;-webkit-box-shadow:0 2px 70px rgba(0,0,0,0.45);box-shadow:0 2px 70px rgba(0,0,0,0.45)}body.nooverflow{position:fixed;overflow:hidden;width:100%}#main{display:block;margin-left:220px;padding:0;min-height:500px;-webkit-transition:all .1s ease-out;transition:all .1s ease-out}@media(max-width:979px){#main{margin-left:0}}#content{padding:10px;position:relative;left:0;-webkit-transition:left .1s ease-out;transition:left .1s ease-out}@media(max-width:767px){#content{padding-left:5px;padding-right:5px}}.page-title{margin:12px 0 15px}.page-title a:hover,.page-title a:active{text-decoration:none}.page-title span{font-size:16px;color:#333;display:inline-block;vertical-align:1px}.page-title span i{padding:0 5px}aside{display:block;width:220px;overflow:hidden;min-height:100%}aside,aside nav li.divider{background:#829db0}#header{display:block;height:49px;position:relative;margin:0;padding:0 13px 0 0;background-color:#f3f3f3;background-image:-webkit-gradient(linear,0 0,0 100%,from(#f3f3f3),to(#e2e2e2));background-image:-webkit-gradient(linear,top left,bottom left,from(#f3f3f3),to(#e2e2e2));background-image:-webkit-linear-gradient(top,#f3f3f3,#e2e2e2);background-image:linear-gradient(to bottom,#f3f3f3,#e2e2e2);background-repeat:repeat-x}@media(max-width:767px){#header{padding-right:5px}}@media only screen and (max-width:679px){#header{padding-right:5px;background:#fff}}#header>div{display:inline-block;vertical-align:middle;height:49px;float:left}#header>div.open{font-weight:700}.fixed-header #header{position:fixed;width:100%;z-index:1001}.container.fixed-header #header{max-width:1164px}.fixed-header #header .ajax-dropdown{z-index:1000}.fixed-header #shortcut{position:fixed}.fixed-header #main{margin-top:49px}#top-links>div{display:inline-block;float:left}@media(min-width:768px) and (max-width:1089px){#top-links>div{display:none}#top-links>div:first-child{display:inline-block}}@media(max-width:767px){#top-links>div{display:none}}.top-menu{display:inline-block;padding:7px 13px 0;position:relative}@media(max-width:767px){.top-menu{display:none}}.top-menu>span{display:block}.top-menu>:first-child{display:block;color:#bfbfbf;font-size:10px;font-weight:700;text-transform:uppercase;text-shadow:0 0 1px #fff;padding-left:0;text-align:left}.top-tabs{display:inline-block;padding:7px 13px 0;position:relative}.top-tabs>span{display:block}.top-tabs>:first-child{display:block;color:#bfbfbf;font-size:10px;font-weight:700;text-transform:uppercase;text-shadow:0 0 1px #fff;padding-left:5px;text-align:left}.top-tabs .nav-tabs li a{padding:2px 10px 3px!important;border-color:#ccc #ccc transparent;box-shadow:0 -2px 3px #ccc;margin-top:3px!important}.top-tabs .nav-tabs li.active a{margin-top:3px!important;padding:2px 10px 3px!important}.top-selector{max-width:97%;white-space:nowrap;background:0;border:0;padding:0;text-align:left;color:#555;font-size:14px;cursor:pointer}.top-selector:hover{color:#333}@media(max-width:979px){#login-info{display:none}}#login-info>span{display:inline-block;height:39px;float:left}#login-info>span .badge{position:absolute;top:-5px;right:-9px;cursor:pointer;background:#0091d9;display:inline-block;font-size:10px;-webkit-box-shadow:inset 1px 1px 0 rgba(0,0,0,0.1),inset 0 -1px 0 rgba(0,0,0,0.07);box-shadow:inset 1px 1px 0 rgba(0,0,0,0.1),inset 0 -1px 0 rgba(0,0,0,0.07);color:#fff;font-weight:700;border-radius:50%;padding:3px;text-align:center;line-height:normal}#login-info span#activity{border-radius:2px;cursor:default!important;display:inline-block;font-weight:700;height:24px;width:24px;padding:2px;text-align:center;text-decoration:none!important;-moz-user-select:none;-webkit-user-select:none;background-color:#f8f8f8;background-image:-webkit-gradient(linear,left top,left bottom,from(#f8f8f8),to(#f1f1f1));background-image:-webkit-gradient(linear,top left,bottom left,from(#f8f8f8),to(#f1f1f1));background-image:-webkit-linear-gradient(top,#f8f8f8,#f1f1f1);background-image:linear-gradient(top,#f8f8f8,#f1f1f1);border:1px solid #bfbfbf;color:#c4bab6;font-size:19px;margin:5px 0 0;position:relative}#login-info span#activity:hover{border:1px solid #bfbfbf;-webkit-transition:all 0s;transition:all 0s;cursor:pointer!important;-webkit-box-shadow:inset 0 0 4px 1px rgba(0,0,0,0.08);box-shadow:inset 0 0 4px 1px rgba(0,0,0,0.08)}.authomatic{display:inline-block;width:21px;height:21px;margin:2px 0!important;padding:3px!important;text-align:center}.authomatic:hover{background-color:#ccc;border-radius:3px}#logo{display:inline-block;width:175px;margin-top:7px;margin-left:9px}@media(min-width:768px) and (max-width:880px){#logo{margin-top:10px}}@media(max-width:767px){#logo{margin-top:10px;margin-left:4px}}@media only screen and (min-width:0) and (max-width:679px){#logo{margin-top:10px;margin-left:4px}}@media only screen and (min-width:320px) and (max-width:479px){#logo{width:135px;margin-top:10px;margin-left:4px}}#logo img{max-width:175px;max-height:36px;padding-left:3px}#logo-group{width:220px}@media only screen and (min-width:480px) and (max-width:1089px){#logo-group{width:175px}}@media only screen and (min-width:320px) and (max-width:479px){#logo-group{width:169px!important}}.uv-icon{position:absolute!important;left:155px!important;top:5px!important;z-index:500!important}@media only screen and (min-width:0) and (max-width:1089px){.uv-icon{left:130px!important}}#activity.active .badge{background:#006fa6!important}.header-search{position:relative}@media(max-width:767px){.header-search{display:none}}.header-search.pull-right{margin-left:6px}@media(max-width:979px){.header-search.pull-right{margin-left:0}}.header-search>input[type=text]{display:block;-webkit-box-sizing:border-box;box-sizing:border-box;-moz-box-sizing:border-box;min-width:200px;width:100%;height:30px;padding:0 10px;outline:0;border-width:1px;border-style:solid;border-radius:0;border-color:#bfbfbf;background:#fff;color:#404040;appearance:normal;-moz-appearance:none;-webkit-appearance:none;margin-top:10px;line-height:normal}@media(min-width:768px) and (max-width:979px){.header-search>input[type=text]{margin-top:9px}}.header-search>button{background:0;border:0;color:#6d6a69;font-size:17px;height:30px;line-height:30px;margin:0;padding:0;position:absolute;right:0;top:10px;width:30px;z-index:2}#search-mobile{display:none}@media(max-width:767px){#search-mobile{display:block}}@media only screen and (min-width:0) and (max-width:679px){#search-mobile{display:block}}@media only screen and (min-width:320px) and (max-width:479px){#search-mobile{margin-left:0}}@media(max-width:767px){.search-mobile .header-search{display:block;position:absolute;top:0;width:100%;height:49px;background:#333;padding:0 2px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;left:0}.search-mobile .header-search>input[type=text]{margin-top:2px;height:45px;border-color:#333;padding-right:75px}.search-mobile .header-search>button{height:29px;line-height:29px;background:#DDD;right:44px}.search-mobile #search-mobile{display:none}.search-mobile #cancel-search-js{display:block}}#cancel-search-js{position:absolute;display:none;background:#a90329;z-index:3;color:#fff;padding:0;right:10px;top:10px;text-align:center;height:29px;line-height:29px;width:30px;font-size:17px;text-decoration:none!important}#left-panel{position:absolute;top:49px;left:0;z-index:1002;-webkit-transition:left .1s ease-out;transition:left .1s ease-out}@media(max-width:979px){#left-panel{left:-220px}}.fixed-navigation #left-panel{position:fixed;z-index:998}@media(max-width:767px){.fixed-navigation #left-panel{position:absolute!important}}#left-panel #ajax-gear{position:absolute;left:calc(49%);top:5px}#left-panel .version{position:absolute;bottom:2px;width:100%;text-align:center;font-size:11px;color:#333}#ribbon{height:40px;background:#6f8696;padding:0 40px 0 13px;position:relative}@media(max-width:767px){#ribbon{padding-left:5px;padding-right:5px}}@media only screen and (min-width:0) and (max-width:679px){#ribbon{border-bottom:1px solid #cfcfcf;border-top:1px solid #e6e6e6;background:#f5f5f5}}#ribbon .breadcrumb{display:inline-block;margin:0;padding:12px 34px 10px 0!important;background:0;vertical-align:top}#ribbon .breadcrumb,#ribbon .breadcrumb a{color:#ddd!important;text-decoration:none!Important}@media only screen and (min-width:0) and (max-width:679px){#ribbon .breadcrumb,#ribbon .breadcrumb a{color:#6d6c6c!important}}#ribbon .breadcrumb>li+li:before{padding:0 1px 0 5px}#ribbon .breadcrumb li:last-child,#ribbon .breadcrumb>.active{color:#eee}@media only screen and (min-width:0) and (max-width:679px){#ribbon .breadcrumb li:last-child,#ribbon .breadcrumb>.active{color:#333!important}}.fixed-ribbon #ribbon{position:fixed;right:0;left:220px;top:49px;z-index:999}@media(max-width:979px){.fixed-ribbon #ribbon{left:0}}.container.fixed-ribbon #ribbon{width:944px;left:590px}.fixed-ribbon #content{padding-top:50px}@media(max-width:767px){.fixed-ribbon #content{padding-top:52px}}.minified.fixed-ribbon #ribbon{left:45px}.hidden-menu.fixed-ribbon #ribbon{left:10px}@media(max-width:979px){.hidden-menu.fixed-ribbon #ribbon{left:220px}}.hidden-ribbon #ribbon{height:1px;min-height:1px;max-height:1px}.hidden-ribbon #ribbon>*{display:none}.ribbon{position:absolute;right:9px;top:-4px}.header-dropdown-list{list-style:none;float:right;position:relative;margin:0;padding-left:10px}.header-dropdown-list>li{display:inline-block;padding-right:5px}.header-dropdown-list>li>.dropdown-toggle{margin-top:16px;display:block}.smart-accordion-default.panel-group .panel+.panel{margin-top:-1px}.smart-accordion-default.panel-group .panel-heading{padding:0}.smart-accordion-default.panel-group .panel-title a{display:block;padding:10px 15px;text-decoration:none!important}.smart-accordion-default .panel-group .panel,.smart-accordion-default .panel-heading{border-radius:0}.smart-accordion-default .panel-default{border-color:#c3c3c3}.smart-accordion-default .panel-default>.panel-heading{background-color:#fcfcfc}.smart-accordion-default .panel-title>a.collapsed>.fa,.smart-accordion-default .panel-title>a>:first-child{display:none}.smart-accordion-default .panel-title>a.collapsed>:first-child{display:inline-block}.no-padding .smart-accordion-default>div{border-left:0!important;border-right:0!important}.no-padding .smart-accordion-default>div:first-child{border-top:0!important}.no-padding .smart-accordion-default>div:last-child{border-bottom:0!important}#logo-group *,.login-info,.login-info *,.minified .menu-item-parent{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.login-info{display:block;font-size:12px;height:39px;color:#333;border:solid transparent;margin:2px 0 0 10px!important;float:right}.login-info a,.login-info strong{text-transform:capitalize;font-size:14px;display:inline-block;color:#333;text-decoration:none;margin-left:5px}.login-info a:hover,.login-info strong{color:#666}.login-info a.btn{margin-top:5px}.login-info a.btn-danger,.login-info a.btn-success,.login-info a.btn-primary{color:#dedede}.login-info span{display:inline-block;padding:0 0 0 10px}.login-info span a.btn-success{margin-top:-10px}.login-info img{width:25px;height:auto;display:inline-block;vertical-align:middle;margin-top:-3px;margin-right:7px;margin-left:0;border-left:3px solid #fff}.minifyme{border-bottom:1px solid #302f2f;background:#454545;color:#a8a8a8;text-align:center;padding:1px 0 0;width:36px;height:28px;display:block;position:absolute;right:-3px;border-radius:5px 0 0 5px;cursor:pointer;margin-top:5px;font-size:19px;-webkit-transition:all .1s linear 0s;transition:all .1s linear 0s}.minifyme:hover{background:#646464;color:#e4e4e4;right:0}.minified .minifyme{right:0;color:#a8a8a8;position:relative;width:100%;border-radius:0;margin:0;height:32px;font-size:23px}.minified .minifyme .fa:before{content:"\f0a9"}.minified #left-panel{width:45px;overflow:visible}@media(max-width:979px){.minified #left-panel{left:0}}.minified #main{margin-left:45px}.minified #left-panel>ul>li,.minified nav>ul>li{overflow:visible}.minified #left-panel>ul>li>ul::before,.minified nav>ul>li>ul::before{border-left:0}.minified #left-panel>ul>li,.minified nav>ul>li,.minified #left-panel>ul>li a,.minified nav>ul>li a{position:relative}.minified #left-panel ul>li>a,.minified nav ul>li>a{padding:12px 11px 10px;display:block}.minified #left-panel>ul>li>a .fa.fa-fw,.minified nav>ul>li>a .fa.fa-fw{display:block;width:auto;text-align:center;padding:0}.minified #left-panel>ul>li>a>i,.minified nav>ul>li>a>i{text-align:center;margin:0;display:block}.minified #left-panel>ul>li.active>a::before,.minified nav>ul>li.active>a::before{content:"\f0d9"}.minified #left-panel ul ul li a,.minified nav ul ul li a{padding-top:5px;padding-bottom:5px;padding-left:14px}.minified #left-panel ul ul li li a,.minified nav ul ul li li a{padding-left:25px}.minified #left-panel>ul ul li::before,.minified nav>ul ul li::before,.minified #left-panel>ul>li>ul::before,.minified nav>ul>li>ul::before{left:12px}.minified #left-panel>ul>li>a .menu-item-parent,.minified nav>ul>li>a .menu-item-parent,.minified #left-panel>ul>li>a>b,.minified nav>ul>li>a>b{display:none}.minified #left-panel>ul>li>a>.menu-item-parent,.minified nav>ul>li>a>.menu-item-parent{display:none;position:absolute;left:40px;top:-3px;width:186px;height:36px;line-height:38px;background-color:#f5f5f5;color:#333;z-index:3;-webkit-box-shadow:2px 1px 2px 0 rgba(0,0,0,0.2);box-shadow:2px 1px 2px 0 rgba(0,0,0,0.2);border-left:1px solid #bfbfbf;border-top:1px solid #d8d4d4;border-bottom:1px solid #fff;padding-left:12px}.minified #left-panel>ul>li>ul,.minified nav>ul>li>ul{display:none!important;position:absolute;left:40px;width:200px;z-index:5;border:1px solid #bfbfbf;min-height:180px;-webkit-box-shadow:1px 1px 2px 0 rgba(0,0,0,0.2);box-shadow:1px 1px 2px 0 rgba(0,0,0,0.2);background:#627685;margin-top:-3px}.minified #left-panel ul>li>ul>li>ul,.minified nav ul>li>ul>li>ul{position:relative;left:13px;border:0;margin-left:-12px;width:197px}.minified #left-panel>ul>li:hover>a>.menu-item-parent,.minified nav>ul>li:hover>a>.menu-item-parent,.minified #left-panel>ul>li:hover>ul,.minified nav>ul>li:hover>ul{display:block!important}.minified #left-panel>ul>li>ul>li,.minified nav>ul>li>ul>li{background-color:rgba(91,103,113,0.8)}.minified #left-panel>ul>li>ul>li>ul>li,.minified nav>ul>li>ul>li>ul>li{background-color:#627685}.minified #left-panel>ul>li>ul>li>a,.minified nav>ul>li>ul>li>a,.minified #left-panel>ul>li>ul>li>ul>li>a,.minified nav>ul>li>ul>li>ul>li>a{padding-top:7px;padding-bottom:7px}.minified #left-panel>ul>li>ul>li>ul>li a,.minified nav>ul>li>ul>li>ul>li a{padding-top:6px;padding-bottom:6px}.minified #left-panel>ul>ul,.minified nav>ul>ul{min-height:100px!important;max-height:180px!important;overflow-y:scroll;overflow-x:hidden;background:#ed1c24!important}.minified #left-panel>ul ul li::before,.minified nav>ul ul li::before{border:0}.minified #left-panel ul ul ul ul li a,.minified nav ul ul ul ul li a{padding-left:45px}.minified #left-panel ul ul ul ul ul li a,.minified nav ul ul ul ul ul li a{padding-left:62px}.minified #left-panel ul ul ul ul ul ul li a,.minified nav ul ul ul ul ul ul li a{padding-left:82px}.minified #left-panel .version{display:none}.minified .slimScrollDiv,.minified .slimScrollDiv>:first-child{overflow:visible!important}.minified .slimScrollBar,.minified .slimScrollRail{display:none}.slimScrollDiv,.slimScrollDiv>:first-child{overflow:hidden}@media(max-width:979px){#hide-menu i,#logout i{color:#6d6a69;font-size:100%}}@media(min-width:0) and (max-width:880px){#hide-menu i,#logout i{font-size:121%}}.hidden-menu #left-panel{left:-210px;z-index:1002}@media(max-width:979px){.hidden-menu #left-panel{left:0}}.hidden-menu #left-panel:hover{left:0}.hidden-menu #main{margin-left:10px}.minified.hidden-menu #main{margin-left:0}@media(max-width:979px){.hidden-menu #main{position:relative;left:210px}}@media(max-width:979px){.hidden-menu #hide-menu i{color:#fff}}@media(min-width:768px) and (max-width:880px){.hidden-menu #hide-menu i::before{content:"\f0c9"}}@media(max-width:767px){.hidden-menu #hide-menu i{color:#fff}.hidden-menu #hide-menu i::before{content:"\f0c9"}}.hidden-menu #hide-menu>:first-child>a{background-color:#e8e8e8;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#5a5a5a),color-stop(100%,#686868));background-image:-webkit-linear-gradient(to bottom,#5a5a5a 0,#686868 100%);background-image:-webkit-gradient(linear,top left,bottom left,from(#5a5a5a),to(#686868));background-image:-webkit-linear-gradient(top,#5a5a5a 0,#686868 100%);background-image:linear-gradient(to bottom,#5a5a5a 0,#686868 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#5A5A5A',endColorstr='#686868',GradientType=0);color:#fff;border-color:#494949;-webkit-box-shadow:inset 0 0 3px 1px rgba(0,0,0,0.15);box-shadow:inset 0 0 3px 1px rgba(0,0,0,0.15)}@media(min-width:768px) and (max-width:979px){.hidden-menu #hide-menu>:first-child>a{margin-top:9px;width:40px}}.hidden-menu #hide-menu>:first-child>a:active{-webkit-box-shadow:inset 0 0 6px 1px rgba(0,0,0,0.2);box-shadow:inset 0 0 6px 1px rgba(0,0,0,0.2)}.hidden-menu .minifyme,.minified #hide-menu{display:none}.no-menu #left-panel{left:-220px;z-index:0}.no-menu #main{margin-left:0}.no-menu #hide-menu{display:none}#shortcut{position:absolute;top:0;left:0;height:auto;width:100%;background-color:#33302f;background-color:rgba(0,0,0,0.85);z-index:1009;display:none;color:#fff;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#shortcut ul{padding:15px 20px 10px;list-style:none;margin:0;-webkit-box-shadow:0 4px 10px rgba(0,0,0,0.3);box-shadow:0 4px 10px rgba(0,0,0,0.3);border-bottom:1px solid #423f3f}#shortcut ul li{display:inline-block;width:auto}#shortcut ul li .ams-metro-tile{margin:0 3px 3px;border:0;border-radius:0}#shortcut ul li .ams-metro-tile:hover{color:#fff;text-decoration:none}#shortcut ul li .ams-metro-tile:active,#shortcut ul li .ams-metro-tile:focus{left:0;top:0}#shortcut .version{position:absolute;right:10px;bottom:10px}.shortcut-on #response-btn{display:none!important}.shortcut-on #left-bar .navbar,.shortcut-on #main .navbar{border:0!important}#sparks{display:block;list-style:none;margin:10px 0 0;padding:0;text-align:right}@media only screen and (min-width:320px) and (max-width:479px){#sparks{text-align:center;background:#e0e0e0;padding:10px 0;margin-bottom:15px}}#sparks li{display:inline-block;border-left:1px dotted #c7c7c7;padding:0 10px;max-height:47px;overflow:hidden;text-align:left;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box}@media only screen and (min-width:320px) and (max-width:479px){#sparks li{padding:0 10px 0 20px}}#sparks li:last-child{padding-right:0}#sparks li:first-child{border-left:0;padding-left:0}#sparks li h5{color:#555;float:left;font-size:11px;font-weight:400;margin:-3px 0 0 0;padding:0;border:0;text-transform:uppercase}#sparks li span{color:#636363;display:block}.sparks-info{min-width:70px}.sparks-info span{font-size:18px;line-height:20px;margin:0;text-transform:none}.sparks-info .sparkline{display:block;float:right;margin:3px 0 0 20px}#heat-fill{display:block;position:relative;margin-bottom:20px;background:#333;height:7px;width:200px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAAABCAIAAAAU3Xa1AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowMDE4MkZGMzMzOTgxMUUzODZBQUNFQUNFOTk0NEUxRiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowMDE4MkZGNDMzOTgxMUUzODZBQUNFQUNFOTk0NEUxRiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjAwMTgyRkYxMzM5ODExRTM4NkFBQ0VBQ0U5OTQ0RTFGIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjAwMTgyRkYyMzM5ODExRTM4NkFBQ0VBQ0U5OTQ0RTFGIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+rG8MDAAAAM5JREFUeNpUUtESwyAIg8ft9v8/W4ElBPWKV1AIiKEeEWVuVlWjINSVONBnirQDxukNgcuyTQsBzLHMDsLIQQw+nIL71JqNJ5GZJXApFNpmtlagQjfS2xGbkFA4Iwu+hu0sK3Wl3nOwNv7TvPrWk3X0eW9dK1pU9hK2eTuWb2ySJmlziutA3iBxmblPNvA5PNsuUpoDY80+Z0SW1IRpDEqwC58C14tsr1f8le8si0aojdADr/1UjaclsFashX8GGkL9wDxtRsV6ft/PX4ABADRzhOVIOJaAAAAAAElFTkSuQmCC)}.fill-a,.fill-b{width:20px;text-align:right;overflow:hidden;text-overflow:ellipsis;display:block;background:#fff;padding-right:4px;position:absolute;left:0;margin-top:-7px;font-weight:700}.fill-b{text-align:left;position:absolute;right:0;left:auto;top:0;width:60px;padding-left:4px;padding-right:0}.cke_top{background:rgba(248,248,248,0.9)!important;background-image:none!important}.MessageBox{width:100%;height:100%;position:fixed;top:0;left:0;background:rgba(0,0,0,0.6);z-index:100000}@media screen and (max-width:450px) and (max-width:767px){.MessageBox{width:100%;height:100%;position:fixed;top:0;left:0;background:rgba(0,0,0,0.6);z-index:100000}}.MessageBoxContainer{top:35%;color:#fff;position:relative;width:100%;background-color:#232323;background-color:rgba(0,0,0,0.8);padding:20px}@media screen and (max-width:450px) and (max-width:767px){.MessageBoxContainer{top:25%;color:#fff;position:relative;width:100%;background-color:#232323}}.MessageBoxContainer input,.MessageBoxContainer select{width:50%;padding:5px}@media screen and (max-width:450px) and (max-width:767px){.MessageBoxContainer input,.MessageBoxContainer select{width:50%;padding:5px}}.MessageBoxMiddle{position:relative;left:20%;width:60%}@media screen and (max-width:450px) and (max-width:767px){.MessageBoxMiddle{position:relative;left:0;width:100%;padding:3px}}.MessageBoxMiddle .MsgTitle{letter-spacing:-1px;font-size:24px;font-weight:300}@media screen and (max-width:450px) and (max-width:767px){.MessageBoxMiddle .MsgTitle{font-size:22px}}.MessageBoxMiddle .pText{font-style:30px}@media screen and (max-width:450px) and (max-width:767px){.MessageBoxMiddle{font-style:10px}}.MessageBoxButtonSection{width:100%;height:30px}@media screen and (max-width:450px) and (max-width:767px){.MessageBoxButtonSection{width:100%;height:30px}}.MessageBoxButtonSection button{float:right;margin-right:7px;padding-left:15px;padding-right:15px;font-size:14px;font-weight:700}@media screen and (max-width:450px) and (max-width:767px){.MessageBoxButtonSection button{float:right;margin-right:5px;padding-left:15px;padding-right:15px}}.LoadingBoxContainer{top:20%;color:#fff;position:relative;width:100%;background-color:#232323}.LoadingBoxContainer .MsgTitle{font-size:26px}.LoadingBoxContainer .pText{font-style:30px}.LoadingBoxMiddle{position:relative;left:20%;width:50%;padding:10px}#LoadingPoints{position:absolute}#divMiniIcons{position:fixed;width:415px;right:10px;bottom:180px;z-index:9999;float:right}#divMiniIcons .cajita{text-align:center;vertical-align:middle;padding:4px 6px;color:#FFF;float:right;cursor:pointer;display:block;background-color:red;font-size:17px;margin-left:4px;margin-top:5px}#divMiniIcons .cajita:active{top:1px;left:1px;position:relative}#divSmallBoxes{position:fixed;right:0;top:0;z-index:9999}@media screen and (max-width:450px) and (max-width:767px){#divSmallBoxes{position:fixed;width:90%;right:0;top:0}}.BigBox{position:fixed;right:10px;bottom:10px;background-color:#004d60;padding:10px 10px 5px;width:390px;height:150px;color:#fff;z-index:99999;box-sizing:content-box;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;border-left:5px solid rgba(0,0,0,0.15);overflow:hidden}.BigBox span{font-size:17px;font-weight:300;letter-spacing:-1px;padding:5px 0!important;display:block}.BigBox p{font-size:13px;margin-top:10px}@media screen and (max-width:450px) and (max-width:767px){.BigBox{width:88%}}.BigBox .bigboxicon{font-size:30px;text-align:left;position:absolute;top:120px;left:6px;z-index:0}.BigBox .bigboxnumber{width:100%;text-align:right;font-size:25px}.SmallBox{position:absolute;right:5px;top:20px;width:420px;color:#fff;z-index:9999;overflow:hidden;border:1px solid transparent}@media screen and (max-width:450px) and (max-width:767px){.SmallBox{width:95%}}.SmallBox:hover{border:1px solid #fff;cursor:pointer}@media screen and (max-width:450px) and (max-width:767px){.SmallBox:hover{-webkit-box-shadow:0 0 10px #888;box-shadow:0 0 10px #888;cursor:pointer}}.SmallBox .foto{font-size:30px;position:absolute;left:20px}.SmallBox .textoFull{width:93%;float:left;padding-left:20px}@media screen and (max-width:450px) and (max-width:767px){.SmallBox .textoFull{width:93%;float:left;padding-left:20px}}.SmallBox .textoFoto{width:78%;margin:3px 20px 3px 80px;float:left}@media screen and (max-width:450px) and (max-width:767px){.SmallBox .textoFoto{width:55%;margin:3px 20px 3px 80px;float:left}}.SmallBox span{font-size:17px;font-weight:300;letter-spacing:-1px;display:block;margin:4px 0}@media screen and (max-width:450px) and (max-width:767px){.SmallBox span{font-size:16px}}.SmallBox p{font-size:13px;margin-top:2px}@media screen and (max-width:450px) and (max-width:767px){.SmallBox p{font-size:12px;margin-top:2px}}.btnClose{position:absolute;right:10px;height:16px;width:15px;cursor:pointer;font-size:18px;opacity:.5;display:block;top:15px}.btnClose:hover{opacity:1}.miniPic{position:absolute;bottom:8px;right:9px}.miniIcon{height:100%;font-size:20px}nav{padding-top:40px}nav ul{width:100%;padding:40px 28px 25px 0;padding:0;margin:0;font-size:13px;line-height:.5em;list-style:none;position:relative;background-color:#627685}nav ul li{overflow:hidden}nav ul li.divider{height:20px;border:0}nav ul li.header{font-family:"Ubuntu-Light",Arial,Helvetica,sans-serif;font-size:14px;font-weight:bold;color:#eee;background-color:#b13510;border-top-color:#d44918;border-bottom-color:#a13812;padding:4px 10px 4px 20px;line-height:18px}nav ul li.header:not(:first-child){margin-top:10px}.minified #left-panel nav ul li.header{padding:5px;color:#b94015;line-height:0;max-height:10px;overflow:hidden}nav ul li a{line-height:normal;font-size:14px;padding:10px 10px 10px 11px;color:#f4e8cf;display:block;font-weight:400;text-decoration:none!important;position:relative}nav ul li a:active{background:#616161!important}nav ul li a:focus{color:#c9c9c9}nav ul li a:hover{color:#fff;text-decoration:none}nav ul li.active>a{background-color:#627685;color:#fff!important;position:relative}nav ul li.active>a:before{content:"\f0d9";font-family:FontAwesome;display:block;height:27px;line-height:14px;width:27px;position:absolute;right:-21px;font-size:20px;color:#eee}nav ul li.active.open>a:before{content:""}nav ul li.active.open>a.active:before{content:"\f0d9"}nav ul li li{border-bottom:0;position:relative}nav ul .active>a{color:#fefefe!important;position:relative}nav ul b{float:right;font-size:14px;margin-top:-1px}nav ul span.menu-item-parent{display:inline-block;margin:0;padding:0}nav ul ul{margin:0;display:none;background:rgba(91,103,113,0.8);padding:2px 0}nav ul ul>li:hover b{color:#d5d9e2}nav ul ul li{margin:0;padding:0}nav ul ul li.divider{height:1px;margin-left:30px;padding:0}nav ul ul li>a{padding-left:42px;font-size:12px;font-weight:400;outline:0}nav ul ul li>a:hover{background-color:#46545e;color:#fff}nav ul ul li>a.active{margin-left:30px;padding-left:12px;background-color:#296191}.minified nav ul ul li>a.active{margin-left:0}nav ul ul ul{background:0;padding:0}nav ul ul ul li a{color:#bfbfbf;padding:8px 10px 8px 60px;font-size:11px}nav ul ul ul li a:hover{background-color:#46545e;color:#fff}nav ul ul ul li a.active{margin-left:50px;padding-left:10px}nav ul ul ul ul li a{padding-left:90px}nav ul ul ul ul li a.active{margin-left:80px;padding-left:10px}nav ul ul ul ul ul li a{padding-left:110px}nav ul ul ul ul ul li a.active{margin-left:100px;padding-left:10px}nav ul ul ul ul ul ul li a{padding-left:130px}nav ul ul ul ul ul ul li a.active{margin-left:120px;padding-left:10px}nav ul ul b{color:#b3b3b3}nav>ul>li{border-top:1px solid #718999;border-bottom:1px solid #576975}nav>ul>li:hover>ul::before,nav>ul>li:hover>ul>li::before{border-color:#acacac!important}nav>ul>li>a>.badge.pull-right{margin-right:15px}nav>ul>li>a b{position:absolute!important;right:10px;top:10px}nav>ul>li>a>i{margin-right:5px;width:15px;display:inline-block;text-align:center;position:relative}nav>ul>li>a>i>em{font-size:9px;display:block;padding:2px;position:absolute;top:-8px;right:-6px;text-decoration:none;font-style:normal;background:#ed1c24;color:#fff;min-width:13px;border-radius:50%;max-height:13px;line-height:8px;font-weight:700;vertical-align:baseline;white-space:nowrap;text-align:center;border:1px solid rgba(255,255,255,0.1)}nav>ul>li>ul::before{content:"";display:block;position:absolute;z-index:1;left:23px;top:0;bottom:0;border-left:1px solid #7a7a7a}nav>ul>li>ul>li>a,nav>ul>li>ul>li>ul>li>a{padding-top:5px;padding-bottom:5px}nav>ul ul li a i{font-size:14px!important;width:18px!important;text-align:center!important}nav>ul ul li::before{content:"";display:block;position:absolute;width:8px;left:23px;top:13px;border-top:1px solid #7a7a7a;z-index:1}nav>ul ul ul li::before{content:"";display:block;position:absolute;width:18px;left:10px;top:17px;border-top:1px solid transparent}@media(min-width:768px){.navbar-nav>li>a{padding-top:17px;padding-bottom:15px}}.ui-menu{display:block;width:155px;padding:2px;-webkit-box-shadow:0 2px 4px rgba(30,30,100,0.25);box-shadow:0 2px 4px rgba(30,30,100,0.25);background:#fff;border:1px solid rgba(0,0,0,0.2);z-index:1;list-style:none;margin:0;margin-bottom:2em;outline:0}.ui-menu .ui-menu{margin-top:-3px;position:absolute;list-style:none}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style:none;list-style-image:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:400}.ui-menu .ui-menu-item a.ui-corner-all{border-radius:0}.ui-menu .ui-menu-item a.ui-state-active,.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-widget-content{font-weight:700;margin:0;background-color:#428bca;border-color:#357ebd;color:#FFF;display:block;white-space:nowrap}.ui-menu .ui-menu-item a.ui-state-active{padding:1px .4em}.ui-menu .ui-menu-item a .ui-menu-icon{width:auto;height:auto;top:0;left:auto;right:auto;bottom:auto;text-indent:0}.ui-menu .ui-menu-divider{margin:5px -2px 5px -2px;height:0;font-size:0;line-height:0;border-width:1px 0 0}.ui-menu .ui-state-disabled{margin:.4em 0 .2em!important;background:none!important;color:#999!important;font-weight:400!important;cursor:default;line-height:1.5}.ui-menu .ui-state-disabled a{cursor:default}.ui-menu .ui-menu-icons{position:relative}.ui-menu .ui-menu-icons .ui-menu-item a{position:relative;padding-left:2em}.ui-menu .ui-icon{position:absolute;top:.2em;left:.2em}.ui-menu .ui-menu-icon{position:static;float:right}.dropdown-menu>li>a:hover{background-color:#e0e0e0}.open>.dropdown-menu{-webkit-animation-name:flipInX;animation-name:flipInX;-webkit-animation-duration:.4s;animation-duration:.4s;-webkit-animation-fill-mode:both;animation-fill-mode:both}.dropdown-menu .small.divider{margin:3px 0}.dropdown-menu-xs{min-width:37px}.dropdown-menu-xs>li>a{padding:3px 10px}.dropdown-menu-xs>li>a:hover i{color:#fff!important}.dropdown-submenu{position:relative}.dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px}.dropdown-submenu:hover>.dropdown-menu{display:block}.dropdown-submenu>a:after{display:block;content:" ";float:right;width:0;height:0;border-color:transparent;border-style:solid;border-width:5px 0 5px 5px;border-left-color:#bfbfbf;margin-top:5px;margin-right:-10px}.dropdown-submenu:hover>a:after{border-left-color:#fff}.dropdown-submenu.pull-left{float:none}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px}.ajax-dropdown{position:absolute;display:none;z-index:1003;top:48px;left:16px;width:344px;height:435px;border-radius:0;-webkit-box-shadow:0 2px 4px rgba(30,30,100,0.25);box-shadow:0 2px 4px rgba(30,30,100,0.25);padding:10px;background:#fff;border:1px solid #b3b3b3}@media only screen and (min-width:320px) and (max-width:479px){.ajax-dropdown{width:299px;height:320px;left:0;top:49px}}.ajax-dropdown:after,.ajax-dropdown:before{bottom:100%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}.ajax-dropdown:before{border-color:rgba(131,131,131,0);border-bottom-color:#838383;border-width:8px;left:50%;margin-left:-8px}@media only screen and (min-width:320px) and (max-width:479px){.ajax-dropdown:before{margin-left:-14px}}.ajax-dropdown:after{border-color:rgba(255,255,255,0);border-bottom-color:#fff;border-width:7px;left:50%;margin-left:-7px}@media only screen and (min-width:320px) and (max-width:479px){.ajax-dropdown:after{margin-left:-13px}}.ajax-dropdown>:last-child{font-size:13px;display:block;padding:5px 0;line-height:22px;font-weight:400}.ajax-dropdown>:first-child{margin:0 0 3px;padding:0 0 9px}.ajax-dropdown .fa-4x.fa-border{border-width:3px;border-radius:50%;display:block;margin:0 auto;width:46px;text-align:center;color:#d1d1d1;border-color:#d1d1d1}.ajax-dropdown .btn-group .btn{font-weight:700;text-transform:capitalize}.ajax-dropdown .btn-group>:nth-child(2){border-right-width:0;border-left-width:0}.ajax-dropdown .btn-group .btn:active{top:0;left:0}.active+.ajax-dropdown{-webkit-animation-name:flipInY;animation-name:flipInY;-webkit-animation-duration:.7s;animation-duration:.7s;-webkit-animation-fill-mode:both;animation-fill-mode:both}.dropdown-large{position:static!important}.dropdown-menu-large{margin-left:16px;margin-right:16px;padding:20px 0}.dropdown-menu-large>li>ul{padding:0;margin:0}.dropdown-menu-large>li>ul>li{list-style:none}.dropdown-menu-large>li>ul>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.428571429;color:#333;white-space:normal}.dropdown-menu-large>li ul>li>a:focus,.dropdown-menu-large>li ul>li>a:hover{text-decoration:none;color:#262626;background-color:#f5f5f5}.dropdown-menu-large .disabled>a,.dropdown-menu-large .disabled>a:focus,.dropdown-menu-large .disabled>a:hover{color:#999}.dropdown-menu-large .disabled>a:focus,.dropdown-menu-large .disabled>a:hover{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);cursor:not-allowed}.dropdown-menu-large .dropdown-header{color:#428bca;font-size:18px}@media(max-width:768px){.dropdown-menu-large{margin-left:0;margin-right:0}.dropdown-menu-large>li{margin-bottom:30px}.dropdown-menu-large>li:last-child{margin-bottom:0}.dropdown-menu-large .dropdown-header{padding:3px 15px!important}}.wijmo-wijmenu{padding:0 20px;background-color:#222;background-repeat:repeat-x;background-image:-webkit-gradient(linear,top left,bottom left,from(#333),to(#222));background-image:-webkit-linear-gradient(top,#333,#222);background-image:linear-gradient(top,#333,#222);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333',endColorstr='#222222',GradientType=0);-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.25),inset 0 -1px 0 rgba(0,0,0,0.1);box-shadow:0 1px 3px rgba(0,0,0,0.25),inset 0 -1px 0 rgba(0,0,0,0.1)}.wijmo-wijmenu .ui-state-default .wijmo-wijmenu-text{color:#bfbfbf}.wijmo-wijmenu .ui-state-hover{background:#444;background:rgba(255,255,255,0.05)}.wijmo-wijmenu .ui-state-hover .wijmo-wijmenu-text{color:#fff}.wijmo-wijmenu .ui-widget-header h3{position:relative;margin-top:1px;padding:0}.wijmo-wijmenu h3 a{color:#fff;display:block;float:left;font-size:20px;font-weight:200;line-height:1;margin-left:-20px;margin-top:1px;padding:8px 20px 12px}.wijmo-wijmenu h3 a:hover{background-color:rgba(255,255,255,0.05);color:#fff;text-decoration:none}.wijmo-wijmenu .ui-widget-header{border:0}.wijmo-wijmenu .wijmo-wijmenu-parent .wijmo-wijmenu-child{padding:.3em 0}.wijmo-wijmenu .wijmo-wijmenu-item{margin:0;border:0}.wijmo-wijmenu .wijmo-wijmenu-item .wijmo-wijmenu-child{background:#333;border:0;margin:0;padding:6px 0;width:160px;border-radius:0 0 6px 6px;-webkit-box-shadow:0 2px 4px rgba(0,0,0,0.2);box-shadow:0 2px 4px rgba(0,0,0,0.2)}.wijmo-wijmenu a.wijmo-wijmenu-link{margin:0;line-height:19px;padding:10px 10px 11px;border:0;border-radius:0}.wijmo-wijmenu .wijmo-wijmenu-child .wijmo-wijmenu-link{display:block;float:none;padding:4px 15px;width:auto}.wijmo-wijmenu .wijmo-wijmenu-child .wijmo-wijmenu-text{float:none}.wijmo-wijmenu .wijmo-wijmenu-item .wijmo-wijmenu-child .ui-state-hover{background:#191919}.wijmo-wijmenu .wijmo-wijmenu-item .wijmo-wijmenu-separator{padding:5px 0;background-image:none;background-color:#222;border-top:1px solid #444;border-bottom:0;border-left:0;border-right:0}.wijmo-wijmenu .wijmo-wijmenu-item input{-moz-transition:none 0s ease 0s;background-color:rgba(255,255,255,0.3);border:1px solid #111;border-radius:4px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.1) inset,0 1px 0 rgba(255,255,255,0.25);box-shadow:0 1px 2px rgba(0,0,0,0.1) inset,0 1px 0 rgba(255,255,255,0.25);color:rgba(255,255,255,0.75);font-family:Ubuntu,Helvetica,Arial,sans-serif;line-height:1;margin:5px 10px 0;padding:4px 9px;width:100px}.wijmo-wijmenu .wijmo-wijmenu-item input:hover{background-color:rgba(255,255,255,0.5);color:#fff}.wijmo-wijmenu .wijmo-wijmenu-item input:focus{background-color:#fff;border:0 none;-webkit-box-shadow:0 0 3px rgba(0,0,0,0.15);box-shadow:0 0 3px rgba(0,0,0,0.15);color:#404040;outline:0 none;padding:5px 10px;text-shadow:0 1px 0 #fff}.wijmo-wijmenu .ui-state-default{text-shadow:none;-webkit-box-shadow:none;box-shadow:none;color:#bfbfbf;-webkit-filter:none;filter:none}.tabs-below>.nav-tabs,.tabs-left>.nav-tabs,.tabs-right>.nav-tabs{border-bottom:0}.nav-tabs.bordered{background:#fff;border:1px solid #ddd}.nav-tabs.bordered>:first-child a{border-left-width:0!important}.nav-tabs.bordered+.tab-content{border:1px solid #ddd;border-top:0}.nav-tabs>li>a{padding:4px 10px;border-radius:0;color:#333}.nav-tabs>li>a.xsmall{line-height:1.0;padding:3px 8px}.nav-tabs>li>a .label{display:inline-block;font-size:11px;margin-left:5px;opacity:.5}.nav-tabs>li>a .badge{font-size:11px;padding:4px 5px 2px;opacity:.5;margin-left:5px;min-width:17px;font-weight:400}.tabs-left .nav-tabs>li>a .badge{margin-right:5px;margin-left:0}.nav-tabs>li>a>.fa{opacity:.5}.nav-tabs.small>li>a{padding:2px 8px;font-size:90%}.nav-tabs.tiny>li>a{padding:1px 6px;font-size:75%}.nav-tabs>li.active>a{-webkit-box-shadow:0 -2px 0 #3276b1;box-shadow:0 -2px 0 #3276b1;border-top-width:0!important;margin-top:1px!important;font-weight:700}.nav-tabs>li.active>a .badge,.nav-tabs>li.active>a .label,.nav-tabs>li.active>a>.fa{opacity:1}.tabs-left .nav-tabs>li.active>a{-webkit-box-shadow:-2px 0 0 #3276b1;box-shadow:-2px 0 0 #3276b1;border-top-width:1px!important;border-left:0!important;margin-left:1px!important}.tabs-right .nav-tabs>li.active>a{-webkit-box-shadow:2px 0 0 #3276b1;box-shadow:2px 0 0 #57889c;border-top-width:1px!important;border-right:0!important;margin-right:1px!important}.tabs-below .nav-tabs>li.active>a{-webkit-box-shadow:0 2px 0 #3276b1;box-shadow:0 2px 0 #3276b1;border-bottom-width:0!important;border-top:0!important;margin-top:0!important}.tabs-left>.nav-tabs>li,.tabs-right>.nav-tabs>li,.tabs-left>.nav-pills>li,.tabs-right>.nav-pills>li{float:none}.tabs-left>.nav-tabs>li>a,.tabs-right>.nav-tabs>li>a,.tabs-left>.nav-pills>li>a,.tabs-right>.nav-pills>li>a{min-width:74px;margin-right:0;margin-bottom:3px}.tabs-left .nav-pills>li.active>a{border:0!important;box-shadow:none!important;-webkit-box-shadow:none!important}.tabs-left>.nav-pills,.tabs-left>.nav-tabs{float:left;margin-right:19px;border-right:1px solid #ddd}.tabs-left>.nav-pills{border-right:0}.tabs-left>.nav-tabs>li>a{margin-right:-1px}.tabs-left>.nav-tabs>li>a:focus,.tabs-left>.nav-tabs>li>a:hover{border-color:#eee #d5d5d5 #eee #eee}.tabs-left>.nav-tabs .active>a,.tabs-left>.nav-tabs .active>a:focus,.tabs-left>.nav-tabs .active>a:hover{border-color:#d5d5d5 transparent #d5d5d5 #ddd;*border-right-color:#fff}.tabs-left>.tab-content{margin-left:109px}.tabs-right>.nav-tabs{float:right;margin-left:19px;border-left:1px solid #ddd}.tabs-right>.nav-tabs>li>a{margin-left:-1px}.tabs-right>.nav-tabs>li>a:focus,.tabs-right>.nav-tabs>li>a:hover{border-color:#eee #eee #eee #ddd}.tabs-right>.nav-tabs .active>a,.tabs-right>.nav-tabs .active>a:focus,.tabs-right>.nav-tabs .active>a:hover{border-color:#ddd #ddd #ddd transparent;*border-left-color:#fff}.tabs-pull-right.nav-tabs>li,.tabs-pull-right.nav-pills>li{float:right}.tabs-pull-right.nav-tabs>li:first-child>a,.tabs-pull-right.nav-pills>li:first-child>a{margin-right:1px}.tabs-pull-right.bordered.nav-pills>li:first-child>a,.tabs-pull-right.bordered.nav-tabs>li:first-child>a{border-left-width:1px!important;margin-right:0;border-right-width:0}.tabs-below>.nav-tabs{border-top:1px solid #ddd}.tabs-below>.nav-tabs>li{margin-top:-1px;margin-bottom:0}.tabs-below>.nav-tabs>li>a:focus,.tabs-below>.nav-tabs>li>a:hover{border-top-color:#ddd;border-bottom-color:transparent}.tabs-below>.nav-tabs>.active>a,.tabs-below>.nav-tabs>.active>a:focus,.tabs-below>.nav-tabs>.active>a:hover{border-color:transparent #ddd #ddd}.pill-content>.pill-pane,.tab-content>.pill-pane,.pill-content>.tab-pane,.tab-content>.tab-pane{display:none}.pill-content>.active,.tab-content>.active,.pill-content>.active,.tab-content>.active{display:block}.pill-content.transparent,.tab-content.transparent{background-color:transparent}.pill-content.bordered,.tab-content.bordered,.pill-content.bordered:hover,.tab-content.bordered:hover{border-color:#ddd;border-top:0}.ams-widget>header>.nav-tabs.pull-left>li:first-child a{border-left-width:0!important}h1,h2,h3,h4{margin:0;font-family:"Ubuntu-Bold",Arial,Helvetica,Sans-Serif;font-weight:300}h1{letter-spacing:-1px;font-size:24px;margin:10px 0}h1 small{font-size:18px;font-weight:300;letter-spacing:-1px}h2{letter-spacing:-1px;font-size:22px;margin:20px 0 15px;line-height:normal}h3{display:block;font-size:19px;font-weight:400;margin:16px 0 10px;line-height:normal}h4{line-height:normal;font-size:17px;font-weight:300;margin:12px 0 8px}h5{font-size:15px;font-weight:300;margin:10px 0 6px;line-height:normal}h6{font-size:14px;margin:10px 0 4px;font-weight:300;line-height:normal}hr .simple{margin-top:10px;margin-bottom:10px;border-style:dashed}li.nodot{list-style-type:none}img.online{border-left-color:#40ac2b!important}img.busy{border-left-color:#ed1c24!important}img.offline{border-left-color:#ddd!important}img.away{border-left-color:#ffc40d!important}[data-ams-url],[data-ams-click-handler]{cursor:pointer}label{font-weight:400}article.sortable-grid{min-height:30px}.caret{border-top:5px solid;border-right:5px solid transparent;border-left:5px solid transparent}.fixed{position:fixed}@media(max-width:768px){.xs-fixed{position:fixed}}@media(min-width:768px) and (max-width:992px){.sm-fixed{position:fixed}}@media(min-width:992px) and (max-width:1200px){.md-fixed{position:fixed}}@media(min-width:1200px){.lg-fixed{position:fixed}}.outside{position:absolute;left:-9999px}@media(max-width:979px){.visible-tablet{display:inline-block!important}}@media(max-width:979px){.hidden-tablet,.display-inline.hidden-tablet{display:none!important}}@media only screen and (min-width:0) and (max-width:679px){.hidden-tablet{display:none!important}}@media only screen and (min-width:320px) and (max-width:479px){.visible-mobile{display:inline-block!important}}@media only screen and (min-width:320px) and (max-width:479px){.hidden-mobile{display:none!important}}.viewport-y{overflow-y:auto}.viewport-y.viewport-100{max-height:100px}.viewport-y.viewport-200{max-height:200px}.viewport-y.viewport-300{max-height:300px}.viewport-y.viewport-600{max-height:600px}.viewport-y.viewport-400{max-height:400px}.viewport-y.viewport-500{max-height:500px}.viewport-y.viewport-600{max-height:600px}.viewport-x{overflow-x:auto}.viewport-x.viewport-100{max-width:100px}.viewport-x.viewport-200{max-width:200px}.viewport-x.viewport-300{max-width:300px}.viewport-x.viewport-400{max-width:400px}.viewport-x.viewport-500{max-width:500px}.viewport-x.viewport-600{max-width:600px}.height-100{min-height:100px}.height-200{min-height:200px}.height-300{min-height:300px}.height-400{min-height:400px}.height-500{min-height:500px}.height-600{min-height:600px}.lead{font-size:19px}.alert{margin-bottom:20px;margin-top:0;color:#675100;border-width:0;border-left-width:5px;padding:10px;border-radius:0}.alert .close{top:0;right:-5px;line-height:20px}.alert-heading{font-weight:600}.alert-danger{border-color:#963b49;color:#fff;background:#c46a69;text-shadow:none}.alert-warning{border-color:#e5c693;color:#6b6d31;background:#ecdfb0}.alert-success{border-color:#8eb589;color:#296829;background:#cee0cf}.alert-info{border-color:#9cb4c5;color:#346597;background:#d6dde7}.alert ul{margin-left:25px;list-style-position:outside;list-style-type:square}.ams-form>.alert{margin:5px;padding:5px;box-shadow:none!important;-webkit-box-shadow:none!important;border-radius:0!important}.help{font-size:90%;padding:5px!important}.help p{margin:0 0 1px;line-height:1.15}.modal-dialog .help{margin-bottom:5px!important}.well{background:#fbfbfb;border:1px solid #ddd;box-shadow:0 1px 1px #ececec;-webkit-box-shadow:0 1px 1px #ececec;position:relative}.well.well-clean{-webkit-box-shadow:none;box-shadow:none;border-color:transparent}.well.well-glass{-webkit-box-shadow:none;box-shadow:none;border-color:transparent;background-color:rgba(255,255,255,0.25);color:#fff}.well.well-light{background:#fff;border:1px solid #e2e2e2}.widget-body .well{margin-bottom:0}.well.transparent{border:0!important;background:none!important}.ams-widget.well.transparent>div,.ams-widget.well.transparent>div .widget-body{padding:0!important}.well[class*=" bg-"],.well[class^=bg-]{border:1px solid #555!important}.note{margin-top:6px;padding:0 1px;font-size:11px;line-height:15px;color:#999}.subscript{font-size:21px;color:#999}.display-image{margin-top:-60px;margin-right:20px}.terms-body{max-height:400px;overflow:auto}.timeline-seperator{display:block;text-align:center;color:#999;margin:20px 0 0}.timeline-seperator>:first-child{padding:4px 5px;border:1px dashed rgba(0,0,0,0.1);background:#fff;font-size:11px;border-radius:4px}.timeline-seperator .btn,.timeline-seperator .btn+.dropdown-menu{margin-right:15px}.timeline-seperator:after{display:block;content:" ";margin:0 20px;border-bottom:1px dashed rgba(0,0,0,0.1);margin-top:-8px}.progress{position:relative;margin-bottom:20px;overflow:hidden;height:22px;background:#eee;box-shadow:0 1px 0 transparent,0 0 0 1px #e3e3e3 inset;-webkit-box-shadow:0 1px 0 transparent,0 0 0 1px #e3e3e3 inset;border-radius:0}.progress-bar{float:left;width:0;height:100%;font-size:11px;color:#fff;text-align:center;background-color:#57889c;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);font-weight:700;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-image:url(../img/pattern/overlay-pattern.png)}.progress-striped .progress-bar{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-ms-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-danger{background-color:#a90329}.progress-striped .progress-bar-danger{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-bar-success{background-color:#739e73}.progress-striped .progress-bar-success{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#c79121}.progress-striped .progress-bar-warning{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#57889c}.progress-striped .progress-bar-info{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress .bar-info,.progress-info .bar{background:#57889c}.progress-micro{height:3px!important;line-height:3px!important}.progress-xs{height:7px!important;line-height:7px!important}.progress-sm{height:14px!important;line-height:14px!important}.progress-lg{height:30px!important;line-height:30px!important}.progress .progress-bar{position:absolute;overflow:hidden;line-height:20px}.progress .progressbar-back-text{position:absolute;width:100%;height:100%;font-size:12px;line-height:20px;text-align:center}.progress .progressbar-front-text{display:block;width:100%;font-size:12px;line-height:20px;text-align:center}.progress.right .progress-bar{right:0}.progress.right .progressbar-front-text{position:absolute;right:0}.progress.vertical{width:25px;height:100%;min-height:150px;margin-right:20px;display:inline-block;margin-bottom:0}.progress.vertical.bottom{position:relative}.progress.vertical.bottom .progress-bar{position:absolute;bottom:0}.progress.vertical.bottom .progressbar-front-text{position:absolute;bottom:0}.progress.vertical .progress-bar{width:100%;height:0;-webkit-transition:height .6s ease;transition:height .6s ease}.progress.wide-bar{width:40px}.dd{position:relative;display:block;margin:0;padding:0;max-width:600px;list-style:none;font-size:13px;line-height:20px}@media only screen and (min-width:700px){.dd{float:left;width:100%}.dd+.dd{margin-left:2%}}.dd-header.calender-spacer{height:46px;display:block}.dd-list{display:block;position:relative;margin:0;padding:0;list-style:none}.dd-list .dd-list{padding-left:30px}.dd-collapsed .dd-list{display:none}.dd-empty{border:1px dashed #bbb;min-height:100px;background-color:#eee;background-image:-webkit-linear-gradient(45deg,#fff 25%,transparent 25%,transparent 75%,#fff 75%,#fff),-webkit-linear-gradient(45deg,#fff 25%,transparent 25%,transparent 75%,#fff 75%,#fff);background-image:linear-gradient(45deg,#fff 25%,transparent 25%,transparent 75%,#fff 75%,#fff),linear-gradient(45deg,#fff 25%,transparent 25%,transparent 75%,#fff 75%,#fff);-webkit-background-size:60px 60px;background-size:60px 60px;background-position:0 0,30px 30px}.dd-empty,.dd-placeholder{margin:5px 0;padding:0;min-height:30px;background:#f2fbff;border:1px dashed #b6bcbf;-webkit-box-sizing:border-box;box-sizing:border-box;-moz-box-sizing:border-box}.dd-empty,.dd-item,.dd-placeholder{display:block;position:relative;margin:0;padding:0;min-height:20px;font-size:13px;line-height:20px}.dd-handle{display:block;font-size:15px;margin:5px 0;padding:7px 15px;color:#333;text-decoration:none;border:1px solid #cfcfcf;background:#fbfbfb}.dd-handle:hover,.dd-handle:hover+.dd-list .dd-handle{background:#fddfb3!important;border:1px solid #faa937;color:#333!important}.dd-handle>span{font-size:13px;color:#777}.dd-hover>.dd-handle{background:#2ea8e5!important}.dd-item>button{position:relative;cursor:pointer;float:left;width:25px;height:20px;margin:7px 10px;line-height:22px!important;padding:0;text-indent:100%;white-space:nowrap;overflow:hidden;border:0;background:rgba(0,0,0,0);text-align:center;display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:400;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:18px}.dd-item>button:before{content:'\f055';display:block;position:absolute;width:100%;text-align:center;text-indent:0;color:#0091d9}.dd-item>button[data-action=collapse]:before{content:'\f056';color:#a90329}.dd-dragel{position:absolute;pointer-events:none;z-index:9999}.dd-dragel>.dd-item .dd-handle{margin-top:0}.dd-dragel>.dd-item>.dd-handle{border-left-width:4px}.dd-dragel .dd-handle{-webkit-box-shadow:2px 4px 6px 0 rgba(0,0,0,0.1);box-shadow:2px 4px 6px 0 rgba(0,0,0,0.1)}.dd-dragel>li.dd-item.dd3-item{position:relative;top:10px;left:10px;z-index:999}.vertical-bars{padding:0;margin:0}.vertical-bars:after{content:"";display:block;height:0;clear:both}.vertical-bars li{padding:14px 0;width:25%;display:block;float:left;text-align:center}.vertical-bars li:first-child{border-left:0}.vertical-bars>li>.progress.vertical{margin:0 auto;float:none}.vertical-bars>li>.progress.vertical:first-child{margin-left:auto}.bar-holder{padding:18px 15px}.bar-holder:first-child{border-top:0}.bar-holder .progress{margin:0}.pagination.pagination-alt>li>a{box-shadow:none;-webkit-box-shadow:none;border:0;margin-left:-1px}.pagination.pagination-alt>li:first-child>a{padding-left:0}.pagination>li>a,.pagination>li>span{padding:7px 12px 5px;box-shadow:inset 0 -2px 0 rgba(0,0,0,0.05);-webkit-box-shadow:inset 0 -2px 0 rgba(0,0,0,0.05)}.pagination-xs>li>a,.pagination-xs>li>span{padding:5px 9px 3px;font-size:12px}.panel-purple{border-color:#6e587a}.panel-purple>.panel-heading{color:#fff;background-color:#6e587a;border-color:#6e587a}.panel-greenLight{border-color:#71843f}.panel-greenLight>.panel-heading{color:#fff;background-color:#71843f;border-color:#71843f}.panel-greenDark{border-color:#496949}.panel-greenDark>.panel-heading{color:#fff;background-color:#496949;border-color:#496949}.panel-darken{border-color:#333}.panel-darken>.panel-heading{color:#fff;background-color:#404040;border-color:#404040}.panel-pink{border-color:#ac5287}.panel-pink>.panel-heading{color:#fff;background-color:#ac5287;border-color:#ac5287}.panel-green{border-color:#356e35}.panel-green>.panel-heading{color:#fff;background-color:#356e35;border-color:#356e35}.panel-blueLight{border-color:#92a2a8}.panel-blueLight>.panel-heading{color:#fff;background-color:#92a2a8;border-color:#92a2a8}.panel-pinkDark{border-color:#a8829f}.panel-pinkDark>.panel-heading{color:#fff;background-color:#a8829f;border-color:#a8829f}.panel-redLight{border-color:#a65858}.panel-redLight>.panel-heading{color:#fff;background-color:#a65858;border-color:#a65858}.panel-red{border-color:#a90329}.panel-red>.panel-heading{color:#fff;background-color:#a90329;border-color:#a90329}.panel-teal{border-color:#568a89}.panel-teal>.panel-heading{color:#fff;background-color:#568a89;border-color:#568a89}.panel-orange{border-color:#c79121}.panel-orange>.panel-heading{color:#fff;background-color:#c79121;border-color:#c79121}.panel-blueDark{border-color:#4c4f53}.panel-blueDark>.panel-heading{color:#fff;background-color:#4c4f53;border-color:#4c4f53}.panel-magenta{border-color:#6e3671}.panel-magenta>.panel-heading{color:#fff;background-color:#6e3671;border-color:#6e3671}.panel-blue{border-color:#57889c}.panel-blue>.panel-heading{color:#fff;background-color:#57889c;border-color:#57889c}.panel-footer>.btn-block{border-radius:0;border-bottom:0;border-left:0;border-right:0}.notification-body{padding:0 0 0 3px;margin:0;list-style:none}.notification-body *,.notification-body:after *,.notification-body:before *{box-sizing:border-box!important;-webkit-box-sizing:border-box!important;-moz-box-sizing:border-box!important}.notification-body>li{border-bottom:1px solid #e9e9e9;position:relative}.notification-body>li>span{background:#fff;display:block;min-height:25px;overflow:hidden;padding:8px 10px 13px;white-space:normal}.notification-body>li>span:hover{background:#f0f4f7;color:#667f8f}.notification-body>li a.msg{padding-left:50px!important}.notification-body>li a,.notification-body>li a span{display:block;position:relative;overflow:hidden}.notification-body>li a,.notification-body>li a:hover{text-decoration:none}.notification-body>li:hover .progress{background:#fff;box-shadow:0 1px 0 rgba(0,0,0,0),0 0 0 1px #a7a7a7 inset;-webkit-box-shadow:0 1px 0 rgba(0,0,0,0),0 0 0 1px #ccc inset}.notification-body>li:hover .text-muted{color:#333}.notification-body .from{font-size:14px;line-height:normal;color:#333;font-weight:400;margin-right:60px;margin-bottom:6px;height:20px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.notification-body .unread{background:#ffffe0}.notification-body .unread .unread .from{font-weight:700}.notification-body time{position:absolute;top:3px;right:0;font-size:11px;font-weight:400;color:#058dc7}.notification-body .msg-body,.notification-body .subject{font-size:13px;color:#a0a0a0;max-height:35px;width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.notification-body .subject{font-size:13px;color:#333;max-height:22px}.ajax-notifications{height:365px;display:block;overflow:auto;margin-right:-10px;margin-left:-10px;border-bottom:1px solid #cecece;border-top:1px solid #cecece;background:#e9e9e9}@media only screen and (min-width:320px) and (max-width:479px){.ajax-notifications{height:250px}}.ajax-notifications>.alert.alert-transparent{background-color:transparent;border-color:transparent;color:#757575;margin:13px 10px}.ajax-notifications>.alert>:first-child{margin-bottom:10px;font-weight:400}.arrow-box-up:before,.arrow-box-up:after{bottom:100%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}.arrow-box-up:before{border-color:rgba(131,131,131,0);border-bottom-color:#838383;border-width:8px;left:50%;margin-left:-8px}.arrow-box-up:after{border-color:rgba(255,255,255,0);border-bottom-color:#fff;border-width:7px;left:50%;margin-left:-7px}.arrow-box-up-right:before,.arrow-box-up-right:after{bottom:100%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}.arrow-box-up-right:before{border-color:rgba(131,131,131,0);border-bottom-color:#838383;border-width:8px;right:9px;margin-left:-8px}.arrow-box-up-right:after{border-color:rgba(255,255,255,0);border-bottom-color:#fff;border-width:7px;right:10px;margin-left:-7px}.tooltip-inner{padding:5px 10px;font-size:11px;font-family:Ubuntu,Arial,Helvetica,sans-serif;font-weight:700;border-radius:0}.jqstooltip{padding:7px!important;border-radius:3px!important;border:0!important;background-color:#000!important;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box}.jqstooltip .jqsfield{font-family:Ubuntu,Arial,sans-serif;font-size:11px}.dd3-content{display:block;margin:5px 0;padding:6px 10px 8px 40px;font-size:15px;color:#333;text-decoration:none;border:1px solid #cfcfcf;background:#fbfbfb}.dd3-content:hover{color:#2ea8e5;background:#fff}.dd-dragel>.dd3-item>.dd3-content{margin:0}.dd3-item>button{margin-left:38px}.dd3-handle{position:absolute;margin:0;left:0;top:0;cursor:move;width:30px;text-indent:100%;white-space:nowrap;overflow:hidden;border:1px solid #aaa;background:#bfbfbf;background:-webkit-gradient(linear,top left,bottom left,from(#ddd),to(#bbb));background:-webkit-linear-gradient(top,#ddd 0,#bbb 100%);background:linear-gradient(top,#ddd 0,#bbb 100%);display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:18px;padding:8px 15px}.dd3-handle:before{content:'\f0c9';display:block;position:absolute;left:0;top:3px;width:100%;text-align:center;text-indent:0;color:#818181;font-weight:400;line-height:28px}.dd3-handle:hover:before{color:#c27616}.nestable-lists{display:block;clear:both;padding:30px 0;width:100%;border:0;border-top:2px solid #bfbfbf;border-bottom:2px solid #bfbfbf}#nestable-menu{padding:0;margin:10px 0 20px}#nestable-output,#nestable2-output{width:100%;padding:5px}.custom-scroll::-webkit-scrollbar{-webkit-overflow-scrolling:touch;height:10px;width:10px}.custom-scroll::-webkit-scrollbar:hover{background-color:#e9e9e9;border:1px solid #dbdbdb}.custom-scroll::-webkit-scrollbar-button:start:decrement,.custom-scroll::-webkit-scrollbar-button:end:increment{background:0;display:block;height:0}.custom-scroll::-webkit-scrollbar-track{-webkit-background-clip:padding-box;background-clip:padding-box;border:solid transparent}.custom-scroll::-webkit-scrollbar-track-piece{-o-border-radius:0;background-color:transparent;border-radius:0}.custom-scroll::-webkit-scrollbar-thumb{-webkit-box-shadow:inset 1px 1px 0 rgba(0,0,0,0.1),inset 0 -1px 0 rgba(0,0,0,0.07);-webkit-background-clip:padding-box;background-clip:padding-box;background-color:rgba(0,0,0,0.2);border:0;box-shadow:inset 1px 1px 0 rgba(0,0,0,0.1),inset 0 -1px 0 rgba(0,0,0,0.07)}.custom-scroll::-webkit-scrollbar-thumb:vertical,.custom-scroll::-webkit-scrollbar-thumb:horizontal{-o-border-radius:0;background-color:#bfbfbf;border-radius:0}.custom-scroll::-webkit-scrollbar-thumb:active{-webkit-box-shadow:inset 1px 1px 3px rgba(0,0,0,0.33);background-color:rgba(0,0,0,0.44);box-shadow:inset 1px 1px 3px rgba(0,0,0,0.33)}.custom-scroll::-webkit-scrollbar-thumb:hover{background-color:#959595}.air{position:absolute;z-index:5}.air-bottom{bottom:0}.air-top{top:0}.air-top-right{top:0;right:0}.air-top-left{top:0;left:0}.air-bottom-left{bottom:0;left:0}.air-bottom-right{bottom:0;right:0}.tree{min-height:20px;border-radius:4px}.tree li{list-style-type:none;margin:0;padding:3px 0 3px 5px;position:relative}.tree li:after,.tree li:before{content:'';left:-20px;position:absolute;right:auto}.tree li:before{border-left:1px solid #999;bottom:50px;height:100%;top:-5px;width:1px;-webkit-transition:"border-color 0.1s ease 0.1s";transition:"border-color 0.1s ease 0.1s"}.tree li:last-child::before{height:30px}.tree li:after{border-top:1px solid #999;height:20px;top:14px;width:25px}.tree li:hover{background:rgba(0,0,0,0.15)}.tree li>span{border:1px dotted #999;border-radius:5px;display:inline-block;padding:4px 8px;text-decoration:none;-webkit-transition:color .2s ease .1s,background-color .2s ease .1s,border-color .3s ease .2s;transition:color .2s ease .1s,background-color .2s ease .1s,border-color .3s ease .2s}.tree li>span>i{padding-right:4px}.tree li.parent_li>span{padding:7px}.tree li>span{cursor:pointer}.tree li>span:hover,.tree li>span:hover+ul li>span{background:#eee;border:1px solid #94a0b4;color:#000}.tree ul ul{padding-left:34px;padding-top:5px}.tree>ul{padding-left:0}.tree>ul>li:after,.tree>ul>li:before{border:0}.pace{-webkit-pointer-events:none;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.pace-inactive{display:none}.pace .pace-progress{background:#3276b1;position:fixed;z-index:2000;top:0;left:0;height:2px;-webkit-transition:width 1s;transition:width 1s}.pace .pace-progress-inner{display:block;position:absolute;right:0;width:100px;height:100%;-webkit-box-shadow:0 0 10px #29d,0 0 5px #29d;box-shadow:0 0 10px #29d,0 0 5px #29d;opacity:1;-webkit-transform:rotate(3deg) translate(0,-4px);-ms-transform:rotate(3deg) translate(0,-4px);transform:rotate(3deg) translate(0,-4px)}.pace .pace-activity{display:block;position:fixed;z-index:2000;top:63px;right:40px;width:14px;height:14px;border:solid 2px transparent;border-top-color:#29d;border-left-color:#29d;border-radius:10px;-webkit-animation:pace-spinner 400ms linear infinite;-ms-animation:pace-spinner 400ms linear infinite;animation:pace-spinner 400ms linear infinite}.table-full{width:100%}.table-wrap{overflow:auto}.table.has-tickbox thead tr th:first-child{width:18px}.table.has-tickbox.ams-form tbody tr td:first-child .checkbox,.table.has-tickbox.ams-form tbody tr td:first-child .radio,.table.has-tickbox.ams-form thead tr th:first-child .checkbox,.table.has-tickbox.ams-form thead tr th:first-child .radio{padding:0!important}.table-dnd tbody tr.dragging-row td{background-color:#cedbf7!important}.table-dnd tbody tr td:first-child{padding-left:20px!important}.table-dnd tbody td.drag-handle{background:transparent url('../img/vert-drag-handle.png') scroll no-repeat left 50%}.table-tight td,.table-tight th{padding:4px 8px!important;line-height:1.3!important}.table-small td,.table-small th{padding:2px 8px!important;line-height:1.2!important}.table-mini td,.table-mini th{padding:1px 8px!important;line-height:1.1!important}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-width:1px}.table-bordered .no-padding>.table-bordered{border:0!important}.table-bordered .no-padding>.table-bordered tbody tr td:first-child,.table-bordered .no-padding>.table-bordered thead tr td:first-child,.table-bordered .no-padding>.table-bordered thead tr th:first-child{border-left-width:0!important}.table-bordered .no-padding>.table-bordered tbody tr td:last-child,.table-bordered .no-padding>.table-bordered thead tr th:last-child{border-right-width:0!important}.table-bordered .no-padding>.table-bordered tbody tr:last-child td{border-bottom-width:0!important}.no-padding .note-editable .table-bordered{border:1px solid #ddd!important}tr.bordered-bottom th,tr.bordered-bottom td{border-bottom:1px solid #ddd}.table-hover>tbody>tr:hover>td,.table-hover>tbody>tr:hover>th{background-color:#eee}th.checker,td.checker{width:30px}th.actions-menu{width:70px}th.action,td.action{width:26px}.dt-row{padding:4px 10px}.dt-top-row{height:0;line-height:0;position:relative}.dt-bottom-row{background:#fafafa;font-size:11px;overflow:hidden;padding:5px 10px;border-top:1px solid #ccc;-webkit-box-shadow:inset 0 1px #fff;-ms-box-shadow:inset 0 1px #fff;box-shadow:inset 0 1px #fff}.modal-dialog .ams-form .dt-bottom-row{padding:5px 10px!important}.modal-dialog .ams-form .dt-bottom-row .row{margin:0}.dataTables_length{position:absolute;right:13px;top:-35px}.dataTables_length select{width:60px;padding:3px;font-size:13px;border:1px solid #bbb}.dataTables_filter{position:absolute;left:10px;top:-35px}.dataTables_filter input{padding:3px 8px 1px;font-size:13px}.dataTables_filter .form-control{height:28px}.dataTables_filter .input-group{width:180px!important}.dataTables_filter input select{border:1px solid #bbb}.dataTables_paginate{margin:4px 0 0}.dataTables_paginate .pagination{margin:0}.dataTables_paginate .btn-group a{color:#2e5f87}.dataTables_wrapper{position:relative}.dataTables_wrapper table.table{clear:both;max-width:inherit;margin-bottom:0}.dataTables_wrapper table.table thead th{white-space:nowrap;text-overflow:ellipsis;-ms-text-overflow:ellipsis}.dataTables_wrapper table.table thead .sorting,.dataTables_wrapper table.table thead .sorting_asc,.dataTables_wrapper table.table thead .sorting_asc_disabled,.dataTables_wrapper table.table thead .sorting_desc,.dataTables_wrapper table.table thead .sorting_desc_disabled{cursor:pointer;padding-right:20px}.dataTables_wrapper table.table thead .sorting{background:url(../img/datatable/sort_both.png) no-repeat center right}.dataTables_wrapper table.table thead .sorting_asc{background:url(../img/datatable/sort_asc.png) no-repeat center right}.dataTables_wrapper table.table thead .sorting_desc{background:url(../img/datatable/sort_desc.png) no-repeat center right}.dataTables_wrapper table.table thead .sorting_asc_disabled{background:url(../img/datatable/sort_asc_disabled.png) no-repeat center right}.dataTables_wrapper table.table thead .sorting_desc_disabled{background:url(../img/datatable/sort_desc_disabled.png) no-repeat center right}.dataTables_wrapper table.table tbody tr.active th,.dataTables_wrapper table.table tbody tr.active td{background-color:#08C;color:#fff}.dataTables_wrapper table.table tbody tr.active:hover td,.dataTables_wrapper table.table tbody tr.active:hover th{background-color:#0075b0!important}.dataTables_wrapper table.dataTable th:active{outline:0}.dataTables_wrapper .table-striped tbody tr.active:nth-child(odd) td,.dataTables_wrapper .table-striped tbody tr.active:nth-child(odd) th{background-color:#017ebc}.dataTables_wrapper select{min-height:inherit}.dataTables_wrapper table+.row{margin-bottom:0;margin-top:10px}.dataTables_wrapper .dt_actions{float:left;margin-right:20px}.dataTables_wrapper .bottom,.dataTables_wrapper .top{background-color:#f5f5f5;border:1px solid #CCC;padding:15px}.dataTables_wrapper div.DTTT .btn:hover{text-decoration:none!important}.dataTables_wrapper ul.DTTT_dropdown.dropdown-menu a{color:#333!important}.dataTables_wrapper ul.DTTT_dropdown.dropdown-menu li:hover a{background-color:#08c;color:#fff!important}.dataTables_wrapper div.DTTT_print_info.modal{height:150px;margin-top:-75px;text-align:center}.dataTables_wrapper div.DTTT_print_info h6{font-weight:400;font-size:28px;line-height:28px;margin:1em}.dataTables_wrapper div.DTTT_print_info p{font-size:14px;line-height:20px}.dataTables_wrapper div.DTFC_LeftFootWrapper table,.dataTables_wrapper div.DTFC_LeftHeadWrapper table,.dataTables_wrapper table.DTFC_Cloned tr.even{background-color:#fff}.dataTables_wrapper div.DTFC_LeftHeadWrapper table{margin-bottom:0!important;border-top-right-radius:0!important;border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}.dataTables_scrollBody{-webkit-overflow-scrolling:touch}.top .dataTables_info{float:none}div.dt-bottom-row .dataTables_info{float:left;padding-top:10px;font-size:12px}.dataTables_full{width:100%!important}.dataTables_empty{text-align:center!important;font-size:15px;background:#fff!important;padding:20px 0!important;cursor:default}.dataTables_scroll{clear:both}.dataTables_scrollHeadInner table.table-bordered{border-radius:4px 4px 0 0}.dataTables_scrollHeadInner table.table-bordered,.dataTables_scrollHeadInner table.table-bordered thead{border-bottom:0}.dataTables_scrollBody table{border-top:0}.dataTables_processing{position:absolute;top:50%;margin-top:-24px;z-index:100;left:50%;width:250px;margin-left:-125px;border:1px solid #ddd;text-align:center;color:#000;background:#fff;font-size:15px!important;-webkit-box-shadow:0 0 4px rgba(0,0,0,0.2);-ms-box-shadow:0 0 4px rgba(0,0,0,0.2);box-shadow:0 0 4px rgba(0,0,0,0.2);padding:10px 0}.dataTables_wrapper .center{text-align:center}.dataTables_wrapper .details,.dataTables_wrapper .details:hover{background:#ddd!important}.dataTables_wrapper .details table td{background:#fff!important}.dataTables_scrollHeadInner table.table,.dataTables_wrapper .details table.table{margin:0!important}.dataTables_scrollHead table{margin-bottom:0!important;border-bottom-left-radius:0;border-bottom-right-radius:0}.dataTables_scrollHead table thead tr:last-child th:first-child{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}.DTFC_LeftHeadWrapper table thead tr:last-child td:first-child,.DTFC_LeftHeadWrapper table thead tr:last-child th:first-child{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}.DTFC_LeftBodyWrapper table,.dataTables_scrollBody table{border-top:0;margin-bottom:0!important}.DTFC_LeftBodyWrapper tbody tr:first-child td,.DTFC_LeftBodyWrapper tbody tr:first-child th,div.DTFC_LeftFootWrapper table,div.dataTables_scrollBody tbody tr:first-child th,div.dataTables_scrollFoot table{border-top:0}.ColVis{position:absolute;right:83px;top:-35px}.ColVis_collection{position:relative;width:180px;background-color:#fff;border:1px solid rgba(0,0,0,0.2);-webkit-box-shadow:0 2px 4px rgba(0,0,0,0.2);box-shadow:0 2px 4px rgba(0,0,0,0.2);z-index:1102;padding-top:3px;padding-left:10px;list-style-type:none;list-style-position:outside}.ColVis_collection .ColVis_Button{position:relative;margin-right:3px;height:30px;background-color:#fff;border:1px solid #d0d0d0;cursor:hand;padding:3px 5px}.ColVis_collection button.ColVis_Button{padding:4px 12px;height:26px;background-color:#fff;border:0;width:100%;float:none;font-size:12px}.ColVis_collection button.ColVis_Button+button.ColVis_Button{border-top:1px solid #e1e1e1}.ColVis_collection button.ColVis_Button button.ColVis_Button input{margin:0}button.ColVis_Button{padding:4px 5px;text-align:left}button.ColVis_Button::-moz-focus-inner{border:0!important;padding:0}.ColVis_collectionBackground{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#000;z-index:1100}div.ColVis_catcher{position:absolute;z-index:1101}span.ColVis_radio{display:inline-block;width:20px;vertical-align:-2px}.ColVis_text_hover,div.ColVis_collection button.ColVis_Button:hover{background:#f2f2f2;color:#222}table.DTCR_clonedTable{background-color:#fff;z-index:202}div.DTCR_pointer{width:1px;background-color:#0259c4;z-index:201}ul.DTTT_dropdown.dropdown-menu li{position:relative}ul.DTTT_dropdown.dropdown-menu li:hover a{background-color:#f2f2f2;color:#333!important}.table_tools_group{position:absolute;right:83px;top:-37px}.DTTT.btn-group{position:absolute;top:-38px;right:83px}.DTTT_dropdown{z-index:2002}.DTFC_LeftHeadWrapper{border-bottom:1px solid #ddd}div.DTTT_container{position:relative;float:right;margin-bottom:1em}a.DTTT_button,button.DTTT_button,div.DTTT_button{position:relative;float:left;margin-right:3px;padding:5px 8px;border:1px solid #999;cursor:pointer;*cursor:hand;font-size:.88em;color:#000!important;-o-border-radius:2px;border-radius:2px;-webkit-box-shadow:1px 1px 3px #ccc;-ms-box-shadow:1px 1px 3px #ccc;-o-box-shadow:1px 1px 3px #ccc;box-shadow:1px 1px 3px #ccc;background:#fff;background:-webkit-gradient(linear,top left,bottom left,from(#fff),color-stop(89%,#f3f3f3),to(#f9f9f9));background:-webkit-linear-gradient(top,#fff 0,#f3f3f3 89%,#f9f9f9 100%);background:linear-gradient(top,#fff 0,#f3f3f3 89%,#f9f9f9 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff',endColorstr='#f9f9f9',GradientType=0)}a.DTTT_button:hover,button.DTTT_button:hover,div.DTTT_button:hover{border:1px solid #666;text-decoration:none!important;-webkit-box-shadow:1px 1px 3px #999;-ms-box-shadow:1px 1px 3px #999;-o-box-shadow:1px 1px 3px #999;box-shadow:1px 1px 3px #999;background:#f3f3f3;background:-webkit-gradient(linear,top left,bottom left,from(#f3f3f3),color-stop(89%,#e2e2e2),to(#f4f4f4));background:-webkit-linear-gradient(top,#f3f3f3 0,#e2e2e2 89%,#f4f4f4 100%);background:linear-gradient(top,#f3f3f3 0,#e2e2e2 89%,#f4f4f4 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f3f3f3',endColorstr='#f4f4f4',GradientType=0)}button.DTTT_button{height:30px;padding:3px 8px}.DTTT_button embed{outline:0}a.DTTT_disabled,button.DTTT_disabled,div.DTTT_disabled{color:#999;border:1px solid #d0d0d0;background:#fff;background:-webkit-gradient(linear,top left,bottom left,from(#fff),color-stop(89%,#f9f9f9),to(#fafafa));background:-webkit-linear-gradient(top,#fff 0,#f9f9f9 89%,#fafafa 100%);background:linear-gradient(top,#fff 0,#f9f9f9 89%,#fafafa 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff',endColorstr='#fafafa',GradientType=0)}table.DTTT_selectable tbody tr{cursor:pointer;*cursor:hand}table.dataTable tr.DTTT_selected.odd td.sorting_1,table.dataTable tr.DTTT_selected.odd td.sorting_2,table.dataTable tr.DTTT_selected.odd td.sorting_3{background-color:#9fafd1}table.dataTable tr.DTTT_selected.even td.sorting_1,table.dataTable tr.DTTT_selected.even td.sorting_2,table.dataTable tr.DTTT_selected.even td.sorting_3{background-color:#b0bed9}div.DTTT_collection{width:150px;padding:8px 8px 4px;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.4);background-color:#f3f3f3;background-color:rgba(255,255,255,0.3);overflow:hidden;z-index:2002;-o-border-radius:5px;border-radius:5px;-webkit-box-shadow:3px 3px 5px rgba(0,0,0,0.3);-ms-box-shadow:3px 3px 5px rgba(0,0,0,0.3);-o-box-shadow:3px 3px 5px rgba(0,0,0,0.3);box-shadow:3px 3px 5px rgba(0,0,0,0.3)}div.DTTT_collection a.DTTT_button,div.DTTT_collection button.DTTT_button,div.DTTT_collection div.DTTT_button{position:relative;left:0;right:0;display:block;float:none;margin-bottom:4px;-webkit-box-shadow:1px 1px 3px #999;-ms-box-shadow:1px 1px 3px #999;-o-box-shadow:1px 1px 3px #999;box-shadow:1px 1px 3px #999}div.DTTT_collection_background{z-index:2001}.DTTT_print_info{position:fixed;top:50%;left:50%;width:400px;height:150px;margin-left:-200px;margin-top:-75px;text-align:center;color:#333;padding:10px 30px;background:#fff;background:-webkit-gradient(linear,top left,bottom left,from(#fff),color-stop(89%,#f3f3f3),to(#f9f9f9));background:-webkit-linear-gradient(top,#fff 0,#f3f3f3 89%,#f9f9f9 100%);background:linear-gradient(top,#fff 0,#f3f3f3 89%,#f9f9f9 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff',endColorstr='#f9f9f9',GradientType=0);opacity:.95;border:1px solid #000;border:1px solid rgba(0,0,0,0.5);-o-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.5);-ms-box-shadow:0 3px 7px rgba(0,0,0,0.5);-o-box-shadow:0 3px 7px rgba(0,0,0,0.5);box-shadow:0 3px 7px rgba(0,0,0,0.5)}.DTTT_print_info h6{font-weight:400;font-size:28px;line-height:28px;margin:1em}.DTTT_print_info p{font-size:14px;line-height:20px}.form hr{margin-left:-13px;margin-right:-13px;border-color:rgba(0,0,0,0.1);margin-top:20px;margin-bottom:20px}.form fieldset{display:block;border:0;background:rgba(255,255,255,0.9);position:relative}.form header,.form legend{display:block;padding:8px 0;border-bottom:1px dashed rgba(0,0,0,0.2);background:#fff;font-size:16px;font-weight:300;color:#222;margin:25px 0 20px}.no-padding .form header{margin:25px 14px 0}.form header:first-child{margin-top:10px}.form .form-group:last-child,.form .form-group:last-child .note,.form fieldset .form-group:last-child,.form fieldset .form-group:last-child .note{margin-bottom:0}fieldset{position:relative}legend{font-weight:400;margin-top:0;background:0}i.hint{vertical-align:super;opacity:.5}i.hint:hover{opacity:.9!important}.nohints i.hint{display:none}.input-group-addon{padding:6px 10px 5px;border-radius:0;transition:background-color .3s;-webkit-transition:background-color .3s}.input-group-addon .fa{font-size:14px}.input-group-addon .fa-2x,.input-group-addon .fa-lg{font-size:2em}.input-group-addon .fa-3x,.input-group-addon .fa-4x,.input-group-addon .fa-5x{font-size:30px}.input-group-addon .checkbox,.input-group-addon .radio{min-height:0;margin-right:0!important;padding-top:0}.input-group-addon label input[type=checkbox].checkbox+span,.input-group-addon label input[type=checkbox].checkbox+span:before,.input-group-addon label input[type=radio].radiobox+span,.input-group-addon label input[type=radio].radiobox+span:before{margin-right:0}.input-group-addon .onoffswitch,.input-group-addon .onoffswitch-label{margin:0}input[type=text]:focus+.input-group-addon{border-color:#0091d9;background-color:#72a0ce;color:#fff}.has-warning input[type=text]:focus+.input-group-addon{border-color:#7f6a1e;background-color:#cead35;color:#fff}.has-error input[type=text]:focus+.input-group-addon{border-color:#c46a69;background-color:#c46a69;color:#fff}.has-success input[type=text]:focus+.input-group-addon{border-color:#446b46;background-color:#588a5a;color:#fff}.input-icon-left>i{right:auto;left:24px}.input-icon-left .form-control{padding-left:29px}.input-icon-right{position:relative}.input-icon-right .form-control{padding-right:27px}.input-icon-left>i,.input-icon-right>i{position:absolute;right:10px;top:30%;font-size:16px;color:#bfbfbf}.form-actions{display:block;padding:13px 14px 15px;border-top:1px solid rgba(0,0,0,0.1);background:rgba(249,249,249,0.9);margin-top:25px;margin-left:-13px;margin-right:-13px;margin-bottom:-13px;text-align:right}.well .form-actions{margin-left:-19px;margin-right:-19px;margin-bottom:-19px}.well.well-lg .form-actions{margin-left:-24px;margin-right:-24px;margin-bottom:-24px}.well.well-sm .form-actions{margin-left:-9px;margin-right:-9px;margin-bottom:-9px}.popover-content .form-actions{margin:0 -14px -9px;border-radius:0 0 3px 3px;padding:9px 14px}.no-padding .form .form-actions{margin:0;display:block;padding:13px 14px 15px;border-top:1px solid rgba(0,0,0,0.1);background:rgba(248,248,248,0.9);text-align:right;margin-top:25px}:focus{outline:0!important}.filter_column input{padding:0 3px}.filter_column input,.filter_column select{width:100%;color:rgba(0,0,0,0.5);border:1px solid #CCC;border-radius:0;-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)}.uneditable-input:focus,input[type=color]:focus,input[type=date]:focus,input[type=datetime-local]:focus,input[type=datetime]:focus,input[type=email]:focus,input[type=month]:focus,input[type=number]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=time]:focus,input[type=url]:focus,input[type=week]:focus,.filter_column input:focus,.filter_column select:focus,select:focus,textarea:focus{border-color:rgba(82,168,236,0.8);outline:0;outline:thin dotted 9;-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)}.form-control{padding:7px 12px 5px}.form-control,.input-lg,.input-sm,.input-xs{border-radius:0!important}.input-xs{height:24px;padding:3px 10px 1px;font-size:11px;line-height:1.5}.fileinput{padding-top:3px}input[type=checkbox].checkbox,input[type=radio].radiobox{visibility:hidden;position:absolute;z-index:20;width:18px;height:18px}.checkbox input[type=checkbox].checkbox+span,.checkbox input[type=radio].radiobox+span,.checkbox-inline input[type=checkbox].checkbox+span,.checkbox-inline input[type=radio].radiobox+span,.radio input[type=checkbox].checkbox+span,.radio input[type=radio].radiobox+span,.radiobox-inline input[type=checkbox].checkbox+span,.radiobox-inline input[type=radio].radiobox+span{margin-left:-20px}.form-inline .checkbox input[type=checkbox].checkbox+span,.form-inline .checkbox input[type=radio].radiobox+span,.form-inline .checkbox-inline input[type=checkbox].checkbox+span,.form-inline .checkbox-inline input[type=radio].radiobox+span,.form-inline .radio input[type=checkbox].checkbox+span,.form-inline .radio input[type=radio].radiobox+span,.form-inline .radiobox-inline input[type=checkbox].checkbox+span,.form-inline .radiobox-inline input[type=radio].radiobox+span{margin-left:0}input[type=checkbox].checkbox+span,input[type=radio].radiobox+span,label input[type=checkbox].checkbox+span,label input[type=radio].radiobox+span{vertical-align:middle;line-height:20px}input[type=checkbox].checkbox+span,input[type=radio].radiobox+span,input[type=checkbox].checkbox+span:after,input[type=radio].radiobox+span:after,input[type=checkbox].checkbox:before,input[type=radio].radiobox:before{box-sizing:content-box!important;-webkit-box-sizing:content-box!important;-moz-box-sizing:content-box!important}label input[type=checkbox].checkbox+span,label input[type=radio].radiobox+span{position:relative;z-index:19;display:inline-block;margin:0;line-height:17px;min-height:14px;min-width:14px;margin-right:5px}label input[type=checkbox].checkbox+span:hover,label input[type=radio].radiobox+span:hover{cursor:pointer}label input[type=checkbox].checkbox+span:before,label input[type=radio].radiobox+span:before{font-family:FontAwesome;font-size:12px;border-radius:0;content:"\a0";display:inline-block;text-align:center;vertical-align:middle;padding:1px;height:12px;line-height:12px;min-width:12px;margin-right:5px;border:1px solid #bfbfbf;background-color:#f4f4f4;font-weight:400;margin-top:-1px}label input[type=checkbox].checkbox+span:before{content:"\a0"}label input[type=checkbox].checkbox:checked+span{font-weight:700}label input[type=checkbox].checkbox:checked+span:before{content:"\f00c";color:#2e7bcc}label input[type=checkbox].checkbox.style-1+span:before{color:#333;background:#fff;text-shadow:none;-webkit-box-shadow:none!important;box-shadow:none!important;border-width:1px;height:12px;line-height:13px;min-width:12px}label input[type=checkbox].checkbox.style-1:checked+span{font-weight:400}label input[type=checkbox].checkbox.style-1:checked+span:before{color:#333;border-color:#333}label input[type=checkbox].checkbox.style-2+span:before{background:0;border-color:#c1c1c1;-webkit-box-shadow:none;box-shadow:none}label input[type=checkbox].checkbox.style-2:checked+span{font-weight:400}label input[type=checkbox].checkbox.style-2:checked+span:before{content:"\f00c";color:#66665e;border-color:#4d90fe;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNS4xIFdpbmRvd3MiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MUQ0MEM4RUFEQUE4MTFFMkEwMjM5NzlCRjAxM0UwRjciIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MUQ0MEM4RUJEQUE4MTFFMkEwMjM5NzlCRjAxM0UwRjciPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoxRDQwQzhFOERBQTgxMUUyQTAyMzk3OUJGMDEzRTBGNyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDoxRDQwQzhFOURBQTgxMUUyQTAyMzk3OUJGMDEzRTBGNyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PsD/PVAAAAAQSURBVHjaYv7//78vQIABAAlYA05NMPppAAAAAElFTkSuQmCC) #fff}label input[type=checkbox].checkbox.style-3:checked+span:before{color:#fff;border-color:#a90329;background:#a90329}label:active input[type=checkbox].checkbox+span:before{-webkit-box-shadow:inset 0 2px 3px 0 rgba(0,0,0,0.3),0 1px 0 0 rgba(255,255,255,0.4);box-shadow:inset 0 2px 3px 0 rgba(0,0,0,0.3),0 1px 0 0 rgba(255,255,255,0.4)}label:hover input[type=checkbox].checkbox+span:before{color:#2e7bcc;border-color:#2e7bcc}label:hover input[type=checkbox].checkbox.style-1+span:before{border-color:#333}label:hover input[type=checkbox].checkbox.style-2+span:before{-webkit-box-shadow:inset 0 2px 3px 0 rgba(0,0,0,0.1),0 1px 0 0 rgba(255,255,255,0.2);box-shadow:inset 0 2px 3px 0 rgba(0,0,0,0.1),0 1px 0 0 rgba(255,255,255,0.2)}label:hover input[type=checkbox].checkbox.style-2:checked+span:before{-webkit-box-shadow:inset 0 2px 3px 0 rgba(0,0,0,0.3),0 1px 0 0 rgba(255,255,255,0.4);box-shadow:inset 0 2px 3px 0 rgba(0,0,0,0.3),0 1px 0 0 rgba(255,255,255,0.4)}label:hover input[type=checkbox].checkbox.style-3+span:before{color:#fff;border-color:#a90327}label:active input[type=checkbox].checkbox:checked+span:before{color:#fff;background:#2e7bcc;border-color:#2e7bcc}label:active input[type=checkbox].checkbox.style-1:checked+span:before{color:#fff;background:#333;border-color:#333}label:active input[type=checkbox].checkbox.style-2+span:before,label:active input[type=checkbox].checkbox.style-2:checked+span:before{color:#66665e;background:0;border-color:#c1c1c1;-webkit-box-shadow:inset 0 2px 3px 0 rgba(0,0,0,0.3),0 1px 0 0 rgba(255,255,255,0.4);box-shadow:inset 0 2px 3px 0 rgba(0,0,0,0.3),0 1px 0 0 rgba(255,255,255,0.4)}label:active input[type=checkbox].checkbox.style-3:checked+span:before{color:#a90329;background:#fff;border-color:#a90329}label input[type=checkbox][disabled].checkbox+span,label input[type=checkbox][disabled].checkbox:checked+span{color:#a7a7a7;cursor:not-allowed}label input[type=checkbox][disabled].checkbox:checked+span:before{content:"\f00c"}label input[type=checkbox][disabled].checkbox.style-2:checked+span:before{content:"\f00c"}label input[type=checkbox][disabled].checkbox+span:before,label input[type=checkbox][disabled].checkbox:checked+span:before,label input[type=checkbox][disabled].checkbox:checked+span:before{background:#eee!important;border-color:#CCC!important;-webkit-box-shadow:none;color:#a7a7a7;box-shadow:none!important}label:hover input[type=checkbox][disabled].checkbox:checked+span:before{color:#a7a7a7;cursor:not-allowed}label:hover input[type=checkbox][disabled].checkbox:checked+span:before{background:#eee!important;border-color:#CCC!important;-webkit-box-shadow:none;color:#a7a7a7;box-shadow:none!important}label input[type=radio].radiobox+span:before{content:"\a0";border-radius:50%;-webkit-box-shadow:inset 0 2px 3px 0 rgba(0,0,0,0.1),0 1px 0 0 rgba(255,255,255,0.2);box-shadow:inset 0 2px 3px 0 rgba(0,0,0,0.1),0 1px 0 0 rgba(255,255,255,0.2)}label input[type=radio].radiobox:checked+span{font-weight:700}label input[type=radio].radiobox:checked+span:before{content:"\f111";color:#2e7bcc}label input[type=radio].radiobox.style-1+span:before{font-size:9px;background:#fff;text-shadow:none;-webkit-box-shadow:none!important;box-shadow:none!important;border-width:1px;height:13px;line-height:13px;min-width:13px}label input[type=radio].radiobox.style-1:checked+span:before{font-size:10px;color:#333;border-color:#333;background:#fff}label input[type=radio].radiobox.style-1:checked+span{font-weight:400}label input[type=radio].radiobox.style-2:checked+span{font-weight:400}label input[type=radio].radiobox.style-2:checked+span:before{color:#66665e;border-color:#4d90fe;font-size:9px}label input[type=radio].radiobox.style-3:checked+span:before{color:#a90329;border-color:#a90329}label:hover input[type=radio].radiobox+span:before,label:hover input[type=radio].radiobox:checked+span:before{color:#2e7bcc;border-color:#2e7bcc}label:hover input[type=radio].radiobox.style-1+span:before,label:hover input[type=radio].radiobox.style-1:checked+span:before{color:#333;border-color:#333;background:#fff}label:hover input[type=radio].radiobox.style-2:checked+span:before{color:#66665e;border-color:#4d90fe}label:hover input[type=radio].radiobox.style-3+span:before,label:hover input[type=radio].radiobox.style-3:checked+span:before{color:#a90329;border-color:#a90329}label:active input[type=radio].radiobox+span:before{-webkit-box-shadow:inset 0 2px 3px 0 rgba(0,0,0,0.3),0 1px 0 0 rgba(255,255,255,0.4);box-shadow:inset 0 2px 3px 0 rgba(0,0,0,0.3),0 1px 0 0 rgba(255,255,255,0.4)}label input[type=radio][disabled].radiobox+span,label input[type=radio][disabled].radiobox:checked+span,label input[type=radio][disabled].radiobox:checked+span:before{color:#a7a7a7;cursor:not-allowed}label input[type=radio][disabled].radiobox:checked+span:before{content:"\f111"}label input[type=radio][disabled].radiobox+span:before,label input[type=radio][disabled].radiobox:checked+span:before{background:#eee!important;border-color:#CCC!important;-webkit-box-shadow:none;box-shadow:none;color:#a7a7a7}label:active input[type=radio][disabled].radiobox:checked+span:before,label:hover input[type=radio][disabled].radiobox:checked+span:before{background:#eee!important;border-color:#CCC!important;-webkit-box-shadow:none;box-shadow:none;color:#a7a7a7}textarea.clone{position:absolute;visibility:hidden}.textarea-div{background-color:#FFF;border:1px solid #CCC;border-bottom:0;margin:10px 0 0}.textarea-controls{box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:5px;display:block;background-color:#FFF;border:1px solid #CCC;border-top:0;height:43px;line-height:33px;overflow:hidden}.textarea-controls>label{margin:3px 10px 0}.textarea-controls .ams-form .checkbox{padding-left:22px!important}.typearea{cursor:text;overflow-x:hidden;overflow-y:auto;max-height:90px;padding:5px 25px 5px 5px;position:relative;border-bottom:1px solid #EEE}.typearea textarea{width:100%;border-color:transparent!important;box-sizing:border-box;box-shadow:none;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-webkit-box-shadow:none;overflow:hidden;padding:0;margin:0;-webkit-transition:height .2s;transition:height .2s;outline:0;resize:none;min-height:61px}.error-box{max-width:900px;margin:0 auto}.error-text{font-weight:400;color:#fff;letter-spacing:-4px;font-size:700%;margin-bottom:30px;text-shadow:0 1px 0 #ccc,0 2px 0 #bfbfbf,0 3px 0 #bbb,0 4px 0 #b9b9b9,0 5px 0 #aaa,0 6px 1px rgba(0,0,0,0.1),0 0 5px rgba(0,0,0,0.1),0 1px 3px rgba(0,0,0,0.3),0 3px 5px rgba(0,0,0,0.2),0 5px 10px rgba(0,0,0,0.25),0 10px 10px rgba(0,0,0,0.2),0 20px 20px rgba(0,0,0,0.15)}.error-search{width:300px;margin:0 auto 20px}.error-icon-shadow{text-shadow:0 1px 0 #803838,0 2px 0 #a85d5d,0 3px 0 #b86565,0 4px 0 #d86f6f,0 5px 0 #b3a5a5,0 6px 1px rgba(131,51,51,0.1),0 0 5px rgba(102,30,30,0.1),0 1px 3px rgba(95,15,15,0.3),0 3px 5px rgba(100,23,23,0.2),0 5px 10px rgba(114,30,30,0.25),0 10px 10px rgba(94,15,15,0.2),0 20px 20px rgba(121,38,38,0.15)}.form-inline .checkbox,.form-inline .radiobox{padding-left:0}.ams-form{position:relative;margin:0;outline:0;color:#333}.ams-form *,.ams-form :after,.ams-form :before{margin:0;padding:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.ams-form header{display:block;padding:8px 0;border-bottom:1px dashed rgba(0,0,0,0.2);background:#fff;font-size:16px;font-weight:300;color:#232323;margin:10px 14px 0}.modal-dialog .ams-form header{margin:10px -2px 0 0}.ams-form fieldset{display:block;position:relative;padding:10px 15px 5px;border:0;background:rgba(255,255,255,0.9)}.ams-form fieldset[disabled]>section,.ams-form fieldset[disabled]>article,.ams-form fieldset[disabled]>div{opacity:.5}.ams-form fieldset[disabled] LEGEND.checker .checkbox{cursor:pointer}.ams-form fieldset.switched{margin-bottom:0!important}.ams-form fieldset.switched>section,.ams-form fieldset.switched>article,.ams-form fieldset.switched>div{display:none}.ams-form fieldset.switched legend{border-bottom:0}.ams-form fieldset.switched+fieldset{margin-top:0!important}.ams-form fieldset.bordered{margin:10px;border:1px solid rgba(192,192,192,0.8);-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.ams-form fieldset.bordered.switched{border:1px solid transparent}.ams-form fieldset.bordered legend{width:auto;padding:3px 10px 1px;border:1px solid rgba(192,192,192,0.8);-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.ams-form fieldset>fieldset.bordered{margin:10px 0}.ams-form fieldset+fieldset{border-top:1px solid rgba(0,0,0,0.1)}.ams-form legend{padding-top:10px}.ams-form legend.inner,.ams-form legend .inner{font-weight:300;font-size:14.5px!important}.ams-form legend.switcher{cursor:pointer}.ams-form legend.checker,.ams-form legend.switcher{font-weight:300;font-size:16.5px;border:0;padding-bottom:0}.ams-form legend.checker label[for],.ams-form legend.switcher label[for]{cursor:pointer}.ams-form legend .fa{color:#3276b1;font-size:75%}.ams-form legend .fa.fa-stack{font-size:100%;width:1em;height:1em;line-height:1em}.ams-form legend .hint{vertical-align:top;font-size:1em}.ams-form legend label.checkbox{display:inline-block;margin-bottom:0;min-height:18px}.ams-form legend label.checkbox i{position:absolute;left:3px;top:-1px}.ams-form>.modal-viewport>fieldset>legend{padding-top:0}.ams-form section{margin-bottom:10px;position:relative}.ams-form .form-group{padding:5px 10px}.ams-form.form-tight .form-group,.ams-form .form-tight .form-group{padding:1px 10px}.ams-form label.checkbox,.ams-form label.radio{padding-top:0}.ams-form label.input-file img.thumbnail{display:inline-block;margin:4px 10px 0 4px!important;padding:4px!important}.ams-form input.input-lg{height:44px;padding:10px 16px;font-size:17px;line-height:1.33}.ams-form input.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5}.ams-form input.input-xs{height:24px;padding:2px 10px;font-size:11px;line-height:1.5}.ams-form select.input-sm{height:30px;line-height:15px;font-size:12px}.ams-form select.input-sm+i{height:10px}.ams-form select.input-lg{height:44px;line-height:22px;font-size:17px}.ams-form select.input-lg+i{height:11px;top:17px}.ams-form .row{margin:0 -15px}.ams-form .row:after{display:table;content:'';clear:both}.ams-form .col-1{width:8.33%}.ams-form .col-2{width:16.66%}.ams-form .col-3{width:25%}.ams-form .col-4{width:33.33%}.ams-form .col-5{width:41.66%}.ams-form .col-6{width:50%}.ams-form .col-8{width:66.67%}.ams-form .col-9{width:75%}.ams-form .col-10{width:83.33%}.ams-form .col{float:left;min-height:1px;padding-right:15px;padding-left:15px;-webkit-box-sizing:border-box;box-sizing:border-box;-moz-box-sizing:border-box}@media screen and (max-width:600px){.ams-form .col{float:none;width:100%}}@media screen and (max-width:600px){.ams-form .col .label{text-align:left;padding-left:20px}}.ams-form footer{display:block;padding:7px 25px 15px;border-top:1px solid rgba(0,0,0,0.1);background:rgba(248,248,248,0.9)}.ams-form footer:after{display:table;clear:both;content:''}.ams-form footer .btn{float:right;height:31px;margin:10px 0 0 5px;padding:0 22px;font:300 15px/29px Ubuntu,Helvetica,Arial,sans-serif;cursor:pointer}.ams-form footer .btn.btn-info{float:left}.ams-form footer .submit-message{display:inline-block}.ams-form .message{display:none;color:#6fb679}.ams-form .message i{display:block;margin:0 auto 20px;width:81px;height:81px;border:1px solid #6fb679;border-radius:50%;font-size:30px;line-height:81px}.ams-form.submitted fieldset,.ams-form.submitted footer{display:none}.ams-form.submitted .message{display:block;padding:25px 30px;background:rgba(255,255,255,0.9);font:300 18px/27px Ubuntu,Helvetica,Arial,sans-serif;text-align:center}.ams-form .note{margin-top:6px;padding:0 1px;font-size:11px;line-height:15px;color:#999}.ams-form .note a{font-size:13px}.ams-form .note-success{color:#6fb679}.ams-form .control-label{display:block;margin-top:4px;margin-bottom:6px;padding-top:0;line-height:19px;font-weight:400;font-size:13px;color:#666;text-align:right}@media screen and (max-width:992px){.ams-form .control-label{text-align:left;margin-bottom:0}}.ams-form .control-label.col{text-align:right}@media screen and (max-width:600px){.ams-form .control-label.col{text-align:left;padding-left:20px}}.ams-form .control-label span{margin-right:10px}.ams-form .control-label span::after{content:" *";color:transparent}.ams-form .control-label span>.hint{margin-top:-2px}.ams-form .control-label .col{margin:0;padding-top:7px}.ams-form label.input span.textline-field{display:block;margin-top:4px;margin-bottom:6px;padding-top:0;line-height:19px;font-size:13px}.ams-form .required-field .control-label span::after{color:red}.ams-form .tooltip{position:absolute;z-index:99999;left:-9999px;padding:2px 8px 3px;font-size:11px;line-height:16px;font-weight:400;background:rgba(0,0,0,0.9);color:#fff;opacity:0;transition:margin .3s,opacity .3s;-webkit-transition:margin .3s,opacity .3s}.ams-form .tooltip:after{position:absolute;content:''}.ams-form .tooltip-top-right{bottom:100%;margin-bottom:15px}.ams-form .tooltip-top-right:after{top:100%;right:11px;border-top:4px solid rgba(0,0,0,0.9);border-right:4px solid transparent;border-left:4px solid transparent}.ams-form .input input:focus+.tooltip-top-right,.ams-form .textarea textarea:focus+.tooltip-top-right{right:0;left:auto;margin-bottom:5px}.ams-form .tooltip-top-left{bottom:100%;margin-bottom:15px}.ams-form .tooltip-top-left:after{top:100%;left:11px;border-top:4px solid rgba(0,0,0,0.9);border-right:4px solid transparent;border-left:4px solid transparent}.ams-form .input input:focus+.tooltip-top-left,.ams-form .textarea textarea:focus+.tooltip-top-left{right:auto;left:0;margin-bottom:5px}.ams-form .tooltip-right{top:4px;white-space:nowrap;margin-left:15px}.ams-form .tooltip-right:after{top:6px;right:100%;border-top:4px solid transparent;border-right:4px solid rgba(0,0,0,0.9);border-bottom:4px solid transparent}.ams-form .input input:focus+.tooltip-right,.ams-form .textarea textarea:focus+.tooltip-right{left:100%;margin-left:5px}.ams-form .tooltip-left{top:4px;white-space:nowrap;margin-right:15px}.ams-form .tooltip-left:after{top:6px;left:100%;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid rgba(0,0,0,0.9)}.ams-form .input input:focus+.tooltip-left,.ams-form .textarea textarea:focus+.tooltip-left{right:100%;left:auto;margin-right:5px}.ams-form .tooltip-bottom-right{top:100%;margin-top:15px}.ams-form .tooltip-bottom-right:after{bottom:100%;right:11px;border-right:4px solid transparent;border-bottom:4px solid rgba(0,0,0,0.9);border-left:4px solid transparent}.ams-form .input input:focus+.tooltip-bottom-right,.ams-form .textarea textarea:focus+.tooltip-bottom-right{right:0;left:auto;margin-top:5px}.ams-form .tooltip-bottom-left{top:100%;margin-top:15px}.ams-form .tooltip-bottom-left:after{bottom:100%;left:11px;border-right:4px solid transparent;border-bottom:4px solid rgba(0,0,0,0.9);border-left:4px solid transparent}.ams-form .input input:focus+.tooltip-bottom-left,.ams-form .textarea textarea:focus+.tooltip-bottom-left{right:auto;left:0;margin-top:5px}.ams-form .inline-group{margin:0 -30px -4px 0}.ams-form .inline-group:after{content:'';display:table;clear:both}.ams-form .inline-group .checkbox,.ams-form .inline-group .radio{float:left;margin-right:30px}.ams-form .inline-group .checkbox:last-child,.ams-form .inline-group .radio:last-child{margin-bottom:4px}.ams-form .input .inline-group{margin:0 0 -4px 0}.ams-form .btn{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ams-form .button{float:right;height:31px;overflow:hidden;margin:10px 0 0 5px;padding:0 25px;outline:0;border:0;font:300 15px/31px Ubuntu,Helvetica,Arial,sans-serif;text-decoration:none;color:#fff;cursor:pointer;background-color:#3276b1;opacity:.8;transition:opacity .2s;-webkit-transition:opacity .2s}.ams-form .button:hover{opacity:1}.ams-form .button.button-secondary{background-color:#b3b3b3}.ams-form .button,.ams-form .checkbox,.ams-form .input,.ams-form .radio,.ams-form .select,.ams-form .textarea,.ams-form .toggle{display:block;position:relative;font-weight:400}.ams-form .input input,.ams-form .select select,.ams-form .textarea textarea{display:block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;width:100%;height:28px;padding:6px 8px;outline:0;border-width:1px;border-style:solid;border-radius:0;background:#fff;font:13px/16px Ubuntu,Helvetica,Arial,sans-serif;color:#404040;appearance:normal;-moz-appearance:none;-webkit-appearance:none}.ams-form .input input[readonly],.ams-form .select select[readonly],.ams-form .textarea textarea[readonly]{border-bottom:1px solid #ccc!important}.ams-form .input input.display-mode,.ams-form .select select.display-mode,.ams-form .textarea textarea.display-mode{border:0;padding:0;margin-top:2px;margin-bottom:3px;height:14px;line-height:1em}.ams-form .input span.textarea-widget,.ams-form .textarea span.textarea-widget{display:block;width:100%;min-height:14px;padding:4px 0;border-bottom:1px solid #ccc!important}.ams-form .input .i18n-content input[readonly],.ams-form .select .i18n-content select[readonly],.ams-form .textarea .i18n-content textarea[readonly]{border-width:0!important}.ams-form .input .i18n-content .textarea-widget{display:block;min-height:12px}.ams-form .input input:focus+.tooltip,.ams-form .textarea textarea:focus+.tooltip{opacity:1}.ams-form .input .icon-prepend+input,.ams-form .textarea .icon-prepend+textarea{padding-left:37px}.ams-form .input .icon-append+input,.ams-form .textarea .icon-append+textarea{padding-right:37px}.ams-form .input .icon-prepend+.icon-append+input,.ams-form .textarea .icon-prepend+.icon-append+textarea{padding-left:37px}.ams-form .input.with-icons .icon-append-2+input{padding-right:60px}.ams-form .input-file{position:relative}.ams-form .input-file .button{position:absolute;top:3px;right:3px;float:none;height:22px;margin:0;padding:0 14px;font-size:13px;line-height:22px}.ams-form .input-file .button:hover{-webkit-box-shadow:none;box-shadow:none}.ams-form .input-file .button input{position:absolute;top:0;right:0;padding:0;font-size:30px;cursor:pointer;opacity:0}.ams-form .select select{padding:5px}.ams-form .select i{position:absolute;top:9px;right:11px;width:5px;height:11px;background:#fff}.ams-form .select i:before,.ams-form .select i:after{content:'';position:absolute;right:0;border-right:4px solid transparent;border-left:4px solid transparent}.ams-form .select i:before{top:0;border-bottom:4px solid #404040}.ams-form .select i:after{bottom:0;border-top:4px solid #404040}.ams-form .select-widget .selected-option{display:inline-block;padding:4px 8px}.ams-form .select-multiple select{height:auto}.ams-form .textarea textarea{height:auto;resize:none}.ams-form .textarea-resizable textarea{resize:vertical}.ams-form .textarea-expandable textarea{height:31px}.ams-form .textarea-expandable textarea:focus{height:auto}.ams-form .checkbox,.ams-form .radio{margin-bottom:4px;padding-left:25px;line-height:25px;color:#404040;cursor:pointer;font-size:13px}.ams-form .checkbox:last-child,.ams-form .radio:last-child{margin-bottom:0}.ams-form .checkbox i,.ams-form .radio i{display:block;position:absolute;top:3px;left:0;width:17px;height:17px;outline:0;border-width:1px;border-style:solid;background:#FFF}.ams-form .checkbox input,.ams-form .radio input{position:absolute;left:-9999px}.ams-form .checkbox input+i:after,.ams-form .radio input+i:after{position:absolute;opacity:0;transition:opacity .1s;-webkit-transition:opacity .1s}.ams-form .checkbox input:checked+i:after,.ams-form .radio input:checked+i:after{opacity:1}.ams-form .radio input+i:after{background-color:#3276b1}.ams-form .checkbox input+i:after{content:'\f00c';top:-1px;left:1px;width:15px;height:15px;font:400 16px/19px FontAwesome;text-align:center}.ams-form .checkbox input+i:after{color:#3276b1}.ams-form .checkbox input:checked:hover+i:after{content:'\f00d'}.ams-form .checkbox input:checked:disabled:hover+i:after{content:'\f00c'}.ams-form .radio input+i:after{content:'';top:4px;left:4px;width:9px;height:9px;border-radius:50%}.ams-form .checkbox+.checkbox,.ams-form .radio+.radio{margin-top:0}.ams-form.table td .checkbox i,.ams-form.table td .radio i,.ams-form.table th .checkbox i,.ams-form.table th .radio i{top:0!important}.ams-form .inner .checkbox{min-height:13px}.ams-form .inner .checkbox i{width:13px;height:13px}.ams-form .inner .checkbox input+i:after{width:11px;height:11px;font:300 12px/16px FontAwesome}.ams-form .toggle{margin-bottom:4px;padding-right:61px;font-size:15px;line-height:25px;color:#404040;cursor:pointer}.ams-form .toggle:last-child{margin-bottom:0}.ams-form .toggle.state-error input:checked+i{background:#fff0f0}.ams-form .toggle.state-success input:checked+i{background:#f0fff0}.ams-form .toggle input{position:absolute;left:-9999px}.ams-form .toggle input:checked+i:before{right:36px}.ams-form .toggle input:checked+i:after{content:attr(data-swchon-text);text-align:right}.ams-form .toggle i{display:block;position:absolute;content:'';top:4px;right:0;width:49px;height:17px;border-width:1px;border-style:solid;border-radius:12px;background:#fff}.ams-form .toggle i:before{display:block;position:absolute;content:'';z-index:1;top:4px;right:4px;width:9px;height:9px;border-radius:50%;opacity:1;transition:right .2s;-webkit-transition:right .2s;background-color:#3276b1}.ams-form .toggle i:after{position:absolute;content:attr(data-swchoff-text);top:2px;right:8px;left:8px;font-style:normal;font-size:9px;line-height:17px;font-weight:700;text-align:left;color:#5f5f5f}.ams-form .checkbox:hover i,.ams-form .radio:hover i,.ams-form .toggle:hover i{-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.1);box-shadow:inset 0 1px 1px rgba(0,0,0,0.1)}.ams-form .checkbox:active i,.ams-form .radio:active i,.ams-form .toggle:active i{background:#f0f0f0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.1);box-shadow:inset 0 1px 1px rgba(0,0,0,0.1)}.ams-form .checkbox input:checked+i,.ams-form .radio input:checked+i,.ams-form .toggle input:checked+i{border-color:#3276b1}.ams-form .rating{margin-bottom:4px;font-size:13px;line-height:25px;color:#404040}.ams-form .rating:last-child{margin-bottom:0}.ams-form .rating.state-error+em{margin-top:-4px;margin-bottom:4px}.ams-form .rating input{position:absolute;left:-9999px}.ams-form .rating input+label:hover,.ams-form .rating input+label:hover ~ label{color:#3276b1}.ams-form .rating input:checked ~ label{color:#3276b1}.ams-form .rating label{display:block;float:right;height:17px;margin-top:5px;padding:0 2px;font-size:17px;line-height:17px;cursor:pointer;color:#ccc;transition:color .3s;-webkit-transition:color .3s}.ams-form .icon-append,.ams-form .icon-prepend{position:absolute;top:4px;width:20px;height:20px;font-size:14px;line-height:20px;text-align:center;color:#a2a2a2}.ams-form .icon-append.fa-stack .fa-stack-2x,.ams-form .icon-prepend.fa-stack .fa-stack-2x{font-size:1.6em;left:1px}.ams-form .icon-append.fa-stack .fa-stack-1x,.ams-form .icon-prepend.fa-stack .fa-stack-1x{left:1px;top:1px}.ams-form .icon-append{right:4px;padding-left:2px;border-left-width:1px;border-left-style:solid}.ams-form .icon-append-2{right:31px}.ams-form .icon-prepend{left:4px;padding-right:2px;border-right-width:1px;border-right-style:solid}.ams-form .icon-prepend-2{left:31px}.ams-form .checkbox i,.ams-form .icon-append,.ams-form .icon-prepend,.ams-form .input input,.ams-form .radio i,.ams-form .select select,.ams-form .textarea textarea,.ams-form .toggle i{border-color:#ccc;transition:border-color .3s;-webkit-transition:border-color .3s}.ams-form .input.bordered:hover,.ams-form .checkbox:hover i,.ams-form .input:hover input,.ams-form .radio:hover i,.ams-form .select:hover select,.ams-form .textarea:hover textarea,.ams-form .toggle:hover i{border-color:rgba(82,168,236,0.7)}.ams-form .checkbox input:focus+i,.ams-form .input input:focus,.ams-form .radio input:focus+i,.ams-form .select select:focus,.ams-form .textarea textarea:focus,.ams-form .toggle input:focus+i{border-color:rgba(82,168,236,0.7);outline:0;outline:thin dotted 9;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.7);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.7);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.7)}.ams-form .checkbox.state-error i,.ams-form .radio.state-error i,.ams-form .state-error input,.ams-form .state-error select,.ams-form .state-error textarea,.ams-form .toggle.state-error i{background:#fff0f0;border-color:rgba(255,60,60,0.8)!important}.ams-form .checkbox.state-error i:focus,.ams-form .radio.state-error i:focus,.ams-form .state-error input:focus,.ams-form .state-error select:focus,.ams-form .state-error textarea:focus,.ams-form .toggle.state-error i:focus{-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(255,60,60,0.6)!important;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(255,60,60,0.6)!important;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(255,60,60,0.6)!important}.ams-form .state-error .select2-container .select2-choice,.ams-form .state-error .select2-container .select2-choices{border-color:rgba(255,60,60,0.8)!important}.ams-form .state-error .select2-container .select2-choice:focus,.ams-form .state-error .select2-container .select2-choices:focus{-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(255,60,60,0.6)!important;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(255,60,60,0.6)!important;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(255,60,60,0.6)!important}.ams-form .checkbox.state-success i,.ams-form .radio.state-success i,.ams-form .state-success input,.ams-form .state-success select,.ams-form .state-success textarea,.ams-form .toggle.state-success i{background:#f0fff0;border-color:#7dc27d}.ams-form .button.state-disabled,.ams-form .checkbox.state-disabled,.ams-form .input.state-disabled input,.ams-form .radio.state-disabled,.ams-form .select.state-disabled,.ams-form .textarea.state-disabled,.ams-form .toggle.state-disabled{cursor:default!important;opacity:.6!important}.ams-form .checkbox.state-disabled:hover i,.ams-form .input.state-disabled:hover input,.ams-form .radio.state-disabled:hover i,.ams-form .select.state-disabled:hover select,.ams-form .textarea.state-disabled:hover textarea,.ams-form .toggle.state-disabled:hover i{border-color:#e5e5e5!important}.ams-form .state-disabled.checkbox input+i:after,.ams-form .state-disabled.checkbox input:checked+i,.ams-form .state-disabled.radio input+i:after,.ams-form .state-disabled.radio input:checked+i,.ams-form .state-disabled.toggle input:checked+i{border-color:#e5e5e5!important;color:#333!important}.ams-form .ui-widget-content .ui-spinner-input{margin:0;border:0;-webkit-box-shadow:none!important;box-shadow:none!important;height:29px}.ams-form .state-error{color:#d56161}.ams-form .state-error select+i{background:#fff0f0;-webkit-box-shadow:0 0 0 9px #fff0f0;box-shadow:0 0 0 9px #fff0f0}.ams-form .state-error+em{display:block;margin-top:6px;padding:0 1px;font-style:normal;font-size:11px;line-height:15px;color:#d56161}.ams-form .state-success select+i{background:#f0fff0;-webkit-box-shadow:0 0 0 9px #f0fff0;box-shadow:0 0 0 9px #f0fff0}.ams-form .state-disabled.radio input+i:after{background-color:#333}.ams-form .form-tiny .form-group{padding:0 10px}.ams-form .form-tiny .control-label{margin-top:2px;margin-bottom:3px;line-height:14px}.ams-form .form-tiny label.input span.textline-field{margin-top:2px;margin-bottom:3px;line-height:14px}.ams-form .form-nomargin .control-label,.ams-form.form-nomargin .control-label{margin-top:0;margin-bottom:0}.ams-form .form-nomargin label.input span.textline-field,.ams-form.form-nomargin label.input span.textline-field{margin-top:0;margin-bottom:0}.ams-form .form-nopadding .form-group,.ams-form.form-nopadding .form-group{padding:0 10px 1px}.ams-form-modal{position:fixed;z-index:1;display:none;width:400px}.ams-form-modal-overlay{position:fixed;top:0;left:0;display:none;width:100%;height:100%;background:rgba(0,0,0,0.7)}.state-error .icon-append,.state-error .icon-prepend{color:#ed1c24}.editableform{margin-bottom:0}.editableform .control-group{margin-bottom:0;white-space:nowrap}.editableform .editable-date{padding:0;margin:0;float:left}.editableform-loading{background:url(../img/loading.gif) center center no-repeat;height:25px;width:auto;min-width:25px}.editable-buttons{display:inline-block;vertical-align:top;margin-left:7px;zoom:1;*display:inline}.editable-buttons.editable-buttons-bottom{display:block;margin-top:7px;margin-left:0}.editable-buttons .editable-cancel{margin-left:7px}.editable-buttons button.ui-button-icon-only{height:24px;width:30px}.editable-inline .add-on .icon-th{margin-top:3px;margin-left:1px}.editable-inline .editableform-loading{background-position:left 5px}.editable-input{vertical-align:top;display:inline-block;width:auto;white-space:normal;zoom:1;*display:inline}.editable-input .datepicker{top:0;left:0;padding:4px}.editable-input .datepicker:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:rgba(0,0,0,0.2);position:absolute;top:-7px;left:6px}.editable-input .datepicker:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;position:absolute;top:-6px;left:7px}.editable-input .datepicker>div{display:none}.editable-input .datepicker table{width:100%;min-width:214px;margin:0}.editable-input .datepicker thead tr:first-child th{cursor:pointer}.editable-input .datepicker thead tr:first-child th:hover{background:#eee}.editable-input .datepicker td,.editable-input .datepicker th{text-align:center;width:24px;height:20px}.editable-input .datepicker th.switch{width:145px}.editable-input .datepicker th.next,.editable-input .datepicker th.prev{font-size:19.5px}.editable-input .datepicker td span{display:block;width:47px;height:54px;line-height:54px;float:left;margin:2px;cursor:pointer}.editable-input .datepicker td span:hover{background:#eee}.editable-input .datepicker td span.active{background:#3276b1;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);border-radius:3px}.editable-input .datepicker td span.old{color:#555}.editable-input .datepicker td.day:hover{background:#eee;cursor:pointer}.editable-input .datepicker td.day.disabled,.editable-input .datepicker td.new,.editable-input .datepicker td.old{color:#555}.editable-input .datepicker td.active,.editable-input .datepicker td.active:hover{background:#3276b1;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);border-radius:3px}.editable-input .datepicker.prev i,.editable-input .datepicker.next i{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:14px}.editable-input .datepicker.prev i:before{content:"\f060"}.editable-input .datepicker.next i:before{content:"\f061"}.editable-checklist label{white-space:nowrap}.editable-checklist label input[type=checkbox],.editable-checklist label span{vertical-align:middle;margin:0}.editable-wysihtml5{width:566px;height:250px}.editable-pre-wrapped{white-space:pre-wrap}.editable-container.editable-popup{max-width:none!important}.editable-container.popover{width:auto}.editable-container.editable-inline{display:inline-block;vertical-align:middle;width:auto;zoom:1;*display:inline}.editable-container.ui-widget{font-size:inherit;z-index:9990}.editable-click,a.editable-click,a.editable-click:hover{text-decoration:none;border-bottom:dashed 1px #08c}.editable-click.editable-disabled,a.editable-click.editable-disabled,a.editable-click.editable-disabled:hover{color:#585858;cursor:default;border-bottom:0}.editable-empty,.editable-empty:focus,.editable-empty:hover{font-style:italic;color:#D14;text-decoration:none}.editable-unsaved{font-weight:700}.editable-bg-transition{-webkit-transition:background-color 1400ms ease-out;transition:background-color 1400ms ease-out}.form-horizontal .editable{padding-top:5px;display:inline-block}.editable-address{display:block;margin-bottom:5px}.editable-address span{width:70px;display:inline-block}.editable-clear{clear:both;font-size:.9em;text-decoration:none;text-align:right}.editable-clear-x{background:url(../img/clear.png) center center no-repeat;display:block;width:13px;height:13px;position:absolute;opacity:.6;z-index:100;top:50%;right:6px;margin-top:-6px}.editable-clear-x:hover{opacity:1}.editable-error-block{max-width:300px;margin:5px 0 0;width:auto;white-space:normal}.editable-error-block.ui-state-error{padding:3px}.editable-error{color:red}.input-append.date .add-on i,.input-prepend.date .add-on i{display:block;cursor:pointer;width:16px;height:16px}.ui-timepicker-div .ui-widget-header{margin-bottom:8px}.ui-timepicker-div dl{text-align:left}.ui-timepicker-div dl dt{float:left;clear:left;padding:0 0 0 5px}.ui-timepicker-div dl dd{margin:17px 10px 12px 40%}.ui-timepicker-div td{font-size:90%}.ui-tpicker-grid-label{background:0;border:0;margin:0;padding:0}.ui-timepicker-rtl{direction:rtl}.ui-timepicker-rtl dl{text-align:right;padding:0 5px 0 0}.ui-timepicker-rtl dl dt{float:right;clear:right}.ui-timepicker-rtl dl dd{margin:0 40% 10px 10px}#login{background:#fff;overflow:visible}#login .container{border:0}#login #header{margin:0;height:71px;border-bottom:1px solid #eee!important;overflow:hidden;padding:0 30px;-webkit-background-clip:padding-box;border-width:0;min-height:28px;background:#f4f4f4!important;margin-bottom:20px}@media(min-width:768px) and (max-width:880px){#login #header{padding:0 5px!important}}@media only screen and (min-width:0) and (max-width:679px){#login #header{padding:0 5px!important}}#login #header #logo{margin-top:22px;margin-left:0}@media only screen and (min-width:0) and (max-width:679px){#login #header #logo{margin-top:22px}}#login #header #logo img{width:137px}@media only screen and (min-width:0) and (max-width:679px){#login #header #logo img{width:135px}}#login-header-space{float:right;text-align:right;display:block;vertical-align:middle;line-height:71px}#login-header-space>:first-child{font-size:13px;margin-right:14px;vertical-align:-3px;font-weight:400}#login-header-space>*{display:inline-block}#login-header-space .btn{font-weight:700;text-transform:uppercase}#login #main{background:#fff;margin:0}#login .hero{background-image:url(../img/gradient/login.png);background-repeat:no-repeat;background-position:0 137px;height:360px;width:100%;float:left}#login h4.paragraph-header{color:#565656;font-size:15px;font-weight:400;line-height:22px;margin-top:15px;width:270px}#login h5.about-heading{color:#565656;font-size:15px;font-weight:700;line-height:24px;margin:0 0 5px}#login .login-header-big{font-weight:400}#login .login-desc-box-l{min-height:350px;width:50%}#login .login-app-icons{vertical-align:top;margin-top:90px;width:300px}.bootstrapWizard{display:block;list-style:none;padding:0;position:relative;width:100%}.bootstrapWizard a:active,.bootstrapWizard a:focus,.bootstrapWizard a:hover{text-decoration:none}.bootstrapWizard li{display:block;float:left;width:25%;text-align:center;padding-left:0}.bootstrapWizard li:before{border-top:3px solid #55606e;content:"";display:block;font-size:0;overflow:hidden;position:relative;top:11px;right:1px;width:100%;z-index:1}.bootstrapWizard li:first-child:before{left:50%;max-width:50%}.bootstrapWizard li:last-child:before{max-width:50%;width:50%}.bootstrapWizard li .step{background:#b2b5b9;color:#fff;display:inline;font-size:15px;font-weight:700;padding:7px 13px;border:3px solid transparent;border-radius:50%;line-height:normal;position:relative;text-align:center;z-index:2;-webkit-transition:all .1s linear 0s;transition:all .1s linear 0s}.bootstrapWizard li .step i{font-size:10px;font-weight:400;position:relative;top:-1.5px}.bootstrapWizard li.complete .step{background:#0aa66e;padding:1px 6px;border:3px solid #55606e}.bootstrapWizard li.active .step,.bootstrapWizard li.active.complete .step{background:#0091d9;color:#fff;font-weight:700;padding:7px 13px;font-size:15px;border-radius:50%;border:3px solid #55606e}.bootstrapWizard li .title{color:#bfbfbf;display:block;font-size:13px;line-height:15px;max-width:100%;position:relative;table-layout:fixed;text-align:center;top:20px;word-wrap:break-word;z-index:104}.bootstrapWizard li.active .title,.bootstrapWizard li.complete .title{color:#2b3d53}.wizard-actions{display:block;list-style:none;padding:0;position:relative;width:100%}.wizard-actions li{display:inline}.fuelux .wizard{position:relative;overflow:hidden;background-color:#f9f9f9;border:1px solid #d4d4d4;border-radius:4px;*zoom:1;-webkit-box-shadow:0 1px 4px rgba(0,0,0,0.065);box-shadow:0 1px 4px rgba(0,0,0,0.065)}.fuelux .wizard:after,.fuelux .wizard:before{display:table;line-height:0;content:""}.fuelux .wizard:after{clear:both}.fuelux .wizard ul{width:4000px;padding:0;margin:0;list-style:none outside none}.fuelux .wizard ul.previous-disabled li.complete{cursor:default}.fuelux .wizard ul.previous-disabled li.complete:hover{color:#356e35;cursor:default;background:#f3f4f5}.fuelux .wizard ul.previous-disabled li.complete:hover .chevron:before{border-left-color:#f3f4f5}.fuelux .wizard ul li{position:relative;float:left;height:46px;padding:0 20px 0 30px;margin:0;font-size:16px;line-height:46px;color:#999;cursor:default;background:#ededed}.fuelux .wizard ul li:first-child{padding-left:20px;border-radius:4px 0 0 4px}.fuelux .wizard ul li.complete{color:#296829;background:#f3f4f5}.fuelux .wizard ul li.complete:hover{cursor:pointer;background:#e7eff8}.fuelux .wizard ul li.complete:hover .chevron:before{border-left:14px solid #e7eff8}.fuelux .wizard ul li.complete .chevron:before{border-left:14px solid #f3f4f5}.fuelux .wizard ul li.active{color:#3a87ad;background:#f1f6fc}.fuelux .wizard ul li.active .chevron:before{border-left:14px solid #f1f6fc}.fuelux .wizard ul li .chevron{position:absolute;top:0;right:-14px;z-index:1;display:block;border:24px solid transparent;border-right:0;border-left:14px solid #d4d4d4}.fuelux .wizard ul li .chevron:before{position:absolute;top:-24px;right:1px;display:block;border:24px solid transparent;border-right:0;border-left:14px solid #ededed;content:""}.fuelux .wizard ul li .badge{margin-right:8px}.fuelux .wizard .actions{position:absolute;right:0;z-index:2;float:right;padding-right:15px;padding-left:15px;line-height:46px;vertical-align:middle;background-color:#eee;border-left:1px solid #d4d4d4}.fuelux .wizard .actions a{margin-right:8px;font-size:12px;line-height:45px}.fuelux .wizard .actions .btn-prev i{margin-right:5px}.fuelux .wizard .actions .btn-next i{margin-left:5px}.fuelux .fuelux .step-content .step-pane{display:none}.fuelux .fuelux .step-content .active{display:block}.fuelux .fuelux .step-content .active .btn-group .active{display:inline-block}.ams-metro-tile{float:left;display:block;background-color:#fff;width:100px;height:70px;cursor:pointer;-webkit-box-shadow:inset 0 0 1px #FFC;box-shadow:inset 0 0 1px #FFC;border:1px dotted #c5c5c5;text-decoration:none;color:#fff;font-weight:300;font-smooth:always;margin:0 10px 20px 0;padding:5px;position:relative}.ams-metro-tile:hover{z-index:10;-webkit-transform:scale(1.07);-moz-transform:scale(1.07)}.ams-metro-tile.big-cubes{width:120px;height:120px}.ams-metro-tile.double{width:249px}.ams-metro-tile:active{top:1px;left:1px}.ams-metro-tile .iconbox{text-align:center}.ams-metro-tile .iconbox i{display:block;margin:15px auto 0;height:75px}.ams-metro-tile .iconbox span{display:block;text-align:left;line-height:1em}.ams-metro-tile .iconbox span>span{position:absolute;right:-5px;bottom:-10px;border-radius:50%;padding:6px 4px 3px;border:1px solid #fff}.mce-edit-area>iframe{min-height:400px!important}.client-form header{padding:15px 13px;margin:0;border-bottom-style:solid;border-bottom-color:rgba(0,0,0,0.1);background:rgba(248,248,248,0.9)}.customfile-button{padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.428571429;text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;border:1px solid #ccc;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.btn,a:link,button{-webkit-tap-highlight-color:rgba(169,3,41,0.5)}button{background-color:#ddd}button:hover{background-color:#ccc}.btns{margin:0;padding:0;list-style:none}.btns>li{display:inline-block;margin-bottom:7px}.btn{padding:6px 12px;border-radius:2px;box-shadow:inset 0 -2px 0 rgba(0,0,0,0.05);-webkit-box-shadow:inset 0 -2px 0 rgba(0,0,0,0.05)}.btn-toolbar .btn{padding:4px}.btn:active{position:relative;top:1px;left:1px}.btn.btn-ribbon{background-color:#5b6771;color:#fff;padding:1px 5px;line-height:20px;vertical-align:middle;height:21px;display:block;border:0;float:left;margin:0 8px 0 0;cursor:pointer}.btn.btn-ribbon>i{font-size:111%}.btn-xs{padding:1px 5px;line-height:1.3em}.btn-sm{padding:3px 10px}.btn-lg{padding:9px 15px}.btn-xl{padding:11px 15px}.btn-circle{width:30px;height:30px;text-align:center;padding:7px 0 5px;font-size:12px;line-height:18px;border-radius:50%}.btn-circle.btn-lg{width:50px;height:50px;padding:9px 15px 7px;font-size:18px;line-height:30px;border-radius:50%}.btn-circle.btn-xl{width:70px;height:70px;padding:11px 15px 9px;font-size:24px;line-height:50px;border-radius:50%}.btn-metro{margin:0 0 20px;padding-top:15px;padding-bottom:15px}.btn-metro>span{display:block;vertical-align:bottom;margin-top:10px;text-transform:uppercase}.btn-metro>span>span.label{position:absolute;top:0;right:0}.btn-label{position:relative;left:-12px;display:inline-block;padding:7px 12px 5px;background:rgba(0,0,0,0.15);border-radius:3px 0 0 3px}.btn-labeled{padding-top:0;padding-bottom:0}.btn-select-tick i{display:none}.btn-select-tick .btn:hover i{opacity:.3;display:block}.btn-select-tick .active i{display:block;opacity:1!important}.btn-header.pull-right{margin-left:6px}@media(min-width:768px) and (max-width:979px){.btn-header a{margin-top:9px!important}}@media(min-width:768px) and (max-width:880px){.btn-header a{margin-top:9px!important;line-height:26px!important}}@media(max-width:767px){.btn-header a{margin-top:5px!important;width:40px!important;height:39px!important;line-height:34px!important}}@media only screen and (min-width:0) and (max-width:679px){.btn-header a{margin-top:5px!important;width:40px!important;height:39px!important;line-height:34px!important}}@media only screen and (min-width:320px) and (max-width:479px){.btn-header a{margin-top:5px!important;width:40px!important;height:39px!important;line-height:34px!important}}.btn-header a>span{font-size:13px;font-weight:400;line-height:30px;height:30px;display:inline-block}@media(min-width:768px) and (max-width:880px){.btn-header.transparent a{border:0!important;background:0;margin-left:0;width:25px!important;-webkit-box-shadow:none!important;box-shadow:none!important}.btn-header.transparent a:hover{color:#a90329}}@media(max-width:767px){.btn-header.transparent a:hover{color:#a90329}}@media only screen and (min-width:0) and (max-width:679px){.btn-header.transparent a{border:0!important;background:0;margin-left:0;width:25px!important;-webkit-box-shadow:none!important;box-shadow:none!important}.btn-header.transparent a:hover{color:#a90329}}@media only screen and (min-width:320px) and (max-width:479px){.btn-header.transparent a{border:0!important;background:0;margin-left:0;width:25px!important;-webkit-box-shadow:none!important;box-shadow:none!important}.btn-header.transparent a:hover{color:#a90329}}.btn-header>:first-child>a{border-radius:2px;cursor:default!important;display:inline-block;font-weight:700;height:30px;min-width:30px;padding:3px;text-align:center;text-decoration:none!important;-moz-user-select:none;-webkit-user-select:none;background-color:#f8f8f8;background-image:-webkit-gradient(linear,left top,left bottom,from(#f8f8f8),to(#f1f1f1));background-image:-webkit-gradient(linear,top left,bottom left,from(#f8f8f8),to(#f1f1f1));background-image:-webkit-linear-gradient(top,#f8f8f8,#f1f1f1);background-image:linear-gradient(top,#f8f8f8,#f1f1f1);border:1px solid #bfbfbf;color:#6d6a69;font-size:17px;margin:10px 0 0}.btn-header>:first-child>a:hover{border:1px solid #bfbfbf;color:#222;-webkit-transition:all 0s;transition:all 0s;cursor:pointer;-webkit-box-shadow:inset 0 0 4px 1px rgba(0,0,0,0.08);box-shadow:inset 0 0 4px 1px rgba(0,0,0,0.08)}.btn-header>:first-child>a:active{background-color:#e8e8e8;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#e8e8e8),color-stop(100%,#ededed));background-image:-webkit-gradient(linear,top left,bottom left,from(#e8e8e8),to(#ededed));background-image:-webkit-linear-gradient(top,#e8e8e8 0,#ededed 100%);background-image:linear-gradient(to bottom,#e8e8e8 0,#ededed 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e8e8e8',endColorstr='#ededed',GradientType=0);-webkit-box-shadow:inset 0 0 3px 1px rgba(0,0,0,0.15);box-shadow:inset 0 0 3px 1px rgba(0,0,0,0.15)}.ribbon-button-alignment{padding-top:10px;display:inline-block}.ribbon-button-alignment.pull-right>.btn.btn-ribbon{margin:0 0 0 8px}.header-btn{margin-top:5px}.widget-header>:first-child{margin:13px 0}.widget-toolbar{display:inline-block;position:relative;float:right;width:auto;height:29px;line-height:29px;border-left:1px solid rgba(0,0,0,0.09);cursor:pointer;padding:0 8px;text-align:center}.widget-toolbar.no-border{border-left:0}.widget-toolbar>:first-child{text-align:left}.widget-toolbar .ams-form label.checkbox,.widget-toolbar .ams-form label.radio{line-height:29px}.widget-toolbar .ams-form .icon-append,.widget-toolbar .ams-form .icon-prepend{top:3px!important}.widget-toolbar.ams-form .icon-append,.widget-toolbar.ams-form .icon-prepend{top:3px!important}.widget-toolbar>.ams-form{margin-top:2px}.widget-toolbar>.ams-form .toggle:last-child{font-size:12px;line-height:29px}.widget-toolbar>.ams-form .checkbox input+i,.widget-toolbar>.ams-form .radio input+i,.widget-toolbar>.ams-form .toggle input+i{border-width:1px;border-color:#c7c7c7!important;margin-top:-1px;-webkit-box-shadow:0 1px 1px #FFF,0 1px 1px #858585 inset;box-shadow:0 1px 1px #FFF,0 1px 1px #858585 inset}.widget-toolbar .btn-group{margin-top:-3px}.widget-toolbar>.btn{margin-top:-3px;font-size:12px!important;padding:1px 8px!important}.widget-toolbar>.label{display:inline-block;vertical-align:middle;margin-top:-3px;text-align:center;font-size:12px;padding:4px 7px}.widget-toolbar>.badge{padding:5px;font-size:14px;border-radius:50%;font-weight:400;min-width:24px;text-align:center!important}.widget-toolbar .progress{width:130px;margin:7px 0 0;height:18px!important;font-size:12px;box-shadow:0 1px 0 rgba(0,0,0,0),0 0 0 1px #d1d1d1 inset;-webkit-box-shadow:0 1px 0 rgba(0,0,0,0),0 0 0 1px #d1d1d1 inset}.widget-toolbar .progress-bar{font-size:12px}.widget-toolbar .pagination{margin:4px 0}.widget-toolbar .pagination>li>a{padding:2px 7px}.widget-toolbar .widget-text-input{max-width:220px}.widget-toolbar input[type=text]{height:28px!important;margin-top:2px}.widget-body.no-padding{padding:0;margin:0}.widget-body.no-padding .alert{margin:5px 5px 0;padding:10px;box-shadow:none!important;-webkit-box-shadow:none!important;border-radius:0!important}.widget-body>table{margin-bottom:0}.widget-body-ajax-loading::before{display:block;position:absolute;content:url(../img/ajax-loader.gif);padding-top:18%;text-align:center;font-weight:700;font-size:16px;color:#fff;background:rgba(255,255,255,0.4);height:100%;z-index:1;width:100%}.widget-body-ajax-loading:hover{cursor:wait!important}.widget-body-toolbar,.ams-form.widget-body-toolbar{display:block;padding:8px 10px;margin:-13px -13px 13px;min-height:42px;border-bottom:1px solid #ccc;background:#fafafa}.no-padding .widget-body-toolbar,.no-padding .ams-form.widget-body-toolbar,.no-padding.widget-body-toolbar,.no-padding.ams-form.widget-body-toolbar{display:block;margin:0}.ams-form .widget-body-toolbar .inline-group,.widget-body-toolbar.ams-form .inline-group{float:left;margin-top:4px}.widget-body-toolbar .btn{vertical-align:middle}.widget-body-toolbar .btn-xs{margin-top:5px}.no-widget-toolbar .widget-body-toolbar{display:none}.widget-content-padding{padding:20px}.widget-content-padding .well{margin-bottom:0}.widget-footer{display:block;position:relative;min-height:32px;vertical-align:middle;margin:0 -13px -13px;padding:5px;border-top:1px solid #e4e4e4;text-align:right;background-color:#f8f7f7}.no-padding .widget-footer{margin:0}.widget-footer.ams-form>label{margin-top:4px;display:block}.ams-widget{position:relative;margin:0 0 15px;padding:0;-khtml-border-radius:0;border-radius:0}.ams-widget header .nav-tabs{border-bottom-color:transparent}.ams-widget header .nav-tabs>li>a{border-radius:0;border:0;padding:5px 15px 4px}.ams-widget header .nav-tabs>li.active>a,.ams-widget header .nav-tabs>li.active>a:focus,.ams-widget header .nav-tabs>li.active>a:hover{color:#555;background-color:#FFF;border:1px solid #c2c2c2;border-bottom-color:transparent;border-top:0;cursor:default}.ams-widget header:first-child .nav-tabs{float:left}.ams-widget header:first-child .nav-tabs li{padding-left:0}.ams-widget header:first-child .nav-tabs li a{color:#333}.ams-widget header:first-child .nav-tabs.pull-right li:last-child a{margin-right:0!important;border-right:0!important}.ams-widget header .nav-pills{margin:3px}.ams-widget header .nav-pills>li>a{padding:3px 5px 4px}.ams-widget header>.btn-group{margin-top:-13px;margin-left:5px}.ams-widget>header{height:30px;padding:0;line-height:40px;color:#333;border:1px solid #c2c2c2;background:#fafafa}.ams-widget>header h2{display:inline-block;position:relative;width:auto;height:100%;margin:0;font-size:14px;line-height:31px;font-weight:400;letter-spacing:0}@media only screen and (min-width:320px) and (max-width:479px){.ams-widget>header h2{width:135px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}}.rtl .ams-widget>header h2{float:right;text-align:right}.ams-widget>header>h2{margin-left:10px;float:left}.ams-widget>header>h2+.btn,.ams-widget>header>h2+.btn-group{margin-left:20px}.rtl .ams-widget>header{padding:0 7px 0 0}.ams-widget>header .widget-icon{display:block;float:left;width:16px;height:16px;margin:10px 10px 0 0;zoom:1;z-index:400}.rtl .ams-widget>header .widget-icon{float:right;margin:10px 0 0 7px}.ams-widget>header>.widget-icon{display:block;position:relative;float:left;margin:0 -10px 0 2px;width:28px;height:28px;font-size:111%;line-height:29px;text-align:center}.ams-widget>header>:first-child.widget-icon{margin-left:0}.ams-widget>div{position:relative;float:left;width:100%;font-size:13px;-khtml-border-radius:0;border-radius:0;margin:0;padding:13px 13px 0;background-color:#fff!important;border-width:1px;border-style:solid;border-color:#ccc!important}.ams-widget>header+div{border-top:0}.ams-widget .widget-body{position:relative;min-height:100px;padding-bottom:13px}.ams-widget .widget-body.widget-hide-overflow{overflow:hidden}.ams-widget.well{margin:0 0 30px}.ams-widget.well header{display:none}.ams-widget.well>div{border:0!important;box-shadow:none!important;-webkit-box-shadow:none!important}.ams-widget.well.transparent .widget-body.no-padding{margin:0!important}.ams-widget-ctrls{width:auto;float:right;padding:0;margin:0}.ams-widget-ctrls a{display:inline-block;padding:0;margin:0;text-decoration:none;font-size:14px;text-align:center;line-height:29px;color:#333}.ams-widget-ctrls .button-icon{position:relative;float:left;min-width:28px;height:28px;font-family:Ubuntu,Arial,Helvetica,sans-serif;border-left:1px solid rgba(0,0,0,0.09)}.ams-widget-ctrls .button-icon :hover{background-color:rgba(0,0,0,0.05)}.rtl .ams-widget-ctrls .button-icon{margin:0 0 5px 5px}.rtl .ams-widget-ctrls{float:left;padding:10px 0 0 3px;margin:0}.ams-widget-loader{display:none;float:right;width:28px;height:28px;margin:0;text-align:center;line-height:28px;background-repeat:no-repeat;background-position:center center}.rtl .ams-widget-loader{float:left}.ams-widget-editbox{display:none;padding:10px;border-bottom:1px solid #b1b1b1;background-color:#fff;margin:-13px -13px 13px}.no-padding .ams-widget-editbox{margin:0 0 10px}.ams-widget,.ams-widget-editbox,.ams-widget>div{zoom:1}.ams-widget:after,.ams-widget-editbox:after,.ams-widget>div:after{clear:both}.ams-widget:before,.ams-widget-editbox:before,.ams-widget>div:before,.ams-widget:after,.ams-widget-editbox:after,.ams-widget>div:after{display:block;visibility:hidden;overflow:hidden;content:"\0020";height:0;font-size:0;line-height:0}.ui-sortable .ams-widget-sortable>header{cursor:move;line-height:normal;-khtml-border-radius:0;border-radius:0;-webkit-box-shadow:inset 0 -2px 0 rgba(0,0,0,0.05);box-shadow:inset 0 -2px 0 rgba(0,0,0,0.05)}.ui-sortable .ams-widget-sortable.ams-widget-collapsed>header{-khtml-border-radius:0;border-radius:0}.ams-widget-timestamp{margin:10px 0 0;color:#868686;font-size:12px;font-style:italic}.ams-widget-placeholder{margin-bottom:28px;padding:0;background-color:#FFC;border:1px dashed #a7a7a7;-khtml-border-radius:0;border-radius:0;-webkit-box-sizing:border-box;-khtml-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.ams-widget-remove-colors{color:#333!important;padding:0!important;background:none!important}.ams-widget-color-magenta>header{color:#fff;background:#6e3671;border-color:#6e3671!important}.ams-widget-color-magenta .nav-tabs li:not(.active) a,.ams-widget-color-magenta>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-magenta .nav-tabs li a:hover{color:#333!important}.ams-widget-color-pink>header{color:#fff;background:#ac5287;border-color:#ac5287!important}.ams-widget-color-pink .nav-tabs li:not(.active) a,.ams-widget-color-pink>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-pink .nav-tabs li a:hover{color:#333!important}.ams-widget-color-pinkDark>header{color:#fff;background:#a8829f;border-color:#a8829f!important}.ams-widget-color-pinkDark .nav-tabs li:not(.active) a,.ams-widget-color-pinkDark>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-pinkDark .nav-tabs li a:hover{color:#333!important}.ams-widget-color-yellow>header{color:#fff;background:#d4c737;border-color:#d4c737!important}.ams-widget-color-yellow .nav-tabs li:not(.active) a,.ams-widget-color-yellow>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-yellow .nav-tabs li a:hover{color:#333!important}.ams-widget-color-orange>header{color:#fff;background:#c79121;border-color:#c79121!important}.ams-widget-color-orange .nav-tabs li:not(.active) a,.ams-widget-color-orange>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-orange .nav-tabs li a:hover{color:#333!important}.ams-widget-color-orangeDark>header{color:#fff;background:#a57225;border-color:#a57225!important}.ams-widget-color-orangeDark .nav-tabs li:not(.active) a,.ams-widget-color-orangeDark>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-orangeDark .nav-tabs li a:hover{color:#333!important}.ams-widget-color-darken>header{color:#fff;background:#404040;border-color:#404040!important}.ams-widget-color-darken .nav-tabs li:not(.active) a,.ams-widget-color-darken>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-darken .nav-tabs li a:hover{color:#333!important}.ams-widget-color-purple>header{color:#fff;background:#65596b;border-color:#65596b!important}.ams-widget-color-purple .nav-tabs li:not(.active) a,.ams-widget-color-purple>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-purple .nav-tabs li a:hover{color:#333!important}.ams-widget-color-teal>header{color:#fff;background:#568a89;border-color:#568a89!important}.ams-widget-color-teal .nav-tabs li:not(.active) a,.ams-widget-color-teal>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-teal .nav-tabs li a:hover{color:#333!important}.ams-widget-color-blueDark>header{color:#fff;background:#4c4f53;border-color:#4c4f53!important}.ams-widget-color-blueDark .nav-tabs li:not(.active) a,.ams-widget-color-blueDark>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-blueDark .nav-tabs li a:hover{color:#333!important}.ams-widget-color-blue>header{color:#fff;background:#60747c;border-color:#60747c!important}.ams-widget-color-blue .nav-tabs li:not(.active) a,.ams-widget-color-blue>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-blue .nav-tabs li a:hover{color:#333!important}.ams-widget-color-blueLight>header{color:#fff;background:#ccdadf;border-color:#ccdadf!important}.ams-widget-color-blueLight .nav-tabs li:not(.active) a,.ams-widget-color-blueLight>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-blueLight .nav-tabs li a:hover{color:#333!important}.ams-widget-color-red>header{color:#fff;background:#931313;border-color:#931313!important}.ams-widget-color-red .nav-tabs li:not(.active) a,.ams-widget-color-red>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-red .nav-tabs li a:hover{color:#333!important}.ams-widget-color-redLight>header{color:#fff;background:#a65858;border-color:#a65858!important}.ams-widget-color-redLight .nav-tabs li:not(.active) a,.ams-widget-color-redLight>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-redLight .nav-tabs li a:hover{color:#333!important}.ams-widget-color-white>header{color:#c8c8c8;background:#dedede;border-color:#c8c8c8!important}.ams-widget-color-white .nav-tabs li:not(.active) a,.ams-widget-color-white>header>.ams-widget-ctrls a{color:#c8c8c8!important}.ams-widget-color-white .nav-tabs li a:hover{color:#838383!important}.ams-widget-color-greenDark>header{color:#fff;background:#496949;border-color:#496949!important}.ams-widget-color-greenDark .nav-tabs li:not(.active) a,.ams-widget-color-greenDark>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-greenDark .nav-tabs li a:hover{color:#333!important}.ams-widget-color-green>header{color:#fff;background:#356e35;border-color:#356e35!important}.ams-widget-color-green .nav-tabs li:not(.active) a,.ams-widget-color-green>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-green .nav-tabs li a:hover{color:#333!important}.ams-widget-color-greenLight>header{color:#fff;background:#71843f;border-color:#71843f!important}.ams-widget-color-greenLight .nav-tabs li:not(.active) a,.ams-widget-color-greenLight>header>.ams-widget-ctrls a{color:#fff!important}.ams-widget-color-greenLight .nav-tabs li a:hover{color:#333!important}#ams-widget-fullscreen-mode{position:fixed;width:100%;height:100%;top:0;left:0;z-index:99999}#ams-widget-fullscreen-mode .ams-widget{margin:0;-khtml-border-radius:0;border-radius:0}#ams-widget-fullscreen-mode>div{overflow-y:scroll;-khtml-border-radius:0;border-radius:0}#ams-widget-fullscreen-mode>div>header{cursor:default}.onoffswitch{position:relative;width:50px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;margin-top:3px;margin-bottom:3px;margin-left:5px;display:inline-block;vertical-align:middle}.onoffswitch-container{margin-top:4px;margin-left:7px;display:inline-block}.onoffswitch-checkbox{display:none}.onoffswitch-label{display:block;overflow:hidden;cursor:pointer;border:1px solid #626262;border-radius:50px;border-color:#adadad #b3b3b3 #9e9e9e;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.onoffswitch-inner{width:200%;margin-left:-100%;display:block}.onoffswitch-inner:after,.onoffswitch-inner:before{float:left;width:50%;height:15px;padding:0;line-height:17px;font-size:10px;font-family:Ubuntu,Trebuchet,Arial,sans-serif;font-weight:700;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.onoffswitch-inner:before{content:attr(data-swchon-text);text-shadow:0 -1px 0 #333;padding-left:7px;background-color:#3276b1;color:#fff;-webkit-box-shadow:inset 0 2px 6px rgba(0,0,0,0.5),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 6px rgba(0,0,0,0.5),0 1px 2px rgba(0,0,0,0.05);text-align:left}.onoffswitch-inner:after{content:attr(data-swchoff-text);padding-right:7px;text-shadow:0 -1px 0 #fff;background-color:#fff;color:#555;text-align:right;-webkit-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)}.onoffswitch-switch{width:19px;height:19px;margin:-2px;background:#fff;border:1px solid #9a9a9a;border-radius:50px;position:absolute;top:0;bottom:0;right:32px;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;background-color:#f4f4f4;background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#eee));background-image:-webkit-gradient(linear,top left,bottom left,from(#fff),to(#eee));background-image:-webkit-linear-gradient(top,#fff,#eee);background-image:linear-gradient(to bottom,#fff,#eee);background-repeat:repeat-x;-webkit-box-shadow:1px 1px 4px 0 rgba(0,0,0,0.3);box-shadow:1px 1px 4px 0 rgba(0,0,0,0.3)}.onoffswitch-checkbox+.onoffswitch-label .onoffswitch-switch:before,.onoffswitch-checkbox:checked+.onoffswitch-label .onoffswitch-switch:before{content:"\f00d";color:#a90329;display:block;text-align:center;line-height:19px;font-size:10px;text-shadow:0 -1px 0 #fff;font-weight:700;font-family:FontAwesome}.onoffswitch-checkbox:checked+.onoffswitch-label .onoffswitch-switch:before{content:"\f00c";color:#57889c}.onoffswitch-checkbox:checked+.onoffswitch-label .onoffswitch-inner{margin-left:0;display:block}.onoffswitch-checkbox:checked+.onoffswitch-label .onoffswitch-switch{right:0}.onoffswitch-switch:hover{background-color:#eee}.onoffswitch-switch:active{background-color:#eee;-webkit-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)}.onoffswitch-checkbox:checked:disabled+.onoffswitch-label .onoffswitch-inner:before,.onoffswitch-checkbox:disabled+.onoffswitch-label .onoffswitch-inner:after{text-shadow:0 1px 0 #fff;background:#bfbfbf;color:#333}.onoffswitch-checkbox:checked:disabled+.onoffswitch-label .onoffswitch-switch,.onoffswitch-checkbox:disabled+.onoffswitch-label .onoffswitch-switch{background-color:#f4f4f4;background-image:-webkit-gradient(linear,0 0,0 100%,from(#bfbfbf),to(#f4f4f4));background-image:-webkit-gradient(linear,top left,bottom left,from(#bfbfbf),to(#f4f4f4));background-image:-webkit-linear-gradient(top,#bfbfbf,#f4f4f4);background-image:linear-gradient(to bottom,#bfbfbf,#f4f4f4);-webkit-box-shadow:none!important;box-shadow:none!important}.onoffswitch-checkbox:checked:disabled+.onoffswitch-label .onoffswitch-label,.onoffswitch-checkbox:disabled+.onoffswitch-label{border-color:#ababab #999 #878787!important}.onoffswitch-checkbox:checked+.onoffswitch-label{border-color:#3276b1 #2a6395 #255681}.onoffswitch+span,.onoffswitch-title{display:inline-block;vertical-align:middle;margin-top:-5px}label.with-icon .select2-parent{margin-right:27px}label.with-icons .select2-parent{margin-right:54px}.select2-container{margin:0;position:relative;display:inline-block;zoom:1;*display:inline;vertical-align:middle}.select2-container .select2-choice{display:block;height:26px;padding:0 0 0 8px;overflow:hidden;position:relative;border:1px solid #ccc;white-space:nowrap;line-height:26px;color:#444;text-decoration:none;-webkit-background-clip:padding-box;background-clip:padding-box;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#fff}label.bordered .select2-container .select2-choice{border-color:transparent}.select2-container .select2-choice:hover{border:1px solid rgba(82,168,236,0.7)}.select2-container .select2-choice>.select2-chosen{margin-right:26px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.select2-container .select2-choice>.select2-chosen abbr{display:none;width:12px;height:12px;position:absolute;right:24px;top:8px;font-size:1px;text-decoration:none;border:0;cursor:pointer;outline:0}.select2-container .select2-choice>.select2-chosen abbr:hover{cursor:pointer}.select2-container.select2-drop-above .select2-choice{border-bottom-color:#ccc}.select2-container.select2-allowclear .select2-choice .select2-chosen{margin-right:42px}.select2-container.select2-allowclear .select2-choice abbr{display:inline-block}.select2-container .select2-arrow{display:inline-block;width:20px;height:20px;position:absolute;right:3px;top:3px;padding:0 0 0 2px;border-left:1px solid #ccc;line-height:22px;-webkit-background-clip:padding-box}.select2-container .select2-arrow b{width:100%;height:100%;display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:relative;font-size:14px}.select2-container .select2-arrow b:before{content:"\f107";width:100%;height:100%;text-align:center;display:block}.select2-container,.select2-drop,.select2-search,.select2-search input{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.select2-container-active .select2-choice,.select2-container-active .select2-choices{border:1px solid rgba(82,168,236,0.7)!important;outline:0}.select2-drop-mask{border:0;margin:0;padding:0;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:9998;background:#fff;filter:alpha(opacity=0)}.select2-drop{margin-top:-1px;width:100%;position:absolute;z-index:9999;top:100%;background:#fff;color:#000;border:1px solid #ccc;border-top:0;-webkit-box-shadow:0 4px 5px rgba(0,0,0,0.15);box-shadow:0 4px 5px rgba(0,0,0,0.15)}.select2-drop.select2-drop-above{margin-bottom:0;border-top:1px solid rgba(82,168,236,0.7);border-top-width:3px;border-bottom:0;-webkit-box-shadow:0 -4px 5px rgba(0,0,0,0.15);box-shadow:0 -4px 5px rgba(0,0,0,0.15)}.select2-drop.select2-drop-above.select2-drop-active{border-top-width:3px}.select2-drop.select2-drop-above .select2-search input{margin-top:4px}.select2-drop.select2-drop-above .select2-search:before{top:34%}.select2-drop-auto-width{border-top:1px solid #ccc;width:auto}.select2-drop-auto-width .select2-search{padding-top:4px}.select2-drop-active{border:1px solid rgba(82,168,236,0.7);border-top:0;border-bottom-width:3px}.select2-search{display:inline-block;width:100%;min-height:26px;margin:0;padding-left:4px;padding-right:4px;position:relative;z-index:10000;white-space:nowrap}.select2-search:before{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:absolute;content:"\f002";top:25%;right:10px;color:#686868!important}.select2-search input{width:100%;height:auto!important;min-height:26px;padding:4px 20px 3px 5px;margin:0;outline:0;font-size:1em;border:1px solid #aaa;-webkit-box-shadow:none;box-shadow:none;background:#fff;background:-webkit-gradient(linear,left bottom,left top,color-stop(0.85,#fff),color-stop(0.99,#eee));background:-webkit-linear-gradient(center bottom,#fff 85%,#eee 99%);background:-webkit-gradient(linear,top left,bottom left,from(#fff),to(#eee));background:-webkit-linear-gradient(top,#fff 85%,#eee 99%);background:linear-gradient(top,#fff 85%,#eee 99%)}.select2-search input.select2-active{background-origin:padding-box;background:#fff url(../img/select2-spinner.gif) no-repeat right 24px top 50%;background:url(../img/select2-spinner.gif) no-repeat right 24px top 50%,-webkit-gradient(linear,left bottom,left top,color-stop(0.85,#fff),color-stop(0.99,#eee));background:url(../img/select2-spinner.gif) no-repeat right 24px top 50%,-webkit-linear-gradient(center bottom,#fff 85%,#eee 99%);background:url(../img/select2-spinner.gif) no-repeat right 24px top 50%,-webkit-gradient(linear,top left,bottom left,from(#fff),to(#eee));background:url(../img/select2-spinner.gif) no-repeat right 24px top 50%,-webkit-linear-gradient(top,#fff 85%,#eee 99%);background:url(../img/select2-spinner.gif) no-repeat right 24px top 50%,linear-gradient(top,#fff 85%,#eee 99%)}.select2-dropdown-open .select2-choice{border-bottom-color:transparent;-webkit-box-shadow:0 1px 0 #fff inset;box-shadow:0 1px 0 #fff inset;border-bottom-left-radius:0;border-bottom-right-radius:0;background-color:#fff}.select2-dropdown-open.select2-drop-above .select2-choice,.select2-dropdown-open.select2-drop-above .select2-choices{border:1px solid #5d98cc;border-top-color:transparent}.select2-dropdown-open .select2-choice .select2-arrow{background:0;border-left:0;-webkit-filter:none;filter:none}.select2-dropdown-open .select2-choice .select2-arrow b{background-position:-18px 1px}.select2-results{max-height:200px;padding:0 0 0 4px;margin:4px 4px 4px 0;position:relative;overflow-x:hidden;overflow-y:auto;-webkit-tap-highlight-color:rgba(0,0,0,0)}.select2-results .select2-selected{opacity:.5}.select2-results ul.select2-result-sub{margin:0;padding-left:0}.select2-results ul.select2-result-sub>li .select2-result-label{padding-left:20px}.select2-results ul.select2-result-sub ul.select2-result-sub>li .select2-result-label{padding-left:40px}.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub>li .select2-result-label{padding-left:60px}.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub>li .select2-result-label{padding-left:80px}.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub>li .select2-result-label{padding-left:100px}.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub>li .select2-result-label{padding-left:110px}.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub>li .select2-result-label{padding-left:120px}.select2-results li{list-style:none;display:list-item;background-image:none}.select2-results li.select2-result-with-children>.select2-result-label{font-weight:700}.select2-results .select2-result-label{padding:3px 7px 4px;margin:0;cursor:pointer;min-height:1em;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.select2-results .select2-highlighted{background:#3276b1;color:#fff}.select2-results li em{background:#feffde;font-style:normal}.select2-results .select2-highlighted em{background:0}.select2-results .select2-highlighted ul{background:#fff;color:#000}.select2-results .select2-no-results,.select2-results .select2-searching,.select2-results .select2-selection-limit{background:#f4f4f4;display:list-item;padding:3px 5px;opacity:.5}.select2-results-results .select2-disabled{background:#f4f4f4;display:list-item;cursor:default}.select2-results-results .select2-disabled.select2-highlighted{color:#666;background:#f4f4f4;display:list-item;cursor:default}.select2-results-results .select2-selected{display:none}.select2-no-results{padding-left:20px}.select2-no-results:before{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\f05a";margin-right:5px}.select2-more-results{background:#f4f4f4;display:list-item}.select2-more-results.select2-active{background:#f4f4f4 url(../img/select2-spinner.gif) no-repeat 100%}.select2-default{color:#999!important}.select2-container.select2-container-disabled .select2-choice{background-color:#f4f4f4;background-image:none;border:1px solid #ddd;cursor:default}.select2-container.select2-container-disabled .select2-choice .select2-arrow{background-color:#f4f4f4;background-image:none;border-left:0}.select2-container.select2-container-disabled .select2-choice abbr{display:none}.select2-container-multi.select2-container-active .select2-choices{border:1px solid rgba(82,168,236,0.7);outline:0}.select2-container-multi .select2-choices{height:auto!important;height:1%;min-height:26px;margin:0;padding:0;position:relative;border:1px solid #ccc;cursor:text;overflow:hidden;background-color:#fff}label.bordered .select2-container-multi .select2-choices{border-color:transparent}.select2-container-multi .select2-choices:hover{border:1px solid rgba(82,168,236,0.7)!important}label.bordered .select2-container-multi .select2-choices:hover{border-color:transparent!important}.select2-container-multi .select2-choices li{float:left;list-style:none}.select2-container-multi .select2-choices .select2-search-field{margin:0;padding:0;white-space:nowrap}.select2-container-multi .select2-choices .select2-search-field input{max-height:24px;padding:3px 5px;margin:1px 0;font-family:Ubuntu,sans-serif;font-size:100%;color:#666;outline:0;border:0;-webkit-box-shadow:none;box-shadow:none;background:transparent!important}.select2-container-multi .select2-choices .select2-search-field input.select2-active{background:#fff url(../img/select2-spinner.gif) no-repeat 99%!important}.select2-container-multi .select2-choices .select2-search-choice{padding:1px 28px 1px 8px;margin:2px;position:relative;line-height:18px;color:#fff;cursor:default;border:1px solid #2a6395;-webkit-background-clip:padding-box;background-clip:padding-box;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#3276b1}.select2-container-multi .select2-choices .select2-search-choice .select2-chosen{cursor:default}.select2-container-multi .select2-choices .select2-search-choice-focus{opacity:.8}.select2-container-multi .select2-choices .select2-search-choice.ui-sortable-handle{cursor:move}.with-icons .select2-container-multi .select2-choices .select2-search-choice.ui-sortable-handle{margin-right:1px}.select2-container-multi.ordered .select2-choices li{float:none;cursor:move}.select2-container-multi.ordered .select2-choices li.ui-state-highlight{margin:2px 0 2px 2px;height:20px;background-color:#ddd;border:1px solid #ddd}.select2-container-multi .select2-search-choice-close{display:block;top:0;right:-2px;padding:3px 0 3px 6px}.select2-container-multi .select2-search-choice-close:hover{background:rgba(0,0,0,0.3)}.select2-container-multi.select2-container-disabled .select2-choices{background-color:#f4f4f4;background-image:none;border:1px solid transparent;border-bottom:1px solid #ccc;cursor:default}.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice{padding:1px 5px;border:1px solid #4a90cc;background-image:none;background-color:#86b4dd;cursor:not-allowed}.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close{display:none;background:0}.select2-locked{padding:3px 5px!important}.select2-search-choice-close{display:block;min-width:20px;min-height:14px;position:absolute;right:3px;top:3px;margin:0;padding:0;font-size:15px;text-decoration:none!important;font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.select2-search-choice-close:before{color:#fff;content:"\f057"}.select2-result-selectable .select2-match,.select2-result-unselectable .select2-match{text-decoration:underline}.select2-offscreen,.select2-offscreen:focus{clip:rect(0 0 0 0)!important;width:1px!important;height:1px!important;border:0!important;margin:0!important;padding:0!important;overflow:hidden!important;position:absolute!important;outline:0!important;left:0!important;top:0!important}.select2-display-none{display:none}.select2-measure-scrollbar{position:absolute;top:-10000px;left:-10000px;width:100px;height:100px;overflow:scroll}.select2-hidden-accessible{position:absolute;border:0;clip:rect(0 0 0 0);height:1px;width:1px;margin:-1px;overflow:hidden;padding:0}label.with-icon>i.icon-append+.select2-parent>.select2-choices{padding-right:29px}.multiselect-container{position:absolute;list-style-type:none;margin:0;padding:0}.multiselect-container .input-group{margin:5px}.multiselect-container>li{padding:0}.multiselect-container>li>a.multiselect-all label{font-weight:700}.multiselect-container>li>a>label{margin:0;height:100%;cursor:pointer;font-weight:400}.multiselect-container>li>a>label.checkbox,.multiselect-container>li>a>label.radio{margin:0}.multiselect-container>li>a>label>input[type=checkbox]{margin-bottom:5px}.multiselect-container>li>label.multiselect-group{margin:0;padding:3px 20px;height:100%;font-weight:700}.btn-group>.btn-group:nth-child(2)>.multiselect.btn{border-top-left-radius:4px;border-bottom-left-radius:4px}.color-select{list-style:none;margin:0;padding:4px;min-width:166px;max-width:156px;right:-3px}.color-select li{display:block;margin:2px;float:left}.color-select li span{display:block;width:22px;height:22px;padding:0;background:#333;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;border:1px solid rgba(0,0,0,0.1);cursor:pointer}.color-select li span:hover{border:3px solid rgba(0,0,0,0.2)}.widget-toolbar .dropdown-menu.color-select{right:-1px}.color-box{display:block;position:relative;width:22px;height:22px;padding:0;background:#333;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border:1px solid rgba(255,255,255,0.3)!important;cursor:pointer;vertical-align:middle;outline:1px solid rgba(0,0,0,0.1);background:rgba(255,255,255,0.3)!important}.color-box:hover,.open .color-box{outline:1px solid rgba(0,0,0,0.1)!important}.color-box:hover{-webkit-transform:scale(1.07);-moz-transform:scale(1.07)}.color-box:active{top:1px;left:1px}.widget-toolbar>.color-box{margin-top:7px;width:18px;height:18px;outline:1px solid rgba(0,0,0,0.2)}.widget-toolbar>.color-box:active,.widget-toolbar>.color-box:focus,.widget-toolbar>.color-box:hover{outline:1px solid rgba(0,0,0,0.25)!important}.ams-widget #calendar{margin-top:-18px}#calendar-buttons{position:absolute;right:14px;top:5px}#calendar-container{position:relative}#external-events>li{margin:6px 4px 6px 0;display:inline-block}#external-events>li>:first-child{padding:5px 10px 10px;cursor:move;display:block}#external-events>li>:first-child:after{color:#fff;color:rgba(255,255,255,0.7);content:attr(data-description);font-size:11px;font-weight:400;display:block;line-height:0;margin:7px 0;text-transform:lowercase}.fc{direction:ltr;text-align:left}.fc .fc-header-space{padding-left:10px}.fc table,html .fc{font-size:12px}.fc table{border-collapse:collapse;border-spacing:0}.fc th,.fc td{padding:0;vertical-align:top}.fc .ui-resizable-handle{display:block;position:absolute;z-index:99999;overflow:hidden;font-size:300%;line-height:50%}.fc .ui-draggable-dragging .fc-event-bg{display:none}.fc-border-separate thead tr,.fc-border-separate .table thead tr{background-color:#eee;background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#fafafa));background-image:-webkit-linear-gradient(top,#f2f2f2 0,#fafafa 100%);background-image:-linear-gradient(top,#f2f2f2 0,#fafafa 100%);font-size:12px}.fc-border-separate thead tr th{padding:4px;line-height:1.428571429}tr td.fc-first,tr.fc-first th.fc-first{border-left:0}tr.fc-last td{border-bottom:0}.fc-header .fc-button{margin-bottom:1em;vertical-align:top;margin-right:-1px}.fc-header .fc-corner-right{margin-right:1px}.fc-header .ui-corner-right{margin-right:0}.fc-header .fc-state-hover,.fc-header .ui-state-hover{z-index:2}.fc-header .fc-state-down{z-index:3}.fc-header .fc-state-active,.fc-header .ui-state-active{z-index:4}.fc-header td{white-space:nowrap}.fc-header-left{width:25%;text-align:left}.fc-header-center{text-align:center}.fc-header-right{width:25%;text-align:right}.fc-header-title{display:inline-block;vertical-align:top}.fc-header-title h2{margin-top:0;white-space:nowrap}.ams-widget .fc-header-title h2{text-shadow:0 1px 0 #fff;margin-top:-12px;margin-left:10px;font-size:14px;font-weight:700;margin-bottom:0}.fc-content{clear:both}.fc-view{width:100%;overflow:hidden}.fc-widget-content,.fc-widget-header{border:1px solid #ccc;border-right:0}.fc-state-highlight{background:#ffc}.fc-cell-overlay{background:#9cf;opacity:.2;filter:alpha(opacity=20)}.fc-button{position:relative;display:inline-block;cursor:pointer}.fc-button-inner{position:relative;float:left;overflow:hidden}.fc-state-default{border-width:1px 0}.fc-state-default .fc-button-inner{border-width:0 1px}.fc-state-default,.fc-state-default .fc-button-inner{border-style:solid;border-color:#ccc #bbb #aaa;background:#f3f3f3;color:#000}.fc-state-default .fc-button-effect{position:absolute;top:50%;left:0}.fc-state-default .fc-button-effect span{position:absolute;top:-100px;left:0;width:500px;height:100px;border-width:100px 0 0 1px;border-style:solid;border-color:#fff;background:#444;opacity:.09;filter:alpha(opacity=9)}.fc-state-hover .fc-button-inner{border-color:#999}.fc-state-down .fc-button-inner{border-color:#555;background:#777}.fc-state-active .fc-button-inner{border-color:#555;background:#777;color:#fff}.fc-state-disabled{cursor:default}.fc-state-disabled .fc-button-inner{color:#999;border-color:#ddd}.fc-state-disabled .fc-button-effect{display:none}.fc-button-content{position:relative;float:left;height:1.9em;line-height:1.9em;padding:0 .6em;white-space:nowrap}.fc-button-content .fc-icon-wrap{position:relative;float:left;top:50%}.fc-button-content .ui-icon{position:relative;float:left;margin-top:-50%;*margin-top:0;*top:-50%}.fc-event{border-style:solid;border-width:0;font-size:.85em;cursor:default}.fc-rtl .fc-event{text-align:right}.fc-event-draggable,a.fc-event{cursor:pointer}a.fc-event{text-decoration:none}.fc-event-skin{color:#FFF;border-right:0!important;cursor:move}.fc-event-skin .fa:before{display:block;font-size:14px;position:absolute;right:4px;top:3px}.fc-event-inner{position:relative;width:100%;height:100%;border-style:solid;border-width:0;overflow:hidden}.fc-event-hori{border-width:1px 0;margin-bottom:1px}.fc-event-hori .ui-resizable-e{top:0!important;right:-3px!important;width:7px!important;height:100%!important;cursor:e-resize}.fc-event-hori .ui-resizable-w{top:0!important;left:-3px!important;width:7px!important;height:100%!important;cursor:w-resize}.fc-event-hori .ui-resizable-handle{_padding-bottom:14px}.fc-corner-left{margin-left:1px}.fc-corner-left .fc-button-inner,.fc-corner-left .fc-event-inner{margin-left:-1px}.fc-corner-right{margin-right:1px}.fc-corner-right .fc-button-inner,.fc-corner-right .fc-event-inner{margin-right:-1px}.fc-corner-right .fc-event-inner{border-left:6px solid rgba(0,0,0,0.15);padding-left:2px;padding-right:15px}.fc-corner-top{margin-top:1px}.fc-corner-top .fc-event-inner{margin-top:-1px;border-top-width:1px}.fc-corner-bottom{margin-bottom:1px}.fc-corner-bottom .fc-event-inner{margin-bottom:-1px;border-bottom-width:1px}table.fc-table-separate{border-collapse:separate}.fc-table-separate td,.fc-table-separate th{border-width:1px 0 0 1px}.fc-table-separate td.fc-last,.fc-table-separate th.fc-last{border-right-width:1px}.fc-table-separate tr.fc-last td,.fc-table-separate tr.fc-last th{border-bottom-width:1px}.fc-table-separate tbody tr.fc-first td,.fc-table-separate tbody tr.fc-first th{border-top-width:0}.fc-grid th{text-align:center}.fc-grid .fc-day-number{float:right;padding:0 2px}.fc-grid .fc-other-month .fc-day-number{opacity:.3;filter:alpha(opacity=30)}.fc-grid .fc-day-content{clear:both;padding:2px 2px 1px}.fc-grid .fc-event-time{font-weight:700}.fc-rtl .fc-grid .fc-day-number{float:left}.fc-rtl .fc-grid .fc-event-time{float:right}.fc-agenda table{border-collapse:separate}.fc-agenda .fc-agenda-axis{width:50px;padding:0 4px;vertical-align:middle;text-align:right;white-space:nowrap;font-weight:400}.fc-agenda .fc-day-content{padding:2px 2px 1px}.fc-agenda-days th{text-align:center}.fc-agenda-days .fc-agenda-axis{border-right-width:1px}.fc-agenda-days .fc-col0{border-left-width:0}.fc-agenda-allday th{border-width:0 1px}.fc-agenda-allday .fc-day-content{min-height:34px;_height:34px}.fc-agenda-divider-inner{height:2px;overflow:hidden}.fc-widget-header .fc-agenda-divider-inner{background:#eee}.fc-agenda-slots th{border-width:1px 1px 0}.fc-agenda-slots td{border-width:1px 0 0;background:0}.fc-agenda-slots td div{height:20px}.fc-agenda-slots tr.fc-slot0 td,.fc-agenda-slots tr.fc-slot0 th{border-top-width:0}.fc-agenda-slots tr.fc-minor td,.fc-agenda-slots tr.fc-minor th{border-top-style:dotted}.fc-agenda-slots tr.fc-minor th.ui-widget-header{*border-top-style:solid}.fc-event-time,.fc-event-title{padding:3px 0 2px 3px;display:inline-block;line-height:16px;font-weight:700;font-size:11px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.fc-event-vert{border-width:0 1px}.fc-event-vert .fc-event-content,.fc-event-vert .fc-event-head{position:relative;z-index:2;width:100%;overflow:hidden}.fc-event-vert .fc-event-time{white-space:nowrap;font-size:10px}.fc-event-vert .fc-event-bg{position:absolute;z-index:1;top:0;left:0;width:100%;height:100%;background:#fff;opacity:.3;filter:alpha(opacity=30)}.fc-event-vert .ui-resizable-s{bottom:0!important;width:100%!important;height:8px!important;overflow:hidden!important;line-height:8px!important;font-size:11px!important;font-family:monospace;text-align:center;cursor:s-resize}.fc-select-helper .fc-event-bg{display:none}.fc-agenda .ui-resizable-resizing{_overflow:hidden}.colorpicker{padding-left:30px!important}.bootstrap-timepicker{position:relative}.bootstrap-timepicker.pull-right .bootstrap-timepicker-widget.dropdown-menu{left:auto;right:0}.bootstrap-timepicker.pull-right .bootstrap-timepicker-widget.dropdown-menu:before{left:auto;right:12px}.bootstrap-timepicker.pull-right .bootstrap-timepicker-widget.dropdown-menu:after{left:auto;right:13px}.bootstrap-timepicker .add-on{cursor:pointer}.bootstrap-timepicker .add-on i{display:inline-block;width:16px;height:16px}@media(max-width:767px){.bootstrap-timepicker,.bootstrap-timepicker .dropdown-menu{width:100%}}.bootstrap-timepicker-widget.dropdown-menu{padding:4px}.bootstrap-timepicker-widget.dropdown-menu.open{display:inline-block}.bootstrap-timepicker-widget.dropdown-menu:before{border-bottom:7px solid rgba(0,0,0,0.2);border-left:7px solid transparent;border-right:7px solid transparent;content:"";display:inline-block;position:absolute}.bootstrap-timepicker-widget.dropdown-menu:after{border-bottom:6px solid #FFF;border-left:6px solid transparent;border-right:6px solid transparent;content:"";display:inline-block;position:absolute}.bootstrap-timepicker-widget.timepicker-orient-left:before{left:6px}.bootstrap-timepicker-widget.timepicker-orient-left:after{left:7px}.bootstrap-timepicker-widget.timepicker-orient-right:before{right:6px}.bootstrap-timepicker-widget.timepicker-orient-right:after{right:7px}.bootstrap-timepicker-widget.timepicker-orient-top:before{top:-7px}.bootstrap-timepicker-widget.timepicker-orient-top:after{top:-6px}.bootstrap-timepicker-widget.timepicker-orient-bottom:before{bottom:-7px;border-bottom:0;border-top:7px solid #999}.bootstrap-timepicker-widget.timepicker-orient-bottom:after{bottom:-6px;border-bottom:0;border-top:6px solid #fff}.bootstrap-timepicker-widget a.btn,.bootstrap-timepicker-widget input{border-radius:4px}.bootstrap-timepicker-widget table{width:100%;margin:0}.bootstrap-timepicker-widget table table td{text-align:center;height:30px;margin:0;padding:2px}.bootstrap-timepicker-widget table table td:not(.separator){min-width:30px}.bootstrap-timepicker-widget table table td span{width:100%}.bootstrap-timepicker-widget table table td a{border:1px transparent solid;width:100%;display:inline-block;margin:0;padding:8px 0;outline:0;color:#333}.bootstrap-timepicker-widget table table td a:hover{text-decoration:none;background-color:#eee;border-radius:4px;border-color:#ddd}.bootstrap-timepicker-widget table table td a i{margin-top:2px;font-size:18px}.bootstrap-timepicker-widget table table td input{width:25px;margin:0;text-align:center}@media(min-width:767px){.bootstrap-timepicker-widget.modal{width:200px;margin-left:-100px}}.bootstrap-timepicker-widget .modal-content{padding:4px}.note-editor{border:1px solid #a9a9a9}.note-editor.fullscreen{position:fixed;top:0;left:0;z-index:1050;width:100%}.note-editor.fullscreen.fullscreen .note-editable{background-color:#fff}.note-editor.codeview .note-editable,.note-editor.fullscreen .note-resizebar{display:none}.note-editor.codeview .note-codeable{display:block}.note-editor .note-toolbar{padding-bottom:5px;padding-left:5px;margin:0;background-color:#f5f5f5;border-bottom:1px solid #a9a9a9}.note-editor .note-toolbar>.btn-group{margin-top:5px;margin-right:5px;margin-left:0}.note-editor .note-toolbar .note-table .dropdown-menu{min-width:0;padding:5px}.note-editor .note-toolbar .note-table .dropdown-menu .note-dimension-picker{font-size:18px}.note-editor .note-toolbar .note-table .dropdown-menu .note-dimension-picker .note-dimension-picker-mousecatcher{position:absolute!important;z-index:3;width:10em;height:10em;cursor:pointer}.note-editor .note-toolbar .note-table .note-table .dropdown-menu .note-dimension-picker .note-dimension-picker-unhighlighted{position:relative!important;z-index:1;width:5em;height:5em;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIj4+Pjp6ekKlAqjAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKhmnaJzPAAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC) repeat}.note-editor .note-toolbar .note-table .note-table .dropdown-menu .note-dimension-picker .note-dimension-picker-highlighted{position:absolute!important;z-index:2;width:1em;height:1em;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIjd6vvD2f9LKLW+AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKwNDEVT0AAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC) repeat}.note-editor .note-toolbar .note-style blockquote,.note-editor .note-toolbar .note-editor .note-toolbar .note-style h1,.note-editor .note-toolbar .note-editor .note-toolbar .note-style h2,.note-editor .note-toolbar .note-editor .note-toolbar .note-style h3,.note-editor .note-toolbar .note-editor .note-toolbar .note-style h4,.note-editor .note-toolbar .note-editor .note-toolbar .note-style h5,.note-editor .note-toolbar .note-editor .note-toolbar .note-style h6{margin:0}.note-editor .note-toolbar .note-color .dropdown-toggle{width:20px;padding-left:5px}.note-editor .note-toolbar .note-color .dropdown-menu{min-width:290px}.note-editor .note-toolbar .note-color .dropdown-menu .btn-group{margin:0}.note-editor .note-toolbar .note-color .dropdown-menu .btn-group:first-child{margin:0 5px}.note-editor .note-toolbar .note-color .dropdown-menu .btn-group .note-palette-title{margin:2px 7px;font-size:12px;text-align:center;border-bottom:1px solid #eee}.note-editor .note-toolbar .note-color .dropdown-menu .btn-group .note-color-reset{padding:0 3px;margin:5px;font-size:12px;cursor:pointer;border-radius:5px}.note-editor .note-toolbar .note-color .dropdown-menu .btn-group .note-color-reset:hover{background:#eee}.note-editor .note-toolbar .note-para .dropdown-menu{min-width:153px;padding:5px}.note-editor .note-toolbar .note-para .note-para li:first-child{margin-bottom:5px}.note-editor .note-statusbar{background-color:#f5f5f5}.note-editor .note-statusbar .note-resizebar{width:100%;height:8px;cursor:s-resize}.note-editor .note-statusbar .note-resizebar .note-icon-bar{width:20px;margin:1px auto;border-top:1px solid #a9a9a9}.note-editor .note-popover .popover{max-width:none}.note-editor .note-popover .popover .popover-content{padding:5px}.note-editor .note-popover .popover .popover-content a{display:inline-block;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}.note-editor .note-popover .popover .popover-content .btn-group+.btn-group{margin-left:5px}.note-editor .note-popover .popover .arrow{left:20px}.note-editor .note-handle .note-control-selection{position:absolute;display:none;border:1px solid #000}.note-editor .note-handle .note-control-selection>div{position:absolute}.note-editor .note-handle .note-control-selection .note-control-selection-bg{width:100%;height:100%;background-color:#000;-webkit-opacity:.3;-khtml-opacity:.3;-moz-opacity:.3;opacity:.3;-ms-filter:alpha(opacity=30);filter:alpha(opacity=30)}.note-editor .note-handle .note-control-selection .note-control-handle,.note-editor .note-handle .note-control-selection .note-control-holder{width:7px;height:7px;border:1px solid #000}.note-editor .note-handle .note-control-selection .note-control-sizing{width:7px;height:7px;background-color:#fff;border:1px solid #000}.note-editor .note-handle .note-control-selection .note-control-nw{top:-5px;left:-5px;border-right:0;border-bottom:0}.note-editor .note-handle .note-control-selection .note-control-ne{top:-5px;right:-5px;border-bottom:0;border-left:0}.note-editor .note-handle .note-control-selection .note-control-sw{bottom:-5px;left:-5px;border-top:0;border-right:0}.note-editor .note-handle .note-control-selection .note-control-se{right:-5px;bottom:-5px;cursor:se-resize}.note-editor .note-handle .note-control-selection .note-control-selection-info{right:0;bottom:0;padding:5px;margin:5px;font-size:12px;color:#fff;background-color:#000;border-radius:5px;-webkit-opacity:.7;-khtml-opacity:.7;-moz-opacity:.7;opacity:.7;-ms-filter:alpha(opacity=70);filter:alpha(opacity=70)}.note-editor .note-dialog>div{display:none}.note-editor .note-dialog .note-image-dialog .note-dropzone{min-height:200px;font-size:30px;line-height:6;color:#d3d3d3;text-align:center;border:4px dashed #d3d3d3}.note-editor .note-dialog .note-help-dialog{font-size:12px;color:#ccc;background:0;background-color:#222!important;border:0;-webkit-opacity:.9;-khtml-opacity:.9;-moz-opacity:.9;opacity:.9;-ms-filter:alpha(opacity=90);filter:alpha(opacity=90)}.note-editor .note-dialog .note-help-dialog .modal-content{background:0;border:1px solid #fff;border-radius:5px;-webkit-box-shadow:none;box-shadow:none}.note-editor .note-dialog .note-help-dialog a{font-size:12px;color:#fff}.note-editor .note-dialog .note-help-dialog .title{padding-bottom:5px;font-size:14px;font-weight:700;color:#fff;border-bottom:#fff 1px solid}.note-editor .note-dialog .note-help-dialog .modal-close{font-size:14px;color:#dd0;cursor:pointer}.note-editor .note-dialog .note-help-dialog .note-shortcut-layout{width:100%}.note-editor .note-dialog .note-help-dialog .note-shortcut-layout td{vertical-align:top}.note-editor .note-dialog .note-help-dialog .note-shortcut{margin-top:8px}.note-editor .note-dialog .note-help-dialog .note-shortcut th{font-size:13px;color:#dd0;text-align:left}.note-editor .note-dialog .note-help-dialog .note-shortcut th:first-child{min-width:110px;padding-right:10px;font-family:"Courier New";color:#dd0;text-align:right}.note-editor .note-editable{padding:10px;overflow:scroll;outline:0}.note-editor .note-codeable{display:none;width:100%;padding:10px;margin-bottom:0;font-family:Menlo,Monaco,monospace,sans-serif;font-size:14px;color:#ccc;background-color:#222;border:0;border-radius:0;-webkit-box-shadow:none;box-shadow:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;resize:none}.note-editor .dropdown-menu{min-width:90px}.note-editor .dropdown-menu.right{right:0;left:auto}.note-editor .dropdown-menu.right::before{right:9px;left:auto!important}.note-editor .dropdown-menu.right::after{right:10px;left:auto!important}.note-editor .dropdown-menu .dropdown-menu li a i{color:#00bfff;visibility:hidden}.note-editor .dropdown-menu .dropdown-menu li a.checked i{visibility:visible}.note-editor .note-color-palette{line-height:1}.note-editor .note-color-palette div .note-color-btn{width:17px;height:17px;padding:0;margin:0;border:1px solid #fff}.note-editor .note-color-palette div .note-color-btn:hover{border:1px solid #000}.no-padding .note-editor{border:0}.note-editor .note-editable{background-color:rgba(48,126,204,0.05)}.note-editor .note-editable:focus{background-color:#fff}.note-editor .note-statusbar .note-resizebar{border-top:1px solid #dbdbdb}.note-editor .note-statusbar:hover{background:#EEE}.note-editor .note-statusbar:active{background:#eaeaea}.md-editor{display:block;border:1px solid #ddd}.md-editor.active{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(102,175,233,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(102,175,233,0.6)}.md-editor .md-footer,.md-editor>.md-header{display:block;padding:6px 4px;background:#f5f5f5}.md-editor>.md-preview{background:#fff;border-top:1px dashed #ddd;border-bottom:1px dashed #ddd;min-height:10px;padding:10px}.md-editor>textarea{font-family:Monaco,Menlo,Consolas,"Courier New",monospace;font-size:13px;outline:0;outline:thin dotted \9;margin:0;display:block;width:100%;border:0;padding:10px;border-top:1px dashed #ddd;border-bottom:1px dashed #ddd;border-radius:0;-webkit-box-shadow:none;box-shadow:none;background:#eee}.md-editor>textarea:focus{-webkit-box-shadow:none;box-shadow:none;background:#fff}.twitter-typeahead .tt-hint,.twitter-typeahead .tt-query{margin-bottom:0}.tt-dropdown-menu{min-width:160px;margin-top:2px;padding:5px 0;background-color:#fff;border:1px solid #bfbfbf;border:1px solid rgba(0,0,0,0.2);*border-right-width:2px;*border-bottom-width:2px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;background-clip:padding-box}.tt-suggestion{display:block;padding:3px 20px}.tt-suggestion.tt-is-under-cursor{color:#fff;background-color:#0081c2}.tt-suggestion.tt-is-under-cursor a{color:#fff}.tt-suggestion p{margin:0}.dropzone,.dropzone *,.dropzone-previews,.dropzone-previews *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.dropzone .dz-preview,.dropzone-previews .dz-preview{background:rgba(255,255,255,0.8);position:relative;display:inline-block;margin:10px;vertical-align:top;border:1px solid #acacac;padding:6px;-webkit-box-shadow:1px 1px 4px rgba(0,0,0,0.16);box-shadow:1px 1px 4px rgba(0,0,0,0.16);font-size:14px}.dropzone .dz-preview.dz-file-preview,.dropzone-previews .dz-preview.dz-file-preview{display:none}.dropzone .dz-preview .dz-details,.dropzone-previews .dz-preview .dz-details{width:100px;height:100px;position:relative;background:#ebebeb;padding:5px;margin-bottom:22px}.dropzone .dz-preview .dz-details .dz-filename,.dropzone-previews .dz-preview .dz-details .dz-filename{overflow:hidden;height:100%}.dropzone .dz-preview .dz-details img,.dropzone-previews .dz-preview .dz-details img{position:absolute;top:0;left:0;width:100px;height:100px}.dropzone .dz-preview .dz-details .dz-size,.dropzone-previews .dz-preview .dz-details .dz-size{position:absolute;bottom:-28px;left:3px;height:28px;line-height:28px}.dropzone .dz-preview.dz-error .dz-error-mark,.dropzone-previews .dz-preview.dz-error .dz-error-mark,.dropzone .dz-preview.dz-success .dz-success-mark,.dropzone-previews .dz-preview.dz-success .dz-success-mark{display:block;opacity:1;-ms-filter:none;-webkit-filter:none;filter:none}.dropzone .dz-preview:hover .dz-details img,.dropzone-previews .dz-preview:hover .dz-details img{display:none}.dropzone .dz-preview .dz-error-mark,.dropzone-previews .dz-preview .dz-error-mark,.dropzone .dz-preview .dz-success-mark,.dropzone-previews .dz-preview .dz-success-mark{display:block;position:absolute;width:40px;height:40px;font-size:30px;text-align:center;right:-10px;top:-10px;opacity:0;-ms-filter:"alpha(Opacity=0)";filter:alpha(opacity=0);-webkit-transition:opacity .4s ease-in-out;transition:opacity .4s ease-in-out;background-image:url(../img/dropzone/spritemap.png);background-repeat:no-repeat}.dropzone .dz-preview .dz-error-mark span,.dropzone-previews .dz-preview .dz-error-mark span,.dropzone .dz-preview .dz-success-mark span,.dropzone-previews .dz-preview .dz-success-mark span{display:none}.dropzone .dz-preview .dz-success-mark,.dropzone-previews .dz-preview .dz-success-mark{color:#8cc657;background-position:-268px -163px}.dropzone .dz-preview .dz-error-mark,.dropzone-previews .dz-preview .dz-error-mark{color:#ee162d;background-position:-268px -123px}.dropzone .dz-preview.dz-error .dz-progress .dz-upload,.dropzone-previews .dz-preview.dz-error .dz-progress .dz-upload{background:#ee1e2d}.dropzone .dz-preview .dz-progress,.dropzone-previews .dz-preview .dz-progress{position:absolute;top:100px;left:6px;right:6px;height:6px;background:#d7d7d7;display:none}.dropzone .dz-preview .dz-progress .dz-upload,.dropzone-previews .dz-preview .dz-progress .dz-upload{position:absolute;bottom:0;background-color:#8cc657;-webkit-animation:loading .4s linear infinite;-ms-animation:loading .4s linear infinite;animation:loading .4s linear infinite;-webkit-transition:width .3s ease-in-out;transition:width .3s ease-in-out;border-radius:2px;top:0;left:0;width:0;height:100%;background-image:url(../img/dropzone/spritemap.png);background-repeat:repeat-x;background-position:0 -400px}.dropzone .dz-preview.dz-processing .dz-progress,.dropzone-previews .dz-preview.dz-processing .dz-progress{display:block}.dropzone .dz-preview .dz-error-message,.dropzone-previews .dz-preview .dz-error-message{position:absolute;top:-5px;left:-20px;background:rgba(245,245,245,0.8);padding:8px 10px;color:#800;min-width:140px;max-width:500px;z-index:500;display:block;opacity:0;-ms-filter:"alpha(Opacity=0)";filter:alpha(opacity=0);-webkit-transition:opacity .3s ease-in-out;transition:opacity .3s ease-in-out}.dropzone .dz-preview:hover.dz-error .dz-error-message,.dropzone-previews .dz-preview:hover.dz-error .dz-error-message{display:block;opacity:1;-ms-filter:none;-webkit-filter:none;filter:none}.dropzone .dz-preview.dz-image-preview:hover .dz-details img,.dropzone-previews .dz-preview.dz-image-preview:hover .dz-details img{display:block;opacity:.1;-ms-filter:"alpha(Opacity=10)";filter:alpha(opacity=10)}.dropzone .dz-preview.dz-success .dz-progress,.dropzone-previews .dz-preview.dz-success .dz-progress{display:block;opacity:0;-ms-filter:"alpha(Opacity=0)";filter:alpha(opacity=0);-webkit-transition:opacity .4s ease-in-out;transition:opacity .4s ease-in-out}.dropzone a.dz-remove,.dropzone-previews a.dz-remove{background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#fafafa),color-stop(1,#eee));background-image:-webkit-gradient(linear,top left,bottom left,from(#fafafa),to(#eee));background-image:-webkit-linear-gradient(top,#fafafa 0,#eee 100%);background-image:linear-gradient(top,#fafafa 0,#eee 100%);border-radius:2px;border:1px solid #eee;text-decoration:none;display:block;padding:4px 5px;text-align:center;color:#aaa;margin-top:26px}.dropzone a.dz-remove:hover,.dropzone-previews a.dz-remove:hover{color:#666}.dropzone{position:relative;padding:1em;border:1px solid rgba(0,0,0,0.03);min-height:360px;border-radius:3px;background:rgba(0,0,0,0.03);background-image:-webkit-gradient(linear,left top,right bottom,color-stop(0.25,rgba(0,0,0,0.03)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(0,0,0,0.03)),color-stop(0.75,rgba(0,0,0,0.03)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(135deg,rgba(0,0,0,0.03) 25%,transparent 25%,transparent 50%,rgba(0,0,0,0.03) 50%,rgba(0,0,0,0.03) 75%,transparent 75%,transparent);background-image:-webkit-linear-gradient(315deg,rgba(0,0,0,0.03) 25%,transparent 25%,transparent 50%,rgba(0,0,0,0.03) 50%,rgba(0,0,0,0.03) 75%,transparent 75%,transparent);background-image:linear-gradient(135deg,rgba(0,0,0,0.03) 25%,transparent 25%,transparent 50%,rgba(0,0,0,0.03) 50%,rgba(0,0,0,0.03) 75%,transparent 75%,transparent);background-color:#fafcfd;-webkit-background-size:16px 16px;background-size:16px 16px}.dropzone .dz-drag-hover{background:rgba(0,0,0,0.04)}.dropzone.dz-clickable,.dropzone.dz-clickable .dz-message,.dropzone.dz-clickable .dz-message span{cursor:pointer}.dropzone.dz-clickable *{cursor:default}.dropzone .dz-message{opacity:1;-ms-filter:none;-webkit-filter:none;filter:none}.dropzone .dz-drag-hover{background-image:-webkit-gradient(linear,left top,right bottom,color-stop(0.25,rgba(0,0,0,0.03)),color-stop(0.25,rgba(0,0,0,0)),color-stop(0.5,rgba(0,0,0,0)),color-stop(0.5,rgba(0,0,0,0.03)),color-stop(0.75,rgba(0,0,0,0.03)),color-stop(0.75,rgba(0,0,0,0)),to(rgba(0,0,0,0)));background-image:-webkit-linear-gradient(135deg,rgba(0,0,0,0.03) 25%,rgba(0,0,0,0) 25%,rgba(0,0,0,0) 50%,rgba(0,0,0,0.03) 50%,rgba(0,0,0,0.03) 75%,rgba(0,0,0,0) 75%,rgba(0,0,0,0));background-image:-webkit-linear-gradient(315deg,rgba(0,0,0,0.03) 25%,rgba(0,0,0,0) 25%,rgba(0,0,0,0) 50%,rgba(0,0,0,0.03) 50%,rgba(0,0,0,0.03) 75%,rgba(0,0,0,0) 75%,rgba(0,0,0,0));background-image:linear-gradient(135deg,rgba(0,0,0,0.03) 25%,rgba(0,0,0,0) 25%,rgba(0,0,0,0) 50%,rgba(0,0,0,0.03) 50%,rgba(0,0,0,0.03) 75%,rgba(0,0,0,0) 75%,rgba(0,0,0,0));background-color:#fafafa;-webkit-background-size:22px 22px;background-size:22px 22px;border:5px dashed #ccc}.dropzone .dz-default.dz-message{opacity:1;-ms-filter:none;-webkit-filter:none;filter:none;-webkit-transition:opacity .3s ease-in-out;transition:opacity .3s ease-in-out;background-image:url(../img/dropzone/spritemap.png);background-repeat:no-repeat;background-position:0 0;position:absolute;width:428px;height:123px;margin-left:-214px;margin-top:-61.5px;top:50%;left:50%}.dropzone .dz-default.dz-message span{display:none}.dropzone.dz-square .dz-default.dz-message{background-position:0 -123px;width:268px;margin-left:-134px;height:174px;margin-top:-87px}.dropzone.dz-drag-hover .dz-message{opacity:.15;-ms-filter:"alpha(Opacity=15)";filter:alpha(opacity=15)}.dropzone.dz-started .dz-message{display:block;opacity:0;-ms-filter:"alpha(Opacity=0)";filter:alpha(opacity=0)}.irs{position:relative;display:block;height:40px}.irs-line{position:relative;display:block;overflow:hidden;height:8px;top:25px;background:#eee}.irs-line-left,.irs-line-mid,.irs-line-right{position:absolute;display:block;top:0;height:8px}.irs-line-left{left:0;width:10%}.irs-line-mid{left:10%;width:80%}.irs-line-right{right:0;width:10%}.irs-diapason{position:absolute;display:block;left:0;width:100%}.irs-slider{position:absolute;display:block;cursor:default;z-index:1;width:10px;height:22px;top:17px;border:1px solid #fff;background:#858585}.irs-slider:hover{background:#6c6c6c}.irs-slider.single{left:10px}.irs-slider.single:before{position:absolute;display:block;content:"";top:-50%;left:-150%;width:400%;height:200%;background:rgba(0,0,0,0)}.irs-slider.from{left:100px}.irs-slider.from:before{position:absolute;display:block;content:"";top:-50%;left:-300%;width:400%;height:200%;background:rgba(0,0,0,0)}.irs-slider.to{left:300px}.irs-slider.to:before{position:absolute;display:block;content:"";top:-50%;left:0;width:400%;height:200%;background:rgba(0,0,0,0)}.irs-slider.last{z-index:2}.irs-max,.irs-min{color:#999;font-size:12px;line-height:1.333;text-shadow:none;top:0;padding:1px 3px;background:rgba(0,0,0,0.1);border-radius:0}.lt-ie9 .irs-max,.lt-ie9 .irs-min{background:#bfbfbf}.irs-min{position:absolute;display:block;left:0;cursor:default}.irs-max{position:absolute;display:block;right:0;cursor:default}.irs-from,.irs-single,.irs-to{position:absolute;display:block;top:0;left:0;cursor:default;white-space:nowrap}.lt-ie9 .irs-from,.lt-ie9 .irs-single,.lt-ie9 .irs-to{background:#999}.irs-grid{position:absolute;display:none;bottom:0;left:0;width:100%;height:20px}.irs-with-grid{height:60px}.irs-with-grid .irs-grid{display:block}.irs-grid-pol{position:absolute;top:0;left:0;width:1px;height:8px;background:#99a4ac}.irs-grid-pol.small{height:4px}.irs-grid-text{position:absolute;bottom:0;left:0;width:100px;white-space:nowrap;text-align:center;font-size:9px;line-height:9px;color:#99a4ac}.irs-diapason{background:#3276b1;height:8px;top:25px}.irs .irs-from,.irs .irs-single,.irs .irs-to{color:#fff;font-size:10px;line-height:1.333;text-shadow:none;padding:1px 5px;background:rgba(0,0,0,0.4);border-radius:0}#irs-active-slider{background:#686868;-webkit-box-shadow:rgba(0,0,0,0.3) 1px 1px 1px 0;box-shadow:rgba(0,0,0,0.3) 1px 1px 1px 0;width:12px;height:24px;top:16px}.google_maps{width:100%;height:350px;position:relative}.google_maps *{box-sizing:content-box;-webkit-box-sizing:content-box;-moz-box-sizing:content-box}.google_maps img{max-width:none}.slider{margin-top:0;margin-bottom:30px}.slider.slider-vertical{margin-bottom:0;margin-right:5px}.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix{display:block;min-height:0}.ui-helper-clearfix:after,.ui-helper-clearfix:before{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden}* html .ui-helper-clearfix{height:1%}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:alpha(opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;width:16px;height:16px;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget{font-family:Ubuntu,Helvetica,Arial,sans-serif;font-size:13px}.ui-widget :active{outline:0}.ui-widget .ui-widget{font-size:13px}.ui-widget button,.ui-widget input,.ui-widget select,.ui-widget textarea{font-family:Ubuntu,Helvetica,Arial,sans-serif;font-size:inherit}.ui-widget-content{border:1px solid #aaa;background:#fff;color:#404040}.ui-widget-content .ui-icon{background:none!important}.ui-widget-header{font-weight:700;background-color:#f5f5f5;border-color:#DDD;color:#333}.ui-widget-header a{color:#222}.ui-widget-overlay{position:fixed;background:#AAA;width:100%;height:200%;top:0;left:0;z-index:999;opacity:.3;filter:alpha(opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa;opacity:.3;filter:alpha(opacity=30);border-radius:8px}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{color:#333;background-color:#fff;font-weight:400;border:1px solid #ccc}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{text-shadow:none}.ui-state-default,.ui-state-error,.ui-state-highlight{position:relative;border-width:1px;border-style:solid}.ui-state-default p,.ui-state-error p,.ui-state-highlight p{font-size:13px;font-weight:400;line-height:18px;margin:7px 15px}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#2d6987}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{color:#b94a48;background-color:#f2dede;border-color:#eed3d7}.ui-state-error a,.ui-state-error-text,.ui-widget-content .ui-state-error a,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error a,.ui-widget-header .ui-state-error-text{color:#953b39}.ui-state-focus,.ui-state-hover,.ui-widget-content .ui-state-focus,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-focus,.ui-widget-header .ui-state-hover{color:#333;background-color:#ebebeb;border-color:#adadad;text-decoration:none}.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited{color:#333;text-decoration:none}.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #adadad;font-weight:400;color:#333}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#333;text-decoration:none}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:alpha(opacity=35);background-image:none}.ui-state-disabled .ui-icon,.ui-widget-content .ui-state-disabled .ui-icon,.ui-widget-header .ui-state-disabled .ui-icon{filter:alpha(opacity=35)}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:700}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:alpha(opacity=70);font-weight:400}.ui-corner-all{border-radius:0}.ui-corner-left,.ui-corner-tl,.ui-corner-top{border-top-left-radius:4px}.ui-corner-right,.ui-corner-top,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-bl,.ui-corner-bottom,.ui-corner-left{border-bottom-left-radius:4px}.ui-corner-bottom,.ui-corner-br,.ui-corner-right{border-bottom-right-radius:4px}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}input[type=color].ui-autocomplete-loading,input[type=date].ui-autocomplete-loading,input[type=datetime-local].ui-autocomplete-loading,input[type=datetime].ui-autocomplete-loading,input[type=email].ui-autocomplete-loading,input[type=month].ui-autocomplete-loading,input[type=number].ui-autocomplete-loading,input[type=password].ui-autocomplete-loading,input[type=search].ui-autocomplete-loading,input[type=tel].ui-autocomplete-loading,input[type=text].ui-autocomplete-loading,input[type=time].ui-autocomplete-loading,input[type=url].ui-autocomplete-loading,input[type=week].ui-autocomplete-loading{background-image:url(../img/select2-spinner.gif)!important;background-repeat:no-repeat;background-position:99% 50%;padding-right:27px}.ui-btn-lg{padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}.ui-btn-sm,.ui-btn-xs{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.ui-btn-xs{padding:1px 5px}.ui-btn-block{display:block;width:100%;padding-right:0;padding-left:0}.ui-btn-block+.ui-btn-block{margin-top:5px}input[type=button].ui-btn-block,input[type=reset].ui-btn-block,input[type=submit].ui-btn-block{width:100%}.ui-button{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.428571429;text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;border:1px solid #ccc;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.ui-button:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.ui-button:focus,.ui-button:hover{color:#333;background-color:#ebebeb;border-color:#adadad;text-decoration:none}fieldset[disabled] .ui-button,fieldset[disabled] .ui-button.ui-state-active,fieldset[disabled] .ui-button:active,fieldset[disabled] .ui-button:focus,fieldset[disabled] .ui-button:hover,.ui-button.disabled,.ui-button.disabled.active,.ui-button.disabled:active,.ui-button.disabled:focus,.ui-button.disabled:hover,.ui-button[disabled],.ui-button[disabled].active,.ui-button[disabled]:active,.ui-button[disabled]:focus,.ui-button[disabled]:hover{background-color:#fff;border-color:#ccc}.ui-button-text-icon-primary .ui-button-icon-primary{float:left}.ui-button-text-icon-primary{padding:2px 7px 3px}.ui-button-primary{color:#fff;background-color:#428bca;border-color:#357ebd}.ui-button-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.ui-button-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.ui-button-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.ui-button-inverse{color:#fff;background-color:#222;border-color:#080808}.ui-button-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.ui-button-error{color:#fff;background-color:#c43c35;border-color:#882a25}.ui-button-danger:hover,.ui-button-info:hover,.ui-button-inverse:hover,.ui-button-primary:hover,.ui-button-success:hover,.ui-button-warning:hover{text-decoration:none}.ui-button-primary:focus,.ui-button-primary:hover{color:#fff;background-color:#3276b1;border-color:#285e8e}.ui-button-success:hover{color:#fff;background-color:#47a447;border-color:#398439}.ui-button-info:hover{color:#fff;background-color:#39b3d7;border-color:#269abc}.ui-button-danger:hover{color:#fff;background-color:#d2322d;border-color:#ac2925}.ui-button-warning:hover{color:#fff;background-color:#ed9c28;border-color:#d58512}.ui-button-inverse:hover{color:#fff;background-color:#363636;border-color:#000}.ui-button-icon-only{width:2.2em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button-text-icon-primary .ui-button-icon-primary.ui-icon{margin-top:5px}.ui-button .ui-button-text{display:block;line-height:normal}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999px;display:none}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-icons-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon{margin-bottom:0;margin-top:0;top:50%}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px;margin-right:-6px}.ui-button-icons-only .ui-button-icon-primary,.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary{left:.5em}.ui-button-icons-only .ui-button-icon-secondary,.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-state-active{color:#fff;background-color:#428bca;border-color:#357ebd}.ui-buttonset .ui-state-active.ui-state-hover{color:#fff;background-color:#3276b1;border-color:#285e8e}.ui-buttonset .ui-button{margin-left:0;margin-right:-0.4em}button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-slider{position:relative;text-align:left}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{-webkit-filter:inherit;filter:inherit}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:16px;height:18px;cursor:default}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0;color:#fff;background-color:#0e90d2;background-image:-webkit-gradient(linear,0 0,0 100%,from(#149bdf),to(#0480be));background-image:-webkit-gradient(linear,top left,bottom left,from(#149bdf),to(#0480be));background-image:-webkit-linear-gradient(top,#149bdf,#0480be);background-image:linear-gradient(to bottom,#149bdf,#0480be);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf',endColorstr='#ff0480be',GradientType=0);-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width .6s ease;transition:width .6s ease}.ui-slider-horizontal{height:10px;background:#d5d5d5;border:0}.ui-slider-horizontal .ui-slider-handle{top:-0.2em;margin-left:-0.5em;background-color:#fff;border-color:#CCC}.ui-slider-horizontal .ui-slider-handle:focus{background-color:#fff;border-color:#357ebd}.ui-slider-horizontal .ui-slider-handle:hover{background-color:#fff;border-color:#285e8e;outline:0}.ui-slider-horizontal .ui-slider-handle:active{background-color:#428bca;border-color:#3276b1}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-0.3em;margin-left:0;margin-bottom:-0.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-tabs{position:relative;border:0;border-radius:0}.ui-tabs .ui-tabs-panel{display:block;border-radius:0;background:0}.ui-tabs .ui-tabs-nav{margin-bottom:0;border:solid #ddd;border-width:0 0 1px;border-radius:0;background:0}.ui-tabs .ui-tabs-nav li{position:relative;top:0;float:left;margin-bottom:-1px;margin-right:3px;border:0;list-style:none;white-space:nowrap;background:0;-webkit-filter:none;filter:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active:hover{background:#fff;cursor:text}.ui-tabs .ui-tabs-nav li.ui-tabs-active a{border:1px solid #ddd;border-bottom:1px solid #fff;background-color:#fff;color:#555;font-weight:700;border-top-width:0!important;margin-top:1px!important;-webkit-box-shadow:0 -2px 0 #57889c;box-shadow:0 -2px 0 #57889c}.ui-tabs .ui-tabs-nav li a{float:left;padding:8px 12px;font-weight:400;text-decoration:none;outline:0;background:0;border-radius:0;background-color:#f5f5f5;border:1px solid #f5f5f5;border-bottom:1px solid #ddd;color:#838383}.ui-tabs .ui-tabs-nav li a:hover{border:1px solid #f5f5f5;border-bottom:1px solid #ddd;background-color:#f5f5f5}.ui-tabs .ui-tabs-nav li.ui-state-disabled a,.ui-tabs .ui-tabs-nav li.ui-tabs-active a,.ui-tabs .ui-tabs-nav li.ui-tabs-loading a{cursor:text}.ui-tabs .ui-tabs-nav .ui-state-default{border:0;-webkit-box-shadow:none;box-shadow:none}.ui-tabs .ui-tabs-panel{border:1px solid #ddd;margin:0;padding:10px 13px;border-top:0}.ui-tabs .ui-tabs-hide{display:none!important}.ui-tooltip{display:block;font-size:11px;opacity:.8;position:absolute;visibility:visible;z-index:1024;max-width:200px;background:#000;border:1px solid #000;color:#FFF;padding:3px 8px;text-align:center;text-decoration:none;-webkit-box-shadow:inset 0 1px 0 #000;box-shadow:inset 0 1px 0 #000;border-radius:4px}body .ui-tooltip{border-width:1px}.ui-spinner{position:relative;display:inline-block;overflow:hidden;width:100%;padding:0;vertical-align:middle}.ui-spinner-input{margin:0!important;height:30px;padding:6px 24px 6px 12px;border:0;background:0;vertical-align:middle}.ui-spinner-input.spinner-left{padding:6px 12px 6px 24px}.ui-spinner-input.spinner-left+.ui-spinner-button,.ui-spinner-input.spinner-left+.ui-spinner-button+.ui-spinner-button{right:auto;left:0}.ui-spinner-input.spinner-both{padding:6px 30px}.ui-spinner-input.spinner-both+.ui-spinner-button+.ui-spinner-button{left:0;right:auto}.ui-spinner-input.spinner-both+.ui-spinner-button,.ui-spinner-input.spinner-both+.ui-spinner-button+.ui-spinner-button{height:30px;width:25px}.ui-spinner-input.spinner-both+.ui-spinner-up+.ui-spinner-down:before,.ui-spinner-input.spinner-both+.ui-spinner-up:before{margin-top:8px}.ui-spinner-button{width:19px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:0;border-bottom:0;border-right:0}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-down,.ui-spinner-up{background:#739e73;border-radius:0}.ui-spinner-down:before,.ui-spinner-up:before{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\f067";color:#fff;font-size:14px;margin-top:1px}.ui-spinner-down>:first-child,.ui-spinner-up>:first-child{display:none}.ui-spinner-up{top:0}.ui-spinner-up:active,.ui-spinner-up:focus,.ui-spinner-up:hover{background:#5b835b}.ui-spinner-down{bottom:0;background:#c2032f}.ui-spinner-down:before{content:"\f068"}.ui-spinner-down:active,.ui-spinner-down:focus,.ui-spinner-down:hover{background:#77021d}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px}.ui-datepicker{width:20em;padding:.2em .2em 0;display:none;z-index:9999!important}.ui-datepicker-inline{z-index:9000!important}.ui-datepicker-header{position:relative;border:0;font-weight:700;width:100%;padding:4px 0;background-color:#f5f5f5;color:gray}.ui-datepicker-next,.ui-datepicker-prev{position:absolute;top:2px;width:5.6em;height:1.8em;text-align:center;margin-top:2px;cursor:pointer}.ui-datepicker-next>:first-child,.ui-datepicker-prev>:first-child{text-indent:0!important}.ui-datepicker-next span,.ui-datepicker-prev span{display:block;position:absolute;text-align:center;top:50%;margin-top:-8px;width:5.8em}.ui-datepicker-prev{left:2px}.ui-datepicker-next{right:2px}.ui-datepicker-title{margin:0 5.8em;line-height:1.8em;text-align:center}.ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month-year{width:100%}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;border:0;font-weight:700;color:gray}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td:hover{color:#fff}.ui-datepicker td a{margin-bottom:0;border:0}.ui-datepicker td a,.ui-datepicker td span{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker td .ui-state-default{border:0;background:0;margin-bottom:0;padding:5px;color:gray;text-align:center;-webkit-filter:none;filter:none}.ui-datepicker td .ui-state-highlight{color:#fff;background-color:#a90329;text-shadow:0 -1px 0 rgba(0,0,0,0.25);border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-radius:0}.ui-datepicker td .ui-state-active{color:#333;background-color:#ebebeb;margin-bottom:0;font-size:normal;text-shadow:0;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-radius:0}.ui-datepicker td .ui-state-hover{color:#fff;background:#428bca;background-color:#428bca;text-shadow:0 -1px 0 rgba(0,0,0,0.25);border-color:#357ebd;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-radius:0}.ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em;width:auto;overflow:visible}.ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-detepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicket-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-datepicker-cover{display:none;display:block;position:absolute;z-index:-1;-webkit-filter:mask();filter:mask();top:-4px;left:-4px;width:200px;height:200px}.ui-datepicker-today a{background-color:#bfbfbf;cursor:pointer;padding:0 4px;margin-bottom:0}.ui-datepicker-today a:hover{background-color:gray;color:#fff}.ui-progressbar{height:2em;margin-bottom:20px;border:0;overflow:hidden;background-color:#f7f7f7;background-image:-webkit-gradient(linear,0 0,0 100%,from(#f5f5f5),to(#f9f9f9));background-image:-webkit-gradient(linear,top left,bottom left,from(#f5f5f5),to(#f9f9f9));background-image:-webkit-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:linear-gradient(to bottom,#f5f5f5,#f9f9f9);background-repeat:repeat-x;border-radius:0;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5',endColorstr='#fff9f9f9',GradientType=0);-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.ui-progressbar .ui-progressbar-value{margin:0;height:100%;color:#fff;background-color:#428bca;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width .6s ease;transition:width .6s ease}.ui-progressbar .ui-progressbar-overlay{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px;-webkit-animation:progress-bar-stripes 2s linear infinite;-ms-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;z-index:99999;display:block}.ui-resizable-autohide .ui-resizable-handle,.ui-resizable-disabled .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted #000}.ui-accordion{width:100%}.ui-accordion .ui-accordion-li-fix{display:inline}.ui-accordion .ui-accordion-header{display:block;position:relative;margin-top:-2px;border-color:#ddd!important;padding:10px 15px 10px 36px!important;cursor:pointer;min-height:0;background-color:#fbfbfb;border-radius:0;font-size:15px}.ui-accordion .ui-accordion-header-active{border-bottom:0!important}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-noicons{padding-left:.7em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px;text-indent:0!important;background-image:none!important;text-align:center;line-height:normal;left:12px!important;margin-top:-6px!important;font-size:14px!important}.ui-accordion .ui-accordion-content{margin-top:-3px;border-radius:0;border-top:0 none;border-color:#ddd!important;padding:15px;position:relative;top:1px;margin-bottom:2px;overflow:auto;display:none}.ui-accordion .ui-accordion-content-active{display:block}.ui-accordion-header-active+.ui-accordion-content{border-top:1px solid #ddd}.noUi-target *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-touch-callout:none;-ms-touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;cursor:default}.noUi-target *[disabled] .noUi-base{background:#999}.noUi-target *[disabled] .noUi-connect{background:#BBB}.noUi-base{width:100%;height:14px;position:relative;max-width:100%;max-height:100%;border:1px solid #bfbfbf;z-index:1}.noUi-origin-lower{background:#72a8d7}.noUi-handle{background:#858585;height:30px;width:16px;border:1px solid #fff;margin:-8px 0 0 -8px;cursor:default}.noUi-handle:hover{background:#6c6c6c}.noUi-active{cursor:default;-webkit-box-shadow:rgba(0,0,0,0.1) 1px 1px 1px 0;box-shadow:rgba(0,0,0,0.1) 1px 1px 1px 0;background:#686868;height:32px;width:18px;margin:-9px 0 0 -8px;border:0}.noUi-active:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;content:"";display:block;height:100%;border:1px solid #ddd}.noUi-connect{background:#3276b1}.noUi-background{background:#eee;border:0}.noUi-origin{position:absolute;right:0;top:0;bottom:0;z-index:0}.noUi-origin-upper{background:inherit!important}.noUi-z-index{z-index:10}.noUi-vertical{width:10px;height:100%}.noUi-vertical .noUi-origin{bottom:0;left:0}.noUi-vertical .noUi-handle{margin:-8px 0 0 -3px}.noUi-state-tap .noUi-origin{-webkit-transition:left .3s,top .3s;transition:left .3s,top .3s}.modal-backdrop,.modal-backdrop.fade.in{position:fixed;width:100%;height:100%;z-index:990}.modal-dialog.modal-max{width:98%;max-width:98%}@media only screen and (min-width:768px){.modal-dialog.modal-large{width:80%;max-width:900px}}@media only screen and (min-width:768px){.modal-dialog.modal-medium{width:60%;max-width:650px}}@media only screen and (min-width:768px){.modal-dialog.modal-small{width:40%;max-width:450px}}.modal-dialog .modal-body .modal-viewport{min-height:140px}.modal-dialog .suffix .alert{margin-bottom:0;border-radius:0 0 5px 5px}.modal-title img{margin:0 15px 0 0}.modal-overflow .modal-body{overflow:hidden}.ui-dialog{position:absolute;top:0;left:0;padding:0;width:300px;overflow:hidden;-webkit-background-clip:padding-box;background-clip:padding-box;background-color:#fff;border-radius:3px;-webkit-box-shadow:0 5px 15px rgba(0,0,0,0.5);box-shadow:0 5px 15px rgba(0,0,0,0.5);border:1px solid rgba(0,0,0,0.2);outline:medium none;z-index:1050}.ui-dialog .ui-dialog-titlebar{position:relative;padding:0 10px;background:#fff;border-color:#fff;font-size:18px;text-decoration:none;border:0 0 0 1px solid;border-bottom-right-radius:0;border-bottom-left-radius:0;border-bottom:1px solid #ccc;border-bottom-color:#eee}.ui-dialog .ui-dialog-title{float:left;margin:0;color:#404040;font-weight:700;padding:5px;text-overflow:ellipsis;overflow:hidden}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:19px;margin:-16px 4px 0 0;padding:1px;height:18px;font-size:20px;font-weight:700;line-height:13.5px;text-shadow:0 1px 0 #fff;filter:alpha(opacity=25);-khtml-opacity:.25;-moz-opacity:.25;opacity:.25;background:0;border:0;-webkit-box-shadow:none;box-shadow:none}.ui-dialog .ui-dialog-titlebar-close:before{content:"\f00d";font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:13px}.ui-dialog .ui-dialog-titlebar-close:focus,.ui-dialog .ui-dialog-titlebar-close:hover{padding:1px;filter:alpha(opacity=90);-moz-opacity:.9;opacity:.9}.ui-dialog .ui-dialog-titlebar-close span{display:block;margin:1px;text-indent:9999px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:0;overflow:auto}.ui-dialog .ui-dialog-buttonpane{margin:13px 0 0;padding:19px 15px 20px;border-top:1px solid #eee;border-width:1px 0 0;border-radius:0 0 6px 6px;background-image:none;background-color:#fff;-webkit-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff;text-align:right}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:0 .4em 0 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:14px;height:14px;right:3px;bottom:3px}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-dialog-buttonpane .ui-dialog-buttonset .ui-button{color:#fff;background-color:#428bca;border-color:#357ebd}.ui-dialog-buttonpane .ui-dialog-buttonset .ui-button.ui-state-hover{color:#fff;background-color:#3276b1;border-color:#285e8e}.ui-dialog-buttonset .ui-button:not(:first-child){cursor:pointer;display:inline-block;color:#333;background-color:#fff;border:1px solid #ccc;-webkit-transition:.1s linear all;transition:.1s linear all;overflow:visible}.ui-dialog-buttonset .ui-button:not(:first-child) .ui-state-hover{color:#333;background-color:#ebebeb;border-color:#adadad;text-decoration:none}.ui-dialog-buttonset .ui-button.ui-button-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.ui-dialog-buttonset .ui-button.ui-button-info.ui-state-hover{color:#fff;background-color:#39b3d7;border-color:#269abc}.ui-dialog-buttonset .ui-button.ui-button-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.ui-dialog-buttonset .ui-button.ui-button-success.ui-state-hover{color:#fff;background-color:#47a447;border-color:#398439}.ui-dialog-buttonset .ui-button.ui-button-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.ui-dialog-buttonset .ui-button.ui-button-warning.ui-state-hover{color:#fff;background-color:#ed9c28;border-color:#d58512}.ui-dialog-buttonset .ui-button.ui-button-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.ui-dialog-buttonset .ui-button.ui-button-danger.ui-state-hover{color:#fff;background-color:#d2322d;border-color:#ac2925}.ui-dialog-buttonset .ui-button.ui-button-inverse{color:#fff;background-color:#222;border-color:#080808}.ui-dialog-buttonset .ui-button.ui-button-inverse.ui-state-hover{color:#fff;background-color:#363636;border-color:#000}.modal-overflow{position:relative}.modal-overflow .scrollmarker{position:absolute;width:100%;height:20px}.modal-overflow .scrollmarker.top{background:-moz-linear-gradient(top,#3276b1 0,rgba(50,118,177,0.83) 17%,rgba(50,118,177,0) 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#3276b1),color-stop(17%,rgba(50,118,177,0.83)),color-stop(100%,rgba(50,118,177,0)));background:-webkit-linear-gradient(top,#3276b1 0,rgba(50,118,177,0.83) 17%,rgba(50,118,177,0) 100%);background:-o-linear-gradient(top,#3276b1 0,rgba(50,118,177,0.83) 17%,rgba(50,118,177,0) 100%);background:-ms-linear-gradient(top,#3276b1 0,rgba(50,118,177,0.83) 17%,rgba(50,118,177,0) 100%);background:linear-gradient(to bottom,#3276b1 0,rgba(50,118,177,0.83) 17%,rgba(50,118,177,0) 100%)}.modal-overflow .scrollmarker.bottom{background:-moz-linear-gradient(bottom,#3276b1 0,rgba(50,118,177,0.83) 17%,rgba(50,118,177,0) 100%);background:-webkit-gradient(linear,left bottom,left top,color-stop(0%,#3276b1),color-stop(17%,rgba(50,118,177,0.83)),color-stop(100%,rgba(50,118,177,0)));background:-webkit-linear-gradient(bottom,#3276b1 0,rgba(50,118,177,0.83) 17%,rgba(50,118,177,0) 100%);background:-o-linear-gradient(bottom,#3276b1 0,rgba(50,118,177,0.83) 17%,rgba(50,118,177,0) 100%);background:-ms-linear-gradient(bottom,#3276b1 0,rgba(50,118,177,0.83) 17%,rgba(50,118,177,0) 100%);background:linear-gradient(to top,#3276b1 0,rgba(50,118,177,0.83) 17%,rgba(50,118,177,0) 100%)}.pricing-big{border:0!important}.pricing-big .panel-heading{border-radius:5px 5px 0 0}.pricing-big .panel-title{text-transform:capitalize;font-size:18px;padding:20px 0;text-align:center;border-radius:5px 5px 0 0;margin:0;font-weight:700}.pricing-big .the-price{padding:20px 0;background:#333;text-align:center;font-size:24px;font-weight:700;color:#FFF;-webkit-box-shadow:none!important;box-shadow:none!important}.pricing-big .subscript{font-size:18px;color:#999;margin-left:5px}.pricing-big .panel-footer{border-radius:0 0 5px 5px;background-color:#f2f2f2!important}.pricing-big .panel-footer>div{padding:15px 0 10px;display:block;font-size:13px}.pricing-big .panel-footer .btn{padding:15px 0;border-radius:3px;font-weight:700;font-size:14px}.pricing-big .panel-footer .btn span{font-weight:400;font-style:italic}.pricing-big table{background:#fafafa;padding:20px 15px;height:230px;text-align:left}.price-features{background:#fafafa;padding:20px 15px;min-height:230px;font-size:13.5px}.price-features .price-features li+li{margin-top:10px}.superbox *,.superbox :after,.superbox :before{margin:0;padding:0;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-webkit-font-smoothing:antialiased;-moz-font-smoothing:antialiased;-o-font-smoothing:antialiased;font-smoothing:antialiased;text-rendering:optimizeLegibility}.superbox-list{display:inline-block;*display:inline;zoom:1;width:12.5%;padding:5px;position:relative}.superbox-list.active:before{content:"\f0d8";font-family:FontAwesome;display:block;position:absolute;left:43%;bottom:-34px;z-index:2;text-align:center;font-size:45px;color:#222}@media only screen and (min-width:320px){.superbox-list{width:50%}}@media only screen and (min-width:486px){.superbox-list{width:25%}}@media only screen and (min-width:768px){.superbox-list{width:16.66666667%}}@media only screen and (min-width:1025px){.superbox-list{width:12.5%}}@media only screen and (min-width:1824px){.superbox-list{width:12.5%}}.superbox-img{max-width:100%;width:100%;cursor:pointer}.superbox-show{text-align:left;position:relative;background-color:#222;width:100%;float:left;padding:25px 0 12px 25px;display:none;margin:5px 0}.superbox-current-img{max-width:100%;float:left;padding-right:25px;padding-bottom:13px}.superbox-img:hover{opacity:.8}.superbox-float{float:left}.superbox-close{opacity:.7;cursor:pointer;position:absolute;top:15px;right:15px;-webkit-transition:all .1s linear 0s;transition:all .1s linear 0s}.superbox-close:hover{opacity:1}.superbox-imageinfo{display:inline-block;max-width:500px;color:#fff;padding:0 25px 0 0}.superbox-imageinfo span{font-size:13px;color:#a19994;margin-right:-2px;padding-top:10px;display:inline-block;padding-bottom:13px}.superbox-imageinfo>:first-child{margin-bottom:10px;font-weight:700}.superbox-imageinfo span p:last-child{margin-top:30px}.bootstrap-tagsinput{display:block;width:100%;min-height:32px;padding:1px 3px;font-size:13px;line-height:1.428571429;color:#555;vertical-align:middle;background-color:#FFF;border:1px solid #CCC;border-radius:0}.bootstrap-tagsinput>span{border-radius:0!important;font-weight:400;padding:3px 28px 4px 8px;font-size:13px;border:1px solid #285e8e;background:#3276b1}.bootstrap-tagsinput input{border:0;-webkit-box-shadow:none;box-shadow:none;outline:0;background-color:transparent;padding:0;margin:0;width:auto!important;max-width:inherit}.bootstrap-tagsinput input:focus{border:0;-webkit-box-shadow:none;box-shadow:none}.bootstrap-tagsinput .tag{color:#FFF;position:relative;margin:3px 0 3px 2px;display:inline-block}.bootstrap-tagsinput .tag [data-role=remove]{display:block;top:-1px;right:0;padding:3px 4px 3px 5px;width:23px;height:22px;position:absolute;cursor:pointer}.bootstrap-tagsinput .tag [data-role=remove]:after{content:"\f057";font-family:fontAwesome;padding:2px 1px;line-height:17px;font-size:15px;text-align:center}.bootstrap-tagsinput .tag [data-role=remove]:hover{background:rgba(0,0,0,0.3);-webkit-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)}.bootstrap-tagsinput .tag [data-role=remove]:hover:active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.slider{display:inline-block;vertical-align:middle;position:relative}.slider.slider-horizontal{width:100%!important;height:20px}.slider.slider-horizontal .slider-track{height:10px;width:100%;margin-top:-5px;top:50%;left:0}.slider.slider-horizontal .slider-selection{height:100%;top:0;bottom:0}.slider.slider-horizontal .slider-selection+.slider-handle.triangle+.slider-handle.triangle:before{content:"\f0d9"}.slider.slider-horizontal .slider-handle{margin-left:-10px;margin-top:-5px}.slider.slider-horizontal .slider-handle.triangle{width:20px;height:20px;filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);border:0;line-height:21px;color:#797777;text-shadow:0 1px 0 rgba(255,255,255,0.8)}.slider.slider-horizontal .slider-handle.triangle:before{content:"\f0da";font-size:34px}.slider.slider-vertical{height:210px;width:20px}.slider.slider-vertical .slider-track{width:10px;height:100%;margin-left:-5px;left:50%;top:0}.slider.slider-vertical .slider-selection{width:100%;left:0;top:0;bottom:0}.slider.slider-vertical .slider-selection+.slider-handle.triangle+.slider-handle.triangle:before{content:"\f0d8";text-shadow:0 -1px 0 rgba(255,255,255,0.8)}.slider.slider-vertical .slider-handle{margin-left:-5px;margin-top:-10px}.slider.slider-vertical .slider-handle.triangle{width:20px;height:20px;filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);border:0;line-height:21px;color:#797777;text-shadow:0 -1px 0 rgba(255,255,255,0.8)}.slider.slider-vertical .slider-handle.triangle:before{content:"\f0d7";font-size:32px;text-shadow:0 1px 0 rgba(255,255,255,0.8)}.slider input{display:none}.slider .tooltip-inner{white-space:nowrap}.slider-track{position:absolute;cursor:pointer;background:#e5e5e5}.slider-danger+.slider-track>.slider-selection{background:#a90329}.slider-warning+.slider-track>.slider-selection{background:#c79121}.slider-info+.slider-track>.slider-selection{background:#57889c}.slider-success+.slider-track>.slider-selection{background:#739e73}.slider-selection{position:absolute;background:#3276b1}.slider-handle{position:absolute;width:20px;height:20px;border:1px solid #FFF;background:#858585;display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:400;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-align:center;line-height:18px;font-size:10px;color:#ccc;text-shadow:0 1px 0 rgba(77,77,77,0.5);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.slider-handle:before{content:"\f0c9"}.slider-handle.round{border-radius:20px;width:20px;height:20px}.slider-handle.triangle{background:transparent none}.fd-form-element-hidden{display:none}.fd-slider{width:100%;height:20px;margin:0}.fd-slider-vertical{width:20px;height:100%;margin:0 10px 10px 0}.fd-slider,.fd-slider-vertical{display:block;position:relative;text-decoration:none;border:0 none;-moz-user-select:none;-khtml-user-select:none;-webkit-touch-callout:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.fd-slider-inner{display:none}.fd-slider-bar{position:absolute;display:block;z-index:2;height:6px;width:100%;border:1px solid #bbb;border-bottom:1px solid #fff;border-right:1px solid #fff;margin:0;padding:0;overflow:hidden;line-height:4px;top:8px;border-radius:4px;-webkit-background-clip:padding-box;background-clip:padding-box;background-color:#333}.fd-slider-range{position:absolute;display:block;z-index:3;height:6px;margin:0;padding:0 2px 0 0;overflow:hidden;top:9px;border-radius:2px;-webkit-background-clip:padding-box;background-clip:padding-box;background-color:#eee}.fd-slider-handle{position:absolute;display:block;padding:0;margin:0 0 0 1px;z-index:3;top:5px;left:0;width:12px;height:12px;line-height:1px!important;outline:0 none;background:#eee;border:1px solid #aaa;border-radius:12px;-webkit-user-select:none;-webkit-touch-callout:none;-moz-user-select:none;-moz-user-focus:none;-moz-outline:0 none;-ms-user-select:none;user-select:none}.fd-slider-handle:focus{outline:0 none;border:0 none;-moz-user-focus:normal}.fd-slider-handle:before,.fd-slider-handle:after{opacity:0;-webkit-transition-property:opacity;-webkit-transition-duration:1s;-webkit-transition-delay:1s;transition-property:opacity;transition-duration:1s;transition-delay:1s}button.fd-slider-handle:focus::-moz-focus-inner{border-color:transparent}.oldie .fd-slider-handle:after,.oldie .fd-slider-handle:before{display:none}body.fd-slider-drag-horizontal,body.fd-slider-drag-horizontal *,body.fd-slider-drag-vertical,body.fd-slider-drag-vertical *{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.fd-slider-active .fd-slider-handle :before,.fd-slider-focused .fd-slider-handle :before,.fd-slider-hover .fd-slider-handle :before{display:block;position:absolute;top:-21px;left:-8px;margin:0;width:20px;padding:3px;height:14px;line-height:12px;text-align:center;font-size:10px;font-weight:700;color:#fff;text-shadow:1px 1px 1px #1a3a95;background:#2f6ee0;z-index:1;content:attr(aria-valuetext);border-radius:3px;-webkit-background-clip:padding-box;background-clip:padding-box;-webkit-box-shadow:0 0 4px #aaa;box-shadow:0 0 4px #999;opacity:1}.fd-slider-active .fd-slider-handle:after,.fd-slider-focused .fd-slider-handle:after,.fd-slider-hover .fd-slider-handle:after{outline:0;content:"";display:block;position:absolute;top:-9px;left:50%;margin:0 0 0 -5px;background:#2f6ee0;z-index:2;width:10px;height:10px;overflow:hidden;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-o-transform:rotate(45deg);-webkit-box-shadow:0 0 4px #aaa;box-shadow:0 0 4px #aaa;clip:rect(4px,14px,14px,4px);opacity:1}.chart{height:220px;margin:20px 5px 10px 10px}.chart-small{height:100px;width:100%}.chart-large{height:235px;width:100%}.chart-xl{height:297px;width:100%}#flotTip{padding:3px 5px;background-color:#fff;z-index:9999;color:#333;-webkit-box-shadow:0 1px 8px rgba(0,0,0,0.1);box-shadow:0 1px 8px rgba(0,0,0,0.1);font-size:14px;border:1px solid #c1c1c1;-khtml-border-radius:4px;border-radius:4px}#flotTip span{color:#38812d;font-weight:700}.has-legend{margin-top:30px!important}.has-legend-unique{margin-top:19px!important}.legendLabel span{display:block;margin:0 5px}.legendColorBox{padding-left:10px;vertical-align:top;padding-top:5px}.legendColorBox div>div{width:4px;height:4px;border-radius:50%;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box}.morris-hover{position:absolute;z-index:1001}.morris-hover.morris-default-style{border-radius:10px;padding:6px;color:#666;background:rgba(255,255,255,0.8);border:solid 2px rgba(230,230,230,0.8);font-family:Ubuntu,sans-serif;font-size:12px;text-align:center}.morris-hover.morris-default-style .morris-hover-row-label{font-weight:700;margin:.25em 0}.morris-hover.morris-default-style .morris-hover-point{white-space:nowrap;margin:.1em 0}.easyPieChart{position:relative;text-align:center}.easyPieChart canvas{position:absolute;top:0;left:0}.easy-pie-chart{display:inline-block}.easy-pie-chart .percent{color:#444;font-size:12px;font-weight:700}.easy-pie-title{display:inline-block;margin:10px 6px 0;font-size:12px;font-weight:400;text-transform:uppercase;width:100px;height:19px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.easy-pie-title .icon-color-bad,.easy-pie-title .icon-color-good{font-size:18px}.show-stat-buttons{float:left;width:100%}@media(max-width:767px){.show-stat-buttons{padding-left:10px!important;padding-right:10px!important}}@media only screen and (min-width:0) and (max-width:679px){.show-stat-buttons{padding-left:10px!important;padding-right:10px!important}}@media only screen and (min-width:320px) and (max-width:479px){.show-stat-buttons{padding-left:10px!important;padding-right:10px!important}}.show-stats{padding-top:6px!important}.show-stats .progress{height:7px;border-radius:0;margin-top:3px;margin-bottom:15px}.show-stats .show-stat-buttons>:first-child{padding-right:5px}@media(max-width:979px){.show-stats .show-stat-buttons>:first-child{padding-right:13px}}.show-stats .show-stat-buttons>:last-child{padding-left:5px}@media(max-width:979px){.show-stats .show-stat-buttons>:last-child{padding-left:13px}}.show-stat-microcharts{margin-left:-10px;margin-right:-10px}.show-stat-microcharts>div{border-right:1px solid #dadada!important;border-top:1px solid #dadada!important;margin-top:10px!important;height:65px;overflow:hidden;padding:7px 9px}@media(max-width:767px){.show-stat-microcharts>div{margin-top:0!important;border-right:0!important}}@media only screen and (min-width:0) and (max-width:679px){.show-stat-microcharts>div{margin-top:0!important;border-right:0!important}}@media only screen and (min-width:320px) and (max-width:479px){.show-stat-microcharts>div{margin-top:0!important;border-right:0!important}}.show-stat-microcharts>:last-child{border-right:0!important}.show-stat-microcharts .sparkline{margin-top:10px;margin-right:8px;opacity:.7}.show-stat-microcharts .sparkline:hover{opacity:1}.smaller-stat{margin:0;padding:0;list-style:none}.smaller-stat li{margin-top:3px;margin-right:0}.smaller-stat li:first-child{margin-top:8px}.smaller-stat span.label{width:40px;display:block;text-align:left;opacity:.5;cursor:default}.smaller-stat span.label:hover{opacity:1}.jvectormap-label{position:absolute;display:none;border:solid 1px #cdcdcd;border-radius:3px;background:#292929;color:#fff;font-family:Ubuntu,sans-serif,Verdana;font-size:smaller;padding:3px}.jvectormap-zoomin{top:0}.jvectormap-zoomout{top:24px}.jvectormap-zoomin,.jvectormap-zoomout{position:absolute;background:#292929;padding:4px;width:22px;height:22px;cursor:pointer;line-height:10px;text-align:center;font-size:14px;border-radius:2px;box-shadow:inset 0 -2px 0 rgba(0,0,0,0.05);-webkit-box-shadow:inset 0 -2px 0 rgba(0,0,0,0.05);background-color:#fff;border:1px solid #bfbfbf}.jvectormap-zoomin:hover,.jvectormap-zoomout:hover{background:#eee;border-color:#d9d9d9}.vector-map{height:300px;width:100%;padding:10px}#chat-container{position:absolute;width:250px;height:270px;z-index:2;border-left:1px solid #cdcecf;right:-251px;top:0;background:#fff;transition-duration:.25s;-webkit-transition-duration:.25s}#chat-container:hover,#chat-container:hover .chat-list-open-close{border-color:#a7a7a7}#chat-container *,#chat-container :after,#chat-container :before{box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box}#chat-container input[type=text]{box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box}#chat-container.open{right:0;top:0}#chat-container.open .chat-list-open-close i:before{content:"\f00d"!important}#chat-container.open .chat-list-open-close b{display:none}#chat-container .chat-list-open-close{display:block;width:25px;height:25px;border:1px solid #cdcecf;border-right:1px solid #f2f4f8!important;position:absolute;left:-32px;top:7%;border-radius:50% 0 0 50%;padding:3px 1px 3px 5px;font-size:21px;line-height:22px;cursor:pointer;color:#868686;-webkit-box-shadow:inset 0 .2em 0 rgba(0,0,0,0.05);box-shadow:inset 0 .2em 0 rgba(0,0,0,0.05);background:#f2f4f8;text-align:center}#chat-container .chat-list-open-close b{position:absolute;right:0;background:#ed1c24;line-height:9px;height:10px;width:10px;top:3px;border:1px solid #FFF;border-radius:3px;font-size:9px;text-align:center;vertical-align:middle;color:#fff;font-weight:400}#chat-container .chat-list-body{height:217px;overflow-y:scroll;overflow-x:hidden;display:block;padding:0;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;background:#f2f4f8}#chat-container #chat-users{list-style:none;margin:10px 0;padding:0}#chat-container #chat-users li{margin-bottom:3px;margin-left:5px}#chat-container #chat-users li a{display:block;font-size:13px;color:#3d3d3d;text-decoration:none!important;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;padding:3px 8px 3px 3px;line-height:33px;vertical-align:middle}#chat-container #chat-users li a:hover{background:#e0e4ee}#chat-container #chat-users li a img{width:33px;height:auto;margin-right:10px}#chat-container #chat-users li a i{color:#acacac;font-size:8px;line-height:34px;font-style:normal}#chat-container #chat-users li a i.last-online{font-size:12px;letter-spacing:-1px}#chat-container .chat-list-footer{overflow:hidden;border-top:1px solid #CCC;padding:10px;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box}#chat-container .chat-list-footer input[type=text]{border:1px solid #bababa!important}#chat-container .control-group{padding:0}.chat-body{background:#fafafa;background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJod…EiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#fafafa),color-stop(100%,#fff));background:-webkit-linear-gradient(top,#fafafa 0,#fff 100%);background:-webkit-gradient(linear,top left,bottom left,from(#f5fcff),to(#fff));background:-webkit-linear-gradient(top,#f5fcff 0,#fff 100%);background:linear-gradient(to bottom,#f5fcff 0,#fff 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fafafa',endColorstr='#ffffff',GradientType=0);-webkit-box-shadow:inset 2px 2px 5px rgba(0,0,0,0.04);box-shadow:inset 2px 2px 5px rgba(0,0,0,0.04);display:block;height:270px;overflow-y:scroll;overflow-x:hidden;padding:10px;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;border:1px solid #fff;border-top:0}.chat-body ul{margin:0;padding:0}.chat-body li:first-child{margin-top:10px}.chat-body li.message{display:block;position:relative;margin:20px 20px 0}.chat-body li.message img{display:inline-block;border-left:4px solid #fff;position:absolute}.chat-body li.message img.online{border-left-color:#00a300}.chat-body li.message img.offline{border-left-color:#ddd}.chat-body li.message img.busy{border-left-color:#a90329}.chat-body li.message img.away{border-left-color:#ffc40d}.chat-body li.message .message-text{display:inline-block;vertical-align:top;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;padding:0;margin-left:65px;line-height:normal}.chat-body li.message .message-text time{position:absolute;top:1px;right:0;font-size:10px;line-height:10px;color:#afafaf}.chat-body li.message .message-text .chat-file{display:block;margin:3px 0;padding:4px;border:1px dotted #ddd;background:rgba(0,0,0,0.05);border-radius:4px;text-align:right;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box}.chat-body li.message .message-text .chat-file:nth-child(3){margin-top:15px}.chat-body li.message .message-text .chat-file.row-fluid [class*=span]{min-height:10px!important}.chat-body li.message .message-text .chat-file b{font-style:italic;white-space:nowrap;width:250px;overflow:hidden;text-overflow:ellipsis;text-align:left}@media(min-width:768px) and (max-width:880px){.chat-body li.message .message-text .chat-file b{width:150px}}@media only screen and (min-width:320px) and (max-width:479px){.chat-body li.message .message-text .chat-file b{width:150px}}@media(max-width:480px){.chat-body li.message .message-text .chat-file b{width:150px}}.chat-body li.message .message-text a.username{display:block;font-weight:700;margin-bottom:4px;vertical-align:top;line-height:14px;font-size:14px;letter-spacing:-1px;text-decoration:none!important}.chat-footer{border-top:1px solid rgba(0,0,0,0.1);background:rgba(248,248,248,0.9);padding:0 10px 15px;position:relative;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box}.profile-message{background:none!important;height:auto!important;box-shadow:none!important;-webkit-box-shadow:none!important;overflow:hidden}.profile-message li.message.message-reply{margin-left:85px!important;background:#f7f7f7;padding:10px;margin:3px 0 0 20px}.profile-message li.message.message-reply img{width:35px!important}.profile-message li.message.message-reply .message-text{margin-left:45px!important}.profile-message .wall-comment-reply{margin-left:85px;margin-bottom:20px}.cajita img{width:23px;height:23px;padding-left:3px;padding-top:3px}#pageslide{display:none;position:absolute;position:fixed;top:0;height:100%;z-index:999999;width:305px;padding:20px;background-color:#004d60;color:#FFF;-webkit-box-shadow:inset 0 0 5px 5px #222;-moz-shadow:inset 0 0 0 0 #222;box-shadow:inset 0 0 0 0 #222}.purehtml{color:#fff;font-size:16px}#inbox-table{font-size:13px;border-top:0;border-left-color:transparent!important;border-right-color:transparent!important}#inbox-table tbody tr:hover{cursor:pointer;background:#e4e4e4}#inbox-table tr td{border-right:0;border-left:0;line-height:26px;padding:6px 4px 7px!important}#inbox-table .inbox-table-icon{padding-left:15px!important}@media(max-width:979px){#inbox-table .inbox-table-icon{padding-left:10px!important}}#inbox-table tbody tr th{overflow:hidden}#inbox-table.table tbody>tr>td{border-color:#fff!important}#inbox-table .checkbox,#inbox-table .radio{margin-top:-1px;margin-bottom:0}.minified .inbox-badge{border-radius:50%;font-size:9px;padding:2px;position:absolute;top:6px;right:6px;background:#ed1c24;min-width:13px}.inbox-body{position:relative}.inbox-body .table-wrap{background:#fff;padding:10px 14px 7px;position:relative;margin-left:200px}@media(max-width:1024px){.inbox-body .table-wrap{margin-left:0!important}}@media(max-width:979px){.inbox-body .table-wrap{padding:0!important}}.inbox-body.no-content-padding{margin-top:0;background:#fff}.inbox-nav-bar{height:70px;margin-bottom:0;padding:20px 14px;background:#fff}@media(max-width:979px){.inbox-nav-bar{padding-left:5px;padding-right:5px}}@media(min-width:768px) and (max-width:880px){.inbox-nav-bar.no-content-padding{margin-top:-10px!important}}@media(max-width:767px){.inbox-nav-bar.no-content-padding{margin-top:-10px!important}}@media only screen and (min-width:0) and (max-width:679px){.inbox-nav-bar.no-content-padding{margin-top:-10px!important}}@media only screen and (min-width:320px) and (max-width:479px){.inbox-nav-bar.no-content-padding{margin-top:-10px!important}}.inbox-nav-bar .page-title{display:inline-block;margin:0;width:196px;line-height:33px;vertical-align:middle}.inbox-footer{height:52px;padding:15px 14px 0;border-top:1px solid #cecece;background:#2a2725;position:absolute;bottom:-53px;width:100%}.inbox-footer .btn-group,.inbox-paging{margin-left:10px}.inbox-data-attachment,.inbox-table-icon{width:28px;text-align:left;padding-left:12px!important;padding-right:0!important}.inbox-data-from{width:200px}.inbox-data-from>:first-child{width:200px;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.inbox-data-date{width:80px;padding-left:7px!important;padding-right:0!important}.inbox-data-message>:first-child{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;height:27px;color:#8a8a8a}@media(max-width:979px){.inbox-data-message>:first-child{height:50px;overflow:hidden}}.inbox-data-message>:first-child span{color:#111}.inbox-data-message>:first-child span.label{color:#fff}@media(max-width:979px){.inbox-data-message>:first-child>:first-child{display:block!important;font-size:14px}}.inbox-data-message>:first-child>:first-child:after{content:" - "}.inbox-checkbox-triggered{display:inline-block}.inbox-checkbox-triggered>.btn-group{margin-right:10px}.inbox-checkbox-triggered>.btn-group .btn{padding-left:14px;padding-right:14px}@media(max-width:979px){.inbox-checkbox-triggered>.btn-group .btn{padding-left:10px;padding-right:10px}}.inbox-side-bar{height:100%;position:absolute;background:#fff;display:block;width:200px;padding:10px 0 10px 14px}@media(max-width:1024px){.inbox-side-bar{display:none!important}}.inbox-side-bar h6{font-weight:400;font-size:11px;display:block;padding:0 15px;text-transform:uppercase;color:#838383}.inbox-side-bar h6 a{font-size:14px;margin-top:-2px}.inbox-side-bar h6 .tooltip{text-transform:none!important}.inbox-side-bar>.btn{margin-bottom:35px}.inbox-side-bar .input-group{margin-bottom:25px}.inbox-space{display:block;width:185px}.inbox-space>.progress{margin-top:5px}.inbox .inbox-menu-lg{list-style:none;padding:0;margin:0 0 20px}.inbox .inbox-menu-lg .inbox-menu-lg li{display:block;width:100%}.inbox .inbox-menu-lg .inbox-menu-lg li a{display:block;padding:6px 15px 7px;font-size:13px;color:#333}.inbox .inbox-menu-lg .inbox-menu-lg li a:hover{text-decoration:none;background:#f4f4f4}.inbox .inbox-menu-lg .inbox-menu-lg li.active a{font-weight:700;background:#f0f0f0;border-bottom:1px solid #e7e7e7;color:#3276b1}.inbox .inbox-menu-sm{list-style:none;padding:0;margin:0 0 20px}.inbox .inbox-menu-sm .inbox-menu-sm li{display:block;width:100%}.inbox .inbox-menu-sm .inbox-menu-sm li a{display:block;padding:8px 15px 10px;font-size:13px;color:#333}.inbox .inbox-menu-sm .inbox-menu-sm li a:hover{text-decoration:none;background:#f4f4f4}.inbox .inbox-menu-sm .inbox-menu-sm li.active a{font-weight:700;background:#f0f0f0;border-bottom:1px solid #e7e7e7;color:#3276b1}.inbox-info-bar{padding:10px 0;border-bottom:1px solid #bfbfbf}.inbox-info-bar .form-group{margin:0}.inbox-info-bar .form-group input,.inbox-info-bar .select2-container-multi .select2-choices{border-color:#fff!important}.inbox-info-bar .select2-choices>div{display:none}.inbox-info-bar .col-md-1,.inbox-info-bar .col-md-11{padding-left:0;padding-right:0}@media(max-width:1024px){.inbox-info-bar .col-md-1,.inbox-info-bar .col-md-11{padding-left:26px;padding-right:26px}}.inbox-info-bar img{width:35px;height:auto;display:inline-block;vertical-align:middle;margin-right:7px;margin-left:2px;border-left:3px solid #fff}.inbox-info-bar em{position:absolute;top:6px;right:20px;text-align:right;font-style:normal}.inbox-download .inbox-message{padding:15px 4px;border-bottom:1px solid #bfbfbf}.inbox-download-list{list-style:none;margin:5px 0 0;padding:0}.inbox-download-list li{display:inline-block;margin:0 5px 0 0;vertical-align:top}.inbox-download-list li>:first-child{margin-bottom:0;width:150px;overflow:hidden}.inbox-download-list li>:first-child:hover{background:#fff;border-color:silver}.inbox-download-list li>:first-child>:first-child{text-align:center;display:block;color:#d6d6d6}.inbox-download-list li>:first-child>:first-child>.fa{font-size:150px}.inbox-download-list li>:first-child>:first-child>img{max-width:120px}.inbox-compose-footer{padding:10px;background:#f5f5f5;border-bottom:1px solid #a9a9a9}.inbox-compose-footer,.inbox-download,.inbox-info-bar,.inbox-message{margin-right:240px;position:relative}@media(max-width:1280px){.inbox-compose-footer,.inbox-download,.inbox-info-bar,.inbox-message{margin-right:0}}@media(max-width:979px){.inbox-table-icon>:first-child{margin-top:12px}}.unread td{background:#fff}.unread .inbox-data-date>:first-child,.unread .inbox-data-from>:first-child,.unread .inbox-data-message>:first-child>:first-child{font-weight:700}tr.highlight td,tr.unread.highlight td{background:#ffc!important;color:#333}#compose-mail-mini{margin-left:4px}.email-open-header{margin:-10px 0 0 0;font-size:20px;border-bottom:1px solid #bfbfbf;border-top:1px solid #eee;padding:15px 3px}.email-open-header>span{font-size:10px;font-weight:400;padding:3px 5px;letter-spacing:normal;text-transform:uppercase;vertical-align:middle;line-height:33px;background:#acacac}.email-infobox{display:block;width:180px;border-bottom:1px solid #bfbfbf;padding-bottom:0;padding-top:15px;position:absolute;top:65px;right:15px}@media(max-width:1280px){.email-infobox .email-infobox{display:none}}.email-reply-text>div{border-left:1px solid #d6d6d6;padding-left:10px;margin-left:50px;color:#a9a9a9}.email-reply-text>:first-child{padding-left:45px}.profile-pic{text-align:right}.profile-pic>img{border-radius:0;position:relative;border:5px solid #fff;top:-30px;display:inline-block;text-align:right;z-index:4;width:120px;margin-bottom:-30px}.profile-carousel .carousel-inner{max-height:150px}.friends-list li{margin-bottom:10px}.friends-list li img{width:35px;border:1px solid #fff;outline:1px solid #bfbfbf}.search-results{padding:18px 5px}.search-results+.search-results{border-top:1px dashed #e3e3e3}.search-results>:first-child{margin-bottom:4px;font-weight:400}.search-results>:first-child a{text-decoration:underline}.search-results .url{font-style:normal;font-size:14px}.search-results img{display:inline-block;margin-top:4px;margin-right:4px;width:80px}.search-results>div{display:inline-block;vertical-align:top}.search-results .note{margin:0;line-height:normal}.search-results .note a{text-decoration:none!important;color:#333}.search-results .note a:hover{color:#ed1c24}.todo{margin:0;padding:0;min-height:5px;list-style:none}.todo>li{display:block;position:relative;overflow:hidden;border-bottom:1px solid #e7e7e7;margin:0 5px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAQCAYAAADagWXwAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo0RkQ1OEY4NTM4NUIxMUUzQjdCMUMxQzJCQUE3MTMxOCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo0RkQ1OEY4NjM4NUIxMUUzQjdCMUMxQzJCQUE3MTMxOCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjRGRDU4RjgzMzg1QjExRTNCN0IxQzFDMkJBQTcxMzE4IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjRGRDU4Rjg0Mzg1QjExRTNCN0IxQzFDMkJBQTcxMzE4Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+pTD+wgAAACtJREFUeNpimDBhwn8gYABhdDYjiIELMDHgAUwTJ06Ea0VnjxpLO2MBAgwAGYZLegQbQ3UAAAAASUVORK5CYII=) 1px 11px no-repeat}.todo>li:last-child,.todo>li:only-child{border-bottom:0}.todo>li>:first-child{display:block;border-right:1px solid #ffe1eb;height:100%;padding:6px 11px 6px 18px;width:20px;vertical-align:top;position:absolute}.todo>li>:first-child:hover{cursor:move}.todo>li.complete{background:0}.todo>li.complete.complete>:first-child:hover{cursor:default}.todo>li.complete>*{text-decoration:line-through;font-style:italic}.todo>li.ui-sortable-helper{border-top:1px solid #eee;background:rgba(113,132,63,0.1)}.todo>li>p{height:100%;margin-left:52px;border-left:1px solid #ffe1eb;display:inline-block;padding:8px 0 6px 7px;margin-bottom:0;min-height:37px;line-height:normal;font-size:14px;font-weight:500;color:#333}.todo>li>p>span{display:block;line-height:12px;font-size:10px;font-weight:400}.todo>li>p>:first-child{margin-top:-5px;color:#999;margin-bottom:4px}.todo>li>p>.date{color:#bfbfbf}.todo-group-title{margin:0;line-height:31px;padding:0 0 0 10px;background:#fafafa;border-bottom:1px solid #e7e7e7;border-top:1px solid #f4f4f4;color:#999}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/AddOnManager.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,265 @@
+/**
+ * AddOnManager.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles the loading of themes/plugins or other add-ons and their language packs.
+ *
+ * @class tinymce.AddOnManager
+ */
+define("tinymce/AddOnManager", [
+	"tinymce/dom/ScriptLoader",
+	"tinymce/util/Tools"
+], function(ScriptLoader, Tools) {
+	var each = Tools.each;
+
+	function AddOnManager() {
+		var self = this;
+
+		self.items = [];
+		self.urls = {};
+		self.lookup = {};
+	}
+
+	AddOnManager.prototype = {
+		/**
+		 * Returns the specified add on by the short name.
+		 *
+		 * @method get
+		 * @param {String} name Add-on to look for.
+		 * @return {tinymce.Theme/tinymce.Plugin} Theme or plugin add-on instance or undefined.
+		 */
+		get: function(name) {
+			if (this.lookup[name]) {
+				return this.lookup[name].instance;
+			} else {
+				return undefined;
+			}
+		},
+
+		dependencies: function(name) {
+			var result;
+
+			if (this.lookup[name]) {
+				result = this.lookup[name].dependencies;
+			}
+
+			return result || [];
+		},
+
+		/**
+		 * Loads a language pack for the specified add-on.
+		 *
+		 * @method requireLangPack
+		 * @param {String} name Short name of the add-on.
+		 * @param {String} languages Optional comma or space separated list of languages to check if it matches the name.
+		 */
+		requireLangPack: function(name, languages) {
+			var language = AddOnManager.language;
+
+			if (language && AddOnManager.languageLoad !== false) {
+				if (languages) {
+					languages = ',' + languages + ',';
+
+					// Load short form sv.js or long form sv_SE.js
+					if (languages.indexOf(',' + language.substr(0, 2) + ',') != -1) {
+						language = language.substr(0, 2);
+					} else if (languages.indexOf(',' + language + ',') == -1) {
+						return;
+					}
+				}
+
+				ScriptLoader.ScriptLoader.add(this.urls[name] + '/langs/' + language + '.js');
+			}
+		},
+
+		/**
+		 * Adds a instance of the add-on by it's short name.
+		 *
+		 * @method add
+		 * @param {String} id Short name/id for the add-on.
+		 * @param {tinymce.Theme/tinymce.Plugin} addOn Theme or plugin to add.
+		 * @return {tinymce.Theme/tinymce.Plugin} The same theme or plugin instance that got passed in.
+		 * @example
+		 * // Create a simple plugin
+		 * tinymce.create('tinymce.plugins.TestPlugin', {
+		 *   TestPlugin: function(ed, url) {
+		 *   ed.on('click', function(e) {
+		 *      ed.windowManager.alert('Hello World!');
+		 *   });
+		 *   }
+		 * });
+		 *
+		 * // Register plugin using the add method
+		 * tinymce.PluginManager.add('test', tinymce.plugins.TestPlugin);
+		 *
+		 * // Initialize TinyMCE
+		 * tinymce.init({
+		 *  ...
+		 *  plugins: '-test' // Init the plugin but don't try to load it
+		 * });
+		 */
+		add: function(id, addOn, dependencies) {
+			this.items.push(addOn);
+			this.lookup[id] = {instance: addOn, dependencies: dependencies};
+
+			return addOn;
+		},
+
+		createUrl: function(baseUrl, dep) {
+			if (typeof dep === "object") {
+				return dep;
+			} else {
+				return {prefix: baseUrl.prefix, resource: dep, suffix: baseUrl.suffix};
+			}
+		},
+
+		/**
+		 * Add a set of components that will make up the add-on. Using the url of the add-on name as the base url.
+		 * This should be used in development mode.  A new compressor/javascript munger process will ensure that the
+		 * components are put together into the plugin.js file and compressed correctly.
+		 *
+		 * @method addComponents
+		 * @param {String} pluginName name of the plugin to load scripts from (will be used to get the base url for the plugins).
+		 * @param {Array} scripts Array containing the names of the scripts to load.
+		 */
+		addComponents: function(pluginName, scripts) {
+			var pluginUrl = this.urls[pluginName];
+
+			each(scripts, function(script) {
+				ScriptLoader.ScriptLoader.add(pluginUrl + "/" + script);
+			});
+		},
+
+		/**
+		 * Loads an add-on from a specific url.
+		 *
+		 * @method load
+		 * @param {String} name Short name of the add-on that gets loaded.
+		 * @param {String} addOnUrl URL to the add-on that will get loaded.
+		 * @param {function} callback Optional callback to execute ones the add-on is loaded.
+		 * @param {Object} scope Optional scope to execute the callback in.
+		 * @example
+		 * // Loads a plugin from an external URL
+		 * tinymce.PluginManager.load('myplugin', '/some/dir/someplugin/plugin.js');
+		 *
+		 * // Initialize TinyMCE
+		 * tinymce.init({
+		 *  ...
+		 *  plugins: '-myplugin' // Don't try to load it again
+		 * });
+		 */
+		load: function(name, addOnUrl, callback, scope) {
+			var self = this, url = addOnUrl;
+
+			function loadDependencies() {
+				var dependencies = self.dependencies(name);
+
+				each(dependencies, function(dep) {
+					var newUrl = self.createUrl(addOnUrl, dep);
+
+					self.load(newUrl.resource, newUrl, undefined, undefined);
+				});
+
+				if (callback) {
+					if (scope) {
+						callback.call(scope);
+					} else {
+						callback.call(ScriptLoader);
+					}
+				}
+			}
+
+			if (self.urls[name]) {
+				return;
+			}
+
+			if (typeof addOnUrl === "object") {
+				url = addOnUrl.prefix + addOnUrl.resource + addOnUrl.suffix;
+			}
+
+			if (url.indexOf('/') !== 0 && url.indexOf('://') == -1) {
+				url = AddOnManager.baseURL + '/' + url;
+			}
+
+			self.urls[name] = url.substring(0, url.lastIndexOf('/'));
+
+			if (self.lookup[name]) {
+				loadDependencies();
+			} else {
+				ScriptLoader.ScriptLoader.add(url, loadDependencies, scope);
+			}
+		}
+	};
+
+	AddOnManager.PluginManager = new AddOnManager();
+	AddOnManager.ThemeManager = new AddOnManager();
+
+	return AddOnManager;
+});
+
+/**
+ * TinyMCE theme class.
+ *
+ * @class tinymce.Theme
+ */
+
+/**
+ * This method is responsible for rendering/generating the overall user interface with toolbars, buttons, iframe containers etc.
+ *
+ * @method renderUI
+ * @param {Object} obj Object parameter containing the targetNode DOM node that will be replaced visually with an editor instance.
+ * @return {Object} an object with items like iframeContainer, editorContainer, sizeContainer, deltaWidth, deltaHeight.
+ */
+
+/**
+ * Plugin base class, this is a pseudo class that describes how a plugin is to be created for TinyMCE. The methods below are all optional.
+ *
+ * @class tinymce.Plugin
+ * @example
+ * tinymce.PluginManager.add('example', function(editor, url) {
+ *     // Add a button that opens a window
+ *     editor.addButton('example', {
+ *         text: 'My button',
+ *         icon: false,
+ *         onclick: function() {
+ *             // Open window
+ *             editor.windowManager.open({
+ *                 title: 'Example plugin',
+ *                 body: [
+ *                     {type: 'textbox', name: 'title', label: 'Title'}
+ *                 ],
+ *                 onsubmit: function(e) {
+ *                     // Insert content when the window form is submitted
+ *                     editor.insertContent('Title: ' + e.data.title);
+ *                 }
+ *             });
+ *         }
+ *     });
+ *
+ *     // Adds a menu item to the tools menu
+ *     editor.addMenuItem('example', {
+ *         text: 'Example plugin',
+ *         context: 'tools',
+ *         onclick: function() {
+ *             // Open window with a specific url
+ *             editor.windowManager.open({
+ *                 title: 'TinyMCE site',
+ *                 url: 'http://www.tinymce.com',
+ *                 width: 800,
+ *                 height: 600,
+ *                 buttons: [{
+ *                     text: 'Close',
+ *                     onclick: 'close'
+ *                 }]
+ *             });
+ *         }
+ *     });
+ * });
+ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/Compat.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,84 @@
+/**
+ * Compat.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * TinyMCE core class.
+ *
+ * @static
+ * @class tinymce
+ * @borrow-members tinymce.EditorManager
+ * @borrow-members tinymce.util.Tools
+ */
+define("tinymce/Compat", [
+	"tinymce/dom/DOMUtils",
+	"tinymce/dom/EventUtils",
+	"tinymce/dom/ScriptLoader",
+	"tinymce/AddOnManager",
+	"tinymce/util/Tools",
+	"tinymce/Env"
+], function(DOMUtils, EventUtils, ScriptLoader, AddOnManager, Tools, Env) {
+	var tinymce = window.tinymce;
+
+	/**
+	 * @property {tinymce.dom.DOMUtils} DOM Global DOM instance.
+	 * @property {tinymce.dom.ScriptLoader} ScriptLoader Global ScriptLoader instance.
+	 * @property {tinymce.AddOnManager} PluginManager Global PluginManager instance.
+	 * @property {tinymce.AddOnManager} ThemeManager Global ThemeManager instance.
+	 */
+	tinymce.DOM = DOMUtils.DOM;
+	tinymce.ScriptLoader = ScriptLoader.ScriptLoader;
+	tinymce.PluginManager = AddOnManager.PluginManager;
+	tinymce.ThemeManager = AddOnManager.ThemeManager;
+
+	tinymce.dom = tinymce.dom || {};
+	tinymce.dom.Event = EventUtils.Event;
+
+	Tools.each(Tools, function(func, key) {
+		tinymce[key] = func;
+	});
+
+	Tools.each('isOpera isWebKit isIE isGecko isMac'.split(' '), function(name) {
+		tinymce[name] = Env[name.substr(2).toLowerCase()];
+	});
+
+	return {};
+});
+
+// Describe the different namespaces
+
+/**
+ * Root level namespace this contains classes directly releated to the TinyMCE editor.
+ *
+ * @namespace tinymce
+ */
+
+/**
+ * Contains classes for handling the browsers DOM.
+ *
+ * @namespace tinymce.dom
+ */
+
+/**
+ * Contains html parser and serializer logic.
+ *
+ * @namespace tinymce.html
+ */
+
+/**
+ * Contains the different UI types such as buttons, listboxes etc.
+ *
+ * @namespace tinymce.ui
+ */
+
+/**
+ * Contains various utility classes such as json parser, cookies etc.
+ *
+ * @namespace tinymce.util
+ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/Editor.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,2070 @@
+/**
+ * Editor.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*jshint scripturl:true */
+
+/**
+ * Include the base event class documentation.
+ *
+ * @include ../../../tools/docs/tinymce.Event.js
+ */
+
+/**
+ * This class contains the core logic for a TinyMCE editor.
+ *
+ * @class tinymce.Editor
+ * @mixes tinymce.util.Observable
+ * @example
+ * // Add a class to all paragraphs in the editor.
+ * tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('p'), 'someclass');
+ *
+ * // Gets the current editors selection as text
+ * tinymce.activeEditor.selection.getContent({format: 'text'});
+ *
+ * // Creates a new editor instance
+ * var ed = new tinymce.Editor('textareaid', {
+ *     some_setting: 1
+ * }, tinymce.EditorManager);
+ *
+ * // Select each item the user clicks on
+ * ed.on('click', function(e) {
+ *     ed.selection.select(e.target);
+ * });
+ *
+ * ed.render();
+ */
+define("tinymce/Editor", [
+	"tinymce/dom/DOMUtils",
+	"tinymce/dom/DomQuery",
+	"tinymce/AddOnManager",
+	"tinymce/NodeChange",
+	"tinymce/html/Node",
+	"tinymce/dom/Serializer",
+	"tinymce/html/Serializer",
+	"tinymce/dom/Selection",
+	"tinymce/Formatter",
+	"tinymce/UndoManager",
+	"tinymce/EnterKey",
+	"tinymce/ForceBlocks",
+	"tinymce/EditorCommands",
+	"tinymce/util/URI",
+	"tinymce/dom/ScriptLoader",
+	"tinymce/dom/EventUtils",
+	"tinymce/WindowManager",
+	"tinymce/html/Schema",
+	"tinymce/html/DomParser",
+	"tinymce/util/Quirks",
+	"tinymce/Env",
+	"tinymce/util/Tools",
+	"tinymce/EditorObservable",
+	"tinymce/Shortcuts"
+], function(
+	DOMUtils, DomQuery, AddOnManager, NodeChange, Node, DomSerializer, Serializer,
+	Selection, Formatter, UndoManager, EnterKey, ForceBlocks, EditorCommands,
+	URI, ScriptLoader, EventUtils, WindowManager,
+	Schema, DomParser, Quirks, Env, Tools, EditorObservable, Shortcuts
+) {
+	// Shorten these names
+	var DOM = DOMUtils.DOM, ThemeManager = AddOnManager.ThemeManager, PluginManager = AddOnManager.PluginManager;
+	var extend = Tools.extend, each = Tools.each, explode = Tools.explode;
+	var inArray = Tools.inArray, trim = Tools.trim, resolve = Tools.resolve;
+	var Event = EventUtils.Event;
+	var isGecko = Env.gecko, ie = Env.ie;
+
+	/**
+	 * Include documentation for all the events.
+	 *
+	 * @include ../../../tools/docs/tinymce.Editor.js
+	 */
+
+	/**
+	 * Constructs a editor instance by id.
+	 *
+	 * @constructor
+	 * @method Editor
+	 * @param {String} id Unique id for the editor.
+	 * @param {Object} settings Settings for the editor.
+	 * @param {tinymce.EditorManager} editorManager EditorManager instance.
+	 * @author Moxiecode
+	 */
+	function Editor(id, settings, editorManager) {
+		var self = this, documentBaseUrl, baseUri;
+
+		documentBaseUrl = self.documentBaseUrl = editorManager.documentBaseURL;
+		baseUri = editorManager.baseURI;
+
+		/**
+		 * Name/value collection with editor settings.
+		 *
+		 * @property settings
+		 * @type Object
+		 * @example
+		 * // Get the value of the theme setting
+		 * tinymce.activeEditor.windowManager.alert("You are using the " + tinymce.activeEditor.settings.theme + " theme");
+		 */
+		self.settings = settings = extend({
+			id: id,
+			theme: 'modern',
+			delta_width: 0,
+			delta_height: 0,
+			popup_css: '',
+			plugins: '',
+			document_base_url: documentBaseUrl,
+			add_form_submit_trigger: true,
+			submit_patch: true,
+			add_unload_trigger: true,
+			convert_urls: true,
+			relative_urls: true,
+			remove_script_host: true,
+			object_resizing: true,
+			doctype: '<!DOCTYPE html>',
+			visual: true,
+			font_size_style_values: 'xx-small,x-small,small,medium,large,x-large,xx-large',
+
+			// See: http://www.w3.org/TR/CSS2/fonts.html#propdef-font-size
+			font_size_legacy_values: 'xx-small,small,medium,large,x-large,xx-large,300%',
+			forced_root_block: 'p',
+			hidden_input: true,
+			padd_empty_editor: true,
+			render_ui: true,
+			indentation: '30px',
+			inline_styles: true,
+			convert_fonts_to_spans: true,
+			indent: 'simple',
+			indent_before: 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,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,th,ul,ol,li,dl,dt,dd,area,table,thead,' +
+				'tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist',
+			validate: true,
+			entity_encoding: 'named',
+			url_converter: self.convertURL,
+			url_converter_scope: self,
+			ie7_compat: true
+		}, settings);
+
+		AddOnManager.language = settings.language || 'en';
+		AddOnManager.languageLoad = settings.language_load;
+
+		AddOnManager.baseURL = editorManager.baseURL;
+
+		/**
+		 * Editor instance id, normally the same as the div/textarea that was replaced.
+		 *
+		 * @property id
+		 * @type String
+		 */
+		self.id = settings.id = id;
+
+		/**
+		 * State to force the editor to return false on a isDirty call.
+		 *
+		 * @property isNotDirty
+		 * @type Boolean
+		 * @example
+		 * function ajaxSave() {
+		 *     var ed = tinymce.get('elm1');
+		 *
+		 *     // Save contents using some XHR call
+		 *     alert(ed.getContent());
+		 *
+		 *     ed.isNotDirty = true; // Force not dirty state
+		 * }
+		 */
+		self.isNotDirty = true;
+
+		/**
+		 * Name/Value object containting plugin instances.
+		 *
+		 * @property plugins
+		 * @type Object
+		 * @example
+		 * // Execute a method inside a plugin directly
+		 * tinymce.activeEditor.plugins.someplugin.someMethod();
+		 */
+		self.plugins = {};
+
+		/**
+		 * URI object to document configured for the TinyMCE instance.
+		 *
+		 * @property documentBaseURI
+		 * @type tinymce.util.URI
+		 * @example
+		 * // Get relative URL from the location of document_base_url
+		 * tinymce.activeEditor.documentBaseURI.toRelative('/somedir/somefile.htm');
+		 *
+		 * // Get absolute URL from the location of document_base_url
+		 * tinymce.activeEditor.documentBaseURI.toAbsolute('somefile.htm');
+		 */
+		self.documentBaseURI = new URI(settings.document_base_url || documentBaseUrl, {
+			base_uri: baseUri
+		});
+
+		/**
+		 * URI object to current document that holds the TinyMCE editor instance.
+		 *
+		 * @property baseURI
+		 * @type tinymce.util.URI
+		 * @example
+		 * // Get relative URL from the location of the API
+		 * tinymce.activeEditor.baseURI.toRelative('/somedir/somefile.htm');
+		 *
+		 * // Get absolute URL from the location of the API
+		 * tinymce.activeEditor.baseURI.toAbsolute('somefile.htm');
+		 */
+		self.baseURI = baseUri;
+
+		/**
+		 * Array with CSS files to load into the iframe.
+		 *
+		 * @property contentCSS
+		 * @type Array
+		 */
+		self.contentCSS = [];
+
+		/**
+		 * Array of CSS styles to add to head of document when the editor loads.
+		 *
+		 * @property contentStyles
+		 * @type Array
+		 */
+		self.contentStyles = [];
+
+		// Creates all events like onClick, onSetContent etc see Editor.Events.js for the actual logic
+		self.shortcuts = new Shortcuts(self);
+		self.loadedCSS = {};
+		self.editorCommands = new EditorCommands(self);
+
+		if (settings.target) {
+			self.targetElm = settings.target;
+		}
+
+		self.suffix = editorManager.suffix;
+		self.editorManager = editorManager;
+		self.inline = settings.inline;
+
+		if (settings.cache_suffix) {
+			Env.cacheSuffix = settings.cache_suffix.replace(/^[\?\&]+/, '');
+		}
+
+		// Call setup
+		editorManager.fire('SetupEditor', self);
+		self.execCallback('setup', self);
+
+		/**
+		 * Dom query instance with default scope to the editor document and default element is the body of the editor.
+		 *
+		 * @property $
+		 * @type tinymce.dom.DomQuery
+		 * @example
+		 * tinymce.activeEditor.$('p').css('color', 'red');
+		 * tinymce.activeEditor.$().append('<p>new</p>');
+		 */
+		self.$ = DomQuery.overrideDefaults(function() {
+			return {
+				context: self.inline ? self.getBody() : self.getDoc(),
+				element: self.getBody()
+			};
+		});
+	}
+
+	Editor.prototype = {
+		/**
+		 * Renderes the editor/adds it to the page.
+		 *
+		 * @method render
+		 */
+		render: function() {
+			var self = this, settings = self.settings, id = self.id, suffix = self.suffix;
+
+			function readyHandler() {
+				DOM.unbind(window, 'ready', readyHandler);
+				self.render();
+			}
+
+			// Page is not loaded yet, wait for it
+			if (!Event.domLoaded) {
+				DOM.bind(window, 'ready', readyHandler);
+				return;
+			}
+
+			// Element not found, then skip initialization
+			if (!self.getElement()) {
+				return;
+			}
+
+			// No editable support old iOS versions etc
+			if (!Env.contentEditable) {
+				return;
+			}
+
+			// Hide target element early to prevent content flashing
+			if (!settings.inline) {
+				self.orgVisibility = self.getElement().style.visibility;
+				self.getElement().style.visibility = 'hidden';
+			} else {
+				self.inline = true;
+			}
+
+			var form = self.getElement().form || DOM.getParent(id, 'form');
+			if (form) {
+				self.formElement = form;
+
+				// Add hidden input for non input elements inside form elements
+				if (settings.hidden_input && !/TEXTAREA|INPUT/i.test(self.getElement().nodeName)) {
+					DOM.insertAfter(DOM.create('input', {type: 'hidden', name: id}), id);
+					self.hasHiddenInput = true;
+				}
+
+				// Pass submit/reset from form to editor instance
+				self.formEventDelegate = function(e) {
+					self.fire(e.type, e);
+				};
+
+				DOM.bind(form, 'submit reset', self.formEventDelegate);
+
+				// Reset contents in editor when the form is reset
+				self.on('reset', function() {
+					self.setContent(self.startContent, {format: 'raw'});
+				});
+
+				// Check page uses id="submit" or name="submit" for it's submit button
+				if (settings.submit_patch && !form.submit.nodeType && !form.submit.length && !form._mceOldSubmit) {
+					form._mceOldSubmit = form.submit;
+					form.submit = function() {
+						self.editorManager.triggerSave();
+						self.isNotDirty = true;
+
+						return form._mceOldSubmit(form);
+					};
+				}
+			}
+
+			/**
+			 * Window manager reference, use this to open new windows and dialogs.
+			 *
+			 * @property windowManager
+			 * @type tinymce.WindowManager
+			 * @example
+			 * // Shows an alert message
+			 * tinymce.activeEditor.windowManager.alert('Hello world!');
+			 *
+			 * // Opens a new dialog with the file.htm file and the size 320x240
+			 * // It also adds a custom parameter this can be retrieved by using tinyMCEPopup.getWindowArg inside the dialog.
+			 * tinymce.activeEditor.windowManager.open({
+			 *    url: 'file.htm',
+			 *    width: 320,
+			 *    height: 240
+			 * }, {
+			 *    custom_param: 1
+			 * });
+			 */
+			self.windowManager = new WindowManager(self);
+
+			if (settings.encoding == 'xml') {
+				self.on('GetContent', function(e) {
+					if (e.save) {
+						e.content = DOM.encode(e.content);
+					}
+				});
+			}
+
+			if (settings.add_form_submit_trigger) {
+				self.on('submit', function() {
+					if (self.initialized) {
+						self.save();
+					}
+				});
+			}
+
+			if (settings.add_unload_trigger) {
+				self._beforeUnload = function() {
+					if (self.initialized && !self.destroyed && !self.isHidden()) {
+						self.save({format: 'raw', no_events: true, set_dirty: false});
+					}
+				};
+
+				self.editorManager.on('BeforeUnload', self._beforeUnload);
+			}
+
+			// Load scripts
+			function loadScripts() {
+				var scriptLoader = ScriptLoader.ScriptLoader;
+
+				if (settings.language && settings.language != 'en' && !settings.language_url) {
+					settings.language_url = self.editorManager.baseURL + '/langs/' + settings.language + '.js';
+				}
+
+				if (settings.language_url) {
+					scriptLoader.add(settings.language_url);
+				}
+
+				if (settings.theme && typeof settings.theme != "function" &&
+					settings.theme.charAt(0) != '-' && !ThemeManager.urls[settings.theme]) {
+					var themeUrl = settings.theme_url;
+
+					if (themeUrl) {
+						themeUrl = self.documentBaseURI.toAbsolute(themeUrl);
+					} else {
+						themeUrl = 'themes/' + settings.theme + '/theme' + suffix + '.js';
+					}
+
+					ThemeManager.load(settings.theme, themeUrl);
+				}
+
+				if (Tools.isArray(settings.plugins)) {
+					settings.plugins = settings.plugins.join(' ');
+				}
+
+				each(settings.external_plugins, function(url, name) {
+					PluginManager.load(name, url);
+					settings.plugins += ' ' + name;
+				});
+
+				each(settings.plugins.split(/[ ,]/), function(plugin) {
+					plugin = trim(plugin);
+
+					if (plugin && !PluginManager.urls[plugin]) {
+						if (plugin.charAt(0) == '-') {
+							plugin = plugin.substr(1, plugin.length);
+
+							var dependencies = PluginManager.dependencies(plugin);
+
+							each(dependencies, function(dep) {
+								var defaultSettings = {
+									prefix: 'plugins/',
+									resource: dep,
+									suffix: '/plugin' + suffix + '.js'
+								};
+
+								dep = PluginManager.createUrl(defaultSettings, dep);
+								PluginManager.load(dep.resource, dep);
+							});
+						} else {
+							PluginManager.load(plugin, {
+								prefix: 'plugins/',
+								resource: plugin,
+								suffix: '/plugin' + suffix + '.js'
+							});
+						}
+					}
+				});
+
+				scriptLoader.loadQueue(function() {
+					if (!self.removed) {
+						self.init();
+					}
+				});
+			}
+
+			loadScripts();
+		},
+
+		/**
+		 * Initializes the editor this will be called automatically when
+		 * all plugins/themes and language packs are loaded by the rendered method.
+		 * This method will setup the iframe and create the theme and plugin instances.
+		 *
+		 * @method init
+		 */
+		init: function() {
+			var self = this, settings = self.settings, elm = self.getElement();
+			var w, h, minHeight, n, o, Theme, url, bodyId, bodyClass, re, i, initializedPlugins = [];
+
+			this.editorManager.i18n.setCode(settings.language);
+			self.rtl = this.editorManager.i18n.rtl;
+			self.editorManager.add(self);
+
+			settings.aria_label = settings.aria_label || DOM.getAttrib(elm, 'aria-label', self.getLang('aria.rich_text_area'));
+
+			/**
+			 * Reference to the theme instance that was used to generate the UI.
+			 *
+			 * @property theme
+			 * @type tinymce.Theme
+			 * @example
+			 * // Executes a method on the theme directly
+			 * tinymce.activeEditor.theme.someMethod();
+			 */
+			if (settings.theme) {
+				if (typeof settings.theme != "function") {
+					settings.theme = settings.theme.replace(/-/, '');
+					Theme = ThemeManager.get(settings.theme);
+					self.theme = new Theme(self, ThemeManager.urls[settings.theme]);
+
+					if (self.theme.init) {
+						self.theme.init(self, ThemeManager.urls[settings.theme] || self.documentBaseUrl.replace(/\/$/, ''), self.$);
+					}
+				} else {
+					self.theme = settings.theme;
+				}
+			}
+
+			function initPlugin(plugin) {
+				var Plugin = PluginManager.get(plugin), pluginUrl, pluginInstance;
+
+				pluginUrl = PluginManager.urls[plugin] || self.documentBaseUrl.replace(/\/$/, '');
+				plugin = trim(plugin);
+				if (Plugin && inArray(initializedPlugins, plugin) === -1) {
+					each(PluginManager.dependencies(plugin), function(dep) {
+						initPlugin(dep);
+					});
+
+					pluginInstance = new Plugin(self, pluginUrl, self.$);
+
+					self.plugins[plugin] = pluginInstance;
+
+					if (pluginInstance.init) {
+						pluginInstance.init(self, pluginUrl);
+						initializedPlugins.push(plugin);
+					}
+				}
+			}
+
+			// Create all plugins
+			each(settings.plugins.replace(/\-/g, '').split(/[ ,]/), initPlugin);
+
+			// Measure box
+			if (settings.render_ui && self.theme) {
+				self.orgDisplay = elm.style.display;
+
+				if (typeof settings.theme != "function") {
+					w = settings.width || elm.style.width || elm.offsetWidth;
+					h = settings.height || elm.style.height || elm.offsetHeight;
+					minHeight = settings.min_height || 100;
+					re = /^[0-9\.]+(|px)$/i;
+
+					if (re.test('' + w)) {
+						w = Math.max(parseInt(w, 10), 100);
+					}
+
+					if (re.test('' + h)) {
+						h = Math.max(parseInt(h, 10), minHeight);
+					}
+
+					// Render UI
+					o = self.theme.renderUI({
+						targetNode: elm,
+						width: w,
+						height: h,
+						deltaWidth: settings.delta_width,
+						deltaHeight: settings.delta_height
+					});
+
+					// Resize editor
+					if (!settings.content_editable) {
+						h = (o.iframeHeight || h) + (typeof h == 'number' ? (o.deltaHeight || 0) : '');
+						if (h < minHeight) {
+							h = minHeight;
+						}
+					}
+				} else {
+					o = settings.theme(self, elm);
+
+					// Convert element type to id:s
+					if (o.editorContainer.nodeType) {
+						o.editorContainer = o.editorContainer.id = o.editorContainer.id || self.id + "_parent";
+					}
+
+					// Convert element type to id:s
+					if (o.iframeContainer.nodeType) {
+						o.iframeContainer = o.iframeContainer.id = o.iframeContainer.id || self.id + "_iframecontainer";
+					}
+
+					// Use specified iframe height or the targets offsetHeight
+					h = o.iframeHeight || elm.offsetHeight;
+				}
+
+				self.editorContainer = o.editorContainer;
+			}
+
+			// Load specified content CSS last
+			if (settings.content_css) {
+				each(explode(settings.content_css), function(u) {
+					self.contentCSS.push(self.documentBaseURI.toAbsolute(u));
+				});
+			}
+
+			// Load specified content CSS last
+			if (settings.content_style) {
+				self.contentStyles.push(settings.content_style);
+			}
+
+			// Content editable mode ends here
+			if (settings.content_editable) {
+				elm = n = o = null; // Fix IE leak
+				return self.initContentBody();
+			}
+
+			self.iframeHTML = settings.doctype + '<html><head>';
+
+			// We only need to override paths if we have to
+			// IE has a bug where it remove site absolute urls to relative ones if this is specified
+			if (settings.document_base_url != self.documentBaseUrl) {
+				self.iframeHTML += '<base href="' + self.documentBaseURI.getURI() + '" />';
+			}
+
+			// IE8 doesn't support carets behind images setting ie7_compat would force IE8+ to run in IE7 compat mode.
+			if (!Env.caretAfter && settings.ie7_compat) {
+				self.iframeHTML += '<meta http-equiv="X-UA-Compatible" content="IE=7" />';
+			}
+
+			self.iframeHTML += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
+
+			// Load the CSS by injecting them into the HTML this will reduce "flicker"
+			for (i = 0; i < self.contentCSS.length; i++) {
+				var cssUrl = self.contentCSS[i];
+				self.iframeHTML += (
+					'<link type="text/css" ' +
+						'rel="stylesheet" ' +
+						'href="' + Tools._addCacheSuffix(cssUrl) + '" />'
+				);
+				self.loadedCSS[cssUrl] = true;
+			}
+
+			bodyId = settings.body_id || 'tinymce';
+			if (bodyId.indexOf('=') != -1) {
+				bodyId = self.getParam('body_id', '', 'hash');
+				bodyId = bodyId[self.id] || bodyId;
+			}
+
+			bodyClass = settings.body_class || '';
+			if (bodyClass.indexOf('=') != -1) {
+				bodyClass = self.getParam('body_class', '', 'hash');
+				bodyClass = bodyClass[self.id] || '';
+			}
+
+			if (settings.content_security_policy) {
+				self.iframeHTML += '<meta http-equiv="Content-Security-Policy" content="' + settings.content_security_policy + '" />';
+			}
+
+			self.iframeHTML += '</head><body id="' + bodyId +
+				'" class="mce-content-body ' + bodyClass +
+				'" data-id="' + self.id + '"><br></body></html>';
+
+			/*eslint no-script-url:0 */
+			var domainRelaxUrl = 'javascript:(function(){' +
+				'document.open();document.domain="' + document.domain + '";' +
+				'var ed = window.parent.tinymce.get("' + self.id + '");document.write(ed.iframeHTML);' +
+				'document.close();ed.initContentBody(true);})()';
+
+			// Domain relaxing is required since the user has messed around with document.domain
+			if (document.domain != location.hostname) {
+				url = domainRelaxUrl;
+			}
+
+			// Create iframe
+			// TODO: ACC add the appropriate description on this.
+			var ifr = DOM.create('iframe', {
+				id: self.id + "_ifr",
+				//src: url || 'javascript:""', // Workaround for HTTPS warning in IE6/7
+				frameBorder: '0',
+				allowTransparency: "true",
+				title: self.editorManager.translate(
+						"Rich Text Area. Press ALT-F9 for menu. " +
+						"Press ALT-F10 for toolbar. Press ALT-0 for help"
+				),
+				style: {
+					width: '100%',
+					height: h,
+					display: 'block' // Important for Gecko to render the iframe correctly
+				}
+			});
+
+			ifr.onload = function() {
+				ifr.onload = null;
+				self.fire("load");
+			};
+
+			DOM.setAttrib(ifr, "src", url || 'javascript:""');
+
+			self.contentAreaContainer = o.iframeContainer;
+			self.iframeElement = ifr;
+
+			n = DOM.add(o.iframeContainer, ifr);
+
+			// Try accessing the document this will fail on IE when document.domain is set to the same as location.hostname
+			// Then we have to force domain relaxing using the domainRelaxUrl approach very ugly!!
+			if (ie) {
+				try {
+					self.getDoc();
+				} catch (e) {
+					n.src = url = domainRelaxUrl;
+				}
+			}
+
+			if (o.editorContainer) {
+				DOM.get(o.editorContainer).style.display = self.orgDisplay;
+				self.hidden = DOM.isHidden(o.editorContainer);
+			}
+
+			self.getElement().style.display = 'none';
+			DOM.setAttrib(self.id, 'aria-hidden', true);
+
+			if (!url) {
+				self.initContentBody();
+			}
+
+			elm = n = o = null; // Cleanup
+		},
+
+		/**
+		 * This method get called by the init method ones the iframe is loaded.
+		 * It will fill the iframe with contents, setups DOM and selection objects for the iframe.
+		 *
+		 * @method initContentBody
+		 * @private
+		 */
+		initContentBody: function(skipWrite) {
+			var self = this, settings = self.settings, targetElm = self.getElement(), doc = self.getDoc(), body, contentCssText;
+
+			// Restore visibility on target element
+			if (!settings.inline) {
+				self.getElement().style.visibility = self.orgVisibility;
+			}
+
+			// Setup iframe body
+			if (!skipWrite && !settings.content_editable) {
+				doc.open();
+				doc.write(self.iframeHTML);
+				doc.close();
+			}
+
+			if (settings.content_editable) {
+				self.on('remove', function() {
+					var bodyEl = this.getBody();
+
+					DOM.removeClass(bodyEl, 'mce-content-body');
+					DOM.removeClass(bodyEl, 'mce-edit-focus');
+					DOM.setAttrib(bodyEl, 'contentEditable', null);
+				});
+
+				DOM.addClass(targetElm, 'mce-content-body');
+				self.contentDocument = doc = settings.content_document || document;
+				self.contentWindow = settings.content_window || window;
+				self.bodyElement = targetElm;
+
+				// Prevent leak in IE
+				settings.content_document = settings.content_window = null;
+
+				// TODO: Fix this
+				settings.root_name = targetElm.nodeName.toLowerCase();
+			}
+
+			// It will not steal focus while setting contentEditable
+			body = self.getBody();
+			body.disabled = true;
+
+			if (!settings.readonly) {
+				if (self.inline && DOM.getStyle(body, 'position', true) == 'static') {
+					body.style.position = 'relative';
+				}
+
+				body.contentEditable = self.getParam('content_editable_state', true);
+			}
+
+			body.disabled = false;
+
+			/**
+			 * Schema instance, enables you to validate elements and it's children.
+			 *
+			 * @property schema
+			 * @type tinymce.html.Schema
+			 */
+			self.schema = new Schema(settings);
+
+			/**
+			 * DOM instance for the editor.
+			 *
+			 * @property dom
+			 * @type tinymce.dom.DOMUtils
+			 * @example
+			 * // Adds a class to all paragraphs within the editor
+			 * tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('p'), 'someclass');
+			 */
+			self.dom = new DOMUtils(doc, {
+				keep_values: true,
+				url_converter: self.convertURL,
+				url_converter_scope: self,
+				hex_colors: settings.force_hex_style_colors,
+				class_filter: settings.class_filter,
+				update_styles: true,
+				root_element: self.inline ? self.getBody() : null,
+				collect: settings.content_editable,
+				schema: self.schema,
+				onSetAttrib: function(e) {
+					self.fire('SetAttrib', e);
+				}
+			});
+
+			/**
+			 * HTML parser will be used when contents is inserted into the editor.
+			 *
+			 * @property parser
+			 * @type tinymce.html.DomParser
+			 */
+			self.parser = new DomParser(settings, self.schema);
+
+			// Convert src and href into data-mce-src, data-mce-href and data-mce-style
+			self.parser.addAttributeFilter('src,href,style,tabindex', function(nodes, name) {
+				var i = nodes.length, node, dom = self.dom, value, internalName;
+
+				while (i--) {
+					node = nodes[i];
+					value = node.attr(name);
+					internalName = 'data-mce-' + name;
+
+					// Add internal attribute if we need to we don't on a refresh of the document
+					if (!node.attributes.map[internalName]) {
+						if (name === "style") {
+							value = dom.serializeStyle(dom.parseStyle(value), node.name);
+
+							if (!value.length) {
+								value = null;
+							}
+
+							node.attr(internalName, value);
+							node.attr(name, value);
+						} else if (name === "tabindex") {
+							node.attr(internalName, value);
+							node.attr(name, null);
+						} else {
+							node.attr(internalName, self.convertURL(value, name, node.name));
+						}
+					}
+				}
+			});
+
+			// Keep scripts from executing
+			self.parser.addNodeFilter('script', function(nodes) {
+				var i = nodes.length, node;
+
+				while (i--) {
+					node = nodes[i];
+					node.attr('type', 'mce-' + (node.attr('type') || 'no/type'));
+				}
+			});
+
+			self.parser.addNodeFilter('#cdata', function(nodes) {
+				var i = nodes.length, node;
+
+				while (i--) {
+					node = nodes[i];
+					node.type = 8;
+					node.name = '#comment';
+					node.value = '[CDATA[' + node.value + ']]';
+				}
+			});
+
+			self.parser.addNodeFilter('p,h1,h2,h3,h4,h5,h6,div', function(nodes) {
+				var i = nodes.length, node, nonEmptyElements = self.schema.getNonEmptyElements();
+
+				while (i--) {
+					node = nodes[i];
+
+					if (node.isEmpty(nonEmptyElements)) {
+						node.append(new Node('br', 1)).shortEnded = true;
+					}
+				}
+			});
+
+			/**
+			 * DOM serializer for the editor. Will be used when contents is extracted from the editor.
+			 *
+			 * @property serializer
+			 * @type tinymce.dom.Serializer
+			 * @example
+			 * // Serializes the first paragraph in the editor into a string
+			 * tinymce.activeEditor.serializer.serialize(tinymce.activeEditor.dom.select('p')[0]);
+			 */
+			self.serializer = new DomSerializer(settings, self);
+
+			/**
+			 * Selection instance for the editor.
+			 *
+			 * @property selection
+			 * @type tinymce.dom.Selection
+			 * @example
+			 * // Sets some contents to the current selection in the editor
+			 * tinymce.activeEditor.selection.setContent('Some contents');
+			 *
+			 * // Gets the current selection
+			 * alert(tinymce.activeEditor.selection.getContent());
+			 *
+			 * // Selects the first paragraph found
+			 * tinymce.activeEditor.selection.select(tinymce.activeEditor.dom.select('p')[0]);
+			 */
+			self.selection = new Selection(self.dom, self.getWin(), self.serializer, self);
+
+			/**
+			 * Formatter instance.
+			 *
+			 * @property formatter
+			 * @type tinymce.Formatter
+			 */
+			self.formatter = new Formatter(self);
+
+			/**
+			 * Undo manager instance, responsible for handling undo levels.
+			 *
+			 * @property undoManager
+			 * @type tinymce.UndoManager
+			 * @example
+			 * // Undoes the last modification to the editor
+			 * tinymce.activeEditor.undoManager.undo();
+			 */
+			self.undoManager = new UndoManager(self);
+
+			self.forceBlocks = new ForceBlocks(self);
+			self.enterKey = new EnterKey(self);
+			self._nodeChangeDispatcher = new NodeChange(self);
+
+			self.fire('PreInit');
+
+			if (!settings.browser_spellcheck && !settings.gecko_spellcheck) {
+				doc.body.spellcheck = false; // Gecko
+				DOM.setAttrib(body, "spellcheck", "false");
+			}
+
+			self.fire('PostRender');
+
+			self.quirks = new Quirks(self);
+
+			if (settings.directionality) {
+				body.dir = settings.directionality;
+			}
+
+			if (settings.nowrap) {
+				body.style.whiteSpace = "nowrap";
+			}
+
+			if (settings.protect) {
+				self.on('BeforeSetContent', function(e) {
+					each(settings.protect, function(pattern) {
+						e.content = e.content.replace(pattern, function(str) {
+							return '<!--mce:protected ' + escape(str) + '-->';
+						});
+					});
+				});
+			}
+
+			self.on('SetContent', function() {
+				self.addVisual(self.getBody());
+			});
+
+			// Remove empty contents
+			if (settings.padd_empty_editor) {
+				self.on('PostProcess', function(e) {
+					e.content = e.content.replace(/^(<p[^>]*>(&nbsp;|&#160;|\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/, '');
+				});
+			}
+
+			self.load({initial: true, format: 'html'});
+			self.startContent = self.getContent({format: 'raw'});
+
+			/**
+			 * Is set to true after the editor instance has been initialized
+			 *
+			 * @property initialized
+			 * @type Boolean
+			 * @example
+			 * function isEditorInitialized(editor) {
+			 *     return editor && editor.initialized;
+			 * }
+			 */
+			self.initialized = true;
+			self.bindPendingEventDelegates();
+
+			self.fire('init');
+			self.focus(true);
+			self.nodeChanged({initial: true});
+			self.execCallback('init_instance_callback', self);
+
+			// Add editor specific CSS styles
+			if (self.contentStyles.length > 0) {
+				contentCssText = '';
+
+				each(self.contentStyles, function(style) {
+					contentCssText += style + "\r\n";
+				});
+
+				self.dom.addStyle(contentCssText);
+			}
+
+			// Load specified content CSS last
+			each(self.contentCSS, function(cssUrl) {
+				if (!self.loadedCSS[cssUrl]) {
+					self.dom.loadCSS(cssUrl);
+					self.loadedCSS[cssUrl] = true;
+				}
+			});
+
+			// Handle auto focus
+			if (settings.auto_focus) {
+				setTimeout(function() {
+					var editor;
+
+					if (settings.auto_focus === true) {
+						editor = self;
+					} else {
+						editor = self.editorManager.get(settings.auto_focus);
+					}
+
+					if (!editor.destroyed) {
+						editor.focus();
+					}
+				}, 100);
+			}
+
+			// Clean up references for IE
+			targetElm = doc = body = null;
+		},
+
+		/**
+		 * Focuses/activates the editor. This will set this editor as the activeEditor in the tinymce collection
+		 * it will also place DOM focus inside the editor.
+		 *
+		 * @method focus
+		 * @param {Boolean} skipFocus Skip DOM focus. Just set is as the active editor.
+		 */
+		focus: function(skipFocus) {
+			var self = this, selection = self.selection, contentEditable = self.settings.content_editable, rng;
+			var controlElm, doc = self.getDoc(), body;
+
+			if (!skipFocus) {
+				// Get selected control element
+				rng = selection.getRng();
+				if (rng.item) {
+					controlElm = rng.item(0);
+				}
+
+				self._refreshContentEditable();
+
+				// Focus the window iframe
+				if (!contentEditable) {
+					// WebKit needs this call to fire focusin event properly see #5948
+					// But Opera pre Blink engine will produce an empty selection so skip Opera
+					if (!Env.opera) {
+						self.getBody().focus();
+					}
+
+					self.getWin().focus();
+				}
+
+				// Focus the body as well since it's contentEditable
+				if (isGecko || contentEditable) {
+					body = self.getBody();
+
+					// Check for setActive since it doesn't scroll to the element
+					if (body.setActive) {
+						// IE 11 sometimes throws "Invalid function" then fallback to focus
+						try {
+							body.setActive();
+						} catch (ex) {
+							body.focus();
+						}
+					} else {
+						body.focus();
+					}
+
+					if (contentEditable) {
+						selection.normalize();
+					}
+				}
+
+				// Restore selected control element
+				// This is needed when for example an image is selected within a
+				// layer a call to focus will then remove the control selection
+				if (controlElm && controlElm.ownerDocument == doc) {
+					rng = doc.body.createControlRange();
+					rng.addElement(controlElm);
+					rng.select();
+				}
+			}
+
+			self.editorManager.setActive(self);
+		},
+
+		/**
+		 * Executes a legacy callback. This method is useful to call old 2.x option callbacks.
+		 * There new event model is a better way to add callback so this method might be removed in the future.
+		 *
+		 * @method execCallback
+		 * @param {String} name Name of the callback to execute.
+		 * @return {Object} Return value passed from callback function.
+		 */
+		execCallback: function(name) {
+			var self = this, callback = self.settings[name], scope;
+
+			if (!callback) {
+				return;
+			}
+
+			// Look through lookup
+			if (self.callbackLookup && (scope = self.callbackLookup[name])) {
+				callback = scope.func;
+				scope = scope.scope;
+			}
+
+			if (typeof callback === 'string') {
+				scope = callback.replace(/\.\w+$/, '');
+				scope = scope ? resolve(scope) : 0;
+				callback = resolve(callback);
+				self.callbackLookup = self.callbackLookup || {};
+				self.callbackLookup[name] = {func: callback, scope: scope};
+			}
+
+			return callback.apply(scope || self, Array.prototype.slice.call(arguments, 1));
+		},
+
+		/**
+		 * Translates the specified string by replacing variables with language pack items it will also check if there is
+		 * a key mathcin the input.
+		 *
+		 * @method translate
+		 * @param {String} text String to translate by the language pack data.
+		 * @return {String} Translated string.
+		 */
+		translate: function(text) {
+			var lang = this.settings.language || 'en', i18n = this.editorManager.i18n;
+
+			if (!text) {
+				return '';
+			}
+
+			return i18n.data[lang + '.' + text] || text.replace(/\{\#([^\}]+)\}/g, function(a, b) {
+				return i18n.data[lang + '.' + b] || '{#' + b + '}';
+			});
+		},
+
+		/**
+		 * Returns a language pack item by name/key.
+		 *
+		 * @method getLang
+		 * @param {String} name Name/key to get from the language pack.
+		 * @param {String} defaultVal Optional default value to retrive.
+		 */
+		getLang: function(name, defaultVal) {
+			return (
+				this.editorManager.i18n.data[(this.settings.language || 'en') + '.' + name] ||
+				(defaultVal !== undefined ? defaultVal : '{#' + name + '}')
+			);
+		},
+
+		/**
+		 * Returns a configuration parameter by name.
+		 *
+		 * @method getParam
+		 * @param {String} name Configruation parameter to retrive.
+		 * @param {String} defaultVal Optional default value to return.
+		 * @param {String} type Optional type parameter.
+		 * @return {String} Configuration parameter value or default value.
+		 * @example
+		 * // Returns a specific config value from the currently active editor
+		 * var someval = tinymce.activeEditor.getParam('myvalue');
+		 *
+		 * // Returns a specific config value from a specific editor instance by id
+		 * var someval2 = tinymce.get('my_editor').getParam('myvalue');
+		 */
+		getParam: function(name, defaultVal, type) {
+			var value = name in this.settings ? this.settings[name] : defaultVal, output;
+
+			if (type === 'hash') {
+				output = {};
+
+				if (typeof value === 'string') {
+					each(value.indexOf('=') > 0 ? value.split(/[;,](?![^=;,]*(?:[;,]|$))/) : value.split(','), function(value) {
+						value = value.split('=');
+
+						if (value.length > 1) {
+							output[trim(value[0])] = trim(value[1]);
+						} else {
+							output[trim(value[0])] = trim(value);
+						}
+					});
+				} else {
+					output = value;
+				}
+
+				return output;
+			}
+
+			return value;
+		},
+
+		/**
+		 * Distpaches out a onNodeChange event to all observers. This method should be called when you
+		 * need to update the UI states or element path etc.
+		 *
+		 * @method nodeChanged
+		 * @param {Object} args Optional args to pass to NodeChange event handlers.
+		 */
+		nodeChanged: function(args) {
+			this._nodeChangeDispatcher.nodeChanged(args);
+		},
+
+		/**
+		 * Adds a button that later gets created by the theme in the editors toolbars.
+		 *
+		 * @method addButton
+		 * @param {String} name Button name to add.
+		 * @param {Object} settings Settings object with title, cmd etc.
+		 * @example
+		 * // Adds a custom button to the editor that inserts contents when clicked
+		 * tinymce.init({
+		 *    ...
+		 *
+		 *    toolbar: 'example'
+		 *
+		 *    setup: function(ed) {
+		 *       ed.addButton('example', {
+		 *          title: 'My title',
+		 *          image: '../js/tinymce/plugins/example/img/example.gif',
+		 *          onclick: function() {
+		 *             ed.insertContent('Hello world!!');
+		 *          }
+		 *       });
+		 *    }
+		 * });
+		 */
+		addButton: function(name, settings) {
+			var self = this;
+
+			if (settings.cmd) {
+				settings.onclick = function() {
+					self.execCommand(settings.cmd);
+				};
+			}
+
+			if (!settings.text && !settings.icon) {
+				settings.icon = name;
+			}
+
+			self.buttons = self.buttons || {};
+			settings.tooltip = settings.tooltip || settings.title;
+			self.buttons[name] = settings;
+		},
+
+		/**
+		 * Adds a menu item to be used in the menus of the theme. There might be multiple instances
+		 * of this menu item for example it might be used in the main menus of the theme but also in
+		 * the context menu so make sure that it's self contained and supports multiple instances.
+		 *
+		 * @method addMenuItem
+		 * @param {String} name Menu item name to add.
+		 * @param {Object} settings Settings object with title, cmd etc.
+		 * @example
+		 * // Adds a custom menu item to the editor that inserts contents when clicked
+		 * // The context option allows you to add the menu item to an existing default menu
+		 * tinymce.init({
+		 *    ...
+		 *
+		 *    setup: function(ed) {
+		 *       ed.addMenuItem('example', {
+		 *          text: 'My menu item',
+		 *          context: 'tools',
+		 *          onclick: function() {
+		 *             ed.insertContent('Hello world!!');
+		 *          }
+		 *       });
+		 *    }
+		 * });
+		 */
+		addMenuItem: function(name, settings) {
+			var self = this;
+
+			if (settings.cmd) {
+				settings.onclick = function() {
+					self.execCommand(settings.cmd);
+				};
+			}
+
+			self.menuItems = self.menuItems || {};
+			self.menuItems[name] = settings;
+		},
+
+		/**
+		 * Adds a custom command to the editor, you can also override existing commands with this method.
+		 * The command that you add can be executed with execCommand.
+		 *
+		 * @method addCommand
+		 * @param {String} name Command name to add/override.
+		 * @param {addCommandCallback} callback Function to execute when the command occurs.
+		 * @param {Object} scope Optional scope to execute the function in.
+		 * @example
+		 * // Adds a custom command that later can be executed using execCommand
+		 * tinymce.init({
+		 *    ...
+		 *
+		 *    setup: function(ed) {
+		 *       // Register example command
+		 *       ed.addCommand('mycommand', function(ui, v) {
+		 *          ed.windowManager.alert('Hello world!! Selection: ' + ed.selection.getContent({format: 'text'}));
+		 *       });
+		 *    }
+		 * });
+		 */
+		addCommand: function(name, callback, scope) {
+			/**
+			 * Callback function that gets called when a command is executed.
+			 *
+			 * @callback addCommandCallback
+			 * @param {Boolean} ui Display UI state true/false.
+			 * @param {Object} value Optional value for command.
+			 * @return {Boolean} True/false state if the command was handled or not.
+			 */
+			this.editorCommands.addCommand(name, callback, scope);
+		},
+
+		/**
+		 * Adds a custom query state command to the editor, you can also override existing commands with this method.
+		 * The command that you add can be executed with queryCommandState function.
+		 *
+		 * @method addQueryStateHandler
+		 * @param {String} name Command name to add/override.
+		 * @param {addQueryStateHandlerCallback} callback Function to execute when the command state retrival occurs.
+		 * @param {Object} scope Optional scope to execute the function in.
+		 */
+		addQueryStateHandler: function(name, callback, scope) {
+			/**
+			 * Callback function that gets called when a queryCommandState is executed.
+			 *
+			 * @callback addQueryStateHandlerCallback
+			 * @return {Boolean} True/false state if the command is enabled or not like is it bold.
+			 */
+			this.editorCommands.addQueryStateHandler(name, callback, scope);
+		},
+
+		/**
+		 * Adds a custom query value command to the editor, you can also override existing commands with this method.
+		 * The command that you add can be executed with queryCommandValue function.
+		 *
+		 * @method addQueryValueHandler
+		 * @param {String} name Command name to add/override.
+		 * @param {addQueryValueHandlerCallback} callback Function to execute when the command value retrival occurs.
+		 * @param {Object} scope Optional scope to execute the function in.
+		 */
+		addQueryValueHandler: function(name, callback, scope) {
+			/**
+			 * Callback function that gets called when a queryCommandValue is executed.
+			 *
+			 * @callback addQueryValueHandlerCallback
+			 * @return {Object} Value of the command or undefined.
+			 */
+			this.editorCommands.addQueryValueHandler(name, callback, scope);
+		},
+
+		/**
+		 * Adds a keyboard shortcut for some command or function.
+		 *
+		 * @method addShortcut
+		 * @param {String} pattern Shortcut pattern. Like for example: ctrl+alt+o.
+		 * @param {String} desc Text description for the command.
+		 * @param {String/Function} cmdFunc Command name string or function to execute when the key is pressed.
+		 * @param {Object} sc Optional scope to execute the function in.
+		 * @return {Boolean} true/false state if the shortcut was added or not.
+		 */
+		addShortcut: function(pattern, desc, cmdFunc, scope) {
+			this.shortcuts.add(pattern, desc, cmdFunc, scope);
+		},
+
+		/**
+		 * Executes a command on the current instance. These commands can be TinyMCE internal commands prefixed with "mce" or
+		 * they can be build in browser commands such as "Bold". A compleate list of browser commands is available on MSDN or Mozilla.org.
+		 * This function will dispatch the execCommand function on each plugin, theme or the execcommand_callback option if none of these
+		 * return true it will handle the command as a internal browser command.
+		 *
+		 * @method execCommand
+		 * @param {String} cmd Command name to execute, for example mceLink or Bold.
+		 * @param {Boolean} ui True/false state if a UI (dialog) should be presented or not.
+		 * @param {mixed} value Optional command value, this can be anything.
+		 * @param {Object} args Optional arguments object.
+		 */
+		execCommand: function(cmd, ui, value, args) {
+			return this.editorCommands.execCommand(cmd, ui, value, args);
+		},
+
+		/**
+		 * Returns a command specific state, for example if bold is enabled or not.
+		 *
+		 * @method queryCommandState
+		 * @param {string} cmd Command to query state from.
+		 * @return {Boolean} Command specific state, for example if bold is enabled or not.
+		 */
+		queryCommandState: function(cmd) {
+			return this.editorCommands.queryCommandState(cmd);
+		},
+
+		/**
+		 * Returns a command specific value, for example the current font size.
+		 *
+		 * @method queryCommandValue
+		 * @param {string} cmd Command to query value from.
+		 * @return {Object} Command specific value, for example the current font size.
+		 */
+		queryCommandValue: function(cmd) {
+			return this.editorCommands.queryCommandValue(cmd);
+		},
+
+		/**
+		 * Returns true/false if the command is supported or not.
+		 *
+		 * @method queryCommandSupported
+		 * @param {String} cmd Command that we check support for.
+		 * @return {Boolean} true/false if the command is supported or not.
+		 */
+		queryCommandSupported: function(cmd) {
+			return this.editorCommands.queryCommandSupported(cmd);
+		},
+
+		/**
+		 * Shows the editor and hides any textarea/div that the editor is supposed to replace.
+		 *
+		 * @method show
+		 */
+		show: function() {
+			var self = this;
+
+			if (self.hidden) {
+				self.hidden = false;
+
+				if (self.inline) {
+					self.getBody().contentEditable = true;
+				} else {
+					DOM.show(self.getContainer());
+					DOM.hide(self.id);
+				}
+
+				self.load();
+				self.fire('show');
+			}
+		},
+
+		/**
+		 * Hides the editor and shows any textarea/div that the editor is supposed to replace.
+		 *
+		 * @method hide
+		 */
+		hide: function() {
+			var self = this, doc = self.getDoc();
+
+			if (!self.hidden) {
+				// Fixed bug where IE has a blinking cursor left from the editor
+				if (ie && doc && !self.inline) {
+					doc.execCommand('SelectAll');
+				}
+
+				// We must save before we hide so Safari doesn't crash
+				self.save();
+
+				if (self.inline) {
+					self.getBody().contentEditable = false;
+
+					// Make sure the editor gets blurred
+					if (self == self.editorManager.focusedEditor) {
+						self.editorManager.focusedEditor = null;
+					}
+				} else {
+					DOM.hide(self.getContainer());
+					DOM.setStyle(self.id, 'display', self.orgDisplay);
+				}
+
+				self.hidden = true;
+				self.fire('hide');
+			}
+		},
+
+		/**
+		 * Returns true/false if the editor is hidden or not.
+		 *
+		 * @method isHidden
+		 * @return {Boolean} True/false if the editor is hidden or not.
+		 */
+		isHidden: function() {
+			return !!this.hidden;
+		},
+
+		/**
+		 * Sets the progress state, this will display a throbber/progess for the editor.
+		 * This is ideal for asycronous operations like an AJAX save call.
+		 *
+		 * @method setProgressState
+		 * @param {Boolean} state Boolean state if the progress should be shown or hidden.
+		 * @param {Number} time Optional time to wait before the progress gets shown.
+		 * @return {Boolean} Same as the input state.
+		 * @example
+		 * // Show progress for the active editor
+		 * tinymce.activeEditor.setProgressState(true);
+		 *
+		 * // Hide progress for the active editor
+		 * tinymce.activeEditor.setProgressState(false);
+		 *
+		 * // Show progress after 3 seconds
+		 * tinymce.activeEditor.setProgressState(true, 3000);
+		 */
+		setProgressState: function(state, time) {
+			this.fire('ProgressState', {state: state, time: time});
+		},
+
+		/**
+		 * Loads contents from the textarea or div element that got converted into an editor instance.
+		 * This method will move the contents from that textarea or div into the editor by using setContent
+		 * so all events etc that method has will get dispatched as well.
+		 *
+		 * @method load
+		 * @param {Object} args Optional content object, this gets passed around through the whole load process.
+		 * @return {String} HTML string that got set into the editor.
+		 */
+		load: function(args) {
+			var self = this, elm = self.getElement(), html;
+
+			if (elm) {
+				args = args || {};
+				args.load = true;
+
+				html = self.setContent(elm.value !== undefined ? elm.value : elm.innerHTML, args);
+				args.element = elm;
+
+				if (!args.no_events) {
+					self.fire('LoadContent', args);
+				}
+
+				args.element = elm = null;
+
+				return html;
+			}
+		},
+
+		/**
+		 * Saves the contents from a editor out to the textarea or div element that got converted into an editor instance.
+		 * This method will move the HTML contents from the editor into that textarea or div by getContent
+		 * so all events etc that method has will get dispatched as well.
+		 *
+		 * @method save
+		 * @param {Object} args Optional content object, this gets passed around through the whole save process.
+		 * @return {String} HTML string that got set into the textarea/div.
+		 */
+		save: function(args) {
+			var self = this, elm = self.getElement(), html, form;
+
+			if (!elm || !self.initialized) {
+				return;
+			}
+
+			args = args || {};
+			args.save = true;
+
+			args.element = elm;
+			html = args.content = self.getContent(args);
+
+			if (!args.no_events) {
+				self.fire('SaveContent', args);
+			}
+
+			html = args.content;
+
+			if (!/TEXTAREA|INPUT/i.test(elm.nodeName)) {
+				// Update DIV element when not in inline mode
+				if (!self.inline) {
+					elm.innerHTML = html;
+				}
+
+				// Update hidden form element
+				if ((form = DOM.getParent(self.id, 'form'))) {
+					each(form.elements, function(elm) {
+						if (elm.name == self.id) {
+							elm.value = html;
+							return false;
+						}
+					});
+				}
+			} else {
+				elm.value = html;
+			}
+
+			args.element = elm = null;
+
+			if (args.set_dirty !== false) {
+				self.isNotDirty = true;
+			}
+
+			return html;
+		},
+
+		/**
+		 * Sets the specified content to the editor instance, this will cleanup the content before it gets set using
+		 * the different cleanup rules options.
+		 *
+		 * @method setContent
+		 * @param {String} content Content to set to editor, normally HTML contents but can be other formats as well.
+		 * @param {Object} args Optional content object, this gets passed around through the whole set process.
+		 * @return {String} HTML string that got set into the editor.
+		 * @example
+		 * // Sets the HTML contents of the activeEditor editor
+		 * tinymce.activeEditor.setContent('<span>some</span> html');
+		 *
+		 * // Sets the raw contents of the activeEditor editor
+		 * tinymce.activeEditor.setContent('<span>some</span> html', {format: 'raw'});
+		 *
+		 * // Sets the content of a specific editor (my_editor in this example)
+		 * tinymce.get('my_editor').setContent(data);
+		 *
+		 * // Sets the bbcode contents of the activeEditor editor if the bbcode plugin was added
+		 * tinymce.activeEditor.setContent('[b]some[/b] html', {format: 'bbcode'});
+		 */
+		setContent: function(content, args) {
+			var self = this, body = self.getBody(), forcedRootBlockName;
+
+			// Setup args object
+			args = args || {};
+			args.format = args.format || 'html';
+			args.set = true;
+			args.content = content;
+
+			// Do preprocessing
+			if (!args.no_events) {
+				self.fire('BeforeSetContent', args);
+			}
+
+			content = args.content;
+
+			// Padd empty content in Gecko and Safari. Commands will otherwise fail on the content
+			// It will also be impossible to place the caret in the editor unless there is a BR element present
+			if (content.length === 0 || /^\s+$/.test(content)) {
+				forcedRootBlockName = self.settings.forced_root_block;
+
+				// Check if forcedRootBlock is configured and that the block is a valid child of the body
+				if (forcedRootBlockName && self.schema.isValidChild(body.nodeName.toLowerCase(), forcedRootBlockName.toLowerCase())) {
+					// Padd with bogus BR elements on modern browsers and IE 7 and 8 since they don't render empty P tags properly
+					content = ie && ie < 11 ? '' : '<br data-mce-bogus="1">';
+					content = self.dom.createHTML(forcedRootBlockName, self.settings.forced_root_block_attrs, content);
+				} else if (!ie) {
+					// We need to add a BR when forced_root_block is disabled on non IE browsers to place the caret
+					content = '<br data-mce-bogus="1">';
+				}
+
+				self.dom.setHTML(body, content);
+
+				self.fire('SetContent', args);
+			} else {
+				// Parse and serialize the html
+				if (args.format !== 'raw') {
+					content = new Serializer({}, self.schema).serialize(
+						self.parser.parse(content, {isRootContent: true})
+					);
+				}
+
+				// Set the new cleaned contents to the editor
+				args.content = trim(content);
+				self.dom.setHTML(body, args.content);
+
+				// Do post processing
+				if (!args.no_events) {
+					self.fire('SetContent', args);
+				}
+
+				// Don't normalize selection if the focused element isn't the body in
+				// content editable mode since it will steal focus otherwise
+				/*if (!self.settings.content_editable || document.activeElement === self.getBody()) {
+					self.selection.normalize();
+				}*/
+			}
+
+			return args.content;
+		},
+
+		/**
+		 * Gets the content from the editor instance, this will cleanup the content before it gets returned using
+		 * the different cleanup rules options.
+		 *
+		 * @method getContent
+		 * @param {Object} args Optional content object, this gets passed around through the whole get process.
+		 * @return {String} Cleaned content string, normally HTML contents.
+		 * @example
+		 * // Get the HTML contents of the currently active editor
+		 * console.debug(tinymce.activeEditor.getContent());
+		 *
+		 * // Get the raw contents of the currently active editor
+		 * tinymce.activeEditor.getContent({format: 'raw'});
+		 *
+		 * // Get content of a specific editor:
+		 * tinymce.get('content id').getContent()
+		 */
+		getContent: function(args) {
+			var self = this, content, body = self.getBody();
+
+			// Setup args object
+			args = args || {};
+			args.format = args.format || 'html';
+			args.get = true;
+			args.getInner = true;
+
+			// Do preprocessing
+			if (!args.no_events) {
+				self.fire('BeforeGetContent', args);
+			}
+
+			// Get raw contents or by default the cleaned contents
+			if (args.format == 'raw') {
+				content = body.innerHTML;
+			} else if (args.format == 'text') {
+				content = body.innerText || body.textContent;
+			} else {
+				content = self.serializer.serialize(body, args);
+			}
+
+			// Trim whitespace in beginning/end of HTML
+			if (args.format != 'text') {
+				args.content = trim(content);
+			} else {
+				args.content = content;
+			}
+
+			// Do post processing
+			if (!args.no_events) {
+				self.fire('GetContent', args);
+			}
+
+			return args.content;
+		},
+
+		/**
+		 * Inserts content at caret position.
+		 *
+		 * @method insertContent
+		 * @param {String} content Content to insert.
+		 * @param {Object} args Optional args to pass to insert call.
+		 */
+		insertContent: function(content, args) {
+			if (args) {
+				content = extend({content: content}, args);
+			}
+
+			this.execCommand('mceInsertContent', false, content);
+		},
+
+		/**
+		 * Returns true/false if the editor is dirty or not. It will get dirty if the user has made modifications to the contents.
+		 *
+		 * @method isDirty
+		 * @return {Boolean} True/false if the editor is dirty or not. It will get dirty if the user has made modifications to the contents.
+		 * @example
+		 * if (tinymce.activeEditor.isDirty())
+		 *     alert("You must save your contents.");
+		 */
+		isDirty: function() {
+			return !this.isNotDirty;
+		},
+
+		/**
+		 * Returns the editors container element. The container element wrappes in
+		 * all the elements added to the page for the editor. Such as UI, iframe etc.
+		 *
+		 * @method getContainer
+		 * @return {Element} HTML DOM element for the editor container.
+		 */
+		getContainer: function() {
+			var self = this;
+
+			if (!self.container) {
+				self.container = DOM.get(self.editorContainer || self.id + '_parent');
+			}
+
+			return self.container;
+		},
+
+		/**
+		 * Returns the editors content area container element. The this element is the one who
+		 * holds the iframe or the editable element.
+		 *
+		 * @method getContentAreaContainer
+		 * @return {Element} HTML DOM element for the editor area container.
+		 */
+		getContentAreaContainer: function() {
+			return this.contentAreaContainer;
+		},
+
+		/**
+		 * Returns the target element/textarea that got replaced with a TinyMCE editor instance.
+		 *
+		 * @method getElement
+		 * @return {Element} HTML DOM element for the replaced element.
+		 */
+		getElement: function() {
+			if (!this.targetElm) {
+				this.targetElm = DOM.get(this.id);
+			}
+
+			return this.targetElm;
+		},
+
+		/**
+		 * Returns the iframes window object.
+		 *
+		 * @method getWin
+		 * @return {Window} Iframe DOM window object.
+		 */
+		getWin: function() {
+			var self = this, elm;
+
+			if (!self.contentWindow) {
+				elm = self.iframeElement;
+
+				if (elm) {
+					self.contentWindow = elm.contentWindow;
+				}
+			}
+
+			return self.contentWindow;
+		},
+
+		/**
+		 * Returns the iframes document object.
+		 *
+		 * @method getDoc
+		 * @return {Document} Iframe DOM document object.
+		 */
+		getDoc: function() {
+			var self = this, win;
+
+			if (!self.contentDocument) {
+				win = self.getWin();
+
+				if (win) {
+					self.contentDocument = win.document;
+				}
+			}
+
+			return self.contentDocument;
+		},
+
+		/**
+		 * Returns the root element of the editable area.
+		 * For a non-inline iframe-based editor, returns the iframe's body element.
+		 *
+		 * @method getBody
+		 * @return {Element} The root element of the editable area.
+		 */
+		getBody: function() {
+			return this.bodyElement || this.getDoc().body;
+		},
+
+		/**
+		 * URL converter function this gets executed each time a user adds an img, a or
+		 * any other element that has a URL in it. This will be called both by the DOM and HTML
+		 * manipulation functions.
+		 *
+		 * @method convertURL
+		 * @param {string} url URL to convert.
+		 * @param {string} name Attribute name src, href etc.
+		 * @param {string/HTMLElement} elm Tag name or HTML DOM element depending on HTML or DOM insert.
+		 * @return {string} Converted URL string.
+		 */
+		convertURL: function(url, name, elm) {
+			var self = this, settings = self.settings;
+
+			// Use callback instead
+			if (settings.urlconverter_callback) {
+				return self.execCallback('urlconverter_callback', url, elm, true, name);
+			}
+
+			// Don't convert link href since thats the CSS files that gets loaded into the editor also skip local file URLs
+			if (!settings.convert_urls || (elm && elm.nodeName == 'LINK') || url.indexOf('file:') === 0 || url.length === 0) {
+				return url;
+			}
+
+			// Convert to relative
+			if (settings.relative_urls) {
+				return self.documentBaseURI.toRelative(url);
+			}
+
+			// Convert to absolute
+			url = self.documentBaseURI.toAbsolute(url, settings.remove_script_host);
+
+			return url;
+		},
+
+		/**
+		 * Adds visual aid for tables, anchors etc so they can be more easily edited inside the editor.
+		 *
+		 * @method addVisual
+		 * @param {Element} elm Optional root element to loop though to find tables etc that needs the visual aid.
+		 */
+		addVisual: function(elm) {
+			var self = this, settings = self.settings, dom = self.dom, cls;
+
+			elm = elm || self.getBody();
+
+			if (self.hasVisual === undefined) {
+				self.hasVisual = settings.visual;
+			}
+
+			each(dom.select('table,a', elm), function(elm) {
+				var value;
+
+				switch (elm.nodeName) {
+					case 'TABLE':
+						cls = settings.visual_table_class || 'mce-item-table';
+						value = dom.getAttrib(elm, 'border');
+
+						if ((!value || value == '0') && self.hasVisual) {
+							dom.addClass(elm, cls);
+						} else {
+							dom.removeClass(elm, cls);
+						}
+
+						return;
+
+					case 'A':
+						if (!dom.getAttrib(elm, 'href', false)) {
+							value = dom.getAttrib(elm, 'name') || elm.id;
+							cls = settings.visual_anchor_class || 'mce-item-anchor';
+
+							if (value && self.hasVisual) {
+								dom.addClass(elm, cls);
+							} else {
+								dom.removeClass(elm, cls);
+							}
+						}
+
+						return;
+				}
+			});
+
+			self.fire('VisualAid', {element: elm, hasVisual: self.hasVisual});
+		},
+
+		/**
+		 * Removes the editor from the dom and tinymce collection.
+		 *
+		 * @method remove
+		 */
+		remove: function() {
+			var self = this;
+
+			if (!self.removed) {
+				self.save();
+				self.removed = 1;
+				self.unbindAllNativeEvents();
+
+				// Remove any hidden input
+				if (self.hasHiddenInput) {
+					DOM.remove(self.getElement().nextSibling);
+				}
+
+				if (!self.inline) {
+					// IE 9 has a bug where the selection stops working if you place the
+					// caret inside the editor then remove the iframe
+					if (ie && ie < 10) {
+						self.getDoc().execCommand('SelectAll', false, null);
+					}
+
+					DOM.setStyle(self.id, 'display', self.orgDisplay);
+					self.getBody().onload = null; // Prevent #6816
+				}
+
+				self.fire('remove');
+
+				self.editorManager.remove(self);
+				DOM.remove(self.getContainer());
+				self.destroy();
+			}
+		},
+
+		/**
+		 * Destroys the editor instance by removing all events, element references or other resources
+		 * that could leak memory. This method will be called automatically when the page is unloaded
+		 * but you can also call it directly if you know what you are doing.
+		 *
+		 * @method destroy
+		 * @param {Boolean} automatic Optional state if the destroy is an automatic destroy or user called one.
+		 */
+		destroy: function(automatic) {
+			var self = this, form;
+
+			// One time is enough
+			if (self.destroyed) {
+				return;
+			}
+
+			// If user manually calls destroy and not remove
+			// Users seems to have logic that calls destroy instead of remove
+			if (!automatic && !self.removed) {
+				self.remove();
+				return;
+			}
+
+			if (!automatic) {
+				self.editorManager.off('beforeunload', self._beforeUnload);
+
+				// Manual destroy
+				if (self.theme && self.theme.destroy) {
+					self.theme.destroy();
+				}
+
+				// Destroy controls, selection and dom
+				self.selection.destroy();
+				self.dom.destroy();
+			}
+
+			form = self.formElement;
+			if (form) {
+				if (form._mceOldSubmit) {
+					form.submit = form._mceOldSubmit;
+					form._mceOldSubmit = null;
+				}
+
+				DOM.unbind(form, 'submit reset', self.formEventDelegate);
+			}
+
+			self.contentAreaContainer = self.formElement = self.container = self.editorContainer = null;
+			self.bodyElement = self.contentDocument = self.contentWindow = null;
+			self.iframeElement = self.targetElm = null;
+
+			if (self.selection) {
+				self.selection = self.selection.win = self.selection.dom = self.selection.dom.doc = null;
+			}
+
+			self.destroyed = 1;
+		},
+
+		// Internal functions
+
+		_refreshContentEditable: function() {
+			var self = this, body, parent;
+
+			// Check if the editor was hidden and the re-initalize contentEditable mode by removing and adding the body again
+			if (self._isHidden()) {
+				body = self.getBody();
+				parent = body.parentNode;
+
+				parent.removeChild(body);
+				parent.appendChild(body);
+
+				body.focus();
+			}
+		},
+
+		_isHidden: function() {
+			var sel;
+
+			if (!isGecko) {
+				return 0;
+			}
+
+			// Weird, wheres that cursor selection?
+			sel = this.selection.getSel();
+			return (!sel || !sel.rangeCount || sel.rangeCount === 0);
+		}
+	};
+
+	extend(Editor.prototype, EditorObservable);
+
+	return Editor;
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/EditorCommands.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,999 @@
+/**
+ * EditorCommands.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class enables you to add custom editor commands and it contains
+ * overrides for native browser commands to address various bugs and issues.
+ *
+ * @class tinymce.EditorCommands
+ */
+define("tinymce/EditorCommands", [
+	"tinymce/html/Serializer",
+	"tinymce/Env",
+	"tinymce/util/Tools",
+	"tinymce/dom/ElementUtils",
+	"tinymce/dom/RangeUtils",
+	"tinymce/dom/TreeWalker"
+], function(Serializer, Env, Tools, ElementUtils, RangeUtils, TreeWalker) {
+	// Added for compression purposes
+	var each = Tools.each, extend = Tools.extend;
+	var map = Tools.map, inArray = Tools.inArray, explode = Tools.explode;
+	var isGecko = Env.gecko, isIE = Env.ie, isOldIE = Env.ie && Env.ie < 11;
+	var TRUE = true, FALSE = false;
+
+	return function(editor) {
+		var dom, selection, formatter,
+			commands = {state: {}, exec: {}, value: {}},
+			settings = editor.settings,
+			bookmark;
+
+		editor.on('PreInit', function() {
+			dom = editor.dom;
+			selection = editor.selection;
+			settings = editor.settings;
+			formatter = editor.formatter;
+		});
+
+		/**
+		 * Executes the specified command.
+		 *
+		 * @method execCommand
+		 * @param {String} command Command to execute.
+		 * @param {Boolean} ui Optional user interface state.
+		 * @param {Object} value Optional value for command.
+		 * @return {Boolean} true/false if the command was found or not.
+		 */
+		function execCommand(command, ui, value, args) {
+			var func, customCommand, state = 0;
+
+			if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(command) && (!args || !args.skip_focus)) {
+				editor.focus();
+			}
+
+			args = extend({}, args);
+			args = editor.fire('BeforeExecCommand', {command: command, ui: ui, value: value});
+			if (args.isDefaultPrevented()) {
+				return false;
+			}
+
+			customCommand = command.toLowerCase();
+			if ((func = commands.exec[customCommand])) {
+				func(customCommand, ui, value);
+				editor.fire('ExecCommand', {command: command, ui: ui, value: value});
+				return true;
+			}
+
+			// Plugin commands
+			each(editor.plugins, function(p) {
+				if (p.execCommand && p.execCommand(command, ui, value)) {
+					editor.fire('ExecCommand', {command: command, ui: ui, value: value});
+					state = true;
+					return false;
+				}
+			});
+
+			if (state) {
+				return state;
+			}
+
+			// Theme commands
+			if (editor.theme && editor.theme.execCommand && editor.theme.execCommand(command, ui, value)) {
+				editor.fire('ExecCommand', {command: command, ui: ui, value: value});
+				return true;
+			}
+
+			// Browser commands
+			try {
+				state = editor.getDoc().execCommand(command, ui, value);
+			} catch (ex) {
+				// Ignore old IE errors
+			}
+
+			if (state) {
+				editor.fire('ExecCommand', {command: command, ui: ui, value: value});
+				return true;
+			}
+
+			return false;
+		}
+
+		/**
+		 * Queries the current state for a command for example if the current selection is "bold".
+		 *
+		 * @method queryCommandState
+		 * @param {String} command Command to check the state of.
+		 * @return {Boolean/Number} true/false if the selected contents is bold or not, -1 if it's not found.
+		 */
+		function queryCommandState(command) {
+			var func;
+
+			// Is hidden then return undefined
+			if (editor._isHidden()) {
+				return;
+			}
+
+			command = command.toLowerCase();
+			if ((func = commands.state[command])) {
+				return func(command);
+			}
+
+			// Browser commands
+			try {
+				return editor.getDoc().queryCommandState(command);
+			} catch (ex) {
+				// Fails sometimes see bug: 1896577
+			}
+
+			return false;
+		}
+
+		/**
+		 * Queries the command value for example the current fontsize.
+		 *
+		 * @method queryCommandValue
+		 * @param {String} command Command to check the value of.
+		 * @return {Object} Command value of false if it's not found.
+		 */
+		function queryCommandValue(command) {
+			var func;
+
+			// Is hidden then return undefined
+			if (editor._isHidden()) {
+				return;
+			}
+
+			command = command.toLowerCase();
+			if ((func = commands.value[command])) {
+				return func(command);
+			}
+
+			// Browser commands
+			try {
+				return editor.getDoc().queryCommandValue(command);
+			} catch (ex) {
+				// Fails sometimes see bug: 1896577
+			}
+		}
+
+		/**
+		 * Adds commands to the command collection.
+		 *
+		 * @method addCommands
+		 * @param {Object} command_list Name/value collection with commands to add, the names can also be comma separated.
+		 * @param {String} type Optional type to add, defaults to exec. Can be value or state as well.
+		 */
+		function addCommands(command_list, type) {
+			type = type || 'exec';
+
+			each(command_list, function(callback, command) {
+				each(command.toLowerCase().split(','), function(command) {
+					commands[type][command] = callback;
+				});
+			});
+		}
+
+		function addCommand(command, callback, scope) {
+			command = command.toLowerCase();
+			commands.exec[command] = function(command, ui, value, args) {
+				return callback.call(scope || editor, ui, value, args);
+			};
+		}
+
+		/**
+		 * Returns true/false if the command is supported or not.
+		 *
+		 * @method queryCommandSupported
+		 * @param {String} cmd Command that we check support for.
+		 * @return {Boolean} true/false if the command is supported or not.
+		 */
+		function queryCommandSupported(command) {
+			command = command.toLowerCase();
+
+			if (commands.exec[command]) {
+				return true;
+			}
+
+			// Browser commands
+			try {
+				return editor.getDoc().queryCommandSupported(command);
+			} catch (ex) {
+				// Fails sometimes see bug: 1896577
+			}
+
+			return false;
+		}
+
+		function addQueryStateHandler(command, callback, scope) {
+			command = command.toLowerCase();
+			commands.state[command] = function() {
+				return callback.call(scope || editor);
+			};
+		}
+
+		function addQueryValueHandler(command, callback, scope) {
+			command = command.toLowerCase();
+			commands.value[command] = function() {
+				return callback.call(scope || editor);
+			};
+		}
+
+		function hasCustomCommand(command) {
+			command = command.toLowerCase();
+			return !!commands.exec[command];
+		}
+
+		// Expose public methods
+		extend(this, {
+			execCommand: execCommand,
+			queryCommandState: queryCommandState,
+			queryCommandValue: queryCommandValue,
+			queryCommandSupported: queryCommandSupported,
+			addCommands: addCommands,
+			addCommand: addCommand,
+			addQueryStateHandler: addQueryStateHandler,
+			addQueryValueHandler: addQueryValueHandler,
+			hasCustomCommand: hasCustomCommand
+		});
+
+		// Private methods
+
+		function execNativeCommand(command, ui, value) {
+			if (ui === undefined) {
+				ui = FALSE;
+			}
+
+			if (value === undefined) {
+				value = null;
+			}
+
+			return editor.getDoc().execCommand(command, ui, value);
+		}
+
+		function isFormatMatch(name) {
+			return formatter.match(name);
+		}
+
+		function toggleFormat(name, value) {
+			formatter.toggle(name, value ? {value: value} : undefined);
+			editor.nodeChanged();
+		}
+
+		function storeSelection(type) {
+			bookmark = selection.getBookmark(type);
+		}
+
+		function restoreSelection() {
+			selection.moveToBookmark(bookmark);
+		}
+
+		// Add execCommand overrides
+		addCommands({
+			// Ignore these, added for compatibility
+			'mceResetDesignMode,mceBeginUndoLevel': function() {},
+
+			// Add undo manager logic
+			'mceEndUndoLevel,mceAddUndoLevel': function() {
+				editor.undoManager.add();
+			},
+
+			'Cut,Copy,Paste': function(command) {
+				var doc = editor.getDoc(), failed;
+
+				// Try executing the native command
+				try {
+					execNativeCommand(command);
+				} catch (ex) {
+					// Command failed
+					failed = TRUE;
+				}
+
+				// Present alert message about clipboard access not being available
+				if (failed || !doc.queryCommandSupported(command)) {
+					var msg = editor.translate(
+						"Your browser doesn't support direct access to the clipboard. " +
+						"Please use the Ctrl+X/C/V keyboard shortcuts instead."
+					);
+
+					if (Env.mac) {
+						msg = msg.replace(/Ctrl\+/g, '\u2318+');
+					}
+
+					editor.windowManager.alert(msg);
+				}
+			},
+
+			// Override unlink command
+			unlink: function() {
+				if (selection.isCollapsed()) {
+					var elm = selection.getNode();
+					if (elm.tagName == 'A') {
+						editor.dom.remove(elm, true);
+					}
+
+					return;
+				}
+
+				formatter.remove("link");
+			},
+
+			// Override justify commands to use the text formatter engine
+			'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull': function(command) {
+				var align = command.substring(7);
+
+				if (align == 'full') {
+					align = 'justify';
+				}
+
+				// Remove all other alignments first
+				each('left,center,right,justify'.split(','), function(name) {
+					if (align != name) {
+						formatter.remove('align' + name);
+					}
+				});
+
+				toggleFormat('align' + align);
+				execCommand('mceRepaint');
+			},
+
+			// Override list commands to fix WebKit bug
+			'InsertUnorderedList,InsertOrderedList': function(command) {
+				var listElm, listParent;
+
+				execNativeCommand(command);
+
+				// WebKit produces lists within block elements so we need to split them
+				// we will replace the native list creation logic to custom logic later on
+				// TODO: Remove this when the list creation logic is removed
+				listElm = dom.getParent(selection.getNode(), 'ol,ul');
+				if (listElm) {
+					listParent = listElm.parentNode;
+
+					// If list is within a text block then split that block
+					if (/^(H[1-6]|P|ADDRESS|PRE)$/.test(listParent.nodeName)) {
+						storeSelection();
+						dom.split(listParent, listElm);
+						restoreSelection();
+					}
+				}
+			},
+
+			// Override commands to use the text formatter engine
+			'Bold,Italic,Underline,Strikethrough,Superscript,Subscript': function(command) {
+				toggleFormat(command);
+			},
+
+			// Override commands to use the text formatter engine
+			'ForeColor,HiliteColor,FontName': function(command, ui, value) {
+				toggleFormat(command, value);
+			},
+
+			FontSize: function(command, ui, value) {
+				var fontClasses, fontSizes;
+
+				// Convert font size 1-7 to styles
+				if (value >= 1 && value <= 7) {
+					fontSizes = explode(settings.font_size_style_values);
+					fontClasses = explode(settings.font_size_classes);
+
+					if (fontClasses) {
+						value = fontClasses[value - 1] || value;
+					} else {
+						value = fontSizes[value - 1] || value;
+					}
+				}
+
+				toggleFormat(command, value);
+			},
+
+			RemoveFormat: function(command) {
+				formatter.remove(command);
+			},
+
+			mceBlockQuote: function() {
+				toggleFormat('blockquote');
+			},
+
+			FormatBlock: function(command, ui, value) {
+				return toggleFormat(value || 'p');
+			},
+
+			mceCleanup: function() {
+				var bookmark = selection.getBookmark();
+
+				editor.setContent(editor.getContent({cleanup: TRUE}), {cleanup: TRUE});
+
+				selection.moveToBookmark(bookmark);
+			},
+
+			mceRemoveNode: function(command, ui, value) {
+				var node = value || selection.getNode();
+
+				// Make sure that the body node isn't removed
+				if (node != editor.getBody()) {
+					storeSelection();
+					editor.dom.remove(node, TRUE);
+					restoreSelection();
+				}
+			},
+
+			mceSelectNodeDepth: function(command, ui, value) {
+				var counter = 0;
+
+				dom.getParent(selection.getNode(), function(node) {
+					if (node.nodeType == 1 && counter++ == value) {
+						selection.select(node);
+						return FALSE;
+					}
+				}, editor.getBody());
+			},
+
+			mceSelectNode: function(command, ui, value) {
+				selection.select(value);
+			},
+
+			mceInsertContent: function(command, ui, value) {
+				var parser, serializer, parentNode, rootNode, fragment, args;
+				var marker, rng, node, node2, bookmarkHtml, merge;
+				var textInlineElements = editor.schema.getTextInlineElements();
+
+				function trimOrPaddLeftRight(html) {
+					var rng, container, offset;
+
+					rng = selection.getRng(true);
+					container = rng.startContainer;
+					offset = rng.startOffset;
+
+					function hasSiblingText(siblingName) {
+						return container[siblingName] && container[siblingName].nodeType == 3;
+					}
+
+					if (container.nodeType == 3) {
+						if (offset > 0) {
+							html = html.replace(/^&nbsp;/, ' ');
+						} else if (!hasSiblingText('previousSibling')) {
+							html = html.replace(/^ /, '&nbsp;');
+						}
+
+						if (offset < container.length) {
+							html = html.replace(/&nbsp;(<br>|)$/, ' ');
+						} else if (!hasSiblingText('nextSibling')) {
+							html = html.replace(/(&nbsp;| )(<br>|)$/, '&nbsp;');
+						}
+					}
+
+					return html;
+				}
+
+				// Removes &nbsp; from a [b] c -> a &nbsp;c -> a c
+				function trimNbspAfterDeleteAndPaddValue() {
+					var rng, container, offset;
+
+					rng = selection.getRng(true);
+					container = rng.startContainer;
+					offset = rng.startOffset;
+
+					if (container.nodeType == 3 && rng.collapsed) {
+						if (container.data[offset] === '\u00a0') {
+							container.deleteData(offset, 1);
+
+							if (!/[\u00a0| ]$/.test(value)) {
+								value += ' ';
+							}
+						} else if (container.data[offset - 1] === '\u00a0') {
+							container.deleteData(offset - 1, 1);
+
+							if (!/[\u00a0| ]$/.test(value)) {
+								value = ' ' + value;
+							}
+						}
+					}
+				}
+
+				function markInlineFormatElements(fragment) {
+					if (merge) {
+						for (node = fragment.firstChild; node; node = node.walk(true)) {
+							if (textInlineElements[node.name]) {
+								node.attr('data-mce-new', "true");
+							}
+						}
+					}
+				}
+
+				function reduceInlineTextElements() {
+					if (merge) {
+						var root = editor.getBody(), elementUtils = new ElementUtils(dom);
+
+						each(dom.select('*[data-mce-new]'), function(node) {
+							node.removeAttribute('data-mce-new');
+
+							for (var testNode = node.parentNode; testNode && testNode != root; testNode = testNode.parentNode) {
+								if (elementUtils.compare(testNode, node)) {
+									dom.remove(node, true);
+								}
+							}
+						});
+					}
+				}
+
+				if (typeof value != 'string') {
+					merge = value.merge;
+					value = value.content;
+				}
+
+				// Check for whitespace before/after value
+				if (/^ | $/.test(value)) {
+					value = trimOrPaddLeftRight(value);
+				}
+
+				// Setup parser and serializer
+				parser = editor.parser;
+				serializer = new Serializer({}, editor.schema);
+				bookmarkHtml = '<span id="mce_marker" data-mce-type="bookmark">&#xFEFF;&#x200B;</span>';
+
+				// Run beforeSetContent handlers on the HTML to be inserted
+				args = {content: value, format: 'html', selection: true};
+				editor.fire('BeforeSetContent', args);
+				value = args.content;
+
+				// Add caret at end of contents if it's missing
+				if (value.indexOf('{$caret}') == -1) {
+					value += '{$caret}';
+				}
+
+				// Replace the caret marker with a span bookmark element
+				value = value.replace(/\{\$caret\}/, bookmarkHtml);
+
+				// If selection is at <body>|<p></p> then move it into <body><p>|</p>
+				rng = selection.getRng();
+				var caretElement = rng.startContainer || (rng.parentElement ? rng.parentElement() : null);
+				var body = editor.getBody();
+				if (caretElement === body && selection.isCollapsed()) {
+					if (dom.isBlock(body.firstChild) && dom.isEmpty(body.firstChild)) {
+						rng = dom.createRng();
+						rng.setStart(body.firstChild, 0);
+						rng.setEnd(body.firstChild, 0);
+						selection.setRng(rng);
+					}
+				}
+
+				// Insert node maker where we will insert the new HTML and get it's parent
+				if (!selection.isCollapsed()) {
+					editor.getDoc().execCommand('Delete', false, null);
+					trimNbspAfterDeleteAndPaddValue();
+				}
+
+				parentNode = selection.getNode();
+
+				// Parse the fragment within the context of the parent node
+				var parserArgs = {context: parentNode.nodeName.toLowerCase()};
+				fragment = parser.parse(value, parserArgs);
+
+				markInlineFormatElements(fragment);
+
+				// Move the caret to a more suitable location
+				node = fragment.lastChild;
+				if (node.attr('id') == 'mce_marker') {
+					marker = node;
+
+					for (node = node.prev; node; node = node.walk(true)) {
+						if (node.type == 3 || !dom.isBlock(node.name)) {
+							if (editor.schema.isValidChild(node.parent.name, 'span')) {
+								node.parent.insert(marker, node, node.name === 'br');
+							}
+							break;
+						}
+					}
+				}
+
+				// If parser says valid we can insert the contents into that parent
+				if (!parserArgs.invalid) {
+					value = serializer.serialize(fragment);
+
+					// Check if parent is empty or only has one BR element then set the innerHTML of that parent
+					node = parentNode.firstChild;
+					node2 = parentNode.lastChild;
+					if (!node || (node === node2 && node.nodeName === 'BR')) {
+						dom.setHTML(parentNode, value);
+					} else {
+						selection.setContent(value);
+					}
+				} else {
+					// If the fragment was invalid within that context then we need
+					// to parse and process the parent it's inserted into
+
+					// Insert bookmark node and get the parent
+					selection.setContent(bookmarkHtml);
+					parentNode = selection.getNode();
+					rootNode = editor.getBody();
+
+					// Opera will return the document node when selection is in root
+					if (parentNode.nodeType == 9) {
+						parentNode = node = rootNode;
+					} else {
+						node = parentNode;
+					}
+
+					// Find the ancestor just before the root element
+					while (node !== rootNode) {
+						parentNode = node;
+						node = node.parentNode;
+					}
+
+					// Get the outer/inner HTML depending on if we are in the root and parser and serialize that
+					value = parentNode == rootNode ? rootNode.innerHTML : dom.getOuterHTML(parentNode);
+					value = serializer.serialize(
+						parser.parse(
+							// Need to replace by using a function since $ in the contents would otherwise be a problem
+							value.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i, function() {
+								return serializer.serialize(fragment);
+							})
+						)
+					);
+
+					// Set the inner/outer HTML depending on if we are in the root or not
+					if (parentNode == rootNode) {
+						dom.setHTML(rootNode, value);
+					} else {
+						dom.setOuterHTML(parentNode, value);
+					}
+				}
+
+				reduceInlineTextElements();
+
+				marker = dom.get('mce_marker');
+				selection.scrollIntoView(marker);
+
+				// Move selection before marker and remove it
+				rng = dom.createRng();
+
+				// If previous sibling is a text node set the selection to the end of that node
+				node = marker.previousSibling;
+				if (node && node.nodeType == 3) {
+					rng.setStart(node, node.nodeValue.length);
+
+					// TODO: Why can't we normalize on IE
+					if (!isIE) {
+						node2 = marker.nextSibling;
+						if (node2 && node2.nodeType == 3) {
+							node.appendData(node2.data);
+							node2.parentNode.removeChild(node2);
+						}
+					}
+				} else {
+					// If the previous sibling isn't a text node or doesn't exist set the selection before the marker node
+					rng.setStartBefore(marker);
+					rng.setEndBefore(marker);
+				}
+
+				// Remove the marker node and set the new range
+				dom.remove(marker);
+				selection.setRng(rng);
+
+				// Dispatch after event and add any visual elements needed
+				editor.fire('SetContent', args);
+				editor.addVisual();
+			},
+
+			mceInsertRawHTML: function(command, ui, value) {
+				selection.setContent('tiny_mce_marker');
+				editor.setContent(
+					editor.getContent().replace(/tiny_mce_marker/g, function() {
+						return value;
+					})
+				);
+			},
+
+			mceToggleFormat: function(command, ui, value) {
+				toggleFormat(value);
+			},
+
+			mceSetContent: function(command, ui, value) {
+				editor.setContent(value);
+			},
+
+			'Indent,Outdent': function(command) {
+				var intentValue, indentUnit, value;
+
+				// Setup indent level
+				intentValue = settings.indentation;
+				indentUnit = /[a-z%]+$/i.exec(intentValue);
+				intentValue = parseInt(intentValue, 10);
+
+				if (!queryCommandState('InsertUnorderedList') && !queryCommandState('InsertOrderedList')) {
+					// If forced_root_blocks is set to false we don't have a block to indent so lets create a div
+					if (!settings.forced_root_block && !dom.getParent(selection.getNode(), dom.isBlock)) {
+						formatter.apply('div');
+					}
+
+					each(selection.getSelectedBlocks(), function(element) {
+						if (element.nodeName != "LI") {
+							var indentStyleName = editor.getParam('indent_use_margin', false) ? 'margin' : 'padding';
+
+							indentStyleName += dom.getStyle(element, 'direction', true) == 'rtl' ? 'Right' : 'Left';
+
+							if (command == 'outdent') {
+								value = Math.max(0, parseInt(element.style[indentStyleName] || 0, 10) - intentValue);
+								dom.setStyle(element, indentStyleName, value ? value + indentUnit : '');
+							} else {
+								value = (parseInt(element.style[indentStyleName] || 0, 10) + intentValue) + indentUnit;
+								dom.setStyle(element, indentStyleName, value);
+							}
+						}
+					});
+				} else {
+					execNativeCommand(command);
+				}
+			},
+
+			mceRepaint: function() {
+				if (isGecko) {
+					try {
+						storeSelection(TRUE);
+
+						if (selection.getSel()) {
+							selection.getSel().selectAllChildren(editor.getBody());
+						}
+
+						selection.collapse(TRUE);
+						restoreSelection();
+					} catch (ex) {
+						// Ignore
+					}
+				}
+			},
+
+			InsertHorizontalRule: function() {
+				editor.execCommand('mceInsertContent', false, '<hr />');
+			},
+
+			mceToggleVisualAid: function() {
+				editor.hasVisual = !editor.hasVisual;
+				editor.addVisual();
+			},
+
+			mceReplaceContent: function(command, ui, value) {
+				editor.execCommand('mceInsertContent', false, value.replace(/\{\$selection\}/g, selection.getContent({format: 'text'})));
+			},
+
+			mceInsertLink: function(command, ui, value) {
+				var anchor;
+
+				if (typeof value == 'string') {
+					value = {href: value};
+				}
+
+				anchor = dom.getParent(selection.getNode(), 'a');
+
+				// Spaces are never valid in URLs and it's a very common mistake for people to make so we fix it here.
+				value.href = value.href.replace(' ', '%20');
+
+				// Remove existing links if there could be child links or that the href isn't specified
+				if (!anchor || !value.href) {
+					formatter.remove('link');
+				}
+
+				// Apply new link to selection
+				if (value.href) {
+					formatter.apply('link', value, anchor);
+				}
+			},
+
+			selectAll: function() {
+				var root = dom.getRoot(), rng;
+
+				if (selection.getRng().setStart) {
+					rng = dom.createRng();
+					rng.setStart(root, 0);
+					rng.setEnd(root, root.childNodes.length);
+					selection.setRng(rng);
+				} else {
+					// IE will render it's own root level block elements and sometimes
+					// even put font elements in them when the user starts typing. So we need to
+					// move the selection to a more suitable element from this:
+					// <body>|<p></p></body> to this: <body><p>|</p></body>
+					rng = selection.getRng();
+					if (!rng.item) {
+						rng.moveToElementText(root);
+						rng.select();
+					}
+				}
+			},
+
+			"delete": function() {
+				execNativeCommand("Delete");
+
+				// Check if body is empty after the delete call if so then set the contents
+				// to an empty string and move the caret to any block produced by that operation
+				// this fixes the issue with root blocks not being properly produced after a delete call on IE
+				var body = editor.getBody();
+
+				if (dom.isEmpty(body)) {
+					editor.setContent('');
+
+					if (body.firstChild && dom.isBlock(body.firstChild)) {
+						editor.selection.setCursorLocation(body.firstChild, 0);
+					} else {
+						editor.selection.setCursorLocation(body, 0);
+					}
+				}
+			},
+
+			mceNewDocument: function() {
+				editor.setContent('');
+			},
+
+			InsertLineBreak: function(command, ui, value) {
+				// We load the current event in from EnterKey.js when appropriate to heed
+				// certain event-specific variations such as ctrl-enter in a list
+				var evt = value;
+				var brElm, extraBr, marker;
+				var rng = selection.getRng(true);
+				new RangeUtils(dom).normalize(rng);
+
+				var offset = rng.startOffset;
+				var container = rng.startContainer;
+
+				// Resolve node index
+				if (container.nodeType == 1 && container.hasChildNodes()) {
+					var isAfterLastNodeInContainer = offset > container.childNodes.length - 1;
+
+					container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container;
+					if (isAfterLastNodeInContainer && container.nodeType == 3) {
+						offset = container.nodeValue.length;
+					} else {
+						offset = 0;
+					}
+				}
+
+				var parentBlock = dom.getParent(container, dom.isBlock);
+				var parentBlockName = parentBlock ? parentBlock.nodeName.toUpperCase() : ''; // IE < 9 & HTML5
+				var containerBlock = parentBlock ? dom.getParent(parentBlock.parentNode, dom.isBlock) : null;
+				var containerBlockName = containerBlock ? containerBlock.nodeName.toUpperCase() : ''; // IE < 9 & HTML5
+
+				// Enter inside block contained within a LI then split or insert before/after LI
+				var isControlKey = evt && evt.ctrlKey;
+				if (containerBlockName == 'LI' && !isControlKey) {
+					parentBlock = containerBlock;
+					parentBlockName = containerBlockName;
+				}
+
+				// Walks the parent block to the right and look for BR elements
+				function hasRightSideContent() {
+					var walker = new TreeWalker(container, parentBlock), node;
+					var nonEmptyElementsMap = editor.schema.getNonEmptyElements();
+
+					while ((node = walker.next())) {
+						if (nonEmptyElementsMap[node.nodeName.toLowerCase()] || node.length > 0) {
+							return true;
+						}
+					}
+				}
+
+				if (container && container.nodeType == 3 && offset >= container.nodeValue.length) {
+					// Insert extra BR element at the end block elements
+					if (!isOldIE && !hasRightSideContent()) {
+						brElm = dom.create('br');
+						rng.insertNode(brElm);
+						rng.setStartAfter(brElm);
+						rng.setEndAfter(brElm);
+						extraBr = true;
+					}
+				}
+
+				brElm = dom.create('br');
+				rng.insertNode(brElm);
+
+				// Rendering modes below IE8 doesn't display BR elements in PRE unless we have a \n before it
+				var documentMode = dom.doc.documentMode;
+				if (isOldIE && parentBlockName == 'PRE' && (!documentMode || documentMode < 8)) {
+					brElm.parentNode.insertBefore(dom.doc.createTextNode('\r'), brElm);
+				}
+
+				// Insert temp marker and scroll to that
+				marker = dom.create('span', {}, '&nbsp;');
+				brElm.parentNode.insertBefore(marker, brElm);
+				selection.scrollIntoView(marker);
+				dom.remove(marker);
+
+				if (!extraBr) {
+					rng.setStartAfter(brElm);
+					rng.setEndAfter(brElm);
+				} else {
+					rng.setStartBefore(brElm);
+					rng.setEndBefore(brElm);
+				}
+
+				selection.setRng(rng);
+				editor.undoManager.add();
+
+				return TRUE;
+			}
+		});
+
+		// Add queryCommandState overrides
+		addCommands({
+			// Override justify commands
+			'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull': function(command) {
+				var name = 'align' + command.substring(7);
+				var nodes = selection.isCollapsed() ? [dom.getParent(selection.getNode(), dom.isBlock)] : selection.getSelectedBlocks();
+				var matches = map(nodes, function(node) {
+					return !!formatter.matchNode(node, name);
+				});
+				return inArray(matches, TRUE) !== -1;
+			},
+
+			'Bold,Italic,Underline,Strikethrough,Superscript,Subscript': function(command) {
+				return isFormatMatch(command);
+			},
+
+			mceBlockQuote: function() {
+				return isFormatMatch('blockquote');
+			},
+
+			Outdent: function() {
+				var node;
+
+				if (settings.inline_styles) {
+					if ((node = dom.getParent(selection.getStart(), dom.isBlock)) && parseInt(node.style.paddingLeft, 10) > 0) {
+						return TRUE;
+					}
+
+					if ((node = dom.getParent(selection.getEnd(), dom.isBlock)) && parseInt(node.style.paddingLeft, 10) > 0) {
+						return TRUE;
+					}
+				}
+
+				return (
+					queryCommandState('InsertUnorderedList') ||
+					queryCommandState('InsertOrderedList') ||
+					(!settings.inline_styles && !!dom.getParent(selection.getNode(), 'BLOCKQUOTE'))
+				);
+			},
+
+			'InsertUnorderedList,InsertOrderedList': function(command) {
+				var list = dom.getParent(selection.getNode(), 'ul,ol');
+
+				return list &&
+					(
+						command === 'insertunorderedlist' && list.tagName === 'UL' ||
+						command === 'insertorderedlist' && list.tagName === 'OL'
+					);
+			}
+		}, 'state');
+
+		// Add queryCommandValue overrides
+		addCommands({
+			'FontSize,FontName': function(command) {
+				var value = 0, parent;
+
+				if ((parent = dom.getParent(selection.getNode(), 'span'))) {
+					if (command == 'fontsize') {
+						value = parent.style.fontSize;
+					} else {
+						value = parent.style.fontFamily.replace(/, /g, ',').replace(/[\'\"]/g, '').toLowerCase();
+					}
+				}
+
+				return value;
+			}
+		}, 'value');
+
+		// Add undo manager logic
+		addCommands({
+			Undo: function() {
+				editor.undoManager.undo();
+			},
+
+			Redo: function() {
+				editor.undoManager.redo();
+			}
+		});
+	};
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/EditorManager.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,654 @@
+/**
+ * EditorManager.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class used as a factory for manager for tinymce.Editor instances.
+ *
+ * @example
+ * tinymce.EditorManager.init({});
+ *
+ * @class tinymce.EditorManager
+ * @mixes tinymce.util.Observable
+ * @static
+ */
+define("tinymce/EditorManager", [
+	"tinymce/Editor",
+	"tinymce/dom/DomQuery",
+	"tinymce/dom/DOMUtils",
+	"tinymce/util/URI",
+	"tinymce/Env",
+	"tinymce/util/Tools",
+	"tinymce/util/Observable",
+	"tinymce/util/I18n",
+	"tinymce/FocusManager"
+], function(Editor, DomQuery, DOMUtils, URI, Env, Tools, Observable, I18n, FocusManager) {
+	var DOM = DOMUtils.DOM;
+	var explode = Tools.explode, each = Tools.each, extend = Tools.extend;
+	var instanceCounter = 0, beforeUnloadDelegate, EditorManager;
+
+	function removeEditorFromList(editor) {
+		var editors = EditorManager.editors, removedFromList;
+
+		delete editors[editor.id];
+
+		for (var i = 0; i < editors.length; i++) {
+			if (editors[i] == editor) {
+				editors.splice(i, 1);
+				removedFromList = true;
+				break;
+			}
+		}
+
+		// Select another editor since the active one was removed
+		if (EditorManager.activeEditor == editor) {
+			EditorManager.activeEditor = editors[0];
+		}
+
+		// Clear focusedEditor if necessary, so that we don't try to blur the destroyed editor
+		if (EditorManager.focusedEditor == editor) {
+			EditorManager.focusedEditor = null;
+		}
+
+		return removedFromList;
+	}
+
+	function purgeDestroyedEditor(editor) {
+		// User has manually destroyed the editor lets clean up the mess
+		if (editor && !(editor.getContainer() || editor.getBody()).parentNode) {
+			removeEditorFromList(editor);
+			editor.unbindAllNativeEvents();
+			editor.destroy(true);
+			editor = null;
+		}
+
+		return editor;
+	}
+
+	EditorManager = {
+		/**
+		 * Dom query instance.
+		 *
+		 * @property $
+		 * @type tinymce.dom.DomQuery
+		 */
+		$: DomQuery,
+
+		/**
+		 * Major version of TinyMCE build.
+		 *
+		 * @property majorVersion
+		 * @type String
+		 */
+		majorVersion: '@@majorVersion@@',
+
+		/**
+		 * Minor version of TinyMCE build.
+		 *
+		 * @property minorVersion
+		 * @type String
+		 */
+		minorVersion: '@@minorVersion@@',
+
+		/**
+		 * Release date of TinyMCE build.
+		 *
+		 * @property releaseDate
+		 * @type String
+		 */
+		releaseDate: '@@releaseDate@@',
+
+		/**
+		 * Collection of editor instances.
+		 *
+		 * @property editors
+		 * @type Object
+		 * @example
+		 * for (edId in tinymce.editors)
+		 *     tinymce.editors[edId].save();
+		 */
+		editors: [],
+
+		/**
+		 * Collection of language pack data.
+		 *
+		 * @property i18n
+		 * @type Object
+		 */
+		i18n: I18n,
+
+		/**
+		 * Currently active editor instance.
+		 *
+		 * @property activeEditor
+		 * @type tinymce.Editor
+		 * @example
+		 * tinyMCE.activeEditor.selection.getContent();
+		 * tinymce.EditorManager.activeEditor.selection.getContent();
+		 */
+		activeEditor: null,
+
+		setup: function() {
+			var self = this, baseURL, documentBaseURL, suffix = "", preInit, src;
+
+			// Get base URL for the current document
+			documentBaseURL = document.location.href;
+
+			// Check if the URL is a document based format like: http://site/dir/file and file:///
+			// leave other formats like applewebdata://... intact
+			if (/^[^:]+:\/\/\/?[^\/]+\//.test(documentBaseURL)) {
+				documentBaseURL = documentBaseURL.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, '');
+
+				if (!/[\/\\]$/.test(documentBaseURL)) {
+					documentBaseURL += '/';
+				}
+			}
+
+			// If tinymce is defined and has a base use that or use the old tinyMCEPreInit
+			preInit = window.tinymce || window.tinyMCEPreInit;
+			if (preInit) {
+				baseURL = preInit.base || preInit.baseURL;
+				suffix = preInit.suffix;
+			} else {
+				// Get base where the tinymce script is located
+				var scripts = document.getElementsByTagName('script');
+				for (var i = 0; i < scripts.length; i++) {
+					src = scripts[i].src;
+
+					// Script types supported:
+					// tinymce.js tinymce.min.js tinymce.dev.js
+					// tinymce.jquery.js tinymce.jquery.min.js tinymce.jquery.dev.js
+					// tinymce.full.js tinymce.full.min.js tinymce.full.dev.js
+					if (/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(src)) {
+						if (src.indexOf('.min') != -1) {
+							suffix = '.min';
+						}
+
+						baseURL = src.substring(0, src.lastIndexOf('/'));
+						break;
+					}
+				}
+
+				// We didn't find any baseURL by looking at the script elements
+				// Try to use the document.currentScript as a fallback
+				if (!baseURL && document.currentScript) {
+					src = document.currentScript.src;
+
+					if (src.indexOf('.min') != -1) {
+						suffix = '.min';
+					}
+
+					baseURL = src.substring(0, src.lastIndexOf('/'));
+				}
+			}
+
+			/**
+			 * Base URL where the root directory if TinyMCE is located.
+			 *
+			 * @property baseURL
+			 * @type String
+			 */
+			self.baseURL = new URI(documentBaseURL).toAbsolute(baseURL);
+
+			/**
+			 * Document base URL where the current document is located.
+			 *
+			 * @property documentBaseURL
+			 * @type String
+			 */
+			self.documentBaseURL = documentBaseURL;
+
+			/**
+			 * Absolute baseURI for the installation path of TinyMCE.
+			 *
+			 * @property baseURI
+			 * @type tinymce.util.URI
+			 */
+			self.baseURI = new URI(self.baseURL);
+
+			/**
+			 * Current suffix to add to each plugin/theme that gets loaded for example ".min".
+			 *
+			 * @property suffix
+			 * @type String
+			 */
+			self.suffix = suffix;
+
+			self.focusManager = new FocusManager(self);
+		},
+
+		/**
+		 * Initializes a set of editors. This method will create editors based on various settings.
+		 *
+		 * @method init
+		 * @param {Object} settings Settings object to be passed to each editor instance.
+		 * @example
+		 * // Initializes a editor using the longer method
+		 * tinymce.EditorManager.init({
+		 *    some_settings : 'some value'
+		 * });
+		 *
+		 * // Initializes a editor instance using the shorter version
+		 * tinyMCE.init({
+		 *    some_settings : 'some value'
+		 * });
+		 */
+		init: function(settings) {
+			var self = this, editors = [];
+
+			function createId(elm) {
+				var id = elm.id;
+
+				// Use element id, or unique name or generate a unique id
+				if (!id) {
+					id = elm.name;
+
+					if (id && !DOM.get(id)) {
+						id = elm.name;
+					} else {
+						// Generate unique name
+						id = DOM.uniqueId();
+					}
+
+					elm.setAttribute('id', id);
+				}
+
+				return id;
+			}
+
+			function createEditor(id, settings, targetElm) {
+				if (!purgeDestroyedEditor(self.get(id))) {
+					var editor = new Editor(id, settings, self);
+
+					editor.targetElm = editor.targetElm || targetElm;
+					editors.push(editor);
+					editor.render();
+				}
+			}
+
+			function execCallback(name) {
+				var callback = settings[name];
+
+				if (!callback) {
+					return;
+				}
+
+				return callback.apply(self, Array.prototype.slice.call(arguments, 2));
+			}
+
+			function hasClass(elm, className) {
+				return className.constructor === RegExp ? className.test(elm.className) : DOM.hasClass(elm, className);
+			}
+
+			function readyHandler() {
+				var l, co;
+
+				DOM.unbind(window, 'ready', readyHandler);
+
+				execCallback('onpageload');
+
+				if (settings.types) {
+					// Process type specific selector
+					each(settings.types, function(type) {
+						each(DOM.select(type.selector), function(elm) {
+							createEditor(createId(elm), extend({}, settings, type), elm);
+						});
+					});
+
+					return;
+				} else if (settings.selector) {
+					// Process global selector
+					each(DOM.select(settings.selector), function(elm) {
+						createEditor(createId(elm), settings, elm);
+					});
+
+					return;
+				} else if (settings.target) {
+					createEditor(createId(settings.target), settings);
+				}
+
+				// Fallback to old setting
+				switch (settings.mode) {
+					case "exact":
+						l = settings.elements || '';
+
+						if (l.length > 0) {
+							each(explode(l), function(id) {
+								var elm;
+
+								if ((elm = DOM.get(id))) {
+									createEditor(id, settings, elm);
+								} else {
+									each(document.forms, function(f) {
+										each(f.elements, function(e) {
+											if (e.name === id) {
+												id = 'mce_editor_' + instanceCounter++;
+												DOM.setAttrib(e, 'id', id);
+												createEditor(id, settings, e);
+											}
+										});
+									});
+								}
+							});
+						}
+						break;
+
+					case "textareas":
+					case "specific_textareas":
+						each(DOM.select('textarea'), function(elm) {
+							if (settings.editor_deselector && hasClass(elm, settings.editor_deselector)) {
+								return;
+							}
+
+							if (!settings.editor_selector || hasClass(elm, settings.editor_selector)) {
+								createEditor(createId(elm), settings, elm);
+							}
+						});
+						break;
+				}
+
+				// Call onInit when all editors are initialized
+				if (settings.oninit) {
+					l = co = 0;
+
+					each(editors, function(ed) {
+						co++;
+
+						if (!ed.initialized) {
+							// Wait for it
+							ed.on('init', function() {
+								l++;
+
+								// All done
+								if (l == co) {
+									execCallback('oninit');
+								}
+							});
+						} else {
+							l++;
+						}
+
+						// All done
+						if (l == co) {
+							execCallback('oninit');
+						}
+					});
+				}
+			}
+
+			self.settings = settings;
+
+			DOM.bind(window, 'ready', readyHandler);
+		},
+
+		/**
+		 * Returns a editor instance by id.
+		 *
+		 * @method get
+		 * @param {String/Number} id Editor instance id or index to return.
+		 * @return {tinymce.Editor} Editor instance to return.
+		 * @example
+		 * // Adds an onclick event to an editor by id (shorter version)
+		 * tinymce.get('mytextbox').on('click', function(e) {
+		 *    ed.windowManager.alert('Hello world!');
+		 * });
+		 *
+		 * // Adds an onclick event to an editor by id (longer version)
+		 * tinymce.EditorManager.get('mytextbox').on('click', function(e) {
+		 *    ed.windowManager.alert('Hello world!');
+		 * });
+		 */
+		get: function(id) {
+			if (!arguments.length) {
+				return this.editors;
+			}
+
+			return id in this.editors ? this.editors[id] : null;
+		},
+
+		/**
+		 * Adds an editor instance to the editor collection. This will also set it as the active editor.
+		 *
+		 * @method add
+		 * @param {tinymce.Editor} editor Editor instance to add to the collection.
+		 * @return {tinymce.Editor} The same instance that got passed in.
+		 */
+		add: function(editor) {
+			var self = this, editors = self.editors;
+
+			// Add named and index editor instance
+			editors[editor.id] = editor;
+			editors.push(editor);
+
+			// Doesn't call setActive method since we don't want
+			// to fire a bunch of activate/deactivate calls while initializing
+			self.activeEditor = editor;
+
+			/**
+			 * Fires when an editor is added to the EditorManager collection.
+			 *
+			 * @event AddEditor
+			 * @param {Object} e Event arguments.
+			 */
+			self.fire('AddEditor', {editor: editor});
+
+			if (!beforeUnloadDelegate) {
+				beforeUnloadDelegate = function() {
+					self.fire('BeforeUnload');
+				};
+
+				DOM.bind(window, 'beforeunload', beforeUnloadDelegate);
+			}
+
+			return editor;
+		},
+
+		/**
+		 * Creates an editor instance and adds it to the EditorManager collection.
+		 *
+		 * @method createEditor
+		 * @param {String} id Instance id to use for editor.
+		 * @param {Object} settings Editor instance settings.
+		 * @return {tinymce.Editor} Editor instance that got created.
+		 */
+		createEditor: function(id, settings) {
+			return this.add(new Editor(id, settings, this));
+		},
+
+		/**
+		 * Removes a editor or editors form page.
+		 *
+		 * @example
+		 * // Remove all editors bound to divs
+		 * tinymce.remove('div');
+		 *
+		 * // Remove all editors bound to textareas
+		 * tinymce.remove('textarea');
+		 *
+		 * // Remove all editors
+		 * tinymce.remove();
+		 *
+		 * // Remove specific instance by id
+		 * tinymce.remove('#id');
+		 *
+		 * @method remove
+		 * @param {tinymce.Editor/String/Object} [selector] CSS selector or editor instance to remove.
+		 * @return {tinymce.Editor} The editor that got passed in will be return if it was found otherwise null.
+		 */
+		remove: function(selector) {
+			var self = this, i, editors = self.editors, editor;
+
+			// Remove all editors
+			if (!selector) {
+				for (i = editors.length - 1; i >= 0; i--) {
+					self.remove(editors[i]);
+				}
+
+				return;
+			}
+
+			// Remove editors by selector
+			if (typeof selector == "string") {
+				selector = selector.selector || selector;
+
+				each(DOM.select(selector), function(elm) {
+					editor = editors[elm.id];
+
+					if (editor) {
+						self.remove(editor);
+					}
+				});
+
+				return;
+			}
+
+			// Remove specific editor
+			editor = selector;
+
+			// Not in the collection
+			if (!editors[editor.id]) {
+				return null;
+			}
+
+			/**
+			 * Fires when an editor is removed from EditorManager collection.
+			 *
+			 * @event RemoveEditor
+			 * @param {Object} e Event arguments.
+			 */
+			if (removeEditorFromList(editor)) {
+				self.fire('RemoveEditor', {editor: editor});
+			}
+
+			if (!editors.length) {
+				DOM.unbind(window, 'beforeunload', beforeUnloadDelegate);
+			}
+
+			editor.remove();
+
+			return editor;
+		},
+
+		/**
+		 * Executes a specific command on the currently active editor.
+		 *
+		 * @method execCommand
+		 * @param {String} c Command to perform for example Bold.
+		 * @param {Boolean} u Optional boolean state if a UI should be presented for the command or not.
+		 * @param {String} v Optional value parameter like for example an URL to a link.
+		 * @return {Boolean} true/false if the command was executed or not.
+		 */
+		execCommand: function(cmd, ui, value) {
+			var self = this, editor = self.get(value);
+
+			// Manager commands
+			switch (cmd) {
+				case "mceAddEditor":
+					if (!self.get(value)) {
+						new Editor(value, self.settings, self).render();
+					}
+
+					return true;
+
+				case "mceRemoveEditor":
+					if (editor) {
+						editor.remove();
+					}
+
+					return true;
+
+				case 'mceToggleEditor':
+					if (!editor) {
+						self.execCommand('mceAddEditor', 0, value);
+						return true;
+					}
+
+					if (editor.isHidden()) {
+						editor.show();
+					} else {
+						editor.hide();
+					}
+
+					return true;
+			}
+
+			// Run command on active editor
+			if (self.activeEditor) {
+				return self.activeEditor.execCommand(cmd, ui, value);
+			}
+
+			return false;
+		},
+
+		/**
+		 * Calls the save method on all editor instances in the collection. This can be useful when a form is to be submitted.
+		 *
+		 * @method triggerSave
+		 * @example
+		 * // Saves all contents
+		 * tinyMCE.triggerSave();
+		 */
+		triggerSave: function() {
+			each(this.editors, function(editor) {
+				editor.save();
+			});
+		},
+
+		/**
+		 * Adds a language pack, this gets called by the loaded language files like en.js.
+		 *
+		 * @method addI18n
+		 * @param {String} code Optional language code.
+		 * @param {Object} items Name/value object with translations.
+		 */
+		addI18n: function(code, items) {
+			I18n.add(code, items);
+		},
+
+		/**
+		 * Translates the specified string using the language pack items.
+		 *
+		 * @method translate
+		 * @param {String/Array/Object} text String to translate
+		 * @return {String} Translated string.
+		 */
+		translate: function(text) {
+			return I18n.translate(text);
+		},
+
+		/**
+		 * Sets the active editor instance and fires the deactivate/activate events.
+		 *
+		 * @method setActive
+		 * @param {tinymce.Editor} editor Editor instance to set as the active instance.
+		 */
+		setActive: function(editor) {
+			var activeEditor = this.activeEditor;
+
+			if (this.activeEditor != editor) {
+				if (activeEditor) {
+					activeEditor.fire('deactivate', {relatedTarget: editor});
+				}
+
+				editor.fire('activate', {relatedTarget: activeEditor});
+			}
+
+			this.activeEditor = editor;
+		}
+	};
+
+	extend(EditorManager, Observable);
+
+	EditorManager.setup();
+
+	// Export EditorManager as tinymce/tinymce in global namespace
+	window.tinymce = window.tinyMCE = EditorManager;
+
+	return EditorManager;
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/EditorObservable.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,204 @@
+/**
+ * EditorObservable.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This mixin contains the event logic for the tinymce.Editor class.
+ *
+ * @mixin tinymce.EditorObservable
+ * @extends tinymce.util.Observable
+ */
+define("tinymce/EditorObservable", [
+	"tinymce/util/Observable",
+	"tinymce/dom/DOMUtils",
+	"tinymce/util/Tools"
+], function(Observable, DOMUtils, Tools) {
+	var DOM = DOMUtils.DOM, customEventRootDelegates;
+
+	/**
+	 * Returns the event target so for the specified event. Some events fire
+	 * only on document, some fire on documentElement etc. This also handles the
+	 * custom event root setting where it returns that element instead of the body.
+	 *
+	 * @private
+	 * @param {tinymce.Editor} editor Editor instance to get event target from.
+	 * @param {String} eventName Name of the event for example "click".
+	 * @return {Element/Document} HTML Element or document target to bind on.
+	 */
+	function getEventTarget(editor, eventName) {
+		if (eventName == 'selectionchange') {
+			return editor.getDoc();
+		}
+
+		// Need to bind mousedown/mouseup etc to document not body in iframe mode
+		// Since the user might click on the HTML element not the BODY
+		if (!editor.inline && /^mouse|click|contextmenu|drop|dragover|dragend/.test(eventName)) {
+			return editor.getDoc().documentElement;
+		}
+
+		// Bind to event root instead of body if it's defined
+		if (editor.settings.event_root) {
+			if (!editor.eventRoot) {
+				editor.eventRoot = DOM.select(editor.settings.event_root)[0];
+			}
+
+			return editor.eventRoot;
+		}
+
+		return editor.getBody();
+	}
+
+	/**
+	 * Binds a event delegate for the specified name this delegate will fire
+	 * the event to the editor dispatcher.
+	 *
+	 * @private
+	 * @param {tinymce.Editor} editor Editor instance to get event target from.
+	 * @param {String} eventName Name of the event for example "click".
+	 */
+	function bindEventDelegate(editor, eventName) {
+		var eventRootElm = getEventTarget(editor, eventName), delegate;
+
+		if (!editor.delegates) {
+			editor.delegates = {};
+		}
+
+		if (editor.delegates[eventName]) {
+			return;
+		}
+
+		if (editor.settings.event_root) {
+			if (!customEventRootDelegates) {
+				customEventRootDelegates = {};
+				editor.editorManager.on('removeEditor', function() {
+					var name;
+
+					if (!editor.editorManager.activeEditor) {
+						if (customEventRootDelegates) {
+							for (name in customEventRootDelegates) {
+								editor.dom.unbind(getEventTarget(editor, name));
+							}
+
+							customEventRootDelegates = null;
+						}
+					}
+				});
+			}
+
+			if (customEventRootDelegates[eventName]) {
+				return;
+			}
+
+			delegate = function(e) {
+				var target = e.target, editors = editor.editorManager.editors, i = editors.length;
+
+				while (i--) {
+					var body = editors[i].getBody();
+
+					if (body === target || DOM.isChildOf(target, body)) {
+						if (!editors[i].hidden) {
+							editors[i].fire(eventName, e);
+						}
+					}
+				}
+			};
+
+			customEventRootDelegates[eventName] = delegate;
+			DOM.bind(eventRootElm, eventName, delegate);
+		} else {
+			delegate = function(e) {
+				if (!editor.hidden) {
+					editor.fire(eventName, e);
+				}
+			};
+
+			DOM.bind(eventRootElm, eventName, delegate);
+			editor.delegates[eventName] = delegate;
+		}
+	}
+
+	var EditorObservable = {
+		/**
+		 * Bind any pending event delegates. This gets executed after the target body/document is created.
+		 *
+		 * @private
+		 */
+		bindPendingEventDelegates: function() {
+			var self = this;
+
+			Tools.each(self._pendingNativeEvents, function(name) {
+				bindEventDelegate(self, name);
+			});
+		},
+
+		/**
+		 * Toggles a native event on/off this is called by the EventDispatcher when
+		 * the first native event handler is added and when the last native event handler is removed.
+		 *
+		 * @private
+		 */
+		toggleNativeEvent: function(name, state) {
+			var self = this;
+
+			if (self.settings.readonly) {
+				return;
+			}
+
+			// Never bind focus/blur since the FocusManager fakes those
+			if (name == "focus" || name == "blur") {
+				return;
+			}
+
+			if (state) {
+				if (self.initialized) {
+					bindEventDelegate(self, name);
+				} else {
+					if (!self._pendingNativeEvents) {
+						self._pendingNativeEvents = [name];
+					} else {
+						self._pendingNativeEvents.push(name);
+					}
+				}
+			} else if (self.initialized) {
+				self.dom.unbind(getEventTarget(self, name), name, self.delegates[name]);
+				delete self.delegates[name];
+			}
+		},
+
+		/**
+		 * Unbinds all native event handlers that means delegates, custom events bound using the Events API etc.
+		 *
+		 * @private
+		 */
+		unbindAllNativeEvents: function() {
+			var self = this, name;
+
+			if (self.delegates) {
+				for (name in self.delegates) {
+					self.dom.unbind(getEventTarget(self, name), name, self.delegates[name]);
+				}
+
+				delete self.delegates;
+			}
+
+			if (!self.inline) {
+				self.getBody().onload = null;
+				self.dom.unbind(self.getWin());
+				self.dom.unbind(self.getDoc());
+			}
+
+			self.dom.unbind(self.getBody());
+			self.dom.unbind(self.getContainer());
+		}
+	};
+
+	EditorObservable = Tools.extend({}, Observable, EditorObservable);
+
+	return EditorObservable;
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/EnterKey.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,638 @@
+/**
+ * EnterKey.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Contains logic for handling the enter key to split/generate block elements.
+ */
+define("tinymce/EnterKey", [
+	"tinymce/dom/TreeWalker",
+	"tinymce/dom/RangeUtils",
+	"tinymce/Env"
+], function(TreeWalker, RangeUtils, Env) {
+	var isIE = Env.ie && Env.ie < 11;
+
+	return function(editor) {
+		var dom = editor.dom, selection = editor.selection, settings = editor.settings;
+		var undoManager = editor.undoManager, schema = editor.schema, nonEmptyElementsMap = schema.getNonEmptyElements(),
+			moveCaretBeforeOnEnterElementsMap = schema.getMoveCaretBeforeOnEnterElements();
+
+		function handleEnterKey(evt) {
+			var rng, tmpRng, editableRoot, container, offset, parentBlock, documentMode, shiftKey,
+				newBlock, fragment, containerBlock, parentBlockName, containerBlockName, newBlockName, isAfterLastNodeInContainer;
+
+			// Returns true if the block can be split into two blocks or not
+			function canSplitBlock(node) {
+				return node &&
+					dom.isBlock(node) &&
+					!/^(TD|TH|CAPTION|FORM)$/.test(node.nodeName) &&
+					!/^(fixed|absolute)/i.test(node.style.position) &&
+					dom.getContentEditable(node) !== "true";
+			}
+
+			// Renders empty block on IE
+			function renderBlockOnIE(block) {
+				var oldRng;
+
+				if (dom.isBlock(block)) {
+					oldRng = selection.getRng();
+					block.appendChild(dom.create('span', null, '\u00a0'));
+					selection.select(block);
+					block.lastChild.outerHTML = '';
+					selection.setRng(oldRng);
+				}
+			}
+
+			// Remove the first empty inline element of the block so this: <p><b><em></em></b>x</p> becomes this: <p>x</p>
+			function trimInlineElementsOnLeftSideOfBlock(block) {
+				var node = block, firstChilds = [], i;
+
+				if (!node) {
+					return;
+				}
+
+				// Find inner most first child ex: <p><i><b>*</b></i></p>
+				while ((node = node.firstChild)) {
+					if (dom.isBlock(node)) {
+						return;
+					}
+
+					if (node.nodeType == 1 && !nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
+						firstChilds.push(node);
+					}
+				}
+
+				i = firstChilds.length;
+				while (i--) {
+					node = firstChilds[i];
+					if (!node.hasChildNodes() || (node.firstChild == node.lastChild && node.firstChild.nodeValue === '')) {
+						dom.remove(node);
+					} else {
+						// Remove <a> </a> see #5381
+						if (node.nodeName == "A" && (node.innerText || node.textContent) === ' ') {
+							dom.remove(node);
+						}
+					}
+				}
+			}
+
+			// Moves the caret to a suitable position within the root for example in the first non
+			// pure whitespace text node or before an image
+			function moveToCaretPosition(root) {
+				var walker, node, rng, lastNode = root, tempElm;
+				function firstNonWhiteSpaceNodeSibling(node) {
+					while (node) {
+						if (node.nodeType == 1 || (node.nodeType == 3 && node.data && /[\r\n\s]/.test(node.data))) {
+							return node;
+						}
+
+						node = node.nextSibling;
+					}
+				}
+
+				if (!root) {
+					return;
+				}
+
+				// Old IE versions doesn't properly render blocks with br elements in them
+				// For example <p><br></p> wont be rendered correctly in a contentEditable area
+				// until you remove the br producing <p></p>
+				if (Env.ie && Env.ie < 9 && parentBlock && parentBlock.firstChild) {
+					if (parentBlock.firstChild == parentBlock.lastChild && parentBlock.firstChild.tagName == 'BR') {
+						dom.remove(parentBlock.firstChild);
+					}
+				}
+
+				if (/^(LI|DT|DD)$/.test(root.nodeName)) {
+					var firstChild = firstNonWhiteSpaceNodeSibling(root.firstChild);
+
+					if (firstChild && /^(UL|OL|DL)$/.test(firstChild.nodeName)) {
+						root.insertBefore(dom.doc.createTextNode('\u00a0'), root.firstChild);
+					}
+				}
+
+				rng = dom.createRng();
+
+				// Normalize whitespace to remove empty text nodes. Fix for: #6904
+				// Gecko will be able to place the caret in empty text nodes but it won't render propery
+				// Older IE versions will sometimes crash so for now ignore all IE versions
+				if (!Env.ie) {
+					root.normalize();
+				}
+
+				if (root.hasChildNodes()) {
+					walker = new TreeWalker(root, root);
+
+					while ((node = walker.current())) {
+						if (node.nodeType == 3) {
+							rng.setStart(node, 0);
+							rng.setEnd(node, 0);
+							break;
+						}
+
+						if (moveCaretBeforeOnEnterElementsMap[node.nodeName.toLowerCase()]) {
+							rng.setStartBefore(node);
+							rng.setEndBefore(node);
+							break;
+						}
+
+						lastNode = node;
+						node = walker.next();
+					}
+
+					if (!node) {
+						rng.setStart(lastNode, 0);
+						rng.setEnd(lastNode, 0);
+					}
+				} else {
+					if (root.nodeName == 'BR') {
+						if (root.nextSibling && dom.isBlock(root.nextSibling)) {
+							// Trick on older IE versions to render the caret before the BR between two lists
+							if (!documentMode || documentMode < 9) {
+								tempElm = dom.create('br');
+								root.parentNode.insertBefore(tempElm, root);
+							}
+
+							rng.setStartBefore(root);
+							rng.setEndBefore(root);
+						} else {
+							rng.setStartAfter(root);
+							rng.setEndAfter(root);
+						}
+					} else {
+						rng.setStart(root, 0);
+						rng.setEnd(root, 0);
+					}
+				}
+
+				selection.setRng(rng);
+
+				// Remove tempElm created for old IE:s
+				dom.remove(tempElm);
+				selection.scrollIntoView(root);
+			}
+
+			function setForcedBlockAttrs(node) {
+				var forcedRootBlockName = settings.forced_root_block;
+
+				if (forcedRootBlockName && forcedRootBlockName.toLowerCase() === node.tagName.toLowerCase()) {
+					dom.setAttribs(node, settings.forced_root_block_attrs);
+				}
+			}
+
+			// Creates a new block element by cloning the current one or creating a new one if the name is specified
+			// This function will also copy any text formatting from the parent block and add it to the new one
+			function createNewBlock(name) {
+				var node = container, block, clonedNode, caretNode, textInlineElements = schema.getTextInlineElements();
+
+				if (name || parentBlockName == "TABLE") {
+					block = dom.create(name || newBlockName);
+					setForcedBlockAttrs(block);
+				} else {
+					block = parentBlock.cloneNode(false);
+				}
+
+				caretNode = block;
+
+				// Clone any parent styles
+				if (settings.keep_styles !== false) {
+					do {
+						if (textInlineElements[node.nodeName]) {
+							// Never clone a caret containers
+							if (node.id == '_mce_caret') {
+								continue;
+							}
+
+							clonedNode = node.cloneNode(false);
+							dom.setAttrib(clonedNode, 'id', ''); // Remove ID since it needs to be document unique
+
+							if (block.hasChildNodes()) {
+								clonedNode.appendChild(block.firstChild);
+								block.appendChild(clonedNode);
+							} else {
+								caretNode = clonedNode;
+								block.appendChild(clonedNode);
+							}
+						}
+					} while ((node = node.parentNode));
+				}
+
+				// BR is needed in empty blocks on non IE browsers
+				if (!isIE) {
+					caretNode.innerHTML = '<br data-mce-bogus="1">';
+				}
+
+				return block;
+			}
+
+			// Returns true/false if the caret is at the start/end of the parent block element
+			function isCaretAtStartOrEndOfBlock(start) {
+				var walker, node, name;
+
+				// Caret is in the middle of a text node like "a|b"
+				if (container.nodeType == 3 && (start ? offset > 0 : offset < container.nodeValue.length)) {
+					return false;
+				}
+
+				// If after the last element in block node edge case for #5091
+				if (container.parentNode == parentBlock && isAfterLastNodeInContainer && !start) {
+					return true;
+				}
+
+				// If the caret if before the first element in parentBlock
+				if (start && container.nodeType == 1 && container == parentBlock.firstChild) {
+					return true;
+				}
+
+				// Caret can be before/after a table
+				if (container.nodeName === "TABLE" || (container.previousSibling && container.previousSibling.nodeName == "TABLE")) {
+					return (isAfterLastNodeInContainer && !start) || (!isAfterLastNodeInContainer && start);
+				}
+
+				// Walk the DOM and look for text nodes or non empty elements
+				walker = new TreeWalker(container, parentBlock);
+
+				// If caret is in beginning or end of a text block then jump to the next/previous node
+				if (container.nodeType == 3) {
+					if (start && offset === 0) {
+						walker.prev();
+					} else if (!start && offset == container.nodeValue.length) {
+						walker.next();
+					}
+				}
+
+				while ((node = walker.current())) {
+					if (node.nodeType === 1) {
+						// Ignore bogus elements
+						if (!node.getAttribute('data-mce-bogus')) {
+							// Keep empty elements like <img /> <input /> but not trailing br:s like <p>text|<br></p>
+							name = node.nodeName.toLowerCase();
+							if (nonEmptyElementsMap[name] && name !== 'br') {
+								return false;
+							}
+						}
+					} else if (node.nodeType === 3 && !/^[ \t\r\n]*$/.test(node.nodeValue)) {
+						return false;
+					}
+
+					if (start) {
+						walker.prev();
+					} else {
+						walker.next();
+					}
+				}
+
+				return true;
+			}
+
+			// Wraps any text nodes or inline elements in the specified forced root block name
+			function wrapSelfAndSiblingsInDefaultBlock(container, offset) {
+				var newBlock, parentBlock, startNode, node, next, rootBlockName, blockName = newBlockName || 'P';
+
+				// Not in a block element or in a table cell or caption
+				parentBlock = dom.getParent(container, dom.isBlock);
+				rootBlockName = editor.getBody().nodeName.toLowerCase();
+				if (!parentBlock || !canSplitBlock(parentBlock)) {
+					parentBlock = parentBlock || editableRoot;
+
+					if (!parentBlock.hasChildNodes()) {
+						newBlock = dom.create(blockName);
+						setForcedBlockAttrs(newBlock);
+						parentBlock.appendChild(newBlock);
+						rng.setStart(newBlock, 0);
+						rng.setEnd(newBlock, 0);
+						return newBlock;
+					}
+
+					// Find parent that is the first child of parentBlock
+					node = container;
+					while (node.parentNode != parentBlock) {
+						node = node.parentNode;
+					}
+
+					// Loop left to find start node start wrapping at
+					while (node && !dom.isBlock(node)) {
+						startNode = node;
+						node = node.previousSibling;
+					}
+
+					if (startNode && schema.isValidChild(rootBlockName, blockName.toLowerCase())) {
+						newBlock = dom.create(blockName);
+						setForcedBlockAttrs(newBlock);
+						startNode.parentNode.insertBefore(newBlock, startNode);
+
+						// Start wrapping until we hit a block
+						node = startNode;
+						while (node && !dom.isBlock(node)) {
+							next = node.nextSibling;
+							newBlock.appendChild(node);
+							node = next;
+						}
+
+						// Restore range to it's past location
+						rng.setStart(container, offset);
+						rng.setEnd(container, offset);
+					}
+				}
+
+				return container;
+			}
+
+			// Inserts a block or br before/after or in the middle of a split list of the LI is empty
+			function handleEmptyListItem() {
+				function isFirstOrLastLi(first) {
+					var node = containerBlock[first ? 'firstChild' : 'lastChild'];
+
+					// Find first/last element since there might be whitespace there
+					while (node) {
+						if (node.nodeType == 1) {
+							break;
+						}
+
+						node = node[first ? 'nextSibling' : 'previousSibling'];
+					}
+
+					return node === parentBlock;
+				}
+
+				function getContainerBlock() {
+					var containerBlockParent = containerBlock.parentNode;
+
+					if (/^(LI|DT|DD)$/.test(containerBlockParent.nodeName)) {
+						return containerBlockParent;
+					}
+
+					return containerBlock;
+				}
+
+				// Check if we are in an nested list
+				var containerBlockParentName = containerBlock.parentNode.nodeName;
+				if (/^(OL|UL|LI)$/.test(containerBlockParentName)) {
+					newBlockName = 'LI';
+				}
+
+				newBlock = newBlockName ? createNewBlock(newBlockName) : dom.create('BR');
+
+				if (isFirstOrLastLi(true) && isFirstOrLastLi()) {
+					if (containerBlockParentName == 'LI') {
+						// Nested list is inside a LI
+						dom.insertAfter(newBlock, getContainerBlock());
+					} else {
+						// Is first and last list item then replace the OL/UL with a text block
+						dom.replace(newBlock, containerBlock);
+					}
+				} else if (isFirstOrLastLi(true)) {
+					if (containerBlockParentName == 'LI') {
+						// List nested in an LI then move the list to a new sibling LI
+						dom.insertAfter(newBlock, getContainerBlock());
+						newBlock.appendChild(dom.doc.createTextNode(' ')); // Needed for IE so the caret can be placed
+						newBlock.appendChild(containerBlock);
+					} else {
+						// First LI in list then remove LI and add text block before list
+						containerBlock.parentNode.insertBefore(newBlock, containerBlock);
+					}
+				} else if (isFirstOrLastLi()) {
+					// Last LI in list then remove LI and add text block after list
+					dom.insertAfter(newBlock, getContainerBlock());
+					renderBlockOnIE(newBlock);
+				} else {
+					// Middle LI in list the split the list and insert a text block in the middle
+					// Extract after fragment and insert it after the current block
+					containerBlock = getContainerBlock();
+					tmpRng = rng.cloneRange();
+					tmpRng.setStartAfter(parentBlock);
+					tmpRng.setEndAfter(containerBlock);
+					fragment = tmpRng.extractContents();
+
+					if (newBlockName == 'LI' && fragment.firstChild.nodeName == 'LI') {
+						newBlock = fragment.firstChild;
+						dom.insertAfter(fragment, containerBlock);
+					} else {
+						dom.insertAfter(fragment, containerBlock);
+						dom.insertAfter(newBlock, containerBlock);
+					}
+				}
+
+				dom.remove(parentBlock);
+				moveToCaretPosition(newBlock);
+				undoManager.add();
+			}
+
+			// Inserts a BR element if the forced_root_block option is set to false or empty string
+			function insertBr() {
+				editor.execCommand("InsertLineBreak", false, evt);
+			}
+
+			// Trims any linebreaks at the beginning of node user for example when pressing enter in a PRE element
+			function trimLeadingLineBreaks(node) {
+				do {
+					if (node.nodeType === 3) {
+						node.nodeValue = node.nodeValue.replace(/^[\r\n]+/, '');
+					}
+
+					node = node.firstChild;
+				} while (node);
+			}
+
+			function getEditableRoot(node) {
+				var root = dom.getRoot(), parent, editableRoot;
+
+				// Get all parents until we hit a non editable parent or the root
+				parent = node;
+				while (parent !== root && dom.getContentEditable(parent) !== "false") {
+					if (dom.getContentEditable(parent) === "true") {
+						editableRoot = parent;
+					}
+
+					parent = parent.parentNode;
+				}
+
+				return parent !== root ? editableRoot : root;
+			}
+
+			// Adds a BR at the end of blocks that only contains an IMG or INPUT since
+			// these might be floated and then they won't expand the block
+			function addBrToBlockIfNeeded(block) {
+				var lastChild;
+
+				// IE will render the blocks correctly other browsers needs a BR
+				if (!isIE) {
+					block.normalize(); // Remove empty text nodes that got left behind by the extract
+
+					// Check if the block is empty or contains a floated last child
+					lastChild = block.lastChild;
+					if (!lastChild || (/^(left|right)$/gi.test(dom.getStyle(lastChild, 'float', true)))) {
+						dom.add(block, 'br');
+					}
+				}
+			}
+
+			rng = selection.getRng(true);
+
+			// Event is blocked by some other handler for example the lists plugin
+			if (evt.isDefaultPrevented()) {
+				return;
+			}
+
+			// Delete any selected contents
+			if (!rng.collapsed) {
+				editor.execCommand('Delete');
+				return;
+			}
+
+			// Setup range items and newBlockName
+			new RangeUtils(dom).normalize(rng);
+			container = rng.startContainer;
+			offset = rng.startOffset;
+			newBlockName = (settings.force_p_newlines ? 'p' : '') || settings.forced_root_block;
+			newBlockName = newBlockName ? newBlockName.toUpperCase() : '';
+			documentMode = dom.doc.documentMode;
+			shiftKey = evt.shiftKey;
+
+			// Resolve node index
+			if (container.nodeType == 1 && container.hasChildNodes()) {
+				isAfterLastNodeInContainer = offset > container.childNodes.length - 1;
+
+				container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container;
+				if (isAfterLastNodeInContainer && container.nodeType == 3) {
+					offset = container.nodeValue.length;
+				} else {
+					offset = 0;
+				}
+			}
+
+			// Get editable root node normaly the body element but sometimes a div or span
+			editableRoot = getEditableRoot(container);
+
+			// If there is no editable root then enter is done inside a contentEditable false element
+			if (!editableRoot) {
+				return;
+			}
+
+			undoManager.beforeChange();
+
+			// If editable root isn't block nor the root of the editor
+			if (!dom.isBlock(editableRoot) && editableRoot != dom.getRoot()) {
+				if (!newBlockName || shiftKey) {
+					insertBr();
+				}
+
+				return;
+			}
+
+			// Wrap the current node and it's sibling in a default block if it's needed.
+			// for example this <td>text|<b>text2</b></td> will become this <td><p>text|<b>text2</p></b></td>
+			// This won't happen if root blocks are disabled or the shiftKey is pressed
+			if ((newBlockName && !shiftKey) || (!newBlockName && shiftKey)) {
+				container = wrapSelfAndSiblingsInDefaultBlock(container, offset);
+			}
+
+			// Find parent block and setup empty block paddings
+			parentBlock = dom.getParent(container, dom.isBlock);
+			containerBlock = parentBlock ? dom.getParent(parentBlock.parentNode, dom.isBlock) : null;
+
+			// Setup block names
+			parentBlockName = parentBlock ? parentBlock.nodeName.toUpperCase() : ''; // IE < 9 & HTML5
+			containerBlockName = containerBlock ? containerBlock.nodeName.toUpperCase() : ''; // IE < 9 & HTML5
+
+			// Enter inside block contained within a LI then split or insert before/after LI
+			if (containerBlockName == 'LI' && !evt.ctrlKey) {
+				parentBlock = containerBlock;
+				parentBlockName = containerBlockName;
+			}
+
+			// Handle enter in list item
+			if (/^(LI|DT|DD)$/.test(parentBlockName)) {
+				if (!newBlockName && shiftKey) {
+					insertBr();
+					return;
+				}
+
+				// Handle enter inside an empty list item
+				if (dom.isEmpty(parentBlock)) {
+					handleEmptyListItem();
+					return;
+				}
+			}
+
+			// Don't split PRE tags but insert a BR instead easier when writing code samples etc
+			if (parentBlockName == 'PRE' && settings.br_in_pre !== false) {
+				if (!shiftKey) {
+					insertBr();
+					return;
+				}
+			} else {
+				// If no root block is configured then insert a BR by default or if the shiftKey is pressed
+				if ((!newBlockName && !shiftKey && parentBlockName != 'LI') || (newBlockName && shiftKey)) {
+					insertBr();
+					return;
+				}
+			}
+
+			// If parent block is root then never insert new blocks
+			if (newBlockName && parentBlock === editor.getBody()) {
+				return;
+			}
+
+			// Default block name if it's not configured
+			newBlockName = newBlockName || 'P';
+
+			// Insert new block before/after the parent block depending on caret location
+			if (isCaretAtStartOrEndOfBlock()) {
+				// If the caret is at the end of a header we produce a P tag after it similar to Word unless we are in a hgroup
+				if (/^(H[1-6]|PRE|FIGURE)$/.test(parentBlockName) && containerBlockName != 'HGROUP') {
+					newBlock = createNewBlock(newBlockName);
+				} else {
+					newBlock = createNewBlock();
+				}
+
+				// Split the current container block element if enter is pressed inside an empty inner block element
+				if (settings.end_container_on_empty_block && canSplitBlock(containerBlock) && dom.isEmpty(parentBlock)) {
+					// Split container block for example a BLOCKQUOTE at the current blockParent location for example a P
+					newBlock = dom.split(containerBlock, parentBlock);
+				} else {
+					dom.insertAfter(newBlock, parentBlock);
+				}
+
+				moveToCaretPosition(newBlock);
+			} else if (isCaretAtStartOrEndOfBlock(true)) {
+				// Insert new block before
+				newBlock = parentBlock.parentNode.insertBefore(createNewBlock(), parentBlock);
+				renderBlockOnIE(newBlock);
+				moveToCaretPosition(parentBlock);
+			} else {
+				// Extract after fragment and insert it after the current block
+				tmpRng = rng.cloneRange();
+				tmpRng.setEndAfter(parentBlock);
+				fragment = tmpRng.extractContents();
+				trimLeadingLineBreaks(fragment);
+				newBlock = fragment.firstChild;
+				dom.insertAfter(fragment, parentBlock);
+				trimInlineElementsOnLeftSideOfBlock(newBlock);
+				addBrToBlockIfNeeded(parentBlock);
+				moveToCaretPosition(newBlock);
+			}
+
+			dom.setAttrib(newBlock, 'id', ''); // Remove ID since it needs to be document unique
+
+			// Allow custom handling of new blocks
+			editor.fire('NewBlock', {newBlock: newBlock});
+
+			undoManager.add();
+		}
+
+		editor.on('keydown', function(evt) {
+			if (evt.keyCode == 13) {
+				if (handleEnterKey(evt) !== false) {
+					evt.preventDefault();
+				}
+			}
+		});
+	};
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/Env.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,150 @@
+/**
+ * Env.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class contains various environment constants like browser versions etc.
+ * Normally you don't want to sniff specific browser versions but sometimes you have
+ * to when it's impossible to feature detect. So use this with care.
+ *
+ * @class tinymce.Env
+ * @static
+ */
+define("tinymce/Env", [], function() {
+	var nav = navigator, userAgent = nav.userAgent;
+	var opera, webkit, ie, ie11, ie12, gecko, mac, iDevice, android;
+
+	opera = window.opera && window.opera.buildNumber;
+	android = /Android/.test(userAgent);
+	webkit = /WebKit/.test(userAgent);
+	ie = !webkit && !opera && (/MSIE/gi).test(userAgent) && (/Explorer/gi).test(nav.appName);
+	ie = ie && /MSIE (\w+)\./.exec(userAgent)[1];
+	ie11 = userAgent.indexOf('Trident/') != -1 && (userAgent.indexOf('rv:') != -1 || nav.appName.indexOf('Netscape') != -1) ? 11 : false;
+	ie12 = (document.msElementsFromPoint && !ie && !ie11) ? 12 : false;
+	ie = ie || ie11 || ie12;
+	gecko = !webkit && !ie11 && /Gecko/.test(userAgent);
+	mac = userAgent.indexOf('Mac') != -1;
+	iDevice = /(iPad|iPhone)/.test(userAgent);
+
+	if (ie12) {
+		webkit = false;
+	}
+
+	// Is a iPad/iPhone and not on iOS5 sniff the WebKit version since older iOS WebKit versions
+	// says it has contentEditable support but there is no visible caret.
+	var contentEditable = !iDevice || userAgent.match(/AppleWebKit\/(\d*)/)[1] >= 534;
+
+	return {
+		/**
+		 * Constant that is true if the browser is Opera.
+		 *
+		 * @property opera
+		 * @type Boolean
+		 * @final
+		 */
+		opera: opera,
+
+		/**
+		 * Constant that is true if the browser is WebKit (Safari/Chrome).
+		 *
+		 * @property webKit
+		 * @type Boolean
+		 * @final
+		 */
+		webkit: webkit,
+
+		/**
+		 * Constant that is more than zero if the browser is IE.
+		 *
+		 * @property ie
+		 * @type Boolean
+		 * @final
+		 */
+		ie: ie,
+
+		/**
+		 * Constant that is true if the browser is Gecko.
+		 *
+		 * @property gecko
+		 * @type Boolean
+		 * @final
+		 */
+		gecko: gecko,
+
+		/**
+		 * Constant that is true if the os is Mac OS.
+		 *
+		 * @property mac
+		 * @type Boolean
+		 * @final
+		 */
+		mac: mac,
+
+		/**
+		 * Constant that is true if the os is iOS.
+		 *
+		 * @property iOS
+		 * @type Boolean
+		 * @final
+		 */
+		iOS: iDevice,
+
+		/**
+		 * Constant that is true if the os is android.
+		 *
+		 * @property android
+		 * @type Boolean
+		 * @final
+		 */
+		android: android,
+
+		/**
+		 * Constant that is true if the browser supports editing.
+		 *
+		 * @property contentEditable
+		 * @type Boolean
+		 * @final
+		 */
+		contentEditable: contentEditable,
+
+		/**
+		 * Transparent image data url.
+		 *
+		 * @property transparentSrc
+		 * @type Boolean
+		 * @final
+		 */
+		transparentSrc: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
+
+		/**
+		 * Returns true/false if the browser can or can't place the caret after a inline block like an image.
+		 *
+		 * @property noCaretAfter
+		 * @type Boolean
+		 * @final
+		 */
+		caretAfter: ie != 8,
+
+		/**
+		 * Constant that is true if the browser supports native DOM Ranges. IE 9+.
+		 *
+		 * @property range
+		 * @type Boolean
+		 */
+		range: window.getSelection && "Range" in window,
+
+		/**
+		 * Returns the IE document mode for non IE browsers this will fake IE 10.
+		 *
+		 * @property documentMode
+		 * @type Number
+		 */
+		documentMode: ie && !ie12 ? (document.documentMode || 7) : 10
+	};
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/FocusManager.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,264 @@
+/**
+ * FocusManager.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class manages the focus/blur state of the editor. This class is needed since some
+ * browsers fire false focus/blur states when the selection is moved to a UI dialog or similar.
+ *
+ * This class will fire two events focus and blur on the editor instances that got affected.
+ * It will also handle the restore of selection when the focus is lost and returned.
+ *
+ * @class tinymce.FocusManager
+ */
+define("tinymce/FocusManager", [
+	"tinymce/dom/DOMUtils",
+	"tinymce/Env"
+], function(DOMUtils, Env) {
+	var selectionChangeHandler, documentFocusInHandler, documentMouseUpHandler, DOM = DOMUtils.DOM;
+
+	/**
+	 * Constructs a new focus manager instance.
+	 *
+	 * @constructor FocusManager
+	 * @param {tinymce.EditorManager} editorManager Editor manager instance to handle focus for.
+	 */
+	function FocusManager(editorManager) {
+		function getActiveElement() {
+			try {
+				return document.activeElement;
+			} catch (ex) {
+				// IE sometimes fails to get the activeElement when resizing table
+				// TODO: Investigate this
+				return document.body;
+			}
+		}
+
+		// We can't store a real range on IE 11 since it gets mutated so we need to use a bookmark object
+		// TODO: Move this to a separate range utils class since it's it's logic is present in Selection as well.
+		function createBookmark(dom, rng) {
+			if (rng && rng.startContainer) {
+				// Verify that the range is within the root of the editor
+				if (!dom.isChildOf(rng.startContainer, dom.getRoot()) || !dom.isChildOf(rng.endContainer, dom.getRoot())) {
+					return;
+				}
+
+				return {
+					startContainer: rng.startContainer,
+					startOffset: rng.startOffset,
+					endContainer: rng.endContainer,
+					endOffset: rng.endOffset
+				};
+			}
+
+			return rng;
+		}
+
+		function bookmarkToRng(editor, bookmark) {
+			var rng;
+
+			if (bookmark.startContainer) {
+				rng = editor.getDoc().createRange();
+				rng.setStart(bookmark.startContainer, bookmark.startOffset);
+				rng.setEnd(bookmark.endContainer, bookmark.endOffset);
+			} else {
+				rng = bookmark;
+			}
+
+			return rng;
+		}
+
+		function isUIElement(elm) {
+			return !!DOM.getParent(elm, FocusManager.isEditorUIElement);
+		}
+
+		function registerEvents(e) {
+			var editor = e.editor;
+
+			editor.on('init', function() {
+				// Gecko/WebKit has ghost selections in iframes and IE only has one selection per browser tab
+				if (editor.inline || Env.ie) {
+					// Use the onbeforedeactivate event when available since it works better see #7023
+					if ("onbeforedeactivate" in document && Env.ie < 9) {
+						editor.dom.bind(editor.getBody(), 'beforedeactivate', function(e) {
+							if (e.target != editor.getBody()) {
+								return;
+							}
+
+							try {
+								editor.lastRng = editor.selection.getRng();
+							} catch (ex) {
+								// IE throws "Unexcpected call to method or property access" some times so lets ignore it
+							}
+						});
+					} else {
+						// On other browsers take snapshot on nodechange in inline mode since they have Ghost selections for iframes
+						editor.on('nodechange mouseup keyup', function(e) {
+							var node = getActiveElement();
+
+							// Only act on manual nodechanges
+							if (e.type == 'nodechange' && e.selectionChange) {
+								return;
+							}
+
+							// IE 11 reports active element as iframe not body of iframe
+							if (node && node.id == editor.id + '_ifr') {
+								node = editor.getBody();
+							}
+
+							if (editor.dom.isChildOf(node, editor.getBody())) {
+								editor.lastRng = editor.selection.getRng();
+							}
+						});
+					}
+
+					// Handles the issue with WebKit not retaining selection within inline document
+					// If the user releases the mouse out side the body since a mouse up event wont occur on the body
+					if (Env.webkit && !selectionChangeHandler) {
+						selectionChangeHandler = function() {
+							var activeEditor = editorManager.activeEditor;
+
+							if (activeEditor && activeEditor.selection) {
+								var rng = activeEditor.selection.getRng();
+
+								// Store when it's non collapsed
+								if (rng && !rng.collapsed) {
+									editor.lastRng = rng;
+								}
+							}
+						};
+
+						DOM.bind(document, 'selectionchange', selectionChangeHandler);
+					}
+				}
+			});
+
+			editor.on('setcontent', function() {
+				editor.lastRng = null;
+			});
+
+			// Remove last selection bookmark on mousedown see #6305
+			editor.on('mousedown', function() {
+				editor.selection.lastFocusBookmark = null;
+			});
+
+			editor.on('focusin', function() {
+				var focusedEditor = editorManager.focusedEditor;
+
+				if (editor.selection.lastFocusBookmark) {
+					editor.selection.setRng(bookmarkToRng(editor, editor.selection.lastFocusBookmark));
+					editor.selection.lastFocusBookmark = null;
+				}
+
+				if (focusedEditor != editor) {
+					if (focusedEditor) {
+						focusedEditor.fire('blur', {focusedEditor: editor});
+					}
+
+					editorManager.setActive(editor);
+					editorManager.focusedEditor = editor;
+					editor.fire('focus', {blurredEditor: focusedEditor});
+					editor.focus(true);
+				}
+
+				editor.lastRng = null;
+			});
+
+			editor.on('focusout', function() {
+				window.setTimeout(function() {
+					var focusedEditor = editorManager.focusedEditor;
+
+					// Still the same editor the the blur was outside any editor UI
+					if (!isUIElement(getActiveElement()) && focusedEditor == editor) {
+						editor.fire('blur', {focusedEditor: null});
+						editorManager.focusedEditor = null;
+
+						// Make sure selection is valid could be invalid if the editor is blured and removed before the timeout occurs
+						if (editor.selection) {
+							editor.selection.lastFocusBookmark = null;
+						}
+					}
+				}, 0);
+			});
+
+			// Check if focus is moved to an element outside the active editor by checking if the target node
+			// isn't within the body of the activeEditor nor a UI element such as a dialog child control
+			if (!documentFocusInHandler) {
+				documentFocusInHandler = function(e) {
+					var activeEditor = editorManager.activeEditor;
+
+					if (activeEditor && e.target.ownerDocument == document) {
+						// Check to make sure we have a valid selection don't update the bookmark if it's
+						// a focusin to the body of the editor see #7025
+						if (activeEditor.selection && e.target != activeEditor.getBody()) {
+							activeEditor.selection.lastFocusBookmark = createBookmark(activeEditor.dom, activeEditor.lastRng);
+						}
+
+						// Fire a blur event if the element isn't a UI element
+						if (e.target != document.body && !isUIElement(e.target) && editorManager.focusedEditor == activeEditor) {
+							activeEditor.fire('blur', {focusedEditor: null});
+							editorManager.focusedEditor = null;
+						}
+					}
+				};
+
+				DOM.bind(document, 'focusin', documentFocusInHandler);
+			}
+
+			// Handle edge case when user starts the selection inside the editor and releases
+			// the mouse outside the editor producing a new selection. This weird workaround is needed since
+			// Gecko doesn't have the "selectionchange" event we need to do this. Fixes: #6843
+			if (editor.inline && !documentMouseUpHandler) {
+				documentMouseUpHandler = function(e) {
+					var activeEditor = editorManager.activeEditor;
+
+					if (activeEditor.inline && !activeEditor.dom.isChildOf(e.target, activeEditor.getBody())) {
+						var rng = activeEditor.selection.getRng();
+
+						if (!rng.collapsed) {
+							activeEditor.lastRng = rng;
+						}
+					}
+				};
+
+				DOM.bind(document, 'mouseup', documentMouseUpHandler);
+			}
+		}
+
+		function unregisterDocumentEvents(e) {
+			if (editorManager.focusedEditor == e.editor) {
+				editorManager.focusedEditor = null;
+			}
+
+			if (!editorManager.activeEditor) {
+				DOM.unbind(document, 'selectionchange', selectionChangeHandler);
+				DOM.unbind(document, 'focusin', documentFocusInHandler);
+				DOM.unbind(document, 'mouseup', documentMouseUpHandler);
+				selectionChangeHandler = documentFocusInHandler = documentMouseUpHandler = null;
+			}
+		}
+
+		editorManager.on('AddEditor', registerEvents);
+		editorManager.on('RemoveEditor', unregisterDocumentEvents);
+	}
+
+	/**
+	 * Returns true if the specified element is part of the UI for example an button or text input.
+	 *
+	 * @method isEditorUIElement
+	 * @param  {Element} elm Element to check if it's part of the UI or not.
+	 * @return {Boolean} True/false state if the element is part of the UI or not.
+	 */
+	FocusManager.isEditorUIElement = function(elm) {
+		// Needs to be converted to string since svg can have focus: #6776
+		return elm.className.toString().indexOf('mce-') !== -1;
+	};
+
+	return FocusManager;
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ForceBlocks.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,132 @@
+/**
+ * ForceBlocks.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+define("tinymce/ForceBlocks", [], function() {
+	return function(editor) {
+		var settings = editor.settings, dom = editor.dom, selection = editor.selection;
+		var schema = editor.schema, blockElements = schema.getBlockElements();
+
+		function addRootBlocks() {
+			var node = selection.getStart(), rootNode = editor.getBody(), rng;
+			var startContainer, startOffset, endContainer, endOffset, rootBlockNode;
+			var tempNode, offset = -0xFFFFFF, wrapped, restoreSelection;
+			var tmpRng, rootNodeName, forcedRootBlock;
+
+			forcedRootBlock = settings.forced_root_block;
+
+			if (!node || node.nodeType !== 1 || !forcedRootBlock) {
+				return;
+			}
+
+			// Check if node is wrapped in block
+			while (node && node != rootNode) {
+				if (blockElements[node.nodeName]) {
+					return;
+				}
+
+				node = node.parentNode;
+			}
+
+			// Get current selection
+			rng = selection.getRng();
+			if (rng.setStart) {
+				startContainer = rng.startContainer;
+				startOffset = rng.startOffset;
+				endContainer = rng.endContainer;
+				endOffset = rng.endOffset;
+
+				try {
+					restoreSelection = editor.getDoc().activeElement === rootNode;
+				} catch (ex) {
+					// IE throws unspecified error here sometimes
+				}
+			} else {
+				// Force control range into text range
+				if (rng.item) {
+					node = rng.item(0);
+					rng = editor.getDoc().body.createTextRange();
+					rng.moveToElementText(node);
+				}
+
+				restoreSelection = rng.parentElement().ownerDocument === editor.getDoc();
+				tmpRng = rng.duplicate();
+				tmpRng.collapse(true);
+				startOffset = tmpRng.move('character', offset) * -1;
+
+				if (!tmpRng.collapsed) {
+					tmpRng = rng.duplicate();
+					tmpRng.collapse(false);
+					endOffset = (tmpRng.move('character', offset) * -1) - startOffset;
+				}
+			}
+
+			// Wrap non block elements and text nodes
+			node = rootNode.firstChild;
+			rootNodeName = rootNode.nodeName.toLowerCase();
+			while (node) {
+				// TODO: Break this up, too complex
+				if (((node.nodeType === 3 || (node.nodeType == 1 && !blockElements[node.nodeName]))) &&
+					schema.isValidChild(rootNodeName, forcedRootBlock.toLowerCase())) {
+					// Remove empty text nodes
+					if (node.nodeType === 3 && node.nodeValue.length === 0) {
+						tempNode = node;
+						node = node.nextSibling;
+						dom.remove(tempNode);
+						continue;
+					}
+
+					if (!rootBlockNode) {
+						rootBlockNode = dom.create(forcedRootBlock, editor.settings.forced_root_block_attrs);
+						node.parentNode.insertBefore(rootBlockNode, node);
+						wrapped = true;
+					}
+
+					tempNode = node;
+					node = node.nextSibling;
+					rootBlockNode.appendChild(tempNode);
+				} else {
+					rootBlockNode = null;
+					node = node.nextSibling;
+				}
+			}
+
+			if (wrapped && restoreSelection) {
+				if (rng.setStart) {
+					rng.setStart(startContainer, startOffset);
+					rng.setEnd(endContainer, endOffset);
+					selection.setRng(rng);
+				} else {
+					// Only select if the previous selection was inside the document to prevent auto focus in quirks mode
+					try {
+						rng = editor.getDoc().body.createTextRange();
+						rng.moveToElementText(rootNode);
+						rng.collapse(true);
+						rng.moveStart('character', startOffset);
+
+						if (endOffset > 0) {
+							rng.moveEnd('character', endOffset);
+						}
+
+						rng.select();
+					} catch (ex) {
+						// Ignore
+					}
+				}
+
+				editor.nodeChanged();
+			}
+		}
+
+		// Force root blocks
+		if (settings.forced_root_block) {
+			editor.on('NodeChange', addRootBlocks);
+		}
+	};
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/Formatter.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,2330 @@
+/**
+ * Formatter.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Text formatter engine class. This class is used to apply formats like bold, italic, font size
+ * etc to the current selection or specific nodes. This engine was build to replace the browsers
+ * default formatting logic for execCommand due to it's inconsistent and buggy behavior.
+ *
+ * @class tinymce.Formatter
+ * @example
+ *  tinymce.activeEditor.formatter.register('mycustomformat', {
+ *    inline: 'span',
+ *    styles: {color: '#ff0000'}
+ *  });
+ *
+ *  tinymce.activeEditor.formatter.apply('mycustomformat');
+ */
+define("tinymce/Formatter", [
+	"tinymce/dom/TreeWalker",
+	"tinymce/dom/RangeUtils",
+	"tinymce/dom/BookmarkManager",
+	"tinymce/dom/ElementUtils",
+	"tinymce/util/Tools",
+	"tinymce/fmt/Preview"
+], function(TreeWalker, RangeUtils, BookmarkManager, ElementUtils, Tools, Preview) {
+	/**
+	 * Constructs a new formatter instance.
+	 *
+	 * @constructor Formatter
+	 * @param {tinymce.Editor} ed Editor instance to construct the formatter engine to.
+	 */
+	return function(ed) {
+		var formats = {},
+			dom = ed.dom,
+			selection = ed.selection,
+			rangeUtils = new RangeUtils(dom),
+			isValid = ed.schema.isValidChild,
+			isBlock = dom.isBlock,
+			forcedRootBlock = ed.settings.forced_root_block,
+			nodeIndex = dom.nodeIndex,
+			INVISIBLE_CHAR = '\uFEFF',
+			MCE_ATTR_RE = /^(src|href|style)$/,
+			FALSE = false,
+			TRUE = true,
+			formatChangeData,
+			undef,
+			getContentEditable = dom.getContentEditable,
+			disableCaretContainer,
+			markCaretContainersBogus,
+			isBookmarkNode = BookmarkManager.isBookmarkNode;
+
+		var each = Tools.each,
+			grep = Tools.grep,
+			walk = Tools.walk,
+			extend = Tools.extend;
+
+		function isTextBlock(name) {
+			if (name.nodeType) {
+				name = name.nodeName;
+			}
+
+			return !!ed.schema.getTextBlockElements()[name.toLowerCase()];
+		}
+
+		function isTableCell(node) {
+			return /^(TH|TD)$/.test(node.nodeName);
+		}
+
+		function getParents(node, selector) {
+			return dom.getParents(node, selector, dom.getRoot());
+		}
+
+		function isCaretNode(node) {
+			return node.nodeType === 1 && node.id === '_mce_caret';
+		}
+
+		function defaultFormats() {
+			register({
+				valigntop: [
+					{selector: 'td,th', styles: {'verticalAlign': 'top'}}
+				],
+
+				valignmiddle: [
+					{selector: 'td,th', styles: {'verticalAlign': 'middle'}}
+				],
+
+				valignbottom: [
+					{selector: 'td,th', styles: {'verticalAlign': 'bottom'}}
+				],
+
+				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: false, 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: false, styles: {display: 'block', marginLeft: 'auto', marginRight: 'auto'}},
+					{selector: 'table', collapsed: false, 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: false, 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: true},
+					{inline: 'u', remove: 'all'}
+				],
+
+				strikethrough: [
+					{inline: 'span', styles: {textDecoration: 'line-through'}, exact: true},
+					{inline: 'strike', remove: 'all'}
+				],
+
+				forecolor: {inline: 'span', styles: {color: '%value'}, links: true, remove_similar: true},
+				hilitecolor: {inline: 'span', styles: {backgroundColor: '%value'}, links: true, remove_similar: true},
+				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: true, deep: true,
+					onmatch: function() {
+						return true;
+					},
+
+					onformat: function(elm, fmt, vars) {
+						each(vars, function(value, key) {
+							dom.setAttrib(elm, key, value);
+						});
+					}
+				},
+
+				removeformat: [
+					{
+						selector: 'b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins',
+						remove: 'all',
+						split: true,
+						expand: false,
+						block_expand: true,
+						deep: true
+					},
+					{selector: 'span', attributes: ['style', 'class'], remove: 'empty', split: true, expand: false, deep: true},
+					{selector: '*', attributes: ['style', 'class'], split: false, expand: false, deep: true}
+				]
+			});
+
+			// Register default block formats
+			each('p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp'.split(/\s/), function(name) {
+				register(name, {block: name, remove: 'all'});
+			});
+
+			// Register user defined formats
+			register(ed.settings.formats);
+		}
+
+		function addKeyboardShortcuts() {
+			// Add some inline shortcuts
+			ed.addShortcut('meta+b', 'bold_desc', 'Bold');
+			ed.addShortcut('meta+i', 'italic_desc', 'Italic');
+			ed.addShortcut('meta+u', 'underline_desc', 'Underline');
+
+			// BlockFormat shortcuts keys
+			for (var i = 1; i <= 6; i++) {
+				ed.addShortcut('access+' + i, '', ['FormatBlock', false, 'h' + i]);
+			}
+
+			ed.addShortcut('access+7', '', ['FormatBlock', false, 'p']);
+			ed.addShortcut('access+8', '', ['FormatBlock', false, 'div']);
+			ed.addShortcut('access+9', '', ['FormatBlock', false, 'address']);
+		}
+
+		// Public functions
+
+		/**
+		 * Returns the format by name or all formats if no name is specified.
+		 *
+		 * @method get
+		 * @param {String} name Optional name to retrive by.
+		 * @return {Array/Object} Array/Object with all registred formats or a specific format.
+		 */
+		function get(name) {
+			return name ? formats[name] : formats;
+		}
+
+		/**
+		 * Registers a specific format by name.
+		 *
+		 * @method register
+		 * @param {Object/String} name Name of the format for example "bold".
+		 * @param {Object/Array} format Optional format object or array of format variants
+		 * can only be omitted if the first arg is an object.
+		 */
+		function register(name, format) {
+			if (name) {
+				if (typeof name !== 'string') {
+					each(name, function(format, name) {
+						register(name, format);
+					});
+				} else {
+					// Force format into array and add it to internal collection
+					format = format.length ? format : [format];
+
+					each(format, function(format) {
+						// Set deep to false by default on selector formats this to avoid removing
+						// alignment on images inside paragraphs when alignment is changed on paragraphs
+						if (format.deep === undef) {
+							format.deep = !format.selector;
+						}
+
+						// Default to true
+						if (format.split === undef) {
+							format.split = !format.selector || format.inline;
+						}
+
+						// Default to true
+						if (format.remove === undef && format.selector && !format.inline) {
+							format.remove = 'none';
+						}
+
+						// Mark format as a mixed format inline + block level
+						if (format.selector && format.inline) {
+							format.mixed = true;
+							format.block_expand = true;
+						}
+
+						// Split classes if needed
+						if (typeof format.classes === 'string') {
+							format.classes = format.classes.split(/\s+/);
+						}
+					});
+
+					formats[name] = format;
+				}
+			}
+		}
+
+		/**
+		 * Unregister a specific format by name.
+		 *
+		 * @method unregister
+		 * @param {String} name Name of the format for example "bold".
+		 */
+		function unregister(name) {
+			if (name && formats[name]) {
+				delete formats[name];
+			}
+
+			return formats;
+		}
+
+		function getTextDecoration(node) {
+			var decoration;
+
+			ed.dom.getParent(node, function(n) {
+				decoration = ed.dom.getStyle(n, 'text-decoration');
+				return decoration && decoration !== 'none';
+			});
+
+			return decoration;
+		}
+
+		function processUnderlineAndColor(node) {
+			var textDecoration;
+			if (node.nodeType === 1 && node.parentNode && node.parentNode.nodeType === 1) {
+				textDecoration = getTextDecoration(node.parentNode);
+				if (ed.dom.getStyle(node, 'color') && textDecoration) {
+					ed.dom.setStyle(node, 'text-decoration', textDecoration);
+				} else if (ed.dom.getStyle(node, 'text-decoration') === textDecoration) {
+					ed.dom.setStyle(node, 'text-decoration', null);
+				}
+			}
+		}
+
+		/**
+		 * Applies the specified format to the current selection or specified node.
+		 *
+		 * @method apply
+		 * @param {String} name Name of format to apply.
+		 * @param {Object} vars Optional list of variables to replace within format before applying it.
+		 * @param {Node} node Optional node to apply the format to defaults to current selection.
+		 */
+		function apply(name, vars, node) {
+			var formatList = get(name), format = formatList[0], bookmark, rng, isCollapsed = !node && selection.isCollapsed();
+
+			function setElementFormat(elm, fmt) {
+				fmt = fmt || format;
+
+				if (elm) {
+					if (fmt.onformat) {
+						fmt.onformat(elm, fmt, vars, node);
+					}
+
+					each(fmt.styles, function(value, name) {
+						dom.setStyle(elm, name, replaceVars(value, vars));
+					});
+
+					// Needed for the WebKit span spam bug
+					// TODO: Remove this once WebKit/Blink fixes this
+					if (fmt.styles) {
+						var styleVal = dom.getAttrib(elm, 'style');
+
+						if (styleVal) {
+							elm.setAttribute('data-mce-style', styleVal);
+						}
+					}
+
+					each(fmt.attributes, function(value, name) {
+						dom.setAttrib(elm, name, replaceVars(value, vars));
+					});
+
+					each(fmt.classes, function(value) {
+						value = replaceVars(value, vars);
+
+						if (!dom.hasClass(elm, value)) {
+							dom.addClass(elm, value);
+						}
+					});
+				}
+			}
+
+			function adjustSelectionToVisibleSelection() {
+				function findSelectionEnd(start, end) {
+					var walker = new TreeWalker(end);
+					for (node = walker.current(); node; node = walker.prev()) {
+						if (node.childNodes.length > 1 || node == start || node.tagName == 'BR') {
+							return node;
+						}
+					}
+				}
+
+				// Adjust selection so that a end container with a end offset of zero is not included in the selection
+				// as this isn't visible to the user.
+				var rng = ed.selection.getRng();
+				var start = rng.startContainer;
+				var end = rng.endContainer;
+
+				if (start != end && rng.endOffset === 0) {
+					var newEnd = findSelectionEnd(start, end);
+					var endOffset = newEnd.nodeType == 3 ? newEnd.length : newEnd.childNodes.length;
+
+					rng.setEnd(newEnd, endOffset);
+				}
+
+				return rng;
+			}
+
+			function applyRngStyle(rng, bookmark, node_specific) {
+				var newWrappers = [], wrapName, wrapElm, contentEditable = true;
+
+				// Setup wrapper element
+				wrapName = format.inline || format.block;
+				wrapElm = dom.create(wrapName);
+				setElementFormat(wrapElm);
+
+				rangeUtils.walk(rng, function(nodes) {
+					var currentWrapElm;
+
+					/**
+					 * Process a list of nodes wrap them.
+					 */
+					function process(node) {
+						var nodeName, parentName, found, hasContentEditableState, lastContentEditable;
+
+						lastContentEditable = contentEditable;
+						nodeName = node.nodeName.toLowerCase();
+						parentName = node.parentNode.nodeName.toLowerCase();
+
+						// Node has a contentEditable value
+						if (node.nodeType === 1 && getContentEditable(node)) {
+							lastContentEditable = contentEditable;
+							contentEditable = getContentEditable(node) === "true";
+							hasContentEditableState = true; // We don't want to wrap the container only it's children
+						}
+
+						// Stop wrapping on br elements
+						if (isEq(nodeName, 'br')) {
+							currentWrapElm = 0;
+
+							// Remove any br elements when we wrap things
+							if (format.block) {
+								dom.remove(node);
+							}
+
+							return;
+						}
+
+						// If node is wrapper type
+						if (format.wrapper && matchNode(node, name, vars)) {
+							currentWrapElm = 0;
+							return;
+						}
+
+						// Can we rename the block
+						// TODO: Break this if up, too complex
+						if (contentEditable && !hasContentEditableState && format.block &&
+							!format.wrapper && isTextBlock(nodeName) && isValid(parentName, wrapName)) {
+							node = dom.rename(node, wrapName);
+							setElementFormat(node);
+							newWrappers.push(node);
+							currentWrapElm = 0;
+							return;
+						}
+
+						// Handle selector patterns
+						if (format.selector) {
+							// Look for matching formats
+							each(formatList, function(format) {
+								// Check collapsed state if it exists
+								if ('collapsed' in format && format.collapsed !== isCollapsed) {
+									return;
+								}
+
+								if (dom.is(node, format.selector) && !isCaretNode(node)) {
+									setElementFormat(node, format);
+									found = true;
+								}
+							});
+
+							// Continue processing if a selector match wasn't found and a inline element is defined
+							if (!format.inline || found) {
+								currentWrapElm = 0;
+								return;
+							}
+						}
+
+						// Is it valid to wrap this item
+						// TODO: Break this if up, too complex
+						if (contentEditable && !hasContentEditableState && isValid(wrapName, nodeName) && isValid(parentName, wrapName) &&
+								!(!node_specific && node.nodeType === 3 &&
+								node.nodeValue.length === 1 &&
+								node.nodeValue.charCodeAt(0) === 65279) &&
+								!isCaretNode(node) &&
+								(!format.inline || !isBlock(node))) {
+							// Start wrapping
+							if (!currentWrapElm) {
+								// Wrap the node
+								currentWrapElm = dom.clone(wrapElm, FALSE);
+								node.parentNode.insertBefore(currentWrapElm, node);
+								newWrappers.push(currentWrapElm);
+							}
+
+							currentWrapElm.appendChild(node);
+						} else {
+							// Start a new wrapper for possible children
+							currentWrapElm = 0;
+
+							each(grep(node.childNodes), process);
+
+							if (hasContentEditableState) {
+								contentEditable = lastContentEditable; // Restore last contentEditable state from stack
+							}
+
+							// End the last wrapper
+							currentWrapElm = 0;
+						}
+					}
+
+					// Process siblings from range
+					each(nodes, process);
+				});
+
+				// Apply formats to links as well to get the color of the underline to change as well
+				if (format.links === true) {
+					each(newWrappers, function(node) {
+						function process(node) {
+							if (node.nodeName === 'A') {
+								setElementFormat(node, format);
+							}
+
+							each(grep(node.childNodes), process);
+						}
+
+						process(node);
+					});
+				}
+
+				// Cleanup
+				each(newWrappers, function(node) {
+					var childCount;
+
+					function getChildCount(node) {
+						var count = 0;
+
+						each(node.childNodes, function(node) {
+							if (!isWhiteSpaceNode(node) && !isBookmarkNode(node)) {
+								count++;
+							}
+						});
+
+						return count;
+					}
+
+					function mergeStyles(node) {
+						var child, clone;
+
+						each(node.childNodes, function(node) {
+							if (node.nodeType == 1 && !isBookmarkNode(node) && !isCaretNode(node)) {
+								child = node;
+								return FALSE; // break loop
+							}
+						});
+
+						// If child was found and of the same type as the current node
+						if (child && !isBookmarkNode(child) && matchName(child, format)) {
+							clone = dom.clone(child, FALSE);
+							setElementFormat(clone);
+
+							dom.replace(clone, node, TRUE);
+							dom.remove(child, 1);
+						}
+
+						return clone || node;
+					}
+
+					childCount = getChildCount(node);
+
+					// Remove empty nodes but only if there is multiple wrappers and they are not block
+					// elements so never remove single <h1></h1> since that would remove the
+					// currrent empty block element where the caret is at
+					if ((newWrappers.length > 1 || !isBlock(node)) && childCount === 0) {
+						dom.remove(node, 1);
+						return;
+					}
+
+					if (format.inline || format.wrapper) {
+						// Merges the current node with it's children of similar type to reduce the number of elements
+						if (!format.exact && childCount === 1) {
+							node = mergeStyles(node);
+						}
+
+						// Remove/merge children
+						each(formatList, function(format) {
+							// Merge all children of similar type will move styles from child to parent
+							// this: <span style="color:red"><b><span style="color:red; font-size:10px">text</span></b></span>
+							// will become: <span style="color:red"><b><span style="font-size:10px">text</span></b></span>
+							each(dom.select(format.inline, node), function(child) {
+								if (isBookmarkNode(child)) {
+									return;
+								}
+
+								removeFormat(format, vars, child, format.exact ? child : null);
+							});
+						});
+
+						// Remove child if direct parent is of same type
+						if (matchNode(node.parentNode, name, vars)) {
+							dom.remove(node, 1);
+							node = 0;
+							return TRUE;
+						}
+
+						// Look for parent with similar style format
+						if (format.merge_with_parents) {
+							dom.getParent(node.parentNode, function(parent) {
+								if (matchNode(parent, name, vars)) {
+									dom.remove(node, 1);
+									node = 0;
+									return TRUE;
+								}
+							});
+						}
+
+						// Merge next and previous siblings if they are similar <b>text</b><b>text</b> becomes <b>texttext</b>
+						if (node && format.merge_siblings !== false) {
+							node = mergeSiblings(getNonWhiteSpaceSibling(node), node);
+							node = mergeSiblings(node, getNonWhiteSpaceSibling(node, TRUE));
+						}
+					}
+				});
+			}
+
+			if (format) {
+				if (node) {
+					if (node.nodeType) {
+						rng = dom.createRng();
+						rng.setStartBefore(node);
+						rng.setEndAfter(node);
+						applyRngStyle(expandRng(rng, formatList), null, true);
+					} else {
+						applyRngStyle(node, null, true);
+					}
+				} else {
+					if (!isCollapsed || !format.inline || dom.select('td.mce-item-selected,th.mce-item-selected').length) {
+						// Obtain selection node before selection is unselected by applyRngStyle()
+						var curSelNode = ed.selection.getNode();
+
+						// If the formats have a default block and we can't find a parent block then
+						// start wrapping it with a DIV this is for forced_root_blocks: false
+						// It's kind of a hack but people should be using the default block type P since all desktop editors work that way
+						if (!forcedRootBlock && formatList[0].defaultBlock && !dom.getParent(curSelNode, dom.isBlock)) {
+							apply(formatList[0].defaultBlock);
+						}
+
+						// Apply formatting to selection
+						ed.selection.setRng(adjustSelectionToVisibleSelection());
+						bookmark = selection.getBookmark();
+						applyRngStyle(expandRng(selection.getRng(TRUE), formatList), bookmark);
+
+						// Colored nodes should be underlined so that the color of the underline matches the text color.
+						if (format.styles && (format.styles.color || format.styles.textDecoration)) {
+							walk(curSelNode, processUnderlineAndColor, 'childNodes');
+							processUnderlineAndColor(curSelNode);
+						}
+
+						selection.moveToBookmark(bookmark);
+						moveStart(selection.getRng(TRUE));
+						ed.nodeChanged();
+					} else {
+						performCaretAction('apply', name, vars);
+					}
+				}
+			}
+		}
+
+		/**
+		 * Removes the specified format from the current selection or specified node.
+		 *
+		 * @method remove
+		 * @param {String} name Name of format to remove.
+		 * @param {Object} vars Optional list of variables to replace within format before removing it.
+		 * @param {Node/Range} node Optional node or DOM range to remove the format from defaults to current selection.
+		 */
+		function remove(name, vars, node, similar) {
+			var formatList = get(name), format = formatList[0], bookmark, rng, contentEditable = true;
+
+			// Merges the styles for each node
+			function process(node) {
+				var children, i, l, lastContentEditable, hasContentEditableState;
+
+				// Node has a contentEditable value
+				if (node.nodeType === 1 && getContentEditable(node)) {
+					lastContentEditable = contentEditable;
+					contentEditable = getContentEditable(node) === "true";
+					hasContentEditableState = true; // We don't want to wrap the container only it's children
+				}
+
+				// Grab the children first since the nodelist might be changed
+				children = grep(node.childNodes);
+
+				// Process current node
+				if (contentEditable && !hasContentEditableState) {
+					for (i = 0, l = formatList.length; i < l; i++) {
+						if (removeFormat(formatList[i], vars, node, node)) {
+							break;
+						}
+					}
+				}
+
+				// Process the children
+				if (format.deep) {
+					if (children.length) {
+						for (i = 0, l = children.length; i < l; i++) {
+							process(children[i]);
+						}
+
+						if (hasContentEditableState) {
+							contentEditable = lastContentEditable; // Restore last contentEditable state from stack
+						}
+					}
+				}
+			}
+
+			function findFormatRoot(container) {
+				var formatRoot;
+
+				// Find format root
+				each(getParents(container.parentNode).reverse(), function(parent) {
+					var format;
+
+					// Find format root element
+					if (!formatRoot && parent.id != '_start' && parent.id != '_end') {
+						// Is the node matching the format we are looking for
+						format = matchNode(parent, name, vars, similar);
+						if (format && format.split !== false) {
+							formatRoot = parent;
+						}
+					}
+				});
+
+				return formatRoot;
+			}
+
+			function wrapAndSplit(formatRoot, container, target, split) {
+				var parent, clone, lastClone, firstClone, i, formatRootParent;
+
+				// Format root found then clone formats and split it
+				if (formatRoot) {
+					formatRootParent = formatRoot.parentNode;
+
+					for (parent = container.parentNode; parent && parent != formatRootParent; parent = parent.parentNode) {
+						clone = dom.clone(parent, FALSE);
+
+						for (i = 0; i < formatList.length; i++) {
+							if (removeFormat(formatList[i], vars, clone, clone)) {
+								clone = 0;
+								break;
+							}
+						}
+
+						// Build wrapper node
+						if (clone) {
+							if (lastClone) {
+								clone.appendChild(lastClone);
+							}
+
+							if (!firstClone) {
+								firstClone = clone;
+							}
+
+							lastClone = clone;
+						}
+					}
+
+					// Never split block elements if the format is mixed
+					if (split && (!format.mixed || !isBlock(formatRoot))) {
+						container = dom.split(formatRoot, container);
+					}
+
+					// Wrap container in cloned formats
+					if (lastClone) {
+						target.parentNode.insertBefore(lastClone, target);
+						firstClone.appendChild(target);
+					}
+				}
+
+				return container;
+			}
+
+			function splitToFormatRoot(container) {
+				return wrapAndSplit(findFormatRoot(container), container, container, true);
+			}
+
+			function unwrap(start) {
+				var node = dom.get(start ? '_start' : '_end'),
+					out = node[start ? 'firstChild' : 'lastChild'];
+
+				// If the end is placed within the start the result will be removed
+				// So this checks if the out node is a bookmark node if it is it
+				// checks for another more suitable node
+				if (isBookmarkNode(out)) {
+					out = out[start ? 'firstChild' : 'lastChild'];
+				}
+
+				// Since dom.remove removes empty text nodes then we need to try to find a better node
+				if (out.nodeType == 3 && out.data.length === 0) {
+					out = start ? node.previousSibling || node.nextSibling : node.nextSibling || node.previousSibling;
+				}
+
+				dom.remove(node, true);
+
+				return out;
+			}
+
+			function removeRngStyle(rng) {
+				var startContainer, endContainer;
+				var commonAncestorContainer = rng.commonAncestorContainer;
+
+				rng = expandRng(rng, formatList, TRUE);
+
+				if (format.split) {
+					startContainer = getContainer(rng, TRUE);
+					endContainer = getContainer(rng);
+
+					if (startContainer != endContainer) {
+						// WebKit will render the table incorrectly if we wrap a TH or TD in a SPAN
+						// so let's see if we can use the first child instead
+						// This will happen if you triple click a table cell and use remove formatting
+						if (/^(TR|TH|TD)$/.test(startContainer.nodeName) && startContainer.firstChild) {
+							if (startContainer.nodeName == "TR") {
+								startContainer = startContainer.firstChild.firstChild || startContainer;
+							} else {
+								startContainer = startContainer.firstChild || startContainer;
+							}
+						}
+
+						// Try to adjust endContainer as well if cells on the same row were selected - bug #6410
+						if (commonAncestorContainer &&
+							/^T(HEAD|BODY|FOOT|R)$/.test(commonAncestorContainer.nodeName) &&
+							isTableCell(endContainer) && endContainer.firstChild) {
+							endContainer = endContainer.firstChild || endContainer;
+						}
+
+						if (dom.isChildOf(startContainer, endContainer) && !isTableCell(startContainer) && !isTableCell(endContainer)) {
+							startContainer = wrap(startContainer, 'span', {id: '_start', 'data-mce-type': 'bookmark'});
+							splitToFormatRoot(startContainer);
+							startContainer = unwrap(TRUE);
+							return;
+						} else {
+							// Wrap start/end nodes in span element since these might be cloned/moved
+							startContainer = wrap(startContainer, 'span', {id: '_start', 'data-mce-type': 'bookmark'});
+							endContainer = wrap(endContainer, 'span', {id: '_end', 'data-mce-type': 'bookmark'});
+
+							// Split start/end
+							splitToFormatRoot(startContainer);
+							splitToFormatRoot(endContainer);
+
+							// Unwrap start/end to get real elements again
+							startContainer = unwrap(TRUE);
+							endContainer = unwrap();
+						}
+					} else {
+						startContainer = endContainer = splitToFormatRoot(startContainer);
+					}
+
+					// Update range positions since they might have changed after the split operations
+					rng.startContainer = startContainer.parentNode ? startContainer.parentNode : startContainer;
+					rng.startOffset = nodeIndex(startContainer);
+					rng.endContainer = endContainer.parentNode ? endContainer.parentNode : endContainer;
+					rng.endOffset = nodeIndex(endContainer) + 1;
+				}
+
+				// Remove items between start/end
+				rangeUtils.walk(rng, function(nodes) {
+					each(nodes, function(node) {
+						process(node);
+
+						// Remove parent span if it only contains text-decoration: underline, yet a parent node is also underlined.
+						if (node.nodeType === 1 && ed.dom.getStyle(node, 'text-decoration') === 'underline' &&
+							node.parentNode && getTextDecoration(node.parentNode) === 'underline') {
+							removeFormat({
+								'deep': false,
+								'exact': true,
+								'inline': 'span',
+								'styles': {
+									'textDecoration': 'underline'
+								}
+							}, null, node);
+						}
+					});
+				});
+			}
+
+			// Handle node
+			if (node) {
+				if (node.nodeType) {
+					rng = dom.createRng();
+					rng.setStartBefore(node);
+					rng.setEndAfter(node);
+					removeRngStyle(rng);
+				} else {
+					removeRngStyle(node);
+				}
+
+				return;
+			}
+
+			if (!selection.isCollapsed() || !format.inline || dom.select('td.mce-item-selected,th.mce-item-selected').length) {
+				bookmark = selection.getBookmark();
+				removeRngStyle(selection.getRng(TRUE));
+				selection.moveToBookmark(bookmark);
+
+				// Check if start element still has formatting then we are at: "<b>text|</b>text"
+				// and need to move the start into the next text node
+				if (format.inline && match(name, vars, selection.getStart())) {
+					moveStart(selection.getRng(true));
+				}
+
+				ed.nodeChanged();
+			} else {
+				performCaretAction('remove', name, vars, similar);
+			}
+		}
+
+		/**
+		 * Toggles the specified format on/off.
+		 *
+		 * @method toggle
+		 * @param {String} name Name of format to apply/remove.
+		 * @param {Object} vars Optional list of variables to replace within format before applying/removing it.
+		 * @param {Node} node Optional node to apply the format to or remove from. Defaults to current selection.
+		 */
+		function toggle(name, vars, node) {
+			var fmt = get(name);
+
+			if (match(name, vars, node) && (!('toggle' in fmt[0]) || fmt[0].toggle)) {
+				remove(name, vars, node);
+			} else {
+				apply(name, vars, node);
+			}
+		}
+
+		/**
+		 * Return true/false if the specified node has the specified format.
+		 *
+		 * @method matchNode
+		 * @param {Node} node Node to check the format on.
+		 * @param {String} name Format name to check.
+		 * @param {Object} vars Optional list of variables to replace before checking it.
+		 * @param {Boolean} similar Match format that has similar properties.
+		 * @return {Object} Returns the format object it matches or undefined if it doesn't match.
+		 */
+		function matchNode(node, name, vars, similar) {
+			var formatList = get(name), format, i, classes;
+
+			function matchItems(node, format, item_name) {
+				var key, value, items = format[item_name], i;
+
+				// Custom match
+				if (format.onmatch) {
+					return format.onmatch(node, format, item_name);
+				}
+
+				// Check all items
+				if (items) {
+					// Non indexed object
+					if (items.length === undef) {
+						for (key in items) {
+							if (items.hasOwnProperty(key)) {
+								if (item_name === 'attributes') {
+									value = dom.getAttrib(node, key);
+								} else {
+									value = getStyle(node, key);
+								}
+
+								if (similar && !value && !format.exact) {
+									return;
+								}
+
+								if ((!similar || format.exact) && !isEq(value, normalizeStyleValue(replaceVars(items[key], vars), key))) {
+									return;
+								}
+							}
+						}
+					} else {
+						// Only one match needed for indexed arrays
+						for (i = 0; i < items.length; i++) {
+							if (item_name === 'attributes' ? dom.getAttrib(node, items[i]) : getStyle(node, items[i])) {
+								return format;
+							}
+						}
+					}
+				}
+
+				return format;
+			}
+
+			if (formatList && node) {
+				// Check each format in list
+				for (i = 0; i < formatList.length; i++) {
+					format = formatList[i];
+
+					// Name name, attributes, styles and classes
+					if (matchName(node, format) && matchItems(node, format, 'attributes') && matchItems(node, format, 'styles')) {
+						// Match classes
+						if ((classes = format.classes)) {
+							for (i = 0; i < classes.length; i++) {
+								if (!dom.hasClass(node, classes[i])) {
+									return;
+								}
+							}
+						}
+
+						return format;
+					}
+				}
+			}
+		}
+
+		/**
+		 * Matches the current selection or specified node against the specified format name.
+		 *
+		 * @method match
+		 * @param {String} name Name of format to match.
+		 * @param {Object} vars Optional list of variables to replace before checking it.
+		 * @param {Node} node Optional node to check.
+		 * @return {boolean} true/false if the specified selection/node matches the format.
+		 */
+		function match(name, vars, node) {
+			var startNode;
+
+			function matchParents(node) {
+				var root = dom.getRoot();
+
+				if (node === root) {
+					return false;
+				}
+
+				// Find first node with similar format settings
+				node = dom.getParent(node, function(node) {
+					return node.parentNode === root || !!matchNode(node, name, vars, true);
+				});
+
+				// Do an exact check on the similar format element
+				return matchNode(node, name, vars);
+			}
+
+			// Check specified node
+			if (node) {
+				return matchParents(node);
+			}
+
+			// Check selected node
+			node = selection.getNode();
+			if (matchParents(node)) {
+				return TRUE;
+			}
+
+			// Check start node if it's different
+			startNode = selection.getStart();
+			if (startNode != node) {
+				if (matchParents(startNode)) {
+					return TRUE;
+				}
+			}
+
+			return FALSE;
+		}
+
+		/**
+		 * Matches the current selection against the array of formats and returns a new array with matching formats.
+		 *
+		 * @method matchAll
+		 * @param {Array} names Name of format to match.
+		 * @param {Object} vars Optional list of variables to replace before checking it.
+		 * @return {Array} Array with matched formats.
+		 */
+		function matchAll(names, vars) {
+			var startElement, matchedFormatNames = [], checkedMap = {};
+
+			// Check start of selection for formats
+			startElement = selection.getStart();
+			dom.getParent(startElement, function(node) {
+				var i, name;
+
+				for (i = 0; i < names.length; i++) {
+					name = names[i];
+
+					if (!checkedMap[name] && matchNode(node, name, vars)) {
+						checkedMap[name] = true;
+						matchedFormatNames.push(name);
+					}
+				}
+			}, dom.getRoot());
+
+			return matchedFormatNames;
+		}
+
+		/**
+		 * Returns true/false if the specified format can be applied to the current selection or not. It
+		 * will currently only check the state for selector formats, it returns true on all other format types.
+		 *
+		 * @method canApply
+		 * @param {String} name Name of format to check.
+		 * @return {boolean} true/false if the specified format can be applied to the current selection/node.
+		 */
+		function canApply(name) {
+			var formatList = get(name), startNode, parents, i, x, selector;
+
+			if (formatList) {
+				startNode = selection.getStart();
+				parents = getParents(startNode);
+
+				for (x = formatList.length - 1; x >= 0; x--) {
+					selector = formatList[x].selector;
+
+					// Format is not selector based then always return TRUE
+					// Is it has a defaultBlock then it's likely it can be applied for example align on a non block element line
+					if (!selector || formatList[x].defaultBlock) {
+						return TRUE;
+					}
+
+					for (i = parents.length - 1; i >= 0; i--) {
+						if (dom.is(parents[i], selector)) {
+							return TRUE;
+						}
+					}
+				}
+			}
+
+			return FALSE;
+		}
+
+		/**
+		 * Executes the specified callback when the current selection matches the formats or not.
+		 *
+		 * @method formatChanged
+		 * @param {String} formats Comma separated list of formats to check for.
+		 * @param {function} callback Callback with state and args when the format is changed/toggled on/off.
+		 * @param {Boolean} similar True/false state if the match should handle similar or exact formats.
+		 */
+		function formatChanged(formats, callback, similar) {
+			var currentFormats;
+
+			// Setup format node change logic
+			if (!formatChangeData) {
+				formatChangeData = {};
+				currentFormats = {};
+
+				ed.on('NodeChange', function(e) {
+					var parents = getParents(e.element), matchedFormats = {};
+
+					// Ignore bogus nodes like the <a> tag created by moveStart()
+					parents = Tools.grep(parents, function(node) {
+						return node.nodeType == 1 && !node.getAttribute('data-mce-bogus');
+					});
+
+					// Check for new formats
+					each(formatChangeData, function(callbacks, format) {
+						each(parents, function(node) {
+							if (matchNode(node, format, {}, callbacks.similar)) {
+								if (!currentFormats[format]) {
+									// Execute callbacks
+									each(callbacks, function(callback) {
+										callback(true, {node: node, format: format, parents: parents});
+									});
+
+									currentFormats[format] = callbacks;
+								}
+
+								matchedFormats[format] = callbacks;
+								return false;
+							}
+						});
+					});
+
+					// Check if current formats still match
+					each(currentFormats, function(callbacks, format) {
+						if (!matchedFormats[format]) {
+							delete currentFormats[format];
+
+							each(callbacks, function(callback) {
+								callback(false, {node: e.element, format: format, parents: parents});
+							});
+						}
+					});
+				});
+			}
+
+			// Add format listeners
+			each(formats.split(','), function(format) {
+				if (!formatChangeData[format]) {
+					formatChangeData[format] = [];
+					formatChangeData[format].similar = similar;
+				}
+
+				formatChangeData[format].push(callback);
+			});
+
+			return this;
+		}
+
+		/**
+		 * Returns a preview css text for the specified format.
+		 *
+		 * @method getCssText
+		 * @param {String/Object} format Format to generate preview css text for.
+		 * @return {String} Css text for the specified format.
+		 * @example
+		 * var cssText1 = editor.formatter.getCssText('bold');
+		 * var cssText2 = editor.formatter.getCssText({inline: 'b'});
+		 */
+		function getCssText(format) {
+			return Preview.getCssText(ed, format);
+		}
+
+		// Expose to public
+		extend(this, {
+			get: get,
+			register: register,
+			unregister: unregister,
+			apply: apply,
+			remove: remove,
+			toggle: toggle,
+			match: match,
+			matchAll: matchAll,
+			matchNode: matchNode,
+			canApply: canApply,
+			formatChanged: formatChanged,
+			getCssText: getCssText
+		});
+
+		// Initialize
+		defaultFormats();
+		addKeyboardShortcuts();
+		ed.on('BeforeGetContent', function(e) {
+			if (markCaretContainersBogus && e.format != 'raw') {
+				markCaretContainersBogus();
+			}
+		});
+		ed.on('mouseup keydown', function(e) {
+			if (disableCaretContainer) {
+				disableCaretContainer(e);
+			}
+		});
+
+		// Private functions
+
+		/**
+		 * Checks if the specified nodes name matches the format inline/block or selector.
+		 *
+		 * @private
+		 * @param {Node} node Node to match against the specified format.
+		 * @param {Object} format Format object o match with.
+		 * @return {boolean} true/false if the format matches.
+		 */
+		function matchName(node, format) {
+			// Check for inline match
+			if (isEq(node, format.inline)) {
+				return TRUE;
+			}
+
+			// Check for block match
+			if (isEq(node, format.block)) {
+				return TRUE;
+			}
+
+			// Check for selector match
+			if (format.selector) {
+				return node.nodeType == 1 && dom.is(node, format.selector);
+			}
+		}
+
+		/**
+		 * Compares two string/nodes regardless of their case.
+		 *
+		 * @private
+		 * @param {String/Node} Node or string to compare.
+		 * @param {String/Node} Node or string to compare.
+		 * @return {boolean} True/false if they match.
+		 */
+		function isEq(str1, str2) {
+			str1 = str1 || '';
+			str2 = str2 || '';
+
+			str1 = '' + (str1.nodeName || str1);
+			str2 = '' + (str2.nodeName || str2);
+
+			return str1.toLowerCase() == str2.toLowerCase();
+		}
+
+		/**
+		 * Returns the style by name on the specified node. This method modifies the style
+		 * contents to make it more easy to match. This will resolve a few browser issues.
+		 *
+		 * @private
+		 * @param {Node} node to get style from.
+		 * @param {String} name Style name to get.
+		 * @return {String} Style item value.
+		 */
+		function getStyle(node, name) {
+			return normalizeStyleValue(dom.getStyle(node, name), name);
+		}
+
+		/**
+		 * Normalize style value by name. This method modifies the style contents
+		 * to make it more easy to match. This will resolve a few browser issues.
+		 *
+		 * @private
+		 * @param {Node} node to get style from.
+		 * @param {String} name Style name to get.
+		 * @return {String} Style item value.
+		 */
+		function normalizeStyleValue(value, name) {
+			// Force the format to hex
+			if (name == 'color' || name == 'backgroundColor') {
+				value = dom.toHex(value);
+			}
+
+			// Opera will return bold as 700
+			if (name == 'fontWeight' && value == 700) {
+				value = 'bold';
+			}
+
+			// Normalize fontFamily so "'Font name', Font" becomes: "Font name,Font"
+			if (name == 'fontFamily') {
+				value = value.replace(/[\'\"]/g, '').replace(/,\s+/g, ',');
+			}
+
+			return '' + value;
+		}
+
+		/**
+		 * Replaces variables in the value. The variable format is %var.
+		 *
+		 * @private
+		 * @param {String} value Value to replace variables in.
+		 * @param {Object} vars Name/value array with variables to replace.
+		 * @return {String} New value with replaced variables.
+		 */
+		function replaceVars(value, vars) {
+			if (typeof value != "string") {
+				value = value(vars);
+			} else if (vars) {
+				value = value.replace(/%(\w+)/g, function(str, name) {
+					return vars[name] || str;
+				});
+			}
+
+			return value;
+		}
+
+		function isWhiteSpaceNode(node) {
+			return node && node.nodeType === 3 && /^([\t \r\n]+|)$/.test(node.nodeValue);
+		}
+
+		function wrap(node, name, attrs) {
+			var wrapper = dom.create(name, attrs);
+
+			node.parentNode.insertBefore(wrapper, node);
+			wrapper.appendChild(node);
+
+			return wrapper;
+		}
+
+		/**
+		 * Expands the specified range like object to depending on format.
+		 *
+		 * For example on block formats it will move the start/end position
+		 * to the beginning of the current block.
+		 *
+		 * @private
+		 * @param {Object} rng Range like object.
+		 * @param {Array} formats Array with formats to expand by.
+		 * @return {Object} Expanded range like object.
+		 */
+		function expandRng(rng, format, remove) {
+			var lastIdx, leaf, endPoint,
+				startContainer = rng.startContainer,
+				startOffset = rng.startOffset,
+				endContainer = rng.endContainer,
+				endOffset = rng.endOffset;
+
+			// This function walks up the tree if there is no siblings before/after the node
+			function findParentContainer(start) {
+				var container, parent, sibling, siblingName, root;
+
+				container = parent = start ? startContainer : endContainer;
+				siblingName = start ? 'previousSibling' : 'nextSibling';
+				root = dom.getRoot();
+
+				function isBogusBr(node) {
+					return node.nodeName == "BR" && node.getAttribute('data-mce-bogus') && !node.nextSibling;
+				}
+
+				// If it's a text node and the offset is inside the text
+				if (container.nodeType == 3 && !isWhiteSpaceNode(container)) {
+					if (start ? startOffset > 0 : endOffset < container.nodeValue.length) {
+						return container;
+					}
+				}
+
+				/*eslint no-constant-condition:0 */
+				while (true) {
+					// Stop expanding on block elements
+					if (!format[0].block_expand && isBlock(parent)) {
+						return parent;
+					}
+
+					// Walk left/right
+					for (sibling = parent[siblingName]; sibling; sibling = sibling[siblingName]) {
+						if (!isBookmarkNode(sibling) && !isWhiteSpaceNode(sibling) && !isBogusBr(sibling)) {
+							return parent;
+						}
+					}
+
+					// Check if we can move up are we at root level or body level
+					if (parent.parentNode == root) {
+						container = parent;
+						break;
+					}
+
+					parent = parent.parentNode;
+				}
+
+				return container;
+			}
+
+			// This function walks down the tree to find the leaf at the selection.
+			// The offset is also returned as if node initially a leaf, the offset may be in the middle of the text node.
+			function findLeaf(node, offset) {
+				if (offset === undef) {
+					offset = node.nodeType === 3 ? node.length : node.childNodes.length;
+				}
+
+				while (node && node.hasChildNodes()) {
+					node = node.childNodes[offset];
+					if (node) {
+						offset = node.nodeType === 3 ? node.length : node.childNodes.length;
+					}
+				}
+				return {node: node, offset: offset};
+			}
+
+			// If index based start position then resolve it
+			if (startContainer.nodeType == 1 && startContainer.hasChildNodes()) {
+				lastIdx = startContainer.childNodes.length - 1;
+				startContainer = startContainer.childNodes[startOffset > lastIdx ? lastIdx : startOffset];
+
+				if (startContainer.nodeType == 3) {
+					startOffset = 0;
+				}
+			}
+
+			// If index based end position then resolve it
+			if (endContainer.nodeType == 1 && endContainer.hasChildNodes()) {
+				lastIdx = endContainer.childNodes.length - 1;
+				endContainer = endContainer.childNodes[endOffset > lastIdx ? lastIdx : endOffset - 1];
+
+				if (endContainer.nodeType == 3) {
+					endOffset = endContainer.nodeValue.length;
+				}
+			}
+
+			// Expands the node to the closes contentEditable false element if it exists
+			function findParentContentEditable(node) {
+				var parent = node;
+
+				while (parent) {
+					if (parent.nodeType === 1 && getContentEditable(parent)) {
+						return getContentEditable(parent) === "false" ? parent : node;
+					}
+
+					parent = parent.parentNode;
+				}
+
+				return node;
+			}
+
+			function findWordEndPoint(container, offset, start) {
+				var walker, node, pos, lastTextNode;
+
+				function findSpace(node, offset) {
+					var pos, pos2, str = node.nodeValue;
+
+					if (typeof offset == "undefined") {
+						offset = start ? str.length : 0;
+					}
+
+					if (start) {
+						pos = str.lastIndexOf(' ', offset);
+						pos2 = str.lastIndexOf('\u00a0', offset);
+						pos = pos > pos2 ? pos : pos2;
+
+						// Include the space on remove to avoid tag soup
+						if (pos !== -1 && !remove) {
+							pos++;
+						}
+					} else {
+						pos = str.indexOf(' ', offset);
+						pos2 = str.indexOf('\u00a0', offset);
+						pos = pos !== -1 && (pos2 === -1 || pos < pos2) ? pos : pos2;
+					}
+
+					return pos;
+				}
+
+				if (container.nodeType === 3) {
+					pos = findSpace(container, offset);
+
+					if (pos !== -1) {
+						return {container: container, offset: pos};
+					}
+
+					lastTextNode = container;
+				}
+
+				// Walk the nodes inside the block
+				walker = new TreeWalker(container, dom.getParent(container, isBlock) || ed.getBody());
+				while ((node = walker[start ? 'prev' : 'next']())) {
+					if (node.nodeType === 3) {
+						lastTextNode = node;
+						pos = findSpace(node);
+
+						if (pos !== -1) {
+							return {container: node, offset: pos};
+						}
+					} else if (isBlock(node)) {
+						break;
+					}
+				}
+
+				if (lastTextNode) {
+					if (start) {
+						offset = 0;
+					} else {
+						offset = lastTextNode.length;
+					}
+
+					return {container: lastTextNode, offset: offset};
+				}
+			}
+
+			function findSelectorEndPoint(container, sibling_name) {
+				var parents, i, y, curFormat;
+
+				if (container.nodeType == 3 && container.nodeValue.length === 0 && container[sibling_name]) {
+					container = container[sibling_name];
+				}
+
+				parents = getParents(container);
+				for (i = 0; i < parents.length; i++) {
+					for (y = 0; y < format.length; y++) {
+						curFormat = format[y];
+
+						// If collapsed state is set then skip formats that doesn't match that
+						if ("collapsed" in curFormat && curFormat.collapsed !== rng.collapsed) {
+							continue;
+						}
+
+						if (dom.is(parents[i], curFormat.selector)) {
+							return parents[i];
+						}
+					}
+				}
+
+				return container;
+			}
+
+			function findBlockEndPoint(container, sibling_name) {
+				var node, root = dom.getRoot();
+
+				// Expand to block of similar type
+				if (!format[0].wrapper) {
+					node = dom.getParent(container, format[0].block, root);
+				}
+
+				// Expand to first wrappable block element or any block element
+				if (!node) {
+					node = dom.getParent(container.nodeType == 3 ? container.parentNode : container, function(node) {
+						// Fixes #6183 where it would expand to editable parent element in inline mode
+						return node != root && isTextBlock(node);
+					});
+				}
+
+				// Exclude inner lists from wrapping
+				if (node && format[0].wrapper) {
+					node = getParents(node, 'ul,ol').reverse()[0] || node;
+				}
+
+				// Didn't find a block element look for first/last wrappable element
+				if (!node) {
+					node = container;
+
+					while (node[sibling_name] && !isBlock(node[sibling_name])) {
+						node = node[sibling_name];
+
+						// Break on BR but include it will be removed later on
+						// we can't remove it now since we need to check if it can be wrapped
+						if (isEq(node, 'br')) {
+							break;
+						}
+					}
+				}
+
+				return node || container;
+			}
+
+			// Expand to closest contentEditable element
+			startContainer = findParentContentEditable(startContainer);
+			endContainer = findParentContentEditable(endContainer);
+
+			// Exclude bookmark nodes if possible
+			if (isBookmarkNode(startContainer.parentNode) || isBookmarkNode(startContainer)) {
+				startContainer = isBookmarkNode(startContainer) ? startContainer : startContainer.parentNode;
+				startContainer = startContainer.nextSibling || startContainer;
+
+				if (startContainer.nodeType == 3) {
+					startOffset = 0;
+				}
+			}
+
+			if (isBookmarkNode(endContainer.parentNode) || isBookmarkNode(endContainer)) {
+				endContainer = isBookmarkNode(endContainer) ? endContainer : endContainer.parentNode;
+				endContainer = endContainer.previousSibling || endContainer;
+
+				if (endContainer.nodeType == 3) {
+					endOffset = endContainer.length;
+				}
+			}
+
+			if (format[0].inline) {
+				if (rng.collapsed) {
+					// Expand left to closest word boundary
+					endPoint = findWordEndPoint(startContainer, startOffset, true);
+					if (endPoint) {
+						startContainer = endPoint.container;
+						startOffset = endPoint.offset;
+					}
+
+					// Expand right to closest word boundary
+					endPoint = findWordEndPoint(endContainer, endOffset);
+					if (endPoint) {
+						endContainer = endPoint.container;
+						endOffset = endPoint.offset;
+					}
+				}
+
+				// Avoid applying formatting to a trailing space.
+				leaf = findLeaf(endContainer, endOffset);
+				if (leaf.node) {
+					while (leaf.node && leaf.offset === 0 && leaf.node.previousSibling) {
+						leaf = findLeaf(leaf.node.previousSibling);
+					}
+
+					if (leaf.node && leaf.offset > 0 && leaf.node.nodeType === 3 &&
+							leaf.node.nodeValue.charAt(leaf.offset - 1) === ' ') {
+
+						if (leaf.offset > 1) {
+							endContainer = leaf.node;
+							endContainer.splitText(leaf.offset - 1);
+						}
+					}
+				}
+			}
+
+			// Move start/end point up the tree if the leaves are sharp and if we are in different containers
+			// Example * becomes !: !<p><b><i>*text</i><i>text*</i></b></p>!
+			// This will reduce the number of wrapper elements that needs to be created
+			// Move start point up the tree
+			if (format[0].inline || format[0].block_expand) {
+				if (!format[0].inline || (startContainer.nodeType != 3 || startOffset === 0)) {
+					startContainer = findParentContainer(true);
+				}
+
+				if (!format[0].inline || (endContainer.nodeType != 3 || endOffset === endContainer.nodeValue.length)) {
+					endContainer = findParentContainer();
+				}
+			}
+
+			// Expand start/end container to matching selector
+			if (format[0].selector && format[0].expand !== FALSE && !format[0].inline) {
+				// Find new startContainer/endContainer if there is better one
+				startContainer = findSelectorEndPoint(startContainer, 'previousSibling');
+				endContainer = findSelectorEndPoint(endContainer, 'nextSibling');
+			}
+
+			// Expand start/end container to matching block element or text node
+			if (format[0].block || format[0].selector) {
+				// Find new startContainer/endContainer if there is better one
+				startContainer = findBlockEndPoint(startContainer, 'previousSibling');
+				endContainer = findBlockEndPoint(endContainer, 'nextSibling');
+
+				// Non block element then try to expand up the leaf
+				if (format[0].block) {
+					if (!isBlock(startContainer)) {
+						startContainer = findParentContainer(true);
+					}
+
+					if (!isBlock(endContainer)) {
+						endContainer = findParentContainer();
+					}
+				}
+			}
+
+			// Setup index for startContainer
+			if (startContainer.nodeType == 1) {
+				startOffset = nodeIndex(startContainer);
+				startContainer = startContainer.parentNode;
+			}
+
+			// Setup index for endContainer
+			if (endContainer.nodeType == 1) {
+				endOffset = nodeIndex(endContainer) + 1;
+				endContainer = endContainer.parentNode;
+			}
+
+			// Return new range like object
+			return {
+				startContainer: startContainer,
+				startOffset: startOffset,
+				endContainer: endContainer,
+				endOffset: endOffset
+			};
+		}
+
+		function isColorFormatAndAnchor(node, format) {
+			return format.links && node.tagName == 'A';
+		}
+
+		/**
+		 * Removes the specified format for the specified node. It will also remove the node if it doesn't have
+		 * any attributes if the format specifies it to do so.
+		 *
+		 * @private
+		 * @param {Object} format Format object with items to remove from node.
+		 * @param {Object} vars Name/value object with variables to apply to format.
+		 * @param {Node} node Node to remove the format styles on.
+		 * @param {Node} compare_node Optional compare node, if specified the styles will be compared to that node.
+		 * @return {Boolean} True/false if the node was removed or not.
+		 */
+		function removeFormat(format, vars, node, compare_node) {
+			var i, attrs, stylesModified;
+
+			// Check if node matches format
+			if (!matchName(node, format) && !isColorFormatAndAnchor(node, format)) {
+				return FALSE;
+			}
+
+			// Should we compare with format attribs and styles
+			if (format.remove != 'all') {
+				// Remove styles
+				each(format.styles, function(value, name) {
+					value = normalizeStyleValue(replaceVars(value, vars), name);
+
+					// Indexed array
+					if (typeof name === 'number') {
+						name = value;
+						compare_node = 0;
+					}
+
+					if (format.remove_similar || (!compare_node || isEq(getStyle(compare_node, name), value))) {
+						dom.setStyle(node, name, '');
+					}
+
+					stylesModified = 1;
+				});
+
+				// Remove style attribute if it's empty
+				if (stylesModified && dom.getAttrib(node, 'style') === '') {
+					node.removeAttribute('style');
+					node.removeAttribute('data-mce-style');
+				}
+
+				// Remove attributes
+				each(format.attributes, function(value, name) {
+					var valueOut;
+
+					value = replaceVars(value, vars);
+
+					// Indexed array
+					if (typeof name === 'number') {
+						name = value;
+						compare_node = 0;
+					}
+
+					if (!compare_node || isEq(dom.getAttrib(compare_node, name), value)) {
+						// Keep internal classes
+						if (name == 'class') {
+							value = dom.getAttrib(node, name);
+							if (value) {
+								// Build new class value where everything is removed except the internal prefixed classes
+								valueOut = '';
+								each(value.split(/\s+/), function(cls) {
+									if (/mce\-\w+/.test(cls)) {
+										valueOut += (valueOut ? ' ' : '') + cls;
+									}
+								});
+
+								// We got some internal classes left
+								if (valueOut) {
+									dom.setAttrib(node, name, valueOut);
+									return;
+								}
+							}
+						}
+
+						// IE6 has a bug where the attribute doesn't get removed correctly
+						if (name == "class") {
+							node.removeAttribute('className');
+						}
+
+						// Remove mce prefixed attributes
+						if (MCE_ATTR_RE.test(name)) {
+							node.removeAttribute('data-mce-' + name);
+						}
+
+						node.removeAttribute(name);
+					}
+				});
+
+				// Remove classes
+				each(format.classes, function(value) {
+					value = replaceVars(value, vars);
+
+					if (!compare_node || dom.hasClass(compare_node, value)) {
+						dom.removeClass(node, value);
+					}
+				});
+
+				// Check for non internal attributes
+				attrs = dom.getAttribs(node);
+				for (i = 0; i < attrs.length; i++) {
+					if (attrs[i].nodeName.indexOf('_') !== 0) {
+						return FALSE;
+					}
+				}
+			}
+
+			// Remove the inline child if it's empty for example <b> or <span>
+			if (format.remove != 'none') {
+				removeNode(node, format);
+				return TRUE;
+			}
+		}
+
+		/**
+		 * Removes the node and wrap it's children in paragraphs before doing so or
+		 * appends BR elements to the beginning/end of the block element if forcedRootBlocks is disabled.
+		 *
+		 * If the div in the node below gets removed:
+		 *  text<div>text</div>text
+		 *
+		 * Output becomes:
+		 *  text<div><br />text<br /></div>text
+		 *
+		 * So when the div is removed the result is:
+		 *  text<br />text<br />text
+		 *
+		 * @private
+		 * @param {Node} node Node to remove + apply BR/P elements to.
+		 * @param {Object} format Format rule.
+		 * @return {Node} Input node.
+		 */
+		function removeNode(node, format) {
+			var parentNode = node.parentNode, rootBlockElm;
+
+			function find(node, next, inc) {
+				node = getNonWhiteSpaceSibling(node, next, inc);
+
+				return !node || (node.nodeName == 'BR' || isBlock(node));
+			}
+
+			if (format.block) {
+				if (!forcedRootBlock) {
+					// Append BR elements if needed before we remove the block
+					if (isBlock(node) && !isBlock(parentNode)) {
+						if (!find(node, FALSE) && !find(node.firstChild, TRUE, 1)) {
+							node.insertBefore(dom.create('br'), node.firstChild);
+						}
+
+						if (!find(node, TRUE) && !find(node.lastChild, FALSE, 1)) {
+							node.appendChild(dom.create('br'));
+						}
+					}
+				} else {
+					// Wrap the block in a forcedRootBlock if we are at the root of document
+					if (parentNode == dom.getRoot()) {
+						if (!format.list_block || !isEq(node, format.list_block)) {
+							each(grep(node.childNodes), function(node) {
+								if (isValid(forcedRootBlock, node.nodeName.toLowerCase())) {
+									if (!rootBlockElm) {
+										rootBlockElm = wrap(node, forcedRootBlock);
+										dom.setAttribs(rootBlockElm, ed.settings.forced_root_block_attrs);
+									} else {
+										rootBlockElm.appendChild(node);
+									}
+								} else {
+									rootBlockElm = 0;
+								}
+							});
+						}
+					}
+				}
+			}
+
+			// Never remove nodes that isn't the specified inline element if a selector is specified too
+			if (format.selector && format.inline && !isEq(format.inline, node)) {
+				return;
+			}
+
+			dom.remove(node, 1);
+		}
+
+		/**
+		 * Returns the next/previous non whitespace node.
+		 *
+		 * @private
+		 * @param {Node} node Node to start at.
+		 * @param {boolean} next (Optional) Include next or previous node defaults to previous.
+		 * @param {boolean} inc (Optional) Include the current node in checking. Defaults to false.
+		 * @return {Node} Next or previous node or undefined if it wasn't found.
+		 */
+		function getNonWhiteSpaceSibling(node, next, inc) {
+			if (node) {
+				next = next ? 'nextSibling' : 'previousSibling';
+
+				for (node = inc ? node : node[next]; node; node = node[next]) {
+					if (node.nodeType == 1 || !isWhiteSpaceNode(node)) {
+						return node;
+					}
+				}
+			}
+		}
+
+		/**
+		 * Merges the next/previous sibling element if they match.
+		 *
+		 * @private
+		 * @param {Node} prev Previous node to compare/merge.
+		 * @param {Node} next Next node to compare/merge.
+		 * @return {Node} Next node if we didn't merge and prev node if we did.
+		 */
+		function mergeSiblings(prev, next) {
+			var sibling, tmpSibling, elementUtils = new ElementUtils(dom);
+
+			function findElementSibling(node, sibling_name) {
+				for (sibling = node; sibling; sibling = sibling[sibling_name]) {
+					if (sibling.nodeType == 3 && sibling.nodeValue.length !== 0) {
+						return node;
+					}
+
+					if (sibling.nodeType == 1 && !isBookmarkNode(sibling)) {
+						return sibling;
+					}
+				}
+
+				return node;
+			}
+
+			// Check if next/prev exists and that they are elements
+			if (prev && next) {
+				// If previous sibling is empty then jump over it
+				prev = findElementSibling(prev, 'previousSibling');
+				next = findElementSibling(next, 'nextSibling');
+
+				// Compare next and previous nodes
+				if (elementUtils.compare(prev, next)) {
+					// Append nodes between
+					for (sibling = prev.nextSibling; sibling && sibling != next;) {
+						tmpSibling = sibling;
+						sibling = sibling.nextSibling;
+						prev.appendChild(tmpSibling);
+					}
+
+					// Remove next node
+					dom.remove(next);
+
+					// Move children into prev node
+					each(grep(next.childNodes), function(node) {
+						prev.appendChild(node);
+					});
+
+					return prev;
+				}
+			}
+
+			return next;
+		}
+
+		function getContainer(rng, start) {
+			var container, offset, lastIdx;
+
+			container = rng[start ? 'startContainer' : 'endContainer'];
+			offset = rng[start ? 'startOffset' : 'endOffset'];
+
+			if (container.nodeType == 1) {
+				lastIdx = container.childNodes.length - 1;
+
+				if (!start && offset) {
+					offset--;
+				}
+
+				container = container.childNodes[offset > lastIdx ? lastIdx : offset];
+			}
+
+			// If start text node is excluded then walk to the next node
+			if (container.nodeType === 3 && start && offset >= container.nodeValue.length) {
+				container = new TreeWalker(container, ed.getBody()).next() || container;
+			}
+
+			// If end text node is excluded then walk to the previous node
+			if (container.nodeType === 3 && !start && offset === 0) {
+				container = new TreeWalker(container, ed.getBody()).prev() || container;
+			}
+
+			return container;
+		}
+
+		function performCaretAction(type, name, vars, similar) {
+			var caretContainerId = '_mce_caret', debug = ed.settings.caret_debug;
+
+			// Creates a caret container bogus element
+			function createCaretContainer(fill) {
+				var caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true, style: debug ? 'color:red' : ''});
+
+				if (fill) {
+					caretContainer.appendChild(ed.getDoc().createTextNode(INVISIBLE_CHAR));
+				}
+
+				return caretContainer;
+			}
+
+			function isCaretContainerEmpty(node, nodes) {
+				while (node) {
+					if ((node.nodeType === 3 && node.nodeValue !== INVISIBLE_CHAR) || node.childNodes.length > 1) {
+						return false;
+					}
+
+					// Collect nodes
+					if (nodes && node.nodeType === 1) {
+						nodes.push(node);
+					}
+
+					node = node.firstChild;
+				}
+
+				return true;
+			}
+
+			// Returns any parent caret container element
+			function getParentCaretContainer(node) {
+				while (node) {
+					if (node.id === caretContainerId) {
+						return node;
+					}
+
+					node = node.parentNode;
+				}
+			}
+
+			// Finds the first text node in the specified node
+			function findFirstTextNode(node) {
+				var walker;
+
+				if (node) {
+					walker = new TreeWalker(node, node);
+
+					for (node = walker.current(); node; node = walker.next()) {
+						if (node.nodeType === 3) {
+							return node;
+						}
+					}
+				}
+			}
+
+			// Removes the caret container for the specified node or all on the current document
+			function removeCaretContainer(node, move_caret) {
+				var child, rng;
+
+				if (!node) {
+					node = getParentCaretContainer(selection.getStart());
+
+					if (!node) {
+						while ((node = dom.get(caretContainerId))) {
+							removeCaretContainer(node, false);
+						}
+					}
+				} else {
+					rng = selection.getRng(true);
+
+					if (isCaretContainerEmpty(node)) {
+						if (move_caret !== false) {
+							rng.setStartBefore(node);
+							rng.setEndBefore(node);
+						}
+
+						dom.remove(node);
+					} else {
+						child = findFirstTextNode(node);
+
+						if (child.nodeValue.charAt(0) === INVISIBLE_CHAR) {
+							child.deleteData(0, 1);
+
+							// Fix for bug #6976
+							if (rng.startContainer == child && rng.startOffset > 0) {
+								rng.setStart(child, rng.startOffset - 1);
+							}
+
+							if (rng.endContainer == child && rng.endOffset > 0) {
+								rng.setEnd(child, rng.endOffset - 1);
+							}
+						}
+
+						dom.remove(node, 1);
+					}
+
+					selection.setRng(rng);
+				}
+			}
+
+			// Applies formatting to the caret postion
+			function applyCaretFormat() {
+				var rng, caretContainer, textNode, offset, bookmark, container, text;
+
+				rng = selection.getRng(true);
+				offset = rng.startOffset;
+				container = rng.startContainer;
+				text = container.nodeValue;
+
+				caretContainer = getParentCaretContainer(selection.getStart());
+				if (caretContainer) {
+					textNode = findFirstTextNode(caretContainer);
+				}
+
+				// Expand to word is caret is in the middle of a text node and the char before/after is a alpha numeric character
+				if (text && offset > 0 && offset < text.length && /\w/.test(text.charAt(offset)) && /\w/.test(text.charAt(offset - 1))) {
+					// Get bookmark of caret position
+					bookmark = selection.getBookmark();
+
+					// Collapse bookmark range (WebKit)
+					rng.collapse(true);
+
+					// Expand the range to the closest word and split it at those points
+					rng = expandRng(rng, get(name));
+					rng = rangeUtils.split(rng);
+
+					// Apply the format to the range
+					apply(name, vars, rng);
+
+					// Move selection back to caret position
+					selection.moveToBookmark(bookmark);
+				} else {
+					if (!caretContainer || textNode.nodeValue !== INVISIBLE_CHAR) {
+						caretContainer = createCaretContainer(true);
+						textNode = caretContainer.firstChild;
+
+						rng.insertNode(caretContainer);
+						offset = 1;
+
+						apply(name, vars, caretContainer);
+					} else {
+						apply(name, vars, caretContainer);
+					}
+
+					// Move selection to text node
+					selection.setCursorLocation(textNode, offset);
+				}
+			}
+
+			function removeCaretFormat() {
+				var rng = selection.getRng(true), container, offset, bookmark,
+					hasContentAfter, node, formatNode, parents = [], i, caretContainer;
+
+				container = rng.startContainer;
+				offset = rng.startOffset;
+				node = container;
+
+				if (container.nodeType == 3) {
+					if (offset != container.nodeValue.length) {
+						hasContentAfter = true;
+					}
+
+					node = node.parentNode;
+				}
+
+				while (node) {
+					if (matchNode(node, name, vars, similar)) {
+						formatNode = node;
+						break;
+					}
+
+					if (node.nextSibling) {
+						hasContentAfter = true;
+					}
+
+					parents.push(node);
+					node = node.parentNode;
+				}
+
+				// Node doesn't have the specified format
+				if (!formatNode) {
+					return;
+				}
+
+				// Is there contents after the caret then remove the format on the element
+				if (hasContentAfter) {
+					// Get bookmark of caret position
+					bookmark = selection.getBookmark();
+
+					// Collapse bookmark range (WebKit)
+					rng.collapse(true);
+
+					// Expand the range to the closest word and split it at those points
+					rng = expandRng(rng, get(name), true);
+					rng = rangeUtils.split(rng);
+
+					// Remove the format from the range
+					remove(name, vars, rng);
+
+					// Move selection back to caret position
+					selection.moveToBookmark(bookmark);
+				} else {
+					caretContainer = createCaretContainer();
+
+					node = caretContainer;
+					for (i = parents.length - 1; i >= 0; i--) {
+						node.appendChild(dom.clone(parents[i], false));
+						node = node.firstChild;
+					}
+
+					// Insert invisible character into inner most format element
+					node.appendChild(dom.doc.createTextNode(INVISIBLE_CHAR));
+					node = node.firstChild;
+
+					var block = dom.getParent(formatNode, isTextBlock);
+
+					if (block && dom.isEmpty(block)) {
+						// Replace formatNode with caretContainer when removing format from empty block like <p><b>|</b></p>
+						formatNode.parentNode.replaceChild(caretContainer, formatNode);
+					} else {
+						// Insert caret container after the formated node
+						dom.insertAfter(caretContainer, formatNode);
+					}
+
+					// Move selection to text node
+					selection.setCursorLocation(node, 1);
+
+					// If the formatNode is empty, we can remove it safely.
+					if (dom.isEmpty(formatNode)) {
+						dom.remove(formatNode);
+					}
+				}
+			}
+
+			// Checks if the parent caret container node isn't empty if that is the case it
+			// will remove the bogus state on all children that isn't empty
+			function unmarkBogusCaretParents() {
+				var caretContainer;
+
+				caretContainer = getParentCaretContainer(selection.getStart());
+				if (caretContainer && !dom.isEmpty(caretContainer)) {
+					walk(caretContainer, function(node) {
+						if (node.nodeType == 1 && node.id !== caretContainerId && !dom.isEmpty(node)) {
+							dom.setAttrib(node, 'data-mce-bogus', null);
+						}
+					}, 'childNodes');
+				}
+			}
+
+			// Only bind the caret events once
+			if (!ed._hasCaretEvents) {
+				// Mark current caret container elements as bogus when getting the contents so we don't end up with empty elements
+				markCaretContainersBogus = function() {
+					var nodes = [], i;
+
+					if (isCaretContainerEmpty(getParentCaretContainer(selection.getStart()), nodes)) {
+						// Mark children
+						i = nodes.length;
+						while (i--) {
+							dom.setAttrib(nodes[i], 'data-mce-bogus', '1');
+						}
+					}
+				};
+
+				disableCaretContainer = function(e) {
+					var keyCode = e.keyCode;
+
+					removeCaretContainer();
+
+					// Remove caret container on keydown and it's a backspace, enter or left/right arrow keys
+					// Backspace key needs to check if the range is collapsed due to bug #6780
+					if ((keyCode == 8 && selection.isCollapsed()) || keyCode == 37 || keyCode == 39) {
+						removeCaretContainer(getParentCaretContainer(selection.getStart()));
+					}
+
+					unmarkBogusCaretParents();
+				};
+
+				// Remove bogus state if they got filled by contents using editor.selection.setContent
+				ed.on('SetContent', function(e) {
+					if (e.selection) {
+						unmarkBogusCaretParents();
+					}
+				});
+				ed._hasCaretEvents = true;
+			}
+
+			// Do apply or remove caret format
+			if (type == "apply") {
+				applyCaretFormat();
+			} else {
+				removeCaretFormat();
+			}
+		}
+
+		/**
+		 * Moves the start to the first suitable text node.
+		 */
+		function moveStart(rng) {
+			var container = rng.startContainer,
+					offset = rng.startOffset, isAtEndOfText,
+					walker, node, nodes, tmpNode;
+
+			// Convert text node into index if possible
+			if (container.nodeType == 3 && offset >= container.nodeValue.length) {
+				// Get the parent container location and walk from there
+				offset = nodeIndex(container);
+				container = container.parentNode;
+				isAtEndOfText = true;
+			}
+
+			// Move startContainer/startOffset in to a suitable node
+			if (container.nodeType == 1) {
+				nodes = container.childNodes;
+				container = nodes[Math.min(offset, nodes.length - 1)];
+				walker = new TreeWalker(container, dom.getParent(container, dom.isBlock));
+
+				// If offset is at end of the parent node walk to the next one
+				if (offset > nodes.length - 1 || isAtEndOfText) {
+					walker.next();
+				}
+
+				for (node = walker.current(); node; node = walker.next()) {
+					if (node.nodeType == 3 && !isWhiteSpaceNode(node)) {
+						// IE has a "neat" feature where it moves the start node into the closest element
+						// we can avoid this by inserting an element before it and then remove it after we set the selection
+						tmpNode = dom.create('a', {'data-mce-bogus': 'all'}, INVISIBLE_CHAR);
+						node.parentNode.insertBefore(tmpNode, node);
+
+						// Set selection and remove tmpNode
+						rng.setStart(node, 0);
+						selection.setRng(rng);
+						dom.remove(tmpNode);
+
+						return;
+					}
+				}
+			}
+		}
+	};
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/LegacyInput.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,76 @@
+/**
+ * LegacyInput.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+define("tinymce/LegacyInput", [
+	"tinymce/EditorManager",
+	"tinymce/util/Tools"
+], function(EditorManager, Tools) {
+	var each = Tools.each, explode = Tools.explode;
+
+	EditorManager.on('AddEditor', function(e) {
+		var editor = e.editor;
+
+		editor.on('preInit', function() {
+			var filters, fontSizes, dom, settings = editor.settings;
+
+			function replaceWithSpan(node, styles) {
+				each(styles, function(value, name) {
+					if (value) {
+						dom.setStyle(node, name, value);
+					}
+				});
+
+				dom.rename(node, 'span');
+			}
+
+			function convert(e) {
+				dom = editor.dom;
+
+				if (settings.convert_fonts_to_spans) {
+					each(dom.select('font,u,strike', e.node), function(node) {
+						filters[node.nodeName.toLowerCase()](dom, node);
+					});
+				}
+			}
+
+			if (settings.inline_styles) {
+				fontSizes = explode(settings.font_size_legacy_values);
+
+				filters = {
+					font: function(dom, node) {
+						replaceWithSpan(node, {
+							backgroundColor: node.style.backgroundColor,
+							color: node.color,
+							fontFamily: node.face,
+							fontSize: fontSizes[parseInt(node.size, 10) - 1]
+						});
+					},
+
+					u: function(dom, node) {
+						// HTML5 allows U element
+						if (editor.settings.schema === "html4") {
+							replaceWithSpan(node, {
+								textDecoration: 'underline'
+							});
+						}
+					},
+
+					strike: function(dom, node) {
+						replaceWithSpan(node, {
+							textDecoration: 'line-through'
+						});
+					}
+				};
+
+				editor.on('PreProcess SetContent', convert);
+			}
+		});
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/NodeChange.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,153 @@
+/**
+ * NodeChange.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles the nodechange event dispatching both manual and though selection change events.
+ *
+ * @class tinymce.NodeChange
+ * @private
+ */
+define("tinymce/NodeChange", [
+	"tinymce/dom/RangeUtils",
+	"tinymce/Env"
+], function(RangeUtils, Env) {
+	return function(editor) {
+		var lastRng, lastPath = [];
+
+		/**
+		 * Returns true/false if the current element path has been changed or not.
+		 *
+		 * @private
+		 * @return {Boolean} True if the element path is the same false if it's not.
+		 */
+		function isSameElementPath(startElm) {
+			var i, currentPath;
+
+			currentPath = editor.$(startElm).parentsUntil(editor.getBody()).add(startElm);
+			if (currentPath.length === lastPath.length) {
+				for (i = currentPath.length; i >= 0; i--) {
+					if (currentPath[i] !== lastPath[i]) {
+						break;
+					}
+				}
+
+				if (i === -1) {
+					lastPath = currentPath;
+					return true;
+				}
+			}
+
+			lastPath = currentPath;
+
+			return false;
+		}
+
+		// Gecko doesn't support the "selectionchange" event
+		if (!('onselectionchange' in editor.getDoc())) {
+			editor.on('NodeChange Click MouseUp KeyUp Focus', function(e) {
+				var nativeRng, fakeRng;
+
+				// Since DOM Ranges mutate on modification
+				// of the DOM we need to clone it's contents
+				nativeRng = editor.selection.getRng();
+				fakeRng = {
+					startContainer: nativeRng.startContainer,
+					startOffset: nativeRng.startOffset,
+					endContainer: nativeRng.endContainer,
+					endOffset: nativeRng.endOffset
+				};
+
+				// Always treat nodechange as a selectionchange since applying
+				// formatting to the current range wouldn't update the range but it's parent
+				if (e.type == 'nodechange' || !RangeUtils.compareRanges(fakeRng, lastRng)) {
+					editor.fire('SelectionChange');
+				}
+
+				lastRng = fakeRng;
+			});
+		}
+
+		// IE has a bug where it fires a selectionchange on right click that has a range at the start of the body
+		// When the contextmenu event fires the selection is located at the right location
+		editor.on('contextmenu', function() {
+			editor.fire('SelectionChange');
+		});
+
+		// Selection change is delayed ~200ms on IE when you click inside the current range
+		editor.on('SelectionChange', function() {
+			var startElm = editor.selection.getStart(true);
+
+			// IE 8 will fire a selectionchange event with an incorrect selection
+			// when focusing out of table cells. Click inside cell -> toolbar = Invalid SelectionChange event
+			if (!Env.range && editor.selection.isCollapsed()) {
+				return;
+			}
+
+			if (!isSameElementPath(startElm) && editor.dom.isChildOf(startElm, editor.getBody())) {
+				editor.nodeChanged({selectionChange: true});
+			}
+		});
+
+		// Fire an extra nodeChange on mouseup for compatibility reasons
+		editor.on('MouseUp', function(e) {
+			if (!e.isDefaultPrevented()) {
+				// Delay nodeChanged call for WebKit edge case issue where the range
+				// isn't updated until after you click outside a selected image
+				if (editor.selection.getNode().nodeName == 'IMG') {
+					setTimeout(function() {
+						editor.nodeChanged();
+					}, 0);
+				} else {
+					editor.nodeChanged();
+				}
+			}
+		});
+
+		/**
+		 * Distpaches out a onNodeChange event to all observers. This method should be called when you
+		 * need to update the UI states or element path etc.
+		 *
+		 * @method nodeChanged
+		 * @param {Object} args Optional args to pass to NodeChange event handlers.
+		 */
+		this.nodeChanged = function(args) {
+			var selection = editor.selection, node, parents, root;
+
+			// Fix for bug #1896577 it seems that this can not be fired while the editor is loading
+			if (editor.initialized && selection && !editor.settings.disable_nodechange && !editor.settings.readonly) {
+				// Get start node
+				root = editor.getBody();
+				node = selection.getStart() || root;
+				node = node.ownerDocument != editor.getDoc() ? editor.getBody() : node;
+
+				// Edge case for <p>|<img></p>
+				if (node.nodeName == 'IMG' && selection.isCollapsed()) {
+					node = node.parentNode;
+				}
+
+				// Get parents and add them to object
+				parents = [];
+				editor.dom.getParent(node, function(node) {
+					if (node === root) {
+						return true;
+					}
+
+					parents.push(node);
+				});
+
+				args = args || {};
+				args.element = node;
+				args.parents = parents;
+
+				editor.fire('NodeChange', args);
+			}
+		};
+	};
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/Shortcuts.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,171 @@
+/**
+ * Shortcuts.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Contains all logic for handling of keyboard shortcuts.
+ *
+ * @example
+ * editor.shortcuts.add('ctrl+a', function() {});
+ * editor.shortcuts.add('meta+a', function() {}); // "meta" maps to Command on Mac and Ctrl on PC
+ * editor.shortcuts.add('ctrl+alt+a', function() {});
+ * editor.shortcuts.add('access+a', function() {}); // "access" maps to ctrl+alt on Mac and shift+alt on PC
+ */
+define("tinymce/Shortcuts", [
+	"tinymce/util/Tools",
+	"tinymce/Env"
+], function(Tools, Env) {
+	var each = Tools.each, explode = Tools.explode;
+
+	var keyCodeLookup = {
+		"f9": 120,
+		"f10": 121,
+		"f11": 122
+	};
+
+	var modifierNames = Tools.makeMap('alt,ctrl,shift,meta,access');
+
+	return function(editor) {
+		var self = this, shortcuts = {};
+
+		function createShortcut(pattern, desc, cmdFunc, scope) {
+			var id, key, shortcut;
+
+			shortcut = {
+				func: cmdFunc,
+				scope: scope || editor,
+				desc: editor.translate(desc)
+			};
+
+			// Parse modifiers and keys ctrl+alt+b for example
+			each(explode(pattern, '+'), function(value) {
+				if (value in modifierNames) {
+					shortcut[value] = true;
+				} else {
+					// Allow numeric keycodes like ctrl+219 for ctrl+[
+					if (/^[0-9]{2,}$/.test(value)) {
+						shortcut.keyCode = parseInt(value, 10);
+					} else {
+						shortcut.charCode = value.charCodeAt(0);
+						shortcut.keyCode = keyCodeLookup[value] || value.toUpperCase().charCodeAt(0);
+					}
+				}
+			});
+
+			// Generate unique id for modifier combination and set default state for unused modifiers
+			id = [shortcut.keyCode];
+			for (key in modifierNames) {
+				if (shortcut[key]) {
+					id.push(key);
+				} else {
+					shortcut[key] = false;
+				}
+			}
+			shortcut.id = id.join(',');
+
+			// Handle special access modifier differently depending on Mac/Win
+			if (shortcut.access) {
+				shortcut.alt = true;
+
+				if (Env.mac) {
+					shortcut.ctrl = true;
+				} else {
+					shortcut.shift = true;
+				}
+			}
+
+			// Handle special meta modifier differently depending on Mac/Win
+			if (shortcut.meta) {
+				if (Env.mac) {
+					shortcut.meta = true;
+				} else {
+					shortcut.ctrl = true;
+					shortcut.meta = false;
+				}
+			}
+
+			return shortcut;
+		}
+
+		editor.on('keyup keypress keydown', function(e) {
+			if ((e.altKey || e.ctrlKey || e.metaKey) && !e.isDefaultPrevented()) {
+				each(shortcuts, function(shortcut) {
+					if (shortcut.ctrl != e.ctrlKey || shortcut.meta != e.metaKey) {
+						return;
+					}
+
+					if (shortcut.alt != e.altKey || shortcut.shift != e.shiftKey) {
+						return;
+					}
+
+					if (e.keyCode == shortcut.keyCode || (e.charCode && e.charCode == shortcut.charCode)) {
+						e.preventDefault();
+
+						if (e.type == "keydown") {
+							shortcut.func.call(shortcut.scope);
+						}
+
+						return true;
+					}
+				});
+			}
+		});
+
+		/**
+		 * Adds a keyboard shortcut for some command or function.
+		 *
+		 * @method addShortcut
+		 * @param {String} pattern Shortcut pattern. Like for example: ctrl+alt+o.
+		 * @param {String} desc Text description for the command.
+		 * @param {String/Function} cmdFunc Command name string or function to execute when the key is pressed.
+		 * @param {Object} sc Optional scope to execute the function in.
+		 * @return {Boolean} true/false state if the shortcut was added or not.
+		 */
+		self.add = function(pattern, desc, cmdFunc, scope) {
+			var cmd;
+
+			cmd = cmdFunc;
+
+			if (typeof cmdFunc === 'string') {
+				cmdFunc = function() {
+					editor.execCommand(cmd, false, null);
+				};
+			} else if (Tools.isArray(cmd)) {
+				cmdFunc = function() {
+					editor.execCommand(cmd[0], cmd[1], cmd[2]);
+				};
+			}
+
+			each(explode(pattern.toLowerCase()), function(pattern) {
+				var shortcut = createShortcut(pattern, desc, cmdFunc, scope);
+				shortcuts[shortcut.id] = shortcut;
+			});
+
+			return true;
+		};
+
+		/**
+		 * Remove a keyboard shortcut by pattern.
+		 *
+		 * @method remove
+		 * @param {String} pattern Shortcut pattern. Like for example: ctrl+alt+o.
+		 * @return {Boolean} true/false state if the shortcut was removed or not.
+		 */
+		self.remove = function(pattern) {
+			var shortcut = createShortcut(pattern);
+
+			if (shortcuts[shortcut.id]) {
+				delete shortcuts[shortcut.id];
+				return true;
+			}
+
+			return false;
+		};
+	};
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/UndoManager.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,379 @@
+/**
+ * UndoManager.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles the undo/redo history levels for the editor. Since the build in undo/redo has major drawbacks a custom one was needed.
+ *
+ * @class tinymce.UndoManager
+ */
+define("tinymce/UndoManager", [
+	"tinymce/util/VK",
+	"tinymce/Env",
+	"tinymce/util/Tools",
+	"tinymce/html/SaxParser"
+], function(VK, Env, Tools, SaxParser) {
+	var trim = Tools.trim, trimContentRegExp;
+
+	trimContentRegExp = new RegExp([
+		'<span[^>]+data-mce-bogus[^>]+>[\u200B\uFEFF]+<\\/span>', // Trim bogus spans like caret containers
+		'\\s?data-mce-selected="[^"]+"' // Trim temporaty data-mce prefixed attributes like data-mce-selected
+	].join('|'), 'gi');
+
+	return function(editor) {
+		var self = this, index = 0, data = [], beforeBookmark, isFirstTypedCharacter, locks = 0;
+
+		/**
+		 * Returns a trimmed version of the editor contents to be used for the undo level. This
+		 * will remove any data-mce-bogus="all" marked elements since these are used for UI it will also
+		 * remove the data-mce-selected attributes used for selection of objects and caret containers.
+		 * It will keep all data-mce-bogus="1" elements since these can be used to place the caret etc and will
+		 * be removed by the serialization logic when you save.
+		 *
+		 * @private
+		 * @return {String} HTML contents of the editor excluding some internal bogus elements.
+		 */
+		function getContent() {
+			var content = editor.getContent({format: 'raw', no_events: 1});
+			var bogusAllRegExp = /<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g;
+			var endTagIndex, index, matchLength, matches, shortEndedElements, schema = editor.schema;
+
+			content = content.replace(trimContentRegExp, '');
+			shortEndedElements = schema.getShortEndedElements();
+
+			// Remove all bogus elements marked with "all"
+			while ((matches = bogusAllRegExp.exec(content))) {
+				index = bogusAllRegExp.lastIndex;
+				matchLength = matches[0].length;
+
+				if (shortEndedElements[matches[1]]) {
+					endTagIndex = index;
+				} else {
+					endTagIndex = SaxParser.findEndTag(schema, content, index);
+				}
+
+				content = content.substring(0, index - matchLength) + content.substring(endTagIndex);
+				bogusAllRegExp.lastIndex = index - matchLength;
+			}
+
+			return trim(content);
+		}
+
+		function setDirty(state) {
+			editor.isNotDirty = !state;
+		}
+
+		function addNonTypingUndoLevel(e) {
+			self.typing = false;
+			self.add({}, e);
+		}
+
+		// Add initial undo level when the editor is initialized
+		editor.on('init', function() {
+			self.add();
+		});
+
+		// Get position before an execCommand is processed
+		editor.on('BeforeExecCommand', function(e) {
+			var cmd = e.command;
+
+			if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint') {
+				self.beforeChange();
+			}
+		});
+
+		// Add undo level after an execCommand call was made
+		editor.on('ExecCommand', function(e) {
+			var cmd = e.command;
+
+			if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint') {
+				addNonTypingUndoLevel(e);
+			}
+		});
+
+		editor.on('ObjectResizeStart', function() {
+			self.beforeChange();
+		});
+
+		editor.on('SaveContent ObjectResized blur', addNonTypingUndoLevel);
+		editor.on('DragEnd', addNonTypingUndoLevel);
+
+		editor.on('KeyUp', function(e) {
+			var keyCode = e.keyCode;
+
+			if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 45 || keyCode == 13 || e.ctrlKey) {
+				addNonTypingUndoLevel();
+				editor.nodeChanged();
+			}
+
+			if (keyCode == 46 || keyCode == 8 || (Env.mac && (keyCode == 91 || keyCode == 93))) {
+				editor.nodeChanged();
+			}
+
+			// Fire a TypingUndo event on the first character entered
+			if (isFirstTypedCharacter && self.typing) {
+				// Make it dirty if the content was changed after typing the first character
+				if (!editor.isDirty()) {
+					setDirty(data[0] && getContent() != data[0].content);
+
+					// Fire initial change event
+					if (!editor.isNotDirty) {
+						editor.fire('change', {level: data[0], lastLevel: null});
+					}
+				}
+
+				editor.fire('TypingUndo');
+				isFirstTypedCharacter = false;
+				editor.nodeChanged();
+			}
+		});
+
+		editor.on('KeyDown', function(e) {
+			var keyCode = e.keyCode;
+
+			// Is caracter positon keys left,right,up,down,home,end,pgdown,pgup,enter
+			if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 45) {
+				if (self.typing) {
+					addNonTypingUndoLevel(e);
+				}
+
+				return;
+			}
+
+			// If key isn't Ctrl+Alt/AltGr
+			var modKey = (e.ctrlKey && !e.altKey) || e.metaKey;
+			if ((keyCode < 16 || keyCode > 20) && keyCode != 224 && keyCode != 91 && !self.typing && !modKey) {
+				self.beforeChange();
+				self.typing = true;
+				self.add({}, e);
+				isFirstTypedCharacter = true;
+			}
+		});
+
+		editor.on('MouseDown', function(e) {
+			if (self.typing) {
+				addNonTypingUndoLevel(e);
+			}
+		});
+
+		// Add keyboard shortcuts for undo/redo keys
+		editor.addShortcut('meta+z', '', 'Undo');
+		editor.addShortcut('meta+y,meta+shift+z', '', 'Redo');
+
+		editor.on('AddUndo Undo Redo ClearUndos', function(e) {
+			if (!e.isDefaultPrevented()) {
+				editor.nodeChanged();
+			}
+		});
+
+		/*eslint consistent-this:0 */
+		self = {
+			// Explose for debugging reasons
+			data: data,
+
+			/**
+			 * State if the user is currently typing or not. This will add a typing operation into one undo
+			 * level instead of one new level for each keystroke.
+			 *
+			 * @field {Boolean} typing
+			 */
+			typing: false,
+
+			/**
+			 * Stores away a bookmark to be used when performing an undo action so that the selection is before
+			 * the change has been made.
+			 *
+			 * @method beforeChange
+			 */
+			beforeChange: function() {
+				if (!locks) {
+					beforeBookmark = editor.selection.getBookmark(2, true);
+				}
+			},
+
+			/**
+			 * Adds a new undo level/snapshot to the undo list.
+			 *
+			 * @method add
+			 * @param {Object} level Optional undo level object to add.
+			 * @param {DOMEvent} Event Optional event responsible for the creation of the undo level.
+			 * @return {Object} Undo level that got added or null it a level wasn't needed.
+			 */
+			add: function(level, event) {
+				var i, settings = editor.settings, lastLevel;
+
+				level = level || {};
+				level.content = getContent();
+
+				if (locks || editor.removed) {
+					return null;
+				}
+
+				lastLevel = data[index];
+				if (editor.fire('BeforeAddUndo', {level: level, lastLevel: lastLevel, originalEvent: event}).isDefaultPrevented()) {
+					return null;
+				}
+
+				// Add undo level if needed
+				if (lastLevel && lastLevel.content == level.content) {
+					return null;
+				}
+
+				// Set before bookmark on previous level
+				if (data[index]) {
+					data[index].beforeBookmark = beforeBookmark;
+				}
+
+				// Time to compress
+				if (settings.custom_undo_redo_levels) {
+					if (data.length > settings.custom_undo_redo_levels) {
+						for (i = 0; i < data.length - 1; i++) {
+							data[i] = data[i + 1];
+						}
+
+						data.length--;
+						index = data.length;
+					}
+				}
+
+				// Get a non intrusive normalized bookmark
+				level.bookmark = editor.selection.getBookmark(2, true);
+
+				// Crop array if needed
+				if (index < data.length - 1) {
+					data.length = index + 1;
+				}
+
+				data.push(level);
+				index = data.length - 1;
+
+				var args = {level: level, lastLevel: lastLevel, originalEvent: event};
+
+				editor.fire('AddUndo', args);
+
+				if (index > 0) {
+					setDirty(true);
+					editor.fire('change', args);
+				}
+
+				return level;
+			},
+
+			/**
+			 * Undoes the last action.
+			 *
+			 * @method undo
+			 * @return {Object} Undo level or null if no undo was performed.
+			 */
+			undo: function() {
+				var level;
+
+				if (self.typing) {
+					self.add();
+					self.typing = false;
+				}
+
+				if (index > 0) {
+					level = data[--index];
+
+					// Undo to first index then set dirty state to false
+					if (index === 0) {
+						setDirty(false);
+					}
+
+					editor.setContent(level.content, {format: 'raw'});
+					editor.selection.moveToBookmark(level.beforeBookmark);
+
+					editor.fire('undo', {level: level});
+				}
+
+				return level;
+			},
+
+			/**
+			 * Redoes the last action.
+			 *
+			 * @method redo
+			 * @return {Object} Redo level or null if no redo was performed.
+			 */
+			redo: function() {
+				var level;
+
+				if (index < data.length - 1) {
+					level = data[++index];
+
+					editor.setContent(level.content, {format: 'raw'});
+					editor.selection.moveToBookmark(level.bookmark);
+					setDirty(true);
+
+					editor.fire('redo', {level: level});
+				}
+
+				return level;
+			},
+
+			/**
+			 * Removes all undo levels.
+			 *
+			 * @method clear
+			 */
+			clear: function() {
+				data = [];
+				index = 0;
+				self.typing = false;
+				editor.fire('ClearUndos');
+			},
+
+			/**
+			 * Returns true/false if the undo manager has any undo levels.
+			 *
+			 * @method hasUndo
+			 * @return {Boolean} true/false if the undo manager has any undo levels.
+			 */
+			hasUndo: function() {
+				// Has undo levels or typing and content isn't the same as the initial level
+				return index > 0 || (self.typing && data[0] && getContent() != data[0].content);
+			},
+
+			/**
+			 * Returns true/false if the undo manager has any redo levels.
+			 *
+			 * @method hasRedo
+			 * @return {Boolean} true/false if the undo manager has any redo levels.
+			 */
+			hasRedo: function() {
+				return index < data.length - 1 && !this.typing;
+			},
+
+			/**
+			 * Executes the specified function in an undo transation. The selection
+			 * before the modification will be stored to the undo stack and if the DOM changes
+			 * it will add a new undo level. Any methods within the transation that adds undo levels will
+			 * be ignored. So a transation can include calls to execCommand or editor.insertContent.
+			 *
+			 * @method transact
+			 * @param {function} callback Function to execute dom manipulation logic in.
+			 */
+			transact: function(callback) {
+				self.beforeChange();
+
+				try {
+					locks++;
+					callback();
+				} finally {
+					locks--;
+				}
+
+				self.add();
+			}
+		};
+
+		return self;
+	};
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/WindowManager.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,241 @@
+/**
+ * WindowManager.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles the creation of native windows and dialogs. This class can be extended to provide for example inline dialogs.
+ *
+ * @class tinymce.WindowManager
+ * @example
+ * // Opens a new dialog with the file.htm file and the size 320x240
+ * // It also adds a custom parameter this can be retrieved by using tinyMCEPopup.getWindowArg inside the dialog.
+ * tinymce.activeEditor.windowManager.open({
+ *    url: 'file.htm',
+ *    width: 320,
+ *    height: 240
+ * }, {
+ *    custom_param: 1
+ * });
+ *
+ * // Displays an alert box using the active editors window manager instance
+ * tinymce.activeEditor.windowManager.alert('Hello world!');
+ *
+ * // Displays an confirm box and an alert message will be displayed depending on what you choose in the confirm
+ * tinymce.activeEditor.windowManager.confirm("Do you want to do something", function(s) {
+ *    if (s)
+ *       tinymce.activeEditor.windowManager.alert("Ok");
+ *    else
+ *       tinymce.activeEditor.windowManager.alert("Cancel");
+ * });
+ */
+define("tinymce/WindowManager", [
+	"tinymce/ui/Window",
+	"tinymce/ui/MessageBox"
+], function(Window, MessageBox) {
+	return function(editor) {
+		var self = this, windows = [];
+
+		function getTopMostWindow() {
+			if (windows.length) {
+				return windows[windows.length - 1];
+			}
+		}
+
+		self.windows = windows;
+
+		editor.on('remove', function() {
+			var i = windows.length;
+
+			while (i--) {
+				windows[i].close();
+			}
+		});
+
+		/**
+		 * Opens a new window.
+		 *
+		 * @method open
+		 * @param {Object} args Optional name/value settings collection contains things like width/height/url etc.
+		 * @option {String} title Window title.
+		 * @option {String} file URL of the file to open in the window.
+		 * @option {Number} width Width in pixels.
+		 * @option {Number} height Height in pixels.
+		 * @option {Boolean} autoScroll Specifies whether the popup window can have scrollbars if required (i.e. content
+		 * larger than the popup size specified).
+		 */
+		self.open = function(args, params) {
+			var win;
+
+			editor.editorManager.setActive(editor);
+
+			args.title = args.title || ' ';
+
+			// Handle URL
+			args.url = args.url || args.file; // Legacy
+			if (args.url) {
+				args.width = parseInt(args.width || 320, 10);
+				args.height = parseInt(args.height || 240, 10);
+			}
+
+			// Handle body
+			if (args.body) {
+				args.items = {
+					defaults: args.defaults,
+					type: args.bodyType || 'form',
+					items: args.body
+				};
+			}
+
+			if (!args.url && !args.buttons) {
+				args.buttons = [
+					{text: 'Ok', subtype: 'primary', onclick: function() {
+						win.find('form')[0].submit();
+					}},
+
+					{text: 'Cancel', onclick: function() {
+						win.close();
+					}}
+				];
+			}
+
+			win = new Window(args);
+			windows.push(win);
+
+			win.on('close', function() {
+				var i = windows.length;
+
+				while (i--) {
+					if (windows[i] === win) {
+						windows.splice(i, 1);
+					}
+				}
+
+				if (!windows.length) {
+					editor.focus();
+				}
+			});
+
+			// Handle data
+			if (args.data) {
+				win.on('postRender', function() {
+					this.find('*').each(function(ctrl) {
+						var name = ctrl.name();
+
+						if (name in args.data) {
+							ctrl.value(args.data[name]);
+						}
+					});
+				});
+			}
+
+			// store args and parameters
+			win.features = args || {};
+			win.params = params || {};
+
+			// Takes a snapshot in the FocusManager of the selection before focus is lost to dialog
+			if (windows.length === 1) {
+				editor.nodeChanged();
+			}
+
+			return win.renderTo().reflow();
+		};
+
+		/**
+		 * Creates a alert dialog. Please don't use the blocking behavior of this
+		 * native version use the callback method instead then it can be extended.
+		 *
+		 * @method alert
+		 * @param {String} message Text to display in the new alert dialog.
+		 * @param {function} callback Callback function to be executed after the user has selected ok.
+		 * @param {Object} scope Optional scope to execute the callback in.
+		 * @example
+		 * // Displays an alert box using the active editors window manager instance
+		 * tinymce.activeEditor.windowManager.alert('Hello world!');
+		 */
+		self.alert = function(message, callback, scope) {
+			MessageBox.alert(message, function() {
+				if (callback) {
+					callback.call(scope || this);
+				} else {
+					editor.focus();
+				}
+			});
+		};
+
+		/**
+		 * Creates a confirm dialog. Please don't use the blocking behavior of this
+		 * native version use the callback method instead then it can be extended.
+		 *
+		 * @method confirm
+		 * @param {String} messageText to display in the new confirm dialog.
+		 * @param {function} callback Callback function to be executed after the user has selected ok or cancel.
+		 * @param {Object} scope Optional scope to execute the callback in.
+		 * @example
+		 * // Displays an confirm box and an alert message will be displayed depending on what you choose in the confirm
+		 * tinymce.activeEditor.windowManager.confirm("Do you want to do something", function(s) {
+		 *    if (s)
+		 *       tinymce.activeEditor.windowManager.alert("Ok");
+		 *    else
+		 *       tinymce.activeEditor.windowManager.alert("Cancel");
+		 * });
+		 */
+		self.confirm = function(message, callback, scope) {
+			MessageBox.confirm(message, function(state) {
+				callback.call(scope || this, state);
+			});
+		};
+
+		/**
+		 * Closes the top most window.
+		 *
+		 * @method close
+		 */
+		self.close = function() {
+			if (getTopMostWindow()) {
+				getTopMostWindow().close();
+			}
+		};
+
+		/**
+		 * Returns the params of the last window open call. This can be used in iframe based
+		 * dialog to get params passed from the tinymce plugin.
+		 *
+		 * @example
+		 * var dialogArguments = top.tinymce.activeEditor.windowManager.getParams();
+		 *
+		 * @method getParams
+		 * @return {Object} Name/value object with parameters passed from windowManager.open call.
+		 */
+		self.getParams = function() {
+			return getTopMostWindow() ? getTopMostWindow().params : null;
+		};
+
+		/**
+		 * Sets the params of the last opened window.
+		 *
+		 * @method setParams
+		 * @param {Object} params Params object to set for the last opened window.
+		 */
+		self.setParams = function(params) {
+			if (getTopMostWindow()) {
+				getTopMostWindow().params = params;
+			}
+		};
+
+		/**
+		 * Returns the currently opened window objects.
+		 *
+		 * @method getWindows
+		 * @return {Array} Array of the currently opened windows.
+		 */
+		self.getWindows = function() {
+			return windows;
+		};
+	};
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/BookmarkManager.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,389 @@
+/**
+ * BookmarkManager.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles selection bookmarks.
+ *
+ * @class tinymce.dom.BookmarkManager
+ */
+define("tinymce/dom/BookmarkManager", [
+	"tinymce/Env",
+	"tinymce/util/Tools"
+], function(Env, Tools) {
+	/**
+	 * Constructs a new BookmarkManager instance for a specific selection instance.
+	 *
+	 * @constructor
+	 * @method BookmarkManager
+	 * @param {tinymce.dom.Selection} selection Selection instance to handle bookmarks for.
+	 */
+	function BookmarkManager(selection) {
+		var dom = selection.dom;
+
+		/**
+		 * Returns a bookmark location for the current selection. This bookmark object
+		 * can then be used to restore the selection after some content modification to the document.
+		 *
+		 * @method getBookmark
+		 * @param {Number} type Optional state if the bookmark should be simple or not. Default is complex.
+		 * @param {Boolean} normalized Optional state that enables you to get a position that it would be after normalization.
+		 * @return {Object} Bookmark object, use moveToBookmark with this object to restore the selection.
+		 * @example
+		 * // Stores a bookmark of the current selection
+		 * var bm = tinymce.activeEditor.selection.getBookmark();
+		 *
+		 * tinymce.activeEditor.setContent(tinymce.activeEditor.getContent() + 'Some new content');
+		 *
+		 * // Restore the selection bookmark
+		 * tinymce.activeEditor.selection.moveToBookmark(bm);
+		 */
+		this.getBookmark = function(type, normalized) {
+			var rng, rng2, id, collapsed, name, element, chr = '&#xFEFF;', styles;
+
+			function findIndex(name, element) {
+				var index = 0;
+
+				Tools.each(dom.select(name), function(node, i) {
+					if (node == element) {
+						index = i;
+					}
+				});
+
+				return index;
+			}
+
+			function normalizeTableCellSelection(rng) {
+				function moveEndPoint(start) {
+					var container, offset, childNodes, prefix = start ? 'start' : 'end';
+
+					container = rng[prefix + 'Container'];
+					offset = rng[prefix + 'Offset'];
+
+					if (container.nodeType == 1 && container.nodeName == "TR") {
+						childNodes = container.childNodes;
+						container = childNodes[Math.min(start ? offset : offset - 1, childNodes.length - 1)];
+						if (container) {
+							offset = start ? 0 : container.childNodes.length;
+							rng['set' + (start ? 'Start' : 'End')](container, offset);
+						}
+					}
+				}
+
+				moveEndPoint(true);
+				moveEndPoint();
+
+				return rng;
+			}
+
+			function getLocation() {
+				var rng = selection.getRng(true), root = dom.getRoot(), bookmark = {};
+
+				function getPoint(rng, start) {
+					var container = rng[start ? 'startContainer' : 'endContainer'],
+						offset = rng[start ? 'startOffset' : 'endOffset'], point = [], node, childNodes, after = 0;
+
+					if (container.nodeType == 3) {
+						if (normalized) {
+							for (node = container.previousSibling; node && node.nodeType == 3; node = node.previousSibling) {
+								offset += node.nodeValue.length;
+							}
+						}
+
+						point.push(offset);
+					} else {
+						childNodes = container.childNodes;
+
+						if (offset >= childNodes.length && childNodes.length) {
+							after = 1;
+							offset = Math.max(0, childNodes.length - 1);
+						}
+
+						point.push(dom.nodeIndex(childNodes[offset], normalized) + after);
+					}
+
+					for (; container && container != root; container = container.parentNode) {
+						point.push(dom.nodeIndex(container, normalized));
+					}
+
+					return point;
+				}
+
+				bookmark.start = getPoint(rng, true);
+
+				if (!selection.isCollapsed()) {
+					bookmark.end = getPoint(rng);
+				}
+
+				return bookmark;
+			}
+
+			if (type == 2) {
+				element = selection.getNode();
+				name = element ? element.nodeName : null;
+
+				if (name == 'IMG') {
+					return {name: name, index: findIndex(name, element)};
+				}
+
+				if (selection.tridentSel) {
+					return selection.tridentSel.getBookmark(type);
+				}
+
+				return getLocation();
+			}
+
+			// Handle simple range
+			if (type) {
+				return {rng: selection.getRng()};
+			}
+
+			rng = selection.getRng();
+			id = dom.uniqueId();
+			collapsed = selection.isCollapsed();
+			styles = 'overflow:hidden;line-height:0px';
+
+			// Explorer method
+			if (rng.duplicate || rng.item) {
+				// Text selection
+				if (!rng.item) {
+					rng2 = rng.duplicate();
+
+					try {
+						// Insert start marker
+						rng.collapse();
+						rng.pasteHTML('<span data-mce-type="bookmark" id="' + id + '_start" style="' + styles + '">' + chr + '</span>');
+
+						// Insert end marker
+						if (!collapsed) {
+							rng2.collapse(false);
+
+							// Detect the empty space after block elements in IE and move the
+							// end back one character <p></p>] becomes <p>]</p>
+							rng.moveToElementText(rng2.parentElement());
+							if (rng.compareEndPoints('StartToEnd', rng2) === 0) {
+								rng2.move('character', -1);
+							}
+
+							rng2.pasteHTML('<span data-mce-type="bookmark" id="' + id + '_end" style="' + styles + '">' + chr + '</span>');
+						}
+					} catch (ex) {
+						// IE might throw unspecified error so lets ignore it
+						return null;
+					}
+				} else {
+					// Control selection
+					element = rng.item(0);
+					name = element.nodeName;
+
+					return {name: name, index: findIndex(name, element)};
+				}
+			} else {
+				element = selection.getNode();
+				name = element.nodeName;
+				if (name == 'IMG') {
+					return {name: name, index: findIndex(name, element)};
+				}
+
+				// W3C method
+				rng2 = normalizeTableCellSelection(rng.cloneRange());
+
+				// Insert end marker
+				if (!collapsed) {
+					rng2.collapse(false);
+					rng2.insertNode(dom.create('span', {'data-mce-type': "bookmark", id: id + '_end', style: styles}, chr));
+				}
+
+				rng = normalizeTableCellSelection(rng);
+				rng.collapse(true);
+				rng.insertNode(dom.create('span', {'data-mce-type': "bookmark", id: id + '_start', style: styles}, chr));
+			}
+
+			selection.moveToBookmark({id: id, keep: 1});
+
+			return {id: id};
+		};
+
+		/**
+		 * Restores the selection to the specified bookmark.
+		 *
+		 * @method moveToBookmark
+		 * @param {Object} bookmark Bookmark to restore selection from.
+		 * @return {Boolean} true/false if it was successful or not.
+		 * @example
+		 * // Stores a bookmark of the current selection
+		 * var bm = tinymce.activeEditor.selection.getBookmark();
+		 *
+		 * tinymce.activeEditor.setContent(tinymce.activeEditor.getContent() + 'Some new content');
+		 *
+		 * // Restore the selection bookmark
+		 * tinymce.activeEditor.selection.moveToBookmark(bm);
+		 */
+		this.moveToBookmark = function(bookmark) {
+			var rng, root, startContainer, endContainer, startOffset, endOffset;
+
+			function setEndPoint(start) {
+				var point = bookmark[start ? 'start' : 'end'], i, node, offset, children;
+
+				if (point) {
+					offset = point[0];
+
+					// Find container node
+					for (node = root, i = point.length - 1; i >= 1; i--) {
+						children = node.childNodes;
+
+						if (point[i] > children.length - 1) {
+							return;
+						}
+
+						node = children[point[i]];
+					}
+
+					// Move text offset to best suitable location
+					if (node.nodeType === 3) {
+						offset = Math.min(point[0], node.nodeValue.length);
+					}
+
+					// Move element offset to best suitable location
+					if (node.nodeType === 1) {
+						offset = Math.min(point[0], node.childNodes.length);
+					}
+
+					// Set offset within container node
+					if (start) {
+						rng.setStart(node, offset);
+					} else {
+						rng.setEnd(node, offset);
+					}
+				}
+
+				return true;
+			}
+
+			function restoreEndPoint(suffix) {
+				var marker = dom.get(bookmark.id + '_' + suffix), node, idx, next, prev, keep = bookmark.keep;
+
+				if (marker) {
+					node = marker.parentNode;
+
+					if (suffix == 'start') {
+						if (!keep) {
+							idx = dom.nodeIndex(marker);
+						} else {
+							node = marker.firstChild;
+							idx = 1;
+						}
+
+						startContainer = endContainer = node;
+						startOffset = endOffset = idx;
+					} else {
+						if (!keep) {
+							idx = dom.nodeIndex(marker);
+						} else {
+							node = marker.firstChild;
+							idx = 1;
+						}
+
+						endContainer = node;
+						endOffset = idx;
+					}
+
+					if (!keep) {
+						prev = marker.previousSibling;
+						next = marker.nextSibling;
+
+						// Remove all marker text nodes
+						Tools.each(Tools.grep(marker.childNodes), function(node) {
+							if (node.nodeType == 3) {
+								node.nodeValue = node.nodeValue.replace(/\uFEFF/g, '');
+							}
+						});
+
+						// Remove marker but keep children if for example contents where inserted into the marker
+						// Also remove duplicated instances of the marker for example by a
+						// split operation or by WebKit auto split on paste feature
+						while ((marker = dom.get(bookmark.id + '_' + suffix))) {
+							dom.remove(marker, 1);
+						}
+
+						// If siblings are text nodes then merge them unless it's Opera since it some how removes the node
+						// and we are sniffing since adding a lot of detection code for a browser with 3% of the market
+						// isn't worth the effort. Sorry, Opera but it's just a fact
+						if (prev && next && prev.nodeType == next.nodeType && prev.nodeType == 3 && !Env.opera) {
+							idx = prev.nodeValue.length;
+							prev.appendData(next.nodeValue);
+							dom.remove(next);
+
+							if (suffix == 'start') {
+								startContainer = endContainer = prev;
+								startOffset = endOffset = idx;
+							} else {
+								endContainer = prev;
+								endOffset = idx;
+							}
+						}
+					}
+				}
+			}
+
+			function addBogus(node) {
+				// Adds a bogus BR element for empty block elements
+				if (dom.isBlock(node) && !node.innerHTML && !Env.ie) {
+					node.innerHTML = '<br data-mce-bogus="1" />';
+				}
+
+				return node;
+			}
+
+			if (bookmark) {
+				if (bookmark.start) {
+					rng = dom.createRng();
+					root = dom.getRoot();
+
+					if (selection.tridentSel) {
+						return selection.tridentSel.moveToBookmark(bookmark);
+					}
+
+					if (setEndPoint(true) && setEndPoint()) {
+						selection.setRng(rng);
+					}
+				} else if (bookmark.id) {
+					// Restore start/end points
+					restoreEndPoint('start');
+					restoreEndPoint('end');
+
+					if (startContainer) {
+						rng = dom.createRng();
+						rng.setStart(addBogus(startContainer), startOffset);
+						rng.setEnd(addBogus(endContainer), endOffset);
+						selection.setRng(rng);
+					}
+				} else if (bookmark.name) {
+					selection.select(dom.select(bookmark.name)[bookmark.index]);
+				} else if (bookmark.rng) {
+					selection.setRng(bookmark.rng);
+				}
+			}
+		};
+	}
+
+	/**
+	 * Returns true/false if the specified node is a bookmark node or not.
+	 *
+	 * @static
+	 * @method isBookmarkNode
+	 * @param {DOMNode} node DOM Node to check if it's a bookmark node or not.
+	 * @return {Boolean} true/false if the node is a bookmark node or not.
+	 */
+	BookmarkManager.isBookmarkNode = function(node) {
+		return node && node.tagName === 'SPAN' && node.getAttribute('data-mce-type') === 'bookmark';
+	};
+
+	return BookmarkManager;
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/ControlSelection.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,593 @@
+/**
+ * ControlSelection.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles control selection of elements. Controls are elements
+ * that can be resized and needs to be selected as a whole. It adds custom resize handles
+ * to all browser engines that support properly disabling the built in resize logic.
+ *
+ * @class tinymce.dom.ControlSelection
+ */
+define("tinymce/dom/ControlSelection", [
+	"tinymce/util/VK",
+	"tinymce/util/Tools",
+	"tinymce/Env"
+], function(VK, Tools, Env) {
+	return function(selection, editor) {
+		var dom = editor.dom, each = Tools.each;
+		var selectedElm, selectedElmGhost, resizeHelper, resizeHandles, selectedHandle, lastMouseDownEvent;
+		var startX, startY, selectedElmX, selectedElmY, startW, startH, ratio, resizeStarted;
+		var width, height, editableDoc = editor.getDoc(), rootDocument = document, isIE = Env.ie && Env.ie < 11;
+		var abs = Math.abs, round = Math.round, rootElement = editor.getBody(), startScrollWidth, startScrollHeight;
+
+		// Details about each resize handle how to scale etc
+		resizeHandles = {
+			// Name: x multiplier, y multiplier, delta size x, delta size y
+			n: [0.5, 0, 0, -1],
+			e: [1, 0.5, 1, 0],
+			s: [0.5, 1, 0, 1],
+			w: [0, 0.5, -1, 0],
+			nw: [0, 0, -1, -1],
+			ne: [1, 0, 1, -1],
+			se: [1, 1, 1, 1],
+			sw: [0, 1, -1, 1]
+		};
+
+		// Add CSS for resize handles, cloned element and selected
+		var rootClass = '.mce-content-body';
+		editor.contentStyles.push(
+			rootClass + ' div.mce-resizehandle {' +
+				'position: absolute;' +
+				'border: 1px solid black;' +
+				'background: #FFF;' +
+				'width: 5px;' +
+				'height: 5px;' +
+				'z-index: 10000' +
+			'}' +
+			rootClass + ' .mce-resizehandle:hover {' +
+				'background: #000' +
+			'}' +
+			rootClass + ' img[data-mce-selected], hr[data-mce-selected] {' +
+				'outline: 1px solid black;' +
+				'resize: none' + // Have been talks about implementing this in browsers
+			'}' +
+			rootClass + ' .mce-clonedresizable {' +
+				'position: absolute;' +
+				(Env.gecko ? '' : 'outline: 1px dashed black;') + // Gecko produces trails while resizing
+				'opacity: .5;' +
+				'filter: alpha(opacity=50);' +
+				'z-index: 10000' +
+			'}' +
+			rootClass + ' .mce-resize-helper {' +
+				'background: #555;' +
+				'background: rgba(0,0,0,0.75);' +
+				'border-radius: 3px;' +
+				'border: 1px;' +
+				'color: white;' +
+				'display: none;' +
+				'font-family: sans-serif;' +
+				'font-size: 12px;' +
+				'white-space: nowrap;' +
+				'line-height: 14px;' +
+				'margin: 5px 10px;' +
+				'padding: 5px;' +
+				'position: absolute;' +
+				'z-index: 10001' +
+			'}'
+		);
+
+		function isResizable(elm) {
+			var selector = editor.settings.object_resizing;
+
+			if (selector === false || Env.iOS) {
+				return false;
+			}
+
+			if (typeof selector != 'string') {
+				selector = 'table,img,div';
+			}
+
+			if (elm.getAttribute('data-mce-resize') === 'false') {
+				return false;
+			}
+
+			return editor.dom.is(elm, selector);
+		}
+
+		function resizeGhostElement(e) {
+			var deltaX, deltaY, proportional;
+			var resizeHelperX, resizeHelperY;
+
+			// Calc new width/height
+			deltaX = e.screenX - startX;
+			deltaY = e.screenY - startY;
+
+			// Calc new size
+			width = deltaX * selectedHandle[2] + startW;
+			height = deltaY * selectedHandle[3] + startH;
+
+			// Never scale down lower than 5 pixels
+			width = width < 5 ? 5 : width;
+			height = height < 5 ? 5 : height;
+
+			if (selectedElm.nodeName == "IMG" && editor.settings.resize_img_proportional !== false) {
+				proportional = !VK.modifierPressed(e);
+			} else {
+				proportional = VK.modifierPressed(e) || (selectedElm.nodeName == "IMG" && selectedHandle[2] * selectedHandle[3] !== 0);
+			}
+
+			// Constrain proportions
+			if (proportional) {
+				if (abs(deltaX) > abs(deltaY)) {
+					height = round(width * ratio);
+					width = round(height / ratio);
+				} else {
+					width = round(height / ratio);
+					height = round(width * ratio);
+				}
+			}
+
+			// Update ghost size
+			dom.setStyles(selectedElmGhost, {
+				width: width,
+				height: height
+			});
+
+			// Update resize helper position
+			resizeHelperX = selectedHandle.startPos.x + deltaX;
+			resizeHelperY = selectedHandle.startPos.y + deltaY;
+			resizeHelperX = resizeHelperX > 0 ? resizeHelperX : 0;
+			resizeHelperY = resizeHelperY > 0 ? resizeHelperY : 0;
+
+			dom.setStyles(resizeHelper, {
+				left: resizeHelperX,
+				top: resizeHelperY,
+				display: 'block'
+			});
+
+			resizeHelper.innerHTML = width + ' &times; ' + height;
+
+			// Update ghost X position if needed
+			if (selectedHandle[2] < 0 && selectedElmGhost.clientWidth <= width) {
+				dom.setStyle(selectedElmGhost, 'left', selectedElmX + (startW - width));
+			}
+
+			// Update ghost Y position if needed
+			if (selectedHandle[3] < 0 && selectedElmGhost.clientHeight <= height) {
+				dom.setStyle(selectedElmGhost, 'top', selectedElmY + (startH - height));
+			}
+
+			// Calculate how must overflow we got
+			deltaX = rootElement.scrollWidth - startScrollWidth;
+			deltaY = rootElement.scrollHeight - startScrollHeight;
+
+			// Re-position the resize helper based on the overflow
+			if (deltaX + deltaY !== 0) {
+				dom.setStyles(resizeHelper, {
+					left: resizeHelperX - deltaX,
+					top: resizeHelperY - deltaY
+				});
+			}
+
+			if (!resizeStarted) {
+				editor.fire('ObjectResizeStart', {target: selectedElm, width: startW, height: startH});
+				resizeStarted = true;
+			}
+		}
+
+		function endGhostResize() {
+			resizeStarted = false;
+
+			function setSizeProp(name, value) {
+				if (value) {
+					// Resize by using style or attribute
+					if (selectedElm.style[name] || !editor.schema.isValid(selectedElm.nodeName.toLowerCase(), name)) {
+						dom.setStyle(selectedElm, name, value);
+					} else {
+						dom.setAttrib(selectedElm, name, value);
+					}
+				}
+			}
+
+			// Set width/height properties
+			setSizeProp('width', width);
+			setSizeProp('height', height);
+
+			dom.unbind(editableDoc, 'mousemove', resizeGhostElement);
+			dom.unbind(editableDoc, 'mouseup', endGhostResize);
+
+			if (rootDocument != editableDoc) {
+				dom.unbind(rootDocument, 'mousemove', resizeGhostElement);
+				dom.unbind(rootDocument, 'mouseup', endGhostResize);
+			}
+
+			// Remove ghost/helper and update resize handle positions
+			dom.remove(selectedElmGhost);
+			dom.remove(resizeHelper);
+
+			if (!isIE || selectedElm.nodeName == "TABLE") {
+				showResizeRect(selectedElm);
+			}
+
+			editor.fire('ObjectResized', {target: selectedElm, width: width, height: height});
+			dom.setAttrib(selectedElm, 'style', dom.getAttrib(selectedElm, 'style'));
+			editor.nodeChanged();
+		}
+
+		function showResizeRect(targetElm, mouseDownHandleName, mouseDownEvent) {
+			var position, targetWidth, targetHeight, e, rect;
+
+			unbindResizeHandleEvents();
+
+			// Get position and size of target
+			position = dom.getPos(targetElm, rootElement);
+			selectedElmX = position.x;
+			selectedElmY = position.y;
+			rect = targetElm.getBoundingClientRect(); // Fix for Gecko offsetHeight for table with caption
+			targetWidth = rect.width || (rect.right - rect.left);
+			targetHeight = rect.height || (rect.bottom - rect.top);
+
+			// Reset width/height if user selects a new image/table
+			if (selectedElm != targetElm) {
+				detachResizeStartListener();
+				selectedElm = targetElm;
+				width = height = 0;
+			}
+
+			// Makes it possible to disable resizing
+			e = editor.fire('ObjectSelected', {target: targetElm});
+
+			if (isResizable(targetElm) && !e.isDefaultPrevented()) {
+				each(resizeHandles, function(handle, name) {
+					var handleElm, handlerContainerElm;
+
+					function startDrag(e) {
+						startX = e.screenX;
+						startY = e.screenY;
+						startW = selectedElm.clientWidth;
+						startH = selectedElm.clientHeight;
+						ratio = startH / startW;
+						selectedHandle = handle;
+
+						handle.startPos = {
+							x: targetWidth * handle[0] + selectedElmX,
+							y: targetHeight * handle[1] + selectedElmY
+						};
+
+						startScrollWidth = rootElement.scrollWidth;
+						startScrollHeight = rootElement.scrollHeight;
+
+						selectedElmGhost = selectedElm.cloneNode(true);
+						dom.addClass(selectedElmGhost, 'mce-clonedresizable');
+						dom.setAttrib(selectedElmGhost, 'data-mce-bogus', 'all');
+						selectedElmGhost.contentEditable = false; // Hides IE move layer cursor
+						selectedElmGhost.unSelectabe = true;
+						dom.setStyles(selectedElmGhost, {
+							left: selectedElmX,
+							top: selectedElmY,
+							margin: 0
+						});
+
+						selectedElmGhost.removeAttribute('data-mce-selected');
+						rootElement.appendChild(selectedElmGhost);
+
+						dom.bind(editableDoc, 'mousemove', resizeGhostElement);
+						dom.bind(editableDoc, 'mouseup', endGhostResize);
+
+						if (rootDocument != editableDoc) {
+							dom.bind(rootDocument, 'mousemove', resizeGhostElement);
+							dom.bind(rootDocument, 'mouseup', endGhostResize);
+						}
+
+						resizeHelper = dom.add(rootElement, 'div', {
+							'class': 'mce-resize-helper',
+							'data-mce-bogus': 'all'
+						}, startW + ' &times; ' + startH);
+					}
+
+					if (mouseDownHandleName) {
+						// Drag started by IE native resizestart
+						if (name == mouseDownHandleName) {
+							startDrag(mouseDownEvent);
+						}
+
+						return;
+					}
+
+					// Get existing or render resize handle
+					handleElm = dom.get('mceResizeHandle' + name);
+					if (!handleElm) {
+						handlerContainerElm = rootElement;
+
+						handleElm = dom.add(handlerContainerElm, 'div', {
+							id: 'mceResizeHandle' + name,
+							'data-mce-bogus': 'all',
+							'class': 'mce-resizehandle',
+							unselectable: true,
+							style: 'cursor:' + name + '-resize; margin:0; padding:0'
+						});
+
+						// Hides IE move layer cursor
+						// If we set it on Chrome we get this wounderful bug: #6725
+						if (Env.ie) {
+							handleElm.contentEditable = false;
+						}
+					} else {
+						dom.show(handleElm);
+					}
+
+					if (!handle.elm) {
+						dom.bind(handleElm, 'mousedown', function(e) {
+							e.stopImmediatePropagation();
+							e.preventDefault();
+							startDrag(e);
+						});
+
+						handle.elm = handleElm;
+					}
+
+					// Position element
+					dom.setStyles(handleElm, {
+						left: (targetWidth * handle[0] + selectedElmX) - (handleElm.offsetWidth / 2),
+						top: (targetHeight * handle[1] + selectedElmY) - (handleElm.offsetHeight / 2)
+					});
+				});
+			} else {
+				hideResizeRect();
+			}
+
+			selectedElm.setAttribute('data-mce-selected', '1');
+		}
+
+		function hideResizeRect() {
+			var name, handleElm;
+
+			unbindResizeHandleEvents();
+
+			if (selectedElm) {
+				selectedElm.removeAttribute('data-mce-selected');
+			}
+
+			for (name in resizeHandles) {
+				handleElm = dom.get('mceResizeHandle' + name);
+				if (handleElm) {
+					dom.unbind(handleElm);
+					dom.remove(handleElm);
+				}
+			}
+		}
+
+		function updateResizeRect(e) {
+			var startElm, controlElm;
+
+			function isChildOrEqual(node, parent) {
+				if (node) {
+					do {
+						if (node === parent) {
+							return true;
+						}
+					} while ((node = node.parentNode));
+				}
+			}
+
+			// Ignore all events while resizing
+			if (resizeStarted) {
+				return;
+			}
+
+			// Remove data-mce-selected from all elements since they might have been copied using Ctrl+c/v
+			each(dom.select('img[data-mce-selected],hr[data-mce-selected]'), function(img) {
+				img.removeAttribute('data-mce-selected');
+			});
+
+			controlElm = e.type == 'mousedown' ? e.target : selection.getNode();
+			controlElm = dom.$(controlElm).closest(isIE ? 'table' : 'table,img,hr')[0];
+
+			if (isChildOrEqual(controlElm, rootElement)) {
+				disableGeckoResize();
+				startElm = selection.getStart(true);
+
+				if (isChildOrEqual(startElm, controlElm) && isChildOrEqual(selection.getEnd(true), controlElm)) {
+					if (!isIE || (controlElm != startElm && startElm.nodeName !== 'IMG')) {
+						showResizeRect(controlElm);
+						return;
+					}
+				}
+			}
+
+			hideResizeRect();
+		}
+
+		function attachEvent(elm, name, func) {
+			if (elm && elm.attachEvent) {
+				elm.attachEvent('on' + name, func);
+			}
+		}
+
+		function detachEvent(elm, name, func) {
+			if (elm && elm.detachEvent) {
+				elm.detachEvent('on' + name, func);
+			}
+		}
+
+		function resizeNativeStart(e) {
+			var target = e.srcElement, pos, name, corner, cornerX, cornerY, relativeX, relativeY;
+
+			pos = target.getBoundingClientRect();
+			relativeX = lastMouseDownEvent.clientX - pos.left;
+			relativeY = lastMouseDownEvent.clientY - pos.top;
+
+			// Figure out what corner we are draging on
+			for (name in resizeHandles) {
+				corner = resizeHandles[name];
+
+				cornerX = target.offsetWidth * corner[0];
+				cornerY = target.offsetHeight * corner[1];
+
+				if (abs(cornerX - relativeX) < 8 && abs(cornerY - relativeY) < 8) {
+					selectedHandle = corner;
+					break;
+				}
+			}
+
+			// Remove native selection and let the magic begin
+			resizeStarted = true;
+			editor.fire('ObjectResizeStart', {
+				target: selectedElm,
+				width: selectedElm.clientWidth,
+				height: selectedElm.clientHeight
+			});
+			editor.getDoc().selection.empty();
+			showResizeRect(target, name, lastMouseDownEvent);
+		}
+
+		function nativeControlSelect(e) {
+			var target = e.srcElement;
+
+			if (target != selectedElm) {
+				editor.fire('ObjectSelected', {target: target});
+				detachResizeStartListener();
+
+				if (target.id.indexOf('mceResizeHandle') === 0) {
+					e.returnValue = false;
+					return;
+				}
+
+				if (target.nodeName == 'IMG' || target.nodeName == 'TABLE') {
+					hideResizeRect();
+					selectedElm = target;
+					attachEvent(target, 'resizestart', resizeNativeStart);
+				}
+			}
+		}
+
+		function detachResizeStartListener() {
+			detachEvent(selectedElm, 'resizestart', resizeNativeStart);
+		}
+
+		function unbindResizeHandleEvents() {
+			for (var name in resizeHandles) {
+				var handle = resizeHandles[name];
+
+				if (handle.elm) {
+					dom.unbind(handle.elm);
+					delete handle.elm;
+				}
+			}
+		}
+
+		function disableGeckoResize() {
+			try {
+				// Disable object resizing on Gecko
+				editor.getDoc().execCommand('enableObjectResizing', false, false);
+			} catch (ex) {
+				// Ignore
+			}
+		}
+
+		function controlSelect(elm) {
+			var ctrlRng;
+
+			if (!isIE) {
+				return;
+			}
+
+			ctrlRng = editableDoc.body.createControlRange();
+
+			try {
+				ctrlRng.addElement(elm);
+				ctrlRng.select();
+				return true;
+			} catch (ex) {
+				// Ignore since the element can't be control selected for example a P tag
+			}
+		}
+
+		editor.on('init', function() {
+			if (isIE) {
+				// Hide the resize rect on resize and reselect the image
+				editor.on('ObjectResized', function(e) {
+					if (e.target.nodeName != 'TABLE') {
+						hideResizeRect();
+						controlSelect(e.target);
+					}
+				});
+
+				attachEvent(rootElement, 'controlselect', nativeControlSelect);
+
+				editor.on('mousedown', function(e) {
+					lastMouseDownEvent = e;
+				});
+			} else {
+				disableGeckoResize();
+
+				if (Env.ie >= 11) {
+					// TODO: Drag/drop doesn't work
+					editor.on('mouseup', function(e) {
+						var nodeName = e.target.nodeName;
+
+						if (!resizeStarted && /^(TABLE|IMG|HR)$/.test(nodeName)) {
+							editor.selection.select(e.target, nodeName == 'TABLE');
+							editor.nodeChanged();
+						}
+					});
+
+					editor.dom.bind(rootElement, 'mscontrolselect', function(e) {
+						if (/^(TABLE|IMG|HR)$/.test(e.target.nodeName)) {
+							e.preventDefault();
+
+							// This moves the selection from being a control selection to a text like selection like in WebKit #6753
+							// TODO: Fix this the day IE works like other browsers without this nasty native ugly control selections.
+							if (e.target.tagName == 'IMG') {
+								window.setTimeout(function() {
+									editor.selection.select(e.target);
+								}, 0);
+							}
+						}
+					});
+				}
+			}
+
+			editor.on('nodechange ResizeEditor', updateResizeRect);
+
+			// Update resize rect while typing in a table
+			editor.on('keydown keyup', function(e) {
+				if (selectedElm && selectedElm.nodeName == "TABLE") {
+					updateResizeRect(e);
+				}
+			});
+
+			editor.on('hide', hideResizeRect);
+
+			// Hide rect on focusout since it would float on top of windows otherwise
+			//editor.on('focusout', hideResizeRect);
+		});
+
+		editor.on('remove', unbindResizeHandleEvents);
+
+		function destroy() {
+			selectedElm = selectedElmGhost = null;
+
+			if (isIE) {
+				detachResizeStartListener();
+				detachEvent(rootElement, 'controlselect', nativeControlSelect);
+			}
+		}
+
+		return {
+			isResizable: isResizable,
+			showResizeRect: showResizeRect,
+			hideResizeRect: hideResizeRect,
+			updateResizeRect: updateResizeRect,
+			controlSelect: controlSelect,
+			destroy: destroy
+		};
+	};
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/DOMUtils.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1835 @@
+/**
+ * DOMUtils.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Utility class for various DOM manipulation and retrieval functions.
+ *
+ * @class tinymce.dom.DOMUtils
+ * @example
+ * // Add a class to an element by id in the page
+ * tinymce.DOM.addClass('someid', 'someclass');
+ *
+ * // Add a class to an element by id inside the editor
+ * tinymce.activeEditor.dom.addClass('someid', 'someclass');
+ */
+define("tinymce/dom/DOMUtils", [
+	"tinymce/dom/Sizzle",
+	"tinymce/dom/DomQuery",
+	"tinymce/html/Styles",
+	"tinymce/dom/EventUtils",
+	"tinymce/dom/TreeWalker",
+	"tinymce/dom/Range",
+	"tinymce/html/Entities",
+	"tinymce/Env",
+	"tinymce/util/Tools",
+	"tinymce/dom/StyleSheetLoader"
+], function(Sizzle, $, Styles, EventUtils, TreeWalker, Range, Entities, Env, Tools, StyleSheetLoader) {
+	// Shorten names
+	var each = Tools.each, is = Tools.is, grep = Tools.grep, trim = Tools.trim;
+	var isIE = Env.ie;
+	var simpleSelectorRe = /^([a-z0-9],?)+$/i;
+	var whiteSpaceRegExp = /^[ \t\r\n]*$/;
+
+	function setupAttrHooks(domUtils, settings) {
+		var attrHooks = {}, keepValues = settings.keep_values, keepUrlHook;
+
+		keepUrlHook = {
+			set: function($elm, value, name) {
+				if (settings.url_converter) {
+					value = settings.url_converter.call(settings.url_converter_scope || domUtils, value, name, $elm[0]);
+				}
+
+				$elm.attr('data-mce-' + name, value).attr(name, value);
+			},
+
+			get: function($elm, name) {
+				return $elm.attr('data-mce-' + name) || $elm.attr(name);
+			}
+		};
+
+		attrHooks = {
+			style: {
+				set: function($elm, value) {
+					if (value !== null && typeof value === 'object') {
+						$elm.css(value);
+						return;
+					}
+
+					if (keepValues) {
+						$elm.attr('data-mce-style', value);
+					}
+
+					$elm.attr('style', value);
+				},
+
+				get: function($elm) {
+					var value = $elm.attr('data-mce-style') || $elm.attr('style');
+
+					value = domUtils.serializeStyle(domUtils.parseStyle(value), $elm[0].nodeName);
+
+					return value;
+				}
+			}
+		};
+
+		if (keepValues) {
+			attrHooks.href = attrHooks.src = keepUrlHook;
+		}
+
+		return attrHooks;
+	}
+
+	/**
+	 * Constructs a new DOMUtils instance. Consult the Wiki for more details on settings etc for this class.
+	 *
+	 * @constructor
+	 * @method DOMUtils
+	 * @param {Document} d Document reference to bind the utility class to.
+	 * @param {settings} s Optional settings collection.
+	 */
+	function DOMUtils(doc, settings) {
+		var self = this, blockElementsMap;
+
+		self.doc = doc;
+		self.win = window;
+		self.files = {};
+		self.counter = 0;
+		self.stdMode = !isIE || doc.documentMode >= 8;
+		self.boxModel = !isIE || doc.compatMode == "CSS1Compat" || self.stdMode;
+		self.styleSheetLoader = new StyleSheetLoader(doc);
+		self.boundEvents = [];
+		self.settings = settings = settings || {};
+		self.schema = settings.schema;
+		self.styles = new Styles({
+			url_converter: settings.url_converter,
+			url_converter_scope: settings.url_converter_scope
+		}, settings.schema);
+
+		self.fixDoc(doc);
+		self.events = settings.ownEvents ? new EventUtils(settings.proxy) : EventUtils.Event;
+		self.attrHooks = setupAttrHooks(self, settings);
+		blockElementsMap = settings.schema ? settings.schema.getBlockElements() : {};
+		self.$ = $.overrideDefaults(function() {
+			return {
+				context: doc,
+				element: self.getRoot()
+			};
+		});
+
+		/**
+		 * Returns true/false if the specified element is a block element or not.
+		 *
+		 * @method isBlock
+		 * @param {Node/String} node Element/Node to check.
+		 * @return {Boolean} True/False state if the node is a block element or not.
+		 */
+		self.isBlock = function(node) {
+			// Fix for #5446
+			if (!node) {
+				return false;
+			}
+
+			// This function is called in module pattern style since it might be executed with the wrong this scope
+			var type = node.nodeType;
+
+			// If it's a node then check the type and use the nodeName
+			if (type) {
+				return !!(type === 1 && blockElementsMap[node.nodeName]);
+			}
+
+			return !!blockElementsMap[node];
+		};
+	}
+
+	DOMUtils.prototype = {
+		$$: function(elm) {
+			if (typeof elm == 'string') {
+				elm = this.get(elm);
+			}
+
+			return this.$(elm);
+		},
+
+		root: null,
+
+		fixDoc: function(doc) {
+			var settings = this.settings, name;
+
+			if (isIE && settings.schema) {
+				// Add missing HTML 4/5 elements to IE
+				('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(name) {
+					doc.createElement(name);
+				});
+
+				// Create all custom elements
+				for (name in settings.schema.getCustomElements()) {
+					doc.createElement(name);
+				}
+			}
+		},
+
+		clone: function(node, deep) {
+			var self = this, clone, doc;
+
+			// TODO: Add feature detection here in the future
+			if (!isIE || node.nodeType !== 1 || deep) {
+				return node.cloneNode(deep);
+			}
+
+			doc = self.doc;
+
+			// Make a HTML5 safe shallow copy
+			if (!deep) {
+				clone = doc.createElement(node.nodeName);
+
+				// Copy attribs
+				each(self.getAttribs(node), function(attr) {
+					self.setAttrib(clone, attr.nodeName, self.getAttrib(node, attr.nodeName));
+				});
+
+				return clone;
+			}
+
+			return clone.firstChild;
+		},
+
+		/**
+		 * Returns the root node of the document. This is normally the body but might be a DIV. Parents like getParent will not
+		 * go above the point of this root node.
+		 *
+		 * @method getRoot
+		 * @return {Element} Root element for the utility class.
+		 */
+		getRoot: function() {
+			var self = this;
+
+			return self.settings.root_element || self.doc.body;
+		},
+
+		/**
+		 * Returns the viewport of the window.
+		 *
+		 * @method getViewPort
+		 * @param {Window} win Optional window to get viewport of.
+		 * @return {Object} Viewport object with fields x, y, w and h.
+		 */
+		getViewPort: function(win) {
+			var doc, rootElm;
+
+			win = !win ? this.win : win;
+			doc = win.document;
+			rootElm = this.boxModel ? doc.documentElement : doc.body;
+
+			// Returns viewport size excluding scrollbars
+			return {
+				x: win.pageXOffset || rootElm.scrollLeft,
+				y: win.pageYOffset || rootElm.scrollTop,
+				w: win.innerWidth || rootElm.clientWidth,
+				h: win.innerHeight || rootElm.clientHeight
+			};
+		},
+
+		/**
+		 * Returns the rectangle for a specific element.
+		 *
+		 * @method getRect
+		 * @param {Element/String} elm Element object or element ID to get rectangle from.
+		 * @return {object} Rectangle for specified element object with x, y, w, h fields.
+		 */
+		getRect: function(elm) {
+			var self = this, pos, size;
+
+			elm = self.get(elm);
+			pos = self.getPos(elm);
+			size = self.getSize(elm);
+
+			return {
+				x: pos.x, y: pos.y,
+				w: size.w, h: size.h
+			};
+		},
+
+		/**
+		 * Returns the size dimensions of the specified element.
+		 *
+		 * @method getSize
+		 * @param {Element/String} elm Element object or element ID to get rectangle from.
+		 * @return {object} Rectangle for specified element object with w, h fields.
+		 */
+		getSize: function(elm) {
+			var self = this, w, h;
+
+			elm = self.get(elm);
+			w = self.getStyle(elm, 'width');
+			h = self.getStyle(elm, 'height');
+
+			// Non pixel value, then force offset/clientWidth
+			if (w.indexOf('px') === -1) {
+				w = 0;
+			}
+
+			// Non pixel value, then force offset/clientWidth
+			if (h.indexOf('px') === -1) {
+				h = 0;
+			}
+
+			return {
+				w: parseInt(w, 10) || elm.offsetWidth || elm.clientWidth,
+				h: parseInt(h, 10) || elm.offsetHeight || elm.clientHeight
+			};
+		},
+
+		/**
+		 * Returns a node by the specified selector function. This function will
+		 * loop through all parent nodes and call the specified function for each node.
+		 * If the function then returns true indicating that it has found what it was looking for, the loop execution will then end
+		 * and the node it found will be returned.
+		 *
+		 * @method getParent
+		 * @param {Node/String} node DOM node to search parents on or ID string.
+		 * @param {function} selector Selection function or CSS selector to execute on each node.
+		 * @param {Node} root Optional root element, never go below this point.
+		 * @return {Node} DOM Node or null if it wasn't found.
+		 */
+		getParent: function(node, selector, root) {
+			return this.getParents(node, selector, root, false);
+		},
+
+		/**
+		 * Returns a node list of all parents matching the specified selector function or pattern.
+		 * If the function then returns true indicating that it has found what it was looking for and that node will be collected.
+		 *
+		 * @method getParents
+		 * @param {Node/String} node DOM node to search parents on or ID string.
+		 * @param {function} selector Selection function to execute on each node or CSS pattern.
+		 * @param {Node} root Optional root element, never go below this point.
+		 * @return {Array} Array of nodes or null if it wasn't found.
+		 */
+		getParents: function(node, selector, root, collect) {
+			var self = this, selectorVal, result = [];
+
+			node = self.get(node);
+			collect = collect === undefined;
+
+			// Default root on inline mode
+			root = root || (self.getRoot().nodeName != 'BODY' ? self.getRoot().parentNode : null);
+
+			// Wrap node name as func
+			if (is(selector, 'string')) {
+				selectorVal = selector;
+
+				if (selector === '*') {
+					selector = function(node) {
+						return node.nodeType == 1;
+					};
+				} else {
+					selector = function(node) {
+						return self.is(node, selectorVal);
+					};
+				}
+			}
+
+			while (node) {
+				if (node == root || !node.nodeType || node.nodeType === 9) {
+					break;
+				}
+
+				if (!selector || selector(node)) {
+					if (collect) {
+						result.push(node);
+					} else {
+						return node;
+					}
+				}
+
+				node = node.parentNode;
+			}
+
+			return collect ? result : null;
+		},
+
+		/**
+		 * Returns the specified element by ID or the input element if it isn't a string.
+		 *
+		 * @method get
+		 * @param {String/Element} n Element id to look for or element to just pass though.
+		 * @return {Element} Element matching the specified id or null if it wasn't found.
+		 */
+		get: function(elm) {
+			var name;
+
+			if (elm && this.doc && typeof elm == 'string') {
+				name = elm;
+				elm = this.doc.getElementById(elm);
+
+				// IE and Opera returns meta elements when they match the specified input ID, but getElementsByName seems to do the trick
+				if (elm && elm.id !== name) {
+					return this.doc.getElementsByName(name)[1];
+				}
+			}
+
+			return elm;
+		},
+
+		/**
+		 * Returns the next node that matches selector or function
+		 *
+		 * @method getNext
+		 * @param {Node} node Node to find siblings from.
+		 * @param {String/function} selector Selector CSS expression or function.
+		 * @return {Node} Next node item matching the selector or null if it wasn't found.
+		 */
+		getNext: function(node, selector) {
+			return this._findSib(node, selector, 'nextSibling');
+		},
+
+		/**
+		 * Returns the previous node that matches selector or function
+		 *
+		 * @method getPrev
+		 * @param {Node} node Node to find siblings from.
+		 * @param {String/function} selector Selector CSS expression or function.
+		 * @return {Node} Previous node item matching the selector or null if it wasn't found.
+		 */
+		getPrev: function(node, selector) {
+			return this._findSib(node, selector, 'previousSibling');
+		},
+
+		// #ifndef jquery
+
+		/**
+		 * Selects specific elements by a CSS level 3 pattern. For example "div#a1 p.test".
+		 * This function is optimized for the most common patterns needed in TinyMCE but it also performs well enough
+		 * on more complex patterns.
+		 *
+		 * @method select
+		 * @param {String} selector CSS level 3 pattern to select/find elements by.
+		 * @param {Object} scope Optional root element/scope element to search in.
+		 * @return {Array} Array with all matched elements.
+		 * @example
+		 * // Adds a class to all paragraphs in the currently active editor
+		 * tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('p'), 'someclass');
+		 *
+		 * // Adds a class to all spans that have the test class in the currently active editor
+		 * tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('span.test'), 'someclass')
+		 */
+		select: function(selector, scope) {
+			var self = this;
+
+			/*eslint new-cap:0 */
+			return Sizzle(selector, self.get(scope) || self.settings.root_element || self.doc, []);
+		},
+
+		/**
+		 * Returns true/false if the specified element matches the specified css pattern.
+		 *
+		 * @method is
+		 * @param {Node/NodeList} elm DOM node to match or an array of nodes to match.
+		 * @param {String} selector CSS pattern to match the element against.
+		 */
+		is: function(elm, selector) {
+			var i;
+
+			// If it isn't an array then try to do some simple selectors instead of Sizzle for to boost performance
+			if (elm.length === undefined) {
+				// Simple all selector
+				if (selector === '*') {
+					return elm.nodeType == 1;
+				}
+
+				// Simple selector just elements
+				if (simpleSelectorRe.test(selector)) {
+					selector = selector.toLowerCase().split(/,/);
+					elm = elm.nodeName.toLowerCase();
+
+					for (i = selector.length - 1; i >= 0; i--) {
+						if (selector[i] == elm) {
+							return true;
+						}
+					}
+
+					return false;
+				}
+			}
+
+			// Is non element
+			if (elm.nodeType && elm.nodeType != 1) {
+				return false;
+			}
+
+			var elms = elm.nodeType ? [elm] : elm;
+
+			/*eslint new-cap:0 */
+			return Sizzle(selector, elms[0].ownerDocument || elms[0], null, elms).length > 0;
+		},
+
+		// #endif
+
+		/**
+		 * Adds the specified element to another element or elements.
+		 *
+		 * @method add
+		 * @param {String/Element/Array} parentElm Element id string, DOM node element or array of ids or elements to add to.
+		 * @param {String/Element} name Name of new element to add or existing element to add.
+		 * @param {Object} attrs Optional object collection with arguments to add to the new element(s).
+		 * @param {String} html Optional inner HTML contents to add for each element.
+		 * @return {Element/Array} Element that got created, or an array of created elements if multiple input elements
+		 * were passed in.
+		 * @example
+		 * // Adds a new paragraph to the end of the active editor
+		 * tinymce.activeEditor.dom.add(tinymce.activeEditor.getBody(), 'p', {title: 'my title'}, 'Some content');
+		 */
+		add: function(parentElm, name, attrs, html, create) {
+			var self = this;
+
+			return this.run(parentElm, function(parentElm) {
+				var newElm;
+
+				newElm = is(name, 'string') ? self.doc.createElement(name) : name;
+				self.setAttribs(newElm, attrs);
+
+				if (html) {
+					if (html.nodeType) {
+						newElm.appendChild(html);
+					} else {
+						self.setHTML(newElm, html);
+					}
+				}
+
+				return !create ? parentElm.appendChild(newElm) : newElm;
+			});
+		},
+
+		/**
+		 * Creates a new element.
+		 *
+		 * @method create
+		 * @param {String} name Name of new element.
+		 * @param {Object} attrs Optional object name/value collection with element attributes.
+		 * @param {String} html Optional HTML string to set as inner HTML of the element.
+		 * @return {Element} HTML DOM node element that got created.
+		 * @example
+		 * // Adds an element where the caret/selection is in the active editor
+		 * var el = tinymce.activeEditor.dom.create('div', {id: 'test', 'class': 'myclass'}, 'some content');
+		 * tinymce.activeEditor.selection.setNode(el);
+		 */
+		create: function(name, attrs, html) {
+			return this.add(this.doc.createElement(name), name, attrs, html, 1);
+		},
+
+		/**
+		 * Creates HTML string for element. The element will be closed unless an empty inner HTML string is passed in.
+		 *
+		 * @method createHTML
+		 * @param {String} name Name of new element.
+		 * @param {Object} attrs Optional object name/value collection with element attributes.
+		 * @param {String} html Optional HTML string to set as inner HTML of the element.
+		 * @return {String} String with new HTML element, for example: <a href="#">test</a>.
+		 * @example
+		 * // Creates a html chunk and inserts it at the current selection/caret location
+		 * tinymce.activeEditor.selection.setContent(tinymce.activeEditor.dom.createHTML('a', {href: 'test.html'}, 'some line'));
+		 */
+		createHTML: function(name, attrs, html) {
+			var outHtml = '', key;
+
+			outHtml += '<' + name;
+
+			for (key in attrs) {
+				if (attrs.hasOwnProperty(key) && attrs[key] !== null && typeof attrs[key] != 'undefined') {
+					outHtml += ' ' + key + '="' + this.encode(attrs[key]) + '"';
+				}
+			}
+
+			// A call to tinymce.is doesn't work for some odd reason on IE9 possible bug inside their JS runtime
+			if (typeof html != "undefined") {
+				return outHtml + '>' + html + '</' + name + '>';
+			}
+
+			return outHtml + ' />';
+		},
+
+		/**
+		 * Creates a document fragment out of the specified HTML string.
+		 *
+		 * @method createFragment
+		 * @param {String} html Html string to create fragment from.
+		 * @return {DocumentFragment} Document fragment node.
+		 */
+		createFragment: function(html) {
+			var frag, node, doc = this.doc, container;
+
+			container = doc.createElement("div");
+			frag = doc.createDocumentFragment();
+
+			if (html) {
+				container.innerHTML = html;
+			}
+
+			while ((node = container.firstChild)) {
+				frag.appendChild(node);
+			}
+
+			return frag;
+		},
+
+		/**
+		 * Removes/deletes the specified element(s) from the DOM.
+		 *
+		 * @method remove
+		 * @param {String/Element/Array} node ID of element or DOM element object or array containing multiple elements/ids.
+		 * @param {Boolean} keepChildren Optional state to keep children or not. If set to true all children will be
+		 * placed at the location of the removed element.
+		 * @return {Element/Array} HTML DOM element that got removed, or an array of removed elements if multiple input elements
+		 * were passed in.
+		 * @example
+		 * // Removes all paragraphs in the active editor
+		 * tinymce.activeEditor.dom.remove(tinymce.activeEditor.dom.select('p'));
+		 *
+		 * // Removes an element by id in the document
+		 * tinymce.DOM.remove('mydiv');
+		 */
+		remove: function(node, keepChildren) {
+			node = this.$$(node);
+
+			if (keepChildren) {
+				node.each(function() {
+					var child;
+
+					while ((child = this.firstChild)) {
+						if (child.nodeType == 3 && child.data.length === 0) {
+							this.removeChild(child);
+						} else {
+							this.parentNode.insertBefore(child, this);
+						}
+					}
+				}).remove();
+			} else {
+				node.remove();
+			}
+
+			return node.length > 1 ? node.toArray() : node[0];
+		},
+
+		/**
+		 * Sets the CSS style value on a HTML element. The name can be a camelcase string
+		 * or the CSS style name like background-color.
+		 *
+		 * @method setStyle
+		 * @param {String/Element/Array} n HTML element/Element ID or Array of elements/ids to set CSS style value on.
+		 * @param {String} na Name of the style value to set.
+		 * @param {String} v Value to set on the style.
+		 * @example
+		 * // Sets a style value on all paragraphs in the currently active editor
+		 * tinymce.activeEditor.dom.setStyle(tinymce.activeEditor.dom.select('p'), 'background-color', 'red');
+		 *
+		 * // Sets a style value to an element by id in the current document
+		 * tinymce.DOM.setStyle('mydiv', 'background-color', 'red');
+		 */
+		setStyle: function(elm, name, value) {
+			elm = this.$$(elm).css(name, value);
+
+			if (this.settings.update_styles) {
+				elm.attr('data-mce-style', null);
+			}
+		},
+
+		/**
+		 * Returns the current style or runtime/computed value of an element.
+		 *
+		 * @method getStyle
+		 * @param {String/Element} elm HTML element or element id string to get style from.
+		 * @param {String} name Style name to return.
+		 * @param {Boolean} computed Computed style.
+		 * @return {String} Current style or computed style value of an element.
+		 */
+		getStyle: function(elm, name, computed) {
+			elm = this.$$(elm);
+
+			if (computed) {
+				return elm.css(name);
+			}
+
+			// Camelcase it, if needed
+			name = name.replace(/-(\D)/g, function(a, b) {
+				return b.toUpperCase();
+			});
+
+			if (name == 'float') {
+				name = isIE ? 'styleFloat' : 'cssFloat';
+			}
+
+			return elm[0] && elm[0].style ? elm[0].style[name] : undefined;
+		},
+
+		/**
+		 * Sets multiple styles on the specified element(s).
+		 *
+		 * @method setStyles
+		 * @param {Element/String/Array} e DOM element, element id string or array of elements/ids to set styles on.
+		 * @param {Object} o Name/Value collection of style items to add to the element(s).
+		 * @example
+		 * // Sets styles on all paragraphs in the currently active editor
+		 * tinymce.activeEditor.dom.setStyles(tinymce.activeEditor.dom.select('p'), {'background-color': 'red', 'color': 'green'});
+		 *
+		 * // Sets styles to an element by id in the current document
+		 * tinymce.DOM.setStyles('mydiv', {'background-color': 'red', 'color': 'green'});
+		 */
+		setStyles: function(elm, styles) {
+			elm = this.$$(elm).css(styles);
+
+			if (this.settings.update_styles) {
+				elm.attr('data-mce-style', null);
+			}
+		},
+
+		/**
+		 * Removes all attributes from an element or elements.
+		 *
+		 * @method removeAllAttribs
+		 * @param {Element/String/Array} e DOM element, element id string or array of elements/ids to remove attributes from.
+		 */
+		removeAllAttribs: function(e) {
+			return this.run(e, function(e) {
+				var i, attrs = e.attributes;
+				for (i = attrs.length - 1; i >= 0; i--) {
+					e.removeAttributeNode(attrs.item(i));
+				}
+			});
+		},
+
+		/**
+		 * Sets the specified attribute of an element or elements.
+		 *
+		 * @method setAttrib
+		 * @param {Element/String/Array} e DOM element, element id string or array of elements/ids to set attribute on.
+		 * @param {String} n Name of attribute to set.
+		 * @param {String} v Value to set on the attribute - if this value is falsy like null, 0 or '' it will remove the attribute instead.
+		 * @example
+		 * // Sets class attribute on all paragraphs in the active editor
+		 * tinymce.activeEditor.dom.setAttrib(tinymce.activeEditor.dom.select('p'), 'class', 'myclass');
+		 *
+		 * // Sets class attribute on a specific element in the current page
+		 * tinymce.dom.setAttrib('mydiv', 'class', 'myclass');
+		 */
+		setAttrib: function(elm, name, value) {
+			var self = this, originalValue, hook, settings = self.settings;
+
+			if (value === '') {
+				value = null;
+			}
+
+			elm = self.$$(elm);
+			originalValue = elm.attr(name);
+
+			if (!elm.length) {
+				return;
+			}
+
+			hook = self.attrHooks[name];
+			if (hook && hook.set) {
+				hook.set(elm, value, name);
+			} else {
+				elm.attr(name, value);
+			}
+
+			if (originalValue != value && settings.onSetAttrib) {
+				settings.onSetAttrib({
+					attrElm: elm,
+					attrName: name,
+					attrValue: value
+				});
+			}
+		},
+
+		/**
+		 * Sets two or more specified attributes of an element or elements.
+		 *
+		 * @method setAttribs
+		 * @param {Element/String/Array} elm DOM element, element id string or array of elements/ids to set attributes on.
+		 * @param {Object} attrs Name/Value collection of attribute items to add to the element(s).
+		 * @example
+		 * // Sets class and title attributes on all paragraphs in the active editor
+		 * tinymce.activeEditor.dom.setAttribs(tinymce.activeEditor.dom.select('p'), {'class': 'myclass', title: 'some title'});
+		 *
+		 * // Sets class and title attributes on a specific element in the current page
+		 * tinymce.DOM.setAttribs('mydiv', {'class': 'myclass', title: 'some title'});
+		 */
+		setAttribs: function(elm, attrs) {
+			var self = this;
+
+			self.$$(elm).each(function(i, node) {
+				each(attrs, function(value, name) {
+					self.setAttrib(node, name, value);
+				});
+			});
+		},
+
+		/**
+		 * Returns the specified attribute by name.
+		 *
+		 * @method getAttrib
+		 * @param {String/Element} elm Element string id or DOM element to get attribute from.
+		 * @param {String} name Name of attribute to get.
+		 * @param {String} defaultVal Optional default value to return if the attribute didn't exist.
+		 * @return {String} Attribute value string, default value or null if the attribute wasn't found.
+		 */
+		getAttrib: function(elm, name, defaultVal) {
+			var self = this, hook, value;
+
+			elm = self.$$(elm);
+
+			if (elm.length) {
+				hook = self.attrHooks[name];
+
+				if (hook && hook.get) {
+					value = hook.get(elm, name);
+				} else {
+					value = elm.attr(name);
+				}
+			}
+
+			if (typeof value == 'undefined') {
+				value = defaultVal || '';
+			}
+
+			return value;
+		},
+
+		/**
+		 * Returns the absolute x, y position of a node. The position will be returned in an object with x, y fields.
+		 *
+		 * @method getPos
+		 * @param {Element/String} elm HTML element or element id to get x, y position from.
+		 * @param {Element} rootElm Optional root element to stop calculations at.
+		 * @return {object} Absolute position of the specified element object with x, y fields.
+		 */
+		getPos: function(elm, rootElm) {
+			var self = this, x = 0, y = 0, offsetParent, doc = self.doc, body = doc.body, pos;
+
+			elm = self.get(elm);
+			rootElm = rootElm || body;
+
+			if (elm) {
+				// Use getBoundingClientRect if it exists since it's faster than looping offset nodes
+				// Fallback to offsetParent calculations if the body isn't static better since it stops at the body root
+				if (rootElm === body && elm.getBoundingClientRect && $(body).css('position') === 'static') {
+					pos = elm.getBoundingClientRect();
+					rootElm = self.boxModel ? doc.documentElement : body;
+
+					// Add scroll offsets from documentElement or body since IE with the wrong box model will use d.body and so do WebKit
+					// Also remove the body/documentelement clientTop/clientLeft on IE 6, 7 since they offset the position
+					x = pos.left + (doc.documentElement.scrollLeft || body.scrollLeft) - rootElm.clientLeft;
+					y = pos.top + (doc.documentElement.scrollTop || body.scrollTop) - rootElm.clientTop;
+
+					return {x: x, y: y};
+				}
+
+				offsetParent = elm;
+				while (offsetParent && offsetParent != rootElm && offsetParent.nodeType) {
+					x += offsetParent.offsetLeft || 0;
+					y += offsetParent.offsetTop || 0;
+					offsetParent = offsetParent.offsetParent;
+				}
+
+				offsetParent = elm.parentNode;
+				while (offsetParent && offsetParent != rootElm && offsetParent.nodeType) {
+					x -= offsetParent.scrollLeft || 0;
+					y -= offsetParent.scrollTop || 0;
+					offsetParent = offsetParent.parentNode;
+				}
+			}
+
+			return {x: x, y: y};
+		},
+
+		/**
+		 * Parses the specified style value into an object collection. This parser will also
+		 * merge and remove any redundant items that browsers might have added. It will also convert non-hex
+		 * colors to hex values. Urls inside the styles will also be converted to absolute/relative based on settings.
+		 *
+		 * @method parseStyle
+		 * @param {String} cssText Style value to parse, for example: border:1px solid red;.
+		 * @return {Object} Object representation of that style, for example: {border: '1px solid red'}
+		 */
+		parseStyle: function(cssText) {
+			return this.styles.parse(cssText);
+		},
+
+		/**
+		 * Serializes the specified style object into a string.
+		 *
+		 * @method serializeStyle
+		 * @param {Object} styles Object to serialize as string, for example: {border: '1px solid red'}
+		 * @param {String} name Optional element name.
+		 * @return {String} String representation of the style object, for example: border: 1px solid red.
+		 */
+		serializeStyle: function(styles, name) {
+			return this.styles.serialize(styles, name);
+		},
+
+		/**
+		 * Adds a style element at the top of the document with the specified cssText content.
+		 *
+		 * @method addStyle
+		 * @param {String} cssText CSS Text style to add to top of head of document.
+		 */
+		addStyle: function(cssText) {
+			var self = this, doc = self.doc, head, styleElm;
+
+			// Prevent inline from loading the same styles twice
+			if (self !== DOMUtils.DOM && doc === document) {
+				var addedStyles = DOMUtils.DOM.addedStyles;
+
+				addedStyles = addedStyles || [];
+				if (addedStyles[cssText]) {
+					return;
+				}
+
+				addedStyles[cssText] = true;
+				DOMUtils.DOM.addedStyles = addedStyles;
+			}
+
+			// Create style element if needed
+			styleElm = doc.getElementById('mceDefaultStyles');
+			if (!styleElm) {
+				styleElm = doc.createElement('style');
+				styleElm.id = 'mceDefaultStyles';
+				styleElm.type = 'text/css';
+
+				head = doc.getElementsByTagName('head')[0];
+				if (head.firstChild) {
+					head.insertBefore(styleElm, head.firstChild);
+				} else {
+					head.appendChild(styleElm);
+				}
+			}
+
+			// Append style data to old or new style element
+			if (styleElm.styleSheet) {
+				styleElm.styleSheet.cssText += cssText;
+			} else {
+				styleElm.appendChild(doc.createTextNode(cssText));
+			}
+		},
+
+		/**
+		 * Imports/loads the specified CSS file into the document bound to the class.
+		 *
+		 * @method loadCSS
+		 * @param {String} u URL to CSS file to load.
+		 * @example
+		 * // Loads a CSS file dynamically into the current document
+		 * tinymce.DOM.loadCSS('somepath/some.css');
+		 *
+		 * // Loads a CSS file into the currently active editor instance
+		 * tinymce.activeEditor.dom.loadCSS('somepath/some.css');
+		 *
+		 * // Loads a CSS file into an editor instance by id
+		 * tinymce.get('someid').dom.loadCSS('somepath/some.css');
+		 *
+		 * // Loads multiple CSS files into the current document
+		 * tinymce.DOM.loadCSS('somepath/some.css,somepath/someother.css');
+		 */
+		loadCSS: function(url) {
+			var self = this, doc = self.doc, head;
+
+			// Prevent inline from loading the same CSS file twice
+			if (self !== DOMUtils.DOM && doc === document) {
+				DOMUtils.DOM.loadCSS(url);
+				return;
+			}
+
+			if (!url) {
+				url = '';
+			}
+
+			head = doc.getElementsByTagName('head')[0];
+
+			each(url.split(','), function(url) {
+				var link;
+
+				url = Tools._addCacheSuffix(url);
+
+				if (self.files[url]) {
+					return;
+				}
+
+				self.files[url] = true;
+				link = self.create('link', {rel: 'stylesheet', href: url});
+
+				// IE 8 has a bug where dynamically loading stylesheets would produce a 1 item remaining bug
+				// This fix seems to resolve that issue by recalcing the document once a stylesheet finishes loading
+				// It's ugly but it seems to work fine.
+				if (isIE && doc.documentMode && doc.recalc) {
+					link.onload = function() {
+						if (doc.recalc) {
+							doc.recalc();
+						}
+
+						link.onload = null;
+					};
+				}
+
+				head.appendChild(link);
+			});
+		},
+
+		/**
+		 * Adds a class to the specified element or elements.
+		 *
+		 * @method addClass
+		 * @param {String/Element/Array} elm Element ID string or DOM element or array with elements or IDs.
+		 * @param {String} cls Class name to add to each element.
+		 * @return {String/Array} String with new class value or array with new class values for all elements.
+		 * @example
+		 * // Adds a class to all paragraphs in the active editor
+		 * tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('p'), 'myclass');
+		 *
+		 * // Adds a class to a specific element in the current page
+		 * tinymce.DOM.addClass('mydiv', 'myclass');
+		 */
+		addClass: function(elm, cls) {
+			this.$$(elm).addClass(cls);
+		},
+
+		/**
+		 * Removes a class from the specified element or elements.
+		 *
+		 * @method removeClass
+		 * @param {String/Element/Array} elm Element ID string or DOM element or array with elements or IDs.
+		 * @param {String} cls Class name to remove from each element.
+		 * @return {String/Array} String of remaining class name(s), or an array of strings if multiple input elements
+		 * were passed in.
+		 * @example
+		 * // Removes a class from all paragraphs in the active editor
+		 * tinymce.activeEditor.dom.removeClass(tinymce.activeEditor.dom.select('p'), 'myclass');
+		 *
+		 * // Removes a class from a specific element in the current page
+		 * tinymce.DOM.removeClass('mydiv', 'myclass');
+		 */
+		removeClass: function(elm, cls) {
+			this.toggleClass(elm, cls, false);
+		},
+
+		/**
+		 * Returns true if the specified element has the specified class.
+		 *
+		 * @method hasClass
+		 * @param {String/Element} n HTML element or element id string to check CSS class on.
+		 * @param {String} c CSS class to check for.
+		 * @return {Boolean} true/false if the specified element has the specified class.
+		 */
+		hasClass: function(elm, cls) {
+			return this.$$(elm).hasClass(cls);
+		},
+
+		/**
+		 * Toggles the specified class on/off.
+		 *
+		 * @method toggleClass
+		 * @param {Element} elm Element to toggle class on.
+		 * @param {[type]} cls Class to toggle on/off.
+		 * @param {[type]} state Optional state to set.
+		 */
+		toggleClass: function(elm, cls, state) {
+			this.$$(elm).toggleClass(cls, state).each(function() {
+				if (this.className === '') {
+					$(this).attr('class', null);
+				}
+			});
+		},
+
+		/**
+		 * Shows the specified element(s) by ID by setting the "display" style.
+		 *
+		 * @method show
+		 * @param {String/Element/Array} elm ID of DOM element or DOM element or array with elements or IDs to show.
+		 */
+		show: function(elm) {
+			this.$$(elm).show();
+		},
+
+		/**
+		 * Hides the specified element(s) by ID by setting the "display" style.
+		 *
+		 * @method hide
+		 * @param {String/Element/Array} e ID of DOM element or DOM element or array with elements or IDs to hide.
+		 * @example
+		 * // Hides an element by id in the document
+		 * tinymce.DOM.hide('myid');
+		 */
+		hide: function(elm) {
+			this.$$(elm).hide();
+		},
+
+		/**
+		 * Returns true/false if the element is hidden or not by checking the "display" style.
+		 *
+		 * @method isHidden
+		 * @param {String/Element} e Id or element to check display state on.
+		 * @return {Boolean} true/false if the element is hidden or not.
+		 */
+		isHidden: function(elm) {
+			return this.$$(elm).css('display') == 'none';
+		},
+
+		/**
+		 * Returns a unique id. This can be useful when generating elements on the fly.
+		 * This method will not check if the element already exists.
+		 *
+		 * @method uniqueId
+		 * @param {String} prefix Optional prefix to add in front of all ids - defaults to "mce_".
+		 * @return {String} Unique id.
+		 */
+		uniqueId: function(prefix) {
+			return (!prefix ? 'mce_' : prefix) + (this.counter++);
+		},
+
+		/**
+		 * Sets the specified HTML content inside the element or elements. The HTML will first be processed. This means
+		 * URLs will get converted, hex color values fixed etc. Check processHTML for details.
+		 *
+		 * @method setHTML
+		 * @param {Element/String/Array} elm DOM element, element id string or array of elements/ids to set HTML inside of.
+		 * @param {String} h HTML content to set as inner HTML of the element.
+		 * @example
+		 * // Sets the inner HTML of all paragraphs in the active editor
+		 * tinymce.activeEditor.dom.setHTML(tinymce.activeEditor.dom.select('p'), 'some inner html');
+		 *
+		 * // Sets the inner HTML of an element by id in the document
+		 * tinymce.DOM.setHTML('mydiv', 'some inner html');
+		 */
+		setHTML: function(elm, html) {
+			elm = this.$$(elm);
+
+			if (isIE) {
+				elm.each(function(i, target) {
+					if (target.canHaveHTML === false) {
+						return;
+					}
+
+					// Remove all child nodes, IE keeps empty text nodes in DOM
+					while (target.firstChild) {
+						target.removeChild(target.firstChild);
+					}
+
+					try {
+						// IE will remove comments from the beginning
+						// unless you padd the contents with something
+						target.innerHTML = '<br>' + html;
+						target.removeChild(target.firstChild);
+					} catch (ex) {
+						// IE sometimes produces an unknown runtime error on innerHTML if it's a div inside a p
+						$('<div>').html('<br>' + html).contents().slice(1).appendTo(target);
+					}
+
+					return html;
+				});
+			} else {
+				elm.html(html);
+			}
+		},
+
+		/**
+		 * Returns the outer HTML of an element.
+		 *
+		 * @method getOuterHTML
+		 * @param {String/Element} elm Element ID or element object to get outer HTML from.
+		 * @return {String} Outer HTML string.
+		 * @example
+		 * tinymce.DOM.getOuterHTML(editorElement);
+		 * tinymce.activeEditor.getOuterHTML(tinymce.activeEditor.getBody());
+		 */
+		getOuterHTML: function(elm) {
+			elm = this.get(elm);
+
+			// Older FF doesn't have outerHTML 3.6 is still used by some orgaizations
+			return elm.nodeType == 1 && "outerHTML" in elm ? elm.outerHTML : $('<div>').append($(elm).clone()).html();
+		},
+
+		/**
+		 * Sets the specified outer HTML on an element or elements.
+		 *
+		 * @method setOuterHTML
+		 * @param {Element/String/Array} elm DOM element, element id string or array of elements/ids to set outer HTML on.
+		 * @param {Object} html HTML code to set as outer value for the element.
+		 * @param {Document} doc Optional document scope to use in this process - defaults to the document of the DOM class.
+		 * @example
+		 * // Sets the outer HTML of all paragraphs in the active editor
+		 * tinymce.activeEditor.dom.setOuterHTML(tinymce.activeEditor.dom.select('p'), '<div>some html</div>');
+		 *
+		 * // Sets the outer HTML of an element by id in the document
+		 * tinymce.DOM.setOuterHTML('mydiv', '<div>some html</div>');
+		 */
+		setOuterHTML: function(elm, html) {
+			var self = this;
+
+			self.$$(elm).each(function() {
+				try {
+					// Older FF doesn't have outerHTML 3.6 is still used by some orgaizations
+					if ("outerHTML" in this) {
+						this.outerHTML = html;
+						return;
+					}
+				} catch (ex) {
+					// Ignore
+				}
+
+				// OuterHTML for IE it sometimes produces an "unknown runtime error"
+				self.remove($(this).html(html), true);
+			});
+		},
+
+		/**
+		 * Entity decodes a string. This method decodes any HTML entities, such as &aring;.
+		 *
+		 * @method decode
+		 * @param {String} s String to decode entities on.
+		 * @return {String} Entity decoded string.
+		 */
+		decode: Entities.decode,
+
+		/**
+		 * Entity encodes a string. This method encodes the most common entities, such as <>"&.
+		 *
+		 * @method encode
+		 * @param {String} text String to encode with entities.
+		 * @return {String} Entity encoded string.
+		 */
+		encode: Entities.encodeAllRaw,
+
+		/**
+		 * Inserts an element after the reference element.
+		 *
+		 * @method insertAfter
+		 * @param {Element} node Element to insert after the reference.
+		 * @param {Element/String/Array} reference_node Reference element, element id or array of elements to insert after.
+		 * @return {Element/Array} Element that got added or an array with elements.
+		 */
+		insertAfter: function(node, referenceNode) {
+			referenceNode = this.get(referenceNode);
+
+			return this.run(node, function(node) {
+				var parent, nextSibling;
+
+				parent = referenceNode.parentNode;
+				nextSibling = referenceNode.nextSibling;
+
+				if (nextSibling) {
+					parent.insertBefore(node, nextSibling);
+				} else {
+					parent.appendChild(node);
+				}
+
+				return node;
+			});
+		},
+
+		/**
+		 * Replaces the specified element or elements with the new element specified. The new element will
+		 * be cloned if multiple input elements are passed in.
+		 *
+		 * @method replace
+		 * @param {Element} newElm New element to replace old ones with.
+		 * @param {Element/String/Array} oldELm Element DOM node, element id or array of elements or ids to replace.
+		 * @param {Boolean} k Optional keep children state, if set to true child nodes from the old object will be added to new ones.
+		 */
+		replace: function(newElm, oldElm, keepChildren) {
+			var self = this;
+
+			return self.run(oldElm, function(oldElm) {
+				if (is(oldElm, 'array')) {
+					newElm = newElm.cloneNode(true);
+				}
+
+				if (keepChildren) {
+					each(grep(oldElm.childNodes), function(node) {
+						newElm.appendChild(node);
+					});
+				}
+
+				return oldElm.parentNode.replaceChild(newElm, oldElm);
+			});
+		},
+
+		/**
+		 * Renames the specified element and keeps its attributes and children.
+		 *
+		 * @method rename
+		 * @param {Element} elm Element to rename.
+		 * @param {String} name Name of the new element.
+		 * @return {Element} New element or the old element if it needed renaming.
+		 */
+		rename: function(elm, name) {
+			var self = this, newElm;
+
+			if (elm.nodeName != name.toUpperCase()) {
+				// Rename block element
+				newElm = self.create(name);
+
+				// Copy attribs to new block
+				each(self.getAttribs(elm), function(attrNode) {
+					self.setAttrib(newElm, attrNode.nodeName, self.getAttrib(elm, attrNode.nodeName));
+				});
+
+				// Replace block
+				self.replace(newElm, elm, 1);
+			}
+
+			return newElm || elm;
+		},
+
+		/**
+		 * Find the common ancestor of two elements. This is a shorter method than using the DOM Range logic.
+		 *
+		 * @method findCommonAncestor
+		 * @param {Element} a Element to find common ancestor of.
+		 * @param {Element} b Element to find common ancestor of.
+		 * @return {Element} Common ancestor element of the two input elements.
+		 */
+		findCommonAncestor: function(a, b) {
+			var ps = a, pe;
+
+			while (ps) {
+				pe = b;
+
+				while (pe && ps != pe) {
+					pe = pe.parentNode;
+				}
+
+				if (ps == pe) {
+					break;
+				}
+
+				ps = ps.parentNode;
+			}
+
+			if (!ps && a.ownerDocument) {
+				return a.ownerDocument.documentElement;
+			}
+
+			return ps;
+		},
+
+		/**
+		 * Parses the specified RGB color value and returns a hex version of that color.
+		 *
+		 * @method toHex
+		 * @param {String} rgbVal RGB string value like rgb(1,2,3)
+		 * @return {String} Hex version of that RGB value like #FF00FF.
+		 */
+		toHex: function(rgbVal) {
+			return this.styles.toHex(Tools.trim(rgbVal));
+		},
+
+		/**
+		 * Executes the specified function on the element by id or dom element node or array of elements/id.
+		 *
+		 * @method run
+		 * @param {String/Element/Array} Element ID or DOM element object or array with ids or elements.
+		 * @param {function} f Function to execute for each item.
+		 * @param {Object} s Optional scope to execute the function in.
+		 * @return {Object/Array} Single object, or an array of objects if multiple input elements were passed in.
+		 */
+		run: function(elm, func, scope) {
+			var self = this, result;
+
+			if (typeof elm === 'string') {
+				elm = self.get(elm);
+			}
+
+			if (!elm) {
+				return false;
+			}
+
+			scope = scope || this;
+			if (!elm.nodeType && (elm.length || elm.length === 0)) {
+				result = [];
+
+				each(elm, function(elm, i) {
+					if (elm) {
+						if (typeof elm == 'string') {
+							elm = self.get(elm);
+						}
+
+						result.push(func.call(scope, elm, i));
+					}
+				});
+
+				return result;
+			}
+
+			return func.call(scope, elm);
+		},
+
+		/**
+		 * Returns a NodeList with attributes for the element.
+		 *
+		 * @method getAttribs
+		 * @param {HTMLElement/string} elm Element node or string id to get attributes from.
+		 * @return {NodeList} NodeList with attributes.
+		 */
+		getAttribs: function(elm) {
+			var attrs;
+
+			elm = this.get(elm);
+
+			if (!elm) {
+				return [];
+			}
+
+			if (isIE) {
+				attrs = [];
+
+				// Object will throw exception in IE
+				if (elm.nodeName == 'OBJECT') {
+					return elm.attributes;
+				}
+
+				// IE doesn't keep the selected attribute if you clone option elements
+				if (elm.nodeName === 'OPTION' && this.getAttrib(elm, 'selected')) {
+					attrs.push({specified: 1, nodeName: 'selected'});
+				}
+
+				// It's crazy that this is faster in IE but it's because it returns all attributes all the time
+				var attrRegExp = /<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi;
+				elm.cloneNode(false).outerHTML.replace(attrRegExp, '').replace(/[\w:\-]+/gi, function(a) {
+					attrs.push({specified: 1, nodeName: a});
+				});
+
+				return attrs;
+			}
+
+			return elm.attributes;
+		},
+
+		/**
+		 * Returns true/false if the specified node is to be considered empty or not.
+		 *
+		 * @example
+		 * tinymce.DOM.isEmpty(node, {img: true});
+		 * @method isEmpty
+		 * @param {Object} elements Optional name/value object with elements that are automatically treated as non-empty elements.
+		 * @return {Boolean} true/false if the node is empty or not.
+		 */
+		isEmpty: function(node, elements) {
+			var self = this, i, attributes, type, walker, name, brCount = 0;
+
+			node = node.firstChild;
+			if (node) {
+				walker = new TreeWalker(node, node.parentNode);
+				elements = elements || (self.schema ? self.schema.getNonEmptyElements() : null);
+
+				do {
+					type = node.nodeType;
+
+					if (type === 1) {
+						// Ignore bogus elements
+						if (node.getAttribute('data-mce-bogus')) {
+							continue;
+						}
+
+						// Keep empty elements like <img />
+						name = node.nodeName.toLowerCase();
+						if (elements && elements[name]) {
+							// Ignore single BR elements in blocks like <p><br /></p> or <p><span><br /></span></p>
+							if (name === 'br') {
+								brCount++;
+								continue;
+							}
+
+							return false;
+						}
+
+						// Keep elements with data-bookmark attributes or name attribute like <a name="1"></a>
+						attributes = self.getAttribs(node);
+						i = attributes.length;
+						while (i--) {
+							name = attributes[i].nodeName;
+							if (name === "name" || name === 'data-mce-bookmark') {
+								return false;
+							}
+						}
+					}
+
+					// Keep comment nodes
+					if (type == 8) {
+						return false;
+					}
+
+					// Keep non whitespace text nodes
+					if ((type === 3 && !whiteSpaceRegExp.test(node.nodeValue))) {
+						return false;
+					}
+				} while ((node = walker.next()));
+			}
+
+			return brCount <= 1;
+		},
+
+		/**
+		 * Creates a new DOM Range object. This will use the native DOM Range API if it's
+		 * available. If it's not, it will fall back to the custom TinyMCE implementation.
+		 *
+		 * @method createRng
+		 * @return {DOMRange} DOM Range object.
+		 * @example
+		 * var rng = tinymce.DOM.createRng();
+		 * alert(rng.startContainer + "," + rng.startOffset);
+		 */
+		createRng: function() {
+			var doc = this.doc;
+
+			return doc.createRange ? doc.createRange() : new Range(this);
+		},
+
+		/**
+		 * Returns the index of the specified node within its parent.
+		 *
+		 * @method nodeIndex
+		 * @param {Node} node Node to look for.
+		 * @param {boolean} normalized Optional true/false state if the index is what it would be after a normalization.
+		 * @return {Number} Index of the specified node.
+		 */
+		nodeIndex: function(node, normalized) {
+			var idx = 0, lastNodeType, nodeType;
+
+			if (node) {
+				for (lastNodeType = node.nodeType, node = node.previousSibling; node; node = node.previousSibling) {
+					nodeType = node.nodeType;
+
+					// Normalize text nodes
+					if (normalized && nodeType == 3) {
+						if (nodeType == lastNodeType || !node.nodeValue.length) {
+							continue;
+						}
+					}
+					idx++;
+					lastNodeType = nodeType;
+				}
+			}
+
+			return idx;
+		},
+
+		/**
+		 * Splits an element into two new elements and places the specified split
+		 * element or elements between the new ones. For example splitting the paragraph at the bold element in
+		 * this example <p>abc<b>abc</b>123</p> would produce <p>abc</p><b>abc</b><p>123</p>.
+		 *
+		 * @method split
+		 * @param {Element} parentElm Parent element to split.
+		 * @param {Element} splitElm Element to split at.
+		 * @param {Element} replacementElm Optional replacement element to replace the split element with.
+		 * @return {Element} Returns the split element or the replacement element if that is specified.
+		 */
+		split: function(parentElm, splitElm, replacementElm) {
+			var self = this, r = self.createRng(), bef, aft, pa;
+
+			// W3C valid browsers tend to leave empty nodes to the left/right side of the contents - this makes sense
+			// but we don't want that in our code since it serves no purpose for the end user
+			// For example splitting this html at the bold element:
+			//   <p>text 1<span><b>CHOP</b></span>text 2</p>
+			// would produce:
+			//   <p>text 1<span></span></p><b>CHOP</b><p><span></span>text 2</p>
+			// this function will then trim off empty edges and produce:
+			//   <p>text 1</p><b>CHOP</b><p>text 2</p>
+			function trimNode(node) {
+				var i, children = node.childNodes, type = node.nodeType;
+
+				function surroundedBySpans(node) {
+					var previousIsSpan = node.previousSibling && node.previousSibling.nodeName == 'SPAN';
+					var nextIsSpan = node.nextSibling && node.nextSibling.nodeName == 'SPAN';
+					return previousIsSpan && nextIsSpan;
+				}
+
+				if (type == 1 && node.getAttribute('data-mce-type') == 'bookmark') {
+					return;
+				}
+
+				for (i = children.length - 1; i >= 0; i--) {
+					trimNode(children[i]);
+				}
+
+				if (type != 9) {
+					// Keep non whitespace text nodes
+					if (type == 3 && node.nodeValue.length > 0) {
+						// If parent element isn't a block or there isn't any useful contents for example "<p>   </p>"
+						// Also keep text nodes with only spaces if surrounded by spans.
+						// eg. "<p><span>a</span> <span>b</span></p>" should keep space between a and b
+						var trimmedLength = trim(node.nodeValue).length;
+						if (!self.isBlock(node.parentNode) || trimmedLength > 0 || trimmedLength === 0 && surroundedBySpans(node)) {
+							return;
+						}
+					} else if (type == 1) {
+						// If the only child is a bookmark then move it up
+						children = node.childNodes;
+
+						// TODO fix this complex if
+						if (children.length == 1 && children[0] && children[0].nodeType == 1 &&
+							children[0].getAttribute('data-mce-type') == 'bookmark') {
+							node.parentNode.insertBefore(children[0], node);
+						}
+
+						// Keep non empty elements or img, hr etc
+						if (children.length || /^(br|hr|input|img)$/i.test(node.nodeName)) {
+							return;
+						}
+					}
+
+					self.remove(node);
+				}
+
+				return node;
+			}
+
+			if (parentElm && splitElm) {
+				// Get before chunk
+				r.setStart(parentElm.parentNode, self.nodeIndex(parentElm));
+				r.setEnd(splitElm.parentNode, self.nodeIndex(splitElm));
+				bef = r.extractContents();
+
+				// Get after chunk
+				r = self.createRng();
+				r.setStart(splitElm.parentNode, self.nodeIndex(splitElm) + 1);
+				r.setEnd(parentElm.parentNode, self.nodeIndex(parentElm) + 1);
+				aft = r.extractContents();
+
+				// Insert before chunk
+				pa = parentElm.parentNode;
+				pa.insertBefore(trimNode(bef), parentElm);
+
+				// Insert middle chunk
+				if (replacementElm) {
+					pa.replaceChild(replacementElm, splitElm);
+				} else {
+					pa.insertBefore(splitElm, parentElm);
+				}
+
+				// Insert after chunk
+				pa.insertBefore(trimNode(aft), parentElm);
+				self.remove(parentElm);
+
+				return replacementElm || splitElm;
+			}
+		},
+
+		/**
+		 * Adds an event handler to the specified object.
+		 *
+		 * @method bind
+		 * @param {Element/Document/Window/Array} target Target element to bind events to.
+		 * handler to or an array of elements/ids/documents.
+		 * @param {String} name Name of event handler to add, for example: click.
+		 * @param {function} func Function to execute when the event occurs.
+		 * @param {Object} scope Optional scope to execute the function in.
+		 * @return {function} Function callback handler the same as the one passed in.
+		 */
+		bind: function(target, name, func, scope) {
+			var self = this;
+
+			if (Tools.isArray(target)) {
+				var i = target.length;
+
+				while (i--) {
+					target[i] = self.bind(target[i], name, func, scope);
+				}
+
+				return target;
+			}
+
+			// Collect all window/document events bound by editor instance
+			if (self.settings.collect && (target === self.doc || target === self.win)) {
+				self.boundEvents.push([target, name, func, scope]);
+			}
+
+			return self.events.bind(target, name, func, scope || self);
+		},
+
+		/**
+		 * Removes the specified event handler by name and function from an element or collection of elements.
+		 *
+		 * @method unbind
+		 * @param {Element/Document/Window/Array} target Target element to unbind events on.
+		 * @param {String} name Event handler name, for example: "click"
+		 * @param {function} func Function to remove.
+		 * @return {bool/Array} Bool state of true if the handler was removed, or an array of states if multiple input elements
+		 * were passed in.
+		 */
+		unbind: function(target, name, func) {
+			var self = this, i;
+
+			if (Tools.isArray(target)) {
+				i = target.length;
+
+				while (i--) {
+					target[i] = self.unbind(target[i], name, func);
+				}
+
+				return target;
+			}
+
+			// Remove any bound events matching the input
+			if (self.boundEvents && (target === self.doc || target === self.win)) {
+				i = self.boundEvents.length;
+
+				while (i--) {
+					var item = self.boundEvents[i];
+
+					if (target == item[0] && (!name || name == item[1]) && (!func || func == item[2])) {
+						this.events.unbind(item[0], item[1], item[2]);
+					}
+				}
+			}
+
+			return this.events.unbind(target, name, func);
+		},
+
+		/**
+		 * Fires the specified event name with object on target.
+		 *
+		 * @method fire
+		 * @param {Node/Document/Window} target Target element or object to fire event on.
+		 * @param {String} name Name of the event to fire.
+		 * @param {Object} evt Event object to send.
+		 * @return {Event} Event object.
+		 */
+		fire: function(target, name, evt) {
+			return this.events.fire(target, name, evt);
+		},
+
+		// Returns the content editable state of a node
+		getContentEditable: function(node) {
+			var contentEditable;
+
+			// Check type
+			if (!node || node.nodeType != 1) {
+				return null;
+			}
+
+			// Check for fake content editable
+			contentEditable = node.getAttribute("data-mce-contenteditable");
+			if (contentEditable && contentEditable !== "inherit") {
+				return contentEditable;
+			}
+
+			// Check for real content editable
+			return node.contentEditable !== "inherit" ? node.contentEditable : null;
+		},
+
+		getContentEditableParent: function(node) {
+			var root = this.getRoot(), state = null;
+
+			for (; node && node !== root; node = node.parentNode) {
+				state = this.getContentEditable(node);
+
+				if (state !== null) {
+					break;
+				}
+			}
+
+			return state;
+		},
+
+		/**
+		 * Destroys all internal references to the DOM to solve IE leak issues.
+		 *
+		 * @method destroy
+		 */
+		destroy: function() {
+			var self = this;
+
+			// Unbind all events bound to window/document by editor instance
+			if (self.boundEvents) {
+				var i = self.boundEvents.length;
+
+				while (i--) {
+					var item = self.boundEvents[i];
+					this.events.unbind(item[0], item[1], item[2]);
+				}
+
+				self.boundEvents = null;
+			}
+
+			// Restore sizzle document to window.document
+			// Since the current document might be removed producing "Permission denied" on IE see #6325
+			if (Sizzle.setDocument) {
+				Sizzle.setDocument();
+			}
+
+			self.win = self.doc = self.root = self.events = self.frag = null;
+		},
+
+		isChildOf: function(node, parent) {
+			while (node) {
+				if (parent === node) {
+					return true;
+				}
+
+				node = node.parentNode;
+			}
+
+			return false;
+		},
+
+		// #ifdef debug
+
+		dumpRng: function(r) {
+			return (
+				'startContainer: ' + r.startContainer.nodeName +
+				', startOffset: ' + r.startOffset +
+				', endContainer: ' + r.endContainer.nodeName +
+				', endOffset: ' + r.endOffset
+			);
+		},
+
+		// #endif
+
+		_findSib: function(node, selector, name) {
+			var self = this, func = selector;
+
+			if (node) {
+				// If expression make a function of it using is
+				if (typeof func == 'string') {
+					func = function(node) {
+						return self.is(node, selector);
+					};
+				}
+
+				// Loop all siblings
+				for (node = node[name]; node; node = node[name]) {
+					if (func(node)) {
+						return node;
+					}
+				}
+			}
+
+			return null;
+		}
+	};
+
+	/**
+	 * Instance of DOMUtils for the current document.
+	 *
+	 * @static
+	 * @property DOM
+	 * @type tinymce.dom.DOMUtils
+	 * @example
+	 * // Example of how to add a class to some element by id
+	 * tinymce.DOM.addClass('someid', 'someclass');
+	 */
+	DOMUtils.DOM = new DOMUtils(document);
+
+	return DOMUtils;
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/DomQuery.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1568 @@
+/**
+ * DomQuery.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class mimics most of the jQuery API:
+ *
+ * This is whats currently implemented:
+ * - Utility functions
+ * - DOM traversial
+ * - DOM manipulation
+ * - Event binding
+ *
+ * This is not currently implemented:
+ * - Dimension
+ * - Ajax
+ * - Animation
+ * - Advanced chaining
+ *
+ * @example
+ * var $ = tinymce.dom.DomQuery;
+ * $('p').attr('attr', 'value').addClass('class');
+ *
+ * @class tinymce.dom.DomQuery
+ */
+define("tinymce/dom/DomQuery", [
+	"tinymce/dom/EventUtils",
+	"tinymce/dom/Sizzle",
+	"tinymce/util/Tools",
+	"tinymce/Env"
+], function(EventUtils, Sizzle, Tools, Env) {
+	var doc = document, push = Array.prototype.push, slice = Array.prototype.slice;
+	var rquickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/;
+	var Event = EventUtils.Event, undef;
+
+	function isDefined(obj) {
+		return typeof obj !== 'undefined';
+	}
+
+	function isString(obj) {
+		return typeof obj === 'string';
+	}
+
+	function isWindow(obj) {
+		return obj && obj == obj.window;
+	}
+
+	function createFragment(html, fragDoc) {
+		var frag, node, container;
+
+		fragDoc = fragDoc || doc;
+		container = fragDoc.createElement('div');
+		frag = fragDoc.createDocumentFragment();
+		container.innerHTML = html;
+
+		while ((node = container.firstChild)) {
+			frag.appendChild(node);
+		}
+
+		return frag;
+	}
+
+	function domManipulate(targetNodes, sourceItem, callback, reverse) {
+		var i;
+
+		if (isString(sourceItem)) {
+			sourceItem = createFragment(sourceItem, getElementDocument(targetNodes[0]));
+		} else if (sourceItem.length && !sourceItem.nodeType) {
+			sourceItem = DomQuery.makeArray(sourceItem);
+
+			if (reverse) {
+				for (i = sourceItem.length - 1; i >= 0; i--) {
+					domManipulate(targetNodes, sourceItem[i], callback, reverse);
+				}
+			} else {
+				for (i = 0; i < sourceItem.length; i++) {
+					domManipulate(targetNodes, sourceItem[i], callback, reverse);
+				}
+			}
+
+			return targetNodes;
+		}
+
+		if (sourceItem.nodeType) {
+			i = targetNodes.length;
+			while (i--) {
+				callback.call(targetNodes[i], sourceItem);
+			}
+		}
+
+		return targetNodes;
+	}
+
+	function hasClass(node, className) {
+		return node && className && (' ' + node.className + ' ').indexOf(' ' + className + ' ') !== -1;
+	}
+
+	function wrap(elements, wrapper, all) {
+		var lastParent, newWrapper;
+
+		wrapper = DomQuery(wrapper)[0];
+
+		elements.each(function() {
+			var self = this;
+
+			if (!all || lastParent != self.parentNode) {
+				lastParent = self.parentNode;
+				newWrapper = wrapper.cloneNode(false);
+				self.parentNode.insertBefore(newWrapper, self);
+				newWrapper.appendChild(self);
+			} else {
+				newWrapper.appendChild(self);
+			}
+		});
+
+		return elements;
+	}
+
+	var numericCssMap = Tools.makeMap('fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom', ' ');
+	var booleanMap = Tools.makeMap('checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected', ' ');
+	var propFix = {
+		'for': 'htmlFor',
+		'class': 'className',
+		'readonly': 'readOnly'
+	};
+	var cssFix = {
+		'float': 'cssFloat'
+	};
+
+	var attrHooks = {}, cssHooks = {};
+
+	function DomQuery(selector, context) {
+		/*eslint new-cap:0 */
+		return new DomQuery.fn.init(selector, context);
+	}
+
+	function inArray(item, array) {
+		var i;
+
+		if (array.indexOf) {
+			return array.indexOf(item);
+		}
+
+		i = array.length;
+		while (i--) {
+			if (array[i] === item) {
+				return i;
+			}
+		}
+
+		return -1;
+	}
+
+	var whiteSpaceRegExp = /^\s*|\s*$/g;
+
+	function trim(str) {
+		return (str === null || str === undef) ? '' : ("" + str).replace(whiteSpaceRegExp, '');
+	}
+
+	function each(obj, callback) {
+		var length, key, i, undef, value;
+
+		if (obj) {
+			length = obj.length;
+
+			if (length === undef) {
+				// Loop object items
+				for (key in obj) {
+					if (obj.hasOwnProperty(key)) {
+						value = obj[key];
+						if (callback.call(value, key, value) === false) {
+							break;
+						}
+					}
+				}
+			} else {
+				// Loop array items
+				for (i = 0; i < length; i++) {
+					value = obj[i];
+					if (callback.call(value, i, value) === false) {
+						break;
+					}
+				}
+			}
+		}
+
+		return obj;
+	}
+
+	function grep(array, callback) {
+		var out = [];
+
+		each(array, function(i, item) {
+			if (callback(item, i)) {
+				out.push(item);
+			}
+		});
+
+		return out;
+	}
+
+	function getElementDocument(element) {
+		if (!element) {
+			return doc;
+		}
+
+		if (element.nodeType == 9) {
+			return element;
+		}
+
+		return element.ownerDocument;
+	}
+
+	DomQuery.fn = DomQuery.prototype = {
+		constructor: DomQuery,
+
+		/**
+		 * Selector for the current set.
+		 *
+		 * @property selector
+		 * @type String
+		 */
+		selector: "",
+
+		/**
+		 * Context used to create the set.
+		 *
+		 * @property context
+		 * @type Element
+		 */
+		context: null,
+
+		/**
+		 * Number of items in the current set.
+		 *
+		 * @property length
+		 * @type Number
+		 */
+		length: 0,
+
+		/**
+		 * Constructs a new DomQuery instance with the specified selector or context.
+		 *
+		 * @constructor
+		 * @method init
+		 * @param {String/Array/DomQuery} selector Optional CSS selector/Array or array like object or HTML string.
+		 * @param {Document/Element} context Optional context to search in.
+		 */
+		init: function(selector, context) {
+			var self = this, match, node;
+
+			if (!selector) {
+				return self;
+			}
+
+			if (selector.nodeType) {
+				self.context = self[0] = selector;
+				self.length = 1;
+
+				return self;
+			}
+
+			if (context && context.nodeType) {
+				self.context = context;
+			} else {
+				if (context) {
+					return DomQuery(selector).attr(context);
+				} else {
+					self.context = context = document;
+				}
+			}
+
+			if (isString(selector)) {
+				self.selector = selector;
+
+				if (selector.charAt(0) === "<" && selector.charAt(selector.length - 1) === ">" && selector.length >= 3) {
+					match = [null, selector, null];
+				} else {
+					match = rquickExpr.exec(selector);
+				}
+
+				if (match) {
+					if (match[1]) {
+						node = createFragment(selector, getElementDocument(context)).firstChild;
+
+						while (node) {
+							push.call(self, node);
+							node = node.nextSibling;
+						}
+					} else {
+						node = getElementDocument(context).getElementById(match[2]);
+
+						if (!node) {
+							return self;
+						}
+
+						if (node.id !== match[2]) {
+							return self.find(selector);
+						}
+
+						self.length = 1;
+						self[0] = node;
+					}
+				} else {
+					return DomQuery(context).find(selector);
+				}
+			} else {
+				this.add(selector, false);
+			}
+
+			return self;
+		},
+
+		/**
+		 * Converts the current set to an array.
+		 *
+		 * @method toArray
+		 * @param {Array} Array of all nodes in set.
+		 */
+		toArray: function() {
+			return Tools.toArray(this);
+		},
+
+		/**
+		 * Adds new nodes to the set.
+		 *
+		 * @method add
+		 * @param {Array/tinymce.dom.DomQuery} items Array of all nodes to add to set.
+		 * @return {tinymce.dom.DomQuery} New instance with nodes added.
+		 */
+		add: function(items, sort) {
+			var self = this, nodes, i;
+
+			if (isString(items)) {
+				return self.add(DomQuery(items));
+			}
+
+			if (sort !== false) {
+				nodes = DomQuery.unique(self.toArray().concat(DomQuery.makeArray(items)));
+				self.length = nodes.length;
+				for (i = 0; i < nodes.length; i++) {
+					self[i] = nodes[i];
+				}
+			} else {
+				push.apply(self, DomQuery.makeArray(items));
+			}
+
+			return self;
+		},
+
+		/**
+		 * Sets/gets attributes on the elements in the current set.
+		 *
+		 * @method attr
+		 * @param {String/Object} name Name of attribute to get or an object with attributes to set.
+		 * @param {String} value Optional value to set.
+		 * @return {tinymce.dom.DomQuery/String} Current set or the specified attribute when only the name is specified.
+		 */
+		attr: function(name, value) {
+			var self = this, hook;
+
+			if (typeof name === "object") {
+				each(name, function(name, value) {
+					self.attr(name, value);
+				});
+			} else if (isDefined(value)) {
+				this.each(function() {
+					var hook;
+
+					if (this.nodeType === 1) {
+						hook = attrHooks[name];
+						if (hook && hook.set) {
+							hook.set(this, value);
+							return;
+						}
+
+						if (value === null) {
+							this.removeAttribute(name, 2);
+						} else {
+							this.setAttribute(name, value, 2);
+						}
+					}
+				});
+			} else {
+				if (self[0] && self[0].nodeType === 1) {
+					hook = attrHooks[name];
+					if (hook && hook.get) {
+						return hook.get(self[0], name);
+					}
+
+					if (booleanMap[name]) {
+						return self.prop(name) ? name : undef;
+					}
+
+					value = self[0].getAttribute(name, 2);
+
+					if (value === null) {
+						value = undef;
+					}
+				}
+
+				return value;
+			}
+
+			return self;
+		},
+
+		/**
+		 * Removes attributse on the elements in the current set.
+		 *
+		 * @method removeAttr
+		 * @param {String/Object} name Name of attribute to remove.
+		 * @return {tinymce.dom.DomQuery/String} Current set.
+		 */
+		removeAttr: function(name) {
+			return this.attr(name, null);
+		},
+
+		/**
+		 * Sets/gets properties on the elements in the current set.
+		 *
+		 * @method attr
+		 * @param {String/Object} name Name of property to get or an object with properties to set.
+		 * @param {String} value Optional value to set.
+		 * @return {tinymce.dom.DomQuery/String} Current set or the specified property when only the name is specified.
+		 */
+		prop: function(name, value) {
+			var self = this;
+
+			name = propFix[name] || name;
+
+			if (typeof name === "object") {
+				each(name, function(name, value) {
+					self.prop(name, value);
+				});
+			} else if (isDefined(value)) {
+				this.each(function() {
+					if (this.nodeType == 1) {
+						this[name] = value;
+					}
+				});
+			} else {
+				if (self[0] && self[0].nodeType && name in self[0]) {
+					return self[0][name];
+				}
+
+				return value;
+			}
+
+			return self;
+		},
+
+		/**
+		 * Sets/gets styles on the elements in the current set.
+		 *
+		 * @method css
+		 * @param {String/Object} name Name of style to get or an object with styles to set.
+		 * @param {String} value Optional value to set.
+		 * @return {tinymce.dom.DomQuery/String} Current set or the specified style when only the name is specified.
+		 */
+		css: function(name, value) {
+			var self = this, elm, hook;
+
+			function camel(name) {
+				return name.replace(/-(\D)/g, function(a, b) {
+					return b.toUpperCase();
+				});
+			}
+
+			function dashed(name) {
+				return name.replace(/[A-Z]/g, function(a) {
+					return '-' + a;
+				});
+			}
+
+			if (typeof name === "object") {
+				each(name, function(name, value) {
+					self.css(name, value);
+				});
+			} else {
+				if (isDefined(value)) {
+					name = camel(name);
+
+					// Default px suffix on these
+					if (typeof value === 'number' && !numericCssMap[name]) {
+						value += 'px';
+					}
+
+					self.each(function() {
+						var style = this.style;
+
+						hook = cssHooks[name];
+						if (hook && hook.set) {
+							hook.set(this, value);
+							return;
+						}
+
+						try {
+							this.style[cssFix[name] || name] = value;
+						} catch (ex) {
+							// Ignore
+						}
+
+						if (value === null || value === '') {
+							if (style.removeProperty) {
+								style.removeProperty(dashed(name));
+							} else {
+								style.removeAttribute(name);
+							}
+						}
+					});
+				} else {
+					elm = self[0];
+
+					hook = cssHooks[name];
+					if (hook && hook.get) {
+						return hook.get(elm);
+					}
+
+					if (elm.ownerDocument.defaultView) {
+						try {
+							return elm.ownerDocument.defaultView.getComputedStyle(elm, null).getPropertyValue(dashed(name));
+						} catch (ex) {
+							return undef;
+						}
+					} else if (elm.currentStyle) {
+						return elm.currentStyle[camel(name)];
+					}
+				}
+			}
+
+			return self;
+		},
+
+		/**
+		 * Removes all nodes in set from the document.
+		 *
+		 * @method remove
+		 * @return {tinymce.dom.DomQuery} Current set with the removed nodes.
+		 */
+		remove: function() {
+			var self = this, node, i = this.length;
+
+			while (i--) {
+				node = self[i];
+				Event.clean(node);
+
+				if (node.parentNode) {
+					node.parentNode.removeChild(node);
+				}
+			}
+
+			return this;
+		},
+
+		/**
+		 * Empties all elements in set.
+		 *
+		 * @method empty
+		 * @return {tinymce.dom.DomQuery} Current set with the empty nodes.
+		 */
+		empty: function() {
+			var self = this, node, i = this.length;
+
+			while (i--) {
+				node = self[i];
+				while (node.firstChild) {
+					node.removeChild(node.firstChild);
+				}
+			}
+
+			return this;
+		},
+
+		/**
+		 * Sets or gets the HTML of the current set or first set node.
+		 *
+		 * @method html
+		 * @param {String} value Optional innerHTML value to set on each element.
+		 * @return {tinymce.dom.DomQuery/String} Current set or the innerHTML of the first element.
+		 */
+		html: function(value) {
+			var self = this, i;
+
+			if (isDefined(value)) {
+				i = self.length;
+
+				try {
+					while (i--) {
+						self[i].innerHTML = value;
+					}
+				} catch (ex) {
+					// Workaround for "Unknown runtime error" when DIV is added to P on IE
+					DomQuery(self[i]).empty().append(value);
+				}
+
+				return self;
+			}
+
+			return self[0] ? self[0].innerHTML : '';
+		},
+
+		/**
+		 * Sets or gets the text of the current set or first set node.
+		 *
+		 * @method text
+		 * @param {String} value Optional innerText value to set on each element.
+		 * @return {tinymce.dom.DomQuery/String} Current set or the innerText of the first element.
+		 */
+		text: function(value) {
+			var self = this, i;
+
+			if (isDefined(value)) {
+				i = self.length;
+				while (i--) {
+					if ("innerText" in self[i]) {
+						self[i].innerText = value;
+					} else {
+						self[0].textContent = value;
+					}
+				}
+
+				return self;
+			}
+
+			return self[0] ? (self[0].innerText || self[0].textContent) : '';
+		},
+
+		/**
+		 * Appends the specified node/html or node set to the current set nodes.
+		 *
+		 * @method append
+		 * @param {String/Element/Array/tinymce.dom.DomQuery} content Content to append to each element in set.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		append: function() {
+			return domManipulate(this, arguments, function(node) {
+				if (this.nodeType === 1) {
+					this.appendChild(node);
+				}
+			});
+		},
+
+		/**
+		 * Prepends the specified node/html or node set to the current set nodes.
+		 *
+		 * @method prepend
+		 * @param {String/Element/Array/tinymce.dom.DomQuery} content Content to prepend to each element in set.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		prepend: function() {
+			return domManipulate(this, arguments, function(node) {
+				if (this.nodeType === 1) {
+					this.insertBefore(node, this.firstChild);
+				}
+			}, true);
+		},
+
+		/**
+		 * Adds the specified elements before current set nodes.
+		 *
+		 * @method before
+		 * @param {String/Element/Array/tinymce.dom.DomQuery} content Content to add before to each element in set.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		before: function() {
+			var self = this;
+
+			if (self[0] && self[0].parentNode) {
+				return domManipulate(self, arguments, function(node) {
+					this.parentNode.insertBefore(node, this);
+				});
+			}
+
+			return self;
+		},
+
+		/**
+		 * Adds the specified elements after current set nodes.
+		 *
+		 * @method after
+		 * @param {String/Element/Array/tinymce.dom.DomQuery} content Content to add after to each element in set.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		after: function() {
+			var self = this;
+
+			if (self[0] && self[0].parentNode) {
+				return domManipulate(self, arguments, function(node) {
+					this.parentNode.insertBefore(node, this.nextSibling);
+				}, true);
+			}
+
+			return self;
+		},
+
+		/**
+		 * Appends the specified set nodes to the specified selector/instance.
+		 *
+		 * @method appendTo
+		 * @param {String/Element/Array/tinymce.dom.DomQuery} val Item to append the current set to.
+		 * @return {tinymce.dom.DomQuery} Current set with the appended nodes.
+		 */
+		appendTo: function(val) {
+			DomQuery(val).append(this);
+
+			return this;
+		},
+
+		/**
+		 * Prepends the specified set nodes to the specified selector/instance.
+		 *
+		 * @method prependTo
+		 * @param {String/Element/Array/tinymce.dom.DomQuery} val Item to prepend the current set to.
+		 * @return {tinymce.dom.DomQuery} Current set with the prepended nodes.
+		 */
+		prependTo: function(val) {
+			DomQuery(val).prepend(this);
+
+			return this;
+		},
+
+		/**
+		 * Replaces the nodes in set with the specified content.
+		 *
+		 * @method replaceWith
+		 * @param {String/Element/Array/tinymce.dom.DomQuery} content Content to replace nodes with.
+		 * @return {tinymce.dom.DomQuery} Set with replaced nodes.
+		 */
+		replaceWith: function(content) {
+			return this.before(content).remove();
+		},
+
+		/**
+		 * Wraps all elements in set with the specified wrapper.
+		 *
+		 * @method wrap
+		 * @param {String/Element/Array/tinymce.dom.DomQuery} content Content to wrap nodes with.
+		 * @return {tinymce.dom.DomQuery} Set with wrapped nodes.
+		 */
+		wrap: function(wrapper) {
+			return wrap(this, wrapper);
+		},
+
+		/**
+		 * Wraps all nodes in set with the specified wrapper. If the nodes are siblings all of them
+		 * will be wrapped in the same wrapper.
+		 *
+		 * @method wrapAll
+		 * @param {String/Element/Array/tinymce.dom.DomQuery} content Content to wrap nodes with.
+		 * @return {tinymce.dom.DomQuery} Set with wrapped nodes.
+		 */
+		wrapAll: function(wrapper) {
+			return wrap(this, wrapper, true);
+		},
+
+		/**
+		 * Wraps all elements inner contents in set with the specified wrapper.
+		 *
+		 * @method wrapInner
+		 * @param {String/Element/Array/tinymce.dom.DomQuery} content Content to wrap nodes with.
+		 * @return {tinymce.dom.DomQuery} Set with wrapped nodes.
+		 */
+		wrapInner: function(wrapper) {
+			this.each(function() {
+				DomQuery(this).contents().wrapAll(wrapper);
+			});
+
+			return this;
+		},
+
+		/**
+		 * Unwraps all elements by removing the parent element of each item in set.
+		 *
+		 * @method unwrap
+		 * @return {tinymce.dom.DomQuery} Set with unwrapped nodes.
+		 */
+		unwrap: function() {
+			return this.parent().each(function() {
+				DomQuery(this).replaceWith(this.childNodes);
+			});
+		},
+
+		/**
+		 * Clones all nodes in set.
+		 *
+		 * @method clone
+		 * @return {tinymce.dom.DomQuery} Set with cloned nodes.
+		 */
+		clone: function() {
+			var result = [];
+
+			this.each(function() {
+				result.push(this.cloneNode(true));
+			});
+
+			return DomQuery(result);
+		},
+
+		/**
+		 * Adds the specified class name to the current set elements.
+		 *
+		 * @method addClass
+		 * @param {String} className Class name to add.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		addClass: function(className) {
+			return this.toggleClass(className, true);
+		},
+
+		/**
+		 * Removes the specified class name to the current set elements.
+		 *
+		 * @method removeClass
+		 * @param {String} className Class name to remove.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		removeClass: function(className) {
+			return this.toggleClass(className, false);
+		},
+
+		/**
+		 * Toggles the specified class name on the current set elements.
+		 *
+		 * @method toggleClass
+		 * @param {String} className Class name to add/remove.
+		 * @param {Boolean} state Optional state to toggle on/off.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		toggleClass: function(className, state) {
+			var self = this;
+
+			// Functions are not supported
+			if (typeof className != 'string') {
+				return self;
+			}
+
+			if (className.indexOf(' ') !== -1) {
+				each(className.split(' '), function() {
+					self.toggleClass(this, state);
+				});
+			} else {
+				self.each(function(index, node) {
+					var existingClassName, classState;
+
+					classState = hasClass(node, className);
+					if (classState !== state) {
+						existingClassName = node.className;
+
+						if (classState) {
+							node.className = trim((" " + existingClassName + " ").replace(' ' + className + ' ', ' '));
+						} else {
+							node.className += existingClassName ? ' ' + className : className;
+						}
+					}
+				});
+			}
+
+			return self;
+		},
+
+		/**
+		 * Returns true/false if the first item in set has the specified class.
+		 *
+		 * @method hasClass
+		 * @param {String} className Class name to check for.
+		 * @return {Boolean} True/false if the set has the specified class.
+		 */
+		hasClass: function(className) {
+			return hasClass(this[0], className);
+		},
+
+		/**
+		 * Executes the callback function for each item DomQuery collection. If you return false in the
+		 * callback it will break the loop.
+		 *
+		 * @method each
+		 * @param {function} callback Callback function to execute for each item.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		each: function(callback) {
+			return each(this, callback);
+		},
+
+		/**
+		 * Binds an event with callback function to the elements in set.
+		 *
+		 * @method on
+		 * @param {String} name Name of the event to bind.
+		 * @param {function} callback Callback function to execute when the event occurs.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		on: function(name, callback) {
+			return this.each(function() {
+				Event.bind(this, name, callback);
+			});
+		},
+
+		/**
+		 * Unbinds an event with callback function to the elements in set.
+		 *
+		 * @method off
+		 * @param {String} name Optional name of the event to bind.
+		 * @param {function} callback Optional callback function to execute when the event occurs.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		off: function(name, callback) {
+			return this.each(function() {
+				Event.unbind(this, name, callback);
+			});
+		},
+
+		/**
+		 * Triggers the specified event by name or event object.
+		 *
+		 * @method trigger
+		 * @param {String/Object} name Name of the event to trigger or event object.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		trigger: function(name) {
+			return this.each(function() {
+				if (typeof name == 'object') {
+					Event.fire(this, name.type, name);
+				} else {
+					Event.fire(this, name);
+				}
+			});
+		},
+
+		/**
+		 * Shows all elements in set.
+		 *
+		 * @method show
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		show: function() {
+			return this.css('display', '');
+		},
+
+		/**
+		 * Hides all elements in set.
+		 *
+		 * @method hide
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		hide: function() {
+			return this.css('display', 'none');
+		},
+
+		/**
+		 * Slices the current set.
+		 *
+		 * @method slice
+		 * @param {Number} start Start index to slice at.
+		 * @param {Number} end Optional ened index to end slice at.
+		 * @return {tinymce.dom.DomQuery} Sliced set.
+		 */
+		slice: function() {
+			return new DomQuery(slice.apply(this, arguments));
+		},
+
+		/**
+		 * Makes the set equal to the specified index.
+		 *
+		 * @method eq
+		 * @param {Number} index Index to set it equal to.
+		 * @return {tinymce.dom.DomQuery} Single item set.
+		 */
+		eq: function(index) {
+			return index === -1 ? this.slice(index) : this.slice(index, +index + 1);
+		},
+
+		/**
+		 * Makes the set equal to first element in set.
+		 *
+		 * @method first
+		 * @return {tinymce.dom.DomQuery} Single item set.
+		 */
+		first: function() {
+			return this.eq(0);
+		},
+
+		/**
+		 * Makes the set equal to last element in set.
+		 *
+		 * @method last
+		 * @return {tinymce.dom.DomQuery} Single item set.
+		 */
+		last: function() {
+			return this.eq(-1);
+		},
+
+		/**
+		 * Finds elements by the specified selector for each element in set.
+		 *
+		 * @method find
+		 * @param {String} selector Selector to find elements by.
+		 * @return {tinymce.dom.DomQuery} Set with matches elements.
+		 */
+		find: function(selector) {
+			var i, l, ret = [];
+
+			for (i = 0, l = this.length; i < l; i++) {
+				DomQuery.find(selector, this[i], ret);
+			}
+
+			return DomQuery(ret);
+		},
+
+		/**
+		 * Filters the current set with the specified selector.
+		 *
+		 * @method filter
+		 * @param {String/function} selector Selector to filter elements by.
+		 * @return {tinymce.dom.DomQuery} Set with filtered elements.
+		 */
+		filter: function(selector) {
+			if (typeof selector == 'function') {
+				return DomQuery(grep(this.toArray(), function(item, i) {
+					return selector(i, item);
+				}));
+			}
+
+			return DomQuery(DomQuery.filter(selector, this.toArray()));
+		},
+
+		/**
+		 * Gets the current node or any partent matching the specified selector.
+		 *
+		 * @method closest
+		 * @param {String/Element/tinymce.dom.DomQuery} selector Selector or element to find.
+		 * @return {tinymce.dom.DomQuery} Set with closest elements.
+		 */
+		closest: function(selector) {
+			var result = [];
+
+			if (selector instanceof DomQuery) {
+				selector = selector[0];
+			}
+
+			this.each(function(i, node) {
+				while (node) {
+					if (typeof selector == 'string' && DomQuery(node).is(selector)) {
+						result.push(node);
+						break;
+					} else if (node == selector) {
+						result.push(node);
+						break;
+					}
+
+					node = node.parentNode;
+				}
+			});
+
+			return DomQuery(result);
+		},
+
+		/**
+		 * Returns the offset of the first element in set or sets the top/left css properties of all elements in set.
+		 *
+		 * @method offset
+		 * @param {Object} offset Optional offset object to set on each item.
+		 * @return {Object/tinymce.dom.DomQuery} Returns the first element offset or the current set if you specified an offset.
+		 */
+		offset: function(offset) {
+			var elm, doc, docElm;
+			var x = 0, y = 0, pos;
+
+			if (!offset) {
+				elm = this[0];
+
+				if (elm) {
+					doc = elm.ownerDocument;
+					docElm = doc.documentElement;
+
+					if (elm.getBoundingClientRect) {
+						pos = elm.getBoundingClientRect();
+						x = pos.left + (docElm.scrollLeft || doc.body.scrollLeft) - docElm.clientLeft;
+						y = pos.top + (docElm.scrollTop || doc.body.scrollTop) - docElm.clientTop;
+					}
+				}
+
+				return {
+					left: x,
+					top: y
+				};
+			}
+
+			return this.css(offset);
+		},
+
+		push: push,
+		sort: [].sort,
+		splice: [].splice
+	};
+
+	// Static members
+	Tools.extend(DomQuery, {
+		/**
+		 * Extends the specified object with one or more objects.
+		 *
+		 * @static
+		 * @method extend
+		 * @param {Object} target Target object to extend with new items.
+		 * @param {Object..} object Object to extend the target with.
+		 * @return {Object} Extended input object.
+		 */
+		extend: Tools.extend,
+
+		/**
+		 * Creates an array out of an array like object.
+		 *
+		 * @static
+		 * @method makeArray
+		 * @param {Object} object Object to convert to array.
+		 * @return {Arrau} Array produced from object.
+		 */
+		makeArray: function(array) {
+			if (isWindow(array) || array.nodeType) {
+				return [array];
+			}
+
+			return Tools.toArray(array);
+		},
+
+		/**
+		 * Returns the index of the specified item inside the array.
+		 *
+		 * @static
+		 * @method inArray
+		 * @param {Object} item Item to look for.
+		 * @param {Array} array Array to look for item in.
+		 * @return {Number} Index of the item or -1.
+		 */
+		inArray: inArray,
+
+		/**
+		 * Returns true/false if the specified object is an array or not.
+		 *
+		 * @static
+		 * @method isArray
+		 * @param {Object} array Object to check if it's an array or not.
+		 * @return {Boolean} True/false if the object is an array.
+		 */
+		isArray: Tools.isArray,
+
+		/**
+		 * Executes the callback function for each item in array/object. If you return false in the
+		 * callback it will break the loop.
+		 *
+		 * @static
+		 * @method each
+		 * @param {Object} obj Object to iterate.
+		 * @param {function} callback Callback function to execute for each item.
+		 */
+		each: each,
+
+		/**
+		 * Removes whitespace from the beginning and end of a string.
+		 *
+		 * @static
+		 * @method trim
+		 * @param {String} str String to remove whitespace from.
+		 * @return {String} New string with removed whitespace.
+		 */
+		trim: trim,
+
+		/**
+		 * Filters out items from the input array by calling the specified function for each item.
+		 * If the function returns false the item will be excluded if it returns true it will be included.
+		 *
+		 * @static
+		 * @method grep
+		 * @param {Array} array Array of items to loop though.
+		 * @param {function} callback Function to call for each item. Include/exclude depends on it's return value.
+		 * @return {Array} New array with values imported and filtered based in input.
+		 * @example
+		 * // Filter out some items, this will return an array with 4 and 5
+		 * var items = DomQuery.grep([1, 2, 3, 4, 5], function(v) {return v > 3;});
+		 */
+		grep: grep,
+
+		// Sizzle
+		find: Sizzle,
+		expr: Sizzle.selectors,
+		unique: Sizzle.uniqueSort,
+		text: Sizzle.getText,
+		contains: Sizzle.contains,
+		filter: function(expr, elems, not) {
+			var i = elems.length;
+
+			if (not) {
+				expr = ":not(" + expr + ")";
+			}
+
+			while (i--) {
+				if (elems[i].nodeType != 1) {
+					elems.splice(i, 1);
+				}
+			}
+
+			if (elems.length === 1) {
+				elems = DomQuery.find.matchesSelector(elems[0], expr) ? [elems[0]] : [];
+			} else {
+				elems = DomQuery.find.matches(expr, elems);
+			}
+
+			return elems;
+		}
+	});
+
+	function dir(el, prop, until) {
+		var matched = [], cur = el[prop];
+
+		if (typeof until != 'string' && until instanceof DomQuery) {
+			until = until[0];
+		}
+
+		while (cur && cur.nodeType !== 9) {
+			if (until !== undefined) {
+				if (cur === until) {
+					break;
+				}
+
+				if (typeof until == 'string' && DomQuery(cur).is(until)) {
+					break;
+				}
+			}
+
+			if (cur.nodeType === 1) {
+				matched.push(cur);
+			}
+
+			cur = cur[prop];
+		}
+
+		return matched;
+	}
+
+	function sibling(node, siblingName, nodeType, until) {
+		var result = [];
+
+		if (until instanceof DomQuery) {
+			until = until[0];
+		}
+
+		for (; node; node = node[siblingName]) {
+			if (nodeType && node.nodeType !== nodeType) {
+				continue;
+			}
+
+			if (until !== undefined) {
+				if (node === until) {
+					break;
+				}
+
+				if (typeof until == 'string' && DomQuery(node).is(until)) {
+					break;
+				}
+			}
+
+			result.push(node);
+		}
+
+		return result;
+	}
+
+	function firstSibling(node, siblingName, nodeType) {
+		for (node = node[siblingName]; node; node = node[siblingName]) {
+			if (node.nodeType == nodeType) {
+				return node;
+			}
+		}
+
+		return null;
+	}
+
+	each({
+		/**
+		 * Returns a new collection with the parent of each item in current collection matching the optional selector.
+		 *
+		 * @method parent
+		 * @param {String} selector Selector to match parents agains.
+		 * @return {tinymce.dom.DomQuery} New DomQuery instance with all matching parents.
+		 */
+		parent: function(node) {
+			var parent = node.parentNode;
+
+			return parent && parent.nodeType !== 11 ? parent : null;
+		},
+
+		/**
+		 * Returns a new collection with the all the parents of each item in current collection matching the optional selector.
+		 *
+		 * @method parents
+		 * @param {String} selector Selector to match parents agains.
+		 * @return {tinymce.dom.DomQuery} New DomQuery instance with all matching parents.
+		 */
+		parents: function(node) {
+			return dir(node, "parentNode");
+		},
+
+		/**
+		 * Returns a new collection with next sibling of each item in current collection matching the optional selector.
+		 *
+		 * @method next
+		 * @param {String} selector Selector to match the next element against.
+		 * @return {tinymce.dom.DomQuery} New DomQuery instance with all matching elements.
+		 */
+		next: function(node) {
+			return firstSibling(node, 'nextSibling', 1);
+		},
+
+		/**
+		 * Returns a new collection with previous sibling of each item in current collection matching the optional selector.
+		 *
+		 * @method prev
+		 * @param {String} selector Selector to match the previous element against.
+		 * @return {tinymce.dom.DomQuery} New DomQuery instance with all matching elements.
+		 */
+		prev: function(node) {
+			return firstSibling(node, 'previousSibling', 1);
+		},
+
+		/**
+		 * Returns all child elements matching the optional selector.
+		 *
+		 * @method children
+		 * @param {String} selector Selector to match the elements against.
+		 * @return {tinymce.dom.DomQuery} New DomQuery instance with all matching elements.
+		 */
+		children: function(node) {
+			return sibling(node.firstChild, 'nextSibling', 1);
+		},
+
+		/**
+		 * Returns all child nodes matching the optional selector.
+		 *
+		 * @method contents
+		 * @return {tinymce.dom.DomQuery} New DomQuery instance with all matching elements.
+		 */
+		contents: function(node) {
+			return Tools.toArray((node.nodeName === "iframe" ? node.contentDocument || node.contentWindow.document : node).childNodes);
+		}
+	}, function(name, fn) {
+		DomQuery.fn[name] = function(selector) {
+			var self = this, result = [];
+
+			self.each(function() {
+				var nodes = fn.call(result, this, selector, result);
+
+				if (nodes) {
+					if (DomQuery.isArray(nodes)) {
+						result.push.apply(result, nodes);
+					} else {
+						result.push(nodes);
+					}
+				}
+			});
+
+			// If traversing on multiple elements we might get the same elements twice
+			if (this.length > 1) {
+				result = DomQuery.unique(result);
+
+				if (name.indexOf('parents') === 0) {
+					result = result.reverse();
+				}
+			}
+
+			result = DomQuery(result);
+
+			if (selector) {
+				return result.filter(selector);
+			}
+
+			return result;
+		};
+	});
+
+	each({
+		/**
+		 * Returns a new collection with the all the parents until the matching selector/element
+		 * of each item in current collection matching the optional selector.
+		 *
+		 * @method parentsUntil
+		 * @param {String/Element/tinymce.dom.DomQuery} until Until the matching selector or element.
+		 * @return {tinymce.dom.DomQuery} New DomQuery instance with all matching parents.
+		 */
+		parentsUntil: function(node, until) {
+			return dir(node, "parentNode", until);
+		},
+
+		/**
+		 * Returns a new collection with all next siblings of each item in current collection matching the optional selector.
+		 *
+		 * @method nextUntil
+		 * @param {String/Element/tinymce.dom.DomQuery} until Until the matching selector or element.
+		 * @return {tinymce.dom.DomQuery} New DomQuery instance with all matching elements.
+		 */
+		nextUntil: function(node, until) {
+			return sibling(node, 'nextSibling', 1, until).slice(1);
+		},
+
+		/**
+		 * Returns a new collection with all previous siblings of each item in current collection matching the optional selector.
+		 *
+		 * @method prevUntil
+		 * @param {String/Element/tinymce.dom.DomQuery} until Until the matching selector or element.
+		 * @return {tinymce.dom.DomQuery} New DomQuery instance with all matching elements.
+		 */
+		prevUntil: function(node, until) {
+			return sibling(node, 'previousSibling', 1, until).slice(1);
+		}
+	}, function(name, fn) {
+		DomQuery.fn[name] = function(selector, filter) {
+			var self = this, result = [];
+
+			self.each(function() {
+				var nodes = fn.call(result, this, selector, result);
+
+				if (nodes) {
+					if (DomQuery.isArray(nodes)) {
+						result.push.apply(result, nodes);
+					} else {
+						result.push(nodes);
+					}
+				}
+			});
+
+			// If traversing on multiple elements we might get the same elements twice
+			if (this.length > 1) {
+				result = DomQuery.unique(result);
+
+				if (name.indexOf('parents') === 0 || name === 'prevUntil') {
+					result = result.reverse();
+				}
+			}
+
+			result = DomQuery(result);
+
+			if (filter) {
+				return result.filter(filter);
+			}
+
+			return result;
+		};
+	});
+
+	/**
+	 * Returns true/false if the current set items matches the selector.
+	 *
+	 * @method is
+	 * @param {String} selector Selector to match the elements against.
+	 * @return {Boolean} True/false if the current set matches the selector.
+	 */
+	DomQuery.fn.is = function(selector) {
+		return !!selector && this.filter(selector).length > 0;
+	};
+
+	DomQuery.fn.init.prototype = DomQuery.fn;
+
+	DomQuery.overrideDefaults = function(callback) {
+		var defaults;
+
+		function sub(selector, context) {
+			defaults = defaults || callback();
+
+			if (arguments.length === 0) {
+				selector = defaults.element;
+			}
+
+			if (!context) {
+				context = defaults.context;
+			}
+
+			return new sub.fn.init(selector, context);
+		}
+
+		DomQuery.extend(sub, this);
+
+		return sub;
+	};
+
+	function appendHooks(targetHooks, prop, hooks) {
+		each(hooks, function(name, func) {
+			targetHooks[name] = targetHooks[name] || {};
+			targetHooks[name][prop] = func;
+		});
+	}
+
+	if (Env.ie && Env.ie < 8) {
+		appendHooks(attrHooks, 'get', {
+			maxlength: function(elm) {
+				var value = elm.maxLength;
+
+				if (value === 0x7fffffff) {
+					return undef;
+				}
+
+				return value;
+			},
+
+			size: function(elm) {
+				var value = elm.size;
+
+				if (value === 20) {
+					return undef;
+				}
+
+				return value;
+			},
+
+			'class': function(elm) {
+				return elm.className;
+			},
+
+			style: function(elm) {
+				var value = elm.style.cssText;
+
+				if (value.length === 0) {
+					return undef;
+				}
+
+				return value;
+			}
+		});
+
+		appendHooks(attrHooks, 'set', {
+			'class': function(elm, value) {
+				elm.className = value;
+			},
+
+			style: function(elm, value) {
+				elm.style.cssText = value;
+			}
+		});
+	}
+
+	if (Env.ie && Env.ie < 9) {
+		/*jshint sub:true */
+		/*eslint dot-notation: 0*/
+		cssFix['float'] = 'styleFloat';
+
+		appendHooks(cssHooks, 'set', {
+			opacity: function(elm, value) {
+				var style = elm.style;
+
+				if (value === null || value === '') {
+					style.removeAttribute('filter');
+				} else {
+					style.zoom = 1;
+					style.filter = 'alpha(opacity=' + (value * 100) + ')';
+				}
+			}
+		});
+	}
+
+	DomQuery.attrHooks = attrHooks;
+	DomQuery.cssHooks = cssHooks;
+
+	return DomQuery;
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/ElementUtils.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,117 @@
+/**
+ * ElementUtils.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Utility class for various element specific functions.
+ *
+ * @private
+ */
+define("tinymce/dom/ElementUtils", [
+	"tinymce/dom/BookmarkManager",
+	"tinymce/util/Tools"
+], function(BookmarkManager, Tools) {
+	var each = Tools.each;
+
+	function ElementUtils(dom) {
+		/**
+		 * Compares two nodes and checks if it's attributes and styles matches.
+		 * This doesn't compare classes as items since their order is significant.
+		 *
+		 * @method compare
+		 * @param {Node} node1 First node to compare with.
+		 * @param {Node} node2 Second node to compare with.
+		 * @return {boolean} True/false if the nodes are the same or not.
+		 */
+		this.compare = function(node1, node2) {
+			// Not the same name
+			if (node1.nodeName != node2.nodeName) {
+				return false;
+			}
+
+			/**
+			 * Returns all the nodes attributes excluding internal ones, styles and classes.
+			 *
+			 * @private
+			 * @param {Node} node Node to get attributes from.
+			 * @return {Object} Name/value object with attributes and attribute values.
+			 */
+			function getAttribs(node) {
+				var attribs = {};
+
+				each(dom.getAttribs(node), function(attr) {
+					var name = attr.nodeName.toLowerCase();
+
+					// Don't compare internal attributes or style
+					if (name.indexOf('_') !== 0 && name !== 'style' && name !== 'data-mce-style') {
+						attribs[name] = dom.getAttrib(node, name);
+					}
+				});
+
+				return attribs;
+			}
+
+			/**
+			 * Compares two objects checks if it's key + value exists in the other one.
+			 *
+			 * @private
+			 * @param {Object} obj1 First object to compare.
+			 * @param {Object} obj2 Second object to compare.
+			 * @return {boolean} True/false if the objects matches or not.
+			 */
+			function compareObjects(obj1, obj2) {
+				var value, name;
+
+				for (name in obj1) {
+					// Obj1 has item obj2 doesn't have
+					if (obj1.hasOwnProperty(name)) {
+						value = obj2[name];
+
+						// Obj2 doesn't have obj1 item
+						if (typeof value == "undefined") {
+							return false;
+						}
+
+						// Obj2 item has a different value
+						if (obj1[name] != value) {
+							return false;
+						}
+
+						// Delete similar value
+						delete obj2[name];
+					}
+				}
+
+				// Check if obj 2 has something obj 1 doesn't have
+				for (name in obj2) {
+					// Obj2 has item obj1 doesn't have
+					if (obj2.hasOwnProperty(name)) {
+						return false;
+					}
+				}
+
+				return true;
+			}
+
+			// Attribs are not the same
+			if (!compareObjects(getAttribs(node1), getAttribs(node2))) {
+				return false;
+			}
+
+			// Styles are not the same
+			if (!compareObjects(dom.parseStyle(dom.getAttrib(node1, 'style')), dom.parseStyle(dom.getAttrib(node2, 'style')))) {
+				return false;
+			}
+
+			return !BookmarkManager.isBookmarkNode(node1) && !BookmarkManager.isBookmarkNode(node2);
+		};
+	}
+
+	return ElementUtils;
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/EventUtils.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,563 @@
+/**
+ * EventUtils.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*jshint loopfunc:true*/
+/*eslint no-loop-func:0 */
+
+/**
+ * This class wraps the browsers native event logic with more convenient methods.
+ *
+ * @class tinymce.dom.EventUtils
+ */
+define("tinymce/dom/EventUtils", [], function() {
+	"use strict";
+
+	var eventExpandoPrefix = "mce-data-";
+	var mouseEventRe = /^(?:mouse|contextmenu)|click/;
+	var deprecated = {keyLocation: 1, layerX: 1, layerY: 1, returnValue: 1};
+
+	/**
+	 * Binds a native event to a callback on the speified target.
+	 */
+	function addEvent(target, name, callback, capture) {
+		if (target.addEventListener) {
+			target.addEventListener(name, callback, capture || false);
+		} else if (target.attachEvent) {
+			target.attachEvent('on' + name, callback);
+		}
+	}
+
+	/**
+	 * Unbinds a native event callback on the specified target.
+	 */
+	function removeEvent(target, name, callback, capture) {
+		if (target.removeEventListener) {
+			target.removeEventListener(name, callback, capture || false);
+		} else if (target.detachEvent) {
+			target.detachEvent('on' + name, callback);
+		}
+	}
+
+	/**
+	 * Normalizes a native event object or just adds the event specific methods on a custom event.
+	 */
+	function fix(originalEvent, data) {
+		var name, event = data || {}, undef;
+
+		// Dummy function that gets replaced on the delegation state functions
+		function returnFalse() {
+			return false;
+		}
+
+		// Dummy function that gets replaced on the delegation state functions
+		function returnTrue() {
+			return true;
+		}
+
+		// Copy all properties from the original event
+		for (name in originalEvent) {
+			// layerX/layerY is deprecated in Chrome and produces a warning
+			if (!deprecated[name]) {
+				event[name] = originalEvent[name];
+			}
+		}
+
+		// Normalize target IE uses srcElement
+		if (!event.target) {
+			event.target = event.srcElement || document;
+		}
+
+		// Calculate pageX/Y if missing and clientX/Y available
+		if (originalEvent && mouseEventRe.test(originalEvent.type) && originalEvent.pageX === undef && originalEvent.clientX !== undef) {
+			var eventDoc = event.target.ownerDocument || document;
+			var doc = eventDoc.documentElement;
+			var body = eventDoc.body;
+
+			event.pageX = originalEvent.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) -
+				(doc && doc.clientLeft || body && body.clientLeft || 0);
+
+			event.pageY = originalEvent.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) -
+				(doc && doc.clientTop || body && body.clientTop || 0);
+		}
+
+		// Add preventDefault method
+		event.preventDefault = function() {
+			event.isDefaultPrevented = returnTrue;
+
+			// Execute preventDefault on the original event object
+			if (originalEvent) {
+				if (originalEvent.preventDefault) {
+					originalEvent.preventDefault();
+				} else {
+					originalEvent.returnValue = false; // IE
+				}
+			}
+		};
+
+		// Add stopPropagation
+		event.stopPropagation = function() {
+			event.isPropagationStopped = returnTrue;
+
+			// Execute stopPropagation on the original event object
+			if (originalEvent) {
+				if (originalEvent.stopPropagation) {
+					originalEvent.stopPropagation();
+				} else {
+					originalEvent.cancelBubble = true; // IE
+				}
+			}
+		};
+
+		// Add stopImmediatePropagation
+		event.stopImmediatePropagation = function() {
+			event.isImmediatePropagationStopped = returnTrue;
+			event.stopPropagation();
+		};
+
+		// Add event delegation states
+		if (!event.isDefaultPrevented) {
+			event.isDefaultPrevented = returnFalse;
+			event.isPropagationStopped = returnFalse;
+			event.isImmediatePropagationStopped = returnFalse;
+		}
+
+		return event;
+	}
+
+	/**
+	 * Bind a DOMContentLoaded event across browsers and executes the callback once the page DOM is initialized.
+	 * It will also set/check the domLoaded state of the event_utils instance so ready isn't called multiple times.
+	 */
+	function bindOnReady(win, callback, eventUtils) {
+		var doc = win.document, event = {type: 'ready'};
+
+		if (eventUtils.domLoaded) {
+			callback(event);
+			return;
+		}
+
+		// Gets called when the DOM is ready
+		function readyHandler() {
+			if (!eventUtils.domLoaded) {
+				eventUtils.domLoaded = true;
+				callback(event);
+			}
+		}
+
+		function waitForDomLoaded() {
+			// Check complete or interactive state if there is a body
+			// element on some iframes IE 8 will produce a null body
+			if (doc.readyState === "complete" || (doc.readyState === "interactive" && doc.body)) {
+				removeEvent(doc, "readystatechange", waitForDomLoaded);
+				readyHandler();
+			}
+		}
+
+		function tryScroll() {
+			try {
+				// If IE is used, use the trick by Diego Perini licensed under MIT by request to the author.
+				// http://javascript.nwbox.com/IEContentLoaded/
+				doc.documentElement.doScroll("left");
+			} catch (ex) {
+				setTimeout(tryScroll, 0);
+				return;
+			}
+
+			readyHandler();
+		}
+
+		// Use W3C method
+		if (doc.addEventListener) {
+			if (doc.readyState === "complete") {
+				readyHandler();
+			} else {
+				addEvent(win, 'DOMContentLoaded', readyHandler);
+			}
+		} else {
+			// Use IE method
+			addEvent(doc, "readystatechange", waitForDomLoaded);
+
+			// Wait until we can scroll, when we can the DOM is initialized
+			if (doc.documentElement.doScroll && win.self === win.top) {
+				tryScroll();
+			}
+		}
+
+		// Fallback if any of the above methods should fail for some odd reason
+		addEvent(win, 'load', readyHandler);
+	}
+
+	/**
+	 * This class enables you to bind/unbind native events to elements and normalize it's behavior across browsers.
+	 */
+	function EventUtils() {
+		var self = this, events = {}, count, expando, hasFocusIn, hasMouseEnterLeave, mouseEnterLeave;
+
+		expando = eventExpandoPrefix + (+new Date()).toString(32);
+		hasMouseEnterLeave = "onmouseenter" in document.documentElement;
+		hasFocusIn = "onfocusin" in document.documentElement;
+		mouseEnterLeave = {mouseenter: 'mouseover', mouseleave: 'mouseout'};
+		count = 1;
+
+		// State if the DOMContentLoaded was executed or not
+		self.domLoaded = false;
+		self.events = events;
+
+		/**
+		 * Executes all event handler callbacks for a specific event.
+		 *
+		 * @private
+		 * @param {Event} evt Event object.
+		 * @param {String} id Expando id value to look for.
+		 */
+		function executeHandlers(evt, id) {
+			var callbackList, i, l, callback, container = events[id];
+
+			callbackList = container && container[evt.type];
+			if (callbackList) {
+				for (i = 0, l = callbackList.length; i < l; i++) {
+					callback = callbackList[i];
+
+					// Check if callback exists might be removed if a unbind is called inside the callback
+					if (callback && callback.func.call(callback.scope, evt) === false) {
+						evt.preventDefault();
+					}
+
+					// Should we stop propagation to immediate listeners
+					if (evt.isImmediatePropagationStopped()) {
+						return;
+					}
+				}
+			}
+		}
+
+		/**
+		 * Binds a callback to an event on the specified target.
+		 *
+		 * @method bind
+		 * @param {Object} target Target node/window or custom object.
+		 * @param {String} names Name of the event to bind.
+		 * @param {function} callback Callback function to execute when the event occurs.
+		 * @param {Object} scope Scope to call the callback function on, defaults to target.
+		 * @return {function} Callback function that got bound.
+		 */
+		self.bind = function(target, names, callback, scope) {
+			var id, callbackList, i, name, fakeName, nativeHandler, capture, win = window;
+
+			// Native event handler function patches the event and executes the callbacks for the expando
+			function defaultNativeHandler(evt) {
+				executeHandlers(fix(evt || win.event), id);
+			}
+
+			// Don't bind to text nodes or comments
+			if (!target || target.nodeType === 3 || target.nodeType === 8) {
+				return;
+			}
+
+			// Create or get events id for the target
+			if (!target[expando]) {
+				id = count++;
+				target[expando] = id;
+				events[id] = {};
+			} else {
+				id = target[expando];
+			}
+
+			// Setup the specified scope or use the target as a default
+			scope = scope || target;
+
+			// Split names and bind each event, enables you to bind multiple events with one call
+			names = names.split(' ');
+			i = names.length;
+			while (i--) {
+				name = names[i];
+				nativeHandler = defaultNativeHandler;
+				fakeName = capture = false;
+
+				// Use ready instead of DOMContentLoaded
+				if (name === "DOMContentLoaded") {
+					name = "ready";
+				}
+
+				// DOM is already ready
+				if (self.domLoaded && name === "ready" && target.readyState == 'complete') {
+					callback.call(scope, fix({type: name}));
+					continue;
+				}
+
+				// Handle mouseenter/mouseleaver
+				if (!hasMouseEnterLeave) {
+					fakeName = mouseEnterLeave[name];
+
+					if (fakeName) {
+						nativeHandler = function(evt) {
+							var current, related;
+
+							current = evt.currentTarget;
+							related = evt.relatedTarget;
+
+							// Check if related is inside the current target if it's not then the event should
+							// be ignored since it's a mouseover/mouseout inside the element
+							if (related && current.contains) {
+								// Use contains for performance
+								related = current.contains(related);
+							} else {
+								while (related && related !== current) {
+									related = related.parentNode;
+								}
+							}
+
+							// Fire fake event
+							if (!related) {
+								evt = fix(evt || win.event);
+								evt.type = evt.type === 'mouseout' ? 'mouseleave' : 'mouseenter';
+								evt.target = current;
+								executeHandlers(evt, id);
+							}
+						};
+					}
+				}
+
+				// Fake bubbeling of focusin/focusout
+				if (!hasFocusIn && (name === "focusin" || name === "focusout")) {
+					capture = true;
+					fakeName = name === "focusin" ? "focus" : "blur";
+					nativeHandler = function(evt) {
+						evt = fix(evt || win.event);
+						evt.type = evt.type === 'focus' ? 'focusin' : 'focusout';
+						executeHandlers(evt, id);
+					};
+				}
+
+				// Setup callback list and bind native event
+				callbackList = events[id][name];
+				if (!callbackList) {
+					events[id][name] = callbackList = [{func: callback, scope: scope}];
+					callbackList.fakeName = fakeName;
+					callbackList.capture = capture;
+					//callbackList.callback = callback;
+
+					// Add the nativeHandler to the callback list so that we can later unbind it
+					callbackList.nativeHandler = nativeHandler;
+
+					// Check if the target has native events support
+
+					if (name === "ready") {
+						bindOnReady(target, nativeHandler, self);
+					} else {
+						addEvent(target, fakeName || name, nativeHandler, capture);
+					}
+				} else {
+					if (name === "ready" && self.domLoaded) {
+						callback({type: name});
+					} else {
+						// If it already has an native handler then just push the callback
+						callbackList.push({func: callback, scope: scope});
+					}
+				}
+			}
+
+			target = callbackList = 0; // Clean memory for IE
+
+			return callback;
+		};
+
+		/**
+		 * Unbinds the specified event by name, name and callback or all events on the target.
+		 *
+		 * @method unbind
+		 * @param {Object} target Target node/window or custom object.
+		 * @param {String} names Optional event name to unbind.
+		 * @param {function} callback Optional callback function to unbind.
+		 * @return {EventUtils} Event utils instance.
+		 */
+		self.unbind = function(target, names, callback) {
+			var id, callbackList, i, ci, name, eventMap;
+
+			// Don't bind to text nodes or comments
+			if (!target || target.nodeType === 3 || target.nodeType === 8) {
+				return self;
+			}
+
+			// Unbind event or events if the target has the expando
+			id = target[expando];
+			if (id) {
+				eventMap = events[id];
+
+				// Specific callback
+				if (names) {
+					names = names.split(' ');
+					i = names.length;
+					while (i--) {
+						name = names[i];
+						callbackList = eventMap[name];
+
+						// Unbind the event if it exists in the map
+						if (callbackList) {
+							// Remove specified callback
+							if (callback) {
+								ci = callbackList.length;
+								while (ci--) {
+									if (callbackList[ci].func === callback) {
+										var nativeHandler = callbackList.nativeHandler;
+										var fakeName = callbackList.fakeName, capture = callbackList.capture;
+
+										// Clone callbackList since unbind inside a callback would otherwise break the handlers loop
+										callbackList = callbackList.slice(0, ci).concat(callbackList.slice(ci + 1));
+										callbackList.nativeHandler = nativeHandler;
+										callbackList.fakeName = fakeName;
+										callbackList.capture = capture;
+
+										eventMap[name] = callbackList;
+									}
+								}
+							}
+
+							// Remove all callbacks if there isn't a specified callback or there is no callbacks left
+							if (!callback || callbackList.length === 0) {
+								delete eventMap[name];
+								removeEvent(target, callbackList.fakeName || name, callbackList.nativeHandler, callbackList.capture);
+							}
+						}
+					}
+				} else {
+					// All events for a specific element
+					for (name in eventMap) {
+						callbackList = eventMap[name];
+						removeEvent(target, callbackList.fakeName || name, callbackList.nativeHandler, callbackList.capture);
+					}
+
+					eventMap = {};
+				}
+
+				// Check if object is empty, if it isn't then we won't remove the expando map
+				for (name in eventMap) {
+					return self;
+				}
+
+				// Delete event object
+				delete events[id];
+
+				// Remove expando from target
+				try {
+					// IE will fail here since it can't delete properties from window
+					delete target[expando];
+				} catch (ex) {
+					// IE will set it to null
+					target[expando] = null;
+				}
+			}
+
+			return self;
+		};
+
+		/**
+		 * Fires the specified event on the specified target.
+		 *
+		 * @method fire
+		 * @param {Object} target Target node/window or custom object.
+		 * @param {String} name Event name to fire.
+		 * @param {Object} args Optional arguments to send to the observers.
+		 * @return {EventUtils} Event utils instance.
+		 */
+		self.fire = function(target, name, args) {
+			var id;
+
+			// Don't bind to text nodes or comments
+			if (!target || target.nodeType === 3 || target.nodeType === 8) {
+				return self;
+			}
+
+			// Build event object by patching the args
+			args = fix(null, args);
+			args.type = name;
+			args.target = target;
+
+			do {
+				// Found an expando that means there is listeners to execute
+				id = target[expando];
+				if (id) {
+					executeHandlers(args, id);
+				}
+
+				// Walk up the DOM
+				target = target.parentNode || target.ownerDocument || target.defaultView || target.parentWindow;
+			} while (target && !args.isPropagationStopped());
+
+			return self;
+		};
+
+		/**
+		 * Removes all bound event listeners for the specified target. This will also remove any bound
+		 * listeners to child nodes within that target.
+		 *
+		 * @method clean
+		 * @param {Object} target Target node/window object.
+		 * @return {EventUtils} Event utils instance.
+		 */
+		self.clean = function(target) {
+			var i, children, unbind = self.unbind;
+
+			// Don't bind to text nodes or comments
+			if (!target || target.nodeType === 3 || target.nodeType === 8) {
+				return self;
+			}
+
+			// Unbind any element on the specificed target
+			if (target[expando]) {
+				unbind(target);
+			}
+
+			// Target doesn't have getElementsByTagName it's probably a window object then use it's document to find the children
+			if (!target.getElementsByTagName) {
+				target = target.document;
+			}
+
+			// Remove events from each child element
+			if (target && target.getElementsByTagName) {
+				unbind(target);
+
+				children = target.getElementsByTagName('*');
+				i = children.length;
+				while (i--) {
+					target = children[i];
+
+					if (target[expando]) {
+						unbind(target);
+					}
+				}
+			}
+
+			return self;
+		};
+
+		/**
+		 * Destroys the event object. Call this on IE to remove memory leaks.
+		 */
+		self.destroy = function() {
+			events = {};
+		};
+
+		// Legacy function for canceling events
+		self.cancel = function(e) {
+			if (e) {
+				e.preventDefault();
+				e.stopImmediatePropagation();
+			}
+
+			return false;
+		};
+	}
+
+	EventUtils.Event = new EventUtils();
+	EventUtils.Event.bind(window, 'ready', function() {});
+
+	return EventUtils;
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/Range.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,777 @@
+/**
+ * Range.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+define("tinymce/dom/Range", [
+	"tinymce/util/Tools"
+], function(Tools) {
+	// Range constructor
+	function Range(dom) {
+		var self = this,
+			doc = dom.doc,
+			EXTRACT = 0,
+			CLONE = 1,
+			DELETE = 2,
+			TRUE = true,
+			FALSE = false,
+			START_OFFSET = 'startOffset',
+			START_CONTAINER = 'startContainer',
+			END_CONTAINER = 'endContainer',
+			END_OFFSET = 'endOffset',
+			extend = Tools.extend,
+			nodeIndex = dom.nodeIndex;
+
+		function createDocumentFragment() {
+			return doc.createDocumentFragment();
+		}
+
+		function setStart(n, o) {
+			_setEndPoint(TRUE, n, o);
+		}
+
+		function setEnd(n, o) {
+			_setEndPoint(FALSE, n, o);
+		}
+
+		function setStartBefore(n) {
+			setStart(n.parentNode, nodeIndex(n));
+		}
+
+		function setStartAfter(n) {
+			setStart(n.parentNode, nodeIndex(n) + 1);
+		}
+
+		function setEndBefore(n) {
+			setEnd(n.parentNode, nodeIndex(n));
+		}
+
+		function setEndAfter(n) {
+			setEnd(n.parentNode, nodeIndex(n) + 1);
+		}
+
+		function collapse(ts) {
+			if (ts) {
+				self[END_CONTAINER] = self[START_CONTAINER];
+				self[END_OFFSET] = self[START_OFFSET];
+			} else {
+				self[START_CONTAINER] = self[END_CONTAINER];
+				self[START_OFFSET] = self[END_OFFSET];
+			}
+
+			self.collapsed = TRUE;
+		}
+
+		function selectNode(n) {
+			setStartBefore(n);
+			setEndAfter(n);
+		}
+
+		function selectNodeContents(n) {
+			setStart(n, 0);
+			setEnd(n, n.nodeType === 1 ? n.childNodes.length : n.nodeValue.length);
+		}
+
+		function compareBoundaryPoints(h, r) {
+			var sc = self[START_CONTAINER], so = self[START_OFFSET], ec = self[END_CONTAINER], eo = self[END_OFFSET],
+			rsc = r.startContainer, rso = r.startOffset, rec = r.endContainer, reo = r.endOffset;
+
+			// Check START_TO_START
+			if (h === 0) {
+				return _compareBoundaryPoints(sc, so, rsc, rso);
+			}
+
+			// Check START_TO_END
+			if (h === 1) {
+				return _compareBoundaryPoints(ec, eo, rsc, rso);
+			}
+
+			// Check END_TO_END
+			if (h === 2) {
+				return _compareBoundaryPoints(ec, eo, rec, reo);
+			}
+
+			// Check END_TO_START
+			if (h === 3) {
+				return _compareBoundaryPoints(sc, so, rec, reo);
+			}
+		}
+
+		function deleteContents() {
+			_traverse(DELETE);
+		}
+
+		function extractContents() {
+			return _traverse(EXTRACT);
+		}
+
+		function cloneContents() {
+			return _traverse(CLONE);
+		}
+
+		function insertNode(n) {
+			var startContainer = this[START_CONTAINER],
+				startOffset = this[START_OFFSET], nn, o;
+
+			// Node is TEXT_NODE or CDATA
+			if ((startContainer.nodeType === 3 || startContainer.nodeType === 4) && startContainer.nodeValue) {
+				if (!startOffset) {
+					// At the start of text
+					startContainer.parentNode.insertBefore(n, startContainer);
+				} else if (startOffset >= startContainer.nodeValue.length) {
+					// At the end of text
+					dom.insertAfter(n, startContainer);
+				} else {
+					// Middle, need to split
+					nn = startContainer.splitText(startOffset);
+					startContainer.parentNode.insertBefore(n, nn);
+				}
+			} else {
+				// Insert element node
+				if (startContainer.childNodes.length > 0) {
+					o = startContainer.childNodes[startOffset];
+				}
+
+				if (o) {
+					startContainer.insertBefore(n, o);
+				} else {
+					if (startContainer.nodeType == 3) {
+						dom.insertAfter(n, startContainer);
+					} else {
+						startContainer.appendChild(n);
+					}
+				}
+			}
+		}
+
+		function surroundContents(n) {
+			var f = self.extractContents();
+
+			self.insertNode(n);
+			n.appendChild(f);
+			self.selectNode(n);
+		}
+
+		function cloneRange() {
+			return extend(new Range(dom), {
+				startContainer: self[START_CONTAINER],
+				startOffset: self[START_OFFSET],
+				endContainer: self[END_CONTAINER],
+				endOffset: self[END_OFFSET],
+				collapsed: self.collapsed,
+				commonAncestorContainer: self.commonAncestorContainer
+			});
+		}
+
+		// Private methods
+
+		function _getSelectedNode(container, offset) {
+			var child;
+
+			if (container.nodeType == 3 /* TEXT_NODE */) {
+				return container;
+			}
+
+			if (offset < 0) {
+				return container;
+			}
+
+			child = container.firstChild;
+			while (child && offset > 0) {
+				--offset;
+				child = child.nextSibling;
+			}
+
+			if (child) {
+				return child;
+			}
+
+			return container;
+		}
+
+		function _isCollapsed() {
+			return (self[START_CONTAINER] == self[END_CONTAINER] && self[START_OFFSET] == self[END_OFFSET]);
+		}
+
+		function _compareBoundaryPoints(containerA, offsetA, containerB, offsetB) {
+			var c, offsetC, n, cmnRoot, childA, childB;
+
+			// In the first case the boundary-points have the same container. A is before B
+			// if its offset is less than the offset of B, A is equal to B if its offset is
+			// equal to the offset of B, and A is after B if its offset is greater than the
+			// offset of B.
+			if (containerA == containerB) {
+				if (offsetA == offsetB) {
+					return 0; // equal
+				}
+
+				if (offsetA < offsetB) {
+					return -1; // before
+				}
+
+				return 1; // after
+			}
+
+			// In the second case a child node C of the container of A is an ancestor
+			// container of B. In this case, A is before B if the offset of A is less than or
+			// equal to the index of the child node C and A is after B otherwise.
+			c = containerB;
+			while (c && c.parentNode != containerA) {
+				c = c.parentNode;
+			}
+
+			if (c) {
+				offsetC = 0;
+				n = containerA.firstChild;
+
+				while (n != c && offsetC < offsetA) {
+					offsetC++;
+					n = n.nextSibling;
+				}
+
+				if (offsetA <= offsetC) {
+					return -1; // before
+				}
+
+				return 1; // after
+			}
+
+			// In the third case a child node C of the container of B is an ancestor container
+			// of A. In this case, A is before B if the index of the child node C is less than
+			// the offset of B and A is after B otherwise.
+			c = containerA;
+			while (c && c.parentNode != containerB) {
+				c = c.parentNode;
+			}
+
+			if (c) {
+				offsetC = 0;
+				n = containerB.firstChild;
+
+				while (n != c && offsetC < offsetB) {
+					offsetC++;
+					n = n.nextSibling;
+				}
+
+				if (offsetC < offsetB) {
+					return -1; // before
+				}
+
+				return 1; // after
+			}
+
+			// In the fourth case, none of three other cases hold: the containers of A and B
+			// are siblings or descendants of sibling nodes. In this case, A is before B if
+			// the container of A is before the container of B in a pre-order traversal of the
+			// Ranges' context tree and A is after B otherwise.
+			cmnRoot = dom.findCommonAncestor(containerA, containerB);
+			childA = containerA;
+
+			while (childA && childA.parentNode != cmnRoot) {
+				childA = childA.parentNode;
+			}
+
+			if (!childA) {
+				childA = cmnRoot;
+			}
+
+			childB = containerB;
+			while (childB && childB.parentNode != cmnRoot) {
+				childB = childB.parentNode;
+			}
+
+			if (!childB) {
+				childB = cmnRoot;
+			}
+
+			if (childA == childB) {
+				return 0; // equal
+			}
+
+			n = cmnRoot.firstChild;
+			while (n) {
+				if (n == childA) {
+					return -1; // before
+				}
+
+				if (n == childB) {
+					return 1; // after
+				}
+
+				n = n.nextSibling;
+			}
+		}
+
+		function _setEndPoint(st, n, o) {
+			var ec, sc;
+
+			if (st) {
+				self[START_CONTAINER] = n;
+				self[START_OFFSET] = o;
+			} else {
+				self[END_CONTAINER] = n;
+				self[END_OFFSET] = o;
+			}
+
+			// If one boundary-point of a Range is set to have a root container
+			// other than the current one for the Range, the Range is collapsed to
+			// the new position. This enforces the restriction that both boundary-
+			// points of a Range must have the same root container.
+			ec = self[END_CONTAINER];
+			while (ec.parentNode) {
+				ec = ec.parentNode;
+			}
+
+			sc = self[START_CONTAINER];
+			while (sc.parentNode) {
+				sc = sc.parentNode;
+			}
+
+			if (sc == ec) {
+				// The start position of a Range is guaranteed to never be after the
+				// end position. To enforce this restriction, if the start is set to
+				// be at a position after the end, the Range is collapsed to that
+				// position.
+				if (_compareBoundaryPoints(self[START_CONTAINER], self[START_OFFSET], self[END_CONTAINER], self[END_OFFSET]) > 0) {
+					self.collapse(st);
+				}
+			} else {
+				self.collapse(st);
+			}
+
+			self.collapsed = _isCollapsed();
+			self.commonAncestorContainer = dom.findCommonAncestor(self[START_CONTAINER], self[END_CONTAINER]);
+		}
+
+		function _traverse(how) {
+			var c, endContainerDepth = 0, startContainerDepth = 0, p, depthDiff, startNode, endNode, sp, ep;
+
+			if (self[START_CONTAINER] == self[END_CONTAINER]) {
+				return _traverseSameContainer(how);
+			}
+
+			for (c = self[END_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) {
+				if (p == self[START_CONTAINER]) {
+					return _traverseCommonStartContainer(c, how);
+				}
+
+				++endContainerDepth;
+			}
+
+			for (c = self[START_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) {
+				if (p == self[END_CONTAINER]) {
+					return _traverseCommonEndContainer(c, how);
+				}
+
+				++startContainerDepth;
+			}
+
+			depthDiff = startContainerDepth - endContainerDepth;
+
+			startNode = self[START_CONTAINER];
+			while (depthDiff > 0) {
+				startNode = startNode.parentNode;
+				depthDiff--;
+			}
+
+			endNode = self[END_CONTAINER];
+			while (depthDiff < 0) {
+				endNode = endNode.parentNode;
+				depthDiff++;
+			}
+
+			// ascend the ancestor hierarchy until we have a common parent.
+			for (sp = startNode.parentNode, ep = endNode.parentNode; sp != ep; sp = sp.parentNode, ep = ep.parentNode) {
+				startNode = sp;
+				endNode = ep;
+			}
+
+			return _traverseCommonAncestors(startNode, endNode, how);
+		}
+
+		function _traverseSameContainer(how) {
+			var frag, s, sub, n, cnt, sibling, xferNode, start, len;
+
+			if (how != DELETE) {
+				frag = createDocumentFragment();
+			}
+
+			// If selection is empty, just return the fragment
+			if (self[START_OFFSET] == self[END_OFFSET]) {
+				return frag;
+			}
+
+			// Text node needs special case handling
+			if (self[START_CONTAINER].nodeType == 3 /* TEXT_NODE */) {
+				// get the substring
+				s = self[START_CONTAINER].nodeValue;
+				sub = s.substring(self[START_OFFSET], self[END_OFFSET]);
+
+				// set the original text node to its new value
+				if (how != CLONE) {
+					n = self[START_CONTAINER];
+					start = self[START_OFFSET];
+					len = self[END_OFFSET] - self[START_OFFSET];
+
+					if (start === 0 && len >= n.nodeValue.length - 1) {
+						n.parentNode.removeChild(n);
+					} else {
+						n.deleteData(start, len);
+					}
+
+					// Nothing is partially selected, so collapse to start point
+					self.collapse(TRUE);
+				}
+
+				if (how == DELETE) {
+					return;
+				}
+
+				if (sub.length > 0) {
+					frag.appendChild(doc.createTextNode(sub));
+				}
+
+				return frag;
+			}
+
+			// Copy nodes between the start/end offsets.
+			n = _getSelectedNode(self[START_CONTAINER], self[START_OFFSET]);
+			cnt = self[END_OFFSET] - self[START_OFFSET];
+
+			while (n && cnt > 0) {
+				sibling = n.nextSibling;
+				xferNode = _traverseFullySelected(n, how);
+
+				if (frag) {
+					frag.appendChild(xferNode);
+				}
+
+				--cnt;
+				n = sibling;
+			}
+
+			// Nothing is partially selected, so collapse to start point
+			if (how != CLONE) {
+				self.collapse(TRUE);
+			}
+
+			return frag;
+		}
+
+		function _traverseCommonStartContainer(endAncestor, how) {
+			var frag, n, endIdx, cnt, sibling, xferNode;
+
+			if (how != DELETE) {
+				frag = createDocumentFragment();
+			}
+
+			n = _traverseRightBoundary(endAncestor, how);
+
+			if (frag) {
+				frag.appendChild(n);
+			}
+
+			endIdx = nodeIndex(endAncestor);
+			cnt = endIdx - self[START_OFFSET];
+
+			if (cnt <= 0) {
+				// Collapse to just before the endAncestor, which
+				// is partially selected.
+				if (how != CLONE) {
+					self.setEndBefore(endAncestor);
+					self.collapse(FALSE);
+				}
+
+				return frag;
+			}
+
+			n = endAncestor.previousSibling;
+			while (cnt > 0) {
+				sibling = n.previousSibling;
+				xferNode = _traverseFullySelected(n, how);
+
+				if (frag) {
+					frag.insertBefore(xferNode, frag.firstChild);
+				}
+
+				--cnt;
+				n = sibling;
+			}
+
+			// Collapse to just before the endAncestor, which
+			// is partially selected.
+			if (how != CLONE) {
+				self.setEndBefore(endAncestor);
+				self.collapse(FALSE);
+			}
+
+			return frag;
+		}
+
+		function _traverseCommonEndContainer(startAncestor, how) {
+			var frag, startIdx, n, cnt, sibling, xferNode;
+
+			if (how != DELETE) {
+				frag = createDocumentFragment();
+			}
+
+			n = _traverseLeftBoundary(startAncestor, how);
+			if (frag) {
+				frag.appendChild(n);
+			}
+
+			startIdx = nodeIndex(startAncestor);
+			++startIdx; // Because we already traversed it
+
+			cnt = self[END_OFFSET] - startIdx;
+			n = startAncestor.nextSibling;
+			while (n && cnt > 0) {
+				sibling = n.nextSibling;
+				xferNode = _traverseFullySelected(n, how);
+
+				if (frag) {
+					frag.appendChild(xferNode);
+				}
+
+				--cnt;
+				n = sibling;
+			}
+
+			if (how != CLONE) {
+				self.setStartAfter(startAncestor);
+				self.collapse(TRUE);
+			}
+
+			return frag;
+		}
+
+		function _traverseCommonAncestors(startAncestor, endAncestor, how) {
+			var n, frag, startOffset, endOffset, cnt, sibling, nextSibling;
+
+			if (how != DELETE) {
+				frag = createDocumentFragment();
+			}
+
+			n = _traverseLeftBoundary(startAncestor, how);
+			if (frag) {
+				frag.appendChild(n);
+			}
+
+			startOffset = nodeIndex(startAncestor);
+			endOffset = nodeIndex(endAncestor);
+			++startOffset;
+
+			cnt = endOffset - startOffset;
+			sibling = startAncestor.nextSibling;
+
+			while (cnt > 0) {
+				nextSibling = sibling.nextSibling;
+				n = _traverseFullySelected(sibling, how);
+
+				if (frag) {
+					frag.appendChild(n);
+				}
+
+				sibling = nextSibling;
+				--cnt;
+			}
+
+			n = _traverseRightBoundary(endAncestor, how);
+
+			if (frag) {
+				frag.appendChild(n);
+			}
+
+			if (how != CLONE) {
+				self.setStartAfter(startAncestor);
+				self.collapse(TRUE);
+			}
+
+			return frag;
+		}
+
+		function _traverseRightBoundary(root, how) {
+			var next = _getSelectedNode(self[END_CONTAINER], self[END_OFFSET] - 1), parent, clonedParent;
+			var prevSibling, clonedChild, clonedGrandParent, isFullySelected = next != self[END_CONTAINER];
+
+			if (next == root) {
+				return _traverseNode(next, isFullySelected, FALSE, how);
+			}
+
+			parent = next.parentNode;
+			clonedParent = _traverseNode(parent, FALSE, FALSE, how);
+
+			while (parent) {
+				while (next) {
+					prevSibling = next.previousSibling;
+					clonedChild = _traverseNode(next, isFullySelected, FALSE, how);
+
+					if (how != DELETE) {
+						clonedParent.insertBefore(clonedChild, clonedParent.firstChild);
+					}
+
+					isFullySelected = TRUE;
+					next = prevSibling;
+				}
+
+				if (parent == root) {
+					return clonedParent;
+				}
+
+				next = parent.previousSibling;
+				parent = parent.parentNode;
+
+				clonedGrandParent = _traverseNode(parent, FALSE, FALSE, how);
+
+				if (how != DELETE) {
+					clonedGrandParent.appendChild(clonedParent);
+				}
+
+				clonedParent = clonedGrandParent;
+			}
+		}
+
+		function _traverseLeftBoundary(root, how) {
+			var next = _getSelectedNode(self[START_CONTAINER], self[START_OFFSET]), isFullySelected = next != self[START_CONTAINER];
+			var parent, clonedParent, nextSibling, clonedChild, clonedGrandParent;
+
+			if (next == root) {
+				return _traverseNode(next, isFullySelected, TRUE, how);
+			}
+
+			parent = next.parentNode;
+			clonedParent = _traverseNode(parent, FALSE, TRUE, how);
+
+			while (parent) {
+				while (next) {
+					nextSibling = next.nextSibling;
+					clonedChild = _traverseNode(next, isFullySelected, TRUE, how);
+
+					if (how != DELETE) {
+						clonedParent.appendChild(clonedChild);
+					}
+
+					isFullySelected = TRUE;
+					next = nextSibling;
+				}
+
+				if (parent == root) {
+					return clonedParent;
+				}
+
+				next = parent.nextSibling;
+				parent = parent.parentNode;
+
+				clonedGrandParent = _traverseNode(parent, FALSE, TRUE, how);
+
+				if (how != DELETE) {
+					clonedGrandParent.appendChild(clonedParent);
+				}
+
+				clonedParent = clonedGrandParent;
+			}
+		}
+
+		function _traverseNode(n, isFullySelected, isLeft, how) {
+			var txtValue, newNodeValue, oldNodeValue, offset, newNode;
+
+			if (isFullySelected) {
+				return _traverseFullySelected(n, how);
+			}
+
+			if (n.nodeType == 3 /* TEXT_NODE */) {
+				txtValue = n.nodeValue;
+
+				if (isLeft) {
+					offset = self[START_OFFSET];
+					newNodeValue = txtValue.substring(offset);
+					oldNodeValue = txtValue.substring(0, offset);
+				} else {
+					offset = self[END_OFFSET];
+					newNodeValue = txtValue.substring(0, offset);
+					oldNodeValue = txtValue.substring(offset);
+				}
+
+				if (how != CLONE) {
+					n.nodeValue = oldNodeValue;
+				}
+
+				if (how == DELETE) {
+					return;
+				}
+
+				newNode = dom.clone(n, FALSE);
+				newNode.nodeValue = newNodeValue;
+
+				return newNode;
+			}
+
+			if (how == DELETE) {
+				return;
+			}
+
+			return dom.clone(n, FALSE);
+		}
+
+		function _traverseFullySelected(n, how) {
+			if (how != DELETE) {
+				return how == CLONE ? dom.clone(n, TRUE) : n;
+			}
+
+			n.parentNode.removeChild(n);
+		}
+
+		function toStringIE() {
+			return dom.create('body', null, cloneContents()).outerText;
+		}
+
+		extend(self, {
+			// Inital states
+			startContainer: doc,
+			startOffset: 0,
+			endContainer: doc,
+			endOffset: 0,
+			collapsed: TRUE,
+			commonAncestorContainer: doc,
+
+			// Range constants
+			START_TO_START: 0,
+			START_TO_END: 1,
+			END_TO_END: 2,
+			END_TO_START: 3,
+
+			// Public methods
+			setStart: setStart,
+			setEnd: setEnd,
+			setStartBefore: setStartBefore,
+			setStartAfter: setStartAfter,
+			setEndBefore: setEndBefore,
+			setEndAfter: setEndAfter,
+			collapse: collapse,
+			selectNode: selectNode,
+			selectNodeContents: selectNodeContents,
+			compareBoundaryPoints: compareBoundaryPoints,
+			deleteContents: deleteContents,
+			extractContents: extractContents,
+			cloneContents: cloneContents,
+			insertNode: insertNode,
+			surroundContents: surroundContents,
+			cloneRange: cloneRange,
+			toStringIE: toStringIE
+		});
+
+		return self;
+	}
+
+	// Older IE versions doesn't let you override toString by it's constructor so we have to stick it in the prototype
+	Range.prototype.toString = function() {
+		return this.toStringIE();
+	};
+
+	return Range;
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/RangeUtils.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,540 @@
+/**
+ * RangeUtils.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class contains a few utility methods for ranges.
+ *
+ * @class tinymce.dom.RangeUtils
+ */
+define("tinymce/dom/RangeUtils", [
+	"tinymce/util/Tools",
+	"tinymce/dom/TreeWalker"
+], function(Tools, TreeWalker) {
+	var each = Tools.each;
+
+	function getEndChild(container, index) {
+		var childNodes = container.childNodes;
+
+		index--;
+
+		if (index > childNodes.length - 1) {
+			index = childNodes.length - 1;
+		} else if (index < 0) {
+			index = 0;
+		}
+
+		return childNodes[index] || container;
+	}
+
+	function RangeUtils(dom) {
+		/**
+		 * Walks the specified range like object and executes the callback for each sibling collection it finds.
+		 *
+		 * @method walk
+		 * @param {Object} rng Range like object.
+		 * @param {function} callback Callback function to execute for each sibling collection.
+		 */
+		this.walk = function(rng, callback) {
+			var startContainer = rng.startContainer,
+				startOffset = rng.startOffset,
+				endContainer = rng.endContainer,
+				endOffset = rng.endOffset,
+				ancestor, startPoint,
+				endPoint, node, parent, siblings, nodes;
+
+			// Handle table cell selection the table plugin enables
+			// you to fake select table cells and perform formatting actions on them
+			nodes = dom.select('td.mce-item-selected,th.mce-item-selected');
+			if (nodes.length > 0) {
+				each(nodes, function(node) {
+					callback([node]);
+				});
+
+				return;
+			}
+
+			/**
+			 * Excludes start/end text node if they are out side the range
+			 *
+			 * @private
+			 * @param {Array} nodes Nodes to exclude items from.
+			 * @return {Array} Array with nodes excluding the start/end container if needed.
+			 */
+			function exclude(nodes) {
+				var node;
+
+				// First node is excluded
+				node = nodes[0];
+				if (node.nodeType === 3 && node === startContainer && startOffset >= node.nodeValue.length) {
+					nodes.splice(0, 1);
+				}
+
+				// Last node is excluded
+				node = nodes[nodes.length - 1];
+				if (endOffset === 0 && nodes.length > 0 && node === endContainer && node.nodeType === 3) {
+					nodes.splice(nodes.length - 1, 1);
+				}
+
+				return nodes;
+			}
+
+			/**
+			 * Collects siblings
+			 *
+			 * @private
+			 * @param {Node} node Node to collect siblings from.
+			 * @param {String} name Name of the sibling to check for.
+			 * @return {Array} Array of collected siblings.
+			 */
+			function collectSiblings(node, name, end_node) {
+				var siblings = [];
+
+				for (; node && node != end_node; node = node[name]) {
+					siblings.push(node);
+				}
+
+				return siblings;
+			}
+
+			/**
+			 * Find an end point this is the node just before the common ancestor root.
+			 *
+			 * @private
+			 * @param {Node} node Node to start at.
+			 * @param {Node} root Root/ancestor element to stop just before.
+			 * @return {Node} Node just before the root element.
+			 */
+			function findEndPoint(node, root) {
+				do {
+					if (node.parentNode == root) {
+						return node;
+					}
+
+					node = node.parentNode;
+				} while (node);
+			}
+
+			function walkBoundary(start_node, end_node, next) {
+				var siblingName = next ? 'nextSibling' : 'previousSibling';
+
+				for (node = start_node, parent = node.parentNode; node && node != end_node; node = parent) {
+					parent = node.parentNode;
+					siblings = collectSiblings(node == start_node ? node : node[siblingName], siblingName);
+
+					if (siblings.length) {
+						if (!next) {
+							siblings.reverse();
+						}
+
+						callback(exclude(siblings));
+					}
+				}
+			}
+
+			// If index based start position then resolve it
+			if (startContainer.nodeType == 1 && startContainer.hasChildNodes()) {
+				startContainer = startContainer.childNodes[startOffset];
+			}
+
+			// If index based end position then resolve it
+			if (endContainer.nodeType == 1 && endContainer.hasChildNodes()) {
+				endContainer = getEndChild(endContainer, endOffset);
+			}
+
+			// Same container
+			if (startContainer == endContainer) {
+				return callback(exclude([startContainer]));
+			}
+
+			// Find common ancestor and end points
+			ancestor = dom.findCommonAncestor(startContainer, endContainer);
+
+			// Process left side
+			for (node = startContainer; node; node = node.parentNode) {
+				if (node === endContainer) {
+					return walkBoundary(startContainer, ancestor, true);
+				}
+
+				if (node === ancestor) {
+					break;
+				}
+			}
+
+			// Process right side
+			for (node = endContainer; node; node = node.parentNode) {
+				if (node === startContainer) {
+					return walkBoundary(endContainer, ancestor);
+				}
+
+				if (node === ancestor) {
+					break;
+				}
+			}
+
+			// Find start/end point
+			startPoint = findEndPoint(startContainer, ancestor) || startContainer;
+			endPoint = findEndPoint(endContainer, ancestor) || endContainer;
+
+			// Walk left leaf
+			walkBoundary(startContainer, startPoint, true);
+
+			// Walk the middle from start to end point
+			siblings = collectSiblings(
+				startPoint == startContainer ? startPoint : startPoint.nextSibling,
+				'nextSibling',
+				endPoint == endContainer ? endPoint.nextSibling : endPoint
+			);
+
+			if (siblings.length) {
+				callback(exclude(siblings));
+			}
+
+			// Walk right leaf
+			walkBoundary(endContainer, endPoint);
+		};
+
+		/**
+		 * Splits the specified range at it's start/end points.
+		 *
+		 * @private
+		 * @param {Range/RangeObject} rng Range to split.
+		 * @return {Object} Range position object.
+		 */
+		this.split = function(rng) {
+			var startContainer = rng.startContainer,
+				startOffset = rng.startOffset,
+				endContainer = rng.endContainer,
+				endOffset = rng.endOffset;
+
+			function splitText(node, offset) {
+				return node.splitText(offset);
+			}
+
+			// Handle single text node
+			if (startContainer == endContainer && startContainer.nodeType == 3) {
+				if (startOffset > 0 && startOffset < startContainer.nodeValue.length) {
+					endContainer = splitText(startContainer, startOffset);
+					startContainer = endContainer.previousSibling;
+
+					if (endOffset > startOffset) {
+						endOffset = endOffset - startOffset;
+						startContainer = endContainer = splitText(endContainer, endOffset).previousSibling;
+						endOffset = endContainer.nodeValue.length;
+						startOffset = 0;
+					} else {
+						endOffset = 0;
+					}
+				}
+			} else {
+				// Split startContainer text node if needed
+				if (startContainer.nodeType == 3 && startOffset > 0 && startOffset < startContainer.nodeValue.length) {
+					startContainer = splitText(startContainer, startOffset);
+					startOffset = 0;
+				}
+
+				// Split endContainer text node if needed
+				if (endContainer.nodeType == 3 && endOffset > 0 && endOffset < endContainer.nodeValue.length) {
+					endContainer = splitText(endContainer, endOffset).previousSibling;
+					endOffset = endContainer.nodeValue.length;
+				}
+			}
+
+			return {
+				startContainer: startContainer,
+				startOffset: startOffset,
+				endContainer: endContainer,
+				endOffset: endOffset
+			};
+		};
+
+		/**
+		 * Normalizes the specified range by finding the closest best suitable caret location.
+		 *
+		 * @private
+		 * @param {Range} rng Range to normalize.
+		 * @return {Boolean} True/false if the specified range was normalized or not.
+		 */
+		this.normalize = function(rng) {
+			var normalized, collapsed;
+
+			function normalizeEndPoint(start) {
+				var container, offset, walker, body = dom.getRoot(), node, nonEmptyElementsMap;
+				var directionLeft, isAfterNode;
+
+				function hasBrBeforeAfter(node, left) {
+					var walker = new TreeWalker(node, dom.getParent(node.parentNode, dom.isBlock) || body);
+
+					while ((node = walker[left ? 'prev' : 'next']())) {
+						if (node.nodeName === "BR") {
+							return true;
+						}
+					}
+				}
+
+				function isPrevNode(node, name) {
+					return node.previousSibling && node.previousSibling.nodeName == name;
+				}
+
+				// Walks the dom left/right to find a suitable text node to move the endpoint into
+				// It will only walk within the current parent block or body and will stop if it hits a block or a BR/IMG
+				function findTextNodeRelative(left, startNode) {
+					var walker, lastInlineElement, parentBlockContainer;
+
+					startNode = startNode || container;
+					parentBlockContainer = dom.getParent(startNode.parentNode, dom.isBlock) || body;
+
+					// Lean left before the BR element if it's the only BR within a block element. Gecko bug: #6680
+					// This: <p><br>|</p> becomes <p>|<br></p>
+					if (left && startNode.nodeName == 'BR' && isAfterNode && dom.isEmpty(parentBlockContainer)) {
+						container = startNode.parentNode;
+						offset = dom.nodeIndex(startNode);
+						normalized = true;
+						return;
+					}
+
+					// Walk left until we hit a text node we can move to or a block/br/img
+					walker = new TreeWalker(startNode, parentBlockContainer);
+					while ((node = walker[left ? 'prev' : 'next']())) {
+						// Break if we hit a non content editable node
+						if (dom.getContentEditableParent(node) === "false") {
+							return;
+						}
+
+						// Found text node that has a length
+						if (node.nodeType === 3 && node.nodeValue.length > 0) {
+							container = node;
+							offset = left ? node.nodeValue.length : 0;
+							normalized = true;
+							return;
+						}
+
+						// Break if we find a block or a BR/IMG/INPUT etc
+						if (dom.isBlock(node) || nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
+							return;
+						}
+
+						lastInlineElement = node;
+					}
+
+					// Only fetch the last inline element when in caret mode for now
+					if (collapsed && lastInlineElement) {
+						container = lastInlineElement;
+						normalized = true;
+						offset = 0;
+					}
+				}
+
+				container = rng[(start ? 'start' : 'end') + 'Container'];
+				offset = rng[(start ? 'start' : 'end') + 'Offset'];
+				isAfterNode = container.nodeType == 1 && offset === container.childNodes.length;
+				nonEmptyElementsMap = dom.schema.getNonEmptyElements();
+				directionLeft = start;
+
+				if (container.nodeType == 1 && offset > container.childNodes.length - 1) {
+					directionLeft = false;
+				}
+
+				// If the container is a document move it to the body element
+				if (container.nodeType === 9) {
+					container = dom.getRoot();
+					offset = 0;
+				}
+
+				// If the container is body try move it into the closest text node or position
+				if (container === body) {
+					// If start is before/after a image, table etc
+					if (directionLeft) {
+						node = container.childNodes[offset > 0 ? offset - 1 : 0];
+						if (node) {
+							if (nonEmptyElementsMap[node.nodeName] || node.nodeName == "TABLE") {
+								return;
+							}
+						}
+					}
+
+					// Resolve the index
+					if (container.hasChildNodes()) {
+						offset = Math.min(!directionLeft && offset > 0 ? offset - 1 : offset, container.childNodes.length - 1);
+						container = container.childNodes[offset];
+						offset = 0;
+
+						// Don't walk into elements that doesn't have any child nodes like a IMG
+						if (container.hasChildNodes() && !/TABLE/.test(container.nodeName)) {
+							// Walk the DOM to find a text node to place the caret at or a BR
+							node = container;
+							walker = new TreeWalker(container, body);
+
+							do {
+								// Found a text node use that position
+								if (node.nodeType === 3 && node.nodeValue.length > 0) {
+									offset = directionLeft ? 0 : node.nodeValue.length;
+									container = node;
+									normalized = true;
+									break;
+								}
+
+								// Found a BR/IMG element that we can place the caret before
+								if (nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
+									offset = dom.nodeIndex(node);
+									container = node.parentNode;
+
+									// Put caret after image when moving the end point
+									if (node.nodeName == "IMG" && !directionLeft) {
+										offset++;
+									}
+
+									normalized = true;
+									break;
+								}
+							} while ((node = (directionLeft ? walker.next() : walker.prev())));
+						}
+					}
+				}
+
+				// Lean the caret to the left if possible
+				if (collapsed) {
+					// So this: <b>x</b><i>|x</i>
+					// Becomes: <b>x|</b><i>x</i>
+					// Seems that only gecko has issues with this
+					if (container.nodeType === 3 && offset === 0) {
+						findTextNodeRelative(true);
+					}
+
+					// Lean left into empty inline elements when the caret is before a BR
+					// So this: <i><b></b><i>|<br></i>
+					// Becomes: <i><b>|</b><i><br></i>
+					// Seems that only gecko has issues with this.
+					// Special edge case for <p><a>x</a>|<br></p> since we don't want <p><a>x|</a><br></p>
+					if (container.nodeType === 1) {
+						node = container.childNodes[offset];
+
+						// Offset is after the containers last child
+						// then use the previous child for normalization
+						if (!node) {
+							node = container.childNodes[offset - 1];
+						}
+
+						if (node && node.nodeName === 'BR' && !isPrevNode(node, 'A') &&
+							!hasBrBeforeAfter(node) && !hasBrBeforeAfter(node, true)) {
+							findTextNodeRelative(true, node);
+						}
+					}
+				}
+
+				// Lean the start of the selection right if possible
+				// So this: x[<b>x]</b>
+				// Becomes: x<b>[x]</b>
+				if (directionLeft && !collapsed && container.nodeType === 3 && offset === container.nodeValue.length) {
+					findTextNodeRelative(false);
+				}
+
+				// Set endpoint if it was normalized
+				if (normalized) {
+					rng['set' + (start ? 'Start' : 'End')](container, offset);
+				}
+			}
+
+			collapsed = rng.collapsed;
+
+			normalizeEndPoint(true);
+
+			if (!collapsed) {
+				normalizeEndPoint();
+			}
+
+			// If it was collapsed then make sure it still is
+			if (normalized && collapsed) {
+				rng.collapse(true);
+			}
+
+			return normalized;
+		};
+	}
+
+	/**
+	 * Compares two ranges and checks if they are equal.
+	 *
+	 * @static
+	 * @method compareRanges
+	 * @param {DOMRange} rng1 First range to compare.
+	 * @param {DOMRange} rng2 First range to compare.
+	 * @return {Boolean} true/false if the ranges are equal.
+	 */
+	RangeUtils.compareRanges = function(rng1, rng2) {
+		if (rng1 && rng2) {
+			// Compare native IE ranges
+			if (rng1.item || rng1.duplicate) {
+				// Both are control ranges and the selected element matches
+				if (rng1.item && rng2.item && rng1.item(0) === rng2.item(0)) {
+					return true;
+				}
+
+				// Both are text ranges and the range matches
+				if (rng1.isEqual && rng2.isEqual && rng2.isEqual(rng1)) {
+					return true;
+				}
+			} else {
+				// Compare w3c ranges
+				return rng1.startContainer == rng2.startContainer && rng1.startOffset == rng2.startOffset;
+			}
+		}
+
+		return false;
+	};
+
+	/**
+	 * Gets the caret range for the given x/y location.
+	 *
+	 * @static
+	 * @method getCaretRangeFromPoint
+	 * @param {Number} x X coordinate for range
+	 * @param {Number} y Y coordinate for range
+	 * @param {Document} doc Document that x/y are relative to
+	 * @returns {Range} caret range
+	 */
+	RangeUtils.getCaretRangeFromPoint = function(x, y, doc) {
+		var rng, point;
+
+		if (doc.caretPositionFromPoint) {
+			point = doc.caretPositionFromPoint(x, y);
+			rng = doc.createRange();
+			rng.setStart(point.offsetNode, point.offset);
+			rng.collapse(true);
+		} else if (doc.caretRangeFromPoint) {
+			rng = doc.caretRangeFromPoint(x, y);
+		} else if (doc.body.createTextRange) {
+			rng = doc.body.createTextRange();
+
+			try {
+				rng.moveToPoint(x, y);
+				rng.collapse(true);
+			} catch (ex) {
+				// Append to top or bottom depending on drop location
+				rng.collapse(y < doc.body.clientHeight);
+			}
+		}
+
+		return rng;
+	};
+
+	RangeUtils.getNode = function(container, offset) {
+		if (container.nodeType == 1 && container.hasChildNodes()) {
+			if (offset >= container.childNodes.length) {
+				offset = container.childNodes.length - 1;
+			}
+
+			container = container.childNodes[offset];
+		}
+
+		return container;
+	};
+
+	return RangeUtils;
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/ScriptLoader.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,255 @@
+/**
+ * ScriptLoader.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*globals console*/
+
+/**
+ * This class handles asynchronous/synchronous loading of JavaScript files it will execute callbacks
+ * when various items gets loaded. This class is useful to load external JavaScript files.
+ *
+ * @class tinymce.dom.ScriptLoader
+ * @example
+ * // Load a script from a specific URL using the global script loader
+ * tinymce.ScriptLoader.load('somescript.js');
+ *
+ * // Load a script using a unique instance of the script loader
+ * var scriptLoader = new tinymce.dom.ScriptLoader();
+ *
+ * scriptLoader.load('somescript.js');
+ *
+ * // Load multiple scripts
+ * var scriptLoader = new tinymce.dom.ScriptLoader();
+ *
+ * scriptLoader.add('somescript1.js');
+ * scriptLoader.add('somescript2.js');
+ * scriptLoader.add('somescript3.js');
+ *
+ * scriptLoader.loadQueue(function() {
+ *    alert('All scripts are now loaded.');
+ * });
+ */
+define("tinymce/dom/ScriptLoader", [
+	"tinymce/dom/DOMUtils",
+	"tinymce/util/Tools"
+], function(DOMUtils, Tools) {
+	var DOM = DOMUtils.DOM;
+	var each = Tools.each, grep = Tools.grep;
+
+	function ScriptLoader() {
+		var QUEUED = 0,
+			LOADING = 1,
+			LOADED = 2,
+			states = {},
+			queue = [],
+			scriptLoadedCallbacks = {},
+			queueLoadedCallbacks = [],
+			loading = 0,
+			undef;
+
+		/**
+		 * Loads a specific script directly without adding it to the load queue.
+		 *
+		 * @method load
+		 * @param {String} url Absolute URL to script to add.
+		 * @param {function} callback Optional callback function to execute ones this script gets loaded.
+		 * @param {Object} scope Optional scope to execute callback in.
+		 */
+		function loadScript(url, callback) {
+			var dom = DOM, elm, id;
+
+			// Execute callback when script is loaded
+			function done() {
+				dom.remove(id);
+
+				if (elm) {
+					elm.onreadystatechange = elm.onload = elm = null;
+				}
+
+				callback();
+			}
+
+			function error() {
+				/*eslint no-console:0 */
+
+				// Report the error so it's easier for people to spot loading errors
+				if (typeof console !== "undefined" && console.log) {
+					console.log("Failed to load: " + url);
+				}
+
+				// We can't mark it as done if there is a load error since
+				// A) We don't want to produce 404 errors on the server and
+				// B) the onerror event won't fire on all browsers.
+				// done();
+			}
+
+			id = dom.uniqueId();
+
+			// Create new script element
+			elm = document.createElement('script');
+			elm.id = id;
+			elm.type = 'text/javascript';
+			elm.src = Tools._addCacheSuffix(url);
+
+			// Seems that onreadystatechange works better on IE 10 onload seems to fire incorrectly
+			if ("onreadystatechange" in elm) {
+				elm.onreadystatechange = function() {
+					if (/loaded|complete/.test(elm.readyState)) {
+						done();
+					}
+				};
+			} else {
+				elm.onload = done;
+			}
+
+			// Add onerror event will get fired on some browsers but not all of them
+			elm.onerror = error;
+
+			// Add script to document
+			(document.getElementsByTagName('head')[0] || document.body).appendChild(elm);
+		}
+
+		/**
+		 * Returns true/false if a script has been loaded or not.
+		 *
+		 * @method isDone
+		 * @param {String} url URL to check for.
+		 * @return {Boolean} true/false if the URL is loaded.
+		 */
+		this.isDone = function(url) {
+			return states[url] == LOADED;
+		};
+
+		/**
+		 * Marks a specific script to be loaded. This can be useful if a script got loaded outside
+		 * the script loader or to skip it from loading some script.
+		 *
+		 * @method markDone
+		 * @param {string} u Absolute URL to the script to mark as loaded.
+		 */
+		this.markDone = function(url) {
+			states[url] = LOADED;
+		};
+
+		/**
+		 * Adds a specific script to the load queue of the script loader.
+		 *
+		 * @method add
+		 * @param {String} url Absolute URL to script to add.
+		 * @param {function} callback Optional callback function to execute ones this script gets loaded.
+		 * @param {Object} scope Optional scope to execute callback in.
+		 */
+		this.add = this.load = function(url, callback, scope) {
+			var state = states[url];
+
+			// Add url to load queue
+			if (state == undef) {
+				queue.push(url);
+				states[url] = QUEUED;
+			}
+
+			if (callback) {
+				// Store away callback for later execution
+				if (!scriptLoadedCallbacks[url]) {
+					scriptLoadedCallbacks[url] = [];
+				}
+
+				scriptLoadedCallbacks[url].push({
+					func: callback,
+					scope: scope || this
+				});
+			}
+		};
+
+		/**
+		 * Starts the loading of the queue.
+		 *
+		 * @method loadQueue
+		 * @param {function} callback Optional callback to execute when all queued items are loaded.
+		 * @param {Object} scope Optional scope to execute the callback in.
+		 */
+		this.loadQueue = function(callback, scope) {
+			this.loadScripts(queue, callback, scope);
+		};
+
+		/**
+		 * Loads the specified queue of files and executes the callback ones they are loaded.
+		 * This method is generally not used outside this class but it might be useful in some scenarios.
+		 *
+		 * @method loadScripts
+		 * @param {Array} scripts Array of queue items to load.
+		 * @param {function} callback Optional callback to execute ones all items are loaded.
+		 * @param {Object} scope Optional scope to execute callback in.
+		 */
+		this.loadScripts = function(scripts, callback, scope) {
+			var loadScripts;
+
+			function execScriptLoadedCallbacks(url) {
+				// Execute URL callback functions
+				each(scriptLoadedCallbacks[url], function(callback) {
+					callback.func.call(callback.scope);
+				});
+
+				scriptLoadedCallbacks[url] = undef;
+			}
+
+			queueLoadedCallbacks.push({
+				func: callback,
+				scope: scope || this
+			});
+
+			loadScripts = function() {
+				var loadingScripts = grep(scripts);
+
+				// Current scripts has been handled
+				scripts.length = 0;
+
+				// Load scripts that needs to be loaded
+				each(loadingScripts, function(url) {
+					// Script is already loaded then execute script callbacks directly
+					if (states[url] == LOADED) {
+						execScriptLoadedCallbacks(url);
+						return;
+					}
+
+					// Is script not loading then start loading it
+					if (states[url] != LOADING) {
+						states[url] = LOADING;
+						loading++;
+
+						loadScript(url, function() {
+							states[url] = LOADED;
+							loading--;
+
+							execScriptLoadedCallbacks(url);
+
+							// Load more scripts if they where added by the recently loaded script
+							loadScripts();
+						});
+					}
+				});
+
+				// No scripts are currently loading then execute all pending queue loaded callbacks
+				if (!loading) {
+					each(queueLoadedCallbacks, function(callback) {
+						callback.func.call(callback.scope);
+					});
+
+					queueLoadedCallbacks.length = 0;
+				}
+			};
+
+			loadScripts();
+		};
+	}
+
+	ScriptLoader.ScriptLoader = new ScriptLoader();
+
+	return ScriptLoader;
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/Selection.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,990 @@
+/**
+ * Selection.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles text and control selection it's an crossbrowser utility class.
+ * Consult the TinyMCE Wiki API for more details and examples on how to use this class.
+ *
+ * @class tinymce.dom.Selection
+ * @example
+ * // Getting the currently selected node for the active editor
+ * alert(tinymce.activeEditor.selection.getNode().nodeName);
+ */
+define("tinymce/dom/Selection", [
+	"tinymce/dom/TreeWalker",
+	"tinymce/dom/TridentSelection",
+	"tinymce/dom/ControlSelection",
+	"tinymce/dom/RangeUtils",
+	"tinymce/dom/BookmarkManager",
+	"tinymce/Env",
+	"tinymce/util/Tools"
+], function(TreeWalker, TridentSelection, ControlSelection, RangeUtils, BookmarkManager, Env, Tools) {
+	var each = Tools.each, trim = Tools.trim;
+	var isIE = Env.ie;
+
+	/**
+	 * Constructs a new selection instance.
+	 *
+	 * @constructor
+	 * @method Selection
+	 * @param {tinymce.dom.DOMUtils} dom DOMUtils object reference.
+	 * @param {Window} win Window to bind the selection object to.
+	 * @param {tinymce.dom.Serializer} serializer DOM serialization class to use for getContent.
+	 */
+	function Selection(dom, win, serializer, editor) {
+		var self = this;
+
+		self.dom = dom;
+		self.win = win;
+		self.serializer = serializer;
+		self.editor = editor;
+		self.bookmarkManager = new BookmarkManager(self);
+		self.controlSelection = new ControlSelection(self, editor);
+
+		// No W3C Range support
+		if (!self.win.getSelection) {
+			self.tridentSel = new TridentSelection(self);
+		}
+	}
+
+	Selection.prototype = {
+		/**
+		 * Move the selection cursor range to the specified node and offset.
+		 * If there is no node specified it will move it to the first suitable location within the body.
+		 *
+		 * @method setCursorLocation
+		 * @param {Node} node Optional node to put the cursor in.
+		 * @param {Number} offset Optional offset from the start of the node to put the cursor at.
+		 */
+		setCursorLocation: function(node, offset) {
+			var self = this, rng = self.dom.createRng();
+
+			if (!node) {
+				self._moveEndPoint(rng, self.editor.getBody(), true);
+				self.setRng(rng);
+			} else {
+				rng.setStart(node, offset);
+				rng.setEnd(node, offset);
+				self.setRng(rng);
+				self.collapse(false);
+			}
+		},
+
+		/**
+		 * Returns the selected contents using the DOM serializer passed in to this class.
+		 *
+		 * @method getContent
+		 * @param {Object} s Optional settings class with for example output format text or html.
+		 * @return {String} Selected contents in for example HTML format.
+		 * @example
+		 * // Alerts the currently selected contents
+		 * alert(tinymce.activeEditor.selection.getContent());
+		 *
+		 * // Alerts the currently selected contents as plain text
+		 * alert(tinymce.activeEditor.selection.getContent({format: 'text'}));
+		 */
+		getContent: function(args) {
+			var self = this, rng = self.getRng(), tmpElm = self.dom.create("body");
+			var se = self.getSel(), whiteSpaceBefore, whiteSpaceAfter, fragment;
+
+			args = args || {};
+			whiteSpaceBefore = whiteSpaceAfter = '';
+			args.get = true;
+			args.format = args.format || 'html';
+			args.selection = true;
+			self.editor.fire('BeforeGetContent', args);
+
+			if (args.format == 'text') {
+				return self.isCollapsed() ? '' : (rng.text || (se.toString ? se.toString() : ''));
+			}
+
+			if (rng.cloneContents) {
+				fragment = rng.cloneContents();
+
+				if (fragment) {
+					tmpElm.appendChild(fragment);
+				}
+			} else if (rng.item !== undefined || rng.htmlText !== undefined) {
+				// IE will produce invalid markup if elements are present that
+				// it doesn't understand like custom elements or HTML5 elements.
+				// Adding a BR in front of the contents and then remoiving it seems to fix it though.
+				tmpElm.innerHTML = '<br>' + (rng.item ? rng.item(0).outerHTML : rng.htmlText);
+				tmpElm.removeChild(tmpElm.firstChild);
+			} else {
+				tmpElm.innerHTML = rng.toString();
+			}
+
+			// Keep whitespace before and after
+			if (/^\s/.test(tmpElm.innerHTML)) {
+				whiteSpaceBefore = ' ';
+			}
+
+			if (/\s+$/.test(tmpElm.innerHTML)) {
+				whiteSpaceAfter = ' ';
+			}
+
+			args.getInner = true;
+
+			args.content = self.isCollapsed() ? '' : whiteSpaceBefore + self.serializer.serialize(tmpElm, args) + whiteSpaceAfter;
+			self.editor.fire('GetContent', args);
+
+			return args.content;
+		},
+
+		/**
+		 * Sets the current selection to the specified content. If any contents is selected it will be replaced
+		 * with the contents passed in to this function. If there is no selection the contents will be inserted
+		 * where the caret is placed in the editor/page.
+		 *
+		 * @method setContent
+		 * @param {String} content HTML contents to set could also be other formats depending on settings.
+		 * @param {Object} args Optional settings object with for example data format.
+		 * @example
+		 * // Inserts some HTML contents at the current selection
+		 * tinymce.activeEditor.selection.setContent('<strong>Some contents</strong>');
+		 */
+		setContent: function(content, args) {
+			var self = this, rng = self.getRng(), caretNode, doc = self.win.document, frag, temp;
+
+			args = args || {format: 'html'};
+			args.set = true;
+			args.selection = true;
+			content = args.content = content;
+
+			// Dispatch before set content event
+			if (!args.no_events) {
+				self.editor.fire('BeforeSetContent', args);
+			}
+
+			content = args.content;
+
+			if (rng.insertNode) {
+				// Make caret marker since insertNode places the caret in the beginning of text after insert
+				content += '<span id="__caret">_</span>';
+
+				// Delete and insert new node
+				if (rng.startContainer == doc && rng.endContainer == doc) {
+					// WebKit will fail if the body is empty since the range is then invalid and it can't insert contents
+					doc.body.innerHTML = content;
+				} else {
+					rng.deleteContents();
+
+					if (doc.body.childNodes.length === 0) {
+						doc.body.innerHTML = content;
+					} else {
+						// createContextualFragment doesn't exists in IE 9 DOMRanges
+						if (rng.createContextualFragment) {
+							rng.insertNode(rng.createContextualFragment(content));
+						} else {
+							// Fake createContextualFragment call in IE 9
+							frag = doc.createDocumentFragment();
+							temp = doc.createElement('div');
+
+							frag.appendChild(temp);
+							temp.outerHTML = content;
+
+							rng.insertNode(frag);
+						}
+					}
+				}
+
+				// Move to caret marker
+				caretNode = self.dom.get('__caret');
+
+				// Make sure we wrap it compleatly, Opera fails with a simple select call
+				rng = doc.createRange();
+				rng.setStartBefore(caretNode);
+				rng.setEndBefore(caretNode);
+				self.setRng(rng);
+
+				// Remove the caret position
+				self.dom.remove('__caret');
+
+				try {
+					self.setRng(rng);
+				} catch (ex) {
+					// Might fail on Opera for some odd reason
+				}
+			} else {
+				if (rng.item) {
+					// Delete content and get caret text selection
+					doc.execCommand('Delete', false, null);
+					rng = self.getRng();
+				}
+
+				// Explorer removes spaces from the beginning of pasted contents
+				if (/^\s+/.test(content)) {
+					rng.pasteHTML('<span id="__mce_tmp">_</span>' + content);
+					self.dom.remove('__mce_tmp');
+				} else {
+					rng.pasteHTML(content);
+				}
+			}
+
+			// Dispatch set content event
+			if (!args.no_events) {
+				self.editor.fire('SetContent', args);
+			}
+		},
+
+		/**
+		 * Returns the start element of a selection range. If the start is in a text
+		 * node the parent element will be returned.
+		 *
+		 * @method getStart
+		 * @param {Boolean} real Optional state to get the real parent when the selection is collapsed not the closest element.
+		 * @return {Element} Start element of selection range.
+		 */
+		getStart: function(real) {
+			var self = this, rng = self.getRng(), startElement, parentElement, checkRng, node;
+
+			if (rng.duplicate || rng.item) {
+				// Control selection, return first item
+				if (rng.item) {
+					return rng.item(0);
+				}
+
+				// Get start element
+				checkRng = rng.duplicate();
+				checkRng.collapse(1);
+				startElement = checkRng.parentElement();
+				if (startElement.ownerDocument !== self.dom.doc) {
+					startElement = self.dom.getRoot();
+				}
+
+				// Check if range parent is inside the start element, then return the inner parent element
+				// This will fix issues when a single element is selected, IE would otherwise return the wrong start element
+				parentElement = node = rng.parentElement();
+				while ((node = node.parentNode)) {
+					if (node == startElement) {
+						startElement = parentElement;
+						break;
+					}
+				}
+
+				return startElement;
+			} else {
+				startElement = rng.startContainer;
+
+				if (startElement.nodeType == 1 && startElement.hasChildNodes()) {
+					if (!real || !rng.collapsed) {
+						startElement = startElement.childNodes[Math.min(startElement.childNodes.length - 1, rng.startOffset)];
+					}
+				}
+
+				if (startElement && startElement.nodeType == 3) {
+					return startElement.parentNode;
+				}
+
+				return startElement;
+			}
+		},
+
+		/**
+		 * Returns the end element of a selection range. If the end is in a text
+		 * node the parent element will be returned.
+		 *
+		 * @method getEnd
+		 * @param {Boolean} real Optional state to get the real parent when the selection is collapsed not the closest element.
+		 * @return {Element} End element of selection range.
+		 */
+		getEnd: function(real) {
+			var self = this, rng = self.getRng(), endElement, endOffset;
+
+			if (rng.duplicate || rng.item) {
+				if (rng.item) {
+					return rng.item(0);
+				}
+
+				rng = rng.duplicate();
+				rng.collapse(0);
+				endElement = rng.parentElement();
+				if (endElement.ownerDocument !== self.dom.doc) {
+					endElement = self.dom.getRoot();
+				}
+
+				if (endElement && endElement.nodeName == 'BODY') {
+					return endElement.lastChild || endElement;
+				}
+
+				return endElement;
+			} else {
+				endElement = rng.endContainer;
+				endOffset = rng.endOffset;
+
+				if (endElement.nodeType == 1 && endElement.hasChildNodes()) {
+					if (!real || !rng.collapsed) {
+						endElement = endElement.childNodes[endOffset > 0 ? endOffset - 1 : endOffset];
+					}
+				}
+
+				if (endElement && endElement.nodeType == 3) {
+					return endElement.parentNode;
+				}
+
+				return endElement;
+			}
+		},
+
+		/**
+		 * Returns a bookmark location for the current selection. This bookmark object
+		 * can then be used to restore the selection after some content modification to the document.
+		 *
+		 * @method getBookmark
+		 * @param {Number} type Optional state if the bookmark should be simple or not. Default is complex.
+		 * @param {Boolean} normalized Optional state that enables you to get a position that it would be after normalization.
+		 * @return {Object} Bookmark object, use moveToBookmark with this object to restore the selection.
+		 * @example
+		 * // Stores a bookmark of the current selection
+		 * var bm = tinymce.activeEditor.selection.getBookmark();
+		 *
+		 * tinymce.activeEditor.setContent(tinymce.activeEditor.getContent() + 'Some new content');
+		 *
+		 * // Restore the selection bookmark
+		 * tinymce.activeEditor.selection.moveToBookmark(bm);
+		 */
+		getBookmark: function(type, normalized) {
+			return this.bookmarkManager.getBookmark(type, normalized);
+		},
+
+		/**
+		 * Restores the selection to the specified bookmark.
+		 *
+		 * @method moveToBookmark
+		 * @param {Object} bookmark Bookmark to restore selection from.
+		 * @return {Boolean} true/false if it was successful or not.
+		 * @example
+		 * // Stores a bookmark of the current selection
+		 * var bm = tinymce.activeEditor.selection.getBookmark();
+		 *
+		 * tinymce.activeEditor.setContent(tinymce.activeEditor.getContent() + 'Some new content');
+		 *
+		 * // Restore the selection bookmark
+		 * tinymce.activeEditor.selection.moveToBookmark(bm);
+		 */
+		moveToBookmark: function(bookmark) {
+			return this.bookmarkManager.moveToBookmark(bookmark);
+		},
+
+		/**
+		 * Selects the specified element. This will place the start and end of the selection range around the element.
+		 *
+		 * @method select
+		 * @param {Element} node HMTL DOM element to select.
+		 * @param {Boolean} content Optional bool state if the contents should be selected or not on non IE browser.
+		 * @return {Element} Selected element the same element as the one that got passed in.
+		 * @example
+		 * // Select the first paragraph in the active editor
+		 * tinymce.activeEditor.selection.select(tinymce.activeEditor.dom.select('p')[0]);
+		 */
+		select: function(node, content) {
+			var self = this, dom = self.dom, rng = dom.createRng(), idx;
+
+			// Clear stored range set by FocusManager
+			self.lastFocusBookmark = null;
+
+			if (node) {
+				if (!content && self.controlSelection.controlSelect(node)) {
+					return;
+				}
+
+				idx = dom.nodeIndex(node);
+				rng.setStart(node.parentNode, idx);
+				rng.setEnd(node.parentNode, idx + 1);
+
+				// Find first/last text node or BR element
+				if (content) {
+					self._moveEndPoint(rng, node, true);
+					self._moveEndPoint(rng, node);
+				}
+
+				self.setRng(rng);
+			}
+
+			return node;
+		},
+
+		/**
+		 * Returns true/false if the selection range is collapsed or not. Collapsed means if it's a caret or a larger selection.
+		 *
+		 * @method isCollapsed
+		 * @return {Boolean} true/false state if the selection range is collapsed or not.
+		 * Collapsed means if it's a caret or a larger selection.
+		 */
+		isCollapsed: function() {
+			var self = this, rng = self.getRng(), sel = self.getSel();
+
+			if (!rng || rng.item) {
+				return false;
+			}
+
+			if (rng.compareEndPoints) {
+				return rng.compareEndPoints('StartToEnd', rng) === 0;
+			}
+
+			return !sel || rng.collapsed;
+		},
+
+		/**
+		 * Collapse the selection to start or end of range.
+		 *
+		 * @method collapse
+		 * @param {Boolean} toStart Optional boolean state if to collapse to end or not. Defaults to start.
+		 */
+		collapse: function(toStart) {
+			var self = this, rng = self.getRng(), node;
+
+			// Control range on IE
+			if (rng.item) {
+				node = rng.item(0);
+				rng = self.win.document.body.createTextRange();
+				rng.moveToElementText(node);
+			}
+
+			rng.collapse(!!toStart);
+			self.setRng(rng);
+		},
+
+		/**
+		 * Returns the browsers internal selection object.
+		 *
+		 * @method getSel
+		 * @return {Selection} Internal browser selection object.
+		 */
+		getSel: function() {
+			var win = this.win;
+
+			return win.getSelection ? win.getSelection() : win.document.selection;
+		},
+
+		/**
+		 * Returns the browsers internal range object.
+		 *
+		 * @method getRng
+		 * @param {Boolean} w3c Forces a compatible W3C range on IE.
+		 * @return {Range} Internal browser range object.
+		 * @see http://www.quirksmode.org/dom/range_intro.html
+		 * @see http://www.dotvoid.com/2001/03/using-the-range-object-in-mozilla/
+		 */
+		getRng: function(w3c) {
+			var self = this, selection, rng, elm, doc = self.win.document, ieRng;
+
+			function tryCompareBoundaryPoints(how, sourceRange, destinationRange) {
+				try {
+					return sourceRange.compareBoundaryPoints(how, destinationRange);
+				} catch (ex) {
+					// Gecko throws wrong document exception if the range points
+					// to nodes that where removed from the dom #6690
+					// Browsers should mutate existing DOMRange instances so that they always point
+					// to something in the document this is not the case in Gecko works fine in IE/WebKit/Blink
+					// For performance reasons just return -1
+					return -1;
+				}
+			}
+
+			// Use last rng passed from FocusManager if it's available this enables
+			// calls to editor.selection.getStart() to work when caret focus is lost on IE
+			if (!w3c && self.lastFocusBookmark) {
+				var bookmark = self.lastFocusBookmark;
+
+				// Convert bookmark to range IE 11 fix
+				if (bookmark.startContainer) {
+					rng = doc.createRange();
+					rng.setStart(bookmark.startContainer, bookmark.startOffset);
+					rng.setEnd(bookmark.endContainer, bookmark.endOffset);
+				} else {
+					rng = bookmark;
+				}
+
+				return rng;
+			}
+
+			// Found tridentSel object then we need to use that one
+			if (w3c && self.tridentSel) {
+				return self.tridentSel.getRangeAt(0);
+			}
+
+			try {
+				if ((selection = self.getSel())) {
+					if (selection.rangeCount > 0) {
+						rng = selection.getRangeAt(0);
+					} else {
+						rng = selection.createRange ? selection.createRange() : doc.createRange();
+					}
+				}
+			} catch (ex) {
+				// IE throws unspecified error here if TinyMCE is placed in a frame/iframe
+			}
+
+			// We have W3C ranges and it's IE then fake control selection since IE9 doesn't handle that correctly yet
+			// IE 11 doesn't support the selection object so we check for that as well
+			if (isIE && rng && rng.setStart && doc.selection) {
+				try {
+					// IE will sometimes throw an exception here
+					ieRng = doc.selection.createRange();
+				} catch (ex) {
+
+				}
+
+				if (ieRng && ieRng.item) {
+					elm = ieRng.item(0);
+					rng = doc.createRange();
+					rng.setStartBefore(elm);
+					rng.setEndAfter(elm);
+				}
+			}
+
+			// No range found then create an empty one
+			// This can occur when the editor is placed in a hidden container element on Gecko
+			// Or on IE when there was an exception
+			if (!rng) {
+				rng = doc.createRange ? doc.createRange() : doc.body.createTextRange();
+			}
+
+			// If range is at start of document then move it to start of body
+			if (rng.setStart && rng.startContainer.nodeType === 9 && rng.collapsed) {
+				elm = self.dom.getRoot();
+				rng.setStart(elm, 0);
+				rng.setEnd(elm, 0);
+			}
+
+			if (self.selectedRange && self.explicitRange) {
+				if (tryCompareBoundaryPoints(rng.START_TO_START, rng, self.selectedRange) === 0 &&
+					tryCompareBoundaryPoints(rng.END_TO_END, rng, self.selectedRange) === 0) {
+					// Safari, Opera and Chrome only ever select text which causes the range to change.
+					// This lets us use the originally set range if the selection hasn't been changed by the user.
+					rng = self.explicitRange;
+				} else {
+					self.selectedRange = null;
+					self.explicitRange = null;
+				}
+			}
+
+			return rng;
+		},
+
+		/**
+		 * Changes the selection to the specified DOM range.
+		 *
+		 * @method setRng
+		 * @param {Range} rng Range to select.
+		 */
+		setRng: function(rng, forward) {
+			var self = this, sel;
+
+			if (!rng) {
+				return;
+			}
+
+			// Is IE specific range
+			if (rng.select) {
+				try {
+					rng.select();
+				} catch (ex) {
+					// Needed for some odd IE bug #1843306
+				}
+
+				return;
+			}
+
+			if (!self.tridentSel) {
+				sel = self.getSel();
+
+				if (sel) {
+					self.explicitRange = rng;
+
+					try {
+						sel.removeAllRanges();
+						sel.addRange(rng);
+					} catch (ex) {
+						// IE might throw errors here if the editor is within a hidden container and selection is changed
+					}
+
+					// Forward is set to false and we have an extend function
+					if (forward === false && sel.extend) {
+						sel.collapse(rng.endContainer, rng.endOffset);
+						sel.extend(rng.startContainer, rng.startOffset);
+					}
+
+					// adding range isn't always successful so we need to check range count otherwise an exception can occur
+					self.selectedRange = sel.rangeCount > 0 ? sel.getRangeAt(0) : null;
+				}
+			} else {
+				// Is W3C Range fake range on IE
+				if (rng.cloneRange) {
+					try {
+						self.tridentSel.addRange(rng);
+						return;
+					} catch (ex) {
+						//IE9 throws an error here if called before selection is placed in the editor
+					}
+				}
+			}
+		},
+
+		/**
+		 * Sets the current selection to the specified DOM element.
+		 *
+		 * @method setNode
+		 * @param {Element} elm Element to set as the contents of the selection.
+		 * @return {Element} Returns the element that got passed in.
+		 * @example
+		 * // Inserts a DOM node at current selection/caret location
+		 * tinymce.activeEditor.selection.setNode(tinymce.activeEditor.dom.create('img', {src: 'some.gif', title: 'some title'}));
+		 */
+		setNode: function(elm) {
+			var self = this;
+
+			self.setContent(self.dom.getOuterHTML(elm));
+
+			return elm;
+		},
+
+		/**
+		 * Returns the currently selected element or the common ancestor element for both start and end of the selection.
+		 *
+		 * @method getNode
+		 * @return {Element} Currently selected element or common ancestor element.
+		 * @example
+		 * // Alerts the currently selected elements node name
+		 * alert(tinymce.activeEditor.selection.getNode().nodeName);
+		 */
+		getNode: function() {
+			var self = this, rng = self.getRng(), elm;
+			var startContainer = rng.startContainer, endContainer = rng.endContainer;
+			var startOffset = rng.startOffset, endOffset = rng.endOffset, root = self.dom.getRoot();
+
+			function skipEmptyTextNodes(node, forwards) {
+				var orig = node;
+
+				while (node && node.nodeType === 3 && node.length === 0) {
+					node = forwards ? node.nextSibling : node.previousSibling;
+				}
+
+				return node || orig;
+			}
+
+			// Range maybe lost after the editor is made visible again
+			if (!rng) {
+				return root;
+			}
+
+			if (rng.setStart) {
+				elm = rng.commonAncestorContainer;
+
+				// Handle selection a image or other control like element such as anchors
+				if (!rng.collapsed) {
+					if (startContainer == endContainer) {
+						if (endOffset - startOffset < 2) {
+							if (startContainer.hasChildNodes()) {
+								elm = startContainer.childNodes[startOffset];
+							}
+						}
+					}
+
+					// If the anchor node is a element instead of a text node then return this element
+					//if (tinymce.isWebKit && sel.anchorNode && sel.anchorNode.nodeType == 1)
+					//	return sel.anchorNode.childNodes[sel.anchorOffset];
+
+					// Handle cases where the selection is immediately wrapped around a node and return that node instead of it's parent.
+					// This happens when you double click an underlined word in FireFox.
+					if (startContainer.nodeType === 3 && endContainer.nodeType === 3) {
+						if (startContainer.length === startOffset) {
+							startContainer = skipEmptyTextNodes(startContainer.nextSibling, true);
+						} else {
+							startContainer = startContainer.parentNode;
+						}
+
+						if (endOffset === 0) {
+							endContainer = skipEmptyTextNodes(endContainer.previousSibling, false);
+						} else {
+							endContainer = endContainer.parentNode;
+						}
+
+						if (startContainer && startContainer === endContainer) {
+							return startContainer;
+						}
+					}
+				}
+
+				if (elm && elm.nodeType == 3) {
+					return elm.parentNode;
+				}
+
+				return elm;
+			}
+
+			elm = rng.item ? rng.item(0) : rng.parentElement();
+
+			// IE 7 might return elements outside the iframe
+			if (elm.ownerDocument !== self.win.document) {
+				elm = root;
+			}
+
+			return elm;
+		},
+
+		getSelectedBlocks: function(startElm, endElm) {
+			var self = this, dom = self.dom, node, root, selectedBlocks = [];
+
+			root = dom.getRoot();
+			startElm = dom.getParent(startElm || self.getStart(), dom.isBlock);
+			endElm = dom.getParent(endElm || self.getEnd(), dom.isBlock);
+
+			if (startElm && startElm != root) {
+				selectedBlocks.push(startElm);
+			}
+
+			if (startElm && endElm && startElm != endElm) {
+				node = startElm;
+
+				var walker = new TreeWalker(startElm, root);
+				while ((node = walker.next()) && node != endElm) {
+					if (dom.isBlock(node)) {
+						selectedBlocks.push(node);
+					}
+				}
+			}
+
+			if (endElm && startElm != endElm && endElm != root) {
+				selectedBlocks.push(endElm);
+			}
+
+			return selectedBlocks;
+		},
+
+		isForward: function() {
+			var dom = this.dom, sel = this.getSel(), anchorRange, focusRange;
+
+			// No support for selection direction then always return true
+			if (!sel || !sel.anchorNode || !sel.focusNode) {
+				return true;
+			}
+
+			anchorRange = dom.createRng();
+			anchorRange.setStart(sel.anchorNode, sel.anchorOffset);
+			anchorRange.collapse(true);
+
+			focusRange = dom.createRng();
+			focusRange.setStart(sel.focusNode, sel.focusOffset);
+			focusRange.collapse(true);
+
+			return anchorRange.compareBoundaryPoints(anchorRange.START_TO_START, focusRange) <= 0;
+		},
+
+		normalize: function() {
+			var self = this, rng = self.getRng();
+
+			if (Env.range && new RangeUtils(self.dom).normalize(rng)) {
+				self.setRng(rng, self.isForward());
+			}
+
+			return rng;
+		},
+
+		/**
+		 * Executes callback when the current selection starts/stops matching the specified selector. The current
+		 * state will be passed to the callback as it's first argument.
+		 *
+		 * @method selectorChanged
+		 * @param {String} selector CSS selector to check for.
+		 * @param {function} callback Callback with state and args when the selector is matches or not.
+		 */
+		selectorChanged: function(selector, callback) {
+			var self = this, currentSelectors;
+
+			if (!self.selectorChangedData) {
+				self.selectorChangedData = {};
+				currentSelectors = {};
+
+				self.editor.on('NodeChange', function(e) {
+					var node = e.element, dom = self.dom, parents = dom.getParents(node, null, dom.getRoot()), matchedSelectors = {};
+
+					// Check for new matching selectors
+					each(self.selectorChangedData, function(callbacks, selector) {
+						each(parents, function(node) {
+							if (dom.is(node, selector)) {
+								if (!currentSelectors[selector]) {
+									// Execute callbacks
+									each(callbacks, function(callback) {
+										callback(true, {node: node, selector: selector, parents: parents});
+									});
+
+									currentSelectors[selector] = callbacks;
+								}
+
+								matchedSelectors[selector] = callbacks;
+								return false;
+							}
+						});
+					});
+
+					// Check if current selectors still match
+					each(currentSelectors, function(callbacks, selector) {
+						if (!matchedSelectors[selector]) {
+							delete currentSelectors[selector];
+
+							each(callbacks, function(callback) {
+								callback(false, {node: node, selector: selector, parents: parents});
+							});
+						}
+					});
+				});
+			}
+
+			// Add selector listeners
+			if (!self.selectorChangedData[selector]) {
+				self.selectorChangedData[selector] = [];
+			}
+
+			self.selectorChangedData[selector].push(callback);
+
+			return self;
+		},
+
+		getScrollContainer: function() {
+			var scrollContainer, node = this.dom.getRoot();
+
+			while (node && node.nodeName != 'BODY') {
+				if (node.scrollHeight > node.clientHeight) {
+					scrollContainer = node;
+					break;
+				}
+
+				node = node.parentNode;
+			}
+
+			return scrollContainer;
+		},
+
+		scrollIntoView: function(elm) {
+			var y, viewPort, self = this, dom = self.dom, root = dom.getRoot(), viewPortY, viewPortH;
+
+			function getPos(elm) {
+				var x = 0, y = 0;
+
+				var offsetParent = elm;
+				while (offsetParent && offsetParent.nodeType) {
+					x += offsetParent.offsetLeft || 0;
+					y += offsetParent.offsetTop || 0;
+					offsetParent = offsetParent.offsetParent;
+				}
+
+				return {x: x, y: y};
+			}
+
+			if (root.nodeName != 'BODY') {
+				var scrollContainer = self.getScrollContainer();
+				if (scrollContainer) {
+					y = getPos(elm).y - getPos(scrollContainer).y;
+					viewPortH = scrollContainer.clientHeight;
+					viewPortY = scrollContainer.scrollTop;
+					if (y < viewPortY || y + 25 > viewPortY + viewPortH) {
+						scrollContainer.scrollTop = y < viewPortY ? y : y - viewPortH + 25;
+					}
+
+					return;
+				}
+			}
+
+			viewPort = dom.getViewPort(self.editor.getWin());
+			y = dom.getPos(elm).y;
+			viewPortY = viewPort.y;
+			viewPortH = viewPort.h;
+			if (y < viewPort.y || y + 25 > viewPortY + viewPortH) {
+				self.editor.getWin().scrollTo(0, y < viewPortY ? y : y - viewPortH + 25);
+			}
+		},
+
+		placeCaretAt: function(clientX, clientY) {
+			var doc = this.editor.getDoc(), rng, point;
+
+			if (doc.caretPositionFromPoint) {
+				point = doc.caretPositionFromPoint(clientX, clientY);
+				rng = doc.createRange();
+				rng.setStart(point.offsetNode, point.offset);
+				rng.collapse(true);
+			} else if (doc.caretRangeFromPoint) {
+				rng = doc.caretRangeFromPoint(clientX, clientY);
+			} else if (doc.body.createTextRange) {
+				rng = doc.body.createTextRange();
+
+				try {
+					rng.moveToPoint(clientX, clientY);
+					rng.collapse(true);
+				} catch (ex) {
+					rng.collapse(clientY < doc.body.clientHeight);
+				}
+			}
+
+			this.setRng(rng);
+		},
+
+		_moveEndPoint: function(rng, node, start) {
+			var root = node, walker = new TreeWalker(node, root);
+			var nonEmptyElementsMap = this.dom.schema.getNonEmptyElements();
+
+			do {
+				// Text node
+				if (node.nodeType == 3 && trim(node.nodeValue).length !== 0) {
+					if (start) {
+						rng.setStart(node, 0);
+					} else {
+						rng.setEnd(node, node.nodeValue.length);
+					}
+
+					return;
+				}
+
+				// BR/IMG/INPUT elements but not table cells
+				if (nonEmptyElementsMap[node.nodeName] && !/^(TD|TH)$/.test(node.nodeName)) {
+					if (start) {
+						rng.setStartBefore(node);
+					} else {
+						if (node.nodeName == 'BR') {
+							rng.setEndBefore(node);
+						} else {
+							rng.setEndAfter(node);
+						}
+					}
+
+					return;
+				}
+
+				// Found empty text block old IE can place the selection inside those
+				if (Env.ie && Env.ie < 11 && this.dom.isBlock(node) && this.dom.isEmpty(node)) {
+					if (start) {
+						rng.setStart(node, 0);
+					} else {
+						rng.setEnd(node, 0);
+					}
+
+					return;
+				}
+			} while ((node = (start ? walker.next() : walker.prev())));
+
+			// Failed to find any text node or other suitable location then move to the root of body
+			if (root.nodeName == 'BODY') {
+				if (start) {
+					rng.setStart(root, 0);
+				} else {
+					rng.setEnd(root, root.childNodes.length);
+				}
+			}
+		},
+
+		destroy: function() {
+			this.win = null;
+			this.controlSelection.destroy();
+		}
+	};
+
+	return Selection;
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/Serializer.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,402 @@
+/**
+ * Serializer.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is used to serialize DOM trees into a string. Consult the TinyMCE Wiki API for
+ * more details and examples on how to use this class.
+ *
+ * @class tinymce.dom.Serializer
+ */
+define("tinymce/dom/Serializer", [
+	"tinymce/dom/DOMUtils",
+	"tinymce/html/DomParser",
+	"tinymce/html/Entities",
+	"tinymce/html/Serializer",
+	"tinymce/html/Node",
+	"tinymce/html/Schema",
+	"tinymce/Env",
+	"tinymce/util/Tools"
+], function(DOMUtils, DomParser, Entities, Serializer, Node, Schema, Env, Tools) {
+	var each = Tools.each, trim = Tools.trim;
+	var DOM = DOMUtils.DOM;
+
+	/**
+	 * Constructs a new DOM serializer class.
+	 *
+	 * @constructor
+	 * @method Serializer
+	 * @param {Object} settings Serializer settings object.
+	 * @param {tinymce.Editor} editor Optional editor to bind events to and get schema/dom from.
+	 */
+	return function(settings, editor) {
+		var dom, schema, htmlParser;
+
+		if (editor) {
+			dom = editor.dom;
+			schema = editor.schema;
+		}
+
+		// Default DOM and Schema if they are undefined
+		dom = dom || DOM;
+		schema = schema || new Schema(settings);
+		settings.entity_encoding = settings.entity_encoding || 'named';
+		settings.remove_trailing_brs = "remove_trailing_brs" in settings ? settings.remove_trailing_brs : true;
+
+		htmlParser = new DomParser(settings, schema);
+
+		// Convert tabindex back to elements when serializing contents
+		htmlParser.addAttributeFilter('data-mce-tabindex', function(nodes, name) {
+			var i = nodes.length, node;
+
+			while (i--) {
+				node = nodes[i];
+				node.attr('tabindex', node.attributes.map['data-mce-tabindex']);
+				node.attr(name, null);
+			}
+		});
+
+		// Convert move data-mce-src, data-mce-href and data-mce-style into nodes or process them if needed
+		htmlParser.addAttributeFilter('src,href,style', function(nodes, name) {
+			var i = nodes.length, node, value, internalName = 'data-mce-' + name;
+			var urlConverter = settings.url_converter, urlConverterScope = settings.url_converter_scope, undef;
+
+			while (i--) {
+				node = nodes[i];
+
+				value = node.attributes.map[internalName];
+				if (value !== undef) {
+					// Set external name to internal value and remove internal
+					node.attr(name, value.length > 0 ? value : null);
+					node.attr(internalName, null);
+				} else {
+					// No internal attribute found then convert the value we have in the DOM
+					value = node.attributes.map[name];
+
+					if (name === "style") {
+						value = dom.serializeStyle(dom.parseStyle(value), node.name);
+					} else if (urlConverter) {
+						value = urlConverter.call(urlConverterScope, value, name, node.name);
+					}
+
+					node.attr(name, value.length > 0 ? value : null);
+				}
+			}
+		});
+
+		// Remove internal classes mceItem<..> or mceSelected
+		htmlParser.addAttributeFilter('class', function(nodes) {
+			var i = nodes.length, node, value;
+
+			while (i--) {
+				node = nodes[i];
+				value = node.attr('class');
+
+				if (value) {
+					value = node.attr('class').replace(/(?:^|\s)mce-item-\w+(?!\S)/g, '');
+					node.attr('class', value.length > 0 ? value : null);
+				}
+			}
+		});
+
+		// Remove bookmark elements
+		htmlParser.addAttributeFilter('data-mce-type', function(nodes, name, args) {
+			var i = nodes.length, node;
+
+			while (i--) {
+				node = nodes[i];
+
+				if (node.attributes.map['data-mce-type'] === 'bookmark' && !args.cleanup) {
+					node.remove();
+				}
+			}
+		});
+
+		htmlParser.addNodeFilter('noscript', function(nodes) {
+			var i = nodes.length, node;
+
+			while (i--) {
+				node = nodes[i].firstChild;
+
+				if (node) {
+					node.value = Entities.decode(node.value);
+				}
+			}
+		});
+
+		// Force script into CDATA sections and remove the mce- prefix also add comments around styles
+		htmlParser.addNodeFilter('script,style', function(nodes, name) {
+			var i = nodes.length, node, value, type;
+
+			function trim(value) {
+				/*jshint maxlen:255 */
+				/*eslint max-len:0 */
+				return value.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, '');
+			}
+
+			while (i--) {
+				node = nodes[i];
+				value = node.firstChild ? node.firstChild.value : '';
+
+				if (name === "script") {
+					// Remove mce- prefix from script elements and remove default type since the user specified
+					// a script element without type attribute
+					type = node.attr('type');
+					if (type) {
+						node.attr('type', type == 'mce-no/type' ? null : type.replace(/^mce\-/, ''));
+					}
+
+					if (value.length > 0) {
+						node.firstChild.value = '// <![CDATA[\n' + trim(value) + '\n// ]]>';
+					}
+				} else {
+					if (value.length > 0) {
+						node.firstChild.value = '<!--\n' + trim(value) + '\n-->';
+					}
+				}
+			}
+		});
+
+		// Convert comments to cdata and handle protected comments
+		htmlParser.addNodeFilter('#comment', function(nodes) {
+			var i = nodes.length, node;
+
+			while (i--) {
+				node = nodes[i];
+
+				if (node.value.indexOf('[CDATA[') === 0) {
+					node.name = '#cdata';
+					node.type = 4;
+					node.value = node.value.replace(/^\[CDATA\[|\]\]$/g, '');
+				} else if (node.value.indexOf('mce:protected ') === 0) {
+					node.name = "#text";
+					node.type = 3;
+					node.raw = true;
+					node.value = unescape(node.value).substr(14);
+				}
+			}
+		});
+
+		htmlParser.addNodeFilter('xml:namespace,input', function(nodes, name) {
+			var i = nodes.length, node;
+
+			while (i--) {
+				node = nodes[i];
+				if (node.type === 7) {
+					node.remove();
+				} else if (node.type === 1) {
+					if (name === "input" && !("type" in node.attributes.map)) {
+						node.attr('type', 'text');
+					}
+				}
+			}
+		});
+
+		// Fix list elements, TODO: Replace this later
+		if (settings.fix_list_elements) {
+			htmlParser.addNodeFilter('ul,ol', function(nodes) {
+				var i = nodes.length, node, parentNode;
+
+				while (i--) {
+					node = nodes[i];
+					parentNode = node.parent;
+
+					if (parentNode.name === 'ul' || parentNode.name === 'ol') {
+						if (node.prev && node.prev.name === 'li') {
+							node.prev.append(node);
+						}
+					}
+				}
+			});
+		}
+
+		// Remove internal data attributes
+		htmlParser.addAttributeFilter(
+			'data-mce-src,data-mce-href,data-mce-style,' +
+			'data-mce-selected,data-mce-expando,' +
+			'data-mce-type,data-mce-resize',
+
+			function(nodes, name) {
+				var i = nodes.length;
+
+				while (i--) {
+					nodes[i].attr(name, null);
+				}
+			}
+		);
+
+		// Return public methods
+		return {
+			/**
+			 * Schema instance that was used to when the Serializer was constructed.
+			 *
+			 * @field {tinymce.html.Schema} schema
+			 */
+			schema: schema,
+
+			/**
+			 * Adds a node filter function to the parser used by the serializer, the parser will collect the specified nodes by name
+			 * and then execute the callback ones it has finished parsing the document.
+			 *
+			 * @example
+			 * parser.addNodeFilter('p,h1', function(nodes, name) {
+			 *		for (var i = 0; i < nodes.length; i++) {
+			 *			console.log(nodes[i].name);
+			 *		}
+			 * });
+			 * @method addNodeFilter
+			 * @method {String} name Comma separated list of nodes to collect.
+			 * @param {function} callback Callback function to execute once it has collected nodes.
+			 */
+			addNodeFilter: htmlParser.addNodeFilter,
+
+			/**
+			 * Adds a attribute filter function to the parser used by the serializer, the parser will
+			 * collect nodes that has the specified attributes
+			 * and then execute the callback ones it has finished parsing the document.
+			 *
+			 * @example
+			 * parser.addAttributeFilter('src,href', function(nodes, name) {
+			 *		for (var i = 0; i < nodes.length; i++) {
+			 *			console.log(nodes[i].name);
+			 *		}
+			 * });
+			 * @method addAttributeFilter
+			 * @method {String} name Comma separated list of nodes to collect.
+			 * @param {function} callback Callback function to execute once it has collected nodes.
+			 */
+			addAttributeFilter: htmlParser.addAttributeFilter,
+
+			/**
+			 * Serializes the specified browser DOM node into a HTML string.
+			 *
+			 * @method serialize
+			 * @param {DOMNode} node DOM node to serialize.
+			 * @param {Object} args Arguments option that gets passed to event handlers.
+			 */
+			serialize: function(node, args) {
+				var self = this, impl, doc, oldDoc, htmlSerializer, content;
+
+				// Explorer won't clone contents of script and style and the
+				// selected index of select elements are cleared on a clone operation.
+				if (Env.ie && dom.select('script,style,select,map').length > 0) {
+					content = node.innerHTML;
+					node = node.cloneNode(false);
+					dom.setHTML(node, content);
+				} else {
+					node = node.cloneNode(true);
+				}
+
+				// Nodes needs to be attached to something in WebKit/Opera
+				// This fix will make DOM ranges and make Sizzle happy!
+				impl = node.ownerDocument.implementation;
+				if (impl.createHTMLDocument) {
+					// Create an empty HTML document
+					doc = impl.createHTMLDocument("");
+
+					// Add the element or it's children if it's a body element to the new document
+					each(node.nodeName == 'BODY' ? node.childNodes : [node], function(node) {
+						doc.body.appendChild(doc.importNode(node, true));
+					});
+
+					// Grab first child or body element for serialization
+					if (node.nodeName != 'BODY') {
+						node = doc.body.firstChild;
+					} else {
+						node = doc.body;
+					}
+
+					// set the new document in DOMUtils so createElement etc works
+					oldDoc = dom.doc;
+					dom.doc = doc;
+				}
+
+				args = args || {};
+				args.format = args.format || 'html';
+
+				// Don't wrap content if we want selected html
+				if (args.selection) {
+					args.forced_root_block = '';
+				}
+
+				// Pre process
+				if (!args.no_events) {
+					args.node = node;
+					self.onPreProcess(args);
+				}
+
+				// Setup serializer
+				htmlSerializer = new Serializer(settings, schema);
+
+				// Parse and serialize HTML
+				args.content = htmlSerializer.serialize(
+					htmlParser.parse(trim(args.getInner ? node.innerHTML : dom.getOuterHTML(node)), args)
+				);
+
+				// Replace all BOM characters for now until we can find a better solution
+				if (!args.cleanup) {
+					args.content = args.content.replace(/\uFEFF/g, '');
+				}
+
+				// Post process
+				if (!args.no_events) {
+					self.onPostProcess(args);
+				}
+
+				// Restore the old document if it was changed
+				if (oldDoc) {
+					dom.doc = oldDoc;
+				}
+
+				args.node = null;
+
+				return args.content;
+			},
+
+			/**
+			 * Adds valid elements rules to the serializers schema instance this enables you to specify things
+			 * like what elements should be outputted and what attributes specific elements might have.
+			 * Consult the Wiki for more details on this format.
+			 *
+			 * @method addRules
+			 * @param {String} rules Valid elements rules string to add to schema.
+			 */
+			addRules: function(rules) {
+				schema.addValidElements(rules);
+			},
+
+			/**
+			 * Sets the valid elements rules to the serializers schema instance this enables you to specify things
+			 * like what elements should be outputted and what attributes specific elements might have.
+			 * Consult the Wiki for more details on this format.
+			 *
+			 * @method setRules
+			 * @param {String} rules Valid elements rules string.
+			 */
+			setRules: function(rules) {
+				schema.setValidElements(rules);
+			},
+
+			onPreProcess: function(args) {
+				if (editor) {
+					editor.fire('PreProcess', args);
+				}
+			},
+
+			onPostProcess: function(args) {
+				if (editor) {
+					editor.fire('PostProcess', args);
+				}
+			}
+		};
+	};
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/Sizzle.jQuery.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,23 @@
+/**
+ * Sizzle.jQuery.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global jQuery:true */
+
+/*
+ * Fake Sizzle using jQuery.
+ */
+define("tinymce/dom/Sizzle", [], function() {
+	// Detect if jQuery is loaded
+	if (!window.jQuery) {
+		throw new Error("Load jQuery first");
+	}
+
+	return jQuery.find;
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/Sizzle.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,2038 @@
+/**
+ * Sizzle.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ *
+ * @ignore-file
+ */
+
+/*jshint bitwise:false, expr:true, noempty:false, sub:true, eqnull:true, latedef:false, maxlen:255 */
+/*eslint dot-notation:0, no-empty:0, no-cond-assign:0, no-unused-expressions:0, new-cap:0 */
+/*eslint no-nested-ternary:0, func-style:0, no-bitwise:0, max-len:0, brace-style:0, no-return-assign:0, no-multi-spaces:0 */
+
+/**
+ * Sizzle CSS Selector Engine v@VERSION
+ * http://sizzlejs.com/
+ *
+ * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ *
+ * Date: @DATE
+ */
+define("tinymce/dom/Sizzle", [], function() {
+var i,
+	support,
+	Expr,
+	getText,
+	isXML,
+	tokenize,
+	compile,
+	select,
+	outermostContext,
+	sortInput,
+	hasDuplicate,
+
+	// Local document vars
+	setDocument,
+	document,
+	docElem,
+	documentIsHTML,
+	rbuggyQSA,
+	rbuggyMatches,
+	matches,
+	contains,
+
+	// Instance-specific data
+	expando = "sizzle" + -(new Date()),
+	preferredDoc = window.document,
+	dirruns = 0,
+	done = 0,
+	classCache = createCache(),
+	tokenCache = createCache(),
+	compilerCache = createCache(),
+	sortOrder = function( a, b ) {
+		if ( a === b ) {
+			hasDuplicate = true;
+		}
+		return 0;
+	},
+
+	// General-purpose constants
+	strundefined = typeof undefined,
+	MAX_NEGATIVE = 1 << 31,
+
+	// Instance methods
+	hasOwn = ({}).hasOwnProperty,
+	arr = [],
+	pop = arr.pop,
+	push_native = arr.push,
+	push = arr.push,
+	slice = arr.slice,
+	// Use a stripped-down indexOf if we can't use a native one
+	indexOf = arr.indexOf || function( elem ) {
+		var i = 0,
+			len = this.length;
+		for ( ; i < len; i++ ) {
+			if ( this[i] === elem ) {
+				return i;
+			}
+		}
+		return -1;
+	},
+
+	booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
+
+	// Regular expressions
+
+	// http://www.w3.org/TR/css3-selectors/#whitespace
+	whitespace = "[\\x20\\t\\r\\n\\f]",
+
+	// http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
+	identifier = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
+
+	// Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
+	attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
+		// Operator (capture 2)
+		"*([*^$|!~]?=)" + whitespace +
+		// "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
+		"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
+		"*\\]",
+
+	pseudos = ":(" + identifier + ")(?:\\((" +
+		// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
+		// 1. quoted (capture 3; capture 4 or capture 5)
+		"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
+		// 2. simple (capture 6)
+		"((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
+		// 3. anything else (capture 2)
+		".*" +
+		")\\)|)",
+
+	// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
+	rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
+
+	rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
+	rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
+
+	rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
+
+	rpseudo = new RegExp( pseudos ),
+	ridentifier = new RegExp( "^" + identifier + "$" ),
+
+	matchExpr = {
+		"ID": new RegExp( "^#(" + identifier + ")" ),
+		"CLASS": new RegExp( "^\\.(" + identifier + ")" ),
+		"TAG": new RegExp( "^(" + identifier + "|[*])" ),
+		"ATTR": new RegExp( "^" + attributes ),
+		"PSEUDO": new RegExp( "^" + pseudos ),
+		"CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
+			"*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
+			"*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
+		"bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
+		// For use in libraries implementing .is()
+		// We use this for POS matching in `select`
+		"needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
+			whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
+	},
+
+	rinputs = /^(?:input|select|textarea|button)$/i,
+	rheader = /^h\d$/i,
+
+	rnative = /^[^{]+\{\s*\[native \w/,
+
+	// Easily-parseable/retrievable ID or TAG or CLASS selectors
+	rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
+
+	rsibling = /[+~]/,
+	rescape = /'|\\/g,
+
+	// CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
+	runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
+	funescape = function( _, escaped, escapedWhitespace ) {
+		var high = "0x" + escaped - 0x10000;
+		// NaN means non-codepoint
+		// Support: Firefox<24
+		// Workaround erroneous numeric interpretation of +"0x"
+		return high !== high || escapedWhitespace ?
+			escaped :
+			high < 0 ?
+				// BMP codepoint
+				String.fromCharCode( high + 0x10000 ) :
+				// Supplemental Plane codepoint (surrogate pair)
+				String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
+	};
+
+// Optimize for push.apply( _, NodeList )
+try {
+	push.apply(
+		(arr = slice.call( preferredDoc.childNodes )),
+		preferredDoc.childNodes
+	);
+	// Support: Android<4.0
+	// Detect silently failing push.apply
+	arr[ preferredDoc.childNodes.length ].nodeType;
+} catch ( e ) {
+	push = { apply: arr.length ?
+
+		// Leverage slice if possible
+		function( target, els ) {
+			push_native.apply( target, slice.call(els) );
+		} :
+
+		// Support: IE<9
+		// Otherwise append directly
+		function( target, els ) {
+			var j = target.length,
+				i = 0;
+			// Can't trust NodeList.length
+			while ( (target[j++] = els[i++]) ) {}
+			target.length = j - 1;
+		}
+	};
+}
+
+function Sizzle( selector, context, results, seed ) {
+	var match, elem, m, nodeType,
+		// QSA vars
+		i, groups, old, nid, newContext, newSelector;
+
+	if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
+		setDocument( context );
+	}
+
+	context = context || document;
+	results = results || [];
+
+	if ( !selector || typeof selector !== "string" ) {
+		return results;
+	}
+
+	if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
+		return [];
+	}
+
+	if ( documentIsHTML && !seed ) {
+
+		// Shortcuts
+		if ( (match = rquickExpr.exec( selector )) ) {
+			// Speed-up: Sizzle("#ID")
+			if ( (m = match[1]) ) {
+				if ( nodeType === 9 ) {
+					elem = context.getElementById( m );
+					// Check parentNode to catch when Blackberry 4.6 returns
+					// nodes that are no longer in the document (jQuery #6963)
+					if ( elem && elem.parentNode ) {
+						// Handle the case where IE, Opera, and Webkit return items
+						// by name instead of ID
+						if ( elem.id === m ) {
+							results.push( elem );
+							return results;
+						}
+					} else {
+						return results;
+					}
+				} else {
+					// Context is not a document
+					if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
+						contains( context, elem ) && elem.id === m ) {
+						results.push( elem );
+						return results;
+					}
+				}
+
+			// Speed-up: Sizzle("TAG")
+			} else if ( match[2] ) {
+				push.apply( results, context.getElementsByTagName( selector ) );
+				return results;
+
+			// Speed-up: Sizzle(".CLASS")
+			} else if ( (m = match[3]) && support.getElementsByClassName ) {
+				push.apply( results, context.getElementsByClassName( m ) );
+				return results;
+			}
+		}
+
+		// QSA path
+		if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
+			nid = old = expando;
+			newContext = context;
+			newSelector = nodeType === 9 && selector;
+
+			// qSA works strangely on Element-rooted queries
+			// We can work around this by specifying an extra ID on the root
+			// and working up from there (Thanks to Andrew Dupont for the technique)
+			// IE 8 doesn't work on object elements
+			if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
+				groups = tokenize( selector );
+
+				if ( (old = context.getAttribute("id")) ) {
+					nid = old.replace( rescape, "\\$&" );
+				} else {
+					context.setAttribute( "id", nid );
+				}
+				nid = "[id='" + nid + "'] ";
+
+				i = groups.length;
+				while ( i-- ) {
+					groups[i] = nid + toSelector( groups[i] );
+				}
+				newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context;
+				newSelector = groups.join(",");
+			}
+
+			if ( newSelector ) {
+				try {
+					push.apply( results,
+						newContext.querySelectorAll( newSelector )
+					);
+					return results;
+				} catch(qsaError) {
+				} finally {
+					if ( !old ) {
+						context.removeAttribute("id");
+					}
+				}
+			}
+		}
+	}
+
+	// All others
+	return select( selector.replace( rtrim, "$1" ), context, results, seed );
+}
+
+/**
+ * Create key-value caches of limited size
+ * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
+ *	property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
+ *	deleting the oldest entry
+ */
+function createCache() {
+	var keys = [];
+
+	function cache( key, value ) {
+		// Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
+		if ( keys.push( key + " " ) > Expr.cacheLength ) {
+			// Only keep the most recent entries
+			delete cache[ keys.shift() ];
+		}
+		return (cache[ key + " " ] = value);
+	}
+	return cache;
+}
+
+/**
+ * Mark a function for special use by Sizzle
+ * @param {Function} fn The function to mark
+ */
+function markFunction( fn ) {
+	fn[ expando ] = true;
+	return fn;
+}
+
+/**
+ * Support testing using an element
+ * @param {Function} fn Passed the created div and expects a boolean result
+ */
+function assert( fn ) {
+	var div = document.createElement("div");
+
+	try {
+		return !!fn( div );
+	} catch (e) {
+		return false;
+	} finally {
+		// Remove from its parent by default
+		if ( div.parentNode ) {
+			div.parentNode.removeChild( div );
+		}
+		// release memory in IE
+		div = null;
+	}
+}
+
+/**
+ * Adds the same handler for all of the specified attrs
+ * @param {String} attrs Pipe-separated list of attributes
+ * @param {Function} handler The method that will be applied
+ */
+function addHandle( attrs, handler ) {
+	var arr = attrs.split("|"),
+		i = attrs.length;
+
+	while ( i-- ) {
+		Expr.attrHandle[ arr[i] ] = handler;
+	}
+}
+
+/**
+ * Checks document order of two siblings
+ * @param {Element} a
+ * @param {Element} b
+ * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
+ */
+function siblingCheck( a, b ) {
+	var cur = b && a,
+		diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
+			( ~b.sourceIndex || MAX_NEGATIVE ) -
+			( ~a.sourceIndex || MAX_NEGATIVE );
+
+	// Use IE sourceIndex if available on both nodes
+	if ( diff ) {
+		return diff;
+	}
+
+	// Check if b follows a
+	if ( cur ) {
+		while ( (cur = cur.nextSibling) ) {
+			if ( cur === b ) {
+				return -1;
+			}
+		}
+	}
+
+	return a ? 1 : -1;
+}
+
+/**
+ * Returns a function to use in pseudos for input types
+ * @param {String} type
+ */
+function createInputPseudo( type ) {
+	return function( elem ) {
+		var name = elem.nodeName.toLowerCase();
+		return name === "input" && elem.type === type;
+	};
+}
+
+/**
+ * Returns a function to use in pseudos for buttons
+ * @param {String} type
+ */
+function createButtonPseudo( type ) {
+	return function( elem ) {
+		var name = elem.nodeName.toLowerCase();
+		return (name === "input" || name === "button") && elem.type === type;
+	};
+}
+
+/**
+ * Returns a function to use in pseudos for positionals
+ * @param {Function} fn
+ */
+function createPositionalPseudo( fn ) {
+	return markFunction(function( argument ) {
+		argument = +argument;
+		return markFunction(function( seed, matches ) {
+			var j,
+				matchIndexes = fn( [], seed.length, argument ),
+				i = matchIndexes.length;
+
+			// Match elements found at the specified indexes
+			while ( i-- ) {
+				if ( seed[ (j = matchIndexes[i]) ] ) {
+					seed[j] = !(matches[j] = seed[j]);
+				}
+			}
+		});
+	});
+}
+
+/**
+ * Checks a node for validity as a Sizzle context
+ * @param {Element|Object=} context
+ * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
+ */
+function testContext( context ) {
+	return context && typeof context.getElementsByTagName !== strundefined && context;
+}
+
+// Expose support vars for convenience
+support = Sizzle.support = {};
+
+/**
+ * Detects XML nodes
+ * @param {Element|Object} elem An element or a document
+ * @returns {Boolean} True iff elem is a non-HTML XML node
+ */
+isXML = Sizzle.isXML = function( elem ) {
+	// documentElement is verified for cases where it doesn't yet exist
+	// (such as loading iframes in IE - #4833)
+	var documentElement = elem && (elem.ownerDocument || elem).documentElement;
+	return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+/**
+ * Sets document-related variables once based on the current document
+ * @param {Element|Object} [doc] An element or document object to use to set the document
+ * @returns {Object} Returns the current document
+ */
+setDocument = Sizzle.setDocument = function( node ) {
+	var hasCompare,
+		doc = node ? node.ownerDocument || node : preferredDoc,
+		parent = doc.defaultView;
+
+	// If no document and documentElement is available, return
+	if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
+		return document;
+	}
+
+	// Set our document
+	document = doc;
+	docElem = doc.documentElement;
+
+	// Support tests
+	documentIsHTML = !isXML( doc );
+
+	// Support: IE>8
+	// If iframe document is assigned to "document" variable and if iframe has been reloaded,
+	// IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
+	// IE6-8 do not support the defaultView property so parent will be undefined
+	if ( parent && parent !== parent.top ) {
+		// IE11 does not have attachEvent, so all must suffer
+		if ( parent.addEventListener ) {
+			parent.addEventListener( "unload", function() {
+				setDocument();
+			}, false );
+		} else if ( parent.attachEvent ) {
+			parent.attachEvent( "onunload", function() {
+				setDocument();
+			});
+		}
+	}
+
+	/* Attributes
+	---------------------------------------------------------------------- */
+
+	// Support: IE<8
+	// Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans)
+	support.attributes = assert(function( div ) {
+		div.className = "i";
+		return !div.getAttribute("className");
+	});
+
+	/* getElement(s)By*
+	---------------------------------------------------------------------- */
+
+	// Check if getElementsByTagName("*") returns only elements
+	support.getElementsByTagName = assert(function( div ) {
+		div.appendChild( doc.createComment("") );
+		return !div.getElementsByTagName("*").length;
+	});
+
+	// Support: IE<9
+	support.getElementsByClassName = rnative.test( doc.getElementsByClassName );
+
+	// Support: IE<10
+	// Check if getElementById returns elements by name
+	// The broken getElementById methods don't pick up programatically-set names,
+	// so use a roundabout getElementsByName test
+	support.getById = assert(function( div ) {
+		docElem.appendChild( div ).id = expando;
+		return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
+	});
+
+	// ID find and filter
+	if ( support.getById ) {
+		Expr.find["ID"] = function( id, context ) {
+			if ( typeof context.getElementById !== strundefined && documentIsHTML ) {
+				var m = context.getElementById( id );
+				// Check parentNode to catch when Blackberry 4.6 returns
+				// nodes that are no longer in the document #6963
+				return m && m.parentNode ? [ m ] : [];
+			}
+		};
+		Expr.filter["ID"] = function( id ) {
+			var attrId = id.replace( runescape, funescape );
+			return function( elem ) {
+				return elem.getAttribute("id") === attrId;
+			};
+		};
+	} else {
+		// Support: IE6/7
+		// getElementById is not reliable as a find shortcut
+		delete Expr.find["ID"];
+
+		Expr.filter["ID"] =  function( id ) {
+			var attrId = id.replace( runescape, funescape );
+			return function( elem ) {
+				var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
+				return node && node.value === attrId;
+			};
+		};
+	}
+
+	// Tag
+	Expr.find["TAG"] = support.getElementsByTagName ?
+		function( tag, context ) {
+			if ( typeof context.getElementsByTagName !== strundefined ) {
+				return context.getElementsByTagName( tag );
+			}
+		} :
+		function( tag, context ) {
+			var elem,
+				tmp = [],
+				i = 0,
+				results = context.getElementsByTagName( tag );
+
+			// Filter out possible comments
+			if ( tag === "*" ) {
+				while ( (elem = results[i++]) ) {
+					if ( elem.nodeType === 1 ) {
+						tmp.push( elem );
+					}
+				}
+
+				return tmp;
+			}
+			return results;
+		};
+
+	// Class
+	Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
+		if ( documentIsHTML ) {
+			return context.getElementsByClassName( className );
+		}
+	};
+
+	/* QSA/matchesSelector
+	---------------------------------------------------------------------- */
+
+	// QSA and matchesSelector support
+
+	// matchesSelector(:active) reports false when true (IE9/Opera 11.5)
+	rbuggyMatches = [];
+
+	// qSa(:focus) reports false when true (Chrome 21)
+	// We allow this because of a bug in IE8/9 that throws an error
+	// whenever `document.activeElement` is accessed on an iframe
+	// So, we allow :focus to pass through QSA all the time to avoid the IE error
+	// See http://bugs.jquery.com/ticket/13378
+	rbuggyQSA = [];
+
+	if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
+		// Build QSA regex
+		// Regex strategy adopted from Diego Perini
+		assert(function( div ) {
+			// Select is set to empty string on purpose
+			// This is to test IE's treatment of not explicitly
+			// setting a boolean content attribute,
+			// since its presence should be enough
+			// http://bugs.jquery.com/ticket/12359
+			div.innerHTML = "<select msallowcapture=''><option selected=''></option></select>";
+
+			// Support: IE8, Opera 11-12.16
+			// Nothing should be selected when empty strings follow ^= or $= or *=
+			// The test attribute must be unknown in Opera but "safe" for WinRT
+			// http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
+			if ( div.querySelectorAll("[msallowcapture^='']").length ) {
+				rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
+			}
+
+			// Support: IE8
+			// Boolean attributes and "value" are not treated correctly
+			if ( !div.querySelectorAll("[selected]").length ) {
+				rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
+			}
+
+			// Webkit/Opera - :checked should return selected option elements
+			// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+			// IE8 throws error here and will not see later tests
+			if ( !div.querySelectorAll(":checked").length ) {
+				rbuggyQSA.push(":checked");
+			}
+		});
+
+		assert(function( div ) {
+			// Support: Windows 8 Native Apps
+			// The type and name attributes are restricted during .innerHTML assignment
+			var input = doc.createElement("input");
+			input.setAttribute( "type", "hidden" );
+			div.appendChild( input ).setAttribute( "name", "D" );
+
+			// Support: IE8
+			// Enforce case-sensitivity of name attribute
+			if ( div.querySelectorAll("[name=d]").length ) {
+				rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
+			}
+
+			// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
+			// IE8 throws error here and will not see later tests
+			if ( !div.querySelectorAll(":enabled").length ) {
+				rbuggyQSA.push( ":enabled", ":disabled" );
+			}
+
+			// Opera 10-11 does not throw on post-comma invalid pseudos
+			div.querySelectorAll("*,:x");
+			rbuggyQSA.push(",.*:");
+		});
+	}
+
+	if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
+		docElem.webkitMatchesSelector ||
+		docElem.mozMatchesSelector ||
+		docElem.oMatchesSelector ||
+		docElem.msMatchesSelector) )) ) {
+
+		assert(function( div ) {
+			// Check to see if it's possible to do matchesSelector
+			// on a disconnected node (IE 9)
+			support.disconnectedMatch = matches.call( div, "div" );
+
+			// This should fail with an exception
+			// Gecko does not error, returns false instead
+			matches.call( div, "[s!='']:x" );
+			rbuggyMatches.push( "!=", pseudos );
+		});
+	}
+
+	rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
+	rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
+
+	/* Contains
+	---------------------------------------------------------------------- */
+	hasCompare = rnative.test( docElem.compareDocumentPosition );
+
+	// Element contains another
+	// Purposefully does not implement inclusive descendent
+	// As in, an element does not contain itself
+	contains = hasCompare || rnative.test( docElem.contains ) ?
+		function( a, b ) {
+			var adown = a.nodeType === 9 ? a.documentElement : a,
+				bup = b && b.parentNode;
+			return a === bup || !!( bup && bup.nodeType === 1 && (
+				adown.contains ?
+					adown.contains( bup ) :
+					a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
+			));
+		} :
+		function( a, b ) {
+			if ( b ) {
+				while ( (b = b.parentNode) ) {
+					if ( b === a ) {
+						return true;
+					}
+				}
+			}
+			return false;
+		};
+
+	/* Sorting
+	---------------------------------------------------------------------- */
+
+	// Document order sorting
+	sortOrder = hasCompare ?
+	function( a, b ) {
+
+		// Flag for duplicate removal
+		if ( a === b ) {
+			hasDuplicate = true;
+			return 0;
+		}
+
+		// Sort on method existence if only one input has compareDocumentPosition
+		var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
+		if ( compare ) {
+			return compare;
+		}
+
+		// Calculate position if both inputs belong to the same document
+		compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
+			a.compareDocumentPosition( b ) :
+
+			// Otherwise we know they are disconnected
+			1;
+
+		// Disconnected nodes
+		if ( compare & 1 ||
+			(!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
+
+			// Choose the first element that is related to our preferred document
+			if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
+				return -1;
+			}
+			if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
+				return 1;
+			}
+
+			// Maintain original order
+			return sortInput ?
+				( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
+				0;
+		}
+
+		return compare & 4 ? -1 : 1;
+	} :
+	function( a, b ) {
+		// Exit early if the nodes are identical
+		if ( a === b ) {
+			hasDuplicate = true;
+			return 0;
+		}
+
+		var cur,
+			i = 0,
+			aup = a.parentNode,
+			bup = b.parentNode,
+			ap = [ a ],
+			bp = [ b ];
+
+		// Parentless nodes are either documents or disconnected
+		if ( !aup || !bup ) {
+			return a === doc ? -1 :
+				b === doc ? 1 :
+				aup ? -1 :
+				bup ? 1 :
+				sortInput ?
+				( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
+				0;
+
+		// If the nodes are siblings, we can do a quick check
+		} else if ( aup === bup ) {
+			return siblingCheck( a, b );
+		}
+
+		// Otherwise we need full lists of their ancestors for comparison
+		cur = a;
+		while ( (cur = cur.parentNode) ) {
+			ap.unshift( cur );
+		}
+		cur = b;
+		while ( (cur = cur.parentNode) ) {
+			bp.unshift( cur );
+		}
+
+		// Walk down the tree looking for a discrepancy
+		while ( ap[i] === bp[i] ) {
+			i++;
+		}
+
+		return i ?
+			// Do a sibling check if the nodes have a common ancestor
+			siblingCheck( ap[i], bp[i] ) :
+
+			// Otherwise nodes in our document sort first
+			ap[i] === preferredDoc ? -1 :
+			bp[i] === preferredDoc ? 1 :
+			0;
+	};
+
+	return doc;
+};
+
+Sizzle.matches = function( expr, elements ) {
+	return Sizzle( expr, null, null, elements );
+};
+
+Sizzle.matchesSelector = function( elem, expr ) {
+	// Set document vars if needed
+	if ( ( elem.ownerDocument || elem ) !== document ) {
+		setDocument( elem );
+	}
+
+	// Make sure that attribute selectors are quoted
+	expr = expr.replace( rattributeQuotes, "='$1']" );
+
+	if ( support.matchesSelector && documentIsHTML &&
+		( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
+		( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {
+
+		try {
+			var ret = matches.call( elem, expr );
+
+			// IE 9's matchesSelector returns false on disconnected nodes
+			if ( ret || support.disconnectedMatch ||
+					// As well, disconnected nodes are said to be in a document
+					// fragment in IE 9
+					elem.document && elem.document.nodeType !== 11 ) {
+				return ret;
+			}
+		} catch(e) {}
+	}
+
+	return Sizzle( expr, document, null, [ elem ] ).length > 0;
+};
+
+Sizzle.contains = function( context, elem ) {
+	// Set document vars if needed
+	if ( ( context.ownerDocument || context ) !== document ) {
+		setDocument( context );
+	}
+	return contains( context, elem );
+};
+
+Sizzle.attr = function( elem, name ) {
+	// Set document vars if needed
+	if ( ( elem.ownerDocument || elem ) !== document ) {
+		setDocument( elem );
+	}
+
+	var fn = Expr.attrHandle[ name.toLowerCase() ],
+		// Don't get fooled by Object.prototype properties (jQuery #13807)
+		val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
+			fn( elem, name, !documentIsHTML ) :
+			undefined;
+
+	return val !== undefined ?
+		val :
+		support.attributes || !documentIsHTML ?
+			elem.getAttribute( name ) :
+			(val = elem.getAttributeNode(name)) && val.specified ?
+				val.value :
+				null;
+};
+
+Sizzle.error = function( msg ) {
+	throw new Error( "Syntax error, unrecognized expression: " + msg );
+};
+
+/**
+ * Document sorting and removing duplicates
+ * @param {ArrayLike} results
+ */
+Sizzle.uniqueSort = function( results ) {
+	var elem,
+		duplicates = [],
+		j = 0,
+		i = 0;
+
+	// Unless we *know* we can detect duplicates, assume their presence
+	hasDuplicate = !support.detectDuplicates;
+	sortInput = !support.sortStable && results.slice( 0 );
+	results.sort( sortOrder );
+
+	if ( hasDuplicate ) {
+		while ( (elem = results[i++]) ) {
+			if ( elem === results[ i ] ) {
+				j = duplicates.push( i );
+			}
+		}
+		while ( j-- ) {
+			results.splice( duplicates[ j ], 1 );
+		}
+	}
+
+	// Clear input after sorting to release objects
+	// See https://github.com/jquery/sizzle/pull/225
+	sortInput = null;
+
+	return results;
+};
+
+/**
+ * Utility function for retrieving the text value of an array of DOM nodes
+ * @param {Array|Element} elem
+ */
+getText = Sizzle.getText = function( elem ) {
+	var node,
+		ret = "",
+		i = 0,
+		nodeType = elem.nodeType;
+
+	if ( !nodeType ) {
+		// If no nodeType, this is expected to be an array
+		while ( (node = elem[i++]) ) {
+			// Do not traverse comment nodes
+			ret += getText( node );
+		}
+	} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
+		// Use textContent for elements
+		// innerText usage removed for consistency of new lines (jQuery #11153)
+		if ( typeof elem.textContent === "string" ) {
+			return elem.textContent;
+		} else {
+			// Traverse its children
+			for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+				ret += getText( elem );
+			}
+		}
+	} else if ( nodeType === 3 || nodeType === 4 ) {
+		return elem.nodeValue;
+	}
+	// Do not include comment or processing instruction nodes
+
+	return ret;
+};
+
+Expr = Sizzle.selectors = {
+
+	// Can be adjusted by the user
+	cacheLength: 50,
+
+	createPseudo: markFunction,
+
+	match: matchExpr,
+
+	attrHandle: {},
+
+	find: {},
+
+	relative: {
+		">": { dir: "parentNode", first: true },
+		" ": { dir: "parentNode" },
+		"+": { dir: "previousSibling", first: true },
+		"~": { dir: "previousSibling" }
+	},
+
+	preFilter: {
+		"ATTR": function( match ) {
+			match[1] = match[1].replace( runescape, funescape );
+
+			// Move the given value to match[3] whether quoted or unquoted
+			match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
+
+			if ( match[2] === "~=" ) {
+				match[3] = " " + match[3] + " ";
+			}
+
+			return match.slice( 0, 4 );
+		},
+
+		"CHILD": function( match ) {
+			/* matches from matchExpr["CHILD"]
+				1 type (only|nth|...)
+				2 what (child|of-type)
+				3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
+				4 xn-component of xn+y argument ([+-]?\d*n|)
+				5 sign of xn-component
+				6 x of xn-component
+				7 sign of y-component
+				8 y of y-component
+			*/
+			match[1] = match[1].toLowerCase();
+
+			if ( match[1].slice( 0, 3 ) === "nth" ) {
+				// nth-* requires argument
+				if ( !match[3] ) {
+					Sizzle.error( match[0] );
+				}
+
+				// numeric x and y parameters for Expr.filter.CHILD
+				// remember that false/true cast respectively to 0/1
+				match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
+				match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
+
+			// other types prohibit arguments
+			} else if ( match[3] ) {
+				Sizzle.error( match[0] );
+			}
+
+			return match;
+		},
+
+		"PSEUDO": function( match ) {
+			var excess,
+				unquoted = !match[6] && match[2];
+
+			if ( matchExpr["CHILD"].test( match[0] ) ) {
+				return null;
+			}
+
+			// Accept quoted arguments as-is
+			if ( match[3] ) {
+				match[2] = match[4] || match[5] || "";
+
+			// Strip excess characters from unquoted arguments
+			} else if ( unquoted && rpseudo.test( unquoted ) &&
+				// Get excess from tokenize (recursively)
+				(excess = tokenize( unquoted, true )) &&
+				// advance to the next closing parenthesis
+				(excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
+
+				// excess is a negative index
+				match[0] = match[0].slice( 0, excess );
+				match[2] = unquoted.slice( 0, excess );
+			}
+
+			// Return only captures needed by the pseudo filter method (type and argument)
+			return match.slice( 0, 3 );
+		}
+	},
+
+	filter: {
+
+		"TAG": function( nodeNameSelector ) {
+			var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
+			return nodeNameSelector === "*" ?
+				function() { return true; } :
+				function( elem ) {
+					return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
+				};
+		},
+
+		"CLASS": function( className ) {
+			var pattern = classCache[ className + " " ];
+
+			return pattern ||
+				(pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
+				classCache( className, function( elem ) {
+					return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" );
+				});
+		},
+
+		"ATTR": function( name, operator, check ) {
+			return function( elem ) {
+				var result = Sizzle.attr( elem, name );
+
+				if ( result == null ) {
+					return operator === "!=";
+				}
+				if ( !operator ) {
+					return true;
+				}
+
+				result += "";
+
+				return operator === "=" ? result === check :
+					operator === "!=" ? result !== check :
+					operator === "^=" ? check && result.indexOf( check ) === 0 :
+					operator === "*=" ? check && result.indexOf( check ) > -1 :
+					operator === "$=" ? check && result.slice( -check.length ) === check :
+					operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
+					operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
+					false;
+			};
+		},
+
+		"CHILD": function( type, what, argument, first, last ) {
+			var simple = type.slice( 0, 3 ) !== "nth",
+				forward = type.slice( -4 ) !== "last",
+				ofType = what === "of-type";
+
+			return first === 1 && last === 0 ?
+
+				// Shortcut for :nth-*(n)
+				function( elem ) {
+					return !!elem.parentNode;
+				} :
+
+				function( elem, context, xml ) {
+					var cache, outerCache, node, diff, nodeIndex, start,
+						dir = simple !== forward ? "nextSibling" : "previousSibling",
+						parent = elem.parentNode,
+						name = ofType && elem.nodeName.toLowerCase(),
+						useCache = !xml && !ofType;
+
+					if ( parent ) {
+
+						// :(first|last|only)-(child|of-type)
+						if ( simple ) {
+							while ( dir ) {
+								node = elem;
+								while ( (node = node[ dir ]) ) {
+									if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
+										return false;
+									}
+								}
+								// Reverse direction for :only-* (if we haven't yet done so)
+								start = dir = type === "only" && !start && "nextSibling";
+							}
+							return true;
+						}
+
+						start = [ forward ? parent.firstChild : parent.lastChild ];
+
+						// non-xml :nth-child(...) stores cache data on `parent`
+						if ( forward && useCache ) {
+							// Seek `elem` from a previously-cached index
+							outerCache = parent[ expando ] || (parent[ expando ] = {});
+							cache = outerCache[ type ] || [];
+							nodeIndex = cache[0] === dirruns && cache[1];
+							diff = cache[0] === dirruns && cache[2];
+							node = nodeIndex && parent.childNodes[ nodeIndex ];
+
+							while ( (node = ++nodeIndex && node && node[ dir ] ||
+
+								// Fallback to seeking `elem` from the start
+								(diff = nodeIndex = 0) || start.pop()) ) {
+
+								// When found, cache indexes on `parent` and break
+								if ( node.nodeType === 1 && ++diff && node === elem ) {
+									outerCache[ type ] = [ dirruns, nodeIndex, diff ];
+									break;
+								}
+							}
+
+						// Use previously-cached element index if available
+						} else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
+							diff = cache[1];
+
+						// xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
+						} else {
+							// Use the same loop as above to seek `elem` from the start
+							while ( (node = ++nodeIndex && node && node[ dir ] ||
+								(diff = nodeIndex = 0) || start.pop()) ) {
+
+								if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
+									// Cache the index of each encountered element
+									if ( useCache ) {
+										(node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
+									}
+
+									if ( node === elem ) {
+										break;
+									}
+								}
+							}
+						}
+
+						// Incorporate the offset, then check against cycle size
+						diff -= last;
+						return diff === first || ( diff % first === 0 && diff / first >= 0 );
+					}
+				};
+		},
+
+		"PSEUDO": function( pseudo, argument ) {
+			// pseudo-class names are case-insensitive
+			// http://www.w3.org/TR/selectors/#pseudo-classes
+			// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
+			// Remember that setFilters inherits from pseudos
+			var args,
+				fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
+					Sizzle.error( "unsupported pseudo: " + pseudo );
+
+			// The user may use createPseudo to indicate that
+			// arguments are needed to create the filter function
+			// just as Sizzle does
+			if ( fn[ expando ] ) {
+				return fn( argument );
+			}
+
+			// But maintain support for old signatures
+			if ( fn.length > 1 ) {
+				args = [ pseudo, pseudo, "", argument ];
+				return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
+					markFunction(function( seed, matches ) {
+						var idx,
+							matched = fn( seed, argument ),
+							i = matched.length;
+						while ( i-- ) {
+							idx = indexOf.call( seed, matched[i] );
+							seed[ idx ] = !( matches[ idx ] = matched[i] );
+						}
+					}) :
+					function( elem ) {
+						return fn( elem, 0, args );
+					};
+			}
+
+			return fn;
+		}
+	},
+
+	pseudos: {
+		// Potentially complex pseudos
+		"not": markFunction(function( selector ) {
+			// Trim the selector passed to compile
+			// to avoid treating leading and trailing
+			// spaces as combinators
+			var input = [],
+				results = [],
+				matcher = compile( selector.replace( rtrim, "$1" ) );
+
+			return matcher[ expando ] ?
+				markFunction(function( seed, matches, context, xml ) {
+					var elem,
+						unmatched = matcher( seed, null, xml, [] ),
+						i = seed.length;
+
+					// Match elements unmatched by `matcher`
+					while ( i-- ) {
+						if ( (elem = unmatched[i]) ) {
+							seed[i] = !(matches[i] = elem);
+						}
+					}
+				}) :
+				function( elem, context, xml ) {
+					input[0] = elem;
+					matcher( input, null, xml, results );
+					return !results.pop();
+				};
+		}),
+
+		"has": markFunction(function( selector ) {
+			return function( elem ) {
+				return Sizzle( selector, elem ).length > 0;
+			};
+		}),
+
+		"contains": markFunction(function( text ) {
+			text = text.replace( runescape, funescape );
+			return function( elem ) {
+				return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
+			};
+		}),
+
+		// "Whether an element is represented by a :lang() selector
+		// is based solely on the element's language value
+		// being equal to the identifier C,
+		// or beginning with the identifier C immediately followed by "-".
+		// The matching of C against the element's language value is performed case-insensitively.
+		// The identifier C does not have to be a valid language name."
+		// http://www.w3.org/TR/selectors/#lang-pseudo
+		"lang": markFunction( function( lang ) {
+			// lang value must be a valid identifier
+			if ( !ridentifier.test(lang || "") ) {
+				Sizzle.error( "unsupported lang: " + lang );
+			}
+			lang = lang.replace( runescape, funescape ).toLowerCase();
+			return function( elem ) {
+				var elemLang;
+				do {
+					if ( (elemLang = documentIsHTML ?
+						elem.lang :
+						elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
+
+						elemLang = elemLang.toLowerCase();
+						return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
+					}
+				} while ( (elem = elem.parentNode) && elem.nodeType === 1 );
+				return false;
+			};
+		}),
+
+		// Miscellaneous
+		"target": function( elem ) {
+			var hash = window.location && window.location.hash;
+			return hash && hash.slice( 1 ) === elem.id;
+		},
+
+		"root": function( elem ) {
+			return elem === docElem;
+		},
+
+		"focus": function( elem ) {
+			return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
+		},
+
+		// Boolean properties
+		"enabled": function( elem ) {
+			return elem.disabled === false;
+		},
+
+		"disabled": function( elem ) {
+			return elem.disabled === true;
+		},
+
+		"checked": function( elem ) {
+			// In CSS3, :checked should return both checked and selected elements
+			// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+			var nodeName = elem.nodeName.toLowerCase();
+			return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
+		},
+
+		"selected": function( elem ) {
+			// Accessing this property makes selected-by-default
+			// options in Safari work properly
+			if ( elem.parentNode ) {
+				elem.parentNode.selectedIndex;
+			}
+
+			return elem.selected === true;
+		},
+
+		// Contents
+		"empty": function( elem ) {
+			// http://www.w3.org/TR/selectors/#empty-pseudo
+			// :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
+			//   but not by others (comment: 8; processing instruction: 7; etc.)
+			// nodeType < 6 works because attributes (2) do not appear as children
+			for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+				if ( elem.nodeType < 6 ) {
+					return false;
+				}
+			}
+			return true;
+		},
+
+		"parent": function( elem ) {
+			return !Expr.pseudos["empty"]( elem );
+		},
+
+		// Element/input types
+		"header": function( elem ) {
+			return rheader.test( elem.nodeName );
+		},
+
+		"input": function( elem ) {
+			return rinputs.test( elem.nodeName );
+		},
+
+		"button": function( elem ) {
+			var name = elem.nodeName.toLowerCase();
+			return name === "input" && elem.type === "button" || name === "button";
+		},
+
+		"text": function( elem ) {
+			var attr;
+			return elem.nodeName.toLowerCase() === "input" &&
+				elem.type === "text" &&
+
+				// Support: IE<8
+				// New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
+				( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
+		},
+
+		// Position-in-collection
+		"first": createPositionalPseudo(function() {
+			return [ 0 ];
+		}),
+
+		"last": createPositionalPseudo(function( matchIndexes, length ) {
+			return [ length - 1 ];
+		}),
+
+		"eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
+			return [ argument < 0 ? argument + length : argument ];
+		}),
+
+		"even": createPositionalPseudo(function( matchIndexes, length ) {
+			var i = 0;
+			for ( ; i < length; i += 2 ) {
+				matchIndexes.push( i );
+			}
+			return matchIndexes;
+		}),
+
+		"odd": createPositionalPseudo(function( matchIndexes, length ) {
+			var i = 1;
+			for ( ; i < length; i += 2 ) {
+				matchIndexes.push( i );
+			}
+			return matchIndexes;
+		}),
+
+		"lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+			var i = argument < 0 ? argument + length : argument;
+			for ( ; --i >= 0; ) {
+				matchIndexes.push( i );
+			}
+			return matchIndexes;
+		}),
+
+		"gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+			var i = argument < 0 ? argument + length : argument;
+			for ( ; ++i < length; ) {
+				matchIndexes.push( i );
+			}
+			return matchIndexes;
+		})
+	}
+};
+
+Expr.pseudos["nth"] = Expr.pseudos["eq"];
+
+// Add button/input type pseudos
+for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
+	Expr.pseudos[ i ] = createInputPseudo( i );
+}
+for ( i in { submit: true, reset: true } ) {
+	Expr.pseudos[ i ] = createButtonPseudo( i );
+}
+
+// Easy API for creating new setFilters
+function setFilters() {}
+setFilters.prototype = Expr.filters = Expr.pseudos;
+Expr.setFilters = new setFilters();
+
+tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
+	var matched, match, tokens, type,
+		soFar, groups, preFilters,
+		cached = tokenCache[ selector + " " ];
+
+	if ( cached ) {
+		return parseOnly ? 0 : cached.slice( 0 );
+	}
+
+	soFar = selector;
+	groups = [];
+	preFilters = Expr.preFilter;
+
+	while ( soFar ) {
+
+		// Comma and first run
+		if ( !matched || (match = rcomma.exec( soFar )) ) {
+			if ( match ) {
+				// Don't consume trailing commas as valid
+				soFar = soFar.slice( match[0].length ) || soFar;
+			}
+			groups.push( (tokens = []) );
+		}
+
+		matched = false;
+
+		// Combinators
+		if ( (match = rcombinators.exec( soFar )) ) {
+			matched = match.shift();
+			tokens.push({
+				value: matched,
+				// Cast descendant combinators to space
+				type: match[0].replace( rtrim, " " )
+			});
+			soFar = soFar.slice( matched.length );
+		}
+
+		// Filters
+		for ( type in Expr.filter ) {
+			if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
+				(match = preFilters[ type ]( match ))) ) {
+				matched = match.shift();
+				tokens.push({
+					value: matched,
+					type: type,
+					matches: match
+				});
+				soFar = soFar.slice( matched.length );
+			}
+		}
+
+		if ( !matched ) {
+			break;
+		}
+	}
+
+	// Return the length of the invalid excess
+	// if we're just parsing
+	// Otherwise, throw an error or return tokens
+	return parseOnly ?
+		soFar.length :
+		soFar ?
+			Sizzle.error( selector ) :
+			// Cache the tokens
+			tokenCache( selector, groups ).slice( 0 );
+};
+
+function toSelector( tokens ) {
+	var i = 0,
+		len = tokens.length,
+		selector = "";
+	for ( ; i < len; i++ ) {
+		selector += tokens[i].value;
+	}
+	return selector;
+}
+
+function addCombinator( matcher, combinator, base ) {
+	var dir = combinator.dir,
+		checkNonElements = base && dir === "parentNode",
+		doneName = done++;
+
+	return combinator.first ?
+		// Check against closest ancestor/preceding element
+		function( elem, context, xml ) {
+			while ( (elem = elem[ dir ]) ) {
+				if ( elem.nodeType === 1 || checkNonElements ) {
+					return matcher( elem, context, xml );
+				}
+			}
+		} :
+
+		// Check against all ancestor/preceding elements
+		function( elem, context, xml ) {
+			var oldCache, outerCache,
+				newCache = [ dirruns, doneName ];
+
+			// We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
+			if ( xml ) {
+				while ( (elem = elem[ dir ]) ) {
+					if ( elem.nodeType === 1 || checkNonElements ) {
+						if ( matcher( elem, context, xml ) ) {
+							return true;
+						}
+					}
+				}
+			} else {
+				while ( (elem = elem[ dir ]) ) {
+					if ( elem.nodeType === 1 || checkNonElements ) {
+						outerCache = elem[ expando ] || (elem[ expando ] = {});
+						if ( (oldCache = outerCache[ dir ]) &&
+							oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
+
+							// Assign to newCache so results back-propagate to previous elements
+							return (newCache[ 2 ] = oldCache[ 2 ]);
+						} else {
+							// Reuse newcache so results back-propagate to previous elements
+							outerCache[ dir ] = newCache;
+
+							// A match means we're done; a fail means we have to keep checking
+							if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
+								return true;
+							}
+						}
+					}
+				}
+			}
+		};
+}
+
+function elementMatcher( matchers ) {
+	return matchers.length > 1 ?
+		function( elem, context, xml ) {
+			var i = matchers.length;
+			while ( i-- ) {
+				if ( !matchers[i]( elem, context, xml ) ) {
+					return false;
+				}
+			}
+			return true;
+		} :
+		matchers[0];
+}
+
+function multipleContexts( selector, contexts, results ) {
+	var i = 0,
+		len = contexts.length;
+	for ( ; i < len; i++ ) {
+		Sizzle( selector, contexts[i], results );
+	}
+	return results;
+}
+
+function condense( unmatched, map, filter, context, xml ) {
+	var elem,
+		newUnmatched = [],
+		i = 0,
+		len = unmatched.length,
+		mapped = map != null;
+
+	for ( ; i < len; i++ ) {
+		if ( (elem = unmatched[i]) ) {
+			if ( !filter || filter( elem, context, xml ) ) {
+				newUnmatched.push( elem );
+				if ( mapped ) {
+					map.push( i );
+				}
+			}
+		}
+	}
+
+	return newUnmatched;
+}
+
+function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
+	if ( postFilter && !postFilter[ expando ] ) {
+		postFilter = setMatcher( postFilter );
+	}
+	if ( postFinder && !postFinder[ expando ] ) {
+		postFinder = setMatcher( postFinder, postSelector );
+	}
+	return markFunction(function( seed, results, context, xml ) {
+		var temp, i, elem,
+			preMap = [],
+			postMap = [],
+			preexisting = results.length,
+
+			// Get initial elements from seed or context
+			elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
+
+			// Prefilter to get matcher input, preserving a map for seed-results synchronization
+			matcherIn = preFilter && ( seed || !selector ) ?
+				condense( elems, preMap, preFilter, context, xml ) :
+				elems,
+
+			matcherOut = matcher ?
+				// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
+				postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
+
+					// ...intermediate processing is necessary
+					[] :
+
+					// ...otherwise use results directly
+					results :
+				matcherIn;
+
+		// Find primary matches
+		if ( matcher ) {
+			matcher( matcherIn, matcherOut, context, xml );
+		}
+
+		// Apply postFilter
+		if ( postFilter ) {
+			temp = condense( matcherOut, postMap );
+			postFilter( temp, [], context, xml );
+
+			// Un-match failing elements by moving them back to matcherIn
+			i = temp.length;
+			while ( i-- ) {
+				if ( (elem = temp[i]) ) {
+					matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
+				}
+			}
+		}
+
+		if ( seed ) {
+			if ( postFinder || preFilter ) {
+				if ( postFinder ) {
+					// Get the final matcherOut by condensing this intermediate into postFinder contexts
+					temp = [];
+					i = matcherOut.length;
+					while ( i-- ) {
+						if ( (elem = matcherOut[i]) ) {
+							// Restore matcherIn since elem is not yet a final match
+							temp.push( (matcherIn[i] = elem) );
+						}
+					}
+					postFinder( null, (matcherOut = []), temp, xml );
+				}
+
+				// Move matched elements from seed to results to keep them synchronized
+				i = matcherOut.length;
+				while ( i-- ) {
+					if ( (elem = matcherOut[i]) &&
+						(temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
+
+						seed[temp] = !(results[temp] = elem);
+					}
+				}
+			}
+
+		// Add elements to results, through postFinder if defined
+		} else {
+			matcherOut = condense(
+				matcherOut === results ?
+					matcherOut.splice( preexisting, matcherOut.length ) :
+					matcherOut
+			);
+			if ( postFinder ) {
+				postFinder( null, results, matcherOut, xml );
+			} else {
+				push.apply( results, matcherOut );
+			}
+		}
+	});
+}
+
+function matcherFromTokens( tokens ) {
+	var checkContext, matcher, j,
+		len = tokens.length,
+		leadingRelative = Expr.relative[ tokens[0].type ],
+		implicitRelative = leadingRelative || Expr.relative[" "],
+		i = leadingRelative ? 1 : 0,
+
+		// The foundational matcher ensures that elements are reachable from top-level context(s)
+		matchContext = addCombinator( function( elem ) {
+			return elem === checkContext;
+		}, implicitRelative, true ),
+		matchAnyContext = addCombinator( function( elem ) {
+			return indexOf.call( checkContext, elem ) > -1;
+		}, implicitRelative, true ),
+		matchers = [ function( elem, context, xml ) {
+			return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
+				(checkContext = context).nodeType ?
+					matchContext( elem, context, xml ) :
+					matchAnyContext( elem, context, xml ) );
+		} ];
+
+	for ( ; i < len; i++ ) {
+		if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
+			matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
+		} else {
+			matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
+
+			// Return special upon seeing a positional matcher
+			if ( matcher[ expando ] ) {
+				// Find the next relative operator (if any) for proper handling
+				j = ++i;
+				for ( ; j < len; j++ ) {
+					if ( Expr.relative[ tokens[j].type ] ) {
+						break;
+					}
+				}
+				return setMatcher(
+					i > 1 && elementMatcher( matchers ),
+					i > 1 && toSelector(
+						// If the preceding token was a descendant combinator, insert an implicit any-element `*`
+						tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
+					).replace( rtrim, "$1" ),
+					matcher,
+					i < j && matcherFromTokens( tokens.slice( i, j ) ),
+					j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
+					j < len && toSelector( tokens )
+				);
+			}
+			matchers.push( matcher );
+		}
+	}
+
+	return elementMatcher( matchers );
+}
+
+function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
+	var bySet = setMatchers.length > 0,
+		byElement = elementMatchers.length > 0,
+		superMatcher = function( seed, context, xml, results, outermost ) {
+			var elem, j, matcher,
+				matchedCount = 0,
+				i = "0",
+				unmatched = seed && [],
+				setMatched = [],
+				contextBackup = outermostContext,
+				// We must always have either seed elements or outermost context
+				elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
+				// Use integer dirruns iff this is the outermost matcher
+				dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
+				len = elems.length;
+
+			if ( outermost ) {
+				outermostContext = context !== document && context;
+			}
+
+			// Add elements passing elementMatchers directly to results
+			// Keep `i` a string if there are no elements so `matchedCount` will be "00" below
+			// Support: IE<9, Safari
+			// Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
+			for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
+				if ( byElement && elem ) {
+					j = 0;
+					while ( (matcher = elementMatchers[j++]) ) {
+						if ( matcher( elem, context, xml ) ) {
+							results.push( elem );
+							break;
+						}
+					}
+					if ( outermost ) {
+						dirruns = dirrunsUnique;
+					}
+				}
+
+				// Track unmatched elements for set filters
+				if ( bySet ) {
+					// They will have gone through all possible matchers
+					if ( (elem = !matcher && elem) ) {
+						matchedCount--;
+					}
+
+					// Lengthen the array for every element, matched or not
+					if ( seed ) {
+						unmatched.push( elem );
+					}
+				}
+			}
+
+			// Apply set filters to unmatched elements
+			matchedCount += i;
+			if ( bySet && i !== matchedCount ) {
+				j = 0;
+				while ( (matcher = setMatchers[j++]) ) {
+					matcher( unmatched, setMatched, context, xml );
+				}
+
+				if ( seed ) {
+					// Reintegrate element matches to eliminate the need for sorting
+					if ( matchedCount > 0 ) {
+						while ( i-- ) {
+							if ( !(unmatched[i] || setMatched[i]) ) {
+								setMatched[i] = pop.call( results );
+							}
+						}
+					}
+
+					// Discard index placeholder values to get only actual matches
+					setMatched = condense( setMatched );
+				}
+
+				// Add matches to results
+				push.apply( results, setMatched );
+
+				// Seedless set matches succeeding multiple successful matchers stipulate sorting
+				if ( outermost && !seed && setMatched.length > 0 &&
+					( matchedCount + setMatchers.length ) > 1 ) {
+
+					Sizzle.uniqueSort( results );
+				}
+			}
+
+			// Override manipulation of globals by nested matchers
+			if ( outermost ) {
+				dirruns = dirrunsUnique;
+				outermostContext = contextBackup;
+			}
+
+			return unmatched;
+		};
+
+	return bySet ?
+		markFunction( superMatcher ) :
+		superMatcher;
+}
+
+compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
+	var i,
+		setMatchers = [],
+		elementMatchers = [],
+		cached = compilerCache[ selector + " " ];
+
+	if ( !cached ) {
+		// Generate a function of recursive functions that can be used to check each element
+		if ( !match ) {
+			match = tokenize( selector );
+		}
+		i = match.length;
+		while ( i-- ) {
+			cached = matcherFromTokens( match[i] );
+			if ( cached[ expando ] ) {
+				setMatchers.push( cached );
+			} else {
+				elementMatchers.push( cached );
+			}
+		}
+
+		// Cache the compiled function
+		cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
+
+		// Save selector and tokenization
+		cached.selector = selector;
+	}
+	return cached;
+};
+
+/**
+ * A low-level selection function that works with Sizzle's compiled
+ *  selector functions
+ * @param {String|Function} selector A selector or a pre-compiled
+ *  selector function built with Sizzle.compile
+ * @param {Element} context
+ * @param {Array} [results]
+ * @param {Array} [seed] A set of elements to match against
+ */
+select = Sizzle.select = function( selector, context, results, seed ) {
+	var i, tokens, token, type, find,
+		compiled = typeof selector === "function" && selector,
+		match = !seed && tokenize( (selector = compiled.selector || selector) );
+
+	results = results || [];
+
+	// Try to minimize operations if there is no seed and only one group
+	if ( match.length === 1 ) {
+
+		// Take a shortcut and set the context if the root selector is an ID
+		tokens = match[0] = match[0].slice( 0 );
+		if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
+				support.getById && context.nodeType === 9 && documentIsHTML &&
+				Expr.relative[ tokens[1].type ] ) {
+
+			context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
+			if ( !context ) {
+				return results;
+
+			// Precompiled matchers will still verify ancestry, so step up a level
+			} else if ( compiled ) {
+				context = context.parentNode;
+			}
+
+			selector = selector.slice( tokens.shift().value.length );
+		}
+
+		// Fetch a seed set for right-to-left matching
+		i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
+		while ( i-- ) {
+			token = tokens[i];
+
+			// Abort if we hit a combinator
+			if ( Expr.relative[ (type = token.type) ] ) {
+				break;
+			}
+			if ( (find = Expr.find[ type ]) ) {
+				// Search, expanding context for leading sibling combinators
+				if ( (seed = find(
+					token.matches[0].replace( runescape, funescape ),
+					rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
+				)) ) {
+
+					// If seed is empty or no tokens remain, we can return early
+					tokens.splice( i, 1 );
+					selector = seed.length && toSelector( tokens );
+					if ( !selector ) {
+						push.apply( results, seed );
+						return results;
+					}
+
+					break;
+				}
+			}
+		}
+	}
+
+	// Compile and execute a filtering function if one is not provided
+	// Provide `match` to avoid retokenization if we modified the selector above
+	( compiled || compile( selector, match ) )(
+		seed,
+		context,
+		!documentIsHTML,
+		results,
+		rsibling.test( selector ) && testContext( context.parentNode ) || context
+	);
+	return results;
+};
+
+// One-time assignments
+
+// Sort stability
+support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
+
+// Support: Chrome 14-35+
+// Always assume duplicates if they aren't passed to the comparison function
+support.detectDuplicates = !!hasDuplicate;
+
+// Initialize against the default document
+setDocument();
+
+// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
+// Detached nodes confoundingly follow *each other*
+support.sortDetached = assert(function( div1 ) {
+	// Should return 1, but returns 4 (following)
+	return div1.compareDocumentPosition( document.createElement("div") ) & 1;
+});
+
+// Support: IE<8
+// Prevent attribute/property "interpolation"
+// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
+if ( !assert(function( div ) {
+	div.innerHTML = "<a href='#'></a>";
+	return div.firstChild.getAttribute("href") === "#" ;
+}) ) {
+	addHandle( "type|href|height|width", function( elem, name, isXML ) {
+		if ( !isXML ) {
+			return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
+		}
+	});
+}
+
+// Support: IE<9
+// Use defaultValue in place of getAttribute("value")
+if ( !support.attributes || !assert(function( div ) {
+	div.innerHTML = "<input/>";
+	div.firstChild.setAttribute( "value", "" );
+	return div.firstChild.getAttribute( "value" ) === "";
+}) ) {
+	addHandle( "value", function( elem, name, isXML ) {
+		if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
+			return elem.defaultValue;
+		}
+	});
+}
+
+// Support: IE<9
+// Use getAttributeNode to fetch booleans when getAttribute lies
+if ( !assert(function( div ) {
+	return div.getAttribute("disabled") == null;
+}) ) {
+	addHandle( booleans, function( elem, name, isXML ) {
+		var val;
+		if ( !isXML ) {
+			return elem[ name ] === true ? name.toLowerCase() :
+					(val = elem.getAttributeNode( name )) && val.specified ?
+					val.value :
+				null;
+		}
+	});
+}
+
+// EXPOSE
+return Sizzle;
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/StyleSheetLoader.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,189 @@
+/**
+ * StyleSheetLoader.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles loading of external stylesheets and fires events when these are loaded.
+ *
+ * @class tinymce.dom.StyleSheetLoader
+ * @private
+ */
+define("tinymce/dom/StyleSheetLoader", [
+	"tinymce/util/Tools"
+], function(Tools) {
+	"use strict";
+
+	return function(document, settings) {
+		var idCount = 0, loadedStates = {}, maxLoadTime;
+
+		settings = settings || {};
+		maxLoadTime = settings.maxLoadTime || 5000;
+
+		function appendToHead(node) {
+			document.getElementsByTagName('head')[0].appendChild(node);
+		}
+
+		/**
+		 * Loads the specified css style sheet file and call the loadedCallback once it's finished loading.
+		 *
+		 * @method load
+		 * @param {String} url Url to be loaded.
+		 * @param {Function} loadedCallback Callback to be executed when loaded.
+		 * @param {Function} errorCallback Callback to be executed when failed loading.
+		 */
+		function load(url, loadedCallback, errorCallback) {
+			var link, style, startTime, state;
+
+			function passed() {
+				var callbacks = state.passed, i = callbacks.length;
+
+				while (i--) {
+					callbacks[i]();
+				}
+
+				state.status = 2;
+				state.passed = [];
+				state.failed = [];
+			}
+
+			function failed() {
+				var callbacks = state.failed, i = callbacks.length;
+
+				while (i--) {
+					callbacks[i]();
+				}
+
+				state.status = 3;
+				state.passed = [];
+				state.failed = [];
+			}
+
+			// Sniffs for older WebKit versions that have the link.onload but a broken one
+			function isOldWebKit() {
+				var webKitChunks = navigator.userAgent.match(/WebKit\/(\d*)/);
+				return !!(webKitChunks && webKitChunks[1] < 536);
+			}
+
+			// Calls the waitCallback until the test returns true or the timeout occurs
+			function wait(testCallback, waitCallback) {
+				if (!testCallback()) {
+					// Wait for timeout
+					if ((new Date().getTime()) - startTime < maxLoadTime) {
+						window.setTimeout(waitCallback, 0);
+					} else {
+						failed();
+					}
+				}
+			}
+
+			// Workaround for WebKit that doesn't properly support the onload event for link elements
+			// Or WebKit that fires the onload event before the StyleSheet is added to the document
+			function waitForWebKitLinkLoaded() {
+				wait(function() {
+					var styleSheets = document.styleSheets, styleSheet, i = styleSheets.length, owner;
+
+					while (i--) {
+						styleSheet = styleSheets[i];
+						owner = styleSheet.ownerNode ? styleSheet.ownerNode : styleSheet.owningElement;
+						if (owner && owner.id === link.id) {
+							passed();
+							return true;
+						}
+					}
+				}, waitForWebKitLinkLoaded);
+			}
+
+			// Workaround for older Geckos that doesn't have any onload event for StyleSheets
+			function waitForGeckoLinkLoaded() {
+				wait(function() {
+					try {
+						// Accessing the cssRules will throw an exception until the CSS file is loaded
+						var cssRules = style.sheet.cssRules;
+						passed();
+						return !!cssRules;
+					} catch (ex) {
+						// Ignore
+					}
+				}, waitForGeckoLinkLoaded);
+			}
+
+			url = Tools._addCacheSuffix(url);
+
+			if (!loadedStates[url]) {
+				state = {
+					passed: [],
+					failed: []
+				};
+
+				loadedStates[url] = state;
+			} else {
+				state = loadedStates[url];
+			}
+
+			if (loadedCallback) {
+				state.passed.push(loadedCallback);
+			}
+
+			if (errorCallback) {
+				state.failed.push(errorCallback);
+			}
+
+			// Is loading wait for it to pass
+			if (state.status == 1) {
+				return;
+			}
+
+			// Has finished loading and was success
+			if (state.status == 2) {
+				passed();
+				return;
+			}
+
+			// Has finished loading and was a failure
+			if (state.status == 3) {
+				failed();
+				return;
+			}
+
+			// Start loading
+			state.status = 1;
+			link = document.createElement('link');
+			link.rel = 'stylesheet';
+			link.type = 'text/css';
+			link.id = 'u' + (idCount++);
+			link.async = false;
+			link.defer = false;
+			startTime = new Date().getTime();
+
+			// Feature detect onload on link element and sniff older webkits since it has an broken onload event
+			if ("onload" in link && !isOldWebKit()) {
+				link.onload = waitForWebKitLinkLoaded;
+				link.onerror = failed;
+			} else {
+				// Sniff for old Firefox that doesn't support the onload event on link elements
+				// TODO: Remove this in the future when everyone uses modern browsers
+				if (navigator.userAgent.indexOf("Firefox") > 0) {
+					style = document.createElement('style');
+					style.textContent = '@import "' + url + '"';
+					waitForGeckoLinkLoaded();
+					appendToHead(style);
+					return;
+				} else {
+					// Use the id owner on older webkits
+					waitForWebKitLinkLoaded();
+				}
+			}
+
+			appendToHead(link);
+			link.href = url;
+		}
+
+		this.load = load;
+	};
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/TreeWalker.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,93 @@
+/**
+ * TreeWalker.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * TreeWalker class enables you to walk the DOM in a linear manner.
+ *
+ * @class tinymce.dom.TreeWalker
+ * @example
+ * var walker = new tinymce.dom.TreeWalker(startNode);
+ *
+ * do {
+ *     console.log(walker.current());
+ * } while (walker.next());
+ */
+define("tinymce/dom/TreeWalker", [], function() {
+	/**
+	 * Constructs a new TreeWalker instance.
+	 *
+	 * @constructor
+	 * @method TreeWalker
+	 * @param {Node} startNode Node to start walking from.
+	 * @param {node} rootNode Optional root node to never walk out of.
+	 */
+	return function(startNode, rootNode) {
+		var node = startNode;
+
+		function findSibling(node, startName, siblingName, shallow) {
+			var sibling, parent;
+
+			if (node) {
+				// Walk into nodes if it has a start
+				if (!shallow && node[startName]) {
+					return node[startName];
+				}
+
+				// Return the sibling if it has one
+				if (node != rootNode) {
+					sibling = node[siblingName];
+					if (sibling) {
+						return sibling;
+					}
+
+					// Walk up the parents to look for siblings
+					for (parent = node.parentNode; parent && parent != rootNode; parent = parent.parentNode) {
+						sibling = parent[siblingName];
+						if (sibling) {
+							return sibling;
+						}
+					}
+				}
+			}
+		}
+
+		/**
+		 * Returns the current node.
+		 *
+		 * @method current
+		 * @return {Node} Current node where the walker is.
+		 */
+		this.current = function() {
+			return node;
+		};
+
+		/**
+		 * Walks to the next node in tree.
+		 *
+		 * @method next
+		 * @return {Node} Current node where the walker is after moving to the next node.
+		 */
+		this.next = function(shallow) {
+			node = findSibling(node, 'firstChild', 'nextSibling', shallow);
+			return node;
+		};
+
+		/**
+		 * Walks to the previous node in tree.
+		 *
+		 * @method prev
+		 * @return {Node} Current node where the walker is after moving to the previous node.
+		 */
+		this.prev = function(shallow) {
+			node = findSibling(node, 'lastChild', 'previousSibling', shallow);
+			return node;
+		};
+	};
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/dom/TridentSelection.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,506 @@
+/**
+ * TridentSelection.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Selection class for old explorer versions. This one fakes the
+ * native selection object available on modern browsers.
+ *
+ * @class tinymce.dom.TridentSelection
+ */
+define("tinymce/dom/TridentSelection", [], function() {
+	function Selection(selection) {
+		var self = this, dom = selection.dom, FALSE = false;
+
+		function getPosition(rng, start) {
+			var checkRng, startIndex = 0, endIndex, inside,
+				children, child, offset, index, position = -1, parent;
+
+			// Setup test range, collapse it and get the parent
+			checkRng = rng.duplicate();
+			checkRng.collapse(start);
+			parent = checkRng.parentElement();
+
+			// Check if the selection is within the right document
+			if (parent.ownerDocument !== selection.dom.doc) {
+				return;
+			}
+
+			// IE will report non editable elements as it's parent so look for an editable one
+			while (parent.contentEditable === "false") {
+				parent = parent.parentNode;
+			}
+
+			// If parent doesn't have any children then return that we are inside the element
+			if (!parent.hasChildNodes()) {
+				return {node: parent, inside: 1};
+			}
+
+			// Setup node list and endIndex
+			children = parent.children;
+			endIndex = children.length - 1;
+
+			// Perform a binary search for the position
+			while (startIndex <= endIndex) {
+				index = Math.floor((startIndex + endIndex) / 2);
+
+				// Move selection to node and compare the ranges
+				child = children[index];
+				checkRng.moveToElementText(child);
+				position = checkRng.compareEndPoints(start ? 'StartToStart' : 'EndToEnd', rng);
+
+				// Before/after or an exact match
+				if (position > 0) {
+					endIndex = index - 1;
+				} else if (position < 0) {
+					startIndex = index + 1;
+				} else {
+					return {node: child};
+				}
+			}
+
+			// Check if child position is before or we didn't find a position
+			if (position < 0) {
+				// No element child was found use the parent element and the offset inside that
+				if (!child) {
+					checkRng.moveToElementText(parent);
+					checkRng.collapse(true);
+					child = parent;
+					inside = true;
+				} else {
+					checkRng.collapse(false);
+				}
+
+				// Walk character by character in text node until we hit the selected range endpoint,
+				// hit the end of document or parent isn't the right one
+				// We need to walk char by char since rng.text or rng.htmlText will trim line endings
+				offset = 0;
+				while (checkRng.compareEndPoints(start ? 'StartToStart' : 'StartToEnd', rng) !== 0) {
+					if (checkRng.move('character', 1) === 0 || parent != checkRng.parentElement()) {
+						break;
+					}
+
+					offset++;
+				}
+			} else {
+				// Child position is after the selection endpoint
+				checkRng.collapse(true);
+
+				// Walk character by character in text node until we hit the selected range endpoint, hit
+				// the end of document or parent isn't the right one
+				offset = 0;
+				while (checkRng.compareEndPoints(start ? 'StartToStart' : 'StartToEnd', rng) !== 0) {
+					if (checkRng.move('character', -1) === 0 || parent != checkRng.parentElement()) {
+						break;
+					}
+
+					offset++;
+				}
+			}
+
+			return {node: child, position: position, offset: offset, inside: inside};
+		}
+
+		// Returns a W3C DOM compatible range object by using the IE Range API
+		function getRange() {
+			var ieRange = selection.getRng(), domRange = dom.createRng(), element, collapsed, tmpRange, element2, bookmark;
+
+			// If selection is outside the current document just return an empty range
+			element = ieRange.item ? ieRange.item(0) : ieRange.parentElement();
+			if (element.ownerDocument != dom.doc) {
+				return domRange;
+			}
+
+			collapsed = selection.isCollapsed();
+
+			// Handle control selection
+			if (ieRange.item) {
+				domRange.setStart(element.parentNode, dom.nodeIndex(element));
+				domRange.setEnd(domRange.startContainer, domRange.startOffset + 1);
+
+				return domRange;
+			}
+
+			function findEndPoint(start) {
+				var endPoint = getPosition(ieRange, start), container, offset, textNodeOffset = 0, sibling, undef, nodeValue;
+
+				container = endPoint.node;
+				offset = endPoint.offset;
+
+				if (endPoint.inside && !container.hasChildNodes()) {
+					domRange[start ? 'setStart' : 'setEnd'](container, 0);
+					return;
+				}
+
+				if (offset === undef) {
+					domRange[start ? 'setStartBefore' : 'setEndAfter'](container);
+					return;
+				}
+
+				if (endPoint.position < 0) {
+					sibling = endPoint.inside ? container.firstChild : container.nextSibling;
+
+					if (!sibling) {
+						domRange[start ? 'setStartAfter' : 'setEndAfter'](container);
+						return;
+					}
+
+					if (!offset) {
+						if (sibling.nodeType == 3) {
+							domRange[start ? 'setStart' : 'setEnd'](sibling, 0);
+						} else {
+							domRange[start ? 'setStartBefore' : 'setEndBefore'](sibling);
+						}
+
+						return;
+					}
+
+					// Find the text node and offset
+					while (sibling) {
+						if (sibling.nodeType == 3) {
+							nodeValue = sibling.nodeValue;
+							textNodeOffset += nodeValue.length;
+
+							// We are at or passed the position we where looking for
+							if (textNodeOffset >= offset) {
+								container = sibling;
+								textNodeOffset -= offset;
+								textNodeOffset = nodeValue.length - textNodeOffset;
+								break;
+							}
+						}
+
+						sibling = sibling.nextSibling;
+					}
+				} else {
+					// Find the text node and offset
+					sibling = container.previousSibling;
+
+					if (!sibling) {
+						return domRange[start ? 'setStartBefore' : 'setEndBefore'](container);
+					}
+
+					// If there isn't any text to loop then use the first position
+					if (!offset) {
+						if (container.nodeType == 3) {
+							domRange[start ? 'setStart' : 'setEnd'](sibling, container.nodeValue.length);
+						} else {
+							domRange[start ? 'setStartAfter' : 'setEndAfter'](sibling);
+						}
+
+						return;
+					}
+
+					while (sibling) {
+						if (sibling.nodeType == 3) {
+							textNodeOffset += sibling.nodeValue.length;
+
+							// We are at or passed the position we where looking for
+							if (textNodeOffset >= offset) {
+								container = sibling;
+								textNodeOffset -= offset;
+								break;
+							}
+						}
+
+						sibling = sibling.previousSibling;
+					}
+				}
+
+				domRange[start ? 'setStart' : 'setEnd'](container, textNodeOffset);
+			}
+
+			try {
+				// Find start point
+				findEndPoint(true);
+
+				// Find end point if needed
+				if (!collapsed) {
+					findEndPoint();
+				}
+			} catch (ex) {
+				// IE has a nasty bug where text nodes might throw "invalid argument" when you
+				// access the nodeValue or other properties of text nodes. This seems to happend when
+				// text nodes are split into two nodes by a delete/backspace call. So lets detect it and try to fix it.
+				if (ex.number == -2147024809) {
+					// Get the current selection
+					bookmark = self.getBookmark(2);
+
+					// Get start element
+					tmpRange = ieRange.duplicate();
+					tmpRange.collapse(true);
+					element = tmpRange.parentElement();
+
+					// Get end element
+					if (!collapsed) {
+						tmpRange = ieRange.duplicate();
+						tmpRange.collapse(false);
+						element2 = tmpRange.parentElement();
+						element2.innerHTML = element2.innerHTML;
+					}
+
+					// Remove the broken elements
+					element.innerHTML = element.innerHTML;
+
+					// Restore the selection
+					self.moveToBookmark(bookmark);
+
+					// Since the range has moved we need to re-get it
+					ieRange = selection.getRng();
+
+					// Find start point
+					findEndPoint(true);
+
+					// Find end point if needed
+					if (!collapsed) {
+						findEndPoint();
+					}
+				} else {
+					throw ex; // Throw other errors
+				}
+			}
+
+			return domRange;
+		}
+
+		this.getBookmark = function(type) {
+			var rng = selection.getRng(), bookmark = {};
+
+			function getIndexes(node) {
+				var parent, root, children, i, indexes = [];
+
+				parent = node.parentNode;
+				root = dom.getRoot().parentNode;
+
+				while (parent != root && parent.nodeType !== 9) {
+					children = parent.children;
+
+					i = children.length;
+					while (i--) {
+						if (node === children[i]) {
+							indexes.push(i);
+							break;
+						}
+					}
+
+					node = parent;
+					parent = parent.parentNode;
+				}
+
+				return indexes;
+			}
+
+			function getBookmarkEndPoint(start) {
+				var position;
+
+				position = getPosition(rng, start);
+				if (position) {
+					return {
+						position: position.position,
+						offset: position.offset,
+						indexes: getIndexes(position.node),
+						inside: position.inside
+					};
+				}
+			}
+
+			// Non ubstructive bookmark
+			if (type === 2) {
+				// Handle text selection
+				if (!rng.item) {
+					bookmark.start = getBookmarkEndPoint(true);
+
+					if (!selection.isCollapsed()) {
+						bookmark.end = getBookmarkEndPoint();
+					}
+				} else {
+					bookmark.start = {ctrl: true, indexes: getIndexes(rng.item(0))};
+				}
+			}
+
+			return bookmark;
+		};
+
+		this.moveToBookmark = function(bookmark) {
+			var rng, body = dom.doc.body;
+
+			function resolveIndexes(indexes) {
+				var node, i, idx, children;
+
+				node = dom.getRoot();
+				for (i = indexes.length - 1; i >= 0; i--) {
+					children = node.children;
+					idx = indexes[i];
+
+					if (idx <= children.length - 1) {
+						node = children[idx];
+					}
+				}
+
+				return node;
+			}
+
+			function setBookmarkEndPoint(start) {
+				var endPoint = bookmark[start ? 'start' : 'end'], moveLeft, moveRng, undef, offset;
+
+				if (endPoint) {
+					moveLeft = endPoint.position > 0;
+
+					moveRng = body.createTextRange();
+					moveRng.moveToElementText(resolveIndexes(endPoint.indexes));
+
+					offset = endPoint.offset;
+					if (offset !== undef) {
+						moveRng.collapse(endPoint.inside || moveLeft);
+						moveRng.moveStart('character', moveLeft ? -offset : offset);
+					} else {
+						moveRng.collapse(start);
+					}
+
+					rng.setEndPoint(start ? 'StartToStart' : 'EndToStart', moveRng);
+
+					if (start) {
+						rng.collapse(true);
+					}
+				}
+			}
+
+			if (bookmark.start) {
+				if (bookmark.start.ctrl) {
+					rng = body.createControlRange();
+					rng.addElement(resolveIndexes(bookmark.start.indexes));
+					rng.select();
+				} else {
+					rng = body.createTextRange();
+					setBookmarkEndPoint(true);
+					setBookmarkEndPoint();
+					rng.select();
+				}
+			}
+		};
+
+		this.addRange = function(rng) {
+			var ieRng, ctrlRng, startContainer, startOffset, endContainer, endOffset, sibling,
+				doc = selection.dom.doc, body = doc.body, nativeRng, ctrlElm;
+
+			function setEndPoint(start) {
+				var container, offset, marker, tmpRng, nodes;
+
+				marker = dom.create('a');
+				container = start ? startContainer : endContainer;
+				offset = start ? startOffset : endOffset;
+				tmpRng = ieRng.duplicate();
+
+				if (container == doc || container == doc.documentElement) {
+					container = body;
+					offset = 0;
+				}
+
+				if (container.nodeType == 3) {
+					container.parentNode.insertBefore(marker, container);
+					tmpRng.moveToElementText(marker);
+					tmpRng.moveStart('character', offset);
+					dom.remove(marker);
+					ieRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', tmpRng);
+				} else {
+					nodes = container.childNodes;
+
+					if (nodes.length) {
+						if (offset >= nodes.length) {
+							dom.insertAfter(marker, nodes[nodes.length - 1]);
+						} else {
+							container.insertBefore(marker, nodes[offset]);
+						}
+
+						tmpRng.moveToElementText(marker);
+					} else if (container.canHaveHTML) {
+						// Empty node selection for example <div>|</div>
+						// Setting innerHTML with a span marker then remove that marker seems to keep empty block elements open
+						container.innerHTML = '<span>&#xFEFF;</span>';
+						marker = container.firstChild;
+						tmpRng.moveToElementText(marker);
+						tmpRng.collapse(FALSE); // Collapse false works better than true for some odd reason
+					}
+
+					ieRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', tmpRng);
+					dom.remove(marker);
+				}
+			}
+
+			// Setup some shorter versions
+			startContainer = rng.startContainer;
+			startOffset = rng.startOffset;
+			endContainer = rng.endContainer;
+			endOffset = rng.endOffset;
+			ieRng = body.createTextRange();
+
+			// If single element selection then try making a control selection out of it
+			if (startContainer == endContainer && startContainer.nodeType == 1) {
+				// Trick to place the caret inside an empty block element like <p></p>
+				if (startOffset == endOffset && !startContainer.hasChildNodes()) {
+					if (startContainer.canHaveHTML) {
+						// Check if previous sibling is an empty block if it is then we need to render it
+						// IE would otherwise move the caret into the sibling instead of the empty startContainer see: #5236
+						// Example this: <p></p><p>|</p> would become this: <p>|</p><p></p>
+						sibling = startContainer.previousSibling;
+						if (sibling && !sibling.hasChildNodes() && dom.isBlock(sibling)) {
+							sibling.innerHTML = '&#xFEFF;';
+						} else {
+							sibling = null;
+						}
+
+						startContainer.innerHTML = '<span>&#xFEFF;</span><span>&#xFEFF;</span>';
+						ieRng.moveToElementText(startContainer.lastChild);
+						ieRng.select();
+						dom.doc.selection.clear();
+						startContainer.innerHTML = '';
+
+						if (sibling) {
+							sibling.innerHTML = '';
+						}
+						return;
+					} else {
+						startOffset = dom.nodeIndex(startContainer);
+						startContainer = startContainer.parentNode;
+					}
+				}
+
+				if (startOffset == endOffset - 1) {
+					try {
+						ctrlElm = startContainer.childNodes[startOffset];
+						ctrlRng = body.createControlRange();
+						ctrlRng.addElement(ctrlElm);
+						ctrlRng.select();
+
+						// Check if the range produced is on the correct element and is a control range
+						// On IE 8 it will select the parent contentEditable container if you select an inner element see: #5398
+						nativeRng = selection.getRng();
+						if (nativeRng.item && ctrlElm === nativeRng.item(0)) {
+							return;
+						}
+					} catch (ex) {
+						// Ignore
+					}
+				}
+			}
+
+			// Set start/end point of selection
+			setEndPoint(true);
+			setEndPoint();
+
+			// Select the new range and scroll it into view
+			ieRng.select();
+		};
+
+		// Expose range method
+		this.getRangeAt = getRange;
+	}
+
+	return Selection;
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/fmt/Preview.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,151 @@
+/**
+ * Preview.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Internal class for generating previews styles for formats.
+ *
+ * Example:
+ *  Preview.getCssText(editor, 'bold');
+ *
+ * @class tinymce.fmt.Preview
+ * @private
+ */
+define("tinymce/fmt/Preview", [
+	"tinymce/util/Tools"
+], function(Tools) {
+	var each = Tools.each;
+
+	function getCssText(editor, format) {
+		var name, previewElm, dom = editor.dom;
+		var previewCss = '', parentFontSize, previewStyles;
+
+		previewStyles = editor.settings.preview_styles;
+
+		// No preview forced
+		if (previewStyles === false) {
+			return '';
+		}
+
+		// Default preview
+		if (!previewStyles) {
+			previewStyles = 'font-family font-size font-weight font-style text-decoration ' +
+				'text-transform color background-color border border-radius outline text-shadow';
+		}
+
+		// Removes any variables since these can't be previewed
+		function removeVars(val) {
+			return val.replace(/%(\w+)/g, '');
+		}
+
+		// Create block/inline element to use for preview
+		if (typeof format == "string") {
+			format = editor.formatter.get(format);
+			if (!format) {
+				return;
+			}
+
+			format = format[0];
+		}
+
+		name = format.block || format.inline || 'span';
+		previewElm = dom.create(name);
+
+		// Add format styles to preview element
+		each(format.styles, function(value, name) {
+			value = removeVars(value);
+
+			if (value) {
+				dom.setStyle(previewElm, name, value);
+			}
+		});
+
+		// Add attributes to preview element
+		each(format.attributes, function(value, name) {
+			value = removeVars(value);
+
+			if (value) {
+				dom.setAttrib(previewElm, name, value);
+			}
+		});
+
+		// Add classes to preview element
+		each(format.classes, function(value) {
+			value = removeVars(value);
+
+			if (!dom.hasClass(previewElm, value)) {
+				dom.addClass(previewElm, value);
+			}
+		});
+
+		editor.fire('PreviewFormats');
+
+		// Add the previewElm outside the visual area
+		dom.setStyles(previewElm, {position: 'absolute', left: -0xFFFF});
+		editor.getBody().appendChild(previewElm);
+
+		// Get parent container font size so we can compute px values out of em/% for older IE:s
+		parentFontSize = dom.getStyle(editor.getBody(), 'fontSize', true);
+		parentFontSize = /px$/.test(parentFontSize) ? parseInt(parentFontSize, 10) : 0;
+
+		each(previewStyles.split(' '), function(name) {
+			var value = dom.getStyle(previewElm, name, true);
+
+			// If background is transparent then check if the body has a background color we can use
+			if (name == 'background-color' && /transparent|rgba\s*\([^)]+,\s*0\)/.test(value)) {
+				value = dom.getStyle(editor.getBody(), name, true);
+
+				// Ignore white since it's the default color, not the nicest fix
+				// TODO: Fix this by detecting runtime style
+				if (dom.toHex(value).toLowerCase() == '#ffffff') {
+					return;
+				}
+			}
+
+			if (name == 'color') {
+				// Ignore black since it's the default color, not the nicest fix
+				// TODO: Fix this by detecting runtime style
+				if (dom.toHex(value).toLowerCase() == '#000000') {
+					return;
+				}
+			}
+
+			// Old IE won't calculate the font size so we need to do that manually
+			if (name == 'font-size') {
+				if (/em|%$/.test(value)) {
+					if (parentFontSize === 0) {
+						return;
+					}
+
+					// Convert font size from em/% to px
+					value = parseFloat(value, 10) / (/%$/.test(value) ? 100 : 1);
+					value = (value * parentFontSize) + 'px';
+				}
+			}
+
+			if (name == "border" && value) {
+				previewCss += 'padding:0 2px;';
+			}
+
+			previewCss += name + ':' + value + ';';
+		});
+
+		editor.fire('AfterPreviewFormats');
+
+		//previewCss += 'line-height:normal';
+
+		dom.remove(previewElm);
+
+		return previewCss;
+	}
+
+	return {
+		getCssText: getCssText
+	};
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/DomParser.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,804 @@
+/**
+ * DomParser.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class parses HTML code into a DOM like structure of nodes it will remove redundant whitespace and make
+ * sure that the node tree is valid according to the specified schema.
+ * So for example: <p>a<p>b</p>c</p> will become <p>a</p><p>b</p><p>c</p>
+ *
+ * @example
+ * var parser = new tinymce.html.DomParser({validate: true}, schema);
+ * var rootNode = parser.parse('<h1>content</h1>');
+ *
+ * @class tinymce.html.DomParser
+ * @version 3.4
+ */
+define("tinymce/html/DomParser", [
+	"tinymce/html/Node",
+	"tinymce/html/Schema",
+	"tinymce/html/SaxParser",
+	"tinymce/util/Tools"
+], function(Node, Schema, SaxParser, Tools) {
+	var makeMap = Tools.makeMap, each = Tools.each, explode = Tools.explode, extend = Tools.extend;
+
+	/**
+	 * Constructs a new DomParser instance.
+	 *
+	 * @constructor
+	 * @method DomParser
+	 * @param {Object} settings Name/value collection of settings. comment, cdata, text, start and end are callbacks.
+	 * @param {tinymce.html.Schema} schema HTML Schema class to use when parsing.
+	 */
+	return function(settings, schema) {
+		var self = this, nodeFilters = {}, attributeFilters = [], matchedNodes = {}, matchedAttributes = {};
+
+		settings = settings || {};
+		settings.validate = "validate" in settings ? settings.validate : true;
+		settings.root_name = settings.root_name || 'body';
+		self.schema = schema = schema || new Schema();
+
+		function fixInvalidChildren(nodes) {
+			var ni, node, parent, parents, newParent, currentNode, tempNode, childNode, i;
+			var nonEmptyElements, nonSplitableElements, textBlockElements, sibling, nextNode;
+
+			nonSplitableElements = makeMap('tr,td,th,tbody,thead,tfoot,table');
+			nonEmptyElements = schema.getNonEmptyElements();
+			textBlockElements = schema.getTextBlockElements();
+
+			for (ni = 0; ni < nodes.length; ni++) {
+				node = nodes[ni];
+
+				// Already removed or fixed
+				if (!node.parent || node.fixed) {
+					continue;
+				}
+
+				// If the invalid element is a text block and the text block is within a parent LI element
+				// Then unwrap the first text block and convert other sibling text blocks to LI elements similar to Word/Open Office
+				if (textBlockElements[node.name] && node.parent.name == 'li') {
+					// Move sibling text blocks after LI element
+					sibling = node.next;
+					while (sibling) {
+						if (textBlockElements[sibling.name]) {
+							sibling.name = 'li';
+							sibling.fixed = true;
+							node.parent.insert(sibling, node.parent);
+						} else {
+							break;
+						}
+
+						sibling = sibling.next;
+					}
+
+					// Unwrap current text block
+					node.unwrap(node);
+					continue;
+				}
+
+				// Get list of all parent nodes until we find a valid parent to stick the child into
+				parents = [node];
+				for (parent = node.parent; parent && !schema.isValidChild(parent.name, node.name) &&
+					!nonSplitableElements[parent.name]; parent = parent.parent) {
+					parents.push(parent);
+				}
+
+				// Found a suitable parent
+				if (parent && parents.length > 1) {
+					// Reverse the array since it makes looping easier
+					parents.reverse();
+
+					// Clone the related parent and insert that after the moved node
+					newParent = currentNode = self.filterNode(parents[0].clone());
+
+					// Start cloning and moving children on the left side of the target node
+					for (i = 0; i < parents.length - 1; i++) {
+						if (schema.isValidChild(currentNode.name, parents[i].name)) {
+							tempNode = self.filterNode(parents[i].clone());
+							currentNode.append(tempNode);
+						} else {
+							tempNode = currentNode;
+						}
+
+						for (childNode = parents[i].firstChild; childNode && childNode != parents[i + 1];) {
+							nextNode = childNode.next;
+							tempNode.append(childNode);
+							childNode = nextNode;
+						}
+
+						currentNode = tempNode;
+					}
+
+					if (!newParent.isEmpty(nonEmptyElements)) {
+						parent.insert(newParent, parents[0], true);
+						parent.insert(node, newParent);
+					} else {
+						parent.insert(node, parents[0], true);
+					}
+
+					// Check if the element is empty by looking through it's contents and special treatment for <p><br /></p>
+					parent = parents[0];
+					if (parent.isEmpty(nonEmptyElements) || parent.firstChild === parent.lastChild && parent.firstChild.name === 'br') {
+						parent.empty().remove();
+					}
+				} else if (node.parent) {
+					// If it's an LI try to find a UL/OL for it or wrap it
+					if (node.name === 'li') {
+						sibling = node.prev;
+						if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) {
+							sibling.append(node);
+							continue;
+						}
+
+						sibling = node.next;
+						if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) {
+							sibling.insert(node, sibling.firstChild, true);
+							continue;
+						}
+
+						node.wrap(self.filterNode(new Node('ul', 1)));
+						continue;
+					}
+
+					// Try wrapping the element in a DIV
+					if (schema.isValidChild(node.parent.name, 'div') && schema.isValidChild('div', node.name)) {
+						node.wrap(self.filterNode(new Node('div', 1)));
+					} else {
+						// We failed wrapping it, then remove or unwrap it
+						if (node.name === 'style' || node.name === 'script') {
+							node.empty().remove();
+						} else {
+							node.unwrap();
+						}
+					}
+				}
+			}
+		}
+
+		/**
+		 * Runs the specified node though the element and attributes filters.
+		 *
+		 * @method filterNode
+		 * @param {tinymce.html.Node} Node the node to run filters on.
+		 * @return {tinymce.html.Node} The passed in node.
+		 */
+		self.filterNode = function(node) {
+			var i, name, list;
+
+			// Run element filters
+			if (name in nodeFilters) {
+				list = matchedNodes[name];
+
+				if (list) {
+					list.push(node);
+				} else {
+					matchedNodes[name] = [node];
+				}
+			}
+
+			// Run attribute filters
+			i = attributeFilters.length;
+			while (i--) {
+				name = attributeFilters[i].name;
+
+				if (name in node.attributes.map) {
+					list = matchedAttributes[name];
+
+					if (list) {
+						list.push(node);
+					} else {
+						matchedAttributes[name] = [node];
+					}
+				}
+			}
+
+			return node;
+		};
+
+		/**
+		 * Adds a node filter function to the parser, the parser will collect the specified nodes by name
+		 * and then execute the callback ones it has finished parsing the document.
+		 *
+		 * @example
+		 * parser.addNodeFilter('p,h1', function(nodes, name) {
+		 *		for (var i = 0; i < nodes.length; i++) {
+		 *			console.log(nodes[i].name);
+		 *		}
+		 * });
+		 * @method addNodeFilter
+		 * @method {String} name Comma separated list of nodes to collect.
+		 * @param {function} callback Callback function to execute once it has collected nodes.
+		 */
+		self.addNodeFilter = function(name, callback) {
+			each(explode(name), function(name) {
+				var list = nodeFilters[name];
+
+				if (!list) {
+					nodeFilters[name] = list = [];
+				}
+
+				list.push(callback);
+			});
+		};
+
+		/**
+		 * Adds a attribute filter function to the parser, the parser will collect nodes that has the specified attributes
+		 * and then execute the callback ones it has finished parsing the document.
+		 *
+		 * @example
+		 * parser.addAttributeFilter('src,href', function(nodes, name) {
+		 *		for (var i = 0; i < nodes.length; i++) {
+		 *			console.log(nodes[i].name);
+		 *		}
+		 * });
+		 * @method addAttributeFilter
+		 * @method {String} name Comma separated list of nodes to collect.
+		 * @param {function} callback Callback function to execute once it has collected nodes.
+		 */
+		self.addAttributeFilter = function(name, callback) {
+			each(explode(name), function(name) {
+				var i;
+
+				for (i = 0; i < attributeFilters.length; i++) {
+					if (attributeFilters[i].name === name) {
+						attributeFilters[i].callbacks.push(callback);
+						return;
+					}
+				}
+
+				attributeFilters.push({name: name, callbacks: [callback]});
+			});
+		};
+
+		/**
+		 * Parses the specified HTML string into a DOM like node tree and returns the result.
+		 *
+		 * @example
+		 * var rootNode = new DomParser({...}).parse('<b>text</b>');
+		 * @method parse
+		 * @param {String} html Html string to sax parse.
+		 * @param {Object} args Optional args object that gets passed to all filter functions.
+		 * @return {tinymce.html.Node} Root node containing the tree.
+		 */
+		self.parse = function(html, args) {
+			var parser, rootNode, node, nodes, i, l, fi, fl, list, name, validate;
+			var blockElements, startWhiteSpaceRegExp, invalidChildren = [], isInWhiteSpacePreservedElement;
+			var endWhiteSpaceRegExp, allWhiteSpaceRegExp, isAllWhiteSpaceRegExp, whiteSpaceElements;
+			var children, nonEmptyElements, rootBlockName;
+
+			args = args || {};
+			matchedNodes = {};
+			matchedAttributes = {};
+			blockElements = extend(makeMap('script,style,head,html,body,title,meta,param'), schema.getBlockElements());
+			nonEmptyElements = schema.getNonEmptyElements();
+			children = schema.children;
+			validate = settings.validate;
+			rootBlockName = "forced_root_block" in args ? args.forced_root_block : settings.forced_root_block;
+
+			whiteSpaceElements = schema.getWhiteSpaceElements();
+			startWhiteSpaceRegExp = /^[ \t\r\n]+/;
+			endWhiteSpaceRegExp = /[ \t\r\n]+$/;
+			allWhiteSpaceRegExp = /[ \t\r\n]+/g;
+			isAllWhiteSpaceRegExp = /^[ \t\r\n]+$/;
+
+			function addRootBlocks() {
+				var node = rootNode.firstChild, next, rootBlockNode;
+
+				// Removes whitespace at beginning and end of block so:
+				// <p> x </p> -> <p>x</p>
+				function trim(rootBlockNode) {
+					if (rootBlockNode) {
+						node = rootBlockNode.firstChild;
+						if (node && node.type == 3) {
+							node.value = node.value.replace(startWhiteSpaceRegExp, '');
+						}
+
+						node = rootBlockNode.lastChild;
+						if (node && node.type == 3) {
+							node.value = node.value.replace(endWhiteSpaceRegExp, '');
+						}
+					}
+				}
+
+				// Check if rootBlock is valid within rootNode for example if P is valid in H1 if H1 is the contentEditabe root
+				if (!schema.isValidChild(rootNode.name, rootBlockName.toLowerCase())) {
+					return;
+				}
+
+				while (node) {
+					next = node.next;
+
+					if (node.type == 3 || (node.type == 1 && node.name !== 'p' &&
+						!blockElements[node.name] && !node.attr('data-mce-type'))) {
+						if (!rootBlockNode) {
+							// Create a new root block element
+							rootBlockNode = createNode(rootBlockName, 1);
+							rootBlockNode.attr(settings.forced_root_block_attrs);
+							rootNode.insert(rootBlockNode, node);
+							rootBlockNode.append(node);
+						} else {
+							rootBlockNode.append(node);
+						}
+					} else {
+						trim(rootBlockNode);
+						rootBlockNode = null;
+					}
+
+					node = next;
+				}
+
+				trim(rootBlockNode);
+			}
+
+			function createNode(name, type) {
+				var node = new Node(name, type), list;
+
+				if (name in nodeFilters) {
+					list = matchedNodes[name];
+
+					if (list) {
+						list.push(node);
+					} else {
+						matchedNodes[name] = [node];
+					}
+				}
+
+				return node;
+			}
+
+			function removeWhitespaceBefore(node) {
+				var textNode, textVal, sibling;
+
+				for (textNode = node.prev; textNode && textNode.type === 3;) {
+					textVal = textNode.value.replace(endWhiteSpaceRegExp, '');
+
+					if (textVal.length > 0) {
+						textNode.value = textVal;
+						textNode = textNode.prev;
+					} else {
+						sibling = textNode.prev;
+						textNode.remove();
+						textNode = sibling;
+					}
+				}
+			}
+
+			function cloneAndExcludeBlocks(input) {
+				var name, output = {};
+
+				for (name in input) {
+					if (name !== 'li' && name != 'p') {
+						output[name] = input[name];
+					}
+				}
+
+				return output;
+			}
+
+			parser = new SaxParser({
+				validate: validate,
+				allow_script_urls: settings.allow_script_urls,
+				allow_conditional_comments: settings.allow_conditional_comments,
+
+				// Exclude P and LI from DOM parsing since it's treated better by the DOM parser
+				self_closing_elements: cloneAndExcludeBlocks(schema.getSelfClosingElements()),
+
+				cdata: function(text) {
+					node.append(createNode('#cdata', 4)).value = text;
+				},
+
+				text: function(text, raw) {
+					var textNode;
+
+					// Trim all redundant whitespace on non white space elements
+					if (!isInWhiteSpacePreservedElement) {
+						text = text.replace(allWhiteSpaceRegExp, ' ');
+
+						if (node.lastChild && blockElements[node.lastChild.name]) {
+							text = text.replace(startWhiteSpaceRegExp, '');
+						}
+					}
+
+					// Do we need to create the node
+					if (text.length !== 0) {
+						textNode = createNode('#text', 3);
+						textNode.raw = !!raw;
+						node.append(textNode).value = text;
+					}
+				},
+
+				comment: function(text) {
+					node.append(createNode('#comment', 8)).value = text;
+				},
+
+				pi: function(name, text) {
+					node.append(createNode(name, 7)).value = text;
+					removeWhitespaceBefore(node);
+				},
+
+				doctype: function(text) {
+					var newNode;
+
+					newNode = node.append(createNode('#doctype', 10));
+					newNode.value = text;
+					removeWhitespaceBefore(node);
+				},
+
+				start: function(name, attrs, empty) {
+					var newNode, attrFiltersLen, elementRule, attrName, parent;
+
+					elementRule = validate ? schema.getElementRule(name) : {};
+					if (elementRule) {
+						newNode = createNode(elementRule.outputName || name, 1);
+						newNode.attributes = attrs;
+						newNode.shortEnded = empty;
+
+						node.append(newNode);
+
+						// Check if node is valid child of the parent node is the child is
+						// unknown we don't collect it since it's probably a custom element
+						parent = children[node.name];
+						if (parent && children[newNode.name] && !parent[newNode.name]) {
+							invalidChildren.push(newNode);
+						}
+
+						attrFiltersLen = attributeFilters.length;
+						while (attrFiltersLen--) {
+							attrName = attributeFilters[attrFiltersLen].name;
+
+							if (attrName in attrs.map) {
+								list = matchedAttributes[attrName];
+
+								if (list) {
+									list.push(newNode);
+								} else {
+									matchedAttributes[attrName] = [newNode];
+								}
+							}
+						}
+
+						// Trim whitespace before block
+						if (blockElements[name]) {
+							removeWhitespaceBefore(newNode);
+						}
+
+						// Change current node if the element wasn't empty i.e not <br /> or <img />
+						if (!empty) {
+							node = newNode;
+						}
+
+						// Check if we are inside a whitespace preserved element
+						if (!isInWhiteSpacePreservedElement && whiteSpaceElements[name]) {
+							isInWhiteSpacePreservedElement = true;
+						}
+					}
+				},
+
+				end: function(name) {
+					var textNode, elementRule, text, sibling, tempNode;
+
+					elementRule = validate ? schema.getElementRule(name) : {};
+					if (elementRule) {
+						if (blockElements[name]) {
+							if (!isInWhiteSpacePreservedElement) {
+								// Trim whitespace of the first node in a block
+								textNode = node.firstChild;
+								if (textNode && textNode.type === 3) {
+									text = textNode.value.replace(startWhiteSpaceRegExp, '');
+
+									// Any characters left after trim or should we remove it
+									if (text.length > 0) {
+										textNode.value = text;
+										textNode = textNode.next;
+									} else {
+										sibling = textNode.next;
+										textNode.remove();
+										textNode = sibling;
+
+										// Remove any pure whitespace siblings
+										while (textNode && textNode.type === 3) {
+											text = textNode.value;
+											sibling = textNode.next;
+
+											if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) {
+												textNode.remove();
+												textNode = sibling;
+											}
+
+											textNode = sibling;
+										}
+									}
+								}
+
+								// Trim whitespace of the last node in a block
+								textNode = node.lastChild;
+								if (textNode && textNode.type === 3) {
+									text = textNode.value.replace(endWhiteSpaceRegExp, '');
+
+									// Any characters left after trim or should we remove it
+									if (text.length > 0) {
+										textNode.value = text;
+										textNode = textNode.prev;
+									} else {
+										sibling = textNode.prev;
+										textNode.remove();
+										textNode = sibling;
+
+										// Remove any pure whitespace siblings
+										while (textNode && textNode.type === 3) {
+											text = textNode.value;
+											sibling = textNode.prev;
+
+											if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) {
+												textNode.remove();
+												textNode = sibling;
+											}
+
+											textNode = sibling;
+										}
+									}
+								}
+							}
+
+							// Trim start white space
+							// Removed due to: #5424
+							/*textNode = node.prev;
+							if (textNode && textNode.type === 3) {
+								text = textNode.value.replace(startWhiteSpaceRegExp, '');
+
+								if (text.length > 0)
+									textNode.value = text;
+								else
+									textNode.remove();
+							}*/
+						}
+
+						// Check if we exited a whitespace preserved element
+						if (isInWhiteSpacePreservedElement && whiteSpaceElements[name]) {
+							isInWhiteSpacePreservedElement = false;
+						}
+
+						// Handle empty nodes
+						if (elementRule.removeEmpty || elementRule.paddEmpty) {
+							if (node.isEmpty(nonEmptyElements)) {
+								if (elementRule.paddEmpty) {
+									node.empty().append(new Node('#text', '3')).value = '\u00a0';
+								} else {
+									// Leave nodes that have a name like <a name="name">
+									if (!node.attributes.map.name && !node.attributes.map.id) {
+										tempNode = node.parent;
+
+										if (blockElements[node.name]) {
+											node.empty().remove();
+										} else {
+											node.unwrap();
+										}
+
+										node = tempNode;
+										return;
+									}
+								}
+							}
+						}
+
+						node = node.parent;
+					}
+				}
+			}, schema);
+
+			rootNode = node = new Node(args.context || settings.root_name, 11);
+
+			parser.parse(html);
+
+			// Fix invalid children or report invalid children in a contextual parsing
+			if (validate && invalidChildren.length) {
+				if (!args.context) {
+					fixInvalidChildren(invalidChildren);
+				} else {
+					args.invalid = true;
+				}
+			}
+
+			// Wrap nodes in the root into block elements if the root is body
+			if (rootBlockName && (rootNode.name == 'body' || args.isRootContent)) {
+				addRootBlocks();
+			}
+
+			// Run filters only when the contents is valid
+			if (!args.invalid) {
+				// Run node filters
+				for (name in matchedNodes) {
+					list = nodeFilters[name];
+					nodes = matchedNodes[name];
+
+					// Remove already removed children
+					fi = nodes.length;
+					while (fi--) {
+						if (!nodes[fi].parent) {
+							nodes.splice(fi, 1);
+						}
+					}
+
+					for (i = 0, l = list.length; i < l; i++) {
+						list[i](nodes, name, args);
+					}
+				}
+
+				// Run attribute filters
+				for (i = 0, l = attributeFilters.length; i < l; i++) {
+					list = attributeFilters[i];
+
+					if (list.name in matchedAttributes) {
+						nodes = matchedAttributes[list.name];
+
+						// Remove already removed children
+						fi = nodes.length;
+						while (fi--) {
+							if (!nodes[fi].parent) {
+								nodes.splice(fi, 1);
+							}
+						}
+
+						for (fi = 0, fl = list.callbacks.length; fi < fl; fi++) {
+							list.callbacks[fi](nodes, list.name, args);
+						}
+					}
+				}
+			}
+
+			return rootNode;
+		};
+
+		// Remove <br> at end of block elements Gecko and WebKit injects BR elements to
+		// make it possible to place the caret inside empty blocks. This logic tries to remove
+		// these elements and keep br elements that where intended to be there intact
+		if (settings.remove_trailing_brs) {
+			self.addNodeFilter('br', function(nodes) {
+				var i, l = nodes.length, node, blockElements = extend({}, schema.getBlockElements());
+				var nonEmptyElements = schema.getNonEmptyElements(), parent, lastParent, prev, prevName;
+				var elementRule, textNode;
+
+				// Remove brs from body element as well
+				blockElements.body = 1;
+
+				// Must loop forwards since it will otherwise remove all brs in <p>a<br><br><br></p>
+				for (i = 0; i < l; i++) {
+					node = nodes[i];
+					parent = node.parent;
+
+					if (blockElements[node.parent.name] && node === parent.lastChild) {
+						// Loop all nodes to the left of the current node and check for other BR elements
+						// excluding bookmarks since they are invisible
+						prev = node.prev;
+						while (prev) {
+							prevName = prev.name;
+
+							// Ignore bookmarks
+							if (prevName !== "span" || prev.attr('data-mce-type') !== 'bookmark') {
+								// Found a non BR element
+								if (prevName !== "br") {
+									break;
+								}
+
+								// Found another br it's a <br><br> structure then don't remove anything
+								if (prevName === 'br') {
+									node = null;
+									break;
+								}
+							}
+
+							prev = prev.prev;
+						}
+
+						if (node) {
+							node.remove();
+
+							// Is the parent to be considered empty after we removed the BR
+							if (parent.isEmpty(nonEmptyElements)) {
+								elementRule = schema.getElementRule(parent.name);
+
+								// Remove or padd the element depending on schema rule
+								if (elementRule) {
+									if (elementRule.removeEmpty) {
+										parent.remove();
+									} else if (elementRule.paddEmpty) {
+										parent.empty().append(new Node('#text', 3)).value = '\u00a0';
+									}
+								}
+							}
+						}
+					} else {
+						// Replaces BR elements inside inline elements like <p><b><i><br></i></b></p>
+						// so they become <p><b><i>&nbsp;</i></b></p>
+						lastParent = node;
+						while (parent && parent.firstChild === lastParent && parent.lastChild === lastParent) {
+							lastParent = parent;
+
+							if (blockElements[parent.name]) {
+								break;
+							}
+
+							parent = parent.parent;
+						}
+
+						if (lastParent === parent) {
+							textNode = new Node('#text', 3);
+							textNode.value = '\u00a0';
+							node.replace(textNode);
+						}
+					}
+				}
+			});
+		}
+
+		// Force anchor names closed, unless the setting "allow_html_in_named_anchor" is explicitly included.
+		if (!settings.allow_html_in_named_anchor) {
+			self.addAttributeFilter('id,name', function(nodes) {
+				var i = nodes.length, sibling, prevSibling, parent, node;
+
+				while (i--) {
+					node = nodes[i];
+					if (node.name === 'a' && node.firstChild && !node.attr('href')) {
+						parent = node.parent;
+
+						// Move children after current node
+						sibling = node.lastChild;
+						do {
+							prevSibling = sibling.prev;
+							parent.insert(sibling, node);
+							sibling = prevSibling;
+						} while (sibling);
+					}
+				}
+			});
+		}
+
+		if (settings.validate && schema.getValidClasses()) {
+			self.addAttributeFilter('class', function(nodes) {
+				var i = nodes.length, node, classList, ci, className, classValue;
+				var validClasses = schema.getValidClasses(), validClassesMap, valid;
+
+				while (i--) {
+					node = nodes[i];
+					classList = node.attr('class').split(' ');
+					classValue = '';
+
+					for (ci = 0; ci < classList.length; ci++) {
+						className = classList[ci];
+						valid = false;
+
+						validClassesMap = validClasses['*'];
+						if (validClassesMap && validClassesMap[className]) {
+							valid = true;
+						}
+
+						validClassesMap = validClasses[node.name];
+						if (!valid && validClassesMap && validClassesMap[className]) {
+							valid = true;
+						}
+
+						if (valid) {
+							if (classValue) {
+								classValue += ' ';
+							}
+
+							classValue += className;
+						}
+					}
+
+					if (!classValue.length) {
+						classValue = null;
+					}
+
+					node.attr('class', classValue);
+				}
+			});
+		}
+	};
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/Entities.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,268 @@
+/**
+ * Entities.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*jshint bitwise:false */
+/*eslint no-bitwise:0 */
+
+/**
+ * Entity encoder class.
+ *
+ * @class tinymce.html.Entities
+ * @static
+ * @version 3.4
+ */
+define("tinymce/html/Entities", [
+	"tinymce/util/Tools"
+], function(Tools) {
+	var makeMap = Tools.makeMap;
+
+	var namedEntities, baseEntities, reverseEntities,
+		attrsCharsRegExp = /[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
+		textCharsRegExp = /[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
+		rawCharsRegExp = /[<>&\"\']/g,
+		entityRegExp = /&#([a-z0-9]+);?|&([a-z0-9]+);/gi,
+		asciiMap = {
+			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"
+		};
+
+	// Raw entities
+	baseEntities = {
+		'\"': '&quot;', // Needs to be escaped since the YUI compressor would otherwise break the code
+		"'": '&#39;',
+		'<': '&lt;',
+		'>': '&gt;',
+		'&': '&amp;',
+		'\u0060': '&#96;'
+	};
+
+	// Reverse lookup table for raw entities
+	reverseEntities = {
+		'&lt;': '<',
+		'&gt;': '>',
+		'&amp;': '&',
+		'&quot;': '"',
+		'&apos;': "'"
+	};
+
+	// Decodes text by using the browser
+	function nativeDecode(text) {
+		var elm;
+
+		elm = document.createElement("div");
+		elm.innerHTML = text;
+
+		return elm.textContent || elm.innerText || text;
+	}
+
+	// Build a two way lookup table for the entities
+	function buildEntitiesLookup(items, radix) {
+		var i, chr, entity, lookup = {};
+
+		if (items) {
+			items = items.split(',');
+			radix = radix || 10;
+
+			// Build entities lookup table
+			for (i = 0; i < items.length; i += 2) {
+				chr = String.fromCharCode(parseInt(items[i], radix));
+
+				// Only add non base entities
+				if (!baseEntities[chr]) {
+					entity = '&' + items[i + 1] + ';';
+					lookup[chr] = entity;
+					lookup[entity] = chr;
+				}
+			}
+
+			return lookup;
+		}
+	}
+
+	// Unpack entities lookup where the numbers are in radix 32 to reduce the size
+	namedEntities = buildEntitiesLookup(
+		'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 Entities = {
+		/**
+		 * Encodes the specified string using raw entities. This means only the required XML base entities will be endoded.
+		 *
+		 * @method encodeRaw
+		 * @param {String} text Text to encode.
+		 * @param {Boolean} attr Optional flag to specify if the text is attribute contents.
+		 * @return {String} Entity encoded text.
+		 */
+		encodeRaw: function(text, attr) {
+			return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) {
+				return baseEntities[chr] || chr;
+			});
+		},
+
+		/**
+		 * Encoded the specified text with both the attributes and text entities. This function will produce larger text contents
+		 * since it doesn't know if the context is within a attribute or text node. This was added for compatibility
+		 * and is exposed as the DOMUtils.encode function.
+		 *
+		 * @method encodeAllRaw
+		 * @param {String} text Text to encode.
+		 * @return {String} Entity encoded text.
+		 */
+		encodeAllRaw: function(text) {
+			return ('' + text).replace(rawCharsRegExp, function(chr) {
+				return baseEntities[chr] || chr;
+			});
+		},
+
+		/**
+		 * Encodes the specified string using numeric entities. The core entities will be
+		 * encoded as named ones but all non lower ascii characters will be encoded into numeric entities.
+		 *
+		 * @method encodeNumeric
+		 * @param {String} text Text to encode.
+		 * @param {Boolean} attr Optional flag to specify if the text is attribute contents.
+		 * @return {String} Entity encoded text.
+		 */
+		encodeNumeric: function(text, attr) {
+			return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) {
+				// Multi byte sequence convert it to a single entity
+				if (chr.length > 1) {
+					return '&#' + (((chr.charCodeAt(0) - 0xD800) * 0x400) + (chr.charCodeAt(1) - 0xDC00) + 0x10000) + ';';
+				}
+
+				return baseEntities[chr] || '&#' + chr.charCodeAt(0) + ';';
+			});
+		},
+
+		/**
+		 * Encodes the specified string using named entities. The core entities will be encoded
+		 * as named ones but all non lower ascii characters will be encoded into named entities.
+		 *
+		 * @method encodeNamed
+		 * @param {String} text Text to encode.
+		 * @param {Boolean} attr Optional flag to specify if the text is attribute contents.
+		 * @param {Object} entities Optional parameter with entities to use.
+		 * @return {String} Entity encoded text.
+		 */
+		encodeNamed: function(text, attr, entities) {
+			entities = entities || namedEntities;
+
+			return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) {
+				return baseEntities[chr] || entities[chr] || chr;
+			});
+		},
+
+		/**
+		 * Returns an encode function based on the name(s) and it's optional entities.
+		 *
+		 * @method getEncodeFunc
+		 * @param {String} name Comma separated list of encoders for example named,numeric.
+		 * @param {String} entities Optional parameter with entities to use instead of the built in set.
+		 * @return {function} Encode function to be used.
+		 */
+		getEncodeFunc: function(name, entities) {
+			entities = buildEntitiesLookup(entities) || namedEntities;
+
+			function encodeNamedAndNumeric(text, attr) {
+				return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) {
+					return baseEntities[chr] || entities[chr] || '&#' + chr.charCodeAt(0) + ';' || chr;
+				});
+			}
+
+			function encodeCustomNamed(text, attr) {
+				return Entities.encodeNamed(text, attr, entities);
+			}
+
+			// Replace + with , to be compatible with previous TinyMCE versions
+			name = makeMap(name.replace(/\+/g, ','));
+
+			// Named and numeric encoder
+			if (name.named && name.numeric) {
+				return encodeNamedAndNumeric;
+			}
+
+			// Named encoder
+			if (name.named) {
+				// Custom names
+				if (entities) {
+					return encodeCustomNamed;
+				}
+
+				return Entities.encodeNamed;
+			}
+
+			// Numeric
+			if (name.numeric) {
+				return Entities.encodeNumeric;
+			}
+
+			// Raw encoder
+			return Entities.encodeRaw;
+		},
+
+		/**
+		 * Decodes the specified string, this will replace entities with raw UTF characters.
+		 *
+		 * @method decode
+		 * @param {String} text Text to entity decode.
+		 * @return {String} Entity decoded string.
+		 */
+		decode: function(text) {
+			return text.replace(entityRegExp, function(all, numeric) {
+				if (numeric) {
+					if (numeric.charAt(0).toLowerCase() === 'x') {
+						numeric = parseInt(numeric.substr(1), 16);
+					} else {
+						numeric = parseInt(numeric, 10);
+					}
+
+					// Support upper UTF
+					if (numeric > 0xFFFF) {
+						numeric -= 0x10000;
+
+						return String.fromCharCode(0xD800 + (numeric >> 10), 0xDC00 + (numeric & 0x3FF));
+					} else {
+						return asciiMap[numeric] || String.fromCharCode(numeric);
+					}
+				}
+
+				return reverseEntities[all] || namedEntities[all] || nativeDecode(all);
+			});
+		}
+	};
+
+	return Entities;
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/Node.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,496 @@
+/**
+ * Node.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is a minimalistic implementation of a DOM like node used by the DomParser class.
+ *
+ * @example
+ * var node = new tinymce.html.Node('strong', 1);
+ * someRoot.append(node);
+ *
+ * @class tinymce.html.Node
+ * @version 3.4
+ */
+define("tinymce/html/Node", [], function() {
+	var whiteSpaceRegExp = /^[ \t\r\n]*$/, typeLookup = {
+		'#text': 3,
+		'#comment': 8,
+		'#cdata': 4,
+		'#pi': 7,
+		'#doctype': 10,
+		'#document-fragment': 11
+	};
+
+	// Walks the tree left/right
+	function walk(node, root_node, prev) {
+		var sibling, parent, startName = prev ? 'lastChild' : 'firstChild', siblingName = prev ? 'prev' : 'next';
+
+		// Walk into nodes if it has a start
+		if (node[startName]) {
+			return node[startName];
+		}
+
+		// Return the sibling if it has one
+		if (node !== root_node) {
+			sibling = node[siblingName];
+
+			if (sibling) {
+				return sibling;
+			}
+
+			// Walk up the parents to look for siblings
+			for (parent = node.parent; parent && parent !== root_node; parent = parent.parent) {
+				sibling = parent[siblingName];
+
+				if (sibling) {
+					return sibling;
+				}
+			}
+		}
+	}
+
+	/**
+	 * Constructs a new Node instance.
+	 *
+	 * @constructor
+	 * @method Node
+	 * @param {String} name Name of the node type.
+	 * @param {Number} type Numeric type representing the node.
+	 */
+	function Node(name, type) {
+		this.name = name;
+		this.type = type;
+
+		if (type === 1) {
+			this.attributes = [];
+			this.attributes.map = {};
+		}
+	}
+
+	Node.prototype = {
+		/**
+		 * Replaces the current node with the specified one.
+		 *
+		 * @example
+		 * someNode.replace(someNewNode);
+		 *
+		 * @method replace
+		 * @param {tinymce.html.Node} node Node to replace the current node with.
+		 * @return {tinymce.html.Node} The old node that got replaced.
+		 */
+		replace: function(node) {
+			var self = this;
+
+			if (node.parent) {
+				node.remove();
+			}
+
+			self.insert(node, self);
+			self.remove();
+
+			return self;
+		},
+
+		/**
+		 * Gets/sets or removes an attribute by name.
+		 *
+		 * @example
+		 * someNode.attr("name", "value"); // Sets an attribute
+		 * console.log(someNode.attr("name")); // Gets an attribute
+		 * someNode.attr("name", null); // Removes an attribute
+		 *
+		 * @method attr
+		 * @param {String} name Attribute name to set or get.
+		 * @param {String} value Optional value to set.
+		 * @return {String/tinymce.html.Node} String or undefined on a get operation or the current node on a set operation.
+		 */
+		attr: function(name, value) {
+			var self = this, attrs, i, undef;
+
+			if (typeof name !== "string") {
+				for (i in name) {
+					self.attr(i, name[i]);
+				}
+
+				return self;
+			}
+
+			if ((attrs = self.attributes)) {
+				if (value !== undef) {
+					// Remove attribute
+					if (value === null) {
+						if (name in attrs.map) {
+							delete attrs.map[name];
+
+							i = attrs.length;
+							while (i--) {
+								if (attrs[i].name === name) {
+									attrs = attrs.splice(i, 1);
+									return self;
+								}
+							}
+						}
+
+						return self;
+					}
+
+					// Set attribute
+					if (name in attrs.map) {
+						// Set attribute
+						i = attrs.length;
+						while (i--) {
+							if (attrs[i].name === name) {
+								attrs[i].value = value;
+								break;
+							}
+						}
+					} else {
+						attrs.push({name: name, value: value});
+					}
+
+					attrs.map[name] = value;
+
+					return self;
+				} else {
+					return attrs.map[name];
+				}
+			}
+		},
+
+		/**
+		 * Does a shallow clones the node into a new node. It will also exclude id attributes since
+		 * there should only be one id per document.
+		 *
+		 * @example
+		 * var clonedNode = node.clone();
+		 *
+		 * @method clone
+		 * @return {tinymce.html.Node} New copy of the original node.
+		 */
+		clone: function() {
+			var self = this, clone = new Node(self.name, self.type), i, l, selfAttrs, selfAttr, cloneAttrs;
+
+			// Clone element attributes
+			if ((selfAttrs = self.attributes)) {
+				cloneAttrs = [];
+				cloneAttrs.map = {};
+
+				for (i = 0, l = selfAttrs.length; i < l; i++) {
+					selfAttr = selfAttrs[i];
+
+					// Clone everything except id
+					if (selfAttr.name !== 'id') {
+						cloneAttrs[cloneAttrs.length] = {name: selfAttr.name, value: selfAttr.value};
+						cloneAttrs.map[selfAttr.name] = selfAttr.value;
+					}
+				}
+
+				clone.attributes = cloneAttrs;
+			}
+
+			clone.value = self.value;
+			clone.shortEnded = self.shortEnded;
+
+			return clone;
+		},
+
+		/**
+		 * Wraps the node in in another node.
+		 *
+		 * @example
+		 * node.wrap(wrapperNode);
+		 *
+		 * @method wrap
+		 */
+		wrap: function(wrapper) {
+			var self = this;
+
+			self.parent.insert(wrapper, self);
+			wrapper.append(self);
+
+			return self;
+		},
+
+		/**
+		 * Unwraps the node in other words it removes the node but keeps the children.
+		 *
+		 * @example
+		 * node.unwrap();
+		 *
+		 * @method unwrap
+		 */
+		unwrap: function() {
+			var self = this, node, next;
+
+			for (node = self.firstChild; node;) {
+				next = node.next;
+				self.insert(node, self, true);
+				node = next;
+			}
+
+			self.remove();
+		},
+
+		/**
+		 * Removes the node from it's parent.
+		 *
+		 * @example
+		 * node.remove();
+		 *
+		 * @method remove
+		 * @return {tinymce.html.Node} Current node that got removed.
+		 */
+		remove: function() {
+			var self = this, parent = self.parent, next = self.next, prev = self.prev;
+
+			if (parent) {
+				if (parent.firstChild === self) {
+					parent.firstChild = next;
+
+					if (next) {
+						next.prev = null;
+					}
+				} else {
+					prev.next = next;
+				}
+
+				if (parent.lastChild === self) {
+					parent.lastChild = prev;
+
+					if (prev) {
+						prev.next = null;
+					}
+				} else {
+					next.prev = prev;
+				}
+
+				self.parent = self.next = self.prev = null;
+			}
+
+			return self;
+		},
+
+		/**
+		 * Appends a new node as a child of the current node.
+		 *
+		 * @example
+		 * node.append(someNode);
+		 *
+		 * @method append
+		 * @param {tinymce.html.Node} node Node to append as a child of the current one.
+		 * @return {tinymce.html.Node} The node that got appended.
+		 */
+		append: function(node) {
+			var self = this, last;
+
+			if (node.parent) {
+				node.remove();
+			}
+
+			last = self.lastChild;
+			if (last) {
+				last.next = node;
+				node.prev = last;
+				self.lastChild = node;
+			} else {
+				self.lastChild = self.firstChild = node;
+			}
+
+			node.parent = self;
+
+			return node;
+		},
+
+		/**
+		 * Inserts a node at a specific position as a child of the current node.
+		 *
+		 * @example
+		 * parentNode.insert(newChildNode, oldChildNode);
+		 *
+		 * @method insert
+		 * @param {tinymce.html.Node} node Node to insert as a child of the current node.
+		 * @param {tinymce.html.Node} ref_node Reference node to set node before/after.
+		 * @param {Boolean} before Optional state to insert the node before the reference node.
+		 * @return {tinymce.html.Node} The node that got inserted.
+		 */
+		insert: function(node, ref_node, before) {
+			var parent;
+
+			if (node.parent) {
+				node.remove();
+			}
+
+			parent = ref_node.parent || this;
+
+			if (before) {
+				if (ref_node === parent.firstChild) {
+					parent.firstChild = node;
+				} else {
+					ref_node.prev.next = node;
+				}
+
+				node.prev = ref_node.prev;
+				node.next = ref_node;
+				ref_node.prev = node;
+			} else {
+				if (ref_node === parent.lastChild) {
+					parent.lastChild = node;
+				} else {
+					ref_node.next.prev = node;
+				}
+
+				node.next = ref_node.next;
+				node.prev = ref_node;
+				ref_node.next = node;
+			}
+
+			node.parent = parent;
+
+			return node;
+		},
+
+		/**
+		 * Get all children by name.
+		 *
+		 * @method getAll
+		 * @param {String} name Name of the child nodes to collect.
+		 * @return {Array} Array with child nodes matchin the specified name.
+		 */
+		getAll: function(name) {
+			var self = this, node, collection = [];
+
+			for (node = self.firstChild; node; node = walk(node, self)) {
+				if (node.name === name) {
+					collection.push(node);
+				}
+			}
+
+			return collection;
+		},
+
+		/**
+		 * Removes all children of the current node.
+		 *
+		 * @method empty
+		 * @return {tinymce.html.Node} The current node that got cleared.
+		 */
+		empty: function() {
+			var self = this, nodes, i, node;
+
+			// Remove all children
+			if (self.firstChild) {
+				nodes = [];
+
+				// Collect the children
+				for (node = self.firstChild; node; node = walk(node, self)) {
+					nodes.push(node);
+				}
+
+				// Remove the children
+				i = nodes.length;
+				while (i--) {
+					node = nodes[i];
+					node.parent = node.firstChild = node.lastChild = node.next = node.prev = null;
+				}
+			}
+
+			self.firstChild = self.lastChild = null;
+
+			return self;
+		},
+
+		/**
+		 * Returns true/false if the node is to be considered empty or not.
+		 *
+		 * @example
+		 * node.isEmpty({img: true});
+		 * @method isEmpty
+		 * @param {Object} elements Name/value object with elements that are automatically treated as non empty elements.
+		 * @return {Boolean} true/false if the node is empty or not.
+		 */
+		isEmpty: function(elements) {
+			var self = this, node = self.firstChild, i, name;
+
+			if (node) {
+				do {
+					if (node.type === 1) {
+						// Ignore bogus elements
+						if (node.attributes.map['data-mce-bogus']) {
+							continue;
+						}
+
+						// Keep empty elements like <img />
+						if (elements[node.name]) {
+							return false;
+						}
+
+						// Keep bookmark nodes and name attribute like <a name="1"></a>
+						i = node.attributes.length;
+						while (i--) {
+							name = node.attributes[i].name;
+							if (name === "name" || name.indexOf('data-mce-bookmark') === 0) {
+								return false;
+							}
+						}
+					}
+
+					// Keep comments
+					if (node.type === 8) {
+						return false;
+					}
+
+					// Keep non whitespace text nodes
+					if ((node.type === 3 && !whiteSpaceRegExp.test(node.value))) {
+						return false;
+					}
+				} while ((node = walk(node, self)));
+			}
+
+			return true;
+		},
+
+		/**
+		 * Walks to the next or previous node and returns that node or null if it wasn't found.
+		 *
+		 * @method walk
+		 * @param {Boolean} prev Optional previous node state defaults to false.
+		 * @return {tinymce.html.Node} Node that is next to or previous of the current node.
+		 */
+		walk: function(prev) {
+			return walk(this, null, prev);
+		}
+	};
+
+	/**
+	 * Creates a node of a specific type.
+	 *
+	 * @static
+	 * @method create
+	 * @param {String} name Name of the node type to create for example "b" or "#text".
+	 * @param {Object} attrs Name/value collection of attributes that will be applied to elements.
+	 */
+	Node.create = function(name, attrs) {
+		var node, attrName;
+
+		// Create node
+		node = new Node(name, typeLookup[name] || 1);
+
+		// Add attributes if needed
+		if (attrs) {
+			for (attrName in attrs) {
+				node.attr(attrName, attrs[attrName]);
+			}
+		}
+
+		return node;
+	};
+
+	return Node;
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/SaxParser.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,474 @@
+/**
+ * SaxParser.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*eslint max-depth:[2, 9] */
+
+/**
+ * This class parses HTML code using pure JavaScript and executes various events for each item it finds. It will
+ * always execute the events in the right order for tag soup code like <b><p></b></p>. It will also remove elements
+ * and attributes that doesn't fit the schema if the validate setting is enabled.
+ *
+ * @example
+ * var parser = new tinymce.html.SaxParser({
+ *     validate: true,
+ *
+ *     comment: function(text) {
+ *         console.log('Comment:', text);
+ *     },
+ *
+ *     cdata: function(text) {
+ *         console.log('CDATA:', text);
+ *     },
+ *
+ *     text: function(text, raw) {
+ *         console.log('Text:', text, 'Raw:', raw);
+ *     },
+ *
+ *     start: function(name, attrs, empty) {
+ *         console.log('Start:', name, attrs, empty);
+ *     },
+ *
+ *     end: function(name) {
+ *         console.log('End:', name);
+ *     },
+ *
+ *     pi: function(name, text) {
+ *         console.log('PI:', name, text);
+ *     },
+ *
+ *     doctype: function(text) {
+ *         console.log('DocType:', text);
+ *     }
+ * }, schema);
+ * @class tinymce.html.SaxParser
+ * @version 3.4
+ */
+define("tinymce/html/SaxParser", [
+	"tinymce/html/Schema",
+	"tinymce/html/Entities",
+	"tinymce/util/Tools"
+], function(Schema, Entities, Tools) {
+	var each = Tools.each;
+
+	/**
+	 * Returns the index of the end tag for a specific start tag. This can be
+	 * used to skip all children of a parent element from being processed.
+	 *
+	 * @private
+	 * @method findEndTag
+	 * @param {tinymce.html.Schema} schema Schema instance to use to match short ended elements.
+	 * @param {String} html HTML string to find the end tag in.
+	 * @param {Number} startIndex Indext to start searching at should be after the start tag.
+	 * @return {Number} Index of the end tag.
+	 */
+	function findEndTag(schema, html, startIndex) {
+		var count = 1, index, matches, tokenRegExp, shortEndedElements;
+
+		shortEndedElements = schema.getShortEndedElements();
+		tokenRegExp = /<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g;
+		tokenRegExp.lastIndex = index = startIndex;
+
+		while ((matches = tokenRegExp.exec(html))) {
+			index = tokenRegExp.lastIndex;
+
+			if (matches[1] === '/') { // End element
+				count--;
+			} else if (!matches[1]) { // Start element
+				if (matches[2] in shortEndedElements) {
+					continue;
+				}
+
+				count++;
+			}
+
+			if (count === 0) {
+				break;
+			}
+		}
+
+		return index;
+	}
+
+	/**
+	 * Constructs a new SaxParser instance.
+	 *
+	 * @constructor
+	 * @method SaxParser
+	 * @param {Object} settings Name/value collection of settings. comment, cdata, text, start and end are callbacks.
+	 * @param {tinymce.html.Schema} schema HTML Schema class to use when parsing.
+	 */
+	function SaxParser(settings, schema) {
+		var self = this;
+
+		function noop() {}
+
+		settings = settings || {};
+		self.schema = schema = schema || new Schema();
+
+		if (settings.fix_self_closing !== false) {
+			settings.fix_self_closing = true;
+		}
+
+		// Add handler functions from settings and setup default handlers
+		each('comment cdata text start end pi doctype'.split(' '), function(name) {
+			if (name) {
+				self[name] = settings[name] || noop;
+			}
+		});
+
+		/**
+		 * Parses the specified HTML string and executes the callbacks for each item it finds.
+		 *
+		 * @example
+		 * new SaxParser({...}).parse('<b>text</b>');
+		 * @method parse
+		 * @param {String} html Html string to sax parse.
+		 */
+		self.parse = function(html) {
+			var self = this, matches, index = 0, value, endRegExp, stack = [], attrList, i, text, name;
+			var isInternalElement, removeInternalElements, shortEndedElements, fillAttrsMap, isShortEnded;
+			var validate, elementRule, isValidElement, attr, attribsValue, validAttributesMap, validAttributePatterns;
+			var attributesRequired, attributesDefault, attributesForced;
+			var anyAttributesRequired, selfClosing, tokenRegExp, attrRegExp, specialElements, attrValue, idCount = 0;
+			var decode = Entities.decode, fixSelfClosing, filteredUrlAttrs = Tools.makeMap('src,href,data,background,formaction,poster');
+			var scriptUriRegExp = /((java|vb)script|mhtml):/i, dataUriRegExp = /^data:/i;
+
+			function processEndTag(name) {
+				var pos, i;
+
+				// Find position of parent of the same type
+				pos = stack.length;
+				while (pos--) {
+					if (stack[pos].name === name) {
+						break;
+					}
+				}
+
+				// Found parent
+				if (pos >= 0) {
+					// Close all the open elements
+					for (i = stack.length - 1; i >= pos; i--) {
+						name = stack[i];
+
+						if (name.valid) {
+							self.end(name.name);
+						}
+					}
+
+					// Remove the open elements from the stack
+					stack.length = pos;
+				}
+			}
+
+			function parseAttribute(match, name, value, val2, val3) {
+				var attrRule, i, trimRegExp = /[\s\u0000-\u001F]+/g;
+
+				name = name.toLowerCase();
+				value = name in fillAttrsMap ? name : decode(value || val2 || val3 || ''); // Handle boolean attribute than value attribute
+
+				// Validate name and value pass through all data- attributes
+				if (validate && !isInternalElement && name.indexOf('data-') !== 0) {
+					attrRule = validAttributesMap[name];
+
+					// Find rule by pattern matching
+					if (!attrRule && validAttributePatterns) {
+						i = validAttributePatterns.length;
+						while (i--) {
+							attrRule = validAttributePatterns[i];
+							if (attrRule.pattern.test(name)) {
+								break;
+							}
+						}
+
+						// No rule matched
+						if (i === -1) {
+							attrRule = null;
+						}
+					}
+
+					// No attribute rule found
+					if (!attrRule) {
+						return;
+					}
+
+					// Validate value
+					if (attrRule.validValues && !(value in attrRule.validValues)) {
+						return;
+					}
+				}
+
+				// Block any javascript: urls or non image data uris
+				if (filteredUrlAttrs[name] && !settings.allow_script_urls) {
+					var uri = value.replace(trimRegExp, '');
+
+					try {
+						// Might throw malformed URI sequence
+						uri = decodeURIComponent(uri);
+					} catch (ex) {
+						// Fallback to non UTF-8 decoder
+						uri = unescape(uri);
+					}
+
+					if (scriptUriRegExp.test(uri)) {
+						return;
+					}
+
+					if (!settings.allow_html_data_urls && dataUriRegExp.test(uri) && !/^data:image\//i.test(uri)) {
+						return;
+					}
+				}
+
+				// Add attribute to list and map
+				attrList.map[name] = value;
+				attrList.push({
+					name: name,
+					value: value
+				});
+			}
+
+			// Precompile RegExps and map objects
+			tokenRegExp = new RegExp('<(?:' +
+				'(?:!--([\\w\\W]*?)-->)|' + // Comment
+				'(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|' + // CDATA
+				'(?:!DOCTYPE([\\w\\W]*?)>)|' + // DOCTYPE
+				'(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|' + // PI
+				'(?:\\/([^>]+)>)|' + // End element
+				'(?:([A-Za-z0-9\\-_\\:\\.]+)((?:\\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\\/|\\s+)>)' + // Start element
+			')', 'g');
+
+			attrRegExp = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g;
+
+			// Setup lookup tables for empty elements and boolean attributes
+			shortEndedElements = schema.getShortEndedElements();
+			selfClosing = settings.self_closing_elements || schema.getSelfClosingElements();
+			fillAttrsMap = schema.getBoolAttrs();
+			validate = settings.validate;
+			removeInternalElements = settings.remove_internals;
+			fixSelfClosing = settings.fix_self_closing;
+			specialElements = schema.getSpecialElements();
+
+			while ((matches = tokenRegExp.exec(html))) {
+				// Text
+				if (index < matches.index) {
+					self.text(decode(html.substr(index, matches.index - index)));
+				}
+
+				if ((value = matches[6])) { // End element
+					value = value.toLowerCase();
+
+					// IE will add a ":" in front of elements it doesn't understand like custom elements or HTML5 elements
+					if (value.charAt(0) === ':') {
+						value = value.substr(1);
+					}
+
+					processEndTag(value);
+				} else if ((value = matches[7])) { // Start element
+					value = value.toLowerCase();
+
+					// IE will add a ":" in front of elements it doesn't understand like custom elements or HTML5 elements
+					if (value.charAt(0) === ':') {
+						value = value.substr(1);
+					}
+
+					isShortEnded = value in shortEndedElements;
+
+					// Is self closing tag for example an <li> after an open <li>
+					if (fixSelfClosing && selfClosing[value] && stack.length > 0 && stack[stack.length - 1].name === value) {
+						processEndTag(value);
+					}
+
+					// Validate element
+					if (!validate || (elementRule = schema.getElementRule(value))) {
+						isValidElement = true;
+
+						// Grab attributes map and patters when validation is enabled
+						if (validate) {
+							validAttributesMap = elementRule.attributes;
+							validAttributePatterns = elementRule.attributePatterns;
+						}
+
+						// Parse attributes
+						if ((attribsValue = matches[8])) {
+							isInternalElement = attribsValue.indexOf('data-mce-type') !== -1; // Check if the element is an internal element
+
+							// If the element has internal attributes then remove it if we are told to do so
+							if (isInternalElement && removeInternalElements) {
+								isValidElement = false;
+							}
+
+							attrList = [];
+							attrList.map = {};
+
+							attribsValue.replace(attrRegExp, parseAttribute);
+						} else {
+							attrList = [];
+							attrList.map = {};
+						}
+
+						// Process attributes if validation is enabled
+						if (validate && !isInternalElement) {
+							attributesRequired = elementRule.attributesRequired;
+							attributesDefault = elementRule.attributesDefault;
+							attributesForced = elementRule.attributesForced;
+							anyAttributesRequired = elementRule.removeEmptyAttrs;
+
+							// Check if any attribute exists
+							if (anyAttributesRequired && !attrList.length) {
+								isValidElement = false;
+							}
+
+							// Handle forced attributes
+							if (attributesForced) {
+								i = attributesForced.length;
+								while (i--) {
+									attr = attributesForced[i];
+									name = attr.name;
+									attrValue = attr.value;
+
+									if (attrValue === '{$uid}') {
+										attrValue = 'mce_' + idCount++;
+									}
+
+									attrList.map[name] = attrValue;
+									attrList.push({name: name, value: attrValue});
+								}
+							}
+
+							// Handle default attributes
+							if (attributesDefault) {
+								i = attributesDefault.length;
+								while (i--) {
+									attr = attributesDefault[i];
+									name = attr.name;
+
+									if (!(name in attrList.map)) {
+										attrValue = attr.value;
+
+										if (attrValue === '{$uid}') {
+											attrValue = 'mce_' + idCount++;
+										}
+
+										attrList.map[name] = attrValue;
+										attrList.push({name: name, value: attrValue});
+									}
+								}
+							}
+
+							// Handle required attributes
+							if (attributesRequired) {
+								i = attributesRequired.length;
+								while (i--) {
+									if (attributesRequired[i] in attrList.map) {
+										break;
+									}
+								}
+
+								// None of the required attributes where found
+								if (i === -1) {
+									isValidElement = false;
+								}
+							}
+
+							// Invalidate element if it's marked as bogus
+							if ((attr = attrList.map['data-mce-bogus'])) {
+								if (attr === 'all') {
+									index = findEndTag(schema, html, tokenRegExp.lastIndex);
+									tokenRegExp.lastIndex = index;
+									continue;
+								}
+
+								isValidElement = false;
+							}
+						}
+
+						if (isValidElement) {
+							self.start(value, attrList, isShortEnded);
+						}
+					} else {
+						isValidElement = false;
+					}
+
+					// Treat script, noscript and style a bit different since they may include code that looks like elements
+					if ((endRegExp = specialElements[value])) {
+						endRegExp.lastIndex = index = matches.index + matches[0].length;
+
+						if ((matches = endRegExp.exec(html))) {
+							if (isValidElement) {
+								text = html.substr(index, matches.index - index);
+							}
+
+							index = matches.index + matches[0].length;
+						} else {
+							text = html.substr(index);
+							index = html.length;
+						}
+
+						if (isValidElement) {
+							if (text.length > 0) {
+								self.text(text, true);
+							}
+
+							self.end(value);
+						}
+
+						tokenRegExp.lastIndex = index;
+						continue;
+					}
+
+					// Push value on to stack
+					if (!isShortEnded) {
+						if (!attribsValue || attribsValue.indexOf('/') != attribsValue.length - 1) {
+							stack.push({name: value, valid: isValidElement});
+						} else if (isValidElement) {
+							self.end(value);
+						}
+					}
+				} else if ((value = matches[1])) { // Comment
+					// Padd comment value to avoid browsers from parsing invalid comments as HTML
+					if (value.charAt(0) === '>') {
+						value = ' ' + value;
+					}
+
+					if (!settings.allow_conditional_comments && value.substr(0, 3) === '[if') {
+						value = ' ' + value;
+					}
+
+					self.comment(value);
+				} else if ((value = matches[2])) { // CDATA
+					self.cdata(value);
+				} else if ((value = matches[3])) { // DOCTYPE
+					self.doctype(value);
+				} else if ((value = matches[4])) { // PI
+					self.pi(value, matches[5]);
+				}
+
+				index = matches.index + matches[0].length;
+			}
+
+			// Text
+			if (index < html.length) {
+				self.text(decode(html.substr(index)));
+			}
+
+			// Close any open elements
+			for (i = stack.length - 1; i >= 0; i--) {
+				value = stack[i];
+
+				if (value.valid) {
+					self.end(value.name);
+				}
+			}
+		};
+	}
+
+	SaxParser.findEndTag = findEndTag;
+
+	return SaxParser;
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/Schema.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1002 @@
+/**
+ * Schema.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Schema validator class.
+ *
+ * @class tinymce.html.Schema
+ * @example
+ *  if (tinymce.activeEditor.schema.isValidChild('p', 'span'))
+ *    alert('span is valid child of p.');
+ *
+ *  if (tinymce.activeEditor.schema.getElementRule('p'))
+ *    alert('P is a valid element.');
+ *
+ * @class tinymce.html.Schema
+ * @version 3.4
+ */
+define("tinymce/html/Schema", [
+	"tinymce/util/Tools"
+], function(Tools) {
+	var mapCache = {}, dummyObj = {};
+	var makeMap = Tools.makeMap, each = Tools.each, extend = Tools.extend, explode = Tools.explode, inArray = Tools.inArray;
+
+	function split(items, delim) {
+		return items ? items.split(delim || ' ') : [];
+	}
+
+	/**
+	 * Builds a schema lookup table
+	 *
+	 * @private
+	 * @param {String} type html4, html5 or html5-strict schema type.
+	 * @return {Object} Schema lookup table.
+	 */
+	function compileSchema(type) {
+		var schema = {}, globalAttributes, blockContent;
+		var phrasingContent, flowContent, html4BlockContent, html4PhrasingContent;
+
+		function add(name, attributes, children) {
+			var ni, i, attributesOrder, args = arguments;
+
+			function arrayToMap(array, obj) {
+				var map = {}, i, l;
+
+				for (i = 0, l = array.length; i < l; i++) {
+					map[array[i]] = obj || {};
+				}
+
+				return map;
+			}
+
+			children = children || [];
+			attributes = attributes || "";
+
+			if (typeof children === "string") {
+				children = split(children);
+			}
+
+			// Split string children
+			for (i = 3; i < args.length; i++) {
+				if (typeof args[i] === "string") {
+					args[i] = split(args[i]);
+				}
+
+				children.push.apply(children, args[i]);
+			}
+
+			name = split(name);
+			ni = name.length;
+			while (ni--) {
+				attributesOrder = [].concat(globalAttributes, split(attributes));
+				schema[name[ni]] = {
+					attributes: arrayToMap(attributesOrder),
+					attributesOrder: attributesOrder,
+					children: arrayToMap(children, dummyObj)
+				};
+			}
+		}
+
+		function addAttrs(name, attributes) {
+			var ni, schemaItem, i, l;
+
+			name = split(name);
+			ni = name.length;
+			attributes = split(attributes);
+			while (ni--) {
+				schemaItem = schema[name[ni]];
+				for (i = 0, l = attributes.length; i < l; i++) {
+					schemaItem.attributes[attributes[i]] = {};
+					schemaItem.attributesOrder.push(attributes[i]);
+				}
+			}
+		}
+
+		// Use cached schema
+		if (mapCache[type]) {
+			return mapCache[type];
+		}
+
+		// Attributes present on all elements
+		globalAttributes = split("id accesskey class dir lang style tabindex title");
+
+		// Event attributes can be opt-in/opt-out
+		/*eventAttributes = split("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"
+		);*/
+
+		// Block content elements
+		blockContent = split(
+			"address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul"
+		);
+
+		// Phrasing content elements from the HTML5 spec (inline)
+		phrasingContent = split(
+			"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"
+		);
+
+		// Add HTML5 items to globalAttributes, blockContent, phrasingContent
+		if (type != "html4") {
+			globalAttributes.push.apply(globalAttributes, split("contenteditable contextmenu draggable dropzone " +
+				"hidden spellcheck translate"));
+			blockContent.push.apply(blockContent, split("article aside details dialog figure header footer hgroup section nav"));
+			phrasingContent.push.apply(phrasingContent, split("audio canvas command datalist mark meter output progress time wbr " +
+				"video ruby bdi keygen"));
+		}
+
+		// Add HTML4 elements unless it's html5-strict
+		if (type != "html5-strict") {
+			globalAttributes.push("xml:lang");
+
+			html4PhrasingContent = split("acronym applet basefont big font strike tt");
+			phrasingContent.push.apply(phrasingContent, html4PhrasingContent);
+
+			each(html4PhrasingContent, function(name) {
+				add(name, "", phrasingContent);
+			});
+
+			html4BlockContent = split("center dir isindex noframes");
+			blockContent.push.apply(blockContent, html4BlockContent);
+
+			// Flow content elements from the HTML5 spec (block+inline)
+			flowContent = [].concat(blockContent, phrasingContent);
+
+			each(html4BlockContent, function(name) {
+				add(name, "", flowContent);
+			});
+		}
+
+		// Flow content elements from the HTML5 spec (block+inline)
+		flowContent = flowContent || [].concat(blockContent, phrasingContent);
+
+		// HTML4 base schema TODO: Move HTML5 specific attributes to HTML5 specific if statement
+		// Schema items <element name>, <specific attributes>, <children ..>
+		add("html", "manifest", "head body");
+		add("head", "", "base command link meta noscript script style title");
+		add("title hr noscript br");
+		add("base", "href target");
+		add("link", "href rel media hreflang type sizes hreflang");
+		add("meta", "name http-equiv content charset");
+		add("style", "media type scoped");
+		add("script", "src async defer type charset");
+		add("body", "onafterprint onbeforeprint onbeforeunload onblur onerror onfocus " +
+				"onhashchange onload onmessage onoffline ononline onpagehide onpageshow " +
+				"onpopstate onresize onscroll onstorage onunload", flowContent);
+		add("address dt dd div caption", "", flowContent);
+		add("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", "", phrasingContent);
+		add("blockquote", "cite", flowContent);
+		add("ol", "reversed start type", "li");
+		add("ul", "", "li");
+		add("li", "value", flowContent);
+		add("dl", "", "dt dd");
+		add("a", "href target rel media hreflang type", phrasingContent);
+		add("q", "cite", phrasingContent);
+		add("ins del", "cite datetime", flowContent);
+		add("img", "src sizes srcset alt usemap ismap width height");
+		add("iframe", "src name width height", flowContent);
+		add("embed", "src type width height");
+		add("object", "data type typemustmatch name usemap form width height", flowContent, "param");
+		add("param", "name value");
+		add("map", "name", flowContent, "area");
+		add("area", "alt coords shape href target rel media hreflang type");
+		add("table", "border", "caption colgroup thead tfoot tbody tr" + (type == "html4" ? " col" : ""));
+		add("colgroup", "span", "col");
+		add("col", "span");
+		add("tbody thead tfoot", "", "tr");
+		add("tr", "", "td th");
+		add("td", "colspan rowspan headers", flowContent);
+		add("th", "colspan rowspan headers scope abbr", flowContent);
+		add("form", "accept-charset action autocomplete enctype method name novalidate target", flowContent);
+		add("fieldset", "disabled form name", flowContent, "legend");
+		add("label", "form for", phrasingContent);
+		add("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"
+		);
+		add("button", "disabled form formaction formenctype formmethod formnovalidate formtarget name type value",
+			type == "html4" ? flowContent : phrasingContent);
+		add("select", "disabled form multiple name required size", "option optgroup");
+		add("optgroup", "disabled label", "option");
+		add("option", "disabled label selected value");
+		add("textarea", "cols dirname disabled form maxlength name readonly required rows wrap");
+		add("menu", "type label", flowContent, "li");
+		add("noscript", "", flowContent);
+
+		// Extend with HTML5 elements
+		if (type != "html4") {
+			add("wbr");
+			add("ruby", "", phrasingContent, "rt rp");
+			add("figcaption", "", flowContent);
+			add("mark rt rp summary bdi", "", phrasingContent);
+			add("canvas", "width height", flowContent);
+			add("video", "src crossorigin poster preload autoplay mediagroup loop " +
+				"muted controls width height buffered", flowContent, "track source");
+			add("audio", "src crossorigin preload autoplay mediagroup loop muted controls buffered volume", flowContent, "track source");
+			add("picture", "", "img source");
+			add("source", "src srcset type media sizes");
+			add("track", "kind src srclang label default");
+			add("datalist", "", phrasingContent, "option");
+			add("article section nav aside header footer", "", flowContent);
+			add("hgroup", "", "h1 h2 h3 h4 h5 h6");
+			add("figure", "", flowContent, "figcaption");
+			add("time", "datetime", phrasingContent);
+			add("dialog", "open", flowContent);
+			add("command", "type label icon disabled checked radiogroup command");
+			add("output", "for form name", phrasingContent);
+			add("progress", "value max", phrasingContent);
+			add("meter", "value min max low high optimum", phrasingContent);
+			add("details", "open", flowContent, "summary");
+			add("keygen", "autofocus challenge disabled form keytype name");
+		}
+
+		// Extend with HTML4 attributes unless it's html5-strict
+		if (type != "html5-strict") {
+			addAttrs("script", "language xml:space");
+			addAttrs("style", "xml:space");
+			addAttrs("object", "declare classid code codebase codetype archive standby align border hspace vspace");
+			addAttrs("embed", "align name hspace vspace");
+			addAttrs("param", "valuetype type");
+			addAttrs("a", "charset name rev shape coords");
+			addAttrs("br", "clear");
+			addAttrs("applet", "codebase archive code object alt name width height align hspace vspace");
+			addAttrs("img", "name longdesc align border hspace vspace");
+			addAttrs("iframe", "longdesc frameborder marginwidth marginheight scrolling align");
+			addAttrs("font basefont", "size color face");
+			addAttrs("input", "usemap align");
+			addAttrs("select", "onchange");
+			addAttrs("textarea");
+			addAttrs("h1 h2 h3 h4 h5 h6 div p legend caption", "align");
+			addAttrs("ul", "type compact");
+			addAttrs("li", "type");
+			addAttrs("ol dl menu dir", "compact");
+			addAttrs("pre", "width xml:space");
+			addAttrs("hr", "align noshade size width");
+			addAttrs("isindex", "prompt");
+			addAttrs("table", "summary width frame rules cellspacing cellpadding align bgcolor");
+			addAttrs("col", "width align char charoff valign");
+			addAttrs("colgroup", "width align char charoff valign");
+			addAttrs("thead", "align char charoff valign");
+			addAttrs("tr", "align char charoff valign bgcolor");
+			addAttrs("th", "axis align char charoff valign nowrap bgcolor width height");
+			addAttrs("form", "accept");
+			addAttrs("td", "abbr axis scope align char charoff valign nowrap bgcolor width height");
+			addAttrs("tfoot", "align char charoff valign");
+			addAttrs("tbody", "align char charoff valign");
+			addAttrs("area", "nohref");
+			addAttrs("body", "background bgcolor text link vlink alink");
+		}
+
+		// Extend with HTML5 attributes unless it's html4
+		if (type != "html4") {
+			addAttrs("input button select textarea", "autofocus");
+			addAttrs("input textarea", "placeholder");
+			addAttrs("a", "download");
+			addAttrs("link script img", "crossorigin");
+			addAttrs("iframe", "sandbox seamless allowfullscreen"); // Excluded: srcdoc
+		}
+
+		// Special: iframe, ruby, video, audio, label
+
+		// Delete children of the same name from it's parent
+		// For example: form can't have a child of the name form
+		each(split('a form meter progress dfn'), function(name) {
+			if (schema[name]) {
+				delete schema[name].children[name];
+			}
+		});
+
+		// Delete header, footer, sectioning and heading content descendants
+		/*each('dt th address', function(name) {
+			delete schema[name].children[name];
+		});*/
+
+		// Caption can't have tables
+		delete schema.caption.children.table;
+
+		// TODO: LI:s can only have value if parent is OL
+
+		// TODO: Handle transparent elements
+		// a ins del canvas map
+
+		mapCache[type] = schema;
+
+		return schema;
+	}
+
+	function compileElementMap(value, mode) {
+		var styles;
+
+		if (value) {
+			styles = {};
+
+			if (typeof value == 'string') {
+				value = {
+					'*': value
+				};
+			}
+
+			// Convert styles into a rule list
+			each(value, function(value, key) {
+				styles[key] = styles[key.toUpperCase()] = mode == 'map' ? makeMap(value, /[, ]/) : explode(value, /[, ]/);
+			});
+		}
+
+		return styles;
+	}
+
+	/**
+	 * Constructs a new Schema instance.
+	 *
+	 * @constructor
+	 * @method Schema
+	 * @param {Object} settings Name/value settings object.
+	 */
+	return function(settings) {
+		var self = this, elements = {}, children = {}, patternElements = [], validStyles, invalidStyles, schemaItems;
+		var whiteSpaceElementsMap, selfClosingElementsMap, shortEndedElementsMap, boolAttrMap, validClasses;
+		var blockElementsMap, nonEmptyElementsMap, moveCaretBeforeOnEnterElementsMap, textBlockElementsMap, textInlineElementsMap;
+		var customElementsMap = {}, specialElements = {};
+
+		// Creates an lookup table map object for the specified option or the default value
+		function createLookupTable(option, default_value, extendWith) {
+			var value = settings[option];
+
+			if (!value) {
+				// Get cached default map or make it if needed
+				value = mapCache[option];
+
+				if (!value) {
+					value = makeMap(default_value, ' ', makeMap(default_value.toUpperCase(), ' '));
+					value = extend(value, extendWith);
+
+					mapCache[option] = value;
+				}
+			} else {
+				// Create custom map
+				value = makeMap(value, /[, ]/, makeMap(value.toUpperCase(), /[, ]/));
+			}
+
+			return value;
+		}
+
+		settings = settings || {};
+		schemaItems = compileSchema(settings.schema);
+
+		// Allow all elements and attributes if verify_html is set to false
+		if (settings.verify_html === false) {
+			settings.valid_elements = '*[*]';
+		}
+
+		validStyles = compileElementMap(settings.valid_styles);
+		invalidStyles = compileElementMap(settings.invalid_styles, 'map');
+		validClasses = compileElementMap(settings.valid_classes, 'map');
+
+		// Setup map objects
+		whiteSpaceElementsMap = createLookupTable('whitespace_elements', 'pre script noscript style textarea video audio iframe object');
+		selfClosingElementsMap = createLookupTable('self_closing_elements', 'colgroup dd dt li option p td tfoot th thead tr');
+		shortEndedElementsMap = createLookupTable('short_ended_elements', 'area base basefont br col frame hr img input isindex link ' +
+			'meta param embed source wbr track');
+		boolAttrMap = createLookupTable('boolean_attributes', 'checked compact declare defer disabled ismap multiple nohref noresize ' +
+			'noshade nowrap readonly selected autoplay loop controls');
+		nonEmptyElementsMap = createLookupTable('non_empty_elements', 'td th iframe video audio object script', shortEndedElementsMap);
+		moveCaretBeforeOnEnterElementsMap = createLookupTable('move_caret_before_on_enter_elements', 'table', nonEmptyElementsMap);
+		textBlockElementsMap = createLookupTable('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');
+		blockElementsMap = createLookupTable('block_elements', 'hr table tbody thead tfoot ' +
+						'th tr td li ol ul caption dl dt dd noscript menu isindex option ' +
+						'datalist select optgroup', textBlockElementsMap);
+		textInlineElementsMap = createLookupTable('text_inline_elements', 'span strong b em i font strike u var cite ' +
+										'dfn code mark q sup sub samp');
+
+		each((settings.special || 'script noscript style textarea').split(' '), function(name) {
+			specialElements[name] = new RegExp('<\/' + name + '[^>]*>', 'gi');
+		});
+
+		// Converts a wildcard expression string to a regexp for example *a will become /.*a/.
+		function patternToRegExp(str) {
+			return new RegExp('^' + str.replace(/([?+*])/g, '.$1') + '$');
+		}
+
+		// Parses the specified valid_elements string and adds to the current rules
+		// This function is a bit hard to read since it's heavily optimized for speed
+		function addValidElements(validElements) {
+			var ei, el, ai, al, matches, element, attr, attrData, elementName, attrName, attrType, attributes, attributesOrder,
+				prefix, outputName, globalAttributes, globalAttributesOrder, key, value,
+				elementRuleRegExp = /^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,
+				attrRuleRegExp = /^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,
+				hasPatternsRegExp = /[*?+]/;
+
+			if (validElements) {
+				// Split valid elements into an array with rules
+				validElements = split(validElements, ',');
+
+				if (elements['@']) {
+					globalAttributes = elements['@'].attributes;
+					globalAttributesOrder = elements['@'].attributesOrder;
+				}
+
+				// Loop all rules
+				for (ei = 0, el = validElements.length; ei < el; ei++) {
+					// Parse element rule
+					matches = elementRuleRegExp.exec(validElements[ei]);
+					if (matches) {
+						// Setup local names for matches
+						prefix = matches[1];
+						elementName = matches[2];
+						outputName = matches[3];
+						attrData = matches[5];
+
+						// Create new attributes and attributesOrder
+						attributes = {};
+						attributesOrder = [];
+
+						// Create the new element
+						element = {
+							attributes: attributes,
+							attributesOrder: attributesOrder
+						};
+
+						// Padd empty elements prefix
+						if (prefix === '#') {
+							element.paddEmpty = true;
+						}
+
+						// Remove empty elements prefix
+						if (prefix === '-') {
+							element.removeEmpty = true;
+						}
+
+						if (matches[4] === '!') {
+							element.removeEmptyAttrs = true;
+						}
+
+						// Copy attributes from global rule into current rule
+						if (globalAttributes) {
+							for (key in globalAttributes) {
+								attributes[key] = globalAttributes[key];
+							}
+
+							attributesOrder.push.apply(attributesOrder, globalAttributesOrder);
+						}
+
+						// Attributes defined
+						if (attrData) {
+							attrData = split(attrData, '|');
+							for (ai = 0, al = attrData.length; ai < al; ai++) {
+								matches = attrRuleRegExp.exec(attrData[ai]);
+								if (matches) {
+									attr = {};
+									attrType = matches[1];
+									attrName = matches[2].replace(/::/g, ':');
+									prefix = matches[3];
+									value = matches[4];
+
+									// Required
+									if (attrType === '!') {
+										element.attributesRequired = element.attributesRequired || [];
+										element.attributesRequired.push(attrName);
+										attr.required = true;
+									}
+
+									// Denied from global
+									if (attrType === '-') {
+										delete attributes[attrName];
+										attributesOrder.splice(inArray(attributesOrder, attrName), 1);
+										continue;
+									}
+
+									// Default value
+									if (prefix) {
+										// Default value
+										if (prefix === '=') {
+											element.attributesDefault = element.attributesDefault || [];
+											element.attributesDefault.push({name: attrName, value: value});
+											attr.defaultValue = value;
+										}
+
+										// Forced value
+										if (prefix === ':') {
+											element.attributesForced = element.attributesForced || [];
+											element.attributesForced.push({name: attrName, value: value});
+											attr.forcedValue = value;
+										}
+
+										// Required values
+										if (prefix === '<') {
+											attr.validValues = makeMap(value, '?');
+										}
+									}
+
+									// Check for attribute patterns
+									if (hasPatternsRegExp.test(attrName)) {
+										element.attributePatterns = element.attributePatterns || [];
+										attr.pattern = patternToRegExp(attrName);
+										element.attributePatterns.push(attr);
+									} else {
+										// Add attribute to order list if it doesn't already exist
+										if (!attributes[attrName]) {
+											attributesOrder.push(attrName);
+										}
+
+										attributes[attrName] = attr;
+									}
+								}
+							}
+						}
+
+						// Global rule, store away these for later usage
+						if (!globalAttributes && elementName == '@') {
+							globalAttributes = attributes;
+							globalAttributesOrder = attributesOrder;
+						}
+
+						// Handle substitute elements such as b/strong
+						if (outputName) {
+							element.outputName = elementName;
+							elements[outputName] = element;
+						}
+
+						// Add pattern or exact element
+						if (hasPatternsRegExp.test(elementName)) {
+							element.pattern = patternToRegExp(elementName);
+							patternElements.push(element);
+						} else {
+							elements[elementName] = element;
+						}
+					}
+				}
+			}
+		}
+
+		function setValidElements(validElements) {
+			elements = {};
+			patternElements = [];
+
+			addValidElements(validElements);
+
+			each(schemaItems, function(element, name) {
+				children[name] = element.children;
+			});
+		}
+
+		// Adds custom non HTML elements to the schema
+		function addCustomElements(customElements) {
+			var customElementRegExp = /^(~)?(.+)$/;
+
+			if (customElements) {
+				// Flush cached items since we are altering the default maps
+				mapCache.text_block_elements = mapCache.block_elements = null;
+
+				each(split(customElements, ','), function(rule) {
+					var matches = customElementRegExp.exec(rule),
+						inline = matches[1] === '~',
+						cloneName = inline ? 'span' : 'div',
+						name = matches[2];
+
+					children[name] = children[cloneName];
+					customElementsMap[name] = cloneName;
+
+					// If it's not marked as inline then add it to valid block elements
+					if (!inline) {
+						blockElementsMap[name.toUpperCase()] = {};
+						blockElementsMap[name] = {};
+					}
+
+					// Add elements clone if needed
+					if (!elements[name]) {
+						var customRule = elements[cloneName];
+
+						customRule = extend({}, customRule);
+						delete customRule.removeEmptyAttrs;
+						delete customRule.removeEmpty;
+
+						elements[name] = customRule;
+					}
+
+					// Add custom elements at span/div positions
+					each(children, function(element, elmName) {
+						if (element[cloneName]) {
+							children[elmName] = element = extend({}, children[elmName]);
+							element[name] = element[cloneName];
+						}
+					});
+				});
+			}
+		}
+
+		// Adds valid children to the schema object
+		function addValidChildren(validChildren) {
+			var childRuleRegExp = /^([+\-]?)(\w+)\[([^\]]+)\]$/;
+
+			if (validChildren) {
+				each(split(validChildren, ','), function(rule) {
+					var matches = childRuleRegExp.exec(rule), parent, prefix;
+
+					if (matches) {
+						prefix = matches[1];
+
+						// Add/remove items from default
+						if (prefix) {
+							parent = children[matches[2]];
+						} else {
+							parent = children[matches[2]] = {'#comment': {}};
+						}
+
+						parent = children[matches[2]];
+
+						each(split(matches[3], '|'), function(child) {
+							if (prefix === '-') {
+								// Clone the element before we delete
+								// things in it to not mess up default schemas
+								children[matches[2]] = parent = extend({}, children[matches[2]]);
+
+								delete parent[child];
+							} else {
+								parent[child] = {};
+							}
+						});
+					}
+				});
+			}
+		}
+
+		function getElementRule(name) {
+			var element = elements[name], i;
+
+			// Exact match found
+			if (element) {
+				return element;
+			}
+
+			// No exact match then try the patterns
+			i = patternElements.length;
+			while (i--) {
+				element = patternElements[i];
+
+				if (element.pattern.test(name)) {
+					return element;
+				}
+			}
+		}
+
+		if (!settings.valid_elements) {
+			// No valid elements defined then clone the elements from the schema spec
+			each(schemaItems, function(element, name) {
+				elements[name] = {
+					attributes: element.attributes,
+					attributesOrder: element.attributesOrder
+				};
+
+				children[name] = element.children;
+			});
+
+			// Switch these on HTML4
+			if (settings.schema != "html5") {
+				each(split('strong/b em/i'), function(item) {
+					item = split(item, '/');
+					elements[item[1]].outputName = item[0];
+				});
+			}
+
+			// Add default alt attribute for images
+			elements.img.attributesDefault = [{name: 'alt', value: ''}];
+
+			// Remove these if they are empty by default
+			each(split('ol ul sub sup blockquote span font a table tbody tr strong em b i'), function(name) {
+				if (elements[name]) {
+					elements[name].removeEmpty = true;
+				}
+			});
+
+			// Padd these by default
+			each(split('p h1 h2 h3 h4 h5 h6 th td pre div address caption'), function(name) {
+				elements[name].paddEmpty = true;
+			});
+
+			// Remove these if they have no attributes
+			each(split('span'), function(name) {
+				elements[name].removeEmptyAttrs = true;
+			});
+
+			// Remove these by default
+			// TODO: Reenable in 4.1
+			/*each(split('script style'), function(name) {
+				delete elements[name];
+			});*/
+		} else {
+			setValidElements(settings.valid_elements);
+		}
+
+		addCustomElements(settings.custom_elements);
+		addValidChildren(settings.valid_children);
+		addValidElements(settings.extended_valid_elements);
+
+		// Todo: Remove this when we fix list handling to be valid
+		addValidChildren('+ol[ul|ol],+ul[ul|ol]');
+
+		// Delete invalid elements
+		if (settings.invalid_elements) {
+			each(explode(settings.invalid_elements), function(item) {
+				if (elements[item]) {
+					delete elements[item];
+				}
+			});
+		}
+
+		// If the user didn't allow span only allow internal spans
+		if (!getElementRule('span')) {
+			addValidElements('span[!data-mce-type|*]');
+		}
+
+		/**
+		 * Name/value map object with valid parents and children to those parents.
+		 *
+		 * @example
+		 * children = {
+		 *    div:{p:{}, h1:{}}
+		 * };
+		 * @field children
+		 * @type Object
+		 */
+		self.children = children;
+
+		/**
+		 * Name/value map object with valid styles for each element.
+		 *
+		 * @method getValidStyles
+		 * @type Object
+		 */
+		self.getValidStyles = function() {
+			return validStyles;
+		};
+
+		/**
+		 * Name/value map object with valid styles for each element.
+		 *
+		 * @method getInvalidStyles
+		 * @type Object
+		 */
+		self.getInvalidStyles = function() {
+			return invalidStyles;
+		};
+
+		/**
+		 * Name/value map object with valid classes for each element.
+		 *
+		 * @method getValidClasses
+		 * @type Object
+		 */
+		self.getValidClasses = function() {
+			return validClasses;
+		};
+
+		/**
+		 * Returns a map with boolean attributes.
+		 *
+		 * @method getBoolAttrs
+		 * @return {Object} Name/value lookup map for boolean attributes.
+		 */
+		self.getBoolAttrs = function() {
+			return boolAttrMap;
+		};
+
+		/**
+		 * Returns a map with block elements.
+		 *
+		 * @method getBlockElements
+		 * @return {Object} Name/value lookup map for block elements.
+		 */
+		self.getBlockElements = function() {
+			return blockElementsMap;
+		};
+
+		/**
+		 * Returns a map with text block elements. Such as: p,h1-h6,div,address
+		 *
+		 * @method getTextBlockElements
+		 * @return {Object} Name/value lookup map for block elements.
+		 */
+		self.getTextBlockElements = function() {
+			return textBlockElementsMap;
+		};
+
+		/**
+		 * Returns a map of inline text format nodes for example strong/span or ins.
+		 *
+		 * @method getTextInlineElements
+		 * @return {Object} Name/value lookup map for text format elements.
+		 */
+		self.getTextInlineElements = function() {
+			return textInlineElementsMap;
+		};
+
+		/**
+		 * Returns a map with short ended elements such as BR or IMG.
+		 *
+		 * @method getShortEndedElements
+		 * @return {Object} Name/value lookup map for short ended elements.
+		 */
+		self.getShortEndedElements = function() {
+			return shortEndedElementsMap;
+		};
+
+		/**
+		 * Returns a map with self closing tags such as <li>.
+		 *
+		 * @method getSelfClosingElements
+		 * @return {Object} Name/value lookup map for self closing tags elements.
+		 */
+		self.getSelfClosingElements = function() {
+			return selfClosingElementsMap;
+		};
+
+		/**
+		 * Returns a map with elements that should be treated as contents regardless if it has text
+		 * content in them or not such as TD, VIDEO or IMG.
+		 *
+		 * @method getNonEmptyElements
+		 * @return {Object} Name/value lookup map for non empty elements.
+		 */
+		self.getNonEmptyElements = function() {
+			return nonEmptyElementsMap;
+		};
+
+		/**
+		 * Returns a map with elements that the caret should be moved in front of after enter is
+		 * pressed
+		 *
+		 * @method getMoveCaretBeforeOnEnterElements
+		 * @return {Object} Name/value lookup map for elements to place the caret in front of.
+		 */
+		self.getMoveCaretBeforeOnEnterElements = function() {
+			return moveCaretBeforeOnEnterElementsMap;
+		};
+
+		/**
+		 * Returns a map with elements where white space is to be preserved like PRE or SCRIPT.
+		 *
+		 * @method getWhiteSpaceElements
+		 * @return {Object} Name/value lookup map for white space elements.
+		 */
+		self.getWhiteSpaceElements = function() {
+			return whiteSpaceElementsMap;
+		};
+
+		/**
+		 * Returns a map with special elements. These are elements that needs to be parsed
+		 * in a special way such as script, style, textarea etc. The map object values
+		 * are regexps used to find the end of the element.
+		 *
+		 * @method getSpecialElements
+		 * @return {Object} Name/value lookup map for special elements.
+		 */
+		self.getSpecialElements = function() {
+			return specialElements;
+		};
+
+		/**
+		 * Returns true/false if the specified element and it's child is valid or not
+		 * according to the schema.
+		 *
+		 * @method isValidChild
+		 * @param {String} name Element name to check for.
+		 * @param {String} child Element child to verify.
+		 * @return {Boolean} True/false if the element is a valid child of the specified parent.
+		 */
+		self.isValidChild = function(name, child) {
+			var parent = children[name];
+
+			return !!(parent && parent[child]);
+		};
+
+		/**
+		 * Returns true/false if the specified element name and optional attribute is
+		 * valid according to the schema.
+		 *
+		 * @method isValid
+		 * @param {String} name Name of element to check.
+		 * @param {String} attr Optional attribute name to check for.
+		 * @return {Boolean} True/false if the element and attribute is valid.
+		 */
+		self.isValid = function(name, attr) {
+			var attrPatterns, i, rule = getElementRule(name);
+
+			// Check if it's a valid element
+			if (rule) {
+				if (attr) {
+					// Check if attribute name exists
+					if (rule.attributes[attr]) {
+						return true;
+					}
+
+					// Check if attribute matches a regexp pattern
+					attrPatterns = rule.attributePatterns;
+					if (attrPatterns) {
+						i = attrPatterns.length;
+						while (i--) {
+							if (attrPatterns[i].pattern.test(name)) {
+								return true;
+							}
+						}
+					}
+				} else {
+					return true;
+				}
+			}
+
+			// No match
+			return false;
+		};
+
+		/**
+		 * Returns true/false if the specified element is valid or not
+		 * according to the schema.
+		 *
+		 * @method getElementRule
+		 * @param {String} name Element name to check for.
+		 * @return {Object} Element object or undefined if the element isn't valid.
+		 */
+		self.getElementRule = getElementRule;
+
+		/**
+		 * Returns an map object of all custom elements.
+		 *
+		 * @method getCustomElements
+		 * @return {Object} Name/value map object of all custom elements.
+		 */
+		self.getCustomElements = function() {
+			return customElementsMap;
+		};
+
+		/**
+		 * Parses a valid elements string and adds it to the schema. The valid elements
+		 * format is for example "element[attr=default|otherattr]".
+		 * Existing rules will be replaced with the ones specified, so this extends the schema.
+		 *
+		 * @method addValidElements
+		 * @param {String} valid_elements String in the valid elements format to be parsed.
+		 */
+		self.addValidElements = addValidElements;
+
+		/**
+		 * Parses a valid elements string and sets it to the schema. The valid elements
+		 * format is for example "element[attr=default|otherattr]".
+		 * Existing rules will be replaced with the ones specified, so this extends the schema.
+		 *
+		 * @method setValidElements
+		 * @param {String} valid_elements String in the valid elements format to be parsed.
+		 */
+		self.setValidElements = setValidElements;
+
+		/**
+		 * Adds custom non HTML elements to the schema.
+		 *
+		 * @method addCustomElements
+		 * @param {String} custom_elements Comma separated list of custom elements to add.
+		 */
+		self.addCustomElements = addCustomElements;
+
+		/**
+		 * Parses a valid children string and adds them to the schema structure. The valid children
+		 * format is for example: "element[child1|child2]".
+		 *
+		 * @method addValidChildren
+		 * @param {String} valid_children Valid children elements string to parse
+		 */
+		self.addValidChildren = addValidChildren;
+
+		self.elements = elements;
+	};
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/Serializer.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,156 @@
+/**
+ * Serializer.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is used to serialize down the DOM tree into a string using a Writer instance.
+ *
+ *
+ * @example
+ * new tinymce.html.Serializer().serialize(new tinymce.html.DomParser().parse('<p>text</p>'));
+ * @class tinymce.html.Serializer
+ * @version 3.4
+ */
+define("tinymce/html/Serializer", [
+	"tinymce/html/Writer",
+	"tinymce/html/Schema"
+], function(Writer, Schema) {
+	/**
+	 * Constructs a new Serializer instance.
+	 *
+	 * @constructor
+	 * @method Serializer
+	 * @param {Object} settings Name/value settings object.
+	 * @param {tinymce.html.Schema} schema Schema instance to use.
+	 */
+	return function(settings, schema) {
+		var self = this, writer = new Writer(settings);
+
+		settings = settings || {};
+		settings.validate = "validate" in settings ? settings.validate : true;
+
+		self.schema = schema = schema || new Schema();
+		self.writer = writer;
+
+		/**
+		 * Serializes the specified node into a string.
+		 *
+		 * @example
+		 * new tinymce.html.Serializer().serialize(new tinymce.html.DomParser().parse('<p>text</p>'));
+		 * @method serialize
+		 * @param {tinymce.html.Node} node Node instance to serialize.
+		 * @return {String} String with HTML based on DOM tree.
+		 */
+		self.serialize = function(node) {
+			var handlers, validate;
+
+			validate = settings.validate;
+
+			handlers = {
+				// #text
+				3: function(node) {
+					writer.text(node.value, node.raw);
+				},
+
+				// #comment
+				8: function(node) {
+					writer.comment(node.value);
+				},
+
+				// Processing instruction
+				7: function(node) {
+					writer.pi(node.name, node.value);
+				},
+
+				// Doctype
+				10: function(node) {
+					writer.doctype(node.value);
+				},
+
+				// CDATA
+				4: function(node) {
+					writer.cdata(node.value);
+				},
+
+				// Document fragment
+				11: function(node) {
+					if ((node = node.firstChild)) {
+						do {
+							walk(node);
+						} while ((node = node.next));
+					}
+				}
+			};
+
+			writer.reset();
+
+			function walk(node) {
+				var handler = handlers[node.type], name, isEmpty, attrs, attrName, attrValue, sortedAttrs, i, l, elementRule;
+
+				if (!handler) {
+					name = node.name;
+					isEmpty = node.shortEnded;
+					attrs = node.attributes;
+
+					// Sort attributes
+					if (validate && attrs && attrs.length > 1) {
+						sortedAttrs = [];
+						sortedAttrs.map = {};
+
+						elementRule = schema.getElementRule(node.name);
+						for (i = 0, l = elementRule.attributesOrder.length; i < l; i++) {
+							attrName = elementRule.attributesOrder[i];
+
+							if (attrName in attrs.map) {
+								attrValue = attrs.map[attrName];
+								sortedAttrs.map[attrName] = attrValue;
+								sortedAttrs.push({name: attrName, value: attrValue});
+							}
+						}
+
+						for (i = 0, l = attrs.length; i < l; i++) {
+							attrName = attrs[i].name;
+
+							if (!(attrName in sortedAttrs.map)) {
+								attrValue = attrs.map[attrName];
+								sortedAttrs.map[attrName] = attrValue;
+								sortedAttrs.push({name: attrName, value: attrValue});
+							}
+						}
+
+						attrs = sortedAttrs;
+					}
+
+					writer.start(node.name, attrs, isEmpty);
+
+					if (!isEmpty) {
+						if ((node = node.firstChild)) {
+							do {
+								walk(node);
+							} while ((node = node.next));
+						}
+
+						writer.end(name);
+					}
+				} else {
+					handler(node);
+				}
+			}
+
+			// Serialize element and treat all non elements as fragments
+			if (node.type == 1 && !settings.inner) {
+				walk(node);
+			} else {
+				handlers[11](node);
+			}
+
+			return writer.getContent();
+		};
+	};
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/Styles.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,363 @@
+/**
+ * Styles.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is used to parse CSS styles it also compresses styles to reduce the output size.
+ *
+ * @example
+ * var Styles = new tinymce.html.Styles({
+ *    url_converter: function(url) {
+ *       return url;
+ *    }
+ * });
+ *
+ * styles = Styles.parse('border: 1px solid red');
+ * styles.color = 'red';
+ *
+ * console.log(new tinymce.html.StyleSerializer().serialize(styles));
+ *
+ * @class tinymce.html.Styles
+ * @version 3.4
+ */
+define("tinymce/html/Styles", [], function() {
+	return function(settings, schema) {
+		/*jshint maxlen:255 */
+		/*eslint max-len:0 */
+		var rgbRegExp = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,
+			urlOrStrRegExp = /(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,
+			styleRegExp = /\s*([^:]+):\s*([^;]+);?/g,
+			trimRightRegExp = /\s+$/,
+			undef, i, encodingLookup = {}, encodingItems, validStyles, invalidStyles, invisibleChar = '\uFEFF';
+
+		settings = settings || {};
+
+		if (schema) {
+			validStyles = schema.getValidStyles();
+			invalidStyles = schema.getInvalidStyles();
+		}
+
+		encodingItems = ('\\" \\\' \\; \\: ; : ' + invisibleChar).split(' ');
+		for (i = 0; i < encodingItems.length; i++) {
+			encodingLookup[encodingItems[i]] = invisibleChar + i;
+			encodingLookup[invisibleChar + i] = encodingItems[i];
+		}
+
+		function toHex(match, r, g, b) {
+			function hex(val) {
+				val = parseInt(val, 10).toString(16);
+
+				return val.length > 1 ? val : '0' + val; // 0 -> 00
+			}
+
+			return '#' + hex(r) + hex(g) + hex(b);
+		}
+
+		return {
+			/**
+			 * Parses the specified RGB color value and returns a hex version of that color.
+			 *
+			 * @method toHex
+			 * @param {String} color RGB string value like rgb(1,2,3)
+			 * @return {String} Hex version of that RGB value like #FF00FF.
+			 */
+			toHex: function(color) {
+				return color.replace(rgbRegExp, toHex);
+			},
+
+			/**
+			 * Parses the specified style value into an object collection. This parser will also
+			 * merge and remove any redundant items that browsers might have added. It will also convert non hex
+			 * colors to hex values. Urls inside the styles will also be converted to absolute/relative based on settings.
+			 *
+			 * @method parse
+			 * @param {String} css Style value to parse for example: border:1px solid red;.
+			 * @return {Object} Object representation of that style like {border: '1px solid red'}
+			 */
+			parse: function(css) {
+				var styles = {}, matches, name, value, isEncoded, urlConverter = settings.url_converter;
+				var urlConverterScope = settings.url_converter_scope || this;
+
+				function compress(prefix, suffix, noJoin) {
+					var top, right, bottom, left;
+
+					top = styles[prefix + '-top' + suffix];
+					if (!top) {
+						return;
+					}
+
+					right = styles[prefix + '-right' + suffix];
+					if (!right) {
+						return;
+					}
+
+					bottom = styles[prefix + '-bottom' + suffix];
+					if (!bottom) {
+						return;
+					}
+
+					left = styles[prefix + '-left' + suffix];
+					if (!left) {
+						return;
+					}
+
+					var box = [top, right, bottom, left];
+					i = box.length - 1;
+					while (i--) {
+						if (box[i] !== box[i + 1]) {
+							break;
+						}
+					}
+
+					if (i > -1 && noJoin) {
+						return;
+					}
+
+					styles[prefix + suffix] = i == -1 ? box[0] : box.join(' ');
+					delete styles[prefix + '-top' + suffix];
+					delete styles[prefix + '-right' + suffix];
+					delete styles[prefix + '-bottom' + suffix];
+					delete styles[prefix + '-left' + suffix];
+				}
+
+				/**
+				 * Checks if the specific style can be compressed in other words if all border-width are equal.
+				 */
+				function canCompress(key) {
+					var value = styles[key], i;
+
+					if (!value) {
+						return;
+					}
+
+					value = value.split(' ');
+					i = value.length;
+					while (i--) {
+						if (value[i] !== value[0]) {
+							return false;
+						}
+					}
+
+					styles[key] = value[0];
+
+					return true;
+				}
+
+				/**
+				 * Compresses multiple styles into one style.
+				 */
+				function compress2(target, a, b, c) {
+					if (!canCompress(a)) {
+						return;
+					}
+
+					if (!canCompress(b)) {
+						return;
+					}
+
+					if (!canCompress(c)) {
+						return;
+					}
+
+					// Compress
+					styles[target] = styles[a] + ' ' + styles[b] + ' ' + styles[c];
+					delete styles[a];
+					delete styles[b];
+					delete styles[c];
+				}
+
+				// Encodes the specified string by replacing all \" \' ; : with _<num>
+				function encode(str) {
+					isEncoded = true;
+
+					return encodingLookup[str];
+				}
+
+				// Decodes the specified string by replacing all _<num> with it's original value \" \' etc
+				// It will also decode the \" \' if keep_slashes is set to fale or omitted
+				function decode(str, keep_slashes) {
+					if (isEncoded) {
+						str = str.replace(/\uFEFF[0-9]/g, function(str) {
+							return encodingLookup[str];
+						});
+					}
+
+					if (!keep_slashes) {
+						str = str.replace(/\\([\'\";:])/g, "$1");
+					}
+
+					return str;
+				}
+
+				function processUrl(match, url, url2, url3, str, str2) {
+					str = str || str2;
+
+					if (str) {
+						str = decode(str);
+
+						// Force strings into single quote format
+						return "'" + str.replace(/\'/g, "\\'") + "'";
+					}
+
+					url = decode(url || url2 || url3);
+
+					if (!settings.allow_script_urls) {
+						var scriptUrl = url.replace(/[\s\r\n]+/, '');
+
+						if (/(java|vb)script:/i.test(scriptUrl)) {
+							return "";
+						}
+
+						if (!settings.allow_svg_data_urls && /^data:image\/svg/i.test(scriptUrl)) {
+							return "";
+						}
+					}
+
+					// Convert the URL to relative/absolute depending on config
+					if (urlConverter) {
+						url = urlConverter.call(urlConverterScope, url, 'style');
+					}
+
+					// Output new URL format
+					return "url('" + url.replace(/\'/g, "\\'") + "')";
+				}
+
+				if (css) {
+					css = css.replace(/[\u0000-\u001F]/g, '');
+
+					// Encode \" \' % and ; and : inside strings so they don't interfere with the style parsing
+					css = css.replace(/\\[\"\';:\uFEFF]/g, encode).replace(/\"[^\"]+\"|\'[^\']+\'/g, function(str) {
+						return str.replace(/[;:]/g, encode);
+					});
+
+					// Parse styles
+					while ((matches = styleRegExp.exec(css))) {
+						name = matches[1].replace(trimRightRegExp, '').toLowerCase();
+						value = matches[2].replace(trimRightRegExp, '');
+
+						// Decode escaped sequences like \65 -> e
+						/*jshint loopfunc:true*/
+						/*eslint no-loop-func:0 */
+						value = value.replace(/\\[0-9a-f]+/g, function(e) {
+							return String.fromCharCode(parseInt(e.substr(1), 16));
+						});
+
+						if (name && value.length > 0) {
+							// Don't allow behavior name or expression/comments within the values
+							if (!settings.allow_script_urls && (name == "behavior" || /expression\s*\(|\/\*|\*\//.test(value))) {
+								continue;
+							}
+
+							// Opera will produce 700 instead of bold in their style values
+							if (name === 'font-weight' && value === '700') {
+								value = 'bold';
+							} else if (name === 'color' || name === 'background-color') { // Lowercase colors like RED
+								value = value.toLowerCase();
+							}
+
+							// Convert RGB colors to HEX
+							value = value.replace(rgbRegExp, toHex);
+
+							// Convert URLs and force them into url('value') format
+							value = value.replace(urlOrStrRegExp, processUrl);
+							styles[name] = isEncoded ? decode(value, true) : value;
+						}
+
+						styleRegExp.lastIndex = matches.index + matches[0].length;
+					}
+					// Compress the styles to reduce it's size for example IE will expand styles
+					compress("border", "", true);
+					compress("border", "-width");
+					compress("border", "-color");
+					compress("border", "-style");
+					compress("padding", "");
+					compress("margin", "");
+					compress2('border', 'border-width', 'border-style', 'border-color');
+
+					// Remove pointless border, IE produces these
+					if (styles.border === 'medium none') {
+						delete styles.border;
+					}
+
+					// IE 11 will produce a border-image: none when getting the style attribute from <p style="border: 1px solid red"></p>
+					// So lets asume it shouldn't be there
+					if (styles['border-image'] === 'none') {
+						delete styles['border-image'];
+					}
+				}
+
+				return styles;
+			},
+
+			/**
+			 * Serializes the specified style object into a string.
+			 *
+			 * @method serialize
+			 * @param {Object} styles Object to serialize as string for example: {border: '1px solid red'}
+			 * @param {String} elementName Optional element name, if specified only the styles that matches the schema will be serialized.
+			 * @return {String} String representation of the style object for example: border: 1px solid red.
+			 */
+			serialize: function(styles, elementName) {
+				var css = '', name, value;
+
+				function serializeStyles(name) {
+					var styleList, i, l, value;
+
+					styleList = validStyles[name];
+					if (styleList) {
+						for (i = 0, l = styleList.length; i < l; i++) {
+							name = styleList[i];
+							value = styles[name];
+
+							if (value !== undef && value.length > 0) {
+								css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';';
+							}
+						}
+					}
+				}
+
+				function isValid(name, elementName) {
+					var styleMap;
+
+					styleMap = invalidStyles['*'];
+					if (styleMap && styleMap[name]) {
+						return false;
+					}
+
+					styleMap = invalidStyles[elementName];
+					if (styleMap && styleMap[name]) {
+						return false;
+					}
+
+					return true;
+				}
+
+				// Serialize styles according to schema
+				if (elementName && validStyles) {
+					// Serialize global styles and element specific styles
+					serializeStyles('*');
+					serializeStyles(elementName);
+				} else {
+					// Output the styles in the order they are inside the object
+					for (name in styles) {
+						value = styles[name];
+
+						if (value !== undef && value.length > 0) {
+							if (!invalidStyles || isValid(name, elementName)) {
+								css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';';
+							}
+						}
+					}
+				}
+
+				return css;
+			}
+		};
+	};
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/html/Writer.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,199 @@
+/**
+ * Writer.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is used to write HTML tags out it can be used with the Serializer or the SaxParser.
+ *
+ * @class tinymce.html.Writer
+ * @example
+ * var writer = new tinymce.html.Writer({indent: true});
+ * var parser = new tinymce.html.SaxParser(writer).parse('<p><br></p>');
+ * console.log(writer.getContent());
+ *
+ * @class tinymce.html.Writer
+ * @version 3.4
+ */
+define("tinymce/html/Writer", [
+	"tinymce/html/Entities",
+	"tinymce/util/Tools"
+], function(Entities, Tools) {
+	var makeMap = Tools.makeMap;
+
+	/**
+	 * Constructs a new Writer instance.
+	 *
+	 * @constructor
+	 * @method Writer
+	 * @param {Object} settings Name/value settings object.
+	 */
+	return function(settings) {
+		var html = [], indent, indentBefore, indentAfter, encode, htmlOutput;
+
+		settings = settings || {};
+		indent = settings.indent;
+		indentBefore = makeMap(settings.indent_before || '');
+		indentAfter = makeMap(settings.indent_after || '');
+		encode = Entities.getEncodeFunc(settings.entity_encoding || 'raw', settings.entities);
+		htmlOutput = settings.element_format == "html";
+
+		return {
+			/**
+			 * Writes the a start element such as <p id="a">.
+			 *
+			 * @method start
+			 * @param {String} name Name of the element.
+			 * @param {Array} attrs Optional attribute array or undefined if it hasn't any.
+			 * @param {Boolean} empty Optional empty state if the tag should end like <br />.
+			 */
+			start: function(name, attrs, empty) {
+				var i, l, attr, value;
+
+				if (indent && indentBefore[name] && html.length > 0) {
+					value = html[html.length - 1];
+
+					if (value.length > 0 && value !== '\n') {
+						html.push('\n');
+					}
+				}
+
+				html.push('<', name);
+
+				if (attrs) {
+					for (i = 0, l = attrs.length; i < l; i++) {
+						attr = attrs[i];
+						html.push(' ', attr.name, '="', encode(attr.value, true), '"');
+					}
+				}
+
+				if (!empty || htmlOutput) {
+					html[html.length] = '>';
+				} else {
+					html[html.length] = ' />';
+				}
+
+				if (empty && indent && indentAfter[name] && html.length > 0) {
+					value = html[html.length - 1];
+
+					if (value.length > 0 && value !== '\n') {
+						html.push('\n');
+					}
+				}
+			},
+
+			/**
+			 * Writes the a end element such as </p>.
+			 *
+			 * @method end
+			 * @param {String} name Name of the element.
+			 */
+			end: function(name) {
+				var value;
+
+				/*if (indent && indentBefore[name] && html.length > 0) {
+					value = html[html.length - 1];
+
+					if (value.length > 0 && value !== '\n')
+						html.push('\n');
+				}*/
+
+				html.push('</', name, '>');
+
+				if (indent && indentAfter[name] && html.length > 0) {
+					value = html[html.length - 1];
+
+					if (value.length > 0 && value !== '\n') {
+						html.push('\n');
+					}
+				}
+			},
+
+			/**
+			 * Writes a text node.
+			 *
+			 * @method text
+			 * @param {String} text String to write out.
+			 * @param {Boolean} raw Optional raw state if true the contents wont get encoded.
+			 */
+			text: function(text, raw) {
+				if (text.length > 0) {
+					html[html.length] = raw ? text : encode(text);
+				}
+			},
+
+			/**
+			 * Writes a cdata node such as <![CDATA[data]]>.
+			 *
+			 * @method cdata
+			 * @param {String} text String to write out inside the cdata.
+			 */
+			cdata: function(text) {
+				html.push('<![CDATA[', text, ']]>');
+			},
+
+			/**
+			 * Writes a comment node such as <!-- Comment -->.
+			 *
+			 * @method cdata
+			 * @param {String} text String to write out inside the comment.
+			 */
+			comment: function(text) {
+				html.push('<!--', text, '-->');
+			},
+
+			/**
+			 * Writes a PI node such as <?xml attr="value" ?>.
+			 *
+			 * @method pi
+			 * @param {String} name Name of the pi.
+			 * @param {String} text String to write out inside the pi.
+			 */
+			pi: function(name, text) {
+				if (text) {
+					html.push('<?', name, ' ', encode(text), '?>');
+				} else {
+					html.push('<?', name, '?>');
+				}
+
+				if (indent) {
+					html.push('\n');
+				}
+			},
+
+			/**
+			 * Writes a doctype node such as <!DOCTYPE data>.
+			 *
+			 * @method doctype
+			 * @param {String} text String to write out inside the doctype.
+			 */
+			doctype: function(text) {
+				html.push('<!DOCTYPE', text, '>', indent ? '\n' : '');
+			},
+
+			/**
+			 * Resets the internal buffer if one wants to reuse the writer.
+			 *
+			 * @method reset
+			 */
+			reset: function() {
+				html.length = 0;
+			},
+
+			/**
+			 * Returns the contents that got serialized.
+			 *
+			 * @method getContent
+			 * @return {String} HTML contents that got written down.
+			 */
+			getContent: function() {
+				return html.join('').replace(/\n$/, '');
+			}
+		};
+	};
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/AbsoluteLayout.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,63 @@
+/**
+ * AbsoluteLayout.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * LayoutManager for absolute positioning. This layout manager is more of
+ * a base class for other layouts but can be created and used directly.
+ *
+ * @-x-less AbsoluteLayout.less
+ * @class tinymce.ui.AbsoluteLayout
+ * @extends tinymce.ui.Layout
+ */
+define("tinymce/ui/AbsoluteLayout", [
+	"tinymce/ui/Layout"
+], function(Layout) {
+	"use strict";
+
+	return Layout.extend({
+		Defaults: {
+			containerClass: 'abs-layout',
+			controlClass: 'abs-layout-item'
+		},
+
+		/**
+		 * Recalculates the positions of the controls in the specified container.
+		 *
+		 * @method recalc
+		 * @param {tinymce.ui.Container} container Container instance to recalc.
+		 */
+		recalc: function(container) {
+			container.items().filter(':visible').each(function(ctrl) {
+				var settings = ctrl.settings;
+
+				ctrl.layoutRect({
+					x: settings.x,
+					y: settings.y,
+					w: settings.w,
+					h: settings.h
+				});
+
+				if (ctrl.recalc) {
+					ctrl.recalc();
+				}
+			});
+		},
+
+		/**
+		 * Renders the specified container and any layout specific HTML.
+		 *
+		 * @method renderHtml
+		 * @param {tinymce.ui.Container} container Container to render HTML for.
+		 */
+		renderHtml: function(container) {
+			return '<div id="' + container._id + '-absend" class="' + container.classPrefix + 'abs-end"></div>' + this._super(container);
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Button.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,170 @@
+/**
+ * Button.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is used to create buttons. You can create them directly or through the Factory.
+ *
+ * @example
+ * // Create and render a button to the body element
+ * tinymce.ui.Factory.create({
+ *     type: 'button',
+ *     text: 'My button'
+ * }).renderTo(document.body);
+ *
+ * @-x-less Button.less
+ * @class tinymce.ui.Button
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/Button", [
+	"tinymce/ui/Widget"
+], function(Widget) {
+	"use strict";
+
+	return Widget.extend({
+		Defaults: {
+			classes: "widget btn",
+			role: "button"
+		},
+
+		/**
+		 * Constructs a new button instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {String} size Size of the button small|medium|large.
+		 * @setting {String} image Image to use for icon.
+		 * @setting {String} icon Icon to use for button.
+		 */
+		init: function(settings) {
+			var self = this, size;
+
+			self.on('click mousedown', function(e) {
+				e.preventDefault();
+			});
+
+			self._super(settings);
+			size = settings.size;
+
+			if (settings.subtype) {
+				self.addClass(settings.subtype);
+			}
+
+			if (size) {
+				self.addClass('btn-' + size);
+			}
+		},
+
+		/**
+		 * Sets/gets the current button icon.
+		 *
+		 * @method icon
+		 * @param {String} [icon] New icon identifier.
+		 * @return {String|tinymce.ui.MenuButton} Current icon or current MenuButton instance.
+		 */
+		icon: function(icon) {
+			var self = this, prefix = self.classPrefix;
+
+			if (typeof icon == 'undefined') {
+				return self.settings.icon;
+			}
+
+			self.settings.icon = icon;
+			icon = icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : '';
+
+			if (self._rendered) {
+				var btnElm = self.getEl().firstChild, iconElm = btnElm.getElementsByTagName('i')[0];
+
+				if (icon) {
+					if (!iconElm || iconElm != btnElm.firstChild) {
+						iconElm = document.createElement('i');
+						btnElm.insertBefore(iconElm, btnElm.firstChild);
+					}
+
+					iconElm.className = icon;
+				} else if (iconElm) {
+					btnElm.removeChild(iconElm);
+				}
+
+				self.text(self._text); // Set text again to fix whitespace between icon + text
+			}
+
+			return self;
+		},
+
+		/**
+		 * Repaints the button for example after it's been resizes by a layout engine.
+		 *
+		 * @method repaint
+		 */
+		repaint: function() {
+			var btnStyle = this.getEl().firstChild.style;
+
+			btnStyle.width = btnStyle.height = "100%";
+
+			this._super();
+		},
+
+		/**
+		 * Sets/gets the current button text.
+		 *
+		 * @method text
+		 * @param {String} [text] New button text.
+		 * @return {String|tinymce.ui.Button} Current text or current Button instance.
+		 */
+		text: function(text) {
+			var self = this;
+
+			if (self._rendered) {
+				var textNode = self.getEl().lastChild.lastChild;
+				if (textNode) {
+					textNode.data = self.translate(text);
+				}
+			}
+
+			return self._super(text);
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, id = self._id, prefix = self.classPrefix;
+			var icon = self.settings.icon, image;
+
+			image = self.settings.image;
+			if (image) {
+				icon = 'none';
+
+				// Support for [high dpi, low dpi] image sources
+				if (typeof image != "string") {
+					image = window.getSelection ? image[0] : image[1];
+				}
+
+				image = ' style="background-image: url(\'' + image + '\')"';
+			} else {
+				image = '';
+			}
+
+			icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
+
+			return (
+				'<div id="' + id + '" class="' + self.classes() + '" tabindex="-1" aria-labelledby="' + id + '">' +
+					'<button role="presentation" type="button" tabindex="-1">' +
+						(icon ? '<i class="' + icon + '"' + image + '></i>' : '') +
+						(self._text ? (icon ? '\u00a0' : '') + self.encode(self._text) : '') +
+					'</button>' +
+				'</div>'
+			);
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ButtonGroup.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,62 @@
+/**
+ * ButtonGroup.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This control enables you to put multiple buttons into a group. This is
+ * useful when you want to combine similar toolbar buttons into a group.
+ *
+ * @example
+ * // Create and render a buttongroup with two buttons to the body element
+ * tinymce.ui.Factory.create({
+ *     type: 'buttongroup',
+ *     items: [
+ *         {text: 'Button A'},
+ *         {text: 'Button B'}
+ *     ]
+ * }).renderTo(document.body);
+ *
+ * @-x-less ButtonGroup.less
+ * @class tinymce.ui.ButtonGroup
+ * @extends tinymce.ui.Container
+ */
+define("tinymce/ui/ButtonGroup", [
+	"tinymce/ui/Container"
+], function(Container) {
+	"use strict";
+
+	return Container.extend({
+		Defaults: {
+			defaultType: 'button',
+			role: 'group'
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, layout = self._layout;
+
+			self.addClass('btn-group');
+			self.preRender();
+			layout.preRender(self);
+
+			return (
+				'<div id="' + self._id + '" class="' + self.classes() + '">' +
+					'<div id="' + self._id + '-body">' +
+						(self.settings.html || '') + layout.renderHtml(self) +
+					'</div>' +
+				'</div>'
+			);
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Checkbox.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,119 @@
+/**
+ * Checkbox.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This control creates a custom checkbox.
+ *
+ * @example
+ * // Create and render a checkbox to the body element
+ * tinymce.ui.Factory.create({
+ *     type: 'checkbox',
+ *     checked: true,
+ *     text: 'My checkbox'
+ * }).renderTo(document.body);
+ *
+ * @-x-less Checkbox.less
+ * @class tinymce.ui.Checkbox
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/Checkbox", [
+	"tinymce/ui/Widget"
+], function(Widget) {
+	"use strict";
+
+	return Widget.extend({
+		Defaults: {
+			classes: "checkbox",
+			role: "checkbox",
+			checked: false
+		},
+
+		/**
+		 * Constructs a new Checkbox instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {Boolean} checked True if the checkbox should be checked by default.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self._super(settings);
+
+			self.on('click mousedown', function(e) {
+				e.preventDefault();
+			});
+
+			self.on('click', function(e) {
+				e.preventDefault();
+
+				if (!self.disabled()) {
+					self.checked(!self.checked());
+				}
+			});
+
+			self.checked(self.settings.checked);
+		},
+
+		/**
+		 * Getter/setter function for the checked state.
+		 *
+		 * @method checked
+		 * @param {Boolean} [state] State to be set.
+		 * @return {Boolean|tinymce.ui.Checkbox} True/false or checkbox if it's a set operation.
+		 */
+		checked: function(state) {
+			var self = this;
+
+			if (typeof state != "undefined") {
+				if (state) {
+					self.addClass('checked');
+				} else {
+					self.removeClass('checked');
+				}
+
+				self._checked = state;
+				self.aria('checked', state);
+
+				return self;
+			}
+
+			return self._checked;
+		},
+
+		/**
+		 * Getter/setter function for the value state.
+		 *
+		 * @method value
+		 * @param {Boolean} [state] State to be set.
+		 * @return {Boolean|tinymce.ui.Checkbox} True/false or checkbox if it's a set operation.
+		 */
+		value: function(state) {
+			return this.checked(state);
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, id = self._id, prefix = self.classPrefix;
+
+			return (
+				'<div id="' + id + '" class="' + self.classes() + '" unselectable="on" aria-labelledby="' + id + '-al" tabindex="-1">' +
+					'<i class="' + prefix + 'ico ' + prefix + 'i-checkbox"></i>' +
+					'<span id="' + id + '-al" class="' + prefix + 'label">' + self.encode(self._text) + '</span>' +
+				'</div>'
+			);
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Collection.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,430 @@
+/**
+ * Collection.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Control collection, this class contains control instances and it enables you to
+ * perform actions on all the contained items. This is very similar to how jQuery works.
+ *
+ * @example
+ * someCollection.show().disabled(true);
+ *
+ * @class tinymce.ui.Collection
+ */
+define("tinymce/ui/Collection", [
+	"tinymce/util/Tools",
+	"tinymce/ui/Selector",
+	"tinymce/util/Class"
+], function(Tools, Selector, Class) {
+	"use strict";
+
+	var Collection, proto, push = Array.prototype.push, slice = Array.prototype.slice;
+
+	proto = {
+		/**
+		 * Current number of contained control instances.
+		 *
+		 * @field length
+		 * @type Number
+		 */
+		length: 0,
+
+		/**
+		 * Constructor for the collection.
+		 *
+		 * @constructor
+		 * @method init
+		 * @param {Array} items Optional array with items to add.
+		 */
+		init: function(items) {
+			if (items) {
+				this.add(items);
+			}
+		},
+
+		/**
+		 * Adds new items to the control collection.
+		 *
+		 * @method add
+		 * @param {Array} items Array if items to add to collection.
+		 * @return {tinymce.ui.Collection} Current collection instance.
+		 */
+		add: function(items) {
+			var self = this;
+
+			// Force single item into array
+			if (!Tools.isArray(items)) {
+				if (items instanceof Collection) {
+					self.add(items.toArray());
+				} else {
+					push.call(self, items);
+				}
+			} else {
+				push.apply(self, items);
+			}
+
+			return self;
+		},
+
+		/**
+		 * Sets the contents of the collection. This will remove any existing items
+		 * and replace them with the ones specified in the input array.
+		 *
+		 * @method set
+		 * @param {Array} items Array with items to set into the Collection.
+		 * @return {tinymce.ui.Collection} Collection instance.
+		 */
+		set: function(items) {
+			var self = this, len = self.length, i;
+
+			self.length = 0;
+			self.add(items);
+
+			// Remove old entries
+			for (i = self.length; i < len; i++) {
+				delete self[i];
+			}
+
+			return self;
+		},
+
+		/**
+		 * Filters the collection item based on the specified selector expression or selector function.
+		 *
+		 * @method filter
+		 * @param {String} selector Selector expression to filter items by.
+		 * @return {tinymce.ui.Collection} Collection containing the filtered items.
+		 */
+		filter: function(selector) {
+			var self = this, i, l, matches = [], item, match;
+
+			// Compile string into selector expression
+			if (typeof selector === "string") {
+				selector = new Selector(selector);
+
+				match = function(item) {
+					return selector.match(item);
+				};
+			} else {
+				// Use selector as matching function
+				match = selector;
+			}
+
+			for (i = 0, l = self.length; i < l; i++) {
+				item = self[i];
+
+				if (match(item)) {
+					matches.push(item);
+				}
+			}
+
+			return new Collection(matches);
+		},
+
+		/**
+		 * Slices the items within the collection.
+		 *
+		 * @method slice
+		 * @param {Number} index Index to slice at.
+		 * @param {Number} len Optional length to slice.
+		 * @return {tinymce.ui.Collection} Current collection.
+		 */
+		slice: function() {
+			return new Collection(slice.apply(this, arguments));
+		},
+
+		/**
+		 * Makes the current collection equal to the specified index.
+		 *
+		 * @method eq
+		 * @param {Number} index Index of the item to set the collection to.
+		 * @return {tinymce.ui.Collection} Current collection.
+		 */
+		eq: function(index) {
+			return index === -1 ? this.slice(index) : this.slice(index, +index + 1);
+		},
+
+		/**
+		 * Executes the specified callback on each item in collection.
+		 *
+		 * @method each
+		 * @param {function} callback Callback to execute for each item in collection.
+		 * @return {tinymce.ui.Collection} Current collection instance.
+		 */
+		each: function(callback) {
+			Tools.each(this, callback);
+
+			return this;
+		},
+
+		/**
+		 * Returns an JavaScript array object of the contents inside the collection.
+		 *
+		 * @method toArray
+		 * @return {Array} Array with all items from collection.
+		 */
+		toArray: function() {
+			return Tools.toArray(this);
+		},
+
+		/**
+		 * Finds the index of the specified control or return -1 if it isn't in the collection.
+		 *
+		 * @method indexOf
+		 * @param {Control} ctrl Control instance to look for.
+		 * @return {Number} Index of the specified control or -1.
+		 */
+		indexOf: function(ctrl) {
+			var self = this, i = self.length;
+
+			while (i--) {
+				if (self[i] === ctrl) {
+					break;
+				}
+			}
+
+			return i;
+		},
+
+		/**
+		 * Returns a new collection of the contents in reverse order.
+		 *
+		 * @method reverse
+		 * @return {tinymce.ui.Collection} Collection instance with reversed items.
+		 */
+		reverse: function() {
+			return new Collection(Tools.toArray(this).reverse());
+		},
+
+		/**
+		 * Returns true/false if the class exists or not.
+		 *
+		 * @method hasClass
+		 * @param {String} cls Class to check for.
+		 * @return {Boolean} true/false state if the class exists or not.
+		 */
+		hasClass: function(cls) {
+			return this[0] ? this[0].hasClass(cls) : false;
+		},
+
+		/**
+		 * Sets/gets the specific property on the items in the collection. The same as executing control.<property>(<value>);
+		 *
+		 * @method prop
+		 * @param {String} name Property name to get/set.
+		 * @param {Object} value Optional object value to set.
+		 * @return {tinymce.ui.Collection} Current collection instance or value of the first item on a get operation.
+		 */
+		prop: function(name, value) {
+			var self = this, undef, item;
+
+			if (value !== undef) {
+				self.each(function(item) {
+					if (item[name]) {
+						item[name](value);
+					}
+				});
+
+				return self;
+			}
+
+			item = self[0];
+
+			if (item && item[name]) {
+				return item[name]();
+			}
+		},
+
+		/**
+		 * Executes the specific function name with optional arguments an all items in collection if it exists.
+		 *
+		 * @example collection.exec("myMethod", arg1, arg2, arg3);
+		 * @method exec
+		 * @param {String} name Name of the function to execute.
+		 * @param {Object} ... Multiple arguments to pass to each function.
+		 * @return {tinymce.ui.Collection} Current collection.
+		 */
+		exec: function(name) {
+			var self = this, args = Tools.toArray(arguments).slice(1);
+
+			self.each(function(item) {
+				if (item[name]) {
+					item[name].apply(item, args);
+				}
+			});
+
+			return self;
+		},
+
+		/**
+		 * Remove all items from collection and DOM.
+		 *
+		 * @method remove
+		 * @return {tinymce.ui.Collection} Current collection.
+		 */
+		remove: function() {
+			var i = this.length;
+
+			while (i--) {
+				this[i].remove();
+			}
+
+			return this;
+		}
+
+		/**
+		 * Fires the specified event by name and arguments on the control. This will execute all
+		 * bound event handlers.
+		 *
+		 * @method fire
+		 * @param {String} name Name of the event to fire.
+		 * @param {Object} args Optional arguments to pass to the event.
+		 * @return {tinymce.ui.Collection} Current collection instance.
+		 */
+		// fire: function(event, args) {}, -- Generated by code below
+
+		/**
+		 * Binds a callback to the specified event. This event can both be
+		 * native browser events like "click" or custom ones like PostRender.
+		 *
+		 * The callback function will have two parameters the first one being the control that received the event
+		 * the second one will be the event object either the browsers native event object or a custom JS object.
+		 *
+		 * @method on
+		 * @param {String} name Name of the event to bind. For example "click".
+		 * @param {String/function} callback Callback function to execute ones the event occurs.
+		 * @return {tinymce.ui.Collection} Current collection instance.
+		 */
+		// on: function(name, callback) {}, -- Generated by code below
+
+		/**
+		 * Unbinds the specified event and optionally a specific callback. If you omit the name
+		 * parameter all event handlers will be removed. If you omit the callback all event handles
+		 * by the specified name will be removed.
+		 *
+		 * @method off
+		 * @param {String} name Optional name for the event to unbind.
+		 * @param {function} callback Optional callback function to unbind.
+		 * @return {tinymce.ui.Collection} Current collection instance.
+		 */
+		// off: function(name, callback) {}, -- Generated by code below
+
+		/**
+		 * Shows the items in the current collection.
+		 *
+		 * @method show
+		 * @return {tinymce.ui.Collection} Current collection instance.
+		 */
+		// show: function() {}, -- Generated by code below
+
+		/**
+		 * Hides the items in the current collection.
+		 *
+		 * @method hide
+		 * @return {tinymce.ui.Collection} Current collection instance.
+		 */
+		// hide: function() {}, -- Generated by code below
+
+		/**
+		 * Sets/gets the text contents of the items in the current collection.
+		 *
+		 * @method text
+		 * @return {tinymce.ui.Collection} Current collection instance or text value of the first item on a get operation.
+		 */
+		// text: function(value) {}, -- Generated by code below
+
+		/**
+		 * Sets/gets the name contents of the items in the current collection.
+		 *
+		 * @method name
+		 * @return {tinymce.ui.Collection} Current collection instance or name value of the first item on a get operation.
+		 */
+		// name: function(value) {}, -- Generated by code below
+
+		/**
+		 * Sets/gets the disabled state on the items in the current collection.
+		 *
+		 * @method disabled
+		 * @return {tinymce.ui.Collection} Current collection instance or disabled state of the first item on a get operation.
+		 */
+		// disabled: function(state) {}, -- Generated by code below
+
+		/**
+		 * Sets/gets the active state on the items in the current collection.
+		 *
+		 * @method active
+		 * @return {tinymce.ui.Collection} Current collection instance or active state of the first item on a get operation.
+		 */
+		// active: function(state) {}, -- Generated by code below
+
+		/**
+		 * Sets/gets the selected state on the items in the current collection.
+		 *
+		 * @method selected
+		 * @return {tinymce.ui.Collection} Current collection instance or selected state of the first item on a get operation.
+		 */
+		// selected: function(state) {}, -- Generated by code below
+
+		/**
+		 * Sets/gets the selected state on the items in the current collection.
+		 *
+		 * @method visible
+		 * @return {tinymce.ui.Collection} Current collection instance or visible state of the first item on a get operation.
+		 */
+		// visible: function(state) {}, -- Generated by code below
+
+		/**
+		 * Adds a class to all items in the collection.
+		 *
+		 * @method addClass
+		 * @param {String} cls Class to add to each item.
+		 * @return {tinymce.ui.Collection} Current collection instance.
+		 */
+		// addClass: function(cls) {}, -- Generated by code below
+
+		/**
+		 * Removes the specified class from all items in collection.
+		 *
+		 * @method removeClass
+		 * @param {String} cls Class to remove from each item.
+		 * @return {tinymce.ui.Collection} Current collection instance.
+		 */
+		// removeClass: function(cls) {}, -- Generated by code below
+	};
+
+	// Extend tinymce.ui.Collection prototype with some generated control specific methods
+	Tools.each('fire on off show hide addClass removeClass append prepend before after reflow'.split(' '), function(name) {
+		proto[name] = function() {
+			var args = Tools.toArray(arguments);
+
+			this.each(function(ctrl) {
+				if (name in ctrl) {
+					ctrl[name].apply(ctrl, args);
+				}
+			});
+
+			return this;
+		};
+	});
+
+	// Extend tinymce.ui.Collection prototype with some property methods
+	Tools.each('text name disabled active selected checked visible parent value data'.split(' '), function(name) {
+		proto[name] = function(value) {
+			return this.prop(name, value);
+		};
+	});
+
+	// Create class based on the new prototype
+	Collection = Class.extend(proto);
+
+	// Stick Collection into Selector to prevent circual references
+	Selector.Collection = Collection;
+
+	return Collection;
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ColorBox.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,72 @@
+/**
+ * ColorBox.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This widget lets you enter colors and browse for colors by pressing the color button. It also displays
+ * a preview of the current color.
+ *
+ * @-x-less ColorBox.less
+ * @class tinymce.ui.ColorBox
+ * @extends tinymce.ui.ComboBox
+ */
+define("tinymce/ui/ColorBox", [
+	"tinymce/ui/ComboBox"
+], function(ComboBox) {
+	"use strict";
+
+	return ComboBox.extend({
+		/**
+		 * Constructs a new control instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			settings.spellcheck = false;
+
+			if (settings.onaction) {
+				settings.icon = 'none';
+			}
+
+			self._super(settings);
+
+			self.addClass('colorbox');
+			self.on('change keyup postrender', function() {
+				self.repaintColor(self.value());
+			});
+		},
+
+		repaintColor: function(value) {
+			var elm = this.getEl().getElementsByTagName('i')[0];
+
+			if (elm) {
+				try {
+					elm.style.background = value;
+				} catch (ex) {
+					// Ignore
+				}
+			}
+		},
+
+		value: function(value) {
+			var self = this;
+
+			if (typeof value != "undefined") {
+				if (self._rendered) {
+					self.repaintColor(value);
+				}
+			}
+
+			return self._super(value);
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ColorButton.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,118 @@
+/**
+ * ColorButton.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class creates a color button control. This is a split button in which the main
+ * button has a visual representation of the currently selected color. When clicked
+ * the caret button displays a color picker, allowing the user to select a new color.
+ *
+ * @-x-less ColorButton.less
+ * @class tinymce.ui.ColorButton
+ * @extends tinymce.ui.PanelButton
+ */
+define("tinymce/ui/ColorButton", [
+	"tinymce/ui/PanelButton",
+	"tinymce/dom/DOMUtils"
+], function(PanelButton, DomUtils) {
+	"use strict";
+
+	var DOM = DomUtils.DOM;
+
+	return PanelButton.extend({
+		/**
+		 * Constructs a new ColorButton instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 */
+		init: function(settings) {
+			this._super(settings);
+			this.addClass('colorbutton');
+		},
+
+		/**
+		 * Getter/setter for the current color.
+		 *
+		 * @method color
+		 * @param {String} [color] Color to set.
+		 * @return {String|tinymce.ui.ColorButton} Current color or current instance.
+		 */
+		color: function(color) {
+			if (color) {
+				this._color = color;
+				this.getEl('preview').style.backgroundColor = color;
+				return this;
+			}
+
+			return this._color;
+		},
+
+		/**
+		 * Resets the current color.
+		 *
+		 * @method resetColor
+		 * @return {tinymce.ui.ColorButton} Current instance.
+		 */
+		resetColor: function() {
+			this._color = null;
+			this.getEl('preview').style.backgroundColor = null;
+			return this;
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, id = self._id, prefix = self.classPrefix;
+			var icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : '';
+			var image = self.settings.image ? ' style="background-image: url(\'' + self.settings.image + '\')"' : '';
+
+			return (
+				'<div id="' + id + '" class="' + self.classes() + '" role="button" tabindex="-1" aria-haspopup="true">' +
+					'<button role="presentation" hidefocus="1" type="button" tabindex="-1">' +
+						(icon ? '<i class="' + icon + '"' + image + '></i>' : '') +
+						'<span id="' + id + '-preview" class="' + prefix + 'preview"></span>' +
+						(self._text ? (icon ? ' ' : '') + (self._text) : '') +
+					'</button>' +
+					'<button type="button" class="' + prefix + 'open" hidefocus="1" tabindex="-1">' +
+						' <i class="' + prefix + 'caret"></i>' +
+					'</button>' +
+				'</div>'
+			);
+		},
+
+		/**
+		 * Called after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this, onClickHandler = self.settings.onclick;
+
+			self.on('click', function(e) {
+				if (e.aria && e.aria.key == 'down') {
+					return;
+				}
+
+				if (e.control == self && !DOM.getParent(e.target, '.' + self.classPrefix + 'open')) {
+					e.stopImmediatePropagation();
+					onClickHandler.call(self, e);
+				}
+			});
+
+			delete self.settings.onclick;
+
+			return self._super();
+		}
+	});
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ColorPicker.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,206 @@
+/**
+ * ColorPicker.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Color picker widget lets you select colors.
+ *
+ * @-x-less ColorPicker.less
+ * @class tinymce.ui.ColorPicker
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/ColorPicker", [
+	"tinymce/ui/Widget",
+	"tinymce/ui/DragHelper",
+	"tinymce/ui/DomUtils",
+	"tinymce/util/Color"
+], function(Widget, DragHelper, DomUtils, Color) {
+	"use strict";
+
+	return Widget.extend({
+		Defaults: {
+			classes: "widget colorpicker"
+		},
+
+		/**
+		 * Constructs a new colorpicker instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {String} color Initial color value.
+		 */
+		init: function(settings) {
+			this._super(settings);
+		},
+
+		postRender: function() {
+			var self = this, color = self.color(), hsv, hueRootElm, huePointElm, svRootElm, svPointElm;
+
+			hueRootElm = self.getEl('h');
+			huePointElm = self.getEl('hp');
+			svRootElm = self.getEl('sv');
+			svPointElm = self.getEl('svp');
+
+			function getPos(elm, event) {
+				var pos = DomUtils.getPos(elm), x, y;
+
+				x = event.pageX - pos.x;
+				y = event.pageY - pos.y;
+
+				x = Math.max(0, Math.min(x / elm.clientWidth, 1));
+				y = Math.max(0, Math.min(y / elm.clientHeight, 1));
+
+				return {
+					x: x,
+					y: y
+				};
+			}
+
+			function updateColor(hsv, hueUpdate) {
+				var hue = (360 - hsv.h) / 360;
+
+				DomUtils.css(huePointElm, {
+					top: (hue * 100) + '%'
+				});
+
+				if (!hueUpdate) {
+					DomUtils.css(svPointElm, {
+						left: hsv.s + '%',
+						top: (100 - hsv.v) + '%'
+					});
+				}
+
+				svRootElm.style.background = new Color({s: 100, v: 100, h: hsv.h}).toHex();
+				self.color().parse({s: hsv.s, v: hsv.v, h: hsv.h});
+			}
+
+			function updateSaturationAndValue(e) {
+				var pos;
+
+				pos = getPos(svRootElm, e);
+				hsv.s = pos.x * 100;
+				hsv.v = (1 - pos.y) * 100;
+
+				updateColor(hsv);
+				self.fire('change');
+			}
+
+			function updateHue(e) {
+				var pos;
+
+				pos = getPos(hueRootElm, e);
+				hsv = color.toHsv();
+				hsv.h = (1 - pos.y) * 360;
+				updateColor(hsv, true);
+				self.fire('change');
+			}
+
+			self._repaint = function() {
+				hsv = color.toHsv();
+				updateColor(hsv);
+			};
+
+			self._super();
+
+			self._svdraghelper = new DragHelper(self._id + '-sv', {
+				start: updateSaturationAndValue,
+				drag: updateSaturationAndValue
+			});
+
+			self._hdraghelper = new DragHelper(self._id + '-h', {
+				start: updateHue,
+				drag: updateHue
+			});
+
+			self._repaint();
+		},
+
+		rgb: function() {
+			return this.color().toRgb();
+		},
+
+		value: function(value) {
+			var self = this;
+
+			if (arguments.length) {
+				self.color().parse(value);
+
+				if (self._rendered) {
+					self._repaint();
+				}
+			} else {
+				return self.color().toHex();
+			}
+		},
+
+		color: function() {
+			if (!this._color) {
+				this._color = new Color();
+			}
+
+			return this._color;
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, id = self._id, prefix = self.classPrefix, hueHtml;
+			var stops = '#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000';
+
+			function getOldIeFallbackHtml() {
+				var i, l, html = '', gradientPrefix, stopsList;
+
+				gradientPrefix = 'filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=';
+				stopsList = stops.split(',');
+				for (i = 0, l = stopsList.length - 1; i < l; i++) {
+					html += (
+						'<div class="' + prefix + 'colorpicker-h-chunk" style="' +
+							'height:' + (100 / l) + '%;' +
+							gradientPrefix + stopsList[i] + ',endColorstr=' + stopsList[i + 1] + ');' +
+							'-ms-' + gradientPrefix + stopsList[i] + ',endColorstr=' + stopsList[i + 1] + ')' +
+						'"></div>'
+					);
+				}
+
+				return html;
+			}
+
+			var gradientCssText = (
+				'background: -ms-linear-gradient(top,' + stops + ');' +
+				'background: linear-gradient(to bottom,' + stops + ');'
+			);
+
+			hueHtml = (
+				'<div id="' + id + '-h" class="' + prefix + 'colorpicker-h" style="' + gradientCssText + '">' +
+					getOldIeFallbackHtml() +
+					'<div id="' + id + '-hp" class="' + prefix + 'colorpicker-h-marker"></div>' +
+				'</div>'
+			);
+
+			return (
+				'<div id="' + id + '" class="' + self.classes() + '">' +
+					'<div id="' + id + '-sv" class="' + prefix + 'colorpicker-sv">' +
+						'<div class="' + prefix + 'colorpicker-overlay1">' +
+							'<div class="' + prefix + 'colorpicker-overlay2">' +
+								'<div id="' + id + '-svp" class="' + prefix + 'colorpicker-selector1">' +
+									'<div class="' + prefix + 'colorpicker-selector2"></div>' +
+								'</div>' +
+							'</div>' +
+						'</div>' +
+					'</div>' +
+					hueHtml +
+				'</div>'
+			);
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ComboBox.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,332 @@
+/**
+ * ComboBox.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class creates a combobox control. Select box that you select a value from or
+ * type a value into.
+ *
+ * @-x-less ComboBox.less
+ * @class tinymce.ui.ComboBox
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/ComboBox", [
+	"tinymce/ui/Widget",
+	"tinymce/ui/Factory",
+	"tinymce/ui/DomUtils"
+], function(Widget, Factory, DomUtils) {
+	"use strict";
+
+	return Widget.extend({
+		/**
+		 * Constructs a new control instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {String} placeholder Placeholder text to display.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self._super(settings);
+			self.addClass('combobox');
+			self.subinput = true;
+			self.ariaTarget = 'inp'; // TODO: Figure out a better way
+
+			settings = self.settings;
+			settings.menu = settings.menu || settings.values;
+
+			if (settings.menu) {
+				settings.icon = 'caret';
+			}
+
+			self.on('click', function(e) {
+				var elm = e.target, root = self.getEl();
+
+				while (elm && elm != root) {
+					if (elm.id && elm.id.indexOf('-open') != -1) {
+						self.fire('action');
+
+						if (settings.menu) {
+							self.showMenu();
+
+							if (e.aria) {
+								self.menu.items()[0].focus();
+							}
+						}
+					}
+
+					elm = elm.parentNode;
+				}
+			});
+
+			// TODO: Rework this
+			self.on('keydown', function(e) {
+				if (e.target.nodeName == "INPUT" && e.keyCode == 13) {
+					self.parents().reverse().each(function(ctrl) {
+						e.preventDefault();
+						self.fire('change');
+
+						if (ctrl.hasEventListeners('submit') && ctrl.toJSON) {
+							ctrl.fire('submit', {data: ctrl.toJSON()});
+							return false;
+						}
+					});
+				}
+			});
+
+			if (settings.placeholder) {
+				self.addClass('placeholder');
+
+				self.on('focusin', function() {
+					if (!self._hasOnChange) {
+						DomUtils.on(self.getEl('inp'), 'change', function() {
+							self.fire('change');
+						});
+
+						self._hasOnChange = true;
+					}
+
+					if (self.hasClass('placeholder')) {
+						self.getEl('inp').value = '';
+						self.removeClass('placeholder');
+					}
+				});
+
+				self.on('focusout', function() {
+					if (self.value().length === 0) {
+						self.getEl('inp').value = settings.placeholder;
+						self.addClass('placeholder');
+					}
+				});
+			}
+		},
+
+		showMenu: function() {
+			var self = this, settings = self.settings, menu;
+
+			if (!self.menu) {
+				menu = settings.menu || [];
+
+				// Is menu array then auto constuct menu control
+				if (menu.length) {
+					menu = {
+						type: 'menu',
+						items: menu
+					};
+				} else {
+					menu.type = menu.type || 'menu';
+				}
+
+				self.menu = Factory.create(menu).parent(self).renderTo(self.getContainerElm());
+				self.fire('createmenu');
+				self.menu.reflow();
+				self.menu.on('cancel', function(e) {
+					if (e.control === self.menu) {
+						self.focus();
+					}
+				});
+
+				self.menu.on('show hide', function(e) {
+					e.control.items().each(function(ctrl) {
+						ctrl.active(ctrl.value() == self.value());
+					});
+				}).fire('show');
+
+				self.menu.on('select', function(e) {
+					self.value(e.control.value());
+				});
+
+				self.on('focusin', function(e) {
+					if (e.target.tagName.toUpperCase() == 'INPUT') {
+						self.menu.hide();
+					}
+				});
+
+				self.aria('expanded', true);
+			}
+
+			self.menu.show();
+			self.menu.layoutRect({w: self.layoutRect().w});
+			self.menu.moveRel(self.getEl(), self.isRtl() ? ['br-tr', 'tr-br'] : ['bl-tl', 'tl-bl']);
+		},
+
+		/**
+		 * Getter/setter function for the control value.
+		 *
+		 * @method value
+		 * @param {String} [value] Value to be set.
+		 * @return {String|tinymce.ui.ComboBox} Value or self if it's a set operation.
+		 */
+		value: function(value) {
+			var self = this;
+
+			if (typeof value != "undefined") {
+				self._value = value;
+				self.removeClass('placeholder');
+
+				if (self._rendered) {
+					self.getEl('inp').value = value;
+				}
+
+				return self;
+			}
+
+			if (self._rendered) {
+				value = self.getEl('inp').value;
+
+				if (value != self.settings.placeholder) {
+					return value;
+				}
+
+				return '';
+			}
+
+			return self._value;
+		},
+
+		/**
+		 * Getter/setter function for the disabled state.
+		 *
+		 * @method value
+		 * @param {Boolean} [state] State to be set.
+		 * @return {Boolean|tinymce.ui.ComboBox} True/false or self if it's a set operation.
+		 */
+		disabled: function(state) {
+			var self = this;
+
+			if (self._rendered && typeof state != 'undefined') {
+				self.getEl('inp').disabled = state;
+			}
+
+			return self._super(state);
+		},
+
+		/**
+		 * Focuses the input area of the control.
+		 *
+		 * @method focus
+		 */
+		focus: function() {
+			this.getEl('inp').focus();
+		},
+
+		/**
+		 * Repaints the control after a layout operation.
+		 *
+		 * @method repaint
+		 */
+		repaint: function() {
+			var self = this, elm = self.getEl(), openElm = self.getEl('open'), rect = self.layoutRect();
+			var width, lineHeight;
+
+			if (openElm) {
+				width = rect.w - DomUtils.getSize(openElm).width - 10;
+			} else {
+				width = rect.w - 10;
+			}
+
+			// Detect old IE 7+8 add lineHeight to align caret vertically in the middle
+			var doc = document;
+			if (doc.all && (!doc.documentMode || doc.documentMode <= 8)) {
+				lineHeight = (self.layoutRect().h - 2) + 'px';
+			}
+
+			DomUtils.css(elm.firstChild, {
+				width: width,
+				lineHeight: lineHeight
+			});
+
+			self._super();
+
+			return self;
+		},
+
+		/**
+		 * Post render method. Called after the control has been rendered to the target.
+		 *
+		 * @method postRender
+		 * @return {tinymce.ui.ComboBox} Current combobox instance.
+		 */
+		postRender: function() {
+			var self = this;
+
+			DomUtils.on(this.getEl('inp'), 'change', function() {
+				self.fire('change');
+			});
+
+			return self._super();
+		},
+
+		remove: function() {
+			DomUtils.off(this.getEl('inp'));
+			this._super();
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, id = self._id, settings = self.settings, prefix = self.classPrefix;
+			var value = settings.value || settings.placeholder || '';
+			var icon, text, openBtnHtml = '', extraAttrs = '';
+
+			if ("spellcheck" in settings) {
+				extraAttrs += ' spellcheck="' + settings.spellcheck + '"';
+			}
+
+			if (settings.maxLength) {
+				extraAttrs += ' maxlength="' + settings.maxLength + '"';
+			}
+
+			if (settings.size) {
+				extraAttrs += ' size="' + settings.size + '"';
+			}
+
+			if (settings.subtype) {
+				extraAttrs += ' type="' + settings.subtype + '"';
+			}
+
+			if (self.disabled()) {
+				extraAttrs += ' disabled="disabled"';
+			}
+
+			icon = settings.icon;
+			if (icon && icon != 'caret') {
+				icon = prefix + 'ico ' + prefix + 'i-' + settings.icon;
+			}
+
+			text = self._text;
+
+			if (icon || text) {
+				openBtnHtml = (
+					'<div id="' + id + '-open" class="' + prefix + 'btn ' + prefix + 'open" tabIndex="-1" role="button">' +
+						'<button id="' + id + '-action" type="button" hidefocus="1" tabindex="-1">' +
+							(icon != 'caret' ? '<i class="' + icon + '"></i>' : '<i class="' + prefix + 'caret"></i>') +
+							(text ? (icon ? ' ' : '') + text : '') +
+						'</button>' +
+					'</div>'
+				);
+
+				self.addClass('has-open');
+			}
+
+			return (
+				'<div id="' + id + '" class="' + self.classes() + '">' +
+					'<input id="' + id + '-inp" class="' + prefix + 'textbox ' + prefix + 'placeholder" value="' +
+					value + '" hidefocus="1"' + extraAttrs + ' />' +
+					openBtnHtml +
+				'</div>'
+			);
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Container.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,495 @@
+/**
+ * Container.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Container control. This is extended by all controls that can have
+ * children such as panels etc. You can also use this class directly as an
+ * generic container instance. The container doesn't have any specific role or style.
+ *
+ * @-x-less Container.less
+ * @class tinymce.ui.Container
+ * @extends tinymce.ui.Control
+ */
+define("tinymce/ui/Container", [
+	"tinymce/ui/Control",
+	"tinymce/ui/Collection",
+	"tinymce/ui/Selector",
+	"tinymce/ui/Factory",
+	"tinymce/ui/KeyboardNavigation",
+	"tinymce/util/Tools",
+	"tinymce/ui/DomUtils"
+], function(Control, Collection, Selector, Factory, KeyboardNavigation, Tools, DomUtils) {
+	"use strict";
+
+	var selectorCache = {};
+
+	return Control.extend({
+		layout: '',
+		innerClass: 'container-inner',
+
+		/**
+		 * Constructs a new control instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {Array} items Items to add to container in JSON format or control instances.
+		 * @setting {String} layout Layout manager by name to use.
+		 * @setting {Object} defaults Default settings to apply to all items.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self._super(settings);
+			settings = self.settings;
+			self._fixed = settings.fixed;
+			self._items = new Collection();
+
+			if (self.isRtl()) {
+				self.addClass('rtl');
+			}
+
+			self.addClass('container');
+			self.addClass('container-body', 'body');
+
+			if (settings.containerCls) {
+				self.addClass(settings.containerCls);
+			}
+
+			self._layout = Factory.create((settings.layout || self.layout) + 'layout');
+
+			if (self.settings.items) {
+				self.add(self.settings.items);
+			}
+
+			// TODO: Fix this!
+			self._hasBody = true;
+		},
+
+		/**
+		 * Returns a collection of child items that the container currently have.
+		 *
+		 * @method items
+		 * @return {tinymce.ui.Collection} Control collection direct child controls.
+		 */
+		items: function() {
+			return this._items;
+		},
+
+		/**
+		 * Find child controls by selector.
+		 *
+		 * @method find
+		 * @param {String} selector Selector CSS pattern to find children by.
+		 * @return {tinymce.ui.Collection} Control collection with child controls.
+		 */
+		find: function(selector) {
+			selector = selectorCache[selector] = selectorCache[selector] || new Selector(selector);
+
+			return selector.find(this);
+		},
+
+		/**
+		 * Adds one or many items to the current container. This will create instances of
+		 * the object representations if needed.
+		 *
+		 * @method add
+		 * @param {Array/Object/tinymce.ui.Control} items Array or item that will be added to the container.
+		 * @return {tinymce.ui.Collection} Current collection control.
+		 */
+		add: function(items) {
+			var self = this;
+
+			self.items().add(self.create(items)).parent(self);
+
+			return self;
+		},
+
+		/**
+		 * Focuses the current container instance. This will look
+		 * for the first control in the container and focus that.
+		 *
+		 * @method focus
+		 * @param {Boolean} keyboard Optional true/false if the focus was a keyboard focus or not.
+		 * @return {tinymce.ui.Collection} Current instance.
+		 */
+		focus: function(keyboard) {
+			var self = this, focusCtrl, keyboardNav, items;
+
+			if (keyboard) {
+				keyboardNav = self.keyboardNav || self.parents().eq(-1)[0].keyboardNav;
+
+				if (keyboardNav) {
+					keyboardNav.focusFirst(self);
+					return;
+				}
+			}
+
+			items = self.find('*');
+
+			// TODO: Figure out a better way to auto focus alert dialog buttons
+			if (self.statusbar) {
+				items.add(self.statusbar.items());
+			}
+
+			items.each(function(ctrl) {
+				if (ctrl.settings.autofocus) {
+					focusCtrl = null;
+					return false;
+				}
+
+				if (ctrl.canFocus) {
+					focusCtrl = focusCtrl || ctrl;
+				}
+			});
+
+			if (focusCtrl) {
+				focusCtrl.focus();
+			}
+
+			return self;
+		},
+
+		/**
+		 * Replaces the specified child control with a new control.
+		 *
+		 * @method replace
+		 * @param {tinymce.ui.Control} oldItem Old item to be replaced.
+		 * @param {tinymce.ui.Control} newItem New item to be inserted.
+		 */
+		replace: function(oldItem, newItem) {
+			var ctrlElm, items = this.items(), i = items.length;
+
+			// Replace the item in collection
+			while (i--) {
+				if (items[i] === oldItem) {
+					items[i] = newItem;
+					break;
+				}
+			}
+
+			if (i >= 0) {
+				// Remove new item from DOM
+				ctrlElm = newItem.getEl();
+				if (ctrlElm) {
+					ctrlElm.parentNode.removeChild(ctrlElm);
+				}
+
+				// Remove old item from DOM
+				ctrlElm = oldItem.getEl();
+				if (ctrlElm) {
+					ctrlElm.parentNode.removeChild(ctrlElm);
+				}
+			}
+
+			// Adopt the item
+			newItem.parent(this);
+		},
+
+		/**
+		 * Creates the specified items. If any of the items is plain JSON style objects
+		 * it will convert these into real tinymce.ui.Control instances.
+		 *
+		 * @method create
+		 * @param {Array} items Array of items to convert into control instances.
+		 * @return {Array} Array with control instances.
+		 */
+		create: function(items) {
+			var self = this, settings, ctrlItems = [];
+
+			// Non array structure, then force it into an array
+			if (!Tools.isArray(items)) {
+				items = [items];
+			}
+
+			// Add default type to each child control
+			Tools.each(items, function(item) {
+				if (item) {
+					// Construct item if needed
+					if (!(item instanceof Control)) {
+						// Name only then convert it to an object
+						if (typeof item == "string") {
+							item = {type: item};
+						}
+
+						// Create control instance based on input settings and default settings
+						settings = Tools.extend({}, self.settings.defaults, item);
+						item.type = settings.type = settings.type || item.type || self.settings.defaultType ||
+							(settings.defaults ? settings.defaults.type : null);
+						item = Factory.create(settings);
+					}
+
+					ctrlItems.push(item);
+				}
+			});
+
+			return ctrlItems;
+		},
+
+		/**
+		 * Renders new control instances.
+		 *
+		 * @private
+		 */
+		renderNew: function() {
+			var self = this;
+
+			// Render any new items
+			self.items().each(function(ctrl, index) {
+				var containerElm, fragment;
+
+				ctrl.parent(self);
+
+				if (!ctrl._rendered) {
+					containerElm = self.getEl('body');
+					fragment = DomUtils.createFragment(ctrl.renderHtml());
+
+					// Insert or append the item
+					if (containerElm.hasChildNodes() && index <= containerElm.childNodes.length - 1) {
+						containerElm.insertBefore(fragment, containerElm.childNodes[index]);
+					} else {
+						containerElm.appendChild(fragment);
+					}
+
+					ctrl.postRender();
+				}
+			});
+
+			self._layout.applyClasses(self);
+			self._lastRect = null;
+
+			return self;
+		},
+
+		/**
+		 * Appends new instances to the current container.
+		 *
+		 * @method append
+		 * @param {Array/tinymce.ui.Collection} items Array if controls to append.
+		 * @return {tinymce.ui.Container} Current container instance.
+		 */
+		append: function(items) {
+			return this.add(items).renderNew();
+		},
+
+		/**
+		 * Prepends new instances to the current container.
+		 *
+		 * @method prepend
+		 * @param {Array/tinymce.ui.Collection} items Array if controls to prepend.
+		 * @return {tinymce.ui.Container} Current container instance.
+		 */
+		prepend: function(items) {
+			var self = this;
+
+			self.items().set(self.create(items).concat(self.items().toArray()));
+
+			return self.renderNew();
+		},
+
+		/**
+		 * Inserts an control at a specific index.
+		 *
+		 * @method insert
+		 * @param {Array/tinymce.ui.Collection} items Array if controls to insert.
+		 * @param {Number} index Index to insert controls at.
+		 * @param {Boolean} [before=false] Inserts controls before the index.
+		 */
+		insert: function(items, index, before) {
+			var self = this, curItems, beforeItems, afterItems;
+
+			items = self.create(items);
+			curItems = self.items();
+
+			if (!before && index < curItems.length - 1) {
+				index += 1;
+			}
+
+			if (index >= 0 && index < curItems.length) {
+				beforeItems = curItems.slice(0, index).toArray();
+				afterItems = curItems.slice(index).toArray();
+				curItems.set(beforeItems.concat(items, afterItems));
+			}
+
+			return self.renderNew();
+		},
+
+		/**
+		 * Populates the form fields from the specified JSON data object.
+		 *
+		 * Control items in the form that matches the data will have it's value set.
+		 *
+		 * @method fromJSON
+		 * @param {Object} data JSON data object to set control values by.
+		 * @return {tinymce.ui.Container} Current form instance.
+		 */
+		fromJSON: function(data) {
+			var self = this;
+
+			for (var name in data) {
+				self.find('#' + name).value(data[name]);
+			}
+
+			return self;
+		},
+
+		/**
+		 * Serializes the form into a JSON object by getting all items
+		 * that has a name and a value.
+		 *
+		 * @method toJSON
+		 * @return {Object} JSON object with form data.
+		 */
+		toJSON: function() {
+			var self = this, data = {};
+
+			self.find('*').each(function(ctrl) {
+				var name = ctrl.name(), value = ctrl.value();
+
+				if (name && typeof value != "undefined") {
+					data[name] = value;
+				}
+			});
+
+			return data;
+		},
+
+		preRender: function() {
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, layout = self._layout, role = this.settings.role;
+
+			self.preRender();
+			layout.preRender(self);
+
+			return (
+				'<div id="' + self._id + '" class="' + self.classes() + '"' + (role ? ' role="' + this.settings.role + '"' : '') + '>' +
+					'<div id="' + self._id + '-body" class="' + self.classes('body') + '">' +
+						(self.settings.html || '') + layout.renderHtml(self) +
+					'</div>' +
+				'</div>'
+			);
+		},
+
+		/**
+		 * Post render method. Called after the control has been rendered to the target.
+		 *
+		 * @method postRender
+		 * @return {tinymce.ui.Container} Current combobox instance.
+		 */
+		postRender: function() {
+			var self = this, box;
+
+			self.items().exec('postRender');
+			self._super();
+
+			self._layout.postRender(self);
+			self._rendered = true;
+
+			if (self.settings.style) {
+				DomUtils.css(self.getEl(), self.settings.style);
+			}
+
+			if (self.settings.border) {
+				box = self.borderBox();
+				DomUtils.css(self.getEl(), {
+					'border-top-width': box.top,
+					'border-right-width': box.right,
+					'border-bottom-width': box.bottom,
+					'border-left-width': box.left
+				});
+			}
+
+			if (!self.parent()) {
+				self.keyboardNav = new KeyboardNavigation({
+					root: self
+				});
+			}
+
+			return self;
+		},
+
+		/**
+		 * Initializes the current controls layout rect.
+		 * This will be executed by the layout managers to determine the
+		 * default minWidth/minHeight etc.
+		 *
+		 * @method initLayoutRect
+		 * @return {Object} Layout rect instance.
+		 */
+		initLayoutRect: function() {
+			var self = this, layoutRect = self._super();
+
+			// Recalc container size by asking layout manager
+			self._layout.recalc(self);
+
+			return layoutRect;
+		},
+
+		/**
+		 * Recalculates the positions of the controls in the current container.
+		 * This is invoked by the reflow method and shouldn't be called directly.
+		 *
+		 * @method recalc
+		 */
+		recalc: function() {
+			var self = this, rect = self._layoutRect, lastRect = self._lastRect;
+
+			if (!lastRect || lastRect.w != rect.w || lastRect.h != rect.h) {
+				self._layout.recalc(self);
+				rect = self.layoutRect();
+				self._lastRect = {x: rect.x, y: rect.y, w: rect.w, h: rect.h};
+				return true;
+			}
+		},
+
+		/**
+		 * Reflows the current container and it's children and possible parents.
+		 * This should be used after you for example append children to the current control so
+		 * that the layout managers know that they need to reposition everything.
+		 *
+		 * @example
+		 * container.append({type: 'button', text: 'My button'}).reflow();
+		 *
+		 * @method reflow
+		 * @return {tinymce.ui.Container} Current container instance.
+		 */
+		reflow: function() {
+			var i;
+
+			if (this.visible()) {
+				Control.repaintControls = [];
+				Control.repaintControls.map = {};
+
+				this.recalc();
+				i = Control.repaintControls.length;
+
+				while (i--) {
+					Control.repaintControls[i].repaint();
+				}
+
+				// TODO: Fix me!
+				if (this.settings.layout !== "flow" && this.settings.layout !== "stack") {
+					this.repaint();
+				}
+
+				Control.repaintControls = [];
+			}
+
+			return this;
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Control.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1479 @@
+/**
+ * Control.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*eslint consistent-this:0 */
+
+/**
+ * This is the base class for all controls and containers. All UI control instances inherit
+ * from this one as it has the base logic needed by all of them.
+ *
+ * @class tinymce.ui.Control
+ */
+define("tinymce/ui/Control", [
+	"tinymce/util/Class",
+	"tinymce/util/Tools",
+	"tinymce/util/EventDispatcher",
+	"tinymce/ui/Collection",
+	"tinymce/ui/DomUtils"
+], function(Class, Tools, EventDispatcher, Collection, DomUtils) {
+	"use strict";
+
+	var hasMouseWheelEventSupport = "onmousewheel" in document;
+	var hasWheelEventSupport = false;
+	var classPrefix = "mce-";
+
+	function getEventDispatcher(obj) {
+		if (!obj._eventDispatcher) {
+			obj._eventDispatcher = new EventDispatcher({
+				scope: obj,
+				toggleEvent: function(name, state) {
+					if (state && EventDispatcher.isNative(name)) {
+						if (!obj._nativeEvents) {
+							obj._nativeEvents = {};
+						}
+
+						obj._nativeEvents[name] = true;
+
+						if (obj._rendered) {
+							obj.bindPendingEvents();
+						}
+					}
+				}
+			});
+		}
+
+		return obj._eventDispatcher;
+	}
+
+	var Control = Class.extend({
+		Statics: {
+			classPrefix: classPrefix
+		},
+
+		isRtl: function() {
+			return Control.rtl;
+		},
+
+		/**
+		 * Class/id prefix to use for all controls.
+		 *
+		 * @final
+		 * @field {String} classPrefix
+		 */
+		classPrefix: classPrefix,
+
+		/**
+		 * Constructs a new control instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {String} style Style CSS properties to add.
+		 * @setting {String} border Border box values example: 1 1 1 1
+		 * @setting {String} padding Padding box values example: 1 1 1 1
+		 * @setting {String} margin Margin box values example: 1 1 1 1
+		 * @setting {Number} minWidth Minimal width for the control.
+		 * @setting {Number} minHeight Minimal height for the control.
+		 * @setting {String} classes Space separated list of classes to add.
+		 * @setting {String} role WAI-ARIA role to use for control.
+		 * @setting {Boolean} hidden Is the control hidden by default.
+		 * @setting {Boolean} disabled Is the control disabled by default.
+		 * @setting {String} name Name of the control instance.
+		 */
+		init: function(settings) {
+			var self = this, classes, i;
+
+			self.settings = settings = Tools.extend({}, self.Defaults, settings);
+
+			// Initial states
+			self._id = settings.id || DomUtils.id();
+			self._text = self._name = '';
+			self._width = self._height = 0;
+			self._aria = {role: settings.role};
+			this._elmCache = {};
+
+			// Setup classes
+			classes = settings.classes;
+			if (classes) {
+				classes = classes.split(' ');
+				classes.map = {};
+				i = classes.length;
+				while (i--) {
+					classes.map[classes[i]] = true;
+				}
+			}
+
+			self._classes = classes || [];
+			self.visible(true);
+
+			// Set some properties
+			Tools.each('title text width height name classes visible disabled active value'.split(' '), function(name) {
+				var value = settings[name], undef;
+
+				if (value !== undef) {
+					self[name](value);
+				} else if (self['_' + name] === undef) {
+					self['_' + name] = false;
+				}
+			});
+
+			self.on('click', function() {
+				if (self.disabled()) {
+					return false;
+				}
+			});
+
+			// TODO: Is this needed duplicate code see above?
+			if (settings.classes) {
+				Tools.each(settings.classes.split(' '), function(cls) {
+					self.addClass(cls);
+				});
+			}
+
+			/**
+			 * Name/value object with settings for the current control.
+			 *
+			 * @field {Object} settings
+			 */
+			self.settings = settings;
+
+			self._borderBox = self.parseBox(settings.border);
+			self._paddingBox = self.parseBox(settings.padding);
+			self._marginBox = self.parseBox(settings.margin);
+
+			if (settings.hidden) {
+				self.hide();
+			}
+		},
+
+		// Will generate getter/setter methods for these properties
+		Properties: 'parent,title,text,width,height,disabled,active,name,value',
+
+		// Will generate empty dummy functions for these
+		Methods: 'renderHtml',
+
+		/**
+		 * Returns the root element to render controls into.
+		 *
+		 * @method getContainerElm
+		 * @return {Element} HTML DOM element to render into.
+		 */
+		getContainerElm: function() {
+			return document.body;
+		},
+
+		/**
+		 * Returns a control instance for the current DOM element.
+		 *
+		 * @method getParentCtrl
+		 * @param {Element} elm HTML dom element to get parent control from.
+		 * @return {tinymce.ui.Control} Control instance or undefined.
+		 */
+		getParentCtrl: function(elm) {
+			var ctrl, lookup = this.getRoot().controlIdLookup;
+
+			while (elm && lookup) {
+				ctrl = lookup[elm.id];
+				if (ctrl) {
+					break;
+				}
+
+				elm = elm.parentNode;
+			}
+
+			return ctrl;
+		},
+
+		/**
+		 * Parses the specified box value. A box value contains 1-4 properties in clockwise order.
+		 *
+		 * @method parseBox
+		 * @param {String/Number} value Box value "0 1 2 3" or "0" etc.
+		 * @return {Object} Object with top/right/bottom/left properties.
+		 * @private
+		 */
+		parseBox: function(value) {
+			var len, radix = 10;
+
+			if (!value) {
+				return;
+			}
+
+			if (typeof value === "number") {
+				value = value || 0;
+
+				return {
+					top: value,
+					left: value,
+					bottom: value,
+					right: value
+				};
+			}
+
+			value = value.split(' ');
+			len = value.length;
+
+			if (len === 1) {
+				value[1] = value[2] = value[3] = value[0];
+			} else if (len === 2) {
+				value[2] = value[0];
+				value[3] = value[1];
+			} else if (len === 3) {
+				value[3] = value[1];
+			}
+
+			return {
+				top: parseInt(value[0], radix) || 0,
+				right: parseInt(value[1], radix) || 0,
+				bottom: parseInt(value[2], radix) || 0,
+				left: parseInt(value[3], radix) || 0
+			};
+		},
+
+		borderBox: function() {
+			return this._borderBox;
+		},
+
+		paddingBox: function() {
+			return this._paddingBox;
+		},
+
+		marginBox: function() {
+			return this._marginBox;
+		},
+
+		measureBox: function(elm, prefix) {
+			function getStyle(name) {
+				var defaultView = document.defaultView;
+
+				if (defaultView) {
+					// Remove camelcase
+					name = name.replace(/[A-Z]/g, function(a) {
+						return '-' + a;
+					});
+
+					return defaultView.getComputedStyle(elm, null).getPropertyValue(name);
+				}
+
+				return elm.currentStyle[name];
+			}
+
+			function getSide(name) {
+				var val = parseFloat(getStyle(name), 10);
+
+				return isNaN(val) ? 0 : val;
+			}
+
+			return {
+				top: getSide(prefix + "TopWidth"),
+				right: getSide(prefix + "RightWidth"),
+				bottom: getSide(prefix + "BottomWidth"),
+				left: getSide(prefix + "LeftWidth")
+			};
+		},
+
+		/**
+		 * Initializes the current controls layout rect.
+		 * This will be executed by the layout managers to determine the
+		 * default minWidth/minHeight etc.
+		 *
+		 * @method initLayoutRect
+		 * @return {Object} Layout rect instance.
+		 */
+		initLayoutRect: function() {
+			var self = this, settings = self.settings, borderBox, layoutRect;
+			var elm = self.getEl(), width, height, minWidth, minHeight, autoResize;
+			var startMinWidth, startMinHeight, initialSize;
+
+			// Measure the current element
+			borderBox = self._borderBox = self._borderBox || self.measureBox(elm, 'border');
+			self._paddingBox = self._paddingBox || self.measureBox(elm, 'padding');
+			self._marginBox = self._marginBox || self.measureBox(elm, 'margin');
+			initialSize = DomUtils.getSize(elm);
+
+			// Setup minWidth/minHeight and width/height
+			startMinWidth = settings.minWidth;
+			startMinHeight = settings.minHeight;
+			minWidth = startMinWidth || initialSize.width;
+			minHeight = startMinHeight || initialSize.height;
+			width = settings.width;
+			height = settings.height;
+			autoResize = settings.autoResize;
+			autoResize = typeof autoResize != "undefined" ? autoResize : !width && !height;
+
+			width = width || minWidth;
+			height = height || minHeight;
+
+			var deltaW = borderBox.left + borderBox.right;
+			var deltaH = borderBox.top + borderBox.bottom;
+
+			var maxW = settings.maxWidth || 0xFFFF;
+			var maxH = settings.maxHeight || 0xFFFF;
+
+			// Setup initial layout rect
+			self._layoutRect = layoutRect = {
+				x: settings.x || 0,
+				y: settings.y || 0,
+				w: width,
+				h: height,
+				deltaW: deltaW,
+				deltaH: deltaH,
+				contentW: width - deltaW,
+				contentH: height - deltaH,
+				innerW: width - deltaW,
+				innerH: height - deltaH,
+				startMinWidth: startMinWidth || 0,
+				startMinHeight: startMinHeight || 0,
+				minW: Math.min(minWidth, maxW),
+				minH: Math.min(minHeight, maxH),
+				maxW: maxW,
+				maxH: maxH,
+				autoResize: autoResize,
+				scrollW: 0
+			};
+
+			self._lastLayoutRect = {};
+
+			return layoutRect;
+		},
+
+		/**
+		 * Getter/setter for the current layout rect.
+		 *
+		 * @method layoutRect
+		 * @param {Object} [newRect] Optional new layout rect.
+		 * @return {tinymce.ui.Control/Object} Current control or rect object.
+		 */
+		layoutRect: function(newRect) {
+			var self = this, curRect = self._layoutRect, lastLayoutRect, size, deltaWidth, deltaHeight, undef, repaintControls;
+
+			// Initialize default layout rect
+			if (!curRect) {
+				curRect = self.initLayoutRect();
+			}
+
+			// Set new rect values
+			if (newRect) {
+				// Calc deltas between inner and outer sizes
+				deltaWidth = curRect.deltaW;
+				deltaHeight = curRect.deltaH;
+
+				// Set x position
+				if (newRect.x !== undef) {
+					curRect.x = newRect.x;
+				}
+
+				// Set y position
+				if (newRect.y !== undef) {
+					curRect.y = newRect.y;
+				}
+
+				// Set minW
+				if (newRect.minW !== undef) {
+					curRect.minW = newRect.minW;
+				}
+
+				// Set minH
+				if (newRect.minH !== undef) {
+					curRect.minH = newRect.minH;
+				}
+
+				// Set new width and calculate inner width
+				size = newRect.w;
+				if (size !== undef) {
+					size = size < curRect.minW ? curRect.minW : size;
+					size = size > curRect.maxW ? curRect.maxW : size;
+					curRect.w = size;
+					curRect.innerW = size - deltaWidth;
+				}
+
+				// Set new height and calculate inner height
+				size = newRect.h;
+				if (size !== undef) {
+					size = size < curRect.minH ? curRect.minH : size;
+					size = size > curRect.maxH ? curRect.maxH : size;
+					curRect.h = size;
+					curRect.innerH = size - deltaHeight;
+				}
+
+				// Set new inner width and calculate width
+				size = newRect.innerW;
+				if (size !== undef) {
+					size = size < curRect.minW - deltaWidth ? curRect.minW - deltaWidth : size;
+					size = size > curRect.maxW - deltaWidth ? curRect.maxW - deltaWidth : size;
+					curRect.innerW = size;
+					curRect.w = size + deltaWidth;
+				}
+
+				// Set new height and calculate inner height
+				size = newRect.innerH;
+				if (size !== undef) {
+					size = size < curRect.minH - deltaHeight ? curRect.minH - deltaHeight : size;
+					size = size > curRect.maxH - deltaHeight ? curRect.maxH - deltaHeight : size;
+					curRect.innerH = size;
+					curRect.h = size + deltaHeight;
+				}
+
+				// Set new contentW
+				if (newRect.contentW !== undef) {
+					curRect.contentW = newRect.contentW;
+				}
+
+				// Set new contentH
+				if (newRect.contentH !== undef) {
+					curRect.contentH = newRect.contentH;
+				}
+
+				// Compare last layout rect with the current one to see if we need to repaint or not
+				lastLayoutRect = self._lastLayoutRect;
+				if (lastLayoutRect.x !== curRect.x || lastLayoutRect.y !== curRect.y ||
+					lastLayoutRect.w !== curRect.w || lastLayoutRect.h !== curRect.h) {
+					repaintControls = Control.repaintControls;
+
+					if (repaintControls) {
+						if (repaintControls.map && !repaintControls.map[self._id]) {
+							repaintControls.push(self);
+							repaintControls.map[self._id] = true;
+						}
+					}
+
+					lastLayoutRect.x = curRect.x;
+					lastLayoutRect.y = curRect.y;
+					lastLayoutRect.w = curRect.w;
+					lastLayoutRect.h = curRect.h;
+				}
+
+				return self;
+			}
+
+			return curRect;
+		},
+
+		/**
+		 * Repaints the control after a layout operation.
+		 *
+		 * @method repaint
+		 */
+		repaint: function() {
+			var self = this, style, bodyStyle, rect, borderBox, borderW = 0, borderH = 0, lastRepaintRect, round;
+
+			// Use Math.round on all values on IE < 9
+			round = !document.createRange ? Math.round : function(value) {
+				return value;
+			};
+
+			style = self.getEl().style;
+			rect = self._layoutRect;
+			lastRepaintRect = self._lastRepaintRect || {};
+
+			borderBox = self._borderBox;
+			borderW = borderBox.left + borderBox.right;
+			borderH = borderBox.top + borderBox.bottom;
+
+			if (rect.x !== lastRepaintRect.x) {
+				style.left = round(rect.x) + 'px';
+				lastRepaintRect.x = rect.x;
+			}
+
+			if (rect.y !== lastRepaintRect.y) {
+				style.top = round(rect.y) + 'px';
+				lastRepaintRect.y = rect.y;
+			}
+
+			if (rect.w !== lastRepaintRect.w) {
+				style.width = round(rect.w - borderW) + 'px';
+				lastRepaintRect.w = rect.w;
+			}
+
+			if (rect.h !== lastRepaintRect.h) {
+				style.height = round(rect.h - borderH) + 'px';
+				lastRepaintRect.h = rect.h;
+			}
+
+			// Update body if needed
+			if (self._hasBody && rect.innerW !== lastRepaintRect.innerW) {
+				bodyStyle = self.getEl('body').style;
+				bodyStyle.width = round(rect.innerW) + 'px';
+				lastRepaintRect.innerW = rect.innerW;
+			}
+
+			if (self._hasBody && rect.innerH !== lastRepaintRect.innerH) {
+				bodyStyle = bodyStyle || self.getEl('body').style;
+				bodyStyle.height = round(rect.innerH) + 'px';
+				lastRepaintRect.innerH = rect.innerH;
+			}
+
+			self._lastRepaintRect = lastRepaintRect;
+			self.fire('repaint', {}, false);
+		},
+
+		/**
+		 * Binds a callback to the specified event. This event can both be
+		 * native browser events like "click" or custom ones like PostRender.
+		 *
+		 * The callback function will be passed a DOM event like object that enables yout do stop propagation.
+		 *
+		 * @method on
+		 * @param {String} name Name of the event to bind. For example "click".
+		 * @param {String/function} callback Callback function to execute ones the event occurs.
+		 * @return {tinymce.ui.Control} Current control object.
+		 */
+		on: function(name, callback) {
+			var self = this;
+
+			function resolveCallbackName(name) {
+				var callback, scope;
+
+				if (typeof name != 'string') {
+					return name;
+				}
+
+				return function(e) {
+					if (!callback) {
+						self.parentsAndSelf().each(function(ctrl) {
+							var callbacks = ctrl.settings.callbacks;
+
+							if (callbacks && (callback = callbacks[name])) {
+								scope = ctrl;
+								return false;
+							}
+						});
+					}
+
+					return callback.call(scope, e);
+				};
+			}
+
+			getEventDispatcher(self).on(name, resolveCallbackName(callback));
+
+			return self;
+		},
+
+		/**
+		 * Unbinds the specified event and optionally a specific callback. If you omit the name
+		 * parameter all event handlers will be removed. If you omit the callback all event handles
+		 * by the specified name will be removed.
+		 *
+		 * @method off
+		 * @param {String} [name] Name for the event to unbind.
+		 * @param {function} [callback] Callback function to unbind.
+		 * @return {mxex.ui.Control} Current control object.
+		 */
+		off: function(name, callback) {
+			getEventDispatcher(this).off(name, callback);
+			return this;
+		},
+
+		/**
+		 * Fires the specified event by name and arguments on the control. This will execute all
+		 * bound event handlers.
+		 *
+		 * @method fire
+		 * @param {String} name Name of the event to fire.
+		 * @param {Object} [args] Arguments to pass to the event.
+		 * @param {Boolean} [bubble] Value to control bubbeling. Defaults to true.
+		 * @return {Object} Current arguments object.
+		 */
+		fire: function(name, args, bubble) {
+			var self = this;
+
+			args = args || {};
+
+			if (!args.control) {
+				args.control = self;
+			}
+
+			args = getEventDispatcher(self).fire(name, args);
+
+			// Bubble event up to parents
+			if (bubble !== false && self.parent) {
+				var parent = self.parent();
+				while (parent && !args.isPropagationStopped()) {
+					parent.fire(name, args, false);
+					parent = parent.parent();
+				}
+			}
+
+			return args;
+		},
+
+		/**
+		 * Returns true/false if the specified event has any listeners.
+		 *
+		 * @method hasEventListeners
+		 * @param {String} name Name of the event to check for.
+		 * @return {Boolean} True/false state if the event has listeners.
+		 */
+		hasEventListeners: function(name) {
+			return getEventDispatcher(this).has(name);
+		},
+
+		/**
+		 * Returns a control collection with all parent controls.
+		 *
+		 * @method parents
+		 * @param {String} selector Optional selector expression to find parents.
+		 * @return {tinymce.ui.Collection} Collection with all parent controls.
+		 */
+		parents: function(selector) {
+			var self = this, ctrl, parents = new Collection();
+
+			// Add each parent to collection
+			for (ctrl = self.parent(); ctrl; ctrl = ctrl.parent()) {
+				parents.add(ctrl);
+			}
+
+			// Filter away everything that doesn't match the selector
+			if (selector) {
+				parents = parents.filter(selector);
+			}
+
+			return parents;
+		},
+
+		/**
+		 * Returns the current control and it's parents.
+		 *
+		 * @method parentsAndSelf
+		 * @param {String} selector Optional selector expression to find parents.
+		 * @return {tinymce.ui.Collection} Collection with all parent controls.
+		 */
+		parentsAndSelf: function(selector) {
+			return new Collection(this).add(this.parents(selector));
+		},
+
+		/**
+		 * Returns the control next to the current control.
+		 *
+		 * @method next
+		 * @return {tinymce.ui.Control} Next control instance.
+		 */
+		next: function() {
+			var parentControls = this.parent().items();
+
+			return parentControls[parentControls.indexOf(this) + 1];
+		},
+
+		/**
+		 * Returns the control previous to the current control.
+		 *
+		 * @method prev
+		 * @return {tinymce.ui.Control} Previous control instance.
+		 */
+		prev: function() {
+			var parentControls = this.parent().items();
+
+			return parentControls[parentControls.indexOf(this) - 1];
+		},
+
+		/**
+		 * Find the common ancestor for two control instances.
+		 *
+		 * @method findCommonAncestor
+		 * @param {tinymce.ui.Control} ctrl1 First control.
+		 * @param {tinymce.ui.Control} ctrl2 Second control.
+		 * @return {tinymce.ui.Control} Ancestor control instance.
+		 */
+		findCommonAncestor: function(ctrl1, ctrl2) {
+			var parentCtrl;
+
+			while (ctrl1) {
+				parentCtrl = ctrl2;
+
+				while (parentCtrl && ctrl1 != parentCtrl) {
+					parentCtrl = parentCtrl.parent();
+				}
+
+				if (ctrl1 == parentCtrl) {
+					break;
+				}
+
+				ctrl1 = ctrl1.parent();
+			}
+
+			return ctrl1;
+		},
+
+		/**
+		 * Returns true/false if the specific control has the specific class.
+		 *
+		 * @method hasClass
+		 * @param {String} cls Class to check for.
+		 * @param {String} [group] Sub element group name.
+		 * @return {Boolean} True/false if the control has the specified class.
+		 */
+		hasClass: function(cls, group) {
+			var classes = this._classes[group || 'control'];
+
+			cls = this.classPrefix + cls;
+
+			return classes && !!classes.map[cls];
+		},
+
+		/**
+		 * Adds the specified class to the control
+		 *
+		 * @method addClass
+		 * @param {String} cls Class to check for.
+		 * @param {String} [group] Sub element group name.
+		 * @return {tinymce.ui.Control} Current control object.
+		 */
+		addClass: function(cls, group) {
+			var self = this, classes, elm;
+
+			cls = this.classPrefix + cls;
+			classes = self._classes[group || 'control'];
+
+			if (!classes) {
+				classes = [];
+				classes.map = {};
+				self._classes[group || 'control'] = classes;
+			}
+
+			if (!classes.map[cls]) {
+				classes.map[cls] = cls;
+				classes.push(cls);
+
+				if (self._rendered) {
+					elm = self.getEl(group);
+
+					if (elm) {
+						elm.className = classes.join(' ');
+					}
+				}
+			}
+
+			return self;
+		},
+
+		/**
+		 * Removes the specified class from the control.
+		 *
+		 * @method removeClass
+		 * @param {String} cls Class to remove.
+		 * @param {String} [group] Sub element group name.
+		 * @return {tinymce.ui.Control} Current control object.
+		 */
+		removeClass: function(cls, group) {
+			var self = this, classes, i, elm;
+
+			cls = this.classPrefix + cls;
+			classes = self._classes[group || 'control'];
+			if (classes && classes.map[cls]) {
+				delete classes.map[cls];
+
+				i = classes.length;
+				while (i--) {
+					if (classes[i] === cls) {
+						classes.splice(i, 1);
+					}
+				}
+			}
+
+			if (self._rendered) {
+				elm = self.getEl(group);
+
+				if (elm) {
+					elm.className = classes.join(' ');
+				}
+			}
+
+			return self;
+		},
+
+		/**
+		 * Toggles the specified class on the control.
+		 *
+		 * @method toggleClass
+		 * @param {String} cls Class to remove.
+		 * @param {Boolean} state True/false state to add/remove class.
+		 * @param {String} [group] Sub element group name.
+		 * @return {tinymce.ui.Control} Current control object.
+		 */
+		toggleClass: function(cls, state, group) {
+			var self = this;
+
+			if (state) {
+				self.addClass(cls, group);
+			} else {
+				self.removeClass(cls, group);
+			}
+
+			return self;
+		},
+
+		/**
+		 * Returns the class string for the specified group name.
+		 *
+		 * @method classes
+		 * @param {String} [group] Group to get clases by.
+		 * @return {String} Classes for the specified group.
+		 */
+		classes: function(group) {
+			var classes = this._classes[group || 'control'];
+
+			return classes ? classes.join(' ') : '';
+		},
+
+		/**
+		 * Sets the inner HTML of the control element.
+		 *
+		 * @method innerHtml
+		 * @param {String} html Html string to set as inner html.
+		 * @return {tinymce.ui.Control} Current control object.
+		 */
+		innerHtml: function(html) {
+			DomUtils.innerHtml(this.getEl(), html);
+			return this;
+		},
+
+		/**
+		 * Returns the control DOM element or sub element.
+		 *
+		 * @method getEl
+		 * @param {String} [suffix] Suffix to get element by.
+		 * @return {Element} HTML DOM element for the current control or it's children.
+		 */
+		getEl: function(suffix) {
+			var id = suffix ? this._id + '-' + suffix : this._id;
+
+			if (!this._elmCache[id]) {
+				this._elmCache[id] = DomUtils.get(id);
+			}
+
+			return this._elmCache[id];
+		},
+
+		/**
+		 * Sets/gets the visible for the control.
+		 *
+		 * @method visible
+		 * @param {Boolean} state Value to set to control.
+		 * @return {Boolean/tinymce.ui.Control} Current control on a set operation or current state on a get.
+		 */
+		visible: function(state) {
+			var self = this, parentCtrl;
+
+			if (typeof state !== "undefined") {
+				if (self._visible !== state) {
+					if (self._rendered) {
+						self.getEl().style.display = state ? '' : 'none';
+					}
+
+					self._visible = state;
+
+					// Parent container needs to reflow
+					parentCtrl = self.parent();
+					if (parentCtrl) {
+						parentCtrl._lastRect = null;
+					}
+
+					self.fire(state ? 'show' : 'hide');
+				}
+
+				return self;
+			}
+
+			return self._visible;
+		},
+
+		/**
+		 * Sets the visible state to true.
+		 *
+		 * @method show
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		show: function() {
+			return this.visible(true);
+		},
+
+		/**
+		 * Sets the visible state to false.
+		 *
+		 * @method hide
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		hide: function() {
+			return this.visible(false);
+		},
+
+		/**
+		 * Focuses the current control.
+		 *
+		 * @method focus
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		focus: function() {
+			try {
+				this.getEl().focus();
+			} catch (ex) {
+				// Ignore IE error
+			}
+
+			return this;
+		},
+
+		/**
+		 * Blurs the current control.
+		 *
+		 * @method blur
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		blur: function() {
+			this.getEl().blur();
+
+			return this;
+		},
+
+		/**
+		 * Sets the specified aria property.
+		 *
+		 * @method aria
+		 * @param {String} name Name of the aria property to set.
+		 * @param {String} value Value of the aria property.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		aria: function(name, value) {
+			var self = this, elm = self.getEl(self.ariaTarget);
+
+			if (typeof value === "undefined") {
+				return self._aria[name];
+			} else {
+				self._aria[name] = value;
+			}
+
+			if (self._rendered) {
+				elm.setAttribute(name == 'role' ? name : 'aria-' + name, value);
+			}
+
+			return self;
+		},
+
+		/**
+		 * Encodes the specified string with HTML entities. It will also
+		 * translate the string to different languages.
+		 *
+		 * @method encode
+		 * @param {String/Object/Array} text Text to entity encode.
+		 * @param {Boolean} [translate=true] False if the contents shouldn't be translated.
+		 * @return {String} Encoded and possible traslated string.
+		 */
+		encode: function(text, translate) {
+			if (translate !== false) {
+				text = this.translate(text);
+			}
+
+			return (text || '').replace(/[&<>"]/g, function(match) {
+				return '&#' + match.charCodeAt(0) + ';';
+			});
+		},
+
+		/**
+		 * Returns the translated string.
+		 *
+		 * @method translate
+		 * @param {String} text Text to translate.
+		 * @return {String} Translated string or the same as the input.
+		 */
+		translate: function(text) {
+			return Control.translate ? Control.translate(text) : text;
+		},
+
+		/**
+		 * Adds items before the current control.
+		 *
+		 * @method before
+		 * @param {Array/tinymce.ui.Collection} items Array of items to prepend before this control.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		before: function(items) {
+			var self = this, parent = self.parent();
+
+			if (parent) {
+				parent.insert(items, parent.items().indexOf(self), true);
+			}
+
+			return self;
+		},
+
+		/**
+		 * Adds items after the current control.
+		 *
+		 * @method after
+		 * @param {Array/tinymce.ui.Collection} items Array of items to append after this control.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		after: function(items) {
+			var self = this, parent = self.parent();
+
+			if (parent) {
+				parent.insert(items, parent.items().indexOf(self));
+			}
+
+			return self;
+		},
+
+		/**
+		 * Removes the current control from DOM and from UI collections.
+		 *
+		 * @method remove
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		remove: function() {
+			var self = this, elm = self.getEl(), parent = self.parent(), newItems, i;
+
+			if (self.items) {
+				var controls = self.items().toArray();
+				i = controls.length;
+				while (i--) {
+					controls[i].remove();
+				}
+			}
+
+			if (parent && parent.items) {
+				newItems = [];
+
+				parent.items().each(function(item) {
+					if (item !== self) {
+						newItems.push(item);
+					}
+				});
+
+				parent.items().set(newItems);
+				parent._lastRect = null;
+			}
+
+			if (self._eventsRoot && self._eventsRoot == self) {
+				DomUtils.off(elm);
+			}
+
+			var lookup = self.getRoot().controlIdLookup;
+			if (lookup) {
+				delete lookup[self._id];
+			}
+
+			if (elm && elm.parentNode) {
+				elm.parentNode.removeChild(elm);
+			}
+
+			self._rendered = false;
+
+			return self;
+		},
+
+		/**
+		 * Renders the control before the specified element.
+		 *
+		 * @method renderBefore
+		 * @param {Element} elm Element to render before.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		renderBefore: function(elm) {
+			var self = this;
+
+			elm.parentNode.insertBefore(DomUtils.createFragment(self.renderHtml()), elm);
+			self.postRender();
+
+			return self;
+		},
+
+		/**
+		 * Renders the control to the specified element.
+		 *
+		 * @method renderBefore
+		 * @param {Element} elm Element to render to.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		renderTo: function(elm) {
+			var self = this;
+
+			elm = elm || self.getContainerElm();
+			elm.appendChild(DomUtils.createFragment(self.renderHtml()));
+			self.postRender();
+
+			return self;
+		},
+
+		/**
+		 * Post render method. Called after the control has been rendered to the target.
+		 *
+		 * @method postRender
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		postRender: function() {
+			var self = this, settings = self.settings, elm, box, parent, name, parentEventsRoot;
+
+			// Bind on<event> settings
+			for (name in settings) {
+				if (name.indexOf("on") === 0) {
+					self.on(name.substr(2), settings[name]);
+				}
+			}
+
+			if (self._eventsRoot) {
+				for (parent = self.parent(); !parentEventsRoot && parent; parent = parent.parent()) {
+					parentEventsRoot = parent._eventsRoot;
+				}
+
+				if (parentEventsRoot) {
+					for (name in parentEventsRoot._nativeEvents) {
+						self._nativeEvents[name] = true;
+					}
+				}
+			}
+
+			self.bindPendingEvents();
+
+			if (settings.style) {
+				elm = self.getEl();
+				if (elm) {
+					elm.setAttribute('style', settings.style);
+					elm.style.cssText = settings.style;
+				}
+			}
+
+			if (!self._visible) {
+				DomUtils.css(self.getEl(), 'display', 'none');
+			}
+
+			if (self.settings.border) {
+				box = self.borderBox();
+				DomUtils.css(self.getEl(), {
+					'border-top-width': box.top,
+					'border-right-width': box.right,
+					'border-bottom-width': box.bottom,
+					'border-left-width': box.left
+				});
+			}
+
+			// Add instance to lookup
+			var root = self.getRoot();
+			if (!root.controlIdLookup) {
+				root.controlIdLookup = {};
+			}
+
+			root.controlIdLookup[self._id] = self;
+
+			for (var key in self._aria) {
+				self.aria(key, self._aria[key]);
+			}
+
+			self.fire('postrender', {}, false);
+		},
+
+		/**
+		 * Scrolls the current control into view.
+		 *
+		 * @method scrollIntoView
+		 * @param {String} align Alignment in view top|center|bottom.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		scrollIntoView: function(align) {
+			function getOffset(elm, rootElm) {
+				var x, y, parent = elm;
+
+				x = y = 0;
+				while (parent && parent != rootElm && parent.nodeType) {
+					x += parent.offsetLeft || 0;
+					y += parent.offsetTop || 0;
+					parent = parent.offsetParent;
+				}
+
+				return {x: x, y: y};
+			}
+
+			var elm = this.getEl(), parentElm = elm.parentNode;
+			var x, y, width, height, parentWidth, parentHeight;
+			var pos = getOffset(elm, parentElm);
+
+			x = pos.x;
+			y = pos.y;
+			width = elm.offsetWidth;
+			height = elm.offsetHeight;
+			parentWidth = parentElm.clientWidth;
+			parentHeight = parentElm.clientHeight;
+
+			if (align == "end") {
+				x -= parentWidth - width;
+				y -= parentHeight - height;
+			} else if (align == "center") {
+				x -= (parentWidth / 2) - (width / 2);
+				y -= (parentHeight / 2) - (height / 2);
+			}
+
+			parentElm.scrollLeft = x;
+			parentElm.scrollTop = y;
+
+			return this;
+		},
+
+		/**
+		 * Binds pending DOM events.
+		 *
+		 * @private
+		 */
+		bindPendingEvents: function() {
+			var self = this, i, l, parents, eventRootCtrl, nativeEvents, name;
+
+			function delegate(e) {
+				var control = self.getParentCtrl(e.target);
+
+				if (control) {
+					control.fire(e.type, e);
+				}
+			}
+
+			function mouseLeaveHandler() {
+				var ctrl = eventRootCtrl._lastHoverCtrl;
+
+				if (ctrl) {
+					ctrl.fire("mouseleave", {target: ctrl.getEl()});
+
+					ctrl.parents().each(function(ctrl) {
+						ctrl.fire("mouseleave", {target: ctrl.getEl()});
+					});
+
+					eventRootCtrl._lastHoverCtrl = null;
+				}
+			}
+
+			function mouseEnterHandler(e) {
+				var ctrl = self.getParentCtrl(e.target), lastCtrl = eventRootCtrl._lastHoverCtrl, idx = 0, i, parents, lastParents;
+
+				// Over on a new control
+				if (ctrl !== lastCtrl) {
+					eventRootCtrl._lastHoverCtrl = ctrl;
+
+					parents = ctrl.parents().toArray().reverse();
+					parents.push(ctrl);
+
+					if (lastCtrl) {
+						lastParents = lastCtrl.parents().toArray().reverse();
+						lastParents.push(lastCtrl);
+
+						for (idx = 0; idx < lastParents.length; idx++) {
+							if (parents[idx] !== lastParents[idx]) {
+								break;
+							}
+						}
+
+						for (i = lastParents.length - 1; i >= idx; i--) {
+							lastCtrl = lastParents[i];
+							lastCtrl.fire("mouseleave", {
+								target: lastCtrl.getEl()
+							});
+						}
+					}
+
+					for (i = idx; i < parents.length; i++) {
+						ctrl = parents[i];
+						ctrl.fire("mouseenter", {
+							target: ctrl.getEl()
+						});
+					}
+				}
+			}
+
+			function fixWheelEvent(e) {
+				e.preventDefault();
+
+				if (e.type == "mousewheel") {
+					e.deltaY = -1 / 40 * e.wheelDelta;
+
+					if (e.wheelDeltaX) {
+						e.deltaX = -1 / 40 * e.wheelDeltaX;
+					}
+				} else {
+					e.deltaX = 0;
+					e.deltaY = e.detail;
+				}
+
+				e = self.fire("wheel", e);
+			}
+
+			self._rendered = true;
+
+			nativeEvents = self._nativeEvents;
+			if (nativeEvents) {
+				// Find event root element if it exists
+				parents = self.parents().toArray();
+				parents.unshift(self);
+				for (i = 0, l = parents.length; !eventRootCtrl && i < l; i++) {
+					eventRootCtrl = parents[i]._eventsRoot;
+				}
+
+				// Event root wasn't found the use the root control
+				if (!eventRootCtrl) {
+					eventRootCtrl = parents[parents.length - 1] || self;
+				}
+
+				// Set the eventsRoot property on children that didn't have it
+				self._eventsRoot = eventRootCtrl;
+				for (l = i, i = 0; i < l; i++) {
+					parents[i]._eventsRoot = eventRootCtrl;
+				}
+
+				var eventRootDelegates = eventRootCtrl._delegates;
+				if (!eventRootDelegates) {
+					eventRootDelegates = eventRootCtrl._delegates = {};
+				}
+
+				// Bind native event delegates
+				for (name in nativeEvents) {
+					if (!nativeEvents) {
+						return false;
+					}
+
+					if (name === "wheel" && !hasWheelEventSupport) {
+						if (hasMouseWheelEventSupport) {
+							DomUtils.on(self.getEl(), "mousewheel", fixWheelEvent);
+						} else {
+							DomUtils.on(self.getEl(), "DOMMouseScroll", fixWheelEvent);
+						}
+
+						continue;
+					}
+
+					// Special treatment for mousenter/mouseleave since these doesn't bubble
+					if (name === "mouseenter" || name === "mouseleave") {
+						// Fake mousenter/mouseleave
+						if (!eventRootCtrl._hasMouseEnter) {
+							DomUtils.on(eventRootCtrl.getEl(), "mouseleave", mouseLeaveHandler);
+							DomUtils.on(eventRootCtrl.getEl(), "mouseover", mouseEnterHandler);
+							eventRootCtrl._hasMouseEnter = 1;
+						}
+					} else if (!eventRootDelegates[name]) {
+						DomUtils.on(eventRootCtrl.getEl(), name, delegate);
+						eventRootDelegates[name] = true;
+					}
+
+					// Remove the event once it's bound
+					nativeEvents[name] = false;
+				}
+			}
+		},
+
+		getRoot: function() {
+			var ctrl = this, rootControl, parents = [];
+
+			while (ctrl) {
+				if (ctrl.rootControl) {
+					rootControl = ctrl.rootControl;
+					break;
+				}
+
+				parents.push(ctrl);
+				rootControl = ctrl;
+				ctrl = ctrl.parent();
+			}
+
+			if (!rootControl) {
+				rootControl = this;
+			}
+
+			var i = parents.length;
+			while (i--) {
+				parents[i].rootControl = rootControl;
+			}
+
+			return rootControl;
+		},
+
+		/**
+		 * Reflows the current control and it's parents.
+		 * This should be used after you for example append children to the current control so
+		 * that the layout managers know that they need to reposition everything.
+		 *
+		 * @example
+		 * container.append({type: 'button', text: 'My button'}).reflow();
+		 *
+		 * @method reflow
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		reflow: function() {
+			this.repaint();
+
+			return this;
+		}
+
+		/**
+		 * Sets/gets the parent container for the control.
+		 *
+		 * @method parent
+		 * @param {tinymce.ui.Container} parent Optional parent to set.
+		 * @return {tinymce.ui.Control} Parent control or the current control on a set action.
+		 */
+		// parent: function(parent) {} -- Generated
+
+		/**
+		 * Sets/gets the text for the control.
+		 *
+		 * @method text
+		 * @param {String} value Value to set to control.
+		 * @return {String/tinymce.ui.Control} Current control on a set operation or current value on a get.
+		 */
+		// text: function(value) {} -- Generated
+
+		/**
+		 * Sets/gets the width for the control.
+		 *
+		 * @method width
+		 * @param {Number} value Value to set to control.
+		 * @return {Number/tinymce.ui.Control} Current control on a set operation or current value on a get.
+		 */
+		// width: function(value) {} -- Generated
+
+		/**
+		 * Sets/gets the height for the control.
+		 *
+		 * @method height
+		 * @param {Number} value Value to set to control.
+		 * @return {Number/tinymce.ui.Control} Current control on a set operation or current value on a get.
+		 */
+		// height: function(value) {} -- Generated
+
+		/**
+		 * Sets/gets the disabled state on the control.
+		 *
+		 * @method disabled
+		 * @param {Boolean} state Value to set to control.
+		 * @return {Boolean/tinymce.ui.Control} Current control on a set operation or current state on a get.
+		 */
+		// disabled: function(state) {} -- Generated
+
+		/**
+		 * Sets/gets the active for the control.
+		 *
+		 * @method active
+		 * @param {Boolean} state Value to set to control.
+		 * @return {Boolean/tinymce.ui.Control} Current control on a set operation or current state on a get.
+		 */
+		// active: function(state) {} -- Generated
+
+		/**
+		 * Sets/gets the name for the control.
+		 *
+		 * @method name
+		 * @param {String} value Value to set to control.
+		 * @return {String/tinymce.ui.Control} Current control on a set operation or current value on a get.
+		 */
+		// name: function(value) {} -- Generated
+
+		/**
+		 * Sets/gets the title for the control.
+		 *
+		 * @method title
+		 * @param {String} value Value to set to control.
+		 * @return {String/tinymce.ui.Control} Current control on a set operation or current value on a get.
+		 */
+		// title: function(value) {} -- Generated
+	});
+
+	return Control;
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/DomUtils.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,101 @@
+/**
+ * DOMUtils.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+define("tinymce/ui/DomUtils", [
+	"tinymce/util/Tools",
+	"tinymce/dom/DOMUtils"
+], function(Tools, DOMUtils) {
+	"use strict";
+
+	var count = 0;
+
+	return {
+		id: function() {
+			return 'mceu_' + (count++);
+		},
+
+		createFragment: function(html) {
+			return DOMUtils.DOM.createFragment(html);
+		},
+
+		getWindowSize: function() {
+			return DOMUtils.DOM.getViewPort();
+		},
+
+		getSize: function(elm) {
+			var width, height;
+
+			if (elm.getBoundingClientRect) {
+				var rect = elm.getBoundingClientRect();
+
+				width = Math.max(rect.width || (rect.right - rect.left), elm.offsetWidth);
+				height = Math.max(rect.height || (rect.bottom - rect.bottom), elm.offsetHeight);
+			} else {
+				width = elm.offsetWidth;
+				height = elm.offsetHeight;
+			}
+
+			return {width: width, height: height};
+		},
+
+		getPos: function(elm, root) {
+			return DOMUtils.DOM.getPos(elm, root);
+		},
+
+		getViewPort: function(win) {
+			return DOMUtils.DOM.getViewPort(win);
+		},
+
+		get: function(id) {
+			return document.getElementById(id);
+		},
+
+		addClass: function(elm, cls) {
+			return DOMUtils.DOM.addClass(elm, cls);
+		},
+
+		removeClass: function(elm, cls) {
+			return DOMUtils.DOM.removeClass(elm, cls);
+		},
+
+		hasClass: function(elm, cls) {
+			return DOMUtils.DOM.hasClass(elm, cls);
+		},
+
+		toggleClass: function(elm, cls, state) {
+			return DOMUtils.DOM.toggleClass(elm, cls, state);
+		},
+
+		css: function(elm, name, value) {
+			return DOMUtils.DOM.setStyle(elm, name, value);
+		},
+
+		getRuntimeStyle: function(elm, name) {
+			return DOMUtils.DOM.getStyle(elm, name, true);
+		},
+
+		on: function(target, name, callback, scope) {
+			return DOMUtils.DOM.bind(target, name, callback, scope);
+		},
+
+		off: function(target, name, callback) {
+			return DOMUtils.DOM.unbind(target, name, callback);
+		},
+
+		fire: function(target, name, args) {
+			return DOMUtils.DOM.fire(target, name, args);
+		},
+
+		innerHtml: function(elm, html) {
+			// Workaround for <div> in <p> bug on IE 8 #6178
+			DOMUtils.DOM.setHTML(elm, html);
+		}
+	};
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/DragHelper.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,135 @@
+/**
+ * DragHelper.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Drag/drop helper class.
+ *
+ * @example
+ * var dragHelper = new tinymce.ui.DragHelper('mydiv', {
+ *     start: function(evt) {
+ *     },
+ *
+ *     drag: function(evt) {
+ *     },
+ *
+ *     end: function(evt) {
+ *     }
+ * });
+ *
+ * @class tinymce.ui.DragHelper
+ */
+define("tinymce/ui/DragHelper", [
+	"tinymce/ui/DomUtils"
+], function(DomUtils) {
+	"use strict";
+
+	function getDocumentSize() {
+		var doc = document, documentElement, body, scrollWidth, clientWidth;
+		var offsetWidth, scrollHeight, clientHeight, offsetHeight, max = Math.max;
+
+		documentElement = doc.documentElement;
+		body = doc.body;
+
+		scrollWidth = max(documentElement.scrollWidth, body.scrollWidth);
+		clientWidth = max(documentElement.clientWidth, body.clientWidth);
+		offsetWidth = max(documentElement.offsetWidth, body.offsetWidth);
+
+		scrollHeight = max(documentElement.scrollHeight, body.scrollHeight);
+		clientHeight = max(documentElement.clientHeight, body.clientHeight);
+		offsetHeight = max(documentElement.offsetHeight, body.offsetHeight);
+
+		return {
+			width: scrollWidth < offsetWidth ? clientWidth : scrollWidth,
+			height: scrollHeight < offsetHeight ? clientHeight : scrollHeight
+		};
+	}
+
+	return function(id, settings) {
+		var eventOverlayElm, doc = document, downButton, start, stop, drag, startX, startY;
+
+		settings = settings || {};
+
+		function getHandleElm() {
+			return doc.getElementById(settings.handle || id);
+		}
+
+		start = function(e) {
+			var docSize = getDocumentSize(), handleElm, cursor;
+
+			e.preventDefault();
+			downButton = e.button;
+			handleElm = getHandleElm();
+			startX = e.screenX;
+			startY = e.screenY;
+
+			// Grab cursor from handle
+			if (window.getComputedStyle) {
+				cursor = window.getComputedStyle(handleElm, null).getPropertyValue("cursor");
+			} else {
+				cursor = handleElm.runtimeStyle.cursor;
+			}
+
+			// Create event overlay and add it to document
+			eventOverlayElm = doc.createElement('div');
+			DomUtils.css(eventOverlayElm, {
+				position: "absolute",
+				top: 0, left: 0,
+				width: docSize.width,
+				height: docSize.height,
+				zIndex: 0x7FFFFFFF,
+				opacity: 0.0001,
+				cursor: cursor
+			});
+
+			doc.body.appendChild(eventOverlayElm);
+
+			// Bind mouse events
+			DomUtils.on(doc, 'mousemove', drag);
+			DomUtils.on(doc, 'mouseup', stop);
+
+			// Begin drag
+			settings.start(e);
+		};
+
+		drag = function(e) {
+			if (e.button !== downButton) {
+				return stop(e);
+			}
+
+			e.deltaX = e.screenX - startX;
+			e.deltaY = e.screenY - startY;
+
+			e.preventDefault();
+			settings.drag(e);
+		};
+
+		stop = function(e) {
+			DomUtils.off(doc, 'mousemove', drag);
+			DomUtils.off(doc, 'mouseup', stop);
+
+			eventOverlayElm.parentNode.removeChild(eventOverlayElm);
+
+			if (settings.stop) {
+				settings.stop(e);
+			}
+		};
+
+		/**
+		 * Destroys the drag/drop helper instance.
+		 *
+		 * @method destroy
+		 */
+		this.destroy = function() {
+			DomUtils.off(getHandleElm());
+		};
+
+		DomUtils.on(getHandleElm(), 'mousedown', start);
+	};
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ElementPath.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,79 @@
+/**
+ * ElementPath.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This control creates an path for the current selections parent elements in TinyMCE.
+ *
+ * @class tinymce.ui.ElementPath
+ * @extends tinymce.ui.Path
+ */
+define("tinymce/ui/ElementPath", [
+	"tinymce/ui/Path",
+	"tinymce/EditorManager"
+], function(Path, EditorManager) {
+	return Path.extend({
+		/**
+		 * Post render method. Called after the control has been rendered to the target.
+		 *
+		 * @method postRender
+		 * @return {tinymce.ui.ElementPath} Current combobox instance.
+		 */
+		postRender: function() {
+			var self = this, editor = EditorManager.activeEditor;
+
+			function isHidden(elm) {
+				if (elm.nodeType === 1) {
+					if (elm.nodeName == "BR" || !!elm.getAttribute('data-mce-bogus')) {
+						return true;
+					}
+
+					if (elm.getAttribute('data-mce-type') === 'bookmark') {
+						return true;
+					}
+				}
+
+				return false;
+			}
+
+			if (editor.settings.elementpath !== false) {
+				self.on('select', function(e) {
+					editor.focus();
+					editor.selection.select(this.data()[e.index].element);
+					editor.nodeChanged();
+				});
+
+				editor.on('nodeChange', function(e) {
+					var outParents = [], parents = e.parents, i = parents.length;
+
+					while (i--) {
+						if (parents[i].nodeType == 1 && !isHidden(parents[i])) {
+							var args = editor.fire('ResolveName', {
+								name: parents[i].nodeName.toLowerCase(),
+								target: parents[i]
+							});
+
+							if (!args.isDefaultPrevented()) {
+								outParents.push({name: args.name, element: parents[i]});
+							}
+
+							if (args.isPropagationStopped()) {
+								break;
+							}
+						}
+					}
+
+					self.data(outParents);
+				});
+			}
+
+			return self._super();
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Factory.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,105 @@
+/**
+ * Factory.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+/**
+ * This class is a factory for control instances. This enables you
+ * to create instances of controls without having to require the UI controls directly.
+ *
+ * It also allow you to override or add new control types.
+ *
+ * @class tinymce.ui.Factory
+ */
+define("tinymce/ui/Factory", [], function() {
+	"use strict";
+
+	var types = {}, namespaceInit;
+
+	return {
+		/**
+		 * Adds a new control instance type to the factory.
+		 *
+		 * @method add
+		 * @param {String} type Type name for example "button".
+		 * @param {function} typeClass Class type function.
+		 */
+		add: function(type, typeClass) {
+			types[type.toLowerCase()] = typeClass;
+		},
+
+		/**
+		 * Returns true/false if the specified type exists or not.
+		 *
+		 * @method has
+		 * @param {String} type Type to look for.
+		 * @return {Boolean} true/false if the control by name exists.
+		 */
+		has: function(type) {
+			return !!types[type.toLowerCase()];
+		},
+
+		/**
+		 * Creates a new control instance based on the settings provided. The instance created will be
+		 * based on the specified type property it can also create whole structures of components out of
+		 * the specified JSON object.
+		 *
+		 * @example
+		 * tinymce.ui.Factory.create({
+		 *     type: 'button',
+		 *     text: 'Hello world!'
+		 * });
+		 *
+		 * @method create
+		 * @param {Object/String} settings Name/Value object with items used to create the type.
+		 * @return {tinymce.ui.Control} Control instance based on the specified type.
+		 */
+		create: function(type, settings) {
+			var ControlType, name, namespace;
+
+			// Build type lookup
+			if (!namespaceInit) {
+				namespace = tinymce.ui;
+
+				for (name in namespace) {
+					types[name.toLowerCase()] = namespace[name];
+				}
+
+				namespaceInit = true;
+			}
+
+			// If string is specified then use it as the type
+			if (typeof type == 'string') {
+				settings = settings || {};
+				settings.type = type;
+			} else {
+				settings = type;
+				type = settings.type;
+			}
+
+			// Find control type
+			type = type.toLowerCase();
+			ControlType = types[type];
+
+			// #if debug
+
+			if (!ControlType) {
+				throw new Error("Could not find control by type: " + type);
+			}
+
+			// #endif
+
+			ControlType = new ControlType(settings);
+			ControlType.type = type; // Set the type on the instance, this will be used by the Selector engine
+
+			return ControlType;
+		}
+	};
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FieldSet.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,59 @@
+/**
+ * FieldSet.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class creates fieldset containers.
+ *
+ * @-x-less FieldSet.less
+ * @class tinymce.ui.FieldSet
+ * @extends tinymce.ui.Form
+ */
+define("tinymce/ui/FieldSet", [
+	"tinymce/ui/Form"
+], function(Form) {
+	"use strict";
+
+	return Form.extend({
+		Defaults: {
+			containerCls: 'fieldset',
+			layout: 'flex',
+			direction: 'column',
+			align: 'stretch',
+			flex: 1,
+			padding: "25 15 5 15",
+			labelGap: 30,
+			spacing: 10,
+			border: 1
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, layout = self._layout, prefix = self.classPrefix;
+
+			self.preRender();
+			layout.preRender(self);
+
+			return (
+				'<fieldset id="' + self._id + '" class="' + self.classes() + '" hidefocus="1" tabindex="-1">' +
+					(self.settings.title ? ('<legend id="' + self._id + '-title" class="' + prefix + 'fieldset-title">' +
+						self.settings.title + '</legend>') : '') +
+					'<div id="' + self._id + '-body" class="' + self.classes('body') + '">' +
+						(self.settings.html || '') + layout.renderHtml(self) +
+					'</div>' +
+				'</fieldset>'
+			);
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FilePicker.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,85 @@
+/**
+ * FilePicker.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+/**
+ * This class creates a file picker control.
+ *
+ * @class tinymce.ui.FilePicker
+ * @extends tinymce.ui.ComboBox
+ */
+define("tinymce/ui/FilePicker", [
+	"tinymce/ui/ComboBox",
+	"tinymce/util/Tools"
+], function(ComboBox, Tools) {
+	"use strict";
+
+	return ComboBox.extend({
+		/**
+		 * Constructs a new control instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 */
+		init: function(settings) {
+			var self = this, editor = tinymce.activeEditor, editorSettings = editor.settings;
+			var actionCallback, fileBrowserCallback, fileBrowserCallbackTypes;
+
+			settings.spellcheck = false;
+
+			fileBrowserCallbackTypes = editorSettings.file_picker_types || editorSettings.file_browser_callback_types;
+			if (fileBrowserCallbackTypes) {
+				fileBrowserCallbackTypes = Tools.makeMap(fileBrowserCallbackTypes, /[, ]/);
+			}
+
+			if (!fileBrowserCallbackTypes || fileBrowserCallbackTypes[settings.filetype]) {
+				fileBrowserCallback = editorSettings.file_picker_callback;
+				if (fileBrowserCallback && (!fileBrowserCallbackTypes || fileBrowserCallbackTypes[settings.filetype])) {
+					actionCallback = function() {
+						var meta = self.fire('beforecall').meta;
+
+						meta = Tools.extend({filetype: settings.filetype}, meta);
+
+						// file_picker_callback(callback, currentValue, metaData)
+						fileBrowserCallback.call(
+							editor,
+							function(value, meta) {
+								self.value(value).fire('change', {meta: meta});
+							},
+							self.value(),
+							meta
+						);
+					};
+				} else {
+					// Legacy callback: file_picker_callback(id, currentValue, filetype, window)
+					fileBrowserCallback = editorSettings.file_browser_callback;
+					if (fileBrowserCallback && (!fileBrowserCallbackTypes || fileBrowserCallbackTypes[settings.filetype])) {
+						actionCallback = function() {
+							fileBrowserCallback(
+								self.getEl('inp').id,
+								self.value(),
+								settings.filetype,
+								window
+							);
+						};
+					}
+				}
+			}
+
+			if (actionCallback) {
+				settings.icon = 'browse';
+				settings.onaction = actionCallback;
+			}
+
+			self._super(settings);
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FitLayout.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,48 @@
+/**
+ * FitLayout.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This layout manager will resize the control to be the size of it's parent container.
+ * In other words width: 100% and height: 100%.
+ *
+ * @-x-less FitLayout.less
+ * @class tinymce.ui.FitLayout
+ * @extends tinymce.ui.AbsoluteLayout
+ */
+define("tinymce/ui/FitLayout", [
+	"tinymce/ui/AbsoluteLayout"
+], function(AbsoluteLayout) {
+	"use strict";
+
+	return AbsoluteLayout.extend({
+		/**
+		 * Recalculates the positions of the controls in the specified container.
+		 *
+		 * @method recalc
+		 * @param {tinymce.ui.Container} container Container instance to recalc.
+		 */
+		recalc: function(container) {
+			var contLayoutRect = container.layoutRect(), paddingBox = container.paddingBox();
+
+			container.items().filter(':visible').each(function(ctrl) {
+				ctrl.layoutRect({
+					x: paddingBox.left,
+					y: paddingBox.top,
+					w: contLayoutRect.innerW - paddingBox.right - paddingBox.left,
+					h: contLayoutRect.innerH - paddingBox.top - paddingBox.bottom
+				});
+
+				if (ctrl.recalc) {
+					ctrl.recalc();
+				}
+			});
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FlexLayout.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,246 @@
+/**
+ * FlexLayout.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This layout manager works similar to the CSS flex box.
+ *
+ * @setting {String} direction row|row-reverse|column|column-reverse
+ * @setting {Number} flex A positive-number to flex by.
+ * @setting {String} align start|end|center|stretch
+ * @setting {String} pack start|end|justify
+ *
+ * @class tinymce.ui.FlexLayout
+ * @extends tinymce.ui.AbsoluteLayout
+ */
+define("tinymce/ui/FlexLayout", [
+	"tinymce/ui/AbsoluteLayout"
+], function(AbsoluteLayout) {
+	"use strict";
+
+	return AbsoluteLayout.extend({
+		/**
+		 * Recalculates the positions of the controls in the specified container.
+		 *
+		 * @method recalc
+		 * @param {tinymce.ui.Container} container Container instance to recalc.
+		 */
+		recalc: function(container) {
+			// A ton of variables, needs to be in the same scope for performance
+			var i, l, items, contLayoutRect, contPaddingBox, contSettings, align, pack, spacing, totalFlex, availableSpace, direction;
+			var ctrl, ctrlLayoutRect, ctrlSettings, flex, maxSizeItems = [], size, maxSize, ratio, rect, pos, maxAlignEndPos;
+			var sizeName, minSizeName, posName, maxSizeName, beforeName, innerSizeName, deltaSizeName, contentSizeName;
+			var alignAxisName, alignInnerSizeName, alignSizeName, alignMinSizeName, alignBeforeName, alignAfterName;
+			var alignDeltaSizeName, alignContentSizeName;
+			var max = Math.max, min = Math.min;
+
+			// Get container items, properties and settings
+			items = container.items().filter(':visible');
+			contLayoutRect = container.layoutRect();
+			contPaddingBox = container._paddingBox;
+			contSettings = container.settings;
+			direction = container.isRtl() ? (contSettings.direction || 'row-reversed') : contSettings.direction;
+			align = contSettings.align;
+			pack = container.isRtl() ? (contSettings.pack || 'end') : contSettings.pack;
+			spacing = contSettings.spacing || 0;
+
+			if (direction == "row-reversed" || direction == "column-reverse") {
+				items = items.set(items.toArray().reverse());
+				direction = direction.split('-')[0];
+			}
+
+			// Setup axis variable name for row/column direction since the calculations is the same
+			if (direction == "column") {
+				posName = "y";
+				sizeName = "h";
+				minSizeName = "minH";
+				maxSizeName = "maxH";
+				innerSizeName = "innerH";
+				beforeName = 'top';
+				deltaSizeName = "deltaH";
+				contentSizeName = "contentH";
+
+				alignBeforeName = "left";
+				alignSizeName = "w";
+				alignAxisName = "x";
+				alignInnerSizeName = "innerW";
+				alignMinSizeName = "minW";
+				alignAfterName = "right";
+				alignDeltaSizeName = "deltaW";
+				alignContentSizeName = "contentW";
+			} else {
+				posName = "x";
+				sizeName = "w";
+				minSizeName = "minW";
+				maxSizeName = "maxW";
+				innerSizeName = "innerW";
+				beforeName = 'left';
+				deltaSizeName = "deltaW";
+				contentSizeName = "contentW";
+
+				alignBeforeName = "top";
+				alignSizeName = "h";
+				alignAxisName = "y";
+				alignInnerSizeName = "innerH";
+				alignMinSizeName = "minH";
+				alignAfterName = "bottom";
+				alignDeltaSizeName = "deltaH";
+				alignContentSizeName = "contentH";
+			}
+
+			// Figure out total flex, availableSpace and collect any max size elements
+			availableSpace = contLayoutRect[innerSizeName] - contPaddingBox[beforeName] - contPaddingBox[beforeName];
+			maxAlignEndPos = totalFlex = 0;
+			for (i = 0, l = items.length; i < l; i++) {
+				ctrl = items[i];
+				ctrlLayoutRect = ctrl.layoutRect();
+				ctrlSettings = ctrl.settings;
+				flex = ctrlSettings.flex;
+				availableSpace -= (i < l - 1 ? spacing : 0);
+
+				if (flex > 0) {
+					totalFlex += flex;
+
+					// Flexed item has a max size then we need to check if we will hit that size
+					if (ctrlLayoutRect[maxSizeName]) {
+						maxSizeItems.push(ctrl);
+					}
+
+					ctrlLayoutRect.flex = flex;
+				}
+
+				availableSpace -= ctrlLayoutRect[minSizeName];
+
+				// Calculate the align end position to be used to check for overflow/underflow
+				size = contPaddingBox[alignBeforeName] + ctrlLayoutRect[alignMinSizeName] + contPaddingBox[alignAfterName];
+				if (size > maxAlignEndPos) {
+					maxAlignEndPos = size;
+				}
+			}
+
+			// Calculate minW/minH
+			rect = {};
+			if (availableSpace < 0) {
+				rect[minSizeName] = contLayoutRect[minSizeName] - availableSpace + contLayoutRect[deltaSizeName];
+			} else {
+				rect[minSizeName] = contLayoutRect[innerSizeName] - availableSpace + contLayoutRect[deltaSizeName];
+			}
+
+			rect[alignMinSizeName] = maxAlignEndPos + contLayoutRect[alignDeltaSizeName];
+
+			rect[contentSizeName] = contLayoutRect[innerSizeName] - availableSpace;
+			rect[alignContentSizeName] = maxAlignEndPos;
+			rect.minW = min(rect.minW, contLayoutRect.maxW);
+			rect.minH = min(rect.minH, contLayoutRect.maxH);
+			rect.minW = max(rect.minW, contLayoutRect.startMinWidth);
+			rect.minH = max(rect.minH, contLayoutRect.startMinHeight);
+
+			// Resize container container if minSize was changed
+			if (contLayoutRect.autoResize && (rect.minW != contLayoutRect.minW || rect.minH != contLayoutRect.minH)) {
+				rect.w = rect.minW;
+				rect.h = rect.minH;
+
+				container.layoutRect(rect);
+				this.recalc(container);
+
+				// Forced recalc for example if items are hidden/shown
+				if (container._lastRect === null) {
+					var parentCtrl = container.parent();
+					if (parentCtrl) {
+						parentCtrl._lastRect = null;
+						parentCtrl.recalc();
+					}
+				}
+
+				return;
+			}
+
+			// Handle max size elements, check if they will become to wide with current options
+			ratio = availableSpace / totalFlex;
+			for (i = 0, l = maxSizeItems.length; i < l; i++) {
+				ctrl = maxSizeItems[i];
+				ctrlLayoutRect = ctrl.layoutRect();
+				maxSize = ctrlLayoutRect[maxSizeName];
+				size = ctrlLayoutRect[minSizeName] + ctrlLayoutRect.flex * ratio;
+
+				if (size > maxSize) {
+					availableSpace -= (ctrlLayoutRect[maxSizeName] - ctrlLayoutRect[minSizeName]);
+					totalFlex -= ctrlLayoutRect.flex;
+					ctrlLayoutRect.flex = 0;
+					ctrlLayoutRect.maxFlexSize = maxSize;
+				} else {
+					ctrlLayoutRect.maxFlexSize = 0;
+				}
+			}
+
+			// Setup new ratio, target layout rect, start position
+			ratio = availableSpace / totalFlex;
+			pos = contPaddingBox[beforeName];
+			rect = {};
+
+			// Handle pack setting moves the start position to end, center
+			if (totalFlex === 0) {
+				if (pack == "end") {
+					pos = availableSpace + contPaddingBox[beforeName];
+				} else if (pack == "center") {
+					pos = Math.round(
+						(contLayoutRect[innerSizeName] / 2) - ((contLayoutRect[innerSizeName] - availableSpace) / 2)
+					) + contPaddingBox[beforeName];
+
+					if (pos < 0) {
+						pos = contPaddingBox[beforeName];
+					}
+				} else if (pack == "justify") {
+					pos = contPaddingBox[beforeName];
+					spacing = Math.floor(availableSpace / (items.length - 1));
+				}
+			}
+
+			// Default aligning (start) the other ones needs to be calculated while doing the layout
+			rect[alignAxisName] = contPaddingBox[alignBeforeName];
+
+			// Start laying out controls
+			for (i = 0, l = items.length; i < l; i++) {
+				ctrl = items[i];
+				ctrlLayoutRect = ctrl.layoutRect();
+				size = ctrlLayoutRect.maxFlexSize || ctrlLayoutRect[minSizeName];
+
+				// Align the control on the other axis
+				if (align === "center") {
+					rect[alignAxisName] = Math.round((contLayoutRect[alignInnerSizeName] / 2) - (ctrlLayoutRect[alignSizeName] / 2));
+				} else if (align === "stretch") {
+					rect[alignSizeName] = max(
+						ctrlLayoutRect[alignMinSizeName] || 0,
+						contLayoutRect[alignInnerSizeName] - contPaddingBox[alignBeforeName] - contPaddingBox[alignAfterName]
+					);
+					rect[alignAxisName] = contPaddingBox[alignBeforeName];
+				} else if (align === "end") {
+					rect[alignAxisName] = contLayoutRect[alignInnerSizeName] - ctrlLayoutRect[alignSizeName] - contPaddingBox.top;
+				}
+
+				// Calculate new size based on flex
+				if (ctrlLayoutRect.flex > 0) {
+					size += ctrlLayoutRect.flex * ratio;
+				}
+
+				rect[sizeName] = size;
+				rect[posName] = pos;
+				ctrl.layoutRect(rect);
+
+				// Recalculate containers
+				if (ctrl.recalc) {
+					ctrl.recalc();
+				}
+
+				// Move x/y position
+				pos += size + spacing;
+			}
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FloatPanel.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,400 @@
+/**
+ * FloatPanel.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class creates a floating panel.
+ *
+ * @-x-less FloatPanel.less
+ * @class tinymce.ui.FloatPanel
+ * @extends tinymce.ui.Panel
+ * @mixes tinymce.ui.Movable
+ * @mixes tinymce.ui.Resizable
+ */
+define("tinymce/ui/FloatPanel", [
+	"tinymce/ui/Panel",
+	"tinymce/ui/Movable",
+	"tinymce/ui/Resizable",
+	"tinymce/ui/DomUtils"
+], function(Panel, Movable, Resizable, DomUtils) {
+	"use strict";
+
+	var documentClickHandler, documentScrollHandler, windowResizeHandler, visiblePanels = [];
+	var zOrder = [], hasModal;
+
+	function bindDocumentClickHandler() {
+		function isChildOf(ctrl, parent) {
+			while (ctrl) {
+				if (ctrl == parent) {
+					return true;
+				}
+
+				ctrl = ctrl.parent();
+			}
+		}
+
+		if (!documentClickHandler) {
+			documentClickHandler = function(e) {
+				// Gecko fires click event and in the wrong order on Mac so lets normalize
+				if (e.button == 2) {
+					return;
+				}
+
+				// Hide any float panel when a click is out side that float panel and the
+				// float panels direct parent for example a click on a menu button
+				var i = visiblePanels.length;
+				while (i--) {
+					var panel = visiblePanels[i], clickCtrl = panel.getParentCtrl(e.target);
+
+					if (panel.settings.autohide) {
+						if (clickCtrl) {
+							if (isChildOf(clickCtrl, panel) || panel.parent() === clickCtrl) {
+								continue;
+							}
+						}
+
+						e = panel.fire('autohide', {target: e.target});
+						if (!e.isDefaultPrevented()) {
+							panel.hide();
+						}
+					}
+				}
+			};
+
+			DomUtils.on(document, 'click', documentClickHandler);
+		}
+	}
+
+	function bindDocumentScrollHandler() {
+		if (!documentScrollHandler) {
+			documentScrollHandler = function() {
+				var i;
+
+				i = visiblePanels.length;
+				while (i--) {
+					repositionPanel(visiblePanels[i]);
+				}
+			};
+
+			DomUtils.on(window, 'scroll', documentScrollHandler);
+		}
+	}
+
+	function bindWindowResizeHandler() {
+		if (!windowResizeHandler) {
+			var docElm = document.documentElement, clientWidth = docElm.clientWidth, clientHeight = docElm.clientHeight;
+
+			windowResizeHandler = function() {
+				// Workaround for #7065 IE 7 fires resize events event though the window wasn't resized
+				if (!document.all || clientWidth != docElm.clientWidth || clientHeight != docElm.clientHeight) {
+					clientWidth = docElm.clientWidth;
+					clientHeight = docElm.clientHeight;
+					FloatPanel.hideAll();
+				}
+			};
+
+			DomUtils.on(window, 'resize', windowResizeHandler);
+		}
+	}
+
+	/**
+	 * Repositions the panel to the top of page if the panel is outside of the visual viewport. It will
+	 * also reposition all child panels of the current panel.
+	 */
+	function repositionPanel(panel) {
+		var scrollY = DomUtils.getViewPort().y;
+
+		function toggleFixedChildPanels(fixed, deltaY) {
+			var parent;
+
+			for (var i = 0; i < visiblePanels.length; i++) {
+				if (visiblePanels[i] != panel) {
+					parent = visiblePanels[i].parent();
+
+					while (parent && (parent = parent.parent())) {
+						if (parent == panel) {
+							visiblePanels[i].fixed(fixed).moveBy(0, deltaY).repaint();
+						}
+					}
+				}
+			}
+		}
+
+		if (panel.settings.autofix) {
+			if (!panel._fixed) {
+				panel._autoFixY = panel.layoutRect().y;
+
+				if (panel._autoFixY < scrollY) {
+					panel.fixed(true).layoutRect({y: 0}).repaint();
+					toggleFixedChildPanels(true, scrollY - panel._autoFixY);
+				}
+			} else {
+				if (panel._autoFixY > scrollY) {
+					panel.fixed(false).layoutRect({y: panel._autoFixY}).repaint();
+					toggleFixedChildPanels(false, panel._autoFixY - scrollY);
+				}
+			}
+		}
+	}
+
+	function addRemove(add, ctrl) {
+		var i, zIndex = FloatPanel.zIndex || 0xFFFF, topModal;
+
+		if (add) {
+			zOrder.push(ctrl);
+		} else {
+			i = zOrder.length;
+
+			while (i--) {
+				if (zOrder[i] === ctrl) {
+					zOrder.splice(i, 1);
+				}
+			}
+		}
+
+		if (zOrder.length) {
+			for (i = 0; i < zOrder.length; i++) {
+				if (zOrder[i].modal) {
+					zIndex++;
+					topModal = zOrder[i];
+				}
+
+				zOrder[i].getEl().style.zIndex = zIndex;
+				zOrder[i].zIndex = zIndex;
+				zIndex++;
+			}
+		}
+
+		var modalBlockEl = document.getElementById(ctrl.classPrefix + 'modal-block');
+
+		if (topModal) {
+			DomUtils.css(modalBlockEl, 'z-index', topModal.zIndex - 1);
+		} else if (modalBlockEl) {
+			modalBlockEl.parentNode.removeChild(modalBlockEl);
+			hasModal = false;
+		}
+
+		FloatPanel.currentZIndex = zIndex;
+	}
+
+	var FloatPanel = Panel.extend({
+		Mixins: [Movable, Resizable],
+
+		/**
+		 * Constructs a new control instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {Boolean} autohide Automatically hide the panel.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self._super(settings);
+			self._eventsRoot = self;
+
+			self.addClass('floatpanel');
+
+			// Hide floatpanes on click out side the root button
+			if (settings.autohide) {
+				bindDocumentClickHandler();
+				bindWindowResizeHandler();
+				visiblePanels.push(self);
+			}
+
+			if (settings.autofix) {
+				bindDocumentScrollHandler();
+
+				self.on('move', function() {
+					repositionPanel(this);
+				});
+			}
+
+			self.on('postrender show', function(e) {
+				if (e.control == self) {
+					var modalBlockEl, prefix = self.classPrefix;
+
+					if (self.modal && !hasModal) {
+						modalBlockEl = DomUtils.createFragment('<div id="' + prefix + 'modal-block" class="' +
+							prefix + 'reset ' + prefix + 'fade"></div>');
+						modalBlockEl = modalBlockEl.firstChild;
+
+						self.getContainerElm().appendChild(modalBlockEl);
+
+						setTimeout(function() {
+							DomUtils.addClass(modalBlockEl, prefix + 'in');
+							DomUtils.addClass(self.getEl(), prefix + 'in');
+						}, 0);
+
+						hasModal = true;
+					}
+
+					addRemove(true, self);
+				}
+			});
+
+			self.on('show', function() {
+				self.parents().each(function(ctrl) {
+					if (ctrl._fixed) {
+						self.fixed(true);
+						return false;
+					}
+				});
+			});
+
+			if (settings.popover) {
+				self._preBodyHtml = '<div class="' + self.classPrefix + 'arrow"></div>';
+				self.addClass('popover').addClass('bottom').addClass(self.isRtl() ? 'end' : 'start');
+			}
+		},
+
+		fixed: function(state) {
+			var self = this;
+
+			if (self._fixed != state) {
+				if (self._rendered) {
+					var viewport = DomUtils.getViewPort();
+
+					if (state) {
+						self.layoutRect().y -= viewport.y;
+					} else {
+						self.layoutRect().y += viewport.y;
+					}
+				}
+
+				self.toggleClass('fixed', state);
+				self._fixed = state;
+			}
+
+			return self;
+		},
+
+		/**
+		 * Shows the current float panel.
+		 *
+		 * @method show
+		 * @return {tinymce.ui.FloatPanel} Current floatpanel instance.
+		 */
+		show: function() {
+			var self = this, i, state = self._super();
+
+			i = visiblePanels.length;
+			while (i--) {
+				if (visiblePanels[i] === self) {
+					break;
+				}
+			}
+
+			if (i === -1) {
+				visiblePanels.push(self);
+			}
+
+			return state;
+		},
+
+		/**
+		 * Hides the current float panel.
+		 *
+		 * @method hide
+		 * @return {tinymce.ui.FloatPanel} Current floatpanel instance.
+		 */
+		hide: function() {
+			removeVisiblePanel(this);
+			addRemove(false, this);
+
+			return this._super();
+		},
+
+		/**
+		 * Hide all visible float panels with he autohide setting enabled. This is for
+		 * manually hiding floating menus or panels.
+		 *
+		 * @method hideAll
+		 */
+		hideAll: function() {
+			FloatPanel.hideAll();
+		},
+
+		/**
+		 * Closes the float panel. This will remove the float panel from page and fire the close event.
+		 *
+		 * @method close
+		 */
+		close: function() {
+			var self = this;
+
+			if (!self.fire('close').isDefaultPrevented()) {
+				self.remove();
+				addRemove(false, self);
+			}
+
+			return self;
+		},
+
+		/**
+		 * Removes the float panel from page.
+		 *
+		 * @method remove
+		 */
+		remove: function() {
+			removeVisiblePanel(this);
+			this._super();
+		},
+
+		postRender: function() {
+			var self = this;
+
+			if (self.settings.bodyRole) {
+				this.getEl('body').setAttribute('role', self.settings.bodyRole);
+			}
+
+			return self._super();
+		}
+	});
+
+	/**
+	 * Hide all visible float panels with he autohide setting enabled. This is for
+	 * manually hiding floating menus or panels.
+	 *
+	 * @static
+	 * @method hideAll
+	 */
+	FloatPanel.hideAll = function() {
+		var i = visiblePanels.length;
+
+		while (i--) {
+			var panel = visiblePanels[i];
+
+			if (panel && panel.settings.autohide) {
+				panel.hide();
+				visiblePanels.splice(i, 1);
+			}
+		}
+	};
+
+	function removeVisiblePanel(panel) {
+		var i;
+
+		i = visiblePanels.length;
+		while (i--) {
+			if (visiblePanels[i] === panel) {
+				visiblePanels.splice(i, 1);
+			}
+		}
+
+		i = zOrder.length;
+		while (i--) {
+			if (zOrder[i] === panel) {
+				zOrder.splice(i, 1);
+			}
+		}
+	}
+
+	return FloatPanel;
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FlowLayout.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,42 @@
+/**
+ * FlowLayout.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This layout manager will place the controls by using the browsers native layout.
+ *
+ * @-x-less FlowLayout.less
+ * @class tinymce.ui.FlowLayout
+ * @extends tinymce.ui.Layout
+ */
+define("tinymce/ui/FlowLayout", [
+	"tinymce/ui/Layout"
+], function(Layout) {
+	return Layout.extend({
+		Defaults: {
+			containerClass: 'flow-layout',
+			controlClass: 'flow-layout-item',
+			endClass: 'break'
+		},
+
+		/**
+		 * Recalculates the positions of the controls in the specified container.
+		 *
+		 * @method recalc
+		 * @param {tinymce.ui.Container} container Container instance to recalc.
+		 */
+		recalc: function(container) {
+			container.items().filter(':visible').each(function(ctrl) {
+				if (ctrl.recalc) {
+					ctrl.recalc();
+				}
+			});
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Form.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,171 @@
+/**
+ * Form.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class creates a form container. A form container has the ability
+ * to automatically wrap items in tinymce.ui.FormItem instances.
+ *
+ * Each FormItem instance is a container for the label and the item.
+ *
+ * @example
+ * tinymce.ui.Factory.create({
+ *     type: 'form',
+ *     items: [
+ *         {type: 'textbox', label: 'My text box'}
+ *     ]
+ * }).renderTo(document.body);
+ *
+ * @class tinymce.ui.Form
+ * @extends tinymce.ui.Container
+ */
+define("tinymce/ui/Form", [
+	"tinymce/ui/Container",
+	"tinymce/ui/FormItem",
+	"tinymce/util/Tools"
+], function(Container, FormItem, Tools) {
+	"use strict";
+
+	return Container.extend({
+		Defaults: {
+			containerCls: 'form',
+			layout: 'flex',
+			direction: 'column',
+			align: 'stretch',
+			flex: 1,
+			padding: 20,
+			labelGap: 30,
+			spacing: 10,
+			callbacks: {
+				submit: function() {
+					this.submit();
+				}
+			}
+		},
+
+		/**
+		 * This method gets invoked before the control is rendered.
+		 *
+		 * @method preRender
+		 */
+		preRender: function() {
+			var self = this, items = self.items();
+
+			if (!self.settings.formItemDefaults) {
+				self.settings.formItemDefaults = {
+					layout: 'flex',
+					autoResize: "overflow",
+					defaults: {flex: 1}
+				};
+			}
+
+			// Wrap any labeled items in FormItems
+			items.each(function(ctrl) {
+				var formItem, label = ctrl.settings.label;
+
+				if (label) {
+					formItem = new FormItem(Tools.extend({
+						items: {
+							type: 'label',
+							id: ctrl._id + '-l',
+							text: label,
+							flex: 0,
+							forId: ctrl._id,
+							disabled: ctrl.disabled()
+						}
+					}, self.settings.formItemDefaults));
+
+					formItem.type = 'formitem';
+					ctrl.aria('labelledby', ctrl._id + '-l');
+
+					if (typeof ctrl.settings.flex == "undefined") {
+						ctrl.settings.flex = 1;
+					}
+
+					self.replace(ctrl, formItem);
+					formItem.add(ctrl);
+				}
+			});
+		},
+
+		/**
+		 * Recalcs label widths.
+		 *
+		 * @private
+		 */
+		recalcLabels: function() {
+			var self = this, maxLabelWidth = 0, labels = [], i, labelGap, items;
+
+			if (self.settings.labelGapCalc === false) {
+				return;
+			}
+
+			if (self.settings.labelGapCalc == "children") {
+				items = self.find('formitem');
+			} else {
+				items = self.items();
+			}
+
+			items.filter('formitem').each(function(item) {
+				var labelCtrl = item.items()[0], labelWidth = labelCtrl.getEl().clientWidth;
+
+				maxLabelWidth = labelWidth > maxLabelWidth ? labelWidth : maxLabelWidth;
+				labels.push(labelCtrl);
+			});
+
+			labelGap = self.settings.labelGap || 0;
+
+			i = labels.length;
+			while (i--) {
+				labels[i].settings.minWidth = maxLabelWidth + labelGap;
+			}
+		},
+
+		/**
+		 * Getter/setter for the visibility state.
+		 *
+		 * @method visible
+		 * @param {Boolean} [state] True/false state to show/hide.
+		 * @return {tinymce.ui.Form|Boolean} True/false state or current control.
+		 */
+		visible: function(state) {
+			var val = this._super(state);
+
+			if (state === true && this._rendered) {
+				this.recalcLabels();
+			}
+
+			return val;
+		},
+
+		/**
+		 * Fires a submit event with the serialized form.
+		 *
+		 * @method submit
+		 * @return {Object} Event arguments object.
+		 */
+		submit: function() {
+			return this.fire('submit', {data: this.toJSON()});
+		},
+
+		/**
+		 * Post render method. Called after the control has been rendered to the target.
+		 *
+		 * @method postRender
+		 * @return {tinymce.ui.ComboBox} Current combobox instance.
+		 */
+		postRender: function() {
+			var self = this;
+
+			self._super();
+			self.recalcLabels();
+			self.fromJSON(self.settings.data);
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FormItem.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,56 @@
+/**
+ * FormItem.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is a container created by the form element with
+ * a label and control item.
+ *
+ * @class tinymce.ui.FormItem
+ * @extends tinymce.ui.Container
+ * @setting {String} label Label to display for the form item.
+ */
+define("tinymce/ui/FormItem", [
+	"tinymce/ui/Container"
+], function(Container) {
+	"use strict";
+
+	return Container.extend({
+		Defaults: {
+			layout: 'flex',
+			align: 'center',
+			defaults: {
+				flex: 1
+			}
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, layout = self._layout, prefix = self.classPrefix;
+
+			self.addClass('formitem');
+			layout.preRender(self);
+
+			return (
+				'<div id="' + self._id + '" class="' + self.classes() + '" hidefocus="1" tabindex="-1">' +
+					(self.settings.title ? ('<div id="' + self._id + '-title" class="' + prefix + 'title">' +
+						self.settings.title + '</div>') : '') +
+					'<div id="' + self._id + '-body" class="' + self.classes('body') + '">' +
+						(self.settings.html || '') + layout.renderHtml(self) +
+					'</div>' +
+				'</div>'
+			);
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FormatControls.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,539 @@
+/**
+ * FormatControls.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Internal class containing all TinyMCE specific control types such as
+ * format listboxes, fontlist boxes, toolbar buttons etc.
+ *
+ * @class tinymce.ui.FormatControls
+ */
+define("tinymce/ui/FormatControls", [
+	"tinymce/ui/Control",
+	"tinymce/ui/Widget",
+	"tinymce/ui/FloatPanel",
+	"tinymce/util/Tools",
+	"tinymce/EditorManager",
+	"tinymce/Env"
+], function(Control, Widget, FloatPanel, Tools, EditorManager, Env) {
+	var each = Tools.each;
+
+	EditorManager.on('AddEditor', function(e) {
+		if (e.editor.rtl) {
+			Control.rtl = true;
+		}
+
+		registerControls(e.editor);
+	});
+
+	Control.translate = function(text) {
+		return EditorManager.translate(text);
+	};
+
+	Widget.tooltips = !Env.iOS;
+
+	function registerControls(editor) {
+		var formatMenu;
+
+		function createListBoxChangeHandler(items, formatName) {
+			return function() {
+				var self = this;
+
+				editor.on('nodeChange', function(e) {
+					var formatter = editor.formatter;
+					var value = null;
+
+					each(e.parents, function(node) {
+						each(items, function(item) {
+							if (formatName) {
+								if (formatter.matchNode(node, formatName, {value: item.value})) {
+									value = item.value;
+								}
+							} else {
+								if (formatter.matchNode(node, item.value)) {
+									value = item.value;
+								}
+							}
+
+							if (value) {
+								return false;
+							}
+						});
+
+						if (value) {
+							return false;
+						}
+					});
+
+					self.value(value);
+				});
+			};
+		}
+
+		function createFormats(formats) {
+			formats = formats.replace(/;$/, '').split(';');
+
+			var i = formats.length;
+			while (i--) {
+				formats[i] = formats[i].split('=');
+			}
+
+			return formats;
+		}
+
+		function createFormatMenu() {
+			var count = 0, newFormats = [];
+
+			var defaultStyleFormats = [
+				{title: 'Headings', items: [
+					{title: 'Heading 1', format: 'h1'},
+					{title: 'Heading 2', format: 'h2'},
+					{title: 'Heading 3', format: 'h3'},
+					{title: 'Heading 4', format: 'h4'},
+					{title: 'Heading 5', format: 'h5'},
+					{title: 'Heading 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'}
+				]}
+			];
+
+			function createMenu(formats) {
+				var menu = [];
+
+				if (!formats) {
+					return;
+				}
+
+				each(formats, function(format) {
+					var menuItem = {
+						text: format.title,
+						icon: format.icon
+					};
+
+					if (format.items) {
+						menuItem.menu = createMenu(format.items);
+					} else {
+						var formatName = format.format || "custom" + count++;
+
+						if (!format.format) {
+							format.name = formatName;
+							newFormats.push(format);
+						}
+
+						menuItem.format = formatName;
+						menuItem.cmd = format.cmd;
+					}
+
+					menu.push(menuItem);
+				});
+
+				return menu;
+			}
+
+			function createStylesMenu() {
+				var menu;
+
+				if (editor.settings.style_formats_merge) {
+					if (editor.settings.style_formats) {
+						menu = createMenu(defaultStyleFormats.concat(editor.settings.style_formats));
+					} else {
+						menu = createMenu(defaultStyleFormats);
+					}
+				} else {
+					menu = createMenu(editor.settings.style_formats || defaultStyleFormats);
+				}
+
+				return menu;
+			}
+
+			editor.on('init', function() {
+				each(newFormats, function(format) {
+					editor.formatter.register(format.name, format);
+				});
+			});
+
+			return {
+				type: 'menu',
+				items: createStylesMenu(),
+				onPostRender: function(e) {
+					editor.fire('renderFormatsMenu', {control: e.control});
+				},
+				itemDefaults: {
+					preview: true,
+
+					textStyle: function() {
+						if (this.settings.format) {
+							return editor.formatter.getCssText(this.settings.format);
+						}
+					},
+
+					onPostRender: function() {
+						var self = this;
+
+						self.parent().on('show', function() {
+							var formatName, command;
+
+							formatName = self.settings.format;
+							if (formatName) {
+								self.disabled(!editor.formatter.canApply(formatName));
+								self.active(editor.formatter.match(formatName));
+							}
+
+							command = self.settings.cmd;
+							if (command) {
+								self.active(editor.queryCommandState(command));
+							}
+						});
+					},
+
+					onclick: function() {
+						if (this.settings.format) {
+							toggleFormat(this.settings.format);
+						}
+
+						if (this.settings.cmd) {
+							editor.execCommand(this.settings.cmd);
+						}
+					}
+				}
+			};
+		}
+
+		formatMenu = createFormatMenu();
+
+		// Simple format controls <control/format>:<UI text>
+		each({
+			bold: 'Bold',
+			italic: 'Italic',
+			underline: 'Underline',
+			strikethrough: 'Strikethrough',
+			subscript: 'Subscript',
+			superscript: 'Superscript'
+		}, function(text, name) {
+			editor.addButton(name, {
+				tooltip: text,
+				onPostRender: function() {
+					var self = this;
+
+					// TODO: Fix this
+					if (editor.formatter) {
+						editor.formatter.formatChanged(name, function(state) {
+							self.active(state);
+						});
+					} else {
+						editor.on('init', function() {
+							editor.formatter.formatChanged(name, function(state) {
+								self.active(state);
+							});
+						});
+					}
+				},
+				onclick: function() {
+					toggleFormat(name);
+				}
+			});
+		});
+
+		// Simple command controls <control>:[<UI text>,<Command>]
+		each({
+			outdent: ['Decrease indent', 'Outdent'],
+			indent: ['Increase indent', 'Indent'],
+			cut: ['Cut', 'Cut'],
+			copy: ['Copy', 'Copy'],
+			paste: ['Paste', 'Paste'],
+			help: ['Help', 'mceHelp'],
+			selectall: ['Select all', 'SelectAll'],
+			removeformat: ['Clear formatting', 'RemoveFormat'],
+			visualaid: ['Visual aids', 'mceToggleVisualAid'],
+			newdocument: ['New document', 'mceNewDocument']
+		}, function(item, name) {
+			editor.addButton(name, {
+				tooltip: item[0],
+				cmd: item[1]
+			});
+		});
+
+		// Simple command controls with format state
+		each({
+			blockquote: ['Blockquote', 'mceBlockQuote'],
+			numlist: ['Numbered list', 'InsertOrderedList'],
+			bullist: ['Bullet list', 'InsertUnorderedList'],
+			subscript: ['Subscript', 'Subscript'],
+			superscript: ['Superscript', 'Superscript'],
+			alignleft: ['Align left', 'JustifyLeft'],
+			aligncenter: ['Align center', 'JustifyCenter'],
+			alignright: ['Align right', 'JustifyRight'],
+			alignjustify: ['Justify', 'JustifyFull']
+		}, function(item, name) {
+			editor.addButton(name, {
+				tooltip: item[0],
+				cmd: item[1],
+				onPostRender: function() {
+					var self = this;
+
+					// TODO: Fix this
+					if (editor.formatter) {
+						editor.formatter.formatChanged(name, function(state) {
+							self.active(state);
+						});
+					} else {
+						editor.on('init', function() {
+							editor.formatter.formatChanged(name, function(state) {
+								self.active(state);
+							});
+						});
+					}
+				}
+			});
+		});
+
+		function toggleUndoRedoState(type) {
+			return function() {
+				var self = this;
+
+				type = type == 'redo' ? 'hasRedo' : 'hasUndo';
+
+				function checkState() {
+					return editor.undoManager ? editor.undoManager[type]() : false;
+				}
+
+				self.disabled(!checkState());
+				editor.on('Undo Redo AddUndo TypingUndo ClearUndos', function() {
+					self.disabled(!checkState());
+				});
+			};
+		}
+
+		function toggleVisualAidState() {
+			var self = this;
+
+			editor.on('VisualAid', function(e) {
+				self.active(e.hasVisual);
+			});
+
+			self.active(editor.hasVisual);
+		}
+
+		editor.addButton('undo', {
+			tooltip: 'Undo',
+			onPostRender: toggleUndoRedoState('undo'),
+			cmd: 'undo'
+		});
+
+		editor.addButton('redo', {
+			tooltip: 'Redo',
+			onPostRender: toggleUndoRedoState('redo'),
+			cmd: 'redo'
+		});
+
+		editor.addMenuItem('newdocument', {
+			text: 'New document',
+			icon: 'newdocument',
+			cmd: 'mceNewDocument'
+		});
+
+		editor.addMenuItem('undo', {
+			text: 'Undo',
+			icon: 'undo',
+			shortcut: 'Meta+Z',
+			onPostRender: toggleUndoRedoState('undo'),
+			cmd: 'undo'
+		});
+
+		editor.addMenuItem('redo', {
+			text: 'Redo',
+			icon: 'redo',
+			shortcut: 'Meta+Y',
+			onPostRender: toggleUndoRedoState('redo'),
+			cmd: 'redo'
+		});
+
+		editor.addMenuItem('visualaid', {
+			text: 'Visual aids',
+			selectable: true,
+			onPostRender: toggleVisualAidState,
+			cmd: 'mceToggleVisualAid'
+		});
+
+		each({
+			cut: ['Cut', 'Cut', 'Meta+X'],
+			copy: ['Copy', 'Copy', 'Meta+C'],
+			paste: ['Paste', 'Paste', 'Meta+V'],
+			selectall: ['Select all', 'SelectAll', 'Meta+A'],
+			bold: ['Bold', 'Bold', 'Meta+B'],
+			italic: ['Italic', 'Italic', 'Meta+I'],
+			underline: ['Underline', 'Underline'],
+			strikethrough: ['Strikethrough', 'Strikethrough'],
+			subscript: ['Subscript', 'Subscript'],
+			superscript: ['Superscript', 'Superscript'],
+			removeformat: ['Clear formatting', 'RemoveFormat']
+		}, function(item, name) {
+			editor.addMenuItem(name, {
+				text: item[0],
+				icon: name,
+				shortcut: item[2],
+				cmd: item[1]
+			});
+		});
+
+		editor.on('mousedown', function() {
+			FloatPanel.hideAll();
+		});
+
+		function toggleFormat(fmt) {
+			if (fmt.control) {
+				fmt = fmt.control.value();
+			}
+
+			if (fmt) {
+				editor.execCommand('mceToggleFormat', false, fmt);
+			}
+		}
+
+		editor.addButton('styleselect', {
+			type: 'menubutton',
+			text: 'Formats',
+			menu: formatMenu
+		});
+
+		editor.addButton('formatselect', function() {
+			var items = [], blocks = createFormats(editor.settings.block_formats ||
+				'Paragraph=p;' +
+				'Heading 1=h1;' +
+				'Heading 2=h2;' +
+				'Heading 3=h3;' +
+				'Heading 4=h4;' +
+				'Heading 5=h5;' +
+				'Heading 6=h6;' +
+				'Preformatted=pre'
+			);
+
+			each(blocks, function(block) {
+				items.push({
+					text: block[0],
+					value: block[1],
+					textStyle: function() {
+						return editor.formatter.getCssText(block[1]);
+					}
+				});
+			});
+
+			return {
+				type: 'listbox',
+				text: blocks[0][0],
+				values: items,
+				fixedWidth: true,
+				onselect: toggleFormat,
+				onPostRender: createListBoxChangeHandler(items)
+			};
+		});
+
+		editor.addButton('fontselect', function() {
+			var defaultFontsFormats =
+				'Andale Mono=andale mono,monospace;' +
+				'Arial=arial,helvetica,sans-serif;' +
+				'Arial Black=arial black,sans-serif;' +
+				'Book Antiqua=book antiqua,palatino,serif;' +
+				'Comic Sans MS=comic sans ms,sans-serif;' +
+				'Courier New=courier new,courier,monospace;' +
+				'Georgia=georgia,palatino,serif;' +
+				'Helvetica=helvetica,arial,sans-serif;' +
+				'Impact=impact,sans-serif;' +
+				'Symbol=symbol;' +
+				'Tahoma=tahoma,arial,helvetica,sans-serif;' +
+				'Terminal=terminal,monaco,monospace;' +
+				'Times New Roman=times new roman,times,serif;' +
+				'Trebuchet MS=trebuchet ms,geneva,sans-serif;' +
+				'Verdana=verdana,geneva,sans-serif;' +
+				'Webdings=webdings;' +
+				'Wingdings=wingdings,zapf dingbats';
+
+			var items = [], fonts = createFormats(editor.settings.font_formats || defaultFontsFormats);
+
+			each(fonts, function(font) {
+				items.push({
+					text: {raw: font[0]},
+					value: font[1],
+					textStyle: font[1].indexOf('dings') == -1 ? 'font-family:' + font[1] : ''
+				});
+			});
+
+			return {
+				type: 'listbox',
+				text: 'Font Family',
+				tooltip: 'Font Family',
+				values: items,
+				fixedWidth: true,
+				onPostRender: createListBoxChangeHandler(items, 'fontname'),
+				onselect: function(e) {
+					if (e.control.settings.value) {
+						editor.execCommand('FontName', false, e.control.settings.value);
+					}
+				}
+			};
+		});
+
+		editor.addButton('fontsizeselect', function() {
+			var items = [], defaultFontsizeFormats = '8pt 10pt 12pt 14pt 18pt 24pt 36pt';
+			var fontsize_formats = editor.settings.fontsize_formats || defaultFontsizeFormats;
+
+			each(fontsize_formats.split(' '), function(item) {
+				var text = item, value = item;
+				// Allow text=value font sizes.
+				var values = item.split('=');
+				if (values.length > 1) {
+					text = values[0];
+					value = values[1];
+				}
+				items.push({text: text, value: value});
+			});
+
+			return {
+				type: 'listbox',
+				text: 'Font Sizes',
+				tooltip: 'Font Sizes',
+				values: items,
+				fixedWidth: true,
+				onPostRender: createListBoxChangeHandler(items, 'fontsize'),
+				onclick: function(e) {
+					if (e.control.settings.value) {
+						editor.execCommand('FontSize', false, e.control.settings.value);
+					}
+				}
+			};
+		});
+
+		editor.addMenuItem('formats', {
+			text: 'Formats',
+			menu: formatMenu
+		});
+	}
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/GridLayout.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,233 @@
+/**
+ * GridLayout.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This layout manager places controls in a grid.
+ *
+ * @setting {Number} spacing Spacing between controls.
+ * @setting {Number} spacingH Horizontal spacing between controls.
+ * @setting {Number} spacingV Vertical spacing between controls.
+ * @setting {Number} columns Number of columns to use.
+ * @setting {String/Array} alignH start|end|center|stretch or array of values for each column.
+ * @setting {String/Array} alignV start|end|center|stretch or array of values for each column.
+ * @setting {String} pack start|end
+ *
+ * @class tinymce.ui.GridLayout
+ * @extends tinymce.ui.AbsoluteLayout
+ */
+define("tinymce/ui/GridLayout", [
+	"tinymce/ui/AbsoluteLayout"
+], function(AbsoluteLayout) {
+	"use strict";
+
+	return AbsoluteLayout.extend({
+		/**
+		 * Recalculates the positions of the controls in the specified container.
+		 *
+		 * @method recalc
+		 * @param {tinymce.ui.Container} container Container instance to recalc.
+		 */
+		recalc: function(container) {
+			var settings = container.settings, rows, cols, items, contLayoutRect, width, height, rect,
+				ctrlLayoutRect, ctrl, x, y, posX, posY, ctrlSettings, contPaddingBox, align, spacingH, spacingV, alignH, alignV, maxX, maxY,
+				colWidths = [], rowHeights = [], ctrlMinWidth, ctrlMinHeight, availableWidth, availableHeight, reverseRows, idx;
+
+			// Get layout settings
+			settings = container.settings;
+			items = container.items().filter(':visible');
+			contLayoutRect = container.layoutRect();
+			cols = settings.columns || Math.ceil(Math.sqrt(items.length));
+			rows = Math.ceil(items.length / cols);
+			spacingH = settings.spacingH || settings.spacing || 0;
+			spacingV = settings.spacingV || settings.spacing || 0;
+			alignH = settings.alignH || settings.align;
+			alignV = settings.alignV || settings.align;
+			contPaddingBox = container._paddingBox;
+			reverseRows = 'reverseRows' in settings ? settings.reverseRows : container.isRtl();
+
+			if (alignH && typeof alignH == "string") {
+				alignH = [alignH];
+			}
+
+			if (alignV && typeof alignV == "string") {
+				alignV = [alignV];
+			}
+
+			// Zero padd columnWidths
+			for (x = 0; x < cols; x++) {
+				colWidths.push(0);
+			}
+
+			// Zero padd rowHeights
+			for (y = 0; y < rows; y++) {
+				rowHeights.push(0);
+			}
+
+			// Calculate columnWidths and rowHeights
+			for (y = 0; y < rows; y++) {
+				for (x = 0; x < cols; x++) {
+					ctrl = items[y * cols + x];
+
+					// Out of bounds
+					if (!ctrl) {
+						break;
+					}
+
+					ctrlLayoutRect = ctrl.layoutRect();
+					ctrlMinWidth = ctrlLayoutRect.minW;
+					ctrlMinHeight = ctrlLayoutRect.minH;
+
+					colWidths[x] = ctrlMinWidth > colWidths[x] ? ctrlMinWidth : colWidths[x];
+					rowHeights[y] = ctrlMinHeight > rowHeights[y] ? ctrlMinHeight : rowHeights[y];
+				}
+			}
+
+			// Calculate maxX
+			availableWidth = contLayoutRect.innerW - contPaddingBox.left - contPaddingBox.right;
+			for (maxX = 0, x = 0; x < cols; x++) {
+				maxX += colWidths[x] + (x > 0 ? spacingH : 0);
+				availableWidth -= (x > 0 ? spacingH : 0) + colWidths[x];
+			}
+
+			// Calculate maxY
+			availableHeight = contLayoutRect.innerH - contPaddingBox.top - contPaddingBox.bottom;
+			for (maxY = 0, y = 0; y < rows; y++) {
+				maxY += rowHeights[y] + (y > 0 ? spacingV : 0);
+				availableHeight -= (y > 0 ? spacingV : 0) + rowHeights[y];
+			}
+
+			maxX += contPaddingBox.left + contPaddingBox.right;
+			maxY += contPaddingBox.top + contPaddingBox.bottom;
+
+			// Calculate minW/minH
+			rect = {};
+			rect.minW = maxX + (contLayoutRect.w - contLayoutRect.innerW);
+			rect.minH = maxY + (contLayoutRect.h - contLayoutRect.innerH);
+
+			rect.contentW = rect.minW - contLayoutRect.deltaW;
+			rect.contentH = rect.minH - contLayoutRect.deltaH;
+			rect.minW = Math.min(rect.minW, contLayoutRect.maxW);
+			rect.minH = Math.min(rect.minH, contLayoutRect.maxH);
+			rect.minW = Math.max(rect.minW, contLayoutRect.startMinWidth);
+			rect.minH = Math.max(rect.minH, contLayoutRect.startMinHeight);
+
+			// Resize container container if minSize was changed
+			if (contLayoutRect.autoResize && (rect.minW != contLayoutRect.minW || rect.minH != contLayoutRect.minH)) {
+				rect.w = rect.minW;
+				rect.h = rect.minH;
+
+				container.layoutRect(rect);
+				this.recalc(container);
+
+				// Forced recalc for example if items are hidden/shown
+				if (container._lastRect === null) {
+					var parentCtrl = container.parent();
+					if (parentCtrl) {
+						parentCtrl._lastRect = null;
+						parentCtrl.recalc();
+					}
+				}
+
+				return;
+			}
+
+			// Update contentW/contentH so absEnd moves correctly
+			if (contLayoutRect.autoResize) {
+				rect = container.layoutRect(rect);
+				rect.contentW = rect.minW - contLayoutRect.deltaW;
+				rect.contentH = rect.minH - contLayoutRect.deltaH;
+			}
+
+			var flexV;
+
+			if (settings.packV == 'start') {
+				flexV = 0;
+			} else {
+				flexV = availableHeight > 0 ? Math.floor(availableHeight / rows) : 0;
+			}
+
+			// Calculate totalFlex
+			var totalFlex = 0;
+			var flexWidths = settings.flexWidths;
+			if (flexWidths) {
+				for (x = 0; x < flexWidths.length; x++) {
+					totalFlex += flexWidths[x];
+				}
+			} else {
+				totalFlex = cols;
+			}
+
+			// Calculate new column widths based on flex values
+			var ratio = availableWidth / totalFlex;
+			for (x = 0; x < cols; x++) {
+				colWidths[x] += flexWidths ? flexWidths[x] * ratio : ratio;
+			}
+
+			// Move/resize controls
+			posY = contPaddingBox.top;
+			for (y = 0; y < rows; y++) {
+				posX = contPaddingBox.left;
+				height = rowHeights[y] + flexV;
+
+				for (x = 0; x < cols; x++) {
+					if (reverseRows) {
+						idx = y * cols + cols - 1 - x;
+					} else {
+						idx = y * cols + x;
+					}
+
+					ctrl = items[idx];
+
+					// No more controls to render then break
+					if (!ctrl) {
+						break;
+					}
+
+					// Get control settings and calculate x, y
+					ctrlSettings = ctrl.settings;
+					ctrlLayoutRect = ctrl.layoutRect();
+					width = Math.max(colWidths[x], ctrlLayoutRect.startMinWidth);
+					ctrlLayoutRect.x = posX;
+					ctrlLayoutRect.y = posY;
+
+					// Align control horizontal
+					align = ctrlSettings.alignH || (alignH ? (alignH[x] || alignH[0]) : null);
+					if (align == "center") {
+						ctrlLayoutRect.x = posX + (width / 2) - (ctrlLayoutRect.w / 2);
+					} else if (align == "right") {
+						ctrlLayoutRect.x = posX + width - ctrlLayoutRect.w;
+					} else if (align == "stretch") {
+						ctrlLayoutRect.w = width;
+					}
+
+					// Align control vertical
+					align = ctrlSettings.alignV || (alignV ? (alignV[x] || alignV[0]) : null);
+					if (align == "center") {
+						ctrlLayoutRect.y = posY + (height / 2) - (ctrlLayoutRect.h / 2);
+					} else if (align == "bottom") {
+						ctrlLayoutRect.y = posY + height - ctrlLayoutRect.h;
+					} else if (align == "stretch") {
+						ctrlLayoutRect.h = height;
+					}
+
+					ctrl.layoutRect(ctrlLayoutRect);
+
+					posX += width + spacingH;
+
+					if (ctrl.recalc) {
+						ctrl.recalc();
+					}
+				}
+
+				posY += height + spacingV;
+			}
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Iframe.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,84 @@
+/**
+ * Iframe.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*jshint scripturl:true */
+
+/**
+ * This class creates an iframe.
+ *
+ * @setting {String} url Url to open in the iframe.
+ *
+ * @-x-less Iframe.less
+ * @class tinymce.ui.Iframe
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/Iframe", [
+	"tinymce/ui/Widget"
+], function(Widget) {
+	"use strict";
+
+	return Widget.extend({
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this;
+
+			self.addClass('iframe');
+			self.canFocus = false;
+
+			/*eslint no-script-url:0 */
+			return (
+				'<iframe id="' + self._id + '" class="' + self.classes() + '" tabindex="-1" src="' +
+				(self.settings.url || "javascript:\'\'") + '" frameborder="0"></iframe>'
+			);
+		},
+
+		/**
+		 * Setter for the iframe source.
+		 *
+		 * @method src
+		 * @param {String} src Source URL for iframe.
+		 */
+		src: function(src) {
+			this.getEl().src = src;
+		},
+
+		/**
+		 * Inner HTML for the iframe.
+		 *
+		 * @method html
+		 * @param {String} html HTML string to set as HTML inside the iframe.
+		 * @param {function} callback Optional callback to execute when the iframe body is filled with contents.
+		 * @return {tinymce.ui.Iframe} Current iframe control.
+		 */
+		html: function(html, callback) {
+			var self = this, body = this.getEl().contentWindow.document.body;
+
+			// Wait for iframe to initialize IE 10 takes time
+			if (!body) {
+				setTimeout(function() {
+					self.html(html);
+				}, 0);
+			} else {
+				body.innerHTML = html;
+
+				if (callback) {
+					callback();
+				}
+			}
+
+			return this;
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/KeyboardNavigation.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,398 @@
+/**
+ * KeyboardNavigation.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles keyboard navigation of controls and elements.
+ *
+ * @class tinymce.ui.KeyboardNavigation
+ */
+define("tinymce/ui/KeyboardNavigation", [
+], function() {
+	"use strict";
+
+	/**
+	 * This class handles all keyboard navigation for WAI-ARIA support. Each root container
+	 * gets an instance of this class.
+	 *
+	 * @constructor
+	 */
+	return function(settings) {
+		var root = settings.root, focusedElement, focusedControl;
+
+		try {
+			focusedElement = document.activeElement;
+		} catch (ex) {
+			// IE sometimes fails to return a proper element
+			focusedElement = document.body;
+		}
+
+		focusedControl = root.getParentCtrl(focusedElement);
+
+		/**
+		 * Returns the currently focused elements wai aria role of the currently
+		 * focused element or specified element.
+		 *
+		 * @private
+		 * @param {Element} elm Optional element to get role from.
+		 * @return {String} Role of specified element.
+		 */
+		function getRole(elm) {
+			elm = elm || focusedElement;
+
+			return elm && elm.getAttribute('role');
+		}
+
+		/**
+		 * Returns the wai role of the parent element of the currently
+		 * focused element or specified element.
+		 *
+		 * @private
+		 * @param {Element} elm Optional element to get parent role from.
+		 * @return {String} Role of the first parent that has a role.
+		 */
+		function getParentRole(elm) {
+			var role, parent = elm || focusedElement;
+
+			while ((parent = parent.parentNode)) {
+				if ((role = getRole(parent))) {
+					return role;
+				}
+			}
+		}
+
+		/**
+		 * Returns a wai aria property by name for example aria-selected.
+		 *
+		 * @private
+		 * @param {String} name Name of the aria property to get for example "disabled".
+		 * @return {String} Aria property value.
+		 */
+		function getAriaProp(name) {
+			var elm = focusedElement;
+
+			if (elm) {
+				return elm.getAttribute('aria-' + name);
+			}
+		}
+
+		/**
+		 * Is the element a text input element or not.
+		 *
+		 * @private
+		 * @param {Element} elm Element to check if it's an text input element or not.
+		 * @return {Boolean} True/false if the element is a text element or not.
+		 */
+		function isTextInputElement(elm) {
+			var tagName = elm.tagName.toUpperCase();
+
+			// Notice: since type can be "email" etc we don't check the type
+			// So all input elements gets treated as text input elements
+			return tagName == "INPUT" || tagName == "TEXTAREA";
+		}
+
+		/**
+		 * Returns true/false if the specified element can be focused or not.
+		 *
+		 * @private
+		 * @param {Element} elm DOM element to check if it can be focused or not.
+		 * @return {Boolean} True/false if the element can have focus.
+		 */
+		function canFocus(elm) {
+			if (isTextInputElement(elm) && !elm.hidden) {
+				return true;
+			}
+
+			if (/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell)$/.test(getRole(elm))) {
+				return true;
+			}
+
+			return false;
+		}
+
+		/**
+		 * Returns an array of focusable visible elements within the specified container element.
+		 *
+		 * @private
+		 * @param {Element} elm DOM element to find focusable elements within.
+		 * @return {Array} Array of focusable elements.
+		 */
+		function getFocusElements(elm) {
+			var elements = [];
+
+			function collect(elm) {
+				if (elm.nodeType != 1 || elm.style.display == 'none') {
+					return;
+				}
+
+				if (canFocus(elm)) {
+					elements.push(elm);
+				}
+
+				for (var i = 0; i < elm.childNodes.length; i++) {
+					collect(elm.childNodes[i]);
+				}
+			}
+
+			collect(elm || root.getEl());
+
+			return elements;
+		}
+
+		/**
+		 * Returns the navigation root control for the specified control. The navigation root
+		 * is the control that the keyboard navigation gets scoped to for example a menubar or toolbar group.
+		 * It will look for parents of the specified target control or the currently focused control if this option is omitted.
+		 *
+		 * @private
+		 * @param {tinymce.ui.Control} targetControl Optional target control to find root of.
+		 * @return {tinymce.ui.Control} Navigation root control.
+		 */
+		function getNavigationRoot(targetControl) {
+			var navigationRoot, controls;
+
+			targetControl = targetControl || focusedControl;
+			controls = targetControl.parents().toArray();
+			controls.unshift(targetControl);
+
+			for (var i = 0; i < controls.length; i++) {
+				navigationRoot = controls[i];
+
+				if (navigationRoot.settings.ariaRoot) {
+					break;
+				}
+			}
+
+			return navigationRoot;
+		}
+
+		/**
+		 * Focuses the first item in the specified targetControl element or the last aria index if the
+		 * navigation root has the ariaRemember option enabled.
+		 *
+		 * @private
+		 * @param {tinymce.ui.Control} targetControl Target control to focus the first item in.
+		 */
+		function focusFirst(targetControl) {
+			var navigationRoot = getNavigationRoot(targetControl);
+			var focusElements = getFocusElements(navigationRoot.getEl());
+
+			if (navigationRoot.settings.ariaRemember && "lastAriaIndex" in navigationRoot) {
+				moveFocusToIndex(navigationRoot.lastAriaIndex, focusElements);
+			} else {
+				moveFocusToIndex(0, focusElements);
+			}
+		}
+
+		/**
+		 * Moves the focus to the specified index within the elements list.
+		 * This will scope the index to the size of the element list if it changed.
+		 *
+		 * @private
+		 * @param {Number} idx Specified index to move to.
+		 * @param {Array} elements Array with dom elements to move focus within.
+		 * @return {Number} Input index or a changed index if it was out of range.
+		 */
+		function moveFocusToIndex(idx, elements) {
+			if (idx < 0) {
+				idx = elements.length - 1;
+			} else if (idx >= elements.length) {
+				idx = 0;
+			}
+
+			if (elements[idx]) {
+				elements[idx].focus();
+			}
+
+			return idx;
+		}
+
+		/**
+		 * Moves the focus forwards or backwards.
+		 *
+		 * @private
+		 * @param {Number} dir Direction to move in positive means forward, negative means backwards.
+		 * @param {Array} elements Optional array of elements to move within defaults to the current navigation roots elements.
+		 */
+		function moveFocus(dir, elements) {
+			var idx = -1, navigationRoot = getNavigationRoot();
+
+			elements = elements || getFocusElements(navigationRoot.getEl());
+
+			for (var i = 0; i < elements.length; i++) {
+				if (elements[i] === focusedElement) {
+					idx = i;
+				}
+			}
+
+			idx += dir;
+			navigationRoot.lastAriaIndex = moveFocusToIndex(idx, elements);
+		}
+
+		/**
+		 * Moves the focus to the left this is called by the left key.
+		 *
+		 * @private
+		 */
+		function left() {
+			var parentRole = getParentRole();
+
+			if (parentRole == "tablist") {
+				moveFocus(-1, getFocusElements(focusedElement.parentNode));
+			} else if (focusedControl.parent().submenu) {
+				cancel();
+			} else {
+				moveFocus(-1);
+			}
+		}
+
+		/**
+		 * Moves the focus to the right this is called by the right key.
+		 *
+		 * @private
+		 */
+		function right() {
+			var role = getRole(), parentRole = getParentRole();
+
+			if (parentRole == "tablist") {
+				moveFocus(1, getFocusElements(focusedElement.parentNode));
+			} else if (role == "menuitem" && parentRole == "menu" && getAriaProp('haspopup')) {
+				enter();
+			} else {
+				moveFocus(1);
+			}
+		}
+
+		/**
+		 * Moves the focus to the up this is called by the up key.
+		 *
+		 * @private
+		 */
+		function up() {
+			moveFocus(-1);
+		}
+
+		/**
+		 * Moves the focus to the up this is called by the down key.
+		 *
+		 * @private
+		 */
+		function down() {
+			var role = getRole(), parentRole = getParentRole();
+
+			if (role == "menuitem" && parentRole == "menubar") {
+				enter();
+			} else if (role == "button" && getAriaProp('haspopup')) {
+				enter({key: 'down'});
+			} else {
+				moveFocus(1);
+			}
+		}
+
+		/**
+		 * Moves the focus to the next item or previous item depending on shift key.
+		 *
+		 * @private
+		 * @param {DOMEvent} e DOM event object.
+		 */
+		function tab(e) {
+			var parentRole = getParentRole();
+
+			if (parentRole == "tablist") {
+				var elm = getFocusElements(focusedControl.getEl('body'))[0];
+
+				if (elm) {
+					elm.focus();
+				}
+			} else {
+				moveFocus(e.shiftKey ? -1 : 1);
+			}
+		}
+
+		/**
+		 * Calls the cancel event on the currently focused control. This is normally done using the Esc key.
+		 *
+		 * @private
+		 */
+		function cancel() {
+			focusedControl.fire('cancel');
+		}
+
+		/**
+		 * Calls the click event on the currently focused control. This is normally done using the Enter/Space keys.
+		 *
+		 * @private
+		 * @param {Object} aria Optional aria data to pass along with the enter event.
+		 */
+		function enter(aria) {
+			aria = aria || {};
+			focusedControl.fire('click', {target: focusedElement, aria: aria});
+		}
+
+		root.on('keydown', function(e) {
+			function handleNonTabOrEscEvent(e, handler) {
+				// Ignore non tab keys for text elements
+				if (isTextInputElement(focusedElement)) {
+					return;
+				}
+
+				if (handler(e) !== false) {
+					e.preventDefault();
+				}
+			}
+
+			if (e.isDefaultPrevented()) {
+				return;
+			}
+
+			switch (e.keyCode) {
+				case 37: // DOM_VK_LEFT
+					handleNonTabOrEscEvent(e, left);
+					break;
+
+				case 39: // DOM_VK_RIGHT
+					handleNonTabOrEscEvent(e, right);
+					break;
+
+				case 38: // DOM_VK_UP
+					handleNonTabOrEscEvent(e, up);
+					break;
+
+				case 40: // DOM_VK_DOWN
+					handleNonTabOrEscEvent(e, down);
+					break;
+
+				case 27: // DOM_VK_ESCAPE
+					cancel();
+					break;
+
+				case 14: // DOM_VK_ENTER
+				case 13: // DOM_VK_RETURN
+				case 32: // DOM_VK_SPACE
+					handleNonTabOrEscEvent(e, enter);
+					break;
+
+				case 9: // DOM_VK_TAB
+					if (tab(e) !== false) {
+						e.preventDefault();
+					}
+					break;
+			}
+		});
+
+		root.on('focusin', function(e) {
+			focusedElement = e.target;
+			focusedControl = e.control;
+		});
+
+		return {
+			focusFirst: focusFirst
+		};
+	};
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Label.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,125 @@
+/**
+ * Label.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class creates a label element. A label is a simple text control
+ * that can be bound to other controls.
+ *
+ * @-x-less Label.less
+ * @class tinymce.ui.Label
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/Label", [
+	"tinymce/ui/Widget",
+	"tinymce/ui/DomUtils"
+], function(Widget, DomUtils) {
+	"use strict";
+
+	return Widget.extend({
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @param {Boolean} multiline Multiline label.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self._super(settings);
+			self.addClass('widget');
+			self.addClass('label');
+			self.canFocus = false;
+
+			if (settings.multiline) {
+				self.addClass('autoscroll');
+			}
+
+			if (settings.strong) {
+				self.addClass('strong');
+			}
+		},
+
+		/**
+		 * Initializes the current controls layout rect.
+		 * This will be executed by the layout managers to determine the
+		 * default minWidth/minHeight etc.
+		 *
+		 * @method initLayoutRect
+		 * @return {Object} Layout rect instance.
+		 */
+		initLayoutRect: function() {
+			var self = this, layoutRect = self._super();
+
+			if (self.settings.multiline) {
+				var size = DomUtils.getSize(self.getEl());
+
+				// Check if the text fits within maxW if not then try word wrapping it
+				if (size.width > layoutRect.maxW) {
+					layoutRect.minW = layoutRect.maxW;
+					self.addClass('multiline');
+				}
+
+				self.getEl().style.width = layoutRect.minW + 'px';
+				layoutRect.startMinH = layoutRect.h = layoutRect.minH = Math.min(layoutRect.maxH, DomUtils.getSize(self.getEl()).height);
+			}
+
+			return layoutRect;
+		},
+
+		/**
+		 * Repaints the control after a layout operation.
+		 *
+		 * @method repaint
+		 */
+		repaint: function() {
+			var self = this;
+
+			if (!self.settings.multiline) {
+				self.getEl().style.lineHeight = self.layoutRect().h + 'px';
+			}
+
+			return self._super();
+		},
+
+		/**
+		 * Sets/gets the current label text.
+		 *
+		 * @method text
+		 * @param {String} [text] New label text.
+		 * @return {String|tinymce.ui.Label} Current text or current label instance.
+		 */
+		text: function(text) {
+			var self = this;
+
+			if (self._rendered && text) {
+				this.innerHtml(self.encode(text));
+			}
+
+			return self._super(text);
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, forId = self.settings.forId;
+
+			return (
+				'<label id="' + self._id + '" class="' + self.classes() + '"' + (forId ? ' for="' + forId + '"' : '') + '>' +
+					self.encode(self._text) +
+				'</label>'
+			);
+		}
+	});
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Layout.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,114 @@
+/**
+ * Layout.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Base layout manager class.
+ *
+ * @class tinymce.ui.Layout
+ */
+define("tinymce/ui/Layout", [
+	"tinymce/util/Class",
+	"tinymce/util/Tools"
+], function(Class, Tools) {
+	"use strict";
+
+	return Class.extend({
+		Defaults: {
+			firstControlClass: 'first',
+			lastControlClass: 'last'
+		},
+
+		/**
+		 * Constructs a layout instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 */
+		init: function(settings) {
+			this.settings = Tools.extend({}, this.Defaults, settings);
+		},
+
+		/**
+		 * This method gets invoked before the layout renders the controls.
+		 *
+		 * @method preRender
+		 * @param {tinymce.ui.Container} container Container instance to preRender.
+		 */
+		preRender: function(container) {
+			container.addClass(this.settings.containerClass, 'body');
+		},
+
+		/**
+		 * Applies layout classes to the container.
+		 *
+		 * @private
+		 */
+		applyClasses: function(container) {
+			var self = this, settings = self.settings, items, firstClass, lastClass;
+
+			items = container.items().filter(':visible');
+			firstClass = settings.firstControlClass;
+			lastClass = settings.lastControlClass;
+
+			items.each(function(item) {
+				item.removeClass(firstClass).removeClass(lastClass);
+
+				if (settings.controlClass) {
+					item.addClass(settings.controlClass);
+				}
+			});
+
+			items.eq(0).addClass(firstClass);
+			items.eq(-1).addClass(lastClass);
+		},
+
+		/**
+		 * Renders the specified container and any layout specific HTML.
+		 *
+		 * @method renderHtml
+		 * @param {tinymce.ui.Container} container Container to render HTML for.
+		 */
+		renderHtml: function(container) {
+			var self = this, settings = self.settings, items, html = '';
+
+			items = container.items();
+			items.eq(0).addClass(settings.firstControlClass);
+			items.eq(-1).addClass(settings.lastControlClass);
+
+			items.each(function(item) {
+				if (settings.controlClass) {
+					item.addClass(settings.controlClass);
+				}
+
+				html += item.renderHtml();
+			});
+
+			return html;
+		},
+
+		/**
+		 * Recalculates the positions of the controls in the specified container.
+		 *
+		 * @method recalc
+		 * @param {tinymce.ui.Container} container Container instance to recalc.
+		 */
+		recalc: function() {
+		},
+
+		/**
+		 * This method gets invoked after the layout renders the controls.
+		 *
+		 * @method postRender
+		 * @param {tinymce.ui.Container} container Container instance to postRender.
+		 */
+		postRender: function() {
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ListBox.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,143 @@
+/**
+ * ListBox.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new list box control.
+ *
+ * @-x-less ListBox.less
+ * @class tinymce.ui.ListBox
+ * @extends tinymce.ui.MenuButton
+ */
+define("tinymce/ui/ListBox", [
+	"tinymce/ui/MenuButton"
+], function(MenuButton) {
+	"use strict";
+
+	return MenuButton.extend({
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {Array} values Array with values to add to list box.
+		 */
+		init: function(settings) {
+			var self = this, values, selected, selectedText, lastItemCtrl;
+
+			function setSelected(menuValues) {
+				// Try to find a selected value
+				for (var i = 0; i < menuValues.length; i++) {
+					selected = menuValues[i].selected || settings.value === menuValues[i].value;
+
+					if (selected) {
+						selectedText = selectedText || menuValues[i].text;
+						self._value = menuValues[i].value;
+						break;
+					}
+
+					// If the value has a submenu, try to find the selected values in that menu
+					if (menuValues[i].menu) {
+						setSelected(menuValues[i].menu);
+					}
+				}
+			}
+
+			self._values = values = settings.values;
+			if (values) {
+				setSelected(values);
+
+				// Default with first item
+				if (!selected && values.length > 0) {
+					selectedText = values[0].text;
+					self._value = values[0].value;
+				}
+
+				settings.menu = values;
+			}
+
+			settings.text = settings.text || selectedText || values[0].text;
+
+			self._super(settings);
+			self.addClass('listbox');
+
+			self.on('select', function(e) {
+				var ctrl = e.control;
+
+				if (lastItemCtrl) {
+					e.lastControl = lastItemCtrl;
+				}
+
+				if (settings.multiple) {
+					ctrl.active(!ctrl.active());
+				} else {
+					self.value(e.control.settings.value);
+				}
+
+				lastItemCtrl = ctrl;
+			});
+		},
+
+		/**
+		 * Getter/setter function for the control value.
+		 *
+		 * @method value
+		 * @param {String} [value] Value to be set.
+		 * @return {Boolean/tinymce.ui.ListBox} Value or self if it's a set operation.
+		 */
+		value: function(value) {
+			var self = this, active, selectedText, menu;
+
+			function activateByValue(menu, value) {
+				menu.items().each(function(ctrl) {
+					active = ctrl.value() === value;
+
+					if (active) {
+						selectedText = selectedText || ctrl.text();
+					}
+
+					ctrl.active(active);
+
+					if (ctrl.menu) {
+						activateByValue(ctrl.menu, value);
+					}
+				});
+			}
+
+			function setActiveValues(menuValues) {
+				for (var i = 0; i < menuValues.length; i++) {
+					active = menuValues[i].value == value;
+
+					if (active) {
+						selectedText = selectedText || menuValues[i].text;
+					}
+
+					menuValues[i].active = active;
+
+					if (menuValues[i].menu) {
+						setActiveValues(menuValues[i].menu);
+					}
+				}
+			}
+
+			if (typeof value != "undefined") {
+				if (self.menu) {
+					activateByValue(self.menu, value);
+				} else {
+					menu = self.settings.menu;
+					setActiveValues(menu);
+				}
+
+				self.text(selectedText || this.settings.text);
+			}
+
+			return self._super(value);
+		}
+	});
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Menu.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,140 @@
+/**
+ * Menu.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new menu.
+ *
+ * @-x-less Menu.less
+ * @class tinymce.ui.Menu
+ * @extends tinymce.ui.FloatPanel
+ */
+define("tinymce/ui/Menu", [
+	"tinymce/ui/FloatPanel",
+	"tinymce/ui/MenuItem",
+	"tinymce/util/Tools"
+], function(FloatPanel, MenuItem, Tools) {
+	"use strict";
+
+	var Menu = FloatPanel.extend({
+		Defaults: {
+			defaultType: 'menuitem',
+			border: 1,
+			layout: 'stack',
+			role: 'application',
+			bodyRole: 'menu',
+			ariaRoot: true
+		},
+
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			settings.autohide = true;
+			settings.constrainToViewport = true;
+
+			if (settings.itemDefaults) {
+				var items = settings.items, i = items.length;
+
+				while (i--) {
+					items[i] = Tools.extend({}, settings.itemDefaults, items[i]);
+				}
+			}
+
+			self._super(settings);
+			self.addClass('menu');
+		},
+
+		/**
+		 * Repaints the control after a layout operation.
+		 *
+		 * @method repaint
+		 */
+		repaint: function() {
+			this.toggleClass('menu-align', true);
+
+			this._super();
+
+			this.getEl().style.height = '';
+			this.getEl('body').style.height = '';
+
+			return this;
+		},
+
+		/**
+		 * Hides/closes the menu.
+		 *
+		 * @method cancel
+		 */
+		cancel: function() {
+			var self = this;
+
+			self.hideAll();
+			self.fire('select');
+		},
+
+		/**
+		 * Hide menu and all sub menus.
+		 *
+		 * @method hideAll
+		 */
+		hideAll: function() {
+			var self = this;
+
+			this.find('menuitem').exec('hideMenu');
+
+			return self._super();
+		},
+/*
+		getContainerElm: function() {
+			var doc = document, id = this.classPrefix + 'menucontainer';
+
+			var elm = doc.getElementById(id);
+			if (!elm) {
+				elm = doc.createElement('div');
+				elm.id = id;
+				elm.setAttribute('role', 'application');
+				elm.className = this.classPrefix + '-reset';
+				elm.style.position = 'absolute';
+				elm.style.top = elm.style.left = '0';
+				elm.style.overflow = 'visible';
+				doc.body.appendChild(elm);
+			}
+
+			return elm;
+		},
+*/
+		/**
+		 * Invoked before the menu is rendered.
+		 *
+		 * @method preRender
+		 */
+		preRender: function() {
+			var self = this;
+
+			self.items().each(function(ctrl) {
+				var settings = ctrl.settings;
+
+				if (settings.icon || settings.selectable) {
+					self._hasIcons = true;
+					return false;
+				}
+			});
+
+			return self._super();
+		}
+	});
+
+	return Menu;
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/MenuBar.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,33 @@
+/**
+ * MenuBar.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new menubar.
+ *
+ * @-x-less MenuBar.less
+ * @class tinymce.ui.MenuBar
+ * @extends tinymce.ui.Toolbar
+ */
+define("tinymce/ui/MenuBar", [
+	"tinymce/ui/Toolbar"
+], function(Toolbar) {
+	"use strict";
+
+	return Toolbar.extend({
+		Defaults: {
+			role: 'menubar',
+			containerCls: 'menubar',
+			ariaRoot: true,
+			defaults: {
+				type: 'menubutton'
+			}
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/MenuButton.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,260 @@
+/**
+ * MenuButton.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new menu button.
+ *
+ * @-x-less MenuButton.less
+ * @class tinymce.ui.MenuButton
+ * @extends tinymce.ui.Button
+ */
+define("tinymce/ui/MenuButton", [
+	"tinymce/ui/Button",
+	"tinymce/ui/Factory",
+	"tinymce/ui/MenuBar"
+], function(Button, Factory, MenuBar) {
+	"use strict";
+
+	// TODO: Maybe add as some global function
+	function isChildOf(node, parent) {
+		while (node) {
+			if (parent === node) {
+				return true;
+			}
+
+			node = node.parentNode;
+		}
+
+		return false;
+	}
+
+	var MenuButton = Button.extend({
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self._renderOpen = true;
+			self._super(settings);
+
+			self.addClass('menubtn');
+
+			if (settings.fixedWidth) {
+				self.addClass('fixed-width');
+			}
+
+			self.aria('haspopup', true);
+			self.hasPopup = true;
+		},
+
+		/**
+		 * Shows the menu for the button.
+		 *
+		 * @method showMenu
+		 */
+		showMenu: function() {
+			var self = this, settings = self.settings, menu;
+
+			if (self.menu && self.menu.visible()) {
+				return self.hideMenu();
+			}
+
+			if (!self.menu) {
+				menu = settings.menu || [];
+
+				// Is menu array then auto constuct menu control
+				if (menu.length) {
+					menu = {
+						type: 'menu',
+						items: menu
+					};
+				} else {
+					menu.type = menu.type || 'menu';
+				}
+
+				self.menu = Factory.create(menu).parent(self).renderTo();
+				self.fire('createmenu');
+				self.menu.reflow();
+				self.menu.on('cancel', function(e) {
+					if (e.control.parent() === self.menu) {
+						e.stopPropagation();
+						self.focus();
+						self.hideMenu();
+					}
+				});
+
+				// Move focus to button when a menu item is selected/clicked
+				self.menu.on('select', function() {
+					self.focus();
+				});
+
+				self.menu.on('show hide', function(e) {
+					if (e.control == self.menu) {
+						self.activeMenu(e.type == 'show');
+					}
+
+					self.aria('expanded', e.type == 'show');
+				}).fire('show');
+			}
+
+			self.menu.show();
+			self.menu.layoutRect({w: self.layoutRect().w});
+			self.menu.moveRel(self.getEl(), self.isRtl() ? ['br-tr', 'tr-br'] : ['bl-tl', 'tl-bl']);
+		},
+
+		/**
+		 * Hides the menu for the button.
+		 *
+		 * @method hideMenu
+		 */
+		hideMenu: function() {
+			var self = this;
+
+			if (self.menu) {
+				self.menu.items().each(function(item) {
+					if (item.hideMenu) {
+						item.hideMenu();
+					}
+				});
+
+				self.menu.hide();
+			}
+		},
+
+		/**
+		 * Sets the active menu state.
+		 *
+		 * @private
+		 */
+		activeMenu: function(state) {
+			this.toggleClass('active', state);
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, id = self._id, prefix = self.classPrefix;
+			var icon = self.settings.icon, image;
+
+			image = self.settings.image;
+			if (image) {
+				icon = 'none';
+
+				// Support for [high dpi, low dpi] image sources
+				if (typeof image != "string") {
+					image = window.getSelection ? image[0] : image[1];
+				}
+
+				image = ' style="background-image: url(\'' + image + '\')"';
+			} else {
+				image = '';
+			}
+
+			icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
+
+			self.aria('role', self.parent() instanceof MenuBar ? 'menuitem' : 'button');
+
+			return (
+				'<div id="' + id + '" class="' + self.classes() + '" tabindex="-1" aria-labelledby="' + id + '">' +
+					'<button id="' + id + '-open" role="presentation" type="button" tabindex="-1">' +
+						(icon ? '<i class="' + icon + '"' + image + '></i>' : '') +
+						'<span>' + (self._text ? (icon ? '\u00a0' : '') + self.encode(self._text) : '') + '</span>' +
+						' <i class="' + prefix + 'caret"></i>' +
+					'</button>' +
+				'</div>'
+			);
+		},
+
+		/**
+		 * Gets invoked after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this;
+
+			self.on('click', function(e) {
+				if (e.control === self && isChildOf(e.target, self.getEl())) {
+					self.showMenu();
+
+					if (e.aria) {
+						self.menu.items()[0].focus();
+					}
+				}
+			});
+
+			self.on('mouseenter', function(e) {
+				var overCtrl = e.control, parent = self.parent(), hasVisibleSiblingMenu;
+
+				if (overCtrl && parent && overCtrl instanceof MenuButton && overCtrl.parent() == parent) {
+					parent.items().filter('MenuButton').each(function(ctrl) {
+						if (ctrl.hideMenu && ctrl != overCtrl) {
+							if (ctrl.menu && ctrl.menu.visible()) {
+								hasVisibleSiblingMenu = true;
+							}
+
+							ctrl.hideMenu();
+						}
+					});
+
+					if (hasVisibleSiblingMenu) {
+						overCtrl.focus(); // Fix for: #5887
+						overCtrl.showMenu();
+					}
+				}
+			});
+
+			return self._super();
+		},
+
+		/**
+		 * Sets/gets the current button text.
+		 *
+		 * @method text
+		 * @param {String} [text] New button text.
+		 * @return {String|tinymce.ui.MenuButton} Current text or current MenuButton instance.
+		 */
+		text: function(text) {
+			var self = this, i, children;
+
+			if (self._rendered) {
+				children = self.getEl('open').getElementsByTagName('span');
+				for (i = 0; i < children.length; i++) {
+					children[i].innerHTML = (self.settings.icon && text ? '\u00a0' : '') + self.encode(text);
+				}
+			}
+
+			return this._super(text);
+		},
+
+		/**
+		 * Removes the control and it's menus.
+		 *
+		 * @method remove
+		 */
+		remove: function() {
+			this._super();
+
+			if (this.menu) {
+				this.menu.remove();
+			}
+		}
+	});
+
+	return MenuButton;
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/MenuItem.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,322 @@
+/**
+ * MenuItem.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new menu item.
+ *
+ * @-x-less MenuItem.less
+ * @class tinymce.ui.MenuItem
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/MenuItem", [
+	"tinymce/ui/Widget",
+	"tinymce/ui/Factory",
+	"tinymce/Env"
+], function(Widget, Factory, Env) {
+	"use strict";
+
+	return Widget.extend({
+		Defaults: {
+			border: 0,
+			role: 'menuitem'
+		},
+
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {Boolean} selectable Selectable menu.
+		 * @setting {Array} menu Submenu array with items.
+		 * @setting {String} shortcut Shortcut to display for menu item. Example: Ctrl+X
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self.hasPopup = true;
+
+			self._super(settings);
+
+			settings = self.settings;
+
+			self.addClass('menu-item');
+
+			if (settings.menu) {
+				self.addClass('menu-item-expand');
+			}
+
+			if (settings.preview) {
+				self.addClass('menu-item-preview');
+			}
+
+			if (self._text === '-' || self._text === '|') {
+				self.addClass('menu-item-sep');
+				self.aria('role', 'separator');
+				self._text = '-';
+			}
+
+			if (settings.selectable) {
+				self.aria('role', 'menuitemcheckbox');
+				self.addClass('menu-item-checkbox');
+				settings.icon = 'selected';
+			}
+
+			if (!settings.preview && !settings.selectable) {
+				self.addClass('menu-item-normal');
+			}
+
+			self.on('mousedown', function(e) {
+				e.preventDefault();
+			});
+
+			if (settings.menu && !settings.ariaHideMenu) {
+				self.aria('haspopup', true);
+			}
+		},
+
+		/**
+		 * Returns true/false if the menuitem has sub menu.
+		 *
+		 * @method hasMenus
+		 * @return {Boolean} True/false state if it has submenu.
+		 */
+		hasMenus: function() {
+			return !!this.settings.menu;
+		},
+
+		/**
+		 * Shows the menu for the menu item.
+		 *
+		 * @method showMenu
+		 */
+		showMenu: function() {
+			var self = this, settings = self.settings, menu, parent = self.parent();
+
+			parent.items().each(function(ctrl) {
+				if (ctrl !== self) {
+					ctrl.hideMenu();
+				}
+			});
+
+			if (settings.menu) {
+				menu = self.menu;
+
+				if (!menu) {
+					menu = settings.menu;
+
+					// Is menu array then auto constuct menu control
+					if (menu.length) {
+						menu = {
+							type: 'menu',
+							items: menu
+						};
+					} else {
+						menu.type = menu.type || 'menu';
+					}
+
+					if (parent.settings.itemDefaults) {
+						menu.itemDefaults = parent.settings.itemDefaults;
+					}
+
+					menu = self.menu = Factory.create(menu).parent(self).renderTo();
+					menu.reflow();
+					menu.on('cancel', function(e) {
+						e.stopPropagation();
+						self.focus();
+						menu.hide();
+					});
+					menu.on('show hide', function(e) {
+						e.control.items().each(function(ctrl) {
+							ctrl.active(ctrl.settings.selected);
+						});
+					}).fire('show');
+
+					menu.on('hide', function(e) {
+						if (e.control === menu) {
+							self.removeClass('selected');
+						}
+					});
+
+					menu.submenu = true;
+				} else {
+					menu.show();
+				}
+
+				menu._parentMenu = parent;
+
+				menu.addClass('menu-sub');
+
+				var rel = menu.testMoveRel(
+					self.getEl(),
+					self.isRtl() ? ['tl-tr', 'bl-br', 'tr-tl', 'br-bl'] : ['tr-tl', 'br-bl', 'tl-tr', 'bl-br']
+				);
+
+				menu.moveRel(self.getEl(), rel);
+				menu.rel = rel;
+
+				rel = 'menu-sub-' + rel;
+				menu.removeClass(menu._lastRel);
+				menu.addClass(rel);
+				menu._lastRel = rel;
+
+				self.addClass('selected');
+				self.aria('expanded', true);
+			}
+		},
+
+		/**
+		 * Hides the menu for the menu item.
+		 *
+		 * @method hideMenu
+		 */
+		hideMenu: function() {
+			var self = this;
+
+			if (self.menu) {
+				self.menu.items().each(function(item) {
+					if (item.hideMenu) {
+						item.hideMenu();
+					}
+				});
+
+				self.menu.hide();
+				self.aria('expanded', false);
+			}
+
+			return self;
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, id = self._id, settings = self.settings, prefix = self.classPrefix, text = self.encode(self._text);
+			var icon = self.settings.icon, image = '', shortcut = settings.shortcut;
+
+			// Converts shortcut format to Mac/PC variants
+			function convertShortcut(shortcut) {
+				var i, value, replace = {};
+
+				if (Env.mac) {
+					replace = {
+						alt: '&#x2325;',
+						ctrl: '&#x2318;',
+						shift: '&#x21E7;',
+						meta: '&#x2318;'
+					};
+				} else {
+					replace = {
+						meta: 'Ctrl'
+					};
+				}
+
+				shortcut = shortcut.split('+');
+
+				for (i = 0; i < shortcut.length; i++) {
+					value = replace[shortcut[i].toLowerCase()];
+
+					if (value) {
+						shortcut[i] = value;
+					}
+				}
+
+				return shortcut.join('+');
+			}
+
+			if (icon) {
+				self.parent().addClass('menu-has-icons');
+			}
+
+			if (settings.image) {
+				icon = 'none';
+				image = ' style="background-image: url(\'' + settings.image + '\')"';
+			}
+
+			if (shortcut) {
+				shortcut = convertShortcut(shortcut);
+			}
+
+			icon = prefix + 'ico ' + prefix + 'i-' + (self.settings.icon || 'none');
+
+			return (
+				'<div id="' + id + '" class="' + self.classes() + '" tabindex="-1">' +
+					(text !== '-' ? '<i class="' + icon + '"' + image + '></i>\u00a0' : '') +
+					(text !== '-' ? '<span id="' + id + '-text" class="' + prefix + 'text">' + text + '</span>' : '') +
+					(shortcut ? '<div id="' + id + '-shortcut" class="' + prefix + 'menu-shortcut">' + shortcut + '</div>' : '') +
+					(settings.menu ? '<div class="' + prefix + 'caret"></div>' : '') +
+				'</div>'
+			);
+		},
+
+		/**
+		 * Gets invoked after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this, settings = self.settings;
+
+			var textStyle = settings.textStyle;
+			if (typeof textStyle == "function") {
+				textStyle = textStyle.call(this);
+			}
+
+			if (textStyle) {
+				var textElm = self.getEl('text');
+				if (textElm) {
+					textElm.setAttribute('style', textStyle);
+				}
+			}
+
+			self.on('mouseenter click', function(e) {
+				if (e.control === self) {
+					if (!settings.menu && e.type === 'click') {
+						self.fire('select');
+						self.parent().hideAll();
+					} else {
+						self.showMenu();
+
+						if (e.aria) {
+							self.menu.focus(true);
+						}
+					}
+				}
+			});
+
+			self._super();
+
+			return self;
+		},
+
+		active: function(state) {
+			if (typeof state != "undefined") {
+				this.aria('checked', state);
+			}
+
+			return this._super(state);
+		},
+
+		/**
+		 * Removes the control and it's menus.
+		 *
+		 * @method remove
+		 */
+		remove: function() {
+			this._super();
+
+			if (this.menu) {
+				this.menu.remove();
+			}
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/MessageBox.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,202 @@
+/**
+ * MessageBox.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is used to create MessageBoxes like alerts/confirms etc.
+ *
+ * @class tinymce.ui.MessageBox
+ * @extends tinymce.ui.Window
+ */
+define("tinymce/ui/MessageBox", [
+	"tinymce/ui/Window"
+], function(Window) {
+	"use strict";
+
+	var MessageBox = Window.extend({
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 */
+		init: function(settings) {
+			settings = {
+				border: 1,
+				padding: 20,
+				layout: 'flex',
+				pack: "center",
+				align: "center",
+				containerCls: 'panel',
+				autoScroll: true,
+				buttons: {type: "button", text: "Ok", action: "ok"},
+				items: {
+					type: "label",
+					multiline: true,
+					maxWidth: 500,
+					maxHeight: 200
+				}
+			};
+
+			this._super(settings);
+		},
+
+		Statics: {
+			/**
+			 * Ok buttons constant.
+			 *
+			 * @static
+			 * @final
+			 * @field {Number} OK
+			 */
+			OK: 1,
+
+			/**
+			 * Ok/cancel buttons constant.
+			 *
+			 * @static
+			 * @final
+			 * @field {Number} OK_CANCEL
+			 */
+			OK_CANCEL: 2,
+
+			/**
+			 * yes/no buttons constant.
+			 *
+			 * @static
+			 * @final
+			 * @field {Number} YES_NO
+			 */
+			YES_NO: 3,
+
+			/**
+			 * yes/no/cancel buttons constant.
+			 *
+			 * @static
+			 * @final
+			 * @field {Number} YES_NO_CANCEL
+			 */
+			YES_NO_CANCEL: 4,
+
+			/**
+			 * Constructs a new message box and renders it to the body element.
+			 *
+			 * @static
+			 * @method msgBox
+			 * @param {Object} settings Name/value object with settings.
+			 */
+			msgBox: function(settings) {
+				var buttons, callback = settings.callback || function() {};
+
+				function createButton(text, status, primary) {
+					return {
+						type: "button",
+						text: text,
+						subtype: primary ? 'primary' : '',
+						onClick: function(e) {
+							e.control.parents()[1].close();
+							callback(status);
+						}
+					};
+				}
+
+				switch (settings.buttons) {
+					case MessageBox.OK_CANCEL:
+						buttons = [
+							createButton('Ok', true, true),
+							createButton('Cancel', false)
+						];
+						break;
+
+					case MessageBox.YES_NO:
+					case MessageBox.YES_NO_CANCEL:
+						buttons = [
+							createButton('Yes', 1, true),
+							createButton('No', 0)
+						];
+
+						if (settings.buttons == MessageBox.YES_NO_CANCEL) {
+							buttons.push(createButton('Cancel', -1));
+						}
+						break;
+
+					default:
+						buttons = [
+							createButton('Ok', true, true)
+						];
+						break;
+				}
+
+				return new Window({
+					padding: 20,
+					x: settings.x,
+					y: settings.y,
+					minWidth: 300,
+					minHeight: 100,
+					layout: "flex",
+					pack: "center",
+					align: "center",
+					buttons: buttons,
+					title: settings.title,
+					role: 'alertdialog',
+					items: {
+						type: "label",
+						multiline: true,
+						maxWidth: 500,
+						maxHeight: 200,
+						text: settings.text
+					},
+					onPostRender: function() {
+						this.aria('describedby', this.items()[0]._id);
+					},
+					onClose: settings.onClose,
+					onCancel: function() {
+						callback(false);
+					}
+				}).renderTo(document.body).reflow();
+			},
+
+			/**
+			 * Creates a new alert dialog.
+			 *
+			 * @method alert
+			 * @param {Object} settings Settings for the alert dialog.
+			 * @param {function} [callback] Callback to execute when the user makes a choice.
+			 */
+			alert: function(settings, callback) {
+				if (typeof settings == "string") {
+					settings = {text: settings};
+				}
+
+				settings.callback = callback;
+				return MessageBox.msgBox(settings);
+			},
+
+			/**
+			 * Creates a new confirm dialog.
+			 *
+			 * @method confirm
+			 * @param {Object} settings Settings for the confirm dialog.
+			 * @param {function} [callback] Callback to execute when the user makes a choice.
+			 */
+			confirm: function(settings, callback) {
+				if (typeof settings == "string") {
+					settings = {text: settings};
+				}
+
+				settings.callback = callback;
+				settings.buttons = MessageBox.OK_CANCEL;
+
+				return MessageBox.msgBox(settings);
+			}
+		}
+	});
+
+	return MessageBox;
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Movable.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,200 @@
+/**
+ * Movable.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Movable mixin. Makes controls movable absolute and relative to other elements.
+ *
+ * @mixin tinymce.ui.Movable
+ */
+define("tinymce/ui/Movable", [
+	"tinymce/ui/DomUtils"
+], function(DomUtils) {
+	"use strict";
+
+	function calculateRelativePosition(ctrl, targetElm, rel) {
+		var ctrlElm, pos, x, y, selfW, selfH, targetW, targetH, viewport, size;
+
+		viewport = DomUtils.getViewPort();
+
+		// Get pos of target
+		pos = DomUtils.getPos(targetElm);
+		x = pos.x;
+		y = pos.y;
+
+		if (ctrl._fixed && DomUtils.getRuntimeStyle(document.body, 'position') == 'static') {
+			x -= viewport.x;
+			y -= viewport.y;
+		}
+
+		// Get size of self
+		ctrlElm = ctrl.getEl();
+		size = DomUtils.getSize(ctrlElm);
+		selfW = size.width;
+		selfH = size.height;
+
+		// Get size of target
+		size = DomUtils.getSize(targetElm);
+		targetW = size.width;
+		targetH = size.height;
+
+		// Parse align string
+		rel = (rel || '').split('');
+
+		// Target corners
+		if (rel[0] === 'b') {
+			y += targetH;
+		}
+
+		if (rel[1] === 'r') {
+			x += targetW;
+		}
+
+		if (rel[0] === 'c') {
+			y += Math.round(targetH / 2);
+		}
+
+		if (rel[1] === 'c') {
+			x += Math.round(targetW / 2);
+		}
+
+		// Self corners
+		if (rel[3] === 'b') {
+			y -= selfH;
+		}
+
+		if (rel[4] === 'r') {
+			x -= selfW;
+		}
+
+		if (rel[3] === 'c') {
+			y -= Math.round(selfH / 2);
+		}
+
+		if (rel[4] === 'c') {
+			x -= Math.round(selfW / 2);
+		}
+
+		return {
+			x: x,
+			y: y,
+			w: selfW,
+			h: selfH
+		};
+	}
+
+	return {
+		/**
+		 * Tests various positions to get the most suitable one.
+		 *
+		 * @method testMoveRel
+		 * @param {DOMElement} elm Element to position against.
+		 * @param {Array} rels Array with relative positions.
+		 * @return {String} Best suitable relative position.
+		 */
+		testMoveRel: function(elm, rels) {
+			var viewPortRect = DomUtils.getViewPort();
+
+			for (var i = 0; i < rels.length; i++) {
+				var pos = calculateRelativePosition(this, elm, rels[i]);
+
+				if (this._fixed) {
+					if (pos.x > 0 && pos.x + pos.w < viewPortRect.w && pos.y > 0 && pos.y + pos.h < viewPortRect.h) {
+						return rels[i];
+					}
+				} else {
+					if (pos.x > viewPortRect.x && pos.x + pos.w < viewPortRect.w + viewPortRect.x &&
+						pos.y > viewPortRect.y && pos.y + pos.h < viewPortRect.h + viewPortRect.y) {
+						return rels[i];
+					}
+				}
+			}
+
+			return rels[0];
+		},
+
+		/**
+		 * Move relative to the specified element.
+		 *
+		 * @method moveRel
+		 * @param {Element} elm Element to move relative to.
+		 * @param {String} rel Relative mode. For example: br-tl.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		moveRel: function(elm, rel) {
+			if (typeof rel != 'string') {
+				rel = this.testMoveRel(elm, rel);
+			}
+
+			var pos = calculateRelativePosition(this, elm, rel);
+			return this.moveTo(pos.x, pos.y);
+		},
+
+		/**
+		 * Move by a relative x, y values.
+		 *
+		 * @method moveBy
+		 * @param {Number} dx Relative x position.
+		 * @param {Number} dy Relative y position.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		moveBy: function(dx, dy) {
+			var self = this, rect = self.layoutRect();
+
+			self.moveTo(rect.x + dx, rect.y + dy);
+
+			return self;
+		},
+
+		/**
+		 * Move to absolute position.
+		 *
+		 * @method moveTo
+		 * @param {Number} x Absolute x position.
+		 * @param {Number} y Absolute y position.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		moveTo: function(x, y) {
+			var self = this;
+
+			// TODO: Move this to some global class
+			function contrain(value, max, size) {
+				if (value < 0) {
+					return 0;
+				}
+
+				if (value + size > max) {
+					value = max - size;
+					return value < 0 ? 0 : value;
+				}
+
+				return value;
+			}
+
+			if (self.settings.constrainToViewport) {
+				var viewPortRect = DomUtils.getViewPort(window);
+				var layoutRect = self.layoutRect();
+
+				x = contrain(x, viewPortRect.w + viewPortRect.x, layoutRect.w);
+				y = contrain(y, viewPortRect.h + viewPortRect.y, layoutRect.h);
+			}
+
+			if (self._rendered) {
+				self.layoutRect({x: x, y: y}).repaint();
+			} else {
+				self.settings.x = x;
+				self.settings.y = y;
+			}
+
+			self.fire('move', {x: x, y: y});
+
+			return self;
+		}
+	};
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Panel.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,67 @@
+/**
+ * Panel.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new panel.
+ *
+ * @-x-less Panel.less
+ * @class tinymce.ui.Panel
+ * @extends tinymce.ui.Container
+ * @mixes tinymce.ui.Scrollable
+ */
+define("tinymce/ui/Panel", [
+	"tinymce/ui/Container",
+	"tinymce/ui/Scrollable"
+], function(Container, Scrollable) {
+	"use strict";
+
+	return Container.extend({
+		Defaults: {
+			layout: 'fit',
+			containerCls: 'panel'
+		},
+
+		Mixins: [Scrollable],
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, layout = self._layout, innerHtml = self.settings.html;
+
+			self.preRender();
+			layout.preRender(self);
+
+			if (typeof innerHtml == "undefined") {
+				innerHtml = (
+					'<div id="' + self._id + '-body" class="' + self.classes('body') + '">' +
+						layout.renderHtml(self) +
+					'</div>'
+				);
+			} else {
+				if (typeof innerHtml == 'function') {
+					innerHtml = innerHtml.call(self);
+				}
+
+				self._hasBody = false;
+			}
+
+			return (
+				'<div id="' + self._id + '" class="' + self.classes() + '" hidefocus="1" tabindex="-1" role="group">' +
+					(self._preBodyHtml || '') +
+					innerHtml +
+				'</div>'
+			);
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/PanelButton.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,114 @@
+/**
+ * PanelButton.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new panel button.
+ *
+ * @class tinymce.ui.PanelButton
+ * @extends tinymce.ui.Button
+ */
+define("tinymce/ui/PanelButton", [
+	"tinymce/ui/Button",
+	"tinymce/ui/FloatPanel"
+], function(Button, FloatPanel) {
+	"use strict";
+
+	return Button.extend({
+		/**
+		 * Shows the panel for the button.
+		 *
+		 * @method showPanel
+		 */
+		showPanel: function() {
+			var self = this, settings = self.settings;
+
+			self.active(true);
+
+			if (!self.panel) {
+				var panelSettings = settings.panel;
+
+				// Wrap panel in grid layout if type if specified
+				// This makes it possible to add forms or other containers directly in the panel option
+				if (panelSettings.type) {
+					panelSettings = {
+						layout: 'grid',
+						items: panelSettings
+					};
+				}
+
+				panelSettings.role = panelSettings.role || 'dialog';
+				panelSettings.popover = true;
+				panelSettings.autohide = true;
+				panelSettings.ariaRoot = true;
+
+				self.panel = new FloatPanel(panelSettings).on('hide', function() {
+					self.active(false);
+				}).on('cancel', function(e) {
+					e.stopPropagation();
+					self.focus();
+					self.hidePanel();
+				}).parent(self).renderTo(self.getContainerElm());
+
+				self.panel.fire('show');
+				self.panel.reflow();
+			} else {
+				self.panel.show();
+			}
+
+			self.panel.moveRel(self.getEl(), settings.popoverAlign || (self.isRtl() ? ['bc-tr', 'bc-tc'] : ['bc-tl', 'bc-tc']));
+		},
+
+		/**
+		 * Hides the panel for the button.
+		 *
+		 * @method hidePanel
+		 */
+		hidePanel: function() {
+			var self = this;
+
+			if (self.panel) {
+				self.panel.hide();
+			}
+		},
+
+		/**
+		 * Called after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this;
+
+			self.aria('haspopup', true);
+
+			self.on('click', function(e) {
+				if (e.control === self) {
+					if (self.panel && self.panel.visible()) {
+						self.hidePanel();
+					} else {
+						self.showPanel();
+						self.panel.focus(!!e.aria);
+					}
+				}
+			});
+
+			return self._super();
+		},
+
+		remove: function() {
+			if (this.panel) {
+				this.panel.remove();
+				this.panel = null;
+			}
+
+			return this._super();
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Path.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,140 @@
+/**
+ * Path.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new path control.
+ *
+ * @-x-less Path.less
+ * @class tinymce.ui.Path
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/Path", [
+	"tinymce/ui/Widget"
+], function(Widget) {
+	"use strict";
+
+	return Widget.extend({
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {String} delimiter Delimiter to display between items in path.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			if (!settings.delimiter) {
+				settings.delimiter = '\u00BB';
+			}
+
+			self._super(settings);
+			self.addClass('path');
+			self.canFocus = true;
+
+			self.on('click', function(e) {
+				var index, target = e.target;
+
+				if ((index = target.getAttribute('data-index'))) {
+					self.fire('select', {value: self.data()[index], index: index});
+				}
+			});
+		},
+
+		/**
+		 * Focuses the current control.
+		 *
+		 * @method focus
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		focus: function() {
+			var self = this;
+
+			self.getEl().firstChild.focus();
+
+			return self;
+		},
+
+		/**
+		 * Sets/gets the data to be used for the path.
+		 *
+		 * @method data
+		 * @param {Array} data Array with items name is rendered to path.
+		 */
+		data: function(data) {
+			var self = this;
+
+			if (typeof data !== "undefined") {
+				self._data = data;
+				self.update();
+
+				return self;
+			}
+
+			return self._data;
+		},
+
+		/**
+		 * Updated the path.
+		 *
+		 * @private
+		 */
+		update: function() {
+			this.innerHtml(this._getPathHtml());
+		},
+
+		/**
+		 * Called after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this;
+
+			self._super();
+
+			self.data(self.settings.data);
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this;
+
+			return (
+				'<div id="' + self._id + '" class="' + self.classes() + '">' +
+					self._getPathHtml() +
+				'</div>'
+			);
+		},
+
+		_getPathHtml: function() {
+			var self = this, parts = self._data || [], i, l, html = '', prefix = self.classPrefix;
+
+			for (i = 0, l = parts.length; i < l; i++) {
+				html += (
+					(i > 0 ? '<div class="' + prefix + 'divider" aria-hidden="true"> ' + self.settings.delimiter + ' </div>' : '') +
+					'<div role="button" class="' + prefix + 'path-item' + (i == l - 1 ? ' ' + prefix + 'last' : '') + '" data-index="' +
+					i + '" tabindex="-1" id="' + self._id + '-' + i + '" aria-level="' + i + '">' + parts[i].name + '</div>'
+				);
+			}
+
+			if (!html) {
+				html = '<div class="' + prefix + 'path-item">\u00a0</div>';
+			}
+
+			return html;
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Radio.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,29 @@
+/**
+ * Radio.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new radio button.
+ *
+ * @-x-less Radio.less
+ * @class tinymce.ui.Radio
+ * @extends tinymce.ui.Checkbox
+ */
+define("tinymce/ui/Radio", [
+	"tinymce/ui/Checkbox"
+], function(Checkbox) {
+	"use strict";
+
+	return Checkbox.extend({
+		Defaults: {
+			classes: "radio",
+			role: "radio"
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Resizable.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,68 @@
+/**
+ * Resizable.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Resizable mixin. Enables controls to be resized.
+ *
+ * @mixin tinymce.ui.Resizable
+ */
+define("tinymce/ui/Resizable", [
+	"tinymce/ui/DomUtils"
+], function(DomUtils) {
+	"use strict";
+
+	return {
+		/**
+		 * Resizes the control to contents.
+		 *
+		 * @method resizeToContent
+		 */
+		resizeToContent: function() {
+			this._layoutRect.autoResize = true;
+			this._lastRect = null;
+			this.reflow();
+		},
+
+		/**
+		 * Resizes the control to a specific width/height.
+		 *
+		 * @method resizeTo
+		 * @param {Number} w Control width.
+		 * @param {Number} h Control height.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		resizeTo: function(w, h) {
+			// TODO: Fix hack
+			if (w <= 1 || h <= 1) {
+				var rect = DomUtils.getWindowSize();
+
+				w = w <= 1 ? w * rect.w : w;
+				h = h <= 1 ? h * rect.h : h;
+			}
+
+			this._layoutRect.autoResize = false;
+			return this.layoutRect({minW: w, minH: h, w: w, h: h}).reflow();
+		},
+
+		/**
+		 * Resizes the control to a specific relative width/height.
+		 *
+		 * @method resizeBy
+		 * @param {Number} dw Relative control width.
+		 * @param {Number} dh Relative control height.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		resizeBy: function(dw, dh) {
+			var self = this, rect = self.layoutRect();
+
+			return self.resizeTo(rect.w + dw, rect.h + dh);
+		}
+	};
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/ResizeHandle.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,86 @@
+/**
+ * ResizeHandle.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Renders a resize handle that fires ResizeStart, Resize and ResizeEnd events.
+ *
+ * @-x-less ResizeHandle.less
+ * @class tinymce.ui.ResizeHandle
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/ResizeHandle", [
+	"tinymce/ui/Widget",
+	"tinymce/ui/DragHelper"
+], function(Widget, DragHelper) {
+	"use strict";
+
+	return Widget.extend({
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, prefix = self.classPrefix;
+
+			self.addClass('resizehandle');
+
+			if (self.settings.direction == "both") {
+				self.addClass('resizehandle-both');
+			}
+
+			self.canFocus = false;
+
+			return (
+				'<div id="' + self._id + '" class="' + self.classes() + '">' +
+					'<i class="' + prefix + 'ico ' + prefix + 'i-resize"></i>' +
+				'</div>'
+			);
+		},
+
+		/**
+		 * Called after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this;
+
+			self._super();
+
+			self.resizeDragHelper = new DragHelper(this._id, {
+				start: function() {
+					self.fire('ResizeStart');
+				},
+
+				drag: function(e) {
+					if (self.settings.direction != "both") {
+						e.deltaX = 0;
+					}
+
+					self.fire('Resize', e);
+				},
+
+				stop: function() {
+					self.fire('ResizeEnd');
+				}
+			});
+		},
+
+		remove: function() {
+			if (this.resizeDragHelper) {
+				this.resizeDragHelper.destroy();
+			}
+
+			return this._super();
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Scrollable.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,149 @@
+/**
+ * Scrollable.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This mixin makes controls scrollable using custom scrollbars.
+ *
+ * @-x-less Scrollable.less
+ * @mixin tinymce.ui.Scrollable
+ */
+define("tinymce/ui/Scrollable", [
+	"tinymce/ui/DomUtils",
+	"tinymce/ui/DragHelper"
+], function(DomUtils, DragHelper) {
+	"use strict";
+
+	return {
+		init: function() {
+			var self = this;
+			self.on('repaint', self.renderScroll);
+		},
+
+		renderScroll: function() {
+			var self = this, margin = 2;
+
+			function repaintScroll() {
+				var hasScrollH, hasScrollV, bodyElm;
+
+				function repaintAxis(axisName, posName, sizeName, contentSizeName, hasScroll, ax) {
+					var containerElm, scrollBarElm, scrollThumbElm;
+					var containerSize, scrollSize, ratio, rect;
+					var posNameLower, sizeNameLower;
+
+					scrollBarElm = self.getEl('scroll' + axisName);
+					if (scrollBarElm) {
+						posNameLower = posName.toLowerCase();
+						sizeNameLower = sizeName.toLowerCase();
+
+						if (self.getEl('absend')) {
+							DomUtils.css(self.getEl('absend'), posNameLower, self.layoutRect()[contentSizeName] - 1);
+						}
+
+						if (!hasScroll) {
+							DomUtils.css(scrollBarElm, 'display', 'none');
+							return;
+						}
+
+						DomUtils.css(scrollBarElm, 'display', 'block');
+						containerElm = self.getEl('body');
+						scrollThumbElm = self.getEl('scroll' + axisName + "t");
+						containerSize = containerElm["client" + sizeName] - (margin * 2);
+						containerSize -= hasScrollH && hasScrollV ? scrollBarElm["client" + ax] : 0;
+						scrollSize = containerElm["scroll" + sizeName];
+						ratio = containerSize / scrollSize;
+
+						rect = {};
+						rect[posNameLower] = containerElm["offset" + posName] + margin;
+						rect[sizeNameLower] = containerSize;
+						DomUtils.css(scrollBarElm, rect);
+
+						rect = {};
+						rect[posNameLower] = containerElm["scroll" + posName] * ratio;
+						rect[sizeNameLower] = containerSize * ratio;
+						DomUtils.css(scrollThumbElm, rect);
+					}
+				}
+
+				bodyElm = self.getEl('body');
+				hasScrollH = bodyElm.scrollWidth > bodyElm.clientWidth;
+				hasScrollV = bodyElm.scrollHeight > bodyElm.clientHeight;
+
+				repaintAxis("h", "Left", "Width", "contentW", hasScrollH, "Height");
+				repaintAxis("v", "Top", "Height", "contentH", hasScrollV, "Width");
+			}
+
+			function addScroll() {
+				function addScrollAxis(axisName, posName, sizeName, deltaPosName, ax) {
+					var scrollStart, axisId = self._id + '-scroll' + axisName, prefix = self.classPrefix;
+
+					self.getEl().appendChild(DomUtils.createFragment(
+						'<div id="' + axisId + '" class="' + prefix + 'scrollbar ' + prefix + 'scrollbar-' + axisName + '">' +
+							'<div id="' + axisId + 't" class="' + prefix + 'scrollbar-thumb"></div>' +
+						'</div>'
+					));
+
+					self.draghelper = new DragHelper(axisId + 't', {
+						start: function() {
+							scrollStart = self.getEl('body')["scroll" + posName];
+							DomUtils.addClass(DomUtils.get(axisId), prefix + 'active');
+						},
+
+						drag: function(e) {
+							var ratio, hasScrollH, hasScrollV, containerSize, layoutRect = self.layoutRect();
+
+							hasScrollH = layoutRect.contentW > layoutRect.innerW;
+							hasScrollV = layoutRect.contentH > layoutRect.innerH;
+							containerSize = self.getEl('body')["client" + sizeName] - (margin * 2);
+							containerSize -= hasScrollH && hasScrollV ? self.getEl('scroll' + axisName)["client" + ax] : 0;
+
+							ratio = containerSize / self.getEl('body')["scroll" + sizeName];
+							self.getEl('body')["scroll" + posName] = scrollStart + (e["delta" + deltaPosName] / ratio);
+						},
+
+						stop: function() {
+							DomUtils.removeClass(DomUtils.get(axisId), prefix + 'active');
+						}
+					});
+/*
+					self.on('click', function(e) {
+						if (e.target.id == self._id + '-scrollv') {
+
+						}
+					});*/
+				}
+
+				self.addClass('scroll');
+
+				addScrollAxis("v", "Top", "Height", "Y", "Width");
+				addScrollAxis("h", "Left", "Width", "X", "Height");
+			}
+
+			if (self.settings.autoScroll) {
+				if (!self._hasScroll) {
+					self._hasScroll = true;
+					addScroll();
+
+					self.on('wheel', function(e) {
+						var bodyEl = self.getEl('body');
+
+						bodyEl.scrollLeft += (e.deltaX || 0) * 10;
+						bodyEl.scrollTop += e.deltaY * 10;
+
+						repaintScroll();
+					});
+
+					DomUtils.on(self.getEl('body'), "scroll", repaintScroll);
+				}
+
+				repaintScroll();
+			}
+		}
+	};
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Selector.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,369 @@
+/**
+ * Selector.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*eslint no-nested-ternary:0 */
+
+/**
+ * Selector engine, enables you to select controls by using CSS like expressions.
+ * We currently only support basic CSS expressions to reduce the size of the core
+ * and the ones we support should be enough for most cases.
+ *
+ * @example
+ * Supported expressions:
+ *  element
+ *  element#name
+ *  element.class
+ *  element[attr]
+ *  element[attr*=value]
+ *  element[attr~=value]
+ *  element[attr!=value]
+ *  element[attr^=value]
+ *  element[attr$=value]
+ *  element:<state>
+ *  element:not(<expression>)
+ *  element:first
+ *  element:last
+ *  element:odd
+ *  element:even
+ *  element element
+ *  element > element
+ *
+ * @class tinymce.ui.Selector
+ */
+define("tinymce/ui/Selector", [
+	"tinymce/util/Class"
+], function(Class) {
+	"use strict";
+
+	/**
+	 * Produces an array with a unique set of objects. It will not compare the values
+	 * but the references of the objects.
+	 *
+	 * @private
+	 * @method unqiue
+	 * @param {Array} array Array to make into an array with unique items.
+	 * @return {Array} Array with unique items.
+	 */
+	function unique(array) {
+		var uniqueItems = [], i = array.length, item;
+
+		while (i--) {
+			item = array[i];
+
+			if (!item.__checked) {
+				uniqueItems.push(item);
+				item.__checked = 1;
+			}
+		}
+
+		i = uniqueItems.length;
+		while (i--) {
+			delete uniqueItems[i].__checked;
+		}
+
+		return uniqueItems;
+	}
+
+	var expression = /^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i;
+
+	/*jshint maxlen:255 */
+	/*eslint max-len:0 */
+	var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+		whiteSpace = /^\s*|\s*$/g,
+		Collection;
+
+	var Selector = Class.extend({
+		/**
+		 * Constructs a new Selector instance.
+		 *
+		 * @constructor
+		 * @method init
+		 * @param {String} selector CSS like selector expression.
+		 */
+		init: function(selector) {
+			var match = this.match;
+
+			function compileNameFilter(name) {
+				if (name) {
+					name = name.toLowerCase();
+
+					return function(item) {
+						return name === '*' || item.type === name;
+					};
+				}
+			}
+
+			function compileIdFilter(id) {
+				if (id) {
+					return function(item) {
+						return item._name === id;
+					};
+				}
+			}
+
+			function compileClassesFilter(classes) {
+				if (classes) {
+					classes = classes.split('.');
+
+					return function(item) {
+						var i = classes.length;
+
+						while (i--) {
+							if (!item.hasClass(classes[i])) {
+								return false;
+							}
+						}
+
+						return true;
+					};
+				}
+			}
+
+			function compileAttrFilter(name, cmp, check) {
+				if (name) {
+					return function(item) {
+						var value = item[name] ? item[name]() : '';
+
+						return !cmp ? !!check :
+							cmp === "=" ? value === check :
+							cmp === "*=" ? value.indexOf(check) >= 0 :
+							cmp === "~=" ? (" " + value + " ").indexOf(" " + check + " ") >= 0 :
+							cmp === "!=" ? value != check :
+							cmp === "^=" ? value.indexOf(check) === 0 :
+							cmp === "$=" ? value.substr(value.length - check.length) === check :
+							false;
+					};
+				}
+			}
+
+			function compilePsuedoFilter(name) {
+				var notSelectors;
+
+				if (name) {
+					name = /(?:not\((.+)\))|(.+)/i.exec(name);
+
+					if (!name[1]) {
+						name = name[2];
+
+						return function(item, index, length) {
+							return name === 'first' ? index === 0 :
+								name === 'last' ? index === length - 1 :
+								name === 'even' ? index % 2 === 0 :
+								name === 'odd' ? index % 2 === 1 :
+								item[name] ? item[name]() :
+								false;
+						};
+					} else {
+						// Compile not expression
+						notSelectors = parseChunks(name[1], []);
+
+						return function(item) {
+							return !match(item, notSelectors);
+						};
+					}
+				}
+			}
+
+			function compile(selector, filters, direct) {
+				var parts;
+
+				function add(filter) {
+					if (filter) {
+						filters.push(filter);
+					}
+				}
+
+				// Parse expression into parts
+				parts = expression.exec(selector.replace(whiteSpace, ''));
+
+				add(compileNameFilter(parts[1]));
+				add(compileIdFilter(parts[2]));
+				add(compileClassesFilter(parts[3]));
+				add(compileAttrFilter(parts[4], parts[5], parts[6]));
+				add(compilePsuedoFilter(parts[7]));
+
+				// Mark the filter with psuedo for performance
+				filters.psuedo = !!parts[7];
+				filters.direct = direct;
+
+				return filters;
+			}
+
+			// Parser logic based on Sizzle by John Resig
+			function parseChunks(selector, selectors) {
+				var parts = [], extra, matches, i;
+
+				do {
+					chunker.exec("");
+					matches = chunker.exec(selector);
+
+					if (matches) {
+						selector = matches[3];
+						parts.push(matches[1]);
+
+						if (matches[2]) {
+							extra = matches[3];
+							break;
+						}
+					}
+				} while (matches);
+
+				if (extra) {
+					parseChunks(extra, selectors);
+				}
+
+				selector = [];
+				for (i = 0; i < parts.length; i++) {
+					if (parts[i] != '>') {
+						selector.push(compile(parts[i], [], parts[i - 1] === '>'));
+					}
+				}
+
+				selectors.push(selector);
+
+				return selectors;
+			}
+
+			this._selectors = parseChunks(selector, []);
+		},
+
+		/**
+		 * Returns true/false if the selector matches the specified control.
+		 *
+		 * @method match
+		 * @param {tinymce.ui.Control} control Control to match agains the selector.
+		 * @param {Array} selectors Optional array of selectors, mostly used internally.
+		 * @return {Boolean} true/false state if the control matches or not.
+		 */
+		match: function(control, selectors) {
+			var i, l, si, sl, selector, fi, fl, filters, index, length, siblings, count, item;
+
+			selectors = selectors || this._selectors;
+			for (i = 0, l = selectors.length; i < l; i++) {
+				selector = selectors[i];
+				sl = selector.length;
+				item = control;
+				count = 0;
+
+				for (si = sl - 1; si >= 0; si--) {
+					filters = selector[si];
+
+					while (item) {
+						// Find the index and length since a psuedo filter like :first needs it
+						if (filters.psuedo) {
+							siblings = item.parent().items();
+							index = length = siblings.length;
+							while (index--) {
+								if (siblings[index] === item) {
+									break;
+								}
+							}
+						}
+
+						for (fi = 0, fl = filters.length; fi < fl; fi++) {
+							if (!filters[fi](item, index, length)) {
+								fi = fl + 1;
+								break;
+							}
+						}
+
+						if (fi === fl) {
+							count++;
+							break;
+						} else {
+							// If it didn't match the right most expression then
+							// break since it's no point looking at the parents
+							if (si === sl - 1) {
+								break;
+							}
+						}
+
+						item = item.parent();
+					}
+				}
+
+				// If we found all selectors then return true otherwise continue looking
+				if (count === sl) {
+					return true;
+				}
+			}
+
+			return false;
+		},
+
+		/**
+		 * Returns a tinymce.ui.Collection with matches of the specified selector inside the specified container.
+		 *
+		 * @method find
+		 * @param {tinymce.ui.Control} container Container to look for items in.
+		 * @return {tinymce.ui.Collection} Collection with matched elements.
+		 */
+		find: function(container) {
+			var matches = [], i, l, selectors = this._selectors;
+
+			function collect(items, selector, index) {
+				var i, l, fi, fl, item, filters = selector[index];
+
+				for (i = 0, l = items.length; i < l; i++) {
+					item = items[i];
+
+					// Run each filter agains the item
+					for (fi = 0, fl = filters.length; fi < fl; fi++) {
+						if (!filters[fi](item, i, l)) {
+							fi = fl + 1;
+							break;
+						}
+					}
+
+					// All filters matched the item
+					if (fi === fl) {
+						// Matched item is on the last expression like: panel toolbar [button]
+						if (index == selector.length - 1) {
+							matches.push(item);
+						} else {
+							// Collect next expression type
+							if (item.items) {
+								collect(item.items(), selector, index + 1);
+							}
+						}
+					} else if (filters.direct) {
+						return;
+					}
+
+					// Collect child items
+					if (item.items) {
+						collect(item.items(), selector, index);
+					}
+				}
+			}
+
+			if (container.items) {
+				for (i = 0, l = selectors.length; i < l; i++) {
+					collect(container.items(), selectors[i], 0);
+				}
+
+				// Unique the matches if needed
+				if (l > 1) {
+					matches = unique(matches);
+				}
+			}
+
+			// Fix for circular reference
+			if (!Collection) {
+				// TODO: Fix me!
+				Collection = Selector.Collection;
+			}
+
+			return new Collection(matches);
+		}
+	});
+
+	return Selector;
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Spacer.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,39 @@
+/**
+ * Spacer.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a spacer. This control is used in flex layouts for example.
+ *
+ * @-x-less Spacer.less
+ * @class tinymce.ui.Spacer
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/Spacer", [
+	"tinymce/ui/Widget"
+], function(Widget) {
+	"use strict";
+
+	return Widget.extend({
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this;
+
+			self.addClass('spacer');
+			self.canFocus = false;
+
+			return '<div id="' + self._id + '" class="' + self.classes() + '"></div>';
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/SplitButton.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,135 @@
+/**
+ * SplitButton.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a split button.
+ *
+ * @-x-less SplitButton.less
+ * @class tinymce.ui.SplitButton
+ * @extends tinymce.ui.MenuButton
+ */
+define("tinymce/ui/SplitButton", [
+	"tinymce/ui/MenuButton",
+	"tinymce/ui/DomUtils"
+], function(MenuButton, DomUtils) {
+	return MenuButton.extend({
+		Defaults: {
+			classes: "widget btn splitbtn",
+			role: "button"
+		},
+
+		/**
+		 * Repaints the control after a layout operation.
+		 *
+		 * @method repaint
+		 */
+		repaint: function() {
+			var self = this, elm = self.getEl(), rect = self.layoutRect(), mainButtonElm, menuButtonElm;
+
+			self._super();
+
+			mainButtonElm = elm.firstChild;
+			menuButtonElm = elm.lastChild;
+
+			DomUtils.css(mainButtonElm, {
+				width: rect.w - DomUtils.getSize(menuButtonElm).width,
+				height: rect.h - 2
+			});
+
+			DomUtils.css(menuButtonElm, {
+				height: rect.h - 2
+			});
+
+			return self;
+		},
+
+		/**
+		 * Sets the active menu state.
+		 *
+		 * @private
+		 */
+		activeMenu: function(state) {
+			var self = this;
+
+			DomUtils.toggleClass(self.getEl().lastChild, self.classPrefix + 'active', state);
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, id = self._id, prefix = self.classPrefix, image;
+			var icon = self.settings.icon;
+
+			image = self.settings.image;
+			if (image) {
+				icon = 'none';
+
+				// Support for [high dpi, low dpi] image sources
+				if (typeof image != "string") {
+					image = window.getSelection ? image[0] : image[1];
+				}
+
+				image = ' style="background-image: url(\'' + image + '\')"';
+			} else {
+				image = '';
+			}
+
+			icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
+
+			return (
+				'<div id="' + id + '" class="' + self.classes() + '" role="button" tabindex="-1">' +
+					'<button type="button" hidefocus="1" tabindex="-1">' +
+						(icon ? '<i class="' + icon + '"' + image + '></i>' : '') +
+						(self._text ? (icon ? ' ' : '') + self._text : '') +
+					'</button>' +
+					'<button type="button" class="' + prefix + 'open" hidefocus="1" tabindex="-1">' +
+						//(icon ? '<i class="' + icon + '"></i>' : '') +
+						(self._menuBtnText ? (icon ? '\u00a0' : '') + self._menuBtnText : '') +
+						' <i class="' + prefix + 'caret"></i>' +
+					'</button>' +
+				'</div>'
+			);
+		},
+
+		/**
+		 * Called after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this, onClickHandler = self.settings.onclick;
+
+			self.on('click', function(e) {
+				var node = e.target;
+
+				if (e.control == this) {
+					// Find clicks that is on the main button
+					while (node) {
+						if ((e.aria && e.aria.key != 'down') || (node.nodeName == 'BUTTON' && node.className.indexOf('open') == -1)) {
+							e.stopImmediatePropagation();
+							onClickHandler.call(this, e);
+							return;
+						}
+
+						node = node.parentNode;
+					}
+				}
+			});
+
+			delete self.settings.onclick;
+
+			return self._super();
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/StackLayout.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,30 @@
+/**
+ * StackLayout.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This layout uses the browsers layout when the items are blocks.
+ *
+ * @-x-less StackLayout.less
+ * @class tinymce.ui.StackLayout
+ * @extends tinymce.ui.FlowLayout
+ */
+define("tinymce/ui/StackLayout", [
+	"tinymce/ui/FlowLayout"
+], function(FlowLayout) {
+	"use strict";
+
+	return FlowLayout.extend({
+		Defaults: {
+			containerClass: 'stack-layout',
+			controlClass: 'stack-layout-item',
+			endClass: 'break'
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/TabPanel.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,177 @@
+/**
+ * TabPanel.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a tab panel control.
+ *
+ * @-x-less TabPanel.less
+ * @class tinymce.ui.TabPanel
+ * @extends tinymce.ui.Panel
+ *
+ * @setting {Number} activeTab Active tab index.
+ */
+define("tinymce/ui/TabPanel", [
+	"tinymce/ui/Panel",
+	"tinymce/ui/DomUtils"
+], function(Panel, DomUtils) {
+	"use strict";
+
+	return Panel.extend({
+		Defaults: {
+			layout: 'absolute',
+			defaults: {
+				type: 'panel'
+			}
+		},
+
+		/**
+		 * Activates the specified tab by index.
+		 *
+		 * @method activateTab
+		 * @param {Number} idx Index of the tab to activate.
+		 */
+		activateTab: function(idx) {
+			var activeTabElm;
+
+			if (this.activeTabId) {
+				activeTabElm = this.getEl(this.activeTabId);
+				DomUtils.removeClass(activeTabElm, this.classPrefix + 'active');
+				activeTabElm.setAttribute('aria-selected', "false");
+			}
+
+			this.activeTabId = 't' + idx;
+
+			activeTabElm = this.getEl('t' + idx);
+			activeTabElm.setAttribute('aria-selected', "true");
+			DomUtils.addClass(activeTabElm, this.classPrefix + 'active');
+
+			this.items()[idx].show().fire('showtab');
+			this.reflow();
+
+			this.items().each(function(item, i) {
+				if (idx != i) {
+					item.hide();
+				}
+			});
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, layout = self._layout, tabsHtml = '', prefix = self.classPrefix;
+
+			self.preRender();
+			layout.preRender(self);
+
+			self.items().each(function(ctrl, i) {
+				var id = self._id + '-t' + i;
+
+				ctrl.aria('role', 'tabpanel');
+				ctrl.aria('labelledby', id);
+
+				tabsHtml += (
+					'<div id="' + id + '" class="' + prefix + 'tab" ' +
+						'unselectable="on" role="tab" aria-controls="' + ctrl._id + '" aria-selected="false" tabIndex="-1">' +
+						self.encode(ctrl.settings.title) +
+					'</div>'
+				);
+			});
+
+			return (
+				'<div id="' + self._id + '" class="' + self.classes() + '" hidefocus="1" tabindex="-1">' +
+					'<div id="' + self._id + '-head" class="' + prefix + 'tabs" role="tablist">' +
+						tabsHtml +
+					'</div>' +
+					'<div id="' + self._id + '-body" class="' + self.classes('body') + '">' +
+						layout.renderHtml(self) +
+					'</div>' +
+				'</div>'
+			);
+		},
+
+		/**
+		 * Called after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this;
+
+			self._super();
+
+			self.settings.activeTab = self.settings.activeTab || 0;
+			self.activateTab(self.settings.activeTab);
+
+			this.on('click', function(e) {
+				var targetParent = e.target.parentNode;
+
+				if (e.target.parentNode.id == self._id + '-head') {
+					var i = targetParent.childNodes.length;
+
+					while (i--) {
+						if (targetParent.childNodes[i] == e.target) {
+							self.activateTab(i);
+						}
+					}
+				}
+			});
+		},
+
+		/**
+		 * Initializes the current controls layout rect.
+		 * This will be executed by the layout managers to determine the
+		 * default minWidth/minHeight etc.
+		 *
+		 * @method initLayoutRect
+		 * @return {Object} Layout rect instance.
+		 */
+		initLayoutRect: function() {
+			var self = this, rect, minW, minH;
+
+			minW = DomUtils.getSize(self.getEl('head')).width;
+			minW = minW < 0 ? 0 : minW;
+			minH = 0;
+
+			self.items().each(function(item) {
+				minW = Math.max(minW, item.layoutRect().minW);
+				minH = Math.max(minH, item.layoutRect().minH);
+			});
+
+			self.items().each(function(ctrl) {
+				ctrl.settings.x = 0;
+				ctrl.settings.y = 0;
+				ctrl.settings.w = minW;
+				ctrl.settings.h = minH;
+
+				ctrl.layoutRect({
+					x: 0,
+					y: 0,
+					w: minW,
+					h: minH
+				});
+			});
+
+			var headH = DomUtils.getSize(self.getEl('head')).height;
+
+			self.settings.minWidth = minW;
+			self.settings.minHeight = minH + headH;
+
+			rect = self._super();
+			rect.deltaH += headH;
+			rect.innerH = rect.h - rect.deltaH;
+
+			return rect;
+		}
+	});
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/TextBox.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,214 @@
+/**
+ * TextBox.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new textbox.
+ *
+ * @-x-less TextBox.less
+ * @class tinymce.ui.TextBox
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/TextBox", [
+	"tinymce/ui/Widget",
+	"tinymce/ui/DomUtils"
+], function(Widget, DomUtils) {
+	"use strict";
+
+	return Widget.extend({
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {Boolean} multiline True if the textbox is a multiline control.
+		 * @setting {Number} maxLength Max length for the textbox.
+		 * @setting {Number} size Size of the textbox in characters.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self._super(settings);
+
+			self._value = settings.value || '';
+			self.addClass('textbox');
+
+			if (settings.multiline) {
+				self.addClass('multiline');
+			} else {
+				// TODO: Rework this
+				self.on('keydown', function(e) {
+					if (e.keyCode == 13) {
+						self.parents().reverse().each(function(ctrl) {
+							e.preventDefault();
+
+							if (ctrl.hasEventListeners('submit') && ctrl.toJSON) {
+								ctrl.fire('submit', {data: ctrl.toJSON()});
+								return false;
+							}
+						});
+					}
+				});
+			}
+		},
+
+		/**
+		 * Getter/setter function for the disabled state.
+		 *
+		 * @method value
+		 * @param {Boolean} [state] State to be set.
+		 * @return {Boolean|tinymce.ui.ComboBox} True/false or self if it's a set operation.
+		 */
+		disabled: function(state) {
+			var self = this;
+
+			if (self._rendered && typeof state != 'undefined') {
+				self.getEl().disabled = state;
+			}
+
+			return self._super(state);
+		},
+
+		/**
+		 * Getter/setter function for the control value.
+		 *
+		 * @method value
+		 * @param {String} [value] Value to be set.
+		 * @return {String|tinymce.ui.ComboBox} Value or self if it's a set operation.
+		 */
+		value: function(value) {
+			var self = this;
+
+			if (typeof value != "undefined") {
+				self._value = value;
+
+				if (self._rendered) {
+					self.getEl().value = value;
+				}
+
+				return self;
+			}
+
+			if (self._rendered) {
+				return self.getEl().value;
+			}
+
+			return self._value;
+		},
+
+		/**
+		 * Repaints the control after a layout operation.
+		 *
+		 * @method repaint
+		 */
+		repaint: function() {
+			var self = this, style, rect, borderBox, borderW = 0, borderH = 0, lastRepaintRect;
+
+			style = self.getEl().style;
+			rect = self._layoutRect;
+			lastRepaintRect = self._lastRepaintRect || {};
+
+			// Detect old IE 7+8 add lineHeight to align caret vertically in the middle
+			var doc = document;
+			if (!self.settings.multiline && doc.all && (!doc.documentMode || doc.documentMode <= 8)) {
+				style.lineHeight = (rect.h - borderH) + 'px';
+			}
+
+			borderBox = self._borderBox;
+			borderW = borderBox.left + borderBox.right + 8;
+			borderH = borderBox.top + borderBox.bottom + (self.settings.multiline ? 8 : 0);
+
+			if (rect.x !== lastRepaintRect.x) {
+				style.left = rect.x + 'px';
+				lastRepaintRect.x = rect.x;
+			}
+
+			if (rect.y !== lastRepaintRect.y) {
+				style.top = rect.y + 'px';
+				lastRepaintRect.y = rect.y;
+			}
+
+			if (rect.w !== lastRepaintRect.w) {
+				style.width = (rect.w - borderW) + 'px';
+				lastRepaintRect.w = rect.w;
+			}
+
+			if (rect.h !== lastRepaintRect.h) {
+				style.height = (rect.h - borderH) + 'px';
+				lastRepaintRect.h = rect.h;
+			}
+
+			self._lastRepaintRect = lastRepaintRect;
+			self.fire('repaint', {}, false);
+
+			return self;
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, id = self._id, settings = self.settings, value = self.encode(self._value, false), extraAttrs = '';
+
+			if ("spellcheck" in settings) {
+				extraAttrs += ' spellcheck="' + settings.spellcheck + '"';
+			}
+
+			if (settings.maxLength) {
+				extraAttrs += ' maxlength="' + settings.maxLength + '"';
+			}
+
+			if (settings.size) {
+				extraAttrs += ' size="' + settings.size + '"';
+			}
+
+			if (settings.subtype) {
+				extraAttrs += ' type="' + settings.subtype + '"';
+			}
+
+			if (self.disabled()) {
+				extraAttrs += ' disabled="disabled"';
+			}
+
+			if (settings.multiline) {
+				return (
+					'<textarea id="' + id + '" class="' + self.classes() + '" ' +
+					(settings.rows ? ' rows="' + settings.rows + '"' : '') +
+					' hidefocus="1"' + extraAttrs + '>' + value +
+					'</textarea>'
+				);
+			}
+
+			return '<input id="' + id + '" class="' + self.classes() + '" value="' + value + '" hidefocus="1"' + extraAttrs + ' />';
+		},
+
+		/**
+		 * Called after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this;
+
+			DomUtils.on(self.getEl(), 'change', function(e) {
+				self.fire('change', e);
+			});
+
+			return self._super();
+		},
+
+		remove: function() {
+			DomUtils.off(this.getEl());
+			this._super();
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Throbber.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,74 @@
+/**
+ * Throbber.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class enables you to display a Throbber for any element.
+ *
+ * @-x-less Throbber.less
+ * @class tinymce.ui.Throbber
+ */
+define("tinymce/ui/Throbber", [
+	"tinymce/ui/DomUtils",
+	"tinymce/ui/Control"
+], function(DomUtils, Control) {
+	"use strict";
+
+	/**
+	 * Constructs a new throbber.
+	 *
+	 * @constructor
+	 * @param {Element} elm DOM Html element to display throbber in.
+	 * @param {Boolean} inline Optional true/false state if the throbber should be appended to end of element for infinite scroll.
+	 */
+	return function(elm, inline) {
+		var self = this, state, classPrefix = Control.classPrefix;
+
+		/**
+		 * Shows the throbber.
+		 *
+		 * @method show
+		 * @param {Number} [time] Time to wait before showing.
+		 * @return {tinymce.ui.Throbber} Current throbber instance.
+		 */
+		self.show = function(time) {
+			self.hide();
+
+			state = true;
+
+			window.setTimeout(function() {
+				if (state) {
+					elm.appendChild(DomUtils.createFragment(
+						'<div class="' + classPrefix + 'throbber' + (inline ? ' ' + classPrefix + 'throbber-inline' : '') + '"></div>'
+					));
+				}
+			}, time || 0);
+
+			return self;
+		};
+
+		/**
+		 * Hides the throbber.
+		 *
+		 * @method hide
+		 * @return {tinymce.ui.Throbber} Current throbber instance.
+		 */
+		self.hide = function() {
+			var child = elm.lastChild;
+
+			if (child && child.className.indexOf('throbber') != -1) {
+				child.parentNode.removeChild(child);
+			}
+
+			state = false;
+
+			return self;
+		};
+	};
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Toolbar.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,54 @@
+/**
+ * Toolbar.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new toolbar.
+ *
+ * @class tinymce.ui.Toolbar
+ * @extends tinymce.ui.Container
+ */
+define("tinymce/ui/Toolbar", [
+	"tinymce/ui/Container"
+], function(Container) {
+	"use strict";
+
+	return Container.extend({
+		Defaults: {
+			role: 'toolbar',
+			layout: 'flow'
+		},
+
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self._super(settings);
+			self.addClass('toolbar');
+		},
+
+		/**
+		 * Called after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this;
+
+			self.items().addClass('toolbar-item');
+
+			return self._super();
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Tooltip.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,86 @@
+/**
+ * Tooltip.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a tooltip instance.
+ *
+ * @-x-less ToolTip.less
+ * @class tinymce.ui.ToolTip
+ * @extends tinymce.ui.Control
+ * @mixes tinymce.ui.Movable
+ */
+define("tinymce/ui/Tooltip", [
+	"tinymce/ui/Control",
+	"tinymce/ui/Movable"
+], function(Control, Movable) {
+	return Control.extend({
+		Mixins: [Movable],
+
+		Defaults: {
+			classes: 'widget tooltip tooltip-n'
+		},
+
+		/**
+		 * Sets/gets the current label text.
+		 *
+		 * @method text
+		 * @param {String} [text] New label text.
+		 * @return {String|tinymce.ui.Tooltip} Current text or current label instance.
+		 */
+		text: function(value) {
+			var self = this;
+
+			if (typeof value != "undefined") {
+				self._value = value;
+
+				if (self._rendered) {
+					self.getEl().lastChild.innerHTML = self.encode(value);
+				}
+
+				return self;
+			}
+
+			return self._value;
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, prefix = self.classPrefix;
+
+			return (
+				'<div id="' + self._id + '" class="' + self.classes() + '" role="presentation">' +
+					'<div class="' + prefix + 'tooltip-arrow"></div>' +
+					'<div class="' + prefix + 'tooltip-inner">' + self.encode(self._text) + '</div>' +
+				'</div>'
+			);
+		},
+
+		/**
+		 * Repaints the control after a layout operation.
+		 *
+		 * @method repaint
+		 */
+		repaint: function() {
+			var self = this, style, rect;
+
+			style = self.getEl().style;
+			rect = self._layoutRect;
+
+			style.left = rect.x + 'px';
+			style.top = rect.y + 'px';
+			style.zIndex = 0xFFFF + 0xFFFF;
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Widget.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,157 @@
+/**
+ * Widget.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Widget base class a widget is a control that has a tooltip and some basic states.
+ *
+ * @class tinymce.ui.Widget
+ * @extends tinymce.ui.Control
+ */
+define("tinymce/ui/Widget", [
+	"tinymce/ui/Control",
+	"tinymce/ui/Tooltip"
+], function(Control, Tooltip) {
+	"use strict";
+
+	var tooltip;
+
+	var Widget = Control.extend({
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {String} tooltip Tooltip text to display when hovering.
+		 * @setting {Boolean} autofocus True if the control should be focused when rendered.
+		 * @setting {String} text Text to display inside widget.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self._super(settings);
+			settings = self.settings;
+			self.canFocus = true;
+
+			if (settings.tooltip && Widget.tooltips !== false) {
+				self.on('mouseenter', function(e) {
+					var tooltip = self.tooltip().moveTo(-0xFFFF);
+
+					if (e.control == self) {
+						var rel = tooltip.text(settings.tooltip).show().testMoveRel(self.getEl(), ['bc-tc', 'bc-tl', 'bc-tr']);
+
+						tooltip.toggleClass('tooltip-n', rel == 'bc-tc');
+						tooltip.toggleClass('tooltip-nw', rel == 'bc-tl');
+						tooltip.toggleClass('tooltip-ne', rel == 'bc-tr');
+
+						tooltip.moveRel(self.getEl(), rel);
+					} else {
+						tooltip.hide();
+					}
+				});
+
+				self.on('mouseleave mousedown click', function() {
+					self.tooltip().hide();
+				});
+			}
+
+			self.aria('label', settings.ariaLabel || settings.tooltip);
+		},
+
+		/**
+		 * Returns the current tooltip instance.
+		 *
+		 * @method tooltip
+		 * @return {tinymce.ui.Tooltip} Tooltip instance.
+		 */
+		tooltip: function() {
+			if (!tooltip) {
+				tooltip = new Tooltip({type: 'tooltip'});
+				tooltip.renderTo();
+			}
+
+			return tooltip;
+		},
+
+		/**
+		 * Sets/gets the active state of the widget.
+		 *
+		 * @method active
+		 * @param {Boolean} [state] State if the control is active.
+		 * @return {Boolean|tinymce.ui.Widget} True/false or current widget instance.
+		 */
+		active: function(state) {
+			var self = this, undef;
+
+			if (state !== undef) {
+				self.aria('pressed', state);
+				self.toggleClass('active', state);
+			}
+
+			return self._super(state);
+		},
+
+		/**
+		 * Sets/gets the disabled state of the widget.
+		 *
+		 * @method disabled
+		 * @param {Boolean} [state] State if the control is disabled.
+		 * @return {Boolean|tinymce.ui.Widget} True/false or current widget instance.
+		 */
+		disabled: function(state) {
+			var self = this, undef;
+
+			if (state !== undef) {
+				self.aria('disabled', state);
+				self.toggleClass('disabled', state);
+			}
+
+			return self._super(state);
+		},
+
+		/**
+		 * Called after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this, settings = self.settings;
+
+			self._rendered = true;
+
+			self._super();
+
+			if (!self.parent() && (settings.width || settings.height)) {
+				self.initLayoutRect();
+				self.repaint();
+			}
+
+			if (settings.autofocus) {
+				self.focus();
+			}
+		},
+
+		/**
+		 * Removes the current control from DOM and from UI collections.
+		 *
+		 * @method remove
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		remove: function() {
+			this._super();
+
+			if (tooltip) {
+				tooltip.remove();
+				tooltip = null;
+			}
+		}
+	});
+
+	return Widget;
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Window.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,384 @@
+/**
+ * Window.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new window.
+ *
+ * @-x-less Window.less
+ * @class tinymce.ui.Window
+ * @extends tinymce.ui.FloatPanel
+ */
+define("tinymce/ui/Window", [
+	"tinymce/ui/FloatPanel",
+	"tinymce/ui/Panel",
+	"tinymce/ui/DomUtils",
+	"tinymce/ui/DragHelper"
+], function(FloatPanel, Panel, DomUtils, DragHelper) {
+	"use strict";
+
+	var Window = FloatPanel.extend({
+		modal: true,
+
+		Defaults: {
+			border: 1,
+			layout: 'flex',
+			containerCls: 'panel',
+			role: 'dialog',
+			callbacks: {
+				submit: function() {
+					this.fire('submit', {data: this.toJSON()});
+				},
+
+				close: function() {
+					this.close();
+				}
+			}
+		},
+
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self._super(settings);
+
+			if (self.isRtl()) {
+				self.addClass('rtl');
+			}
+
+			self.addClass('window');
+			self._fixed = true;
+
+			// Create statusbar
+			if (settings.buttons) {
+				self.statusbar = new Panel({
+					layout: 'flex',
+					border: '1 0 0 0',
+					spacing: 3,
+					padding: 10,
+					align: 'center',
+					pack: self.isRtl() ? 'start' : 'end',
+					defaults: {
+						type: 'button'
+					},
+					items: settings.buttons
+				});
+
+				self.statusbar.addClass('foot');
+				self.statusbar.parent(self);
+			}
+
+			self.on('click', function(e) {
+				if (e.target.className.indexOf(self.classPrefix + 'close') != -1) {
+					self.close();
+				}
+			});
+
+			self.on('cancel', function() {
+				self.close();
+			});
+
+			self.aria('describedby', self.describedBy || self._id + '-none');
+			self.aria('label', settings.title);
+			self._fullscreen = false;
+		},
+
+		/**
+		 * Recalculates the positions of the controls in the current container.
+		 * This is invoked by the reflow method and shouldn't be called directly.
+		 *
+		 * @method recalc
+		 */
+		recalc: function() {
+			var self = this, statusbar = self.statusbar, layoutRect, width, x, needsRecalc;
+
+			if (self._fullscreen) {
+				self.layoutRect(DomUtils.getWindowSize());
+				self.layoutRect().contentH = self.layoutRect().innerH;
+			}
+
+			self._super();
+
+			layoutRect = self.layoutRect();
+
+			// Resize window based on title width
+			if (self.settings.title && !self._fullscreen) {
+				width = layoutRect.headerW;
+				if (width > layoutRect.w) {
+					x = layoutRect.x - Math.max(0, width / 2);
+					self.layoutRect({w: width, x: x});
+					needsRecalc = true;
+				}
+			}
+
+			// Resize window based on statusbar width
+			if (statusbar) {
+				statusbar.layoutRect({w: self.layoutRect().innerW}).recalc();
+
+				width = statusbar.layoutRect().minW + layoutRect.deltaW;
+				if (width > layoutRect.w) {
+					x = layoutRect.x - Math.max(0, width - layoutRect.w);
+					self.layoutRect({w: width, x: x});
+					needsRecalc = true;
+				}
+			}
+
+			// Recalc body and disable auto resize
+			if (needsRecalc) {
+				self.recalc();
+			}
+		},
+
+		/**
+		 * Initializes the current controls layout rect.
+		 * This will be executed by the layout managers to determine the
+		 * default minWidth/minHeight etc.
+		 *
+		 * @method initLayoutRect
+		 * @return {Object} Layout rect instance.
+		 */
+		initLayoutRect: function() {
+			var self = this, layoutRect = self._super(), deltaH = 0, headEl;
+
+			// Reserve vertical space for title
+			if (self.settings.title && !self._fullscreen) {
+				headEl = self.getEl('head');
+
+				var size = DomUtils.getSize(headEl);
+
+				layoutRect.headerW = size.width;
+				layoutRect.headerH = size.height;
+
+				deltaH += layoutRect.headerH;
+			}
+
+			// Reserve vertical space for statusbar
+			if (self.statusbar) {
+				deltaH += self.statusbar.layoutRect().h;
+			}
+
+			layoutRect.deltaH += deltaH;
+			layoutRect.minH += deltaH;
+			//layoutRect.innerH -= deltaH;
+			layoutRect.h += deltaH;
+
+			var rect = DomUtils.getWindowSize();
+
+			layoutRect.x = Math.max(0, rect.w / 2 - layoutRect.w / 2);
+			layoutRect.y = Math.max(0, rect.h / 2 - layoutRect.h / 2);
+
+			return layoutRect;
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, layout = self._layout, id = self._id, prefix = self.classPrefix;
+			var settings = self.settings, headerHtml = '', footerHtml = '', html = settings.html;
+
+			self.preRender();
+			layout.preRender(self);
+
+			if (settings.title) {
+				headerHtml = (
+					'<div id="' + id + '-head" class="' + prefix + 'window-head">' +
+						'<div id="' + id + '-title" class="' + prefix + 'title">' + self.encode(settings.title) + '</div>' +
+						'<button type="button" class="' + prefix + 'close" aria-hidden="true">\u00d7</button>' +
+						'<div id="' + id + '-dragh" class="' + prefix + 'dragh"></div>' +
+					'</div>'
+				);
+			}
+
+			if (settings.url) {
+				html = '<iframe src="' + settings.url + '" tabindex="-1"></iframe>';
+			}
+
+			if (typeof html == "undefined") {
+				html = layout.renderHtml(self);
+			}
+
+			if (self.statusbar) {
+				footerHtml = self.statusbar.renderHtml();
+			}
+
+			return (
+				'<div id="' + id + '" class="' + self.classes() + '" hidefocus="1">' +
+					'<div class="' + self.classPrefix + 'reset" role="application">' +
+						headerHtml +
+						'<div id="' + id + '-body" class="' + self.classes('body') + '">' +
+							html +
+						'</div>' +
+						footerHtml +
+					'</div>' +
+				'</div>'
+			);
+		},
+
+		/**
+		 * Switches the window fullscreen mode.
+		 *
+		 * @method fullscreen
+		 * @param {Boolean} state True/false state.
+		 * @return {tinymce.ui.Window} Current window instance.
+		 */
+		fullscreen: function(state) {
+			var self = this, documentElement = document.documentElement, slowRendering, prefix = self.classPrefix, layoutRect;
+
+			if (state != self._fullscreen) {
+				DomUtils.on(window, 'resize', function() {
+					var time;
+
+					if (self._fullscreen) {
+						// Time the layout time if it's to slow use a timeout to not hog the CPU
+						if (!slowRendering) {
+							time = new Date().getTime();
+
+							var rect = DomUtils.getWindowSize();
+							self.moveTo(0, 0).resizeTo(rect.w, rect.h);
+
+							if ((new Date().getTime()) - time > 50) {
+								slowRendering = true;
+							}
+						} else {
+							if (!self._timer) {
+								self._timer = setTimeout(function() {
+									var rect = DomUtils.getWindowSize();
+									self.moveTo(0, 0).resizeTo(rect.w, rect.h);
+
+									self._timer = 0;
+								}, 50);
+							}
+						}
+					}
+				});
+
+				layoutRect = self.layoutRect();
+				self._fullscreen = state;
+
+				if (!state) {
+					self._borderBox = self.parseBox(self.settings.border);
+					self.getEl('head').style.display = '';
+					layoutRect.deltaH += layoutRect.headerH;
+					DomUtils.removeClass(documentElement, prefix + 'fullscreen');
+					DomUtils.removeClass(document.body, prefix + 'fullscreen');
+					self.removeClass('fullscreen');
+					self.moveTo(self._initial.x, self._initial.y).resizeTo(self._initial.w, self._initial.h);
+				} else {
+					self._initial = {x: layoutRect.x, y: layoutRect.y, w: layoutRect.w, h: layoutRect.h};
+
+					self._borderBox = self.parseBox('0');
+					self.getEl('head').style.display = 'none';
+					layoutRect.deltaH -= layoutRect.headerH + 2;
+					DomUtils.addClass(documentElement, prefix + 'fullscreen');
+					DomUtils.addClass(document.body, prefix + 'fullscreen');
+					self.addClass('fullscreen');
+
+					var rect = DomUtils.getWindowSize();
+					self.moveTo(0, 0).resizeTo(rect.w, rect.h);
+				}
+			}
+
+			return self.reflow();
+		},
+
+		/**
+		 * Called after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this, startPos;
+
+			setTimeout(function() {
+				self.addClass('in');
+			}, 0);
+
+			self._super();
+
+			if (self.statusbar) {
+				self.statusbar.postRender();
+			}
+
+			self.focus();
+
+			this.dragHelper = new DragHelper(self._id + '-dragh', {
+				start: function() {
+					startPos = {
+						x: self.layoutRect().x,
+						y: self.layoutRect().y
+					};
+				},
+
+				drag: function(e) {
+					self.moveTo(startPos.x + e.deltaX, startPos.y + e.deltaY);
+				}
+			});
+
+			self.on('submit', function(e) {
+				if (!e.isDefaultPrevented()) {
+					self.close();
+				}
+			});
+		},
+
+		/**
+		 * Fires a submit event with the serialized form.
+		 *
+		 * @method submit
+		 * @return {Object} Event arguments object.
+		 */
+		submit: function() {
+			return this.fire('submit', {data: this.toJSON()});
+		},
+
+		/**
+		 * Removes the current control from DOM and from UI collections.
+		 *
+		 * @method remove
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		remove: function() {
+			var self = this, prefix = self.classPrefix;
+
+			self.dragHelper.destroy();
+			self._super();
+
+			if (self.statusbar) {
+				this.statusbar.remove();
+			}
+
+			if (self._fullscreen) {
+				DomUtils.removeClass(document.documentElement, prefix + 'fullscreen');
+				DomUtils.removeClass(document.body, prefix + 'fullscreen');
+			}
+		},
+
+		/**
+		 * Returns the contentWindow object of the iframe if it exists.
+		 *
+		 * @method getContentWindow
+		 * @return {Window} window object or null.
+		 */
+		getContentWindow: function() {
+			var ifr = this.getEl().getElementsByTagName('iframe')[0];
+			return ifr ? ifr.contentWindow : null;
+		}
+	});
+
+	return Window;
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/Class.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,165 @@
+/**
+ * Class.js
+ *
+ * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved.
+ */
+
+/**
+ * This utilitiy class is used for easier inheritage.
+ *
+ * Features:
+ * * Exposed super functions: this._super();
+ * * Mixins
+ * * Dummy functions
+ * * Property functions: var value = object.value(); and object.value(newValue);
+ * * Static functions
+ * * Defaults settings
+ */
+define("tinymce/util/Class", [
+	"tinymce/util/Tools"
+], function(Tools) {
+	var each = Tools.each, extend = Tools.extend;
+
+	var extendClass, initializing;
+
+	function Class() {
+	}
+
+	// Provides classical inheritance, based on code made by John Resig
+	Class.extend = extendClass = function(prop) {
+		var self = this, _super = self.prototype, prototype, name, member;
+
+		// The dummy class constructor
+		function Class() {
+			var i, mixins, mixin, self = this;
+
+			// All construction is actually done in the init method
+			if (!initializing) {
+				// Run class constuctor
+				if (self.init) {
+					self.init.apply(self, arguments);
+				}
+
+				// Run mixin constructors
+				mixins = self.Mixins;
+				if (mixins) {
+					i = mixins.length;
+					while (i--) {
+						mixin = mixins[i];
+						if (mixin.init) {
+							mixin.init.apply(self, arguments);
+						}
+					}
+				}
+			}
+		}
+
+		// Dummy function, needs to be extended in order to provide functionality
+		function dummy() {
+			return this;
+		}
+
+		// Creates a overloaded method for the class
+		// this enables you to use this._super(); to call the super function
+		function createMethod(name, fn) {
+			return function() {
+				var self = this, tmp = self._super, ret;
+
+				self._super = _super[name];
+				ret = fn.apply(self, arguments);
+				self._super = tmp;
+
+				return ret;
+			};
+		}
+
+		// Instantiate a base class (but only create the instance,
+		// don't run the init constructor)
+		initializing = true;
+
+		/*eslint new-cap:0 */
+		prototype = new self();
+		initializing = false;
+
+		// Add mixins
+		if (prop.Mixins) {
+			each(prop.Mixins, function(mixin) {
+				mixin = mixin;
+
+				for (var name in mixin) {
+					if (name !== "init") {
+						prop[name] = mixin[name];
+					}
+				}
+			});
+
+			if (_super.Mixins) {
+				prop.Mixins = _super.Mixins.concat(prop.Mixins);
+			}
+		}
+
+		// Generate dummy methods
+		if (prop.Methods) {
+			each(prop.Methods.split(','), function(name) {
+				prop[name] = dummy;
+			});
+		}
+
+		// Generate property methods
+		if (prop.Properties) {
+			each(prop.Properties.split(','), function(name) {
+				var fieldName = '_' + name;
+
+				prop[name] = function(value) {
+					var self = this, undef;
+
+					// Set value
+					if (value !== undef) {
+						self[fieldName] = value;
+
+						return self;
+					}
+
+					// Get value
+					return self[fieldName];
+				};
+			});
+		}
+
+		// Static functions
+		if (prop.Statics) {
+			each(prop.Statics, function(func, name) {
+				Class[name] = func;
+			});
+		}
+
+		// Default settings
+		if (prop.Defaults && _super.Defaults) {
+			prop.Defaults = extend({}, _super.Defaults, prop.Defaults);
+		}
+
+		// Copy the properties over onto the new prototype
+		for (name in prop) {
+			member = prop[name];
+
+			if (typeof member == "function" && _super[name]) {
+				prototype[name] = createMethod(name, member);
+			} else {
+				prototype[name] = member;
+			}
+		}
+
+		// Populate our constructed prototype object
+		Class.prototype = prototype;
+
+		// Enforce the constructor to be what we expect
+		Class.constructor = Class;
+
+		// And make this class extendible
+		Class.extend = extendClass;
+
+		return Class;
+	};
+
+	return Class;
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/Color.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,235 @@
+/**
+ * Color.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class lets you parse/serialize colors and convert rgb/hsb.
+ *
+ * @class tinymce.util.Color
+ * @example
+ * var white = new tinymce.util.Color({r: 255, g: 255, b: 255});
+ * var red = new tinymce.util.Color('#FF0000');
+ *
+ * console.log(white.toHex(), red.toHsv());
+ */
+define("tinymce/util/Color", [], function() {
+	var min = Math.min, max = Math.max, round = Math.round;
+
+	/**
+	 * Constructs a new color instance.
+	 *
+	 * @constructor
+	 * @method Color
+	 * @param {String} value Optional initial value to parse.
+	 */
+	function Color(value) {
+		var self = this, r = 0, g = 0, b = 0;
+
+		function rgb2hsv(r, g, b) {
+			var h, s, v, d, minRGB, maxRGB;
+
+			h = 0;
+			s = 0;
+			v = 0;
+			r = r / 255;
+			g = g / 255;
+			b = b / 255;
+
+			minRGB = min(r, min(g, b));
+			maxRGB = max(r, max(g, b));
+
+			if (minRGB == maxRGB) {
+				v = minRGB;
+
+				return {
+					h: 0,
+					s: 0,
+					v: v * 100
+				};
+			}
+
+			/*eslint no-nested-ternary:0 */
+			d = (r == minRGB) ? g - b : ((b == minRGB) ? r - g : b - r);
+			h = (r == minRGB) ? 3 : ((b == minRGB) ? 1 : 5);
+			h = 60 * (h - d / (maxRGB - minRGB));
+			s = (maxRGB - minRGB) / maxRGB;
+			v = maxRGB;
+
+			return {
+				h: round(h),
+				s: round(s * 100),
+				v: round(v * 100)
+			};
+		}
+
+		function hsvToRgb(hue, saturation, brightness) {
+			var side, chroma, x, match;
+
+			hue = (parseInt(hue, 10) || 0) % 360;
+			saturation = parseInt(saturation, 10) / 100;
+			brightness = parseInt(brightness, 10) / 100;
+			saturation = max(0, min(saturation, 1));
+			brightness = max(0, min(brightness, 1));
+
+			if (saturation === 0) {
+				r = g = b = round(255 * brightness);
+				return;
+			}
+
+			side = hue / 60;
+			chroma = brightness * saturation;
+			x = chroma * (1 - Math.abs(side % 2 - 1));
+			match = brightness - chroma;
+
+			switch (Math.floor(side)) {
+				case 0:
+					r = chroma;
+					g = x;
+					b = 0;
+					break;
+
+				case 1:
+					r = x;
+					g = chroma;
+					b = 0;
+					break;
+
+				case 2:
+					r = 0;
+					g = chroma;
+					b = x;
+					break;
+
+				case 3:
+					r = 0;
+					g = x;
+					b = chroma;
+					break;
+
+				case 4:
+					r = x;
+					g = 0;
+					b = chroma;
+					break;
+
+				case 5:
+					r = chroma;
+					g = 0;
+					b = x;
+					break;
+
+				default:
+					r = g = b = 0;
+			}
+
+			r = round(255 * (r + match));
+			g = round(255 * (g + match));
+			b = round(255 * (b + match));
+		}
+
+		/**
+		 * Returns the hex string of the current color. For example: #ff00ff
+		 *
+		 * @method toHex
+		 * @return {String} Hex string of current color.
+		 */
+		function toHex() {
+			function hex(val) {
+				val = parseInt(val, 10).toString(16);
+
+				return val.length > 1 ? val : '0' + val;
+			}
+
+			return '#' + hex(r) + hex(g) + hex(b);
+		}
+
+		/**
+		 * Returns the r, g, b values of the color. Each channel has a range from 0-255.
+		 *
+		 * @method toRgb
+		 * @return {Object} Object with r, g, b fields.
+		 */
+		function toRgb() {
+			return {
+				r: r,
+				g: g,
+				b: b
+			};
+		}
+
+		/**
+		 * Returns the h, s, v values of the color. Ranges: h=0-360, s=0-100, v=0-100.
+		 *
+		 * @method toHsv
+		 * @return {Object} Object with h, s, v fields.
+		 */
+		function toHsv() {
+			return rgb2hsv(r, g, b);
+		}
+
+		/**
+		 * Parses the specified value and populates the color instance.
+		 *
+		 * Supported format examples:
+		 *  * rbg(255,0,0)
+		 *  * #ff0000
+		 *  * #fff
+		 *  * {r: 255, g: 0, b: 0}
+		 *  * {h: 360, s: 100, v: 100}
+		 *
+		 * @method parse
+		 * @param {Object/String} value Color value to parse.
+		 * @return {tinymce.util.Color} Current color instance.
+		 */
+		function parse(value) {
+			var matches;
+
+			if (typeof value == 'object') {
+				if ("r" in value) {
+					r = value.r;
+					g = value.g;
+					b = value.b;
+				} else if ("v" in value) {
+					hsvToRgb(value.h, value.s, value.v);
+				}
+			} else {
+				if ((matches = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(value))) {
+					r = parseInt(matches[1], 10);
+					g = parseInt(matches[2], 10);
+					b = parseInt(matches[3], 10);
+				} else if ((matches = /#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(value))) {
+					r = parseInt(matches[1], 16);
+					g = parseInt(matches[2], 16);
+					b = parseInt(matches[3], 16);
+				} else if ((matches = /#([0-F])([0-F])([0-F])/gi.exec(value))) {
+					r = parseInt(matches[1] + matches[1], 16);
+					g = parseInt(matches[2] + matches[2], 16);
+					b = parseInt(matches[3] + matches[3], 16);
+				}
+			}
+
+			r = r < 0 ? 0 : (r > 255 ? 255 : r);
+			g = g < 0 ? 0 : (g > 255 ? 255 : g);
+			b = b < 0 ? 0 : (b > 255 ? 255 : b);
+
+			return self;
+		}
+
+		if (value) {
+			parse(value);
+		}
+
+		self.toRgb = toRgb;
+		self.toHsv = toHsv;
+		self.toHex = toHex;
+		self.parse = parse;
+	}
+
+	return Color;
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/EventDispatcher.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,294 @@
+/**
+ * EventDispatcher.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class lets you add/remove and fire events by name on the specified scope. This makes
+ * it easy to add event listener logic to any class.
+ *
+ * @class tinymce.util.EventDispatcher
+ * @example
+ *  var eventDispatcher = new EventDispatcher();
+ *
+ *  eventDispatcher.on('click', function() {console.log('data');});
+ *  eventDispatcher.fire('click', {data: 123});
+ */
+define("tinymce/util/EventDispatcher", [
+	"tinymce/util/Tools"
+], function(Tools) {
+	var nativeEvents = Tools.makeMap(
+		"focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange " +
+		"mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover " +
+		"draggesture dragdrop drop drag submit " +
+		"compositionstart compositionend compositionupdate touchstart touchend",
+		' '
+	);
+
+	function Dispatcher(settings) {
+		var self = this, scope, bindings = {}, toggleEvent;
+
+		function returnFalse() {
+			return false;
+		}
+
+		function returnTrue() {
+			return true;
+		}
+
+		settings = settings || {};
+		scope = settings.scope || self;
+		toggleEvent = settings.toggleEvent || returnFalse;
+
+		/**
+		 * Fires the specified event by name.
+		 *
+		 * @method fire
+		 * @param {String} name Name of the event to fire.
+		 * @param {Object?} args Event arguments.
+		 * @return {Object} Event args instance passed in.
+		 * @example
+		 * instance.fire('event', {...});
+		 */
+		function fire(name, args) {
+			var handlers, i, l, callback;
+
+			name = name.toLowerCase();
+			args = args || {};
+			args.type = name;
+
+			// Setup target is there isn't one
+			if (!args.target) {
+				args.target = scope;
+			}
+
+			// Add event delegation methods if they are missing
+			if (!args.preventDefault) {
+				// Add preventDefault method
+				args.preventDefault = function() {
+					args.isDefaultPrevented = returnTrue;
+				};
+
+				// Add stopPropagation
+				args.stopPropagation = function() {
+					args.isPropagationStopped = returnTrue;
+				};
+
+				// Add stopImmediatePropagation
+				args.stopImmediatePropagation = function() {
+					args.isImmediatePropagationStopped = returnTrue;
+				};
+
+				// Add event delegation states
+				args.isDefaultPrevented = returnFalse;
+				args.isPropagationStopped = returnFalse;
+				args.isImmediatePropagationStopped = returnFalse;
+			}
+
+			if (settings.beforeFire) {
+				settings.beforeFire(args);
+			}
+
+			handlers = bindings[name];
+			if (handlers) {
+				for (i = 0, l = handlers.length; i < l; i++) {
+					callback = handlers[i];
+
+					// Unbind handlers marked with "once"
+					if (callback.once) {
+						off(name, callback.func);
+					}
+
+					// Stop immediate propagation if needed
+					if (args.isImmediatePropagationStopped()) {
+						args.stopPropagation();
+						return args;
+					}
+
+					// If callback returns false then prevent default and stop all propagation
+					if (callback.func.call(scope, args) === false) {
+						args.preventDefault();
+						return args;
+					}
+				}
+			}
+
+			return args;
+		}
+
+		/**
+		 * Binds an event listener to a specific event by name.
+		 *
+		 * @method on
+		 * @param {String} name Event name or space separated list of events to bind.
+		 * @param {callback} callback Callback to be executed when the event occurs.
+		 * @param {Boolean} first Optional flag if the event should be prepended. Use this with care.
+		 * @return {Object} Current class instance.
+		 * @example
+		 * instance.on('event', function(e) {
+		 *     // Callback logic
+		 * });
+		 */
+		function on(name, callback, prepend, extra) {
+			var handlers, names, i;
+
+			if (callback === false) {
+				callback = returnFalse;
+			}
+
+			if (callback) {
+				callback = {
+					func: callback
+				};
+
+				if (extra) {
+					Tools.extend(callback, extra);
+				}
+
+				names = name.toLowerCase().split(' ');
+				i = names.length;
+				while (i--) {
+					name = names[i];
+					handlers = bindings[name];
+					if (!handlers) {
+						handlers = bindings[name] = [];
+						toggleEvent(name, true);
+					}
+
+					if (prepend) {
+						handlers.unshift(callback);
+					} else {
+						handlers.push(callback);
+					}
+				}
+			}
+
+			return self;
+		}
+
+		/**
+		 * Unbinds an event listener to a specific event by name.
+		 *
+		 * @method off
+		 * @param {String?} name Name of the event to unbind.
+		 * @param {callback?} callback Callback to unbind.
+		 * @return {Object} Current class instance.
+		 * @example
+		 * // Unbind specific callback
+		 * instance.off('event', handler);
+		 *
+		 * // Unbind all listeners by name
+		 * instance.off('event');
+		 *
+		 * // Unbind all events
+		 * instance.off();
+		 */
+		function off(name, callback) {
+			var i, handlers, bindingName, names, hi;
+
+			if (name) {
+				names = name.toLowerCase().split(' ');
+				i = names.length;
+				while (i--) {
+					name = names[i];
+					handlers = bindings[name];
+
+					// Unbind all handlers
+					if (!name) {
+						for (bindingName in bindings) {
+							toggleEvent(bindingName, false);
+							delete bindings[bindingName];
+						}
+
+						return self;
+					}
+
+					if (handlers) {
+						// Unbind all by name
+						if (!callback) {
+							handlers.length = 0;
+						} else {
+							// Unbind specific ones
+							hi = handlers.length;
+							while (hi--) {
+								if (handlers[hi].func === callback) {
+									handlers = handlers.slice(0, hi).concat(handlers.slice(hi + 1));
+									bindings[name] = handlers;
+								}
+							}
+						}
+
+						if (!handlers.length) {
+							toggleEvent(name, false);
+							delete bindings[name];
+						}
+					}
+				}
+			} else {
+				for (name in bindings) {
+					toggleEvent(name, false);
+				}
+
+				bindings = {};
+			}
+
+			return self;
+		}
+
+		/**
+		 * Binds an event listener to a specific event by name
+		 * and automatically unbind the event once the callback fires.
+		 *
+		 * @method once
+		 * @param {String} name Event name or space separated list of events to bind.
+		 * @param {callback} callback Callback to be executed when the event occurs.
+		 * @param {Boolean} first Optional flag if the event should be prepended. Use this with care.
+		 * @return {Object} Current class instance.
+		 * @example
+		 * instance.once('event', function(e) {
+		 *     // Callback logic
+		 * });
+		 */
+		function once(name, callback, prepend) {
+			return on(name, callback, prepend, {once: true});
+		}
+
+		/**
+		 * Returns true/false if the dispatcher has a event of the specified name.
+		 *
+		 * @method has
+		 * @param {String} name Name of the event to check for.
+		 * @return {Boolean} true/false if the event exists or not.
+		 */
+		function has(name) {
+			name = name.toLowerCase();
+			return !(!bindings[name] || bindings[name].length === 0);
+		}
+
+		// Expose
+		self.fire = fire;
+		self.on = on;
+		self.off = off;
+		self.once = once;
+		self.has = has;
+	}
+
+	/**
+	 * Returns true/false if the specified event name is a native browser event or not.
+	 *
+	 * @method isNative
+	 * @param {String} name Name to check if it's native.
+	 * @return {Boolean} true/false if the event is native or not.
+	 * @static
+	 */
+	Dispatcher.isNative = function(name) {
+		return !!nativeEvents[name.toLowerCase()];
+	};
+
+	return Dispatcher;
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/I18n.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,115 @@
+/**
+ * I18n.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * I18n class that handles translation of TinyMCE UI.
+ * Uses po style with csharp style parameters.
+ *
+ * @class tinymce.util.I18n
+ */
+define("tinymce/util/I18n", [], function() {
+	"use strict";
+
+	var data = {}, code = "en";
+
+	return {
+		/**
+		 * Sets the current language code.
+		 *
+		 * @method setCode
+		 * @param {String} newCode Current language code.
+		 */
+		setCode: function(newCode) {
+			if (newCode) {
+				code = newCode;
+				this.rtl = this.data[newCode] ? this.data[newCode]._dir === 'rtl' : false;
+			}
+		},
+
+		/**
+		 * Returns the current language code.
+		 *
+		 * @return {String} Current language code.
+		 */
+		getCode: function() {
+			return code;
+		},
+
+		/**
+		 * Property gets set to true if a RTL language pack was loaded.
+		 *
+		 * @property rtl
+		 * @type Boolean
+		 */
+		rtl: false,
+
+		/**
+		 * Adds translations for a specific language code.
+		 *
+		 * @method add
+		 * @param {String} code Language code like sv_SE.
+		 * @param {Array} items Name/value array with English en_US to sv_SE.
+		 */
+		add: function(code, items) {
+			var langData = data[code];
+
+			if (!langData) {
+				data[code] = langData = {};
+			}
+
+			for (var name in items) {
+				langData[name] = items[name];
+			}
+
+			this.setCode(code);
+		},
+
+		/**
+		 * Translates the specified text.
+		 *
+		 * It has a few formats:
+		 * I18n.translate("Text");
+		 * I18n.translate(["Text {0}/{1}", 0, 1]);
+		 * I18n.translate({raw: "Raw string"});
+		 *
+		 * @method translate
+		 * @param {String/Object/Array} text Text to translate.
+		 * @return {String} String that got translated.
+		 */
+		translate: function(text) {
+			var langData;
+
+			langData = data[code];
+			if (!langData) {
+				langData = {};
+			}
+
+			if (typeof text == "undefined") {
+				return text;
+			}
+
+			if (typeof text != "string" && text.raw) {
+				return text.raw;
+			}
+
+			if (text.push) {
+				var values = text.slice(1);
+
+				text = (langData[text[0]] || text[0]).replace(/\{([0-9]+)\}/g, function(match1, match2) {
+					return values[match2];
+				});
+			}
+
+			return (langData[text] || text).replace(/{context:\w+}$/, '');
+		},
+
+		data: data
+	};
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/JSON.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,109 @@
+/**
+ * JSON.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * JSON parser and serializer class.
+ *
+ * @class tinymce.util.JSON
+ * @static
+ * @example
+ * // JSON parse a string into an object
+ * var obj = tinymce.util.JSON.parse(somestring);
+ *
+ * // JSON serialize a object into an string
+ * var str = tinymce.util.JSON.serialize(obj);
+ */
+define("tinymce/util/JSON", [], function() {
+	function serialize(o, quote) {
+		var i, v, t, name;
+
+		quote = quote || '"';
+
+		if (o === null) {
+			return 'null';
+		}
+
+		t = typeof o;
+
+		if (t == 'string') {
+			v = '\bb\tt\nn\ff\rr\""\'\'\\\\';
+
+			return quote + o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g, function(a, b) {
+				// Make sure single quotes never get encoded inside double quotes for JSON compatibility
+				if (quote === '"' && a === "'") {
+					return a;
+				}
+
+				i = v.indexOf(b);
+
+				if (i + 1) {
+					return '\\' + v.charAt(i + 1);
+				}
+
+				a = b.charCodeAt().toString(16);
+
+				return '\\u' + '0000'.substring(a.length) + a;
+			}) + quote;
+		}
+
+		if (t == 'object') {
+			if (o.hasOwnProperty && Object.prototype.toString.call(o) === '[object Array]') {
+				for (i = 0, v = '['; i < o.length; i++) {
+					v += (i > 0 ? ',' : '') + serialize(o[i], quote);
+				}
+
+				return v + ']';
+			}
+
+			v = '{';
+
+			for (name in o) {
+				if (o.hasOwnProperty(name)) {
+					v += typeof o[name] != 'function' ? (v.length > 1 ? ',' + quote : quote) + name +
+						quote + ':' + serialize(o[name], quote) : '';
+				}
+			}
+
+			return v + '}';
+		}
+
+		return '' + o;
+	}
+
+	return {
+		/**
+		 * Serializes the specified object as a JSON string.
+		 *
+		 * @method serialize
+		 * @param {Object} obj Object to serialize as a JSON string.
+		 * @param {String} quote Optional quote string defaults to ".
+		 * @return {string} JSON string serialized from input.
+		 */
+		serialize: serialize,
+
+		/**
+		 * Unserializes/parses the specified JSON string into a object.
+		 *
+		 * @method parse
+		 * @param {string} s JSON String to parse into a JavaScript object.
+		 * @return {Object} Object from input JSON string or undefined if it failed.
+		 */
+		parse: function(text) {
+			try {
+				// Trick uglify JS
+				return window[String.fromCharCode(101) + 'val']('(' + text + ')');
+			} catch (ex) {
+				// Ignore
+			}
+		}
+
+		/**#@-*/
+	};
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/JSONP.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,38 @@
+/**
+ * JSONP.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+define("tinymce/util/JSONP", [
+	"tinymce/dom/DOMUtils"
+], function(DOMUtils) {
+	return {
+		callbacks: {},
+		count: 0,
+
+		send: function(settings) {
+			var self = this, dom = DOMUtils.DOM, count = settings.count !== undefined ? settings.count : self.count;
+			var id = 'tinymce_jsonp_' + count;
+
+			self.callbacks[count] = function(json) {
+				dom.remove(id);
+				delete self.callbacks[count];
+
+				settings.callback(json);
+			};
+
+			dom.add(dom.doc.body, 'script', {
+				id: id,
+				src: settings.url,
+				type: 'text/javascript'
+			});
+
+			self.count++;
+		}
+	};
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/JSONRequest.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,110 @@
+/**
+ * JSONRequest.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class enables you to use JSON-RPC to call backend methods.
+ *
+ * @class tinymce.util.JSONRequest
+ * @example
+ * var json = new tinymce.util.JSONRequest({
+ *     url: 'somebackend.php'
+ * });
+ *
+ * // Send RPC call 1
+ * json.send({
+ *     method: 'someMethod1',
+ *     params: ['a', 'b'],
+ *     success: function(result) {
+ *         console.dir(result);
+ *     }
+ * });
+ *
+ * // Send RPC call 2
+ * json.send({
+ *     method: 'someMethod2',
+ *     params: ['a', 'b'],
+ *     success: function(result) {
+ *         console.dir(result);
+ *     }
+ * });
+ */
+define("tinymce/util/JSONRequest", [
+	"tinymce/util/JSON",
+	"tinymce/util/XHR",
+	"tinymce/util/Tools"
+], function(JSON, XHR, Tools) {
+	var extend = Tools.extend;
+
+	function JSONRequest(settings) {
+		this.settings = extend({}, settings);
+		this.count = 0;
+	}
+
+	/**
+	 * Simple helper function to send a JSON-RPC request without the need to initialize an object.
+	 * Consult the Wiki API documentation for more details on what you can pass to this function.
+	 *
+	 * @method sendRPC
+	 * @static
+	 * @param {Object} o Call object where there are three field id, method and params this object should also contain callbacks etc.
+	 */
+	JSONRequest.sendRPC = function(o) {
+		return new JSONRequest().send(o);
+	};
+
+	JSONRequest.prototype = {
+		/**
+		 * Sends a JSON-RPC call. Consult the Wiki API documentation for more details on what you can pass to this function.
+		 *
+		 * @method send
+		 * @param {Object} args Call object where there are three field id, method and params this object should also contain callbacks etc.
+		 */
+		send: function(args) {
+			var ecb = args.error, scb = args.success;
+
+			args = extend(this.settings, args);
+
+			args.success = function(c, x) {
+				c = JSON.parse(c);
+
+				if (typeof c == 'undefined') {
+					c = {
+						error: 'JSON Parse error.'
+					};
+				}
+
+				if (c.error) {
+					ecb.call(args.error_scope || args.scope, c.error, x);
+				} else {
+					scb.call(args.success_scope || args.scope, c.result);
+				}
+			};
+
+			args.error = function(ty, x) {
+				if (ecb) {
+					ecb.call(args.error_scope || args.scope, ty, x);
+				}
+			};
+
+			args.data = JSON.serialize({
+				id: args.id || 'c' + (this.count++),
+				method: args.method,
+				params: args.params
+			});
+
+			// JSON content type for Ruby on rails. Bug: #1883287
+			args.content_type = 'application/json';
+
+			XHR.send(args);
+		}
+	};
+
+	return JSONRequest;
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/LocalStorage.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,213 @@
+/**
+ * LocalStorage.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class will simulate LocalStorage on IE 7 and return the native version on modern browsers.
+ * Storage is done using userData on IE 7 and a special serialization format. The format is designed
+ * to be as small as possible by making sure that the keys and values doesn't need to be encoded. This
+ * makes it possible to store for example HTML data.
+ *
+ * Storage format for userData:
+ * <base 32 key length>,<key string>,<base 32 value length>,<value>,...
+ *
+ * For example this data key1=value1,key2=value2 would be:
+ * 4,key1,6,value1,4,key2,6,value2
+ *
+ * @class tinymce.util.LocalStorage
+ * @static
+ * @version 4.0
+ * @example
+ * tinymce.util.LocalStorage.setItem('key', 'value');
+ * var value = tinymce.util.LocalStorage.getItem('key');
+ */
+define("tinymce/util/LocalStorage", [], function() {
+	var LocalStorage, storageElm, items, keys, userDataKey, hasOldIEDataSupport;
+
+	// Check for native support
+	try {
+		if (window.localStorage) {
+			return localStorage;
+		}
+	} catch (ex) {
+		// Ignore
+	}
+
+	userDataKey = "tinymce";
+	storageElm = document.documentElement;
+	hasOldIEDataSupport = !!storageElm.addBehavior;
+
+	if (hasOldIEDataSupport) {
+		storageElm.addBehavior('#default#userData');
+	}
+
+	/**
+	 * Gets the keys names and updates LocalStorage.length property. Since IE7 doesn't have any getters/setters.
+	 */
+	function updateKeys() {
+		keys = [];
+
+		for (var key in items) {
+			keys.push(key);
+		}
+
+		LocalStorage.length = keys.length;
+	}
+
+	/**
+	 * Loads the userData string and parses it into the items structure.
+	 */
+	function load() {
+		var key, data, value, pos = 0;
+
+		items = {};
+
+		// localStorage can be disabled on WebKit/Gecko so make a dummy storage
+		if (!hasOldIEDataSupport) {
+			return;
+		}
+
+		function next(end) {
+			var value, nextPos;
+
+			nextPos = end !== undefined ? pos + end : data.indexOf(',', pos);
+			if (nextPos === -1 || nextPos > data.length) {
+				return null;
+			}
+
+			value = data.substring(pos, nextPos);
+			pos = nextPos + 1;
+
+			return value;
+		}
+
+		storageElm.load(userDataKey);
+		data = storageElm.getAttribute(userDataKey) || '';
+
+		do {
+			var offset = next();
+			if (offset === null) {
+				break;
+			}
+
+			key = next(parseInt(offset, 32) || 0);
+			if (key !== null) {
+				offset = next();
+				if (offset === null) {
+					break;
+				}
+
+				value = next(parseInt(offset, 32) || 0);
+
+				if (key) {
+					items[key] = value;
+				}
+			}
+		} while (key !== null);
+
+		updateKeys();
+	}
+
+	/**
+	 * Saves the items structure into a the userData format.
+	 */
+	function save() {
+		var value, data = '';
+
+		// localStorage can be disabled on WebKit/Gecko so make a dummy storage
+		if (!hasOldIEDataSupport) {
+			return;
+		}
+
+		for (var key in items) {
+			value = items[key];
+			data += (data ? ',' : '') + key.length.toString(32) + ',' + key + ',' + value.length.toString(32) + ',' + value;
+		}
+
+		storageElm.setAttribute(userDataKey, data);
+
+		try {
+			storageElm.save(userDataKey);
+		} catch (ex) {
+			// Ignore disk full
+		}
+
+		updateKeys();
+	}
+
+	LocalStorage = {
+		/**
+		 * Length of the number of items in storage.
+		 *
+		 * @property length
+		 * @type Number
+		 * @return {Number} Number of items in storage.
+		 */
+		//length:0,
+
+		/**
+		 * Returns the key name by index.
+		 *
+		 * @method key
+		 * @param {Number} index Index of key to return.
+		 * @return {String} Key value or null if it wasn't found.
+		 */
+		key: function(index) {
+			return keys[index];
+		},
+
+		/**
+		 * Returns the value if the specified key or null if it wasn't found.
+		 *
+		 * @method getItem
+		 * @param {String} key Key of item to retrive.
+		 * @return {String} Value of the specified item or null if it wasn't found.
+		 */
+		getItem: function(key) {
+			return key in items ? items[key] : null;
+		},
+
+		/**
+		 * Sets the value of the specified item by it's key.
+		 *
+		 * @method setItem
+		 * @param {String} key Key of the item to set.
+		 * @param {String} value Value of the item to set.
+		 */
+		setItem: function(key, value) {
+			items[key] = "" + value;
+			save();
+		},
+
+		/**
+		 * Removes the specified item by key.
+		 *
+		 * @method removeItem
+		 * @param {String} key Key of item to remove.
+		 */
+		removeItem: function(key) {
+			delete items[key];
+			save();
+		},
+
+		/**
+		 * Removes all items.
+		 *
+		 * @method clear
+		 */
+		clear: function() {
+			items = {};
+			save();
+		}
+	};
+
+	load();
+
+	return LocalStorage;
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/Observable.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,129 @@
+/**
+ * Observable.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This mixin will add event binding logic to classes.
+ *
+ * @mixin tinymce.util.Observable
+ */
+define("tinymce/util/Observable", [
+	"tinymce/util/EventDispatcher"
+], function(EventDispatcher) {
+	function getEventDispatcher(obj) {
+		if (!obj._eventDispatcher) {
+			obj._eventDispatcher = new EventDispatcher({
+				scope: obj,
+				toggleEvent: function(name, state) {
+					if (EventDispatcher.isNative(name) && obj.toggleNativeEvent) {
+						obj.toggleNativeEvent(name, state);
+					}
+				}
+			});
+		}
+
+		return obj._eventDispatcher;
+	}
+
+	return {
+		/**
+		 * Fires the specified event by name.
+		 *
+		 * @method fire
+		 * @param {String} name Name of the event to fire.
+		 * @param {Object?} args Event arguments.
+		 * @param {Boolean?} bubble True/false if the event is to be bubbled.
+		 * @return {Object} Event args instance passed in.
+		 * @example
+		 * instance.fire('event', {...});
+		 */
+		fire: function(name, args, bubble) {
+			var self = this;
+
+			// Prevent all events except the remove event after the instance has been removed
+			if (self.removed && name !== "remove") {
+				return args;
+			}
+
+			args = getEventDispatcher(self).fire(name, args, bubble);
+
+			// Bubble event up to parents
+			if (bubble !== false && self.parent) {
+				var parent = self.parent();
+				while (parent && !args.isPropagationStopped()) {
+					parent.fire(name, args, false);
+					parent = parent.parent();
+				}
+			}
+
+			return args;
+		},
+
+		/**
+		 * Binds an event listener to a specific event by name.
+		 *
+		 * @method on
+		 * @param {String} name Event name or space separated list of events to bind.
+		 * @param {callback} callback Callback to be executed when the event occurs.
+		 * @param {Boolean} first Optional flag if the event should be prepended. Use this with care.
+		 * @return {Object} Current class instance.
+		 * @example
+		 * instance.on('event', function(e) {
+		 *     // Callback logic
+		 * });
+		 */
+		on: function(name, callback, prepend) {
+			return getEventDispatcher(this).on(name, callback, prepend);
+		},
+
+		/**
+		 * Unbinds an event listener to a specific event by name.
+		 *
+		 * @method off
+		 * @param {String?} name Name of the event to unbind.
+		 * @param {callback?} callback Callback to unbind.
+		 * @return {Object} Current class instance.
+		 * @example
+		 * // Unbind specific callback
+		 * instance.off('event', handler);
+		 *
+		 * // Unbind all listeners by name
+		 * instance.off('event');
+		 *
+		 * // Unbind all events
+		 * instance.off();
+		 */
+		off: function(name, callback) {
+			return getEventDispatcher(this).off(name, callback);
+		},
+
+		/**
+		 * Bind the event callback and once it fires the callback is removed.
+		 *
+		 * @method once
+		 * @param {String} name Name of the event to bind.
+		 * @param {callback} callback Callback to bind only once.
+		 * @return {Object} Current class instance.
+		 */
+		once: function(name, callback) {
+			return getEventDispatcher(this).once(name, callback);
+		},
+
+		/**
+		 * Returns true/false if the object has a event of the specified name.
+		 *
+		 * @method hasEventListeners
+		 * @param {String} name Name of the event to check for.
+		 * @return {Boolean} true/false if the event exists or not.
+		 */
+		hasEventListeners: function(name) {
+			return getEventDispatcher(this).has(name);
+		}
+	};
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/Quirks.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1577 @@
+/**
+ * Quirks.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ *
+ * @ignore-file
+ */
+
+/**
+ * This file includes fixes for various browser quirks it's made to make it easy to add/remove browser specific fixes.
+ *
+ * @class tinymce.util.Quirks
+ */
+define("tinymce/util/Quirks", [
+	"tinymce/util/VK",
+	"tinymce/dom/RangeUtils",
+	"tinymce/dom/TreeWalker",
+	"tinymce/html/Node",
+	"tinymce/html/Entities",
+	"tinymce/Env",
+	"tinymce/util/Tools"
+], function(VK, RangeUtils, TreeWalker, Node, Entities, Env, Tools) {
+	return function(editor) {
+		var each = Tools.each, $ = editor.$;
+		var BACKSPACE = VK.BACKSPACE, DELETE = VK.DELETE, dom = editor.dom, selection = editor.selection,
+			settings = editor.settings, parser = editor.parser, serializer = editor.serializer;
+		var isGecko = Env.gecko, isIE = Env.ie, isWebKit = Env.webkit;
+		var mceInternalUrlPrefix = 'data:text/mce-internal,';
+		var mceInternalDataType = isIE ? 'Text' : 'URL';
+
+		/**
+		 * Executes a command with a specific state this can be to enable/disable browser editing features.
+		 */
+		function setEditorCommandState(cmd, state) {
+			try {
+				editor.getDoc().execCommand(cmd, false, state);
+			} catch (ex) {
+				// Ignore
+			}
+		}
+
+		/**
+		 * Returns current IE document mode.
+		 */
+		function getDocumentMode() {
+			var documentMode = editor.getDoc().documentMode;
+
+			return documentMode ? documentMode : 6;
+		}
+
+		/**
+		 * Returns true/false if the event is prevented or not.
+		 *
+		 * @private
+		 * @param {Event} e Event object.
+		 * @return {Boolean} true/false if the event is prevented or not.
+		 */
+		function isDefaultPrevented(e) {
+			return e.isDefaultPrevented();
+		}
+
+		/**
+		 * Sets Text/URL data on the event's dataTransfer object to a special data:text/mce-internal url.
+		 * This is to workaround the inability to set custom contentType on IE and Safari.
+		 * The editor's selected content is encoded into this url so drag and drop between editors will work.
+		 *
+		 * @private
+		 * @param {DragEvent} e Event object
+		 */
+		function setMceInteralContent(e) {
+			var selectionHtml;
+
+			if (e.dataTransfer) {
+				if (editor.selection.isCollapsed() && e.target.tagName == 'IMG') {
+					selection.select(e.target);
+				}
+
+				selectionHtml = editor.selection.getContent();
+
+				// Safari/IE doesn't support custom dataTransfer items so we can only use URL and Text
+				if (selectionHtml.length > 0) {
+					e.dataTransfer.setData(mceInternalDataType, mceInternalUrlPrefix + escape(selectionHtml));
+				}
+			}
+		}
+
+		/**
+		 * Gets content of special data:text/mce-internal url on the event's dataTransfer object.
+		 * This is to workaround the inability to set custom contentType on IE and Safari.
+		 * The editor's selected content is encoded into this url so drag and drop between editors will work.
+		 *
+		 * @private
+		 * @param {DragEvent} e Event object
+		 * @returns {String} mce-internal content
+		 */
+		function getMceInternalContent(e) {
+			var internalContent, content;
+
+			if (e.dataTransfer) {
+				internalContent = e.dataTransfer.getData(mceInternalDataType);
+
+				if (internalContent && internalContent.indexOf(mceInternalUrlPrefix) >= 0) {
+					content = unescape(internalContent.substr(mceInternalUrlPrefix.length));
+				}
+			}
+
+			return content;
+		}
+
+		/**
+		 * Inserts contents using the paste clipboard command if it's available if it isn't it will fallback
+		 * to the core command.
+		 *
+		 * @private
+		 * @param {String} content Content to insert at selection.
+		 */
+		function insertClipboardContents(content) {
+			if (editor.queryCommandSupported('mceInsertClipboardContent')) {
+				editor.execCommand('mceInsertClipboardContent', false, {content: content});
+			} else {
+				editor.execCommand('mceInsertContent', false, content);
+			}
+		}
+
+		/**
+		 * Fixes a WebKit bug when deleting contents using backspace or delete key.
+		 * WebKit will produce a span element if you delete across two block elements.
+		 *
+		 * Example:
+		 * <h1>a</h1><p>|b</p>
+		 *
+		 * Will produce this on backspace:
+		 * <h1>a<span style="<all runtime styles>">b</span></p>
+		 *
+		 * This fixes the backspace to produce:
+		 * <h1>a|b</p>
+		 *
+		 * See bug: https://bugs.webkit.org/show_bug.cgi?id=45784
+		 *
+		 * This fixes the following delete scenarios:
+		 *  1. Delete by pressing backspace key.
+		 *  2. Delete by pressing delete key.
+		 *  3. Delete by pressing backspace key with ctrl/cmd (Word delete).
+		 *  4. Delete by pressing delete key with ctrl/cmd (Word delete).
+		 *  5. Delete by drag/dropping contents inside the editor.
+		 *  6. Delete by using Cut Ctrl+X/Cmd+X.
+		 *  7. Delete by selecting contents and writing a character.
+		 *
+		 * This code is a ugly hack since writing full custom delete logic for just this bug
+		 * fix seemed like a huge task. I hope we can remove this before the year 2030.
+		 */
+		function cleanupStylesWhenDeleting() {
+			var doc = editor.getDoc(), dom = editor.dom, selection = editor.selection;
+			var MutationObserver = window.MutationObserver, olderWebKit, dragStartRng;
+
+			// Add mini polyfill for older WebKits
+			// TODO: Remove this when old Safari versions gets updated
+			if (!MutationObserver) {
+				olderWebKit = true;
+
+				MutationObserver = function() {
+					var records = [], target;
+
+					function nodeInsert(e) {
+						var target = e.relatedNode || e.target;
+						records.push({target: target, addedNodes: [target]});
+					}
+
+					function attrModified(e) {
+						var target = e.relatedNode || e.target;
+						records.push({target: target, attributeName: e.attrName});
+					}
+
+					this.observe = function(node) {
+						target = node;
+						target.addEventListener('DOMSubtreeModified', nodeInsert, false);
+						target.addEventListener('DOMNodeInsertedIntoDocument', nodeInsert, false);
+						target.addEventListener('DOMNodeInserted', nodeInsert, false);
+						target.addEventListener('DOMAttrModified', attrModified, false);
+					};
+
+					this.disconnect = function() {
+						target.removeEventListener('DOMSubtreeModified', nodeInsert, false);
+						target.removeEventListener('DOMNodeInsertedIntoDocument', nodeInsert, false);
+						target.removeEventListener('DOMNodeInserted', nodeInsert, false);
+						target.removeEventListener('DOMAttrModified', attrModified, false);
+					};
+
+					this.takeRecords = function() {
+						return records;
+					};
+				};
+			}
+
+			function isTrailingBr(node) {
+				var blockElements = dom.schema.getBlockElements(), rootNode = editor.getBody();
+
+				if (node.nodeName != 'BR') {
+					return false;
+				}
+
+				for (node = node; node != rootNode && !blockElements[node.nodeName]; node = node.parentNode) {
+					if (node.nextSibling) {
+						return false;
+					}
+				}
+
+				return true;
+			}
+
+			function isSiblingsIgnoreWhiteSpace(node1, node2) {
+				var node;
+
+				for (node = node1.nextSibling; node && node != node2; node = node.nextSibling) {
+					if (node.nodeType == 3 && $.trim(node.data).length === 0) {
+						continue;
+					}
+
+					if (node !== node2) {
+						return false;
+					}
+				}
+
+				return node === node2;
+			}
+
+			function findCaretNode(node, forward, startNode) {
+				var walker, current, nonEmptyElements;
+
+				nonEmptyElements = dom.schema.getNonEmptyElements();
+
+				walker = new TreeWalker(startNode || node, node);
+
+				while ((current = walker[forward ? 'next' : 'prev']())) {
+					if (nonEmptyElements[current.nodeName] && !isTrailingBr(current)) {
+						return current;
+					}
+
+					if (current.nodeType == 3 && current.data.length > 0) {
+						return current;
+					}
+				}
+			}
+
+			function deleteRangeBetweenTextBlocks(rng) {
+				var startBlock, endBlock, caretNodeBefore, caretNodeAfter, textBlockElements;
+
+				if (rng.collapsed) {
+					return;
+				}
+
+				startBlock = dom.getParent(RangeUtils.getNode(rng.startContainer, rng.startOffset), dom.isBlock);
+				endBlock = dom.getParent(RangeUtils.getNode(rng.endContainer, rng.endOffset), dom.isBlock);
+				textBlockElements = editor.schema.getTextBlockElements();
+
+				if (startBlock == endBlock) {
+					return;
+				}
+
+				if (!textBlockElements[startBlock.nodeName] || !textBlockElements[endBlock.nodeName]) {
+					return;
+				}
+
+				if (dom.getContentEditable(startBlock) === "false" || dom.getContentEditable(endBlock) === "false") {
+					return;
+				}
+
+				rng.deleteContents();
+
+				caretNodeBefore = findCaretNode(startBlock, false);
+				caretNodeAfter = findCaretNode(endBlock, true);
+
+				if (!dom.isEmpty(endBlock)) {
+					$(startBlock).append(endBlock.childNodes);
+				}
+
+				$(endBlock).remove();
+
+				if (caretNodeBefore) {
+					if (caretNodeBefore.nodeType == 1) {
+						if (caretNodeBefore.nodeName == "BR") {
+							rng.setStartBefore(caretNodeBefore);
+							rng.setEndBefore(caretNodeBefore);
+						} else {
+							rng.setStartAfter(caretNodeBefore);
+							rng.setEndAfter(caretNodeBefore);
+						}
+					} else {
+						rng.setStart(caretNodeBefore, caretNodeBefore.data.length);
+						rng.setEnd(caretNodeBefore, caretNodeBefore.data.length);
+					}
+				} else if (caretNodeAfter) {
+					if (caretNodeAfter.nodeType == 1) {
+						rng.setStartBefore(caretNodeAfter);
+						rng.setEndBefore(caretNodeAfter);
+					} else {
+						rng.setStart(caretNodeAfter, 0);
+						rng.setEnd(caretNodeAfter, 0);
+					}
+				}
+
+				selection.setRng(rng);
+
+				return true;
+			}
+
+			function expandBetweenBlocks(rng, isForward) {
+				var caretNode, targetCaretNode, textBlock, targetTextBlock, container, offset;
+
+				if (!rng.collapsed) {
+					return rng;
+				}
+
+				container = rng.startContainer;
+				offset = rng.startOffset;
+
+				if (container.nodeType == 3) {
+					if (isForward) {
+						if (offset < container.data.length) {
+							return rng;
+						}
+					} else {
+						if (offset > 0) {
+							return rng;
+						}
+					}
+				}
+
+				caretNode = RangeUtils.getNode(rng.startContainer, rng.startOffset);
+				textBlock = dom.getParent(caretNode, dom.isBlock);
+				targetCaretNode = findCaretNode(editor.getBody(), isForward, caretNode);
+				targetTextBlock = dom.getParent(targetCaretNode, dom.isBlock);
+
+				if (!caretNode || !targetCaretNode) {
+					return rng;
+				}
+
+				if (targetTextBlock && textBlock != targetTextBlock) {
+					if (!isForward) {
+						if (!isSiblingsIgnoreWhiteSpace(targetTextBlock, textBlock)) {
+							return rng;
+						}
+
+						if (targetCaretNode.nodeType == 1) {
+							if (targetCaretNode.nodeName == "BR") {
+								rng.setStartBefore(targetCaretNode);
+							} else {
+								rng.setStartAfter(targetCaretNode);
+							}
+						} else {
+							rng.setStart(targetCaretNode, targetCaretNode.data.length);
+						}
+
+						if (caretNode.nodeType == 1) {
+							rng.setEnd(caretNode, 0);
+						} else {
+							rng.setEndBefore(caretNode);
+						}
+					} else {
+						if (!isSiblingsIgnoreWhiteSpace(textBlock, targetTextBlock)) {
+							return rng;
+						}
+
+						if (caretNode.nodeType == 1) {
+							if (caretNode.nodeName == "BR") {
+								rng.setStartBefore(caretNode);
+							} else {
+								rng.setStartAfter(caretNode);
+							}
+						} else {
+							rng.setStart(caretNode, caretNode.data.length);
+						}
+
+						if (targetCaretNode.nodeType == 1) {
+							rng.setEnd(targetCaretNode, 0);
+						} else {
+							rng.setEndBefore(targetCaretNode);
+						}
+					}
+				}
+
+				return rng;
+			}
+
+			function handleTextBlockMergeDelete(isForward) {
+				var rng = selection.getRng();
+
+				rng = expandBetweenBlocks(rng, isForward);
+
+				if (deleteRangeBetweenTextBlocks(rng)) {
+					return true;
+				}
+			}
+
+			function customDelete(isForward) {
+				var mutationObserver, rng, caretElement;
+
+				if (handleTextBlockMergeDelete(isForward)) {
+					return;
+				}
+
+				Tools.each(editor.getBody().getElementsByTagName('*'), function(elm) {
+					// Mark existing spans
+					if (elm.tagName == 'SPAN') {
+						elm.setAttribute('mce-data-marked', 1);
+					}
+
+					// Make sure all elements has a data-mce-style attribute
+					if (!elm.hasAttribute('data-mce-style') && elm.hasAttribute('style')) {
+						editor.dom.setAttrib(elm, 'style', editor.dom.getAttrib(elm, 'style'));
+					}
+				});
+
+				// Observe added nodes and style attribute changes
+				mutationObserver = new MutationObserver(function() {});
+				mutationObserver.observe(editor.getDoc(), {
+					childList: true,
+					attributes: true,
+					subtree: true,
+					attributeFilter: ['style']
+				});
+
+				editor.getDoc().execCommand(isForward ? 'ForwardDelete' : 'Delete', false, null);
+
+				rng = editor.selection.getRng();
+				caretElement = rng.startContainer.parentNode;
+
+				Tools.each(mutationObserver.takeRecords(), function(record) {
+					if (!dom.isChildOf(record.target, editor.getBody())) {
+						return;
+					}
+
+					// Restore style attribute to previous value
+					if (record.attributeName == "style") {
+						var oldValue = record.target.getAttribute('data-mce-style');
+
+						if (oldValue) {
+							record.target.setAttribute("style", oldValue);
+						} else {
+							record.target.removeAttribute("style");
+						}
+					}
+
+					// Remove all spans that isn't maked and retain selection
+					Tools.each(record.addedNodes, function(node) {
+						if (node.nodeName == "SPAN" && !node.getAttribute('mce-data-marked')) {
+							var offset, container;
+
+							if (node == caretElement) {
+								offset = rng.startOffset;
+								container = node.firstChild;
+							}
+
+							dom.remove(node, true);
+
+							if (container) {
+								rng.setStart(container, offset);
+								rng.setEnd(container, offset);
+								editor.selection.setRng(rng);
+							}
+						}
+					});
+				});
+
+				mutationObserver.disconnect();
+
+				// Remove any left over marks
+				Tools.each(editor.dom.select('span[mce-data-marked]'), function(span) {
+					span.removeAttribute('mce-data-marked');
+				});
+			}
+
+			editor.on('keydown', function(e) {
+				var isForward = e.keyCode == DELETE, isMetaOrCtrl = e.ctrlKey || e.metaKey;
+
+				if (!isDefaultPrevented(e) && (isForward || e.keyCode == BACKSPACE)) {
+					var rng = editor.selection.getRng(), container = rng.startContainer, offset = rng.startOffset;
+
+					// Ignore non meta delete in the where there is text before/after the caret
+					if (!isMetaOrCtrl && rng.collapsed && container.nodeType == 3) {
+						if (isForward ? offset < container.data.length : offset > 0) {
+							return;
+						}
+					}
+
+					e.preventDefault();
+
+					if (isMetaOrCtrl) {
+						editor.selection.getSel().modify("extend", isForward ? "forward" : "backward", e.metaKey ? "lineboundary" : "word");
+					}
+
+					customDelete(isForward);
+				}
+			});
+
+			// Handle case where text is deleted by typing over
+			editor.on('keypress', function(e) {
+				if (!isDefaultPrevented(e) && !selection.isCollapsed() && e.charCode && !VK.metaKeyPressed(e)) {
+					var rng, currentFormatNodes, fragmentNode, blockParent, caretNode, charText;
+
+					rng = editor.selection.getRng();
+					charText = String.fromCharCode(e.charCode);
+					e.preventDefault();
+
+					// Keep track of current format nodes
+					currentFormatNodes = $(rng.startContainer).parents().filter(function(idx, node) {
+						return !!editor.schema.getTextInlineElements()[node.nodeName];
+					});
+
+					customDelete(true);
+
+					// Check if the browser removed them
+					currentFormatNodes = currentFormatNodes.filter(function(idx, node) {
+						return !$.contains(editor.getBody(), node);
+					});
+
+					// Then re-add them
+					if (currentFormatNodes.length) {
+						fragmentNode = dom.createFragment();
+
+						currentFormatNodes.each(function(idx, formatNode) {
+							formatNode = formatNode.cloneNode(false);
+
+							if (fragmentNode.hasChildNodes()) {
+								formatNode.appendChild(fragmentNode.firstChild);
+								fragmentNode.appendChild(formatNode);
+							} else {
+								caretNode = formatNode;
+								fragmentNode.appendChild(formatNode);
+							}
+
+							fragmentNode.appendChild(formatNode);
+						});
+
+						caretNode.appendChild(editor.getDoc().createTextNode(charText));
+
+						// Prevent edge case where older WebKit would add an extra BR element
+						blockParent = dom.getParent(rng.startContainer, dom.isBlock);
+						if (dom.isEmpty(blockParent)) {
+							$(blockParent).empty().append(fragmentNode);
+						} else {
+							rng.insertNode(fragmentNode);
+						}
+
+						rng.setStart(caretNode.firstChild, 1);
+						rng.setEnd(caretNode.firstChild, 1);
+						editor.selection.setRng(rng);
+					} else {
+						editor.selection.setContent(charText);
+					}
+				}
+			});
+
+			editor.addCommand('Delete', function() {
+				customDelete();
+			});
+
+			editor.addCommand('ForwardDelete', function() {
+				customDelete(true);
+			});
+
+			// Older WebKits doesn't properly handle the clipboard so we can't add the rest
+			if (olderWebKit) {
+				return;
+			}
+
+			editor.on('dragstart', function(e) {
+				dragStartRng = selection.getRng();
+				setMceInteralContent(e);
+			});
+
+			editor.on('drop', function(e) {
+				if (!isDefaultPrevented(e)) {
+					var internalContent = getMceInternalContent(e);
+					if (internalContent) {
+						e.preventDefault();
+
+						// Safari has a weird issue where drag/dropping images sometimes
+						// produces a green plus icon. When this happens the caretRangeFromPoint
+						// will return "null" even though the x, y coordinate is correct.
+						// But if we detach the insert from the drop event we will get a proper range
+						window.setTimeout(function() {
+							var pointRng = RangeUtils.getCaretRangeFromPoint(e.x, e.y, doc);
+
+							if (dragStartRng) {
+								selection.setRng(dragStartRng);
+								dragStartRng = null;
+							}
+
+							customDelete();
+							selection.setRng(pointRng);
+							insertClipboardContents(internalContent);
+						}, 0);
+					}
+				}
+			});
+
+			editor.on('cut', function(e) {
+				if (!isDefaultPrevented(e) && e.clipboardData) {
+					e.preventDefault();
+					e.clipboardData.clearData();
+					e.clipboardData.setData('text/html', editor.selection.getContent());
+					e.clipboardData.setData('text/plain', editor.selection.getContent({format: 'text'}));
+					customDelete(true);
+				}
+			});
+		}
+
+		/**
+		 * Makes sure that the editor body becomes empty when backspace or delete is pressed in empty editors.
+		 *
+		 * For example:
+		 * <p><b>|</b></p>
+		 *
+		 * Or:
+		 * <h1>|</h1>
+		 *
+		 * Or:
+		 * [<h1></h1>]
+		 */
+		function emptyEditorWhenDeleting() {
+			function serializeRng(rng) {
+				var body = dom.create("body");
+				var contents = rng.cloneContents();
+				body.appendChild(contents);
+				return selection.serializer.serialize(body, {format: 'html'});
+			}
+
+			function allContentsSelected(rng) {
+				if (!rng.setStart) {
+					if (rng.item) {
+						return false;
+					}
+
+					var bodyRng = rng.duplicate();
+					bodyRng.moveToElementText(editor.getBody());
+					return RangeUtils.compareRanges(rng, bodyRng);
+				}
+
+				var selection = serializeRng(rng);
+
+				var allRng = dom.createRng();
+				allRng.selectNode(editor.getBody());
+
+				var allSelection = serializeRng(allRng);
+				return selection === allSelection;
+			}
+
+			editor.on('keydown', function(e) {
+				var keyCode = e.keyCode, isCollapsed, body;
+
+				// Empty the editor if it's needed for example backspace at <p><b>|</b></p>
+				if (!isDefaultPrevented(e) && (keyCode == DELETE || keyCode == BACKSPACE)) {
+					isCollapsed = editor.selection.isCollapsed();
+					body = editor.getBody();
+
+					// Selection is collapsed but the editor isn't empty
+					if (isCollapsed && !dom.isEmpty(body)) {
+						return;
+					}
+
+					// Selection isn't collapsed but not all the contents is selected
+					if (!isCollapsed && !allContentsSelected(editor.selection.getRng())) {
+						return;
+					}
+
+					// Manually empty the editor
+					e.preventDefault();
+					editor.setContent('');
+
+					if (body.firstChild && dom.isBlock(body.firstChild)) {
+						editor.selection.setCursorLocation(body.firstChild, 0);
+					} else {
+						editor.selection.setCursorLocation(body, 0);
+					}
+
+					editor.nodeChanged();
+				}
+			});
+		}
+
+		/**
+		 * WebKit doesn't select all the nodes in the body when you press Ctrl+A.
+		 * IE selects more than the contents <body>[<p>a</p>]</body> instead of <body><p>[a]</p]</body> see bug #6438
+		 * This selects the whole body so that backspace/delete logic will delete everything
+		 */
+		function selectAll() {
+			editor.shortcuts.add('meta+a', null, 'SelectAll');
+		}
+
+		/**
+		 * WebKit has a weird issue where it some times fails to properly convert keypresses to input method keystrokes.
+		 * The IME on Mac doesn't initialize when it doesn't fire a proper focus event.
+		 *
+		 * This seems to happen when the user manages to click the documentElement element then the window doesn't get proper focus until
+		 * you enter a character into the editor.
+		 *
+		 * It also happens when the first focus in made to the body.
+		 *
+		 * See: https://bugs.webkit.org/show_bug.cgi?id=83566
+		 */
+		function inputMethodFocus() {
+			if (!editor.settings.content_editable) {
+				// Case 1 IME doesn't initialize if you focus the document
+				dom.bind(editor.getDoc(), 'focusin', function() {
+					selection.setRng(selection.getRng());
+				});
+
+				// Case 2 IME doesn't initialize if you click the documentElement it also doesn't properly fire the focusin event
+				// Needs to be both down/up due to weird rendering bug on Chrome Windows
+				dom.bind(editor.getDoc(), 'mousedown mouseup', function(e) {
+					if (e.target == editor.getDoc().documentElement) {
+						editor.getBody().focus();
+
+						if (e.type == 'mousedown') {
+							// Edge case for mousedown, drag select and mousedown again within selection on Chrome Windows to render caret
+							selection.placeCaretAt(e.clientX, e.clientY);
+						} else {
+							selection.setRng(selection.getRng());
+						}
+					}
+				});
+			}
+		}
+
+		/**
+		 * Backspacing in FireFox/IE from a paragraph into a horizontal rule results in a floating text node because the
+		 * browser just deletes the paragraph - the browser fails to merge the text node with a horizontal rule so it is
+		 * left there. TinyMCE sees a floating text node and wraps it in a paragraph on the key up event (ForceBlocks.js
+		 * addRootBlocks), meaning the action does nothing. With this code, FireFox/IE matche the behaviour of other
+		 * browsers.
+		 *
+		 * It also fixes a bug on Firefox where it's impossible to delete HR elements.
+		 */
+		function removeHrOnBackspace() {
+			editor.on('keydown', function(e) {
+				if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {
+					// Check if there is any HR elements this is faster since getRng on IE 7 & 8 is slow
+					if (!editor.getBody().getElementsByTagName('hr').length) {
+						return;
+					}
+
+					if (selection.isCollapsed() && selection.getRng(true).startOffset === 0) {
+						var node = selection.getNode();
+						var previousSibling = node.previousSibling;
+
+						if (node.nodeName == 'HR') {
+							dom.remove(node);
+							e.preventDefault();
+							return;
+						}
+
+						if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === "hr") {
+							dom.remove(previousSibling);
+							e.preventDefault();
+						}
+					}
+				}
+			});
+		}
+
+		/**
+		 * Firefox 3.x has an issue where the body element won't get proper focus if you click out
+		 * side it's rectangle.
+		 */
+		function focusBody() {
+			// Fix for a focus bug in FF 3.x where the body element
+			// wouldn't get proper focus if the user clicked on the HTML element
+			if (!window.Range.prototype.getClientRects) { // Detect getClientRects got introduced in FF 4
+				editor.on('mousedown', function(e) {
+					if (!isDefaultPrevented(e) && e.target.nodeName === "HTML") {
+						var body = editor.getBody();
+
+						// Blur the body it's focused but not correctly focused
+						body.blur();
+
+						// Refocus the body after a little while
+						setTimeout(function() {
+							body.focus();
+						}, 0);
+					}
+				});
+			}
+		}
+
+		/**
+		 * WebKit has a bug where it isn't possible to select image, hr or anchor elements
+		 * by clicking on them so we need to fake that.
+		 */
+		function selectControlElements() {
+			editor.on('click', function(e) {
+				var target = e.target;
+
+				// Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250
+				// WebKit can't even do simple things like selecting an image
+				// Needs to be the setBaseAndExtend or it will fail to select floated images
+				if (/^(IMG|HR)$/.test(target.nodeName)) {
+					e.preventDefault();
+					selection.getSel().setBaseAndExtent(target, 0, target, 1);
+					editor.nodeChanged();
+				}
+
+				if (target.nodeName == 'A' && dom.hasClass(target, 'mce-item-anchor')) {
+					e.preventDefault();
+					selection.select(target);
+				}
+			});
+		}
+
+		/**
+		 * Fixes a Gecko bug where the style attribute gets added to the wrong element when deleting between two block elements.
+		 *
+		 * Fixes do backspace/delete on this:
+		 * <p>bla[ck</p><p style="color:red">r]ed</p>
+		 *
+		 * Would become:
+		 * <p>bla|ed</p>
+		 *
+		 * Instead of:
+		 * <p style="color:red">bla|ed</p>
+		 */
+		function removeStylesWhenDeletingAcrossBlockElements() {
+			function getAttributeApplyFunction() {
+				var template = dom.getAttribs(selection.getStart().cloneNode(false));
+
+				return function() {
+					var target = selection.getStart();
+
+					if (target !== editor.getBody()) {
+						dom.setAttrib(target, "style", null);
+
+						each(template, function(attr) {
+							target.setAttributeNode(attr.cloneNode(true));
+						});
+					}
+				};
+			}
+
+			function isSelectionAcrossElements() {
+				return !selection.isCollapsed() &&
+					dom.getParent(selection.getStart(), dom.isBlock) != dom.getParent(selection.getEnd(), dom.isBlock);
+			}
+
+			editor.on('keypress', function(e) {
+				var applyAttributes;
+
+				if (!isDefaultPrevented(e) && (e.keyCode == 8 || e.keyCode == 46) && isSelectionAcrossElements()) {
+					applyAttributes = getAttributeApplyFunction();
+					editor.getDoc().execCommand('delete', false, null);
+					applyAttributes();
+					e.preventDefault();
+					return false;
+				}
+			});
+
+			dom.bind(editor.getDoc(), 'cut', function(e) {
+				var applyAttributes;
+
+				if (!isDefaultPrevented(e) && isSelectionAcrossElements()) {
+					applyAttributes = getAttributeApplyFunction();
+
+					setTimeout(function() {
+						applyAttributes();
+					}, 0);
+				}
+			});
+		}
+
+		/**
+		 * Screen readers on IE needs to have the role application set on the body.
+		 */
+		function ensureBodyHasRoleApplication() {
+			document.body.setAttribute("role", "application");
+		}
+
+		/**
+		 * Backspacing into a table behaves differently depending upon browser type.
+		 * Therefore, disable Backspace when cursor immediately follows a table.
+		 */
+		function disableBackspaceIntoATable() {
+			editor.on('keydown', function(e) {
+				if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {
+					if (selection.isCollapsed() && selection.getRng(true).startOffset === 0) {
+						var previousSibling = selection.getNode().previousSibling;
+						if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === "table") {
+							e.preventDefault();
+							return false;
+						}
+					}
+				}
+			});
+		}
+
+		/**
+		 * Old IE versions can't properly render BR elements in PRE tags white in contentEditable mode. So this
+		 * logic adds a \n before the BR so that it will get rendered.
+		 */
+		function addNewLinesBeforeBrInPre() {
+			// IE8+ rendering mode does the right thing with BR in PRE
+			if (getDocumentMode() > 7) {
+				return;
+			}
+
+			// Enable display: none in area and add a specific class that hides all BR elements in PRE to
+			// avoid the caret from getting stuck at the BR elements while pressing the right arrow key
+			setEditorCommandState('RespectVisibilityInDesign', true);
+			editor.contentStyles.push('.mceHideBrInPre pre br {display: none}');
+			dom.addClass(editor.getBody(), 'mceHideBrInPre');
+
+			// Adds a \n before all BR elements in PRE to get them visual
+			parser.addNodeFilter('pre', function(nodes) {
+				var i = nodes.length, brNodes, j, brElm, sibling;
+
+				while (i--) {
+					brNodes = nodes[i].getAll('br');
+					j = brNodes.length;
+					while (j--) {
+						brElm = brNodes[j];
+
+						// Add \n before BR in PRE elements on older IE:s so the new lines get rendered
+						sibling = brElm.prev;
+						if (sibling && sibling.type === 3 && sibling.value.charAt(sibling.value - 1) != '\n') {
+							sibling.value += '\n';
+						} else {
+							brElm.parent.insert(new Node('#text', 3), brElm, true).value = '\n';
+						}
+					}
+				}
+			});
+
+			// Removes any \n before BR elements in PRE since other browsers and in contentEditable=false mode they will be visible
+			serializer.addNodeFilter('pre', function(nodes) {
+				var i = nodes.length, brNodes, j, brElm, sibling;
+
+				while (i--) {
+					brNodes = nodes[i].getAll('br');
+					j = brNodes.length;
+					while (j--) {
+						brElm = brNodes[j];
+						sibling = brElm.prev;
+						if (sibling && sibling.type == 3) {
+							sibling.value = sibling.value.replace(/\r?\n$/, '');
+						}
+					}
+				}
+			});
+		}
+
+		/**
+		 * Moves style width/height to attribute width/height when the user resizes an image on IE.
+		 */
+		function removePreSerializedStylesWhenSelectingControls() {
+			dom.bind(editor.getBody(), 'mouseup', function() {
+				var value, node = selection.getNode();
+
+				// Moved styles to attributes on IMG eements
+				if (node.nodeName == 'IMG') {
+					// Convert style width to width attribute
+					if ((value = dom.getStyle(node, 'width'))) {
+						dom.setAttrib(node, 'width', value.replace(/[^0-9%]+/g, ''));
+						dom.setStyle(node, 'width', '');
+					}
+
+					// Convert style height to height attribute
+					if ((value = dom.getStyle(node, 'height'))) {
+						dom.setAttrib(node, 'height', value.replace(/[^0-9%]+/g, ''));
+						dom.setStyle(node, 'height', '');
+					}
+				}
+			});
+		}
+
+		/**
+		 * Removes a blockquote when backspace is pressed at the beginning of it.
+		 *
+		 * For example:
+		 * <blockquote><p>|x</p></blockquote>
+		 *
+		 * Becomes:
+		 * <p>|x</p>
+		 */
+		function removeBlockQuoteOnBackSpace() {
+			// Add block quote deletion handler
+			editor.on('keydown', function(e) {
+				var rng, container, offset, root, parent;
+
+				if (isDefaultPrevented(e) || e.keyCode != VK.BACKSPACE) {
+					return;
+				}
+
+				rng = selection.getRng();
+				container = rng.startContainer;
+				offset = rng.startOffset;
+				root = dom.getRoot();
+				parent = container;
+
+				if (!rng.collapsed || offset !== 0) {
+					return;
+				}
+
+				while (parent && parent.parentNode && parent.parentNode.firstChild == parent && parent.parentNode != root) {
+					parent = parent.parentNode;
+				}
+
+				// Is the cursor at the beginning of a blockquote?
+				if (parent.tagName === 'BLOCKQUOTE') {
+					// Remove the blockquote
+					editor.formatter.toggle('blockquote', null, parent);
+
+					// Move the caret to the beginning of container
+					rng = dom.createRng();
+					rng.setStart(container, 0);
+					rng.setEnd(container, 0);
+					selection.setRng(rng);
+				}
+			});
+		}
+
+		/**
+		 * Sets various Gecko editing options on mouse down and before a execCommand to disable inline table editing that is broken etc.
+		 */
+		function setGeckoEditingOptions() {
+			function setOpts() {
+				editor._refreshContentEditable();
+
+				setEditorCommandState("StyleWithCSS", false);
+				setEditorCommandState("enableInlineTableEditing", false);
+
+				if (!settings.object_resizing) {
+					setEditorCommandState("enableObjectResizing", false);
+				}
+			}
+
+			if (!settings.readonly) {
+				editor.on('BeforeExecCommand MouseDown', setOpts);
+			}
+		}
+
+		/**
+		 * Fixes a gecko link bug, when a link is placed at the end of block elements there is
+		 * no way to move the caret behind the link. This fix adds a bogus br element after the link.
+		 *
+		 * For example this:
+		 * <p><b><a href="#">x</a></b></p>
+		 *
+		 * Becomes this:
+		 * <p><b><a href="#">x</a></b><br></p>
+		 */
+		function addBrAfterLastLinks() {
+			function fixLinks() {
+				each(dom.select('a'), function(node) {
+					var parentNode = node.parentNode, root = dom.getRoot();
+
+					if (parentNode.lastChild === node) {
+						while (parentNode && !dom.isBlock(parentNode)) {
+							if (parentNode.parentNode.lastChild !== parentNode || parentNode === root) {
+								return;
+							}
+
+							parentNode = parentNode.parentNode;
+						}
+
+						dom.add(parentNode, 'br', {'data-mce-bogus': 1});
+					}
+				});
+			}
+
+			editor.on('SetContent ExecCommand', function(e) {
+				if (e.type == "setcontent" || e.command === 'mceInsertLink') {
+					fixLinks();
+				}
+			});
+		}
+
+		/**
+		 * WebKit will produce DIV elements here and there by default. But since TinyMCE uses paragraphs by
+		 * default we want to change that behavior.
+		 */
+		function setDefaultBlockType() {
+			if (settings.forced_root_block) {
+				editor.on('init', function() {
+					setEditorCommandState('DefaultParagraphSeparator', settings.forced_root_block);
+				});
+			}
+		}
+
+		/**
+		 * Removes ghost selections from images/tables on Gecko.
+		 */
+		function removeGhostSelection() {
+			editor.on('Undo Redo SetContent', function(e) {
+				if (!e.initial) {
+					editor.execCommand('mceRepaint');
+				}
+			});
+		}
+
+		/**
+		 * Deletes the selected image on IE instead of navigating to previous page.
+		 */
+		function deleteControlItemOnBackSpace() {
+			editor.on('keydown', function(e) {
+				var rng;
+
+				if (!isDefaultPrevented(e) && e.keyCode == BACKSPACE) {
+					rng = editor.getDoc().selection.createRange();
+					if (rng && rng.item) {
+						e.preventDefault();
+						editor.undoManager.beforeChange();
+						dom.remove(rng.item(0));
+						editor.undoManager.add();
+					}
+				}
+			});
+		}
+
+		/**
+		 * IE10 doesn't properly render block elements with the right height until you add contents to them.
+		 * This fixes that by adding a padding-right to all empty text block elements.
+		 * See: https://connect.microsoft.com/IE/feedback/details/743881
+		 */
+		function renderEmptyBlocksFix() {
+			var emptyBlocksCSS;
+
+			// IE10+
+			if (getDocumentMode() >= 10) {
+				emptyBlocksCSS = '';
+				each('p div h1 h2 h3 h4 h5 h6'.split(' '), function(name, i) {
+					emptyBlocksCSS += (i > 0 ? ',' : '') + name + ':empty';
+				});
+
+				editor.contentStyles.push(emptyBlocksCSS + '{padding-right: 1px !important}');
+			}
+		}
+
+		/**
+		 * Old IE versions can't retain contents within noscript elements so this logic will store the contents
+		 * as a attribute and the insert that value as it's raw text when the DOM is serialized.
+		 */
+		function keepNoScriptContents() {
+			if (getDocumentMode() < 9) {
+				parser.addNodeFilter('noscript', function(nodes) {
+					var i = nodes.length, node, textNode;
+
+					while (i--) {
+						node = nodes[i];
+						textNode = node.firstChild;
+
+						if (textNode) {
+							node.attr('data-mce-innertext', textNode.value);
+						}
+					}
+				});
+
+				serializer.addNodeFilter('noscript', function(nodes) {
+					var i = nodes.length, node, textNode, value;
+
+					while (i--) {
+						node = nodes[i];
+						textNode = nodes[i].firstChild;
+
+						if (textNode) {
+							textNode.value = Entities.decode(textNode.value);
+						} else {
+							// Old IE can't retain noscript value so an attribute is used to store it
+							value = node.attributes.map['data-mce-innertext'];
+							if (value) {
+								node.attr('data-mce-innertext', null);
+								textNode = new Node('#text', 3);
+								textNode.value = value;
+								textNode.raw = true;
+								node.append(textNode);
+							}
+						}
+					}
+				});
+			}
+		}
+
+		/**
+		 * IE has an issue where you can't select/move the caret by clicking outside the body if the document is in standards mode.
+		 */
+		function fixCaretSelectionOfDocumentElementOnIe() {
+			var doc = dom.doc, body = doc.body, started, startRng, htmlElm;
+
+			// Return range from point or null if it failed
+			function rngFromPoint(x, y) {
+				var rng = body.createTextRange();
+
+				try {
+					rng.moveToPoint(x, y);
+				} catch (ex) {
+					// IE sometimes throws and exception, so lets just ignore it
+					rng = null;
+				}
+
+				return rng;
+			}
+
+			// Fires while the selection is changing
+			function selectionChange(e) {
+				var pointRng;
+
+				// Check if the button is down or not
+				if (e.button) {
+					// Create range from mouse position
+					pointRng = rngFromPoint(e.x, e.y);
+
+					if (pointRng) {
+						// Check if pointRange is before/after selection then change the endPoint
+						if (pointRng.compareEndPoints('StartToStart', startRng) > 0) {
+							pointRng.setEndPoint('StartToStart', startRng);
+						} else {
+							pointRng.setEndPoint('EndToEnd', startRng);
+						}
+
+						pointRng.select();
+					}
+				} else {
+					endSelection();
+				}
+			}
+
+			// Removes listeners
+			function endSelection() {
+				var rng = doc.selection.createRange();
+
+				// If the range is collapsed then use the last start range
+				if (startRng && !rng.item && rng.compareEndPoints('StartToEnd', rng) === 0) {
+					startRng.select();
+				}
+
+				dom.unbind(doc, 'mouseup', endSelection);
+				dom.unbind(doc, 'mousemove', selectionChange);
+				startRng = started = 0;
+			}
+
+			// Make HTML element unselectable since we are going to handle selection by hand
+			doc.documentElement.unselectable = true;
+
+			// Detect when user selects outside BODY
+			dom.bind(doc, 'mousedown contextmenu', function(e) {
+				if (e.target.nodeName === 'HTML') {
+					if (started) {
+						endSelection();
+					}
+
+					// Detect vertical scrollbar, since IE will fire a mousedown on the scrollbar and have target set as HTML
+					htmlElm = doc.documentElement;
+					if (htmlElm.scrollHeight > htmlElm.clientHeight) {
+						return;
+					}
+
+					started = 1;
+					// Setup start position
+					startRng = rngFromPoint(e.x, e.y);
+					if (startRng) {
+						// Listen for selection change events
+						dom.bind(doc, 'mouseup', endSelection);
+						dom.bind(doc, 'mousemove', selectionChange);
+
+						dom.getRoot().focus();
+						startRng.select();
+					}
+				}
+			});
+		}
+
+		/**
+		 * Fixes selection issues where the caret can be placed between two inline elements like <b>a</b>|<b>b</b>
+		 * this fix will lean the caret right into the closest inline element.
+		 */
+		function normalizeSelection() {
+			// Normalize selection for example <b>a</b><i>|a</i> becomes <b>a|</b><i>a</i> except for Ctrl+A since it selects everything
+			editor.on('keyup focusin mouseup', function(e) {
+				if (e.keyCode != 65 || !VK.metaKeyPressed(e)) {
+					selection.normalize();
+				}
+			}, true);
+		}
+
+		/**
+		 * Forces Gecko to render a broken image icon if it fails to load an image.
+		 */
+		function showBrokenImageIcon() {
+			editor.contentStyles.push(
+				'img:-moz-broken {' +
+					'-moz-force-broken-image-icon:1;' +
+					'min-width:24px;' +
+					'min-height:24px' +
+				'}'
+			);
+		}
+
+		/**
+		 * iOS has a bug where it's impossible to type if the document has a touchstart event
+		 * bound and the user touches the document while having the on screen keyboard visible.
+		 *
+		 * The touch event moves the focus to the parent document while having the caret inside the iframe
+		 * this fix moves the focus back into the iframe document.
+		 */
+		function restoreFocusOnKeyDown() {
+			if (!editor.inline) {
+				editor.on('keydown', function() {
+					if (document.activeElement == document.body) {
+						editor.getWin().focus();
+					}
+				});
+			}
+		}
+
+		/**
+		 * IE 11 has an annoying issue where you can't move focus into the editor
+		 * by clicking on the white area HTML element. We used to be able to to fix this with
+		 * the fixCaretSelectionOfDocumentElementOnIe fix. But since M$ removed the selection
+		 * object it's not possible anymore. So we need to hack in a ungly CSS to force the
+		 * body to be at least 150px. If the user clicks the HTML element out side this 150px region
+		 * we simply move the focus into the first paragraph. Not ideal since you loose the
+		 * positioning of the caret but goot enough for most cases.
+		 */
+		function bodyHeight() {
+			if (!editor.inline) {
+				editor.contentStyles.push('body {min-height: 150px}');
+				editor.on('click', function(e) {
+					if (e.target.nodeName == 'HTML') {
+						var rng;
+
+						// Need to store away non collapsed ranges since the focus call will mess that up see #7382
+						rng = editor.selection.getRng();
+						editor.getBody().focus();
+						editor.selection.setRng(rng);
+						editor.selection.normalize();
+						editor.nodeChanged();
+					}
+				});
+			}
+		}
+
+		/**
+		 * Firefox on Mac OS will move the browser back to the previous page if you press CMD+Left arrow.
+		 * You might then loose all your work so we need to block that behavior and replace it with our own.
+		 */
+		function blockCmdArrowNavigation() {
+			if (Env.mac) {
+				editor.on('keydown', function(e) {
+					if (VK.metaKeyPressed(e) && (e.keyCode == 37 || e.keyCode == 39)) {
+						e.preventDefault();
+						editor.selection.getSel().modify('move', e.keyCode == 37 ? 'backward' : 'forward', 'lineboundary');
+					}
+				});
+			}
+		}
+
+		/**
+		 * Disables the autolinking in IE 9+ this is then re-enabled by the autolink plugin.
+		 */
+		function disableAutoUrlDetect() {
+			setEditorCommandState("AutoUrlDetect", false);
+		}
+
+		/**
+		 * IE 11 has a fantastic bug where it will produce two trailing BR elements to iframe bodies when
+		 * the iframe is hidden by display: none on a parent container. The DOM is actually out of sync
+		 * with innerHTML in this case. It's like IE adds shadow DOM BR elements that appears on innerHTML
+		 * but not as the lastChild of the body. However is we add a BR element to the body then remove it
+		 * it doesn't seem to add these BR elements makes sence right?!
+		 *
+		 * Example of what happens: <body>text</body> becomes <body>text<br><br></body>
+		 */
+		function doubleTrailingBrElements() {
+			if (!editor.inline) {
+				editor.on('focus blur beforegetcontent', function() {
+					var br = editor.dom.create('br');
+					editor.getBody().appendChild(br);
+					br.parentNode.removeChild(br);
+				}, true);
+			}
+		}
+
+		/**
+		 * iOS 7.1 introduced two new bugs:
+		 * 1) It's possible to open links within a contentEditable area by clicking on them.
+		 * 2) If you hold down the finger it will display the link/image touch callout menu.
+		 */
+		function tapLinksAndImages() {
+			editor.on('click', function(e) {
+				var elm = e.target;
+
+				do {
+					if (elm.tagName === 'A') {
+						e.preventDefault();
+						return;
+					}
+				} while ((elm = elm.parentNode));
+			});
+
+			editor.contentStyles.push('.mce-content-body {-webkit-touch-callout: none}');
+		}
+
+		/**
+		 * iOS Safari and possible other browsers have a bug where it won't fire
+		 * a click event when a contentEditable is focused. This function fakes click events
+		 * by using touchstart/touchend and measuring the time and distance travelled.
+		 */
+		function touchClickEvent() {
+			editor.on('touchstart', function(e) {
+				var elm, time, startTouch, changedTouches;
+
+				elm = e.target;
+				time = new Date().getTime();
+				changedTouches = e.changedTouches;
+
+				if (!changedTouches || changedTouches.length > 1) {
+					return;
+				}
+
+				startTouch = changedTouches[0];
+
+				editor.once('touchend', function(e) {
+					var endTouch = e.changedTouches[0], args;
+
+					if (new Date().getTime() - time > 500) {
+						return;
+					}
+
+					if (Math.abs(startTouch.clientX - endTouch.clientX) > 5) {
+						return;
+					}
+
+					if (Math.abs(startTouch.clientY - endTouch.clientY) > 5) {
+						return;
+					}
+
+					args = {
+						target: elm
+					};
+
+					each('pageX pageY clientX clientY screenX screenY'.split(' '), function(key) {
+						args[key] = endTouch[key];
+					});
+
+					args = editor.fire('click', args);
+
+					if (!args.isDefaultPrevented()) {
+						// iOS WebKit can't place the caret properly once
+						// you bind touch events so we need to do this manually
+						// TODO: Expand to the closest word? Touble tap still works.
+						editor.selection.placeCaretAt(endTouch.clientX, endTouch.clientY);
+						editor.nodeChanged();
+					}
+				});
+			});
+		}
+
+		/**
+		 * WebKit has a bug where it will allow forms to be submitted if they are inside a contentEditable element.
+		 * For example this: <form><button></form>
+		 */
+		function blockFormSubmitInsideEditor() {
+			editor.on('init', function() {
+				editor.dom.bind(editor.getBody(), 'submit', function(e) {
+					e.preventDefault();
+				});
+			});
+		}
+
+		/**
+		 * Sometimes WebKit/Blink generates BR elements with the Apple-interchange-newline class.
+		 *
+		 * Scenario:
+		 *  1) Create a table 2x2.
+		 *  2) Select and copy cells A2-B2.
+		 *  3) Paste and it will add BR element to table cell.
+		 */
+		function removeAppleInterchangeBrs() {
+			parser.addNodeFilter('br', function(nodes) {
+				var i = nodes.length;
+
+				while (i--) {
+					if (nodes[i].attr('class') == 'Apple-interchange-newline') {
+						nodes[i].remove();
+					}
+				}
+			});
+		}
+
+		/**
+		 * IE cannot set custom contentType's on drag events, and also does not properly drag/drop between
+		 * editors. This uses a special data:text/mce-internal URL to pass data when drag/drop between editors.
+		 */
+		function ieInternalDragAndDrop() {
+			editor.on('dragstart', function(e) {
+				setMceInteralContent(e);
+			});
+
+			editor.on('drop', function(e) {
+				if (!isDefaultPrevented(e)) {
+					var internalContent = getMceInternalContent(e);
+					if (internalContent) {
+						e.preventDefault();
+
+						var rng = RangeUtils.getCaretRangeFromPoint(e.x, e.y, editor.getDoc());
+						selection.setRng(rng);
+						insertClipboardContents(internalContent);
+					}
+				}
+			});
+		}
+
+		// All browsers
+		removeBlockQuoteOnBackSpace();
+		emptyEditorWhenDeleting();
+		normalizeSelection();
+
+		// WebKit
+		if (isWebKit) {
+			cleanupStylesWhenDeleting();
+			inputMethodFocus();
+			selectControlElements();
+			setDefaultBlockType();
+			blockFormSubmitInsideEditor();
+			disableBackspaceIntoATable();
+			removeAppleInterchangeBrs();
+			touchClickEvent();
+
+			// iOS
+			if (Env.iOS) {
+				restoreFocusOnKeyDown();
+				bodyHeight();
+				tapLinksAndImages();
+			} else {
+				selectAll();
+			}
+		}
+
+		// IE
+		if (isIE && Env.ie < 11) {
+			removeHrOnBackspace();
+			ensureBodyHasRoleApplication();
+			addNewLinesBeforeBrInPre();
+			removePreSerializedStylesWhenSelectingControls();
+			deleteControlItemOnBackSpace();
+			renderEmptyBlocksFix();
+			keepNoScriptContents();
+			fixCaretSelectionOfDocumentElementOnIe();
+		}
+
+		if (Env.ie >= 11) {
+			bodyHeight();
+			doubleTrailingBrElements();
+			disableBackspaceIntoATable();
+		}
+
+		if (Env.ie) {
+			selectAll();
+			disableAutoUrlDetect();
+			ieInternalDragAndDrop();
+		}
+
+		// Gecko
+		if (isGecko) {
+			removeHrOnBackspace();
+			focusBody();
+			removeStylesWhenDeletingAcrossBlockElements();
+			setGeckoEditingOptions();
+			addBrAfterLastLinks();
+			removeGhostSelection();
+			showBrokenImageIcon();
+			blockCmdArrowNavigation();
+			disableBackspaceIntoATable();
+		}
+	};
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/Tools.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,520 @@
+/**
+ * Tools.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class contains various utlity functions. These are also exposed
+ * directly on the tinymce namespace.
+ *
+ * @class tinymce.util.Tools
+ */
+define("tinymce/util/Tools", [
+	"tinymce/Env"
+], function(Env) {
+	/**
+	 * Removes whitespace from the beginning and end of a string.
+	 *
+	 * @method trim
+	 * @param {String} s String to remove whitespace from.
+	 * @return {String} New string with removed whitespace.
+	 */
+	var whiteSpaceRegExp = /^\s*|\s*$/g;
+
+	function trim(str) {
+		return (str === null || str === undefined) ? '' : ("" + str).replace(whiteSpaceRegExp, '');
+	}
+
+	/**
+	 * Returns true/false if the object is an array or not.
+	 *
+	 * @method isArray
+	 * @param {Object} obj Object to check.
+	 * @return {boolean} true/false state if the object is an array or not.
+	 */
+	var isArray = Array.isArray || function(obj) {
+		return Object.prototype.toString.call(obj) === "[object Array]";
+	};
+
+	/**
+	 * Checks if a object is of a specific type for example an array.
+	 *
+	 * @method is
+	 * @param {Object} obj Object to check type of.
+	 * @param {string} type Optional type to check for.
+	 * @return {Boolean} true/false if the object is of the specified type.
+	 */
+	function is(obj, type) {
+		if (!type) {
+			return obj !== undefined;
+		}
+
+		if (type == 'array' && isArray(obj)) {
+			return true;
+		}
+
+		return typeof obj == type;
+	}
+
+	/**
+	 * Converts the specified object into a real JavaScript array.
+	 *
+	 * @method toArray
+	 * @param {Object} obj Object to convert into array.
+	 * @return {Array} Array object based in input.
+	 */
+	function toArray(obj) {
+		var array = obj, i, l;
+
+		if (!isArray(obj)) {
+			array = [];
+			for (i = 0, l = obj.length; i < l; i++) {
+				array[i] = obj[i];
+			}
+		}
+
+		return array;
+	}
+
+	/**
+	 * Makes a name/object map out of an array with names.
+	 *
+	 * @method makeMap
+	 * @param {Array/String} items Items to make map out of.
+	 * @param {String} delim Optional delimiter to split string by.
+	 * @param {Object} map Optional map to add items to.
+	 * @return {Object} Name/value map of items.
+	 */
+	function makeMap(items, delim, map) {
+		var i;
+
+		items = items || [];
+		delim = delim || ',';
+
+		if (typeof items == "string") {
+			items = items.split(delim);
+		}
+
+		map = map || {};
+
+		i = items.length;
+		while (i--) {
+			map[items[i]] = {};
+		}
+
+		return map;
+	}
+
+	/**
+	 * Performs an iteration of all items in a collection such as an object or array. This method will execure the
+	 * callback function for each item in the collection, if the callback returns false the iteration will terminate.
+	 * The callback has the following format: cb(value, key_or_index).
+	 *
+	 * @method each
+	 * @param {Object} o Collection to iterate.
+	 * @param {function} cb Callback function to execute for each item.
+	 * @param {Object} s Optional scope to execute the callback in.
+	 * @example
+	 * // Iterate an array
+	 * tinymce.each([1,2,3], function(v, i) {
+	 *     console.debug("Value: " + v + ", Index: " + i);
+	 * });
+	 *
+	 * // Iterate an object
+	 * tinymce.each({a: 1, b: 2, c: 3], function(v, k) {
+	 *     console.debug("Value: " + v + ", Key: " + k);
+	 * });
+	 */
+	function each(o, cb, s) {
+		var n, l;
+
+		if (!o) {
+			return 0;
+		}
+
+		s = s || o;
+
+		if (o.length !== undefined) {
+			// Indexed arrays, needed for Safari
+			for (n = 0, l = o.length; n < l; n++) {
+				if (cb.call(s, o[n], n, o) === false) {
+					return 0;
+				}
+			}
+		} else {
+			// Hashtables
+			for (n in o) {
+				if (o.hasOwnProperty(n)) {
+					if (cb.call(s, o[n], n, o) === false) {
+						return 0;
+					}
+				}
+			}
+		}
+
+		return 1;
+	}
+
+	/**
+	 * Creates a new array by the return value of each iteration function call. This enables you to convert
+	 * one array list into another.
+	 *
+	 * @method map
+	 * @param {Array} array Array of items to iterate.
+	 * @param {function} callback Function to call for each item. It's return value will be the new value.
+	 * @return {Array} Array with new values based on function return values.
+	 */
+	function map(array, callback) {
+		var out = [];
+
+		each(array, function(item) {
+			out.push(callback(item));
+		});
+
+		return out;
+	}
+
+	/**
+	 * Filters out items from the input array by calling the specified function for each item.
+	 * If the function returns false the item will be excluded if it returns true it will be included.
+	 *
+	 * @method grep
+	 * @param {Array} a Array of items to loop though.
+	 * @param {function} f Function to call for each item. Include/exclude depends on it's return value.
+	 * @return {Array} New array with values imported and filtered based in input.
+	 * @example
+	 * // Filter out some items, this will return an array with 4 and 5
+	 * var items = tinymce.grep([1,2,3,4,5], function(v) {return v > 3;});
+	 */
+	function grep(a, f) {
+		var o = [];
+
+		each(a, function(v) {
+			if (!f || f(v)) {
+				o.push(v);
+			}
+		});
+
+		return o;
+	}
+
+	/**
+	 * Creates a class, subclass or static singleton.
+	 * More details on this method can be found in the Wiki.
+	 *
+	 * @method create
+	 * @param {String} s Class name, inheritage and prefix.
+	 * @param {Object} p Collection of methods to add to the class.
+	 * @param {Object} root Optional root object defaults to the global window object.
+	 * @example
+	 * // Creates a basic class
+	 * tinymce.create('tinymce.somepackage.SomeClass', {
+	 *     SomeClass: function() {
+	 *         // Class constructor
+	 *     },
+	 *
+	 *     method: function() {
+	 *         // Some method
+	 *     }
+	 * });
+	 *
+	 * // Creates a basic subclass class
+	 * tinymce.create('tinymce.somepackage.SomeSubClass:tinymce.somepackage.SomeClass', {
+	 *     SomeSubClass: function() {
+	 *         // Class constructor
+	 *         this.parent(); // Call parent constructor
+	 *     },
+	 *
+	 *     method: function() {
+	 *         // Some method
+	 *         this.parent(); // Call parent method
+	 *     },
+	 *
+	 *     'static': {
+	 *         staticMethod: function() {
+	 *             // Static method
+	 *         }
+	 *     }
+	 * });
+	 *
+	 * // Creates a singleton/static class
+	 * tinymce.create('static tinymce.somepackage.SomeSingletonClass', {
+	 *     method: function() {
+	 *         // Some method
+	 *     }
+	 * });
+	 */
+	function create(s, p, root) {
+		var self = this, sp, ns, cn, scn, c, de = 0;
+
+		// Parse : <prefix> <class>:<super class>
+		s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s);
+		cn = s[3].match(/(^|\.)(\w+)$/i)[2]; // Class name
+
+		// Create namespace for new class
+		ns = self.createNS(s[3].replace(/\.\w+$/, ''), root);
+
+		// Class already exists
+		if (ns[cn]) {
+			return;
+		}
+
+		// Make pure static class
+		if (s[2] == 'static') {
+			ns[cn] = p;
+
+			if (this.onCreate) {
+				this.onCreate(s[2], s[3], ns[cn]);
+			}
+
+			return;
+		}
+
+		// Create default constructor
+		if (!p[cn]) {
+			p[cn] = function() {};
+			de = 1;
+		}
+
+		// Add constructor and methods
+		ns[cn] = p[cn];
+		self.extend(ns[cn].prototype, p);
+
+		// Extend
+		if (s[5]) {
+			sp = self.resolve(s[5]).prototype;
+			scn = s[5].match(/\.(\w+)$/i)[1]; // Class name
+
+			// Extend constructor
+			c = ns[cn];
+			if (de) {
+				// Add passthrough constructor
+				ns[cn] = function() {
+					return sp[scn].apply(this, arguments);
+				};
+			} else {
+				// Add inherit constructor
+				ns[cn] = function() {
+					this.parent = sp[scn];
+					return c.apply(this, arguments);
+				};
+			}
+			ns[cn].prototype[cn] = ns[cn];
+
+			// Add super methods
+			self.each(sp, function(f, n) {
+				ns[cn].prototype[n] = sp[n];
+			});
+
+			// Add overridden methods
+			self.each(p, function(f, n) {
+				// Extend methods if needed
+				if (sp[n]) {
+					ns[cn].prototype[n] = function() {
+						this.parent = sp[n];
+						return f.apply(this, arguments);
+					};
+				} else {
+					if (n != cn) {
+						ns[cn].prototype[n] = f;
+					}
+				}
+			});
+		}
+
+		// Add static methods
+		/*jshint sub:true*/
+		/*eslint dot-notation:0*/
+		self.each(p['static'], function(f, n) {
+			ns[cn][n] = f;
+		});
+	}
+
+	/**
+	 * Returns the index of a value in an array, this method will return -1 if the item wasn't found.
+	 *
+	 * @method inArray
+	 * @param {Array} a Array/Object to search for value in.
+	 * @param {Object} v Value to check for inside the array.
+	 * @return {Number/String} Index of item inside the array inside an object. Or -1 if it wasn't found.
+	 * @example
+	 * // Get index of value in array this will alert 1 since 2 is at that index
+	 * alert(tinymce.inArray([1,2,3], 2));
+	 */
+	function inArray(a, v) {
+		var i, l;
+
+		if (a) {
+			for (i = 0, l = a.length; i < l; i++) {
+				if (a[i] === v) {
+					return i;
+				}
+			}
+		}
+
+		return -1;
+	}
+
+	function extend(obj, ext) {
+		var i, l, name, args = arguments, value;
+
+		for (i = 1, l = args.length; i < l; i++) {
+			ext = args[i];
+			for (name in ext) {
+				if (ext.hasOwnProperty(name)) {
+					value = ext[name];
+
+					if (value !== undefined) {
+						obj[name] = value;
+					}
+				}
+			}
+		}
+
+		return obj;
+	}
+
+	/**
+	 * Executed the specified function for each item in a object tree.
+	 *
+	 * @method walk
+	 * @param {Object} o Object tree to walk though.
+	 * @param {function} f Function to call for each item.
+	 * @param {String} n Optional name of collection inside the objects to walk for example childNodes.
+	 * @param {String} s Optional scope to execute the function in.
+	 */
+	function walk(o, f, n, s) {
+		s = s || this;
+
+		if (o) {
+			if (n) {
+				o = o[n];
+			}
+
+			each(o, function(o, i) {
+				if (f.call(s, o, i, n) === false) {
+					return false;
+				}
+
+				walk(o, f, n, s);
+			});
+		}
+	}
+
+	/**
+	 * Creates a namespace on a specific object.
+	 *
+	 * @method createNS
+	 * @param {String} n Namespace to create for example a.b.c.d.
+	 * @param {Object} o Optional object to add namespace to, defaults to window.
+	 * @return {Object} New namespace object the last item in path.
+	 * @example
+	 * // Create some namespace
+	 * tinymce.createNS('tinymce.somepackage.subpackage');
+	 *
+	 * // Add a singleton
+	 * var tinymce.somepackage.subpackage.SomeSingleton = {
+	 *     method: function() {
+	 *         // Some method
+	 *     }
+	 * };
+	 */
+	function createNS(n, o) {
+		var i, v;
+
+		o = o || window;
+
+		n = n.split('.');
+		for (i = 0; i < n.length; i++) {
+			v = n[i];
+
+			if (!o[v]) {
+				o[v] = {};
+			}
+
+			o = o[v];
+		}
+
+		return o;
+	}
+
+	/**
+	 * Resolves a string and returns the object from a specific structure.
+	 *
+	 * @method resolve
+	 * @param {String} n Path to resolve for example a.b.c.d.
+	 * @param {Object} o Optional object to search though, defaults to window.
+	 * @return {Object} Last object in path or null if it couldn't be resolved.
+	 * @example
+	 * // Resolve a path into an object reference
+	 * var obj = tinymce.resolve('a.b.c.d');
+	 */
+	function resolve(n, o) {
+		var i, l;
+
+		o = o || window;
+
+		n = n.split('.');
+		for (i = 0, l = n.length; i < l; i++) {
+			o = o[n[i]];
+
+			if (!o) {
+				break;
+			}
+		}
+
+		return o;
+	}
+
+	/**
+	 * Splits a string but removes the whitespace before and after each value.
+	 *
+	 * @method explode
+	 * @param {string} s String to split.
+	 * @param {string} d Delimiter to split by.
+	 * @example
+	 * // Split a string into an array with a,b,c
+	 * var arr = tinymce.explode('a, b,   c');
+	 */
+	function explode(s, d) {
+		if (!s || is(s, 'array')) {
+			return s;
+		}
+
+		return map(s.split(d || ','), trim);
+	}
+
+	function _addCacheSuffix(url) {
+		var cacheSuffix = Env.cacheSuffix;
+
+		if (cacheSuffix) {
+			url += (url.indexOf('?') === -1 ? '?' : '&') + cacheSuffix;
+		}
+
+		return url;
+	}
+
+	return {
+		trim: trim,
+		isArray: isArray,
+		is: is,
+		toArray: toArray,
+		makeMap: makeMap,
+		each: each,
+		map: map,
+		grep: grep,
+		inArray: inArray,
+		extend: extend,
+		create: create,
+		walk: walk,
+		createNS: createNS,
+		resolve: resolve,
+		explode: explode,
+		_addCacheSuffix: _addCacheSuffix
+	};
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/URI.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,395 @@
+/**
+ * URI.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles parsing, modification and serialization of URI/URL strings.
+ * @class tinymce.util.URI
+ */
+define("tinymce/util/URI", [
+	"tinymce/util/Tools"
+], function(Tools) {
+	var each = Tools.each, trim = Tools.trim;
+	var queryParts = "source protocol authority userInfo user password host port relative path directory file query anchor".split(' ');
+	var DEFAULT_PORTS = {
+		'ftp': 21,
+		'http': 80,
+		'https': 443,
+		'mailto': 25
+	};
+
+	/**
+	 * Constructs a new URI instance.
+	 *
+	 * @constructor
+	 * @method URI
+	 * @param {String} url URI string to parse.
+	 * @param {Object} settings Optional settings object.
+	 */
+	function URI(url, settings) {
+		var self = this, baseUri, base_url;
+
+		url = trim(url);
+		settings = self.settings = settings || {};
+		baseUri = settings.base_uri;
+
+		// Strange app protocol that isn't http/https or local anchor
+		// For example: mailto,skype,tel etc.
+		if (/^([\w\-]+):([^\/]{2})/i.test(url) || /^\s*#/.test(url)) {
+			self.source = url;
+			return;
+		}
+
+		var isProtocolRelative = url.indexOf('//') === 0;
+
+		// Absolute path with no host, fake host and protocol
+		if (url.indexOf('/') === 0 && !isProtocolRelative) {
+			url = (baseUri ? baseUri.protocol || 'http' : 'http') + '://mce_host' + url;
+		}
+
+		// Relative path http:// or protocol relative //path
+		if (!/^[\w\-]*:?\/\//.test(url)) {
+			base_url = settings.base_uri ? settings.base_uri.path : new URI(location.href).directory;
+			if (settings.base_uri.protocol === "") {
+				url = '//mce_host' + self.toAbsPath(base_url, url);
+			} else {
+				url = /([^#?]*)([#?]?.*)/.exec(url);
+				url = ((baseUri && baseUri.protocol) || 'http') + '://mce_host' + self.toAbsPath(base_url, url[1]) + url[2];
+			}
+		}
+
+		// Parse URL (Credits goes to Steave, http://blog.stevenlevithan.com/archives/parseuri)
+		url = url.replace(/@@/g, '(mce_at)'); // Zope 3 workaround, they use @@something
+
+		/*jshint maxlen: 255 */
+		/*eslint max-len: 0 */
+		url = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(url);
+
+		each(queryParts, function(v, i) {
+			var part = url[i];
+
+			// Zope 3 workaround, they use @@something
+			if (part) {
+				part = part.replace(/\(mce_at\)/g, '@@');
+			}
+
+			self[v] = part;
+		});
+
+		if (baseUri) {
+			if (!self.protocol) {
+				self.protocol = baseUri.protocol;
+			}
+
+			if (!self.userInfo) {
+				self.userInfo = baseUri.userInfo;
+			}
+
+			if (!self.port && self.host === 'mce_host') {
+				self.port = baseUri.port;
+			}
+
+			if (!self.host || self.host === 'mce_host') {
+				self.host = baseUri.host;
+			}
+
+			self.source = '';
+		}
+
+		if (isProtocolRelative) {
+			self.protocol = '';
+		}
+
+		//t.path = t.path || '/';
+	}
+
+	URI.prototype = {
+		/**
+		 * Sets the internal path part of the URI.
+		 *
+		 * @method setPath
+		 * @param {string} path Path string to set.
+		 */
+		setPath: function(path) {
+			var self = this;
+
+			path = /^(.*?)\/?(\w+)?$/.exec(path);
+
+			// Update path parts
+			self.path = path[0];
+			self.directory = path[1];
+			self.file = path[2];
+
+			// Rebuild source
+			self.source = '';
+			self.getURI();
+		},
+
+		/**
+		 * Converts the specified URI into a relative URI based on the current URI instance location.
+		 *
+		 * @method toRelative
+		 * @param {String} uri URI to convert into a relative path/URI.
+		 * @return {String} Relative URI from the point specified in the current URI instance.
+		 * @example
+		 * // Converts an absolute URL to an relative URL url will be somedir/somefile.htm
+		 * var url = new tinymce.util.URI('http://www.site.com/dir/').toRelative('http://www.site.com/dir/somedir/somefile.htm');
+		 */
+		toRelative: function(uri) {
+			var self = this, output;
+
+			if (uri === "./") {
+				return uri;
+			}
+
+			uri = new URI(uri, {base_uri: self});
+
+			// Not on same domain/port or protocol
+			if ((uri.host != 'mce_host' && self.host != uri.host && uri.host) || self.port != uri.port ||
+				(self.protocol != uri.protocol && uri.protocol !== "")) {
+				return uri.getURI();
+			}
+
+			var tu = self.getURI(), uu = uri.getURI();
+
+			// Allow usage of the base_uri when relative_urls = true
+			if (tu == uu || (tu.charAt(tu.length - 1) == "/" && tu.substr(0, tu.length - 1) == uu)) {
+				return tu;
+			}
+
+			output = self.toRelPath(self.path, uri.path);
+
+			// Add query
+			if (uri.query) {
+				output += '?' + uri.query;
+			}
+
+			// Add anchor
+			if (uri.anchor) {
+				output += '#' + uri.anchor;
+			}
+
+			return output;
+		},
+
+		/**
+		 * Converts the specified URI into a absolute URI based on the current URI instance location.
+		 *
+		 * @method toAbsolute
+		 * @param {String} uri URI to convert into a relative path/URI.
+		 * @param {Boolean} noHost No host and protocol prefix.
+		 * @return {String} Absolute URI from the point specified in the current URI instance.
+		 * @example
+		 * // Converts an relative URL to an absolute URL url will be http://www.site.com/dir/somedir/somefile.htm
+		 * var url = new tinymce.util.URI('http://www.site.com/dir/').toAbsolute('somedir/somefile.htm');
+		 */
+		toAbsolute: function(uri, noHost) {
+			uri = new URI(uri, {base_uri: this});
+
+			return uri.getURI(noHost && this.isSameOrigin(uri));
+		},
+
+		/**
+		 * Determine whether the given URI has the same origin as this URI.  Based on RFC-6454.
+		 * Supports default ports for protocols listed in DEFAULT_PORTS.  Unsupported protocols will fail safe: they
+		 * won't match, if the port specifications differ.
+		 *
+		 * @method isSameOrigin
+		 * @param {tinymce.util.URI} uri Uri instance to compare.
+		 * @returns {Boolean} True if the origins are the same.
+		 */
+		isSameOrigin: function(uri) {
+			if (this.host == uri.host && this.protocol == uri.protocol) {
+				if (this.port == uri.port) {
+					return true;
+				}
+
+				var defaultPort = DEFAULT_PORTS[this.protocol];
+				if (defaultPort && ((this.port || defaultPort) == (uri.port || defaultPort))) {
+					return true;
+				}
+			}
+
+			return false;
+		},
+
+		/**
+		 * Converts a absolute path into a relative path.
+		 *
+		 * @method toRelPath
+		 * @param {String} base Base point to convert the path from.
+		 * @param {String} path Absolute path to convert into a relative path.
+		 */
+		toRelPath: function(base, path) {
+			var items, breakPoint = 0, out = '', i, l;
+
+			// Split the paths
+			base = base.substring(0, base.lastIndexOf('/'));
+			base = base.split('/');
+			items = path.split('/');
+
+			if (base.length >= items.length) {
+				for (i = 0, l = base.length; i < l; i++) {
+					if (i >= items.length || base[i] != items[i]) {
+						breakPoint = i + 1;
+						break;
+					}
+				}
+			}
+
+			if (base.length < items.length) {
+				for (i = 0, l = items.length; i < l; i++) {
+					if (i >= base.length || base[i] != items[i]) {
+						breakPoint = i + 1;
+						break;
+					}
+				}
+			}
+
+			if (breakPoint === 1) {
+				return path;
+			}
+
+			for (i = 0, l = base.length - (breakPoint - 1); i < l; i++) {
+				out += "../";
+			}
+
+			for (i = breakPoint - 1, l = items.length; i < l; i++) {
+				if (i != breakPoint - 1) {
+					out += "/" + items[i];
+				} else {
+					out += items[i];
+				}
+			}
+
+			return out;
+		},
+
+		/**
+		 * Converts a relative path into a absolute path.
+		 *
+		 * @method toAbsPath
+		 * @param {String} base Base point to convert the path from.
+		 * @param {String} path Relative path to convert into an absolute path.
+		 */
+		toAbsPath: function(base, path) {
+			var i, nb = 0, o = [], tr, outPath;
+
+			// Split paths
+			tr = /\/$/.test(path) ? '/' : '';
+			base = base.split('/');
+			path = path.split('/');
+
+			// Remove empty chunks
+			each(base, function(k) {
+				if (k) {
+					o.push(k);
+				}
+			});
+
+			base = o;
+
+			// Merge relURLParts chunks
+			for (i = path.length - 1, o = []; i >= 0; i--) {
+				// Ignore empty or .
+				if (path[i].length === 0 || path[i] === ".") {
+					continue;
+				}
+
+				// Is parent
+				if (path[i] === '..') {
+					nb++;
+					continue;
+				}
+
+				// Move up
+				if (nb > 0) {
+					nb--;
+					continue;
+				}
+
+				o.push(path[i]);
+			}
+
+			i = base.length - nb;
+
+			// If /a/b/c or /
+			if (i <= 0) {
+				outPath = o.reverse().join('/');
+			} else {
+				outPath = base.slice(0, i).join('/') + '/' + o.reverse().join('/');
+			}
+
+			// Add front / if it's needed
+			if (outPath.indexOf('/') !== 0) {
+				outPath = '/' + outPath;
+			}
+
+			// Add traling / if it's needed
+			if (tr && outPath.lastIndexOf('/') !== outPath.length - 1) {
+				outPath += tr;
+			}
+
+			return outPath;
+		},
+
+		/**
+		 * Returns the full URI of the internal structure.
+		 *
+		 * @method getURI
+		 * @param {Boolean} noProtoHost Optional no host and protocol part. Defaults to false.
+		 */
+		getURI: function(noProtoHost) {
+			var s, self = this;
+
+			// Rebuild source
+			if (!self.source || noProtoHost) {
+				s = '';
+
+				if (!noProtoHost) {
+					if (self.protocol) {
+						s += self.protocol + '://';
+					} else {
+						s += '//';
+					}
+
+					if (self.userInfo) {
+						s += self.userInfo + '@';
+					}
+
+					if (self.host) {
+						s += self.host;
+					}
+
+					if (self.port) {
+						s += ':' + self.port;
+					}
+				}
+
+				if (self.path) {
+					s += self.path;
+				}
+
+				if (self.query) {
+					s += '?' + self.query;
+				}
+
+				if (self.anchor) {
+					s += '#' + self.anchor;
+				}
+
+				self.source = s;
+			}
+
+			return self.source;
+		}
+	};
+
+	return URI;
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/VK.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,37 @@
+/**
+ * VK.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This file exposes a set of the common KeyCodes for use.  Please grow it as needed.
+ */
+define("tinymce/util/VK", [
+	"tinymce/Env"
+], function(Env) {
+	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 || this.metaKeyPressed(e);
+		},
+
+		metaKeyPressed: function(e) {
+			// Check if ctrl or meta key is pressed. Edge case for AltGr on Windows where it produces ctrlKey+altKey states
+			return (Env.mac ? e.metaKey : e.ctrlKey && !e.altKey);
+		}
+	};
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/XHR.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,102 @@
+/**
+ * XHR.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class enables you to send XMLHTTPRequests cross browser.
+ * @class tinymce.util.XHR
+ * @mixes tinymce.util.Observable
+ * @static
+ * @example
+ * // Sends a low level Ajax request
+ * tinymce.util.XHR.send({
+ *    url: 'someurl',
+ *    success: function(text) {
+ *       console.debug(text);
+ *    }
+ * });
+ *
+ * // Add custom header to XHR request
+ * tinymce.util.XHR.on('beforeSend', function(e) {
+ *     e.xhr.setRequestHeader('X-Requested-With', 'Something');
+ * });
+ */
+define("tinymce/util/XHR", [
+	"tinymce/util/Observable",
+	"tinymce/util/Tools"
+], function(Observable, Tools) {
+	var XHR = {
+		/**
+		 * Sends a XMLHTTPRequest.
+		 * Consult the Wiki for details on what settings this method takes.
+		 *
+		 * @method send
+		 * @param {Object} settings Object will target URL, callbacks and other info needed to make the request.
+		 */
+		send: function(settings) {
+			var xhr, count = 0;
+
+			function ready() {
+				if (!settings.async || xhr.readyState == 4 || count++ > 10000) {
+					if (settings.success && count < 10000 && xhr.status == 200) {
+						settings.success.call(settings.success_scope, '' + xhr.responseText, xhr, settings);
+					} else if (settings.error) {
+						settings.error.call(settings.error_scope, count > 10000 ? 'TIMED_OUT' : 'GENERAL', xhr, settings);
+					}
+
+					xhr = null;
+				} else {
+					setTimeout(ready, 10);
+				}
+			}
+
+			// Default settings
+			settings.scope = settings.scope || this;
+			settings.success_scope = settings.success_scope || settings.scope;
+			settings.error_scope = settings.error_scope || settings.scope;
+			settings.async = settings.async === false ? false : true;
+			settings.data = settings.data || '';
+
+			xhr = new XMLHttpRequest();
+
+			if (xhr) {
+				if (xhr.overrideMimeType) {
+					xhr.overrideMimeType(settings.content_type);
+				}
+
+				xhr.open(settings.type || (settings.data ? 'POST' : 'GET'), settings.url, settings.async);
+
+				if (settings.crossDomain) {
+					xhr.withCredentials = true;
+				}
+
+				if (settings.content_type) {
+					xhr.setRequestHeader('Content-Type', settings.content_type);
+				}
+
+				xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
+
+				xhr = XHR.fire('beforeSend', {xhr: xhr, settings: settings}).xhr;
+				xhr.send(settings.data);
+
+				// Syncronous request
+				if (!settings.async) {
+					return ready();
+				}
+
+				// Wait for response, onReadyStateChange can not be used since it leaks memory in IE
+				setTimeout(ready, 10);
+			}
+		}
+	};
+
+	Tools.extend(XHR, Observable);
+
+	return XHR;
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/jquery.tinymce.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,377 @@
+/**
+ * jquery.tinymce.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true, jQuery */
+
+(function($) {
+	var undef,
+		lazyLoading,
+		patchApplied,
+		delayedInits = [],
+		win = window;
+
+	$.fn.tinymce = function(settings) {
+		var self = this, url, base, lang, suffix = "";
+
+		// No match then just ignore the call
+		if (!self.length) {
+			return self;
+		}
+
+		// Get editor instance
+		if (!settings) {
+			return window.tinymce ? tinymce.get(self[0].id) : null;
+		}
+
+		self.css('visibility', 'hidden'); // Hide textarea to avoid flicker
+
+		function init() {
+			var editors = [], initCount = 0;
+
+			// Apply patches to the jQuery object, only once
+			if (!patchApplied) {
+				applyPatch();
+				patchApplied = true;
+			}
+
+			// Create an editor instance for each matched node
+			self.each(function(i, node) {
+				var ed, id = node.id, oninit = settings.oninit;
+
+				// Generate unique id for target element if needed
+				if (!id) {
+					node.id = id = tinymce.DOM.uniqueId();
+				}
+
+				// Only init the editor once
+				if (tinymce.get(id)) {
+					return;
+				}
+
+				// Create editor instance and render it
+				ed = new tinymce.Editor(id, settings, tinymce.EditorManager);
+				editors.push(ed);
+
+				ed.on('init', function() {
+					var scope, func = oninit;
+
+					self.css('visibility', '');
+
+					// Run this if the oninit setting is defined
+					// this logic will fire the oninit callback ones each
+					// matched editor instance is initialized
+					if (oninit) {
+						// Fire the oninit event ones each editor instance is initialized
+						if (++initCount == editors.length) {
+							if (typeof func === "string") {
+								scope = (func.indexOf(".") === -1) ? null : tinymce.resolve(func.replace(/\.\w+$/, ""));
+								func = tinymce.resolve(func);
+							}
+
+							// Call the oninit function with the object
+							func.apply(scope || tinymce, editors);
+						}
+					}
+				});
+			});
+
+			// Render the editor instances in a separate loop since we
+			// need to have the full editors array used in the onInit calls
+			$.each(editors, function(i, ed) {
+				ed.render();
+			});
+		}
+
+		// Load TinyMCE on demand, if we need to
+		if (!win.tinymce && !lazyLoading && (url = settings.script_url)) {
+			lazyLoading = 1;
+			base = url.substring(0, url.lastIndexOf("/"));
+
+			// Check if it's a dev/src version they want to load then
+			// make sure that all plugins, themes etc are loaded in source mode as well
+			if (url.indexOf('.min') != -1) {
+				suffix = ".min";
+			}
+
+			// Setup tinyMCEPreInit object this will later be used by the TinyMCE
+			// core script to locate other resources like CSS files, dialogs etc
+			// You can also predefined a tinyMCEPreInit object and then it will use that instead
+			win.tinymce = win.tinyMCEPreInit || {
+				base: base,
+				suffix: suffix
+			};
+
+			// url contains gzip then we assume it's a compressor
+			if (url.indexOf('gzip') != -1) {
+				lang = settings.language || "en";
+				url = url + (/\?/.test(url) ? '&' : '?') + "js=true&core=true&suffix=" + escape(suffix) +
+					"&themes=" + escape(settings.theme || 'modern') + "&plugins=" +
+					escape(settings.plugins || '') + "&languages=" + (lang || '');
+
+				// Check if compressor script is already loaded otherwise setup a basic one
+				if (!win.tinyMCE_GZ) {
+					win.tinyMCE_GZ = {
+						start: function() {
+							function load(url) {
+								tinymce.ScriptLoader.markDone(tinymce.baseURI.toAbsolute(url));
+							}
+
+							// Add core languages
+							load("langs/" + lang + ".js");
+
+							// Add themes with languages
+							load("themes/" + settings.theme + "/theme" + suffix + ".js");
+							load("themes/" + settings.theme + "/langs/" + lang + ".js");
+
+							// Add plugins with languages
+							$.each(settings.plugins.split(","), function(i, name) {
+								if (name) {
+									load("plugins/" + name + "/plugin" + suffix + ".js");
+									load("plugins/" + name + "/langs/" + lang + ".js");
+								}
+							});
+						},
+
+						end: function() {
+						}
+					};
+				}
+			}
+
+			var script = document.createElement('script');
+			script.type = 'text/javascript';
+			script.onload = script.onreadystatechange = function(e) {
+				e = e || window.event;
+
+				if (lazyLoading !== 2 && (e.type == 'load' || /complete|loaded/.test(script.readyState))) {
+					tinymce.dom.Event.domLoaded = 1;
+					lazyLoading = 2;
+
+					// Execute callback after mainscript has been loaded and before the initialization occurs
+					if (settings.script_loaded) {
+						settings.script_loaded();
+					}
+
+					init();
+
+					$.each(delayedInits, function(i, init) {
+						init();
+					});
+				}
+			};
+			script.src = url;
+			document.body.appendChild(script);
+		} else {
+			// Delay the init call until tinymce is loaded
+			if (lazyLoading === 1) {
+				delayedInits.push(init);
+			} else {
+				init();
+			}
+		}
+
+		return self;
+	};
+
+	// Add :tinymce psuedo selector this will select elements that has been converted into editor instances
+	// it's now possible to use things like $('*:tinymce') to get all TinyMCE bound elements.
+	$.extend($.expr[":"], {
+		tinymce: function(e) {
+			var editor;
+
+			if (e.id && "tinymce" in window) {
+				editor = tinymce.get(e.id);
+
+				if (editor && editor.editorManager === tinymce) {
+					return true;
+				}
+			}
+
+			return false;
+		}
+	});
+
+	// This function patches internal jQuery functions so that if
+	// you for example remove an div element containing an editor it's
+	// automatically destroyed by the TinyMCE API
+	function applyPatch() {
+		// Removes any child editor instances by looking for editor wrapper elements
+		function removeEditors(name) {
+			// If the function is remove
+			if (name === "remove") {
+				this.each(function(i, node) {
+					var ed = tinyMCEInstance(node);
+
+					if (ed) {
+						ed.remove();
+					}
+				});
+			}
+
+			this.find("span.mceEditor,div.mceEditor").each(function(i, node) {
+				var ed = tinymce.get(node.id.replace(/_parent$/, ""));
+
+				if (ed) {
+					ed.remove();
+				}
+			});
+		}
+
+		// Loads or saves contents from/to textarea if the value
+		// argument is defined it will set the TinyMCE internal contents
+		function loadOrSave(value) {
+			var self = this, ed;
+
+			// Handle set value
+			/*jshint eqnull:true */
+			if (value != null) {
+				removeEditors.call(self);
+
+				// Saves the contents before get/set value of textarea/div
+				self.each(function(i, node) {
+					var ed;
+
+					if ((ed = tinymce.get(node.id))) {
+						ed.setContent(value);
+					}
+				});
+			} else if (self.length > 0) {
+				// Handle get value
+				if ((ed = tinymce.get(self[0].id))) {
+					return ed.getContent();
+				}
+			}
+		}
+
+		// Returns tinymce instance for the specified element or null if it wasn't found
+		function tinyMCEInstance(element) {
+			var ed = null;
+
+			if (element && element.id && win.tinymce) {
+				ed = tinymce.get(element.id);
+			}
+
+			return ed;
+		}
+
+		// Checks if the specified set contains tinymce instances
+		function containsTinyMCE(matchedSet) {
+			return !!((matchedSet) && (matchedSet.length) && (win.tinymce) && (matchedSet.is(":tinymce")));
+		}
+
+		// Patch various jQuery functions
+		var jQueryFn = {};
+
+		// Patch some setter/getter functions these will
+		// now be able to set/get the contents of editor instances for
+		// example $('#editorid').html('Content'); will update the TinyMCE iframe instance
+		$.each(["text", "html", "val"], function(i, name) {
+			var origFn = jQueryFn[name] = $.fn[name],
+				textProc = (name === "text");
+
+			$.fn[name] = function(value) {
+				var self = this;
+
+				if (!containsTinyMCE(self)) {
+					return origFn.apply(self, arguments);
+				}
+
+				if (value !== undef) {
+					loadOrSave.call(self.filter(":tinymce"), value);
+					origFn.apply(self.not(":tinymce"), arguments);
+
+					return self; // return original set for chaining
+				} else {
+					var ret = "";
+					var args = arguments;
+
+					(textProc ? self : self.eq(0)).each(function(i, node) {
+						var ed = tinyMCEInstance(node);
+
+						if (ed) {
+							ret += textProc ? ed.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g, "") : ed.getContent({save: true});
+						} else {
+							ret += origFn.apply($(node), args);
+						}
+					});
+
+					return ret;
+				}
+			};
+		});
+
+		// Makes it possible to use $('#id').append("content"); to append contents to the TinyMCE editor iframe
+		$.each(["append", "prepend"], function(i, name) {
+			var origFn = jQueryFn[name] = $.fn[name],
+				prepend = (name === "prepend");
+
+			$.fn[name] = function(value) {
+				var self = this;
+
+				if (!containsTinyMCE(self)) {
+					return origFn.apply(self, arguments);
+				}
+
+				if (value !== undef) {
+					if (typeof value === "string") {
+						self.filter(":tinymce").each(function(i, node) {
+							var ed = tinyMCEInstance(node);
+
+							if (ed) {
+								ed.setContent(prepend ? value + ed.getContent() : ed.getContent() + value);
+							}
+						});
+					}
+
+					origFn.apply(self.not(":tinymce"), arguments);
+
+					return self; // return original set for chaining
+				}
+			};
+		});
+
+		// Makes sure that the editor instance gets properly destroyed when the parent element is removed
+		$.each(["remove", "replaceWith", "replaceAll", "empty"], function(i, name) {
+			var origFn = jQueryFn[name] = $.fn[name];
+
+			$.fn[name] = function() {
+				removeEditors.call(this, name);
+
+				return origFn.apply(this, arguments);
+			};
+		});
+
+		jQueryFn.attr = $.fn.attr;
+
+		// Makes sure that $('#tinymce_id').attr('value') gets the editors current HTML contents
+		$.fn.attr = function(name, value) {
+			var self = this, args = arguments;
+
+			if ((!name) || (name !== "value") || (!containsTinyMCE(self))) {
+				if (value !== undef) {
+					return jQueryFn.attr.apply(self, args);
+				} else {
+					return jQueryFn.attr.apply(self, args);
+				}
+			}
+
+			if (value !== undef) {
+				loadOrSave.call(self.filter(":tinymce"), value);
+				jQueryFn.attr.apply(self.not(":tinymce"), args);
+
+				return self; // return original set for chaining
+			} else {
+				var node = self[0], ed = tinyMCEInstance(node);
+
+				return ed ? ed.getContent({save: true}) : jQueryFn.attr.apply($(node), args);
+			}
+		};
+	}
+})(jQuery);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/jquery.tinymce.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+(function(d){var b,f,c,a=[],e=window;d.fn.tinymce=function(k){var i=this,j,l,o,m="";if(!i.length){return i}if(!k){return window.tinymce?tinymce.get(i[0].id):null}i.css("visibility","hidden");function n(){var q=[],p=0;if(!c){g();c=true}i.each(function(s,t){var r,v=t.id,u=k.oninit;if(!v){t.id=v=tinymce.DOM.uniqueId()}if(tinymce.get(v)){return}r=new tinymce.Editor(v,k,tinymce.EditorManager);q.push(r);r.on("init",function(){var w,x=u;i.css("visibility","");if(u){if(++p==q.length){if(typeof x==="string"){w=(x.indexOf(".")===-1)?null:tinymce.resolve(x.replace(/\.\w+$/,""));x=tinymce.resolve(x)}x.apply(w||tinymce,q)}}})});d.each(q,function(s,r){r.render()})}if(!e.tinymce&&!f&&(j=k.script_url)){f=1;l=j.substring(0,j.lastIndexOf("/"));if(j.indexOf(".min")!=-1){m=".min"}e.tinymce=e.tinyMCEPreInit||{base:l,suffix:m};if(j.indexOf("gzip")!=-1){o=k.language||"en";j=j+(/\?/.test(j)?"&":"?")+"js=true&core=true&suffix="+escape(m)+"&themes="+escape(k.theme||"modern")+"&plugins="+escape(k.plugins||"")+"&languages="+(o||"");if(!e.tinyMCE_GZ){e.tinyMCE_GZ={start:function(){function p(q){tinymce.ScriptLoader.markDone(tinymce.baseURI.toAbsolute(q))}p("langs/"+o+".js");p("themes/"+k.theme+"/theme"+m+".js");p("themes/"+k.theme+"/langs/"+o+".js");d.each(k.plugins.split(","),function(r,q){if(q){p("plugins/"+q+"/plugin"+m+".js");p("plugins/"+q+"/langs/"+o+".js")}})},end:function(){}}}}var h=document.createElement("script");h.type="text/javascript";h.onload=h.onreadystatechange=function(p){p=p||window.event;if(f!==2&&(p.type=="load"||/complete|loaded/.test(h.readyState))){tinymce.dom.Event.domLoaded=1;f=2;if(k.script_loaded){k.script_loaded()}n();d.each(a,function(q,r){r()})}};h.src=j;document.body.appendChild(h)}else{if(f===1){a.push(n)}else{n()}}return i};d.extend(d.expr[":"],{tinymce:function(i){var h;if(i.id&&"tinymce" in window){h=tinymce.get(i.id);if(h&&h.editorManager===tinymce){return true}}return false}});function g(){function j(m){if(m==="remove"){this.each(function(o,p){var n=i(p);if(n){n.remove()}})}this.find("span.mceEditor,div.mceEditor").each(function(o,p){var n=tinymce.get(p.id.replace(/_parent$/,""));if(n){n.remove()}})}function l(o){var n=this,m;if(o!=null){j.call(n);n.each(function(q,r){var p;if((p=tinymce.get(r.id))){p.setContent(o)}})}else{if(n.length>0){if((m=tinymce.get(n[0].id))){return m.getContent()}}}}function i(n){var m=null;if(n&&n.id&&e.tinymce){m=tinymce.get(n.id)}return m}function h(m){return !!((m)&&(m.length)&&(e.tinymce)&&(m.is(":tinymce")))}var k={};d.each(["text","html","val"],function(o,m){var p=k[m]=d.fn[m],n=(m==="text");d.fn[m]=function(t){var q=this;if(!h(q)){return p.apply(q,arguments)}if(t!==b){l.call(q.filter(":tinymce"),t);p.apply(q.not(":tinymce"),arguments);return q}else{var s="";var r=arguments;(n?q:q.eq(0)).each(function(v,w){var u=i(w);if(u){s+=n?u.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):u.getContent({save:true})}else{s+=p.apply(d(w),r)}});return s}}});d.each(["append","prepend"],function(o,n){var p=k[n]=d.fn[n],m=(n==="prepend");d.fn[n]=function(r){var q=this;if(!h(q)){return p.apply(q,arguments)}if(r!==b){if(typeof r==="string"){q.filter(":tinymce").each(function(t,u){var s=i(u);if(s){s.setContent(m?r+s.getContent():s.getContent()+r)}})}p.apply(q.not(":tinymce"),arguments);return q}}});d.each(["remove","replaceWith","replaceAll","empty"],function(n,m){var o=k[m]=d.fn[m];d.fn[m]=function(){j.call(this,m);return o.apply(this,arguments)}});k.attr=d.fn.attr;d.fn.attr=function(p,r){var n=this,o=arguments;if((!p)||(p!=="value")||(!h(n))){if(r!==b){return k.attr.apply(n,o)}else{return k.attr.apply(n,o)}}if(r!==b){l.call(n.filter(":tinymce"),r);k.attr.apply(n.not(":tinymce"),o);return n}else{var q=n[0],m=i(q);return m?m.getContent({save:true}):k.attr.apply(d(q),o)}}}})(jQuery);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/langs/fr.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,200 @@
+tinymce.addI18n('fr',{
+"Cut": "Couper",
+"Heading 5": "En-t\u00eate 5",
+"Header 2": "Titre 2",
+"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "Votre navigateur ne supporte pas la copie directe. Merci d'utiliser les touches Ctrl+X\/C\/V.",
+"Heading 4": "En-t\u00eate 4",
+"Div": "Div",
+"Heading 2": "En-t\u00eate 2",
+"Paste": "Coller",
+"Close": "Fermer",
+"Font Family": "Police",
+"Pre": "Pre",
+"Align right": "Aligner \u00e0 droite",
+"New document": "Nouveau document",
+"Blockquote": "Citation",
+"Numbered list": "Num\u00e9rotation",
+"Heading 1": "En-t\u00eate 1",
+"Headings": "En-t\u00eates",
+"Increase indent": "Augmenter le retrait",
+"Formats": "Formats",
+"Headers": "Titres",
+"Select all": "Tout s\u00e9lectionner",
+"Header 3": "Titre 3",
+"Blocks": "Blocs",
+"Undo": "Annuler",
+"Strikethrough": "Barr\u00e9",
+"Bullet list": "Puces",
+"Header 1": "Titre 1",
+"Superscript": "Exposant",
+"Clear formatting": "Effacer la mise en forme",
+"Font Sizes": "Taille de police",
+"Subscript": "Indice",
+"Header 6": "Titre 6",
+"Redo": "R\u00e9tablir",
+"Paragraph": "Paragraphe",
+"Ok": "Ok",
+"Bold": "Gras",
+"Code": "Code",
+"Italic": "Italique",
+"Align center": "Centrer",
+"Header 5": "Titre 5",
+"Heading 6": "En-t\u00eate 6",
+"Heading 3": "En-t\u00eate 3",
+"Decrease indent": "Diminuer le retrait",
+"Header 4": "Titre 4",
+"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "Le presse-papiers est maintenant en mode \"texte plein\". Les contenus seront coll\u00e9s sans retenir les formatages jusqu'\u00e0 ce que vous d\u00e9sactiviez cette option.",
+"Underline": "Soulign\u00e9",
+"Cancel": "Annuler",
+"Justify": "Justifier",
+"Inline": "En ligne",
+"Copy": "Copier",
+"Align left": "Aligner \u00e0 gauche",
+"Visual aids": "Aides visuelle",
+"Lower Greek": "Grec minuscule",
+"Square": "Carr\u00e9",
+"Default": "Par d\u00e9faut",
+"Lower Alpha": "Alpha minuscule",
+"Circle": "Cercle",
+"Disc": "Disque",
+"Upper Alpha": "Alpha majuscule",
+"Upper Roman": "Romain majuscule",
+"Lower Roman": "Romain minuscule",
+"Name": "Nom",
+"Anchor": "Ancre",
+"You have unsaved changes are you sure you want to navigate away?": "Vous avez des modifications non enregistr\u00e9es, \u00eates-vous s\u00fbr de quitter la page?",
+"Restore last draft": "Restaurer le dernier brouillon",
+"Special character": "Caract\u00e8res sp\u00e9ciaux",
+"Source code": "Code source",
+"Color": "Couleur",
+"Right to left": "Droite \u00e0 gauche",
+"Left to right": "Gauche \u00e0 droite",
+"Emoticons": "Emotic\u00f4nes",
+"Robots": "Robots",
+"Document properties": "Propri\u00e9t\u00e9 du document",
+"Title": "Titre",
+"Keywords": "Mots-cl\u00e9s",
+"Encoding": "Encodage",
+"Description": "Description",
+"Author": "Auteur",
+"Fullscreen": "Plein \u00e9cran",
+"Horizontal line": "Ligne horizontale",
+"Horizontal space": "Espacement horizontal",
+"B": "B",
+"Insert\/edit image": "Ins\u00e9rer\/modifier une image",
+"General": "G\u00e9n\u00e9ral",
+"Advanced": "Avanc\u00e9",
+"G": "V",
+"R": "R",
+"Source": "Source",
+"Border": "Bordure",
+"Constrain proportions": "Conserver les proportions",
+"Vertical space": "Espacement vertical",
+"Image description": "Description de l'image",
+"Style": "Style",
+"Dimensions": "Dimensions",
+"Insert image": "Ins\u00e9rer une image",
+"Insert date\/time": "Ins\u00e9rer date\/heure",
+"Remove link": "Enlever le lien",
+"Url": "Url",
+"Text to display": "Texte \u00e0 afficher",
+"Anchors": "Ancres",
+"Insert link": "Ins\u00e9rer un lien",
+"New window": "Nouvelle fen\u00eatre",
+"None": "n\/a",
+"The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?": "L'URL que vous avez entr\u00e9e semble \u00eatre un lien externe. Voulez-vous ajouter le pr\u00e9fixe http:\/\/ n\u00e9cessaire?",
+"Target": "Cible",
+"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?": "L'URL que vous avez entr\u00e9e semble \u00eatre une adresse e-mail. Voulez-vous ajouter le pr\u00e9fixe mailto: n\u00e9cessaire?",
+"Insert\/edit link": "Ins\u00e9rer\/modifier un lien",
+"Insert\/edit video": "Ins\u00e9rer\/modifier une vid\u00e9o",
+"Poster": "Publier",
+"Alternative source": "Source alternative",
+"Paste your embed code below:": "Collez votre code d'int\u00e9gration ci-dessous :",
+"Insert video": "Ins\u00e9rer une vid\u00e9o",
+"Embed": "Int\u00e9grer",
+"Nonbreaking space": "Espace ins\u00e9cable",
+"Page break": "Saut de page",
+"Paste as text": "Coller comme texte",
+"Preview": "Pr\u00e9visualiser",
+"Print": "Imprimer",
+"Save": "Enregistrer",
+"Could not find the specified string.": "Impossible de trouver la cha\u00eene sp\u00e9cifi\u00e9e.",
+"Replace": "Remplacer",
+"Next": "Suiv",
+"Whole words": "Mots entiers",
+"Find and replace": "Trouver et remplacer",
+"Replace with": "Remplacer par",
+"Find": "Chercher",
+"Replace all": "Tout remplacer",
+"Match case": "Respecter la casse",
+"Prev": "Pr\u00e9c ",
+"Spellcheck": "V\u00e9rification orthographique",
+"Finish": "Finie",
+"Ignore all": "Tout ignorer",
+"Ignore": "Ignorer",
+"Add to Dictionary": "Ajouter au dictionnaire",
+"Insert row before": "Ins\u00e9rer une ligne avant",
+"Rows": "Lignes",
+"Height": "Hauteur",
+"Paste row after": "Coller la ligne apr\u00e8s",
+"Alignment": "Alignement",
+"Border color": "Couleur de la bordure",
+"Column group": "Groupe de colonnes",
+"Row": "Ligne",
+"Insert column before": "Ins\u00e9rer une colonne avant",
+"Split cell": "Diviser la cellule",
+"Cell padding": "Espacement interne cellule",
+"Cell spacing": "Espacement inter-cellulles",
+"Row type": "Type de ligne",
+"Insert table": "Ins\u00e9rer un tableau",
+"Body": "Corps",
+"Caption": "Titre",
+"Footer": "Pied",
+"Delete row": "Effacer la ligne",
+"Paste row before": "Coller la ligne avant",
+"Scope": "Etendue",
+"Delete table": "Supprimer le tableau",
+"H Align": "Alignement H",
+"Top": "Haut",
+"Header cell": "Cellule d'en-t\u00eate",
+"Column": "Colonne",
+"Row group": "Groupe de lignes",
+"Cell": "Cellule",
+"Middle": "Milieu",
+"Cell type": "Type de cellule",
+"Copy row": "Copier la ligne",
+"Row properties": "Propri\u00e9t\u00e9s de la ligne",
+"Table properties": "Propri\u00e9t\u00e9s du tableau",
+"Bottom": "Bas",
+"V Align": "Alignement V",
+"Header": "En-t\u00eate",
+"Right": "Droite",
+"Insert column after": "Ins\u00e9rer une colonne apr\u00e8s",
+"Cols": "Colonnes",
+"Insert row after": "Ins\u00e9rer une ligne apr\u00e8s",
+"Width": "Largeur",
+"Cell properties": "Propri\u00e9t\u00e9s de la cellule",
+"Left": "Gauche",
+"Cut row": "Couper la ligne",
+"Delete column": "Effacer la colonne",
+"Center": "Centr\u00e9",
+"Merge cells": "Fusionner les cellules",
+"Insert template": "Ajouter un th\u00e8me",
+"Templates": "Th\u00e8mes",
+"Background color": "Couleur d'arri\u00e8re-plan",
+"Custom...": "Personnalis\u00e9...",
+"Custom color": "Couleur personnalis\u00e9e",
+"No color": "Aucune couleur",
+"Text color": "Couleur du texte",
+"Show blocks": "Afficher les blocs",
+"Show invisible characters": "Afficher les caract\u00e8res invisibles",
+"Words: {0}": "Mots : {0}",
+"Insert": "Ins\u00e9rer",
+"File": "Fichier",
+"Edit": "Editer",
+"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "Zone Texte Riche. Appuyer sur ALT-F9 pour le menu. Appuyer sur ALT-F10 pour la barre d'outils. Appuyer sur ALT-0 pour de l'aide.",
+"Tools": "Outils",
+"View": "Voir",
+"Table": "Tableau",
+"Format": "Format"
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/langs/fr.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.addI18n("fr",{Cut:"Couper","Heading 5":"En-t\u00eate 5","Header 2":"Titre 2","Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.":"Votre navigateur ne supporte pas la copie directe. Merci d'utiliser les touches Ctrl+X/C/V.","Heading 4":"En-t\u00eate 4",Div:"Div","Heading 2":"En-t\u00eate 2",Paste:"Coller",Close:"Fermer","Font Family":"Police",Pre:"Pre","Align right":"Aligner \u00e0 droite","New document":"Nouveau document",Blockquote:"Citation","Numbered list":"Num\u00e9rotation","Heading 1":"En-t\u00eate 1",Headings:"En-t\u00eates","Increase indent":"Augmenter le retrait",Formats:"Formats",Headers:"Titres","Select all":"Tout s\u00e9lectionner","Header 3":"Titre 3",Blocks:"Blocs",Undo:"Annuler",Strikethrough:"Barr\u00e9","Bullet list":"Puces","Header 1":"Titre 1",Superscript:"Exposant","Clear formatting":"Effacer la mise en forme","Font Sizes":"Taille de police",Subscript:"Indice","Header 6":"Titre 6",Redo:"R\u00e9tablir",Paragraph:"Paragraphe",Ok:"Ok",Bold:"Gras",Code:"Code",Italic:"Italique","Align center":"Centrer","Header 5":"Titre 5","Heading 6":"En-t\u00eate 6","Heading 3":"En-t\u00eate 3","Decrease indent":"Diminuer le retrait","Header 4":"Titre 4","Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.":'Le presse-papiers est maintenant en mode "texte plein". Les contenus seront coll\u00e9s sans retenir les formatages jusqu\'\u00e0 ce que vous d\u00e9sactiviez cette option.',Underline:"Soulign\u00e9",Cancel:"Annuler",Justify:"Justifier",Inline:"En ligne",Copy:"Copier","Align left":"Aligner \u00e0 gauche","Visual aids":"Aides visuelle","Lower Greek":"Grec minuscule",Square:"Carr\u00e9",Default:"Par d\u00e9faut","Lower Alpha":"Alpha minuscule",Circle:"Cercle",Disc:"Disque","Upper Alpha":"Alpha majuscule","Upper Roman":"Romain majuscule","Lower Roman":"Romain minuscule",Name:"Nom",Anchor:"Ancre","You have unsaved changes are you sure you want to navigate away?":"Vous avez des modifications non enregistr\u00e9es, \u00eates-vous s\u00fbr de quitter la page?","Restore last draft":"Restaurer le dernier brouillon","Special character":"Caract\u00e8res sp\u00e9ciaux","Source code":"Code source",Color:"Couleur","Right to left":"Droite \u00e0 gauche","Left to right":"Gauche \u00e0 droite",Emoticons:"Emotic\u00f4nes",Robots:"Robots","Document properties":"Propri\u00e9t\u00e9 du document",Title:"Titre",Keywords:"Mots-cl\u00e9s",Encoding:"Encodage",Description:"Description",Author:"Auteur",Fullscreen:"Plein \u00e9cran","Horizontal line":"Ligne horizontale","Horizontal space":"Espacement horizontal",B:"B","Insert/edit image":"Ins\u00e9rer/modifier une image",General:"G\u00e9n\u00e9ral",Advanced:"Avanc\u00e9",G:"V",R:"R",Source:"Source",Border:"Bordure","Constrain proportions":"Conserver les proportions","Vertical space":"Espacement vertical","Image description":"Description de l'image",Style:"Style",Dimensions:"Dimensions","Insert image":"Ins\u00e9rer une image","Insert date/time":"Ins\u00e9rer date/heure","Remove link":"Enlever le lien",Url:"Url","Text to display":"Texte \u00e0 afficher",Anchors:"Ancres","Insert link":"Ins\u00e9rer un lien","New window":"Nouvelle fen\u00eatre",None:"n/a","The URL you entered seems to be an external link. Do you want to add the required http:// prefix?":"L'URL que vous avez entr\u00e9e semble \u00eatre un lien externe. Voulez-vous ajouter le pr\u00e9fixe http:// n\u00e9cessaire?",Target:"Cible","The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?":"L'URL que vous avez entr\u00e9e semble \u00eatre une adresse e-mail. Voulez-vous ajouter le pr\u00e9fixe mailto: n\u00e9cessaire?","Insert/edit link":"Ins\u00e9rer/modifier un lien","Insert/edit video":"Ins\u00e9rer/modifier une vid\u00e9o",Poster:"Publier","Alternative source":"Source alternative","Paste your embed code below:":"Collez votre code d'int\u00e9gration ci-dessous :","Insert video":"Ins\u00e9rer une vid\u00e9o",Embed:"Int\u00e9grer","Nonbreaking space":"Espace ins\u00e9cable","Page break":"Saut de page","Paste as text":"Coller comme texte",Preview:"Pr\u00e9visualiser",Print:"Imprimer",Save:"Enregistrer","Could not find the specified string.":"Impossible de trouver la cha\u00eene sp\u00e9cifi\u00e9e.",Replace:"Remplacer",Next:"Suiv","Whole words":"Mots entiers","Find and replace":"Trouver et remplacer","Replace with":"Remplacer par",Find:"Chercher","Replace all":"Tout remplacer","Match case":"Respecter la casse",Prev:"Pr\u00e9c ",Spellcheck:"V\u00e9rification orthographique",Finish:"Finie","Ignore all":"Tout ignorer",Ignore:"Ignorer","Add to Dictionary":"Ajouter au dictionnaire","Insert row before":"Ins\u00e9rer une ligne avant",Rows:"Lignes",Height:"Hauteur","Paste row after":"Coller la ligne apr\u00e8s",Alignment:"Alignement","Border color":"Couleur de la bordure","Column group":"Groupe de colonnes",Row:"Ligne","Insert column before":"Ins\u00e9rer une colonne avant","Split cell":"Diviser la cellule","Cell padding":"Espacement interne cellule","Cell spacing":"Espacement inter-cellulles","Row type":"Type de ligne","Insert table":"Ins\u00e9rer un tableau",Body:"Corps",Caption:"Titre",Footer:"Pied","Delete row":"Effacer la ligne","Paste row before":"Coller la ligne avant",Scope:"Etendue","Delete table":"Supprimer le tableau","H Align":"Alignement H",Top:"Haut","Header cell":"Cellule d'en-t\u00eate",Column:"Colonne","Row group":"Groupe de lignes",Cell:"Cellule",Middle:"Milieu","Cell type":"Type de cellule","Copy row":"Copier la ligne","Row properties":"Propri\u00e9t\u00e9s de la ligne","Table properties":"Propri\u00e9t\u00e9s du tableau",Bottom:"Bas","V Align":"Alignement V",Header:"En-t\u00eate",Right:"Droite","Insert column after":"Ins\u00e9rer une colonne apr\u00e8s",Cols:"Colonnes","Insert row after":"Ins\u00e9rer une ligne apr\u00e8s",Width:"Largeur","Cell properties":"Propri\u00e9t\u00e9s de la cellule",Left:"Gauche","Cut row":"Couper la ligne","Delete column":"Effacer la colonne",Center:"Centr\u00e9","Merge cells":"Fusionner les cellules","Insert template":"Ajouter un th\u00e8me",Templates:"Th\u00e8mes","Background color":"Couleur d'arri\u00e8re-plan","Custom...":"Personnalis\u00e9...","Custom color":"Couleur personnalis\u00e9e","No color":"Aucune couleur","Text color":"Couleur du texte","Show blocks":"Afficher les blocs","Show invisible characters":"Afficher les caract\u00e8res invisibles","Words: {0}":"Mots : {0}",Insert:"Ins\u00e9rer",File:"Fichier",Edit:"Editer","Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help":"Zone Texte Riche. Appuyer sur ALT-F9 pour le menu. Appuyer sur ALT-F10 pour la barre d'outils. Appuyer sur ALT-0 pour de l'aide.",Tools:"Outils",View:"Voir",Table:"Tableau",Format:"Format"});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/langs/readme.md	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,3 @@
+This is where language files should be placed.
+
+Please DO NOT translate these directly use this service: https://www.transifex.com/projects/p/tinymce/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/license.txt	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,504 @@
+		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/advlist/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,97 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('advlist', function(editor) {
+	var olMenuItems, ulMenuItems, lastStyles = {};
+
+	function buildMenuItems(listName, styleValues) {
+		var items = [];
+
+		tinymce.each(styleValues.split(/[ ,]/), function(styleValue) {
+			items.push({
+				text: styleValue.replace(/\-/g, ' ').replace(/\b\w/g, function(chr) {
+					return chr.toUpperCase();
+				}),
+				data: styleValue == 'default' ? '' : styleValue
+			});
+		});
+
+		return items;
+	}
+
+	olMenuItems = buildMenuItems('OL', editor.getParam(
+		"advlist_number_styles",
+		"default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman"
+	));
+
+	ulMenuItems = buildMenuItems('UL', editor.getParam("advlist_bullet_styles", "default,circle,disc,square"));
+
+	function applyListFormat(listName, styleValue) {
+		editor.undoManager.transact(function() {
+			var list, dom = editor.dom, sel = editor.selection;
+
+			// Check for existing list element
+			list = dom.getParent(sel.getNode(), 'ol,ul');
+
+			// Switch/add list type if needed
+			if (!list || list.nodeName != listName || styleValue === false) {
+				editor.execCommand(listName == 'UL' ? 'InsertUnorderedList' : 'InsertOrderedList');
+			}
+
+			// Set style
+			styleValue = styleValue === false ? lastStyles[listName] : styleValue;
+			lastStyles[listName] = styleValue;
+
+			list = dom.getParent(sel.getNode(), 'ol,ul');
+			if (list) {
+				dom.setStyle(list, 'listStyleType', styleValue ? styleValue : null);
+				list.removeAttribute('data-mce-style');
+			}
+
+			editor.focus();
+		});
+	}
+
+	function updateSelection(e) {
+		var listStyleType = editor.dom.getStyle(editor.dom.getParent(editor.selection.getNode(), 'ol,ul'), 'listStyleType') || '';
+
+		e.control.items().each(function(ctrl) {
+			ctrl.active(ctrl.settings.data === listStyleType);
+		});
+	}
+
+	editor.addButton('numlist', {
+		type: 'splitbutton',
+		tooltip: 'Numbered list',
+		menu: olMenuItems,
+		onshow: updateSelection,
+		onselect: function(e) {
+			applyListFormat('OL', e.control.settings.data);
+		},
+		onclick: function() {
+			applyListFormat('OL', false);
+		}
+	});
+
+	editor.addButton('bullist', {
+		type: 'splitbutton',
+		tooltip: 'Bullet list',
+		menu: ulMenuItems,
+		onshow: updateSelection,
+		onselect: function(e) {
+			applyListFormat('UL', e.control.settings.data);
+		},
+		onclick: function() {
+			applyListFormat('UL', false);
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/advlist/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("advlist",function(d){var g,f,b={};function a(j,h){var i=[];tinymce.each(h.split(/[ ,]/),function(k){i.push({text:k.replace(/\-/g," ").replace(/\b\w/g,function(l){return l.toUpperCase()}),data:k=="default"?"":k})});return i}g=a("OL",d.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman"));f=a("UL",d.getParam("advlist_bullet_styles","default,circle,disc,square"));function e(i,h){d.undoManager.transact(function(){var k,l=d.dom,j=d.selection;k=l.getParent(j.getNode(),"ol,ul");if(!k||k.nodeName!=i||h===false){d.execCommand(i=="UL"?"InsertUnorderedList":"InsertOrderedList")}h=h===false?b[i]:h;b[i]=h;k=l.getParent(j.getNode(),"ol,ul");if(k){l.setStyle(k,"listStyleType",h?h:null);k.removeAttribute("data-mce-style")}d.focus()})}function c(i){var h=d.dom.getStyle(d.dom.getParent(d.selection.getNode(),"ol,ul"),"listStyleType")||"";i.control.items().each(function(j){j.active(j.settings.data===h)})}d.addButton("numlist",{type:"splitbutton",tooltip:"Numbered list",menu:g,onshow:c,onselect:function(h){e("OL",h.control.settings.data)},onclick:function(){e("OL",false)}});d.addButton("bullist",{type:"splitbutton",tooltip:"Bullet list",menu:f,onshow:c,onselect:function(h){e("UL",h.control.settings.data)},onclick:function(){e("UL",false)}})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/anchor/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,45 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('anchor', function(editor) {
+	function showDialog() {
+		var selectedNode = editor.selection.getNode(), name = '';
+
+		if (selectedNode.tagName == 'A') {
+			name = selectedNode.name || selectedNode.id || '';
+		}
+
+		editor.windowManager.open({
+			title: 'Anchor',
+			body: {type: 'textbox', name: 'name', size: 40, label: 'Name', value: name},
+			onsubmit: function(e) {
+				editor.execCommand('mceInsertContent', false, editor.dom.createHTML('a', {
+					id: e.data.name
+				}));
+			}
+		});
+	}
+
+	editor.addButton('anchor', {
+		icon: 'anchor',
+		tooltip: 'Anchor',
+		onclick: showDialog,
+		stateSelector: 'a:not([href])'
+	});
+
+	editor.addMenuItem('anchor', {
+		icon: 'anchor',
+		text: 'Anchor',
+		context: 'insert',
+		onclick: showDialog
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/anchor/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("anchor",function(b){function a(){var d=b.selection.getNode(),c="";if(d.tagName=="A"){c=d.name||d.id||""}b.windowManager.open({title:"Anchor",body:{type:"textbox",name:"name",size:40,label:"Name",value:c},onsubmit:function(f){b.execCommand("mceInsertContent",false,b.dom.createHTML("a",{id:f.data.name}))}})}b.addButton("anchor",{icon:"anchor",tooltip:"Anchor",onclick:a,stateSelector:"a:not([href])"});b.addMenuItem("anchor",{icon:"anchor",text:"Anchor",context:"insert",onclick:a})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/autolink/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,194 @@
+/**
+ * plugin.js
+ *
+ * Copyright 2011, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('autolink', function(editor) {
+	var AutoUrlDetectState;
+
+	editor.on("keydown", function(e) {
+		if (e.keyCode == 13) {
+			return handleEnter(editor);
+		}
+	});
+
+	// Internet Explorer has built-in automatic linking for most cases
+	if (tinymce.Env.ie) {
+		editor.on("focus", function() {
+			if (!AutoUrlDetectState) {
+				AutoUrlDetectState = true;
+
+				try {
+					editor.execCommand('AutoUrlDetect', false, true);
+				} catch (ex) {
+					// Ignore
+				}
+			}
+		});
+
+		return;
+	}
+
+	editor.on("keypress", function(e) {
+		if (e.keyCode == 41) {
+			return handleEclipse(editor);
+		}
+	});
+
+	editor.on("keyup", function(e) {
+		if (e.keyCode == 32) {
+			return handleSpacebar(editor);
+		}
+	});
+
+	function handleEclipse(editor) {
+		parseCurrentLine(editor, -1, '(', true);
+	}
+
+	function handleSpacebar(editor) {
+		parseCurrentLine(editor, 0, '', true);
+	}
+
+	function handleEnter(editor) {
+		parseCurrentLine(editor, -1, '', false);
+	}
+
+	function parseCurrentLine(editor, end_offset, delimiter) {
+		var rng, end, start, endContainer, bookmark, text, matches, prev, len, rngText;
+
+		function scopeIndex(container, index) {
+			if (index < 0) {
+				index = 0;
+			}
+
+			if (container.nodeType == 3) {
+				var len = container.data.length;
+
+				if (index > len) {
+					index = len;
+				}
+			}
+
+			return index;
+		}
+
+		function setStart(container, offset) {
+			if (container.nodeType != 1 || container.hasChildNodes()) {
+				rng.setStart(container, scopeIndex(container, offset));
+			} else {
+				rng.setStartBefore(container);
+			}
+		}
+
+		function setEnd(container, offset) {
+			if (container.nodeType != 1 || container.hasChildNodes()) {
+				rng.setEnd(container, scopeIndex(container, offset));
+			} else {
+				rng.setEndAfter(container);
+			}
+		}
+
+		// We need at least five characters to form a URL,
+		// hence, at minimum, five characters from the beginning of the line.
+		rng = editor.selection.getRng(true).cloneRange();
+		if (rng.startOffset < 5) {
+			// During testing, the caret is placed inbetween two text nodes.
+			// The previous text node contains the URL.
+			prev = rng.endContainer.previousSibling;
+			if (!prev) {
+				if (!rng.endContainer.firstChild || !rng.endContainer.firstChild.nextSibling) {
+					return;
+				}
+
+				prev = rng.endContainer.firstChild.nextSibling;
+			}
+
+			len = prev.length;
+			setStart(prev, len);
+			setEnd(prev, len);
+
+			if (rng.endOffset < 5) {
+				return;
+			}
+
+			end = rng.endOffset;
+			endContainer = prev;
+		} else {
+			endContainer = rng.endContainer;
+
+			// Get a text node
+			if (endContainer.nodeType != 3 && endContainer.firstChild) {
+				while (endContainer.nodeType != 3 && endContainer.firstChild) {
+					endContainer = endContainer.firstChild;
+				}
+
+				// Move range to text node
+				if (endContainer.nodeType == 3) {
+					setStart(endContainer, 0);
+					setEnd(endContainer, endContainer.nodeValue.length);
+				}
+			}
+
+			if (rng.endOffset == 1) {
+				end = 2;
+			} else {
+				end = rng.endOffset - 1 - end_offset;
+			}
+		}
+
+		start = end;
+
+		do {
+			// Move the selection one character backwards.
+			setStart(endContainer, end >= 2 ? end - 2 : 0);
+			setEnd(endContainer, end >= 1 ? end - 1 : 0);
+			end -= 1;
+			rngText = rng.toString();
+
+			// Loop until one of the following is found: a blank space, &nbsp;, delimiter, (end-2) >= 0
+		} while (rngText != ' ' && rngText !== '' && rngText.charCodeAt(0) != 160 && (end - 2) >= 0 && rngText != delimiter);
+
+		if (rng.toString() == delimiter || rng.toString().charCodeAt(0) == 160) {
+			setStart(endContainer, end);
+			setEnd(endContainer, start);
+			end += 1;
+		} else if (rng.startOffset === 0) {
+			setStart(endContainer, 0);
+			setEnd(endContainer, start);
+		} else {
+			setStart(endContainer, end);
+			setEnd(endContainer, start);
+		}
+
+		// Exclude last . from word like "www.site.com."
+		text = rng.toString();
+		if (text.charAt(text.length - 1) == '.') {
+			setEnd(endContainer, start - 1);
+		}
+
+		text = rng.toString();
+		matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i);
+
+		if (matches) {
+			if (matches[1] == 'www.') {
+				matches[1] = 'http://www.';
+			} else if (/@$/.test(matches[1]) && !/^mailto:/.test(matches[1])) {
+				matches[1] = 'mailto:' + matches[1];
+			}
+
+			bookmark = editor.selection.getBookmark();
+
+			editor.selection.setRng(rng);
+			editor.execCommand('createlink', false, matches[1] + matches[2]);
+			editor.selection.moveToBookmark(bookmark);
+			editor.nodeChanged();
+		}
+	}
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/autolink/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("autolink",function(d){var a;d.on("keydown",function(g){if(g.keyCode==13){return c(d)}});if(tinymce.Env.ie){d.on("focus",function(){if(!a){a=true;try{d.execCommand("AutoUrlDetect",false,true)}catch(g){}}});return}d.on("keypress",function(g){if(g.keyCode==41){return e(d)}});d.on("keyup",function(g){if(g.keyCode==32){return b(d)}});function e(g){f(g,-1,"(",true)}function b(g){f(g,0,"",true)}function c(g){f(g,-1,"",false)}function f(p,k,h){var g,m,j,v,s,u,n,l,o,t;function i(x,y){if(y<0){y=0}if(x.nodeType==3){var w=x.data.length;if(y>w){y=w}}return y}function r(w,x){if(w.nodeType!=1||w.hasChildNodes()){g.setStart(w,i(w,x))}else{g.setStartBefore(w)}}function q(w,x){if(w.nodeType!=1||w.hasChildNodes()){g.setEnd(w,i(w,x))}else{g.setEndAfter(w)}}g=p.selection.getRng(true).cloneRange();if(g.startOffset<5){l=g.endContainer.previousSibling;if(!l){if(!g.endContainer.firstChild||!g.endContainer.firstChild.nextSibling){return}l=g.endContainer.firstChild.nextSibling}o=l.length;r(l,o);q(l,o);if(g.endOffset<5){return}m=g.endOffset;v=l}else{v=g.endContainer;if(v.nodeType!=3&&v.firstChild){while(v.nodeType!=3&&v.firstChild){v=v.firstChild}if(v.nodeType==3){r(v,0);q(v,v.nodeValue.length)}}if(g.endOffset==1){m=2}else{m=g.endOffset-1-k}}j=m;do{r(v,m>=2?m-2:0);q(v,m>=1?m-1:0);m-=1;t=g.toString()}while(t!=" "&&t!==""&&t.charCodeAt(0)!=160&&(m-2)>=0&&t!=h);if(g.toString()==h||g.toString().charCodeAt(0)==160){r(v,m);q(v,j);m+=1}else{if(g.startOffset===0){r(v,0);q(v,j)}else{r(v,m);q(v,j)}}u=g.toString();if(u.charAt(u.length-1)=="."){q(v,j-1)}u=g.toString();n=u.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i);if(n){if(n[1]=="www."){n[1]="http://www."}else{if(/@$/.test(n[1])&&!/^mailto:/.test(n[1])){n[1]="mailto:"+n[1]}}s=p.selection.getBookmark();p.selection.setRng(g);p.execCommand("createlink",false,n[1]+n[2]);p.selection.moveToBookmark(s);p.nodeChanged()}}});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/autoresize/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,162 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+/*eslint no-nested-ternary:0 */
+
+/**
+ * Auto Resize
+ *
+ * This plugin automatically resizes the content area to fit its content height.
+ * It will retain a minimum height, which is the height of the content area when
+ * it's initialized.
+ */
+tinymce.PluginManager.add('autoresize', function(editor) {
+	var settings = editor.settings, oldSize = 0;
+
+	function isFullscreen() {
+		return editor.plugins.fullscreen && editor.plugins.fullscreen.isFullscreen();
+	}
+
+	if (editor.settings.inline) {
+		return;
+	}
+
+	/**
+	 * This method gets executed each time the editor needs to resize.
+	 */
+	function resize(e) {
+		var deltaSize, doc, body, docElm, DOM = tinymce.DOM, resizeHeight, myHeight,
+			marginTop, marginBottom, paddingTop, paddingBottom, borderTop, borderBottom;
+
+		doc = editor.getDoc();
+		if (!doc) {
+			return;
+		}
+
+		body = doc.body;
+		docElm = doc.documentElement;
+		resizeHeight = settings.autoresize_min_height;
+
+		if (!body || (e && e.type === "setcontent" && e.initial) || isFullscreen()) {
+			if (body && docElm) {
+				body.style.overflowY = "auto";
+				docElm.style.overflowY = "auto"; // Old IE
+			}
+
+			return;
+		}
+
+		// Calculate outer height of the body element using CSS styles
+		marginTop = editor.dom.getStyle(body, 'margin-top', true);
+		marginBottom = editor.dom.getStyle(body, 'margin-bottom', true);
+		paddingTop = editor.dom.getStyle(body, 'padding-top', true);
+		paddingBottom = editor.dom.getStyle(body, 'padding-bottom', true);
+		borderTop = editor.dom.getStyle(body, 'border-top-width', true);
+		borderBottom = editor.dom.getStyle(body, 'border-bottom-width', true);
+		myHeight = body.offsetHeight + parseInt(marginTop, 10) + parseInt(marginBottom, 10) +
+			parseInt(paddingTop, 10) + parseInt(paddingBottom, 10) +
+			parseInt(borderTop, 10) + parseInt(borderBottom, 10);
+
+		// Make sure we have a valid height
+		if (isNaN(myHeight) || myHeight <= 0) {
+			// Get height differently depending on the browser used
+			myHeight = tinymce.Env.ie ? body.scrollHeight : (tinymce.Env.webkit && body.clientHeight === 0 ? 0 : body.offsetHeight);
+		}
+
+		// Don't make it smaller than the minimum height
+		if (myHeight > settings.autoresize_min_height) {
+			resizeHeight = myHeight;
+		}
+
+		// If a maximum height has been defined don't exceed this height
+		if (settings.autoresize_max_height && myHeight > settings.autoresize_max_height) {
+			resizeHeight = settings.autoresize_max_height;
+			body.style.overflowY = "auto";
+			docElm.style.overflowY = "auto"; // Old IE
+		} else {
+			body.style.overflowY = "hidden";
+			docElm.style.overflowY = "hidden"; // Old IE
+			body.scrollTop = 0;
+		}
+
+		// Resize content element
+		if (resizeHeight !== oldSize) {
+			deltaSize = resizeHeight - oldSize;
+			DOM.setStyle(editor.iframeElement, 'height', resizeHeight + 'px');
+			oldSize = resizeHeight;
+
+			// WebKit doesn't decrease the size of the body element until the iframe gets resized
+			// So we need to continue to resize the iframe down until the size gets fixed
+			if (tinymce.isWebKit && deltaSize < 0) {
+				resize(e);
+			}
+		}
+	}
+
+	/**
+	 * Calls the resize x times in 100ms intervals. We can't wait for load events since
+	 * the CSS files might load async.
+	 */
+	function wait(times, interval, callback) {
+		setTimeout(function() {
+			resize({});
+
+			if (times--) {
+				wait(times, interval, callback);
+			} else if (callback) {
+				callback();
+			}
+		}, interval);
+	}
+
+	// Define minimum height
+	settings.autoresize_min_height = parseInt(editor.getParam('autoresize_min_height', editor.getElement().offsetHeight), 10);
+
+	// Define maximum height
+	settings.autoresize_max_height = parseInt(editor.getParam('autoresize_max_height', 0), 10);
+
+	// Add padding at the bottom for better UX
+	editor.on("init", function() {
+		var overflowPadding, bottomMargin;
+
+		overflowPadding = editor.getParam('autoresize_overflow_padding', 1);
+		bottomMargin = editor.getParam('autoresize_bottom_margin', 50);
+
+		if (overflowPadding !== false) {
+			editor.dom.setStyles(editor.getBody(), {
+				paddingLeft: overflowPadding,
+				paddingRight: overflowPadding
+			});
+		}
+
+		if (bottomMargin !== false) {
+			editor.dom.setStyles(editor.getBody(), {
+				paddingBottom: bottomMargin
+			});
+		}
+	});
+
+	// Add appropriate listeners for resizing content area
+	editor.on("nodechange setcontent keyup FullscreenStateChanged", resize);
+
+	if (editor.getParam('autoresize_on_init', true)) {
+		editor.on('init', function() {
+			// Hit it 20 times in 100 ms intervals
+			wait(20, 100, function() {
+				// Hit it 5 times in 1 sec intervals
+				wait(5, 1000);
+			});
+		});
+	}
+
+	// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
+	editor.addCommand('mceAutoResize', resize);
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/autoresize/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("autoresize",function(d){var c=d.settings,e=0;function b(){return d.plugins.fullscreen&&d.plugins.fullscreen.isFullscreen()}if(d.settings.inline){return}function a(o){var l,q,n,r,t=tinymce.DOM,j,h,g,m,s,i,k,p;q=d.getDoc();if(!q){return}n=q.body;r=q.documentElement;j=c.autoresize_min_height;if(!n||(o&&o.type==="setcontent"&&o.initial)||b()){if(n&&r){n.style.overflowY="auto";r.style.overflowY="auto"}return}g=d.dom.getStyle(n,"margin-top",true);m=d.dom.getStyle(n,"margin-bottom",true);s=d.dom.getStyle(n,"padding-top",true);i=d.dom.getStyle(n,"padding-bottom",true);k=d.dom.getStyle(n,"border-top-width",true);p=d.dom.getStyle(n,"border-bottom-width",true);h=n.offsetHeight+parseInt(g,10)+parseInt(m,10)+parseInt(s,10)+parseInt(i,10)+parseInt(k,10)+parseInt(p,10);if(isNaN(h)||h<=0){h=tinymce.Env.ie?n.scrollHeight:(tinymce.Env.webkit&&n.clientHeight===0?0:n.offsetHeight)}if(h>c.autoresize_min_height){j=h}if(c.autoresize_max_height&&h>c.autoresize_max_height){j=c.autoresize_max_height;n.style.overflowY="auto";r.style.overflowY="auto"}else{n.style.overflowY="hidden";r.style.overflowY="hidden";n.scrollTop=0}if(j!==e){l=j-e;t.setStyle(d.iframeElement,"height",j+"px");e=j;if(tinymce.isWebKit&&l<0){a(o)}}}function f(h,g,i){setTimeout(function(){a({});if(h--){f(h,g,i)}else{if(i){i()}}},g)}c.autoresize_min_height=parseInt(d.getParam("autoresize_min_height",d.getElement().offsetHeight),10);c.autoresize_max_height=parseInt(d.getParam("autoresize_max_height",0),10);d.on("init",function(){var h,g;h=d.getParam("autoresize_overflow_padding",1);g=d.getParam("autoresize_bottom_margin",50);if(h!==false){d.dom.setStyles(d.getBody(),{paddingLeft:h,paddingRight:h})}if(g!==false){d.dom.setStyles(d.getBody(),{paddingBottom:g})}});d.on("nodechange setcontent keyup FullscreenStateChanged",a);if(d.getParam("autoresize_on_init",true)){d.on("init",function(){f(20,100,function(){f(5,1000)})})}d.addCommand("mceAutoResize",a)});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/autosave/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,165 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+// Internal unload handler will be called before the page is unloaded
+// Needs to be outside the plugin since it would otherwise keep
+// a reference to editor in closue scope
+/*eslint no-func-assign:0 */
+tinymce._beforeUnloadHandler = function() {
+	var msg;
+
+	tinymce.each(tinymce.editors, function(editor) {
+		// Store a draft for each editor instance
+		if (editor.plugins.autosave) {
+			editor.plugins.autosave.storeDraft();
+		}
+
+		// Setup a return message if the editor is dirty
+		if (!msg && editor.isDirty() && editor.getParam("autosave_ask_before_unload", true)) {
+			msg = editor.translate("You have unsaved changes are you sure you want to navigate away?");
+		}
+	});
+
+	return msg;
+};
+
+tinymce.PluginManager.add('autosave', function(editor) {
+	var settings = editor.settings, LocalStorage = tinymce.util.LocalStorage, prefix, started;
+
+	prefix = settings.autosave_prefix || 'tinymce-autosave-{path}{query}-{id}-';
+	prefix = prefix.replace(/\{path\}/g, document.location.pathname);
+	prefix = prefix.replace(/\{query\}/g, document.location.search);
+	prefix = prefix.replace(/\{id\}/g, editor.id);
+
+	function parseTime(time, defaultTime) {
+		var multipels = {
+			s: 1000,
+			m: 60000
+		};
+
+		time = /^(\d+)([ms]?)$/.exec('' + (time || defaultTime));
+
+		return (time[2] ? multipels[time[2]] : 1) * parseInt(time, 10);
+	}
+
+	function hasDraft() {
+		var time = parseInt(LocalStorage.getItem(prefix + "time"), 10) || 0;
+
+		if (new Date().getTime() - time > settings.autosave_retention) {
+			removeDraft(false);
+			return false;
+		}
+
+		return true;
+	}
+
+	function removeDraft(fire) {
+		LocalStorage.removeItem(prefix + "draft");
+		LocalStorage.removeItem(prefix + "time");
+
+		if (fire !== false) {
+			editor.fire('RemoveDraft');
+		}
+	}
+
+	function storeDraft() {
+		if (!isEmpty() && editor.isDirty()) {
+			LocalStorage.setItem(prefix + "draft", editor.getContent({format: 'raw', no_events: true}));
+			LocalStorage.setItem(prefix + "time", new Date().getTime());
+			editor.fire('StoreDraft');
+		}
+	}
+
+	function restoreDraft() {
+		if (hasDraft()) {
+			editor.setContent(LocalStorage.getItem(prefix + "draft"), {format: 'raw'});
+			editor.fire('RestoreDraft');
+		}
+	}
+
+	function startStoreDraft() {
+		if (!started) {
+			setInterval(function() {
+				if (!editor.removed) {
+					storeDraft();
+				}
+			}, settings.autosave_interval);
+
+			started = true;
+		}
+	}
+
+	settings.autosave_interval = parseTime(settings.autosave_interval, '30s');
+	settings.autosave_retention = parseTime(settings.autosave_retention, '20m');
+
+	function postRender() {
+		var self = this;
+
+		self.disabled(!hasDraft());
+
+		editor.on('StoreDraft RestoreDraft RemoveDraft', function() {
+			self.disabled(!hasDraft());
+		});
+
+		startStoreDraft();
+	}
+
+	function restoreLastDraft() {
+		editor.undoManager.beforeChange();
+		restoreDraft();
+		removeDraft();
+		editor.undoManager.add();
+	}
+
+	editor.addButton('restoredraft', {
+		title: 'Restore last draft',
+		onclick: restoreLastDraft,
+		onPostRender: postRender
+	});
+
+	editor.addMenuItem('restoredraft', {
+		text: 'Restore last draft',
+		onclick: restoreLastDraft,
+		onPostRender: postRender,
+		context: 'file'
+	});
+
+	function isEmpty(html) {
+		var forcedRootBlockName = editor.settings.forced_root_block;
+
+		html = tinymce.trim(typeof html == "undefined" ? editor.getBody().innerHTML : html);
+
+		return html === '' || new RegExp(
+			'^<' + forcedRootBlockName + '[^>]*>((\u00a0|&nbsp;|[ \t]|<br[^>]*>)+?|)<\/' + forcedRootBlockName + '>|<br>$', 'i'
+		).test(html);
+	}
+
+	if (editor.settings.autosave_restore_when_empty !== false) {
+		editor.on('init', function() {
+			if (hasDraft() && isEmpty()) {
+				restoreDraft();
+			}
+		});
+
+		editor.on('saveContent', function() {
+			removeDraft();
+		});
+	}
+
+	window.onbeforeunload = tinymce._beforeUnloadHandler;
+
+	this.hasDraft = hasDraft;
+	this.storeDraft = storeDraft;
+	this.restoreDraft = restoreDraft;
+	this.removeDraft = removeDraft;
+	this.isEmpty = isEmpty;
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/autosave/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce._beforeUnloadHandler=function(){var a;tinymce.each(tinymce.editors,function(b){if(b.plugins.autosave){b.plugins.autosave.storeDraft()}if(!a&&b.isDirty()&&b.getParam("autosave_ask_before_unload",true)){a=b.translate("You have unsaved changes are you sure you want to navigate away?")}});return a};tinymce.PluginManager.add("autosave",function(j){var d=j.settings,k=tinymce.util.LocalStorage,h,m;h=d.autosave_prefix||"tinymce-autosave-{path}{query}-{id}-";h=h.replace(/\{path\}/g,document.location.pathname);h=h.replace(/\{query\}/g,document.location.search);h=h.replace(/\{id\}/g,j.id);function a(q,o){var p={s:1000,m:60000};q=/^(\d+)([ms]?)$/.exec(""+(q||o));return(q[2]?p[q[2]]:1)*parseInt(q,10)}function c(){var o=parseInt(k.getItem(h+"time"),10)||0;if(new Date().getTime()-o>d.autosave_retention){n(false);return false}return true}function n(o){k.removeItem(h+"draft");k.removeItem(h+"time");if(o!==false){j.fire("RemoveDraft")}}function b(){if(!g()&&j.isDirty()){k.setItem(h+"draft",j.getContent({format:"raw",no_events:true}));k.setItem(h+"time",new Date().getTime());j.fire("StoreDraft")}}function l(){if(c()){j.setContent(k.getItem(h+"draft"),{format:"raw"});j.fire("RestoreDraft")}}function f(){if(!m){setInterval(function(){if(!j.removed){b()}},d.autosave_interval);m=true}}d.autosave_interval=a(d.autosave_interval,"30s");d.autosave_retention=a(d.autosave_retention,"20m");function i(){var o=this;o.disabled(!c());j.on("StoreDraft RestoreDraft RemoveDraft",function(){o.disabled(!c())});f()}function e(){j.undoManager.beforeChange();l();n();j.undoManager.add()}j.addButton("restoredraft",{title:"Restore last draft",onclick:e,onPostRender:i});j.addMenuItem("restoredraft",{text:"Restore last draft",onclick:e,onPostRender:i,context:"file"});function g(p){var o=j.settings.forced_root_block;p=tinymce.trim(typeof p=="undefined"?j.getBody().innerHTML:p);return p===""||new RegExp("^<"+o+"[^>]*>((\u00a0|&nbsp;|[ \t]|<br[^>]*>)+?|)</"+o+">|<br>$","i").test(p)}if(j.settings.autosave_restore_when_empty!==false){j.on("init",function(){if(c()&&g()){l()}});j.on("saveContent",function(){n()})}window.onbeforeunload=tinymce._beforeUnloadHandler;this.hasDraft=c;this.storeDraft=b;this.restoreDraft=l;this.removeDraft=n;this.isEmpty=g});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/bbcode/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,123 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+(function() {
+	tinymce.create('tinymce.plugins.BBCodePlugin', {
+		init: function(ed) {
+			var self = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase();
+
+			ed.on('beforeSetContent', function(e) {
+				e.content = self['_' + dialect + '_bbcode2html'](e.content);
+			});
+
+			ed.on('postProcess', function(e) {
+				if (e.set) {
+					e.content = self['_' + dialect + '_bbcode2html'](e.content);
+				}
+
+				if (e.get) {
+					e.content = self['_' + dialect + '_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'
+			};
+		},
+
+		// Private methods
+
+		// HTML -> BBCode in PunBB dialect
+		_punbb_html2bbcode: function(s) {
+			s = tinymce.trim(s);
+
+			function rep(re, str) {
+				s = s.replace(re, str);
+			}
+
+			// example: <strong> to [b]
+			rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi, "[url=$1]$2[/url]");
+			rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi, "[code][color=$1]$2[/color][/code]");
+			rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi, "[quote][color=$1]$2[/color][/quote]");
+			rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi, "[code][color=$1]$2[/color][/code]");
+			rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi, "[quote][color=$1]$2[/color][/quote]");
+			rep(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi, "[color=$1]$2[/color]");
+			rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi, "[color=$1]$2[/color]");
+			rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi, "[size=$1]$2[/size]");
+			rep(/<font>(.*?)<\/font>/gi, "$1");
+			rep(/<img.*?src=\"(.*?)\".*?\/>/gi, "[img]$1[/img]");
+			rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi, "[code]$1[/code]");
+			rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi, "[quote]$1[/quote]");
+			rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi, "[code][b]$1[/b][/code]");
+			rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi, "[quote][b]$1[/b][/quote]");
+			rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi, "[code][i]$1[/i][/code]");
+			rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi, "[quote][i]$1[/i][/quote]");
+			rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi, "[code][u]$1[/u][/code]");
+			rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi, "[quote][u]$1[/u][/quote]");
+			rep(/<\/(strong|b)>/gi, "[/b]");
+			rep(/<(strong|b)>/gi, "[b]");
+			rep(/<\/(em|i)>/gi, "[/i]");
+			rep(/<(em|i)>/gi, "[i]");
+			rep(/<\/u>/gi, "[/u]");
+			rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi, "[u]$1[/u]");
+			rep(/<u>/gi, "[u]");
+			rep(/<blockquote[^>]*>/gi, "[quote]");
+			rep(/<\/blockquote>/gi, "[/quote]");
+			rep(/<br \/>/gi, "\n");
+			rep(/<br\/>/gi, "\n");
+			rep(/<br>/gi, "\n");
+			rep(/<p>/gi, "");
+			rep(/<\/p>/gi, "\n");
+			rep(/&nbsp;|\u00a0/gi, " ");
+			rep(/&quot;/gi, "\"");
+			rep(/&lt;/gi, "<");
+			rep(/&gt;/gi, ">");
+			rep(/&amp;/gi, "&");
+
+			return s;
+		},
+
+		// BBCode -> HTML from PunBB dialect
+		_punbb_bbcode2html: function(s) {
+			s = tinymce.trim(s);
+
+			function rep(re, str) {
+				s = s.replace(re, str);
+			}
+
+			// example: [b] to <strong>
+			rep(/\n/gi, "<br />");
+			rep(/\[b\]/gi, "<strong>");
+			rep(/\[\/b\]/gi, "</strong>");
+			rep(/\[i\]/gi, "<em>");
+			rep(/\[\/i\]/gi, "</em>");
+			rep(/\[u\]/gi, "<u>");
+			rep(/\[\/u\]/gi, "</u>");
+			rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi, "<a href=\"$1\">$2</a>");
+			rep(/\[url\](.*?)\[\/url\]/gi, "<a href=\"$1\">$1</a>");
+			rep(/\[img\](.*?)\[\/img\]/gi, "<img src=\"$1\" />");
+			rep(/\[color=(.*?)\](.*?)\[\/color\]/gi, "<font color=\"$1\">$2</font>");
+			rep(/\[code\](.*?)\[\/code\]/gi, "<span class=\"codeStyle\">$1</span>&nbsp;");
+			rep(/\[quote.*?\](.*?)\[\/quote\]/gi, "<span class=\"quoteStyle\">$1</span>&nbsp;");
+
+			return s;
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin);
+})();
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/bbcode/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+(function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(b){var a=this,c=b.getParam("bbcode_dialect","punbb").toLowerCase();b.on("beforeSetContent",function(d){d.content=a["_"+c+"_bbcode2html"](d.content)});b.on("postProcess",function(d){if(d.set){d.content=a["_"+c+"_bbcode2html"](d.content)}if(d.get){d.content=a["_"+c+"_html2bbcode"](d.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(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");b(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");b(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");b(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");b(/<font>(.*?)<\/font>/gi,"$1");b(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");b(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");b(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");b(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");b(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");b(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");b(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");b(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");b(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");b(/<\/(strong|b)>/gi,"[/b]");b(/<(strong|b)>/gi,"[b]");b(/<\/(em|i)>/gi,"[/i]");b(/<(em|i)>/gi,"[i]");b(/<\/u>/gi,"[/u]");b(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");b(/<u>/gi,"[u]");b(/<blockquote[^>]*>/gi,"[quote]");b(/<\/blockquote>/gi,"[/quote]");b(/<br \/>/gi,"\n");b(/<br\/>/gi,"\n");b(/<br>/gi,"\n");b(/<p>/gi,"");b(/<\/p>/gi,"\n");b(/&nbsp;|\u00a0/gi," ");b(/&quot;/gi,'"');b(/&lt;/gi,"<");b(/&gt;/gi,">");b(/&amp;/gi,"&");return a},_punbb_bbcode2html:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/\n/gi,"<br />");b(/\[b\]/gi,"<strong>");b(/\[\/b\]/gi,"</strong>");b(/\[i\]/gi,"<em>");b(/\[\/i\]/gi,"</em>");b(/\[u\]/gi,"<u>");b(/\[\/u\]/gi,"</u>");b(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>');b(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>');b(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />');b(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>');b(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span>&nbsp;');b(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span>&nbsp;');return a}});tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)})();
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/charmap/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,396 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('charmap', function(editor) {
+	var charmap = [
+		['160', 'no-break space'],
+		['173', 'soft hyphen'],
+		['34', 'quotation mark'],
+	// finance
+		['162', 'cent sign'],
+		['8364', 'euro sign'],
+		['163', 'pound sign'],
+		['165', 'yen sign'],
+	// signs
+		['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'],
+	// quotations
+		['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'],
+	// math / logical
+		['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'],
+	// undefined
+		['180', 'acute accent'],
+		['184', 'cedilla'],
+		['170', 'feminine ordinal indicator'],
+		['186', 'masculine ordinal indicator'],
+		['8224', 'dagger'],
+		['8225', 'double dagger'],
+	// alphabetical special chars
+		['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'],
+	// symbols
+		['8501', 'alef symbol'],
+		['982', 'pi symbol'],
+		['8476', 'real part symbol'],
+		['978', 'upsilon - hook symbol'],
+		['8472', 'Weierstrass p'],
+		['8465', 'imaginary part'],
+	// arrows
+		['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']
+	];
+
+	function showDialog() {
+		var gridHtml, x, y, win;
+
+		function getParentTd(elm) {
+			while (elm) {
+				if (elm.nodeName == 'TD') {
+					return elm;
+				}
+
+				elm = elm.parentNode;
+			}
+		}
+
+		gridHtml = '<table role="presentation" cellspacing="0" class="mce-charmap"><tbody>';
+
+		var width = 25;
+		var height = Math.ceil(charmap.length / width);
+		for (y = 0; y < height; y++) {
+			gridHtml += '<tr>';
+
+			for (x = 0; x < width; x++) {
+				var index = y * width + x;
+				if (index < charmap.length) {
+					var chr = charmap[index];
+
+					gridHtml += '<td title="' + chr[1] + '"><div tabindex="-1" title="' + chr[1] + '" role="button">' +
+						(chr ? String.fromCharCode(parseInt(chr[0], 10)) : '&nbsp;') + '</div></td>';
+				} else {
+					gridHtml += '<td />';
+				}
+			}
+
+			gridHtml += '</tr>';
+		}
+
+		gridHtml += '</tbody></table>';
+
+		var charMapPanel = {
+			type: 'container',
+			html: gridHtml,
+			onclick: function(e) {
+				var target = e.target;
+				if (/^(TD|DIV)$/.test(target.nodeName)) {
+					if (getParentTd(target).firstChild) {
+						editor.execCommand('mceInsertContent', false, tinymce.trim(target.innerText || target.textContent));
+
+						if (!e.ctrlKey) {
+							win.close();
+						}
+					}
+				}
+			},
+			onmouseover: function(e) {
+				var td = getParentTd(e.target);
+
+				if (td && td.firstChild) {
+					win.find('#preview').text(td.firstChild.firstChild.data);
+					win.find('#previewTitle').text(td.title);
+				} else {
+					win.find('#preview').text(' ');
+					win.find('#previewTitle').text(' ');
+				}
+			}
+		};
+
+		win = editor.windowManager.open({
+			title: "Special character",
+			spacing: 10,
+			padding: 10,
+			items: [
+				charMapPanel,
+				{
+					type: 'container',
+					layout: 'flex',
+					direction: 'column',
+					align: 'center',
+					spacing: 5,
+					minWidth: 160,
+					minHeight: 160,
+					items: [
+						{
+							type: 'label',
+							name: 'preview',
+							text: ' ',
+							style: 'font-size: 40px; text-align: center',
+							border: 1,
+							minWidth: 140,
+							minHeight: 80
+						},
+						{
+							type: 'label',
+							name: 'previewTitle',
+							text: ' ',
+							style: 'text-align: center',
+							border: 1,
+							minWidth: 140,
+							minHeight: 80
+						}
+					]
+				}
+			],
+			buttons: [
+				{text: "Close", onclick: function() {
+					win.close();
+				}}
+			]
+		});
+	}
+
+	editor.addButton('charmap', {
+		icon: 'charmap',
+		tooltip: 'Special character',
+		onclick: showDialog
+	});
+
+	editor.addMenuItem('charmap', {
+		icon: 'charmap',
+		text: 'Special character',
+		onclick: showDialog,
+		context: 'insert'
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/charmap/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("charmap",function(b){var c=[["160","no-break space"],["173","soft hyphen"],["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"]];function a(){var k,l,j,g;function d(n){while(n){if(n.nodeName=="TD"){return n}n=n.parentNode}}k='<table role="presentation" cellspacing="0" class="mce-charmap"><tbody>';var e=25;var m=Math.ceil(c.length/e);for(j=0;j<m;j++){k+="<tr>";for(l=0;l<e;l++){var h=j*e+l;if(h<c.length){var f=c[h];k+='<td title="'+f[1]+'"><div tabindex="-1" title="'+f[1]+'" role="button">'+(f?String.fromCharCode(parseInt(f[0],10)):"&nbsp;")+"</div></td>"}else{k+="<td />"}}k+="</tr>"}k+="</tbody></table>";var i={type:"container",html:k,onclick:function(o){var n=o.target;if(/^(TD|DIV)$/.test(n.nodeName)){if(d(n).firstChild){b.execCommand("mceInsertContent",false,tinymce.trim(n.innerText||n.textContent));if(!o.ctrlKey){g.close()}}}},onmouseover:function(n){var o=d(n.target);if(o&&o.firstChild){g.find("#preview").text(o.firstChild.firstChild.data);g.find("#previewTitle").text(o.title)}else{g.find("#preview").text(" ");g.find("#previewTitle").text(" ")}}};g=b.windowManager.open({title:"Special character",spacing:10,padding:10,items:[i,{type:"container",layout:"flex",direction:"column",align:"center",spacing:5,minWidth:160,minHeight:160,items:[{type:"label",name:"preview",text:" ",style:"font-size: 40px; text-align: center",border:1,minWidth:140,minHeight:80},{type:"label",name:"previewTitle",text:" ",style:"text-align: center",border:1,minWidth:140,minHeight:80}]}],buttons:[{text:"Close",onclick:function(){g.close()}}]})}b.addButton("charmap",{icon:"charmap",tooltip:"Special character",onclick:a});b.addMenuItem("charmap",{icon:"charmap",text:"Special character",onclick:a,context:"insert"})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/code/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,60 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('code', function(editor) {
+	function showDialog() {
+		var win = editor.windowManager.open({
+			title: "Source code",
+			body: {
+				type: 'textbox',
+				name: 'code',
+				multiline: true,
+				minWidth: editor.getParam("code_dialog_width", 600),
+				minHeight: editor.getParam("code_dialog_height", Math.min(tinymce.DOM.getViewPort().h - 200, 500)),
+				spellcheck: false,
+				style: 'direction: ltr; text-align: left'
+			},
+			onSubmit: function(e) {
+				// We get a lovely "Wrong document" error in IE 11 if we
+				// don't move the focus to the editor before creating an undo
+				// transation since it tries to make a bookmark for the current selection
+				editor.focus();
+
+				editor.undoManager.transact(function() {
+					editor.setContent(e.data.code);
+				});
+
+				editor.selection.setCursorLocation();
+				editor.nodeChanged();
+			}
+		});
+
+		// Gecko has a major performance issue with textarea
+		// contents so we need to set it when all reflows are done
+		win.find('#code').value(editor.getContent({source_view: true}));
+	}
+
+	editor.addCommand("mceCodeEditor", showDialog);
+
+	editor.addButton('code', {
+		icon: 'code',
+		tooltip: 'Source code',
+		onclick: showDialog
+	});
+
+	editor.addMenuItem('code', {
+		icon: 'code',
+		text: 'Source code',
+		context: 'tools',
+		onclick: showDialog
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/code/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("code",function(b){function a(){var c=b.windowManager.open({title:"Source code",body:{type:"textbox",name:"code",multiline:true,minWidth:b.getParam("code_dialog_width",600),minHeight:b.getParam("code_dialog_height",Math.min(tinymce.DOM.getViewPort().h-200,500)),spellcheck:false,style:"direction: ltr; text-align: left"},onSubmit:function(d){b.focus();b.undoManager.transact(function(){b.setContent(d.data.code)});b.selection.setCursorLocation();b.nodeChanged()}});c.find("#code").value(b.getContent({source_view:true}))}b.addCommand("mceCodeEditor",a);b.addButton("code",{icon:"code",tooltip:"Source code",onclick:a});b.addMenuItem("code",{icon:"code",text:"Source code",context:"tools",onclick:a})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/colorpicker/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,112 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('colorpicker', function(editor) {
+	function colorPickerCallback(callback, value) {
+		function setColor(value) {
+			var color = new tinymce.util.Color(value), rgb = color.toRgb();
+
+			win.fromJSON({
+				r: rgb.r,
+				g: rgb.g,
+				b: rgb.b,
+				hex: color.toHex().substr(1)
+			});
+
+			showPreview(color.toHex());
+		}
+
+		function showPreview(hexColor) {
+			win.find('#preview')[0].getEl().style.background = hexColor;
+		}
+
+		var win = editor.windowManager.open({
+			title: 'Color',
+			items: {
+				type: 'container',
+				layout: 'flex',
+				direction: 'row',
+				align: 'stretch',
+				padding: 5,
+				spacing: 10,
+				items: [
+					{
+						type: 'colorpicker',
+						value: value,
+						onchange: function() {
+							var rgb = this.rgb();
+
+							if (win) {
+								win.find('#r').value(rgb.r);
+								win.find('#g').value(rgb.g);
+								win.find('#b').value(rgb.b);
+								win.find('#hex').value(this.value().substr(1));
+								showPreview(this.value());
+							}
+						}
+					},
+					{
+						type: 'form',
+						padding: 0,
+						labelGap: 5,
+						defaults: {
+							type: 'textbox',
+							size: 7,
+							value: '0',
+							flex: 1,
+							spellcheck: false,
+							onchange: function() {
+								var colorPickerCtrl = win.find('colorpicker')[0];
+								var name, value;
+
+								name = this.name();
+								value = this.value();
+
+								if (name == "hex") {
+									value = '#' + value;
+									setColor(value);
+									colorPickerCtrl.value(value);
+									return;
+								}
+
+								value = {
+									r: win.find('#r').value(),
+									g: win.find('#g').value(),
+									b: win.find('#b').value()
+								};
+
+								colorPickerCtrl.value(value);
+								setColor(value);
+							}
+						},
+						items: [
+							{name: 'r', label: 'R', autofocus: 1},
+							{name: 'g', label: 'G'},
+							{name: 'b', label: 'B'},
+							{name: 'hex', label: '#', value: '000000'},
+							{name: 'preview', type: 'container', border: 1}
+						]
+					}
+				]
+			},
+			onSubmit: function() {
+				callback('#' + this.toJSON().hex);
+			}
+		});
+
+		setColor(value);
+	}
+
+	if (!editor.settings.color_picker_callback) {
+		editor.settings.color_picker_callback = colorPickerCallback;
+	}
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/colorpicker/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("colorpicker",function(b){function a(g,e){function d(j){var h=new tinymce.util.Color(j),i=h.toRgb();f.fromJSON({r:i.r,g:i.g,b:i.b,hex:h.toHex().substr(1)});c(h.toHex())}function c(h){f.find("#preview")[0].getEl().style.background=h}var f=b.windowManager.open({title:"Color",items:{type:"container",layout:"flex",direction:"row",align:"stretch",padding:5,spacing:10,items:[{type:"colorpicker",value:e,onchange:function(){var h=this.rgb();if(f){f.find("#r").value(h.r);f.find("#g").value(h.g);f.find("#b").value(h.b);f.find("#hex").value(this.value().substr(1));c(this.value())}}},{type:"form",padding:0,labelGap:5,defaults:{type:"textbox",size:7,value:"0",flex:1,spellcheck:false,onchange:function(){var h=f.find("colorpicker")[0];var i,j;i=this.name();j=this.value();if(i=="hex"){j="#"+j;d(j);h.value(j);return}j={r:f.find("#r").value(),g:f.find("#g").value(),b:f.find("#b").value()};h.value(j);d(j)}},items:[{name:"r",label:"R",autofocus:1},{name:"g",label:"G"},{name:"b",label:"B"},{name:"hex",label:"#",value:"000000"},{name:"preview",type:"container",border:1}]}]},onSubmit:function(){g("#"+this.toJSON().hex)}});d(e)}if(!b.settings.color_picker_callback){b.settings.color_picker_callback=a}});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/css/dialog.css	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,118 @@
+/* Generic */
+body {
+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:#DDDDDD;
+scrollbar-face-color:#E0E0DD;
+scrollbar-highlight-color:#F0F0EE;
+scrollbar-shadow-color:#F0F0EE;
+scrollbar-track-color:#F5F5F5;
+background:#F0F0EE;
+padding:0;
+margin:8px 8px 0 8px;
+}
+
+html {background:#F0F0EE;}
+td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
+textarea {resize:none;outline:none;}
+a:link, a:visited {color:black;}
+a:hover {color:#2B6FB6;}
+.nowrap {white-space: nowrap}
+
+/* Forms */
+fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;}
+legend {color:#2B6FB6; font-weight:bold;}
+label.msg {display:none;}
+label.invalid {color:#EE0000; display:inline;}
+input.invalid {border:1px solid #EE0000;}
+input {background:#FFF; border:1px solid #CCC;}
+input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
+input, select, textarea {border:1px solid #808080;}
+input.radio {border:1px none #000000; background:transparent; vertical-align:middle;}
+input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;}
+.input_noborder {border:0;}
+
+/* Buttons */
+#insert, #cancel, input.button, .updateButton {
+border:0; margin:0; padding:0;
+font-weight:bold;
+width:94px; height:26px;
+background:url(../img/buttons.png) 0 -26px;
+cursor:pointer;
+padding-bottom:2px;
+float:left;
+}
+
+#insert {background:url(../img/buttons.png) 0 -52px}
+#cancel {background:url(../img/buttons.png) 0 0; float:right}
+
+/* Browse */
+a.pickcolor, a.browse {text-decoration:none}
+a.browse span {display:block; width:20px; height:18px; background:url(../img/icons.gif) -20px 0 no-repeat; border:1px solid #FFF; margin-left:1px;}
+.mceOldBoxModel a.browse span {width:22px; height:20px;}
+a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;}
+a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
+a.browse:hover span.disabled {border:1px solid white; background-color:transparent;}
+a.pickcolor span {display:block; width:20px; height:16px; background:url(../img/icons.gif) -840px 0; margin-left:2px;}
+.mceOldBoxModel a.pickcolor span {width:21px; height:17px;}
+a.pickcolor:hover span {background-color:#B2BBD0;}
+a.pickcolor:hover span.disabled {}
+
+/* Charmap */
+table.charmap {border:1px solid #AAA; text-align:center}
+td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;}
+#charmap a {display:block; color:#000; text-decoration:none; border:0}
+#charmap a:hover {background:#CCC;color:#2B6FB6}
+#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center}
+#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center}
+
+/* Source */
+.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;}
+.mceActionPanel {margin-top:5px;}
+
+/* Tabs classes */
+.tabs {width:100%; height:18px; line-height:normal; background:url(../img/tabs.gif) repeat-x 0 -72px;}
+.tabs ul {margin:0; padding:0; list-style:none;}
+.tabs li {float:left; background:url(../img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;}
+.tabs li.current {background:url(../img/tabs.gif) no-repeat 0 -18px; margin-right:2px;}
+.tabs span {float:left; display:block; background:url(../img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;}
+.tabs .current span {background:url(../img/tabs.gif) no-repeat right -54px;}
+.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;}
+.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;}
+
+/* Panels */
+.panel_wrapper div.panel {display:none;}
+.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
+.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}
+
+/* Columns */
+.column {float:left;}
+.properties {width:100%;}
+.properties .column1 {}
+.properties .column2 {text-align:left;}
+
+/* Titles */
+h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;}
+h3 {font-size:14px;}
+.title {font-size:12px; font-weight:bold; color:#2B6FB6;}
+
+/* Dialog specific */
+#link .panel_wrapper, #link div.current {height:125px;}
+#image .panel_wrapper, #image div.current {height:200px;}
+#plugintable thead {font-weight:bold; background:#DDD;}
+#plugintable, #about #plugintable td {border:1px solid #919B9C;}
+#plugintable {width:96%; margin-top:10px;}
+#pluginscontainer {height:290px; overflow:auto;}
+#colorpicker #preview {display:inline-block; padding-left:40px; height:14px; border:1px solid black; margin-left:5px; margin-right: 5px}
+#colorpicker #previewblock {position: relative; top: -3px; padding-left:5px; padding-top: 0px; display:inline}
+#colorpicker #preview_wrapper { text-align:center; padding-top:4px; white-space: nowrap}
+#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}
+#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}
+#colorpicker #light div {overflow:hidden;}
+#colorpicker .panel_wrapper div.current {height:175px;}
+#colorpicker #namedcolors {width:150px;}
+#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
+#colorpicker #colornamecontainer {margin-top:5px;}
+#colorpicker #picker_panel fieldset {margin:auto;width:325px;}
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/img/buttons.png has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/img/icons.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/img/items.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/img/menu_arrow.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/img/menu_check.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/img/progress.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/img/tabs.gif has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,297 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true, console:true */
+/*eslint no-console:0, new-cap:0 */
+
+/**
+ * This plugin adds missing events form the 4.x API back. Not every event is
+ * properly supported but most things should work.
+ *
+ * Unsupported things:
+ *  - No editor.onEvent
+ *  - Can't cancel execCommands with beforeExecCommand
+ */
+(function(tinymce) {
+	var reported;
+
+	function noop() {
+	}
+
+	function log(apiCall) {
+		if (!reported && window && window.console) {
+			reported = true;
+			console.log("Deprecated TinyMCE API call: " + apiCall);
+		}
+	}
+
+	function Dispatcher(target, newEventName, argsMap, defaultScope) {
+		target = target || this;
+
+		if (!newEventName) {
+			this.add = this.addToTop = this.remove = this.dispatch = noop;
+			return;
+		}
+
+		this.add = function(callback, scope, prepend) {
+			log('<target>.on' + newEventName + ".add(..)");
+
+			// Convert callback({arg1:x, arg2:x}) -> callback(arg1, arg2)
+			function patchedEventCallback(e) {
+				var callbackArgs = [];
+
+				if (typeof argsMap == "string") {
+					argsMap = argsMap.split(" ");
+				}
+
+				if (argsMap && typeof argsMap != "function") {
+					for (var i = 0; i < argsMap.length; i++) {
+						callbackArgs.push(e[argsMap[i]]);
+					}
+				}
+
+				if (typeof argsMap == "function") {
+					callbackArgs = argsMap(newEventName, e, target);
+					if (!callbackArgs) {
+						return;
+					}
+				}
+
+				if (!argsMap) {
+					callbackArgs = [e];
+				}
+
+				callbackArgs.unshift(defaultScope || target);
+
+				if (callback.apply(scope || defaultScope || target, callbackArgs) === false) {
+					e.stopImmediatePropagation();
+				}
+			}
+
+			target.on(newEventName, patchedEventCallback, prepend);
+
+			return patchedEventCallback;
+		};
+
+		this.addToTop = function(callback, scope) {
+			this.add(callback, scope, true);
+		};
+
+		this.remove = function(callback) {
+			return target.off(newEventName, callback);
+		};
+
+		this.dispatch = function() {
+			target.fire(newEventName);
+
+			return true;
+		};
+	}
+
+	tinymce.util.Dispatcher = Dispatcher;
+	tinymce.onBeforeUnload = new Dispatcher(tinymce, "BeforeUnload");
+	tinymce.onAddEditor = new Dispatcher(tinymce, "AddEditor", "editor");
+	tinymce.onRemoveEditor = new Dispatcher(tinymce, "RemoveEditor", "editor");
+
+	tinymce.util.Cookie = {
+		get: noop, getHash: noop, remove: noop, set: noop, setHash: noop
+	};
+
+	function patchEditor(editor) {
+		function patchEditorEvents(oldEventNames, argsMap) {
+			tinymce.each(oldEventNames.split(" "), function(oldName) {
+				editor["on" + oldName] = new Dispatcher(editor, oldName, argsMap);
+			});
+		}
+
+		function convertUndoEventArgs(type, event, target) {
+			return [
+				event.level,
+				target
+			];
+		}
+
+		function filterSelectionEvents(needsSelection) {
+			return function(type, e) {
+				if ((!e.selection && !needsSelection) || e.selection == needsSelection) {
+					return [e];
+				}
+			};
+		}
+
+		if (editor.controlManager) {
+			return;
+		}
+
+		function cmNoop() {
+			var obj = {}, methods = 'add addMenu addSeparator collapse createMenu destroy displayColor expand focus ' +
+				'getLength hasMenus hideMenu isActive isCollapsed isDisabled isRendered isSelected mark ' +
+				'postRender remove removeAll renderHTML renderMenu renderNode renderTo select selectByIndex ' +
+				'setActive setAriaProperty setColor setDisabled setSelected setState showMenu update';
+
+			log('editor.controlManager.*');
+
+			function _noop() {
+				return cmNoop();
+			}
+
+			tinymce.each(methods.split(' '), function(method) {
+				obj[method] = _noop;
+			});
+
+			return obj;
+		}
+
+		editor.controlManager = {
+			buttons: {},
+
+			setDisabled: function(name, state) {
+				log("controlManager.setDisabled(..)");
+
+				if (this.buttons[name]) {
+					this.buttons[name].disabled(state);
+				}
+			},
+
+			setActive: function(name, state) {
+				log("controlManager.setActive(..)");
+
+				if (this.buttons[name]) {
+					this.buttons[name].active(state);
+				}
+			},
+
+			onAdd: new Dispatcher(),
+			onPostRender: new Dispatcher(),
+
+			add: function(obj) {
+				return obj;
+			},
+			createButton: cmNoop,
+			createColorSplitButton: cmNoop,
+			createControl: cmNoop,
+			createDropMenu: cmNoop,
+			createListBox: cmNoop,
+			createMenuButton: cmNoop,
+			createSeparator: cmNoop,
+			createSplitButton: cmNoop,
+			createToolbar: cmNoop,
+			createToolbarGroup: cmNoop,
+			destroy: noop,
+			get: noop,
+			setControlType: cmNoop
+		};
+
+		patchEditorEvents("PreInit BeforeRenderUI PostRender Load Init Remove Activate Deactivate", "editor");
+		patchEditorEvents("Click MouseUp MouseDown DblClick KeyDown KeyUp KeyPress ContextMenu Paste Submit Reset");
+		patchEditorEvents("BeforeExecCommand ExecCommand", "command ui value args"); // args.terminate not supported
+		patchEditorEvents("PreProcess PostProcess LoadContent SaveContent Change");
+		patchEditorEvents("BeforeSetContent BeforeGetContent SetContent GetContent", filterSelectionEvents(false));
+		patchEditorEvents("SetProgressState", "state time");
+		patchEditorEvents("VisualAid", "element hasVisual");
+		patchEditorEvents("Undo Redo", convertUndoEventArgs);
+
+		patchEditorEvents("NodeChange", function(type, e) {
+			return [
+				editor.controlManager,
+				e.element,
+				editor.selection.isCollapsed(),
+				e
+			];
+		});
+
+		var originalAddButton = editor.addButton;
+		editor.addButton = function(name, settings) {
+			var originalOnPostRender;
+
+			function patchedPostRender() {
+				editor.controlManager.buttons[name] = this;
+
+				if (originalOnPostRender) {
+					return originalOnPostRender.call(this);
+				}
+			}
+
+			for (var key in settings) {
+				if (key.toLowerCase() === "onpostrender") {
+					originalOnPostRender = settings[key];
+					settings.onPostRender = patchedPostRender;
+				}
+			}
+
+			if (!originalOnPostRender) {
+				settings.onPostRender = patchedPostRender;
+			}
+
+			if (settings.title) {
+				settings.title = tinymce.i18n.translate((editor.settings.language || "en") + "." + settings.title);
+			}
+
+			return originalAddButton.call(this, name, settings);
+		};
+
+		editor.on('init', function() {
+			var undoManager = editor.undoManager, selection = editor.selection;
+
+			undoManager.onUndo = new Dispatcher(editor, "Undo", convertUndoEventArgs, null, undoManager);
+			undoManager.onRedo = new Dispatcher(editor, "Redo", convertUndoEventArgs, null, undoManager);
+			undoManager.onBeforeAdd = new Dispatcher(editor, "BeforeAddUndo", null, undoManager);
+			undoManager.onAdd = new Dispatcher(editor, "AddUndo", null, undoManager);
+
+			selection.onBeforeGetContent = new Dispatcher(editor, "BeforeGetContent", filterSelectionEvents(true), selection);
+			selection.onGetContent = new Dispatcher(editor, "GetContent", filterSelectionEvents(true), selection);
+			selection.onBeforeSetContent = new Dispatcher(editor, "BeforeSetContent", filterSelectionEvents(true), selection);
+			selection.onSetContent = new Dispatcher(editor, "SetContent", filterSelectionEvents(true), selection);
+		});
+
+		editor.on('BeforeRenderUI', function() {
+			var windowManager = editor.windowManager;
+
+			windowManager.onOpen = new Dispatcher();
+			windowManager.onClose = new Dispatcher();
+			windowManager.createInstance = function(className, a, b, c, d, e) {
+				log("windowManager.createInstance(..)");
+
+				var constr = tinymce.resolve(className);
+				return new constr(a, b, c, d, e);
+			};
+		});
+	}
+
+	tinymce.on('SetupEditor', patchEditor);
+	tinymce.PluginManager.add("compat3x", patchEditor);
+
+	tinymce.addI18n = function(prefix, o) {
+		var I18n = tinymce.util.I18n, each = tinymce.each;
+
+		if (typeof prefix == "string" && prefix.indexOf('.') === -1) {
+			I18n.add(prefix, o);
+			return;
+		}
+
+		if (!tinymce.is(prefix, 'string')) {
+			each(prefix, function(o, lc) {
+				each(o, function(o, g) {
+					each(o, function(o, k) {
+						if (g === 'common') {
+							I18n.data[lc + '.' + k] = o;
+						} else {
+							I18n.data[lc + '.' + g + '.' + k] = o;
+						}
+					});
+				});
+			});
+		} else {
+			each(o, function(o, k) {
+				I18n.data[prefix + '.' + k] = o;
+			});
+		}
+	};
+})(tinymce);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+(function(f){var c;function e(){}function b(g){if(!c&&window&&window.console){c=true;console.log("Deprecated TinyMCE API call: "+g)}}function a(h,g,j,i){h=h||this;if(!g){this.add=this.addToTop=this.remove=this.dispatch=e;return}this.add=function(n,l,k){b("<target>.on"+g+".add(..)");function m(q){var p=[];if(typeof j=="string"){j=j.split(" ")}if(j&&typeof j!="function"){for(var o=0;o<j.length;o++){p.push(q[j[o]])}}if(typeof j=="function"){p=j(g,q,h);if(!p){return}}if(!j){p=[q]}p.unshift(i||h);if(n.apply(l||i||h,p)===false){q.stopImmediatePropagation()}}h.on(g,m,k);return m};this.addToTop=function(l,k){this.add(l,k,true)};this.remove=function(k){return h.off(g,k)};this.dispatch=function(){h.fire(g);return true}}f.util.Dispatcher=a;f.onBeforeUnload=new a(f,"BeforeUnload");f.onAddEditor=new a(f,"AddEditor","editor");f.onRemoveEditor=new a(f,"RemoveEditor","editor");f.util.Cookie={get:e,getHash:e,remove:e,set:e,setHash:e};function d(i){function g(m,n){f.each(m.split(" "),function(o){i["on"+o]=new a(i,o,n)})}function k(m,n,o){return[n.level,o]}function h(m){return function(n,o){if((!o.selection&&!m)||o.selection==m){return[o]}}}if(i.controlManager){return}function l(){var o={},m="add addMenu addSeparator collapse createMenu destroy displayColor expand focus getLength hasMenus hideMenu isActive isCollapsed isDisabled isRendered isSelected mark postRender remove removeAll renderHTML renderMenu renderNode renderTo select selectByIndex setActive setAriaProperty setColor setDisabled setSelected setState showMenu update";b("editor.controlManager.*");function n(){return l()}f.each(m.split(" "),function(p){o[p]=n});return o}i.controlManager={buttons:{},setDisabled:function(m,n){b("controlManager.setDisabled(..)");if(this.buttons[m]){this.buttons[m].disabled(n)}},setActive:function(m,n){b("controlManager.setActive(..)");if(this.buttons[m]){this.buttons[m].active(n)}},onAdd:new a(),onPostRender:new a(),add:function(m){return m},createButton:l,createColorSplitButton:l,createControl:l,createDropMenu:l,createListBox:l,createMenuButton:l,createSeparator:l,createSplitButton:l,createToolbar:l,createToolbarGroup:l,destroy:e,get:e,setControlType:l};g("PreInit BeforeRenderUI PostRender Load Init Remove Activate Deactivate","editor");g("Click MouseUp MouseDown DblClick KeyDown KeyUp KeyPress ContextMenu Paste Submit Reset");g("BeforeExecCommand ExecCommand","command ui value args");g("PreProcess PostProcess LoadContent SaveContent Change");g("BeforeSetContent BeforeGetContent SetContent GetContent",h(false));g("SetProgressState","state time");g("VisualAid","element hasVisual");g("Undo Redo",k);g("NodeChange",function(m,n){return[i.controlManager,n.element,i.selection.isCollapsed(),n]});var j=i.addButton;i.addButton=function(n,p){var q;function m(){i.controlManager.buttons[n]=this;if(q){return q.call(this)}}for(var o in p){if(o.toLowerCase()==="onpostrender"){q=p[o];p.onPostRender=m}}if(!q){p.onPostRender=m}if(p.title){p.title=f.i18n.translate((i.settings.language||"en")+"."+p.title)}return j.call(this,n,p)};i.on("init",function(){var n=i.undoManager,m=i.selection;n.onUndo=new a(i,"Undo",k,null,n);n.onRedo=new a(i,"Redo",k,null,n);n.onBeforeAdd=new a(i,"BeforeAddUndo",null,n);n.onAdd=new a(i,"AddUndo",null,n);m.onBeforeGetContent=new a(i,"BeforeGetContent",h(true),m);m.onGetContent=new a(i,"GetContent",h(true),m);m.onBeforeSetContent=new a(i,"BeforeSetContent",h(true),m);m.onSetContent=new a(i,"SetContent",h(true),m)});i.on("BeforeRenderUI",function(){var m=i.windowManager;m.onOpen=new a();m.onClose=new a();m.createInstance=function(p,o,n,t,s,r){b("windowManager.createInstance(..)");var q=f.resolve(p);return new q(o,n,t,s,r)}})}f.on("SetupEditor",d);f.PluginManager.add("compat3x",d);f.addI18n=function(i,j){var g=f.util.I18n,h=f.each;if(typeof i=="string"&&i.indexOf(".")===-1){g.add(i,j);return}if(!f.is(i,"string")){h(i,function(l,k){h(l,function(n,m){h(n,function(q,p){if(m==="common"){g.data[k+"."+p]=q}else{g.data[k+"."+m+"."+p]=q}})})})}else{h(j,function(m,l){g.data[i+"."+l]=m})}}})(tinymce);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/tiny_mce_popup.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,542 @@
+/**
+ * Popup.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+var tinymce, tinyMCE;
+
+/**
+ * TinyMCE popup/dialog helper class. This gives you easy access to the
+ * parent editor instance and a bunch of other things. It's higly recommended
+ * that you load this script into your dialogs.
+ *
+ * @static
+ * @class tinyMCEPopup
+ */
+var tinyMCEPopup = {
+	/**
+	 * Initializes the popup this will be called automatically.
+	 *
+	 * @method init
+	 */
+	init: function() {
+		var self = this, parentWin, settings, uiWindow;
+
+		// Find window & API
+		parentWin = self.getWin();
+		tinymce = tinyMCE = parentWin.tinymce;
+		self.editor = tinymce.EditorManager.activeEditor;
+		self.params = self.editor.windowManager.getParams();
+
+		uiWindow = self.editor.windowManager.windows[self.editor.windowManager.windows.length - 1];
+		self.features = uiWindow.features;
+		self.uiWindow = uiWindow;
+
+		settings = self.editor.settings;
+
+		// Setup popup CSS path(s)
+		if (settings.popup_css !== false) {
+			if (settings.popup_css) {
+				settings.popup_css = self.editor.documentBaseURI.toAbsolute(settings.popup_css);
+			} else {
+				settings.popup_css = self.editor.baseURI.toAbsolute("plugins/compat3x/css/dialog.css");
+			}
+		}
+
+		if (settings.popup_css_add) {
+			settings.popup_css += ',' + self.editor.documentBaseURI.toAbsolute(settings.popup_css_add);
+		}
+
+		// Setup local DOM
+		self.dom = self.editor.windowManager.createInstance('tinymce.dom.DOMUtils', document, {
+			ownEvents: true,
+			proxy: tinyMCEPopup._eventProxy
+		});
+
+		self.dom.bind(window, 'ready', self._onDOMLoaded, self);
+
+		// Enables you to skip loading the default css
+		if (self.features.popup_css !== false) {
+			self.dom.loadCSS(self.features.popup_css || self.editor.settings.popup_css);
+		}
+
+		// Setup on init listeners
+		self.listeners = [];
+
+		/**
+		 * Fires when the popup is initialized.
+		 *
+		 * @event onInit
+		 * @param {tinymce.Editor} editor Editor instance.
+		 * @example
+		 * // Alerts the selected contents when the dialog is loaded
+		 * tinyMCEPopup.onInit.add(function(ed) {
+		 *     alert(ed.selection.getContent());
+		 * });
+		 *
+		 * // Executes the init method on page load in some object using the SomeObject scope
+		 * tinyMCEPopup.onInit.add(SomeObject.init, SomeObject);
+		 */
+		self.onInit = {
+			add: function(func, scope) {
+				self.listeners.push({func : func, scope : scope});
+			}
+		};
+
+		self.isWindow = !self.getWindowArg('mce_inline');
+		self.id = self.getWindowArg('mce_window_id');
+	},
+
+	/**
+	 * Returns the reference to the parent window that opened the dialog.
+	 *
+	 * @method getWin
+	 * @return {Window} Reference to the parent window that opened the dialog.
+	 */
+	getWin: function() {
+		// Added frameElement check to fix bug: #2817583
+		return (!window.frameElement && window.dialogArguments) || opener || parent || top;
+	},
+
+	/**
+	 * Returns a window argument/parameter by name.
+	 *
+	 * @method getWindowArg
+	 * @param {String} name Name of the window argument to retrive.
+	 * @param {String} defaultValue Optional default value to return.
+	 * @return {String} Argument value or default value if it wasn't found.
+	 */
+	getWindowArg : function(name, defaultValue) {
+		var value = this.params[name];
+
+		return tinymce.is(value) ? value : defaultValue;
+	},
+
+	/**
+	 * Returns a editor parameter/config option value.
+	 *
+	 * @method getParam
+	 * @param {String} name Name of the editor config option to retrive.
+	 * @param {String} defaultValue Optional default value to return.
+	 * @return {String} Parameter value or default value if it wasn't found.
+	 */
+	getParam : function(name, defaultValue) {
+		return this.editor.getParam(name, defaultValue);
+	},
+
+	/**
+	 * Returns a language item by key.
+	 *
+	 * @method getLang
+	 * @param {String} name Language item like mydialog.something.
+	 * @param {String} defaultValue Optional default value to return.
+	 * @return {String} Language value for the item like "my string" or the default value if it wasn't found.
+	 */
+	getLang : function(name, defaultValue) {
+		return this.editor.getLang(name, defaultValue);
+	},
+
+	/**
+	 * Executed a command on editor that opened the dialog/popup.
+	 *
+	 * @method execCommand
+	 * @param {String} cmd Command to execute.
+	 * @param {Boolean} ui Optional boolean value if the UI for the command should be presented or not.
+	 * @param {Object} val Optional value to pass with the comman like an URL.
+	 * @param {Object} a Optional arguments object.
+	 */
+	execCommand : function(cmd, ui, val, args) {
+		args = args || {};
+		args.skip_focus = 1;
+
+		this.restoreSelection();
+		return this.editor.execCommand(cmd, ui, val, args);
+	},
+
+	/**
+	 * Resizes the dialog to the inner size of the window. This is needed since various browsers
+	 * have different border sizes on windows.
+	 *
+	 * @method resizeToInnerSize
+	 */
+	resizeToInnerSize : function() {
+		/*var self = this;
+
+		// Detach it to workaround a Chrome specific bug
+		// https://sourceforge.net/tracker/?func=detail&atid=635682&aid=2926339&group_id=103281
+		setTimeout(function() {
+			var vp = self.dom.getViewPort(window);
+
+			self.editor.windowManager.resizeBy(
+				self.getWindowArg('mce_width') - vp.w,
+				self.getWindowArg('mce_height') - vp.h,
+				self.id || window
+			);
+		}, 10);*/
+	},
+
+	/**
+	 * Will executed the specified string when the page has been loaded. This function
+	 * was added for compatibility with the 2.x branch.
+	 *
+	 * @method executeOnLoad
+	 * @param {String} evil String to evalutate on init.
+	 */
+	executeOnLoad : function(evil) {
+		this.onInit.add(function() {
+			eval(evil);
+		});
+	},
+
+	/**
+	 * Stores the current editor selection for later restoration. This can be useful since some browsers
+	 * looses it's selection if a control element is selected/focused inside the dialogs.
+	 *
+	 * @method storeSelection
+	 */
+	storeSelection : function() {
+		this.editor.windowManager.bookmark = tinyMCEPopup.editor.selection.getBookmark(1);
+	},
+
+	/**
+	 * Restores any stored selection. This can be useful since some browsers
+	 * looses it's selection if a control element is selected/focused inside the dialogs.
+	 *
+	 * @method restoreSelection
+	 */
+	restoreSelection : function() {
+		var self = tinyMCEPopup;
+
+		if (!self.isWindow && tinymce.isIE) {
+			self.editor.selection.moveToBookmark(self.editor.windowManager.bookmark);
+		}
+	},
+
+	/**
+	 * Loads a specific dialog language pack. If you pass in plugin_url as a argument
+	 * when you open the window it will load the <plugin url>/langs/<code>_dlg.js lang pack file.
+	 *
+	 * @method requireLangPack
+	 */
+	requireLangPack : function() {
+		var self = this, url = self.getWindowArg('plugin_url') || self.getWindowArg('theme_url'), settings = self.editor.settings, lang;
+
+		if (settings.language !== false) {
+			lang = settings.language || "en";
+		}
+
+		if (url && lang && self.features.translate_i18n !== false && settings.language_load !== false) {
+			url += '/langs/' + lang + '_dlg.js';
+
+			if (!tinymce.ScriptLoader.isDone(url)) {
+				document.write('<script type="text/javascript" src="' + url + '"></script>');
+				tinymce.ScriptLoader.markDone(url);
+			}
+		}
+	},
+
+	/**
+	 * Executes a color picker on the specified element id. When the user
+	 * then selects a color it will be set as the value of the specified element.
+	 *
+	 * @method pickColor
+	 * @param {DOMEvent} e DOM event object.
+	 * @param {string} element_id Element id to be filled with the color value from the picker.
+	 */
+	pickColor : function(e, element_id) {
+		var el = document.getElementById(element_id), colorPickerCallback = this.editor.settings.color_picker_callback;
+		if (colorPickerCallback) {
+			colorPickerCallback.call(
+				this.editor,
+				function (value) {
+					el.value = value;
+					try {
+						el.onchange();
+					} catch (ex) {
+						// Try fire event, ignore errors
+					}
+				},
+				el.value
+			);
+		}
+	},
+
+	/**
+	 * Opens a filebrowser/imagebrowser this will set the output value from
+	 * the browser as a value on the specified element.
+	 *
+	 * @method openBrowser
+	 * @param {string} element_id Id of the element to set value in.
+	 * @param {string} type Type of browser to open image/file/flash.
+	 * @param {string} option Option name to get the file_broswer_callback function name from.
+	 */
+	openBrowser : function(element_id, type) {
+		tinyMCEPopup.restoreSelection();
+		this.editor.execCallback('file_browser_callback', element_id, document.getElementById(element_id).value, type, window);
+	},
+
+	/**
+	 * Creates a confirm dialog. Please don't use the blocking behavior of this
+	 * native version use the callback method instead then it can be extended.
+	 *
+	 * @method confirm
+	 * @param {String} t Title for the new confirm dialog.
+	 * @param {function} cb Callback function to be executed after the user has selected ok or cancel.
+	 * @param {Object} s Optional scope to execute the callback in.
+	 */
+	confirm : function(t, cb, s) {
+		this.editor.windowManager.confirm(t, cb, s, window);
+	},
+
+	/**
+	 * Creates a alert dialog. Please don't use the blocking behavior of this
+	 * native version use the callback method instead then it can be extended.
+	 *
+	 * @method alert
+	 * @param {String} tx Title for the new alert dialog.
+	 * @param {function} cb Callback function to be executed after the user has selected ok.
+	 * @param {Object} s Optional scope to execute the callback in.
+	 */
+	alert : function(tx, cb, s) {
+		this.editor.windowManager.alert(tx, cb, s, window);
+	},
+
+	/**
+	 * Closes the current window.
+	 *
+	 * @method close
+	 */
+	close : function() {
+		var t = this;
+
+		// To avoid domain relaxing issue in Opera
+		function close() {
+			t.editor.windowManager.close(window);
+			tinymce = tinyMCE = t.editor = t.params = t.dom = t.dom.doc = null; // Cleanup
+		}
+
+		if (tinymce.isOpera) {
+			t.getWin().setTimeout(close, 0);
+		} else {
+			close();
+		}
+	},
+
+	// Internal functions
+
+	_restoreSelection : function() {
+		var e = window.event.srcElement;
+
+		if (e.nodeName == 'INPUT' && (e.type == 'submit' || e.type == 'button')) {
+			tinyMCEPopup.restoreSelection();
+		}
+	},
+
+/*	_restoreSelection : function() {
+		var e = window.event.srcElement;
+
+		// If user focus a non text input or textarea
+		if ((e.nodeName != 'INPUT' && e.nodeName != 'TEXTAREA') || e.type != 'text')
+			tinyMCEPopup.restoreSelection();
+	},*/
+
+	_onDOMLoaded : function() {
+		var t = tinyMCEPopup, ti = document.title, h, nv;
+
+		// Translate page
+		if (t.features.translate_i18n !== false) {
+			var map = {
+				"update": "Ok",
+				"insert": "Ok",
+				"cancel": "Cancel",
+				"not_set": "--",
+				"class_name": "Class name",
+				"browse": "Browse"
+			};
+
+			var langCode = (tinymce.settings ? tinymce.settings : t.editor.settings).language || 'en';
+			for (var key in map) {
+				tinymce.i18n.data[langCode + "." + key] = tinymce.i18n.translate(map[key]);
+			}
+
+			h = document.body.innerHTML;
+
+			// Replace a=x with a="x" in IE
+			if (tinymce.isIE) {
+				h = h.replace(/ (value|title|alt)=([^"][^\s>]+)/gi, ' $1="$2"');
+			}
+
+			document.dir = t.editor.getParam('directionality','');
+
+			if ((nv = t.editor.translate(h)) && nv != h) {
+				document.body.innerHTML = nv;
+			}
+
+			if ((nv = t.editor.translate(ti)) && nv != ti) {
+				document.title = ti = nv;
+			}
+		}
+
+		if (!t.editor.getParam('browser_preferred_colors', false) || !t.isWindow) {
+			t.dom.addClass(document.body, 'forceColors');
+		}
+
+		document.body.style.display = '';
+
+		// Restore selection in IE when focus is placed on a non textarea or input element of the type text
+		if (tinymce.Env.ie) {
+			if (tinymce.Env.ie < 11) {
+				document.attachEvent('onmouseup', tinyMCEPopup._restoreSelection);
+
+				// Add base target element for it since it would fail with modal dialogs
+				t.dom.add(t.dom.select('head')[0], 'base', {target: '_self'});
+			} else {
+				document.addEventListener('mouseup', tinyMCEPopup._restoreSelection, false);
+			}
+		}
+
+		t.restoreSelection();
+		t.resizeToInnerSize();
+
+		// Set inline title
+		if (!t.isWindow) {
+			t.editor.windowManager.setTitle(window, ti);
+		} else {
+			window.focus();
+		}
+
+		if (!tinymce.isIE && !t.isWindow) {
+			t.dom.bind(document, 'focus', function() {
+				t.editor.windowManager.focus(t.id);
+			});
+		}
+
+		// Patch for accessibility
+		tinymce.each(t.dom.select('select'), function(e) {
+			e.onkeydown = tinyMCEPopup._accessHandler;
+		});
+
+		// Call onInit
+		// Init must be called before focus so the selection won't get lost by the focus call
+		tinymce.each(t.listeners, function(o) {
+			o.func.call(o.scope, t.editor);
+		});
+
+		// Move focus to window
+		if (t.getWindowArg('mce_auto_focus', true)) {
+			window.focus();
+
+			// Focus element with mceFocus class
+			tinymce.each(document.forms, function(f) {
+				tinymce.each(f.elements, function(e) {
+					if (t.dom.hasClass(e, 'mceFocus') && !e.disabled) {
+						e.focus();
+						return false; // Break loop
+					}
+				});
+			});
+		}
+
+		document.onkeyup = tinyMCEPopup._closeWinKeyHandler;
+
+		if ('textContent' in document) {
+			t.uiWindow.getEl('head').firstChild.textContent = document.title;
+		} else {
+			t.uiWindow.getEl('head').firstChild.innerText = document.title;
+		}
+	},
+
+	_accessHandler : function(e) {
+		e = e || window.event;
+
+		if (e.keyCode == 13 || e.keyCode == 32) {
+			var elm = e.target || e.srcElement;
+
+			if (elm.onchange) {
+				elm.onchange();
+			}
+
+			return tinymce.dom.Event.cancel(e);
+		}
+	},
+
+	_closeWinKeyHandler : function(e) {
+		e = e || window.event;
+
+		if (e.keyCode == 27) {
+			tinyMCEPopup.close();
+		}
+	},
+
+	_eventProxy: function(id) {
+		return function(evt) {
+			tinyMCEPopup.dom.events.callNativeHandler(id, evt);
+		};
+	}
+};
+
+tinyMCEPopup.init();
+
+tinymce.util.Dispatcher = function(scope) {
+	this.scope = scope || this;
+	this.listeners = [];
+
+	this.add = function(callback, scope) {
+		this.listeners.push({cb : callback, scope : scope || this.scope});
+
+		return callback;
+	};
+
+	this.addToTop = function(callback, scope) {
+		var self = this, listener = {cb : callback, scope : scope || self.scope};
+
+		// Create new listeners if addToTop is executed in a dispatch loop
+		if (self.inDispatch) {
+			self.listeners = [listener].concat(self.listeners);
+		} else {
+			self.listeners.unshift(listener);
+		}
+
+		return callback;
+	};
+
+	this.remove = function(callback) {
+		var listeners = this.listeners, output = null;
+
+		tinymce.each(listeners, function(listener, i) {
+			if (callback == listener.cb) {
+				output = listener;
+				listeners.splice(i, 1);
+				return false;
+			}
+		});
+
+		return output;
+	};
+
+	this.dispatch = function() {
+		var self = this, returnValue, args = arguments, i, listeners = self.listeners, listener;
+
+		self.inDispatch = true;
+
+		// Needs to be a real loop since the listener count might change while looping
+		// And this is also more efficient
+		for (i = 0; i < listeners.length; i++) {
+			listener = listeners[i];
+			returnValue = listener.cb.apply(listener.scope, args.length > 0 ? args : [listener.scope]);
+
+			if (returnValue === false) {
+				break;
+			}
+		}
+
+		self.inDispatch = false;
+
+		return returnValue;
+	};
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/utils/editable_selects.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,70 @@
+/**
+ * editable_selects.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+var TinyMCE_EditableSelects = {
+	editSelectElm : null,
+
+	init : function() {
+		var nl = document.getElementsByTagName("select"), i, d = document, o;
+
+		for (i=0; i<nl.length; i++) {
+			if (nl[i].className.indexOf('mceEditableSelect') != -1) {
+				o = new Option(tinyMCEPopup.editor.translate('value'), '__mce_add_custom__');
+
+				o.className = 'mceAddSelectValue';
+
+				nl[i].options[nl[i].options.length] = o;
+				nl[i].onchange = TinyMCE_EditableSelects.onChangeEditableSelect;
+			}
+		}
+	},
+
+	onChangeEditableSelect : function(e) {
+		var d = document, ne, se = window.event ? window.event.srcElement : e.target;
+
+		if (se.options[se.selectedIndex].value == '__mce_add_custom__') {
+			ne = d.createElement("input");
+			ne.id = se.id + "_custom";
+			ne.name = se.name + "_custom";
+			ne.type = "text";
+
+			ne.style.width = se.offsetWidth + 'px';
+			se.parentNode.insertBefore(ne, se);
+			se.style.display = 'none';
+			ne.focus();
+			ne.onblur = TinyMCE_EditableSelects.onBlurEditableSelectInput;
+			ne.onkeydown = TinyMCE_EditableSelects.onKeyDown;
+			TinyMCE_EditableSelects.editSelectElm = se;
+		}
+	},
+
+	onBlurEditableSelectInput : function() {
+		var se = TinyMCE_EditableSelects.editSelectElm;
+
+		if (se) {
+			if (se.previousSibling.value != '') {
+				addSelectValue(document.forms[0], se.id, se.previousSibling.value, se.previousSibling.value);
+				selectByValue(document.forms[0], se.id, se.previousSibling.value);
+			} else
+				selectByValue(document.forms[0], se.id, '');
+
+			se.style.display = 'inline';
+			se.parentNode.removeChild(se.previousSibling);
+			TinyMCE_EditableSelects.editSelectElm = null;
+		}
+	},
+
+	onKeyDown : function(e) {
+		e = e || window.event;
+
+		if (e.keyCode == 13)
+			TinyMCE_EditableSelects.onBlurEditableSelectInput();
+	}
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/utils/form_utils.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,210 @@
+/**
+ * form_utils.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+var themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme"));
+
+function getColorPickerHTML(id, target_form_element) {
+	var h = "", dom = tinyMCEPopup.dom;
+
+	if (label = dom.select('label[for=' + target_form_element + ']')[0]) {
+		label.id = label.id || dom.uniqueId();
+	}
+
+	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">';
+	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>';
+
+	return h;
+}
+
+function updateColor(img_id, form_element_id) {
+	document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value;
+}
+
+function setBrowserDisabled(id, state) {
+	var img = document.getElementById(id);
+	var lnk = document.getElementById(id + "_link");
+
+	if (lnk) {
+		if (state) {
+			lnk.setAttribute("realhref", lnk.getAttribute("href"));
+			lnk.removeAttribute("href");
+			tinyMCEPopup.dom.addClass(img, 'disabled');
+		} else {
+			if (lnk.getAttribute("realhref"))
+				lnk.setAttribute("href", lnk.getAttribute("realhref"));
+
+			tinyMCEPopup.dom.removeClass(img, 'disabled');
+		}
+	}
+}
+
+function getBrowserHTML(id, target_form_element, type, prefix) {
+	var option = prefix + "_" + type + "_browser_callback", cb, html;
+
+	cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback"));
+
+	if (!cb)
+		return "";
+
+	html = "";
+	html += '<a id="' + id + '_link" href="javascript:openBrowser(\'' + id + '\',\'' + target_form_element + '\', \'' + type + '\',\'' + option + '\');" onmousedown="return false;" class="browse">';
+	html += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '">&nbsp;</span></a>';
+
+	return html;
+}
+
+function openBrowser(img_id, target_form_element, type, option) {
+	var img = document.getElementById(img_id);
+
+	if (img.className != "mceButtonDisabled")
+		tinyMCEPopup.openBrowser(target_form_element, type, option);
+}
+
+function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {
+	if (!form_obj || !form_obj.elements[field_name])
+		return;
+
+	if (!value)
+		value = "";
+
+	var sel = form_obj.elements[field_name];
+
+	var found = false;
+	for (var i=0; i<sel.options.length; i++) {
+		var option = sel.options[i];
+
+		if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {
+			option.selected = true;
+			found = true;
+		} else
+			option.selected = false;
+	}
+
+	if (!found && add_custom && value != '') {
+		var option = new Option(value, value);
+		option.selected = true;
+		sel.options[sel.options.length] = option;
+		sel.selectedIndex = sel.options.length - 1;
+	}
+
+	return found;
+}
+
+function getSelectValue(form_obj, field_name) {
+	var elm = form_obj.elements[field_name];
+
+	if (elm == null || elm.options == null || elm.selectedIndex === -1)
+		return "";
+
+	return elm.options[elm.selectedIndex].value;
+}
+
+function addSelectValue(form_obj, field_name, name, value) {
+	var s = form_obj.elements[field_name];
+	var o = new Option(name, value);
+	s.options[s.options.length] = o;
+}
+
+function addClassesToList(list_id, specific_option) {
+	// Setup class droplist
+	var styleSelectElm = document.getElementById(list_id);
+	var styles = tinyMCEPopup.getParam('theme_advanced_styles', false);
+	styles = tinyMCEPopup.getParam(specific_option, styles);
+
+	if (styles) {
+		var stylesAr = styles.split(';');
+
+		for (var i=0; i<stylesAr.length; i++) {
+			if (stylesAr != "") {
+				var key, value;
+
+				key = stylesAr[i].split('=')[0];
+				value = stylesAr[i].split('=')[1];
+
+				styleSelectElm.options[styleSelectElm.length] = new Option(key, value);
+			}
+		}
+	} else {
+		/*tinymce.each(tinyMCEPopup.editor.dom.getClasses(), function(o) {
+			styleSelectElm.options[styleSelectElm.length] = new Option(o.title || o['class'], o['class']);
+		});*/
+	}
+}
+
+function isVisible(element_id) {
+	var elm = document.getElementById(element_id);
+
+	return elm && elm.style.display != "none";
+}
+
+function convertRGBToHex(col) {
+	var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
+
+	var rgb = col.replace(re, "$1,$2,$3").split(',');
+	if (rgb.length == 3) {
+		r = parseInt(rgb[0]).toString(16);
+		g = parseInt(rgb[1]).toString(16);
+		b = parseInt(rgb[2]).toString(16);
+
+		r = r.length == 1 ? '0' + r : r;
+		g = g.length == 1 ? '0' + g : g;
+		b = b.length == 1 ? '0' + b : b;
+
+		return "#" + r + g + b;
+	}
+
+	return col;
+}
+
+function convertHexToRGB(col) {
+	if (col.indexOf('#') != -1) {
+		col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
+
+		r = parseInt(col.substring(0, 2), 16);
+		g = parseInt(col.substring(2, 4), 16);
+		b = parseInt(col.substring(4, 6), 16);
+
+		return "rgb(" + r + "," + g + "," + b + ")";
+	}
+
+	return col;
+}
+
+function trimSize(size) {
+	return size.replace(/([0-9\.]+)(px|%|in|cm|mm|em|ex|pt|pc)/i, '$1$2');
+}
+
+function getCSSSize(size) {
+	size = trimSize(size);
+
+	if (size == "")
+		return "";
+
+	// Add px
+	if (/^[0-9]+$/.test(size))
+		size += 'px';
+	// Sanity check, IE doesn't like broken values
+	else if (!(/^[0-9\.]+(px|%|in|cm|mm|em|ex|pt|pc)$/i.test(size)))
+		return "";
+
+	return size;
+}
+
+function getStyle(elm, attrib, style) {
+	var val = tinyMCEPopup.dom.getAttrib(elm, attrib);
+
+	if (val != '')
+		return '' + val;
+
+	if (typeof(style) == 'undefined')
+		style = attrib;
+
+	return tinyMCEPopup.dom.getStyle(elm, style);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/utils/mctabs.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,164 @@
+/**
+ * mctabs.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*jshint globals: tinyMCEPopup */
+
+function MCTabs() {
+	this.settings = [];
+	this.onChange = tinyMCEPopup.editor.windowManager.createInstance('tinymce.util.Dispatcher');
+};
+
+MCTabs.prototype.init = function(settings) {
+	this.settings = settings;
+};
+
+MCTabs.prototype.getParam = function(name, default_value) {
+	var value = null;
+
+	value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name];
+
+	// Fix bool values
+	if (value == "true" || value == "false")
+		return (value == "true");
+
+	return value;
+};
+
+MCTabs.prototype.showTab =function(tab){
+	tab.className = 'current';
+	tab.setAttribute("aria-selected", true);
+	tab.setAttribute("aria-expanded", true);
+	tab.tabIndex = 0;
+};
+
+MCTabs.prototype.hideTab =function(tab){
+	var t=this;
+
+	tab.className = '';
+	tab.setAttribute("aria-selected", false);
+	tab.setAttribute("aria-expanded", false);
+	tab.tabIndex = -1;
+};
+
+MCTabs.prototype.showPanel = function(panel) {
+	panel.className = 'current'; 
+	panel.setAttribute("aria-hidden", false);
+};
+
+MCTabs.prototype.hidePanel = function(panel) {
+	panel.className = 'panel';
+	panel.setAttribute("aria-hidden", true);
+}; 
+
+MCTabs.prototype.getPanelForTab = function(tabElm) {
+	return tinyMCEPopup.dom.getAttrib(tabElm, "aria-controls");
+};
+
+MCTabs.prototype.displayTab = function(tab_id, panel_id, avoid_focus) {
+	var panelElm, panelContainerElm, tabElm, tabContainerElm, selectionClass, nodes, i, t = this;
+
+	tabElm = document.getElementById(tab_id);
+
+	if (panel_id === undefined) {
+		panel_id = t.getPanelForTab(tabElm);
+	}
+
+	panelElm= document.getElementById(panel_id);
+	panelContainerElm = panelElm ? panelElm.parentNode : null;
+	tabContainerElm = tabElm ? tabElm.parentNode : null;
+	selectionClass = t.getParam('selection_class', 'current');
+
+	if (tabElm && tabContainerElm) {
+		nodes = tabContainerElm.childNodes;
+
+		// Hide all other tabs
+		for (i = 0; i < nodes.length; i++) {
+			if (nodes[i].nodeName == "LI") {
+				t.hideTab(nodes[i]);
+			}
+		}
+
+		// Show selected tab
+		t.showTab(tabElm);
+	}
+
+	if (panelElm && panelContainerElm) {
+		nodes = panelContainerElm.childNodes;
+
+		// Hide all other panels
+		for (i = 0; i < nodes.length; i++) {
+			if (nodes[i].nodeName == "DIV")
+				t.hidePanel(nodes[i]);
+		}
+
+		if (!avoid_focus) { 
+			tabElm.focus();
+		}
+
+		// Show selected panel
+		t.showPanel(panelElm);
+	}
+};
+
+MCTabs.prototype.getAnchor = function() {
+	var pos, url = document.location.href;
+
+	if ((pos = url.lastIndexOf('#')) != -1)
+		return url.substring(pos + 1);
+
+	return "";
+};
+
+
+//Global instance
+var mcTabs = new MCTabs();
+
+tinyMCEPopup.onInit.add(function() {
+	var tinymce = tinyMCEPopup.getWin().tinymce, dom = tinyMCEPopup.dom, each = tinymce.each;
+
+	each(dom.select('div.tabs'), function(tabContainerElm) {
+		//var keyNav;
+
+		dom.setAttrib(tabContainerElm, "role", "tablist");
+
+		var items = tinyMCEPopup.dom.select('li', tabContainerElm);
+		var action = function(id) {
+			mcTabs.displayTab(id, mcTabs.getPanelForTab(id));
+			mcTabs.onChange.dispatch(id);
+		};
+
+		each(items, function(item) {
+			dom.setAttrib(item, 'role', 'tab');
+			dom.bind(item, 'click', function(evt) {
+				action(item.id);
+			});
+		});
+
+		dom.bind(dom.getRoot(), 'keydown', function(evt) {
+			if (evt.keyCode === 9 && evt.ctrlKey && !evt.altKey) { // Tab
+				//keyNav.moveFocus(evt.shiftKey ? -1 : 1);
+				tinymce.dom.Event.cancel(evt);
+			}
+		});
+
+		each(dom.select('a', tabContainerElm), function(a) {
+			dom.setAttrib(a, 'tabindex', '-1');
+		});
+
+		/*keyNav = tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', {
+			root: tabContainerElm,
+			items: items,
+			onAction: action,
+			actOnFocus: true,
+			enableLeftRight: true,
+			enableUpDown: true
+		}, tinyMCEPopup.dom);*/
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/compat3x/utils/validate.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,252 @@
+/**
+ * validate.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+	// String validation:
+
+	if (!Validator.isEmail('myemail'))
+		alert('Invalid email.');
+
+	// Form validation:
+
+	var f = document.forms['myform'];
+
+	if (!Validator.isEmail(f.myemail))
+		alert('Invalid email.');
+*/
+
+var Validator = {
+	isEmail : function(s) {
+		return this.test(s, '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$');
+	},
+
+	isAbsUrl : function(s) {
+		return this.test(s, '^(news|telnet|nttp|file|http|ftp|https)://[-A-Za-z0-9\\.]+\\/?.*$');
+	},
+
+	isSize : function(s) {
+		return this.test(s, '^[0-9.]+(%|in|cm|mm|em|ex|pt|pc|px)?$');
+	},
+
+	isId : function(s) {
+		return this.test(s, '^[A-Za-z_]([A-Za-z0-9_])*$');
+	},
+
+	isEmpty : function(s) {
+		var nl, i;
+
+		if (s.nodeName == 'SELECT' && s.selectedIndex < 1)
+			return true;
+
+		if (s.type == 'checkbox' && !s.checked)
+			return true;
+
+		if (s.type == 'radio') {
+			for (i=0, nl = s.form.elements; i<nl.length; i++) {
+				if (nl[i].type == "radio" && nl[i].name == s.name && nl[i].checked)
+					return false;
+			}
+
+			return true;
+		}
+
+		return new RegExp('^\\s*$').test(s.nodeType == 1 ? s.value : s);
+	},
+
+	isNumber : function(s, d) {
+		return !isNaN(s.nodeType == 1 ? s.value : s) && (!d || !this.test(s, '^-?[0-9]*\\.[0-9]*$'));
+	},
+
+	test : function(s, p) {
+		s = s.nodeType == 1 ? s.value : s;
+
+		return s == '' || new RegExp(p).test(s);
+	}
+};
+
+var AutoValidator = {
+	settings : {
+		id_cls : 'id',
+		int_cls : 'int',
+		url_cls : 'url',
+		number_cls : 'number',
+		email_cls : 'email',
+		size_cls : 'size',
+		required_cls : 'required',
+		invalid_cls : 'invalid',
+		min_cls : 'min',
+		max_cls : 'max'
+	},
+
+	init : function(s) {
+		var n;
+
+		for (n in s)
+			this.settings[n] = s[n];
+	},
+
+	validate : function(f) {
+		var i, nl, s = this.settings, c = 0;
+
+		nl = this.tags(f, 'label');
+		for (i=0; i<nl.length; i++) {
+			this.removeClass(nl[i], s.invalid_cls);
+			nl[i].setAttribute('aria-invalid', false);
+		}
+
+		c += this.validateElms(f, 'input');
+		c += this.validateElms(f, 'select');
+		c += this.validateElms(f, 'textarea');
+
+		return c == 3;
+	},
+
+	invalidate : function(n) {
+		this.mark(n.form, n);
+	},
+	
+	getErrorMessages : function(f) {
+		var nl, i, s = this.settings, field, msg, values, messages = [], ed = tinyMCEPopup.editor;
+		nl = this.tags(f, "label");
+		for (i=0; i<nl.length; i++) {
+			if (this.hasClass(nl[i], s.invalid_cls)) {
+				field = document.getElementById(nl[i].getAttribute("for"));
+				values = { field: nl[i].textContent };
+				if (this.hasClass(field, s.min_cls, true)) {
+					message = ed.getLang('invalid_data_min');
+					values.min = this.getNum(field, s.min_cls);
+				} else if (this.hasClass(field, s.number_cls)) {
+					message = ed.getLang('invalid_data_number');
+				} else if (this.hasClass(field, s.size_cls)) {
+					message = ed.getLang('invalid_data_size');
+				} else {
+					message = ed.getLang('invalid_data');
+				}
+				
+				message = message.replace(/{\#([^}]+)\}/g, function(a, b) {
+					return values[b] || '{#' + b + '}';
+				});
+				messages.push(message);
+			}
+		}
+		return messages;
+	},
+
+	reset : function(e) {
+		var t = ['label', 'input', 'select', 'textarea'];
+		var i, j, nl, s = this.settings;
+
+		if (e == null)
+			return;
+
+		for (i=0; i<t.length; i++) {
+			nl = this.tags(e.form ? e.form : e, t[i]);
+			for (j=0; j<nl.length; j++) {
+				this.removeClass(nl[j], s.invalid_cls);
+				nl[j].setAttribute('aria-invalid', false);
+			}
+		}
+	},
+
+	validateElms : function(f, e) {
+		var nl, i, n, s = this.settings, st = true, va = Validator, v;
+
+		nl = this.tags(f, e);
+		for (i=0; i<nl.length; i++) {
+			n = nl[i];
+
+			this.removeClass(n, s.invalid_cls);
+
+			if (this.hasClass(n, s.required_cls) && va.isEmpty(n))
+				st = this.mark(f, n);
+
+			if (this.hasClass(n, s.number_cls) && !va.isNumber(n))
+				st = this.mark(f, n);
+
+			if (this.hasClass(n, s.int_cls) && !va.isNumber(n, true))
+				st = this.mark(f, n);
+
+			if (this.hasClass(n, s.url_cls) && !va.isAbsUrl(n))
+				st = this.mark(f, n);
+
+			if (this.hasClass(n, s.email_cls) && !va.isEmail(n))
+				st = this.mark(f, n);
+
+			if (this.hasClass(n, s.size_cls) && !va.isSize(n))
+				st = this.mark(f, n);
+
+			if (this.hasClass(n, s.id_cls) && !va.isId(n))
+				st = this.mark(f, n);
+
+			if (this.hasClass(n, s.min_cls, true)) {
+				v = this.getNum(n, s.min_cls);
+
+				if (isNaN(v) || parseInt(n.value) < parseInt(v))
+					st = this.mark(f, n);
+			}
+
+			if (this.hasClass(n, s.max_cls, true)) {
+				v = this.getNum(n, s.max_cls);
+
+				if (isNaN(v) || parseInt(n.value) > parseInt(v))
+					st = this.mark(f, n);
+			}
+		}
+
+		return st;
+	},
+
+	hasClass : function(n, c, d) {
+		return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className);
+	},
+
+	getNum : function(n, c) {
+		c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0];
+		c = c.replace(/[^0-9]/g, '');
+
+		return c;
+	},
+
+	addClass : function(n, c, b) {
+		var o = this.removeClass(n, c);
+		n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c;
+	},
+
+	removeClass : function(n, c) {
+		c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' ');
+		return n.className = c != ' ' ? c : '';
+	},
+
+	tags : function(f, s) {
+		return f.getElementsByTagName(s);
+	},
+
+	mark : function(f, n) {
+		var s = this.settings;
+
+		this.addClass(n, s.invalid_cls);
+		n.setAttribute('aria-invalid', 'true');
+		this.markLabels(f, n, s.invalid_cls);
+
+		return false;
+	},
+
+	markLabels : function(f, n, ic) {
+		var nl, i;
+
+		nl = this.tags(f, "label");
+		for (i=0; i<nl.length; i++) {
+			if (nl[i].getAttribute("for") == n.id || nl[i].htmlFor == n.id)
+				this.addClass(nl[i], ic);
+		}
+
+		return null;
+	}
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/contextmenu/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,87 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('contextmenu', function(editor) {
+	var menu, contextmenuNeverUseNative = editor.settings.contextmenu_never_use_native;
+
+	editor.on('contextmenu', function(e) {
+		var contextmenu, doc = editor.getDoc();
+
+		// Block TinyMCE menu on ctrlKey
+		if (e.ctrlKey && !contextmenuNeverUseNative) {
+			return;
+		}
+
+		e.preventDefault();
+
+		/**
+		 * WebKit/Blink on Mac has the odd behavior of selecting the target word or line this causes
+		 * issues when for example inserting images see: #7022
+		 */
+		if (tinymce.Env.mac && tinymce.Env.webkit) {
+			if (e.button == 2 && doc.caretRangeFromPoint) {
+				editor.selection.setRng(doc.caretRangeFromPoint(e.x, e.y));
+			}
+		}
+
+		contextmenu = editor.settings.contextmenu || 'link image inserttable | cell row column deletetable';
+
+		// Render menu
+		if (!menu) {
+			var items = [];
+
+			tinymce.each(contextmenu.split(/[ ,]/), function(name) {
+				var item = editor.menuItems[name];
+
+				if (name == '|') {
+					item = {text: name};
+				}
+
+				if (item) {
+					item.shortcut = ''; // Hide shortcuts
+					items.push(item);
+				}
+			});
+
+			for (var i = 0; i < items.length; i++) {
+				if (items[i].text == '|') {
+					if (i === 0 || i == items.length - 1) {
+						items.splice(i, 1);
+					}
+				}
+			}
+
+			menu = new tinymce.ui.Menu({
+				items: items,
+				context: 'contextmenu'
+			}).addClass('contextmenu').renderTo();
+
+			editor.on('remove', function() {
+				menu.remove();
+				menu = null;
+			});
+		} else {
+			menu.show();
+		}
+
+		// Position menu
+		var pos = {x: e.pageX, y: e.pageY};
+
+		if (!editor.inline) {
+			pos = tinymce.DOM.getPos(editor.getContentAreaContainer());
+			pos.x += e.clientX;
+			pos.y += e.clientY;
+		}
+
+		menu.moveTo(pos.x, pos.y);
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/contextmenu/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("contextmenu",function(b){var c,a=b.settings.contextmenu_never_use_native;b.on("contextmenu",function(j){var g,h=b.getDoc();if(j.ctrlKey&&!a){return}j.preventDefault();if(tinymce.Env.mac&&tinymce.Env.webkit){if(j.button==2&&h.caretRangeFromPoint){b.selection.setRng(h.caretRangeFromPoint(j.x,j.y))}}g=b.settings.contextmenu||"link image inserttable | cell row column deletetable";if(!c){var d=[];tinymce.each(g.split(/[ ,]/),function(e){var i=b.menuItems[e];if(e=="|"){i={text:e}}if(i){i.shortcut="";d.push(i)}});for(var f=0;f<d.length;f++){if(d[f].text=="|"){if(f===0||f==d.length-1){d.splice(f,1)}}}c=new tinymce.ui.Menu({items:d,context:"contextmenu"}).addClass("contextmenu").renderTo();b.on("remove",function(){c.remove();c=null})}else{c.show()}var k={x:j.pageX,y:j.pageY};if(!b.inline){k=tinymce.DOM.getPos(b.getContentAreaContainer());k.x+=j.clientX;k.y+=j.clientY}c.moveTo(k.x,k.y)})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/directionality/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,64 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('directionality', function(editor) {
+	function setDir(dir) {
+		var dom = editor.dom, curDir, blocks = editor.selection.getSelectedBlocks();
+
+		if (blocks.length) {
+			curDir = dom.getAttrib(blocks[0], "dir");
+
+			tinymce.each(blocks, function(block) {
+				// Add dir to block if the parent block doesn't already have that dir
+				if (!dom.getParent(block.parentNode, "*[dir='" + dir + "']", dom.getRoot())) {
+					if (curDir != dir) {
+						dom.setAttrib(block, "dir", dir);
+					} else {
+						dom.setAttrib(block, "dir", null);
+					}
+				}
+			});
+
+			editor.nodeChanged();
+		}
+	}
+
+	function generateSelector(dir) {
+		var selector = [];
+
+		tinymce.each('h1 h2 h3 h4 h5 h6 div p'.split(' '), function(name) {
+			selector.push(name + '[dir=' + dir + ']');
+		});
+
+		return selector.join(',');
+	}
+
+	editor.addCommand('mceDirectionLTR', function() {
+		setDir("ltr");
+	});
+
+	editor.addCommand('mceDirectionRTL', function() {
+		setDir("rtl");
+	});
+
+	editor.addButton('ltr', {
+		title: 'Left to right',
+		cmd: 'mceDirectionLTR',
+		stateSelector: generateSelector('ltr')
+	});
+
+	editor.addButton('rtl', {
+		title: 'Right to left',
+		cmd: 'mceDirectionRTL',
+		stateSelector: generateSelector('rtl')
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/directionality/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("directionality",function(b){function a(d){var g=b.dom,f,e=b.selection.getSelectedBlocks();if(e.length){f=g.getAttrib(e[0],"dir");tinymce.each(e,function(h){if(!g.getParent(h.parentNode,"*[dir='"+d+"']",g.getRoot())){if(f!=d){g.setAttrib(h,"dir",d)}else{g.setAttrib(h,"dir",null)}}});b.nodeChanged()}}function c(e){var d=[];tinymce.each("h1 h2 h3 h4 h5 h6 div p".split(" "),function(f){d.push(f+"[dir="+e+"]")});return d.join(",")}b.addCommand("mceDirectionLTR",function(){a("ltr")});b.addCommand("mceDirectionRTL",function(){a("rtl")});b.addButton("ltr",{title:"Left to right",cmd:"mceDirectionLTR",stateSelector:c("ltr")});b.addButton("rtl",{title:"Right to left",cmd:"mceDirectionRTL",stateSelector:c("rtl")})});
\ No newline at end of file
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-cool.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-cry.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-embarassed.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-foot-in-mouth.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-frown.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-innocent.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-kiss.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-laughing.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-money-mouth.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-sealed.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-smile.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-surprised.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-tongue-out.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-undecided.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-wink.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/img/smiley-yell.gif has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,65 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('emoticons', function(editor, url) {
+	var emoticons = [
+		["cool", "cry", "embarassed", "foot-in-mouth"],
+		["frown", "innocent", "kiss", "laughing"],
+		["money-mouth", "sealed", "smile", "surprised"],
+		["tongue-out", "undecided", "wink", "yell"]
+	];
+
+	function getHtml() {
+		var emoticonsHtml;
+
+		emoticonsHtml = '<table role="list" class="mce-grid">';
+
+		tinymce.each(emoticons, function(row) {
+			emoticonsHtml += '<tr>';
+
+			tinymce.each(row, function(icon) {
+				var emoticonUrl = url + '/img/smiley-' + icon + '.gif';
+
+				emoticonsHtml += '<td><a href="#" data-mce-url="' + emoticonUrl + '" data-mce-alt="' + icon + '" tabindex="-1" ' +
+					'role="option" aria-label="' + icon + '"><img src="' +
+					emoticonUrl + '" style="width: 18px; height: 18px" role="presentation" /></a></td>';
+			});
+
+			emoticonsHtml += '</tr>';
+		});
+
+		emoticonsHtml += '</table>';
+
+		return emoticonsHtml;
+	}
+
+	editor.addButton('emoticons', {
+		type: 'panelbutton',
+		panel: {
+			role: 'application',
+			autohide: true,
+			html: getHtml,
+			onclick: function(e) {
+				var linkElm = editor.dom.getParent(e.target, 'a');
+
+				if (linkElm) {
+					editor.insertContent(
+						'<img src="' + linkElm.getAttribute('data-mce-url') + '" alt="' + linkElm.getAttribute('data-mce-alt') + '" />'
+					);
+
+					this.hide();
+				}
+			}
+		},
+		tooltip: 'Emoticons'
+	});
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/emoticons/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("emoticons",function(c,a){var b=[["cool","cry","embarassed","foot-in-mouth"],["frown","innocent","kiss","laughing"],["money-mouth","sealed","smile","surprised"],["tongue-out","undecided","wink","yell"]];function d(){var e;e='<table role="list" class="mce-grid">';tinymce.each(b,function(f){e+="<tr>";tinymce.each(f,function(h){var g=a+"/img/smiley-"+h+".gif";e+='<td><a href="#" data-mce-url="'+g+'" data-mce-alt="'+h+'" tabindex="-1" role="option" aria-label="'+h+'"><img src="'+g+'" style="width: 18px; height: 18px" role="presentation" /></a></td>'});e+="</tr>"});e+="</table>";return e}c.addButton("emoticons",{type:"panelbutton",panel:{role:"application",autohide:true,html:d,onclick:function(f){var g=c.dom.getParent(f.target,"a");if(g){c.insertContent('<img src="'+g.getAttribute("data-mce-url")+'" alt="'+g.getAttribute("data-mce-alt")+'" />');this.hide()}}},tooltip:"Emoticons"})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/example/dialog.html	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+<body>
+	<h3>Custom dialog</h3>
+	Input some text: <input id="content">
+	<button onclick="top.tinymce.activeEditor.windowManager.getWindows()[0].close();">Close window</button>
+</body>
+</html>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/example/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,68 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*jshint unused:false */
+/*global tinymce:true */
+
+/**
+ * Example plugin that adds a toolbar button and menu item.
+ */
+tinymce.PluginManager.add('example', function(editor, url) {
+	// Add a button that opens a window
+	editor.addButton('example', {
+		text: 'My button',
+		icon: false,
+		onclick: function() {
+			// Open window
+			editor.windowManager.open({
+				title: 'Example plugin',
+				body: [
+					{type: 'textbox', name: 'title', label: 'Title'}
+				],
+				onsubmit: function(e) {
+					// Insert content when the window form is submitted
+					editor.insertContent('Title: ' + e.data.title);
+				}
+			});
+		}
+	});
+
+	// Adds a menu item to the tools menu
+	editor.addMenuItem('example', {
+		text: 'Example plugin',
+		context: 'tools',
+		onclick: function() {
+			// Open window with a specific url
+			editor.windowManager.open({
+				title: 'TinyMCE site',
+				url: url + '/dialog.html',
+				width: 600,
+				height: 400,
+				buttons: [
+					{
+						text: 'Insert',
+						onclick: function() {
+							// Top most window object
+							var win = editor.windowManager.getWindows()[0];
+
+							// Insert the contents of the dialog.html textarea into the editor
+							editor.insertContent(win.getContentWindow().document.getElementById('content').value);
+
+							// Close the window
+							win.close();
+						}
+					},
+
+					{text: 'Close', onclick: 'close'}
+				]
+			});
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/example/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("example",function(b,a){b.addButton("example",{text:"My button",icon:false,onclick:function(){b.windowManager.open({title:"Example plugin",body:[{type:"textbox",name:"title",label:"Title"}],onsubmit:function(c){b.insertContent("Title: "+c.data.title)}})}});b.addMenuItem("example",{text:"Example plugin",context:"tools",onclick:function(){b.windowManager.open({title:"TinyMCE site",url:a+"/dialog.html",width:600,height:400,buttons:[{text:"Insert",onclick:function(){var c=b.windowManager.getWindows()[0];b.insertContent(c.getContentWindow().document.getElementById("content").value);c.close()}},{text:"Close",onclick:"close"}]})}})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/example_dependency/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,22 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*jshint unused:false */
+/*global tinymce:true */
+
+/**
+ * Register the plugin, specifying the list of the plugins that this plugin depends on.  They are specified in a list,
+ * with the list loaded in order. plugins in this list will be initialised when this plugin is initialized. (before the
+ * init method is called). plugins in a depends list should typically be specified using the short name). If necessary
+ * this can be done with an object which has the url to the plugin and the shortname.
+ */
+tinymce.PluginManager.add('example_dependency', function() {
+	// Example logic here
+}, ['example']);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/example_dependency/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("example_dependency",function(){},["example"]);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/fullpage/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,490 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('fullpage', function(editor) {
+	var each = tinymce.each, Node = tinymce.html.Node;
+	var head, foot;
+
+	function showDialog() {
+		var data = htmlToData();
+
+		editor.windowManager.open({
+			title: 'Document properties',
+			data: data,
+			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) {
+				dataToHtml(tinymce.extend(data, e.data));
+			}
+		});
+	}
+
+	function htmlToData() {
+		var headerFragment = parseHeader(), data = {}, elm, matches;
+
+		function getAttr(elm, name) {
+			var value = elm.attr(name);
+
+			return value || '';
+		}
+
+		// Default some values
+		data.fontface = editor.getParam("fullpage_default_fontface", "");
+		data.fontsize = editor.getParam("fullpage_default_fontsize", "");
+
+		// Parse XML PI
+		elm = headerFragment.firstChild;
+		if (elm.type == 7) {
+			data.xml_pi = true;
+			matches = /encoding="([^"]+)"/.exec(elm.value);
+			if (matches) {
+				data.docencoding = matches[1];
+			}
+		}
+
+		// Parse doctype
+		elm = headerFragment.getAll('#doctype')[0];
+		if (elm) {
+			data.doctype = '<!DOCTYPE' + elm.value + ">";
+		}
+
+		// Parse title element
+		elm = headerFragment.getAll('title')[0];
+		if (elm && elm.firstChild) {
+			data.title = elm.firstChild.value;
+		}
+
+		// Parse meta elements
+		each(headerFragment.getAll('meta'), function(meta) {
+			var name = meta.attr('name'), httpEquiv = meta.attr('http-equiv'), matches;
+
+			if (name) {
+				data[name.toLowerCase()] = meta.attr('content');
+			} else if (httpEquiv == "Content-Type") {
+				matches = /charset\s*=\s*(.*)\s*/gi.exec(meta.attr('content'));
+
+				if (matches) {
+					data.docencoding = matches[1];
+				}
+			}
+		});
+
+		// Parse html attribs
+		elm = headerFragment.getAll('html')[0];
+		if (elm) {
+			data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang');
+		}
+
+		// Parse stylesheets
+		data.stylesheets = [];
+		tinymce.each(headerFragment.getAll('link'), function(link) {
+			if (link.attr('rel') == 'stylesheet') {
+				data.stylesheets.push(link.attr('href'));
+			}
+		});
+
+		// Parse body parts
+		elm = headerFragment.getAll('body')[0];
+		if (elm) {
+			data.langdir = getAttr(elm, 'dir');
+			data.style = getAttr(elm, 'style');
+			data.visited_color = getAttr(elm, 'vlink');
+			data.link_color = getAttr(elm, 'link');
+			data.active_color = getAttr(elm, 'alink');
+		}
+
+		return data;
+	}
+
+	function dataToHtml(data) {
+		var headerFragment, headElement, html, elm, value, dom = editor.dom;
+
+		function setAttr(elm, name, value) {
+			elm.attr(name, value ? value : undefined);
+		}
+
+		function addHeadNode(node) {
+			if (headElement.firstChild) {
+				headElement.insert(node, headElement.firstChild);
+			} else {
+				headElement.append(node);
+			}
+		}
+
+		headerFragment = parseHeader();
+		headElement = headerFragment.getAll('head')[0];
+		if (!headElement) {
+			elm = headerFragment.getAll('html')[0];
+			headElement = new Node('head', 1);
+
+			if (elm.firstChild) {
+				elm.insert(headElement, elm.firstChild, true);
+			} else {
+				elm.append(headElement);
+			}
+		}
+
+		// Add/update/remove XML-PI
+		elm = headerFragment.firstChild;
+		if (data.xml_pi) {
+			value = 'version="1.0"';
+
+			if (data.docencoding) {
+				value += ' encoding="' + data.docencoding + '"';
+			}
+
+			if (elm.type != 7) {
+				elm = new Node('xml', 7);
+				headerFragment.insert(elm, headerFragment.firstChild, true);
+			}
+
+			elm.value = value;
+		} else if (elm && elm.type == 7) {
+			elm.remove();
+		}
+
+		// Add/update/remove doctype
+		elm = headerFragment.getAll('#doctype')[0];
+		if (data.doctype) {
+			if (!elm) {
+				elm = new Node('#doctype', 10);
+
+				if (data.xml_pi) {
+					headerFragment.insert(elm, headerFragment.firstChild);
+				} else {
+					addHeadNode(elm);
+				}
+			}
+
+			elm.value = data.doctype.substring(9, data.doctype.length - 1);
+		} else if (elm) {
+			elm.remove();
+		}
+
+		// Add meta encoding
+		elm = null;
+		each(headerFragment.getAll('meta'), function(meta) {
+			if (meta.attr('http-equiv') == 'Content-Type') {
+				elm = meta;
+			}
+		});
+
+		if (data.docencoding) {
+			if (!elm) {
+				elm = new Node('meta', 1);
+				elm.attr('http-equiv', 'Content-Type');
+				elm.shortEnded = true;
+				addHeadNode(elm);
+			}
+
+			elm.attr('content', 'text/html; charset=' + data.docencoding);
+		} else if (elm) {
+			elm.remove();
+		}
+
+		// Add/update/remove title
+		elm = headerFragment.getAll('title')[0];
+		if (data.title) {
+			if (!elm) {
+				elm = new Node('title', 1);
+				addHeadNode(elm);
+			} else {
+				elm.empty();
+			}
+
+			elm.append(new Node('#text', 3)).value = data.title;
+		} else if (elm) {
+			elm.remove();
+		}
+
+		// Add/update/remove meta
+		each('keywords,description,author,copyright,robots'.split(','), function(name) {
+			var nodes = headerFragment.getAll('meta'), i, meta, value = data[name];
+
+			for (i = 0; i < nodes.length; i++) {
+				meta = nodes[i];
+
+				if (meta.attr('name') == name) {
+					if (value) {
+						meta.attr('content', value);
+					} else {
+						meta.remove();
+					}
+
+					return;
+				}
+			}
+
+			if (value) {
+				elm = new Node('meta', 1);
+				elm.attr('name', name);
+				elm.attr('content', value);
+				elm.shortEnded = true;
+
+				addHeadNode(elm);
+			}
+		});
+
+		var currentStyleSheetsMap = {};
+		tinymce.each(headerFragment.getAll('link'), function(stylesheet) {
+			if (stylesheet.attr('rel') == 'stylesheet') {
+				currentStyleSheetsMap[stylesheet.attr('href')] = stylesheet;
+			}
+		});
+
+		// Add new
+		tinymce.each(data.stylesheets, function(stylesheet) {
+			if (!currentStyleSheetsMap[stylesheet]) {
+				elm = new Node('link', 1);
+				elm.attr({
+					rel: 'stylesheet',
+					text: 'text/css',
+					href: stylesheet
+				});
+				elm.shortEnded = true;
+				addHeadNode(elm);
+			}
+
+			delete currentStyleSheetsMap[stylesheet];
+		});
+
+		// Delete old
+		tinymce.each(currentStyleSheetsMap, function(stylesheet) {
+			stylesheet.remove();
+		});
+
+		// Update body attributes
+		elm = headerFragment.getAll('body')[0];
+		if (elm) {
+			setAttr(elm, 'dir', data.langdir);
+			setAttr(elm, 'style', data.style);
+			setAttr(elm, 'vlink', data.visited_color);
+			setAttr(elm, 'link', data.link_color);
+			setAttr(elm, 'alink', data.active_color);
+
+			// Update iframe body as well
+			dom.setAttribs(editor.getBody(), {
+				style: data.style,
+				dir: data.dir,
+				vLink: data.visited_color,
+				link: data.link_color,
+				aLink: data.active_color
+			});
+		}
+
+		// Set html attributes
+		elm = headerFragment.getAll('html')[0];
+		if (elm) {
+			setAttr(elm, 'lang', data.langcode);
+			setAttr(elm, 'xml:lang', data.langcode);
+		}
+
+		// No need for a head element
+		if (!headElement.firstChild) {
+			headElement.remove();
+		}
+
+		// Serialize header fragment and crop away body part
+		html = new tinymce.html.Serializer({
+			validate: false,
+			indent: true,
+			apply_source_formatting: true,
+			indent_before: 'head,html,body,meta,title,script,link,style',
+			indent_after: 'head,html,body,meta,title,script,link,style'
+		}).serialize(headerFragment);
+
+		head = html.substring(0, html.indexOf('</body>'));
+	}
+
+	function parseHeader() {
+		// Parse the contents with a DOM parser
+		return new tinymce.html.DomParser({
+			validate: false,
+			root_name: '#document'
+		}).parse(head);
+	}
+
+	function setContent(evt) {
+		var startPos, endPos, content = evt.content, headerFragment, styles = '', dom = editor.dom, elm;
+
+		if (evt.selection) {
+			return;
+		}
+
+		function low(s) {
+			return s.replace(/<\/?[A-Z]+/g, function(a) {
+				return a.toLowerCase();
+			});
+		}
+
+		// Ignore raw updated if we already have a head, this will fix issues with undo/redo keeping the head/foot separate
+		if (evt.format == 'raw' && head) {
+			return;
+		}
+
+		if (evt.source_view && editor.getParam('fullpage_hide_in_source_view')) {
+			return;
+		}
+
+		// Fixed so new document/setContent('') doesn't remove existing header/footer except when it's in source code view
+		if (content.length === 0 && !evt.source_view) {
+			content = tinymce.trim(head) + '\n' + tinymce.trim(content) + '\n' + tinymce.trim(foot);
+		}
+
+		// Parse out head, body and footer
+		content = content.replace(/<(\/?)BODY/gi, '<$1body');
+		startPos = content.indexOf('<body');
+
+		if (startPos != -1) {
+			startPos = content.indexOf('>', startPos);
+			head = low(content.substring(0, startPos + 1));
+
+			endPos = content.indexOf('</body', startPos);
+			if (endPos == -1) {
+				endPos = content.length;
+			}
+
+			evt.content = content.substring(startPos + 1, endPos);
+			foot = low(content.substring(endPos));
+		} else {
+			head = getDefaultHeader();
+			foot = '\n</body>\n</html>';
+		}
+
+		// Parse header and update iframe
+		headerFragment = parseHeader();
+		each(headerFragment.getAll('style'), function(node) {
+			if (node.firstChild) {
+				styles += node.firstChild.value;
+			}
+		});
+
+		elm = headerFragment.getAll('body')[0];
+		if (elm) {
+			dom.setAttribs(editor.getBody(), {
+				style: elm.attr('style') || '',
+				dir: elm.attr('dir') || '',
+				vLink: elm.attr('vlink') || '',
+				link: elm.attr('link') || '',
+				aLink: elm.attr('alink') || ''
+			});
+		}
+
+		dom.remove('fullpage_styles');
+
+		var headElm = editor.getDoc().getElementsByTagName('head')[0];
+
+		if (styles) {
+			dom.add(headElm, 'style', {
+				id: 'fullpage_styles'
+			}, styles);
+
+			// Needed for IE 6/7
+			elm = dom.get('fullpage_styles');
+			if (elm.styleSheet) {
+				elm.styleSheet.cssText = styles;
+			}
+		}
+
+		var currentStyleSheetsMap = {};
+		tinymce.each(headElm.getElementsByTagName('link'), function(stylesheet) {
+			if (stylesheet.rel == 'stylesheet' && stylesheet.getAttribute('data-mce-fullpage')) {
+				currentStyleSheetsMap[stylesheet.href] = stylesheet;
+			}
+		});
+
+		// Add new
+		tinymce.each(headerFragment.getAll('link'), function(stylesheet) {
+			var href = stylesheet.attr('href');
+
+			if (!currentStyleSheetsMap[href] && stylesheet.attr('rel') == 'stylesheet') {
+				dom.add(headElm, 'link', {
+					rel: 'stylesheet',
+					text: 'text/css',
+					href: href,
+					'data-mce-fullpage': '1'
+				});
+			}
+
+			delete currentStyleSheetsMap[href];
+		});
+
+		// Delete old
+		tinymce.each(currentStyleSheetsMap, function(stylesheet) {
+			stylesheet.parentNode.removeChild(stylesheet);
+		});
+	}
+
+	function getDefaultHeader() {
+		var header = '', value, styles = '';
+
+		if (editor.getParam('fullpage_default_xml_pi')) {
+			header += '<?xml version="1.0" encoding="' + editor.getParam('fullpage_default_encoding', 'ISO-8859-1') + '" ?>\n';
+		}
+
+		header += editor.getParam('fullpage_default_doctype', '<!DOCTYPE html>');
+		header += '\n<html>\n<head>\n';
+
+		if ((value = editor.getParam('fullpage_default_title'))) {
+			header += '<title>' + value + '</title>\n';
+		}
+
+		if ((value = editor.getParam('fullpage_default_encoding'))) {
+			header += '<meta http-equiv="Content-Type" content="text/html; charset=' + value + '" />\n';
+		}
+
+		if ((value = editor.getParam('fullpage_default_font_family'))) {
+			styles += 'font-family: ' + value + ';';
+		}
+
+		if ((value = editor.getParam('fullpage_default_font_size'))) {
+			styles += 'font-size: ' + value + ';';
+		}
+
+		if ((value = editor.getParam('fullpage_default_text_color'))) {
+			styles += 'color: ' + value + ';';
+		}
+
+		header += '</head>\n<body' + (styles ? ' style="' + styles + '"' : '') + '>\n';
+
+		return header;
+	}
+
+	function getContent(evt) {
+		if (!evt.selection && (!evt.source_view || !editor.getParam('fullpage_hide_in_source_view'))) {
+			evt.content = tinymce.trim(head) + '\n' + tinymce.trim(evt.content) + '\n' + tinymce.trim(foot);
+		}
+	}
+
+	editor.addCommand('mceFullPageProperties', showDialog);
+
+	editor.addButton('fullpage', {
+		title: 'Document properties',
+		cmd: 'mceFullPageProperties'
+	});
+
+	editor.addMenuItem('fullpage', {
+		text: 'Document properties',
+		cmd: 'mceFullPageProperties',
+		context: 'file'
+	});
+
+	editor.on('BeforeSetContent', setContent);
+	editor.on('GetContent', getContent);
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/fullpage/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("fullpage",function(d){var j=tinymce.each,f=tinymce.html.Node;var h,k;function i(){var m=l();d.windowManager.open({title:"Document properties",data:m,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(n){g(tinymce.extend(m,n.data))}})}function l(){var n=e(),p={},q,o;function m(t,r){var s=t.attr(r);return s||""}p.fontface=d.getParam("fullpage_default_fontface","");p.fontsize=d.getParam("fullpage_default_fontsize","");q=n.firstChild;if(q.type==7){p.xml_pi=true;o=/encoding="([^"]+)"/.exec(q.value);if(o){p.docencoding=o[1]}}q=n.getAll("#doctype")[0];if(q){p.doctype="<!DOCTYPE"+q.value+">"}q=n.getAll("title")[0];if(q&&q.firstChild){p.title=q.firstChild.value}j(n.getAll("meta"),function(u){var s=u.attr("name"),r=u.attr("http-equiv"),t;if(s){p[s.toLowerCase()]=u.attr("content")}else{if(r=="Content-Type"){t=/charset\s*=\s*(.*)\s*/gi.exec(u.attr("content"));if(t){p.docencoding=t[1]}}}});q=n.getAll("html")[0];if(q){p.langcode=m(q,"lang")||m(q,"xml:lang")}p.stylesheets=[];tinymce.each(n.getAll("link"),function(r){if(r.attr("rel")=="stylesheet"){p.stylesheets.push(r.attr("href"))}});q=n.getAll("body")[0];if(q){p.langdir=m(q,"dir");p.style=m(q,"style");p.visited_color=m(q,"vlink");p.link_color=m(q,"link");p.active_color=m(q,"alink")}return p}function g(q){var p,n,s,u,v,o=d.dom;function m(y,w,x){y.attr(w,x?x:undefined)}function t(w){if(n.firstChild){n.insert(w,n.firstChild)}else{n.append(w)}}p=e();n=p.getAll("head")[0];if(!n){u=p.getAll("html")[0];n=new f("head",1);if(u.firstChild){u.insert(n,u.firstChild,true)}else{u.append(n)}}u=p.firstChild;if(q.xml_pi){v='version="1.0"';if(q.docencoding){v+=' encoding="'+q.docencoding+'"'}if(u.type!=7){u=new f("xml",7);p.insert(u,p.firstChild,true)}u.value=v}else{if(u&&u.type==7){u.remove()}}u=p.getAll("#doctype")[0];if(q.doctype){if(!u){u=new f("#doctype",10);if(q.xml_pi){p.insert(u,p.firstChild)}else{t(u)}}u.value=q.doctype.substring(9,q.doctype.length-1)}else{if(u){u.remove()}}u=null;j(p.getAll("meta"),function(w){if(w.attr("http-equiv")=="Content-Type"){u=w}});if(q.docencoding){if(!u){u=new f("meta",1);u.attr("http-equiv","Content-Type");u.shortEnded=true;t(u)}u.attr("content","text/html; charset="+q.docencoding)}else{if(u){u.remove()}}u=p.getAll("title")[0];if(q.title){if(!u){u=new f("title",1);t(u)}else{u.empty()}u.append(new f("#text",3)).value=q.title}else{if(u){u.remove()}}j("keywords,description,author,copyright,robots".split(","),function(x){var w=p.getAll("meta"),y,A,z=q[x];for(y=0;y<w.length;y++){A=w[y];if(A.attr("name")==x){if(z){A.attr("content",z)}else{A.remove()}return}}if(z){u=new f("meta",1);u.attr("name",x);u.attr("content",z);u.shortEnded=true;t(u)}});var r={};tinymce.each(p.getAll("link"),function(w){if(w.attr("rel")=="stylesheet"){r[w.attr("href")]=w}});tinymce.each(q.stylesheets,function(w){if(!r[w]){u=new f("link",1);u.attr({rel:"stylesheet",text:"text/css",href:w});u.shortEnded=true;t(u)}delete r[w]});tinymce.each(r,function(w){w.remove()});u=p.getAll("body")[0];if(u){m(u,"dir",q.langdir);m(u,"style",q.style);m(u,"vlink",q.visited_color);m(u,"link",q.link_color);m(u,"alink",q.active_color);o.setAttribs(d.getBody(),{style:q.style,dir:q.dir,vLink:q.visited_color,link:q.link_color,aLink:q.active_color})}u=p.getAll("html")[0];if(u){m(u,"lang",q.langcode);m(u,"xml:lang",q.langcode)}if(!n.firstChild){n.remove()}s=new tinymce.html.Serializer({validate:false,indent:true,apply_source_formatting:true,indent_before:"head,html,body,meta,title,script,link,style",indent_after:"head,html,body,meta,title,script,link,style"}).serialize(p);h=s.substring(0,s.indexOf("</body>"))}function e(){return new tinymce.html.DomParser({validate:false,root_name:"#document"}).parse(h)}function b(v){var s,m,r=v.content,o,w="",n=d.dom,t;if(v.selection){return}function u(x){return x.replace(/<\/?[A-Z]+/g,function(y){return y.toLowerCase()})}if(v.format=="raw"&&h){return}if(v.source_view&&d.getParam("fullpage_hide_in_source_view")){return}if(r.length===0&&!v.source_view){r=tinymce.trim(h)+"\n"+tinymce.trim(r)+"\n"+tinymce.trim(k)}r=r.replace(/<(\/?)BODY/gi,"<$1body");s=r.indexOf("<body");if(s!=-1){s=r.indexOf(">",s);h=u(r.substring(0,s+1));m=r.indexOf("</body",s);if(m==-1){m=r.length}v.content=r.substring(s+1,m);k=u(r.substring(m))}else{h=a();k="\n</body>\n</html>"}o=e();j(o.getAll("style"),function(x){if(x.firstChild){w+=x.firstChild.value}});t=o.getAll("body")[0];if(t){n.setAttribs(d.getBody(),{style:t.attr("style")||"",dir:t.attr("dir")||"",vLink:t.attr("vlink")||"",link:t.attr("link")||"",aLink:t.attr("alink")||""})}n.remove("fullpage_styles");var q=d.getDoc().getElementsByTagName("head")[0];if(w){n.add(q,"style",{id:"fullpage_styles"},w);t=n.get("fullpage_styles");if(t.styleSheet){t.styleSheet.cssText=w}}var p={};tinymce.each(q.getElementsByTagName("link"),function(x){if(x.rel=="stylesheet"&&x.getAttribute("data-mce-fullpage")){p[x.href]=x}});tinymce.each(o.getAll("link"),function(y){var x=y.attr("href");if(!p[x]&&y.attr("rel")=="stylesheet"){n.add(q,"link",{rel:"stylesheet",text:"text/css",href:x,"data-mce-fullpage":"1"})}delete p[x]});tinymce.each(p,function(x){x.parentNode.removeChild(x)})}function a(){var o="",n,m="";if(d.getParam("fullpage_default_xml_pi")){o+='<?xml version="1.0" encoding="'+d.getParam("fullpage_default_encoding","ISO-8859-1")+'" ?>\n'}o+=d.getParam("fullpage_default_doctype","<!DOCTYPE html>");o+="\n<html>\n<head>\n";if((n=d.getParam("fullpage_default_title"))){o+="<title>"+n+"</title>\n"}if((n=d.getParam("fullpage_default_encoding"))){o+='<meta http-equiv="Content-Type" content="text/html; charset='+n+'" />\n'}if((n=d.getParam("fullpage_default_font_family"))){m+="font-family: "+n+";"}if((n=d.getParam("fullpage_default_font_size"))){m+="font-size: "+n+";"}if((n=d.getParam("fullpage_default_text_color"))){m+="color: "+n+";"}o+="</head>\n<body"+(m?' style="'+m+'"':"")+">\n";return o}function c(m){if(!m.selection&&(!m.source_view||!d.getParam("fullpage_hide_in_source_view"))){m.content=tinymce.trim(h)+"\n"+tinymce.trim(m.content)+"\n"+tinymce.trim(k)}}d.addCommand("mceFullPageProperties",i);d.addButton("fullpage",{title:"Document properties",cmd:"mceFullPageProperties"});d.addMenuItem("fullpage",{text:"Document properties",cmd:"mceFullPageProperties",context:"file"});d.on("BeforeSetContent",b);d.on("GetContent",c)});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/fullscreen/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,136 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('fullscreen', function(editor) {
+	var fullscreenState = false, DOM = tinymce.DOM, iframeWidth, iframeHeight, resizeHandler;
+	var containerWidth, containerHeight;
+
+	if (editor.settings.inline) {
+		return;
+	}
+
+	function getWindowSize() {
+		var w, h, win = window, doc = document;
+		var body = doc.body;
+
+		// Old IE
+		if (body.offsetWidth) {
+			w = body.offsetWidth;
+			h = body.offsetHeight;
+		}
+
+		// Modern browsers
+		if (win.innerWidth && win.innerHeight) {
+			w = win.innerWidth;
+			h = win.innerHeight;
+		}
+
+		return {w: w, h: h};
+	}
+
+	function toggleFullscreen() {
+		var body = document.body, documentElement = document.documentElement, editorContainerStyle;
+		var editorContainer, iframe, iframeStyle;
+
+		function resize() {
+			DOM.setStyle(iframe, 'height', getWindowSize().h - (editorContainer.clientHeight - iframe.clientHeight));
+		}
+
+		fullscreenState = !fullscreenState;
+
+		editorContainer = editor.getContainer();
+		editorContainerStyle = editorContainer.style;
+		iframe = editor.getContentAreaContainer().firstChild;
+		iframeStyle = iframe.style;
+
+		if (fullscreenState) {
+			iframeWidth = iframeStyle.width;
+			iframeHeight = iframeStyle.height;
+			iframeStyle.width = iframeStyle.height = '100%';
+			containerWidth = editorContainerStyle.width;
+			containerHeight = editorContainerStyle.height;
+			editorContainerStyle.width = editorContainerStyle.height = '';
+
+			DOM.addClass(body, 'mce-fullscreen');
+			DOM.addClass(documentElement, 'mce-fullscreen');
+			DOM.addClass(editorContainer, 'mce-fullscreen');
+
+			DOM.bind(window, 'resize', resize);
+			resize();
+			resizeHandler = resize;
+		} else {
+			iframeStyle.width = iframeWidth;
+			iframeStyle.height = iframeHeight;
+
+			if (containerWidth) {
+				editorContainerStyle.width = containerWidth;
+			}
+
+			if (containerHeight) {
+				editorContainerStyle.height = containerHeight;
+			}
+
+			DOM.removeClass(body, 'mce-fullscreen');
+			DOM.removeClass(documentElement, 'mce-fullscreen');
+			DOM.removeClass(editorContainer, 'mce-fullscreen');
+			DOM.unbind(window, 'resize', resizeHandler);
+		}
+
+		editor.fire('FullscreenStateChanged', {state: fullscreenState});
+	}
+
+	editor.on('init', function() {
+		editor.addShortcut('Meta+Alt+F', '', toggleFullscreen);
+	});
+
+	editor.on('remove', function() {
+		if (resizeHandler) {
+			DOM.unbind(window, 'resize', resizeHandler);
+		}
+	});
+
+	editor.addCommand('mceFullScreen', toggleFullscreen);
+
+	editor.addMenuItem('fullscreen', {
+		text: 'Fullscreen',
+		shortcut: 'Meta+Alt+F',
+		selectable: true,
+		onClick: toggleFullscreen,
+		onPostRender: function() {
+			var self = this;
+
+			editor.on('FullscreenStateChanged', function(e) {
+				self.active(e.state);
+			});
+		},
+		context: 'view'
+	});
+
+	editor.addButton('fullscreen', {
+		tooltip: 'Fullscreen',
+		shortcut: 'Meta+Alt+F',
+		onClick: toggleFullscreen,
+		onPostRender: function() {
+			var self = this;
+
+			editor.on('FullscreenStateChanged', function(e) {
+				self.active(e.state);
+			});
+		}
+	});
+
+	return {
+		isFullscreen: function() {
+			return fullscreenState;
+		}
+	};
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/fullscreen/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("fullscreen",function(g){var d=false,i=tinymce.DOM,f,e,b;var h,j;if(g.settings.inline){return}function c(){var l,m,o=window,n=document;var k=n.body;if(k.offsetWidth){l=k.offsetWidth;m=k.offsetHeight}if(o.innerWidth&&o.innerHeight){l=o.innerWidth;m=o.innerHeight}return{w:l,h:m}}function a(){var l=document.body,q=document.documentElement,o;var p,n,k;function m(){i.setStyle(n,"height",c().h-(p.clientHeight-n.clientHeight))}d=!d;p=g.getContainer();o=p.style;n=g.getContentAreaContainer().firstChild;k=n.style;if(d){f=k.width;e=k.height;k.width=k.height="100%";h=o.width;j=o.height;o.width=o.height="";i.addClass(l,"mce-fullscreen");i.addClass(q,"mce-fullscreen");i.addClass(p,"mce-fullscreen");i.bind(window,"resize",m);m();b=m}else{k.width=f;k.height=e;if(h){o.width=h}if(j){o.height=j}i.removeClass(l,"mce-fullscreen");i.removeClass(q,"mce-fullscreen");i.removeClass(p,"mce-fullscreen");i.unbind(window,"resize",b)}g.fire("FullscreenStateChanged",{state:d})}g.on("init",function(){g.addShortcut("Meta+Alt+F","",a)});g.on("remove",function(){if(b){i.unbind(window,"resize",b)}});g.addCommand("mceFullScreen",a);g.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Meta+Alt+F",selectable:true,onClick:a,onPostRender:function(){var k=this;g.on("FullscreenStateChanged",function(l){k.active(l.state)})},context:"view"});g.addButton("fullscreen",{tooltip:"Fullscreen",shortcut:"Meta+Alt+F",onClick:a,onPostRender:function(){var k=this;g.on("FullscreenStateChanged",function(l){k.active(l.state)})}});return{isFullscreen:function(){return d}}});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/hr/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,30 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('hr', function(editor) {
+	editor.addCommand('InsertHorizontalRule', function() {
+		editor.execCommand('mceInsertContent', false, '<hr />');
+	});
+
+	editor.addButton('hr', {
+		icon: 'hr',
+		tooltip: 'Horizontal line',
+		cmd: 'InsertHorizontalRule'
+	});
+
+	editor.addMenuItem('hr', {
+		icon: 'hr',
+		text: 'Horizontal line',
+		cmd: 'InsertHorizontalRule',
+		context: 'insert'
+	});
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/hr/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("hr",function(a){a.addCommand("InsertHorizontalRule",function(){a.execCommand("mceInsertContent",false,"<hr />")});a.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"});a.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/image/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,548 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('image', function(editor) {
+	function getImageSize(url, callback) {
+		var img = document.createElement('img');
+
+		function done(width, height) {
+			if (img.parentNode) {
+				img.parentNode.removeChild(img);
+			}
+
+			callback({width: width, height: height});
+		}
+
+		img.onload = function() {
+			done(img.clientWidth, img.clientHeight);
+		};
+
+		img.onerror = function() {
+			done();
+		};
+
+		var style = img.style;
+		style.visibility = 'hidden';
+		style.position = 'fixed';
+		style.bottom = style.left = 0;
+		style.width = style.height = 'auto';
+
+		document.body.appendChild(img);
+		img.src = url;
+	}
+
+	function buildListItems(inputList, itemCallback, startItems) {
+		function appendItems(values, output) {
+			output = output || [];
+
+			tinymce.each(values, function(item) {
+				var menuItem = {text: item.text || item.title};
+
+				if (item.menu) {
+					menuItem.menu = appendItems(item.menu);
+				} else {
+					menuItem.value = item.value;
+					itemCallback(menuItem);
+				}
+
+				output.push(menuItem);
+			});
+
+			return output;
+		}
+
+		return appendItems(inputList, startItems || []);
+	}
+
+	function createImageList(callback) {
+		return function() {
+			var imageList = editor.settings.image_list;
+
+			if (typeof imageList == "string") {
+				tinymce.util.XHR.send({
+					url: imageList,
+					success: function(text) {
+						callback(tinymce.util.JSON.parse(text));
+					}
+				});
+			} else if (typeof imageList == "function") {
+				imageList(callback);
+			} else {
+				callback(imageList);
+			}
+		};
+	}
+
+	function showDialog(imageList) {
+		var win, data = {}, dom = editor.dom, imgElm = editor.selection.getNode();
+		var width, height, imageListCtrl, classListCtrl, imageDimensions = editor.settings.image_dimensions !== false;
+
+		function recalcSize() {
+			var widthCtrl, heightCtrl, newWidth, newHeight;
+
+			widthCtrl = win.find('#width')[0];
+			heightCtrl = win.find('#height')[0];
+
+			if (!widthCtrl || !heightCtrl) {
+				return;
+			}
+
+			newWidth = widthCtrl.value();
+			newHeight = heightCtrl.value();
+
+			if (win.find('#constrain')[0].checked() && width && height && newWidth && newHeight) {
+				if (width != newWidth) {
+					newHeight = Math.round((newWidth / width) * newHeight);
+
+					if (!isNaN(newHeight)) {
+						heightCtrl.value(newHeight);
+					}
+				} else {
+					newWidth = Math.round((newHeight / height) * newWidth);
+
+					if (!isNaN(newWidth)) {
+						widthCtrl.value(newWidth);
+					}
+				}
+			}
+
+			width = newWidth;
+			height = newHeight;
+		}
+
+		function onSubmitForm() {
+			function waitLoad(imgElm) {
+				function selectImage() {
+					imgElm.onload = imgElm.onerror = null;
+
+					if (editor.selection) {
+						editor.selection.select(imgElm);
+						editor.nodeChanged();
+					}
+				}
+
+				imgElm.onload = function() {
+					if (!data.width && !data.height && imageDimensions) {
+						dom.setAttribs(imgElm, {
+							width: imgElm.clientWidth,
+							height: imgElm.clientHeight
+						});
+					}
+
+					selectImage();
+				};
+
+				imgElm.onerror = selectImage;
+			}
+
+			updateStyle();
+			recalcSize();
+
+			data = tinymce.extend(data, win.toJSON());
+
+			if (!data.alt) {
+				data.alt = '';
+			}
+
+			if (!data.title) {
+				data.title = '';
+			}
+
+			if (data.width === '') {
+				data.width = null;
+			}
+
+			if (data.height === '') {
+				data.height = null;
+			}
+
+			if (!data.style) {
+				data.style = null;
+			}
+
+			// Setup new data excluding style properties
+			/*eslint dot-notation: 0*/
+			data = {
+				src: data.src,
+				alt: data.alt,
+				title: data.title,
+				width: data.width,
+				height: data.height,
+				style: data.style,
+				"class": data["class"]
+			};
+
+			editor.undoManager.transact(function() {
+				if (!data.src) {
+					if (imgElm) {
+						dom.remove(imgElm);
+						editor.focus();
+						editor.nodeChanged();
+					}
+
+					return;
+				}
+
+				if (data.title === "") {
+					data.title = null;
+				}
+
+				if (!imgElm) {
+					data.id = '__mcenew';
+					editor.focus();
+					editor.selection.setContent(dom.createHTML('img', data));
+					imgElm = dom.get('__mcenew');
+					dom.setAttrib(imgElm, 'id', null);
+				} else {
+					dom.setAttribs(imgElm, data);
+				}
+
+				waitLoad(imgElm);
+			});
+		}
+
+		function removePixelSuffix(value) {
+			if (value) {
+				value = value.replace(/px$/, '');
+			}
+
+			return value;
+		}
+
+		function srcChange(e) {
+			var srcURL, prependURL, absoluteURLPattern, meta = e.meta || {};
+
+			if (imageListCtrl) {
+				imageListCtrl.value(editor.convertURL(this.value(), 'src'));
+			}
+
+			tinymce.each(meta, function(value, key) {
+				win.find('#' + key).value(value);
+			});
+
+			if (!meta.width && !meta.height) {
+				srcURL = editor.convertURL(this.value(), 'src');
+
+				// Pattern test the src url and make sure we haven't already prepended the url
+				prependURL = editor.settings.image_prepend_url;
+				absoluteURLPattern = new RegExp('^(?:[a-z]+:)?//', 'i');
+				if (prependURL && !absoluteURLPattern.test(srcURL) && srcURL.substring(0, prependURL.length) !== prependURL) {
+					srcURL = prependURL + srcURL;
+				}
+
+				this.value(srcURL);
+
+				getImageSize(editor.documentBaseURI.toAbsolute(this.value()), function(data) {
+					if (data.width && data.height && imageDimensions) {
+						width = data.width;
+						height = data.height;
+
+						win.find('#width').value(width);
+						win.find('#height').value(height);
+					}
+				});
+			}
+		}
+
+		width = dom.getAttrib(imgElm, 'width');
+		height = dom.getAttrib(imgElm, 'height');
+
+		if (imgElm.nodeName == 'IMG' && !imgElm.getAttribute('data-mce-object') && !imgElm.getAttribute('data-mce-placeholder')) {
+			data = {
+				src: dom.getAttrib(imgElm, 'src'),
+				alt: dom.getAttrib(imgElm, 'alt'),
+				title: dom.getAttrib(imgElm, 'title'),
+				"class": dom.getAttrib(imgElm, 'class'),
+				width: width,
+				height: height
+			};
+		} else {
+			imgElm = null;
+		}
+
+		if (imageList) {
+			imageListCtrl = {
+				type: 'listbox',
+				label: 'Image list',
+				values: buildListItems(
+					imageList,
+					function(item) {
+						item.value = editor.convertURL(item.value || item.url, 'src');
+					},
+					[{text: 'None', value: ''}]
+				),
+				value: data.src && editor.convertURL(data.src, 'src'),
+				onselect: function(e) {
+					var altCtrl = win.find('#alt');
+
+					if (!altCtrl.value() || (e.lastControl && altCtrl.value() == e.lastControl.text())) {
+						altCtrl.value(e.control.text());
+					}
+
+					win.find('#src').value(e.control.value()).fire('change');
+				},
+				onPostRender: function() {
+					imageListCtrl = this;
+				}
+			};
+		}
+
+		if (editor.settings.image_class_list) {
+			classListCtrl = {
+				name: 'class',
+				type: 'listbox',
+				label: 'Class',
+				values: buildListItems(
+					editor.settings.image_class_list,
+					function(item) {
+						if (item.value) {
+							item.textStyle = function() {
+								return editor.formatter.getCssText({inline: 'img', classes: [item.value]});
+							};
+						}
+					}
+				)
+			};
+		}
+
+		// General settings shared between simple and advanced dialogs
+		var generalFormItems = [
+			{
+				name: 'src',
+				type: 'filepicker',
+				filetype: 'image',
+				label: 'Source',
+				autofocus: true,
+				onchange: srcChange
+			},
+			imageListCtrl
+		];
+
+		if (editor.settings.image_description !== false) {
+			generalFormItems.push({name: 'alt', type: 'textbox', label: 'Image description'});
+		}
+
+		if (editor.settings.image_title) {
+			generalFormItems.push({name: 'title', type: 'textbox', label: 'Image Title'});
+		}
+
+		if (imageDimensions) {
+			generalFormItems.push({
+				type: 'container',
+				label: 'Dimensions',
+				layout: 'flex',
+				direction: 'row',
+				align: 'center',
+				spacing: 5,
+				items: [
+					{name: 'width', type: 'textbox', maxLength: 5, size: 3, onchange: recalcSize, ariaLabel: 'Width'},
+					{type: 'label', text: 'x'},
+					{name: 'height', type: 'textbox', maxLength: 5, size: 3, onchange: recalcSize, ariaLabel: 'Height'},
+					{name: 'constrain', type: 'checkbox', checked: true, text: 'Constrain proportions'}
+				]
+			});
+		}
+
+		generalFormItems.push(classListCtrl);
+
+		function mergeMargins(css) {
+			if (css.margin) {
+
+				var splitMargin = css.margin.split(" ");
+
+				switch (splitMargin.length) {
+					case 1: //margin: toprightbottomleft;
+						css['margin-top'] = css['margin-top'] || splitMargin[0];
+						css['margin-right'] = css['margin-right'] || splitMargin[0];
+						css['margin-bottom'] = css['margin-bottom'] || splitMargin[0];
+						css['margin-left'] = css['margin-left'] || splitMargin[0];
+						break;
+					case 2: //margin: topbottom rightleft;
+						css['margin-top'] = css['margin-top'] || splitMargin[0];
+						css['margin-right'] = css['margin-right'] || splitMargin[1];
+						css['margin-bottom'] = css['margin-bottom'] || splitMargin[0];
+						css['margin-left'] = css['margin-left'] || splitMargin[1];
+						break;
+					case 3: //margin: top rightleft bottom;
+						css['margin-top'] = css['margin-top'] || splitMargin[0];
+						css['margin-right'] = css['margin-right'] || splitMargin[1];
+						css['margin-bottom'] = css['margin-bottom'] || splitMargin[2];
+						css['margin-left'] = css['margin-left'] || splitMargin[1];
+						break;
+					case 4: //margin: top right bottom left;
+						css['margin-top'] = css['margin-top'] || splitMargin[0];
+						css['margin-right'] = css['margin-right'] || splitMargin[1];
+						css['margin-bottom'] = css['margin-bottom'] || splitMargin[2];
+						css['margin-left'] = css['margin-left'] || splitMargin[3];
+				}
+				delete css.margin;
+			}
+			return css;
+		}
+
+		function updateStyle() {
+			function addPixelSuffix(value) {
+				if (value.length > 0 && /^[0-9]+$/.test(value)) {
+					value += 'px';
+				}
+
+				return value;
+			}
+
+			if (!editor.settings.image_advtab) {
+				return;
+			}
+
+			var data = win.toJSON(),
+				css = dom.parseStyle(data.style);
+
+			css = mergeMargins(css);
+
+			if (data.vspace) {
+				css['margin-top'] = css['margin-bottom'] = addPixelSuffix(data.vspace);
+			}
+			if (data.hspace) {
+				css['margin-left'] = css['margin-right'] = addPixelSuffix(data.hspace);
+			}
+			if (data.border) {
+				css['border-width'] = addPixelSuffix(data.border);
+			}
+
+			win.find('#style').value(dom.serializeStyle(dom.parseStyle(dom.serializeStyle(css))));
+		}
+
+		function updateVSpaceHSpaceBorder() {
+			if (!editor.settings.image_advtab) {
+				return;
+			}
+
+			var data = win.toJSON(),
+				css = dom.parseStyle(data.style);
+
+			win.find('#vspace').value("");
+			win.find('#hspace').value("");
+
+			css = mergeMargins(css);
+
+			//Move opposite equal margins to vspace/hspace field
+			if ((css['margin-top'] && css['margin-bottom']) || (css['margin-right'] && css['margin-left'])) {
+				if (css['margin-top'] === css['margin-bottom']) {
+					win.find('#vspace').value(removePixelSuffix(css['margin-top']));
+				} else {
+					win.find('#vspace').value('');
+				}
+				if (css['margin-right'] === css['margin-left']) {
+					win.find('#hspace').value(removePixelSuffix(css['margin-right']));
+				} else {
+					win.find('#hspace').value('');
+				}
+			}
+
+			//Move border-width
+			if (css['border-width']) {
+				win.find('#border').value(removePixelSuffix(css['border-width']));
+			}
+
+			win.find('#style').value(dom.serializeStyle(dom.parseStyle(dom.serializeStyle(css))));
+
+		}
+
+		if (editor.settings.image_advtab) {
+			// Parse styles from img
+			if (imgElm) {
+				if (imgElm.style.marginLeft && imgElm.style.marginRight && imgElm.style.marginLeft === imgElm.style.marginRight) {
+					data.hspace = removePixelSuffix(imgElm.style.marginLeft);
+				}
+				if (imgElm.style.marginTop && imgElm.style.marginBottom && imgElm.style.marginTop === imgElm.style.marginBottom) {
+					data.vspace = removePixelSuffix(imgElm.style.marginTop);
+				}
+				if (imgElm.style.borderWidth) {
+					data.border = removePixelSuffix(imgElm.style.borderWidth);
+				}
+
+				data.style = editor.dom.serializeStyle(editor.dom.parseStyle(editor.dom.getAttrib(imgElm, 'style')));
+			}
+
+			// Advanced dialog shows general+advanced tabs
+			win = editor.windowManager.open({
+				title: 'Insert/edit image',
+				data: data,
+				bodyType: 'tabpanel',
+				body: [
+					{
+						title: 'General',
+						type: 'form',
+						items: generalFormItems
+					},
+
+					{
+						title: 'Advanced',
+						type: 'form',
+						pack: 'start',
+						items: [
+							{
+								label: 'Style',
+								name: 'style',
+								type: 'textbox',
+								onchange: updateVSpaceHSpaceBorder
+							},
+							{
+								type: 'form',
+								layout: 'grid',
+								packV: 'start',
+								columns: 2,
+								padding: 0,
+								alignH: ['left', 'right'],
+								defaults: {
+									type: 'textbox',
+									maxWidth: 50,
+									onchange: updateStyle
+								},
+								items: [
+									{label: 'Vertical space', name: 'vspace'},
+									{label: 'Horizontal space', name: 'hspace'},
+									{label: 'Border', name: 'border'}
+								]
+							}
+						]
+					}
+				],
+				onSubmit: onSubmitForm
+			});
+		} else {
+			// Simple default dialog
+			win = editor.windowManager.open({
+				title: 'Insert/edit image',
+				data: data,
+				body: generalFormItems,
+				onSubmit: onSubmitForm
+			});
+		}
+	}
+
+	editor.addButton('image', {
+		icon: 'image',
+		tooltip: 'Insert/edit image',
+		onclick: createImageList(showDialog),
+		stateSelector: 'img:not([data-mce-object],[data-mce-placeholder])'
+	});
+
+	editor.addMenuItem('image', {
+		icon: 'image',
+		text: 'Insert/edit image',
+		onclick: createImageList(showDialog),
+		context: 'insert',
+		prependToContext: true
+	});
+
+	editor.addCommand('mceImage', createImageList(showDialog));
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/image/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("image",function(e){function c(h,j){var g=document.createElement("img");function f(l,k){if(g.parentNode){g.parentNode.removeChild(g)}j({width:l,height:k})}g.onload=function(){f(g.clientWidth,g.clientHeight)};g.onerror=function(){f()};var i=g.style;i.visibility="hidden";i.position="fixed";i.bottom=i.left=0;i.width=i.height="auto";document.body.appendChild(g);g.src=h}function d(h,f,i){function g(k,j){j=j||[];tinymce.each(k,function(m){var l={text:m.text||m.title};if(m.menu){l.menu=g(m.menu)}else{l.value=m.value;f(l)}j.push(l)});return j}return g(h,i||[])}function b(f){return function(){var g=e.settings.image_list;if(typeof g=="string"){tinymce.util.XHR.send({url:g,success:function(h){f(tinymce.util.JSON.parse(h))}})}else{if(typeof g=="function"){g(f)}else{f(g)}}}}function a(p){var j,w={},r=e.dom,g=e.selection.getNode();var o,m,s,i,k=e.settings.image_dimensions!==false;function f(){var y,A,z,x;y=j.find("#width")[0];A=j.find("#height")[0];if(!y||!A){return}z=y.value();x=A.value();if(j.find("#constrain")[0].checked()&&o&&m&&z&&x){if(o!=z){x=Math.round((z/o)*x);if(!isNaN(x)){A.value(x)}}else{z=Math.round((x/m)*z);if(!isNaN(z)){y.value(z)}}}o=z;m=x}function l(){function x(z){function y(){z.onload=z.onerror=null;if(e.selection){e.selection.select(z);e.nodeChanged()}}z.onload=function(){if(!w.width&&!w.height&&k){r.setAttribs(z,{width:z.clientWidth,height:z.clientHeight})}y()};z.onerror=y}n();f();w=tinymce.extend(w,j.toJSON());if(!w.alt){w.alt=""}if(!w.title){w.title=""}if(w.width===""){w.width=null}if(w.height===""){w.height=null}if(!w.style){w.style=null}w={src:w.src,alt:w.alt,title:w.title,width:w.width,height:w.height,style:w.style,"class":w["class"]};e.undoManager.transact(function(){if(!w.src){if(g){r.remove(g);e.focus();e.nodeChanged()}return}if(w.title===""){w.title=null}if(!g){w.id="__mcenew";e.focus();e.selection.setContent(r.createHTML("img",w));g=r.get("__mcenew");r.setAttrib(g,"id",null)}else{r.setAttribs(g,w)}x(g)})}function v(x){if(x){x=x.replace(/px$/,"")}return x}function q(A){var B,y,x,z=A.meta||{};if(s){s.value(e.convertURL(this.value(),"src"))}tinymce.each(z,function(D,C){j.find("#"+C).value(D)});if(!z.width&&!z.height){B=e.convertURL(this.value(),"src");y=e.settings.image_prepend_url;x=new RegExp("^(?:[a-z]+:)?//","i");if(y&&!x.test(B)&&B.substring(0,y.length)!==y){B=y+B}this.value(B);c(e.documentBaseURI.toAbsolute(this.value()),function(C){if(C.width&&C.height&&k){o=C.width;m=C.height;j.find("#width").value(o);j.find("#height").value(m)}})}}o=r.getAttrib(g,"width");m=r.getAttrib(g,"height");if(g.nodeName=="IMG"&&!g.getAttribute("data-mce-object")&&!g.getAttribute("data-mce-placeholder")){w={src:r.getAttrib(g,"src"),alt:r.getAttrib(g,"alt"),title:r.getAttrib(g,"title"),"class":r.getAttrib(g,"class"),width:o,height:m}}else{g=null}if(p){s={type:"listbox",label:"Image list",values:d(p,function(x){x.value=e.convertURL(x.value||x.url,"src")},[{text:"None",value:""}]),value:w.src&&e.convertURL(w.src,"src"),onselect:function(x){var y=j.find("#alt");if(!y.value()||(x.lastControl&&y.value()==x.lastControl.text())){y.value(x.control.text())}j.find("#src").value(x.control.value()).fire("change")},onPostRender:function(){s=this}}}if(e.settings.image_class_list){i={name:"class",type:"listbox",label:"Class",values:d(e.settings.image_class_list,function(x){if(x.value){x.textStyle=function(){return e.formatter.getCssText({inline:"img",classes:[x.value]})}}})}}var u=[{name:"src",type:"filepicker",filetype:"image",label:"Source",autofocus:true,onchange:q},s];if(e.settings.image_description!==false){u.push({name:"alt",type:"textbox",label:"Image description"})}if(e.settings.image_title){u.push({name:"title",type:"textbox",label:"Image Title"})}if(k){u.push({type:"container",label:"Dimensions",layout:"flex",direction:"row",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:3,onchange:f,ariaLabel:"Width"},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:3,onchange:f,ariaLabel:"Height"},{name:"constrain",type:"checkbox",checked:true,text:"Constrain proportions"}]})}u.push(i);function t(y){if(y.margin){var x=y.margin.split(" ");switch(x.length){case 1:y["margin-top"]=y["margin-top"]||x[0];y["margin-right"]=y["margin-right"]||x[0];y["margin-bottom"]=y["margin-bottom"]||x[0];y["margin-left"]=y["margin-left"]||x[0];break;case 2:y["margin-top"]=y["margin-top"]||x[0];y["margin-right"]=y["margin-right"]||x[1];y["margin-bottom"]=y["margin-bottom"]||x[0];y["margin-left"]=y["margin-left"]||x[1];break;case 3:y["margin-top"]=y["margin-top"]||x[0];y["margin-right"]=y["margin-right"]||x[1];y["margin-bottom"]=y["margin-bottom"]||x[2];y["margin-left"]=y["margin-left"]||x[1];break;case 4:y["margin-top"]=y["margin-top"]||x[0];y["margin-right"]=y["margin-right"]||x[1];y["margin-bottom"]=y["margin-bottom"]||x[2];y["margin-left"]=y["margin-left"]||x[3]}delete y.margin}return y}function n(){function z(A){if(A.length>0&&/^[0-9]+$/.test(A)){A+="px"}return A}if(!e.settings.image_advtab){return}var y=j.toJSON(),x=r.parseStyle(y.style);x=t(x);if(y.vspace){x["margin-top"]=x["margin-bottom"]=z(y.vspace)}if(y.hspace){x["margin-left"]=x["margin-right"]=z(y.hspace)}if(y.border){x["border-width"]=z(y.border)}j.find("#style").value(r.serializeStyle(r.parseStyle(r.serializeStyle(x))))}function h(){if(!e.settings.image_advtab){return}var y=j.toJSON(),x=r.parseStyle(y.style);j.find("#vspace").value("");j.find("#hspace").value("");x=t(x);if((x["margin-top"]&&x["margin-bottom"])||(x["margin-right"]&&x["margin-left"])){if(x["margin-top"]===x["margin-bottom"]){j.find("#vspace").value(v(x["margin-top"]))}else{j.find("#vspace").value("")}if(x["margin-right"]===x["margin-left"]){j.find("#hspace").value(v(x["margin-right"]))}else{j.find("#hspace").value("")}}if(x["border-width"]){j.find("#border").value(v(x["border-width"]))}j.find("#style").value(r.serializeStyle(r.parseStyle(r.serializeStyle(x))))}if(e.settings.image_advtab){if(g){if(g.style.marginLeft&&g.style.marginRight&&g.style.marginLeft===g.style.marginRight){w.hspace=v(g.style.marginLeft)}if(g.style.marginTop&&g.style.marginBottom&&g.style.marginTop===g.style.marginBottom){w.vspace=v(g.style.marginTop)}if(g.style.borderWidth){w.border=v(g.style.borderWidth)}w.style=e.dom.serializeStyle(e.dom.parseStyle(e.dom.getAttrib(g,"style")))}j=e.windowManager.open({title:"Insert/edit image",data:w,bodyType:"tabpanel",body:[{title:"General",type:"form",items:u},{title:"Advanced",type:"form",pack:"start",items:[{label:"Style",name:"style",type:"textbox",onchange:h},{type:"form",layout:"grid",packV:"start",columns:2,padding:0,alignH:["left","right"],defaults:{type:"textbox",maxWidth:50,onchange:n},items:[{label:"Vertical space",name:"vspace"},{label:"Horizontal space",name:"hspace"},{label:"Border",name:"border"}]}]}],onSubmit:l})}else{j=e.windowManager.open({title:"Insert/edit image",data:w,body:u,onSubmit:l})}}e.addButton("image",{icon:"image",tooltip:"Insert/edit image",onclick:b(a),stateSelector:"img:not([data-mce-object],[data-mce-placeholder])"});e.addMenuItem("image",{icon:"image",text:"Insert/edit image",onclick:b(a),context:"insert",prependToContext:true});e.addCommand("mceImage",b(a))});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/importcss/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,195 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('importcss', function(editor) {
+	var self = this, each = tinymce.each;
+
+	function compileFilter(filter) {
+		if (typeof filter == "string") {
+			return function(value) {
+				return value.indexOf(filter) !== -1;
+			};
+		} else if (filter instanceof RegExp) {
+			return function(value) {
+				return filter.test(value);
+			};
+		}
+
+		return filter;
+	}
+
+	function getSelectors(doc, fileFilter) {
+		var selectors = [], contentCSSUrls = {};
+
+		function append(styleSheet, imported) {
+			var href = styleSheet.href, rules;
+
+			if (!href || !fileFilter(href, imported)) {
+				return;
+			}
+
+			each(styleSheet.imports, function(styleSheet) {
+				append(styleSheet, true);
+			});
+
+			try {
+				rules = styleSheet.cssRules || styleSheet.rules;
+			} catch (e) {
+				// Firefox fails on rules to remote domain for example:
+				// @import url(//fonts.googleapis.com/css?family=Pathway+Gothic+One);
+			}
+
+			each(rules, function(cssRule) {
+				if (cssRule.styleSheet) {
+					append(cssRule.styleSheet, true);
+				} else if (cssRule.selectorText) {
+					each(cssRule.selectorText.split(','), function(selector) {
+						selectors.push(tinymce.trim(selector));
+					});
+				}
+			});
+		}
+
+		each(editor.contentCSS, function(url) {
+			contentCSSUrls[url] = true;
+		});
+
+		if (!fileFilter) {
+			fileFilter = function(href, imported) {
+				return imported || contentCSSUrls[href];
+			};
+		}
+
+		try {
+			each(doc.styleSheets, function(styleSheet) {
+				append(styleSheet);
+			});
+		} catch (e) {}
+
+		return selectors;
+	}
+
+	function convertSelectorToFormat(selectorText) {
+		var format;
+
+		// Parse simple element.class1, .class1
+		var selector = /^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(selectorText);
+		if (!selector) {
+			return;
+		}
+
+		var elementName = selector[1];
+		var classes = selector[2].substr(1).split('.').join(' ');
+		var inlineSelectorElements = tinymce.makeMap('a,img');
+
+		// element.class - Produce block formats
+		if (selector[1]) {
+			format = {
+				title: selectorText
+			};
+
+			if (editor.schema.getTextBlockElements()[elementName]) {
+				// Text block format ex: h1.class1
+				format.block = elementName;
+			} else if (editor.schema.getBlockElements()[elementName] || inlineSelectorElements[elementName.toLowerCase()]) {
+				// Block elements such as table.class and special inline elements such as a.class or img.class
+				format.selector = elementName;
+			} else {
+				// Inline format strong.class1
+				format.inline = elementName;
+			}
+		} else if (selector[2]) {
+			// .class - Produce inline span with classes
+			format = {
+				inline: 'span',
+				title: selectorText.substr(1),
+				classes: classes
+			};
+		}
+
+		// Append to or override class attribute
+		if (editor.settings.importcss_merge_classes !== false) {
+			format.classes = classes;
+		} else {
+			format.attributes = {"class": classes};
+		}
+
+		return format;
+	}
+
+	editor.on('renderFormatsMenu', function(e) {
+		var settings = editor.settings, selectors = {};
+		var selectorConverter = settings.importcss_selector_converter || convertSelectorToFormat;
+		var selectorFilter = compileFilter(settings.importcss_selector_filter), ctrl = e.control;
+
+		if (!editor.settings.importcss_append) {
+			ctrl.items().remove();
+		}
+
+		// Setup new groups collection by cloning the configured one
+		var groups = [];
+		tinymce.each(settings.importcss_groups, function(group) {
+			group = tinymce.extend({}, group);
+			group.filter = compileFilter(group.filter);
+			groups.push(group);
+		});
+
+		each(getSelectors(e.doc || editor.getDoc(), compileFilter(settings.importcss_file_filter)), function(selector) {
+			if (selector.indexOf('.mce-') === -1) {
+				if (!selectors[selector] && (!selectorFilter || selectorFilter(selector))) {
+					var format = selectorConverter.call(self, selector), menu;
+
+					if (format) {
+						var formatName = format.name || tinymce.DOM.uniqueId();
+
+						if (groups) {
+							for (var i = 0; i < groups.length; i++) {
+								if (!groups[i].filter || groups[i].filter(selector)) {
+									if (!groups[i].item) {
+										groups[i].item = {text: groups[i].title, menu: []};
+									}
+
+									menu = groups[i].item.menu;
+									break;
+								}
+							}
+						}
+
+						editor.formatter.register(formatName, format);
+
+						var menuItem = tinymce.extend({}, ctrl.settings.itemDefaults, {
+							text: format.title,
+							format: formatName
+						});
+
+						if (menu) {
+							menu.push(menuItem);
+						} else {
+							ctrl.add(menuItem);
+						}
+					}
+
+					selectors[selector] = true;
+				}
+			}
+		});
+
+		each(groups, function(group) {
+			ctrl.add(group.item);
+		});
+
+		e.control.renderNew();
+	});
+
+	// Expose default convertSelectorToFormat implementation
+	self.convertSelectorToFormat = convertSelectorToFormat;
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/importcss/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("importcss",function(d){var b=this,e=tinymce.each;function c(g){if(typeof g=="string"){return function(h){return h.indexOf(g)!==-1}}else{if(g instanceof RegExp){return function(h){return g.test(h)}}}return g}function a(l,j){var i=[],h={};function g(q,p){var m=q.href,o;if(!m||!j(m,p)){return}e(q.imports,function(r){g(r,true)});try{o=q.cssRules||q.rules}catch(n){}e(o,function(r){if(r.styleSheet){g(r.styleSheet,true)}else{if(r.selectorText){e(r.selectorText.split(","),function(s){i.push(tinymce.trim(s))})}}})}e(d.contentCSS,function(m){h[m]=true});if(!j){j=function(m,n){return n||h[m]}}try{e(l.styleSheets,function(m){g(m)})}catch(k){}return i}function f(k){var l;var h=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(k);if(!h){return}var g=h[1];var i=h[2].substr(1).split(".").join(" ");var j=tinymce.makeMap("a,img");if(h[1]){l={title:k};if(d.schema.getTextBlockElements()[g]){l.block=g}else{if(d.schema.getBlockElements()[g]||j[g.toLowerCase()]){l.selector=g}else{l.inline=g}}}else{if(h[2]){l={inline:"span",title:k.substr(1),classes:i}}}if(d.settings.importcss_merge_classes!==false){l.classes=i}else{l.attributes={"class":i}}return l}d.on("renderFormatsMenu",function(m){var j=d.settings,i={};var h=j.importcss_selector_converter||f;var l=c(j.importcss_selector_filter),k=m.control;if(!d.settings.importcss_append){k.items().remove()}var g=[];tinymce.each(j.importcss_groups,function(n){n=tinymce.extend({},n);n.filter=c(n.filter);g.push(n)});e(a(m.doc||d.getDoc(),c(j.importcss_file_filter)),function(n){if(n.indexOf(".mce-")===-1){if(!i[n]&&(!l||l(n))){var r=h.call(b,n),s;if(r){var q=r.name||tinymce.DOM.uniqueId();if(g){for(var o=0;o<g.length;o++){if(!g[o].filter||g[o].filter(n)){if(!g[o].item){g[o].item={text:g[o].title,menu:[]}}s=g[o].item.menu;break}}}d.formatter.register(q,r);var p=tinymce.extend({},k.settings.itemDefaults,{text:r.title,format:q});if(s){s.push(p)}else{k.add(p)}}i[n]=true}}});e(g,function(n){k.add(n.item)});m.control.renderNew()});b.convertSelectorToFormat=f});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/insertdatetime/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,121 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('insertdatetime', function(editor) {
+	var daysShort = "Sun Mon Tue Wed Thu Fri Sat Sun".split(' ');
+	var daysLong = "Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(' ');
+	var monthsShort = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(' ');
+	var monthsLong = "January February March April May June July August September October November December".split(' ');
+	var menuItems = [], lastFormat, defaultButtonTimeFormat;
+
+	function getDateTime(fmt, date) {
+		function addZeros(value, len) {
+			value = "" + value;
+
+			if (value.length < len) {
+				for (var i = 0; i < (len - value.length); i++) {
+					value = "0" + value;
+				}
+			}
+
+			return value;
+		}
+
+		date = date || new Date();
+
+		fmt = fmt.replace("%D", "%m/%d/%Y");
+		fmt = fmt.replace("%r", "%I:%M:%S %p");
+		fmt = fmt.replace("%Y", "" + date.getFullYear());
+		fmt = fmt.replace("%y", "" + date.getYear());
+		fmt = fmt.replace("%m", addZeros(date.getMonth() + 1, 2));
+		fmt = fmt.replace("%d", addZeros(date.getDate(), 2));
+		fmt = fmt.replace("%H", "" + addZeros(date.getHours(), 2));
+		fmt = fmt.replace("%M", "" + addZeros(date.getMinutes(), 2));
+		fmt = fmt.replace("%S", "" + addZeros(date.getSeconds(), 2));
+		fmt = fmt.replace("%I", "" + ((date.getHours() + 11) % 12 + 1));
+		fmt = fmt.replace("%p", "" + (date.getHours() < 12 ? "AM" : "PM"));
+		fmt = fmt.replace("%B", "" + editor.translate(monthsLong[date.getMonth()]));
+		fmt = fmt.replace("%b", "" + editor.translate(monthsShort[date.getMonth()]));
+		fmt = fmt.replace("%A", "" + editor.translate(daysLong[date.getDay()]));
+		fmt = fmt.replace("%a", "" + editor.translate(daysShort[date.getDay()]));
+		fmt = fmt.replace("%%", "%");
+
+		return fmt;
+	}
+
+	function insertDateTime(format) {
+		var html = getDateTime(format);
+
+		if (editor.settings.insertdatetime_element) {
+			var computerTime;
+
+			if (/%[HMSIp]/.test(format)) {
+				computerTime = getDateTime("%Y-%m-%dT%H:%M");
+			} else {
+				computerTime = getDateTime("%Y-%m-%d");
+			}
+
+			html = '<time datetime="' + computerTime + '">' + html + '</time>';
+
+			var timeElm = editor.dom.getParent(editor.selection.getStart(), 'time');
+			if (timeElm) {
+				editor.dom.setOuterHTML(timeElm, html);
+				return;
+			}
+		}
+
+		editor.insertContent(html);
+	}
+
+	editor.addCommand('mceInsertDate', function() {
+		insertDateTime(editor.getParam("insertdatetime_dateformat", editor.translate("%Y-%m-%d")));
+	});
+
+	editor.addCommand('mceInsertTime', function() {
+		insertDateTime(editor.getParam("insertdatetime_timeformat", editor.translate('%H:%M:%S')));
+	});
+
+	editor.addButton('insertdatetime', {
+		type: 'splitbutton',
+		title: 'Insert date/time',
+		onclick: function() {
+			insertDateTime(lastFormat || defaultButtonTimeFormat);
+		},
+		menu: menuItems
+	});
+
+	tinymce.each(editor.settings.insertdatetime_formats || [
+		"%H:%M:%S",
+		"%Y-%m-%d",
+		"%I:%M:%S %p",
+		"%D"
+	], function(fmt) {
+		if (!defaultButtonTimeFormat) {
+			defaultButtonTimeFormat = fmt;
+		}
+
+		menuItems.push({
+			text: getDateTime(fmt),
+			onclick: function() {
+				lastFormat = fmt;
+				insertDateTime(fmt);
+			}
+		});
+	});
+
+	editor.addMenuItem('insertdatetime', {
+		icon: 'date',
+		text: 'Insert date/time',
+		menu: menuItems,
+		context: 'insert'
+	});
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/insertdatetime/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("insertdatetime",function(f){var j="Sun Mon Tue Wed Thu Fri Sat Sun".split(" ");var b="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" ");var g="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" ");var e="January February March April May June July August September October November December".split(" ");var a=[],d,i;function c(k,m){function l(p,n){p=""+p;if(p.length<n){for(var o=0;o<(n-p.length);o++){p="0"+p}}return p}m=m||new Date();k=k.replace("%D","%m/%d/%Y");k=k.replace("%r","%I:%M:%S %p");k=k.replace("%Y",""+m.getFullYear());k=k.replace("%y",""+m.getYear());k=k.replace("%m",l(m.getMonth()+1,2));k=k.replace("%d",l(m.getDate(),2));k=k.replace("%H",""+l(m.getHours(),2));k=k.replace("%M",""+l(m.getMinutes(),2));k=k.replace("%S",""+l(m.getSeconds(),2));k=k.replace("%I",""+((m.getHours()+11)%12+1));k=k.replace("%p",""+(m.getHours()<12?"AM":"PM"));k=k.replace("%B",""+f.translate(e[m.getMonth()]));k=k.replace("%b",""+f.translate(g[m.getMonth()]));k=k.replace("%A",""+f.translate(b[m.getDay()]));k=k.replace("%a",""+f.translate(j[m.getDay()]));k=k.replace("%%","%");return k}function h(m){var l=c(m);if(f.settings.insertdatetime_element){var k;if(/%[HMSIp]/.test(m)){k=c("%Y-%m-%dT%H:%M")}else{k=c("%Y-%m-%d")}l='<time datetime="'+k+'">'+l+"</time>";var n=f.dom.getParent(f.selection.getStart(),"time");if(n){f.dom.setOuterHTML(n,l);return}}f.insertContent(l)}f.addCommand("mceInsertDate",function(){h(f.getParam("insertdatetime_dateformat",f.translate("%Y-%m-%d")))});f.addCommand("mceInsertTime",function(){h(f.getParam("insertdatetime_timeformat",f.translate("%H:%M:%S")))});f.addButton("insertdatetime",{type:"splitbutton",title:"Insert date/time",onclick:function(){h(d||i)},menu:a});tinymce.each(f.settings.insertdatetime_formats||["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"],function(k){if(!i){i=k}a.push({text:c(k),onclick:function(){d=k;h(k)}})});f.addMenuItem("insertdatetime",{icon:"date",text:"Insert date/time",menu:a,context:"insert"})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/layer/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,225 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('layer', function(editor) {
+	function getParentLayer(node) {
+		do {
+			if (node.className && node.className.indexOf('mceItemLayer') != -1) {
+				return node;
+			}
+		} while ((node = node.parentNode));
+	}
+
+	function visualAid(e) {
+		var dom = editor.dom;
+
+		tinymce.each(dom.select('div,p', e), function(e) {
+			if (/^(absolute|relative|fixed)$/i.test(e.style.position)) {
+				if (e.hasVisual) {
+					dom.addClass(e, 'mceItemVisualAid');
+				} else {
+					dom.removeClass(e, 'mceItemVisualAid');
+				}
+
+				dom.addClass(e, 'mceItemLayer');
+			}
+		});
+	}
+
+	function move(d) {
+		var i, z = [], le = getParentLayer(editor.selection.getNode()), ci = -1, fi = -1, nl;
+
+		nl = [];
+		tinymce.walk(editor.getBody(), function(n) {
+			if (n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position)) {
+				nl.push(n);
+			}
+		}, 'childNodes');
+
+		// Find z-indexes
+		for (i = 0; i < nl.length; i++) {
+			z[i] = nl[i].style.zIndex ? parseInt(nl[i].style.zIndex, 10) : 0;
+
+			if (ci < 0 && nl[i] == le) {
+				ci = i;
+			}
+		}
+
+		if (d < 0) {
+			// Move back
+
+			// Try find a lower one
+			for (i = 0; i < z.length; i++) {
+				if (z[i] < z[ci]) {
+					fi = i;
+					break;
+				}
+			}
+
+			if (fi > -1) {
+				nl[ci].style.zIndex = z[fi];
+				nl[fi].style.zIndex = z[ci];
+			} else {
+				if (z[ci] > 0) {
+					nl[ci].style.zIndex = z[ci] - 1;
+				}
+			}
+		} else {
+			// Move forward
+
+			// Try find a higher one
+			for (i = 0; i < z.length; i++) {
+				if (z[i] > z[ci]) {
+					fi = i;
+					break;
+				}
+			}
+
+			if (fi > -1) {
+				nl[ci].style.zIndex = z[fi];
+				nl[fi].style.zIndex = z[ci];
+			} else {
+				nl[ci].style.zIndex = z[ci] + 1;
+			}
+		}
+
+		editor.execCommand('mceRepaint');
+	}
+
+	function insertLayer() {
+		var dom = editor.dom, p = dom.getPos(dom.getParent(editor.selection.getNode(), '*'));
+		var body = editor.getBody();
+
+		editor.dom.add(body, 'div', {
+			style: {
+				position: 'absolute',
+				left: p.x,
+				top: (p.y > 20 ? p.y : 20),
+				width: 100,
+				height: 100
+			},
+			'class': 'mceItemVisualAid mceItemLayer'
+		}, editor.selection.getContent() || editor.getLang('layer.content'));
+
+		// Workaround for IE where it messes up the JS engine if you insert a layer on IE 6,7
+		if (tinymce.Env.ie) {
+			dom.setHTML(body, body.innerHTML);
+		}
+	}
+
+	function toggleAbsolute() {
+		var le = getParentLayer(editor.selection.getNode());
+
+		if (!le) {
+			le = editor.dom.getParent(editor.selection.getNode(), 'DIV,P,IMG');
+		}
+
+		if (le) {
+			if (le.style.position.toLowerCase() == "absolute") {
+				editor.dom.setStyles(le, {
+					position: '',
+					left: '',
+					top: '',
+					width: '',
+					height: ''
+				});
+
+				editor.dom.removeClass(le, 'mceItemVisualAid');
+				editor.dom.removeClass(le, 'mceItemLayer');
+			} else {
+				if (!le.style.left) {
+					le.style.left = 20 + 'px';
+				}
+
+				if (!le.style.top) {
+					le.style.top = 20 + 'px';
+				}
+
+				if (!le.style.width) {
+					le.style.width = le.width ? (le.width + 'px') : '100px';
+				}
+
+				if (!le.style.height) {
+					le.style.height = le.height ? (le.height + 'px') : '100px';
+				}
+
+				le.style.position = "absolute";
+
+				editor.dom.setAttrib(le, 'data-mce-style', '');
+				editor.addVisual(editor.getBody());
+			}
+
+			editor.execCommand('mceRepaint');
+			editor.nodeChanged();
+		}
+	}
+
+	// Register commands
+	editor.addCommand('mceInsertLayer', insertLayer);
+
+	editor.addCommand('mceMoveForward', function() {
+		move(1);
+	});
+
+	editor.addCommand('mceMoveBackward', function() {
+		move(-1);
+	});
+
+	editor.addCommand('mceMakeAbsolute', function() {
+		toggleAbsolute();
+	});
+
+	// Register buttons
+	editor.addButton('moveforward', {title: 'layer.forward_desc', cmd: 'mceMoveForward'});
+	editor.addButton('movebackward', {title: 'layer.backward_desc', cmd: 'mceMoveBackward'});
+	editor.addButton('absolute', {title: 'layer.absolute_desc', cmd: 'mceMakeAbsolute'});
+	editor.addButton('insertlayer', {title: 'layer.insertlayer_desc', cmd: 'mceInsertLayer'});
+
+	editor.on('init', function() {
+		if (tinymce.Env.ie) {
+			editor.getDoc().execCommand('2D-Position', false, true);
+		}
+	});
+
+	// Remove serialized styles when selecting a layer since it might be changed by a drag operation
+	editor.on('mouseup', function(e) {
+		var layer = getParentLayer(e.target);
+
+		if (layer) {
+			editor.dom.setAttrib(layer, 'data-mce-style', '');
+		}
+	});
+
+	// Fixes edit focus issues with layers on Gecko
+	// This will enable designMode while inside a layer and disable it when outside
+	editor.on('mousedown', function(e) {
+		var node = e.target, doc = editor.getDoc(), parent;
+
+		if (tinymce.Env.gecko) {
+			if (getParentLayer(node)) {
+				if (doc.designMode !== 'on') {
+					doc.designMode = 'on';
+
+					// Repaint caret
+					node = doc.body;
+					parent = node.parentNode;
+					parent.removeChild(node);
+					parent.appendChild(node);
+				}
+			} else if (doc.designMode == 'on') {
+				doc.designMode = 'off';
+			}
+		}
+	});
+
+	editor.on('NodeChange', visualAid);
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/layer/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("layer",function(e){function f(g){do{if(g.className&&g.className.indexOf("mceItemLayer")!=-1){return g}}while((g=g.parentNode))}function a(g){var h=e.dom;tinymce.each(h.select("div,p",g),function(i){if(/^(absolute|relative|fixed)$/i.test(i.style.position)){if(i.hasVisual){h.addClass(i,"mceItemVisualAid")}else{h.removeClass(i,"mceItemVisualAid")}h.addClass(i,"mceItemLayer")}})}function c(m){var k,l=[],j=f(e.selection.getNode()),h=-1,n=-1,g;g=[];tinymce.walk(e.getBody(),function(i){if(i.nodeType==1&&/^(absolute|relative|static)$/i.test(i.style.position)){g.push(i)}},"childNodes");for(k=0;k<g.length;k++){l[k]=g[k].style.zIndex?parseInt(g[k].style.zIndex,10):0;if(h<0&&g[k]==j){h=k}}if(m<0){for(k=0;k<l.length;k++){if(l[k]<l[h]){n=k;break}}if(n>-1){g[h].style.zIndex=l[n];g[n].style.zIndex=l[h]}else{if(l[h]>0){g[h].style.zIndex=l[h]-1}}}else{for(k=0;k<l.length;k++){if(l[k]>l[h]){n=k;break}}if(n>-1){g[h].style.zIndex=l[n];g[n].style.zIndex=l[h]}else{g[h].style.zIndex=l[h]+1}}e.execCommand("mceRepaint")}function b(){var i=e.dom,h=i.getPos(i.getParent(e.selection.getNode(),"*"));var g=e.getBody();e.dom.add(g,"div",{style:{position:"absolute",left:h.x,top:(h.y>20?h.y:20),width:100,height:100},"class":"mceItemVisualAid mceItemLayer"},e.selection.getContent()||e.getLang("layer.content"));if(tinymce.Env.ie){i.setHTML(g,g.innerHTML)}}function d(){var g=f(e.selection.getNode());if(!g){g=e.dom.getParent(e.selection.getNode(),"DIV,P,IMG")}if(g){if(g.style.position.toLowerCase()=="absolute"){e.dom.setStyles(g,{position:"",left:"",top:"",width:"",height:""});e.dom.removeClass(g,"mceItemVisualAid");e.dom.removeClass(g,"mceItemLayer")}else{if(!g.style.left){g.style.left=20+"px"}if(!g.style.top){g.style.top=20+"px"}if(!g.style.width){g.style.width=g.width?(g.width+"px"):"100px"}if(!g.style.height){g.style.height=g.height?(g.height+"px"):"100px"}g.style.position="absolute";e.dom.setAttrib(g,"data-mce-style","");e.addVisual(e.getBody())}e.execCommand("mceRepaint");e.nodeChanged()}}e.addCommand("mceInsertLayer",b);e.addCommand("mceMoveForward",function(){c(1)});e.addCommand("mceMoveBackward",function(){c(-1)});e.addCommand("mceMakeAbsolute",function(){d()});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(){if(tinymce.Env.ie){e.getDoc().execCommand("2D-Position",false,true)}});e.on("mouseup",function(h){var g=f(h.target);if(g){e.dom.setAttrib(g,"data-mce-style","")}});e.on("mousedown",function(j){var h=j.target,i=e.getDoc(),g;if(tinymce.Env.gecko){if(f(h)){if(i.designMode!=="on"){i.designMode="on";h=i.body;g=h.parentNode;g.removeChild(h);g.appendChild(h)}}else{if(i.designMode=="on"){i.designMode="off"}}}});e.on("NodeChange",a)});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/legacyoutput/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,211 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ *
+ * This plugin will force TinyMCE to produce deprecated legacy output such as font elements, u elements, align
+ * attributes and so forth. There are a few cases where these old items might be needed for example in email applications or with Flash
+ *
+ * However you should NOT use this plugin if you are building some system that produces web contents such as a CMS. All these elements are
+ * not apart of the newer specifications for HTML and XHTML.
+ */
+
+/*global tinymce:true */
+
+(function(tinymce) {
+	// Override inline_styles setting to force TinyMCE to produce deprecated contents
+	tinymce.on('AddEditor', function(e) {
+		e.editor.settings.inline_styles = false;
+	});
+
+	tinymce.PluginManager.add('legacyoutput', function(editor, url, $) {
+		editor.on('init', function() {
+			var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img',
+				fontSizes = tinymce.explode(editor.settings.font_size_style_values),
+				schema = editor.schema;
+
+			// Override some internal formats to produce legacy elements and attributes
+			editor.formatter.register({
+				// Change alignment formats to use the deprecated align attribute
+				alignleft: {selector: alignElements, attributes: {align: 'left'}},
+				aligncenter: {selector: alignElements, attributes: {align: 'center'}},
+				alignright: {selector: alignElements, attributes: {align: 'right'}},
+				alignjustify: {selector: alignElements, attributes: {align: 'justify'}},
+
+				// Change the basic formatting elements to use deprecated element types
+				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: true}
+				],
+				strikethrough: [
+					{inline: 'strike', remove: 'all'},
+					{inline: 'span', styles: {textDecoration: 'line-through'}, exact: true}
+				],
+
+				// Change font size and font family to use the deprecated font element
+				fontname: {inline: 'font', attributes: {face: '%value'}},
+				fontsize: {
+					inline: 'font',
+					attributes: {
+						size: function(vars) {
+							return tinymce.inArray(fontSizes, vars.value) + 1;
+						}
+					}
+				},
+
+				// Setup font elements for colors as well
+				forecolor: {inline: 'font', attributes: {color: '%value'}},
+				hilitecolor: {inline: 'font', styles: {backgroundColor: '%value'}}
+			});
+
+			// Check that deprecated elements are allowed if not add them
+			tinymce.each('b,i,u,strike'.split(','), function(name) {
+				schema.addValidElements(name + '[*]');
+			});
+
+			// Add font element if it's missing
+			if (!schema.getElementRule("font")) {
+				schema.addValidElements("font[face|size|color|style]");
+			}
+
+			// Add the missing and depreacted align attribute for the serialization engine
+			tinymce.each(alignElements.split(','), function(name) {
+				var rule = schema.getElementRule(name);
+
+				if (rule) {
+					if (!rule.attributes.align) {
+						rule.attributes.align = {};
+						rule.attributesOrder.push('align');
+					}
+				}
+			});
+		});
+
+		editor.addButton('fontsizeselect', function() {
+			var items = [], defaultFontsizeFormats = '8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7';
+			var fontsize_formats = editor.settings.fontsize_formats || defaultFontsizeFormats;
+
+			editor.$.each(fontsize_formats.split(' '), function(i, item) {
+				var text = item, value = item;
+				var values = item.split('=');
+
+				if (values.length > 1) {
+					text = values[0];
+					value = values[1];
+				}
+
+				items.push({text: text, value: value});
+			});
+
+			return {
+				type: 'listbox',
+				text: 'Font Sizes',
+				tooltip: 'Font Sizes',
+				values: items,
+				fixedWidth: true,
+				onPostRender: function() {
+					var self = this;
+
+					editor.on('NodeChange', function() {
+						var fontElm;
+
+						fontElm = editor.dom.getParent(editor.selection.getNode(), 'font');
+						if (fontElm) {
+							self.value(fontElm.size);
+						} else {
+							self.value('');
+						}
+					});
+				},
+				onclick: function(e) {
+					if (e.control.settings.value) {
+						editor.execCommand('FontSize', false, e.control.settings.value);
+					}
+				}
+			};
+		});
+
+		editor.addButton('fontselect', function() {
+			function createFormats(formats) {
+				formats = formats.replace(/;$/, '').split(';');
+
+				var i = formats.length;
+				while (i--) {
+					formats[i] = formats[i].split('=');
+				}
+
+				return formats;
+			}
+
+			var defaultFontsFormats =
+				'Andale Mono=andale mono,monospace;' +
+				'Arial=arial,helvetica,sans-serif;' +
+				'Arial Black=arial black,sans-serif;' +
+				'Book Antiqua=book antiqua,palatino,serif;' +
+				'Comic Sans MS=comic sans ms,sans-serif;' +
+				'Courier New=courier new,courier,monospace;' +
+				'Georgia=georgia,palatino,serif;' +
+				'Helvetica=helvetica,arial,sans-serif;' +
+				'Impact=impact,sans-serif;' +
+				'Symbol=symbol;' +
+				'Tahoma=tahoma,arial,helvetica,sans-serif;' +
+				'Terminal=terminal,monaco,monospace;' +
+				'Times New Roman=times new roman,times,serif;' +
+				'Trebuchet MS=trebuchet ms,geneva,sans-serif;' +
+				'Verdana=verdana,geneva,sans-serif;' +
+				'Webdings=webdings;' +
+				'Wingdings=wingdings,zapf dingbats';
+
+			var items = [], fonts = createFormats(editor.settings.font_formats || defaultFontsFormats);
+
+			$.each(fonts, function(i, font) {
+				items.push({
+					text: {raw: font[0]},
+					value: font[1],
+					textStyle: font[1].indexOf('dings') == -1 ? 'font-family:' + font[1] : ''
+				});
+			});
+
+			return {
+				type: 'listbox',
+				text: 'Font Family',
+				tooltip: 'Font Family',
+				values: items,
+				fixedWidth: true,
+				onPostRender: function() {
+					var self = this;
+
+					editor.on('NodeChange', function() {
+						var fontElm;
+
+						fontElm = editor.dom.getParent(editor.selection.getNode(), 'font');
+						if (fontElm) {
+							self.value(fontElm.face);
+						} else {
+							self.value('');
+						}
+					});
+				},
+				onselect: function(e) {
+					if (e.control.settings.value) {
+						editor.execCommand('FontName', false, e.control.settings.value);
+					}
+				}
+			};
+		});
+	});
+})(tinymce);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/legacyoutput/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+(function(a){a.on("AddEditor",function(b){b.editor.settings.inline_styles=false});a.PluginManager.add("legacyoutput",function(c,b,d){c.on("init",function(){var e="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",g=a.explode(c.settings.font_size_style_values),f=c.schema;c.formatter.register({alignleft:{selector:e,attributes:{align:"left"}},aligncenter:{selector:e,attributes:{align:"center"}},alignright:{selector:e,attributes:{align:"right"}},alignjustify:{selector:e,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:true}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:true}],fontname:{inline:"font",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(h){return a.inArray(g,h.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}});a.each("b,i,u,strike".split(","),function(h){f.addValidElements(h+"[*]")});if(!f.getElementRule("font")){f.addValidElements("font[face|size|color|style]")}a.each(e.split(","),function(h){var i=f.getElementRule(h);if(i){if(!i.attributes.align){i.attributes.align={};i.attributesOrder.push("align")}}})});c.addButton("fontsizeselect",function(){var e=[],g="8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7";var f=c.settings.fontsize_formats||g;c.$.each(f.split(" "),function(j,k){var m=k,l=k;var h=k.split("=");if(h.length>1){m=h[0];l=h[1]}e.push({text:m,value:l})});return{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:e,fixedWidth:true,onPostRender:function(){var h=this;c.on("NodeChange",function(){var i;i=c.dom.getParent(c.selection.getNode(),"font");if(i){h.value(i.size)}else{h.value("")}})},onclick:function(h){if(h.control.settings.value){c.execCommand("FontSize",false,h.control.settings.value)}}}});c.addButton("fontselect",function(){function e(j){j=j.replace(/;$/,"").split(";");var k=j.length;while(k--){j[k]=j[k].split("=")}return j}var g="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats";var f=[],h=e(c.settings.font_formats||g);d.each(h,function(k,j){f.push({text:{raw:j[0]},value:j[1],textStyle:j[1].indexOf("dings")==-1?"font-family:"+j[1]:""})});return{type:"listbox",text:"Font Family",tooltip:"Font Family",values:f,fixedWidth:true,onPostRender:function(){var i=this;c.on("NodeChange",function(){var j;j=c.dom.getParent(c.selection.getNode(),"font");if(j){i.value(j.face)}else{i.value("")}})},onselect:function(i){if(i.control.settings.value){c.execCommand("FontName",false,i.control.settings.value)}}}})})})(tinymce);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/link/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,402 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('link', function(editor) {
+	function createLinkList(callback) {
+		return function() {
+			var linkList = editor.settings.link_list;
+
+			if (typeof linkList == "string") {
+				tinymce.util.XHR.send({
+					url: linkList,
+					success: function(text) {
+						callback(tinymce.util.JSON.parse(text));
+					}
+				});
+			} else if (typeof linkList == "function") {
+				linkList(callback);
+			} else {
+				callback(linkList);
+			}
+		};
+	}
+
+	function buildListItems(inputList, itemCallback, startItems) {
+		function appendItems(values, output) {
+			output = output || [];
+
+			tinymce.each(values, function(item) {
+				var menuItem = {text: item.text || item.title};
+
+				if (item.menu) {
+					menuItem.menu = appendItems(item.menu);
+				} else {
+					menuItem.value = item.value;
+
+					if (itemCallback) {
+						itemCallback(menuItem);
+					}
+				}
+
+				output.push(menuItem);
+			});
+
+			return output;
+		}
+
+		return appendItems(inputList, startItems || []);
+	}
+
+	function showDialog(linkList) {
+		var data = {}, selection = editor.selection, dom = editor.dom, selectedElm, anchorElm, initialText;
+		var win, onlyText, textListCtrl, linkListCtrl, relListCtrl, targetListCtrl, classListCtrl, linkTitleCtrl, value;
+
+		function linkListChangeHandler(e) {
+			var textCtrl = win.find('#text');
+
+			if (!textCtrl.value() || (e.lastControl && textCtrl.value() == e.lastControl.text())) {
+				textCtrl.value(e.control.text());
+			}
+
+			win.find('#href').value(e.control.value());
+		}
+
+		function buildAnchorListControl(url) {
+			var anchorList = [];
+
+			tinymce.each(editor.dom.select('a:not([href])'), function(anchor) {
+				var id = anchor.name || anchor.id;
+
+				if (id) {
+					anchorList.push({
+						text: id,
+						value: '#' + id,
+						selected: url.indexOf('#' + id) != -1
+					});
+				}
+			});
+
+			if (anchorList.length) {
+				anchorList.unshift({text: 'None', value: ''});
+
+				return {
+					name: 'anchor',
+					type: 'listbox',
+					label: 'Anchors',
+					values: anchorList,
+					onselect: linkListChangeHandler
+				};
+			}
+		}
+
+		function updateText() {
+			if (!initialText && data.text.length === 0 && onlyText) {
+				this.parent().parent().find('#text')[0].value(this.value());
+			}
+		}
+
+		function urlChange(e) {
+			var meta = e.meta || {};
+
+			if (linkListCtrl) {
+				linkListCtrl.value(editor.convertURL(this.value(), 'href'));
+			}
+
+			tinymce.each(e.meta, function(value, key) {
+				win.find('#' + key).value(value);
+			});
+
+			if (!meta.text) {
+				updateText.call(this);
+			}
+		}
+
+		function isOnlyTextSelected(anchorElm) {
+			var html = selection.getContent();
+
+			// Partial html and not a fully selected anchor element
+			if (/</.test(html) && (!/^<a [^>]+>[^<]+<\/a>$/.test(html) || html.indexOf('href=') == -1)) {
+				return false;
+			}
+
+			if (anchorElm) {
+				var nodes = anchorElm.childNodes, i;
+
+				if (nodes.length === 0) {
+					return false;
+				}
+
+				for (i = nodes.length - 1; i >= 0; i--) {
+					if (nodes[i].nodeType != 3) {
+						return false;
+					}
+				}
+			}
+
+			return true;
+		}
+
+		selectedElm = selection.getNode();
+		anchorElm = dom.getParent(selectedElm, 'a[href]');
+		onlyText = isOnlyTextSelected();
+
+		data.text = initialText = anchorElm ? (anchorElm.innerText || anchorElm.textContent) : selection.getContent({format: 'text'});
+		data.href = anchorElm ? dom.getAttrib(anchorElm, 'href') : '';
+
+		if (anchorElm) {
+			data.target = dom.getAttrib(anchorElm, 'target');
+		} else if (editor.settings.default_link_target) {
+			data.target = editor.settings.default_link_target;
+		}
+
+		if ((value = dom.getAttrib(anchorElm, 'rel'))) {
+			data.rel = value;
+		}
+
+		if ((value = dom.getAttrib(anchorElm, 'class'))) {
+			data['class'] = value;
+		}
+
+		if ((value = dom.getAttrib(anchorElm, 'title'))) {
+			data.title = value;
+		}
+
+		if (onlyText) {
+			textListCtrl = {
+				name: 'text',
+				type: 'textbox',
+				size: 40,
+				label: 'Text to display',
+				onchange: function() {
+					data.text = this.value();
+				}
+			};
+		}
+
+		if (linkList) {
+			linkListCtrl = {
+				type: 'listbox',
+				label: 'Link list',
+				values: buildListItems(
+					linkList,
+					function(item) {
+						item.value = editor.convertURL(item.value || item.url, 'href');
+					},
+					[{text: 'None', value: ''}]
+				),
+				onselect: linkListChangeHandler,
+				value: editor.convertURL(data.href, 'href'),
+				onPostRender: function() {
+					linkListCtrl = this;
+				}
+			};
+		}
+
+		if (editor.settings.target_list !== false) {
+			if (!editor.settings.target_list) {
+				editor.settings.target_list = [
+					{text: 'None', value: ''},
+					{text: 'New window', value: '_blank'}
+				];
+			}
+
+			targetListCtrl = {
+				name: 'target',
+				type: 'listbox',
+				label: 'Target',
+				values: buildListItems(editor.settings.target_list)
+			};
+		}
+
+		if (editor.settings.rel_list) {
+			relListCtrl = {
+				name: 'rel',
+				type: 'listbox',
+				label: 'Rel',
+				values: buildListItems(editor.settings.rel_list)
+			};
+		}
+
+		if (editor.settings.link_class_list) {
+			classListCtrl = {
+				name: 'class',
+				type: 'listbox',
+				label: 'Class',
+				values: buildListItems(
+					editor.settings.link_class_list,
+					function(item) {
+						if (item.value) {
+							item.textStyle = function() {
+								return editor.formatter.getCssText({inline: 'a', classes: [item.value]});
+							};
+						}
+					}
+				)
+			};
+		}
+
+		if (editor.settings.link_title !== false) {
+			linkTitleCtrl = {
+				name: 'title',
+				type: 'textbox',
+				label: 'Title',
+				value: data.title
+			};
+		}
+
+		win = editor.windowManager.open({
+			title: 'Insert link',
+			data: data,
+			body: [
+				{
+					name: 'href',
+					type: 'filepicker',
+					filetype: 'file',
+					size: 40,
+					autofocus: true,
+					label: 'Url',
+					onchange: urlChange,
+					onkeyup: updateText
+				},
+				textListCtrl,
+				linkTitleCtrl,
+				buildAnchorListControl(data.href),
+				linkListCtrl,
+				relListCtrl,
+				targetListCtrl,
+				classListCtrl
+			],
+			onSubmit: function(e) {
+				/*eslint dot-notation: 0*/
+				var href;
+
+				data = tinymce.extend(data, e.data);
+				href = data.href;
+
+				// Delay confirm since onSubmit will move focus
+				function delayedConfirm(message, callback) {
+					var rng = editor.selection.getRng();
+
+					window.setTimeout(function() {
+						editor.windowManager.confirm(message, function(state) {
+							editor.selection.setRng(rng);
+							callback(state);
+						});
+					}, 0);
+				}
+
+				function insertLink() {
+					var linkAttrs = {
+						href: href,
+						target: data.target ? data.target : null,
+						rel: data.rel ? data.rel : null,
+						"class": data["class"] ? data["class"] : null,
+						title: data.title ? data.title : null
+					};
+
+					if (anchorElm) {
+						editor.focus();
+
+						if (onlyText && data.text != initialText) {
+							if ("innerText" in anchorElm) {
+								anchorElm.innerText = data.text;
+							} else {
+								anchorElm.textContent = data.text;
+							}
+						}
+
+						dom.setAttribs(anchorElm, linkAttrs);
+
+						selection.select(anchorElm);
+						editor.undoManager.add();
+					} else {
+						if (onlyText) {
+							editor.insertContent(dom.createHTML('a', linkAttrs, dom.encode(data.text)));
+						} else {
+							editor.execCommand('mceInsertLink', false, linkAttrs);
+						}
+					}
+				}
+
+				if (!href) {
+					editor.execCommand('unlink');
+					return;
+				}
+
+				// Is email and not //user@domain.com
+				if (href.indexOf('@') > 0 && href.indexOf('//') == -1 && href.indexOf('mailto:') == -1) {
+					delayedConfirm(
+						'The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?',
+						function(state) {
+							if (state) {
+								href = 'mailto:' + href;
+							}
+
+							insertLink();
+						}
+					);
+
+					return;
+				}
+
+				// Is not protocol prefixed
+				if ((editor.settings.link_assume_external_targets && !/^\w+:/i.test(href)) ||
+					(!editor.settings.link_assume_external_targets && /^\s*www\./i.test(href))) {
+					delayedConfirm(
+						'The URL you entered seems to be an external link. Do you want to add the required http:// prefix?',
+						function(state) {
+							if (state) {
+								href = 'http://' + href;
+							}
+
+							insertLink();
+						}
+					);
+
+					return;
+				}
+
+				insertLink();
+			}
+		});
+	}
+
+	editor.addButton('link', {
+		icon: 'link',
+		tooltip: 'Insert/edit link',
+		shortcut: 'Meta+K',
+		onclick: createLinkList(showDialog),
+		stateSelector: 'a[href]'
+	});
+
+	editor.addButton('unlink', {
+		icon: 'unlink',
+		tooltip: 'Remove link',
+		cmd: 'unlink',
+		stateSelector: 'a[href]'
+	});
+
+	editor.addShortcut('Meta+K', '', createLinkList(showDialog));
+	editor.addCommand('mceLink', createLinkList(showDialog));
+
+	this.showDialog = showDialog;
+
+	editor.addMenuItem('link', {
+		icon: 'link',
+		text: 'Insert/edit link',
+		shortcut: 'Meta+K',
+		onclick: createLinkList(showDialog),
+		stateSelector: 'a[href]',
+		context: 'insert',
+		prependToContext: true
+	});
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/link/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("link",function(d){function b(e){return function(){var f=d.settings.link_list;if(typeof f=="string"){tinymce.util.XHR.send({url:f,success:function(g){e(tinymce.util.JSON.parse(g))}})}else{if(typeof f=="function"){f(e)}else{e(f)}}}}function c(g,e,h){function f(j,i){i=i||[];tinymce.each(j,function(l){var k={text:l.text||l.title};if(l.menu){k.menu=f(l.menu)}else{k.value=l.value;if(e){e(k)}}i.push(k)});return i}return f(g,h||[])}function a(j){var x={},y=d.selection,t=d.dom,v,n,o;var i,l,k,g,p,m,h,q,r;function u(z){var A=i.find("#text");if(!A.value()||(z.lastControl&&A.value()==z.lastControl.text())){A.value(z.control.text())}i.find("#href").value(z.control.value())}function f(z){var A=[];tinymce.each(d.dom.select("a:not([href])"),function(B){var C=B.name||B.id;if(C){A.push({text:C,value:"#"+C,selected:z.indexOf("#"+C)!=-1})}});if(A.length){A.unshift({text:"None",value:""});return{name:"anchor",type:"listbox",label:"Anchors",values:A,onselect:u}}}function s(){if(!o&&x.text.length===0&&l){this.parent().parent().find("#text")[0].value(this.value())}}function e(A){var z=A.meta||{};if(g){g.value(d.convertURL(this.value(),"href"))}tinymce.each(A.meta,function(C,B){i.find("#"+B).value(C)});if(!z.text){s.call(this)}}function w(A){var C=y.getContent();if(/</.test(C)&&(!/^<a [^>]+>[^<]+<\/a>$/.test(C)||C.indexOf("href=")==-1)){return false}if(A){var z=A.childNodes,B;if(z.length===0){return false}for(B=z.length-1;B>=0;B--){if(z[B].nodeType!=3){return false}}}return true}v=y.getNode();n=t.getParent(v,"a[href]");l=w();x.text=o=n?(n.innerText||n.textContent):y.getContent({format:"text"});x.href=n?t.getAttrib(n,"href"):"";if(n){x.target=t.getAttrib(n,"target")}else{if(d.settings.default_link_target){x.target=d.settings.default_link_target}}if((r=t.getAttrib(n,"rel"))){x.rel=r}if((r=t.getAttrib(n,"class"))){x["class"]=r}if((r=t.getAttrib(n,"title"))){x.title=r}if(l){k={name:"text",type:"textbox",size:40,label:"Text to display",onchange:function(){x.text=this.value()}}}if(j){g={type:"listbox",label:"Link list",values:c(j,function(z){z.value=d.convertURL(z.value||z.url,"href")},[{text:"None",value:""}]),onselect:u,value:d.convertURL(x.href,"href"),onPostRender:function(){g=this}}}if(d.settings.target_list!==false){if(!d.settings.target_list){d.settings.target_list=[{text:"None",value:""},{text:"New window",value:"_blank"}]}m={name:"target",type:"listbox",label:"Target",values:c(d.settings.target_list)}}if(d.settings.rel_list){p={name:"rel",type:"listbox",label:"Rel",values:c(d.settings.rel_list)}}if(d.settings.link_class_list){h={name:"class",type:"listbox",label:"Class",values:c(d.settings.link_class_list,function(z){if(z.value){z.textStyle=function(){return d.formatter.getCssText({inline:"a",classes:[z.value]})}}})}}if(d.settings.link_title!==false){q={name:"title",type:"textbox",label:"Title",value:x.title}}i=d.windowManager.open({title:"Insert link",data:x,body:[{name:"href",type:"filepicker",filetype:"file",size:40,autofocus:true,label:"Url",onchange:e,onkeyup:s},k,q,f(x.href),g,p,m,h],onSubmit:function(C){var z;x=tinymce.extend(x,C.data);z=x.href;function B(E,F){var D=d.selection.getRng();window.setTimeout(function(){d.windowManager.confirm(E,function(G){d.selection.setRng(D);F(G)})},0)}function A(){var D={href:z,target:x.target?x.target:null,rel:x.rel?x.rel:null,"class":x["class"]?x["class"]:null,title:x.title?x.title:null};if(n){d.focus();if(l&&x.text!=o){if("innerText" in n){n.innerText=x.text}else{n.textContent=x.text}}t.setAttribs(n,D);y.select(n);d.undoManager.add()}else{if(l){d.insertContent(t.createHTML("a",D,t.encode(x.text)))}else{d.execCommand("mceInsertLink",false,D)}}}if(!z){d.execCommand("unlink");return}if(z.indexOf("@")>0&&z.indexOf("//")==-1&&z.indexOf("mailto:")==-1){B("The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",function(D){if(D){z="mailto:"+z}A()});return}if((d.settings.link_assume_external_targets&&!/^\w+:/i.test(z))||(!d.settings.link_assume_external_targets&&/^\s*www\./i.test(z))){B("The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",function(D){if(D){z="http://"+z}A()});return}A()}})}d.addButton("link",{icon:"link",tooltip:"Insert/edit link",shortcut:"Meta+K",onclick:b(a),stateSelector:"a[href]"});d.addButton("unlink",{icon:"unlink",tooltip:"Remove link",cmd:"unlink",stateSelector:"a[href]"});d.addShortcut("Meta+K","",b(a));d.addCommand("mceLink",b(a));this.showDialog=a;d.addMenuItem("link",{icon:"link",text:"Insert/edit link",shortcut:"Meta+K",onclick:b(a),stateSelector:"a[href]",context:"insert",prependToContext:true})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/lists/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,813 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+/*eslint consistent-this:0 */
+
+tinymce.PluginManager.add('lists', function(editor) {
+	var self = this;
+
+	function isListNode(node) {
+		return node && (/^(OL|UL|DL)$/).test(node.nodeName);
+	}
+
+	function isFirstChild(node) {
+		return node.parentNode.firstChild == node;
+	}
+
+	function isLastChild(node) {
+		return node.parentNode.lastChild == node;
+	}
+
+	function isTextBlock(node) {
+		return node && !!editor.schema.getTextBlockElements()[node.nodeName];
+	}
+
+	editor.on('init', function() {
+		var dom = editor.dom, selection = editor.selection;
+
+		/**
+		 * Returns a range bookmark. This will convert indexed bookmarks into temporary span elements with
+		 * index 0 so that they can be restored properly after the DOM has been modified. Text bookmarks will not have spans
+		 * added to them since they can be restored after a dom operation.
+		 *
+		 * So this: <p><b>|</b><b>|</b></p>
+		 * becomes: <p><b><span data-mce-type="bookmark">|</span></b><b data-mce-type="bookmark">|</span></b></p>
+		 *
+		 * @param  {DOMRange} rng DOM Range to get bookmark on.
+		 * @return {Object} Bookmark object.
+		 */
+		function createBookmark(rng) {
+			var bookmark = {};
+
+			function setupEndPoint(start) {
+				var offsetNode, container, offset;
+
+				container = rng[start ? 'startContainer' : 'endContainer'];
+				offset = rng[start ? 'startOffset' : 'endOffset'];
+
+				if (container.nodeType == 1) {
+					offsetNode = dom.create('span', {'data-mce-type': 'bookmark'});
+
+					if (container.hasChildNodes()) {
+						offset = Math.min(offset, container.childNodes.length - 1);
+
+						if (start) {
+							container.insertBefore(offsetNode, container.childNodes[offset]);
+						} else {
+							dom.insertAfter(offsetNode, container.childNodes[offset]);
+						}
+					} else {
+						container.appendChild(offsetNode);
+					}
+
+					container = offsetNode;
+					offset = 0;
+				}
+
+				bookmark[start ? 'startContainer' : 'endContainer'] = container;
+				bookmark[start ? 'startOffset' : 'endOffset'] = offset;
+			}
+
+			setupEndPoint(true);
+
+			if (!rng.collapsed) {
+				setupEndPoint();
+			}
+
+			return bookmark;
+		}
+
+		/**
+		 * Moves the selection to the current bookmark and removes any selection container wrappers.
+		 *
+		 * @param {Object} bookmark Bookmark object to move selection to.
+		 */
+		function moveToBookmark(bookmark) {
+			function restoreEndPoint(start) {
+				var container, offset, node;
+
+				function nodeIndex(container) {
+					var node = container.parentNode.firstChild, idx = 0;
+
+					while (node) {
+						if (node == container) {
+							return idx;
+						}
+
+						// Skip data-mce-type=bookmark nodes
+						if (node.nodeType != 1 || node.getAttribute('data-mce-type') != 'bookmark') {
+							idx++;
+						}
+
+						node = node.nextSibling;
+					}
+
+					return -1;
+				}
+
+				container = node = bookmark[start ? 'startContainer' : 'endContainer'];
+				offset = bookmark[start ? 'startOffset' : 'endOffset'];
+
+				if (!container) {
+					return;
+				}
+
+				if (container.nodeType == 1) {
+					offset = nodeIndex(container);
+					container = container.parentNode;
+					dom.remove(node);
+				}
+
+				bookmark[start ? 'startContainer' : 'endContainer'] = container;
+				bookmark[start ? 'startOffset' : 'endOffset'] = offset;
+			}
+
+			restoreEndPoint(true);
+			restoreEndPoint();
+
+			var rng = dom.createRng();
+
+			rng.setStart(bookmark.startContainer, bookmark.startOffset);
+
+			if (bookmark.endContainer) {
+				rng.setEnd(bookmark.endContainer, bookmark.endOffset);
+			}
+
+			selection.setRng(rng);
+		}
+
+		function createNewTextBlock(contentNode, blockName) {
+			var node, textBlock, fragment = dom.createFragment(), hasContentNode;
+			var blockElements = editor.schema.getBlockElements();
+
+			if (editor.settings.forced_root_block) {
+				blockName = blockName || editor.settings.forced_root_block;
+			}
+
+			if (blockName) {
+				textBlock = dom.create(blockName);
+
+				if (textBlock.tagName === editor.settings.forced_root_block) {
+					dom.setAttribs(textBlock, editor.settings.forced_root_block_attrs);
+				}
+
+				fragment.appendChild(textBlock);
+			}
+
+			if (contentNode) {
+				while ((node = contentNode.firstChild)) {
+					var nodeName = node.nodeName;
+
+					if (!hasContentNode && (nodeName != 'SPAN' || node.getAttribute('data-mce-type') != 'bookmark')) {
+						hasContentNode = true;
+					}
+
+					if (blockElements[nodeName]) {
+						fragment.appendChild(node);
+						textBlock = null;
+					} else {
+						if (blockName) {
+							if (!textBlock) {
+								textBlock = dom.create(blockName);
+								fragment.appendChild(textBlock);
+							}
+
+							textBlock.appendChild(node);
+						} else {
+							fragment.appendChild(node);
+						}
+					}
+				}
+			}
+
+			if (!editor.settings.forced_root_block) {
+				fragment.appendChild(dom.create('br'));
+			} else {
+				// BR is needed in empty blocks on non IE browsers
+				if (!hasContentNode && (!tinymce.Env.ie || tinymce.Env.ie > 10)) {
+					textBlock.appendChild(dom.create('br', {'data-mce-bogus': '1'}));
+				}
+			}
+
+			return fragment;
+		}
+
+		function getSelectedListItems() {
+			return tinymce.grep(selection.getSelectedBlocks(), function(block) {
+				return /^(LI|DT|DD)$/.test(block.nodeName);
+			});
+		}
+
+		function splitList(ul, li, newBlock) {
+			var tmpRng, fragment, bookmarks, node;
+
+			function removeAndKeepBookmarks(targetNode) {
+				tinymce.each(bookmarks, function(node) {
+					targetNode.parentNode.insertBefore(node, li.parentNode);
+				});
+
+				dom.remove(targetNode);
+			}
+
+			bookmarks = dom.select('span[data-mce-type="bookmark"]', ul);
+			newBlock = newBlock || createNewTextBlock(li);
+			tmpRng = dom.createRng();
+			tmpRng.setStartAfter(li);
+			tmpRng.setEndAfter(ul);
+			fragment = tmpRng.extractContents();
+
+			for (node = fragment.firstChild; node; node = node.firstChild) {
+				if (node.nodeName == 'LI' && dom.isEmpty(node)) {
+					dom.remove(node);
+					break;
+				}
+			}
+
+			if (!dom.isEmpty(fragment)) {
+				dom.insertAfter(fragment, ul);
+			}
+
+			dom.insertAfter(newBlock, ul);
+
+			if (dom.isEmpty(li.parentNode)) {
+				removeAndKeepBookmarks(li.parentNode);
+			}
+
+			dom.remove(li);
+
+			if (dom.isEmpty(ul)) {
+				dom.remove(ul);
+			}
+		}
+
+		function mergeWithAdjacentLists(listBlock) {
+			var sibling, node;
+
+			sibling = listBlock.nextSibling;
+			if (sibling && isListNode(sibling) && sibling.nodeName == listBlock.nodeName) {
+				while ((node = sibling.firstChild)) {
+					listBlock.appendChild(node);
+				}
+
+				dom.remove(sibling);
+			}
+
+			sibling = listBlock.previousSibling;
+			if (sibling && isListNode(sibling) && sibling.nodeName == listBlock.nodeName) {
+				while ((node = sibling.firstChild)) {
+					listBlock.insertBefore(node, listBlock.firstChild);
+				}
+
+				dom.remove(sibling);
+			}
+		}
+
+		/**
+		 * Normalizes the all lists in the specified element.
+		 */
+		function normalizeList(element) {
+			tinymce.each(tinymce.grep(dom.select('ol,ul', element)), function(ul) {
+				var sibling, parentNode = ul.parentNode;
+
+				// Move UL/OL to previous LI if it's the only child of a LI
+				if (parentNode.nodeName == 'LI' && parentNode.firstChild == ul) {
+					sibling = parentNode.previousSibling;
+					if (sibling && sibling.nodeName == 'LI') {
+						sibling.appendChild(ul);
+
+						if (dom.isEmpty(parentNode)) {
+							dom.remove(parentNode);
+						}
+					}
+				}
+
+				// Append OL/UL to previous LI if it's in a parent OL/UL i.e. old HTML4
+				if (isListNode(parentNode)) {
+					sibling = parentNode.previousSibling;
+					if (sibling && sibling.nodeName == 'LI') {
+						sibling.appendChild(ul);
+					}
+				}
+			});
+		}
+
+		function outdent(li) {
+			var ul = li.parentNode, ulParent = ul.parentNode, newBlock;
+
+			function removeEmptyLi(li) {
+				if (dom.isEmpty(li)) {
+					dom.remove(li);
+				}
+			}
+
+			if (li.nodeName == 'DD') {
+				dom.rename(li, 'DT');
+				return true;
+			}
+
+			if (isFirstChild(li) && isLastChild(li)) {
+				if (ulParent.nodeName == "LI") {
+					dom.insertAfter(li, ulParent);
+					removeEmptyLi(ulParent);
+					dom.remove(ul);
+				} else if (isListNode(ulParent)) {
+					dom.remove(ul, true);
+				} else {
+					ulParent.insertBefore(createNewTextBlock(li), ul);
+					dom.remove(ul);
+				}
+
+				return true;
+			} else if (isFirstChild(li)) {
+				if (ulParent.nodeName == "LI") {
+					dom.insertAfter(li, ulParent);
+					li.appendChild(ul);
+					removeEmptyLi(ulParent);
+				} else if (isListNode(ulParent)) {
+					ulParent.insertBefore(li, ul);
+				} else {
+					ulParent.insertBefore(createNewTextBlock(li), ul);
+					dom.remove(li);
+				}
+
+				return true;
+			} else if (isLastChild(li)) {
+				if (ulParent.nodeName == "LI") {
+					dom.insertAfter(li, ulParent);
+				} else if (isListNode(ulParent)) {
+					dom.insertAfter(li, ul);
+				} else {
+					dom.insertAfter(createNewTextBlock(li), ul);
+					dom.remove(li);
+				}
+
+				return true;
+			} else {
+				if (ulParent.nodeName == 'LI') {
+					ul = ulParent;
+					newBlock = createNewTextBlock(li, 'LI');
+				} else if (isListNode(ulParent)) {
+					newBlock = createNewTextBlock(li, 'LI');
+				} else {
+					newBlock = createNewTextBlock(li);
+				}
+
+				splitList(ul, li, newBlock);
+				normalizeList(ul.parentNode);
+
+				return true;
+			}
+
+			return false;
+		}
+
+		function indent(li) {
+			var sibling, newList;
+
+			function mergeLists(from, to) {
+				var node;
+
+				if (isListNode(from)) {
+					while ((node = li.lastChild.firstChild)) {
+						to.appendChild(node);
+					}
+
+					dom.remove(from);
+				}
+			}
+
+			if (li.nodeName == 'DT') {
+				dom.rename(li, 'DD');
+				return true;
+			}
+
+			sibling = li.previousSibling;
+
+			if (sibling && isListNode(sibling)) {
+				sibling.appendChild(li);
+				return true;
+			}
+
+			if (sibling && sibling.nodeName == 'LI' && isListNode(sibling.lastChild)) {
+				sibling.lastChild.appendChild(li);
+				mergeLists(li.lastChild, sibling.lastChild);
+				return true;
+			}
+
+			sibling = li.nextSibling;
+
+			if (sibling && isListNode(sibling)) {
+				sibling.insertBefore(li, sibling.firstChild);
+				return true;
+			}
+
+			if (sibling && sibling.nodeName == 'LI' && isListNode(li.lastChild)) {
+				return false;
+			}
+
+			sibling = li.previousSibling;
+			if (sibling && sibling.nodeName == 'LI') {
+				newList = dom.create(li.parentNode.nodeName);
+				sibling.appendChild(newList);
+				newList.appendChild(li);
+				mergeLists(li.lastChild, newList);
+				return true;
+			}
+
+			return false;
+		}
+
+		function indentSelection() {
+			var listElements = getSelectedListItems();
+
+			if (listElements.length) {
+				var bookmark = createBookmark(selection.getRng(true));
+
+				for (var i = 0; i < listElements.length; i++) {
+					if (!indent(listElements[i]) && i === 0) {
+						break;
+					}
+				}
+
+				moveToBookmark(bookmark);
+				editor.nodeChanged();
+
+				return true;
+			}
+		}
+
+		function outdentSelection() {
+			var listElements = getSelectedListItems();
+
+			if (listElements.length) {
+				var bookmark = createBookmark(selection.getRng(true));
+				var i, y, root = editor.getBody();
+
+				i = listElements.length;
+				while (i--) {
+					var node = listElements[i].parentNode;
+
+					while (node && node != root) {
+						y = listElements.length;
+						while (y--) {
+							if (listElements[y] === node) {
+								listElements.splice(i, 1);
+								break;
+							}
+						}
+
+						node = node.parentNode;
+					}
+				}
+
+				for (i = 0; i < listElements.length; i++) {
+					if (!outdent(listElements[i]) && i === 0) {
+						break;
+					}
+				}
+
+				moveToBookmark(bookmark);
+				editor.nodeChanged();
+
+				return true;
+			}
+		}
+
+		function applyList(listName) {
+			var rng = selection.getRng(true), bookmark = createBookmark(rng), listItemName = 'LI';
+
+			listName = listName.toUpperCase();
+
+			if (listName == 'DL') {
+				listItemName = 'DT';
+			}
+
+			function getSelectedTextBlocks() {
+				var textBlocks = [], root = editor.getBody();
+
+				function getEndPointNode(start) {
+					var container, offset;
+
+					container = rng[start ? 'startContainer' : 'endContainer'];
+					offset = rng[start ? 'startOffset' : 'endOffset'];
+
+					// Resolve node index
+					if (container.nodeType == 1) {
+						container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container;
+					}
+
+					while (container.parentNode != root) {
+						if (isTextBlock(container)) {
+							return container;
+						}
+
+						if (/^(TD|TH)$/.test(container.parentNode.nodeName)) {
+							return container;
+						}
+
+						container = container.parentNode;
+					}
+
+					return container;
+				}
+
+				var startNode = getEndPointNode(true);
+				var endNode = getEndPointNode();
+				var block, siblings = [];
+
+				for (var node = startNode; node; node = node.nextSibling) {
+					siblings.push(node);
+
+					if (node == endNode) {
+						break;
+					}
+				}
+
+				tinymce.each(siblings, function(node) {
+					if (isTextBlock(node)) {
+						textBlocks.push(node);
+						block = null;
+						return;
+					}
+
+					if (dom.isBlock(node) || node.nodeName == 'BR') {
+						if (node.nodeName == 'BR') {
+							dom.remove(node);
+						}
+
+						block = null;
+						return;
+					}
+
+					var nextSibling = node.nextSibling;
+					if (tinymce.dom.BookmarkManager.isBookmarkNode(node)) {
+						if (isTextBlock(nextSibling) || (!nextSibling && node.parentNode == root)) {
+							block = null;
+							return;
+						}
+					}
+
+					if (!block) {
+						block = dom.create('p');
+						node.parentNode.insertBefore(block, node);
+						textBlocks.push(block);
+					}
+
+					block.appendChild(node);
+				});
+
+				return textBlocks;
+			}
+
+			tinymce.each(getSelectedTextBlocks(), function(block) {
+				var listBlock, sibling;
+
+				sibling = block.previousSibling;
+				if (sibling && isListNode(sibling) && sibling.nodeName == listName) {
+					listBlock = sibling;
+					block = dom.rename(block, listItemName);
+					sibling.appendChild(block);
+				} else {
+					listBlock = dom.create(listName);
+					block.parentNode.insertBefore(listBlock, block);
+					listBlock.appendChild(block);
+					block = dom.rename(block, listItemName);
+				}
+
+				mergeWithAdjacentLists(listBlock);
+			});
+
+			moveToBookmark(bookmark);
+		}
+
+		function removeList() {
+			var bookmark = createBookmark(selection.getRng(true)), root = editor.getBody();
+
+			tinymce.each(getSelectedListItems(), function(li) {
+				var node, rootList;
+
+				if (dom.isEmpty(li)) {
+					outdent(li);
+					return;
+				}
+
+				for (node = li; node && node != root; node = node.parentNode) {
+					if (isListNode(node)) {
+						rootList = node;
+					}
+				}
+
+				splitList(rootList, li);
+			});
+
+			moveToBookmark(bookmark);
+		}
+
+		function toggleList(listName) {
+			var parentList = dom.getParent(selection.getStart(), 'OL,UL,DL');
+
+			if (parentList) {
+				if (parentList.nodeName == listName) {
+					removeList(listName);
+				} else {
+					var bookmark = createBookmark(selection.getRng(true));
+					mergeWithAdjacentLists(dom.rename(parentList, listName));
+					moveToBookmark(bookmark);
+				}
+			} else {
+				applyList(listName);
+			}
+		}
+
+		function queryListCommandState(listName) {
+			return function() {
+				var parentList = dom.getParent(editor.selection.getStart(), 'UL,OL,DL');
+
+				return parentList && parentList.nodeName == listName;
+			};
+		}
+
+		self.backspaceDelete = function(isForward) {
+			function findNextCaretContainer(rng, isForward) {
+				var node = rng.startContainer, offset = rng.startOffset;
+				var nonEmptyBlocks, walker;
+
+				if (node.nodeType == 3 && (isForward ? offset < node.data.length : offset > 0)) {
+					return node;
+				}
+
+				nonEmptyBlocks = editor.schema.getNonEmptyElements();
+				walker = new tinymce.dom.TreeWalker(rng.startContainer);
+
+				while ((node = walker[isForward ? 'next' : 'prev']())) {
+					if (node.nodeName == 'LI' && !node.hasChildNodes()) {
+						return node;
+					}
+
+					if (nonEmptyBlocks[node.nodeName]) {
+						return node;
+					}
+
+					if (node.nodeType == 3 && node.data.length > 0) {
+						return node;
+					}
+				}
+			}
+
+			function mergeLiElements(fromElm, toElm) {
+				var node, listNode, ul = fromElm.parentNode;
+
+				if (isListNode(toElm.lastChild)) {
+					listNode = toElm.lastChild;
+				}
+
+				node = toElm.lastChild;
+				if (node && node.nodeName == 'BR' && fromElm.hasChildNodes()) {
+					dom.remove(node);
+				}
+
+				if (dom.isEmpty(toElm)) {
+					dom.$(toElm).empty();
+				}
+
+				if (!dom.isEmpty(fromElm)) {
+					while ((node = fromElm.firstChild)) {
+						toElm.appendChild(node);
+					}
+				}
+
+				if (listNode) {
+					toElm.appendChild(listNode);
+				}
+
+				dom.remove(fromElm);
+
+				if (dom.isEmpty(ul)) {
+					dom.remove(ul);
+				}
+			}
+
+			if (selection.isCollapsed()) {
+				var li = dom.getParent(selection.getStart(), 'LI');
+
+				if (li) {
+					var rng = selection.getRng(true);
+					var otherLi = dom.getParent(findNextCaretContainer(rng, isForward), 'LI');
+
+					if (otherLi && otherLi != li) {
+						var bookmark = createBookmark(rng);
+
+						if (isForward) {
+							mergeLiElements(otherLi, li);
+						} else {
+							mergeLiElements(li, otherLi);
+						}
+
+						moveToBookmark(bookmark);
+
+						return true;
+					} else if (!otherLi) {
+						if (!isForward && removeList(li.parentNode.nodeName)) {
+							return true;
+						}
+					}
+				}
+			}
+		};
+
+		editor.on('BeforeExecCommand', function(e) {
+			var cmd = e.command.toLowerCase(), isHandled;
+
+			if (cmd == "indent") {
+				if (indentSelection()) {
+					isHandled = true;
+				}
+			} else if (cmd == "outdent") {
+				if (outdentSelection()) {
+					isHandled = true;
+				}
+			}
+
+			if (isHandled) {
+				editor.fire('ExecCommand', {command: e.command});
+				e.preventDefault();
+				return true;
+			}
+		});
+
+		editor.addCommand('InsertUnorderedList', function() {
+			toggleList('UL');
+		});
+
+		editor.addCommand('InsertOrderedList', function() {
+			toggleList('OL');
+		});
+
+		editor.addCommand('InsertDefinitionList', function() {
+			toggleList('DL');
+		});
+
+		editor.addQueryStateHandler('InsertUnorderedList', queryListCommandState('UL'));
+		editor.addQueryStateHandler('InsertOrderedList', queryListCommandState('OL'));
+		editor.addQueryStateHandler('InsertDefinitionList', queryListCommandState('DL'));
+
+		editor.on('keydown', function(e) {
+			// Check for tab but not ctrl/cmd+tab since it switches browser tabs
+			if (e.keyCode != 9 || tinymce.util.VK.metaKeyPressed(e)) {
+				return;
+			}
+
+			if (editor.dom.getParent(editor.selection.getStart(), 'LI,DT,DD')) {
+				e.preventDefault();
+
+				if (e.shiftKey) {
+					outdentSelection();
+				} else {
+					indentSelection();
+				}
+			}
+		});
+	});
+
+	editor.addButton('indent', {
+		icon: 'indent',
+		title: 'Increase indent',
+		cmd: 'Indent',
+		onPostRender: function() {
+			var ctrl = this;
+
+			editor.on('nodechange', function() {
+				var blocks = editor.selection.getSelectedBlocks();
+				var disable = false;
+
+				for (var i = 0, l = blocks.length; !disable && i < l; i++) {
+					var tag = blocks[i].nodeName;
+
+					disable = (tag == 'LI' && isFirstChild(blocks[i]) || tag == 'UL' || tag == 'OL' || tag == 'DD');
+				}
+
+				ctrl.disabled(disable);
+			});
+		}
+	});
+
+	editor.on('keydown', function(e) {
+		if (e.keyCode == tinymce.util.VK.BACKSPACE) {
+			if (self.backspaceDelete()) {
+				e.preventDefault();
+			}
+		} else if (e.keyCode == tinymce.util.VK.DELETE) {
+			if (self.backspaceDelete(true)) {
+				e.preventDefault();
+			}
+		}
+	});
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/lists/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("lists",function(d){var a=this;function b(g){return g&&(/^(OL|UL|DL)$/).test(g.nodeName)}function c(g){return g.parentNode.firstChild==g}function f(g){return g.parentNode.lastChild==g}function e(g){return g&&!!d.schema.getTextBlockElements()[g.nodeName]}d.on("init",function(){var n=d.dom,v=d.selection;function u(x){var y={};function z(D){var B,A,C;A=x[D?"startContainer":"endContainer"];C=x[D?"startOffset":"endOffset"];if(A.nodeType==1){B=n.create("span",{"data-mce-type":"bookmark"});if(A.hasChildNodes()){C=Math.min(C,A.childNodes.length-1);if(D){A.insertBefore(B,A.childNodes[C])}else{n.insertAfter(B,A.childNodes[C])}}else{A.appendChild(B)}A=B;C=0}y[D?"startContainer":"endContainer"]=A;y[D?"startOffset":"endOffset"]=C}z(true);if(!x.collapsed){z()}return y}function t(y){function z(E){var A,C,B;function D(G){var H=G.parentNode.firstChild,F=0;while(H){if(H==G){return F}if(H.nodeType!=1||H.getAttribute("data-mce-type")!="bookmark"){F++}H=H.nextSibling}return -1}A=B=y[E?"startContainer":"endContainer"];C=y[E?"startOffset":"endOffset"];if(!A){return}if(A.nodeType==1){C=D(A);A=A.parentNode;n.remove(B)}y[E?"startContainer":"endContainer"]=A;y[E?"startOffset":"endOffset"]=C}z(true);z();var x=n.createRng();x.setStart(y.startContainer,y.startOffset);if(y.endContainer){x.setEnd(y.endContainer,y.endOffset)}v.setRng(x)}function k(x,B){var D,y,A=n.createFragment(),z;var C=d.schema.getBlockElements();if(d.settings.forced_root_block){B=B||d.settings.forced_root_block}if(B){y=n.create(B);if(y.tagName===d.settings.forced_root_block){n.setAttribs(y,d.settings.forced_root_block_attrs)}A.appendChild(y)}if(x){while((D=x.firstChild)){var E=D.nodeName;if(!z&&(E!="SPAN"||D.getAttribute("data-mce-type")!="bookmark")){z=true}if(C[E]){A.appendChild(D);y=null}else{if(B){if(!y){y=n.create(B);A.appendChild(y)}y.appendChild(D)}else{A.appendChild(D)}}}}if(!d.settings.forced_root_block){A.appendChild(n.create("br"))}else{if(!z&&(!tinymce.Env.ie||tinymce.Env.ie>10)){y.appendChild(n.create("br",{"data-mce-bogus":"1"}))}}return A}function p(){return tinymce.grep(v.getSelectedBlocks(),function(x){return/^(LI|DT|DD)$/.test(x.nodeName)})}function o(A,x,E){var z,y,B,C;function D(F){tinymce.each(B,function(G){F.parentNode.insertBefore(G,x.parentNode)});n.remove(F)}B=n.select('span[data-mce-type="bookmark"]',A);E=E||k(x);z=n.createRng();z.setStartAfter(x);z.setEndAfter(A);y=z.extractContents();for(C=y.firstChild;C;C=C.firstChild){if(C.nodeName=="LI"&&n.isEmpty(C)){n.remove(C);break}}if(!n.isEmpty(y)){n.insertAfter(y,A)}n.insertAfter(E,A);if(n.isEmpty(x.parentNode)){D(x.parentNode)}n.remove(x);if(n.isEmpty(A)){n.remove(A)}}function w(x){var y,z;y=x.nextSibling;if(y&&b(y)&&y.nodeName==x.nodeName){while((z=y.firstChild)){x.appendChild(z)}n.remove(y)}y=x.previousSibling;if(y&&b(y)&&y.nodeName==x.nodeName){while((z=y.firstChild)){x.insertBefore(z,x.firstChild)}n.remove(y)}}function g(x){tinymce.each(tinymce.grep(n.select("ol,ul",x)),function(z){var A,y=z.parentNode;if(y.nodeName=="LI"&&y.firstChild==z){A=y.previousSibling;if(A&&A.nodeName=="LI"){A.appendChild(z);if(n.isEmpty(y)){n.remove(y)}}}if(b(y)){A=y.previousSibling;if(A&&A.nodeName=="LI"){A.appendChild(z)}}})}function s(y){var z=y.parentNode,x=z.parentNode,B;function A(C){if(n.isEmpty(C)){n.remove(C)}}if(y.nodeName=="DD"){n.rename(y,"DT");return true}if(c(y)&&f(y)){if(x.nodeName=="LI"){n.insertAfter(y,x);A(x);n.remove(z)}else{if(b(x)){n.remove(z,true)}else{x.insertBefore(k(y),z);n.remove(z)}}return true}else{if(c(y)){if(x.nodeName=="LI"){n.insertAfter(y,x);y.appendChild(z);A(x)}else{if(b(x)){x.insertBefore(y,z)}else{x.insertBefore(k(y),z);n.remove(y)}}return true}else{if(f(y)){if(x.nodeName=="LI"){n.insertAfter(y,x)}else{if(b(x)){n.insertAfter(y,z)}else{n.insertAfter(k(y),z);n.remove(y)}}return true}else{if(x.nodeName=="LI"){z=x;B=k(y,"LI")}else{if(b(x)){B=k(y,"LI")}else{B=k(y)}}o(z,y,B);g(z.parentNode);return true}}}return false}function i(x){var z,y;function A(D,C){var B;if(b(D)){while((B=x.lastChild.firstChild)){C.appendChild(B)}n.remove(D)}}if(x.nodeName=="DT"){n.rename(x,"DD");return true}z=x.previousSibling;if(z&&b(z)){z.appendChild(x);return true}if(z&&z.nodeName=="LI"&&b(z.lastChild)){z.lastChild.appendChild(x);A(x.lastChild,z.lastChild);return true}z=x.nextSibling;if(z&&b(z)){z.insertBefore(x,z.firstChild);return true}if(z&&z.nodeName=="LI"&&b(x.lastChild)){return false}z=x.previousSibling;if(z&&z.nodeName=="LI"){y=n.create(x.parentNode.nodeName);z.appendChild(y);y.appendChild(x);A(x.lastChild,y);return true}return false}function h(){var y=p();if(y.length){var z=u(v.getRng(true));for(var x=0;x<y.length;x++){if(!i(y[x])&&x===0){break}}t(z);d.nodeChanged();return true}}function q(){var A=p();if(A.length){var B=u(v.getRng(true));var z,D,x=d.getBody();z=A.length;while(z--){var C=A[z].parentNode;while(C&&C!=x){D=A.length;while(D--){if(A[D]===C){A.splice(z,1);break}}C=C.parentNode}}for(z=0;z<A.length;z++){if(!s(A[z])&&z===0){break}}t(B);d.nodeChanged();return true}}function j(z){var y=v.getRng(true),B=u(y),A="LI";z=z.toUpperCase();if(z=="DL"){A="DT"}function x(){var H=[],D=d.getBody();function F(M){var K,L;K=y[M?"startContainer":"endContainer"];L=y[M?"startOffset":"endOffset"];if(K.nodeType==1){K=K.childNodes[Math.min(L,K.childNodes.length-1)]||K}while(K.parentNode!=D){if(e(K)){return K}if(/^(TD|TH)$/.test(K.parentNode.nodeName)){return K}K=K.parentNode}return K}var E=F(true);var C=F();var J,I=[];for(var G=E;G;G=G.nextSibling){I.push(G);if(G==C){break}}tinymce.each(I,function(K){if(e(K)){H.push(K);J=null;return}if(n.isBlock(K)||K.nodeName=="BR"){if(K.nodeName=="BR"){n.remove(K)}J=null;return}var L=K.nextSibling;if(tinymce.dom.BookmarkManager.isBookmarkNode(K)){if(e(L)||(!L&&K.parentNode==D)){J=null;return}}if(!J){J=n.create("p");K.parentNode.insertBefore(J,K);H.push(J)}J.appendChild(K)});return H}tinymce.each(x(),function(E){var C,D;D=E.previousSibling;if(D&&b(D)&&D.nodeName==z){C=D;E=n.rename(E,A);D.appendChild(E)}else{C=n.create(z);E.parentNode.insertBefore(C,E);C.appendChild(E);E=n.rename(E,A)}w(C)});t(B)}function r(){var y=u(v.getRng(true)),x=d.getBody();tinymce.each(p(),function(z){var B,A;if(n.isEmpty(z)){s(z);return}for(B=z;B&&B!=x;B=B.parentNode){if(b(B)){A=B}}o(A,z)});t(y)}function m(y){var x=n.getParent(v.getStart(),"OL,UL,DL");if(x){if(x.nodeName==y){r(y)}else{var z=u(v.getRng(true));w(n.rename(x,y));t(z)}}else{j(y)}}function l(x){return function(){var y=n.getParent(d.selection.getStart(),"UL,OL,DL");return y&&y.nodeName==x}}a.backspaceDelete=function(B){function C(F,H){var G=F.startContainer,J=F.startOffset;var E,I;if(G.nodeType==3&&(H?J<G.data.length:J>0)){return G}E=d.schema.getNonEmptyElements();I=new tinymce.dom.TreeWalker(F.startContainer);while((G=I[H?"next":"prev"]())){if(G.nodeName=="LI"&&!G.hasChildNodes()){return G}if(E[G.nodeName]){return G}if(G.nodeType==3&&G.data.length>0){return G}}}function D(F,I){var H,G,E=F.parentNode;if(b(I.lastChild)){G=I.lastChild}H=I.lastChild;if(H&&H.nodeName=="BR"&&F.hasChildNodes()){n.remove(H)}if(n.isEmpty(I)){n.$(I).empty()}if(!n.isEmpty(F)){while((H=F.firstChild)){I.appendChild(H)}}if(G){I.appendChild(G)}n.remove(F);if(n.isEmpty(E)){n.remove(E)}}if(v.isCollapsed()){var x=n.getParent(v.getStart(),"LI");if(x){var z=v.getRng(true);var y=n.getParent(C(z,B),"LI");if(y&&y!=x){var A=u(z);if(B){D(y,x)}else{D(x,y)}t(A);return true}else{if(!y){if(!B&&r(x.parentNode.nodeName)){return true}}}}}};d.on("BeforeExecCommand",function(z){var y=z.command.toLowerCase(),x;if(y=="indent"){if(h()){x=true}}else{if(y=="outdent"){if(q()){x=true}}}if(x){d.fire("ExecCommand",{command:z.command});z.preventDefault();return true}});d.addCommand("InsertUnorderedList",function(){m("UL")});d.addCommand("InsertOrderedList",function(){m("OL")});d.addCommand("InsertDefinitionList",function(){m("DL")});d.addQueryStateHandler("InsertUnorderedList",l("UL"));d.addQueryStateHandler("InsertOrderedList",l("OL"));d.addQueryStateHandler("InsertDefinitionList",l("DL"));d.on("keydown",function(x){if(x.keyCode!=9||tinymce.util.VK.metaKeyPressed(x)){return}if(d.dom.getParent(d.selection.getStart(),"LI,DT,DD")){x.preventDefault();if(x.shiftKey){q()}else{h()}}})});d.addButton("indent",{icon:"indent",title:"Increase indent",cmd:"Indent",onPostRender:function(){var g=this;d.on("nodechange",function(){var n=d.selection.getSelectedBlocks();var k=false;for(var m=0,j=n.length;!k&&m<j;m++){var h=n[m].nodeName;k=(h=="LI"&&c(n[m])||h=="UL"||h=="OL"||h=="DD")}g.disabled(k)})}});d.on("keydown",function(g){if(g.keyCode==tinymce.util.VK.BACKSPACE){if(a.backspaceDelete()){g.preventDefault()}}else{if(g.keyCode==tinymce.util.VK.DELETE){if(a.backspaceDelete(true)){g.preventDefault()}}}})});
\ No newline at end of file
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/media/moxieplayer.swf has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/media/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,782 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*jshint maxlen:255 */
+/*eslint max-len:0 */
+/*global tinymce:true */
+
+tinymce.PluginManager.add('media', function(editor, url) {
+	var urlPatterns = [
+		{regex: /youtu\.be\/([\w\-.]+)/, type: 'iframe', w: 425, h: 350, url: '//www.youtube.com/embed/$1'},
+		{regex: /youtube\.com(.+)v=([^&]+)/, type: 'iframe', w: 425, h: 350, url: '//www.youtube.com/embed/$2'},
+		{regex: /vimeo\.com\/([0-9]+)/, type: 'iframe', w: 425, h: 350, url: '//player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc'},
+		{regex: /vimeo\.com\/(.*)\/([0-9]+)/, type: "iframe", w: 425, h: 350, url: "//player.vimeo.com/video/$2?title=0&amp;byline=0"},
+		{regex: /maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/, type: 'iframe', w: 425, h: 350, url: '//maps.google.com/maps/ms?msid=$2&output=embed"'}
+	];
+
+	var embedChange = (tinymce.Env.ie && tinymce.Env.ie <= 8) ? 'onChange' : 'onInput';
+
+	function guessMime(url) {
+		url = url.toLowerCase();
+
+		if (url.indexOf('.mp3') != -1) {
+			return 'audio/mpeg';
+		}
+
+		if (url.indexOf('.wav') != -1) {
+			return 'audio/wav';
+		}
+
+		if (url.indexOf('.mp4') != -1) {
+			return 'video/mp4';
+		}
+
+		if (url.indexOf('.webm') != -1) {
+			return 'video/webm';
+		}
+
+		if (url.indexOf('.ogg') != -1) {
+			return 'video/ogg';
+		}
+
+		if (url.indexOf('.swf') != -1) {
+			return 'application/x-shockwave-flash';
+		}
+
+		return '';
+	}
+
+	function getVideoScriptMatch(src) {
+		var prefixes = editor.settings.media_scripts;
+
+		if (prefixes) {
+			for (var i = 0; i < prefixes.length; i++) {
+				if (src.indexOf(prefixes[i].filter) !== -1) {
+					return prefixes[i];
+				}
+			}
+		}
+	}
+
+	function showDialog() {
+		var win, width, height, data;
+
+		var generalFormItems = [
+			{
+				name: 'source1',
+				type: 'filepicker',
+				filetype: 'media',
+				size: 40,
+				autofocus: true,
+				label: 'Source',
+				onchange: function(e) {
+					tinymce.each(e.meta, function(value, key) {
+						win.find('#' + key).value(value);
+					});
+				}
+			}
+		];
+
+		function recalcSize(e) {
+			var widthCtrl, heightCtrl, newWidth, newHeight;
+
+			widthCtrl = win.find('#width')[0];
+			heightCtrl = win.find('#height')[0];
+
+			newWidth = widthCtrl.value();
+			newHeight = heightCtrl.value();
+
+			if (win.find('#constrain')[0].checked() && width && height && newWidth && newHeight) {
+				if (e.control == widthCtrl) {
+					newHeight = Math.round((newWidth / width) * newHeight);
+
+					if (!isNaN(newHeight)) {
+						heightCtrl.value(newHeight);
+					}
+				} else {
+					newWidth = Math.round((newHeight / height) * newWidth);
+
+					if (!isNaN(newWidth)) {
+						widthCtrl.value(newWidth);
+					}
+				}
+			}
+
+			width = newWidth;
+			height = newHeight;
+		}
+
+		if (editor.settings.media_alt_source !== false) {
+			generalFormItems.push({name: 'source2', type: 'filepicker', filetype: 'media', size: 40, label: 'Alternative source'});
+		}
+
+		if (editor.settings.media_poster !== false) {
+			generalFormItems.push({name: 'poster', type: 'filepicker', filetype: 'image', size: 40, label: 'Poster'});
+		}
+
+		if (editor.settings.media_dimensions !== false) {
+			generalFormItems.push({
+				type: 'container',
+				label: 'Dimensions',
+				layout: 'flex',
+				align: 'center',
+				spacing: 5,
+				items: [
+					{name: 'width', type: 'textbox', maxLength: 5, size: 3, onchange: recalcSize, ariaLabel: 'Width'},
+					{type: 'label', text: 'x'},
+					{name: 'height', type: 'textbox', maxLength: 5, size: 3, onchange: recalcSize, ariaLabel: 'Height'},
+					{name: 'constrain', type: 'checkbox', checked: true, text: 'Constrain proportions'}
+				]
+			});
+		}
+
+		data = getData(editor.selection.getNode());
+		width = data.width;
+		height = data.height;
+
+		var embedTextBox = {
+			id: 'mcemediasource',
+			type: 'textbox',
+			flex: 1,
+			name: 'embed',
+			value: getSource(),
+			multiline: true,
+			label: 'Source'
+		};
+
+		function updateValueOnChange() {
+			data = htmlToData(this.value());
+			this.parent().parent().fromJSON(data);
+		}
+
+		embedTextBox[embedChange] = updateValueOnChange;
+
+		win = editor.windowManager.open({
+			title: 'Insert/edit video',
+			data: data,
+			bodyType: 'tabpanel',
+			body: [
+				{
+					title: 'General',
+					type: "form",
+					onShowTab: function() {
+						data = htmlToData(this.next().find('#embed').value());
+						this.fromJSON(data);
+					},
+					items: generalFormItems
+				},
+
+				{
+					title: 'Embed',
+					type: "panel",
+					layout: 'flex',
+					direction: 'column',
+					align: 'stretch',
+					padding: 10,
+					spacing: 10,
+					onShowTab: function() {
+						this.find('#embed').value(dataToHtml(this.parent().toJSON()));
+					},
+					items: [
+						{
+							type: 'label',
+							text: 'Paste your embed code below:',
+							forId: 'mcemediasource'
+						},
+						embedTextBox
+					]
+				}
+			],
+			onSubmit: function() {
+				var beforeObjects, afterObjects, i, y;
+
+				beforeObjects = editor.dom.select('img[data-mce-object]');
+				editor.insertContent(dataToHtml(this.toJSON()));
+				afterObjects = editor.dom.select('img[data-mce-object]');
+
+				// Find new image placeholder so we can select it
+				for (i = 0; i < beforeObjects.length; i++) {
+					for (y = afterObjects.length - 1; y >= 0; y--) {
+						if (beforeObjects[i] == afterObjects[y]) {
+							afterObjects.splice(y, 1);
+						}
+					}
+				}
+
+				editor.selection.select(afterObjects[0]);
+				editor.nodeChanged();
+			}
+		});
+	}
+
+	function getSource() {
+		var elm = editor.selection.getNode();
+
+		if (elm.getAttribute('data-mce-object')) {
+			return editor.selection.getContent();
+		}
+	}
+
+	function dataToHtml(data) {
+		var html = '';
+
+		if (!data.source1) {
+			tinymce.extend(data, htmlToData(data.embed));
+			if (!data.source1) {
+				return '';
+			}
+		}
+
+		if (!data.source2) {
+			data.source2 = '';
+		}
+
+		if (!data.poster) {
+			data.poster = '';
+		}
+
+		data.source1 = editor.convertURL(data.source1, "source");
+		data.source2 = editor.convertURL(data.source2, "source");
+		data.source1mime = guessMime(data.source1);
+		data.source2mime = guessMime(data.source2);
+		data.poster = editor.convertURL(data.poster, "poster");
+		data.flashPlayerUrl = editor.convertURL(url + '/moxieplayer.swf', "movie");
+
+		tinymce.each(urlPatterns, function(pattern) {
+			var match, i, url;
+
+			if ((match = pattern.regex.exec(data.source1))) {
+				url = pattern.url;
+
+				for (i = 0; match[i]; i++) {
+					/*jshint loopfunc:true*/
+					/*eslint no-loop-func:0 */
+					url = url.replace('$' + i, function() {
+						return match[i];
+					});
+				}
+
+				data.source1 = url;
+				data.type = pattern.type;
+				data.width = data.width || pattern.w;
+				data.height = data.height || pattern.h;
+			}
+		});
+
+		if (data.embed) {
+			html = updateHtml(data.embed, data, true);
+		} else {
+			var videoScript = getVideoScriptMatch(data.source1);
+			if (videoScript) {
+				data.type = 'script';
+				data.width = videoScript.width;
+				data.height = videoScript.height;
+			}
+
+			data.width = data.width || 300;
+			data.height = data.height || 150;
+
+			tinymce.each(data, function(value, key) {
+				data[key] = editor.dom.encode(value);
+			});
+
+			if (data.type == "iframe") {
+				html += '<iframe src="' + data.source1 + '" width="' + data.width + '" height="' + data.height + '"></iframe>';
+			} else if (data.source1mime == "application/x-shockwave-flash") {
+				html += '<object data="' + data.source1 + '" width="' + data.width + '" height="' + data.height + '" type="application/x-shockwave-flash">';
+
+				if (data.poster) {
+					html += '<img src="' + data.poster + '" width="' + data.width + '" height="' + data.height + '" />';
+				}
+
+				html += '</object>';
+			} else if (data.source1mime.indexOf('audio') != -1) {
+				if (editor.settings.audio_template_callback) {
+					html = editor.settings.audio_template_callback(data);
+				} else {
+					html += (
+						'<audio controls="controls" src="' + data.source1 + '">' +
+							(data.source2 ? '\n<source src="' + data.source2 + '"' + (data.source2mime ? ' type="' + data.source2mime + '"' : '') + ' />\n' : '') +
+						'</audio>'
+					);
+				}
+			} else if (data.type == "script") {
+				html += '<script src="' + data.source1 + '"></script>';
+			} else {
+				if (editor.settings.video_template_callback) {
+					html = editor.settings.video_template_callback(data);
+				} else {
+					html = (
+						'<video width="' + data.width + '" height="' + data.height + '"' + (data.poster ? ' poster="' + data.poster + '"' : '') + ' controls="controls">\n' +
+							'<source src="' + data.source1 + '"' + (data.source1mime ? ' type="' + data.source1mime + '"' : '') + ' />\n' +
+							(data.source2 ? '<source src="' + data.source2 + '"' + (data.source2mime ? ' type="' + data.source2mime + '"' : '') + ' />\n' : '') +
+						'</video>'
+					);
+				}
+			}
+		}
+
+		return html;
+	}
+
+	function htmlToData(html) {
+		var data = {};
+
+		new tinymce.html.SaxParser({
+			validate: false,
+			allow_conditional_comments: true,
+			special: 'script,noscript',
+			start: function(name, attrs) {
+				if (!data.source1 && name == "param") {
+					data.source1 = attrs.map.movie;
+				}
+
+				if (name == "iframe" || name == "object" || name == "embed" || name == "video" || name == "audio") {
+					if (!data.type) {
+						data.type = name;
+					}
+
+					data = tinymce.extend(attrs.map, data);
+				}
+
+				if (name == "script") {
+					var videoScript = getVideoScriptMatch(attrs.map.src);
+					if (!videoScript) {
+						return;
+					}
+
+					data = {
+						type: "script",
+						source1: attrs.map.src,
+						width: videoScript.width,
+						height: videoScript.height
+					};
+				}
+
+				if (name == "source") {
+					if (!data.source1) {
+						data.source1 = attrs.map.src;
+					} else if (!data.source2) {
+						data.source2 = attrs.map.src;
+					}
+				}
+
+				if (name == "img" && !data.poster) {
+					data.poster = attrs.map.src;
+				}
+			}
+		}).parse(html);
+
+		data.source1 = data.source1 || data.src || data.data;
+		data.source2 = data.source2 || '';
+		data.poster = data.poster || '';
+
+		return data;
+	}
+
+	function getData(element) {
+		if (element.getAttribute('data-mce-object')) {
+			return htmlToData(editor.serializer.serialize(element, {selection: true}));
+		}
+
+		return {};
+	}
+
+	function sanitize(html) {
+		if (editor.settings.media_filter_html === false) {
+			return html;
+		}
+
+		var writer = new tinymce.html.Writer();
+
+		new tinymce.html.SaxParser({
+			validate: false,
+			allow_conditional_comments: false,
+			special: 'script,noscript',
+
+			comment: function(text) {
+				writer.comment(text);
+			},
+
+			cdata: function(text) {
+				writer.cdata(text);
+			},
+
+			text: function(text, raw) {
+				writer.text(text, raw);
+			},
+
+			start: function(name, attrs, empty) {
+				if (name == 'script' || name == 'noscript') {
+					return;
+				}
+
+				for (var i = 0; i < attrs.length; i++) {
+					if (attrs[i].name.indexOf('on') === 0) {
+						return;
+					}
+				}
+
+				writer.start(name, attrs, empty);
+			},
+
+			end: function(name) {
+				if (name == 'script' || name == 'noscript') {
+					return;
+				}
+
+				writer.end(name);
+			}
+		}, new tinymce.html.Schema({})).parse(html);
+
+		return writer.getContent();
+	}
+
+	function updateHtml(html, data, updateAll) {
+		var writer = new tinymce.html.Writer();
+		var sourceCount = 0, hasImage;
+
+		function setAttributes(attrs, updatedAttrs) {
+			var name, i, value, attr;
+
+			for (name in updatedAttrs) {
+				value = "" + updatedAttrs[name];
+
+				if (attrs.map[name]) {
+					i = attrs.length;
+					while (i--) {
+						attr = attrs[i];
+
+						if (attr.name == name) {
+							if (value) {
+								attrs.map[name] = value;
+								attr.value = value;
+							} else {
+								delete attrs.map[name];
+								attrs.splice(i, 1);
+							}
+						}
+					}
+				} else if (value) {
+					attrs.push({
+						name: name,
+						value: value
+					});
+
+					attrs.map[name] = value;
+				}
+			}
+		}
+
+		new tinymce.html.SaxParser({
+			validate: false,
+			allow_conditional_comments: true,
+			special: 'script,noscript',
+
+			comment: function(text) {
+				writer.comment(text);
+			},
+
+			cdata: function(text) {
+				writer.cdata(text);
+			},
+
+			text: function(text, raw) {
+				writer.text(text, raw);
+			},
+
+			start: function(name, attrs, empty) {
+				switch (name) {
+					case "video":
+					case "object":
+					case "embed":
+					case "img":
+					case "iframe":
+						setAttributes(attrs, {
+							width: data.width,
+							height: data.height
+						});
+						break;
+				}
+
+				if (updateAll) {
+					switch (name) {
+						case "video":
+							setAttributes(attrs, {
+								poster: data.poster,
+								src: ""
+							});
+
+							if (data.source2) {
+								setAttributes(attrs, {
+									src: ""
+								});
+							}
+							break;
+
+						case "iframe":
+							setAttributes(attrs, {
+								src: data.source1
+							});
+							break;
+
+						case "source":
+							sourceCount++;
+
+							if (sourceCount <= 2) {
+								setAttributes(attrs, {
+									src: data["source" + sourceCount],
+									type: data["source" + sourceCount + "mime"]
+								});
+
+								if (!data["source" + sourceCount]) {
+									return;
+								}
+							}
+							break;
+
+						case "img":
+							if (!data.poster) {
+								return;
+							}
+
+							hasImage = true;
+							break;
+					}
+				}
+
+				writer.start(name, attrs, empty);
+			},
+
+			end: function(name) {
+				if (name == "video" && updateAll) {
+					for (var index = 1; index <= 2; index++) {
+						if (data["source" + index]) {
+							var attrs = [];
+							attrs.map = {};
+
+							if (sourceCount < index) {
+								setAttributes(attrs, {
+									src: data["source" + index],
+									type: data["source" + index + "mime"]
+								});
+
+								writer.start("source", attrs, true);
+							}
+						}
+					}
+				}
+
+				if (data.poster && name == "object" && updateAll && !hasImage) {
+					var imgAttrs = [];
+					imgAttrs.map = {};
+
+					setAttributes(imgAttrs, {
+						src: data.poster,
+						width: data.width,
+						height: data.height
+					});
+
+					writer.start("img", imgAttrs, true);
+				}
+
+				writer.end(name);
+			}
+		}, new tinymce.html.Schema({})).parse(html);
+
+		return writer.getContent();
+	}
+
+	editor.on('ResolveName', function(e) {
+		var name;
+
+		if (e.target.nodeType == 1 && (name = e.target.getAttribute("data-mce-object"))) {
+			e.name = name;
+		}
+	});
+
+	editor.on('preInit', function() {
+		// Make sure that any messy HTML is retained inside these
+		var specialElements = editor.schema.getSpecialElements();
+		tinymce.each('video audio iframe object'.split(' '), function(name) {
+			specialElements[name] = new RegExp('<\/' + name + '[^>]*>', 'gi');
+		});
+
+		// Allow elements
+		//editor.schema.addValidElements('object[id|style|width|height|classid|codebase|*],embed[id|style|width|height|type|src|*],video[*],audio[*]');
+
+		// Set allowFullscreen attribs as boolean
+		var boolAttrs = editor.schema.getBoolAttrs();
+		tinymce.each('webkitallowfullscreen mozallowfullscreen allowfullscreen'.split(' '), function(name) {
+			boolAttrs[name] = {};
+		});
+
+		// Converts iframe, video etc into placeholder images
+		editor.parser.addNodeFilter('iframe,video,audio,object,embed,script', function(nodes, name) {
+			var i = nodes.length, ai, node, placeHolder, attrName, attrValue, attribs, innerHtml;
+			var videoScript;
+
+			while (i--) {
+				node = nodes[i];
+				if (!node.parent) {
+					continue;
+				}
+
+				if (node.name == 'script') {
+					videoScript = getVideoScriptMatch(node.attr('src'));
+					if (!videoScript) {
+						continue;
+					}
+				}
+
+				placeHolder = new tinymce.html.Node('img', 1);
+				placeHolder.shortEnded = true;
+
+				if (videoScript) {
+					if (videoScript.width) {
+						node.attr('width', videoScript.width.toString());
+					}
+
+					if (videoScript.height) {
+						node.attr('height', videoScript.height.toString());
+					}
+				}
+
+				// Prefix all attributes except width, height and style since we
+				// will add these to the placeholder
+				attribs = node.attributes;
+				ai = attribs.length;
+				while (ai--) {
+					attrName = attribs[ai].name;
+					attrValue = attribs[ai].value;
+
+					if (attrName !== "width" && attrName !== "height" && attrName !== "style") {
+						if (attrName == "data" || attrName == "src") {
+							attrValue = editor.convertURL(attrValue, attrName);
+						}
+
+						placeHolder.attr('data-mce-p-' + attrName, attrValue);
+					}
+				}
+
+				// Place the inner HTML contents inside an escaped attribute
+				// This enables us to copy/paste the fake object
+				innerHtml = node.firstChild && node.firstChild.value;
+				if (innerHtml) {
+					placeHolder.attr("data-mce-html", escape(innerHtml));
+					placeHolder.firstChild = null;
+				}
+
+				placeHolder.attr({
+					width: node.attr('width') || "300",
+					height: node.attr('height') || (name == "audio" ? "30" : "150"),
+					style: node.attr('style'),
+					src: tinymce.Env.transparentSrc,
+					"data-mce-object": name,
+					"class": "mce-object mce-object-" + name
+				});
+
+				node.replace(placeHolder);
+			}
+		});
+
+		// Replaces placeholder images with real elements for video, object, iframe etc
+		editor.serializer.addAttributeFilter('data-mce-object', function(nodes, name) {
+			var i = nodes.length, node, realElm, ai, attribs, innerHtml, innerNode, realElmName;
+
+			while (i--) {
+				node = nodes[i];
+				if (!node.parent) {
+					continue;
+				}
+
+				realElmName = node.attr(name);
+				realElm = new tinymce.html.Node(realElmName, 1);
+
+				// Add width/height to everything but audio
+				if (realElmName != "audio" && realElmName != "script") {
+					realElm.attr({
+						width: node.attr('width'),
+						height: node.attr('height')
+					});
+				}
+
+				realElm.attr({
+					style: node.attr('style')
+				});
+
+				// Unprefix all placeholder attributes
+				attribs = node.attributes;
+				ai = attribs.length;
+				while (ai--) {
+					var attrName = attribs[ai].name;
+
+					if (attrName.indexOf('data-mce-p-') === 0) {
+						realElm.attr(attrName.substr(11), attribs[ai].value);
+					}
+				}
+
+				if (realElmName == "script") {
+					realElm.attr('type', 'text/javascript');
+				}
+
+				// Inject innerhtml
+				innerHtml = node.attr('data-mce-html');
+				if (innerHtml) {
+					innerNode = new tinymce.html.Node('#text', 3);
+					innerNode.raw = true;
+					innerNode.value = sanitize(unescape(innerHtml));
+					realElm.append(innerNode);
+				}
+
+				node.replace(realElm);
+			}
+		});
+	});
+
+	editor.on('ObjectSelected', function(e) {
+		var objectType = e.target.getAttribute('data-mce-object');
+
+		if (objectType == "audio" || objectType == "script") {
+			e.preventDefault();
+		}
+	});
+
+	editor.on('objectResized', function(e) {
+		var target = e.target, html;
+
+		if (target.getAttribute('data-mce-object')) {
+			html = target.getAttribute('data-mce-html');
+			if (html) {
+				html = unescape(html);
+				target.setAttribute('data-mce-html', escape(
+					updateHtml(html, {
+						width: e.width,
+						height: e.height
+					})
+				));
+			}
+		}
+	});
+
+	editor.addButton('media', {
+		tooltip: 'Insert/edit video',
+		onclick: showDialog,
+		stateSelector: ['img[data-mce-object=video]', 'img[data-mce-object=iframe]']
+	});
+
+	editor.addMenuItem('media', {
+		icon: 'media',
+		text: 'Insert/edit video',
+		onclick: showDialog,
+		context: 'insert',
+		prependToContext: true
+	});
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/media/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("media",function(e,b){var m=[{regex:/youtu\.be\/([\w\-.]+)/,type:"iframe",w:425,h:350,url:"//www.youtube.com/embed/$1"},{regex:/youtube\.com(.+)v=([^&]+)/,type:"iframe",w:425,h:350,url:"//www.youtube.com/embed/$2"},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc"},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$2?title=0&amp;byline=0"},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'//maps.google.com/maps/ms?msid=$2&output=embed"'}];var k=(tinymce.Env.ie&&tinymce.Env.ie<=8)?"onChange":"onInput";function a(n){n=n.toLowerCase();if(n.indexOf(".mp3")!=-1){return"audio/mpeg"}if(n.indexOf(".wav")!=-1){return"audio/wav"}if(n.indexOf(".mp4")!=-1){return"video/mp4"}if(n.indexOf(".webm")!=-1){return"video/webm"}if(n.indexOf(".ogg")!=-1){return"video/ogg"}if(n.indexOf(".swf")!=-1){return"application/x-shockwave-flash"}return""}function j(p){var o=e.settings.media_scripts;if(o){for(var n=0;n<o.length;n++){if(p.indexOf(o[n].filter)!==-1){return o[n]}}}}function i(){var u,s,o,t;var r=[{name:"source1",type:"filepicker",filetype:"media",size:40,autofocus:true,label:"Source",onchange:function(v){tinymce.each(v.meta,function(x,w){u.find("#"+w).value(x)})}}];function p(z){var w,y,x,v;w=u.find("#width")[0];y=u.find("#height")[0];x=w.value();v=y.value();if(u.find("#constrain")[0].checked()&&s&&o&&x&&v){if(z.control==w){v=Math.round((x/s)*v);if(!isNaN(v)){y.value(v)}}else{x=Math.round((v/o)*x);if(!isNaN(x)){w.value(x)}}}s=x;o=v}if(e.settings.media_alt_source!==false){r.push({name:"source2",type:"filepicker",filetype:"media",size:40,label:"Alternative source"})}if(e.settings.media_poster!==false){r.push({name:"poster",type:"filepicker",filetype:"image",size:40,label:"Poster"})}if(e.settings.media_dimensions!==false){r.push({type:"container",label:"Dimensions",layout:"flex",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:3,onchange:p,ariaLabel:"Width"},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:3,onchange:p,ariaLabel:"Height"},{name:"constrain",type:"checkbox",checked:true,text:"Constrain proportions"}]})}t=d(e.selection.getNode());s=t.width;o=t.height;var n={id:"mcemediasource",type:"textbox",flex:1,name:"embed",value:f(),multiline:true,label:"Source"};function q(){t=l(this.value());this.parent().parent().fromJSON(t)}n[k]=q;u=e.windowManager.open({title:"Insert/edit video",data:t,bodyType:"tabpanel",body:[{title:"General",type:"form",onShowTab:function(){t=l(this.next().find("#embed").value());this.fromJSON(t)},items:r},{title:"Embed",type:"panel",layout:"flex",direction:"column",align:"stretch",padding:10,spacing:10,onShowTab:function(){this.find("#embed").value(h(this.parent().toJSON()))},items:[{type:"label",text:"Paste your embed code below:",forId:"mcemediasource"},n]}],onSubmit:function(){var x,v,w,z;x=e.dom.select("img[data-mce-object]");e.insertContent(h(this.toJSON()));v=e.dom.select("img[data-mce-object]");for(w=0;w<x.length;w++){for(z=v.length-1;z>=0;z--){if(x[w]==v[z]){v.splice(z,1)}}}e.selection.select(v[0]);e.nodeChanged()}})}function f(){var n=e.selection.getNode();if(n.getAttribute("data-mce-object")){return e.selection.getContent()}}function h(p){var o="";if(!p.source1){tinymce.extend(p,l(p.embed));if(!p.source1){return""}}if(!p.source2){p.source2=""}if(!p.poster){p.poster=""}p.source1=e.convertURL(p.source1,"source");p.source2=e.convertURL(p.source2,"source");p.source1mime=a(p.source1);p.source2mime=a(p.source2);p.poster=e.convertURL(p.poster,"poster");p.flashPlayerUrl=e.convertURL(b+"/moxieplayer.swf","movie");tinymce.each(m,function(t){var r,s,q;if((r=t.regex.exec(p.source1))){q=t.url;for(s=0;r[s];s++){q=q.replace("$"+s,function(){return r[s]})}p.source1=q;p.type=t.type;p.width=p.width||t.w;p.height=p.height||t.h}});if(p.embed){o=g(p.embed,p,true)}else{var n=j(p.source1);if(n){p.type="script";p.width=n.width;p.height=n.height}p.width=p.width||300;p.height=p.height||150;tinymce.each(p,function(r,q){p[q]=e.dom.encode(r)});if(p.type=="iframe"){o+='<iframe src="'+p.source1+'" width="'+p.width+'" height="'+p.height+'"></iframe>'}else{if(p.source1mime=="application/x-shockwave-flash"){o+='<object data="'+p.source1+'" width="'+p.width+'" height="'+p.height+'" type="application/x-shockwave-flash">';if(p.poster){o+='<img src="'+p.poster+'" width="'+p.width+'" height="'+p.height+'" />'}o+="</object>"}else{if(p.source1mime.indexOf("audio")!=-1){if(e.settings.audio_template_callback){o=e.settings.audio_template_callback(p)}else{o+=('<audio controls="controls" src="'+p.source1+'">'+(p.source2?'\n<source src="'+p.source2+'"'+(p.source2mime?' type="'+p.source2mime+'"':"")+" />\n":"")+"</audio>")}}else{if(p.type=="script"){o+='<script src="'+p.source1+'"><\/script>'}else{if(e.settings.video_template_callback){o=e.settings.video_template_callback(p)}else{o=('<video width="'+p.width+'" height="'+p.height+'"'+(p.poster?' poster="'+p.poster+'"':"")+' controls="controls">\n<source src="'+p.source1+'"'+(p.source1mime?' type="'+p.source1mime+'"':"")+" />\n"+(p.source2?'<source src="'+p.source2+'"'+(p.source2mime?' type="'+p.source2mime+'"':"")+" />\n":"")+"</video>")}}}}}}return o}function l(n){var o={};new tinymce.html.SaxParser({validate:false,allow_conditional_comments:true,special:"script,noscript",start:function(q,p){if(!o.source1&&q=="param"){o.source1=p.map.movie}if(q=="iframe"||q=="object"||q=="embed"||q=="video"||q=="audio"){if(!o.type){o.type=q}o=tinymce.extend(p.map,o)}if(q=="script"){var r=j(p.map.src);if(!r){return}o={type:"script",source1:p.map.src,width:r.width,height:r.height}}if(q=="source"){if(!o.source1){o.source1=p.map.src}else{if(!o.source2){o.source2=p.map.src}}}if(q=="img"&&!o.poster){o.poster=p.map.src}}}).parse(n);o.source1=o.source1||o.src||o.data;o.source2=o.source2||"";o.poster=o.poster||"";return o}function d(n){if(n.getAttribute("data-mce-object")){return l(e.serializer.serialize(n,{selection:true}))}return{}}function c(n){if(e.settings.media_filter_html===false){return n}var o=new tinymce.html.Writer();new tinymce.html.SaxParser({validate:false,allow_conditional_comments:false,special:"script,noscript",comment:function(p){o.comment(p)},cdata:function(p){o.cdata(p)},text:function(q,p){o.text(q,p)},start:function(q,p,s){if(q=="script"||q=="noscript"){return}for(var r=0;r<p.length;r++){if(p[r].name.indexOf("on")===0){return}}o.start(q,p,s)},end:function(p){if(p=="script"||p=="noscript"){return}o.end(p)}},new tinymce.html.Schema({})).parse(n);return o.getContent()}function g(p,s,t){var r=new tinymce.html.Writer();var o=0,q;function n(w,z){var v,x,y,u;for(v in z){y=""+z[v];if(w.map[v]){x=w.length;while(x--){u=w[x];if(u.name==v){if(y){w.map[v]=y;u.value=y}else{delete w.map[v];w.splice(x,1)}}}}else{if(y){w.push({name:v,value:y});w.map[v]=y}}}}new tinymce.html.SaxParser({validate:false,allow_conditional_comments:true,special:"script,noscript",comment:function(u){r.comment(u)},cdata:function(u){r.cdata(u)},text:function(v,u){r.text(v,u)},start:function(v,u,w){switch(v){case"video":case"object":case"embed":case"img":case"iframe":n(u,{width:s.width,height:s.height});break}if(t){switch(v){case"video":n(u,{poster:s.poster,src:""});if(s.source2){n(u,{src:""})}break;case"iframe":n(u,{src:s.source1});break;case"source":o++;if(o<=2){n(u,{src:s["source"+o],type:s["source"+o+"mime"]});if(!s["source"+o]){return}}break;case"img":if(!s.poster){return}q=true;break}}r.start(v,u,w)},end:function(x){if(x=="video"&&t){for(var w=1;w<=2;w++){if(s["source"+w]){var v=[];v.map={};if(o<w){n(v,{src:s["source"+w],type:s["source"+w+"mime"]});r.start("source",v,true)}}}}if(s.poster&&x=="object"&&t&&!q){var u=[];u.map={};n(u,{src:s.poster,width:s.width,height:s.height});r.start("img",u,true)}r.end(x)}},new tinymce.html.Schema({})).parse(p);return r.getContent()}e.on("ResolveName",function(o){var n;if(o.target.nodeType==1&&(n=o.target.getAttribute("data-mce-object"))){o.name=n}});e.on("preInit",function(){var n=e.schema.getSpecialElements();tinymce.each("video audio iframe object".split(" "),function(p){n[p]=new RegExp("</"+p+"[^>]*>","gi")});var o=e.schema.getBoolAttrs();tinymce.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),function(p){o[p]={}});e.parser.addNodeFilter("iframe,video,audio,object,embed,script",function(r,q){var u=r.length,y,t,z,x,w,p,s;var v;while(u--){t=r[u];if(!t.parent){continue}if(t.name=="script"){v=j(t.attr("src"));if(!v){continue}}z=new tinymce.html.Node("img",1);z.shortEnded=true;if(v){if(v.width){t.attr("width",v.width.toString())}if(v.height){t.attr("height",v.height.toString())}}p=t.attributes;y=p.length;while(y--){x=p[y].name;w=p[y].value;if(x!=="width"&&x!=="height"&&x!=="style"){if(x=="data"||x=="src"){w=e.convertURL(w,x)}z.attr("data-mce-p-"+x,w)}}s=t.firstChild&&t.firstChild.value;if(s){z.attr("data-mce-html",escape(s));z.firstChild=null}z.attr({width:t.attr("width")||"300",height:t.attr("height")||(q=="audio"?"30":"150"),style:t.attr("style"),src:tinymce.Env.transparentSrc,"data-mce-object":q,"class":"mce-object mce-object-"+q});t.replace(z)}});e.serializer.addAttributeFilter("data-mce-object",function(r,q){var u=r.length,t,y,w,p,s,z,x;while(u--){t=r[u];if(!t.parent){continue}x=t.attr(q);y=new tinymce.html.Node(x,1);if(x!="audio"&&x!="script"){y.attr({width:t.attr("width"),height:t.attr("height")})}y.attr({style:t.attr("style")});p=t.attributes;w=p.length;while(w--){var v=p[w].name;if(v.indexOf("data-mce-p-")===0){y.attr(v.substr(11),p[w].value)}}if(x=="script"){y.attr("type","text/javascript")}s=t.attr("data-mce-html");if(s){z=new tinymce.html.Node("#text",3);z.raw=true;z.value=c(unescape(s));y.append(z)}t.replace(y)}})});e.on("ObjectSelected",function(o){var n=o.target.getAttribute("data-mce-object");if(n=="audio"||n=="script"){o.preventDefault()}});e.on("objectResized",function(p){var o=p.target,n;if(o.getAttribute("data-mce-object")){n=o.getAttribute("data-mce-html");if(n){n=unescape(n);o.setAttribute("data-mce-html",escape(g(n,{width:p.width,height:p.height})))}}});e.addButton("media",{tooltip:"Insert/edit video",onclick:i,stateSelector:["img[data-mce-object=video]","img[data-mce-object=iframe]"]});e.addMenuItem("media",{icon:"media",text:"Insert/edit video",onclick:i,context:"insert",prependToContext:true})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/nonbreaking/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,53 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('nonbreaking', function(editor) {
+	var setting = editor.getParam('nonbreaking_force_tab');
+
+	editor.addCommand('mceNonBreaking', function() {
+		editor.insertContent(
+			(editor.plugins.visualchars && editor.plugins.visualchars.state) ?
+			'<span class="mce-nbsp">&nbsp;</span>' : '&nbsp;'
+		);
+
+		editor.dom.setAttrib(editor.dom.select('span.mce-nbsp'), 'data-mce-bogus', '1');
+	});
+
+	editor.addButton('nonbreaking', {
+		title: 'Nonbreaking space',
+		cmd: 'mceNonBreaking'
+	});
+
+	editor.addMenuItem('nonbreaking', {
+		text: 'Nonbreaking space',
+		cmd: 'mceNonBreaking',
+		context: 'insert'
+	});
+
+	if (setting) {
+		var spaces = +setting > 1 ? +setting : 3;  // defaults to 3 spaces if setting is true (or 1)
+
+		editor.on('keydown', function(e) {
+			if (e.keyCode == 9) {
+
+				if (e.shiftKey) {
+					return;
+				}
+
+				e.preventDefault();
+				for (var i = 0; i < spaces; i++) {
+					editor.execCommand('mceNonBreaking');
+				}
+			}
+		});
+	}
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/nonbreaking/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("nonbreaking",function(c){var b=c.getParam("nonbreaking_force_tab");c.addCommand("mceNonBreaking",function(){c.insertContent((c.plugins.visualchars&&c.plugins.visualchars.state)?'<span class="mce-nbsp">&nbsp;</span>':"&nbsp;");c.dom.setAttrib(c.dom.select("span.mce-nbsp"),"data-mce-bogus","1")});c.addButton("nonbreaking",{title:"Nonbreaking space",cmd:"mceNonBreaking"});c.addMenuItem("nonbreaking",{text:"Nonbreaking space",cmd:"mceNonBreaking",context:"insert"});if(b){var a=+b>1?+b:3;c.on("keydown",function(f){if(f.keyCode==9){if(f.shiftKey){return}f.preventDefault();for(var d=0;d<a;d++){c.execCommand("mceNonBreaking")}}})}});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/noneditable/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,614 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*jshint loopfunc:true */
+/*eslint no-loop-func:0 */
+/*global tinymce:true */
+
+tinymce.PluginManager.add('noneditable', function(editor) {
+	var TreeWalker = tinymce.dom.TreeWalker;
+	var externalName = 'contenteditable', internalName = 'data-mce-' + externalName;
+	var VK = tinymce.util.VK;
+
+	// Returns the content editable state of a node "true/false" or null
+	function getContentEditable(node) {
+		var contentEditable;
+
+		// Ignore non elements
+		if (node.nodeType === 1) {
+			// Check for fake content editable
+			contentEditable = node.getAttribute(internalName);
+			if (contentEditable && contentEditable !== "inherit") {
+				return contentEditable;
+			}
+
+			// Check for real content editable
+			contentEditable = node.contentEditable;
+			if (contentEditable !== "inherit") {
+				return contentEditable;
+			}
+		}
+
+		return null;
+	}
+
+	// Returns the noneditable parent or null if there is a editable before it or if it wasn't found
+	function getNonEditableParent(node) {
+		var state;
+
+		while (node) {
+			state = getContentEditable(node);
+			if (state) {
+				return state === "false" ? node : null;
+			}
+
+			node = node.parentNode;
+		}
+	}
+
+	function handleContentEditableSelection() {
+		var dom = editor.dom, selection = editor.selection, caretContainerId = 'mce_noneditablecaret', invisibleChar = '\uFEFF';
+
+		// Get caret container parent for the specified node
+		function getParentCaretContainer(node) {
+			while (node) {
+				if (node.id === caretContainerId) {
+					return node;
+				}
+
+				node = node.parentNode;
+			}
+		}
+
+		// Finds the first text node in the specified node
+		function findFirstTextNode(node) {
+			var walker;
+
+			if (node) {
+				walker = new TreeWalker(node, node);
+
+				for (node = walker.current(); node; node = walker.next()) {
+					if (node.nodeType === 3) {
+						return node;
+					}
+				}
+			}
+		}
+
+		// Insert caret container before/after target or expand selection to include block
+		function insertCaretContainerOrExpandToBlock(target, before) {
+			var caretContainer, rng;
+
+			// Select block
+			if (getContentEditable(target) === "false") {
+				if (dom.isBlock(target)) {
+					selection.select(target);
+					return;
+				}
+			}
+
+			rng = dom.createRng();
+
+			if (getContentEditable(target) === "true") {
+				if (!target.firstChild) {
+					target.appendChild(editor.getDoc().createTextNode('\u00a0'));
+				}
+
+				target = target.firstChild;
+				before = true;
+			}
+
+			/*
+			caretContainer = dom.create('span', {
+				id: caretContainerId,
+				'data-mce-bogus': true,
+				style:'border: 1px solid red'
+			}, invisibleChar);
+			*/
+
+			caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true}, invisibleChar);
+
+			if (before) {
+				target.parentNode.insertBefore(caretContainer, target);
+			} else {
+				dom.insertAfter(caretContainer, target);
+			}
+
+			rng.setStart(caretContainer.firstChild, 1);
+			rng.collapse(true);
+			selection.setRng(rng);
+
+			return caretContainer;
+		}
+
+		// Removes any caret container
+		function removeCaretContainer(caretContainer) {
+			var rng, child, lastContainer;
+
+			if (caretContainer) {
+				rng = selection.getRng(true);
+				rng.setStartBefore(caretContainer);
+				rng.setEndBefore(caretContainer);
+
+				child = findFirstTextNode(caretContainer);
+				if (child && child.nodeValue.charAt(0) == invisibleChar) {
+					child = child.deleteData(0, 1);
+				}
+
+				dom.remove(caretContainer, true);
+
+				selection.setRng(rng);
+			} else {
+				while ((caretContainer = dom.get(caretContainerId)) && caretContainer !== lastContainer) {
+					child = findFirstTextNode(caretContainer);
+					if (child && child.nodeValue.charAt(0) == invisibleChar) {
+						child = child.deleteData(0, 1);
+					}
+
+					dom.remove(caretContainer, true);
+
+					lastContainer = caretContainer;
+				}
+			}
+		}
+
+		// Modifies the selection to include contentEditable false elements or insert caret containers
+		function moveSelection() {
+			var nonEditableStart, nonEditableEnd, isCollapsed, rng, element;
+
+			// Checks if there is any contents to the left/right side of caret returns the noneditable element or
+			// any editable element if it finds one inside
+			function hasSideContent(element, left) {
+				var container, offset, walker, node, len;
+
+				container = rng.startContainer;
+				offset = rng.startOffset;
+
+				// If endpoint is in middle of text node then expand to beginning/end of element
+				if (container.nodeType == 3) {
+					len = container.nodeValue.length;
+					if ((offset > 0 && offset < len) || (left ? offset == len : offset === 0)) {
+						return;
+					}
+				} else {
+					// Can we resolve the node by index
+					if (offset < container.childNodes.length) {
+						// Browser represents caret position as the offset at the start of an element. When moving right
+						// this is the element we are moving into so we consider our container to be child node at offset-1
+						var pos = !left && offset > 0 ? offset - 1 : offset;
+						container = container.childNodes[pos];
+						if (container.hasChildNodes()) {
+							container = container.firstChild;
+						}
+					} else {
+						// If not then the caret is at the last position in it's container and the caret container
+						// should be inserted after the noneditable element
+						return !left ? element : null;
+					}
+				}
+
+				// Walk left/right to look for contents
+				walker = new TreeWalker(container, element);
+				while ((node = walker[left ? 'prev' : 'next']())) {
+					if (node.nodeType === 3 && node.nodeValue.length > 0) {
+						return;
+					} else if (getContentEditable(node) === "true") {
+						// Found contentEditable=true element return this one to we can move the caret inside it
+						return node;
+					}
+				}
+
+				return element;
+			}
+
+			// Remove any existing caret containers
+			removeCaretContainer();
+
+			// Get noneditable start/end elements
+			isCollapsed = selection.isCollapsed();
+			nonEditableStart = getNonEditableParent(selection.getStart());
+			nonEditableEnd = getNonEditableParent(selection.getEnd());
+
+			// Is any fo the range endpoints noneditable
+			if (nonEditableStart || nonEditableEnd) {
+				rng = selection.getRng(true);
+
+				// If it's a caret selection then look left/right to see if we need to move the caret out side or expand
+				if (isCollapsed) {
+					nonEditableStart = nonEditableStart || nonEditableEnd;
+
+					if ((element = hasSideContent(nonEditableStart, true))) {
+						// We have no contents to the left of the caret then insert a caret container before the noneditable element
+						insertCaretContainerOrExpandToBlock(element, true);
+					} else if ((element = hasSideContent(nonEditableStart, false))) {
+						// We have no contents to the right of the caret then insert a caret container after the noneditable element
+						insertCaretContainerOrExpandToBlock(element, false);
+					} else {
+						// We are in the middle of a noneditable so expand to select it
+						selection.select(nonEditableStart);
+					}
+				} else {
+					rng = selection.getRng(true);
+
+					// Expand selection to include start non editable element
+					if (nonEditableStart) {
+						rng.setStartBefore(nonEditableStart);
+					}
+
+					// Expand selection to include end non editable element
+					if (nonEditableEnd) {
+						rng.setEndAfter(nonEditableEnd);
+					}
+
+					selection.setRng(rng);
+				}
+			}
+		}
+
+		function handleKey(e) {
+			var keyCode = e.keyCode, nonEditableParent, caretContainer, startElement, endElement;
+
+			function getNonEmptyTextNodeSibling(node, prev) {
+				while ((node = node[prev ? 'previousSibling' : 'nextSibling'])) {
+					if (node.nodeType !== 3 || node.nodeValue.length > 0) {
+						return node;
+					}
+				}
+			}
+
+			function positionCaretOnElement(element, start) {
+				selection.select(element);
+				selection.collapse(start);
+			}
+
+			function canDelete(backspace) {
+				var rng, container, offset, nonEditableParent;
+
+				function removeNodeIfNotParent(node) {
+					var parent = container;
+
+					while (parent) {
+						if (parent === node) {
+							return;
+						}
+
+						parent = parent.parentNode;
+					}
+
+					dom.remove(node);
+					moveSelection();
+				}
+
+				function isNextPrevTreeNodeNonEditable() {
+					var node, walker, nonEmptyElements = editor.schema.getNonEmptyElements();
+
+					walker = new tinymce.dom.TreeWalker(container, editor.getBody());
+					while ((node = (backspace ? walker.prev() : walker.next()))) {
+						// Found IMG/INPUT etc
+						if (nonEmptyElements[node.nodeName.toLowerCase()]) {
+							break;
+						}
+
+						// Found text node with contents
+						if (node.nodeType === 3 && tinymce.trim(node.nodeValue).length > 0) {
+							break;
+						}
+
+						// Found non editable node
+						if (getContentEditable(node) === "false") {
+							removeNodeIfNotParent(node);
+							return true;
+						}
+					}
+
+					// Check if the content node is within a non editable parent
+					if (getNonEditableParent(node)) {
+						return true;
+					}
+
+					return false;
+				}
+
+				if (selection.isCollapsed()) {
+					rng = selection.getRng(true);
+					container = rng.startContainer;
+					offset = rng.startOffset;
+					container = getParentCaretContainer(container) || container;
+
+					// Is in noneditable parent
+					if ((nonEditableParent = getNonEditableParent(container))) {
+						removeNodeIfNotParent(nonEditableParent);
+						return false;
+					}
+
+					// Check if the caret is in the middle of a text node
+					if (container.nodeType == 3 && (backspace ? offset > 0 : offset < container.nodeValue.length)) {
+						return true;
+					}
+
+					// Resolve container index
+					if (container.nodeType == 1) {
+						container = container.childNodes[offset] || container;
+					}
+
+					// Check if previous or next tree node is non editable then block the event
+					if (isNextPrevTreeNodeNonEditable()) {
+						return false;
+					}
+				}
+
+				return true;
+			}
+
+			moveSelection();
+
+			startElement = selection.getStart();
+			endElement = selection.getEnd();
+
+			// Disable all key presses in contentEditable=false except delete or backspace
+			nonEditableParent = getNonEditableParent(startElement) || getNonEditableParent(endElement);
+			var currentNode = editor.selection.getNode();
+
+			var isDirectionKey = keyCode == VK.LEFT || keyCode == VK.RIGHT || keyCode == VK.UP || keyCode == VK.DOWN;
+			var left = keyCode == VK.LEFT || keyCode == VK.UP;
+
+			if (nonEditableParent && (keyCode < 112 || keyCode > 124) && keyCode != VK.DELETE && keyCode != VK.BACKSPACE) {
+
+				// Is Ctrl+c, Ctrl+v or Ctrl+x then use default browser behavior
+				if ((tinymce.isMac ? e.metaKey : e.ctrlKey) && (keyCode == 67 || keyCode == 88 || keyCode == 86)) {
+					return;
+				}
+
+				e.preventDefault();
+
+				// Arrow left/right select the element and collapse left/right
+				if (isDirectionKey) {
+
+					// If a block element find previous or next element to position the caret
+					if (editor.dom.isBlock(nonEditableParent)) {
+						var targetElement = left ? nonEditableParent.previousSibling : nonEditableParent.nextSibling;
+
+						// Handling for edge-cases:
+						// 	- two nonEditables in a row -> no way to get between them
+						// 	- nonEditable as the first/last element -> no way to get before/behind it
+						if (!targetElement || targetElement && getContentEditable(targetElement) === 'false') {
+							var p = dom.create('p', null, '&nbsp;');
+							p.className = 'mceTmpParagraph';
+
+							var insertElement = left ? nonEditableParent : targetElement;
+
+							if (insertElement && insertElement.parentNode) {
+								insertElement.parentNode.insertBefore(p, insertElement);
+							} else if (!targetElement && !left) {
+								nonEditableParent.parentNode.appendChild(p);
+							}
+
+							targetElement = p;
+						}
+
+						var walker = new TreeWalker(targetElement, targetElement);
+						var caretElement = left ? walker.prev() : walker.next();
+
+						positionCaretOnElement(caretElement, !left);
+					} else {
+						positionCaretOnElement(nonEditableParent, left);
+					}
+				}
+			} else {
+				// Is arrow left/right, backspace or delete
+				if (isDirectionKey || keyCode == VK.BACKSPACE || keyCode == VK.DELETE) {
+					caretContainer = getParentCaretContainer(startElement);
+
+					if (caretContainer) {
+						// Arrow left or backspace
+						if (keyCode == VK.LEFT || keyCode == VK.BACKSPACE) {
+							nonEditableParent = getNonEmptyTextNodeSibling(caretContainer, true);
+
+							if (nonEditableParent && getContentEditable(nonEditableParent) === "false") {
+								e.preventDefault();
+
+								if (keyCode == VK.LEFT) {
+									positionCaretOnElement(nonEditableParent, true);
+								} else {
+									dom.remove(nonEditableParent);
+									return;
+								}
+							} else {
+								removeCaretContainer(caretContainer);
+							}
+						}
+
+						// Arrow right or delete
+						if (keyCode == VK.RIGHT || keyCode == VK.DELETE) {
+							nonEditableParent = getNonEmptyTextNodeSibling(caretContainer, true);
+
+							if (nonEditableParent && getContentEditable(nonEditableParent) === "false") {
+								e.preventDefault();
+
+								if (keyCode == VK.RIGHT) {
+									positionCaretOnElement(nonEditableParent, false);
+								} else {
+									dom.remove(nonEditableParent);
+									return;
+								}
+							} else {
+								removeCaretContainer(caretContainer);
+							}
+						}
+					} else {
+
+						if (isDirectionKey) {
+							// Removal of separator paragraphs between two nonEditables
+							// and before/after a nonEditable as the first/last element
+							if (currentNode && currentNode.className.indexOf('mceTmpParagraph') !== -1 &&
+									currentNode[left ? 'previousSibling' : 'nextSibling']) {
+								var jumpTarget = currentNode[left ? 'previousSibling' : 'nextSibling'];
+
+								// current node is still empty and a separator -> remove it
+								// else: remove the separator class, as it now includes content
+								if (currentNode.innerHTML === '&nbsp;' || currentNode.innerHTML === '' || currentNode.innerHTML === ' ') {
+									dom.remove(currentNode);
+								} else {
+									currentNode.className = currentNode.className.replace('mceTmpParagraph', '');
+								}
+
+								positionCaretOnElement(jumpTarget, !left);
+							}
+						}
+
+						var rng = selection.getRng(true);
+						var container = rng.endContainer;
+
+						// FIX: If end of node is selected, check wether next sibling is nonEditable to correctly remove it
+						// 			(else would break for more complex nonEditables, their content would get moved to the current node)
+						if (dom.isBlock(container) && dom.isBlock(container.nextSibling) && rng.endOffset == 1 && keyCode == VK.DELETE) {
+							nonEditableParent = getNonEditableParent(container.nextSibling);
+						}
+
+						// correctly remove block-level nonEditable domNode on delete/backspace
+						if (nonEditableParent && (keyCode == VK.DELETE || keyCode == VK.BACKSPACE) && dom.isBlock(nonEditableParent)) {
+							e.preventDefault();
+							dom.remove(nonEditableParent);
+							return;
+						}
+					}
+
+					if ((keyCode == VK.BACKSPACE || keyCode == VK.DELETE) && !canDelete(keyCode == VK.BACKSPACE)) {
+						e.preventDefault();
+						return false;
+					}
+				}
+			}
+		}
+
+		editor.on('mousedown', function(e) {
+			var node = editor.selection.getNode();
+
+			// Also remove separator lines when clicking on another node
+			if (node && node.className.indexOf('mceTmpParagraph') !== -1 && node !== e.target) {
+				// current node is still empty and a separator -> remove it
+				// else: remove the separator class, as it now includes content
+				if (node.innerHTML === '&nbsp;' || node.innerHTML === '' || node.innerHTML === ' ') {
+					dom.remove(node);
+				} else {
+					node.className = node.className.replace('mceTmpParagraph', '');
+				}
+			}
+
+			if (getContentEditable(node) === "false" && node == e.target) {
+				// Expand selection on mouse down we can't block the default event since it's used for drag/drop
+				moveSelection();
+			}
+		});
+
+		editor.on('mouseup', moveSelection);
+
+		editor.on('keydown', handleKey);
+	}
+
+	var editClass, nonEditClass, nonEditableRegExps;
+
+	// Converts configured regexps to noneditable span items
+	function convertRegExpsToNonEditable(e) {
+		var i = nonEditableRegExps.length, content = e.content, cls = tinymce.trim(nonEditClass);
+
+		// Don't replace the variables when raw is used for example on undo/redo
+		if (e.format == "raw") {
+			return;
+		}
+
+		while (i--) {
+			content = content.replace(nonEditableRegExps[i], function(match) {
+				var args = arguments, index = args[args.length - 2];
+
+				// Is value inside an attribute then don't replace
+				if (index > 0 && content.charAt(index - 1) == '"') {
+					return match;
+				}
+
+				return (
+					'<span class="' + cls + '" data-mce-content="' + editor.dom.encode(args[0]) + '">' +
+					editor.dom.encode(typeof args[1] === "string" ? args[1] : args[0]) + '</span>'
+				);
+			});
+		}
+
+		e.content = content;
+	}
+
+	editClass = " " + tinymce.trim(editor.getParam("noneditable_editable_class", "mceEditable")) + " ";
+	nonEditClass = " " + tinymce.trim(editor.getParam("noneditable_noneditable_class", "mceNonEditable")) + " ";
+
+	// Setup noneditable regexps array
+	nonEditableRegExps = editor.getParam("noneditable_regexp");
+	if (nonEditableRegExps && !nonEditableRegExps.length) {
+		nonEditableRegExps = [nonEditableRegExps];
+	}
+
+	editor.on('PreInit', function() {
+		handleContentEditableSelection();
+
+		if (nonEditableRegExps) {
+			editor.on('BeforeSetContent', convertRegExpsToNonEditable);
+		}
+
+		// Apply contentEditable true/false on elements with the noneditable/editable classes
+		editor.parser.addAttributeFilter('class', function(nodes) {
+			var i = nodes.length, className, node;
+
+			while (i--) {
+				node = nodes[i];
+				className = " " + node.attr("class") + " ";
+
+				if (className.indexOf(editClass) !== -1) {
+					node.attr(internalName, "true");
+				} else if (className.indexOf(nonEditClass) !== -1) {
+					node.attr(internalName, "false");
+				}
+			}
+		});
+
+		// Remove internal name
+		editor.serializer.addAttributeFilter(internalName, function(nodes) {
+			var i = nodes.length, node;
+
+			while (i--) {
+				node = nodes[i];
+
+				if (nonEditableRegExps && node.attr('data-mce-content')) {
+					node.name = "#text";
+					node.type = 3;
+					node.raw = true;
+					node.value = node.attr('data-mce-content');
+				} else {
+					node.attr(externalName, null);
+					node.attr(internalName, null);
+				}
+			}
+		});
+
+		// Convert external name into internal name
+		editor.parser.addAttributeFilter(externalName, function(nodes) {
+			var i = nodes.length, node;
+
+			while (i--) {
+				node = nodes[i];
+				node.attr(internalName, node.attr(externalName));
+				node.attr(externalName, null);
+			}
+		});
+	});
+
+	editor.on('drop', function(e) {
+		if (getNonEditableParent(e.target)) {
+			e.preventDefault();
+		}
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/noneditable/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("noneditable",function(g){var i=tinymce.dom.TreeWalker;var d="contenteditable",c="data-mce-"+d;var j=tinymce.util.VK;function f(n){var m;if(n.nodeType===1){m=n.getAttribute(c);if(m&&m!=="inherit"){return m}m=n.contentEditable;if(m!=="inherit"){return m}}return null}function a(m){var n;while(m){n=f(m);if(n){return n==="false"?m:null}m=m.parentNode}}function h(){var p=g.dom,t=g.selection,s="mce_noneditablecaret",v="\uFEFF";function r(w){while(w){if(w.id===s){return w}w=w.parentNode}}function q(w){var x;if(w){x=new i(w,w);for(w=x.current();w;w=x.next()){if(w.nodeType===3){return w}}}}function m(z,y){var w,x;if(f(z)==="false"){if(p.isBlock(z)){t.select(z);return}}x=p.createRng();if(f(z)==="true"){if(!z.firstChild){z.appendChild(g.getDoc().createTextNode("\u00a0"))}z=z.firstChild;y=true}w=p.create("span",{id:s,"data-mce-bogus":true},v);if(y){z.parentNode.insertBefore(w,z)}else{p.insertAfter(w,z)}x.setStart(w.firstChild,1);x.collapse(true);t.setRng(x);return w}function o(w){var x,z,y;if(w){x=t.getRng(true);x.setStartBefore(w);x.setEndBefore(w);z=q(w);if(z&&z.nodeValue.charAt(0)==v){z=z.deleteData(0,1)}p.remove(w,true);t.setRng(x)}else{while((w=p.get(s))&&w!==y){z=q(w);if(z&&z.nodeValue.charAt(0)==v){z=z.deleteData(0,1)}p.remove(w,true);y=w}}}function u(){var w,A,y,x,z;function B(E,G){var D,I,H,F,C;D=x.startContainer;I=x.startOffset;if(D.nodeType==3){C=D.nodeValue.length;if((I>0&&I<C)||(G?I==C:I===0)){return}}else{if(I<D.childNodes.length){var J=!G&&I>0?I-1:I;D=D.childNodes[J];if(D.hasChildNodes()){D=D.firstChild}}else{return !G?E:null}}H=new i(D,E);while((F=H[G?"prev":"next"]())){if(F.nodeType===3&&F.nodeValue.length>0){return}else{if(f(F)==="true"){return F}}}return E}o();y=t.isCollapsed();w=a(t.getStart());A=a(t.getEnd());if(w||A){x=t.getRng(true);if(y){w=w||A;if((z=B(w,true))){m(z,true)}else{if((z=B(w,false))){m(z,false)}else{t.select(w)}}}else{x=t.getRng(true);if(w){x.setStartBefore(w)}if(A){x.setEndAfter(A)}t.setRng(x)}}}function n(O){var D=O.keyCode,P,F,w,C;function x(R,Q){while((R=R[Q?"previousSibling":"nextSibling"])){if(R.nodeType!==3||R.nodeValue.length>0){return R}}}function G(Q,R){t.select(Q);t.collapse(R)}function L(U){var T,S,W,R;function Q(Y){var X=S;while(X){if(X===Y){return}X=X.parentNode}p.remove(Y);u()}function V(){var Y,Z,X=g.schema.getNonEmptyElements();Z=new tinymce.dom.TreeWalker(S,g.getBody());while((Y=(U?Z.prev():Z.next()))){if(X[Y.nodeName.toLowerCase()]){break}if(Y.nodeType===3&&tinymce.trim(Y.nodeValue).length>0){break}if(f(Y)==="false"){Q(Y);return true}}if(a(Y)){return true}return false}if(t.isCollapsed()){T=t.getRng(true);S=T.startContainer;W=T.startOffset;S=r(S)||S;if((R=a(S))){Q(R);return false}if(S.nodeType==3&&(U?W>0:W<S.nodeValue.length)){return true}if(S.nodeType==1){S=S.childNodes[W]||S}if(V()){return false}}return true}u();w=t.getStart();C=t.getEnd();P=a(w)||a(C);var y=g.selection.getNode();var N=D==j.LEFT||D==j.RIGHT||D==j.UP||D==j.DOWN;var z=D==j.LEFT||D==j.UP;if(P&&(D<112||D>124)&&D!=j.DELETE&&D!=j.BACKSPACE){if((tinymce.isMac?O.metaKey:O.ctrlKey)&&(D==67||D==88||D==86)){return}O.preventDefault();if(N){if(g.dom.isBlock(P)){var E=z?P.previousSibling:P.nextSibling;if(!E||E&&f(E)==="false"){var J=p.create("p",null,"&nbsp;");J.className="mceTmpParagraph";var B=z?P:E;if(B&&B.parentNode){B.parentNode.insertBefore(J,B)}else{if(!E&&!z){P.parentNode.appendChild(J)}}E=J}var K=new i(E,E);var I=z?K.prev():K.next();G(I,!z)}else{G(P,z)}}}else{if(N||D==j.BACKSPACE||D==j.DELETE){F=r(w);if(F){if(D==j.LEFT||D==j.BACKSPACE){P=x(F,true);if(P&&f(P)==="false"){O.preventDefault();if(D==j.LEFT){G(P,true)}else{p.remove(P);return}}else{o(F)}}if(D==j.RIGHT||D==j.DELETE){P=x(F,true);if(P&&f(P)==="false"){O.preventDefault();if(D==j.RIGHT){G(P,false)}else{p.remove(P);return}}else{o(F)}}}else{if(N){if(y&&y.className.indexOf("mceTmpParagraph")!==-1&&y[z?"previousSibling":"nextSibling"]){var M=y[z?"previousSibling":"nextSibling"];if(y.innerHTML==="&nbsp;"||y.innerHTML===""||y.innerHTML===" "){p.remove(y)}else{y.className=y.className.replace("mceTmpParagraph","")}G(M,!z)}}var A=t.getRng(true);var H=A.endContainer;if(p.isBlock(H)&&p.isBlock(H.nextSibling)&&A.endOffset==1&&D==j.DELETE){P=a(H.nextSibling)}if(P&&(D==j.DELETE||D==j.BACKSPACE)&&p.isBlock(P)){O.preventDefault();p.remove(P);return}}if((D==j.BACKSPACE||D==j.DELETE)&&!L(D==j.BACKSPACE)){O.preventDefault();return false}}}}g.on("mousedown",function(x){var w=g.selection.getNode();if(w&&w.className.indexOf("mceTmpParagraph")!==-1&&w!==x.target){if(w.innerHTML==="&nbsp;"||w.innerHTML===""||w.innerHTML===" "){p.remove(w)}else{w.className=w.className.replace("mceTmpParagraph","")}}if(f(w)==="false"&&w==x.target){u()}});g.on("mouseup",u);g.on("keydown",n)}var e,l,b;function k(p){var n=b.length,o=p.content,m=tinymce.trim(l);if(p.format=="raw"){return}while(n--){o=o.replace(b[n],function(s){var r=arguments,q=r[r.length-2];if(q>0&&o.charAt(q-1)=='"'){return s}return('<span class="'+m+'" data-mce-content="'+g.dom.encode(r[0])+'">'+g.dom.encode(typeof r[1]==="string"?r[1]:r[0])+"</span>")})}p.content=o}e=" "+tinymce.trim(g.getParam("noneditable_editable_class","mceEditable"))+" ";l=" "+tinymce.trim(g.getParam("noneditable_noneditable_class","mceNonEditable"))+" ";b=g.getParam("noneditable_regexp");if(b&&!b.length){b=[b]}g.on("PreInit",function(){h();if(b){g.on("BeforeSetContent",k)}g.parser.addAttributeFilter("class",function(m){var n=m.length,o,p;while(n--){p=m[n];o=" "+p.attr("class")+" ";if(o.indexOf(e)!==-1){p.attr(c,"true")}else{if(o.indexOf(l)!==-1){p.attr(c,"false")}}}});g.serializer.addAttributeFilter(c,function(m){var n=m.length,o;while(n--){o=m[n];if(b&&o.attr("data-mce-content")){o.name="#text";o.type=3;o.raw=true;o.value=o.attr("data-mce-content")}else{o.attr(d,null);o.attr(c,null)}}});g.parser.addAttributeFilter(d,function(m){var n=m.length,o;while(n--){o=m[n];o.attr(c,o.attr(d));o.attr(d,null)}})});g.on("drop",function(m){if(a(m.target)){m.preventDefault()}})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/pagebreak/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,88 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('pagebreak', function(editor) {
+	var pageBreakClass = 'mce-pagebreak', separatorHtml = editor.getParam('pagebreak_separator', '<!-- pagebreak -->');
+
+	var pageBreakSeparatorRegExp = new RegExp(separatorHtml.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) {
+		return '\\' + a;
+	}), 'gi');
+
+	var pageBreakPlaceHolderHtml = '<img src="' + tinymce.Env.transparentSrc + '" class="' +
+		pageBreakClass + '" data-mce-resize="false" />';
+
+	// Register commands
+	editor.addCommand('mcePageBreak', function() {
+		if (editor.settings.pagebreak_split_block) {
+			editor.insertContent('<p>' + pageBreakPlaceHolderHtml + '</p>');
+		} else {
+			editor.insertContent(pageBreakPlaceHolderHtml);
+		}
+	});
+
+	// Register buttons
+	editor.addButton('pagebreak', {
+		title: 'Page break',
+		cmd: 'mcePageBreak'
+	});
+
+	editor.addMenuItem('pagebreak', {
+		text: 'Page break',
+		icon: 'pagebreak',
+		cmd: 'mcePageBreak',
+		context: 'insert'
+	});
+
+	editor.on('ResolveName', function(e) {
+		if (e.target.nodeName == 'IMG' && editor.dom.hasClass(e.target, pageBreakClass)) {
+			e.name = 'pagebreak';
+		}
+	});
+
+	editor.on('click', function(e) {
+		e = e.target;
+
+		if (e.nodeName === 'IMG' && editor.dom.hasClass(e, pageBreakClass)) {
+			editor.selection.select(e);
+		}
+	});
+
+	editor.on('BeforeSetContent', function(e) {
+		e.content = e.content.replace(pageBreakSeparatorRegExp, pageBreakPlaceHolderHtml);
+	});
+
+	editor.on('PreInit', function() {
+		editor.serializer.addNodeFilter('img', function(nodes) {
+			var i = nodes.length, node, className;
+
+			while (i--) {
+				node = nodes[i];
+				className = node.attr('class');
+				if (className && className.indexOf('mce-pagebreak') !== -1) {
+					// Replace parent block node if pagebreak_split_block is enabled
+					var parentNode = node.parent;
+					if (editor.schema.getBlockElements()[parentNode.name] && editor.settings.pagebreak_split_block) {
+						parentNode.type = 3;
+						parentNode.value = separatorHtml;
+						parentNode.raw = true;
+						node.remove();
+						continue;
+					}
+
+					node.type = 3;
+					node.value = separatorHtml;
+					node.raw = true;
+				}
+			}
+		});
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/pagebreak/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("pagebreak",function(c){var d="mce-pagebreak",a=c.getParam("pagebreak_separator","<!-- pagebreak -->");var e=new RegExp(a.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(f){return"\\"+f}),"gi");var b='<img src="'+tinymce.Env.transparentSrc+'" class="'+d+'" data-mce-resize="false" />';c.addCommand("mcePageBreak",function(){if(c.settings.pagebreak_split_block){c.insertContent("<p>"+b+"</p>")}else{c.insertContent(b)}});c.addButton("pagebreak",{title:"Page break",cmd:"mcePageBreak"});c.addMenuItem("pagebreak",{text:"Page break",icon:"pagebreak",cmd:"mcePageBreak",context:"insert"});c.on("ResolveName",function(f){if(f.target.nodeName=="IMG"&&c.dom.hasClass(f.target,d)){f.name="pagebreak"}});c.on("click",function(f){f=f.target;if(f.nodeName==="IMG"&&c.dom.hasClass(f,d)){c.selection.select(f)}});c.on("BeforeSetContent",function(f){f.content=f.content.replace(e,b)});c.on("PreInit",function(){c.serializer.addNodeFilter("img",function(g){var h=g.length,k,j;while(h--){k=g[h];j=k.attr("class");if(j&&j.indexOf("mce-pagebreak")!==-1){var f=k.parent;if(c.schema.getBlockElements()[f.name]&&c.settings.pagebreak_split_block){f.type=3;f.value=a;f.raw=true;k.remove();continue}k.type=3;k.value=a;k.raw=true}}})})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/paste/classes/Clipboard.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,611 @@
+/**
+ * Clipboard.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class contains logic for getting HTML contents out of the clipboard.
+ *
+ * We need to make a lot of ugly hacks to get the contents out of the clipboard since
+ * the W3C Clipboard API is broken in all browsers that have it: Gecko/WebKit/Blink.
+ * We might rewrite this the way those API:s stabilize. Browsers doesn't handle pasting
+ * from applications like Word the same way as it does when pasting into a contentEditable area
+ * so we need to do lots of extra work to try to get to this clipboard data.
+ *
+ * Current implementation steps:
+ *  1. On keydown with paste keys Ctrl+V or Shift+Insert create
+ *     a paste bin element and move focus to that element.
+ *  2. Wait for the browser to fire a "paste" event and get the contents out of the paste bin.
+ *  3. Check if the paste was successful if true, process the HTML.
+ *  (4). If the paste was unsuccessful use IE execCommand, Clipboard API, document.dataTransfer old WebKit API etc.
+ *
+ * @class tinymce.pasteplugin.Clipboard
+ * @private
+ */
+define("tinymce/pasteplugin/Clipboard", [
+	"tinymce/Env",
+	"tinymce/dom/RangeUtils",
+	"tinymce/util/VK",
+	"tinymce/pasteplugin/Utils"
+], function(Env, RangeUtils, VK, Utils) {
+	return function(editor) {
+		var self = this, pasteBinElm, lastRng, keyboardPasteTimeStamp = 0, draggingInternally = false;
+		var pasteBinDefaultContent = '%MCEPASTEBIN%', keyboardPastePlainTextState;
+		var mceInternalUrlPrefix = 'data:text/mce-internal,';
+
+		/**
+		 * Pastes the specified HTML. This means that the HTML is filtered and then
+		 * inserted at the current selection in the editor. It will also fire paste events
+		 * for custom user filtering.
+		 *
+		 * @param {String} html HTML code to paste into the current selection.
+		 */
+		function pasteHtml(html) {
+			var args, dom = editor.dom;
+
+			args = editor.fire('BeforePastePreProcess', {content: html}); // Internal event used by Quirks
+			args = editor.fire('PastePreProcess', args);
+			html = args.content;
+
+			if (!args.isDefaultPrevented()) {
+				// User has bound PastePostProcess events then we need to pass it through a DOM node
+				// This is not ideal but we don't want to let the browser mess up the HTML for example
+				// some browsers add &nbsp; to P tags etc
+				if (editor.hasEventListeners('PastePostProcess') && !args.isDefaultPrevented()) {
+					// We need to attach the element to the DOM so Sizzle selectors work on the contents
+					var tempBody = dom.add(editor.getBody(), 'div', {style: 'display:none'}, html);
+					args = editor.fire('PastePostProcess', {node: tempBody});
+					dom.remove(tempBody);
+					html = args.node.innerHTML;
+				}
+
+				if (!args.isDefaultPrevented()) {
+					editor.insertContent(html, {merge: editor.settings.paste_merge_formats !== false});
+				}
+			}
+		}
+
+		/**
+		 * Pastes the specified text. This means that the plain text is processed
+		 * and converted into BR and P elements. It will fire paste events for custom filtering.
+		 *
+		 * @param {String} text Text to paste as the current selection location.
+		 */
+		function pasteText(text) {
+			text = editor.dom.encode(text).replace(/\r\n/g, '\n');
+
+			var startBlock = editor.dom.getParent(editor.selection.getStart(), editor.dom.isBlock);
+
+			// Create start block html for example <p attr="value">
+			var forcedRootBlockName = editor.settings.forced_root_block;
+			var forcedRootBlockStartHtml;
+			if (forcedRootBlockName) {
+				forcedRootBlockStartHtml = editor.dom.createHTML(forcedRootBlockName, editor.settings.forced_root_block_attrs);
+				forcedRootBlockStartHtml = forcedRootBlockStartHtml.substr(0, forcedRootBlockStartHtml.length - 3) + '>';
+			}
+
+			if ((startBlock && /^(PRE|DIV)$/.test(startBlock.nodeName)) || !forcedRootBlockName) {
+				text = Utils.filter(text, [
+					[/\n/g, "<br>"]
+				]);
+			} else {
+				text = Utils.filter(text, [
+					[/\n\n/g, "</p>" + forcedRootBlockStartHtml],
+					[/^(.*<\/p>)(<p>)$/, forcedRootBlockStartHtml + '$1'],
+					[/\n/g, "<br />"]
+				]);
+
+				if (text.indexOf('<p>') != -1) {
+					text = forcedRootBlockStartHtml + text;
+				}
+			}
+
+			pasteHtml(text);
+		}
+
+		/**
+		 * Creates a paste bin element as close as possible to the current caret location and places the focus inside that element
+		 * so that when the real paste event occurs the contents gets inserted into this element
+		 * instead of the current editor selection element.
+		 */
+		function createPasteBin() {
+			var dom = editor.dom, body = editor.getBody();
+			var viewport = editor.dom.getViewPort(editor.getWin()), scrollTop = viewport.y, top = 20;
+			var scrollContainer;
+
+			lastRng = editor.selection.getRng();
+
+			if (editor.inline) {
+				scrollContainer = editor.selection.getScrollContainer();
+
+				// Can't always rely on scrollTop returning a useful value.
+				// It returns 0 if the browser doesn't support scrollTop for the element or is non-scrollable
+				if (scrollContainer && scrollContainer.scrollTop > 0) {
+					scrollTop = scrollContainer.scrollTop;
+				}
+			}
+
+			/**
+			 * Returns the rect of the current caret if the caret is in an empty block before a
+			 * BR we insert a temporary invisible character that we get the rect this way we always get a proper rect.
+			 *
+			 * TODO: This might be useful in core.
+			 */
+			function getCaretRect(rng) {
+				var rects, textNode, node, container = rng.startContainer;
+
+				rects = rng.getClientRects();
+				if (rects.length) {
+					return rects[0];
+				}
+
+				if (!rng.collapsed || container.nodeType != 1) {
+					return;
+				}
+
+				node = container.childNodes[lastRng.startOffset];
+
+				// Skip empty whitespace nodes
+				while (node && node.nodeType == 3 && !node.data.length) {
+					node = node.nextSibling;
+				}
+
+				if (!node) {
+					return;
+				}
+
+				// Check if the location is |<br>
+				// TODO: Might need to expand this to say |<table>
+				if (node.tagName == 'BR') {
+					textNode = dom.doc.createTextNode('\uFEFF');
+					node.parentNode.insertBefore(textNode, node);
+
+					rng = dom.createRng();
+					rng.setStartBefore(textNode);
+					rng.setEndAfter(textNode);
+
+					rects = rng.getClientRects();
+					dom.remove(textNode);
+				}
+
+				if (rects.length) {
+					return rects[0];
+				}
+			}
+
+			// Calculate top cordinate this is needed to avoid scrolling to top of document
+			// We want the paste bin to be as close to the caret as possible to avoid scrolling
+			if (lastRng.getClientRects) {
+				var rect = getCaretRect(lastRng);
+
+				if (rect) {
+					// Client rects gets us closes to the actual
+					// caret location in for example a wrapped paragraph block
+					top = scrollTop + (rect.top - dom.getPos(body).y);
+				} else {
+					top = scrollTop;
+
+					// Check if we can find a closer location by checking the range element
+					var container = lastRng.startContainer;
+					if (container) {
+						if (container.nodeType == 3 && container.parentNode != body) {
+							container = container.parentNode;
+						}
+
+						if (container.nodeType == 1) {
+							top = dom.getPos(container, scrollContainer || body).y;
+						}
+					}
+				}
+			}
+
+			// Create a pastebin
+			pasteBinElm = dom.add(editor.getBody(), 'div', {
+				id: "mcepastebin",
+				contentEditable: true,
+				"data-mce-bogus": "all",
+				style: 'position: absolute; top: ' + top + 'px;' +
+					'width: 10px; height: 10px; overflow: hidden; opacity: 0'
+			}, pasteBinDefaultContent);
+
+			// Move paste bin out of sight since the controlSelection rect gets displayed otherwise on IE and Gecko
+			if (Env.ie || Env.gecko) {
+				dom.setStyle(pasteBinElm, 'left', dom.getStyle(body, 'direction', true) == 'rtl' ? 0xFFFF : -0xFFFF);
+			}
+
+			// Prevent focus events from bubbeling fixed FocusManager issues
+			dom.bind(pasteBinElm, 'beforedeactivate focusin focusout', function(e) {
+				e.stopPropagation();
+			});
+
+			pasteBinElm.focus();
+			editor.selection.select(pasteBinElm, true);
+		}
+
+		/**
+		 * Removes the paste bin if it exists.
+		 */
+		function removePasteBin() {
+			if (pasteBinElm) {
+				var pasteBinClone;
+
+				// WebKit/Blink might clone the div so
+				// lets make sure we remove all clones
+				// TODO: Man o man is this ugly. WebKit is the new IE! Remove this if they ever fix it!
+				while ((pasteBinClone = editor.dom.get('mcepastebin'))) {
+					editor.dom.remove(pasteBinClone);
+					editor.dom.unbind(pasteBinClone);
+				}
+
+				if (lastRng) {
+					editor.selection.setRng(lastRng);
+				}
+			}
+
+			pasteBinElm = lastRng = null;
+		}
+
+		/**
+		 * Returns the contents of the paste bin as a HTML string.
+		 *
+		 * @return {String} Get the contents of the paste bin.
+		 */
+		function getPasteBinHtml() {
+			var html = '', pasteBinClones, i, clone, cloneHtml;
+
+			// Since WebKit/Chrome might clone the paste bin when pasting
+			// for example: <img style="float: right"> we need to check if any of them contains some useful html.
+			// TODO: Man o man is this ugly. WebKit is the new IE! Remove this if they ever fix it!
+			pasteBinClones = editor.dom.select('div[id=mcepastebin]');
+			for (i = 0; i < pasteBinClones.length; i++) {
+				clone = pasteBinClones[i];
+
+				// Pasting plain text produces pastebins in pastebinds makes sence right!?
+				if (clone.firstChild && clone.firstChild.id == 'mcepastebin') {
+					clone = clone.firstChild;
+				}
+
+				cloneHtml = clone.innerHTML;
+				if (html != pasteBinDefaultContent) {
+					html += cloneHtml;
+				}
+			}
+
+			return html;
+		}
+
+		/**
+		 * Gets various content types out of a datatransfer object.
+		 *
+		 * @param {DataTransfer} dataTransfer Event fired on paste.
+		 * @return {Object} Object with mime types and data for those mime types.
+		 */
+		function getDataTransferItems(dataTransfer) {
+			var data = {};
+
+			if (dataTransfer) {
+				// Use old WebKit/IE API
+				if (dataTransfer.getData) {
+					var legacyText = dataTransfer.getData('Text');
+					if (legacyText && legacyText.length > 0) {
+						if (legacyText.indexOf(mceInternalUrlPrefix) == -1) {
+							data['text/plain'] = legacyText;
+						}
+					}
+				}
+
+				if (dataTransfer.types) {
+					for (var i = 0; i < dataTransfer.types.length; i++) {
+						var contentType = dataTransfer.types[i];
+						data[contentType] = dataTransfer.getData(contentType);
+					}
+				}
+			}
+
+			return data;
+		}
+
+		/**
+		 * Gets various content types out of the Clipboard API. It will also get the
+		 * plain text using older IE and WebKit API:s.
+		 *
+		 * @param {ClipboardEvent} clipboardEvent Event fired on paste.
+		 * @return {Object} Object with mime types and data for those mime types.
+		 */
+		function getClipboardContent(clipboardEvent) {
+			return getDataTransferItems(clipboardEvent.clipboardData || editor.getDoc().dataTransfer);
+		}
+
+		/**
+		 * Checks if the clipboard contains image data if it does it will take that data
+		 * and convert it into a data url image and paste that image at the caret location.
+		 *
+		 * @param  {ClipboardEvent} e Paste/drop event object.
+		 * @param  {DOMRange} rng Optional rng object to move selection to.
+		 * @return {Boolean} true/false if the image data was found or not.
+		 */
+		function pasteImageData(e, rng) {
+			var dataTransfer = e.clipboardData || e.dataTransfer;
+
+			function processItems(items) {
+				var i, item, reader, hadImage = false;
+
+				function pasteImage(reader) {
+					if (rng) {
+						editor.selection.setRng(rng);
+						rng = null;
+					}
+
+					pasteHtml('<img src="' + reader.result + '">');
+				}
+
+				if (items) {
+					for (i = 0; i < items.length; i++) {
+						item = items[i];
+
+						if (/^image\/(jpeg|png|gif|bmp)$/.test(item.type)) {
+							reader = new FileReader();
+							reader.onload = pasteImage.bind(null, reader);
+							reader.readAsDataURL(item.getAsFile ? item.getAsFile() : item);
+
+							e.preventDefault();
+							hadImage = true;
+						}
+					}
+				}
+
+				return hadImage;
+			}
+
+			if (editor.settings.paste_data_images && dataTransfer) {
+				return processItems(dataTransfer.items) || processItems(dataTransfer.files);
+			}
+		}
+
+		/**
+		 * Chrome on Android doesn't support proper clipboard access so we have no choice but to allow the browser default behavior.
+		 *
+		 * @param {Event} e Paste event object to check if it contains any data.
+		 * @return {Boolean} true/false if the clipboard is empty or not.
+		 */
+		function isBrokenAndroidClipboardEvent(e) {
+			var clipboardData = e.clipboardData;
+
+			return navigator.userAgent.indexOf('Android') != -1 && clipboardData && clipboardData.items && clipboardData.items.length === 0;
+		}
+
+		function getCaretRangeFromEvent(e) {
+			return RangeUtils.getCaretRangeFromPoint(e.clientX, e.clientY, editor.getDoc());
+		}
+
+		function hasContentType(clipboardContent, mimeType) {
+			return mimeType in clipboardContent && clipboardContent[mimeType].length > 0;
+		}
+
+		function isKeyboardPasteEvent(e) {
+			return (VK.metaKeyPressed(e) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45);
+		}
+
+		function registerEventHandlers() {
+			editor.on('keydown', function(e) {
+				function removePasteBinOnKeyUp(e) {
+					// Ctrl+V or Shift+Insert
+					if (isKeyboardPasteEvent(e) && !e.isDefaultPrevented()) {
+						removePasteBin();
+					}
+				}
+
+				// Ctrl+V or Shift+Insert
+				if (isKeyboardPasteEvent(e) && !e.isDefaultPrevented()) {
+					keyboardPastePlainTextState = e.shiftKey && e.keyCode == 86;
+
+					// Edge case on Safari on Mac where it doesn't handle Cmd+Shift+V correctly
+					// it fires the keydown but no paste or keyup so we are left with a paste bin
+					if (keyboardPastePlainTextState && Env.webkit && navigator.userAgent.indexOf('Version/') != -1) {
+						return;
+					}
+
+					// Prevent undoManager keydown handler from making an undo level with the pastebin in it
+					e.stopImmediatePropagation();
+
+					keyboardPasteTimeStamp = new Date().getTime();
+
+					// IE doesn't support Ctrl+Shift+V and it doesn't even produce a paste event
+					// so lets fake a paste event and let IE use the execCommand/dataTransfer methods
+					if (Env.ie && keyboardPastePlainTextState) {
+						e.preventDefault();
+						editor.fire('paste', {ieFake: true});
+						return;
+					}
+
+					removePasteBin();
+					createPasteBin();
+
+					// Remove pastebin if we get a keyup and no paste event
+					// For example pasting a file in IE 11 will not produce a paste event
+					editor.once('keyup', removePasteBinOnKeyUp);
+					editor.once('paste', function() {
+						editor.off('keyup', removePasteBinOnKeyUp);
+					});
+				}
+			});
+
+			editor.on('paste', function(e) {
+				// Getting content from the Clipboard can take some time
+				var clipboardTimer = new Date().getTime();
+				var clipboardContent = getClipboardContent(e);
+				var clipboardDelay = new Date().getTime() - clipboardTimer;
+
+				var isKeyBoardPaste = (new Date().getTime() - keyboardPasteTimeStamp - clipboardDelay) < 1000;
+				var plainTextMode = self.pasteFormat == "text" || keyboardPastePlainTextState;
+
+				keyboardPastePlainTextState = false;
+
+				if (e.isDefaultPrevented() || isBrokenAndroidClipboardEvent(e)) {
+					removePasteBin();
+					return;
+				}
+
+				if (pasteImageData(e)) {
+					removePasteBin();
+					return;
+				}
+
+				// Not a keyboard paste prevent default paste and try to grab the clipboard contents using different APIs
+				if (!isKeyBoardPaste) {
+					e.preventDefault();
+				}
+
+				// Try IE only method if paste isn't a keyboard paste
+				if (Env.ie && (!isKeyBoardPaste || e.ieFake)) {
+					createPasteBin();
+
+					editor.dom.bind(pasteBinElm, 'paste', function(e) {
+						e.stopPropagation();
+					});
+
+					editor.getDoc().execCommand('Paste', false, null);
+					clipboardContent["text/html"] = getPasteBinHtml();
+				}
+
+				setTimeout(function() {
+					var content;
+
+					// Grab HTML from Clipboard API or paste bin as a fallback
+					if (hasContentType(clipboardContent, 'text/html')) {
+						content = clipboardContent['text/html'];
+					} else {
+						content = getPasteBinHtml();
+
+						// If paste bin is empty try using plain text mode
+						// since that is better than nothing right
+						if (content == pasteBinDefaultContent) {
+							plainTextMode = true;
+						}
+					}
+
+					content = Utils.trimHtml(content);
+
+					// WebKit has a nice bug where it clones the paste bin if you paste from for example notepad
+					// so we need to force plain text mode in this case
+					if (pasteBinElm && pasteBinElm.firstChild && pasteBinElm.firstChild.id === 'mcepastebin') {
+						plainTextMode = true;
+					}
+
+					removePasteBin();
+
+					// If we got nothing from clipboard API and pastebin then we could try the last resort: plain/text
+					if (!content.length) {
+						plainTextMode = true;
+					}
+
+					// Grab plain text from Clipboard API or convert existing HTML to plain text
+					if (plainTextMode) {
+						// Use plain text contents from Clipboard API unless the HTML contains paragraphs then
+						// we should convert the HTML to plain text since works better when pasting HTML/Word contents as plain text
+						if (hasContentType(clipboardContent, 'text/plain') && content.indexOf('</p>') == -1) {
+							content = clipboardContent['text/plain'];
+						} else {
+							content = Utils.innerText(content);
+						}
+					}
+
+					// If the content is the paste bin default HTML then it was
+					// impossible to get the cliboard data out.
+					if (content == pasteBinDefaultContent) {
+						if (!isKeyBoardPaste) {
+							editor.windowManager.alert('Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.');
+						}
+
+						return;
+					}
+
+					if (plainTextMode) {
+						pasteText(content);
+					} else {
+						pasteHtml(content);
+					}
+				}, 0);
+			});
+
+			editor.on('dragstart dragend', function(e) {
+				draggingInternally = e.type == 'dragstart';
+			});
+
+			editor.on('drop', function(e) {
+				var rng = getCaretRangeFromEvent(e);
+
+				if (e.isDefaultPrevented() || draggingInternally) {
+					return;
+				}
+
+				if (pasteImageData(e, rng)) {
+					return;
+				}
+
+				if (rng && editor.settings.paste_filter_drop !== false) {
+					var dropContent = getDataTransferItems(e.dataTransfer);
+					var content = dropContent['mce-internal'] || dropContent['text/html'] || dropContent['text/plain'];
+
+					if (content) {
+						e.preventDefault();
+
+						editor.undoManager.transact(function() {
+							if (dropContent['mce-internal']) {
+								editor.execCommand('Delete');
+							}
+
+							editor.selection.setRng(rng);
+
+							content = Utils.trimHtml(content);
+
+							if (!dropContent['text/html']) {
+								pasteText(content);
+							} else {
+								pasteHtml(content);
+							}
+						});
+					}
+				}
+			});
+
+			editor.on('dragover dragend', function(e) {
+				if (editor.settings.paste_data_images) {
+					e.preventDefault();
+				}
+			});
+		}
+
+		self.pasteHtml = pasteHtml;
+		self.pasteText = pasteText;
+
+		editor.on('preInit', function() {
+			registerEventHandlers();
+
+			// Remove all data images from paste for example from Gecko
+			// except internal images like video elements
+			editor.parser.addNodeFilter('img', function(nodes) {
+				if (!editor.settings.paste_data_images) {
+					var i = nodes.length;
+
+					while (i--) {
+						var src = nodes[i].attributes.map.src;
+
+						// Some browsers automatically produce data uris on paste
+						// Safari on Mac produces webkit-fake-url see: https://bugs.webkit.org/show_bug.cgi?id=49141
+						if (src && /^(data:image|webkit\-fake\-url)/.test(src)) {
+							if (!nodes[i].attr('data-mce-object') && src !== Env.transparentSrc) {
+								nodes[i].remove();
+							}
+						}
+					}
+				}
+			});
+		});
+	};
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/paste/classes/Plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,110 @@
+/**
+ * Plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class contains the tinymce plugin logic for the paste plugin.
+ *
+ * @class tinymce.pasteplugin.Plugin
+ * @private
+ */
+define("tinymce/pasteplugin/Plugin", [
+	"tinymce/PluginManager",
+	"tinymce/pasteplugin/Clipboard",
+	"tinymce/pasteplugin/WordFilter",
+	"tinymce/pasteplugin/Quirks"
+], function(PluginManager, Clipboard, WordFilter, Quirks) {
+	var userIsInformed;
+
+	PluginManager.add('paste', function(editor) {
+		var self = this, clipboard, settings = editor.settings;
+
+		function togglePlainTextPaste() {
+			if (clipboard.pasteFormat == "text") {
+				this.active(false);
+				clipboard.pasteFormat = "html";
+			} else {
+				clipboard.pasteFormat = "text";
+				this.active(true);
+
+				if (!userIsInformed) {
+					editor.windowManager.alert(
+						'Paste is now in plain text mode. Contents will now ' +
+						'be pasted as plain text until you toggle this option off.'
+					);
+
+					userIsInformed = true;
+				}
+			}
+		}
+
+		self.clipboard = clipboard = new Clipboard(editor);
+		self.quirks = new Quirks(editor);
+		self.wordFilter = new WordFilter(editor);
+
+		if (editor.settings.paste_as_text) {
+			self.clipboard.pasteFormat = "text";
+		}
+
+		if (settings.paste_preprocess) {
+			editor.on('PastePreProcess', function(e) {
+				settings.paste_preprocess.call(self, self, e);
+			});
+		}
+
+		if (settings.paste_postprocess) {
+			editor.on('PastePostProcess', function(e) {
+				settings.paste_postprocess.call(self, self, e);
+			});
+		}
+
+		editor.addCommand('mceInsertClipboardContent', function(ui, value) {
+			if (value.content) {
+				self.clipboard.pasteHtml(value.content);
+			}
+
+			if (value.text) {
+				self.clipboard.pasteText(value.text);
+			}
+		});
+
+		// Block all drag/drop events
+		if (editor.paste_block_drop) {
+			editor.on('dragend dragover draggesture dragdrop drop drag', function(e) {
+				e.preventDefault();
+				e.stopPropagation();
+			});
+		}
+
+		// Prevent users from dropping data images on Gecko
+		if (!editor.settings.paste_data_images) {
+			editor.on('drop', function(e) {
+				var dataTransfer = e.dataTransfer;
+
+				if (dataTransfer && dataTransfer.files && dataTransfer.files.length > 0) {
+					e.preventDefault();
+				}
+			});
+		}
+
+		editor.addButton('pastetext', {
+			icon: 'pastetext',
+			tooltip: 'Paste as text',
+			onclick: togglePlainTextPaste,
+			active: self.clipboard.pasteFormat == "text"
+		});
+
+		editor.addMenuItem('pastetext', {
+			text: 'Paste as text',
+			selectable: true,
+			active: clipboard.pasteFormat,
+			onclick: togglePlainTextPaste
+		});
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/paste/classes/Quirks.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,159 @@
+/**
+ * Quirks.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class contains various fixes for browsers. These issues can not be feature
+ * detected since we have no direct control over the clipboard. However we might be able
+ * to remove some of these fixes once the browsers gets updated/fixed.
+ *
+ * @class tinymce.pasteplugin.Quirks
+ * @private
+ */
+define("tinymce/pasteplugin/Quirks", [
+	"tinymce/Env",
+	"tinymce/util/Tools",
+	"tinymce/pasteplugin/WordFilter",
+	"tinymce/pasteplugin/Utils"
+], function(Env, Tools, WordFilter, Utils) {
+	"use strict";
+
+	return function(editor) {
+		function addPreProcessFilter(filterFunc) {
+			editor.on('BeforePastePreProcess', function(e) {
+				e.content = filterFunc(e.content);
+			});
+		}
+
+		/**
+		 * Removes BR elements after block elements. IE9 has a nasty bug where it puts a BR element after each
+		 * block element when pasting from word. This removes those elements.
+		 *
+		 * This:
+		 *  <p>a</p><br><p>b</p>
+		 *
+		 * Becomes:
+		 *  <p>a</p><p>b</p>
+		 */
+		function removeExplorerBrElementsAfterBlocks(html) {
+			// Only filter word specific content
+			if (!WordFilter.isWordContent(html)) {
+				return html;
+			}
+
+			// Produce block regexp based on the block elements in schema
+			var blockElements = [];
+
+			Tools.each(editor.schema.getBlockElements(), function(block, blockName) {
+				blockElements.push(blockName);
+			});
+
+			var explorerBlocksRegExp = new RegExp(
+				'(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*(<\\/?(' + blockElements.join('|') + ')[^>]*>)(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*',
+				'g'
+			);
+
+			// Remove BR:s from: <BLOCK>X</BLOCK><BR>
+			html = Utils.filter(html, [
+				[explorerBlocksRegExp, '$1']
+			]);
+
+			// IE9 also adds an extra BR element for each soft-linefeed and it also adds a BR for each word wrap break
+			html = Utils.filter(html, [
+				[/<br><br>/g, '<BR><BR>'], // Replace multiple BR elements with uppercase BR to keep them intact
+				[/<br>/g, ' '],            // Replace single br elements with space since they are word wrap BR:s
+				[/<BR><BR>/g, '<br>']      // Replace back the double brs but into a single BR
+			]);
+
+			return html;
+		}
+
+		/**
+		 * WebKit has a nasty bug where the all computed styles gets added to style attributes when copy/pasting contents.
+		 * This fix solves that by simply removing the whole style attribute.
+		 *
+		 * The paste_webkit_styles option can be set to specify what to keep:
+		 *  paste_webkit_styles: "none" // Keep no styles
+		 *  paste_webkit_styles: "all", // Keep all of them
+		 *  paste_webkit_styles: "font-weight color" // Keep specific ones
+		 *
+		 * @param {String} content Content that needs to be processed.
+		 * @return {String} Processed contents.
+		 */
+		function removeWebKitStyles(content) {
+			// Passthrough all styles from Word and let the WordFilter handle that junk
+			if (WordFilter.isWordContent(content)) {
+				return content;
+			}
+
+			// Filter away styles that isn't matching the target node
+			var webKitStyles = editor.settings.paste_webkit_styles;
+
+			if (editor.settings.paste_remove_styles_if_webkit === false || webKitStyles == "all") {
+				return content;
+			}
+
+			if (webKitStyles) {
+				webKitStyles = webKitStyles.split(/[, ]/);
+			}
+
+			// Keep specific styles that doesn't match the current node computed style
+			if (webKitStyles) {
+				var dom = editor.dom, node = editor.selection.getNode();
+
+				content = content.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi, function(all, before, value, after) {
+					var inputStyles = dom.parseStyle(value, 'span'), outputStyles = {};
+
+					if (webKitStyles === "none") {
+						return before + after;
+					}
+
+					for (var i = 0; i < webKitStyles.length; i++) {
+						var inputValue = inputStyles[webKitStyles[i]], currentValue = dom.getStyle(node, webKitStyles[i], true);
+
+						if (/color/.test(webKitStyles[i])) {
+							inputValue = dom.toHex(inputValue);
+							currentValue = dom.toHex(currentValue);
+						}
+
+						if (currentValue != inputValue) {
+							outputStyles[webKitStyles[i]] = inputValue;
+						}
+					}
+
+					outputStyles = dom.serializeStyle(outputStyles, 'span');
+					if (outputStyles) {
+						return before + ' style="' + outputStyles + '"' + after;
+					}
+
+					return before + after;
+				});
+			} else {
+				// Remove all external styles
+				content = content.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi, '$1$3');
+			}
+
+			// Keep internal styles
+			content = content.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi, function(all, before, value, after) {
+				return before + ' style="' + value + '"' + after;
+			});
+
+			return content;
+		}
+
+		// Sniff browsers and apply fixes since we can't feature detect
+		if (Env.webkit) {
+			addPreProcessFilter(removeWebKitStyles);
+		}
+
+		if (Env.ie) {
+			addPreProcessFilter(removeExplorerBrElementsAfterBlocks);
+		}
+	};
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/paste/classes/Utils.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,129 @@
+/**
+ * Utils.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class contails various utility functions for the paste plugin.
+ *
+ * @class tinymce.pasteplugin.Utils
+ */
+define("tinymce/pasteplugin/Utils", [
+	"tinymce/util/Tools",
+	"tinymce/html/DomParser",
+	"tinymce/html/Schema"
+], function(Tools, DomParser, Schema) {
+	function filter(content, items) {
+		Tools.each(items, function(v) {
+			if (v.constructor == RegExp) {
+				content = content.replace(v, '');
+			} else {
+				content = content.replace(v[0], v[1]);
+			}
+		});
+
+		return content;
+	}
+
+	/**
+	 * Gets the innerText of the specified element. It will handle edge cases
+	 * and works better than textContent on Gecko.
+	 *
+	 * @param {String} html HTML string to get text from.
+	 * @return {String} String of text with line feeds.
+	 */
+	function innerText(html) {
+		var schema = new Schema(), domParser = new DomParser({}, schema), text = '';
+		var shortEndedElements = schema.getShortEndedElements();
+		var ignoreElements = Tools.makeMap('script noscript style textarea video audio iframe object', ' ');
+		var blockElements = schema.getBlockElements();
+
+		function walk(node) {
+			var name = node.name, currentNode = node;
+
+			if (name === 'br') {
+				text += '\n';
+				return;
+			}
+
+			// img/input/hr
+			if (shortEndedElements[name]) {
+				text += ' ';
+			}
+
+			// Ingore script, video contents
+			if (ignoreElements[name]) {
+				text += ' ';
+				return;
+			}
+
+			if (node.type == 3) {
+				text += node.value;
+			}
+
+			// Walk all children
+			if (!node.shortEnded) {
+				if ((node = node.firstChild)) {
+					do {
+						walk(node);
+					} while ((node = node.next));
+				}
+			}
+
+			// Add \n or \n\n for blocks or P
+			if (blockElements[name] && currentNode.next) {
+				text += '\n';
+
+				if (name == 'p') {
+					text += '\n';
+				}
+			}
+		}
+
+		html = filter(html, [
+			/<!\[[^\]]+\]>/g // Conditional comments
+		]);
+
+		walk(domParser.parse(html));
+
+		return text;
+	}
+
+	/**
+	 * Trims the specified HTML by removing all WebKit fragments, all elements wrapping the body trailing BR elements etc.
+	 *
+	 * @param {String} html Html string to trim contents on.
+	 * @return {String} Html contents that got trimmed.
+	 */
+	function trimHtml(html) {
+		function trimSpaces(all, s1, s2) {
+			// WebKit &nbsp; meant to preserve multiple spaces but instead inserted around all inline tags,
+			// including the spans with inline styles created on paste
+			if (!s1 && !s2) {
+				return ' ';
+			}
+
+			return '\u00a0';
+		}
+
+		html = filter(html, [
+			/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g, // Remove anything but the contents within the BODY element
+			/<!--StartFragment-->|<!--EndFragment-->/g, // Inner fragments (tables from excel on mac)
+			[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g, trimSpaces],
+			/<br>$/i // Trailing BR elements
+		]);
+
+		return html;
+	}
+
+	return {
+		filter: filter,
+		innerText: innerText,
+		trimHtml: trimHtml
+	};
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/paste/classes/WordFilter.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,498 @@
+/**
+ * WordFilter.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class parses word HTML into proper TinyMCE markup.
+ *
+ * @class tinymce.pasteplugin.WordFilter
+ * @private
+ */
+define("tinymce/pasteplugin/WordFilter", [
+	"tinymce/util/Tools",
+	"tinymce/html/DomParser",
+	"tinymce/html/Schema",
+	"tinymce/html/Serializer",
+	"tinymce/html/Node",
+	"tinymce/pasteplugin/Utils"
+], function(Tools, DomParser, Schema, Serializer, Node, Utils) {
+	/**
+	 * Checks if the specified content is from any of the following sources: MS Word/Office 365/Google docs.
+	 */
+	function isWordContent(content) {
+		return (
+			(/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i).test(content) ||
+			(/class="OutlineElement/).test(content) ||
+			(/id="?docs\-internal\-guid\-/.test(content))
+		);
+	}
+
+	/**
+	 * Checks if the specified text starts with "1. " or "a. " etc.
+	 */
+	function isNumericList(text) {
+		var found, patterns;
+
+		patterns = [
+			/^[IVXLMCD]{1,2}\.[ \u00a0]/,  // Roman upper case
+			/^[ivxlmcd]{1,2}\.[ \u00a0]/,  // Roman lower case
+			/^[a-z]{1,2}[\.\)][ \u00a0]/,  // Alphabetical a-z
+			/^[A-Z]{1,2}[\.\)][ \u00a0]/,  // Alphabetical A-Z
+			/^[0-9]+\.[ \u00a0]/,          // Numeric lists
+			/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/, // Japanese
+			/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/  // Chinese
+		];
+
+		text = text.replace(/^[\u00a0 ]+/, '');
+
+		Tools.each(patterns, function(pattern) {
+			if (pattern.test(text)) {
+				found = true;
+				return false;
+			}
+		});
+
+		return found;
+	}
+
+	function isBulletList(text) {
+		return /^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(text);
+	}
+
+	function WordFilter(editor) {
+		var settings = editor.settings;
+
+		editor.on('BeforePastePreProcess', function(e) {
+			var content = e.content, retainStyleProperties, validStyles;
+
+			// Remove google docs internal guid markers
+			content = content.replace(/<b[^>]+id="?docs-internal-[^>]*>/gi, '');
+			content = content.replace(/<br class="?Apple-interchange-newline"?>/gi, '');
+
+			retainStyleProperties = settings.paste_retain_style_properties;
+			if (retainStyleProperties) {
+				validStyles = Tools.makeMap(retainStyleProperties.split(/[, ]/));
+			}
+
+			/**
+			 * Converts fake bullet and numbered lists to real semantic OL/UL.
+			 *
+			 * @param {tinymce.html.Node} node Root node to convert children of.
+			 */
+			function convertFakeListsToProperLists(node) {
+				var currentListNode, prevListNode, lastLevel = 1;
+
+				function getText(node) {
+					var txt = '';
+
+					if (node.type === 3) {
+						return node.value;
+					}
+
+					if ((node = node.firstChild)) {
+						do {
+							txt += getText(node);
+						} while ((node = node.next));
+					}
+
+					return txt;
+				}
+
+				function trimListStart(node, regExp) {
+					if (node.type === 3) {
+						if (regExp.test(node.value)) {
+							node.value = node.value.replace(regExp, '');
+							return false;
+						}
+					}
+
+					if ((node = node.firstChild)) {
+						do {
+							if (!trimListStart(node, regExp)) {
+								return false;
+							}
+						} while ((node = node.next));
+					}
+
+					return true;
+				}
+
+				function removeIgnoredNodes(node) {
+					if (node._listIgnore) {
+						node.remove();
+						return;
+					}
+
+					if ((node = node.firstChild)) {
+						do {
+							removeIgnoredNodes(node);
+						} while ((node = node.next));
+					}
+				}
+
+				function convertParagraphToLi(paragraphNode, listName, start) {
+					var level = paragraphNode._listLevel || lastLevel;
+
+					// Handle list nesting
+					if (level != lastLevel) {
+						if (level < lastLevel) {
+							// Move to parent list
+							if (currentListNode) {
+								currentListNode = currentListNode.parent.parent;
+							}
+						} else {
+							// Create new list
+							prevListNode = currentListNode;
+							currentListNode = null;
+						}
+					}
+
+					if (!currentListNode || currentListNode.name != listName) {
+						prevListNode = prevListNode || currentListNode;
+						currentListNode = new Node(listName, 1);
+
+						if (start > 1) {
+							currentListNode.attr('start', '' + start);
+						}
+
+						paragraphNode.wrap(currentListNode);
+					} else {
+						currentListNode.append(paragraphNode);
+					}
+
+					paragraphNode.name = 'li';
+
+					// Append list to previous list if it exists
+					if (level > lastLevel && prevListNode) {
+						prevListNode.lastChild.append(currentListNode);
+					}
+
+					lastLevel = level;
+
+					// Remove start of list item "1. " or "&middot; " etc
+					removeIgnoredNodes(paragraphNode);
+					trimListStart(paragraphNode, /^\u00a0+/);
+					trimListStart(paragraphNode, /^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/);
+					trimListStart(paragraphNode, /^\u00a0+/);
+				}
+
+				// Build a list of all root level elements before we start
+				// altering them in the loop below.
+				var elements = [], child = node.firstChild;
+				while (typeof child !== 'undefined' && child !== null) {
+					elements.push(child);
+
+					child = child.walk();
+					if (child !== null) {
+						while (typeof child !== 'undefined' && child.parent !== node) {
+							child = child.walk();
+						}
+					}
+				}
+
+				for (var i = 0; i < elements.length; i++) {
+					node = elements[i];
+
+					if (node.name == 'p' && node.firstChild) {
+						// Find first text node in paragraph
+						var nodeText = getText(node);
+
+						// Detect unordered lists look for bullets
+						if (isBulletList(nodeText)) {
+							convertParagraphToLi(node, 'ul');
+							continue;
+						}
+
+						// Detect ordered lists 1., a. or ixv.
+						if (isNumericList(nodeText)) {
+							// Parse OL start number
+							var matches = /([0-9]+)\./.exec(nodeText);
+							var start = 1;
+							if (matches) {
+								start = parseInt(matches[1], 10);
+							}
+
+							convertParagraphToLi(node, 'ol', start);
+							continue;
+						}
+
+						// Convert paragraphs marked as lists but doesn't look like anything
+						if (node._listLevel) {
+							convertParagraphToLi(node, 'ul', 1);
+							continue;
+						}
+
+						currentListNode = null;
+					} else {
+						// If the root level element isn't a p tag which can be
+						// processed by convertParagraphToLi, it interrupts the
+						// lists, causing a new list to start instead of having
+						// elements from the next list inserted above this tag.
+						prevListNode = currentListNode;
+						currentListNode = null;
+					}
+				}
+			}
+
+			function filterStyles(node, styleValue) {
+				var outputStyles = {}, matches, styles = editor.dom.parseStyle(styleValue);
+
+				Tools.each(styles, function(value, name) {
+					// Convert various MS styles to W3C styles
+					switch (name) {
+						case 'mso-list':
+							// Parse out list indent level for lists
+							matches = /\w+ \w+([0-9]+)/i.exec(styleValue);
+							if (matches) {
+								node._listLevel = parseInt(matches[1], 10);
+							}
+
+							// Remove these nodes <span style="mso-list:Ignore">o</span>
+							// Since the span gets removed we mark the text node and the span
+							if (/Ignore/i.test(value) && node.firstChild) {
+								node._listIgnore = true;
+								node.firstChild._listIgnore = true;
+							}
+
+							break;
+
+						case "horiz-align":
+							name = "text-align";
+							break;
+
+						case "vert-align":
+							name = "vertical-align";
+							break;
+
+						case "font-color":
+						case "mso-foreground":
+							name = "color";
+							break;
+
+						case "mso-background":
+						case "mso-highlight":
+							name = "background";
+							break;
+
+						case "font-weight":
+						case "font-style":
+							if (value != "normal") {
+								outputStyles[name] = value;
+							}
+							return;
+
+						case "mso-element":
+							// Remove track changes code
+							if (/^(comment|comment-list)$/i.test(value)) {
+								node.remove();
+								return;
+							}
+
+							break;
+					}
+
+					if (name.indexOf('mso-comment') === 0) {
+						node.remove();
+						return;
+					}
+
+					// Never allow mso- prefixed names
+					if (name.indexOf('mso-') === 0) {
+						return;
+					}
+
+					// Output only valid styles
+					if (retainStyleProperties == "all" || (validStyles && validStyles[name])) {
+						outputStyles[name] = value;
+					}
+				});
+
+				// Convert bold style to "b" element
+				if (/(bold)/i.test(outputStyles["font-weight"])) {
+					delete outputStyles["font-weight"];
+					node.wrap(new Node("b", 1));
+				}
+
+				// Convert italic style to "i" element
+				if (/(italic)/i.test(outputStyles["font-style"])) {
+					delete outputStyles["font-style"];
+					node.wrap(new Node("i", 1));
+				}
+
+				// Serialize the styles and see if there is something left to keep
+				outputStyles = editor.dom.serializeStyle(outputStyles, node.name);
+				if (outputStyles) {
+					return outputStyles;
+				}
+
+				return null;
+			}
+
+			if (settings.paste_enable_default_filters === false) {
+				return;
+			}
+
+			// Detect is the contents is Word junk HTML
+			if (isWordContent(e.content)) {
+				e.wordContent = true; // Mark it for other processors
+
+				// Remove basic Word junk
+				content = Utils.filter(content, [
+					// Word comments like conditional comments etc
+					/<!--[\s\S]+?-->/gi,
+
+					// Remove comments, scripts (e.g., msoShowComment), XML tag, VML content,
+					// MS Office namespaced tags, and a few other tags
+					/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,
+
+					// Convert <s> into <strike> for line-though
+					[/<(\/?)s>/gi, "<$1strike>"],
+
+					// Replace nsbp entites to char since it's easier to handle
+					[/&nbsp;/gi, "\u00a0"],
+
+					// Convert <span style="mso-spacerun:yes">___</span> to string of alternating
+					// breaking/non-breaking spaces of same length
+					[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,
+						function(str, spaces) {
+							return (spaces.length > 0) ?
+								spaces.replace(/./, " ").slice(Math.floor(spaces.length / 2)).split("").join("\u00a0") : "";
+						}
+					]
+				]);
+
+				var validElements = settings.paste_word_valid_elements;
+				if (!validElements) {
+					validElements = (
+						'-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,' +
+						'-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,' +
+						'td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody'
+					);
+				}
+
+				// Setup strict schema
+				var schema = new Schema({
+					valid_elements: validElements,
+					valid_children: '-li[p]'
+				});
+
+				// Add style/class attribute to all element rules since the user might have removed them from
+				// paste_word_valid_elements config option and we need to check them for properties
+				Tools.each(schema.elements, function(rule) {
+					/*eslint dot-notation:0*/
+					if (!rule.attributes["class"]) {
+						rule.attributes["class"] = {};
+						rule.attributesOrder.push("class");
+					}
+
+					if (!rule.attributes.style) {
+						rule.attributes.style = {};
+						rule.attributesOrder.push("style");
+					}
+				});
+
+				// Parse HTML into DOM structure
+				var domParser = new DomParser({}, schema);
+
+				// Filter styles to remove "mso" specific styles and convert some of them
+				domParser.addAttributeFilter('style', function(nodes) {
+					var i = nodes.length, node;
+
+					while (i--) {
+						node = nodes[i];
+						node.attr('style', filterStyles(node, node.attr('style')));
+
+						// Remove pointess spans
+						if (node.name == 'span' && node.parent && !node.attributes.length) {
+							node.unwrap();
+						}
+					}
+				});
+
+				// Check the class attribute for comments or del items and remove those
+				domParser.addAttributeFilter('class', function(nodes) {
+					var i = nodes.length, node, className;
+
+					while (i--) {
+						node = nodes[i];
+
+						className = node.attr('class');
+						if (/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(className)) {
+							node.remove();
+						}
+
+						node.attr('class', null);
+					}
+				});
+
+				// Remove all del elements since we don't want the track changes code in the editor
+				domParser.addNodeFilter('del', function(nodes) {
+					var i = nodes.length;
+
+					while (i--) {
+						nodes[i].remove();
+					}
+				});
+
+				// Keep some of the links and anchors
+				domParser.addNodeFilter('a', function(nodes) {
+					var i = nodes.length, node, href, name;
+
+					while (i--) {
+						node = nodes[i];
+						href = node.attr('href');
+						name = node.attr('name');
+
+						if (href && href.indexOf('#_msocom_') != -1) {
+							node.remove();
+							continue;
+						}
+
+						if (href && href.indexOf('file://') === 0) {
+							href = href.split('#')[1];
+							if (href) {
+								href = '#' + href;
+							}
+						}
+
+						if (!href && !name) {
+							node.unwrap();
+						} else {
+							// Remove all named anchors that aren't specific to TOC, Footnotes or Endnotes
+							if (name && !/^_?(?:toc|edn|ftn)/i.test(name)) {
+								node.unwrap();
+								continue;
+							}
+
+							node.attr({
+								href: href,
+								name: name
+							});
+						}
+					}
+				});
+
+				// Parse into DOM structure
+				var rootNode = domParser.parse(content);
+
+				// Process DOM
+				if (settings.paste_convert_word_fake_lists !== false) {
+					convertFakeListsToProperLists(rootNode);
+				}
+
+				// Serialize DOM back to HTML
+				e.content = new Serializer({}, schema).serialize(rootNode);
+			}
+		});
+	}
+
+	WordFilter.isWordContent = isWordContent;
+
+	return WordFilter;
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/paste/plugin.dev.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,120 @@
+/**
+ * Inline development version. Only to be used while developing since it uses document.write to load scripts.
+ */
+
+/*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */
+/*globals $code */
+
+(function(exports) {
+	"use strict";
+
+	var html = "", baseDir;
+	var modules = {}, exposedModules = [], moduleCount = 0;
+
+	var scripts = document.getElementsByTagName('script');
+	for (var i = 0; i < scripts.length; i++) {
+		var src = scripts[i].src;
+
+		if (src.indexOf('/plugin.dev.js') != -1) {
+			baseDir = src.substring(0, src.lastIndexOf('/'));
+		}
+	}
+
+	function require(ids, callback) {
+		var module, defs = [];
+
+		for (var i = 0; i < ids.length; ++i) {
+			module = modules[ids[i]] || resolve(ids[i]);
+			if (!module) {
+				throw 'module definition dependecy not found: ' + ids[i];
+			}
+
+			defs.push(module);
+		}
+
+		callback.apply(null, defs);
+	}
+
+	function resolve(id) {
+		var target = exports;
+		var fragments = id.split(/[.\/]/);
+
+		for (var fi = 0; fi < fragments.length; ++fi) {
+			if (!target[fragments[fi]]) {
+				return;
+			}
+
+			target = target[fragments[fi]];
+		}
+
+		return target;
+	}
+
+	function register(id) {
+		var target = exports;
+		var fragments = id.split(/[.\/]/);
+
+		for (var fi = 0; fi < fragments.length - 1; ++fi) {
+			if (target[fragments[fi]] === undefined) {
+				target[fragments[fi]] = {};
+			}
+
+			target = target[fragments[fi]];
+		}
+
+		target[fragments[fragments.length - 1]] = modules[id];
+	}
+
+	function define(id, dependencies, definition) {
+		if (typeof id !== 'string') {
+			throw 'invalid module definition, module id must be defined and be a string';
+		}
+
+		if (dependencies === undefined) {
+			throw 'invalid module definition, dependencies must be specified';
+		}
+
+		if (definition === undefined) {
+			throw 'invalid module definition, definition function must be specified';
+		}
+
+		require(dependencies, function() {
+			modules[id] = definition.apply(null, arguments);
+		});
+
+		if (--moduleCount === 0) {
+			for (var i = 0; i < exposedModules.length; i++) {
+				register(exposedModules[i]);
+			}
+		}
+	}
+
+	function expose(ids) {
+		exposedModules = ids;
+	}
+
+	function writeScripts() {
+		document.write(html);
+	}
+
+	function load(path) {
+		html += '<script type="text/javascript" src="' + baseDir + '/' + path + '"></script>\n';
+		moduleCount++;
+	}
+
+	// Expose globally
+	exports.define = define;
+	exports.require = require;
+
+	expose(["tinymce/pasteplugin/Utils"]);
+
+	load('classes/Utils.js');
+	load('classes/Clipboard.js');
+	load('classes/WordFilter.js');
+	load('classes/Quirks.js');
+	load('classes/Plugin.js');
+
+	writeScripts();
+})(this);
+
+// $hash: bc2f915b9558e72dc8a3bd07314a5bfe
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/paste/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1606 @@
+/**
+ * Compiled inline version. (Library mode)
+ */
+
+/*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */
+/*globals $code */
+
+(function(exports, undefined) {
+	"use strict";
+
+	var modules = {};
+
+	function require(ids, callback) {
+		var module, defs = [];
+
+		for (var i = 0; i < ids.length; ++i) {
+			module = modules[ids[i]] || resolve(ids[i]);
+			if (!module) {
+				throw 'module definition dependecy not found: ' + ids[i];
+			}
+
+			defs.push(module);
+		}
+
+		callback.apply(null, defs);
+	}
+
+	function define(id, dependencies, definition) {
+		if (typeof id !== 'string') {
+			throw 'invalid module definition, module id must be defined and be a string';
+		}
+
+		if (dependencies === undefined) {
+			throw 'invalid module definition, dependencies must be specified';
+		}
+
+		if (definition === undefined) {
+			throw 'invalid module definition, definition function must be specified';
+		}
+
+		require(dependencies, function() {
+			modules[id] = definition.apply(null, arguments);
+		});
+	}
+
+	function defined(id) {
+		return !!modules[id];
+	}
+
+	function resolve(id) {
+		var target = exports;
+		var fragments = id.split(/[.\/]/);
+
+		for (var fi = 0; fi < fragments.length; ++fi) {
+			if (!target[fragments[fi]]) {
+				return;
+			}
+
+			target = target[fragments[fi]];
+		}
+
+		return target;
+	}
+
+	function expose(ids) {
+		for (var i = 0; i < ids.length; i++) {
+			var target = exports;
+			var id = ids[i];
+			var fragments = id.split(/[.\/]/);
+
+			for (var fi = 0; fi < fragments.length - 1; ++fi) {
+				if (target[fragments[fi]] === undefined) {
+					target[fragments[fi]] = {};
+				}
+
+				target = target[fragments[fi]];
+			}
+
+			target[fragments[fragments.length - 1]] = modules[id];
+		}
+	}
+
+// Included from: js/tinymce/plugins/paste/classes/Utils.js
+
+/**
+ * Utils.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class contails various utility functions for the paste plugin.
+ *
+ * @class tinymce.pasteplugin.Utils
+ */
+define("tinymce/pasteplugin/Utils", [
+	"tinymce/util/Tools",
+	"tinymce/html/DomParser",
+	"tinymce/html/Schema"
+], function(Tools, DomParser, Schema) {
+	function filter(content, items) {
+		Tools.each(items, function(v) {
+			if (v.constructor == RegExp) {
+				content = content.replace(v, '');
+			} else {
+				content = content.replace(v[0], v[1]);
+			}
+		});
+
+		return content;
+	}
+
+	/**
+	 * Gets the innerText of the specified element. It will handle edge cases
+	 * and works better than textContent on Gecko.
+	 *
+	 * @param {String} html HTML string to get text from.
+	 * @return {String} String of text with line feeds.
+	 */
+	function innerText(html) {
+		var schema = new Schema(), domParser = new DomParser({}, schema), text = '';
+		var shortEndedElements = schema.getShortEndedElements();
+		var ignoreElements = Tools.makeMap('script noscript style textarea video audio iframe object', ' ');
+		var blockElements = schema.getBlockElements();
+
+		function walk(node) {
+			var name = node.name, currentNode = node;
+
+			if (name === 'br') {
+				text += '\n';
+				return;
+			}
+
+			// img/input/hr
+			if (shortEndedElements[name]) {
+				text += ' ';
+			}
+
+			// Ingore script, video contents
+			if (ignoreElements[name]) {
+				text += ' ';
+				return;
+			}
+
+			if (node.type == 3) {
+				text += node.value;
+			}
+
+			// Walk all children
+			if (!node.shortEnded) {
+				if ((node = node.firstChild)) {
+					do {
+						walk(node);
+					} while ((node = node.next));
+				}
+			}
+
+			// Add \n or \n\n for blocks or P
+			if (blockElements[name] && currentNode.next) {
+				text += '\n';
+
+				if (name == 'p') {
+					text += '\n';
+				}
+			}
+		}
+
+		html = filter(html, [
+			/<!\[[^\]]+\]>/g // Conditional comments
+		]);
+
+		walk(domParser.parse(html));
+
+		return text;
+	}
+
+	/**
+	 * Trims the specified HTML by removing all WebKit fragments, all elements wrapping the body trailing BR elements etc.
+	 *
+	 * @param {String} html Html string to trim contents on.
+	 * @return {String} Html contents that got trimmed.
+	 */
+	function trimHtml(html) {
+		function trimSpaces(all, s1, s2) {
+			// WebKit &nbsp; meant to preserve multiple spaces but instead inserted around all inline tags,
+			// including the spans with inline styles created on paste
+			if (!s1 && !s2) {
+				return ' ';
+			}
+
+			return '\u00a0';
+		}
+
+		html = filter(html, [
+			/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g, // Remove anything but the contents within the BODY element
+			/<!--StartFragment-->|<!--EndFragment-->/g, // Inner fragments (tables from excel on mac)
+			[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g, trimSpaces],
+			/<br>$/i // Trailing BR elements
+		]);
+
+		return html;
+	}
+
+	return {
+		filter: filter,
+		innerText: innerText,
+		trimHtml: trimHtml
+	};
+});
+
+// Included from: js/tinymce/plugins/paste/classes/Clipboard.js
+
+/**
+ * Clipboard.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class contains logic for getting HTML contents out of the clipboard.
+ *
+ * We need to make a lot of ugly hacks to get the contents out of the clipboard since
+ * the W3C Clipboard API is broken in all browsers that have it: Gecko/WebKit/Blink.
+ * We might rewrite this the way those API:s stabilize. Browsers doesn't handle pasting
+ * from applications like Word the same way as it does when pasting into a contentEditable area
+ * so we need to do lots of extra work to try to get to this clipboard data.
+ *
+ * Current implementation steps:
+ *  1. On keydown with paste keys Ctrl+V or Shift+Insert create
+ *     a paste bin element and move focus to that element.
+ *  2. Wait for the browser to fire a "paste" event and get the contents out of the paste bin.
+ *  3. Check if the paste was successful if true, process the HTML.
+ *  (4). If the paste was unsuccessful use IE execCommand, Clipboard API, document.dataTransfer old WebKit API etc.
+ *
+ * @class tinymce.pasteplugin.Clipboard
+ * @private
+ */
+define("tinymce/pasteplugin/Clipboard", [
+	"tinymce/Env",
+	"tinymce/dom/RangeUtils",
+	"tinymce/util/VK",
+	"tinymce/pasteplugin/Utils"
+], function(Env, RangeUtils, VK, Utils) {
+	return function(editor) {
+		var self = this, pasteBinElm, lastRng, keyboardPasteTimeStamp = 0, draggingInternally = false;
+		var pasteBinDefaultContent = '%MCEPASTEBIN%', keyboardPastePlainTextState;
+		var mceInternalUrlPrefix = 'data:text/mce-internal,';
+
+		/**
+		 * Pastes the specified HTML. This means that the HTML is filtered and then
+		 * inserted at the current selection in the editor. It will also fire paste events
+		 * for custom user filtering.
+		 *
+		 * @param {String} html HTML code to paste into the current selection.
+		 */
+		function pasteHtml(html) {
+			var args, dom = editor.dom;
+
+			args = editor.fire('BeforePastePreProcess', {content: html}); // Internal event used by Quirks
+			args = editor.fire('PastePreProcess', args);
+			html = args.content;
+
+			if (!args.isDefaultPrevented()) {
+				// User has bound PastePostProcess events then we need to pass it through a DOM node
+				// This is not ideal but we don't want to let the browser mess up the HTML for example
+				// some browsers add &nbsp; to P tags etc
+				if (editor.hasEventListeners('PastePostProcess') && !args.isDefaultPrevented()) {
+					// We need to attach the element to the DOM so Sizzle selectors work on the contents
+					var tempBody = dom.add(editor.getBody(), 'div', {style: 'display:none'}, html);
+					args = editor.fire('PastePostProcess', {node: tempBody});
+					dom.remove(tempBody);
+					html = args.node.innerHTML;
+				}
+
+				if (!args.isDefaultPrevented()) {
+					editor.insertContent(html, {merge: editor.settings.paste_merge_formats !== false});
+				}
+			}
+		}
+
+		/**
+		 * Pastes the specified text. This means that the plain text is processed
+		 * and converted into BR and P elements. It will fire paste events for custom filtering.
+		 *
+		 * @param {String} text Text to paste as the current selection location.
+		 */
+		function pasteText(text) {
+			text = editor.dom.encode(text).replace(/\r\n/g, '\n');
+
+			var startBlock = editor.dom.getParent(editor.selection.getStart(), editor.dom.isBlock);
+
+			// Create start block html for example <p attr="value">
+			var forcedRootBlockName = editor.settings.forced_root_block;
+			var forcedRootBlockStartHtml;
+			if (forcedRootBlockName) {
+				forcedRootBlockStartHtml = editor.dom.createHTML(forcedRootBlockName, editor.settings.forced_root_block_attrs);
+				forcedRootBlockStartHtml = forcedRootBlockStartHtml.substr(0, forcedRootBlockStartHtml.length - 3) + '>';
+			}
+
+			if ((startBlock && /^(PRE|DIV)$/.test(startBlock.nodeName)) || !forcedRootBlockName) {
+				text = Utils.filter(text, [
+					[/\n/g, "<br>"]
+				]);
+			} else {
+				text = Utils.filter(text, [
+					[/\n\n/g, "</p>" + forcedRootBlockStartHtml],
+					[/^(.*<\/p>)(<p>)$/, forcedRootBlockStartHtml + '$1'],
+					[/\n/g, "<br />"]
+				]);
+
+				if (text.indexOf('<p>') != -1) {
+					text = forcedRootBlockStartHtml + text;
+				}
+			}
+
+			pasteHtml(text);
+		}
+
+		/**
+		 * Creates a paste bin element as close as possible to the current caret location and places the focus inside that element
+		 * so that when the real paste event occurs the contents gets inserted into this element
+		 * instead of the current editor selection element.
+		 */
+		function createPasteBin() {
+			var dom = editor.dom, body = editor.getBody();
+			var viewport = editor.dom.getViewPort(editor.getWin()), scrollTop = viewport.y, top = 20;
+			var scrollContainer;
+
+			lastRng = editor.selection.getRng();
+
+			if (editor.inline) {
+				scrollContainer = editor.selection.getScrollContainer();
+
+				// Can't always rely on scrollTop returning a useful value.
+				// It returns 0 if the browser doesn't support scrollTop for the element or is non-scrollable
+				if (scrollContainer && scrollContainer.scrollTop > 0) {
+					scrollTop = scrollContainer.scrollTop;
+				}
+			}
+
+			/**
+			 * Returns the rect of the current caret if the caret is in an empty block before a
+			 * BR we insert a temporary invisible character that we get the rect this way we always get a proper rect.
+			 *
+			 * TODO: This might be useful in core.
+			 */
+			function getCaretRect(rng) {
+				var rects, textNode, node, container = rng.startContainer;
+
+				rects = rng.getClientRects();
+				if (rects.length) {
+					return rects[0];
+				}
+
+				if (!rng.collapsed || container.nodeType != 1) {
+					return;
+				}
+
+				node = container.childNodes[lastRng.startOffset];
+
+				// Skip empty whitespace nodes
+				while (node && node.nodeType == 3 && !node.data.length) {
+					node = node.nextSibling;
+				}
+
+				if (!node) {
+					return;
+				}
+
+				// Check if the location is |<br>
+				// TODO: Might need to expand this to say |<table>
+				if (node.tagName == 'BR') {
+					textNode = dom.doc.createTextNode('\uFEFF');
+					node.parentNode.insertBefore(textNode, node);
+
+					rng = dom.createRng();
+					rng.setStartBefore(textNode);
+					rng.setEndAfter(textNode);
+
+					rects = rng.getClientRects();
+					dom.remove(textNode);
+				}
+
+				if (rects.length) {
+					return rects[0];
+				}
+			}
+
+			// Calculate top cordinate this is needed to avoid scrolling to top of document
+			// We want the paste bin to be as close to the caret as possible to avoid scrolling
+			if (lastRng.getClientRects) {
+				var rect = getCaretRect(lastRng);
+
+				if (rect) {
+					// Client rects gets us closes to the actual
+					// caret location in for example a wrapped paragraph block
+					top = scrollTop + (rect.top - dom.getPos(body).y);
+				} else {
+					top = scrollTop;
+
+					// Check if we can find a closer location by checking the range element
+					var container = lastRng.startContainer;
+					if (container) {
+						if (container.nodeType == 3 && container.parentNode != body) {
+							container = container.parentNode;
+						}
+
+						if (container.nodeType == 1) {
+							top = dom.getPos(container, scrollContainer || body).y;
+						}
+					}
+				}
+			}
+
+			// Create a pastebin
+			pasteBinElm = dom.add(editor.getBody(), 'div', {
+				id: "mcepastebin",
+				contentEditable: true,
+				"data-mce-bogus": "all",
+				style: 'position: absolute; top: ' + top + 'px;' +
+					'width: 10px; height: 10px; overflow: hidden; opacity: 0'
+			}, pasteBinDefaultContent);
+
+			// Move paste bin out of sight since the controlSelection rect gets displayed otherwise on IE and Gecko
+			if (Env.ie || Env.gecko) {
+				dom.setStyle(pasteBinElm, 'left', dom.getStyle(body, 'direction', true) == 'rtl' ? 0xFFFF : -0xFFFF);
+			}
+
+			// Prevent focus events from bubbeling fixed FocusManager issues
+			dom.bind(pasteBinElm, 'beforedeactivate focusin focusout', function(e) {
+				e.stopPropagation();
+			});
+
+			pasteBinElm.focus();
+			editor.selection.select(pasteBinElm, true);
+		}
+
+		/**
+		 * Removes the paste bin if it exists.
+		 */
+		function removePasteBin() {
+			if (pasteBinElm) {
+				var pasteBinClone;
+
+				// WebKit/Blink might clone the div so
+				// lets make sure we remove all clones
+				// TODO: Man o man is this ugly. WebKit is the new IE! Remove this if they ever fix it!
+				while ((pasteBinClone = editor.dom.get('mcepastebin'))) {
+					editor.dom.remove(pasteBinClone);
+					editor.dom.unbind(pasteBinClone);
+				}
+
+				if (lastRng) {
+					editor.selection.setRng(lastRng);
+				}
+			}
+
+			pasteBinElm = lastRng = null;
+		}
+
+		/**
+		 * Returns the contents of the paste bin as a HTML string.
+		 *
+		 * @return {String} Get the contents of the paste bin.
+		 */
+		function getPasteBinHtml() {
+			var html = '', pasteBinClones, i, clone, cloneHtml;
+
+			// Since WebKit/Chrome might clone the paste bin when pasting
+			// for example: <img style="float: right"> we need to check if any of them contains some useful html.
+			// TODO: Man o man is this ugly. WebKit is the new IE! Remove this if they ever fix it!
+			pasteBinClones = editor.dom.select('div[id=mcepastebin]');
+			for (i = 0; i < pasteBinClones.length; i++) {
+				clone = pasteBinClones[i];
+
+				// Pasting plain text produces pastebins in pastebinds makes sence right!?
+				if (clone.firstChild && clone.firstChild.id == 'mcepastebin') {
+					clone = clone.firstChild;
+				}
+
+				cloneHtml = clone.innerHTML;
+				if (html != pasteBinDefaultContent) {
+					html += cloneHtml;
+				}
+			}
+
+			return html;
+		}
+
+		/**
+		 * Gets various content types out of a datatransfer object.
+		 *
+		 * @param {DataTransfer} dataTransfer Event fired on paste.
+		 * @return {Object} Object with mime types and data for those mime types.
+		 */
+		function getDataTransferItems(dataTransfer) {
+			var data = {};
+
+			if (dataTransfer) {
+				// Use old WebKit/IE API
+				if (dataTransfer.getData) {
+					var legacyText = dataTransfer.getData('Text');
+					if (legacyText && legacyText.length > 0) {
+						if (legacyText.indexOf(mceInternalUrlPrefix) == -1) {
+							data['text/plain'] = legacyText;
+						}
+					}
+				}
+
+				if (dataTransfer.types) {
+					for (var i = 0; i < dataTransfer.types.length; i++) {
+						var contentType = dataTransfer.types[i];
+						data[contentType] = dataTransfer.getData(contentType);
+					}
+				}
+			}
+
+			return data;
+		}
+
+		/**
+		 * Gets various content types out of the Clipboard API. It will also get the
+		 * plain text using older IE and WebKit API:s.
+		 *
+		 * @param {ClipboardEvent} clipboardEvent Event fired on paste.
+		 * @return {Object} Object with mime types and data for those mime types.
+		 */
+		function getClipboardContent(clipboardEvent) {
+			return getDataTransferItems(clipboardEvent.clipboardData || editor.getDoc().dataTransfer);
+		}
+
+		/**
+		 * Checks if the clipboard contains image data if it does it will take that data
+		 * and convert it into a data url image and paste that image at the caret location.
+		 *
+		 * @param  {ClipboardEvent} e Paste/drop event object.
+		 * @param  {DOMRange} rng Optional rng object to move selection to.
+		 * @return {Boolean} true/false if the image data was found or not.
+		 */
+		function pasteImageData(e, rng) {
+			var dataTransfer = e.clipboardData || e.dataTransfer;
+
+			function processItems(items) {
+				var i, item, reader, hadImage = false;
+
+				function pasteImage(reader) {
+					if (rng) {
+						editor.selection.setRng(rng);
+						rng = null;
+					}
+
+					pasteHtml('<img src="' + reader.result + '">');
+				}
+
+				if (items) {
+					for (i = 0; i < items.length; i++) {
+						item = items[i];
+
+						if (/^image\/(jpeg|png|gif|bmp)$/.test(item.type)) {
+							reader = new FileReader();
+							reader.onload = pasteImage.bind(null, reader);
+							reader.readAsDataURL(item.getAsFile ? item.getAsFile() : item);
+
+							e.preventDefault();
+							hadImage = true;
+						}
+					}
+				}
+
+				return hadImage;
+			}
+
+			if (editor.settings.paste_data_images && dataTransfer) {
+				return processItems(dataTransfer.items) || processItems(dataTransfer.files);
+			}
+		}
+
+		/**
+		 * Chrome on Android doesn't support proper clipboard access so we have no choice but to allow the browser default behavior.
+		 *
+		 * @param {Event} e Paste event object to check if it contains any data.
+		 * @return {Boolean} true/false if the clipboard is empty or not.
+		 */
+		function isBrokenAndroidClipboardEvent(e) {
+			var clipboardData = e.clipboardData;
+
+			return navigator.userAgent.indexOf('Android') != -1 && clipboardData && clipboardData.items && clipboardData.items.length === 0;
+		}
+
+		function getCaretRangeFromEvent(e) {
+			return RangeUtils.getCaretRangeFromPoint(e.clientX, e.clientY, editor.getDoc());
+		}
+
+		function hasContentType(clipboardContent, mimeType) {
+			return mimeType in clipboardContent && clipboardContent[mimeType].length > 0;
+		}
+
+		function isKeyboardPasteEvent(e) {
+			return (VK.metaKeyPressed(e) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45);
+		}
+
+		function registerEventHandlers() {
+			editor.on('keydown', function(e) {
+				function removePasteBinOnKeyUp(e) {
+					// Ctrl+V or Shift+Insert
+					if (isKeyboardPasteEvent(e) && !e.isDefaultPrevented()) {
+						removePasteBin();
+					}
+				}
+
+				// Ctrl+V or Shift+Insert
+				if (isKeyboardPasteEvent(e) && !e.isDefaultPrevented()) {
+					keyboardPastePlainTextState = e.shiftKey && e.keyCode == 86;
+
+					// Edge case on Safari on Mac where it doesn't handle Cmd+Shift+V correctly
+					// it fires the keydown but no paste or keyup so we are left with a paste bin
+					if (keyboardPastePlainTextState && Env.webkit && navigator.userAgent.indexOf('Version/') != -1) {
+						return;
+					}
+
+					// Prevent undoManager keydown handler from making an undo level with the pastebin in it
+					e.stopImmediatePropagation();
+
+					keyboardPasteTimeStamp = new Date().getTime();
+
+					// IE doesn't support Ctrl+Shift+V and it doesn't even produce a paste event
+					// so lets fake a paste event and let IE use the execCommand/dataTransfer methods
+					if (Env.ie && keyboardPastePlainTextState) {
+						e.preventDefault();
+						editor.fire('paste', {ieFake: true});
+						return;
+					}
+
+					removePasteBin();
+					createPasteBin();
+
+					// Remove pastebin if we get a keyup and no paste event
+					// For example pasting a file in IE 11 will not produce a paste event
+					editor.once('keyup', removePasteBinOnKeyUp);
+					editor.once('paste', function() {
+						editor.off('keyup', removePasteBinOnKeyUp);
+					});
+				}
+			});
+
+			editor.on('paste', function(e) {
+				// Getting content from the Clipboard can take some time
+				var clipboardTimer = new Date().getTime();
+				var clipboardContent = getClipboardContent(e);
+				var clipboardDelay = new Date().getTime() - clipboardTimer;
+
+				var isKeyBoardPaste = (new Date().getTime() - keyboardPasteTimeStamp - clipboardDelay) < 1000;
+				var plainTextMode = self.pasteFormat == "text" || keyboardPastePlainTextState;
+
+				keyboardPastePlainTextState = false;
+
+				if (e.isDefaultPrevented() || isBrokenAndroidClipboardEvent(e)) {
+					removePasteBin();
+					return;
+				}
+
+				if (pasteImageData(e)) {
+					removePasteBin();
+					return;
+				}
+
+				// Not a keyboard paste prevent default paste and try to grab the clipboard contents using different APIs
+				if (!isKeyBoardPaste) {
+					e.preventDefault();
+				}
+
+				// Try IE only method if paste isn't a keyboard paste
+				if (Env.ie && (!isKeyBoardPaste || e.ieFake)) {
+					createPasteBin();
+
+					editor.dom.bind(pasteBinElm, 'paste', function(e) {
+						e.stopPropagation();
+					});
+
+					editor.getDoc().execCommand('Paste', false, null);
+					clipboardContent["text/html"] = getPasteBinHtml();
+				}
+
+				setTimeout(function() {
+					var content;
+
+					// Grab HTML from Clipboard API or paste bin as a fallback
+					if (hasContentType(clipboardContent, 'text/html')) {
+						content = clipboardContent['text/html'];
+					} else {
+						content = getPasteBinHtml();
+
+						// If paste bin is empty try using plain text mode
+						// since that is better than nothing right
+						if (content == pasteBinDefaultContent) {
+							plainTextMode = true;
+						}
+					}
+
+					content = Utils.trimHtml(content);
+
+					// WebKit has a nice bug where it clones the paste bin if you paste from for example notepad
+					// so we need to force plain text mode in this case
+					if (pasteBinElm && pasteBinElm.firstChild && pasteBinElm.firstChild.id === 'mcepastebin') {
+						plainTextMode = true;
+					}
+
+					removePasteBin();
+
+					// If we got nothing from clipboard API and pastebin then we could try the last resort: plain/text
+					if (!content.length) {
+						plainTextMode = true;
+					}
+
+					// Grab plain text from Clipboard API or convert existing HTML to plain text
+					if (plainTextMode) {
+						// Use plain text contents from Clipboard API unless the HTML contains paragraphs then
+						// we should convert the HTML to plain text since works better when pasting HTML/Word contents as plain text
+						if (hasContentType(clipboardContent, 'text/plain') && content.indexOf('</p>') == -1) {
+							content = clipboardContent['text/plain'];
+						} else {
+							content = Utils.innerText(content);
+						}
+					}
+
+					// If the content is the paste bin default HTML then it was
+					// impossible to get the cliboard data out.
+					if (content == pasteBinDefaultContent) {
+						if (!isKeyBoardPaste) {
+							editor.windowManager.alert('Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.');
+						}
+
+						return;
+					}
+
+					if (plainTextMode) {
+						pasteText(content);
+					} else {
+						pasteHtml(content);
+					}
+				}, 0);
+			});
+
+			editor.on('dragstart dragend', function(e) {
+				draggingInternally = e.type == 'dragstart';
+			});
+
+			editor.on('drop', function(e) {
+				var rng = getCaretRangeFromEvent(e);
+
+				if (e.isDefaultPrevented() || draggingInternally) {
+					return;
+				}
+
+				if (pasteImageData(e, rng)) {
+					return;
+				}
+
+				if (rng && editor.settings.paste_filter_drop !== false) {
+					var dropContent = getDataTransferItems(e.dataTransfer);
+					var content = dropContent['mce-internal'] || dropContent['text/html'] || dropContent['text/plain'];
+
+					if (content) {
+						e.preventDefault();
+
+						editor.undoManager.transact(function() {
+							if (dropContent['mce-internal']) {
+								editor.execCommand('Delete');
+							}
+
+							editor.selection.setRng(rng);
+
+							content = Utils.trimHtml(content);
+
+							if (!dropContent['text/html']) {
+								pasteText(content);
+							} else {
+								pasteHtml(content);
+							}
+						});
+					}
+				}
+			});
+
+			editor.on('dragover dragend', function(e) {
+				if (editor.settings.paste_data_images) {
+					e.preventDefault();
+				}
+			});
+		}
+
+		self.pasteHtml = pasteHtml;
+		self.pasteText = pasteText;
+
+		editor.on('preInit', function() {
+			registerEventHandlers();
+
+			// Remove all data images from paste for example from Gecko
+			// except internal images like video elements
+			editor.parser.addNodeFilter('img', function(nodes) {
+				if (!editor.settings.paste_data_images) {
+					var i = nodes.length;
+
+					while (i--) {
+						var src = nodes[i].attributes.map.src;
+
+						// Some browsers automatically produce data uris on paste
+						// Safari on Mac produces webkit-fake-url see: https://bugs.webkit.org/show_bug.cgi?id=49141
+						if (src && /^(data:image|webkit\-fake\-url)/.test(src)) {
+							if (!nodes[i].attr('data-mce-object') && src !== Env.transparentSrc) {
+								nodes[i].remove();
+							}
+						}
+					}
+				}
+			});
+		});
+	};
+});
+
+// Included from: js/tinymce/plugins/paste/classes/WordFilter.js
+
+/**
+ * WordFilter.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class parses word HTML into proper TinyMCE markup.
+ *
+ * @class tinymce.pasteplugin.WordFilter
+ * @private
+ */
+define("tinymce/pasteplugin/WordFilter", [
+	"tinymce/util/Tools",
+	"tinymce/html/DomParser",
+	"tinymce/html/Schema",
+	"tinymce/html/Serializer",
+	"tinymce/html/Node",
+	"tinymce/pasteplugin/Utils"
+], function(Tools, DomParser, Schema, Serializer, Node, Utils) {
+	/**
+	 * Checks if the specified content is from any of the following sources: MS Word/Office 365/Google docs.
+	 */
+	function isWordContent(content) {
+		return (
+			(/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i).test(content) ||
+			(/class="OutlineElement/).test(content) ||
+			(/id="?docs\-internal\-guid\-/.test(content))
+		);
+	}
+
+	/**
+	 * Checks if the specified text starts with "1. " or "a. " etc.
+	 */
+	function isNumericList(text) {
+		var found, patterns;
+
+		patterns = [
+			/^[IVXLMCD]{1,2}\.[ \u00a0]/,  // Roman upper case
+			/^[ivxlmcd]{1,2}\.[ \u00a0]/,  // Roman lower case
+			/^[a-z]{1,2}[\.\)][ \u00a0]/,  // Alphabetical a-z
+			/^[A-Z]{1,2}[\.\)][ \u00a0]/,  // Alphabetical A-Z
+			/^[0-9]+\.[ \u00a0]/,          // Numeric lists
+			/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/, // Japanese
+			/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/  // Chinese
+		];
+
+		text = text.replace(/^[\u00a0 ]+/, '');
+
+		Tools.each(patterns, function(pattern) {
+			if (pattern.test(text)) {
+				found = true;
+				return false;
+			}
+		});
+
+		return found;
+	}
+
+	function isBulletList(text) {
+		return /^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(text);
+	}
+
+	function WordFilter(editor) {
+		var settings = editor.settings;
+
+		editor.on('BeforePastePreProcess', function(e) {
+			var content = e.content, retainStyleProperties, validStyles;
+
+			// Remove google docs internal guid markers
+			content = content.replace(/<b[^>]+id="?docs-internal-[^>]*>/gi, '');
+			content = content.replace(/<br class="?Apple-interchange-newline"?>/gi, '');
+
+			retainStyleProperties = settings.paste_retain_style_properties;
+			if (retainStyleProperties) {
+				validStyles = Tools.makeMap(retainStyleProperties.split(/[, ]/));
+			}
+
+			/**
+			 * Converts fake bullet and numbered lists to real semantic OL/UL.
+			 *
+			 * @param {tinymce.html.Node} node Root node to convert children of.
+			 */
+			function convertFakeListsToProperLists(node) {
+				var currentListNode, prevListNode, lastLevel = 1;
+
+				function getText(node) {
+					var txt = '';
+
+					if (node.type === 3) {
+						return node.value;
+					}
+
+					if ((node = node.firstChild)) {
+						do {
+							txt += getText(node);
+						} while ((node = node.next));
+					}
+
+					return txt;
+				}
+
+				function trimListStart(node, regExp) {
+					if (node.type === 3) {
+						if (regExp.test(node.value)) {
+							node.value = node.value.replace(regExp, '');
+							return false;
+						}
+					}
+
+					if ((node = node.firstChild)) {
+						do {
+							if (!trimListStart(node, regExp)) {
+								return false;
+							}
+						} while ((node = node.next));
+					}
+
+					return true;
+				}
+
+				function removeIgnoredNodes(node) {
+					if (node._listIgnore) {
+						node.remove();
+						return;
+					}
+
+					if ((node = node.firstChild)) {
+						do {
+							removeIgnoredNodes(node);
+						} while ((node = node.next));
+					}
+				}
+
+				function convertParagraphToLi(paragraphNode, listName, start) {
+					var level = paragraphNode._listLevel || lastLevel;
+
+					// Handle list nesting
+					if (level != lastLevel) {
+						if (level < lastLevel) {
+							// Move to parent list
+							if (currentListNode) {
+								currentListNode = currentListNode.parent.parent;
+							}
+						} else {
+							// Create new list
+							prevListNode = currentListNode;
+							currentListNode = null;
+						}
+					}
+
+					if (!currentListNode || currentListNode.name != listName) {
+						prevListNode = prevListNode || currentListNode;
+						currentListNode = new Node(listName, 1);
+
+						if (start > 1) {
+							currentListNode.attr('start', '' + start);
+						}
+
+						paragraphNode.wrap(currentListNode);
+					} else {
+						currentListNode.append(paragraphNode);
+					}
+
+					paragraphNode.name = 'li';
+
+					// Append list to previous list if it exists
+					if (level > lastLevel && prevListNode) {
+						prevListNode.lastChild.append(currentListNode);
+					}
+
+					lastLevel = level;
+
+					// Remove start of list item "1. " or "&middot; " etc
+					removeIgnoredNodes(paragraphNode);
+					trimListStart(paragraphNode, /^\u00a0+/);
+					trimListStart(paragraphNode, /^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/);
+					trimListStart(paragraphNode, /^\u00a0+/);
+				}
+
+				// Build a list of all root level elements before we start
+				// altering them in the loop below.
+				var elements = [], child = node.firstChild;
+				while (typeof child !== 'undefined' && child !== null) {
+					elements.push(child);
+
+					child = child.walk();
+					if (child !== null) {
+						while (typeof child !== 'undefined' && child.parent !== node) {
+							child = child.walk();
+						}
+					}
+				}
+
+				for (var i = 0; i < elements.length; i++) {
+					node = elements[i];
+
+					if (node.name == 'p' && node.firstChild) {
+						// Find first text node in paragraph
+						var nodeText = getText(node);
+
+						// Detect unordered lists look for bullets
+						if (isBulletList(nodeText)) {
+							convertParagraphToLi(node, 'ul');
+							continue;
+						}
+
+						// Detect ordered lists 1., a. or ixv.
+						if (isNumericList(nodeText)) {
+							// Parse OL start number
+							var matches = /([0-9]+)\./.exec(nodeText);
+							var start = 1;
+							if (matches) {
+								start = parseInt(matches[1], 10);
+							}
+
+							convertParagraphToLi(node, 'ol', start);
+							continue;
+						}
+
+						// Convert paragraphs marked as lists but doesn't look like anything
+						if (node._listLevel) {
+							convertParagraphToLi(node, 'ul', 1);
+							continue;
+						}
+
+						currentListNode = null;
+					} else {
+						// If the root level element isn't a p tag which can be
+						// processed by convertParagraphToLi, it interrupts the
+						// lists, causing a new list to start instead of having
+						// elements from the next list inserted above this tag.
+						prevListNode = currentListNode;
+						currentListNode = null;
+					}
+				}
+			}
+
+			function filterStyles(node, styleValue) {
+				var outputStyles = {}, matches, styles = editor.dom.parseStyle(styleValue);
+
+				Tools.each(styles, function(value, name) {
+					// Convert various MS styles to W3C styles
+					switch (name) {
+						case 'mso-list':
+							// Parse out list indent level for lists
+							matches = /\w+ \w+([0-9]+)/i.exec(styleValue);
+							if (matches) {
+								node._listLevel = parseInt(matches[1], 10);
+							}
+
+							// Remove these nodes <span style="mso-list:Ignore">o</span>
+							// Since the span gets removed we mark the text node and the span
+							if (/Ignore/i.test(value) && node.firstChild) {
+								node._listIgnore = true;
+								node.firstChild._listIgnore = true;
+							}
+
+							break;
+
+						case "horiz-align":
+							name = "text-align";
+							break;
+
+						case "vert-align":
+							name = "vertical-align";
+							break;
+
+						case "font-color":
+						case "mso-foreground":
+							name = "color";
+							break;
+
+						case "mso-background":
+						case "mso-highlight":
+							name = "background";
+							break;
+
+						case "font-weight":
+						case "font-style":
+							if (value != "normal") {
+								outputStyles[name] = value;
+							}
+							return;
+
+						case "mso-element":
+							// Remove track changes code
+							if (/^(comment|comment-list)$/i.test(value)) {
+								node.remove();
+								return;
+							}
+
+							break;
+					}
+
+					if (name.indexOf('mso-comment') === 0) {
+						node.remove();
+						return;
+					}
+
+					// Never allow mso- prefixed names
+					if (name.indexOf('mso-') === 0) {
+						return;
+					}
+
+					// Output only valid styles
+					if (retainStyleProperties == "all" || (validStyles && validStyles[name])) {
+						outputStyles[name] = value;
+					}
+				});
+
+				// Convert bold style to "b" element
+				if (/(bold)/i.test(outputStyles["font-weight"])) {
+					delete outputStyles["font-weight"];
+					node.wrap(new Node("b", 1));
+				}
+
+				// Convert italic style to "i" element
+				if (/(italic)/i.test(outputStyles["font-style"])) {
+					delete outputStyles["font-style"];
+					node.wrap(new Node("i", 1));
+				}
+
+				// Serialize the styles and see if there is something left to keep
+				outputStyles = editor.dom.serializeStyle(outputStyles, node.name);
+				if (outputStyles) {
+					return outputStyles;
+				}
+
+				return null;
+			}
+
+			if (settings.paste_enable_default_filters === false) {
+				return;
+			}
+
+			// Detect is the contents is Word junk HTML
+			if (isWordContent(e.content)) {
+				e.wordContent = true; // Mark it for other processors
+
+				// Remove basic Word junk
+				content = Utils.filter(content, [
+					// Word comments like conditional comments etc
+					/<!--[\s\S]+?-->/gi,
+
+					// Remove comments, scripts (e.g., msoShowComment), XML tag, VML content,
+					// MS Office namespaced tags, and a few other tags
+					/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,
+
+					// Convert <s> into <strike> for line-though
+					[/<(\/?)s>/gi, "<$1strike>"],
+
+					// Replace nsbp entites to char since it's easier to handle
+					[/&nbsp;/gi, "\u00a0"],
+
+					// Convert <span style="mso-spacerun:yes">___</span> to string of alternating
+					// breaking/non-breaking spaces of same length
+					[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,
+						function(str, spaces) {
+							return (spaces.length > 0) ?
+								spaces.replace(/./, " ").slice(Math.floor(spaces.length / 2)).split("").join("\u00a0") : "";
+						}
+					]
+				]);
+
+				var validElements = settings.paste_word_valid_elements;
+				if (!validElements) {
+					validElements = (
+						'-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,' +
+						'-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,' +
+						'td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody'
+					);
+				}
+
+				// Setup strict schema
+				var schema = new Schema({
+					valid_elements: validElements,
+					valid_children: '-li[p]'
+				});
+
+				// Add style/class attribute to all element rules since the user might have removed them from
+				// paste_word_valid_elements config option and we need to check them for properties
+				Tools.each(schema.elements, function(rule) {
+					/*eslint dot-notation:0*/
+					if (!rule.attributes["class"]) {
+						rule.attributes["class"] = {};
+						rule.attributesOrder.push("class");
+					}
+
+					if (!rule.attributes.style) {
+						rule.attributes.style = {};
+						rule.attributesOrder.push("style");
+					}
+				});
+
+				// Parse HTML into DOM structure
+				var domParser = new DomParser({}, schema);
+
+				// Filter styles to remove "mso" specific styles and convert some of them
+				domParser.addAttributeFilter('style', function(nodes) {
+					var i = nodes.length, node;
+
+					while (i--) {
+						node = nodes[i];
+						node.attr('style', filterStyles(node, node.attr('style')));
+
+						// Remove pointess spans
+						if (node.name == 'span' && node.parent && !node.attributes.length) {
+							node.unwrap();
+						}
+					}
+				});
+
+				// Check the class attribute for comments or del items and remove those
+				domParser.addAttributeFilter('class', function(nodes) {
+					var i = nodes.length, node, className;
+
+					while (i--) {
+						node = nodes[i];
+
+						className = node.attr('class');
+						if (/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(className)) {
+							node.remove();
+						}
+
+						node.attr('class', null);
+					}
+				});
+
+				// Remove all del elements since we don't want the track changes code in the editor
+				domParser.addNodeFilter('del', function(nodes) {
+					var i = nodes.length;
+
+					while (i--) {
+						nodes[i].remove();
+					}
+				});
+
+				// Keep some of the links and anchors
+				domParser.addNodeFilter('a', function(nodes) {
+					var i = nodes.length, node, href, name;
+
+					while (i--) {
+						node = nodes[i];
+						href = node.attr('href');
+						name = node.attr('name');
+
+						if (href && href.indexOf('#_msocom_') != -1) {
+							node.remove();
+							continue;
+						}
+
+						if (href && href.indexOf('file://') === 0) {
+							href = href.split('#')[1];
+							if (href) {
+								href = '#' + href;
+							}
+						}
+
+						if (!href && !name) {
+							node.unwrap();
+						} else {
+							// Remove all named anchors that aren't specific to TOC, Footnotes or Endnotes
+							if (name && !/^_?(?:toc|edn|ftn)/i.test(name)) {
+								node.unwrap();
+								continue;
+							}
+
+							node.attr({
+								href: href,
+								name: name
+							});
+						}
+					}
+				});
+
+				// Parse into DOM structure
+				var rootNode = domParser.parse(content);
+
+				// Process DOM
+				if (settings.paste_convert_word_fake_lists !== false) {
+					convertFakeListsToProperLists(rootNode);
+				}
+
+				// Serialize DOM back to HTML
+				e.content = new Serializer({}, schema).serialize(rootNode);
+			}
+		});
+	}
+
+	WordFilter.isWordContent = isWordContent;
+
+	return WordFilter;
+});
+
+// Included from: js/tinymce/plugins/paste/classes/Quirks.js
+
+/**
+ * Quirks.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class contains various fixes for browsers. These issues can not be feature
+ * detected since we have no direct control over the clipboard. However we might be able
+ * to remove some of these fixes once the browsers gets updated/fixed.
+ *
+ * @class tinymce.pasteplugin.Quirks
+ * @private
+ */
+define("tinymce/pasteplugin/Quirks", [
+	"tinymce/Env",
+	"tinymce/util/Tools",
+	"tinymce/pasteplugin/WordFilter",
+	"tinymce/pasteplugin/Utils"
+], function(Env, Tools, WordFilter, Utils) {
+	"use strict";
+
+	return function(editor) {
+		function addPreProcessFilter(filterFunc) {
+			editor.on('BeforePastePreProcess', function(e) {
+				e.content = filterFunc(e.content);
+			});
+		}
+
+		/**
+		 * Removes BR elements after block elements. IE9 has a nasty bug where it puts a BR element after each
+		 * block element when pasting from word. This removes those elements.
+		 *
+		 * This:
+		 *  <p>a</p><br><p>b</p>
+		 *
+		 * Becomes:
+		 *  <p>a</p><p>b</p>
+		 */
+		function removeExplorerBrElementsAfterBlocks(html) {
+			// Only filter word specific content
+			if (!WordFilter.isWordContent(html)) {
+				return html;
+			}
+
+			// Produce block regexp based on the block elements in schema
+			var blockElements = [];
+
+			Tools.each(editor.schema.getBlockElements(), function(block, blockName) {
+				blockElements.push(blockName);
+			});
+
+			var explorerBlocksRegExp = new RegExp(
+				'(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*(<\\/?(' + blockElements.join('|') + ')[^>]*>)(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*',
+				'g'
+			);
+
+			// Remove BR:s from: <BLOCK>X</BLOCK><BR>
+			html = Utils.filter(html, [
+				[explorerBlocksRegExp, '$1']
+			]);
+
+			// IE9 also adds an extra BR element for each soft-linefeed and it also adds a BR for each word wrap break
+			html = Utils.filter(html, [
+				[/<br><br>/g, '<BR><BR>'], // Replace multiple BR elements with uppercase BR to keep them intact
+				[/<br>/g, ' '],            // Replace single br elements with space since they are word wrap BR:s
+				[/<BR><BR>/g, '<br>']      // Replace back the double brs but into a single BR
+			]);
+
+			return html;
+		}
+
+		/**
+		 * WebKit has a nasty bug where the all computed styles gets added to style attributes when copy/pasting contents.
+		 * This fix solves that by simply removing the whole style attribute.
+		 *
+		 * The paste_webkit_styles option can be set to specify what to keep:
+		 *  paste_webkit_styles: "none" // Keep no styles
+		 *  paste_webkit_styles: "all", // Keep all of them
+		 *  paste_webkit_styles: "font-weight color" // Keep specific ones
+		 *
+		 * @param {String} content Content that needs to be processed.
+		 * @return {String} Processed contents.
+		 */
+		function removeWebKitStyles(content) {
+			// Passthrough all styles from Word and let the WordFilter handle that junk
+			if (WordFilter.isWordContent(content)) {
+				return content;
+			}
+
+			// Filter away styles that isn't matching the target node
+			var webKitStyles = editor.settings.paste_webkit_styles;
+
+			if (editor.settings.paste_remove_styles_if_webkit === false || webKitStyles == "all") {
+				return content;
+			}
+
+			if (webKitStyles) {
+				webKitStyles = webKitStyles.split(/[, ]/);
+			}
+
+			// Keep specific styles that doesn't match the current node computed style
+			if (webKitStyles) {
+				var dom = editor.dom, node = editor.selection.getNode();
+
+				content = content.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi, function(all, before, value, after) {
+					var inputStyles = dom.parseStyle(value, 'span'), outputStyles = {};
+
+					if (webKitStyles === "none") {
+						return before + after;
+					}
+
+					for (var i = 0; i < webKitStyles.length; i++) {
+						var inputValue = inputStyles[webKitStyles[i]], currentValue = dom.getStyle(node, webKitStyles[i], true);
+
+						if (/color/.test(webKitStyles[i])) {
+							inputValue = dom.toHex(inputValue);
+							currentValue = dom.toHex(currentValue);
+						}
+
+						if (currentValue != inputValue) {
+							outputStyles[webKitStyles[i]] = inputValue;
+						}
+					}
+
+					outputStyles = dom.serializeStyle(outputStyles, 'span');
+					if (outputStyles) {
+						return before + ' style="' + outputStyles + '"' + after;
+					}
+
+					return before + after;
+				});
+			} else {
+				// Remove all external styles
+				content = content.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi, '$1$3');
+			}
+
+			// Keep internal styles
+			content = content.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi, function(all, before, value, after) {
+				return before + ' style="' + value + '"' + after;
+			});
+
+			return content;
+		}
+
+		// Sniff browsers and apply fixes since we can't feature detect
+		if (Env.webkit) {
+			addPreProcessFilter(removeWebKitStyles);
+		}
+
+		if (Env.ie) {
+			addPreProcessFilter(removeExplorerBrElementsAfterBlocks);
+		}
+	};
+});
+
+// Included from: js/tinymce/plugins/paste/classes/Plugin.js
+
+/**
+ * Plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class contains the tinymce plugin logic for the paste plugin.
+ *
+ * @class tinymce.pasteplugin.Plugin
+ * @private
+ */
+define("tinymce/pasteplugin/Plugin", [
+	"tinymce/PluginManager",
+	"tinymce/pasteplugin/Clipboard",
+	"tinymce/pasteplugin/WordFilter",
+	"tinymce/pasteplugin/Quirks"
+], function(PluginManager, Clipboard, WordFilter, Quirks) {
+	var userIsInformed;
+
+	PluginManager.add('paste', function(editor) {
+		var self = this, clipboard, settings = editor.settings;
+
+		function togglePlainTextPaste() {
+			if (clipboard.pasteFormat == "text") {
+				this.active(false);
+				clipboard.pasteFormat = "html";
+			} else {
+				clipboard.pasteFormat = "text";
+				this.active(true);
+
+				if (!userIsInformed) {
+					editor.windowManager.alert(
+						'Paste is now in plain text mode. Contents will now ' +
+						'be pasted as plain text until you toggle this option off.'
+					);
+
+					userIsInformed = true;
+				}
+			}
+		}
+
+		self.clipboard = clipboard = new Clipboard(editor);
+		self.quirks = new Quirks(editor);
+		self.wordFilter = new WordFilter(editor);
+
+		if (editor.settings.paste_as_text) {
+			self.clipboard.pasteFormat = "text";
+		}
+
+		if (settings.paste_preprocess) {
+			editor.on('PastePreProcess', function(e) {
+				settings.paste_preprocess.call(self, self, e);
+			});
+		}
+
+		if (settings.paste_postprocess) {
+			editor.on('PastePostProcess', function(e) {
+				settings.paste_postprocess.call(self, self, e);
+			});
+		}
+
+		editor.addCommand('mceInsertClipboardContent', function(ui, value) {
+			if (value.content) {
+				self.clipboard.pasteHtml(value.content);
+			}
+
+			if (value.text) {
+				self.clipboard.pasteText(value.text);
+			}
+		});
+
+		// Block all drag/drop events
+		if (editor.paste_block_drop) {
+			editor.on('dragend dragover draggesture dragdrop drop drag', function(e) {
+				e.preventDefault();
+				e.stopPropagation();
+			});
+		}
+
+		// Prevent users from dropping data images on Gecko
+		if (!editor.settings.paste_data_images) {
+			editor.on('drop', function(e) {
+				var dataTransfer = e.dataTransfer;
+
+				if (dataTransfer && dataTransfer.files && dataTransfer.files.length > 0) {
+					e.preventDefault();
+				}
+			});
+		}
+
+		editor.addButton('pastetext', {
+			icon: 'pastetext',
+			tooltip: 'Paste as text',
+			onclick: togglePlainTextPaste,
+			active: self.clipboard.pasteFormat == "text"
+		});
+
+		editor.addMenuItem('pastetext', {
+			text: 'Paste as text',
+			selectable: true,
+			active: clipboard.pasteFormat,
+			onclick: togglePlainTextPaste
+		});
+	});
+});
+
+expose(["tinymce/pasteplugin/Utils"]);
+})(this);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/paste/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+(function(b,g){var d={};function c(m,n){var l,j=[];for(var k=0;k<m.length;++k){l=d[m[k]]||e(m[k]);if(!l){throw"module definition dependecy not found: "+m[k]}j.push(l)}n.apply(null,j)}function h(k,j,i){if(typeof k!=="string"){throw"invalid module definition, module id must be defined and be a string"}if(j===g){throw"invalid module definition, dependencies must be specified"}if(i===g){throw"invalid module definition, definition function must be specified"}c(j,function(){d[k]=i.apply(null,arguments)})}function f(i){return !!d[i]}function e(l){var j=b;var i=l.split(/[.\/]/);for(var k=0;k<i.length;++k){if(!j[i[k]]){return}j=j[i[k]]}return j}function a(l){for(var k=0;k<l.length;k++){var m=b;var o=l[k];var j=o.split(/[.\/]/);for(var n=0;n<j.length-1;++n){if(m[j[n]]===g){m[j[n]]={}}m=m[j[n]]}m[j[j.length-1]]=d[o]}}h("tinymce/pasteplugin/Utils",["tinymce/util/Tools","tinymce/html/DomParser","tinymce/html/Schema"],function(i,n,l){function k(p,o){i.each(o,function(q){if(q.constructor==RegExp){p=p.replace(q,"")}else{p=p.replace(q[0],q[1])}});return p}function m(r){var t=new l(),v=new n({},t),u="";var q=t.getShortEndedElements();var p=i.makeMap("script noscript style textarea video audio iframe object"," ");var s=t.getBlockElements();function o(y){var w=y.name,x=y;if(w==="br"){u+="\n";return}if(q[w]){u+=" "}if(p[w]){u+=" ";return}if(y.type==3){u+=y.value}if(!y.shortEnded){if((y=y.firstChild)){do{o(y)}while((y=y.next))}}if(s[w]&&x.next){u+="\n";if(w=="p"){u+="\n"}}}r=k(r,[/<!\[[^\]]+\]>/g]);o(v.parse(r));return u}function j(o){function p(s,r,q){if(!r&&!q){return" "}return"\u00a0"}o=k(o,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,p],/<br>$/i]);return o}return{filter:k,innerText:m,trimHtml:j}});h("tinymce/pasteplugin/Clipboard",["tinymce/Env","tinymce/dom/RangeUtils","tinymce/util/VK","tinymce/pasteplugin/Utils"],function(i,j,l,k){return function(q){var y=this,o,D,n=0,C=false;var r="%MCEPASTEBIN%",E;var s="data:text/mce-internal,";function A(K){var J,L=q.dom;J=q.fire("BeforePastePreProcess",{content:K});J=q.fire("PastePreProcess",J);K=J.content;if(!J.isDefaultPrevented()){if(q.hasEventListeners("PastePostProcess")&&!J.isDefaultPrevented()){var I=L.add(q.getBody(),"div",{style:"display:none"},K);J=q.fire("PastePostProcess",{node:I});L.remove(I);K=J.node.innerHTML}if(!J.isDefaultPrevented()){q.insertContent(K,{merge:q.settings.paste_merge_formats!==false})}}}function B(L){L=q.dom.encode(L).replace(/\r\n/g,"\n");var J=q.dom.getParent(q.selection.getStart(),q.dom.isBlock);var I=q.settings.forced_root_block;var K;if(I){K=q.dom.createHTML(I,q.settings.forced_root_block_attrs);K=K.substr(0,K.length-3)+">"}if((J&&/^(PRE|DIV)$/.test(J.nodeName))||!I){L=k.filter(L,[[/\n/g,"<br>"]])}else{L=k.filter(L,[[/\n\n/g,"</p>"+K],[/^(.*<\/p>)(<p>)$/,K+"$1"],[/\n/g,"<br />"]]);if(L.indexOf("<p>")!=-1){L=K+L}}A(L)}function t(){var K=q.dom,L=q.getBody();var M=q.dom.getViewPort(q.getWin()),J=M.y,O=20;var Q;D=q.selection.getRng();if(q.inline){Q=q.selection.getScrollContainer();if(Q&&Q.scrollTop>0){J=Q.scrollTop}}function N(S){var T,V,U,R=S.startContainer;T=S.getClientRects();if(T.length){return T[0]}if(!S.collapsed||R.nodeType!=1){return}U=R.childNodes[D.startOffset];while(U&&U.nodeType==3&&!U.data.length){U=U.nextSibling}if(!U){return}if(U.tagName=="BR"){V=K.doc.createTextNode("\uFEFF");U.parentNode.insertBefore(V,U);S=K.createRng();S.setStartBefore(V);S.setEndAfter(V);T=S.getClientRects();K.remove(V)}if(T.length){return T[0]}}if(D.getClientRects){var P=N(D);if(P){O=J+(P.top-K.getPos(L).y)}else{O=J;var I=D.startContainer;if(I){if(I.nodeType==3&&I.parentNode!=L){I=I.parentNode}if(I.nodeType==1){O=K.getPos(I,Q||L).y}}}}o=K.add(q.getBody(),"div",{id:"mcepastebin",contentEditable:true,"data-mce-bogus":"all",style:"position: absolute; top: "+O+"px;width: 10px; height: 10px; overflow: hidden; opacity: 0"},r);if(i.ie||i.gecko){K.setStyle(o,"left",K.getStyle(L,"direction",true)=="rtl"?65535:-65535)}K.bind(o,"beforedeactivate focusin focusout",function(R){R.stopPropagation()});o.focus();q.selection.select(o,true)}function H(){if(o){var I;while((I=q.dom.get("mcepastebin"))){q.dom.remove(I);q.dom.unbind(I)}if(D){q.selection.setRng(D)}}o=D=null}function G(){var L="",J,K,M,I;J=q.dom.select("div[id=mcepastebin]");for(K=0;K<J.length;K++){M=J[K];if(M.firstChild&&M.firstChild.id=="mcepastebin"){M=M.firstChild}I=M.innerHTML;if(L!=r){L+=I}}return L}function v(K){var J={};if(K){if(K.getData){var M=K.getData("Text");if(M&&M.length>0){if(M.indexOf(s)==-1){J["text/plain"]=M}}}if(K.types){for(var I=0;I<K.types.length;I++){var L=K.types[I];J[L]=K.getData(L)}}}return J}function w(I){return v(I.clipboardData||q.getDoc().dataTransfer)}function u(L,J){var K=L.clipboardData||L.dataTransfer;function I(N){var P,Q,M,R=false;function O(S){if(J){q.selection.setRng(J);J=null}A('<img src="'+S.result+'">')}if(N){for(P=0;P<N.length;P++){Q=N[P];if(/^image\/(jpeg|png|gif|bmp)$/.test(Q.type)){M=new FileReader();M.onload=O.bind(null,M);M.readAsDataURL(Q.getAsFile?Q.getAsFile():Q);L.preventDefault();R=true}}}return R}if(q.settings.paste_data_images&&K){return I(K.items)||I(K.files)}}function z(I){var J=I.clipboardData;return navigator.userAgent.indexOf("Android")!=-1&&J&&J.items&&J.items.length===0}function m(I){return j.getCaretRangeFromPoint(I.clientX,I.clientY,q.getDoc())}function x(I,J){return J in I&&I[J].length>0}function F(I){return(l.metaKeyPressed(I)&&I.keyCode==86)||(I.shiftKey&&I.keyCode==45)}function p(){q.on("keydown",function(I){function J(K){if(F(K)&&!K.isDefaultPrevented()){H()}}if(F(I)&&!I.isDefaultPrevented()){E=I.shiftKey&&I.keyCode==86;if(E&&i.webkit&&navigator.userAgent.indexOf("Version/")!=-1){return}I.stopImmediatePropagation();n=new Date().getTime();if(i.ie&&E){I.preventDefault();q.fire("paste",{ieFake:true});return}H();t();q.once("keyup",J);q.once("paste",function(){q.off("keyup",J)})}});q.on("paste",function(M){var N=new Date().getTime();var L=w(M);var J=new Date().getTime()-N;var I=(new Date().getTime()-n-J)<1000;var K=y.pasteFormat=="text"||E;E=false;if(M.isDefaultPrevented()||z(M)){H();return}if(u(M)){H();return}if(!I){M.preventDefault()}if(i.ie&&(!I||M.ieFake)){t();q.dom.bind(o,"paste",function(O){O.stopPropagation()});q.getDoc().execCommand("Paste",false,null);L["text/html"]=G()}setTimeout(function(){var O;if(x(L,"text/html")){O=L["text/html"]}else{O=G();if(O==r){K=true}}O=k.trimHtml(O);if(o&&o.firstChild&&o.firstChild.id==="mcepastebin"){K=true}H();if(!O.length){K=true}if(K){if(x(L,"text/plain")&&O.indexOf("</p>")==-1){O=L["text/plain"]}else{O=k.innerText(O)}}if(O==r){if(!I){q.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.")}return}if(K){B(O)}else{A(O)}},0)});q.on("dragstart dragend",function(I){C=I.type=="dragstart"});q.on("drop",function(L){var I=m(L);if(L.isDefaultPrevented()||C){return}if(u(L,I)){return}if(I&&q.settings.paste_filter_drop!==false){var J=v(L.dataTransfer);var K=J["mce-internal"]||J["text/html"]||J["text/plain"];if(K){L.preventDefault();q.undoManager.transact(function(){if(J["mce-internal"]){q.execCommand("Delete")}q.selection.setRng(I);K=k.trimHtml(K);if(!J["text/html"]){B(K)}else{A(K)}})}}});q.on("dragover dragend",function(I){if(q.settings.paste_data_images){I.preventDefault()}})}y.pasteHtml=A;y.pasteText=B;q.on("preInit",function(){p();q.parser.addNodeFilter("img",function(I){if(!q.settings.paste_data_images){var J=I.length;while(J--){var K=I[J].attributes.map.src;if(K&&/^(data:image|webkit\-fake\-url)/.test(K)){if(!I[J].attr("data-mce-object")&&K!==i.transparentSrc){I[J].remove()}}}}})})}});h("tinymce/pasteplugin/WordFilter",["tinymce/util/Tools","tinymce/html/DomParser","tinymce/html/Schema","tinymce/html/Serializer","tinymce/html/Node","tinymce/pasteplugin/Utils"],function(i,r,l,n,m,k){function q(s){return((/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i).test(s)||(/class="OutlineElement/).test(s)||(/id="?docs\-internal\-guid\-/.test(s)))}function j(u){var t,s;s=[/^[IVXLMCD]{1,2}\.[ \u00a0]/,/^[ivxlmcd]{1,2}\.[ \u00a0]/,/^[a-z]{1,2}[\.\)][ \u00a0]/,/^[A-Z]{1,2}[\.\)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/];u=u.replace(/^[\u00a0 ]+/,"");i.each(s,function(v){if(v.test(u)){t=true;return false}});return t}function o(s){return/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(s)}function p(t){var s=t.settings;t.on("BeforePastePreProcess",function(A){var C=A.content,B,x;C=C.replace(/<b[^>]+id="?docs-internal-[^>]*>/gi,"");C=C.replace(/<br class="?Apple-interchange-newline"?>/gi,"");B=s.paste_retain_style_properties;if(B){x=i.makeMap(B.split(/[, ]/))}function z(K){var H,Q,F=1;function P(T){var S="";if(T.type===3){return T.value}if((T=T.firstChild)){do{S+=P(T)}while((T=T.next))}return S}function N(T,S){if(T.type===3){if(S.test(T.value)){T.value=T.value.replace(S,"");return false}}if((T=T.firstChild)){do{if(!N(T,S)){return false}}while((T=T.next))}return true}function J(S){if(S._listIgnore){S.remove();return}if((S=S.firstChild)){do{J(S)}while((S=S.next))}}function R(S,T,V){var U=S._listLevel||F;if(U!=F){if(U<F){if(H){H=H.parent.parent}}else{Q=H;H=null}}if(!H||H.name!=T){Q=Q||H;H=new m(T,1);if(V>1){H.attr("start",""+V)}S.wrap(H)}else{H.append(S)}S.name="li";if(U>F&&Q){Q.lastChild.append(H)}F=U;J(S);N(S,/^\u00a0+/);N(S,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/);N(S,/^\u00a0+/)}var E=[],I=K.firstChild;while(typeof I!=="undefined"&&I!==null){E.push(I);I=I.walk();if(I!==null){while(typeof I!=="undefined"&&I.parent!==K){I=I.walk()}}}for(var L=0;L<E.length;L++){K=E[L];if(K.name=="p"&&K.firstChild){var O=P(K);if(o(O)){R(K,"ul");continue}if(j(O)){var M=/([0-9]+)\./.exec(O);var G=1;if(M){G=parseInt(M[1],10)}R(K,"ol",G);continue}if(K._listLevel){R(K,"ul",1);continue}H=null}else{Q=H;H=null}}}function u(G,E){var I={},H,F=t.dom.parseStyle(E);i.each(F,function(K,J){switch(J){case"mso-list":H=/\w+ \w+([0-9]+)/i.exec(E);if(H){G._listLevel=parseInt(H[1],10)}if(/Ignore/i.test(K)&&G.firstChild){G._listIgnore=true;G.firstChild._listIgnore=true}break;case"horiz-align":J="text-align";break;case"vert-align":J="vertical-align";break;case"font-color":case"mso-foreground":J="color";break;case"mso-background":case"mso-highlight":J="background";break;case"font-weight":case"font-style":if(K!="normal"){I[J]=K}return;case"mso-element":if(/^(comment|comment-list)$/i.test(K)){G.remove();return}break}if(J.indexOf("mso-comment")===0){G.remove();return}if(J.indexOf("mso-")===0){return}if(B=="all"||(x&&x[J])){I[J]=K}});if(/(bold)/i.test(I["font-weight"])){delete I["font-weight"];G.wrap(new m("b",1))}if(/(italic)/i.test(I["font-style"])){delete I["font-style"];G.wrap(new m("i",1))}I=t.dom.serializeStyle(I,G.name);if(I){return I}return null}if(s.paste_enable_default_filters===false){return}if(q(A.content)){A.wordContent=true;C=k.filter(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(F,E){return(E.length>0)?E.replace(/./," ").slice(Math.floor(E.length/2)).split("").join("\u00a0"):""}]]);var v=s.paste_word_valid_elements;if(!v){v=("-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody")}var y=new l({valid_elements:v,valid_children:"-li[p]"});i.each(y.elements,function(E){if(!E.attributes["class"]){E.attributes["class"]={};E.attributesOrder.push("class")}if(!E.attributes.style){E.attributes.style={};E.attributesOrder.push("style")}});var D=new r({},y);D.addAttributeFilter("style",function(E){var F=E.length,G;while(F--){G=E[F];G.attr("style",u(G,G.attr("style")));if(G.name=="span"&&G.parent&&!G.attributes.length){G.unwrap()}}});D.addAttributeFilter("class",function(E){var F=E.length,H,G;while(F--){H=E[F];G=H.attr("class");if(/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(G)){H.remove()}H.attr("class",null)}});D.addNodeFilter("del",function(E){var F=E.length;while(F--){E[F].remove()}});D.addNodeFilter("a",function(F){var H=F.length,I,E,G;while(H--){I=F[H];E=I.attr("href");G=I.attr("name");if(E&&E.indexOf("#_msocom_")!=-1){I.remove();continue}if(E&&E.indexOf("file://")===0){E=E.split("#")[1];if(E){E="#"+E}}if(!E&&!G){I.unwrap()}else{if(G&&!/^_?(?:toc|edn|ftn)/i.test(G)){I.unwrap();continue}I.attr({href:E,name:G})}}});var w=D.parse(C);if(s.paste_convert_word_fake_lists!==false){z(w)}A.content=new n({},y).serialize(w)}})}p.isWordContent=q;return p});h("tinymce/pasteplugin/Quirks",["tinymce/Env","tinymce/util/Tools","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Utils"],function(i,j,l,k){return function(o){function p(q){o.on("BeforePastePreProcess",function(r){r.content=q(r.content)})}function n(q){if(!l.isWordContent(q)){return q}var r=[];j.each(o.schema.getBlockElements(),function(u,t){r.push(t)});var s=new RegExp("(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*(<\\/?("+r.join("|")+")[^>]*>)(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*","g");q=k.filter(q,[[s,"$1"]]);q=k.filter(q,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]]);return q}function m(s){if(l.isWordContent(s)){return s}var q=o.settings.paste_webkit_styles;if(o.settings.paste_remove_styles_if_webkit===false||q=="all"){return s}if(q){q=q.split(/[, ]/)}if(q){var t=o.dom,r=o.selection.getNode();s=s.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(B,z,A,u){var v=t.parseStyle(A,"span"),y={};if(q==="none"){return z+u}for(var x=0;x<q.length;x++){var w=v[q[x]],C=t.getStyle(r,q[x],true);if(/color/.test(q[x])){w=t.toHex(w);C=t.toHex(C)}if(C!=w){y[q[x]]=w}}y=t.serializeStyle(y,"span");if(y){return z+' style="'+y+'"'+u}return z+u})}else{s=s.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3")}s=s.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(u,w,v,x){return w+' style="'+v+'"'+x});return s}if(i.webkit){p(m)}if(i.ie){p(n)}}});h("tinymce/pasteplugin/Plugin",["tinymce/PluginManager","tinymce/pasteplugin/Clipboard","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Quirks"],function(i,m,l,j){var k;i.add("paste",function(q){var o=this,r,p=q.settings;function n(){if(r.pasteFormat=="text"){this.active(false);r.pasteFormat="html"}else{r.pasteFormat="text";this.active(true);if(!k){q.windowManager.alert("Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.");k=true}}}o.clipboard=r=new m(q);o.quirks=new j(q);o.wordFilter=new l(q);if(q.settings.paste_as_text){o.clipboard.pasteFormat="text"}if(p.paste_preprocess){q.on("PastePreProcess",function(s){p.paste_preprocess.call(o,o,s)})}if(p.paste_postprocess){q.on("PastePostProcess",function(s){p.paste_postprocess.call(o,o,s)})}q.addCommand("mceInsertClipboardContent",function(t,s){if(s.content){o.clipboard.pasteHtml(s.content)}if(s.text){o.clipboard.pasteText(s.text)}});if(q.paste_block_drop){q.on("dragend dragover draggesture dragdrop drop drag",function(s){s.preventDefault();s.stopPropagation()})}if(!q.settings.paste_data_images){q.on("drop",function(t){var s=t.dataTransfer;if(s&&s.files&&s.files.length>0){t.preventDefault()}})}q.addButton("pastetext",{icon:"pastetext",tooltip:"Paste as text",onclick:n,active:o.clipboard.pasteFormat=="text"});q.addMenuItem("pastetext",{text:"Paste as text",selectable:true,active:r.pasteFormat,onclick:n})})});a(["tinymce/pasteplugin/Utils"])})(this);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/preview/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,88 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('preview', function(editor) {
+	var settings = editor.settings, sandbox = !tinymce.Env.ie;
+
+	editor.addCommand('mcePreview', function() {
+		editor.windowManager.open({
+			title: 'Preview',
+			width: parseInt(editor.getParam("plugin_preview_width", "650"), 10),
+			height: parseInt(editor.getParam("plugin_preview_height", "500"), 10),
+			html: '<iframe src="javascript:\'\'" frameborder="0"' + (sandbox ? ' sandbox="allow-scripts"' : '') + '></iframe>',
+			buttons: {
+				text: 'Close',
+				onclick: function() {
+					this.parent().parent().close();
+				}
+			},
+			onPostRender: function() {
+				var previewHtml, headHtml = '';
+
+				headHtml += '<base href="' + editor.documentBaseURI.getURI() + '">';
+
+				tinymce.each(editor.contentCSS, function(url) {
+					headHtml += '<link type="text/css" rel="stylesheet" href="' + editor.documentBaseURI.toAbsolute(url) + '">';
+				});
+
+				var bodyId = settings.body_id || 'tinymce';
+				if (bodyId.indexOf('=') != -1) {
+					bodyId = editor.getParam('body_id', '', 'hash');
+					bodyId = bodyId[editor.id] || bodyId;
+				}
+
+				var bodyClass = settings.body_class || '';
+				if (bodyClass.indexOf('=') != -1) {
+					bodyClass = editor.getParam('body_class', '', 'hash');
+					bodyClass = bodyClass[editor.id] || '';
+				}
+
+				var dirAttr = editor.settings.directionality ? ' dir="' + editor.settings.directionality + '"' : '';
+
+				previewHtml = (
+					'<!DOCTYPE html>' +
+					'<html>' +
+					'<head>' +
+						headHtml +
+					'</head>' +
+					'<body id="' + bodyId + '" class="mce-content-body ' + bodyClass + '"' + dirAttr + '>' +
+						editor.getContent() +
+					'</body>' +
+					'</html>'
+				);
+
+				if (!sandbox) {
+					// IE 6-11 doesn't support data uris on iframes
+					// so I guess they will have to be less secure since we can't sandbox on those
+					// TODO: Use sandbox if future versions of IE supports iframes with data: uris.
+					var doc = this.getEl('body').firstChild.contentWindow.document;
+					doc.open();
+					doc.write(previewHtml);
+					doc.close();
+				} else {
+					this.getEl('body').firstChild.src = 'data:text/html;charset=utf-8,' + encodeURIComponent(previewHtml);
+				}
+			}
+		});
+	});
+
+	editor.addButton('preview', {
+		title: 'Preview',
+		cmd: 'mcePreview'
+	});
+
+	editor.addMenuItem('preview', {
+		text: 'Preview',
+		cmd: 'mcePreview',
+		context: 'view'
+	});
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/preview/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("preview",function(c){var b=c.settings,a=!tinymce.Env.ie;c.addCommand("mcePreview",function(){c.windowManager.open({title:"Preview",width:parseInt(c.getParam("plugin_preview_width","650"),10),height:parseInt(c.getParam("plugin_preview_height","500"),10),html:'<iframe src="javascript:\'\'" frameborder="0"'+(a?' sandbox="allow-scripts"':"")+"></iframe>",buttons:{text:"Close",onclick:function(){this.parent().parent().close()}},onPostRender:function(){var d,g="";g+='<base href="'+c.documentBaseURI.getURI()+'">';tinymce.each(c.contentCSS,function(j){g+='<link type="text/css" rel="stylesheet" href="'+c.documentBaseURI.toAbsolute(j)+'">'});var h=b.body_id||"tinymce";if(h.indexOf("=")!=-1){h=c.getParam("body_id","","hash");h=h[c.id]||h}var f=b.body_class||"";if(f.indexOf("=")!=-1){f=c.getParam("body_class","","hash");f=f[c.id]||""}var e=c.settings.directionality?' dir="'+c.settings.directionality+'"':"";d=("<!DOCTYPE html><html><head>"+g+'</head><body id="'+h+'" class="mce-content-body '+f+'"'+e+">"+c.getContent()+"</body></html>");if(!a){var i=this.getEl("body").firstChild.contentWindow.document;i.open();i.write(d);i.close()}else{this.getEl("body").firstChild.src="data:text/html;charset=utf-8,"+encodeURIComponent(d)}}})});c.addButton("preview",{title:"Preview",cmd:"mcePreview"});c.addMenuItem("preview",{text:"Preview",cmd:"mcePreview",context:"view"})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/print/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,32 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('print', function(editor) {
+	editor.addCommand('mcePrint', function() {
+		editor.getWin().print();
+	});
+
+	editor.addButton('print', {
+		title: 'Print',
+		cmd: 'mcePrint'
+	});
+
+	editor.addShortcut('Meta+P', '', 'mcePrint');
+
+	editor.addMenuItem('print', {
+		text: 'Print',
+		cmd: 'mcePrint',
+		icon: 'print',
+		shortcut: 'Meta+P',
+		context: 'file'
+	});
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/print/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("print",function(a){a.addCommand("mcePrint",function(){a.getWin().print()});a.addButton("print",{title:"Print",cmd:"mcePrint"});a.addShortcut("Meta+P","","mcePrint");a.addMenuItem("print",{text:"Print",cmd:"mcePrint",icon:"print",shortcut:"Meta+P",context:"file"})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/save/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,94 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('save', function(editor) {
+	function save() {
+		var formObj;
+
+		formObj = tinymce.DOM.getParent(editor.id, 'form');
+
+		if (editor.getParam("save_enablewhendirty", true) && !editor.isDirty()) {
+			return;
+		}
+
+		tinymce.triggerSave();
+
+		// Use callback instead
+		if (editor.getParam("save_onsavecallback")) {
+			if (editor.execCallback('save_onsavecallback', editor)) {
+				editor.startContent = tinymce.trim(editor.getContent({format: 'raw'}));
+				editor.nodeChanged();
+			}
+
+			return;
+		}
+
+		if (formObj) {
+			editor.isNotDirty = true;
+
+			if (!formObj.onsubmit || formObj.onsubmit()) {
+				if (typeof formObj.submit == "function") {
+					formObj.submit();
+				} else {
+					editor.windowManager.alert("Error: Form submit field collision.");
+				}
+			}
+
+			editor.nodeChanged();
+		} else {
+			editor.windowManager.alert("Error: No form element found.");
+		}
+	}
+
+	function cancel() {
+		var h = tinymce.trim(editor.startContent);
+
+		// Use callback instead
+		if (editor.getParam("save_oncancelcallback")) {
+			editor.execCallback('save_oncancelcallback', editor);
+			return;
+		}
+
+		editor.setContent(h);
+		editor.undoManager.clear();
+		editor.nodeChanged();
+	}
+
+	function stateToggle() {
+		var self = this;
+
+		editor.on('nodeChange', function() {
+			self.disabled(editor.getParam("save_enablewhendirty", true) && !editor.isDirty());
+		});
+	}
+
+	editor.addCommand('mceSave', save);
+	editor.addCommand('mceCancel', cancel);
+
+	editor.addButton('save', {
+		icon: 'save',
+		text: 'Save',
+		cmd: 'mceSave',
+		disabled: true,
+		onPostRender: stateToggle
+	});
+
+	editor.addButton('cancel', {
+		text: 'Cancel',
+		icon: false,
+		cmd: 'mceCancel',
+		disabled: true,
+		onPostRender: stateToggle
+	});
+
+	editor.addShortcut('Meta+S', '', 'mceSave');
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/save/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("save",function(b){function d(){var e;e=tinymce.DOM.getParent(b.id,"form");if(b.getParam("save_enablewhendirty",true)&&!b.isDirty()){return}tinymce.triggerSave();if(b.getParam("save_onsavecallback")){if(b.execCallback("save_onsavecallback",b)){b.startContent=tinymce.trim(b.getContent({format:"raw"}));b.nodeChanged()}return}if(e){b.isNotDirty=true;if(!e.onsubmit||e.onsubmit()){if(typeof e.submit=="function"){e.submit()}else{b.windowManager.alert("Error: Form submit field collision.")}}b.nodeChanged()}else{b.windowManager.alert("Error: No form element found.")}}function c(){var e=tinymce.trim(b.startContent);if(b.getParam("save_oncancelcallback")){b.execCallback("save_oncancelcallback",b);return}b.setContent(e);b.undoManager.clear();b.nodeChanged()}function a(){var e=this;b.on("nodeChange",function(){e.disabled(b.getParam("save_enablewhendirty",true)&&!b.isDirty())})}b.addCommand("mceSave",d);b.addCommand("mceCancel",c);b.addButton("save",{icon:"save",text:"Save",cmd:"mceSave",disabled:true,onPostRender:a});b.addButton("cancel",{text:"Cancel",icon:false,cmd:"mceCancel",disabled:true,onPostRender:a});b.addShortcut("Meta+S","","mceSave")});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/searchreplace/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,594 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*jshint smarttabs:true, undef:true, unused:true, latedef:true, curly:true, bitwise:true */
+/*eslint no-labels:0, no-constant-condition: 0 */
+/*global tinymce:true */
+
+(function() {
+	// Based on work developed by: James Padolsey http://james.padolsey.com
+	// released under UNLICENSE that is compatible with LGPL
+	// TODO: Handle contentEditable edgecase:
+	// <p>text<span contentEditable="false">text<span contentEditable="true">text</span>text</span>text</p>
+	function findAndReplaceDOMText(regex, node, replacementNode, captureGroup, schema) {
+		var m, matches = [], text, count = 0, doc;
+		var blockElementsMap, hiddenTextElementsMap, shortEndedElementsMap;
+
+		doc = node.ownerDocument;
+		blockElementsMap = schema.getBlockElements(); // H1-H6, P, TD etc
+		hiddenTextElementsMap = schema.getWhiteSpaceElements(); // TEXTAREA, PRE, STYLE, SCRIPT
+		shortEndedElementsMap = schema.getShortEndedElements(); // BR, IMG, INPUT
+
+		function getMatchIndexes(m, captureGroup) {
+			captureGroup = captureGroup || 0;
+
+			if (!m[0]) {
+				throw 'findAndReplaceDOMText cannot handle zero-length matches';
+			}
+
+			var index = m.index;
+
+			if (captureGroup > 0) {
+				var cg = m[captureGroup];
+
+				if (!cg) {
+					throw 'Invalid capture group';
+				}
+
+				index += m[0].indexOf(cg);
+				m[0] = cg;
+			}
+
+			return [index, index + m[0].length, [m[0]]];
+		}
+
+		function getText(node) {
+			var txt;
+
+			if (node.nodeType === 3) {
+				return node.data;
+			}
+
+			if (hiddenTextElementsMap[node.nodeName] && !blockElementsMap[node.nodeName]) {
+				return '';
+			}
+
+			txt = '';
+
+			if (blockElementsMap[node.nodeName] || shortEndedElementsMap[node.nodeName]) {
+				txt += '\n';
+			}
+
+			if ((node = node.firstChild)) {
+				do {
+					txt += getText(node);
+				} while ((node = node.nextSibling));
+			}
+
+			return txt;
+		}
+
+		function stepThroughMatches(node, matches, replaceFn) {
+			var startNode, endNode, startNodeIndex,
+				endNodeIndex, innerNodes = [], atIndex = 0, curNode = node,
+				matchLocation = matches.shift(), matchIndex = 0;
+
+			out: while (true) {
+				if (blockElementsMap[curNode.nodeName] || shortEndedElementsMap[curNode.nodeName]) {
+					atIndex++;
+				}
+
+				if (curNode.nodeType === 3) {
+					if (!endNode && curNode.length + atIndex >= matchLocation[1]) {
+						// We've found the ending
+						endNode = curNode;
+						endNodeIndex = matchLocation[1] - atIndex;
+					} else if (startNode) {
+						// Intersecting node
+						innerNodes.push(curNode);
+					}
+
+					if (!startNode && curNode.length + atIndex > matchLocation[0]) {
+						// We've found the match start
+						startNode = curNode;
+						startNodeIndex = matchLocation[0] - atIndex;
+					}
+
+					atIndex += curNode.length;
+				}
+
+				if (startNode && endNode) {
+					curNode = replaceFn({
+						startNode: startNode,
+						startNodeIndex: startNodeIndex,
+						endNode: endNode,
+						endNodeIndex: endNodeIndex,
+						innerNodes: innerNodes,
+						match: matchLocation[2],
+						matchIndex: matchIndex
+					});
+
+					// replaceFn has to return the node that replaced the endNode
+					// and then we step back so we can continue from the end of the
+					// match:
+					atIndex -= (endNode.length - endNodeIndex);
+					startNode = null;
+					endNode = null;
+					innerNodes = [];
+					matchLocation = matches.shift();
+					matchIndex++;
+
+					if (!matchLocation) {
+						break; // no more matches
+					}
+				} else if ((!hiddenTextElementsMap[curNode.nodeName] || blockElementsMap[curNode.nodeName]) && curNode.firstChild) {
+					// Move down
+					curNode = curNode.firstChild;
+					continue;
+				} else if (curNode.nextSibling) {
+					// Move forward:
+					curNode = curNode.nextSibling;
+					continue;
+				}
+
+				// Move forward or up:
+				while (true) {
+					if (curNode.nextSibling) {
+						curNode = curNode.nextSibling;
+						break;
+					} else if (curNode.parentNode !== node) {
+						curNode = curNode.parentNode;
+					} else {
+						break out;
+					}
+				}
+			}
+		}
+
+		/**
+		* Generates the actual replaceFn which splits up text nodes
+		* and inserts the replacement element.
+		*/
+		function genReplacer(nodeName) {
+			var makeReplacementNode;
+
+			if (typeof nodeName != 'function') {
+				var stencilNode = nodeName.nodeType ? nodeName : doc.createElement(nodeName);
+
+				makeReplacementNode = function(fill, matchIndex) {
+					var clone = stencilNode.cloneNode(false);
+
+					clone.setAttribute('data-mce-index', matchIndex);
+
+					if (fill) {
+						clone.appendChild(doc.createTextNode(fill));
+					}
+
+					return clone;
+				};
+			} else {
+				makeReplacementNode = nodeName;
+			}
+
+			return function(range) {
+				var before, after, parentNode, startNode = range.startNode,
+					endNode = range.endNode, matchIndex = range.matchIndex;
+
+				if (startNode === endNode) {
+					var node = startNode;
+
+					parentNode = node.parentNode;
+					if (range.startNodeIndex > 0) {
+						// Add `before` text node (before the match)
+						before = doc.createTextNode(node.data.substring(0, range.startNodeIndex));
+						parentNode.insertBefore(before, node);
+					}
+
+					// Create the replacement node:
+					var el = makeReplacementNode(range.match[0], matchIndex);
+					parentNode.insertBefore(el, node);
+					if (range.endNodeIndex < node.length) {
+						// Add `after` text node (after the match)
+						after = doc.createTextNode(node.data.substring(range.endNodeIndex));
+						parentNode.insertBefore(after, node);
+					}
+
+					node.parentNode.removeChild(node);
+
+					return el;
+				} else {
+					// Replace startNode -> [innerNodes...] -> endNode (in that order)
+					before = doc.createTextNode(startNode.data.substring(0, range.startNodeIndex));
+					after = doc.createTextNode(endNode.data.substring(range.endNodeIndex));
+					var elA = makeReplacementNode(startNode.data.substring(range.startNodeIndex), matchIndex);
+					var innerEls = [];
+
+					for (var i = 0, l = range.innerNodes.length; i < l; ++i) {
+						var innerNode = range.innerNodes[i];
+						var innerEl = makeReplacementNode(innerNode.data, matchIndex);
+						innerNode.parentNode.replaceChild(innerEl, innerNode);
+						innerEls.push(innerEl);
+					}
+
+					var elB = makeReplacementNode(endNode.data.substring(0, range.endNodeIndex), matchIndex);
+
+					parentNode = startNode.parentNode;
+					parentNode.insertBefore(before, startNode);
+					parentNode.insertBefore(elA, startNode);
+					parentNode.removeChild(startNode);
+
+					parentNode = endNode.parentNode;
+					parentNode.insertBefore(elB, endNode);
+					parentNode.insertBefore(after, endNode);
+					parentNode.removeChild(endNode);
+
+					return elB;
+				}
+			};
+		}
+
+		text = getText(node);
+		if (!text) {
+			return;
+		}
+
+		if (regex.global) {
+			while ((m = regex.exec(text))) {
+				matches.push(getMatchIndexes(m, captureGroup));
+			}
+		} else {
+			m = text.match(regex);
+			matches.push(getMatchIndexes(m, captureGroup));
+		}
+
+		if (matches.length) {
+			count = matches.length;
+			stepThroughMatches(node, matches, genReplacer(replacementNode));
+		}
+
+		return count;
+	}
+
+	function Plugin(editor) {
+		var self = this, currentIndex = -1;
+
+		function showDialog() {
+			var last = {};
+
+			function updateButtonStates() {
+				win.statusbar.find('#next').disabled(!findSpansByIndex(currentIndex + 1).length);
+				win.statusbar.find('#prev').disabled(!findSpansByIndex(currentIndex - 1).length);
+			}
+
+			function notFoundAlert() {
+				tinymce.ui.MessageBox.alert('Could not find the specified string.', function() {
+					win.find('#find')[0].focus();
+				});
+			}
+
+			var win = tinymce.ui.Factory.create({
+				type: 'window',
+				layout: "flex",
+				pack: "center",
+				align: "center",
+				onClose: function() {
+					editor.focus();
+					self.done();
+				},
+				onSubmit: function(e) {
+					var count, caseState, text, wholeWord;
+
+					e.preventDefault();
+
+					caseState = win.find('#case').checked();
+					wholeWord = win.find('#words').checked();
+
+					text = win.find('#find').value();
+					if (!text.length) {
+						self.done(false);
+						win.statusbar.items().slice(1).disabled(true);
+						return;
+					}
+
+					if (last.text == text && last.caseState == caseState && last.wholeWord == wholeWord) {
+						if (findSpansByIndex(currentIndex + 1).length === 0) {
+							notFoundAlert();
+							return;
+						}
+
+						self.next();
+						updateButtonStates();
+						return;
+					}
+
+					count = self.find(text, caseState, wholeWord);
+					if (!count) {
+						notFoundAlert();
+					}
+
+					win.statusbar.items().slice(1).disabled(count === 0);
+					updateButtonStates();
+
+					last = {
+						text: text,
+						caseState: caseState,
+						wholeWord: wholeWord
+					};
+				},
+				buttons: [
+					{text: "Find", onclick: function() {
+						win.submit();
+					}},
+					{text: "Replace", disabled: true, onclick: function() {
+						if (!self.replace(win.find('#replace').value())) {
+							win.statusbar.items().slice(1).disabled(true);
+							currentIndex = -1;
+							last = {};
+						}
+					}},
+					{text: "Replace all", disabled: true, onclick: function() {
+						self.replace(win.find('#replace').value(), true, true);
+						win.statusbar.items().slice(1).disabled(true);
+						last = {};
+					}},
+					{type: "spacer", flex: 1},
+					{text: "Prev", name: 'prev', disabled: true, onclick: function() {
+						self.prev();
+						updateButtonStates();
+					}},
+					{text: "Next", name: 'next', disabled: true, onclick: function() {
+						self.next();
+						updateButtonStates();
+					}}
+				],
+				title: "Find and replace",
+				items: {
+					type: "form",
+					padding: 20,
+					labelGap: 30,
+					spacing: 10,
+					items: [
+						{type: 'textbox', name: 'find', size: 40, label: 'Find', value: editor.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();
+		}
+
+		self.init = function(ed) {
+			ed.addMenuItem('searchreplace', {
+				text: 'Find and replace',
+				shortcut: 'Meta+F',
+				onclick: showDialog,
+				separator: 'before',
+				context: 'edit'
+			});
+
+			ed.addButton('searchreplace', {
+				tooltip: 'Find and replace',
+				shortcut: 'Meta+F',
+				onclick: showDialog
+			});
+
+			ed.addCommand("SearchReplace", showDialog);
+			ed.shortcuts.add('Meta+F', '', showDialog);
+		};
+
+		function getElmIndex(elm) {
+			var value = elm.getAttribute('data-mce-index');
+
+			if (typeof value == "number") {
+				return "" + value;
+			}
+
+			return value;
+		}
+
+		function markAllMatches(regex) {
+			var node, marker;
+
+			marker = editor.dom.create('span', {
+				"data-mce-bogus": 1
+			});
+
+			marker.className = 'mce-match-marker'; // IE 7 adds class="mce-match-marker" and class=mce-match-marker
+			node = editor.getBody();
+
+			self.done(false);
+
+			return findAndReplaceDOMText(regex, node, marker, false, editor.schema);
+		}
+
+		function unwrap(node) {
+			var parentNode = node.parentNode;
+
+			if (node.firstChild) {
+				parentNode.insertBefore(node.firstChild, node);
+			}
+
+			node.parentNode.removeChild(node);
+		}
+
+		function findSpansByIndex(index) {
+			var nodes, spans = [];
+
+			nodes = tinymce.toArray(editor.getBody().getElementsByTagName('span'));
+			if (nodes.length) {
+				for (var i = 0; i < nodes.length; i++) {
+					var nodeIndex = getElmIndex(nodes[i]);
+
+					if (nodeIndex === null || !nodeIndex.length) {
+						continue;
+					}
+
+					if (nodeIndex === index.toString()) {
+						spans.push(nodes[i]);
+					}
+				}
+			}
+
+			return spans;
+		}
+
+		function moveSelection(forward) {
+			var testIndex = currentIndex, dom = editor.dom;
+
+			forward = forward !== false;
+
+			if (forward) {
+				testIndex++;
+			} else {
+				testIndex--;
+			}
+
+			dom.removeClass(findSpansByIndex(currentIndex), 'mce-match-marker-selected');
+
+			var spans = findSpansByIndex(testIndex);
+			if (spans.length) {
+				dom.addClass(findSpansByIndex(testIndex), 'mce-match-marker-selected');
+				editor.selection.scrollIntoView(spans[0]);
+				return testIndex;
+			}
+
+			return -1;
+		}
+
+		function removeNode(node) {
+			node.parentNode.removeChild(node);
+		}
+
+		self.find = function(text, matchCase, wholeWord) {
+			text = text.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
+			text = wholeWord ? '\\b' + text + '\\b' : text;
+
+			var count = markAllMatches(new RegExp(text, matchCase ? 'g' : 'gi'));
+
+			if (count) {
+				currentIndex = -1;
+				currentIndex = moveSelection(true);
+			}
+
+			return count;
+		};
+
+		self.next = function() {
+			var index = moveSelection(true);
+
+			if (index !== -1) {
+				currentIndex = index;
+			}
+		};
+
+		self.prev = function() {
+			var index = moveSelection(false);
+
+			if (index !== -1) {
+				currentIndex = index;
+			}
+		};
+
+		self.replace = function(text, forward, all) {
+			var i, nodes, node, matchIndex, currentMatchIndex, nextIndex = currentIndex, hasMore;
+
+			forward = forward !== false;
+
+			node = editor.getBody();
+			nodes = tinymce.toArray(node.getElementsByTagName('span'));
+			for (i = 0; i < nodes.length; i++) {
+				var nodeIndex = getElmIndex(nodes[i]);
+
+				if (nodeIndex === null || !nodeIndex.length) {
+					continue;
+				}
+
+				matchIndex = currentMatchIndex = parseInt(nodeIndex, 10);
+				if (all || matchIndex === currentIndex) {
+					if (text.length) {
+						nodes[i].firstChild.nodeValue = text;
+						unwrap(nodes[i]);
+					} else {
+						removeNode(nodes[i]);
+					}
+
+					while (nodes[++i]) {
+						matchIndex = getElmIndex(nodes[i]);
+
+						if (nodeIndex === null || !nodeIndex.length) {
+							continue;
+						}
+
+						if (matchIndex === currentMatchIndex) {
+							removeNode(nodes[i]);
+						} else {
+							i--;
+							break;
+						}
+					}
+
+					if (forward) {
+						nextIndex--;
+					}
+				} else if (currentMatchIndex > currentIndex) {
+					nodes[i].setAttribute('data-mce-index', currentMatchIndex - 1);
+				}
+			}
+
+			editor.undoManager.add();
+			currentIndex = nextIndex;
+
+			if (forward) {
+				hasMore = findSpansByIndex(nextIndex + 1).length > 0;
+				self.next();
+			} else {
+				hasMore = findSpansByIndex(nextIndex - 1).length > 0;
+				self.prev();
+			}
+
+			return !all && hasMore;
+		};
+
+		self.done = function(keepEditorSelection) {
+			var i, nodes, startContainer, endContainer;
+
+			nodes = tinymce.toArray(editor.getBody().getElementsByTagName('span'));
+			for (i = 0; i < nodes.length; i++) {
+				var nodeIndex = getElmIndex(nodes[i]);
+
+				if (nodeIndex !== null && nodeIndex.length) {
+					if (nodeIndex === currentIndex.toString()) {
+						if (!startContainer) {
+							startContainer = nodes[i].firstChild;
+						}
+
+						endContainer = nodes[i].firstChild;
+					}
+
+					unwrap(nodes[i]);
+				}
+			}
+
+			if (startContainer && endContainer) {
+				var rng = editor.dom.createRng();
+				rng.setStart(startContainer, 0);
+				rng.setEnd(endContainer, endContainer.data.length);
+
+				if (keepEditorSelection !== false) {
+					editor.selection.setRng(rng);
+				}
+
+				return rng;
+			}
+		};
+	}
+
+	tinymce.PluginManager.add('searchreplace', Plugin);
+})();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/searchreplace/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+(function(){function b(n,f,c,t,h){var g,i=[],s,l=0,o;var r,d,k;o=f.ownerDocument;r=h.getBlockElements();d=h.getWhiteSpaceElements();k=h.getShortEndedElements();function p(u,v){v=v||0;if(!u[0]){throw"findAndReplaceDOMText cannot handle zero-length matches"}var w=u.index;if(v>0){var x=u[v];if(!x){throw"Invalid capture group"}w+=u[0].indexOf(x);u[0]=x}return[w,w+u[0].length,[u[0]]]}function q(u){var m;if(u.nodeType===3){return u.data}if(d[u.nodeName]&&!r[u.nodeName]){return""}m="";if(r[u.nodeName]||k[u.nodeName]){m+="\n"}if((u=u.firstChild)){do{m+=q(u)}while((u=u.nextSibling))}return m}function j(w,y,C){var u,B,z,v,D=[],A=0,x=w,m=y.shift(),E=0;out:while(true){if(r[x.nodeName]||k[x.nodeName]){A++}if(x.nodeType===3){if(!B&&x.length+A>=m[1]){B=x;v=m[1]-A}else{if(u){D.push(x)}}if(!u&&x.length+A>m[0]){u=x;z=m[0]-A}A+=x.length}if(u&&B){x=C({startNode:u,startNodeIndex:z,endNode:B,endNodeIndex:v,innerNodes:D,match:m[2],matchIndex:E});A-=(B.length-v);u=null;B=null;D=[];m=y.shift();E++;if(!m){break}}else{if((!d[x.nodeName]||r[x.nodeName])&&x.firstChild){x=x.firstChild;continue}else{if(x.nextSibling){x=x.nextSibling;continue}}}while(true){if(x.nextSibling){x=x.nextSibling;break}else{if(x.parentNode!==w){x=x.parentNode}else{break out}}}}}function e(v){var m;if(typeof v!="function"){var u=v.nodeType?v:o.createElement(v);m=function(x,w){var y=u.cloneNode(false);y.setAttribute("data-mce-index",w);if(x){y.appendChild(o.createTextNode(x))}return y}}else{m=v}return function(C){var J,w,D,y=C.startNode,F=C.endNode,K=C.matchIndex;if(y===F){var z=y;D=z.parentNode;if(C.startNodeIndex>0){J=o.createTextNode(z.data.substring(0,C.startNodeIndex));D.insertBefore(J,z)}var x=m(C.match[0],K);D.insertBefore(x,z);if(C.endNodeIndex<z.length){w=o.createTextNode(z.data.substring(C.endNodeIndex));D.insertBefore(w,z)}z.parentNode.removeChild(z);return x}else{J=o.createTextNode(y.data.substring(0,C.startNodeIndex));w=o.createTextNode(F.data.substring(C.endNodeIndex));var H=m(y.data.substring(C.startNodeIndex),K);var G=[];for(var B=0,A=C.innerNodes.length;B<A;++B){var L=C.innerNodes[B];var I=m(L.data,K);L.parentNode.replaceChild(I,L);G.push(I)}var E=m(F.data.substring(0,C.endNodeIndex),K);D=y.parentNode;D.insertBefore(J,y);D.insertBefore(H,y);D.removeChild(y);D=F.parentNode;D.insertBefore(E,F);D.insertBefore(w,F);D.removeChild(F);return E}}}s=q(f);if(!s){return}if(n.global){while((g=n.exec(s))){i.push(p(g,t))}}else{g=s.match(n);i.push(p(g,t))}if(i.length){l=i.length;j(f,i,e(c))}return l}function a(f){var l=this,h=-1;function i(){var n={};function m(){o.statusbar.find("#next").disabled(!c(h+1).length);o.statusbar.find("#prev").disabled(!c(h-1).length)}function p(){tinymce.ui.MessageBox.alert("Could not find the specified string.",function(){o.find("#find")[0].focus()})}var o=tinymce.ui.Factory.create({type:"window",layout:"flex",pack:"center",align:"center",onClose:function(){f.focus();l.done()},onSubmit:function(t){var s,q,u,r;t.preventDefault();q=o.find("#case").checked();r=o.find("#words").checked();u=o.find("#find").value();if(!u.length){l.done(false);o.statusbar.items().slice(1).disabled(true);return}if(n.text==u&&n.caseState==q&&n.wholeWord==r){if(c(h+1).length===0){p();return}l.next();m();return}s=l.find(u,q,r);if(!s){p()}o.statusbar.items().slice(1).disabled(s===0);m();n={text:u,caseState:q,wholeWord:r}},buttons:[{text:"Find",onclick:function(){o.submit()}},{text:"Replace",disabled:true,onclick:function(){if(!l.replace(o.find("#replace").value())){o.statusbar.items().slice(1).disabled(true);h=-1;n={}}}},{text:"Replace all",disabled:true,onclick:function(){l.replace(o.find("#replace").value(),true,true);o.statusbar.items().slice(1).disabled(true);n={}}},{type:"spacer",flex:1},{text:"Prev",name:"prev",disabled:true,onclick:function(){l.prev();m()}},{text:"Next",name:"next",disabled:true,onclick:function(){l.next();m()}}],title:"Find and replace",items:{type:"form",padding:20,labelGap:30,spacing:10,items:[{type:"textbox",name:"find",size:40,label:"Find",value:f.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()}l.init=function(m){m.addMenuItem("searchreplace",{text:"Find and replace",shortcut:"Meta+F",onclick:i,separator:"before",context:"edit"});m.addButton("searchreplace",{tooltip:"Find and replace",shortcut:"Meta+F",onclick:i});m.addCommand("SearchReplace",i);m.shortcuts.add("Meta+F","",i)};function j(n){var m=n.getAttribute("data-mce-index");if(typeof m=="number"){return""+m}return m}function g(o){var n,m;m=f.dom.create("span",{"data-mce-bogus":1});m.className="mce-match-marker";n=f.getBody();l.done(false);return b(o,n,m,false,f.schema)}function e(n){var m=n.parentNode;if(n.firstChild){m.insertBefore(n.firstChild,n)}n.parentNode.removeChild(n)}function c(n){var m,p=[];m=tinymce.toArray(f.getBody().getElementsByTagName("span"));if(m.length){for(var o=0;o<m.length;o++){var q=j(m[o]);if(q===null||!q.length){continue}if(q===n.toString()){p.push(m[o])}}}return p}function k(m){var o=h,p=f.dom;m=m!==false;if(m){o++}else{o--}p.removeClass(c(h),"mce-match-marker-selected");var n=c(o);if(n.length){p.addClass(c(o),"mce-match-marker-selected");f.selection.scrollIntoView(n[0]);return o}return -1}function d(m){m.parentNode.removeChild(m)}l.find=function(p,o,m){p=p.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");p=m?"\\b"+p+"\\b":p;var n=g(new RegExp(p,o?"g":"gi"));if(n){h=-1;h=k(true)}return n};l.next=function(){var m=k(true);if(m!==-1){h=m}};l.prev=function(){var m=k(false);if(m!==-1){h=m}};l.replace=function(w,t,v){var r,m,o,u,q,s=h,n;t=t!==false;o=f.getBody();m=tinymce.toArray(o.getElementsByTagName("span"));for(r=0;r<m.length;r++){var p=j(m[r]);if(p===null||!p.length){continue}u=q=parseInt(p,10);if(v||u===h){if(w.length){m[r].firstChild.nodeValue=w;e(m[r])}else{d(m[r])}while(m[++r]){u=j(m[r]);if(p===null||!p.length){continue}if(u===q){d(m[r])}else{r--;break}}if(t){s--}}else{if(q>h){m[r].setAttribute("data-mce-index",q-1)}}}f.undoManager.add();h=s;if(t){n=c(s+1).length>0;l.next()}else{n=c(s-1).length>0;l.prev()}return !v&&n};l.done=function(o){var p,n,q,r;n=tinymce.toArray(f.getBody().getElementsByTagName("span"));for(p=0;p<n.length;p++){var s=j(n[p]);if(s!==null&&s.length){if(s===h.toString()){if(!q){q=n[p].firstChild}r=n[p].firstChild}e(n[p])}}if(q&&r){var m=f.dom.createRng();m.setStart(q,0);m.setEnd(r,r.data.length);if(o!==false){f.selection.setRng(m)}return m}}}tinymce.PluginManager.add("searchreplace",a)})();
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/spellchecker/classes/DomTextMatcher.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,470 @@
+/**
+ * DomTextMatcher.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*eslint no-labels:0, no-constant-condition: 0 */
+
+/**
+ * This class logic for filtering text and matching words.
+ *
+ * @class tinymce.spellcheckerplugin.TextFilter
+ * @private
+ */
+define("tinymce/spellcheckerplugin/DomTextMatcher", [], function() {
+	// Based on work developed by: James Padolsey http://james.padolsey.com
+	// released under UNLICENSE that is compatible with LGPL
+	// TODO: Handle contentEditable edgecase:
+	// <p>text<span contentEditable="false">text<span contentEditable="true">text</span>text</span>text</p>
+	return function(node, editor) {
+		var m, matches = [], text, dom = editor.dom;
+		var blockElementsMap, hiddenTextElementsMap, shortEndedElementsMap;
+
+		blockElementsMap = editor.schema.getBlockElements(); // H1-H6, P, TD etc
+		hiddenTextElementsMap = editor.schema.getWhiteSpaceElements(); // TEXTAREA, PRE, STYLE, SCRIPT
+		shortEndedElementsMap = editor.schema.getShortEndedElements(); // BR, IMG, INPUT
+
+		function createMatch(m, data) {
+			if (!m[0]) {
+				throw 'findAndReplaceDOMText cannot handle zero-length matches';
+			}
+
+			return {
+				start: m.index,
+				end: m.index + m[0].length,
+				text: m[0],
+				data: data
+			};
+		}
+
+		function getText(node) {
+			var txt;
+
+			if (node.nodeType === 3) {
+				return node.data;
+			}
+
+			if (hiddenTextElementsMap[node.nodeName] && !blockElementsMap[node.nodeName]) {
+				return '';
+			}
+
+			txt = '';
+
+			if (blockElementsMap[node.nodeName] || shortEndedElementsMap[node.nodeName]) {
+				txt += '\n';
+			}
+
+			if ((node = node.firstChild)) {
+				do {
+					txt += getText(node);
+				} while ((node = node.nextSibling));
+			}
+
+			return txt;
+		}
+
+		function stepThroughMatches(node, matches, replaceFn) {
+			var startNode, endNode, startNodeIndex,
+				endNodeIndex, innerNodes = [], atIndex = 0, curNode = node,
+				matchLocation, matchIndex = 0;
+
+			matches = matches.slice(0);
+			matches.sort(function(a, b) {
+				return a.start - b.start;
+			});
+
+			matchLocation = matches.shift();
+
+			out: while (true) {
+				if (blockElementsMap[curNode.nodeName] || shortEndedElementsMap[curNode.nodeName]) {
+					atIndex++;
+				}
+
+				if (curNode.nodeType === 3) {
+					if (!endNode && curNode.length + atIndex >= matchLocation.end) {
+						// We've found the ending
+						endNode = curNode;
+						endNodeIndex = matchLocation.end - atIndex;
+					} else if (startNode) {
+						// Intersecting node
+						innerNodes.push(curNode);
+					}
+
+					if (!startNode && curNode.length + atIndex > matchLocation.start) {
+						// We've found the match start
+						startNode = curNode;
+						startNodeIndex = matchLocation.start - atIndex;
+					}
+
+					atIndex += curNode.length;
+				}
+
+				if (startNode && endNode) {
+					curNode = replaceFn({
+						startNode: startNode,
+						startNodeIndex: startNodeIndex,
+						endNode: endNode,
+						endNodeIndex: endNodeIndex,
+						innerNodes: innerNodes,
+						match: matchLocation.text,
+						matchIndex: matchIndex
+					});
+
+					// replaceFn has to return the node that replaced the endNode
+					// and then we step back so we can continue from the end of the
+					// match:
+					atIndex -= (endNode.length - endNodeIndex);
+					startNode = null;
+					endNode = null;
+					innerNodes = [];
+					matchLocation = matches.shift();
+					matchIndex++;
+
+					if (!matchLocation) {
+						break; // no more matches
+					}
+				} else if ((!hiddenTextElementsMap[curNode.nodeName] || blockElementsMap[curNode.nodeName]) && curNode.firstChild) {
+					// Move down
+					curNode = curNode.firstChild;
+					continue;
+				} else if (curNode.nextSibling) {
+					// Move forward:
+					curNode = curNode.nextSibling;
+					continue;
+				}
+
+				// Move forward or up:
+				while (true) {
+					if (curNode.nextSibling) {
+						curNode = curNode.nextSibling;
+						break;
+					} else if (curNode.parentNode !== node) {
+						curNode = curNode.parentNode;
+					} else {
+						break out;
+					}
+				}
+			}
+		}
+
+		/**
+		* Generates the actual replaceFn which splits up text nodes
+		* and inserts the replacement element.
+		*/
+		function genReplacer(callback) {
+			function makeReplacementNode(fill, matchIndex) {
+				var match = matches[matchIndex];
+
+				if (!match.stencil) {
+					match.stencil = callback(match);
+				}
+
+				var clone = match.stencil.cloneNode(false);
+				clone.setAttribute('data-mce-index', matchIndex);
+
+				if (fill) {
+					clone.appendChild(dom.doc.createTextNode(fill));
+				}
+
+				return clone;
+			}
+
+			return function(range) {
+				var before, after, parentNode, startNode = range.startNode,
+					endNode = range.endNode, matchIndex = range.matchIndex,
+					doc = dom.doc;
+
+				if (startNode === endNode) {
+					var node = startNode;
+
+					parentNode = node.parentNode;
+					if (range.startNodeIndex > 0) {
+						// Add "before" text node (before the match)
+						before = doc.createTextNode(node.data.substring(0, range.startNodeIndex));
+						parentNode.insertBefore(before, node);
+					}
+
+					// Create the replacement node:
+					var el = makeReplacementNode(range.match, matchIndex);
+					parentNode.insertBefore(el, node);
+					if (range.endNodeIndex < node.length) {
+						// Add "after" text node (after the match)
+						after = doc.createTextNode(node.data.substring(range.endNodeIndex));
+						parentNode.insertBefore(after, node);
+					}
+
+					node.parentNode.removeChild(node);
+
+					return el;
+				} else {
+					// Replace startNode -> [innerNodes...] -> endNode (in that order)
+					before = doc.createTextNode(startNode.data.substring(0, range.startNodeIndex));
+					after = doc.createTextNode(endNode.data.substring(range.endNodeIndex));
+					var elA = makeReplacementNode(startNode.data.substring(range.startNodeIndex), matchIndex);
+					var innerEls = [];
+
+					for (var i = 0, l = range.innerNodes.length; i < l; ++i) {
+						var innerNode = range.innerNodes[i];
+						var innerEl = makeReplacementNode(innerNode.data, matchIndex);
+						innerNode.parentNode.replaceChild(innerEl, innerNode);
+						innerEls.push(innerEl);
+					}
+
+					var elB = makeReplacementNode(endNode.data.substring(0, range.endNodeIndex), matchIndex);
+
+					parentNode = startNode.parentNode;
+					parentNode.insertBefore(before, startNode);
+					parentNode.insertBefore(elA, startNode);
+					parentNode.removeChild(startNode);
+
+					parentNode = endNode.parentNode;
+					parentNode.insertBefore(elB, endNode);
+					parentNode.insertBefore(after, endNode);
+					parentNode.removeChild(endNode);
+
+					return elB;
+				}
+			};
+		}
+
+		function unwrapElement(element) {
+			var parentNode = element.parentNode;
+			parentNode.insertBefore(element.firstChild, element);
+			element.parentNode.removeChild(element);
+		}
+
+		function getWrappersByIndex(index) {
+			var elements = node.getElementsByTagName('*'), wrappers = [];
+
+			index = typeof index == "number" ? "" + index : null;
+
+			for (var i = 0; i < elements.length; i++) {
+				var element = elements[i], dataIndex = element.getAttribute('data-mce-index');
+
+				if (dataIndex !== null && dataIndex.length) {
+					if (dataIndex === index || index === null) {
+						wrappers.push(element);
+					}
+				}
+			}
+
+			return wrappers;
+		}
+
+		/**
+		 * Returns the index of a specific match object or -1 if it isn't found.
+		 *
+		 * @param  {Match} match Text match object.
+		 * @return {Number} Index of match or -1 if it isn't found.
+		 */
+		function indexOf(match) {
+			var i = matches.length;
+			while (i--) {
+				if (matches[i] === match) {
+					return i;
+				}
+			}
+
+			return -1;
+		}
+
+		/**
+		 * Filters the matches. If the callback returns true it stays if not it gets removed.
+		 *
+		 * @param {Function} callback Callback to execute for each match.
+		 * @return {DomTextMatcher} Current DomTextMatcher instance.
+		 */
+		function filter(callback) {
+			var filteredMatches = [];
+
+			each(function(match, i) {
+				if (callback(match, i)) {
+					filteredMatches.push(match);
+				}
+			});
+
+			matches = filteredMatches;
+
+			/*jshint validthis:true*/
+			return this;
+		}
+
+		/**
+		 * Executes the specified callback for each match.
+		 *
+		 * @param {Function} callback  Callback to execute for each match.
+		 * @return {DomTextMatcher} Current DomTextMatcher instance.
+		 */
+		function each(callback) {
+			for (var i = 0, l = matches.length; i < l; i++) {
+				if (callback(matches[i], i) === false) {
+					break;
+				}
+			}
+
+			/*jshint validthis:true*/
+			return this;
+		}
+
+		/**
+		 * Wraps the current matches with nodes created by the specified callback.
+		 * Multiple clones of these matches might occur on matches that are on multiple nodex.
+		 *
+		 * @param {Function} callback Callback to execute in order to create elements for matches.
+		 * @return {DomTextMatcher} Current DomTextMatcher instance.
+		 */
+		function wrap(callback) {
+			if (matches.length) {
+				stepThroughMatches(node, matches, genReplacer(callback));
+			}
+
+			/*jshint validthis:true*/
+			return this;
+		}
+
+		/**
+		 * Finds the specified regexp and adds them to the matches collection.
+		 *
+		 * @param {RegExp} regex Global regexp to search the current node by.
+		 * @param {Object} [data] Optional custom data element for the match.
+		 * @return {DomTextMatcher} Current DomTextMatcher instance.
+		 */
+		function find(regex, data) {
+			if (text && regex.global) {
+				while ((m = regex.exec(text))) {
+					matches.push(createMatch(m, data));
+				}
+			}
+
+			return this;
+		}
+
+		/**
+		 * Unwraps the specified match object or all matches if unspecified.
+		 *
+		 * @param {Object} [match] Optional match object.
+		 * @return {DomTextMatcher} Current DomTextMatcher instance.
+		 */
+		function unwrap(match) {
+			var i, elements = getWrappersByIndex(match ? indexOf(match) : null);
+
+			i = elements.length;
+			while (i--) {
+				unwrapElement(elements[i]);
+			}
+
+			return this;
+		}
+
+		/**
+		 * Returns a match object by the specified DOM element.
+		 *
+		 * @param {DOMElement} element Element to return match object for.
+		 * @return {Object} Match object for the specified element.
+		 */
+		function matchFromElement(element) {
+			return matches[element.getAttribute('data-mce-index')];
+		}
+
+		/**
+		 * Returns a DOM element from the specified match element. This will be the first element if it's split
+		 * on multiple nodes.
+		 *
+		 * @param {Object} match Match element to get first element of.
+		 * @return {DOMElement} DOM element for the specified match object.
+		 */
+		function elementFromMatch(match) {
+			return getWrappersByIndex(indexOf(match))[0];
+		}
+
+		/**
+		 * Adds match the specified range for example a grammar line.
+		 *
+		 * @param {Number} start Start offset.
+		 * @param {Number} length Length of the text.
+		 * @param {Object} data Custom data object for match.
+		 * @return {DomTextMatcher} Current DomTextMatcher instance.
+		 */
+		function add(start, length, data) {
+			matches.push({
+				start: start,
+				end: start + length,
+				text: text.substr(start, length),
+				data: data
+			});
+
+			return this;
+		}
+
+		/**
+		 * Returns a DOM range for the specified match.
+		 *
+		 * @param  {Object} match Match object to get range for.
+		 * @return {DOMRange} DOM Range for the specified match.
+		 */
+		function rangeFromMatch(match) {
+			var wrappers = getWrappersByIndex(indexOf(match));
+
+			var rng = editor.dom.createRng();
+			rng.setStartBefore(wrappers[0]);
+			rng.setEndAfter(wrappers[wrappers.length - 1]);
+
+			return rng;
+		}
+
+		/**
+		 * Replaces the specified match with the specified text.
+		 *
+		 * @param {Object} match Match object to replace.
+		 * @param {String} text Text to replace the match with.
+		 * @return {DOMRange} DOM range produced after the replace.
+		 */
+		function replace(match, text) {
+			var rng = rangeFromMatch(match);
+
+			rng.deleteContents();
+
+			if (text.length > 0) {
+				rng.insertNode(editor.dom.doc.createTextNode(text));
+			}
+
+			return rng;
+		}
+
+		/**
+		 * Resets the DomTextMatcher instance. This will remove any wrapped nodes and remove any matches.
+		 *
+		 * @return {[type]} [description]
+		 */
+		function reset() {
+			matches.splice(0, matches.length);
+			unwrap();
+
+			return this;
+		}
+
+		text = getText(node);
+
+		return {
+			text: text,
+			matches: matches,
+			each: each,
+			filter: filter,
+			reset: reset,
+			matchFromElement: matchFromElement,
+			elementFromMatch: elementFromMatch,
+			find: find,
+			add: add,
+			wrap: wrap,
+			unwrap: unwrap,
+			replace: replace,
+			rangeFromMatch: rangeFromMatch,
+			indexOf: indexOf
+		};
+	};
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/spellchecker/classes/Plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,436 @@
+/**
+ * Plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*jshint camelcase:false */
+
+/**
+ * This class contains all core logic for the spellchecker plugin.
+ *
+ * @class tinymce.spellcheckerplugin.Plugin
+ * @private
+ */
+define("tinymce/spellcheckerplugin/Plugin", [
+	"tinymce/spellcheckerplugin/DomTextMatcher",
+	"tinymce/PluginManager",
+	"tinymce/util/Tools",
+	"tinymce/ui/Menu",
+	"tinymce/dom/DOMUtils",
+	"tinymce/util/XHR",
+	"tinymce/util/URI",
+	"tinymce/util/JSON"
+], function(DomTextMatcher, PluginManager, Tools, Menu, DOMUtils, XHR, URI, JSON) {
+	PluginManager.add('spellchecker', function(editor, url) {
+		var languageMenuItems, self = this, lastSuggestions, started, suggestionsMenu, settings = editor.settings;
+		var hasDictionarySupport;
+
+		function getTextMatcher() {
+			if (!self.textMatcher) {
+				self.textMatcher = new DomTextMatcher(editor.getBody(), editor);
+			}
+
+			return self.textMatcher;
+		}
+
+		function buildMenuItems(listName, languageValues) {
+			var items = [];
+
+			Tools.each(languageValues, function(languageValue) {
+				items.push({
+					selectable: true,
+					text: languageValue.name,
+					data: languageValue.value
+				});
+			});
+
+			return items;
+		}
+
+		var languagesString = settings.spellchecker_languages ||
+			'English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr_FR,' +
+			'German=de,Italian=it,Polish=pl,Portuguese=pt_BR,' +
+			'Spanish=es,Swedish=sv';
+
+		languageMenuItems = buildMenuItems('Language',
+			Tools.map(languagesString.split(','), function(langPair) {
+				langPair = langPair.split('=');
+
+				return {
+					name: langPair[0],
+					value: langPair[1]
+				};
+			})
+		);
+
+		function isEmpty(obj) {
+			/*jshint unused:false*/
+			/*eslint no-unused-vars:0 */
+			for (var name in obj) {
+				return false;
+			}
+
+			return true;
+		}
+
+		function showSuggestions(word, spans) {
+			var items = [], suggestions = lastSuggestions[word];
+
+			Tools.each(suggestions, function(suggestion) {
+				items.push({
+					text: suggestion,
+					onclick: function() {
+						editor.insertContent(editor.dom.encode(suggestion));
+						editor.dom.remove(spans);
+						checkIfFinished();
+					}
+				});
+			});
+
+			items.push({text: '-'});
+
+			if (hasDictionarySupport) {
+				items.push({text: 'Add to Dictionary', onclick: function() {
+					addToDictionary(word, spans);
+				}});
+			}
+
+			items.push.apply(items, [
+				{text: 'Ignore', onclick: function() {
+					ignoreWord(word, spans);
+				}},
+
+				{text: 'Ignore all', onclick: function() {
+					ignoreWord(word, spans, true);
+				}}
+			]);
+
+			// Render menu
+			suggestionsMenu = new Menu({
+				items: items,
+				context: 'contextmenu',
+				onautohide: function(e) {
+					if (e.target.className.indexOf('spellchecker') != -1) {
+						e.preventDefault();
+					}
+				},
+				onhide: function() {
+					suggestionsMenu.remove();
+					suggestionsMenu = null;
+				}
+			});
+
+			suggestionsMenu.renderTo(document.body);
+
+			// Position menu
+			var pos = DOMUtils.DOM.getPos(editor.getContentAreaContainer());
+			var targetPos = editor.dom.getPos(spans[0]);
+			var root = editor.dom.getRoot();
+
+			// Adjust targetPos for scrolling in the editor
+			if (root.nodeName == 'BODY') {
+				targetPos.x -= root.ownerDocument.documentElement.scrollLeft || root.scrollLeft;
+				targetPos.y -= root.ownerDocument.documentElement.scrollTop || root.scrollTop;
+			} else {
+				targetPos.x -= root.scrollLeft;
+				targetPos.y -= root.scrollTop;
+			}
+
+			pos.x += targetPos.x;
+			pos.y += targetPos.y;
+
+			suggestionsMenu.moveTo(pos.x, pos.y + spans[0].offsetHeight);
+		}
+
+		function getWordCharPattern() {
+			// Regexp for finding word specific characters this will split words by
+			// spaces, quotes, copy right characters etc. It's escaped with unicode characters
+			// to make it easier to output scripts on servers using different encodings
+			// so if you add any characters outside the 128 byte range make sure to escape it
+			return editor.getParam('spellchecker_wordchar_pattern') || new RegExp("[^" +
+				"\\s!\"#$%&()*+,-./:;<=>?@[\\]^_{|}`" +
+				"\u00a7\u00a9\u00ab\u00ae\u00b1\u00b6\u00b7\u00b8\u00bb" +
+				"\u00bc\u00bd\u00be\u00bf\u00d7\u00f7\u00a4\u201d\u201c\u201e\u00a0\u2002\u2003\u2009" +
+			"]+", "g");
+		}
+
+		function defaultSpellcheckCallback(method, text, doneCallback, errorCallback) {
+			var data = {method: method}, postData = '';
+
+			if (method == "spellcheck") {
+				data.text = text;
+				data.lang = settings.spellchecker_language;
+			}
+
+			if (method == "addToDictionary") {
+				data.word = text;
+			}
+
+			Tools.each(data, function(value, key) {
+				if (postData) {
+					postData += '&';
+				}
+
+				postData += key + '=' + encodeURIComponent(value);
+			});
+
+			XHR.send({
+				url: new URI(url).toAbsolute(settings.spellchecker_rpc_url),
+				type: "post",
+				content_type: 'application/x-www-form-urlencoded',
+				data: postData,
+				success: function(result) {
+					result = JSON.parse(result);
+
+					if (!result) {
+						errorCallback("Sever response wasn't proper JSON.");
+					} else if (result.error) {
+						errorCallback(result.error);
+					} else {
+						doneCallback(result);
+					}
+				},
+				error: function(type, xhr) {
+					errorCallback("Spellchecker request error: " + xhr.status);
+				}
+			});
+		}
+
+		function sendRpcCall(name, data, successCallback, errorCallback) {
+			var spellCheckCallback = settings.spellchecker_callback || defaultSpellcheckCallback;
+			spellCheckCallback.call(self, name, data, successCallback, errorCallback);
+		}
+
+		function spellcheck() {
+			if (started) {
+				finish();
+				return;
+			} else {
+				finish();
+			}
+
+			function errorCallback(message) {
+				editor.windowManager.alert(message);
+				editor.setProgressState(false);
+				finish();
+			}
+
+			editor.setProgressState(true);
+			sendRpcCall("spellcheck", getTextMatcher().text, markErrors, errorCallback);
+			editor.focus();
+		}
+
+		function checkIfFinished() {
+			if (!editor.dom.select('span.mce-spellchecker-word').length) {
+				finish();
+			}
+		}
+
+		function addToDictionary(word, spans) {
+			editor.setProgressState(true);
+
+			sendRpcCall("addToDictionary", word, function() {
+				editor.setProgressState(false);
+				editor.dom.remove(spans, true);
+				checkIfFinished();
+			}, function(message) {
+				editor.windowManager.alert(message);
+				editor.setProgressState(false);
+			});
+		}
+
+		function ignoreWord(word, spans, all) {
+			editor.selection.collapse();
+
+			if (all) {
+				Tools.each(editor.dom.select('span.mce-spellchecker-word'), function(span) {
+					if (span.getAttribute('data-mce-word') == word) {
+						editor.dom.remove(span, true);
+					}
+				});
+			} else {
+				editor.dom.remove(spans, true);
+			}
+
+			checkIfFinished();
+		}
+
+		function finish() {
+			getTextMatcher().reset();
+			self.textMatcher = null;
+
+			if (started) {
+				started = false;
+				editor.fire('SpellcheckEnd');
+			}
+		}
+
+		function getElmIndex(elm) {
+			var value = elm.getAttribute('data-mce-index');
+
+			if (typeof value == "number") {
+				return "" + value;
+			}
+
+			return value;
+		}
+
+		function findSpansByIndex(index) {
+			var nodes, spans = [];
+
+			nodes = Tools.toArray(editor.getBody().getElementsByTagName('span'));
+			if (nodes.length) {
+				for (var i = 0; i < nodes.length; i++) {
+					var nodeIndex = getElmIndex(nodes[i]);
+
+					if (nodeIndex === null || !nodeIndex.length) {
+						continue;
+					}
+
+					if (nodeIndex === index.toString()) {
+						spans.push(nodes[i]);
+					}
+				}
+			}
+
+			return spans;
+		}
+
+		editor.on('click', function(e) {
+			var target = e.target;
+
+			if (target.className == "mce-spellchecker-word") {
+				e.preventDefault();
+
+				var spans = findSpansByIndex(getElmIndex(target));
+
+				if (spans.length > 0) {
+					var rng = editor.dom.createRng();
+					rng.setStartBefore(spans[0]);
+					rng.setEndAfter(spans[spans.length - 1]);
+					editor.selection.setRng(rng);
+					showSuggestions(target.getAttribute('data-mce-word'), spans);
+				}
+			}
+		});
+
+		editor.addMenuItem('spellchecker', {
+			text: 'Spellcheck',
+			context: 'tools',
+			onclick: spellcheck,
+			selectable: true,
+			onPostRender: function() {
+				var self = this;
+
+				self.active(started);
+
+				editor.on('SpellcheckStart SpellcheckEnd', function() {
+					self.active(started);
+				});
+			}
+		});
+
+		function updateSelection(e) {
+			var selectedLanguage = settings.spellchecker_language;
+
+			e.control.items().each(function(ctrl) {
+				ctrl.active(ctrl.settings.data === selectedLanguage);
+			});
+		}
+
+		/**
+		 * Find the specified words and marks them. It will also show suggestions for those words.
+		 *
+		 * @example
+		 * editor.plugins.spellchecker.markErrors({
+		 *     dictionary: true,
+		 *     words: {
+		 *         "word1": ["suggestion 1", "Suggestion 2"]
+		 *     }
+		 * });
+		 * @param {Object} data Data object containing the words with suggestions.
+		 */
+		function markErrors(data) {
+			var suggestions;
+
+			if (data.words) {
+				hasDictionarySupport = !!data.dictionary;
+				suggestions = data.words;
+			} else {
+				// Fallback to old format
+				suggestions = data;
+			}
+
+			editor.setProgressState(false);
+
+			if (isEmpty(suggestions)) {
+				editor.windowManager.alert('No misspellings found');
+				started = false;
+				return;
+			}
+
+			lastSuggestions = suggestions;
+
+			getTextMatcher().find(getWordCharPattern()).filter(function(match) {
+				return !!suggestions[match.text];
+			}).wrap(function(match) {
+				return editor.dom.create('span', {
+					"class": 'mce-spellchecker-word',
+					"data-mce-bogus": 1,
+					"data-mce-word": match.text
+				});
+			});
+
+			started = true;
+			editor.fire('SpellcheckStart');
+		}
+
+		var buttonArgs = {
+			tooltip: 'Spellcheck',
+			onclick: spellcheck,
+			onPostRender: function() {
+				var self = this;
+
+				editor.on('SpellcheckStart SpellcheckEnd', function() {
+					self.active(started);
+				});
+			}
+		};
+
+		if (languageMenuItems.length > 1) {
+			buttonArgs.type = 'splitbutton';
+			buttonArgs.menu = languageMenuItems;
+			buttonArgs.onshow = updateSelection;
+			buttonArgs.onselect = function(e) {
+				settings.spellchecker_language = e.control.settings.data;
+			};
+		}
+
+		editor.addButton('spellchecker', buttonArgs);
+		editor.addCommand('mceSpellCheck', spellcheck);
+
+		editor.on('remove', function() {
+			if (suggestionsMenu) {
+				suggestionsMenu.remove();
+				suggestionsMenu = null;
+			}
+		});
+
+		editor.on('change', checkIfFinished);
+
+		this.getTextMatcher = getTextMatcher;
+		this.getWordCharPattern = getWordCharPattern;
+		this.markErrors = markErrors;
+		this.getLanguage = function() {
+			return settings.spellchecker_language;
+		};
+
+		// Set default spellchecker language if it's not specified
+		settings.spellchecker_language = settings.spellchecker_language || settings.language || 'en';
+	});
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/spellchecker/plugin.dev.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,117 @@
+/**
+ * Inline development version. Only to be used while developing since it uses document.write to load scripts.
+ */
+
+/*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */
+/*globals $code */
+
+(function(exports) {
+	"use strict";
+
+	var html = "", baseDir;
+	var modules = {}, exposedModules = [], moduleCount = 0;
+
+	var scripts = document.getElementsByTagName('script');
+	for (var i = 0; i < scripts.length; i++) {
+		var src = scripts[i].src;
+
+		if (src.indexOf('/plugin.dev.js') != -1) {
+			baseDir = src.substring(0, src.lastIndexOf('/'));
+		}
+	}
+
+	function require(ids, callback) {
+		var module, defs = [];
+
+		for (var i = 0; i < ids.length; ++i) {
+			module = modules[ids[i]] || resolve(ids[i]);
+			if (!module) {
+				throw 'module definition dependecy not found: ' + ids[i];
+			}
+
+			defs.push(module);
+		}
+
+		callback.apply(null, defs);
+	}
+
+	function resolve(id) {
+		var target = exports;
+		var fragments = id.split(/[.\/]/);
+
+		for (var fi = 0; fi < fragments.length; ++fi) {
+			if (!target[fragments[fi]]) {
+				return;
+			}
+
+			target = target[fragments[fi]];
+		}
+
+		return target;
+	}
+
+	function register(id) {
+		var target = exports;
+		var fragments = id.split(/[.\/]/);
+
+		for (var fi = 0; fi < fragments.length - 1; ++fi) {
+			if (target[fragments[fi]] === undefined) {
+				target[fragments[fi]] = {};
+			}
+
+			target = target[fragments[fi]];
+		}
+
+		target[fragments[fragments.length - 1]] = modules[id];
+	}
+
+	function define(id, dependencies, definition) {
+		if (typeof id !== 'string') {
+			throw 'invalid module definition, module id must be defined and be a string';
+		}
+
+		if (dependencies === undefined) {
+			throw 'invalid module definition, dependencies must be specified';
+		}
+
+		if (definition === undefined) {
+			throw 'invalid module definition, definition function must be specified';
+		}
+
+		require(dependencies, function() {
+			modules[id] = definition.apply(null, arguments);
+		});
+
+		if (--moduleCount === 0) {
+			for (var i = 0; i < exposedModules.length; i++) {
+				register(exposedModules[i]);
+			}
+		}
+	}
+
+	function expose(ids) {
+		exposedModules = ids;
+	}
+
+	function writeScripts() {
+		document.write(html);
+	}
+
+	function load(path) {
+		html += '<script type="text/javascript" src="' + baseDir + '/' + path + '"></script>\n';
+		moduleCount++;
+	}
+
+	// Expose globally
+	exports.define = define;
+	exports.require = require;
+
+	expose(["tinymce/spellcheckerplugin/DomTextMatcher"]);
+
+	load('classes/DomTextMatcher.js');
+	load('classes/Plugin.js');
+
+	writeScripts();
+})(this);
+
+// $hash: 71db3b0268e64137c268d50724a7efdc
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/spellchecker/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,996 @@
+/**
+ * Compiled inline version. (Library mode)
+ */
+
+/*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */
+/*globals $code */
+
+(function(exports, undefined) {
+	"use strict";
+
+	var modules = {};
+
+	function require(ids, callback) {
+		var module, defs = [];
+
+		for (var i = 0; i < ids.length; ++i) {
+			module = modules[ids[i]] || resolve(ids[i]);
+			if (!module) {
+				throw 'module definition dependecy not found: ' + ids[i];
+			}
+
+			defs.push(module);
+		}
+
+		callback.apply(null, defs);
+	}
+
+	function define(id, dependencies, definition) {
+		if (typeof id !== 'string') {
+			throw 'invalid module definition, module id must be defined and be a string';
+		}
+
+		if (dependencies === undefined) {
+			throw 'invalid module definition, dependencies must be specified';
+		}
+
+		if (definition === undefined) {
+			throw 'invalid module definition, definition function must be specified';
+		}
+
+		require(dependencies, function() {
+			modules[id] = definition.apply(null, arguments);
+		});
+	}
+
+	function defined(id) {
+		return !!modules[id];
+	}
+
+	function resolve(id) {
+		var target = exports;
+		var fragments = id.split(/[.\/]/);
+
+		for (var fi = 0; fi < fragments.length; ++fi) {
+			if (!target[fragments[fi]]) {
+				return;
+			}
+
+			target = target[fragments[fi]];
+		}
+
+		return target;
+	}
+
+	function expose(ids) {
+		for (var i = 0; i < ids.length; i++) {
+			var target = exports;
+			var id = ids[i];
+			var fragments = id.split(/[.\/]/);
+
+			for (var fi = 0; fi < fragments.length - 1; ++fi) {
+				if (target[fragments[fi]] === undefined) {
+					target[fragments[fi]] = {};
+				}
+
+				target = target[fragments[fi]];
+			}
+
+			target[fragments[fragments.length - 1]] = modules[id];
+		}
+	}
+
+// Included from: js/tinymce/plugins/spellchecker/classes/DomTextMatcher.js
+
+/**
+ * DomTextMatcher.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*eslint no-labels:0, no-constant-condition: 0 */
+
+/**
+ * This class logic for filtering text and matching words.
+ *
+ * @class tinymce.spellcheckerplugin.TextFilter
+ * @private
+ */
+define("tinymce/spellcheckerplugin/DomTextMatcher", [], function() {
+	// Based on work developed by: James Padolsey http://james.padolsey.com
+	// released under UNLICENSE that is compatible with LGPL
+	// TODO: Handle contentEditable edgecase:
+	// <p>text<span contentEditable="false">text<span contentEditable="true">text</span>text</span>text</p>
+	return function(node, editor) {
+		var m, matches = [], text, dom = editor.dom;
+		var blockElementsMap, hiddenTextElementsMap, shortEndedElementsMap;
+
+		blockElementsMap = editor.schema.getBlockElements(); // H1-H6, P, TD etc
+		hiddenTextElementsMap = editor.schema.getWhiteSpaceElements(); // TEXTAREA, PRE, STYLE, SCRIPT
+		shortEndedElementsMap = editor.schema.getShortEndedElements(); // BR, IMG, INPUT
+
+		function createMatch(m, data) {
+			if (!m[0]) {
+				throw 'findAndReplaceDOMText cannot handle zero-length matches';
+			}
+
+			return {
+				start: m.index,
+				end: m.index + m[0].length,
+				text: m[0],
+				data: data
+			};
+		}
+
+		function getText(node) {
+			var txt;
+
+			if (node.nodeType === 3) {
+				return node.data;
+			}
+
+			if (hiddenTextElementsMap[node.nodeName] && !blockElementsMap[node.nodeName]) {
+				return '';
+			}
+
+			txt = '';
+
+			if (blockElementsMap[node.nodeName] || shortEndedElementsMap[node.nodeName]) {
+				txt += '\n';
+			}
+
+			if ((node = node.firstChild)) {
+				do {
+					txt += getText(node);
+				} while ((node = node.nextSibling));
+			}
+
+			return txt;
+		}
+
+		function stepThroughMatches(node, matches, replaceFn) {
+			var startNode, endNode, startNodeIndex,
+				endNodeIndex, innerNodes = [], atIndex = 0, curNode = node,
+				matchLocation, matchIndex = 0;
+
+			matches = matches.slice(0);
+			matches.sort(function(a, b) {
+				return a.start - b.start;
+			});
+
+			matchLocation = matches.shift();
+
+			out: while (true) {
+				if (blockElementsMap[curNode.nodeName] || shortEndedElementsMap[curNode.nodeName]) {
+					atIndex++;
+				}
+
+				if (curNode.nodeType === 3) {
+					if (!endNode && curNode.length + atIndex >= matchLocation.end) {
+						// We've found the ending
+						endNode = curNode;
+						endNodeIndex = matchLocation.end - atIndex;
+					} else if (startNode) {
+						// Intersecting node
+						innerNodes.push(curNode);
+					}
+
+					if (!startNode && curNode.length + atIndex > matchLocation.start) {
+						// We've found the match start
+						startNode = curNode;
+						startNodeIndex = matchLocation.start - atIndex;
+					}
+
+					atIndex += curNode.length;
+				}
+
+				if (startNode && endNode) {
+					curNode = replaceFn({
+						startNode: startNode,
+						startNodeIndex: startNodeIndex,
+						endNode: endNode,
+						endNodeIndex: endNodeIndex,
+						innerNodes: innerNodes,
+						match: matchLocation.text,
+						matchIndex: matchIndex
+					});
+
+					// replaceFn has to return the node that replaced the endNode
+					// and then we step back so we can continue from the end of the
+					// match:
+					atIndex -= (endNode.length - endNodeIndex);
+					startNode = null;
+					endNode = null;
+					innerNodes = [];
+					matchLocation = matches.shift();
+					matchIndex++;
+
+					if (!matchLocation) {
+						break; // no more matches
+					}
+				} else if ((!hiddenTextElementsMap[curNode.nodeName] || blockElementsMap[curNode.nodeName]) && curNode.firstChild) {
+					// Move down
+					curNode = curNode.firstChild;
+					continue;
+				} else if (curNode.nextSibling) {
+					// Move forward:
+					curNode = curNode.nextSibling;
+					continue;
+				}
+
+				// Move forward or up:
+				while (true) {
+					if (curNode.nextSibling) {
+						curNode = curNode.nextSibling;
+						break;
+					} else if (curNode.parentNode !== node) {
+						curNode = curNode.parentNode;
+					} else {
+						break out;
+					}
+				}
+			}
+		}
+
+		/**
+		* Generates the actual replaceFn which splits up text nodes
+		* and inserts the replacement element.
+		*/
+		function genReplacer(callback) {
+			function makeReplacementNode(fill, matchIndex) {
+				var match = matches[matchIndex];
+
+				if (!match.stencil) {
+					match.stencil = callback(match);
+				}
+
+				var clone = match.stencil.cloneNode(false);
+				clone.setAttribute('data-mce-index', matchIndex);
+
+				if (fill) {
+					clone.appendChild(dom.doc.createTextNode(fill));
+				}
+
+				return clone;
+			}
+
+			return function(range) {
+				var before, after, parentNode, startNode = range.startNode,
+					endNode = range.endNode, matchIndex = range.matchIndex,
+					doc = dom.doc;
+
+				if (startNode === endNode) {
+					var node = startNode;
+
+					parentNode = node.parentNode;
+					if (range.startNodeIndex > 0) {
+						// Add "before" text node (before the match)
+						before = doc.createTextNode(node.data.substring(0, range.startNodeIndex));
+						parentNode.insertBefore(before, node);
+					}
+
+					// Create the replacement node:
+					var el = makeReplacementNode(range.match, matchIndex);
+					parentNode.insertBefore(el, node);
+					if (range.endNodeIndex < node.length) {
+						// Add "after" text node (after the match)
+						after = doc.createTextNode(node.data.substring(range.endNodeIndex));
+						parentNode.insertBefore(after, node);
+					}
+
+					node.parentNode.removeChild(node);
+
+					return el;
+				} else {
+					// Replace startNode -> [innerNodes...] -> endNode (in that order)
+					before = doc.createTextNode(startNode.data.substring(0, range.startNodeIndex));
+					after = doc.createTextNode(endNode.data.substring(range.endNodeIndex));
+					var elA = makeReplacementNode(startNode.data.substring(range.startNodeIndex), matchIndex);
+					var innerEls = [];
+
+					for (var i = 0, l = range.innerNodes.length; i < l; ++i) {
+						var innerNode = range.innerNodes[i];
+						var innerEl = makeReplacementNode(innerNode.data, matchIndex);
+						innerNode.parentNode.replaceChild(innerEl, innerNode);
+						innerEls.push(innerEl);
+					}
+
+					var elB = makeReplacementNode(endNode.data.substring(0, range.endNodeIndex), matchIndex);
+
+					parentNode = startNode.parentNode;
+					parentNode.insertBefore(before, startNode);
+					parentNode.insertBefore(elA, startNode);
+					parentNode.removeChild(startNode);
+
+					parentNode = endNode.parentNode;
+					parentNode.insertBefore(elB, endNode);
+					parentNode.insertBefore(after, endNode);
+					parentNode.removeChild(endNode);
+
+					return elB;
+				}
+			};
+		}
+
+		function unwrapElement(element) {
+			var parentNode = element.parentNode;
+			parentNode.insertBefore(element.firstChild, element);
+			element.parentNode.removeChild(element);
+		}
+
+		function getWrappersByIndex(index) {
+			var elements = node.getElementsByTagName('*'), wrappers = [];
+
+			index = typeof index == "number" ? "" + index : null;
+
+			for (var i = 0; i < elements.length; i++) {
+				var element = elements[i], dataIndex = element.getAttribute('data-mce-index');
+
+				if (dataIndex !== null && dataIndex.length) {
+					if (dataIndex === index || index === null) {
+						wrappers.push(element);
+					}
+				}
+			}
+
+			return wrappers;
+		}
+
+		/**
+		 * Returns the index of a specific match object or -1 if it isn't found.
+		 *
+		 * @param  {Match} match Text match object.
+		 * @return {Number} Index of match or -1 if it isn't found.
+		 */
+		function indexOf(match) {
+			var i = matches.length;
+			while (i--) {
+				if (matches[i] === match) {
+					return i;
+				}
+			}
+
+			return -1;
+		}
+
+		/**
+		 * Filters the matches. If the callback returns true it stays if not it gets removed.
+		 *
+		 * @param {Function} callback Callback to execute for each match.
+		 * @return {DomTextMatcher} Current DomTextMatcher instance.
+		 */
+		function filter(callback) {
+			var filteredMatches = [];
+
+			each(function(match, i) {
+				if (callback(match, i)) {
+					filteredMatches.push(match);
+				}
+			});
+
+			matches = filteredMatches;
+
+			/*jshint validthis:true*/
+			return this;
+		}
+
+		/**
+		 * Executes the specified callback for each match.
+		 *
+		 * @param {Function} callback  Callback to execute for each match.
+		 * @return {DomTextMatcher} Current DomTextMatcher instance.
+		 */
+		function each(callback) {
+			for (var i = 0, l = matches.length; i < l; i++) {
+				if (callback(matches[i], i) === false) {
+					break;
+				}
+			}
+
+			/*jshint validthis:true*/
+			return this;
+		}
+
+		/**
+		 * Wraps the current matches with nodes created by the specified callback.
+		 * Multiple clones of these matches might occur on matches that are on multiple nodex.
+		 *
+		 * @param {Function} callback Callback to execute in order to create elements for matches.
+		 * @return {DomTextMatcher} Current DomTextMatcher instance.
+		 */
+		function wrap(callback) {
+			if (matches.length) {
+				stepThroughMatches(node, matches, genReplacer(callback));
+			}
+
+			/*jshint validthis:true*/
+			return this;
+		}
+
+		/**
+		 * Finds the specified regexp and adds them to the matches collection.
+		 *
+		 * @param {RegExp} regex Global regexp to search the current node by.
+		 * @param {Object} [data] Optional custom data element for the match.
+		 * @return {DomTextMatcher} Current DomTextMatcher instance.
+		 */
+		function find(regex, data) {
+			if (text && regex.global) {
+				while ((m = regex.exec(text))) {
+					matches.push(createMatch(m, data));
+				}
+			}
+
+			return this;
+		}
+
+		/**
+		 * Unwraps the specified match object or all matches if unspecified.
+		 *
+		 * @param {Object} [match] Optional match object.
+		 * @return {DomTextMatcher} Current DomTextMatcher instance.
+		 */
+		function unwrap(match) {
+			var i, elements = getWrappersByIndex(match ? indexOf(match) : null);
+
+			i = elements.length;
+			while (i--) {
+				unwrapElement(elements[i]);
+			}
+
+			return this;
+		}
+
+		/**
+		 * Returns a match object by the specified DOM element.
+		 *
+		 * @param {DOMElement} element Element to return match object for.
+		 * @return {Object} Match object for the specified element.
+		 */
+		function matchFromElement(element) {
+			return matches[element.getAttribute('data-mce-index')];
+		}
+
+		/**
+		 * Returns a DOM element from the specified match element. This will be the first element if it's split
+		 * on multiple nodes.
+		 *
+		 * @param {Object} match Match element to get first element of.
+		 * @return {DOMElement} DOM element for the specified match object.
+		 */
+		function elementFromMatch(match) {
+			return getWrappersByIndex(indexOf(match))[0];
+		}
+
+		/**
+		 * Adds match the specified range for example a grammar line.
+		 *
+		 * @param {Number} start Start offset.
+		 * @param {Number} length Length of the text.
+		 * @param {Object} data Custom data object for match.
+		 * @return {DomTextMatcher} Current DomTextMatcher instance.
+		 */
+		function add(start, length, data) {
+			matches.push({
+				start: start,
+				end: start + length,
+				text: text.substr(start, length),
+				data: data
+			});
+
+			return this;
+		}
+
+		/**
+		 * Returns a DOM range for the specified match.
+		 *
+		 * @param  {Object} match Match object to get range for.
+		 * @return {DOMRange} DOM Range for the specified match.
+		 */
+		function rangeFromMatch(match) {
+			var wrappers = getWrappersByIndex(indexOf(match));
+
+			var rng = editor.dom.createRng();
+			rng.setStartBefore(wrappers[0]);
+			rng.setEndAfter(wrappers[wrappers.length - 1]);
+
+			return rng;
+		}
+
+		/**
+		 * Replaces the specified match with the specified text.
+		 *
+		 * @param {Object} match Match object to replace.
+		 * @param {String} text Text to replace the match with.
+		 * @return {DOMRange} DOM range produced after the replace.
+		 */
+		function replace(match, text) {
+			var rng = rangeFromMatch(match);
+
+			rng.deleteContents();
+
+			if (text.length > 0) {
+				rng.insertNode(editor.dom.doc.createTextNode(text));
+			}
+
+			return rng;
+		}
+
+		/**
+		 * Resets the DomTextMatcher instance. This will remove any wrapped nodes and remove any matches.
+		 *
+		 * @return {[type]} [description]
+		 */
+		function reset() {
+			matches.splice(0, matches.length);
+			unwrap();
+
+			return this;
+		}
+
+		text = getText(node);
+
+		return {
+			text: text,
+			matches: matches,
+			each: each,
+			filter: filter,
+			reset: reset,
+			matchFromElement: matchFromElement,
+			elementFromMatch: elementFromMatch,
+			find: find,
+			add: add,
+			wrap: wrap,
+			unwrap: unwrap,
+			replace: replace,
+			rangeFromMatch: rangeFromMatch,
+			indexOf: indexOf
+		};
+	};
+});
+
+// Included from: js/tinymce/plugins/spellchecker/classes/Plugin.js
+
+/**
+ * Plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*jshint camelcase:false */
+
+/**
+ * This class contains all core logic for the spellchecker plugin.
+ *
+ * @class tinymce.spellcheckerplugin.Plugin
+ * @private
+ */
+define("tinymce/spellcheckerplugin/Plugin", [
+	"tinymce/spellcheckerplugin/DomTextMatcher",
+	"tinymce/PluginManager",
+	"tinymce/util/Tools",
+	"tinymce/ui/Menu",
+	"tinymce/dom/DOMUtils",
+	"tinymce/util/XHR",
+	"tinymce/util/URI",
+	"tinymce/util/JSON"
+], function(DomTextMatcher, PluginManager, Tools, Menu, DOMUtils, XHR, URI, JSON) {
+	PluginManager.add('spellchecker', function(editor, url) {
+		var languageMenuItems, self = this, lastSuggestions, started, suggestionsMenu, settings = editor.settings;
+		var hasDictionarySupport;
+
+		function getTextMatcher() {
+			if (!self.textMatcher) {
+				self.textMatcher = new DomTextMatcher(editor.getBody(), editor);
+			}
+
+			return self.textMatcher;
+		}
+
+		function buildMenuItems(listName, languageValues) {
+			var items = [];
+
+			Tools.each(languageValues, function(languageValue) {
+				items.push({
+					selectable: true,
+					text: languageValue.name,
+					data: languageValue.value
+				});
+			});
+
+			return items;
+		}
+
+		var languagesString = settings.spellchecker_languages ||
+			'English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr_FR,' +
+			'German=de,Italian=it,Polish=pl,Portuguese=pt_BR,' +
+			'Spanish=es,Swedish=sv';
+
+		languageMenuItems = buildMenuItems('Language',
+			Tools.map(languagesString.split(','), function(langPair) {
+				langPair = langPair.split('=');
+
+				return {
+					name: langPair[0],
+					value: langPair[1]
+				};
+			})
+		);
+
+		function isEmpty(obj) {
+			/*jshint unused:false*/
+			/*eslint no-unused-vars:0 */
+			for (var name in obj) {
+				return false;
+			}
+
+			return true;
+		}
+
+		function showSuggestions(word, spans) {
+			var items = [], suggestions = lastSuggestions[word];
+
+			Tools.each(suggestions, function(suggestion) {
+				items.push({
+					text: suggestion,
+					onclick: function() {
+						editor.insertContent(editor.dom.encode(suggestion));
+						editor.dom.remove(spans);
+						checkIfFinished();
+					}
+				});
+			});
+
+			items.push({text: '-'});
+
+			if (hasDictionarySupport) {
+				items.push({text: 'Add to Dictionary', onclick: function() {
+					addToDictionary(word, spans);
+				}});
+			}
+
+			items.push.apply(items, [
+				{text: 'Ignore', onclick: function() {
+					ignoreWord(word, spans);
+				}},
+
+				{text: 'Ignore all', onclick: function() {
+					ignoreWord(word, spans, true);
+				}}
+			]);
+
+			// Render menu
+			suggestionsMenu = new Menu({
+				items: items,
+				context: 'contextmenu',
+				onautohide: function(e) {
+					if (e.target.className.indexOf('spellchecker') != -1) {
+						e.preventDefault();
+					}
+				},
+				onhide: function() {
+					suggestionsMenu.remove();
+					suggestionsMenu = null;
+				}
+			});
+
+			suggestionsMenu.renderTo(document.body);
+
+			// Position menu
+			var pos = DOMUtils.DOM.getPos(editor.getContentAreaContainer());
+			var targetPos = editor.dom.getPos(spans[0]);
+			var root = editor.dom.getRoot();
+
+			// Adjust targetPos for scrolling in the editor
+			if (root.nodeName == 'BODY') {
+				targetPos.x -= root.ownerDocument.documentElement.scrollLeft || root.scrollLeft;
+				targetPos.y -= root.ownerDocument.documentElement.scrollTop || root.scrollTop;
+			} else {
+				targetPos.x -= root.scrollLeft;
+				targetPos.y -= root.scrollTop;
+			}
+
+			pos.x += targetPos.x;
+			pos.y += targetPos.y;
+
+			suggestionsMenu.moveTo(pos.x, pos.y + spans[0].offsetHeight);
+		}
+
+		function getWordCharPattern() {
+			// Regexp for finding word specific characters this will split words by
+			// spaces, quotes, copy right characters etc. It's escaped with unicode characters
+			// to make it easier to output scripts on servers using different encodings
+			// so if you add any characters outside the 128 byte range make sure to escape it
+			return editor.getParam('spellchecker_wordchar_pattern') || new RegExp("[^" +
+				"\\s!\"#$%&()*+,-./:;<=>?@[\\]^_{|}`" +
+				"\u00a7\u00a9\u00ab\u00ae\u00b1\u00b6\u00b7\u00b8\u00bb" +
+				"\u00bc\u00bd\u00be\u00bf\u00d7\u00f7\u00a4\u201d\u201c\u201e\u00a0\u2002\u2003\u2009" +
+			"]+", "g");
+		}
+
+		function defaultSpellcheckCallback(method, text, doneCallback, errorCallback) {
+			var data = {method: method}, postData = '';
+
+			if (method == "spellcheck") {
+				data.text = text;
+				data.lang = settings.spellchecker_language;
+			}
+
+			if (method == "addToDictionary") {
+				data.word = text;
+			}
+
+			Tools.each(data, function(value, key) {
+				if (postData) {
+					postData += '&';
+				}
+
+				postData += key + '=' + encodeURIComponent(value);
+			});
+
+			XHR.send({
+				url: new URI(url).toAbsolute(settings.spellchecker_rpc_url),
+				type: "post",
+				content_type: 'application/x-www-form-urlencoded',
+				data: postData,
+				success: function(result) {
+					result = JSON.parse(result);
+
+					if (!result) {
+						errorCallback("Sever response wasn't proper JSON.");
+					} else if (result.error) {
+						errorCallback(result.error);
+					} else {
+						doneCallback(result);
+					}
+				},
+				error: function(type, xhr) {
+					errorCallback("Spellchecker request error: " + xhr.status);
+				}
+			});
+		}
+
+		function sendRpcCall(name, data, successCallback, errorCallback) {
+			var spellCheckCallback = settings.spellchecker_callback || defaultSpellcheckCallback;
+			spellCheckCallback.call(self, name, data, successCallback, errorCallback);
+		}
+
+		function spellcheck() {
+			if (started) {
+				finish();
+				return;
+			} else {
+				finish();
+			}
+
+			function errorCallback(message) {
+				editor.windowManager.alert(message);
+				editor.setProgressState(false);
+				finish();
+			}
+
+			editor.setProgressState(true);
+			sendRpcCall("spellcheck", getTextMatcher().text, markErrors, errorCallback);
+			editor.focus();
+		}
+
+		function checkIfFinished() {
+			if (!editor.dom.select('span.mce-spellchecker-word').length) {
+				finish();
+			}
+		}
+
+		function addToDictionary(word, spans) {
+			editor.setProgressState(true);
+
+			sendRpcCall("addToDictionary", word, function() {
+				editor.setProgressState(false);
+				editor.dom.remove(spans, true);
+				checkIfFinished();
+			}, function(message) {
+				editor.windowManager.alert(message);
+				editor.setProgressState(false);
+			});
+		}
+
+		function ignoreWord(word, spans, all) {
+			editor.selection.collapse();
+
+			if (all) {
+				Tools.each(editor.dom.select('span.mce-spellchecker-word'), function(span) {
+					if (span.getAttribute('data-mce-word') == word) {
+						editor.dom.remove(span, true);
+					}
+				});
+			} else {
+				editor.dom.remove(spans, true);
+			}
+
+			checkIfFinished();
+		}
+
+		function finish() {
+			getTextMatcher().reset();
+			self.textMatcher = null;
+
+			if (started) {
+				started = false;
+				editor.fire('SpellcheckEnd');
+			}
+		}
+
+		function getElmIndex(elm) {
+			var value = elm.getAttribute('data-mce-index');
+
+			if (typeof value == "number") {
+				return "" + value;
+			}
+
+			return value;
+		}
+
+		function findSpansByIndex(index) {
+			var nodes, spans = [];
+
+			nodes = Tools.toArray(editor.getBody().getElementsByTagName('span'));
+			if (nodes.length) {
+				for (var i = 0; i < nodes.length; i++) {
+					var nodeIndex = getElmIndex(nodes[i]);
+
+					if (nodeIndex === null || !nodeIndex.length) {
+						continue;
+					}
+
+					if (nodeIndex === index.toString()) {
+						spans.push(nodes[i]);
+					}
+				}
+			}
+
+			return spans;
+		}
+
+		editor.on('click', function(e) {
+			var target = e.target;
+
+			if (target.className == "mce-spellchecker-word") {
+				e.preventDefault();
+
+				var spans = findSpansByIndex(getElmIndex(target));
+
+				if (spans.length > 0) {
+					var rng = editor.dom.createRng();
+					rng.setStartBefore(spans[0]);
+					rng.setEndAfter(spans[spans.length - 1]);
+					editor.selection.setRng(rng);
+					showSuggestions(target.getAttribute('data-mce-word'), spans);
+				}
+			}
+		});
+
+		editor.addMenuItem('spellchecker', {
+			text: 'Spellcheck',
+			context: 'tools',
+			onclick: spellcheck,
+			selectable: true,
+			onPostRender: function() {
+				var self = this;
+
+				self.active(started);
+
+				editor.on('SpellcheckStart SpellcheckEnd', function() {
+					self.active(started);
+				});
+			}
+		});
+
+		function updateSelection(e) {
+			var selectedLanguage = settings.spellchecker_language;
+
+			e.control.items().each(function(ctrl) {
+				ctrl.active(ctrl.settings.data === selectedLanguage);
+			});
+		}
+
+		/**
+		 * Find the specified words and marks them. It will also show suggestions for those words.
+		 *
+		 * @example
+		 * editor.plugins.spellchecker.markErrors({
+		 *     dictionary: true,
+		 *     words: {
+		 *         "word1": ["suggestion 1", "Suggestion 2"]
+		 *     }
+		 * });
+		 * @param {Object} data Data object containing the words with suggestions.
+		 */
+		function markErrors(data) {
+			var suggestions;
+
+			if (data.words) {
+				hasDictionarySupport = !!data.dictionary;
+				suggestions = data.words;
+			} else {
+				// Fallback to old format
+				suggestions = data;
+			}
+
+			editor.setProgressState(false);
+
+			if (isEmpty(suggestions)) {
+				editor.windowManager.alert('No misspellings found');
+				started = false;
+				return;
+			}
+
+			lastSuggestions = suggestions;
+
+			getTextMatcher().find(getWordCharPattern()).filter(function(match) {
+				return !!suggestions[match.text];
+			}).wrap(function(match) {
+				return editor.dom.create('span', {
+					"class": 'mce-spellchecker-word',
+					"data-mce-bogus": 1,
+					"data-mce-word": match.text
+				});
+			});
+
+			started = true;
+			editor.fire('SpellcheckStart');
+		}
+
+		var buttonArgs = {
+			tooltip: 'Spellcheck',
+			onclick: spellcheck,
+			onPostRender: function() {
+				var self = this;
+
+				editor.on('SpellcheckStart SpellcheckEnd', function() {
+					self.active(started);
+				});
+			}
+		};
+
+		if (languageMenuItems.length > 1) {
+			buttonArgs.type = 'splitbutton';
+			buttonArgs.menu = languageMenuItems;
+			buttonArgs.onshow = updateSelection;
+			buttonArgs.onselect = function(e) {
+				settings.spellchecker_language = e.control.settings.data;
+			};
+		}
+
+		editor.addButton('spellchecker', buttonArgs);
+		editor.addCommand('mceSpellCheck', spellcheck);
+
+		editor.on('remove', function() {
+			if (suggestionsMenu) {
+				suggestionsMenu.remove();
+				suggestionsMenu = null;
+			}
+		});
+
+		editor.on('change', checkIfFinished);
+
+		this.getTextMatcher = getTextMatcher;
+		this.getWordCharPattern = getWordCharPattern;
+		this.markErrors = markErrors;
+		this.getLanguage = function() {
+			return settings.spellchecker_language;
+		};
+
+		// Set default spellchecker language if it's not specified
+		settings.spellchecker_language = settings.spellchecker_language || settings.language || 'en';
+	});
+});
+
+expose(["tinymce/spellcheckerplugin/DomTextMatcher"]);
+})(this);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/spellchecker/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+(function(b,g){var d={};function c(m,n){var l,j=[];for(var k=0;k<m.length;++k){l=d[m[k]]||e(m[k]);if(!l){throw"module definition dependecy not found: "+m[k]}j.push(l)}n.apply(null,j)}function h(k,j,i){if(typeof k!=="string"){throw"invalid module definition, module id must be defined and be a string"}if(j===g){throw"invalid module definition, dependencies must be specified"}if(i===g){throw"invalid module definition, definition function must be specified"}c(j,function(){d[k]=i.apply(null,arguments)})}function f(i){return !!d[i]}function e(l){var j=b;var i=l.split(/[.\/]/);for(var k=0;k<i.length;++k){if(!j[i[k]]){return}j=j[i[k]]}return j}function a(l){for(var k=0;k<l.length;k++){var m=b;var o=l[k];var j=o.split(/[.\/]/);for(var n=0;n<j.length-1;++n){if(m[j[n]]===g){m[j[n]]={}}m=m[j[n]]}m[j[j.length-1]]=d[o]}}h("tinymce/spellcheckerplugin/DomTextMatcher",[],function(){return function(C,n){var B,k=[],s,G=n.dom;var y,t,E;y=n.schema.getBlockElements();t=n.schema.getWhiteSpaceElements();E=n.schema.getShortEndedElements();function F(K,L){if(!K[0]){throw"findAndReplaceDOMText cannot handle zero-length matches"}return{start:K.index,end:K.index+K[0].length,text:K[0],data:L}}function i(K){var m;if(K.nodeType===3){return K.data}if(t[K.nodeName]&&!y[K.nodeName]){return""}m="";if(y[K.nodeName]||E[K.nodeName]){m+="\n"}if((K=K.firstChild)){do{m+=i(K)}while((K=K.nextSibling))}return m}function H(M,O,S){var K,R,P,L,T=[],Q=0,N=M,m,U=0;O=O.slice(0);O.sort(function(W,V){return W.start-V.start});m=O.shift();out:while(true){if(y[N.nodeName]||E[N.nodeName]){Q++}if(N.nodeType===3){if(!R&&N.length+Q>=m.end){R=N;L=m.end-Q}else{if(K){T.push(N)}}if(!K&&N.length+Q>m.start){K=N;P=m.start-Q}Q+=N.length}if(K&&R){N=S({startNode:K,startNodeIndex:P,endNode:R,endNodeIndex:L,innerNodes:T,match:m.text,matchIndex:U});Q-=(R.length-L);K=null;R=null;T=[];m=O.shift();U++;if(!m){break}}else{if((!t[N.nodeName]||y[N.nodeName])&&N.firstChild){N=N.firstChild;continue}else{if(N.nextSibling){N=N.nextSibling;continue}}}while(true){if(N.nextSibling){N=N.nextSibling;break}else{if(N.parentNode!==M){N=N.parentNode}else{break out}}}}}function v(K){function m(N,L){var M=k[L];if(!M.stencil){M.stencil=K(M)}var O=M.stencil.cloneNode(false);O.setAttribute("data-mce-index",L);if(N){O.appendChild(G.doc.createTextNode(N))}return O}return function(R){var Y,L,S,N=R.startNode,U=R.endNode,Z=R.matchIndex,aa=G.doc;if(N===U){var O=N;S=O.parentNode;if(R.startNodeIndex>0){Y=aa.createTextNode(O.data.substring(0,R.startNodeIndex));S.insertBefore(Y,O)}var M=m(R.match,Z);S.insertBefore(M,O);if(R.endNodeIndex<O.length){L=aa.createTextNode(O.data.substring(R.endNodeIndex));S.insertBefore(L,O)}O.parentNode.removeChild(O);return M}else{Y=aa.createTextNode(N.data.substring(0,R.startNodeIndex));L=aa.createTextNode(U.data.substring(R.endNodeIndex));var W=m(N.data.substring(R.startNodeIndex),Z);var V=[];for(var Q=0,P=R.innerNodes.length;Q<P;++Q){var ab=R.innerNodes[Q];var X=m(ab.data,Z);ab.parentNode.replaceChild(X,ab);V.push(X)}var T=m(U.data.substring(0,R.endNodeIndex),Z);S=N.parentNode;S.insertBefore(Y,N);S.insertBefore(W,N);S.removeChild(N);S=U.parentNode;S.insertBefore(T,U);S.insertBefore(L,U);S.removeChild(U);return T}}}function o(K){var m=K.parentNode;m.insertBefore(K.firstChild,K);K.parentNode.removeChild(K)}function D(m){var O=C.getElementsByTagName("*"),N=[];m=typeof m=="number"?""+m:null;for(var M=0;M<O.length;M++){var L=O[M],K=L.getAttribute("data-mce-index");if(K!==null&&K.length){if(K===m||m===null){N.push(L)}}}return N}function j(m){var K=k.length;while(K--){if(k[K]===m){return K}}return -1}function r(K){var m=[];l(function(L,M){if(K(L,M)){m.push(L)}});k=m;return this}function l(L){for(var K=0,m=k.length;K<m;K++){if(L(k[K],K)===false){break}}return this}function q(m){if(k.length){H(C,k,v(m))}return this}function x(m,K){if(s&&m.global){while((B=m.exec(s))){k.push(F(B,K))}}return this}function A(m){var K,L=D(m?j(m):null);K=L.length;while(K--){o(L[K])}return this}function z(m){return k[m.getAttribute("data-mce-index")]}function u(m){return D(j(m))[0]}function w(L,m,K){k.push({start:L,end:L+m,text:s.substr(L,m),data:K});return this}function p(K){var L=D(j(K));var m=n.dom.createRng();m.setStartBefore(L[0]);m.setEndAfter(L[L.length-1]);return m}function I(K,L){var m=p(K);m.deleteContents();if(L.length>0){m.insertNode(n.dom.doc.createTextNode(L))}return m}function J(){k.splice(0,k.length);A();return this}s=i(C);return{text:s,matches:k,each:l,filter:r,reset:J,matchFromElement:z,elementFromMatch:u,find:x,add:w,wrap:q,unwrap:A,replace:I,rangeFromMatch:p,indexOf:j}}});h("tinymce/spellcheckerplugin/Plugin",["tinymce/spellcheckerplugin/DomTextMatcher","tinymce/PluginManager","tinymce/util/Tools","tinymce/ui/Menu","tinymce/dom/DOMUtils","tinymce/util/XHR","tinymce/util/URI","tinymce/util/JSON"],function(p,k,j,m,n,l,i,o){k.add("spellchecker",function(r,u){var z,A=this,Q,q,H,M=r.settings;var N;function P(){if(!A.textMatcher){A.textMatcher=new p(r.getBody(),r)}return A.textMatcher}function I(T,R){var S=[];j.each(R,function(U){S.push({selectable:true,text:U.name,data:U.value})});return S}var J=M.spellchecker_languages||"English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr_FR,German=de,Italian=it,Polish=pl,Portuguese=pt_BR,Spanish=es,Swedish=sv";z=I("Language",j.map(J.split(","),function(R){R=R.split("=");return{name:R[0],value:R[1]}}));function y(S){for(var R in S){return false}return true}function s(W,U){var T=[],R=Q[W];j.each(R,function(Y){T.push({text:Y,onclick:function(){r.insertContent(r.dom.encode(Y));r.dom.remove(U);K()}})});T.push({text:"-"});if(N){T.push({text:"Add to Dictionary",onclick:function(){v(W,U)}})}T.push.apply(T,[{text:"Ignore",onclick:function(){C(W,U)}},{text:"Ignore all",onclick:function(){C(W,U,true)}}]);H=new m({items:T,context:"contextmenu",onautohide:function(Y){if(Y.target.className.indexOf("spellchecker")!=-1){Y.preventDefault()}},onhide:function(){H.remove();H=null}});H.renderTo(document.body);var X=n.DOM.getPos(r.getContentAreaContainer());var V=r.dom.getPos(U[0]);var S=r.dom.getRoot();if(S.nodeName=="BODY"){V.x-=S.ownerDocument.documentElement.scrollLeft||S.scrollLeft;V.y-=S.ownerDocument.documentElement.scrollTop||S.scrollTop}else{V.x-=S.scrollLeft;V.y-=S.scrollTop}X.x+=V.x;X.y+=V.y;H.moveTo(X.x,X.y+U[0].offsetHeight)}function G(){return r.getParam("spellchecker_wordchar_pattern")||new RegExp('[^\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`\u00a7\u00a9\u00ab\u00ae\u00b1\u00b6\u00b7\u00b8\u00bb\u00bc\u00bd\u00be\u00bf\u00d7\u00f7\u00a4\u201d\u201c\u201e\u00a0\u2002\u2003\u2009]+',"g")}function t(W,V,S,T){var U={method:W},R="";if(W=="spellcheck"){U.text=V;U.lang=M.spellchecker_language}if(W=="addToDictionary"){U.word=V}j.each(U,function(Y,X){if(R){R+="&"}R+=X+"="+encodeURIComponent(Y)});l.send({url:new i(u).toAbsolute(M.spellchecker_rpc_url),type:"post",content_type:"application/x-www-form-urlencoded",data:R,success:function(X){X=o.parse(X);if(!X){T("Sever response wasn't proper JSON.")}else{if(X.error){T(X.error)}else{S(X)}}},error:function(X,Y){T("Spellchecker request error: "+Y.status)}})}function L(U,V,R,T){var S=M.spellchecker_callback||t;S.call(A,U,V,R,T)}function O(){if(q){F();return}else{F()}function R(S){r.windowManager.alert(S);r.setProgressState(false);F()}r.setProgressState(true);L("spellcheck",P().text,B,R);r.focus()}function K(){if(!r.dom.select("span.mce-spellchecker-word").length){F()}}function v(S,R){r.setProgressState(true);L("addToDictionary",S,function(){r.setProgressState(false);r.dom.remove(R,true);K()},function(T){r.windowManager.alert(T);r.setProgressState(false)})}function C(T,R,S){r.selection.collapse();if(S){j.each(r.dom.select("span.mce-spellchecker-word"),function(U){if(U.getAttribute("data-mce-word")==T){r.dom.remove(U,true)}})}else{r.dom.remove(R,true)}K()}function F(){P().reset();A.textMatcher=null;if(q){q=false;r.fire("SpellcheckEnd")}}function x(S){var R=S.getAttribute("data-mce-index");if(typeof R=="number"){return""+R}return R}function w(S){var R,U=[];R=j.toArray(r.getBody().getElementsByTagName("span"));if(R.length){for(var T=0;T<R.length;T++){var V=x(R[T]);if(V===null||!V.length){continue}if(V===S.toString()){U.push(R[T])}}}return U}r.on("click",function(U){var T=U.target;if(T.className=="mce-spellchecker-word"){U.preventDefault();var S=w(x(T));if(S.length>0){var R=r.dom.createRng();R.setStartBefore(S[0]);R.setEndAfter(S[S.length-1]);r.selection.setRng(R);s(T.getAttribute("data-mce-word"),S)}}});r.addMenuItem("spellchecker",{text:"Spellcheck",context:"tools",onclick:O,selectable:true,onPostRender:function(){var R=this;R.active(q);r.on("SpellcheckStart SpellcheckEnd",function(){R.active(q)})}});function E(S){var R=M.spellchecker_language;S.control.items().each(function(T){T.active(T.settings.data===R)})}function B(S){var R;if(S.words){N=!!S.dictionary;R=S.words}else{R=S}r.setProgressState(false);if(y(R)){r.windowManager.alert("No misspellings found");q=false;return}Q=R;P().find(G()).filter(function(T){return !!R[T.text]}).wrap(function(T){return r.dom.create("span",{"class":"mce-spellchecker-word","data-mce-bogus":1,"data-mce-word":T.text})});q=true;r.fire("SpellcheckStart")}var D={tooltip:"Spellcheck",onclick:O,onPostRender:function(){var R=this;r.on("SpellcheckStart SpellcheckEnd",function(){R.active(q)})}};if(z.length>1){D.type="splitbutton";D.menu=z;D.onshow=E;D.onselect=function(R){M.spellchecker_language=R.control.settings.data}}r.addButton("spellchecker",D);r.addCommand("mceSpellCheck",O);r.on("remove",function(){if(H){H.remove();H=null}});r.on("change",K);this.getTextMatcher=P;this.getWordCharPattern=G;this.markErrors=B;this.getLanguage=function(){return M.spellchecker_language};M.spellchecker_language=M.spellchecker_language||M.language||"en"})});a(["tinymce/spellcheckerplugin/DomTextMatcher"])})(this);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/tabfocus/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,120 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('tabfocus', function(editor) {
+	var DOM = tinymce.DOM, each = tinymce.each, explode = tinymce.explode;
+
+	function tabCancel(e) {
+		if (e.keyCode === 9 && !e.ctrlKey && !e.altKey && !e.metaKey) {
+			e.preventDefault();
+		}
+	}
+
+	function tabHandler(e) {
+		var x, el, v, i;
+
+		if (e.keyCode !== 9 || e.ctrlKey || e.altKey || e.metaKey || e.isDefaultPrevented()) {
+			return;
+		}
+
+		function find(direction) {
+			el = DOM.select(':input:enabled,*[tabindex]:not(iframe)');
+
+			function canSelectRecursive(e) {
+				return e.nodeName === "BODY" || (e.type != 'hidden' &&
+					e.style.display != "none" &&
+					e.style.visibility != "hidden" && canSelectRecursive(e.parentNode));
+			}
+
+			function canSelect(el) {
+				return /INPUT|TEXTAREA|BUTTON/.test(el.tagName) && tinymce.get(e.id) && el.tabIndex != -1 && canSelectRecursive(el);
+			}
+
+			each(el, function(e, i) {
+				if (e.id == editor.id) {
+					x = i;
+					return false;
+				}
+			});
+			if (direction > 0) {
+				for (i = x + 1; i < el.length; i++) {
+					if (canSelect(el[i])) {
+						return el[i];
+					}
+				}
+			} else {
+				for (i = x - 1; i >= 0; i--) {
+					if (canSelect(el[i])) {
+						return el[i];
+					}
+				}
+			}
+
+			return null;
+		}
+
+		v = explode(editor.getParam('tab_focus', editor.getParam('tabfocus_elements', ':prev,:next')));
+
+		if (v.length == 1) {
+			v[1] = v[0];
+			v[0] = ':prev';
+		}
+
+		// Find element to focus
+		if (e.shiftKey) {
+			if (v[0] == ':prev') {
+				el = find(-1);
+			} else {
+				el = DOM.get(v[0]);
+			}
+		} else {
+			if (v[1] == ':next') {
+				el = find(1);
+			} else {
+				el = DOM.get(v[1]);
+			}
+		}
+
+		if (el) {
+			var focusEditor = tinymce.get(el.id || el.name);
+
+			if (el.id && focusEditor) {
+				focusEditor.focus();
+			} else {
+				window.setTimeout(function() {
+					if (!tinymce.Env.webkit) {
+						window.focus();
+					}
+
+					el.focus();
+				}, 10);
+			}
+
+			e.preventDefault();
+		}
+	}
+
+	editor.on('init', function() {
+		if (editor.inline) {
+			// Remove default tabIndex in inline mode
+			tinymce.DOM.setAttrib(editor.getBody(), 'tabIndex', null);
+		}
+
+		editor.on('keyup', tabCancel);
+
+		if (tinymce.Env.gecko) {
+			editor.on('keypress keydown', tabHandler);
+		} else {
+			editor.on('keydown', tabHandler);
+		}
+	});
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/tabfocus/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("tabfocus",function(d){var e=tinymce.DOM,f=tinymce.each,c=tinymce.explode;function a(g){if(g.keyCode===9&&!g.ctrlKey&&!g.altKey&&!g.metaKey){g.preventDefault()}}function b(m){var g,k,h,j;if(m.keyCode!==9||m.ctrlKey||m.altKey||m.metaKey||m.isDefaultPrevented()){return}function n(p){k=e.select(":input:enabled,*[tabindex]:not(iframe)");function o(q){return q.nodeName==="BODY"||(q.type!="hidden"&&q.style.display!="none"&&q.style.visibility!="hidden"&&o(q.parentNode))}function i(q){return/INPUT|TEXTAREA|BUTTON/.test(q.tagName)&&tinymce.get(m.id)&&q.tabIndex!=-1&&o(q)}f(k,function(r,q){if(r.id==d.id){g=q;return false}});if(p>0){for(j=g+1;j<k.length;j++){if(i(k[j])){return k[j]}}}else{for(j=g-1;j>=0;j--){if(i(k[j])){return k[j]}}}return null}h=c(d.getParam("tab_focus",d.getParam("tabfocus_elements",":prev,:next")));if(h.length==1){h[1]=h[0];h[0]=":prev"}if(m.shiftKey){if(h[0]==":prev"){k=n(-1)}else{k=e.get(h[0])}}else{if(h[1]==":next"){k=n(1)}else{k=e.get(h[1])}}if(k){var l=tinymce.get(k.id||k.name);if(k.id&&l){l.focus()}else{window.setTimeout(function(){if(!tinymce.Env.webkit){window.focus()}k.focus()},10)}m.preventDefault()}}d.on("init",function(){if(d.inline){tinymce.DOM.setAttrib(d.getBody(),"tabIndex",null)}d.on("keyup",a);if(tinymce.Env.gecko){d.on("keypress keydown",b)}else{d.on("keydown",b)}})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/table/classes/CellSelection.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,176 @@
+/**
+ * CellSelection.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles table cell selection by faking it using a css class that gets applied
+ * to cells when dragging the mouse from one cell to another.
+ *
+ * @class tinymce.tableplugin.CellSelection
+ * @private
+ */
+define("tinymce/tableplugin/CellSelection", [
+	"tinymce/tableplugin/TableGrid",
+	"tinymce/dom/TreeWalker",
+	"tinymce/util/Tools"
+], function(TableGrid, TreeWalker, Tools) {
+	return function(editor) {
+		var dom = editor.dom, tableGrid, startCell, startTable, hasCellSelection = true, resizing;
+
+		function clear(force) {
+			// Restore selection possibilities
+			editor.getBody().style.webkitUserSelect = '';
+
+			if (force || hasCellSelection) {
+				editor.dom.removeClass(
+					editor.dom.select('td.mce-item-selected,th.mce-item-selected'),
+					'mce-item-selected'
+				);
+
+				hasCellSelection = false;
+			}
+		}
+
+		function cellSelectionHandler(e) {
+			var sel, table, target = e.target;
+
+			if (resizing) {
+				return;
+			}
+
+			if (startCell && (tableGrid || target != startCell) && (target.nodeName == 'TD' || target.nodeName == 'TH')) {
+				table = dom.getParent(target, 'table');
+				if (table == startTable) {
+					if (!tableGrid) {
+						tableGrid = new TableGrid(editor, table);
+						tableGrid.setStartCell(startCell);
+
+						editor.getBody().style.webkitUserSelect = 'none';
+					}
+
+					tableGrid.setEndCell(target);
+					hasCellSelection = true;
+				}
+
+				// Remove current selection
+				sel = editor.selection.getSel();
+
+				try {
+					if (sel.removeAllRanges) {
+						sel.removeAllRanges();
+					} else {
+						sel.empty();
+					}
+				} catch (ex) {
+					// IE9 might throw errors here
+				}
+
+				e.preventDefault();
+			}
+		}
+
+		// Add cell selection logic
+		editor.on('MouseDown', function(e) {
+			if (e.button != 2 && !resizing) {
+				clear();
+
+				startCell = dom.getParent(e.target, 'td,th');
+				startTable = dom.getParent(startCell, 'table');
+			}
+		});
+
+		editor.on('mouseover', cellSelectionHandler);
+
+		editor.on('remove', function() {
+			dom.unbind(editor.getDoc(), 'mouseover', cellSelectionHandler);
+		});
+
+		editor.on('MouseUp', function() {
+			var rng, sel = editor.selection, selectedCells, walker, node, lastNode;
+
+			function setPoint(node, start) {
+				var walker = new TreeWalker(node, node);
+
+				do {
+					// Text node
+					if (node.nodeType == 3 && Tools.trim(node.nodeValue).length !== 0) {
+						if (start) {
+							rng.setStart(node, 0);
+						} else {
+							rng.setEnd(node, node.nodeValue.length);
+						}
+
+						return;
+					}
+
+					// BR element
+					if (node.nodeName == 'BR') {
+						if (start) {
+							rng.setStartBefore(node);
+						} else {
+							rng.setEndBefore(node);
+						}
+
+						return;
+					}
+				} while ((node = (start ? walker.next() : walker.prev())));
+			}
+
+			// Move selection to startCell
+			if (startCell) {
+				if (tableGrid) {
+					editor.getBody().style.webkitUserSelect = '';
+				}
+
+				// Try to expand text selection as much as we can only Gecko supports cell selection
+				selectedCells = dom.select('td.mce-item-selected,th.mce-item-selected');
+				if (selectedCells.length > 0) {
+					rng = dom.createRng();
+					node = selectedCells[0];
+					rng.setStartBefore(node);
+					rng.setEndAfter(node);
+
+					setPoint(node, 1);
+					walker = new TreeWalker(node, dom.getParent(selectedCells[0], 'table'));
+
+					do {
+						if (node.nodeName == 'TD' || node.nodeName == 'TH') {
+							if (!dom.hasClass(node, 'mce-item-selected')) {
+								break;
+							}
+
+							lastNode = node;
+						}
+					} while ((node = walker.next()));
+
+					setPoint(lastNode);
+
+					sel.setRng(rng);
+				}
+
+				editor.nodeChanged();
+				startCell = tableGrid = startTable = null;
+			}
+		});
+
+		editor.on('KeyUp Drop SetContent', function(e) {
+			clear(e.type == 'setcontent');
+			startCell = tableGrid = startTable = null;
+			resizing = false;
+		});
+
+		editor.on('ObjectResizeStart ObjectResized', function(e) {
+			resizing = e.type != 'objectresized';
+		});
+
+		return {
+			clear: clear
+		};
+	};
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/table/classes/Dialogs.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,824 @@
+/**
+ * Dialogs.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*eslint dot-notation:0*/
+
+/**
+ * ...
+ *
+ * @class tinymce.tableplugin.Dialogs
+ * @private
+ */
+define("tinymce/tableplugin/Dialogs", [
+	"tinymce/util/Tools",
+	"tinymce/Env"
+], function(Tools, Env) {
+	var each = Tools.each;
+
+	return function(editor) {
+		var self = this;
+
+		function createColorPickAction() {
+			var colorPickerCallback = editor.settings.color_picker_callback;
+
+			if (colorPickerCallback) {
+				return function() {
+					var self = this;
+
+					colorPickerCallback.call(
+						editor,
+						function(value) {
+							self.value(value).fire('change');
+						},
+						self.value()
+					);
+				};
+			}
+		}
+
+		function createStyleForm(dom) {
+			return {
+				title: 'Advanced',
+				type: 'form',
+				defaults: {
+					onchange: function() {
+						updateStyle(dom, this.parents().reverse()[0], this.name() == "style");
+					}
+				},
+				items: [
+					{
+						label: 'Style',
+						name: 'style',
+						type: 'textbox'
+					},
+
+					{
+						type: 'form',
+						padding: 0,
+						formItemDefaults: {
+							layout: 'grid',
+							alignH: ['start', 'right']
+						},
+						defaults: {
+							size: 7
+						},
+						items: [
+							{
+								label: 'Border color',
+								type: 'colorbox',
+								name: 'borderColor',
+								onaction: createColorPickAction()
+							},
+
+							{
+								label: 'Background color',
+								type: 'colorbox',
+								name: 'backgroundColor',
+								onaction: createColorPickAction()
+							}
+						]
+					}
+				]
+			};
+		}
+
+		function removePxSuffix(size) {
+			return size ? size.replace(/px$/, '') : "";
+		}
+
+		function addSizeSuffix(size) {
+			if (/^[0-9]+$/.test(size)) {
+				size += "px";
+			}
+
+			return size;
+		}
+
+		function unApplyAlign(elm) {
+			each('left center right'.split(' '), function(name) {
+				editor.formatter.remove('align' + name, {}, elm);
+			});
+		}
+
+		function unApplyVAlign(elm) {
+			each('top middle bottom'.split(' '), function(name) {
+				editor.formatter.remove('valign' + name, {}, elm);
+			});
+		}
+
+		function buildListItems(inputList, itemCallback, startItems) {
+			function appendItems(values, output) {
+				output = output || [];
+
+				Tools.each(values, function(item) {
+					var menuItem = {text: item.text || item.title};
+
+					if (item.menu) {
+						menuItem.menu = appendItems(item.menu);
+					} else {
+						menuItem.value = item.value;
+
+						if (itemCallback) {
+							itemCallback(menuItem);
+						}
+					}
+
+					output.push(menuItem);
+				});
+
+				return output;
+			}
+
+			return appendItems(inputList, startItems || []);
+		}
+
+		function updateStyle(dom, win, isStyleCtrl) {
+			var data = win.toJSON();
+			var css = dom.parseStyle(data.style);
+
+			if (isStyleCtrl) {
+				win.find('#borderColor').value(css["border-color"] || '')[0].fire('change');
+				win.find('#backgroundColor').value(css["background-color"] || '')[0].fire('change');
+			} else {
+				css["border-color"] = data.borderColor;
+				css["background-color"] = data.backgroundColor;
+			}
+
+			win.find('#style').value(dom.serializeStyle(dom.parseStyle(dom.serializeStyle(css))));
+		}
+
+		function appendStylesToData(dom, data, elm) {
+			var css = dom.parseStyle(dom.getAttrib(elm, 'style'));
+
+			if (css["border-color"]) {
+				data.borderColor = css["border-color"];
+			}
+
+			if (css["background-color"]) {
+				data.backgroundColor = css["background-color"];
+			}
+
+			data.style = dom.serializeStyle(css);
+		}
+
+		function mergeStyles(dom, elm, styles) {
+			var css = dom.parseStyle(dom.getAttrib(elm, 'style'));
+
+			each(styles, function(style) {
+				css[style.name] = style.value;
+			});
+
+			dom.setAttrib(elm, 'style', dom.serializeStyle(dom.parseStyle(dom.serializeStyle(css))));
+		}
+
+		self.tableProps = function() {
+			self.table(true);
+		};
+
+		self.table = function(isProps) {
+			var dom = editor.dom, tableElm, colsCtrl, rowsCtrl, classListCtrl, data = {}, generalTableForm, stylesToMerge;
+
+			function onSubmitTableForm() {
+
+				//Explore the layers of the table till we find the first layer of tds or ths
+				function styleTDTH (elm, name, value) {
+					if (elm.tagName === "TD" || elm.tagName === "TH") {
+						dom.setStyle(elm, name, value);
+					} else {
+						if (elm.children) {
+							for (var i = 0; i < elm.children.length; i++) {
+								styleTDTH(elm.children[i], name, value);
+							}
+						}
+					}
+				}
+
+				var captionElm;
+
+				updateStyle(dom, this);
+				data = Tools.extend(data, this.toJSON());
+
+				if (data["class"] === false) {
+					delete data["class"];
+				}
+
+				editor.undoManager.transact(function() {
+					if (!tableElm) {
+						tableElm = editor.plugins.table.insertTable(data.cols || 1, data.rows || 1);
+					}
+
+					editor.dom.setAttribs(tableElm, {
+						style: data.style,
+						'class': data['class']
+					});
+
+					if (editor.settings.table_style_by_css) {
+						stylesToMerge = [];
+						stylesToMerge.push({name: 'border', value: data.border});
+						stylesToMerge.push({name: 'border-spacing', value: addSizeSuffix(data.cellspacing)});
+						mergeStyles(dom, tableElm, stylesToMerge);
+						dom.setAttribs(tableElm, {
+							'data-mce-border-color': data.borderColor,
+							'data-mce-cell-padding': data.cellpadding,
+							'data-mce-border': data.border
+						});
+						if (tableElm.children) {
+							for (var i = 0; i < tableElm.children.length; i++) {
+								styleTDTH(tableElm.children[i], 'border', data.border);
+								styleTDTH(tableElm.children[i], 'padding', addSizeSuffix(data.cellpadding));
+							}
+						}
+					} else {
+						editor.dom.setAttribs(tableElm, {
+							border: data.border,
+							cellpadding: data.cellpadding,
+							cellspacing: data.cellspacing
+						});
+					}
+
+					if (dom.getAttrib(tableElm, 'width') && !editor.settings.table_style_by_css) {
+						dom.setAttrib(tableElm, 'width', removePxSuffix(data.width));
+					} else {
+						dom.setStyle(tableElm, 'width', addSizeSuffix(data.width));
+					}
+
+					dom.setStyle(tableElm, 'height', addSizeSuffix(data.height));
+
+					// Toggle caption on/off
+					captionElm = dom.select('caption', tableElm)[0];
+
+					if (captionElm && !data.caption) {
+						dom.remove(captionElm);
+					}
+
+					if (!captionElm && data.caption) {
+						captionElm = dom.create('caption');
+						captionElm.innerHTML = !Env.ie ? '<br data-mce-bogus="1"/>' : '\u00a0';
+						tableElm.insertBefore(captionElm, tableElm.firstChild);
+					}
+					unApplyAlign(tableElm);
+					if (data.align) {
+						editor.formatter.apply('align' + data.align, {}, tableElm);
+					}
+
+					editor.focus();
+					editor.addVisual();
+				});
+			}
+
+			function getTDTHOverallStyle (elm, name) {
+				var cells = editor.dom.select("td,th", elm), firstChildStyle;
+
+				function checkChildren(firstChildStyle, elms) {
+
+					for (var i = 0; i < elms.length; i++) {
+						var currentStyle = dom.getStyle(elms[i], name);
+						if (typeof firstChildStyle === "undefined") {
+							firstChildStyle = currentStyle;
+						}
+						if (firstChildStyle != currentStyle) {
+							return "";
+						}
+					}
+
+					return firstChildStyle;
+
+				}
+
+				firstChildStyle = checkChildren(firstChildStyle, cells);
+
+				return firstChildStyle;
+			}
+
+			if (isProps === true) {
+				tableElm = dom.getParent(editor.selection.getStart(), 'table');
+
+				if (tableElm) {
+					data = {
+						width: removePxSuffix(dom.getStyle(tableElm, 'width') || dom.getAttrib(tableElm, 'width')),
+						height: removePxSuffix(dom.getStyle(tableElm, 'height') || dom.getAttrib(tableElm, 'height')),
+						cellspacing: removePxSuffix(dom.getStyle(tableElm, 'border-spacing') ||
+							dom.getAttrib(tableElm, 'cellspacing')),
+						cellpadding: dom.getAttrib(tableElm, 'data-mce-cell-padding') || dom.getAttrib(tableElm, 'cellpadding') ||
+							getTDTHOverallStyle(tableElm, 'padding'),
+						border: dom.getAttrib(tableElm, 'data-mce-border') || dom.getAttrib(tableElm, 'border') ||
+							getTDTHOverallStyle(tableElm, 'border'),
+						borderColor: dom.getAttrib(tableElm, 'data-mce-border-color'),
+						caption: !!dom.select('caption', tableElm)[0],
+						'class': dom.getAttrib(tableElm, 'class')
+					};
+
+					each('left center right'.split(' '), function(name) {
+						if (editor.formatter.matchNode(tableElm, 'align' + name)) {
+							data.align = name;
+						}
+					});
+				}
+			} else {
+				colsCtrl = {label: 'Cols', name: 'cols'};
+				rowsCtrl = {label: 'Rows', name: 'rows'};
+			}
+
+			if (editor.settings.table_class_list) {
+				if (data["class"]) {
+					data["class"] = data["class"].replace(/\s*mce\-item\-table\s*/g, '');
+				}
+
+				classListCtrl = {
+					name: 'class',
+					type: 'listbox',
+					label: 'Class',
+					values: buildListItems(
+						editor.settings.table_class_list,
+						function(item) {
+							if (item.value) {
+								item.textStyle = function() {
+									return editor.formatter.getCssText({block: 'table', classes: [item.value]});
+								};
+							}
+						}
+					)
+				};
+			}
+
+			generalTableForm = {
+				type: 'form',
+				layout: 'flex',
+				direction: 'column',
+				labelGapCalc: 'children',
+				padding: 0,
+				items: [
+					{
+						type: 'form',
+						labelGapCalc: false,
+						padding: 0,
+						layout: 'grid',
+						columns: 2,
+						defaults: {
+							type: 'textbox',
+							maxWidth: 50
+						},
+						items: (editor.settings.table_appearance_options !== false) ? [
+							colsCtrl,
+							rowsCtrl,
+							{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'}
+						] : [
+							colsCtrl,
+							rowsCtrl,
+							{label: 'Width', name: 'width'},
+							{label: 'Height', name: 'height'}
+						]
+					},
+
+					{
+						label: 'Alignment',
+						name: 'align',
+						type: 'listbox',
+						text: 'None',
+						values: [
+							{text: 'None', value: ''},
+							{text: 'Left', value: 'left'},
+							{text: 'Center', value: 'center'},
+							{text: 'Right', value: 'right'}
+						]
+					},
+
+					classListCtrl
+				]
+			};
+
+			if (editor.settings.table_advtab !== false) {
+				appendStylesToData(dom, data, tableElm);
+
+				editor.windowManager.open({
+					title: "Table properties",
+					data: data,
+					bodyType: 'tabpanel',
+					body: [
+						{
+							title: 'General',
+							type: 'form',
+							items: generalTableForm
+						},
+						createStyleForm(dom)
+					],
+
+					onsubmit: onSubmitTableForm
+				});
+			} else {
+				editor.windowManager.open({
+					title: "Table properties",
+					data: data,
+					body: generalTableForm,
+					onsubmit: onSubmitTableForm
+				});
+			}
+		};
+
+		self.merge = function(grid, cell) {
+			editor.windowManager.open({
+				title: "Merge cells",
+				body: [
+					{label: 'Cols', name: 'cols', type: 'textbox', value: '1', size: 10},
+					{label: 'Rows', name: 'rows', type: 'textbox', value: '1', size: 10}
+				],
+				onsubmit: function() {
+					var data = this.toJSON();
+
+					editor.undoManager.transact(function() {
+						grid.merge(cell, data.cols, data.rows);
+					});
+				}
+			});
+		};
+
+		self.cell = function() {
+			var dom = editor.dom, cellElm, data, classListCtrl, cells = [];
+
+			function onSubmitCellForm() {
+				updateStyle(dom, this);
+				data = Tools.extend(data, this.toJSON());
+
+				editor.undoManager.transact(function() {
+					each(cells, function(cellElm) {
+						editor.dom.setAttribs(cellElm, {
+							scope: data.scope,
+							style: data.style,
+							'class': data['class']
+						});
+
+						editor.dom.setStyles(cellElm, {
+							width: addSizeSuffix(data.width),
+							height: addSizeSuffix(data.height)
+						});
+
+						// Switch cell type
+						if (data.type && cellElm.nodeName.toLowerCase() != data.type) {
+							cellElm = dom.rename(cellElm, data.type);
+						}
+
+						// Apply/remove alignment
+						unApplyAlign(cellElm);
+						if (data.align) {
+							editor.formatter.apply('align' + data.align, {}, cellElm);
+						}
+
+						// Apply/remove vertical alignment
+						unApplyVAlign(cellElm);
+						if (data.valign) {
+							editor.formatter.apply('valign' + data.valign, {}, cellElm);
+						}
+					});
+
+					editor.focus();
+				});
+			}
+
+			// Get selected cells or the current cell
+			cells = editor.dom.select('td.mce-item-selected,th.mce-item-selected');
+			cellElm = editor.dom.getParent(editor.selection.getStart(), 'td,th');
+			if (!cells.length && cellElm) {
+				cells.push(cellElm);
+			}
+
+			cellElm = cellElm || cells[0];
+
+			if (!cellElm) {
+				// If this element is null, return now to avoid crashing.
+				return;
+			}
+
+			data = {
+				width: removePxSuffix(dom.getStyle(cellElm, 'width') || dom.getAttrib(cellElm, 'width')),
+				height: removePxSuffix(dom.getStyle(cellElm, 'height') || dom.getAttrib(cellElm, 'height')),
+				scope: dom.getAttrib(cellElm, 'scope'),
+				'class': dom.getAttrib(cellElm, 'class')
+			};
+
+			data.type = cellElm.nodeName.toLowerCase();
+
+			each('left center right'.split(' '), function(name) {
+				if (editor.formatter.matchNode(cellElm, 'align' + name)) {
+					data.align = name;
+				}
+			});
+
+			each('top middle bottom'.split(' '), function(name) {
+				if (editor.formatter.matchNode(cellElm, 'valign' + name)) {
+					data.valign = name;
+				}
+			});
+
+			if (editor.settings.table_cell_class_list) {
+				classListCtrl = {
+					name: 'class',
+					type: 'listbox',
+					label: 'Class',
+					values: buildListItems(
+						editor.settings.table_cell_class_list,
+						function(item) {
+							if (item.value) {
+								item.textStyle = function() {
+									return editor.formatter.getCssText({block: 'td', classes: [item.value]});
+								};
+							}
+						}
+					)
+				};
+			}
+
+			var generalCellForm = {
+				type: 'form',
+				layout: 'flex',
+				direction: 'column',
+				labelGapCalc: 'children',
+				padding: 0,
+				items: [
+					{
+						type: 'form',
+						layout: 'grid',
+						columns: 2,
+						labelGapCalc: false,
+						padding: 0,
+						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,
+								values: [
+									{text: 'Cell', value: 'td'},
+									{text: 'Header cell', value: 'th'}
+								]
+							},
+							{
+								label: 'Scope',
+								name: 'scope',
+								type: 'listbox',
+								text: 'None',
+								minWidth: 90,
+								maxWidth: null,
+								values: [
+									{text: 'None', value: ''},
+									{text: 'Row', value: 'row'},
+									{text: 'Column', value: 'col'},
+									{text: 'Row group', value: 'rowgroup'},
+									{text: 'Column group', value: 'colgroup'}
+								]
+							},
+							{
+								label: 'H Align',
+								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'}
+								]
+							},
+							{
+								label: 'V Align',
+								name: 'valign',
+								type: 'listbox',
+								text: 'None',
+								minWidth: 90,
+								maxWidth: null,
+								values: [
+									{text: 'None', value: ''},
+									{text: 'Top', value: 'top'},
+									{text: 'Middle', value: 'middle'},
+									{text: 'Bottom', value: 'bottom'}
+								]
+							}
+						]
+					},
+
+					classListCtrl
+				]
+			};
+
+			if (editor.settings.table_cell_advtab !== false) {
+				appendStylesToData(dom, data, cellElm);
+
+				editor.windowManager.open({
+					title: "Cell properties",
+					bodyType: 'tabpanel',
+					data: data,
+					body: [
+						{
+							title: 'General',
+							type: 'form',
+							items: generalCellForm
+						},
+
+						createStyleForm(dom)
+					],
+
+					onsubmit: onSubmitCellForm
+				});
+			} else {
+				editor.windowManager.open({
+					title: "Cell properties",
+					data: data,
+					body: generalCellForm,
+					onsubmit: onSubmitCellForm
+				});
+			}
+		};
+
+		self.row = function() {
+			var dom = editor.dom, tableElm, cellElm, rowElm, classListCtrl, data, rows = [], generalRowForm;
+
+			function onSubmitRowForm() {
+				var tableElm, oldParentElm, parentElm;
+
+				updateStyle(dom, this);
+				data = Tools.extend(data, this.toJSON());
+
+				editor.undoManager.transact(function() {
+					var toType = data.type;
+
+					each(rows, function(rowElm) {
+						editor.dom.setAttribs(rowElm, {
+							scope: data.scope,
+							style: data.style,
+							'class': data['class']
+						});
+
+						editor.dom.setStyles(rowElm, {
+							height: addSizeSuffix(data.height)
+						});
+
+						if (toType != rowElm.parentNode.nodeName.toLowerCase()) {
+							tableElm = dom.getParent(rowElm, 'table');
+
+							oldParentElm = rowElm.parentNode;
+							parentElm = dom.select(toType, tableElm)[0];
+							if (!parentElm) {
+								parentElm = dom.create(toType);
+								if (tableElm.firstChild) {
+									tableElm.insertBefore(parentElm, tableElm.firstChild);
+								} else {
+									tableElm.appendChild(parentElm);
+								}
+							}
+
+							parentElm.appendChild(rowElm);
+
+							if (!oldParentElm.hasChildNodes()) {
+								dom.remove(oldParentElm);
+							}
+						}
+
+						// Apply/remove alignment
+						unApplyAlign(rowElm);
+						if (data.align) {
+							editor.formatter.apply('align' + data.align, {}, rowElm);
+						}
+					});
+
+					editor.focus();
+				});
+			}
+
+			tableElm = editor.dom.getParent(editor.selection.getStart(), 'table');
+			cellElm = editor.dom.getParent(editor.selection.getStart(), 'td,th');
+
+			each(tableElm.rows, function(row) {
+				each(row.cells, function(cell) {
+					if (dom.hasClass(cell, 'mce-item-selected') || cell == cellElm) {
+						rows.push(row);
+						return false;
+					}
+				});
+			});
+
+			rowElm = rows[0];
+			if (!rowElm) {
+				// If this element is null, return now to avoid crashing.
+				return;
+			}
+
+			data = {
+				height: removePxSuffix(dom.getStyle(rowElm, 'height') || dom.getAttrib(rowElm, 'height')),
+				scope: dom.getAttrib(rowElm, 'scope'),
+				'class': dom.getAttrib(rowElm, 'class')
+			};
+
+			data.type = rowElm.parentNode.nodeName.toLowerCase();
+
+			each('left center right'.split(' '), function(name) {
+				if (editor.formatter.matchNode(rowElm, 'align' + name)) {
+					data.align = name;
+				}
+			});
+
+			if (editor.settings.table_row_class_list) {
+				classListCtrl = {
+					name: 'class',
+					type: 'listbox',
+					label: 'Class',
+					values: buildListItems(
+						editor.settings.table_row_class_list,
+						function(item) {
+							if (item.value) {
+								item.textStyle = function() {
+									return editor.formatter.getCssText({block: 'tr', classes: [item.value]});
+								};
+							}
+						}
+					)
+				};
+			}
+
+			generalRowForm = {
+				type: 'form',
+				columns: 2,
+				padding: 0,
+				defaults: {
+					type: 'textbox'
+				},
+				items: [
+					{
+						type: 'listbox',
+						name: 'type',
+						label: 'Row type',
+						text: 'None',
+						maxWidth: null,
+						values: [
+							{text: 'Header', value: 'thead'},
+							{text: 'Body', value: 'tbody'},
+							{text: 'Footer', value: 'tfoot'}
+						]
+					},
+					{
+						type: 'listbox',
+						name: 'align',
+						label: 'Alignment',
+						text: 'None',
+						maxWidth: null,
+						values: [
+							{text: 'None', value: ''},
+							{text: 'Left', value: 'left'},
+							{text: 'Center', value: 'center'},
+							{text: 'Right', value: 'right'}
+						]
+					},
+					{label: 'Height', name: 'height'},
+					classListCtrl
+				]
+			};
+
+			if (editor.settings.table_row_advtab !== false) {
+				appendStylesToData(dom, data, rowElm);
+
+				editor.windowManager.open({
+					title: "Row properties",
+					data: data,
+					bodyType: 'tabpanel',
+					body: [
+						{
+							title: 'General',
+							type: 'form',
+							items: generalRowForm
+						},
+						createStyleForm(dom)
+					],
+
+					onsubmit: onSubmitRowForm
+				});
+			} else {
+				editor.windowManager.open({
+					title: "Row properties",
+					data: data,
+					body: generalRowForm,
+					onsubmit: onSubmitRowForm
+				});
+			}
+		};
+	};
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/table/classes/Plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,436 @@
+/**
+ * Plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class contains all core logic for the table plugin.
+ *
+ * @class tinymce.tableplugin.Plugin
+ * @private
+ */
+define("tinymce/tableplugin/Plugin", [
+	"tinymce/tableplugin/TableGrid",
+	"tinymce/tableplugin/Quirks",
+	"tinymce/tableplugin/CellSelection",
+	"tinymce/tableplugin/Dialogs",
+	"tinymce/util/Tools",
+	"tinymce/dom/TreeWalker",
+	"tinymce/Env",
+	"tinymce/PluginManager"
+], function(TableGrid, Quirks, CellSelection, Dialogs, Tools, TreeWalker, Env, PluginManager) {
+	var each = Tools.each;
+
+	function Plugin(editor) {
+		var clipboardRows, self = this, dialogs = new Dialogs(editor);
+
+		function cmd(command) {
+			return function() {
+				editor.execCommand(command);
+			};
+		}
+
+		function insertTable(cols, rows) {
+			var y, x, html, tableElm;
+
+			html = '<table id="__mce"><tbody>';
+
+			for (y = 0; y < rows; y++) {
+				html += '<tr>';
+
+				for (x = 0; x < cols; x++) {
+					html += '<td>' + (Env.ie ? " " : '<br>') + '</td>';
+				}
+
+				html += '</tr>';
+			}
+
+			html += '</tbody></table>';
+
+			editor.undoManager.transact(function() {
+				editor.insertContent(html);
+
+				tableElm = editor.dom.get('__mce');
+				editor.dom.setAttrib(tableElm, 'id', null);
+
+				editor.dom.setAttribs(tableElm, editor.settings.table_default_attributes || {});
+				editor.dom.setStyles(tableElm, editor.settings.table_default_styles || {});
+			});
+
+			return tableElm;
+		}
+
+		function handleDisabledState(ctrl, selector) {
+			function bindStateListener() {
+				ctrl.disabled(!editor.dom.getParent(editor.selection.getStart(), selector));
+
+				editor.selection.selectorChanged(selector, function(state) {
+					ctrl.disabled(!state);
+				});
+			}
+
+			if (editor.initialized) {
+				bindStateListener();
+			} else {
+				editor.on('init', bindStateListener);
+			}
+		}
+
+		function postRender() {
+			/*jshint validthis:true*/
+			handleDisabledState(this, 'table');
+		}
+
+		function postRenderCell() {
+			/*jshint validthis:true*/
+			handleDisabledState(this, 'td,th');
+		}
+
+		function generateTableGrid() {
+			var html = '';
+
+			html = '<table role="grid" class="mce-grid mce-grid-border" aria-readonly="true">';
+
+			for (var y = 0; y < 10; y++) {
+				html += '<tr>';
+
+				for (var x = 0; x < 10; x++) {
+					html += '<td role="gridcell" tabindex="-1"><a id="mcegrid' + (y * 10 + x) + '" href="#" ' +
+						'data-mce-x="' + x + '" data-mce-y="' + y + '"></a></td>';
+				}
+
+				html += '</tr>';
+			}
+
+			html += '</table>';
+
+			html += '<div class="mce-text-center" role="presentation">1 x 1</div>';
+
+			return html;
+		}
+
+		function selectGrid(tx, ty, control) {
+			var table = control.getEl().getElementsByTagName('table')[0];
+			var x, y, focusCell, cell, active;
+			var rtl = control.isRtl() || control.parent().rel == 'tl-tr';
+
+			table.nextSibling.innerHTML = (tx + 1) + ' x ' + (ty + 1);
+
+			if (rtl) {
+				tx = 9 - tx;
+			}
+
+			for (y = 0; y < 10; y++) {
+				for (x = 0; x < 10; x++) {
+					cell = table.rows[y].childNodes[x].firstChild;
+					active = (rtl ? x >= tx : x <= tx) && y <= ty;
+
+					editor.dom.toggleClass(cell, 'mce-active', active);
+
+					if (active) {
+						focusCell = cell;
+					}
+				}
+			}
+
+			return focusCell.parentNode;
+		}
+
+		if (editor.settings.table_grid === false) {
+			editor.addMenuItem('inserttable', {
+				text: 'Insert table',
+				icon: 'table',
+				context: 'table',
+				onclick: dialogs.table
+			});
+		} else {
+			editor.addMenuItem('inserttable', {
+				text: 'Insert table',
+				icon: 'table',
+				context: 'table',
+				ariaHideMenu: true,
+				onclick: function(e) {
+					if (e.aria) {
+						this.parent().hideAll();
+						e.stopImmediatePropagation();
+						dialogs.table();
+					}
+				},
+				onshow: function() {
+					selectGrid(0, 0, this.menu.items()[0]);
+				},
+				onhide: function() {
+					var elements = this.menu.items()[0].getEl().getElementsByTagName('a');
+					editor.dom.removeClass(elements, 'mce-active');
+					editor.dom.addClass(elements[0], 'mce-active');
+				},
+				menu: [
+					{
+						type: 'container',
+						html: generateTableGrid(),
+
+						onPostRender: function() {
+							this.lastX = this.lastY = 0;
+						},
+
+						onmousemove: function(e) {
+							var target = e.target, x, y;
+
+							if (target.tagName.toUpperCase() == 'A') {
+								x = parseInt(target.getAttribute('data-mce-x'), 10);
+								y = parseInt(target.getAttribute('data-mce-y'), 10);
+
+								if (this.isRtl() || this.parent().rel == 'tl-tr') {
+									x = 9 - x;
+								}
+
+								if (x !== this.lastX || y !== this.lastY) {
+									selectGrid(x, y, e.control);
+
+									this.lastX = x;
+									this.lastY = y;
+								}
+							}
+						},
+
+						onclick: function(e) {
+							var self = this;
+
+							if (e.target.tagName.toUpperCase() == 'A') {
+								e.preventDefault();
+								e.stopPropagation();
+								self.parent().cancel();
+
+								editor.undoManager.transact(function() {
+									insertTable(self.lastX + 1, self.lastY + 1);
+								});
+
+								editor.addVisual();
+							}
+						}
+					}
+				]
+			});
+		}
+
+		editor.addMenuItem('tableprops', {
+			text: 'Table properties',
+			context: 'table',
+			onPostRender: postRender,
+			onclick: dialogs.tableProps
+		});
+
+		editor.addMenuItem('deletetable', {
+			text: 'Delete table',
+			context: 'table',
+			onPostRender: postRender,
+			cmd: 'mceTableDelete'
+		});
+
+		editor.addMenuItem('cell', {
+			separator: 'before',
+			text: 'Cell',
+			context: 'table',
+			menu: [
+				{text: 'Cell properties', onclick: cmd('mceTableCellProps'), onPostRender: postRenderCell},
+				{text: 'Merge cells', onclick: cmd('mceTableMergeCells'), onPostRender: postRenderCell},
+				{text: 'Split cell', onclick: cmd('mceTableSplitCells'), onPostRender: postRenderCell}
+			]
+		});
+
+		editor.addMenuItem('row', {
+			text: 'Row',
+			context: 'table',
+			menu: [
+				{text: 'Insert row before', onclick: cmd('mceTableInsertRowBefore'), onPostRender: postRenderCell},
+				{text: 'Insert row after', onclick: cmd('mceTableInsertRowAfter'), onPostRender: postRenderCell},
+				{text: 'Delete row', onclick: cmd('mceTableDeleteRow'), onPostRender: postRenderCell},
+				{text: 'Row properties', onclick: cmd('mceTableRowProps'), onPostRender: postRenderCell},
+				{text: '-'},
+				{text: 'Cut row', onclick: cmd('mceTableCutRow'), onPostRender: postRenderCell},
+				{text: 'Copy row', onclick: cmd('mceTableCopyRow'), onPostRender: postRenderCell},
+				{text: 'Paste row before', onclick: cmd('mceTablePasteRowBefore'), onPostRender: postRenderCell},
+				{text: 'Paste row after', onclick: cmd('mceTablePasteRowAfter'), onPostRender: postRenderCell}
+			]
+		});
+
+		editor.addMenuItem('column', {
+			text: 'Column',
+			context: 'table',
+			menu: [
+				{text: 'Insert column before', onclick: cmd('mceTableInsertColBefore'), onPostRender: postRenderCell},
+				{text: 'Insert column after', onclick: cmd('mceTableInsertColAfter'), onPostRender: postRenderCell},
+				{text: 'Delete column', onclick: cmd('mceTableDeleteCol'), onPostRender: postRenderCell}
+			]
+		});
+
+		var menuItems = [];
+		each("inserttable tableprops deletetable | cell row column".split(' '), function(name) {
+			if (name == '|') {
+				menuItems.push({text: '-'});
+			} else {
+				menuItems.push(editor.menuItems[name]);
+			}
+		});
+
+		editor.addButton("table", {
+			type: "menubutton",
+			title: "Table",
+			menu: menuItems
+		});
+
+		// Select whole table is a table border is clicked
+		if (!Env.isIE) {
+			editor.on('click', function(e) {
+				e = e.target;
+
+				if (e.nodeName === 'TABLE') {
+					editor.selection.select(e);
+					editor.nodeChanged();
+				}
+			});
+		}
+
+		self.quirks = new Quirks(editor);
+
+		editor.on('Init', function() {
+			self.cellSelection = new CellSelection(editor);
+		});
+
+		editor.on('PreInit', function() {
+			// Remove internal data attributes
+			editor.serializer.addAttributeFilter(
+				'data-mce-cell-padding,data-mce-border,data-mce-border-color',
+				function(nodes, name) {
+
+					var i = nodes.length;
+
+					while (i--) {
+						nodes[i].attr(name, null);
+					}
+				});
+		});
+
+		// Register action commands
+		each({
+			mceTableSplitCells: function(grid) {
+				grid.split();
+			},
+
+			mceTableMergeCells: function(grid) {
+				var cell;
+
+				cell = editor.dom.getParent(editor.selection.getStart(), 'th,td');
+
+				if (!editor.dom.select('td.mce-item-selected,th.mce-item-selected').length) {
+					dialogs.merge(grid, cell);
+				} else {
+					grid.merge();
+				}
+			},
+
+			mceTableInsertRowBefore: function(grid) {
+				grid.insertRow(true);
+			},
+
+			mceTableInsertRowAfter: function(grid) {
+				grid.insertRow();
+			},
+
+			mceTableInsertColBefore: function(grid) {
+				grid.insertCol(true);
+			},
+
+			mceTableInsertColAfter: function(grid) {
+				grid.insertCol();
+			},
+
+			mceTableDeleteCol: function(grid) {
+				grid.deleteCols();
+			},
+
+			mceTableDeleteRow: function(grid) {
+				grid.deleteRows();
+			},
+
+			mceTableCutRow: function(grid) {
+				clipboardRows = grid.cutRows();
+			},
+
+			mceTableCopyRow: function(grid) {
+				clipboardRows = grid.copyRows();
+			},
+
+			mceTablePasteRowBefore: function(grid) {
+				grid.pasteRows(clipboardRows, true);
+			},
+
+			mceTablePasteRowAfter: function(grid) {
+				grid.pasteRows(clipboardRows);
+			},
+
+			mceTableDelete: function(grid) {
+				grid.deleteTable();
+			}
+		}, function(func, name) {
+			editor.addCommand(name, function() {
+				var grid = new TableGrid(editor);
+
+				if (grid) {
+					func(grid);
+					editor.execCommand('mceRepaint');
+					self.cellSelection.clear();
+				}
+			});
+		});
+
+		// Register dialog commands
+		each({
+			mceInsertTable: dialogs.table,
+			mceTableProps: function() {
+				dialogs.table(true);
+			},
+			mceTableRowProps: dialogs.row,
+			mceTableCellProps: dialogs.cell
+		}, function(func, name) {
+			editor.addCommand(name, function(ui, val) {
+				func(val);
+			});
+		});
+
+		// Enable tab key cell navigation
+		if (editor.settings.table_tab_navigation !== false) {
+			editor.on('keydown', function(e) {
+				var cellElm, grid, delta;
+
+				if (e.keyCode == 9) {
+					cellElm = editor.dom.getParent(editor.selection.getStart(), 'th,td');
+
+					if (cellElm) {
+						e.preventDefault();
+
+						grid = new TableGrid(editor);
+						delta = e.shiftKey ? -1 : 1;
+
+						editor.undoManager.transact(function() {
+							if (!grid.moveRelIdx(cellElm, delta) && delta > 0) {
+								grid.insertRow();
+								grid.refresh();
+								grid.moveRelIdx(cellElm, delta);
+							}
+						});
+					}
+				}
+			});
+		}
+
+		self.insertTable = insertTable;
+	}
+
+	PluginManager.add('table', Plugin);
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/table/classes/Quirks.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,372 @@
+/**
+ * Quirks.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class includes fixes for various browser quirks.
+ *
+ * @class tinymce.tableplugin.Quirks
+ * @private
+ */
+define("tinymce/tableplugin/Quirks", [
+	"tinymce/util/VK",
+	"tinymce/Env",
+	"tinymce/util/Tools"
+], function(VK, Env, Tools) {
+	var each = Tools.each;
+
+	function getSpanVal(td, name) {
+		return parseInt(td.getAttribute(name) || 1, 10);
+	}
+
+	return function(editor) {
+		/**
+		 * Fixed caret movement around tables on WebKit.
+		 */
+		function moveWebKitSelection() {
+			function eventHandler(e) {
+				var key = e.keyCode;
+
+				function handle(upBool, sourceNode) {
+					var siblingDirection = upBool ? 'previousSibling' : 'nextSibling';
+					var currentRow = editor.dom.getParent(sourceNode, 'tr');
+					var siblingRow = currentRow[siblingDirection];
+
+					if (siblingRow) {
+						moveCursorToRow(editor, sourceNode, siblingRow, upBool);
+						e.preventDefault();
+						return true;
+					} else {
+						var tableNode = editor.dom.getParent(currentRow, 'table');
+						var middleNode = currentRow.parentNode;
+						var parentNodeName = middleNode.nodeName.toLowerCase();
+						if (parentNodeName === 'tbody' || parentNodeName === (upBool ? 'tfoot' : 'thead')) {
+							var targetParent = getTargetParent(upBool, tableNode, middleNode, 'tbody');
+							if (targetParent !== null) {
+								return moveToRowInTarget(upBool, targetParent, sourceNode);
+							}
+						}
+						return escapeTable(upBool, currentRow, siblingDirection, tableNode);
+					}
+				}
+
+				function getTargetParent(upBool, topNode, secondNode, nodeName) {
+					var tbodies = editor.dom.select('>' + nodeName, topNode);
+					var position = tbodies.indexOf(secondNode);
+					if (upBool && position === 0 || !upBool && position === tbodies.length - 1) {
+						return getFirstHeadOrFoot(upBool, topNode);
+					} else if (position === -1) {
+						var topOrBottom = secondNode.tagName.toLowerCase() === 'thead' ? 0 : tbodies.length - 1;
+						return tbodies[topOrBottom];
+					} else {
+						return tbodies[position + (upBool ? -1 : 1)];
+					}
+				}
+
+				function getFirstHeadOrFoot(upBool, parent) {
+					var tagName = upBool ? 'thead' : 'tfoot';
+					var headOrFoot = editor.dom.select('>' + tagName, parent);
+					return headOrFoot.length !== 0 ? headOrFoot[0] : null;
+				}
+
+				function moveToRowInTarget(upBool, targetParent, sourceNode) {
+					var targetRow = getChildForDirection(targetParent, upBool);
+
+					if (targetRow) {
+						moveCursorToRow(editor, sourceNode, targetRow, upBool);
+					}
+
+					e.preventDefault();
+					return true;
+				}
+
+				function escapeTable(upBool, currentRow, siblingDirection, table) {
+					var tableSibling = table[siblingDirection];
+
+					if (tableSibling) {
+						moveCursorToStartOfElement(tableSibling);
+						return true;
+					} else {
+						var parentCell = editor.dom.getParent(table, 'td,th');
+						if (parentCell) {
+							return handle(upBool, parentCell, e);
+						} else {
+							var backUpSibling = getChildForDirection(currentRow, !upBool);
+							moveCursorToStartOfElement(backUpSibling);
+							e.preventDefault();
+							return false;
+						}
+					}
+				}
+
+				function getChildForDirection(parent, up) {
+					var child = parent && parent[up ? 'lastChild' : 'firstChild'];
+					// BR is not a valid table child to return in this case we return the table cell
+					return child && child.nodeName === 'BR' ? editor.dom.getParent(child, 'td,th') : child;
+				}
+
+				function moveCursorToStartOfElement(n) {
+					editor.selection.setCursorLocation(n, 0);
+				}
+
+				function isVerticalMovement() {
+					return key == VK.UP || key == VK.DOWN;
+				}
+
+				function isInTable(editor) {
+					var node = editor.selection.getNode();
+					var currentRow = editor.dom.getParent(node, 'tr');
+					return currentRow !== null;
+				}
+
+				function columnIndex(column) {
+					var colIndex = 0;
+					var c = column;
+					while (c.previousSibling) {
+						c = c.previousSibling;
+						colIndex = colIndex + getSpanVal(c, "colspan");
+					}
+					return colIndex;
+				}
+
+				function findColumn(rowElement, columnIndex) {
+					var c = 0, r = 0;
+
+					each(rowElement.children, function(cell, i) {
+						c = c + getSpanVal(cell, "colspan");
+						r = i;
+						if (c > columnIndex) {
+							return false;
+						}
+					});
+					return r;
+				}
+
+				function moveCursorToRow(ed, node, row, upBool) {
+					var srcColumnIndex = columnIndex(editor.dom.getParent(node, 'td,th'));
+					var tgtColumnIndex = findColumn(row, srcColumnIndex);
+					var tgtNode = row.childNodes[tgtColumnIndex];
+					var rowCellTarget = getChildForDirection(tgtNode, upBool);
+					moveCursorToStartOfElement(rowCellTarget || tgtNode);
+				}
+
+				function shouldFixCaret(preBrowserNode) {
+					var newNode = editor.selection.getNode();
+					var newParent = editor.dom.getParent(newNode, 'td,th');
+					var oldParent = editor.dom.getParent(preBrowserNode, 'td,th');
+
+					return newParent && newParent !== oldParent && checkSameParentTable(newParent, oldParent);
+				}
+
+				function checkSameParentTable(nodeOne, NodeTwo) {
+					return editor.dom.getParent(nodeOne, 'TABLE') === editor.dom.getParent(NodeTwo, 'TABLE');
+				}
+
+				if (isVerticalMovement() && isInTable(editor)) {
+					var preBrowserNode = editor.selection.getNode();
+					setTimeout(function() {
+						if (shouldFixCaret(preBrowserNode)) {
+							handle(!e.shiftKey && key === VK.UP, preBrowserNode, e);
+						}
+					}, 0);
+				}
+			}
+
+			editor.on('KeyDown', function(e) {
+				eventHandler(e);
+			});
+		}
+
+		function fixBeforeTableCaretBug() {
+			// Checks if the selection/caret is at the start of the specified block element
+			function isAtStart(rng, par) {
+				var doc = par.ownerDocument, rng2 = doc.createRange(), elm;
+
+				rng2.setStartBefore(par);
+				rng2.setEnd(rng.endContainer, rng.endOffset);
+
+				elm = doc.createElement('body');
+				elm.appendChild(rng2.cloneContents());
+
+				// Check for text characters of other elements that should be treated as content
+				return elm.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi, '-').replace(/<[^>]+>/g, '').length === 0;
+			}
+
+			// Fixes an bug where it's impossible to place the caret before a table in Gecko
+			// this fix solves it by detecting when the caret is at the beginning of such a table
+			// and then manually moves the caret infront of the table
+			editor.on('KeyDown', function(e) {
+				var rng, table, dom = editor.dom;
+
+				// On gecko it's not possible to place the caret before a table
+				if (e.keyCode == 37 || e.keyCode == 38) {
+					rng = editor.selection.getRng();
+					table = dom.getParent(rng.startContainer, 'table');
+
+					if (table && editor.getBody().firstChild == table) {
+						if (isAtStart(rng, table)) {
+							rng = dom.createRng();
+
+							rng.setStartBefore(table);
+							rng.setEndBefore(table);
+
+							editor.selection.setRng(rng);
+
+							e.preventDefault();
+						}
+					}
+				}
+			});
+		}
+
+		// Fixes an issue on Gecko where it's impossible to place the caret behind a table
+		// This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled
+		function fixTableCaretPos() {
+			editor.on('KeyDown SetContent VisualAid', function() {
+				var last;
+
+				// Skip empty text nodes from the end
+				for (last = editor.getBody().lastChild; last; last = last.previousSibling) {
+					if (last.nodeType == 3) {
+						if (last.nodeValue.length > 0) {
+							break;
+						}
+					} else if (last.nodeType == 1 && (last.tagName == 'BR' || !last.getAttribute('data-mce-bogus'))) {
+						break;
+					}
+				}
+
+				if (last && last.nodeName == 'TABLE') {
+					if (editor.settings.forced_root_block) {
+						editor.dom.add(
+							editor.getBody(),
+							editor.settings.forced_root_block,
+							editor.settings.forced_root_block_attrs,
+							Env.ie && Env.ie < 11 ? '&nbsp;' : '<br data-mce-bogus="1" />'
+						);
+					} else {
+						editor.dom.add(editor.getBody(), 'br', {'data-mce-bogus': '1'});
+					}
+				}
+			});
+
+			editor.on('PreProcess', function(o) {
+				var last = o.node.lastChild;
+
+				if (last && (last.nodeName == "BR" || (last.childNodes.length == 1 &&
+					(last.firstChild.nodeName == 'BR' || last.firstChild.nodeValue == '\u00a0'))) &&
+					last.previousSibling && last.previousSibling.nodeName == "TABLE") {
+					editor.dom.remove(last);
+				}
+			});
+		}
+
+		// this nasty hack is here to work around some WebKit selection bugs.
+		function fixTableCellSelection() {
+			function tableCellSelected(ed, rng, n, currentCell) {
+				// The decision of when a table cell is selected is somewhat involved.  The fact that this code is
+				// required is actually a pointer to the root cause of this bug. A cell is selected when the start
+				// and end offsets are 0, the start container is a text, and the selection node is either a TR (most cases)
+				// or the parent of the table (in the case of the selection containing the last cell of a table).
+				var TEXT_NODE = 3, table = ed.dom.getParent(rng.startContainer, 'TABLE');
+				var tableParent, allOfCellSelected, tableCellSelection;
+
+				if (table) {
+					tableParent = table.parentNode;
+				}
+
+				allOfCellSelected = rng.startContainer.nodeType == TEXT_NODE &&
+					rng.startOffset === 0 &&
+					rng.endOffset === 0 &&
+					currentCell &&
+					(n.nodeName == "TR" || n == tableParent);
+
+				tableCellSelection = (n.nodeName == "TD" || n.nodeName == "TH") && !currentCell;
+
+				return allOfCellSelected || tableCellSelection;
+			}
+
+			function fixSelection() {
+				var rng = editor.selection.getRng();
+				var n = editor.selection.getNode();
+				var currentCell = editor.dom.getParent(rng.startContainer, 'TD,TH');
+
+				if (!tableCellSelected(editor, rng, n, currentCell)) {
+					return;
+				}
+
+				if (!currentCell) {
+					currentCell = n;
+				}
+
+				// Get the very last node inside the table cell
+				var end = currentCell.lastChild;
+				while (end.lastChild) {
+					end = end.lastChild;
+				}
+
+				// Select the entire table cell. Nothing outside of the table cell should be selected.
+				if (end.nodeType == 3) {
+					rng.setEnd(end, end.data.length);
+					editor.selection.setRng(rng);
+				}
+			}
+
+			editor.on('KeyDown', function() {
+				fixSelection();
+			});
+
+			editor.on('MouseDown', function(e) {
+				if (e.button != 2) {
+					fixSelection();
+				}
+			});
+		}
+
+		/**
+		 * Delete table if all cells are selected.
+		 */
+		function deleteTable() {
+			editor.on('keydown', function(e) {
+				if ((e.keyCode == VK.DELETE || e.keyCode == VK.BACKSPACE) && !e.isDefaultPrevented()) {
+					var table = editor.dom.getParent(editor.selection.getStart(), 'table');
+
+					if (table) {
+						var cells = editor.dom.select('td,th', table), i = cells.length;
+						while (i--) {
+							if (!editor.dom.hasClass(cells[i], 'mce-item-selected')) {
+								return;
+							}
+						}
+
+						e.preventDefault();
+						editor.execCommand('mceTableDelete');
+					}
+				}
+			});
+		}
+
+		deleteTable();
+
+		if (Env.webkit) {
+			moveWebKitSelection();
+			fixTableCellSelection();
+		}
+
+		if (Env.gecko) {
+			fixBeforeTableCaretBug();
+			fixTableCaretPos();
+		}
+
+		if (Env.ie > 10) {
+			fixBeforeTableCaretBug();
+			fixTableCaretPos();
+		}
+	};
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/table/classes/TableGrid.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,864 @@
+/**
+ * TableGrid.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class creates a grid out of a table element. This
+ * makes it a whole lot easier to handle complex tables with
+ * col/row spans.
+ *
+ * @class tinymce.tableplugin.TableGrid
+ * @private
+ */
+define("tinymce/tableplugin/TableGrid", [
+	"tinymce/util/Tools",
+	"tinymce/Env"
+], function(Tools, Env) {
+	var each = Tools.each;
+
+	function getSpanVal(td, name) {
+		return parseInt(td.getAttribute(name) || 1, 10);
+	}
+
+	return function(editor, table) {
+		var grid, gridWidth, startPos, endPos, selectedCell, selection = editor.selection, dom = selection.dom;
+
+		function buildGrid() {
+			var startY = 0;
+
+			grid = [];
+			gridWidth = 0;
+
+			each(['thead', 'tbody', 'tfoot'], function(part) {
+				var rows = dom.select('> ' + part + ' tr', table);
+
+				each(rows, function(tr, y) {
+					y += startY;
+
+					each(dom.select('> td, > th', tr), function(td, x) {
+						var x2, y2, rowspan, colspan;
+
+						// Skip over existing cells produced by rowspan
+						if (grid[y]) {
+							while (grid[y][x]) {
+								x++;
+							}
+						}
+
+						// Get col/rowspan from cell
+						rowspan = getSpanVal(td, 'rowspan');
+						colspan = getSpanVal(td, 'colspan');
+
+						// Fill out rowspan/colspan right and down
+						for (y2 = y; y2 < y + rowspan; y2++) {
+							if (!grid[y2]) {
+								grid[y2] = [];
+							}
+
+							for (x2 = x; x2 < x + colspan; x2++) {
+								grid[y2][x2] = {
+									part: part,
+									real: y2 == y && x2 == x,
+									elm: td,
+									rowspan: rowspan,
+									colspan: colspan
+								};
+							}
+						}
+
+						gridWidth = Math.max(gridWidth, x + 1);
+					});
+				});
+
+				startY += rows.length;
+			});
+		}
+
+		function cloneNode(node, children) {
+			node = node.cloneNode(children);
+			node.removeAttribute('id');
+
+			return node;
+		}
+
+		function getCell(x, y) {
+			var row;
+
+			row = grid[y];
+			if (row) {
+				return row[x];
+			}
+		}
+
+		function setSpanVal(td, name, val) {
+			if (td) {
+				val = parseInt(val, 10);
+
+				if (val === 1) {
+					td.removeAttribute(name, 1);
+				} else {
+					td.setAttribute(name, val, 1);
+				}
+			}
+		}
+
+		function isCellSelected(cell) {
+			return cell && (dom.hasClass(cell.elm, 'mce-item-selected') || cell == selectedCell);
+		}
+
+		function getSelectedRows() {
+			var rows = [];
+
+			each(table.rows, function(row) {
+				each(row.cells, function(cell) {
+					if (dom.hasClass(cell, 'mce-item-selected') || (selectedCell && cell == selectedCell.elm)) {
+						rows.push(row);
+						return false;
+					}
+				});
+			});
+
+			return rows;
+		}
+
+		function deleteTable() {
+			var rng = dom.createRng();
+
+			rng.setStartAfter(table);
+			rng.setEndAfter(table);
+
+			selection.setRng(rng);
+
+			dom.remove(table);
+		}
+
+		function cloneCell(cell) {
+			var formatNode, cloneFormats = {};
+
+			if (editor.settings.table_clone_elements !== false) {
+				cloneFormats = Tools.makeMap(
+					(editor.settings.table_clone_elements || 'strong em b i span font h1 h2 h3 h4 h5 h6 p div').toUpperCase(),
+					/[ ,]/
+				);
+			}
+
+			// Clone formats
+			Tools.walk(cell, function(node) {
+				var curNode;
+
+				if (node.nodeType == 3) {
+					each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) {
+						if (!cloneFormats[node.nodeName]) {
+							return;
+						}
+
+						node = cloneNode(node, false);
+
+						if (!formatNode) {
+							formatNode = curNode = node;
+						} else if (curNode) {
+							curNode.appendChild(node);
+						}
+
+						curNode = node;
+					});
+
+					// Add something to the inner node
+					if (curNode) {
+						curNode.innerHTML = Env.ie ? '&nbsp;' : '<br data-mce-bogus="1" />';
+					}
+
+					return false;
+				}
+			}, 'childNodes');
+
+			cell = cloneNode(cell, false);
+			setSpanVal(cell, 'rowSpan', 1);
+			setSpanVal(cell, 'colSpan', 1);
+
+			if (formatNode) {
+				cell.appendChild(formatNode);
+			} else {
+				if (!Env.ie || Env.ie > 10) {
+					cell.innerHTML = '<br data-mce-bogus="1" />';
+				}
+			}
+
+			return cell;
+		}
+
+		function cleanup() {
+			var rng = dom.createRng(), row;
+
+			// Empty rows
+			each(dom.select('tr', table), function(tr) {
+				if (tr.cells.length === 0) {
+					dom.remove(tr);
+				}
+			});
+
+			// Empty table
+			if (dom.select('tr', table).length === 0) {
+				rng.setStartBefore(table);
+				rng.setEndBefore(table);
+				selection.setRng(rng);
+				dom.remove(table);
+				return;
+			}
+
+			// Empty header/body/footer
+			each(dom.select('thead,tbody,tfoot', table), function(part) {
+				if (part.rows.length === 0) {
+					dom.remove(part);
+				}
+			});
+
+			// Restore selection to start position if it still exists
+			buildGrid();
+
+			// If we have a valid startPos object
+			if (startPos) {
+				// Restore the selection to the closest table position
+				row = grid[Math.min(grid.length - 1, startPos.y)];
+				if (row) {
+					selection.select(row[Math.min(row.length - 1, startPos.x)].elm, true);
+					selection.collapse(true);
+				}
+			}
+		}
+
+		function fillLeftDown(x, y, rows, cols) {
+			var tr, x2, r, c, cell;
+
+			tr = grid[y][x].elm.parentNode;
+			for (r = 1; r <= rows; r++) {
+				tr = dom.getNext(tr, 'tr');
+
+				if (tr) {
+					// Loop left to find real cell
+					for (x2 = x; x2 >= 0; x2--) {
+						cell = grid[y + r][x2].elm;
+
+						if (cell.parentNode == tr) {
+							// Append clones after
+							for (c = 1; c <= cols; c++) {
+								dom.insertAfter(cloneCell(cell), cell);
+							}
+
+							break;
+						}
+					}
+
+					if (x2 == -1) {
+						// Insert nodes before first cell
+						for (c = 1; c <= cols; c++) {
+							tr.insertBefore(cloneCell(tr.cells[0]), tr.cells[0]);
+						}
+					}
+				}
+			}
+		}
+
+		function split() {
+			each(grid, function(row, y) {
+				each(row, function(cell, x) {
+					var colSpan, rowSpan, i;
+
+					if (isCellSelected(cell)) {
+						cell = cell.elm;
+						colSpan = getSpanVal(cell, 'colspan');
+						rowSpan = getSpanVal(cell, 'rowspan');
+
+						if (colSpan > 1 || rowSpan > 1) {
+							setSpanVal(cell, 'rowSpan', 1);
+							setSpanVal(cell, 'colSpan', 1);
+
+							// Insert cells right
+							for (i = 0; i < colSpan - 1; i++) {
+								dom.insertAfter(cloneCell(cell), cell);
+							}
+
+							fillLeftDown(x, y, rowSpan - 1, colSpan);
+						}
+					}
+				});
+			});
+		}
+
+		function merge(cell, cols, rows) {
+			var pos, startX, startY, endX, endY, x, y, startCell, endCell, children, count;
+
+			// Use specified cell and cols/rows
+			if (cell) {
+				pos = getPos(cell);
+				startX = pos.x;
+				startY = pos.y;
+				endX = startX + (cols - 1);
+				endY = startY + (rows - 1);
+			} else {
+				startPos = endPos = null;
+
+				// Calculate start/end pos by checking for selected cells in grid works better with context menu
+				each(grid, function(row, y) {
+					each(row, function(cell, x) {
+						if (isCellSelected(cell)) {
+							if (!startPos) {
+								startPos = {x: x, y: y};
+							}
+
+							endPos = {x: x, y: y};
+						}
+					});
+				});
+
+				// Use selection, but make sure startPos is valid before accessing
+				if (startPos) {
+					startX = startPos.x;
+					startY = startPos.y;
+					endX = endPos.x;
+					endY = endPos.y;
+				}
+			}
+
+			// Find start/end cells
+			startCell = getCell(startX, startY);
+			endCell = getCell(endX, endY);
+
+			// Check if the cells exists and if they are of the same part for example tbody = tbody
+			if (startCell && endCell && startCell.part == endCell.part) {
+				// Split and rebuild grid
+				split();
+				buildGrid();
+
+				// Set row/col span to start cell
+				startCell = getCell(startX, startY).elm;
+				setSpanVal(startCell, 'colSpan', (endX - startX) + 1);
+				setSpanVal(startCell, 'rowSpan', (endY - startY) + 1);
+
+				// Remove other cells and add it's contents to the start cell
+				for (y = startY; y <= endY; y++) {
+					for (x = startX; x <= endX; x++) {
+						if (!grid[y] || !grid[y][x]) {
+							continue;
+						}
+
+						cell = grid[y][x].elm;
+
+						/*jshint loopfunc:true */
+						/*eslint no-loop-func:0 */
+						if (cell != startCell) {
+							// Move children to startCell
+							children = Tools.grep(cell.childNodes);
+							each(children, function(node) {
+								startCell.appendChild(node);
+							});
+
+							// Remove bogus nodes if there is children in the target cell
+							if (children.length) {
+								children = Tools.grep(startCell.childNodes);
+								count = 0;
+								each(children, function(node) {
+									if (node.nodeName == 'BR' && dom.getAttrib(node, 'data-mce-bogus') && count++ < children.length - 1) {
+										startCell.removeChild(node);
+									}
+								});
+							}
+
+							dom.remove(cell);
+						}
+					}
+				}
+
+				// Remove empty rows etc and restore caret location
+				cleanup();
+			}
+		}
+
+		function insertRow(before) {
+			var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell, rowSpan;
+
+			// Find first/last row
+			each(grid, function(row, y) {
+				each(row, function(cell) {
+					if (isCellSelected(cell)) {
+						cell = cell.elm;
+						rowElm = cell.parentNode;
+						newRow = cloneNode(rowElm, false);
+						posY = y;
+
+						if (before) {
+							return false;
+						}
+					}
+				});
+
+				if (before) {
+					return !posY;
+				}
+			});
+
+			// If posY is undefined there is nothing for us to do here...just return to avoid crashing below
+			if (posY === undefined) {
+				return;
+			}
+
+			for (x = 0; x < grid[0].length; x++) {
+				// Cell not found could be because of an invalid table structure
+				if (!grid[posY][x]) {
+					continue;
+				}
+
+				cell = grid[posY][x].elm;
+
+				if (cell != lastCell) {
+					if (!before) {
+						rowSpan = getSpanVal(cell, 'rowspan');
+						if (rowSpan > 1) {
+							setSpanVal(cell, 'rowSpan', rowSpan + 1);
+							continue;
+						}
+					} else {
+						// Check if cell above can be expanded
+						if (posY > 0 && grid[posY - 1][x]) {
+							otherCell = grid[posY - 1][x].elm;
+							rowSpan = getSpanVal(otherCell, 'rowSpan');
+							if (rowSpan > 1) {
+								setSpanVal(otherCell, 'rowSpan', rowSpan + 1);
+								continue;
+							}
+						}
+					}
+
+					// Insert new cell into new row
+					newCell = cloneCell(cell);
+					setSpanVal(newCell, 'colSpan', cell.colSpan);
+
+					newRow.appendChild(newCell);
+
+					lastCell = cell;
+				}
+			}
+
+			if (newRow.hasChildNodes()) {
+				if (!before) {
+					dom.insertAfter(newRow, rowElm);
+				} else {
+					rowElm.parentNode.insertBefore(newRow, rowElm);
+				}
+			}
+		}
+
+		function insertCol(before) {
+			var posX, lastCell;
+
+			// Find first/last column
+			each(grid, function(row) {
+				each(row, function(cell, x) {
+					if (isCellSelected(cell)) {
+						posX = x;
+
+						if (before) {
+							return false;
+						}
+					}
+				});
+
+				if (before) {
+					return !posX;
+				}
+			});
+
+			each(grid, function(row, y) {
+				var cell, rowSpan, colSpan;
+
+				if (!row[posX]) {
+					return;
+				}
+
+				cell = row[posX].elm;
+				if (cell != lastCell) {
+					colSpan = getSpanVal(cell, 'colspan');
+					rowSpan = getSpanVal(cell, 'rowspan');
+
+					if (colSpan == 1) {
+						if (!before) {
+							dom.insertAfter(cloneCell(cell), cell);
+							fillLeftDown(posX, y, rowSpan - 1, colSpan);
+						} else {
+							cell.parentNode.insertBefore(cloneCell(cell), cell);
+							fillLeftDown(posX, y, rowSpan - 1, colSpan);
+						}
+					} else {
+						setSpanVal(cell, 'colSpan', cell.colSpan + 1);
+					}
+
+					lastCell = cell;
+				}
+			});
+		}
+
+		function deleteCols() {
+			var cols = [];
+
+			// Get selected column indexes
+			each(grid, function(row) {
+				each(row, function(cell, x) {
+					if (isCellSelected(cell) && Tools.inArray(cols, x) === -1) {
+						each(grid, function(row) {
+							var cell = row[x].elm, colSpan;
+
+							colSpan = getSpanVal(cell, 'colSpan');
+
+							if (colSpan > 1) {
+								setSpanVal(cell, 'colSpan', colSpan - 1);
+							} else {
+								dom.remove(cell);
+							}
+						});
+
+						cols.push(x);
+					}
+				});
+			});
+
+			cleanup();
+		}
+
+		function deleteRows() {
+			var rows;
+
+			function deleteRow(tr) {
+				var pos, lastCell;
+
+				// Move down row spanned cells
+				each(tr.cells, function(cell) {
+					var rowSpan = getSpanVal(cell, 'rowSpan');
+
+					if (rowSpan > 1) {
+						setSpanVal(cell, 'rowSpan', rowSpan - 1);
+						pos = getPos(cell);
+						fillLeftDown(pos.x, pos.y, 1, 1);
+					}
+				});
+
+				// Delete cells
+				pos = getPos(tr.cells[0]);
+				each(grid[pos.y], function(cell) {
+					var rowSpan;
+
+					cell = cell.elm;
+
+					if (cell != lastCell) {
+						rowSpan = getSpanVal(cell, 'rowSpan');
+
+						if (rowSpan <= 1) {
+							dom.remove(cell);
+						} else {
+							setSpanVal(cell, 'rowSpan', rowSpan - 1);
+						}
+
+						lastCell = cell;
+					}
+				});
+			}
+
+			// Get selected rows and move selection out of scope
+			rows = getSelectedRows();
+
+			// Delete all selected rows
+			each(rows.reverse(), function(tr) {
+				deleteRow(tr);
+			});
+
+			cleanup();
+		}
+
+		function cutRows() {
+			var rows = getSelectedRows();
+
+			dom.remove(rows);
+			cleanup();
+
+			return rows;
+		}
+
+		function copyRows() {
+			var rows = getSelectedRows();
+
+			each(rows, function(row, i) {
+				rows[i] = cloneNode(row, true);
+			});
+
+			return rows;
+		}
+
+		function pasteRows(rows, before) {
+			var selectedRows = getSelectedRows(),
+				targetRow = selectedRows[before ? 0 : selectedRows.length - 1],
+				targetCellCount = targetRow.cells.length;
+
+			// Nothing to paste
+			if (!rows) {
+				return;
+			}
+
+			// Calc target cell count
+			each(grid, function(row) {
+				var match;
+
+				targetCellCount = 0;
+				each(row, function(cell) {
+					if (cell.real) {
+						targetCellCount += cell.colspan;
+					}
+
+					if (cell.elm.parentNode == targetRow) {
+						match = 1;
+					}
+				});
+
+				if (match) {
+					return false;
+				}
+			});
+
+			if (!before) {
+				rows.reverse();
+			}
+
+			each(rows, function(row) {
+				var i, cellCount = row.cells.length, cell;
+
+				// Remove col/rowspans
+				for (i = 0; i < cellCount; i++) {
+					cell = row.cells[i];
+					setSpanVal(cell, 'colSpan', 1);
+					setSpanVal(cell, 'rowSpan', 1);
+				}
+
+				// Needs more cells
+				for (i = cellCount; i < targetCellCount; i++) {
+					row.appendChild(cloneCell(row.cells[cellCount - 1]));
+				}
+
+				// Needs less cells
+				for (i = targetCellCount; i < cellCount; i++) {
+					dom.remove(row.cells[i]);
+				}
+
+				// Add before/after
+				if (before) {
+					targetRow.parentNode.insertBefore(row, targetRow);
+				} else {
+					dom.insertAfter(row, targetRow);
+				}
+			});
+
+			// Remove current selection
+			dom.removeClass(dom.select('td.mce-item-selected,th.mce-item-selected'), 'mce-item-selected');
+		}
+
+		function getPos(target) {
+			var pos;
+
+			each(grid, function(row, y) {
+				each(row, function(cell, x) {
+					if (cell.elm == target) {
+						pos = {x: x, y: y};
+						return false;
+					}
+				});
+
+				return !pos;
+			});
+
+			return pos;
+		}
+
+		function setStartCell(cell) {
+			startPos = getPos(cell);
+		}
+
+		function findEndPos() {
+			var maxX, maxY;
+
+			maxX = maxY = 0;
+
+			each(grid, function(row, y) {
+				each(row, function(cell, x) {
+					var colSpan, rowSpan;
+
+					if (isCellSelected(cell)) {
+						cell = grid[y][x];
+
+						if (x > maxX) {
+							maxX = x;
+						}
+
+						if (y > maxY) {
+							maxY = y;
+						}
+
+						if (cell.real) {
+							colSpan = cell.colspan - 1;
+							rowSpan = cell.rowspan - 1;
+
+							if (colSpan) {
+								if (x + colSpan > maxX) {
+									maxX = x + colSpan;
+								}
+							}
+
+							if (rowSpan) {
+								if (y + rowSpan > maxY) {
+									maxY = y + rowSpan;
+								}
+							}
+						}
+					}
+				});
+			});
+
+			return {x: maxX, y: maxY};
+		}
+
+		function setEndCell(cell) {
+			var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan, x, y;
+
+			endPos = getPos(cell);
+
+			if (startPos && endPos) {
+				// Get start/end positions
+				startX = Math.min(startPos.x, endPos.x);
+				startY = Math.min(startPos.y, endPos.y);
+				endX = Math.max(startPos.x, endPos.x);
+				endY = Math.max(startPos.y, endPos.y);
+
+				// Expand end positon to include spans
+				maxX = endX;
+				maxY = endY;
+
+				// Expand startX
+				for (y = startY; y <= maxY; y++) {
+					cell = grid[y][startX];
+
+					if (!cell.real) {
+						if (startX - (cell.colspan - 1) < startX) {
+							startX -= cell.colspan - 1;
+						}
+					}
+				}
+
+				// Expand startY
+				for (x = startX; x <= maxX; x++) {
+					cell = grid[startY][x];
+
+					if (!cell.real) {
+						if (startY - (cell.rowspan - 1) < startY) {
+							startY -= cell.rowspan - 1;
+						}
+					}
+				}
+
+				// Find max X, Y
+				for (y = startY; y <= endY; y++) {
+					for (x = startX; x <= endX; x++) {
+						cell = grid[y][x];
+
+						if (cell.real) {
+							colSpan = cell.colspan - 1;
+							rowSpan = cell.rowspan - 1;
+
+							if (colSpan) {
+								if (x + colSpan > maxX) {
+									maxX = x + colSpan;
+								}
+							}
+
+							if (rowSpan) {
+								if (y + rowSpan > maxY) {
+									maxY = y + rowSpan;
+								}
+							}
+						}
+					}
+				}
+
+				// Remove current selection
+				dom.removeClass(dom.select('td.mce-item-selected,th.mce-item-selected'), 'mce-item-selected');
+
+				// Add new selection
+				for (y = startY; y <= maxY; y++) {
+					for (x = startX; x <= maxX; x++) {
+						if (grid[y][x]) {
+							dom.addClass(grid[y][x].elm, 'mce-item-selected');
+						}
+					}
+				}
+			}
+		}
+
+		function moveRelIdx(cellElm, delta) {
+			var pos, index, cell;
+
+			pos = getPos(cellElm);
+			index = pos.y * gridWidth + pos.x;
+
+			do {
+				index += delta;
+				cell = getCell(index % gridWidth, Math.floor(index / gridWidth));
+
+				if (!cell) {
+					break;
+				}
+
+				if (cell.elm != cellElm) {
+					selection.select(cell.elm, true);
+
+					if (dom.isEmpty(cell.elm)) {
+						selection.collapse(true);
+					}
+
+					return true;
+				}
+			} while (cell.elm == cellElm);
+
+			return false;
+		}
+
+		table = table || dom.getParent(selection.getStart(), 'table');
+
+		buildGrid();
+
+		selectedCell = dom.getParent(selection.getStart(), 'th,td');
+		if (selectedCell) {
+			startPos = getPos(selectedCell);
+			endPos = findEndPos();
+			selectedCell = getCell(startPos.x, startPos.y);
+		}
+
+		Tools.extend(this, {
+			deleteTable: deleteTable,
+			split: split,
+			merge: merge,
+			insertRow: insertRow,
+			insertCol: insertCol,
+			deleteCols: deleteCols,
+			deleteRows: deleteRows,
+			cutRows: cutRows,
+			copyRows: copyRows,
+			pasteRows: pasteRows,
+			getPos: getPos,
+			setStartCell: setStartCell,
+			setEndCell: setEndCell,
+			moveRelIdx: moveRelIdx,
+			refresh: buildGrid
+		});
+	};
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/table/plugin.dev.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,118 @@
+/**
+ * Inline development version. Only to be used while developing since it uses document.write to load scripts.
+ */
+
+/*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */
+/*globals $code */
+
+(function(exports) {
+	"use strict";
+
+	var html = "", baseDir;
+	var modules = {}, exposedModules = [], moduleCount = 0;
+
+	var scripts = document.getElementsByTagName('script');
+	for (var i = 0; i < scripts.length; i++) {
+		var src = scripts[i].src;
+
+		if (src.indexOf('/plugin.dev.js') != -1) {
+			baseDir = src.substring(0, src.lastIndexOf('/'));
+		}
+	}
+
+	function require(ids, callback) {
+		var module, defs = [];
+
+		for (var i = 0; i < ids.length; ++i) {
+			module = modules[ids[i]] || resolve(ids[i]);
+			if (!module) {
+				throw 'module definition dependecy not found: ' + ids[i];
+			}
+
+			defs.push(module);
+		}
+
+		callback.apply(null, defs);
+	}
+
+	function resolve(id) {
+		var target = exports;
+		var fragments = id.split(/[.\/]/);
+
+		for (var fi = 0; fi < fragments.length; ++fi) {
+			if (!target[fragments[fi]]) {
+				return;
+			}
+
+			target = target[fragments[fi]];
+		}
+
+		return target;
+	}
+
+	function register(id) {
+		var target = exports;
+		var fragments = id.split(/[.\/]/);
+
+		for (var fi = 0; fi < fragments.length - 1; ++fi) {
+			if (target[fragments[fi]] === undefined) {
+				target[fragments[fi]] = {};
+			}
+
+			target = target[fragments[fi]];
+		}
+
+		target[fragments[fragments.length - 1]] = modules[id];
+	}
+
+	function define(id, dependencies, definition) {
+		if (typeof id !== 'string') {
+			throw 'invalid module definition, module id must be defined and be a string';
+		}
+
+		if (dependencies === undefined) {
+			throw 'invalid module definition, dependencies must be specified';
+		}
+
+		if (definition === undefined) {
+			throw 'invalid module definition, definition function must be specified';
+		}
+
+		require(dependencies, function() {
+			modules[id] = definition.apply(null, arguments);
+		});
+
+		if (--moduleCount === 0) {
+			for (var i = 0; i < exposedModules.length; i++) {
+				register(exposedModules[i]);
+			}
+		}
+	}
+
+	function expose(ids) {
+		exposedModules = ids;
+	}
+
+	function writeScripts() {
+		document.write(html);
+	}
+
+	function load(path) {
+		html += '<script type="text/javascript" src="' + baseDir + '/' + path + '"></script>\n';
+		moduleCount++;
+	}
+
+	// Expose globally
+	exports.define = define;
+	exports.require = require;
+
+	load('classes/TableGrid.js');
+	load('classes/Quirks.js');
+	load('classes/CellSelection.js');
+	load('classes/Dialogs.js');
+	load('classes/Plugin.js');
+
+	writeScripts();
+})(this);
+
+// $hash: 712fc4092f1b9967704422d7ed4cd0b4
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/table/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,2769 @@
+/**
+ * Compiled inline version. (Library mode)
+ */
+
+/*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */
+/*globals $code */
+
+(function(exports, undefined) {
+	"use strict";
+
+	var modules = {};
+
+	function require(ids, callback) {
+		var module, defs = [];
+
+		for (var i = 0; i < ids.length; ++i) {
+			module = modules[ids[i]] || resolve(ids[i]);
+			if (!module) {
+				throw 'module definition dependecy not found: ' + ids[i];
+			}
+
+			defs.push(module);
+		}
+
+		callback.apply(null, defs);
+	}
+
+	function define(id, dependencies, definition) {
+		if (typeof id !== 'string') {
+			throw 'invalid module definition, module id must be defined and be a string';
+		}
+
+		if (dependencies === undefined) {
+			throw 'invalid module definition, dependencies must be specified';
+		}
+
+		if (definition === undefined) {
+			throw 'invalid module definition, definition function must be specified';
+		}
+
+		require(dependencies, function() {
+			modules[id] = definition.apply(null, arguments);
+		});
+	}
+
+	function defined(id) {
+		return !!modules[id];
+	}
+
+	function resolve(id) {
+		var target = exports;
+		var fragments = id.split(/[.\/]/);
+
+		for (var fi = 0; fi < fragments.length; ++fi) {
+			if (!target[fragments[fi]]) {
+				return;
+			}
+
+			target = target[fragments[fi]];
+		}
+
+		return target;
+	}
+
+	function expose(ids) {
+		for (var i = 0; i < ids.length; i++) {
+			var target = exports;
+			var id = ids[i];
+			var fragments = id.split(/[.\/]/);
+
+			for (var fi = 0; fi < fragments.length - 1; ++fi) {
+				if (target[fragments[fi]] === undefined) {
+					target[fragments[fi]] = {};
+				}
+
+				target = target[fragments[fi]];
+			}
+
+			target[fragments[fragments.length - 1]] = modules[id];
+		}
+	}
+
+// Included from: js/tinymce/plugins/table/classes/TableGrid.js
+
+/**
+ * TableGrid.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class creates a grid out of a table element. This
+ * makes it a whole lot easier to handle complex tables with
+ * col/row spans.
+ *
+ * @class tinymce.tableplugin.TableGrid
+ * @private
+ */
+define("tinymce/tableplugin/TableGrid", [
+	"tinymce/util/Tools",
+	"tinymce/Env"
+], function(Tools, Env) {
+	var each = Tools.each;
+
+	function getSpanVal(td, name) {
+		return parseInt(td.getAttribute(name) || 1, 10);
+	}
+
+	return function(editor, table) {
+		var grid, gridWidth, startPos, endPos, selectedCell, selection = editor.selection, dom = selection.dom;
+
+		function buildGrid() {
+			var startY = 0;
+
+			grid = [];
+			gridWidth = 0;
+
+			each(['thead', 'tbody', 'tfoot'], function(part) {
+				var rows = dom.select('> ' + part + ' tr', table);
+
+				each(rows, function(tr, y) {
+					y += startY;
+
+					each(dom.select('> td, > th', tr), function(td, x) {
+						var x2, y2, rowspan, colspan;
+
+						// Skip over existing cells produced by rowspan
+						if (grid[y]) {
+							while (grid[y][x]) {
+								x++;
+							}
+						}
+
+						// Get col/rowspan from cell
+						rowspan = getSpanVal(td, 'rowspan');
+						colspan = getSpanVal(td, 'colspan');
+
+						// Fill out rowspan/colspan right and down
+						for (y2 = y; y2 < y + rowspan; y2++) {
+							if (!grid[y2]) {
+								grid[y2] = [];
+							}
+
+							for (x2 = x; x2 < x + colspan; x2++) {
+								grid[y2][x2] = {
+									part: part,
+									real: y2 == y && x2 == x,
+									elm: td,
+									rowspan: rowspan,
+									colspan: colspan
+								};
+							}
+						}
+
+						gridWidth = Math.max(gridWidth, x + 1);
+					});
+				});
+
+				startY += rows.length;
+			});
+		}
+
+		function cloneNode(node, children) {
+			node = node.cloneNode(children);
+			node.removeAttribute('id');
+
+			return node;
+		}
+
+		function getCell(x, y) {
+			var row;
+
+			row = grid[y];
+			if (row) {
+				return row[x];
+			}
+		}
+
+		function setSpanVal(td, name, val) {
+			if (td) {
+				val = parseInt(val, 10);
+
+				if (val === 1) {
+					td.removeAttribute(name, 1);
+				} else {
+					td.setAttribute(name, val, 1);
+				}
+			}
+		}
+
+		function isCellSelected(cell) {
+			return cell && (dom.hasClass(cell.elm, 'mce-item-selected') || cell == selectedCell);
+		}
+
+		function getSelectedRows() {
+			var rows = [];
+
+			each(table.rows, function(row) {
+				each(row.cells, function(cell) {
+					if (dom.hasClass(cell, 'mce-item-selected') || (selectedCell && cell == selectedCell.elm)) {
+						rows.push(row);
+						return false;
+					}
+				});
+			});
+
+			return rows;
+		}
+
+		function deleteTable() {
+			var rng = dom.createRng();
+
+			rng.setStartAfter(table);
+			rng.setEndAfter(table);
+
+			selection.setRng(rng);
+
+			dom.remove(table);
+		}
+
+		function cloneCell(cell) {
+			var formatNode, cloneFormats = {};
+
+			if (editor.settings.table_clone_elements !== false) {
+				cloneFormats = Tools.makeMap(
+					(editor.settings.table_clone_elements || 'strong em b i span font h1 h2 h3 h4 h5 h6 p div').toUpperCase(),
+					/[ ,]/
+				);
+			}
+
+			// Clone formats
+			Tools.walk(cell, function(node) {
+				var curNode;
+
+				if (node.nodeType == 3) {
+					each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) {
+						if (!cloneFormats[node.nodeName]) {
+							return;
+						}
+
+						node = cloneNode(node, false);
+
+						if (!formatNode) {
+							formatNode = curNode = node;
+						} else if (curNode) {
+							curNode.appendChild(node);
+						}
+
+						curNode = node;
+					});
+
+					// Add something to the inner node
+					if (curNode) {
+						curNode.innerHTML = Env.ie ? '&nbsp;' : '<br data-mce-bogus="1" />';
+					}
+
+					return false;
+				}
+			}, 'childNodes');
+
+			cell = cloneNode(cell, false);
+			setSpanVal(cell, 'rowSpan', 1);
+			setSpanVal(cell, 'colSpan', 1);
+
+			if (formatNode) {
+				cell.appendChild(formatNode);
+			} else {
+				if (!Env.ie || Env.ie > 10) {
+					cell.innerHTML = '<br data-mce-bogus="1" />';
+				}
+			}
+
+			return cell;
+		}
+
+		function cleanup() {
+			var rng = dom.createRng(), row;
+
+			// Empty rows
+			each(dom.select('tr', table), function(tr) {
+				if (tr.cells.length === 0) {
+					dom.remove(tr);
+				}
+			});
+
+			// Empty table
+			if (dom.select('tr', table).length === 0) {
+				rng.setStartBefore(table);
+				rng.setEndBefore(table);
+				selection.setRng(rng);
+				dom.remove(table);
+				return;
+			}
+
+			// Empty header/body/footer
+			each(dom.select('thead,tbody,tfoot', table), function(part) {
+				if (part.rows.length === 0) {
+					dom.remove(part);
+				}
+			});
+
+			// Restore selection to start position if it still exists
+			buildGrid();
+
+			// If we have a valid startPos object
+			if (startPos) {
+				// Restore the selection to the closest table position
+				row = grid[Math.min(grid.length - 1, startPos.y)];
+				if (row) {
+					selection.select(row[Math.min(row.length - 1, startPos.x)].elm, true);
+					selection.collapse(true);
+				}
+			}
+		}
+
+		function fillLeftDown(x, y, rows, cols) {
+			var tr, x2, r, c, cell;
+
+			tr = grid[y][x].elm.parentNode;
+			for (r = 1; r <= rows; r++) {
+				tr = dom.getNext(tr, 'tr');
+
+				if (tr) {
+					// Loop left to find real cell
+					for (x2 = x; x2 >= 0; x2--) {
+						cell = grid[y + r][x2].elm;
+
+						if (cell.parentNode == tr) {
+							// Append clones after
+							for (c = 1; c <= cols; c++) {
+								dom.insertAfter(cloneCell(cell), cell);
+							}
+
+							break;
+						}
+					}
+
+					if (x2 == -1) {
+						// Insert nodes before first cell
+						for (c = 1; c <= cols; c++) {
+							tr.insertBefore(cloneCell(tr.cells[0]), tr.cells[0]);
+						}
+					}
+				}
+			}
+		}
+
+		function split() {
+			each(grid, function(row, y) {
+				each(row, function(cell, x) {
+					var colSpan, rowSpan, i;
+
+					if (isCellSelected(cell)) {
+						cell = cell.elm;
+						colSpan = getSpanVal(cell, 'colspan');
+						rowSpan = getSpanVal(cell, 'rowspan');
+
+						if (colSpan > 1 || rowSpan > 1) {
+							setSpanVal(cell, 'rowSpan', 1);
+							setSpanVal(cell, 'colSpan', 1);
+
+							// Insert cells right
+							for (i = 0; i < colSpan - 1; i++) {
+								dom.insertAfter(cloneCell(cell), cell);
+							}
+
+							fillLeftDown(x, y, rowSpan - 1, colSpan);
+						}
+					}
+				});
+			});
+		}
+
+		function merge(cell, cols, rows) {
+			var pos, startX, startY, endX, endY, x, y, startCell, endCell, children, count;
+
+			// Use specified cell and cols/rows
+			if (cell) {
+				pos = getPos(cell);
+				startX = pos.x;
+				startY = pos.y;
+				endX = startX + (cols - 1);
+				endY = startY + (rows - 1);
+			} else {
+				startPos = endPos = null;
+
+				// Calculate start/end pos by checking for selected cells in grid works better with context menu
+				each(grid, function(row, y) {
+					each(row, function(cell, x) {
+						if (isCellSelected(cell)) {
+							if (!startPos) {
+								startPos = {x: x, y: y};
+							}
+
+							endPos = {x: x, y: y};
+						}
+					});
+				});
+
+				// Use selection, but make sure startPos is valid before accessing
+				if (startPos) {
+					startX = startPos.x;
+					startY = startPos.y;
+					endX = endPos.x;
+					endY = endPos.y;
+				}
+			}
+
+			// Find start/end cells
+			startCell = getCell(startX, startY);
+			endCell = getCell(endX, endY);
+
+			// Check if the cells exists and if they are of the same part for example tbody = tbody
+			if (startCell && endCell && startCell.part == endCell.part) {
+				// Split and rebuild grid
+				split();
+				buildGrid();
+
+				// Set row/col span to start cell
+				startCell = getCell(startX, startY).elm;
+				setSpanVal(startCell, 'colSpan', (endX - startX) + 1);
+				setSpanVal(startCell, 'rowSpan', (endY - startY) + 1);
+
+				// Remove other cells and add it's contents to the start cell
+				for (y = startY; y <= endY; y++) {
+					for (x = startX; x <= endX; x++) {
+						if (!grid[y] || !grid[y][x]) {
+							continue;
+						}
+
+						cell = grid[y][x].elm;
+
+						/*jshint loopfunc:true */
+						/*eslint no-loop-func:0 */
+						if (cell != startCell) {
+							// Move children to startCell
+							children = Tools.grep(cell.childNodes);
+							each(children, function(node) {
+								startCell.appendChild(node);
+							});
+
+							// Remove bogus nodes if there is children in the target cell
+							if (children.length) {
+								children = Tools.grep(startCell.childNodes);
+								count = 0;
+								each(children, function(node) {
+									if (node.nodeName == 'BR' && dom.getAttrib(node, 'data-mce-bogus') && count++ < children.length - 1) {
+										startCell.removeChild(node);
+									}
+								});
+							}
+
+							dom.remove(cell);
+						}
+					}
+				}
+
+				// Remove empty rows etc and restore caret location
+				cleanup();
+			}
+		}
+
+		function insertRow(before) {
+			var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell, rowSpan;
+
+			// Find first/last row
+			each(grid, function(row, y) {
+				each(row, function(cell) {
+					if (isCellSelected(cell)) {
+						cell = cell.elm;
+						rowElm = cell.parentNode;
+						newRow = cloneNode(rowElm, false);
+						posY = y;
+
+						if (before) {
+							return false;
+						}
+					}
+				});
+
+				if (before) {
+					return !posY;
+				}
+			});
+
+			// If posY is undefined there is nothing for us to do here...just return to avoid crashing below
+			if (posY === undefined) {
+				return;
+			}
+
+			for (x = 0; x < grid[0].length; x++) {
+				// Cell not found could be because of an invalid table structure
+				if (!grid[posY][x]) {
+					continue;
+				}
+
+				cell = grid[posY][x].elm;
+
+				if (cell != lastCell) {
+					if (!before) {
+						rowSpan = getSpanVal(cell, 'rowspan');
+						if (rowSpan > 1) {
+							setSpanVal(cell, 'rowSpan', rowSpan + 1);
+							continue;
+						}
+					} else {
+						// Check if cell above can be expanded
+						if (posY > 0 && grid[posY - 1][x]) {
+							otherCell = grid[posY - 1][x].elm;
+							rowSpan = getSpanVal(otherCell, 'rowSpan');
+							if (rowSpan > 1) {
+								setSpanVal(otherCell, 'rowSpan', rowSpan + 1);
+								continue;
+							}
+						}
+					}
+
+					// Insert new cell into new row
+					newCell = cloneCell(cell);
+					setSpanVal(newCell, 'colSpan', cell.colSpan);
+
+					newRow.appendChild(newCell);
+
+					lastCell = cell;
+				}
+			}
+
+			if (newRow.hasChildNodes()) {
+				if (!before) {
+					dom.insertAfter(newRow, rowElm);
+				} else {
+					rowElm.parentNode.insertBefore(newRow, rowElm);
+				}
+			}
+		}
+
+		function insertCol(before) {
+			var posX, lastCell;
+
+			// Find first/last column
+			each(grid, function(row) {
+				each(row, function(cell, x) {
+					if (isCellSelected(cell)) {
+						posX = x;
+
+						if (before) {
+							return false;
+						}
+					}
+				});
+
+				if (before) {
+					return !posX;
+				}
+			});
+
+			each(grid, function(row, y) {
+				var cell, rowSpan, colSpan;
+
+				if (!row[posX]) {
+					return;
+				}
+
+				cell = row[posX].elm;
+				if (cell != lastCell) {
+					colSpan = getSpanVal(cell, 'colspan');
+					rowSpan = getSpanVal(cell, 'rowspan');
+
+					if (colSpan == 1) {
+						if (!before) {
+							dom.insertAfter(cloneCell(cell), cell);
+							fillLeftDown(posX, y, rowSpan - 1, colSpan);
+						} else {
+							cell.parentNode.insertBefore(cloneCell(cell), cell);
+							fillLeftDown(posX, y, rowSpan - 1, colSpan);
+						}
+					} else {
+						setSpanVal(cell, 'colSpan', cell.colSpan + 1);
+					}
+
+					lastCell = cell;
+				}
+			});
+		}
+
+		function deleteCols() {
+			var cols = [];
+
+			// Get selected column indexes
+			each(grid, function(row) {
+				each(row, function(cell, x) {
+					if (isCellSelected(cell) && Tools.inArray(cols, x) === -1) {
+						each(grid, function(row) {
+							var cell = row[x].elm, colSpan;
+
+							colSpan = getSpanVal(cell, 'colSpan');
+
+							if (colSpan > 1) {
+								setSpanVal(cell, 'colSpan', colSpan - 1);
+							} else {
+								dom.remove(cell);
+							}
+						});
+
+						cols.push(x);
+					}
+				});
+			});
+
+			cleanup();
+		}
+
+		function deleteRows() {
+			var rows;
+
+			function deleteRow(tr) {
+				var pos, lastCell;
+
+				// Move down row spanned cells
+				each(tr.cells, function(cell) {
+					var rowSpan = getSpanVal(cell, 'rowSpan');
+
+					if (rowSpan > 1) {
+						setSpanVal(cell, 'rowSpan', rowSpan - 1);
+						pos = getPos(cell);
+						fillLeftDown(pos.x, pos.y, 1, 1);
+					}
+				});
+
+				// Delete cells
+				pos = getPos(tr.cells[0]);
+				each(grid[pos.y], function(cell) {
+					var rowSpan;
+
+					cell = cell.elm;
+
+					if (cell != lastCell) {
+						rowSpan = getSpanVal(cell, 'rowSpan');
+
+						if (rowSpan <= 1) {
+							dom.remove(cell);
+						} else {
+							setSpanVal(cell, 'rowSpan', rowSpan - 1);
+						}
+
+						lastCell = cell;
+					}
+				});
+			}
+
+			// Get selected rows and move selection out of scope
+			rows = getSelectedRows();
+
+			// Delete all selected rows
+			each(rows.reverse(), function(tr) {
+				deleteRow(tr);
+			});
+
+			cleanup();
+		}
+
+		function cutRows() {
+			var rows = getSelectedRows();
+
+			dom.remove(rows);
+			cleanup();
+
+			return rows;
+		}
+
+		function copyRows() {
+			var rows = getSelectedRows();
+
+			each(rows, function(row, i) {
+				rows[i] = cloneNode(row, true);
+			});
+
+			return rows;
+		}
+
+		function pasteRows(rows, before) {
+			var selectedRows = getSelectedRows(),
+				targetRow = selectedRows[before ? 0 : selectedRows.length - 1],
+				targetCellCount = targetRow.cells.length;
+
+			// Nothing to paste
+			if (!rows) {
+				return;
+			}
+
+			// Calc target cell count
+			each(grid, function(row) {
+				var match;
+
+				targetCellCount = 0;
+				each(row, function(cell) {
+					if (cell.real) {
+						targetCellCount += cell.colspan;
+					}
+
+					if (cell.elm.parentNode == targetRow) {
+						match = 1;
+					}
+				});
+
+				if (match) {
+					return false;
+				}
+			});
+
+			if (!before) {
+				rows.reverse();
+			}
+
+			each(rows, function(row) {
+				var i, cellCount = row.cells.length, cell;
+
+				// Remove col/rowspans
+				for (i = 0; i < cellCount; i++) {
+					cell = row.cells[i];
+					setSpanVal(cell, 'colSpan', 1);
+					setSpanVal(cell, 'rowSpan', 1);
+				}
+
+				// Needs more cells
+				for (i = cellCount; i < targetCellCount; i++) {
+					row.appendChild(cloneCell(row.cells[cellCount - 1]));
+				}
+
+				// Needs less cells
+				for (i = targetCellCount; i < cellCount; i++) {
+					dom.remove(row.cells[i]);
+				}
+
+				// Add before/after
+				if (before) {
+					targetRow.parentNode.insertBefore(row, targetRow);
+				} else {
+					dom.insertAfter(row, targetRow);
+				}
+			});
+
+			// Remove current selection
+			dom.removeClass(dom.select('td.mce-item-selected,th.mce-item-selected'), 'mce-item-selected');
+		}
+
+		function getPos(target) {
+			var pos;
+
+			each(grid, function(row, y) {
+				each(row, function(cell, x) {
+					if (cell.elm == target) {
+						pos = {x: x, y: y};
+						return false;
+					}
+				});
+
+				return !pos;
+			});
+
+			return pos;
+		}
+
+		function setStartCell(cell) {
+			startPos = getPos(cell);
+		}
+
+		function findEndPos() {
+			var maxX, maxY;
+
+			maxX = maxY = 0;
+
+			each(grid, function(row, y) {
+				each(row, function(cell, x) {
+					var colSpan, rowSpan;
+
+					if (isCellSelected(cell)) {
+						cell = grid[y][x];
+
+						if (x > maxX) {
+							maxX = x;
+						}
+
+						if (y > maxY) {
+							maxY = y;
+						}
+
+						if (cell.real) {
+							colSpan = cell.colspan - 1;
+							rowSpan = cell.rowspan - 1;
+
+							if (colSpan) {
+								if (x + colSpan > maxX) {
+									maxX = x + colSpan;
+								}
+							}
+
+							if (rowSpan) {
+								if (y + rowSpan > maxY) {
+									maxY = y + rowSpan;
+								}
+							}
+						}
+					}
+				});
+			});
+
+			return {x: maxX, y: maxY};
+		}
+
+		function setEndCell(cell) {
+			var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan, x, y;
+
+			endPos = getPos(cell);
+
+			if (startPos && endPos) {
+				// Get start/end positions
+				startX = Math.min(startPos.x, endPos.x);
+				startY = Math.min(startPos.y, endPos.y);
+				endX = Math.max(startPos.x, endPos.x);
+				endY = Math.max(startPos.y, endPos.y);
+
+				// Expand end positon to include spans
+				maxX = endX;
+				maxY = endY;
+
+				// Expand startX
+				for (y = startY; y <= maxY; y++) {
+					cell = grid[y][startX];
+
+					if (!cell.real) {
+						if (startX - (cell.colspan - 1) < startX) {
+							startX -= cell.colspan - 1;
+						}
+					}
+				}
+
+				// Expand startY
+				for (x = startX; x <= maxX; x++) {
+					cell = grid[startY][x];
+
+					if (!cell.real) {
+						if (startY - (cell.rowspan - 1) < startY) {
+							startY -= cell.rowspan - 1;
+						}
+					}
+				}
+
+				// Find max X, Y
+				for (y = startY; y <= endY; y++) {
+					for (x = startX; x <= endX; x++) {
+						cell = grid[y][x];
+
+						if (cell.real) {
+							colSpan = cell.colspan - 1;
+							rowSpan = cell.rowspan - 1;
+
+							if (colSpan) {
+								if (x + colSpan > maxX) {
+									maxX = x + colSpan;
+								}
+							}
+
+							if (rowSpan) {
+								if (y + rowSpan > maxY) {
+									maxY = y + rowSpan;
+								}
+							}
+						}
+					}
+				}
+
+				// Remove current selection
+				dom.removeClass(dom.select('td.mce-item-selected,th.mce-item-selected'), 'mce-item-selected');
+
+				// Add new selection
+				for (y = startY; y <= maxY; y++) {
+					for (x = startX; x <= maxX; x++) {
+						if (grid[y][x]) {
+							dom.addClass(grid[y][x].elm, 'mce-item-selected');
+						}
+					}
+				}
+			}
+		}
+
+		function moveRelIdx(cellElm, delta) {
+			var pos, index, cell;
+
+			pos = getPos(cellElm);
+			index = pos.y * gridWidth + pos.x;
+
+			do {
+				index += delta;
+				cell = getCell(index % gridWidth, Math.floor(index / gridWidth));
+
+				if (!cell) {
+					break;
+				}
+
+				if (cell.elm != cellElm) {
+					selection.select(cell.elm, true);
+
+					if (dom.isEmpty(cell.elm)) {
+						selection.collapse(true);
+					}
+
+					return true;
+				}
+			} while (cell.elm == cellElm);
+
+			return false;
+		}
+
+		table = table || dom.getParent(selection.getStart(), 'table');
+
+		buildGrid();
+
+		selectedCell = dom.getParent(selection.getStart(), 'th,td');
+		if (selectedCell) {
+			startPos = getPos(selectedCell);
+			endPos = findEndPos();
+			selectedCell = getCell(startPos.x, startPos.y);
+		}
+
+		Tools.extend(this, {
+			deleteTable: deleteTable,
+			split: split,
+			merge: merge,
+			insertRow: insertRow,
+			insertCol: insertCol,
+			deleteCols: deleteCols,
+			deleteRows: deleteRows,
+			cutRows: cutRows,
+			copyRows: copyRows,
+			pasteRows: pasteRows,
+			getPos: getPos,
+			setStartCell: setStartCell,
+			setEndCell: setEndCell,
+			moveRelIdx: moveRelIdx,
+			refresh: buildGrid
+		});
+	};
+});
+
+// Included from: js/tinymce/plugins/table/classes/Quirks.js
+
+/**
+ * Quirks.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class includes fixes for various browser quirks.
+ *
+ * @class tinymce.tableplugin.Quirks
+ * @private
+ */
+define("tinymce/tableplugin/Quirks", [
+	"tinymce/util/VK",
+	"tinymce/Env",
+	"tinymce/util/Tools"
+], function(VK, Env, Tools) {
+	var each = Tools.each;
+
+	function getSpanVal(td, name) {
+		return parseInt(td.getAttribute(name) || 1, 10);
+	}
+
+	return function(editor) {
+		/**
+		 * Fixed caret movement around tables on WebKit.
+		 */
+		function moveWebKitSelection() {
+			function eventHandler(e) {
+				var key = e.keyCode;
+
+				function handle(upBool, sourceNode) {
+					var siblingDirection = upBool ? 'previousSibling' : 'nextSibling';
+					var currentRow = editor.dom.getParent(sourceNode, 'tr');
+					var siblingRow = currentRow[siblingDirection];
+
+					if (siblingRow) {
+						moveCursorToRow(editor, sourceNode, siblingRow, upBool);
+						e.preventDefault();
+						return true;
+					} else {
+						var tableNode = editor.dom.getParent(currentRow, 'table');
+						var middleNode = currentRow.parentNode;
+						var parentNodeName = middleNode.nodeName.toLowerCase();
+						if (parentNodeName === 'tbody' || parentNodeName === (upBool ? 'tfoot' : 'thead')) {
+							var targetParent = getTargetParent(upBool, tableNode, middleNode, 'tbody');
+							if (targetParent !== null) {
+								return moveToRowInTarget(upBool, targetParent, sourceNode);
+							}
+						}
+						return escapeTable(upBool, currentRow, siblingDirection, tableNode);
+					}
+				}
+
+				function getTargetParent(upBool, topNode, secondNode, nodeName) {
+					var tbodies = editor.dom.select('>' + nodeName, topNode);
+					var position = tbodies.indexOf(secondNode);
+					if (upBool && position === 0 || !upBool && position === tbodies.length - 1) {
+						return getFirstHeadOrFoot(upBool, topNode);
+					} else if (position === -1) {
+						var topOrBottom = secondNode.tagName.toLowerCase() === 'thead' ? 0 : tbodies.length - 1;
+						return tbodies[topOrBottom];
+					} else {
+						return tbodies[position + (upBool ? -1 : 1)];
+					}
+				}
+
+				function getFirstHeadOrFoot(upBool, parent) {
+					var tagName = upBool ? 'thead' : 'tfoot';
+					var headOrFoot = editor.dom.select('>' + tagName, parent);
+					return headOrFoot.length !== 0 ? headOrFoot[0] : null;
+				}
+
+				function moveToRowInTarget(upBool, targetParent, sourceNode) {
+					var targetRow = getChildForDirection(targetParent, upBool);
+
+					if (targetRow) {
+						moveCursorToRow(editor, sourceNode, targetRow, upBool);
+					}
+
+					e.preventDefault();
+					return true;
+				}
+
+				function escapeTable(upBool, currentRow, siblingDirection, table) {
+					var tableSibling = table[siblingDirection];
+
+					if (tableSibling) {
+						moveCursorToStartOfElement(tableSibling);
+						return true;
+					} else {
+						var parentCell = editor.dom.getParent(table, 'td,th');
+						if (parentCell) {
+							return handle(upBool, parentCell, e);
+						} else {
+							var backUpSibling = getChildForDirection(currentRow, !upBool);
+							moveCursorToStartOfElement(backUpSibling);
+							e.preventDefault();
+							return false;
+						}
+					}
+				}
+
+				function getChildForDirection(parent, up) {
+					var child = parent && parent[up ? 'lastChild' : 'firstChild'];
+					// BR is not a valid table child to return in this case we return the table cell
+					return child && child.nodeName === 'BR' ? editor.dom.getParent(child, 'td,th') : child;
+				}
+
+				function moveCursorToStartOfElement(n) {
+					editor.selection.setCursorLocation(n, 0);
+				}
+
+				function isVerticalMovement() {
+					return key == VK.UP || key == VK.DOWN;
+				}
+
+				function isInTable(editor) {
+					var node = editor.selection.getNode();
+					var currentRow = editor.dom.getParent(node, 'tr');
+					return currentRow !== null;
+				}
+
+				function columnIndex(column) {
+					var colIndex = 0;
+					var c = column;
+					while (c.previousSibling) {
+						c = c.previousSibling;
+						colIndex = colIndex + getSpanVal(c, "colspan");
+					}
+					return colIndex;
+				}
+
+				function findColumn(rowElement, columnIndex) {
+					var c = 0, r = 0;
+
+					each(rowElement.children, function(cell, i) {
+						c = c + getSpanVal(cell, "colspan");
+						r = i;
+						if (c > columnIndex) {
+							return false;
+						}
+					});
+					return r;
+				}
+
+				function moveCursorToRow(ed, node, row, upBool) {
+					var srcColumnIndex = columnIndex(editor.dom.getParent(node, 'td,th'));
+					var tgtColumnIndex = findColumn(row, srcColumnIndex);
+					var tgtNode = row.childNodes[tgtColumnIndex];
+					var rowCellTarget = getChildForDirection(tgtNode, upBool);
+					moveCursorToStartOfElement(rowCellTarget || tgtNode);
+				}
+
+				function shouldFixCaret(preBrowserNode) {
+					var newNode = editor.selection.getNode();
+					var newParent = editor.dom.getParent(newNode, 'td,th');
+					var oldParent = editor.dom.getParent(preBrowserNode, 'td,th');
+
+					return newParent && newParent !== oldParent && checkSameParentTable(newParent, oldParent);
+				}
+
+				function checkSameParentTable(nodeOne, NodeTwo) {
+					return editor.dom.getParent(nodeOne, 'TABLE') === editor.dom.getParent(NodeTwo, 'TABLE');
+				}
+
+				if (isVerticalMovement() && isInTable(editor)) {
+					var preBrowserNode = editor.selection.getNode();
+					setTimeout(function() {
+						if (shouldFixCaret(preBrowserNode)) {
+							handle(!e.shiftKey && key === VK.UP, preBrowserNode, e);
+						}
+					}, 0);
+				}
+			}
+
+			editor.on('KeyDown', function(e) {
+				eventHandler(e);
+			});
+		}
+
+		function fixBeforeTableCaretBug() {
+			// Checks if the selection/caret is at the start of the specified block element
+			function isAtStart(rng, par) {
+				var doc = par.ownerDocument, rng2 = doc.createRange(), elm;
+
+				rng2.setStartBefore(par);
+				rng2.setEnd(rng.endContainer, rng.endOffset);
+
+				elm = doc.createElement('body');
+				elm.appendChild(rng2.cloneContents());
+
+				// Check for text characters of other elements that should be treated as content
+				return elm.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi, '-').replace(/<[^>]+>/g, '').length === 0;
+			}
+
+			// Fixes an bug where it's impossible to place the caret before a table in Gecko
+			// this fix solves it by detecting when the caret is at the beginning of such a table
+			// and then manually moves the caret infront of the table
+			editor.on('KeyDown', function(e) {
+				var rng, table, dom = editor.dom;
+
+				// On gecko it's not possible to place the caret before a table
+				if (e.keyCode == 37 || e.keyCode == 38) {
+					rng = editor.selection.getRng();
+					table = dom.getParent(rng.startContainer, 'table');
+
+					if (table && editor.getBody().firstChild == table) {
+						if (isAtStart(rng, table)) {
+							rng = dom.createRng();
+
+							rng.setStartBefore(table);
+							rng.setEndBefore(table);
+
+							editor.selection.setRng(rng);
+
+							e.preventDefault();
+						}
+					}
+				}
+			});
+		}
+
+		// Fixes an issue on Gecko where it's impossible to place the caret behind a table
+		// This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled
+		function fixTableCaretPos() {
+			editor.on('KeyDown SetContent VisualAid', function() {
+				var last;
+
+				// Skip empty text nodes from the end
+				for (last = editor.getBody().lastChild; last; last = last.previousSibling) {
+					if (last.nodeType == 3) {
+						if (last.nodeValue.length > 0) {
+							break;
+						}
+					} else if (last.nodeType == 1 && (last.tagName == 'BR' || !last.getAttribute('data-mce-bogus'))) {
+						break;
+					}
+				}
+
+				if (last && last.nodeName == 'TABLE') {
+					if (editor.settings.forced_root_block) {
+						editor.dom.add(
+							editor.getBody(),
+							editor.settings.forced_root_block,
+							editor.settings.forced_root_block_attrs,
+							Env.ie && Env.ie < 11 ? '&nbsp;' : '<br data-mce-bogus="1" />'
+						);
+					} else {
+						editor.dom.add(editor.getBody(), 'br', {'data-mce-bogus': '1'});
+					}
+				}
+			});
+
+			editor.on('PreProcess', function(o) {
+				var last = o.node.lastChild;
+
+				if (last && (last.nodeName == "BR" || (last.childNodes.length == 1 &&
+					(last.firstChild.nodeName == 'BR' || last.firstChild.nodeValue == '\u00a0'))) &&
+					last.previousSibling && last.previousSibling.nodeName == "TABLE") {
+					editor.dom.remove(last);
+				}
+			});
+		}
+
+		// this nasty hack is here to work around some WebKit selection bugs.
+		function fixTableCellSelection() {
+			function tableCellSelected(ed, rng, n, currentCell) {
+				// The decision of when a table cell is selected is somewhat involved.  The fact that this code is
+				// required is actually a pointer to the root cause of this bug. A cell is selected when the start
+				// and end offsets are 0, the start container is a text, and the selection node is either a TR (most cases)
+				// or the parent of the table (in the case of the selection containing the last cell of a table).
+				var TEXT_NODE = 3, table = ed.dom.getParent(rng.startContainer, 'TABLE');
+				var tableParent, allOfCellSelected, tableCellSelection;
+
+				if (table) {
+					tableParent = table.parentNode;
+				}
+
+				allOfCellSelected = rng.startContainer.nodeType == TEXT_NODE &&
+					rng.startOffset === 0 &&
+					rng.endOffset === 0 &&
+					currentCell &&
+					(n.nodeName == "TR" || n == tableParent);
+
+				tableCellSelection = (n.nodeName == "TD" || n.nodeName == "TH") && !currentCell;
+
+				return allOfCellSelected || tableCellSelection;
+			}
+
+			function fixSelection() {
+				var rng = editor.selection.getRng();
+				var n = editor.selection.getNode();
+				var currentCell = editor.dom.getParent(rng.startContainer, 'TD,TH');
+
+				if (!tableCellSelected(editor, rng, n, currentCell)) {
+					return;
+				}
+
+				if (!currentCell) {
+					currentCell = n;
+				}
+
+				// Get the very last node inside the table cell
+				var end = currentCell.lastChild;
+				while (end.lastChild) {
+					end = end.lastChild;
+				}
+
+				// Select the entire table cell. Nothing outside of the table cell should be selected.
+				if (end.nodeType == 3) {
+					rng.setEnd(end, end.data.length);
+					editor.selection.setRng(rng);
+				}
+			}
+
+			editor.on('KeyDown', function() {
+				fixSelection();
+			});
+
+			editor.on('MouseDown', function(e) {
+				if (e.button != 2) {
+					fixSelection();
+				}
+			});
+		}
+
+		/**
+		 * Delete table if all cells are selected.
+		 */
+		function deleteTable() {
+			editor.on('keydown', function(e) {
+				if ((e.keyCode == VK.DELETE || e.keyCode == VK.BACKSPACE) && !e.isDefaultPrevented()) {
+					var table = editor.dom.getParent(editor.selection.getStart(), 'table');
+
+					if (table) {
+						var cells = editor.dom.select('td,th', table), i = cells.length;
+						while (i--) {
+							if (!editor.dom.hasClass(cells[i], 'mce-item-selected')) {
+								return;
+							}
+						}
+
+						e.preventDefault();
+						editor.execCommand('mceTableDelete');
+					}
+				}
+			});
+		}
+
+		deleteTable();
+
+		if (Env.webkit) {
+			moveWebKitSelection();
+			fixTableCellSelection();
+		}
+
+		if (Env.gecko) {
+			fixBeforeTableCaretBug();
+			fixTableCaretPos();
+		}
+
+		if (Env.ie > 10) {
+			fixBeforeTableCaretBug();
+			fixTableCaretPos();
+		}
+	};
+});
+
+// Included from: js/tinymce/plugins/table/classes/CellSelection.js
+
+/**
+ * CellSelection.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles table cell selection by faking it using a css class that gets applied
+ * to cells when dragging the mouse from one cell to another.
+ *
+ * @class tinymce.tableplugin.CellSelection
+ * @private
+ */
+define("tinymce/tableplugin/CellSelection", [
+	"tinymce/tableplugin/TableGrid",
+	"tinymce/dom/TreeWalker",
+	"tinymce/util/Tools"
+], function(TableGrid, TreeWalker, Tools) {
+	return function(editor) {
+		var dom = editor.dom, tableGrid, startCell, startTable, hasCellSelection = true, resizing;
+
+		function clear(force) {
+			// Restore selection possibilities
+			editor.getBody().style.webkitUserSelect = '';
+
+			if (force || hasCellSelection) {
+				editor.dom.removeClass(
+					editor.dom.select('td.mce-item-selected,th.mce-item-selected'),
+					'mce-item-selected'
+				);
+
+				hasCellSelection = false;
+			}
+		}
+
+		function cellSelectionHandler(e) {
+			var sel, table, target = e.target;
+
+			if (resizing) {
+				return;
+			}
+
+			if (startCell && (tableGrid || target != startCell) && (target.nodeName == 'TD' || target.nodeName == 'TH')) {
+				table = dom.getParent(target, 'table');
+				if (table == startTable) {
+					if (!tableGrid) {
+						tableGrid = new TableGrid(editor, table);
+						tableGrid.setStartCell(startCell);
+
+						editor.getBody().style.webkitUserSelect = 'none';
+					}
+
+					tableGrid.setEndCell(target);
+					hasCellSelection = true;
+				}
+
+				// Remove current selection
+				sel = editor.selection.getSel();
+
+				try {
+					if (sel.removeAllRanges) {
+						sel.removeAllRanges();
+					} else {
+						sel.empty();
+					}
+				} catch (ex) {
+					// IE9 might throw errors here
+				}
+
+				e.preventDefault();
+			}
+		}
+
+		// Add cell selection logic
+		editor.on('MouseDown', function(e) {
+			if (e.button != 2 && !resizing) {
+				clear();
+
+				startCell = dom.getParent(e.target, 'td,th');
+				startTable = dom.getParent(startCell, 'table');
+			}
+		});
+
+		editor.on('mouseover', cellSelectionHandler);
+
+		editor.on('remove', function() {
+			dom.unbind(editor.getDoc(), 'mouseover', cellSelectionHandler);
+		});
+
+		editor.on('MouseUp', function() {
+			var rng, sel = editor.selection, selectedCells, walker, node, lastNode;
+
+			function setPoint(node, start) {
+				var walker = new TreeWalker(node, node);
+
+				do {
+					// Text node
+					if (node.nodeType == 3 && Tools.trim(node.nodeValue).length !== 0) {
+						if (start) {
+							rng.setStart(node, 0);
+						} else {
+							rng.setEnd(node, node.nodeValue.length);
+						}
+
+						return;
+					}
+
+					// BR element
+					if (node.nodeName == 'BR') {
+						if (start) {
+							rng.setStartBefore(node);
+						} else {
+							rng.setEndBefore(node);
+						}
+
+						return;
+					}
+				} while ((node = (start ? walker.next() : walker.prev())));
+			}
+
+			// Move selection to startCell
+			if (startCell) {
+				if (tableGrid) {
+					editor.getBody().style.webkitUserSelect = '';
+				}
+
+				// Try to expand text selection as much as we can only Gecko supports cell selection
+				selectedCells = dom.select('td.mce-item-selected,th.mce-item-selected');
+				if (selectedCells.length > 0) {
+					rng = dom.createRng();
+					node = selectedCells[0];
+					rng.setStartBefore(node);
+					rng.setEndAfter(node);
+
+					setPoint(node, 1);
+					walker = new TreeWalker(node, dom.getParent(selectedCells[0], 'table'));
+
+					do {
+						if (node.nodeName == 'TD' || node.nodeName == 'TH') {
+							if (!dom.hasClass(node, 'mce-item-selected')) {
+								break;
+							}
+
+							lastNode = node;
+						}
+					} while ((node = walker.next()));
+
+					setPoint(lastNode);
+
+					sel.setRng(rng);
+				}
+
+				editor.nodeChanged();
+				startCell = tableGrid = startTable = null;
+			}
+		});
+
+		editor.on('KeyUp Drop SetContent', function(e) {
+			clear(e.type == 'setcontent');
+			startCell = tableGrid = startTable = null;
+			resizing = false;
+		});
+
+		editor.on('ObjectResizeStart ObjectResized', function(e) {
+			resizing = e.type != 'objectresized';
+		});
+
+		return {
+			clear: clear
+		};
+	};
+});
+
+// Included from: js/tinymce/plugins/table/classes/Dialogs.js
+
+/**
+ * Dialogs.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*eslint dot-notation:0*/
+
+/**
+ * ...
+ *
+ * @class tinymce.tableplugin.Dialogs
+ * @private
+ */
+define("tinymce/tableplugin/Dialogs", [
+	"tinymce/util/Tools",
+	"tinymce/Env"
+], function(Tools, Env) {
+	var each = Tools.each;
+
+	return function(editor) {
+		var self = this;
+
+		function createColorPickAction() {
+			var colorPickerCallback = editor.settings.color_picker_callback;
+
+			if (colorPickerCallback) {
+				return function() {
+					var self = this;
+
+					colorPickerCallback.call(
+						editor,
+						function(value) {
+							self.value(value).fire('change');
+						},
+						self.value()
+					);
+				};
+			}
+		}
+
+		function createStyleForm(dom) {
+			return {
+				title: 'Advanced',
+				type: 'form',
+				defaults: {
+					onchange: function() {
+						updateStyle(dom, this.parents().reverse()[0], this.name() == "style");
+					}
+				},
+				items: [
+					{
+						label: 'Style',
+						name: 'style',
+						type: 'textbox'
+					},
+
+					{
+						type: 'form',
+						padding: 0,
+						formItemDefaults: {
+							layout: 'grid',
+							alignH: ['start', 'right']
+						},
+						defaults: {
+							size: 7
+						},
+						items: [
+							{
+								label: 'Border color',
+								type: 'colorbox',
+								name: 'borderColor',
+								onaction: createColorPickAction()
+							},
+
+							{
+								label: 'Background color',
+								type: 'colorbox',
+								name: 'backgroundColor',
+								onaction: createColorPickAction()
+							}
+						]
+					}
+				]
+			};
+		}
+
+		function removePxSuffix(size) {
+			return size ? size.replace(/px$/, '') : "";
+		}
+
+		function addSizeSuffix(size) {
+			if (/^[0-9]+$/.test(size)) {
+				size += "px";
+			}
+
+			return size;
+		}
+
+		function unApplyAlign(elm) {
+			each('left center right'.split(' '), function(name) {
+				editor.formatter.remove('align' + name, {}, elm);
+			});
+		}
+
+		function unApplyVAlign(elm) {
+			each('top middle bottom'.split(' '), function(name) {
+				editor.formatter.remove('valign' + name, {}, elm);
+			});
+		}
+
+		function buildListItems(inputList, itemCallback, startItems) {
+			function appendItems(values, output) {
+				output = output || [];
+
+				Tools.each(values, function(item) {
+					var menuItem = {text: item.text || item.title};
+
+					if (item.menu) {
+						menuItem.menu = appendItems(item.menu);
+					} else {
+						menuItem.value = item.value;
+
+						if (itemCallback) {
+							itemCallback(menuItem);
+						}
+					}
+
+					output.push(menuItem);
+				});
+
+				return output;
+			}
+
+			return appendItems(inputList, startItems || []);
+		}
+
+		function updateStyle(dom, win, isStyleCtrl) {
+			var data = win.toJSON();
+			var css = dom.parseStyle(data.style);
+
+			if (isStyleCtrl) {
+				win.find('#borderColor').value(css["border-color"] || '')[0].fire('change');
+				win.find('#backgroundColor').value(css["background-color"] || '')[0].fire('change');
+			} else {
+				css["border-color"] = data.borderColor;
+				css["background-color"] = data.backgroundColor;
+			}
+
+			win.find('#style').value(dom.serializeStyle(dom.parseStyle(dom.serializeStyle(css))));
+		}
+
+		function appendStylesToData(dom, data, elm) {
+			var css = dom.parseStyle(dom.getAttrib(elm, 'style'));
+
+			if (css["border-color"]) {
+				data.borderColor = css["border-color"];
+			}
+
+			if (css["background-color"]) {
+				data.backgroundColor = css["background-color"];
+			}
+
+			data.style = dom.serializeStyle(css);
+		}
+
+		function mergeStyles(dom, elm, styles) {
+			var css = dom.parseStyle(dom.getAttrib(elm, 'style'));
+
+			each(styles, function(style) {
+				css[style.name] = style.value;
+			});
+
+			dom.setAttrib(elm, 'style', dom.serializeStyle(dom.parseStyle(dom.serializeStyle(css))));
+		}
+
+		self.tableProps = function() {
+			self.table(true);
+		};
+
+		self.table = function(isProps) {
+			var dom = editor.dom, tableElm, colsCtrl, rowsCtrl, classListCtrl, data = {}, generalTableForm, stylesToMerge;
+
+			function onSubmitTableForm() {
+
+				//Explore the layers of the table till we find the first layer of tds or ths
+				function styleTDTH (elm, name, value) {
+					if (elm.tagName === "TD" || elm.tagName === "TH") {
+						dom.setStyle(elm, name, value);
+					} else {
+						if (elm.children) {
+							for (var i = 0; i < elm.children.length; i++) {
+								styleTDTH(elm.children[i], name, value);
+							}
+						}
+					}
+				}
+
+				var captionElm;
+
+				updateStyle(dom, this);
+				data = Tools.extend(data, this.toJSON());
+
+				if (data["class"] === false) {
+					delete data["class"];
+				}
+
+				editor.undoManager.transact(function() {
+					if (!tableElm) {
+						tableElm = editor.plugins.table.insertTable(data.cols || 1, data.rows || 1);
+					}
+
+					editor.dom.setAttribs(tableElm, {
+						style: data.style,
+						'class': data['class']
+					});
+
+					if (editor.settings.table_style_by_css) {
+						stylesToMerge = [];
+						stylesToMerge.push({name: 'border', value: data.border});
+						stylesToMerge.push({name: 'border-spacing', value: addSizeSuffix(data.cellspacing)});
+						mergeStyles(dom, tableElm, stylesToMerge);
+						dom.setAttribs(tableElm, {
+							'data-mce-border-color': data.borderColor,
+							'data-mce-cell-padding': data.cellpadding,
+							'data-mce-border': data.border
+						});
+						if (tableElm.children) {
+							for (var i = 0; i < tableElm.children.length; i++) {
+								styleTDTH(tableElm.children[i], 'border', data.border);
+								styleTDTH(tableElm.children[i], 'padding', addSizeSuffix(data.cellpadding));
+							}
+						}
+					} else {
+						editor.dom.setAttribs(tableElm, {
+							border: data.border,
+							cellpadding: data.cellpadding,
+							cellspacing: data.cellspacing
+						});
+					}
+
+					if (dom.getAttrib(tableElm, 'width') && !editor.settings.table_style_by_css) {
+						dom.setAttrib(tableElm, 'width', removePxSuffix(data.width));
+					} else {
+						dom.setStyle(tableElm, 'width', addSizeSuffix(data.width));
+					}
+
+					dom.setStyle(tableElm, 'height', addSizeSuffix(data.height));
+
+					// Toggle caption on/off
+					captionElm = dom.select('caption', tableElm)[0];
+
+					if (captionElm && !data.caption) {
+						dom.remove(captionElm);
+					}
+
+					if (!captionElm && data.caption) {
+						captionElm = dom.create('caption');
+						captionElm.innerHTML = !Env.ie ? '<br data-mce-bogus="1"/>' : '\u00a0';
+						tableElm.insertBefore(captionElm, tableElm.firstChild);
+					}
+					unApplyAlign(tableElm);
+					if (data.align) {
+						editor.formatter.apply('align' + data.align, {}, tableElm);
+					}
+
+					editor.focus();
+					editor.addVisual();
+				});
+			}
+
+			function getTDTHOverallStyle (elm, name) {
+				var cells = editor.dom.select("td,th", elm), firstChildStyle;
+
+				function checkChildren(firstChildStyle, elms) {
+
+					for (var i = 0; i < elms.length; i++) {
+						var currentStyle = dom.getStyle(elms[i], name);
+						if (typeof firstChildStyle === "undefined") {
+							firstChildStyle = currentStyle;
+						}
+						if (firstChildStyle != currentStyle) {
+							return "";
+						}
+					}
+
+					return firstChildStyle;
+
+				}
+
+				firstChildStyle = checkChildren(firstChildStyle, cells);
+
+				return firstChildStyle;
+			}
+
+			if (isProps === true) {
+				tableElm = dom.getParent(editor.selection.getStart(), 'table');
+
+				if (tableElm) {
+					data = {
+						width: removePxSuffix(dom.getStyle(tableElm, 'width') || dom.getAttrib(tableElm, 'width')),
+						height: removePxSuffix(dom.getStyle(tableElm, 'height') || dom.getAttrib(tableElm, 'height')),
+						cellspacing: removePxSuffix(dom.getStyle(tableElm, 'border-spacing') ||
+							dom.getAttrib(tableElm, 'cellspacing')),
+						cellpadding: dom.getAttrib(tableElm, 'data-mce-cell-padding') || dom.getAttrib(tableElm, 'cellpadding') ||
+							getTDTHOverallStyle(tableElm, 'padding'),
+						border: dom.getAttrib(tableElm, 'data-mce-border') || dom.getAttrib(tableElm, 'border') ||
+							getTDTHOverallStyle(tableElm, 'border'),
+						borderColor: dom.getAttrib(tableElm, 'data-mce-border-color'),
+						caption: !!dom.select('caption', tableElm)[0],
+						'class': dom.getAttrib(tableElm, 'class')
+					};
+
+					each('left center right'.split(' '), function(name) {
+						if (editor.formatter.matchNode(tableElm, 'align' + name)) {
+							data.align = name;
+						}
+					});
+				}
+			} else {
+				colsCtrl = {label: 'Cols', name: 'cols'};
+				rowsCtrl = {label: 'Rows', name: 'rows'};
+			}
+
+			if (editor.settings.table_class_list) {
+				if (data["class"]) {
+					data["class"] = data["class"].replace(/\s*mce\-item\-table\s*/g, '');
+				}
+
+				classListCtrl = {
+					name: 'class',
+					type: 'listbox',
+					label: 'Class',
+					values: buildListItems(
+						editor.settings.table_class_list,
+						function(item) {
+							if (item.value) {
+								item.textStyle = function() {
+									return editor.formatter.getCssText({block: 'table', classes: [item.value]});
+								};
+							}
+						}
+					)
+				};
+			}
+
+			generalTableForm = {
+				type: 'form',
+				layout: 'flex',
+				direction: 'column',
+				labelGapCalc: 'children',
+				padding: 0,
+				items: [
+					{
+						type: 'form',
+						labelGapCalc: false,
+						padding: 0,
+						layout: 'grid',
+						columns: 2,
+						defaults: {
+							type: 'textbox',
+							maxWidth: 50
+						},
+						items: (editor.settings.table_appearance_options !== false) ? [
+							colsCtrl,
+							rowsCtrl,
+							{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'}
+						] : [
+							colsCtrl,
+							rowsCtrl,
+							{label: 'Width', name: 'width'},
+							{label: 'Height', name: 'height'}
+						]
+					},
+
+					{
+						label: 'Alignment',
+						name: 'align',
+						type: 'listbox',
+						text: 'None',
+						values: [
+							{text: 'None', value: ''},
+							{text: 'Left', value: 'left'},
+							{text: 'Center', value: 'center'},
+							{text: 'Right', value: 'right'}
+						]
+					},
+
+					classListCtrl
+				]
+			};
+
+			if (editor.settings.table_advtab !== false) {
+				appendStylesToData(dom, data, tableElm);
+
+				editor.windowManager.open({
+					title: "Table properties",
+					data: data,
+					bodyType: 'tabpanel',
+					body: [
+						{
+							title: 'General',
+							type: 'form',
+							items: generalTableForm
+						},
+						createStyleForm(dom)
+					],
+
+					onsubmit: onSubmitTableForm
+				});
+			} else {
+				editor.windowManager.open({
+					title: "Table properties",
+					data: data,
+					body: generalTableForm,
+					onsubmit: onSubmitTableForm
+				});
+			}
+		};
+
+		self.merge = function(grid, cell) {
+			editor.windowManager.open({
+				title: "Merge cells",
+				body: [
+					{label: 'Cols', name: 'cols', type: 'textbox', value: '1', size: 10},
+					{label: 'Rows', name: 'rows', type: 'textbox', value: '1', size: 10}
+				],
+				onsubmit: function() {
+					var data = this.toJSON();
+
+					editor.undoManager.transact(function() {
+						grid.merge(cell, data.cols, data.rows);
+					});
+				}
+			});
+		};
+
+		self.cell = function() {
+			var dom = editor.dom, cellElm, data, classListCtrl, cells = [];
+
+			function onSubmitCellForm() {
+				updateStyle(dom, this);
+				data = Tools.extend(data, this.toJSON());
+
+				editor.undoManager.transact(function() {
+					each(cells, function(cellElm) {
+						editor.dom.setAttribs(cellElm, {
+							scope: data.scope,
+							style: data.style,
+							'class': data['class']
+						});
+
+						editor.dom.setStyles(cellElm, {
+							width: addSizeSuffix(data.width),
+							height: addSizeSuffix(data.height)
+						});
+
+						// Switch cell type
+						if (data.type && cellElm.nodeName.toLowerCase() != data.type) {
+							cellElm = dom.rename(cellElm, data.type);
+						}
+
+						// Apply/remove alignment
+						unApplyAlign(cellElm);
+						if (data.align) {
+							editor.formatter.apply('align' + data.align, {}, cellElm);
+						}
+
+						// Apply/remove vertical alignment
+						unApplyVAlign(cellElm);
+						if (data.valign) {
+							editor.formatter.apply('valign' + data.valign, {}, cellElm);
+						}
+					});
+
+					editor.focus();
+				});
+			}
+
+			// Get selected cells or the current cell
+			cells = editor.dom.select('td.mce-item-selected,th.mce-item-selected');
+			cellElm = editor.dom.getParent(editor.selection.getStart(), 'td,th');
+			if (!cells.length && cellElm) {
+				cells.push(cellElm);
+			}
+
+			cellElm = cellElm || cells[0];
+
+			if (!cellElm) {
+				// If this element is null, return now to avoid crashing.
+				return;
+			}
+
+			data = {
+				width: removePxSuffix(dom.getStyle(cellElm, 'width') || dom.getAttrib(cellElm, 'width')),
+				height: removePxSuffix(dom.getStyle(cellElm, 'height') || dom.getAttrib(cellElm, 'height')),
+				scope: dom.getAttrib(cellElm, 'scope'),
+				'class': dom.getAttrib(cellElm, 'class')
+			};
+
+			data.type = cellElm.nodeName.toLowerCase();
+
+			each('left center right'.split(' '), function(name) {
+				if (editor.formatter.matchNode(cellElm, 'align' + name)) {
+					data.align = name;
+				}
+			});
+
+			each('top middle bottom'.split(' '), function(name) {
+				if (editor.formatter.matchNode(cellElm, 'valign' + name)) {
+					data.valign = name;
+				}
+			});
+
+			if (editor.settings.table_cell_class_list) {
+				classListCtrl = {
+					name: 'class',
+					type: 'listbox',
+					label: 'Class',
+					values: buildListItems(
+						editor.settings.table_cell_class_list,
+						function(item) {
+							if (item.value) {
+								item.textStyle = function() {
+									return editor.formatter.getCssText({block: 'td', classes: [item.value]});
+								};
+							}
+						}
+					)
+				};
+			}
+
+			var generalCellForm = {
+				type: 'form',
+				layout: 'flex',
+				direction: 'column',
+				labelGapCalc: 'children',
+				padding: 0,
+				items: [
+					{
+						type: 'form',
+						layout: 'grid',
+						columns: 2,
+						labelGapCalc: false,
+						padding: 0,
+						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,
+								values: [
+									{text: 'Cell', value: 'td'},
+									{text: 'Header cell', value: 'th'}
+								]
+							},
+							{
+								label: 'Scope',
+								name: 'scope',
+								type: 'listbox',
+								text: 'None',
+								minWidth: 90,
+								maxWidth: null,
+								values: [
+									{text: 'None', value: ''},
+									{text: 'Row', value: 'row'},
+									{text: 'Column', value: 'col'},
+									{text: 'Row group', value: 'rowgroup'},
+									{text: 'Column group', value: 'colgroup'}
+								]
+							},
+							{
+								label: 'H Align',
+								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'}
+								]
+							},
+							{
+								label: 'V Align',
+								name: 'valign',
+								type: 'listbox',
+								text: 'None',
+								minWidth: 90,
+								maxWidth: null,
+								values: [
+									{text: 'None', value: ''},
+									{text: 'Top', value: 'top'},
+									{text: 'Middle', value: 'middle'},
+									{text: 'Bottom', value: 'bottom'}
+								]
+							}
+						]
+					},
+
+					classListCtrl
+				]
+			};
+
+			if (editor.settings.table_cell_advtab !== false) {
+				appendStylesToData(dom, data, cellElm);
+
+				editor.windowManager.open({
+					title: "Cell properties",
+					bodyType: 'tabpanel',
+					data: data,
+					body: [
+						{
+							title: 'General',
+							type: 'form',
+							items: generalCellForm
+						},
+
+						createStyleForm(dom)
+					],
+
+					onsubmit: onSubmitCellForm
+				});
+			} else {
+				editor.windowManager.open({
+					title: "Cell properties",
+					data: data,
+					body: generalCellForm,
+					onsubmit: onSubmitCellForm
+				});
+			}
+		};
+
+		self.row = function() {
+			var dom = editor.dom, tableElm, cellElm, rowElm, classListCtrl, data, rows = [], generalRowForm;
+
+			function onSubmitRowForm() {
+				var tableElm, oldParentElm, parentElm;
+
+				updateStyle(dom, this);
+				data = Tools.extend(data, this.toJSON());
+
+				editor.undoManager.transact(function() {
+					var toType = data.type;
+
+					each(rows, function(rowElm) {
+						editor.dom.setAttribs(rowElm, {
+							scope: data.scope,
+							style: data.style,
+							'class': data['class']
+						});
+
+						editor.dom.setStyles(rowElm, {
+							height: addSizeSuffix(data.height)
+						});
+
+						if (toType != rowElm.parentNode.nodeName.toLowerCase()) {
+							tableElm = dom.getParent(rowElm, 'table');
+
+							oldParentElm = rowElm.parentNode;
+							parentElm = dom.select(toType, tableElm)[0];
+							if (!parentElm) {
+								parentElm = dom.create(toType);
+								if (tableElm.firstChild) {
+									tableElm.insertBefore(parentElm, tableElm.firstChild);
+								} else {
+									tableElm.appendChild(parentElm);
+								}
+							}
+
+							parentElm.appendChild(rowElm);
+
+							if (!oldParentElm.hasChildNodes()) {
+								dom.remove(oldParentElm);
+							}
+						}
+
+						// Apply/remove alignment
+						unApplyAlign(rowElm);
+						if (data.align) {
+							editor.formatter.apply('align' + data.align, {}, rowElm);
+						}
+					});
+
+					editor.focus();
+				});
+			}
+
+			tableElm = editor.dom.getParent(editor.selection.getStart(), 'table');
+			cellElm = editor.dom.getParent(editor.selection.getStart(), 'td,th');
+
+			each(tableElm.rows, function(row) {
+				each(row.cells, function(cell) {
+					if (dom.hasClass(cell, 'mce-item-selected') || cell == cellElm) {
+						rows.push(row);
+						return false;
+					}
+				});
+			});
+
+			rowElm = rows[0];
+			if (!rowElm) {
+				// If this element is null, return now to avoid crashing.
+				return;
+			}
+
+			data = {
+				height: removePxSuffix(dom.getStyle(rowElm, 'height') || dom.getAttrib(rowElm, 'height')),
+				scope: dom.getAttrib(rowElm, 'scope'),
+				'class': dom.getAttrib(rowElm, 'class')
+			};
+
+			data.type = rowElm.parentNode.nodeName.toLowerCase();
+
+			each('left center right'.split(' '), function(name) {
+				if (editor.formatter.matchNode(rowElm, 'align' + name)) {
+					data.align = name;
+				}
+			});
+
+			if (editor.settings.table_row_class_list) {
+				classListCtrl = {
+					name: 'class',
+					type: 'listbox',
+					label: 'Class',
+					values: buildListItems(
+						editor.settings.table_row_class_list,
+						function(item) {
+							if (item.value) {
+								item.textStyle = function() {
+									return editor.formatter.getCssText({block: 'tr', classes: [item.value]});
+								};
+							}
+						}
+					)
+				};
+			}
+
+			generalRowForm = {
+				type: 'form',
+				columns: 2,
+				padding: 0,
+				defaults: {
+					type: 'textbox'
+				},
+				items: [
+					{
+						type: 'listbox',
+						name: 'type',
+						label: 'Row type',
+						text: 'None',
+						maxWidth: null,
+						values: [
+							{text: 'Header', value: 'thead'},
+							{text: 'Body', value: 'tbody'},
+							{text: 'Footer', value: 'tfoot'}
+						]
+					},
+					{
+						type: 'listbox',
+						name: 'align',
+						label: 'Alignment',
+						text: 'None',
+						maxWidth: null,
+						values: [
+							{text: 'None', value: ''},
+							{text: 'Left', value: 'left'},
+							{text: 'Center', value: 'center'},
+							{text: 'Right', value: 'right'}
+						]
+					},
+					{label: 'Height', name: 'height'},
+					classListCtrl
+				]
+			};
+
+			if (editor.settings.table_row_advtab !== false) {
+				appendStylesToData(dom, data, rowElm);
+
+				editor.windowManager.open({
+					title: "Row properties",
+					data: data,
+					bodyType: 'tabpanel',
+					body: [
+						{
+							title: 'General',
+							type: 'form',
+							items: generalRowForm
+						},
+						createStyleForm(dom)
+					],
+
+					onsubmit: onSubmitRowForm
+				});
+			} else {
+				editor.windowManager.open({
+					title: "Row properties",
+					data: data,
+					body: generalRowForm,
+					onsubmit: onSubmitRowForm
+				});
+			}
+		};
+	};
+});
+
+// Included from: js/tinymce/plugins/table/classes/Plugin.js
+
+/**
+ * Plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class contains all core logic for the table plugin.
+ *
+ * @class tinymce.tableplugin.Plugin
+ * @private
+ */
+define("tinymce/tableplugin/Plugin", [
+	"tinymce/tableplugin/TableGrid",
+	"tinymce/tableplugin/Quirks",
+	"tinymce/tableplugin/CellSelection",
+	"tinymce/tableplugin/Dialogs",
+	"tinymce/util/Tools",
+	"tinymce/dom/TreeWalker",
+	"tinymce/Env",
+	"tinymce/PluginManager"
+], function(TableGrid, Quirks, CellSelection, Dialogs, Tools, TreeWalker, Env, PluginManager) {
+	var each = Tools.each;
+
+	function Plugin(editor) {
+		var clipboardRows, self = this, dialogs = new Dialogs(editor);
+
+		function cmd(command) {
+			return function() {
+				editor.execCommand(command);
+			};
+		}
+
+		function insertTable(cols, rows) {
+			var y, x, html, tableElm;
+
+			html = '<table id="__mce"><tbody>';
+
+			for (y = 0; y < rows; y++) {
+				html += '<tr>';
+
+				for (x = 0; x < cols; x++) {
+					html += '<td>' + (Env.ie ? " " : '<br>') + '</td>';
+				}
+
+				html += '</tr>';
+			}
+
+			html += '</tbody></table>';
+
+			editor.undoManager.transact(function() {
+				editor.insertContent(html);
+
+				tableElm = editor.dom.get('__mce');
+				editor.dom.setAttrib(tableElm, 'id', null);
+
+				editor.dom.setAttribs(tableElm, editor.settings.table_default_attributes || {});
+				editor.dom.setStyles(tableElm, editor.settings.table_default_styles || {});
+			});
+
+			return tableElm;
+		}
+
+		function handleDisabledState(ctrl, selector) {
+			function bindStateListener() {
+				ctrl.disabled(!editor.dom.getParent(editor.selection.getStart(), selector));
+
+				editor.selection.selectorChanged(selector, function(state) {
+					ctrl.disabled(!state);
+				});
+			}
+
+			if (editor.initialized) {
+				bindStateListener();
+			} else {
+				editor.on('init', bindStateListener);
+			}
+		}
+
+		function postRender() {
+			/*jshint validthis:true*/
+			handleDisabledState(this, 'table');
+		}
+
+		function postRenderCell() {
+			/*jshint validthis:true*/
+			handleDisabledState(this, 'td,th');
+		}
+
+		function generateTableGrid() {
+			var html = '';
+
+			html = '<table role="grid" class="mce-grid mce-grid-border" aria-readonly="true">';
+
+			for (var y = 0; y < 10; y++) {
+				html += '<tr>';
+
+				for (var x = 0; x < 10; x++) {
+					html += '<td role="gridcell" tabindex="-1"><a id="mcegrid' + (y * 10 + x) + '" href="#" ' +
+						'data-mce-x="' + x + '" data-mce-y="' + y + '"></a></td>';
+				}
+
+				html += '</tr>';
+			}
+
+			html += '</table>';
+
+			html += '<div class="mce-text-center" role="presentation">1 x 1</div>';
+
+			return html;
+		}
+
+		function selectGrid(tx, ty, control) {
+			var table = control.getEl().getElementsByTagName('table')[0];
+			var x, y, focusCell, cell, active;
+			var rtl = control.isRtl() || control.parent().rel == 'tl-tr';
+
+			table.nextSibling.innerHTML = (tx + 1) + ' x ' + (ty + 1);
+
+			if (rtl) {
+				tx = 9 - tx;
+			}
+
+			for (y = 0; y < 10; y++) {
+				for (x = 0; x < 10; x++) {
+					cell = table.rows[y].childNodes[x].firstChild;
+					active = (rtl ? x >= tx : x <= tx) && y <= ty;
+
+					editor.dom.toggleClass(cell, 'mce-active', active);
+
+					if (active) {
+						focusCell = cell;
+					}
+				}
+			}
+
+			return focusCell.parentNode;
+		}
+
+		if (editor.settings.table_grid === false) {
+			editor.addMenuItem('inserttable', {
+				text: 'Insert table',
+				icon: 'table',
+				context: 'table',
+				onclick: dialogs.table
+			});
+		} else {
+			editor.addMenuItem('inserttable', {
+				text: 'Insert table',
+				icon: 'table',
+				context: 'table',
+				ariaHideMenu: true,
+				onclick: function(e) {
+					if (e.aria) {
+						this.parent().hideAll();
+						e.stopImmediatePropagation();
+						dialogs.table();
+					}
+				},
+				onshow: function() {
+					selectGrid(0, 0, this.menu.items()[0]);
+				},
+				onhide: function() {
+					var elements = this.menu.items()[0].getEl().getElementsByTagName('a');
+					editor.dom.removeClass(elements, 'mce-active');
+					editor.dom.addClass(elements[0], 'mce-active');
+				},
+				menu: [
+					{
+						type: 'container',
+						html: generateTableGrid(),
+
+						onPostRender: function() {
+							this.lastX = this.lastY = 0;
+						},
+
+						onmousemove: function(e) {
+							var target = e.target, x, y;
+
+							if (target.tagName.toUpperCase() == 'A') {
+								x = parseInt(target.getAttribute('data-mce-x'), 10);
+								y = parseInt(target.getAttribute('data-mce-y'), 10);
+
+								if (this.isRtl() || this.parent().rel == 'tl-tr') {
+									x = 9 - x;
+								}
+
+								if (x !== this.lastX || y !== this.lastY) {
+									selectGrid(x, y, e.control);
+
+									this.lastX = x;
+									this.lastY = y;
+								}
+							}
+						},
+
+						onclick: function(e) {
+							var self = this;
+
+							if (e.target.tagName.toUpperCase() == 'A') {
+								e.preventDefault();
+								e.stopPropagation();
+								self.parent().cancel();
+
+								editor.undoManager.transact(function() {
+									insertTable(self.lastX + 1, self.lastY + 1);
+								});
+
+								editor.addVisual();
+							}
+						}
+					}
+				]
+			});
+		}
+
+		editor.addMenuItem('tableprops', {
+			text: 'Table properties',
+			context: 'table',
+			onPostRender: postRender,
+			onclick: dialogs.tableProps
+		});
+
+		editor.addMenuItem('deletetable', {
+			text: 'Delete table',
+			context: 'table',
+			onPostRender: postRender,
+			cmd: 'mceTableDelete'
+		});
+
+		editor.addMenuItem('cell', {
+			separator: 'before',
+			text: 'Cell',
+			context: 'table',
+			menu: [
+				{text: 'Cell properties', onclick: cmd('mceTableCellProps'), onPostRender: postRenderCell},
+				{text: 'Merge cells', onclick: cmd('mceTableMergeCells'), onPostRender: postRenderCell},
+				{text: 'Split cell', onclick: cmd('mceTableSplitCells'), onPostRender: postRenderCell}
+			]
+		});
+
+		editor.addMenuItem('row', {
+			text: 'Row',
+			context: 'table',
+			menu: [
+				{text: 'Insert row before', onclick: cmd('mceTableInsertRowBefore'), onPostRender: postRenderCell},
+				{text: 'Insert row after', onclick: cmd('mceTableInsertRowAfter'), onPostRender: postRenderCell},
+				{text: 'Delete row', onclick: cmd('mceTableDeleteRow'), onPostRender: postRenderCell},
+				{text: 'Row properties', onclick: cmd('mceTableRowProps'), onPostRender: postRenderCell},
+				{text: '-'},
+				{text: 'Cut row', onclick: cmd('mceTableCutRow'), onPostRender: postRenderCell},
+				{text: 'Copy row', onclick: cmd('mceTableCopyRow'), onPostRender: postRenderCell},
+				{text: 'Paste row before', onclick: cmd('mceTablePasteRowBefore'), onPostRender: postRenderCell},
+				{text: 'Paste row after', onclick: cmd('mceTablePasteRowAfter'), onPostRender: postRenderCell}
+			]
+		});
+
+		editor.addMenuItem('column', {
+			text: 'Column',
+			context: 'table',
+			menu: [
+				{text: 'Insert column before', onclick: cmd('mceTableInsertColBefore'), onPostRender: postRenderCell},
+				{text: 'Insert column after', onclick: cmd('mceTableInsertColAfter'), onPostRender: postRenderCell},
+				{text: 'Delete column', onclick: cmd('mceTableDeleteCol'), onPostRender: postRenderCell}
+			]
+		});
+
+		var menuItems = [];
+		each("inserttable tableprops deletetable | cell row column".split(' '), function(name) {
+			if (name == '|') {
+				menuItems.push({text: '-'});
+			} else {
+				menuItems.push(editor.menuItems[name]);
+			}
+		});
+
+		editor.addButton("table", {
+			type: "menubutton",
+			title: "Table",
+			menu: menuItems
+		});
+
+		// Select whole table is a table border is clicked
+		if (!Env.isIE) {
+			editor.on('click', function(e) {
+				e = e.target;
+
+				if (e.nodeName === 'TABLE') {
+					editor.selection.select(e);
+					editor.nodeChanged();
+				}
+			});
+		}
+
+		self.quirks = new Quirks(editor);
+
+		editor.on('Init', function() {
+			self.cellSelection = new CellSelection(editor);
+		});
+
+		editor.on('PreInit', function() {
+			// Remove internal data attributes
+			editor.serializer.addAttributeFilter(
+				'data-mce-cell-padding,data-mce-border,data-mce-border-color',
+				function(nodes, name) {
+
+					var i = nodes.length;
+
+					while (i--) {
+						nodes[i].attr(name, null);
+					}
+				});
+		});
+
+		// Register action commands
+		each({
+			mceTableSplitCells: function(grid) {
+				grid.split();
+			},
+
+			mceTableMergeCells: function(grid) {
+				var cell;
+
+				cell = editor.dom.getParent(editor.selection.getStart(), 'th,td');
+
+				if (!editor.dom.select('td.mce-item-selected,th.mce-item-selected').length) {
+					dialogs.merge(grid, cell);
+				} else {
+					grid.merge();
+				}
+			},
+
+			mceTableInsertRowBefore: function(grid) {
+				grid.insertRow(true);
+			},
+
+			mceTableInsertRowAfter: function(grid) {
+				grid.insertRow();
+			},
+
+			mceTableInsertColBefore: function(grid) {
+				grid.insertCol(true);
+			},
+
+			mceTableInsertColAfter: function(grid) {
+				grid.insertCol();
+			},
+
+			mceTableDeleteCol: function(grid) {
+				grid.deleteCols();
+			},
+
+			mceTableDeleteRow: function(grid) {
+				grid.deleteRows();
+			},
+
+			mceTableCutRow: function(grid) {
+				clipboardRows = grid.cutRows();
+			},
+
+			mceTableCopyRow: function(grid) {
+				clipboardRows = grid.copyRows();
+			},
+
+			mceTablePasteRowBefore: function(grid) {
+				grid.pasteRows(clipboardRows, true);
+			},
+
+			mceTablePasteRowAfter: function(grid) {
+				grid.pasteRows(clipboardRows);
+			},
+
+			mceTableDelete: function(grid) {
+				grid.deleteTable();
+			}
+		}, function(func, name) {
+			editor.addCommand(name, function() {
+				var grid = new TableGrid(editor);
+
+				if (grid) {
+					func(grid);
+					editor.execCommand('mceRepaint');
+					self.cellSelection.clear();
+				}
+			});
+		});
+
+		// Register dialog commands
+		each({
+			mceInsertTable: dialogs.table,
+			mceTableProps: function() {
+				dialogs.table(true);
+			},
+			mceTableRowProps: dialogs.row,
+			mceTableCellProps: dialogs.cell
+		}, function(func, name) {
+			editor.addCommand(name, function(ui, val) {
+				func(val);
+			});
+		});
+
+		// Enable tab key cell navigation
+		if (editor.settings.table_tab_navigation !== false) {
+			editor.on('keydown', function(e) {
+				var cellElm, grid, delta;
+
+				if (e.keyCode == 9) {
+					cellElm = editor.dom.getParent(editor.selection.getStart(), 'th,td');
+
+					if (cellElm) {
+						e.preventDefault();
+
+						grid = new TableGrid(editor);
+						delta = e.shiftKey ? -1 : 1;
+
+						editor.undoManager.transact(function() {
+							if (!grid.moveRelIdx(cellElm, delta) && delta > 0) {
+								grid.insertRow();
+								grid.refresh();
+								grid.moveRelIdx(cellElm, delta);
+							}
+						});
+					}
+				}
+			});
+		}
+
+		self.insertTable = insertTable;
+	}
+
+	PluginManager.add('table', Plugin);
+});
+})(this);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/table/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+(function(b,g){var d={};function c(m,n){var l,j=[];for(var k=0;k<m.length;++k){l=d[m[k]]||e(m[k]);if(!l){throw"module definition dependecy not found: "+m[k]}j.push(l)}n.apply(null,j)}function h(k,j,i){if(typeof k!=="string"){throw"invalid module definition, module id must be defined and be a string"}if(j===g){throw"invalid module definition, dependencies must be specified"}if(i===g){throw"invalid module definition, definition function must be specified"}c(j,function(){d[k]=i.apply(null,arguments)})}function f(i){return !!d[i]}function e(l){var j=b;var i=l.split(/[.\/]/);for(var k=0;k<i.length;++k){if(!j[i[k]]){return}j=j[i[k]]}return j}function a(l){for(var k=0;k<l.length;k++){var m=b;var o=l[k];var j=o.split(/[.\/]/);for(var n=0;n<j.length-1;++n){if(m[j[n]]===g){m[j[n]]={}}m=m[j[n]]}m[j[j.length-1]]=d[o]}}h("tinymce/tableplugin/TableGrid",["tinymce/util/Tools","tinymce/Env"],function(k,j){var l=k.each;function i(n,m){return parseInt(n.getAttribute(m)||1,10)}return function(v,O){var n,N,S,J,w,R=v.selection,M=R.dom;function B(){var T=0;n=[];N=0;l(["thead","tbody","tfoot"],function(U){var V=M.select("> "+U+" tr",O);l(V,function(W,X){X+=T;l(M.select("> td, > th",W),function(ad,Y){var Z,aa,ab,ac;if(n[X]){while(n[X][Y]){Y++}}ab=i(ad,"rowspan");ac=i(ad,"colspan");for(aa=X;aa<X+ab;aa++){if(!n[aa]){n[aa]=[]}for(Z=Y;Z<Y+ac;Z++){n[aa][Z]={part:U,real:aa==X&&Z==Y,elm:ad,rowspan:ab,colspan:ac}}}N=Math.max(N,Y+1)})});T+=V.length})}function G(U,T){U=U.cloneNode(T);U.removeAttribute("id");return U}function F(T,V){var U;U=n[V];if(U){return U[T]}}function A(V,T,U){if(V){U=parseInt(U,10);if(U===1){V.removeAttribute(T,1)}else{V.setAttribute(T,U,1)}}}function p(T){return T&&(M.hasClass(T.elm,"mce-item-selected")||T==w)}function r(){var T=[];l(O.rows,function(U){l(U.cells,function(V){if(M.hasClass(V,"mce-item-selected")||(w&&V==w.elm)){T.push(U);return false}})});return T}function z(){var T=M.createRng();T.setStartAfter(O);T.setEndAfter(O);R.setRng(T);M.remove(O)}function m(T){var V,U={};if(v.settings.table_clone_elements!==false){U=k.makeMap((v.settings.table_clone_elements||"strong em b i span font h1 h2 h3 h4 h5 h6 p div").toUpperCase(),/[ ,]/)}k.walk(T,function(X){var W;if(X.nodeType==3){l(M.getParents(X.parentNode,null,T).reverse(),function(Y){if(!U[Y.nodeName]){return}Y=G(Y,false);if(!V){V=W=Y}else{if(W){W.appendChild(Y)}}W=Y});if(W){W.innerHTML=j.ie?"&nbsp;":'<br data-mce-bogus="1" />'}return false}},"childNodes");T=G(T,false);A(T,"rowSpan",1);A(T,"colSpan",1);if(V){T.appendChild(V)}else{if(!j.ie||j.ie>10){T.innerHTML='<br data-mce-bogus="1" />'}}return T}function y(){var T=M.createRng(),U;l(M.select("tr",O),function(V){if(V.cells.length===0){M.remove(V)}});if(M.select("tr",O).length===0){T.setStartBefore(O);T.setEndBefore(O);R.setRng(T);M.remove(O);return}l(M.select("thead,tbody,tfoot",O),function(V){if(V.rows.length===0){M.remove(V)}});B();if(S){U=n[Math.min(n.length-1,S.y)];if(U){R.select(U[Math.min(U.length-1,S.x)].elm,true);R.collapse(true)}}}function C(Z,X,ab,Y){var W,U,T,V,aa;W=n[X][Z].elm.parentNode;for(T=1;T<=ab;T++){W=M.getNext(W,"tr");if(W){for(U=Z;U>=0;U--){aa=n[X+T][U].elm;if(aa.parentNode==W){for(V=1;V<=Y;V++){M.insertAfter(m(aa),aa)}break}}if(U==-1){for(V=1;V<=Y;V++){W.insertBefore(m(W.cells[0]),W.cells[0])}}}}}function I(){l(n,function(T,U){l(T,function(W,V){var Z,Y,X;if(p(W)){W=W.elm;Z=i(W,"colspan");Y=i(W,"rowspan");if(Z>1||Y>1){A(W,"rowSpan",1);A(W,"colSpan",1);for(X=0;X<Z-1;X++){M.insertAfter(m(W),W)}C(V,U,Y-1,Z)}}})})}function x(ad,aa,ag){var Z,W,V,af,ae,ac,Y,ab,T,U,X;if(ad){Z=L(ad);W=Z.x;V=Z.y;af=W+(aa-1);ae=V+(ag-1)}else{S=J=null;l(n,function(ah,ai){l(ah,function(ak,aj){if(p(ak)){if(!S){S={x:aj,y:ai}}J={x:aj,y:ai}}})});if(S){W=S.x;V=S.y;af=J.x;ae=J.y}}ab=F(W,V);T=F(af,ae);if(ab&&T&&ab.part==T.part){I();B();ab=F(W,V).elm;A(ab,"colSpan",(af-W)+1);A(ab,"rowSpan",(ae-V)+1);for(Y=V;Y<=ae;Y++){for(ac=W;ac<=af;ac++){if(!n[Y]||!n[Y][ac]){continue}ad=n[Y][ac].elm;if(ad!=ab){U=k.grep(ad.childNodes);l(U,function(ah){ab.appendChild(ah)});if(U.length){U=k.grep(ab.childNodes);X=0;l(U,function(ah){if(ah.nodeName=="BR"&&M.getAttrib(ah,"data-mce-bogus")&&X++<U.length-1){ab.removeChild(ah)}})}M.remove(ad)}}}y()}}function s(X){var T,Z,W,Y,aa,ab,U,ac,V;l(n,function(ad,ae){l(ad,function(af){if(p(af)){af=af.elm;aa=af.parentNode;ab=G(aa,false);T=ae;if(X){return false}}});if(X){return !T}});if(T===g){return}for(Y=0;Y<n[0].length;Y++){if(!n[T][Y]){continue}Z=n[T][Y].elm;if(Z!=W){if(!X){V=i(Z,"rowspan");if(V>1){A(Z,"rowSpan",V+1);continue}}else{if(T>0&&n[T-1][Y]){ac=n[T-1][Y].elm;V=i(ac,"rowSpan");if(V>1){A(ac,"rowSpan",V+1);continue}}}U=m(Z);A(U,"colSpan",Z.colSpan);ab.appendChild(U);W=Z}}if(ab.hasChildNodes()){if(!X){M.insertAfter(ab,aa)}else{aa.parentNode.insertBefore(ab,aa)}}}function o(U){var V,T;l(n,function(W){l(W,function(Y,X){if(p(Y)){V=X;if(U){return false}}});if(U){return !V}});l(n,function(Z,aa){var W,X,Y;if(!Z[V]){return}W=Z[V].elm;if(W!=T){Y=i(W,"colspan");X=i(W,"rowspan");if(Y==1){if(!U){M.insertAfter(m(W),W);C(V,aa,X-1,Y)}else{W.parentNode.insertBefore(m(W),W);C(V,aa,X-1,Y)}}else{A(W,"colSpan",W.colSpan+1)}T=W}})}function u(){var T=[];l(n,function(U){l(U,function(W,V){if(p(W)&&k.inArray(T,V)===-1){l(n,function(Z){var X=Z[V].elm,Y;Y=i(X,"colSpan");if(Y>1){A(X,"colSpan",Y-1)}else{M.remove(X)}});T.push(V)}})});y()}function t(){var U;function T(W){var X,V;l(W.cells,function(Y){var Z=i(Y,"rowSpan");if(Z>1){A(Y,"rowSpan",Z-1);X=L(Y);C(X.x,X.y,1,1)}});X=L(W.cells[0]);l(n[X.y],function(Y){var Z;Y=Y.elm;if(Y!=V){Z=i(Y,"rowSpan");if(Z<=1){M.remove(Y)}else{A(Y,"rowSpan",Z-1)}V=Y}})}U=r();l(U.reverse(),function(V){T(V)});y()}function K(){var T=r();M.remove(T);y();return T}function Q(){var T=r();l(T,function(V,U){T[U]=G(V,true)});return T}function H(V,U){var W=r(),T=W[U?0:W.length-1],X=T.cells.length;if(!V){return}l(n,function(Z){var Y;X=0;l(Z,function(aa){if(aa.real){X+=aa.colspan}if(aa.elm.parentNode==T){Y=1}});if(Y){return false}});if(!U){V.reverse()}l(V,function(ab){var Z,aa=ab.cells.length,Y;for(Z=0;Z<aa;Z++){Y=ab.cells[Z];A(Y,"colSpan",1);A(Y,"rowSpan",1)}for(Z=aa;Z<X;Z++){ab.appendChild(m(ab.cells[aa-1]))}for(Z=X;Z<aa;Z++){M.remove(ab.cells[Z])}if(U){T.parentNode.insertBefore(ab,T)}else{M.insertAfter(ab,T)}});M.removeClass(M.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected")}function L(T){var U;l(n,function(V,W){l(V,function(Y,X){if(Y.elm==T){U={x:X,y:W};return false}});return !U});return U}function E(T){S=L(T)}function P(){var U,T;U=T=0;l(n,function(V,W){l(V,function(Y,X){var aa,Z;if(p(Y)){Y=n[W][X];if(X>U){U=X}if(W>T){T=W}if(Y.real){aa=Y.colspan-1;Z=Y.rowspan-1;if(aa){if(X+aa>U){U=X+aa}}if(Z){if(W+Z>T){T=W+Z}}}}})});return{x:U,y:T}}function D(ab){var W,V,ad,ac,U,T,X,Y,aa,Z;J=L(ab);if(S&&J){W=Math.min(S.x,J.x);V=Math.min(S.y,J.y);ad=Math.max(S.x,J.x);ac=Math.max(S.y,J.y);U=ad;T=ac;for(Z=V;Z<=T;Z++){ab=n[Z][W];if(!ab.real){if(W-(ab.colspan-1)<W){W-=ab.colspan-1}}}for(aa=W;aa<=U;aa++){ab=n[V][aa];if(!ab.real){if(V-(ab.rowspan-1)<V){V-=ab.rowspan-1}}}for(Z=V;Z<=ac;Z++){for(aa=W;aa<=ad;aa++){ab=n[Z][aa];if(ab.real){X=ab.colspan-1;Y=ab.rowspan-1;if(X){if(aa+X>U){U=aa+X}}if(Y){if(Z+Y>T){T=Z+Y}}}}}M.removeClass(M.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected");for(Z=V;Z<=T;Z++){for(aa=W;aa<=U;aa++){if(n[Z][aa]){M.addClass(n[Z][aa].elm,"mce-item-selected")}}}}}function q(V,X){var W,U,T;W=L(V);U=W.y*N+W.x;do{U+=X;T=F(U%N,Math.floor(U/N));if(!T){break}if(T.elm!=V){R.select(T.elm,true);if(M.isEmpty(T.elm)){R.collapse(true)}return true}}while(T.elm==V);return false}O=O||M.getParent(R.getStart(),"table");B();w=M.getParent(R.getStart(),"th,td");if(w){S=L(w);J=P();w=F(S.x,S.y)}k.extend(this,{deleteTable:z,split:I,merge:x,insertRow:s,insertCol:o,deleteCols:u,deleteRows:t,cutRows:K,copyRows:Q,pasteRows:H,getPos:L,setStartCell:E,setEndCell:D,moveRelIdx:q,refresh:B})}});h("tinymce/tableplugin/Quirks",["tinymce/util/VK","tinymce/Env","tinymce/util/Tools"],function(m,j,k){var l=k.each;function i(o,n){return parseInt(o.getAttribute(n)||1,10)}return function(r){function s(){function t(C){var I=C.keyCode;function A(R,N){var M=R?"previousSibling":"nextSibling";var S=r.dom.getParent(N,"tr");var Q=S[M];if(Q){E(r,N,Q,R);C.preventDefault();return true}else{var T=r.dom.getParent(S,"table");var P=S.parentNode;var L=P.nodeName.toLowerCase();if(L==="tbody"||L===(R?"tfoot":"thead")){var O=v(R,T,P,"tbody");if(O!==null){return x(R,O,N)}}return H(R,S,M,T)}}function v(P,N,O,R){var M=r.dom.select(">"+R,N);var L=M.indexOf(O);if(P&&L===0||!P&&L===M.length-1){return y(P,N)}else{if(L===-1){var Q=O.tagName.toLowerCase()==="thead"?0:M.length-1;return M[Q]}else{return M[L+(P?-1:1)]}}}function y(O,N){var M=O?"thead":"tfoot";var L=r.dom.select(">"+M,N);return L.length!==0?L[0]:null}function x(O,N,M){var L=u(N,O);if(L){E(r,M,L,O)}C.preventDefault();return true}function H(R,O,L,Q){var M=Q[L];if(M){G(M);return true}else{var P=r.dom.getParent(Q,"td,th");if(P){return A(R,P,C)}else{var N=u(O,!R);G(N);C.preventDefault();return false}}}function u(M,L){var N=M&&M[L?"lastChild":"firstChild"];return N&&N.nodeName==="BR"?r.dom.getParent(N,"td,th"):N}function G(L){r.selection.setCursorLocation(L,0)}function D(){return I==m.UP||I==m.DOWN}function F(M){var N=M.selection.getNode();var L=M.dom.getParent(N,"tr");return L!==null}function B(M){var L=0;var N=M;while(N.previousSibling){N=N.previousSibling;L=L+i(N,"colspan")}return L}function w(N,L){var O=0,M=0;l(N.children,function(P,Q){O=O+i(P,"colspan");M=Q;if(O>L){return false}});return M}function E(N,Q,S,P){var R=B(r.dom.getParent(Q,"td,th"));var M=w(S,R);var L=S.childNodes[M];var O=u(L,P);G(O||L)}function K(L){var N=r.selection.getNode();var O=r.dom.getParent(N,"td,th");var M=r.dom.getParent(L,"td,th");return O&&O!==M&&z(O,M)}function z(M,L){return r.dom.getParent(M,"TABLE")===r.dom.getParent(L,"TABLE")}if(D()&&F(r)){var J=r.selection.getNode();setTimeout(function(){if(K(J)){A(!C.shiftKey&&I===m.UP,J,C)}},0)}}r.on("KeyDown",function(u){t(u)})}function n(){function t(v,w){var x=w.ownerDocument,u=x.createRange(),y;u.setStartBefore(w);u.setEnd(v.endContainer,v.endOffset);y=x.createElement("body");y.appendChild(u.cloneContents());return y.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length===0}r.on("KeyDown",function(w){var u,v,x=r.dom;if(w.keyCode==37||w.keyCode==38){u=r.selection.getRng();v=x.getParent(u.startContainer,"table");if(v&&r.getBody().firstChild==v){if(t(u,v)){u=x.createRng();u.setStartBefore(v);u.setEndBefore(v);r.selection.setRng(u);w.preventDefault()}}}})}function p(){r.on("KeyDown SetContent VisualAid",function(){var t;for(t=r.getBody().lastChild;t;t=t.previousSibling){if(t.nodeType==3){if(t.nodeValue.length>0){break}}else{if(t.nodeType==1&&(t.tagName=="BR"||!t.getAttribute("data-mce-bogus"))){break}}}if(t&&t.nodeName=="TABLE"){if(r.settings.forced_root_block){r.dom.add(r.getBody(),r.settings.forced_root_block,r.settings.forced_root_block_attrs,j.ie&&j.ie<11?"&nbsp;":'<br data-mce-bogus="1" />')}else{r.dom.add(r.getBody(),"br",{"data-mce-bogus":"1"})}}});r.on("PreProcess",function(u){var t=u.node.lastChild;if(t&&(t.nodeName=="BR"||(t.childNodes.length==1&&(t.firstChild.nodeName=="BR"||t.firstChild.nodeValue=="\u00a0")))&&t.previousSibling&&t.previousSibling.nodeName=="TABLE"){r.dom.remove(t)}})}function o(){function t(A,w,x,C){var y=3,D=A.dom.getParent(w.startContainer,"TABLE");var z,v,B;if(D){z=D.parentNode}v=w.startContainer.nodeType==y&&w.startOffset===0&&w.endOffset===0&&C&&(x.nodeName=="TR"||x==z);B=(x.nodeName=="TD"||x.nodeName=="TH")&&!C;return v||B}function u(){var w=r.selection.getRng();var y=r.selection.getNode();var x=r.dom.getParent(w.startContainer,"TD,TH");if(!t(r,w,y,x)){return}if(!x){x=y}var v=x.lastChild;while(v.lastChild){v=v.lastChild}if(v.nodeType==3){w.setEnd(v,v.data.length);r.selection.setRng(w)}}r.on("KeyDown",function(){u()});r.on("MouseDown",function(v){if(v.button!=2){u()}})}function q(){r.on("keydown",function(w){if((w.keyCode==m.DELETE||w.keyCode==m.BACKSPACE)&&!w.isDefaultPrevented()){var v=r.dom.getParent(r.selection.getStart(),"table");if(v){var t=r.dom.select("td,th",v),u=t.length;while(u--){if(!r.dom.hasClass(t[u],"mce-item-selected")){return}}w.preventDefault();r.execCommand("mceTableDelete")}}})}q();if(j.webkit){s();o()}if(j.gecko){n();p()}if(j.ie>10){n();p()}}});h("tinymce/tableplugin/CellSelection",["tinymce/tableplugin/TableGrid","tinymce/dom/TreeWalker","tinymce/util/Tools"],function(j,k,i){return function(p){var n=p.dom,s,r,m,t=true,q;function o(u){p.getBody().style.webkitUserSelect="";if(u||t){p.dom.removeClass(p.dom.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected");t=false}}function l(y){var w,v,x=y.target;if(q){return}if(r&&(s||x!=r)&&(x.nodeName=="TD"||x.nodeName=="TH")){v=n.getParent(x,"table");if(v==m){if(!s){s=new j(p,v);s.setStartCell(r);p.getBody().style.webkitUserSelect="none"}s.setEndCell(x);t=true}w=p.selection.getSel();try{if(w.removeAllRanges){w.removeAllRanges()}else{w.empty()}}catch(u){}y.preventDefault()}}p.on("MouseDown",function(u){if(u.button!=2&&!q){o();r=n.getParent(u.target,"td,th");m=n.getParent(r,"table")}});p.on("mouseover",l);p.on("remove",function(){n.unbind(p.getDoc(),"mouseover",l)});p.on("MouseUp",function(){var v,z=p.selection,u,A,y,x;function w(B,D){var C=new k(B,B);do{if(B.nodeType==3&&i.trim(B.nodeValue).length!==0){if(D){v.setStart(B,0)}else{v.setEnd(B,B.nodeValue.length)}return}if(B.nodeName=="BR"){if(D){v.setStartBefore(B)}else{v.setEndBefore(B)}return}}while((B=(D?C.next():C.prev())))}if(r){if(s){p.getBody().style.webkitUserSelect=""}u=n.select("td.mce-item-selected,th.mce-item-selected");if(u.length>0){v=n.createRng();y=u[0];v.setStartBefore(y);v.setEndAfter(y);w(y,1);A=new k(y,n.getParent(u[0],"table"));do{if(y.nodeName=="TD"||y.nodeName=="TH"){if(!n.hasClass(y,"mce-item-selected")){break}x=y}}while((y=A.next()));w(x);z.setRng(v)}p.nodeChanged();r=s=m=null}});p.on("KeyUp Drop SetContent",function(u){o(u.type=="setcontent");r=s=m=null;q=false});p.on("ObjectResizeStart ObjectResized",function(u){q=u.type!="objectresized"});return{clear:o}}});h("tinymce/tableplugin/Dialogs",["tinymce/util/Tools","tinymce/Env"],function(j,i){var k=j.each;return function(n){var w=this;function q(){var x=n.settings.color_picker_callback;if(x){return function(){var y=this;x.call(n,function(z){y.value(z).fire("change")},y.value())}}}function t(x){return{title:"Advanced",type:"form",defaults:{onchange:function(){v(x,this.parents().reverse()[0],this.name()=="style")}},items:[{label:"Style",name:"style",type:"textbox"},{type:"form",padding:0,formItemDefaults:{layout:"grid",alignH:["start","right"]},defaults:{size:7},items:[{label:"Border color",type:"colorbox",name:"borderColor",onaction:q()},{label:"Background color",type:"colorbox",name:"backgroundColor",onaction:q()}]}]}}function m(x){return x?x.replace(/px$/,""):""}function u(x){if(/^[0-9]+$/.test(x)){x+="px"}return x}function s(x){k("left center right".split(" "),function(y){n.formatter.remove("align"+y,{},x)})}function o(x){k("top middle bottom".split(" "),function(y){n.formatter.remove("valign"+y,{},x)})}function p(z,x,A){function y(C,B){B=B||[];j.each(C,function(E){var D={text:E.text||E.title};if(E.menu){D.menu=y(E.menu)}else{D.value=E.value;if(x){x(D)}}B.push(D)});return B}return y(z,A||[])}function v(B,A,x){var z=A.toJSON();var y=B.parseStyle(z.style);if(x){A.find("#borderColor").value(y["border-color"]||"")[0].fire("change");A.find("#backgroundColor").value(y["background-color"]||"")[0].fire("change")}else{y["border-color"]=z.borderColor;y["background-color"]=z.backgroundColor}A.find("#style").value(B.serializeStyle(B.parseStyle(B.serializeStyle(y))))}function l(z,y,A){var x=z.parseStyle(z.getAttrib(A,"style"));if(x["border-color"]){y.borderColor=x["border-color"]}if(x["background-color"]){y.backgroundColor=x["background-color"]}y.style=z.serializeStyle(x)}function r(z,A,y){var x=z.parseStyle(z.getAttrib(A,"style"));k(y,function(B){x[B.name]=B.value});z.setAttrib(A,"style",z.serializeStyle(z.parseStyle(z.serializeStyle(x))))}w.tableProps=function(){w.table(true)};w.table=function(B){var y=n.dom,D,F,C,x,A={},G,z;function H(){function J(N,K,M){if(N.tagName==="TD"||N.tagName==="TH"){y.setStyle(N,K,M)}else{if(N.children){for(var L=0;L<N.children.length;L++){J(N.children[L],K,M)}}}}var I;v(y,this);A=j.extend(A,this.toJSON());if(A["class"]===false){delete A["class"]}n.undoManager.transact(function(){if(!D){D=n.plugins.table.insertTable(A.cols||1,A.rows||1)}n.dom.setAttribs(D,{style:A.style,"class":A["class"]});if(n.settings.table_style_by_css){z=[];z.push({name:"border",value:A.border});z.push({name:"border-spacing",value:u(A.cellspacing)});r(y,D,z);y.setAttribs(D,{"data-mce-border-color":A.borderColor,"data-mce-cell-padding":A.cellpadding,"data-mce-border":A.border});if(D.children){for(var K=0;K<D.children.length;K++){J(D.children[K],"border",A.border);J(D.children[K],"padding",u(A.cellpadding))}}}else{n.dom.setAttribs(D,{border:A.border,cellpadding:A.cellpadding,cellspacing:A.cellspacing})}if(y.getAttrib(D,"width")&&!n.settings.table_style_by_css){y.setAttrib(D,"width",m(A.width))}else{y.setStyle(D,"width",u(A.width))}y.setStyle(D,"height",u(A.height));I=y.select("caption",D)[0];if(I&&!A.caption){y.remove(I)}if(!I&&A.caption){I=y.create("caption");I.innerHTML=!i.ie?'<br data-mce-bogus="1"/>':"\u00a0";D.insertBefore(I,D.firstChild)}s(D);if(A.align){n.formatter.apply("align"+A.align,{},D)}n.focus();n.addVisual()})}function E(M,K){var J=n.dom.select("td,th",M),L;function I(Q,P){for(var O=0;O<P.length;O++){var N=y.getStyle(P[O],K);if(typeof Q==="undefined"){Q=N}if(Q!=N){return""}}return Q}L=I(L,J);return L}if(B===true){D=y.getParent(n.selection.getStart(),"table");if(D){A={width:m(y.getStyle(D,"width")||y.getAttrib(D,"width")),height:m(y.getStyle(D,"height")||y.getAttrib(D,"height")),cellspacing:m(y.getStyle(D,"border-spacing")||y.getAttrib(D,"cellspacing")),cellpadding:y.getAttrib(D,"data-mce-cell-padding")||y.getAttrib(D,"cellpadding")||E(D,"padding"),border:y.getAttrib(D,"data-mce-border")||y.getAttrib(D,"border")||E(D,"border"),borderColor:y.getAttrib(D,"data-mce-border-color"),caption:!!y.select("caption",D)[0],"class":y.getAttrib(D,"class")};k("left center right".split(" "),function(I){if(n.formatter.matchNode(D,"align"+I)){A.align=I}})}}else{F={label:"Cols",name:"cols"};C={label:"Rows",name:"rows"}}if(n.settings.table_class_list){if(A["class"]){A["class"]=A["class"].replace(/\s*mce\-item\-table\s*/g,"")}x={name:"class",type:"listbox",label:"Class",values:p(n.settings.table_class_list,function(I){if(I.value){I.textStyle=function(){return n.formatter.getCssText({block:"table",classes:[I.value]})}}})}}G={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",labelGapCalc:false,padding:0,layout:"grid",columns:2,defaults:{type:"textbox",maxWidth:50},items:(n.settings.table_appearance_options!==false)?[F,C,{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"}]:[F,C,{label:"Width",name:"width"},{label:"Height",name:"height"}]},{label:"Alignment",name:"align",type:"listbox",text:"None",values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},x]};if(n.settings.table_advtab!==false){l(y,A,D);n.windowManager.open({title:"Table properties",data:A,bodyType:"tabpanel",body:[{title:"General",type:"form",items:G},t(y)],onsubmit:H})}else{n.windowManager.open({title:"Table properties",data:A,body:G,onsubmit:H})}};w.merge=function(y,x){n.windowManager.open({title:"Merge cells",body:[{label:"Cols",name:"cols",type:"textbox",value:"1",size:10},{label:"Rows",name:"rows",type:"textbox",value:"1",size:10}],onsubmit:function(){var z=this.toJSON();n.undoManager.transact(function(){y.merge(x,z.cols,z.rows)})}})};w.cell=function(){var D=n.dom,z,C,A,x=[];function B(){v(D,this);C=j.extend(C,this.toJSON());n.undoManager.transact(function(){k(x,function(E){n.dom.setAttribs(E,{scope:C.scope,style:C.style,"class":C["class"]});n.dom.setStyles(E,{width:u(C.width),height:u(C.height)});if(C.type&&E.nodeName.toLowerCase()!=C.type){E=D.rename(E,C.type)}s(E);if(C.align){n.formatter.apply("align"+C.align,{},E)}o(E);if(C.valign){n.formatter.apply("valign"+C.valign,{},E)}});n.focus()})}x=n.dom.select("td.mce-item-selected,th.mce-item-selected");z=n.dom.getParent(n.selection.getStart(),"td,th");if(!x.length&&z){x.push(z)}z=z||x[0];if(!z){return}C={width:m(D.getStyle(z,"width")||D.getAttrib(z,"width")),height:m(D.getStyle(z,"height")||D.getAttrib(z,"height")),scope:D.getAttrib(z,"scope"),"class":D.getAttrib(z,"class")};C.type=z.nodeName.toLowerCase();k("left center right".split(" "),function(E){if(n.formatter.matchNode(z,"align"+E)){C.align=E}});k("top middle bottom".split(" "),function(E){if(n.formatter.matchNode(z,"valign"+E)){C.valign=E}});if(n.settings.table_cell_class_list){A={name:"class",type:"listbox",label:"Class",values:p(n.settings.table_cell_class_list,function(E){if(E.value){E.textStyle=function(){return n.formatter.getCssText({block:"td",classes:[E.value]})}}})}}var y={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",layout:"grid",columns:2,labelGapCalc:false,padding:0,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,values:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{label:"Scope",name:"scope",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{label:"H Align",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"}]},{label:"V Align",name:"valign",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}]}]},A]};if(n.settings.table_cell_advtab!==false){l(D,C,z);n.windowManager.open({title:"Cell properties",bodyType:"tabpanel",data:C,body:[{title:"General",type:"form",items:y},t(D)],onsubmit:B})}else{n.windowManager.open({title:"Cell properties",data:C,body:y,onsubmit:B})}};w.row=function(){var z=n.dom,C,D,E,x,A,F=[],y;function B(){var G,H,I;v(z,this);A=j.extend(A,this.toJSON());n.undoManager.transact(function(){var J=A.type;k(F,function(K){n.dom.setAttribs(K,{scope:A.scope,style:A.style,"class":A["class"]});n.dom.setStyles(K,{height:u(A.height)});if(J!=K.parentNode.nodeName.toLowerCase()){G=z.getParent(K,"table");H=K.parentNode;I=z.select(J,G)[0];if(!I){I=z.create(J);if(G.firstChild){G.insertBefore(I,G.firstChild)}else{G.appendChild(I)}}I.appendChild(K);if(!H.hasChildNodes()){z.remove(H)}}s(K);if(A.align){n.formatter.apply("align"+A.align,{},K)}});n.focus()})}C=n.dom.getParent(n.selection.getStart(),"table");D=n.dom.getParent(n.selection.getStart(),"td,th");k(C.rows,function(G){k(G.cells,function(H){if(z.hasClass(H,"mce-item-selected")||H==D){F.push(G);return false}})});E=F[0];if(!E){return}A={height:m(z.getStyle(E,"height")||z.getAttrib(E,"height")),scope:z.getAttrib(E,"scope"),"class":z.getAttrib(E,"class")};A.type=E.parentNode.nodeName.toLowerCase();k("left center right".split(" "),function(G){if(n.formatter.matchNode(E,"align"+G)){A.align=G}});if(n.settings.table_row_class_list){x={name:"class",type:"listbox",label:"Class",values:p(n.settings.table_row_class_list,function(G){if(G.value){G.textStyle=function(){return n.formatter.getCssText({block:"tr",classes:[G.value]})}}})}}y={type:"form",columns:2,padding:0,defaults:{type:"textbox"},items:[{type:"listbox",name:"type",label:"Row type",text:"None",maxWidth:null,values:[{text:"Header",value:"thead"},{text:"Body",value:"tbody"},{text:"Footer",value:"tfoot"}]},{type:"listbox",name:"align",label:"Alignment",text:"None",maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height"},x]};if(n.settings.table_row_advtab!==false){l(z,A,E);n.windowManager.open({title:"Row properties",data:A,bodyType:"tabpanel",body:[{title:"General",type:"form",items:y},t(z)],onsubmit:B})}else{n.windowManager.open({title:"Row properties",data:A,body:y,onsubmit:B})}}}});h("tinymce/tableplugin/Plugin",["tinymce/tableplugin/TableGrid","tinymce/tableplugin/Quirks","tinymce/tableplugin/CellSelection","tinymce/tableplugin/Dialogs","tinymce/util/Tools","tinymce/dom/TreeWalker","tinymce/Env","tinymce/PluginManager"],function(q,p,r,n,i,o,k,j){var m=i.each;function l(A){var B,D=this,u=new n(A);function w(E){return function(){A.execCommand(E)}}function x(I,H){var J,E,G,F;G='<table id="__mce"><tbody>';for(J=0;J<H;J++){G+="<tr>";for(E=0;E<I;E++){G+="<td>"+(k.ie?" ":"<br>")+"</td>"}G+="</tr>"}G+="</tbody></table>";A.undoManager.transact(function(){A.insertContent(G);F=A.dom.get("__mce");A.dom.setAttrib(F,"id",null);A.dom.setAttribs(F,A.settings.table_default_attributes||{});A.dom.setStyles(F,A.settings.table_default_styles||{})});return F}function v(F,E){function G(){F.disabled(!A.dom.getParent(A.selection.getStart(),E));A.selection.selectorChanged(E,function(H){F.disabled(!H)})}if(A.initialized){G()}else{A.on("init",G)}}function z(){v(this,"table")}function y(){v(this,"td,th")}function C(){var F="";F='<table role="grid" class="mce-grid mce-grid-border" aria-readonly="true">';for(var G=0;G<10;G++){F+="<tr>";for(var E=0;E<10;E++){F+='<td role="gridcell" tabindex="-1"><a id="mcegrid'+(G*10+E)+'" href="#" data-mce-x="'+E+'" data-mce-y="'+G+'"></a></td>'}F+="</tr>"}F+="</table>";F+='<div class="mce-text-center" role="presentation">1 x 1</div>';return F}function t(H,F,G){var M=G.getEl().getElementsByTagName("table")[0];var K,J,N,L,E;var I=G.isRtl()||G.parent().rel=="tl-tr";M.nextSibling.innerHTML=(H+1)+" x "+(F+1);if(I){H=9-H}for(J=0;J<10;J++){for(K=0;K<10;K++){L=M.rows[J].childNodes[K].firstChild;E=(I?K>=H:K<=H)&&J<=F;A.dom.toggleClass(L,"mce-active",E);if(E){N=L}}}return N.parentNode}if(A.settings.table_grid===false){A.addMenuItem("inserttable",{text:"Insert table",icon:"table",context:"table",onclick:u.table})}else{A.addMenuItem("inserttable",{text:"Insert table",icon:"table",context:"table",ariaHideMenu:true,onclick:function(E){if(E.aria){this.parent().hideAll();E.stopImmediatePropagation();u.table()}},onshow:function(){t(0,0,this.menu.items()[0])},onhide:function(){var E=this.menu.items()[0].getEl().getElementsByTagName("a");A.dom.removeClass(E,"mce-active");A.dom.addClass(E[0],"mce-active")},menu:[{type:"container",html:C(),onPostRender:function(){this.lastX=this.lastY=0},onmousemove:function(G){var F=G.target,E,H;if(F.tagName.toUpperCase()=="A"){E=parseInt(F.getAttribute("data-mce-x"),10);H=parseInt(F.getAttribute("data-mce-y"),10);if(this.isRtl()||this.parent().rel=="tl-tr"){E=9-E}if(E!==this.lastX||H!==this.lastY){t(E,H,G.control);this.lastX=E;this.lastY=H}}},onclick:function(F){var E=this;if(F.target.tagName.toUpperCase()=="A"){F.preventDefault();F.stopPropagation();E.parent().cancel();A.undoManager.transact(function(){x(E.lastX+1,E.lastY+1)});A.addVisual()}}}]})}A.addMenuItem("tableprops",{text:"Table properties",context:"table",onPostRender:z,onclick:u.tableProps});A.addMenuItem("deletetable",{text:"Delete table",context:"table",onPostRender:z,cmd:"mceTableDelete"});A.addMenuItem("cell",{separator:"before",text:"Cell",context:"table",menu:[{text:"Cell properties",onclick:w("mceTableCellProps"),onPostRender:y},{text:"Merge cells",onclick:w("mceTableMergeCells"),onPostRender:y},{text:"Split cell",onclick:w("mceTableSplitCells"),onPostRender:y}]});A.addMenuItem("row",{text:"Row",context:"table",menu:[{text:"Insert row before",onclick:w("mceTableInsertRowBefore"),onPostRender:y},{text:"Insert row after",onclick:w("mceTableInsertRowAfter"),onPostRender:y},{text:"Delete row",onclick:w("mceTableDeleteRow"),onPostRender:y},{text:"Row properties",onclick:w("mceTableRowProps"),onPostRender:y},{text:"-"},{text:"Cut row",onclick:w("mceTableCutRow"),onPostRender:y},{text:"Copy row",onclick:w("mceTableCopyRow"),onPostRender:y},{text:"Paste row before",onclick:w("mceTablePasteRowBefore"),onPostRender:y},{text:"Paste row after",onclick:w("mceTablePasteRowAfter"),onPostRender:y}]});A.addMenuItem("column",{text:"Column",context:"table",menu:[{text:"Insert column before",onclick:w("mceTableInsertColBefore"),onPostRender:y},{text:"Insert column after",onclick:w("mceTableInsertColAfter"),onPostRender:y},{text:"Delete column",onclick:w("mceTableDeleteCol"),onPostRender:y}]});var s=[];m("inserttable tableprops deletetable | cell row column".split(" "),function(E){if(E=="|"){s.push({text:"-"})}else{s.push(A.menuItems[E])}});A.addButton("table",{type:"menubutton",title:"Table",menu:s});if(!k.isIE){A.on("click",function(E){E=E.target;if(E.nodeName==="TABLE"){A.selection.select(E);A.nodeChanged()}})}D.quirks=new p(A);A.on("Init",function(){D.cellSelection=new r(A)});A.on("PreInit",function(){A.serializer.addAttributeFilter("data-mce-cell-padding,data-mce-border,data-mce-border-color",function(E,F){var G=E.length;while(G--){E[G].attr(F,null)}})});m({mceTableSplitCells:function(E){E.split()},mceTableMergeCells:function(F){var E;E=A.dom.getParent(A.selection.getStart(),"th,td");if(!A.dom.select("td.mce-item-selected,th.mce-item-selected").length){u.merge(F,E)}else{F.merge()}},mceTableInsertRowBefore:function(E){E.insertRow(true)},mceTableInsertRowAfter:function(E){E.insertRow()},mceTableInsertColBefore:function(E){E.insertCol(true)},mceTableInsertColAfter:function(E){E.insertCol()},mceTableDeleteCol:function(E){E.deleteCols()},mceTableDeleteRow:function(E){E.deleteRows()},mceTableCutRow:function(E){B=E.cutRows()},mceTableCopyRow:function(E){B=E.copyRows()},mceTablePasteRowBefore:function(E){E.pasteRows(B,true)},mceTablePasteRowAfter:function(E){E.pasteRows(B)},mceTableDelete:function(E){E.deleteTable()}},function(F,E){A.addCommand(E,function(){var G=new q(A);if(G){F(G);A.execCommand("mceRepaint");D.cellSelection.clear()}})});m({mceInsertTable:u.table,mceTableProps:function(){u.table(true)},mceTableRowProps:u.row,mceTableCellProps:u.cell},function(F,E){A.addCommand(E,function(G,H){F(H)})});if(A.settings.table_tab_navigation!==false){A.on("keydown",function(G){var F,E,H;if(G.keyCode==9){F=A.dom.getParent(A.selection.getStart(),"th,td");if(F){G.preventDefault();E=new q(A);H=G.shiftKey?-1:1;A.undoManager.transact(function(){if(!E.moveRelIdx(F,H)&&H>0){E.insertRow();E.refresh();E.moveRelIdx(F,H)}})}}})}D.insertTable=x}j.add("table",l)})})(this);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/template/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,262 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('template', function(editor) {
+	var each = tinymce.each;
+
+	function createTemplateList(callback) {
+		return function() {
+			var templateList = editor.settings.templates;
+
+			if (typeof templateList == "string") {
+				tinymce.util.XHR.send({
+					url: templateList,
+					success: function(text) {
+						callback(tinymce.util.JSON.parse(text));
+					}
+				});
+			} else {
+				callback(templateList);
+			}
+		};
+	}
+
+	function showDialog(templateList) {
+		var win, values = [], templateHtml;
+
+		if (!templateList || templateList.length === 0) {
+			editor.windowManager.alert('No templates defined');
+			return;
+		}
+
+		tinymce.each(templateList, function(template) {
+			values.push({
+				selected: !values.length,
+				text: template.title,
+				value: {
+					url: template.url,
+					content: template.content,
+					description: template.description
+				}
+			});
+		});
+
+		function onSelectTemplate(e) {
+			var value = e.control.value();
+
+			function insertIframeHtml(html) {
+				if (html.indexOf('<html>') == -1) {
+					var contentCssLinks = '';
+
+					tinymce.each(editor.contentCSS, function(url) {
+						contentCssLinks += '<link type="text/css" rel="stylesheet" href="' + editor.documentBaseURI.toAbsolute(url) + '">';
+					});
+
+					html = (
+						'<!DOCTYPE html>' +
+						'<html>' +
+							'<head>' +
+								contentCssLinks +
+							'</head>' +
+							'<body>' +
+								html +
+							'</body>' +
+						'</html>'
+					);
+				}
+
+				html = replaceTemplateValues(html, 'template_preview_replace_values');
+
+				var doc = win.find('iframe')[0].getEl().contentWindow.document;
+				doc.open();
+				doc.write(html);
+				doc.close();
+			}
+
+			if (value.url) {
+				tinymce.util.XHR.send({
+					url: value.url,
+					success: function(html) {
+						templateHtml = html;
+						insertIframeHtml(templateHtml);
+					}
+				});
+			} else {
+				templateHtml = value.content;
+				insertIframeHtml(templateHtml);
+			}
+
+			win.find('#description')[0].text(e.control.value().description);
+		}
+
+		win = editor.windowManager.open({
+			title: 'Insert template',
+			layout: 'flex',
+			direction: 'column',
+			align: 'stretch',
+			padding: 15,
+			spacing: 10,
+
+			items: [
+				{type: 'form', flex: 0, padding: 0, items: [
+					{type: 'container', label: 'Templates', items: {
+						type: 'listbox', label: 'Templates', name: 'template', values: values, onselect: onSelectTemplate
+					}}
+				]},
+				{type: 'label', name: 'description', label: 'Description', text: '\u00a0'},
+				{type: 'iframe', flex: 1, border: 1}
+			],
+
+			onsubmit: function() {
+				insertTemplate(false, templateHtml);
+			},
+
+			width: editor.getParam('template_popup_width', 600),
+			height: editor.getParam('template_popup_height', 500)
+		});
+
+		win.find('listbox')[0].fire('select');
+	}
+
+	function getDateTime(fmt, date) {
+		var daysShort = "Sun Mon Tue Wed Thu Fri Sat Sun".split(' ');
+		var daysLong = "Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(' ');
+		var monthsShort = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(' ');
+		var monthsLong = "January February March April May June July August September October November December".split(' ');
+
+		function addZeros(value, len) {
+			value = "" + value;
+
+			if (value.length < len) {
+				for (var i = 0; i < (len - value.length); i++) {
+					value = "0" + value;
+				}
+			}
+
+			return value;
+		}
+
+		date = date || new Date();
+
+		fmt = fmt.replace("%D", "%m/%d/%Y");
+		fmt = fmt.replace("%r", "%I:%M:%S %p");
+		fmt = fmt.replace("%Y", "" + date.getFullYear());
+		fmt = fmt.replace("%y", "" + date.getYear());
+		fmt = fmt.replace("%m", addZeros(date.getMonth() + 1, 2));
+		fmt = fmt.replace("%d", addZeros(date.getDate(), 2));
+		fmt = fmt.replace("%H", "" + addZeros(date.getHours(), 2));
+		fmt = fmt.replace("%M", "" + addZeros(date.getMinutes(), 2));
+		fmt = fmt.replace("%S", "" + addZeros(date.getSeconds(), 2));
+		fmt = fmt.replace("%I", "" + ((date.getHours() + 11) % 12 + 1));
+		fmt = fmt.replace("%p", "" + (date.getHours() < 12 ? "AM" : "PM"));
+		fmt = fmt.replace("%B", "" + editor.translate(monthsLong[date.getMonth()]));
+		fmt = fmt.replace("%b", "" + editor.translate(monthsShort[date.getMonth()]));
+		fmt = fmt.replace("%A", "" + editor.translate(daysLong[date.getDay()]));
+		fmt = fmt.replace("%a", "" + editor.translate(daysShort[date.getDay()]));
+		fmt = fmt.replace("%%", "%");
+
+		return fmt;
+	}
+
+	function replaceVals(e) {
+		var dom = editor.dom, vl = editor.getParam('template_replace_values');
+
+		each(dom.select('*', e), function(e) {
+			each(vl, function(v, k) {
+				if (dom.hasClass(e, k)) {
+					if (typeof vl[k] == 'function') {
+						vl[k](e);
+					}
+				}
+			});
+		});
+	}
+
+	function replaceTemplateValues(html, templateValuesOptionName) {
+		each(editor.getParam(templateValuesOptionName), function(v, k) {
+			if (typeof v != 'function') {
+				html = html.replace(new RegExp('\\{\\$' + k + '\\}', 'g'), v);
+			}
+		});
+
+		return html;
+	}
+
+	function insertTemplate(ui, html) {
+		var el, n, dom = editor.dom, sel = editor.selection.getContent();
+
+		html = replaceTemplateValues(html, 'template_replace_values');
+		el = dom.create('div', null, html);
+
+		// Find template element within div
+		n = dom.select('.mceTmpl', el);
+		if (n && n.length > 0) {
+			el = dom.create('div', null);
+			el.appendChild(n[0].cloneNode(true));
+		}
+
+		function hasClass(n, c) {
+			return new RegExp('\\b' + c + '\\b', 'g').test(n.className);
+		}
+
+		each(dom.select('*', el), function(n) {
+			// Replace cdate
+			if (hasClass(n, editor.getParam('template_cdate_classes', 'cdate').replace(/\s+/g, '|'))) {
+				n.innerHTML = getDateTime(editor.getParam("template_cdate_format", editor.getLang("template.cdate_format")));
+			}
+
+			// Replace mdate
+			if (hasClass(n, editor.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) {
+				n.innerHTML = getDateTime(editor.getParam("template_mdate_format", editor.getLang("template.mdate_format")));
+			}
+
+			// Replace selection
+			if (hasClass(n, editor.getParam('template_selected_content_classes', 'selcontent').replace(/\s+/g, '|'))) {
+				n.innerHTML = sel;
+			}
+		});
+
+		replaceVals(el);
+
+		editor.execCommand('mceInsertContent', false, el.innerHTML);
+		editor.addVisual();
+	}
+
+	editor.addCommand('mceInsertTemplate', insertTemplate);
+
+	editor.addButton('template', {
+		title: 'Insert template',
+		onclick: createTemplateList(showDialog)
+	});
+
+	editor.addMenuItem('template', {
+		text: 'Insert template',
+		onclick: createTemplateList(showDialog),
+		context: 'insert'
+	});
+
+	editor.on('PreProcess', function(o) {
+		var dom = editor.dom;
+
+		each(dom.select('div', o.node), function(e) {
+			if (dom.hasClass(e, 'mceTmpl')) {
+				each(dom.select('*', e), function(e) {
+					if (dom.hasClass(e, editor.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) {
+						e.innerHTML = getDateTime(editor.getParam("template_mdate_format", editor.getLang("template.mdate_format")));
+					}
+				});
+
+				replaceVals(e);
+			}
+		});
+	});
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/template/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("template",function(e){var g=tinymce.each;function f(i){return function(){var j=e.settings.templates;if(typeof j=="string"){tinymce.util.XHR.send({url:j,success:function(k){i(tinymce.util.JSON.parse(k))}})}else{i(j)}}}function a(l){var m,k=[],j;if(!l||l.length===0){e.windowManager.alert("No templates defined");return}tinymce.each(l,function(n){k.push({selected:!k.length,text:n.title,value:{url:n.url,content:n.content,description:n.description}})});function i(p){var o=p.control.value();function n(q){if(q.indexOf("<html>")==-1){var s="";tinymce.each(e.contentCSS,function(t){s+='<link type="text/css" rel="stylesheet" href="'+e.documentBaseURI.toAbsolute(t)+'">'});q=("<!DOCTYPE html><html><head>"+s+"</head><body>"+q+"</body></html>")}q=d(q,"template_preview_replace_values");var r=m.find("iframe")[0].getEl().contentWindow.document;r.open();r.write(q);r.close()}if(o.url){tinymce.util.XHR.send({url:o.url,success:function(q){j=q;n(j)}})}else{j=o.content;n(j)}m.find("#description")[0].text(p.control.value().description)}m=e.windowManager.open({title:"Insert template",layout:"flex",direction:"column",align:"stretch",padding:15,spacing:10,items:[{type:"form",flex:0,padding:0,items:[{type:"container",label:"Templates",items:{type:"listbox",label:"Templates",name:"template",values:k,onselect:i}}]},{type:"label",name:"description",label:"Description",text:"\u00a0"},{type:"iframe",flex:1,border:1}],onsubmit:function(){c(false,j)},width:e.getParam("template_popup_width",600),height:e.getParam("template_popup_height",500)});m.find("listbox")[0].fire("select")}function b(j,m){var i="Sun Mon Tue Wed Thu Fri Sat Sun".split(" ");var o="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" ");var n="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" ");var l="January February March April May June July August September October November December".split(" ");function k(r,p){r=""+r;if(r.length<p){for(var q=0;q<(p-r.length);q++){r="0"+r}}return r}m=m||new Date();j=j.replace("%D","%m/%d/%Y");j=j.replace("%r","%I:%M:%S %p");j=j.replace("%Y",""+m.getFullYear());j=j.replace("%y",""+m.getYear());j=j.replace("%m",k(m.getMonth()+1,2));j=j.replace("%d",k(m.getDate(),2));j=j.replace("%H",""+k(m.getHours(),2));j=j.replace("%M",""+k(m.getMinutes(),2));j=j.replace("%S",""+k(m.getSeconds(),2));j=j.replace("%I",""+((m.getHours()+11)%12+1));j=j.replace("%p",""+(m.getHours()<12?"AM":"PM"));j=j.replace("%B",""+e.translate(l[m.getMonth()]));j=j.replace("%b",""+e.translate(n[m.getMonth()]));j=j.replace("%A",""+e.translate(o[m.getDay()]));j=j.replace("%a",""+e.translate(i[m.getDay()]));j=j.replace("%%","%");return j}function h(j){var k=e.dom,i=e.getParam("template_replace_values");g(k.select("*",j),function(l){g(i,function(n,m){if(k.hasClass(l,m)){if(typeof i[m]=="function"){i[m](l)}}})})}function d(i,j){g(e.getParam(j),function(m,l){if(typeof m!="function"){i=i.replace(new RegExp("\\{\\$"+l+"\\}","g"),m)}});return i}function c(m,j){var k,p,o=e.dom,l=e.selection.getContent();j=d(j,"template_replace_values");k=o.create("div",null,j);p=o.select(".mceTmpl",k);if(p&&p.length>0){k=o.create("div",null);k.appendChild(p[0].cloneNode(true))}function i(r,q){return new RegExp("\\b"+q+"\\b","g").test(r.className)}g(o.select("*",k),function(q){if(i(q,e.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))){q.innerHTML=b(e.getParam("template_cdate_format",e.getLang("template.cdate_format")))}if(i(q,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){q.innerHTML=b(e.getParam("template_mdate_format",e.getLang("template.mdate_format")))}if(i(q,e.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))){q.innerHTML=l}});h(k);e.execCommand("mceInsertContent",false,k.innerHTML);e.addVisual()}e.addCommand("mceInsertTemplate",c);e.addButton("template",{title:"Insert template",onclick:f(a)});e.addMenuItem("template",{text:"Insert template",onclick:f(a),context:"insert"});e.on("PreProcess",function(j){var i=e.dom;g(i.select("div",j.node),function(k){if(i.hasClass(k,"mceTmpl")){g(i.select("*",k),function(l){if(i.hasClass(l,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){l.innerHTML=b(e.getParam("template_mdate_format",e.getLang("template.mdate_format")))}});h(k)}})})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/textcolor/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,282 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+/*eslint consistent-this:0 */
+
+tinymce.PluginManager.add('textcolor', function(editor) {
+	var cols, rows;
+
+	rows = editor.settings.textcolor_rows || 5;
+	cols = editor.settings.textcolor_cols || 8;
+
+	function getCurrentColor(format) {
+		var color;
+
+		editor.dom.getParents(editor.selection.getStart(), function(elm) {
+			var value;
+
+			if ((value = elm.style[format == 'forecolor' ? 'color' : 'background-color'])) {
+				color = value;
+			}
+		});
+
+		return color;
+	}
+
+	function mapColors() {
+		var i, colors = [], colorMap;
+
+		colorMap = editor.settings.textcolor_map || [
+			"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", "Red violet",
+			"FFFFFF", "White",
+			"FF99CC", "Pink",
+			"FFCC99", "Peach",
+			"FFFF99", "Light yellow",
+			"CCFFCC", "Pale green",
+			"CCFFFF", "Pale cyan",
+			"99CCFF", "Light sky blue",
+			"CC99FF", "Plum"
+		];
+
+		for (i = 0; i < colorMap.length; i += 2) {
+			colors.push({
+				text: colorMap[i + 1],
+				color: '#' + colorMap[i]
+			});
+		}
+
+		return colors;
+	}
+
+	function renderColorPicker() {
+		var ctrl = this, colors, color, html, last, x, y, i, id = ctrl._id, count = 0;
+
+		function getColorCellHtml(color, title) {
+			var isNoColor = color == 'transparent';
+
+			return (
+				'<td class="mce-grid-cell' + (isNoColor ? ' mce-colorbtn-trans' : '') + '">' +
+					'<div id="' + id + '-' + (count++) + '"' +
+						' data-mce-color="' + (color ? color : '') + '"' +
+						' role="option"' +
+						' tabIndex="-1"' +
+						' style="' + (color ? 'background-color: ' + color : '') + '"' +
+						' title="' + tinymce.translate(title) + '">' +
+						(isNoColor ? '&#215;' : '') +
+					'</div>' +
+				'</td>'
+			);
+		}
+
+		colors = mapColors();
+		colors.push({
+			text: tinymce.translate("No color"),
+			color: "transparent"
+		});
+
+		html = '<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="list" cellspacing="0"><tbody>';
+		last = colors.length - 1;
+
+		for (y = 0; y < rows; y++) {
+			html += '<tr>';
+
+			for (x = 0; x < cols; x++) {
+				i = y * cols + x;
+
+				if (i > last) {
+					html += '<td></td>';
+				} else {
+					color = colors[i];
+					html += getColorCellHtml(color.color, color.text);
+				}
+			}
+
+			html += '</tr>';
+		}
+
+		if (editor.settings.color_picker_callback) {
+			html += (
+				'<tr>' +
+					'<td colspan="' + cols + '" class="mce-custom-color-btn">' +
+						'<div id="' + id + '-c" class="mce-widget mce-btn mce-btn-small mce-btn-flat" ' +
+							'role="button" tabindex="-1" aria-labelledby="' + id + '-c" style="width: 100%">' +
+							'<button type="button" role="presentation" tabindex="-1">' + tinymce.translate('Custom...') + '</button>' +
+						'</div>' +
+					'</td>' +
+				'</tr>'
+			);
+
+			html += '<tr>';
+
+			for (x = 0; x < cols; x++) {
+				html += getColorCellHtml('', 'Custom color');
+			}
+
+			html += '</tr>';
+		}
+
+		html += '</tbody></table>';
+
+		return html;
+	}
+
+	function applyFormat(format, value) {
+		editor.undoManager.transact(function() {
+			editor.focus();
+			editor.formatter.apply(format, {value: value});
+			editor.nodeChanged();
+		});
+	}
+
+	function removeFormat(format) {
+		editor.undoManager.transact(function() {
+			editor.focus();
+			editor.formatter.remove(format, {value: null}, null, true);
+			editor.nodeChanged();
+		});
+	}
+
+	function onPanelClick(e) {
+		var buttonCtrl = this.parent(), value;
+
+		function selectColor(value) {
+			buttonCtrl.hidePanel();
+			buttonCtrl.color(value);
+			applyFormat(buttonCtrl.settings.format, value);
+		}
+
+		function resetColor() {
+			buttonCtrl.hidePanel();
+			buttonCtrl.resetColor();
+			removeFormat(buttonCtrl.settings.format);
+		}
+
+		function setDivColor(div, value) {
+			div.style.background = value;
+			div.setAttribute('data-mce-color', value);
+		}
+
+		if (tinymce.DOM.getParent(e.target, '.mce-custom-color-btn')) {
+			buttonCtrl.hidePanel();
+
+			editor.settings.color_picker_callback.call(editor, function(value) {
+				var tableElm = buttonCtrl.panel.getEl().getElementsByTagName('table')[0];
+				var customColorCells, div, i;
+
+				customColorCells = tinymce.map(tableElm.rows[tableElm.rows.length - 1].childNodes, function(elm) {
+					return elm.firstChild;
+				});
+
+				for (i = 0; i < customColorCells.length; i++) {
+					div = customColorCells[i];
+					if (!div.getAttribute('data-mce-color')) {
+						break;
+					}
+				}
+
+				// Shift colors to the right
+				// TODO: Might need to be the left on RTL
+				if (i == cols) {
+					for (i = 0; i < cols - 1; i++) {
+						setDivColor(customColorCells[i], customColorCells[i + 1].getAttribute('data-mce-color'));
+					}
+				}
+
+				setDivColor(div, value);
+				selectColor(value);
+			}, getCurrentColor(buttonCtrl.settings.format));
+		}
+
+		value = e.target.getAttribute('data-mce-color');
+		if (value) {
+			if (this.lastId) {
+				document.getElementById(this.lastId).setAttribute('aria-selected', false);
+			}
+
+			e.target.setAttribute('aria-selected', true);
+			this.lastId = e.target.id;
+
+			if (value == 'transparent') {
+				resetColor();
+			} else {
+				selectColor(value);
+			}
+		} else if (value !== null) {
+			buttonCtrl.hidePanel();
+		}
+	}
+
+	function onButtonClick() {
+		var self = this;
+
+		if (self._color) {
+			applyFormat(self.settings.format, self._color);
+		} else {
+			removeFormat(self.settings.format);
+		}
+	}
+
+	editor.addButton('forecolor', {
+		type: 'colorbutton',
+		tooltip: 'Text color',
+		format: 'forecolor',
+		panel: {
+			role: 'application',
+			ariaRemember: true,
+			html: renderColorPicker,
+			onclick: onPanelClick
+		},
+		onclick: onButtonClick
+	});
+
+	editor.addButton('backcolor', {
+		type: 'colorbutton',
+		tooltip: 'Background color',
+		format: 'hilitecolor',
+		panel: {
+			role: 'application',
+			ariaRemember: true,
+			html: renderColorPicker,
+			onclick: onPanelClick
+		},
+		onclick: onButtonClick
+	});
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/textcolor/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("textcolor",function(f){var g,j;j=f.settings.textcolor_rows||5;g=f.settings.textcolor_cols||8;function a(l){var k;f.dom.getParents(f.selection.getStart(),function(n){var m;if((m=n.style[l=="forecolor"?"color":"background-color"])){k=m}});return k}function h(){var m,k=[],l;l=f.settings.textcolor_map||["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","Red violet","FFFFFF","White","FF99CC","Pink","FFCC99","Peach","FFFF99","Light yellow","CCFFCC","Pale green","CCFFFF","Pale cyan","99CCFF","Light sky blue","CC99FF","Plum"];for(m=0;m<l.length;m+=2){k.push({text:l[m+1],color:"#"+l[m]})}return k}function b(){var k=this,l,n,p,u,t,s,o,m=k._id,q=0;function r(v,x){var w=v=="transparent";return('<td class="mce-grid-cell'+(w?" mce-colorbtn-trans":"")+'"><div id="'+m+"-"+(q++)+'" data-mce-color="'+(v?v:"")+'" role="option" tabIndex="-1" style="'+(v?"background-color: "+v:"")+'" title="'+tinymce.translate(x)+'">'+(w?"&#215;":"")+"</div></td>")}l=h();l.push({text:tinymce.translate("No color"),color:"transparent"});p='<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="list" cellspacing="0"><tbody>';u=l.length-1;for(s=0;s<j;s++){p+="<tr>";for(t=0;t<g;t++){o=s*g+t;if(o>u){p+="<td></td>"}else{n=l[o];p+=r(n.color,n.text)}}p+="</tr>"}if(f.settings.color_picker_callback){p+=('<tr><td colspan="'+g+'" class="mce-custom-color-btn"><div id="'+m+'-c" class="mce-widget mce-btn mce-btn-small mce-btn-flat" role="button" tabindex="-1" aria-labelledby="'+m+'-c" style="width: 100%"><button type="button" role="presentation" tabindex="-1">'+tinymce.translate("Custom...")+"</button></div></td></tr>");p+="<tr>";for(t=0;t<g;t++){p+=r("","Custom color")}p+="</tr>"}p+="</tbody></table>";return p}function c(l,k){f.undoManager.transact(function(){f.focus();f.formatter.apply(l,{value:k});f.nodeChanged()})}function i(k){f.undoManager.transact(function(){f.focus();f.formatter.remove(k,{value:null},null,true);f.nodeChanged()})}function d(p){var m=this.parent(),o;function l(q){m.hidePanel();m.color(q);c(m.settings.format,q)}function n(){m.hidePanel();m.resetColor();i(m.settings.format)}function k(r,q){r.style.background=q;r.setAttribute("data-mce-color",q)}if(tinymce.DOM.getParent(p.target,".mce-custom-color-btn")){m.hidePanel();f.settings.color_picker_callback.call(f,function(t){var q=m.panel.getEl().getElementsByTagName("table")[0];var s,u,r;s=tinymce.map(q.rows[q.rows.length-1].childNodes,function(v){return v.firstChild});for(r=0;r<s.length;r++){u=s[r];if(!u.getAttribute("data-mce-color")){break}}if(r==g){for(r=0;r<g-1;r++){k(s[r],s[r+1].getAttribute("data-mce-color"))}}k(u,t);l(t)},a(m.settings.format))}o=p.target.getAttribute("data-mce-color");if(o){if(this.lastId){document.getElementById(this.lastId).setAttribute("aria-selected",false)}p.target.setAttribute("aria-selected",true);this.lastId=p.target.id;if(o=="transparent"){n()}else{l(o)}}else{if(o!==null){m.hidePanel()}}}function e(){var k=this;if(k._color){c(k.settings.format,k._color)}else{i(k.settings.format)}}f.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",format:"forecolor",panel:{role:"application",ariaRemember:true,html:b,onclick:d},onclick:e});f.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",format:"hilitecolor",panel:{role:"application",ariaRemember:true,html:b,onclick:d},onclick:e})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/textpattern/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,268 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('textpattern', function(editor) {
+	var isPatternsDirty = true, patterns;
+
+	patterns = editor.settings.textpattern_patterns || [
+		{start: '*', end: '*', format: 'italic'},
+		{start: '**', end: '**', format: 'bold'},
+		{start: '#', format: 'h1'},
+		{start: '##', format: 'h2'},
+		{start: '###', format: 'h3'},
+		{start: '####', format: 'h4'},
+		{start: '#####', format: 'h5'},
+		{start: '######', format: 'h6'},
+		{start: '1. ', cmd: 'InsertOrderedList'},
+		{start: '* ', cmd: 'InsertUnorderedList'},
+		{start: '- ', cmd: 'InsertUnorderedList'}
+	];
+
+	// Returns a sorted patterns list, ordered descending by start length
+	function getPatterns() {
+		if (isPatternsDirty) {
+			patterns.sort(function(a, b) {
+				if (a.start.length > b.start.length) {
+					return -1;
+				}
+
+				if (a.start.length < b.start.length) {
+					return 1;
+				}
+
+				return 0;
+			});
+
+			isPatternsDirty = false;
+		}
+
+		return patterns;
+	}
+
+	// Finds a matching pattern to the specified text
+	function findPattern(text) {
+		var patterns = getPatterns();
+
+		for (var i = 0; i < patterns.length; i++) {
+			if (text.indexOf(patterns[i].start) !== 0) {
+				continue;
+			}
+
+			if (patterns[i].end && text.lastIndexOf(patterns[i].end) != text.length - patterns[i].end.length) {
+				continue;
+			}
+
+			return patterns[i];
+		}
+	}
+
+	// Finds the best matching end pattern
+	function findEndPattern(text, offset, delta) {
+		var patterns, pattern, i;
+
+		// Find best matching end
+		patterns = getPatterns();
+		for (i = 0; i < patterns.length; i++) {
+			pattern = patterns[i];
+			if (pattern.end && text.substr(offset - pattern.end.length - delta, pattern.end.length) == pattern.end) {
+				return pattern;
+			}
+		}
+	}
+
+	// Handles inline formats like *abc* and **abc**
+	function applyInlineFormat(space) {
+		var selection, dom, rng, container, offset, startOffset, text, patternRng, pattern, delta, format;
+
+		function splitContainer() {
+			// Split text node and remove start/end from text node
+			container = container.splitText(startOffset);
+			container.splitText(offset - startOffset - delta);
+			container.deleteData(0, pattern.start.length);
+			container.deleteData(container.data.length - pattern.end.length, pattern.end.length);
+		}
+
+		selection = editor.selection;
+		dom = editor.dom;
+
+		if (!selection.isCollapsed()) {
+			return;
+		}
+
+		rng = selection.getRng(true);
+		container = rng.startContainer;
+		offset = rng.startOffset;
+		text = container.data;
+		delta = space ? 1 : 0;
+
+		if (container.nodeType != 3) {
+			return;
+		}
+
+		// Find best matching end
+		pattern = findEndPattern(text, offset, delta);
+		if (!pattern) {
+			return;
+		}
+
+		// Find start of matched pattern
+		// TODO: Might need to improve this if there is nested formats
+		startOffset = Math.max(0, offset - delta);
+		startOffset = text.lastIndexOf(pattern.start, startOffset - pattern.end.length - 1);
+
+		if (startOffset === -1) {
+			return;
+		}
+
+		// Setup a range for the matching word
+		patternRng = dom.createRng();
+		patternRng.setStart(container, startOffset);
+		patternRng.setEnd(container, offset - delta);
+		pattern = findPattern(patternRng.toString());
+
+		if (!pattern || !pattern.end) {
+			return;
+		}
+
+		// If container match doesn't have anything between start/end then do nothing
+		if (container.data.length <= pattern.start.length + pattern.end.length) {
+			return;
+		}
+
+		format = editor.formatter.get(pattern.format);
+		if (format && format[0].inline) {
+			splitContainer();
+			editor.formatter.apply(pattern.format, {}, container);
+			return container;
+		}
+	}
+
+	// Handles block formats like ##abc or 1. abc
+	function applyBlockFormat() {
+		var selection, dom, container, firstTextNode, node, format, textBlockElm, pattern, walker, rng, offset;
+
+		selection = editor.selection;
+		dom = editor.dom;
+
+		if (!selection.isCollapsed()) {
+			return;
+		}
+
+		textBlockElm = dom.getParent(selection.getStart(), 'p');
+		if (textBlockElm) {
+			walker = new tinymce.dom.TreeWalker(textBlockElm, textBlockElm);
+			while ((node = walker.next())) {
+				if (node.nodeType == 3) {
+					firstTextNode = node;
+					break;
+				}
+			}
+
+			if (firstTextNode) {
+				pattern = findPattern(firstTextNode.data);
+				if (!pattern) {
+					return;
+				}
+
+				rng = selection.getRng(true);
+				container = rng.startContainer;
+				offset = rng.startOffset;
+
+				if (firstTextNode == container) {
+					offset = Math.max(0, offset - pattern.start.length);
+				}
+
+				if (tinymce.trim(firstTextNode.data).length == pattern.start.length) {
+					return;
+				}
+
+				if (pattern.format) {
+					format = editor.formatter.get(pattern.format);
+					if (format && format[0].block) {
+						firstTextNode.deleteData(0, pattern.start.length);
+						editor.formatter.apply(pattern.format, {}, firstTextNode);
+
+						rng.setStart(container, offset);
+						rng.collapse(true);
+						selection.setRng(rng);
+					}
+				}
+
+				if (pattern.cmd) {
+					editor.undoManager.transact(function() {
+						firstTextNode.deleteData(0, pattern.start.length);
+						editor.execCommand(pattern.cmd);
+					});
+				}
+			}
+		}
+	}
+
+	function handleEnter() {
+		var rng, wrappedTextNode;
+
+		wrappedTextNode = applyInlineFormat();
+		if (wrappedTextNode) {
+			rng = editor.dom.createRng();
+			rng.setStart(wrappedTextNode, wrappedTextNode.data.length);
+			rng.setEnd(wrappedTextNode, wrappedTextNode.data.length);
+			editor.selection.setRng(rng);
+		}
+
+		applyBlockFormat();
+	}
+
+	function handleSpace() {
+		var wrappedTextNode, lastChar, lastCharNode, rng, dom;
+
+		wrappedTextNode = applyInlineFormat(true);
+		if (wrappedTextNode) {
+			dom = editor.dom;
+			lastChar = wrappedTextNode.data.slice(-1);
+
+			// Move space after the newly formatted node
+			if (/[\u00a0 ]/.test(lastChar)) {
+				wrappedTextNode.deleteData(wrappedTextNode.data.length - 1, 1);
+				lastCharNode = dom.doc.createTextNode(lastChar);
+
+				if (wrappedTextNode.nextSibling) {
+					dom.insertAfter(lastCharNode, wrappedTextNode.nextSibling);
+				} else {
+					wrappedTextNode.parentNode.appendChild(lastCharNode);
+				}
+
+				rng = dom.createRng();
+				rng.setStart(lastCharNode, 1);
+				rng.setEnd(lastCharNode, 1);
+				editor.selection.setRng(rng);
+			}
+		}
+	}
+
+	editor.on('keydown', function(e) {
+		if (e.keyCode == 13 && !tinymce.util.VK.modifierPressed(e)) {
+			handleEnter();
+		}
+	}, true);
+
+	editor.on('keyup', function(e) {
+		if (e.keyCode == 32 && !tinymce.util.VK.modifierPressed(e)) {
+			handleSpace();
+		}
+	});
+
+	this.getPatterns = getPatterns;
+	this.setPatterns = function(newPatterns) {
+		patterns = newPatterns;
+		isPatternsDirty = true;
+	};
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/textpattern/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("textpattern",function(f){var a=true,b;b=f.settings.textpattern_patterns||[{start:"*",end:"*",format:"italic"},{start:"**",end:"**",format:"bold"},{start:"#",format:"h1"},{start:"##",format:"h2"},{start:"###",format:"h3"},{start:"####",format:"h4"},{start:"#####",format:"h5"},{start:"######",format:"h6"},{start:"1. ",cmd:"InsertOrderedList"},{start:"* ",cmd:"InsertUnorderedList"},{start:"- ",cmd:"InsertUnorderedList"}];function j(){if(a){b.sort(function(l,k){if(l.start.length>k.start.length){return -1}if(l.start.length<k.start.length){return 1}return 0});a=false}return b}function d(m){var l=j();for(var k=0;k<l.length;k++){if(m.indexOf(l[k].start)!==0){continue}if(l[k].end&&m.lastIndexOf(l[k].end)!=m.length-l[k].end.length){continue}return l[k]}}function h(o,n,p){var l,m,k;l=j();for(k=0;k<l.length;k++){m=l[k];if(m.end&&o.substr(n-m.end.length-p,m.end.length)==m.end){return m}}}function e(k){var u,n,l,m,o,s,w,p,r,v,t;function q(){m=m.splitText(s);m.splitText(o-s-v);m.deleteData(0,r.start.length);m.deleteData(m.data.length-r.end.length,r.end.length)}u=f.selection;n=f.dom;if(!u.isCollapsed()){return}l=u.getRng(true);m=l.startContainer;o=l.startOffset;w=m.data;v=k?1:0;if(m.nodeType!=3){return}r=h(w,o,v);if(!r){return}s=Math.max(0,o-v);s=w.lastIndexOf(r.start,s-r.end.length-1);if(s===-1){return}p=n.createRng();p.setStart(m,s);p.setEnd(m,o-v);r=d(p.toString());if(!r||!r.end){return}if(m.data.length<=r.start.length+r.end.length){return}t=f.formatter.get(r.format);if(t&&t[0].inline){q();f.formatter.apply(r.format,{},m);return m}}function i(){var u,p,m,s,n,t,r,q,l,k,o;u=f.selection;p=f.dom;if(!u.isCollapsed()){return}r=p.getParent(u.getStart(),"p");if(r){l=new tinymce.dom.TreeWalker(r,r);while((n=l.next())){if(n.nodeType==3){s=n;break}}if(s){q=d(s.data);if(!q){return}k=u.getRng(true);m=k.startContainer;o=k.startOffset;if(s==m){o=Math.max(0,o-q.start.length)}if(tinymce.trim(s.data).length==q.start.length){return}if(q.format){t=f.formatter.get(q.format);if(t&&t[0].block){s.deleteData(0,q.start.length);f.formatter.apply(q.format,{},s);k.setStart(m,o);k.collapse(true);u.setRng(k)}}if(q.cmd){f.undoManager.transact(function(){s.deleteData(0,q.start.length);f.execCommand(q.cmd)})}}}}function c(){var k,l;l=e();if(l){k=f.dom.createRng();k.setStart(l,l.data.length);k.setEnd(l,l.data.length);f.selection.setRng(k)}i()}function g(){var n,m,l,k,o;n=e(true);if(n){o=f.dom;m=n.data.slice(-1);if(/[\u00a0 ]/.test(m)){n.deleteData(n.data.length-1,1);l=o.doc.createTextNode(m);if(n.nextSibling){o.insertAfter(l,n.nextSibling)}else{n.parentNode.appendChild(l)}k=o.createRng();k.setStart(l,1);k.setEnd(l,1);f.selection.setRng(k)}}}f.on("keydown",function(k){if(k.keyCode==13&&!tinymce.util.VK.modifierPressed(k)){c()}},true);f.on("keyup",function(k){if(k.keyCode==32&&!tinymce.util.VK.modifierPressed(k)){g()}});this.getPatterns=j;this.setPatterns=function(k){b=k;a=true}});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/css/visualblocks.css	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,135 @@
+.mce-visualblocks p {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin-left: 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7);
+}
+
+.mce-visualblocks h1 {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin-left: 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==);
+}
+
+.mce-visualblocks h2 {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin-left: 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==);
+}
+
+.mce-visualblocks h3 {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin-left: 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7);
+}
+
+.mce-visualblocks h4 {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin-left: 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==);
+}
+
+.mce-visualblocks h5 {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin-left: 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==);
+}
+
+.mce-visualblocks h6 {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin-left: 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==);
+}
+
+.mce-visualblocks div {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin-left: 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7);
+}
+
+.mce-visualblocks section {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin: 0 0 1em 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=);
+}
+
+.mce-visualblocks article {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin: 0 0 1em 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7);
+}
+
+.mce-visualblocks blockquote {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7);
+}
+
+.mce-visualblocks address {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin: 0 0 1em 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=);
+}
+
+.mce-visualblocks pre {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin-left: 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==);
+}
+
+.mce-visualblocks figure {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin: 0 0 1em 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7);
+}
+
+.mce-visualblocks hgroup {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin: 0 0 1em 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7);
+}
+
+.mce-visualblocks aside {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin: 0 0 1em 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=);
+}
+
+.mce-visualblocks figcaption {
+	border: 1px dashed #BBB;
+}
+
+.mce-visualblocks ul {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin: 0 0 1em 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==)
+}
+
+.mce-visualblocks ol {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin: 0 0 1em 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==);
+}
+
+.mce-visualblocks dl {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin: 0 0 1em 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==);
+}
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/address.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/article.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/aside.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/blockquote.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/div.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/dl.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/figure.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/h1.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/h2.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/h3.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/h4.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/h5.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/h6.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/hgroup.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/ol.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/p.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/pre.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/section.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/img/ul.gif has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,86 @@
+/**
+ * plugin.js
+ *
+ * Copyright 2012, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('visualblocks', function(editor, url) {
+	var cssId, visualBlocksMenuItem, enabled;
+
+	// We don't support older browsers like IE6/7 and they don't provide prototypes for DOM objects
+	if (!window.NodeList) {
+		return;
+	}
+
+	function toggleActiveState() {
+		var self = this;
+
+		self.active(enabled);
+
+		editor.on('VisualBlocks', function() {
+			self.active(editor.dom.hasClass(editor.getBody(), 'mce-visualblocks'));
+		});
+	}
+
+	editor.addCommand('mceVisualBlocks', function() {
+		var dom = editor.dom, linkElm;
+
+		if (!cssId) {
+			cssId = dom.uniqueId();
+			linkElm = dom.create('link', {
+				id: cssId,
+				rel: 'stylesheet',
+				href: url + '/css/visualblocks.css'
+			});
+
+			editor.getDoc().getElementsByTagName('head')[0].appendChild(linkElm);
+		}
+
+		// Toggle on/off visual blocks while computing previews
+		editor.on("PreviewFormats AfterPreviewFormats", function(e) {
+			if (enabled) {
+				dom.toggleClass(editor.getBody(), 'mce-visualblocks', e.type == "afterpreviewformats");
+			}
+		});
+
+		dom.toggleClass(editor.getBody(), 'mce-visualblocks');
+		enabled = editor.dom.hasClass(editor.getBody(), 'mce-visualblocks');
+
+		if (visualBlocksMenuItem) {
+			visualBlocksMenuItem.active(dom.hasClass(editor.getBody(), 'mce-visualblocks'));
+		}
+
+		editor.fire('VisualBlocks');
+	});
+
+	editor.addButton('visualblocks', {
+		title: 'Show blocks',
+		cmd: 'mceVisualBlocks',
+		onPostRender: toggleActiveState
+	});
+
+	editor.addMenuItem('visualblocks', {
+		text: 'Show blocks',
+		cmd: 'mceVisualBlocks',
+		onPostRender: toggleActiveState,
+		selectable: true,
+		context: 'view',
+		prependToContext: true
+	});
+
+	editor.on('init', function() {
+		if (editor.settings.visualblocks_default_state) {
+			editor.execCommand('mceVisualBlocks', false, null, {skip_focus: true});
+		}
+	});
+
+	editor.on('remove', function() {
+		editor.dom.removeClass(editor.getBody(), 'mce-visualblocks');
+	});
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualblocks/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("visualblocks",function(d,c){var f,e,b;if(!window.NodeList){return}function a(){var g=this;g.active(b);d.on("VisualBlocks",function(){g.active(d.dom.hasClass(d.getBody(),"mce-visualblocks"))})}d.addCommand("mceVisualBlocks",function(){var h=d.dom,g;if(!f){f=h.uniqueId();g=h.create("link",{id:f,rel:"stylesheet",href:c+"/css/visualblocks.css"});d.getDoc().getElementsByTagName("head")[0].appendChild(g)}d.on("PreviewFormats AfterPreviewFormats",function(i){if(b){h.toggleClass(d.getBody(),"mce-visualblocks",i.type=="afterpreviewformats")}});h.toggleClass(d.getBody(),"mce-visualblocks");b=d.dom.hasClass(d.getBody(),"mce-visualblocks");if(e){e.active(h.hasClass(d.getBody(),"mce-visualblocks"))}d.fire("VisualBlocks")});d.addButton("visualblocks",{title:"Show blocks",cmd:"mceVisualBlocks",onPostRender:a});d.addMenuItem("visualblocks",{text:"Show blocks",cmd:"mceVisualBlocks",onPostRender:a,selectable:true,context:"view",prependToContext:true});d.on("init",function(){if(d.settings.visualblocks_default_state){d.execCommand("mceVisualBlocks",false,null,{skip_focus:true})}});d.on("remove",function(){d.dom.removeClass(d.getBody(),"mce-visualblocks")})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualchars/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,123 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('visualchars', function(editor) {
+	var self = this, state;
+
+	function toggleVisualChars(addBookmark) {
+		var node, nodeList, i, body = editor.getBody(), nodeValue, selection = editor.selection, div, bookmark;
+		var charMap, visualCharsRegExp;
+
+		charMap = {
+			'\u00a0': 'nbsp',
+			'\u00ad': 'shy'
+		};
+
+		function wrapCharWithSpan(value) {
+			return '<span data-mce-bogus="1" class="mce-' + charMap[value] + '">' + value + '</span>';
+		}
+
+		function compileCharMapToRegExp() {
+			var key, regExp = '';
+
+			for (key in charMap) {
+				regExp += key;
+			}
+
+			return new RegExp('[' + regExp + ']', 'g');
+		}
+
+		function compileCharMapToCssSelector() {
+			var key, selector = '';
+
+			for (key in charMap) {
+				if (selector) {
+					selector += ',';
+				}
+
+				selector += 'span.mce-' + charMap[key];
+			}
+
+			return selector;
+		}
+
+		state = !state;
+		self.state = state;
+		editor.fire('VisualChars', {state: state});
+		visualCharsRegExp = compileCharMapToRegExp();
+
+		if (addBookmark) {
+			bookmark = selection.getBookmark();
+		}
+
+		if (state) {
+			nodeList = [];
+			tinymce.walk(body, function(n) {
+				if (n.nodeType == 3 && n.nodeValue && visualCharsRegExp.test(n.nodeValue)) {
+					nodeList.push(n);
+				}
+			}, 'childNodes');
+
+			for (i = 0; i < nodeList.length; i++) {
+				nodeValue = nodeList[i].nodeValue;
+				nodeValue = nodeValue.replace(visualCharsRegExp, wrapCharWithSpan);
+
+				div = editor.dom.create('div', null, nodeValue);
+				while ((node = div.lastChild)) {
+					editor.dom.insertAfter(node, nodeList[i]);
+				}
+
+				editor.dom.remove(nodeList[i]);
+			}
+		} else {
+			nodeList = editor.dom.select(compileCharMapToCssSelector(), body);
+
+			for (i = nodeList.length - 1; i >= 0; i--) {
+				editor.dom.remove(nodeList[i], 1);
+			}
+		}
+
+		selection.moveToBookmark(bookmark);
+	}
+
+	function toggleActiveState() {
+		var self = this;
+
+		editor.on('VisualChars', function(e) {
+			self.active(e.state);
+		});
+	}
+
+	editor.addCommand('mceVisualChars', toggleVisualChars);
+
+	editor.addButton('visualchars', {
+		title: 'Show invisible characters',
+		cmd: 'mceVisualChars',
+		onPostRender: toggleActiveState
+	});
+
+	editor.addMenuItem('visualchars', {
+		text: 'Show invisible characters',
+		cmd: 'mceVisualChars',
+		onPostRender: toggleActiveState,
+		selectable: true,
+		context: 'view',
+		prependToContext: true
+	});
+
+	editor.on('beforegetcontent', function(e) {
+		if (state && e.format != 'raw' && !e.draft) {
+			state = true;
+			toggleVisualChars(false);
+		}
+	});
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/visualchars/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("visualchars",function(c){var a=this,e;function d(l){var g,j,k,n=c.getBody(),o,t=c.selection,f,q;var p,h;p={"\u00a0":"nbsp","\u00ad":"shy"};function r(i){return'<span data-mce-bogus="1" class="mce-'+p[i]+'">'+i+"</span>"}function s(){var u,i="";for(u in p){i+=u}return new RegExp("["+i+"]","g")}function m(){var u,i="";for(u in p){if(i){i+=","}i+="span.mce-"+p[u]}return i}e=!e;a.state=e;c.fire("VisualChars",{state:e});h=s();if(l){q=t.getBookmark()}if(e){j=[];tinymce.walk(n,function(i){if(i.nodeType==3&&i.nodeValue&&h.test(i.nodeValue)){j.push(i)}},"childNodes");for(k=0;k<j.length;k++){o=j[k].nodeValue;o=o.replace(h,r);f=c.dom.create("div",null,o);while((g=f.lastChild)){c.dom.insertAfter(g,j[k])}c.dom.remove(j[k])}}else{j=c.dom.select(m(),n);for(k=j.length-1;k>=0;k--){c.dom.remove(j[k],1)}}t.moveToBookmark(q)}function b(){var f=this;c.on("VisualChars",function(g){f.active(g.state)})}c.addCommand("mceVisualChars",d);c.addButton("visualchars",{title:"Show invisible characters",cmd:"mceVisualChars",onPostRender:b});c.addMenuItem("visualchars",{text:"Show invisible characters",cmd:"mceVisualChars",onPostRender:b,selectable:true,context:"view",prependToContext:true});c.on("beforegetcontent",function(f){if(e&&f.format!="raw"&&!f.draft){e=true;d(false)}})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/wordcount/plugin.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,69 @@
+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('wordcount', function(editor) {
+	var self = this, countre, cleanre;
+
+	// Included most unicode blocks see: http://en.wikipedia.org/wiki/Unicode_block
+	// Latin-1_Supplement letters, a-z, u2019 == &rsquo;
+	countre = editor.getParam('wordcount_countregex', /[\w\u2019\x27\-\u00C0-\u1FFF]+/g);
+	cleanre = editor.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$?\x27\x22_+=\\\/\-]*/g);
+
+	function update() {
+		editor.theme.panel.find('#wordcount').text(['Words: {0}', self.getCount()]);
+	}
+
+	editor.on('init', function() {
+		var statusbar = editor.theme.panel && editor.theme.panel.find('#statusbar')[0];
+
+		if (statusbar) {
+			window.setTimeout(function() {
+				statusbar.insert({
+					type: 'label',
+					name: 'wordcount',
+					text: ['Words: {0}', self.getCount()],
+					classes: 'wordcount',
+					disabled: editor.settings.readonly
+				}, 0);
+
+				editor.on('setcontent beforeaddundo', update);
+
+				editor.on('keyup', function(e) {
+					if (e.keyCode == 32) {
+						update();
+					}
+				});
+			}, 0);
+		}
+	});
+
+	self.getCount = function() {
+		var tx = editor.getContent({format: 'raw'});
+		var tc = 0;
+
+		if (tx) {
+			tx = tx.replace(/\.\.\./g, ' '); // convert ellipses to spaces
+			tx = tx.replace(/<.[^<>]*?>/g, ' ').replace(/&nbsp;|&#160;/gi, ' '); // remove html tags and space chars
+
+			// deal with html entities
+			tx = tx.replace(/(\w+)(&#?[a-z0-9]+;)+(\w+)/i, "$1$3").replace(/&.+?;/g, ' ');
+			tx = tx.replace(cleanre, ''); // remove numbers and punctuation
+
+			var wordArray = tx.match(countre);
+			if (wordArray) {
+				tc = wordArray.length;
+			}
+		}
+
+		return tc;
+	};
+});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/wordcount/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("wordcount",function(b){var a=this,c,e;c=b.getParam("wordcount_countregex",/[\w\u2019\x27\-\u00C0-\u1FFF]+/g);e=b.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$?\x27\x22_+=\\\/\-]*/g);function d(){b.theme.panel.find("#wordcount").text(["Words: {0}",a.getCount()])}b.on("init",function(){var f=b.theme.panel&&b.theme.panel.find("#statusbar")[0];if(f){window.setTimeout(function(){f.insert({type:"label",name:"wordcount",text:["Words: {0}",a.getCount()],classes:"wordcount",disabled:b.settings.readonly},0);b.on("setcontent beforeaddundo",d);b.on("keyup",function(g){if(g.keyCode==32){d()}})},0)}});a.getCount=function(){var g=b.getContent({format:"raw"});var f=0;if(g){g=g.replace(/\.\.\./g," ");g=g.replace(/<.[^<>]*?>/g," ").replace(/&nbsp;|&#160;/gi," ");g=g.replace(/(\w+)(&#?[a-z0-9]+;)+(\w+)/i,"$1$3").replace(/&.+?;/g," ");g=g.replace(e,"");var h=g.match(c);if(h){f=h.length}}return f}});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/AbsoluteLayout.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,17 @@
+// AbsoluteLayout
+
+.@{prefix}-abs-layout {
+	position: relative;
+}
+
+body .@{prefix}-abs-layout-item, .@{prefix}-abs-end {
+	position: absolute;
+}
+
+.@{prefix}-abs-end {
+	width: 1px; height: 1px;
+}
+
+.@{prefix}-container-body.@{prefix}-abs-layout {
+	overflow: hidden;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Animations.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,10 @@
+// Animations
+
+.@{prefix}-fade {
+	opacity: 0;
+	.transition(opacity .15s linear);
+
+	&.@{prefix}-in {
+		opacity: 1;
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Button.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,157 @@
+// Button
+
+.@{prefix}-btn {
+	border: 1px solid mix(rgb(red(@btn-border-right), green(@btn-border-right), blue(@btn-border-right)), @panel-bg, 30%);
+	border-color: @btn-border-top @btn-border-right @btn-border-bottom @btn-border-left;
+	position: relative;
+	text-shadow: @text-shadow;
+
+	.inline-block();
+	.border-radius(3px);
+	.box-shadow(@btn-box-shadow);
+	.vertical-gradient(@btn-bg, @btn-bg-hlight);
+
+	&:hover, &:focus {
+		color: @btn-text;
+		.vertical-gradient(darken(@btn-bg, 5%), darken(@btn-bg-hlight, 5%));
+	}
+
+	&.@{prefix}-disabled button, &.@{prefix}-disabled:hover button {
+		cursor: default;
+		.box-shadow(none);
+		.opacity(@btn-box-disabled-opacity);
+	}
+
+	&.@{prefix}-active, &.@{prefix}-active:hover {
+		.vertical-gradient(darken(@btn-bg, 10%), darken(@btn-bg-hlight, 10%));
+		.box-shadow(@btn-box-shadow-active);
+	}
+
+	&:active {
+		.vertical-gradient(darken(@btn-bg, 10%), darken(@btn-bg-hlight, 10%));
+		.box-shadow(@btn-box-shadow-active);
+	}
+}
+
+.@{prefix}-btn button {
+	padding: 4px 10px;
+	font-size: @font-size;
+	line-height: @line-height;
+	*line-height: @line-height - 4px;
+	cursor: pointer;
+	color: @btn-text;
+	text-align: center;
+
+	// Fixes for default inner padding of button
+	overflow: visible; // IE7
+	-webkit-appearance: none; // WebKit
+	&::-moz-focus-inner { // Gecko
+		border: 0;
+		padding: 0;
+	}
+}
+
+.@{prefix}-btn i {
+	text-shadow: 1px 1px @btn-text-shadow;
+}
+
+.@{prefix}-primary {
+	min-width: 50px;
+	color: @btn-primary-text;
+	border: 1px solid mix(rgb(red(@btn-border-right), green(@btn-border-right), blue(@btn-border-right)), @panel-bg, 30%);
+	border-color: @btn-border-top @btn-border-right @btn-border-bottom @btn-border-left;
+	.vertical-gradient(@btn-primary-bg, @btn-primary-bg-hlight);
+
+	&:hover, &:focus {
+		.vertical-gradient(darken(@btn-primary-bg, 5%), darken(@btn-primary-bg-hlight, 5%));
+	}
+
+	&.@{prefix}-disabled button, &.@{prefix}-disabled:hover button {
+		cursor: default;
+		.box-shadow(none);
+		.opacity(@btn-box-disabled-opacity);
+	}
+
+	&.@{prefix}-active, &.@{prefix}-active:hover, &:not(.@{prefix}-disabled):active {
+		.vertical-gradient(darken(@btn-primary-bg, 10%), darken(@btn-primary-bg-hlight, 10%));
+		.box-shadow(@btn-box-shadow-active);
+	}
+}
+
+.@{prefix}-primary button, .@{prefix}-primary button i {
+	color: @btn-primary-text;
+	text-shadow: 1px 1px @btn-primary-text-shadow;
+}
+
+.@{prefix}-btn-large button {
+	padding: 9px 14px;
+	font-size: @font-size + 2px;
+	line-height: normal;
+	.border-radius(5px);
+}
+
+.@{prefix}-btn-large i {
+	margin-top: 2px;
+}
+
+.@{prefix}-btn-small button {
+	padding: 1px 5px;
+	font-size: @font-size - 2px;
+	*padding-bottom: 2px;
+}
+
+.@{prefix}-btn-small i {
+	line-height: 20px;
+	vertical-align: top;
+	*line-height: 18px;
+}
+
+.@{prefix}-btn .@{prefix}-caret {
+	margin-top: 8px;
+	margin-left: 0;
+}
+
+.@{prefix}-btn-small .@{prefix}-caret {
+	margin-top: 8px;
+	margin-left: 0;
+}
+
+.@{prefix}-caret {
+	.inline-block();
+	width: 0; height: 0;
+	vertical-align: top;
+	border-top: 4px solid @btn-caret-border;
+	border-right: 4px solid transparent;
+	border-left: 4px solid transparent;
+	content: "";
+}
+
+.@{prefix}-disabled .@{prefix}-caret {
+	border-top-color: @text-disabled;
+}
+
+.@{prefix}-caret.@{prefix}-up {
+	border-bottom: 4px solid @btn-caret-border;
+	border-top: 0;
+}
+
+.@{prefix}-btn-flat {
+	border: 0;
+	background: transparent;
+	.border-radius(0);
+	.box-shadow(none);
+	filter: none;
+}
+
+.@{prefix}-btn-flat:hover, .@{prefix}-btn-flat.@{prefix}-active, .@{prefix}-btn-flat:focus, .@{prefix}-btn-flat:active {
+	border: 0;
+	background: @menubar-bg-active;
+	filter: none;
+	.box-shadow(none);
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-btn button {
+	direction: rtl;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/ButtonGroup.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,27 @@
+// ButtonGroup
+
+.@{prefix}-btn-group .@{prefix}-btn {
+	border-width: 1px 0 1px 0;
+	margin: 0;
+	.border-radius(0);
+}
+
+.@{prefix}-btn-group .@{prefix}-first {
+	border-left: 1px solid mix(rgb(red(@btn-border-left), green(@btn-border-left), blue(@btn-border-left)), @panel-bg, 30%);
+	border-left: 1px solid @btn-border-left;
+	.border-radius(3px 0 0 3px);
+}
+
+.@{prefix}-btn-group .@{prefix}-last {
+	border-right: 1px solid mix(rgb(red(@btn-border-right), green(@btn-border-right), blue(@btn-border-right)), @panel-bg, 30%);
+	border-right: 1px solid @btn-border-right;
+	.border-radius(0 3px 3px 0);
+}
+
+.@{prefix}-btn-group .@{prefix}-first.@{prefix}-last {
+	.border-radius(3px);
+}
+
+.@{prefix}-btn-group .@{prefix}-btn.@{prefix}-flow-layout-item {
+	margin: 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Checkbox.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,45 @@
+// Checkbox
+
+.@{prefix}-checkbox {
+	cursor: pointer;
+}
+
+i.@{prefix}-i-checkbox {
+	margin: 0 3px 0 0;
+	border: 1px solid @checkbox-border;
+	.border-radius(3px);
+	.box-shadow(@checkbox-box-shadow);
+	.vertical-gradient(@checkbox-bg, @checkbox-bg-hlight);
+	text-indent: -10em;
+	*font-size: 0;
+	*line-height: 0;
+	*text-indent: 0;
+	overflow: hidden;
+}
+
+.@{prefix}-checked i.@{prefix}-i-checkbox {
+	color: @btn-text;
+	font-size: 16px;
+	line-height: 16px;
+	text-indent: 0;
+}
+
+.@{prefix}-checkbox:focus i.@{prefix}-i-checkbox, .@{prefix}-checkbox.@{prefix}-focus i.@{prefix}-i-checkbox {
+	border: 1px solid @checkbox-border-focus;
+	.box-shadow(inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px fadeout(@checkbox-border-focus, 15%));
+}
+
+.@{prefix}-checkbox.@{prefix}-disabled .@{prefix}-label, .@{prefix}-checkbox.@{prefix}-disabled i.@{prefix}-i-checkbox {
+	color: mix(@text, @panel-bg, 40%);
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-checkbox {
+	direction: rtl;
+	text-align: right;
+}
+
+.@{prefix}-rtl i.@{prefix}-i-checkbox {
+	margin: 0 0 0 3px;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/ColorBox.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,6 @@
+// ColorBox
+
+.@{prefix}-colorbox i {
+	border: 1px solid @textbox-border;
+	width: 14px; height: 14px;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/ColorButton.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,78 @@
+// ColorButton
+
+.@{prefix}-colorbutton .@{prefix}-ico {
+	position: relative;
+}
+
+.@{prefix}-colorbutton-grid {
+	margin: 4px;	
+}
+
+.@{prefix}-colorbutton button {
+	padding-right: 4px;
+}
+
+.@{prefix}-colorbutton .@{prefix}-preview {
+	padding-right: 3px;
+	display: block;
+	position: absolute;
+	left: 50%;
+	top: 50%;
+	margin-left: -14px;
+	margin-top: 7px;
+	background: gray;
+	width: 13px;
+	height: 2px;
+	overflow: hidden;
+}
+
+.@{prefix}-colorbutton.@{prefix}-btn-small .@{prefix}-preview {
+	margin-left: -16px;
+	padding-right: 0;
+	width: 16px;
+}
+
+.@{prefix}-colorbutton .@{prefix}-open {
+	padding-left: 4px;
+	border-left: 1px solid transparent;
+	border-right: 1px solid transparent;
+}
+
+.@{prefix}-colorbutton:hover .@{prefix}-open {
+	border-left-color: @btn-split-border;
+	border-right-color: @btn-split-border;
+}
+
+.@{prefix}-colorbutton.@{prefix}-btn-small .@{prefix}-open {
+	padding: 0 3px 0 3px;
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-colorbutton {
+	direction: rtl;
+}
+
+.@{prefix}-rtl .@{prefix}-colorbutton .@{prefix}-preview {
+	margin-left: 0;
+	padding-right: 0;
+	padding-left: 4px;
+	margin-right: -14px;
+}
+
+.@{prefix}-rtl .@{prefix}-colorbutton.@{prefix}-btn-small .@{prefix}-preview {
+	margin-left: 0;
+	padding-right: 0;
+	margin-right: -17px;
+	padding-left: 0;
+}
+
+.@{prefix}-rtl .@{prefix}-colorbutton button {
+	padding-right: 10px;
+	padding-left: 10px;
+}
+
+.@{prefix}-rtl .@{prefix}-colorbutton .@{prefix}-open {
+	padding-left: 4px;
+	padding-right: 4px;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/ColorPicker.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,80 @@
+// ColorPicker
+
+.@{prefix}-colorpicker {
+	position: relative;
+	width: 250px;
+	height: 220px;
+}
+
+.@{prefix}-colorpicker-sv {
+	position: absolute;
+	top: 0; left: 0;
+	width: 90%;
+	height: 100%;
+	border: 1px solid @colorpicker-border;
+	cursor: crosshair;
+	overflow: hidden;
+}
+
+.@{prefix}-colorpicker-h-chunk {
+	width: 100%;
+}
+
+.@{prefix}-colorpicker-overlay1, .@{prefix}-colorpicker-overlay2 {
+	width: 100%;
+	height: 100%;
+	position: absolute;
+	top: 0;
+	left: 0;
+}
+
+.@{prefix}-colorpicker-overlay1 {
+	filter: progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff');
+	-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff')";
+	background: linear-gradient(to right, rgba(255,255,255,1), rgba(255,255,255,0));
+}
+
+.@{prefix}-colorpicker-overlay2 {
+	filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00000000', endColorstr='#000000');
+	-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00000000', endColorstr='#000000')";
+	background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,1));
+}
+
+.@{prefix}-colorpicker-selector1 {
+	background: none;
+	position: absolute;
+	width: 12px;
+	height: 12px;
+	margin: -8px 0 0 -8px;
+	border: 1px solid black;
+	border-radius: 50%;
+}
+
+.@{prefix}-colorpicker-selector2 {
+	position: absolute;
+	width: 10px;
+	height: 10px;
+	border: 1px solid white;
+	border-radius: 50%;
+}
+
+.@{prefix}-colorpicker-h {
+	position: absolute;
+	top: 0; right: 0;
+	width: 6.5%;
+	height: 100%;
+	border: 1px solid @colorpicker-border;
+	cursor: crosshair;
+}
+
+.@{prefix}-colorpicker-h-marker {
+	margin-top: -4px;
+	position: absolute;
+	top: 0;
+	left: -1px;
+	width: 100%;
+	border: 1px solid @colorpicker-hue-border;
+	background: @colorpicker-hue-bg;
+	height: 4px;
+	z-index: 100;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/ComboBox.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,38 @@
+// ComboBox
+
+.@{prefix}-combobox {
+	.inline-block();
+	.border-radius(3px);
+	.box-shadow(@textbox-box-shadow);
+	*height: 32px;
+}
+
+.@{prefix}-combobox input {
+	border: 1px solid @textbox-border;
+	border-right-color: @combobox-border;
+	height: 28px;
+}
+
+.@{prefix}-combobox.@{prefix}-disabled input {
+	color: mix(@text, @textbox-bg, 40%);
+}
+
+.@{prefix}-combobox.@{prefix}-has-open input {
+	.border-radius(4px 0 0 4px);
+}
+
+.@{prefix}-combobox .@{prefix}-btn {
+	border-left: 0;
+	.border-radius(0 4px 4px 0);
+}
+
+.@{prefix}-combobox button {
+	padding-right: 8px;
+	padding-left: 8px;
+}
+
+.@{prefix}-combobox.@{prefix}-disabled .@{prefix}-btn button {
+	cursor: default;
+	.box-shadow(none);
+	.opacity(@btn-box-disabled-opacity);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Container.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,9 @@
+// Container
+
+.@{prefix}-container, .@{prefix}-container-body {
+	display: block;
+}
+
+.@{prefix}-autoscroll {
+	overflow: hidden;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Content.Inline.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,3 @@
+/* Content.Inline.less */
+
+@import "Content.Objects.less";
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Content.Objects.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,82 @@
+/* Content.Objects.less */
+
+.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;
+	page-break-before: always;
+}
+
+@media print {
+  .mce-pagebreak {
+    border: 0px;
+  }
+}
+
+.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;
+	user-select: all;
+	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, .mce-shy {
+	background: #AAA;
+}
+
+.mce-shy::after {
+	content: '-';
+}
+
+hr {
+	cursor: default;
+}
+
+.mce-match-marker {
+	background: #AAA;
+	color: #fff;
+}
+
+.mce-match-marker-selected {
+	background: #3399ff;
+	color: #fff;
+}
+
+.mce-spellchecker-word {
+	border-bottom: 2px solid #F00;
+	cursor: default;
+}
+
+.mce-spellchecker-grammar {
+	border-bottom: 2px solid #008000;
+	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: #3399ff !important;
+}
+
+.mce-edit-focus {
+	outline: 1px dotted #333;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Content.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,26 @@
+/* Content.less */
+
+@font-family: Verdana, Arial, Helvetica, sans-serif;
+@font-size: 11px;
+
+body {
+	background-color: #FFFFFF;
+	color: #000000;
+	font-family: @font-family;
+	font-size: @font-size;
+	scrollbar-3dlight-color: #F0F0EE;
+	scrollbar-arrow-color: #676662;
+	scrollbar-base-color: #F0F0EE;
+	scrollbar-darkshadow-color: #DDDDDD;
+	scrollbar-face-color: #E0E0DD;
+	scrollbar-highlight-color: #F0F0EE;
+	scrollbar-shadow-color: #F0F0EE;
+	scrollbar-track-color: #F5F5F5;
+}
+
+td, th {
+	font-family: @font-family;
+	font-size: @font-size;
+}
+
+@import "Content.Objects.less";
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/FieldSet.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,15 @@
+// FieldSet
+
+.@{prefix}-fieldset {
+	border: 0 solid #9E9E9E;
+	.border-radius(3px);
+}
+
+.@{prefix}-fieldset > .@{prefix}-container-body {
+	margin-top: -15px;
+}
+
+.@{prefix}-fieldset-title {
+	margin-left: 5px;
+	padding: 0 5px 0 5px;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/FitLayout.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,9 @@
+// FitLayout
+
+.@{prefix}-fit-layout {
+	.inline-block();
+}
+
+.@{prefix}-fit-layout-item {
+	position: absolute;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/FloatPanel.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,69 @@
+// FloatPanel
+
+.@{prefix}-floatpanel {
+	position: absolute;
+	.box-shadow(@floatpanel-box-shadow);
+}
+
+.@{prefix}-floatpanel.@{prefix}-fixed {
+	position: fixed;
+}
+
+// Popover panel
+
+.@{prefix}-floatpanel .@{prefix}-arrow,
+.@{prefix}-floatpanel .@{prefix}-arrow:after {
+	position: absolute;
+	display: block;
+	width: 0;
+	height: 0;
+	border-color: transparent;
+	border-style: solid;
+}
+
+.@{prefix}-floatpanel .@{prefix}-arrow {
+	border-width: @popover-arrow-outer-width;
+}
+
+.@{prefix}-floatpanel .@{prefix}-arrow:after {
+	border-width: @popover-arrow-width;
+	content: "";
+}
+
+.@{prefix}-floatpanel.@{prefix}-popover {
+	.reset-gradient();
+	.border-radius(6px);
+	.box-shadow(@floatpanel-box-shadow);
+	top: 0;
+	left: 0;
+	background: @popover-bg;
+	border: 1px solid @panel-border;
+	border: 1px solid @popover-arrow-outer;
+
+	&.@{prefix}-bottom {
+		margin-top: @popover-arrow-width;
+		*margin-top: 0;
+
+		& > .@{prefix}-arrow {
+			left: 50%;
+			margin-left: -@popover-arrow-outer-width;
+			border-top-width: 0;
+			border-bottom-color: @panel-border;
+			border-bottom-color: @popover-arrow-outer;
+			top: -@popover-arrow-outer-width;
+
+			&:after {
+				top: 1px;
+				margin-left: -@popover-arrow-width;
+				border-top-width: 0;
+				border-bottom-color: @popover-arrow;
+			}
+		}
+
+		&.@{prefix}-start { margin-left: -22px; }
+		&.@{prefix}-start > .@{prefix}-arrow { left: 20px; }
+
+		&.@{prefix}-end { margin-left: 22px; }
+		&.@{prefix}-end > .@{prefix}-arrow { right: 10px; left: auto; }
+	}
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/FlowLayout.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,36 @@
+// FlowLayout
+
+.@{prefix}-flow-layout-item {
+	.inline-block();
+}
+
+.@{prefix}-flow-layout-item {
+	margin: 2px 0 2px 2px;	
+}
+
+.@{prefix}-flow-layout-item.@{prefix}-last {
+	margin-right: 2px;
+}
+
+.@{prefix}-flow-layout {
+	white-space: normal;
+}
+
+.@{prefix}-tinymce-inline .@{prefix}-flow-layout {
+	white-space: nowrap;
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-flow-layout {
+	text-align: right;
+	direction: rtl;
+}
+
+.@{prefix}-rtl .@{prefix}-flow-layout-item {
+	margin: 2px 2px 2px 0;	
+}
+
+.@{prefix}-rtl .@{prefix}-flow-layout-item.@{prefix}-last {
+	margin-left: 2px;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Icons.Ie7.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,113 @@
+/* Icons IE7 */
+
+@font-face {
+	font-family: 'tinymce';
+	src:url('fonts/tinymce.eot');
+	src:url('fonts/tinymce.eot?#iefix') format('embedded-opentype'),
+		url('fonts/tinymce.woff') format('woff'),
+		url('fonts/tinymce.ttf') format('truetype'),
+		url('fonts/tinymce.svg#tinymce') format('svg');
+	font-weight: normal;
+	font-style: normal;
+}
+
+@font-face {
+	font-family: 'tinymce-small';
+	src:url('fonts/tinymce-small.eot');
+	src:url('fonts/tinymce-small.eot?#iefix') format('embedded-opentype'),
+		url('fonts/tinymce-small.woff') format('woff'),
+		url('fonts/tinymce-small.ttf') format('truetype'),
+		url('fonts/tinymce-small.svg#tinymce') format('svg');
+	font-weight: normal;
+	font-style: normal;
+}
+
+@iconSize: 16px;
+
+.@{prefix}-ico {
+	font-family: 'tinymce';
+	font-style: normal;
+	font-weight: normal;
+	font-size: @iconSize;
+	line-height: 16px;
+	vertical-align: text-top;
+	-webkit-font-smoothing: antialiased;
+
+	display: inline-block;
+	background: transparent center center;
+	width: 16px;
+	height: 16px;
+	color: @btn-text;
+	-ie7-icon: ' ';
+}
+
+.@{prefix}-btn-small .@{prefix}-ico {
+	font-family: 'tinymce-small';
+}
+
+// .@{prefix}-i-checkbox needs to have zoom overridden since it's set by the gradient mixin
+.@{prefix}-ico, i.@{prefix}-i-checkbox {
+	zoom: ~"expression(this.runtimeStyle['zoom'] = '1', this.innerHTML = this.currentStyle['-ie7-icon'].substr(1, 1) + '&nbsp;')";	
+}
+
+.@{prefix}-i-save           { -ie7-icon: "\e000"; }
+.@{prefix}-i-newdocument    { -ie7-icon: "\e001"; }
+.@{prefix}-i-fullpage       { -ie7-icon: "\e002"; }
+.@{prefix}-i-alignleft      { -ie7-icon: "\e003"; }
+.@{prefix}-i-aligncenter    { -ie7-icon: "\e004"; }
+.@{prefix}-i-alignright     { -ie7-icon: "\e005"; }
+.@{prefix}-i-alignjustify   { -ie7-icon: "\e006"; }
+.@{prefix}-i-cut            { -ie7-icon: "\e007"; }
+.@{prefix}-i-paste          { -ie7-icon: "\e008"; }
+.@{prefix}-i-searchreplace  { -ie7-icon: "\e009"; }
+.@{prefix}-i-bullist        { -ie7-icon: "\e00a"; }
+.@{prefix}-i-numlist        { -ie7-icon: "\e00b"; }
+.@{prefix}-i-indent         { -ie7-icon: "\e00c"; }
+.@{prefix}-i-outdent        { -ie7-icon: "\e00d"; }
+.@{prefix}-i-blockquote     { -ie7-icon: "\e00e"; }
+.@{prefix}-i-undo           { -ie7-icon: "\e00f"; }
+.@{prefix}-i-redo           { -ie7-icon: "\e010"; }
+.@{prefix}-i-link           { -ie7-icon: "\e011"; }
+.@{prefix}-i-unlink         { -ie7-icon: "\e012"; }
+.@{prefix}-i-anchor         { -ie7-icon: "\e013"; }
+.@{prefix}-i-image          { -ie7-icon: "\e014"; }
+.@{prefix}-i-media          { -ie7-icon: "\e015"; }
+.@{prefix}-i-help           { -ie7-icon: "\e016"; }
+.@{prefix}-i-code           { -ie7-icon: "\e017"; }
+.@{prefix}-i-insertdatetime { -ie7-icon: "\e018"; }
+.@{prefix}-i-preview        { -ie7-icon: "\e019"; }
+.@{prefix}-i-forecolor      { -ie7-icon: "\e01a"; }
+.@{prefix}-i-backcolor      { -ie7-icon: "\e01a"; }
+.@{prefix}-i-table          { -ie7-icon: "\e01b"; }
+.@{prefix}-i-hr             { -ie7-icon: "\e01c"; }
+.@{prefix}-i-removeformat   { -ie7-icon: "\e01d"; }
+.@{prefix}-i-subscript      { -ie7-icon: "\e01e"; }
+.@{prefix}-i-superscript    { -ie7-icon: "\e01f"; }
+.@{prefix}-i-charmap        { -ie7-icon: "\e020"; }
+.@{prefix}-i-emoticons      { -ie7-icon: "\e021"; }
+.@{prefix}-i-print          { -ie7-icon: "\e022"; }
+.@{prefix}-i-fullscreen     { -ie7-icon: "\e023"; }
+.@{prefix}-i-spellchecker   { -ie7-icon: "\e024"; }
+.@{prefix}-i-nonbreaking    { -ie7-icon: "\e025"; }
+.@{prefix}-i-template       { -ie7-icon: "\e026"; }
+.@{prefix}-i-pagebreak      { -ie7-icon: "\e027"; }
+.@{prefix}-i-restoredraft   { -ie7-icon: "\e028"; }
+.@{prefix}-i-untitled       { -ie7-icon: "\e029"; }
+.@{prefix}-i-bold           { -ie7-icon: "\e02a"; }
+.@{prefix}-i-italic         { -ie7-icon: "\e02b"; }
+.@{prefix}-i-underline      { -ie7-icon: "\e02c"; }
+.@{prefix}-i-strikethrough  { -ie7-icon: "\e02d"; }
+.@{prefix}-i-visualchars    { -ie7-icon: "\e02e"; }
+.@{prefix}-i-ltr            { -ie7-icon: "\e02f"; }
+.@{prefix}-i-rtl            { -ie7-icon: "\e030"; }
+.@{prefix}-i-copy           { -ie7-icon: "\e031"; }
+.@{prefix}-i-resize         { -ie7-icon: "\e032"; }
+.@{prefix}-i-browse         { -ie7-icon: "\e034"; }
+.@{prefix}-i-pastetext      { -ie7-icon: "\e035"; }
+
+.@{prefix}-i-checkbox, .@{prefix}-i-selected {
+	-ie7-icon: "\e033";
+}
+
+.@{prefix}-i-selected              { visibility: hidden; }
+.@{prefix}-i-backcolor             { background: #BBB; }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Icons.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,112 @@
+/* Icons */
+
+@font-face {
+	font-family: 'tinymce';
+	src:url('fonts/tinymce.eot');
+	src:url('fonts/tinymce.eot?#iefix') format('embedded-opentype'),
+		url('fonts/tinymce.woff') format('woff'),
+		url('fonts/tinymce.ttf') format('truetype'),
+		url('fonts/tinymce.svg#tinymce') format('svg');
+	font-weight: normal;
+	font-style: normal;
+}
+
+@font-face {
+	font-family: 'tinymce-small';
+	src:url('fonts/tinymce-small.eot');
+	src:url('fonts/tinymce-small.eot?#iefix') format('embedded-opentype'),
+		url('fonts/tinymce-small.woff') format('woff'),
+		url('fonts/tinymce-small.ttf') format('truetype'),
+		url('fonts/tinymce-small.svg#tinymce') format('svg');
+	font-weight: normal;
+	font-style: normal;
+}
+
+@iconSize: 16px;
+
+.@{prefix}-ico {
+	font-family: 'tinymce', Arial;
+	font-style: normal;
+	font-weight: normal;
+	font-variant: normal;
+	font-size: @iconSize;
+	line-height: 16px;
+	speak: none;
+	vertical-align: text-top;
+	-webkit-font-smoothing: antialiased;
+	-moz-osx-font-smoothing: grayscale;
+
+	display: inline-block;
+	background: transparent center center;
+	background-size: cover;
+	width: 16px;
+	height: 16px;
+	color: @btn-text;
+}
+
+.@{prefix}-btn-small .@{prefix}-ico {
+	font-family: 'tinymce-small', Arial;
+}
+
+.@{prefix}-i-save:before           { content: "\e000"; }
+.@{prefix}-i-newdocument:before    { content: "\e001"; }
+.@{prefix}-i-fullpage:before       { content: "\e002"; }
+.@{prefix}-i-alignleft:before      { content: "\e003"; }
+.@{prefix}-i-aligncenter:before    { content: "\e004"; }
+.@{prefix}-i-alignright:before     { content: "\e005"; }
+.@{prefix}-i-alignjustify:before   { content: "\e006"; }
+.@{prefix}-i-cut:before            { content: "\e007"; }
+.@{prefix}-i-paste:before          { content: "\e008"; }
+.@{prefix}-i-searchreplace:before  { content: "\e009"; }
+.@{prefix}-i-bullist:before        { content: "\e00a"; }
+.@{prefix}-i-numlist:before        { content: "\e00b"; }
+.@{prefix}-i-indent:before         { content: "\e00c"; }
+.@{prefix}-i-outdent:before        { content: "\e00d"; }
+.@{prefix}-i-blockquote:before     { content: "\e00e"; }
+.@{prefix}-i-undo:before           { content: "\e00f"; }
+.@{prefix}-i-redo:before           { content: "\e010"; }
+.@{prefix}-i-link:before           { content: "\e011"; }
+.@{prefix}-i-unlink:before         { content: "\e012"; }
+.@{prefix}-i-anchor:before         { content: "\e013"; }
+.@{prefix}-i-image:before          { content: "\e014"; }
+.@{prefix}-i-media:before          { content: "\e015"; }
+.@{prefix}-i-help:before           { content: "\e016"; }
+.@{prefix}-i-code:before           { content: "\e017"; }
+.@{prefix}-i-insertdatetime:before { content: "\e018"; }
+.@{prefix}-i-preview:before        { content: "\e019"; }
+.@{prefix}-i-forecolor:before      { content: "\e01a"; }
+.@{prefix}-i-backcolor:before      { content: "\e01a"; }
+.@{prefix}-i-table:before          { content: "\e01b"; }
+.@{prefix}-i-hr:before             { content: "\e01c"; }
+.@{prefix}-i-removeformat:before   { content: "\e01d"; }
+.@{prefix}-i-subscript:before      { content: "\e01e"; }
+.@{prefix}-i-superscript:before    { content: "\e01f"; }
+.@{prefix}-i-charmap:before        { content: "\e020"; }
+.@{prefix}-i-emoticons:before      { content: "\e021"; }
+.@{prefix}-i-print:before          { content: "\e022"; }
+.@{prefix}-i-fullscreen:before     { content: "\e023"; }
+.@{prefix}-i-spellchecker:before   { content: "\e024"; }
+.@{prefix}-i-nonbreaking:before    { content: "\e025"; }
+.@{prefix}-i-template:before       { content: "\e026"; }
+.@{prefix}-i-pagebreak:before      { content: "\e027"; }
+.@{prefix}-i-restoredraft:before   { content: "\e028"; }
+.@{prefix}-i-untitled:before       { content: "\e029"; }
+.@{prefix}-i-bold:before           { content: "\e02a"; }
+.@{prefix}-i-italic:before         { content: "\e02b"; }
+.@{prefix}-i-underline:before      { content: "\e02c"; }
+.@{prefix}-i-strikethrough:before  { content: "\e02d"; }
+.@{prefix}-i-visualchars:before    { content: "\e02e"; }
+.@{prefix}-i-visualblocks:before   { content: "\e02e"; }
+.@{prefix}-i-ltr:before            { content: "\e02f"; }
+.@{prefix}-i-rtl:before            { content: "\e030"; }
+.@{prefix}-i-copy:before           { content: "\e031"; }
+.@{prefix}-i-resize:before         { content: "\e032"; }
+.@{prefix}-i-browse:before         { content: "\e034"; }
+.@{prefix}-i-pastetext:before      { content: "\e035"; }
+
+.@{prefix}-i-checkbox:before, .@{prefix}-i-selected:before {
+	content: "\e033";
+}
+
+.@{prefix}-i-selected              { visibility: hidden; }
+i.@{prefix}-i-backcolor            { text-shadow: none; background: @colorbtn-backcolor-bg; }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Iframe.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,6 @@
+// Iframe
+
+.@{prefix}-iframe {
+	border: 0 solid @iframe-border;
+	width: 100%; height: 100%;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Label.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,30 @@
+// Label
+
+.@{prefix}-label {
+	.inline-block();
+	text-shadow: @text-shadow;
+	overflow: hidden;
+}
+
+.@{prefix}-label.@{prefix}-autoscroll {
+	overflow: auto;
+}
+
+.@{prefix}-label.@{prefix}-disabled {
+	color: @text-disabled;
+}
+
+.@{prefix}-label.@{prefix}-multiline {
+	white-space: pre-wrap;
+}
+
+.@{prefix}-label.@{prefix}-error {
+	color: @text-error;
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-label {
+	text-align: right;
+	direction: rtl;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/ListBox.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,26 @@
+// ListBox
+
+.@{prefix}-listbox button {
+	text-align: left;
+	padding-right: 20px;
+	position: relative;
+}
+
+.@{prefix}-listbox .@{prefix}-caret {
+	position: absolute;
+	margin-top: -2px;
+	right: 8px;
+	top: 50%;
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-listbox .@{prefix}-caret {
+	right: auto;
+	left: 8px;
+}
+
+.@{prefix}-rtl .@{prefix}-listbox button {
+	padding-right: 10px;
+	padding-left: 20px;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Menu.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,34 @@
+// Menu
+
+.@{prefix}-menu {
+	position: absolute;
+	left: 0; top: 0;
+	.reset-gradient();
+	z-index: 1000;
+	padding: 5px 0 5px 0;
+	margin: 2px 0 0;
+	min-width: 160px;
+	background: @menu-bg;
+	border: 1px solid mix(rgb(red(@menu-border), green(@menu-border), blue(@menu-border)), @panel-bg, round(alpha(@menu-border) * 200));
+	border: 1px solid @menu-border;
+	z-index: 1002;
+	.border-radius(6px);
+	.box-shadow(0 5px 10px rgba(0,0,0,.2));
+	max-height: 400px;
+	overflow: auto;
+	overflow-x: hidden;
+}
+
+.@{prefix}-menu i {
+	display: none;
+}
+
+.@{prefix}-menu-has-icons i {
+	display: inline-block;
+	*display: inline;
+}
+
+.@{prefix}-menu-sub-tr-tl { margin: -6px 0 0 -1px; }
+.@{prefix}-menu-sub-br-bl { margin: 6px 0 0 -1px; }
+.@{prefix}-menu-sub-tl-tr { margin: -6px 0 0 1px; }
+.@{prefix}-menu-sub-bl-br { margin: 6px 0 0 1px; }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/MenuBar.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,28 @@
+/* MenuBar */
+
+.@{prefix}-menubar .@{prefix}-menubtn {
+	border-color: transparent;
+	background: transparent;
+	.border-radius(0);
+	.box-shadow(none);
+	filter: none;
+}
+
+.@{prefix}-menubar {
+	border: 1px solid @menubar-border;
+}
+
+.@{prefix}-menubar .@{prefix}-menubtn button span {
+	color: @text;
+}
+
+.@{prefix}-menubar .@{prefix}-caret {
+	border-top-color: @text;
+}
+
+.@{prefix}-menubar .@{prefix}-menubtn:hover, .@{prefix}-menubar .@{prefix}-menubtn.@{prefix}-active, .@{prefix}-menubar .@{prefix}-menubtn:focus {
+	border-color: transparent;
+	background: @menubar-bg-active;
+	filter: none;
+	.box-shadow(none);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/MenuButton.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,34 @@
+/* MenuButton */
+
+.@{prefix}-menubtn span {
+	color: @btn-text;
+	margin-right: 2px;
+	line-height: @line-height;
+	*line-height: @line-height - 4px;
+}
+
+.@{prefix}-menubtn.@{prefix}-btn-small span {
+	font-size: @font-size - 2px;
+}
+
+.@{prefix}-menubtn.@{prefix}-fixed-width span {
+	display: inline-block;
+	overflow-x: hidden;
+	text-overflow: ellipsis;
+	width: 90px;
+}
+
+.@{prefix}-menubtn.@{prefix}-fixed-width.@{prefix}-btn-small span {
+	width: 70px;
+}
+
+.@{prefix}-menubtn .@{prefix}-caret {
+	*margin-top: 6px;
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-menubtn button {
+	direction: rtl;
+	text-align: right;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/MenuItem.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,142 @@
+// MenuItem
+
+.@{prefix}-menu-item {
+	display: block;
+	padding: 6px 15px 6px 12px;
+	clear: both;
+	font-weight: normal;
+	line-height: 20px;
+	color: @menuitem-text;
+	white-space: nowrap;
+	cursor: pointer;
+	line-height: normal;
+	border-left: 4px solid transparent;
+	margin-bottom: 1px;
+}
+
+.@{prefix}-menu-item .@{prefix}-ico, .@{prefix}-menu-item .@{prefix}-text {
+	color: @menuitem-text;
+}
+
+.@{prefix}-menu-item.@{prefix}-disabled .@{prefix}-text, .@{prefix}-menu-item.@{prefix}-disabled .@{prefix}-ico {
+	color: mix(@menuitem-text, @menu-bg, 40%);
+}
+
+.@{prefix}-menu-item:hover .@{prefix}-text, .@{prefix}-menu-item.@{prefix}-selected .@{prefix}-text, .@{prefix}-menu-item:focus .@{prefix}-text {
+	color: @menuitem-text-inverse;
+}
+
+.@{prefix}-menu-item:hover .@{prefix}-ico, .@{prefix}-menu-item.@{prefix}-selected .@{prefix}-ico, .@{prefix}-menu-item:focus .@{prefix}-ico {
+	color: @menuitem-text-inverse;
+}
+
+.@{prefix}-menu-item.@{prefix}-disabled:hover {
+	background: @menuitem-bg-disabled;
+}
+
+.@{prefix}-menu-shortcut {
+	display: inline-block;
+	color: mix(@menuitem-text, @menu-bg, 40%);
+}
+
+.@{prefix}-menu-shortcut {
+	.inline-block();
+	padding: 0 15px 0 20px;
+}
+
+.@{prefix}-menu-item:hover .@{prefix}-menu-shortcut, .@{prefix}-menu-item.@{prefix}-selected .@{prefix}-menu-shortcut, .@{prefix}-menu-item:focus .@{prefix}-menu-shortcut {
+	color: @menuitem-text-inverse;
+}
+
+.@{prefix}-menu-item .@{prefix}-caret {
+	margin-top: 4px;
+	*margin-top: 3px;
+	margin-right: 6px;
+	border-top: 4px solid transparent;
+	border-bottom: 4px solid transparent;
+	border-left: 4px solid @menuitem-caret;
+}
+
+.@{prefix}-menu-item.@{prefix}-selected .@{prefix}-caret, .@{prefix}-menu-item:focus .@{prefix}-caret, .@{prefix}-menu-item:hover .@{prefix}-caret {
+	border-left-color: @menuitem-caret-selected;
+}
+
+.@{prefix}-menu-align .@{prefix}-menu-shortcut {
+	*margin-top: -2px;
+}
+
+.@{prefix}-menu-align .@{prefix}-menu-shortcut, .@{prefix}-menu-align .@{prefix}-caret {
+	position: absolute;
+	right: 0;
+}
+
+.@{prefix}-menu-item.@{prefix}-active i {
+	visibility: visible;
+}
+
+.@{prefix}-menu-item-normal.@{prefix}-active {
+	background-color: @menuitem-bg-active;
+}
+
+.@{prefix}-menu-item-preview.@{prefix}-active {
+	border-left: 5px solid @menuitem-preview-border-active;
+}
+
+.@{prefix}-menu-item-normal.@{prefix}-active .@{prefix}-text {
+	color: @menuitem-text-active;
+}
+
+.@{prefix}-menu-item-normal.@{prefix}-active:hover .@{prefix}-text, .@{prefix}-menu-item-normal.@{prefix}-active:hover .@{prefix}-ico {
+	color: @menuitem-text-inverse;
+}
+
+.@{prefix}-menu-item-normal.@{prefix}-active:focus .@{prefix}-text, .@{prefix}-menu-item-normal.@{prefix}-active:focus .@{prefix}-ico {
+	color: @menuitem-text-inverse;
+}
+
+.@{prefix}-menu-item:hover, .@{prefix}-menu-item.@{prefix}-selected, .@{prefix}-menu-item:focus {
+	text-decoration: none;
+	color: @menuitem-text-inverse;
+	.vertical-gradient(@menuitem-bg-selected, @menuitem-bg-selected-hlight);
+}
+
+div.@{prefix}-menu .@{prefix}-menu-item-sep, .@{prefix}-menu-item-sep:hover {
+	border: 0;
+	padding: 0;
+	height: 1px;
+	margin: 9px 1px;
+	overflow: hidden;
+	background: @menuitem-separator-top;
+	border-bottom: 1px solid @menuitem-separator-bottom;
+	cursor: default;
+	filter: none;
+}
+
+// RTL
+
+.@{prefix}-menu.@{prefix}-rtl {
+	direction: rtl;
+}
+
+.@{prefix}-rtl .@{prefix}-menu-item {
+	text-align: right;
+	direction: rtl;
+	padding: 6px 12px 6px 15px;
+}
+
+.@{prefix}-menu-align.@{prefix}-rtl .@{prefix}-menu-shortcut, .@{prefix}-menu-align.@{prefix}-rtl .@{prefix}-caret {
+	right: auto;
+	left: 0;
+}
+
+.@{prefix}-rtl .@{prefix}-menu-item .@{prefix}-caret {
+	margin-left: 6px;
+	margin-right: 0;
+	border-right: 4px solid @menuitem-caret;
+	border-left: 0;
+}
+
+.@{prefix}-rtl .@{prefix}-menu-item.@{prefix}-selected .@{prefix}-caret, .@{prefix}-rtl .@{prefix}-menu-item:focus .@{prefix}-caret, .@{prefix}-rtl .@{prefix}-menu-item:hover .@{prefix}-caret {
+	border-left-color: transparent;
+	border-right-color: @menuitem-caret-selected;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Mixins.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,54 @@
+// Mixins
+
+.opacity(@opacity) {
+	opacity: @opacity;
+	@opacityie: @opacity * 100;
+	filter: ~"alpha(opacity=@{opacityie})";
+	zoom: 1;
+}
+
+.vertical-gradient(@startColor, @endColor) when (@has-gradients = true) {
+	background-color: mix(@startColor, @endColor, 60%);
+	background-image: -moz-linear-gradient(top, @startColor, @endColor); // FF 3.6+
+	background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+
+	background-image: -webkit-linear-gradient(top, @startColor, @endColor); // Safari 5.1+, Chrome 10+
+	background-image: -o-linear-gradient(top, @startColor, @endColor); // Opera 11.10
+	background-image: linear-gradient(to bottom, @startColor, @endColor); // Standard, IE10
+	background-repeat: repeat-x;
+	filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)", argb(@startColor), argb(@endColor)));
+	zoom: 1;
+}
+
+.vertical-gradient(@startColor, @endColor) when (@has-gradients = false) {
+	background-color: mix(@startColor, @endColor, 60%);
+}
+
+.border-radius(@radius) when (@has-radius = true) {
+	-webkit-border-radius: @radius;
+	-moz-border-radius: @radius;
+	border-radius: @radius;
+}
+
+.box-shadow(@shadowA, @shadowB:X, ...) when (@has-boxshadow = true) {
+	// Multiple shadow solution from http://toekneestuck.com/blog/2012/05/15/less-css-arguments-variable/
+	@props: ~`"@{arguments}".replace(/[\[\]]|\,\sX/g, '')`;
+	-webkit-box-shadow: @props;
+	-moz-box-shadow: @props;
+	box-shadow: @props;
+}
+
+.transition(@transition) {
+	-webkit-transition: @transition;
+	transition: @transition;
+}
+
+.inline-block() {
+	display: inline-block;
+	*display: inline;
+	*zoom: 1;
+}
+
+.reset-gradient() {
+	filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)"));
+	background: transparent;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Panel.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,6 @@
+// Panel
+
+.@{prefix}-panel {
+	border: 0 solid @panel-border;
+	.vertical-gradient(@panel-bg, @panel-bg-hlight);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Path.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,45 @@
+// Path
+
+.@{prefix}-path {
+	.inline-block();
+	padding: 8px;
+	white-space: normal;
+}
+
+.@{prefix}-path .@{prefix}-txt {
+	display: inline-block;
+	padding-right: 3px;
+}
+
+.@{prefix}-path .@{prefix}-path-body {
+	display: inline-block;
+}
+
+.@{prefix}-path-item {
+	.inline-block();
+	cursor: pointer;
+	color: @path-text;
+}
+
+.@{prefix}-path-item:hover {
+	text-decoration: underline;
+}
+
+.@{prefix}-path-item:focus {
+	background: @path-bg-focus;
+	color: @path-text-focus;
+}
+
+.@{prefix}-path .@{prefix}-divider {
+	display: inline;
+}
+
+.@{prefix}-disabled .@{prefix}-path-item {
+	color: @text-disabled;
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-path {
+	direction: rtl;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Radio.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+// Radio - not implemented yet
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Reset.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,32 @@
+// Reset
+
+.@{prefix}-container, .@{prefix}-container *, .@{prefix}-widget, .@{prefix}-widget *, .@{prefix}-reset {
+	margin: 0; padding: 0; border: 0; outline: 0;
+	vertical-align: top; background: transparent;
+	text-decoration: none; color: @text;
+	font-family: @font-family;
+	font-size: @font-size; text-shadow: none; float: none;
+	position: static; width: auto; height: auto;
+	white-space: nowrap; cursor: inherit;
+	-webkit-tap-highlight-color: transparent;
+	line-height: normal; font-weight: normal;
+	text-align: left;
+	-moz-box-sizing: content-box;
+	-webkit-box-sizing: content-box;
+	box-sizing: content-box;
+	direction: ltr;
+	max-width: none;
+}
+
+.@{prefix}-widget button {
+	-moz-box-sizing: border-box;
+	-webkit-box-sizing: border-box;
+	box-sizing: border-box;
+}
+
+.@{prefix}-container *[unselectable] {
+	-moz-user-select: none;
+	-webkit-user-select: none;
+	-o-user-select: none;
+	user-select: none;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/ResizeHandle.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,18 @@
+.@{prefix}-container-body .@{prefix}-resizehandle {
+	position: absolute;
+	right: 0;
+	bottom: 0;
+	width: 16px;
+	height: 16px;
+	visibility: visible;
+	cursor: s-resize;
+	margin: 0;
+}
+
+.@{prefix}-container-body .@{prefix}-resizehandle-both {
+	cursor: se-resize;
+}
+
+i.@{prefix}-i-resize {
+	color: @text;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Scrollable.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,44 @@
+// Scrollbar
+
+.@{prefix}-scrollbar {
+	position: absolute;
+	width: 7px;
+	height: 100%;
+	top: 2px;
+	right: 2px;
+	.opacity(0.4);
+}
+
+.@{prefix}-scrollbar-h {
+	top: auto;
+	right: auto;
+	left: 2px;
+	bottom: 2px;
+	width: 100%;
+	height: 7px;
+}
+
+.@{prefix}-scrollbar-thumb {
+	position: absolute;
+	background-color: #000;
+	border: 1px solid #888;
+	border-color: rgba(85, 85, 85, .6);
+	width: 5px;
+	height: 100%;
+	.border-radius(7px);
+}
+
+.@{prefix}-scrollbar-h .@{prefix}-scrollbar-thumb {
+	width: 100%;
+	height: 5px;
+}
+
+.@{prefix}-scrollbar:hover, .@{prefix}-scrollbar.@{prefix}-active {
+	background-color: #AAA;
+	.opacity(0.6);
+	.border-radius(7px);
+}
+
+.@{prefix}-scroll {
+	position: relative;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Spacer.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,5 @@
+// Spacer
+
+.@{prefix}-spacer {
+	visibility: hidden;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/SplitButton.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,44 @@
+// SplitButton
+
+.@{prefix}-splitbtn .@{prefix}-open {
+	border-left: 1px solid transparent;
+	border-right: 1px solid transparent;
+}
+
+.@{prefix}-splitbtn:hover .@{prefix}-open {
+	border-left-color: @btn-split-border;
+	border-right-color: @btn-split-border;
+}
+
+.@{prefix}-splitbtn button {
+	padding-right: 4px;
+}
+
+.@{prefix}-splitbtn .@{prefix}-open {
+	padding-left: 4px;
+}
+
+.@{prefix}-splitbtn .@{prefix}-open.@{prefix}-active {
+	.box-shadow(inset 0 2px 4px rgba(0, 0, 0, .15), 0 1px 2px rgba(0, 0, 0 ,.05));
+}
+
+.@{prefix}-splitbtn.@{prefix}-btn-small .@{prefix}-open {
+	padding: 0 3px 0 3px;
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-splitbtn {
+	direction: rtl;
+	text-align: right;
+}
+
+.@{prefix}-rtl .@{prefix}-splitbtn button {
+	padding-right: 10px;
+	padding-left: 10px;
+}
+
+.@{prefix}-rtl .@{prefix}-splitbtn .@{prefix}-open {
+	padding-left: 4px;
+	padding-right: 4px;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/StackLayout.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,5 @@
+// StackLayout 
+
+.@{prefix}-stack-layout-item {
+	display: block;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/TabPanel.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,39 @@
+// TabPanel
+
+.@{prefix}-tabs {
+	display: block;
+	border-bottom: 1px solid @tab-border;
+}
+
+.@{prefix}-tab {
+	.inline-block();
+	border: 1px solid @tab-border;
+	border-width: 0 1px 0 0;
+	background: @tab-bg;
+	padding: 8px;
+	text-shadow: @text-shadow;
+	height: 13px;
+	cursor: pointer;
+}
+
+.@{prefix}-tab:hover {
+	background: @tab-bg-hover;
+}
+
+.@{prefix}-tab.@{prefix}-active {
+	background: @tab-bg-active;
+	border-bottom-color: transparent;
+	margin-bottom: -1px;
+	height: 14px;
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-tabs {
+	text-align: right;
+	direction: rtl;
+}
+
+.@{prefix}-rtl .@{prefix}-tab {
+	border-width: 0 0 0 1px;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/TextBox.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,40 @@
+// TextBox
+
+.@{prefix}-textbox {
+	background: @textbox-bg;
+	border: 1px solid @textbox-border;
+	.border-radius(3px);
+	.box-shadow(@textbox-box-shadow);
+	display: inline-block;
+	.transition(~"border linear .2s, box-shadow linear .2s");
+	height: 28px;
+	resize: none;
+	padding: 0 4px 0 4px;
+	white-space: pre-wrap;
+	*white-space: pre;
+	color: @text;
+}
+
+.@{prefix}-textbox:focus, .@{prefix}-textbox.@{prefix}-focus {
+	border-color: @textbox-border-focus;
+	.box-shadow(inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px fadeout(@textbox-border-focus, 15%));
+}
+
+.@{prefix}-placeholder .@{prefix}-textbox {
+	color: @textbox-text-placeholder;
+}
+
+.@{prefix}-textbox.@{prefix}-multiline {
+	padding: 4px;
+}
+
+.@{prefix}-textbox.@{prefix}-disabled {
+	color: mix(@text, @textbox-bg, 40%);
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-textbox {
+	text-align: right;
+	direction: rtl;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Throbber.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,14 @@
+// Throbber
+
+.@{prefix}-throbber {
+	position: absolute;
+	top: 0; left: 0;
+	width: 100%; height: 100%;
+	.opacity(0.6);
+	background: @throbber-bg;
+}
+
+.@{prefix}-throbber-inline {
+	position: static;
+	height: 50px;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/TinyMCE.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,151 @@
+.@{prefix}-tinymce {
+	// Avoid FOUC
+	visibility: inherit !important;
+	position: relative;
+}
+
+.@{prefix}-fullscreen {
+	border: 0; padding: 0; margin: 0;
+	overflow: hidden;
+	height: 100%;
+	z-index: 100;
+}
+
+div.@{prefix}-fullscreen {
+	position: fixed;
+	top: 0; left: 0;
+	width: 100%;
+	height: auto;
+}
+
+.@{prefix}-tinymce {
+	display: block;
+	.border-radius(2px);
+}
+
+.@{prefix}-wordcount {
+	position: absolute;
+	top: 0;
+	right: 0;
+	padding: 8px;
+}
+
+div.@{prefix}-edit-area {
+	background: #FFF;
+	filter: none;
+}
+
+.@{prefix}-statusbar {
+	position: relative;
+}
+
+.@{prefix}-statusbar .@{prefix}-container-body {
+	position: relative;
+}
+
+.@{prefix}-fullscreen .@{prefix}-resizehandle {
+	display: none;
+}
+
+// Charmap
+
+.@{prefix}-charmap {
+	border-collapse: collapse;
+}
+
+.@{prefix}-charmap td {
+	cursor: default;
+	border: 1px solid @panel-border;
+	width: 20px;
+	height: 20px;
+	line-height: 20px;
+	text-align: center;
+	vertical-align: middle;
+	padding: 2px;
+}
+
+.@{prefix}-charmap td div {
+	text-align: center;
+}
+
+.@{prefix}-charmap td:hover {
+	background: @btn-bg-hlight;
+}
+
+.@{prefix}-grid td.@{prefix}-grid-cell div {
+	border: 1px solid @grid-border;
+	width: 15px; height: 15px;
+	margin: 0px;
+	cursor: pointer;
+
+	&:focus {
+		border-color: @grid-border-active;
+	}
+
+	&[disabled] {
+		cursor: not-allowed;
+	}
+}
+
+.@{prefix}-grid {
+	border-spacing: 2px;
+	border-collapse: separate;
+
+	a {
+		display: block;
+		border: 1px solid transparent;
+
+		&:hover, &:focus {
+			border-color: @grid-border-active;
+		}
+	}
+}
+
+.@{prefix}-grid-border {
+	margin: 0 4px 0 4px;
+
+	a {
+		border-color: @grid-border;
+		width: 13px; height: 13px;
+	}
+
+	a:hover, a.@{prefix}-active {
+		border-color: @grid-border-active;
+		background: @grid-bg-active;
+	}
+}
+
+.@{prefix}-text-center {
+	text-align: center;
+}
+
+div.@{prefix}-tinymce-inline {
+	width: 100%;
+	.box-shadow(none);
+}
+
+.@{prefix}-colorbtn-trans div {
+	text-align: center;
+	vertical-align: middle;
+	font-weight: bold;
+	font-size: 20px;
+	line-height: 16px;
+	color: mix(@text, #fff, 70%);
+}
+
+// Reduce double margins between toolbar rows
+
+.@{prefix}-toolbar-grp {
+	padding-bottom: 2px;
+}
+
+.@{prefix}-toolbar-grp .@{prefix}-flow-layout-item {
+	margin-bottom: 0;
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-wordcount {
+	left: 0;
+	right: auto;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/ToolTip.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,129 @@
+// Tooltip
+
+.@{prefix}-tooltip {
+	position: absolute;
+	padding: 5px;
+	.opacity(0.8);
+}
+
+.@{prefix}-tooltip-inner {
+	font-size: @tooltip-font-size;
+	background-color: @tooltip-bg;
+	color: @tooltip-text;
+	max-width: 200px;
+	padding: 5px 8px 4px 8px;
+	text-align: center;
+	white-space: normal;
+}
+
+.@{prefix}-tooltip-inner {
+	.border-radius(3px);
+}
+
+.@{prefix}-tooltip-inner {
+	.box-shadow(0 0 5px @tooltip-bg);
+}
+
+.@{prefix}-tooltip-arrow {
+	position: absolute;
+	width: 0;
+	height: 0;
+	line-height: 0;
+	border: 5px dashed @tooltip-bg;
+}
+
+.@{prefix}-tooltip-arrow-n {
+	border-bottom-color: @tooltip-bg;
+}
+
+.@{prefix}-tooltip-arrow-s {
+	border-top-color: @tooltip-bg;
+}
+
+.@{prefix}-tooltip-arrow-e {
+	border-left-color: @tooltip-bg;
+}
+
+.@{prefix}-tooltip-arrow-w {
+	border-right-color: @tooltip-bg;
+}
+
+.@{prefix}-tooltip-nw, .@{prefix}-tooltip-sw {
+	margin-left: -14px;
+}
+
+.@{prefix}-tooltip-n .@{prefix}-tooltip-arrow {
+	top: 0px;
+	left: 50%;
+	margin-left: -5px;
+	border-bottom-style: solid;
+	border-top: none;
+	border-left-color: transparent;
+	border-right-color: transparent;
+}
+
+.@{prefix}-tooltip-nw .@{prefix}-tooltip-arrow {
+	top: 0;
+	left: 10px;
+	border-bottom-style: solid;
+	border-top: none;
+	border-left-color: transparent;
+	border-right-color: transparent;
+}
+
+.@{prefix}-tooltip-ne .@{prefix}-tooltip-arrow {
+	top: 0;
+	right: 10px;
+	border-bottom-style: solid;
+	border-top: none;
+	border-left-color: transparent;
+	border-right-color: transparent;
+}
+
+.@{prefix}-tooltip-s .@{prefix}-tooltip-arrow {
+	bottom: 0;
+	left: 50%;
+	margin-left: -5px;
+	border-top-style: solid;
+	border-bottom: none;
+	border-left-color: transparent;
+	border-right-color: transparent;
+}
+
+.@{prefix}-tooltip-sw .@{prefix}-tooltip-arrow {
+	bottom: 0;
+	left: 10px;
+	border-top-style: solid;
+	border-bottom: none;
+	border-left-color: transparent;
+	border-right-color: transparent;
+}
+
+.@{prefix}-tooltip-se .@{prefix}-tooltip-arrow {
+	bottom: 0;
+	right: 10px;
+	border-top-style: solid;
+	border-bottom: none;
+	border-left-color: transparent;
+	border-right-color: transparent;
+}
+
+.@{prefix}-tooltip-e .@{prefix}-tooltip-arrow {
+	right: 0;
+	top: 50%;
+	margin-top: -5px;
+	border-left-style: solid;
+	border-right: none;
+	border-top-color: transparent;
+	border-bottom-color: transparent;
+}
+
+.@{prefix}-tooltip-w .@{prefix}-tooltip-arrow {
+	left: 0;
+	top: 50%;
+	margin-top: -5px;
+	border-right-style: solid;
+	border-left: none;
+	border-top-color: transparent;
+	border-bottom-color: transparent;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Variables.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,147 @@
+// Variables
+// Syntax: <control>-(<sub control>)-<bg|border|text>-(<state>)-(<extra>);
+// Example: @btn-primary-bg-hover-hlight;
+
+@prefix:                         mce;
+
+// Default font
+@font-family:                    "Helvetica Neue", Helvetica, Arial, sans-serif;
+@font-size:                      14px;
+@line-height:                    20px;
+@has-gradients:                  true;
+@has-radius:                     true;
+@has-boxshadow:                  true;
+
+// Text colors
+@text:                           #333;
+@text-inverse:                   white;
+@text-disabled:                  #aaa;
+@text-shadow:                    0 1px 1px hsla(hue(@text-inverse), saturation(@text-inverse), lightness(@text-inverse), 0.75);
+@text-error:                     #aa0000;
+
+// Button
+@btn-text:                       @text;
+@btn-text-shadow:                @text-inverse;
+@btn-border-top:                 rgba(0, 0, 0, .1);
+@btn-border-right:               rgba(0, 0, 0, .1);
+@btn-border-bottom:              fadein(rgba(0, 0, 0, .1), 15%);
+@btn-border-left:                fadein(rgba(0, 0, 0, .1), 15%);
+@btn-split-border:               #bdbdbd;
+@btn-caret-border:               @btn-text;
+@btn-text-disabled:              @text-disabled;
+@btn-box-shadow:                 inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 2px rgba(0, 0, 0, .05);
+@btn-box-shadow-active:          inset 0 2px 4px rgba(0, 0, 0, .15), 0 1px 2px rgba(0, 0, 0, .05);
+@btn-box-disabled-opacity:       0.4;
+@btn-bg:                         white;
+@btn-bg-hlight:                  #D9D9D9;
+@btn-bg-hover:                   darken(@btn-bg, 5%);
+@btn-bg-hlight-hover:            darken(@btn-bg-hlight, 5%);
+
+@btn-primary-bg:                 #0088cc;
+@btn-primary-bg-hlight:          #0044cc;
+@btn-primary-bg-hover:           darken(@btn-primary-bg, 5%);
+@btn-primary-bg-hover-hlight:    darken(@btn-primary-bg-hlight, 5%);
+@btn-primary-text:               #fff;
+@btn-primary-text-shadow:        #333;
+@btn-primary-border-top:         mix(@btn-border-top, @btn-primary-bg, 50%);
+@btn-primary-border-right:       mix(@btn-border-right, @btn-primary-bg, 50%);
+@btn-primary-border-bottom:      mix(@btn-border-bottom, @btn-primary-bg, 50%);
+@btn-primary-border-left:        mix(@btn-border-left, @btn-primary-bg, 50%);
+
+// Menu
+@menuitem-text:                  @text;
+@menu-bg:                        #fff;
+@menu-border:                    rgba(0, 0, 0, 0.2);
+@menubar-border:                 mix(@panel-border, @panel-bg, 60%);
+@menuitem-text-inverse:          @text-inverse;
+@menubar-bg-active:              darken(@btn-bg, 10%);
+@menuitem-bg-hover:              #0081C2;
+@menuitem-bg-selected:           #08C;
+@menuitem-bg-selected-hlight:    #0077B3;
+@menuitem-bg-disabled:           #CCC;
+@menuitem-caret:                 @menuitem-text;
+@menuitem-caret-selected:        @menuitem-text-inverse;
+@menuitem-separator-top:         #CBCBCB;
+@menuitem-separator-bottom:      @menu-bg;
+@menuitem-bg-active:             #C8DEF4;
+@menuitem-text-active:           @text;
+@menuitem-preview-border-active: #aaa;
+
+// Panel
+@panel-border:                   #9E9E9E;
+@panel-bg:                       #FDFDFD;
+@panel-bg-hlight:                #DDD;
+
+// Tabs
+@tab-border:                     #c5c5c5;
+@tab-bg:                         #e3e3e3;
+@tab-bg-hover:                   #FDFDFD;
+@tab-bg-active:                  #FDFDFD;
+
+// Tooltip
+@tooltip-bg:                     #000;
+@tooltip-text:                   white;
+@tooltip-font-size:              11px;
+
+// Window
+@window-border:                  #c5c5c5;
+@window-head-border:             @window-border;
+@window-head-close:              mix(@text, @window-bg, 60%);
+@window-head-close-hover:        mix(@text, @window-bg, 40%);
+@window-foot-border:             @window-border;
+@window-foot-bg:                 @window-bg;
+@window-fullscreen-bg:           #FFF;
+@window-modalblock-bg:           #000;
+@window-modalblock-opacity:      0.3;
+@window-box-shadow:              0 3px 7px rgba(0, 0, 0, 0.3);
+@window-bg:                      #FFF;
+@window-title-font-size:         20px;
+
+// Popover
+@popover-bg:                     @window-bg;
+@popover-arrow-width:            10px;
+@popover-arrow:                  @window-bg;
+@popover-arrow-outer-width:      @popover-arrow-width + 1;
+@popover-arrow-outer:            rgba(0, 0, 0, 0.25);
+
+// Floatpanel
+@floatpanel-box-shadow:          0 5px 10px rgba(0, 0, 0, .2);
+
+// Checkbox
+@checkbox-bg:                    @btn-bg;
+@checkbox-bg-hlight:             @btn-bg-hlight;
+@checkbox-box-shadow:            inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 2px rgba(0, 0, 0, .05);
+@checkbox-border:                #c5c5c5;
+@checkbox-border-focus:          rgba(82, 168, 236, .8);
+
+// Path
+@path-text:                      @text;
+@path-bg-focus:                  #666;
+@path-text-focus:                #fff;
+
+// Textbox
+@textbox-text-placeholder:       #aaa;
+@textbox-box-shadow:             inset 0 1px 1px rgba(0, 0, 0, 0.075);
+@textbox-bg:                     #fff;
+@textbox-border:                 #c5c5c5;
+@textbox-border-focus:           rgba(82, 168, 236, .8);
+
+// Throbber
+@throbber-bg:                    #fff url('img/loader.gif') no-repeat center center;
+
+// Combobox
+@combobox-border:                @textbox-border;
+
+// Colorpicker
+@colorpicker-border:             @textbox-border;
+@colorpicker-hue-bg:             #fff;
+@colorpicker-hue-border:         #333;
+
+// Grid
+@grid-bg-active:                 @menuitem-bg-active;
+@grid-border-active:             #a1a1a1;
+@grid-border:                    #d6d6d6;
+
+// Misc
+@colorbtn-backcolor-bg:          #BBB;
+@iframe-border:                  @panel-border;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/Window.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,123 @@
+// Window
+
+.@{prefix}-fullscreen {
+	border: 0; padding: 0; margin: 0;
+	overflow: hidden;
+	background: @window-fullscreen-bg;
+	height: 100%;
+}
+
+div.@{prefix}-fullscreen {
+	position: fixed;
+	top: 0; left: 0;
+}
+
+#@{prefix}-modal-block {
+	.opacity(0);
+	position: fixed;
+	left: 0; top: 0;
+	width: 100%; height: 100%;
+	background: @window-modalblock-bg;
+}
+
+#@{prefix}-modal-block.@{prefix}-in {
+	.opacity(@window-modalblock-opacity);
+}
+
+.@{prefix}-window-move {
+	cursor: move;
+}
+
+.@{prefix}-window {
+	.border-radius(6px);
+	.box-shadow(@window-box-shadow);
+	.reset-gradient();
+	background: @window-bg;
+	position: fixed;
+	top: 0; left: 0;
+	opacity: 0;
+	.transition(opacity 150ms ease-in);
+}
+
+.@{prefix}-window.@{prefix}-in {
+	opacity: 1;
+}
+
+.@{prefix}-window-head {
+	padding: 9px 15px;
+	border-bottom: 1px solid @window-head-border;
+	position: relative;
+}
+
+.@{prefix}-window-head .@{prefix}-close {
+	position: absolute;
+	right: 15px;
+	top: 9px;
+	font-size: 20px;
+	font-weight: bold;
+	line-height: 20px;
+	color: @window-head-close;
+	cursor: pointer;
+
+	// IE7
+	height: 20px;
+	overflow: hidden;
+}
+
+.@{prefix}-close:hover {
+	color: @window-head-close-hover;
+}
+
+.@{prefix}-window-head .@{prefix}-title {
+	line-height: 20px;
+	font-size: @window-title-font-size;
+	font-weight: bold;
+	text-rendering: optimizelegibility;
+	padding-right: 10px;
+}
+
+.@{prefix}-window .@{prefix}-container-body {
+	display: block;
+}
+
+.@{prefix}-foot {
+	display: block;
+	background-color: @window-foot-bg;
+	border-top: 1px solid @window-foot-border;
+	.border-radius(0 0 6px 6px);
+}
+
+.@{prefix}-window-head .@{prefix}-dragh {
+	position: absolute;
+	top: 0; left: 0;
+	cursor: move;
+	width: 90%;
+	height: 100%;
+}
+
+.@{prefix}-window iframe {
+	width: 100%;
+	height: 100%;
+}
+
+.@{prefix}-window.@{prefix}-fullscreen, .@{prefix}-window.@{prefix}-fullscreen .@{prefix}-foot {
+	.border-radius(0);
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-window-head .@{prefix}-close {
+	position: absolute;
+	right: auto;
+	left: 15px;
+}
+
+.@{prefix}-rtl .@{prefix}-window-head .@{prefix}-dragh {
+	left: auto;
+	right: 0;
+}
+
+.@{prefix}-rtl .@{prefix}-window-head .@{prefix}-title {
+	direction: rtl;
+	text-align: right;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/content.inline.min.css	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+.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;page-break-before:always}@media print{.mce-pagebreak{border:0}}.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;user-select:all;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,.mce-shy{background:#AAA}.mce-shy::after{content:'-'}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-spellchecker-word{border-bottom:2px solid red;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid green;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}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/content.min.css	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+body{background-color:#FFF;color:#000;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;page-break-before:always}@media print{.mce-pagebreak{border:0}}.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;user-select:all;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,.mce-shy{background:#AAA}.mce-shy::after{content:'-'}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-spellchecker-word{border-bottom:2px solid red;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid green;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}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/readme.md	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+Icons are generated and provided by the http://icomoon.io service.
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/tinymce-small.eot has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/tinymce-small.json	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1194 @@
+{
+	"IcoMoonType": "selection",
+	"icons": [
+		{
+			"icon": {
+				"paths": [
+					"M704 832v-37.004c151.348-61.628 256-193.82 256-346.996 0-212.078-200.576-384-448-384s-448 171.922-448 384c0 153.176 104.654 285.368 256 346.996v37.004h-192l-64-96v224h320v-222.812c-100.9-51.362-170.666-161.54-170.666-289.188 0-176.732 133.718-320 298.666-320 164.948 0 298.666 143.268 298.666 320 0 127.648-69.766 237.826-170.666 289.188v222.812h320v-224l-64 96h-192z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57376,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 0,
+				"order": 1,
+				"prevSize": 32,
+				"code": 57376,
+				"name": "charmap",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 0
+		},
+		{
+			"icon": {
+				"paths": [
+					"M256 64v896l256-256 256 256v-896h-512zM704 789.49l-192-192-192 192v-661.49h384v661.49z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57363,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 1,
+				"order": 2,
+				"prevSize": 32,
+				"code": 57363,
+				"name": "bookmark",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 1
+		},
+		{
+			"icon": {
+				"paths": [
+					"M927.274 230.216l-133.49-133.488c-21.104-21.104-49.232-32.728-79.198-32.728s-58.094 11.624-79.196 32.726l-165.492 165.49c-43.668 43.668-43.668 114.724 0 158.392l2.746 2.746 67.882-67.882-2.746-2.746c-6.132-6.132-6.132-16.494 0-22.626l165.492-165.492c4.010-4.008 8.808-4.608 11.312-4.608s7.302 0.598 11.312 4.61l133.49 133.488c6.132 6.134 6.132 16.498 0.002 22.628l-165.494 165.494c-4.008 4.008-8.806 4.608-11.31 4.608s-7.302-0.6-11.312-4.612l-2.746-2.746-67.88 67.884 2.742 2.742c21.106 21.108 49.23 32.728 79.2 32.728s58.094-11.624 79.196-32.726l165.494-165.492c43.662-43.666 43.662-114.72-0.004-158.39zM551.356 600.644l-67.882 67.882 2.746 2.746c4.008 4.008 4.61 8.806 4.61 11.31 0 2.506-0.598 7.302-4.606 11.314l-165.494 165.49c-4.010 4.010-8.81 4.61-11.314 4.61s-7.304-0.6-11.314-4.61l-133.492-133.486c-4.010-4.010-4.61-8.81-4.61-11.314s0.598-7.3 4.61-11.312l165.49-165.488c4.010-4.012 8.81-4.612 11.314-4.612s7.304 0.6 11.314 4.612l2.746 2.742 67.882-67.88-2.746-2.746c-21.104-21.104-49.23-32.726-79.196-32.726s-58.092 11.624-79.196 32.726l-165.488 165.486c-21.106 21.104-32.73 49.234-32.73 79.198s11.624 58.094 32.726 79.198l133.49 133.49c21.106 21.102 49.232 32.726 79.198 32.726s58.092-11.624 79.196-32.726l165.494-165.492c21.104-21.104 32.722-49.23 32.722-79.196s-11.624-58.094-32.726-79.196l-2.744-2.746zM800 838c-9.724 0-19.45-3.708-26.87-11.13l-128-127.998c-14.844-14.84-14.844-38.898 0-53.738 14.84-14.844 38.896-14.844 53.736 0l128 128c14.844 14.84 14.844 38.896 0 53.736-7.416 7.422-17.142 11.13-26.866 11.13zM608 960c-17.674 0-32-14.326-32-32v-128c0-17.674 14.326-32 32-32s32 14.326 32 32v128c0 17.674-14.326 32-32 32zM928 640h-128c-17.674 0-32-14.326-32-32s14.326-32 32-32h128c17.674 0 32 14.326 32 32s-14.326 32-32 32zM224 186c9.724 0 19.45 3.708 26.87 11.13l128 128c14.842 14.84 14.842 38.898 0 53.738-14.84 14.844-38.898 14.844-53.738 0l-128-128c-14.842-14.84-14.842-38.898 0-53.738 7.418-7.422 17.144-11.13 26.868-11.13zM416 64c17.674 0 32 14.326 32 32v128c0 17.674-14.326 32-32 32s-32-14.326-32-32v-128c0-17.674 14.326-32 32-32zM96 384h128c17.674 0 32 14.326 32 32s-14.326 32-32 32h-128c-17.674 0-32-14.326-32-32s14.326-32 32-32z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57362,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 2,
+				"order": 3,
+				"prevSize": 32,
+				"code": 57362,
+				"name": "link",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 2
+		},
+		{
+			"icon": {
+				"paths": [
+					"M927.274 230.216l-133.49-133.488c-21.104-21.104-49.232-32.728-79.198-32.728s-58.094 11.624-79.196 32.726l-165.492 165.49c-43.668 43.668-43.668 114.724 0 158.392l2.746 2.746 67.882-67.882-2.746-2.746c-6.132-6.132-6.132-16.494 0-22.626l165.492-165.492c4.010-4.008 8.808-4.608 11.312-4.608s7.302 0.598 11.312 4.61l133.49 133.488c6.132 6.134 6.132 16.498 0.002 22.628l-165.494 165.494c-4.008 4.008-8.806 4.608-11.31 4.608s-7.302-0.6-11.312-4.612l-2.746-2.746-67.88 67.884 2.742 2.742c21.106 21.108 49.23 32.728 79.2 32.728s58.094-11.624 79.196-32.726l165.494-165.492c43.662-43.666 43.662-114.72-0.004-158.39zM551.356 600.644l-67.882 67.882 2.746 2.746c4.008 4.008 4.61 8.806 4.61 11.31 0 2.506-0.598 7.302-4.606 11.314l-165.494 165.49c-4.010 4.010-8.81 4.61-11.314 4.61s-7.304-0.6-11.314-4.61l-133.492-133.486c-4.010-4.010-4.61-8.81-4.61-11.314s0.598-7.3 4.61-11.312l165.49-165.488c4.010-4.012 8.81-4.612 11.314-4.612s7.304 0.6 11.314 4.612l2.746 2.742 67.882-67.88-2.746-2.746c-21.104-21.104-49.23-32.726-79.196-32.726s-58.092 11.624-79.196 32.726l-165.488 165.486c-21.106 21.104-32.73 49.234-32.73 79.198s11.624 58.094 32.726 79.198l133.49 133.49c21.106 21.102 49.232 32.726 79.198 32.726s58.092-11.624 79.196-32.726l165.494-165.492c21.104-21.104 32.722-49.23 32.722-79.196s-11.624-58.094-32.726-79.196l-2.744-2.746zM352 710c-9.724 0-19.45-3.71-26.87-11.128-14.84-14.84-14.84-38.898 0-53.738l320-320c14.84-14.84 38.896-14.84 53.736 0 14.844 14.84 14.844 38.9 0 53.74l-320 320c-7.416 7.416-17.142 11.126-26.866 11.126z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57361,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 3,
+				"order": 4,
+				"prevSize": 32,
+				"code": 57361,
+				"name": "unlink",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 3
+		},
+		{
+			"icon": {
+				"paths": [
+					"M576 281.326v-217.326l336.002 336-336.002 336v-222.096c-390.906-9.17-315 247.096-256 446.096-288-320-212.092-690.874 256-678.674z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57360,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 4,
+				"order": 5,
+				"prevSize": 32,
+				"code": 57360,
+				"name": "redo",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 4
+		},
+		{
+			"icon": {
+				"paths": [
+					"M704 960c59-199 134.906-455.266-256-446.096v222.096l-336.002-336 336.002-336v217.326c468.092-12.2 544 358.674 256 678.674z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57359,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 5,
+				"order": 6,
+				"prevSize": 32,
+				"code": 57359,
+				"name": "undo",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 5
+		},
+		{
+			"icon": {
+				"paths": [
+					"M256.428 424.726c105.8 0 191.572 91.17 191.572 203.638 0 112.464-85.772 203.636-191.572 203.636-105.802 0-191.572-91.17-191.572-203.636l-0.856-29.092c0-224.93 171.54-407.272 383.144-407.272v116.364c-73.1 0-141.826 30.26-193.516 85.204-9.954 10.578-19.034 21.834-27.224 33.656 9.784-1.64 19.806-2.498 30.024-2.498zM768.428 424.726c105.8 0 191.572 91.17 191.572 203.638 0 112.464-85.772 203.636-191.572 203.636-105.802 0-191.572-91.17-191.572-203.636l-0.856-29.092c0-224.93 171.54-407.272 383.144-407.272v116.364c-73.1 0-141.826 30.26-193.516 85.204-9.956 10.578-19.036 21.834-27.224 33.656 9.784-1.64 19.806-2.498 30.024-2.498z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57358,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 6,
+				"order": 7,
+				"prevSize": 32,
+				"code": 57358,
+				"name": "blockquote",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 6
+		},
+		{
+			"icon": {
+				"paths": [
+					"M64 192h896v128h-896zM384 576h576v128h-576zM384 384h576v128h-576zM64 768h896v128h-896zM64 384l224 160-224 160z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57356,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 7,
+				"order": 8,
+				"prevSize": 32,
+				"code": 57356,
+				"name": "indent",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 7
+		},
+		{
+			"icon": {
+				"paths": [
+					"M64 192h896v128h-896zM64 576h576v128h-576zM64 384h576v128h-576zM64 768h896v128h-896zM960 384l-224 160 224 160z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57357,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 8,
+				"order": 9,
+				"prevSize": 32,
+				"code": 57357,
+				"name": "outdent",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 8
+		},
+		{
+			"icon": {
+				"paths": [
+					"M384 128h576v128h-576zM384 448h576v128h-576zM384 768h576v128h-576zM320 530v-146h-64v-320h-128v64h64v256h-64v64h128v50l-128 60v146h128v64h-128v64h128v64h-128v64h192v-320h-128v-50z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57355,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 9,
+				"order": 10,
+				"prevSize": 32,
+				"code": 57355,
+				"name": "numlist",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 9
+		},
+		{
+			"icon": {
+				"paths": [
+					"M384 128h576v128h-576zM384 448h576v128h-576zM384 768h576v128h-576zM128 192c0 35.346 28.654 64 64 64s64-28.654 64-64c0-35.346-28.654-64-64-64-35.346 0-64 28.654-64 64zM128 512c0 35.346 28.654 64 64 64s64-28.654 64-64c0-35.346-28.654-64-64-64-35.346 0-64 28.654-64 64zM128 832c0 35.346 28.654 64 64 64s64-28.654 64-64c0-35.346-28.654-64-64-64-35.346 0-64 28.654-64 64z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57354,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 10,
+				"order": 11,
+				"prevSize": 32,
+				"code": 57354,
+				"name": "bullist",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 10
+		},
+		{
+			"icon": {
+				"paths": [
+					"M888 384h-56v-256h64v-64h-320v64h64v256h-256v-256h64v-64h-320v64h64v256h-56c-39.6 0-72 32.4-72 72v432c0 39.6 32.4 72 72 72h240c39.6 0 72-32.4 72-72v-312h128v312c0 39.6 32.4 72 72 72h240c39.6 0 72-32.4 72-72v-432c0-39.6-32.4-72-72-72zM348 896h-184c-19.8 0-36-14.4-36-32s16.2-32 36-32h184c19.8 0 36 14.4 36 32s-16.2 32-36 32zM544 512h-64c-17.6 0-32-14.4-32-32s14.4-32 32-32h64c17.6 0 32 14.4 32 32s-14.4 32-32 32zM860 896h-184c-19.8 0-36-14.4-36-32s16.2-32 36-32h184c19.8 0 36 14.4 36 32s-16.2 32-36 32z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57353,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 11,
+				"order": 12,
+				"prevSize": 32,
+				"code": 57353,
+				"name": "searchreplace",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 11
+		},
+		{
+			"icon": {
+				"paths": [
+					"M704 384v-160c0-17.6-14.4-32-32-32h-160v-64c0-35.2-28.8-64-64-64h-128c-35.204 0-64 28.8-64 64v64h-160c-17.602 0-32 14.4-32 32v512c0 17.6 14.398 32 32 32h224v192h384l192-192v-384h-192zM320 128.114c0.034-0.038 0.072-0.078 0.114-0.114h127.768c0.042 0.036 0.082 0.076 0.118 0.114l0 63.886h-128v-63.886zM192 320v-64h384v64h-384zM704 869.49v-101.49h101.49l-101.49 101.49zM832 704h-192v192h-256v-448h448v256z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57352,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 12,
+				"order": 13,
+				"prevSize": 32,
+				"code": 57352,
+				"name": "paste",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 12
+		},
+		{
+			"icon": {
+				"paths": [
+					"M832 320h-192v-64l-192-192h-384v704h384v192h576v-448l-192-192zM832 410.51l101.49 101.49h-101.49v-101.49zM448 154.51l101.49 101.49h-101.49v-101.49zM128 128h256v192h192v384h-448v-576zM960 896h-448v-128h128v-384h128v192h192v320z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57393,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 13,
+				"order": 14,
+				"prevSize": 32,
+				"code": 57393,
+				"name": "copy",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 13
+		},
+		{
+			"icon": {
+				"paths": [
+					"M960 512h-265.876c-50.078-35.42-114.43-54.86-182.124-54.86-89.206 0-164.572-50.242-164.572-109.712 0-59.47 75.366-109.714 164.572-109.714 75.058 0 140.308 35.576 159.12 82.286h113.016c-7.93-50.644-37.58-97.968-84.058-132.826-50.88-38.16-117.676-59.174-188.078-59.174-70.404 0-137.196 21.014-188.074 59.174-54.788 41.090-86.212 99.502-86.212 160.254s31.424 119.164 86.212 160.254c1.956 1.466 3.942 2.898 5.946 4.316h-265.872v64h512.532c58.208 17.106 100.042 56.27 100.042 100.572 0 59.468-75.368 109.71-164.572 109.71-75.060 0-140.308-35.574-159.118-82.286h-113.016c7.93 50.64 37.582 97.968 84.060 132.826 50.876 38.164 117.668 59.18 188.072 59.18 70.402 0 137.198-21.016 188.074-59.174 54.79-41.090 86.208-99.502 86.208-160.254 0-35.298-10.654-69.792-30.294-100.572h204.012v-64z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57389,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 19,
+				"order": 15,
+				"prevSize": 32,
+				"code": 57389,
+				"name": "strikethrough",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 14
+		},
+		{
+			"icon": {
+				"paths": [
+					"M192 832h576v64h-576v-64zM640 128v384c0 31.312-14.7 61.624-41.39 85.352-30.942 27.502-73.068 42.648-118.61 42.648-45.544 0-87.668-15.146-118.608-42.648-26.692-23.728-41.392-54.040-41.392-85.352v-384h-128v384c0 141.382 128.942 256 288 256s288-114.618 288-256v-384h-128z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57388,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 20,
+				"order": 16,
+				"prevSize": 32,
+				"code": 57388,
+				"name": "underline",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 15
+		},
+		{
+			"icon": {
+				"paths": [
+					"M832 128v64h-144l-256 640h144v64h-448v-64h144l256-640h-144v-64h448z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57387,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 21,
+				"order": 17,
+				"prevSize": 32,
+				"code": 57387,
+				"name": "italic",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 16
+		},
+		{
+			"icon": {
+				"paths": [
+					"M625.442 494.182c48.074-38.15 78.558-94.856 78.558-158.182 0-114.876-100.29-208-224-208h-224v768h288c123.712 0 224-93.124 224-208 0-88.196-59.118-163.562-142.558-193.818zM384 304c0-26.51 21.49-48 48-48h67.204c42.414 0 76.796 42.98 76.796 96s-34.382 96-76.796 96h-115.204v-144zM547.2 768h-115.2c-26.51 0-48-21.49-48-48v-144h163.2c42.418 0 76.8 42.98 76.8 96s-34.382 96-76.8 96z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57386,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 22,
+				"order": 18,
+				"prevSize": 32,
+				"code": 57386,
+				"name": "bold",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 17
+		},
+		{
+			"icon": {
+				"paths": [
+					"M850.746 242.746l-133.492-133.49c-24.888-24.892-74.054-45.256-109.254-45.256h-416c-35.2 0-64 28.8-64 64v768c0 35.2 28.8 64 64 64h640c35.2 0 64-28.8 64-64v-544c0-35.2-20.366-84.364-45.254-109.254zM805.49 287.998c6.792 6.796 13.792 19.162 18.894 32.002h-184.384v-184.386c12.84 5.1 25.204 12.1 32 18.896l133.49 133.488zM831.884 896h-639.77c-0.040-0.034-0.082-0.076-0.114-0.116v-767.77c0.034-0.040 0.076-0.082 0.114-0.114h383.886v256h256v511.884c-0.034 0.040-0.076 0.082-0.116 0.116z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57345,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 23,
+				"order": 19,
+				"prevSize": 32,
+				"code": 57345,
+				"name": "newdocument",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 18
+		},
+		{
+			"icon": {
+				"paths": [
+					"M960 880v-591.938l-223.938-224.062h-592.062c-44.182 0-80 35.816-80 80v736c0 44.184 35.818 80 80 80h736c44.184 0 80-35.816 80-80zM576 192h64v192h-64v-192zM704 832h-384v-255.882c0.034-0.042 0.076-0.082 0.116-0.118h383.77c0.040 0.036 0.082 0.076 0.116 0.118l-0.002 255.882zM832 832h-64v-256c0-35.2-28.8-64-64-64h-384c-35.2 0-64 28.8-64 64v256h-64v-640h64v192c0 35.2 28.8 64 64 64h320c35.2 0 64-28.8 64-64v-171.010l128 128.072v490.938z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57344,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 24,
+				"order": 20,
+				"prevSize": 32,
+				"code": 57344,
+				"name": "save",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 19
+		},
+		{
+			"icon": {
+				"paths": [
+					"M64 192v704h896v-704h-896zM384 640v-128h256v128h-256zM640 704v128h-256v-128h256zM640 320v128h-256v-128h256zM320 320v128h-192v-128h192zM128 512h192v128h-192v-128zM704 512h192v128h-192v-128zM704 448v-128h192v128h-192zM128 704h192v128h-192v-128zM704 832v-128h192v128h-192z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57371,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 25,
+				"order": 21,
+				"prevSize": 32,
+				"code": 57371,
+				"name": "table",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 20
+		},
+		{
+			"icon": {
+				"paths": [
+					"M512 140c99.366 0 192.782 38.694 263.042 108.956s108.958 163.678 108.958 263.044-38.696 192.782-108.958 263.042-163.676 108.958-263.042 108.958-192.782-38.696-263.044-108.958-108.956-163.676-108.956-263.042 38.694-192.782 108.956-263.044 163.678-108.956 263.044-108.956zM512 64c-247.424 0-448 200.576-448 448s200.576 448 448 448 448-200.576 448-448-200.576-448-448-448v0zM320 384c0 35.346 28.654 64 64 64s64-28.654 64-64c0-35.346-28.654-64-64-64-35.346 0-64 28.654-64 64zM576 384c0 35.346 28.654 64 64 64s64-28.654 64-64c0-35.346-28.654-64-64-64-35.346 0-64 28.654-64 64zM512 656c-101.84 0-192.56-36.874-251.166-94.328 23.126 117.608 126.778 206.328 251.166 206.328 124.388 0 228.040-88.72 251.168-206.328-58.608 57.454-149.328 94.328-251.168 94.328z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57377,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 26,
+				"order": 22,
+				"prevSize": 32,
+				"code": 57377,
+				"name": "emoticons",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 21
+		},
+		{
+			"icon": {
+				"paths": [
+					"M480 384l-192-192 128-128h-352v352l128-128 192 192zM640 480l192-192 128 128v-352h-352l128 128-192 192zM544 640l192 192-128 128h352v-352l-128 128-192-192zM384 544l-192 192-128-128v352h352l-128-128 192-192z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57379,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 27,
+				"order": 23,
+				"prevSize": 32,
+				"code": 57379,
+				"name": "fullscreen",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 22
+		},
+		{
+			"icon": {
+				"paths": [
+					"M64 448h896v128h-896z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57372,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 28,
+				"order": 24,
+				"prevSize": 32,
+				"code": 57372,
+				"name": "hr",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 23
+		},
+		{
+			"icon": {
+				"paths": [
+					"M64 768h512v128h-512v-128zM768 192h-220.558l-183.766 512h-132.288l183.762-512h-223.15v-128h576v128zM929.774 896l-129.774-129.774-129.774 129.774-62.226-62.226 129.774-129.774-129.774-129.774 62.226-62.226 129.774 129.774 129.774-129.774 62.226 62.226-129.774 129.774 129.774 129.774-62.226 62.226z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57373,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 29,
+				"order": 25,
+				"prevSize": 32,
+				"code": 57373,
+				"name": "removefromat",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 24
+		},
+		{
+			"icon": {
+				"paths": [
+					"M256 128h512v128h-512v-128zM896 320h-768c-35.2 0-64 28.8-64 64v256c0 35.2 28.796 64 64 64h128v192h512v-192h128c35.2 0 64-28.8 64-64v-256c0-35.2-28.8-64-64-64zM704 832h-384v-256h384v256zM910.4 416c0 25.626-20.774 46.4-46.398 46.4s-46.402-20.774-46.402-46.4 20.778-46.4 46.402-46.4c25.626 0 46.398 20.774 46.398 46.4z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57378,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 30,
+				"order": 26,
+				"prevSize": 32,
+				"code": 57378,
+				"name": "print",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 25
+		},
+		{
+			"icon": {
+				"paths": [
+					"M384 128c-123.712 0-224 100.288-224 224s100.288 224 224 224v320h128v-640h64v640h128v-640h128v-128h-448z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57390,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 31,
+				"order": 27,
+				"prevSize": 32,
+				"code": 57390,
+				"name": "visualchars",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 26
+		},
+		{
+			"icon": {
+				"paths": [
+					"M448 128c-123.712 0-224 100.288-224 224s100.288 224 224 224v320h128v-640h64v640h128v-640h128v-128h-448zM64 896l224-192-224-192z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57391,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 32,
+				"order": 28,
+				"prevSize": 32,
+				"code": 57391,
+				"name": "ltr",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 27
+		},
+		{
+			"icon": {
+				"paths": [
+					"M416 704l-192-192 192-192-64-64-256 256 256 256zM672 256l-64 64 192 192-192 192 64 64 256-256z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57367,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 38,
+				"order": 29,
+				"prevSize": 32,
+				"code": 57367,
+				"name": "code",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 28
+		},
+		{
+			"icon": {
+				"paths": [
+					"M448 704h128v128h-128v-128zM704 256c35.346 0 64 28.654 64 64v166l-228 154h-92v-64l192-128v-64h-320v-128h384zM512 64c-119.666 0-232.166 46.6-316.784 131.216-84.614 84.618-131.216 197.118-131.216 316.784 0 119.664 46.602 232.168 131.216 316.784 84.618 84.616 197.118 131.216 316.784 131.216 119.664 0 232.168-46.6 316.784-131.216 84.616-84.616 131.216-197.12 131.216-316.784 0-119.666-46.6-232.166-131.216-316.784-84.616-84.616-197.12-131.216-316.784-131.216z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57366,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 39,
+				"order": 30,
+				"prevSize": 32,
+				"code": 57366,
+				"name": "help",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 29
+		},
+		{
+			"icon": {
+				"paths": [
+					"M896 128h-768c-35.2 0-64 28.8-64 64v640c0 35.2 28.8 64 64 64h768c35.2 0 64-28.8 64-64v-640c0-35.2-28.8-64-64-64zM896 831.884c-0.012 0.014-0.030 0.028-0.042 0.042l-191.958-319.926-160 128-224-288-191.968 479.916c-0.010-0.010-0.022-0.022-0.032-0.032v-639.77c0.034-0.040 0.076-0.082 0.114-0.114h767.77c0.040 0.034 0.082 0.076 0.116 0.116v639.768zM640 352c0 53.019 42.981 96 96 96s96-42.981 96-96c0-53.019-42.981-96-96-96-53.019 0-96 42.981-96 96z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57364,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 40,
+				"order": 31,
+				"prevSize": 32,
+				"code": 57364,
+				"name": "image",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 30
+		},
+		{
+			"icon": {
+				"paths": [
+					"M896 128h-768c-35.2 0-64 28.8-64 64v640c0 35.2 28.8 64 64 64h768c35.2 0 64-28.8 64-64v-640c0-35.2-28.8-64-64-64zM256 832h-128v-128h128v128zM256 576h-128v-128h128v128zM256 320h-128v-128h128v128zM704 832h-384v-640h384v640zM896 832h-128v-128h128v128zM896 576h-128v-128h128v128zM896 320h-128v-128h128v128zM384 320v384l288-192z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57365,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 41,
+				"order": 32,
+				"prevSize": 32,
+				"code": 57365,
+				"name": "media",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 31
+		},
+		{
+			"icon": {
+				"paths": [
+					"M77.798 304.624l81.414 50.882c50.802-81.114 128.788-143.454 221.208-174.246l-30.366-91.094c-113.748 37.898-209.728 114.626-272.256 214.458zM673.946 90.166l-30.366 91.094c92.422 30.792 170.404 93.132 221.208 174.248l81.412-50.882c-62.526-99.834-158.506-176.562-272.254-214.46zM607.974 704.008c-4.808 0-9.692-1.090-14.286-3.386l-145.688-72.844v-211.778c0-17.672 14.328-32 32-32s32 14.328 32 32v172.222l110.31 55.156c15.806 7.902 22.214 27.124 14.31 42.932-5.604 11.214-16.908 17.696-28.646 17.698zM512 192c-212.078 0-384 171.922-384 384s171.922 384 384 384c212.078 0 384-171.922 384-384 0-212.078-171.922-384-384-384zM512 864c-159.058 0-288-128.942-288-288s128.942-288 288-288c159.058 0 288 128.942 288 288 0 159.058-128.942 288-288 288z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57368,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 42,
+				"order": 33,
+				"prevSize": 32,
+				"code": 57368,
+				"name": "insertdatetime",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 32
+		},
+		{
+			"icon": {
+				"paths": [
+					"M64 455.746c45.318-49.92 97.162-92.36 153.272-125.124 90.332-52.744 192.246-80.622 294.728-80.622 102.48 0 204.396 27.878 294.726 80.624 56.112 32.764 107.956 75.204 153.274 125.124v-117.432c-33.010-28.118-68.124-53.14-104.868-74.594-105.006-61.314-223.658-93.722-343.132-93.722s-238.128 32.408-343.134 93.72c-36.742 21.454-71.856 46.478-104.866 74.596v117.43zM512 320c-183.196 0-345.838 100.556-448 256 102.162 155.448 264.804 256 448 256 183.196 0 345.838-100.552 448-256-102.162-155.444-264.804-256-448-256zM512 512c0 35.346-28.654 64-64 64s-64-28.654-64-64c0-35.348 28.654-64 64-64s64 28.652 64 64zM728.066 696.662c-67.434 39.374-140.128 59.338-216.066 59.338s-148.632-19.964-216.066-59.338c-51.554-30.104-98.616-71.31-138.114-120.662 39.498-49.35 86.56-90.558 138.116-120.66 13.276-7.752 26.758-14.74 40.426-20.982-10.512 23.742-16.362 50.008-16.362 77.642 0 106.040 85.962 192 192 192 106.040 0 192-85.96 192-192 0-27.634-5.85-53.9-16.36-77.642 13.668 6.244 27.15 13.23 40.426 20.982 51.554 30.102 98.616 71.31 138.116 120.66-39.498 49.352-86.56 90.558-138.116 120.662z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57369,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 43,
+				"order": 34,
+				"prevSize": 32,
+				"code": 57369,
+				"name": "preview",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 33
+		},
+		{
+			"icon": {
+				"paths": [
+					"M651.168 283.834c-24.612-81.962-28.876-91.834-107.168-91.834h-64c-79.618 0-82.664 10.152-108.418 96 0 0.002 0 0.002-0.002 0.004l-143.998 479.996h113.636l57.6-192h226.366l57.6 192h113.63l-145.246-484.166zM437.218 448l38.4-136c10.086-33.618 36.38-30 36.38-30s26.294-3.618 36.38 30h0.004l38.4 136h-149.564z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57370,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 44,
+				"order": 35,
+				"prevSize": 32,
+				"code": 57370,
+				"name": "forecolor",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 34
+		},
+		{
+			"icon": {
+				"paths": [
+					"M576 64c247.424 0 448 200.576 448 448s-200.576 448-448 448v-96c94.024 0 182.418-36.614 248.902-103.098 66.484-66.484 103.098-154.878 103.098-248.902 0-94.022-36.614-182.418-103.098-248.902-66.484-66.484-154.878-103.098-248.902-103.098-94.022 0-182.418 36.614-248.902 103.098-51.14 51.138-84.582 115.246-97.306 184.902h186.208l-224 256-224-256h164.57c31.060-217.102 217.738-384 443.43-384zM768 448v128h-256v-320h128v192z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57384,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 45,
+				"order": 36,
+				"prevSize": 32,
+				"code": 57384,
+				"name": "restoredraft",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 35
+		},
+		{
+			"icon": {
+				"paths": [
+					"M1024 592.458v-160.916l-159.144-15.914c-8.186-30.042-20.088-58.548-35.21-84.98l104.596-127.838-113.052-113.050-127.836 104.596c-26.434-15.124-54.942-27.026-84.982-35.208l-15.914-159.148h-160.916l-15.914 159.146c-30.042 8.186-58.548 20.086-84.98 35.208l-127.838-104.594-113.050 113.050 104.596 127.836c-15.124 26.432-27.026 54.94-35.21 84.98l-159.146 15.916v160.916l159.146 15.914c8.186 30.042 20.086 58.548 35.21 84.982l-104.596 127.836 113.048 113.048 127.838-104.596c26.432 15.124 54.94 27.028 84.98 35.21l15.916 159.148h160.916l15.914-159.144c30.042-8.186 58.548-20.088 84.982-35.21l127.836 104.596 113.048-113.048-104.596-127.836c15.124-26.434 27.028-54.942 35.21-84.98l159.148-15.92zM704 576l-128 128h-128l-128-128v-128l128-128h128l128 128v128z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57346,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 46,
+				"order": 37,
+				"prevSize": 32,
+				"code": 57346,
+				"name": "fullpage",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 36
+		},
+		{
+			"icon": {
+				"paths": [
+					"M768 206v50h128v64h-192v-146l128-60v-50h-128v-64h192v146zM676 256h-136l-188 188-188-188h-136l256 256-256 256h136l188-188 188 188h136l-256-256z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57375,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 47,
+				"order": 38,
+				"prevSize": 32,
+				"code": 57375,
+				"name": "superscript",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 37
+		},
+		{
+			"icon": {
+				"paths": [
+					"M768 910v50h128v64h-192v-146l128-60v-50h-128v-64h192v146zM676 256h-136l-188 188-188-188h-136l256 256-256 256h136l188-188 188 188h136l-256-256z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57374,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 48,
+				"order": 39,
+				"prevSize": 32,
+				"code": 57374,
+				"name": "subscript",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 38
+		},
+		{
+			"icon": {
+				"paths": [
+					"M704 384v-160c0-17.6-14.4-32-32-32h-160v-64c0-35.2-28.8-64-64-64h-128c-35.204 0-64 28.8-64 64v64h-160c-17.602 0-32 14.4-32 32v512c0 17.6 14.398 32 32 32h224v192h576v-576h-192zM320 128.114c0.034-0.038 0.072-0.078 0.114-0.114h127.768c0.042 0.036 0.082 0.076 0.118 0.114l0 63.886h-128v-63.886zM192 320v-64h384v64h-384zM832 896h-448v-448h448v448zM448 512v128h32l32-64h64v192h-48v64h160v-64h-48v-192h64l32 64h32v-128z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"pastetext"
+				],
+				"defaultCode": 57397,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 49,
+				"order": 40,
+				"prevSize": 32,
+				"code": 57397,
+				"name": "pastetext",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 39
+		},
+		{
+			"icon": {
+				"paths": [
+					"M768 256h64v64h-64zM640 384h64v64h-64zM640 512h64v64h-64zM640 640h64v64h-64zM512 512h64v64h-64zM512 640h64v64h-64zM384 640h64v64h-64zM768 384h64v64h-64zM768 512h64v64h-64zM768 640h64v64h-64zM768 768h64v64h-64zM640 768h64v64h-64zM512 768h64v64h-64zM384 768h64v64h-64zM256 768h64v64h-64z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"resize",
+					"dots"
+				],
+				"defaultCode": 57394,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 50,
+				"order": 41,
+				"prevSize": 32,
+				"code": 57394,
+				"name": "resize",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 40
+		},
+		{
+			"icon": {
+				"paths": [
+					"M928 128h-416l-32-64h-352l-64 128h896zM840.34 704h87.66l32-448h-896l64 640h356.080c-104.882-37.776-180.080-138.266-180.080-256 0-149.982 122.018-272 272-272 149.98 0 272 122.018 272 272 0 21.678-2.622 43.15-7.66 64zM874.996 849.75l-134.496-110.692c17.454-28.922 27.5-62.814 27.5-99.058 0-106.040-85.96-192-192-192s-192 85.96-192 192 85.96 192 192 192c36.244 0 70.138-10.046 99.058-27.5l110.692 134.496c22.962 26.678 62.118 28.14 87.006 3.252l5.492-5.492c24.888-24.888 23.426-64.044-3.252-87.006zM576 764c-68.484 0-124-55.516-124-124s55.516-124 124-124 124 55.516 124 124-55.516 124-124 124z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"browse"
+				],
+				"defaultCode": 57396,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 51,
+				"order": 42,
+				"prevSize": 32,
+				"code": 57396,
+				"name": "browse",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 41
+		},
+		{
+			"icon": {
+				"paths": [
+					"M864.408 670.132c-46.47-46.47-106.938-68.004-161.082-62.806l-63.326-63.326 192-192c0 0 128-128 0-256l-320 320-320-320c-128 128 0 256 0 256l192 192-63.326 63.326c-54.144-5.198-114.61 16.338-161.080 62.806-74.98 74.98-85.112 186.418-22.626 248.9 62.482 62.482 173.92 52.354 248.9-22.626 46.47-46.468 68.002-106.938 62.806-161.080l63.326-63.326 63.328 63.328c-5.196 54.144 16.336 114.61 62.806 161.078 74.978 74.98 186.418 85.112 248.898 22.626 62.488-62.482 52.356-173.918-22.624-248.9zM353.124 758.578c-2.212 24.332-15.020 49.826-35.14 69.946-22.212 22.214-51.080 35.476-77.218 35.476-10.524 0-25.298-2.228-35.916-12.848-21.406-21.404-17.376-73.132 22.626-113.136 22.212-22.214 51.080-35.476 77.218-35.476 10.524 0 25.298 2.228 35.916 12.848 13.112 13.11 13.47 32.688 12.514 43.19zM512 608c-35.346 0-64-28.654-64-64s28.654-64 64-64 64 28.654 64 64-28.654 64-64 64zM819.152 851.152c-10.62 10.62-25.392 12.848-35.916 12.848-26.138 0-55.006-13.262-77.218-35.476-20.122-20.12-32.928-45.614-35.138-69.946-0.958-10.502-0.6-30.080 12.514-43.192 10.618-10.622 25.39-12.848 35.916-12.848 26.136 0 55.006 13.262 77.216 35.474 40.004 40.008 44.032 91.736 22.626 113.14z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57351,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 14,
+				"order": 43,
+				"prevSize": 32,
+				"code": 57351,
+				"name": "cut",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 42
+		},
+		{
+			"icon": {
+				"paths": [
+					"M64 192h896v128h-896zM64 576h896v128h-896zM64 384h896v128h-896zM64 768h896v128h-896z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57350,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 15,
+				"order": 44,
+				"prevSize": 32,
+				"code": 57350,
+				"name": "alignjustify",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 43
+		},
+		{
+			"icon": {
+				"paths": [
+					"M64 192h896v128h-896zM64 576h896v128h-896zM256 384h512v128h-512zM256 768h512v128h-512z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57348,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 16,
+				"order": 45,
+				"prevSize": 32,
+				"code": 57348,
+				"name": "aligncenter",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 44
+		},
+		{
+			"icon": {
+				"paths": [
+					"M64 192h896v128h-896zM64 576h896v128h-896zM384 384h576v128h-576zM384 768h576v128h-576z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57349,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 17,
+				"order": 46,
+				"prevSize": 32,
+				"code": 57349,
+				"name": "alignright",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 45
+		},
+		{
+			"icon": {
+				"paths": [
+					"M64 192h896v128h-896zM64 576h896v128h-896zM64 384h576v128h-576zM64 768h576v128h-576z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57347,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 18,
+				"order": 47,
+				"prevSize": 32,
+				"code": 57347,
+				"name": "alignleft",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 46
+		},
+		{
+			"icon": {
+				"paths": [
+					"M320 128c-123.712 0-224 100.288-224 224s100.288 224 224 224v320h128v-640h64v640h128v-640h128v-128h-448zM960 512l-224 192 224 192z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57392,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 33,
+				"order": 48,
+				"prevSize": 32,
+				"code": 57392,
+				"name": "rtl",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 47
+		},
+		{
+			"icon": {
+				"paths": [
+					"M512 384h128v64h-128zM512 768h128v64h-128zM576 576h128v64h-128zM768 576v192h-64v64h128v-256zM384 576h128v64h-128zM320 768h128v64h-128zM320 384h128v64h-128zM192 192v256h64v-192h64v-64zM704 448h128v-256h-64v192h-64zM64 64v896h896v-896h-896zM896 896h-768v-768h768v768zM192 576v256h64v-192h64v-64zM576 192h128v64h-128zM384 192h128v64h-128z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57382,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 34,
+				"order": 49,
+				"prevSize": 32,
+				"code": 57382,
+				"name": "template",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 48
+		},
+		{
+			"icon": {
+				"paths": [
+					"M816 64l16 384h-640l16-384h32l16 320h512l16-320h32zM208 960l-16-320h640l-16 320h-32l-16-256h-512l-16 256h-32zM64 512h128v64h-128zM256 512h128v64h-128zM448 512h128v64h-128zM640 512h128v64h-128zM832 512h128v64h-128z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57383,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 35,
+				"order": 50,
+				"prevSize": 32,
+				"code": 57383,
+				"name": "pagebreak",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 49
+		},
+		{
+			"icon": {
+				"paths": [
+					"M960 128v-64h-192c-35.202 0-64 28.8-64 64v320c0 15.856 5.858 30.402 15.496 41.614l-303.496 260.386-142-148-82 70 224 288 416-448h128v-64h-192v-320h192zM256 512h64v-384c0-35.2-28.8-64-64-64h-128c-35.2 0-64 28.8-64 64v384h64v-192h128v192zM128 256v-128h128v128h-128zM640 448v-96c0-35.2-8.8-64-44-64 35.2 0 44-28.8 44-64v-96c0-35.2-28.8-64-64-64h-192v448h192c35.2 0 64-28.8 64-64zM448 128h128v128h-128v-128zM448 320h128v128h-128v-128z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57380,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 36,
+				"order": 51,
+				"prevSize": 32,
+				"code": 57380,
+				"name": "spellcheck",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 50
+		},
+		{
+			"icon": {
+				"paths": [
+					"M448 512h-128v-128h128v-128h128v128h128v128h-128v128h-128v-128zM960 576v320h-896v-320h128v192h640v-192h128z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57381,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 37,
+				"order": 52,
+				"prevSize": 32,
+				"code": 57381,
+				"name": "nonbreaking",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 51
+		}
+	],
+	"height": 1024,
+	"metadata": {
+		"name": "tinymce-small"
+	},
+	"preferences": {
+		"showGlyphs": true,
+		"showQuickUse": true,
+		"showQuickUse2": true,
+		"showSVGs": true,
+		"fontPref": {
+			"prefix": "icon-",
+			"metadata": {
+				"fontFamily": "tinymce-small",
+				"majorVersion": 1,
+				"minorVersion": 0
+			},
+			"metrics": {
+				"emSize": 1024,
+				"baseline": 6.25,
+				"whitespace": 50
+			},
+			"showMetrics": false,
+			"showMetadata": false,
+			"showVersion": false
+		},
+		"imagePref": {
+			"prefix": "icon-",
+			"png": true,
+			"useClassSelector": true,
+			"color": 4473924,
+			"bgColor": 16777215
+		},
+		"historySize": 100,
+		"showCodes": true
+	}
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/tinymce-small.svg	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,62 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata>Generated by IcoMoon</metadata>
+<defs>
+<font id="tinymce-small" horiz-adv-x="1024">
+<font-face units-per-em="1024" ascent="960" descent="-64" />
+<missing-glyph horiz-adv-x="1024" />
+<glyph unicode="&#x20;" d="" horiz-adv-x="512" />
+<glyph unicode="&#xe000;" d="M960 80v591.938l-223.938 224.062h-592.062c-44.182 0-80-35.816-80-80v-736c0-44.184 35.818-80 80-80h736c44.184 0 80 35.816 80 80zM576 768h64v-192h-64v192zM704 128h-384v255.882c0.034 0.042 0.076 0.082 0.116 0.118h383.77c0.040-0.036 0.082-0.076 0.116-0.118l-0.002-255.882zM832 128h-64v256c0 35.2-28.8 64-64 64h-384c-35.2 0-64-28.8-64-64v-256h-64v640h64v-192c0-35.2 28.8-64 64-64h320c35.2 0 64 28.8 64 64v171.010l128-128.072v-490.938z" />
+<glyph unicode="&#xe001;" d="M850.746 717.254l-133.492 133.49c-24.888 24.892-74.054 45.256-109.254 45.256h-416c-35.2 0-64-28.8-64-64v-768c0-35.2 28.8-64 64-64h640c35.2 0 64 28.8 64 64v544c0 35.2-20.366 84.364-45.254 109.254zM805.49 672.002c6.792-6.796 13.792-19.162 18.894-32.002h-184.384v184.386c12.84-5.1 25.204-12.1 32-18.896l133.49-133.488zM831.884 64h-639.77c-0.040 0.034-0.082 0.076-0.114 0.116v767.77c0.034 0.040 0.076 0.082 0.114 0.114h383.886v-256h256v-511.884c-0.034-0.040-0.076-0.082-0.116-0.116z" />
+<glyph unicode="&#xe002;" d="M1024 367.542v160.916l-159.144 15.914c-8.186 30.042-20.088 58.548-35.21 84.98l104.596 127.838-113.052 113.050-127.836-104.596c-26.434 15.124-54.942 27.026-84.982 35.208l-15.914 159.148h-160.916l-15.914-159.146c-30.042-8.186-58.548-20.086-84.98-35.208l-127.838 104.594-113.050-113.050 104.596-127.836c-15.124-26.432-27.026-54.94-35.21-84.98l-159.146-15.916v-160.916l159.146-15.914c8.186-30.042 20.086-58.548 35.21-84.982l-104.596-127.836 113.048-113.048 127.838 104.596c26.432-15.124 54.94-27.028 84.98-35.21l15.916-159.148h160.916l15.914 159.144c30.042 8.186 58.548 20.088 84.982 35.21l127.836-104.596 113.048 113.048-104.596 127.836c15.124 26.434 27.028 54.942 35.21 84.98l159.148 15.92zM704 384l-128-128h-128l-128 128v128l128 128h128l128-128v-128z" />
+<glyph unicode="&#xe003;" d="M64 768h896v-128h-896zM64 384h896v-128h-896zM64 576h576v-128h-576zM64 192h576v-128h-576z" />
+<glyph unicode="&#xe004;" d="M64 768h896v-128h-896zM64 384h896v-128h-896zM256 576h512v-128h-512zM256 192h512v-128h-512z" />
+<glyph unicode="&#xe005;" d="M64 768h896v-128h-896zM64 384h896v-128h-896zM384 576h576v-128h-576zM384 192h576v-128h-576z" />
+<glyph unicode="&#xe006;" d="M64 768h896v-128h-896zM64 384h896v-128h-896zM64 576h896v-128h-896zM64 192h896v-128h-896z" />
+<glyph unicode="&#xe007;" d="M864.408 289.868c-46.47 46.47-106.938 68.004-161.082 62.806l-63.326 63.326 192 192c0 0 128 128 0 256l-320-320-320 320c-128-128 0-256 0-256l192-192-63.326-63.326c-54.144 5.198-114.61-16.338-161.080-62.806-74.98-74.98-85.112-186.418-22.626-248.9 62.482-62.482 173.92-52.354 248.9 22.626 46.47 46.468 68.002 106.938 62.806 161.080l63.326 63.326 63.328-63.328c-5.196-54.144 16.336-114.61 62.806-161.078 74.978-74.98 186.418-85.112 248.898-22.626 62.488 62.482 52.356 173.918-22.624 248.9zM353.124 201.422c-2.212-24.332-15.020-49.826-35.14-69.946-22.212-22.214-51.080-35.476-77.218-35.476-10.524 0-25.298 2.228-35.916 12.848-21.406 21.404-17.376 73.132 22.626 113.136 22.212 22.214 51.080 35.476 77.218 35.476 10.524 0 25.298-2.228 35.916-12.848 13.112-13.11 13.47-32.688 12.514-43.19zM512 352c-35.346 0-64 28.654-64 64s28.654 64 64 64 64-28.654 64-64-28.654-64-64-64zM819.152 108.848c-10.62-10.62-25.392-12.848-35.916-12.848-26.138 0-55.006 13.262-77.218 35.476-20.122 20.12-32.928 45.614-35.138 69.946-0.958 10.502-0.6 30.080 12.514 43.192 10.618 10.622 25.39 12.848 35.916 12.848 26.136 0 55.006-13.262 77.216-35.474 40.004-40.008 44.032-91.736 22.626-113.14z" />
+<glyph unicode="&#xe008;" d="M704 576v160c0 17.6-14.4 32-32 32h-160v64c0 35.2-28.8 64-64 64h-128c-35.204 0-64-28.8-64-64v-64h-160c-17.602 0-32-14.4-32-32v-512c0-17.6 14.398-32 32-32h224v-192h384l192 192v384h-192zM320 831.886c0.034 0.038 0.072 0.078 0.114 0.114h127.768c0.042-0.036 0.082-0.076 0.118-0.114v-63.886h-128v63.886zM192 640v64h384v-64h-384zM704 90.51v101.49h101.49l-101.49-101.49zM832 256h-192v-192h-256v448h448v-256z" />
+<glyph unicode="&#xe009;" d="M888 576h-56v256h64v64h-320v-64h64v-256h-256v256h64v64h-320v-64h64v-256h-56c-39.6 0-72-32.4-72-72v-432c0-39.6 32.4-72 72-72h240c39.6 0 72 32.4 72 72v312h128v-312c0-39.6 32.4-72 72-72h240c39.6 0 72 32.4 72 72v432c0 39.6-32.4 72-72 72zM348 64h-184c-19.8 0-36 14.4-36 32s16.2 32 36 32h184c19.8 0 36-14.4 36-32s-16.2-32-36-32zM544 448h-64c-17.6 0-32 14.4-32 32s14.4 32 32 32h64c17.6 0 32-14.4 32-32s-14.4-32-32-32zM860 64h-184c-19.8 0-36 14.4-36 32s16.2 32 36 32h184c19.8 0 36-14.4 36-32s-16.2-32-36-32z" />
+<glyph unicode="&#xe00a;" d="M384 832h576v-128h-576zM384 512h576v-128h-576zM384 192h576v-128h-576zM128 768c0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64s-64-28.654-64-64zM128 448c0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64s-64-28.654-64-64zM128 128c0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64s-64-28.654-64-64z" />
+<glyph unicode="&#xe00b;" d="M384 832h576v-128h-576zM384 512h576v-128h-576zM384 192h576v-128h-576zM320 430v146h-64v320h-128v-64h64v-256h-64v-64h128v-50l-128-60v-146h128v-64h-128v-64h128v-64h-128v-64h192v320h-128v50z" />
+<glyph unicode="&#xe00c;" d="M64 768h896v-128h-896zM384 384h576v-128h-576zM384 576h576v-128h-576zM64 192h896v-128h-896zM64 576l224-160-224-160z" />
+<glyph unicode="&#xe00d;" d="M64 768h896v-128h-896zM64 384h576v-128h-576zM64 576h576v-128h-576zM64 192h896v-128h-896zM960 576l-224-160 224-160z" />
+<glyph unicode="&#xe00e;" d="M256.428 535.274c105.8 0 191.572-91.17 191.572-203.638 0-112.464-85.772-203.636-191.572-203.636-105.802 0-191.572 91.17-191.572 203.636l-0.856 29.092c0 224.93 171.54 407.272 383.144 407.272v-116.364c-73.1 0-141.826-30.26-193.516-85.204-9.954-10.578-19.034-21.834-27.224-33.656 9.784 1.64 19.806 2.498 30.024 2.498zM768.428 535.274c105.8 0 191.572-91.17 191.572-203.638 0-112.464-85.772-203.636-191.572-203.636-105.802 0-191.572 91.17-191.572 203.636l-0.856 29.092c0 224.93 171.54 407.272 383.144 407.272v-116.364c-73.1 0-141.826-30.26-193.516-85.204-9.956-10.578-19.036-21.834-27.224-33.656 9.784 1.64 19.806 2.498 30.024 2.498z" />
+<glyph unicode="&#xe00f;" d="M704 0c59 199 134.906 455.266-256 446.096v-222.096l-336.002 336 336.002 336v-217.326c468.092 12.2 544-358.674 256-678.674z" />
+<glyph unicode="&#xe010;" d="M576 678.674v217.326l336.002-336-336.002-336v222.096c-390.906 9.17-315-247.096-256-446.096-288 320-212.092 690.874 256 678.674z" />
+<glyph unicode="&#xe011;" d="M927.274 729.784l-133.49 133.488c-21.104 21.104-49.232 32.728-79.198 32.728s-58.094-11.624-79.196-32.726l-165.492-165.49c-43.668-43.668-43.668-114.724 0-158.392l2.746-2.746 67.882 67.882-2.746 2.746c-6.132 6.132-6.132 16.494 0 22.626l165.492 165.492c4.010 4.008 8.808 4.608 11.312 4.608s7.302-0.598 11.312-4.61l133.49-133.488c6.132-6.134 6.132-16.498 0.002-22.628l-165.494-165.494c-4.008-4.008-8.806-4.608-11.31-4.608s-7.302 0.6-11.312 4.612l-2.746 2.746-67.88-67.884 2.742-2.742c21.106-21.108 49.23-32.728 79.2-32.728s58.094 11.624 79.196 32.726l165.494 165.492c43.662 43.666 43.662 114.72-0.004 158.39zM551.356 359.356l-67.882-67.882 2.746-2.746c4.008-4.008 4.61-8.806 4.61-11.31 0-2.506-0.598-7.302-4.606-11.314l-165.494-165.49c-4.010-4.010-8.81-4.61-11.314-4.61s-7.304 0.6-11.314 4.61l-133.492 133.486c-4.010 4.010-4.61 8.81-4.61 11.314s0.598 7.3 4.61 11.312l165.49 165.488c4.010 4.012 8.81 4.612 11.314 4.612s7.304-0.6 11.314-4.612l2.746-2.742 67.882 67.88-2.746 2.746c-21.104 21.104-49.23 32.726-79.196 32.726s-58.092-11.624-79.196-32.726l-165.488-165.486c-21.106-21.104-32.73-49.234-32.73-79.198s11.624-58.094 32.726-79.198l133.49-133.49c21.106-21.102 49.232-32.726 79.198-32.726s58.092 11.624 79.196 32.726l165.494 165.492c21.104 21.104 32.722 49.23 32.722 79.196s-11.624 58.094-32.726 79.196l-2.744 2.746zM352 250c-9.724 0-19.45 3.71-26.87 11.128-14.84 14.84-14.84 38.898 0 53.738l320 320c14.84 14.84 38.896 14.84 53.736 0 14.844-14.84 14.844-38.9 0-53.74l-320-320c-7.416-7.416-17.142-11.126-26.866-11.126z" />
+<glyph unicode="&#xe012;" d="M927.274 729.784l-133.49 133.488c-21.104 21.104-49.232 32.728-79.198 32.728s-58.094-11.624-79.196-32.726l-165.492-165.49c-43.668-43.668-43.668-114.724 0-158.392l2.746-2.746 67.882 67.882-2.746 2.746c-6.132 6.132-6.132 16.494 0 22.626l165.492 165.492c4.010 4.008 8.808 4.608 11.312 4.608s7.302-0.598 11.312-4.61l133.49-133.488c6.132-6.134 6.132-16.498 0.002-22.628l-165.494-165.494c-4.008-4.008-8.806-4.608-11.31-4.608s-7.302 0.6-11.312 4.612l-2.746 2.746-67.88-67.884 2.742-2.742c21.106-21.108 49.23-32.728 79.2-32.728s58.094 11.624 79.196 32.726l165.494 165.492c43.662 43.666 43.662 114.72-0.004 158.39zM551.356 359.356l-67.882-67.882 2.746-2.746c4.008-4.008 4.61-8.806 4.61-11.31 0-2.506-0.598-7.302-4.606-11.314l-165.494-165.49c-4.010-4.010-8.81-4.61-11.314-4.61s-7.304 0.6-11.314 4.61l-133.492 133.486c-4.010 4.010-4.61 8.81-4.61 11.314s0.598 7.3 4.61 11.312l165.49 165.488c4.010 4.012 8.81 4.612 11.314 4.612s7.304-0.6 11.314-4.612l2.746-2.742 67.882 67.88-2.746 2.746c-21.104 21.104-49.23 32.726-79.196 32.726s-58.092-11.624-79.196-32.726l-165.488-165.486c-21.106-21.104-32.73-49.234-32.73-79.198s11.624-58.094 32.726-79.198l133.49-133.49c21.106-21.102 49.232-32.726 79.198-32.726s58.092 11.624 79.196 32.726l165.494 165.492c21.104 21.104 32.722 49.23 32.722 79.196s-11.624 58.094-32.726 79.196l-2.744 2.746zM800 122c-9.724 0-19.45 3.708-26.87 11.13l-128 127.998c-14.844 14.84-14.844 38.898 0 53.738 14.84 14.844 38.896 14.844 53.736 0l128-128c14.844-14.84 14.844-38.896 0-53.736-7.416-7.422-17.142-11.13-26.866-11.13zM608 0c-17.674 0-32 14.326-32 32v128c0 17.674 14.326 32 32 32s32-14.326 32-32v-128c0-17.674-14.326-32-32-32zM928 320h-128c-17.674 0-32 14.326-32 32s14.326 32 32 32h128c17.674 0 32-14.326 32-32s-14.326-32-32-32zM224 774c9.724 0 19.45-3.708 26.87-11.13l128-128c14.842-14.84 14.842-38.898 0-53.738-14.84-14.844-38.898-14.844-53.738 0l-128 128c-14.842 14.84-14.842 38.898 0 53.738 7.418 7.422 17.144 11.13 26.868 11.13zM416 896c17.674 0 32-14.326 32-32v-128c0-17.674-14.326-32-32-32s-32 14.326-32 32v128c0 17.674 14.326 32 32 32zM96 576h128c17.674 0 32-14.326 32-32s-14.326-32-32-32h-128c-17.674 0-32 14.326-32 32s14.326 32 32 32z" />
+<glyph unicode="&#xe013;" d="M256 896v-896l256 256 256-256v896h-512zM704 170.51l-192 192-192-192v661.49h384v-661.49z" />
+<glyph unicode="&#xe014;" d="M896 832h-768c-35.2 0-64-28.8-64-64v-640c0-35.2 28.8-64 64-64h768c35.2 0 64 28.8 64 64v640c0 35.2-28.8 64-64 64zM896 128.116c-0.012-0.014-0.030-0.028-0.042-0.042l-191.958 319.926-160-128-224 288-191.968-479.916c-0.010 0.010-0.022 0.022-0.032 0.032v639.77c0.034 0.040 0.076 0.082 0.114 0.114h767.77c0.040-0.034 0.082-0.076 0.116-0.116v-639.768zM640 608c0-53.019 42.981-96 96-96s96 42.981 96 96c0 53.019-42.981 96-96 96s-96-42.981-96-96z" />
+<glyph unicode="&#xe015;" d="M896 832h-768c-35.2 0-64-28.8-64-64v-640c0-35.2 28.8-64 64-64h768c35.2 0 64 28.8 64 64v640c0 35.2-28.8 64-64 64zM256 128h-128v128h128v-128zM256 384h-128v128h128v-128zM256 640h-128v128h128v-128zM704 128h-384v640h384v-640zM896 128h-128v128h128v-128zM896 384h-128v128h128v-128zM896 640h-128v128h128v-128zM384 640v-384l288 192z" />
+<glyph unicode="&#xe016;" d="M448 256h128v-128h-128v128zM704 704c35.346 0 64-28.654 64-64v-166l-228-154h-92v64l192 128v64h-320v128h384zM512 896c-119.666 0-232.166-46.6-316.784-131.216-84.614-84.618-131.216-197.118-131.216-316.784 0-119.664 46.602-232.168 131.216-316.784 84.618-84.616 197.118-131.216 316.784-131.216 119.664 0 232.168 46.6 316.784 131.216s131.216 197.12 131.216 316.784c0 119.666-46.6 232.166-131.216 316.784-84.616 84.616-197.12 131.216-316.784 131.216z" />
+<glyph unicode="&#xe017;" d="M416 256l-192 192 192 192-64 64-256-256 256-256zM672 704l-64-64 192-192-192-192 64-64 256 256z" />
+<glyph unicode="&#xe018;" d="M77.798 655.376l81.414-50.882c50.802 81.114 128.788 143.454 221.208 174.246l-30.366 91.094c-113.748-37.898-209.728-114.626-272.256-214.458zM673.946 869.834l-30.366-91.094c92.422-30.792 170.404-93.132 221.208-174.248l81.412 50.882c-62.526 99.834-158.506 176.562-272.254 214.46zM607.974 255.992c-4.808 0-9.692 1.090-14.286 3.386l-145.688 72.844v211.778c0 17.672 14.328 32 32 32s32-14.328 32-32v-172.222l110.31-55.156c15.806-7.902 22.214-27.124 14.31-42.932-5.604-11.214-16.908-17.696-28.646-17.698zM512 768c-212.078 0-384-171.922-384-384s171.922-384 384-384c212.078 0 384 171.922 384 384s-171.922 384-384 384zM512 96c-159.058 0-288 128.942-288 288s128.942 288 288 288c159.058 0 288-128.942 288-288s-128.942-288-288-288z" />
+<glyph unicode="&#xe019;" d="M64 504.254c45.318 49.92 97.162 92.36 153.272 125.124 90.332 52.744 192.246 80.622 294.728 80.622 102.48 0 204.396-27.878 294.726-80.624 56.112-32.764 107.956-75.204 153.274-125.124v117.432c-33.010 28.118-68.124 53.14-104.868 74.594-105.006 61.314-223.658 93.722-343.132 93.722s-238.128-32.408-343.134-93.72c-36.742-21.454-71.856-46.478-104.866-74.596v-117.43zM512 640c-183.196 0-345.838-100.556-448-256 102.162-155.448 264.804-256 448-256s345.838 100.552 448 256c-102.162 155.444-264.804 256-448 256zM512 448c0-35.346-28.654-64-64-64s-64 28.654-64 64c0 35.348 28.654 64 64 64s64-28.652 64-64zM728.066 263.338c-67.434-39.374-140.128-59.338-216.066-59.338s-148.632 19.964-216.066 59.338c-51.554 30.104-98.616 71.31-138.114 120.662 39.498 49.35 86.56 90.558 138.116 120.66 13.276 7.752 26.758 14.74 40.426 20.982-10.512-23.742-16.362-50.008-16.362-77.642 0-106.040 85.962-192 192-192 106.040 0 192 85.96 192 192 0 27.634-5.85 53.9-16.36 77.642 13.668-6.244 27.15-13.23 40.426-20.982 51.554-30.102 98.616-71.31 138.116-120.66-39.498-49.352-86.56-90.558-138.116-120.662z" />
+<glyph unicode="&#xe01a;" d="M651.168 676.166c-24.612 81.962-28.876 91.834-107.168 91.834h-64c-79.618 0-82.664-10.152-108.418-96 0-0.002 0-0.002-0.002-0.004l-143.998-479.996h113.636l57.6 192h226.366l57.6-192h113.63l-145.246 484.166zM437.218 512l38.4 136c10.086 33.618 36.38 30 36.38 30s26.294 3.618 36.38-30h0.004l38.4-136h-149.564z" />
+<glyph unicode="&#xe01b;" d="M64 768v-704h896v704h-896zM384 320v128h256v-128h-256zM640 256v-128h-256v128h256zM640 640v-128h-256v128h256zM320 640v-128h-192v128h192zM128 448h192v-128h-192v128zM704 448h192v-128h-192v128zM704 512v128h192v-128h-192zM128 256h192v-128h-192v128zM704 128v128h192v-128h-192z" />
+<glyph unicode="&#xe01c;" d="M64 512h896v-128h-896z" />
+<glyph unicode="&#xe01d;" d="M64 192h512v-128h-512v128zM768 768h-220.558l-183.766-512h-132.288l183.762 512h-223.15v128h576v-128zM929.774 64l-129.774 129.774-129.774-129.774-62.226 62.226 129.774 129.774-129.774 129.774 62.226 62.226 129.774-129.774 129.774 129.774 62.226-62.226-129.774-129.774 129.774-129.774-62.226-62.226z" />
+<glyph unicode="&#xe01e;" d="M768 50v-50h128v-64h-192v146l128 60v50h-128v64h192v-146zM676 704h-136l-188-188-188 188h-136l256-256-256-256h136l188 188 188-188h136l-256 256z" />
+<glyph unicode="&#xe01f;" d="M768 754v-50h128v-64h-192v146l128 60v50h-128v64h192v-146zM676 704h-136l-188-188-188 188h-136l256-256-256-256h136l188 188 188-188h136l-256 256z" />
+<glyph unicode="&#xe020;" d="M704 128v37.004c151.348 61.628 256 193.82 256 346.996 0 212.078-200.576 384-448 384s-448-171.922-448-384c0-153.176 104.654-285.368 256-346.996v-37.004h-192l-64 96v-224h320v222.812c-100.9 51.362-170.666 161.54-170.666 289.188 0 176.732 133.718 320 298.666 320s298.666-143.268 298.666-320c0-127.648-69.766-237.826-170.666-289.188v-222.812h320v224l-64-96h-192z" />
+<glyph unicode="&#xe021;" d="M512 820c99.366 0 192.782-38.694 263.042-108.956s108.958-163.678 108.958-263.044-38.696-192.782-108.958-263.042-163.676-108.958-263.042-108.958-192.782 38.696-263.044 108.958-108.956 163.676-108.956 263.042 38.694 192.782 108.956 263.044 163.678 108.956 263.044 108.956zM512 896c-247.424 0-448-200.576-448-448s200.576-448 448-448 448 200.576 448 448-200.576 448-448 448v0zM320 576c0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64s-64-28.654-64-64zM576 576c0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64s-64-28.654-64-64zM512 304c-101.84 0-192.56 36.874-251.166 94.328 23.126-117.608 126.778-206.328 251.166-206.328s228.040 88.72 251.168 206.328c-58.608-57.454-149.328-94.328-251.168-94.328z" />
+<glyph unicode="&#xe022;" d="M256 832h512v-128h-512v128zM896 640h-768c-35.2 0-64-28.8-64-64v-256c0-35.2 28.796-64 64-64h128v-192h512v192h128c35.2 0 64 28.8 64 64v256c0 35.2-28.8 64-64 64zM704 128h-384v256h384v-256zM910.4 544c0-25.626-20.774-46.4-46.398-46.4s-46.402 20.774-46.402 46.4 20.778 46.4 46.402 46.4c25.626 0 46.398-20.774 46.398-46.4z" />
+<glyph unicode="&#xe023;" d="M480 576l-192 192 128 128h-352v-352l128 128 192-192zM640 480l192 192 128-128v352h-352l128-128-192-192zM544 320l192-192-128-128h352v352l-128-128-192 192zM384 416l-192-192-128 128v-352h352l-128 128 192 192z" />
+<glyph unicode="&#xe024;" d="M960 832v64h-192c-35.202 0-64-28.8-64-64v-320c0-15.856 5.858-30.402 15.496-41.614l-303.496-260.386-142 148-82-70 224-288 416 448h128v64h-192v320h192zM256 448h64v384c0 35.2-28.8 64-64 64h-128c-35.2 0-64-28.8-64-64v-384h64v192h128v-192zM128 704v128h128v-128h-128zM640 512v96c0 35.2-8.8 64-44 64 35.2 0 44 28.8 44 64v96c0 35.2-28.8 64-64 64h-192v-448h192c35.2 0 64 28.8 64 64zM448 832h128v-128h-128v128zM448 640h128v-128h-128v128z" />
+<glyph unicode="&#xe025;" d="M448 448h-128v128h128v128h128v-128h128v-128h-128v-128h-128v128zM960 384v-320h-896v320h128v-192h640v192h128z" />
+<glyph unicode="&#xe026;" d="M512 576h128v-64h-128zM512 192h128v-64h-128zM576 384h128v-64h-128zM768 384v-192h-64v-64h128v256zM384 384h128v-64h-128zM320 192h128v-64h-128zM320 576h128v-64h-128zM192 768v-256h64v192h64v64zM704 512h128v256h-64v-192h-64zM64 896v-896h896v896h-896zM896 64h-768v768h768v-768zM192 384v-256h64v192h64v64zM576 768h128v-64h-128zM384 768h128v-64h-128z" />
+<glyph unicode="&#xe027;" d="M816 896l16-384h-640l16 384h32l16-320h512l16 320h32zM208 0l-16 320h640l-16-320h-32l-16 256h-512l-16-256h-32zM64 448h128v-64h-128zM256 448h128v-64h-128zM448 448h128v-64h-128zM640 448h128v-64h-128zM832 448h128v-64h-128z" />
+<glyph unicode="&#xe028;" d="M576 896c247.424 0 448-200.576 448-448s-200.576-448-448-448v96c94.024 0 182.418 36.614 248.902 103.098s103.098 154.878 103.098 248.902c0 94.022-36.614 182.418-103.098 248.902s-154.878 103.098-248.902 103.098c-94.022 0-182.418-36.614-248.902-103.098-51.14-51.138-84.582-115.246-97.306-184.902h186.208l-224-256-224 256h164.57c31.060 217.102 217.738 384 443.43 384zM768 512v-128h-256v320h128v-192z" />
+<glyph unicode="&#xe02a;" d="M625.442 465.818c48.074 38.15 78.558 94.856 78.558 158.182 0 114.876-100.29 208-224 208h-224v-768h288c123.712 0 224 93.124 224 208 0 88.196-59.118 163.562-142.558 193.818zM384 656c0 26.51 21.49 48 48 48h67.204c42.414 0 76.796-42.98 76.796-96s-34.382-96-76.796-96h-115.204v144zM547.2 192h-115.2c-26.51 0-48 21.49-48 48v144h163.2c42.418 0 76.8-42.98 76.8-96s-34.382-96-76.8-96z" />
+<glyph unicode="&#xe02b;" d="M832 832v-64h-144l-256-640h144v-64h-448v64h144l256 640h-144v64h448z" />
+<glyph unicode="&#xe02c;" d="M192 128h576v-64h-576v64zM640 832v-384c0-31.312-14.7-61.624-41.39-85.352-30.942-27.502-73.068-42.648-118.61-42.648-45.544 0-87.668 15.146-118.608 42.648-26.692 23.728-41.392 54.040-41.392 85.352v384h-128v-384c0-141.382 128.942-256 288-256s288 114.618 288 256v384h-128z" />
+<glyph unicode="&#xe02d;" d="M960 448h-265.876c-50.078 35.42-114.43 54.86-182.124 54.86-89.206 0-164.572 50.242-164.572 109.712s75.366 109.714 164.572 109.714c75.058 0 140.308-35.576 159.12-82.286h113.016c-7.93 50.644-37.58 97.968-84.058 132.826-50.88 38.16-117.676 59.174-188.078 59.174-70.404 0-137.196-21.014-188.074-59.174-54.788-41.090-86.212-99.502-86.212-160.254s31.424-119.164 86.212-160.254c1.956-1.466 3.942-2.898 5.946-4.316h-265.872v-64h512.532c58.208-17.106 100.042-56.27 100.042-100.572 0-59.468-75.368-109.71-164.572-109.71-75.060 0-140.308 35.574-159.118 82.286h-113.016c7.93-50.64 37.582-97.968 84.060-132.826 50.876-38.164 117.668-59.18 188.072-59.18 70.402 0 137.198 21.016 188.074 59.174 54.79 41.090 86.208 99.502 86.208 160.254 0 35.298-10.654 69.792-30.294 100.572h204.012v64z" />
+<glyph unicode="&#xe02e;" d="M384 832c-123.712 0-224-100.288-224-224s100.288-224 224-224v-320h128v640h64v-640h128v640h128v128h-448z" />
+<glyph unicode="&#xe02f;" d="M448 832c-123.712 0-224-100.288-224-224s100.288-224 224-224v-320h128v640h64v-640h128v640h128v128h-448zM64 64l224 192-224 192z" />
+<glyph unicode="&#xe030;" d="M320 832c-123.712 0-224-100.288-224-224s100.288-224 224-224v-320h128v640h64v-640h128v640h128v128h-448zM960 448l-224-192 224-192z" />
+<glyph unicode="&#xe031;" d="M832 640h-192v64l-192 192h-384v-704h384v-192h576v448l-192 192zM832 549.49l101.49-101.49h-101.49v101.49zM448 805.49l101.49-101.49h-101.49v101.49zM128 832h256v-192h192v-384h-448v576zM960 64h-448v128h128v384h128v-192h192v-320z" />
+<glyph unicode="&#xe032;" d="M768 704h64v-64h-64zM640 576h64v-64h-64zM640 448h64v-64h-64zM640 320h64v-64h-64zM512 448h64v-64h-64zM512 320h64v-64h-64zM384 320h64v-64h-64zM768 576h64v-64h-64zM768 448h64v-64h-64zM768 320h64v-64h-64zM768 192h64v-64h-64zM640 192h64v-64h-64zM512 192h64v-64h-64zM384 192h64v-64h-64zM256 192h64v-64h-64z" />
+<glyph unicode="&#xe034;" d="M928 832h-416l-32 64h-352l-64-128h896zM840.34 256h87.66l32 448h-896l64-640h356.080c-104.882 37.776-180.080 138.266-180.080 256 0 149.982 122.018 272 272 272 149.98 0 272-122.018 272-272 0-21.678-2.622-43.15-7.66-64zM874.996 110.25l-134.496 110.692c17.454 28.922 27.5 62.814 27.5 99.058 0 106.040-85.96 192-192 192s-192-85.96-192-192 85.96-192 192-192c36.244 0 70.138 10.046 99.058 27.5l110.692-134.496c22.962-26.678 62.118-28.14 87.006-3.252l5.492 5.492c24.888 24.888 23.426 64.044-3.252 87.006zM576 196c-68.484 0-124 55.516-124 124s55.516 124 124 124 124-55.516 124-124-55.516-124-124-124z" />
+<glyph unicode="&#xe035;" d="M704 576v160c0 17.6-14.4 32-32 32h-160v64c0 35.2-28.8 64-64 64h-128c-35.204 0-64-28.8-64-64v-64h-160c-17.602 0-32-14.4-32-32v-512c0-17.6 14.398-32 32-32h224v-192h576v576h-192zM320 831.886c0.034 0.038 0.072 0.078 0.114 0.114h127.768c0.042-0.036 0.082-0.076 0.118-0.114v-63.886h-128v63.886zM192 640v64h384v-64h-384zM832 64h-448v448h448v-448zM448 448v-128h32l32 64h64v-192h-48v-64h160v64h-48v192h64l32-64h32v128z" />
+</font></defs></svg>
\ No newline at end of file
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/tinymce-small.ttf has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/tinymce-small.woff has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/tinymce.eot has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/tinymce.json	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1357 @@
+{
+	"IcoMoonType": "selection",
+	"icons": [
+		{
+			"icon": {
+				"paths": [
+					"M928 128h-416l-32-64h-352l-64 128h896zM904.34 704h74.86l44.8-448h-1024l64 640h484.080c-104.882-37.776-180.080-138.266-180.080-256 0-149.982 122.018-272 272-272 149.98 0 272 122.018 272 272 0 21.678-2.622 43.15-7.66 64zM1002.996 913.75l-198.496-174.692c17.454-28.92 27.5-62.814 27.5-99.058 0-106.040-85.96-192-192-192s-192 85.96-192 192 85.96 192 192 192c36.244 0 70.138-10.046 99.058-27.5l174.692 198.496c22.962 26.678 62.118 28.14 87.006 3.252l5.492-5.492c24.888-24.888 23.426-64.044-3.252-87.006zM640 764c-68.484 0-124-55.516-124-124s55.516-124 124-124 124 55.516 124 124-55.516 124-124 124z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57396,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 0,
+				"order": 1,
+				"prevSize": 32,
+				"code": 57396,
+				"name": "browse",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 0
+		},
+		{
+			"icon": {
+				"paths": [
+					"M768 256h64v64h-64zM640 384h64v64h-64zM640 512h64v64h-64zM640 640h64v64h-64zM512 512h64v64h-64zM512 640h64v64h-64zM384 640h64v64h-64zM768 384h64v64h-64zM768 512h64v64h-64zM768 640h64v64h-64zM768 768h64v64h-64zM640 768h64v64h-64zM512 768h64v64h-64zM384 768h64v64h-64zM256 768h64v64h-64z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"resize",
+					"dots"
+				],
+				"defaultCode": 57394,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 1,
+				"order": 2,
+				"prevSize": 32,
+				"code": 57394,
+				"name": "resize",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 1
+		},
+		{
+			"icon": {
+				"paths": [
+					"M832 256h-192v-64l-192-192h-448v768h384v256h640v-576l-192-192zM832 346.51l101.49 101.49h-101.49v-101.49zM448 90.51l101.49 101.49h-101.49v-101.49zM64 64h320v192h192v448h-512v-640zM960 960h-512v-192h192v-448h128v192h192v448z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"copy"
+				],
+				"defaultCode": 57393,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 2,
+				"order": 3,
+				"prevSize": 32,
+				"code": 57393,
+				"name": "copy",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 2
+		},
+		{
+			"icon": {
+				"paths": [
+					"M256 64h512v128h-128v768h-128v-768h-128v768h-128v-448c-123.712 0-224-100.288-224-224s100.288-224 224-224zM960 896l-256-224 256-224z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"rtl"
+				],
+				"defaultCode": 57392,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 3,
+				"order": 4,
+				"prevSize": 32,
+				"code": 57392,
+				"name": "rtl",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 3
+		},
+		{
+			"icon": {
+				"paths": [
+					"M448 64h512v128h-128v768h-128v-768h-128v768h-128v-448c-123.712 0-224-100.288-224-224s100.288-224 224-224zM64 448l256 224-256 224z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"ltr"
+				],
+				"defaultCode": 57391,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 4,
+				"order": 5,
+				"prevSize": 32,
+				"code": 57391,
+				"name": "ltr",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 4
+		},
+		{
+			"icon": {
+				"paths": [
+					"M384 64h512v128h-128v768h-128v-768h-128v768h-128v-448c-123.712 0-224-100.288-224-224s100.288-224 224-224z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"visualchars"
+				],
+				"defaultCode": 57390,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 5,
+				"order": 6,
+				"prevSize": 32,
+				"code": 57390,
+				"name": "visualchars",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 5
+		},
+		{
+			"icon": {
+				"paths": [
+					"M731.42 517.036c63.92 47.938 100.58 116.086 100.58 186.964s-36.66 139.026-100.58 186.964c-59.358 44.518-137.284 69.036-219.42 69.036-82.138 0-160.062-24.518-219.42-69.036-63.92-47.938-100.58-116.086-100.58-186.964h128c0 69.382 87.926 128 192 128 104.074 0 192-58.618 192-128 0-69.382-87.926-128-192-128-82.138 0-160.062-24.518-219.42-69.036-63.92-47.94-100.58-116.086-100.58-186.964 0-70.878 36.66-139.024 100.58-186.964 59.358-44.518 137.282-69.036 219.42-69.036 82.136 0 160.062 24.518 219.42 69.036 63.92 47.94 100.58 116.086 100.58 186.964h-128c0-69.382-87.926-128-192-128-104.074 0-192 58.618-192 128 0 69.382 87.926 128 192 128 82.136 0 160.062 24.518 219.42 69.036zM0 512h1024v64h-1024z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"strikethrough"
+				],
+				"defaultCode": 57389,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 6,
+				"order": 7,
+				"prevSize": 32,
+				"code": 57389,
+				"name": "strikethrough",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 6
+		},
+		{
+			"icon": {
+				"paths": [
+					"M704 64h128v416c0 159.058-143.268 288-320 288-176.73 0-320-128.942-320-288v-416h128v416c0 40.166 18.238 78.704 51.354 108.506 36.896 33.204 86.846 51.494 140.646 51.494 53.8 0 103.75-18.29 140.646-51.494 33.116-29.802 51.354-68.34 51.354-108.506v-416zM192 832h640v128h-640z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"underline"
+				],
+				"defaultCode": 57388,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 7,
+				"order": 8,
+				"prevSize": 32,
+				"code": 57388,
+				"name": "underline",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 7
+		},
+		{
+			"icon": {
+				"paths": [
+					"M896 64v64h-128l-320 768h128v64h-448v-64h128l320-768h-128v-64z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"italic"
+				],
+				"defaultCode": 57387,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 8,
+				"order": 9,
+				"prevSize": 32,
+				"code": 57387,
+				"name": "italic",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 8
+		},
+		{
+			"icon": {
+				"paths": [
+					"M707.88 484.652c37.498-44.542 60.12-102.008 60.12-164.652 0-141.16-114.842-256-256-256h-320v896h384c141.158 0 256-114.842 256-256 0-92.956-49.798-174.496-124.12-219.348zM384 192h101.5c55.968 0 101.5 57.42 101.5 128s-45.532 128-101.5 128h-101.5v-256zM543 832h-159v-256h159c58.45 0 106 57.42 106 128s-47.55 128-106 128z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"bold0"
+				],
+				"defaultCode": 57386,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 9,
+				"order": 10,
+				"prevSize": 32,
+				"code": 57386,
+				"name": "bold",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 9
+		},
+		{
+			"icon": {
+				"paths": [
+					"M576 64c247.424 0 448 200.576 448 448s-200.576 448-448 448v-96c94.024 0 182.418-36.614 248.902-103.098 66.484-66.484 103.098-154.878 103.098-248.902 0-94.022-36.614-182.418-103.098-248.902-66.484-66.484-154.878-103.098-248.902-103.098-94.022 0-182.418 36.614-248.902 103.098-51.14 51.138-84.582 115.246-97.306 184.902h186.208l-224 256-224-256h164.57c31.060-217.102 217.738-384 443.43-384zM768 448v128h-256v-320h128v192z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"restoredraft"
+				],
+				"defaultCode": 57384,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 11,
+				"order": 11,
+				"prevSize": 32,
+				"code": 57384,
+				"name": "restoredraft",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 10
+		},
+		{
+			"icon": {
+				"paths": [
+					"M0 512h128v64h-128zM192 512h192v64h-192zM448 512h128v64h-128zM640 512h192v64h-192zM896 512h128v64h-128zM880 0l16 448h-768l16-448h32l16 384h640l16-384zM144 1024l-16-384h768l-16 384h-32l-16-320h-640l-16 320z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"pagebreak"
+				],
+				"defaultCode": 57383,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 12,
+				"order": 12,
+				"prevSize": 32,
+				"code": 57383,
+				"name": "pagebreak",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 11
+		},
+		{
+			"icon": {
+				"paths": [
+					"M384 192h128v64h-128zM576 192h128v64h-128zM896 192v256h-192v-64h128v-128h-64v-64zM320 384h128v64h-128zM512 384h128v64h-128zM192 256v128h64v64h-128v-256h192v64zM384 576h128v64h-128zM576 576h128v64h-128zM896 576v256h-192v-64h128v-128h-64v-64zM320 768h128v64h-128zM512 768h128v64h-128zM192 640v128h64v64h-128v-256h192v64zM960 64h-896v896h896v-896zM1024 0v0 1024h-1024v-1024h1024z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"template"
+				],
+				"defaultCode": 57382,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 13,
+				"order": 13,
+				"prevSize": 32,
+				"code": 57382,
+				"name": "template",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 12
+		},
+		{
+			"icon": {
+				"paths": [
+					"M448 576h-192v-128h192v-192h128v192h192v128h-192v192h-128zM1024 640v384h-1024v-384h128v256h768v-256z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"nonbreaking"
+				],
+				"defaultCode": 57381,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 14,
+				"order": 14,
+				"prevSize": 32,
+				"code": 57381,
+				"name": "nonbreaking",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 13
+		},
+		{
+			"icon": {
+				"paths": [
+					"M128 256h128v192h64v-384c0-35.2-28.8-64-64-64h-128c-35.2 0-64 28.8-64 64v384h64v-192zM128 64h128v128h-128v-128zM960 64v-64h-192c-35.202 0-64 28.8-64 64v320c0 35.2 28.798 64 64 64h192v-64h-192v-320h192zM640 160v-96c0-35.2-28.8-64-64-64h-192v448h192c35.2 0 64-28.8 64-64v-96c0-35.2-8.8-64-44-64 35.2 0 44-28.8 44-64zM576 384h-128v-128h128v128zM576 192h-128v-128h128v128zM832 576l-416 448-224-288 82-70 142 148 352-302z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"spellchecker"
+				],
+				"defaultCode": 57380,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 15,
+				"order": 15,
+				"prevSize": 32,
+				"code": 57380,
+				"name": "spellchecker",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 14
+		},
+		{
+			"icon": {
+				"paths": [
+					"M704 896h256l64-128v256h-384v-214.214c131.112-56.484 224-197.162 224-361.786 0-214.432-157.598-382.266-352-382.266-194.406 0-352 167.832-352 382.266 0 164.624 92.886 305.302 224 361.786v214.214h-384v-256l64 128h256v-32.59c-187.63-66.46-320-227.402-320-415.41 0-247.424 229.23-448 512-448 282.77 0 512 200.576 512 448 0 188.008-132.37 348.95-320 415.41v32.59z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"charmap"
+				],
+				"defaultCode": 57376,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 19,
+				"order": 16,
+				"prevSize": 32,
+				"code": 57376,
+				"name": "charmap",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 15
+		},
+		{
+			"icon": {
+				"paths": [
+					"M768 206v50h128v64h-192v-146l128-60v-50h-128v-64h192v146zM676 256h-136l-188 188-188-188h-136l256 256-256 256h136l188-188 188 188h136l-256-256z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"sup"
+				],
+				"defaultCode": 57375,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 20,
+				"order": 17,
+				"prevSize": 32,
+				"code": 57375,
+				"name": "sup",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 16
+		},
+		{
+			"icon": {
+				"paths": [
+					"M768 910v50h128v64h-192v-146l128-60v-50h-128v-64h192v146zM676 256h-136l-188 188-188-188h-136l256 256-256 256h136l188-188 188 188h136l-256-256z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"sub"
+				],
+				"defaultCode": 57374,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 21,
+				"order": 18,
+				"prevSize": 32,
+				"code": 57374,
+				"name": "sub",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 17
+		},
+		{
+			"icon": {
+				"paths": [
+					"M0 896h576v128h-576zM192 0h704v128h-704zM277.388 832l204.688-784.164 123.85 32.328-196.25 751.836zM929.774 1024l-129.774-129.774-129.774 129.774-62.226-62.226 129.774-129.774-129.774-129.774 62.226-62.226 129.774 129.774 129.774-129.774 62.226 62.226-129.774 129.774 129.774 129.774z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"removeformat"
+				],
+				"defaultCode": 57373,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 22,
+				"order": 19,
+				"prevSize": 32,
+				"code": 57373,
+				"name": "removeformat",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 18
+		},
+		{
+			"icon": {
+				"paths": [
+					"M0 448h1024v128h-1024z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"hr"
+				],
+				"defaultCode": 57372,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 23,
+				"order": 20,
+				"prevSize": 32,
+				"code": 57372,
+				"name": "hr",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 19
+		},
+		{
+			"icon": {
+				"paths": [
+					"M0 64v896h1024v-896h-1024zM384 640v-192h256v192h-256zM640 704v192h-256v-192h256zM640 192v192h-256v-192h256zM320 192v192h-256v-192h256zM64 448h256v192h-256v-192zM704 448h256v192h-256v-192zM704 384v-192h256v192h-256zM64 704h256v192h-256v-192zM704 896v-192h256v192h-256z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"table"
+				],
+				"defaultCode": 57371,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 24,
+				"order": 21,
+				"prevSize": 32,
+				"code": 57371,
+				"name": "table",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 20
+		},
+		{
+			"icon": {
+				"paths": [
+					"M322.018 832l57.6-192h264.764l57.6 192h113.632l-191.996-640h-223.236l-192 640h113.636zM475.618 320h72.764l57.6 192h-187.964l57.6-192z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"forecolor"
+				],
+				"defaultCode": 57370,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 25,
+				"order": 22,
+				"prevSize": 32,
+				"code": 57370,
+				"name": "forecolor",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 21
+		},
+		{
+			"icon": {
+				"paths": [
+					"M512 320c-209.368 0-395.244 100.556-512 256 116.756 155.446 302.632 256 512 256 209.368 0 395.244-100.554 512-256-116.756-155.444-302.632-256-512-256zM448 448c35.346 0 64 28.654 64 64s-28.654 64-64 64-64-28.654-64-64 28.654-64 64-64zM773.616 705.296c-39.648 20.258-81.652 35.862-124.846 46.376-44.488 10.836-90.502 16.328-136.77 16.328-46.266 0-92.282-5.492-136.768-16.324-43.194-10.518-85.198-26.122-124.846-46.376-63.020-32.202-120.222-76.41-167.64-129.298 47.418-52.888 104.62-97.1 167.64-129.298 32.336-16.522 66.242-29.946 101.082-40.040-19.888 30.242-31.468 66.434-31.468 105.336 0 106.040 85.962 192 192 192 106.038 0 192-85.96 192-192 0-38.902-11.582-75.094-31.466-105.34 34.838 10.096 68.744 23.52 101.082 40.042 63.022 32.198 120.218 76.408 167.638 129.298-47.42 52.886-104.618 97.1-167.638 129.296zM860.918 243.722c-108.72-55.554-226.112-83.722-348.918-83.722-122.806 0-240.198 28.168-348.918 83.722-58.772 30.032-113.732 67.904-163.082 112.076v109.206c55.338-58.566 120.694-107.754 192.194-144.29 99.62-50.904 207.218-76.714 319.806-76.714s220.186 25.81 319.804 76.716c71.502 36.536 136.858 85.724 192.196 144.29v-109.206c-49.35-44.174-104.308-82.046-163.082-112.078z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"preview"
+				],
+				"defaultCode": 57369,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 26,
+				"order": 23,
+				"prevSize": 32,
+				"code": 57369,
+				"name": "preview",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 22
+		},
+		{
+			"icon": {
+				"paths": [
+					"M512 192c-212.076 0-384 171.922-384 384s171.922 384 384 384c212.074 0 384-171.922 384-384s-171.926-384-384-384zM715.644 779.646c-54.392 54.396-126.716 84.354-203.644 84.354s-149.25-29.958-203.646-84.354c-54.396-54.394-84.354-126.718-84.354-203.646s29.958-149.25 84.354-203.646c54.396-54.396 126.718-84.354 203.646-84.354s149.252 29.958 203.642 84.354c54.402 54.396 84.358 126.718 84.358 203.646s-29.958 149.252-84.356 203.646zM325.93 203.862l-42.94-85.878c-98.874 49.536-179.47 130.132-229.006 229.008l85.876 42.94c40.248-80.336 105.732-145.822 186.070-186.070zM884.134 389.93l85.878-42.938c-49.532-98.876-130.126-179.472-229.004-229.008l-42.944 85.878c80.338 40.248 145.824 105.732 186.070 186.068zM512 384h-64v192c0 10.11 4.7 19.11 12.022 24.972l-0.012 0.016 160 128 39.976-49.976-147.986-118.39v-176.622z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"inserttime"
+				],
+				"defaultCode": 57368,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 27,
+				"order": 24,
+				"prevSize": 32,
+				"code": 57368,
+				"name": "inserttime",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 23
+		},
+		{
+			"icon": {
+				"paths": [
+					"M320 256l-256 256 256 256h128l-256-256 256-256zM704 256h-128l256 256-256 256h128l256-256z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"code"
+				],
+				"defaultCode": 57367,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 28,
+				"order": 25,
+				"prevSize": 32,
+				"code": 57367,
+				"name": "code",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 24
+		},
+		{
+			"icon": {
+				"paths": [
+					"M448 704h128v128h-128zM704 256c35.346 0 64 28.654 64 64v192l-192 128h-128v-64l192-128v-64h-320v-128h384zM512 96c-111.118 0-215.584 43.272-294.156 121.844s-121.844 183.038-121.844 294.156c0 111.118 43.272 215.584 121.844 294.156 78.572 78.572 183.038 121.844 294.156 121.844 111.118 0 215.584-43.272 294.156-121.844 78.572-78.572 121.844-183.038 121.844-294.156 0-111.118-43.272-215.584-121.844-294.156-78.572-78.572-183.038-121.844-294.156-121.844zM512 0v0c282.77 0 512 229.23 512 512s-229.23 512-512 512c-282.77 0-512-229.23-512-512 0-282.77 229.23-512 512-512z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"help"
+				],
+				"defaultCode": 57366,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 29,
+				"order": 26,
+				"prevSize": 32,
+				"code": 57366,
+				"name": "help",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 25
+		},
+		{
+			"icon": {
+				"paths": [
+					"M0 128v768h1024v-768h-1024zM192 832h-128v-128h128v128zM192 576h-128v-128h128v128zM192 320h-128v-128h128v128zM768 832h-512v-640h512v640zM960 832h-128v-128h128v128zM960 576h-128v-128h128v128zM960 320h-128v-128h128v128zM384 320v384l256-192z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"media"
+				],
+				"defaultCode": 57365,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 30,
+				"order": 27,
+				"prevSize": 32,
+				"code": 57365,
+				"name": "media",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 26
+		},
+		{
+			"icon": {
+				"paths": [
+					"M0 128v832h1024v-832h-1024zM960 896h-896v-704h896v704zM704 352c0-53.019 42.981-96 96-96s96 42.981 96 96c0 53.019-42.981 96-96 96-53.019 0-96-42.981-96-96zM896 832h-768l192-512 256 320 128-96z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"image"
+				],
+				"defaultCode": 57364,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 31,
+				"order": 28,
+				"prevSize": 32,
+				"code": 57364,
+				"name": "image",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 27
+		},
+		{
+			"icon": {
+				"paths": [
+					"M192 0v1024l320-320 320 320v-1024h-640zM768 869.49l-256-256-256 256v-805.49h512v805.49z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"anchor"
+				],
+				"defaultCode": 57363,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 32,
+				"order": 29,
+				"prevSize": 32,
+				"code": 57363,
+				"name": "anchor",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 28
+		},
+		{
+			"icon": {
+				"paths": [
+					"M476.888 675.114c4.56 9.048 6.99 19.158 6.99 29.696 0 17.616-6.744 34.058-18.992 46.308l-163.38 163.38c-12.248 12.248-28.696 18.992-46.308 18.992s-34.060-6.744-46.308-18.992l-99.38-99.38c-12.248-12.25-18.992-28.696-18.992-46.308s6.744-34.060 18.992-46.308l163.38-163.382c12.248-12.246 28.696-18.992 46.308-18.992 10.538 0 20.644 2.43 29.696 6.988l65.338-65.336c-27.87-21.41-61.44-32.16-95.034-32.16-39.986 0-79.972 15.166-110.308 45.502l-163.38 163.382c-60.67 60.67-60.67 159.95 0 220.618l99.38 99.382c30.334 30.332 70.32 45.5 110.306 45.5 39.988 0 79.974-15.168 110.308-45.502l163.38-163.38c55.82-55.82 60.238-144.298 13.344-205.346l-65.34 65.338zM978.496 144.884l-99.38-99.382c-30.334-30.336-70.32-45.502-110.308-45.502-39.986 0-79.97 15.166-110.306 45.502l-163.382 163.382c-55.82 55.82-60.238 144.298-13.342 205.342l65.338-65.34c-4.558-9.050-6.988-19.16-6.988-29.694 0-17.616 6.744-34.060 18.992-46.308l163.382-163.382c12.246-12.248 28.694-18.994 46.306-18.994 17.616 0 34.060 6.746 46.308 18.994l99.38 99.382c12.248 12.248 18.992 28.694 18.992 46.308s-6.744 34.060-18.992 46.308l-163.38 163.382c-12.248 12.248-28.694 18.992-46.308 18.992-10.536 0-20.644-2.43-29.696-6.99l-65.338 65.338c27.872 21.41 61.44 32.16 95.034 32.16 39.988 0 79.974-15.168 110.308-45.504l163.38-163.38c60.672-60.666 60.672-159.944 0-220.614zM233.368 278.624l-191.994-191.994 45.256-45.256 191.994 191.994zM384 0h64v192h-64zM0 384h192v64h-192zM790.632 745.376l191.996 191.996-45.256 45.256-191.996-191.996zM576 832h64v192h-64zM832 576h192v64h-192z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"unlink"
+				],
+				"defaultCode": 57362,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 33,
+				"order": 30,
+				"prevSize": 32,
+				"code": 57362,
+				"name": "unlink",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 29
+		},
+		{
+			"icon": {
+				"paths": [
+					"M320 704c17.6 17.6 47.274 16.726 65.942-1.942l316.118-316.116c18.668-18.668 19.54-48.342 1.94-65.942s-47.274-16.726-65.942 1.942l-316.116 316.116c-18.668 18.668-19.542 48.342-1.942 65.942zM476.888 675.112c4.56 9.050 6.99 19.16 6.99 29.696 0 17.616-6.744 34.060-18.992 46.308l-163.382 163.382c-12.248 12.248-28.694 18.992-46.308 18.992s-34.060-6.744-46.308-18.992l-99.382-99.382c-12.248-12.248-18.992-28.694-18.992-46.308s6.744-34.060 18.992-46.308l163.382-163.382c12.248-12.248 28.694-18.994 46.308-18.994 10.536 0 20.644 2.43 29.696 6.99l65.338-65.338c-27.87-21.41-61.44-32.16-95.034-32.16-39.986 0-79.972 15.166-110.308 45.502l-163.382 163.382c-60.67 60.67-60.67 159.948 0 220.618l99.382 99.382c30.334 30.332 70.32 45.5 110.306 45.5 39.988 0 79.974-15.168 110.308-45.502l163.382-163.382c55.82-55.82 60.238-144.298 13.344-205.344l-65.34 65.34zM978.498 144.884l-99.382-99.382c-30.334-30.336-70.32-45.502-110.308-45.502-39.986 0-79.972 15.166-110.308 45.502l-163.382 163.382c-55.82 55.82-60.238 144.298-13.342 205.342l65.338-65.34c-4.558-9.050-6.988-19.16-6.988-29.694 0-17.616 6.744-34.060 18.992-46.308l163.382-163.382c12.248-12.248 28.694-18.994 46.308-18.994s34.060 6.746 46.308 18.994l99.382 99.382c12.248 12.248 18.992 28.694 18.992 46.308s-6.744 34.060-18.992 46.308l-163.382 163.382c-12.248 12.248-28.694 18.992-46.308 18.992-10.536 0-20.644-2.43-29.696-6.99l-65.338 65.338c27.872 21.41 61.44 32.16 95.034 32.16 39.988 0 79.974-15.168 110.308-45.502l163.382-163.382c60.67-60.666 60.67-159.944 0-220.614z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"link"
+				],
+				"defaultCode": 57361,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 34,
+				"order": 31,
+				"prevSize": 32,
+				"code": 57361,
+				"name": "link",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 30
+		},
+		{
+			"icon": {
+				"paths": [
+					"M0 64h1024v128h-1024zM384 256h640v128h-640zM384 448h640v128h-640zM384 640h640v128h-640zM0 832h1024v128h-1024zM256 320v384l-256-192z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"outdent"
+				],
+				"defaultCode": 57357,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 38,
+				"order": 32,
+				"prevSize": 32,
+				"code": 57357,
+				"name": "outdent",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 31
+		},
+		{
+			"icon": {
+				"paths": [
+					"M0 64h1024v128h-1024zM384 256h640v128h-640zM384 448h640v128h-640zM384 640h640v128h-640zM0 832h1024v128h-1024zM0 704v-384l256 192z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"indent"
+				],
+				"defaultCode": 57356,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 39,
+				"order": 33,
+				"prevSize": 32,
+				"code": 57356,
+				"name": "indent",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 32
+		},
+		{
+			"icon": {
+				"paths": [
+					"M384 832h640v128h-640zM384 448h640v128h-640zM384 64h640v128h-640zM192 0v256h-64v-192h-64v-64zM128 526v50h128v64h-192v-146l128-60v-50h-128v-64h192v146zM256 704v320h-192v-64h128v-64h-128v-64h128v-64h-128v-64z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"numlist"
+				],
+				"defaultCode": 57355,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 40,
+				"order": 34,
+				"prevSize": 32,
+				"code": 57355,
+				"name": "numlist",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 33
+		},
+		{
+			"icon": {
+				"paths": [
+					"M384 64h640v128h-640v-128zM384 448h640v128h-640v-128zM384 832h640v128h-640v-128zM0 128c0-70.692 57.308-128 128-128 70.692 0 128 57.308 128 128 0 70.692-57.308 128-128 128-70.692 0-128-57.308-128-128zM0 512c0-70.692 57.308-128 128-128 70.692 0 128 57.308 128 128 0 70.692-57.308 128-128 128-70.692 0-128-57.308-128-128zM0 896c0-70.692 57.308-128 128-128 70.692 0 128 57.308 128 128 0 70.692-57.308 128-128 128-70.692 0-128-57.308-128-128z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"bullist"
+				],
+				"defaultCode": 57354,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 41,
+				"order": 35,
+				"prevSize": 32,
+				"code": 57354,
+				"name": "bullist",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 34
+		},
+		{
+			"icon": {
+				"paths": [
+					"M64 0h384v64h-384zM576 0h384v64h-384zM952 320h-56v-256h-256v256h-256v-256h-256v256h-56c-39.6 0-72 32.4-72 72v560c0 39.6 32.4 72 72 72h304c39.6 0 72-32.4 72-72v-376h128v376c0 39.6 32.4 72 72 72h304c39.6 0 72-32.4 72-72v-560c0-39.6-32.4-72-72-72zM348 960h-248c-19.8 0-36-14.4-36-32s16.2-32 36-32h248c19.8 0 36 14.4 36 32s-16.2 32-36 32zM544 512h-64c-17.6 0-32-14.4-32-32s14.4-32 32-32h64c17.6 0 32 14.4 32 32s-14.4 32-32 32zM924 960h-248c-19.8 0-36-14.4-36-32s16.2-32 36-32h248c19.8 0 36 14.4 36 32s-16.2 32-36 32z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"searchreplace"
+				],
+				"defaultCode": 57353,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 42,
+				"order": 36,
+				"prevSize": 32,
+				"code": 57353,
+				"name": "searchreplace",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 35
+		},
+		{
+			"icon": {
+				"paths": [
+					"M832 320v-160c0-17.6-14.4-32-32-32h-224v-64c0-35.2-28.8-64-64-64h-128c-35.204 0-64 28.8-64 64v64h-224c-17.602 0-32 14.4-32 32v640c0 17.6 14.398 32 32 32h288v192h448l192-192v-512h-192zM384 64.114c0.034-0.038 0.072-0.078 0.114-0.114h127.768c0.042 0.036 0.082 0.076 0.118 0.114l0 63.886h-128v-63.886zM192 256v-64h512v64h-512zM832 933.49v-101.49h101.49l-101.49 101.49zM960 768h-192v192h-320v-576h512v384z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"paste"
+				],
+				"defaultCode": 57352,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 43,
+				"order": 37,
+				"prevSize": 32,
+				"code": 57352,
+				"name": "paste",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 36
+		},
+		{
+			"icon": {
+				"paths": [
+					"M890.774 709.154c-45.654-45.556-103.728-69.072-157.946-69.072h-29.112l-63.904-64.008 255.62-256.038c63.904-64.010 63.904-192.028 0-256.038l-383.43 384.056-383.432-384.054c-63.904 64.008-63.904 192.028 0 256.038l255.622 256.034-63.906 64.008h-29.114c-54.22 0-112.292 23.518-157.948 69.076-81.622 81.442-92.65 202.484-24.63 270.35 29.97 29.902 70.288 44.494 112.996 44.494 54.216 0 112.29-23.514 157.946-69.072 53.584-53.464 76.742-124 67.084-185.348l65.384-65.488 65.376 65.488c-9.656 61.348 13.506 131.882 67.084 185.348 45.662 45.558 103.732 69.072 157.948 69.072 42.708 0 83.024-14.592 112.994-44.496 68.020-67.866 56.988-188.908-24.632-270.35zM353.024 845.538c-7.698 17.882-19.010 34.346-33.626 48.926-14.636 14.604-31.172 25.918-49.148 33.624-16.132 6.916-32.96 10.568-48.662 10.568-15.146 0-36.612-3.402-52.862-19.612-16.136-16.104-19.52-37.318-19.52-52.288 0-15.542 3.642-32.21 10.526-48.212 7.7-17.884 19.014-34.346 33.626-48.926 14.634-14.606 31.172-25.914 49.15-33.624 16.134-6.914 32.96-10.568 48.664-10.568 15.146 0 36.612 3.4 52.858 19.614 16.134 16.098 19.522 37.316 19.522 52.284 0.002 15.542-3.638 32.216-10.528 48.214zM512.004 666.596c-49.914 0-90.376-40.532-90.376-90.526 0-49.992 40.462-90.52 90.376-90.52s90.372 40.528 90.372 90.52c0 49.998-40.46 90.526-90.372 90.526zM855.272 919.042c-16.248 16.208-37.712 19.612-52.86 19.612-15.704 0-32.53-3.652-48.666-10.568-17.972-7.706-34.508-19.020-49.142-33.624-14.614-14.58-25.926-31.042-33.626-48.926-6.886-15.998-10.526-32.672-10.526-48.212 0-14.966 3.384-36.188 19.52-52.286 16.246-16.208 37.712-19.614 52.86-19.614 15.7 0 32.53 3.654 48.66 10.568 17.978 7.708 34.516 19.018 49.15 33.624 14.61 14.58 25.924 31.042 33.626 48.926 6.884 15.998 10.526 32.67 10.526 48.212-0.002 14.97-3.39 36.186-19.522 52.288z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"cut"
+				],
+				"defaultCode": 57351,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 44,
+				"order": 38,
+				"prevSize": 32,
+				"code": 57351,
+				"name": "cut",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 37
+		},
+		{
+			"icon": {
+				"paths": [
+					"M0 64h1024v128h-1024zM0 256h1024v128h-1024zM0 448h1024v128h-1024zM0 640h1024v128h-1024zM0 832h1024v128h-1024z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"alignjustify"
+				],
+				"defaultCode": 57350,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 45,
+				"order": 39,
+				"prevSize": 32,
+				"code": 57350,
+				"name": "alignjustify",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 38
+		},
+		{
+			"icon": {
+				"paths": [
+					"M0 64h1024v128h-1024zM384 256h640v128h-640zM384 640h640v128h-640zM0 448h1024v128h-1024zM0 832h1024v128h-1024z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"alignright"
+				],
+				"defaultCode": 57349,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 46,
+				"order": 40,
+				"prevSize": 32,
+				"code": 57349,
+				"name": "alignright",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 39
+		},
+		{
+			"icon": {
+				"paths": [
+					"M0 64h1024v128h-1024zM192 256h640v128h-640zM192 640h640v128h-640zM0 448h1024v128h-1024zM0 832h1024v128h-1024z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"aligncenter"
+				],
+				"defaultCode": 57348,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 47,
+				"order": 41,
+				"prevSize": 32,
+				"code": 57348,
+				"name": "aligncenter",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 40
+		},
+		{
+			"icon": {
+				"paths": [
+					"M0 64h1024v128h-1024zM0 256h640v128h-640zM0 640h640v128h-640zM0 448h1024v128h-1024zM0 832h1024v128h-1024z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"alignleft"
+				],
+				"defaultCode": 57347,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 48,
+				"order": 42,
+				"prevSize": 32,
+				"code": 57347,
+				"name": "alignleft",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 41
+		},
+		{
+			"icon": {
+				"paths": [
+					"M1024 592.458v-160.916l-159.144-15.914c-8.186-30.042-20.088-58.548-35.21-84.98l104.596-127.838-113.052-113.050-127.836 104.596c-26.434-15.124-54.942-27.026-84.982-35.208l-15.914-159.148h-160.916l-15.914 159.146c-30.042 8.186-58.548 20.086-84.98 35.208l-127.838-104.594-113.050 113.050 104.596 127.836c-15.124 26.432-27.026 54.94-35.21 84.98l-159.146 15.916v160.916l159.146 15.914c8.186 30.042 20.086 58.548 35.21 84.982l-104.596 127.836 113.048 113.048 127.838-104.596c26.432 15.124 54.94 27.028 84.98 35.21l15.916 159.148h160.916l15.914-159.144c30.042-8.186 58.548-20.088 84.982-35.21l127.836 104.596 113.048-113.048-104.596-127.836c15.124-26.434 27.028-54.942 35.21-84.98l159.148-15.92zM704 576l-128 128h-128l-128-128v-128l128-128h128l128 128v128z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"fullpage"
+				],
+				"defaultCode": 57346,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 49,
+				"order": 43,
+				"prevSize": 32,
+				"code": 57346,
+				"name": "fullpage",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 42
+		},
+		{
+			"icon": {
+				"paths": [
+					"M903.432 199.43l-142.864-142.862c-31.112-31.112-92.568-56.568-136.568-56.568h-480c-44 0-80 36-80 80v864c0 44 36 80 80 80h736c44 0 80-36 80-80v-608c0-44-25.456-105.458-56.568-136.57zM858.178 244.686c3.13 3.13 6.25 6.974 9.28 11.314h-163.458v-163.456c4.34 3.030 8.184 6.15 11.314 9.28l142.864 142.862zM896 944c0 8.672-7.328 16-16 16h-736c-8.672 0-16-7.328-16-16v-864c0-8.672 7.328-16 16-16h480c4.832 0 10.254 0.61 16 1.704v254.296h254.296c1.094 5.746 1.704 11.166 1.704 16v608z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"newdocument"
+				],
+				"defaultCode": 57345,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 50,
+				"order": 44,
+				"prevSize": 32,
+				"code": 57345,
+				"name": "newdocument",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 43
+		},
+		{
+			"icon": {
+				"paths": [
+					"M896 0h-896v1024h1024v-896l-128-128zM512 128h128v256h-128v-256zM896 896h-768v-768h64v320h576v-320h74.978l53.022 53.018v714.982z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"save"
+				],
+				"defaultCode": 57344,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 51,
+				"order": 45,
+				"prevSize": 32,
+				"code": 57344,
+				"name": "save",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 44
+		},
+		{
+			"icon": {
+				"paths": [
+					"M128 544l288 288 480-480-128-128-352 352-160-160z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"defaultCode": 57395,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 52,
+				"order": 46,
+				"prevSize": 32,
+				"code": 57395,
+				"name": "checkbox",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 45
+		},
+		{
+			"icon": {
+				"paths": [
+					"M512 512v128h32l32-64h64v256h-48v64h224v-64h-48v-256h64l32 64h32v-128zM832 320v-160c0-17.6-14.4-32-32-32h-224v-64c0-35.2-28.8-64-64-64h-128c-35.204 0-64 28.8-64 64v64h-224c-17.602 0-32 14.4-32 32v640c0 17.6 14.398 32 32 32h288v192h640v-704h-192zM384 64.114c0.034-0.038 0.072-0.078 0.114-0.114h127.768c0.042 0.036 0.082 0.076 0.118 0.114l0 63.886h-128v-63.886zM192 256v-64h512v64h-512zM960 960h-512v-576h512v576z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"pastetext"
+				],
+				"defaultCode": 57397,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 53,
+				"order": 47,
+				"prevSize": 32,
+				"code": 57397,
+				"name": "pastetext",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 46
+		},
+		{
+			"icon": {
+				"paths": [
+					"M1024 0v384l-138.26-138.26-212 212-107.48-107.48 212-212-138.26-138.26zM245.74 138.26l212 212-107.48 107.48-212-212-138.26 138.26v-384h384zM885.74 778.26l138.26-138.26v384h-384l138.26-138.26-212-212 107.48-107.48zM457.74 673.74l-212 212 138.26 138.26h-384v-384l138.26 138.26 212-212z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"fullscreen"
+				],
+				"defaultCode": 57379,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 16,
+				"order": 48,
+				"prevSize": 32,
+				"code": 57379,
+				"name": "fullscreen",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 47
+		},
+		{
+			"icon": {
+				"paths": [
+					"M256 64h512v128h-512zM960 256h-896c-35.2 0-64 28.8-64 64v320c0 35.2 28.796 64 64 64h192v256h512v-256h192c35.2 0 64-28.8 64-64v-320c0-35.2-28.8-64-64-64zM704 896h-384v-320h384v320zM974.4 352c0 25.626-20.774 46.4-46.398 46.4-25.626 0-46.402-20.774-46.402-46.4s20.776-46.4 46.402-46.4c25.626 0 46.398 20.774 46.398 46.4z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"print"
+				],
+				"defaultCode": 57378,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 17,
+				"order": 49,
+				"prevSize": 32,
+				"code": 57378,
+				"name": "print",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 48
+		},
+		{
+			"icon": {
+				"paths": [
+					"M512 0c-282.77 0-512 229.228-512 512 0 282.77 229.228 512 512 512 282.77 0 512-229.23 512-512 0-282.772-229.23-512-512-512zM512 944c-238.586 0-432-193.412-432-432 0-238.586 193.414-432 432-432 238.59 0 432 193.414 432 432 0 238.588-193.41 432-432 432zM384 320c0 35.346-28.654 64-64 64s-64-28.654-64-64 28.654-64 64-64 64 28.654 64 64zM768 320c0 35.346-28.652 64-64 64s-64-28.654-64-64 28.652-64 64-64 64 28.654 64 64zM512 652c141.074 0 262.688-57.532 318.462-123.192-20.872 171.22-156.288 303.192-318.462 303.192-162.118 0-297.498-132.026-318.444-303.168 55.786 65.646 177.386 123.168 318.444 123.168z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"emoticons"
+				],
+				"defaultCode": 57377,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 18,
+				"order": 50,
+				"prevSize": 32,
+				"code": 57377,
+				"name": "emoticons",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 49
+		},
+		{
+			"icon": {
+				"paths": [
+					"M225 448c123.712 0 224 100.29 224 224 0 123.712-100.288 224-224 224-123.712 0-224-100.288-224-224l-1-32c0-247.424 200.576-448 448-448v128c-85.474 0-165.834 33.286-226.274 93.726-11.634 11.636-22.252 24.016-31.83 37.020 11.438-1.8 23.16-2.746 35.104-2.746zM801 448c123.71 0 224 100.29 224 224 0 123.712-100.29 224-224 224-123.71 0-224-100.288-224-224l-1-32c0-247.424 200.576-448 448-448v128c-85.474 0-165.834 33.286-226.274 93.726-11.636 11.636-22.254 24.016-31.832 37.020 11.44-1.8 23.16-2.746 35.106-2.746z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"blockquote"
+				],
+				"defaultCode": 57358,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 37,
+				"order": 51,
+				"prevSize": 32,
+				"code": 57358,
+				"name": "blockquote",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 50
+		},
+		{
+			"icon": {
+				"paths": [
+					"M761.862 1024c113.726-206.032 132.888-520.306-313.862-509.824v253.824l-384-384 384-384v248.372c534.962-13.942 594.57 472.214 313.862 775.628z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"undo"
+				],
+				"defaultCode": 57359,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 36,
+				"order": 52,
+				"prevSize": 32,
+				"code": 57359,
+				"name": "undo",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 51
+		},
+		{
+			"icon": {
+				"paths": [
+					"M576 248.372v-248.372l384 384-384 384v-253.824c-446.75-10.482-427.588 303.792-313.86 509.824-280.712-303.414-221.1-789.57 313.86-775.628z"
+				],
+				"attrs": [],
+				"isMulticolor": false,
+				"tags": [
+					"redo"
+				],
+				"defaultCode": 57360,
+				"grid": 0
+			},
+			"attrs": [],
+			"properties": {
+				"id": 35,
+				"order": 53,
+				"prevSize": 32,
+				"code": 57360,
+				"name": "redo",
+				"ligatures": ""
+			},
+			"setIdx": 0,
+			"iconIdx": 52
+		}
+	],
+	"height": 1024,
+	"metadata": {
+		"name": "tinymce"
+	},
+	"preferences": {
+		"showGlyphs": true,
+		"showQuickUse": true,
+		"showQuickUse2": true,
+		"showSVGs": true,
+		"fontPref": {
+			"prefix": "icon-",
+			"metadata": {
+				"fontFamily": "tinymce",
+				"majorVersion": 1,
+				"minorVersion": 0
+			},
+			"metrics": {
+				"emSize": 1024,
+				"baseline": 6.25,
+				"whitespace": 50
+			}
+		},
+		"imagePref": {
+			"prefix": "icon-",
+			"png": true,
+			"useClassSelector": true,
+			"color": 4473924,
+			"bgColor": 16777215
+		},
+		"historySize": 100,
+		"showCodes": true
+	}
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/tinymce.svg	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,63 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata>Generated by IcoMoon</metadata>
+<defs>
+<font id="tinymce" horiz-adv-x="1024">
+<font-face units-per-em="1024" ascent="960" descent="-64" />
+<missing-glyph horiz-adv-x="1024" />
+<glyph unicode="&#x20;" d="" horiz-adv-x="512" />
+<glyph unicode="&#xe000;" d="M896 960h-896v-1024h1024v896l-128 128zM512 832h128v-256h-128v256zM896 64h-768v768h64v-320h576v320h74.978l53.022-53.018v-714.982z" />
+<glyph unicode="&#xe001;" d="M903.432 760.57l-142.864 142.862c-31.112 31.112-92.568 56.568-136.568 56.568h-480c-44 0-80-36-80-80v-864c0-44 36-80 80-80h736c44 0 80 36 80 80v608c0 44-25.456 105.458-56.568 136.57zM858.178 715.314c3.13-3.13 6.25-6.974 9.28-11.314h-163.458v163.456c4.34-3.030 8.184-6.15 11.314-9.28l142.864-142.862zM896 16c0-8.672-7.328-16-16-16h-736c-8.672 0-16 7.328-16 16v864c0 8.672 7.328 16 16 16h480c4.832 0 10.254-0.61 16-1.704v-254.296h254.296c1.094-5.746 1.704-11.166 1.704-16v-608z" />
+<glyph unicode="&#xe002;" d="M1024 367.542v160.916l-159.144 15.914c-8.186 30.042-20.088 58.548-35.21 84.98l104.596 127.838-113.052 113.050-127.836-104.596c-26.434 15.124-54.942 27.026-84.982 35.208l-15.914 159.148h-160.916l-15.914-159.146c-30.042-8.186-58.548-20.086-84.98-35.208l-127.838 104.594-113.050-113.050 104.596-127.836c-15.124-26.432-27.026-54.94-35.21-84.98l-159.146-15.916v-160.916l159.146-15.914c8.186-30.042 20.086-58.548 35.21-84.982l-104.596-127.836 113.048-113.048 127.838 104.596c26.432-15.124 54.94-27.028 84.98-35.21l15.916-159.148h160.916l15.914 159.144c30.042 8.186 58.548 20.088 84.982 35.21l127.836-104.596 113.048 113.048-104.596 127.836c15.124 26.434 27.028 54.942 35.21 84.98l159.148 15.92zM704 384l-128-128h-128l-128 128v128l128 128h128l128-128v-128z" />
+<glyph unicode="&#xe003;" d="M0 896h1024v-128h-1024zM0 704h640v-128h-640zM0 320h640v-128h-640zM0 512h1024v-128h-1024zM0 128h1024v-128h-1024z" />
+<glyph unicode="&#xe004;" d="M0 896h1024v-128h-1024zM192 704h640v-128h-640zM192 320h640v-128h-640zM0 512h1024v-128h-1024zM0 128h1024v-128h-1024z" />
+<glyph unicode="&#xe005;" d="M0 896h1024v-128h-1024zM384 704h640v-128h-640zM384 320h640v-128h-640zM0 512h1024v-128h-1024zM0 128h1024v-128h-1024z" />
+<glyph unicode="&#xe006;" d="M0 896h1024v-128h-1024zM0 704h1024v-128h-1024zM0 512h1024v-128h-1024zM0 320h1024v-128h-1024zM0 128h1024v-128h-1024z" />
+<glyph unicode="&#xe007;" d="M890.774 250.846c-45.654 45.556-103.728 69.072-157.946 69.072h-29.112l-63.904 64.008 255.62 256.038c63.904 64.010 63.904 192.028 0 256.038l-383.43-384.056-383.432 384.054c-63.904-64.008-63.904-192.028 0-256.038l255.622-256.034-63.906-64.008h-29.114c-54.22 0-112.292-23.518-157.948-69.076-81.622-81.442-92.65-202.484-24.63-270.35 29.97-29.902 70.288-44.494 112.996-44.494 54.216 0 112.29 23.514 157.946 69.072 53.584 53.464 76.742 124 67.084 185.348l65.384 65.488 65.376-65.488c-9.656-61.348 13.506-131.882 67.084-185.348 45.662-45.558 103.732-69.072 157.948-69.072 42.708 0 83.024 14.592 112.994 44.496 68.020 67.866 56.988 188.908-24.632 270.35zM353.024 114.462c-7.698-17.882-19.010-34.346-33.626-48.926-14.636-14.604-31.172-25.918-49.148-33.624-16.132-6.916-32.96-10.568-48.662-10.568-15.146 0-36.612 3.402-52.862 19.612-16.136 16.104-19.52 37.318-19.52 52.288 0 15.542 3.642 32.21 10.526 48.212 7.7 17.884 19.014 34.346 33.626 48.926 14.634 14.606 31.172 25.914 49.15 33.624 16.134 6.914 32.96 10.568 48.664 10.568 15.146 0 36.612-3.4 52.858-19.614 16.134-16.098 19.522-37.316 19.522-52.284 0.002-15.542-3.638-32.216-10.528-48.214zM512.004 293.404c-49.914 0-90.376 40.532-90.376 90.526 0 49.992 40.462 90.52 90.376 90.52s90.372-40.528 90.372-90.52c0-49.998-40.46-90.526-90.372-90.526zM855.272 40.958c-16.248-16.208-37.712-19.612-52.86-19.612-15.704 0-32.53 3.652-48.666 10.568-17.972 7.706-34.508 19.020-49.142 33.624-14.614 14.58-25.926 31.042-33.626 48.926-6.886 15.998-10.526 32.672-10.526 48.212 0 14.966 3.384 36.188 19.52 52.286 16.246 16.208 37.712 19.614 52.86 19.614 15.7 0 32.53-3.654 48.66-10.568 17.978-7.708 34.516-19.018 49.15-33.624 14.61-14.58 25.924-31.042 33.626-48.926 6.884-15.998 10.526-32.67 10.526-48.212-0.002-14.97-3.39-36.186-19.522-52.288z" />
+<glyph unicode="&#xe008;" d="M832 640v160c0 17.6-14.4 32-32 32h-224v64c0 35.2-28.8 64-64 64h-128c-35.204 0-64-28.8-64-64v-64h-224c-17.602 0-32-14.4-32-32v-640c0-17.6 14.398-32 32-32h288v-192h448l192 192v512h-192zM384 895.886c0.034 0.038 0.072 0.078 0.114 0.114h127.768c0.042-0.036 0.082-0.076 0.118-0.114v-63.886h-128v63.886zM192 704v64h512v-64h-512zM832 26.51v101.49h101.49l-101.49-101.49zM960 192h-192v-192h-320v576h512v-384z" />
+<glyph unicode="&#xe009;" d="M64 960h384v-64h-384zM576 960h384v-64h-384zM952 640h-56v256h-256v-256h-256v256h-256v-256h-56c-39.6 0-72-32.4-72-72v-560c0-39.6 32.4-72 72-72h304c39.6 0 72 32.4 72 72v376h128v-376c0-39.6 32.4-72 72-72h304c39.6 0 72 32.4 72 72v560c0 39.6-32.4 72-72 72zM348 0h-248c-19.8 0-36 14.4-36 32s16.2 32 36 32h248c19.8 0 36-14.4 36-32s-16.2-32-36-32zM544 448h-64c-17.6 0-32 14.4-32 32s14.4 32 32 32h64c17.6 0 32-14.4 32-32s-14.4-32-32-32zM924 0h-248c-19.8 0-36 14.4-36 32s16.2 32 36 32h248c19.8 0 36-14.4 36-32s-16.2-32-36-32z" />
+<glyph unicode="&#xe00a;" d="M384 896h640v-128h-640v128zM384 512h640v-128h-640v128zM384 128h640v-128h-640v128zM0 832c0 70.692 57.308 128 128 128s128-57.308 128-128c0-70.692-57.308-128-128-128s-128 57.308-128 128zM0 448c0 70.692 57.308 128 128 128s128-57.308 128-128c0-70.692-57.308-128-128-128s-128 57.308-128 128zM0 64c0 70.692 57.308 128 128 128s128-57.308 128-128c0-70.692-57.308-128-128-128s-128 57.308-128 128z" />
+<glyph unicode="&#xe00b;" d="M384 128h640v-128h-640zM384 512h640v-128h-640zM384 896h640v-128h-640zM192 960v-256h-64v192h-64v64zM128 434v-50h128v-64h-192v146l128 60v50h-128v64h192v-146zM256 256v-320h-192v64h128v64h-128v64h128v64h-128v64z" />
+<glyph unicode="&#xe00c;" d="M0 896h1024v-128h-1024zM384 704h640v-128h-640zM384 512h640v-128h-640zM384 320h640v-128h-640zM0 128h1024v-128h-1024zM0 256v384l256-192z" />
+<glyph unicode="&#xe00d;" d="M0 896h1024v-128h-1024zM384 704h640v-128h-640zM384 512h640v-128h-640zM384 320h640v-128h-640zM0 128h1024v-128h-1024zM256 640v-384l-256 192z" />
+<glyph unicode="&#xe00e;" d="M225 512c123.712 0 224-100.29 224-224 0-123.712-100.288-224-224-224s-224 100.288-224 224l-1 32c0 247.424 200.576 448 448 448v-128c-85.474 0-165.834-33.286-226.274-93.726-11.634-11.636-22.252-24.016-31.83-37.020 11.438 1.8 23.16 2.746 35.104 2.746zM801 512c123.71 0 224-100.29 224-224 0-123.712-100.29-224-224-224s-224 100.288-224 224l-1 32c0 247.424 200.576 448 448 448v-128c-85.474 0-165.834-33.286-226.274-93.726-11.636-11.636-22.254-24.016-31.832-37.020 11.44 1.8 23.16 2.746 35.106 2.746z" />
+<glyph unicode="&#xe00f;" d="M761.862-64c113.726 206.032 132.888 520.306-313.862 509.824v-253.824l-384 384 384 384v-248.372c534.962 13.942 594.57-472.214 313.862-775.628z" />
+<glyph unicode="&#xe010;" d="M576 711.628v248.372l384-384-384-384v253.824c-446.75 10.482-427.588-303.792-313.86-509.824-280.712 303.414-221.1 789.57 313.86 775.628z" />
+<glyph unicode="&#xe011;" d="M320 256c17.6-17.6 47.274-16.726 65.942 1.942l316.118 316.116c18.668 18.668 19.54 48.342 1.94 65.942s-47.274 16.726-65.942-1.942l-316.116-316.116c-18.668-18.668-19.542-48.342-1.942-65.942zM476.888 284.888c4.56-9.050 6.99-19.16 6.99-29.696 0-17.616-6.744-34.060-18.992-46.308l-163.382-163.382c-12.248-12.248-28.694-18.992-46.308-18.992s-34.060 6.744-46.308 18.992l-99.382 99.382c-12.248 12.248-18.992 28.694-18.992 46.308s6.744 34.060 18.992 46.308l163.382 163.382c12.248 12.248 28.694 18.994 46.308 18.994 10.536 0 20.644-2.43 29.696-6.99l65.338 65.338c-27.87 21.41-61.44 32.16-95.034 32.16-39.986 0-79.972-15.166-110.308-45.502l-163.382-163.382c-60.67-60.67-60.67-159.948 0-220.618l99.382-99.382c30.334-30.332 70.32-45.5 110.306-45.5 39.988 0 79.974 15.168 110.308 45.502l163.382 163.382c55.82 55.82 60.238 144.298 13.344 205.344l-65.34-65.34zM978.498 815.116l-99.382 99.382c-30.334 30.336-70.32 45.502-110.308 45.502-39.986 0-79.972-15.166-110.308-45.502l-163.382-163.382c-55.82-55.82-60.238-144.298-13.342-205.342l65.338 65.34c-4.558 9.050-6.988 19.16-6.988 29.694 0 17.616 6.744 34.060 18.992 46.308l163.382 163.382c12.248 12.248 28.694 18.994 46.308 18.994s34.060-6.746 46.308-18.994l99.382-99.382c12.248-12.248 18.992-28.694 18.992-46.308s-6.744-34.060-18.992-46.308l-163.382-163.382c-12.248-12.248-28.694-18.992-46.308-18.992-10.536 0-20.644 2.43-29.696 6.99l-65.338-65.338c27.872-21.41 61.44-32.16 95.034-32.16 39.988 0 79.974 15.168 110.308 45.502l163.382 163.382c60.67 60.666 60.67 159.944 0 220.614z" />
+<glyph unicode="&#xe012;" d="M476.888 284.886c4.56-9.048 6.99-19.158 6.99-29.696 0-17.616-6.744-34.058-18.992-46.308l-163.38-163.38c-12.248-12.248-28.696-18.992-46.308-18.992s-34.060 6.744-46.308 18.992l-99.38 99.38c-12.248 12.25-18.992 28.696-18.992 46.308s6.744 34.060 18.992 46.308l163.38 163.382c12.248 12.246 28.696 18.992 46.308 18.992 10.538 0 20.644-2.43 29.696-6.988l65.338 65.336c-27.87 21.41-61.44 32.16-95.034 32.16-39.986 0-79.972-15.166-110.308-45.502l-163.38-163.382c-60.67-60.67-60.67-159.95 0-220.618l99.38-99.382c30.334-30.332 70.32-45.5 110.306-45.5 39.988 0 79.974 15.168 110.308 45.502l163.38 163.38c55.82 55.82 60.238 144.298 13.344 205.346l-65.34-65.338zM978.496 815.116l-99.38 99.382c-30.334 30.336-70.32 45.502-110.308 45.502-39.986 0-79.97-15.166-110.306-45.502l-163.382-163.382c-55.82-55.82-60.238-144.298-13.342-205.342l65.338 65.34c-4.558 9.050-6.988 19.16-6.988 29.694 0 17.616 6.744 34.060 18.992 46.308l163.382 163.382c12.246 12.248 28.694 18.994 46.306 18.994 17.616 0 34.060-6.746 46.308-18.994l99.38-99.382c12.248-12.248 18.992-28.694 18.992-46.308s-6.744-34.060-18.992-46.308l-163.38-163.382c-12.248-12.248-28.694-18.992-46.308-18.992-10.536 0-20.644 2.43-29.696 6.99l-65.338-65.338c27.872-21.41 61.44-32.16 95.034-32.16 39.988 0 79.974 15.168 110.308 45.504l163.38 163.38c60.672 60.666 60.672 159.944 0 220.614zM233.368 681.376l-191.994 191.994 45.256 45.256 191.994-191.994zM384 960h64v-192h-64zM0 576h192v-64h-192zM790.632 214.624l191.996-191.996-45.256-45.256-191.996 191.996zM576 128h64v-192h-64zM832 384h192v-64h-192z" />
+<glyph unicode="&#xe013;" d="M192 960v-1024l320 320 320-320v1024h-640zM768 90.51l-256 256-256-256v805.49h512v-805.49z" />
+<glyph unicode="&#xe014;" d="M0 832v-832h1024v832h-1024zM960 64h-896v704h896v-704zM704 608c0 53.019 42.981 96 96 96s96-42.981 96-96c0-53.019-42.981-96-96-96s-96 42.981-96 96zM896 128h-768l192 512 256-320 128 96z" />
+<glyph unicode="&#xe015;" d="M0 832v-768h1024v768h-1024zM192 128h-128v128h128v-128zM192 384h-128v128h128v-128zM192 640h-128v128h128v-128zM768 128h-512v640h512v-640zM960 128h-128v128h128v-128zM960 384h-128v128h128v-128zM960 640h-128v128h128v-128zM384 640v-384l256 192z" />
+<glyph unicode="&#xe016;" d="M448 256h128v-128h-128zM704 704c35.346 0 64-28.654 64-64v-192l-192-128h-128v64l192 128v64h-320v128h384zM512 864c-111.118 0-215.584-43.272-294.156-121.844s-121.844-183.038-121.844-294.156c0-111.118 43.272-215.584 121.844-294.156s183.038-121.844 294.156-121.844c111.118 0 215.584 43.272 294.156 121.844s121.844 183.038 121.844 294.156c0 111.118-43.272 215.584-121.844 294.156s-183.038 121.844-294.156 121.844zM512 960v0c282.77 0 512-229.23 512-512s-229.23-512-512-512c-282.77 0-512 229.23-512 512s229.23 512 512 512z" />
+<glyph unicode="&#xe017;" d="M320 704l-256-256 256-256h128l-256 256 256 256zM704 704h-128l256-256-256-256h128l256 256z" />
+<glyph unicode="&#xe018;" d="M512 768c-212.076 0-384-171.922-384-384s171.922-384 384-384c212.074 0 384 171.922 384 384s-171.926 384-384 384zM715.644 180.354c-54.392-54.396-126.716-84.354-203.644-84.354s-149.25 29.958-203.646 84.354c-54.396 54.394-84.354 126.718-84.354 203.646s29.958 149.25 84.354 203.646c54.396 54.396 126.718 84.354 203.646 84.354s149.252-29.958 203.642-84.354c54.402-54.396 84.358-126.718 84.358-203.646s-29.958-149.252-84.356-203.646zM325.93 756.138l-42.94 85.878c-98.874-49.536-179.47-130.132-229.006-229.008l85.876-42.94c40.248 80.336 105.732 145.822 186.070 186.070zM884.134 570.070l85.878 42.938c-49.532 98.876-130.126 179.472-229.004 229.008l-42.944-85.878c80.338-40.248 145.824-105.732 186.070-186.068zM512 576h-64v-192c0-10.11 4.7-19.11 12.022-24.972l-0.012-0.016 160-128 39.976 49.976-147.986 118.39v176.622z" />
+<glyph unicode="&#xe019;" d="M512 640c-209.368 0-395.244-100.556-512-256 116.756-155.446 302.632-256 512-256s395.244 100.554 512 256c-116.756 155.444-302.632 256-512 256zM448 512c35.346 0 64-28.654 64-64s-28.654-64-64-64-64 28.654-64 64 28.654 64 64 64zM773.616 254.704c-39.648-20.258-81.652-35.862-124.846-46.376-44.488-10.836-90.502-16.328-136.77-16.328-46.266 0-92.282 5.492-136.768 16.324-43.194 10.518-85.198 26.122-124.846 46.376-63.020 32.202-120.222 76.41-167.64 129.298 47.418 52.888 104.62 97.1 167.64 129.298 32.336 16.522 66.242 29.946 101.082 40.040-19.888-30.242-31.468-66.434-31.468-105.336 0-106.040 85.962-192 192-192s192 85.96 192 192c0 38.902-11.582 75.094-31.466 105.34 34.838-10.096 68.744-23.52 101.082-40.042 63.022-32.198 120.218-76.408 167.638-129.298-47.42-52.886-104.618-97.1-167.638-129.296zM860.918 716.278c-108.72 55.554-226.112 83.722-348.918 83.722s-240.198-28.168-348.918-83.722c-58.772-30.032-113.732-67.904-163.082-112.076v-109.206c55.338 58.566 120.694 107.754 192.194 144.29 99.62 50.904 207.218 76.714 319.806 76.714s220.186-25.81 319.804-76.716c71.502-36.536 136.858-85.724 192.196-144.29v109.206c-49.35 44.174-104.308 82.046-163.082 112.078z" />
+<glyph unicode="&#xe01a;" d="M322.018 128l57.6 192h264.764l57.6-192h113.632l-191.996 640h-223.236l-192-640h113.636zM475.618 640h72.764l57.6-192h-187.964l57.6 192z" />
+<glyph unicode="&#xe01b;" d="M0 896v-896h1024v896h-1024zM384 320v192h256v-192h-256zM640 256v-192h-256v192h256zM640 768v-192h-256v192h256zM320 768v-192h-256v192h256zM64 512h256v-192h-256v192zM704 512h256v-192h-256v192zM704 576v192h256v-192h-256zM64 256h256v-192h-256v192zM704 64v192h256v-192h-256z" />
+<glyph unicode="&#xe01c;" d="M0 512h1024v-128h-1024z" />
+<glyph unicode="&#xe01d;" d="M0 64h576v-128h-576zM192 960h704v-128h-704zM277.388 128l204.688 784.164 123.85-32.328-196.25-751.836zM929.774-64l-129.774 129.774-129.774-129.774-62.226 62.226 129.774 129.774-129.774 129.774 62.226 62.226 129.774-129.774 129.774 129.774 62.226-62.226-129.774-129.774 129.774-129.774z" />
+<glyph unicode="&#xe01e;" d="M768 50v-50h128v-64h-192v146l128 60v50h-128v64h192v-146zM676 704h-136l-188-188-188 188h-136l256-256-256-256h136l188 188 188-188h136l-256 256z" />
+<glyph unicode="&#xe01f;" d="M768 754v-50h128v-64h-192v146l128 60v50h-128v64h192v-146zM676 704h-136l-188-188-188 188h-136l256-256-256-256h136l188 188 188-188h136l-256 256z" />
+<glyph unicode="&#xe020;" d="M704 64h256l64 128v-256h-384v214.214c131.112 56.484 224 197.162 224 361.786 0 214.432-157.598 382.266-352 382.266-194.406 0-352-167.832-352-382.266 0-164.624 92.886-305.302 224-361.786v-214.214h-384v256l64-128h256v32.59c-187.63 66.46-320 227.402-320 415.41 0 247.424 229.23 448 512 448s512-200.576 512-448c0-188.008-132.37-348.95-320-415.41v-32.59z" />
+<glyph unicode="&#xe021;" d="M512 960c-282.77 0-512-229.228-512-512 0-282.77 229.228-512 512-512 282.77 0 512 229.23 512 512 0 282.772-229.23 512-512 512zM512 16c-238.586 0-432 193.412-432 432 0 238.586 193.414 432 432 432 238.59 0 432-193.414 432-432 0-238.588-193.41-432-432-432zM384 640c0-35.346-28.654-64-64-64s-64 28.654-64 64 28.654 64 64 64 64-28.654 64-64zM768 640c0-35.346-28.652-64-64-64s-64 28.654-64 64 28.652 64 64 64 64-28.654 64-64zM512 308c141.074 0 262.688 57.532 318.462 123.192-20.872-171.22-156.288-303.192-318.462-303.192-162.118 0-297.498 132.026-318.444 303.168 55.786-65.646 177.386-123.168 318.444-123.168z" />
+<glyph unicode="&#xe022;" d="M256 896h512v-128h-512zM960 704h-896c-35.2 0-64-28.8-64-64v-320c0-35.2 28.796-64 64-64h192v-256h512v256h192c35.2 0 64 28.8 64 64v320c0 35.2-28.8 64-64 64zM704 64h-384v320h384v-320zM974.4 608c0-25.626-20.774-46.4-46.398-46.4-25.626 0-46.402 20.774-46.402 46.4s20.776 46.4 46.402 46.4c25.626 0 46.398-20.774 46.398-46.4z" />
+<glyph unicode="&#xe023;" d="M1024 960v-384l-138.26 138.26-212-212-107.48 107.48 212 212-138.26 138.26zM245.74 821.74l212-212-107.48-107.48-212 212-138.26-138.26v384h384zM885.74 181.74l138.26 138.26v-384h-384l138.26 138.26-212 212 107.48 107.48zM457.74 286.26l-212-212 138.26-138.26h-384v384l138.26-138.26 212 212z" />
+<glyph unicode="&#xe024;" d="M128 704h128v-192h64v384c0 35.2-28.8 64-64 64h-128c-35.2 0-64-28.8-64-64v-384h64v192zM128 896h128v-128h-128v128zM960 896v64h-192c-35.202 0-64-28.8-64-64v-320c0-35.2 28.798-64 64-64h192v64h-192v320h192zM640 800v96c0 35.2-28.8 64-64 64h-192v-448h192c35.2 0 64 28.8 64 64v96c0 35.2-8.8 64-44 64 35.2 0 44 28.8 44 64zM576 576h-128v128h128v-128zM576 768h-128v128h128v-128zM832 384l-416-448-224 288 82 70 142-148 352 302z" />
+<glyph unicode="&#xe025;" d="M448 384h-192v128h192v192h128v-192h192v-128h-192v-192h-128zM1024 320v-384h-1024v384h128v-256h768v256z" />
+<glyph unicode="&#xe026;" d="M384 768h128v-64h-128zM576 768h128v-64h-128zM896 768v-256h-192v64h128v128h-64v64zM320 576h128v-64h-128zM512 576h128v-64h-128zM192 704v-128h64v-64h-128v256h192v-64zM384 384h128v-64h-128zM576 384h128v-64h-128zM896 384v-256h-192v64h128v128h-64v64zM320 192h128v-64h-128zM512 192h128v-64h-128zM192 320v-128h64v-64h-128v256h192v-64zM960 896h-896v-896h896v896zM1024 960v0-1024h-1024v1024h1024z" />
+<glyph unicode="&#xe027;" d="M0 448h128v-64h-128zM192 448h192v-64h-192zM448 448h128v-64h-128zM640 448h192v-64h-192zM896 448h128v-64h-128zM880 960l16-448h-768l16 448h32l16-384h640l16 384zM144-64l-16 384h768l-16-384h-32l-16 320h-640l-16-320z" />
+<glyph unicode="&#xe028;" d="M576 896c247.424 0 448-200.576 448-448s-200.576-448-448-448v96c94.024 0 182.418 36.614 248.902 103.098s103.098 154.878 103.098 248.902c0 94.022-36.614 182.418-103.098 248.902s-154.878 103.098-248.902 103.098c-94.022 0-182.418-36.614-248.902-103.098-51.14-51.138-84.582-115.246-97.306-184.902h186.208l-224-256-224 256h164.57c31.060 217.102 217.738 384 443.43 384zM768 512v-128h-256v320h128v-192z" />
+<glyph unicode="&#xe02a;" d="M707.88 475.348c37.498 44.542 60.12 102.008 60.12 164.652 0 141.16-114.842 256-256 256h-320v-896h384c141.158 0 256 114.842 256 256 0 92.956-49.798 174.496-124.12 219.348zM384 768h101.5c55.968 0 101.5-57.42 101.5-128s-45.532-128-101.5-128h-101.5v256zM543 128h-159v256h159c58.45 0 106-57.42 106-128s-47.55-128-106-128z" />
+<glyph unicode="&#xe02b;" d="M896 896v-64h-128l-320-768h128v-64h-448v64h128l320 768h-128v64z" />
+<glyph unicode="&#xe02c;" d="M704 896h128v-416c0-159.058-143.268-288-320-288-176.73 0-320 128.942-320 288v416h128v-416c0-40.166 18.238-78.704 51.354-108.506 36.896-33.204 86.846-51.494 140.646-51.494s103.75 18.29 140.646 51.494c33.116 29.802 51.354 68.34 51.354 108.506v416zM192 128h640v-128h-640z" />
+<glyph unicode="&#xe02d;" d="M731.42 442.964c63.92-47.938 100.58-116.086 100.58-186.964s-36.66-139.026-100.58-186.964c-59.358-44.518-137.284-69.036-219.42-69.036-82.138 0-160.062 24.518-219.42 69.036-63.92 47.938-100.58 116.086-100.58 186.964h128c0-69.382 87.926-128 192-128s192 58.618 192 128c0 69.382-87.926 128-192 128-82.138 0-160.062 24.518-219.42 69.036-63.92 47.94-100.58 116.086-100.58 186.964s36.66 139.024 100.58 186.964c59.358 44.518 137.282 69.036 219.42 69.036 82.136 0 160.062-24.518 219.42-69.036 63.92-47.94 100.58-116.086 100.58-186.964h-128c0 69.382-87.926 128-192 128s-192-58.618-192-128c0-69.382 87.926-128 192-128 82.136 0 160.062-24.518 219.42-69.036zM0 448h1024v-64h-1024z" />
+<glyph unicode="&#xe02e;" d="M384 896h512v-128h-128v-768h-128v768h-128v-768h-128v448c-123.712 0-224 100.288-224 224s100.288 224 224 224z" />
+<glyph unicode="&#xe02f;" d="M448 896h512v-128h-128v-768h-128v768h-128v-768h-128v448c-123.712 0-224 100.288-224 224s100.288 224 224 224zM64 512l256-224-256-224z" />
+<glyph unicode="&#xe030;" d="M256 896h512v-128h-128v-768h-128v768h-128v-768h-128v448c-123.712 0-224 100.288-224 224s100.288 224 224 224zM960 64l-256 224 256 224z" />
+<glyph unicode="&#xe031;" d="M832 704h-192v64l-192 192h-448v-768h384v-256h640v576l-192 192zM832 613.49l101.49-101.49h-101.49v101.49zM448 869.49l101.49-101.49h-101.49v101.49zM64 896h320v-192h192v-448h-512v640zM960 0h-512v192h192v448h128v-192h192v-448z" />
+<glyph unicode="&#xe032;" d="M768 704h64v-64h-64zM640 576h64v-64h-64zM640 448h64v-64h-64zM640 320h64v-64h-64zM512 448h64v-64h-64zM512 320h64v-64h-64zM384 320h64v-64h-64zM768 576h64v-64h-64zM768 448h64v-64h-64zM768 320h64v-64h-64zM768 192h64v-64h-64zM640 192h64v-64h-64zM512 192h64v-64h-64zM384 192h64v-64h-64zM256 192h64v-64h-64z" />
+<glyph unicode="&#xe033;" d="M128 416l288-288 480 480-128 128-352-352-160 160z" />
+<glyph unicode="&#xe034;" d="M928 832h-416l-32 64h-352l-64-128h896zM904.34 256h74.86l44.8 448h-1024l64-640h484.080c-104.882 37.776-180.080 138.266-180.080 256 0 149.982 122.018 272 272 272 149.98 0 272-122.018 272-272 0-21.678-2.622-43.15-7.66-64zM1002.996 46.25l-198.496 174.692c17.454 28.92 27.5 62.814 27.5 99.058 0 106.040-85.96 192-192 192s-192-85.96-192-192 85.96-192 192-192c36.244 0 70.138 10.046 99.058 27.5l174.692-198.496c22.962-26.678 62.118-28.14 87.006-3.252l5.492 5.492c24.888 24.888 23.426 64.044-3.252 87.006zM640 196c-68.484 0-124 55.516-124 124s55.516 124 124 124 124-55.516 124-124-55.516-124-124-124z" />
+<glyph unicode="&#xe035;" d="M512 448v-128h32l32 64h64v-256h-48v-64h224v64h-48v256h64l32-64h32v128zM832 640v160c0 17.6-14.4 32-32 32h-224v64c0 35.2-28.8 64-64 64h-128c-35.204 0-64-28.8-64-64v-64h-224c-17.602 0-32-14.4-32-32v-640c0-17.6 14.398-32 32-32h288v-192h640v704h-192zM384 895.886c0.034 0.038 0.072 0.078 0.114 0.114h127.768c0.042-0.036 0.082-0.076 0.118-0.114v-63.886h-128v63.886zM192 704v64h512v-64h-512zM960 0h-512v576h512v-576z" />
+</font></defs></svg>
\ No newline at end of file
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/tinymce.ttf has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/fonts/tinymce.woff has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/img/anchor.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/img/loader.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/img/object.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/img/trans.gif has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/skin.dev.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,39 @@
+@import "Reset.less";
+@import "Variables.less";
+@import "Mixins.less";
+@import "Animations.less";
+@import "TinyMCE.less";
+@import "Container.less";
+@import "Scrollable.less";
+@import "Panel.less";
+@import "FloatPanel.less";
+@import "Window.less";
+@import "AbsoluteLayout.less";
+@import "ToolTip.less";
+@import "Button.less";
+@import "ButtonGroup.less";
+@import "Checkbox.less";
+@import "ComboBox.less";
+@import "ColorBox.less";
+@import "ColorButton.less";
+@import "ColorPicker.less";
+@import "Path.less";
+@import "FieldSet.less";
+@import "FitLayout.less";
+@import "FlowLayout.less";
+@import "Iframe.less";
+@import "Label.less";
+@import "MenuBar.less";
+@import "MenuButton.less";
+@import "ListBox.less";
+@import "MenuItem.less";
+@import "Menu.less";
+@import "Radio.less";
+@import "ResizeHandle.less";
+@import "Spacer.less";
+@import "SplitButton.less";
+@import "StackLayout.less";
+@import "TabPanel.less";
+@import "TextBox.less";
+@import "Throbber.less";
+@import "Icons.less";
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/skin.ie7.dev.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,39 @@
+@import "Variables.less";
+@import "Reset.less";
+@import "Mixins.less";
+@import "Animations.less";
+@import "TinyMCE.less";
+@import "Container.less";
+@import "Scrollable.less";
+@import "Panel.less";
+@import "FloatPanel.less";
+@import "Window.less";
+@import "AbsoluteLayout.less";
+@import "ToolTip.less";
+@import "Button.less";
+@import "ButtonGroup.less";
+@import "Checkbox.less";
+@import "ComboBox.less";
+@import "ColorBox.less";
+@import "ColorButton.less";
+@import "ColorPicker.less";
+@import "Path.less";
+@import "FieldSet.less";
+@import "FitLayout.less";
+@import "FlowLayout.less";
+@import "Iframe.less";
+@import "Label.less";
+@import "MenuBar.less";
+@import "MenuButton.less";
+@import "ListBox.less";
+@import "MenuItem.less";
+@import "Menu.less";
+@import "Radio.less";
+@import "ResizeHandle.less";
+@import "Spacer.less";
+@import "SplitButton.less";
+@import "StackLayout.less";
+@import "TabPanel.less";
+@import "TextBox.less";
+@import "Throbber.less";
+@import "Icons.Ie7.less";
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/skin.ie7.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1904 @@
+// Reset
+
+.@{prefix}-container, .@{prefix}-container *, .@{prefix}-widget, .@{prefix}-widget *, .@{prefix}-reset {
+	margin: 0; padding: 0; border: 0; outline: 0;
+	vertical-align: top; background: transparent;
+	text-decoration: none; color: @text;
+	font-family: @font-family;
+	font-size: @font-size; text-shadow: none; float: none;
+	position: static; width: auto; height: auto;
+	white-space: nowrap; cursor: inherit;
+	-webkit-tap-highlight-color: transparent;
+	line-height: normal; font-weight: normal;
+	text-align: left;
+	-moz-box-sizing: content-box;
+	-webkit-box-sizing: content-box;
+	box-sizing: content-box;
+	direction: ltr;
+	max-width: none;
+}
+
+.@{prefix}-widget button {
+	-moz-box-sizing: border-box;
+	-webkit-box-sizing: border-box;
+	box-sizing: border-box;
+}
+
+.@{prefix}-container *[unselectable] {
+	-moz-user-select: none;
+	-webkit-user-select: none;
+	-o-user-select: none;
+	user-select: none;
+}
+// Variables
+// Syntax: <control>-(<sub control>)-<bg|border|text>-(<state>)-(<extra>);
+// Example: @btn-primary-bg-hover-hlight;
+
+@prefix:                         mce;
+
+// Default font
+@font-family:                    "Helvetica Neue", Helvetica, Arial, sans-serif;
+@font-size:                      14px;
+@line-height:                    20px;
+@has-gradients:                  true;
+@has-radius:                     true;
+@has-boxshadow:                  true;
+
+// Text colors
+@text:                           #333;
+@text-inverse:                   white;
+@text-disabled:                  #aaa;
+@text-shadow:                    0 1px 1px hsla(hue(@text-inverse), saturation(@text-inverse), lightness(@text-inverse), 0.75);
+@text-error:                     #aa0000;
+
+// Button
+@btn-text:                       @text;
+@btn-text-shadow:                @text-inverse;
+@btn-border-top:                 rgba(0, 0, 0, .1);
+@btn-border-right:               rgba(0, 0, 0, .1);
+@btn-border-bottom:              fadein(rgba(0, 0, 0, .1), 15%);
+@btn-border-left:                fadein(rgba(0, 0, 0, .1), 15%);
+@btn-split-border:               #bdbdbd;
+@btn-caret-border:               @btn-text;
+@btn-text-disabled:              @text-disabled;
+@btn-box-shadow:                 inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 2px rgba(0, 0, 0, .05);
+@btn-box-shadow-active:          inset 0 2px 4px rgba(0, 0, 0, .15), 0 1px 2px rgba(0, 0, 0, .05);
+@btn-box-disabled-opacity:       0.4;
+@btn-bg:                         white;
+@btn-bg-hlight:                  #D9D9D9;
+@btn-bg-hover:                   darken(@btn-bg, 5%);
+@btn-bg-hlight-hover:            darken(@btn-bg-hlight, 5%);
+
+@btn-primary-bg:                 #0088cc;
+@btn-primary-bg-hlight:          #0044cc;
+@btn-primary-bg-hover:           darken(@btn-primary-bg, 5%);
+@btn-primary-bg-hover-hlight:    darken(@btn-primary-bg-hlight, 5%);
+@btn-primary-text:               #fff;
+@btn-primary-text-shadow:        #333;
+@btn-primary-border-top:         mix(@btn-border-top, @btn-primary-bg, 50%);
+@btn-primary-border-right:       mix(@btn-border-right, @btn-primary-bg, 50%);
+@btn-primary-border-bottom:      mix(@btn-border-bottom, @btn-primary-bg, 50%);
+@btn-primary-border-left:        mix(@btn-border-left, @btn-primary-bg, 50%);
+
+// Menu
+@menuitem-text:                  @text;
+@menu-bg:                        #fff;
+@menu-border:                    rgba(0, 0, 0, 0.2);
+@menubar-border:                 mix(@panel-border, @panel-bg, 60%);
+@menuitem-text-inverse:          @text-inverse;
+@menubar-bg-active:              darken(@btn-bg, 10%);
+@menuitem-bg-hover:              #0081C2;
+@menuitem-bg-selected:           #08C;
+@menuitem-bg-selected-hlight:    #0077B3;
+@menuitem-bg-disabled:           #CCC;
+@menuitem-caret:                 @menuitem-text;
+@menuitem-caret-selected:        @menuitem-text-inverse;
+@menuitem-separator-top:         #CBCBCB;
+@menuitem-separator-bottom:      @menu-bg;
+@menuitem-bg-active:             #C8DEF4;
+@menuitem-text-active:           @text;
+@menuitem-preview-border-active: #aaa;
+
+// Panel
+@panel-border:                   #9E9E9E;
+@panel-bg:                       #FDFDFD;
+@panel-bg-hlight:                #DDD;
+
+// Tabs
+@tab-border:                     #c5c5c5;
+@tab-bg:                         #e3e3e3;
+@tab-bg-hover:                   #FDFDFD;
+@tab-bg-active:                  #FDFDFD;
+
+// Tooltip
+@tooltip-bg:                     #000;
+@tooltip-text:                   white;
+@tooltip-font-size:              11px;
+
+// Window
+@window-border:                  #c5c5c5;
+@window-head-border:             @window-border;
+@window-head-close:              mix(@text, @window-bg, 60%);
+@window-head-close-hover:        mix(@text, @window-bg, 40%);
+@window-foot-border:             @window-border;
+@window-foot-bg:                 @window-bg;
+@window-fullscreen-bg:           #FFF;
+@window-modalblock-bg:           #000;
+@window-modalblock-opacity:      0.3;
+@window-box-shadow:              0 3px 7px rgba(0, 0, 0, 0.3);
+@window-bg:                      #FFF;
+@window-title-font-size:         20px;
+
+// Popover
+@popover-bg:                     @window-bg;
+@popover-arrow-width:            10px;
+@popover-arrow:                  @window-bg;
+@popover-arrow-outer-width:      @popover-arrow-width + 1;
+@popover-arrow-outer:            rgba(0, 0, 0, 0.25);
+
+// Floatpanel
+@floatpanel-box-shadow:          0 5px 10px rgba(0, 0, 0, .2);
+
+// Checkbox
+@checkbox-bg:                    @btn-bg;
+@checkbox-bg-hlight:             @btn-bg-hlight;
+@checkbox-box-shadow:            inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 2px rgba(0, 0, 0, .05);
+@checkbox-border:                #c5c5c5;
+@checkbox-border-focus:          rgba(82, 168, 236, .8);
+
+// Path
+@path-text:                      @text;
+@path-bg-focus:                  #666;
+@path-text-focus:                #fff;
+
+// Textbox
+@textbox-text-placeholder:       #aaa;
+@textbox-box-shadow:             inset 0 1px 1px rgba(0, 0, 0, 0.075);
+@textbox-bg:                     #fff;
+@textbox-border:                 #c5c5c5;
+@textbox-border-focus:           rgba(82, 168, 236, .8);
+
+// Throbber
+@throbber-bg:                    #fff url('img/loader.gif') no-repeat center center;
+
+// Combobox
+@combobox-border:                @textbox-border;
+
+// Colorpicker
+@colorpicker-border:             @textbox-border;
+@colorpicker-hue-bg:             #fff;
+@colorpicker-hue-border:         #333;
+
+// Grid
+@grid-bg-active:                 @menuitem-bg-active;
+@grid-border-active:             #a1a1a1;
+@grid-border:                    #d6d6d6;
+
+// Misc
+@colorbtn-backcolor-bg:          #BBB;
+@iframe-border:                  @panel-border;
+// Mixins
+
+.opacity(@opacity) {
+	opacity: @opacity;
+	@opacityie: @opacity * 100;
+	filter: ~"alpha(opacity=@{opacityie})";
+	zoom: 1;
+}
+
+.vertical-gradient(@startColor, @endColor) when (@has-gradients = true) {
+	background-color: mix(@startColor, @endColor, 60%);
+	background-image: -moz-linear-gradient(top, @startColor, @endColor); // FF 3.6+
+	background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+
+	background-image: -webkit-linear-gradient(top, @startColor, @endColor); // Safari 5.1+, Chrome 10+
+	background-image: -o-linear-gradient(top, @startColor, @endColor); // Opera 11.10
+	background-image: linear-gradient(to bottom, @startColor, @endColor); // Standard, IE10
+	background-repeat: repeat-x;
+	filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)", argb(@startColor), argb(@endColor)));
+	zoom: 1;
+}
+
+.vertical-gradient(@startColor, @endColor) when (@has-gradients = false) {
+	background-color: mix(@startColor, @endColor, 60%);
+}
+
+.border-radius(@radius) when (@has-radius = true) {
+	-webkit-border-radius: @radius;
+	-moz-border-radius: @radius;
+	border-radius: @radius;
+}
+
+.box-shadow(@shadowA, @shadowB:X, ...) when (@has-boxshadow = true) {
+	// Multiple shadow solution from http://toekneestuck.com/blog/2012/05/15/less-css-arguments-variable/
+	@props: ~`"@{arguments}".replace(/[\[\]]|\,\sX/g, '')`;
+	-webkit-box-shadow: @props;
+	-moz-box-shadow: @props;
+	box-shadow: @props;
+}
+
+.transition(@transition) {
+	-webkit-transition: @transition;
+	transition: @transition;
+}
+
+.inline-block() {
+	display: inline-block;
+	*display: inline;
+	*zoom: 1;
+}
+
+.reset-gradient() {
+	filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)"));
+	background: transparent;
+}
+// Animations
+
+.@{prefix}-fade {
+	opacity: 0;
+	.transition(opacity .15s linear);
+
+	&.@{prefix}-in {
+		opacity: 1;
+	}
+}
+.@{prefix}-tinymce {
+	// Avoid FOUC
+	visibility: inherit !important;
+	position: relative;
+}
+
+.@{prefix}-fullscreen {
+	border: 0; padding: 0; margin: 0;
+	overflow: hidden;
+	height: 100%;
+	z-index: 100;
+}
+
+div.@{prefix}-fullscreen {
+	position: fixed;
+	top: 0; left: 0;
+	width: 100%;
+	height: auto;
+}
+
+.@{prefix}-tinymce {
+	display: block;
+	.border-radius(2px);
+}
+
+.@{prefix}-wordcount {
+	position: absolute;
+	top: 0;
+	right: 0;
+	padding: 8px;
+}
+
+div.@{prefix}-edit-area {
+	background: #FFF;
+	filter: none;
+}
+
+.@{prefix}-statusbar {
+	position: relative;
+}
+
+.@{prefix}-statusbar .@{prefix}-container-body {
+	position: relative;
+}
+
+.@{prefix}-fullscreen .@{prefix}-resizehandle {
+	display: none;
+}
+
+// Charmap
+
+.@{prefix}-charmap {
+	border-collapse: collapse;
+}
+
+.@{prefix}-charmap td {
+	cursor: default;
+	border: 1px solid @panel-border;
+	width: 20px;
+	height: 20px;
+	line-height: 20px;
+	text-align: center;
+	vertical-align: middle;
+	padding: 2px;
+}
+
+.@{prefix}-charmap td div {
+	text-align: center;
+}
+
+.@{prefix}-charmap td:hover {
+	background: @btn-bg-hlight;
+}
+
+.@{prefix}-grid td.@{prefix}-grid-cell div {
+	border: 1px solid @grid-border;
+	width: 15px; height: 15px;
+	margin: 0px;
+	cursor: pointer;
+
+	&:focus {
+		border-color: @grid-border-active;
+	}
+
+	&[disabled] {
+		cursor: not-allowed;
+	}
+}
+
+.@{prefix}-grid {
+	border-spacing: 2px;
+	border-collapse: separate;
+
+	a {
+		display: block;
+		border: 1px solid transparent;
+
+		&:hover, &:focus {
+			border-color: @grid-border-active;
+		}
+	}
+}
+
+.@{prefix}-grid-border {
+	margin: 0 4px 0 4px;
+
+	a {
+		border-color: @grid-border;
+		width: 13px; height: 13px;
+	}
+
+	a:hover, a.@{prefix}-active {
+		border-color: @grid-border-active;
+		background: @grid-bg-active;
+	}
+}
+
+.@{prefix}-text-center {
+	text-align: center;
+}
+
+div.@{prefix}-tinymce-inline {
+	width: 100%;
+	.box-shadow(none);
+}
+
+.@{prefix}-colorbtn-trans div {
+	text-align: center;
+	vertical-align: middle;
+	font-weight: bold;
+	font-size: 20px;
+	line-height: 16px;
+	color: mix(@text, #fff, 70%);
+}
+
+// Reduce double margins between toolbar rows
+
+.@{prefix}-toolbar-grp {
+	padding-bottom: 2px;
+}
+
+.@{prefix}-toolbar-grp .@{prefix}-flow-layout-item {
+	margin-bottom: 0;
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-wordcount {
+	left: 0;
+	right: auto;
+}
+// Container
+
+.@{prefix}-container, .@{prefix}-container-body {
+	display: block;
+}
+
+.@{prefix}-autoscroll {
+	overflow: hidden;
+}
+// Scrollbar
+
+.@{prefix}-scrollbar {
+	position: absolute;
+	width: 7px;
+	height: 100%;
+	top: 2px;
+	right: 2px;
+	.opacity(0.4);
+}
+
+.@{prefix}-scrollbar-h {
+	top: auto;
+	right: auto;
+	left: 2px;
+	bottom: 2px;
+	width: 100%;
+	height: 7px;
+}
+
+.@{prefix}-scrollbar-thumb {
+	position: absolute;
+	background-color: #000;
+	border: 1px solid #888;
+	border-color: rgba(85, 85, 85, .6);
+	width: 5px;
+	height: 100%;
+	.border-radius(7px);
+}
+
+.@{prefix}-scrollbar-h .@{prefix}-scrollbar-thumb {
+	width: 100%;
+	height: 5px;
+}
+
+.@{prefix}-scrollbar:hover, .@{prefix}-scrollbar.@{prefix}-active {
+	background-color: #AAA;
+	.opacity(0.6);
+	.border-radius(7px);
+}
+
+.@{prefix}-scroll {
+	position: relative;
+}
+// Panel
+
+.@{prefix}-panel {
+	border: 0 solid @panel-border;
+	.vertical-gradient(@panel-bg, @panel-bg-hlight);
+}
+// FloatPanel
+
+.@{prefix}-floatpanel {
+	position: absolute;
+	.box-shadow(@floatpanel-box-shadow);
+}
+
+.@{prefix}-floatpanel.@{prefix}-fixed {
+	position: fixed;
+}
+
+// Popover panel
+
+.@{prefix}-floatpanel .@{prefix}-arrow,
+.@{prefix}-floatpanel .@{prefix}-arrow:after {
+	position: absolute;
+	display: block;
+	width: 0;
+	height: 0;
+	border-color: transparent;
+	border-style: solid;
+}
+
+.@{prefix}-floatpanel .@{prefix}-arrow {
+	border-width: @popover-arrow-outer-width;
+}
+
+.@{prefix}-floatpanel .@{prefix}-arrow:after {
+	border-width: @popover-arrow-width;
+	content: "";
+}
+
+.@{prefix}-floatpanel.@{prefix}-popover {
+	.reset-gradient();
+	.border-radius(6px);
+	.box-shadow(@floatpanel-box-shadow);
+	top: 0;
+	left: 0;
+	background: @popover-bg;
+	border: 1px solid @panel-border;
+	border: 1px solid @popover-arrow-outer;
+
+	&.@{prefix}-bottom {
+		margin-top: @popover-arrow-width;
+		*margin-top: 0;
+
+		& > .@{prefix}-arrow {
+			left: 50%;
+			margin-left: -@popover-arrow-outer-width;
+			border-top-width: 0;
+			border-bottom-color: @panel-border;
+			border-bottom-color: @popover-arrow-outer;
+			top: -@popover-arrow-outer-width;
+
+			&:after {
+				top: 1px;
+				margin-left: -@popover-arrow-width;
+				border-top-width: 0;
+				border-bottom-color: @popover-arrow;
+			}
+		}
+
+		&.@{prefix}-start { margin-left: -22px; }
+		&.@{prefix}-start > .@{prefix}-arrow { left: 20px; }
+
+		&.@{prefix}-end { margin-left: 22px; }
+		&.@{prefix}-end > .@{prefix}-arrow { right: 10px; left: auto; }
+	}
+}// Window
+
+.@{prefix}-fullscreen {
+	border: 0; padding: 0; margin: 0;
+	overflow: hidden;
+	background: @window-fullscreen-bg;
+	height: 100%;
+}
+
+div.@{prefix}-fullscreen {
+	position: fixed;
+	top: 0; left: 0;
+}
+
+#@{prefix}-modal-block {
+	.opacity(0);
+	position: fixed;
+	left: 0; top: 0;
+	width: 100%; height: 100%;
+	background: @window-modalblock-bg;
+}
+
+#@{prefix}-modal-block.@{prefix}-in {
+	.opacity(@window-modalblock-opacity);
+}
+
+.@{prefix}-window-move {
+	cursor: move;
+}
+
+.@{prefix}-window {
+	.border-radius(6px);
+	.box-shadow(@window-box-shadow);
+	.reset-gradient();
+	background: @window-bg;
+	position: fixed;
+	top: 0; left: 0;
+	opacity: 0;
+	.transition(opacity 150ms ease-in);
+}
+
+.@{prefix}-window.@{prefix}-in {
+	opacity: 1;
+}
+
+.@{prefix}-window-head {
+	padding: 9px 15px;
+	border-bottom: 1px solid @window-head-border;
+	position: relative;
+}
+
+.@{prefix}-window-head .@{prefix}-close {
+	position: absolute;
+	right: 15px;
+	top: 9px;
+	font-size: 20px;
+	font-weight: bold;
+	line-height: 20px;
+	color: @window-head-close;
+	cursor: pointer;
+
+	// IE7
+	height: 20px;
+	overflow: hidden;
+}
+
+.@{prefix}-close:hover {
+	color: @window-head-close-hover;
+}
+
+.@{prefix}-window-head .@{prefix}-title {
+	line-height: 20px;
+	font-size: @window-title-font-size;
+	font-weight: bold;
+	text-rendering: optimizelegibility;
+	padding-right: 10px;
+}
+
+.@{prefix}-window .@{prefix}-container-body {
+	display: block;
+}
+
+.@{prefix}-foot {
+	display: block;
+	background-color: @window-foot-bg;
+	border-top: 1px solid @window-foot-border;
+	.border-radius(0 0 6px 6px);
+}
+
+.@{prefix}-window-head .@{prefix}-dragh {
+	position: absolute;
+	top: 0; left: 0;
+	cursor: move;
+	width: 90%;
+	height: 100%;
+}
+
+.@{prefix}-window iframe {
+	width: 100%;
+	height: 100%;
+}
+
+.@{prefix}-window.@{prefix}-fullscreen, .@{prefix}-window.@{prefix}-fullscreen .@{prefix}-foot {
+	.border-radius(0);
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-window-head .@{prefix}-close {
+	position: absolute;
+	right: auto;
+	left: 15px;
+}
+
+.@{prefix}-rtl .@{prefix}-window-head .@{prefix}-dragh {
+	left: auto;
+	right: 0;
+}
+
+.@{prefix}-rtl .@{prefix}-window-head .@{prefix}-title {
+	direction: rtl;
+	text-align: right;
+}
+// AbsoluteLayout
+
+.@{prefix}-abs-layout {
+	position: relative;
+}
+
+body .@{prefix}-abs-layout-item, .@{prefix}-abs-end {
+	position: absolute;
+}
+
+.@{prefix}-abs-end {
+	width: 1px; height: 1px;
+}
+
+.@{prefix}-container-body.@{prefix}-abs-layout {
+	overflow: hidden;
+}
+// Tooltip
+
+.@{prefix}-tooltip {
+	position: absolute;
+	padding: 5px;
+	.opacity(0.8);
+}
+
+.@{prefix}-tooltip-inner {
+	font-size: @tooltip-font-size;
+	background-color: @tooltip-bg;
+	color: @tooltip-text;
+	max-width: 200px;
+	padding: 5px 8px 4px 8px;
+	text-align: center;
+	white-space: normal;
+}
+
+.@{prefix}-tooltip-inner {
+	.border-radius(3px);
+}
+
+.@{prefix}-tooltip-inner {
+	.box-shadow(0 0 5px @tooltip-bg);
+}
+
+.@{prefix}-tooltip-arrow {
+	position: absolute;
+	width: 0;
+	height: 0;
+	line-height: 0;
+	border: 5px dashed @tooltip-bg;
+}
+
+.@{prefix}-tooltip-arrow-n {
+	border-bottom-color: @tooltip-bg;
+}
+
+.@{prefix}-tooltip-arrow-s {
+	border-top-color: @tooltip-bg;
+}
+
+.@{prefix}-tooltip-arrow-e {
+	border-left-color: @tooltip-bg;
+}
+
+.@{prefix}-tooltip-arrow-w {
+	border-right-color: @tooltip-bg;
+}
+
+.@{prefix}-tooltip-nw, .@{prefix}-tooltip-sw {
+	margin-left: -14px;
+}
+
+.@{prefix}-tooltip-n .@{prefix}-tooltip-arrow {
+	top: 0px;
+	left: 50%;
+	margin-left: -5px;
+	border-bottom-style: solid;
+	border-top: none;
+	border-left-color: transparent;
+	border-right-color: transparent;
+}
+
+.@{prefix}-tooltip-nw .@{prefix}-tooltip-arrow {
+	top: 0;
+	left: 10px;
+	border-bottom-style: solid;
+	border-top: none;
+	border-left-color: transparent;
+	border-right-color: transparent;
+}
+
+.@{prefix}-tooltip-ne .@{prefix}-tooltip-arrow {
+	top: 0;
+	right: 10px;
+	border-bottom-style: solid;
+	border-top: none;
+	border-left-color: transparent;
+	border-right-color: transparent;
+}
+
+.@{prefix}-tooltip-s .@{prefix}-tooltip-arrow {
+	bottom: 0;
+	left: 50%;
+	margin-left: -5px;
+	border-top-style: solid;
+	border-bottom: none;
+	border-left-color: transparent;
+	border-right-color: transparent;
+}
+
+.@{prefix}-tooltip-sw .@{prefix}-tooltip-arrow {
+	bottom: 0;
+	left: 10px;
+	border-top-style: solid;
+	border-bottom: none;
+	border-left-color: transparent;
+	border-right-color: transparent;
+}
+
+.@{prefix}-tooltip-se .@{prefix}-tooltip-arrow {
+	bottom: 0;
+	right: 10px;
+	border-top-style: solid;
+	border-bottom: none;
+	border-left-color: transparent;
+	border-right-color: transparent;
+}
+
+.@{prefix}-tooltip-e .@{prefix}-tooltip-arrow {
+	right: 0;
+	top: 50%;
+	margin-top: -5px;
+	border-left-style: solid;
+	border-right: none;
+	border-top-color: transparent;
+	border-bottom-color: transparent;
+}
+
+.@{prefix}-tooltip-w .@{prefix}-tooltip-arrow {
+	left: 0;
+	top: 50%;
+	margin-top: -5px;
+	border-right-style: solid;
+	border-left: none;
+	border-top-color: transparent;
+	border-bottom-color: transparent;
+}
+// Button
+
+.@{prefix}-btn {
+	border: 1px solid mix(rgb(red(@btn-border-right), green(@btn-border-right), blue(@btn-border-right)), @panel-bg, 30%);
+	border-color: @btn-border-top @btn-border-right @btn-border-bottom @btn-border-left;
+	position: relative;
+	text-shadow: @text-shadow;
+
+	.inline-block();
+	.border-radius(3px);
+	.box-shadow(@btn-box-shadow);
+	.vertical-gradient(@btn-bg, @btn-bg-hlight);
+
+	&:hover, &:focus {
+		color: @btn-text;
+		.vertical-gradient(darken(@btn-bg, 5%), darken(@btn-bg-hlight, 5%));
+	}
+
+	&.@{prefix}-disabled button, &.@{prefix}-disabled:hover button {
+		cursor: default;
+		.box-shadow(none);
+		.opacity(@btn-box-disabled-opacity);
+	}
+
+	&.@{prefix}-active, &.@{prefix}-active:hover {
+		.vertical-gradient(darken(@btn-bg, 10%), darken(@btn-bg-hlight, 10%));
+		.box-shadow(@btn-box-shadow-active);
+	}
+
+	&:active {
+		.vertical-gradient(darken(@btn-bg, 10%), darken(@btn-bg-hlight, 10%));
+		.box-shadow(@btn-box-shadow-active);
+	}
+}
+
+.@{prefix}-btn button {
+	padding: 4px 10px;
+	font-size: @font-size;
+	line-height: @line-height;
+	*line-height: @line-height - 4px;
+	cursor: pointer;
+	color: @btn-text;
+	text-align: center;
+
+	// Fixes for default inner padding of button
+	overflow: visible; // IE7
+	-webkit-appearance: none; // WebKit
+	&::-moz-focus-inner { // Gecko
+		border: 0;
+		padding: 0;
+	}
+}
+
+.@{prefix}-btn i {
+	text-shadow: 1px 1px @btn-text-shadow;
+}
+
+.@{prefix}-primary {
+	min-width: 50px;
+	color: @btn-primary-text;
+	border: 1px solid mix(rgb(red(@btn-border-right), green(@btn-border-right), blue(@btn-border-right)), @panel-bg, 30%);
+	border-color: @btn-border-top @btn-border-right @btn-border-bottom @btn-border-left;
+	.vertical-gradient(@btn-primary-bg, @btn-primary-bg-hlight);
+
+	&:hover, &:focus {
+		.vertical-gradient(darken(@btn-primary-bg, 5%), darken(@btn-primary-bg-hlight, 5%));
+	}
+
+	&.@{prefix}-disabled button, &.@{prefix}-disabled:hover button {
+		cursor: default;
+		.box-shadow(none);
+		.opacity(@btn-box-disabled-opacity);
+	}
+
+	&.@{prefix}-active, &.@{prefix}-active:hover, &:not(.@{prefix}-disabled):active {
+		.vertical-gradient(darken(@btn-primary-bg, 10%), darken(@btn-primary-bg-hlight, 10%));
+		.box-shadow(@btn-box-shadow-active);
+	}
+}
+
+.@{prefix}-primary button, .@{prefix}-primary button i {
+	color: @btn-primary-text;
+	text-shadow: 1px 1px @btn-primary-text-shadow;
+}
+
+.@{prefix}-btn-large button {
+	padding: 9px 14px;
+	font-size: @font-size + 2px;
+	line-height: normal;
+	.border-radius(5px);
+}
+
+.@{prefix}-btn-large i {
+	margin-top: 2px;
+}
+
+.@{prefix}-btn-small button {
+	padding: 1px 5px;
+	font-size: @font-size - 2px;
+	*padding-bottom: 2px;
+}
+
+.@{prefix}-btn-small i {
+	line-height: 20px;
+	vertical-align: top;
+	*line-height: 18px;
+}
+
+.@{prefix}-btn .@{prefix}-caret {
+	margin-top: 8px;
+	margin-left: 0;
+}
+
+.@{prefix}-btn-small .@{prefix}-caret {
+	margin-top: 8px;
+	margin-left: 0;
+}
+
+.@{prefix}-caret {
+	.inline-block();
+	width: 0; height: 0;
+	vertical-align: top;
+	border-top: 4px solid @btn-caret-border;
+	border-right: 4px solid transparent;
+	border-left: 4px solid transparent;
+	content: "";
+}
+
+.@{prefix}-disabled .@{prefix}-caret {
+	border-top-color: @text-disabled;
+}
+
+.@{prefix}-caret.@{prefix}-up {
+	border-bottom: 4px solid @btn-caret-border;
+	border-top: 0;
+}
+
+.@{prefix}-btn-flat {
+	border: 0;
+	background: transparent;
+	.border-radius(0);
+	.box-shadow(none);
+	filter: none;
+}
+
+.@{prefix}-btn-flat:hover, .@{prefix}-btn-flat.@{prefix}-active, .@{prefix}-btn-flat:focus, .@{prefix}-btn-flat:active {
+	border: 0;
+	background: @menubar-bg-active;
+	filter: none;
+	.box-shadow(none);
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-btn button {
+	direction: rtl;
+}
+// ButtonGroup
+
+.@{prefix}-btn-group .@{prefix}-btn {
+	border-width: 1px 0 1px 0;
+	margin: 0;
+	.border-radius(0);
+}
+
+.@{prefix}-btn-group .@{prefix}-first {
+	border-left: 1px solid mix(rgb(red(@btn-border-left), green(@btn-border-left), blue(@btn-border-left)), @panel-bg, 30%);
+	border-left: 1px solid @btn-border-left;
+	.border-radius(3px 0 0 3px);
+}
+
+.@{prefix}-btn-group .@{prefix}-last {
+	border-right: 1px solid mix(rgb(red(@btn-border-right), green(@btn-border-right), blue(@btn-border-right)), @panel-bg, 30%);
+	border-right: 1px solid @btn-border-right;
+	.border-radius(0 3px 3px 0);
+}
+
+.@{prefix}-btn-group .@{prefix}-first.@{prefix}-last {
+	.border-radius(3px);
+}
+
+.@{prefix}-btn-group .@{prefix}-btn.@{prefix}-flow-layout-item {
+	margin: 0;
+}
+// Checkbox
+
+.@{prefix}-checkbox {
+	cursor: pointer;
+}
+
+i.@{prefix}-i-checkbox {
+	margin: 0 3px 0 0;
+	border: 1px solid @checkbox-border;
+	.border-radius(3px);
+	.box-shadow(@checkbox-box-shadow);
+	.vertical-gradient(@checkbox-bg, @checkbox-bg-hlight);
+	text-indent: -10em;
+	*font-size: 0;
+	*line-height: 0;
+	*text-indent: 0;
+	overflow: hidden;
+}
+
+.@{prefix}-checked i.@{prefix}-i-checkbox {
+	color: @btn-text;
+	font-size: 16px;
+	line-height: 16px;
+	text-indent: 0;
+}
+
+.@{prefix}-checkbox:focus i.@{prefix}-i-checkbox, .@{prefix}-checkbox.@{prefix}-focus i.@{prefix}-i-checkbox {
+	border: 1px solid @checkbox-border-focus;
+	.box-shadow(inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px fadeout(@checkbox-border-focus, 15%));
+}
+
+.@{prefix}-checkbox.@{prefix}-disabled .@{prefix}-label, .@{prefix}-checkbox.@{prefix}-disabled i.@{prefix}-i-checkbox {
+	color: mix(@text, @panel-bg, 40%);
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-checkbox {
+	direction: rtl;
+	text-align: right;
+}
+
+.@{prefix}-rtl i.@{prefix}-i-checkbox {
+	margin: 0 0 0 3px;
+}
+// ComboBox
+
+.@{prefix}-combobox {
+	.inline-block();
+	.border-radius(3px);
+	.box-shadow(@textbox-box-shadow);
+	*height: 32px;
+}
+
+.@{prefix}-combobox input {
+	border: 1px solid @textbox-border;
+	border-right-color: @combobox-border;
+	height: 28px;
+}
+
+.@{prefix}-combobox.@{prefix}-disabled input {
+	color: mix(@text, @textbox-bg, 40%);
+}
+
+.@{prefix}-combobox.@{prefix}-has-open input {
+	.border-radius(4px 0 0 4px);
+}
+
+.@{prefix}-combobox .@{prefix}-btn {
+	border-left: 0;
+	.border-radius(0 4px 4px 0);
+}
+
+.@{prefix}-combobox button {
+	padding-right: 8px;
+	padding-left: 8px;
+}
+
+.@{prefix}-combobox.@{prefix}-disabled .@{prefix}-btn button {
+	cursor: default;
+	.box-shadow(none);
+	.opacity(@btn-box-disabled-opacity);
+}
+// ColorBox
+
+.@{prefix}-colorbox i {
+	border: 1px solid @textbox-border;
+	width: 14px; height: 14px;
+}
+// ColorButton
+
+.@{prefix}-colorbutton .@{prefix}-ico {
+	position: relative;
+}
+
+.@{prefix}-colorbutton-grid {
+	margin: 4px;	
+}
+
+.@{prefix}-colorbutton button {
+	padding-right: 4px;
+}
+
+.@{prefix}-colorbutton .@{prefix}-preview {
+	padding-right: 3px;
+	display: block;
+	position: absolute;
+	left: 50%;
+	top: 50%;
+	margin-left: -14px;
+	margin-top: 7px;
+	background: gray;
+	width: 13px;
+	height: 2px;
+	overflow: hidden;
+}
+
+.@{prefix}-colorbutton.@{prefix}-btn-small .@{prefix}-preview {
+	margin-left: -16px;
+	padding-right: 0;
+	width: 16px;
+}
+
+.@{prefix}-colorbutton .@{prefix}-open {
+	padding-left: 4px;
+	border-left: 1px solid transparent;
+	border-right: 1px solid transparent;
+}
+
+.@{prefix}-colorbutton:hover .@{prefix}-open {
+	border-left-color: @btn-split-border;
+	border-right-color: @btn-split-border;
+}
+
+.@{prefix}-colorbutton.@{prefix}-btn-small .@{prefix}-open {
+	padding: 0 3px 0 3px;
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-colorbutton {
+	direction: rtl;
+}
+
+.@{prefix}-rtl .@{prefix}-colorbutton .@{prefix}-preview {
+	margin-left: 0;
+	padding-right: 0;
+	padding-left: 4px;
+	margin-right: -14px;
+}
+
+.@{prefix}-rtl .@{prefix}-colorbutton.@{prefix}-btn-small .@{prefix}-preview {
+	margin-left: 0;
+	padding-right: 0;
+	margin-right: -17px;
+	padding-left: 0;
+}
+
+.@{prefix}-rtl .@{prefix}-colorbutton button {
+	padding-right: 10px;
+	padding-left: 10px;
+}
+
+.@{prefix}-rtl .@{prefix}-colorbutton .@{prefix}-open {
+	padding-left: 4px;
+	padding-right: 4px;
+}
+// ColorPicker
+
+.@{prefix}-colorpicker {
+	position: relative;
+	width: 250px;
+	height: 220px;
+}
+
+.@{prefix}-colorpicker-sv {
+	position: absolute;
+	top: 0; left: 0;
+	width: 90%;
+	height: 100%;
+	border: 1px solid @colorpicker-border;
+	cursor: crosshair;
+	overflow: hidden;
+}
+
+.@{prefix}-colorpicker-h-chunk {
+	width: 100%;
+}
+
+.@{prefix}-colorpicker-overlay1, .@{prefix}-colorpicker-overlay2 {
+	width: 100%;
+	height: 100%;
+	position: absolute;
+	top: 0;
+	left: 0;
+}
+
+.@{prefix}-colorpicker-overlay1 {
+	filter: progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff');
+	-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff')";
+	background: linear-gradient(to right, rgba(255,255,255,1), rgba(255,255,255,0));
+}
+
+.@{prefix}-colorpicker-overlay2 {
+	filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00000000', endColorstr='#000000');
+	-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00000000', endColorstr='#000000')";
+	background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,1));
+}
+
+.@{prefix}-colorpicker-selector1 {
+	background: none;
+	position: absolute;
+	width: 12px;
+	height: 12px;
+	margin: -8px 0 0 -8px;
+	border: 1px solid black;
+	border-radius: 50%;
+}
+
+.@{prefix}-colorpicker-selector2 {
+	position: absolute;
+	width: 10px;
+	height: 10px;
+	border: 1px solid white;
+	border-radius: 50%;
+}
+
+.@{prefix}-colorpicker-h {
+	position: absolute;
+	top: 0; right: 0;
+	width: 6.5%;
+	height: 100%;
+	border: 1px solid @colorpicker-border;
+	cursor: crosshair;
+}
+
+.@{prefix}-colorpicker-h-marker {
+	margin-top: -4px;
+	position: absolute;
+	top: 0;
+	left: -1px;
+	width: 100%;
+	border: 1px solid @colorpicker-hue-border;
+	background: @colorpicker-hue-bg;
+	height: 4px;
+	z-index: 100;
+}
+// Path
+
+.@{prefix}-path {
+	.inline-block();
+	padding: 8px;
+	white-space: normal;
+}
+
+.@{prefix}-path .@{prefix}-txt {
+	display: inline-block;
+	padding-right: 3px;
+}
+
+.@{prefix}-path .@{prefix}-path-body {
+	display: inline-block;
+}
+
+.@{prefix}-path-item {
+	.inline-block();
+	cursor: pointer;
+	color: @path-text;
+}
+
+.@{prefix}-path-item:hover {
+	text-decoration: underline;
+}
+
+.@{prefix}-path-item:focus {
+	background: @path-bg-focus;
+	color: @path-text-focus;
+}
+
+.@{prefix}-path .@{prefix}-divider {
+	display: inline;
+}
+
+.@{prefix}-disabled .@{prefix}-path-item {
+	color: @text-disabled;
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-path {
+	direction: rtl;
+}
+// FieldSet
+
+.@{prefix}-fieldset {
+	border: 0 solid #9E9E9E;
+	.border-radius(3px);
+}
+
+.@{prefix}-fieldset > .@{prefix}-container-body {
+	margin-top: -15px;
+}
+
+.@{prefix}-fieldset-title {
+	margin-left: 5px;
+	padding: 0 5px 0 5px;
+}// FitLayout
+
+.@{prefix}-fit-layout {
+	.inline-block();
+}
+
+.@{prefix}-fit-layout-item {
+	position: absolute;
+}
+// FlowLayout
+
+.@{prefix}-flow-layout-item {
+	.inline-block();
+}
+
+.@{prefix}-flow-layout-item {
+	margin: 2px 0 2px 2px;	
+}
+
+.@{prefix}-flow-layout-item.@{prefix}-last {
+	margin-right: 2px;
+}
+
+.@{prefix}-flow-layout {
+	white-space: normal;
+}
+
+.@{prefix}-tinymce-inline .@{prefix}-flow-layout {
+	white-space: nowrap;
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-flow-layout {
+	text-align: right;
+	direction: rtl;
+}
+
+.@{prefix}-rtl .@{prefix}-flow-layout-item {
+	margin: 2px 2px 2px 0;	
+}
+
+.@{prefix}-rtl .@{prefix}-flow-layout-item.@{prefix}-last {
+	margin-left: 2px;
+}
+// Iframe
+
+.@{prefix}-iframe {
+	border: 0 solid @iframe-border;
+	width: 100%; height: 100%;
+}
+// Label
+
+.@{prefix}-label {
+	.inline-block();
+	text-shadow: @text-shadow;
+	overflow: hidden;
+}
+
+.@{prefix}-label.@{prefix}-autoscroll {
+	overflow: auto;
+}
+
+.@{prefix}-label.@{prefix}-disabled {
+	color: @text-disabled;
+}
+
+.@{prefix}-label.@{prefix}-multiline {
+	white-space: pre-wrap;
+}
+
+.@{prefix}-label.@{prefix}-error {
+	color: @text-error;
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-label {
+	text-align: right;
+	direction: rtl;
+}
+/* MenuBar */
+
+.@{prefix}-menubar .@{prefix}-menubtn {
+	border-color: transparent;
+	background: transparent;
+	.border-radius(0);
+	.box-shadow(none);
+	filter: none;
+}
+
+.@{prefix}-menubar {
+	border: 1px solid @menubar-border;
+}
+
+.@{prefix}-menubar .@{prefix}-menubtn button span {
+	color: @text;
+}
+
+.@{prefix}-menubar .@{prefix}-caret {
+	border-top-color: @text;
+}
+
+.@{prefix}-menubar .@{prefix}-menubtn:hover, .@{prefix}-menubar .@{prefix}-menubtn.@{prefix}-active, .@{prefix}-menubar .@{prefix}-menubtn:focus {
+	border-color: transparent;
+	background: @menubar-bg-active;
+	filter: none;
+	.box-shadow(none);
+}
+/* MenuButton */
+
+.@{prefix}-menubtn span {
+	color: @btn-text;
+	margin-right: 2px;
+	line-height: @line-height;
+	*line-height: @line-height - 4px;
+}
+
+.@{prefix}-menubtn.@{prefix}-btn-small span {
+	font-size: @font-size - 2px;
+}
+
+.@{prefix}-menubtn.@{prefix}-fixed-width span {
+	display: inline-block;
+	overflow-x: hidden;
+	text-overflow: ellipsis;
+	width: 90px;
+}
+
+.@{prefix}-menubtn.@{prefix}-fixed-width.@{prefix}-btn-small span {
+	width: 70px;
+}
+
+.@{prefix}-menubtn .@{prefix}-caret {
+	*margin-top: 6px;
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-menubtn button {
+	direction: rtl;
+	text-align: right;
+}
+// ListBox
+
+.@{prefix}-listbox button {
+	text-align: left;
+	padding-right: 20px;
+	position: relative;
+}
+
+.@{prefix}-listbox .@{prefix}-caret {
+	position: absolute;
+	margin-top: -2px;
+	right: 8px;
+	top: 50%;
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-listbox .@{prefix}-caret {
+	right: auto;
+	left: 8px;
+}
+
+.@{prefix}-rtl .@{prefix}-listbox button {
+	padding-right: 10px;
+	padding-left: 20px;
+}
+// MenuItem
+
+.@{prefix}-menu-item {
+	display: block;
+	padding: 6px 15px 6px 12px;
+	clear: both;
+	font-weight: normal;
+	line-height: 20px;
+	color: @menuitem-text;
+	white-space: nowrap;
+	cursor: pointer;
+	line-height: normal;
+	border-left: 4px solid transparent;
+	margin-bottom: 1px;
+}
+
+.@{prefix}-menu-item .@{prefix}-ico, .@{prefix}-menu-item .@{prefix}-text {
+	color: @menuitem-text;
+}
+
+.@{prefix}-menu-item.@{prefix}-disabled .@{prefix}-text, .@{prefix}-menu-item.@{prefix}-disabled .@{prefix}-ico {
+	color: mix(@menuitem-text, @menu-bg, 40%);
+}
+
+.@{prefix}-menu-item:hover .@{prefix}-text, .@{prefix}-menu-item.@{prefix}-selected .@{prefix}-text, .@{prefix}-menu-item:focus .@{prefix}-text {
+	color: @menuitem-text-inverse;
+}
+
+.@{prefix}-menu-item:hover .@{prefix}-ico, .@{prefix}-menu-item.@{prefix}-selected .@{prefix}-ico, .@{prefix}-menu-item:focus .@{prefix}-ico {
+	color: @menuitem-text-inverse;
+}
+
+.@{prefix}-menu-item.@{prefix}-disabled:hover {
+	background: @menuitem-bg-disabled;
+}
+
+.@{prefix}-menu-shortcut {
+	display: inline-block;
+	color: mix(@menuitem-text, @menu-bg, 40%);
+}
+
+.@{prefix}-menu-shortcut {
+	.inline-block();
+	padding: 0 15px 0 20px;
+}
+
+.@{prefix}-menu-item:hover .@{prefix}-menu-shortcut, .@{prefix}-menu-item.@{prefix}-selected .@{prefix}-menu-shortcut, .@{prefix}-menu-item:focus .@{prefix}-menu-shortcut {
+	color: @menuitem-text-inverse;
+}
+
+.@{prefix}-menu-item .@{prefix}-caret {
+	margin-top: 4px;
+	*margin-top: 3px;
+	margin-right: 6px;
+	border-top: 4px solid transparent;
+	border-bottom: 4px solid transparent;
+	border-left: 4px solid @menuitem-caret;
+}
+
+.@{prefix}-menu-item.@{prefix}-selected .@{prefix}-caret, .@{prefix}-menu-item:focus .@{prefix}-caret, .@{prefix}-menu-item:hover .@{prefix}-caret {
+	border-left-color: @menuitem-caret-selected;
+}
+
+.@{prefix}-menu-align .@{prefix}-menu-shortcut {
+	*margin-top: -2px;
+}
+
+.@{prefix}-menu-align .@{prefix}-menu-shortcut, .@{prefix}-menu-align .@{prefix}-caret {
+	position: absolute;
+	right: 0;
+}
+
+.@{prefix}-menu-item.@{prefix}-active i {
+	visibility: visible;
+}
+
+.@{prefix}-menu-item-normal.@{prefix}-active {
+	background-color: @menuitem-bg-active;
+}
+
+.@{prefix}-menu-item-preview.@{prefix}-active {
+	border-left: 5px solid @menuitem-preview-border-active;
+}
+
+.@{prefix}-menu-item-normal.@{prefix}-active .@{prefix}-text {
+	color: @menuitem-text-active;
+}
+
+.@{prefix}-menu-item-normal.@{prefix}-active:hover .@{prefix}-text, .@{prefix}-menu-item-normal.@{prefix}-active:hover .@{prefix}-ico {
+	color: @menuitem-text-inverse;
+}
+
+.@{prefix}-menu-item-normal.@{prefix}-active:focus .@{prefix}-text, .@{prefix}-menu-item-normal.@{prefix}-active:focus .@{prefix}-ico {
+	color: @menuitem-text-inverse;
+}
+
+.@{prefix}-menu-item:hover, .@{prefix}-menu-item.@{prefix}-selected, .@{prefix}-menu-item:focus {
+	text-decoration: none;
+	color: @menuitem-text-inverse;
+	.vertical-gradient(@menuitem-bg-selected, @menuitem-bg-selected-hlight);
+}
+
+div.@{prefix}-menu .@{prefix}-menu-item-sep, .@{prefix}-menu-item-sep:hover {
+	border: 0;
+	padding: 0;
+	height: 1px;
+	margin: 9px 1px;
+	overflow: hidden;
+	background: @menuitem-separator-top;
+	border-bottom: 1px solid @menuitem-separator-bottom;
+	cursor: default;
+	filter: none;
+}
+
+// RTL
+
+.@{prefix}-menu.@{prefix}-rtl {
+	direction: rtl;
+}
+
+.@{prefix}-rtl .@{prefix}-menu-item {
+	text-align: right;
+	direction: rtl;
+	padding: 6px 12px 6px 15px;
+}
+
+.@{prefix}-menu-align.@{prefix}-rtl .@{prefix}-menu-shortcut, .@{prefix}-menu-align.@{prefix}-rtl .@{prefix}-caret {
+	right: auto;
+	left: 0;
+}
+
+.@{prefix}-rtl .@{prefix}-menu-item .@{prefix}-caret {
+	margin-left: 6px;
+	margin-right: 0;
+	border-right: 4px solid @menuitem-caret;
+	border-left: 0;
+}
+
+.@{prefix}-rtl .@{prefix}-menu-item.@{prefix}-selected .@{prefix}-caret, .@{prefix}-rtl .@{prefix}-menu-item:focus .@{prefix}-caret, .@{prefix}-rtl .@{prefix}-menu-item:hover .@{prefix}-caret {
+	border-left-color: transparent;
+	border-right-color: @menuitem-caret-selected;
+}
+// Menu
+
+.@{prefix}-menu {
+	position: absolute;
+	left: 0; top: 0;
+	.reset-gradient();
+	z-index: 1000;
+	padding: 5px 0 5px 0;
+	margin: 2px 0 0;
+	min-width: 160px;
+	background: @menu-bg;
+	border: 1px solid mix(rgb(red(@menu-border), green(@menu-border), blue(@menu-border)), @panel-bg, round(alpha(@menu-border) * 200));
+	border: 1px solid @menu-border;
+	z-index: 1002;
+	.border-radius(6px);
+	.box-shadow(0 5px 10px rgba(0,0,0,.2));
+	max-height: 400px;
+	overflow: auto;
+	overflow-x: hidden;
+}
+
+.@{prefix}-menu i {
+	display: none;
+}
+
+.@{prefix}-menu-has-icons i {
+	display: inline-block;
+	*display: inline;
+}
+
+.@{prefix}-menu-sub-tr-tl { margin: -6px 0 0 -1px; }
+.@{prefix}-menu-sub-br-bl { margin: 6px 0 0 -1px; }
+.@{prefix}-menu-sub-tl-tr { margin: -6px 0 0 1px; }
+.@{prefix}-menu-sub-bl-br { margin: 6px 0 0 1px; }
+// Radio - not implemented yet
+.@{prefix}-container-body .@{prefix}-resizehandle {
+	position: absolute;
+	right: 0;
+	bottom: 0;
+	width: 16px;
+	height: 16px;
+	visibility: visible;
+	cursor: s-resize;
+	margin: 0;
+}
+
+.@{prefix}-container-body .@{prefix}-resizehandle-both {
+	cursor: se-resize;
+}
+
+i.@{prefix}-i-resize {
+	color: @text;
+}
+// Spacer
+
+.@{prefix}-spacer {
+	visibility: hidden;
+}
+// SplitButton
+
+.@{prefix}-splitbtn .@{prefix}-open {
+	border-left: 1px solid transparent;
+	border-right: 1px solid transparent;
+}
+
+.@{prefix}-splitbtn:hover .@{prefix}-open {
+	border-left-color: @btn-split-border;
+	border-right-color: @btn-split-border;
+}
+
+.@{prefix}-splitbtn button {
+	padding-right: 4px;
+}
+
+.@{prefix}-splitbtn .@{prefix}-open {
+	padding-left: 4px;
+}
+
+.@{prefix}-splitbtn .@{prefix}-open.@{prefix}-active {
+	.box-shadow(inset 0 2px 4px rgba(0, 0, 0, .15), 0 1px 2px rgba(0, 0, 0 ,.05));
+}
+
+.@{prefix}-splitbtn.@{prefix}-btn-small .@{prefix}-open {
+	padding: 0 3px 0 3px;
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-splitbtn {
+	direction: rtl;
+	text-align: right;
+}
+
+.@{prefix}-rtl .@{prefix}-splitbtn button {
+	padding-right: 10px;
+	padding-left: 10px;
+}
+
+.@{prefix}-rtl .@{prefix}-splitbtn .@{prefix}-open {
+	padding-left: 4px;
+	padding-right: 4px;
+}
+// StackLayout 
+
+.@{prefix}-stack-layout-item {
+	display: block;
+}
+// TabPanel
+
+.@{prefix}-tabs {
+	display: block;
+	border-bottom: 1px solid @tab-border;
+}
+
+.@{prefix}-tab {
+	.inline-block();
+	border: 1px solid @tab-border;
+	border-width: 0 1px 0 0;
+	background: @tab-bg;
+	padding: 8px;
+	text-shadow: @text-shadow;
+	height: 13px;
+	cursor: pointer;
+}
+
+.@{prefix}-tab:hover {
+	background: @tab-bg-hover;
+}
+
+.@{prefix}-tab.@{prefix}-active {
+	background: @tab-bg-active;
+	border-bottom-color: transparent;
+	margin-bottom: -1px;
+	height: 14px;
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-tabs {
+	text-align: right;
+	direction: rtl;
+}
+
+.@{prefix}-rtl .@{prefix}-tab {
+	border-width: 0 0 0 1px;
+}
+// TextBox
+
+.@{prefix}-textbox {
+	background: @textbox-bg;
+	border: 1px solid @textbox-border;
+	.border-radius(3px);
+	.box-shadow(@textbox-box-shadow);
+	display: inline-block;
+	.transition(~"border linear .2s, box-shadow linear .2s");
+	height: 28px;
+	resize: none;
+	padding: 0 4px 0 4px;
+	white-space: pre-wrap;
+	*white-space: pre;
+	color: @text;
+}
+
+.@{prefix}-textbox:focus, .@{prefix}-textbox.@{prefix}-focus {
+	border-color: @textbox-border-focus;
+	.box-shadow(inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px fadeout(@textbox-border-focus, 15%));
+}
+
+.@{prefix}-placeholder .@{prefix}-textbox {
+	color: @textbox-text-placeholder;
+}
+
+.@{prefix}-textbox.@{prefix}-multiline {
+	padding: 4px;
+}
+
+.@{prefix}-textbox.@{prefix}-disabled {
+	color: mix(@text, @textbox-bg, 40%);
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-textbox {
+	text-align: right;
+	direction: rtl;
+}
+// Throbber
+
+.@{prefix}-throbber {
+	position: absolute;
+	top: 0; left: 0;
+	width: 100%; height: 100%;
+	.opacity(0.6);
+	background: @throbber-bg;
+}
+
+.@{prefix}-throbber-inline {
+	position: static;
+	height: 50px;
+}
+/* Icons IE7 */
+
+@font-face {
+	font-family: 'tinymce';
+	src:url('fonts/tinymce.eot');
+	src:url('fonts/tinymce.eot?#iefix') format('embedded-opentype'),
+		url('fonts/tinymce.woff') format('woff'),
+		url('fonts/tinymce.ttf') format('truetype'),
+		url('fonts/tinymce.svg#tinymce') format('svg');
+	font-weight: normal;
+	font-style: normal;
+}
+
+@font-face {
+	font-family: 'tinymce-small';
+	src:url('fonts/tinymce-small.eot');
+	src:url('fonts/tinymce-small.eot?#iefix') format('embedded-opentype'),
+		url('fonts/tinymce-small.woff') format('woff'),
+		url('fonts/tinymce-small.ttf') format('truetype'),
+		url('fonts/tinymce-small.svg#tinymce') format('svg');
+	font-weight: normal;
+	font-style: normal;
+}
+
+@iconSize: 16px;
+
+.@{prefix}-ico {
+	font-family: 'tinymce';
+	font-style: normal;
+	font-weight: normal;
+	font-size: @iconSize;
+	line-height: 16px;
+	vertical-align: text-top;
+	-webkit-font-smoothing: antialiased;
+
+	display: inline-block;
+	background: transparent center center;
+	width: 16px;
+	height: 16px;
+	color: @btn-text;
+	-ie7-icon: ' ';
+}
+
+.@{prefix}-btn-small .@{prefix}-ico {
+	font-family: 'tinymce-small';
+}
+
+// .@{prefix}-i-checkbox needs to have zoom overridden since it's set by the gradient mixin
+.@{prefix}-ico, i.@{prefix}-i-checkbox {
+	zoom: ~"expression(this.runtimeStyle['zoom'] = '1', this.innerHTML = this.currentStyle['-ie7-icon'].substr(1, 1) + '&nbsp;')";	
+}
+
+.@{prefix}-i-save           { -ie7-icon: "\e000"; }
+.@{prefix}-i-newdocument    { -ie7-icon: "\e001"; }
+.@{prefix}-i-fullpage       { -ie7-icon: "\e002"; }
+.@{prefix}-i-alignleft      { -ie7-icon: "\e003"; }
+.@{prefix}-i-aligncenter    { -ie7-icon: "\e004"; }
+.@{prefix}-i-alignright     { -ie7-icon: "\e005"; }
+.@{prefix}-i-alignjustify   { -ie7-icon: "\e006"; }
+.@{prefix}-i-cut            { -ie7-icon: "\e007"; }
+.@{prefix}-i-paste          { -ie7-icon: "\e008"; }
+.@{prefix}-i-searchreplace  { -ie7-icon: "\e009"; }
+.@{prefix}-i-bullist        { -ie7-icon: "\e00a"; }
+.@{prefix}-i-numlist        { -ie7-icon: "\e00b"; }
+.@{prefix}-i-indent         { -ie7-icon: "\e00c"; }
+.@{prefix}-i-outdent        { -ie7-icon: "\e00d"; }
+.@{prefix}-i-blockquote     { -ie7-icon: "\e00e"; }
+.@{prefix}-i-undo           { -ie7-icon: "\e00f"; }
+.@{prefix}-i-redo           { -ie7-icon: "\e010"; }
+.@{prefix}-i-link           { -ie7-icon: "\e011"; }
+.@{prefix}-i-unlink         { -ie7-icon: "\e012"; }
+.@{prefix}-i-anchor         { -ie7-icon: "\e013"; }
+.@{prefix}-i-image          { -ie7-icon: "\e014"; }
+.@{prefix}-i-media          { -ie7-icon: "\e015"; }
+.@{prefix}-i-help           { -ie7-icon: "\e016"; }
+.@{prefix}-i-code           { -ie7-icon: "\e017"; }
+.@{prefix}-i-insertdatetime { -ie7-icon: "\e018"; }
+.@{prefix}-i-preview        { -ie7-icon: "\e019"; }
+.@{prefix}-i-forecolor      { -ie7-icon: "\e01a"; }
+.@{prefix}-i-backcolor      { -ie7-icon: "\e01a"; }
+.@{prefix}-i-table          { -ie7-icon: "\e01b"; }
+.@{prefix}-i-hr             { -ie7-icon: "\e01c"; }
+.@{prefix}-i-removeformat   { -ie7-icon: "\e01d"; }
+.@{prefix}-i-subscript      { -ie7-icon: "\e01e"; }
+.@{prefix}-i-superscript    { -ie7-icon: "\e01f"; }
+.@{prefix}-i-charmap        { -ie7-icon: "\e020"; }
+.@{prefix}-i-emoticons      { -ie7-icon: "\e021"; }
+.@{prefix}-i-print          { -ie7-icon: "\e022"; }
+.@{prefix}-i-fullscreen     { -ie7-icon: "\e023"; }
+.@{prefix}-i-spellchecker   { -ie7-icon: "\e024"; }
+.@{prefix}-i-nonbreaking    { -ie7-icon: "\e025"; }
+.@{prefix}-i-template       { -ie7-icon: "\e026"; }
+.@{prefix}-i-pagebreak      { -ie7-icon: "\e027"; }
+.@{prefix}-i-restoredraft   { -ie7-icon: "\e028"; }
+.@{prefix}-i-untitled       { -ie7-icon: "\e029"; }
+.@{prefix}-i-bold           { -ie7-icon: "\e02a"; }
+.@{prefix}-i-italic         { -ie7-icon: "\e02b"; }
+.@{prefix}-i-underline      { -ie7-icon: "\e02c"; }
+.@{prefix}-i-strikethrough  { -ie7-icon: "\e02d"; }
+.@{prefix}-i-visualchars    { -ie7-icon: "\e02e"; }
+.@{prefix}-i-ltr            { -ie7-icon: "\e02f"; }
+.@{prefix}-i-rtl            { -ie7-icon: "\e030"; }
+.@{prefix}-i-copy           { -ie7-icon: "\e031"; }
+.@{prefix}-i-resize         { -ie7-icon: "\e032"; }
+.@{prefix}-i-browse         { -ie7-icon: "\e034"; }
+.@{prefix}-i-pastetext      { -ie7-icon: "\e035"; }
+
+.@{prefix}-i-checkbox, .@{prefix}-i-selected {
+	-ie7-icon: "\e033";
+}
+
+.@{prefix}-i-selected              { visibility: hidden; }
+.@{prefix}-i-backcolor             { background: #BBB; }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/skin.ie7.min.css	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+.mce-container,.mce-container *,.mce-widget,.mce-widget *,.mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:#333;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;font-weight:normal;text-align:left;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-widget button{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.mce-container *[unselectable]{-moz-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none}.mce-fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.mce-fade.mce-in{opacity:1}.mce-tinymce{visibility:inherit !important;position:relative}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;height:100%;z-index:100}div.mce-fullscreen{position:fixed;top:0;left:0;width:100%;height:auto}.mce-tinymce{display:block;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.mce-wordcount{position:absolute;top:0;right:0;padding:8px}div.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 #9e9e9e;width:20px;height:20px;line-height:20px;text-align:center;vertical-align:middle;padding:2px}.mce-charmap td div{text-align:center}.mce-charmap td:hover{background:#d9d9d9}.mce-grid td.mce-grid-cell div{border:1px solid #d6d6d6;width:15px;height:15px;margin:0px;cursor:pointer}.mce-grid td.mce-grid-cell div:focus{border-color:#a1a1a1}.mce-grid td.mce-grid-cell div[disabled]{cursor:not-allowed}.mce-grid{border-spacing:2px;border-collapse:separate}.mce-grid a{display:block;border:1px solid transparent}.mce-grid a:hover,.mce-grid a:focus{border-color:#a1a1a1}.mce-grid-border{margin:0 4px 0 4px}.mce-grid-border a{border-color:#d6d6d6;width:13px;height:13px}.mce-grid-border a:hover,.mce-grid-border a.mce-active{border-color:#a1a1a1;background:#c8def4}.mce-text-center{text-align:center}div.mce-tinymce-inline{width:100%;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-colorbtn-trans div{text-align:center;vertical-align:middle;font-weight:bold;font-size:20px;line-height:16px;color:#707070}.mce-toolbar-grp{padding-bottom:2px}.mce-toolbar-grp .mce-flow-layout-item{margin-bottom:0}.mce-rtl .mce-wordcount{left:0;right:auto}.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: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-fixed{position:fixed}.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{filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;-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);top:0;left:0;background:#fff;border:1px solid #9e9e9e;border:1px solid rgba(0,0,0,0.25)}.mce-floatpanel.mce-popover.mce-bottom{margin-top:10px;*margin-top:0}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#9e9e9e;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 #c5c5c5;position:relative}.mce-window-head .mce-close{position:absolute;right:15px;top:9px;font-size:20px;font-weight:bold;line-height:20px;color:#858585;cursor:pointer;height:20px;overflow:hidden}.mce-close:hover{color:#adadad}.mce-window-head .mce-title{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:#fff;border-top:1px solid #c5c5c5;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.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-rtl .mce-window-head .mce-close{position:absolute;right:auto;left:15px}.mce-rtl .mce-window-head .mce-dragh{left:auto;right:0}.mce-rtl .mce-window-head .mce-title{direction:rtl;text-align:right}.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 #000000;-moz-box-shadow:0 0 5px #000000;box-shadow:0 0 5px #000000}.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-nw,.mce-tooltip-sw{margin-left:-14px}.mce-tooltip-n .mce-tooltip-arrow{top:0px;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-nw .mce-tooltip-arrow{top:0;left:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-ne .mce-tooltip-arrow{top:0;right:10px;border-bottom-style:solid;border-top:none;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:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-sw .mce-tooltip-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-se .mce-tooltip-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:none;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:none;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 #b1b1b1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25) rgba(0,0,0,0.25);position:relative;text-shadow:0 1px 1px rgba(255,255,255,0.75);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);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}.mce-btn:hover,.mce-btn:focus{color:#333;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}.mce-btn.mce-disabled button,.mce-btn.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-btn.mce-active,.mce-btn.mce-active:hover{background-color:#d6d6d6;background-image:-moz-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#c0c0c0));background-image:-webkit-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-o-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:linear-gradient(to bottom, #e6e6e6, #c0c0c0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0);zoom:1;-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:active{background-color:#d6d6d6;background-image:-moz-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#c0c0c0));background-image:-webkit-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-o-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:linear-gradient(to bottom, #e6e6e6, #c0c0c0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0);zoom:1;-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;text-align:center;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{min-width:50px;color:#fff;border:1px solid #b1b1b1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25) rgba(0,0,0,0.25);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}.mce-primary:hover,.mce-primary:focus{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}.mce-primary.mce-disabled button,.mce-primary.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-primary.mce-active,.mce-primary.mce-active:hover,.mce-primary:not(.mce-disabled):active{background-color:#005299;background-image:-moz-linear-gradient(top, #069, #039);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#069), to(#039));background-image:-webkit-linear-gradient(top, #069, #039);background-image:-o-linear-gradient(top, #069, #039);background-image:linear-gradient(to bottom, #069, #039);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff006699', endColorstr='#ff003399', GradientType=0);zoom:1;-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-primary button,.mce-primary button i{color:#fff;text-shadow:1px 1px #333}.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:1px 5px;font-size:12px;*padding-bottom:2px}.mce-btn-small i{line-height:20px;vertical-align:top;*line-height:18px}.mce-btn .mce-caret{margin-top:8px;margin-left:0}.mce-btn-small .mce-caret{margin-top:8px;margin-left:0}.mce-caret{display:inline-block;*display:inline;*zoom:1;width:0;height:0;vertical-align:top;border-top:4px solid #333;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.mce-disabled .mce-caret{border-top-color:#aaa}.mce-caret.mce-up{border-bottom:4px solid #333;border-top:0}.mce-btn-flat{border:0;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-btn-flat:hover,.mce-btn-flat.mce-active,.mce-btn-flat:focus,.mce-btn-flat:active{border:0;background:#e6e6e6;filter:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-rtl .mce-btn button{direction:rtl}.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-first{border-left:1px solid #b1b1b1;border-left:1px solid rgba(0,0,0,0.25);-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 #b1b1b1;border-right:1px solid rgba(0,0,0,0.1);-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, #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;text-indent:-10em;*font-size:0;*line-height:0;*text-indent:0;overflow:hidden}.mce-checked i.mce-i-checkbox{color:#333;font-size:16px;line-height:16px;text-indent:0}.mce-checkbox:focus i.mce-i-checkbox,.mce-checkbox.mce-focus i.mce-i-checkbox{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.65);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65)}.mce-checkbox.mce-disabled .mce-label,.mce-checkbox.mce-disabled i.mce-i-checkbox{color:#acacac}.mce-rtl .mce-checkbox{direction:rtl;text-align:right}.mce-rtl i.mce-i-checkbox{margin:0 0 0 3px}.mce-combobox{display:inline-block;*display:inline;*zoom:1;-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);*height:32px}.mce-combobox input{border:1px solid #c5c5c5;border-right-color:#c5c5c5;height:28px}.mce-combobox.mce-disabled input{color:#adadad}.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.mce-disabled .mce-btn button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-colorbox i{border:1px solid #c5c5c5;width:14px;height:14px}.mce-colorbutton .mce-ico{position:relative}.mce-colorbutton-grid{margin:4px}.mce-colorbutton button{padding-right:4px}.mce-colorbutton .mce-preview{padding-right:3px;display:block;position:absolute;left:50%;top:50%;margin-left:-14px;margin-top:7px;background:gray;width:13px;height:2px;overflow:hidden}.mce-colorbutton.mce-btn-small .mce-preview{margin-left:-16px;padding-right:0;width:16px}.mce-colorbutton .mce-open{padding-left:4px;border-left:1px solid transparent;border-right:1px solid transparent}.mce-colorbutton:hover .mce-open{border-left-color:#bdbdbd;border-right-color:#bdbdbd}.mce-colorbutton.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-colorbutton{direction:rtl}.mce-rtl .mce-colorbutton .mce-preview{margin-left:0;padding-right:0;padding-left:4px;margin-right:-14px}.mce-rtl .mce-colorbutton.mce-btn-small .mce-preview{margin-left:0;padding-right:0;margin-right:-17px;padding-left:0}.mce-rtl .mce-colorbutton button{padding-right:10px;padding-left:10px}.mce-rtl .mce-colorbutton .mce-open{padding-left:4px;padding-right:4px}.mce-colorpicker{position:relative;width:250px;height:220px}.mce-colorpicker-sv{position:absolute;top:0;left:0;width:90%;height:100%;border:1px solid #c5c5c5;cursor:crosshair;overflow:hidden}.mce-colorpicker-h-chunk{width:100%}.mce-colorpicker-overlay1,.mce-colorpicker-overlay2{width:100%;height:100%;position:absolute;top:0;left:0}.mce-colorpicker-overlay1{filter:progid:DXImageTransform.Microsoft.gradient(GradientType=1, startColorstr='#ffffff', endColorstr='#00ffffff');-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff')";background:linear-gradient(to right, #fff, rgba(255,255,255,0))}.mce-colorpicker-overlay2{filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#00000000', endColorstr='#000000');-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00000000', endColorstr='#000000')";background:linear-gradient(to bottom, rgba(0,0,0,0), #000)}.mce-colorpicker-selector1{background:none;position:absolute;width:12px;height:12px;margin:-8px 0 0 -8px;border:1px solid black;border-radius:50%}.mce-colorpicker-selector2{position:absolute;width:10px;height:10px;border:1px solid white;border-radius:50%}.mce-colorpicker-h{position:absolute;top:0;right:0;width:6.5%;height:100%;border:1px solid #c5c5c5;cursor:crosshair}.mce-colorpicker-h-marker{margin-top:-4px;position:absolute;top:0;left:-1px;width:100%;border:1px solid #333;background:#fff;height:4px;z-index:100}.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:#333}.mce-path-item:hover{text-decoration:underline}.mce-path-item:focus{background:#666;color:#fff}.mce-path .mce-divider{display:inline}.mce-disabled .mce-path-item{color:#aaa}.mce-rtl .mce-path{direction:rtl}.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-tinymce-inline .mce-flow-layout{white-space:nowrap}.mce-rtl .mce-flow-layout{text-align:right;direction:rtl}.mce-rtl .mce-flow-layout-item{margin:2px 2px 2px 0}.mce-rtl .mce-flow-layout-item.mce-last{margin-left:2px}.mce-iframe{border:0 solid #9e9e9e;width:100%;height:100%}.mce-label{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 1px rgba(255,255,255,0.75);overflow:hidden}.mce-label.mce-autoscroll{overflow:auto}.mce-label.mce-disabled{color:#aaa}.mce-label.mce-multiline{white-space:pre-wrap}.mce-label.mce-error{color:#a00}.mce-rtl .mce-label{text-align:right;direction:rtl}.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 #c4c4c4}.mce-menubar .mce-menubtn button span{color:#333}.mce-menubar .mce-caret{border-top-color:#333}.mce-menubar .mce-menubtn:hover,.mce-menubar .mce-menubtn.mce-active,.mce-menubar .mce-menubtn:focus{border-color:transparent;background:#e6e6e6;filter:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-menubtn span{color:#333;margin-right:2px;line-height:20px;*line-height:16px}.mce-menubtn.mce-btn-small span{font-size:12px}.mce-menubtn.mce-fixed-width span{display:inline-block;overflow-x:hidden;text-overflow:ellipsis;width:90px}.mce-menubtn.mce-fixed-width.mce-btn-small span{width:70px}.mce-menubtn .mce-caret{*margin-top:6px}.mce-rtl .mce-menubtn button{direction:rtl;text-align:right}.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-rtl .mce-listbox .mce-caret{right:auto;left:8px}.mce-rtl .mce-listbox button{padding-right:10px;padding-left:20px}.mce-menu-item{display:block;padding:6px 15px 6px 12px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap;cursor:pointer;line-height:normal;border-left:4px solid transparent;margin-bottom:1px}.mce-menu-item .mce-ico,.mce-menu-item .mce-text{color:#333}.mce-menu-item.mce-disabled .mce-text,.mce-menu-item.mce-disabled .mce-ico{color:#adadad}.mce-menu-item:hover .mce-text,.mce-menu-item.mce-selected .mce-text,.mce-menu-item:focus .mce-text{color:#fff}.mce-menu-item:hover .mce-ico,.mce-menu-item.mce-selected .mce-ico,.mce-menu-item:focus .mce-ico{color:#fff}.mce-menu-item.mce-disabled:hover{background:#ccc}.mce-menu-shortcut{display:inline-block;color:#adadad}.mce-menu-shortcut{display:inline-block;*display:inline;*zoom:1;padding:0 15px 0 20px}.mce-menu-item:hover .mce-menu-shortcut,.mce-menu-item.mce-selected .mce-menu-shortcut,.mce-menu-item:focus .mce-menu-shortcut{color:#fff}.mce-menu-item .mce-caret{margin-top:4px;*margin-top:3px;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid #333}.mce-menu-item.mce-selected .mce-caret,.mce-menu-item:focus .mce-caret,.mce-menu-item:hover .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.mce-active i{visibility:visible}.mce-menu-item-normal.mce-active{background-color:#c8def4}.mce-menu-item-preview.mce-active{border-left:5px solid #aaa}.mce-menu-item-normal.mce-active .mce-text{color:#333}.mce-menu-item-normal.mce-active:hover .mce-text,.mce-menu-item-normal.mce-active:hover .mce-ico{color:#fff}.mce-menu-item-normal.mce-active:focus .mce-text,.mce-menu-item-normal.mce-active:focus .mce-ico{color:#fff}.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}div.mce-menu .mce-menu-item-sep,.mce-menu-item-sep:hover{border:0;padding:0;height:1px;margin:9px 1px;overflow:hidden;background:#cbcbcb;border-bottom:1px solid #fff;cursor:default;filter:none}.mce-menu.mce-rtl{direction:rtl}.mce-rtl .mce-menu-item{text-align:right;direction:rtl;padding:6px 12px 6px 15px}.mce-menu-align.mce-rtl .mce-menu-shortcut,.mce-menu-align.mce-rtl .mce-caret{right:auto;left:0}.mce-rtl .mce-menu-item .mce-caret{margin-left:6px;margin-right:0;border-right:4px solid #333;border-left:0}.mce-rtl .mce-menu-item.mce-selected .mce-caret,.mce-rtl .mce-menu-item:focus .mce-caret,.mce-rtl .mce-menu-item:hover .mce-caret{border-left-color:transparent;border-right-color:#fff}.mce-menu{position:absolute;left:0;top:0;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 #989898;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);max-height:400px;overflow:auto;overflow-x:hidden}.mce-menu i{display:none}.mce-menu-has-icons i{display:inline-block;*display:inline}.mce-menu-sub-tr-tl{margin:-6px 0 0 -1px}.mce-menu-sub-br-bl{margin:6px 0 0 -1px}.mce-menu-sub-tl-tr{margin:-6px 0 0 1px}.mce-menu-sub-bl-br{margin:6px 0 0 1px}.mce-container-body .mce-resizehandle{position:absolute;right:0;bottom:0;width:16px;height:16px;visibility:visible;cursor:s-resize;margin:0}.mce-container-body .mce-resizehandle-both{cursor:se-resize}i.mce-i-resize{color:#333}.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:#bdbdbd;border-right-color:#bdbdbd}.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-splitbtn.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-splitbtn{direction:rtl;text-align:right}.mce-rtl .mce-splitbtn button{padding-right:10px;padding-left:10px}.mce-rtl .mce-splitbtn .mce-open{padding-left:4px;padding-right:4px}.mce-stack-layout-item{display:block}.mce-tabs{display:block;border-bottom:1px solid #c5c5c5}.mce-tab{display:inline-block;*display:inline;*zoom:1;border:1px solid #c5c5c5;border-width:0 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-rtl .mce-tabs{text-align:right;direction:rtl}.mce-rtl .mce-tab{border-width:0 0 0 1px}.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:pre-wrap;*white-space:pre;color:#333}.mce-textbox:focus,.mce-textbox.mce-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.65);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65)}.mce-placeholder .mce-textbox{color:#aaa}.mce-textbox.mce-multiline{padding:4px}.mce-textbox.mce-disabled{color:#adadad}.mce-rtl .mce-textbox{text-align:right;direction:rtl}.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}.mce-throbber-inline{position:static;height:50px}@font-face{font-family:'tinymce';src:url('fonts/tinymce.eot');src:url('fonts/tinymce.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce.woff') format('woff'),url('fonts/tinymce.ttf') format('truetype'),url('fonts/tinymce.svg#tinymce') format('svg');font-weight:normal;font-style:normal}@font-face{font-family:'tinymce-small';src:url('fonts/tinymce-small.eot');src:url('fonts/tinymce-small.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce-small.woff') format('woff'),url('fonts/tinymce-small.ttf') format('truetype'),url('fonts/tinymce-small.svg#tinymce') format('svg');font-weight:normal;font-style:normal}.mce-ico{font-family:'tinymce';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-btn-small .mce-ico{font-family:'tinymce-small'}.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-insertdatetime{-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-pastetext{-ie7-icon:"\e035"}.mce-i-checkbox,.mce-i-selected{-ie7-icon:"\e033"}.mce-i-selected{visibility:hidden}.mce-i-backcolor{background:#BBB}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/skin.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1903 @@
+// Reset
+
+.@{prefix}-container, .@{prefix}-container *, .@{prefix}-widget, .@{prefix}-widget *, .@{prefix}-reset {
+	margin: 0; padding: 0; border: 0; outline: 0;
+	vertical-align: top; background: transparent;
+	text-decoration: none; color: @text;
+	font-family: @font-family;
+	font-size: @font-size; text-shadow: none; float: none;
+	position: static; width: auto; height: auto;
+	white-space: nowrap; cursor: inherit;
+	-webkit-tap-highlight-color: transparent;
+	line-height: normal; font-weight: normal;
+	text-align: left;
+	-moz-box-sizing: content-box;
+	-webkit-box-sizing: content-box;
+	box-sizing: content-box;
+	direction: ltr;
+	max-width: none;
+}
+
+.@{prefix}-widget button {
+	-moz-box-sizing: border-box;
+	-webkit-box-sizing: border-box;
+	box-sizing: border-box;
+}
+
+.@{prefix}-container *[unselectable] {
+	-moz-user-select: none;
+	-webkit-user-select: none;
+	-o-user-select: none;
+	user-select: none;
+}
+// Variables
+// Syntax: <control>-(<sub control>)-<bg|border|text>-(<state>)-(<extra>);
+// Example: @btn-primary-bg-hover-hlight;
+
+@prefix:                         mce;
+
+// Default font
+@font-family:                    "Helvetica Neue", Helvetica, Arial, sans-serif;
+@font-size:                      14px;
+@line-height:                    20px;
+@has-gradients:                  true;
+@has-radius:                     true;
+@has-boxshadow:                  true;
+
+// Text colors
+@text:                           #333;
+@text-inverse:                   white;
+@text-disabled:                  #aaa;
+@text-shadow:                    0 1px 1px hsla(hue(@text-inverse), saturation(@text-inverse), lightness(@text-inverse), 0.75);
+@text-error:                     #aa0000;
+
+// Button
+@btn-text:                       @text;
+@btn-text-shadow:                @text-inverse;
+@btn-border-top:                 rgba(0, 0, 0, .1);
+@btn-border-right:               rgba(0, 0, 0, .1);
+@btn-border-bottom:              fadein(rgba(0, 0, 0, .1), 15%);
+@btn-border-left:                fadein(rgba(0, 0, 0, .1), 15%);
+@btn-split-border:               #bdbdbd;
+@btn-caret-border:               @btn-text;
+@btn-text-disabled:              @text-disabled;
+@btn-box-shadow:                 inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 2px rgba(0, 0, 0, .05);
+@btn-box-shadow-active:          inset 0 2px 4px rgba(0, 0, 0, .15), 0 1px 2px rgba(0, 0, 0, .05);
+@btn-box-disabled-opacity:       0.4;
+@btn-bg:                         white;
+@btn-bg-hlight:                  #D9D9D9;
+@btn-bg-hover:                   darken(@btn-bg, 5%);
+@btn-bg-hlight-hover:            darken(@btn-bg-hlight, 5%);
+
+@btn-primary-bg:                 #0088cc;
+@btn-primary-bg-hlight:          #0044cc;
+@btn-primary-bg-hover:           darken(@btn-primary-bg, 5%);
+@btn-primary-bg-hover-hlight:    darken(@btn-primary-bg-hlight, 5%);
+@btn-primary-text:               #fff;
+@btn-primary-text-shadow:        #333;
+@btn-primary-border-top:         mix(@btn-border-top, @btn-primary-bg, 50%);
+@btn-primary-border-right:       mix(@btn-border-right, @btn-primary-bg, 50%);
+@btn-primary-border-bottom:      mix(@btn-border-bottom, @btn-primary-bg, 50%);
+@btn-primary-border-left:        mix(@btn-border-left, @btn-primary-bg, 50%);
+
+// Menu
+@menuitem-text:                  @text;
+@menu-bg:                        #fff;
+@menu-border:                    rgba(0, 0, 0, 0.2);
+@menubar-border:                 mix(@panel-border, @panel-bg, 60%);
+@menuitem-text-inverse:          @text-inverse;
+@menubar-bg-active:              darken(@btn-bg, 10%);
+@menuitem-bg-hover:              #0081C2;
+@menuitem-bg-selected:           #08C;
+@menuitem-bg-selected-hlight:    #0077B3;
+@menuitem-bg-disabled:           #CCC;
+@menuitem-caret:                 @menuitem-text;
+@menuitem-caret-selected:        @menuitem-text-inverse;
+@menuitem-separator-top:         #CBCBCB;
+@menuitem-separator-bottom:      @menu-bg;
+@menuitem-bg-active:             #C8DEF4;
+@menuitem-text-active:           @text;
+@menuitem-preview-border-active: #aaa;
+
+// Panel
+@panel-border:                   #9E9E9E;
+@panel-bg:                       #FDFDFD;
+@panel-bg-hlight:                #DDD;
+
+// Tabs
+@tab-border:                     #c5c5c5;
+@tab-bg:                         #e3e3e3;
+@tab-bg-hover:                   #FDFDFD;
+@tab-bg-active:                  #FDFDFD;
+
+// Tooltip
+@tooltip-bg:                     #000;
+@tooltip-text:                   white;
+@tooltip-font-size:              11px;
+
+// Window
+@window-border:                  #c5c5c5;
+@window-head-border:             @window-border;
+@window-head-close:              mix(@text, @window-bg, 60%);
+@window-head-close-hover:        mix(@text, @window-bg, 40%);
+@window-foot-border:             @window-border;
+@window-foot-bg:                 @window-bg;
+@window-fullscreen-bg:           #FFF;
+@window-modalblock-bg:           #000;
+@window-modalblock-opacity:      0.3;
+@window-box-shadow:              0 3px 7px rgba(0, 0, 0, 0.3);
+@window-bg:                      #FFF;
+@window-title-font-size:         20px;
+
+// Popover
+@popover-bg:                     @window-bg;
+@popover-arrow-width:            10px;
+@popover-arrow:                  @window-bg;
+@popover-arrow-outer-width:      @popover-arrow-width + 1;
+@popover-arrow-outer:            rgba(0, 0, 0, 0.25);
+
+// Floatpanel
+@floatpanel-box-shadow:          0 5px 10px rgba(0, 0, 0, .2);
+
+// Checkbox
+@checkbox-bg:                    @btn-bg;
+@checkbox-bg-hlight:             @btn-bg-hlight;
+@checkbox-box-shadow:            inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 2px rgba(0, 0, 0, .05);
+@checkbox-border:                #c5c5c5;
+@checkbox-border-focus:          rgba(82, 168, 236, .8);
+
+// Path
+@path-text:                      @text;
+@path-bg-focus:                  #666;
+@path-text-focus:                #fff;
+
+// Textbox
+@textbox-text-placeholder:       #aaa;
+@textbox-box-shadow:             inset 0 1px 1px rgba(0, 0, 0, 0.075);
+@textbox-bg:                     #fff;
+@textbox-border:                 #c5c5c5;
+@textbox-border-focus:           rgba(82, 168, 236, .8);
+
+// Throbber
+@throbber-bg:                    #fff url('img/loader.gif') no-repeat center center;
+
+// Combobox
+@combobox-border:                @textbox-border;
+
+// Colorpicker
+@colorpicker-border:             @textbox-border;
+@colorpicker-hue-bg:             #fff;
+@colorpicker-hue-border:         #333;
+
+// Grid
+@grid-bg-active:                 @menuitem-bg-active;
+@grid-border-active:             #a1a1a1;
+@grid-border:                    #d6d6d6;
+
+// Misc
+@colorbtn-backcolor-bg:          #BBB;
+@iframe-border:                  @panel-border;
+// Mixins
+
+.opacity(@opacity) {
+	opacity: @opacity;
+	@opacityie: @opacity * 100;
+	filter: ~"alpha(opacity=@{opacityie})";
+	zoom: 1;
+}
+
+.vertical-gradient(@startColor, @endColor) when (@has-gradients = true) {
+	background-color: mix(@startColor, @endColor, 60%);
+	background-image: -moz-linear-gradient(top, @startColor, @endColor); // FF 3.6+
+	background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+
+	background-image: -webkit-linear-gradient(top, @startColor, @endColor); // Safari 5.1+, Chrome 10+
+	background-image: -o-linear-gradient(top, @startColor, @endColor); // Opera 11.10
+	background-image: linear-gradient(to bottom, @startColor, @endColor); // Standard, IE10
+	background-repeat: repeat-x;
+	filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)", argb(@startColor), argb(@endColor)));
+	zoom: 1;
+}
+
+.vertical-gradient(@startColor, @endColor) when (@has-gradients = false) {
+	background-color: mix(@startColor, @endColor, 60%);
+}
+
+.border-radius(@radius) when (@has-radius = true) {
+	-webkit-border-radius: @radius;
+	-moz-border-radius: @radius;
+	border-radius: @radius;
+}
+
+.box-shadow(@shadowA, @shadowB:X, ...) when (@has-boxshadow = true) {
+	// Multiple shadow solution from http://toekneestuck.com/blog/2012/05/15/less-css-arguments-variable/
+	@props: ~`"@{arguments}".replace(/[\[\]]|\,\sX/g, '')`;
+	-webkit-box-shadow: @props;
+	-moz-box-shadow: @props;
+	box-shadow: @props;
+}
+
+.transition(@transition) {
+	-webkit-transition: @transition;
+	transition: @transition;
+}
+
+.inline-block() {
+	display: inline-block;
+	*display: inline;
+	*zoom: 1;
+}
+
+.reset-gradient() {
+	filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)"));
+	background: transparent;
+}
+// Animations
+
+.@{prefix}-fade {
+	opacity: 0;
+	.transition(opacity .15s linear);
+
+	&.@{prefix}-in {
+		opacity: 1;
+	}
+}
+.@{prefix}-tinymce {
+	// Avoid FOUC
+	visibility: inherit !important;
+	position: relative;
+}
+
+.@{prefix}-fullscreen {
+	border: 0; padding: 0; margin: 0;
+	overflow: hidden;
+	height: 100%;
+	z-index: 100;
+}
+
+div.@{prefix}-fullscreen {
+	position: fixed;
+	top: 0; left: 0;
+	width: 100%;
+	height: auto;
+}
+
+.@{prefix}-tinymce {
+	display: block;
+	.border-radius(2px);
+}
+
+.@{prefix}-wordcount {
+	position: absolute;
+	top: 0;
+	right: 0;
+	padding: 8px;
+}
+
+div.@{prefix}-edit-area {
+	background: #FFF;
+	filter: none;
+}
+
+.@{prefix}-statusbar {
+	position: relative;
+}
+
+.@{prefix}-statusbar .@{prefix}-container-body {
+	position: relative;
+}
+
+.@{prefix}-fullscreen .@{prefix}-resizehandle {
+	display: none;
+}
+
+// Charmap
+
+.@{prefix}-charmap {
+	border-collapse: collapse;
+}
+
+.@{prefix}-charmap td {
+	cursor: default;
+	border: 1px solid @panel-border;
+	width: 20px;
+	height: 20px;
+	line-height: 20px;
+	text-align: center;
+	vertical-align: middle;
+	padding: 2px;
+}
+
+.@{prefix}-charmap td div {
+	text-align: center;
+}
+
+.@{prefix}-charmap td:hover {
+	background: @btn-bg-hlight;
+}
+
+.@{prefix}-grid td.@{prefix}-grid-cell div {
+	border: 1px solid @grid-border;
+	width: 15px; height: 15px;
+	margin: 0px;
+	cursor: pointer;
+
+	&:focus {
+		border-color: @grid-border-active;
+	}
+
+	&[disabled] {
+		cursor: not-allowed;
+	}
+}
+
+.@{prefix}-grid {
+	border-spacing: 2px;
+	border-collapse: separate;
+
+	a {
+		display: block;
+		border: 1px solid transparent;
+
+		&:hover, &:focus {
+			border-color: @grid-border-active;
+		}
+	}
+}
+
+.@{prefix}-grid-border {
+	margin: 0 4px 0 4px;
+
+	a {
+		border-color: @grid-border;
+		width: 13px; height: 13px;
+	}
+
+	a:hover, a.@{prefix}-active {
+		border-color: @grid-border-active;
+		background: @grid-bg-active;
+	}
+}
+
+.@{prefix}-text-center {
+	text-align: center;
+}
+
+div.@{prefix}-tinymce-inline {
+	width: 100%;
+	.box-shadow(none);
+}
+
+.@{prefix}-colorbtn-trans div {
+	text-align: center;
+	vertical-align: middle;
+	font-weight: bold;
+	font-size: 20px;
+	line-height: 16px;
+	color: mix(@text, #fff, 70%);
+}
+
+// Reduce double margins between toolbar rows
+
+.@{prefix}-toolbar-grp {
+	padding-bottom: 2px;
+}
+
+.@{prefix}-toolbar-grp .@{prefix}-flow-layout-item {
+	margin-bottom: 0;
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-wordcount {
+	left: 0;
+	right: auto;
+}
+// Container
+
+.@{prefix}-container, .@{prefix}-container-body {
+	display: block;
+}
+
+.@{prefix}-autoscroll {
+	overflow: hidden;
+}
+// Scrollbar
+
+.@{prefix}-scrollbar {
+	position: absolute;
+	width: 7px;
+	height: 100%;
+	top: 2px;
+	right: 2px;
+	.opacity(0.4);
+}
+
+.@{prefix}-scrollbar-h {
+	top: auto;
+	right: auto;
+	left: 2px;
+	bottom: 2px;
+	width: 100%;
+	height: 7px;
+}
+
+.@{prefix}-scrollbar-thumb {
+	position: absolute;
+	background-color: #000;
+	border: 1px solid #888;
+	border-color: rgba(85, 85, 85, .6);
+	width: 5px;
+	height: 100%;
+	.border-radius(7px);
+}
+
+.@{prefix}-scrollbar-h .@{prefix}-scrollbar-thumb {
+	width: 100%;
+	height: 5px;
+}
+
+.@{prefix}-scrollbar:hover, .@{prefix}-scrollbar.@{prefix}-active {
+	background-color: #AAA;
+	.opacity(0.6);
+	.border-radius(7px);
+}
+
+.@{prefix}-scroll {
+	position: relative;
+}
+// Panel
+
+.@{prefix}-panel {
+	border: 0 solid @panel-border;
+	.vertical-gradient(@panel-bg, @panel-bg-hlight);
+}
+// FloatPanel
+
+.@{prefix}-floatpanel {
+	position: absolute;
+	.box-shadow(@floatpanel-box-shadow);
+}
+
+.@{prefix}-floatpanel.@{prefix}-fixed {
+	position: fixed;
+}
+
+// Popover panel
+
+.@{prefix}-floatpanel .@{prefix}-arrow,
+.@{prefix}-floatpanel .@{prefix}-arrow:after {
+	position: absolute;
+	display: block;
+	width: 0;
+	height: 0;
+	border-color: transparent;
+	border-style: solid;
+}
+
+.@{prefix}-floatpanel .@{prefix}-arrow {
+	border-width: @popover-arrow-outer-width;
+}
+
+.@{prefix}-floatpanel .@{prefix}-arrow:after {
+	border-width: @popover-arrow-width;
+	content: "";
+}
+
+.@{prefix}-floatpanel.@{prefix}-popover {
+	.reset-gradient();
+	.border-radius(6px);
+	.box-shadow(@floatpanel-box-shadow);
+	top: 0;
+	left: 0;
+	background: @popover-bg;
+	border: 1px solid @panel-border;
+	border: 1px solid @popover-arrow-outer;
+
+	&.@{prefix}-bottom {
+		margin-top: @popover-arrow-width;
+		*margin-top: 0;
+
+		& > .@{prefix}-arrow {
+			left: 50%;
+			margin-left: -@popover-arrow-outer-width;
+			border-top-width: 0;
+			border-bottom-color: @panel-border;
+			border-bottom-color: @popover-arrow-outer;
+			top: -@popover-arrow-outer-width;
+
+			&:after {
+				top: 1px;
+				margin-left: -@popover-arrow-width;
+				border-top-width: 0;
+				border-bottom-color: @popover-arrow;
+			}
+		}
+
+		&.@{prefix}-start { margin-left: -22px; }
+		&.@{prefix}-start > .@{prefix}-arrow { left: 20px; }
+
+		&.@{prefix}-end { margin-left: 22px; }
+		&.@{prefix}-end > .@{prefix}-arrow { right: 10px; left: auto; }
+	}
+}// Window
+
+.@{prefix}-fullscreen {
+	border: 0; padding: 0; margin: 0;
+	overflow: hidden;
+	background: @window-fullscreen-bg;
+	height: 100%;
+}
+
+div.@{prefix}-fullscreen {
+	position: fixed;
+	top: 0; left: 0;
+}
+
+#@{prefix}-modal-block {
+	.opacity(0);
+	position: fixed;
+	left: 0; top: 0;
+	width: 100%; height: 100%;
+	background: @window-modalblock-bg;
+}
+
+#@{prefix}-modal-block.@{prefix}-in {
+	.opacity(@window-modalblock-opacity);
+}
+
+.@{prefix}-window-move {
+	cursor: move;
+}
+
+.@{prefix}-window {
+	.border-radius(6px);
+	.box-shadow(@window-box-shadow);
+	.reset-gradient();
+	background: @window-bg;
+	position: fixed;
+	top: 0; left: 0;
+	opacity: 0;
+	.transition(opacity 150ms ease-in);
+}
+
+.@{prefix}-window.@{prefix}-in {
+	opacity: 1;
+}
+
+.@{prefix}-window-head {
+	padding: 9px 15px;
+	border-bottom: 1px solid @window-head-border;
+	position: relative;
+}
+
+.@{prefix}-window-head .@{prefix}-close {
+	position: absolute;
+	right: 15px;
+	top: 9px;
+	font-size: 20px;
+	font-weight: bold;
+	line-height: 20px;
+	color: @window-head-close;
+	cursor: pointer;
+
+	// IE7
+	height: 20px;
+	overflow: hidden;
+}
+
+.@{prefix}-close:hover {
+	color: @window-head-close-hover;
+}
+
+.@{prefix}-window-head .@{prefix}-title {
+	line-height: 20px;
+	font-size: @window-title-font-size;
+	font-weight: bold;
+	text-rendering: optimizelegibility;
+	padding-right: 10px;
+}
+
+.@{prefix}-window .@{prefix}-container-body {
+	display: block;
+}
+
+.@{prefix}-foot {
+	display: block;
+	background-color: @window-foot-bg;
+	border-top: 1px solid @window-foot-border;
+	.border-radius(0 0 6px 6px);
+}
+
+.@{prefix}-window-head .@{prefix}-dragh {
+	position: absolute;
+	top: 0; left: 0;
+	cursor: move;
+	width: 90%;
+	height: 100%;
+}
+
+.@{prefix}-window iframe {
+	width: 100%;
+	height: 100%;
+}
+
+.@{prefix}-window.@{prefix}-fullscreen, .@{prefix}-window.@{prefix}-fullscreen .@{prefix}-foot {
+	.border-radius(0);
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-window-head .@{prefix}-close {
+	position: absolute;
+	right: auto;
+	left: 15px;
+}
+
+.@{prefix}-rtl .@{prefix}-window-head .@{prefix}-dragh {
+	left: auto;
+	right: 0;
+}
+
+.@{prefix}-rtl .@{prefix}-window-head .@{prefix}-title {
+	direction: rtl;
+	text-align: right;
+}
+// AbsoluteLayout
+
+.@{prefix}-abs-layout {
+	position: relative;
+}
+
+body .@{prefix}-abs-layout-item, .@{prefix}-abs-end {
+	position: absolute;
+}
+
+.@{prefix}-abs-end {
+	width: 1px; height: 1px;
+}
+
+.@{prefix}-container-body.@{prefix}-abs-layout {
+	overflow: hidden;
+}
+// Tooltip
+
+.@{prefix}-tooltip {
+	position: absolute;
+	padding: 5px;
+	.opacity(0.8);
+}
+
+.@{prefix}-tooltip-inner {
+	font-size: @tooltip-font-size;
+	background-color: @tooltip-bg;
+	color: @tooltip-text;
+	max-width: 200px;
+	padding: 5px 8px 4px 8px;
+	text-align: center;
+	white-space: normal;
+}
+
+.@{prefix}-tooltip-inner {
+	.border-radius(3px);
+}
+
+.@{prefix}-tooltip-inner {
+	.box-shadow(0 0 5px @tooltip-bg);
+}
+
+.@{prefix}-tooltip-arrow {
+	position: absolute;
+	width: 0;
+	height: 0;
+	line-height: 0;
+	border: 5px dashed @tooltip-bg;
+}
+
+.@{prefix}-tooltip-arrow-n {
+	border-bottom-color: @tooltip-bg;
+}
+
+.@{prefix}-tooltip-arrow-s {
+	border-top-color: @tooltip-bg;
+}
+
+.@{prefix}-tooltip-arrow-e {
+	border-left-color: @tooltip-bg;
+}
+
+.@{prefix}-tooltip-arrow-w {
+	border-right-color: @tooltip-bg;
+}
+
+.@{prefix}-tooltip-nw, .@{prefix}-tooltip-sw {
+	margin-left: -14px;
+}
+
+.@{prefix}-tooltip-n .@{prefix}-tooltip-arrow {
+	top: 0px;
+	left: 50%;
+	margin-left: -5px;
+	border-bottom-style: solid;
+	border-top: none;
+	border-left-color: transparent;
+	border-right-color: transparent;
+}
+
+.@{prefix}-tooltip-nw .@{prefix}-tooltip-arrow {
+	top: 0;
+	left: 10px;
+	border-bottom-style: solid;
+	border-top: none;
+	border-left-color: transparent;
+	border-right-color: transparent;
+}
+
+.@{prefix}-tooltip-ne .@{prefix}-tooltip-arrow {
+	top: 0;
+	right: 10px;
+	border-bottom-style: solid;
+	border-top: none;
+	border-left-color: transparent;
+	border-right-color: transparent;
+}
+
+.@{prefix}-tooltip-s .@{prefix}-tooltip-arrow {
+	bottom: 0;
+	left: 50%;
+	margin-left: -5px;
+	border-top-style: solid;
+	border-bottom: none;
+	border-left-color: transparent;
+	border-right-color: transparent;
+}
+
+.@{prefix}-tooltip-sw .@{prefix}-tooltip-arrow {
+	bottom: 0;
+	left: 10px;
+	border-top-style: solid;
+	border-bottom: none;
+	border-left-color: transparent;
+	border-right-color: transparent;
+}
+
+.@{prefix}-tooltip-se .@{prefix}-tooltip-arrow {
+	bottom: 0;
+	right: 10px;
+	border-top-style: solid;
+	border-bottom: none;
+	border-left-color: transparent;
+	border-right-color: transparent;
+}
+
+.@{prefix}-tooltip-e .@{prefix}-tooltip-arrow {
+	right: 0;
+	top: 50%;
+	margin-top: -5px;
+	border-left-style: solid;
+	border-right: none;
+	border-top-color: transparent;
+	border-bottom-color: transparent;
+}
+
+.@{prefix}-tooltip-w .@{prefix}-tooltip-arrow {
+	left: 0;
+	top: 50%;
+	margin-top: -5px;
+	border-right-style: solid;
+	border-left: none;
+	border-top-color: transparent;
+	border-bottom-color: transparent;
+}
+// Button
+
+.@{prefix}-btn {
+	border: 1px solid mix(rgb(red(@btn-border-right), green(@btn-border-right), blue(@btn-border-right)), @panel-bg, 30%);
+	border-color: @btn-border-top @btn-border-right @btn-border-bottom @btn-border-left;
+	position: relative;
+	text-shadow: @text-shadow;
+
+	.inline-block();
+	.border-radius(3px);
+	.box-shadow(@btn-box-shadow);
+	.vertical-gradient(@btn-bg, @btn-bg-hlight);
+
+	&:hover, &:focus {
+		color: @btn-text;
+		.vertical-gradient(darken(@btn-bg, 5%), darken(@btn-bg-hlight, 5%));
+	}
+
+	&.@{prefix}-disabled button, &.@{prefix}-disabled:hover button {
+		cursor: default;
+		.box-shadow(none);
+		.opacity(@btn-box-disabled-opacity);
+	}
+
+	&.@{prefix}-active, &.@{prefix}-active:hover {
+		.vertical-gradient(darken(@btn-bg, 10%), darken(@btn-bg-hlight, 10%));
+		.box-shadow(@btn-box-shadow-active);
+	}
+
+	&:active {
+		.vertical-gradient(darken(@btn-bg, 10%), darken(@btn-bg-hlight, 10%));
+		.box-shadow(@btn-box-shadow-active);
+	}
+}
+
+.@{prefix}-btn button {
+	padding: 4px 10px;
+	font-size: @font-size;
+	line-height: @line-height;
+	*line-height: @line-height - 4px;
+	cursor: pointer;
+	color: @btn-text;
+	text-align: center;
+
+	// Fixes for default inner padding of button
+	overflow: visible; // IE7
+	-webkit-appearance: none; // WebKit
+	&::-moz-focus-inner { // Gecko
+		border: 0;
+		padding: 0;
+	}
+}
+
+.@{prefix}-btn i {
+	text-shadow: 1px 1px @btn-text-shadow;
+}
+
+.@{prefix}-primary {
+	min-width: 50px;
+	color: @btn-primary-text;
+	border: 1px solid mix(rgb(red(@btn-border-right), green(@btn-border-right), blue(@btn-border-right)), @panel-bg, 30%);
+	border-color: @btn-border-top @btn-border-right @btn-border-bottom @btn-border-left;
+	.vertical-gradient(@btn-primary-bg, @btn-primary-bg-hlight);
+
+	&:hover, &:focus {
+		.vertical-gradient(darken(@btn-primary-bg, 5%), darken(@btn-primary-bg-hlight, 5%));
+	}
+
+	&.@{prefix}-disabled button, &.@{prefix}-disabled:hover button {
+		cursor: default;
+		.box-shadow(none);
+		.opacity(@btn-box-disabled-opacity);
+	}
+
+	&.@{prefix}-active, &.@{prefix}-active:hover, &:not(.@{prefix}-disabled):active {
+		.vertical-gradient(darken(@btn-primary-bg, 10%), darken(@btn-primary-bg-hlight, 10%));
+		.box-shadow(@btn-box-shadow-active);
+	}
+}
+
+.@{prefix}-primary button, .@{prefix}-primary button i {
+	color: @btn-primary-text;
+	text-shadow: 1px 1px @btn-primary-text-shadow;
+}
+
+.@{prefix}-btn-large button {
+	padding: 9px 14px;
+	font-size: @font-size + 2px;
+	line-height: normal;
+	.border-radius(5px);
+}
+
+.@{prefix}-btn-large i {
+	margin-top: 2px;
+}
+
+.@{prefix}-btn-small button {
+	padding: 1px 5px;
+	font-size: @font-size - 2px;
+	*padding-bottom: 2px;
+}
+
+.@{prefix}-btn-small i {
+	line-height: 20px;
+	vertical-align: top;
+	*line-height: 18px;
+}
+
+.@{prefix}-btn .@{prefix}-caret {
+	margin-top: 8px;
+	margin-left: 0;
+}
+
+.@{prefix}-btn-small .@{prefix}-caret {
+	margin-top: 8px;
+	margin-left: 0;
+}
+
+.@{prefix}-caret {
+	.inline-block();
+	width: 0; height: 0;
+	vertical-align: top;
+	border-top: 4px solid @btn-caret-border;
+	border-right: 4px solid transparent;
+	border-left: 4px solid transparent;
+	content: "";
+}
+
+.@{prefix}-disabled .@{prefix}-caret {
+	border-top-color: @text-disabled;
+}
+
+.@{prefix}-caret.@{prefix}-up {
+	border-bottom: 4px solid @btn-caret-border;
+	border-top: 0;
+}
+
+.@{prefix}-btn-flat {
+	border: 0;
+	background: transparent;
+	.border-radius(0);
+	.box-shadow(none);
+	filter: none;
+}
+
+.@{prefix}-btn-flat:hover, .@{prefix}-btn-flat.@{prefix}-active, .@{prefix}-btn-flat:focus, .@{prefix}-btn-flat:active {
+	border: 0;
+	background: @menubar-bg-active;
+	filter: none;
+	.box-shadow(none);
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-btn button {
+	direction: rtl;
+}
+// ButtonGroup
+
+.@{prefix}-btn-group .@{prefix}-btn {
+	border-width: 1px 0 1px 0;
+	margin: 0;
+	.border-radius(0);
+}
+
+.@{prefix}-btn-group .@{prefix}-first {
+	border-left: 1px solid mix(rgb(red(@btn-border-left), green(@btn-border-left), blue(@btn-border-left)), @panel-bg, 30%);
+	border-left: 1px solid @btn-border-left;
+	.border-radius(3px 0 0 3px);
+}
+
+.@{prefix}-btn-group .@{prefix}-last {
+	border-right: 1px solid mix(rgb(red(@btn-border-right), green(@btn-border-right), blue(@btn-border-right)), @panel-bg, 30%);
+	border-right: 1px solid @btn-border-right;
+	.border-radius(0 3px 3px 0);
+}
+
+.@{prefix}-btn-group .@{prefix}-first.@{prefix}-last {
+	.border-radius(3px);
+}
+
+.@{prefix}-btn-group .@{prefix}-btn.@{prefix}-flow-layout-item {
+	margin: 0;
+}
+// Checkbox
+
+.@{prefix}-checkbox {
+	cursor: pointer;
+}
+
+i.@{prefix}-i-checkbox {
+	margin: 0 3px 0 0;
+	border: 1px solid @checkbox-border;
+	.border-radius(3px);
+	.box-shadow(@checkbox-box-shadow);
+	.vertical-gradient(@checkbox-bg, @checkbox-bg-hlight);
+	text-indent: -10em;
+	*font-size: 0;
+	*line-height: 0;
+	*text-indent: 0;
+	overflow: hidden;
+}
+
+.@{prefix}-checked i.@{prefix}-i-checkbox {
+	color: @btn-text;
+	font-size: 16px;
+	line-height: 16px;
+	text-indent: 0;
+}
+
+.@{prefix}-checkbox:focus i.@{prefix}-i-checkbox, .@{prefix}-checkbox.@{prefix}-focus i.@{prefix}-i-checkbox {
+	border: 1px solid @checkbox-border-focus;
+	.box-shadow(inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px fadeout(@checkbox-border-focus, 15%));
+}
+
+.@{prefix}-checkbox.@{prefix}-disabled .@{prefix}-label, .@{prefix}-checkbox.@{prefix}-disabled i.@{prefix}-i-checkbox {
+	color: mix(@text, @panel-bg, 40%);
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-checkbox {
+	direction: rtl;
+	text-align: right;
+}
+
+.@{prefix}-rtl i.@{prefix}-i-checkbox {
+	margin: 0 0 0 3px;
+}
+// ComboBox
+
+.@{prefix}-combobox {
+	.inline-block();
+	.border-radius(3px);
+	.box-shadow(@textbox-box-shadow);
+	*height: 32px;
+}
+
+.@{prefix}-combobox input {
+	border: 1px solid @textbox-border;
+	border-right-color: @combobox-border;
+	height: 28px;
+}
+
+.@{prefix}-combobox.@{prefix}-disabled input {
+	color: mix(@text, @textbox-bg, 40%);
+}
+
+.@{prefix}-combobox.@{prefix}-has-open input {
+	.border-radius(4px 0 0 4px);
+}
+
+.@{prefix}-combobox .@{prefix}-btn {
+	border-left: 0;
+	.border-radius(0 4px 4px 0);
+}
+
+.@{prefix}-combobox button {
+	padding-right: 8px;
+	padding-left: 8px;
+}
+
+.@{prefix}-combobox.@{prefix}-disabled .@{prefix}-btn button {
+	cursor: default;
+	.box-shadow(none);
+	.opacity(@btn-box-disabled-opacity);
+}
+// ColorBox
+
+.@{prefix}-colorbox i {
+	border: 1px solid @textbox-border;
+	width: 14px; height: 14px;
+}
+// ColorButton
+
+.@{prefix}-colorbutton .@{prefix}-ico {
+	position: relative;
+}
+
+.@{prefix}-colorbutton-grid {
+	margin: 4px;	
+}
+
+.@{prefix}-colorbutton button {
+	padding-right: 4px;
+}
+
+.@{prefix}-colorbutton .@{prefix}-preview {
+	padding-right: 3px;
+	display: block;
+	position: absolute;
+	left: 50%;
+	top: 50%;
+	margin-left: -14px;
+	margin-top: 7px;
+	background: gray;
+	width: 13px;
+	height: 2px;
+	overflow: hidden;
+}
+
+.@{prefix}-colorbutton.@{prefix}-btn-small .@{prefix}-preview {
+	margin-left: -16px;
+	padding-right: 0;
+	width: 16px;
+}
+
+.@{prefix}-colorbutton .@{prefix}-open {
+	padding-left: 4px;
+	border-left: 1px solid transparent;
+	border-right: 1px solid transparent;
+}
+
+.@{prefix}-colorbutton:hover .@{prefix}-open {
+	border-left-color: @btn-split-border;
+	border-right-color: @btn-split-border;
+}
+
+.@{prefix}-colorbutton.@{prefix}-btn-small .@{prefix}-open {
+	padding: 0 3px 0 3px;
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-colorbutton {
+	direction: rtl;
+}
+
+.@{prefix}-rtl .@{prefix}-colorbutton .@{prefix}-preview {
+	margin-left: 0;
+	padding-right: 0;
+	padding-left: 4px;
+	margin-right: -14px;
+}
+
+.@{prefix}-rtl .@{prefix}-colorbutton.@{prefix}-btn-small .@{prefix}-preview {
+	margin-left: 0;
+	padding-right: 0;
+	margin-right: -17px;
+	padding-left: 0;
+}
+
+.@{prefix}-rtl .@{prefix}-colorbutton button {
+	padding-right: 10px;
+	padding-left: 10px;
+}
+
+.@{prefix}-rtl .@{prefix}-colorbutton .@{prefix}-open {
+	padding-left: 4px;
+	padding-right: 4px;
+}
+// ColorPicker
+
+.@{prefix}-colorpicker {
+	position: relative;
+	width: 250px;
+	height: 220px;
+}
+
+.@{prefix}-colorpicker-sv {
+	position: absolute;
+	top: 0; left: 0;
+	width: 90%;
+	height: 100%;
+	border: 1px solid @colorpicker-border;
+	cursor: crosshair;
+	overflow: hidden;
+}
+
+.@{prefix}-colorpicker-h-chunk {
+	width: 100%;
+}
+
+.@{prefix}-colorpicker-overlay1, .@{prefix}-colorpicker-overlay2 {
+	width: 100%;
+	height: 100%;
+	position: absolute;
+	top: 0;
+	left: 0;
+}
+
+.@{prefix}-colorpicker-overlay1 {
+	filter: progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff');
+	-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff')";
+	background: linear-gradient(to right, rgba(255,255,255,1), rgba(255,255,255,0));
+}
+
+.@{prefix}-colorpicker-overlay2 {
+	filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00000000', endColorstr='#000000');
+	-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00000000', endColorstr='#000000')";
+	background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,1));
+}
+
+.@{prefix}-colorpicker-selector1 {
+	background: none;
+	position: absolute;
+	width: 12px;
+	height: 12px;
+	margin: -8px 0 0 -8px;
+	border: 1px solid black;
+	border-radius: 50%;
+}
+
+.@{prefix}-colorpicker-selector2 {
+	position: absolute;
+	width: 10px;
+	height: 10px;
+	border: 1px solid white;
+	border-radius: 50%;
+}
+
+.@{prefix}-colorpicker-h {
+	position: absolute;
+	top: 0; right: 0;
+	width: 6.5%;
+	height: 100%;
+	border: 1px solid @colorpicker-border;
+	cursor: crosshair;
+}
+
+.@{prefix}-colorpicker-h-marker {
+	margin-top: -4px;
+	position: absolute;
+	top: 0;
+	left: -1px;
+	width: 100%;
+	border: 1px solid @colorpicker-hue-border;
+	background: @colorpicker-hue-bg;
+	height: 4px;
+	z-index: 100;
+}
+// Path
+
+.@{prefix}-path {
+	.inline-block();
+	padding: 8px;
+	white-space: normal;
+}
+
+.@{prefix}-path .@{prefix}-txt {
+	display: inline-block;
+	padding-right: 3px;
+}
+
+.@{prefix}-path .@{prefix}-path-body {
+	display: inline-block;
+}
+
+.@{prefix}-path-item {
+	.inline-block();
+	cursor: pointer;
+	color: @path-text;
+}
+
+.@{prefix}-path-item:hover {
+	text-decoration: underline;
+}
+
+.@{prefix}-path-item:focus {
+	background: @path-bg-focus;
+	color: @path-text-focus;
+}
+
+.@{prefix}-path .@{prefix}-divider {
+	display: inline;
+}
+
+.@{prefix}-disabled .@{prefix}-path-item {
+	color: @text-disabled;
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-path {
+	direction: rtl;
+}
+// FieldSet
+
+.@{prefix}-fieldset {
+	border: 0 solid #9E9E9E;
+	.border-radius(3px);
+}
+
+.@{prefix}-fieldset > .@{prefix}-container-body {
+	margin-top: -15px;
+}
+
+.@{prefix}-fieldset-title {
+	margin-left: 5px;
+	padding: 0 5px 0 5px;
+}// FitLayout
+
+.@{prefix}-fit-layout {
+	.inline-block();
+}
+
+.@{prefix}-fit-layout-item {
+	position: absolute;
+}
+// FlowLayout
+
+.@{prefix}-flow-layout-item {
+	.inline-block();
+}
+
+.@{prefix}-flow-layout-item {
+	margin: 2px 0 2px 2px;	
+}
+
+.@{prefix}-flow-layout-item.@{prefix}-last {
+	margin-right: 2px;
+}
+
+.@{prefix}-flow-layout {
+	white-space: normal;
+}
+
+.@{prefix}-tinymce-inline .@{prefix}-flow-layout {
+	white-space: nowrap;
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-flow-layout {
+	text-align: right;
+	direction: rtl;
+}
+
+.@{prefix}-rtl .@{prefix}-flow-layout-item {
+	margin: 2px 2px 2px 0;	
+}
+
+.@{prefix}-rtl .@{prefix}-flow-layout-item.@{prefix}-last {
+	margin-left: 2px;
+}
+// Iframe
+
+.@{prefix}-iframe {
+	border: 0 solid @iframe-border;
+	width: 100%; height: 100%;
+}
+// Label
+
+.@{prefix}-label {
+	.inline-block();
+	text-shadow: @text-shadow;
+	overflow: hidden;
+}
+
+.@{prefix}-label.@{prefix}-autoscroll {
+	overflow: auto;
+}
+
+.@{prefix}-label.@{prefix}-disabled {
+	color: @text-disabled;
+}
+
+.@{prefix}-label.@{prefix}-multiline {
+	white-space: pre-wrap;
+}
+
+.@{prefix}-label.@{prefix}-error {
+	color: @text-error;
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-label {
+	text-align: right;
+	direction: rtl;
+}
+/* MenuBar */
+
+.@{prefix}-menubar .@{prefix}-menubtn {
+	border-color: transparent;
+	background: transparent;
+	.border-radius(0);
+	.box-shadow(none);
+	filter: none;
+}
+
+.@{prefix}-menubar {
+	border: 1px solid @menubar-border;
+}
+
+.@{prefix}-menubar .@{prefix}-menubtn button span {
+	color: @text;
+}
+
+.@{prefix}-menubar .@{prefix}-caret {
+	border-top-color: @text;
+}
+
+.@{prefix}-menubar .@{prefix}-menubtn:hover, .@{prefix}-menubar .@{prefix}-menubtn.@{prefix}-active, .@{prefix}-menubar .@{prefix}-menubtn:focus {
+	border-color: transparent;
+	background: @menubar-bg-active;
+	filter: none;
+	.box-shadow(none);
+}
+/* MenuButton */
+
+.@{prefix}-menubtn span {
+	color: @btn-text;
+	margin-right: 2px;
+	line-height: @line-height;
+	*line-height: @line-height - 4px;
+}
+
+.@{prefix}-menubtn.@{prefix}-btn-small span {
+	font-size: @font-size - 2px;
+}
+
+.@{prefix}-menubtn.@{prefix}-fixed-width span {
+	display: inline-block;
+	overflow-x: hidden;
+	text-overflow: ellipsis;
+	width: 90px;
+}
+
+.@{prefix}-menubtn.@{prefix}-fixed-width.@{prefix}-btn-small span {
+	width: 70px;
+}
+
+.@{prefix}-menubtn .@{prefix}-caret {
+	*margin-top: 6px;
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-menubtn button {
+	direction: rtl;
+	text-align: right;
+}
+// ListBox
+
+.@{prefix}-listbox button {
+	text-align: left;
+	padding-right: 20px;
+	position: relative;
+}
+
+.@{prefix}-listbox .@{prefix}-caret {
+	position: absolute;
+	margin-top: -2px;
+	right: 8px;
+	top: 50%;
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-listbox .@{prefix}-caret {
+	right: auto;
+	left: 8px;
+}
+
+.@{prefix}-rtl .@{prefix}-listbox button {
+	padding-right: 10px;
+	padding-left: 20px;
+}
+// MenuItem
+
+.@{prefix}-menu-item {
+	display: block;
+	padding: 6px 15px 6px 12px;
+	clear: both;
+	font-weight: normal;
+	line-height: 20px;
+	color: @menuitem-text;
+	white-space: nowrap;
+	cursor: pointer;
+	line-height: normal;
+	border-left: 4px solid transparent;
+	margin-bottom: 1px;
+}
+
+.@{prefix}-menu-item .@{prefix}-ico, .@{prefix}-menu-item .@{prefix}-text {
+	color: @menuitem-text;
+}
+
+.@{prefix}-menu-item.@{prefix}-disabled .@{prefix}-text, .@{prefix}-menu-item.@{prefix}-disabled .@{prefix}-ico {
+	color: mix(@menuitem-text, @menu-bg, 40%);
+}
+
+.@{prefix}-menu-item:hover .@{prefix}-text, .@{prefix}-menu-item.@{prefix}-selected .@{prefix}-text, .@{prefix}-menu-item:focus .@{prefix}-text {
+	color: @menuitem-text-inverse;
+}
+
+.@{prefix}-menu-item:hover .@{prefix}-ico, .@{prefix}-menu-item.@{prefix}-selected .@{prefix}-ico, .@{prefix}-menu-item:focus .@{prefix}-ico {
+	color: @menuitem-text-inverse;
+}
+
+.@{prefix}-menu-item.@{prefix}-disabled:hover {
+	background: @menuitem-bg-disabled;
+}
+
+.@{prefix}-menu-shortcut {
+	display: inline-block;
+	color: mix(@menuitem-text, @menu-bg, 40%);
+}
+
+.@{prefix}-menu-shortcut {
+	.inline-block();
+	padding: 0 15px 0 20px;
+}
+
+.@{prefix}-menu-item:hover .@{prefix}-menu-shortcut, .@{prefix}-menu-item.@{prefix}-selected .@{prefix}-menu-shortcut, .@{prefix}-menu-item:focus .@{prefix}-menu-shortcut {
+	color: @menuitem-text-inverse;
+}
+
+.@{prefix}-menu-item .@{prefix}-caret {
+	margin-top: 4px;
+	*margin-top: 3px;
+	margin-right: 6px;
+	border-top: 4px solid transparent;
+	border-bottom: 4px solid transparent;
+	border-left: 4px solid @menuitem-caret;
+}
+
+.@{prefix}-menu-item.@{prefix}-selected .@{prefix}-caret, .@{prefix}-menu-item:focus .@{prefix}-caret, .@{prefix}-menu-item:hover .@{prefix}-caret {
+	border-left-color: @menuitem-caret-selected;
+}
+
+.@{prefix}-menu-align .@{prefix}-menu-shortcut {
+	*margin-top: -2px;
+}
+
+.@{prefix}-menu-align .@{prefix}-menu-shortcut, .@{prefix}-menu-align .@{prefix}-caret {
+	position: absolute;
+	right: 0;
+}
+
+.@{prefix}-menu-item.@{prefix}-active i {
+	visibility: visible;
+}
+
+.@{prefix}-menu-item-normal.@{prefix}-active {
+	background-color: @menuitem-bg-active;
+}
+
+.@{prefix}-menu-item-preview.@{prefix}-active {
+	border-left: 5px solid @menuitem-preview-border-active;
+}
+
+.@{prefix}-menu-item-normal.@{prefix}-active .@{prefix}-text {
+	color: @menuitem-text-active;
+}
+
+.@{prefix}-menu-item-normal.@{prefix}-active:hover .@{prefix}-text, .@{prefix}-menu-item-normal.@{prefix}-active:hover .@{prefix}-ico {
+	color: @menuitem-text-inverse;
+}
+
+.@{prefix}-menu-item-normal.@{prefix}-active:focus .@{prefix}-text, .@{prefix}-menu-item-normal.@{prefix}-active:focus .@{prefix}-ico {
+	color: @menuitem-text-inverse;
+}
+
+.@{prefix}-menu-item:hover, .@{prefix}-menu-item.@{prefix}-selected, .@{prefix}-menu-item:focus {
+	text-decoration: none;
+	color: @menuitem-text-inverse;
+	.vertical-gradient(@menuitem-bg-selected, @menuitem-bg-selected-hlight);
+}
+
+div.@{prefix}-menu .@{prefix}-menu-item-sep, .@{prefix}-menu-item-sep:hover {
+	border: 0;
+	padding: 0;
+	height: 1px;
+	margin: 9px 1px;
+	overflow: hidden;
+	background: @menuitem-separator-top;
+	border-bottom: 1px solid @menuitem-separator-bottom;
+	cursor: default;
+	filter: none;
+}
+
+// RTL
+
+.@{prefix}-menu.@{prefix}-rtl {
+	direction: rtl;
+}
+
+.@{prefix}-rtl .@{prefix}-menu-item {
+	text-align: right;
+	direction: rtl;
+	padding: 6px 12px 6px 15px;
+}
+
+.@{prefix}-menu-align.@{prefix}-rtl .@{prefix}-menu-shortcut, .@{prefix}-menu-align.@{prefix}-rtl .@{prefix}-caret {
+	right: auto;
+	left: 0;
+}
+
+.@{prefix}-rtl .@{prefix}-menu-item .@{prefix}-caret {
+	margin-left: 6px;
+	margin-right: 0;
+	border-right: 4px solid @menuitem-caret;
+	border-left: 0;
+}
+
+.@{prefix}-rtl .@{prefix}-menu-item.@{prefix}-selected .@{prefix}-caret, .@{prefix}-rtl .@{prefix}-menu-item:focus .@{prefix}-caret, .@{prefix}-rtl .@{prefix}-menu-item:hover .@{prefix}-caret {
+	border-left-color: transparent;
+	border-right-color: @menuitem-caret-selected;
+}
+// Menu
+
+.@{prefix}-menu {
+	position: absolute;
+	left: 0; top: 0;
+	.reset-gradient();
+	z-index: 1000;
+	padding: 5px 0 5px 0;
+	margin: 2px 0 0;
+	min-width: 160px;
+	background: @menu-bg;
+	border: 1px solid mix(rgb(red(@menu-border), green(@menu-border), blue(@menu-border)), @panel-bg, round(alpha(@menu-border) * 200));
+	border: 1px solid @menu-border;
+	z-index: 1002;
+	.border-radius(6px);
+	.box-shadow(0 5px 10px rgba(0,0,0,.2));
+	max-height: 400px;
+	overflow: auto;
+	overflow-x: hidden;
+}
+
+.@{prefix}-menu i {
+	display: none;
+}
+
+.@{prefix}-menu-has-icons i {
+	display: inline-block;
+	*display: inline;
+}
+
+.@{prefix}-menu-sub-tr-tl { margin: -6px 0 0 -1px; }
+.@{prefix}-menu-sub-br-bl { margin: 6px 0 0 -1px; }
+.@{prefix}-menu-sub-tl-tr { margin: -6px 0 0 1px; }
+.@{prefix}-menu-sub-bl-br { margin: 6px 0 0 1px; }
+// Radio - not implemented yet
+.@{prefix}-container-body .@{prefix}-resizehandle {
+	position: absolute;
+	right: 0;
+	bottom: 0;
+	width: 16px;
+	height: 16px;
+	visibility: visible;
+	cursor: s-resize;
+	margin: 0;
+}
+
+.@{prefix}-container-body .@{prefix}-resizehandle-both {
+	cursor: se-resize;
+}
+
+i.@{prefix}-i-resize {
+	color: @text;
+}
+// Spacer
+
+.@{prefix}-spacer {
+	visibility: hidden;
+}
+// SplitButton
+
+.@{prefix}-splitbtn .@{prefix}-open {
+	border-left: 1px solid transparent;
+	border-right: 1px solid transparent;
+}
+
+.@{prefix}-splitbtn:hover .@{prefix}-open {
+	border-left-color: @btn-split-border;
+	border-right-color: @btn-split-border;
+}
+
+.@{prefix}-splitbtn button {
+	padding-right: 4px;
+}
+
+.@{prefix}-splitbtn .@{prefix}-open {
+	padding-left: 4px;
+}
+
+.@{prefix}-splitbtn .@{prefix}-open.@{prefix}-active {
+	.box-shadow(inset 0 2px 4px rgba(0, 0, 0, .15), 0 1px 2px rgba(0, 0, 0 ,.05));
+}
+
+.@{prefix}-splitbtn.@{prefix}-btn-small .@{prefix}-open {
+	padding: 0 3px 0 3px;
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-splitbtn {
+	direction: rtl;
+	text-align: right;
+}
+
+.@{prefix}-rtl .@{prefix}-splitbtn button {
+	padding-right: 10px;
+	padding-left: 10px;
+}
+
+.@{prefix}-rtl .@{prefix}-splitbtn .@{prefix}-open {
+	padding-left: 4px;
+	padding-right: 4px;
+}
+// StackLayout 
+
+.@{prefix}-stack-layout-item {
+	display: block;
+}
+// TabPanel
+
+.@{prefix}-tabs {
+	display: block;
+	border-bottom: 1px solid @tab-border;
+}
+
+.@{prefix}-tab {
+	.inline-block();
+	border: 1px solid @tab-border;
+	border-width: 0 1px 0 0;
+	background: @tab-bg;
+	padding: 8px;
+	text-shadow: @text-shadow;
+	height: 13px;
+	cursor: pointer;
+}
+
+.@{prefix}-tab:hover {
+	background: @tab-bg-hover;
+}
+
+.@{prefix}-tab.@{prefix}-active {
+	background: @tab-bg-active;
+	border-bottom-color: transparent;
+	margin-bottom: -1px;
+	height: 14px;
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-tabs {
+	text-align: right;
+	direction: rtl;
+}
+
+.@{prefix}-rtl .@{prefix}-tab {
+	border-width: 0 0 0 1px;
+}
+// TextBox
+
+.@{prefix}-textbox {
+	background: @textbox-bg;
+	border: 1px solid @textbox-border;
+	.border-radius(3px);
+	.box-shadow(@textbox-box-shadow);
+	display: inline-block;
+	.transition(~"border linear .2s, box-shadow linear .2s");
+	height: 28px;
+	resize: none;
+	padding: 0 4px 0 4px;
+	white-space: pre-wrap;
+	*white-space: pre;
+	color: @text;
+}
+
+.@{prefix}-textbox:focus, .@{prefix}-textbox.@{prefix}-focus {
+	border-color: @textbox-border-focus;
+	.box-shadow(inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px fadeout(@textbox-border-focus, 15%));
+}
+
+.@{prefix}-placeholder .@{prefix}-textbox {
+	color: @textbox-text-placeholder;
+}
+
+.@{prefix}-textbox.@{prefix}-multiline {
+	padding: 4px;
+}
+
+.@{prefix}-textbox.@{prefix}-disabled {
+	color: mix(@text, @textbox-bg, 40%);
+}
+
+// RTL
+
+.@{prefix}-rtl .@{prefix}-textbox {
+	text-align: right;
+	direction: rtl;
+}
+// Throbber
+
+.@{prefix}-throbber {
+	position: absolute;
+	top: 0; left: 0;
+	width: 100%; height: 100%;
+	.opacity(0.6);
+	background: @throbber-bg;
+}
+
+.@{prefix}-throbber-inline {
+	position: static;
+	height: 50px;
+}
+/* Icons */
+
+@font-face {
+	font-family: 'tinymce';
+	src:url('fonts/tinymce.eot');
+	src:url('fonts/tinymce.eot?#iefix') format('embedded-opentype'),
+		url('fonts/tinymce.woff') format('woff'),
+		url('fonts/tinymce.ttf') format('truetype'),
+		url('fonts/tinymce.svg#tinymce') format('svg');
+	font-weight: normal;
+	font-style: normal;
+}
+
+@font-face {
+	font-family: 'tinymce-small';
+	src:url('fonts/tinymce-small.eot');
+	src:url('fonts/tinymce-small.eot?#iefix') format('embedded-opentype'),
+		url('fonts/tinymce-small.woff') format('woff'),
+		url('fonts/tinymce-small.ttf') format('truetype'),
+		url('fonts/tinymce-small.svg#tinymce') format('svg');
+	font-weight: normal;
+	font-style: normal;
+}
+
+@iconSize: 16px;
+
+.@{prefix}-ico {
+	font-family: 'tinymce', Arial;
+	font-style: normal;
+	font-weight: normal;
+	font-variant: normal;
+	font-size: @iconSize;
+	line-height: 16px;
+	speak: none;
+	vertical-align: text-top;
+	-webkit-font-smoothing: antialiased;
+	-moz-osx-font-smoothing: grayscale;
+
+	display: inline-block;
+	background: transparent center center;
+	background-size: cover;
+	width: 16px;
+	height: 16px;
+	color: @btn-text;
+}
+
+.@{prefix}-btn-small .@{prefix}-ico {
+	font-family: 'tinymce-small', Arial;
+}
+
+.@{prefix}-i-save:before           { content: "\e000"; }
+.@{prefix}-i-newdocument:before    { content: "\e001"; }
+.@{prefix}-i-fullpage:before       { content: "\e002"; }
+.@{prefix}-i-alignleft:before      { content: "\e003"; }
+.@{prefix}-i-aligncenter:before    { content: "\e004"; }
+.@{prefix}-i-alignright:before     { content: "\e005"; }
+.@{prefix}-i-alignjustify:before   { content: "\e006"; }
+.@{prefix}-i-cut:before            { content: "\e007"; }
+.@{prefix}-i-paste:before          { content: "\e008"; }
+.@{prefix}-i-searchreplace:before  { content: "\e009"; }
+.@{prefix}-i-bullist:before        { content: "\e00a"; }
+.@{prefix}-i-numlist:before        { content: "\e00b"; }
+.@{prefix}-i-indent:before         { content: "\e00c"; }
+.@{prefix}-i-outdent:before        { content: "\e00d"; }
+.@{prefix}-i-blockquote:before     { content: "\e00e"; }
+.@{prefix}-i-undo:before           { content: "\e00f"; }
+.@{prefix}-i-redo:before           { content: "\e010"; }
+.@{prefix}-i-link:before           { content: "\e011"; }
+.@{prefix}-i-unlink:before         { content: "\e012"; }
+.@{prefix}-i-anchor:before         { content: "\e013"; }
+.@{prefix}-i-image:before          { content: "\e014"; }
+.@{prefix}-i-media:before          { content: "\e015"; }
+.@{prefix}-i-help:before           { content: "\e016"; }
+.@{prefix}-i-code:before           { content: "\e017"; }
+.@{prefix}-i-insertdatetime:before { content: "\e018"; }
+.@{prefix}-i-preview:before        { content: "\e019"; }
+.@{prefix}-i-forecolor:before      { content: "\e01a"; }
+.@{prefix}-i-backcolor:before      { content: "\e01a"; }
+.@{prefix}-i-table:before          { content: "\e01b"; }
+.@{prefix}-i-hr:before             { content: "\e01c"; }
+.@{prefix}-i-removeformat:before   { content: "\e01d"; }
+.@{prefix}-i-subscript:before      { content: "\e01e"; }
+.@{prefix}-i-superscript:before    { content: "\e01f"; }
+.@{prefix}-i-charmap:before        { content: "\e020"; }
+.@{prefix}-i-emoticons:before      { content: "\e021"; }
+.@{prefix}-i-print:before          { content: "\e022"; }
+.@{prefix}-i-fullscreen:before     { content: "\e023"; }
+.@{prefix}-i-spellchecker:before   { content: "\e024"; }
+.@{prefix}-i-nonbreaking:before    { content: "\e025"; }
+.@{prefix}-i-template:before       { content: "\e026"; }
+.@{prefix}-i-pagebreak:before      { content: "\e027"; }
+.@{prefix}-i-restoredraft:before   { content: "\e028"; }
+.@{prefix}-i-untitled:before       { content: "\e029"; }
+.@{prefix}-i-bold:before           { content: "\e02a"; }
+.@{prefix}-i-italic:before         { content: "\e02b"; }
+.@{prefix}-i-underline:before      { content: "\e02c"; }
+.@{prefix}-i-strikethrough:before  { content: "\e02d"; }
+.@{prefix}-i-visualchars:before    { content: "\e02e"; }
+.@{prefix}-i-visualblocks:before   { content: "\e02e"; }
+.@{prefix}-i-ltr:before            { content: "\e02f"; }
+.@{prefix}-i-rtl:before            { content: "\e030"; }
+.@{prefix}-i-copy:before           { content: "\e031"; }
+.@{prefix}-i-resize:before         { content: "\e032"; }
+.@{prefix}-i-browse:before         { content: "\e034"; }
+.@{prefix}-i-pastetext:before      { content: "\e035"; }
+
+.@{prefix}-i-checkbox:before, .@{prefix}-i-selected:before {
+	content: "\e033";
+}
+
+.@{prefix}-i-selected              { visibility: hidden; }
+i.@{prefix}-i-backcolor            { text-shadow: none; background: @colorbtn-backcolor-bg; }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/skin.min.css	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+.mce-container,.mce-container *,.mce-widget,.mce-widget *,.mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:0 0;text-decoration:none;color:#333;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;font-weight:400;text-align:left;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-widget button{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.mce-container [unselectable]{-moz-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none}.mce-fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.mce-fade.mce-in{opacity:1}.mce-tinymce{visibility:inherit!important;position:relative}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;height:100%;z-index:100}div.mce-fullscreen{position:fixed;top:0;left:0;width:100%;height:auto}.mce-tinymce{display:block;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.mce-wordcount{position:absolute;top:0;right:0;padding:8px}div.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 #9e9e9e;width:20px;height:20px;line-height:20px;text-align:center;vertical-align:middle;padding:2px}.mce-charmap td div{text-align:center}.mce-charmap td:hover{background:#d9d9d9}.mce-grid td.mce-grid-cell div{border:1px solid #d6d6d6;width:15px;height:15px;margin:0;cursor:pointer}.mce-grid td.mce-grid-cell div:focus{border-color:#a1a1a1}.mce-grid td.mce-grid-cell div[disabled]{cursor:not-allowed}.mce-grid{border-spacing:2px;border-collapse:separate}.mce-grid a{display:block;border:1px solid transparent}.mce-grid a:hover,.mce-grid a:focus{border-color:#a1a1a1}.mce-grid-border{margin:0 4px 0 4px}.mce-grid-border a{border-color:#d6d6d6;width:13px;height:13px}.mce-grid-border a:hover,.mce-grid-border a.mce-active{border-color:#a1a1a1;background:#c8def4}.mce-text-center{text-align:center}div.mce-tinymce-inline{width:100%;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-colorbtn-trans div{text-align:center;vertical-align:middle;font-weight:700;font-size:20px;line-height:16px;color:#707070}.mce-toolbar-grp{padding-bottom:2px}.mce-toolbar-grp .mce-flow-layout-item{margin-bottom:0}.mce-rtl .mce-wordcount{left:0;right:auto}.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,.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:0 5px 10px rgba(0,0,0,.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2)}.mce-floatpanel.mce-fixed{position:fixed}.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{filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background:0 0;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);top:0;left:0;background:#fff;border:1px solid #9e9e9e;border:1px solid rgba(0,0,0,.25)}.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:#9e9e9e;border-bottom-color:rgba(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,.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,.3);box-shadow:0 3px 7px rgba(0,0,0,.3);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background:0 0;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 #c5c5c5;position:relative}.mce-window-head .mce-close{position:absolute;right:15px;top:9px;font-size:20px;font-weight:700;line-height:20px;color:#858585;cursor:pointer;height:20px;overflow:hidden}.mce-close:hover{color:#adadad}.mce-window-head .mce-title{line-height:20px;font-size:20px;font-weight:700;text-rendering:optimizelegibility;padding-right:10px}.mce-window .mce-container-body{display:block}.mce-foot{display:block;background-color:#fff;border-top:1px solid #c5c5c5;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.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-rtl .mce-window-head .mce-close{position:absolute;right:auto;left:15px}.mce-rtl .mce-window-head .mce-dragh{left:auto;right:0}.mce-rtl .mce-window-head .mce-title{direction:rtl;text-align:right}.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-nw,.mce-tooltip-sw{margin-left:-14px}.mce-tooltip-n .mce-tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-nw .mce-tooltip-arrow{top:0;left:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-ne .mce-tooltip-arrow{top:0;right:10px;border-bottom-style:solid;border-top:none;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:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-sw .mce-tooltip-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-se .mce-tooltip-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:none;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:none;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 #b1b1b1;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25) rgba(0,0,0,.25);position:relative;text-shadow:0 1px 1px rgba(255,255,255,.75);display:inline-block;;;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);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}.mce-btn:hover,.mce-btn:focus{color:#333;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}.mce-btn.mce-disabled button,.mce-btn.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-btn.mce-active,.mce-btn.mce-active:hover{background-color:#d6d6d6;background-image:-moz-linear-gradient(top,#e6e6e6,silver);background-image:-webkit-gradient(linear,0 0,0 100%,from(#e6e6e6),to(silver));background-image:-webkit-linear-gradient(top,#e6e6e6,silver);background-image:-o-linear-gradient(top,#e6e6e6,silver);background-image:linear-gradient(to bottom,#e6e6e6,silver);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05)}.mce-btn:active{background-color:#d6d6d6;background-image:-moz-linear-gradient(top,#e6e6e6,silver);background-image:-webkit-gradient(linear,0 0,0 100%,from(#e6e6e6),to(silver));background-image:-webkit-linear-gradient(top,#e6e6e6,silver);background-image:-o-linear-gradient(top,#e6e6e6,silver);background-image:linear-gradient(to bottom,#e6e6e6,silver);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05)}.mce-btn button{padding:4px 10px;font-size:14px;line-height:20px;;cursor:pointer;color:#333;text-align:center;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{min-width:50px;color:#fff;border:1px solid #b1b1b1;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25) rgba(0,0,0,.25);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}.mce-primary:hover,.mce-primary:focus{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}.mce-primary.mce-disabled button,.mce-primary.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-primary.mce-active,.mce-primary.mce-active:hover,.mce-primary:not(.mce-disabled):active{background-color:#005299;background-image:-moz-linear-gradient(top,#069,#039);background-image:-webkit-gradient(linear,0 0,0 100%,from(#069),to(#039));background-image:-webkit-linear-gradient(top,#069,#039);background-image:-o-linear-gradient(top,#069,#039);background-image:linear-gradient(to bottom,#069,#039);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff006699', endColorstr='#ff003399', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05)}.mce-primary button,.mce-primary button i{color:#fff;text-shadow:1px 1px #333}.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:1px 5px;font-size:12px;}.mce-btn-small i{line-height:20px;vertical-align:top;}.mce-btn .mce-caret{margin-top:8px;margin-left:0}.mce-btn-small .mce-caret{margin-top:8px;margin-left:0}.mce-caret{display:inline-block;;;width:0;height:0;vertical-align:top;border-top:4px solid #333;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.mce-disabled .mce-caret{border-top-color:#aaa}.mce-caret.mce-up{border-bottom:4px solid #333;border-top:0}.mce-btn-flat{border:0;background:0 0;-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-btn-flat:hover,.mce-btn-flat.mce-active,.mce-btn-flat:focus,.mce-btn-flat:active{border:0;background:#e6e6e6;filter:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-rtl .mce-btn button{direction:rtl}.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-first{border-left:1px solid #b1b1b1;border-left:1px solid rgba(0,0,0,.25);-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 #b1b1b1;border-right:1px solid rgba(0,0,0,.1);-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,.2),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);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;text-indent:-10em;;;;overflow:hidden}.mce-checked i.mce-i-checkbox{color:#333;font-size:16px;line-height:16px;text-indent:0}.mce-checkbox:focus i.mce-i-checkbox,.mce-checkbox.mce-focus i.mce-i-checkbox{border:1px solid rgba(82,168,236,.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.65);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.65);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.65)}.mce-checkbox.mce-disabled .mce-label,.mce-checkbox.mce-disabled i.mce-i-checkbox{color:#acacac}.mce-rtl .mce-checkbox{direction:rtl;text-align:right}.mce-rtl i.mce-i-checkbox{margin:0 0 0 3px}.mce-combobox{display:inline-block;;;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);}.mce-combobox input{border:1px solid #c5c5c5;border-right-color:#c5c5c5;height:28px}.mce-combobox.mce-disabled input{color:#adadad}.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.mce-disabled .mce-btn button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-colorbox i{border:1px solid #c5c5c5;width:14px;height:14px}.mce-colorbutton .mce-ico{position:relative}.mce-colorbutton-grid{margin:4px}.mce-colorbutton button{padding-right:4px}.mce-colorbutton .mce-preview{padding-right:3px;display:block;position:absolute;left:50%;top:50%;margin-left:-14px;margin-top:7px;background:gray;width:13px;height:2px;overflow:hidden}.mce-colorbutton.mce-btn-small .mce-preview{margin-left:-16px;padding-right:0;width:16px}.mce-colorbutton .mce-open{padding-left:4px;border-left:1px solid transparent;border-right:1px solid transparent}.mce-colorbutton:hover .mce-open{border-left-color:#bdbdbd;border-right-color:#bdbdbd}.mce-colorbutton.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-colorbutton{direction:rtl}.mce-rtl .mce-colorbutton .mce-preview{margin-left:0;padding-right:0;padding-left:4px;margin-right:-14px}.mce-rtl .mce-colorbutton.mce-btn-small .mce-preview{margin-left:0;padding-right:0;margin-right:-17px;padding-left:0}.mce-rtl .mce-colorbutton button{padding-right:10px;padding-left:10px}.mce-rtl .mce-colorbutton .mce-open{padding-left:4px;padding-right:4px}.mce-colorpicker{position:relative;width:250px;height:220px}.mce-colorpicker-sv{position:absolute;top:0;left:0;width:90%;height:100%;border:1px solid #c5c5c5;cursor:crosshair;overflow:hidden}.mce-colorpicker-h-chunk{width:100%}.mce-colorpicker-overlay1,.mce-colorpicker-overlay2{width:100%;height:100%;position:absolute;top:0;left:0}.mce-colorpicker-overlay1{filter:progid:DXImageTransform.Microsoft.gradient(GradientType=1, startColorstr='#ffffff', endColorstr='#00ffffff');-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff')";background:linear-gradient(to right,#fff,rgba(255,255,255,0))}.mce-colorpicker-overlay2{filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#00000000', endColorstr='#000000');-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00000000', endColorstr='#000000')";background:linear-gradient(to bottom,rgba(0,0,0,0),#000)}.mce-colorpicker-selector1{background:0 0;position:absolute;width:12px;height:12px;margin:-8px 0 0 -8px;border:1px solid #000;border-radius:50%}.mce-colorpicker-selector2{position:absolute;width:10px;height:10px;border:1px solid #fff;border-radius:50%}.mce-colorpicker-h{position:absolute;top:0;right:0;width:6.5%;height:100%;border:1px solid #c5c5c5;cursor:crosshair}.mce-colorpicker-h-marker{margin-top:-4px;position:absolute;top:0;left:-1px;width:100%;border:1px solid #333;background:#fff;height:4px;z-index:100}.mce-path{display:inline-block;;;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;;;cursor:pointer;color:#333}.mce-path-item:hover{text-decoration:underline}.mce-path-item:focus{background:#666;color:#fff}.mce-path .mce-divider{display:inline}.mce-disabled .mce-path-item{color:#aaa}.mce-rtl .mce-path{direction:rtl}.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;;}.mce-fit-layout-item{position:absolute}.mce-flow-layout-item{display:inline-block;;}.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-tinymce-inline .mce-flow-layout{white-space:nowrap}.mce-rtl .mce-flow-layout{text-align:right;direction:rtl}.mce-rtl .mce-flow-layout-item{margin:2px 2px 2px 0}.mce-rtl .mce-flow-layout-item.mce-last{margin-left:2px}.mce-iframe{border:0 solid #9e9e9e;width:100%;height:100%}.mce-label{display:inline-block;;;text-shadow:0 1px 1px rgba(255,255,255,.75);overflow:hidden}.mce-label.mce-autoscroll{overflow:auto}.mce-label.mce-disabled{color:#aaa}.mce-label.mce-multiline{white-space:pre-wrap}.mce-label.mce-error{color:#a00}.mce-rtl .mce-label{text-align:right;direction:rtl}.mce-menubar .mce-menubtn{border-color:transparent;background:0 0;-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 #c4c4c4}.mce-menubar .mce-menubtn button span{color:#333}.mce-menubar .mce-caret{border-top-color:#333}.mce-menubar .mce-menubtn:hover,.mce-menubar .mce-menubtn.mce-active,.mce-menubar .mce-menubtn:focus{border-color:transparent;background:#e6e6e6;filter:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-menubtn span{color:#333;margin-right:2px;line-height:20px;}.mce-menubtn.mce-btn-small span{font-size:12px}.mce-menubtn.mce-fixed-width span{display:inline-block;overflow-x:hidden;text-overflow:ellipsis;width:90px}.mce-menubtn.mce-fixed-width.mce-btn-small span{width:70px}.mce-rtl .mce-menubtn button{direction:rtl;text-align:right}.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-rtl .mce-listbox .mce-caret{right:auto;left:8px}.mce-rtl .mce-listbox button{padding-right:10px;padding-left:20px}.mce-menu-item{display:block;padding:6px 15px 6px 12px;clear:both;font-weight:400;line-height:20px;color:#333;white-space:nowrap;cursor:pointer;line-height:normal;border-left:4px solid transparent;margin-bottom:1px}.mce-menu-item .mce-ico,.mce-menu-item .mce-text{color:#333}.mce-menu-item.mce-disabled .mce-text,.mce-menu-item.mce-disabled .mce-ico{color:#adadad}.mce-menu-item:hover .mce-text,.mce-menu-item.mce-selected .mce-text,.mce-menu-item:focus .mce-text{color:#fff}.mce-menu-item:hover .mce-ico,.mce-menu-item.mce-selected .mce-ico,.mce-menu-item:focus .mce-ico{color:#fff}.mce-menu-item.mce-disabled:hover{background:#ccc}.mce-menu-shortcut{display:inline-block;color:#adadad}.mce-menu-shortcut{display:inline-block;;;padding:0 15px 0 20px}.mce-menu-item:hover .mce-menu-shortcut,.mce-menu-item.mce-selected .mce-menu-shortcut,.mce-menu-item:focus .mce-menu-shortcut{color:#fff}.mce-menu-item .mce-caret{margin-top:4px;;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid #333}.mce-menu-item.mce-selected .mce-caret,.mce-menu-item:focus .mce-caret,.mce-menu-item:hover .mce-caret{border-left-color:#fff}.mce-menu-align .mce-menu-shortcut,.mce-menu-align .mce-caret{position:absolute;right:0}.mce-menu-item.mce-active i{visibility:visible}.mce-menu-item-normal.mce-active{background-color:#c8def4}.mce-menu-item-preview.mce-active{border-left:5px solid #aaa}.mce-menu-item-normal.mce-active .mce-text{color:#333}.mce-menu-item-normal.mce-active:hover .mce-text,.mce-menu-item-normal.mce-active:hover .mce-ico{color:#fff}.mce-menu-item-normal.mce-active:focus .mce-text,.mce-menu-item-normal.mce-active:focus .mce-ico{color:#fff}.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}div.mce-menu .mce-menu-item-sep,.mce-menu-item-sep:hover{border:0;padding:0;height:1px;margin:9px 1px;overflow:hidden;background:#cbcbcb;border-bottom:1px solid #fff;cursor:default;filter:none}.mce-menu.mce-rtl{direction:rtl}.mce-rtl .mce-menu-item{text-align:right;direction:rtl;padding:6px 12px 6px 15px}.mce-menu-align.mce-rtl .mce-menu-shortcut,.mce-menu-align.mce-rtl .mce-caret{right:auto;left:0}.mce-rtl .mce-menu-item .mce-caret{margin-left:6px;margin-right:0;border-right:4px solid #333;border-left:0}.mce-rtl .mce-menu-item.mce-selected .mce-caret,.mce-rtl .mce-menu-item:focus .mce-caret,.mce-rtl .mce-menu-item:hover .mce-caret{border-left-color:transparent;border-right-color:#fff}.mce-menu{position:absolute;left:0;top:0;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background:0 0;z-index:1000;padding:5px 0 5px 0;margin:2px 0 0;min-width:160px;background:#fff;border:1px solid #989898;border:1px solid rgba(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,.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);max-height:400px;overflow:auto;overflow-x:hidden}.mce-menu i{display:none}.mce-menu-has-icons i{display:inline-block;}.mce-menu-sub-tr-tl{margin:-6px 0 0 -1px}.mce-menu-sub-br-bl{margin:6px 0 0 -1px}.mce-menu-sub-tl-tr{margin:-6px 0 0 1px}.mce-menu-sub-bl-br{margin:6px 0 0 1px}.mce-container-body .mce-resizehandle{position:absolute;right:0;bottom:0;width:16px;height:16px;visibility:visible;cursor:s-resize;margin:0}.mce-container-body .mce-resizehandle-both{cursor:se-resize}i.mce-i-resize{color:#333}.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:#bdbdbd;border-right-color:#bdbdbd}.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,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05)}.mce-splitbtn.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-splitbtn{direction:rtl;text-align:right}.mce-rtl .mce-splitbtn button{padding-right:10px;padding-left:10px}.mce-rtl .mce-splitbtn .mce-open{padding-left:4px;padding-right:4px}.mce-stack-layout-item{display:block}.mce-tabs{display:block;border-bottom:1px solid #c5c5c5}.mce-tab{display:inline-block;;;border:1px solid #c5c5c5;border-width:0 1px 0 0;background:#e3e3e3;padding:8px;text-shadow:0 1px 1px rgba(255,255,255,.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-rtl .mce-tabs{text-align:right;direction:rtl}.mce-rtl .mce-tab{border-width:0 0 0 1px}.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,.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(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:pre-wrap;;color:#333}.mce-textbox:focus,.mce-textbox.mce-focus{border-color:rgba(82,168,236,.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.65);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.65);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.65)}.mce-placeholder .mce-textbox{color:#aaa}.mce-textbox.mce-multiline{padding:4px}.mce-textbox.mce-disabled{color:#adadad}.mce-rtl .mce-textbox{text-align:right;direction:rtl}.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}.mce-throbber-inline{position:static;height:50px}@font-face{font-family:tinymce;src:url(fonts/tinymce.eot);src:url(fonts/tinymce.eot?#iefix) format('embedded-opentype'),url(fonts/tinymce.woff) format('woff'),url(fonts/tinymce.ttf) format('truetype'),url(fonts/tinymce.svg#tinymce) format('svg');font-weight:400;font-style:normal}@font-face{font-family:tinymce-small;src:url(fonts/tinymce-small.eot);src:url(fonts/tinymce-small.eot?#iefix) format('embedded-opentype'),url(fonts/tinymce-small.woff) format('woff'),url(fonts/tinymce-small.ttf) format('truetype'),url(fonts/tinymce-small.svg#tinymce) format('svg');font-weight:400;font-style:normal}.mce-ico{font-family:tinymce,Arial;font-style:normal;font-weight:400;font-variant:normal;font-size:16px;line-height:16px;speak:none;vertical-align:text-top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;background:transparent center center;background-size:cover;width:16px;height:16px;color:#333}.mce-btn-small .mce-ico{font-family:tinymce-small,Arial}.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-insertdatetime: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-visualblocks: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-pastetext:before{content:"\e035"}.mce-i-checkbox:before,.mce-i-selected:before{content:"\e033"}.mce-i-selected{visibility:hidden}i.mce-i-backcolor{text-shadow:none;background:#bbb}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/skins/lightgray/skin.modern.dev.less	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,39 @@
+@import "Variables.less";
+@import "Reset.less";
+@import "Mixins.less";
+@import "Animations.less";
+@import "TinyMCE.less";
+@import "Container.less";
+@import "Scrollable.less";
+@import "Panel.less";
+@import "FloatPanel.less";
+@import "Window.less";
+@import "AbsoluteLayout.less";
+@import "ToolTip.less";
+@import "Button.less";
+@import "ButtonGroup.less";
+@import "Checkbox.less";
+@import "ComboBox.less";
+@import "ColorBox.less";
+@import "ColorButton.less";
+@import "ColorPicker.less";
+@import "Path.less";
+@import "FieldSet.less";
+@import "FitLayout.less";
+@import "FlowLayout.less";
+@import "Iframe.less";
+@import "Label.less";
+@import "MenuBar.less";
+@import "MenuButton.less";
+@import "ListBox.less";
+@import "MenuItem.less";
+@import "Menu.less";
+@import "Radio.less";
+@import "ResizeHandle.less";
+@import "Spacer.less";
+@import "SplitButton.less";
+@import "StackLayout.less";
+@import "TabPanel.less";
+@import "TextBox.less";
+@import "Throbber.less";
+@import "Icons.less";
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/themes/modern/theme.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,617 @@
+/**
+ * theme.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.ThemeManager.add('modern', function(editor) {
+	var self = this, settings = editor.settings, Factory = tinymce.ui.Factory, each = tinymce.each, DOM = tinymce.DOM;
+
+	// Default menus
+	var defaultMenus = {
+		file: {title: 'File', items: 'newdocument'},
+		edit: {title: 'Edit', items: 'undo redo | cut copy paste pastetext | 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'}
+	};
+
+	var defaultToolbar = "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | " +
+		"bullist numlist outdent indent | link image";
+
+	/**
+	 * Creates the toolbars from config and returns a toolbar array.
+	 *
+	 * @return {Array} Array with toolbars.
+	 */
+	function createToolbars() {
+		var toolbars = [];
+
+		function addToolbar(items) {
+			var toolbarItems = [], buttonGroup;
+
+			if (!items) {
+				return;
+			}
+
+			each(items.split(/[ ,]/), function(item) {
+				var itemName;
+
+				function bindSelectorChanged() {
+					var selection = editor.selection;
+
+					if (itemName == "bullist") {
+						selection.selectorChanged('ul > li', function(state, args) {
+							var nodeName, i = args.parents.length;
+
+							while (i--) {
+								nodeName = args.parents[i].nodeName;
+								if (nodeName == "OL" || nodeName == "UL") {
+									break;
+								}
+							}
+
+							item.active(state && nodeName == "UL");
+						});
+					}
+
+					if (itemName == "numlist") {
+						selection.selectorChanged('ol > li', function(state, args) {
+							var nodeName, i = args.parents.length;
+
+							while (i--) {
+								nodeName = args.parents[i].nodeName;
+								if (nodeName == "OL" || nodeName == "UL") {
+									break;
+								}
+							}
+
+							item.active(state && nodeName == "OL");
+						});
+					}
+
+					if (item.settings.stateSelector) {
+						selection.selectorChanged(item.settings.stateSelector, function(state) {
+							item.active(state);
+						}, true);
+					}
+
+					if (item.settings.disabledStateSelector) {
+						selection.selectorChanged(item.settings.disabledStateSelector, function(state) {
+							item.disabled(state);
+						});
+					}
+				}
+
+				if (item == "|") {
+					buttonGroup = null;
+				} else {
+					if (Factory.has(item)) {
+						item = {type: item};
+
+						if (settings.toolbar_items_size) {
+							item.size = settings.toolbar_items_size;
+						}
+
+						toolbarItems.push(item);
+						buttonGroup = null;
+					} else {
+						if (!buttonGroup) {
+							buttonGroup = {type: 'buttongroup', items: []};
+							toolbarItems.push(buttonGroup);
+						}
+
+						if (editor.buttons[item]) {
+							// TODO: Move control creation to some UI class
+							itemName = item;
+							item = editor.buttons[itemName];
+
+							if (typeof item == "function") {
+								item = item();
+							}
+
+							item.type = item.type || 'button';
+
+							if (settings.toolbar_items_size) {
+								item.size = settings.toolbar_items_size;
+							}
+
+							item = Factory.create(item);
+							buttonGroup.items.push(item);
+
+							if (editor.initialized) {
+								bindSelectorChanged();
+							} else {
+								editor.on('init', bindSelectorChanged);
+							}
+						}
+					}
+				}
+			});
+
+			toolbars.push({type: 'toolbar', layout: 'flow', items: toolbarItems});
+
+			return true;
+		}
+
+		// Convert toolbar array to multiple options
+		if (tinymce.isArray(settings.toolbar)) {
+			// Empty toolbar array is the same as a disabled toolbar
+			if (settings.toolbar.length === 0) {
+				return;
+			}
+
+			tinymce.each(settings.toolbar, function(toolbar, i) {
+				settings["toolbar" + (i + 1)] = toolbar;
+			});
+
+			delete settings.toolbar;
+		}
+
+		// Generate toolbar<n>
+		for (var i = 1; i < 10; i++) {
+			if (!addToolbar(settings["toolbar" + i])) {
+				break;
+			}
+		}
+
+		// Generate toolbar or default toolbar unless it's disabled
+		if (!toolbars.length && settings.toolbar !== false) {
+			addToolbar(settings.toolbar || defaultToolbar);
+		}
+
+		if (toolbars.length) {
+			return {
+				type: 'panel',
+				layout: 'stack',
+				classes: "toolbar-grp",
+				ariaRoot: true,
+				ariaRemember: true,
+				items: toolbars
+			};
+		}
+	}
+
+	/**
+	 * Creates the menu buttons based on config.
+	 *
+	 * @return {Array} Menu buttons array.
+	 */
+	function createMenuButtons() {
+		var name, menuButtons = [];
+
+		function createMenuItem(name) {
+			var menuItem;
+
+			if (name == '|') {
+				return {text: '|'};
+			}
+
+			menuItem = editor.menuItems[name];
+
+			return menuItem;
+		}
+
+		function createMenu(context) {
+			var menuButton, menu, menuItems, isUserDefined, removedMenuItems;
+
+			removedMenuItems = tinymce.makeMap((settings.removed_menuitems || '').split(/[ ,]/));
+
+			// User defined menu
+			if (settings.menu) {
+				menu = settings.menu[context];
+				isUserDefined = true;
+			} else {
+				menu = defaultMenus[context];
+			}
+
+			if (menu) {
+				menuButton = {text: menu.title};
+				menuItems = [];
+
+				// Default/user defined items
+				each((menu.items || '').split(/[ ,]/), function(item) {
+					var menuItem = createMenuItem(item);
+
+					if (menuItem && !removedMenuItems[item]) {
+						menuItems.push(createMenuItem(item));
+					}
+				});
+
+				// Added though context
+				if (!isUserDefined) {
+					each(editor.menuItems, function(menuItem) {
+						if (menuItem.context == context) {
+							if (menuItem.separator == 'before') {
+								menuItems.push({text: '|'});
+							}
+
+							if (menuItem.prependToContext) {
+								menuItems.unshift(menuItem);
+							} else {
+								menuItems.push(menuItem);
+							}
+
+							if (menuItem.separator == 'after') {
+								menuItems.push({text: '|'});
+							}
+						}
+					});
+				}
+
+				for (var i = 0; i < menuItems.length; i++) {
+					if (menuItems[i].text == '|') {
+						if (i === 0 || i == menuItems.length - 1) {
+							menuItems.splice(i, 1);
+						}
+					}
+				}
+
+				menuButton.menu = menuItems;
+
+				if (!menuButton.menu.length) {
+					return null;
+				}
+			}
+
+			return menuButton;
+		}
+
+		var defaultMenuBar = [];
+		if (settings.menu) {
+			for (name in settings.menu) {
+				defaultMenuBar.push(name);
+			}
+		} else {
+			for (name in defaultMenus) {
+				defaultMenuBar.push(name);
+			}
+		}
+
+		var enabledMenuNames = typeof settings.menubar == "string" ? settings.menubar.split(/[ ,]/) : defaultMenuBar;
+		for (var i = 0; i < enabledMenuNames.length; i++) {
+			var menu = enabledMenuNames[i];
+			menu = createMenu(menu);
+
+			if (menu) {
+				menuButtons.push(menu);
+			}
+		}
+
+		return menuButtons;
+	}
+
+	/**
+	 * Adds accessibility shortcut keys to panel.
+	 *
+	 * @param {tinymce.ui.Panel} panel Panel to add focus to.
+	 */
+	function addAccessibilityKeys(panel) {
+		function focus(type) {
+			var item = panel.find(type)[0];
+
+			if (item) {
+				item.focus(true);
+			}
+		}
+
+		editor.shortcuts.add('Alt+F9', '', function() {
+			focus('menubar');
+		});
+
+		editor.shortcuts.add('Alt+F10', '', function() {
+			focus('toolbar');
+		});
+
+		editor.shortcuts.add('Alt+F11', '', function() {
+			focus('elementpath');
+		});
+
+		panel.on('cancel', function() {
+			editor.focus();
+		});
+	}
+
+	/**
+	 * Resizes the editor to the specified width, height.
+	 */
+	function resizeTo(width, height) {
+		var containerElm, iframeElm, containerSize, iframeSize;
+
+		function getSize(elm) {
+			return {
+				width: elm.clientWidth,
+				height: elm.clientHeight
+			};
+		}
+
+		containerElm = editor.getContainer();
+		iframeElm = editor.getContentAreaContainer().firstChild;
+		containerSize = getSize(containerElm);
+		iframeSize = getSize(iframeElm);
+
+		if (width !== null) {
+			width = Math.max(settings.min_width || 100, width);
+			width = Math.min(settings.max_width || 0xFFFF, width);
+
+			DOM.setStyle(containerElm, 'width', width + (containerSize.width - iframeSize.width));
+			DOM.setStyle(iframeElm, 'width', width);
+		}
+
+		height = Math.max(settings.min_height || 100, height);
+		height = Math.min(settings.max_height || 0xFFFF, height);
+		DOM.setStyle(iframeElm, 'height', height);
+
+		editor.fire('ResizeEditor');
+	}
+
+	function resizeBy(dw, dh) {
+		var elm = editor.getContentAreaContainer();
+		self.resizeTo(elm.clientWidth + dw, elm.clientHeight + dh);
+	}
+
+	/**
+	 * Renders the inline editor UI.
+	 *
+	 * @return {Object} Name/value object with theme data.
+	 */
+	function renderInlineUI(args) {
+		var panel, inlineToolbarContainer;
+
+		if (settings.fixed_toolbar_container) {
+			inlineToolbarContainer = DOM.select(settings.fixed_toolbar_container)[0];
+		}
+
+		function reposition() {
+			if (panel && panel.moveRel && panel.visible() && !panel._fixed) {
+				// TODO: This is kind of ugly and doesn't handle multiple scrollable elements
+				var scrollContainer = editor.selection.getScrollContainer(), body = editor.getBody();
+				var deltaX = 0, deltaY = 0;
+
+				if (scrollContainer) {
+					var bodyPos = DOM.getPos(body), scrollContainerPos = DOM.getPos(scrollContainer);
+
+					deltaX = Math.max(0, scrollContainerPos.x - bodyPos.x);
+					deltaY = Math.max(0, scrollContainerPos.y - bodyPos.y);
+				}
+
+				panel.fixed(false).moveRel(body, editor.rtl ? ['tr-br', 'br-tr'] : ['tl-bl', 'bl-tl', 'tr-br']).moveBy(deltaX, deltaY);
+			}
+		}
+
+		function show() {
+			if (panel) {
+				panel.show();
+				reposition();
+				DOM.addClass(editor.getBody(), 'mce-edit-focus');
+			}
+		}
+
+		function hide() {
+			if (panel) {
+				panel.hide();
+				DOM.removeClass(editor.getBody(), 'mce-edit-focus');
+			}
+		}
+
+		function render() {
+			if (panel) {
+				if (!panel.visible()) {
+					show();
+				}
+
+				return;
+			}
+
+			// Render a plain panel inside the inlineToolbarContainer if it's defined
+			panel = self.panel = Factory.create({
+				type: inlineToolbarContainer ? 'panel' : 'floatpanel',
+				role: 'application',
+				classes: 'tinymce tinymce-inline',
+				layout: 'flex',
+				direction: 'column',
+				align: 'stretch',
+				autohide: false,
+				autofix: true,
+				fixed: !!inlineToolbarContainer,
+				border: 1,
+				items: [
+					settings.menubar === false ? null : {type: 'menubar', border: '0 0 1 0', items: createMenuButtons()},
+					createToolbars()
+				]
+			});
+
+			// Add statusbar
+			/*if (settings.statusbar !== false) {
+				panel.add({type: 'panel', classes: 'statusbar', layout: 'flow', border: '1 0 0 0', items: [
+					{type: 'elementpath'}
+				]});
+			}*/
+
+			editor.fire('BeforeRenderUI');
+			panel.renderTo(inlineToolbarContainer || document.body).reflow();
+
+			addAccessibilityKeys(panel);
+			show();
+
+			editor.on('nodeChange', reposition);
+			editor.on('activate', show);
+			editor.on('deactivate', hide);
+
+			editor.nodeChanged();
+		}
+
+		settings.content_editable = true;
+
+		editor.on('focus', function() {
+			// Render only when the CSS file has been loaded
+			if (args.skinUiCss) {
+				tinymce.DOM.styleSheetLoader.load(args.skinUiCss, render, render);
+			} else {
+				render();
+			}
+		});
+
+		editor.on('blur hide', hide);
+
+		// Remove the panel when the editor is removed
+		editor.on('remove', function() {
+			if (panel) {
+				panel.remove();
+				panel = null;
+			}
+		});
+
+		// Preload skin css
+		if (args.skinUiCss) {
+			tinymce.DOM.styleSheetLoader.load(args.skinUiCss);
+		}
+
+		return {};
+	}
+
+	/**
+	 * Renders the iframe editor UI.
+	 *
+	 * @param {Object} args Details about target element etc.
+	 * @return {Object} Name/value object with theme data.
+	 */
+	function renderIframeUI(args) {
+		var panel, resizeHandleCtrl, startSize;
+
+		if (args.skinUiCss) {
+			tinymce.DOM.loadCSS(args.skinUiCss);
+		}
+
+		// Basic UI layout
+		panel = self.panel = Factory.create({
+			type: 'panel',
+			role: 'application',
+			classes: 'tinymce',
+			style: 'visibility: hidden',
+			layout: 'stack',
+			border: 1,
+			items: [
+				settings.menubar === false ? null : {type: 'menubar', border: '0 0 1 0', items: createMenuButtons()},
+				createToolbars(),
+				{type: 'panel', name: 'iframe', layout: 'stack', classes: 'edit-area', html: '', border: '1 0 0 0'}
+			]
+		});
+
+		if (settings.resize !== false) {
+			resizeHandleCtrl = {
+				type: 'resizehandle',
+				direction: settings.resize,
+
+				onResizeStart: function() {
+					var elm = editor.getContentAreaContainer().firstChild;
+
+					startSize = {
+						width: elm.clientWidth,
+						height: elm.clientHeight
+					};
+				},
+
+				onResize: function(e) {
+					if (settings.resize == 'both') {
+						resizeTo(startSize.width + e.deltaX, startSize.height + e.deltaY);
+					} else {
+						resizeTo(null, startSize.height + e.deltaY);
+					}
+				}
+			};
+		}
+
+		// Add statusbar if needed
+		if (settings.statusbar !== false) {
+			panel.add({type: 'panel', name: 'statusbar', classes: 'statusbar', layout: 'flow', border: '1 0 0 0', ariaRoot: true, items: [
+				{type: 'elementpath'},
+				resizeHandleCtrl
+			]});
+		}
+
+		if (settings.readonly) {
+			panel.find('*').disabled(true);
+		}
+
+		editor.fire('BeforeRenderUI');
+		panel.renderBefore(args.targetNode).reflow();
+
+		if (settings.width) {
+			tinymce.DOM.setStyle(panel.getEl(), 'width', settings.width);
+		}
+
+		// Remove the panel when the editor is removed
+		editor.on('remove', function() {
+			panel.remove();
+			panel = null;
+		});
+
+		// Add accesibility shortkuts
+		addAccessibilityKeys(panel);
+
+		return {
+			iframeContainer: panel.find('#iframe')[0].getEl(),
+			editorContainer: panel.getEl()
+		};
+	}
+
+	/**
+	 * Renders the UI for the theme. This gets called by the editor.
+	 *
+	 * @param {Object} args Details about target element etc.
+	 * @return {Object} Theme UI data items.
+	 */
+	self.renderUI = function(args) {
+		var skin = settings.skin !== false ? settings.skin || 'lightgray' : false;
+
+		if (skin) {
+			var skinUrl = settings.skin_url;
+
+			if (skinUrl) {
+				skinUrl = editor.documentBaseURI.toAbsolute(skinUrl);
+			} else {
+				skinUrl = tinymce.baseURL + '/skins/' + skin;
+			}
+
+			// Load special skin for IE7
+			// TODO: Remove this when we drop IE7 support
+			if (tinymce.Env.documentMode <= 7) {
+				args.skinUiCss = skinUrl + '/skin.ie7.min.css';
+			} else {
+				args.skinUiCss = skinUrl + '/skin.min.css';
+			}
+
+			// Load content.min.css or content.inline.min.css
+			editor.contentCSS.push(skinUrl + '/content' + (editor.inline ? '.inline' : '') + '.min.css');
+		}
+
+		// Handle editor setProgressState change
+		editor.on('ProgressState', function(e) {
+			self.throbber = self.throbber || new tinymce.ui.Throbber(self.panel.getEl('body'));
+
+			if (e.state) {
+				self.throbber.show(e.time);
+			} else {
+				self.throbber.hide();
+			}
+		});
+
+		if (settings.inline) {
+			return renderInlineUI(args);
+		}
+
+		return renderIframeUI(args);
+	};
+
+	self.resizeTo = resizeTo;
+	self.resizeBy = resizeBy;
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/themes/modern/theme.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.ThemeManager.add("modern",function(i){var o=this,f=i.settings,c=tinymce.ui.Factory,m=tinymce.each,n=tinymce.DOM;var d={file:{title:"File",items:"newdocument"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | 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"}};var b="undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image";function l(){var q=[];function r(t){var u=[],s;if(!t){return}m(t.split(/[ ,]/),function(w){var x;function v(){var y=i.selection;if(x=="bullist"){y.selectorChanged("ul > li",function(B,z){var C,A=z.parents.length;while(A--){C=z.parents[A].nodeName;if(C=="OL"||C=="UL"){break}}w.active(B&&C=="UL")})}if(x=="numlist"){y.selectorChanged("ol > li",function(B,z){var C,A=z.parents.length;while(A--){C=z.parents[A].nodeName;if(C=="OL"||C=="UL"){break}}w.active(B&&C=="OL")})}if(w.settings.stateSelector){y.selectorChanged(w.settings.stateSelector,function(z){w.active(z)},true)}if(w.settings.disabledStateSelector){y.selectorChanged(w.settings.disabledStateSelector,function(z){w.disabled(z)})}}if(w=="|"){s=null}else{if(c.has(w)){w={type:w};if(f.toolbar_items_size){w.size=f.toolbar_items_size}u.push(w);s=null}else{if(!s){s={type:"buttongroup",items:[]};u.push(s)}if(i.buttons[w]){x=w;w=i.buttons[x];if(typeof w=="function"){w=w()}w.type=w.type||"button";if(f.toolbar_items_size){w.size=f.toolbar_items_size}w=c.create(w);s.items.push(w);if(i.initialized){v()}else{i.on("init",v)}}}}});q.push({type:"toolbar",layout:"flow",items:u});return true}if(tinymce.isArray(f.toolbar)){if(f.toolbar.length===0){return}tinymce.each(f.toolbar,function(t,s){f["toolbar"+(s+1)]=t});delete f.toolbar}for(var p=1;p<10;p++){if(!r(f["toolbar"+p])){break}}if(!q.length&&f.toolbar!==false){r(f.toolbar||b)}if(q.length){return{type:"panel",layout:"stack",classes:"toolbar-grp",ariaRoot:true,ariaRemember:true,items:q}}}function k(){var r,w=[];function u(x){var y;if(x=="|"){return{text:"|"}}y=i.menuItems[x];return y}function p(B){var x,C,A,D,z;z=tinymce.makeMap((f.removed_menuitems||"").split(/[ ,]/));if(f.menu){C=f.menu[B];D=true}else{C=d[B]}if(C){x={text:C.title};A=[];m((C.items||"").split(/[ ,]/),function(F){var E=u(F);if(E&&!z[F]){A.push(u(F))}});if(!D){m(i.menuItems,function(E){if(E.context==B){if(E.separator=="before"){A.push({text:"|"})}if(E.prependToContext){A.unshift(E)}else{A.push(E)}if(E.separator=="after"){A.push({text:"|"})}}})}for(var y=0;y<A.length;y++){if(A[y].text=="|"){if(y===0||y==A.length-1){A.splice(y,1)}}}x.menu=A;if(!x.menu.length){return null}}return x}var q=[];if(f.menu){for(r in f.menu){q.push(r)}}else{for(r in d){q.push(r)}}var t=typeof f.menubar=="string"?f.menubar.split(/[ ,]/):q;for(var s=0;s<t.length;s++){var v=t[s];v=p(v);if(v){w.push(v)}}return w}function g(q){function p(r){var s=q.find(r)[0];if(s){s.focus(true)}}i.shortcuts.add("Alt+F9","",function(){p("menubar")});i.shortcuts.add("Alt+F10","",function(){p("toolbar")});i.shortcuts.add("Alt+F11","",function(){p("elementpath")});q.on("cancel",function(){i.focus()})}function h(r,q){var v,p,t,u;function s(w){return{width:w.clientWidth,height:w.clientHeight}}v=i.getContainer();p=i.getContentAreaContainer().firstChild;t=s(v);u=s(p);if(r!==null){r=Math.max(f.min_width||100,r);r=Math.min(f.max_width||65535,r);n.setStyle(v,"width",r+(t.width-u.width));n.setStyle(p,"width",r)}q=Math.max(f.min_height||100,q);q=Math.min(f.max_height||65535,q);n.setStyle(p,"height",q);i.fire("ResizeEditor")}function e(p,q){var r=i.getContentAreaContainer();o.resizeTo(r.clientWidth+p,r.clientHeight+q)}function a(s){var r,v;if(f.fixed_toolbar_container){v=n.select(f.fixed_toolbar_container)[0]}function q(){if(r&&r.moveRel&&r.visible()&&!r._fixed){var A=i.selection.getScrollContainer(),x=i.getBody();var y=0,w=0;if(A){var B=n.getPos(x),z=n.getPos(A);y=Math.max(0,z.x-B.x);w=Math.max(0,z.y-B.y)}r.fixed(false).moveRel(x,i.rtl?["tr-br","br-tr"]:["tl-bl","bl-tl","tr-br"]).moveBy(y,w)}}function p(){if(r){r.show();q();n.addClass(i.getBody(),"mce-edit-focus")}}function t(){if(r){r.hide();n.removeClass(i.getBody(),"mce-edit-focus")}}function u(){if(r){if(!r.visible()){p()}return}r=o.panel=c.create({type:v?"panel":"floatpanel",role:"application",classes:"tinymce tinymce-inline",layout:"flex",direction:"column",align:"stretch",autohide:false,autofix:true,fixed:!!v,border:1,items:[f.menubar===false?null:{type:"menubar",border:"0 0 1 0",items:k()},l()]});i.fire("BeforeRenderUI");r.renderTo(v||document.body).reflow();g(r);p();i.on("nodeChange",q);i.on("activate",p);i.on("deactivate",t);i.nodeChanged()}f.content_editable=true;i.on("focus",function(){if(s.skinUiCss){tinymce.DOM.styleSheetLoader.load(s.skinUiCss,u,u)}else{u()}});i.on("blur hide",t);i.on("remove",function(){if(r){r.remove();r=null}});if(s.skinUiCss){tinymce.DOM.styleSheetLoader.load(s.skinUiCss)}return{}}function j(r){var q,s,p;if(r.skinUiCss){tinymce.DOM.loadCSS(r.skinUiCss)}q=o.panel=c.create({type:"panel",role:"application",classes:"tinymce",style:"visibility: hidden",layout:"stack",border:1,items:[f.menubar===false?null:{type:"menubar",border:"0 0 1 0",items:k()},l(),{type:"panel",name:"iframe",layout:"stack",classes:"edit-area",html:"",border:"1 0 0 0"}]});if(f.resize!==false){s={type:"resizehandle",direction:f.resize,onResizeStart:function(){var t=i.getContentAreaContainer().firstChild;p={width:t.clientWidth,height:t.clientHeight}},onResize:function(t){if(f.resize=="both"){h(p.width+t.deltaX,p.height+t.deltaY)}else{h(null,p.height+t.deltaY)}}}}if(f.statusbar!==false){q.add({type:"panel",name:"statusbar",classes:"statusbar",layout:"flow",border:"1 0 0 0",ariaRoot:true,items:[{type:"elementpath"},s]})}if(f.readonly){q.find("*").disabled(true)}i.fire("BeforeRenderUI");q.renderBefore(r.targetNode).reflow();if(f.width){tinymce.DOM.setStyle(q.getEl(),"width",f.width)}i.on("remove",function(){q.remove();q=null});g(q);return{iframeContainer:q.find("#iframe")[0].getEl(),editorContainer:q.getEl()}}o.renderUI=function(q){var r=f.skin!==false?f.skin||"lightgray":false;if(r){var p=f.skin_url;if(p){p=i.documentBaseURI.toAbsolute(p)}else{p=tinymce.baseURL+"/skins/"+r}if(tinymce.Env.documentMode<=7){q.skinUiCss=p+"/skin.ie7.min.css"}else{q.skinUiCss=p+"/skin.min.css"}i.contentCSS.push(p+"/content"+(i.inline?".inline":"")+".min.css")}i.on("ProgressState",function(s){o.throbber=o.throbber||new tinymce.ui.Throbber(o.panel.getEl("body"));if(s.state){o.throbber.show(s.time)}else{o.throbber.hide()}});if(f.inline){return a(q)}return j(q)};o.resizeTo=h;o.resizeBy=e});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/tinymce.jquery.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,36250 @@
+// 4.1.10 (2015-05-05)
+
+/**
+ * Compiled inline version. (Library mode)
+ */
+
+/*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */
+/*globals $code */
+
+(function(exports, undefined) {
+	"use strict";
+
+	var modules = {};
+
+	function require(ids, callback) {
+		var module, defs = [];
+
+		for (var i = 0; i < ids.length; ++i) {
+			module = modules[ids[i]] || resolve(ids[i]);
+			if (!module) {
+				throw 'module definition dependecy not found: ' + ids[i];
+			}
+
+			defs.push(module);
+		}
+
+		callback.apply(null, defs);
+	}
+
+	function define(id, dependencies, definition) {
+		if (typeof id !== 'string') {
+			throw 'invalid module definition, module id must be defined and be a string';
+		}
+
+		if (dependencies === undefined) {
+			throw 'invalid module definition, dependencies must be specified';
+		}
+
+		if (definition === undefined) {
+			throw 'invalid module definition, definition function must be specified';
+		}
+
+		require(dependencies, function() {
+			modules[id] = definition.apply(null, arguments);
+		});
+	}
+
+	function defined(id) {
+		return !!modules[id];
+	}
+
+	function resolve(id) {
+		var target = exports;
+		var fragments = id.split(/[.\/]/);
+
+		for (var fi = 0; fi < fragments.length; ++fi) {
+			if (!target[fragments[fi]]) {
+				return;
+			}
+
+			target = target[fragments[fi]];
+		}
+
+		return target;
+	}
+
+	function expose(ids) {
+		for (var i = 0; i < ids.length; i++) {
+			var target = exports;
+			var id = ids[i];
+			var fragments = id.split(/[.\/]/);
+
+			for (var fi = 0; fi < fragments.length - 1; ++fi) {
+				if (target[fragments[fi]] === undefined) {
+					target[fragments[fi]] = {};
+				}
+
+				target = target[fragments[fi]];
+			}
+
+			target[fragments[fragments.length - 1]] = modules[id];
+		}
+	}
+
+// Included from: js/tinymce/classes/dom/EventUtils.js
+
+/**
+ * EventUtils.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*jshint loopfunc:true*/
+/*eslint no-loop-func:0 */
+
+/**
+ * This class wraps the browsers native event logic with more convenient methods.
+ *
+ * @class tinymce.dom.EventUtils
+ */
+define("tinymce/dom/EventUtils", [], function() {
+	"use strict";
+
+	var eventExpandoPrefix = "mce-data-";
+	var mouseEventRe = /^(?:mouse|contextmenu)|click/;
+	var deprecated = {keyLocation: 1, layerX: 1, layerY: 1, returnValue: 1};
+
+	/**
+	 * Binds a native event to a callback on the speified target.
+	 */
+	function addEvent(target, name, callback, capture) {
+		if (target.addEventListener) {
+			target.addEventListener(name, callback, capture || false);
+		} else if (target.attachEvent) {
+			target.attachEvent('on' + name, callback);
+		}
+	}
+
+	/**
+	 * Unbinds a native event callback on the specified target.
+	 */
+	function removeEvent(target, name, callback, capture) {
+		if (target.removeEventListener) {
+			target.removeEventListener(name, callback, capture || false);
+		} else if (target.detachEvent) {
+			target.detachEvent('on' + name, callback);
+		}
+	}
+
+	/**
+	 * Normalizes a native event object or just adds the event specific methods on a custom event.
+	 */
+	function fix(originalEvent, data) {
+		var name, event = data || {}, undef;
+
+		// Dummy function that gets replaced on the delegation state functions
+		function returnFalse() {
+			return false;
+		}
+
+		// Dummy function that gets replaced on the delegation state functions
+		function returnTrue() {
+			return true;
+		}
+
+		// Copy all properties from the original event
+		for (name in originalEvent) {
+			// layerX/layerY is deprecated in Chrome and produces a warning
+			if (!deprecated[name]) {
+				event[name] = originalEvent[name];
+			}
+		}
+
+		// Normalize target IE uses srcElement
+		if (!event.target) {
+			event.target = event.srcElement || document;
+		}
+
+		// Calculate pageX/Y if missing and clientX/Y available
+		if (originalEvent && mouseEventRe.test(originalEvent.type) && originalEvent.pageX === undef && originalEvent.clientX !== undef) {
+			var eventDoc = event.target.ownerDocument || document;
+			var doc = eventDoc.documentElement;
+			var body = eventDoc.body;
+
+			event.pageX = originalEvent.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) -
+				(doc && doc.clientLeft || body && body.clientLeft || 0);
+
+			event.pageY = originalEvent.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) -
+				(doc && doc.clientTop || body && body.clientTop || 0);
+		}
+
+		// Add preventDefault method
+		event.preventDefault = function() {
+			event.isDefaultPrevented = returnTrue;
+
+			// Execute preventDefault on the original event object
+			if (originalEvent) {
+				if (originalEvent.preventDefault) {
+					originalEvent.preventDefault();
+				} else {
+					originalEvent.returnValue = false; // IE
+				}
+			}
+		};
+
+		// Add stopPropagation
+		event.stopPropagation = function() {
+			event.isPropagationStopped = returnTrue;
+
+			// Execute stopPropagation on the original event object
+			if (originalEvent) {
+				if (originalEvent.stopPropagation) {
+					originalEvent.stopPropagation();
+				} else {
+					originalEvent.cancelBubble = true; // IE
+				}
+			}
+		};
+
+		// Add stopImmediatePropagation
+		event.stopImmediatePropagation = function() {
+			event.isImmediatePropagationStopped = returnTrue;
+			event.stopPropagation();
+		};
+
+		// Add event delegation states
+		if (!event.isDefaultPrevented) {
+			event.isDefaultPrevented = returnFalse;
+			event.isPropagationStopped = returnFalse;
+			event.isImmediatePropagationStopped = returnFalse;
+		}
+
+		return event;
+	}
+
+	/**
+	 * Bind a DOMContentLoaded event across browsers and executes the callback once the page DOM is initialized.
+	 * It will also set/check the domLoaded state of the event_utils instance so ready isn't called multiple times.
+	 */
+	function bindOnReady(win, callback, eventUtils) {
+		var doc = win.document, event = {type: 'ready'};
+
+		if (eventUtils.domLoaded) {
+			callback(event);
+			return;
+		}
+
+		// Gets called when the DOM is ready
+		function readyHandler() {
+			if (!eventUtils.domLoaded) {
+				eventUtils.domLoaded = true;
+				callback(event);
+			}
+		}
+
+		function waitForDomLoaded() {
+			// Check complete or interactive state if there is a body
+			// element on some iframes IE 8 will produce a null body
+			if (doc.readyState === "complete" || (doc.readyState === "interactive" && doc.body)) {
+				removeEvent(doc, "readystatechange", waitForDomLoaded);
+				readyHandler();
+			}
+		}
+
+		function tryScroll() {
+			try {
+				// If IE is used, use the trick by Diego Perini licensed under MIT by request to the author.
+				// http://javascript.nwbox.com/IEContentLoaded/
+				doc.documentElement.doScroll("left");
+			} catch (ex) {
+				setTimeout(tryScroll, 0);
+				return;
+			}
+
+			readyHandler();
+		}
+
+		// Use W3C method
+		if (doc.addEventListener) {
+			if (doc.readyState === "complete") {
+				readyHandler();
+			} else {
+				addEvent(win, 'DOMContentLoaded', readyHandler);
+			}
+		} else {
+			// Use IE method
+			addEvent(doc, "readystatechange", waitForDomLoaded);
+
+			// Wait until we can scroll, when we can the DOM is initialized
+			if (doc.documentElement.doScroll && win.self === win.top) {
+				tryScroll();
+			}
+		}
+
+		// Fallback if any of the above methods should fail for some odd reason
+		addEvent(win, 'load', readyHandler);
+	}
+
+	/**
+	 * This class enables you to bind/unbind native events to elements and normalize it's behavior across browsers.
+	 */
+	function EventUtils() {
+		var self = this, events = {}, count, expando, hasFocusIn, hasMouseEnterLeave, mouseEnterLeave;
+
+		expando = eventExpandoPrefix + (+new Date()).toString(32);
+		hasMouseEnterLeave = "onmouseenter" in document.documentElement;
+		hasFocusIn = "onfocusin" in document.documentElement;
+		mouseEnterLeave = {mouseenter: 'mouseover', mouseleave: 'mouseout'};
+		count = 1;
+
+		// State if the DOMContentLoaded was executed or not
+		self.domLoaded = false;
+		self.events = events;
+
+		/**
+		 * Executes all event handler callbacks for a specific event.
+		 *
+		 * @private
+		 * @param {Event} evt Event object.
+		 * @param {String} id Expando id value to look for.
+		 */
+		function executeHandlers(evt, id) {
+			var callbackList, i, l, callback, container = events[id];
+
+			callbackList = container && container[evt.type];
+			if (callbackList) {
+				for (i = 0, l = callbackList.length; i < l; i++) {
+					callback = callbackList[i];
+
+					// Check if callback exists might be removed if a unbind is called inside the callback
+					if (callback && callback.func.call(callback.scope, evt) === false) {
+						evt.preventDefault();
+					}
+
+					// Should we stop propagation to immediate listeners
+					if (evt.isImmediatePropagationStopped()) {
+						return;
+					}
+				}
+			}
+		}
+
+		/**
+		 * Binds a callback to an event on the specified target.
+		 *
+		 * @method bind
+		 * @param {Object} target Target node/window or custom object.
+		 * @param {String} names Name of the event to bind.
+		 * @param {function} callback Callback function to execute when the event occurs.
+		 * @param {Object} scope Scope to call the callback function on, defaults to target.
+		 * @return {function} Callback function that got bound.
+		 */
+		self.bind = function(target, names, callback, scope) {
+			var id, callbackList, i, name, fakeName, nativeHandler, capture, win = window;
+
+			// Native event handler function patches the event and executes the callbacks for the expando
+			function defaultNativeHandler(evt) {
+				executeHandlers(fix(evt || win.event), id);
+			}
+
+			// Don't bind to text nodes or comments
+			if (!target || target.nodeType === 3 || target.nodeType === 8) {
+				return;
+			}
+
+			// Create or get events id for the target
+			if (!target[expando]) {
+				id = count++;
+				target[expando] = id;
+				events[id] = {};
+			} else {
+				id = target[expando];
+			}
+
+			// Setup the specified scope or use the target as a default
+			scope = scope || target;
+
+			// Split names and bind each event, enables you to bind multiple events with one call
+			names = names.split(' ');
+			i = names.length;
+			while (i--) {
+				name = names[i];
+				nativeHandler = defaultNativeHandler;
+				fakeName = capture = false;
+
+				// Use ready instead of DOMContentLoaded
+				if (name === "DOMContentLoaded") {
+					name = "ready";
+				}
+
+				// DOM is already ready
+				if (self.domLoaded && name === "ready" && target.readyState == 'complete') {
+					callback.call(scope, fix({type: name}));
+					continue;
+				}
+
+				// Handle mouseenter/mouseleaver
+				if (!hasMouseEnterLeave) {
+					fakeName = mouseEnterLeave[name];
+
+					if (fakeName) {
+						nativeHandler = function(evt) {
+							var current, related;
+
+							current = evt.currentTarget;
+							related = evt.relatedTarget;
+
+							// Check if related is inside the current target if it's not then the event should
+							// be ignored since it's a mouseover/mouseout inside the element
+							if (related && current.contains) {
+								// Use contains for performance
+								related = current.contains(related);
+							} else {
+								while (related && related !== current) {
+									related = related.parentNode;
+								}
+							}
+
+							// Fire fake event
+							if (!related) {
+								evt = fix(evt || win.event);
+								evt.type = evt.type === 'mouseout' ? 'mouseleave' : 'mouseenter';
+								evt.target = current;
+								executeHandlers(evt, id);
+							}
+						};
+					}
+				}
+
+				// Fake bubbeling of focusin/focusout
+				if (!hasFocusIn && (name === "focusin" || name === "focusout")) {
+					capture = true;
+					fakeName = name === "focusin" ? "focus" : "blur";
+					nativeHandler = function(evt) {
+						evt = fix(evt || win.event);
+						evt.type = evt.type === 'focus' ? 'focusin' : 'focusout';
+						executeHandlers(evt, id);
+					};
+				}
+
+				// Setup callback list and bind native event
+				callbackList = events[id][name];
+				if (!callbackList) {
+					events[id][name] = callbackList = [{func: callback, scope: scope}];
+					callbackList.fakeName = fakeName;
+					callbackList.capture = capture;
+					//callbackList.callback = callback;
+
+					// Add the nativeHandler to the callback list so that we can later unbind it
+					callbackList.nativeHandler = nativeHandler;
+
+					// Check if the target has native events support
+
+					if (name === "ready") {
+						bindOnReady(target, nativeHandler, self);
+					} else {
+						addEvent(target, fakeName || name, nativeHandler, capture);
+					}
+				} else {
+					if (name === "ready" && self.domLoaded) {
+						callback({type: name});
+					} else {
+						// If it already has an native handler then just push the callback
+						callbackList.push({func: callback, scope: scope});
+					}
+				}
+			}
+
+			target = callbackList = 0; // Clean memory for IE
+
+			return callback;
+		};
+
+		/**
+		 * Unbinds the specified event by name, name and callback or all events on the target.
+		 *
+		 * @method unbind
+		 * @param {Object} target Target node/window or custom object.
+		 * @param {String} names Optional event name to unbind.
+		 * @param {function} callback Optional callback function to unbind.
+		 * @return {EventUtils} Event utils instance.
+		 */
+		self.unbind = function(target, names, callback) {
+			var id, callbackList, i, ci, name, eventMap;
+
+			// Don't bind to text nodes or comments
+			if (!target || target.nodeType === 3 || target.nodeType === 8) {
+				return self;
+			}
+
+			// Unbind event or events if the target has the expando
+			id = target[expando];
+			if (id) {
+				eventMap = events[id];
+
+				// Specific callback
+				if (names) {
+					names = names.split(' ');
+					i = names.length;
+					while (i--) {
+						name = names[i];
+						callbackList = eventMap[name];
+
+						// Unbind the event if it exists in the map
+						if (callbackList) {
+							// Remove specified callback
+							if (callback) {
+								ci = callbackList.length;
+								while (ci--) {
+									if (callbackList[ci].func === callback) {
+										var nativeHandler = callbackList.nativeHandler;
+										var fakeName = callbackList.fakeName, capture = callbackList.capture;
+
+										// Clone callbackList since unbind inside a callback would otherwise break the handlers loop
+										callbackList = callbackList.slice(0, ci).concat(callbackList.slice(ci + 1));
+										callbackList.nativeHandler = nativeHandler;
+										callbackList.fakeName = fakeName;
+										callbackList.capture = capture;
+
+										eventMap[name] = callbackList;
+									}
+								}
+							}
+
+							// Remove all callbacks if there isn't a specified callback or there is no callbacks left
+							if (!callback || callbackList.length === 0) {
+								delete eventMap[name];
+								removeEvent(target, callbackList.fakeName || name, callbackList.nativeHandler, callbackList.capture);
+							}
+						}
+					}
+				} else {
+					// All events for a specific element
+					for (name in eventMap) {
+						callbackList = eventMap[name];
+						removeEvent(target, callbackList.fakeName || name, callbackList.nativeHandler, callbackList.capture);
+					}
+
+					eventMap = {};
+				}
+
+				// Check if object is empty, if it isn't then we won't remove the expando map
+				for (name in eventMap) {
+					return self;
+				}
+
+				// Delete event object
+				delete events[id];
+
+				// Remove expando from target
+				try {
+					// IE will fail here since it can't delete properties from window
+					delete target[expando];
+				} catch (ex) {
+					// IE will set it to null
+					target[expando] = null;
+				}
+			}
+
+			return self;
+		};
+
+		/**
+		 * Fires the specified event on the specified target.
+		 *
+		 * @method fire
+		 * @param {Object} target Target node/window or custom object.
+		 * @param {String} name Event name to fire.
+		 * @param {Object} args Optional arguments to send to the observers.
+		 * @return {EventUtils} Event utils instance.
+		 */
+		self.fire = function(target, name, args) {
+			var id;
+
+			// Don't bind to text nodes or comments
+			if (!target || target.nodeType === 3 || target.nodeType === 8) {
+				return self;
+			}
+
+			// Build event object by patching the args
+			args = fix(null, args);
+			args.type = name;
+			args.target = target;
+
+			do {
+				// Found an expando that means there is listeners to execute
+				id = target[expando];
+				if (id) {
+					executeHandlers(args, id);
+				}
+
+				// Walk up the DOM
+				target = target.parentNode || target.ownerDocument || target.defaultView || target.parentWindow;
+			} while (target && !args.isPropagationStopped());
+
+			return self;
+		};
+
+		/**
+		 * Removes all bound event listeners for the specified target. This will also remove any bound
+		 * listeners to child nodes within that target.
+		 *
+		 * @method clean
+		 * @param {Object} target Target node/window object.
+		 * @return {EventUtils} Event utils instance.
+		 */
+		self.clean = function(target) {
+			var i, children, unbind = self.unbind;
+
+			// Don't bind to text nodes or comments
+			if (!target || target.nodeType === 3 || target.nodeType === 8) {
+				return self;
+			}
+
+			// Unbind any element on the specificed target
+			if (target[expando]) {
+				unbind(target);
+			}
+
+			// Target doesn't have getElementsByTagName it's probably a window object then use it's document to find the children
+			if (!target.getElementsByTagName) {
+				target = target.document;
+			}
+
+			// Remove events from each child element
+			if (target && target.getElementsByTagName) {
+				unbind(target);
+
+				children = target.getElementsByTagName('*');
+				i = children.length;
+				while (i--) {
+					target = children[i];
+
+					if (target[expando]) {
+						unbind(target);
+					}
+				}
+			}
+
+			return self;
+		};
+
+		/**
+		 * Destroys the event object. Call this on IE to remove memory leaks.
+		 */
+		self.destroy = function() {
+			events = {};
+		};
+
+		// Legacy function for canceling events
+		self.cancel = function(e) {
+			if (e) {
+				e.preventDefault();
+				e.stopImmediatePropagation();
+			}
+
+			return false;
+		};
+	}
+
+	EventUtils.Event = new EventUtils();
+	EventUtils.Event.bind(window, 'ready', function() {});
+
+	return EventUtils;
+});
+
+// Included from: js/tinymce/classes/dom/Sizzle.jQuery.js
+
+/**
+ * Sizzle.jQuery.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global jQuery:true */
+
+/*
+ * Fake Sizzle using jQuery.
+ */
+define("tinymce/dom/Sizzle", [], function() {
+	// Detect if jQuery is loaded
+	if (!window.jQuery) {
+		throw new Error("Load jQuery first");
+	}
+
+	return jQuery.find;
+});
+
+// Included from: js/tinymce/classes/Env.js
+
+/**
+ * Env.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class contains various environment constants like browser versions etc.
+ * Normally you don't want to sniff specific browser versions but sometimes you have
+ * to when it's impossible to feature detect. So use this with care.
+ *
+ * @class tinymce.Env
+ * @static
+ */
+define("tinymce/Env", [], function() {
+	var nav = navigator, userAgent = nav.userAgent;
+	var opera, webkit, ie, ie11, ie12, gecko, mac, iDevice, android;
+
+	opera = window.opera && window.opera.buildNumber;
+	android = /Android/.test(userAgent);
+	webkit = /WebKit/.test(userAgent);
+	ie = !webkit && !opera && (/MSIE/gi).test(userAgent) && (/Explorer/gi).test(nav.appName);
+	ie = ie && /MSIE (\w+)\./.exec(userAgent)[1];
+	ie11 = userAgent.indexOf('Trident/') != -1 && (userAgent.indexOf('rv:') != -1 || nav.appName.indexOf('Netscape') != -1) ? 11 : false;
+	ie12 = (document.msElementsFromPoint && !ie && !ie11) ? 12 : false;
+	ie = ie || ie11 || ie12;
+	gecko = !webkit && !ie11 && /Gecko/.test(userAgent);
+	mac = userAgent.indexOf('Mac') != -1;
+	iDevice = /(iPad|iPhone)/.test(userAgent);
+
+	if (ie12) {
+		webkit = false;
+	}
+
+	// Is a iPad/iPhone and not on iOS5 sniff the WebKit version since older iOS WebKit versions
+	// says it has contentEditable support but there is no visible caret.
+	var contentEditable = !iDevice || userAgent.match(/AppleWebKit\/(\d*)/)[1] >= 534;
+
+	return {
+		/**
+		 * Constant that is true if the browser is Opera.
+		 *
+		 * @property opera
+		 * @type Boolean
+		 * @final
+		 */
+		opera: opera,
+
+		/**
+		 * Constant that is true if the browser is WebKit (Safari/Chrome).
+		 *
+		 * @property webKit
+		 * @type Boolean
+		 * @final
+		 */
+		webkit: webkit,
+
+		/**
+		 * Constant that is more than zero if the browser is IE.
+		 *
+		 * @property ie
+		 * @type Boolean
+		 * @final
+		 */
+		ie: ie,
+
+		/**
+		 * Constant that is true if the browser is Gecko.
+		 *
+		 * @property gecko
+		 * @type Boolean
+		 * @final
+		 */
+		gecko: gecko,
+
+		/**
+		 * Constant that is true if the os is Mac OS.
+		 *
+		 * @property mac
+		 * @type Boolean
+		 * @final
+		 */
+		mac: mac,
+
+		/**
+		 * Constant that is true if the os is iOS.
+		 *
+		 * @property iOS
+		 * @type Boolean
+		 * @final
+		 */
+		iOS: iDevice,
+
+		/**
+		 * Constant that is true if the os is android.
+		 *
+		 * @property android
+		 * @type Boolean
+		 * @final
+		 */
+		android: android,
+
+		/**
+		 * Constant that is true if the browser supports editing.
+		 *
+		 * @property contentEditable
+		 * @type Boolean
+		 * @final
+		 */
+		contentEditable: contentEditable,
+
+		/**
+		 * Transparent image data url.
+		 *
+		 * @property transparentSrc
+		 * @type Boolean
+		 * @final
+		 */
+		transparentSrc: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
+
+		/**
+		 * Returns true/false if the browser can or can't place the caret after a inline block like an image.
+		 *
+		 * @property noCaretAfter
+		 * @type Boolean
+		 * @final
+		 */
+		caretAfter: ie != 8,
+
+		/**
+		 * Constant that is true if the browser supports native DOM Ranges. IE 9+.
+		 *
+		 * @property range
+		 * @type Boolean
+		 */
+		range: window.getSelection && "Range" in window,
+
+		/**
+		 * Returns the IE document mode for non IE browsers this will fake IE 10.
+		 *
+		 * @property documentMode
+		 * @type Number
+		 */
+		documentMode: ie && !ie12 ? (document.documentMode || 7) : 10
+	};
+});
+
+// Included from: js/tinymce/classes/util/Tools.js
+
+/**
+ * Tools.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class contains various utlity functions. These are also exposed
+ * directly on the tinymce namespace.
+ *
+ * @class tinymce.util.Tools
+ */
+define("tinymce/util/Tools", [
+	"tinymce/Env"
+], function(Env) {
+	/**
+	 * Removes whitespace from the beginning and end of a string.
+	 *
+	 * @method trim
+	 * @param {String} s String to remove whitespace from.
+	 * @return {String} New string with removed whitespace.
+	 */
+	var whiteSpaceRegExp = /^\s*|\s*$/g;
+
+	function trim(str) {
+		return (str === null || str === undefined) ? '' : ("" + str).replace(whiteSpaceRegExp, '');
+	}
+
+	/**
+	 * Returns true/false if the object is an array or not.
+	 *
+	 * @method isArray
+	 * @param {Object} obj Object to check.
+	 * @return {boolean} true/false state if the object is an array or not.
+	 */
+	var isArray = Array.isArray || function(obj) {
+		return Object.prototype.toString.call(obj) === "[object Array]";
+	};
+
+	/**
+	 * Checks if a object is of a specific type for example an array.
+	 *
+	 * @method is
+	 * @param {Object} obj Object to check type of.
+	 * @param {string} type Optional type to check for.
+	 * @return {Boolean} true/false if the object is of the specified type.
+	 */
+	function is(obj, type) {
+		if (!type) {
+			return obj !== undefined;
+		}
+
+		if (type == 'array' && isArray(obj)) {
+			return true;
+		}
+
+		return typeof obj == type;
+	}
+
+	/**
+	 * Converts the specified object into a real JavaScript array.
+	 *
+	 * @method toArray
+	 * @param {Object} obj Object to convert into array.
+	 * @return {Array} Array object based in input.
+	 */
+	function toArray(obj) {
+		var array = obj, i, l;
+
+		if (!isArray(obj)) {
+			array = [];
+			for (i = 0, l = obj.length; i < l; i++) {
+				array[i] = obj[i];
+			}
+		}
+
+		return array;
+	}
+
+	/**
+	 * Makes a name/object map out of an array with names.
+	 *
+	 * @method makeMap
+	 * @param {Array/String} items Items to make map out of.
+	 * @param {String} delim Optional delimiter to split string by.
+	 * @param {Object} map Optional map to add items to.
+	 * @return {Object} Name/value map of items.
+	 */
+	function makeMap(items, delim, map) {
+		var i;
+
+		items = items || [];
+		delim = delim || ',';
+
+		if (typeof items == "string") {
+			items = items.split(delim);
+		}
+
+		map = map || {};
+
+		i = items.length;
+		while (i--) {
+			map[items[i]] = {};
+		}
+
+		return map;
+	}
+
+	/**
+	 * Performs an iteration of all items in a collection such as an object or array. This method will execure the
+	 * callback function for each item in the collection, if the callback returns false the iteration will terminate.
+	 * The callback has the following format: cb(value, key_or_index).
+	 *
+	 * @method each
+	 * @param {Object} o Collection to iterate.
+	 * @param {function} cb Callback function to execute for each item.
+	 * @param {Object} s Optional scope to execute the callback in.
+	 * @example
+	 * // Iterate an array
+	 * tinymce.each([1,2,3], function(v, i) {
+	 *     console.debug("Value: " + v + ", Index: " + i);
+	 * });
+	 *
+	 * // Iterate an object
+	 * tinymce.each({a: 1, b: 2, c: 3], function(v, k) {
+	 *     console.debug("Value: " + v + ", Key: " + k);
+	 * });
+	 */
+	function each(o, cb, s) {
+		var n, l;
+
+		if (!o) {
+			return 0;
+		}
+
+		s = s || o;
+
+		if (o.length !== undefined) {
+			// Indexed arrays, needed for Safari
+			for (n = 0, l = o.length; n < l; n++) {
+				if (cb.call(s, o[n], n, o) === false) {
+					return 0;
+				}
+			}
+		} else {
+			// Hashtables
+			for (n in o) {
+				if (o.hasOwnProperty(n)) {
+					if (cb.call(s, o[n], n, o) === false) {
+						return 0;
+					}
+				}
+			}
+		}
+
+		return 1;
+	}
+
+	/**
+	 * Creates a new array by the return value of each iteration function call. This enables you to convert
+	 * one array list into another.
+	 *
+	 * @method map
+	 * @param {Array} array Array of items to iterate.
+	 * @param {function} callback Function to call for each item. It's return value will be the new value.
+	 * @return {Array} Array with new values based on function return values.
+	 */
+	function map(array, callback) {
+		var out = [];
+
+		each(array, function(item) {
+			out.push(callback(item));
+		});
+
+		return out;
+	}
+
+	/**
+	 * Filters out items from the input array by calling the specified function for each item.
+	 * If the function returns false the item will be excluded if it returns true it will be included.
+	 *
+	 * @method grep
+	 * @param {Array} a Array of items to loop though.
+	 * @param {function} f Function to call for each item. Include/exclude depends on it's return value.
+	 * @return {Array} New array with values imported and filtered based in input.
+	 * @example
+	 * // Filter out some items, this will return an array with 4 and 5
+	 * var items = tinymce.grep([1,2,3,4,5], function(v) {return v > 3;});
+	 */
+	function grep(a, f) {
+		var o = [];
+
+		each(a, function(v) {
+			if (!f || f(v)) {
+				o.push(v);
+			}
+		});
+
+		return o;
+	}
+
+	/**
+	 * Creates a class, subclass or static singleton.
+	 * More details on this method can be found in the Wiki.
+	 *
+	 * @method create
+	 * @param {String} s Class name, inheritage and prefix.
+	 * @param {Object} p Collection of methods to add to the class.
+	 * @param {Object} root Optional root object defaults to the global window object.
+	 * @example
+	 * // Creates a basic class
+	 * tinymce.create('tinymce.somepackage.SomeClass', {
+	 *     SomeClass: function() {
+	 *         // Class constructor
+	 *     },
+	 *
+	 *     method: function() {
+	 *         // Some method
+	 *     }
+	 * });
+	 *
+	 * // Creates a basic subclass class
+	 * tinymce.create('tinymce.somepackage.SomeSubClass:tinymce.somepackage.SomeClass', {
+	 *     SomeSubClass: function() {
+	 *         // Class constructor
+	 *         this.parent(); // Call parent constructor
+	 *     },
+	 *
+	 *     method: function() {
+	 *         // Some method
+	 *         this.parent(); // Call parent method
+	 *     },
+	 *
+	 *     'static': {
+	 *         staticMethod: function() {
+	 *             // Static method
+	 *         }
+	 *     }
+	 * });
+	 *
+	 * // Creates a singleton/static class
+	 * tinymce.create('static tinymce.somepackage.SomeSingletonClass', {
+	 *     method: function() {
+	 *         // Some method
+	 *     }
+	 * });
+	 */
+	function create(s, p, root) {
+		var self = this, sp, ns, cn, scn, c, de = 0;
+
+		// Parse : <prefix> <class>:<super class>
+		s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s);
+		cn = s[3].match(/(^|\.)(\w+)$/i)[2]; // Class name
+
+		// Create namespace for new class
+		ns = self.createNS(s[3].replace(/\.\w+$/, ''), root);
+
+		// Class already exists
+		if (ns[cn]) {
+			return;
+		}
+
+		// Make pure static class
+		if (s[2] == 'static') {
+			ns[cn] = p;
+
+			if (this.onCreate) {
+				this.onCreate(s[2], s[3], ns[cn]);
+			}
+
+			return;
+		}
+
+		// Create default constructor
+		if (!p[cn]) {
+			p[cn] = function() {};
+			de = 1;
+		}
+
+		// Add constructor and methods
+		ns[cn] = p[cn];
+		self.extend(ns[cn].prototype, p);
+
+		// Extend
+		if (s[5]) {
+			sp = self.resolve(s[5]).prototype;
+			scn = s[5].match(/\.(\w+)$/i)[1]; // Class name
+
+			// Extend constructor
+			c = ns[cn];
+			if (de) {
+				// Add passthrough constructor
+				ns[cn] = function() {
+					return sp[scn].apply(this, arguments);
+				};
+			} else {
+				// Add inherit constructor
+				ns[cn] = function() {
+					this.parent = sp[scn];
+					return c.apply(this, arguments);
+				};
+			}
+			ns[cn].prototype[cn] = ns[cn];
+
+			// Add super methods
+			self.each(sp, function(f, n) {
+				ns[cn].prototype[n] = sp[n];
+			});
+
+			// Add overridden methods
+			self.each(p, function(f, n) {
+				// Extend methods if needed
+				if (sp[n]) {
+					ns[cn].prototype[n] = function() {
+						this.parent = sp[n];
+						return f.apply(this, arguments);
+					};
+				} else {
+					if (n != cn) {
+						ns[cn].prototype[n] = f;
+					}
+				}
+			});
+		}
+
+		// Add static methods
+		/*jshint sub:true*/
+		/*eslint dot-notation:0*/
+		self.each(p['static'], function(f, n) {
+			ns[cn][n] = f;
+		});
+	}
+
+	/**
+	 * Returns the index of a value in an array, this method will return -1 if the item wasn't found.
+	 *
+	 * @method inArray
+	 * @param {Array} a Array/Object to search for value in.
+	 * @param {Object} v Value to check for inside the array.
+	 * @return {Number/String} Index of item inside the array inside an object. Or -1 if it wasn't found.
+	 * @example
+	 * // Get index of value in array this will alert 1 since 2 is at that index
+	 * alert(tinymce.inArray([1,2,3], 2));
+	 */
+	function inArray(a, v) {
+		var i, l;
+
+		if (a) {
+			for (i = 0, l = a.length; i < l; i++) {
+				if (a[i] === v) {
+					return i;
+				}
+			}
+		}
+
+		return -1;
+	}
+
+	function extend(obj, ext) {
+		var i, l, name, args = arguments, value;
+
+		for (i = 1, l = args.length; i < l; i++) {
+			ext = args[i];
+			for (name in ext) {
+				if (ext.hasOwnProperty(name)) {
+					value = ext[name];
+
+					if (value !== undefined) {
+						obj[name] = value;
+					}
+				}
+			}
+		}
+
+		return obj;
+	}
+
+	/**
+	 * Executed the specified function for each item in a object tree.
+	 *
+	 * @method walk
+	 * @param {Object} o Object tree to walk though.
+	 * @param {function} f Function to call for each item.
+	 * @param {String} n Optional name of collection inside the objects to walk for example childNodes.
+	 * @param {String} s Optional scope to execute the function in.
+	 */
+	function walk(o, f, n, s) {
+		s = s || this;
+
+		if (o) {
+			if (n) {
+				o = o[n];
+			}
+
+			each(o, function(o, i) {
+				if (f.call(s, o, i, n) === false) {
+					return false;
+				}
+
+				walk(o, f, n, s);
+			});
+		}
+	}
+
+	/**
+	 * Creates a namespace on a specific object.
+	 *
+	 * @method createNS
+	 * @param {String} n Namespace to create for example a.b.c.d.
+	 * @param {Object} o Optional object to add namespace to, defaults to window.
+	 * @return {Object} New namespace object the last item in path.
+	 * @example
+	 * // Create some namespace
+	 * tinymce.createNS('tinymce.somepackage.subpackage');
+	 *
+	 * // Add a singleton
+	 * var tinymce.somepackage.subpackage.SomeSingleton = {
+	 *     method: function() {
+	 *         // Some method
+	 *     }
+	 * };
+	 */
+	function createNS(n, o) {
+		var i, v;
+
+		o = o || window;
+
+		n = n.split('.');
+		for (i = 0; i < n.length; i++) {
+			v = n[i];
+
+			if (!o[v]) {
+				o[v] = {};
+			}
+
+			o = o[v];
+		}
+
+		return o;
+	}
+
+	/**
+	 * Resolves a string and returns the object from a specific structure.
+	 *
+	 * @method resolve
+	 * @param {String} n Path to resolve for example a.b.c.d.
+	 * @param {Object} o Optional object to search though, defaults to window.
+	 * @return {Object} Last object in path or null if it couldn't be resolved.
+	 * @example
+	 * // Resolve a path into an object reference
+	 * var obj = tinymce.resolve('a.b.c.d');
+	 */
+	function resolve(n, o) {
+		var i, l;
+
+		o = o || window;
+
+		n = n.split('.');
+		for (i = 0, l = n.length; i < l; i++) {
+			o = o[n[i]];
+
+			if (!o) {
+				break;
+			}
+		}
+
+		return o;
+	}
+
+	/**
+	 * Splits a string but removes the whitespace before and after each value.
+	 *
+	 * @method explode
+	 * @param {string} s String to split.
+	 * @param {string} d Delimiter to split by.
+	 * @example
+	 * // Split a string into an array with a,b,c
+	 * var arr = tinymce.explode('a, b,   c');
+	 */
+	function explode(s, d) {
+		if (!s || is(s, 'array')) {
+			return s;
+		}
+
+		return map(s.split(d || ','), trim);
+	}
+
+	function _addCacheSuffix(url) {
+		var cacheSuffix = Env.cacheSuffix;
+
+		if (cacheSuffix) {
+			url += (url.indexOf('?') === -1 ? '?' : '&') + cacheSuffix;
+		}
+
+		return url;
+	}
+
+	return {
+		trim: trim,
+		isArray: isArray,
+		is: is,
+		toArray: toArray,
+		makeMap: makeMap,
+		each: each,
+		map: map,
+		grep: grep,
+		inArray: inArray,
+		extend: extend,
+		create: create,
+		walk: walk,
+		createNS: createNS,
+		resolve: resolve,
+		explode: explode,
+		_addCacheSuffix: _addCacheSuffix
+	};
+});
+
+// Included from: js/tinymce/classes/dom/DomQuery.js
+
+/**
+ * DomQuery.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class mimics most of the jQuery API:
+ *
+ * This is whats currently implemented:
+ * - Utility functions
+ * - DOM traversial
+ * - DOM manipulation
+ * - Event binding
+ *
+ * This is not currently implemented:
+ * - Dimension
+ * - Ajax
+ * - Animation
+ * - Advanced chaining
+ *
+ * @example
+ * var $ = tinymce.dom.DomQuery;
+ * $('p').attr('attr', 'value').addClass('class');
+ *
+ * @class tinymce.dom.DomQuery
+ */
+define("tinymce/dom/DomQuery", [
+	"tinymce/dom/EventUtils",
+	"tinymce/dom/Sizzle",
+	"tinymce/util/Tools",
+	"tinymce/Env"
+], function(EventUtils, Sizzle, Tools, Env) {
+	var doc = document, push = Array.prototype.push, slice = Array.prototype.slice;
+	var rquickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/;
+	var Event = EventUtils.Event, undef;
+
+	function isDefined(obj) {
+		return typeof obj !== 'undefined';
+	}
+
+	function isString(obj) {
+		return typeof obj === 'string';
+	}
+
+	function isWindow(obj) {
+		return obj && obj == obj.window;
+	}
+
+	function createFragment(html, fragDoc) {
+		var frag, node, container;
+
+		fragDoc = fragDoc || doc;
+		container = fragDoc.createElement('div');
+		frag = fragDoc.createDocumentFragment();
+		container.innerHTML = html;
+
+		while ((node = container.firstChild)) {
+			frag.appendChild(node);
+		}
+
+		return frag;
+	}
+
+	function domManipulate(targetNodes, sourceItem, callback, reverse) {
+		var i;
+
+		if (isString(sourceItem)) {
+			sourceItem = createFragment(sourceItem, getElementDocument(targetNodes[0]));
+		} else if (sourceItem.length && !sourceItem.nodeType) {
+			sourceItem = DomQuery.makeArray(sourceItem);
+
+			if (reverse) {
+				for (i = sourceItem.length - 1; i >= 0; i--) {
+					domManipulate(targetNodes, sourceItem[i], callback, reverse);
+				}
+			} else {
+				for (i = 0; i < sourceItem.length; i++) {
+					domManipulate(targetNodes, sourceItem[i], callback, reverse);
+				}
+			}
+
+			return targetNodes;
+		}
+
+		if (sourceItem.nodeType) {
+			i = targetNodes.length;
+			while (i--) {
+				callback.call(targetNodes[i], sourceItem);
+			}
+		}
+
+		return targetNodes;
+	}
+
+	function hasClass(node, className) {
+		return node && className && (' ' + node.className + ' ').indexOf(' ' + className + ' ') !== -1;
+	}
+
+	function wrap(elements, wrapper, all) {
+		var lastParent, newWrapper;
+
+		wrapper = DomQuery(wrapper)[0];
+
+		elements.each(function() {
+			var self = this;
+
+			if (!all || lastParent != self.parentNode) {
+				lastParent = self.parentNode;
+				newWrapper = wrapper.cloneNode(false);
+				self.parentNode.insertBefore(newWrapper, self);
+				newWrapper.appendChild(self);
+			} else {
+				newWrapper.appendChild(self);
+			}
+		});
+
+		return elements;
+	}
+
+	var numericCssMap = Tools.makeMap('fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom', ' ');
+	var booleanMap = Tools.makeMap('checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected', ' ');
+	var propFix = {
+		'for': 'htmlFor',
+		'class': 'className',
+		'readonly': 'readOnly'
+	};
+	var cssFix = {
+		'float': 'cssFloat'
+	};
+
+	var attrHooks = {}, cssHooks = {};
+
+	function DomQuery(selector, context) {
+		/*eslint new-cap:0 */
+		return new DomQuery.fn.init(selector, context);
+	}
+
+	function inArray(item, array) {
+		var i;
+
+		if (array.indexOf) {
+			return array.indexOf(item);
+		}
+
+		i = array.length;
+		while (i--) {
+			if (array[i] === item) {
+				return i;
+			}
+		}
+
+		return -1;
+	}
+
+	var whiteSpaceRegExp = /^\s*|\s*$/g;
+
+	function trim(str) {
+		return (str === null || str === undef) ? '' : ("" + str).replace(whiteSpaceRegExp, '');
+	}
+
+	function each(obj, callback) {
+		var length, key, i, undef, value;
+
+		if (obj) {
+			length = obj.length;
+
+			if (length === undef) {
+				// Loop object items
+				for (key in obj) {
+					if (obj.hasOwnProperty(key)) {
+						value = obj[key];
+						if (callback.call(value, key, value) === false) {
+							break;
+						}
+					}
+				}
+			} else {
+				// Loop array items
+				for (i = 0; i < length; i++) {
+					value = obj[i];
+					if (callback.call(value, i, value) === false) {
+						break;
+					}
+				}
+			}
+		}
+
+		return obj;
+	}
+
+	function grep(array, callback) {
+		var out = [];
+
+		each(array, function(i, item) {
+			if (callback(item, i)) {
+				out.push(item);
+			}
+		});
+
+		return out;
+	}
+
+	function getElementDocument(element) {
+		if (!element) {
+			return doc;
+		}
+
+		if (element.nodeType == 9) {
+			return element;
+		}
+
+		return element.ownerDocument;
+	}
+
+	DomQuery.fn = DomQuery.prototype = {
+		constructor: DomQuery,
+
+		/**
+		 * Selector for the current set.
+		 *
+		 * @property selector
+		 * @type String
+		 */
+		selector: "",
+
+		/**
+		 * Context used to create the set.
+		 *
+		 * @property context
+		 * @type Element
+		 */
+		context: null,
+
+		/**
+		 * Number of items in the current set.
+		 *
+		 * @property length
+		 * @type Number
+		 */
+		length: 0,
+
+		/**
+		 * Constructs a new DomQuery instance with the specified selector or context.
+		 *
+		 * @constructor
+		 * @method init
+		 * @param {String/Array/DomQuery} selector Optional CSS selector/Array or array like object or HTML string.
+		 * @param {Document/Element} context Optional context to search in.
+		 */
+		init: function(selector, context) {
+			var self = this, match, node;
+
+			if (!selector) {
+				return self;
+			}
+
+			if (selector.nodeType) {
+				self.context = self[0] = selector;
+				self.length = 1;
+
+				return self;
+			}
+
+			if (context && context.nodeType) {
+				self.context = context;
+			} else {
+				if (context) {
+					return DomQuery(selector).attr(context);
+				} else {
+					self.context = context = document;
+				}
+			}
+
+			if (isString(selector)) {
+				self.selector = selector;
+
+				if (selector.charAt(0) === "<" && selector.charAt(selector.length - 1) === ">" && selector.length >= 3) {
+					match = [null, selector, null];
+				} else {
+					match = rquickExpr.exec(selector);
+				}
+
+				if (match) {
+					if (match[1]) {
+						node = createFragment(selector, getElementDocument(context)).firstChild;
+
+						while (node) {
+							push.call(self, node);
+							node = node.nextSibling;
+						}
+					} else {
+						node = getElementDocument(context).getElementById(match[2]);
+
+						if (!node) {
+							return self;
+						}
+
+						if (node.id !== match[2]) {
+							return self.find(selector);
+						}
+
+						self.length = 1;
+						self[0] = node;
+					}
+				} else {
+					return DomQuery(context).find(selector);
+				}
+			} else {
+				this.add(selector, false);
+			}
+
+			return self;
+		},
+
+		/**
+		 * Converts the current set to an array.
+		 *
+		 * @method toArray
+		 * @param {Array} Array of all nodes in set.
+		 */
+		toArray: function() {
+			return Tools.toArray(this);
+		},
+
+		/**
+		 * Adds new nodes to the set.
+		 *
+		 * @method add
+		 * @param {Array/tinymce.dom.DomQuery} items Array of all nodes to add to set.
+		 * @return {tinymce.dom.DomQuery} New instance with nodes added.
+		 */
+		add: function(items, sort) {
+			var self = this, nodes, i;
+
+			if (isString(items)) {
+				return self.add(DomQuery(items));
+			}
+
+			if (sort !== false) {
+				nodes = DomQuery.unique(self.toArray().concat(DomQuery.makeArray(items)));
+				self.length = nodes.length;
+				for (i = 0; i < nodes.length; i++) {
+					self[i] = nodes[i];
+				}
+			} else {
+				push.apply(self, DomQuery.makeArray(items));
+			}
+
+			return self;
+		},
+
+		/**
+		 * Sets/gets attributes on the elements in the current set.
+		 *
+		 * @method attr
+		 * @param {String/Object} name Name of attribute to get or an object with attributes to set.
+		 * @param {String} value Optional value to set.
+		 * @return {tinymce.dom.DomQuery/String} Current set or the specified attribute when only the name is specified.
+		 */
+		attr: function(name, value) {
+			var self = this, hook;
+
+			if (typeof name === "object") {
+				each(name, function(name, value) {
+					self.attr(name, value);
+				});
+			} else if (isDefined(value)) {
+				this.each(function() {
+					var hook;
+
+					if (this.nodeType === 1) {
+						hook = attrHooks[name];
+						if (hook && hook.set) {
+							hook.set(this, value);
+							return;
+						}
+
+						if (value === null) {
+							this.removeAttribute(name, 2);
+						} else {
+							this.setAttribute(name, value, 2);
+						}
+					}
+				});
+			} else {
+				if (self[0] && self[0].nodeType === 1) {
+					hook = attrHooks[name];
+					if (hook && hook.get) {
+						return hook.get(self[0], name);
+					}
+
+					if (booleanMap[name]) {
+						return self.prop(name) ? name : undef;
+					}
+
+					value = self[0].getAttribute(name, 2);
+
+					if (value === null) {
+						value = undef;
+					}
+				}
+
+				return value;
+			}
+
+			return self;
+		},
+
+		/**
+		 * Removes attributse on the elements in the current set.
+		 *
+		 * @method removeAttr
+		 * @param {String/Object} name Name of attribute to remove.
+		 * @return {tinymce.dom.DomQuery/String} Current set.
+		 */
+		removeAttr: function(name) {
+			return this.attr(name, null);
+		},
+
+		/**
+		 * Sets/gets properties on the elements in the current set.
+		 *
+		 * @method attr
+		 * @param {String/Object} name Name of property to get or an object with properties to set.
+		 * @param {String} value Optional value to set.
+		 * @return {tinymce.dom.DomQuery/String} Current set or the specified property when only the name is specified.
+		 */
+		prop: function(name, value) {
+			var self = this;
+
+			name = propFix[name] || name;
+
+			if (typeof name === "object") {
+				each(name, function(name, value) {
+					self.prop(name, value);
+				});
+			} else if (isDefined(value)) {
+				this.each(function() {
+					if (this.nodeType == 1) {
+						this[name] = value;
+					}
+				});
+			} else {
+				if (self[0] && self[0].nodeType && name in self[0]) {
+					return self[0][name];
+				}
+
+				return value;
+			}
+
+			return self;
+		},
+
+		/**
+		 * Sets/gets styles on the elements in the current set.
+		 *
+		 * @method css
+		 * @param {String/Object} name Name of style to get or an object with styles to set.
+		 * @param {String} value Optional value to set.
+		 * @return {tinymce.dom.DomQuery/String} Current set or the specified style when only the name is specified.
+		 */
+		css: function(name, value) {
+			var self = this, elm, hook;
+
+			function camel(name) {
+				return name.replace(/-(\D)/g, function(a, b) {
+					return b.toUpperCase();
+				});
+			}
+
+			function dashed(name) {
+				return name.replace(/[A-Z]/g, function(a) {
+					return '-' + a;
+				});
+			}
+
+			if (typeof name === "object") {
+				each(name, function(name, value) {
+					self.css(name, value);
+				});
+			} else {
+				if (isDefined(value)) {
+					name = camel(name);
+
+					// Default px suffix on these
+					if (typeof value === 'number' && !numericCssMap[name]) {
+						value += 'px';
+					}
+
+					self.each(function() {
+						var style = this.style;
+
+						hook = cssHooks[name];
+						if (hook && hook.set) {
+							hook.set(this, value);
+							return;
+						}
+
+						try {
+							this.style[cssFix[name] || name] = value;
+						} catch (ex) {
+							// Ignore
+						}
+
+						if (value === null || value === '') {
+							if (style.removeProperty) {
+								style.removeProperty(dashed(name));
+							} else {
+								style.removeAttribute(name);
+							}
+						}
+					});
+				} else {
+					elm = self[0];
+
+					hook = cssHooks[name];
+					if (hook && hook.get) {
+						return hook.get(elm);
+					}
+
+					if (elm.ownerDocument.defaultView) {
+						try {
+							return elm.ownerDocument.defaultView.getComputedStyle(elm, null).getPropertyValue(dashed(name));
+						} catch (ex) {
+							return undef;
+						}
+					} else if (elm.currentStyle) {
+						return elm.currentStyle[camel(name)];
+					}
+				}
+			}
+
+			return self;
+		},
+
+		/**
+		 * Removes all nodes in set from the document.
+		 *
+		 * @method remove
+		 * @return {tinymce.dom.DomQuery} Current set with the removed nodes.
+		 */
+		remove: function() {
+			var self = this, node, i = this.length;
+
+			while (i--) {
+				node = self[i];
+				Event.clean(node);
+
+				if (node.parentNode) {
+					node.parentNode.removeChild(node);
+				}
+			}
+
+			return this;
+		},
+
+		/**
+		 * Empties all elements in set.
+		 *
+		 * @method empty
+		 * @return {tinymce.dom.DomQuery} Current set with the empty nodes.
+		 */
+		empty: function() {
+			var self = this, node, i = this.length;
+
+			while (i--) {
+				node = self[i];
+				while (node.firstChild) {
+					node.removeChild(node.firstChild);
+				}
+			}
+
+			return this;
+		},
+
+		/**
+		 * Sets or gets the HTML of the current set or first set node.
+		 *
+		 * @method html
+		 * @param {String} value Optional innerHTML value to set on each element.
+		 * @return {tinymce.dom.DomQuery/String} Current set or the innerHTML of the first element.
+		 */
+		html: function(value) {
+			var self = this, i;
+
+			if (isDefined(value)) {
+				i = self.length;
+
+				try {
+					while (i--) {
+						self[i].innerHTML = value;
+					}
+				} catch (ex) {
+					// Workaround for "Unknown runtime error" when DIV is added to P on IE
+					DomQuery(self[i]).empty().append(value);
+				}
+
+				return self;
+			}
+
+			return self[0] ? self[0].innerHTML : '';
+		},
+
+		/**
+		 * Sets or gets the text of the current set or first set node.
+		 *
+		 * @method text
+		 * @param {String} value Optional innerText value to set on each element.
+		 * @return {tinymce.dom.DomQuery/String} Current set or the innerText of the first element.
+		 */
+		text: function(value) {
+			var self = this, i;
+
+			if (isDefined(value)) {
+				i = self.length;
+				while (i--) {
+					if ("innerText" in self[i]) {
+						self[i].innerText = value;
+					} else {
+						self[0].textContent = value;
+					}
+				}
+
+				return self;
+			}
+
+			return self[0] ? (self[0].innerText || self[0].textContent) : '';
+		},
+
+		/**
+		 * Appends the specified node/html or node set to the current set nodes.
+		 *
+		 * @method append
+		 * @param {String/Element/Array/tinymce.dom.DomQuery} content Content to append to each element in set.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		append: function() {
+			return domManipulate(this, arguments, function(node) {
+				if (this.nodeType === 1) {
+					this.appendChild(node);
+				}
+			});
+		},
+
+		/**
+		 * Prepends the specified node/html or node set to the current set nodes.
+		 *
+		 * @method prepend
+		 * @param {String/Element/Array/tinymce.dom.DomQuery} content Content to prepend to each element in set.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		prepend: function() {
+			return domManipulate(this, arguments, function(node) {
+				if (this.nodeType === 1) {
+					this.insertBefore(node, this.firstChild);
+				}
+			}, true);
+		},
+
+		/**
+		 * Adds the specified elements before current set nodes.
+		 *
+		 * @method before
+		 * @param {String/Element/Array/tinymce.dom.DomQuery} content Content to add before to each element in set.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		before: function() {
+			var self = this;
+
+			if (self[0] && self[0].parentNode) {
+				return domManipulate(self, arguments, function(node) {
+					this.parentNode.insertBefore(node, this);
+				});
+			}
+
+			return self;
+		},
+
+		/**
+		 * Adds the specified elements after current set nodes.
+		 *
+		 * @method after
+		 * @param {String/Element/Array/tinymce.dom.DomQuery} content Content to add after to each element in set.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		after: function() {
+			var self = this;
+
+			if (self[0] && self[0].parentNode) {
+				return domManipulate(self, arguments, function(node) {
+					this.parentNode.insertBefore(node, this.nextSibling);
+				}, true);
+			}
+
+			return self;
+		},
+
+		/**
+		 * Appends the specified set nodes to the specified selector/instance.
+		 *
+		 * @method appendTo
+		 * @param {String/Element/Array/tinymce.dom.DomQuery} val Item to append the current set to.
+		 * @return {tinymce.dom.DomQuery} Current set with the appended nodes.
+		 */
+		appendTo: function(val) {
+			DomQuery(val).append(this);
+
+			return this;
+		},
+
+		/**
+		 * Prepends the specified set nodes to the specified selector/instance.
+		 *
+		 * @method prependTo
+		 * @param {String/Element/Array/tinymce.dom.DomQuery} val Item to prepend the current set to.
+		 * @return {tinymce.dom.DomQuery} Current set with the prepended nodes.
+		 */
+		prependTo: function(val) {
+			DomQuery(val).prepend(this);
+
+			return this;
+		},
+
+		/**
+		 * Replaces the nodes in set with the specified content.
+		 *
+		 * @method replaceWith
+		 * @param {String/Element/Array/tinymce.dom.DomQuery} content Content to replace nodes with.
+		 * @return {tinymce.dom.DomQuery} Set with replaced nodes.
+		 */
+		replaceWith: function(content) {
+			return this.before(content).remove();
+		},
+
+		/**
+		 * Wraps all elements in set with the specified wrapper.
+		 *
+		 * @method wrap
+		 * @param {String/Element/Array/tinymce.dom.DomQuery} content Content to wrap nodes with.
+		 * @return {tinymce.dom.DomQuery} Set with wrapped nodes.
+		 */
+		wrap: function(wrapper) {
+			return wrap(this, wrapper);
+		},
+
+		/**
+		 * Wraps all nodes in set with the specified wrapper. If the nodes are siblings all of them
+		 * will be wrapped in the same wrapper.
+		 *
+		 * @method wrapAll
+		 * @param {String/Element/Array/tinymce.dom.DomQuery} content Content to wrap nodes with.
+		 * @return {tinymce.dom.DomQuery} Set with wrapped nodes.
+		 */
+		wrapAll: function(wrapper) {
+			return wrap(this, wrapper, true);
+		},
+
+		/**
+		 * Wraps all elements inner contents in set with the specified wrapper.
+		 *
+		 * @method wrapInner
+		 * @param {String/Element/Array/tinymce.dom.DomQuery} content Content to wrap nodes with.
+		 * @return {tinymce.dom.DomQuery} Set with wrapped nodes.
+		 */
+		wrapInner: function(wrapper) {
+			this.each(function() {
+				DomQuery(this).contents().wrapAll(wrapper);
+			});
+
+			return this;
+		},
+
+		/**
+		 * Unwraps all elements by removing the parent element of each item in set.
+		 *
+		 * @method unwrap
+		 * @return {tinymce.dom.DomQuery} Set with unwrapped nodes.
+		 */
+		unwrap: function() {
+			return this.parent().each(function() {
+				DomQuery(this).replaceWith(this.childNodes);
+			});
+		},
+
+		/**
+		 * Clones all nodes in set.
+		 *
+		 * @method clone
+		 * @return {tinymce.dom.DomQuery} Set with cloned nodes.
+		 */
+		clone: function() {
+			var result = [];
+
+			this.each(function() {
+				result.push(this.cloneNode(true));
+			});
+
+			return DomQuery(result);
+		},
+
+		/**
+		 * Adds the specified class name to the current set elements.
+		 *
+		 * @method addClass
+		 * @param {String} className Class name to add.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		addClass: function(className) {
+			return this.toggleClass(className, true);
+		},
+
+		/**
+		 * Removes the specified class name to the current set elements.
+		 *
+		 * @method removeClass
+		 * @param {String} className Class name to remove.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		removeClass: function(className) {
+			return this.toggleClass(className, false);
+		},
+
+		/**
+		 * Toggles the specified class name on the current set elements.
+		 *
+		 * @method toggleClass
+		 * @param {String} className Class name to add/remove.
+		 * @param {Boolean} state Optional state to toggle on/off.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		toggleClass: function(className, state) {
+			var self = this;
+
+			// Functions are not supported
+			if (typeof className != 'string') {
+				return self;
+			}
+
+			if (className.indexOf(' ') !== -1) {
+				each(className.split(' '), function() {
+					self.toggleClass(this, state);
+				});
+			} else {
+				self.each(function(index, node) {
+					var existingClassName, classState;
+
+					classState = hasClass(node, className);
+					if (classState !== state) {
+						existingClassName = node.className;
+
+						if (classState) {
+							node.className = trim((" " + existingClassName + " ").replace(' ' + className + ' ', ' '));
+						} else {
+							node.className += existingClassName ? ' ' + className : className;
+						}
+					}
+				});
+			}
+
+			return self;
+		},
+
+		/**
+		 * Returns true/false if the first item in set has the specified class.
+		 *
+		 * @method hasClass
+		 * @param {String} className Class name to check for.
+		 * @return {Boolean} True/false if the set has the specified class.
+		 */
+		hasClass: function(className) {
+			return hasClass(this[0], className);
+		},
+
+		/**
+		 * Executes the callback function for each item DomQuery collection. If you return false in the
+		 * callback it will break the loop.
+		 *
+		 * @method each
+		 * @param {function} callback Callback function to execute for each item.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		each: function(callback) {
+			return each(this, callback);
+		},
+
+		/**
+		 * Binds an event with callback function to the elements in set.
+		 *
+		 * @method on
+		 * @param {String} name Name of the event to bind.
+		 * @param {function} callback Callback function to execute when the event occurs.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		on: function(name, callback) {
+			return this.each(function() {
+				Event.bind(this, name, callback);
+			});
+		},
+
+		/**
+		 * Unbinds an event with callback function to the elements in set.
+		 *
+		 * @method off
+		 * @param {String} name Optional name of the event to bind.
+		 * @param {function} callback Optional callback function to execute when the event occurs.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		off: function(name, callback) {
+			return this.each(function() {
+				Event.unbind(this, name, callback);
+			});
+		},
+
+		/**
+		 * Triggers the specified event by name or event object.
+		 *
+		 * @method trigger
+		 * @param {String/Object} name Name of the event to trigger or event object.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		trigger: function(name) {
+			return this.each(function() {
+				if (typeof name == 'object') {
+					Event.fire(this, name.type, name);
+				} else {
+					Event.fire(this, name);
+				}
+			});
+		},
+
+		/**
+		 * Shows all elements in set.
+		 *
+		 * @method show
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		show: function() {
+			return this.css('display', '');
+		},
+
+		/**
+		 * Hides all elements in set.
+		 *
+		 * @method hide
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		hide: function() {
+			return this.css('display', 'none');
+		},
+
+		/**
+		 * Slices the current set.
+		 *
+		 * @method slice
+		 * @param {Number} start Start index to slice at.
+		 * @param {Number} end Optional ened index to end slice at.
+		 * @return {tinymce.dom.DomQuery} Sliced set.
+		 */
+		slice: function() {
+			return new DomQuery(slice.apply(this, arguments));
+		},
+
+		/**
+		 * Makes the set equal to the specified index.
+		 *
+		 * @method eq
+		 * @param {Number} index Index to set it equal to.
+		 * @return {tinymce.dom.DomQuery} Single item set.
+		 */
+		eq: function(index) {
+			return index === -1 ? this.slice(index) : this.slice(index, +index + 1);
+		},
+
+		/**
+		 * Makes the set equal to first element in set.
+		 *
+		 * @method first
+		 * @return {tinymce.dom.DomQuery} Single item set.
+		 */
+		first: function() {
+			return this.eq(0);
+		},
+
+		/**
+		 * Makes the set equal to last element in set.
+		 *
+		 * @method last
+		 * @return {tinymce.dom.DomQuery} Single item set.
+		 */
+		last: function() {
+			return this.eq(-1);
+		},
+
+		/**
+		 * Finds elements by the specified selector for each element in set.
+		 *
+		 * @method find
+		 * @param {String} selector Selector to find elements by.
+		 * @return {tinymce.dom.DomQuery} Set with matches elements.
+		 */
+		find: function(selector) {
+			var i, l, ret = [];
+
+			for (i = 0, l = this.length; i < l; i++) {
+				DomQuery.find(selector, this[i], ret);
+			}
+
+			return DomQuery(ret);
+		},
+
+		/**
+		 * Filters the current set with the specified selector.
+		 *
+		 * @method filter
+		 * @param {String/function} selector Selector to filter elements by.
+		 * @return {tinymce.dom.DomQuery} Set with filtered elements.
+		 */
+		filter: function(selector) {
+			if (typeof selector == 'function') {
+				return DomQuery(grep(this.toArray(), function(item, i) {
+					return selector(i, item);
+				}));
+			}
+
+			return DomQuery(DomQuery.filter(selector, this.toArray()));
+		},
+
+		/**
+		 * Gets the current node or any partent matching the specified selector.
+		 *
+		 * @method closest
+		 * @param {String/Element/tinymce.dom.DomQuery} selector Selector or element to find.
+		 * @return {tinymce.dom.DomQuery} Set with closest elements.
+		 */
+		closest: function(selector) {
+			var result = [];
+
+			if (selector instanceof DomQuery) {
+				selector = selector[0];
+			}
+
+			this.each(function(i, node) {
+				while (node) {
+					if (typeof selector == 'string' && DomQuery(node).is(selector)) {
+						result.push(node);
+						break;
+					} else if (node == selector) {
+						result.push(node);
+						break;
+					}
+
+					node = node.parentNode;
+				}
+			});
+
+			return DomQuery(result);
+		},
+
+		/**
+		 * Returns the offset of the first element in set or sets the top/left css properties of all elements in set.
+		 *
+		 * @method offset
+		 * @param {Object} offset Optional offset object to set on each item.
+		 * @return {Object/tinymce.dom.DomQuery} Returns the first element offset or the current set if you specified an offset.
+		 */
+		offset: function(offset) {
+			var elm, doc, docElm;
+			var x = 0, y = 0, pos;
+
+			if (!offset) {
+				elm = this[0];
+
+				if (elm) {
+					doc = elm.ownerDocument;
+					docElm = doc.documentElement;
+
+					if (elm.getBoundingClientRect) {
+						pos = elm.getBoundingClientRect();
+						x = pos.left + (docElm.scrollLeft || doc.body.scrollLeft) - docElm.clientLeft;
+						y = pos.top + (docElm.scrollTop || doc.body.scrollTop) - docElm.clientTop;
+					}
+				}
+
+				return {
+					left: x,
+					top: y
+				};
+			}
+
+			return this.css(offset);
+		},
+
+		push: push,
+		sort: [].sort,
+		splice: [].splice
+	};
+
+	// Static members
+	Tools.extend(DomQuery, {
+		/**
+		 * Extends the specified object with one or more objects.
+		 *
+		 * @static
+		 * @method extend
+		 * @param {Object} target Target object to extend with new items.
+		 * @param {Object..} object Object to extend the target with.
+		 * @return {Object} Extended input object.
+		 */
+		extend: Tools.extend,
+
+		/**
+		 * Creates an array out of an array like object.
+		 *
+		 * @static
+		 * @method makeArray
+		 * @param {Object} object Object to convert to array.
+		 * @return {Arrau} Array produced from object.
+		 */
+		makeArray: function(array) {
+			if (isWindow(array) || array.nodeType) {
+				return [array];
+			}
+
+			return Tools.toArray(array);
+		},
+
+		/**
+		 * Returns the index of the specified item inside the array.
+		 *
+		 * @static
+		 * @method inArray
+		 * @param {Object} item Item to look for.
+		 * @param {Array} array Array to look for item in.
+		 * @return {Number} Index of the item or -1.
+		 */
+		inArray: inArray,
+
+		/**
+		 * Returns true/false if the specified object is an array or not.
+		 *
+		 * @static
+		 * @method isArray
+		 * @param {Object} array Object to check if it's an array or not.
+		 * @return {Boolean} True/false if the object is an array.
+		 */
+		isArray: Tools.isArray,
+
+		/**
+		 * Executes the callback function for each item in array/object. If you return false in the
+		 * callback it will break the loop.
+		 *
+		 * @static
+		 * @method each
+		 * @param {Object} obj Object to iterate.
+		 * @param {function} callback Callback function to execute for each item.
+		 */
+		each: each,
+
+		/**
+		 * Removes whitespace from the beginning and end of a string.
+		 *
+		 * @static
+		 * @method trim
+		 * @param {String} str String to remove whitespace from.
+		 * @return {String} New string with removed whitespace.
+		 */
+		trim: trim,
+
+		/**
+		 * Filters out items from the input array by calling the specified function for each item.
+		 * If the function returns false the item will be excluded if it returns true it will be included.
+		 *
+		 * @static
+		 * @method grep
+		 * @param {Array} array Array of items to loop though.
+		 * @param {function} callback Function to call for each item. Include/exclude depends on it's return value.
+		 * @return {Array} New array with values imported and filtered based in input.
+		 * @example
+		 * // Filter out some items, this will return an array with 4 and 5
+		 * var items = DomQuery.grep([1, 2, 3, 4, 5], function(v) {return v > 3;});
+		 */
+		grep: grep,
+
+		// Sizzle
+		find: Sizzle,
+		expr: Sizzle.selectors,
+		unique: Sizzle.uniqueSort,
+		text: Sizzle.getText,
+		contains: Sizzle.contains,
+		filter: function(expr, elems, not) {
+			var i = elems.length;
+
+			if (not) {
+				expr = ":not(" + expr + ")";
+			}
+
+			while (i--) {
+				if (elems[i].nodeType != 1) {
+					elems.splice(i, 1);
+				}
+			}
+
+			if (elems.length === 1) {
+				elems = DomQuery.find.matchesSelector(elems[0], expr) ? [elems[0]] : [];
+			} else {
+				elems = DomQuery.find.matches(expr, elems);
+			}
+
+			return elems;
+		}
+	});
+
+	function dir(el, prop, until) {
+		var matched = [], cur = el[prop];
+
+		if (typeof until != 'string' && until instanceof DomQuery) {
+			until = until[0];
+		}
+
+		while (cur && cur.nodeType !== 9) {
+			if (until !== undefined) {
+				if (cur === until) {
+					break;
+				}
+
+				if (typeof until == 'string' && DomQuery(cur).is(until)) {
+					break;
+				}
+			}
+
+			if (cur.nodeType === 1) {
+				matched.push(cur);
+			}
+
+			cur = cur[prop];
+		}
+
+		return matched;
+	}
+
+	function sibling(node, siblingName, nodeType, until) {
+		var result = [];
+
+		if (until instanceof DomQuery) {
+			until = until[0];
+		}
+
+		for (; node; node = node[siblingName]) {
+			if (nodeType && node.nodeType !== nodeType) {
+				continue;
+			}
+
+			if (until !== undefined) {
+				if (node === until) {
+					break;
+				}
+
+				if (typeof until == 'string' && DomQuery(node).is(until)) {
+					break;
+				}
+			}
+
+			result.push(node);
+		}
+
+		return result;
+	}
+
+	function firstSibling(node, siblingName, nodeType) {
+		for (node = node[siblingName]; node; node = node[siblingName]) {
+			if (node.nodeType == nodeType) {
+				return node;
+			}
+		}
+
+		return null;
+	}
+
+	each({
+		/**
+		 * Returns a new collection with the parent of each item in current collection matching the optional selector.
+		 *
+		 * @method parent
+		 * @param {String} selector Selector to match parents agains.
+		 * @return {tinymce.dom.DomQuery} New DomQuery instance with all matching parents.
+		 */
+		parent: function(node) {
+			var parent = node.parentNode;
+
+			return parent && parent.nodeType !== 11 ? parent : null;
+		},
+
+		/**
+		 * Returns a new collection with the all the parents of each item in current collection matching the optional selector.
+		 *
+		 * @method parents
+		 * @param {String} selector Selector to match parents agains.
+		 * @return {tinymce.dom.DomQuery} New DomQuery instance with all matching parents.
+		 */
+		parents: function(node) {
+			return dir(node, "parentNode");
+		},
+
+		/**
+		 * Returns a new collection with next sibling of each item in current collection matching the optional selector.
+		 *
+		 * @method next
+		 * @param {String} selector Selector to match the next element against.
+		 * @return {tinymce.dom.DomQuery} New DomQuery instance with all matching elements.
+		 */
+		next: function(node) {
+			return firstSibling(node, 'nextSibling', 1);
+		},
+
+		/**
+		 * Returns a new collection with previous sibling of each item in current collection matching the optional selector.
+		 *
+		 * @method prev
+		 * @param {String} selector Selector to match the previous element against.
+		 * @return {tinymce.dom.DomQuery} New DomQuery instance with all matching elements.
+		 */
+		prev: function(node) {
+			return firstSibling(node, 'previousSibling', 1);
+		},
+
+		/**
+		 * Returns all child elements matching the optional selector.
+		 *
+		 * @method children
+		 * @param {String} selector Selector to match the elements against.
+		 * @return {tinymce.dom.DomQuery} New DomQuery instance with all matching elements.
+		 */
+		children: function(node) {
+			return sibling(node.firstChild, 'nextSibling', 1);
+		},
+
+		/**
+		 * Returns all child nodes matching the optional selector.
+		 *
+		 * @method contents
+		 * @return {tinymce.dom.DomQuery} New DomQuery instance with all matching elements.
+		 */
+		contents: function(node) {
+			return Tools.toArray((node.nodeName === "iframe" ? node.contentDocument || node.contentWindow.document : node).childNodes);
+		}
+	}, function(name, fn) {
+		DomQuery.fn[name] = function(selector) {
+			var self = this, result = [];
+
+			self.each(function() {
+				var nodes = fn.call(result, this, selector, result);
+
+				if (nodes) {
+					if (DomQuery.isArray(nodes)) {
+						result.push.apply(result, nodes);
+					} else {
+						result.push(nodes);
+					}
+				}
+			});
+
+			// If traversing on multiple elements we might get the same elements twice
+			if (this.length > 1) {
+				result = DomQuery.unique(result);
+
+				if (name.indexOf('parents') === 0) {
+					result = result.reverse();
+				}
+			}
+
+			result = DomQuery(result);
+
+			if (selector) {
+				return result.filter(selector);
+			}
+
+			return result;
+		};
+	});
+
+	each({
+		/**
+		 * Returns a new collection with the all the parents until the matching selector/element
+		 * of each item in current collection matching the optional selector.
+		 *
+		 * @method parentsUntil
+		 * @param {String/Element/tinymce.dom.DomQuery} until Until the matching selector or element.
+		 * @return {tinymce.dom.DomQuery} New DomQuery instance with all matching parents.
+		 */
+		parentsUntil: function(node, until) {
+			return dir(node, "parentNode", until);
+		},
+
+		/**
+		 * Returns a new collection with all next siblings of each item in current collection matching the optional selector.
+		 *
+		 * @method nextUntil
+		 * @param {String/Element/tinymce.dom.DomQuery} until Until the matching selector or element.
+		 * @return {tinymce.dom.DomQuery} New DomQuery instance with all matching elements.
+		 */
+		nextUntil: function(node, until) {
+			return sibling(node, 'nextSibling', 1, until).slice(1);
+		},
+
+		/**
+		 * Returns a new collection with all previous siblings of each item in current collection matching the optional selector.
+		 *
+		 * @method prevUntil
+		 * @param {String/Element/tinymce.dom.DomQuery} until Until the matching selector or element.
+		 * @return {tinymce.dom.DomQuery} New DomQuery instance with all matching elements.
+		 */
+		prevUntil: function(node, until) {
+			return sibling(node, 'previousSibling', 1, until).slice(1);
+		}
+	}, function(name, fn) {
+		DomQuery.fn[name] = function(selector, filter) {
+			var self = this, result = [];
+
+			self.each(function() {
+				var nodes = fn.call(result, this, selector, result);
+
+				if (nodes) {
+					if (DomQuery.isArray(nodes)) {
+						result.push.apply(result, nodes);
+					} else {
+						result.push(nodes);
+					}
+				}
+			});
+
+			// If traversing on multiple elements we might get the same elements twice
+			if (this.length > 1) {
+				result = DomQuery.unique(result);
+
+				if (name.indexOf('parents') === 0 || name === 'prevUntil') {
+					result = result.reverse();
+				}
+			}
+
+			result = DomQuery(result);
+
+			if (filter) {
+				return result.filter(filter);
+			}
+
+			return result;
+		};
+	});
+
+	/**
+	 * Returns true/false if the current set items matches the selector.
+	 *
+	 * @method is
+	 * @param {String} selector Selector to match the elements against.
+	 * @return {Boolean} True/false if the current set matches the selector.
+	 */
+	DomQuery.fn.is = function(selector) {
+		return !!selector && this.filter(selector).length > 0;
+	};
+
+	DomQuery.fn.init.prototype = DomQuery.fn;
+
+	DomQuery.overrideDefaults = function(callback) {
+		var defaults;
+
+		function sub(selector, context) {
+			defaults = defaults || callback();
+
+			if (arguments.length === 0) {
+				selector = defaults.element;
+			}
+
+			if (!context) {
+				context = defaults.context;
+			}
+
+			return new sub.fn.init(selector, context);
+		}
+
+		DomQuery.extend(sub, this);
+
+		return sub;
+	};
+
+	function appendHooks(targetHooks, prop, hooks) {
+		each(hooks, function(name, func) {
+			targetHooks[name] = targetHooks[name] || {};
+			targetHooks[name][prop] = func;
+		});
+	}
+
+	if (Env.ie && Env.ie < 8) {
+		appendHooks(attrHooks, 'get', {
+			maxlength: function(elm) {
+				var value = elm.maxLength;
+
+				if (value === 0x7fffffff) {
+					return undef;
+				}
+
+				return value;
+			},
+
+			size: function(elm) {
+				var value = elm.size;
+
+				if (value === 20) {
+					return undef;
+				}
+
+				return value;
+			},
+
+			'class': function(elm) {
+				return elm.className;
+			},
+
+			style: function(elm) {
+				var value = elm.style.cssText;
+
+				if (value.length === 0) {
+					return undef;
+				}
+
+				return value;
+			}
+		});
+
+		appendHooks(attrHooks, 'set', {
+			'class': function(elm, value) {
+				elm.className = value;
+			},
+
+			style: function(elm, value) {
+				elm.style.cssText = value;
+			}
+		});
+	}
+
+	if (Env.ie && Env.ie < 9) {
+		/*jshint sub:true */
+		/*eslint dot-notation: 0*/
+		cssFix['float'] = 'styleFloat';
+
+		appendHooks(cssHooks, 'set', {
+			opacity: function(elm, value) {
+				var style = elm.style;
+
+				if (value === null || value === '') {
+					style.removeAttribute('filter');
+				} else {
+					style.zoom = 1;
+					style.filter = 'alpha(opacity=' + (value * 100) + ')';
+				}
+			}
+		});
+	}
+
+	DomQuery.attrHooks = attrHooks;
+	DomQuery.cssHooks = cssHooks;
+
+	return DomQuery;
+});
+
+// Included from: js/tinymce/classes/html/Styles.js
+
+/**
+ * Styles.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is used to parse CSS styles it also compresses styles to reduce the output size.
+ *
+ * @example
+ * var Styles = new tinymce.html.Styles({
+ *    url_converter: function(url) {
+ *       return url;
+ *    }
+ * });
+ *
+ * styles = Styles.parse('border: 1px solid red');
+ * styles.color = 'red';
+ *
+ * console.log(new tinymce.html.StyleSerializer().serialize(styles));
+ *
+ * @class tinymce.html.Styles
+ * @version 3.4
+ */
+define("tinymce/html/Styles", [], function() {
+	return function(settings, schema) {
+		/*jshint maxlen:255 */
+		/*eslint max-len:0 */
+		var rgbRegExp = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,
+			urlOrStrRegExp = /(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,
+			styleRegExp = /\s*([^:]+):\s*([^;]+);?/g,
+			trimRightRegExp = /\s+$/,
+			undef, i, encodingLookup = {}, encodingItems, validStyles, invalidStyles, invisibleChar = '\uFEFF';
+
+		settings = settings || {};
+
+		if (schema) {
+			validStyles = schema.getValidStyles();
+			invalidStyles = schema.getInvalidStyles();
+		}
+
+		encodingItems = ('\\" \\\' \\; \\: ; : ' + invisibleChar).split(' ');
+		for (i = 0; i < encodingItems.length; i++) {
+			encodingLookup[encodingItems[i]] = invisibleChar + i;
+			encodingLookup[invisibleChar + i] = encodingItems[i];
+		}
+
+		function toHex(match, r, g, b) {
+			function hex(val) {
+				val = parseInt(val, 10).toString(16);
+
+				return val.length > 1 ? val : '0' + val; // 0 -> 00
+			}
+
+			return '#' + hex(r) + hex(g) + hex(b);
+		}
+
+		return {
+			/**
+			 * Parses the specified RGB color value and returns a hex version of that color.
+			 *
+			 * @method toHex
+			 * @param {String} color RGB string value like rgb(1,2,3)
+			 * @return {String} Hex version of that RGB value like #FF00FF.
+			 */
+			toHex: function(color) {
+				return color.replace(rgbRegExp, toHex);
+			},
+
+			/**
+			 * Parses the specified style value into an object collection. This parser will also
+			 * merge and remove any redundant items that browsers might have added. It will also convert non hex
+			 * colors to hex values. Urls inside the styles will also be converted to absolute/relative based on settings.
+			 *
+			 * @method parse
+			 * @param {String} css Style value to parse for example: border:1px solid red;.
+			 * @return {Object} Object representation of that style like {border: '1px solid red'}
+			 */
+			parse: function(css) {
+				var styles = {}, matches, name, value, isEncoded, urlConverter = settings.url_converter;
+				var urlConverterScope = settings.url_converter_scope || this;
+
+				function compress(prefix, suffix, noJoin) {
+					var top, right, bottom, left;
+
+					top = styles[prefix + '-top' + suffix];
+					if (!top) {
+						return;
+					}
+
+					right = styles[prefix + '-right' + suffix];
+					if (!right) {
+						return;
+					}
+
+					bottom = styles[prefix + '-bottom' + suffix];
+					if (!bottom) {
+						return;
+					}
+
+					left = styles[prefix + '-left' + suffix];
+					if (!left) {
+						return;
+					}
+
+					var box = [top, right, bottom, left];
+					i = box.length - 1;
+					while (i--) {
+						if (box[i] !== box[i + 1]) {
+							break;
+						}
+					}
+
+					if (i > -1 && noJoin) {
+						return;
+					}
+
+					styles[prefix + suffix] = i == -1 ? box[0] : box.join(' ');
+					delete styles[prefix + '-top' + suffix];
+					delete styles[prefix + '-right' + suffix];
+					delete styles[prefix + '-bottom' + suffix];
+					delete styles[prefix + '-left' + suffix];
+				}
+
+				/**
+				 * Checks if the specific style can be compressed in other words if all border-width are equal.
+				 */
+				function canCompress(key) {
+					var value = styles[key], i;
+
+					if (!value) {
+						return;
+					}
+
+					value = value.split(' ');
+					i = value.length;
+					while (i--) {
+						if (value[i] !== value[0]) {
+							return false;
+						}
+					}
+
+					styles[key] = value[0];
+
+					return true;
+				}
+
+				/**
+				 * Compresses multiple styles into one style.
+				 */
+				function compress2(target, a, b, c) {
+					if (!canCompress(a)) {
+						return;
+					}
+
+					if (!canCompress(b)) {
+						return;
+					}
+
+					if (!canCompress(c)) {
+						return;
+					}
+
+					// Compress
+					styles[target] = styles[a] + ' ' + styles[b] + ' ' + styles[c];
+					delete styles[a];
+					delete styles[b];
+					delete styles[c];
+				}
+
+				// Encodes the specified string by replacing all \" \' ; : with _<num>
+				function encode(str) {
+					isEncoded = true;
+
+					return encodingLookup[str];
+				}
+
+				// Decodes the specified string by replacing all _<num> with it's original value \" \' etc
+				// It will also decode the \" \' if keep_slashes is set to fale or omitted
+				function decode(str, keep_slashes) {
+					if (isEncoded) {
+						str = str.replace(/\uFEFF[0-9]/g, function(str) {
+							return encodingLookup[str];
+						});
+					}
+
+					if (!keep_slashes) {
+						str = str.replace(/\\([\'\";:])/g, "$1");
+					}
+
+					return str;
+				}
+
+				function processUrl(match, url, url2, url3, str, str2) {
+					str = str || str2;
+
+					if (str) {
+						str = decode(str);
+
+						// Force strings into single quote format
+						return "'" + str.replace(/\'/g, "\\'") + "'";
+					}
+
+					url = decode(url || url2 || url3);
+
+					if (!settings.allow_script_urls) {
+						var scriptUrl = url.replace(/[\s\r\n]+/, '');
+
+						if (/(java|vb)script:/i.test(scriptUrl)) {
+							return "";
+						}
+
+						if (!settings.allow_svg_data_urls && /^data:image\/svg/i.test(scriptUrl)) {
+							return "";
+						}
+					}
+
+					// Convert the URL to relative/absolute depending on config
+					if (urlConverter) {
+						url = urlConverter.call(urlConverterScope, url, 'style');
+					}
+
+					// Output new URL format
+					return "url('" + url.replace(/\'/g, "\\'") + "')";
+				}
+
+				if (css) {
+					css = css.replace(/[\u0000-\u001F]/g, '');
+
+					// Encode \" \' % and ; and : inside strings so they don't interfere with the style parsing
+					css = css.replace(/\\[\"\';:\uFEFF]/g, encode).replace(/\"[^\"]+\"|\'[^\']+\'/g, function(str) {
+						return str.replace(/[;:]/g, encode);
+					});
+
+					// Parse styles
+					while ((matches = styleRegExp.exec(css))) {
+						name = matches[1].replace(trimRightRegExp, '').toLowerCase();
+						value = matches[2].replace(trimRightRegExp, '');
+
+						// Decode escaped sequences like \65 -> e
+						/*jshint loopfunc:true*/
+						/*eslint no-loop-func:0 */
+						value = value.replace(/\\[0-9a-f]+/g, function(e) {
+							return String.fromCharCode(parseInt(e.substr(1), 16));
+						});
+
+						if (name && value.length > 0) {
+							// Don't allow behavior name or expression/comments within the values
+							if (!settings.allow_script_urls && (name == "behavior" || /expression\s*\(|\/\*|\*\//.test(value))) {
+								continue;
+							}
+
+							// Opera will produce 700 instead of bold in their style values
+							if (name === 'font-weight' && value === '700') {
+								value = 'bold';
+							} else if (name === 'color' || name === 'background-color') { // Lowercase colors like RED
+								value = value.toLowerCase();
+							}
+
+							// Convert RGB colors to HEX
+							value = value.replace(rgbRegExp, toHex);
+
+							// Convert URLs and force them into url('value') format
+							value = value.replace(urlOrStrRegExp, processUrl);
+							styles[name] = isEncoded ? decode(value, true) : value;
+						}
+
+						styleRegExp.lastIndex = matches.index + matches[0].length;
+					}
+					// Compress the styles to reduce it's size for example IE will expand styles
+					compress("border", "", true);
+					compress("border", "-width");
+					compress("border", "-color");
+					compress("border", "-style");
+					compress("padding", "");
+					compress("margin", "");
+					compress2('border', 'border-width', 'border-style', 'border-color');
+
+					// Remove pointless border, IE produces these
+					if (styles.border === 'medium none') {
+						delete styles.border;
+					}
+
+					// IE 11 will produce a border-image: none when getting the style attribute from <p style="border: 1px solid red"></p>
+					// So lets asume it shouldn't be there
+					if (styles['border-image'] === 'none') {
+						delete styles['border-image'];
+					}
+				}
+
+				return styles;
+			},
+
+			/**
+			 * Serializes the specified style object into a string.
+			 *
+			 * @method serialize
+			 * @param {Object} styles Object to serialize as string for example: {border: '1px solid red'}
+			 * @param {String} elementName Optional element name, if specified only the styles that matches the schema will be serialized.
+			 * @return {String} String representation of the style object for example: border: 1px solid red.
+			 */
+			serialize: function(styles, elementName) {
+				var css = '', name, value;
+
+				function serializeStyles(name) {
+					var styleList, i, l, value;
+
+					styleList = validStyles[name];
+					if (styleList) {
+						for (i = 0, l = styleList.length; i < l; i++) {
+							name = styleList[i];
+							value = styles[name];
+
+							if (value !== undef && value.length > 0) {
+								css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';';
+							}
+						}
+					}
+				}
+
+				function isValid(name, elementName) {
+					var styleMap;
+
+					styleMap = invalidStyles['*'];
+					if (styleMap && styleMap[name]) {
+						return false;
+					}
+
+					styleMap = invalidStyles[elementName];
+					if (styleMap && styleMap[name]) {
+						return false;
+					}
+
+					return true;
+				}
+
+				// Serialize styles according to schema
+				if (elementName && validStyles) {
+					// Serialize global styles and element specific styles
+					serializeStyles('*');
+					serializeStyles(elementName);
+				} else {
+					// Output the styles in the order they are inside the object
+					for (name in styles) {
+						value = styles[name];
+
+						if (value !== undef && value.length > 0) {
+							if (!invalidStyles || isValid(name, elementName)) {
+								css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';';
+							}
+						}
+					}
+				}
+
+				return css;
+			}
+		};
+	};
+});
+
+// Included from: js/tinymce/classes/dom/TreeWalker.js
+
+/**
+ * TreeWalker.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * TreeWalker class enables you to walk the DOM in a linear manner.
+ *
+ * @class tinymce.dom.TreeWalker
+ * @example
+ * var walker = new tinymce.dom.TreeWalker(startNode);
+ *
+ * do {
+ *     console.log(walker.current());
+ * } while (walker.next());
+ */
+define("tinymce/dom/TreeWalker", [], function() {
+	/**
+	 * Constructs a new TreeWalker instance.
+	 *
+	 * @constructor
+	 * @method TreeWalker
+	 * @param {Node} startNode Node to start walking from.
+	 * @param {node} rootNode Optional root node to never walk out of.
+	 */
+	return function(startNode, rootNode) {
+		var node = startNode;
+
+		function findSibling(node, startName, siblingName, shallow) {
+			var sibling, parent;
+
+			if (node) {
+				// Walk into nodes if it has a start
+				if (!shallow && node[startName]) {
+					return node[startName];
+				}
+
+				// Return the sibling if it has one
+				if (node != rootNode) {
+					sibling = node[siblingName];
+					if (sibling) {
+						return sibling;
+					}
+
+					// Walk up the parents to look for siblings
+					for (parent = node.parentNode; parent && parent != rootNode; parent = parent.parentNode) {
+						sibling = parent[siblingName];
+						if (sibling) {
+							return sibling;
+						}
+					}
+				}
+			}
+		}
+
+		/**
+		 * Returns the current node.
+		 *
+		 * @method current
+		 * @return {Node} Current node where the walker is.
+		 */
+		this.current = function() {
+			return node;
+		};
+
+		/**
+		 * Walks to the next node in tree.
+		 *
+		 * @method next
+		 * @return {Node} Current node where the walker is after moving to the next node.
+		 */
+		this.next = function(shallow) {
+			node = findSibling(node, 'firstChild', 'nextSibling', shallow);
+			return node;
+		};
+
+		/**
+		 * Walks to the previous node in tree.
+		 *
+		 * @method prev
+		 * @return {Node} Current node where the walker is after moving to the previous node.
+		 */
+		this.prev = function(shallow) {
+			node = findSibling(node, 'lastChild', 'previousSibling', shallow);
+			return node;
+		};
+	};
+});
+
+// Included from: js/tinymce/classes/dom/Range.js
+
+/**
+ * Range.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+define("tinymce/dom/Range", [
+	"tinymce/util/Tools"
+], function(Tools) {
+	// Range constructor
+	function Range(dom) {
+		var self = this,
+			doc = dom.doc,
+			EXTRACT = 0,
+			CLONE = 1,
+			DELETE = 2,
+			TRUE = true,
+			FALSE = false,
+			START_OFFSET = 'startOffset',
+			START_CONTAINER = 'startContainer',
+			END_CONTAINER = 'endContainer',
+			END_OFFSET = 'endOffset',
+			extend = Tools.extend,
+			nodeIndex = dom.nodeIndex;
+
+		function createDocumentFragment() {
+			return doc.createDocumentFragment();
+		}
+
+		function setStart(n, o) {
+			_setEndPoint(TRUE, n, o);
+		}
+
+		function setEnd(n, o) {
+			_setEndPoint(FALSE, n, o);
+		}
+
+		function setStartBefore(n) {
+			setStart(n.parentNode, nodeIndex(n));
+		}
+
+		function setStartAfter(n) {
+			setStart(n.parentNode, nodeIndex(n) + 1);
+		}
+
+		function setEndBefore(n) {
+			setEnd(n.parentNode, nodeIndex(n));
+		}
+
+		function setEndAfter(n) {
+			setEnd(n.parentNode, nodeIndex(n) + 1);
+		}
+
+		function collapse(ts) {
+			if (ts) {
+				self[END_CONTAINER] = self[START_CONTAINER];
+				self[END_OFFSET] = self[START_OFFSET];
+			} else {
+				self[START_CONTAINER] = self[END_CONTAINER];
+				self[START_OFFSET] = self[END_OFFSET];
+			}
+
+			self.collapsed = TRUE;
+		}
+
+		function selectNode(n) {
+			setStartBefore(n);
+			setEndAfter(n);
+		}
+
+		function selectNodeContents(n) {
+			setStart(n, 0);
+			setEnd(n, n.nodeType === 1 ? n.childNodes.length : n.nodeValue.length);
+		}
+
+		function compareBoundaryPoints(h, r) {
+			var sc = self[START_CONTAINER], so = self[START_OFFSET], ec = self[END_CONTAINER], eo = self[END_OFFSET],
+			rsc = r.startContainer, rso = r.startOffset, rec = r.endContainer, reo = r.endOffset;
+
+			// Check START_TO_START
+			if (h === 0) {
+				return _compareBoundaryPoints(sc, so, rsc, rso);
+			}
+
+			// Check START_TO_END
+			if (h === 1) {
+				return _compareBoundaryPoints(ec, eo, rsc, rso);
+			}
+
+			// Check END_TO_END
+			if (h === 2) {
+				return _compareBoundaryPoints(ec, eo, rec, reo);
+			}
+
+			// Check END_TO_START
+			if (h === 3) {
+				return _compareBoundaryPoints(sc, so, rec, reo);
+			}
+		}
+
+		function deleteContents() {
+			_traverse(DELETE);
+		}
+
+		function extractContents() {
+			return _traverse(EXTRACT);
+		}
+
+		function cloneContents() {
+			return _traverse(CLONE);
+		}
+
+		function insertNode(n) {
+			var startContainer = this[START_CONTAINER],
+				startOffset = this[START_OFFSET], nn, o;
+
+			// Node is TEXT_NODE or CDATA
+			if ((startContainer.nodeType === 3 || startContainer.nodeType === 4) && startContainer.nodeValue) {
+				if (!startOffset) {
+					// At the start of text
+					startContainer.parentNode.insertBefore(n, startContainer);
+				} else if (startOffset >= startContainer.nodeValue.length) {
+					// At the end of text
+					dom.insertAfter(n, startContainer);
+				} else {
+					// Middle, need to split
+					nn = startContainer.splitText(startOffset);
+					startContainer.parentNode.insertBefore(n, nn);
+				}
+			} else {
+				// Insert element node
+				if (startContainer.childNodes.length > 0) {
+					o = startContainer.childNodes[startOffset];
+				}
+
+				if (o) {
+					startContainer.insertBefore(n, o);
+				} else {
+					if (startContainer.nodeType == 3) {
+						dom.insertAfter(n, startContainer);
+					} else {
+						startContainer.appendChild(n);
+					}
+				}
+			}
+		}
+
+		function surroundContents(n) {
+			var f = self.extractContents();
+
+			self.insertNode(n);
+			n.appendChild(f);
+			self.selectNode(n);
+		}
+
+		function cloneRange() {
+			return extend(new Range(dom), {
+				startContainer: self[START_CONTAINER],
+				startOffset: self[START_OFFSET],
+				endContainer: self[END_CONTAINER],
+				endOffset: self[END_OFFSET],
+				collapsed: self.collapsed,
+				commonAncestorContainer: self.commonAncestorContainer
+			});
+		}
+
+		// Private methods
+
+		function _getSelectedNode(container, offset) {
+			var child;
+
+			if (container.nodeType == 3 /* TEXT_NODE */) {
+				return container;
+			}
+
+			if (offset < 0) {
+				return container;
+			}
+
+			child = container.firstChild;
+			while (child && offset > 0) {
+				--offset;
+				child = child.nextSibling;
+			}
+
+			if (child) {
+				return child;
+			}
+
+			return container;
+		}
+
+		function _isCollapsed() {
+			return (self[START_CONTAINER] == self[END_CONTAINER] && self[START_OFFSET] == self[END_OFFSET]);
+		}
+
+		function _compareBoundaryPoints(containerA, offsetA, containerB, offsetB) {
+			var c, offsetC, n, cmnRoot, childA, childB;
+
+			// In the first case the boundary-points have the same container. A is before B
+			// if its offset is less than the offset of B, A is equal to B if its offset is
+			// equal to the offset of B, and A is after B if its offset is greater than the
+			// offset of B.
+			if (containerA == containerB) {
+				if (offsetA == offsetB) {
+					return 0; // equal
+				}
+
+				if (offsetA < offsetB) {
+					return -1; // before
+				}
+
+				return 1; // after
+			}
+
+			// In the second case a child node C of the container of A is an ancestor
+			// container of B. In this case, A is before B if the offset of A is less than or
+			// equal to the index of the child node C and A is after B otherwise.
+			c = containerB;
+			while (c && c.parentNode != containerA) {
+				c = c.parentNode;
+			}
+
+			if (c) {
+				offsetC = 0;
+				n = containerA.firstChild;
+
+				while (n != c && offsetC < offsetA) {
+					offsetC++;
+					n = n.nextSibling;
+				}
+
+				if (offsetA <= offsetC) {
+					return -1; // before
+				}
+
+				return 1; // after
+			}
+
+			// In the third case a child node C of the container of B is an ancestor container
+			// of A. In this case, A is before B if the index of the child node C is less than
+			// the offset of B and A is after B otherwise.
+			c = containerA;
+			while (c && c.parentNode != containerB) {
+				c = c.parentNode;
+			}
+
+			if (c) {
+				offsetC = 0;
+				n = containerB.firstChild;
+
+				while (n != c && offsetC < offsetB) {
+					offsetC++;
+					n = n.nextSibling;
+				}
+
+				if (offsetC < offsetB) {
+					return -1; // before
+				}
+
+				return 1; // after
+			}
+
+			// In the fourth case, none of three other cases hold: the containers of A and B
+			// are siblings or descendants of sibling nodes. In this case, A is before B if
+			// the container of A is before the container of B in a pre-order traversal of the
+			// Ranges' context tree and A is after B otherwise.
+			cmnRoot = dom.findCommonAncestor(containerA, containerB);
+			childA = containerA;
+
+			while (childA && childA.parentNode != cmnRoot) {
+				childA = childA.parentNode;
+			}
+
+			if (!childA) {
+				childA = cmnRoot;
+			}
+
+			childB = containerB;
+			while (childB && childB.parentNode != cmnRoot) {
+				childB = childB.parentNode;
+			}
+
+			if (!childB) {
+				childB = cmnRoot;
+			}
+
+			if (childA == childB) {
+				return 0; // equal
+			}
+
+			n = cmnRoot.firstChild;
+			while (n) {
+				if (n == childA) {
+					return -1; // before
+				}
+
+				if (n == childB) {
+					return 1; // after
+				}
+
+				n = n.nextSibling;
+			}
+		}
+
+		function _setEndPoint(st, n, o) {
+			var ec, sc;
+
+			if (st) {
+				self[START_CONTAINER] = n;
+				self[START_OFFSET] = o;
+			} else {
+				self[END_CONTAINER] = n;
+				self[END_OFFSET] = o;
+			}
+
+			// If one boundary-point of a Range is set to have a root container
+			// other than the current one for the Range, the Range is collapsed to
+			// the new position. This enforces the restriction that both boundary-
+			// points of a Range must have the same root container.
+			ec = self[END_CONTAINER];
+			while (ec.parentNode) {
+				ec = ec.parentNode;
+			}
+
+			sc = self[START_CONTAINER];
+			while (sc.parentNode) {
+				sc = sc.parentNode;
+			}
+
+			if (sc == ec) {
+				// The start position of a Range is guaranteed to never be after the
+				// end position. To enforce this restriction, if the start is set to
+				// be at a position after the end, the Range is collapsed to that
+				// position.
+				if (_compareBoundaryPoints(self[START_CONTAINER], self[START_OFFSET], self[END_CONTAINER], self[END_OFFSET]) > 0) {
+					self.collapse(st);
+				}
+			} else {
+				self.collapse(st);
+			}
+
+			self.collapsed = _isCollapsed();
+			self.commonAncestorContainer = dom.findCommonAncestor(self[START_CONTAINER], self[END_CONTAINER]);
+		}
+
+		function _traverse(how) {
+			var c, endContainerDepth = 0, startContainerDepth = 0, p, depthDiff, startNode, endNode, sp, ep;
+
+			if (self[START_CONTAINER] == self[END_CONTAINER]) {
+				return _traverseSameContainer(how);
+			}
+
+			for (c = self[END_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) {
+				if (p == self[START_CONTAINER]) {
+					return _traverseCommonStartContainer(c, how);
+				}
+
+				++endContainerDepth;
+			}
+
+			for (c = self[START_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) {
+				if (p == self[END_CONTAINER]) {
+					return _traverseCommonEndContainer(c, how);
+				}
+
+				++startContainerDepth;
+			}
+
+			depthDiff = startContainerDepth - endContainerDepth;
+
+			startNode = self[START_CONTAINER];
+			while (depthDiff > 0) {
+				startNode = startNode.parentNode;
+				depthDiff--;
+			}
+
+			endNode = self[END_CONTAINER];
+			while (depthDiff < 0) {
+				endNode = endNode.parentNode;
+				depthDiff++;
+			}
+
+			// ascend the ancestor hierarchy until we have a common parent.
+			for (sp = startNode.parentNode, ep = endNode.parentNode; sp != ep; sp = sp.parentNode, ep = ep.parentNode) {
+				startNode = sp;
+				endNode = ep;
+			}
+
+			return _traverseCommonAncestors(startNode, endNode, how);
+		}
+
+		function _traverseSameContainer(how) {
+			var frag, s, sub, n, cnt, sibling, xferNode, start, len;
+
+			if (how != DELETE) {
+				frag = createDocumentFragment();
+			}
+
+			// If selection is empty, just return the fragment
+			if (self[START_OFFSET] == self[END_OFFSET]) {
+				return frag;
+			}
+
+			// Text node needs special case handling
+			if (self[START_CONTAINER].nodeType == 3 /* TEXT_NODE */) {
+				// get the substring
+				s = self[START_CONTAINER].nodeValue;
+				sub = s.substring(self[START_OFFSET], self[END_OFFSET]);
+
+				// set the original text node to its new value
+				if (how != CLONE) {
+					n = self[START_CONTAINER];
+					start = self[START_OFFSET];
+					len = self[END_OFFSET] - self[START_OFFSET];
+
+					if (start === 0 && len >= n.nodeValue.length - 1) {
+						n.parentNode.removeChild(n);
+					} else {
+						n.deleteData(start, len);
+					}
+
+					// Nothing is partially selected, so collapse to start point
+					self.collapse(TRUE);
+				}
+
+				if (how == DELETE) {
+					return;
+				}
+
+				if (sub.length > 0) {
+					frag.appendChild(doc.createTextNode(sub));
+				}
+
+				return frag;
+			}
+
+			// Copy nodes between the start/end offsets.
+			n = _getSelectedNode(self[START_CONTAINER], self[START_OFFSET]);
+			cnt = self[END_OFFSET] - self[START_OFFSET];
+
+			while (n && cnt > 0) {
+				sibling = n.nextSibling;
+				xferNode = _traverseFullySelected(n, how);
+
+				if (frag) {
+					frag.appendChild(xferNode);
+				}
+
+				--cnt;
+				n = sibling;
+			}
+
+			// Nothing is partially selected, so collapse to start point
+			if (how != CLONE) {
+				self.collapse(TRUE);
+			}
+
+			return frag;
+		}
+
+		function _traverseCommonStartContainer(endAncestor, how) {
+			var frag, n, endIdx, cnt, sibling, xferNode;
+
+			if (how != DELETE) {
+				frag = createDocumentFragment();
+			}
+
+			n = _traverseRightBoundary(endAncestor, how);
+
+			if (frag) {
+				frag.appendChild(n);
+			}
+
+			endIdx = nodeIndex(endAncestor);
+			cnt = endIdx - self[START_OFFSET];
+
+			if (cnt <= 0) {
+				// Collapse to just before the endAncestor, which
+				// is partially selected.
+				if (how != CLONE) {
+					self.setEndBefore(endAncestor);
+					self.collapse(FALSE);
+				}
+
+				return frag;
+			}
+
+			n = endAncestor.previousSibling;
+			while (cnt > 0) {
+				sibling = n.previousSibling;
+				xferNode = _traverseFullySelected(n, how);
+
+				if (frag) {
+					frag.insertBefore(xferNode, frag.firstChild);
+				}
+
+				--cnt;
+				n = sibling;
+			}
+
+			// Collapse to just before the endAncestor, which
+			// is partially selected.
+			if (how != CLONE) {
+				self.setEndBefore(endAncestor);
+				self.collapse(FALSE);
+			}
+
+			return frag;
+		}
+
+		function _traverseCommonEndContainer(startAncestor, how) {
+			var frag, startIdx, n, cnt, sibling, xferNode;
+
+			if (how != DELETE) {
+				frag = createDocumentFragment();
+			}
+
+			n = _traverseLeftBoundary(startAncestor, how);
+			if (frag) {
+				frag.appendChild(n);
+			}
+
+			startIdx = nodeIndex(startAncestor);
+			++startIdx; // Because we already traversed it
+
+			cnt = self[END_OFFSET] - startIdx;
+			n = startAncestor.nextSibling;
+			while (n && cnt > 0) {
+				sibling = n.nextSibling;
+				xferNode = _traverseFullySelected(n, how);
+
+				if (frag) {
+					frag.appendChild(xferNode);
+				}
+
+				--cnt;
+				n = sibling;
+			}
+
+			if (how != CLONE) {
+				self.setStartAfter(startAncestor);
+				self.collapse(TRUE);
+			}
+
+			return frag;
+		}
+
+		function _traverseCommonAncestors(startAncestor, endAncestor, how) {
+			var n, frag, startOffset, endOffset, cnt, sibling, nextSibling;
+
+			if (how != DELETE) {
+				frag = createDocumentFragment();
+			}
+
+			n = _traverseLeftBoundary(startAncestor, how);
+			if (frag) {
+				frag.appendChild(n);
+			}
+
+			startOffset = nodeIndex(startAncestor);
+			endOffset = nodeIndex(endAncestor);
+			++startOffset;
+
+			cnt = endOffset - startOffset;
+			sibling = startAncestor.nextSibling;
+
+			while (cnt > 0) {
+				nextSibling = sibling.nextSibling;
+				n = _traverseFullySelected(sibling, how);
+
+				if (frag) {
+					frag.appendChild(n);
+				}
+
+				sibling = nextSibling;
+				--cnt;
+			}
+
+			n = _traverseRightBoundary(endAncestor, how);
+
+			if (frag) {
+				frag.appendChild(n);
+			}
+
+			if (how != CLONE) {
+				self.setStartAfter(startAncestor);
+				self.collapse(TRUE);
+			}
+
+			return frag;
+		}
+
+		function _traverseRightBoundary(root, how) {
+			var next = _getSelectedNode(self[END_CONTAINER], self[END_OFFSET] - 1), parent, clonedParent;
+			var prevSibling, clonedChild, clonedGrandParent, isFullySelected = next != self[END_CONTAINER];
+
+			if (next == root) {
+				return _traverseNode(next, isFullySelected, FALSE, how);
+			}
+
+			parent = next.parentNode;
+			clonedParent = _traverseNode(parent, FALSE, FALSE, how);
+
+			while (parent) {
+				while (next) {
+					prevSibling = next.previousSibling;
+					clonedChild = _traverseNode(next, isFullySelected, FALSE, how);
+
+					if (how != DELETE) {
+						clonedParent.insertBefore(clonedChild, clonedParent.firstChild);
+					}
+
+					isFullySelected = TRUE;
+					next = prevSibling;
+				}
+
+				if (parent == root) {
+					return clonedParent;
+				}
+
+				next = parent.previousSibling;
+				parent = parent.parentNode;
+
+				clonedGrandParent = _traverseNode(parent, FALSE, FALSE, how);
+
+				if (how != DELETE) {
+					clonedGrandParent.appendChild(clonedParent);
+				}
+
+				clonedParent = clonedGrandParent;
+			}
+		}
+
+		function _traverseLeftBoundary(root, how) {
+			var next = _getSelectedNode(self[START_CONTAINER], self[START_OFFSET]), isFullySelected = next != self[START_CONTAINER];
+			var parent, clonedParent, nextSibling, clonedChild, clonedGrandParent;
+
+			if (next == root) {
+				return _traverseNode(next, isFullySelected, TRUE, how);
+			}
+
+			parent = next.parentNode;
+			clonedParent = _traverseNode(parent, FALSE, TRUE, how);
+
+			while (parent) {
+				while (next) {
+					nextSibling = next.nextSibling;
+					clonedChild = _traverseNode(next, isFullySelected, TRUE, how);
+
+					if (how != DELETE) {
+						clonedParent.appendChild(clonedChild);
+					}
+
+					isFullySelected = TRUE;
+					next = nextSibling;
+				}
+
+				if (parent == root) {
+					return clonedParent;
+				}
+
+				next = parent.nextSibling;
+				parent = parent.parentNode;
+
+				clonedGrandParent = _traverseNode(parent, FALSE, TRUE, how);
+
+				if (how != DELETE) {
+					clonedGrandParent.appendChild(clonedParent);
+				}
+
+				clonedParent = clonedGrandParent;
+			}
+		}
+
+		function _traverseNode(n, isFullySelected, isLeft, how) {
+			var txtValue, newNodeValue, oldNodeValue, offset, newNode;
+
+			if (isFullySelected) {
+				return _traverseFullySelected(n, how);
+			}
+
+			if (n.nodeType == 3 /* TEXT_NODE */) {
+				txtValue = n.nodeValue;
+
+				if (isLeft) {
+					offset = self[START_OFFSET];
+					newNodeValue = txtValue.substring(offset);
+					oldNodeValue = txtValue.substring(0, offset);
+				} else {
+					offset = self[END_OFFSET];
+					newNodeValue = txtValue.substring(0, offset);
+					oldNodeValue = txtValue.substring(offset);
+				}
+
+				if (how != CLONE) {
+					n.nodeValue = oldNodeValue;
+				}
+
+				if (how == DELETE) {
+					return;
+				}
+
+				newNode = dom.clone(n, FALSE);
+				newNode.nodeValue = newNodeValue;
+
+				return newNode;
+			}
+
+			if (how == DELETE) {
+				return;
+			}
+
+			return dom.clone(n, FALSE);
+		}
+
+		function _traverseFullySelected(n, how) {
+			if (how != DELETE) {
+				return how == CLONE ? dom.clone(n, TRUE) : n;
+			}
+
+			n.parentNode.removeChild(n);
+		}
+
+		function toStringIE() {
+			return dom.create('body', null, cloneContents()).outerText;
+		}
+
+		extend(self, {
+			// Inital states
+			startContainer: doc,
+			startOffset: 0,
+			endContainer: doc,
+			endOffset: 0,
+			collapsed: TRUE,
+			commonAncestorContainer: doc,
+
+			// Range constants
+			START_TO_START: 0,
+			START_TO_END: 1,
+			END_TO_END: 2,
+			END_TO_START: 3,
+
+			// Public methods
+			setStart: setStart,
+			setEnd: setEnd,
+			setStartBefore: setStartBefore,
+			setStartAfter: setStartAfter,
+			setEndBefore: setEndBefore,
+			setEndAfter: setEndAfter,
+			collapse: collapse,
+			selectNode: selectNode,
+			selectNodeContents: selectNodeContents,
+			compareBoundaryPoints: compareBoundaryPoints,
+			deleteContents: deleteContents,
+			extractContents: extractContents,
+			cloneContents: cloneContents,
+			insertNode: insertNode,
+			surroundContents: surroundContents,
+			cloneRange: cloneRange,
+			toStringIE: toStringIE
+		});
+
+		return self;
+	}
+
+	// Older IE versions doesn't let you override toString by it's constructor so we have to stick it in the prototype
+	Range.prototype.toString = function() {
+		return this.toStringIE();
+	};
+
+	return Range;
+});
+
+// Included from: js/tinymce/classes/html/Entities.js
+
+/**
+ * Entities.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*jshint bitwise:false */
+/*eslint no-bitwise:0 */
+
+/**
+ * Entity encoder class.
+ *
+ * @class tinymce.html.Entities
+ * @static
+ * @version 3.4
+ */
+define("tinymce/html/Entities", [
+	"tinymce/util/Tools"
+], function(Tools) {
+	var makeMap = Tools.makeMap;
+
+	var namedEntities, baseEntities, reverseEntities,
+		attrsCharsRegExp = /[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
+		textCharsRegExp = /[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
+		rawCharsRegExp = /[<>&\"\']/g,
+		entityRegExp = /&#([a-z0-9]+);?|&([a-z0-9]+);/gi,
+		asciiMap = {
+			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"
+		};
+
+	// Raw entities
+	baseEntities = {
+		'\"': '&quot;', // Needs to be escaped since the YUI compressor would otherwise break the code
+		"'": '&#39;',
+		'<': '&lt;',
+		'>': '&gt;',
+		'&': '&amp;',
+		'\u0060': '&#96;'
+	};
+
+	// Reverse lookup table for raw entities
+	reverseEntities = {
+		'&lt;': '<',
+		'&gt;': '>',
+		'&amp;': '&',
+		'&quot;': '"',
+		'&apos;': "'"
+	};
+
+	// Decodes text by using the browser
+	function nativeDecode(text) {
+		var elm;
+
+		elm = document.createElement("div");
+		elm.innerHTML = text;
+
+		return elm.textContent || elm.innerText || text;
+	}
+
+	// Build a two way lookup table for the entities
+	function buildEntitiesLookup(items, radix) {
+		var i, chr, entity, lookup = {};
+
+		if (items) {
+			items = items.split(',');
+			radix = radix || 10;
+
+			// Build entities lookup table
+			for (i = 0; i < items.length; i += 2) {
+				chr = String.fromCharCode(parseInt(items[i], radix));
+
+				// Only add non base entities
+				if (!baseEntities[chr]) {
+					entity = '&' + items[i + 1] + ';';
+					lookup[chr] = entity;
+					lookup[entity] = chr;
+				}
+			}
+
+			return lookup;
+		}
+	}
+
+	// Unpack entities lookup where the numbers are in radix 32 to reduce the size
+	namedEntities = buildEntitiesLookup(
+		'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 Entities = {
+		/**
+		 * Encodes the specified string using raw entities. This means only the required XML base entities will be endoded.
+		 *
+		 * @method encodeRaw
+		 * @param {String} text Text to encode.
+		 * @param {Boolean} attr Optional flag to specify if the text is attribute contents.
+		 * @return {String} Entity encoded text.
+		 */
+		encodeRaw: function(text, attr) {
+			return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) {
+				return baseEntities[chr] || chr;
+			});
+		},
+
+		/**
+		 * Encoded the specified text with both the attributes and text entities. This function will produce larger text contents
+		 * since it doesn't know if the context is within a attribute or text node. This was added for compatibility
+		 * and is exposed as the DOMUtils.encode function.
+		 *
+		 * @method encodeAllRaw
+		 * @param {String} text Text to encode.
+		 * @return {String} Entity encoded text.
+		 */
+		encodeAllRaw: function(text) {
+			return ('' + text).replace(rawCharsRegExp, function(chr) {
+				return baseEntities[chr] || chr;
+			});
+		},
+
+		/**
+		 * Encodes the specified string using numeric entities. The core entities will be
+		 * encoded as named ones but all non lower ascii characters will be encoded into numeric entities.
+		 *
+		 * @method encodeNumeric
+		 * @param {String} text Text to encode.
+		 * @param {Boolean} attr Optional flag to specify if the text is attribute contents.
+		 * @return {String} Entity encoded text.
+		 */
+		encodeNumeric: function(text, attr) {
+			return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) {
+				// Multi byte sequence convert it to a single entity
+				if (chr.length > 1) {
+					return '&#' + (((chr.charCodeAt(0) - 0xD800) * 0x400) + (chr.charCodeAt(1) - 0xDC00) + 0x10000) + ';';
+				}
+
+				return baseEntities[chr] || '&#' + chr.charCodeAt(0) + ';';
+			});
+		},
+
+		/**
+		 * Encodes the specified string using named entities. The core entities will be encoded
+		 * as named ones but all non lower ascii characters will be encoded into named entities.
+		 *
+		 * @method encodeNamed
+		 * @param {String} text Text to encode.
+		 * @param {Boolean} attr Optional flag to specify if the text is attribute contents.
+		 * @param {Object} entities Optional parameter with entities to use.
+		 * @return {String} Entity encoded text.
+		 */
+		encodeNamed: function(text, attr, entities) {
+			entities = entities || namedEntities;
+
+			return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) {
+				return baseEntities[chr] || entities[chr] || chr;
+			});
+		},
+
+		/**
+		 * Returns an encode function based on the name(s) and it's optional entities.
+		 *
+		 * @method getEncodeFunc
+		 * @param {String} name Comma separated list of encoders for example named,numeric.
+		 * @param {String} entities Optional parameter with entities to use instead of the built in set.
+		 * @return {function} Encode function to be used.
+		 */
+		getEncodeFunc: function(name, entities) {
+			entities = buildEntitiesLookup(entities) || namedEntities;
+
+			function encodeNamedAndNumeric(text, attr) {
+				return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) {
+					return baseEntities[chr] || entities[chr] || '&#' + chr.charCodeAt(0) + ';' || chr;
+				});
+			}
+
+			function encodeCustomNamed(text, attr) {
+				return Entities.encodeNamed(text, attr, entities);
+			}
+
+			// Replace + with , to be compatible with previous TinyMCE versions
+			name = makeMap(name.replace(/\+/g, ','));
+
+			// Named and numeric encoder
+			if (name.named && name.numeric) {
+				return encodeNamedAndNumeric;
+			}
+
+			// Named encoder
+			if (name.named) {
+				// Custom names
+				if (entities) {
+					return encodeCustomNamed;
+				}
+
+				return Entities.encodeNamed;
+			}
+
+			// Numeric
+			if (name.numeric) {
+				return Entities.encodeNumeric;
+			}
+
+			// Raw encoder
+			return Entities.encodeRaw;
+		},
+
+		/**
+		 * Decodes the specified string, this will replace entities with raw UTF characters.
+		 *
+		 * @method decode
+		 * @param {String} text Text to entity decode.
+		 * @return {String} Entity decoded string.
+		 */
+		decode: function(text) {
+			return text.replace(entityRegExp, function(all, numeric) {
+				if (numeric) {
+					if (numeric.charAt(0).toLowerCase() === 'x') {
+						numeric = parseInt(numeric.substr(1), 16);
+					} else {
+						numeric = parseInt(numeric, 10);
+					}
+
+					// Support upper UTF
+					if (numeric > 0xFFFF) {
+						numeric -= 0x10000;
+
+						return String.fromCharCode(0xD800 + (numeric >> 10), 0xDC00 + (numeric & 0x3FF));
+					} else {
+						return asciiMap[numeric] || String.fromCharCode(numeric);
+					}
+				}
+
+				return reverseEntities[all] || namedEntities[all] || nativeDecode(all);
+			});
+		}
+	};
+
+	return Entities;
+});
+
+// Included from: js/tinymce/classes/dom/StyleSheetLoader.js
+
+/**
+ * StyleSheetLoader.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles loading of external stylesheets and fires events when these are loaded.
+ *
+ * @class tinymce.dom.StyleSheetLoader
+ * @private
+ */
+define("tinymce/dom/StyleSheetLoader", [
+	"tinymce/util/Tools"
+], function(Tools) {
+	"use strict";
+
+	return function(document, settings) {
+		var idCount = 0, loadedStates = {}, maxLoadTime;
+
+		settings = settings || {};
+		maxLoadTime = settings.maxLoadTime || 5000;
+
+		function appendToHead(node) {
+			document.getElementsByTagName('head')[0].appendChild(node);
+		}
+
+		/**
+		 * Loads the specified css style sheet file and call the loadedCallback once it's finished loading.
+		 *
+		 * @method load
+		 * @param {String} url Url to be loaded.
+		 * @param {Function} loadedCallback Callback to be executed when loaded.
+		 * @param {Function} errorCallback Callback to be executed when failed loading.
+		 */
+		function load(url, loadedCallback, errorCallback) {
+			var link, style, startTime, state;
+
+			function passed() {
+				var callbacks = state.passed, i = callbacks.length;
+
+				while (i--) {
+					callbacks[i]();
+				}
+
+				state.status = 2;
+				state.passed = [];
+				state.failed = [];
+			}
+
+			function failed() {
+				var callbacks = state.failed, i = callbacks.length;
+
+				while (i--) {
+					callbacks[i]();
+				}
+
+				state.status = 3;
+				state.passed = [];
+				state.failed = [];
+			}
+
+			// Sniffs for older WebKit versions that have the link.onload but a broken one
+			function isOldWebKit() {
+				var webKitChunks = navigator.userAgent.match(/WebKit\/(\d*)/);
+				return !!(webKitChunks && webKitChunks[1] < 536);
+			}
+
+			// Calls the waitCallback until the test returns true or the timeout occurs
+			function wait(testCallback, waitCallback) {
+				if (!testCallback()) {
+					// Wait for timeout
+					if ((new Date().getTime()) - startTime < maxLoadTime) {
+						window.setTimeout(waitCallback, 0);
+					} else {
+						failed();
+					}
+				}
+			}
+
+			// Workaround for WebKit that doesn't properly support the onload event for link elements
+			// Or WebKit that fires the onload event before the StyleSheet is added to the document
+			function waitForWebKitLinkLoaded() {
+				wait(function() {
+					var styleSheets = document.styleSheets, styleSheet, i = styleSheets.length, owner;
+
+					while (i--) {
+						styleSheet = styleSheets[i];
+						owner = styleSheet.ownerNode ? styleSheet.ownerNode : styleSheet.owningElement;
+						if (owner && owner.id === link.id) {
+							passed();
+							return true;
+						}
+					}
+				}, waitForWebKitLinkLoaded);
+			}
+
+			// Workaround for older Geckos that doesn't have any onload event for StyleSheets
+			function waitForGeckoLinkLoaded() {
+				wait(function() {
+					try {
+						// Accessing the cssRules will throw an exception until the CSS file is loaded
+						var cssRules = style.sheet.cssRules;
+						passed();
+						return !!cssRules;
+					} catch (ex) {
+						// Ignore
+					}
+				}, waitForGeckoLinkLoaded);
+			}
+
+			url = Tools._addCacheSuffix(url);
+
+			if (!loadedStates[url]) {
+				state = {
+					passed: [],
+					failed: []
+				};
+
+				loadedStates[url] = state;
+			} else {
+				state = loadedStates[url];
+			}
+
+			if (loadedCallback) {
+				state.passed.push(loadedCallback);
+			}
+
+			if (errorCallback) {
+				state.failed.push(errorCallback);
+			}
+
+			// Is loading wait for it to pass
+			if (state.status == 1) {
+				return;
+			}
+
+			// Has finished loading and was success
+			if (state.status == 2) {
+				passed();
+				return;
+			}
+
+			// Has finished loading and was a failure
+			if (state.status == 3) {
+				failed();
+				return;
+			}
+
+			// Start loading
+			state.status = 1;
+			link = document.createElement('link');
+			link.rel = 'stylesheet';
+			link.type = 'text/css';
+			link.id = 'u' + (idCount++);
+			link.async = false;
+			link.defer = false;
+			startTime = new Date().getTime();
+
+			// Feature detect onload on link element and sniff older webkits since it has an broken onload event
+			if ("onload" in link && !isOldWebKit()) {
+				link.onload = waitForWebKitLinkLoaded;
+				link.onerror = failed;
+			} else {
+				// Sniff for old Firefox that doesn't support the onload event on link elements
+				// TODO: Remove this in the future when everyone uses modern browsers
+				if (navigator.userAgent.indexOf("Firefox") > 0) {
+					style = document.createElement('style');
+					style.textContent = '@import "' + url + '"';
+					waitForGeckoLinkLoaded();
+					appendToHead(style);
+					return;
+				} else {
+					// Use the id owner on older webkits
+					waitForWebKitLinkLoaded();
+				}
+			}
+
+			appendToHead(link);
+			link.href = url;
+		}
+
+		this.load = load;
+	};
+});
+
+// Included from: js/tinymce/classes/dom/DOMUtils.js
+
+/**
+ * DOMUtils.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Utility class for various DOM manipulation and retrieval functions.
+ *
+ * @class tinymce.dom.DOMUtils
+ * @example
+ * // Add a class to an element by id in the page
+ * tinymce.DOM.addClass('someid', 'someclass');
+ *
+ * // Add a class to an element by id inside the editor
+ * tinymce.activeEditor.dom.addClass('someid', 'someclass');
+ */
+define("tinymce/dom/DOMUtils", [
+	"tinymce/dom/Sizzle",
+	"tinymce/dom/DomQuery",
+	"tinymce/html/Styles",
+	"tinymce/dom/EventUtils",
+	"tinymce/dom/TreeWalker",
+	"tinymce/dom/Range",
+	"tinymce/html/Entities",
+	"tinymce/Env",
+	"tinymce/util/Tools",
+	"tinymce/dom/StyleSheetLoader"
+], function(Sizzle, $, Styles, EventUtils, TreeWalker, Range, Entities, Env, Tools, StyleSheetLoader) {
+	// Shorten names
+	var each = Tools.each, is = Tools.is, grep = Tools.grep, trim = Tools.trim;
+	var isIE = Env.ie;
+	var simpleSelectorRe = /^([a-z0-9],?)+$/i;
+	var whiteSpaceRegExp = /^[ \t\r\n]*$/;
+
+	function setupAttrHooks(domUtils, settings) {
+		var attrHooks = {}, keepValues = settings.keep_values, keepUrlHook;
+
+		keepUrlHook = {
+			set: function($elm, value, name) {
+				if (settings.url_converter) {
+					value = settings.url_converter.call(settings.url_converter_scope || domUtils, value, name, $elm[0]);
+				}
+
+				$elm.attr('data-mce-' + name, value).attr(name, value);
+			},
+
+			get: function($elm, name) {
+				return $elm.attr('data-mce-' + name) || $elm.attr(name);
+			}
+		};
+
+		attrHooks = {
+			style: {
+				set: function($elm, value) {
+					if (value !== null && typeof value === 'object') {
+						$elm.css(value);
+						return;
+					}
+
+					if (keepValues) {
+						$elm.attr('data-mce-style', value);
+					}
+
+					$elm.attr('style', value);
+				},
+
+				get: function($elm) {
+					var value = $elm.attr('data-mce-style') || $elm.attr('style');
+
+					value = domUtils.serializeStyle(domUtils.parseStyle(value), $elm[0].nodeName);
+
+					return value;
+				}
+			}
+		};
+
+		if (keepValues) {
+			attrHooks.href = attrHooks.src = keepUrlHook;
+		}
+
+		return attrHooks;
+	}
+
+	/**
+	 * Constructs a new DOMUtils instance. Consult the Wiki for more details on settings etc for this class.
+	 *
+	 * @constructor
+	 * @method DOMUtils
+	 * @param {Document} d Document reference to bind the utility class to.
+	 * @param {settings} s Optional settings collection.
+	 */
+	function DOMUtils(doc, settings) {
+		var self = this, blockElementsMap;
+
+		self.doc = doc;
+		self.win = window;
+		self.files = {};
+		self.counter = 0;
+		self.stdMode = !isIE || doc.documentMode >= 8;
+		self.boxModel = !isIE || doc.compatMode == "CSS1Compat" || self.stdMode;
+		self.styleSheetLoader = new StyleSheetLoader(doc);
+		self.boundEvents = [];
+		self.settings = settings = settings || {};
+		self.schema = settings.schema;
+		self.styles = new Styles({
+			url_converter: settings.url_converter,
+			url_converter_scope: settings.url_converter_scope
+		}, settings.schema);
+
+		self.fixDoc(doc);
+		self.events = settings.ownEvents ? new EventUtils(settings.proxy) : EventUtils.Event;
+		self.attrHooks = setupAttrHooks(self, settings);
+		blockElementsMap = settings.schema ? settings.schema.getBlockElements() : {};
+		self.$ = $.overrideDefaults(function() {
+			return {
+				context: doc,
+				element: self.getRoot()
+			};
+		});
+
+		/**
+		 * Returns true/false if the specified element is a block element or not.
+		 *
+		 * @method isBlock
+		 * @param {Node/String} node Element/Node to check.
+		 * @return {Boolean} True/False state if the node is a block element or not.
+		 */
+		self.isBlock = function(node) {
+			// Fix for #5446
+			if (!node) {
+				return false;
+			}
+
+			// This function is called in module pattern style since it might be executed with the wrong this scope
+			var type = node.nodeType;
+
+			// If it's a node then check the type and use the nodeName
+			if (type) {
+				return !!(type === 1 && blockElementsMap[node.nodeName]);
+			}
+
+			return !!blockElementsMap[node];
+		};
+	}
+
+	DOMUtils.prototype = {
+		$$: function(elm) {
+			if (typeof elm == 'string') {
+				elm = this.get(elm);
+			}
+
+			return this.$(elm);
+		},
+
+		root: null,
+
+		fixDoc: function(doc) {
+			var settings = this.settings, name;
+
+			if (isIE && settings.schema) {
+				// Add missing HTML 4/5 elements to IE
+				('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(name) {
+					doc.createElement(name);
+				});
+
+				// Create all custom elements
+				for (name in settings.schema.getCustomElements()) {
+					doc.createElement(name);
+				}
+			}
+		},
+
+		clone: function(node, deep) {
+			var self = this, clone, doc;
+
+			// TODO: Add feature detection here in the future
+			if (!isIE || node.nodeType !== 1 || deep) {
+				return node.cloneNode(deep);
+			}
+
+			doc = self.doc;
+
+			// Make a HTML5 safe shallow copy
+			if (!deep) {
+				clone = doc.createElement(node.nodeName);
+
+				// Copy attribs
+				each(self.getAttribs(node), function(attr) {
+					self.setAttrib(clone, attr.nodeName, self.getAttrib(node, attr.nodeName));
+				});
+
+				return clone;
+			}
+
+			return clone.firstChild;
+		},
+
+		/**
+		 * Returns the root node of the document. This is normally the body but might be a DIV. Parents like getParent will not
+		 * go above the point of this root node.
+		 *
+		 * @method getRoot
+		 * @return {Element} Root element for the utility class.
+		 */
+		getRoot: function() {
+			var self = this;
+
+			return self.settings.root_element || self.doc.body;
+		},
+
+		/**
+		 * Returns the viewport of the window.
+		 *
+		 * @method getViewPort
+		 * @param {Window} win Optional window to get viewport of.
+		 * @return {Object} Viewport object with fields x, y, w and h.
+		 */
+		getViewPort: function(win) {
+			var doc, rootElm;
+
+			win = !win ? this.win : win;
+			doc = win.document;
+			rootElm = this.boxModel ? doc.documentElement : doc.body;
+
+			// Returns viewport size excluding scrollbars
+			return {
+				x: win.pageXOffset || rootElm.scrollLeft,
+				y: win.pageYOffset || rootElm.scrollTop,
+				w: win.innerWidth || rootElm.clientWidth,
+				h: win.innerHeight || rootElm.clientHeight
+			};
+		},
+
+		/**
+		 * Returns the rectangle for a specific element.
+		 *
+		 * @method getRect
+		 * @param {Element/String} elm Element object or element ID to get rectangle from.
+		 * @return {object} Rectangle for specified element object with x, y, w, h fields.
+		 */
+		getRect: function(elm) {
+			var self = this, pos, size;
+
+			elm = self.get(elm);
+			pos = self.getPos(elm);
+			size = self.getSize(elm);
+
+			return {
+				x: pos.x, y: pos.y,
+				w: size.w, h: size.h
+			};
+		},
+
+		/**
+		 * Returns the size dimensions of the specified element.
+		 *
+		 * @method getSize
+		 * @param {Element/String} elm Element object or element ID to get rectangle from.
+		 * @return {object} Rectangle for specified element object with w, h fields.
+		 */
+		getSize: function(elm) {
+			var self = this, w, h;
+
+			elm = self.get(elm);
+			w = self.getStyle(elm, 'width');
+			h = self.getStyle(elm, 'height');
+
+			// Non pixel value, then force offset/clientWidth
+			if (w.indexOf('px') === -1) {
+				w = 0;
+			}
+
+			// Non pixel value, then force offset/clientWidth
+			if (h.indexOf('px') === -1) {
+				h = 0;
+			}
+
+			return {
+				w: parseInt(w, 10) || elm.offsetWidth || elm.clientWidth,
+				h: parseInt(h, 10) || elm.offsetHeight || elm.clientHeight
+			};
+		},
+
+		/**
+		 * Returns a node by the specified selector function. This function will
+		 * loop through all parent nodes and call the specified function for each node.
+		 * If the function then returns true indicating that it has found what it was looking for, the loop execution will then end
+		 * and the node it found will be returned.
+		 *
+		 * @method getParent
+		 * @param {Node/String} node DOM node to search parents on or ID string.
+		 * @param {function} selector Selection function or CSS selector to execute on each node.
+		 * @param {Node} root Optional root element, never go below this point.
+		 * @return {Node} DOM Node or null if it wasn't found.
+		 */
+		getParent: function(node, selector, root) {
+			return this.getParents(node, selector, root, false);
+		},
+
+		/**
+		 * Returns a node list of all parents matching the specified selector function or pattern.
+		 * If the function then returns true indicating that it has found what it was looking for and that node will be collected.
+		 *
+		 * @method getParents
+		 * @param {Node/String} node DOM node to search parents on or ID string.
+		 * @param {function} selector Selection function to execute on each node or CSS pattern.
+		 * @param {Node} root Optional root element, never go below this point.
+		 * @return {Array} Array of nodes or null if it wasn't found.
+		 */
+		getParents: function(node, selector, root, collect) {
+			var self = this, selectorVal, result = [];
+
+			node = self.get(node);
+			collect = collect === undefined;
+
+			// Default root on inline mode
+			root = root || (self.getRoot().nodeName != 'BODY' ? self.getRoot().parentNode : null);
+
+			// Wrap node name as func
+			if (is(selector, 'string')) {
+				selectorVal = selector;
+
+				if (selector === '*') {
+					selector = function(node) {
+						return node.nodeType == 1;
+					};
+				} else {
+					selector = function(node) {
+						return self.is(node, selectorVal);
+					};
+				}
+			}
+
+			while (node) {
+				if (node == root || !node.nodeType || node.nodeType === 9) {
+					break;
+				}
+
+				if (!selector || selector(node)) {
+					if (collect) {
+						result.push(node);
+					} else {
+						return node;
+					}
+				}
+
+				node = node.parentNode;
+			}
+
+			return collect ? result : null;
+		},
+
+		/**
+		 * Returns the specified element by ID or the input element if it isn't a string.
+		 *
+		 * @method get
+		 * @param {String/Element} n Element id to look for or element to just pass though.
+		 * @return {Element} Element matching the specified id or null if it wasn't found.
+		 */
+		get: function(elm) {
+			var name;
+
+			if (elm && this.doc && typeof elm == 'string') {
+				name = elm;
+				elm = this.doc.getElementById(elm);
+
+				// IE and Opera returns meta elements when they match the specified input ID, but getElementsByName seems to do the trick
+				if (elm && elm.id !== name) {
+					return this.doc.getElementsByName(name)[1];
+				}
+			}
+
+			return elm;
+		},
+
+		/**
+		 * Returns the next node that matches selector or function
+		 *
+		 * @method getNext
+		 * @param {Node} node Node to find siblings from.
+		 * @param {String/function} selector Selector CSS expression or function.
+		 * @return {Node} Next node item matching the selector or null if it wasn't found.
+		 */
+		getNext: function(node, selector) {
+			return this._findSib(node, selector, 'nextSibling');
+		},
+
+		/**
+		 * Returns the previous node that matches selector or function
+		 *
+		 * @method getPrev
+		 * @param {Node} node Node to find siblings from.
+		 * @param {String/function} selector Selector CSS expression or function.
+		 * @return {Node} Previous node item matching the selector or null if it wasn't found.
+		 */
+		getPrev: function(node, selector) {
+			return this._findSib(node, selector, 'previousSibling');
+		},
+
+		// #ifndef jquery
+
+		/**
+		 * Selects specific elements by a CSS level 3 pattern. For example "div#a1 p.test".
+		 * This function is optimized for the most common patterns needed in TinyMCE but it also performs well enough
+		 * on more complex patterns.
+		 *
+		 * @method select
+		 * @param {String} selector CSS level 3 pattern to select/find elements by.
+		 * @param {Object} scope Optional root element/scope element to search in.
+		 * @return {Array} Array with all matched elements.
+		 * @example
+		 * // Adds a class to all paragraphs in the currently active editor
+		 * tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('p'), 'someclass');
+		 *
+		 * // Adds a class to all spans that have the test class in the currently active editor
+		 * tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('span.test'), 'someclass')
+		 */
+		select: function(selector, scope) {
+			var self = this;
+
+			/*eslint new-cap:0 */
+			return Sizzle(selector, self.get(scope) || self.settings.root_element || self.doc, []);
+		},
+
+		/**
+		 * Returns true/false if the specified element matches the specified css pattern.
+		 *
+		 * @method is
+		 * @param {Node/NodeList} elm DOM node to match or an array of nodes to match.
+		 * @param {String} selector CSS pattern to match the element against.
+		 */
+		is: function(elm, selector) {
+			var i;
+
+			// If it isn't an array then try to do some simple selectors instead of Sizzle for to boost performance
+			if (elm.length === undefined) {
+				// Simple all selector
+				if (selector === '*') {
+					return elm.nodeType == 1;
+				}
+
+				// Simple selector just elements
+				if (simpleSelectorRe.test(selector)) {
+					selector = selector.toLowerCase().split(/,/);
+					elm = elm.nodeName.toLowerCase();
+
+					for (i = selector.length - 1; i >= 0; i--) {
+						if (selector[i] == elm) {
+							return true;
+						}
+					}
+
+					return false;
+				}
+			}
+
+			// Is non element
+			if (elm.nodeType && elm.nodeType != 1) {
+				return false;
+			}
+
+			var elms = elm.nodeType ? [elm] : elm;
+
+			/*eslint new-cap:0 */
+			return Sizzle(selector, elms[0].ownerDocument || elms[0], null, elms).length > 0;
+		},
+
+		// #endif
+
+		/**
+		 * Adds the specified element to another element or elements.
+		 *
+		 * @method add
+		 * @param {String/Element/Array} parentElm Element id string, DOM node element or array of ids or elements to add to.
+		 * @param {String/Element} name Name of new element to add or existing element to add.
+		 * @param {Object} attrs Optional object collection with arguments to add to the new element(s).
+		 * @param {String} html Optional inner HTML contents to add for each element.
+		 * @return {Element/Array} Element that got created, or an array of created elements if multiple input elements
+		 * were passed in.
+		 * @example
+		 * // Adds a new paragraph to the end of the active editor
+		 * tinymce.activeEditor.dom.add(tinymce.activeEditor.getBody(), 'p', {title: 'my title'}, 'Some content');
+		 */
+		add: function(parentElm, name, attrs, html, create) {
+			var self = this;
+
+			return this.run(parentElm, function(parentElm) {
+				var newElm;
+
+				newElm = is(name, 'string') ? self.doc.createElement(name) : name;
+				self.setAttribs(newElm, attrs);
+
+				if (html) {
+					if (html.nodeType) {
+						newElm.appendChild(html);
+					} else {
+						self.setHTML(newElm, html);
+					}
+				}
+
+				return !create ? parentElm.appendChild(newElm) : newElm;
+			});
+		},
+
+		/**
+		 * Creates a new element.
+		 *
+		 * @method create
+		 * @param {String} name Name of new element.
+		 * @param {Object} attrs Optional object name/value collection with element attributes.
+		 * @param {String} html Optional HTML string to set as inner HTML of the element.
+		 * @return {Element} HTML DOM node element that got created.
+		 * @example
+		 * // Adds an element where the caret/selection is in the active editor
+		 * var el = tinymce.activeEditor.dom.create('div', {id: 'test', 'class': 'myclass'}, 'some content');
+		 * tinymce.activeEditor.selection.setNode(el);
+		 */
+		create: function(name, attrs, html) {
+			return this.add(this.doc.createElement(name), name, attrs, html, 1);
+		},
+
+		/**
+		 * Creates HTML string for element. The element will be closed unless an empty inner HTML string is passed in.
+		 *
+		 * @method createHTML
+		 * @param {String} name Name of new element.
+		 * @param {Object} attrs Optional object name/value collection with element attributes.
+		 * @param {String} html Optional HTML string to set as inner HTML of the element.
+		 * @return {String} String with new HTML element, for example: <a href="#">test</a>.
+		 * @example
+		 * // Creates a html chunk and inserts it at the current selection/caret location
+		 * tinymce.activeEditor.selection.setContent(tinymce.activeEditor.dom.createHTML('a', {href: 'test.html'}, 'some line'));
+		 */
+		createHTML: function(name, attrs, html) {
+			var outHtml = '', key;
+
+			outHtml += '<' + name;
+
+			for (key in attrs) {
+				if (attrs.hasOwnProperty(key) && attrs[key] !== null && typeof attrs[key] != 'undefined') {
+					outHtml += ' ' + key + '="' + this.encode(attrs[key]) + '"';
+				}
+			}
+
+			// A call to tinymce.is doesn't work for some odd reason on IE9 possible bug inside their JS runtime
+			if (typeof html != "undefined") {
+				return outHtml + '>' + html + '</' + name + '>';
+			}
+
+			return outHtml + ' />';
+		},
+
+		/**
+		 * Creates a document fragment out of the specified HTML string.
+		 *
+		 * @method createFragment
+		 * @param {String} html Html string to create fragment from.
+		 * @return {DocumentFragment} Document fragment node.
+		 */
+		createFragment: function(html) {
+			var frag, node, doc = this.doc, container;
+
+			container = doc.createElement("div");
+			frag = doc.createDocumentFragment();
+
+			if (html) {
+				container.innerHTML = html;
+			}
+
+			while ((node = container.firstChild)) {
+				frag.appendChild(node);
+			}
+
+			return frag;
+		},
+
+		/**
+		 * Removes/deletes the specified element(s) from the DOM.
+		 *
+		 * @method remove
+		 * @param {String/Element/Array} node ID of element or DOM element object or array containing multiple elements/ids.
+		 * @param {Boolean} keepChildren Optional state to keep children or not. If set to true all children will be
+		 * placed at the location of the removed element.
+		 * @return {Element/Array} HTML DOM element that got removed, or an array of removed elements if multiple input elements
+		 * were passed in.
+		 * @example
+		 * // Removes all paragraphs in the active editor
+		 * tinymce.activeEditor.dom.remove(tinymce.activeEditor.dom.select('p'));
+		 *
+		 * // Removes an element by id in the document
+		 * tinymce.DOM.remove('mydiv');
+		 */
+		remove: function(node, keepChildren) {
+			node = this.$$(node);
+
+			if (keepChildren) {
+				node.each(function() {
+					var child;
+
+					while ((child = this.firstChild)) {
+						if (child.nodeType == 3 && child.data.length === 0) {
+							this.removeChild(child);
+						} else {
+							this.parentNode.insertBefore(child, this);
+						}
+					}
+				}).remove();
+			} else {
+				node.remove();
+			}
+
+			return node.length > 1 ? node.toArray() : node[0];
+		},
+
+		/**
+		 * Sets the CSS style value on a HTML element. The name can be a camelcase string
+		 * or the CSS style name like background-color.
+		 *
+		 * @method setStyle
+		 * @param {String/Element/Array} n HTML element/Element ID or Array of elements/ids to set CSS style value on.
+		 * @param {String} na Name of the style value to set.
+		 * @param {String} v Value to set on the style.
+		 * @example
+		 * // Sets a style value on all paragraphs in the currently active editor
+		 * tinymce.activeEditor.dom.setStyle(tinymce.activeEditor.dom.select('p'), 'background-color', 'red');
+		 *
+		 * // Sets a style value to an element by id in the current document
+		 * tinymce.DOM.setStyle('mydiv', 'background-color', 'red');
+		 */
+		setStyle: function(elm, name, value) {
+			elm = this.$$(elm).css(name, value);
+
+			if (this.settings.update_styles) {
+				elm.attr('data-mce-style', null);
+			}
+		},
+
+		/**
+		 * Returns the current style or runtime/computed value of an element.
+		 *
+		 * @method getStyle
+		 * @param {String/Element} elm HTML element or element id string to get style from.
+		 * @param {String} name Style name to return.
+		 * @param {Boolean} computed Computed style.
+		 * @return {String} Current style or computed style value of an element.
+		 */
+		getStyle: function(elm, name, computed) {
+			elm = this.$$(elm);
+
+			if (computed) {
+				return elm.css(name);
+			}
+
+			// Camelcase it, if needed
+			name = name.replace(/-(\D)/g, function(a, b) {
+				return b.toUpperCase();
+			});
+
+			if (name == 'float') {
+				name = isIE ? 'styleFloat' : 'cssFloat';
+			}
+
+			return elm[0] && elm[0].style ? elm[0].style[name] : undefined;
+		},
+
+		/**
+		 * Sets multiple styles on the specified element(s).
+		 *
+		 * @method setStyles
+		 * @param {Element/String/Array} e DOM element, element id string or array of elements/ids to set styles on.
+		 * @param {Object} o Name/Value collection of style items to add to the element(s).
+		 * @example
+		 * // Sets styles on all paragraphs in the currently active editor
+		 * tinymce.activeEditor.dom.setStyles(tinymce.activeEditor.dom.select('p'), {'background-color': 'red', 'color': 'green'});
+		 *
+		 * // Sets styles to an element by id in the current document
+		 * tinymce.DOM.setStyles('mydiv', {'background-color': 'red', 'color': 'green'});
+		 */
+		setStyles: function(elm, styles) {
+			elm = this.$$(elm).css(styles);
+
+			if (this.settings.update_styles) {
+				elm.attr('data-mce-style', null);
+			}
+		},
+
+		/**
+		 * Removes all attributes from an element or elements.
+		 *
+		 * @method removeAllAttribs
+		 * @param {Element/String/Array} e DOM element, element id string or array of elements/ids to remove attributes from.
+		 */
+		removeAllAttribs: function(e) {
+			return this.run(e, function(e) {
+				var i, attrs = e.attributes;
+				for (i = attrs.length - 1; i >= 0; i--) {
+					e.removeAttributeNode(attrs.item(i));
+				}
+			});
+		},
+
+		/**
+		 * Sets the specified attribute of an element or elements.
+		 *
+		 * @method setAttrib
+		 * @param {Element/String/Array} e DOM element, element id string or array of elements/ids to set attribute on.
+		 * @param {String} n Name of attribute to set.
+		 * @param {String} v Value to set on the attribute - if this value is falsy like null, 0 or '' it will remove the attribute instead.
+		 * @example
+		 * // Sets class attribute on all paragraphs in the active editor
+		 * tinymce.activeEditor.dom.setAttrib(tinymce.activeEditor.dom.select('p'), 'class', 'myclass');
+		 *
+		 * // Sets class attribute on a specific element in the current page
+		 * tinymce.dom.setAttrib('mydiv', 'class', 'myclass');
+		 */
+		setAttrib: function(elm, name, value) {
+			var self = this, originalValue, hook, settings = self.settings;
+
+			if (value === '') {
+				value = null;
+			}
+
+			elm = self.$$(elm);
+			originalValue = elm.attr(name);
+
+			if (!elm.length) {
+				return;
+			}
+
+			hook = self.attrHooks[name];
+			if (hook && hook.set) {
+				hook.set(elm, value, name);
+			} else {
+				elm.attr(name, value);
+			}
+
+			if (originalValue != value && settings.onSetAttrib) {
+				settings.onSetAttrib({
+					attrElm: elm,
+					attrName: name,
+					attrValue: value
+				});
+			}
+		},
+
+		/**
+		 * Sets two or more specified attributes of an element or elements.
+		 *
+		 * @method setAttribs
+		 * @param {Element/String/Array} elm DOM element, element id string or array of elements/ids to set attributes on.
+		 * @param {Object} attrs Name/Value collection of attribute items to add to the element(s).
+		 * @example
+		 * // Sets class and title attributes on all paragraphs in the active editor
+		 * tinymce.activeEditor.dom.setAttribs(tinymce.activeEditor.dom.select('p'), {'class': 'myclass', title: 'some title'});
+		 *
+		 * // Sets class and title attributes on a specific element in the current page
+		 * tinymce.DOM.setAttribs('mydiv', {'class': 'myclass', title: 'some title'});
+		 */
+		setAttribs: function(elm, attrs) {
+			var self = this;
+
+			self.$$(elm).each(function(i, node) {
+				each(attrs, function(value, name) {
+					self.setAttrib(node, name, value);
+				});
+			});
+		},
+
+		/**
+		 * Returns the specified attribute by name.
+		 *
+		 * @method getAttrib
+		 * @param {String/Element} elm Element string id or DOM element to get attribute from.
+		 * @param {String} name Name of attribute to get.
+		 * @param {String} defaultVal Optional default value to return if the attribute didn't exist.
+		 * @return {String} Attribute value string, default value or null if the attribute wasn't found.
+		 */
+		getAttrib: function(elm, name, defaultVal) {
+			var self = this, hook, value;
+
+			elm = self.$$(elm);
+
+			if (elm.length) {
+				hook = self.attrHooks[name];
+
+				if (hook && hook.get) {
+					value = hook.get(elm, name);
+				} else {
+					value = elm.attr(name);
+				}
+			}
+
+			if (typeof value == 'undefined') {
+				value = defaultVal || '';
+			}
+
+			return value;
+		},
+
+		/**
+		 * Returns the absolute x, y position of a node. The position will be returned in an object with x, y fields.
+		 *
+		 * @method getPos
+		 * @param {Element/String} elm HTML element or element id to get x, y position from.
+		 * @param {Element} rootElm Optional root element to stop calculations at.
+		 * @return {object} Absolute position of the specified element object with x, y fields.
+		 */
+		getPos: function(elm, rootElm) {
+			var self = this, x = 0, y = 0, offsetParent, doc = self.doc, body = doc.body, pos;
+
+			elm = self.get(elm);
+			rootElm = rootElm || body;
+
+			if (elm) {
+				// Use getBoundingClientRect if it exists since it's faster than looping offset nodes
+				// Fallback to offsetParent calculations if the body isn't static better since it stops at the body root
+				if (rootElm === body && elm.getBoundingClientRect && $(body).css('position') === 'static') {
+					pos = elm.getBoundingClientRect();
+					rootElm = self.boxModel ? doc.documentElement : body;
+
+					// Add scroll offsets from documentElement or body since IE with the wrong box model will use d.body and so do WebKit
+					// Also remove the body/documentelement clientTop/clientLeft on IE 6, 7 since they offset the position
+					x = pos.left + (doc.documentElement.scrollLeft || body.scrollLeft) - rootElm.clientLeft;
+					y = pos.top + (doc.documentElement.scrollTop || body.scrollTop) - rootElm.clientTop;
+
+					return {x: x, y: y};
+				}
+
+				offsetParent = elm;
+				while (offsetParent && offsetParent != rootElm && offsetParent.nodeType) {
+					x += offsetParent.offsetLeft || 0;
+					y += offsetParent.offsetTop || 0;
+					offsetParent = offsetParent.offsetParent;
+				}
+
+				offsetParent = elm.parentNode;
+				while (offsetParent && offsetParent != rootElm && offsetParent.nodeType) {
+					x -= offsetParent.scrollLeft || 0;
+					y -= offsetParent.scrollTop || 0;
+					offsetParent = offsetParent.parentNode;
+				}
+			}
+
+			return {x: x, y: y};
+		},
+
+		/**
+		 * Parses the specified style value into an object collection. This parser will also
+		 * merge and remove any redundant items that browsers might have added. It will also convert non-hex
+		 * colors to hex values. Urls inside the styles will also be converted to absolute/relative based on settings.
+		 *
+		 * @method parseStyle
+		 * @param {String} cssText Style value to parse, for example: border:1px solid red;.
+		 * @return {Object} Object representation of that style, for example: {border: '1px solid red'}
+		 */
+		parseStyle: function(cssText) {
+			return this.styles.parse(cssText);
+		},
+
+		/**
+		 * Serializes the specified style object into a string.
+		 *
+		 * @method serializeStyle
+		 * @param {Object} styles Object to serialize as string, for example: {border: '1px solid red'}
+		 * @param {String} name Optional element name.
+		 * @return {String} String representation of the style object, for example: border: 1px solid red.
+		 */
+		serializeStyle: function(styles, name) {
+			return this.styles.serialize(styles, name);
+		},
+
+		/**
+		 * Adds a style element at the top of the document with the specified cssText content.
+		 *
+		 * @method addStyle
+		 * @param {String} cssText CSS Text style to add to top of head of document.
+		 */
+		addStyle: function(cssText) {
+			var self = this, doc = self.doc, head, styleElm;
+
+			// Prevent inline from loading the same styles twice
+			if (self !== DOMUtils.DOM && doc === document) {
+				var addedStyles = DOMUtils.DOM.addedStyles;
+
+				addedStyles = addedStyles || [];
+				if (addedStyles[cssText]) {
+					return;
+				}
+
+				addedStyles[cssText] = true;
+				DOMUtils.DOM.addedStyles = addedStyles;
+			}
+
+			// Create style element if needed
+			styleElm = doc.getElementById('mceDefaultStyles');
+			if (!styleElm) {
+				styleElm = doc.createElement('style');
+				styleElm.id = 'mceDefaultStyles';
+				styleElm.type = 'text/css';
+
+				head = doc.getElementsByTagName('head')[0];
+				if (head.firstChild) {
+					head.insertBefore(styleElm, head.firstChild);
+				} else {
+					head.appendChild(styleElm);
+				}
+			}
+
+			// Append style data to old or new style element
+			if (styleElm.styleSheet) {
+				styleElm.styleSheet.cssText += cssText;
+			} else {
+				styleElm.appendChild(doc.createTextNode(cssText));
+			}
+		},
+
+		/**
+		 * Imports/loads the specified CSS file into the document bound to the class.
+		 *
+		 * @method loadCSS
+		 * @param {String} u URL to CSS file to load.
+		 * @example
+		 * // Loads a CSS file dynamically into the current document
+		 * tinymce.DOM.loadCSS('somepath/some.css');
+		 *
+		 * // Loads a CSS file into the currently active editor instance
+		 * tinymce.activeEditor.dom.loadCSS('somepath/some.css');
+		 *
+		 * // Loads a CSS file into an editor instance by id
+		 * tinymce.get('someid').dom.loadCSS('somepath/some.css');
+		 *
+		 * // Loads multiple CSS files into the current document
+		 * tinymce.DOM.loadCSS('somepath/some.css,somepath/someother.css');
+		 */
+		loadCSS: function(url) {
+			var self = this, doc = self.doc, head;
+
+			// Prevent inline from loading the same CSS file twice
+			if (self !== DOMUtils.DOM && doc === document) {
+				DOMUtils.DOM.loadCSS(url);
+				return;
+			}
+
+			if (!url) {
+				url = '';
+			}
+
+			head = doc.getElementsByTagName('head')[0];
+
+			each(url.split(','), function(url) {
+				var link;
+
+				url = Tools._addCacheSuffix(url);
+
+				if (self.files[url]) {
+					return;
+				}
+
+				self.files[url] = true;
+				link = self.create('link', {rel: 'stylesheet', href: url});
+
+				// IE 8 has a bug where dynamically loading stylesheets would produce a 1 item remaining bug
+				// This fix seems to resolve that issue by recalcing the document once a stylesheet finishes loading
+				// It's ugly but it seems to work fine.
+				if (isIE && doc.documentMode && doc.recalc) {
+					link.onload = function() {
+						if (doc.recalc) {
+							doc.recalc();
+						}
+
+						link.onload = null;
+					};
+				}
+
+				head.appendChild(link);
+			});
+		},
+
+		/**
+		 * Adds a class to the specified element or elements.
+		 *
+		 * @method addClass
+		 * @param {String/Element/Array} elm Element ID string or DOM element or array with elements or IDs.
+		 * @param {String} cls Class name to add to each element.
+		 * @return {String/Array} String with new class value or array with new class values for all elements.
+		 * @example
+		 * // Adds a class to all paragraphs in the active editor
+		 * tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('p'), 'myclass');
+		 *
+		 * // Adds a class to a specific element in the current page
+		 * tinymce.DOM.addClass('mydiv', 'myclass');
+		 */
+		addClass: function(elm, cls) {
+			this.$$(elm).addClass(cls);
+		},
+
+		/**
+		 * Removes a class from the specified element or elements.
+		 *
+		 * @method removeClass
+		 * @param {String/Element/Array} elm Element ID string or DOM element or array with elements or IDs.
+		 * @param {String} cls Class name to remove from each element.
+		 * @return {String/Array} String of remaining class name(s), or an array of strings if multiple input elements
+		 * were passed in.
+		 * @example
+		 * // Removes a class from all paragraphs in the active editor
+		 * tinymce.activeEditor.dom.removeClass(tinymce.activeEditor.dom.select('p'), 'myclass');
+		 *
+		 * // Removes a class from a specific element in the current page
+		 * tinymce.DOM.removeClass('mydiv', 'myclass');
+		 */
+		removeClass: function(elm, cls) {
+			this.toggleClass(elm, cls, false);
+		},
+
+		/**
+		 * Returns true if the specified element has the specified class.
+		 *
+		 * @method hasClass
+		 * @param {String/Element} n HTML element or element id string to check CSS class on.
+		 * @param {String} c CSS class to check for.
+		 * @return {Boolean} true/false if the specified element has the specified class.
+		 */
+		hasClass: function(elm, cls) {
+			return this.$$(elm).hasClass(cls);
+		},
+
+		/**
+		 * Toggles the specified class on/off.
+		 *
+		 * @method toggleClass
+		 * @param {Element} elm Element to toggle class on.
+		 * @param {[type]} cls Class to toggle on/off.
+		 * @param {[type]} state Optional state to set.
+		 */
+		toggleClass: function(elm, cls, state) {
+			this.$$(elm).toggleClass(cls, state).each(function() {
+				if (this.className === '') {
+					$(this).attr('class', null);
+				}
+			});
+		},
+
+		/**
+		 * Shows the specified element(s) by ID by setting the "display" style.
+		 *
+		 * @method show
+		 * @param {String/Element/Array} elm ID of DOM element or DOM element or array with elements or IDs to show.
+		 */
+		show: function(elm) {
+			this.$$(elm).show();
+		},
+
+		/**
+		 * Hides the specified element(s) by ID by setting the "display" style.
+		 *
+		 * @method hide
+		 * @param {String/Element/Array} e ID of DOM element or DOM element or array with elements or IDs to hide.
+		 * @example
+		 * // Hides an element by id in the document
+		 * tinymce.DOM.hide('myid');
+		 */
+		hide: function(elm) {
+			this.$$(elm).hide();
+		},
+
+		/**
+		 * Returns true/false if the element is hidden or not by checking the "display" style.
+		 *
+		 * @method isHidden
+		 * @param {String/Element} e Id or element to check display state on.
+		 * @return {Boolean} true/false if the element is hidden or not.
+		 */
+		isHidden: function(elm) {
+			return this.$$(elm).css('display') == 'none';
+		},
+
+		/**
+		 * Returns a unique id. This can be useful when generating elements on the fly.
+		 * This method will not check if the element already exists.
+		 *
+		 * @method uniqueId
+		 * @param {String} prefix Optional prefix to add in front of all ids - defaults to "mce_".
+		 * @return {String} Unique id.
+		 */
+		uniqueId: function(prefix) {
+			return (!prefix ? 'mce_' : prefix) + (this.counter++);
+		},
+
+		/**
+		 * Sets the specified HTML content inside the element or elements. The HTML will first be processed. This means
+		 * URLs will get converted, hex color values fixed etc. Check processHTML for details.
+		 *
+		 * @method setHTML
+		 * @param {Element/String/Array} elm DOM element, element id string or array of elements/ids to set HTML inside of.
+		 * @param {String} h HTML content to set as inner HTML of the element.
+		 * @example
+		 * // Sets the inner HTML of all paragraphs in the active editor
+		 * tinymce.activeEditor.dom.setHTML(tinymce.activeEditor.dom.select('p'), 'some inner html');
+		 *
+		 * // Sets the inner HTML of an element by id in the document
+		 * tinymce.DOM.setHTML('mydiv', 'some inner html');
+		 */
+		setHTML: function(elm, html) {
+			elm = this.$$(elm);
+
+			if (isIE) {
+				elm.each(function(i, target) {
+					if (target.canHaveHTML === false) {
+						return;
+					}
+
+					// Remove all child nodes, IE keeps empty text nodes in DOM
+					while (target.firstChild) {
+						target.removeChild(target.firstChild);
+					}
+
+					try {
+						// IE will remove comments from the beginning
+						// unless you padd the contents with something
+						target.innerHTML = '<br>' + html;
+						target.removeChild(target.firstChild);
+					} catch (ex) {
+						// IE sometimes produces an unknown runtime error on innerHTML if it's a div inside a p
+						$('<div>').html('<br>' + html).contents().slice(1).appendTo(target);
+					}
+
+					return html;
+				});
+			} else {
+				elm.html(html);
+			}
+		},
+
+		/**
+		 * Returns the outer HTML of an element.
+		 *
+		 * @method getOuterHTML
+		 * @param {String/Element} elm Element ID or element object to get outer HTML from.
+		 * @return {String} Outer HTML string.
+		 * @example
+		 * tinymce.DOM.getOuterHTML(editorElement);
+		 * tinymce.activeEditor.getOuterHTML(tinymce.activeEditor.getBody());
+		 */
+		getOuterHTML: function(elm) {
+			elm = this.get(elm);
+
+			// Older FF doesn't have outerHTML 3.6 is still used by some orgaizations
+			return elm.nodeType == 1 && "outerHTML" in elm ? elm.outerHTML : $('<div>').append($(elm).clone()).html();
+		},
+
+		/**
+		 * Sets the specified outer HTML on an element or elements.
+		 *
+		 * @method setOuterHTML
+		 * @param {Element/String/Array} elm DOM element, element id string or array of elements/ids to set outer HTML on.
+		 * @param {Object} html HTML code to set as outer value for the element.
+		 * @param {Document} doc Optional document scope to use in this process - defaults to the document of the DOM class.
+		 * @example
+		 * // Sets the outer HTML of all paragraphs in the active editor
+		 * tinymce.activeEditor.dom.setOuterHTML(tinymce.activeEditor.dom.select('p'), '<div>some html</div>');
+		 *
+		 * // Sets the outer HTML of an element by id in the document
+		 * tinymce.DOM.setOuterHTML('mydiv', '<div>some html</div>');
+		 */
+		setOuterHTML: function(elm, html) {
+			var self = this;
+
+			self.$$(elm).each(function() {
+				try {
+					// Older FF doesn't have outerHTML 3.6 is still used by some orgaizations
+					if ("outerHTML" in this) {
+						this.outerHTML = html;
+						return;
+					}
+				} catch (ex) {
+					// Ignore
+				}
+
+				// OuterHTML for IE it sometimes produces an "unknown runtime error"
+				self.remove($(this).html(html), true);
+			});
+		},
+
+		/**
+		 * Entity decodes a string. This method decodes any HTML entities, such as &aring;.
+		 *
+		 * @method decode
+		 * @param {String} s String to decode entities on.
+		 * @return {String} Entity decoded string.
+		 */
+		decode: Entities.decode,
+
+		/**
+		 * Entity encodes a string. This method encodes the most common entities, such as <>"&.
+		 *
+		 * @method encode
+		 * @param {String} text String to encode with entities.
+		 * @return {String} Entity encoded string.
+		 */
+		encode: Entities.encodeAllRaw,
+
+		/**
+		 * Inserts an element after the reference element.
+		 *
+		 * @method insertAfter
+		 * @param {Element} node Element to insert after the reference.
+		 * @param {Element/String/Array} reference_node Reference element, element id or array of elements to insert after.
+		 * @return {Element/Array} Element that got added or an array with elements.
+		 */
+		insertAfter: function(node, referenceNode) {
+			referenceNode = this.get(referenceNode);
+
+			return this.run(node, function(node) {
+				var parent, nextSibling;
+
+				parent = referenceNode.parentNode;
+				nextSibling = referenceNode.nextSibling;
+
+				if (nextSibling) {
+					parent.insertBefore(node, nextSibling);
+				} else {
+					parent.appendChild(node);
+				}
+
+				return node;
+			});
+		},
+
+		/**
+		 * Replaces the specified element or elements with the new element specified. The new element will
+		 * be cloned if multiple input elements are passed in.
+		 *
+		 * @method replace
+		 * @param {Element} newElm New element to replace old ones with.
+		 * @param {Element/String/Array} oldELm Element DOM node, element id or array of elements or ids to replace.
+		 * @param {Boolean} k Optional keep children state, if set to true child nodes from the old object will be added to new ones.
+		 */
+		replace: function(newElm, oldElm, keepChildren) {
+			var self = this;
+
+			return self.run(oldElm, function(oldElm) {
+				if (is(oldElm, 'array')) {
+					newElm = newElm.cloneNode(true);
+				}
+
+				if (keepChildren) {
+					each(grep(oldElm.childNodes), function(node) {
+						newElm.appendChild(node);
+					});
+				}
+
+				return oldElm.parentNode.replaceChild(newElm, oldElm);
+			});
+		},
+
+		/**
+		 * Renames the specified element and keeps its attributes and children.
+		 *
+		 * @method rename
+		 * @param {Element} elm Element to rename.
+		 * @param {String} name Name of the new element.
+		 * @return {Element} New element or the old element if it needed renaming.
+		 */
+		rename: function(elm, name) {
+			var self = this, newElm;
+
+			if (elm.nodeName != name.toUpperCase()) {
+				// Rename block element
+				newElm = self.create(name);
+
+				// Copy attribs to new block
+				each(self.getAttribs(elm), function(attrNode) {
+					self.setAttrib(newElm, attrNode.nodeName, self.getAttrib(elm, attrNode.nodeName));
+				});
+
+				// Replace block
+				self.replace(newElm, elm, 1);
+			}
+
+			return newElm || elm;
+		},
+
+		/**
+		 * Find the common ancestor of two elements. This is a shorter method than using the DOM Range logic.
+		 *
+		 * @method findCommonAncestor
+		 * @param {Element} a Element to find common ancestor of.
+		 * @param {Element} b Element to find common ancestor of.
+		 * @return {Element} Common ancestor element of the two input elements.
+		 */
+		findCommonAncestor: function(a, b) {
+			var ps = a, pe;
+
+			while (ps) {
+				pe = b;
+
+				while (pe && ps != pe) {
+					pe = pe.parentNode;
+				}
+
+				if (ps == pe) {
+					break;
+				}
+
+				ps = ps.parentNode;
+			}
+
+			if (!ps && a.ownerDocument) {
+				return a.ownerDocument.documentElement;
+			}
+
+			return ps;
+		},
+
+		/**
+		 * Parses the specified RGB color value and returns a hex version of that color.
+		 *
+		 * @method toHex
+		 * @param {String} rgbVal RGB string value like rgb(1,2,3)
+		 * @return {String} Hex version of that RGB value like #FF00FF.
+		 */
+		toHex: function(rgbVal) {
+			return this.styles.toHex(Tools.trim(rgbVal));
+		},
+
+		/**
+		 * Executes the specified function on the element by id or dom element node or array of elements/id.
+		 *
+		 * @method run
+		 * @param {String/Element/Array} Element ID or DOM element object or array with ids or elements.
+		 * @param {function} f Function to execute for each item.
+		 * @param {Object} s Optional scope to execute the function in.
+		 * @return {Object/Array} Single object, or an array of objects if multiple input elements were passed in.
+		 */
+		run: function(elm, func, scope) {
+			var self = this, result;
+
+			if (typeof elm === 'string') {
+				elm = self.get(elm);
+			}
+
+			if (!elm) {
+				return false;
+			}
+
+			scope = scope || this;
+			if (!elm.nodeType && (elm.length || elm.length === 0)) {
+				result = [];
+
+				each(elm, function(elm, i) {
+					if (elm) {
+						if (typeof elm == 'string') {
+							elm = self.get(elm);
+						}
+
+						result.push(func.call(scope, elm, i));
+					}
+				});
+
+				return result;
+			}
+
+			return func.call(scope, elm);
+		},
+
+		/**
+		 * Returns a NodeList with attributes for the element.
+		 *
+		 * @method getAttribs
+		 * @param {HTMLElement/string} elm Element node or string id to get attributes from.
+		 * @return {NodeList} NodeList with attributes.
+		 */
+		getAttribs: function(elm) {
+			var attrs;
+
+			elm = this.get(elm);
+
+			if (!elm) {
+				return [];
+			}
+
+			if (isIE) {
+				attrs = [];
+
+				// Object will throw exception in IE
+				if (elm.nodeName == 'OBJECT') {
+					return elm.attributes;
+				}
+
+				// IE doesn't keep the selected attribute if you clone option elements
+				if (elm.nodeName === 'OPTION' && this.getAttrib(elm, 'selected')) {
+					attrs.push({specified: 1, nodeName: 'selected'});
+				}
+
+				// It's crazy that this is faster in IE but it's because it returns all attributes all the time
+				var attrRegExp = /<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi;
+				elm.cloneNode(false).outerHTML.replace(attrRegExp, '').replace(/[\w:\-]+/gi, function(a) {
+					attrs.push({specified: 1, nodeName: a});
+				});
+
+				return attrs;
+			}
+
+			return elm.attributes;
+		},
+
+		/**
+		 * Returns true/false if the specified node is to be considered empty or not.
+		 *
+		 * @example
+		 * tinymce.DOM.isEmpty(node, {img: true});
+		 * @method isEmpty
+		 * @param {Object} elements Optional name/value object with elements that are automatically treated as non-empty elements.
+		 * @return {Boolean} true/false if the node is empty or not.
+		 */
+		isEmpty: function(node, elements) {
+			var self = this, i, attributes, type, walker, name, brCount = 0;
+
+			node = node.firstChild;
+			if (node) {
+				walker = new TreeWalker(node, node.parentNode);
+				elements = elements || (self.schema ? self.schema.getNonEmptyElements() : null);
+
+				do {
+					type = node.nodeType;
+
+					if (type === 1) {
+						// Ignore bogus elements
+						if (node.getAttribute('data-mce-bogus')) {
+							continue;
+						}
+
+						// Keep empty elements like <img />
+						name = node.nodeName.toLowerCase();
+						if (elements && elements[name]) {
+							// Ignore single BR elements in blocks like <p><br /></p> or <p><span><br /></span></p>
+							if (name === 'br') {
+								brCount++;
+								continue;
+							}
+
+							return false;
+						}
+
+						// Keep elements with data-bookmark attributes or name attribute like <a name="1"></a>
+						attributes = self.getAttribs(node);
+						i = attributes.length;
+						while (i--) {
+							name = attributes[i].nodeName;
+							if (name === "name" || name === 'data-mce-bookmark') {
+								return false;
+							}
+						}
+					}
+
+					// Keep comment nodes
+					if (type == 8) {
+						return false;
+					}
+
+					// Keep non whitespace text nodes
+					if ((type === 3 && !whiteSpaceRegExp.test(node.nodeValue))) {
+						return false;
+					}
+				} while ((node = walker.next()));
+			}
+
+			return brCount <= 1;
+		},
+
+		/**
+		 * Creates a new DOM Range object. This will use the native DOM Range API if it's
+		 * available. If it's not, it will fall back to the custom TinyMCE implementation.
+		 *
+		 * @method createRng
+		 * @return {DOMRange} DOM Range object.
+		 * @example
+		 * var rng = tinymce.DOM.createRng();
+		 * alert(rng.startContainer + "," + rng.startOffset);
+		 */
+		createRng: function() {
+			var doc = this.doc;
+
+			return doc.createRange ? doc.createRange() : new Range(this);
+		},
+
+		/**
+		 * Returns the index of the specified node within its parent.
+		 *
+		 * @method nodeIndex
+		 * @param {Node} node Node to look for.
+		 * @param {boolean} normalized Optional true/false state if the index is what it would be after a normalization.
+		 * @return {Number} Index of the specified node.
+		 */
+		nodeIndex: function(node, normalized) {
+			var idx = 0, lastNodeType, nodeType;
+
+			if (node) {
+				for (lastNodeType = node.nodeType, node = node.previousSibling; node; node = node.previousSibling) {
+					nodeType = node.nodeType;
+
+					// Normalize text nodes
+					if (normalized && nodeType == 3) {
+						if (nodeType == lastNodeType || !node.nodeValue.length) {
+							continue;
+						}
+					}
+					idx++;
+					lastNodeType = nodeType;
+				}
+			}
+
+			return idx;
+		},
+
+		/**
+		 * Splits an element into two new elements and places the specified split
+		 * element or elements between the new ones. For example splitting the paragraph at the bold element in
+		 * this example <p>abc<b>abc</b>123</p> would produce <p>abc</p><b>abc</b><p>123</p>.
+		 *
+		 * @method split
+		 * @param {Element} parentElm Parent element to split.
+		 * @param {Element} splitElm Element to split at.
+		 * @param {Element} replacementElm Optional replacement element to replace the split element with.
+		 * @return {Element} Returns the split element or the replacement element if that is specified.
+		 */
+		split: function(parentElm, splitElm, replacementElm) {
+			var self = this, r = self.createRng(), bef, aft, pa;
+
+			// W3C valid browsers tend to leave empty nodes to the left/right side of the contents - this makes sense
+			// but we don't want that in our code since it serves no purpose for the end user
+			// For example splitting this html at the bold element:
+			//   <p>text 1<span><b>CHOP</b></span>text 2</p>
+			// would produce:
+			//   <p>text 1<span></span></p><b>CHOP</b><p><span></span>text 2</p>
+			// this function will then trim off empty edges and produce:
+			//   <p>text 1</p><b>CHOP</b><p>text 2</p>
+			function trimNode(node) {
+				var i, children = node.childNodes, type = node.nodeType;
+
+				function surroundedBySpans(node) {
+					var previousIsSpan = node.previousSibling && node.previousSibling.nodeName == 'SPAN';
+					var nextIsSpan = node.nextSibling && node.nextSibling.nodeName == 'SPAN';
+					return previousIsSpan && nextIsSpan;
+				}
+
+				if (type == 1 && node.getAttribute('data-mce-type') == 'bookmark') {
+					return;
+				}
+
+				for (i = children.length - 1; i >= 0; i--) {
+					trimNode(children[i]);
+				}
+
+				if (type != 9) {
+					// Keep non whitespace text nodes
+					if (type == 3 && node.nodeValue.length > 0) {
+						// If parent element isn't a block or there isn't any useful contents for example "<p>   </p>"
+						// Also keep text nodes with only spaces if surrounded by spans.
+						// eg. "<p><span>a</span> <span>b</span></p>" should keep space between a and b
+						var trimmedLength = trim(node.nodeValue).length;
+						if (!self.isBlock(node.parentNode) || trimmedLength > 0 || trimmedLength === 0 && surroundedBySpans(node)) {
+							return;
+						}
+					} else if (type == 1) {
+						// If the only child is a bookmark then move it up
+						children = node.childNodes;
+
+						// TODO fix this complex if
+						if (children.length == 1 && children[0] && children[0].nodeType == 1 &&
+							children[0].getAttribute('data-mce-type') == 'bookmark') {
+							node.parentNode.insertBefore(children[0], node);
+						}
+
+						// Keep non empty elements or img, hr etc
+						if (children.length || /^(br|hr|input|img)$/i.test(node.nodeName)) {
+							return;
+						}
+					}
+
+					self.remove(node);
+				}
+
+				return node;
+			}
+
+			if (parentElm && splitElm) {
+				// Get before chunk
+				r.setStart(parentElm.parentNode, self.nodeIndex(parentElm));
+				r.setEnd(splitElm.parentNode, self.nodeIndex(splitElm));
+				bef = r.extractContents();
+
+				// Get after chunk
+				r = self.createRng();
+				r.setStart(splitElm.parentNode, self.nodeIndex(splitElm) + 1);
+				r.setEnd(parentElm.parentNode, self.nodeIndex(parentElm) + 1);
+				aft = r.extractContents();
+
+				// Insert before chunk
+				pa = parentElm.parentNode;
+				pa.insertBefore(trimNode(bef), parentElm);
+
+				// Insert middle chunk
+				if (replacementElm) {
+					pa.replaceChild(replacementElm, splitElm);
+				} else {
+					pa.insertBefore(splitElm, parentElm);
+				}
+
+				// Insert after chunk
+				pa.insertBefore(trimNode(aft), parentElm);
+				self.remove(parentElm);
+
+				return replacementElm || splitElm;
+			}
+		},
+
+		/**
+		 * Adds an event handler to the specified object.
+		 *
+		 * @method bind
+		 * @param {Element/Document/Window/Array} target Target element to bind events to.
+		 * handler to or an array of elements/ids/documents.
+		 * @param {String} name Name of event handler to add, for example: click.
+		 * @param {function} func Function to execute when the event occurs.
+		 * @param {Object} scope Optional scope to execute the function in.
+		 * @return {function} Function callback handler the same as the one passed in.
+		 */
+		bind: function(target, name, func, scope) {
+			var self = this;
+
+			if (Tools.isArray(target)) {
+				var i = target.length;
+
+				while (i--) {
+					target[i] = self.bind(target[i], name, func, scope);
+				}
+
+				return target;
+			}
+
+			// Collect all window/document events bound by editor instance
+			if (self.settings.collect && (target === self.doc || target === self.win)) {
+				self.boundEvents.push([target, name, func, scope]);
+			}
+
+			return self.events.bind(target, name, func, scope || self);
+		},
+
+		/**
+		 * Removes the specified event handler by name and function from an element or collection of elements.
+		 *
+		 * @method unbind
+		 * @param {Element/Document/Window/Array} target Target element to unbind events on.
+		 * @param {String} name Event handler name, for example: "click"
+		 * @param {function} func Function to remove.
+		 * @return {bool/Array} Bool state of true if the handler was removed, or an array of states if multiple input elements
+		 * were passed in.
+		 */
+		unbind: function(target, name, func) {
+			var self = this, i;
+
+			if (Tools.isArray(target)) {
+				i = target.length;
+
+				while (i--) {
+					target[i] = self.unbind(target[i], name, func);
+				}
+
+				return target;
+			}
+
+			// Remove any bound events matching the input
+			if (self.boundEvents && (target === self.doc || target === self.win)) {
+				i = self.boundEvents.length;
+
+				while (i--) {
+					var item = self.boundEvents[i];
+
+					if (target == item[0] && (!name || name == item[1]) && (!func || func == item[2])) {
+						this.events.unbind(item[0], item[1], item[2]);
+					}
+				}
+			}
+
+			return this.events.unbind(target, name, func);
+		},
+
+		/**
+		 * Fires the specified event name with object on target.
+		 *
+		 * @method fire
+		 * @param {Node/Document/Window} target Target element or object to fire event on.
+		 * @param {String} name Name of the event to fire.
+		 * @param {Object} evt Event object to send.
+		 * @return {Event} Event object.
+		 */
+		fire: function(target, name, evt) {
+			return this.events.fire(target, name, evt);
+		},
+
+		// Returns the content editable state of a node
+		getContentEditable: function(node) {
+			var contentEditable;
+
+			// Check type
+			if (!node || node.nodeType != 1) {
+				return null;
+			}
+
+			// Check for fake content editable
+			contentEditable = node.getAttribute("data-mce-contenteditable");
+			if (contentEditable && contentEditable !== "inherit") {
+				return contentEditable;
+			}
+
+			// Check for real content editable
+			return node.contentEditable !== "inherit" ? node.contentEditable : null;
+		},
+
+		getContentEditableParent: function(node) {
+			var root = this.getRoot(), state = null;
+
+			for (; node && node !== root; node = node.parentNode) {
+				state = this.getContentEditable(node);
+
+				if (state !== null) {
+					break;
+				}
+			}
+
+			return state;
+		},
+
+		/**
+		 * Destroys all internal references to the DOM to solve IE leak issues.
+		 *
+		 * @method destroy
+		 */
+		destroy: function() {
+			var self = this;
+
+			// Unbind all events bound to window/document by editor instance
+			if (self.boundEvents) {
+				var i = self.boundEvents.length;
+
+				while (i--) {
+					var item = self.boundEvents[i];
+					this.events.unbind(item[0], item[1], item[2]);
+				}
+
+				self.boundEvents = null;
+			}
+
+			// Restore sizzle document to window.document
+			// Since the current document might be removed producing "Permission denied" on IE see #6325
+			if (Sizzle.setDocument) {
+				Sizzle.setDocument();
+			}
+
+			self.win = self.doc = self.root = self.events = self.frag = null;
+		},
+
+		isChildOf: function(node, parent) {
+			while (node) {
+				if (parent === node) {
+					return true;
+				}
+
+				node = node.parentNode;
+			}
+
+			return false;
+		},
+
+		// #ifdef debug
+
+		dumpRng: function(r) {
+			return (
+				'startContainer: ' + r.startContainer.nodeName +
+				', startOffset: ' + r.startOffset +
+				', endContainer: ' + r.endContainer.nodeName +
+				', endOffset: ' + r.endOffset
+			);
+		},
+
+		// #endif
+
+		_findSib: function(node, selector, name) {
+			var self = this, func = selector;
+
+			if (node) {
+				// If expression make a function of it using is
+				if (typeof func == 'string') {
+					func = function(node) {
+						return self.is(node, selector);
+					};
+				}
+
+				// Loop all siblings
+				for (node = node[name]; node; node = node[name]) {
+					if (func(node)) {
+						return node;
+					}
+				}
+			}
+
+			return null;
+		}
+	};
+
+	/**
+	 * Instance of DOMUtils for the current document.
+	 *
+	 * @static
+	 * @property DOM
+	 * @type tinymce.dom.DOMUtils
+	 * @example
+	 * // Example of how to add a class to some element by id
+	 * tinymce.DOM.addClass('someid', 'someclass');
+	 */
+	DOMUtils.DOM = new DOMUtils(document);
+
+	return DOMUtils;
+});
+
+// Included from: js/tinymce/classes/dom/ScriptLoader.js
+
+/**
+ * ScriptLoader.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*globals console*/
+
+/**
+ * This class handles asynchronous/synchronous loading of JavaScript files it will execute callbacks
+ * when various items gets loaded. This class is useful to load external JavaScript files.
+ *
+ * @class tinymce.dom.ScriptLoader
+ * @example
+ * // Load a script from a specific URL using the global script loader
+ * tinymce.ScriptLoader.load('somescript.js');
+ *
+ * // Load a script using a unique instance of the script loader
+ * var scriptLoader = new tinymce.dom.ScriptLoader();
+ *
+ * scriptLoader.load('somescript.js');
+ *
+ * // Load multiple scripts
+ * var scriptLoader = new tinymce.dom.ScriptLoader();
+ *
+ * scriptLoader.add('somescript1.js');
+ * scriptLoader.add('somescript2.js');
+ * scriptLoader.add('somescript3.js');
+ *
+ * scriptLoader.loadQueue(function() {
+ *    alert('All scripts are now loaded.');
+ * });
+ */
+define("tinymce/dom/ScriptLoader", [
+	"tinymce/dom/DOMUtils",
+	"tinymce/util/Tools"
+], function(DOMUtils, Tools) {
+	var DOM = DOMUtils.DOM;
+	var each = Tools.each, grep = Tools.grep;
+
+	function ScriptLoader() {
+		var QUEUED = 0,
+			LOADING = 1,
+			LOADED = 2,
+			states = {},
+			queue = [],
+			scriptLoadedCallbacks = {},
+			queueLoadedCallbacks = [],
+			loading = 0,
+			undef;
+
+		/**
+		 * Loads a specific script directly without adding it to the load queue.
+		 *
+		 * @method load
+		 * @param {String} url Absolute URL to script to add.
+		 * @param {function} callback Optional callback function to execute ones this script gets loaded.
+		 * @param {Object} scope Optional scope to execute callback in.
+		 */
+		function loadScript(url, callback) {
+			var dom = DOM, elm, id;
+
+			// Execute callback when script is loaded
+			function done() {
+				dom.remove(id);
+
+				if (elm) {
+					elm.onreadystatechange = elm.onload = elm = null;
+				}
+
+				callback();
+			}
+
+			function error() {
+				/*eslint no-console:0 */
+
+				// Report the error so it's easier for people to spot loading errors
+				if (typeof console !== "undefined" && console.log) {
+					console.log("Failed to load: " + url);
+				}
+
+				// We can't mark it as done if there is a load error since
+				// A) We don't want to produce 404 errors on the server and
+				// B) the onerror event won't fire on all browsers.
+				// done();
+			}
+
+			id = dom.uniqueId();
+
+			// Create new script element
+			elm = document.createElement('script');
+			elm.id = id;
+			elm.type = 'text/javascript';
+			elm.src = Tools._addCacheSuffix(url);
+
+			// Seems that onreadystatechange works better on IE 10 onload seems to fire incorrectly
+			if ("onreadystatechange" in elm) {
+				elm.onreadystatechange = function() {
+					if (/loaded|complete/.test(elm.readyState)) {
+						done();
+					}
+				};
+			} else {
+				elm.onload = done;
+			}
+
+			// Add onerror event will get fired on some browsers but not all of them
+			elm.onerror = error;
+
+			// Add script to document
+			(document.getElementsByTagName('head')[0] || document.body).appendChild(elm);
+		}
+
+		/**
+		 * Returns true/false if a script has been loaded or not.
+		 *
+		 * @method isDone
+		 * @param {String} url URL to check for.
+		 * @return {Boolean} true/false if the URL is loaded.
+		 */
+		this.isDone = function(url) {
+			return states[url] == LOADED;
+		};
+
+		/**
+		 * Marks a specific script to be loaded. This can be useful if a script got loaded outside
+		 * the script loader or to skip it from loading some script.
+		 *
+		 * @method markDone
+		 * @param {string} u Absolute URL to the script to mark as loaded.
+		 */
+		this.markDone = function(url) {
+			states[url] = LOADED;
+		};
+
+		/**
+		 * Adds a specific script to the load queue of the script loader.
+		 *
+		 * @method add
+		 * @param {String} url Absolute URL to script to add.
+		 * @param {function} callback Optional callback function to execute ones this script gets loaded.
+		 * @param {Object} scope Optional scope to execute callback in.
+		 */
+		this.add = this.load = function(url, callback, scope) {
+			var state = states[url];
+
+			// Add url to load queue
+			if (state == undef) {
+				queue.push(url);
+				states[url] = QUEUED;
+			}
+
+			if (callback) {
+				// Store away callback for later execution
+				if (!scriptLoadedCallbacks[url]) {
+					scriptLoadedCallbacks[url] = [];
+				}
+
+				scriptLoadedCallbacks[url].push({
+					func: callback,
+					scope: scope || this
+				});
+			}
+		};
+
+		/**
+		 * Starts the loading of the queue.
+		 *
+		 * @method loadQueue
+		 * @param {function} callback Optional callback to execute when all queued items are loaded.
+		 * @param {Object} scope Optional scope to execute the callback in.
+		 */
+		this.loadQueue = function(callback, scope) {
+			this.loadScripts(queue, callback, scope);
+		};
+
+		/**
+		 * Loads the specified queue of files and executes the callback ones they are loaded.
+		 * This method is generally not used outside this class but it might be useful in some scenarios.
+		 *
+		 * @method loadScripts
+		 * @param {Array} scripts Array of queue items to load.
+		 * @param {function} callback Optional callback to execute ones all items are loaded.
+		 * @param {Object} scope Optional scope to execute callback in.
+		 */
+		this.loadScripts = function(scripts, callback, scope) {
+			var loadScripts;
+
+			function execScriptLoadedCallbacks(url) {
+				// Execute URL callback functions
+				each(scriptLoadedCallbacks[url], function(callback) {
+					callback.func.call(callback.scope);
+				});
+
+				scriptLoadedCallbacks[url] = undef;
+			}
+
+			queueLoadedCallbacks.push({
+				func: callback,
+				scope: scope || this
+			});
+
+			loadScripts = function() {
+				var loadingScripts = grep(scripts);
+
+				// Current scripts has been handled
+				scripts.length = 0;
+
+				// Load scripts that needs to be loaded
+				each(loadingScripts, function(url) {
+					// Script is already loaded then execute script callbacks directly
+					if (states[url] == LOADED) {
+						execScriptLoadedCallbacks(url);
+						return;
+					}
+
+					// Is script not loading then start loading it
+					if (states[url] != LOADING) {
+						states[url] = LOADING;
+						loading++;
+
+						loadScript(url, function() {
+							states[url] = LOADED;
+							loading--;
+
+							execScriptLoadedCallbacks(url);
+
+							// Load more scripts if they where added by the recently loaded script
+							loadScripts();
+						});
+					}
+				});
+
+				// No scripts are currently loading then execute all pending queue loaded callbacks
+				if (!loading) {
+					each(queueLoadedCallbacks, function(callback) {
+						callback.func.call(callback.scope);
+					});
+
+					queueLoadedCallbacks.length = 0;
+				}
+			};
+
+			loadScripts();
+		};
+	}
+
+	ScriptLoader.ScriptLoader = new ScriptLoader();
+
+	return ScriptLoader;
+});
+
+// Included from: js/tinymce/classes/AddOnManager.js
+
+/**
+ * AddOnManager.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles the loading of themes/plugins or other add-ons and their language packs.
+ *
+ * @class tinymce.AddOnManager
+ */
+define("tinymce/AddOnManager", [
+	"tinymce/dom/ScriptLoader",
+	"tinymce/util/Tools"
+], function(ScriptLoader, Tools) {
+	var each = Tools.each;
+
+	function AddOnManager() {
+		var self = this;
+
+		self.items = [];
+		self.urls = {};
+		self.lookup = {};
+	}
+
+	AddOnManager.prototype = {
+		/**
+		 * Returns the specified add on by the short name.
+		 *
+		 * @method get
+		 * @param {String} name Add-on to look for.
+		 * @return {tinymce.Theme/tinymce.Plugin} Theme or plugin add-on instance or undefined.
+		 */
+		get: function(name) {
+			if (this.lookup[name]) {
+				return this.lookup[name].instance;
+			} else {
+				return undefined;
+			}
+		},
+
+		dependencies: function(name) {
+			var result;
+
+			if (this.lookup[name]) {
+				result = this.lookup[name].dependencies;
+			}
+
+			return result || [];
+		},
+
+		/**
+		 * Loads a language pack for the specified add-on.
+		 *
+		 * @method requireLangPack
+		 * @param {String} name Short name of the add-on.
+		 * @param {String} languages Optional comma or space separated list of languages to check if it matches the name.
+		 */
+		requireLangPack: function(name, languages) {
+			var language = AddOnManager.language;
+
+			if (language && AddOnManager.languageLoad !== false) {
+				if (languages) {
+					languages = ',' + languages + ',';
+
+					// Load short form sv.js or long form sv_SE.js
+					if (languages.indexOf(',' + language.substr(0, 2) + ',') != -1) {
+						language = language.substr(0, 2);
+					} else if (languages.indexOf(',' + language + ',') == -1) {
+						return;
+					}
+				}
+
+				ScriptLoader.ScriptLoader.add(this.urls[name] + '/langs/' + language + '.js');
+			}
+		},
+
+		/**
+		 * Adds a instance of the add-on by it's short name.
+		 *
+		 * @method add
+		 * @param {String} id Short name/id for the add-on.
+		 * @param {tinymce.Theme/tinymce.Plugin} addOn Theme or plugin to add.
+		 * @return {tinymce.Theme/tinymce.Plugin} The same theme or plugin instance that got passed in.
+		 * @example
+		 * // Create a simple plugin
+		 * tinymce.create('tinymce.plugins.TestPlugin', {
+		 *   TestPlugin: function(ed, url) {
+		 *   ed.on('click', function(e) {
+		 *      ed.windowManager.alert('Hello World!');
+		 *   });
+		 *   }
+		 * });
+		 *
+		 * // Register plugin using the add method
+		 * tinymce.PluginManager.add('test', tinymce.plugins.TestPlugin);
+		 *
+		 * // Initialize TinyMCE
+		 * tinymce.init({
+		 *  ...
+		 *  plugins: '-test' // Init the plugin but don't try to load it
+		 * });
+		 */
+		add: function(id, addOn, dependencies) {
+			this.items.push(addOn);
+			this.lookup[id] = {instance: addOn, dependencies: dependencies};
+
+			return addOn;
+		},
+
+		createUrl: function(baseUrl, dep) {
+			if (typeof dep === "object") {
+				return dep;
+			} else {
+				return {prefix: baseUrl.prefix, resource: dep, suffix: baseUrl.suffix};
+			}
+		},
+
+		/**
+		 * Add a set of components that will make up the add-on. Using the url of the add-on name as the base url.
+		 * This should be used in development mode.  A new compressor/javascript munger process will ensure that the
+		 * components are put together into the plugin.js file and compressed correctly.
+		 *
+		 * @method addComponents
+		 * @param {String} pluginName name of the plugin to load scripts from (will be used to get the base url for the plugins).
+		 * @param {Array} scripts Array containing the names of the scripts to load.
+		 */
+		addComponents: function(pluginName, scripts) {
+			var pluginUrl = this.urls[pluginName];
+
+			each(scripts, function(script) {
+				ScriptLoader.ScriptLoader.add(pluginUrl + "/" + script);
+			});
+		},
+
+		/**
+		 * Loads an add-on from a specific url.
+		 *
+		 * @method load
+		 * @param {String} name Short name of the add-on that gets loaded.
+		 * @param {String} addOnUrl URL to the add-on that will get loaded.
+		 * @param {function} callback Optional callback to execute ones the add-on is loaded.
+		 * @param {Object} scope Optional scope to execute the callback in.
+		 * @example
+		 * // Loads a plugin from an external URL
+		 * tinymce.PluginManager.load('myplugin', '/some/dir/someplugin/plugin.js');
+		 *
+		 * // Initialize TinyMCE
+		 * tinymce.init({
+		 *  ...
+		 *  plugins: '-myplugin' // Don't try to load it again
+		 * });
+		 */
+		load: function(name, addOnUrl, callback, scope) {
+			var self = this, url = addOnUrl;
+
+			function loadDependencies() {
+				var dependencies = self.dependencies(name);
+
+				each(dependencies, function(dep) {
+					var newUrl = self.createUrl(addOnUrl, dep);
+
+					self.load(newUrl.resource, newUrl, undefined, undefined);
+				});
+
+				if (callback) {
+					if (scope) {
+						callback.call(scope);
+					} else {
+						callback.call(ScriptLoader);
+					}
+				}
+			}
+
+			if (self.urls[name]) {
+				return;
+			}
+
+			if (typeof addOnUrl === "object") {
+				url = addOnUrl.prefix + addOnUrl.resource + addOnUrl.suffix;
+			}
+
+			if (url.indexOf('/') !== 0 && url.indexOf('://') == -1) {
+				url = AddOnManager.baseURL + '/' + url;
+			}
+
+			self.urls[name] = url.substring(0, url.lastIndexOf('/'));
+
+			if (self.lookup[name]) {
+				loadDependencies();
+			} else {
+				ScriptLoader.ScriptLoader.add(url, loadDependencies, scope);
+			}
+		}
+	};
+
+	AddOnManager.PluginManager = new AddOnManager();
+	AddOnManager.ThemeManager = new AddOnManager();
+
+	return AddOnManager;
+});
+
+/**
+ * TinyMCE theme class.
+ *
+ * @class tinymce.Theme
+ */
+
+/**
+ * This method is responsible for rendering/generating the overall user interface with toolbars, buttons, iframe containers etc.
+ *
+ * @method renderUI
+ * @param {Object} obj Object parameter containing the targetNode DOM node that will be replaced visually with an editor instance.
+ * @return {Object} an object with items like iframeContainer, editorContainer, sizeContainer, deltaWidth, deltaHeight.
+ */
+
+/**
+ * Plugin base class, this is a pseudo class that describes how a plugin is to be created for TinyMCE. The methods below are all optional.
+ *
+ * @class tinymce.Plugin
+ * @example
+ * tinymce.PluginManager.add('example', function(editor, url) {
+ *     // Add a button that opens a window
+ *     editor.addButton('example', {
+ *         text: 'My button',
+ *         icon: false,
+ *         onclick: function() {
+ *             // Open window
+ *             editor.windowManager.open({
+ *                 title: 'Example plugin',
+ *                 body: [
+ *                     {type: 'textbox', name: 'title', label: 'Title'}
+ *                 ],
+ *                 onsubmit: function(e) {
+ *                     // Insert content when the window form is submitted
+ *                     editor.insertContent('Title: ' + e.data.title);
+ *                 }
+ *             });
+ *         }
+ *     });
+ *
+ *     // Adds a menu item to the tools menu
+ *     editor.addMenuItem('example', {
+ *         text: 'Example plugin',
+ *         context: 'tools',
+ *         onclick: function() {
+ *             // Open window with a specific url
+ *             editor.windowManager.open({
+ *                 title: 'TinyMCE site',
+ *                 url: 'http://www.tinymce.com',
+ *                 width: 800,
+ *                 height: 600,
+ *                 buttons: [{
+ *                     text: 'Close',
+ *                     onclick: 'close'
+ *                 }]
+ *             });
+ *         }
+ *     });
+ * });
+ */
+
+// Included from: js/tinymce/classes/dom/RangeUtils.js
+
+/**
+ * RangeUtils.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class contains a few utility methods for ranges.
+ *
+ * @class tinymce.dom.RangeUtils
+ */
+define("tinymce/dom/RangeUtils", [
+	"tinymce/util/Tools",
+	"tinymce/dom/TreeWalker"
+], function(Tools, TreeWalker) {
+	var each = Tools.each;
+
+	function getEndChild(container, index) {
+		var childNodes = container.childNodes;
+
+		index--;
+
+		if (index > childNodes.length - 1) {
+			index = childNodes.length - 1;
+		} else if (index < 0) {
+			index = 0;
+		}
+
+		return childNodes[index] || container;
+	}
+
+	function RangeUtils(dom) {
+		/**
+		 * Walks the specified range like object and executes the callback for each sibling collection it finds.
+		 *
+		 * @method walk
+		 * @param {Object} rng Range like object.
+		 * @param {function} callback Callback function to execute for each sibling collection.
+		 */
+		this.walk = function(rng, callback) {
+			var startContainer = rng.startContainer,
+				startOffset = rng.startOffset,
+				endContainer = rng.endContainer,
+				endOffset = rng.endOffset,
+				ancestor, startPoint,
+				endPoint, node, parent, siblings, nodes;
+
+			// Handle table cell selection the table plugin enables
+			// you to fake select table cells and perform formatting actions on them
+			nodes = dom.select('td.mce-item-selected,th.mce-item-selected');
+			if (nodes.length > 0) {
+				each(nodes, function(node) {
+					callback([node]);
+				});
+
+				return;
+			}
+
+			/**
+			 * Excludes start/end text node if they are out side the range
+			 *
+			 * @private
+			 * @param {Array} nodes Nodes to exclude items from.
+			 * @return {Array} Array with nodes excluding the start/end container if needed.
+			 */
+			function exclude(nodes) {
+				var node;
+
+				// First node is excluded
+				node = nodes[0];
+				if (node.nodeType === 3 && node === startContainer && startOffset >= node.nodeValue.length) {
+					nodes.splice(0, 1);
+				}
+
+				// Last node is excluded
+				node = nodes[nodes.length - 1];
+				if (endOffset === 0 && nodes.length > 0 && node === endContainer && node.nodeType === 3) {
+					nodes.splice(nodes.length - 1, 1);
+				}
+
+				return nodes;
+			}
+
+			/**
+			 * Collects siblings
+			 *
+			 * @private
+			 * @param {Node} node Node to collect siblings from.
+			 * @param {String} name Name of the sibling to check for.
+			 * @return {Array} Array of collected siblings.
+			 */
+			function collectSiblings(node, name, end_node) {
+				var siblings = [];
+
+				for (; node && node != end_node; node = node[name]) {
+					siblings.push(node);
+				}
+
+				return siblings;
+			}
+
+			/**
+			 * Find an end point this is the node just before the common ancestor root.
+			 *
+			 * @private
+			 * @param {Node} node Node to start at.
+			 * @param {Node} root Root/ancestor element to stop just before.
+			 * @return {Node} Node just before the root element.
+			 */
+			function findEndPoint(node, root) {
+				do {
+					if (node.parentNode == root) {
+						return node;
+					}
+
+					node = node.parentNode;
+				} while (node);
+			}
+
+			function walkBoundary(start_node, end_node, next) {
+				var siblingName = next ? 'nextSibling' : 'previousSibling';
+
+				for (node = start_node, parent = node.parentNode; node && node != end_node; node = parent) {
+					parent = node.parentNode;
+					siblings = collectSiblings(node == start_node ? node : node[siblingName], siblingName);
+
+					if (siblings.length) {
+						if (!next) {
+							siblings.reverse();
+						}
+
+						callback(exclude(siblings));
+					}
+				}
+			}
+
+			// If index based start position then resolve it
+			if (startContainer.nodeType == 1 && startContainer.hasChildNodes()) {
+				startContainer = startContainer.childNodes[startOffset];
+			}
+
+			// If index based end position then resolve it
+			if (endContainer.nodeType == 1 && endContainer.hasChildNodes()) {
+				endContainer = getEndChild(endContainer, endOffset);
+			}
+
+			// Same container
+			if (startContainer == endContainer) {
+				return callback(exclude([startContainer]));
+			}
+
+			// Find common ancestor and end points
+			ancestor = dom.findCommonAncestor(startContainer, endContainer);
+
+			// Process left side
+			for (node = startContainer; node; node = node.parentNode) {
+				if (node === endContainer) {
+					return walkBoundary(startContainer, ancestor, true);
+				}
+
+				if (node === ancestor) {
+					break;
+				}
+			}
+
+			// Process right side
+			for (node = endContainer; node; node = node.parentNode) {
+				if (node === startContainer) {
+					return walkBoundary(endContainer, ancestor);
+				}
+
+				if (node === ancestor) {
+					break;
+				}
+			}
+
+			// Find start/end point
+			startPoint = findEndPoint(startContainer, ancestor) || startContainer;
+			endPoint = findEndPoint(endContainer, ancestor) || endContainer;
+
+			// Walk left leaf
+			walkBoundary(startContainer, startPoint, true);
+
+			// Walk the middle from start to end point
+			siblings = collectSiblings(
+				startPoint == startContainer ? startPoint : startPoint.nextSibling,
+				'nextSibling',
+				endPoint == endContainer ? endPoint.nextSibling : endPoint
+			);
+
+			if (siblings.length) {
+				callback(exclude(siblings));
+			}
+
+			// Walk right leaf
+			walkBoundary(endContainer, endPoint);
+		};
+
+		/**
+		 * Splits the specified range at it's start/end points.
+		 *
+		 * @private
+		 * @param {Range/RangeObject} rng Range to split.
+		 * @return {Object} Range position object.
+		 */
+		this.split = function(rng) {
+			var startContainer = rng.startContainer,
+				startOffset = rng.startOffset,
+				endContainer = rng.endContainer,
+				endOffset = rng.endOffset;
+
+			function splitText(node, offset) {
+				return node.splitText(offset);
+			}
+
+			// Handle single text node
+			if (startContainer == endContainer && startContainer.nodeType == 3) {
+				if (startOffset > 0 && startOffset < startContainer.nodeValue.length) {
+					endContainer = splitText(startContainer, startOffset);
+					startContainer = endContainer.previousSibling;
+
+					if (endOffset > startOffset) {
+						endOffset = endOffset - startOffset;
+						startContainer = endContainer = splitText(endContainer, endOffset).previousSibling;
+						endOffset = endContainer.nodeValue.length;
+						startOffset = 0;
+					} else {
+						endOffset = 0;
+					}
+				}
+			} else {
+				// Split startContainer text node if needed
+				if (startContainer.nodeType == 3 && startOffset > 0 && startOffset < startContainer.nodeValue.length) {
+					startContainer = splitText(startContainer, startOffset);
+					startOffset = 0;
+				}
+
+				// Split endContainer text node if needed
+				if (endContainer.nodeType == 3 && endOffset > 0 && endOffset < endContainer.nodeValue.length) {
+					endContainer = splitText(endContainer, endOffset).previousSibling;
+					endOffset = endContainer.nodeValue.length;
+				}
+			}
+
+			return {
+				startContainer: startContainer,
+				startOffset: startOffset,
+				endContainer: endContainer,
+				endOffset: endOffset
+			};
+		};
+
+		/**
+		 * Normalizes the specified range by finding the closest best suitable caret location.
+		 *
+		 * @private
+		 * @param {Range} rng Range to normalize.
+		 * @return {Boolean} True/false if the specified range was normalized or not.
+		 */
+		this.normalize = function(rng) {
+			var normalized, collapsed;
+
+			function normalizeEndPoint(start) {
+				var container, offset, walker, body = dom.getRoot(), node, nonEmptyElementsMap;
+				var directionLeft, isAfterNode;
+
+				function hasBrBeforeAfter(node, left) {
+					var walker = new TreeWalker(node, dom.getParent(node.parentNode, dom.isBlock) || body);
+
+					while ((node = walker[left ? 'prev' : 'next']())) {
+						if (node.nodeName === "BR") {
+							return true;
+						}
+					}
+				}
+
+				function isPrevNode(node, name) {
+					return node.previousSibling && node.previousSibling.nodeName == name;
+				}
+
+				// Walks the dom left/right to find a suitable text node to move the endpoint into
+				// It will only walk within the current parent block or body and will stop if it hits a block or a BR/IMG
+				function findTextNodeRelative(left, startNode) {
+					var walker, lastInlineElement, parentBlockContainer;
+
+					startNode = startNode || container;
+					parentBlockContainer = dom.getParent(startNode.parentNode, dom.isBlock) || body;
+
+					// Lean left before the BR element if it's the only BR within a block element. Gecko bug: #6680
+					// This: <p><br>|</p> becomes <p>|<br></p>
+					if (left && startNode.nodeName == 'BR' && isAfterNode && dom.isEmpty(parentBlockContainer)) {
+						container = startNode.parentNode;
+						offset = dom.nodeIndex(startNode);
+						normalized = true;
+						return;
+					}
+
+					// Walk left until we hit a text node we can move to or a block/br/img
+					walker = new TreeWalker(startNode, parentBlockContainer);
+					while ((node = walker[left ? 'prev' : 'next']())) {
+						// Break if we hit a non content editable node
+						if (dom.getContentEditableParent(node) === "false") {
+							return;
+						}
+
+						// Found text node that has a length
+						if (node.nodeType === 3 && node.nodeValue.length > 0) {
+							container = node;
+							offset = left ? node.nodeValue.length : 0;
+							normalized = true;
+							return;
+						}
+
+						// Break if we find a block or a BR/IMG/INPUT etc
+						if (dom.isBlock(node) || nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
+							return;
+						}
+
+						lastInlineElement = node;
+					}
+
+					// Only fetch the last inline element when in caret mode for now
+					if (collapsed && lastInlineElement) {
+						container = lastInlineElement;
+						normalized = true;
+						offset = 0;
+					}
+				}
+
+				container = rng[(start ? 'start' : 'end') + 'Container'];
+				offset = rng[(start ? 'start' : 'end') + 'Offset'];
+				isAfterNode = container.nodeType == 1 && offset === container.childNodes.length;
+				nonEmptyElementsMap = dom.schema.getNonEmptyElements();
+				directionLeft = start;
+
+				if (container.nodeType == 1 && offset > container.childNodes.length - 1) {
+					directionLeft = false;
+				}
+
+				// If the container is a document move it to the body element
+				if (container.nodeType === 9) {
+					container = dom.getRoot();
+					offset = 0;
+				}
+
+				// If the container is body try move it into the closest text node or position
+				if (container === body) {
+					// If start is before/after a image, table etc
+					if (directionLeft) {
+						node = container.childNodes[offset > 0 ? offset - 1 : 0];
+						if (node) {
+							if (nonEmptyElementsMap[node.nodeName] || node.nodeName == "TABLE") {
+								return;
+							}
+						}
+					}
+
+					// Resolve the index
+					if (container.hasChildNodes()) {
+						offset = Math.min(!directionLeft && offset > 0 ? offset - 1 : offset, container.childNodes.length - 1);
+						container = container.childNodes[offset];
+						offset = 0;
+
+						// Don't walk into elements that doesn't have any child nodes like a IMG
+						if (container.hasChildNodes() && !/TABLE/.test(container.nodeName)) {
+							// Walk the DOM to find a text node to place the caret at or a BR
+							node = container;
+							walker = new TreeWalker(container, body);
+
+							do {
+								// Found a text node use that position
+								if (node.nodeType === 3 && node.nodeValue.length > 0) {
+									offset = directionLeft ? 0 : node.nodeValue.length;
+									container = node;
+									normalized = true;
+									break;
+								}
+
+								// Found a BR/IMG element that we can place the caret before
+								if (nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
+									offset = dom.nodeIndex(node);
+									container = node.parentNode;
+
+									// Put caret after image when moving the end point
+									if (node.nodeName == "IMG" && !directionLeft) {
+										offset++;
+									}
+
+									normalized = true;
+									break;
+								}
+							} while ((node = (directionLeft ? walker.next() : walker.prev())));
+						}
+					}
+				}
+
+				// Lean the caret to the left if possible
+				if (collapsed) {
+					// So this: <b>x</b><i>|x</i>
+					// Becomes: <b>x|</b><i>x</i>
+					// Seems that only gecko has issues with this
+					if (container.nodeType === 3 && offset === 0) {
+						findTextNodeRelative(true);
+					}
+
+					// Lean left into empty inline elements when the caret is before a BR
+					// So this: <i><b></b><i>|<br></i>
+					// Becomes: <i><b>|</b><i><br></i>
+					// Seems that only gecko has issues with this.
+					// Special edge case for <p><a>x</a>|<br></p> since we don't want <p><a>x|</a><br></p>
+					if (container.nodeType === 1) {
+						node = container.childNodes[offset];
+
+						// Offset is after the containers last child
+						// then use the previous child for normalization
+						if (!node) {
+							node = container.childNodes[offset - 1];
+						}
+
+						if (node && node.nodeName === 'BR' && !isPrevNode(node, 'A') &&
+							!hasBrBeforeAfter(node) && !hasBrBeforeAfter(node, true)) {
+							findTextNodeRelative(true, node);
+						}
+					}
+				}
+
+				// Lean the start of the selection right if possible
+				// So this: x[<b>x]</b>
+				// Becomes: x<b>[x]</b>
+				if (directionLeft && !collapsed && container.nodeType === 3 && offset === container.nodeValue.length) {
+					findTextNodeRelative(false);
+				}
+
+				// Set endpoint if it was normalized
+				if (normalized) {
+					rng['set' + (start ? 'Start' : 'End')](container, offset);
+				}
+			}
+
+			collapsed = rng.collapsed;
+
+			normalizeEndPoint(true);
+
+			if (!collapsed) {
+				normalizeEndPoint();
+			}
+
+			// If it was collapsed then make sure it still is
+			if (normalized && collapsed) {
+				rng.collapse(true);
+			}
+
+			return normalized;
+		};
+	}
+
+	/**
+	 * Compares two ranges and checks if they are equal.
+	 *
+	 * @static
+	 * @method compareRanges
+	 * @param {DOMRange} rng1 First range to compare.
+	 * @param {DOMRange} rng2 First range to compare.
+	 * @return {Boolean} true/false if the ranges are equal.
+	 */
+	RangeUtils.compareRanges = function(rng1, rng2) {
+		if (rng1 && rng2) {
+			// Compare native IE ranges
+			if (rng1.item || rng1.duplicate) {
+				// Both are control ranges and the selected element matches
+				if (rng1.item && rng2.item && rng1.item(0) === rng2.item(0)) {
+					return true;
+				}
+
+				// Both are text ranges and the range matches
+				if (rng1.isEqual && rng2.isEqual && rng2.isEqual(rng1)) {
+					return true;
+				}
+			} else {
+				// Compare w3c ranges
+				return rng1.startContainer == rng2.startContainer && rng1.startOffset == rng2.startOffset;
+			}
+		}
+
+		return false;
+	};
+
+	/**
+	 * Gets the caret range for the given x/y location.
+	 *
+	 * @static
+	 * @method getCaretRangeFromPoint
+	 * @param {Number} x X coordinate for range
+	 * @param {Number} y Y coordinate for range
+	 * @param {Document} doc Document that x/y are relative to
+	 * @returns {Range} caret range
+	 */
+	RangeUtils.getCaretRangeFromPoint = function(x, y, doc) {
+		var rng, point;
+
+		if (doc.caretPositionFromPoint) {
+			point = doc.caretPositionFromPoint(x, y);
+			rng = doc.createRange();
+			rng.setStart(point.offsetNode, point.offset);
+			rng.collapse(true);
+		} else if (doc.caretRangeFromPoint) {
+			rng = doc.caretRangeFromPoint(x, y);
+		} else if (doc.body.createTextRange) {
+			rng = doc.body.createTextRange();
+
+			try {
+				rng.moveToPoint(x, y);
+				rng.collapse(true);
+			} catch (ex) {
+				// Append to top or bottom depending on drop location
+				rng.collapse(y < doc.body.clientHeight);
+			}
+		}
+
+		return rng;
+	};
+
+	RangeUtils.getNode = function(container, offset) {
+		if (container.nodeType == 1 && container.hasChildNodes()) {
+			if (offset >= container.childNodes.length) {
+				offset = container.childNodes.length - 1;
+			}
+
+			container = container.childNodes[offset];
+		}
+
+		return container;
+	};
+
+	return RangeUtils;
+});
+
+// Included from: js/tinymce/classes/NodeChange.js
+
+/**
+ * NodeChange.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles the nodechange event dispatching both manual and though selection change events.
+ *
+ * @class tinymce.NodeChange
+ * @private
+ */
+define("tinymce/NodeChange", [
+	"tinymce/dom/RangeUtils",
+	"tinymce/Env"
+], function(RangeUtils, Env) {
+	return function(editor) {
+		var lastRng, lastPath = [];
+
+		/**
+		 * Returns true/false if the current element path has been changed or not.
+		 *
+		 * @private
+		 * @return {Boolean} True if the element path is the same false if it's not.
+		 */
+		function isSameElementPath(startElm) {
+			var i, currentPath;
+
+			currentPath = editor.$(startElm).parentsUntil(editor.getBody()).add(startElm);
+			if (currentPath.length === lastPath.length) {
+				for (i = currentPath.length; i >= 0; i--) {
+					if (currentPath[i] !== lastPath[i]) {
+						break;
+					}
+				}
+
+				if (i === -1) {
+					lastPath = currentPath;
+					return true;
+				}
+			}
+
+			lastPath = currentPath;
+
+			return false;
+		}
+
+		// Gecko doesn't support the "selectionchange" event
+		if (!('onselectionchange' in editor.getDoc())) {
+			editor.on('NodeChange Click MouseUp KeyUp Focus', function(e) {
+				var nativeRng, fakeRng;
+
+				// Since DOM Ranges mutate on modification
+				// of the DOM we need to clone it's contents
+				nativeRng = editor.selection.getRng();
+				fakeRng = {
+					startContainer: nativeRng.startContainer,
+					startOffset: nativeRng.startOffset,
+					endContainer: nativeRng.endContainer,
+					endOffset: nativeRng.endOffset
+				};
+
+				// Always treat nodechange as a selectionchange since applying
+				// formatting to the current range wouldn't update the range but it's parent
+				if (e.type == 'nodechange' || !RangeUtils.compareRanges(fakeRng, lastRng)) {
+					editor.fire('SelectionChange');
+				}
+
+				lastRng = fakeRng;
+			});
+		}
+
+		// IE has a bug where it fires a selectionchange on right click that has a range at the start of the body
+		// When the contextmenu event fires the selection is located at the right location
+		editor.on('contextmenu', function() {
+			editor.fire('SelectionChange');
+		});
+
+		// Selection change is delayed ~200ms on IE when you click inside the current range
+		editor.on('SelectionChange', function() {
+			var startElm = editor.selection.getStart(true);
+
+			// IE 8 will fire a selectionchange event with an incorrect selection
+			// when focusing out of table cells. Click inside cell -> toolbar = Invalid SelectionChange event
+			if (!Env.range && editor.selection.isCollapsed()) {
+				return;
+			}
+
+			if (!isSameElementPath(startElm) && editor.dom.isChildOf(startElm, editor.getBody())) {
+				editor.nodeChanged({selectionChange: true});
+			}
+		});
+
+		// Fire an extra nodeChange on mouseup for compatibility reasons
+		editor.on('MouseUp', function(e) {
+			if (!e.isDefaultPrevented()) {
+				// Delay nodeChanged call for WebKit edge case issue where the range
+				// isn't updated until after you click outside a selected image
+				if (editor.selection.getNode().nodeName == 'IMG') {
+					setTimeout(function() {
+						editor.nodeChanged();
+					}, 0);
+				} else {
+					editor.nodeChanged();
+				}
+			}
+		});
+
+		/**
+		 * Distpaches out a onNodeChange event to all observers. This method should be called when you
+		 * need to update the UI states or element path etc.
+		 *
+		 * @method nodeChanged
+		 * @param {Object} args Optional args to pass to NodeChange event handlers.
+		 */
+		this.nodeChanged = function(args) {
+			var selection = editor.selection, node, parents, root;
+
+			// Fix for bug #1896577 it seems that this can not be fired while the editor is loading
+			if (editor.initialized && selection && !editor.settings.disable_nodechange && !editor.settings.readonly) {
+				// Get start node
+				root = editor.getBody();
+				node = selection.getStart() || root;
+				node = node.ownerDocument != editor.getDoc() ? editor.getBody() : node;
+
+				// Edge case for <p>|<img></p>
+				if (node.nodeName == 'IMG' && selection.isCollapsed()) {
+					node = node.parentNode;
+				}
+
+				// Get parents and add them to object
+				parents = [];
+				editor.dom.getParent(node, function(node) {
+					if (node === root) {
+						return true;
+					}
+
+					parents.push(node);
+				});
+
+				args = args || {};
+				args.element = node;
+				args.parents = parents;
+
+				editor.fire('NodeChange', args);
+			}
+		};
+	};
+});
+
+// Included from: js/tinymce/classes/html/Node.js
+
+/**
+ * Node.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is a minimalistic implementation of a DOM like node used by the DomParser class.
+ *
+ * @example
+ * var node = new tinymce.html.Node('strong', 1);
+ * someRoot.append(node);
+ *
+ * @class tinymce.html.Node
+ * @version 3.4
+ */
+define("tinymce/html/Node", [], function() {
+	var whiteSpaceRegExp = /^[ \t\r\n]*$/, typeLookup = {
+		'#text': 3,
+		'#comment': 8,
+		'#cdata': 4,
+		'#pi': 7,
+		'#doctype': 10,
+		'#document-fragment': 11
+	};
+
+	// Walks the tree left/right
+	function walk(node, root_node, prev) {
+		var sibling, parent, startName = prev ? 'lastChild' : 'firstChild', siblingName = prev ? 'prev' : 'next';
+
+		// Walk into nodes if it has a start
+		if (node[startName]) {
+			return node[startName];
+		}
+
+		// Return the sibling if it has one
+		if (node !== root_node) {
+			sibling = node[siblingName];
+
+			if (sibling) {
+				return sibling;
+			}
+
+			// Walk up the parents to look for siblings
+			for (parent = node.parent; parent && parent !== root_node; parent = parent.parent) {
+				sibling = parent[siblingName];
+
+				if (sibling) {
+					return sibling;
+				}
+			}
+		}
+	}
+
+	/**
+	 * Constructs a new Node instance.
+	 *
+	 * @constructor
+	 * @method Node
+	 * @param {String} name Name of the node type.
+	 * @param {Number} type Numeric type representing the node.
+	 */
+	function Node(name, type) {
+		this.name = name;
+		this.type = type;
+
+		if (type === 1) {
+			this.attributes = [];
+			this.attributes.map = {};
+		}
+	}
+
+	Node.prototype = {
+		/**
+		 * Replaces the current node with the specified one.
+		 *
+		 * @example
+		 * someNode.replace(someNewNode);
+		 *
+		 * @method replace
+		 * @param {tinymce.html.Node} node Node to replace the current node with.
+		 * @return {tinymce.html.Node} The old node that got replaced.
+		 */
+		replace: function(node) {
+			var self = this;
+
+			if (node.parent) {
+				node.remove();
+			}
+
+			self.insert(node, self);
+			self.remove();
+
+			return self;
+		},
+
+		/**
+		 * Gets/sets or removes an attribute by name.
+		 *
+		 * @example
+		 * someNode.attr("name", "value"); // Sets an attribute
+		 * console.log(someNode.attr("name")); // Gets an attribute
+		 * someNode.attr("name", null); // Removes an attribute
+		 *
+		 * @method attr
+		 * @param {String} name Attribute name to set or get.
+		 * @param {String} value Optional value to set.
+		 * @return {String/tinymce.html.Node} String or undefined on a get operation or the current node on a set operation.
+		 */
+		attr: function(name, value) {
+			var self = this, attrs, i, undef;
+
+			if (typeof name !== "string") {
+				for (i in name) {
+					self.attr(i, name[i]);
+				}
+
+				return self;
+			}
+
+			if ((attrs = self.attributes)) {
+				if (value !== undef) {
+					// Remove attribute
+					if (value === null) {
+						if (name in attrs.map) {
+							delete attrs.map[name];
+
+							i = attrs.length;
+							while (i--) {
+								if (attrs[i].name === name) {
+									attrs = attrs.splice(i, 1);
+									return self;
+								}
+							}
+						}
+
+						return self;
+					}
+
+					// Set attribute
+					if (name in attrs.map) {
+						// Set attribute
+						i = attrs.length;
+						while (i--) {
+							if (attrs[i].name === name) {
+								attrs[i].value = value;
+								break;
+							}
+						}
+					} else {
+						attrs.push({name: name, value: value});
+					}
+
+					attrs.map[name] = value;
+
+					return self;
+				} else {
+					return attrs.map[name];
+				}
+			}
+		},
+
+		/**
+		 * Does a shallow clones the node into a new node. It will also exclude id attributes since
+		 * there should only be one id per document.
+		 *
+		 * @example
+		 * var clonedNode = node.clone();
+		 *
+		 * @method clone
+		 * @return {tinymce.html.Node} New copy of the original node.
+		 */
+		clone: function() {
+			var self = this, clone = new Node(self.name, self.type), i, l, selfAttrs, selfAttr, cloneAttrs;
+
+			// Clone element attributes
+			if ((selfAttrs = self.attributes)) {
+				cloneAttrs = [];
+				cloneAttrs.map = {};
+
+				for (i = 0, l = selfAttrs.length; i < l; i++) {
+					selfAttr = selfAttrs[i];
+
+					// Clone everything except id
+					if (selfAttr.name !== 'id') {
+						cloneAttrs[cloneAttrs.length] = {name: selfAttr.name, value: selfAttr.value};
+						cloneAttrs.map[selfAttr.name] = selfAttr.value;
+					}
+				}
+
+				clone.attributes = cloneAttrs;
+			}
+
+			clone.value = self.value;
+			clone.shortEnded = self.shortEnded;
+
+			return clone;
+		},
+
+		/**
+		 * Wraps the node in in another node.
+		 *
+		 * @example
+		 * node.wrap(wrapperNode);
+		 *
+		 * @method wrap
+		 */
+		wrap: function(wrapper) {
+			var self = this;
+
+			self.parent.insert(wrapper, self);
+			wrapper.append(self);
+
+			return self;
+		},
+
+		/**
+		 * Unwraps the node in other words it removes the node but keeps the children.
+		 *
+		 * @example
+		 * node.unwrap();
+		 *
+		 * @method unwrap
+		 */
+		unwrap: function() {
+			var self = this, node, next;
+
+			for (node = self.firstChild; node;) {
+				next = node.next;
+				self.insert(node, self, true);
+				node = next;
+			}
+
+			self.remove();
+		},
+
+		/**
+		 * Removes the node from it's parent.
+		 *
+		 * @example
+		 * node.remove();
+		 *
+		 * @method remove
+		 * @return {tinymce.html.Node} Current node that got removed.
+		 */
+		remove: function() {
+			var self = this, parent = self.parent, next = self.next, prev = self.prev;
+
+			if (parent) {
+				if (parent.firstChild === self) {
+					parent.firstChild = next;
+
+					if (next) {
+						next.prev = null;
+					}
+				} else {
+					prev.next = next;
+				}
+
+				if (parent.lastChild === self) {
+					parent.lastChild = prev;
+
+					if (prev) {
+						prev.next = null;
+					}
+				} else {
+					next.prev = prev;
+				}
+
+				self.parent = self.next = self.prev = null;
+			}
+
+			return self;
+		},
+
+		/**
+		 * Appends a new node as a child of the current node.
+		 *
+		 * @example
+		 * node.append(someNode);
+		 *
+		 * @method append
+		 * @param {tinymce.html.Node} node Node to append as a child of the current one.
+		 * @return {tinymce.html.Node} The node that got appended.
+		 */
+		append: function(node) {
+			var self = this, last;
+
+			if (node.parent) {
+				node.remove();
+			}
+
+			last = self.lastChild;
+			if (last) {
+				last.next = node;
+				node.prev = last;
+				self.lastChild = node;
+			} else {
+				self.lastChild = self.firstChild = node;
+			}
+
+			node.parent = self;
+
+			return node;
+		},
+
+		/**
+		 * Inserts a node at a specific position as a child of the current node.
+		 *
+		 * @example
+		 * parentNode.insert(newChildNode, oldChildNode);
+		 *
+		 * @method insert
+		 * @param {tinymce.html.Node} node Node to insert as a child of the current node.
+		 * @param {tinymce.html.Node} ref_node Reference node to set node before/after.
+		 * @param {Boolean} before Optional state to insert the node before the reference node.
+		 * @return {tinymce.html.Node} The node that got inserted.
+		 */
+		insert: function(node, ref_node, before) {
+			var parent;
+
+			if (node.parent) {
+				node.remove();
+			}
+
+			parent = ref_node.parent || this;
+
+			if (before) {
+				if (ref_node === parent.firstChild) {
+					parent.firstChild = node;
+				} else {
+					ref_node.prev.next = node;
+				}
+
+				node.prev = ref_node.prev;
+				node.next = ref_node;
+				ref_node.prev = node;
+			} else {
+				if (ref_node === parent.lastChild) {
+					parent.lastChild = node;
+				} else {
+					ref_node.next.prev = node;
+				}
+
+				node.next = ref_node.next;
+				node.prev = ref_node;
+				ref_node.next = node;
+			}
+
+			node.parent = parent;
+
+			return node;
+		},
+
+		/**
+		 * Get all children by name.
+		 *
+		 * @method getAll
+		 * @param {String} name Name of the child nodes to collect.
+		 * @return {Array} Array with child nodes matchin the specified name.
+		 */
+		getAll: function(name) {
+			var self = this, node, collection = [];
+
+			for (node = self.firstChild; node; node = walk(node, self)) {
+				if (node.name === name) {
+					collection.push(node);
+				}
+			}
+
+			return collection;
+		},
+
+		/**
+		 * Removes all children of the current node.
+		 *
+		 * @method empty
+		 * @return {tinymce.html.Node} The current node that got cleared.
+		 */
+		empty: function() {
+			var self = this, nodes, i, node;
+
+			// Remove all children
+			if (self.firstChild) {
+				nodes = [];
+
+				// Collect the children
+				for (node = self.firstChild; node; node = walk(node, self)) {
+					nodes.push(node);
+				}
+
+				// Remove the children
+				i = nodes.length;
+				while (i--) {
+					node = nodes[i];
+					node.parent = node.firstChild = node.lastChild = node.next = node.prev = null;
+				}
+			}
+
+			self.firstChild = self.lastChild = null;
+
+			return self;
+		},
+
+		/**
+		 * Returns true/false if the node is to be considered empty or not.
+		 *
+		 * @example
+		 * node.isEmpty({img: true});
+		 * @method isEmpty
+		 * @param {Object} elements Name/value object with elements that are automatically treated as non empty elements.
+		 * @return {Boolean} true/false if the node is empty or not.
+		 */
+		isEmpty: function(elements) {
+			var self = this, node = self.firstChild, i, name;
+
+			if (node) {
+				do {
+					if (node.type === 1) {
+						// Ignore bogus elements
+						if (node.attributes.map['data-mce-bogus']) {
+							continue;
+						}
+
+						// Keep empty elements like <img />
+						if (elements[node.name]) {
+							return false;
+						}
+
+						// Keep bookmark nodes and name attribute like <a name="1"></a>
+						i = node.attributes.length;
+						while (i--) {
+							name = node.attributes[i].name;
+							if (name === "name" || name.indexOf('data-mce-bookmark') === 0) {
+								return false;
+							}
+						}
+					}
+
+					// Keep comments
+					if (node.type === 8) {
+						return false;
+					}
+
+					// Keep non whitespace text nodes
+					if ((node.type === 3 && !whiteSpaceRegExp.test(node.value))) {
+						return false;
+					}
+				} while ((node = walk(node, self)));
+			}
+
+			return true;
+		},
+
+		/**
+		 * Walks to the next or previous node and returns that node or null if it wasn't found.
+		 *
+		 * @method walk
+		 * @param {Boolean} prev Optional previous node state defaults to false.
+		 * @return {tinymce.html.Node} Node that is next to or previous of the current node.
+		 */
+		walk: function(prev) {
+			return walk(this, null, prev);
+		}
+	};
+
+	/**
+	 * Creates a node of a specific type.
+	 *
+	 * @static
+	 * @method create
+	 * @param {String} name Name of the node type to create for example "b" or "#text".
+	 * @param {Object} attrs Name/value collection of attributes that will be applied to elements.
+	 */
+	Node.create = function(name, attrs) {
+		var node, attrName;
+
+		// Create node
+		node = new Node(name, typeLookup[name] || 1);
+
+		// Add attributes if needed
+		if (attrs) {
+			for (attrName in attrs) {
+				node.attr(attrName, attrs[attrName]);
+			}
+		}
+
+		return node;
+	};
+
+	return Node;
+});
+
+// Included from: js/tinymce/classes/html/Schema.js
+
+/**
+ * Schema.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Schema validator class.
+ *
+ * @class tinymce.html.Schema
+ * @example
+ *  if (tinymce.activeEditor.schema.isValidChild('p', 'span'))
+ *    alert('span is valid child of p.');
+ *
+ *  if (tinymce.activeEditor.schema.getElementRule('p'))
+ *    alert('P is a valid element.');
+ *
+ * @class tinymce.html.Schema
+ * @version 3.4
+ */
+define("tinymce/html/Schema", [
+	"tinymce/util/Tools"
+], function(Tools) {
+	var mapCache = {}, dummyObj = {};
+	var makeMap = Tools.makeMap, each = Tools.each, extend = Tools.extend, explode = Tools.explode, inArray = Tools.inArray;
+
+	function split(items, delim) {
+		return items ? items.split(delim || ' ') : [];
+	}
+
+	/**
+	 * Builds a schema lookup table
+	 *
+	 * @private
+	 * @param {String} type html4, html5 or html5-strict schema type.
+	 * @return {Object} Schema lookup table.
+	 */
+	function compileSchema(type) {
+		var schema = {}, globalAttributes, blockContent;
+		var phrasingContent, flowContent, html4BlockContent, html4PhrasingContent;
+
+		function add(name, attributes, children) {
+			var ni, i, attributesOrder, args = arguments;
+
+			function arrayToMap(array, obj) {
+				var map = {}, i, l;
+
+				for (i = 0, l = array.length; i < l; i++) {
+					map[array[i]] = obj || {};
+				}
+
+				return map;
+			}
+
+			children = children || [];
+			attributes = attributes || "";
+
+			if (typeof children === "string") {
+				children = split(children);
+			}
+
+			// Split string children
+			for (i = 3; i < args.length; i++) {
+				if (typeof args[i] === "string") {
+					args[i] = split(args[i]);
+				}
+
+				children.push.apply(children, args[i]);
+			}
+
+			name = split(name);
+			ni = name.length;
+			while (ni--) {
+				attributesOrder = [].concat(globalAttributes, split(attributes));
+				schema[name[ni]] = {
+					attributes: arrayToMap(attributesOrder),
+					attributesOrder: attributesOrder,
+					children: arrayToMap(children, dummyObj)
+				};
+			}
+		}
+
+		function addAttrs(name, attributes) {
+			var ni, schemaItem, i, l;
+
+			name = split(name);
+			ni = name.length;
+			attributes = split(attributes);
+			while (ni--) {
+				schemaItem = schema[name[ni]];
+				for (i = 0, l = attributes.length; i < l; i++) {
+					schemaItem.attributes[attributes[i]] = {};
+					schemaItem.attributesOrder.push(attributes[i]);
+				}
+			}
+		}
+
+		// Use cached schema
+		if (mapCache[type]) {
+			return mapCache[type];
+		}
+
+		// Attributes present on all elements
+		globalAttributes = split("id accesskey class dir lang style tabindex title");
+
+		// Event attributes can be opt-in/opt-out
+		/*eventAttributes = split("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"
+		);*/
+
+		// Block content elements
+		blockContent = split(
+			"address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul"
+		);
+
+		// Phrasing content elements from the HTML5 spec (inline)
+		phrasingContent = split(
+			"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"
+		);
+
+		// Add HTML5 items to globalAttributes, blockContent, phrasingContent
+		if (type != "html4") {
+			globalAttributes.push.apply(globalAttributes, split("contenteditable contextmenu draggable dropzone " +
+				"hidden spellcheck translate"));
+			blockContent.push.apply(blockContent, split("article aside details dialog figure header footer hgroup section nav"));
+			phrasingContent.push.apply(phrasingContent, split("audio canvas command datalist mark meter output progress time wbr " +
+				"video ruby bdi keygen"));
+		}
+
+		// Add HTML4 elements unless it's html5-strict
+		if (type != "html5-strict") {
+			globalAttributes.push("xml:lang");
+
+			html4PhrasingContent = split("acronym applet basefont big font strike tt");
+			phrasingContent.push.apply(phrasingContent, html4PhrasingContent);
+
+			each(html4PhrasingContent, function(name) {
+				add(name, "", phrasingContent);
+			});
+
+			html4BlockContent = split("center dir isindex noframes");
+			blockContent.push.apply(blockContent, html4BlockContent);
+
+			// Flow content elements from the HTML5 spec (block+inline)
+			flowContent = [].concat(blockContent, phrasingContent);
+
+			each(html4BlockContent, function(name) {
+				add(name, "", flowContent);
+			});
+		}
+
+		// Flow content elements from the HTML5 spec (block+inline)
+		flowContent = flowContent || [].concat(blockContent, phrasingContent);
+
+		// HTML4 base schema TODO: Move HTML5 specific attributes to HTML5 specific if statement
+		// Schema items <element name>, <specific attributes>, <children ..>
+		add("html", "manifest", "head body");
+		add("head", "", "base command link meta noscript script style title");
+		add("title hr noscript br");
+		add("base", "href target");
+		add("link", "href rel media hreflang type sizes hreflang");
+		add("meta", "name http-equiv content charset");
+		add("style", "media type scoped");
+		add("script", "src async defer type charset");
+		add("body", "onafterprint onbeforeprint onbeforeunload onblur onerror onfocus " +
+				"onhashchange onload onmessage onoffline ononline onpagehide onpageshow " +
+				"onpopstate onresize onscroll onstorage onunload", flowContent);
+		add("address dt dd div caption", "", flowContent);
+		add("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", "", phrasingContent);
+		add("blockquote", "cite", flowContent);
+		add("ol", "reversed start type", "li");
+		add("ul", "", "li");
+		add("li", "value", flowContent);
+		add("dl", "", "dt dd");
+		add("a", "href target rel media hreflang type", phrasingContent);
+		add("q", "cite", phrasingContent);
+		add("ins del", "cite datetime", flowContent);
+		add("img", "src sizes srcset alt usemap ismap width height");
+		add("iframe", "src name width height", flowContent);
+		add("embed", "src type width height");
+		add("object", "data type typemustmatch name usemap form width height", flowContent, "param");
+		add("param", "name value");
+		add("map", "name", flowContent, "area");
+		add("area", "alt coords shape href target rel media hreflang type");
+		add("table", "border", "caption colgroup thead tfoot tbody tr" + (type == "html4" ? " col" : ""));
+		add("colgroup", "span", "col");
+		add("col", "span");
+		add("tbody thead tfoot", "", "tr");
+		add("tr", "", "td th");
+		add("td", "colspan rowspan headers", flowContent);
+		add("th", "colspan rowspan headers scope abbr", flowContent);
+		add("form", "accept-charset action autocomplete enctype method name novalidate target", flowContent);
+		add("fieldset", "disabled form name", flowContent, "legend");
+		add("label", "form for", phrasingContent);
+		add("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"
+		);
+		add("button", "disabled form formaction formenctype formmethod formnovalidate formtarget name type value",
+			type == "html4" ? flowContent : phrasingContent);
+		add("select", "disabled form multiple name required size", "option optgroup");
+		add("optgroup", "disabled label", "option");
+		add("option", "disabled label selected value");
+		add("textarea", "cols dirname disabled form maxlength name readonly required rows wrap");
+		add("menu", "type label", flowContent, "li");
+		add("noscript", "", flowContent);
+
+		// Extend with HTML5 elements
+		if (type != "html4") {
+			add("wbr");
+			add("ruby", "", phrasingContent, "rt rp");
+			add("figcaption", "", flowContent);
+			add("mark rt rp summary bdi", "", phrasingContent);
+			add("canvas", "width height", flowContent);
+			add("video", "src crossorigin poster preload autoplay mediagroup loop " +
+				"muted controls width height buffered", flowContent, "track source");
+			add("audio", "src crossorigin preload autoplay mediagroup loop muted controls buffered volume", flowContent, "track source");
+			add("picture", "", "img source");
+			add("source", "src srcset type media sizes");
+			add("track", "kind src srclang label default");
+			add("datalist", "", phrasingContent, "option");
+			add("article section nav aside header footer", "", flowContent);
+			add("hgroup", "", "h1 h2 h3 h4 h5 h6");
+			add("figure", "", flowContent, "figcaption");
+			add("time", "datetime", phrasingContent);
+			add("dialog", "open", flowContent);
+			add("command", "type label icon disabled checked radiogroup command");
+			add("output", "for form name", phrasingContent);
+			add("progress", "value max", phrasingContent);
+			add("meter", "value min max low high optimum", phrasingContent);
+			add("details", "open", flowContent, "summary");
+			add("keygen", "autofocus challenge disabled form keytype name");
+		}
+
+		// Extend with HTML4 attributes unless it's html5-strict
+		if (type != "html5-strict") {
+			addAttrs("script", "language xml:space");
+			addAttrs("style", "xml:space");
+			addAttrs("object", "declare classid code codebase codetype archive standby align border hspace vspace");
+			addAttrs("embed", "align name hspace vspace");
+			addAttrs("param", "valuetype type");
+			addAttrs("a", "charset name rev shape coords");
+			addAttrs("br", "clear");
+			addAttrs("applet", "codebase archive code object alt name width height align hspace vspace");
+			addAttrs("img", "name longdesc align border hspace vspace");
+			addAttrs("iframe", "longdesc frameborder marginwidth marginheight scrolling align");
+			addAttrs("font basefont", "size color face");
+			addAttrs("input", "usemap align");
+			addAttrs("select", "onchange");
+			addAttrs("textarea");
+			addAttrs("h1 h2 h3 h4 h5 h6 div p legend caption", "align");
+			addAttrs("ul", "type compact");
+			addAttrs("li", "type");
+			addAttrs("ol dl menu dir", "compact");
+			addAttrs("pre", "width xml:space");
+			addAttrs("hr", "align noshade size width");
+			addAttrs("isindex", "prompt");
+			addAttrs("table", "summary width frame rules cellspacing cellpadding align bgcolor");
+			addAttrs("col", "width align char charoff valign");
+			addAttrs("colgroup", "width align char charoff valign");
+			addAttrs("thead", "align char charoff valign");
+			addAttrs("tr", "align char charoff valign bgcolor");
+			addAttrs("th", "axis align char charoff valign nowrap bgcolor width height");
+			addAttrs("form", "accept");
+			addAttrs("td", "abbr axis scope align char charoff valign nowrap bgcolor width height");
+			addAttrs("tfoot", "align char charoff valign");
+			addAttrs("tbody", "align char charoff valign");
+			addAttrs("area", "nohref");
+			addAttrs("body", "background bgcolor text link vlink alink");
+		}
+
+		// Extend with HTML5 attributes unless it's html4
+		if (type != "html4") {
+			addAttrs("input button select textarea", "autofocus");
+			addAttrs("input textarea", "placeholder");
+			addAttrs("a", "download");
+			addAttrs("link script img", "crossorigin");
+			addAttrs("iframe", "sandbox seamless allowfullscreen"); // Excluded: srcdoc
+		}
+
+		// Special: iframe, ruby, video, audio, label
+
+		// Delete children of the same name from it's parent
+		// For example: form can't have a child of the name form
+		each(split('a form meter progress dfn'), function(name) {
+			if (schema[name]) {
+				delete schema[name].children[name];
+			}
+		});
+
+		// Delete header, footer, sectioning and heading content descendants
+		/*each('dt th address', function(name) {
+			delete schema[name].children[name];
+		});*/
+
+		// Caption can't have tables
+		delete schema.caption.children.table;
+
+		// TODO: LI:s can only have value if parent is OL
+
+		// TODO: Handle transparent elements
+		// a ins del canvas map
+
+		mapCache[type] = schema;
+
+		return schema;
+	}
+
+	function compileElementMap(value, mode) {
+		var styles;
+
+		if (value) {
+			styles = {};
+
+			if (typeof value == 'string') {
+				value = {
+					'*': value
+				};
+			}
+
+			// Convert styles into a rule list
+			each(value, function(value, key) {
+				styles[key] = styles[key.toUpperCase()] = mode == 'map' ? makeMap(value, /[, ]/) : explode(value, /[, ]/);
+			});
+		}
+
+		return styles;
+	}
+
+	/**
+	 * Constructs a new Schema instance.
+	 *
+	 * @constructor
+	 * @method Schema
+	 * @param {Object} settings Name/value settings object.
+	 */
+	return function(settings) {
+		var self = this, elements = {}, children = {}, patternElements = [], validStyles, invalidStyles, schemaItems;
+		var whiteSpaceElementsMap, selfClosingElementsMap, shortEndedElementsMap, boolAttrMap, validClasses;
+		var blockElementsMap, nonEmptyElementsMap, moveCaretBeforeOnEnterElementsMap, textBlockElementsMap, textInlineElementsMap;
+		var customElementsMap = {}, specialElements = {};
+
+		// Creates an lookup table map object for the specified option or the default value
+		function createLookupTable(option, default_value, extendWith) {
+			var value = settings[option];
+
+			if (!value) {
+				// Get cached default map or make it if needed
+				value = mapCache[option];
+
+				if (!value) {
+					value = makeMap(default_value, ' ', makeMap(default_value.toUpperCase(), ' '));
+					value = extend(value, extendWith);
+
+					mapCache[option] = value;
+				}
+			} else {
+				// Create custom map
+				value = makeMap(value, /[, ]/, makeMap(value.toUpperCase(), /[, ]/));
+			}
+
+			return value;
+		}
+
+		settings = settings || {};
+		schemaItems = compileSchema(settings.schema);
+
+		// Allow all elements and attributes if verify_html is set to false
+		if (settings.verify_html === false) {
+			settings.valid_elements = '*[*]';
+		}
+
+		validStyles = compileElementMap(settings.valid_styles);
+		invalidStyles = compileElementMap(settings.invalid_styles, 'map');
+		validClasses = compileElementMap(settings.valid_classes, 'map');
+
+		// Setup map objects
+		whiteSpaceElementsMap = createLookupTable('whitespace_elements', 'pre script noscript style textarea video audio iframe object');
+		selfClosingElementsMap = createLookupTable('self_closing_elements', 'colgroup dd dt li option p td tfoot th thead tr');
+		shortEndedElementsMap = createLookupTable('short_ended_elements', 'area base basefont br col frame hr img input isindex link ' +
+			'meta param embed source wbr track');
+		boolAttrMap = createLookupTable('boolean_attributes', 'checked compact declare defer disabled ismap multiple nohref noresize ' +
+			'noshade nowrap readonly selected autoplay loop controls');
+		nonEmptyElementsMap = createLookupTable('non_empty_elements', 'td th iframe video audio object script', shortEndedElementsMap);
+		moveCaretBeforeOnEnterElementsMap = createLookupTable('move_caret_before_on_enter_elements', 'table', nonEmptyElementsMap);
+		textBlockElementsMap = createLookupTable('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');
+		blockElementsMap = createLookupTable('block_elements', 'hr table tbody thead tfoot ' +
+						'th tr td li ol ul caption dl dt dd noscript menu isindex option ' +
+						'datalist select optgroup', textBlockElementsMap);
+		textInlineElementsMap = createLookupTable('text_inline_elements', 'span strong b em i font strike u var cite ' +
+										'dfn code mark q sup sub samp');
+
+		each((settings.special || 'script noscript style textarea').split(' '), function(name) {
+			specialElements[name] = new RegExp('<\/' + name + '[^>]*>', 'gi');
+		});
+
+		// Converts a wildcard expression string to a regexp for example *a will become /.*a/.
+		function patternToRegExp(str) {
+			return new RegExp('^' + str.replace(/([?+*])/g, '.$1') + '$');
+		}
+
+		// Parses the specified valid_elements string and adds to the current rules
+		// This function is a bit hard to read since it's heavily optimized for speed
+		function addValidElements(validElements) {
+			var ei, el, ai, al, matches, element, attr, attrData, elementName, attrName, attrType, attributes, attributesOrder,
+				prefix, outputName, globalAttributes, globalAttributesOrder, key, value,
+				elementRuleRegExp = /^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,
+				attrRuleRegExp = /^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,
+				hasPatternsRegExp = /[*?+]/;
+
+			if (validElements) {
+				// Split valid elements into an array with rules
+				validElements = split(validElements, ',');
+
+				if (elements['@']) {
+					globalAttributes = elements['@'].attributes;
+					globalAttributesOrder = elements['@'].attributesOrder;
+				}
+
+				// Loop all rules
+				for (ei = 0, el = validElements.length; ei < el; ei++) {
+					// Parse element rule
+					matches = elementRuleRegExp.exec(validElements[ei]);
+					if (matches) {
+						// Setup local names for matches
+						prefix = matches[1];
+						elementName = matches[2];
+						outputName = matches[3];
+						attrData = matches[5];
+
+						// Create new attributes and attributesOrder
+						attributes = {};
+						attributesOrder = [];
+
+						// Create the new element
+						element = {
+							attributes: attributes,
+							attributesOrder: attributesOrder
+						};
+
+						// Padd empty elements prefix
+						if (prefix === '#') {
+							element.paddEmpty = true;
+						}
+
+						// Remove empty elements prefix
+						if (prefix === '-') {
+							element.removeEmpty = true;
+						}
+
+						if (matches[4] === '!') {
+							element.removeEmptyAttrs = true;
+						}
+
+						// Copy attributes from global rule into current rule
+						if (globalAttributes) {
+							for (key in globalAttributes) {
+								attributes[key] = globalAttributes[key];
+							}
+
+							attributesOrder.push.apply(attributesOrder, globalAttributesOrder);
+						}
+
+						// Attributes defined
+						if (attrData) {
+							attrData = split(attrData, '|');
+							for (ai = 0, al = attrData.length; ai < al; ai++) {
+								matches = attrRuleRegExp.exec(attrData[ai]);
+								if (matches) {
+									attr = {};
+									attrType = matches[1];
+									attrName = matches[2].replace(/::/g, ':');
+									prefix = matches[3];
+									value = matches[4];
+
+									// Required
+									if (attrType === '!') {
+										element.attributesRequired = element.attributesRequired || [];
+										element.attributesRequired.push(attrName);
+										attr.required = true;
+									}
+
+									// Denied from global
+									if (attrType === '-') {
+										delete attributes[attrName];
+										attributesOrder.splice(inArray(attributesOrder, attrName), 1);
+										continue;
+									}
+
+									// Default value
+									if (prefix) {
+										// Default value
+										if (prefix === '=') {
+											element.attributesDefault = element.attributesDefault || [];
+											element.attributesDefault.push({name: attrName, value: value});
+											attr.defaultValue = value;
+										}
+
+										// Forced value
+										if (prefix === ':') {
+											element.attributesForced = element.attributesForced || [];
+											element.attributesForced.push({name: attrName, value: value});
+											attr.forcedValue = value;
+										}
+
+										// Required values
+										if (prefix === '<') {
+											attr.validValues = makeMap(value, '?');
+										}
+									}
+
+									// Check for attribute patterns
+									if (hasPatternsRegExp.test(attrName)) {
+										element.attributePatterns = element.attributePatterns || [];
+										attr.pattern = patternToRegExp(attrName);
+										element.attributePatterns.push(attr);
+									} else {
+										// Add attribute to order list if it doesn't already exist
+										if (!attributes[attrName]) {
+											attributesOrder.push(attrName);
+										}
+
+										attributes[attrName] = attr;
+									}
+								}
+							}
+						}
+
+						// Global rule, store away these for later usage
+						if (!globalAttributes && elementName == '@') {
+							globalAttributes = attributes;
+							globalAttributesOrder = attributesOrder;
+						}
+
+						// Handle substitute elements such as b/strong
+						if (outputName) {
+							element.outputName = elementName;
+							elements[outputName] = element;
+						}
+
+						// Add pattern or exact element
+						if (hasPatternsRegExp.test(elementName)) {
+							element.pattern = patternToRegExp(elementName);
+							patternElements.push(element);
+						} else {
+							elements[elementName] = element;
+						}
+					}
+				}
+			}
+		}
+
+		function setValidElements(validElements) {
+			elements = {};
+			patternElements = [];
+
+			addValidElements(validElements);
+
+			each(schemaItems, function(element, name) {
+				children[name] = element.children;
+			});
+		}
+
+		// Adds custom non HTML elements to the schema
+		function addCustomElements(customElements) {
+			var customElementRegExp = /^(~)?(.+)$/;
+
+			if (customElements) {
+				// Flush cached items since we are altering the default maps
+				mapCache.text_block_elements = mapCache.block_elements = null;
+
+				each(split(customElements, ','), function(rule) {
+					var matches = customElementRegExp.exec(rule),
+						inline = matches[1] === '~',
+						cloneName = inline ? 'span' : 'div',
+						name = matches[2];
+
+					children[name] = children[cloneName];
+					customElementsMap[name] = cloneName;
+
+					// If it's not marked as inline then add it to valid block elements
+					if (!inline) {
+						blockElementsMap[name.toUpperCase()] = {};
+						blockElementsMap[name] = {};
+					}
+
+					// Add elements clone if needed
+					if (!elements[name]) {
+						var customRule = elements[cloneName];
+
+						customRule = extend({}, customRule);
+						delete customRule.removeEmptyAttrs;
+						delete customRule.removeEmpty;
+
+						elements[name] = customRule;
+					}
+
+					// Add custom elements at span/div positions
+					each(children, function(element, elmName) {
+						if (element[cloneName]) {
+							children[elmName] = element = extend({}, children[elmName]);
+							element[name] = element[cloneName];
+						}
+					});
+				});
+			}
+		}
+
+		// Adds valid children to the schema object
+		function addValidChildren(validChildren) {
+			var childRuleRegExp = /^([+\-]?)(\w+)\[([^\]]+)\]$/;
+
+			if (validChildren) {
+				each(split(validChildren, ','), function(rule) {
+					var matches = childRuleRegExp.exec(rule), parent, prefix;
+
+					if (matches) {
+						prefix = matches[1];
+
+						// Add/remove items from default
+						if (prefix) {
+							parent = children[matches[2]];
+						} else {
+							parent = children[matches[2]] = {'#comment': {}};
+						}
+
+						parent = children[matches[2]];
+
+						each(split(matches[3], '|'), function(child) {
+							if (prefix === '-') {
+								// Clone the element before we delete
+								// things in it to not mess up default schemas
+								children[matches[2]] = parent = extend({}, children[matches[2]]);
+
+								delete parent[child];
+							} else {
+								parent[child] = {};
+							}
+						});
+					}
+				});
+			}
+		}
+
+		function getElementRule(name) {
+			var element = elements[name], i;
+
+			// Exact match found
+			if (element) {
+				return element;
+			}
+
+			// No exact match then try the patterns
+			i = patternElements.length;
+			while (i--) {
+				element = patternElements[i];
+
+				if (element.pattern.test(name)) {
+					return element;
+				}
+			}
+		}
+
+		if (!settings.valid_elements) {
+			// No valid elements defined then clone the elements from the schema spec
+			each(schemaItems, function(element, name) {
+				elements[name] = {
+					attributes: element.attributes,
+					attributesOrder: element.attributesOrder
+				};
+
+				children[name] = element.children;
+			});
+
+			// Switch these on HTML4
+			if (settings.schema != "html5") {
+				each(split('strong/b em/i'), function(item) {
+					item = split(item, '/');
+					elements[item[1]].outputName = item[0];
+				});
+			}
+
+			// Add default alt attribute for images
+			elements.img.attributesDefault = [{name: 'alt', value: ''}];
+
+			// Remove these if they are empty by default
+			each(split('ol ul sub sup blockquote span font a table tbody tr strong em b i'), function(name) {
+				if (elements[name]) {
+					elements[name].removeEmpty = true;
+				}
+			});
+
+			// Padd these by default
+			each(split('p h1 h2 h3 h4 h5 h6 th td pre div address caption'), function(name) {
+				elements[name].paddEmpty = true;
+			});
+
+			// Remove these if they have no attributes
+			each(split('span'), function(name) {
+				elements[name].removeEmptyAttrs = true;
+			});
+
+			// Remove these by default
+			// TODO: Reenable in 4.1
+			/*each(split('script style'), function(name) {
+				delete elements[name];
+			});*/
+		} else {
+			setValidElements(settings.valid_elements);
+		}
+
+		addCustomElements(settings.custom_elements);
+		addValidChildren(settings.valid_children);
+		addValidElements(settings.extended_valid_elements);
+
+		// Todo: Remove this when we fix list handling to be valid
+		addValidChildren('+ol[ul|ol],+ul[ul|ol]');
+
+		// Delete invalid elements
+		if (settings.invalid_elements) {
+			each(explode(settings.invalid_elements), function(item) {
+				if (elements[item]) {
+					delete elements[item];
+				}
+			});
+		}
+
+		// If the user didn't allow span only allow internal spans
+		if (!getElementRule('span')) {
+			addValidElements('span[!data-mce-type|*]');
+		}
+
+		/**
+		 * Name/value map object with valid parents and children to those parents.
+		 *
+		 * @example
+		 * children = {
+		 *    div:{p:{}, h1:{}}
+		 * };
+		 * @field children
+		 * @type Object
+		 */
+		self.children = children;
+
+		/**
+		 * Name/value map object with valid styles for each element.
+		 *
+		 * @method getValidStyles
+		 * @type Object
+		 */
+		self.getValidStyles = function() {
+			return validStyles;
+		};
+
+		/**
+		 * Name/value map object with valid styles for each element.
+		 *
+		 * @method getInvalidStyles
+		 * @type Object
+		 */
+		self.getInvalidStyles = function() {
+			return invalidStyles;
+		};
+
+		/**
+		 * Name/value map object with valid classes for each element.
+		 *
+		 * @method getValidClasses
+		 * @type Object
+		 */
+		self.getValidClasses = function() {
+			return validClasses;
+		};
+
+		/**
+		 * Returns a map with boolean attributes.
+		 *
+		 * @method getBoolAttrs
+		 * @return {Object} Name/value lookup map for boolean attributes.
+		 */
+		self.getBoolAttrs = function() {
+			return boolAttrMap;
+		};
+
+		/**
+		 * Returns a map with block elements.
+		 *
+		 * @method getBlockElements
+		 * @return {Object} Name/value lookup map for block elements.
+		 */
+		self.getBlockElements = function() {
+			return blockElementsMap;
+		};
+
+		/**
+		 * Returns a map with text block elements. Such as: p,h1-h6,div,address
+		 *
+		 * @method getTextBlockElements
+		 * @return {Object} Name/value lookup map for block elements.
+		 */
+		self.getTextBlockElements = function() {
+			return textBlockElementsMap;
+		};
+
+		/**
+		 * Returns a map of inline text format nodes for example strong/span or ins.
+		 *
+		 * @method getTextInlineElements
+		 * @return {Object} Name/value lookup map for text format elements.
+		 */
+		self.getTextInlineElements = function() {
+			return textInlineElementsMap;
+		};
+
+		/**
+		 * Returns a map with short ended elements such as BR or IMG.
+		 *
+		 * @method getShortEndedElements
+		 * @return {Object} Name/value lookup map for short ended elements.
+		 */
+		self.getShortEndedElements = function() {
+			return shortEndedElementsMap;
+		};
+
+		/**
+		 * Returns a map with self closing tags such as <li>.
+		 *
+		 * @method getSelfClosingElements
+		 * @return {Object} Name/value lookup map for self closing tags elements.
+		 */
+		self.getSelfClosingElements = function() {
+			return selfClosingElementsMap;
+		};
+
+		/**
+		 * Returns a map with elements that should be treated as contents regardless if it has text
+		 * content in them or not such as TD, VIDEO or IMG.
+		 *
+		 * @method getNonEmptyElements
+		 * @return {Object} Name/value lookup map for non empty elements.
+		 */
+		self.getNonEmptyElements = function() {
+			return nonEmptyElementsMap;
+		};
+
+		/**
+		 * Returns a map with elements that the caret should be moved in front of after enter is
+		 * pressed
+		 *
+		 * @method getMoveCaretBeforeOnEnterElements
+		 * @return {Object} Name/value lookup map for elements to place the caret in front of.
+		 */
+		self.getMoveCaretBeforeOnEnterElements = function() {
+			return moveCaretBeforeOnEnterElementsMap;
+		};
+
+		/**
+		 * Returns a map with elements where white space is to be preserved like PRE or SCRIPT.
+		 *
+		 * @method getWhiteSpaceElements
+		 * @return {Object} Name/value lookup map for white space elements.
+		 */
+		self.getWhiteSpaceElements = function() {
+			return whiteSpaceElementsMap;
+		};
+
+		/**
+		 * Returns a map with special elements. These are elements that needs to be parsed
+		 * in a special way such as script, style, textarea etc. The map object values
+		 * are regexps used to find the end of the element.
+		 *
+		 * @method getSpecialElements
+		 * @return {Object} Name/value lookup map for special elements.
+		 */
+		self.getSpecialElements = function() {
+			return specialElements;
+		};
+
+		/**
+		 * Returns true/false if the specified element and it's child is valid or not
+		 * according to the schema.
+		 *
+		 * @method isValidChild
+		 * @param {String} name Element name to check for.
+		 * @param {String} child Element child to verify.
+		 * @return {Boolean} True/false if the element is a valid child of the specified parent.
+		 */
+		self.isValidChild = function(name, child) {
+			var parent = children[name];
+
+			return !!(parent && parent[child]);
+		};
+
+		/**
+		 * Returns true/false if the specified element name and optional attribute is
+		 * valid according to the schema.
+		 *
+		 * @method isValid
+		 * @param {String} name Name of element to check.
+		 * @param {String} attr Optional attribute name to check for.
+		 * @return {Boolean} True/false if the element and attribute is valid.
+		 */
+		self.isValid = function(name, attr) {
+			var attrPatterns, i, rule = getElementRule(name);
+
+			// Check if it's a valid element
+			if (rule) {
+				if (attr) {
+					// Check if attribute name exists
+					if (rule.attributes[attr]) {
+						return true;
+					}
+
+					// Check if attribute matches a regexp pattern
+					attrPatterns = rule.attributePatterns;
+					if (attrPatterns) {
+						i = attrPatterns.length;
+						while (i--) {
+							if (attrPatterns[i].pattern.test(name)) {
+								return true;
+							}
+						}
+					}
+				} else {
+					return true;
+				}
+			}
+
+			// No match
+			return false;
+		};
+
+		/**
+		 * Returns true/false if the specified element is valid or not
+		 * according to the schema.
+		 *
+		 * @method getElementRule
+		 * @param {String} name Element name to check for.
+		 * @return {Object} Element object or undefined if the element isn't valid.
+		 */
+		self.getElementRule = getElementRule;
+
+		/**
+		 * Returns an map object of all custom elements.
+		 *
+		 * @method getCustomElements
+		 * @return {Object} Name/value map object of all custom elements.
+		 */
+		self.getCustomElements = function() {
+			return customElementsMap;
+		};
+
+		/**
+		 * Parses a valid elements string and adds it to the schema. The valid elements
+		 * format is for example "element[attr=default|otherattr]".
+		 * Existing rules will be replaced with the ones specified, so this extends the schema.
+		 *
+		 * @method addValidElements
+		 * @param {String} valid_elements String in the valid elements format to be parsed.
+		 */
+		self.addValidElements = addValidElements;
+
+		/**
+		 * Parses a valid elements string and sets it to the schema. The valid elements
+		 * format is for example "element[attr=default|otherattr]".
+		 * Existing rules will be replaced with the ones specified, so this extends the schema.
+		 *
+		 * @method setValidElements
+		 * @param {String} valid_elements String in the valid elements format to be parsed.
+		 */
+		self.setValidElements = setValidElements;
+
+		/**
+		 * Adds custom non HTML elements to the schema.
+		 *
+		 * @method addCustomElements
+		 * @param {String} custom_elements Comma separated list of custom elements to add.
+		 */
+		self.addCustomElements = addCustomElements;
+
+		/**
+		 * Parses a valid children string and adds them to the schema structure. The valid children
+		 * format is for example: "element[child1|child2]".
+		 *
+		 * @method addValidChildren
+		 * @param {String} valid_children Valid children elements string to parse
+		 */
+		self.addValidChildren = addValidChildren;
+
+		self.elements = elements;
+	};
+});
+
+// Included from: js/tinymce/classes/html/SaxParser.js
+
+/**
+ * SaxParser.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*eslint max-depth:[2, 9] */
+
+/**
+ * This class parses HTML code using pure JavaScript and executes various events for each item it finds. It will
+ * always execute the events in the right order for tag soup code like <b><p></b></p>. It will also remove elements
+ * and attributes that doesn't fit the schema if the validate setting is enabled.
+ *
+ * @example
+ * var parser = new tinymce.html.SaxParser({
+ *     validate: true,
+ *
+ *     comment: function(text) {
+ *         console.log('Comment:', text);
+ *     },
+ *
+ *     cdata: function(text) {
+ *         console.log('CDATA:', text);
+ *     },
+ *
+ *     text: function(text, raw) {
+ *         console.log('Text:', text, 'Raw:', raw);
+ *     },
+ *
+ *     start: function(name, attrs, empty) {
+ *         console.log('Start:', name, attrs, empty);
+ *     },
+ *
+ *     end: function(name) {
+ *         console.log('End:', name);
+ *     },
+ *
+ *     pi: function(name, text) {
+ *         console.log('PI:', name, text);
+ *     },
+ *
+ *     doctype: function(text) {
+ *         console.log('DocType:', text);
+ *     }
+ * }, schema);
+ * @class tinymce.html.SaxParser
+ * @version 3.4
+ */
+define("tinymce/html/SaxParser", [
+	"tinymce/html/Schema",
+	"tinymce/html/Entities",
+	"tinymce/util/Tools"
+], function(Schema, Entities, Tools) {
+	var each = Tools.each;
+
+	/**
+	 * Returns the index of the end tag for a specific start tag. This can be
+	 * used to skip all children of a parent element from being processed.
+	 *
+	 * @private
+	 * @method findEndTag
+	 * @param {tinymce.html.Schema} schema Schema instance to use to match short ended elements.
+	 * @param {String} html HTML string to find the end tag in.
+	 * @param {Number} startIndex Indext to start searching at should be after the start tag.
+	 * @return {Number} Index of the end tag.
+	 */
+	function findEndTag(schema, html, startIndex) {
+		var count = 1, index, matches, tokenRegExp, shortEndedElements;
+
+		shortEndedElements = schema.getShortEndedElements();
+		tokenRegExp = /<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g;
+		tokenRegExp.lastIndex = index = startIndex;
+
+		while ((matches = tokenRegExp.exec(html))) {
+			index = tokenRegExp.lastIndex;
+
+			if (matches[1] === '/') { // End element
+				count--;
+			} else if (!matches[1]) { // Start element
+				if (matches[2] in shortEndedElements) {
+					continue;
+				}
+
+				count++;
+			}
+
+			if (count === 0) {
+				break;
+			}
+		}
+
+		return index;
+	}
+
+	/**
+	 * Constructs a new SaxParser instance.
+	 *
+	 * @constructor
+	 * @method SaxParser
+	 * @param {Object} settings Name/value collection of settings. comment, cdata, text, start and end are callbacks.
+	 * @param {tinymce.html.Schema} schema HTML Schema class to use when parsing.
+	 */
+	function SaxParser(settings, schema) {
+		var self = this;
+
+		function noop() {}
+
+		settings = settings || {};
+		self.schema = schema = schema || new Schema();
+
+		if (settings.fix_self_closing !== false) {
+			settings.fix_self_closing = true;
+		}
+
+		// Add handler functions from settings and setup default handlers
+		each('comment cdata text start end pi doctype'.split(' '), function(name) {
+			if (name) {
+				self[name] = settings[name] || noop;
+			}
+		});
+
+		/**
+		 * Parses the specified HTML string and executes the callbacks for each item it finds.
+		 *
+		 * @example
+		 * new SaxParser({...}).parse('<b>text</b>');
+		 * @method parse
+		 * @param {String} html Html string to sax parse.
+		 */
+		self.parse = function(html) {
+			var self = this, matches, index = 0, value, endRegExp, stack = [], attrList, i, text, name;
+			var isInternalElement, removeInternalElements, shortEndedElements, fillAttrsMap, isShortEnded;
+			var validate, elementRule, isValidElement, attr, attribsValue, validAttributesMap, validAttributePatterns;
+			var attributesRequired, attributesDefault, attributesForced;
+			var anyAttributesRequired, selfClosing, tokenRegExp, attrRegExp, specialElements, attrValue, idCount = 0;
+			var decode = Entities.decode, fixSelfClosing, filteredUrlAttrs = Tools.makeMap('src,href,data,background,formaction,poster');
+			var scriptUriRegExp = /((java|vb)script|mhtml):/i, dataUriRegExp = /^data:/i;
+
+			function processEndTag(name) {
+				var pos, i;
+
+				// Find position of parent of the same type
+				pos = stack.length;
+				while (pos--) {
+					if (stack[pos].name === name) {
+						break;
+					}
+				}
+
+				// Found parent
+				if (pos >= 0) {
+					// Close all the open elements
+					for (i = stack.length - 1; i >= pos; i--) {
+						name = stack[i];
+
+						if (name.valid) {
+							self.end(name.name);
+						}
+					}
+
+					// Remove the open elements from the stack
+					stack.length = pos;
+				}
+			}
+
+			function parseAttribute(match, name, value, val2, val3) {
+				var attrRule, i, trimRegExp = /[\s\u0000-\u001F]+/g;
+
+				name = name.toLowerCase();
+				value = name in fillAttrsMap ? name : decode(value || val2 || val3 || ''); // Handle boolean attribute than value attribute
+
+				// Validate name and value pass through all data- attributes
+				if (validate && !isInternalElement && name.indexOf('data-') !== 0) {
+					attrRule = validAttributesMap[name];
+
+					// Find rule by pattern matching
+					if (!attrRule && validAttributePatterns) {
+						i = validAttributePatterns.length;
+						while (i--) {
+							attrRule = validAttributePatterns[i];
+							if (attrRule.pattern.test(name)) {
+								break;
+							}
+						}
+
+						// No rule matched
+						if (i === -1) {
+							attrRule = null;
+						}
+					}
+
+					// No attribute rule found
+					if (!attrRule) {
+						return;
+					}
+
+					// Validate value
+					if (attrRule.validValues && !(value in attrRule.validValues)) {
+						return;
+					}
+				}
+
+				// Block any javascript: urls or non image data uris
+				if (filteredUrlAttrs[name] && !settings.allow_script_urls) {
+					var uri = value.replace(trimRegExp, '');
+
+					try {
+						// Might throw malformed URI sequence
+						uri = decodeURIComponent(uri);
+					} catch (ex) {
+						// Fallback to non UTF-8 decoder
+						uri = unescape(uri);
+					}
+
+					if (scriptUriRegExp.test(uri)) {
+						return;
+					}
+
+					if (!settings.allow_html_data_urls && dataUriRegExp.test(uri) && !/^data:image\//i.test(uri)) {
+						return;
+					}
+				}
+
+				// Add attribute to list and map
+				attrList.map[name] = value;
+				attrList.push({
+					name: name,
+					value: value
+				});
+			}
+
+			// Precompile RegExps and map objects
+			tokenRegExp = new RegExp('<(?:' +
+				'(?:!--([\\w\\W]*?)-->)|' + // Comment
+				'(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|' + // CDATA
+				'(?:!DOCTYPE([\\w\\W]*?)>)|' + // DOCTYPE
+				'(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|' + // PI
+				'(?:\\/([^>]+)>)|' + // End element
+				'(?:([A-Za-z0-9\\-_\\:\\.]+)((?:\\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\\/|\\s+)>)' + // Start element
+			')', 'g');
+
+			attrRegExp = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g;
+
+			// Setup lookup tables for empty elements and boolean attributes
+			shortEndedElements = schema.getShortEndedElements();
+			selfClosing = settings.self_closing_elements || schema.getSelfClosingElements();
+			fillAttrsMap = schema.getBoolAttrs();
+			validate = settings.validate;
+			removeInternalElements = settings.remove_internals;
+			fixSelfClosing = settings.fix_self_closing;
+			specialElements = schema.getSpecialElements();
+
+			while ((matches = tokenRegExp.exec(html))) {
+				// Text
+				if (index < matches.index) {
+					self.text(decode(html.substr(index, matches.index - index)));
+				}
+
+				if ((value = matches[6])) { // End element
+					value = value.toLowerCase();
+
+					// IE will add a ":" in front of elements it doesn't understand like custom elements or HTML5 elements
+					if (value.charAt(0) === ':') {
+						value = value.substr(1);
+					}
+
+					processEndTag(value);
+				} else if ((value = matches[7])) { // Start element
+					value = value.toLowerCase();
+
+					// IE will add a ":" in front of elements it doesn't understand like custom elements or HTML5 elements
+					if (value.charAt(0) === ':') {
+						value = value.substr(1);
+					}
+
+					isShortEnded = value in shortEndedElements;
+
+					// Is self closing tag for example an <li> after an open <li>
+					if (fixSelfClosing && selfClosing[value] && stack.length > 0 && stack[stack.length - 1].name === value) {
+						processEndTag(value);
+					}
+
+					// Validate element
+					if (!validate || (elementRule = schema.getElementRule(value))) {
+						isValidElement = true;
+
+						// Grab attributes map and patters when validation is enabled
+						if (validate) {
+							validAttributesMap = elementRule.attributes;
+							validAttributePatterns = elementRule.attributePatterns;
+						}
+
+						// Parse attributes
+						if ((attribsValue = matches[8])) {
+							isInternalElement = attribsValue.indexOf('data-mce-type') !== -1; // Check if the element is an internal element
+
+							// If the element has internal attributes then remove it if we are told to do so
+							if (isInternalElement && removeInternalElements) {
+								isValidElement = false;
+							}
+
+							attrList = [];
+							attrList.map = {};
+
+							attribsValue.replace(attrRegExp, parseAttribute);
+						} else {
+							attrList = [];
+							attrList.map = {};
+						}
+
+						// Process attributes if validation is enabled
+						if (validate && !isInternalElement) {
+							attributesRequired = elementRule.attributesRequired;
+							attributesDefault = elementRule.attributesDefault;
+							attributesForced = elementRule.attributesForced;
+							anyAttributesRequired = elementRule.removeEmptyAttrs;
+
+							// Check if any attribute exists
+							if (anyAttributesRequired && !attrList.length) {
+								isValidElement = false;
+							}
+
+							// Handle forced attributes
+							if (attributesForced) {
+								i = attributesForced.length;
+								while (i--) {
+									attr = attributesForced[i];
+									name = attr.name;
+									attrValue = attr.value;
+
+									if (attrValue === '{$uid}') {
+										attrValue = 'mce_' + idCount++;
+									}
+
+									attrList.map[name] = attrValue;
+									attrList.push({name: name, value: attrValue});
+								}
+							}
+
+							// Handle default attributes
+							if (attributesDefault) {
+								i = attributesDefault.length;
+								while (i--) {
+									attr = attributesDefault[i];
+									name = attr.name;
+
+									if (!(name in attrList.map)) {
+										attrValue = attr.value;
+
+										if (attrValue === '{$uid}') {
+											attrValue = 'mce_' + idCount++;
+										}
+
+										attrList.map[name] = attrValue;
+										attrList.push({name: name, value: attrValue});
+									}
+								}
+							}
+
+							// Handle required attributes
+							if (attributesRequired) {
+								i = attributesRequired.length;
+								while (i--) {
+									if (attributesRequired[i] in attrList.map) {
+										break;
+									}
+								}
+
+								// None of the required attributes where found
+								if (i === -1) {
+									isValidElement = false;
+								}
+							}
+
+							// Invalidate element if it's marked as bogus
+							if ((attr = attrList.map['data-mce-bogus'])) {
+								if (attr === 'all') {
+									index = findEndTag(schema, html, tokenRegExp.lastIndex);
+									tokenRegExp.lastIndex = index;
+									continue;
+								}
+
+								isValidElement = false;
+							}
+						}
+
+						if (isValidElement) {
+							self.start(value, attrList, isShortEnded);
+						}
+					} else {
+						isValidElement = false;
+					}
+
+					// Treat script, noscript and style a bit different since they may include code that looks like elements
+					if ((endRegExp = specialElements[value])) {
+						endRegExp.lastIndex = index = matches.index + matches[0].length;
+
+						if ((matches = endRegExp.exec(html))) {
+							if (isValidElement) {
+								text = html.substr(index, matches.index - index);
+							}
+
+							index = matches.index + matches[0].length;
+						} else {
+							text = html.substr(index);
+							index = html.length;
+						}
+
+						if (isValidElement) {
+							if (text.length > 0) {
+								self.text(text, true);
+							}
+
+							self.end(value);
+						}
+
+						tokenRegExp.lastIndex = index;
+						continue;
+					}
+
+					// Push value on to stack
+					if (!isShortEnded) {
+						if (!attribsValue || attribsValue.indexOf('/') != attribsValue.length - 1) {
+							stack.push({name: value, valid: isValidElement});
+						} else if (isValidElement) {
+							self.end(value);
+						}
+					}
+				} else if ((value = matches[1])) { // Comment
+					// Padd comment value to avoid browsers from parsing invalid comments as HTML
+					if (value.charAt(0) === '>') {
+						value = ' ' + value;
+					}
+
+					if (!settings.allow_conditional_comments && value.substr(0, 3) === '[if') {
+						value = ' ' + value;
+					}
+
+					self.comment(value);
+				} else if ((value = matches[2])) { // CDATA
+					self.cdata(value);
+				} else if ((value = matches[3])) { // DOCTYPE
+					self.doctype(value);
+				} else if ((value = matches[4])) { // PI
+					self.pi(value, matches[5]);
+				}
+
+				index = matches.index + matches[0].length;
+			}
+
+			// Text
+			if (index < html.length) {
+				self.text(decode(html.substr(index)));
+			}
+
+			// Close any open elements
+			for (i = stack.length - 1; i >= 0; i--) {
+				value = stack[i];
+
+				if (value.valid) {
+					self.end(value.name);
+				}
+			}
+		};
+	}
+
+	SaxParser.findEndTag = findEndTag;
+
+	return SaxParser;
+});
+
+// Included from: js/tinymce/classes/html/DomParser.js
+
+/**
+ * DomParser.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class parses HTML code into a DOM like structure of nodes it will remove redundant whitespace and make
+ * sure that the node tree is valid according to the specified schema.
+ * So for example: <p>a<p>b</p>c</p> will become <p>a</p><p>b</p><p>c</p>
+ *
+ * @example
+ * var parser = new tinymce.html.DomParser({validate: true}, schema);
+ * var rootNode = parser.parse('<h1>content</h1>');
+ *
+ * @class tinymce.html.DomParser
+ * @version 3.4
+ */
+define("tinymce/html/DomParser", [
+	"tinymce/html/Node",
+	"tinymce/html/Schema",
+	"tinymce/html/SaxParser",
+	"tinymce/util/Tools"
+], function(Node, Schema, SaxParser, Tools) {
+	var makeMap = Tools.makeMap, each = Tools.each, explode = Tools.explode, extend = Tools.extend;
+
+	/**
+	 * Constructs a new DomParser instance.
+	 *
+	 * @constructor
+	 * @method DomParser
+	 * @param {Object} settings Name/value collection of settings. comment, cdata, text, start and end are callbacks.
+	 * @param {tinymce.html.Schema} schema HTML Schema class to use when parsing.
+	 */
+	return function(settings, schema) {
+		var self = this, nodeFilters = {}, attributeFilters = [], matchedNodes = {}, matchedAttributes = {};
+
+		settings = settings || {};
+		settings.validate = "validate" in settings ? settings.validate : true;
+		settings.root_name = settings.root_name || 'body';
+		self.schema = schema = schema || new Schema();
+
+		function fixInvalidChildren(nodes) {
+			var ni, node, parent, parents, newParent, currentNode, tempNode, childNode, i;
+			var nonEmptyElements, nonSplitableElements, textBlockElements, sibling, nextNode;
+
+			nonSplitableElements = makeMap('tr,td,th,tbody,thead,tfoot,table');
+			nonEmptyElements = schema.getNonEmptyElements();
+			textBlockElements = schema.getTextBlockElements();
+
+			for (ni = 0; ni < nodes.length; ni++) {
+				node = nodes[ni];
+
+				// Already removed or fixed
+				if (!node.parent || node.fixed) {
+					continue;
+				}
+
+				// If the invalid element is a text block and the text block is within a parent LI element
+				// Then unwrap the first text block and convert other sibling text blocks to LI elements similar to Word/Open Office
+				if (textBlockElements[node.name] && node.parent.name == 'li') {
+					// Move sibling text blocks after LI element
+					sibling = node.next;
+					while (sibling) {
+						if (textBlockElements[sibling.name]) {
+							sibling.name = 'li';
+							sibling.fixed = true;
+							node.parent.insert(sibling, node.parent);
+						} else {
+							break;
+						}
+
+						sibling = sibling.next;
+					}
+
+					// Unwrap current text block
+					node.unwrap(node);
+					continue;
+				}
+
+				// Get list of all parent nodes until we find a valid parent to stick the child into
+				parents = [node];
+				for (parent = node.parent; parent && !schema.isValidChild(parent.name, node.name) &&
+					!nonSplitableElements[parent.name]; parent = parent.parent) {
+					parents.push(parent);
+				}
+
+				// Found a suitable parent
+				if (parent && parents.length > 1) {
+					// Reverse the array since it makes looping easier
+					parents.reverse();
+
+					// Clone the related parent and insert that after the moved node
+					newParent = currentNode = self.filterNode(parents[0].clone());
+
+					// Start cloning and moving children on the left side of the target node
+					for (i = 0; i < parents.length - 1; i++) {
+						if (schema.isValidChild(currentNode.name, parents[i].name)) {
+							tempNode = self.filterNode(parents[i].clone());
+							currentNode.append(tempNode);
+						} else {
+							tempNode = currentNode;
+						}
+
+						for (childNode = parents[i].firstChild; childNode && childNode != parents[i + 1];) {
+							nextNode = childNode.next;
+							tempNode.append(childNode);
+							childNode = nextNode;
+						}
+
+						currentNode = tempNode;
+					}
+
+					if (!newParent.isEmpty(nonEmptyElements)) {
+						parent.insert(newParent, parents[0], true);
+						parent.insert(node, newParent);
+					} else {
+						parent.insert(node, parents[0], true);
+					}
+
+					// Check if the element is empty by looking through it's contents and special treatment for <p><br /></p>
+					parent = parents[0];
+					if (parent.isEmpty(nonEmptyElements) || parent.firstChild === parent.lastChild && parent.firstChild.name === 'br') {
+						parent.empty().remove();
+					}
+				} else if (node.parent) {
+					// If it's an LI try to find a UL/OL for it or wrap it
+					if (node.name === 'li') {
+						sibling = node.prev;
+						if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) {
+							sibling.append(node);
+							continue;
+						}
+
+						sibling = node.next;
+						if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) {
+							sibling.insert(node, sibling.firstChild, true);
+							continue;
+						}
+
+						node.wrap(self.filterNode(new Node('ul', 1)));
+						continue;
+					}
+
+					// Try wrapping the element in a DIV
+					if (schema.isValidChild(node.parent.name, 'div') && schema.isValidChild('div', node.name)) {
+						node.wrap(self.filterNode(new Node('div', 1)));
+					} else {
+						// We failed wrapping it, then remove or unwrap it
+						if (node.name === 'style' || node.name === 'script') {
+							node.empty().remove();
+						} else {
+							node.unwrap();
+						}
+					}
+				}
+			}
+		}
+
+		/**
+		 * Runs the specified node though the element and attributes filters.
+		 *
+		 * @method filterNode
+		 * @param {tinymce.html.Node} Node the node to run filters on.
+		 * @return {tinymce.html.Node} The passed in node.
+		 */
+		self.filterNode = function(node) {
+			var i, name, list;
+
+			// Run element filters
+			if (name in nodeFilters) {
+				list = matchedNodes[name];
+
+				if (list) {
+					list.push(node);
+				} else {
+					matchedNodes[name] = [node];
+				}
+			}
+
+			// Run attribute filters
+			i = attributeFilters.length;
+			while (i--) {
+				name = attributeFilters[i].name;
+
+				if (name in node.attributes.map) {
+					list = matchedAttributes[name];
+
+					if (list) {
+						list.push(node);
+					} else {
+						matchedAttributes[name] = [node];
+					}
+				}
+			}
+
+			return node;
+		};
+
+		/**
+		 * Adds a node filter function to the parser, the parser will collect the specified nodes by name
+		 * and then execute the callback ones it has finished parsing the document.
+		 *
+		 * @example
+		 * parser.addNodeFilter('p,h1', function(nodes, name) {
+		 *		for (var i = 0; i < nodes.length; i++) {
+		 *			console.log(nodes[i].name);
+		 *		}
+		 * });
+		 * @method addNodeFilter
+		 * @method {String} name Comma separated list of nodes to collect.
+		 * @param {function} callback Callback function to execute once it has collected nodes.
+		 */
+		self.addNodeFilter = function(name, callback) {
+			each(explode(name), function(name) {
+				var list = nodeFilters[name];
+
+				if (!list) {
+					nodeFilters[name] = list = [];
+				}
+
+				list.push(callback);
+			});
+		};
+
+		/**
+		 * Adds a attribute filter function to the parser, the parser will collect nodes that has the specified attributes
+		 * and then execute the callback ones it has finished parsing the document.
+		 *
+		 * @example
+		 * parser.addAttributeFilter('src,href', function(nodes, name) {
+		 *		for (var i = 0; i < nodes.length; i++) {
+		 *			console.log(nodes[i].name);
+		 *		}
+		 * });
+		 * @method addAttributeFilter
+		 * @method {String} name Comma separated list of nodes to collect.
+		 * @param {function} callback Callback function to execute once it has collected nodes.
+		 */
+		self.addAttributeFilter = function(name, callback) {
+			each(explode(name), function(name) {
+				var i;
+
+				for (i = 0; i < attributeFilters.length; i++) {
+					if (attributeFilters[i].name === name) {
+						attributeFilters[i].callbacks.push(callback);
+						return;
+					}
+				}
+
+				attributeFilters.push({name: name, callbacks: [callback]});
+			});
+		};
+
+		/**
+		 * Parses the specified HTML string into a DOM like node tree and returns the result.
+		 *
+		 * @example
+		 * var rootNode = new DomParser({...}).parse('<b>text</b>');
+		 * @method parse
+		 * @param {String} html Html string to sax parse.
+		 * @param {Object} args Optional args object that gets passed to all filter functions.
+		 * @return {tinymce.html.Node} Root node containing the tree.
+		 */
+		self.parse = function(html, args) {
+			var parser, rootNode, node, nodes, i, l, fi, fl, list, name, validate;
+			var blockElements, startWhiteSpaceRegExp, invalidChildren = [], isInWhiteSpacePreservedElement;
+			var endWhiteSpaceRegExp, allWhiteSpaceRegExp, isAllWhiteSpaceRegExp, whiteSpaceElements;
+			var children, nonEmptyElements, rootBlockName;
+
+			args = args || {};
+			matchedNodes = {};
+			matchedAttributes = {};
+			blockElements = extend(makeMap('script,style,head,html,body,title,meta,param'), schema.getBlockElements());
+			nonEmptyElements = schema.getNonEmptyElements();
+			children = schema.children;
+			validate = settings.validate;
+			rootBlockName = "forced_root_block" in args ? args.forced_root_block : settings.forced_root_block;
+
+			whiteSpaceElements = schema.getWhiteSpaceElements();
+			startWhiteSpaceRegExp = /^[ \t\r\n]+/;
+			endWhiteSpaceRegExp = /[ \t\r\n]+$/;
+			allWhiteSpaceRegExp = /[ \t\r\n]+/g;
+			isAllWhiteSpaceRegExp = /^[ \t\r\n]+$/;
+
+			function addRootBlocks() {
+				var node = rootNode.firstChild, next, rootBlockNode;
+
+				// Removes whitespace at beginning and end of block so:
+				// <p> x </p> -> <p>x</p>
+				function trim(rootBlockNode) {
+					if (rootBlockNode) {
+						node = rootBlockNode.firstChild;
+						if (node && node.type == 3) {
+							node.value = node.value.replace(startWhiteSpaceRegExp, '');
+						}
+
+						node = rootBlockNode.lastChild;
+						if (node && node.type == 3) {
+							node.value = node.value.replace(endWhiteSpaceRegExp, '');
+						}
+					}
+				}
+
+				// Check if rootBlock is valid within rootNode for example if P is valid in H1 if H1 is the contentEditabe root
+				if (!schema.isValidChild(rootNode.name, rootBlockName.toLowerCase())) {
+					return;
+				}
+
+				while (node) {
+					next = node.next;
+
+					if (node.type == 3 || (node.type == 1 && node.name !== 'p' &&
+						!blockElements[node.name] && !node.attr('data-mce-type'))) {
+						if (!rootBlockNode) {
+							// Create a new root block element
+							rootBlockNode = createNode(rootBlockName, 1);
+							rootBlockNode.attr(settings.forced_root_block_attrs);
+							rootNode.insert(rootBlockNode, node);
+							rootBlockNode.append(node);
+						} else {
+							rootBlockNode.append(node);
+						}
+					} else {
+						trim(rootBlockNode);
+						rootBlockNode = null;
+					}
+
+					node = next;
+				}
+
+				trim(rootBlockNode);
+			}
+
+			function createNode(name, type) {
+				var node = new Node(name, type), list;
+
+				if (name in nodeFilters) {
+					list = matchedNodes[name];
+
+					if (list) {
+						list.push(node);
+					} else {
+						matchedNodes[name] = [node];
+					}
+				}
+
+				return node;
+			}
+
+			function removeWhitespaceBefore(node) {
+				var textNode, textVal, sibling;
+
+				for (textNode = node.prev; textNode && textNode.type === 3;) {
+					textVal = textNode.value.replace(endWhiteSpaceRegExp, '');
+
+					if (textVal.length > 0) {
+						textNode.value = textVal;
+						textNode = textNode.prev;
+					} else {
+						sibling = textNode.prev;
+						textNode.remove();
+						textNode = sibling;
+					}
+				}
+			}
+
+			function cloneAndExcludeBlocks(input) {
+				var name, output = {};
+
+				for (name in input) {
+					if (name !== 'li' && name != 'p') {
+						output[name] = input[name];
+					}
+				}
+
+				return output;
+			}
+
+			parser = new SaxParser({
+				validate: validate,
+				allow_script_urls: settings.allow_script_urls,
+				allow_conditional_comments: settings.allow_conditional_comments,
+
+				// Exclude P and LI from DOM parsing since it's treated better by the DOM parser
+				self_closing_elements: cloneAndExcludeBlocks(schema.getSelfClosingElements()),
+
+				cdata: function(text) {
+					node.append(createNode('#cdata', 4)).value = text;
+				},
+
+				text: function(text, raw) {
+					var textNode;
+
+					// Trim all redundant whitespace on non white space elements
+					if (!isInWhiteSpacePreservedElement) {
+						text = text.replace(allWhiteSpaceRegExp, ' ');
+
+						if (node.lastChild && blockElements[node.lastChild.name]) {
+							text = text.replace(startWhiteSpaceRegExp, '');
+						}
+					}
+
+					// Do we need to create the node
+					if (text.length !== 0) {
+						textNode = createNode('#text', 3);
+						textNode.raw = !!raw;
+						node.append(textNode).value = text;
+					}
+				},
+
+				comment: function(text) {
+					node.append(createNode('#comment', 8)).value = text;
+				},
+
+				pi: function(name, text) {
+					node.append(createNode(name, 7)).value = text;
+					removeWhitespaceBefore(node);
+				},
+
+				doctype: function(text) {
+					var newNode;
+
+					newNode = node.append(createNode('#doctype', 10));
+					newNode.value = text;
+					removeWhitespaceBefore(node);
+				},
+
+				start: function(name, attrs, empty) {
+					var newNode, attrFiltersLen, elementRule, attrName, parent;
+
+					elementRule = validate ? schema.getElementRule(name) : {};
+					if (elementRule) {
+						newNode = createNode(elementRule.outputName || name, 1);
+						newNode.attributes = attrs;
+						newNode.shortEnded = empty;
+
+						node.append(newNode);
+
+						// Check if node is valid child of the parent node is the child is
+						// unknown we don't collect it since it's probably a custom element
+						parent = children[node.name];
+						if (parent && children[newNode.name] && !parent[newNode.name]) {
+							invalidChildren.push(newNode);
+						}
+
+						attrFiltersLen = attributeFilters.length;
+						while (attrFiltersLen--) {
+							attrName = attributeFilters[attrFiltersLen].name;
+
+							if (attrName in attrs.map) {
+								list = matchedAttributes[attrName];
+
+								if (list) {
+									list.push(newNode);
+								} else {
+									matchedAttributes[attrName] = [newNode];
+								}
+							}
+						}
+
+						// Trim whitespace before block
+						if (blockElements[name]) {
+							removeWhitespaceBefore(newNode);
+						}
+
+						// Change current node if the element wasn't empty i.e not <br /> or <img />
+						if (!empty) {
+							node = newNode;
+						}
+
+						// Check if we are inside a whitespace preserved element
+						if (!isInWhiteSpacePreservedElement && whiteSpaceElements[name]) {
+							isInWhiteSpacePreservedElement = true;
+						}
+					}
+				},
+
+				end: function(name) {
+					var textNode, elementRule, text, sibling, tempNode;
+
+					elementRule = validate ? schema.getElementRule(name) : {};
+					if (elementRule) {
+						if (blockElements[name]) {
+							if (!isInWhiteSpacePreservedElement) {
+								// Trim whitespace of the first node in a block
+								textNode = node.firstChild;
+								if (textNode && textNode.type === 3) {
+									text = textNode.value.replace(startWhiteSpaceRegExp, '');
+
+									// Any characters left after trim or should we remove it
+									if (text.length > 0) {
+										textNode.value = text;
+										textNode = textNode.next;
+									} else {
+										sibling = textNode.next;
+										textNode.remove();
+										textNode = sibling;
+
+										// Remove any pure whitespace siblings
+										while (textNode && textNode.type === 3) {
+											text = textNode.value;
+											sibling = textNode.next;
+
+											if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) {
+												textNode.remove();
+												textNode = sibling;
+											}
+
+											textNode = sibling;
+										}
+									}
+								}
+
+								// Trim whitespace of the last node in a block
+								textNode = node.lastChild;
+								if (textNode && textNode.type === 3) {
+									text = textNode.value.replace(endWhiteSpaceRegExp, '');
+
+									// Any characters left after trim or should we remove it
+									if (text.length > 0) {
+										textNode.value = text;
+										textNode = textNode.prev;
+									} else {
+										sibling = textNode.prev;
+										textNode.remove();
+										textNode = sibling;
+
+										// Remove any pure whitespace siblings
+										while (textNode && textNode.type === 3) {
+											text = textNode.value;
+											sibling = textNode.prev;
+
+											if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) {
+												textNode.remove();
+												textNode = sibling;
+											}
+
+											textNode = sibling;
+										}
+									}
+								}
+							}
+
+							// Trim start white space
+							// Removed due to: #5424
+							/*textNode = node.prev;
+							if (textNode && textNode.type === 3) {
+								text = textNode.value.replace(startWhiteSpaceRegExp, '');
+
+								if (text.length > 0)
+									textNode.value = text;
+								else
+									textNode.remove();
+							}*/
+						}
+
+						// Check if we exited a whitespace preserved element
+						if (isInWhiteSpacePreservedElement && whiteSpaceElements[name]) {
+							isInWhiteSpacePreservedElement = false;
+						}
+
+						// Handle empty nodes
+						if (elementRule.removeEmpty || elementRule.paddEmpty) {
+							if (node.isEmpty(nonEmptyElements)) {
+								if (elementRule.paddEmpty) {
+									node.empty().append(new Node('#text', '3')).value = '\u00a0';
+								} else {
+									// Leave nodes that have a name like <a name="name">
+									if (!node.attributes.map.name && !node.attributes.map.id) {
+										tempNode = node.parent;
+
+										if (blockElements[node.name]) {
+											node.empty().remove();
+										} else {
+											node.unwrap();
+										}
+
+										node = tempNode;
+										return;
+									}
+								}
+							}
+						}
+
+						node = node.parent;
+					}
+				}
+			}, schema);
+
+			rootNode = node = new Node(args.context || settings.root_name, 11);
+
+			parser.parse(html);
+
+			// Fix invalid children or report invalid children in a contextual parsing
+			if (validate && invalidChildren.length) {
+				if (!args.context) {
+					fixInvalidChildren(invalidChildren);
+				} else {
+					args.invalid = true;
+				}
+			}
+
+			// Wrap nodes in the root into block elements if the root is body
+			if (rootBlockName && (rootNode.name == 'body' || args.isRootContent)) {
+				addRootBlocks();
+			}
+
+			// Run filters only when the contents is valid
+			if (!args.invalid) {
+				// Run node filters
+				for (name in matchedNodes) {
+					list = nodeFilters[name];
+					nodes = matchedNodes[name];
+
+					// Remove already removed children
+					fi = nodes.length;
+					while (fi--) {
+						if (!nodes[fi].parent) {
+							nodes.splice(fi, 1);
+						}
+					}
+
+					for (i = 0, l = list.length; i < l; i++) {
+						list[i](nodes, name, args);
+					}
+				}
+
+				// Run attribute filters
+				for (i = 0, l = attributeFilters.length; i < l; i++) {
+					list = attributeFilters[i];
+
+					if (list.name in matchedAttributes) {
+						nodes = matchedAttributes[list.name];
+
+						// Remove already removed children
+						fi = nodes.length;
+						while (fi--) {
+							if (!nodes[fi].parent) {
+								nodes.splice(fi, 1);
+							}
+						}
+
+						for (fi = 0, fl = list.callbacks.length; fi < fl; fi++) {
+							list.callbacks[fi](nodes, list.name, args);
+						}
+					}
+				}
+			}
+
+			return rootNode;
+		};
+
+		// Remove <br> at end of block elements Gecko and WebKit injects BR elements to
+		// make it possible to place the caret inside empty blocks. This logic tries to remove
+		// these elements and keep br elements that where intended to be there intact
+		if (settings.remove_trailing_brs) {
+			self.addNodeFilter('br', function(nodes) {
+				var i, l = nodes.length, node, blockElements = extend({}, schema.getBlockElements());
+				var nonEmptyElements = schema.getNonEmptyElements(), parent, lastParent, prev, prevName;
+				var elementRule, textNode;
+
+				// Remove brs from body element as well
+				blockElements.body = 1;
+
+				// Must loop forwards since it will otherwise remove all brs in <p>a<br><br><br></p>
+				for (i = 0; i < l; i++) {
+					node = nodes[i];
+					parent = node.parent;
+
+					if (blockElements[node.parent.name] && node === parent.lastChild) {
+						// Loop all nodes to the left of the current node and check for other BR elements
+						// excluding bookmarks since they are invisible
+						prev = node.prev;
+						while (prev) {
+							prevName = prev.name;
+
+							// Ignore bookmarks
+							if (prevName !== "span" || prev.attr('data-mce-type') !== 'bookmark') {
+								// Found a non BR element
+								if (prevName !== "br") {
+									break;
+								}
+
+								// Found another br it's a <br><br> structure then don't remove anything
+								if (prevName === 'br') {
+									node = null;
+									break;
+								}
+							}
+
+							prev = prev.prev;
+						}
+
+						if (node) {
+							node.remove();
+
+							// Is the parent to be considered empty after we removed the BR
+							if (parent.isEmpty(nonEmptyElements)) {
+								elementRule = schema.getElementRule(parent.name);
+
+								// Remove or padd the element depending on schema rule
+								if (elementRule) {
+									if (elementRule.removeEmpty) {
+										parent.remove();
+									} else if (elementRule.paddEmpty) {
+										parent.empty().append(new Node('#text', 3)).value = '\u00a0';
+									}
+								}
+							}
+						}
+					} else {
+						// Replaces BR elements inside inline elements like <p><b><i><br></i></b></p>
+						// so they become <p><b><i>&nbsp;</i></b></p>
+						lastParent = node;
+						while (parent && parent.firstChild === lastParent && parent.lastChild === lastParent) {
+							lastParent = parent;
+
+							if (blockElements[parent.name]) {
+								break;
+							}
+
+							parent = parent.parent;
+						}
+
+						if (lastParent === parent) {
+							textNode = new Node('#text', 3);
+							textNode.value = '\u00a0';
+							node.replace(textNode);
+						}
+					}
+				}
+			});
+		}
+
+		// Force anchor names closed, unless the setting "allow_html_in_named_anchor" is explicitly included.
+		if (!settings.allow_html_in_named_anchor) {
+			self.addAttributeFilter('id,name', function(nodes) {
+				var i = nodes.length, sibling, prevSibling, parent, node;
+
+				while (i--) {
+					node = nodes[i];
+					if (node.name === 'a' && node.firstChild && !node.attr('href')) {
+						parent = node.parent;
+
+						// Move children after current node
+						sibling = node.lastChild;
+						do {
+							prevSibling = sibling.prev;
+							parent.insert(sibling, node);
+							sibling = prevSibling;
+						} while (sibling);
+					}
+				}
+			});
+		}
+
+		if (settings.validate && schema.getValidClasses()) {
+			self.addAttributeFilter('class', function(nodes) {
+				var i = nodes.length, node, classList, ci, className, classValue;
+				var validClasses = schema.getValidClasses(), validClassesMap, valid;
+
+				while (i--) {
+					node = nodes[i];
+					classList = node.attr('class').split(' ');
+					classValue = '';
+
+					for (ci = 0; ci < classList.length; ci++) {
+						className = classList[ci];
+						valid = false;
+
+						validClassesMap = validClasses['*'];
+						if (validClassesMap && validClassesMap[className]) {
+							valid = true;
+						}
+
+						validClassesMap = validClasses[node.name];
+						if (!valid && validClassesMap && validClassesMap[className]) {
+							valid = true;
+						}
+
+						if (valid) {
+							if (classValue) {
+								classValue += ' ';
+							}
+
+							classValue += className;
+						}
+					}
+
+					if (!classValue.length) {
+						classValue = null;
+					}
+
+					node.attr('class', classValue);
+				}
+			});
+		}
+	};
+});
+
+// Included from: js/tinymce/classes/html/Writer.js
+
+/**
+ * Writer.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is used to write HTML tags out it can be used with the Serializer or the SaxParser.
+ *
+ * @class tinymce.html.Writer
+ * @example
+ * var writer = new tinymce.html.Writer({indent: true});
+ * var parser = new tinymce.html.SaxParser(writer).parse('<p><br></p>');
+ * console.log(writer.getContent());
+ *
+ * @class tinymce.html.Writer
+ * @version 3.4
+ */
+define("tinymce/html/Writer", [
+	"tinymce/html/Entities",
+	"tinymce/util/Tools"
+], function(Entities, Tools) {
+	var makeMap = Tools.makeMap;
+
+	/**
+	 * Constructs a new Writer instance.
+	 *
+	 * @constructor
+	 * @method Writer
+	 * @param {Object} settings Name/value settings object.
+	 */
+	return function(settings) {
+		var html = [], indent, indentBefore, indentAfter, encode, htmlOutput;
+
+		settings = settings || {};
+		indent = settings.indent;
+		indentBefore = makeMap(settings.indent_before || '');
+		indentAfter = makeMap(settings.indent_after || '');
+		encode = Entities.getEncodeFunc(settings.entity_encoding || 'raw', settings.entities);
+		htmlOutput = settings.element_format == "html";
+
+		return {
+			/**
+			 * Writes the a start element such as <p id="a">.
+			 *
+			 * @method start
+			 * @param {String} name Name of the element.
+			 * @param {Array} attrs Optional attribute array or undefined if it hasn't any.
+			 * @param {Boolean} empty Optional empty state if the tag should end like <br />.
+			 */
+			start: function(name, attrs, empty) {
+				var i, l, attr, value;
+
+				if (indent && indentBefore[name] && html.length > 0) {
+					value = html[html.length - 1];
+
+					if (value.length > 0 && value !== '\n') {
+						html.push('\n');
+					}
+				}
+
+				html.push('<', name);
+
+				if (attrs) {
+					for (i = 0, l = attrs.length; i < l; i++) {
+						attr = attrs[i];
+						html.push(' ', attr.name, '="', encode(attr.value, true), '"');
+					}
+				}
+
+				if (!empty || htmlOutput) {
+					html[html.length] = '>';
+				} else {
+					html[html.length] = ' />';
+				}
+
+				if (empty && indent && indentAfter[name] && html.length > 0) {
+					value = html[html.length - 1];
+
+					if (value.length > 0 && value !== '\n') {
+						html.push('\n');
+					}
+				}
+			},
+
+			/**
+			 * Writes the a end element such as </p>.
+			 *
+			 * @method end
+			 * @param {String} name Name of the element.
+			 */
+			end: function(name) {
+				var value;
+
+				/*if (indent && indentBefore[name] && html.length > 0) {
+					value = html[html.length - 1];
+
+					if (value.length > 0 && value !== '\n')
+						html.push('\n');
+				}*/
+
+				html.push('</', name, '>');
+
+				if (indent && indentAfter[name] && html.length > 0) {
+					value = html[html.length - 1];
+
+					if (value.length > 0 && value !== '\n') {
+						html.push('\n');
+					}
+				}
+			},
+
+			/**
+			 * Writes a text node.
+			 *
+			 * @method text
+			 * @param {String} text String to write out.
+			 * @param {Boolean} raw Optional raw state if true the contents wont get encoded.
+			 */
+			text: function(text, raw) {
+				if (text.length > 0) {
+					html[html.length] = raw ? text : encode(text);
+				}
+			},
+
+			/**
+			 * Writes a cdata node such as <![CDATA[data]]>.
+			 *
+			 * @method cdata
+			 * @param {String} text String to write out inside the cdata.
+			 */
+			cdata: function(text) {
+				html.push('<![CDATA[', text, ']]>');
+			},
+
+			/**
+			 * Writes a comment node such as <!-- Comment -->.
+			 *
+			 * @method cdata
+			 * @param {String} text String to write out inside the comment.
+			 */
+			comment: function(text) {
+				html.push('<!--', text, '-->');
+			},
+
+			/**
+			 * Writes a PI node such as <?xml attr="value" ?>.
+			 *
+			 * @method pi
+			 * @param {String} name Name of the pi.
+			 * @param {String} text String to write out inside the pi.
+			 */
+			pi: function(name, text) {
+				if (text) {
+					html.push('<?', name, ' ', encode(text), '?>');
+				} else {
+					html.push('<?', name, '?>');
+				}
+
+				if (indent) {
+					html.push('\n');
+				}
+			},
+
+			/**
+			 * Writes a doctype node such as <!DOCTYPE data>.
+			 *
+			 * @method doctype
+			 * @param {String} text String to write out inside the doctype.
+			 */
+			doctype: function(text) {
+				html.push('<!DOCTYPE', text, '>', indent ? '\n' : '');
+			},
+
+			/**
+			 * Resets the internal buffer if one wants to reuse the writer.
+			 *
+			 * @method reset
+			 */
+			reset: function() {
+				html.length = 0;
+			},
+
+			/**
+			 * Returns the contents that got serialized.
+			 *
+			 * @method getContent
+			 * @return {String} HTML contents that got written down.
+			 */
+			getContent: function() {
+				return html.join('').replace(/\n$/, '');
+			}
+		};
+	};
+});
+
+// Included from: js/tinymce/classes/html/Serializer.js
+
+/**
+ * Serializer.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is used to serialize down the DOM tree into a string using a Writer instance.
+ *
+ *
+ * @example
+ * new tinymce.html.Serializer().serialize(new tinymce.html.DomParser().parse('<p>text</p>'));
+ * @class tinymce.html.Serializer
+ * @version 3.4
+ */
+define("tinymce/html/Serializer", [
+	"tinymce/html/Writer",
+	"tinymce/html/Schema"
+], function(Writer, Schema) {
+	/**
+	 * Constructs a new Serializer instance.
+	 *
+	 * @constructor
+	 * @method Serializer
+	 * @param {Object} settings Name/value settings object.
+	 * @param {tinymce.html.Schema} schema Schema instance to use.
+	 */
+	return function(settings, schema) {
+		var self = this, writer = new Writer(settings);
+
+		settings = settings || {};
+		settings.validate = "validate" in settings ? settings.validate : true;
+
+		self.schema = schema = schema || new Schema();
+		self.writer = writer;
+
+		/**
+		 * Serializes the specified node into a string.
+		 *
+		 * @example
+		 * new tinymce.html.Serializer().serialize(new tinymce.html.DomParser().parse('<p>text</p>'));
+		 * @method serialize
+		 * @param {tinymce.html.Node} node Node instance to serialize.
+		 * @return {String} String with HTML based on DOM tree.
+		 */
+		self.serialize = function(node) {
+			var handlers, validate;
+
+			validate = settings.validate;
+
+			handlers = {
+				// #text
+				3: function(node) {
+					writer.text(node.value, node.raw);
+				},
+
+				// #comment
+				8: function(node) {
+					writer.comment(node.value);
+				},
+
+				// Processing instruction
+				7: function(node) {
+					writer.pi(node.name, node.value);
+				},
+
+				// Doctype
+				10: function(node) {
+					writer.doctype(node.value);
+				},
+
+				// CDATA
+				4: function(node) {
+					writer.cdata(node.value);
+				},
+
+				// Document fragment
+				11: function(node) {
+					if ((node = node.firstChild)) {
+						do {
+							walk(node);
+						} while ((node = node.next));
+					}
+				}
+			};
+
+			writer.reset();
+
+			function walk(node) {
+				var handler = handlers[node.type], name, isEmpty, attrs, attrName, attrValue, sortedAttrs, i, l, elementRule;
+
+				if (!handler) {
+					name = node.name;
+					isEmpty = node.shortEnded;
+					attrs = node.attributes;
+
+					// Sort attributes
+					if (validate && attrs && attrs.length > 1) {
+						sortedAttrs = [];
+						sortedAttrs.map = {};
+
+						elementRule = schema.getElementRule(node.name);
+						for (i = 0, l = elementRule.attributesOrder.length; i < l; i++) {
+							attrName = elementRule.attributesOrder[i];
+
+							if (attrName in attrs.map) {
+								attrValue = attrs.map[attrName];
+								sortedAttrs.map[attrName] = attrValue;
+								sortedAttrs.push({name: attrName, value: attrValue});
+							}
+						}
+
+						for (i = 0, l = attrs.length; i < l; i++) {
+							attrName = attrs[i].name;
+
+							if (!(attrName in sortedAttrs.map)) {
+								attrValue = attrs.map[attrName];
+								sortedAttrs.map[attrName] = attrValue;
+								sortedAttrs.push({name: attrName, value: attrValue});
+							}
+						}
+
+						attrs = sortedAttrs;
+					}
+
+					writer.start(node.name, attrs, isEmpty);
+
+					if (!isEmpty) {
+						if ((node = node.firstChild)) {
+							do {
+								walk(node);
+							} while ((node = node.next));
+						}
+
+						writer.end(name);
+					}
+				} else {
+					handler(node);
+				}
+			}
+
+			// Serialize element and treat all non elements as fragments
+			if (node.type == 1 && !settings.inner) {
+				walk(node);
+			} else {
+				handlers[11](node);
+			}
+
+			return writer.getContent();
+		};
+	};
+});
+
+// Included from: js/tinymce/classes/dom/Serializer.js
+
+/**
+ * Serializer.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is used to serialize DOM trees into a string. Consult the TinyMCE Wiki API for
+ * more details and examples on how to use this class.
+ *
+ * @class tinymce.dom.Serializer
+ */
+define("tinymce/dom/Serializer", [
+	"tinymce/dom/DOMUtils",
+	"tinymce/html/DomParser",
+	"tinymce/html/Entities",
+	"tinymce/html/Serializer",
+	"tinymce/html/Node",
+	"tinymce/html/Schema",
+	"tinymce/Env",
+	"tinymce/util/Tools"
+], function(DOMUtils, DomParser, Entities, Serializer, Node, Schema, Env, Tools) {
+	var each = Tools.each, trim = Tools.trim;
+	var DOM = DOMUtils.DOM;
+
+	/**
+	 * Constructs a new DOM serializer class.
+	 *
+	 * @constructor
+	 * @method Serializer
+	 * @param {Object} settings Serializer settings object.
+	 * @param {tinymce.Editor} editor Optional editor to bind events to and get schema/dom from.
+	 */
+	return function(settings, editor) {
+		var dom, schema, htmlParser;
+
+		if (editor) {
+			dom = editor.dom;
+			schema = editor.schema;
+		}
+
+		// Default DOM and Schema if they are undefined
+		dom = dom || DOM;
+		schema = schema || new Schema(settings);
+		settings.entity_encoding = settings.entity_encoding || 'named';
+		settings.remove_trailing_brs = "remove_trailing_brs" in settings ? settings.remove_trailing_brs : true;
+
+		htmlParser = new DomParser(settings, schema);
+
+		// Convert tabindex back to elements when serializing contents
+		htmlParser.addAttributeFilter('data-mce-tabindex', function(nodes, name) {
+			var i = nodes.length, node;
+
+			while (i--) {
+				node = nodes[i];
+				node.attr('tabindex', node.attributes.map['data-mce-tabindex']);
+				node.attr(name, null);
+			}
+		});
+
+		// Convert move data-mce-src, data-mce-href and data-mce-style into nodes or process them if needed
+		htmlParser.addAttributeFilter('src,href,style', function(nodes, name) {
+			var i = nodes.length, node, value, internalName = 'data-mce-' + name;
+			var urlConverter = settings.url_converter, urlConverterScope = settings.url_converter_scope, undef;
+
+			while (i--) {
+				node = nodes[i];
+
+				value = node.attributes.map[internalName];
+				if (value !== undef) {
+					// Set external name to internal value and remove internal
+					node.attr(name, value.length > 0 ? value : null);
+					node.attr(internalName, null);
+				} else {
+					// No internal attribute found then convert the value we have in the DOM
+					value = node.attributes.map[name];
+
+					if (name === "style") {
+						value = dom.serializeStyle(dom.parseStyle(value), node.name);
+					} else if (urlConverter) {
+						value = urlConverter.call(urlConverterScope, value, name, node.name);
+					}
+
+					node.attr(name, value.length > 0 ? value : null);
+				}
+			}
+		});
+
+		// Remove internal classes mceItem<..> or mceSelected
+		htmlParser.addAttributeFilter('class', function(nodes) {
+			var i = nodes.length, node, value;
+
+			while (i--) {
+				node = nodes[i];
+				value = node.attr('class');
+
+				if (value) {
+					value = node.attr('class').replace(/(?:^|\s)mce-item-\w+(?!\S)/g, '');
+					node.attr('class', value.length > 0 ? value : null);
+				}
+			}
+		});
+
+		// Remove bookmark elements
+		htmlParser.addAttributeFilter('data-mce-type', function(nodes, name, args) {
+			var i = nodes.length, node;
+
+			while (i--) {
+				node = nodes[i];
+
+				if (node.attributes.map['data-mce-type'] === 'bookmark' && !args.cleanup) {
+					node.remove();
+				}
+			}
+		});
+
+		htmlParser.addNodeFilter('noscript', function(nodes) {
+			var i = nodes.length, node;
+
+			while (i--) {
+				node = nodes[i].firstChild;
+
+				if (node) {
+					node.value = Entities.decode(node.value);
+				}
+			}
+		});
+
+		// Force script into CDATA sections and remove the mce- prefix also add comments around styles
+		htmlParser.addNodeFilter('script,style', function(nodes, name) {
+			var i = nodes.length, node, value, type;
+
+			function trim(value) {
+				/*jshint maxlen:255 */
+				/*eslint max-len:0 */
+				return value.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, '');
+			}
+
+			while (i--) {
+				node = nodes[i];
+				value = node.firstChild ? node.firstChild.value : '';
+
+				if (name === "script") {
+					// Remove mce- prefix from script elements and remove default type since the user specified
+					// a script element without type attribute
+					type = node.attr('type');
+					if (type) {
+						node.attr('type', type == 'mce-no/type' ? null : type.replace(/^mce\-/, ''));
+					}
+
+					if (value.length > 0) {
+						node.firstChild.value = '// <![CDATA[\n' + trim(value) + '\n// ]]>';
+					}
+				} else {
+					if (value.length > 0) {
+						node.firstChild.value = '<!--\n' + trim(value) + '\n-->';
+					}
+				}
+			}
+		});
+
+		// Convert comments to cdata and handle protected comments
+		htmlParser.addNodeFilter('#comment', function(nodes) {
+			var i = nodes.length, node;
+
+			while (i--) {
+				node = nodes[i];
+
+				if (node.value.indexOf('[CDATA[') === 0) {
+					node.name = '#cdata';
+					node.type = 4;
+					node.value = node.value.replace(/^\[CDATA\[|\]\]$/g, '');
+				} else if (node.value.indexOf('mce:protected ') === 0) {
+					node.name = "#text";
+					node.type = 3;
+					node.raw = true;
+					node.value = unescape(node.value).substr(14);
+				}
+			}
+		});
+
+		htmlParser.addNodeFilter('xml:namespace,input', function(nodes, name) {
+			var i = nodes.length, node;
+
+			while (i--) {
+				node = nodes[i];
+				if (node.type === 7) {
+					node.remove();
+				} else if (node.type === 1) {
+					if (name === "input" && !("type" in node.attributes.map)) {
+						node.attr('type', 'text');
+					}
+				}
+			}
+		});
+
+		// Fix list elements, TODO: Replace this later
+		if (settings.fix_list_elements) {
+			htmlParser.addNodeFilter('ul,ol', function(nodes) {
+				var i = nodes.length, node, parentNode;
+
+				while (i--) {
+					node = nodes[i];
+					parentNode = node.parent;
+
+					if (parentNode.name === 'ul' || parentNode.name === 'ol') {
+						if (node.prev && node.prev.name === 'li') {
+							node.prev.append(node);
+						}
+					}
+				}
+			});
+		}
+
+		// Remove internal data attributes
+		htmlParser.addAttributeFilter(
+			'data-mce-src,data-mce-href,data-mce-style,' +
+			'data-mce-selected,data-mce-expando,' +
+			'data-mce-type,data-mce-resize',
+
+			function(nodes, name) {
+				var i = nodes.length;
+
+				while (i--) {
+					nodes[i].attr(name, null);
+				}
+			}
+		);
+
+		// Return public methods
+		return {
+			/**
+			 * Schema instance that was used to when the Serializer was constructed.
+			 *
+			 * @field {tinymce.html.Schema} schema
+			 */
+			schema: schema,
+
+			/**
+			 * Adds a node filter function to the parser used by the serializer, the parser will collect the specified nodes by name
+			 * and then execute the callback ones it has finished parsing the document.
+			 *
+			 * @example
+			 * parser.addNodeFilter('p,h1', function(nodes, name) {
+			 *		for (var i = 0; i < nodes.length; i++) {
+			 *			console.log(nodes[i].name);
+			 *		}
+			 * });
+			 * @method addNodeFilter
+			 * @method {String} name Comma separated list of nodes to collect.
+			 * @param {function} callback Callback function to execute once it has collected nodes.
+			 */
+			addNodeFilter: htmlParser.addNodeFilter,
+
+			/**
+			 * Adds a attribute filter function to the parser used by the serializer, the parser will
+			 * collect nodes that has the specified attributes
+			 * and then execute the callback ones it has finished parsing the document.
+			 *
+			 * @example
+			 * parser.addAttributeFilter('src,href', function(nodes, name) {
+			 *		for (var i = 0; i < nodes.length; i++) {
+			 *			console.log(nodes[i].name);
+			 *		}
+			 * });
+			 * @method addAttributeFilter
+			 * @method {String} name Comma separated list of nodes to collect.
+			 * @param {function} callback Callback function to execute once it has collected nodes.
+			 */
+			addAttributeFilter: htmlParser.addAttributeFilter,
+
+			/**
+			 * Serializes the specified browser DOM node into a HTML string.
+			 *
+			 * @method serialize
+			 * @param {DOMNode} node DOM node to serialize.
+			 * @param {Object} args Arguments option that gets passed to event handlers.
+			 */
+			serialize: function(node, args) {
+				var self = this, impl, doc, oldDoc, htmlSerializer, content;
+
+				// Explorer won't clone contents of script and style and the
+				// selected index of select elements are cleared on a clone operation.
+				if (Env.ie && dom.select('script,style,select,map').length > 0) {
+					content = node.innerHTML;
+					node = node.cloneNode(false);
+					dom.setHTML(node, content);
+				} else {
+					node = node.cloneNode(true);
+				}
+
+				// Nodes needs to be attached to something in WebKit/Opera
+				// This fix will make DOM ranges and make Sizzle happy!
+				impl = node.ownerDocument.implementation;
+				if (impl.createHTMLDocument) {
+					// Create an empty HTML document
+					doc = impl.createHTMLDocument("");
+
+					// Add the element or it's children if it's a body element to the new document
+					each(node.nodeName == 'BODY' ? node.childNodes : [node], function(node) {
+						doc.body.appendChild(doc.importNode(node, true));
+					});
+
+					// Grab first child or body element for serialization
+					if (node.nodeName != 'BODY') {
+						node = doc.body.firstChild;
+					} else {
+						node = doc.body;
+					}
+
+					// set the new document in DOMUtils so createElement etc works
+					oldDoc = dom.doc;
+					dom.doc = doc;
+				}
+
+				args = args || {};
+				args.format = args.format || 'html';
+
+				// Don't wrap content if we want selected html
+				if (args.selection) {
+					args.forced_root_block = '';
+				}
+
+				// Pre process
+				if (!args.no_events) {
+					args.node = node;
+					self.onPreProcess(args);
+				}
+
+				// Setup serializer
+				htmlSerializer = new Serializer(settings, schema);
+
+				// Parse and serialize HTML
+				args.content = htmlSerializer.serialize(
+					htmlParser.parse(trim(args.getInner ? node.innerHTML : dom.getOuterHTML(node)), args)
+				);
+
+				// Replace all BOM characters for now until we can find a better solution
+				if (!args.cleanup) {
+					args.content = args.content.replace(/\uFEFF/g, '');
+				}
+
+				// Post process
+				if (!args.no_events) {
+					self.onPostProcess(args);
+				}
+
+				// Restore the old document if it was changed
+				if (oldDoc) {
+					dom.doc = oldDoc;
+				}
+
+				args.node = null;
+
+				return args.content;
+			},
+
+			/**
+			 * Adds valid elements rules to the serializers schema instance this enables you to specify things
+			 * like what elements should be outputted and what attributes specific elements might have.
+			 * Consult the Wiki for more details on this format.
+			 *
+			 * @method addRules
+			 * @param {String} rules Valid elements rules string to add to schema.
+			 */
+			addRules: function(rules) {
+				schema.addValidElements(rules);
+			},
+
+			/**
+			 * Sets the valid elements rules to the serializers schema instance this enables you to specify things
+			 * like what elements should be outputted and what attributes specific elements might have.
+			 * Consult the Wiki for more details on this format.
+			 *
+			 * @method setRules
+			 * @param {String} rules Valid elements rules string.
+			 */
+			setRules: function(rules) {
+				schema.setValidElements(rules);
+			},
+
+			onPreProcess: function(args) {
+				if (editor) {
+					editor.fire('PreProcess', args);
+				}
+			},
+
+			onPostProcess: function(args) {
+				if (editor) {
+					editor.fire('PostProcess', args);
+				}
+			}
+		};
+	};
+});
+
+// Included from: js/tinymce/classes/dom/TridentSelection.js
+
+/**
+ * TridentSelection.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Selection class for old explorer versions. This one fakes the
+ * native selection object available on modern browsers.
+ *
+ * @class tinymce.dom.TridentSelection
+ */
+define("tinymce/dom/TridentSelection", [], function() {
+	function Selection(selection) {
+		var self = this, dom = selection.dom, FALSE = false;
+
+		function getPosition(rng, start) {
+			var checkRng, startIndex = 0, endIndex, inside,
+				children, child, offset, index, position = -1, parent;
+
+			// Setup test range, collapse it and get the parent
+			checkRng = rng.duplicate();
+			checkRng.collapse(start);
+			parent = checkRng.parentElement();
+
+			// Check if the selection is within the right document
+			if (parent.ownerDocument !== selection.dom.doc) {
+				return;
+			}
+
+			// IE will report non editable elements as it's parent so look for an editable one
+			while (parent.contentEditable === "false") {
+				parent = parent.parentNode;
+			}
+
+			// If parent doesn't have any children then return that we are inside the element
+			if (!parent.hasChildNodes()) {
+				return {node: parent, inside: 1};
+			}
+
+			// Setup node list and endIndex
+			children = parent.children;
+			endIndex = children.length - 1;
+
+			// Perform a binary search for the position
+			while (startIndex <= endIndex) {
+				index = Math.floor((startIndex + endIndex) / 2);
+
+				// Move selection to node and compare the ranges
+				child = children[index];
+				checkRng.moveToElementText(child);
+				position = checkRng.compareEndPoints(start ? 'StartToStart' : 'EndToEnd', rng);
+
+				// Before/after or an exact match
+				if (position > 0) {
+					endIndex = index - 1;
+				} else if (position < 0) {
+					startIndex = index + 1;
+				} else {
+					return {node: child};
+				}
+			}
+
+			// Check if child position is before or we didn't find a position
+			if (position < 0) {
+				// No element child was found use the parent element and the offset inside that
+				if (!child) {
+					checkRng.moveToElementText(parent);
+					checkRng.collapse(true);
+					child = parent;
+					inside = true;
+				} else {
+					checkRng.collapse(false);
+				}
+
+				// Walk character by character in text node until we hit the selected range endpoint,
+				// hit the end of document or parent isn't the right one
+				// We need to walk char by char since rng.text or rng.htmlText will trim line endings
+				offset = 0;
+				while (checkRng.compareEndPoints(start ? 'StartToStart' : 'StartToEnd', rng) !== 0) {
+					if (checkRng.move('character', 1) === 0 || parent != checkRng.parentElement()) {
+						break;
+					}
+
+					offset++;
+				}
+			} else {
+				// Child position is after the selection endpoint
+				checkRng.collapse(true);
+
+				// Walk character by character in text node until we hit the selected range endpoint, hit
+				// the end of document or parent isn't the right one
+				offset = 0;
+				while (checkRng.compareEndPoints(start ? 'StartToStart' : 'StartToEnd', rng) !== 0) {
+					if (checkRng.move('character', -1) === 0 || parent != checkRng.parentElement()) {
+						break;
+					}
+
+					offset++;
+				}
+			}
+
+			return {node: child, position: position, offset: offset, inside: inside};
+		}
+
+		// Returns a W3C DOM compatible range object by using the IE Range API
+		function getRange() {
+			var ieRange = selection.getRng(), domRange = dom.createRng(), element, collapsed, tmpRange, element2, bookmark;
+
+			// If selection is outside the current document just return an empty range
+			element = ieRange.item ? ieRange.item(0) : ieRange.parentElement();
+			if (element.ownerDocument != dom.doc) {
+				return domRange;
+			}
+
+			collapsed = selection.isCollapsed();
+
+			// Handle control selection
+			if (ieRange.item) {
+				domRange.setStart(element.parentNode, dom.nodeIndex(element));
+				domRange.setEnd(domRange.startContainer, domRange.startOffset + 1);
+
+				return domRange;
+			}
+
+			function findEndPoint(start) {
+				var endPoint = getPosition(ieRange, start), container, offset, textNodeOffset = 0, sibling, undef, nodeValue;
+
+				container = endPoint.node;
+				offset = endPoint.offset;
+
+				if (endPoint.inside && !container.hasChildNodes()) {
+					domRange[start ? 'setStart' : 'setEnd'](container, 0);
+					return;
+				}
+
+				if (offset === undef) {
+					domRange[start ? 'setStartBefore' : 'setEndAfter'](container);
+					return;
+				}
+
+				if (endPoint.position < 0) {
+					sibling = endPoint.inside ? container.firstChild : container.nextSibling;
+
+					if (!sibling) {
+						domRange[start ? 'setStartAfter' : 'setEndAfter'](container);
+						return;
+					}
+
+					if (!offset) {
+						if (sibling.nodeType == 3) {
+							domRange[start ? 'setStart' : 'setEnd'](sibling, 0);
+						} else {
+							domRange[start ? 'setStartBefore' : 'setEndBefore'](sibling);
+						}
+
+						return;
+					}
+
+					// Find the text node and offset
+					while (sibling) {
+						if (sibling.nodeType == 3) {
+							nodeValue = sibling.nodeValue;
+							textNodeOffset += nodeValue.length;
+
+							// We are at or passed the position we where looking for
+							if (textNodeOffset >= offset) {
+								container = sibling;
+								textNodeOffset -= offset;
+								textNodeOffset = nodeValue.length - textNodeOffset;
+								break;
+							}
+						}
+
+						sibling = sibling.nextSibling;
+					}
+				} else {
+					// Find the text node and offset
+					sibling = container.previousSibling;
+
+					if (!sibling) {
+						return domRange[start ? 'setStartBefore' : 'setEndBefore'](container);
+					}
+
+					// If there isn't any text to loop then use the first position
+					if (!offset) {
+						if (container.nodeType == 3) {
+							domRange[start ? 'setStart' : 'setEnd'](sibling, container.nodeValue.length);
+						} else {
+							domRange[start ? 'setStartAfter' : 'setEndAfter'](sibling);
+						}
+
+						return;
+					}
+
+					while (sibling) {
+						if (sibling.nodeType == 3) {
+							textNodeOffset += sibling.nodeValue.length;
+
+							// We are at or passed the position we where looking for
+							if (textNodeOffset >= offset) {
+								container = sibling;
+								textNodeOffset -= offset;
+								break;
+							}
+						}
+
+						sibling = sibling.previousSibling;
+					}
+				}
+
+				domRange[start ? 'setStart' : 'setEnd'](container, textNodeOffset);
+			}
+
+			try {
+				// Find start point
+				findEndPoint(true);
+
+				// Find end point if needed
+				if (!collapsed) {
+					findEndPoint();
+				}
+			} catch (ex) {
+				// IE has a nasty bug where text nodes might throw "invalid argument" when you
+				// access the nodeValue or other properties of text nodes. This seems to happend when
+				// text nodes are split into two nodes by a delete/backspace call. So lets detect it and try to fix it.
+				if (ex.number == -2147024809) {
+					// Get the current selection
+					bookmark = self.getBookmark(2);
+
+					// Get start element
+					tmpRange = ieRange.duplicate();
+					tmpRange.collapse(true);
+					element = tmpRange.parentElement();
+
+					// Get end element
+					if (!collapsed) {
+						tmpRange = ieRange.duplicate();
+						tmpRange.collapse(false);
+						element2 = tmpRange.parentElement();
+						element2.innerHTML = element2.innerHTML;
+					}
+
+					// Remove the broken elements
+					element.innerHTML = element.innerHTML;
+
+					// Restore the selection
+					self.moveToBookmark(bookmark);
+
+					// Since the range has moved we need to re-get it
+					ieRange = selection.getRng();
+
+					// Find start point
+					findEndPoint(true);
+
+					// Find end point if needed
+					if (!collapsed) {
+						findEndPoint();
+					}
+				} else {
+					throw ex; // Throw other errors
+				}
+			}
+
+			return domRange;
+		}
+
+		this.getBookmark = function(type) {
+			var rng = selection.getRng(), bookmark = {};
+
+			function getIndexes(node) {
+				var parent, root, children, i, indexes = [];
+
+				parent = node.parentNode;
+				root = dom.getRoot().parentNode;
+
+				while (parent != root && parent.nodeType !== 9) {
+					children = parent.children;
+
+					i = children.length;
+					while (i--) {
+						if (node === children[i]) {
+							indexes.push(i);
+							break;
+						}
+					}
+
+					node = parent;
+					parent = parent.parentNode;
+				}
+
+				return indexes;
+			}
+
+			function getBookmarkEndPoint(start) {
+				var position;
+
+				position = getPosition(rng, start);
+				if (position) {
+					return {
+						position: position.position,
+						offset: position.offset,
+						indexes: getIndexes(position.node),
+						inside: position.inside
+					};
+				}
+			}
+
+			// Non ubstructive bookmark
+			if (type === 2) {
+				// Handle text selection
+				if (!rng.item) {
+					bookmark.start = getBookmarkEndPoint(true);
+
+					if (!selection.isCollapsed()) {
+						bookmark.end = getBookmarkEndPoint();
+					}
+				} else {
+					bookmark.start = {ctrl: true, indexes: getIndexes(rng.item(0))};
+				}
+			}
+
+			return bookmark;
+		};
+
+		this.moveToBookmark = function(bookmark) {
+			var rng, body = dom.doc.body;
+
+			function resolveIndexes(indexes) {
+				var node, i, idx, children;
+
+				node = dom.getRoot();
+				for (i = indexes.length - 1; i >= 0; i--) {
+					children = node.children;
+					idx = indexes[i];
+
+					if (idx <= children.length - 1) {
+						node = children[idx];
+					}
+				}
+
+				return node;
+			}
+
+			function setBookmarkEndPoint(start) {
+				var endPoint = bookmark[start ? 'start' : 'end'], moveLeft, moveRng, undef, offset;
+
+				if (endPoint) {
+					moveLeft = endPoint.position > 0;
+
+					moveRng = body.createTextRange();
+					moveRng.moveToElementText(resolveIndexes(endPoint.indexes));
+
+					offset = endPoint.offset;
+					if (offset !== undef) {
+						moveRng.collapse(endPoint.inside || moveLeft);
+						moveRng.moveStart('character', moveLeft ? -offset : offset);
+					} else {
+						moveRng.collapse(start);
+					}
+
+					rng.setEndPoint(start ? 'StartToStart' : 'EndToStart', moveRng);
+
+					if (start) {
+						rng.collapse(true);
+					}
+				}
+			}
+
+			if (bookmark.start) {
+				if (bookmark.start.ctrl) {
+					rng = body.createControlRange();
+					rng.addElement(resolveIndexes(bookmark.start.indexes));
+					rng.select();
+				} else {
+					rng = body.createTextRange();
+					setBookmarkEndPoint(true);
+					setBookmarkEndPoint();
+					rng.select();
+				}
+			}
+		};
+
+		this.addRange = function(rng) {
+			var ieRng, ctrlRng, startContainer, startOffset, endContainer, endOffset, sibling,
+				doc = selection.dom.doc, body = doc.body, nativeRng, ctrlElm;
+
+			function setEndPoint(start) {
+				var container, offset, marker, tmpRng, nodes;
+
+				marker = dom.create('a');
+				container = start ? startContainer : endContainer;
+				offset = start ? startOffset : endOffset;
+				tmpRng = ieRng.duplicate();
+
+				if (container == doc || container == doc.documentElement) {
+					container = body;
+					offset = 0;
+				}
+
+				if (container.nodeType == 3) {
+					container.parentNode.insertBefore(marker, container);
+					tmpRng.moveToElementText(marker);
+					tmpRng.moveStart('character', offset);
+					dom.remove(marker);
+					ieRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', tmpRng);
+				} else {
+					nodes = container.childNodes;
+
+					if (nodes.length) {
+						if (offset >= nodes.length) {
+							dom.insertAfter(marker, nodes[nodes.length - 1]);
+						} else {
+							container.insertBefore(marker, nodes[offset]);
+						}
+
+						tmpRng.moveToElementText(marker);
+					} else if (container.canHaveHTML) {
+						// Empty node selection for example <div>|</div>
+						// Setting innerHTML with a span marker then remove that marker seems to keep empty block elements open
+						container.innerHTML = '<span>&#xFEFF;</span>';
+						marker = container.firstChild;
+						tmpRng.moveToElementText(marker);
+						tmpRng.collapse(FALSE); // Collapse false works better than true for some odd reason
+					}
+
+					ieRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', tmpRng);
+					dom.remove(marker);
+				}
+			}
+
+			// Setup some shorter versions
+			startContainer = rng.startContainer;
+			startOffset = rng.startOffset;
+			endContainer = rng.endContainer;
+			endOffset = rng.endOffset;
+			ieRng = body.createTextRange();
+
+			// If single element selection then try making a control selection out of it
+			if (startContainer == endContainer && startContainer.nodeType == 1) {
+				// Trick to place the caret inside an empty block element like <p></p>
+				if (startOffset == endOffset && !startContainer.hasChildNodes()) {
+					if (startContainer.canHaveHTML) {
+						// Check if previous sibling is an empty block if it is then we need to render it
+						// IE would otherwise move the caret into the sibling instead of the empty startContainer see: #5236
+						// Example this: <p></p><p>|</p> would become this: <p>|</p><p></p>
+						sibling = startContainer.previousSibling;
+						if (sibling && !sibling.hasChildNodes() && dom.isBlock(sibling)) {
+							sibling.innerHTML = '&#xFEFF;';
+						} else {
+							sibling = null;
+						}
+
+						startContainer.innerHTML = '<span>&#xFEFF;</span><span>&#xFEFF;</span>';
+						ieRng.moveToElementText(startContainer.lastChild);
+						ieRng.select();
+						dom.doc.selection.clear();
+						startContainer.innerHTML = '';
+
+						if (sibling) {
+							sibling.innerHTML = '';
+						}
+						return;
+					} else {
+						startOffset = dom.nodeIndex(startContainer);
+						startContainer = startContainer.parentNode;
+					}
+				}
+
+				if (startOffset == endOffset - 1) {
+					try {
+						ctrlElm = startContainer.childNodes[startOffset];
+						ctrlRng = body.createControlRange();
+						ctrlRng.addElement(ctrlElm);
+						ctrlRng.select();
+
+						// Check if the range produced is on the correct element and is a control range
+						// On IE 8 it will select the parent contentEditable container if you select an inner element see: #5398
+						nativeRng = selection.getRng();
+						if (nativeRng.item && ctrlElm === nativeRng.item(0)) {
+							return;
+						}
+					} catch (ex) {
+						// Ignore
+					}
+				}
+			}
+
+			// Set start/end point of selection
+			setEndPoint(true);
+			setEndPoint();
+
+			// Select the new range and scroll it into view
+			ieRng.select();
+		};
+
+		// Expose range method
+		this.getRangeAt = getRange;
+	}
+
+	return Selection;
+});
+
+// Included from: js/tinymce/classes/util/VK.js
+
+/**
+ * VK.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This file exposes a set of the common KeyCodes for use.  Please grow it as needed.
+ */
+define("tinymce/util/VK", [
+	"tinymce/Env"
+], function(Env) {
+	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 || this.metaKeyPressed(e);
+		},
+
+		metaKeyPressed: function(e) {
+			// Check if ctrl or meta key is pressed. Edge case for AltGr on Windows where it produces ctrlKey+altKey states
+			return (Env.mac ? e.metaKey : e.ctrlKey && !e.altKey);
+		}
+	};
+});
+
+// Included from: js/tinymce/classes/dom/ControlSelection.js
+
+/**
+ * ControlSelection.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles control selection of elements. Controls are elements
+ * that can be resized and needs to be selected as a whole. It adds custom resize handles
+ * to all browser engines that support properly disabling the built in resize logic.
+ *
+ * @class tinymce.dom.ControlSelection
+ */
+define("tinymce/dom/ControlSelection", [
+	"tinymce/util/VK",
+	"tinymce/util/Tools",
+	"tinymce/Env"
+], function(VK, Tools, Env) {
+	return function(selection, editor) {
+		var dom = editor.dom, each = Tools.each;
+		var selectedElm, selectedElmGhost, resizeHelper, resizeHandles, selectedHandle, lastMouseDownEvent;
+		var startX, startY, selectedElmX, selectedElmY, startW, startH, ratio, resizeStarted;
+		var width, height, editableDoc = editor.getDoc(), rootDocument = document, isIE = Env.ie && Env.ie < 11;
+		var abs = Math.abs, round = Math.round, rootElement = editor.getBody(), startScrollWidth, startScrollHeight;
+
+		// Details about each resize handle how to scale etc
+		resizeHandles = {
+			// Name: x multiplier, y multiplier, delta size x, delta size y
+			n: [0.5, 0, 0, -1],
+			e: [1, 0.5, 1, 0],
+			s: [0.5, 1, 0, 1],
+			w: [0, 0.5, -1, 0],
+			nw: [0, 0, -1, -1],
+			ne: [1, 0, 1, -1],
+			se: [1, 1, 1, 1],
+			sw: [0, 1, -1, 1]
+		};
+
+		// Add CSS for resize handles, cloned element and selected
+		var rootClass = '.mce-content-body';
+		editor.contentStyles.push(
+			rootClass + ' div.mce-resizehandle {' +
+				'position: absolute;' +
+				'border: 1px solid black;' +
+				'background: #FFF;' +
+				'width: 5px;' +
+				'height: 5px;' +
+				'z-index: 10000' +
+			'}' +
+			rootClass + ' .mce-resizehandle:hover {' +
+				'background: #000' +
+			'}' +
+			rootClass + ' img[data-mce-selected], hr[data-mce-selected] {' +
+				'outline: 1px solid black;' +
+				'resize: none' + // Have been talks about implementing this in browsers
+			'}' +
+			rootClass + ' .mce-clonedresizable {' +
+				'position: absolute;' +
+				(Env.gecko ? '' : 'outline: 1px dashed black;') + // Gecko produces trails while resizing
+				'opacity: .5;' +
+				'filter: alpha(opacity=50);' +
+				'z-index: 10000' +
+			'}' +
+			rootClass + ' .mce-resize-helper {' +
+				'background: #555;' +
+				'background: rgba(0,0,0,0.75);' +
+				'border-radius: 3px;' +
+				'border: 1px;' +
+				'color: white;' +
+				'display: none;' +
+				'font-family: sans-serif;' +
+				'font-size: 12px;' +
+				'white-space: nowrap;' +
+				'line-height: 14px;' +
+				'margin: 5px 10px;' +
+				'padding: 5px;' +
+				'position: absolute;' +
+				'z-index: 10001' +
+			'}'
+		);
+
+		function isResizable(elm) {
+			var selector = editor.settings.object_resizing;
+
+			if (selector === false || Env.iOS) {
+				return false;
+			}
+
+			if (typeof selector != 'string') {
+				selector = 'table,img,div';
+			}
+
+			if (elm.getAttribute('data-mce-resize') === 'false') {
+				return false;
+			}
+
+			return editor.dom.is(elm, selector);
+		}
+
+		function resizeGhostElement(e) {
+			var deltaX, deltaY, proportional;
+			var resizeHelperX, resizeHelperY;
+
+			// Calc new width/height
+			deltaX = e.screenX - startX;
+			deltaY = e.screenY - startY;
+
+			// Calc new size
+			width = deltaX * selectedHandle[2] + startW;
+			height = deltaY * selectedHandle[3] + startH;
+
+			// Never scale down lower than 5 pixels
+			width = width < 5 ? 5 : width;
+			height = height < 5 ? 5 : height;
+
+			if (selectedElm.nodeName == "IMG" && editor.settings.resize_img_proportional !== false) {
+				proportional = !VK.modifierPressed(e);
+			} else {
+				proportional = VK.modifierPressed(e) || (selectedElm.nodeName == "IMG" && selectedHandle[2] * selectedHandle[3] !== 0);
+			}
+
+			// Constrain proportions
+			if (proportional) {
+				if (abs(deltaX) > abs(deltaY)) {
+					height = round(width * ratio);
+					width = round(height / ratio);
+				} else {
+					width = round(height / ratio);
+					height = round(width * ratio);
+				}
+			}
+
+			// Update ghost size
+			dom.setStyles(selectedElmGhost, {
+				width: width,
+				height: height
+			});
+
+			// Update resize helper position
+			resizeHelperX = selectedHandle.startPos.x + deltaX;
+			resizeHelperY = selectedHandle.startPos.y + deltaY;
+			resizeHelperX = resizeHelperX > 0 ? resizeHelperX : 0;
+			resizeHelperY = resizeHelperY > 0 ? resizeHelperY : 0;
+
+			dom.setStyles(resizeHelper, {
+				left: resizeHelperX,
+				top: resizeHelperY,
+				display: 'block'
+			});
+
+			resizeHelper.innerHTML = width + ' &times; ' + height;
+
+			// Update ghost X position if needed
+			if (selectedHandle[2] < 0 && selectedElmGhost.clientWidth <= width) {
+				dom.setStyle(selectedElmGhost, 'left', selectedElmX + (startW - width));
+			}
+
+			// Update ghost Y position if needed
+			if (selectedHandle[3] < 0 && selectedElmGhost.clientHeight <= height) {
+				dom.setStyle(selectedElmGhost, 'top', selectedElmY + (startH - height));
+			}
+
+			// Calculate how must overflow we got
+			deltaX = rootElement.scrollWidth - startScrollWidth;
+			deltaY = rootElement.scrollHeight - startScrollHeight;
+
+			// Re-position the resize helper based on the overflow
+			if (deltaX + deltaY !== 0) {
+				dom.setStyles(resizeHelper, {
+					left: resizeHelperX - deltaX,
+					top: resizeHelperY - deltaY
+				});
+			}
+
+			if (!resizeStarted) {
+				editor.fire('ObjectResizeStart', {target: selectedElm, width: startW, height: startH});
+				resizeStarted = true;
+			}
+		}
+
+		function endGhostResize() {
+			resizeStarted = false;
+
+			function setSizeProp(name, value) {
+				if (value) {
+					// Resize by using style or attribute
+					if (selectedElm.style[name] || !editor.schema.isValid(selectedElm.nodeName.toLowerCase(), name)) {
+						dom.setStyle(selectedElm, name, value);
+					} else {
+						dom.setAttrib(selectedElm, name, value);
+					}
+				}
+			}
+
+			// Set width/height properties
+			setSizeProp('width', width);
+			setSizeProp('height', height);
+
+			dom.unbind(editableDoc, 'mousemove', resizeGhostElement);
+			dom.unbind(editableDoc, 'mouseup', endGhostResize);
+
+			if (rootDocument != editableDoc) {
+				dom.unbind(rootDocument, 'mousemove', resizeGhostElement);
+				dom.unbind(rootDocument, 'mouseup', endGhostResize);
+			}
+
+			// Remove ghost/helper and update resize handle positions
+			dom.remove(selectedElmGhost);
+			dom.remove(resizeHelper);
+
+			if (!isIE || selectedElm.nodeName == "TABLE") {
+				showResizeRect(selectedElm);
+			}
+
+			editor.fire('ObjectResized', {target: selectedElm, width: width, height: height});
+			dom.setAttrib(selectedElm, 'style', dom.getAttrib(selectedElm, 'style'));
+			editor.nodeChanged();
+		}
+
+		function showResizeRect(targetElm, mouseDownHandleName, mouseDownEvent) {
+			var position, targetWidth, targetHeight, e, rect;
+
+			unbindResizeHandleEvents();
+
+			// Get position and size of target
+			position = dom.getPos(targetElm, rootElement);
+			selectedElmX = position.x;
+			selectedElmY = position.y;
+			rect = targetElm.getBoundingClientRect(); // Fix for Gecko offsetHeight for table with caption
+			targetWidth = rect.width || (rect.right - rect.left);
+			targetHeight = rect.height || (rect.bottom - rect.top);
+
+			// Reset width/height if user selects a new image/table
+			if (selectedElm != targetElm) {
+				detachResizeStartListener();
+				selectedElm = targetElm;
+				width = height = 0;
+			}
+
+			// Makes it possible to disable resizing
+			e = editor.fire('ObjectSelected', {target: targetElm});
+
+			if (isResizable(targetElm) && !e.isDefaultPrevented()) {
+				each(resizeHandles, function(handle, name) {
+					var handleElm, handlerContainerElm;
+
+					function startDrag(e) {
+						startX = e.screenX;
+						startY = e.screenY;
+						startW = selectedElm.clientWidth;
+						startH = selectedElm.clientHeight;
+						ratio = startH / startW;
+						selectedHandle = handle;
+
+						handle.startPos = {
+							x: targetWidth * handle[0] + selectedElmX,
+							y: targetHeight * handle[1] + selectedElmY
+						};
+
+						startScrollWidth = rootElement.scrollWidth;
+						startScrollHeight = rootElement.scrollHeight;
+
+						selectedElmGhost = selectedElm.cloneNode(true);
+						dom.addClass(selectedElmGhost, 'mce-clonedresizable');
+						dom.setAttrib(selectedElmGhost, 'data-mce-bogus', 'all');
+						selectedElmGhost.contentEditable = false; // Hides IE move layer cursor
+						selectedElmGhost.unSelectabe = true;
+						dom.setStyles(selectedElmGhost, {
+							left: selectedElmX,
+							top: selectedElmY,
+							margin: 0
+						});
+
+						selectedElmGhost.removeAttribute('data-mce-selected');
+						rootElement.appendChild(selectedElmGhost);
+
+						dom.bind(editableDoc, 'mousemove', resizeGhostElement);
+						dom.bind(editableDoc, 'mouseup', endGhostResize);
+
+						if (rootDocument != editableDoc) {
+							dom.bind(rootDocument, 'mousemove', resizeGhostElement);
+							dom.bind(rootDocument, 'mouseup', endGhostResize);
+						}
+
+						resizeHelper = dom.add(rootElement, 'div', {
+							'class': 'mce-resize-helper',
+							'data-mce-bogus': 'all'
+						}, startW + ' &times; ' + startH);
+					}
+
+					if (mouseDownHandleName) {
+						// Drag started by IE native resizestart
+						if (name == mouseDownHandleName) {
+							startDrag(mouseDownEvent);
+						}
+
+						return;
+					}
+
+					// Get existing or render resize handle
+					handleElm = dom.get('mceResizeHandle' + name);
+					if (!handleElm) {
+						handlerContainerElm = rootElement;
+
+						handleElm = dom.add(handlerContainerElm, 'div', {
+							id: 'mceResizeHandle' + name,
+							'data-mce-bogus': 'all',
+							'class': 'mce-resizehandle',
+							unselectable: true,
+							style: 'cursor:' + name + '-resize; margin:0; padding:0'
+						});
+
+						// Hides IE move layer cursor
+						// If we set it on Chrome we get this wounderful bug: #6725
+						if (Env.ie) {
+							handleElm.contentEditable = false;
+						}
+					} else {
+						dom.show(handleElm);
+					}
+
+					if (!handle.elm) {
+						dom.bind(handleElm, 'mousedown', function(e) {
+							e.stopImmediatePropagation();
+							e.preventDefault();
+							startDrag(e);
+						});
+
+						handle.elm = handleElm;
+					}
+
+					// Position element
+					dom.setStyles(handleElm, {
+						left: (targetWidth * handle[0] + selectedElmX) - (handleElm.offsetWidth / 2),
+						top: (targetHeight * handle[1] + selectedElmY) - (handleElm.offsetHeight / 2)
+					});
+				});
+			} else {
+				hideResizeRect();
+			}
+
+			selectedElm.setAttribute('data-mce-selected', '1');
+		}
+
+		function hideResizeRect() {
+			var name, handleElm;
+
+			unbindResizeHandleEvents();
+
+			if (selectedElm) {
+				selectedElm.removeAttribute('data-mce-selected');
+			}
+
+			for (name in resizeHandles) {
+				handleElm = dom.get('mceResizeHandle' + name);
+				if (handleElm) {
+					dom.unbind(handleElm);
+					dom.remove(handleElm);
+				}
+			}
+		}
+
+		function updateResizeRect(e) {
+			var startElm, controlElm;
+
+			function isChildOrEqual(node, parent) {
+				if (node) {
+					do {
+						if (node === parent) {
+							return true;
+						}
+					} while ((node = node.parentNode));
+				}
+			}
+
+			// Ignore all events while resizing
+			if (resizeStarted) {
+				return;
+			}
+
+			// Remove data-mce-selected from all elements since they might have been copied using Ctrl+c/v
+			each(dom.select('img[data-mce-selected],hr[data-mce-selected]'), function(img) {
+				img.removeAttribute('data-mce-selected');
+			});
+
+			controlElm = e.type == 'mousedown' ? e.target : selection.getNode();
+			controlElm = dom.$(controlElm).closest(isIE ? 'table' : 'table,img,hr')[0];
+
+			if (isChildOrEqual(controlElm, rootElement)) {
+				disableGeckoResize();
+				startElm = selection.getStart(true);
+
+				if (isChildOrEqual(startElm, controlElm) && isChildOrEqual(selection.getEnd(true), controlElm)) {
+					if (!isIE || (controlElm != startElm && startElm.nodeName !== 'IMG')) {
+						showResizeRect(controlElm);
+						return;
+					}
+				}
+			}
+
+			hideResizeRect();
+		}
+
+		function attachEvent(elm, name, func) {
+			if (elm && elm.attachEvent) {
+				elm.attachEvent('on' + name, func);
+			}
+		}
+
+		function detachEvent(elm, name, func) {
+			if (elm && elm.detachEvent) {
+				elm.detachEvent('on' + name, func);
+			}
+		}
+
+		function resizeNativeStart(e) {
+			var target = e.srcElement, pos, name, corner, cornerX, cornerY, relativeX, relativeY;
+
+			pos = target.getBoundingClientRect();
+			relativeX = lastMouseDownEvent.clientX - pos.left;
+			relativeY = lastMouseDownEvent.clientY - pos.top;
+
+			// Figure out what corner we are draging on
+			for (name in resizeHandles) {
+				corner = resizeHandles[name];
+
+				cornerX = target.offsetWidth * corner[0];
+				cornerY = target.offsetHeight * corner[1];
+
+				if (abs(cornerX - relativeX) < 8 && abs(cornerY - relativeY) < 8) {
+					selectedHandle = corner;
+					break;
+				}
+			}
+
+			// Remove native selection and let the magic begin
+			resizeStarted = true;
+			editor.fire('ObjectResizeStart', {
+				target: selectedElm,
+				width: selectedElm.clientWidth,
+				height: selectedElm.clientHeight
+			});
+			editor.getDoc().selection.empty();
+			showResizeRect(target, name, lastMouseDownEvent);
+		}
+
+		function nativeControlSelect(e) {
+			var target = e.srcElement;
+
+			if (target != selectedElm) {
+				editor.fire('ObjectSelected', {target: target});
+				detachResizeStartListener();
+
+				if (target.id.indexOf('mceResizeHandle') === 0) {
+					e.returnValue = false;
+					return;
+				}
+
+				if (target.nodeName == 'IMG' || target.nodeName == 'TABLE') {
+					hideResizeRect();
+					selectedElm = target;
+					attachEvent(target, 'resizestart', resizeNativeStart);
+				}
+			}
+		}
+
+		function detachResizeStartListener() {
+			detachEvent(selectedElm, 'resizestart', resizeNativeStart);
+		}
+
+		function unbindResizeHandleEvents() {
+			for (var name in resizeHandles) {
+				var handle = resizeHandles[name];
+
+				if (handle.elm) {
+					dom.unbind(handle.elm);
+					delete handle.elm;
+				}
+			}
+		}
+
+		function disableGeckoResize() {
+			try {
+				// Disable object resizing on Gecko
+				editor.getDoc().execCommand('enableObjectResizing', false, false);
+			} catch (ex) {
+				// Ignore
+			}
+		}
+
+		function controlSelect(elm) {
+			var ctrlRng;
+
+			if (!isIE) {
+				return;
+			}
+
+			ctrlRng = editableDoc.body.createControlRange();
+
+			try {
+				ctrlRng.addElement(elm);
+				ctrlRng.select();
+				return true;
+			} catch (ex) {
+				// Ignore since the element can't be control selected for example a P tag
+			}
+		}
+
+		editor.on('init', function() {
+			if (isIE) {
+				// Hide the resize rect on resize and reselect the image
+				editor.on('ObjectResized', function(e) {
+					if (e.target.nodeName != 'TABLE') {
+						hideResizeRect();
+						controlSelect(e.target);
+					}
+				});
+
+				attachEvent(rootElement, 'controlselect', nativeControlSelect);
+
+				editor.on('mousedown', function(e) {
+					lastMouseDownEvent = e;
+				});
+			} else {
+				disableGeckoResize();
+
+				if (Env.ie >= 11) {
+					// TODO: Drag/drop doesn't work
+					editor.on('mouseup', function(e) {
+						var nodeName = e.target.nodeName;
+
+						if (!resizeStarted && /^(TABLE|IMG|HR)$/.test(nodeName)) {
+							editor.selection.select(e.target, nodeName == 'TABLE');
+							editor.nodeChanged();
+						}
+					});
+
+					editor.dom.bind(rootElement, 'mscontrolselect', function(e) {
+						if (/^(TABLE|IMG|HR)$/.test(e.target.nodeName)) {
+							e.preventDefault();
+
+							// This moves the selection from being a control selection to a text like selection like in WebKit #6753
+							// TODO: Fix this the day IE works like other browsers without this nasty native ugly control selections.
+							if (e.target.tagName == 'IMG') {
+								window.setTimeout(function() {
+									editor.selection.select(e.target);
+								}, 0);
+							}
+						}
+					});
+				}
+			}
+
+			editor.on('nodechange ResizeEditor', updateResizeRect);
+
+			// Update resize rect while typing in a table
+			editor.on('keydown keyup', function(e) {
+				if (selectedElm && selectedElm.nodeName == "TABLE") {
+					updateResizeRect(e);
+				}
+			});
+
+			editor.on('hide', hideResizeRect);
+
+			// Hide rect on focusout since it would float on top of windows otherwise
+			//editor.on('focusout', hideResizeRect);
+		});
+
+		editor.on('remove', unbindResizeHandleEvents);
+
+		function destroy() {
+			selectedElm = selectedElmGhost = null;
+
+			if (isIE) {
+				detachResizeStartListener();
+				detachEvent(rootElement, 'controlselect', nativeControlSelect);
+			}
+		}
+
+		return {
+			isResizable: isResizable,
+			showResizeRect: showResizeRect,
+			hideResizeRect: hideResizeRect,
+			updateResizeRect: updateResizeRect,
+			controlSelect: controlSelect,
+			destroy: destroy
+		};
+	};
+});
+
+// Included from: js/tinymce/classes/dom/BookmarkManager.js
+
+/**
+ * BookmarkManager.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles selection bookmarks.
+ *
+ * @class tinymce.dom.BookmarkManager
+ */
+define("tinymce/dom/BookmarkManager", [
+	"tinymce/Env",
+	"tinymce/util/Tools"
+], function(Env, Tools) {
+	/**
+	 * Constructs a new BookmarkManager instance for a specific selection instance.
+	 *
+	 * @constructor
+	 * @method BookmarkManager
+	 * @param {tinymce.dom.Selection} selection Selection instance to handle bookmarks for.
+	 */
+	function BookmarkManager(selection) {
+		var dom = selection.dom;
+
+		/**
+		 * Returns a bookmark location for the current selection. This bookmark object
+		 * can then be used to restore the selection after some content modification to the document.
+		 *
+		 * @method getBookmark
+		 * @param {Number} type Optional state if the bookmark should be simple or not. Default is complex.
+		 * @param {Boolean} normalized Optional state that enables you to get a position that it would be after normalization.
+		 * @return {Object} Bookmark object, use moveToBookmark with this object to restore the selection.
+		 * @example
+		 * // Stores a bookmark of the current selection
+		 * var bm = tinymce.activeEditor.selection.getBookmark();
+		 *
+		 * tinymce.activeEditor.setContent(tinymce.activeEditor.getContent() + 'Some new content');
+		 *
+		 * // Restore the selection bookmark
+		 * tinymce.activeEditor.selection.moveToBookmark(bm);
+		 */
+		this.getBookmark = function(type, normalized) {
+			var rng, rng2, id, collapsed, name, element, chr = '&#xFEFF;', styles;
+
+			function findIndex(name, element) {
+				var index = 0;
+
+				Tools.each(dom.select(name), function(node, i) {
+					if (node == element) {
+						index = i;
+					}
+				});
+
+				return index;
+			}
+
+			function normalizeTableCellSelection(rng) {
+				function moveEndPoint(start) {
+					var container, offset, childNodes, prefix = start ? 'start' : 'end';
+
+					container = rng[prefix + 'Container'];
+					offset = rng[prefix + 'Offset'];
+
+					if (container.nodeType == 1 && container.nodeName == "TR") {
+						childNodes = container.childNodes;
+						container = childNodes[Math.min(start ? offset : offset - 1, childNodes.length - 1)];
+						if (container) {
+							offset = start ? 0 : container.childNodes.length;
+							rng['set' + (start ? 'Start' : 'End')](container, offset);
+						}
+					}
+				}
+
+				moveEndPoint(true);
+				moveEndPoint();
+
+				return rng;
+			}
+
+			function getLocation() {
+				var rng = selection.getRng(true), root = dom.getRoot(), bookmark = {};
+
+				function getPoint(rng, start) {
+					var container = rng[start ? 'startContainer' : 'endContainer'],
+						offset = rng[start ? 'startOffset' : 'endOffset'], point = [], node, childNodes, after = 0;
+
+					if (container.nodeType == 3) {
+						if (normalized) {
+							for (node = container.previousSibling; node && node.nodeType == 3; node = node.previousSibling) {
+								offset += node.nodeValue.length;
+							}
+						}
+
+						point.push(offset);
+					} else {
+						childNodes = container.childNodes;
+
+						if (offset >= childNodes.length && childNodes.length) {
+							after = 1;
+							offset = Math.max(0, childNodes.length - 1);
+						}
+
+						point.push(dom.nodeIndex(childNodes[offset], normalized) + after);
+					}
+
+					for (; container && container != root; container = container.parentNode) {
+						point.push(dom.nodeIndex(container, normalized));
+					}
+
+					return point;
+				}
+
+				bookmark.start = getPoint(rng, true);
+
+				if (!selection.isCollapsed()) {
+					bookmark.end = getPoint(rng);
+				}
+
+				return bookmark;
+			}
+
+			if (type == 2) {
+				element = selection.getNode();
+				name = element ? element.nodeName : null;
+
+				if (name == 'IMG') {
+					return {name: name, index: findIndex(name, element)};
+				}
+
+				if (selection.tridentSel) {
+					return selection.tridentSel.getBookmark(type);
+				}
+
+				return getLocation();
+			}
+
+			// Handle simple range
+			if (type) {
+				return {rng: selection.getRng()};
+			}
+
+			rng = selection.getRng();
+			id = dom.uniqueId();
+			collapsed = selection.isCollapsed();
+			styles = 'overflow:hidden;line-height:0px';
+
+			// Explorer method
+			if (rng.duplicate || rng.item) {
+				// Text selection
+				if (!rng.item) {
+					rng2 = rng.duplicate();
+
+					try {
+						// Insert start marker
+						rng.collapse();
+						rng.pasteHTML('<span data-mce-type="bookmark" id="' + id + '_start" style="' + styles + '">' + chr + '</span>');
+
+						// Insert end marker
+						if (!collapsed) {
+							rng2.collapse(false);
+
+							// Detect the empty space after block elements in IE and move the
+							// end back one character <p></p>] becomes <p>]</p>
+							rng.moveToElementText(rng2.parentElement());
+							if (rng.compareEndPoints('StartToEnd', rng2) === 0) {
+								rng2.move('character', -1);
+							}
+
+							rng2.pasteHTML('<span data-mce-type="bookmark" id="' + id + '_end" style="' + styles + '">' + chr + '</span>');
+						}
+					} catch (ex) {
+						// IE might throw unspecified error so lets ignore it
+						return null;
+					}
+				} else {
+					// Control selection
+					element = rng.item(0);
+					name = element.nodeName;
+
+					return {name: name, index: findIndex(name, element)};
+				}
+			} else {
+				element = selection.getNode();
+				name = element.nodeName;
+				if (name == 'IMG') {
+					return {name: name, index: findIndex(name, element)};
+				}
+
+				// W3C method
+				rng2 = normalizeTableCellSelection(rng.cloneRange());
+
+				// Insert end marker
+				if (!collapsed) {
+					rng2.collapse(false);
+					rng2.insertNode(dom.create('span', {'data-mce-type': "bookmark", id: id + '_end', style: styles}, chr));
+				}
+
+				rng = normalizeTableCellSelection(rng);
+				rng.collapse(true);
+				rng.insertNode(dom.create('span', {'data-mce-type': "bookmark", id: id + '_start', style: styles}, chr));
+			}
+
+			selection.moveToBookmark({id: id, keep: 1});
+
+			return {id: id};
+		};
+
+		/**
+		 * Restores the selection to the specified bookmark.
+		 *
+		 * @method moveToBookmark
+		 * @param {Object} bookmark Bookmark to restore selection from.
+		 * @return {Boolean} true/false if it was successful or not.
+		 * @example
+		 * // Stores a bookmark of the current selection
+		 * var bm = tinymce.activeEditor.selection.getBookmark();
+		 *
+		 * tinymce.activeEditor.setContent(tinymce.activeEditor.getContent() + 'Some new content');
+		 *
+		 * // Restore the selection bookmark
+		 * tinymce.activeEditor.selection.moveToBookmark(bm);
+		 */
+		this.moveToBookmark = function(bookmark) {
+			var rng, root, startContainer, endContainer, startOffset, endOffset;
+
+			function setEndPoint(start) {
+				var point = bookmark[start ? 'start' : 'end'], i, node, offset, children;
+
+				if (point) {
+					offset = point[0];
+
+					// Find container node
+					for (node = root, i = point.length - 1; i >= 1; i--) {
+						children = node.childNodes;
+
+						if (point[i] > children.length - 1) {
+							return;
+						}
+
+						node = children[point[i]];
+					}
+
+					// Move text offset to best suitable location
+					if (node.nodeType === 3) {
+						offset = Math.min(point[0], node.nodeValue.length);
+					}
+
+					// Move element offset to best suitable location
+					if (node.nodeType === 1) {
+						offset = Math.min(point[0], node.childNodes.length);
+					}
+
+					// Set offset within container node
+					if (start) {
+						rng.setStart(node, offset);
+					} else {
+						rng.setEnd(node, offset);
+					}
+				}
+
+				return true;
+			}
+
+			function restoreEndPoint(suffix) {
+				var marker = dom.get(bookmark.id + '_' + suffix), node, idx, next, prev, keep = bookmark.keep;
+
+				if (marker) {
+					node = marker.parentNode;
+
+					if (suffix == 'start') {
+						if (!keep) {
+							idx = dom.nodeIndex(marker);
+						} else {
+							node = marker.firstChild;
+							idx = 1;
+						}
+
+						startContainer = endContainer = node;
+						startOffset = endOffset = idx;
+					} else {
+						if (!keep) {
+							idx = dom.nodeIndex(marker);
+						} else {
+							node = marker.firstChild;
+							idx = 1;
+						}
+
+						endContainer = node;
+						endOffset = idx;
+					}
+
+					if (!keep) {
+						prev = marker.previousSibling;
+						next = marker.nextSibling;
+
+						// Remove all marker text nodes
+						Tools.each(Tools.grep(marker.childNodes), function(node) {
+							if (node.nodeType == 3) {
+								node.nodeValue = node.nodeValue.replace(/\uFEFF/g, '');
+							}
+						});
+
+						// Remove marker but keep children if for example contents where inserted into the marker
+						// Also remove duplicated instances of the marker for example by a
+						// split operation or by WebKit auto split on paste feature
+						while ((marker = dom.get(bookmark.id + '_' + suffix))) {
+							dom.remove(marker, 1);
+						}
+
+						// If siblings are text nodes then merge them unless it's Opera since it some how removes the node
+						// and we are sniffing since adding a lot of detection code for a browser with 3% of the market
+						// isn't worth the effort. Sorry, Opera but it's just a fact
+						if (prev && next && prev.nodeType == next.nodeType && prev.nodeType == 3 && !Env.opera) {
+							idx = prev.nodeValue.length;
+							prev.appendData(next.nodeValue);
+							dom.remove(next);
+
+							if (suffix == 'start') {
+								startContainer = endContainer = prev;
+								startOffset = endOffset = idx;
+							} else {
+								endContainer = prev;
+								endOffset = idx;
+							}
+						}
+					}
+				}
+			}
+
+			function addBogus(node) {
+				// Adds a bogus BR element for empty block elements
+				if (dom.isBlock(node) && !node.innerHTML && !Env.ie) {
+					node.innerHTML = '<br data-mce-bogus="1" />';
+				}
+
+				return node;
+			}
+
+			if (bookmark) {
+				if (bookmark.start) {
+					rng = dom.createRng();
+					root = dom.getRoot();
+
+					if (selection.tridentSel) {
+						return selection.tridentSel.moveToBookmark(bookmark);
+					}
+
+					if (setEndPoint(true) && setEndPoint()) {
+						selection.setRng(rng);
+					}
+				} else if (bookmark.id) {
+					// Restore start/end points
+					restoreEndPoint('start');
+					restoreEndPoint('end');
+
+					if (startContainer) {
+						rng = dom.createRng();
+						rng.setStart(addBogus(startContainer), startOffset);
+						rng.setEnd(addBogus(endContainer), endOffset);
+						selection.setRng(rng);
+					}
+				} else if (bookmark.name) {
+					selection.select(dom.select(bookmark.name)[bookmark.index]);
+				} else if (bookmark.rng) {
+					selection.setRng(bookmark.rng);
+				}
+			}
+		};
+	}
+
+	/**
+	 * Returns true/false if the specified node is a bookmark node or not.
+	 *
+	 * @static
+	 * @method isBookmarkNode
+	 * @param {DOMNode} node DOM Node to check if it's a bookmark node or not.
+	 * @return {Boolean} true/false if the node is a bookmark node or not.
+	 */
+	BookmarkManager.isBookmarkNode = function(node) {
+		return node && node.tagName === 'SPAN' && node.getAttribute('data-mce-type') === 'bookmark';
+	};
+
+	return BookmarkManager;
+});
+
+// Included from: js/tinymce/classes/dom/Selection.js
+
+/**
+ * Selection.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles text and control selection it's an crossbrowser utility class.
+ * Consult the TinyMCE Wiki API for more details and examples on how to use this class.
+ *
+ * @class tinymce.dom.Selection
+ * @example
+ * // Getting the currently selected node for the active editor
+ * alert(tinymce.activeEditor.selection.getNode().nodeName);
+ */
+define("tinymce/dom/Selection", [
+	"tinymce/dom/TreeWalker",
+	"tinymce/dom/TridentSelection",
+	"tinymce/dom/ControlSelection",
+	"tinymce/dom/RangeUtils",
+	"tinymce/dom/BookmarkManager",
+	"tinymce/Env",
+	"tinymce/util/Tools"
+], function(TreeWalker, TridentSelection, ControlSelection, RangeUtils, BookmarkManager, Env, Tools) {
+	var each = Tools.each, trim = Tools.trim;
+	var isIE = Env.ie;
+
+	/**
+	 * Constructs a new selection instance.
+	 *
+	 * @constructor
+	 * @method Selection
+	 * @param {tinymce.dom.DOMUtils} dom DOMUtils object reference.
+	 * @param {Window} win Window to bind the selection object to.
+	 * @param {tinymce.dom.Serializer} serializer DOM serialization class to use for getContent.
+	 */
+	function Selection(dom, win, serializer, editor) {
+		var self = this;
+
+		self.dom = dom;
+		self.win = win;
+		self.serializer = serializer;
+		self.editor = editor;
+		self.bookmarkManager = new BookmarkManager(self);
+		self.controlSelection = new ControlSelection(self, editor);
+
+		// No W3C Range support
+		if (!self.win.getSelection) {
+			self.tridentSel = new TridentSelection(self);
+		}
+	}
+
+	Selection.prototype = {
+		/**
+		 * Move the selection cursor range to the specified node and offset.
+		 * If there is no node specified it will move it to the first suitable location within the body.
+		 *
+		 * @method setCursorLocation
+		 * @param {Node} node Optional node to put the cursor in.
+		 * @param {Number} offset Optional offset from the start of the node to put the cursor at.
+		 */
+		setCursorLocation: function(node, offset) {
+			var self = this, rng = self.dom.createRng();
+
+			if (!node) {
+				self._moveEndPoint(rng, self.editor.getBody(), true);
+				self.setRng(rng);
+			} else {
+				rng.setStart(node, offset);
+				rng.setEnd(node, offset);
+				self.setRng(rng);
+				self.collapse(false);
+			}
+		},
+
+		/**
+		 * Returns the selected contents using the DOM serializer passed in to this class.
+		 *
+		 * @method getContent
+		 * @param {Object} s Optional settings class with for example output format text or html.
+		 * @return {String} Selected contents in for example HTML format.
+		 * @example
+		 * // Alerts the currently selected contents
+		 * alert(tinymce.activeEditor.selection.getContent());
+		 *
+		 * // Alerts the currently selected contents as plain text
+		 * alert(tinymce.activeEditor.selection.getContent({format: 'text'}));
+		 */
+		getContent: function(args) {
+			var self = this, rng = self.getRng(), tmpElm = self.dom.create("body");
+			var se = self.getSel(), whiteSpaceBefore, whiteSpaceAfter, fragment;
+
+			args = args || {};
+			whiteSpaceBefore = whiteSpaceAfter = '';
+			args.get = true;
+			args.format = args.format || 'html';
+			args.selection = true;
+			self.editor.fire('BeforeGetContent', args);
+
+			if (args.format == 'text') {
+				return self.isCollapsed() ? '' : (rng.text || (se.toString ? se.toString() : ''));
+			}
+
+			if (rng.cloneContents) {
+				fragment = rng.cloneContents();
+
+				if (fragment) {
+					tmpElm.appendChild(fragment);
+				}
+			} else if (rng.item !== undefined || rng.htmlText !== undefined) {
+				// IE will produce invalid markup if elements are present that
+				// it doesn't understand like custom elements or HTML5 elements.
+				// Adding a BR in front of the contents and then remoiving it seems to fix it though.
+				tmpElm.innerHTML = '<br>' + (rng.item ? rng.item(0).outerHTML : rng.htmlText);
+				tmpElm.removeChild(tmpElm.firstChild);
+			} else {
+				tmpElm.innerHTML = rng.toString();
+			}
+
+			// Keep whitespace before and after
+			if (/^\s/.test(tmpElm.innerHTML)) {
+				whiteSpaceBefore = ' ';
+			}
+
+			if (/\s+$/.test(tmpElm.innerHTML)) {
+				whiteSpaceAfter = ' ';
+			}
+
+			args.getInner = true;
+
+			args.content = self.isCollapsed() ? '' : whiteSpaceBefore + self.serializer.serialize(tmpElm, args) + whiteSpaceAfter;
+			self.editor.fire('GetContent', args);
+
+			return args.content;
+		},
+
+		/**
+		 * Sets the current selection to the specified content. If any contents is selected it will be replaced
+		 * with the contents passed in to this function. If there is no selection the contents will be inserted
+		 * where the caret is placed in the editor/page.
+		 *
+		 * @method setContent
+		 * @param {String} content HTML contents to set could also be other formats depending on settings.
+		 * @param {Object} args Optional settings object with for example data format.
+		 * @example
+		 * // Inserts some HTML contents at the current selection
+		 * tinymce.activeEditor.selection.setContent('<strong>Some contents</strong>');
+		 */
+		setContent: function(content, args) {
+			var self = this, rng = self.getRng(), caretNode, doc = self.win.document, frag, temp;
+
+			args = args || {format: 'html'};
+			args.set = true;
+			args.selection = true;
+			content = args.content = content;
+
+			// Dispatch before set content event
+			if (!args.no_events) {
+				self.editor.fire('BeforeSetContent', args);
+			}
+
+			content = args.content;
+
+			if (rng.insertNode) {
+				// Make caret marker since insertNode places the caret in the beginning of text after insert
+				content += '<span id="__caret">_</span>';
+
+				// Delete and insert new node
+				if (rng.startContainer == doc && rng.endContainer == doc) {
+					// WebKit will fail if the body is empty since the range is then invalid and it can't insert contents
+					doc.body.innerHTML = content;
+				} else {
+					rng.deleteContents();
+
+					if (doc.body.childNodes.length === 0) {
+						doc.body.innerHTML = content;
+					} else {
+						// createContextualFragment doesn't exists in IE 9 DOMRanges
+						if (rng.createContextualFragment) {
+							rng.insertNode(rng.createContextualFragment(content));
+						} else {
+							// Fake createContextualFragment call in IE 9
+							frag = doc.createDocumentFragment();
+							temp = doc.createElement('div');
+
+							frag.appendChild(temp);
+							temp.outerHTML = content;
+
+							rng.insertNode(frag);
+						}
+					}
+				}
+
+				// Move to caret marker
+				caretNode = self.dom.get('__caret');
+
+				// Make sure we wrap it compleatly, Opera fails with a simple select call
+				rng = doc.createRange();
+				rng.setStartBefore(caretNode);
+				rng.setEndBefore(caretNode);
+				self.setRng(rng);
+
+				// Remove the caret position
+				self.dom.remove('__caret');
+
+				try {
+					self.setRng(rng);
+				} catch (ex) {
+					// Might fail on Opera for some odd reason
+				}
+			} else {
+				if (rng.item) {
+					// Delete content and get caret text selection
+					doc.execCommand('Delete', false, null);
+					rng = self.getRng();
+				}
+
+				// Explorer removes spaces from the beginning of pasted contents
+				if (/^\s+/.test(content)) {
+					rng.pasteHTML('<span id="__mce_tmp">_</span>' + content);
+					self.dom.remove('__mce_tmp');
+				} else {
+					rng.pasteHTML(content);
+				}
+			}
+
+			// Dispatch set content event
+			if (!args.no_events) {
+				self.editor.fire('SetContent', args);
+			}
+		},
+
+		/**
+		 * Returns the start element of a selection range. If the start is in a text
+		 * node the parent element will be returned.
+		 *
+		 * @method getStart
+		 * @param {Boolean} real Optional state to get the real parent when the selection is collapsed not the closest element.
+		 * @return {Element} Start element of selection range.
+		 */
+		getStart: function(real) {
+			var self = this, rng = self.getRng(), startElement, parentElement, checkRng, node;
+
+			if (rng.duplicate || rng.item) {
+				// Control selection, return first item
+				if (rng.item) {
+					return rng.item(0);
+				}
+
+				// Get start element
+				checkRng = rng.duplicate();
+				checkRng.collapse(1);
+				startElement = checkRng.parentElement();
+				if (startElement.ownerDocument !== self.dom.doc) {
+					startElement = self.dom.getRoot();
+				}
+
+				// Check if range parent is inside the start element, then return the inner parent element
+				// This will fix issues when a single element is selected, IE would otherwise return the wrong start element
+				parentElement = node = rng.parentElement();
+				while ((node = node.parentNode)) {
+					if (node == startElement) {
+						startElement = parentElement;
+						break;
+					}
+				}
+
+				return startElement;
+			} else {
+				startElement = rng.startContainer;
+
+				if (startElement.nodeType == 1 && startElement.hasChildNodes()) {
+					if (!real || !rng.collapsed) {
+						startElement = startElement.childNodes[Math.min(startElement.childNodes.length - 1, rng.startOffset)];
+					}
+				}
+
+				if (startElement && startElement.nodeType == 3) {
+					return startElement.parentNode;
+				}
+
+				return startElement;
+			}
+		},
+
+		/**
+		 * Returns the end element of a selection range. If the end is in a text
+		 * node the parent element will be returned.
+		 *
+		 * @method getEnd
+		 * @param {Boolean} real Optional state to get the real parent when the selection is collapsed not the closest element.
+		 * @return {Element} End element of selection range.
+		 */
+		getEnd: function(real) {
+			var self = this, rng = self.getRng(), endElement, endOffset;
+
+			if (rng.duplicate || rng.item) {
+				if (rng.item) {
+					return rng.item(0);
+				}
+
+				rng = rng.duplicate();
+				rng.collapse(0);
+				endElement = rng.parentElement();
+				if (endElement.ownerDocument !== self.dom.doc) {
+					endElement = self.dom.getRoot();
+				}
+
+				if (endElement && endElement.nodeName == 'BODY') {
+					return endElement.lastChild || endElement;
+				}
+
+				return endElement;
+			} else {
+				endElement = rng.endContainer;
+				endOffset = rng.endOffset;
+
+				if (endElement.nodeType == 1 && endElement.hasChildNodes()) {
+					if (!real || !rng.collapsed) {
+						endElement = endElement.childNodes[endOffset > 0 ? endOffset - 1 : endOffset];
+					}
+				}
+
+				if (endElement && endElement.nodeType == 3) {
+					return endElement.parentNode;
+				}
+
+				return endElement;
+			}
+		},
+
+		/**
+		 * Returns a bookmark location for the current selection. This bookmark object
+		 * can then be used to restore the selection after some content modification to the document.
+		 *
+		 * @method getBookmark
+		 * @param {Number} type Optional state if the bookmark should be simple or not. Default is complex.
+		 * @param {Boolean} normalized Optional state that enables you to get a position that it would be after normalization.
+		 * @return {Object} Bookmark object, use moveToBookmark with this object to restore the selection.
+		 * @example
+		 * // Stores a bookmark of the current selection
+		 * var bm = tinymce.activeEditor.selection.getBookmark();
+		 *
+		 * tinymce.activeEditor.setContent(tinymce.activeEditor.getContent() + 'Some new content');
+		 *
+		 * // Restore the selection bookmark
+		 * tinymce.activeEditor.selection.moveToBookmark(bm);
+		 */
+		getBookmark: function(type, normalized) {
+			return this.bookmarkManager.getBookmark(type, normalized);
+		},
+
+		/**
+		 * Restores the selection to the specified bookmark.
+		 *
+		 * @method moveToBookmark
+		 * @param {Object} bookmark Bookmark to restore selection from.
+		 * @return {Boolean} true/false if it was successful or not.
+		 * @example
+		 * // Stores a bookmark of the current selection
+		 * var bm = tinymce.activeEditor.selection.getBookmark();
+		 *
+		 * tinymce.activeEditor.setContent(tinymce.activeEditor.getContent() + 'Some new content');
+		 *
+		 * // Restore the selection bookmark
+		 * tinymce.activeEditor.selection.moveToBookmark(bm);
+		 */
+		moveToBookmark: function(bookmark) {
+			return this.bookmarkManager.moveToBookmark(bookmark);
+		},
+
+		/**
+		 * Selects the specified element. This will place the start and end of the selection range around the element.
+		 *
+		 * @method select
+		 * @param {Element} node HMTL DOM element to select.
+		 * @param {Boolean} content Optional bool state if the contents should be selected or not on non IE browser.
+		 * @return {Element} Selected element the same element as the one that got passed in.
+		 * @example
+		 * // Select the first paragraph in the active editor
+		 * tinymce.activeEditor.selection.select(tinymce.activeEditor.dom.select('p')[0]);
+		 */
+		select: function(node, content) {
+			var self = this, dom = self.dom, rng = dom.createRng(), idx;
+
+			// Clear stored range set by FocusManager
+			self.lastFocusBookmark = null;
+
+			if (node) {
+				if (!content && self.controlSelection.controlSelect(node)) {
+					return;
+				}
+
+				idx = dom.nodeIndex(node);
+				rng.setStart(node.parentNode, idx);
+				rng.setEnd(node.parentNode, idx + 1);
+
+				// Find first/last text node or BR element
+				if (content) {
+					self._moveEndPoint(rng, node, true);
+					self._moveEndPoint(rng, node);
+				}
+
+				self.setRng(rng);
+			}
+
+			return node;
+		},
+
+		/**
+		 * Returns true/false if the selection range is collapsed or not. Collapsed means if it's a caret or a larger selection.
+		 *
+		 * @method isCollapsed
+		 * @return {Boolean} true/false state if the selection range is collapsed or not.
+		 * Collapsed means if it's a caret or a larger selection.
+		 */
+		isCollapsed: function() {
+			var self = this, rng = self.getRng(), sel = self.getSel();
+
+			if (!rng || rng.item) {
+				return false;
+			}
+
+			if (rng.compareEndPoints) {
+				return rng.compareEndPoints('StartToEnd', rng) === 0;
+			}
+
+			return !sel || rng.collapsed;
+		},
+
+		/**
+		 * Collapse the selection to start or end of range.
+		 *
+		 * @method collapse
+		 * @param {Boolean} toStart Optional boolean state if to collapse to end or not. Defaults to start.
+		 */
+		collapse: function(toStart) {
+			var self = this, rng = self.getRng(), node;
+
+			// Control range on IE
+			if (rng.item) {
+				node = rng.item(0);
+				rng = self.win.document.body.createTextRange();
+				rng.moveToElementText(node);
+			}
+
+			rng.collapse(!!toStart);
+			self.setRng(rng);
+		},
+
+		/**
+		 * Returns the browsers internal selection object.
+		 *
+		 * @method getSel
+		 * @return {Selection} Internal browser selection object.
+		 */
+		getSel: function() {
+			var win = this.win;
+
+			return win.getSelection ? win.getSelection() : win.document.selection;
+		},
+
+		/**
+		 * Returns the browsers internal range object.
+		 *
+		 * @method getRng
+		 * @param {Boolean} w3c Forces a compatible W3C range on IE.
+		 * @return {Range} Internal browser range object.
+		 * @see http://www.quirksmode.org/dom/range_intro.html
+		 * @see http://www.dotvoid.com/2001/03/using-the-range-object-in-mozilla/
+		 */
+		getRng: function(w3c) {
+			var self = this, selection, rng, elm, doc = self.win.document, ieRng;
+
+			function tryCompareBoundaryPoints(how, sourceRange, destinationRange) {
+				try {
+					return sourceRange.compareBoundaryPoints(how, destinationRange);
+				} catch (ex) {
+					// Gecko throws wrong document exception if the range points
+					// to nodes that where removed from the dom #6690
+					// Browsers should mutate existing DOMRange instances so that they always point
+					// to something in the document this is not the case in Gecko works fine in IE/WebKit/Blink
+					// For performance reasons just return -1
+					return -1;
+				}
+			}
+
+			// Use last rng passed from FocusManager if it's available this enables
+			// calls to editor.selection.getStart() to work when caret focus is lost on IE
+			if (!w3c && self.lastFocusBookmark) {
+				var bookmark = self.lastFocusBookmark;
+
+				// Convert bookmark to range IE 11 fix
+				if (bookmark.startContainer) {
+					rng = doc.createRange();
+					rng.setStart(bookmark.startContainer, bookmark.startOffset);
+					rng.setEnd(bookmark.endContainer, bookmark.endOffset);
+				} else {
+					rng = bookmark;
+				}
+
+				return rng;
+			}
+
+			// Found tridentSel object then we need to use that one
+			if (w3c && self.tridentSel) {
+				return self.tridentSel.getRangeAt(0);
+			}
+
+			try {
+				if ((selection = self.getSel())) {
+					if (selection.rangeCount > 0) {
+						rng = selection.getRangeAt(0);
+					} else {
+						rng = selection.createRange ? selection.createRange() : doc.createRange();
+					}
+				}
+			} catch (ex) {
+				// IE throws unspecified error here if TinyMCE is placed in a frame/iframe
+			}
+
+			// We have W3C ranges and it's IE then fake control selection since IE9 doesn't handle that correctly yet
+			// IE 11 doesn't support the selection object so we check for that as well
+			if (isIE && rng && rng.setStart && doc.selection) {
+				try {
+					// IE will sometimes throw an exception here
+					ieRng = doc.selection.createRange();
+				} catch (ex) {
+
+				}
+
+				if (ieRng && ieRng.item) {
+					elm = ieRng.item(0);
+					rng = doc.createRange();
+					rng.setStartBefore(elm);
+					rng.setEndAfter(elm);
+				}
+			}
+
+			// No range found then create an empty one
+			// This can occur when the editor is placed in a hidden container element on Gecko
+			// Or on IE when there was an exception
+			if (!rng) {
+				rng = doc.createRange ? doc.createRange() : doc.body.createTextRange();
+			}
+
+			// If range is at start of document then move it to start of body
+			if (rng.setStart && rng.startContainer.nodeType === 9 && rng.collapsed) {
+				elm = self.dom.getRoot();
+				rng.setStart(elm, 0);
+				rng.setEnd(elm, 0);
+			}
+
+			if (self.selectedRange && self.explicitRange) {
+				if (tryCompareBoundaryPoints(rng.START_TO_START, rng, self.selectedRange) === 0 &&
+					tryCompareBoundaryPoints(rng.END_TO_END, rng, self.selectedRange) === 0) {
+					// Safari, Opera and Chrome only ever select text which causes the range to change.
+					// This lets us use the originally set range if the selection hasn't been changed by the user.
+					rng = self.explicitRange;
+				} else {
+					self.selectedRange = null;
+					self.explicitRange = null;
+				}
+			}
+
+			return rng;
+		},
+
+		/**
+		 * Changes the selection to the specified DOM range.
+		 *
+		 * @method setRng
+		 * @param {Range} rng Range to select.
+		 */
+		setRng: function(rng, forward) {
+			var self = this, sel;
+
+			if (!rng) {
+				return;
+			}
+
+			// Is IE specific range
+			if (rng.select) {
+				try {
+					rng.select();
+				} catch (ex) {
+					// Needed for some odd IE bug #1843306
+				}
+
+				return;
+			}
+
+			if (!self.tridentSel) {
+				sel = self.getSel();
+
+				if (sel) {
+					self.explicitRange = rng;
+
+					try {
+						sel.removeAllRanges();
+						sel.addRange(rng);
+					} catch (ex) {
+						// IE might throw errors here if the editor is within a hidden container and selection is changed
+					}
+
+					// Forward is set to false and we have an extend function
+					if (forward === false && sel.extend) {
+						sel.collapse(rng.endContainer, rng.endOffset);
+						sel.extend(rng.startContainer, rng.startOffset);
+					}
+
+					// adding range isn't always successful so we need to check range count otherwise an exception can occur
+					self.selectedRange = sel.rangeCount > 0 ? sel.getRangeAt(0) : null;
+				}
+			} else {
+				// Is W3C Range fake range on IE
+				if (rng.cloneRange) {
+					try {
+						self.tridentSel.addRange(rng);
+						return;
+					} catch (ex) {
+						//IE9 throws an error here if called before selection is placed in the editor
+					}
+				}
+			}
+		},
+
+		/**
+		 * Sets the current selection to the specified DOM element.
+		 *
+		 * @method setNode
+		 * @param {Element} elm Element to set as the contents of the selection.
+		 * @return {Element} Returns the element that got passed in.
+		 * @example
+		 * // Inserts a DOM node at current selection/caret location
+		 * tinymce.activeEditor.selection.setNode(tinymce.activeEditor.dom.create('img', {src: 'some.gif', title: 'some title'}));
+		 */
+		setNode: function(elm) {
+			var self = this;
+
+			self.setContent(self.dom.getOuterHTML(elm));
+
+			return elm;
+		},
+
+		/**
+		 * Returns the currently selected element or the common ancestor element for both start and end of the selection.
+		 *
+		 * @method getNode
+		 * @return {Element} Currently selected element or common ancestor element.
+		 * @example
+		 * // Alerts the currently selected elements node name
+		 * alert(tinymce.activeEditor.selection.getNode().nodeName);
+		 */
+		getNode: function() {
+			var self = this, rng = self.getRng(), elm;
+			var startContainer = rng.startContainer, endContainer = rng.endContainer;
+			var startOffset = rng.startOffset, endOffset = rng.endOffset, root = self.dom.getRoot();
+
+			function skipEmptyTextNodes(node, forwards) {
+				var orig = node;
+
+				while (node && node.nodeType === 3 && node.length === 0) {
+					node = forwards ? node.nextSibling : node.previousSibling;
+				}
+
+				return node || orig;
+			}
+
+			// Range maybe lost after the editor is made visible again
+			if (!rng) {
+				return root;
+			}
+
+			if (rng.setStart) {
+				elm = rng.commonAncestorContainer;
+
+				// Handle selection a image or other control like element such as anchors
+				if (!rng.collapsed) {
+					if (startContainer == endContainer) {
+						if (endOffset - startOffset < 2) {
+							if (startContainer.hasChildNodes()) {
+								elm = startContainer.childNodes[startOffset];
+							}
+						}
+					}
+
+					// If the anchor node is a element instead of a text node then return this element
+					//if (tinymce.isWebKit && sel.anchorNode && sel.anchorNode.nodeType == 1)
+					//	return sel.anchorNode.childNodes[sel.anchorOffset];
+
+					// Handle cases where the selection is immediately wrapped around a node and return that node instead of it's parent.
+					// This happens when you double click an underlined word in FireFox.
+					if (startContainer.nodeType === 3 && endContainer.nodeType === 3) {
+						if (startContainer.length === startOffset) {
+							startContainer = skipEmptyTextNodes(startContainer.nextSibling, true);
+						} else {
+							startContainer = startContainer.parentNode;
+						}
+
+						if (endOffset === 0) {
+							endContainer = skipEmptyTextNodes(endContainer.previousSibling, false);
+						} else {
+							endContainer = endContainer.parentNode;
+						}
+
+						if (startContainer && startContainer === endContainer) {
+							return startContainer;
+						}
+					}
+				}
+
+				if (elm && elm.nodeType == 3) {
+					return elm.parentNode;
+				}
+
+				return elm;
+			}
+
+			elm = rng.item ? rng.item(0) : rng.parentElement();
+
+			// IE 7 might return elements outside the iframe
+			if (elm.ownerDocument !== self.win.document) {
+				elm = root;
+			}
+
+			return elm;
+		},
+
+		getSelectedBlocks: function(startElm, endElm) {
+			var self = this, dom = self.dom, node, root, selectedBlocks = [];
+
+			root = dom.getRoot();
+			startElm = dom.getParent(startElm || self.getStart(), dom.isBlock);
+			endElm = dom.getParent(endElm || self.getEnd(), dom.isBlock);
+
+			if (startElm && startElm != root) {
+				selectedBlocks.push(startElm);
+			}
+
+			if (startElm && endElm && startElm != endElm) {
+				node = startElm;
+
+				var walker = new TreeWalker(startElm, root);
+				while ((node = walker.next()) && node != endElm) {
+					if (dom.isBlock(node)) {
+						selectedBlocks.push(node);
+					}
+				}
+			}
+
+			if (endElm && startElm != endElm && endElm != root) {
+				selectedBlocks.push(endElm);
+			}
+
+			return selectedBlocks;
+		},
+
+		isForward: function() {
+			var dom = this.dom, sel = this.getSel(), anchorRange, focusRange;
+
+			// No support for selection direction then always return true
+			if (!sel || !sel.anchorNode || !sel.focusNode) {
+				return true;
+			}
+
+			anchorRange = dom.createRng();
+			anchorRange.setStart(sel.anchorNode, sel.anchorOffset);
+			anchorRange.collapse(true);
+
+			focusRange = dom.createRng();
+			focusRange.setStart(sel.focusNode, sel.focusOffset);
+			focusRange.collapse(true);
+
+			return anchorRange.compareBoundaryPoints(anchorRange.START_TO_START, focusRange) <= 0;
+		},
+
+		normalize: function() {
+			var self = this, rng = self.getRng();
+
+			if (Env.range && new RangeUtils(self.dom).normalize(rng)) {
+				self.setRng(rng, self.isForward());
+			}
+
+			return rng;
+		},
+
+		/**
+		 * Executes callback when the current selection starts/stops matching the specified selector. The current
+		 * state will be passed to the callback as it's first argument.
+		 *
+		 * @method selectorChanged
+		 * @param {String} selector CSS selector to check for.
+		 * @param {function} callback Callback with state and args when the selector is matches or not.
+		 */
+		selectorChanged: function(selector, callback) {
+			var self = this, currentSelectors;
+
+			if (!self.selectorChangedData) {
+				self.selectorChangedData = {};
+				currentSelectors = {};
+
+				self.editor.on('NodeChange', function(e) {
+					var node = e.element, dom = self.dom, parents = dom.getParents(node, null, dom.getRoot()), matchedSelectors = {};
+
+					// Check for new matching selectors
+					each(self.selectorChangedData, function(callbacks, selector) {
+						each(parents, function(node) {
+							if (dom.is(node, selector)) {
+								if (!currentSelectors[selector]) {
+									// Execute callbacks
+									each(callbacks, function(callback) {
+										callback(true, {node: node, selector: selector, parents: parents});
+									});
+
+									currentSelectors[selector] = callbacks;
+								}
+
+								matchedSelectors[selector] = callbacks;
+								return false;
+							}
+						});
+					});
+
+					// Check if current selectors still match
+					each(currentSelectors, function(callbacks, selector) {
+						if (!matchedSelectors[selector]) {
+							delete currentSelectors[selector];
+
+							each(callbacks, function(callback) {
+								callback(false, {node: node, selector: selector, parents: parents});
+							});
+						}
+					});
+				});
+			}
+
+			// Add selector listeners
+			if (!self.selectorChangedData[selector]) {
+				self.selectorChangedData[selector] = [];
+			}
+
+			self.selectorChangedData[selector].push(callback);
+
+			return self;
+		},
+
+		getScrollContainer: function() {
+			var scrollContainer, node = this.dom.getRoot();
+
+			while (node && node.nodeName != 'BODY') {
+				if (node.scrollHeight > node.clientHeight) {
+					scrollContainer = node;
+					break;
+				}
+
+				node = node.parentNode;
+			}
+
+			return scrollContainer;
+		},
+
+		scrollIntoView: function(elm) {
+			var y, viewPort, self = this, dom = self.dom, root = dom.getRoot(), viewPortY, viewPortH;
+
+			function getPos(elm) {
+				var x = 0, y = 0;
+
+				var offsetParent = elm;
+				while (offsetParent && offsetParent.nodeType) {
+					x += offsetParent.offsetLeft || 0;
+					y += offsetParent.offsetTop || 0;
+					offsetParent = offsetParent.offsetParent;
+				}
+
+				return {x: x, y: y};
+			}
+
+			if (root.nodeName != 'BODY') {
+				var scrollContainer = self.getScrollContainer();
+				if (scrollContainer) {
+					y = getPos(elm).y - getPos(scrollContainer).y;
+					viewPortH = scrollContainer.clientHeight;
+					viewPortY = scrollContainer.scrollTop;
+					if (y < viewPortY || y + 25 > viewPortY + viewPortH) {
+						scrollContainer.scrollTop = y < viewPortY ? y : y - viewPortH + 25;
+					}
+
+					return;
+				}
+			}
+
+			viewPort = dom.getViewPort(self.editor.getWin());
+			y = dom.getPos(elm).y;
+			viewPortY = viewPort.y;
+			viewPortH = viewPort.h;
+			if (y < viewPort.y || y + 25 > viewPortY + viewPortH) {
+				self.editor.getWin().scrollTo(0, y < viewPortY ? y : y - viewPortH + 25);
+			}
+		},
+
+		placeCaretAt: function(clientX, clientY) {
+			var doc = this.editor.getDoc(), rng, point;
+
+			if (doc.caretPositionFromPoint) {
+				point = doc.caretPositionFromPoint(clientX, clientY);
+				rng = doc.createRange();
+				rng.setStart(point.offsetNode, point.offset);
+				rng.collapse(true);
+			} else if (doc.caretRangeFromPoint) {
+				rng = doc.caretRangeFromPoint(clientX, clientY);
+			} else if (doc.body.createTextRange) {
+				rng = doc.body.createTextRange();
+
+				try {
+					rng.moveToPoint(clientX, clientY);
+					rng.collapse(true);
+				} catch (ex) {
+					rng.collapse(clientY < doc.body.clientHeight);
+				}
+			}
+
+			this.setRng(rng);
+		},
+
+		_moveEndPoint: function(rng, node, start) {
+			var root = node, walker = new TreeWalker(node, root);
+			var nonEmptyElementsMap = this.dom.schema.getNonEmptyElements();
+
+			do {
+				// Text node
+				if (node.nodeType == 3 && trim(node.nodeValue).length !== 0) {
+					if (start) {
+						rng.setStart(node, 0);
+					} else {
+						rng.setEnd(node, node.nodeValue.length);
+					}
+
+					return;
+				}
+
+				// BR/IMG/INPUT elements but not table cells
+				if (nonEmptyElementsMap[node.nodeName] && !/^(TD|TH)$/.test(node.nodeName)) {
+					if (start) {
+						rng.setStartBefore(node);
+					} else {
+						if (node.nodeName == 'BR') {
+							rng.setEndBefore(node);
+						} else {
+							rng.setEndAfter(node);
+						}
+					}
+
+					return;
+				}
+
+				// Found empty text block old IE can place the selection inside those
+				if (Env.ie && Env.ie < 11 && this.dom.isBlock(node) && this.dom.isEmpty(node)) {
+					if (start) {
+						rng.setStart(node, 0);
+					} else {
+						rng.setEnd(node, 0);
+					}
+
+					return;
+				}
+			} while ((node = (start ? walker.next() : walker.prev())));
+
+			// Failed to find any text node or other suitable location then move to the root of body
+			if (root.nodeName == 'BODY') {
+				if (start) {
+					rng.setStart(root, 0);
+				} else {
+					rng.setEnd(root, root.childNodes.length);
+				}
+			}
+		},
+
+		destroy: function() {
+			this.win = null;
+			this.controlSelection.destroy();
+		}
+	};
+
+	return Selection;
+});
+
+// Included from: js/tinymce/classes/dom/ElementUtils.js
+
+/**
+ * ElementUtils.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Utility class for various element specific functions.
+ *
+ * @private
+ */
+define("tinymce/dom/ElementUtils", [
+	"tinymce/dom/BookmarkManager",
+	"tinymce/util/Tools"
+], function(BookmarkManager, Tools) {
+	var each = Tools.each;
+
+	function ElementUtils(dom) {
+		/**
+		 * Compares two nodes and checks if it's attributes and styles matches.
+		 * This doesn't compare classes as items since their order is significant.
+		 *
+		 * @method compare
+		 * @param {Node} node1 First node to compare with.
+		 * @param {Node} node2 Second node to compare with.
+		 * @return {boolean} True/false if the nodes are the same or not.
+		 */
+		this.compare = function(node1, node2) {
+			// Not the same name
+			if (node1.nodeName != node2.nodeName) {
+				return false;
+			}
+
+			/**
+			 * Returns all the nodes attributes excluding internal ones, styles and classes.
+			 *
+			 * @private
+			 * @param {Node} node Node to get attributes from.
+			 * @return {Object} Name/value object with attributes and attribute values.
+			 */
+			function getAttribs(node) {
+				var attribs = {};
+
+				each(dom.getAttribs(node), function(attr) {
+					var name = attr.nodeName.toLowerCase();
+
+					// Don't compare internal attributes or style
+					if (name.indexOf('_') !== 0 && name !== 'style' && name !== 'data-mce-style') {
+						attribs[name] = dom.getAttrib(node, name);
+					}
+				});
+
+				return attribs;
+			}
+
+			/**
+			 * Compares two objects checks if it's key + value exists in the other one.
+			 *
+			 * @private
+			 * @param {Object} obj1 First object to compare.
+			 * @param {Object} obj2 Second object to compare.
+			 * @return {boolean} True/false if the objects matches or not.
+			 */
+			function compareObjects(obj1, obj2) {
+				var value, name;
+
+				for (name in obj1) {
+					// Obj1 has item obj2 doesn't have
+					if (obj1.hasOwnProperty(name)) {
+						value = obj2[name];
+
+						// Obj2 doesn't have obj1 item
+						if (typeof value == "undefined") {
+							return false;
+						}
+
+						// Obj2 item has a different value
+						if (obj1[name] != value) {
+							return false;
+						}
+
+						// Delete similar value
+						delete obj2[name];
+					}
+				}
+
+				// Check if obj 2 has something obj 1 doesn't have
+				for (name in obj2) {
+					// Obj2 has item obj1 doesn't have
+					if (obj2.hasOwnProperty(name)) {
+						return false;
+					}
+				}
+
+				return true;
+			}
+
+			// Attribs are not the same
+			if (!compareObjects(getAttribs(node1), getAttribs(node2))) {
+				return false;
+			}
+
+			// Styles are not the same
+			if (!compareObjects(dom.parseStyle(dom.getAttrib(node1, 'style')), dom.parseStyle(dom.getAttrib(node2, 'style')))) {
+				return false;
+			}
+
+			return !BookmarkManager.isBookmarkNode(node1) && !BookmarkManager.isBookmarkNode(node2);
+		};
+	}
+
+	return ElementUtils;
+});
+
+// Included from: js/tinymce/classes/fmt/Preview.js
+
+/**
+ * Preview.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Internal class for generating previews styles for formats.
+ *
+ * Example:
+ *  Preview.getCssText(editor, 'bold');
+ *
+ * @class tinymce.fmt.Preview
+ * @private
+ */
+define("tinymce/fmt/Preview", [
+	"tinymce/util/Tools"
+], function(Tools) {
+	var each = Tools.each;
+
+	function getCssText(editor, format) {
+		var name, previewElm, dom = editor.dom;
+		var previewCss = '', parentFontSize, previewStyles;
+
+		previewStyles = editor.settings.preview_styles;
+
+		// No preview forced
+		if (previewStyles === false) {
+			return '';
+		}
+
+		// Default preview
+		if (!previewStyles) {
+			previewStyles = 'font-family font-size font-weight font-style text-decoration ' +
+				'text-transform color background-color border border-radius outline text-shadow';
+		}
+
+		// Removes any variables since these can't be previewed
+		function removeVars(val) {
+			return val.replace(/%(\w+)/g, '');
+		}
+
+		// Create block/inline element to use for preview
+		if (typeof format == "string") {
+			format = editor.formatter.get(format);
+			if (!format) {
+				return;
+			}
+
+			format = format[0];
+		}
+
+		name = format.block || format.inline || 'span';
+		previewElm = dom.create(name);
+
+		// Add format styles to preview element
+		each(format.styles, function(value, name) {
+			value = removeVars(value);
+
+			if (value) {
+				dom.setStyle(previewElm, name, value);
+			}
+		});
+
+		// Add attributes to preview element
+		each(format.attributes, function(value, name) {
+			value = removeVars(value);
+
+			if (value) {
+				dom.setAttrib(previewElm, name, value);
+			}
+		});
+
+		// Add classes to preview element
+		each(format.classes, function(value) {
+			value = removeVars(value);
+
+			if (!dom.hasClass(previewElm, value)) {
+				dom.addClass(previewElm, value);
+			}
+		});
+
+		editor.fire('PreviewFormats');
+
+		// Add the previewElm outside the visual area
+		dom.setStyles(previewElm, {position: 'absolute', left: -0xFFFF});
+		editor.getBody().appendChild(previewElm);
+
+		// Get parent container font size so we can compute px values out of em/% for older IE:s
+		parentFontSize = dom.getStyle(editor.getBody(), 'fontSize', true);
+		parentFontSize = /px$/.test(parentFontSize) ? parseInt(parentFontSize, 10) : 0;
+
+		each(previewStyles.split(' '), function(name) {
+			var value = dom.getStyle(previewElm, name, true);
+
+			// If background is transparent then check if the body has a background color we can use
+			if (name == 'background-color' && /transparent|rgba\s*\([^)]+,\s*0\)/.test(value)) {
+				value = dom.getStyle(editor.getBody(), name, true);
+
+				// Ignore white since it's the default color, not the nicest fix
+				// TODO: Fix this by detecting runtime style
+				if (dom.toHex(value).toLowerCase() == '#ffffff') {
+					return;
+				}
+			}
+
+			if (name == 'color') {
+				// Ignore black since it's the default color, not the nicest fix
+				// TODO: Fix this by detecting runtime style
+				if (dom.toHex(value).toLowerCase() == '#000000') {
+					return;
+				}
+			}
+
+			// Old IE won't calculate the font size so we need to do that manually
+			if (name == 'font-size') {
+				if (/em|%$/.test(value)) {
+					if (parentFontSize === 0) {
+						return;
+					}
+
+					// Convert font size from em/% to px
+					value = parseFloat(value, 10) / (/%$/.test(value) ? 100 : 1);
+					value = (value * parentFontSize) + 'px';
+				}
+			}
+
+			if (name == "border" && value) {
+				previewCss += 'padding:0 2px;';
+			}
+
+			previewCss += name + ':' + value + ';';
+		});
+
+		editor.fire('AfterPreviewFormats');
+
+		//previewCss += 'line-height:normal';
+
+		dom.remove(previewElm);
+
+		return previewCss;
+	}
+
+	return {
+		getCssText: getCssText
+	};
+});
+
+// Included from: js/tinymce/classes/Formatter.js
+
+/**
+ * Formatter.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Text formatter engine class. This class is used to apply formats like bold, italic, font size
+ * etc to the current selection or specific nodes. This engine was build to replace the browsers
+ * default formatting logic for execCommand due to it's inconsistent and buggy behavior.
+ *
+ * @class tinymce.Formatter
+ * @example
+ *  tinymce.activeEditor.formatter.register('mycustomformat', {
+ *    inline: 'span',
+ *    styles: {color: '#ff0000'}
+ *  });
+ *
+ *  tinymce.activeEditor.formatter.apply('mycustomformat');
+ */
+define("tinymce/Formatter", [
+	"tinymce/dom/TreeWalker",
+	"tinymce/dom/RangeUtils",
+	"tinymce/dom/BookmarkManager",
+	"tinymce/dom/ElementUtils",
+	"tinymce/util/Tools",
+	"tinymce/fmt/Preview"
+], function(TreeWalker, RangeUtils, BookmarkManager, ElementUtils, Tools, Preview) {
+	/**
+	 * Constructs a new formatter instance.
+	 *
+	 * @constructor Formatter
+	 * @param {tinymce.Editor} ed Editor instance to construct the formatter engine to.
+	 */
+	return function(ed) {
+		var formats = {},
+			dom = ed.dom,
+			selection = ed.selection,
+			rangeUtils = new RangeUtils(dom),
+			isValid = ed.schema.isValidChild,
+			isBlock = dom.isBlock,
+			forcedRootBlock = ed.settings.forced_root_block,
+			nodeIndex = dom.nodeIndex,
+			INVISIBLE_CHAR = '\uFEFF',
+			MCE_ATTR_RE = /^(src|href|style)$/,
+			FALSE = false,
+			TRUE = true,
+			formatChangeData,
+			undef,
+			getContentEditable = dom.getContentEditable,
+			disableCaretContainer,
+			markCaretContainersBogus,
+			isBookmarkNode = BookmarkManager.isBookmarkNode;
+
+		var each = Tools.each,
+			grep = Tools.grep,
+			walk = Tools.walk,
+			extend = Tools.extend;
+
+		function isTextBlock(name) {
+			if (name.nodeType) {
+				name = name.nodeName;
+			}
+
+			return !!ed.schema.getTextBlockElements()[name.toLowerCase()];
+		}
+
+		function isTableCell(node) {
+			return /^(TH|TD)$/.test(node.nodeName);
+		}
+
+		function getParents(node, selector) {
+			return dom.getParents(node, selector, dom.getRoot());
+		}
+
+		function isCaretNode(node) {
+			return node.nodeType === 1 && node.id === '_mce_caret';
+		}
+
+		function defaultFormats() {
+			register({
+				valigntop: [
+					{selector: 'td,th', styles: {'verticalAlign': 'top'}}
+				],
+
+				valignmiddle: [
+					{selector: 'td,th', styles: {'verticalAlign': 'middle'}}
+				],
+
+				valignbottom: [
+					{selector: 'td,th', styles: {'verticalAlign': 'bottom'}}
+				],
+
+				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: false, 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: false, styles: {display: 'block', marginLeft: 'auto', marginRight: 'auto'}},
+					{selector: 'table', collapsed: false, 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: false, 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: true},
+					{inline: 'u', remove: 'all'}
+				],
+
+				strikethrough: [
+					{inline: 'span', styles: {textDecoration: 'line-through'}, exact: true},
+					{inline: 'strike', remove: 'all'}
+				],
+
+				forecolor: {inline: 'span', styles: {color: '%value'}, links: true, remove_similar: true},
+				hilitecolor: {inline: 'span', styles: {backgroundColor: '%value'}, links: true, remove_similar: true},
+				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: true, deep: true,
+					onmatch: function() {
+						return true;
+					},
+
+					onformat: function(elm, fmt, vars) {
+						each(vars, function(value, key) {
+							dom.setAttrib(elm, key, value);
+						});
+					}
+				},
+
+				removeformat: [
+					{
+						selector: 'b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins',
+						remove: 'all',
+						split: true,
+						expand: false,
+						block_expand: true,
+						deep: true
+					},
+					{selector: 'span', attributes: ['style', 'class'], remove: 'empty', split: true, expand: false, deep: true},
+					{selector: '*', attributes: ['style', 'class'], split: false, expand: false, deep: true}
+				]
+			});
+
+			// Register default block formats
+			each('p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp'.split(/\s/), function(name) {
+				register(name, {block: name, remove: 'all'});
+			});
+
+			// Register user defined formats
+			register(ed.settings.formats);
+		}
+
+		function addKeyboardShortcuts() {
+			// Add some inline shortcuts
+			ed.addShortcut('meta+b', 'bold_desc', 'Bold');
+			ed.addShortcut('meta+i', 'italic_desc', 'Italic');
+			ed.addShortcut('meta+u', 'underline_desc', 'Underline');
+
+			// BlockFormat shortcuts keys
+			for (var i = 1; i <= 6; i++) {
+				ed.addShortcut('access+' + i, '', ['FormatBlock', false, 'h' + i]);
+			}
+
+			ed.addShortcut('access+7', '', ['FormatBlock', false, 'p']);
+			ed.addShortcut('access+8', '', ['FormatBlock', false, 'div']);
+			ed.addShortcut('access+9', '', ['FormatBlock', false, 'address']);
+		}
+
+		// Public functions
+
+		/**
+		 * Returns the format by name or all formats if no name is specified.
+		 *
+		 * @method get
+		 * @param {String} name Optional name to retrive by.
+		 * @return {Array/Object} Array/Object with all registred formats or a specific format.
+		 */
+		function get(name) {
+			return name ? formats[name] : formats;
+		}
+
+		/**
+		 * Registers a specific format by name.
+		 *
+		 * @method register
+		 * @param {Object/String} name Name of the format for example "bold".
+		 * @param {Object/Array} format Optional format object or array of format variants
+		 * can only be omitted if the first arg is an object.
+		 */
+		function register(name, format) {
+			if (name) {
+				if (typeof name !== 'string') {
+					each(name, function(format, name) {
+						register(name, format);
+					});
+				} else {
+					// Force format into array and add it to internal collection
+					format = format.length ? format : [format];
+
+					each(format, function(format) {
+						// Set deep to false by default on selector formats this to avoid removing
+						// alignment on images inside paragraphs when alignment is changed on paragraphs
+						if (format.deep === undef) {
+							format.deep = !format.selector;
+						}
+
+						// Default to true
+						if (format.split === undef) {
+							format.split = !format.selector || format.inline;
+						}
+
+						// Default to true
+						if (format.remove === undef && format.selector && !format.inline) {
+							format.remove = 'none';
+						}
+
+						// Mark format as a mixed format inline + block level
+						if (format.selector && format.inline) {
+							format.mixed = true;
+							format.block_expand = true;
+						}
+
+						// Split classes if needed
+						if (typeof format.classes === 'string') {
+							format.classes = format.classes.split(/\s+/);
+						}
+					});
+
+					formats[name] = format;
+				}
+			}
+		}
+
+		/**
+		 * Unregister a specific format by name.
+		 *
+		 * @method unregister
+		 * @param {String} name Name of the format for example "bold".
+		 */
+		function unregister(name) {
+			if (name && formats[name]) {
+				delete formats[name];
+			}
+
+			return formats;
+		}
+
+		function getTextDecoration(node) {
+			var decoration;
+
+			ed.dom.getParent(node, function(n) {
+				decoration = ed.dom.getStyle(n, 'text-decoration');
+				return decoration && decoration !== 'none';
+			});
+
+			return decoration;
+		}
+
+		function processUnderlineAndColor(node) {
+			var textDecoration;
+			if (node.nodeType === 1 && node.parentNode && node.parentNode.nodeType === 1) {
+				textDecoration = getTextDecoration(node.parentNode);
+				if (ed.dom.getStyle(node, 'color') && textDecoration) {
+					ed.dom.setStyle(node, 'text-decoration', textDecoration);
+				} else if (ed.dom.getStyle(node, 'text-decoration') === textDecoration) {
+					ed.dom.setStyle(node, 'text-decoration', null);
+				}
+			}
+		}
+
+		/**
+		 * Applies the specified format to the current selection or specified node.
+		 *
+		 * @method apply
+		 * @param {String} name Name of format to apply.
+		 * @param {Object} vars Optional list of variables to replace within format before applying it.
+		 * @param {Node} node Optional node to apply the format to defaults to current selection.
+		 */
+		function apply(name, vars, node) {
+			var formatList = get(name), format = formatList[0], bookmark, rng, isCollapsed = !node && selection.isCollapsed();
+
+			function setElementFormat(elm, fmt) {
+				fmt = fmt || format;
+
+				if (elm) {
+					if (fmt.onformat) {
+						fmt.onformat(elm, fmt, vars, node);
+					}
+
+					each(fmt.styles, function(value, name) {
+						dom.setStyle(elm, name, replaceVars(value, vars));
+					});
+
+					// Needed for the WebKit span spam bug
+					// TODO: Remove this once WebKit/Blink fixes this
+					if (fmt.styles) {
+						var styleVal = dom.getAttrib(elm, 'style');
+
+						if (styleVal) {
+							elm.setAttribute('data-mce-style', styleVal);
+						}
+					}
+
+					each(fmt.attributes, function(value, name) {
+						dom.setAttrib(elm, name, replaceVars(value, vars));
+					});
+
+					each(fmt.classes, function(value) {
+						value = replaceVars(value, vars);
+
+						if (!dom.hasClass(elm, value)) {
+							dom.addClass(elm, value);
+						}
+					});
+				}
+			}
+
+			function adjustSelectionToVisibleSelection() {
+				function findSelectionEnd(start, end) {
+					var walker = new TreeWalker(end);
+					for (node = walker.current(); node; node = walker.prev()) {
+						if (node.childNodes.length > 1 || node == start || node.tagName == 'BR') {
+							return node;
+						}
+					}
+				}
+
+				// Adjust selection so that a end container with a end offset of zero is not included in the selection
+				// as this isn't visible to the user.
+				var rng = ed.selection.getRng();
+				var start = rng.startContainer;
+				var end = rng.endContainer;
+
+				if (start != end && rng.endOffset === 0) {
+					var newEnd = findSelectionEnd(start, end);
+					var endOffset = newEnd.nodeType == 3 ? newEnd.length : newEnd.childNodes.length;
+
+					rng.setEnd(newEnd, endOffset);
+				}
+
+				return rng;
+			}
+
+			function applyRngStyle(rng, bookmark, node_specific) {
+				var newWrappers = [], wrapName, wrapElm, contentEditable = true;
+
+				// Setup wrapper element
+				wrapName = format.inline || format.block;
+				wrapElm = dom.create(wrapName);
+				setElementFormat(wrapElm);
+
+				rangeUtils.walk(rng, function(nodes) {
+					var currentWrapElm;
+
+					/**
+					 * Process a list of nodes wrap them.
+					 */
+					function process(node) {
+						var nodeName, parentName, found, hasContentEditableState, lastContentEditable;
+
+						lastContentEditable = contentEditable;
+						nodeName = node.nodeName.toLowerCase();
+						parentName = node.parentNode.nodeName.toLowerCase();
+
+						// Node has a contentEditable value
+						if (node.nodeType === 1 && getContentEditable(node)) {
+							lastContentEditable = contentEditable;
+							contentEditable = getContentEditable(node) === "true";
+							hasContentEditableState = true; // We don't want to wrap the container only it's children
+						}
+
+						// Stop wrapping on br elements
+						if (isEq(nodeName, 'br')) {
+							currentWrapElm = 0;
+
+							// Remove any br elements when we wrap things
+							if (format.block) {
+								dom.remove(node);
+							}
+
+							return;
+						}
+
+						// If node is wrapper type
+						if (format.wrapper && matchNode(node, name, vars)) {
+							currentWrapElm = 0;
+							return;
+						}
+
+						// Can we rename the block
+						// TODO: Break this if up, too complex
+						if (contentEditable && !hasContentEditableState && format.block &&
+							!format.wrapper && isTextBlock(nodeName) && isValid(parentName, wrapName)) {
+							node = dom.rename(node, wrapName);
+							setElementFormat(node);
+							newWrappers.push(node);
+							currentWrapElm = 0;
+							return;
+						}
+
+						// Handle selector patterns
+						if (format.selector) {
+							// Look for matching formats
+							each(formatList, function(format) {
+								// Check collapsed state if it exists
+								if ('collapsed' in format && format.collapsed !== isCollapsed) {
+									return;
+								}
+
+								if (dom.is(node, format.selector) && !isCaretNode(node)) {
+									setElementFormat(node, format);
+									found = true;
+								}
+							});
+
+							// Continue processing if a selector match wasn't found and a inline element is defined
+							if (!format.inline || found) {
+								currentWrapElm = 0;
+								return;
+							}
+						}
+
+						// Is it valid to wrap this item
+						// TODO: Break this if up, too complex
+						if (contentEditable && !hasContentEditableState && isValid(wrapName, nodeName) && isValid(parentName, wrapName) &&
+								!(!node_specific && node.nodeType === 3 &&
+								node.nodeValue.length === 1 &&
+								node.nodeValue.charCodeAt(0) === 65279) &&
+								!isCaretNode(node) &&
+								(!format.inline || !isBlock(node))) {
+							// Start wrapping
+							if (!currentWrapElm) {
+								// Wrap the node
+								currentWrapElm = dom.clone(wrapElm, FALSE);
+								node.parentNode.insertBefore(currentWrapElm, node);
+								newWrappers.push(currentWrapElm);
+							}
+
+							currentWrapElm.appendChild(node);
+						} else {
+							// Start a new wrapper for possible children
+							currentWrapElm = 0;
+
+							each(grep(node.childNodes), process);
+
+							if (hasContentEditableState) {
+								contentEditable = lastContentEditable; // Restore last contentEditable state from stack
+							}
+
+							// End the last wrapper
+							currentWrapElm = 0;
+						}
+					}
+
+					// Process siblings from range
+					each(nodes, process);
+				});
+
+				// Apply formats to links as well to get the color of the underline to change as well
+				if (format.links === true) {
+					each(newWrappers, function(node) {
+						function process(node) {
+							if (node.nodeName === 'A') {
+								setElementFormat(node, format);
+							}
+
+							each(grep(node.childNodes), process);
+						}
+
+						process(node);
+					});
+				}
+
+				// Cleanup
+				each(newWrappers, function(node) {
+					var childCount;
+
+					function getChildCount(node) {
+						var count = 0;
+
+						each(node.childNodes, function(node) {
+							if (!isWhiteSpaceNode(node) && !isBookmarkNode(node)) {
+								count++;
+							}
+						});
+
+						return count;
+					}
+
+					function mergeStyles(node) {
+						var child, clone;
+
+						each(node.childNodes, function(node) {
+							if (node.nodeType == 1 && !isBookmarkNode(node) && !isCaretNode(node)) {
+								child = node;
+								return FALSE; // break loop
+							}
+						});
+
+						// If child was found and of the same type as the current node
+						if (child && !isBookmarkNode(child) && matchName(child, format)) {
+							clone = dom.clone(child, FALSE);
+							setElementFormat(clone);
+
+							dom.replace(clone, node, TRUE);
+							dom.remove(child, 1);
+						}
+
+						return clone || node;
+					}
+
+					childCount = getChildCount(node);
+
+					// Remove empty nodes but only if there is multiple wrappers and they are not block
+					// elements so never remove single <h1></h1> since that would remove the
+					// currrent empty block element where the caret is at
+					if ((newWrappers.length > 1 || !isBlock(node)) && childCount === 0) {
+						dom.remove(node, 1);
+						return;
+					}
+
+					if (format.inline || format.wrapper) {
+						// Merges the current node with it's children of similar type to reduce the number of elements
+						if (!format.exact && childCount === 1) {
+							node = mergeStyles(node);
+						}
+
+						// Remove/merge children
+						each(formatList, function(format) {
+							// Merge all children of similar type will move styles from child to parent
+							// this: <span style="color:red"><b><span style="color:red; font-size:10px">text</span></b></span>
+							// will become: <span style="color:red"><b><span style="font-size:10px">text</span></b></span>
+							each(dom.select(format.inline, node), function(child) {
+								if (isBookmarkNode(child)) {
+									return;
+								}
+
+								removeFormat(format, vars, child, format.exact ? child : null);
+							});
+						});
+
+						// Remove child if direct parent is of same type
+						if (matchNode(node.parentNode, name, vars)) {
+							dom.remove(node, 1);
+							node = 0;
+							return TRUE;
+						}
+
+						// Look for parent with similar style format
+						if (format.merge_with_parents) {
+							dom.getParent(node.parentNode, function(parent) {
+								if (matchNode(parent, name, vars)) {
+									dom.remove(node, 1);
+									node = 0;
+									return TRUE;
+								}
+							});
+						}
+
+						// Merge next and previous siblings if they are similar <b>text</b><b>text</b> becomes <b>texttext</b>
+						if (node && format.merge_siblings !== false) {
+							node = mergeSiblings(getNonWhiteSpaceSibling(node), node);
+							node = mergeSiblings(node, getNonWhiteSpaceSibling(node, TRUE));
+						}
+					}
+				});
+			}
+
+			if (format) {
+				if (node) {
+					if (node.nodeType) {
+						rng = dom.createRng();
+						rng.setStartBefore(node);
+						rng.setEndAfter(node);
+						applyRngStyle(expandRng(rng, formatList), null, true);
+					} else {
+						applyRngStyle(node, null, true);
+					}
+				} else {
+					if (!isCollapsed || !format.inline || dom.select('td.mce-item-selected,th.mce-item-selected').length) {
+						// Obtain selection node before selection is unselected by applyRngStyle()
+						var curSelNode = ed.selection.getNode();
+
+						// If the formats have a default block and we can't find a parent block then
+						// start wrapping it with a DIV this is for forced_root_blocks: false
+						// It's kind of a hack but people should be using the default block type P since all desktop editors work that way
+						if (!forcedRootBlock && formatList[0].defaultBlock && !dom.getParent(curSelNode, dom.isBlock)) {
+							apply(formatList[0].defaultBlock);
+						}
+
+						// Apply formatting to selection
+						ed.selection.setRng(adjustSelectionToVisibleSelection());
+						bookmark = selection.getBookmark();
+						applyRngStyle(expandRng(selection.getRng(TRUE), formatList), bookmark);
+
+						// Colored nodes should be underlined so that the color of the underline matches the text color.
+						if (format.styles && (format.styles.color || format.styles.textDecoration)) {
+							walk(curSelNode, processUnderlineAndColor, 'childNodes');
+							processUnderlineAndColor(curSelNode);
+						}
+
+						selection.moveToBookmark(bookmark);
+						moveStart(selection.getRng(TRUE));
+						ed.nodeChanged();
+					} else {
+						performCaretAction('apply', name, vars);
+					}
+				}
+			}
+		}
+
+		/**
+		 * Removes the specified format from the current selection or specified node.
+		 *
+		 * @method remove
+		 * @param {String} name Name of format to remove.
+		 * @param {Object} vars Optional list of variables to replace within format before removing it.
+		 * @param {Node/Range} node Optional node or DOM range to remove the format from defaults to current selection.
+		 */
+		function remove(name, vars, node, similar) {
+			var formatList = get(name), format = formatList[0], bookmark, rng, contentEditable = true;
+
+			// Merges the styles for each node
+			function process(node) {
+				var children, i, l, lastContentEditable, hasContentEditableState;
+
+				// Node has a contentEditable value
+				if (node.nodeType === 1 && getContentEditable(node)) {
+					lastContentEditable = contentEditable;
+					contentEditable = getContentEditable(node) === "true";
+					hasContentEditableState = true; // We don't want to wrap the container only it's children
+				}
+
+				// Grab the children first since the nodelist might be changed
+				children = grep(node.childNodes);
+
+				// Process current node
+				if (contentEditable && !hasContentEditableState) {
+					for (i = 0, l = formatList.length; i < l; i++) {
+						if (removeFormat(formatList[i], vars, node, node)) {
+							break;
+						}
+					}
+				}
+
+				// Process the children
+				if (format.deep) {
+					if (children.length) {
+						for (i = 0, l = children.length; i < l; i++) {
+							process(children[i]);
+						}
+
+						if (hasContentEditableState) {
+							contentEditable = lastContentEditable; // Restore last contentEditable state from stack
+						}
+					}
+				}
+			}
+
+			function findFormatRoot(container) {
+				var formatRoot;
+
+				// Find format root
+				each(getParents(container.parentNode).reverse(), function(parent) {
+					var format;
+
+					// Find format root element
+					if (!formatRoot && parent.id != '_start' && parent.id != '_end') {
+						// Is the node matching the format we are looking for
+						format = matchNode(parent, name, vars, similar);
+						if (format && format.split !== false) {
+							formatRoot = parent;
+						}
+					}
+				});
+
+				return formatRoot;
+			}
+
+			function wrapAndSplit(formatRoot, container, target, split) {
+				var parent, clone, lastClone, firstClone, i, formatRootParent;
+
+				// Format root found then clone formats and split it
+				if (formatRoot) {
+					formatRootParent = formatRoot.parentNode;
+
+					for (parent = container.parentNode; parent && parent != formatRootParent; parent = parent.parentNode) {
+						clone = dom.clone(parent, FALSE);
+
+						for (i = 0; i < formatList.length; i++) {
+							if (removeFormat(formatList[i], vars, clone, clone)) {
+								clone = 0;
+								break;
+							}
+						}
+
+						// Build wrapper node
+						if (clone) {
+							if (lastClone) {
+								clone.appendChild(lastClone);
+							}
+
+							if (!firstClone) {
+								firstClone = clone;
+							}
+
+							lastClone = clone;
+						}
+					}
+
+					// Never split block elements if the format is mixed
+					if (split && (!format.mixed || !isBlock(formatRoot))) {
+						container = dom.split(formatRoot, container);
+					}
+
+					// Wrap container in cloned formats
+					if (lastClone) {
+						target.parentNode.insertBefore(lastClone, target);
+						firstClone.appendChild(target);
+					}
+				}
+
+				return container;
+			}
+
+			function splitToFormatRoot(container) {
+				return wrapAndSplit(findFormatRoot(container), container, container, true);
+			}
+
+			function unwrap(start) {
+				var node = dom.get(start ? '_start' : '_end'),
+					out = node[start ? 'firstChild' : 'lastChild'];
+
+				// If the end is placed within the start the result will be removed
+				// So this checks if the out node is a bookmark node if it is it
+				// checks for another more suitable node
+				if (isBookmarkNode(out)) {
+					out = out[start ? 'firstChild' : 'lastChild'];
+				}
+
+				// Since dom.remove removes empty text nodes then we need to try to find a better node
+				if (out.nodeType == 3 && out.data.length === 0) {
+					out = start ? node.previousSibling || node.nextSibling : node.nextSibling || node.previousSibling;
+				}
+
+				dom.remove(node, true);
+
+				return out;
+			}
+
+			function removeRngStyle(rng) {
+				var startContainer, endContainer;
+				var commonAncestorContainer = rng.commonAncestorContainer;
+
+				rng = expandRng(rng, formatList, TRUE);
+
+				if (format.split) {
+					startContainer = getContainer(rng, TRUE);
+					endContainer = getContainer(rng);
+
+					if (startContainer != endContainer) {
+						// WebKit will render the table incorrectly if we wrap a TH or TD in a SPAN
+						// so let's see if we can use the first child instead
+						// This will happen if you triple click a table cell and use remove formatting
+						if (/^(TR|TH|TD)$/.test(startContainer.nodeName) && startContainer.firstChild) {
+							if (startContainer.nodeName == "TR") {
+								startContainer = startContainer.firstChild.firstChild || startContainer;
+							} else {
+								startContainer = startContainer.firstChild || startContainer;
+							}
+						}
+
+						// Try to adjust endContainer as well if cells on the same row were selected - bug #6410
+						if (commonAncestorContainer &&
+							/^T(HEAD|BODY|FOOT|R)$/.test(commonAncestorContainer.nodeName) &&
+							isTableCell(endContainer) && endContainer.firstChild) {
+							endContainer = endContainer.firstChild || endContainer;
+						}
+
+						if (dom.isChildOf(startContainer, endContainer) && !isTableCell(startContainer) && !isTableCell(endContainer)) {
+							startContainer = wrap(startContainer, 'span', {id: '_start', 'data-mce-type': 'bookmark'});
+							splitToFormatRoot(startContainer);
+							startContainer = unwrap(TRUE);
+							return;
+						} else {
+							// Wrap start/end nodes in span element since these might be cloned/moved
+							startContainer = wrap(startContainer, 'span', {id: '_start', 'data-mce-type': 'bookmark'});
+							endContainer = wrap(endContainer, 'span', {id: '_end', 'data-mce-type': 'bookmark'});
+
+							// Split start/end
+							splitToFormatRoot(startContainer);
+							splitToFormatRoot(endContainer);
+
+							// Unwrap start/end to get real elements again
+							startContainer = unwrap(TRUE);
+							endContainer = unwrap();
+						}
+					} else {
+						startContainer = endContainer = splitToFormatRoot(startContainer);
+					}
+
+					// Update range positions since they might have changed after the split operations
+					rng.startContainer = startContainer.parentNode ? startContainer.parentNode : startContainer;
+					rng.startOffset = nodeIndex(startContainer);
+					rng.endContainer = endContainer.parentNode ? endContainer.parentNode : endContainer;
+					rng.endOffset = nodeIndex(endContainer) + 1;
+				}
+
+				// Remove items between start/end
+				rangeUtils.walk(rng, function(nodes) {
+					each(nodes, function(node) {
+						process(node);
+
+						// Remove parent span if it only contains text-decoration: underline, yet a parent node is also underlined.
+						if (node.nodeType === 1 && ed.dom.getStyle(node, 'text-decoration') === 'underline' &&
+							node.parentNode && getTextDecoration(node.parentNode) === 'underline') {
+							removeFormat({
+								'deep': false,
+								'exact': true,
+								'inline': 'span',
+								'styles': {
+									'textDecoration': 'underline'
+								}
+							}, null, node);
+						}
+					});
+				});
+			}
+
+			// Handle node
+			if (node) {
+				if (node.nodeType) {
+					rng = dom.createRng();
+					rng.setStartBefore(node);
+					rng.setEndAfter(node);
+					removeRngStyle(rng);
+				} else {
+					removeRngStyle(node);
+				}
+
+				return;
+			}
+
+			if (!selection.isCollapsed() || !format.inline || dom.select('td.mce-item-selected,th.mce-item-selected').length) {
+				bookmark = selection.getBookmark();
+				removeRngStyle(selection.getRng(TRUE));
+				selection.moveToBookmark(bookmark);
+
+				// Check if start element still has formatting then we are at: "<b>text|</b>text"
+				// and need to move the start into the next text node
+				if (format.inline && match(name, vars, selection.getStart())) {
+					moveStart(selection.getRng(true));
+				}
+
+				ed.nodeChanged();
+			} else {
+				performCaretAction('remove', name, vars, similar);
+			}
+		}
+
+		/**
+		 * Toggles the specified format on/off.
+		 *
+		 * @method toggle
+		 * @param {String} name Name of format to apply/remove.
+		 * @param {Object} vars Optional list of variables to replace within format before applying/removing it.
+		 * @param {Node} node Optional node to apply the format to or remove from. Defaults to current selection.
+		 */
+		function toggle(name, vars, node) {
+			var fmt = get(name);
+
+			if (match(name, vars, node) && (!('toggle' in fmt[0]) || fmt[0].toggle)) {
+				remove(name, vars, node);
+			} else {
+				apply(name, vars, node);
+			}
+		}
+
+		/**
+		 * Return true/false if the specified node has the specified format.
+		 *
+		 * @method matchNode
+		 * @param {Node} node Node to check the format on.
+		 * @param {String} name Format name to check.
+		 * @param {Object} vars Optional list of variables to replace before checking it.
+		 * @param {Boolean} similar Match format that has similar properties.
+		 * @return {Object} Returns the format object it matches or undefined if it doesn't match.
+		 */
+		function matchNode(node, name, vars, similar) {
+			var formatList = get(name), format, i, classes;
+
+			function matchItems(node, format, item_name) {
+				var key, value, items = format[item_name], i;
+
+				// Custom match
+				if (format.onmatch) {
+					return format.onmatch(node, format, item_name);
+				}
+
+				// Check all items
+				if (items) {
+					// Non indexed object
+					if (items.length === undef) {
+						for (key in items) {
+							if (items.hasOwnProperty(key)) {
+								if (item_name === 'attributes') {
+									value = dom.getAttrib(node, key);
+								} else {
+									value = getStyle(node, key);
+								}
+
+								if (similar && !value && !format.exact) {
+									return;
+								}
+
+								if ((!similar || format.exact) && !isEq(value, normalizeStyleValue(replaceVars(items[key], vars), key))) {
+									return;
+								}
+							}
+						}
+					} else {
+						// Only one match needed for indexed arrays
+						for (i = 0; i < items.length; i++) {
+							if (item_name === 'attributes' ? dom.getAttrib(node, items[i]) : getStyle(node, items[i])) {
+								return format;
+							}
+						}
+					}
+				}
+
+				return format;
+			}
+
+			if (formatList && node) {
+				// Check each format in list
+				for (i = 0; i < formatList.length; i++) {
+					format = formatList[i];
+
+					// Name name, attributes, styles and classes
+					if (matchName(node, format) && matchItems(node, format, 'attributes') && matchItems(node, format, 'styles')) {
+						// Match classes
+						if ((classes = format.classes)) {
+							for (i = 0; i < classes.length; i++) {
+								if (!dom.hasClass(node, classes[i])) {
+									return;
+								}
+							}
+						}
+
+						return format;
+					}
+				}
+			}
+		}
+
+		/**
+		 * Matches the current selection or specified node against the specified format name.
+		 *
+		 * @method match
+		 * @param {String} name Name of format to match.
+		 * @param {Object} vars Optional list of variables to replace before checking it.
+		 * @param {Node} node Optional node to check.
+		 * @return {boolean} true/false if the specified selection/node matches the format.
+		 */
+		function match(name, vars, node) {
+			var startNode;
+
+			function matchParents(node) {
+				var root = dom.getRoot();
+
+				if (node === root) {
+					return false;
+				}
+
+				// Find first node with similar format settings
+				node = dom.getParent(node, function(node) {
+					return node.parentNode === root || !!matchNode(node, name, vars, true);
+				});
+
+				// Do an exact check on the similar format element
+				return matchNode(node, name, vars);
+			}
+
+			// Check specified node
+			if (node) {
+				return matchParents(node);
+			}
+
+			// Check selected node
+			node = selection.getNode();
+			if (matchParents(node)) {
+				return TRUE;
+			}
+
+			// Check start node if it's different
+			startNode = selection.getStart();
+			if (startNode != node) {
+				if (matchParents(startNode)) {
+					return TRUE;
+				}
+			}
+
+			return FALSE;
+		}
+
+		/**
+		 * Matches the current selection against the array of formats and returns a new array with matching formats.
+		 *
+		 * @method matchAll
+		 * @param {Array} names Name of format to match.
+		 * @param {Object} vars Optional list of variables to replace before checking it.
+		 * @return {Array} Array with matched formats.
+		 */
+		function matchAll(names, vars) {
+			var startElement, matchedFormatNames = [], checkedMap = {};
+
+			// Check start of selection for formats
+			startElement = selection.getStart();
+			dom.getParent(startElement, function(node) {
+				var i, name;
+
+				for (i = 0; i < names.length; i++) {
+					name = names[i];
+
+					if (!checkedMap[name] && matchNode(node, name, vars)) {
+						checkedMap[name] = true;
+						matchedFormatNames.push(name);
+					}
+				}
+			}, dom.getRoot());
+
+			return matchedFormatNames;
+		}
+
+		/**
+		 * Returns true/false if the specified format can be applied to the current selection or not. It
+		 * will currently only check the state for selector formats, it returns true on all other format types.
+		 *
+		 * @method canApply
+		 * @param {String} name Name of format to check.
+		 * @return {boolean} true/false if the specified format can be applied to the current selection/node.
+		 */
+		function canApply(name) {
+			var formatList = get(name), startNode, parents, i, x, selector;
+
+			if (formatList) {
+				startNode = selection.getStart();
+				parents = getParents(startNode);
+
+				for (x = formatList.length - 1; x >= 0; x--) {
+					selector = formatList[x].selector;
+
+					// Format is not selector based then always return TRUE
+					// Is it has a defaultBlock then it's likely it can be applied for example align on a non block element line
+					if (!selector || formatList[x].defaultBlock) {
+						return TRUE;
+					}
+
+					for (i = parents.length - 1; i >= 0; i--) {
+						if (dom.is(parents[i], selector)) {
+							return TRUE;
+						}
+					}
+				}
+			}
+
+			return FALSE;
+		}
+
+		/**
+		 * Executes the specified callback when the current selection matches the formats or not.
+		 *
+		 * @method formatChanged
+		 * @param {String} formats Comma separated list of formats to check for.
+		 * @param {function} callback Callback with state and args when the format is changed/toggled on/off.
+		 * @param {Boolean} similar True/false state if the match should handle similar or exact formats.
+		 */
+		function formatChanged(formats, callback, similar) {
+			var currentFormats;
+
+			// Setup format node change logic
+			if (!formatChangeData) {
+				formatChangeData = {};
+				currentFormats = {};
+
+				ed.on('NodeChange', function(e) {
+					var parents = getParents(e.element), matchedFormats = {};
+
+					// Ignore bogus nodes like the <a> tag created by moveStart()
+					parents = Tools.grep(parents, function(node) {
+						return node.nodeType == 1 && !node.getAttribute('data-mce-bogus');
+					});
+
+					// Check for new formats
+					each(formatChangeData, function(callbacks, format) {
+						each(parents, function(node) {
+							if (matchNode(node, format, {}, callbacks.similar)) {
+								if (!currentFormats[format]) {
+									// Execute callbacks
+									each(callbacks, function(callback) {
+										callback(true, {node: node, format: format, parents: parents});
+									});
+
+									currentFormats[format] = callbacks;
+								}
+
+								matchedFormats[format] = callbacks;
+								return false;
+							}
+						});
+					});
+
+					// Check if current formats still match
+					each(currentFormats, function(callbacks, format) {
+						if (!matchedFormats[format]) {
+							delete currentFormats[format];
+
+							each(callbacks, function(callback) {
+								callback(false, {node: e.element, format: format, parents: parents});
+							});
+						}
+					});
+				});
+			}
+
+			// Add format listeners
+			each(formats.split(','), function(format) {
+				if (!formatChangeData[format]) {
+					formatChangeData[format] = [];
+					formatChangeData[format].similar = similar;
+				}
+
+				formatChangeData[format].push(callback);
+			});
+
+			return this;
+		}
+
+		/**
+		 * Returns a preview css text for the specified format.
+		 *
+		 * @method getCssText
+		 * @param {String/Object} format Format to generate preview css text for.
+		 * @return {String} Css text for the specified format.
+		 * @example
+		 * var cssText1 = editor.formatter.getCssText('bold');
+		 * var cssText2 = editor.formatter.getCssText({inline: 'b'});
+		 */
+		function getCssText(format) {
+			return Preview.getCssText(ed, format);
+		}
+
+		// Expose to public
+		extend(this, {
+			get: get,
+			register: register,
+			unregister: unregister,
+			apply: apply,
+			remove: remove,
+			toggle: toggle,
+			match: match,
+			matchAll: matchAll,
+			matchNode: matchNode,
+			canApply: canApply,
+			formatChanged: formatChanged,
+			getCssText: getCssText
+		});
+
+		// Initialize
+		defaultFormats();
+		addKeyboardShortcuts();
+		ed.on('BeforeGetContent', function(e) {
+			if (markCaretContainersBogus && e.format != 'raw') {
+				markCaretContainersBogus();
+			}
+		});
+		ed.on('mouseup keydown', function(e) {
+			if (disableCaretContainer) {
+				disableCaretContainer(e);
+			}
+		});
+
+		// Private functions
+
+		/**
+		 * Checks if the specified nodes name matches the format inline/block or selector.
+		 *
+		 * @private
+		 * @param {Node} node Node to match against the specified format.
+		 * @param {Object} format Format object o match with.
+		 * @return {boolean} true/false if the format matches.
+		 */
+		function matchName(node, format) {
+			// Check for inline match
+			if (isEq(node, format.inline)) {
+				return TRUE;
+			}
+
+			// Check for block match
+			if (isEq(node, format.block)) {
+				return TRUE;
+			}
+
+			// Check for selector match
+			if (format.selector) {
+				return node.nodeType == 1 && dom.is(node, format.selector);
+			}
+		}
+
+		/**
+		 * Compares two string/nodes regardless of their case.
+		 *
+		 * @private
+		 * @param {String/Node} Node or string to compare.
+		 * @param {String/Node} Node or string to compare.
+		 * @return {boolean} True/false if they match.
+		 */
+		function isEq(str1, str2) {
+			str1 = str1 || '';
+			str2 = str2 || '';
+
+			str1 = '' + (str1.nodeName || str1);
+			str2 = '' + (str2.nodeName || str2);
+
+			return str1.toLowerCase() == str2.toLowerCase();
+		}
+
+		/**
+		 * Returns the style by name on the specified node. This method modifies the style
+		 * contents to make it more easy to match. This will resolve a few browser issues.
+		 *
+		 * @private
+		 * @param {Node} node to get style from.
+		 * @param {String} name Style name to get.
+		 * @return {String} Style item value.
+		 */
+		function getStyle(node, name) {
+			return normalizeStyleValue(dom.getStyle(node, name), name);
+		}
+
+		/**
+		 * Normalize style value by name. This method modifies the style contents
+		 * to make it more easy to match. This will resolve a few browser issues.
+		 *
+		 * @private
+		 * @param {Node} node to get style from.
+		 * @param {String} name Style name to get.
+		 * @return {String} Style item value.
+		 */
+		function normalizeStyleValue(value, name) {
+			// Force the format to hex
+			if (name == 'color' || name == 'backgroundColor') {
+				value = dom.toHex(value);
+			}
+
+			// Opera will return bold as 700
+			if (name == 'fontWeight' && value == 700) {
+				value = 'bold';
+			}
+
+			// Normalize fontFamily so "'Font name', Font" becomes: "Font name,Font"
+			if (name == 'fontFamily') {
+				value = value.replace(/[\'\"]/g, '').replace(/,\s+/g, ',');
+			}
+
+			return '' + value;
+		}
+
+		/**
+		 * Replaces variables in the value. The variable format is %var.
+		 *
+		 * @private
+		 * @param {String} value Value to replace variables in.
+		 * @param {Object} vars Name/value array with variables to replace.
+		 * @return {String} New value with replaced variables.
+		 */
+		function replaceVars(value, vars) {
+			if (typeof value != "string") {
+				value = value(vars);
+			} else if (vars) {
+				value = value.replace(/%(\w+)/g, function(str, name) {
+					return vars[name] || str;
+				});
+			}
+
+			return value;
+		}
+
+		function isWhiteSpaceNode(node) {
+			return node && node.nodeType === 3 && /^([\t \r\n]+|)$/.test(node.nodeValue);
+		}
+
+		function wrap(node, name, attrs) {
+			var wrapper = dom.create(name, attrs);
+
+			node.parentNode.insertBefore(wrapper, node);
+			wrapper.appendChild(node);
+
+			return wrapper;
+		}
+
+		/**
+		 * Expands the specified range like object to depending on format.
+		 *
+		 * For example on block formats it will move the start/end position
+		 * to the beginning of the current block.
+		 *
+		 * @private
+		 * @param {Object} rng Range like object.
+		 * @param {Array} formats Array with formats to expand by.
+		 * @return {Object} Expanded range like object.
+		 */
+		function expandRng(rng, format, remove) {
+			var lastIdx, leaf, endPoint,
+				startContainer = rng.startContainer,
+				startOffset = rng.startOffset,
+				endContainer = rng.endContainer,
+				endOffset = rng.endOffset;
+
+			// This function walks up the tree if there is no siblings before/after the node
+			function findParentContainer(start) {
+				var container, parent, sibling, siblingName, root;
+
+				container = parent = start ? startContainer : endContainer;
+				siblingName = start ? 'previousSibling' : 'nextSibling';
+				root = dom.getRoot();
+
+				function isBogusBr(node) {
+					return node.nodeName == "BR" && node.getAttribute('data-mce-bogus') && !node.nextSibling;
+				}
+
+				// If it's a text node and the offset is inside the text
+				if (container.nodeType == 3 && !isWhiteSpaceNode(container)) {
+					if (start ? startOffset > 0 : endOffset < container.nodeValue.length) {
+						return container;
+					}
+				}
+
+				/*eslint no-constant-condition:0 */
+				while (true) {
+					// Stop expanding on block elements
+					if (!format[0].block_expand && isBlock(parent)) {
+						return parent;
+					}
+
+					// Walk left/right
+					for (sibling = parent[siblingName]; sibling; sibling = sibling[siblingName]) {
+						if (!isBookmarkNode(sibling) && !isWhiteSpaceNode(sibling) && !isBogusBr(sibling)) {
+							return parent;
+						}
+					}
+
+					// Check if we can move up are we at root level or body level
+					if (parent.parentNode == root) {
+						container = parent;
+						break;
+					}
+
+					parent = parent.parentNode;
+				}
+
+				return container;
+			}
+
+			// This function walks down the tree to find the leaf at the selection.
+			// The offset is also returned as if node initially a leaf, the offset may be in the middle of the text node.
+			function findLeaf(node, offset) {
+				if (offset === undef) {
+					offset = node.nodeType === 3 ? node.length : node.childNodes.length;
+				}
+
+				while (node && node.hasChildNodes()) {
+					node = node.childNodes[offset];
+					if (node) {
+						offset = node.nodeType === 3 ? node.length : node.childNodes.length;
+					}
+				}
+				return {node: node, offset: offset};
+			}
+
+			// If index based start position then resolve it
+			if (startContainer.nodeType == 1 && startContainer.hasChildNodes()) {
+				lastIdx = startContainer.childNodes.length - 1;
+				startContainer = startContainer.childNodes[startOffset > lastIdx ? lastIdx : startOffset];
+
+				if (startContainer.nodeType == 3) {
+					startOffset = 0;
+				}
+			}
+
+			// If index based end position then resolve it
+			if (endContainer.nodeType == 1 && endContainer.hasChildNodes()) {
+				lastIdx = endContainer.childNodes.length - 1;
+				endContainer = endContainer.childNodes[endOffset > lastIdx ? lastIdx : endOffset - 1];
+
+				if (endContainer.nodeType == 3) {
+					endOffset = endContainer.nodeValue.length;
+				}
+			}
+
+			// Expands the node to the closes contentEditable false element if it exists
+			function findParentContentEditable(node) {
+				var parent = node;
+
+				while (parent) {
+					if (parent.nodeType === 1 && getContentEditable(parent)) {
+						return getContentEditable(parent) === "false" ? parent : node;
+					}
+
+					parent = parent.parentNode;
+				}
+
+				return node;
+			}
+
+			function findWordEndPoint(container, offset, start) {
+				var walker, node, pos, lastTextNode;
+
+				function findSpace(node, offset) {
+					var pos, pos2, str = node.nodeValue;
+
+					if (typeof offset == "undefined") {
+						offset = start ? str.length : 0;
+					}
+
+					if (start) {
+						pos = str.lastIndexOf(' ', offset);
+						pos2 = str.lastIndexOf('\u00a0', offset);
+						pos = pos > pos2 ? pos : pos2;
+
+						// Include the space on remove to avoid tag soup
+						if (pos !== -1 && !remove) {
+							pos++;
+						}
+					} else {
+						pos = str.indexOf(' ', offset);
+						pos2 = str.indexOf('\u00a0', offset);
+						pos = pos !== -1 && (pos2 === -1 || pos < pos2) ? pos : pos2;
+					}
+
+					return pos;
+				}
+
+				if (container.nodeType === 3) {
+					pos = findSpace(container, offset);
+
+					if (pos !== -1) {
+						return {container: container, offset: pos};
+					}
+
+					lastTextNode = container;
+				}
+
+				// Walk the nodes inside the block
+				walker = new TreeWalker(container, dom.getParent(container, isBlock) || ed.getBody());
+				while ((node = walker[start ? 'prev' : 'next']())) {
+					if (node.nodeType === 3) {
+						lastTextNode = node;
+						pos = findSpace(node);
+
+						if (pos !== -1) {
+							return {container: node, offset: pos};
+						}
+					} else if (isBlock(node)) {
+						break;
+					}
+				}
+
+				if (lastTextNode) {
+					if (start) {
+						offset = 0;
+					} else {
+						offset = lastTextNode.length;
+					}
+
+					return {container: lastTextNode, offset: offset};
+				}
+			}
+
+			function findSelectorEndPoint(container, sibling_name) {
+				var parents, i, y, curFormat;
+
+				if (container.nodeType == 3 && container.nodeValue.length === 0 && container[sibling_name]) {
+					container = container[sibling_name];
+				}
+
+				parents = getParents(container);
+				for (i = 0; i < parents.length; i++) {
+					for (y = 0; y < format.length; y++) {
+						curFormat = format[y];
+
+						// If collapsed state is set then skip formats that doesn't match that
+						if ("collapsed" in curFormat && curFormat.collapsed !== rng.collapsed) {
+							continue;
+						}
+
+						if (dom.is(parents[i], curFormat.selector)) {
+							return parents[i];
+						}
+					}
+				}
+
+				return container;
+			}
+
+			function findBlockEndPoint(container, sibling_name) {
+				var node, root = dom.getRoot();
+
+				// Expand to block of similar type
+				if (!format[0].wrapper) {
+					node = dom.getParent(container, format[0].block, root);
+				}
+
+				// Expand to first wrappable block element or any block element
+				if (!node) {
+					node = dom.getParent(container.nodeType == 3 ? container.parentNode : container, function(node) {
+						// Fixes #6183 where it would expand to editable parent element in inline mode
+						return node != root && isTextBlock(node);
+					});
+				}
+
+				// Exclude inner lists from wrapping
+				if (node && format[0].wrapper) {
+					node = getParents(node, 'ul,ol').reverse()[0] || node;
+				}
+
+				// Didn't find a block element look for first/last wrappable element
+				if (!node) {
+					node = container;
+
+					while (node[sibling_name] && !isBlock(node[sibling_name])) {
+						node = node[sibling_name];
+
+						// Break on BR but include it will be removed later on
+						// we can't remove it now since we need to check if it can be wrapped
+						if (isEq(node, 'br')) {
+							break;
+						}
+					}
+				}
+
+				return node || container;
+			}
+
+			// Expand to closest contentEditable element
+			startContainer = findParentContentEditable(startContainer);
+			endContainer = findParentContentEditable(endContainer);
+
+			// Exclude bookmark nodes if possible
+			if (isBookmarkNode(startContainer.parentNode) || isBookmarkNode(startContainer)) {
+				startContainer = isBookmarkNode(startContainer) ? startContainer : startContainer.parentNode;
+				startContainer = startContainer.nextSibling || startContainer;
+
+				if (startContainer.nodeType == 3) {
+					startOffset = 0;
+				}
+			}
+
+			if (isBookmarkNode(endContainer.parentNode) || isBookmarkNode(endContainer)) {
+				endContainer = isBookmarkNode(endContainer) ? endContainer : endContainer.parentNode;
+				endContainer = endContainer.previousSibling || endContainer;
+
+				if (endContainer.nodeType == 3) {
+					endOffset = endContainer.length;
+				}
+			}
+
+			if (format[0].inline) {
+				if (rng.collapsed) {
+					// Expand left to closest word boundary
+					endPoint = findWordEndPoint(startContainer, startOffset, true);
+					if (endPoint) {
+						startContainer = endPoint.container;
+						startOffset = endPoint.offset;
+					}
+
+					// Expand right to closest word boundary
+					endPoint = findWordEndPoint(endContainer, endOffset);
+					if (endPoint) {
+						endContainer = endPoint.container;
+						endOffset = endPoint.offset;
+					}
+				}
+
+				// Avoid applying formatting to a trailing space.
+				leaf = findLeaf(endContainer, endOffset);
+				if (leaf.node) {
+					while (leaf.node && leaf.offset === 0 && leaf.node.previousSibling) {
+						leaf = findLeaf(leaf.node.previousSibling);
+					}
+
+					if (leaf.node && leaf.offset > 0 && leaf.node.nodeType === 3 &&
+							leaf.node.nodeValue.charAt(leaf.offset - 1) === ' ') {
+
+						if (leaf.offset > 1) {
+							endContainer = leaf.node;
+							endContainer.splitText(leaf.offset - 1);
+						}
+					}
+				}
+			}
+
+			// Move start/end point up the tree if the leaves are sharp and if we are in different containers
+			// Example * becomes !: !<p><b><i>*text</i><i>text*</i></b></p>!
+			// This will reduce the number of wrapper elements that needs to be created
+			// Move start point up the tree
+			if (format[0].inline || format[0].block_expand) {
+				if (!format[0].inline || (startContainer.nodeType != 3 || startOffset === 0)) {
+					startContainer = findParentContainer(true);
+				}
+
+				if (!format[0].inline || (endContainer.nodeType != 3 || endOffset === endContainer.nodeValue.length)) {
+					endContainer = findParentContainer();
+				}
+			}
+
+			// Expand start/end container to matching selector
+			if (format[0].selector && format[0].expand !== FALSE && !format[0].inline) {
+				// Find new startContainer/endContainer if there is better one
+				startContainer = findSelectorEndPoint(startContainer, 'previousSibling');
+				endContainer = findSelectorEndPoint(endContainer, 'nextSibling');
+			}
+
+			// Expand start/end container to matching block element or text node
+			if (format[0].block || format[0].selector) {
+				// Find new startContainer/endContainer if there is better one
+				startContainer = findBlockEndPoint(startContainer, 'previousSibling');
+				endContainer = findBlockEndPoint(endContainer, 'nextSibling');
+
+				// Non block element then try to expand up the leaf
+				if (format[0].block) {
+					if (!isBlock(startContainer)) {
+						startContainer = findParentContainer(true);
+					}
+
+					if (!isBlock(endContainer)) {
+						endContainer = findParentContainer();
+					}
+				}
+			}
+
+			// Setup index for startContainer
+			if (startContainer.nodeType == 1) {
+				startOffset = nodeIndex(startContainer);
+				startContainer = startContainer.parentNode;
+			}
+
+			// Setup index for endContainer
+			if (endContainer.nodeType == 1) {
+				endOffset = nodeIndex(endContainer) + 1;
+				endContainer = endContainer.parentNode;
+			}
+
+			// Return new range like object
+			return {
+				startContainer: startContainer,
+				startOffset: startOffset,
+				endContainer: endContainer,
+				endOffset: endOffset
+			};
+		}
+
+		function isColorFormatAndAnchor(node, format) {
+			return format.links && node.tagName == 'A';
+		}
+
+		/**
+		 * Removes the specified format for the specified node. It will also remove the node if it doesn't have
+		 * any attributes if the format specifies it to do so.
+		 *
+		 * @private
+		 * @param {Object} format Format object with items to remove from node.
+		 * @param {Object} vars Name/value object with variables to apply to format.
+		 * @param {Node} node Node to remove the format styles on.
+		 * @param {Node} compare_node Optional compare node, if specified the styles will be compared to that node.
+		 * @return {Boolean} True/false if the node was removed or not.
+		 */
+		function removeFormat(format, vars, node, compare_node) {
+			var i, attrs, stylesModified;
+
+			// Check if node matches format
+			if (!matchName(node, format) && !isColorFormatAndAnchor(node, format)) {
+				return FALSE;
+			}
+
+			// Should we compare with format attribs and styles
+			if (format.remove != 'all') {
+				// Remove styles
+				each(format.styles, function(value, name) {
+					value = normalizeStyleValue(replaceVars(value, vars), name);
+
+					// Indexed array
+					if (typeof name === 'number') {
+						name = value;
+						compare_node = 0;
+					}
+
+					if (format.remove_similar || (!compare_node || isEq(getStyle(compare_node, name), value))) {
+						dom.setStyle(node, name, '');
+					}
+
+					stylesModified = 1;
+				});
+
+				// Remove style attribute if it's empty
+				if (stylesModified && dom.getAttrib(node, 'style') === '') {
+					node.removeAttribute('style');
+					node.removeAttribute('data-mce-style');
+				}
+
+				// Remove attributes
+				each(format.attributes, function(value, name) {
+					var valueOut;
+
+					value = replaceVars(value, vars);
+
+					// Indexed array
+					if (typeof name === 'number') {
+						name = value;
+						compare_node = 0;
+					}
+
+					if (!compare_node || isEq(dom.getAttrib(compare_node, name), value)) {
+						// Keep internal classes
+						if (name == 'class') {
+							value = dom.getAttrib(node, name);
+							if (value) {
+								// Build new class value where everything is removed except the internal prefixed classes
+								valueOut = '';
+								each(value.split(/\s+/), function(cls) {
+									if (/mce\-\w+/.test(cls)) {
+										valueOut += (valueOut ? ' ' : '') + cls;
+									}
+								});
+
+								// We got some internal classes left
+								if (valueOut) {
+									dom.setAttrib(node, name, valueOut);
+									return;
+								}
+							}
+						}
+
+						// IE6 has a bug where the attribute doesn't get removed correctly
+						if (name == "class") {
+							node.removeAttribute('className');
+						}
+
+						// Remove mce prefixed attributes
+						if (MCE_ATTR_RE.test(name)) {
+							node.removeAttribute('data-mce-' + name);
+						}
+
+						node.removeAttribute(name);
+					}
+				});
+
+				// Remove classes
+				each(format.classes, function(value) {
+					value = replaceVars(value, vars);
+
+					if (!compare_node || dom.hasClass(compare_node, value)) {
+						dom.removeClass(node, value);
+					}
+				});
+
+				// Check for non internal attributes
+				attrs = dom.getAttribs(node);
+				for (i = 0; i < attrs.length; i++) {
+					if (attrs[i].nodeName.indexOf('_') !== 0) {
+						return FALSE;
+					}
+				}
+			}
+
+			// Remove the inline child if it's empty for example <b> or <span>
+			if (format.remove != 'none') {
+				removeNode(node, format);
+				return TRUE;
+			}
+		}
+
+		/**
+		 * Removes the node and wrap it's children in paragraphs before doing so or
+		 * appends BR elements to the beginning/end of the block element if forcedRootBlocks is disabled.
+		 *
+		 * If the div in the node below gets removed:
+		 *  text<div>text</div>text
+		 *
+		 * Output becomes:
+		 *  text<div><br />text<br /></div>text
+		 *
+		 * So when the div is removed the result is:
+		 *  text<br />text<br />text
+		 *
+		 * @private
+		 * @param {Node} node Node to remove + apply BR/P elements to.
+		 * @param {Object} format Format rule.
+		 * @return {Node} Input node.
+		 */
+		function removeNode(node, format) {
+			var parentNode = node.parentNode, rootBlockElm;
+
+			function find(node, next, inc) {
+				node = getNonWhiteSpaceSibling(node, next, inc);
+
+				return !node || (node.nodeName == 'BR' || isBlock(node));
+			}
+
+			if (format.block) {
+				if (!forcedRootBlock) {
+					// Append BR elements if needed before we remove the block
+					if (isBlock(node) && !isBlock(parentNode)) {
+						if (!find(node, FALSE) && !find(node.firstChild, TRUE, 1)) {
+							node.insertBefore(dom.create('br'), node.firstChild);
+						}
+
+						if (!find(node, TRUE) && !find(node.lastChild, FALSE, 1)) {
+							node.appendChild(dom.create('br'));
+						}
+					}
+				} else {
+					// Wrap the block in a forcedRootBlock if we are at the root of document
+					if (parentNode == dom.getRoot()) {
+						if (!format.list_block || !isEq(node, format.list_block)) {
+							each(grep(node.childNodes), function(node) {
+								if (isValid(forcedRootBlock, node.nodeName.toLowerCase())) {
+									if (!rootBlockElm) {
+										rootBlockElm = wrap(node, forcedRootBlock);
+										dom.setAttribs(rootBlockElm, ed.settings.forced_root_block_attrs);
+									} else {
+										rootBlockElm.appendChild(node);
+									}
+								} else {
+									rootBlockElm = 0;
+								}
+							});
+						}
+					}
+				}
+			}
+
+			// Never remove nodes that isn't the specified inline element if a selector is specified too
+			if (format.selector && format.inline && !isEq(format.inline, node)) {
+				return;
+			}
+
+			dom.remove(node, 1);
+		}
+
+		/**
+		 * Returns the next/previous non whitespace node.
+		 *
+		 * @private
+		 * @param {Node} node Node to start at.
+		 * @param {boolean} next (Optional) Include next or previous node defaults to previous.
+		 * @param {boolean} inc (Optional) Include the current node in checking. Defaults to false.
+		 * @return {Node} Next or previous node or undefined if it wasn't found.
+		 */
+		function getNonWhiteSpaceSibling(node, next, inc) {
+			if (node) {
+				next = next ? 'nextSibling' : 'previousSibling';
+
+				for (node = inc ? node : node[next]; node; node = node[next]) {
+					if (node.nodeType == 1 || !isWhiteSpaceNode(node)) {
+						return node;
+					}
+				}
+			}
+		}
+
+		/**
+		 * Merges the next/previous sibling element if they match.
+		 *
+		 * @private
+		 * @param {Node} prev Previous node to compare/merge.
+		 * @param {Node} next Next node to compare/merge.
+		 * @return {Node} Next node if we didn't merge and prev node if we did.
+		 */
+		function mergeSiblings(prev, next) {
+			var sibling, tmpSibling, elementUtils = new ElementUtils(dom);
+
+			function findElementSibling(node, sibling_name) {
+				for (sibling = node; sibling; sibling = sibling[sibling_name]) {
+					if (sibling.nodeType == 3 && sibling.nodeValue.length !== 0) {
+						return node;
+					}
+
+					if (sibling.nodeType == 1 && !isBookmarkNode(sibling)) {
+						return sibling;
+					}
+				}
+
+				return node;
+			}
+
+			// Check if next/prev exists and that they are elements
+			if (prev && next) {
+				// If previous sibling is empty then jump over it
+				prev = findElementSibling(prev, 'previousSibling');
+				next = findElementSibling(next, 'nextSibling');
+
+				// Compare next and previous nodes
+				if (elementUtils.compare(prev, next)) {
+					// Append nodes between
+					for (sibling = prev.nextSibling; sibling && sibling != next;) {
+						tmpSibling = sibling;
+						sibling = sibling.nextSibling;
+						prev.appendChild(tmpSibling);
+					}
+
+					// Remove next node
+					dom.remove(next);
+
+					// Move children into prev node
+					each(grep(next.childNodes), function(node) {
+						prev.appendChild(node);
+					});
+
+					return prev;
+				}
+			}
+
+			return next;
+		}
+
+		function getContainer(rng, start) {
+			var container, offset, lastIdx;
+
+			container = rng[start ? 'startContainer' : 'endContainer'];
+			offset = rng[start ? 'startOffset' : 'endOffset'];
+
+			if (container.nodeType == 1) {
+				lastIdx = container.childNodes.length - 1;
+
+				if (!start && offset) {
+					offset--;
+				}
+
+				container = container.childNodes[offset > lastIdx ? lastIdx : offset];
+			}
+
+			// If start text node is excluded then walk to the next node
+			if (container.nodeType === 3 && start && offset >= container.nodeValue.length) {
+				container = new TreeWalker(container, ed.getBody()).next() || container;
+			}
+
+			// If end text node is excluded then walk to the previous node
+			if (container.nodeType === 3 && !start && offset === 0) {
+				container = new TreeWalker(container, ed.getBody()).prev() || container;
+			}
+
+			return container;
+		}
+
+		function performCaretAction(type, name, vars, similar) {
+			var caretContainerId = '_mce_caret', debug = ed.settings.caret_debug;
+
+			// Creates a caret container bogus element
+			function createCaretContainer(fill) {
+				var caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true, style: debug ? 'color:red' : ''});
+
+				if (fill) {
+					caretContainer.appendChild(ed.getDoc().createTextNode(INVISIBLE_CHAR));
+				}
+
+				return caretContainer;
+			}
+
+			function isCaretContainerEmpty(node, nodes) {
+				while (node) {
+					if ((node.nodeType === 3 && node.nodeValue !== INVISIBLE_CHAR) || node.childNodes.length > 1) {
+						return false;
+					}
+
+					// Collect nodes
+					if (nodes && node.nodeType === 1) {
+						nodes.push(node);
+					}
+
+					node = node.firstChild;
+				}
+
+				return true;
+			}
+
+			// Returns any parent caret container element
+			function getParentCaretContainer(node) {
+				while (node) {
+					if (node.id === caretContainerId) {
+						return node;
+					}
+
+					node = node.parentNode;
+				}
+			}
+
+			// Finds the first text node in the specified node
+			function findFirstTextNode(node) {
+				var walker;
+
+				if (node) {
+					walker = new TreeWalker(node, node);
+
+					for (node = walker.current(); node; node = walker.next()) {
+						if (node.nodeType === 3) {
+							return node;
+						}
+					}
+				}
+			}
+
+			// Removes the caret container for the specified node or all on the current document
+			function removeCaretContainer(node, move_caret) {
+				var child, rng;
+
+				if (!node) {
+					node = getParentCaretContainer(selection.getStart());
+
+					if (!node) {
+						while ((node = dom.get(caretContainerId))) {
+							removeCaretContainer(node, false);
+						}
+					}
+				} else {
+					rng = selection.getRng(true);
+
+					if (isCaretContainerEmpty(node)) {
+						if (move_caret !== false) {
+							rng.setStartBefore(node);
+							rng.setEndBefore(node);
+						}
+
+						dom.remove(node);
+					} else {
+						child = findFirstTextNode(node);
+
+						if (child.nodeValue.charAt(0) === INVISIBLE_CHAR) {
+							child.deleteData(0, 1);
+
+							// Fix for bug #6976
+							if (rng.startContainer == child && rng.startOffset > 0) {
+								rng.setStart(child, rng.startOffset - 1);
+							}
+
+							if (rng.endContainer == child && rng.endOffset > 0) {
+								rng.setEnd(child, rng.endOffset - 1);
+							}
+						}
+
+						dom.remove(node, 1);
+					}
+
+					selection.setRng(rng);
+				}
+			}
+
+			// Applies formatting to the caret postion
+			function applyCaretFormat() {
+				var rng, caretContainer, textNode, offset, bookmark, container, text;
+
+				rng = selection.getRng(true);
+				offset = rng.startOffset;
+				container = rng.startContainer;
+				text = container.nodeValue;
+
+				caretContainer = getParentCaretContainer(selection.getStart());
+				if (caretContainer) {
+					textNode = findFirstTextNode(caretContainer);
+				}
+
+				// Expand to word is caret is in the middle of a text node and the char before/after is a alpha numeric character
+				if (text && offset > 0 && offset < text.length && /\w/.test(text.charAt(offset)) && /\w/.test(text.charAt(offset - 1))) {
+					// Get bookmark of caret position
+					bookmark = selection.getBookmark();
+
+					// Collapse bookmark range (WebKit)
+					rng.collapse(true);
+
+					// Expand the range to the closest word and split it at those points
+					rng = expandRng(rng, get(name));
+					rng = rangeUtils.split(rng);
+
+					// Apply the format to the range
+					apply(name, vars, rng);
+
+					// Move selection back to caret position
+					selection.moveToBookmark(bookmark);
+				} else {
+					if (!caretContainer || textNode.nodeValue !== INVISIBLE_CHAR) {
+						caretContainer = createCaretContainer(true);
+						textNode = caretContainer.firstChild;
+
+						rng.insertNode(caretContainer);
+						offset = 1;
+
+						apply(name, vars, caretContainer);
+					} else {
+						apply(name, vars, caretContainer);
+					}
+
+					// Move selection to text node
+					selection.setCursorLocation(textNode, offset);
+				}
+			}
+
+			function removeCaretFormat() {
+				var rng = selection.getRng(true), container, offset, bookmark,
+					hasContentAfter, node, formatNode, parents = [], i, caretContainer;
+
+				container = rng.startContainer;
+				offset = rng.startOffset;
+				node = container;
+
+				if (container.nodeType == 3) {
+					if (offset != container.nodeValue.length) {
+						hasContentAfter = true;
+					}
+
+					node = node.parentNode;
+				}
+
+				while (node) {
+					if (matchNode(node, name, vars, similar)) {
+						formatNode = node;
+						break;
+					}
+
+					if (node.nextSibling) {
+						hasContentAfter = true;
+					}
+
+					parents.push(node);
+					node = node.parentNode;
+				}
+
+				// Node doesn't have the specified format
+				if (!formatNode) {
+					return;
+				}
+
+				// Is there contents after the caret then remove the format on the element
+				if (hasContentAfter) {
+					// Get bookmark of caret position
+					bookmark = selection.getBookmark();
+
+					// Collapse bookmark range (WebKit)
+					rng.collapse(true);
+
+					// Expand the range to the closest word and split it at those points
+					rng = expandRng(rng, get(name), true);
+					rng = rangeUtils.split(rng);
+
+					// Remove the format from the range
+					remove(name, vars, rng);
+
+					// Move selection back to caret position
+					selection.moveToBookmark(bookmark);
+				} else {
+					caretContainer = createCaretContainer();
+
+					node = caretContainer;
+					for (i = parents.length - 1; i >= 0; i--) {
+						node.appendChild(dom.clone(parents[i], false));
+						node = node.firstChild;
+					}
+
+					// Insert invisible character into inner most format element
+					node.appendChild(dom.doc.createTextNode(INVISIBLE_CHAR));
+					node = node.firstChild;
+
+					var block = dom.getParent(formatNode, isTextBlock);
+
+					if (block && dom.isEmpty(block)) {
+						// Replace formatNode with caretContainer when removing format from empty block like <p><b>|</b></p>
+						formatNode.parentNode.replaceChild(caretContainer, formatNode);
+					} else {
+						// Insert caret container after the formated node
+						dom.insertAfter(caretContainer, formatNode);
+					}
+
+					// Move selection to text node
+					selection.setCursorLocation(node, 1);
+
+					// If the formatNode is empty, we can remove it safely.
+					if (dom.isEmpty(formatNode)) {
+						dom.remove(formatNode);
+					}
+				}
+			}
+
+			// Checks if the parent caret container node isn't empty if that is the case it
+			// will remove the bogus state on all children that isn't empty
+			function unmarkBogusCaretParents() {
+				var caretContainer;
+
+				caretContainer = getParentCaretContainer(selection.getStart());
+				if (caretContainer && !dom.isEmpty(caretContainer)) {
+					walk(caretContainer, function(node) {
+						if (node.nodeType == 1 && node.id !== caretContainerId && !dom.isEmpty(node)) {
+							dom.setAttrib(node, 'data-mce-bogus', null);
+						}
+					}, 'childNodes');
+				}
+			}
+
+			// Only bind the caret events once
+			if (!ed._hasCaretEvents) {
+				// Mark current caret container elements as bogus when getting the contents so we don't end up with empty elements
+				markCaretContainersBogus = function() {
+					var nodes = [], i;
+
+					if (isCaretContainerEmpty(getParentCaretContainer(selection.getStart()), nodes)) {
+						// Mark children
+						i = nodes.length;
+						while (i--) {
+							dom.setAttrib(nodes[i], 'data-mce-bogus', '1');
+						}
+					}
+				};
+
+				disableCaretContainer = function(e) {
+					var keyCode = e.keyCode;
+
+					removeCaretContainer();
+
+					// Remove caret container on keydown and it's a backspace, enter or left/right arrow keys
+					// Backspace key needs to check if the range is collapsed due to bug #6780
+					if ((keyCode == 8 && selection.isCollapsed()) || keyCode == 37 || keyCode == 39) {
+						removeCaretContainer(getParentCaretContainer(selection.getStart()));
+					}
+
+					unmarkBogusCaretParents();
+				};
+
+				// Remove bogus state if they got filled by contents using editor.selection.setContent
+				ed.on('SetContent', function(e) {
+					if (e.selection) {
+						unmarkBogusCaretParents();
+					}
+				});
+				ed._hasCaretEvents = true;
+			}
+
+			// Do apply or remove caret format
+			if (type == "apply") {
+				applyCaretFormat();
+			} else {
+				removeCaretFormat();
+			}
+		}
+
+		/**
+		 * Moves the start to the first suitable text node.
+		 */
+		function moveStart(rng) {
+			var container = rng.startContainer,
+					offset = rng.startOffset, isAtEndOfText,
+					walker, node, nodes, tmpNode;
+
+			// Convert text node into index if possible
+			if (container.nodeType == 3 && offset >= container.nodeValue.length) {
+				// Get the parent container location and walk from there
+				offset = nodeIndex(container);
+				container = container.parentNode;
+				isAtEndOfText = true;
+			}
+
+			// Move startContainer/startOffset in to a suitable node
+			if (container.nodeType == 1) {
+				nodes = container.childNodes;
+				container = nodes[Math.min(offset, nodes.length - 1)];
+				walker = new TreeWalker(container, dom.getParent(container, dom.isBlock));
+
+				// If offset is at end of the parent node walk to the next one
+				if (offset > nodes.length - 1 || isAtEndOfText) {
+					walker.next();
+				}
+
+				for (node = walker.current(); node; node = walker.next()) {
+					if (node.nodeType == 3 && !isWhiteSpaceNode(node)) {
+						// IE has a "neat" feature where it moves the start node into the closest element
+						// we can avoid this by inserting an element before it and then remove it after we set the selection
+						tmpNode = dom.create('a', {'data-mce-bogus': 'all'}, INVISIBLE_CHAR);
+						node.parentNode.insertBefore(tmpNode, node);
+
+						// Set selection and remove tmpNode
+						rng.setStart(node, 0);
+						selection.setRng(rng);
+						dom.remove(tmpNode);
+
+						return;
+					}
+				}
+			}
+		}
+	};
+});
+
+// Included from: js/tinymce/classes/UndoManager.js
+
+/**
+ * UndoManager.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles the undo/redo history levels for the editor. Since the build in undo/redo has major drawbacks a custom one was needed.
+ *
+ * @class tinymce.UndoManager
+ */
+define("tinymce/UndoManager", [
+	"tinymce/util/VK",
+	"tinymce/Env",
+	"tinymce/util/Tools",
+	"tinymce/html/SaxParser"
+], function(VK, Env, Tools, SaxParser) {
+	var trim = Tools.trim, trimContentRegExp;
+
+	trimContentRegExp = new RegExp([
+		'<span[^>]+data-mce-bogus[^>]+>[\u200B\uFEFF]+<\\/span>', // Trim bogus spans like caret containers
+		'\\s?data-mce-selected="[^"]+"' // Trim temporaty data-mce prefixed attributes like data-mce-selected
+	].join('|'), 'gi');
+
+	return function(editor) {
+		var self = this, index = 0, data = [], beforeBookmark, isFirstTypedCharacter, locks = 0;
+
+		/**
+		 * Returns a trimmed version of the editor contents to be used for the undo level. This
+		 * will remove any data-mce-bogus="all" marked elements since these are used for UI it will also
+		 * remove the data-mce-selected attributes used for selection of objects and caret containers.
+		 * It will keep all data-mce-bogus="1" elements since these can be used to place the caret etc and will
+		 * be removed by the serialization logic when you save.
+		 *
+		 * @private
+		 * @return {String} HTML contents of the editor excluding some internal bogus elements.
+		 */
+		function getContent() {
+			var content = editor.getContent({format: 'raw', no_events: 1});
+			var bogusAllRegExp = /<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g;
+			var endTagIndex, index, matchLength, matches, shortEndedElements, schema = editor.schema;
+
+			content = content.replace(trimContentRegExp, '');
+			shortEndedElements = schema.getShortEndedElements();
+
+			// Remove all bogus elements marked with "all"
+			while ((matches = bogusAllRegExp.exec(content))) {
+				index = bogusAllRegExp.lastIndex;
+				matchLength = matches[0].length;
+
+				if (shortEndedElements[matches[1]]) {
+					endTagIndex = index;
+				} else {
+					endTagIndex = SaxParser.findEndTag(schema, content, index);
+				}
+
+				content = content.substring(0, index - matchLength) + content.substring(endTagIndex);
+				bogusAllRegExp.lastIndex = index - matchLength;
+			}
+
+			return trim(content);
+		}
+
+		function setDirty(state) {
+			editor.isNotDirty = !state;
+		}
+
+		function addNonTypingUndoLevel(e) {
+			self.typing = false;
+			self.add({}, e);
+		}
+
+		// Add initial undo level when the editor is initialized
+		editor.on('init', function() {
+			self.add();
+		});
+
+		// Get position before an execCommand is processed
+		editor.on('BeforeExecCommand', function(e) {
+			var cmd = e.command;
+
+			if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint') {
+				self.beforeChange();
+			}
+		});
+
+		// Add undo level after an execCommand call was made
+		editor.on('ExecCommand', function(e) {
+			var cmd = e.command;
+
+			if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint') {
+				addNonTypingUndoLevel(e);
+			}
+		});
+
+		editor.on('ObjectResizeStart', function() {
+			self.beforeChange();
+		});
+
+		editor.on('SaveContent ObjectResized blur', addNonTypingUndoLevel);
+		editor.on('DragEnd', addNonTypingUndoLevel);
+
+		editor.on('KeyUp', function(e) {
+			var keyCode = e.keyCode;
+
+			if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 45 || keyCode == 13 || e.ctrlKey) {
+				addNonTypingUndoLevel();
+				editor.nodeChanged();
+			}
+
+			if (keyCode == 46 || keyCode == 8 || (Env.mac && (keyCode == 91 || keyCode == 93))) {
+				editor.nodeChanged();
+			}
+
+			// Fire a TypingUndo event on the first character entered
+			if (isFirstTypedCharacter && self.typing) {
+				// Make it dirty if the content was changed after typing the first character
+				if (!editor.isDirty()) {
+					setDirty(data[0] && getContent() != data[0].content);
+
+					// Fire initial change event
+					if (!editor.isNotDirty) {
+						editor.fire('change', {level: data[0], lastLevel: null});
+					}
+				}
+
+				editor.fire('TypingUndo');
+				isFirstTypedCharacter = false;
+				editor.nodeChanged();
+			}
+		});
+
+		editor.on('KeyDown', function(e) {
+			var keyCode = e.keyCode;
+
+			// Is caracter positon keys left,right,up,down,home,end,pgdown,pgup,enter
+			if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 45) {
+				if (self.typing) {
+					addNonTypingUndoLevel(e);
+				}
+
+				return;
+			}
+
+			// If key isn't Ctrl+Alt/AltGr
+			var modKey = (e.ctrlKey && !e.altKey) || e.metaKey;
+			if ((keyCode < 16 || keyCode > 20) && keyCode != 224 && keyCode != 91 && !self.typing && !modKey) {
+				self.beforeChange();
+				self.typing = true;
+				self.add({}, e);
+				isFirstTypedCharacter = true;
+			}
+		});
+
+		editor.on('MouseDown', function(e) {
+			if (self.typing) {
+				addNonTypingUndoLevel(e);
+			}
+		});
+
+		// Add keyboard shortcuts for undo/redo keys
+		editor.addShortcut('meta+z', '', 'Undo');
+		editor.addShortcut('meta+y,meta+shift+z', '', 'Redo');
+
+		editor.on('AddUndo Undo Redo ClearUndos', function(e) {
+			if (!e.isDefaultPrevented()) {
+				editor.nodeChanged();
+			}
+		});
+
+		/*eslint consistent-this:0 */
+		self = {
+			// Explose for debugging reasons
+			data: data,
+
+			/**
+			 * State if the user is currently typing or not. This will add a typing operation into one undo
+			 * level instead of one new level for each keystroke.
+			 *
+			 * @field {Boolean} typing
+			 */
+			typing: false,
+
+			/**
+			 * Stores away a bookmark to be used when performing an undo action so that the selection is before
+			 * the change has been made.
+			 *
+			 * @method beforeChange
+			 */
+			beforeChange: function() {
+				if (!locks) {
+					beforeBookmark = editor.selection.getBookmark(2, true);
+				}
+			},
+
+			/**
+			 * Adds a new undo level/snapshot to the undo list.
+			 *
+			 * @method add
+			 * @param {Object} level Optional undo level object to add.
+			 * @param {DOMEvent} Event Optional event responsible for the creation of the undo level.
+			 * @return {Object} Undo level that got added or null it a level wasn't needed.
+			 */
+			add: function(level, event) {
+				var i, settings = editor.settings, lastLevel;
+
+				level = level || {};
+				level.content = getContent();
+
+				if (locks || editor.removed) {
+					return null;
+				}
+
+				lastLevel = data[index];
+				if (editor.fire('BeforeAddUndo', {level: level, lastLevel: lastLevel, originalEvent: event}).isDefaultPrevented()) {
+					return null;
+				}
+
+				// Add undo level if needed
+				if (lastLevel && lastLevel.content == level.content) {
+					return null;
+				}
+
+				// Set before bookmark on previous level
+				if (data[index]) {
+					data[index].beforeBookmark = beforeBookmark;
+				}
+
+				// Time to compress
+				if (settings.custom_undo_redo_levels) {
+					if (data.length > settings.custom_undo_redo_levels) {
+						for (i = 0; i < data.length - 1; i++) {
+							data[i] = data[i + 1];
+						}
+
+						data.length--;
+						index = data.length;
+					}
+				}
+
+				// Get a non intrusive normalized bookmark
+				level.bookmark = editor.selection.getBookmark(2, true);
+
+				// Crop array if needed
+				if (index < data.length - 1) {
+					data.length = index + 1;
+				}
+
+				data.push(level);
+				index = data.length - 1;
+
+				var args = {level: level, lastLevel: lastLevel, originalEvent: event};
+
+				editor.fire('AddUndo', args);
+
+				if (index > 0) {
+					setDirty(true);
+					editor.fire('change', args);
+				}
+
+				return level;
+			},
+
+			/**
+			 * Undoes the last action.
+			 *
+			 * @method undo
+			 * @return {Object} Undo level or null if no undo was performed.
+			 */
+			undo: function() {
+				var level;
+
+				if (self.typing) {
+					self.add();
+					self.typing = false;
+				}
+
+				if (index > 0) {
+					level = data[--index];
+
+					// Undo to first index then set dirty state to false
+					if (index === 0) {
+						setDirty(false);
+					}
+
+					editor.setContent(level.content, {format: 'raw'});
+					editor.selection.moveToBookmark(level.beforeBookmark);
+
+					editor.fire('undo', {level: level});
+				}
+
+				return level;
+			},
+
+			/**
+			 * Redoes the last action.
+			 *
+			 * @method redo
+			 * @return {Object} Redo level or null if no redo was performed.
+			 */
+			redo: function() {
+				var level;
+
+				if (index < data.length - 1) {
+					level = data[++index];
+
+					editor.setContent(level.content, {format: 'raw'});
+					editor.selection.moveToBookmark(level.bookmark);
+					setDirty(true);
+
+					editor.fire('redo', {level: level});
+				}
+
+				return level;
+			},
+
+			/**
+			 * Removes all undo levels.
+			 *
+			 * @method clear
+			 */
+			clear: function() {
+				data = [];
+				index = 0;
+				self.typing = false;
+				editor.fire('ClearUndos');
+			},
+
+			/**
+			 * Returns true/false if the undo manager has any undo levels.
+			 *
+			 * @method hasUndo
+			 * @return {Boolean} true/false if the undo manager has any undo levels.
+			 */
+			hasUndo: function() {
+				// Has undo levels or typing and content isn't the same as the initial level
+				return index > 0 || (self.typing && data[0] && getContent() != data[0].content);
+			},
+
+			/**
+			 * Returns true/false if the undo manager has any redo levels.
+			 *
+			 * @method hasRedo
+			 * @return {Boolean} true/false if the undo manager has any redo levels.
+			 */
+			hasRedo: function() {
+				return index < data.length - 1 && !this.typing;
+			},
+
+			/**
+			 * Executes the specified function in an undo transation. The selection
+			 * before the modification will be stored to the undo stack and if the DOM changes
+			 * it will add a new undo level. Any methods within the transation that adds undo levels will
+			 * be ignored. So a transation can include calls to execCommand or editor.insertContent.
+			 *
+			 * @method transact
+			 * @param {function} callback Function to execute dom manipulation logic in.
+			 */
+			transact: function(callback) {
+				self.beforeChange();
+
+				try {
+					locks++;
+					callback();
+				} finally {
+					locks--;
+				}
+
+				self.add();
+			}
+		};
+
+		return self;
+	};
+});
+
+// Included from: js/tinymce/classes/EnterKey.js
+
+/**
+ * EnterKey.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Contains logic for handling the enter key to split/generate block elements.
+ */
+define("tinymce/EnterKey", [
+	"tinymce/dom/TreeWalker",
+	"tinymce/dom/RangeUtils",
+	"tinymce/Env"
+], function(TreeWalker, RangeUtils, Env) {
+	var isIE = Env.ie && Env.ie < 11;
+
+	return function(editor) {
+		var dom = editor.dom, selection = editor.selection, settings = editor.settings;
+		var undoManager = editor.undoManager, schema = editor.schema, nonEmptyElementsMap = schema.getNonEmptyElements(),
+			moveCaretBeforeOnEnterElementsMap = schema.getMoveCaretBeforeOnEnterElements();
+
+		function handleEnterKey(evt) {
+			var rng, tmpRng, editableRoot, container, offset, parentBlock, documentMode, shiftKey,
+				newBlock, fragment, containerBlock, parentBlockName, containerBlockName, newBlockName, isAfterLastNodeInContainer;
+
+			// Returns true if the block can be split into two blocks or not
+			function canSplitBlock(node) {
+				return node &&
+					dom.isBlock(node) &&
+					!/^(TD|TH|CAPTION|FORM)$/.test(node.nodeName) &&
+					!/^(fixed|absolute)/i.test(node.style.position) &&
+					dom.getContentEditable(node) !== "true";
+			}
+
+			// Renders empty block on IE
+			function renderBlockOnIE(block) {
+				var oldRng;
+
+				if (dom.isBlock(block)) {
+					oldRng = selection.getRng();
+					block.appendChild(dom.create('span', null, '\u00a0'));
+					selection.select(block);
+					block.lastChild.outerHTML = '';
+					selection.setRng(oldRng);
+				}
+			}
+
+			// Remove the first empty inline element of the block so this: <p><b><em></em></b>x</p> becomes this: <p>x</p>
+			function trimInlineElementsOnLeftSideOfBlock(block) {
+				var node = block, firstChilds = [], i;
+
+				if (!node) {
+					return;
+				}
+
+				// Find inner most first child ex: <p><i><b>*</b></i></p>
+				while ((node = node.firstChild)) {
+					if (dom.isBlock(node)) {
+						return;
+					}
+
+					if (node.nodeType == 1 && !nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
+						firstChilds.push(node);
+					}
+				}
+
+				i = firstChilds.length;
+				while (i--) {
+					node = firstChilds[i];
+					if (!node.hasChildNodes() || (node.firstChild == node.lastChild && node.firstChild.nodeValue === '')) {
+						dom.remove(node);
+					} else {
+						// Remove <a> </a> see #5381
+						if (node.nodeName == "A" && (node.innerText || node.textContent) === ' ') {
+							dom.remove(node);
+						}
+					}
+				}
+			}
+
+			// Moves the caret to a suitable position within the root for example in the first non
+			// pure whitespace text node or before an image
+			function moveToCaretPosition(root) {
+				var walker, node, rng, lastNode = root, tempElm;
+				function firstNonWhiteSpaceNodeSibling(node) {
+					while (node) {
+						if (node.nodeType == 1 || (node.nodeType == 3 && node.data && /[\r\n\s]/.test(node.data))) {
+							return node;
+						}
+
+						node = node.nextSibling;
+					}
+				}
+
+				if (!root) {
+					return;
+				}
+
+				// Old IE versions doesn't properly render blocks with br elements in them
+				// For example <p><br></p> wont be rendered correctly in a contentEditable area
+				// until you remove the br producing <p></p>
+				if (Env.ie && Env.ie < 9 && parentBlock && parentBlock.firstChild) {
+					if (parentBlock.firstChild == parentBlock.lastChild && parentBlock.firstChild.tagName == 'BR') {
+						dom.remove(parentBlock.firstChild);
+					}
+				}
+
+				if (/^(LI|DT|DD)$/.test(root.nodeName)) {
+					var firstChild = firstNonWhiteSpaceNodeSibling(root.firstChild);
+
+					if (firstChild && /^(UL|OL|DL)$/.test(firstChild.nodeName)) {
+						root.insertBefore(dom.doc.createTextNode('\u00a0'), root.firstChild);
+					}
+				}
+
+				rng = dom.createRng();
+
+				// Normalize whitespace to remove empty text nodes. Fix for: #6904
+				// Gecko will be able to place the caret in empty text nodes but it won't render propery
+				// Older IE versions will sometimes crash so for now ignore all IE versions
+				if (!Env.ie) {
+					root.normalize();
+				}
+
+				if (root.hasChildNodes()) {
+					walker = new TreeWalker(root, root);
+
+					while ((node = walker.current())) {
+						if (node.nodeType == 3) {
+							rng.setStart(node, 0);
+							rng.setEnd(node, 0);
+							break;
+						}
+
+						if (moveCaretBeforeOnEnterElementsMap[node.nodeName.toLowerCase()]) {
+							rng.setStartBefore(node);
+							rng.setEndBefore(node);
+							break;
+						}
+
+						lastNode = node;
+						node = walker.next();
+					}
+
+					if (!node) {
+						rng.setStart(lastNode, 0);
+						rng.setEnd(lastNode, 0);
+					}
+				} else {
+					if (root.nodeName == 'BR') {
+						if (root.nextSibling && dom.isBlock(root.nextSibling)) {
+							// Trick on older IE versions to render the caret before the BR between two lists
+							if (!documentMode || documentMode < 9) {
+								tempElm = dom.create('br');
+								root.parentNode.insertBefore(tempElm, root);
+							}
+
+							rng.setStartBefore(root);
+							rng.setEndBefore(root);
+						} else {
+							rng.setStartAfter(root);
+							rng.setEndAfter(root);
+						}
+					} else {
+						rng.setStart(root, 0);
+						rng.setEnd(root, 0);
+					}
+				}
+
+				selection.setRng(rng);
+
+				// Remove tempElm created for old IE:s
+				dom.remove(tempElm);
+				selection.scrollIntoView(root);
+			}
+
+			function setForcedBlockAttrs(node) {
+				var forcedRootBlockName = settings.forced_root_block;
+
+				if (forcedRootBlockName && forcedRootBlockName.toLowerCase() === node.tagName.toLowerCase()) {
+					dom.setAttribs(node, settings.forced_root_block_attrs);
+				}
+			}
+
+			// Creates a new block element by cloning the current one or creating a new one if the name is specified
+			// This function will also copy any text formatting from the parent block and add it to the new one
+			function createNewBlock(name) {
+				var node = container, block, clonedNode, caretNode, textInlineElements = schema.getTextInlineElements();
+
+				if (name || parentBlockName == "TABLE") {
+					block = dom.create(name || newBlockName);
+					setForcedBlockAttrs(block);
+				} else {
+					block = parentBlock.cloneNode(false);
+				}
+
+				caretNode = block;
+
+				// Clone any parent styles
+				if (settings.keep_styles !== false) {
+					do {
+						if (textInlineElements[node.nodeName]) {
+							// Never clone a caret containers
+							if (node.id == '_mce_caret') {
+								continue;
+							}
+
+							clonedNode = node.cloneNode(false);
+							dom.setAttrib(clonedNode, 'id', ''); // Remove ID since it needs to be document unique
+
+							if (block.hasChildNodes()) {
+								clonedNode.appendChild(block.firstChild);
+								block.appendChild(clonedNode);
+							} else {
+								caretNode = clonedNode;
+								block.appendChild(clonedNode);
+							}
+						}
+					} while ((node = node.parentNode));
+				}
+
+				// BR is needed in empty blocks on non IE browsers
+				if (!isIE) {
+					caretNode.innerHTML = '<br data-mce-bogus="1">';
+				}
+
+				return block;
+			}
+
+			// Returns true/false if the caret is at the start/end of the parent block element
+			function isCaretAtStartOrEndOfBlock(start) {
+				var walker, node, name;
+
+				// Caret is in the middle of a text node like "a|b"
+				if (container.nodeType == 3 && (start ? offset > 0 : offset < container.nodeValue.length)) {
+					return false;
+				}
+
+				// If after the last element in block node edge case for #5091
+				if (container.parentNode == parentBlock && isAfterLastNodeInContainer && !start) {
+					return true;
+				}
+
+				// If the caret if before the first element in parentBlock
+				if (start && container.nodeType == 1 && container == parentBlock.firstChild) {
+					return true;
+				}
+
+				// Caret can be before/after a table
+				if (container.nodeName === "TABLE" || (container.previousSibling && container.previousSibling.nodeName == "TABLE")) {
+					return (isAfterLastNodeInContainer && !start) || (!isAfterLastNodeInContainer && start);
+				}
+
+				// Walk the DOM and look for text nodes or non empty elements
+				walker = new TreeWalker(container, parentBlock);
+
+				// If caret is in beginning or end of a text block then jump to the next/previous node
+				if (container.nodeType == 3) {
+					if (start && offset === 0) {
+						walker.prev();
+					} else if (!start && offset == container.nodeValue.length) {
+						walker.next();
+					}
+				}
+
+				while ((node = walker.current())) {
+					if (node.nodeType === 1) {
+						// Ignore bogus elements
+						if (!node.getAttribute('data-mce-bogus')) {
+							// Keep empty elements like <img /> <input /> but not trailing br:s like <p>text|<br></p>
+							name = node.nodeName.toLowerCase();
+							if (nonEmptyElementsMap[name] && name !== 'br') {
+								return false;
+							}
+						}
+					} else if (node.nodeType === 3 && !/^[ \t\r\n]*$/.test(node.nodeValue)) {
+						return false;
+					}
+
+					if (start) {
+						walker.prev();
+					} else {
+						walker.next();
+					}
+				}
+
+				return true;
+			}
+
+			// Wraps any text nodes or inline elements in the specified forced root block name
+			function wrapSelfAndSiblingsInDefaultBlock(container, offset) {
+				var newBlock, parentBlock, startNode, node, next, rootBlockName, blockName = newBlockName || 'P';
+
+				// Not in a block element or in a table cell or caption
+				parentBlock = dom.getParent(container, dom.isBlock);
+				rootBlockName = editor.getBody().nodeName.toLowerCase();
+				if (!parentBlock || !canSplitBlock(parentBlock)) {
+					parentBlock = parentBlock || editableRoot;
+
+					if (!parentBlock.hasChildNodes()) {
+						newBlock = dom.create(blockName);
+						setForcedBlockAttrs(newBlock);
+						parentBlock.appendChild(newBlock);
+						rng.setStart(newBlock, 0);
+						rng.setEnd(newBlock, 0);
+						return newBlock;
+					}
+
+					// Find parent that is the first child of parentBlock
+					node = container;
+					while (node.parentNode != parentBlock) {
+						node = node.parentNode;
+					}
+
+					// Loop left to find start node start wrapping at
+					while (node && !dom.isBlock(node)) {
+						startNode = node;
+						node = node.previousSibling;
+					}
+
+					if (startNode && schema.isValidChild(rootBlockName, blockName.toLowerCase())) {
+						newBlock = dom.create(blockName);
+						setForcedBlockAttrs(newBlock);
+						startNode.parentNode.insertBefore(newBlock, startNode);
+
+						// Start wrapping until we hit a block
+						node = startNode;
+						while (node && !dom.isBlock(node)) {
+							next = node.nextSibling;
+							newBlock.appendChild(node);
+							node = next;
+						}
+
+						// Restore range to it's past location
+						rng.setStart(container, offset);
+						rng.setEnd(container, offset);
+					}
+				}
+
+				return container;
+			}
+
+			// Inserts a block or br before/after or in the middle of a split list of the LI is empty
+			function handleEmptyListItem() {
+				function isFirstOrLastLi(first) {
+					var node = containerBlock[first ? 'firstChild' : 'lastChild'];
+
+					// Find first/last element since there might be whitespace there
+					while (node) {
+						if (node.nodeType == 1) {
+							break;
+						}
+
+						node = node[first ? 'nextSibling' : 'previousSibling'];
+					}
+
+					return node === parentBlock;
+				}
+
+				function getContainerBlock() {
+					var containerBlockParent = containerBlock.parentNode;
+
+					if (/^(LI|DT|DD)$/.test(containerBlockParent.nodeName)) {
+						return containerBlockParent;
+					}
+
+					return containerBlock;
+				}
+
+				// Check if we are in an nested list
+				var containerBlockParentName = containerBlock.parentNode.nodeName;
+				if (/^(OL|UL|LI)$/.test(containerBlockParentName)) {
+					newBlockName = 'LI';
+				}
+
+				newBlock = newBlockName ? createNewBlock(newBlockName) : dom.create('BR');
+
+				if (isFirstOrLastLi(true) && isFirstOrLastLi()) {
+					if (containerBlockParentName == 'LI') {
+						// Nested list is inside a LI
+						dom.insertAfter(newBlock, getContainerBlock());
+					} else {
+						// Is first and last list item then replace the OL/UL with a text block
+						dom.replace(newBlock, containerBlock);
+					}
+				} else if (isFirstOrLastLi(true)) {
+					if (containerBlockParentName == 'LI') {
+						// List nested in an LI then move the list to a new sibling LI
+						dom.insertAfter(newBlock, getContainerBlock());
+						newBlock.appendChild(dom.doc.createTextNode(' ')); // Needed for IE so the caret can be placed
+						newBlock.appendChild(containerBlock);
+					} else {
+						// First LI in list then remove LI and add text block before list
+						containerBlock.parentNode.insertBefore(newBlock, containerBlock);
+					}
+				} else if (isFirstOrLastLi()) {
+					// Last LI in list then remove LI and add text block after list
+					dom.insertAfter(newBlock, getContainerBlock());
+					renderBlockOnIE(newBlock);
+				} else {
+					// Middle LI in list the split the list and insert a text block in the middle
+					// Extract after fragment and insert it after the current block
+					containerBlock = getContainerBlock();
+					tmpRng = rng.cloneRange();
+					tmpRng.setStartAfter(parentBlock);
+					tmpRng.setEndAfter(containerBlock);
+					fragment = tmpRng.extractContents();
+
+					if (newBlockName == 'LI' && fragment.firstChild.nodeName == 'LI') {
+						newBlock = fragment.firstChild;
+						dom.insertAfter(fragment, containerBlock);
+					} else {
+						dom.insertAfter(fragment, containerBlock);
+						dom.insertAfter(newBlock, containerBlock);
+					}
+				}
+
+				dom.remove(parentBlock);
+				moveToCaretPosition(newBlock);
+				undoManager.add();
+			}
+
+			// Inserts a BR element if the forced_root_block option is set to false or empty string
+			function insertBr() {
+				editor.execCommand("InsertLineBreak", false, evt);
+			}
+
+			// Trims any linebreaks at the beginning of node user for example when pressing enter in a PRE element
+			function trimLeadingLineBreaks(node) {
+				do {
+					if (node.nodeType === 3) {
+						node.nodeValue = node.nodeValue.replace(/^[\r\n]+/, '');
+					}
+
+					node = node.firstChild;
+				} while (node);
+			}
+
+			function getEditableRoot(node) {
+				var root = dom.getRoot(), parent, editableRoot;
+
+				// Get all parents until we hit a non editable parent or the root
+				parent = node;
+				while (parent !== root && dom.getContentEditable(parent) !== "false") {
+					if (dom.getContentEditable(parent) === "true") {
+						editableRoot = parent;
+					}
+
+					parent = parent.parentNode;
+				}
+
+				return parent !== root ? editableRoot : root;
+			}
+
+			// Adds a BR at the end of blocks that only contains an IMG or INPUT since
+			// these might be floated and then they won't expand the block
+			function addBrToBlockIfNeeded(block) {
+				var lastChild;
+
+				// IE will render the blocks correctly other browsers needs a BR
+				if (!isIE) {
+					block.normalize(); // Remove empty text nodes that got left behind by the extract
+
+					// Check if the block is empty or contains a floated last child
+					lastChild = block.lastChild;
+					if (!lastChild || (/^(left|right)$/gi.test(dom.getStyle(lastChild, 'float', true)))) {
+						dom.add(block, 'br');
+					}
+				}
+			}
+
+			rng = selection.getRng(true);
+
+			// Event is blocked by some other handler for example the lists plugin
+			if (evt.isDefaultPrevented()) {
+				return;
+			}
+
+			// Delete any selected contents
+			if (!rng.collapsed) {
+				editor.execCommand('Delete');
+				return;
+			}
+
+			// Setup range items and newBlockName
+			new RangeUtils(dom).normalize(rng);
+			container = rng.startContainer;
+			offset = rng.startOffset;
+			newBlockName = (settings.force_p_newlines ? 'p' : '') || settings.forced_root_block;
+			newBlockName = newBlockName ? newBlockName.toUpperCase() : '';
+			documentMode = dom.doc.documentMode;
+			shiftKey = evt.shiftKey;
+
+			// Resolve node index
+			if (container.nodeType == 1 && container.hasChildNodes()) {
+				isAfterLastNodeInContainer = offset > container.childNodes.length - 1;
+
+				container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container;
+				if (isAfterLastNodeInContainer && container.nodeType == 3) {
+					offset = container.nodeValue.length;
+				} else {
+					offset = 0;
+				}
+			}
+
+			// Get editable root node normaly the body element but sometimes a div or span
+			editableRoot = getEditableRoot(container);
+
+			// If there is no editable root then enter is done inside a contentEditable false element
+			if (!editableRoot) {
+				return;
+			}
+
+			undoManager.beforeChange();
+
+			// If editable root isn't block nor the root of the editor
+			if (!dom.isBlock(editableRoot) && editableRoot != dom.getRoot()) {
+				if (!newBlockName || shiftKey) {
+					insertBr();
+				}
+
+				return;
+			}
+
+			// Wrap the current node and it's sibling in a default block if it's needed.
+			// for example this <td>text|<b>text2</b></td> will become this <td><p>text|<b>text2</p></b></td>
+			// This won't happen if root blocks are disabled or the shiftKey is pressed
+			if ((newBlockName && !shiftKey) || (!newBlockName && shiftKey)) {
+				container = wrapSelfAndSiblingsInDefaultBlock(container, offset);
+			}
+
+			// Find parent block and setup empty block paddings
+			parentBlock = dom.getParent(container, dom.isBlock);
+			containerBlock = parentBlock ? dom.getParent(parentBlock.parentNode, dom.isBlock) : null;
+
+			// Setup block names
+			parentBlockName = parentBlock ? parentBlock.nodeName.toUpperCase() : ''; // IE < 9 & HTML5
+			containerBlockName = containerBlock ? containerBlock.nodeName.toUpperCase() : ''; // IE < 9 & HTML5
+
+			// Enter inside block contained within a LI then split or insert before/after LI
+			if (containerBlockName == 'LI' && !evt.ctrlKey) {
+				parentBlock = containerBlock;
+				parentBlockName = containerBlockName;
+			}
+
+			// Handle enter in list item
+			if (/^(LI|DT|DD)$/.test(parentBlockName)) {
+				if (!newBlockName && shiftKey) {
+					insertBr();
+					return;
+				}
+
+				// Handle enter inside an empty list item
+				if (dom.isEmpty(parentBlock)) {
+					handleEmptyListItem();
+					return;
+				}
+			}
+
+			// Don't split PRE tags but insert a BR instead easier when writing code samples etc
+			if (parentBlockName == 'PRE' && settings.br_in_pre !== false) {
+				if (!shiftKey) {
+					insertBr();
+					return;
+				}
+			} else {
+				// If no root block is configured then insert a BR by default or if the shiftKey is pressed
+				if ((!newBlockName && !shiftKey && parentBlockName != 'LI') || (newBlockName && shiftKey)) {
+					insertBr();
+					return;
+				}
+			}
+
+			// If parent block is root then never insert new blocks
+			if (newBlockName && parentBlock === editor.getBody()) {
+				return;
+			}
+
+			// Default block name if it's not configured
+			newBlockName = newBlockName || 'P';
+
+			// Insert new block before/after the parent block depending on caret location
+			if (isCaretAtStartOrEndOfBlock()) {
+				// If the caret is at the end of a header we produce a P tag after it similar to Word unless we are in a hgroup
+				if (/^(H[1-6]|PRE|FIGURE)$/.test(parentBlockName) && containerBlockName != 'HGROUP') {
+					newBlock = createNewBlock(newBlockName);
+				} else {
+					newBlock = createNewBlock();
+				}
+
+				// Split the current container block element if enter is pressed inside an empty inner block element
+				if (settings.end_container_on_empty_block && canSplitBlock(containerBlock) && dom.isEmpty(parentBlock)) {
+					// Split container block for example a BLOCKQUOTE at the current blockParent location for example a P
+					newBlock = dom.split(containerBlock, parentBlock);
+				} else {
+					dom.insertAfter(newBlock, parentBlock);
+				}
+
+				moveToCaretPosition(newBlock);
+			} else if (isCaretAtStartOrEndOfBlock(true)) {
+				// Insert new block before
+				newBlock = parentBlock.parentNode.insertBefore(createNewBlock(), parentBlock);
+				renderBlockOnIE(newBlock);
+				moveToCaretPosition(parentBlock);
+			} else {
+				// Extract after fragment and insert it after the current block
+				tmpRng = rng.cloneRange();
+				tmpRng.setEndAfter(parentBlock);
+				fragment = tmpRng.extractContents();
+				trimLeadingLineBreaks(fragment);
+				newBlock = fragment.firstChild;
+				dom.insertAfter(fragment, parentBlock);
+				trimInlineElementsOnLeftSideOfBlock(newBlock);
+				addBrToBlockIfNeeded(parentBlock);
+				moveToCaretPosition(newBlock);
+			}
+
+			dom.setAttrib(newBlock, 'id', ''); // Remove ID since it needs to be document unique
+
+			// Allow custom handling of new blocks
+			editor.fire('NewBlock', {newBlock: newBlock});
+
+			undoManager.add();
+		}
+
+		editor.on('keydown', function(evt) {
+			if (evt.keyCode == 13) {
+				if (handleEnterKey(evt) !== false) {
+					evt.preventDefault();
+				}
+			}
+		});
+	};
+});
+
+// Included from: js/tinymce/classes/ForceBlocks.js
+
+/**
+ * ForceBlocks.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+define("tinymce/ForceBlocks", [], function() {
+	return function(editor) {
+		var settings = editor.settings, dom = editor.dom, selection = editor.selection;
+		var schema = editor.schema, blockElements = schema.getBlockElements();
+
+		function addRootBlocks() {
+			var node = selection.getStart(), rootNode = editor.getBody(), rng;
+			var startContainer, startOffset, endContainer, endOffset, rootBlockNode;
+			var tempNode, offset = -0xFFFFFF, wrapped, restoreSelection;
+			var tmpRng, rootNodeName, forcedRootBlock;
+
+			forcedRootBlock = settings.forced_root_block;
+
+			if (!node || node.nodeType !== 1 || !forcedRootBlock) {
+				return;
+			}
+
+			// Check if node is wrapped in block
+			while (node && node != rootNode) {
+				if (blockElements[node.nodeName]) {
+					return;
+				}
+
+				node = node.parentNode;
+			}
+
+			// Get current selection
+			rng = selection.getRng();
+			if (rng.setStart) {
+				startContainer = rng.startContainer;
+				startOffset = rng.startOffset;
+				endContainer = rng.endContainer;
+				endOffset = rng.endOffset;
+
+				try {
+					restoreSelection = editor.getDoc().activeElement === rootNode;
+				} catch (ex) {
+					// IE throws unspecified error here sometimes
+				}
+			} else {
+				// Force control range into text range
+				if (rng.item) {
+					node = rng.item(0);
+					rng = editor.getDoc().body.createTextRange();
+					rng.moveToElementText(node);
+				}
+
+				restoreSelection = rng.parentElement().ownerDocument === editor.getDoc();
+				tmpRng = rng.duplicate();
+				tmpRng.collapse(true);
+				startOffset = tmpRng.move('character', offset) * -1;
+
+				if (!tmpRng.collapsed) {
+					tmpRng = rng.duplicate();
+					tmpRng.collapse(false);
+					endOffset = (tmpRng.move('character', offset) * -1) - startOffset;
+				}
+			}
+
+			// Wrap non block elements and text nodes
+			node = rootNode.firstChild;
+			rootNodeName = rootNode.nodeName.toLowerCase();
+			while (node) {
+				// TODO: Break this up, too complex
+				if (((node.nodeType === 3 || (node.nodeType == 1 && !blockElements[node.nodeName]))) &&
+					schema.isValidChild(rootNodeName, forcedRootBlock.toLowerCase())) {
+					// Remove empty text nodes
+					if (node.nodeType === 3 && node.nodeValue.length === 0) {
+						tempNode = node;
+						node = node.nextSibling;
+						dom.remove(tempNode);
+						continue;
+					}
+
+					if (!rootBlockNode) {
+						rootBlockNode = dom.create(forcedRootBlock, editor.settings.forced_root_block_attrs);
+						node.parentNode.insertBefore(rootBlockNode, node);
+						wrapped = true;
+					}
+
+					tempNode = node;
+					node = node.nextSibling;
+					rootBlockNode.appendChild(tempNode);
+				} else {
+					rootBlockNode = null;
+					node = node.nextSibling;
+				}
+			}
+
+			if (wrapped && restoreSelection) {
+				if (rng.setStart) {
+					rng.setStart(startContainer, startOffset);
+					rng.setEnd(endContainer, endOffset);
+					selection.setRng(rng);
+				} else {
+					// Only select if the previous selection was inside the document to prevent auto focus in quirks mode
+					try {
+						rng = editor.getDoc().body.createTextRange();
+						rng.moveToElementText(rootNode);
+						rng.collapse(true);
+						rng.moveStart('character', startOffset);
+
+						if (endOffset > 0) {
+							rng.moveEnd('character', endOffset);
+						}
+
+						rng.select();
+					} catch (ex) {
+						// Ignore
+					}
+				}
+
+				editor.nodeChanged();
+			}
+		}
+
+		// Force root blocks
+		if (settings.forced_root_block) {
+			editor.on('NodeChange', addRootBlocks);
+		}
+	};
+});
+
+// Included from: js/tinymce/classes/EditorCommands.js
+
+/**
+ * EditorCommands.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class enables you to add custom editor commands and it contains
+ * overrides for native browser commands to address various bugs and issues.
+ *
+ * @class tinymce.EditorCommands
+ */
+define("tinymce/EditorCommands", [
+	"tinymce/html/Serializer",
+	"tinymce/Env",
+	"tinymce/util/Tools",
+	"tinymce/dom/ElementUtils",
+	"tinymce/dom/RangeUtils",
+	"tinymce/dom/TreeWalker"
+], function(Serializer, Env, Tools, ElementUtils, RangeUtils, TreeWalker) {
+	// Added for compression purposes
+	var each = Tools.each, extend = Tools.extend;
+	var map = Tools.map, inArray = Tools.inArray, explode = Tools.explode;
+	var isGecko = Env.gecko, isIE = Env.ie, isOldIE = Env.ie && Env.ie < 11;
+	var TRUE = true, FALSE = false;
+
+	return function(editor) {
+		var dom, selection, formatter,
+			commands = {state: {}, exec: {}, value: {}},
+			settings = editor.settings,
+			bookmark;
+
+		editor.on('PreInit', function() {
+			dom = editor.dom;
+			selection = editor.selection;
+			settings = editor.settings;
+			formatter = editor.formatter;
+		});
+
+		/**
+		 * Executes the specified command.
+		 *
+		 * @method execCommand
+		 * @param {String} command Command to execute.
+		 * @param {Boolean} ui Optional user interface state.
+		 * @param {Object} value Optional value for command.
+		 * @return {Boolean} true/false if the command was found or not.
+		 */
+		function execCommand(command, ui, value, args) {
+			var func, customCommand, state = 0;
+
+			if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(command) && (!args || !args.skip_focus)) {
+				editor.focus();
+			}
+
+			args = extend({}, args);
+			args = editor.fire('BeforeExecCommand', {command: command, ui: ui, value: value});
+			if (args.isDefaultPrevented()) {
+				return false;
+			}
+
+			customCommand = command.toLowerCase();
+			if ((func = commands.exec[customCommand])) {
+				func(customCommand, ui, value);
+				editor.fire('ExecCommand', {command: command, ui: ui, value: value});
+				return true;
+			}
+
+			// Plugin commands
+			each(editor.plugins, function(p) {
+				if (p.execCommand && p.execCommand(command, ui, value)) {
+					editor.fire('ExecCommand', {command: command, ui: ui, value: value});
+					state = true;
+					return false;
+				}
+			});
+
+			if (state) {
+				return state;
+			}
+
+			// Theme commands
+			if (editor.theme && editor.theme.execCommand && editor.theme.execCommand(command, ui, value)) {
+				editor.fire('ExecCommand', {command: command, ui: ui, value: value});
+				return true;
+			}
+
+			// Browser commands
+			try {
+				state = editor.getDoc().execCommand(command, ui, value);
+			} catch (ex) {
+				// Ignore old IE errors
+			}
+
+			if (state) {
+				editor.fire('ExecCommand', {command: command, ui: ui, value: value});
+				return true;
+			}
+
+			return false;
+		}
+
+		/**
+		 * Queries the current state for a command for example if the current selection is "bold".
+		 *
+		 * @method queryCommandState
+		 * @param {String} command Command to check the state of.
+		 * @return {Boolean/Number} true/false if the selected contents is bold or not, -1 if it's not found.
+		 */
+		function queryCommandState(command) {
+			var func;
+
+			// Is hidden then return undefined
+			if (editor._isHidden()) {
+				return;
+			}
+
+			command = command.toLowerCase();
+			if ((func = commands.state[command])) {
+				return func(command);
+			}
+
+			// Browser commands
+			try {
+				return editor.getDoc().queryCommandState(command);
+			} catch (ex) {
+				// Fails sometimes see bug: 1896577
+			}
+
+			return false;
+		}
+
+		/**
+		 * Queries the command value for example the current fontsize.
+		 *
+		 * @method queryCommandValue
+		 * @param {String} command Command to check the value of.
+		 * @return {Object} Command value of false if it's not found.
+		 */
+		function queryCommandValue(command) {
+			var func;
+
+			// Is hidden then return undefined
+			if (editor._isHidden()) {
+				return;
+			}
+
+			command = command.toLowerCase();
+			if ((func = commands.value[command])) {
+				return func(command);
+			}
+
+			// Browser commands
+			try {
+				return editor.getDoc().queryCommandValue(command);
+			} catch (ex) {
+				// Fails sometimes see bug: 1896577
+			}
+		}
+
+		/**
+		 * Adds commands to the command collection.
+		 *
+		 * @method addCommands
+		 * @param {Object} command_list Name/value collection with commands to add, the names can also be comma separated.
+		 * @param {String} type Optional type to add, defaults to exec. Can be value or state as well.
+		 */
+		function addCommands(command_list, type) {
+			type = type || 'exec';
+
+			each(command_list, function(callback, command) {
+				each(command.toLowerCase().split(','), function(command) {
+					commands[type][command] = callback;
+				});
+			});
+		}
+
+		function addCommand(command, callback, scope) {
+			command = command.toLowerCase();
+			commands.exec[command] = function(command, ui, value, args) {
+				return callback.call(scope || editor, ui, value, args);
+			};
+		}
+
+		/**
+		 * Returns true/false if the command is supported or not.
+		 *
+		 * @method queryCommandSupported
+		 * @param {String} cmd Command that we check support for.
+		 * @return {Boolean} true/false if the command is supported or not.
+		 */
+		function queryCommandSupported(command) {
+			command = command.toLowerCase();
+
+			if (commands.exec[command]) {
+				return true;
+			}
+
+			// Browser commands
+			try {
+				return editor.getDoc().queryCommandSupported(command);
+			} catch (ex) {
+				// Fails sometimes see bug: 1896577
+			}
+
+			return false;
+		}
+
+		function addQueryStateHandler(command, callback, scope) {
+			command = command.toLowerCase();
+			commands.state[command] = function() {
+				return callback.call(scope || editor);
+			};
+		}
+
+		function addQueryValueHandler(command, callback, scope) {
+			command = command.toLowerCase();
+			commands.value[command] = function() {
+				return callback.call(scope || editor);
+			};
+		}
+
+		function hasCustomCommand(command) {
+			command = command.toLowerCase();
+			return !!commands.exec[command];
+		}
+
+		// Expose public methods
+		extend(this, {
+			execCommand: execCommand,
+			queryCommandState: queryCommandState,
+			queryCommandValue: queryCommandValue,
+			queryCommandSupported: queryCommandSupported,
+			addCommands: addCommands,
+			addCommand: addCommand,
+			addQueryStateHandler: addQueryStateHandler,
+			addQueryValueHandler: addQueryValueHandler,
+			hasCustomCommand: hasCustomCommand
+		});
+
+		// Private methods
+
+		function execNativeCommand(command, ui, value) {
+			if (ui === undefined) {
+				ui = FALSE;
+			}
+
+			if (value === undefined) {
+				value = null;
+			}
+
+			return editor.getDoc().execCommand(command, ui, value);
+		}
+
+		function isFormatMatch(name) {
+			return formatter.match(name);
+		}
+
+		function toggleFormat(name, value) {
+			formatter.toggle(name, value ? {value: value} : undefined);
+			editor.nodeChanged();
+		}
+
+		function storeSelection(type) {
+			bookmark = selection.getBookmark(type);
+		}
+
+		function restoreSelection() {
+			selection.moveToBookmark(bookmark);
+		}
+
+		// Add execCommand overrides
+		addCommands({
+			// Ignore these, added for compatibility
+			'mceResetDesignMode,mceBeginUndoLevel': function() {},
+
+			// Add undo manager logic
+			'mceEndUndoLevel,mceAddUndoLevel': function() {
+				editor.undoManager.add();
+			},
+
+			'Cut,Copy,Paste': function(command) {
+				var doc = editor.getDoc(), failed;
+
+				// Try executing the native command
+				try {
+					execNativeCommand(command);
+				} catch (ex) {
+					// Command failed
+					failed = TRUE;
+				}
+
+				// Present alert message about clipboard access not being available
+				if (failed || !doc.queryCommandSupported(command)) {
+					var msg = editor.translate(
+						"Your browser doesn't support direct access to the clipboard. " +
+						"Please use the Ctrl+X/C/V keyboard shortcuts instead."
+					);
+
+					if (Env.mac) {
+						msg = msg.replace(/Ctrl\+/g, '\u2318+');
+					}
+
+					editor.windowManager.alert(msg);
+				}
+			},
+
+			// Override unlink command
+			unlink: function() {
+				if (selection.isCollapsed()) {
+					var elm = selection.getNode();
+					if (elm.tagName == 'A') {
+						editor.dom.remove(elm, true);
+					}
+
+					return;
+				}
+
+				formatter.remove("link");
+			},
+
+			// Override justify commands to use the text formatter engine
+			'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull': function(command) {
+				var align = command.substring(7);
+
+				if (align == 'full') {
+					align = 'justify';
+				}
+
+				// Remove all other alignments first
+				each('left,center,right,justify'.split(','), function(name) {
+					if (align != name) {
+						formatter.remove('align' + name);
+					}
+				});
+
+				toggleFormat('align' + align);
+				execCommand('mceRepaint');
+			},
+
+			// Override list commands to fix WebKit bug
+			'InsertUnorderedList,InsertOrderedList': function(command) {
+				var listElm, listParent;
+
+				execNativeCommand(command);
+
+				// WebKit produces lists within block elements so we need to split them
+				// we will replace the native list creation logic to custom logic later on
+				// TODO: Remove this when the list creation logic is removed
+				listElm = dom.getParent(selection.getNode(), 'ol,ul');
+				if (listElm) {
+					listParent = listElm.parentNode;
+
+					// If list is within a text block then split that block
+					if (/^(H[1-6]|P|ADDRESS|PRE)$/.test(listParent.nodeName)) {
+						storeSelection();
+						dom.split(listParent, listElm);
+						restoreSelection();
+					}
+				}
+			},
+
+			// Override commands to use the text formatter engine
+			'Bold,Italic,Underline,Strikethrough,Superscript,Subscript': function(command) {
+				toggleFormat(command);
+			},
+
+			// Override commands to use the text formatter engine
+			'ForeColor,HiliteColor,FontName': function(command, ui, value) {
+				toggleFormat(command, value);
+			},
+
+			FontSize: function(command, ui, value) {
+				var fontClasses, fontSizes;
+
+				// Convert font size 1-7 to styles
+				if (value >= 1 && value <= 7) {
+					fontSizes = explode(settings.font_size_style_values);
+					fontClasses = explode(settings.font_size_classes);
+
+					if (fontClasses) {
+						value = fontClasses[value - 1] || value;
+					} else {
+						value = fontSizes[value - 1] || value;
+					}
+				}
+
+				toggleFormat(command, value);
+			},
+
+			RemoveFormat: function(command) {
+				formatter.remove(command);
+			},
+
+			mceBlockQuote: function() {
+				toggleFormat('blockquote');
+			},
+
+			FormatBlock: function(command, ui, value) {
+				return toggleFormat(value || 'p');
+			},
+
+			mceCleanup: function() {
+				var bookmark = selection.getBookmark();
+
+				editor.setContent(editor.getContent({cleanup: TRUE}), {cleanup: TRUE});
+
+				selection.moveToBookmark(bookmark);
+			},
+
+			mceRemoveNode: function(command, ui, value) {
+				var node = value || selection.getNode();
+
+				// Make sure that the body node isn't removed
+				if (node != editor.getBody()) {
+					storeSelection();
+					editor.dom.remove(node, TRUE);
+					restoreSelection();
+				}
+			},
+
+			mceSelectNodeDepth: function(command, ui, value) {
+				var counter = 0;
+
+				dom.getParent(selection.getNode(), function(node) {
+					if (node.nodeType == 1 && counter++ == value) {
+						selection.select(node);
+						return FALSE;
+					}
+				}, editor.getBody());
+			},
+
+			mceSelectNode: function(command, ui, value) {
+				selection.select(value);
+			},
+
+			mceInsertContent: function(command, ui, value) {
+				var parser, serializer, parentNode, rootNode, fragment, args;
+				var marker, rng, node, node2, bookmarkHtml, merge;
+				var textInlineElements = editor.schema.getTextInlineElements();
+
+				function trimOrPaddLeftRight(html) {
+					var rng, container, offset;
+
+					rng = selection.getRng(true);
+					container = rng.startContainer;
+					offset = rng.startOffset;
+
+					function hasSiblingText(siblingName) {
+						return container[siblingName] && container[siblingName].nodeType == 3;
+					}
+
+					if (container.nodeType == 3) {
+						if (offset > 0) {
+							html = html.replace(/^&nbsp;/, ' ');
+						} else if (!hasSiblingText('previousSibling')) {
+							html = html.replace(/^ /, '&nbsp;');
+						}
+
+						if (offset < container.length) {
+							html = html.replace(/&nbsp;(<br>|)$/, ' ');
+						} else if (!hasSiblingText('nextSibling')) {
+							html = html.replace(/(&nbsp;| )(<br>|)$/, '&nbsp;');
+						}
+					}
+
+					return html;
+				}
+
+				// Removes &nbsp; from a [b] c -> a &nbsp;c -> a c
+				function trimNbspAfterDeleteAndPaddValue() {
+					var rng, container, offset;
+
+					rng = selection.getRng(true);
+					container = rng.startContainer;
+					offset = rng.startOffset;
+
+					if (container.nodeType == 3 && rng.collapsed) {
+						if (container.data[offset] === '\u00a0') {
+							container.deleteData(offset, 1);
+
+							if (!/[\u00a0| ]$/.test(value)) {
+								value += ' ';
+							}
+						} else if (container.data[offset - 1] === '\u00a0') {
+							container.deleteData(offset - 1, 1);
+
+							if (!/[\u00a0| ]$/.test(value)) {
+								value = ' ' + value;
+							}
+						}
+					}
+				}
+
+				function markInlineFormatElements(fragment) {
+					if (merge) {
+						for (node = fragment.firstChild; node; node = node.walk(true)) {
+							if (textInlineElements[node.name]) {
+								node.attr('data-mce-new', "true");
+							}
+						}
+					}
+				}
+
+				function reduceInlineTextElements() {
+					if (merge) {
+						var root = editor.getBody(), elementUtils = new ElementUtils(dom);
+
+						each(dom.select('*[data-mce-new]'), function(node) {
+							node.removeAttribute('data-mce-new');
+
+							for (var testNode = node.parentNode; testNode && testNode != root; testNode = testNode.parentNode) {
+								if (elementUtils.compare(testNode, node)) {
+									dom.remove(node, true);
+								}
+							}
+						});
+					}
+				}
+
+				if (typeof value != 'string') {
+					merge = value.merge;
+					value = value.content;
+				}
+
+				// Check for whitespace before/after value
+				if (/^ | $/.test(value)) {
+					value = trimOrPaddLeftRight(value);
+				}
+
+				// Setup parser and serializer
+				parser = editor.parser;
+				serializer = new Serializer({}, editor.schema);
+				bookmarkHtml = '<span id="mce_marker" data-mce-type="bookmark">&#xFEFF;&#x200B;</span>';
+
+				// Run beforeSetContent handlers on the HTML to be inserted
+				args = {content: value, format: 'html', selection: true};
+				editor.fire('BeforeSetContent', args);
+				value = args.content;
+
+				// Add caret at end of contents if it's missing
+				if (value.indexOf('{$caret}') == -1) {
+					value += '{$caret}';
+				}
+
+				// Replace the caret marker with a span bookmark element
+				value = value.replace(/\{\$caret\}/, bookmarkHtml);
+
+				// If selection is at <body>|<p></p> then move it into <body><p>|</p>
+				rng = selection.getRng();
+				var caretElement = rng.startContainer || (rng.parentElement ? rng.parentElement() : null);
+				var body = editor.getBody();
+				if (caretElement === body && selection.isCollapsed()) {
+					if (dom.isBlock(body.firstChild) && dom.isEmpty(body.firstChild)) {
+						rng = dom.createRng();
+						rng.setStart(body.firstChild, 0);
+						rng.setEnd(body.firstChild, 0);
+						selection.setRng(rng);
+					}
+				}
+
+				// Insert node maker where we will insert the new HTML and get it's parent
+				if (!selection.isCollapsed()) {
+					editor.getDoc().execCommand('Delete', false, null);
+					trimNbspAfterDeleteAndPaddValue();
+				}
+
+				parentNode = selection.getNode();
+
+				// Parse the fragment within the context of the parent node
+				var parserArgs = {context: parentNode.nodeName.toLowerCase()};
+				fragment = parser.parse(value, parserArgs);
+
+				markInlineFormatElements(fragment);
+
+				// Move the caret to a more suitable location
+				node = fragment.lastChild;
+				if (node.attr('id') == 'mce_marker') {
+					marker = node;
+
+					for (node = node.prev; node; node = node.walk(true)) {
+						if (node.type == 3 || !dom.isBlock(node.name)) {
+							if (editor.schema.isValidChild(node.parent.name, 'span')) {
+								node.parent.insert(marker, node, node.name === 'br');
+							}
+							break;
+						}
+					}
+				}
+
+				// If parser says valid we can insert the contents into that parent
+				if (!parserArgs.invalid) {
+					value = serializer.serialize(fragment);
+
+					// Check if parent is empty or only has one BR element then set the innerHTML of that parent
+					node = parentNode.firstChild;
+					node2 = parentNode.lastChild;
+					if (!node || (node === node2 && node.nodeName === 'BR')) {
+						dom.setHTML(parentNode, value);
+					} else {
+						selection.setContent(value);
+					}
+				} else {
+					// If the fragment was invalid within that context then we need
+					// to parse and process the parent it's inserted into
+
+					// Insert bookmark node and get the parent
+					selection.setContent(bookmarkHtml);
+					parentNode = selection.getNode();
+					rootNode = editor.getBody();
+
+					// Opera will return the document node when selection is in root
+					if (parentNode.nodeType == 9) {
+						parentNode = node = rootNode;
+					} else {
+						node = parentNode;
+					}
+
+					// Find the ancestor just before the root element
+					while (node !== rootNode) {
+						parentNode = node;
+						node = node.parentNode;
+					}
+
+					// Get the outer/inner HTML depending on if we are in the root and parser and serialize that
+					value = parentNode == rootNode ? rootNode.innerHTML : dom.getOuterHTML(parentNode);
+					value = serializer.serialize(
+						parser.parse(
+							// Need to replace by using a function since $ in the contents would otherwise be a problem
+							value.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i, function() {
+								return serializer.serialize(fragment);
+							})
+						)
+					);
+
+					// Set the inner/outer HTML depending on if we are in the root or not
+					if (parentNode == rootNode) {
+						dom.setHTML(rootNode, value);
+					} else {
+						dom.setOuterHTML(parentNode, value);
+					}
+				}
+
+				reduceInlineTextElements();
+
+				marker = dom.get('mce_marker');
+				selection.scrollIntoView(marker);
+
+				// Move selection before marker and remove it
+				rng = dom.createRng();
+
+				// If previous sibling is a text node set the selection to the end of that node
+				node = marker.previousSibling;
+				if (node && node.nodeType == 3) {
+					rng.setStart(node, node.nodeValue.length);
+
+					// TODO: Why can't we normalize on IE
+					if (!isIE) {
+						node2 = marker.nextSibling;
+						if (node2 && node2.nodeType == 3) {
+							node.appendData(node2.data);
+							node2.parentNode.removeChild(node2);
+						}
+					}
+				} else {
+					// If the previous sibling isn't a text node or doesn't exist set the selection before the marker node
+					rng.setStartBefore(marker);
+					rng.setEndBefore(marker);
+				}
+
+				// Remove the marker node and set the new range
+				dom.remove(marker);
+				selection.setRng(rng);
+
+				// Dispatch after event and add any visual elements needed
+				editor.fire('SetContent', args);
+				editor.addVisual();
+			},
+
+			mceInsertRawHTML: function(command, ui, value) {
+				selection.setContent('tiny_mce_marker');
+				editor.setContent(
+					editor.getContent().replace(/tiny_mce_marker/g, function() {
+						return value;
+					})
+				);
+			},
+
+			mceToggleFormat: function(command, ui, value) {
+				toggleFormat(value);
+			},
+
+			mceSetContent: function(command, ui, value) {
+				editor.setContent(value);
+			},
+
+			'Indent,Outdent': function(command) {
+				var intentValue, indentUnit, value;
+
+				// Setup indent level
+				intentValue = settings.indentation;
+				indentUnit = /[a-z%]+$/i.exec(intentValue);
+				intentValue = parseInt(intentValue, 10);
+
+				if (!queryCommandState('InsertUnorderedList') && !queryCommandState('InsertOrderedList')) {
+					// If forced_root_blocks is set to false we don't have a block to indent so lets create a div
+					if (!settings.forced_root_block && !dom.getParent(selection.getNode(), dom.isBlock)) {
+						formatter.apply('div');
+					}
+
+					each(selection.getSelectedBlocks(), function(element) {
+						if (element.nodeName != "LI") {
+							var indentStyleName = editor.getParam('indent_use_margin', false) ? 'margin' : 'padding';
+
+							indentStyleName += dom.getStyle(element, 'direction', true) == 'rtl' ? 'Right' : 'Left';
+
+							if (command == 'outdent') {
+								value = Math.max(0, parseInt(element.style[indentStyleName] || 0, 10) - intentValue);
+								dom.setStyle(element, indentStyleName, value ? value + indentUnit : '');
+							} else {
+								value = (parseInt(element.style[indentStyleName] || 0, 10) + intentValue) + indentUnit;
+								dom.setStyle(element, indentStyleName, value);
+							}
+						}
+					});
+				} else {
+					execNativeCommand(command);
+				}
+			},
+
+			mceRepaint: function() {
+				if (isGecko) {
+					try {
+						storeSelection(TRUE);
+
+						if (selection.getSel()) {
+							selection.getSel().selectAllChildren(editor.getBody());
+						}
+
+						selection.collapse(TRUE);
+						restoreSelection();
+					} catch (ex) {
+						// Ignore
+					}
+				}
+			},
+
+			InsertHorizontalRule: function() {
+				editor.execCommand('mceInsertContent', false, '<hr />');
+			},
+
+			mceToggleVisualAid: function() {
+				editor.hasVisual = !editor.hasVisual;
+				editor.addVisual();
+			},
+
+			mceReplaceContent: function(command, ui, value) {
+				editor.execCommand('mceInsertContent', false, value.replace(/\{\$selection\}/g, selection.getContent({format: 'text'})));
+			},
+
+			mceInsertLink: function(command, ui, value) {
+				var anchor;
+
+				if (typeof value == 'string') {
+					value = {href: value};
+				}
+
+				anchor = dom.getParent(selection.getNode(), 'a');
+
+				// Spaces are never valid in URLs and it's a very common mistake for people to make so we fix it here.
+				value.href = value.href.replace(' ', '%20');
+
+				// Remove existing links if there could be child links or that the href isn't specified
+				if (!anchor || !value.href) {
+					formatter.remove('link');
+				}
+
+				// Apply new link to selection
+				if (value.href) {
+					formatter.apply('link', value, anchor);
+				}
+			},
+
+			selectAll: function() {
+				var root = dom.getRoot(), rng;
+
+				if (selection.getRng().setStart) {
+					rng = dom.createRng();
+					rng.setStart(root, 0);
+					rng.setEnd(root, root.childNodes.length);
+					selection.setRng(rng);
+				} else {
+					// IE will render it's own root level block elements and sometimes
+					// even put font elements in them when the user starts typing. So we need to
+					// move the selection to a more suitable element from this:
+					// <body>|<p></p></body> to this: <body><p>|</p></body>
+					rng = selection.getRng();
+					if (!rng.item) {
+						rng.moveToElementText(root);
+						rng.select();
+					}
+				}
+			},
+
+			"delete": function() {
+				execNativeCommand("Delete");
+
+				// Check if body is empty after the delete call if so then set the contents
+				// to an empty string and move the caret to any block produced by that operation
+				// this fixes the issue with root blocks not being properly produced after a delete call on IE
+				var body = editor.getBody();
+
+				if (dom.isEmpty(body)) {
+					editor.setContent('');
+
+					if (body.firstChild && dom.isBlock(body.firstChild)) {
+						editor.selection.setCursorLocation(body.firstChild, 0);
+					} else {
+						editor.selection.setCursorLocation(body, 0);
+					}
+				}
+			},
+
+			mceNewDocument: function() {
+				editor.setContent('');
+			},
+
+			InsertLineBreak: function(command, ui, value) {
+				// We load the current event in from EnterKey.js when appropriate to heed
+				// certain event-specific variations such as ctrl-enter in a list
+				var evt = value;
+				var brElm, extraBr, marker;
+				var rng = selection.getRng(true);
+				new RangeUtils(dom).normalize(rng);
+
+				var offset = rng.startOffset;
+				var container = rng.startContainer;
+
+				// Resolve node index
+				if (container.nodeType == 1 && container.hasChildNodes()) {
+					var isAfterLastNodeInContainer = offset > container.childNodes.length - 1;
+
+					container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container;
+					if (isAfterLastNodeInContainer && container.nodeType == 3) {
+						offset = container.nodeValue.length;
+					} else {
+						offset = 0;
+					}
+				}
+
+				var parentBlock = dom.getParent(container, dom.isBlock);
+				var parentBlockName = parentBlock ? parentBlock.nodeName.toUpperCase() : ''; // IE < 9 & HTML5
+				var containerBlock = parentBlock ? dom.getParent(parentBlock.parentNode, dom.isBlock) : null;
+				var containerBlockName = containerBlock ? containerBlock.nodeName.toUpperCase() : ''; // IE < 9 & HTML5
+
+				// Enter inside block contained within a LI then split or insert before/after LI
+				var isControlKey = evt && evt.ctrlKey;
+				if (containerBlockName == 'LI' && !isControlKey) {
+					parentBlock = containerBlock;
+					parentBlockName = containerBlockName;
+				}
+
+				// Walks the parent block to the right and look for BR elements
+				function hasRightSideContent() {
+					var walker = new TreeWalker(container, parentBlock), node;
+					var nonEmptyElementsMap = editor.schema.getNonEmptyElements();
+
+					while ((node = walker.next())) {
+						if (nonEmptyElementsMap[node.nodeName.toLowerCase()] || node.length > 0) {
+							return true;
+						}
+					}
+				}
+
+				if (container && container.nodeType == 3 && offset >= container.nodeValue.length) {
+					// Insert extra BR element at the end block elements
+					if (!isOldIE && !hasRightSideContent()) {
+						brElm = dom.create('br');
+						rng.insertNode(brElm);
+						rng.setStartAfter(brElm);
+						rng.setEndAfter(brElm);
+						extraBr = true;
+					}
+				}
+
+				brElm = dom.create('br');
+				rng.insertNode(brElm);
+
+				// Rendering modes below IE8 doesn't display BR elements in PRE unless we have a \n before it
+				var documentMode = dom.doc.documentMode;
+				if (isOldIE && parentBlockName == 'PRE' && (!documentMode || documentMode < 8)) {
+					brElm.parentNode.insertBefore(dom.doc.createTextNode('\r'), brElm);
+				}
+
+				// Insert temp marker and scroll to that
+				marker = dom.create('span', {}, '&nbsp;');
+				brElm.parentNode.insertBefore(marker, brElm);
+				selection.scrollIntoView(marker);
+				dom.remove(marker);
+
+				if (!extraBr) {
+					rng.setStartAfter(brElm);
+					rng.setEndAfter(brElm);
+				} else {
+					rng.setStartBefore(brElm);
+					rng.setEndBefore(brElm);
+				}
+
+				selection.setRng(rng);
+				editor.undoManager.add();
+
+				return TRUE;
+			}
+		});
+
+		// Add queryCommandState overrides
+		addCommands({
+			// Override justify commands
+			'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull': function(command) {
+				var name = 'align' + command.substring(7);
+				var nodes = selection.isCollapsed() ? [dom.getParent(selection.getNode(), dom.isBlock)] : selection.getSelectedBlocks();
+				var matches = map(nodes, function(node) {
+					return !!formatter.matchNode(node, name);
+				});
+				return inArray(matches, TRUE) !== -1;
+			},
+
+			'Bold,Italic,Underline,Strikethrough,Superscript,Subscript': function(command) {
+				return isFormatMatch(command);
+			},
+
+			mceBlockQuote: function() {
+				return isFormatMatch('blockquote');
+			},
+
+			Outdent: function() {
+				var node;
+
+				if (settings.inline_styles) {
+					if ((node = dom.getParent(selection.getStart(), dom.isBlock)) && parseInt(node.style.paddingLeft, 10) > 0) {
+						return TRUE;
+					}
+
+					if ((node = dom.getParent(selection.getEnd(), dom.isBlock)) && parseInt(node.style.paddingLeft, 10) > 0) {
+						return TRUE;
+					}
+				}
+
+				return (
+					queryCommandState('InsertUnorderedList') ||
+					queryCommandState('InsertOrderedList') ||
+					(!settings.inline_styles && !!dom.getParent(selection.getNode(), 'BLOCKQUOTE'))
+				);
+			},
+
+			'InsertUnorderedList,InsertOrderedList': function(command) {
+				var list = dom.getParent(selection.getNode(), 'ul,ol');
+
+				return list &&
+					(
+						command === 'insertunorderedlist' && list.tagName === 'UL' ||
+						command === 'insertorderedlist' && list.tagName === 'OL'
+					);
+			}
+		}, 'state');
+
+		// Add queryCommandValue overrides
+		addCommands({
+			'FontSize,FontName': function(command) {
+				var value = 0, parent;
+
+				if ((parent = dom.getParent(selection.getNode(), 'span'))) {
+					if (command == 'fontsize') {
+						value = parent.style.fontSize;
+					} else {
+						value = parent.style.fontFamily.replace(/, /g, ',').replace(/[\'\"]/g, '').toLowerCase();
+					}
+				}
+
+				return value;
+			}
+		}, 'value');
+
+		// Add undo manager logic
+		addCommands({
+			Undo: function() {
+				editor.undoManager.undo();
+			},
+
+			Redo: function() {
+				editor.undoManager.redo();
+			}
+		});
+	};
+});
+
+// Included from: js/tinymce/classes/util/URI.js
+
+/**
+ * URI.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles parsing, modification and serialization of URI/URL strings.
+ * @class tinymce.util.URI
+ */
+define("tinymce/util/URI", [
+	"tinymce/util/Tools"
+], function(Tools) {
+	var each = Tools.each, trim = Tools.trim;
+	var queryParts = "source protocol authority userInfo user password host port relative path directory file query anchor".split(' ');
+	var DEFAULT_PORTS = {
+		'ftp': 21,
+		'http': 80,
+		'https': 443,
+		'mailto': 25
+	};
+
+	/**
+	 * Constructs a new URI instance.
+	 *
+	 * @constructor
+	 * @method URI
+	 * @param {String} url URI string to parse.
+	 * @param {Object} settings Optional settings object.
+	 */
+	function URI(url, settings) {
+		var self = this, baseUri, base_url;
+
+		url = trim(url);
+		settings = self.settings = settings || {};
+		baseUri = settings.base_uri;
+
+		// Strange app protocol that isn't http/https or local anchor
+		// For example: mailto,skype,tel etc.
+		if (/^([\w\-]+):([^\/]{2})/i.test(url) || /^\s*#/.test(url)) {
+			self.source = url;
+			return;
+		}
+
+		var isProtocolRelative = url.indexOf('//') === 0;
+
+		// Absolute path with no host, fake host and protocol
+		if (url.indexOf('/') === 0 && !isProtocolRelative) {
+			url = (baseUri ? baseUri.protocol || 'http' : 'http') + '://mce_host' + url;
+		}
+
+		// Relative path http:// or protocol relative //path
+		if (!/^[\w\-]*:?\/\//.test(url)) {
+			base_url = settings.base_uri ? settings.base_uri.path : new URI(location.href).directory;
+			if (settings.base_uri.protocol === "") {
+				url = '//mce_host' + self.toAbsPath(base_url, url);
+			} else {
+				url = /([^#?]*)([#?]?.*)/.exec(url);
+				url = ((baseUri && baseUri.protocol) || 'http') + '://mce_host' + self.toAbsPath(base_url, url[1]) + url[2];
+			}
+		}
+
+		// Parse URL (Credits goes to Steave, http://blog.stevenlevithan.com/archives/parseuri)
+		url = url.replace(/@@/g, '(mce_at)'); // Zope 3 workaround, they use @@something
+
+		/*jshint maxlen: 255 */
+		/*eslint max-len: 0 */
+		url = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(url);
+
+		each(queryParts, function(v, i) {
+			var part = url[i];
+
+			// Zope 3 workaround, they use @@something
+			if (part) {
+				part = part.replace(/\(mce_at\)/g, '@@');
+			}
+
+			self[v] = part;
+		});
+
+		if (baseUri) {
+			if (!self.protocol) {
+				self.protocol = baseUri.protocol;
+			}
+
+			if (!self.userInfo) {
+				self.userInfo = baseUri.userInfo;
+			}
+
+			if (!self.port && self.host === 'mce_host') {
+				self.port = baseUri.port;
+			}
+
+			if (!self.host || self.host === 'mce_host') {
+				self.host = baseUri.host;
+			}
+
+			self.source = '';
+		}
+
+		if (isProtocolRelative) {
+			self.protocol = '';
+		}
+
+		//t.path = t.path || '/';
+	}
+
+	URI.prototype = {
+		/**
+		 * Sets the internal path part of the URI.
+		 *
+		 * @method setPath
+		 * @param {string} path Path string to set.
+		 */
+		setPath: function(path) {
+			var self = this;
+
+			path = /^(.*?)\/?(\w+)?$/.exec(path);
+
+			// Update path parts
+			self.path = path[0];
+			self.directory = path[1];
+			self.file = path[2];
+
+			// Rebuild source
+			self.source = '';
+			self.getURI();
+		},
+
+		/**
+		 * Converts the specified URI into a relative URI based on the current URI instance location.
+		 *
+		 * @method toRelative
+		 * @param {String} uri URI to convert into a relative path/URI.
+		 * @return {String} Relative URI from the point specified in the current URI instance.
+		 * @example
+		 * // Converts an absolute URL to an relative URL url will be somedir/somefile.htm
+		 * var url = new tinymce.util.URI('http://www.site.com/dir/').toRelative('http://www.site.com/dir/somedir/somefile.htm');
+		 */
+		toRelative: function(uri) {
+			var self = this, output;
+
+			if (uri === "./") {
+				return uri;
+			}
+
+			uri = new URI(uri, {base_uri: self});
+
+			// Not on same domain/port or protocol
+			if ((uri.host != 'mce_host' && self.host != uri.host && uri.host) || self.port != uri.port ||
+				(self.protocol != uri.protocol && uri.protocol !== "")) {
+				return uri.getURI();
+			}
+
+			var tu = self.getURI(), uu = uri.getURI();
+
+			// Allow usage of the base_uri when relative_urls = true
+			if (tu == uu || (tu.charAt(tu.length - 1) == "/" && tu.substr(0, tu.length - 1) == uu)) {
+				return tu;
+			}
+
+			output = self.toRelPath(self.path, uri.path);
+
+			// Add query
+			if (uri.query) {
+				output += '?' + uri.query;
+			}
+
+			// Add anchor
+			if (uri.anchor) {
+				output += '#' + uri.anchor;
+			}
+
+			return output;
+		},
+
+		/**
+		 * Converts the specified URI into a absolute URI based on the current URI instance location.
+		 *
+		 * @method toAbsolute
+		 * @param {String} uri URI to convert into a relative path/URI.
+		 * @param {Boolean} noHost No host and protocol prefix.
+		 * @return {String} Absolute URI from the point specified in the current URI instance.
+		 * @example
+		 * // Converts an relative URL to an absolute URL url will be http://www.site.com/dir/somedir/somefile.htm
+		 * var url = new tinymce.util.URI('http://www.site.com/dir/').toAbsolute('somedir/somefile.htm');
+		 */
+		toAbsolute: function(uri, noHost) {
+			uri = new URI(uri, {base_uri: this});
+
+			return uri.getURI(noHost && this.isSameOrigin(uri));
+		},
+
+		/**
+		 * Determine whether the given URI has the same origin as this URI.  Based on RFC-6454.
+		 * Supports default ports for protocols listed in DEFAULT_PORTS.  Unsupported protocols will fail safe: they
+		 * won't match, if the port specifications differ.
+		 *
+		 * @method isSameOrigin
+		 * @param {tinymce.util.URI} uri Uri instance to compare.
+		 * @returns {Boolean} True if the origins are the same.
+		 */
+		isSameOrigin: function(uri) {
+			if (this.host == uri.host && this.protocol == uri.protocol) {
+				if (this.port == uri.port) {
+					return true;
+				}
+
+				var defaultPort = DEFAULT_PORTS[this.protocol];
+				if (defaultPort && ((this.port || defaultPort) == (uri.port || defaultPort))) {
+					return true;
+				}
+			}
+
+			return false;
+		},
+
+		/**
+		 * Converts a absolute path into a relative path.
+		 *
+		 * @method toRelPath
+		 * @param {String} base Base point to convert the path from.
+		 * @param {String} path Absolute path to convert into a relative path.
+		 */
+		toRelPath: function(base, path) {
+			var items, breakPoint = 0, out = '', i, l;
+
+			// Split the paths
+			base = base.substring(0, base.lastIndexOf('/'));
+			base = base.split('/');
+			items = path.split('/');
+
+			if (base.length >= items.length) {
+				for (i = 0, l = base.length; i < l; i++) {
+					if (i >= items.length || base[i] != items[i]) {
+						breakPoint = i + 1;
+						break;
+					}
+				}
+			}
+
+			if (base.length < items.length) {
+				for (i = 0, l = items.length; i < l; i++) {
+					if (i >= base.length || base[i] != items[i]) {
+						breakPoint = i + 1;
+						break;
+					}
+				}
+			}
+
+			if (breakPoint === 1) {
+				return path;
+			}
+
+			for (i = 0, l = base.length - (breakPoint - 1); i < l; i++) {
+				out += "../";
+			}
+
+			for (i = breakPoint - 1, l = items.length; i < l; i++) {
+				if (i != breakPoint - 1) {
+					out += "/" + items[i];
+				} else {
+					out += items[i];
+				}
+			}
+
+			return out;
+		},
+
+		/**
+		 * Converts a relative path into a absolute path.
+		 *
+		 * @method toAbsPath
+		 * @param {String} base Base point to convert the path from.
+		 * @param {String} path Relative path to convert into an absolute path.
+		 */
+		toAbsPath: function(base, path) {
+			var i, nb = 0, o = [], tr, outPath;
+
+			// Split paths
+			tr = /\/$/.test(path) ? '/' : '';
+			base = base.split('/');
+			path = path.split('/');
+
+			// Remove empty chunks
+			each(base, function(k) {
+				if (k) {
+					o.push(k);
+				}
+			});
+
+			base = o;
+
+			// Merge relURLParts chunks
+			for (i = path.length - 1, o = []; i >= 0; i--) {
+				// Ignore empty or .
+				if (path[i].length === 0 || path[i] === ".") {
+					continue;
+				}
+
+				// Is parent
+				if (path[i] === '..') {
+					nb++;
+					continue;
+				}
+
+				// Move up
+				if (nb > 0) {
+					nb--;
+					continue;
+				}
+
+				o.push(path[i]);
+			}
+
+			i = base.length - nb;
+
+			// If /a/b/c or /
+			if (i <= 0) {
+				outPath = o.reverse().join('/');
+			} else {
+				outPath = base.slice(0, i).join('/') + '/' + o.reverse().join('/');
+			}
+
+			// Add front / if it's needed
+			if (outPath.indexOf('/') !== 0) {
+				outPath = '/' + outPath;
+			}
+
+			// Add traling / if it's needed
+			if (tr && outPath.lastIndexOf('/') !== outPath.length - 1) {
+				outPath += tr;
+			}
+
+			return outPath;
+		},
+
+		/**
+		 * Returns the full URI of the internal structure.
+		 *
+		 * @method getURI
+		 * @param {Boolean} noProtoHost Optional no host and protocol part. Defaults to false.
+		 */
+		getURI: function(noProtoHost) {
+			var s, self = this;
+
+			// Rebuild source
+			if (!self.source || noProtoHost) {
+				s = '';
+
+				if (!noProtoHost) {
+					if (self.protocol) {
+						s += self.protocol + '://';
+					} else {
+						s += '//';
+					}
+
+					if (self.userInfo) {
+						s += self.userInfo + '@';
+					}
+
+					if (self.host) {
+						s += self.host;
+					}
+
+					if (self.port) {
+						s += ':' + self.port;
+					}
+				}
+
+				if (self.path) {
+					s += self.path;
+				}
+
+				if (self.query) {
+					s += '?' + self.query;
+				}
+
+				if (self.anchor) {
+					s += '#' + self.anchor;
+				}
+
+				self.source = s;
+			}
+
+			return self.source;
+		}
+	};
+
+	return URI;
+});
+
+// Included from: js/tinymce/classes/util/Class.js
+
+/**
+ * Class.js
+ *
+ * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved.
+ */
+
+/**
+ * This utilitiy class is used for easier inheritage.
+ *
+ * Features:
+ * * Exposed super functions: this._super();
+ * * Mixins
+ * * Dummy functions
+ * * Property functions: var value = object.value(); and object.value(newValue);
+ * * Static functions
+ * * Defaults settings
+ */
+define("tinymce/util/Class", [
+	"tinymce/util/Tools"
+], function(Tools) {
+	var each = Tools.each, extend = Tools.extend;
+
+	var extendClass, initializing;
+
+	function Class() {
+	}
+
+	// Provides classical inheritance, based on code made by John Resig
+	Class.extend = extendClass = function(prop) {
+		var self = this, _super = self.prototype, prototype, name, member;
+
+		// The dummy class constructor
+		function Class() {
+			var i, mixins, mixin, self = this;
+
+			// All construction is actually done in the init method
+			if (!initializing) {
+				// Run class constuctor
+				if (self.init) {
+					self.init.apply(self, arguments);
+				}
+
+				// Run mixin constructors
+				mixins = self.Mixins;
+				if (mixins) {
+					i = mixins.length;
+					while (i--) {
+						mixin = mixins[i];
+						if (mixin.init) {
+							mixin.init.apply(self, arguments);
+						}
+					}
+				}
+			}
+		}
+
+		// Dummy function, needs to be extended in order to provide functionality
+		function dummy() {
+			return this;
+		}
+
+		// Creates a overloaded method for the class
+		// this enables you to use this._super(); to call the super function
+		function createMethod(name, fn) {
+			return function() {
+				var self = this, tmp = self._super, ret;
+
+				self._super = _super[name];
+				ret = fn.apply(self, arguments);
+				self._super = tmp;
+
+				return ret;
+			};
+		}
+
+		// Instantiate a base class (but only create the instance,
+		// don't run the init constructor)
+		initializing = true;
+
+		/*eslint new-cap:0 */
+		prototype = new self();
+		initializing = false;
+
+		// Add mixins
+		if (prop.Mixins) {
+			each(prop.Mixins, function(mixin) {
+				mixin = mixin;
+
+				for (var name in mixin) {
+					if (name !== "init") {
+						prop[name] = mixin[name];
+					}
+				}
+			});
+
+			if (_super.Mixins) {
+				prop.Mixins = _super.Mixins.concat(prop.Mixins);
+			}
+		}
+
+		// Generate dummy methods
+		if (prop.Methods) {
+			each(prop.Methods.split(','), function(name) {
+				prop[name] = dummy;
+			});
+		}
+
+		// Generate property methods
+		if (prop.Properties) {
+			each(prop.Properties.split(','), function(name) {
+				var fieldName = '_' + name;
+
+				prop[name] = function(value) {
+					var self = this, undef;
+
+					// Set value
+					if (value !== undef) {
+						self[fieldName] = value;
+
+						return self;
+					}
+
+					// Get value
+					return self[fieldName];
+				};
+			});
+		}
+
+		// Static functions
+		if (prop.Statics) {
+			each(prop.Statics, function(func, name) {
+				Class[name] = func;
+			});
+		}
+
+		// Default settings
+		if (prop.Defaults && _super.Defaults) {
+			prop.Defaults = extend({}, _super.Defaults, prop.Defaults);
+		}
+
+		// Copy the properties over onto the new prototype
+		for (name in prop) {
+			member = prop[name];
+
+			if (typeof member == "function" && _super[name]) {
+				prototype[name] = createMethod(name, member);
+			} else {
+				prototype[name] = member;
+			}
+		}
+
+		// Populate our constructed prototype object
+		Class.prototype = prototype;
+
+		// Enforce the constructor to be what we expect
+		Class.constructor = Class;
+
+		// And make this class extendible
+		Class.extend = extendClass;
+
+		return Class;
+	};
+
+	return Class;
+});
+
+// Included from: js/tinymce/classes/util/EventDispatcher.js
+
+/**
+ * EventDispatcher.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class lets you add/remove and fire events by name on the specified scope. This makes
+ * it easy to add event listener logic to any class.
+ *
+ * @class tinymce.util.EventDispatcher
+ * @example
+ *  var eventDispatcher = new EventDispatcher();
+ *
+ *  eventDispatcher.on('click', function() {console.log('data');});
+ *  eventDispatcher.fire('click', {data: 123});
+ */
+define("tinymce/util/EventDispatcher", [
+	"tinymce/util/Tools"
+], function(Tools) {
+	var nativeEvents = Tools.makeMap(
+		"focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange " +
+		"mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover " +
+		"draggesture dragdrop drop drag submit " +
+		"compositionstart compositionend compositionupdate touchstart touchend",
+		' '
+	);
+
+	function Dispatcher(settings) {
+		var self = this, scope, bindings = {}, toggleEvent;
+
+		function returnFalse() {
+			return false;
+		}
+
+		function returnTrue() {
+			return true;
+		}
+
+		settings = settings || {};
+		scope = settings.scope || self;
+		toggleEvent = settings.toggleEvent || returnFalse;
+
+		/**
+		 * Fires the specified event by name.
+		 *
+		 * @method fire
+		 * @param {String} name Name of the event to fire.
+		 * @param {Object?} args Event arguments.
+		 * @return {Object} Event args instance passed in.
+		 * @example
+		 * instance.fire('event', {...});
+		 */
+		function fire(name, args) {
+			var handlers, i, l, callback;
+
+			name = name.toLowerCase();
+			args = args || {};
+			args.type = name;
+
+			// Setup target is there isn't one
+			if (!args.target) {
+				args.target = scope;
+			}
+
+			// Add event delegation methods if they are missing
+			if (!args.preventDefault) {
+				// Add preventDefault method
+				args.preventDefault = function() {
+					args.isDefaultPrevented = returnTrue;
+				};
+
+				// Add stopPropagation
+				args.stopPropagation = function() {
+					args.isPropagationStopped = returnTrue;
+				};
+
+				// Add stopImmediatePropagation
+				args.stopImmediatePropagation = function() {
+					args.isImmediatePropagationStopped = returnTrue;
+				};
+
+				// Add event delegation states
+				args.isDefaultPrevented = returnFalse;
+				args.isPropagationStopped = returnFalse;
+				args.isImmediatePropagationStopped = returnFalse;
+			}
+
+			if (settings.beforeFire) {
+				settings.beforeFire(args);
+			}
+
+			handlers = bindings[name];
+			if (handlers) {
+				for (i = 0, l = handlers.length; i < l; i++) {
+					callback = handlers[i];
+
+					// Unbind handlers marked with "once"
+					if (callback.once) {
+						off(name, callback.func);
+					}
+
+					// Stop immediate propagation if needed
+					if (args.isImmediatePropagationStopped()) {
+						args.stopPropagation();
+						return args;
+					}
+
+					// If callback returns false then prevent default and stop all propagation
+					if (callback.func.call(scope, args) === false) {
+						args.preventDefault();
+						return args;
+					}
+				}
+			}
+
+			return args;
+		}
+
+		/**
+		 * Binds an event listener to a specific event by name.
+		 *
+		 * @method on
+		 * @param {String} name Event name or space separated list of events to bind.
+		 * @param {callback} callback Callback to be executed when the event occurs.
+		 * @param {Boolean} first Optional flag if the event should be prepended. Use this with care.
+		 * @return {Object} Current class instance.
+		 * @example
+		 * instance.on('event', function(e) {
+		 *     // Callback logic
+		 * });
+		 */
+		function on(name, callback, prepend, extra) {
+			var handlers, names, i;
+
+			if (callback === false) {
+				callback = returnFalse;
+			}
+
+			if (callback) {
+				callback = {
+					func: callback
+				};
+
+				if (extra) {
+					Tools.extend(callback, extra);
+				}
+
+				names = name.toLowerCase().split(' ');
+				i = names.length;
+				while (i--) {
+					name = names[i];
+					handlers = bindings[name];
+					if (!handlers) {
+						handlers = bindings[name] = [];
+						toggleEvent(name, true);
+					}
+
+					if (prepend) {
+						handlers.unshift(callback);
+					} else {
+						handlers.push(callback);
+					}
+				}
+			}
+
+			return self;
+		}
+
+		/**
+		 * Unbinds an event listener to a specific event by name.
+		 *
+		 * @method off
+		 * @param {String?} name Name of the event to unbind.
+		 * @param {callback?} callback Callback to unbind.
+		 * @return {Object} Current class instance.
+		 * @example
+		 * // Unbind specific callback
+		 * instance.off('event', handler);
+		 *
+		 * // Unbind all listeners by name
+		 * instance.off('event');
+		 *
+		 * // Unbind all events
+		 * instance.off();
+		 */
+		function off(name, callback) {
+			var i, handlers, bindingName, names, hi;
+
+			if (name) {
+				names = name.toLowerCase().split(' ');
+				i = names.length;
+				while (i--) {
+					name = names[i];
+					handlers = bindings[name];
+
+					// Unbind all handlers
+					if (!name) {
+						for (bindingName in bindings) {
+							toggleEvent(bindingName, false);
+							delete bindings[bindingName];
+						}
+
+						return self;
+					}
+
+					if (handlers) {
+						// Unbind all by name
+						if (!callback) {
+							handlers.length = 0;
+						} else {
+							// Unbind specific ones
+							hi = handlers.length;
+							while (hi--) {
+								if (handlers[hi].func === callback) {
+									handlers = handlers.slice(0, hi).concat(handlers.slice(hi + 1));
+									bindings[name] = handlers;
+								}
+							}
+						}
+
+						if (!handlers.length) {
+							toggleEvent(name, false);
+							delete bindings[name];
+						}
+					}
+				}
+			} else {
+				for (name in bindings) {
+					toggleEvent(name, false);
+				}
+
+				bindings = {};
+			}
+
+			return self;
+		}
+
+		/**
+		 * Binds an event listener to a specific event by name
+		 * and automatically unbind the event once the callback fires.
+		 *
+		 * @method once
+		 * @param {String} name Event name or space separated list of events to bind.
+		 * @param {callback} callback Callback to be executed when the event occurs.
+		 * @param {Boolean} first Optional flag if the event should be prepended. Use this with care.
+		 * @return {Object} Current class instance.
+		 * @example
+		 * instance.once('event', function(e) {
+		 *     // Callback logic
+		 * });
+		 */
+		function once(name, callback, prepend) {
+			return on(name, callback, prepend, {once: true});
+		}
+
+		/**
+		 * Returns true/false if the dispatcher has a event of the specified name.
+		 *
+		 * @method has
+		 * @param {String} name Name of the event to check for.
+		 * @return {Boolean} true/false if the event exists or not.
+		 */
+		function has(name) {
+			name = name.toLowerCase();
+			return !(!bindings[name] || bindings[name].length === 0);
+		}
+
+		// Expose
+		self.fire = fire;
+		self.on = on;
+		self.off = off;
+		self.once = once;
+		self.has = has;
+	}
+
+	/**
+	 * Returns true/false if the specified event name is a native browser event or not.
+	 *
+	 * @method isNative
+	 * @param {String} name Name to check if it's native.
+	 * @return {Boolean} true/false if the event is native or not.
+	 * @static
+	 */
+	Dispatcher.isNative = function(name) {
+		return !!nativeEvents[name.toLowerCase()];
+	};
+
+	return Dispatcher;
+});
+
+// Included from: js/tinymce/classes/ui/Selector.js
+
+/**
+ * Selector.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*eslint no-nested-ternary:0 */
+
+/**
+ * Selector engine, enables you to select controls by using CSS like expressions.
+ * We currently only support basic CSS expressions to reduce the size of the core
+ * and the ones we support should be enough for most cases.
+ *
+ * @example
+ * Supported expressions:
+ *  element
+ *  element#name
+ *  element.class
+ *  element[attr]
+ *  element[attr*=value]
+ *  element[attr~=value]
+ *  element[attr!=value]
+ *  element[attr^=value]
+ *  element[attr$=value]
+ *  element:<state>
+ *  element:not(<expression>)
+ *  element:first
+ *  element:last
+ *  element:odd
+ *  element:even
+ *  element element
+ *  element > element
+ *
+ * @class tinymce.ui.Selector
+ */
+define("tinymce/ui/Selector", [
+	"tinymce/util/Class"
+], function(Class) {
+	"use strict";
+
+	/**
+	 * Produces an array with a unique set of objects. It will not compare the values
+	 * but the references of the objects.
+	 *
+	 * @private
+	 * @method unqiue
+	 * @param {Array} array Array to make into an array with unique items.
+	 * @return {Array} Array with unique items.
+	 */
+	function unique(array) {
+		var uniqueItems = [], i = array.length, item;
+
+		while (i--) {
+			item = array[i];
+
+			if (!item.__checked) {
+				uniqueItems.push(item);
+				item.__checked = 1;
+			}
+		}
+
+		i = uniqueItems.length;
+		while (i--) {
+			delete uniqueItems[i].__checked;
+		}
+
+		return uniqueItems;
+	}
+
+	var expression = /^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i;
+
+	/*jshint maxlen:255 */
+	/*eslint max-len:0 */
+	var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+		whiteSpace = /^\s*|\s*$/g,
+		Collection;
+
+	var Selector = Class.extend({
+		/**
+		 * Constructs a new Selector instance.
+		 *
+		 * @constructor
+		 * @method init
+		 * @param {String} selector CSS like selector expression.
+		 */
+		init: function(selector) {
+			var match = this.match;
+
+			function compileNameFilter(name) {
+				if (name) {
+					name = name.toLowerCase();
+
+					return function(item) {
+						return name === '*' || item.type === name;
+					};
+				}
+			}
+
+			function compileIdFilter(id) {
+				if (id) {
+					return function(item) {
+						return item._name === id;
+					};
+				}
+			}
+
+			function compileClassesFilter(classes) {
+				if (classes) {
+					classes = classes.split('.');
+
+					return function(item) {
+						var i = classes.length;
+
+						while (i--) {
+							if (!item.hasClass(classes[i])) {
+								return false;
+							}
+						}
+
+						return true;
+					};
+				}
+			}
+
+			function compileAttrFilter(name, cmp, check) {
+				if (name) {
+					return function(item) {
+						var value = item[name] ? item[name]() : '';
+
+						return !cmp ? !!check :
+							cmp === "=" ? value === check :
+							cmp === "*=" ? value.indexOf(check) >= 0 :
+							cmp === "~=" ? (" " + value + " ").indexOf(" " + check + " ") >= 0 :
+							cmp === "!=" ? value != check :
+							cmp === "^=" ? value.indexOf(check) === 0 :
+							cmp === "$=" ? value.substr(value.length - check.length) === check :
+							false;
+					};
+				}
+			}
+
+			function compilePsuedoFilter(name) {
+				var notSelectors;
+
+				if (name) {
+					name = /(?:not\((.+)\))|(.+)/i.exec(name);
+
+					if (!name[1]) {
+						name = name[2];
+
+						return function(item, index, length) {
+							return name === 'first' ? index === 0 :
+								name === 'last' ? index === length - 1 :
+								name === 'even' ? index % 2 === 0 :
+								name === 'odd' ? index % 2 === 1 :
+								item[name] ? item[name]() :
+								false;
+						};
+					} else {
+						// Compile not expression
+						notSelectors = parseChunks(name[1], []);
+
+						return function(item) {
+							return !match(item, notSelectors);
+						};
+					}
+				}
+			}
+
+			function compile(selector, filters, direct) {
+				var parts;
+
+				function add(filter) {
+					if (filter) {
+						filters.push(filter);
+					}
+				}
+
+				// Parse expression into parts
+				parts = expression.exec(selector.replace(whiteSpace, ''));
+
+				add(compileNameFilter(parts[1]));
+				add(compileIdFilter(parts[2]));
+				add(compileClassesFilter(parts[3]));
+				add(compileAttrFilter(parts[4], parts[5], parts[6]));
+				add(compilePsuedoFilter(parts[7]));
+
+				// Mark the filter with psuedo for performance
+				filters.psuedo = !!parts[7];
+				filters.direct = direct;
+
+				return filters;
+			}
+
+			// Parser logic based on Sizzle by John Resig
+			function parseChunks(selector, selectors) {
+				var parts = [], extra, matches, i;
+
+				do {
+					chunker.exec("");
+					matches = chunker.exec(selector);
+
+					if (matches) {
+						selector = matches[3];
+						parts.push(matches[1]);
+
+						if (matches[2]) {
+							extra = matches[3];
+							break;
+						}
+					}
+				} while (matches);
+
+				if (extra) {
+					parseChunks(extra, selectors);
+				}
+
+				selector = [];
+				for (i = 0; i < parts.length; i++) {
+					if (parts[i] != '>') {
+						selector.push(compile(parts[i], [], parts[i - 1] === '>'));
+					}
+				}
+
+				selectors.push(selector);
+
+				return selectors;
+			}
+
+			this._selectors = parseChunks(selector, []);
+		},
+
+		/**
+		 * Returns true/false if the selector matches the specified control.
+		 *
+		 * @method match
+		 * @param {tinymce.ui.Control} control Control to match agains the selector.
+		 * @param {Array} selectors Optional array of selectors, mostly used internally.
+		 * @return {Boolean} true/false state if the control matches or not.
+		 */
+		match: function(control, selectors) {
+			var i, l, si, sl, selector, fi, fl, filters, index, length, siblings, count, item;
+
+			selectors = selectors || this._selectors;
+			for (i = 0, l = selectors.length; i < l; i++) {
+				selector = selectors[i];
+				sl = selector.length;
+				item = control;
+				count = 0;
+
+				for (si = sl - 1; si >= 0; si--) {
+					filters = selector[si];
+
+					while (item) {
+						// Find the index and length since a psuedo filter like :first needs it
+						if (filters.psuedo) {
+							siblings = item.parent().items();
+							index = length = siblings.length;
+							while (index--) {
+								if (siblings[index] === item) {
+									break;
+								}
+							}
+						}
+
+						for (fi = 0, fl = filters.length; fi < fl; fi++) {
+							if (!filters[fi](item, index, length)) {
+								fi = fl + 1;
+								break;
+							}
+						}
+
+						if (fi === fl) {
+							count++;
+							break;
+						} else {
+							// If it didn't match the right most expression then
+							// break since it's no point looking at the parents
+							if (si === sl - 1) {
+								break;
+							}
+						}
+
+						item = item.parent();
+					}
+				}
+
+				// If we found all selectors then return true otherwise continue looking
+				if (count === sl) {
+					return true;
+				}
+			}
+
+			return false;
+		},
+
+		/**
+		 * Returns a tinymce.ui.Collection with matches of the specified selector inside the specified container.
+		 *
+		 * @method find
+		 * @param {tinymce.ui.Control} container Container to look for items in.
+		 * @return {tinymce.ui.Collection} Collection with matched elements.
+		 */
+		find: function(container) {
+			var matches = [], i, l, selectors = this._selectors;
+
+			function collect(items, selector, index) {
+				var i, l, fi, fl, item, filters = selector[index];
+
+				for (i = 0, l = items.length; i < l; i++) {
+					item = items[i];
+
+					// Run each filter agains the item
+					for (fi = 0, fl = filters.length; fi < fl; fi++) {
+						if (!filters[fi](item, i, l)) {
+							fi = fl + 1;
+							break;
+						}
+					}
+
+					// All filters matched the item
+					if (fi === fl) {
+						// Matched item is on the last expression like: panel toolbar [button]
+						if (index == selector.length - 1) {
+							matches.push(item);
+						} else {
+							// Collect next expression type
+							if (item.items) {
+								collect(item.items(), selector, index + 1);
+							}
+						}
+					} else if (filters.direct) {
+						return;
+					}
+
+					// Collect child items
+					if (item.items) {
+						collect(item.items(), selector, index);
+					}
+				}
+			}
+
+			if (container.items) {
+				for (i = 0, l = selectors.length; i < l; i++) {
+					collect(container.items(), selectors[i], 0);
+				}
+
+				// Unique the matches if needed
+				if (l > 1) {
+					matches = unique(matches);
+				}
+			}
+
+			// Fix for circular reference
+			if (!Collection) {
+				// TODO: Fix me!
+				Collection = Selector.Collection;
+			}
+
+			return new Collection(matches);
+		}
+	});
+
+	return Selector;
+});
+
+// Included from: js/tinymce/classes/ui/Collection.js
+
+/**
+ * Collection.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Control collection, this class contains control instances and it enables you to
+ * perform actions on all the contained items. This is very similar to how jQuery works.
+ *
+ * @example
+ * someCollection.show().disabled(true);
+ *
+ * @class tinymce.ui.Collection
+ */
+define("tinymce/ui/Collection", [
+	"tinymce/util/Tools",
+	"tinymce/ui/Selector",
+	"tinymce/util/Class"
+], function(Tools, Selector, Class) {
+	"use strict";
+
+	var Collection, proto, push = Array.prototype.push, slice = Array.prototype.slice;
+
+	proto = {
+		/**
+		 * Current number of contained control instances.
+		 *
+		 * @field length
+		 * @type Number
+		 */
+		length: 0,
+
+		/**
+		 * Constructor for the collection.
+		 *
+		 * @constructor
+		 * @method init
+		 * @param {Array} items Optional array with items to add.
+		 */
+		init: function(items) {
+			if (items) {
+				this.add(items);
+			}
+		},
+
+		/**
+		 * Adds new items to the control collection.
+		 *
+		 * @method add
+		 * @param {Array} items Array if items to add to collection.
+		 * @return {tinymce.ui.Collection} Current collection instance.
+		 */
+		add: function(items) {
+			var self = this;
+
+			// Force single item into array
+			if (!Tools.isArray(items)) {
+				if (items instanceof Collection) {
+					self.add(items.toArray());
+				} else {
+					push.call(self, items);
+				}
+			} else {
+				push.apply(self, items);
+			}
+
+			return self;
+		},
+
+		/**
+		 * Sets the contents of the collection. This will remove any existing items
+		 * and replace them with the ones specified in the input array.
+		 *
+		 * @method set
+		 * @param {Array} items Array with items to set into the Collection.
+		 * @return {tinymce.ui.Collection} Collection instance.
+		 */
+		set: function(items) {
+			var self = this, len = self.length, i;
+
+			self.length = 0;
+			self.add(items);
+
+			// Remove old entries
+			for (i = self.length; i < len; i++) {
+				delete self[i];
+			}
+
+			return self;
+		},
+
+		/**
+		 * Filters the collection item based on the specified selector expression or selector function.
+		 *
+		 * @method filter
+		 * @param {String} selector Selector expression to filter items by.
+		 * @return {tinymce.ui.Collection} Collection containing the filtered items.
+		 */
+		filter: function(selector) {
+			var self = this, i, l, matches = [], item, match;
+
+			// Compile string into selector expression
+			if (typeof selector === "string") {
+				selector = new Selector(selector);
+
+				match = function(item) {
+					return selector.match(item);
+				};
+			} else {
+				// Use selector as matching function
+				match = selector;
+			}
+
+			for (i = 0, l = self.length; i < l; i++) {
+				item = self[i];
+
+				if (match(item)) {
+					matches.push(item);
+				}
+			}
+
+			return new Collection(matches);
+		},
+
+		/**
+		 * Slices the items within the collection.
+		 *
+		 * @method slice
+		 * @param {Number} index Index to slice at.
+		 * @param {Number} len Optional length to slice.
+		 * @return {tinymce.ui.Collection} Current collection.
+		 */
+		slice: function() {
+			return new Collection(slice.apply(this, arguments));
+		},
+
+		/**
+		 * Makes the current collection equal to the specified index.
+		 *
+		 * @method eq
+		 * @param {Number} index Index of the item to set the collection to.
+		 * @return {tinymce.ui.Collection} Current collection.
+		 */
+		eq: function(index) {
+			return index === -1 ? this.slice(index) : this.slice(index, +index + 1);
+		},
+
+		/**
+		 * Executes the specified callback on each item in collection.
+		 *
+		 * @method each
+		 * @param {function} callback Callback to execute for each item in collection.
+		 * @return {tinymce.ui.Collection} Current collection instance.
+		 */
+		each: function(callback) {
+			Tools.each(this, callback);
+
+			return this;
+		},
+
+		/**
+		 * Returns an JavaScript array object of the contents inside the collection.
+		 *
+		 * @method toArray
+		 * @return {Array} Array with all items from collection.
+		 */
+		toArray: function() {
+			return Tools.toArray(this);
+		},
+
+		/**
+		 * Finds the index of the specified control or return -1 if it isn't in the collection.
+		 *
+		 * @method indexOf
+		 * @param {Control} ctrl Control instance to look for.
+		 * @return {Number} Index of the specified control or -1.
+		 */
+		indexOf: function(ctrl) {
+			var self = this, i = self.length;
+
+			while (i--) {
+				if (self[i] === ctrl) {
+					break;
+				}
+			}
+
+			return i;
+		},
+
+		/**
+		 * Returns a new collection of the contents in reverse order.
+		 *
+		 * @method reverse
+		 * @return {tinymce.ui.Collection} Collection instance with reversed items.
+		 */
+		reverse: function() {
+			return new Collection(Tools.toArray(this).reverse());
+		},
+
+		/**
+		 * Returns true/false if the class exists or not.
+		 *
+		 * @method hasClass
+		 * @param {String} cls Class to check for.
+		 * @return {Boolean} true/false state if the class exists or not.
+		 */
+		hasClass: function(cls) {
+			return this[0] ? this[0].hasClass(cls) : false;
+		},
+
+		/**
+		 * Sets/gets the specific property on the items in the collection. The same as executing control.<property>(<value>);
+		 *
+		 * @method prop
+		 * @param {String} name Property name to get/set.
+		 * @param {Object} value Optional object value to set.
+		 * @return {tinymce.ui.Collection} Current collection instance or value of the first item on a get operation.
+		 */
+		prop: function(name, value) {
+			var self = this, undef, item;
+
+			if (value !== undef) {
+				self.each(function(item) {
+					if (item[name]) {
+						item[name](value);
+					}
+				});
+
+				return self;
+			}
+
+			item = self[0];
+
+			if (item && item[name]) {
+				return item[name]();
+			}
+		},
+
+		/**
+		 * Executes the specific function name with optional arguments an all items in collection if it exists.
+		 *
+		 * @example collection.exec("myMethod", arg1, arg2, arg3);
+		 * @method exec
+		 * @param {String} name Name of the function to execute.
+		 * @param {Object} ... Multiple arguments to pass to each function.
+		 * @return {tinymce.ui.Collection} Current collection.
+		 */
+		exec: function(name) {
+			var self = this, args = Tools.toArray(arguments).slice(1);
+
+			self.each(function(item) {
+				if (item[name]) {
+					item[name].apply(item, args);
+				}
+			});
+
+			return self;
+		},
+
+		/**
+		 * Remove all items from collection and DOM.
+		 *
+		 * @method remove
+		 * @return {tinymce.ui.Collection} Current collection.
+		 */
+		remove: function() {
+			var i = this.length;
+
+			while (i--) {
+				this[i].remove();
+			}
+
+			return this;
+		}
+
+		/**
+		 * Fires the specified event by name and arguments on the control. This will execute all
+		 * bound event handlers.
+		 *
+		 * @method fire
+		 * @param {String} name Name of the event to fire.
+		 * @param {Object} args Optional arguments to pass to the event.
+		 * @return {tinymce.ui.Collection} Current collection instance.
+		 */
+		// fire: function(event, args) {}, -- Generated by code below
+
+		/**
+		 * Binds a callback to the specified event. This event can both be
+		 * native browser events like "click" or custom ones like PostRender.
+		 *
+		 * The callback function will have two parameters the first one being the control that received the event
+		 * the second one will be the event object either the browsers native event object or a custom JS object.
+		 *
+		 * @method on
+		 * @param {String} name Name of the event to bind. For example "click".
+		 * @param {String/function} callback Callback function to execute ones the event occurs.
+		 * @return {tinymce.ui.Collection} Current collection instance.
+		 */
+		// on: function(name, callback) {}, -- Generated by code below
+
+		/**
+		 * Unbinds the specified event and optionally a specific callback. If you omit the name
+		 * parameter all event handlers will be removed. If you omit the callback all event handles
+		 * by the specified name will be removed.
+		 *
+		 * @method off
+		 * @param {String} name Optional name for the event to unbind.
+		 * @param {function} callback Optional callback function to unbind.
+		 * @return {tinymce.ui.Collection} Current collection instance.
+		 */
+		// off: function(name, callback) {}, -- Generated by code below
+
+		/**
+		 * Shows the items in the current collection.
+		 *
+		 * @method show
+		 * @return {tinymce.ui.Collection} Current collection instance.
+		 */
+		// show: function() {}, -- Generated by code below
+
+		/**
+		 * Hides the items in the current collection.
+		 *
+		 * @method hide
+		 * @return {tinymce.ui.Collection} Current collection instance.
+		 */
+		// hide: function() {}, -- Generated by code below
+
+		/**
+		 * Sets/gets the text contents of the items in the current collection.
+		 *
+		 * @method text
+		 * @return {tinymce.ui.Collection} Current collection instance or text value of the first item on a get operation.
+		 */
+		// text: function(value) {}, -- Generated by code below
+
+		/**
+		 * Sets/gets the name contents of the items in the current collection.
+		 *
+		 * @method name
+		 * @return {tinymce.ui.Collection} Current collection instance or name value of the first item on a get operation.
+		 */
+		// name: function(value) {}, -- Generated by code below
+
+		/**
+		 * Sets/gets the disabled state on the items in the current collection.
+		 *
+		 * @method disabled
+		 * @return {tinymce.ui.Collection} Current collection instance or disabled state of the first item on a get operation.
+		 */
+		// disabled: function(state) {}, -- Generated by code below
+
+		/**
+		 * Sets/gets the active state on the items in the current collection.
+		 *
+		 * @method active
+		 * @return {tinymce.ui.Collection} Current collection instance or active state of the first item on a get operation.
+		 */
+		// active: function(state) {}, -- Generated by code below
+
+		/**
+		 * Sets/gets the selected state on the items in the current collection.
+		 *
+		 * @method selected
+		 * @return {tinymce.ui.Collection} Current collection instance or selected state of the first item on a get operation.
+		 */
+		// selected: function(state) {}, -- Generated by code below
+
+		/**
+		 * Sets/gets the selected state on the items in the current collection.
+		 *
+		 * @method visible
+		 * @return {tinymce.ui.Collection} Current collection instance or visible state of the first item on a get operation.
+		 */
+		// visible: function(state) {}, -- Generated by code below
+
+		/**
+		 * Adds a class to all items in the collection.
+		 *
+		 * @method addClass
+		 * @param {String} cls Class to add to each item.
+		 * @return {tinymce.ui.Collection} Current collection instance.
+		 */
+		// addClass: function(cls) {}, -- Generated by code below
+
+		/**
+		 * Removes the specified class from all items in collection.
+		 *
+		 * @method removeClass
+		 * @param {String} cls Class to remove from each item.
+		 * @return {tinymce.ui.Collection} Current collection instance.
+		 */
+		// removeClass: function(cls) {}, -- Generated by code below
+	};
+
+	// Extend tinymce.ui.Collection prototype with some generated control specific methods
+	Tools.each('fire on off show hide addClass removeClass append prepend before after reflow'.split(' '), function(name) {
+		proto[name] = function() {
+			var args = Tools.toArray(arguments);
+
+			this.each(function(ctrl) {
+				if (name in ctrl) {
+					ctrl[name].apply(ctrl, args);
+				}
+			});
+
+			return this;
+		};
+	});
+
+	// Extend tinymce.ui.Collection prototype with some property methods
+	Tools.each('text name disabled active selected checked visible parent value data'.split(' '), function(name) {
+		proto[name] = function(value) {
+			return this.prop(name, value);
+		};
+	});
+
+	// Create class based on the new prototype
+	Collection = Class.extend(proto);
+
+	// Stick Collection into Selector to prevent circual references
+	Selector.Collection = Collection;
+
+	return Collection;
+});
+
+// Included from: js/tinymce/classes/ui/DomUtils.js
+
+/**
+ * DOMUtils.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+define("tinymce/ui/DomUtils", [
+	"tinymce/util/Tools",
+	"tinymce/dom/DOMUtils"
+], function(Tools, DOMUtils) {
+	"use strict";
+
+	var count = 0;
+
+	return {
+		id: function() {
+			return 'mceu_' + (count++);
+		},
+
+		createFragment: function(html) {
+			return DOMUtils.DOM.createFragment(html);
+		},
+
+		getWindowSize: function() {
+			return DOMUtils.DOM.getViewPort();
+		},
+
+		getSize: function(elm) {
+			var width, height;
+
+			if (elm.getBoundingClientRect) {
+				var rect = elm.getBoundingClientRect();
+
+				width = Math.max(rect.width || (rect.right - rect.left), elm.offsetWidth);
+				height = Math.max(rect.height || (rect.bottom - rect.bottom), elm.offsetHeight);
+			} else {
+				width = elm.offsetWidth;
+				height = elm.offsetHeight;
+			}
+
+			return {width: width, height: height};
+		},
+
+		getPos: function(elm, root) {
+			return DOMUtils.DOM.getPos(elm, root);
+		},
+
+		getViewPort: function(win) {
+			return DOMUtils.DOM.getViewPort(win);
+		},
+
+		get: function(id) {
+			return document.getElementById(id);
+		},
+
+		addClass: function(elm, cls) {
+			return DOMUtils.DOM.addClass(elm, cls);
+		},
+
+		removeClass: function(elm, cls) {
+			return DOMUtils.DOM.removeClass(elm, cls);
+		},
+
+		hasClass: function(elm, cls) {
+			return DOMUtils.DOM.hasClass(elm, cls);
+		},
+
+		toggleClass: function(elm, cls, state) {
+			return DOMUtils.DOM.toggleClass(elm, cls, state);
+		},
+
+		css: function(elm, name, value) {
+			return DOMUtils.DOM.setStyle(elm, name, value);
+		},
+
+		getRuntimeStyle: function(elm, name) {
+			return DOMUtils.DOM.getStyle(elm, name, true);
+		},
+
+		on: function(target, name, callback, scope) {
+			return DOMUtils.DOM.bind(target, name, callback, scope);
+		},
+
+		off: function(target, name, callback) {
+			return DOMUtils.DOM.unbind(target, name, callback);
+		},
+
+		fire: function(target, name, args) {
+			return DOMUtils.DOM.fire(target, name, args);
+		},
+
+		innerHtml: function(elm, html) {
+			// Workaround for <div> in <p> bug on IE 8 #6178
+			DOMUtils.DOM.setHTML(elm, html);
+		}
+	};
+});
+
+// Included from: js/tinymce/classes/ui/Control.js
+
+/**
+ * Control.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*eslint consistent-this:0 */
+
+/**
+ * This is the base class for all controls and containers. All UI control instances inherit
+ * from this one as it has the base logic needed by all of them.
+ *
+ * @class tinymce.ui.Control
+ */
+define("tinymce/ui/Control", [
+	"tinymce/util/Class",
+	"tinymce/util/Tools",
+	"tinymce/util/EventDispatcher",
+	"tinymce/ui/Collection",
+	"tinymce/ui/DomUtils"
+], function(Class, Tools, EventDispatcher, Collection, DomUtils) {
+	"use strict";
+
+	var hasMouseWheelEventSupport = "onmousewheel" in document;
+	var hasWheelEventSupport = false;
+	var classPrefix = "mce-";
+
+	function getEventDispatcher(obj) {
+		if (!obj._eventDispatcher) {
+			obj._eventDispatcher = new EventDispatcher({
+				scope: obj,
+				toggleEvent: function(name, state) {
+					if (state && EventDispatcher.isNative(name)) {
+						if (!obj._nativeEvents) {
+							obj._nativeEvents = {};
+						}
+
+						obj._nativeEvents[name] = true;
+
+						if (obj._rendered) {
+							obj.bindPendingEvents();
+						}
+					}
+				}
+			});
+		}
+
+		return obj._eventDispatcher;
+	}
+
+	var Control = Class.extend({
+		Statics: {
+			classPrefix: classPrefix
+		},
+
+		isRtl: function() {
+			return Control.rtl;
+		},
+
+		/**
+		 * Class/id prefix to use for all controls.
+		 *
+		 * @final
+		 * @field {String} classPrefix
+		 */
+		classPrefix: classPrefix,
+
+		/**
+		 * Constructs a new control instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {String} style Style CSS properties to add.
+		 * @setting {String} border Border box values example: 1 1 1 1
+		 * @setting {String} padding Padding box values example: 1 1 1 1
+		 * @setting {String} margin Margin box values example: 1 1 1 1
+		 * @setting {Number} minWidth Minimal width for the control.
+		 * @setting {Number} minHeight Minimal height for the control.
+		 * @setting {String} classes Space separated list of classes to add.
+		 * @setting {String} role WAI-ARIA role to use for control.
+		 * @setting {Boolean} hidden Is the control hidden by default.
+		 * @setting {Boolean} disabled Is the control disabled by default.
+		 * @setting {String} name Name of the control instance.
+		 */
+		init: function(settings) {
+			var self = this, classes, i;
+
+			self.settings = settings = Tools.extend({}, self.Defaults, settings);
+
+			// Initial states
+			self._id = settings.id || DomUtils.id();
+			self._text = self._name = '';
+			self._width = self._height = 0;
+			self._aria = {role: settings.role};
+			this._elmCache = {};
+
+			// Setup classes
+			classes = settings.classes;
+			if (classes) {
+				classes = classes.split(' ');
+				classes.map = {};
+				i = classes.length;
+				while (i--) {
+					classes.map[classes[i]] = true;
+				}
+			}
+
+			self._classes = classes || [];
+			self.visible(true);
+
+			// Set some properties
+			Tools.each('title text width height name classes visible disabled active value'.split(' '), function(name) {
+				var value = settings[name], undef;
+
+				if (value !== undef) {
+					self[name](value);
+				} else if (self['_' + name] === undef) {
+					self['_' + name] = false;
+				}
+			});
+
+			self.on('click', function() {
+				if (self.disabled()) {
+					return false;
+				}
+			});
+
+			// TODO: Is this needed duplicate code see above?
+			if (settings.classes) {
+				Tools.each(settings.classes.split(' '), function(cls) {
+					self.addClass(cls);
+				});
+			}
+
+			/**
+			 * Name/value object with settings for the current control.
+			 *
+			 * @field {Object} settings
+			 */
+			self.settings = settings;
+
+			self._borderBox = self.parseBox(settings.border);
+			self._paddingBox = self.parseBox(settings.padding);
+			self._marginBox = self.parseBox(settings.margin);
+
+			if (settings.hidden) {
+				self.hide();
+			}
+		},
+
+		// Will generate getter/setter methods for these properties
+		Properties: 'parent,title,text,width,height,disabled,active,name,value',
+
+		// Will generate empty dummy functions for these
+		Methods: 'renderHtml',
+
+		/**
+		 * Returns the root element to render controls into.
+		 *
+		 * @method getContainerElm
+		 * @return {Element} HTML DOM element to render into.
+		 */
+		getContainerElm: function() {
+			return document.body;
+		},
+
+		/**
+		 * Returns a control instance for the current DOM element.
+		 *
+		 * @method getParentCtrl
+		 * @param {Element} elm HTML dom element to get parent control from.
+		 * @return {tinymce.ui.Control} Control instance or undefined.
+		 */
+		getParentCtrl: function(elm) {
+			var ctrl, lookup = this.getRoot().controlIdLookup;
+
+			while (elm && lookup) {
+				ctrl = lookup[elm.id];
+				if (ctrl) {
+					break;
+				}
+
+				elm = elm.parentNode;
+			}
+
+			return ctrl;
+		},
+
+		/**
+		 * Parses the specified box value. A box value contains 1-4 properties in clockwise order.
+		 *
+		 * @method parseBox
+		 * @param {String/Number} value Box value "0 1 2 3" or "0" etc.
+		 * @return {Object} Object with top/right/bottom/left properties.
+		 * @private
+		 */
+		parseBox: function(value) {
+			var len, radix = 10;
+
+			if (!value) {
+				return;
+			}
+
+			if (typeof value === "number") {
+				value = value || 0;
+
+				return {
+					top: value,
+					left: value,
+					bottom: value,
+					right: value
+				};
+			}
+
+			value = value.split(' ');
+			len = value.length;
+
+			if (len === 1) {
+				value[1] = value[2] = value[3] = value[0];
+			} else if (len === 2) {
+				value[2] = value[0];
+				value[3] = value[1];
+			} else if (len === 3) {
+				value[3] = value[1];
+			}
+
+			return {
+				top: parseInt(value[0], radix) || 0,
+				right: parseInt(value[1], radix) || 0,
+				bottom: parseInt(value[2], radix) || 0,
+				left: parseInt(value[3], radix) || 0
+			};
+		},
+
+		borderBox: function() {
+			return this._borderBox;
+		},
+
+		paddingBox: function() {
+			return this._paddingBox;
+		},
+
+		marginBox: function() {
+			return this._marginBox;
+		},
+
+		measureBox: function(elm, prefix) {
+			function getStyle(name) {
+				var defaultView = document.defaultView;
+
+				if (defaultView) {
+					// Remove camelcase
+					name = name.replace(/[A-Z]/g, function(a) {
+						return '-' + a;
+					});
+
+					return defaultView.getComputedStyle(elm, null).getPropertyValue(name);
+				}
+
+				return elm.currentStyle[name];
+			}
+
+			function getSide(name) {
+				var val = parseFloat(getStyle(name), 10);
+
+				return isNaN(val) ? 0 : val;
+			}
+
+			return {
+				top: getSide(prefix + "TopWidth"),
+				right: getSide(prefix + "RightWidth"),
+				bottom: getSide(prefix + "BottomWidth"),
+				left: getSide(prefix + "LeftWidth")
+			};
+		},
+
+		/**
+		 * Initializes the current controls layout rect.
+		 * This will be executed by the layout managers to determine the
+		 * default minWidth/minHeight etc.
+		 *
+		 * @method initLayoutRect
+		 * @return {Object} Layout rect instance.
+		 */
+		initLayoutRect: function() {
+			var self = this, settings = self.settings, borderBox, layoutRect;
+			var elm = self.getEl(), width, height, minWidth, minHeight, autoResize;
+			var startMinWidth, startMinHeight, initialSize;
+
+			// Measure the current element
+			borderBox = self._borderBox = self._borderBox || self.measureBox(elm, 'border');
+			self._paddingBox = self._paddingBox || self.measureBox(elm, 'padding');
+			self._marginBox = self._marginBox || self.measureBox(elm, 'margin');
+			initialSize = DomUtils.getSize(elm);
+
+			// Setup minWidth/minHeight and width/height
+			startMinWidth = settings.minWidth;
+			startMinHeight = settings.minHeight;
+			minWidth = startMinWidth || initialSize.width;
+			minHeight = startMinHeight || initialSize.height;
+			width = settings.width;
+			height = settings.height;
+			autoResize = settings.autoResize;
+			autoResize = typeof autoResize != "undefined" ? autoResize : !width && !height;
+
+			width = width || minWidth;
+			height = height || minHeight;
+
+			var deltaW = borderBox.left + borderBox.right;
+			var deltaH = borderBox.top + borderBox.bottom;
+
+			var maxW = settings.maxWidth || 0xFFFF;
+			var maxH = settings.maxHeight || 0xFFFF;
+
+			// Setup initial layout rect
+			self._layoutRect = layoutRect = {
+				x: settings.x || 0,
+				y: settings.y || 0,
+				w: width,
+				h: height,
+				deltaW: deltaW,
+				deltaH: deltaH,
+				contentW: width - deltaW,
+				contentH: height - deltaH,
+				innerW: width - deltaW,
+				innerH: height - deltaH,
+				startMinWidth: startMinWidth || 0,
+				startMinHeight: startMinHeight || 0,
+				minW: Math.min(minWidth, maxW),
+				minH: Math.min(minHeight, maxH),
+				maxW: maxW,
+				maxH: maxH,
+				autoResize: autoResize,
+				scrollW: 0
+			};
+
+			self._lastLayoutRect = {};
+
+			return layoutRect;
+		},
+
+		/**
+		 * Getter/setter for the current layout rect.
+		 *
+		 * @method layoutRect
+		 * @param {Object} [newRect] Optional new layout rect.
+		 * @return {tinymce.ui.Control/Object} Current control or rect object.
+		 */
+		layoutRect: function(newRect) {
+			var self = this, curRect = self._layoutRect, lastLayoutRect, size, deltaWidth, deltaHeight, undef, repaintControls;
+
+			// Initialize default layout rect
+			if (!curRect) {
+				curRect = self.initLayoutRect();
+			}
+
+			// Set new rect values
+			if (newRect) {
+				// Calc deltas between inner and outer sizes
+				deltaWidth = curRect.deltaW;
+				deltaHeight = curRect.deltaH;
+
+				// Set x position
+				if (newRect.x !== undef) {
+					curRect.x = newRect.x;
+				}
+
+				// Set y position
+				if (newRect.y !== undef) {
+					curRect.y = newRect.y;
+				}
+
+				// Set minW
+				if (newRect.minW !== undef) {
+					curRect.minW = newRect.minW;
+				}
+
+				// Set minH
+				if (newRect.minH !== undef) {
+					curRect.minH = newRect.minH;
+				}
+
+				// Set new width and calculate inner width
+				size = newRect.w;
+				if (size !== undef) {
+					size = size < curRect.minW ? curRect.minW : size;
+					size = size > curRect.maxW ? curRect.maxW : size;
+					curRect.w = size;
+					curRect.innerW = size - deltaWidth;
+				}
+
+				// Set new height and calculate inner height
+				size = newRect.h;
+				if (size !== undef) {
+					size = size < curRect.minH ? curRect.minH : size;
+					size = size > curRect.maxH ? curRect.maxH : size;
+					curRect.h = size;
+					curRect.innerH = size - deltaHeight;
+				}
+
+				// Set new inner width and calculate width
+				size = newRect.innerW;
+				if (size !== undef) {
+					size = size < curRect.minW - deltaWidth ? curRect.minW - deltaWidth : size;
+					size = size > curRect.maxW - deltaWidth ? curRect.maxW - deltaWidth : size;
+					curRect.innerW = size;
+					curRect.w = size + deltaWidth;
+				}
+
+				// Set new height and calculate inner height
+				size = newRect.innerH;
+				if (size !== undef) {
+					size = size < curRect.minH - deltaHeight ? curRect.minH - deltaHeight : size;
+					size = size > curRect.maxH - deltaHeight ? curRect.maxH - deltaHeight : size;
+					curRect.innerH = size;
+					curRect.h = size + deltaHeight;
+				}
+
+				// Set new contentW
+				if (newRect.contentW !== undef) {
+					curRect.contentW = newRect.contentW;
+				}
+
+				// Set new contentH
+				if (newRect.contentH !== undef) {
+					curRect.contentH = newRect.contentH;
+				}
+
+				// Compare last layout rect with the current one to see if we need to repaint or not
+				lastLayoutRect = self._lastLayoutRect;
+				if (lastLayoutRect.x !== curRect.x || lastLayoutRect.y !== curRect.y ||
+					lastLayoutRect.w !== curRect.w || lastLayoutRect.h !== curRect.h) {
+					repaintControls = Control.repaintControls;
+
+					if (repaintControls) {
+						if (repaintControls.map && !repaintControls.map[self._id]) {
+							repaintControls.push(self);
+							repaintControls.map[self._id] = true;
+						}
+					}
+
+					lastLayoutRect.x = curRect.x;
+					lastLayoutRect.y = curRect.y;
+					lastLayoutRect.w = curRect.w;
+					lastLayoutRect.h = curRect.h;
+				}
+
+				return self;
+			}
+
+			return curRect;
+		},
+
+		/**
+		 * Repaints the control after a layout operation.
+		 *
+		 * @method repaint
+		 */
+		repaint: function() {
+			var self = this, style, bodyStyle, rect, borderBox, borderW = 0, borderH = 0, lastRepaintRect, round;
+
+			// Use Math.round on all values on IE < 9
+			round = !document.createRange ? Math.round : function(value) {
+				return value;
+			};
+
+			style = self.getEl().style;
+			rect = self._layoutRect;
+			lastRepaintRect = self._lastRepaintRect || {};
+
+			borderBox = self._borderBox;
+			borderW = borderBox.left + borderBox.right;
+			borderH = borderBox.top + borderBox.bottom;
+
+			if (rect.x !== lastRepaintRect.x) {
+				style.left = round(rect.x) + 'px';
+				lastRepaintRect.x = rect.x;
+			}
+
+			if (rect.y !== lastRepaintRect.y) {
+				style.top = round(rect.y) + 'px';
+				lastRepaintRect.y = rect.y;
+			}
+
+			if (rect.w !== lastRepaintRect.w) {
+				style.width = round(rect.w - borderW) + 'px';
+				lastRepaintRect.w = rect.w;
+			}
+
+			if (rect.h !== lastRepaintRect.h) {
+				style.height = round(rect.h - borderH) + 'px';
+				lastRepaintRect.h = rect.h;
+			}
+
+			// Update body if needed
+			if (self._hasBody && rect.innerW !== lastRepaintRect.innerW) {
+				bodyStyle = self.getEl('body').style;
+				bodyStyle.width = round(rect.innerW) + 'px';
+				lastRepaintRect.innerW = rect.innerW;
+			}
+
+			if (self._hasBody && rect.innerH !== lastRepaintRect.innerH) {
+				bodyStyle = bodyStyle || self.getEl('body').style;
+				bodyStyle.height = round(rect.innerH) + 'px';
+				lastRepaintRect.innerH = rect.innerH;
+			}
+
+			self._lastRepaintRect = lastRepaintRect;
+			self.fire('repaint', {}, false);
+		},
+
+		/**
+		 * Binds a callback to the specified event. This event can both be
+		 * native browser events like "click" or custom ones like PostRender.
+		 *
+		 * The callback function will be passed a DOM event like object that enables yout do stop propagation.
+		 *
+		 * @method on
+		 * @param {String} name Name of the event to bind. For example "click".
+		 * @param {String/function} callback Callback function to execute ones the event occurs.
+		 * @return {tinymce.ui.Control} Current control object.
+		 */
+		on: function(name, callback) {
+			var self = this;
+
+			function resolveCallbackName(name) {
+				var callback, scope;
+
+				if (typeof name != 'string') {
+					return name;
+				}
+
+				return function(e) {
+					if (!callback) {
+						self.parentsAndSelf().each(function(ctrl) {
+							var callbacks = ctrl.settings.callbacks;
+
+							if (callbacks && (callback = callbacks[name])) {
+								scope = ctrl;
+								return false;
+							}
+						});
+					}
+
+					return callback.call(scope, e);
+				};
+			}
+
+			getEventDispatcher(self).on(name, resolveCallbackName(callback));
+
+			return self;
+		},
+
+		/**
+		 * Unbinds the specified event and optionally a specific callback. If you omit the name
+		 * parameter all event handlers will be removed. If you omit the callback all event handles
+		 * by the specified name will be removed.
+		 *
+		 * @method off
+		 * @param {String} [name] Name for the event to unbind.
+		 * @param {function} [callback] Callback function to unbind.
+		 * @return {mxex.ui.Control} Current control object.
+		 */
+		off: function(name, callback) {
+			getEventDispatcher(this).off(name, callback);
+			return this;
+		},
+
+		/**
+		 * Fires the specified event by name and arguments on the control. This will execute all
+		 * bound event handlers.
+		 *
+		 * @method fire
+		 * @param {String} name Name of the event to fire.
+		 * @param {Object} [args] Arguments to pass to the event.
+		 * @param {Boolean} [bubble] Value to control bubbeling. Defaults to true.
+		 * @return {Object} Current arguments object.
+		 */
+		fire: function(name, args, bubble) {
+			var self = this;
+
+			args = args || {};
+
+			if (!args.control) {
+				args.control = self;
+			}
+
+			args = getEventDispatcher(self).fire(name, args);
+
+			// Bubble event up to parents
+			if (bubble !== false && self.parent) {
+				var parent = self.parent();
+				while (parent && !args.isPropagationStopped()) {
+					parent.fire(name, args, false);
+					parent = parent.parent();
+				}
+			}
+
+			return args;
+		},
+
+		/**
+		 * Returns true/false if the specified event has any listeners.
+		 *
+		 * @method hasEventListeners
+		 * @param {String} name Name of the event to check for.
+		 * @return {Boolean} True/false state if the event has listeners.
+		 */
+		hasEventListeners: function(name) {
+			return getEventDispatcher(this).has(name);
+		},
+
+		/**
+		 * Returns a control collection with all parent controls.
+		 *
+		 * @method parents
+		 * @param {String} selector Optional selector expression to find parents.
+		 * @return {tinymce.ui.Collection} Collection with all parent controls.
+		 */
+		parents: function(selector) {
+			var self = this, ctrl, parents = new Collection();
+
+			// Add each parent to collection
+			for (ctrl = self.parent(); ctrl; ctrl = ctrl.parent()) {
+				parents.add(ctrl);
+			}
+
+			// Filter away everything that doesn't match the selector
+			if (selector) {
+				parents = parents.filter(selector);
+			}
+
+			return parents;
+		},
+
+		/**
+		 * Returns the current control and it's parents.
+		 *
+		 * @method parentsAndSelf
+		 * @param {String} selector Optional selector expression to find parents.
+		 * @return {tinymce.ui.Collection} Collection with all parent controls.
+		 */
+		parentsAndSelf: function(selector) {
+			return new Collection(this).add(this.parents(selector));
+		},
+
+		/**
+		 * Returns the control next to the current control.
+		 *
+		 * @method next
+		 * @return {tinymce.ui.Control} Next control instance.
+		 */
+		next: function() {
+			var parentControls = this.parent().items();
+
+			return parentControls[parentControls.indexOf(this) + 1];
+		},
+
+		/**
+		 * Returns the control previous to the current control.
+		 *
+		 * @method prev
+		 * @return {tinymce.ui.Control} Previous control instance.
+		 */
+		prev: function() {
+			var parentControls = this.parent().items();
+
+			return parentControls[parentControls.indexOf(this) - 1];
+		},
+
+		/**
+		 * Find the common ancestor for two control instances.
+		 *
+		 * @method findCommonAncestor
+		 * @param {tinymce.ui.Control} ctrl1 First control.
+		 * @param {tinymce.ui.Control} ctrl2 Second control.
+		 * @return {tinymce.ui.Control} Ancestor control instance.
+		 */
+		findCommonAncestor: function(ctrl1, ctrl2) {
+			var parentCtrl;
+
+			while (ctrl1) {
+				parentCtrl = ctrl2;
+
+				while (parentCtrl && ctrl1 != parentCtrl) {
+					parentCtrl = parentCtrl.parent();
+				}
+
+				if (ctrl1 == parentCtrl) {
+					break;
+				}
+
+				ctrl1 = ctrl1.parent();
+			}
+
+			return ctrl1;
+		},
+
+		/**
+		 * Returns true/false if the specific control has the specific class.
+		 *
+		 * @method hasClass
+		 * @param {String} cls Class to check for.
+		 * @param {String} [group] Sub element group name.
+		 * @return {Boolean} True/false if the control has the specified class.
+		 */
+		hasClass: function(cls, group) {
+			var classes = this._classes[group || 'control'];
+
+			cls = this.classPrefix + cls;
+
+			return classes && !!classes.map[cls];
+		},
+
+		/**
+		 * Adds the specified class to the control
+		 *
+		 * @method addClass
+		 * @param {String} cls Class to check for.
+		 * @param {String} [group] Sub element group name.
+		 * @return {tinymce.ui.Control} Current control object.
+		 */
+		addClass: function(cls, group) {
+			var self = this, classes, elm;
+
+			cls = this.classPrefix + cls;
+			classes = self._classes[group || 'control'];
+
+			if (!classes) {
+				classes = [];
+				classes.map = {};
+				self._classes[group || 'control'] = classes;
+			}
+
+			if (!classes.map[cls]) {
+				classes.map[cls] = cls;
+				classes.push(cls);
+
+				if (self._rendered) {
+					elm = self.getEl(group);
+
+					if (elm) {
+						elm.className = classes.join(' ');
+					}
+				}
+			}
+
+			return self;
+		},
+
+		/**
+		 * Removes the specified class from the control.
+		 *
+		 * @method removeClass
+		 * @param {String} cls Class to remove.
+		 * @param {String} [group] Sub element group name.
+		 * @return {tinymce.ui.Control} Current control object.
+		 */
+		removeClass: function(cls, group) {
+			var self = this, classes, i, elm;
+
+			cls = this.classPrefix + cls;
+			classes = self._classes[group || 'control'];
+			if (classes && classes.map[cls]) {
+				delete classes.map[cls];
+
+				i = classes.length;
+				while (i--) {
+					if (classes[i] === cls) {
+						classes.splice(i, 1);
+					}
+				}
+			}
+
+			if (self._rendered) {
+				elm = self.getEl(group);
+
+				if (elm) {
+					elm.className = classes.join(' ');
+				}
+			}
+
+			return self;
+		},
+
+		/**
+		 * Toggles the specified class on the control.
+		 *
+		 * @method toggleClass
+		 * @param {String} cls Class to remove.
+		 * @param {Boolean} state True/false state to add/remove class.
+		 * @param {String} [group] Sub element group name.
+		 * @return {tinymce.ui.Control} Current control object.
+		 */
+		toggleClass: function(cls, state, group) {
+			var self = this;
+
+			if (state) {
+				self.addClass(cls, group);
+			} else {
+				self.removeClass(cls, group);
+			}
+
+			return self;
+		},
+
+		/**
+		 * Returns the class string for the specified group name.
+		 *
+		 * @method classes
+		 * @param {String} [group] Group to get clases by.
+		 * @return {String} Classes for the specified group.
+		 */
+		classes: function(group) {
+			var classes = this._classes[group || 'control'];
+
+			return classes ? classes.join(' ') : '';
+		},
+
+		/**
+		 * Sets the inner HTML of the control element.
+		 *
+		 * @method innerHtml
+		 * @param {String} html Html string to set as inner html.
+		 * @return {tinymce.ui.Control} Current control object.
+		 */
+		innerHtml: function(html) {
+			DomUtils.innerHtml(this.getEl(), html);
+			return this;
+		},
+
+		/**
+		 * Returns the control DOM element or sub element.
+		 *
+		 * @method getEl
+		 * @param {String} [suffix] Suffix to get element by.
+		 * @return {Element} HTML DOM element for the current control or it's children.
+		 */
+		getEl: function(suffix) {
+			var id = suffix ? this._id + '-' + suffix : this._id;
+
+			if (!this._elmCache[id]) {
+				this._elmCache[id] = DomUtils.get(id);
+			}
+
+			return this._elmCache[id];
+		},
+
+		/**
+		 * Sets/gets the visible for the control.
+		 *
+		 * @method visible
+		 * @param {Boolean} state Value to set to control.
+		 * @return {Boolean/tinymce.ui.Control} Current control on a set operation or current state on a get.
+		 */
+		visible: function(state) {
+			var self = this, parentCtrl;
+
+			if (typeof state !== "undefined") {
+				if (self._visible !== state) {
+					if (self._rendered) {
+						self.getEl().style.display = state ? '' : 'none';
+					}
+
+					self._visible = state;
+
+					// Parent container needs to reflow
+					parentCtrl = self.parent();
+					if (parentCtrl) {
+						parentCtrl._lastRect = null;
+					}
+
+					self.fire(state ? 'show' : 'hide');
+				}
+
+				return self;
+			}
+
+			return self._visible;
+		},
+
+		/**
+		 * Sets the visible state to true.
+		 *
+		 * @method show
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		show: function() {
+			return this.visible(true);
+		},
+
+		/**
+		 * Sets the visible state to false.
+		 *
+		 * @method hide
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		hide: function() {
+			return this.visible(false);
+		},
+
+		/**
+		 * Focuses the current control.
+		 *
+		 * @method focus
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		focus: function() {
+			try {
+				this.getEl().focus();
+			} catch (ex) {
+				// Ignore IE error
+			}
+
+			return this;
+		},
+
+		/**
+		 * Blurs the current control.
+		 *
+		 * @method blur
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		blur: function() {
+			this.getEl().blur();
+
+			return this;
+		},
+
+		/**
+		 * Sets the specified aria property.
+		 *
+		 * @method aria
+		 * @param {String} name Name of the aria property to set.
+		 * @param {String} value Value of the aria property.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		aria: function(name, value) {
+			var self = this, elm = self.getEl(self.ariaTarget);
+
+			if (typeof value === "undefined") {
+				return self._aria[name];
+			} else {
+				self._aria[name] = value;
+			}
+
+			if (self._rendered) {
+				elm.setAttribute(name == 'role' ? name : 'aria-' + name, value);
+			}
+
+			return self;
+		},
+
+		/**
+		 * Encodes the specified string with HTML entities. It will also
+		 * translate the string to different languages.
+		 *
+		 * @method encode
+		 * @param {String/Object/Array} text Text to entity encode.
+		 * @param {Boolean} [translate=true] False if the contents shouldn't be translated.
+		 * @return {String} Encoded and possible traslated string.
+		 */
+		encode: function(text, translate) {
+			if (translate !== false) {
+				text = this.translate(text);
+			}
+
+			return (text || '').replace(/[&<>"]/g, function(match) {
+				return '&#' + match.charCodeAt(0) + ';';
+			});
+		},
+
+		/**
+		 * Returns the translated string.
+		 *
+		 * @method translate
+		 * @param {String} text Text to translate.
+		 * @return {String} Translated string or the same as the input.
+		 */
+		translate: function(text) {
+			return Control.translate ? Control.translate(text) : text;
+		},
+
+		/**
+		 * Adds items before the current control.
+		 *
+		 * @method before
+		 * @param {Array/tinymce.ui.Collection} items Array of items to prepend before this control.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		before: function(items) {
+			var self = this, parent = self.parent();
+
+			if (parent) {
+				parent.insert(items, parent.items().indexOf(self), true);
+			}
+
+			return self;
+		},
+
+		/**
+		 * Adds items after the current control.
+		 *
+		 * @method after
+		 * @param {Array/tinymce.ui.Collection} items Array of items to append after this control.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		after: function(items) {
+			var self = this, parent = self.parent();
+
+			if (parent) {
+				parent.insert(items, parent.items().indexOf(self));
+			}
+
+			return self;
+		},
+
+		/**
+		 * Removes the current control from DOM and from UI collections.
+		 *
+		 * @method remove
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		remove: function() {
+			var self = this, elm = self.getEl(), parent = self.parent(), newItems, i;
+
+			if (self.items) {
+				var controls = self.items().toArray();
+				i = controls.length;
+				while (i--) {
+					controls[i].remove();
+				}
+			}
+
+			if (parent && parent.items) {
+				newItems = [];
+
+				parent.items().each(function(item) {
+					if (item !== self) {
+						newItems.push(item);
+					}
+				});
+
+				parent.items().set(newItems);
+				parent._lastRect = null;
+			}
+
+			if (self._eventsRoot && self._eventsRoot == self) {
+				DomUtils.off(elm);
+			}
+
+			var lookup = self.getRoot().controlIdLookup;
+			if (lookup) {
+				delete lookup[self._id];
+			}
+
+			if (elm && elm.parentNode) {
+				elm.parentNode.removeChild(elm);
+			}
+
+			self._rendered = false;
+
+			return self;
+		},
+
+		/**
+		 * Renders the control before the specified element.
+		 *
+		 * @method renderBefore
+		 * @param {Element} elm Element to render before.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		renderBefore: function(elm) {
+			var self = this;
+
+			elm.parentNode.insertBefore(DomUtils.createFragment(self.renderHtml()), elm);
+			self.postRender();
+
+			return self;
+		},
+
+		/**
+		 * Renders the control to the specified element.
+		 *
+		 * @method renderBefore
+		 * @param {Element} elm Element to render to.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		renderTo: function(elm) {
+			var self = this;
+
+			elm = elm || self.getContainerElm();
+			elm.appendChild(DomUtils.createFragment(self.renderHtml()));
+			self.postRender();
+
+			return self;
+		},
+
+		/**
+		 * Post render method. Called after the control has been rendered to the target.
+		 *
+		 * @method postRender
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		postRender: function() {
+			var self = this, settings = self.settings, elm, box, parent, name, parentEventsRoot;
+
+			// Bind on<event> settings
+			for (name in settings) {
+				if (name.indexOf("on") === 0) {
+					self.on(name.substr(2), settings[name]);
+				}
+			}
+
+			if (self._eventsRoot) {
+				for (parent = self.parent(); !parentEventsRoot && parent; parent = parent.parent()) {
+					parentEventsRoot = parent._eventsRoot;
+				}
+
+				if (parentEventsRoot) {
+					for (name in parentEventsRoot._nativeEvents) {
+						self._nativeEvents[name] = true;
+					}
+				}
+			}
+
+			self.bindPendingEvents();
+
+			if (settings.style) {
+				elm = self.getEl();
+				if (elm) {
+					elm.setAttribute('style', settings.style);
+					elm.style.cssText = settings.style;
+				}
+			}
+
+			if (!self._visible) {
+				DomUtils.css(self.getEl(), 'display', 'none');
+			}
+
+			if (self.settings.border) {
+				box = self.borderBox();
+				DomUtils.css(self.getEl(), {
+					'border-top-width': box.top,
+					'border-right-width': box.right,
+					'border-bottom-width': box.bottom,
+					'border-left-width': box.left
+				});
+			}
+
+			// Add instance to lookup
+			var root = self.getRoot();
+			if (!root.controlIdLookup) {
+				root.controlIdLookup = {};
+			}
+
+			root.controlIdLookup[self._id] = self;
+
+			for (var key in self._aria) {
+				self.aria(key, self._aria[key]);
+			}
+
+			self.fire('postrender', {}, false);
+		},
+
+		/**
+		 * Scrolls the current control into view.
+		 *
+		 * @method scrollIntoView
+		 * @param {String} align Alignment in view top|center|bottom.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		scrollIntoView: function(align) {
+			function getOffset(elm, rootElm) {
+				var x, y, parent = elm;
+
+				x = y = 0;
+				while (parent && parent != rootElm && parent.nodeType) {
+					x += parent.offsetLeft || 0;
+					y += parent.offsetTop || 0;
+					parent = parent.offsetParent;
+				}
+
+				return {x: x, y: y};
+			}
+
+			var elm = this.getEl(), parentElm = elm.parentNode;
+			var x, y, width, height, parentWidth, parentHeight;
+			var pos = getOffset(elm, parentElm);
+
+			x = pos.x;
+			y = pos.y;
+			width = elm.offsetWidth;
+			height = elm.offsetHeight;
+			parentWidth = parentElm.clientWidth;
+			parentHeight = parentElm.clientHeight;
+
+			if (align == "end") {
+				x -= parentWidth - width;
+				y -= parentHeight - height;
+			} else if (align == "center") {
+				x -= (parentWidth / 2) - (width / 2);
+				y -= (parentHeight / 2) - (height / 2);
+			}
+
+			parentElm.scrollLeft = x;
+			parentElm.scrollTop = y;
+
+			return this;
+		},
+
+		/**
+		 * Binds pending DOM events.
+		 *
+		 * @private
+		 */
+		bindPendingEvents: function() {
+			var self = this, i, l, parents, eventRootCtrl, nativeEvents, name;
+
+			function delegate(e) {
+				var control = self.getParentCtrl(e.target);
+
+				if (control) {
+					control.fire(e.type, e);
+				}
+			}
+
+			function mouseLeaveHandler() {
+				var ctrl = eventRootCtrl._lastHoverCtrl;
+
+				if (ctrl) {
+					ctrl.fire("mouseleave", {target: ctrl.getEl()});
+
+					ctrl.parents().each(function(ctrl) {
+						ctrl.fire("mouseleave", {target: ctrl.getEl()});
+					});
+
+					eventRootCtrl._lastHoverCtrl = null;
+				}
+			}
+
+			function mouseEnterHandler(e) {
+				var ctrl = self.getParentCtrl(e.target), lastCtrl = eventRootCtrl._lastHoverCtrl, idx = 0, i, parents, lastParents;
+
+				// Over on a new control
+				if (ctrl !== lastCtrl) {
+					eventRootCtrl._lastHoverCtrl = ctrl;
+
+					parents = ctrl.parents().toArray().reverse();
+					parents.push(ctrl);
+
+					if (lastCtrl) {
+						lastParents = lastCtrl.parents().toArray().reverse();
+						lastParents.push(lastCtrl);
+
+						for (idx = 0; idx < lastParents.length; idx++) {
+							if (parents[idx] !== lastParents[idx]) {
+								break;
+							}
+						}
+
+						for (i = lastParents.length - 1; i >= idx; i--) {
+							lastCtrl = lastParents[i];
+							lastCtrl.fire("mouseleave", {
+								target: lastCtrl.getEl()
+							});
+						}
+					}
+
+					for (i = idx; i < parents.length; i++) {
+						ctrl = parents[i];
+						ctrl.fire("mouseenter", {
+							target: ctrl.getEl()
+						});
+					}
+				}
+			}
+
+			function fixWheelEvent(e) {
+				e.preventDefault();
+
+				if (e.type == "mousewheel") {
+					e.deltaY = -1 / 40 * e.wheelDelta;
+
+					if (e.wheelDeltaX) {
+						e.deltaX = -1 / 40 * e.wheelDeltaX;
+					}
+				} else {
+					e.deltaX = 0;
+					e.deltaY = e.detail;
+				}
+
+				e = self.fire("wheel", e);
+			}
+
+			self._rendered = true;
+
+			nativeEvents = self._nativeEvents;
+			if (nativeEvents) {
+				// Find event root element if it exists
+				parents = self.parents().toArray();
+				parents.unshift(self);
+				for (i = 0, l = parents.length; !eventRootCtrl && i < l; i++) {
+					eventRootCtrl = parents[i]._eventsRoot;
+				}
+
+				// Event root wasn't found the use the root control
+				if (!eventRootCtrl) {
+					eventRootCtrl = parents[parents.length - 1] || self;
+				}
+
+				// Set the eventsRoot property on children that didn't have it
+				self._eventsRoot = eventRootCtrl;
+				for (l = i, i = 0; i < l; i++) {
+					parents[i]._eventsRoot = eventRootCtrl;
+				}
+
+				var eventRootDelegates = eventRootCtrl._delegates;
+				if (!eventRootDelegates) {
+					eventRootDelegates = eventRootCtrl._delegates = {};
+				}
+
+				// Bind native event delegates
+				for (name in nativeEvents) {
+					if (!nativeEvents) {
+						return false;
+					}
+
+					if (name === "wheel" && !hasWheelEventSupport) {
+						if (hasMouseWheelEventSupport) {
+							DomUtils.on(self.getEl(), "mousewheel", fixWheelEvent);
+						} else {
+							DomUtils.on(self.getEl(), "DOMMouseScroll", fixWheelEvent);
+						}
+
+						continue;
+					}
+
+					// Special treatment for mousenter/mouseleave since these doesn't bubble
+					if (name === "mouseenter" || name === "mouseleave") {
+						// Fake mousenter/mouseleave
+						if (!eventRootCtrl._hasMouseEnter) {
+							DomUtils.on(eventRootCtrl.getEl(), "mouseleave", mouseLeaveHandler);
+							DomUtils.on(eventRootCtrl.getEl(), "mouseover", mouseEnterHandler);
+							eventRootCtrl._hasMouseEnter = 1;
+						}
+					} else if (!eventRootDelegates[name]) {
+						DomUtils.on(eventRootCtrl.getEl(), name, delegate);
+						eventRootDelegates[name] = true;
+					}
+
+					// Remove the event once it's bound
+					nativeEvents[name] = false;
+				}
+			}
+		},
+
+		getRoot: function() {
+			var ctrl = this, rootControl, parents = [];
+
+			while (ctrl) {
+				if (ctrl.rootControl) {
+					rootControl = ctrl.rootControl;
+					break;
+				}
+
+				parents.push(ctrl);
+				rootControl = ctrl;
+				ctrl = ctrl.parent();
+			}
+
+			if (!rootControl) {
+				rootControl = this;
+			}
+
+			var i = parents.length;
+			while (i--) {
+				parents[i].rootControl = rootControl;
+			}
+
+			return rootControl;
+		},
+
+		/**
+		 * Reflows the current control and it's parents.
+		 * This should be used after you for example append children to the current control so
+		 * that the layout managers know that they need to reposition everything.
+		 *
+		 * @example
+		 * container.append({type: 'button', text: 'My button'}).reflow();
+		 *
+		 * @method reflow
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		reflow: function() {
+			this.repaint();
+
+			return this;
+		}
+
+		/**
+		 * Sets/gets the parent container for the control.
+		 *
+		 * @method parent
+		 * @param {tinymce.ui.Container} parent Optional parent to set.
+		 * @return {tinymce.ui.Control} Parent control or the current control on a set action.
+		 */
+		// parent: function(parent) {} -- Generated
+
+		/**
+		 * Sets/gets the text for the control.
+		 *
+		 * @method text
+		 * @param {String} value Value to set to control.
+		 * @return {String/tinymce.ui.Control} Current control on a set operation or current value on a get.
+		 */
+		// text: function(value) {} -- Generated
+
+		/**
+		 * Sets/gets the width for the control.
+		 *
+		 * @method width
+		 * @param {Number} value Value to set to control.
+		 * @return {Number/tinymce.ui.Control} Current control on a set operation or current value on a get.
+		 */
+		// width: function(value) {} -- Generated
+
+		/**
+		 * Sets/gets the height for the control.
+		 *
+		 * @method height
+		 * @param {Number} value Value to set to control.
+		 * @return {Number/tinymce.ui.Control} Current control on a set operation or current value on a get.
+		 */
+		// height: function(value) {} -- Generated
+
+		/**
+		 * Sets/gets the disabled state on the control.
+		 *
+		 * @method disabled
+		 * @param {Boolean} state Value to set to control.
+		 * @return {Boolean/tinymce.ui.Control} Current control on a set operation or current state on a get.
+		 */
+		// disabled: function(state) {} -- Generated
+
+		/**
+		 * Sets/gets the active for the control.
+		 *
+		 * @method active
+		 * @param {Boolean} state Value to set to control.
+		 * @return {Boolean/tinymce.ui.Control} Current control on a set operation or current state on a get.
+		 */
+		// active: function(state) {} -- Generated
+
+		/**
+		 * Sets/gets the name for the control.
+		 *
+		 * @method name
+		 * @param {String} value Value to set to control.
+		 * @return {String/tinymce.ui.Control} Current control on a set operation or current value on a get.
+		 */
+		// name: function(value) {} -- Generated
+
+		/**
+		 * Sets/gets the title for the control.
+		 *
+		 * @method title
+		 * @param {String} value Value to set to control.
+		 * @return {String/tinymce.ui.Control} Current control on a set operation or current value on a get.
+		 */
+		// title: function(value) {} -- Generated
+	});
+
+	return Control;
+});
+
+// Included from: js/tinymce/classes/ui/Factory.js
+
+/**
+ * Factory.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+/**
+ * This class is a factory for control instances. This enables you
+ * to create instances of controls without having to require the UI controls directly.
+ *
+ * It also allow you to override or add new control types.
+ *
+ * @class tinymce.ui.Factory
+ */
+define("tinymce/ui/Factory", [], function() {
+	"use strict";
+
+	var types = {}, namespaceInit;
+
+	return {
+		/**
+		 * Adds a new control instance type to the factory.
+		 *
+		 * @method add
+		 * @param {String} type Type name for example "button".
+		 * @param {function} typeClass Class type function.
+		 */
+		add: function(type, typeClass) {
+			types[type.toLowerCase()] = typeClass;
+		},
+
+		/**
+		 * Returns true/false if the specified type exists or not.
+		 *
+		 * @method has
+		 * @param {String} type Type to look for.
+		 * @return {Boolean} true/false if the control by name exists.
+		 */
+		has: function(type) {
+			return !!types[type.toLowerCase()];
+		},
+
+		/**
+		 * Creates a new control instance based on the settings provided. The instance created will be
+		 * based on the specified type property it can also create whole structures of components out of
+		 * the specified JSON object.
+		 *
+		 * @example
+		 * tinymce.ui.Factory.create({
+		 *     type: 'button',
+		 *     text: 'Hello world!'
+		 * });
+		 *
+		 * @method create
+		 * @param {Object/String} settings Name/Value object with items used to create the type.
+		 * @return {tinymce.ui.Control} Control instance based on the specified type.
+		 */
+		create: function(type, settings) {
+			var ControlType, name, namespace;
+
+			// Build type lookup
+			if (!namespaceInit) {
+				namespace = tinymce.ui;
+
+				for (name in namespace) {
+					types[name.toLowerCase()] = namespace[name];
+				}
+
+				namespaceInit = true;
+			}
+
+			// If string is specified then use it as the type
+			if (typeof type == 'string') {
+				settings = settings || {};
+				settings.type = type;
+			} else {
+				settings = type;
+				type = settings.type;
+			}
+
+			// Find control type
+			type = type.toLowerCase();
+			ControlType = types[type];
+
+			// #if debug
+
+			if (!ControlType) {
+				throw new Error("Could not find control by type: " + type);
+			}
+
+			// #endif
+
+			ControlType = new ControlType(settings);
+			ControlType.type = type; // Set the type on the instance, this will be used by the Selector engine
+
+			return ControlType;
+		}
+	};
+});
+
+// Included from: js/tinymce/classes/ui/KeyboardNavigation.js
+
+/**
+ * KeyboardNavigation.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles keyboard navigation of controls and elements.
+ *
+ * @class tinymce.ui.KeyboardNavigation
+ */
+define("tinymce/ui/KeyboardNavigation", [
+], function() {
+	"use strict";
+
+	/**
+	 * This class handles all keyboard navigation for WAI-ARIA support. Each root container
+	 * gets an instance of this class.
+	 *
+	 * @constructor
+	 */
+	return function(settings) {
+		var root = settings.root, focusedElement, focusedControl;
+
+		try {
+			focusedElement = document.activeElement;
+		} catch (ex) {
+			// IE sometimes fails to return a proper element
+			focusedElement = document.body;
+		}
+
+		focusedControl = root.getParentCtrl(focusedElement);
+
+		/**
+		 * Returns the currently focused elements wai aria role of the currently
+		 * focused element or specified element.
+		 *
+		 * @private
+		 * @param {Element} elm Optional element to get role from.
+		 * @return {String} Role of specified element.
+		 */
+		function getRole(elm) {
+			elm = elm || focusedElement;
+
+			return elm && elm.getAttribute('role');
+		}
+
+		/**
+		 * Returns the wai role of the parent element of the currently
+		 * focused element or specified element.
+		 *
+		 * @private
+		 * @param {Element} elm Optional element to get parent role from.
+		 * @return {String} Role of the first parent that has a role.
+		 */
+		function getParentRole(elm) {
+			var role, parent = elm || focusedElement;
+
+			while ((parent = parent.parentNode)) {
+				if ((role = getRole(parent))) {
+					return role;
+				}
+			}
+		}
+
+		/**
+		 * Returns a wai aria property by name for example aria-selected.
+		 *
+		 * @private
+		 * @param {String} name Name of the aria property to get for example "disabled".
+		 * @return {String} Aria property value.
+		 */
+		function getAriaProp(name) {
+			var elm = focusedElement;
+
+			if (elm) {
+				return elm.getAttribute('aria-' + name);
+			}
+		}
+
+		/**
+		 * Is the element a text input element or not.
+		 *
+		 * @private
+		 * @param {Element} elm Element to check if it's an text input element or not.
+		 * @return {Boolean} True/false if the element is a text element or not.
+		 */
+		function isTextInputElement(elm) {
+			var tagName = elm.tagName.toUpperCase();
+
+			// Notice: since type can be "email" etc we don't check the type
+			// So all input elements gets treated as text input elements
+			return tagName == "INPUT" || tagName == "TEXTAREA";
+		}
+
+		/**
+		 * Returns true/false if the specified element can be focused or not.
+		 *
+		 * @private
+		 * @param {Element} elm DOM element to check if it can be focused or not.
+		 * @return {Boolean} True/false if the element can have focus.
+		 */
+		function canFocus(elm) {
+			if (isTextInputElement(elm) && !elm.hidden) {
+				return true;
+			}
+
+			if (/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell)$/.test(getRole(elm))) {
+				return true;
+			}
+
+			return false;
+		}
+
+		/**
+		 * Returns an array of focusable visible elements within the specified container element.
+		 *
+		 * @private
+		 * @param {Element} elm DOM element to find focusable elements within.
+		 * @return {Array} Array of focusable elements.
+		 */
+		function getFocusElements(elm) {
+			var elements = [];
+
+			function collect(elm) {
+				if (elm.nodeType != 1 || elm.style.display == 'none') {
+					return;
+				}
+
+				if (canFocus(elm)) {
+					elements.push(elm);
+				}
+
+				for (var i = 0; i < elm.childNodes.length; i++) {
+					collect(elm.childNodes[i]);
+				}
+			}
+
+			collect(elm || root.getEl());
+
+			return elements;
+		}
+
+		/**
+		 * Returns the navigation root control for the specified control. The navigation root
+		 * is the control that the keyboard navigation gets scoped to for example a menubar or toolbar group.
+		 * It will look for parents of the specified target control or the currently focused control if this option is omitted.
+		 *
+		 * @private
+		 * @param {tinymce.ui.Control} targetControl Optional target control to find root of.
+		 * @return {tinymce.ui.Control} Navigation root control.
+		 */
+		function getNavigationRoot(targetControl) {
+			var navigationRoot, controls;
+
+			targetControl = targetControl || focusedControl;
+			controls = targetControl.parents().toArray();
+			controls.unshift(targetControl);
+
+			for (var i = 0; i < controls.length; i++) {
+				navigationRoot = controls[i];
+
+				if (navigationRoot.settings.ariaRoot) {
+					break;
+				}
+			}
+
+			return navigationRoot;
+		}
+
+		/**
+		 * Focuses the first item in the specified targetControl element or the last aria index if the
+		 * navigation root has the ariaRemember option enabled.
+		 *
+		 * @private
+		 * @param {tinymce.ui.Control} targetControl Target control to focus the first item in.
+		 */
+		function focusFirst(targetControl) {
+			var navigationRoot = getNavigationRoot(targetControl);
+			var focusElements = getFocusElements(navigationRoot.getEl());
+
+			if (navigationRoot.settings.ariaRemember && "lastAriaIndex" in navigationRoot) {
+				moveFocusToIndex(navigationRoot.lastAriaIndex, focusElements);
+			} else {
+				moveFocusToIndex(0, focusElements);
+			}
+		}
+
+		/**
+		 * Moves the focus to the specified index within the elements list.
+		 * This will scope the index to the size of the element list if it changed.
+		 *
+		 * @private
+		 * @param {Number} idx Specified index to move to.
+		 * @param {Array} elements Array with dom elements to move focus within.
+		 * @return {Number} Input index or a changed index if it was out of range.
+		 */
+		function moveFocusToIndex(idx, elements) {
+			if (idx < 0) {
+				idx = elements.length - 1;
+			} else if (idx >= elements.length) {
+				idx = 0;
+			}
+
+			if (elements[idx]) {
+				elements[idx].focus();
+			}
+
+			return idx;
+		}
+
+		/**
+		 * Moves the focus forwards or backwards.
+		 *
+		 * @private
+		 * @param {Number} dir Direction to move in positive means forward, negative means backwards.
+		 * @param {Array} elements Optional array of elements to move within defaults to the current navigation roots elements.
+		 */
+		function moveFocus(dir, elements) {
+			var idx = -1, navigationRoot = getNavigationRoot();
+
+			elements = elements || getFocusElements(navigationRoot.getEl());
+
+			for (var i = 0; i < elements.length; i++) {
+				if (elements[i] === focusedElement) {
+					idx = i;
+				}
+			}
+
+			idx += dir;
+			navigationRoot.lastAriaIndex = moveFocusToIndex(idx, elements);
+		}
+
+		/**
+		 * Moves the focus to the left this is called by the left key.
+		 *
+		 * @private
+		 */
+		function left() {
+			var parentRole = getParentRole();
+
+			if (parentRole == "tablist") {
+				moveFocus(-1, getFocusElements(focusedElement.parentNode));
+			} else if (focusedControl.parent().submenu) {
+				cancel();
+			} else {
+				moveFocus(-1);
+			}
+		}
+
+		/**
+		 * Moves the focus to the right this is called by the right key.
+		 *
+		 * @private
+		 */
+		function right() {
+			var role = getRole(), parentRole = getParentRole();
+
+			if (parentRole == "tablist") {
+				moveFocus(1, getFocusElements(focusedElement.parentNode));
+			} else if (role == "menuitem" && parentRole == "menu" && getAriaProp('haspopup')) {
+				enter();
+			} else {
+				moveFocus(1);
+			}
+		}
+
+		/**
+		 * Moves the focus to the up this is called by the up key.
+		 *
+		 * @private
+		 */
+		function up() {
+			moveFocus(-1);
+		}
+
+		/**
+		 * Moves the focus to the up this is called by the down key.
+		 *
+		 * @private
+		 */
+		function down() {
+			var role = getRole(), parentRole = getParentRole();
+
+			if (role == "menuitem" && parentRole == "menubar") {
+				enter();
+			} else if (role == "button" && getAriaProp('haspopup')) {
+				enter({key: 'down'});
+			} else {
+				moveFocus(1);
+			}
+		}
+
+		/**
+		 * Moves the focus to the next item or previous item depending on shift key.
+		 *
+		 * @private
+		 * @param {DOMEvent} e DOM event object.
+		 */
+		function tab(e) {
+			var parentRole = getParentRole();
+
+			if (parentRole == "tablist") {
+				var elm = getFocusElements(focusedControl.getEl('body'))[0];
+
+				if (elm) {
+					elm.focus();
+				}
+			} else {
+				moveFocus(e.shiftKey ? -1 : 1);
+			}
+		}
+
+		/**
+		 * Calls the cancel event on the currently focused control. This is normally done using the Esc key.
+		 *
+		 * @private
+		 */
+		function cancel() {
+			focusedControl.fire('cancel');
+		}
+
+		/**
+		 * Calls the click event on the currently focused control. This is normally done using the Enter/Space keys.
+		 *
+		 * @private
+		 * @param {Object} aria Optional aria data to pass along with the enter event.
+		 */
+		function enter(aria) {
+			aria = aria || {};
+			focusedControl.fire('click', {target: focusedElement, aria: aria});
+		}
+
+		root.on('keydown', function(e) {
+			function handleNonTabOrEscEvent(e, handler) {
+				// Ignore non tab keys for text elements
+				if (isTextInputElement(focusedElement)) {
+					return;
+				}
+
+				if (handler(e) !== false) {
+					e.preventDefault();
+				}
+			}
+
+			if (e.isDefaultPrevented()) {
+				return;
+			}
+
+			switch (e.keyCode) {
+				case 37: // DOM_VK_LEFT
+					handleNonTabOrEscEvent(e, left);
+					break;
+
+				case 39: // DOM_VK_RIGHT
+					handleNonTabOrEscEvent(e, right);
+					break;
+
+				case 38: // DOM_VK_UP
+					handleNonTabOrEscEvent(e, up);
+					break;
+
+				case 40: // DOM_VK_DOWN
+					handleNonTabOrEscEvent(e, down);
+					break;
+
+				case 27: // DOM_VK_ESCAPE
+					cancel();
+					break;
+
+				case 14: // DOM_VK_ENTER
+				case 13: // DOM_VK_RETURN
+				case 32: // DOM_VK_SPACE
+					handleNonTabOrEscEvent(e, enter);
+					break;
+
+				case 9: // DOM_VK_TAB
+					if (tab(e) !== false) {
+						e.preventDefault();
+					}
+					break;
+			}
+		});
+
+		root.on('focusin', function(e) {
+			focusedElement = e.target;
+			focusedControl = e.control;
+		});
+
+		return {
+			focusFirst: focusFirst
+		};
+	};
+});
+
+// Included from: js/tinymce/classes/ui/Container.js
+
+/**
+ * Container.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Container control. This is extended by all controls that can have
+ * children such as panels etc. You can also use this class directly as an
+ * generic container instance. The container doesn't have any specific role or style.
+ *
+ * @-x-less Container.less
+ * @class tinymce.ui.Container
+ * @extends tinymce.ui.Control
+ */
+define("tinymce/ui/Container", [
+	"tinymce/ui/Control",
+	"tinymce/ui/Collection",
+	"tinymce/ui/Selector",
+	"tinymce/ui/Factory",
+	"tinymce/ui/KeyboardNavigation",
+	"tinymce/util/Tools",
+	"tinymce/ui/DomUtils"
+], function(Control, Collection, Selector, Factory, KeyboardNavigation, Tools, DomUtils) {
+	"use strict";
+
+	var selectorCache = {};
+
+	return Control.extend({
+		layout: '',
+		innerClass: 'container-inner',
+
+		/**
+		 * Constructs a new control instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {Array} items Items to add to container in JSON format or control instances.
+		 * @setting {String} layout Layout manager by name to use.
+		 * @setting {Object} defaults Default settings to apply to all items.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self._super(settings);
+			settings = self.settings;
+			self._fixed = settings.fixed;
+			self._items = new Collection();
+
+			if (self.isRtl()) {
+				self.addClass('rtl');
+			}
+
+			self.addClass('container');
+			self.addClass('container-body', 'body');
+
+			if (settings.containerCls) {
+				self.addClass(settings.containerCls);
+			}
+
+			self._layout = Factory.create((settings.layout || self.layout) + 'layout');
+
+			if (self.settings.items) {
+				self.add(self.settings.items);
+			}
+
+			// TODO: Fix this!
+			self._hasBody = true;
+		},
+
+		/**
+		 * Returns a collection of child items that the container currently have.
+		 *
+		 * @method items
+		 * @return {tinymce.ui.Collection} Control collection direct child controls.
+		 */
+		items: function() {
+			return this._items;
+		},
+
+		/**
+		 * Find child controls by selector.
+		 *
+		 * @method find
+		 * @param {String} selector Selector CSS pattern to find children by.
+		 * @return {tinymce.ui.Collection} Control collection with child controls.
+		 */
+		find: function(selector) {
+			selector = selectorCache[selector] = selectorCache[selector] || new Selector(selector);
+
+			return selector.find(this);
+		},
+
+		/**
+		 * Adds one or many items to the current container. This will create instances of
+		 * the object representations if needed.
+		 *
+		 * @method add
+		 * @param {Array/Object/tinymce.ui.Control} items Array or item that will be added to the container.
+		 * @return {tinymce.ui.Collection} Current collection control.
+		 */
+		add: function(items) {
+			var self = this;
+
+			self.items().add(self.create(items)).parent(self);
+
+			return self;
+		},
+
+		/**
+		 * Focuses the current container instance. This will look
+		 * for the first control in the container and focus that.
+		 *
+		 * @method focus
+		 * @param {Boolean} keyboard Optional true/false if the focus was a keyboard focus or not.
+		 * @return {tinymce.ui.Collection} Current instance.
+		 */
+		focus: function(keyboard) {
+			var self = this, focusCtrl, keyboardNav, items;
+
+			if (keyboard) {
+				keyboardNav = self.keyboardNav || self.parents().eq(-1)[0].keyboardNav;
+
+				if (keyboardNav) {
+					keyboardNav.focusFirst(self);
+					return;
+				}
+			}
+
+			items = self.find('*');
+
+			// TODO: Figure out a better way to auto focus alert dialog buttons
+			if (self.statusbar) {
+				items.add(self.statusbar.items());
+			}
+
+			items.each(function(ctrl) {
+				if (ctrl.settings.autofocus) {
+					focusCtrl = null;
+					return false;
+				}
+
+				if (ctrl.canFocus) {
+					focusCtrl = focusCtrl || ctrl;
+				}
+			});
+
+			if (focusCtrl) {
+				focusCtrl.focus();
+			}
+
+			return self;
+		},
+
+		/**
+		 * Replaces the specified child control with a new control.
+		 *
+		 * @method replace
+		 * @param {tinymce.ui.Control} oldItem Old item to be replaced.
+		 * @param {tinymce.ui.Control} newItem New item to be inserted.
+		 */
+		replace: function(oldItem, newItem) {
+			var ctrlElm, items = this.items(), i = items.length;
+
+			// Replace the item in collection
+			while (i--) {
+				if (items[i] === oldItem) {
+					items[i] = newItem;
+					break;
+				}
+			}
+
+			if (i >= 0) {
+				// Remove new item from DOM
+				ctrlElm = newItem.getEl();
+				if (ctrlElm) {
+					ctrlElm.parentNode.removeChild(ctrlElm);
+				}
+
+				// Remove old item from DOM
+				ctrlElm = oldItem.getEl();
+				if (ctrlElm) {
+					ctrlElm.parentNode.removeChild(ctrlElm);
+				}
+			}
+
+			// Adopt the item
+			newItem.parent(this);
+		},
+
+		/**
+		 * Creates the specified items. If any of the items is plain JSON style objects
+		 * it will convert these into real tinymce.ui.Control instances.
+		 *
+		 * @method create
+		 * @param {Array} items Array of items to convert into control instances.
+		 * @return {Array} Array with control instances.
+		 */
+		create: function(items) {
+			var self = this, settings, ctrlItems = [];
+
+			// Non array structure, then force it into an array
+			if (!Tools.isArray(items)) {
+				items = [items];
+			}
+
+			// Add default type to each child control
+			Tools.each(items, function(item) {
+				if (item) {
+					// Construct item if needed
+					if (!(item instanceof Control)) {
+						// Name only then convert it to an object
+						if (typeof item == "string") {
+							item = {type: item};
+						}
+
+						// Create control instance based on input settings and default settings
+						settings = Tools.extend({}, self.settings.defaults, item);
+						item.type = settings.type = settings.type || item.type || self.settings.defaultType ||
+							(settings.defaults ? settings.defaults.type : null);
+						item = Factory.create(settings);
+					}
+
+					ctrlItems.push(item);
+				}
+			});
+
+			return ctrlItems;
+		},
+
+		/**
+		 * Renders new control instances.
+		 *
+		 * @private
+		 */
+		renderNew: function() {
+			var self = this;
+
+			// Render any new items
+			self.items().each(function(ctrl, index) {
+				var containerElm, fragment;
+
+				ctrl.parent(self);
+
+				if (!ctrl._rendered) {
+					containerElm = self.getEl('body');
+					fragment = DomUtils.createFragment(ctrl.renderHtml());
+
+					// Insert or append the item
+					if (containerElm.hasChildNodes() && index <= containerElm.childNodes.length - 1) {
+						containerElm.insertBefore(fragment, containerElm.childNodes[index]);
+					} else {
+						containerElm.appendChild(fragment);
+					}
+
+					ctrl.postRender();
+				}
+			});
+
+			self._layout.applyClasses(self);
+			self._lastRect = null;
+
+			return self;
+		},
+
+		/**
+		 * Appends new instances to the current container.
+		 *
+		 * @method append
+		 * @param {Array/tinymce.ui.Collection} items Array if controls to append.
+		 * @return {tinymce.ui.Container} Current container instance.
+		 */
+		append: function(items) {
+			return this.add(items).renderNew();
+		},
+
+		/**
+		 * Prepends new instances to the current container.
+		 *
+		 * @method prepend
+		 * @param {Array/tinymce.ui.Collection} items Array if controls to prepend.
+		 * @return {tinymce.ui.Container} Current container instance.
+		 */
+		prepend: function(items) {
+			var self = this;
+
+			self.items().set(self.create(items).concat(self.items().toArray()));
+
+			return self.renderNew();
+		},
+
+		/**
+		 * Inserts an control at a specific index.
+		 *
+		 * @method insert
+		 * @param {Array/tinymce.ui.Collection} items Array if controls to insert.
+		 * @param {Number} index Index to insert controls at.
+		 * @param {Boolean} [before=false] Inserts controls before the index.
+		 */
+		insert: function(items, index, before) {
+			var self = this, curItems, beforeItems, afterItems;
+
+			items = self.create(items);
+			curItems = self.items();
+
+			if (!before && index < curItems.length - 1) {
+				index += 1;
+			}
+
+			if (index >= 0 && index < curItems.length) {
+				beforeItems = curItems.slice(0, index).toArray();
+				afterItems = curItems.slice(index).toArray();
+				curItems.set(beforeItems.concat(items, afterItems));
+			}
+
+			return self.renderNew();
+		},
+
+		/**
+		 * Populates the form fields from the specified JSON data object.
+		 *
+		 * Control items in the form that matches the data will have it's value set.
+		 *
+		 * @method fromJSON
+		 * @param {Object} data JSON data object to set control values by.
+		 * @return {tinymce.ui.Container} Current form instance.
+		 */
+		fromJSON: function(data) {
+			var self = this;
+
+			for (var name in data) {
+				self.find('#' + name).value(data[name]);
+			}
+
+			return self;
+		},
+
+		/**
+		 * Serializes the form into a JSON object by getting all items
+		 * that has a name and a value.
+		 *
+		 * @method toJSON
+		 * @return {Object} JSON object with form data.
+		 */
+		toJSON: function() {
+			var self = this, data = {};
+
+			self.find('*').each(function(ctrl) {
+				var name = ctrl.name(), value = ctrl.value();
+
+				if (name && typeof value != "undefined") {
+					data[name] = value;
+				}
+			});
+
+			return data;
+		},
+
+		preRender: function() {
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, layout = self._layout, role = this.settings.role;
+
+			self.preRender();
+			layout.preRender(self);
+
+			return (
+				'<div id="' + self._id + '" class="' + self.classes() + '"' + (role ? ' role="' + this.settings.role + '"' : '') + '>' +
+					'<div id="' + self._id + '-body" class="' + self.classes('body') + '">' +
+						(self.settings.html || '') + layout.renderHtml(self) +
+					'</div>' +
+				'</div>'
+			);
+		},
+
+		/**
+		 * Post render method. Called after the control has been rendered to the target.
+		 *
+		 * @method postRender
+		 * @return {tinymce.ui.Container} Current combobox instance.
+		 */
+		postRender: function() {
+			var self = this, box;
+
+			self.items().exec('postRender');
+			self._super();
+
+			self._layout.postRender(self);
+			self._rendered = true;
+
+			if (self.settings.style) {
+				DomUtils.css(self.getEl(), self.settings.style);
+			}
+
+			if (self.settings.border) {
+				box = self.borderBox();
+				DomUtils.css(self.getEl(), {
+					'border-top-width': box.top,
+					'border-right-width': box.right,
+					'border-bottom-width': box.bottom,
+					'border-left-width': box.left
+				});
+			}
+
+			if (!self.parent()) {
+				self.keyboardNav = new KeyboardNavigation({
+					root: self
+				});
+			}
+
+			return self;
+		},
+
+		/**
+		 * Initializes the current controls layout rect.
+		 * This will be executed by the layout managers to determine the
+		 * default minWidth/minHeight etc.
+		 *
+		 * @method initLayoutRect
+		 * @return {Object} Layout rect instance.
+		 */
+		initLayoutRect: function() {
+			var self = this, layoutRect = self._super();
+
+			// Recalc container size by asking layout manager
+			self._layout.recalc(self);
+
+			return layoutRect;
+		},
+
+		/**
+		 * Recalculates the positions of the controls in the current container.
+		 * This is invoked by the reflow method and shouldn't be called directly.
+		 *
+		 * @method recalc
+		 */
+		recalc: function() {
+			var self = this, rect = self._layoutRect, lastRect = self._lastRect;
+
+			if (!lastRect || lastRect.w != rect.w || lastRect.h != rect.h) {
+				self._layout.recalc(self);
+				rect = self.layoutRect();
+				self._lastRect = {x: rect.x, y: rect.y, w: rect.w, h: rect.h};
+				return true;
+			}
+		},
+
+		/**
+		 * Reflows the current container and it's children and possible parents.
+		 * This should be used after you for example append children to the current control so
+		 * that the layout managers know that they need to reposition everything.
+		 *
+		 * @example
+		 * container.append({type: 'button', text: 'My button'}).reflow();
+		 *
+		 * @method reflow
+		 * @return {tinymce.ui.Container} Current container instance.
+		 */
+		reflow: function() {
+			var i;
+
+			if (this.visible()) {
+				Control.repaintControls = [];
+				Control.repaintControls.map = {};
+
+				this.recalc();
+				i = Control.repaintControls.length;
+
+				while (i--) {
+					Control.repaintControls[i].repaint();
+				}
+
+				// TODO: Fix me!
+				if (this.settings.layout !== "flow" && this.settings.layout !== "stack") {
+					this.repaint();
+				}
+
+				Control.repaintControls = [];
+			}
+
+			return this;
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/DragHelper.js
+
+/**
+ * DragHelper.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Drag/drop helper class.
+ *
+ * @example
+ * var dragHelper = new tinymce.ui.DragHelper('mydiv', {
+ *     start: function(evt) {
+ *     },
+ *
+ *     drag: function(evt) {
+ *     },
+ *
+ *     end: function(evt) {
+ *     }
+ * });
+ *
+ * @class tinymce.ui.DragHelper
+ */
+define("tinymce/ui/DragHelper", [
+	"tinymce/ui/DomUtils"
+], function(DomUtils) {
+	"use strict";
+
+	function getDocumentSize() {
+		var doc = document, documentElement, body, scrollWidth, clientWidth;
+		var offsetWidth, scrollHeight, clientHeight, offsetHeight, max = Math.max;
+
+		documentElement = doc.documentElement;
+		body = doc.body;
+
+		scrollWidth = max(documentElement.scrollWidth, body.scrollWidth);
+		clientWidth = max(documentElement.clientWidth, body.clientWidth);
+		offsetWidth = max(documentElement.offsetWidth, body.offsetWidth);
+
+		scrollHeight = max(documentElement.scrollHeight, body.scrollHeight);
+		clientHeight = max(documentElement.clientHeight, body.clientHeight);
+		offsetHeight = max(documentElement.offsetHeight, body.offsetHeight);
+
+		return {
+			width: scrollWidth < offsetWidth ? clientWidth : scrollWidth,
+			height: scrollHeight < offsetHeight ? clientHeight : scrollHeight
+		};
+	}
+
+	return function(id, settings) {
+		var eventOverlayElm, doc = document, downButton, start, stop, drag, startX, startY;
+
+		settings = settings || {};
+
+		function getHandleElm() {
+			return doc.getElementById(settings.handle || id);
+		}
+
+		start = function(e) {
+			var docSize = getDocumentSize(), handleElm, cursor;
+
+			e.preventDefault();
+			downButton = e.button;
+			handleElm = getHandleElm();
+			startX = e.screenX;
+			startY = e.screenY;
+
+			// Grab cursor from handle
+			if (window.getComputedStyle) {
+				cursor = window.getComputedStyle(handleElm, null).getPropertyValue("cursor");
+			} else {
+				cursor = handleElm.runtimeStyle.cursor;
+			}
+
+			// Create event overlay and add it to document
+			eventOverlayElm = doc.createElement('div');
+			DomUtils.css(eventOverlayElm, {
+				position: "absolute",
+				top: 0, left: 0,
+				width: docSize.width,
+				height: docSize.height,
+				zIndex: 0x7FFFFFFF,
+				opacity: 0.0001,
+				cursor: cursor
+			});
+
+			doc.body.appendChild(eventOverlayElm);
+
+			// Bind mouse events
+			DomUtils.on(doc, 'mousemove', drag);
+			DomUtils.on(doc, 'mouseup', stop);
+
+			// Begin drag
+			settings.start(e);
+		};
+
+		drag = function(e) {
+			if (e.button !== downButton) {
+				return stop(e);
+			}
+
+			e.deltaX = e.screenX - startX;
+			e.deltaY = e.screenY - startY;
+
+			e.preventDefault();
+			settings.drag(e);
+		};
+
+		stop = function(e) {
+			DomUtils.off(doc, 'mousemove', drag);
+			DomUtils.off(doc, 'mouseup', stop);
+
+			eventOverlayElm.parentNode.removeChild(eventOverlayElm);
+
+			if (settings.stop) {
+				settings.stop(e);
+			}
+		};
+
+		/**
+		 * Destroys the drag/drop helper instance.
+		 *
+		 * @method destroy
+		 */
+		this.destroy = function() {
+			DomUtils.off(getHandleElm());
+		};
+
+		DomUtils.on(getHandleElm(), 'mousedown', start);
+	};
+});
+
+// Included from: js/tinymce/classes/ui/Scrollable.js
+
+/**
+ * Scrollable.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This mixin makes controls scrollable using custom scrollbars.
+ *
+ * @-x-less Scrollable.less
+ * @mixin tinymce.ui.Scrollable
+ */
+define("tinymce/ui/Scrollable", [
+	"tinymce/ui/DomUtils",
+	"tinymce/ui/DragHelper"
+], function(DomUtils, DragHelper) {
+	"use strict";
+
+	return {
+		init: function() {
+			var self = this;
+			self.on('repaint', self.renderScroll);
+		},
+
+		renderScroll: function() {
+			var self = this, margin = 2;
+
+			function repaintScroll() {
+				var hasScrollH, hasScrollV, bodyElm;
+
+				function repaintAxis(axisName, posName, sizeName, contentSizeName, hasScroll, ax) {
+					var containerElm, scrollBarElm, scrollThumbElm;
+					var containerSize, scrollSize, ratio, rect;
+					var posNameLower, sizeNameLower;
+
+					scrollBarElm = self.getEl('scroll' + axisName);
+					if (scrollBarElm) {
+						posNameLower = posName.toLowerCase();
+						sizeNameLower = sizeName.toLowerCase();
+
+						if (self.getEl('absend')) {
+							DomUtils.css(self.getEl('absend'), posNameLower, self.layoutRect()[contentSizeName] - 1);
+						}
+
+						if (!hasScroll) {
+							DomUtils.css(scrollBarElm, 'display', 'none');
+							return;
+						}
+
+						DomUtils.css(scrollBarElm, 'display', 'block');
+						containerElm = self.getEl('body');
+						scrollThumbElm = self.getEl('scroll' + axisName + "t");
+						containerSize = containerElm["client" + sizeName] - (margin * 2);
+						containerSize -= hasScrollH && hasScrollV ? scrollBarElm["client" + ax] : 0;
+						scrollSize = containerElm["scroll" + sizeName];
+						ratio = containerSize / scrollSize;
+
+						rect = {};
+						rect[posNameLower] = containerElm["offset" + posName] + margin;
+						rect[sizeNameLower] = containerSize;
+						DomUtils.css(scrollBarElm, rect);
+
+						rect = {};
+						rect[posNameLower] = containerElm["scroll" + posName] * ratio;
+						rect[sizeNameLower] = containerSize * ratio;
+						DomUtils.css(scrollThumbElm, rect);
+					}
+				}
+
+				bodyElm = self.getEl('body');
+				hasScrollH = bodyElm.scrollWidth > bodyElm.clientWidth;
+				hasScrollV = bodyElm.scrollHeight > bodyElm.clientHeight;
+
+				repaintAxis("h", "Left", "Width", "contentW", hasScrollH, "Height");
+				repaintAxis("v", "Top", "Height", "contentH", hasScrollV, "Width");
+			}
+
+			function addScroll() {
+				function addScrollAxis(axisName, posName, sizeName, deltaPosName, ax) {
+					var scrollStart, axisId = self._id + '-scroll' + axisName, prefix = self.classPrefix;
+
+					self.getEl().appendChild(DomUtils.createFragment(
+						'<div id="' + axisId + '" class="' + prefix + 'scrollbar ' + prefix + 'scrollbar-' + axisName + '">' +
+							'<div id="' + axisId + 't" class="' + prefix + 'scrollbar-thumb"></div>' +
+						'</div>'
+					));
+
+					self.draghelper = new DragHelper(axisId + 't', {
+						start: function() {
+							scrollStart = self.getEl('body')["scroll" + posName];
+							DomUtils.addClass(DomUtils.get(axisId), prefix + 'active');
+						},
+
+						drag: function(e) {
+							var ratio, hasScrollH, hasScrollV, containerSize, layoutRect = self.layoutRect();
+
+							hasScrollH = layoutRect.contentW > layoutRect.innerW;
+							hasScrollV = layoutRect.contentH > layoutRect.innerH;
+							containerSize = self.getEl('body')["client" + sizeName] - (margin * 2);
+							containerSize -= hasScrollH && hasScrollV ? self.getEl('scroll' + axisName)["client" + ax] : 0;
+
+							ratio = containerSize / self.getEl('body')["scroll" + sizeName];
+							self.getEl('body')["scroll" + posName] = scrollStart + (e["delta" + deltaPosName] / ratio);
+						},
+
+						stop: function() {
+							DomUtils.removeClass(DomUtils.get(axisId), prefix + 'active');
+						}
+					});
+/*
+					self.on('click', function(e) {
+						if (e.target.id == self._id + '-scrollv') {
+
+						}
+					});*/
+				}
+
+				self.addClass('scroll');
+
+				addScrollAxis("v", "Top", "Height", "Y", "Width");
+				addScrollAxis("h", "Left", "Width", "X", "Height");
+			}
+
+			if (self.settings.autoScroll) {
+				if (!self._hasScroll) {
+					self._hasScroll = true;
+					addScroll();
+
+					self.on('wheel', function(e) {
+						var bodyEl = self.getEl('body');
+
+						bodyEl.scrollLeft += (e.deltaX || 0) * 10;
+						bodyEl.scrollTop += e.deltaY * 10;
+
+						repaintScroll();
+					});
+
+					DomUtils.on(self.getEl('body'), "scroll", repaintScroll);
+				}
+
+				repaintScroll();
+			}
+		}
+	};
+});
+
+// Included from: js/tinymce/classes/ui/Panel.js
+
+/**
+ * Panel.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new panel.
+ *
+ * @-x-less Panel.less
+ * @class tinymce.ui.Panel
+ * @extends tinymce.ui.Container
+ * @mixes tinymce.ui.Scrollable
+ */
+define("tinymce/ui/Panel", [
+	"tinymce/ui/Container",
+	"tinymce/ui/Scrollable"
+], function(Container, Scrollable) {
+	"use strict";
+
+	return Container.extend({
+		Defaults: {
+			layout: 'fit',
+			containerCls: 'panel'
+		},
+
+		Mixins: [Scrollable],
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, layout = self._layout, innerHtml = self.settings.html;
+
+			self.preRender();
+			layout.preRender(self);
+
+			if (typeof innerHtml == "undefined") {
+				innerHtml = (
+					'<div id="' + self._id + '-body" class="' + self.classes('body') + '">' +
+						layout.renderHtml(self) +
+					'</div>'
+				);
+			} else {
+				if (typeof innerHtml == 'function') {
+					innerHtml = innerHtml.call(self);
+				}
+
+				self._hasBody = false;
+			}
+
+			return (
+				'<div id="' + self._id + '" class="' + self.classes() + '" hidefocus="1" tabindex="-1" role="group">' +
+					(self._preBodyHtml || '') +
+					innerHtml +
+				'</div>'
+			);
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/Movable.js
+
+/**
+ * Movable.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Movable mixin. Makes controls movable absolute and relative to other elements.
+ *
+ * @mixin tinymce.ui.Movable
+ */
+define("tinymce/ui/Movable", [
+	"tinymce/ui/DomUtils"
+], function(DomUtils) {
+	"use strict";
+
+	function calculateRelativePosition(ctrl, targetElm, rel) {
+		var ctrlElm, pos, x, y, selfW, selfH, targetW, targetH, viewport, size;
+
+		viewport = DomUtils.getViewPort();
+
+		// Get pos of target
+		pos = DomUtils.getPos(targetElm);
+		x = pos.x;
+		y = pos.y;
+
+		if (ctrl._fixed && DomUtils.getRuntimeStyle(document.body, 'position') == 'static') {
+			x -= viewport.x;
+			y -= viewport.y;
+		}
+
+		// Get size of self
+		ctrlElm = ctrl.getEl();
+		size = DomUtils.getSize(ctrlElm);
+		selfW = size.width;
+		selfH = size.height;
+
+		// Get size of target
+		size = DomUtils.getSize(targetElm);
+		targetW = size.width;
+		targetH = size.height;
+
+		// Parse align string
+		rel = (rel || '').split('');
+
+		// Target corners
+		if (rel[0] === 'b') {
+			y += targetH;
+		}
+
+		if (rel[1] === 'r') {
+			x += targetW;
+		}
+
+		if (rel[0] === 'c') {
+			y += Math.round(targetH / 2);
+		}
+
+		if (rel[1] === 'c') {
+			x += Math.round(targetW / 2);
+		}
+
+		// Self corners
+		if (rel[3] === 'b') {
+			y -= selfH;
+		}
+
+		if (rel[4] === 'r') {
+			x -= selfW;
+		}
+
+		if (rel[3] === 'c') {
+			y -= Math.round(selfH / 2);
+		}
+
+		if (rel[4] === 'c') {
+			x -= Math.round(selfW / 2);
+		}
+
+		return {
+			x: x,
+			y: y,
+			w: selfW,
+			h: selfH
+		};
+	}
+
+	return {
+		/**
+		 * Tests various positions to get the most suitable one.
+		 *
+		 * @method testMoveRel
+		 * @param {DOMElement} elm Element to position against.
+		 * @param {Array} rels Array with relative positions.
+		 * @return {String} Best suitable relative position.
+		 */
+		testMoveRel: function(elm, rels) {
+			var viewPortRect = DomUtils.getViewPort();
+
+			for (var i = 0; i < rels.length; i++) {
+				var pos = calculateRelativePosition(this, elm, rels[i]);
+
+				if (this._fixed) {
+					if (pos.x > 0 && pos.x + pos.w < viewPortRect.w && pos.y > 0 && pos.y + pos.h < viewPortRect.h) {
+						return rels[i];
+					}
+				} else {
+					if (pos.x > viewPortRect.x && pos.x + pos.w < viewPortRect.w + viewPortRect.x &&
+						pos.y > viewPortRect.y && pos.y + pos.h < viewPortRect.h + viewPortRect.y) {
+						return rels[i];
+					}
+				}
+			}
+
+			return rels[0];
+		},
+
+		/**
+		 * Move relative to the specified element.
+		 *
+		 * @method moveRel
+		 * @param {Element} elm Element to move relative to.
+		 * @param {String} rel Relative mode. For example: br-tl.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		moveRel: function(elm, rel) {
+			if (typeof rel != 'string') {
+				rel = this.testMoveRel(elm, rel);
+			}
+
+			var pos = calculateRelativePosition(this, elm, rel);
+			return this.moveTo(pos.x, pos.y);
+		},
+
+		/**
+		 * Move by a relative x, y values.
+		 *
+		 * @method moveBy
+		 * @param {Number} dx Relative x position.
+		 * @param {Number} dy Relative y position.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		moveBy: function(dx, dy) {
+			var self = this, rect = self.layoutRect();
+
+			self.moveTo(rect.x + dx, rect.y + dy);
+
+			return self;
+		},
+
+		/**
+		 * Move to absolute position.
+		 *
+		 * @method moveTo
+		 * @param {Number} x Absolute x position.
+		 * @param {Number} y Absolute y position.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		moveTo: function(x, y) {
+			var self = this;
+
+			// TODO: Move this to some global class
+			function contrain(value, max, size) {
+				if (value < 0) {
+					return 0;
+				}
+
+				if (value + size > max) {
+					value = max - size;
+					return value < 0 ? 0 : value;
+				}
+
+				return value;
+			}
+
+			if (self.settings.constrainToViewport) {
+				var viewPortRect = DomUtils.getViewPort(window);
+				var layoutRect = self.layoutRect();
+
+				x = contrain(x, viewPortRect.w + viewPortRect.x, layoutRect.w);
+				y = contrain(y, viewPortRect.h + viewPortRect.y, layoutRect.h);
+			}
+
+			if (self._rendered) {
+				self.layoutRect({x: x, y: y}).repaint();
+			} else {
+				self.settings.x = x;
+				self.settings.y = y;
+			}
+
+			self.fire('move', {x: x, y: y});
+
+			return self;
+		}
+	};
+});
+
+// Included from: js/tinymce/classes/ui/Resizable.js
+
+/**
+ * Resizable.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Resizable mixin. Enables controls to be resized.
+ *
+ * @mixin tinymce.ui.Resizable
+ */
+define("tinymce/ui/Resizable", [
+	"tinymce/ui/DomUtils"
+], function(DomUtils) {
+	"use strict";
+
+	return {
+		/**
+		 * Resizes the control to contents.
+		 *
+		 * @method resizeToContent
+		 */
+		resizeToContent: function() {
+			this._layoutRect.autoResize = true;
+			this._lastRect = null;
+			this.reflow();
+		},
+
+		/**
+		 * Resizes the control to a specific width/height.
+		 *
+		 * @method resizeTo
+		 * @param {Number} w Control width.
+		 * @param {Number} h Control height.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		resizeTo: function(w, h) {
+			// TODO: Fix hack
+			if (w <= 1 || h <= 1) {
+				var rect = DomUtils.getWindowSize();
+
+				w = w <= 1 ? w * rect.w : w;
+				h = h <= 1 ? h * rect.h : h;
+			}
+
+			this._layoutRect.autoResize = false;
+			return this.layoutRect({minW: w, minH: h, w: w, h: h}).reflow();
+		},
+
+		/**
+		 * Resizes the control to a specific relative width/height.
+		 *
+		 * @method resizeBy
+		 * @param {Number} dw Relative control width.
+		 * @param {Number} dh Relative control height.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		resizeBy: function(dw, dh) {
+			var self = this, rect = self.layoutRect();
+
+			return self.resizeTo(rect.w + dw, rect.h + dh);
+		}
+	};
+});
+
+// Included from: js/tinymce/classes/ui/FloatPanel.js
+
+/**
+ * FloatPanel.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class creates a floating panel.
+ *
+ * @-x-less FloatPanel.less
+ * @class tinymce.ui.FloatPanel
+ * @extends tinymce.ui.Panel
+ * @mixes tinymce.ui.Movable
+ * @mixes tinymce.ui.Resizable
+ */
+define("tinymce/ui/FloatPanel", [
+	"tinymce/ui/Panel",
+	"tinymce/ui/Movable",
+	"tinymce/ui/Resizable",
+	"tinymce/ui/DomUtils"
+], function(Panel, Movable, Resizable, DomUtils) {
+	"use strict";
+
+	var documentClickHandler, documentScrollHandler, windowResizeHandler, visiblePanels = [];
+	var zOrder = [], hasModal;
+
+	function bindDocumentClickHandler() {
+		function isChildOf(ctrl, parent) {
+			while (ctrl) {
+				if (ctrl == parent) {
+					return true;
+				}
+
+				ctrl = ctrl.parent();
+			}
+		}
+
+		if (!documentClickHandler) {
+			documentClickHandler = function(e) {
+				// Gecko fires click event and in the wrong order on Mac so lets normalize
+				if (e.button == 2) {
+					return;
+				}
+
+				// Hide any float panel when a click is out side that float panel and the
+				// float panels direct parent for example a click on a menu button
+				var i = visiblePanels.length;
+				while (i--) {
+					var panel = visiblePanels[i], clickCtrl = panel.getParentCtrl(e.target);
+
+					if (panel.settings.autohide) {
+						if (clickCtrl) {
+							if (isChildOf(clickCtrl, panel) || panel.parent() === clickCtrl) {
+								continue;
+							}
+						}
+
+						e = panel.fire('autohide', {target: e.target});
+						if (!e.isDefaultPrevented()) {
+							panel.hide();
+						}
+					}
+				}
+			};
+
+			DomUtils.on(document, 'click', documentClickHandler);
+		}
+	}
+
+	function bindDocumentScrollHandler() {
+		if (!documentScrollHandler) {
+			documentScrollHandler = function() {
+				var i;
+
+				i = visiblePanels.length;
+				while (i--) {
+					repositionPanel(visiblePanels[i]);
+				}
+			};
+
+			DomUtils.on(window, 'scroll', documentScrollHandler);
+		}
+	}
+
+	function bindWindowResizeHandler() {
+		if (!windowResizeHandler) {
+			var docElm = document.documentElement, clientWidth = docElm.clientWidth, clientHeight = docElm.clientHeight;
+
+			windowResizeHandler = function() {
+				// Workaround for #7065 IE 7 fires resize events event though the window wasn't resized
+				if (!document.all || clientWidth != docElm.clientWidth || clientHeight != docElm.clientHeight) {
+					clientWidth = docElm.clientWidth;
+					clientHeight = docElm.clientHeight;
+					FloatPanel.hideAll();
+				}
+			};
+
+			DomUtils.on(window, 'resize', windowResizeHandler);
+		}
+	}
+
+	/**
+	 * Repositions the panel to the top of page if the panel is outside of the visual viewport. It will
+	 * also reposition all child panels of the current panel.
+	 */
+	function repositionPanel(panel) {
+		var scrollY = DomUtils.getViewPort().y;
+
+		function toggleFixedChildPanels(fixed, deltaY) {
+			var parent;
+
+			for (var i = 0; i < visiblePanels.length; i++) {
+				if (visiblePanels[i] != panel) {
+					parent = visiblePanels[i].parent();
+
+					while (parent && (parent = parent.parent())) {
+						if (parent == panel) {
+							visiblePanels[i].fixed(fixed).moveBy(0, deltaY).repaint();
+						}
+					}
+				}
+			}
+		}
+
+		if (panel.settings.autofix) {
+			if (!panel._fixed) {
+				panel._autoFixY = panel.layoutRect().y;
+
+				if (panel._autoFixY < scrollY) {
+					panel.fixed(true).layoutRect({y: 0}).repaint();
+					toggleFixedChildPanels(true, scrollY - panel._autoFixY);
+				}
+			} else {
+				if (panel._autoFixY > scrollY) {
+					panel.fixed(false).layoutRect({y: panel._autoFixY}).repaint();
+					toggleFixedChildPanels(false, panel._autoFixY - scrollY);
+				}
+			}
+		}
+	}
+
+	function addRemove(add, ctrl) {
+		var i, zIndex = FloatPanel.zIndex || 0xFFFF, topModal;
+
+		if (add) {
+			zOrder.push(ctrl);
+		} else {
+			i = zOrder.length;
+
+			while (i--) {
+				if (zOrder[i] === ctrl) {
+					zOrder.splice(i, 1);
+				}
+			}
+		}
+
+		if (zOrder.length) {
+			for (i = 0; i < zOrder.length; i++) {
+				if (zOrder[i].modal) {
+					zIndex++;
+					topModal = zOrder[i];
+				}
+
+				zOrder[i].getEl().style.zIndex = zIndex;
+				zOrder[i].zIndex = zIndex;
+				zIndex++;
+			}
+		}
+
+		var modalBlockEl = document.getElementById(ctrl.classPrefix + 'modal-block');
+
+		if (topModal) {
+			DomUtils.css(modalBlockEl, 'z-index', topModal.zIndex - 1);
+		} else if (modalBlockEl) {
+			modalBlockEl.parentNode.removeChild(modalBlockEl);
+			hasModal = false;
+		}
+
+		FloatPanel.currentZIndex = zIndex;
+	}
+
+	var FloatPanel = Panel.extend({
+		Mixins: [Movable, Resizable],
+
+		/**
+		 * Constructs a new control instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {Boolean} autohide Automatically hide the panel.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self._super(settings);
+			self._eventsRoot = self;
+
+			self.addClass('floatpanel');
+
+			// Hide floatpanes on click out side the root button
+			if (settings.autohide) {
+				bindDocumentClickHandler();
+				bindWindowResizeHandler();
+				visiblePanels.push(self);
+			}
+
+			if (settings.autofix) {
+				bindDocumentScrollHandler();
+
+				self.on('move', function() {
+					repositionPanel(this);
+				});
+			}
+
+			self.on('postrender show', function(e) {
+				if (e.control == self) {
+					var modalBlockEl, prefix = self.classPrefix;
+
+					if (self.modal && !hasModal) {
+						modalBlockEl = DomUtils.createFragment('<div id="' + prefix + 'modal-block" class="' +
+							prefix + 'reset ' + prefix + 'fade"></div>');
+						modalBlockEl = modalBlockEl.firstChild;
+
+						self.getContainerElm().appendChild(modalBlockEl);
+
+						setTimeout(function() {
+							DomUtils.addClass(modalBlockEl, prefix + 'in');
+							DomUtils.addClass(self.getEl(), prefix + 'in');
+						}, 0);
+
+						hasModal = true;
+					}
+
+					addRemove(true, self);
+				}
+			});
+
+			self.on('show', function() {
+				self.parents().each(function(ctrl) {
+					if (ctrl._fixed) {
+						self.fixed(true);
+						return false;
+					}
+				});
+			});
+
+			if (settings.popover) {
+				self._preBodyHtml = '<div class="' + self.classPrefix + 'arrow"></div>';
+				self.addClass('popover').addClass('bottom').addClass(self.isRtl() ? 'end' : 'start');
+			}
+		},
+
+		fixed: function(state) {
+			var self = this;
+
+			if (self._fixed != state) {
+				if (self._rendered) {
+					var viewport = DomUtils.getViewPort();
+
+					if (state) {
+						self.layoutRect().y -= viewport.y;
+					} else {
+						self.layoutRect().y += viewport.y;
+					}
+				}
+
+				self.toggleClass('fixed', state);
+				self._fixed = state;
+			}
+
+			return self;
+		},
+
+		/**
+		 * Shows the current float panel.
+		 *
+		 * @method show
+		 * @return {tinymce.ui.FloatPanel} Current floatpanel instance.
+		 */
+		show: function() {
+			var self = this, i, state = self._super();
+
+			i = visiblePanels.length;
+			while (i--) {
+				if (visiblePanels[i] === self) {
+					break;
+				}
+			}
+
+			if (i === -1) {
+				visiblePanels.push(self);
+			}
+
+			return state;
+		},
+
+		/**
+		 * Hides the current float panel.
+		 *
+		 * @method hide
+		 * @return {tinymce.ui.FloatPanel} Current floatpanel instance.
+		 */
+		hide: function() {
+			removeVisiblePanel(this);
+			addRemove(false, this);
+
+			return this._super();
+		},
+
+		/**
+		 * Hide all visible float panels with he autohide setting enabled. This is for
+		 * manually hiding floating menus or panels.
+		 *
+		 * @method hideAll
+		 */
+		hideAll: function() {
+			FloatPanel.hideAll();
+		},
+
+		/**
+		 * Closes the float panel. This will remove the float panel from page and fire the close event.
+		 *
+		 * @method close
+		 */
+		close: function() {
+			var self = this;
+
+			if (!self.fire('close').isDefaultPrevented()) {
+				self.remove();
+				addRemove(false, self);
+			}
+
+			return self;
+		},
+
+		/**
+		 * Removes the float panel from page.
+		 *
+		 * @method remove
+		 */
+		remove: function() {
+			removeVisiblePanel(this);
+			this._super();
+		},
+
+		postRender: function() {
+			var self = this;
+
+			if (self.settings.bodyRole) {
+				this.getEl('body').setAttribute('role', self.settings.bodyRole);
+			}
+
+			return self._super();
+		}
+	});
+
+	/**
+	 * Hide all visible float panels with he autohide setting enabled. This is for
+	 * manually hiding floating menus or panels.
+	 *
+	 * @static
+	 * @method hideAll
+	 */
+	FloatPanel.hideAll = function() {
+		var i = visiblePanels.length;
+
+		while (i--) {
+			var panel = visiblePanels[i];
+
+			if (panel && panel.settings.autohide) {
+				panel.hide();
+				visiblePanels.splice(i, 1);
+			}
+		}
+	};
+
+	function removeVisiblePanel(panel) {
+		var i;
+
+		i = visiblePanels.length;
+		while (i--) {
+			if (visiblePanels[i] === panel) {
+				visiblePanels.splice(i, 1);
+			}
+		}
+
+		i = zOrder.length;
+		while (i--) {
+			if (zOrder[i] === panel) {
+				zOrder.splice(i, 1);
+			}
+		}
+	}
+
+	return FloatPanel;
+});
+
+// Included from: js/tinymce/classes/ui/Window.js
+
+/**
+ * Window.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new window.
+ *
+ * @-x-less Window.less
+ * @class tinymce.ui.Window
+ * @extends tinymce.ui.FloatPanel
+ */
+define("tinymce/ui/Window", [
+	"tinymce/ui/FloatPanel",
+	"tinymce/ui/Panel",
+	"tinymce/ui/DomUtils",
+	"tinymce/ui/DragHelper"
+], function(FloatPanel, Panel, DomUtils, DragHelper) {
+	"use strict";
+
+	var Window = FloatPanel.extend({
+		modal: true,
+
+		Defaults: {
+			border: 1,
+			layout: 'flex',
+			containerCls: 'panel',
+			role: 'dialog',
+			callbacks: {
+				submit: function() {
+					this.fire('submit', {data: this.toJSON()});
+				},
+
+				close: function() {
+					this.close();
+				}
+			}
+		},
+
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self._super(settings);
+
+			if (self.isRtl()) {
+				self.addClass('rtl');
+			}
+
+			self.addClass('window');
+			self._fixed = true;
+
+			// Create statusbar
+			if (settings.buttons) {
+				self.statusbar = new Panel({
+					layout: 'flex',
+					border: '1 0 0 0',
+					spacing: 3,
+					padding: 10,
+					align: 'center',
+					pack: self.isRtl() ? 'start' : 'end',
+					defaults: {
+						type: 'button'
+					},
+					items: settings.buttons
+				});
+
+				self.statusbar.addClass('foot');
+				self.statusbar.parent(self);
+			}
+
+			self.on('click', function(e) {
+				if (e.target.className.indexOf(self.classPrefix + 'close') != -1) {
+					self.close();
+				}
+			});
+
+			self.on('cancel', function() {
+				self.close();
+			});
+
+			self.aria('describedby', self.describedBy || self._id + '-none');
+			self.aria('label', settings.title);
+			self._fullscreen = false;
+		},
+
+		/**
+		 * Recalculates the positions of the controls in the current container.
+		 * This is invoked by the reflow method and shouldn't be called directly.
+		 *
+		 * @method recalc
+		 */
+		recalc: function() {
+			var self = this, statusbar = self.statusbar, layoutRect, width, x, needsRecalc;
+
+			if (self._fullscreen) {
+				self.layoutRect(DomUtils.getWindowSize());
+				self.layoutRect().contentH = self.layoutRect().innerH;
+			}
+
+			self._super();
+
+			layoutRect = self.layoutRect();
+
+			// Resize window based on title width
+			if (self.settings.title && !self._fullscreen) {
+				width = layoutRect.headerW;
+				if (width > layoutRect.w) {
+					x = layoutRect.x - Math.max(0, width / 2);
+					self.layoutRect({w: width, x: x});
+					needsRecalc = true;
+				}
+			}
+
+			// Resize window based on statusbar width
+			if (statusbar) {
+				statusbar.layoutRect({w: self.layoutRect().innerW}).recalc();
+
+				width = statusbar.layoutRect().minW + layoutRect.deltaW;
+				if (width > layoutRect.w) {
+					x = layoutRect.x - Math.max(0, width - layoutRect.w);
+					self.layoutRect({w: width, x: x});
+					needsRecalc = true;
+				}
+			}
+
+			// Recalc body and disable auto resize
+			if (needsRecalc) {
+				self.recalc();
+			}
+		},
+
+		/**
+		 * Initializes the current controls layout rect.
+		 * This will be executed by the layout managers to determine the
+		 * default minWidth/minHeight etc.
+		 *
+		 * @method initLayoutRect
+		 * @return {Object} Layout rect instance.
+		 */
+		initLayoutRect: function() {
+			var self = this, layoutRect = self._super(), deltaH = 0, headEl;
+
+			// Reserve vertical space for title
+			if (self.settings.title && !self._fullscreen) {
+				headEl = self.getEl('head');
+
+				var size = DomUtils.getSize(headEl);
+
+				layoutRect.headerW = size.width;
+				layoutRect.headerH = size.height;
+
+				deltaH += layoutRect.headerH;
+			}
+
+			// Reserve vertical space for statusbar
+			if (self.statusbar) {
+				deltaH += self.statusbar.layoutRect().h;
+			}
+
+			layoutRect.deltaH += deltaH;
+			layoutRect.minH += deltaH;
+			//layoutRect.innerH -= deltaH;
+			layoutRect.h += deltaH;
+
+			var rect = DomUtils.getWindowSize();
+
+			layoutRect.x = Math.max(0, rect.w / 2 - layoutRect.w / 2);
+			layoutRect.y = Math.max(0, rect.h / 2 - layoutRect.h / 2);
+
+			return layoutRect;
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, layout = self._layout, id = self._id, prefix = self.classPrefix;
+			var settings = self.settings, headerHtml = '', footerHtml = '', html = settings.html;
+
+			self.preRender();
+			layout.preRender(self);
+
+			if (settings.title) {
+				headerHtml = (
+					'<div id="' + id + '-head" class="' + prefix + 'window-head">' +
+						'<div id="' + id + '-title" class="' + prefix + 'title">' + self.encode(settings.title) + '</div>' +
+						'<button type="button" class="' + prefix + 'close" aria-hidden="true">\u00d7</button>' +
+						'<div id="' + id + '-dragh" class="' + prefix + 'dragh"></div>' +
+					'</div>'
+				);
+			}
+
+			if (settings.url) {
+				html = '<iframe src="' + settings.url + '" tabindex="-1"></iframe>';
+			}
+
+			if (typeof html == "undefined") {
+				html = layout.renderHtml(self);
+			}
+
+			if (self.statusbar) {
+				footerHtml = self.statusbar.renderHtml();
+			}
+
+			return (
+				'<div id="' + id + '" class="' + self.classes() + '" hidefocus="1">' +
+					'<div class="' + self.classPrefix + 'reset" role="application">' +
+						headerHtml +
+						'<div id="' + id + '-body" class="' + self.classes('body') + '">' +
+							html +
+						'</div>' +
+						footerHtml +
+					'</div>' +
+				'</div>'
+			);
+		},
+
+		/**
+		 * Switches the window fullscreen mode.
+		 *
+		 * @method fullscreen
+		 * @param {Boolean} state True/false state.
+		 * @return {tinymce.ui.Window} Current window instance.
+		 */
+		fullscreen: function(state) {
+			var self = this, documentElement = document.documentElement, slowRendering, prefix = self.classPrefix, layoutRect;
+
+			if (state != self._fullscreen) {
+				DomUtils.on(window, 'resize', function() {
+					var time;
+
+					if (self._fullscreen) {
+						// Time the layout time if it's to slow use a timeout to not hog the CPU
+						if (!slowRendering) {
+							time = new Date().getTime();
+
+							var rect = DomUtils.getWindowSize();
+							self.moveTo(0, 0).resizeTo(rect.w, rect.h);
+
+							if ((new Date().getTime()) - time > 50) {
+								slowRendering = true;
+							}
+						} else {
+							if (!self._timer) {
+								self._timer = setTimeout(function() {
+									var rect = DomUtils.getWindowSize();
+									self.moveTo(0, 0).resizeTo(rect.w, rect.h);
+
+									self._timer = 0;
+								}, 50);
+							}
+						}
+					}
+				});
+
+				layoutRect = self.layoutRect();
+				self._fullscreen = state;
+
+				if (!state) {
+					self._borderBox = self.parseBox(self.settings.border);
+					self.getEl('head').style.display = '';
+					layoutRect.deltaH += layoutRect.headerH;
+					DomUtils.removeClass(documentElement, prefix + 'fullscreen');
+					DomUtils.removeClass(document.body, prefix + 'fullscreen');
+					self.removeClass('fullscreen');
+					self.moveTo(self._initial.x, self._initial.y).resizeTo(self._initial.w, self._initial.h);
+				} else {
+					self._initial = {x: layoutRect.x, y: layoutRect.y, w: layoutRect.w, h: layoutRect.h};
+
+					self._borderBox = self.parseBox('0');
+					self.getEl('head').style.display = 'none';
+					layoutRect.deltaH -= layoutRect.headerH + 2;
+					DomUtils.addClass(documentElement, prefix + 'fullscreen');
+					DomUtils.addClass(document.body, prefix + 'fullscreen');
+					self.addClass('fullscreen');
+
+					var rect = DomUtils.getWindowSize();
+					self.moveTo(0, 0).resizeTo(rect.w, rect.h);
+				}
+			}
+
+			return self.reflow();
+		},
+
+		/**
+		 * Called after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this, startPos;
+
+			setTimeout(function() {
+				self.addClass('in');
+			}, 0);
+
+			self._super();
+
+			if (self.statusbar) {
+				self.statusbar.postRender();
+			}
+
+			self.focus();
+
+			this.dragHelper = new DragHelper(self._id + '-dragh', {
+				start: function() {
+					startPos = {
+						x: self.layoutRect().x,
+						y: self.layoutRect().y
+					};
+				},
+
+				drag: function(e) {
+					self.moveTo(startPos.x + e.deltaX, startPos.y + e.deltaY);
+				}
+			});
+
+			self.on('submit', function(e) {
+				if (!e.isDefaultPrevented()) {
+					self.close();
+				}
+			});
+		},
+
+		/**
+		 * Fires a submit event with the serialized form.
+		 *
+		 * @method submit
+		 * @return {Object} Event arguments object.
+		 */
+		submit: function() {
+			return this.fire('submit', {data: this.toJSON()});
+		},
+
+		/**
+		 * Removes the current control from DOM and from UI collections.
+		 *
+		 * @method remove
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		remove: function() {
+			var self = this, prefix = self.classPrefix;
+
+			self.dragHelper.destroy();
+			self._super();
+
+			if (self.statusbar) {
+				this.statusbar.remove();
+			}
+
+			if (self._fullscreen) {
+				DomUtils.removeClass(document.documentElement, prefix + 'fullscreen');
+				DomUtils.removeClass(document.body, prefix + 'fullscreen');
+			}
+		},
+
+		/**
+		 * Returns the contentWindow object of the iframe if it exists.
+		 *
+		 * @method getContentWindow
+		 * @return {Window} window object or null.
+		 */
+		getContentWindow: function() {
+			var ifr = this.getEl().getElementsByTagName('iframe')[0];
+			return ifr ? ifr.contentWindow : null;
+		}
+	});
+
+	return Window;
+});
+
+// Included from: js/tinymce/classes/ui/MessageBox.js
+
+/**
+ * MessageBox.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is used to create MessageBoxes like alerts/confirms etc.
+ *
+ * @class tinymce.ui.MessageBox
+ * @extends tinymce.ui.Window
+ */
+define("tinymce/ui/MessageBox", [
+	"tinymce/ui/Window"
+], function(Window) {
+	"use strict";
+
+	var MessageBox = Window.extend({
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 */
+		init: function(settings) {
+			settings = {
+				border: 1,
+				padding: 20,
+				layout: 'flex',
+				pack: "center",
+				align: "center",
+				containerCls: 'panel',
+				autoScroll: true,
+				buttons: {type: "button", text: "Ok", action: "ok"},
+				items: {
+					type: "label",
+					multiline: true,
+					maxWidth: 500,
+					maxHeight: 200
+				}
+			};
+
+			this._super(settings);
+		},
+
+		Statics: {
+			/**
+			 * Ok buttons constant.
+			 *
+			 * @static
+			 * @final
+			 * @field {Number} OK
+			 */
+			OK: 1,
+
+			/**
+			 * Ok/cancel buttons constant.
+			 *
+			 * @static
+			 * @final
+			 * @field {Number} OK_CANCEL
+			 */
+			OK_CANCEL: 2,
+
+			/**
+			 * yes/no buttons constant.
+			 *
+			 * @static
+			 * @final
+			 * @field {Number} YES_NO
+			 */
+			YES_NO: 3,
+
+			/**
+			 * yes/no/cancel buttons constant.
+			 *
+			 * @static
+			 * @final
+			 * @field {Number} YES_NO_CANCEL
+			 */
+			YES_NO_CANCEL: 4,
+
+			/**
+			 * Constructs a new message box and renders it to the body element.
+			 *
+			 * @static
+			 * @method msgBox
+			 * @param {Object} settings Name/value object with settings.
+			 */
+			msgBox: function(settings) {
+				var buttons, callback = settings.callback || function() {};
+
+				function createButton(text, status, primary) {
+					return {
+						type: "button",
+						text: text,
+						subtype: primary ? 'primary' : '',
+						onClick: function(e) {
+							e.control.parents()[1].close();
+							callback(status);
+						}
+					};
+				}
+
+				switch (settings.buttons) {
+					case MessageBox.OK_CANCEL:
+						buttons = [
+							createButton('Ok', true, true),
+							createButton('Cancel', false)
+						];
+						break;
+
+					case MessageBox.YES_NO:
+					case MessageBox.YES_NO_CANCEL:
+						buttons = [
+							createButton('Yes', 1, true),
+							createButton('No', 0)
+						];
+
+						if (settings.buttons == MessageBox.YES_NO_CANCEL) {
+							buttons.push(createButton('Cancel', -1));
+						}
+						break;
+
+					default:
+						buttons = [
+							createButton('Ok', true, true)
+						];
+						break;
+				}
+
+				return new Window({
+					padding: 20,
+					x: settings.x,
+					y: settings.y,
+					minWidth: 300,
+					minHeight: 100,
+					layout: "flex",
+					pack: "center",
+					align: "center",
+					buttons: buttons,
+					title: settings.title,
+					role: 'alertdialog',
+					items: {
+						type: "label",
+						multiline: true,
+						maxWidth: 500,
+						maxHeight: 200,
+						text: settings.text
+					},
+					onPostRender: function() {
+						this.aria('describedby', this.items()[0]._id);
+					},
+					onClose: settings.onClose,
+					onCancel: function() {
+						callback(false);
+					}
+				}).renderTo(document.body).reflow();
+			},
+
+			/**
+			 * Creates a new alert dialog.
+			 *
+			 * @method alert
+			 * @param {Object} settings Settings for the alert dialog.
+			 * @param {function} [callback] Callback to execute when the user makes a choice.
+			 */
+			alert: function(settings, callback) {
+				if (typeof settings == "string") {
+					settings = {text: settings};
+				}
+
+				settings.callback = callback;
+				return MessageBox.msgBox(settings);
+			},
+
+			/**
+			 * Creates a new confirm dialog.
+			 *
+			 * @method confirm
+			 * @param {Object} settings Settings for the confirm dialog.
+			 * @param {function} [callback] Callback to execute when the user makes a choice.
+			 */
+			confirm: function(settings, callback) {
+				if (typeof settings == "string") {
+					settings = {text: settings};
+				}
+
+				settings.callback = callback;
+				settings.buttons = MessageBox.OK_CANCEL;
+
+				return MessageBox.msgBox(settings);
+			}
+		}
+	});
+
+	return MessageBox;
+});
+
+// Included from: js/tinymce/classes/WindowManager.js
+
+/**
+ * WindowManager.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles the creation of native windows and dialogs. This class can be extended to provide for example inline dialogs.
+ *
+ * @class tinymce.WindowManager
+ * @example
+ * // Opens a new dialog with the file.htm file and the size 320x240
+ * // It also adds a custom parameter this can be retrieved by using tinyMCEPopup.getWindowArg inside the dialog.
+ * tinymce.activeEditor.windowManager.open({
+ *    url: 'file.htm',
+ *    width: 320,
+ *    height: 240
+ * }, {
+ *    custom_param: 1
+ * });
+ *
+ * // Displays an alert box using the active editors window manager instance
+ * tinymce.activeEditor.windowManager.alert('Hello world!');
+ *
+ * // Displays an confirm box and an alert message will be displayed depending on what you choose in the confirm
+ * tinymce.activeEditor.windowManager.confirm("Do you want to do something", function(s) {
+ *    if (s)
+ *       tinymce.activeEditor.windowManager.alert("Ok");
+ *    else
+ *       tinymce.activeEditor.windowManager.alert("Cancel");
+ * });
+ */
+define("tinymce/WindowManager", [
+	"tinymce/ui/Window",
+	"tinymce/ui/MessageBox"
+], function(Window, MessageBox) {
+	return function(editor) {
+		var self = this, windows = [];
+
+		function getTopMostWindow() {
+			if (windows.length) {
+				return windows[windows.length - 1];
+			}
+		}
+
+		self.windows = windows;
+
+		editor.on('remove', function() {
+			var i = windows.length;
+
+			while (i--) {
+				windows[i].close();
+			}
+		});
+
+		/**
+		 * Opens a new window.
+		 *
+		 * @method open
+		 * @param {Object} args Optional name/value settings collection contains things like width/height/url etc.
+		 * @option {String} title Window title.
+		 * @option {String} file URL of the file to open in the window.
+		 * @option {Number} width Width in pixels.
+		 * @option {Number} height Height in pixels.
+		 * @option {Boolean} autoScroll Specifies whether the popup window can have scrollbars if required (i.e. content
+		 * larger than the popup size specified).
+		 */
+		self.open = function(args, params) {
+			var win;
+
+			editor.editorManager.setActive(editor);
+
+			args.title = args.title || ' ';
+
+			// Handle URL
+			args.url = args.url || args.file; // Legacy
+			if (args.url) {
+				args.width = parseInt(args.width || 320, 10);
+				args.height = parseInt(args.height || 240, 10);
+			}
+
+			// Handle body
+			if (args.body) {
+				args.items = {
+					defaults: args.defaults,
+					type: args.bodyType || 'form',
+					items: args.body
+				};
+			}
+
+			if (!args.url && !args.buttons) {
+				args.buttons = [
+					{text: 'Ok', subtype: 'primary', onclick: function() {
+						win.find('form')[0].submit();
+					}},
+
+					{text: 'Cancel', onclick: function() {
+						win.close();
+					}}
+				];
+			}
+
+			win = new Window(args);
+			windows.push(win);
+
+			win.on('close', function() {
+				var i = windows.length;
+
+				while (i--) {
+					if (windows[i] === win) {
+						windows.splice(i, 1);
+					}
+				}
+
+				if (!windows.length) {
+					editor.focus();
+				}
+			});
+
+			// Handle data
+			if (args.data) {
+				win.on('postRender', function() {
+					this.find('*').each(function(ctrl) {
+						var name = ctrl.name();
+
+						if (name in args.data) {
+							ctrl.value(args.data[name]);
+						}
+					});
+				});
+			}
+
+			// store args and parameters
+			win.features = args || {};
+			win.params = params || {};
+
+			// Takes a snapshot in the FocusManager of the selection before focus is lost to dialog
+			if (windows.length === 1) {
+				editor.nodeChanged();
+			}
+
+			return win.renderTo().reflow();
+		};
+
+		/**
+		 * Creates a alert dialog. Please don't use the blocking behavior of this
+		 * native version use the callback method instead then it can be extended.
+		 *
+		 * @method alert
+		 * @param {String} message Text to display in the new alert dialog.
+		 * @param {function} callback Callback function to be executed after the user has selected ok.
+		 * @param {Object} scope Optional scope to execute the callback in.
+		 * @example
+		 * // Displays an alert box using the active editors window manager instance
+		 * tinymce.activeEditor.windowManager.alert('Hello world!');
+		 */
+		self.alert = function(message, callback, scope) {
+			MessageBox.alert(message, function() {
+				if (callback) {
+					callback.call(scope || this);
+				} else {
+					editor.focus();
+				}
+			});
+		};
+
+		/**
+		 * Creates a confirm dialog. Please don't use the blocking behavior of this
+		 * native version use the callback method instead then it can be extended.
+		 *
+		 * @method confirm
+		 * @param {String} messageText to display in the new confirm dialog.
+		 * @param {function} callback Callback function to be executed after the user has selected ok or cancel.
+		 * @param {Object} scope Optional scope to execute the callback in.
+		 * @example
+		 * // Displays an confirm box and an alert message will be displayed depending on what you choose in the confirm
+		 * tinymce.activeEditor.windowManager.confirm("Do you want to do something", function(s) {
+		 *    if (s)
+		 *       tinymce.activeEditor.windowManager.alert("Ok");
+		 *    else
+		 *       tinymce.activeEditor.windowManager.alert("Cancel");
+		 * });
+		 */
+		self.confirm = function(message, callback, scope) {
+			MessageBox.confirm(message, function(state) {
+				callback.call(scope || this, state);
+			});
+		};
+
+		/**
+		 * Closes the top most window.
+		 *
+		 * @method close
+		 */
+		self.close = function() {
+			if (getTopMostWindow()) {
+				getTopMostWindow().close();
+			}
+		};
+
+		/**
+		 * Returns the params of the last window open call. This can be used in iframe based
+		 * dialog to get params passed from the tinymce plugin.
+		 *
+		 * @example
+		 * var dialogArguments = top.tinymce.activeEditor.windowManager.getParams();
+		 *
+		 * @method getParams
+		 * @return {Object} Name/value object with parameters passed from windowManager.open call.
+		 */
+		self.getParams = function() {
+			return getTopMostWindow() ? getTopMostWindow().params : null;
+		};
+
+		/**
+		 * Sets the params of the last opened window.
+		 *
+		 * @method setParams
+		 * @param {Object} params Params object to set for the last opened window.
+		 */
+		self.setParams = function(params) {
+			if (getTopMostWindow()) {
+				getTopMostWindow().params = params;
+			}
+		};
+
+		/**
+		 * Returns the currently opened window objects.
+		 *
+		 * @method getWindows
+		 * @return {Array} Array of the currently opened windows.
+		 */
+		self.getWindows = function() {
+			return windows;
+		};
+	};
+});
+
+// Included from: js/tinymce/classes/util/Quirks.js
+
+/**
+ * Quirks.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ *
+ * @ignore-file
+ */
+
+/**
+ * This file includes fixes for various browser quirks it's made to make it easy to add/remove browser specific fixes.
+ *
+ * @class tinymce.util.Quirks
+ */
+define("tinymce/util/Quirks", [
+	"tinymce/util/VK",
+	"tinymce/dom/RangeUtils",
+	"tinymce/dom/TreeWalker",
+	"tinymce/html/Node",
+	"tinymce/html/Entities",
+	"tinymce/Env",
+	"tinymce/util/Tools"
+], function(VK, RangeUtils, TreeWalker, Node, Entities, Env, Tools) {
+	return function(editor) {
+		var each = Tools.each, $ = editor.$;
+		var BACKSPACE = VK.BACKSPACE, DELETE = VK.DELETE, dom = editor.dom, selection = editor.selection,
+			settings = editor.settings, parser = editor.parser, serializer = editor.serializer;
+		var isGecko = Env.gecko, isIE = Env.ie, isWebKit = Env.webkit;
+		var mceInternalUrlPrefix = 'data:text/mce-internal,';
+		var mceInternalDataType = isIE ? 'Text' : 'URL';
+
+		/**
+		 * Executes a command with a specific state this can be to enable/disable browser editing features.
+		 */
+		function setEditorCommandState(cmd, state) {
+			try {
+				editor.getDoc().execCommand(cmd, false, state);
+			} catch (ex) {
+				// Ignore
+			}
+		}
+
+		/**
+		 * Returns current IE document mode.
+		 */
+		function getDocumentMode() {
+			var documentMode = editor.getDoc().documentMode;
+
+			return documentMode ? documentMode : 6;
+		}
+
+		/**
+		 * Returns true/false if the event is prevented or not.
+		 *
+		 * @private
+		 * @param {Event} e Event object.
+		 * @return {Boolean} true/false if the event is prevented or not.
+		 */
+		function isDefaultPrevented(e) {
+			return e.isDefaultPrevented();
+		}
+
+		/**
+		 * Sets Text/URL data on the event's dataTransfer object to a special data:text/mce-internal url.
+		 * This is to workaround the inability to set custom contentType on IE and Safari.
+		 * The editor's selected content is encoded into this url so drag and drop between editors will work.
+		 *
+		 * @private
+		 * @param {DragEvent} e Event object
+		 */
+		function setMceInteralContent(e) {
+			var selectionHtml;
+
+			if (e.dataTransfer) {
+				if (editor.selection.isCollapsed() && e.target.tagName == 'IMG') {
+					selection.select(e.target);
+				}
+
+				selectionHtml = editor.selection.getContent();
+
+				// Safari/IE doesn't support custom dataTransfer items so we can only use URL and Text
+				if (selectionHtml.length > 0) {
+					e.dataTransfer.setData(mceInternalDataType, mceInternalUrlPrefix + escape(selectionHtml));
+				}
+			}
+		}
+
+		/**
+		 * Gets content of special data:text/mce-internal url on the event's dataTransfer object.
+		 * This is to workaround the inability to set custom contentType on IE and Safari.
+		 * The editor's selected content is encoded into this url so drag and drop between editors will work.
+		 *
+		 * @private
+		 * @param {DragEvent} e Event object
+		 * @returns {String} mce-internal content
+		 */
+		function getMceInternalContent(e) {
+			var internalContent, content;
+
+			if (e.dataTransfer) {
+				internalContent = e.dataTransfer.getData(mceInternalDataType);
+
+				if (internalContent && internalContent.indexOf(mceInternalUrlPrefix) >= 0) {
+					content = unescape(internalContent.substr(mceInternalUrlPrefix.length));
+				}
+			}
+
+			return content;
+		}
+
+		/**
+		 * Inserts contents using the paste clipboard command if it's available if it isn't it will fallback
+		 * to the core command.
+		 *
+		 * @private
+		 * @param {String} content Content to insert at selection.
+		 */
+		function insertClipboardContents(content) {
+			if (editor.queryCommandSupported('mceInsertClipboardContent')) {
+				editor.execCommand('mceInsertClipboardContent', false, {content: content});
+			} else {
+				editor.execCommand('mceInsertContent', false, content);
+			}
+		}
+
+		/**
+		 * Fixes a WebKit bug when deleting contents using backspace or delete key.
+		 * WebKit will produce a span element if you delete across two block elements.
+		 *
+		 * Example:
+		 * <h1>a</h1><p>|b</p>
+		 *
+		 * Will produce this on backspace:
+		 * <h1>a<span style="<all runtime styles>">b</span></p>
+		 *
+		 * This fixes the backspace to produce:
+		 * <h1>a|b</p>
+		 *
+		 * See bug: https://bugs.webkit.org/show_bug.cgi?id=45784
+		 *
+		 * This fixes the following delete scenarios:
+		 *  1. Delete by pressing backspace key.
+		 *  2. Delete by pressing delete key.
+		 *  3. Delete by pressing backspace key with ctrl/cmd (Word delete).
+		 *  4. Delete by pressing delete key with ctrl/cmd (Word delete).
+		 *  5. Delete by drag/dropping contents inside the editor.
+		 *  6. Delete by using Cut Ctrl+X/Cmd+X.
+		 *  7. Delete by selecting contents and writing a character.
+		 *
+		 * This code is a ugly hack since writing full custom delete logic for just this bug
+		 * fix seemed like a huge task. I hope we can remove this before the year 2030.
+		 */
+		function cleanupStylesWhenDeleting() {
+			var doc = editor.getDoc(), dom = editor.dom, selection = editor.selection;
+			var MutationObserver = window.MutationObserver, olderWebKit, dragStartRng;
+
+			// Add mini polyfill for older WebKits
+			// TODO: Remove this when old Safari versions gets updated
+			if (!MutationObserver) {
+				olderWebKit = true;
+
+				MutationObserver = function() {
+					var records = [], target;
+
+					function nodeInsert(e) {
+						var target = e.relatedNode || e.target;
+						records.push({target: target, addedNodes: [target]});
+					}
+
+					function attrModified(e) {
+						var target = e.relatedNode || e.target;
+						records.push({target: target, attributeName: e.attrName});
+					}
+
+					this.observe = function(node) {
+						target = node;
+						target.addEventListener('DOMSubtreeModified', nodeInsert, false);
+						target.addEventListener('DOMNodeInsertedIntoDocument', nodeInsert, false);
+						target.addEventListener('DOMNodeInserted', nodeInsert, false);
+						target.addEventListener('DOMAttrModified', attrModified, false);
+					};
+
+					this.disconnect = function() {
+						target.removeEventListener('DOMSubtreeModified', nodeInsert, false);
+						target.removeEventListener('DOMNodeInsertedIntoDocument', nodeInsert, false);
+						target.removeEventListener('DOMNodeInserted', nodeInsert, false);
+						target.removeEventListener('DOMAttrModified', attrModified, false);
+					};
+
+					this.takeRecords = function() {
+						return records;
+					};
+				};
+			}
+
+			function isTrailingBr(node) {
+				var blockElements = dom.schema.getBlockElements(), rootNode = editor.getBody();
+
+				if (node.nodeName != 'BR') {
+					return false;
+				}
+
+				for (node = node; node != rootNode && !blockElements[node.nodeName]; node = node.parentNode) {
+					if (node.nextSibling) {
+						return false;
+					}
+				}
+
+				return true;
+			}
+
+			function isSiblingsIgnoreWhiteSpace(node1, node2) {
+				var node;
+
+				for (node = node1.nextSibling; node && node != node2; node = node.nextSibling) {
+					if (node.nodeType == 3 && $.trim(node.data).length === 0) {
+						continue;
+					}
+
+					if (node !== node2) {
+						return false;
+					}
+				}
+
+				return node === node2;
+			}
+
+			function findCaretNode(node, forward, startNode) {
+				var walker, current, nonEmptyElements;
+
+				nonEmptyElements = dom.schema.getNonEmptyElements();
+
+				walker = new TreeWalker(startNode || node, node);
+
+				while ((current = walker[forward ? 'next' : 'prev']())) {
+					if (nonEmptyElements[current.nodeName] && !isTrailingBr(current)) {
+						return current;
+					}
+
+					if (current.nodeType == 3 && current.data.length > 0) {
+						return current;
+					}
+				}
+			}
+
+			function deleteRangeBetweenTextBlocks(rng) {
+				var startBlock, endBlock, caretNodeBefore, caretNodeAfter, textBlockElements;
+
+				if (rng.collapsed) {
+					return;
+				}
+
+				startBlock = dom.getParent(RangeUtils.getNode(rng.startContainer, rng.startOffset), dom.isBlock);
+				endBlock = dom.getParent(RangeUtils.getNode(rng.endContainer, rng.endOffset), dom.isBlock);
+				textBlockElements = editor.schema.getTextBlockElements();
+
+				if (startBlock == endBlock) {
+					return;
+				}
+
+				if (!textBlockElements[startBlock.nodeName] || !textBlockElements[endBlock.nodeName]) {
+					return;
+				}
+
+				if (dom.getContentEditable(startBlock) === "false" || dom.getContentEditable(endBlock) === "false") {
+					return;
+				}
+
+				rng.deleteContents();
+
+				caretNodeBefore = findCaretNode(startBlock, false);
+				caretNodeAfter = findCaretNode(endBlock, true);
+
+				if (!dom.isEmpty(endBlock)) {
+					$(startBlock).append(endBlock.childNodes);
+				}
+
+				$(endBlock).remove();
+
+				if (caretNodeBefore) {
+					if (caretNodeBefore.nodeType == 1) {
+						if (caretNodeBefore.nodeName == "BR") {
+							rng.setStartBefore(caretNodeBefore);
+							rng.setEndBefore(caretNodeBefore);
+						} else {
+							rng.setStartAfter(caretNodeBefore);
+							rng.setEndAfter(caretNodeBefore);
+						}
+					} else {
+						rng.setStart(caretNodeBefore, caretNodeBefore.data.length);
+						rng.setEnd(caretNodeBefore, caretNodeBefore.data.length);
+					}
+				} else if (caretNodeAfter) {
+					if (caretNodeAfter.nodeType == 1) {
+						rng.setStartBefore(caretNodeAfter);
+						rng.setEndBefore(caretNodeAfter);
+					} else {
+						rng.setStart(caretNodeAfter, 0);
+						rng.setEnd(caretNodeAfter, 0);
+					}
+				}
+
+				selection.setRng(rng);
+
+				return true;
+			}
+
+			function expandBetweenBlocks(rng, isForward) {
+				var caretNode, targetCaretNode, textBlock, targetTextBlock, container, offset;
+
+				if (!rng.collapsed) {
+					return rng;
+				}
+
+				container = rng.startContainer;
+				offset = rng.startOffset;
+
+				if (container.nodeType == 3) {
+					if (isForward) {
+						if (offset < container.data.length) {
+							return rng;
+						}
+					} else {
+						if (offset > 0) {
+							return rng;
+						}
+					}
+				}
+
+				caretNode = RangeUtils.getNode(rng.startContainer, rng.startOffset);
+				textBlock = dom.getParent(caretNode, dom.isBlock);
+				targetCaretNode = findCaretNode(editor.getBody(), isForward, caretNode);
+				targetTextBlock = dom.getParent(targetCaretNode, dom.isBlock);
+
+				if (!caretNode || !targetCaretNode) {
+					return rng;
+				}
+
+				if (targetTextBlock && textBlock != targetTextBlock) {
+					if (!isForward) {
+						if (!isSiblingsIgnoreWhiteSpace(targetTextBlock, textBlock)) {
+							return rng;
+						}
+
+						if (targetCaretNode.nodeType == 1) {
+							if (targetCaretNode.nodeName == "BR") {
+								rng.setStartBefore(targetCaretNode);
+							} else {
+								rng.setStartAfter(targetCaretNode);
+							}
+						} else {
+							rng.setStart(targetCaretNode, targetCaretNode.data.length);
+						}
+
+						if (caretNode.nodeType == 1) {
+							rng.setEnd(caretNode, 0);
+						} else {
+							rng.setEndBefore(caretNode);
+						}
+					} else {
+						if (!isSiblingsIgnoreWhiteSpace(textBlock, targetTextBlock)) {
+							return rng;
+						}
+
+						if (caretNode.nodeType == 1) {
+							if (caretNode.nodeName == "BR") {
+								rng.setStartBefore(caretNode);
+							} else {
+								rng.setStartAfter(caretNode);
+							}
+						} else {
+							rng.setStart(caretNode, caretNode.data.length);
+						}
+
+						if (targetCaretNode.nodeType == 1) {
+							rng.setEnd(targetCaretNode, 0);
+						} else {
+							rng.setEndBefore(targetCaretNode);
+						}
+					}
+				}
+
+				return rng;
+			}
+
+			function handleTextBlockMergeDelete(isForward) {
+				var rng = selection.getRng();
+
+				rng = expandBetweenBlocks(rng, isForward);
+
+				if (deleteRangeBetweenTextBlocks(rng)) {
+					return true;
+				}
+			}
+
+			function customDelete(isForward) {
+				var mutationObserver, rng, caretElement;
+
+				if (handleTextBlockMergeDelete(isForward)) {
+					return;
+				}
+
+				Tools.each(editor.getBody().getElementsByTagName('*'), function(elm) {
+					// Mark existing spans
+					if (elm.tagName == 'SPAN') {
+						elm.setAttribute('mce-data-marked', 1);
+					}
+
+					// Make sure all elements has a data-mce-style attribute
+					if (!elm.hasAttribute('data-mce-style') && elm.hasAttribute('style')) {
+						editor.dom.setAttrib(elm, 'style', editor.dom.getAttrib(elm, 'style'));
+					}
+				});
+
+				// Observe added nodes and style attribute changes
+				mutationObserver = new MutationObserver(function() {});
+				mutationObserver.observe(editor.getDoc(), {
+					childList: true,
+					attributes: true,
+					subtree: true,
+					attributeFilter: ['style']
+				});
+
+				editor.getDoc().execCommand(isForward ? 'ForwardDelete' : 'Delete', false, null);
+
+				rng = editor.selection.getRng();
+				caretElement = rng.startContainer.parentNode;
+
+				Tools.each(mutationObserver.takeRecords(), function(record) {
+					if (!dom.isChildOf(record.target, editor.getBody())) {
+						return;
+					}
+
+					// Restore style attribute to previous value
+					if (record.attributeName == "style") {
+						var oldValue = record.target.getAttribute('data-mce-style');
+
+						if (oldValue) {
+							record.target.setAttribute("style", oldValue);
+						} else {
+							record.target.removeAttribute("style");
+						}
+					}
+
+					// Remove all spans that isn't maked and retain selection
+					Tools.each(record.addedNodes, function(node) {
+						if (node.nodeName == "SPAN" && !node.getAttribute('mce-data-marked')) {
+							var offset, container;
+
+							if (node == caretElement) {
+								offset = rng.startOffset;
+								container = node.firstChild;
+							}
+
+							dom.remove(node, true);
+
+							if (container) {
+								rng.setStart(container, offset);
+								rng.setEnd(container, offset);
+								editor.selection.setRng(rng);
+							}
+						}
+					});
+				});
+
+				mutationObserver.disconnect();
+
+				// Remove any left over marks
+				Tools.each(editor.dom.select('span[mce-data-marked]'), function(span) {
+					span.removeAttribute('mce-data-marked');
+				});
+			}
+
+			editor.on('keydown', function(e) {
+				var isForward = e.keyCode == DELETE, isMetaOrCtrl = e.ctrlKey || e.metaKey;
+
+				if (!isDefaultPrevented(e) && (isForward || e.keyCode == BACKSPACE)) {
+					var rng = editor.selection.getRng(), container = rng.startContainer, offset = rng.startOffset;
+
+					// Ignore non meta delete in the where there is text before/after the caret
+					if (!isMetaOrCtrl && rng.collapsed && container.nodeType == 3) {
+						if (isForward ? offset < container.data.length : offset > 0) {
+							return;
+						}
+					}
+
+					e.preventDefault();
+
+					if (isMetaOrCtrl) {
+						editor.selection.getSel().modify("extend", isForward ? "forward" : "backward", e.metaKey ? "lineboundary" : "word");
+					}
+
+					customDelete(isForward);
+				}
+			});
+
+			// Handle case where text is deleted by typing over
+			editor.on('keypress', function(e) {
+				if (!isDefaultPrevented(e) && !selection.isCollapsed() && e.charCode && !VK.metaKeyPressed(e)) {
+					var rng, currentFormatNodes, fragmentNode, blockParent, caretNode, charText;
+
+					rng = editor.selection.getRng();
+					charText = String.fromCharCode(e.charCode);
+					e.preventDefault();
+
+					// Keep track of current format nodes
+					currentFormatNodes = $(rng.startContainer).parents().filter(function(idx, node) {
+						return !!editor.schema.getTextInlineElements()[node.nodeName];
+					});
+
+					customDelete(true);
+
+					// Check if the browser removed them
+					currentFormatNodes = currentFormatNodes.filter(function(idx, node) {
+						return !$.contains(editor.getBody(), node);
+					});
+
+					// Then re-add them
+					if (currentFormatNodes.length) {
+						fragmentNode = dom.createFragment();
+
+						currentFormatNodes.each(function(idx, formatNode) {
+							formatNode = formatNode.cloneNode(false);
+
+							if (fragmentNode.hasChildNodes()) {
+								formatNode.appendChild(fragmentNode.firstChild);
+								fragmentNode.appendChild(formatNode);
+							} else {
+								caretNode = formatNode;
+								fragmentNode.appendChild(formatNode);
+							}
+
+							fragmentNode.appendChild(formatNode);
+						});
+
+						caretNode.appendChild(editor.getDoc().createTextNode(charText));
+
+						// Prevent edge case where older WebKit would add an extra BR element
+						blockParent = dom.getParent(rng.startContainer, dom.isBlock);
+						if (dom.isEmpty(blockParent)) {
+							$(blockParent).empty().append(fragmentNode);
+						} else {
+							rng.insertNode(fragmentNode);
+						}
+
+						rng.setStart(caretNode.firstChild, 1);
+						rng.setEnd(caretNode.firstChild, 1);
+						editor.selection.setRng(rng);
+					} else {
+						editor.selection.setContent(charText);
+					}
+				}
+			});
+
+			editor.addCommand('Delete', function() {
+				customDelete();
+			});
+
+			editor.addCommand('ForwardDelete', function() {
+				customDelete(true);
+			});
+
+			// Older WebKits doesn't properly handle the clipboard so we can't add the rest
+			if (olderWebKit) {
+				return;
+			}
+
+			editor.on('dragstart', function(e) {
+				dragStartRng = selection.getRng();
+				setMceInteralContent(e);
+			});
+
+			editor.on('drop', function(e) {
+				if (!isDefaultPrevented(e)) {
+					var internalContent = getMceInternalContent(e);
+					if (internalContent) {
+						e.preventDefault();
+
+						// Safari has a weird issue where drag/dropping images sometimes
+						// produces a green plus icon. When this happens the caretRangeFromPoint
+						// will return "null" even though the x, y coordinate is correct.
+						// But if we detach the insert from the drop event we will get a proper range
+						window.setTimeout(function() {
+							var pointRng = RangeUtils.getCaretRangeFromPoint(e.x, e.y, doc);
+
+							if (dragStartRng) {
+								selection.setRng(dragStartRng);
+								dragStartRng = null;
+							}
+
+							customDelete();
+							selection.setRng(pointRng);
+							insertClipboardContents(internalContent);
+						}, 0);
+					}
+				}
+			});
+
+			editor.on('cut', function(e) {
+				if (!isDefaultPrevented(e) && e.clipboardData) {
+					e.preventDefault();
+					e.clipboardData.clearData();
+					e.clipboardData.setData('text/html', editor.selection.getContent());
+					e.clipboardData.setData('text/plain', editor.selection.getContent({format: 'text'}));
+					customDelete(true);
+				}
+			});
+		}
+
+		/**
+		 * Makes sure that the editor body becomes empty when backspace or delete is pressed in empty editors.
+		 *
+		 * For example:
+		 * <p><b>|</b></p>
+		 *
+		 * Or:
+		 * <h1>|</h1>
+		 *
+		 * Or:
+		 * [<h1></h1>]
+		 */
+		function emptyEditorWhenDeleting() {
+			function serializeRng(rng) {
+				var body = dom.create("body");
+				var contents = rng.cloneContents();
+				body.appendChild(contents);
+				return selection.serializer.serialize(body, {format: 'html'});
+			}
+
+			function allContentsSelected(rng) {
+				if (!rng.setStart) {
+					if (rng.item) {
+						return false;
+					}
+
+					var bodyRng = rng.duplicate();
+					bodyRng.moveToElementText(editor.getBody());
+					return RangeUtils.compareRanges(rng, bodyRng);
+				}
+
+				var selection = serializeRng(rng);
+
+				var allRng = dom.createRng();
+				allRng.selectNode(editor.getBody());
+
+				var allSelection = serializeRng(allRng);
+				return selection === allSelection;
+			}
+
+			editor.on('keydown', function(e) {
+				var keyCode = e.keyCode, isCollapsed, body;
+
+				// Empty the editor if it's needed for example backspace at <p><b>|</b></p>
+				if (!isDefaultPrevented(e) && (keyCode == DELETE || keyCode == BACKSPACE)) {
+					isCollapsed = editor.selection.isCollapsed();
+					body = editor.getBody();
+
+					// Selection is collapsed but the editor isn't empty
+					if (isCollapsed && !dom.isEmpty(body)) {
+						return;
+					}
+
+					// Selection isn't collapsed but not all the contents is selected
+					if (!isCollapsed && !allContentsSelected(editor.selection.getRng())) {
+						return;
+					}
+
+					// Manually empty the editor
+					e.preventDefault();
+					editor.setContent('');
+
+					if (body.firstChild && dom.isBlock(body.firstChild)) {
+						editor.selection.setCursorLocation(body.firstChild, 0);
+					} else {
+						editor.selection.setCursorLocation(body, 0);
+					}
+
+					editor.nodeChanged();
+				}
+			});
+		}
+
+		/**
+		 * WebKit doesn't select all the nodes in the body when you press Ctrl+A.
+		 * IE selects more than the contents <body>[<p>a</p>]</body> instead of <body><p>[a]</p]</body> see bug #6438
+		 * This selects the whole body so that backspace/delete logic will delete everything
+		 */
+		function selectAll() {
+			editor.shortcuts.add('meta+a', null, 'SelectAll');
+		}
+
+		/**
+		 * WebKit has a weird issue where it some times fails to properly convert keypresses to input method keystrokes.
+		 * The IME on Mac doesn't initialize when it doesn't fire a proper focus event.
+		 *
+		 * This seems to happen when the user manages to click the documentElement element then the window doesn't get proper focus until
+		 * you enter a character into the editor.
+		 *
+		 * It also happens when the first focus in made to the body.
+		 *
+		 * See: https://bugs.webkit.org/show_bug.cgi?id=83566
+		 */
+		function inputMethodFocus() {
+			if (!editor.settings.content_editable) {
+				// Case 1 IME doesn't initialize if you focus the document
+				dom.bind(editor.getDoc(), 'focusin', function() {
+					selection.setRng(selection.getRng());
+				});
+
+				// Case 2 IME doesn't initialize if you click the documentElement it also doesn't properly fire the focusin event
+				// Needs to be both down/up due to weird rendering bug on Chrome Windows
+				dom.bind(editor.getDoc(), 'mousedown mouseup', function(e) {
+					if (e.target == editor.getDoc().documentElement) {
+						editor.getBody().focus();
+
+						if (e.type == 'mousedown') {
+							// Edge case for mousedown, drag select and mousedown again within selection on Chrome Windows to render caret
+							selection.placeCaretAt(e.clientX, e.clientY);
+						} else {
+							selection.setRng(selection.getRng());
+						}
+					}
+				});
+			}
+		}
+
+		/**
+		 * Backspacing in FireFox/IE from a paragraph into a horizontal rule results in a floating text node because the
+		 * browser just deletes the paragraph - the browser fails to merge the text node with a horizontal rule so it is
+		 * left there. TinyMCE sees a floating text node and wraps it in a paragraph on the key up event (ForceBlocks.js
+		 * addRootBlocks), meaning the action does nothing. With this code, FireFox/IE matche the behaviour of other
+		 * browsers.
+		 *
+		 * It also fixes a bug on Firefox where it's impossible to delete HR elements.
+		 */
+		function removeHrOnBackspace() {
+			editor.on('keydown', function(e) {
+				if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {
+					// Check if there is any HR elements this is faster since getRng on IE 7 & 8 is slow
+					if (!editor.getBody().getElementsByTagName('hr').length) {
+						return;
+					}
+
+					if (selection.isCollapsed() && selection.getRng(true).startOffset === 0) {
+						var node = selection.getNode();
+						var previousSibling = node.previousSibling;
+
+						if (node.nodeName == 'HR') {
+							dom.remove(node);
+							e.preventDefault();
+							return;
+						}
+
+						if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === "hr") {
+							dom.remove(previousSibling);
+							e.preventDefault();
+						}
+					}
+				}
+			});
+		}
+
+		/**
+		 * Firefox 3.x has an issue where the body element won't get proper focus if you click out
+		 * side it's rectangle.
+		 */
+		function focusBody() {
+			// Fix for a focus bug in FF 3.x where the body element
+			// wouldn't get proper focus if the user clicked on the HTML element
+			if (!window.Range.prototype.getClientRects) { // Detect getClientRects got introduced in FF 4
+				editor.on('mousedown', function(e) {
+					if (!isDefaultPrevented(e) && e.target.nodeName === "HTML") {
+						var body = editor.getBody();
+
+						// Blur the body it's focused but not correctly focused
+						body.blur();
+
+						// Refocus the body after a little while
+						setTimeout(function() {
+							body.focus();
+						}, 0);
+					}
+				});
+			}
+		}
+
+		/**
+		 * WebKit has a bug where it isn't possible to select image, hr or anchor elements
+		 * by clicking on them so we need to fake that.
+		 */
+		function selectControlElements() {
+			editor.on('click', function(e) {
+				var target = e.target;
+
+				// Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250
+				// WebKit can't even do simple things like selecting an image
+				// Needs to be the setBaseAndExtend or it will fail to select floated images
+				if (/^(IMG|HR)$/.test(target.nodeName)) {
+					e.preventDefault();
+					selection.getSel().setBaseAndExtent(target, 0, target, 1);
+					editor.nodeChanged();
+				}
+
+				if (target.nodeName == 'A' && dom.hasClass(target, 'mce-item-anchor')) {
+					e.preventDefault();
+					selection.select(target);
+				}
+			});
+		}
+
+		/**
+		 * Fixes a Gecko bug where the style attribute gets added to the wrong element when deleting between two block elements.
+		 *
+		 * Fixes do backspace/delete on this:
+		 * <p>bla[ck</p><p style="color:red">r]ed</p>
+		 *
+		 * Would become:
+		 * <p>bla|ed</p>
+		 *
+		 * Instead of:
+		 * <p style="color:red">bla|ed</p>
+		 */
+		function removeStylesWhenDeletingAcrossBlockElements() {
+			function getAttributeApplyFunction() {
+				var template = dom.getAttribs(selection.getStart().cloneNode(false));
+
+				return function() {
+					var target = selection.getStart();
+
+					if (target !== editor.getBody()) {
+						dom.setAttrib(target, "style", null);
+
+						each(template, function(attr) {
+							target.setAttributeNode(attr.cloneNode(true));
+						});
+					}
+				};
+			}
+
+			function isSelectionAcrossElements() {
+				return !selection.isCollapsed() &&
+					dom.getParent(selection.getStart(), dom.isBlock) != dom.getParent(selection.getEnd(), dom.isBlock);
+			}
+
+			editor.on('keypress', function(e) {
+				var applyAttributes;
+
+				if (!isDefaultPrevented(e) && (e.keyCode == 8 || e.keyCode == 46) && isSelectionAcrossElements()) {
+					applyAttributes = getAttributeApplyFunction();
+					editor.getDoc().execCommand('delete', false, null);
+					applyAttributes();
+					e.preventDefault();
+					return false;
+				}
+			});
+
+			dom.bind(editor.getDoc(), 'cut', function(e) {
+				var applyAttributes;
+
+				if (!isDefaultPrevented(e) && isSelectionAcrossElements()) {
+					applyAttributes = getAttributeApplyFunction();
+
+					setTimeout(function() {
+						applyAttributes();
+					}, 0);
+				}
+			});
+		}
+
+		/**
+		 * Screen readers on IE needs to have the role application set on the body.
+		 */
+		function ensureBodyHasRoleApplication() {
+			document.body.setAttribute("role", "application");
+		}
+
+		/**
+		 * Backspacing into a table behaves differently depending upon browser type.
+		 * Therefore, disable Backspace when cursor immediately follows a table.
+		 */
+		function disableBackspaceIntoATable() {
+			editor.on('keydown', function(e) {
+				if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {
+					if (selection.isCollapsed() && selection.getRng(true).startOffset === 0) {
+						var previousSibling = selection.getNode().previousSibling;
+						if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === "table") {
+							e.preventDefault();
+							return false;
+						}
+					}
+				}
+			});
+		}
+
+		/**
+		 * Old IE versions can't properly render BR elements in PRE tags white in contentEditable mode. So this
+		 * logic adds a \n before the BR so that it will get rendered.
+		 */
+		function addNewLinesBeforeBrInPre() {
+			// IE8+ rendering mode does the right thing with BR in PRE
+			if (getDocumentMode() > 7) {
+				return;
+			}
+
+			// Enable display: none in area and add a specific class that hides all BR elements in PRE to
+			// avoid the caret from getting stuck at the BR elements while pressing the right arrow key
+			setEditorCommandState('RespectVisibilityInDesign', true);
+			editor.contentStyles.push('.mceHideBrInPre pre br {display: none}');
+			dom.addClass(editor.getBody(), 'mceHideBrInPre');
+
+			// Adds a \n before all BR elements in PRE to get them visual
+			parser.addNodeFilter('pre', function(nodes) {
+				var i = nodes.length, brNodes, j, brElm, sibling;
+
+				while (i--) {
+					brNodes = nodes[i].getAll('br');
+					j = brNodes.length;
+					while (j--) {
+						brElm = brNodes[j];
+
+						// Add \n before BR in PRE elements on older IE:s so the new lines get rendered
+						sibling = brElm.prev;
+						if (sibling && sibling.type === 3 && sibling.value.charAt(sibling.value - 1) != '\n') {
+							sibling.value += '\n';
+						} else {
+							brElm.parent.insert(new Node('#text', 3), brElm, true).value = '\n';
+						}
+					}
+				}
+			});
+
+			// Removes any \n before BR elements in PRE since other browsers and in contentEditable=false mode they will be visible
+			serializer.addNodeFilter('pre', function(nodes) {
+				var i = nodes.length, brNodes, j, brElm, sibling;
+
+				while (i--) {
+					brNodes = nodes[i].getAll('br');
+					j = brNodes.length;
+					while (j--) {
+						brElm = brNodes[j];
+						sibling = brElm.prev;
+						if (sibling && sibling.type == 3) {
+							sibling.value = sibling.value.replace(/\r?\n$/, '');
+						}
+					}
+				}
+			});
+		}
+
+		/**
+		 * Moves style width/height to attribute width/height when the user resizes an image on IE.
+		 */
+		function removePreSerializedStylesWhenSelectingControls() {
+			dom.bind(editor.getBody(), 'mouseup', function() {
+				var value, node = selection.getNode();
+
+				// Moved styles to attributes on IMG eements
+				if (node.nodeName == 'IMG') {
+					// Convert style width to width attribute
+					if ((value = dom.getStyle(node, 'width'))) {
+						dom.setAttrib(node, 'width', value.replace(/[^0-9%]+/g, ''));
+						dom.setStyle(node, 'width', '');
+					}
+
+					// Convert style height to height attribute
+					if ((value = dom.getStyle(node, 'height'))) {
+						dom.setAttrib(node, 'height', value.replace(/[^0-9%]+/g, ''));
+						dom.setStyle(node, 'height', '');
+					}
+				}
+			});
+		}
+
+		/**
+		 * Removes a blockquote when backspace is pressed at the beginning of it.
+		 *
+		 * For example:
+		 * <blockquote><p>|x</p></blockquote>
+		 *
+		 * Becomes:
+		 * <p>|x</p>
+		 */
+		function removeBlockQuoteOnBackSpace() {
+			// Add block quote deletion handler
+			editor.on('keydown', function(e) {
+				var rng, container, offset, root, parent;
+
+				if (isDefaultPrevented(e) || e.keyCode != VK.BACKSPACE) {
+					return;
+				}
+
+				rng = selection.getRng();
+				container = rng.startContainer;
+				offset = rng.startOffset;
+				root = dom.getRoot();
+				parent = container;
+
+				if (!rng.collapsed || offset !== 0) {
+					return;
+				}
+
+				while (parent && parent.parentNode && parent.parentNode.firstChild == parent && parent.parentNode != root) {
+					parent = parent.parentNode;
+				}
+
+				// Is the cursor at the beginning of a blockquote?
+				if (parent.tagName === 'BLOCKQUOTE') {
+					// Remove the blockquote
+					editor.formatter.toggle('blockquote', null, parent);
+
+					// Move the caret to the beginning of container
+					rng = dom.createRng();
+					rng.setStart(container, 0);
+					rng.setEnd(container, 0);
+					selection.setRng(rng);
+				}
+			});
+		}
+
+		/**
+		 * Sets various Gecko editing options on mouse down and before a execCommand to disable inline table editing that is broken etc.
+		 */
+		function setGeckoEditingOptions() {
+			function setOpts() {
+				editor._refreshContentEditable();
+
+				setEditorCommandState("StyleWithCSS", false);
+				setEditorCommandState("enableInlineTableEditing", false);
+
+				if (!settings.object_resizing) {
+					setEditorCommandState("enableObjectResizing", false);
+				}
+			}
+
+			if (!settings.readonly) {
+				editor.on('BeforeExecCommand MouseDown', setOpts);
+			}
+		}
+
+		/**
+		 * Fixes a gecko link bug, when a link is placed at the end of block elements there is
+		 * no way to move the caret behind the link. This fix adds a bogus br element after the link.
+		 *
+		 * For example this:
+		 * <p><b><a href="#">x</a></b></p>
+		 *
+		 * Becomes this:
+		 * <p><b><a href="#">x</a></b><br></p>
+		 */
+		function addBrAfterLastLinks() {
+			function fixLinks() {
+				each(dom.select('a'), function(node) {
+					var parentNode = node.parentNode, root = dom.getRoot();
+
+					if (parentNode.lastChild === node) {
+						while (parentNode && !dom.isBlock(parentNode)) {
+							if (parentNode.parentNode.lastChild !== parentNode || parentNode === root) {
+								return;
+							}
+
+							parentNode = parentNode.parentNode;
+						}
+
+						dom.add(parentNode, 'br', {'data-mce-bogus': 1});
+					}
+				});
+			}
+
+			editor.on('SetContent ExecCommand', function(e) {
+				if (e.type == "setcontent" || e.command === 'mceInsertLink') {
+					fixLinks();
+				}
+			});
+		}
+
+		/**
+		 * WebKit will produce DIV elements here and there by default. But since TinyMCE uses paragraphs by
+		 * default we want to change that behavior.
+		 */
+		function setDefaultBlockType() {
+			if (settings.forced_root_block) {
+				editor.on('init', function() {
+					setEditorCommandState('DefaultParagraphSeparator', settings.forced_root_block);
+				});
+			}
+		}
+
+		/**
+		 * Removes ghost selections from images/tables on Gecko.
+		 */
+		function removeGhostSelection() {
+			editor.on('Undo Redo SetContent', function(e) {
+				if (!e.initial) {
+					editor.execCommand('mceRepaint');
+				}
+			});
+		}
+
+		/**
+		 * Deletes the selected image on IE instead of navigating to previous page.
+		 */
+		function deleteControlItemOnBackSpace() {
+			editor.on('keydown', function(e) {
+				var rng;
+
+				if (!isDefaultPrevented(e) && e.keyCode == BACKSPACE) {
+					rng = editor.getDoc().selection.createRange();
+					if (rng && rng.item) {
+						e.preventDefault();
+						editor.undoManager.beforeChange();
+						dom.remove(rng.item(0));
+						editor.undoManager.add();
+					}
+				}
+			});
+		}
+
+		/**
+		 * IE10 doesn't properly render block elements with the right height until you add contents to them.
+		 * This fixes that by adding a padding-right to all empty text block elements.
+		 * See: https://connect.microsoft.com/IE/feedback/details/743881
+		 */
+		function renderEmptyBlocksFix() {
+			var emptyBlocksCSS;
+
+			// IE10+
+			if (getDocumentMode() >= 10) {
+				emptyBlocksCSS = '';
+				each('p div h1 h2 h3 h4 h5 h6'.split(' '), function(name, i) {
+					emptyBlocksCSS += (i > 0 ? ',' : '') + name + ':empty';
+				});
+
+				editor.contentStyles.push(emptyBlocksCSS + '{padding-right: 1px !important}');
+			}
+		}
+
+		/**
+		 * Old IE versions can't retain contents within noscript elements so this logic will store the contents
+		 * as a attribute and the insert that value as it's raw text when the DOM is serialized.
+		 */
+		function keepNoScriptContents() {
+			if (getDocumentMode() < 9) {
+				parser.addNodeFilter('noscript', function(nodes) {
+					var i = nodes.length, node, textNode;
+
+					while (i--) {
+						node = nodes[i];
+						textNode = node.firstChild;
+
+						if (textNode) {
+							node.attr('data-mce-innertext', textNode.value);
+						}
+					}
+				});
+
+				serializer.addNodeFilter('noscript', function(nodes) {
+					var i = nodes.length, node, textNode, value;
+
+					while (i--) {
+						node = nodes[i];
+						textNode = nodes[i].firstChild;
+
+						if (textNode) {
+							textNode.value = Entities.decode(textNode.value);
+						} else {
+							// Old IE can't retain noscript value so an attribute is used to store it
+							value = node.attributes.map['data-mce-innertext'];
+							if (value) {
+								node.attr('data-mce-innertext', null);
+								textNode = new Node('#text', 3);
+								textNode.value = value;
+								textNode.raw = true;
+								node.append(textNode);
+							}
+						}
+					}
+				});
+			}
+		}
+
+		/**
+		 * IE has an issue where you can't select/move the caret by clicking outside the body if the document is in standards mode.
+		 */
+		function fixCaretSelectionOfDocumentElementOnIe() {
+			var doc = dom.doc, body = doc.body, started, startRng, htmlElm;
+
+			// Return range from point or null if it failed
+			function rngFromPoint(x, y) {
+				var rng = body.createTextRange();
+
+				try {
+					rng.moveToPoint(x, y);
+				} catch (ex) {
+					// IE sometimes throws and exception, so lets just ignore it
+					rng = null;
+				}
+
+				return rng;
+			}
+
+			// Fires while the selection is changing
+			function selectionChange(e) {
+				var pointRng;
+
+				// Check if the button is down or not
+				if (e.button) {
+					// Create range from mouse position
+					pointRng = rngFromPoint(e.x, e.y);
+
+					if (pointRng) {
+						// Check if pointRange is before/after selection then change the endPoint
+						if (pointRng.compareEndPoints('StartToStart', startRng) > 0) {
+							pointRng.setEndPoint('StartToStart', startRng);
+						} else {
+							pointRng.setEndPoint('EndToEnd', startRng);
+						}
+
+						pointRng.select();
+					}
+				} else {
+					endSelection();
+				}
+			}
+
+			// Removes listeners
+			function endSelection() {
+				var rng = doc.selection.createRange();
+
+				// If the range is collapsed then use the last start range
+				if (startRng && !rng.item && rng.compareEndPoints('StartToEnd', rng) === 0) {
+					startRng.select();
+				}
+
+				dom.unbind(doc, 'mouseup', endSelection);
+				dom.unbind(doc, 'mousemove', selectionChange);
+				startRng = started = 0;
+			}
+
+			// Make HTML element unselectable since we are going to handle selection by hand
+			doc.documentElement.unselectable = true;
+
+			// Detect when user selects outside BODY
+			dom.bind(doc, 'mousedown contextmenu', function(e) {
+				if (e.target.nodeName === 'HTML') {
+					if (started) {
+						endSelection();
+					}
+
+					// Detect vertical scrollbar, since IE will fire a mousedown on the scrollbar and have target set as HTML
+					htmlElm = doc.documentElement;
+					if (htmlElm.scrollHeight > htmlElm.clientHeight) {
+						return;
+					}
+
+					started = 1;
+					// Setup start position
+					startRng = rngFromPoint(e.x, e.y);
+					if (startRng) {
+						// Listen for selection change events
+						dom.bind(doc, 'mouseup', endSelection);
+						dom.bind(doc, 'mousemove', selectionChange);
+
+						dom.getRoot().focus();
+						startRng.select();
+					}
+				}
+			});
+		}
+
+		/**
+		 * Fixes selection issues where the caret can be placed between two inline elements like <b>a</b>|<b>b</b>
+		 * this fix will lean the caret right into the closest inline element.
+		 */
+		function normalizeSelection() {
+			// Normalize selection for example <b>a</b><i>|a</i> becomes <b>a|</b><i>a</i> except for Ctrl+A since it selects everything
+			editor.on('keyup focusin mouseup', function(e) {
+				if (e.keyCode != 65 || !VK.metaKeyPressed(e)) {
+					selection.normalize();
+				}
+			}, true);
+		}
+
+		/**
+		 * Forces Gecko to render a broken image icon if it fails to load an image.
+		 */
+		function showBrokenImageIcon() {
+			editor.contentStyles.push(
+				'img:-moz-broken {' +
+					'-moz-force-broken-image-icon:1;' +
+					'min-width:24px;' +
+					'min-height:24px' +
+				'}'
+			);
+		}
+
+		/**
+		 * iOS has a bug where it's impossible to type if the document has a touchstart event
+		 * bound and the user touches the document while having the on screen keyboard visible.
+		 *
+		 * The touch event moves the focus to the parent document while having the caret inside the iframe
+		 * this fix moves the focus back into the iframe document.
+		 */
+		function restoreFocusOnKeyDown() {
+			if (!editor.inline) {
+				editor.on('keydown', function() {
+					if (document.activeElement == document.body) {
+						editor.getWin().focus();
+					}
+				});
+			}
+		}
+
+		/**
+		 * IE 11 has an annoying issue where you can't move focus into the editor
+		 * by clicking on the white area HTML element. We used to be able to to fix this with
+		 * the fixCaretSelectionOfDocumentElementOnIe fix. But since M$ removed the selection
+		 * object it's not possible anymore. So we need to hack in a ungly CSS to force the
+		 * body to be at least 150px. If the user clicks the HTML element out side this 150px region
+		 * we simply move the focus into the first paragraph. Not ideal since you loose the
+		 * positioning of the caret but goot enough for most cases.
+		 */
+		function bodyHeight() {
+			if (!editor.inline) {
+				editor.contentStyles.push('body {min-height: 150px}');
+				editor.on('click', function(e) {
+					if (e.target.nodeName == 'HTML') {
+						var rng;
+
+						// Need to store away non collapsed ranges since the focus call will mess that up see #7382
+						rng = editor.selection.getRng();
+						editor.getBody().focus();
+						editor.selection.setRng(rng);
+						editor.selection.normalize();
+						editor.nodeChanged();
+					}
+				});
+			}
+		}
+
+		/**
+		 * Firefox on Mac OS will move the browser back to the previous page if you press CMD+Left arrow.
+		 * You might then loose all your work so we need to block that behavior and replace it with our own.
+		 */
+		function blockCmdArrowNavigation() {
+			if (Env.mac) {
+				editor.on('keydown', function(e) {
+					if (VK.metaKeyPressed(e) && (e.keyCode == 37 || e.keyCode == 39)) {
+						e.preventDefault();
+						editor.selection.getSel().modify('move', e.keyCode == 37 ? 'backward' : 'forward', 'lineboundary');
+					}
+				});
+			}
+		}
+
+		/**
+		 * Disables the autolinking in IE 9+ this is then re-enabled by the autolink plugin.
+		 */
+		function disableAutoUrlDetect() {
+			setEditorCommandState("AutoUrlDetect", false);
+		}
+
+		/**
+		 * IE 11 has a fantastic bug where it will produce two trailing BR elements to iframe bodies when
+		 * the iframe is hidden by display: none on a parent container. The DOM is actually out of sync
+		 * with innerHTML in this case. It's like IE adds shadow DOM BR elements that appears on innerHTML
+		 * but not as the lastChild of the body. However is we add a BR element to the body then remove it
+		 * it doesn't seem to add these BR elements makes sence right?!
+		 *
+		 * Example of what happens: <body>text</body> becomes <body>text<br><br></body>
+		 */
+		function doubleTrailingBrElements() {
+			if (!editor.inline) {
+				editor.on('focus blur beforegetcontent', function() {
+					var br = editor.dom.create('br');
+					editor.getBody().appendChild(br);
+					br.parentNode.removeChild(br);
+				}, true);
+			}
+		}
+
+		/**
+		 * iOS 7.1 introduced two new bugs:
+		 * 1) It's possible to open links within a contentEditable area by clicking on them.
+		 * 2) If you hold down the finger it will display the link/image touch callout menu.
+		 */
+		function tapLinksAndImages() {
+			editor.on('click', function(e) {
+				var elm = e.target;
+
+				do {
+					if (elm.tagName === 'A') {
+						e.preventDefault();
+						return;
+					}
+				} while ((elm = elm.parentNode));
+			});
+
+			editor.contentStyles.push('.mce-content-body {-webkit-touch-callout: none}');
+		}
+
+		/**
+		 * iOS Safari and possible other browsers have a bug where it won't fire
+		 * a click event when a contentEditable is focused. This function fakes click events
+		 * by using touchstart/touchend and measuring the time and distance travelled.
+		 */
+		function touchClickEvent() {
+			editor.on('touchstart', function(e) {
+				var elm, time, startTouch, changedTouches;
+
+				elm = e.target;
+				time = new Date().getTime();
+				changedTouches = e.changedTouches;
+
+				if (!changedTouches || changedTouches.length > 1) {
+					return;
+				}
+
+				startTouch = changedTouches[0];
+
+				editor.once('touchend', function(e) {
+					var endTouch = e.changedTouches[0], args;
+
+					if (new Date().getTime() - time > 500) {
+						return;
+					}
+
+					if (Math.abs(startTouch.clientX - endTouch.clientX) > 5) {
+						return;
+					}
+
+					if (Math.abs(startTouch.clientY - endTouch.clientY) > 5) {
+						return;
+					}
+
+					args = {
+						target: elm
+					};
+
+					each('pageX pageY clientX clientY screenX screenY'.split(' '), function(key) {
+						args[key] = endTouch[key];
+					});
+
+					args = editor.fire('click', args);
+
+					if (!args.isDefaultPrevented()) {
+						// iOS WebKit can't place the caret properly once
+						// you bind touch events so we need to do this manually
+						// TODO: Expand to the closest word? Touble tap still works.
+						editor.selection.placeCaretAt(endTouch.clientX, endTouch.clientY);
+						editor.nodeChanged();
+					}
+				});
+			});
+		}
+
+		/**
+		 * WebKit has a bug where it will allow forms to be submitted if they are inside a contentEditable element.
+		 * For example this: <form><button></form>
+		 */
+		function blockFormSubmitInsideEditor() {
+			editor.on('init', function() {
+				editor.dom.bind(editor.getBody(), 'submit', function(e) {
+					e.preventDefault();
+				});
+			});
+		}
+
+		/**
+		 * Sometimes WebKit/Blink generates BR elements with the Apple-interchange-newline class.
+		 *
+		 * Scenario:
+		 *  1) Create a table 2x2.
+		 *  2) Select and copy cells A2-B2.
+		 *  3) Paste and it will add BR element to table cell.
+		 */
+		function removeAppleInterchangeBrs() {
+			parser.addNodeFilter('br', function(nodes) {
+				var i = nodes.length;
+
+				while (i--) {
+					if (nodes[i].attr('class') == 'Apple-interchange-newline') {
+						nodes[i].remove();
+					}
+				}
+			});
+		}
+
+		/**
+		 * IE cannot set custom contentType's on drag events, and also does not properly drag/drop between
+		 * editors. This uses a special data:text/mce-internal URL to pass data when drag/drop between editors.
+		 */
+		function ieInternalDragAndDrop() {
+			editor.on('dragstart', function(e) {
+				setMceInteralContent(e);
+			});
+
+			editor.on('drop', function(e) {
+				if (!isDefaultPrevented(e)) {
+					var internalContent = getMceInternalContent(e);
+					if (internalContent) {
+						e.preventDefault();
+
+						var rng = RangeUtils.getCaretRangeFromPoint(e.x, e.y, editor.getDoc());
+						selection.setRng(rng);
+						insertClipboardContents(internalContent);
+					}
+				}
+			});
+		}
+
+		// All browsers
+		removeBlockQuoteOnBackSpace();
+		emptyEditorWhenDeleting();
+		normalizeSelection();
+
+		// WebKit
+		if (isWebKit) {
+			cleanupStylesWhenDeleting();
+			inputMethodFocus();
+			selectControlElements();
+			setDefaultBlockType();
+			blockFormSubmitInsideEditor();
+			disableBackspaceIntoATable();
+			removeAppleInterchangeBrs();
+			touchClickEvent();
+
+			// iOS
+			if (Env.iOS) {
+				restoreFocusOnKeyDown();
+				bodyHeight();
+				tapLinksAndImages();
+			} else {
+				selectAll();
+			}
+		}
+
+		// IE
+		if (isIE && Env.ie < 11) {
+			removeHrOnBackspace();
+			ensureBodyHasRoleApplication();
+			addNewLinesBeforeBrInPre();
+			removePreSerializedStylesWhenSelectingControls();
+			deleteControlItemOnBackSpace();
+			renderEmptyBlocksFix();
+			keepNoScriptContents();
+			fixCaretSelectionOfDocumentElementOnIe();
+		}
+
+		if (Env.ie >= 11) {
+			bodyHeight();
+			doubleTrailingBrElements();
+			disableBackspaceIntoATable();
+		}
+
+		if (Env.ie) {
+			selectAll();
+			disableAutoUrlDetect();
+			ieInternalDragAndDrop();
+		}
+
+		// Gecko
+		if (isGecko) {
+			removeHrOnBackspace();
+			focusBody();
+			removeStylesWhenDeletingAcrossBlockElements();
+			setGeckoEditingOptions();
+			addBrAfterLastLinks();
+			removeGhostSelection();
+			showBrokenImageIcon();
+			blockCmdArrowNavigation();
+			disableBackspaceIntoATable();
+		}
+	};
+});
+
+// Included from: js/tinymce/classes/util/Observable.js
+
+/**
+ * Observable.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This mixin will add event binding logic to classes.
+ *
+ * @mixin tinymce.util.Observable
+ */
+define("tinymce/util/Observable", [
+	"tinymce/util/EventDispatcher"
+], function(EventDispatcher) {
+	function getEventDispatcher(obj) {
+		if (!obj._eventDispatcher) {
+			obj._eventDispatcher = new EventDispatcher({
+				scope: obj,
+				toggleEvent: function(name, state) {
+					if (EventDispatcher.isNative(name) && obj.toggleNativeEvent) {
+						obj.toggleNativeEvent(name, state);
+					}
+				}
+			});
+		}
+
+		return obj._eventDispatcher;
+	}
+
+	return {
+		/**
+		 * Fires the specified event by name.
+		 *
+		 * @method fire
+		 * @param {String} name Name of the event to fire.
+		 * @param {Object?} args Event arguments.
+		 * @param {Boolean?} bubble True/false if the event is to be bubbled.
+		 * @return {Object} Event args instance passed in.
+		 * @example
+		 * instance.fire('event', {...});
+		 */
+		fire: function(name, args, bubble) {
+			var self = this;
+
+			// Prevent all events except the remove event after the instance has been removed
+			if (self.removed && name !== "remove") {
+				return args;
+			}
+
+			args = getEventDispatcher(self).fire(name, args, bubble);
+
+			// Bubble event up to parents
+			if (bubble !== false && self.parent) {
+				var parent = self.parent();
+				while (parent && !args.isPropagationStopped()) {
+					parent.fire(name, args, false);
+					parent = parent.parent();
+				}
+			}
+
+			return args;
+		},
+
+		/**
+		 * Binds an event listener to a specific event by name.
+		 *
+		 * @method on
+		 * @param {String} name Event name or space separated list of events to bind.
+		 * @param {callback} callback Callback to be executed when the event occurs.
+		 * @param {Boolean} first Optional flag if the event should be prepended. Use this with care.
+		 * @return {Object} Current class instance.
+		 * @example
+		 * instance.on('event', function(e) {
+		 *     // Callback logic
+		 * });
+		 */
+		on: function(name, callback, prepend) {
+			return getEventDispatcher(this).on(name, callback, prepend);
+		},
+
+		/**
+		 * Unbinds an event listener to a specific event by name.
+		 *
+		 * @method off
+		 * @param {String?} name Name of the event to unbind.
+		 * @param {callback?} callback Callback to unbind.
+		 * @return {Object} Current class instance.
+		 * @example
+		 * // Unbind specific callback
+		 * instance.off('event', handler);
+		 *
+		 * // Unbind all listeners by name
+		 * instance.off('event');
+		 *
+		 * // Unbind all events
+		 * instance.off();
+		 */
+		off: function(name, callback) {
+			return getEventDispatcher(this).off(name, callback);
+		},
+
+		/**
+		 * Bind the event callback and once it fires the callback is removed.
+		 *
+		 * @method once
+		 * @param {String} name Name of the event to bind.
+		 * @param {callback} callback Callback to bind only once.
+		 * @return {Object} Current class instance.
+		 */
+		once: function(name, callback) {
+			return getEventDispatcher(this).once(name, callback);
+		},
+
+		/**
+		 * Returns true/false if the object has a event of the specified name.
+		 *
+		 * @method hasEventListeners
+		 * @param {String} name Name of the event to check for.
+		 * @return {Boolean} true/false if the event exists or not.
+		 */
+		hasEventListeners: function(name) {
+			return getEventDispatcher(this).has(name);
+		}
+	};
+});
+
+// Included from: js/tinymce/classes/EditorObservable.js
+
+/**
+ * EditorObservable.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This mixin contains the event logic for the tinymce.Editor class.
+ *
+ * @mixin tinymce.EditorObservable
+ * @extends tinymce.util.Observable
+ */
+define("tinymce/EditorObservable", [
+	"tinymce/util/Observable",
+	"tinymce/dom/DOMUtils",
+	"tinymce/util/Tools"
+], function(Observable, DOMUtils, Tools) {
+	var DOM = DOMUtils.DOM, customEventRootDelegates;
+
+	/**
+	 * Returns the event target so for the specified event. Some events fire
+	 * only on document, some fire on documentElement etc. This also handles the
+	 * custom event root setting where it returns that element instead of the body.
+	 *
+	 * @private
+	 * @param {tinymce.Editor} editor Editor instance to get event target from.
+	 * @param {String} eventName Name of the event for example "click".
+	 * @return {Element/Document} HTML Element or document target to bind on.
+	 */
+	function getEventTarget(editor, eventName) {
+		if (eventName == 'selectionchange') {
+			return editor.getDoc();
+		}
+
+		// Need to bind mousedown/mouseup etc to document not body in iframe mode
+		// Since the user might click on the HTML element not the BODY
+		if (!editor.inline && /^mouse|click|contextmenu|drop|dragover|dragend/.test(eventName)) {
+			return editor.getDoc().documentElement;
+		}
+
+		// Bind to event root instead of body if it's defined
+		if (editor.settings.event_root) {
+			if (!editor.eventRoot) {
+				editor.eventRoot = DOM.select(editor.settings.event_root)[0];
+			}
+
+			return editor.eventRoot;
+		}
+
+		return editor.getBody();
+	}
+
+	/**
+	 * Binds a event delegate for the specified name this delegate will fire
+	 * the event to the editor dispatcher.
+	 *
+	 * @private
+	 * @param {tinymce.Editor} editor Editor instance to get event target from.
+	 * @param {String} eventName Name of the event for example "click".
+	 */
+	function bindEventDelegate(editor, eventName) {
+		var eventRootElm = getEventTarget(editor, eventName), delegate;
+
+		if (!editor.delegates) {
+			editor.delegates = {};
+		}
+
+		if (editor.delegates[eventName]) {
+			return;
+		}
+
+		if (editor.settings.event_root) {
+			if (!customEventRootDelegates) {
+				customEventRootDelegates = {};
+				editor.editorManager.on('removeEditor', function() {
+					var name;
+
+					if (!editor.editorManager.activeEditor) {
+						if (customEventRootDelegates) {
+							for (name in customEventRootDelegates) {
+								editor.dom.unbind(getEventTarget(editor, name));
+							}
+
+							customEventRootDelegates = null;
+						}
+					}
+				});
+			}
+
+			if (customEventRootDelegates[eventName]) {
+				return;
+			}
+
+			delegate = function(e) {
+				var target = e.target, editors = editor.editorManager.editors, i = editors.length;
+
+				while (i--) {
+					var body = editors[i].getBody();
+
+					if (body === target || DOM.isChildOf(target, body)) {
+						if (!editors[i].hidden) {
+							editors[i].fire(eventName, e);
+						}
+					}
+				}
+			};
+
+			customEventRootDelegates[eventName] = delegate;
+			DOM.bind(eventRootElm, eventName, delegate);
+		} else {
+			delegate = function(e) {
+				if (!editor.hidden) {
+					editor.fire(eventName, e);
+				}
+			};
+
+			DOM.bind(eventRootElm, eventName, delegate);
+			editor.delegates[eventName] = delegate;
+		}
+	}
+
+	var EditorObservable = {
+		/**
+		 * Bind any pending event delegates. This gets executed after the target body/document is created.
+		 *
+		 * @private
+		 */
+		bindPendingEventDelegates: function() {
+			var self = this;
+
+			Tools.each(self._pendingNativeEvents, function(name) {
+				bindEventDelegate(self, name);
+			});
+		},
+
+		/**
+		 * Toggles a native event on/off this is called by the EventDispatcher when
+		 * the first native event handler is added and when the last native event handler is removed.
+		 *
+		 * @private
+		 */
+		toggleNativeEvent: function(name, state) {
+			var self = this;
+
+			if (self.settings.readonly) {
+				return;
+			}
+
+			// Never bind focus/blur since the FocusManager fakes those
+			if (name == "focus" || name == "blur") {
+				return;
+			}
+
+			if (state) {
+				if (self.initialized) {
+					bindEventDelegate(self, name);
+				} else {
+					if (!self._pendingNativeEvents) {
+						self._pendingNativeEvents = [name];
+					} else {
+						self._pendingNativeEvents.push(name);
+					}
+				}
+			} else if (self.initialized) {
+				self.dom.unbind(getEventTarget(self, name), name, self.delegates[name]);
+				delete self.delegates[name];
+			}
+		},
+
+		/**
+		 * Unbinds all native event handlers that means delegates, custom events bound using the Events API etc.
+		 *
+		 * @private
+		 */
+		unbindAllNativeEvents: function() {
+			var self = this, name;
+
+			if (self.delegates) {
+				for (name in self.delegates) {
+					self.dom.unbind(getEventTarget(self, name), name, self.delegates[name]);
+				}
+
+				delete self.delegates;
+			}
+
+			if (!self.inline) {
+				self.getBody().onload = null;
+				self.dom.unbind(self.getWin());
+				self.dom.unbind(self.getDoc());
+			}
+
+			self.dom.unbind(self.getBody());
+			self.dom.unbind(self.getContainer());
+		}
+	};
+
+	EditorObservable = Tools.extend({}, Observable, EditorObservable);
+
+	return EditorObservable;
+});
+
+// Included from: js/tinymce/classes/Shortcuts.js
+
+/**
+ * Shortcuts.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Contains all logic for handling of keyboard shortcuts.
+ *
+ * @example
+ * editor.shortcuts.add('ctrl+a', function() {});
+ * editor.shortcuts.add('meta+a', function() {}); // "meta" maps to Command on Mac and Ctrl on PC
+ * editor.shortcuts.add('ctrl+alt+a', function() {});
+ * editor.shortcuts.add('access+a', function() {}); // "access" maps to ctrl+alt on Mac and shift+alt on PC
+ */
+define("tinymce/Shortcuts", [
+	"tinymce/util/Tools",
+	"tinymce/Env"
+], function(Tools, Env) {
+	var each = Tools.each, explode = Tools.explode;
+
+	var keyCodeLookup = {
+		"f9": 120,
+		"f10": 121,
+		"f11": 122
+	};
+
+	var modifierNames = Tools.makeMap('alt,ctrl,shift,meta,access');
+
+	return function(editor) {
+		var self = this, shortcuts = {};
+
+		function createShortcut(pattern, desc, cmdFunc, scope) {
+			var id, key, shortcut;
+
+			shortcut = {
+				func: cmdFunc,
+				scope: scope || editor,
+				desc: editor.translate(desc)
+			};
+
+			// Parse modifiers and keys ctrl+alt+b for example
+			each(explode(pattern, '+'), function(value) {
+				if (value in modifierNames) {
+					shortcut[value] = true;
+				} else {
+					// Allow numeric keycodes like ctrl+219 for ctrl+[
+					if (/^[0-9]{2,}$/.test(value)) {
+						shortcut.keyCode = parseInt(value, 10);
+					} else {
+						shortcut.charCode = value.charCodeAt(0);
+						shortcut.keyCode = keyCodeLookup[value] || value.toUpperCase().charCodeAt(0);
+					}
+				}
+			});
+
+			// Generate unique id for modifier combination and set default state for unused modifiers
+			id = [shortcut.keyCode];
+			for (key in modifierNames) {
+				if (shortcut[key]) {
+					id.push(key);
+				} else {
+					shortcut[key] = false;
+				}
+			}
+			shortcut.id = id.join(',');
+
+			// Handle special access modifier differently depending on Mac/Win
+			if (shortcut.access) {
+				shortcut.alt = true;
+
+				if (Env.mac) {
+					shortcut.ctrl = true;
+				} else {
+					shortcut.shift = true;
+				}
+			}
+
+			// Handle special meta modifier differently depending on Mac/Win
+			if (shortcut.meta) {
+				if (Env.mac) {
+					shortcut.meta = true;
+				} else {
+					shortcut.ctrl = true;
+					shortcut.meta = false;
+				}
+			}
+
+			return shortcut;
+		}
+
+		editor.on('keyup keypress keydown', function(e) {
+			if ((e.altKey || e.ctrlKey || e.metaKey) && !e.isDefaultPrevented()) {
+				each(shortcuts, function(shortcut) {
+					if (shortcut.ctrl != e.ctrlKey || shortcut.meta != e.metaKey) {
+						return;
+					}
+
+					if (shortcut.alt != e.altKey || shortcut.shift != e.shiftKey) {
+						return;
+					}
+
+					if (e.keyCode == shortcut.keyCode || (e.charCode && e.charCode == shortcut.charCode)) {
+						e.preventDefault();
+
+						if (e.type == "keydown") {
+							shortcut.func.call(shortcut.scope);
+						}
+
+						return true;
+					}
+				});
+			}
+		});
+
+		/**
+		 * Adds a keyboard shortcut for some command or function.
+		 *
+		 * @method addShortcut
+		 * @param {String} pattern Shortcut pattern. Like for example: ctrl+alt+o.
+		 * @param {String} desc Text description for the command.
+		 * @param {String/Function} cmdFunc Command name string or function to execute when the key is pressed.
+		 * @param {Object} sc Optional scope to execute the function in.
+		 * @return {Boolean} true/false state if the shortcut was added or not.
+		 */
+		self.add = function(pattern, desc, cmdFunc, scope) {
+			var cmd;
+
+			cmd = cmdFunc;
+
+			if (typeof cmdFunc === 'string') {
+				cmdFunc = function() {
+					editor.execCommand(cmd, false, null);
+				};
+			} else if (Tools.isArray(cmd)) {
+				cmdFunc = function() {
+					editor.execCommand(cmd[0], cmd[1], cmd[2]);
+				};
+			}
+
+			each(explode(pattern.toLowerCase()), function(pattern) {
+				var shortcut = createShortcut(pattern, desc, cmdFunc, scope);
+				shortcuts[shortcut.id] = shortcut;
+			});
+
+			return true;
+		};
+
+		/**
+		 * Remove a keyboard shortcut by pattern.
+		 *
+		 * @method remove
+		 * @param {String} pattern Shortcut pattern. Like for example: ctrl+alt+o.
+		 * @return {Boolean} true/false state if the shortcut was removed or not.
+		 */
+		self.remove = function(pattern) {
+			var shortcut = createShortcut(pattern);
+
+			if (shortcuts[shortcut.id]) {
+				delete shortcuts[shortcut.id];
+				return true;
+			}
+
+			return false;
+		};
+	};
+});
+
+// Included from: js/tinymce/classes/Editor.js
+
+/**
+ * Editor.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*jshint scripturl:true */
+
+/**
+ * Include the base event class documentation.
+ *
+ * @include ../../../tools/docs/tinymce.Event.js
+ */
+
+/**
+ * This class contains the core logic for a TinyMCE editor.
+ *
+ * @class tinymce.Editor
+ * @mixes tinymce.util.Observable
+ * @example
+ * // Add a class to all paragraphs in the editor.
+ * tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('p'), 'someclass');
+ *
+ * // Gets the current editors selection as text
+ * tinymce.activeEditor.selection.getContent({format: 'text'});
+ *
+ * // Creates a new editor instance
+ * var ed = new tinymce.Editor('textareaid', {
+ *     some_setting: 1
+ * }, tinymce.EditorManager);
+ *
+ * // Select each item the user clicks on
+ * ed.on('click', function(e) {
+ *     ed.selection.select(e.target);
+ * });
+ *
+ * ed.render();
+ */
+define("tinymce/Editor", [
+	"tinymce/dom/DOMUtils",
+	"tinymce/dom/DomQuery",
+	"tinymce/AddOnManager",
+	"tinymce/NodeChange",
+	"tinymce/html/Node",
+	"tinymce/dom/Serializer",
+	"tinymce/html/Serializer",
+	"tinymce/dom/Selection",
+	"tinymce/Formatter",
+	"tinymce/UndoManager",
+	"tinymce/EnterKey",
+	"tinymce/ForceBlocks",
+	"tinymce/EditorCommands",
+	"tinymce/util/URI",
+	"tinymce/dom/ScriptLoader",
+	"tinymce/dom/EventUtils",
+	"tinymce/WindowManager",
+	"tinymce/html/Schema",
+	"tinymce/html/DomParser",
+	"tinymce/util/Quirks",
+	"tinymce/Env",
+	"tinymce/util/Tools",
+	"tinymce/EditorObservable",
+	"tinymce/Shortcuts"
+], function(
+	DOMUtils, DomQuery, AddOnManager, NodeChange, Node, DomSerializer, Serializer,
+	Selection, Formatter, UndoManager, EnterKey, ForceBlocks, EditorCommands,
+	URI, ScriptLoader, EventUtils, WindowManager,
+	Schema, DomParser, Quirks, Env, Tools, EditorObservable, Shortcuts
+) {
+	// Shorten these names
+	var DOM = DOMUtils.DOM, ThemeManager = AddOnManager.ThemeManager, PluginManager = AddOnManager.PluginManager;
+	var extend = Tools.extend, each = Tools.each, explode = Tools.explode;
+	var inArray = Tools.inArray, trim = Tools.trim, resolve = Tools.resolve;
+	var Event = EventUtils.Event;
+	var isGecko = Env.gecko, ie = Env.ie;
+
+	/**
+	 * Include documentation for all the events.
+	 *
+	 * @include ../../../tools/docs/tinymce.Editor.js
+	 */
+
+	/**
+	 * Constructs a editor instance by id.
+	 *
+	 * @constructor
+	 * @method Editor
+	 * @param {String} id Unique id for the editor.
+	 * @param {Object} settings Settings for the editor.
+	 * @param {tinymce.EditorManager} editorManager EditorManager instance.
+	 * @author Moxiecode
+	 */
+	function Editor(id, settings, editorManager) {
+		var self = this, documentBaseUrl, baseUri;
+
+		documentBaseUrl = self.documentBaseUrl = editorManager.documentBaseURL;
+		baseUri = editorManager.baseURI;
+
+		/**
+		 * Name/value collection with editor settings.
+		 *
+		 * @property settings
+		 * @type Object
+		 * @example
+		 * // Get the value of the theme setting
+		 * tinymce.activeEditor.windowManager.alert("You are using the " + tinymce.activeEditor.settings.theme + " theme");
+		 */
+		self.settings = settings = extend({
+			id: id,
+			theme: 'modern',
+			delta_width: 0,
+			delta_height: 0,
+			popup_css: '',
+			plugins: '',
+			document_base_url: documentBaseUrl,
+			add_form_submit_trigger: true,
+			submit_patch: true,
+			add_unload_trigger: true,
+			convert_urls: true,
+			relative_urls: true,
+			remove_script_host: true,
+			object_resizing: true,
+			doctype: '<!DOCTYPE html>',
+			visual: true,
+			font_size_style_values: 'xx-small,x-small,small,medium,large,x-large,xx-large',
+
+			// See: http://www.w3.org/TR/CSS2/fonts.html#propdef-font-size
+			font_size_legacy_values: 'xx-small,small,medium,large,x-large,xx-large,300%',
+			forced_root_block: 'p',
+			hidden_input: true,
+			padd_empty_editor: true,
+			render_ui: true,
+			indentation: '30px',
+			inline_styles: true,
+			convert_fonts_to_spans: true,
+			indent: 'simple',
+			indent_before: 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,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,th,ul,ol,li,dl,dt,dd,area,table,thead,' +
+				'tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist',
+			validate: true,
+			entity_encoding: 'named',
+			url_converter: self.convertURL,
+			url_converter_scope: self,
+			ie7_compat: true
+		}, settings);
+
+		AddOnManager.language = settings.language || 'en';
+		AddOnManager.languageLoad = settings.language_load;
+
+		AddOnManager.baseURL = editorManager.baseURL;
+
+		/**
+		 * Editor instance id, normally the same as the div/textarea that was replaced.
+		 *
+		 * @property id
+		 * @type String
+		 */
+		self.id = settings.id = id;
+
+		/**
+		 * State to force the editor to return false on a isDirty call.
+		 *
+		 * @property isNotDirty
+		 * @type Boolean
+		 * @example
+		 * function ajaxSave() {
+		 *     var ed = tinymce.get('elm1');
+		 *
+		 *     // Save contents using some XHR call
+		 *     alert(ed.getContent());
+		 *
+		 *     ed.isNotDirty = true; // Force not dirty state
+		 * }
+		 */
+		self.isNotDirty = true;
+
+		/**
+		 * Name/Value object containting plugin instances.
+		 *
+		 * @property plugins
+		 * @type Object
+		 * @example
+		 * // Execute a method inside a plugin directly
+		 * tinymce.activeEditor.plugins.someplugin.someMethod();
+		 */
+		self.plugins = {};
+
+		/**
+		 * URI object to document configured for the TinyMCE instance.
+		 *
+		 * @property documentBaseURI
+		 * @type tinymce.util.URI
+		 * @example
+		 * // Get relative URL from the location of document_base_url
+		 * tinymce.activeEditor.documentBaseURI.toRelative('/somedir/somefile.htm');
+		 *
+		 * // Get absolute URL from the location of document_base_url
+		 * tinymce.activeEditor.documentBaseURI.toAbsolute('somefile.htm');
+		 */
+		self.documentBaseURI = new URI(settings.document_base_url || documentBaseUrl, {
+			base_uri: baseUri
+		});
+
+		/**
+		 * URI object to current document that holds the TinyMCE editor instance.
+		 *
+		 * @property baseURI
+		 * @type tinymce.util.URI
+		 * @example
+		 * // Get relative URL from the location of the API
+		 * tinymce.activeEditor.baseURI.toRelative('/somedir/somefile.htm');
+		 *
+		 * // Get absolute URL from the location of the API
+		 * tinymce.activeEditor.baseURI.toAbsolute('somefile.htm');
+		 */
+		self.baseURI = baseUri;
+
+		/**
+		 * Array with CSS files to load into the iframe.
+		 *
+		 * @property contentCSS
+		 * @type Array
+		 */
+		self.contentCSS = [];
+
+		/**
+		 * Array of CSS styles to add to head of document when the editor loads.
+		 *
+		 * @property contentStyles
+		 * @type Array
+		 */
+		self.contentStyles = [];
+
+		// Creates all events like onClick, onSetContent etc see Editor.Events.js for the actual logic
+		self.shortcuts = new Shortcuts(self);
+		self.loadedCSS = {};
+		self.editorCommands = new EditorCommands(self);
+
+		if (settings.target) {
+			self.targetElm = settings.target;
+		}
+
+		self.suffix = editorManager.suffix;
+		self.editorManager = editorManager;
+		self.inline = settings.inline;
+
+		if (settings.cache_suffix) {
+			Env.cacheSuffix = settings.cache_suffix.replace(/^[\?\&]+/, '');
+		}
+
+		// Call setup
+		editorManager.fire('SetupEditor', self);
+		self.execCallback('setup', self);
+
+		/**
+		 * Dom query instance with default scope to the editor document and default element is the body of the editor.
+		 *
+		 * @property $
+		 * @type tinymce.dom.DomQuery
+		 * @example
+		 * tinymce.activeEditor.$('p').css('color', 'red');
+		 * tinymce.activeEditor.$().append('<p>new</p>');
+		 */
+		self.$ = DomQuery.overrideDefaults(function() {
+			return {
+				context: self.inline ? self.getBody() : self.getDoc(),
+				element: self.getBody()
+			};
+		});
+	}
+
+	Editor.prototype = {
+		/**
+		 * Renderes the editor/adds it to the page.
+		 *
+		 * @method render
+		 */
+		render: function() {
+			var self = this, settings = self.settings, id = self.id, suffix = self.suffix;
+
+			function readyHandler() {
+				DOM.unbind(window, 'ready', readyHandler);
+				self.render();
+			}
+
+			// Page is not loaded yet, wait for it
+			if (!Event.domLoaded) {
+				DOM.bind(window, 'ready', readyHandler);
+				return;
+			}
+
+			// Element not found, then skip initialization
+			if (!self.getElement()) {
+				return;
+			}
+
+			// No editable support old iOS versions etc
+			if (!Env.contentEditable) {
+				return;
+			}
+
+			// Hide target element early to prevent content flashing
+			if (!settings.inline) {
+				self.orgVisibility = self.getElement().style.visibility;
+				self.getElement().style.visibility = 'hidden';
+			} else {
+				self.inline = true;
+			}
+
+			var form = self.getElement().form || DOM.getParent(id, 'form');
+			if (form) {
+				self.formElement = form;
+
+				// Add hidden input for non input elements inside form elements
+				if (settings.hidden_input && !/TEXTAREA|INPUT/i.test(self.getElement().nodeName)) {
+					DOM.insertAfter(DOM.create('input', {type: 'hidden', name: id}), id);
+					self.hasHiddenInput = true;
+				}
+
+				// Pass submit/reset from form to editor instance
+				self.formEventDelegate = function(e) {
+					self.fire(e.type, e);
+				};
+
+				DOM.bind(form, 'submit reset', self.formEventDelegate);
+
+				// Reset contents in editor when the form is reset
+				self.on('reset', function() {
+					self.setContent(self.startContent, {format: 'raw'});
+				});
+
+				// Check page uses id="submit" or name="submit" for it's submit button
+				if (settings.submit_patch && !form.submit.nodeType && !form.submit.length && !form._mceOldSubmit) {
+					form._mceOldSubmit = form.submit;
+					form.submit = function() {
+						self.editorManager.triggerSave();
+						self.isNotDirty = true;
+
+						return form._mceOldSubmit(form);
+					};
+				}
+			}
+
+			/**
+			 * Window manager reference, use this to open new windows and dialogs.
+			 *
+			 * @property windowManager
+			 * @type tinymce.WindowManager
+			 * @example
+			 * // Shows an alert message
+			 * tinymce.activeEditor.windowManager.alert('Hello world!');
+			 *
+			 * // Opens a new dialog with the file.htm file and the size 320x240
+			 * // It also adds a custom parameter this can be retrieved by using tinyMCEPopup.getWindowArg inside the dialog.
+			 * tinymce.activeEditor.windowManager.open({
+			 *    url: 'file.htm',
+			 *    width: 320,
+			 *    height: 240
+			 * }, {
+			 *    custom_param: 1
+			 * });
+			 */
+			self.windowManager = new WindowManager(self);
+
+			if (settings.encoding == 'xml') {
+				self.on('GetContent', function(e) {
+					if (e.save) {
+						e.content = DOM.encode(e.content);
+					}
+				});
+			}
+
+			if (settings.add_form_submit_trigger) {
+				self.on('submit', function() {
+					if (self.initialized) {
+						self.save();
+					}
+				});
+			}
+
+			if (settings.add_unload_trigger) {
+				self._beforeUnload = function() {
+					if (self.initialized && !self.destroyed && !self.isHidden()) {
+						self.save({format: 'raw', no_events: true, set_dirty: false});
+					}
+				};
+
+				self.editorManager.on('BeforeUnload', self._beforeUnload);
+			}
+
+			// Load scripts
+			function loadScripts() {
+				var scriptLoader = ScriptLoader.ScriptLoader;
+
+				if (settings.language && settings.language != 'en' && !settings.language_url) {
+					settings.language_url = self.editorManager.baseURL + '/langs/' + settings.language + '.js';
+				}
+
+				if (settings.language_url) {
+					scriptLoader.add(settings.language_url);
+				}
+
+				if (settings.theme && typeof settings.theme != "function" &&
+					settings.theme.charAt(0) != '-' && !ThemeManager.urls[settings.theme]) {
+					var themeUrl = settings.theme_url;
+
+					if (themeUrl) {
+						themeUrl = self.documentBaseURI.toAbsolute(themeUrl);
+					} else {
+						themeUrl = 'themes/' + settings.theme + '/theme' + suffix + '.js';
+					}
+
+					ThemeManager.load(settings.theme, themeUrl);
+				}
+
+				if (Tools.isArray(settings.plugins)) {
+					settings.plugins = settings.plugins.join(' ');
+				}
+
+				each(settings.external_plugins, function(url, name) {
+					PluginManager.load(name, url);
+					settings.plugins += ' ' + name;
+				});
+
+				each(settings.plugins.split(/[ ,]/), function(plugin) {
+					plugin = trim(plugin);
+
+					if (plugin && !PluginManager.urls[plugin]) {
+						if (plugin.charAt(0) == '-') {
+							plugin = plugin.substr(1, plugin.length);
+
+							var dependencies = PluginManager.dependencies(plugin);
+
+							each(dependencies, function(dep) {
+								var defaultSettings = {
+									prefix: 'plugins/',
+									resource: dep,
+									suffix: '/plugin' + suffix + '.js'
+								};
+
+								dep = PluginManager.createUrl(defaultSettings, dep);
+								PluginManager.load(dep.resource, dep);
+							});
+						} else {
+							PluginManager.load(plugin, {
+								prefix: 'plugins/',
+								resource: plugin,
+								suffix: '/plugin' + suffix + '.js'
+							});
+						}
+					}
+				});
+
+				scriptLoader.loadQueue(function() {
+					if (!self.removed) {
+						self.init();
+					}
+				});
+			}
+
+			loadScripts();
+		},
+
+		/**
+		 * Initializes the editor this will be called automatically when
+		 * all plugins/themes and language packs are loaded by the rendered method.
+		 * This method will setup the iframe and create the theme and plugin instances.
+		 *
+		 * @method init
+		 */
+		init: function() {
+			var self = this, settings = self.settings, elm = self.getElement();
+			var w, h, minHeight, n, o, Theme, url, bodyId, bodyClass, re, i, initializedPlugins = [];
+
+			this.editorManager.i18n.setCode(settings.language);
+			self.rtl = this.editorManager.i18n.rtl;
+			self.editorManager.add(self);
+
+			settings.aria_label = settings.aria_label || DOM.getAttrib(elm, 'aria-label', self.getLang('aria.rich_text_area'));
+
+			/**
+			 * Reference to the theme instance that was used to generate the UI.
+			 *
+			 * @property theme
+			 * @type tinymce.Theme
+			 * @example
+			 * // Executes a method on the theme directly
+			 * tinymce.activeEditor.theme.someMethod();
+			 */
+			if (settings.theme) {
+				if (typeof settings.theme != "function") {
+					settings.theme = settings.theme.replace(/-/, '');
+					Theme = ThemeManager.get(settings.theme);
+					self.theme = new Theme(self, ThemeManager.urls[settings.theme]);
+
+					if (self.theme.init) {
+						self.theme.init(self, ThemeManager.urls[settings.theme] || self.documentBaseUrl.replace(/\/$/, ''), self.$);
+					}
+				} else {
+					self.theme = settings.theme;
+				}
+			}
+
+			function initPlugin(plugin) {
+				var Plugin = PluginManager.get(plugin), pluginUrl, pluginInstance;
+
+				pluginUrl = PluginManager.urls[plugin] || self.documentBaseUrl.replace(/\/$/, '');
+				plugin = trim(plugin);
+				if (Plugin && inArray(initializedPlugins, plugin) === -1) {
+					each(PluginManager.dependencies(plugin), function(dep) {
+						initPlugin(dep);
+					});
+
+					pluginInstance = new Plugin(self, pluginUrl, self.$);
+
+					self.plugins[plugin] = pluginInstance;
+
+					if (pluginInstance.init) {
+						pluginInstance.init(self, pluginUrl);
+						initializedPlugins.push(plugin);
+					}
+				}
+			}
+
+			// Create all plugins
+			each(settings.plugins.replace(/\-/g, '').split(/[ ,]/), initPlugin);
+
+			// Measure box
+			if (settings.render_ui && self.theme) {
+				self.orgDisplay = elm.style.display;
+
+				if (typeof settings.theme != "function") {
+					w = settings.width || elm.style.width || elm.offsetWidth;
+					h = settings.height || elm.style.height || elm.offsetHeight;
+					minHeight = settings.min_height || 100;
+					re = /^[0-9\.]+(|px)$/i;
+
+					if (re.test('' + w)) {
+						w = Math.max(parseInt(w, 10), 100);
+					}
+
+					if (re.test('' + h)) {
+						h = Math.max(parseInt(h, 10), minHeight);
+					}
+
+					// Render UI
+					o = self.theme.renderUI({
+						targetNode: elm,
+						width: w,
+						height: h,
+						deltaWidth: settings.delta_width,
+						deltaHeight: settings.delta_height
+					});
+
+					// Resize editor
+					if (!settings.content_editable) {
+						h = (o.iframeHeight || h) + (typeof h == 'number' ? (o.deltaHeight || 0) : '');
+						if (h < minHeight) {
+							h = minHeight;
+						}
+					}
+				} else {
+					o = settings.theme(self, elm);
+
+					// Convert element type to id:s
+					if (o.editorContainer.nodeType) {
+						o.editorContainer = o.editorContainer.id = o.editorContainer.id || self.id + "_parent";
+					}
+
+					// Convert element type to id:s
+					if (o.iframeContainer.nodeType) {
+						o.iframeContainer = o.iframeContainer.id = o.iframeContainer.id || self.id + "_iframecontainer";
+					}
+
+					// Use specified iframe height or the targets offsetHeight
+					h = o.iframeHeight || elm.offsetHeight;
+				}
+
+				self.editorContainer = o.editorContainer;
+			}
+
+			// Load specified content CSS last
+			if (settings.content_css) {
+				each(explode(settings.content_css), function(u) {
+					self.contentCSS.push(self.documentBaseURI.toAbsolute(u));
+				});
+			}
+
+			// Load specified content CSS last
+			if (settings.content_style) {
+				self.contentStyles.push(settings.content_style);
+			}
+
+			// Content editable mode ends here
+			if (settings.content_editable) {
+				elm = n = o = null; // Fix IE leak
+				return self.initContentBody();
+			}
+
+			self.iframeHTML = settings.doctype + '<html><head>';
+
+			// We only need to override paths if we have to
+			// IE has a bug where it remove site absolute urls to relative ones if this is specified
+			if (settings.document_base_url != self.documentBaseUrl) {
+				self.iframeHTML += '<base href="' + self.documentBaseURI.getURI() + '" />';
+			}
+
+			// IE8 doesn't support carets behind images setting ie7_compat would force IE8+ to run in IE7 compat mode.
+			if (!Env.caretAfter && settings.ie7_compat) {
+				self.iframeHTML += '<meta http-equiv="X-UA-Compatible" content="IE=7" />';
+			}
+
+			self.iframeHTML += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
+
+			// Load the CSS by injecting them into the HTML this will reduce "flicker"
+			for (i = 0; i < self.contentCSS.length; i++) {
+				var cssUrl = self.contentCSS[i];
+				self.iframeHTML += (
+					'<link type="text/css" ' +
+						'rel="stylesheet" ' +
+						'href="' + Tools._addCacheSuffix(cssUrl) + '" />'
+				);
+				self.loadedCSS[cssUrl] = true;
+			}
+
+			bodyId = settings.body_id || 'tinymce';
+			if (bodyId.indexOf('=') != -1) {
+				bodyId = self.getParam('body_id', '', 'hash');
+				bodyId = bodyId[self.id] || bodyId;
+			}
+
+			bodyClass = settings.body_class || '';
+			if (bodyClass.indexOf('=') != -1) {
+				bodyClass = self.getParam('body_class', '', 'hash');
+				bodyClass = bodyClass[self.id] || '';
+			}
+
+			if (settings.content_security_policy) {
+				self.iframeHTML += '<meta http-equiv="Content-Security-Policy" content="' + settings.content_security_policy + '" />';
+			}
+
+			self.iframeHTML += '</head><body id="' + bodyId +
+				'" class="mce-content-body ' + bodyClass +
+				'" data-id="' + self.id + '"><br></body></html>';
+
+			/*eslint no-script-url:0 */
+			var domainRelaxUrl = 'javascript:(function(){' +
+				'document.open();document.domain="' + document.domain + '";' +
+				'var ed = window.parent.tinymce.get("' + self.id + '");document.write(ed.iframeHTML);' +
+				'document.close();ed.initContentBody(true);})()';
+
+			// Domain relaxing is required since the user has messed around with document.domain
+			if (document.domain != location.hostname) {
+				url = domainRelaxUrl;
+			}
+
+			// Create iframe
+			// TODO: ACC add the appropriate description on this.
+			var ifr = DOM.create('iframe', {
+				id: self.id + "_ifr",
+				//src: url || 'javascript:""', // Workaround for HTTPS warning in IE6/7
+				frameBorder: '0',
+				allowTransparency: "true",
+				title: self.editorManager.translate(
+						"Rich Text Area. Press ALT-F9 for menu. " +
+						"Press ALT-F10 for toolbar. Press ALT-0 for help"
+				),
+				style: {
+					width: '100%',
+					height: h,
+					display: 'block' // Important for Gecko to render the iframe correctly
+				}
+			});
+
+			ifr.onload = function() {
+				ifr.onload = null;
+				self.fire("load");
+			};
+
+			DOM.setAttrib(ifr, "src", url || 'javascript:""');
+
+			self.contentAreaContainer = o.iframeContainer;
+			self.iframeElement = ifr;
+
+			n = DOM.add(o.iframeContainer, ifr);
+
+			// Try accessing the document this will fail on IE when document.domain is set to the same as location.hostname
+			// Then we have to force domain relaxing using the domainRelaxUrl approach very ugly!!
+			if (ie) {
+				try {
+					self.getDoc();
+				} catch (e) {
+					n.src = url = domainRelaxUrl;
+				}
+			}
+
+			if (o.editorContainer) {
+				DOM.get(o.editorContainer).style.display = self.orgDisplay;
+				self.hidden = DOM.isHidden(o.editorContainer);
+			}
+
+			self.getElement().style.display = 'none';
+			DOM.setAttrib(self.id, 'aria-hidden', true);
+
+			if (!url) {
+				self.initContentBody();
+			}
+
+			elm = n = o = null; // Cleanup
+		},
+
+		/**
+		 * This method get called by the init method ones the iframe is loaded.
+		 * It will fill the iframe with contents, setups DOM and selection objects for the iframe.
+		 *
+		 * @method initContentBody
+		 * @private
+		 */
+		initContentBody: function(skipWrite) {
+			var self = this, settings = self.settings, targetElm = self.getElement(), doc = self.getDoc(), body, contentCssText;
+
+			// Restore visibility on target element
+			if (!settings.inline) {
+				self.getElement().style.visibility = self.orgVisibility;
+			}
+
+			// Setup iframe body
+			if (!skipWrite && !settings.content_editable) {
+				doc.open();
+				doc.write(self.iframeHTML);
+				doc.close();
+			}
+
+			if (settings.content_editable) {
+				self.on('remove', function() {
+					var bodyEl = this.getBody();
+
+					DOM.removeClass(bodyEl, 'mce-content-body');
+					DOM.removeClass(bodyEl, 'mce-edit-focus');
+					DOM.setAttrib(bodyEl, 'contentEditable', null);
+				});
+
+				DOM.addClass(targetElm, 'mce-content-body');
+				self.contentDocument = doc = settings.content_document || document;
+				self.contentWindow = settings.content_window || window;
+				self.bodyElement = targetElm;
+
+				// Prevent leak in IE
+				settings.content_document = settings.content_window = null;
+
+				// TODO: Fix this
+				settings.root_name = targetElm.nodeName.toLowerCase();
+			}
+
+			// It will not steal focus while setting contentEditable
+			body = self.getBody();
+			body.disabled = true;
+
+			if (!settings.readonly) {
+				if (self.inline && DOM.getStyle(body, 'position', true) == 'static') {
+					body.style.position = 'relative';
+				}
+
+				body.contentEditable = self.getParam('content_editable_state', true);
+			}
+
+			body.disabled = false;
+
+			/**
+			 * Schema instance, enables you to validate elements and it's children.
+			 *
+			 * @property schema
+			 * @type tinymce.html.Schema
+			 */
+			self.schema = new Schema(settings);
+
+			/**
+			 * DOM instance for the editor.
+			 *
+			 * @property dom
+			 * @type tinymce.dom.DOMUtils
+			 * @example
+			 * // Adds a class to all paragraphs within the editor
+			 * tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('p'), 'someclass');
+			 */
+			self.dom = new DOMUtils(doc, {
+				keep_values: true,
+				url_converter: self.convertURL,
+				url_converter_scope: self,
+				hex_colors: settings.force_hex_style_colors,
+				class_filter: settings.class_filter,
+				update_styles: true,
+				root_element: self.inline ? self.getBody() : null,
+				collect: settings.content_editable,
+				schema: self.schema,
+				onSetAttrib: function(e) {
+					self.fire('SetAttrib', e);
+				}
+			});
+
+			/**
+			 * HTML parser will be used when contents is inserted into the editor.
+			 *
+			 * @property parser
+			 * @type tinymce.html.DomParser
+			 */
+			self.parser = new DomParser(settings, self.schema);
+
+			// Convert src and href into data-mce-src, data-mce-href and data-mce-style
+			self.parser.addAttributeFilter('src,href,style,tabindex', function(nodes, name) {
+				var i = nodes.length, node, dom = self.dom, value, internalName;
+
+				while (i--) {
+					node = nodes[i];
+					value = node.attr(name);
+					internalName = 'data-mce-' + name;
+
+					// Add internal attribute if we need to we don't on a refresh of the document
+					if (!node.attributes.map[internalName]) {
+						if (name === "style") {
+							value = dom.serializeStyle(dom.parseStyle(value), node.name);
+
+							if (!value.length) {
+								value = null;
+							}
+
+							node.attr(internalName, value);
+							node.attr(name, value);
+						} else if (name === "tabindex") {
+							node.attr(internalName, value);
+							node.attr(name, null);
+						} else {
+							node.attr(internalName, self.convertURL(value, name, node.name));
+						}
+					}
+				}
+			});
+
+			// Keep scripts from executing
+			self.parser.addNodeFilter('script', function(nodes) {
+				var i = nodes.length, node;
+
+				while (i--) {
+					node = nodes[i];
+					node.attr('type', 'mce-' + (node.attr('type') || 'no/type'));
+				}
+			});
+
+			self.parser.addNodeFilter('#cdata', function(nodes) {
+				var i = nodes.length, node;
+
+				while (i--) {
+					node = nodes[i];
+					node.type = 8;
+					node.name = '#comment';
+					node.value = '[CDATA[' + node.value + ']]';
+				}
+			});
+
+			self.parser.addNodeFilter('p,h1,h2,h3,h4,h5,h6,div', function(nodes) {
+				var i = nodes.length, node, nonEmptyElements = self.schema.getNonEmptyElements();
+
+				while (i--) {
+					node = nodes[i];
+
+					if (node.isEmpty(nonEmptyElements)) {
+						node.append(new Node('br', 1)).shortEnded = true;
+					}
+				}
+			});
+
+			/**
+			 * DOM serializer for the editor. Will be used when contents is extracted from the editor.
+			 *
+			 * @property serializer
+			 * @type tinymce.dom.Serializer
+			 * @example
+			 * // Serializes the first paragraph in the editor into a string
+			 * tinymce.activeEditor.serializer.serialize(tinymce.activeEditor.dom.select('p')[0]);
+			 */
+			self.serializer = new DomSerializer(settings, self);
+
+			/**
+			 * Selection instance for the editor.
+			 *
+			 * @property selection
+			 * @type tinymce.dom.Selection
+			 * @example
+			 * // Sets some contents to the current selection in the editor
+			 * tinymce.activeEditor.selection.setContent('Some contents');
+			 *
+			 * // Gets the current selection
+			 * alert(tinymce.activeEditor.selection.getContent());
+			 *
+			 * // Selects the first paragraph found
+			 * tinymce.activeEditor.selection.select(tinymce.activeEditor.dom.select('p')[0]);
+			 */
+			self.selection = new Selection(self.dom, self.getWin(), self.serializer, self);
+
+			/**
+			 * Formatter instance.
+			 *
+			 * @property formatter
+			 * @type tinymce.Formatter
+			 */
+			self.formatter = new Formatter(self);
+
+			/**
+			 * Undo manager instance, responsible for handling undo levels.
+			 *
+			 * @property undoManager
+			 * @type tinymce.UndoManager
+			 * @example
+			 * // Undoes the last modification to the editor
+			 * tinymce.activeEditor.undoManager.undo();
+			 */
+			self.undoManager = new UndoManager(self);
+
+			self.forceBlocks = new ForceBlocks(self);
+			self.enterKey = new EnterKey(self);
+			self._nodeChangeDispatcher = new NodeChange(self);
+
+			self.fire('PreInit');
+
+			if (!settings.browser_spellcheck && !settings.gecko_spellcheck) {
+				doc.body.spellcheck = false; // Gecko
+				DOM.setAttrib(body, "spellcheck", "false");
+			}
+
+			self.fire('PostRender');
+
+			self.quirks = new Quirks(self);
+
+			if (settings.directionality) {
+				body.dir = settings.directionality;
+			}
+
+			if (settings.nowrap) {
+				body.style.whiteSpace = "nowrap";
+			}
+
+			if (settings.protect) {
+				self.on('BeforeSetContent', function(e) {
+					each(settings.protect, function(pattern) {
+						e.content = e.content.replace(pattern, function(str) {
+							return '<!--mce:protected ' + escape(str) + '-->';
+						});
+					});
+				});
+			}
+
+			self.on('SetContent', function() {
+				self.addVisual(self.getBody());
+			});
+
+			// Remove empty contents
+			if (settings.padd_empty_editor) {
+				self.on('PostProcess', function(e) {
+					e.content = e.content.replace(/^(<p[^>]*>(&nbsp;|&#160;|\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/, '');
+				});
+			}
+
+			self.load({initial: true, format: 'html'});
+			self.startContent = self.getContent({format: 'raw'});
+
+			/**
+			 * Is set to true after the editor instance has been initialized
+			 *
+			 * @property initialized
+			 * @type Boolean
+			 * @example
+			 * function isEditorInitialized(editor) {
+			 *     return editor && editor.initialized;
+			 * }
+			 */
+			self.initialized = true;
+			self.bindPendingEventDelegates();
+
+			self.fire('init');
+			self.focus(true);
+			self.nodeChanged({initial: true});
+			self.execCallback('init_instance_callback', self);
+
+			// Add editor specific CSS styles
+			if (self.contentStyles.length > 0) {
+				contentCssText = '';
+
+				each(self.contentStyles, function(style) {
+					contentCssText += style + "\r\n";
+				});
+
+				self.dom.addStyle(contentCssText);
+			}
+
+			// Load specified content CSS last
+			each(self.contentCSS, function(cssUrl) {
+				if (!self.loadedCSS[cssUrl]) {
+					self.dom.loadCSS(cssUrl);
+					self.loadedCSS[cssUrl] = true;
+				}
+			});
+
+			// Handle auto focus
+			if (settings.auto_focus) {
+				setTimeout(function() {
+					var editor;
+
+					if (settings.auto_focus === true) {
+						editor = self;
+					} else {
+						editor = self.editorManager.get(settings.auto_focus);
+					}
+
+					if (!editor.destroyed) {
+						editor.focus();
+					}
+				}, 100);
+			}
+
+			// Clean up references for IE
+			targetElm = doc = body = null;
+		},
+
+		/**
+		 * Focuses/activates the editor. This will set this editor as the activeEditor in the tinymce collection
+		 * it will also place DOM focus inside the editor.
+		 *
+		 * @method focus
+		 * @param {Boolean} skipFocus Skip DOM focus. Just set is as the active editor.
+		 */
+		focus: function(skipFocus) {
+			var self = this, selection = self.selection, contentEditable = self.settings.content_editable, rng;
+			var controlElm, doc = self.getDoc(), body;
+
+			if (!skipFocus) {
+				// Get selected control element
+				rng = selection.getRng();
+				if (rng.item) {
+					controlElm = rng.item(0);
+				}
+
+				self._refreshContentEditable();
+
+				// Focus the window iframe
+				if (!contentEditable) {
+					// WebKit needs this call to fire focusin event properly see #5948
+					// But Opera pre Blink engine will produce an empty selection so skip Opera
+					if (!Env.opera) {
+						self.getBody().focus();
+					}
+
+					self.getWin().focus();
+				}
+
+				// Focus the body as well since it's contentEditable
+				if (isGecko || contentEditable) {
+					body = self.getBody();
+
+					// Check for setActive since it doesn't scroll to the element
+					if (body.setActive) {
+						// IE 11 sometimes throws "Invalid function" then fallback to focus
+						try {
+							body.setActive();
+						} catch (ex) {
+							body.focus();
+						}
+					} else {
+						body.focus();
+					}
+
+					if (contentEditable) {
+						selection.normalize();
+					}
+				}
+
+				// Restore selected control element
+				// This is needed when for example an image is selected within a
+				// layer a call to focus will then remove the control selection
+				if (controlElm && controlElm.ownerDocument == doc) {
+					rng = doc.body.createControlRange();
+					rng.addElement(controlElm);
+					rng.select();
+				}
+			}
+
+			self.editorManager.setActive(self);
+		},
+
+		/**
+		 * Executes a legacy callback. This method is useful to call old 2.x option callbacks.
+		 * There new event model is a better way to add callback so this method might be removed in the future.
+		 *
+		 * @method execCallback
+		 * @param {String} name Name of the callback to execute.
+		 * @return {Object} Return value passed from callback function.
+		 */
+		execCallback: function(name) {
+			var self = this, callback = self.settings[name], scope;
+
+			if (!callback) {
+				return;
+			}
+
+			// Look through lookup
+			if (self.callbackLookup && (scope = self.callbackLookup[name])) {
+				callback = scope.func;
+				scope = scope.scope;
+			}
+
+			if (typeof callback === 'string') {
+				scope = callback.replace(/\.\w+$/, '');
+				scope = scope ? resolve(scope) : 0;
+				callback = resolve(callback);
+				self.callbackLookup = self.callbackLookup || {};
+				self.callbackLookup[name] = {func: callback, scope: scope};
+			}
+
+			return callback.apply(scope || self, Array.prototype.slice.call(arguments, 1));
+		},
+
+		/**
+		 * Translates the specified string by replacing variables with language pack items it will also check if there is
+		 * a key mathcin the input.
+		 *
+		 * @method translate
+		 * @param {String} text String to translate by the language pack data.
+		 * @return {String} Translated string.
+		 */
+		translate: function(text) {
+			var lang = this.settings.language || 'en', i18n = this.editorManager.i18n;
+
+			if (!text) {
+				return '';
+			}
+
+			return i18n.data[lang + '.' + text] || text.replace(/\{\#([^\}]+)\}/g, function(a, b) {
+				return i18n.data[lang + '.' + b] || '{#' + b + '}';
+			});
+		},
+
+		/**
+		 * Returns a language pack item by name/key.
+		 *
+		 * @method getLang
+		 * @param {String} name Name/key to get from the language pack.
+		 * @param {String} defaultVal Optional default value to retrive.
+		 */
+		getLang: function(name, defaultVal) {
+			return (
+				this.editorManager.i18n.data[(this.settings.language || 'en') + '.' + name] ||
+				(defaultVal !== undefined ? defaultVal : '{#' + name + '}')
+			);
+		},
+
+		/**
+		 * Returns a configuration parameter by name.
+		 *
+		 * @method getParam
+		 * @param {String} name Configruation parameter to retrive.
+		 * @param {String} defaultVal Optional default value to return.
+		 * @param {String} type Optional type parameter.
+		 * @return {String} Configuration parameter value or default value.
+		 * @example
+		 * // Returns a specific config value from the currently active editor
+		 * var someval = tinymce.activeEditor.getParam('myvalue');
+		 *
+		 * // Returns a specific config value from a specific editor instance by id
+		 * var someval2 = tinymce.get('my_editor').getParam('myvalue');
+		 */
+		getParam: function(name, defaultVal, type) {
+			var value = name in this.settings ? this.settings[name] : defaultVal, output;
+
+			if (type === 'hash') {
+				output = {};
+
+				if (typeof value === 'string') {
+					each(value.indexOf('=') > 0 ? value.split(/[;,](?![^=;,]*(?:[;,]|$))/) : value.split(','), function(value) {
+						value = value.split('=');
+
+						if (value.length > 1) {
+							output[trim(value[0])] = trim(value[1]);
+						} else {
+							output[trim(value[0])] = trim(value);
+						}
+					});
+				} else {
+					output = value;
+				}
+
+				return output;
+			}
+
+			return value;
+		},
+
+		/**
+		 * Distpaches out a onNodeChange event to all observers. This method should be called when you
+		 * need to update the UI states or element path etc.
+		 *
+		 * @method nodeChanged
+		 * @param {Object} args Optional args to pass to NodeChange event handlers.
+		 */
+		nodeChanged: function(args) {
+			this._nodeChangeDispatcher.nodeChanged(args);
+		},
+
+		/**
+		 * Adds a button that later gets created by the theme in the editors toolbars.
+		 *
+		 * @method addButton
+		 * @param {String} name Button name to add.
+		 * @param {Object} settings Settings object with title, cmd etc.
+		 * @example
+		 * // Adds a custom button to the editor that inserts contents when clicked
+		 * tinymce.init({
+		 *    ...
+		 *
+		 *    toolbar: 'example'
+		 *
+		 *    setup: function(ed) {
+		 *       ed.addButton('example', {
+		 *          title: 'My title',
+		 *          image: '../js/tinymce/plugins/example/img/example.gif',
+		 *          onclick: function() {
+		 *             ed.insertContent('Hello world!!');
+		 *          }
+		 *       });
+		 *    }
+		 * });
+		 */
+		addButton: function(name, settings) {
+			var self = this;
+
+			if (settings.cmd) {
+				settings.onclick = function() {
+					self.execCommand(settings.cmd);
+				};
+			}
+
+			if (!settings.text && !settings.icon) {
+				settings.icon = name;
+			}
+
+			self.buttons = self.buttons || {};
+			settings.tooltip = settings.tooltip || settings.title;
+			self.buttons[name] = settings;
+		},
+
+		/**
+		 * Adds a menu item to be used in the menus of the theme. There might be multiple instances
+		 * of this menu item for example it might be used in the main menus of the theme but also in
+		 * the context menu so make sure that it's self contained and supports multiple instances.
+		 *
+		 * @method addMenuItem
+		 * @param {String} name Menu item name to add.
+		 * @param {Object} settings Settings object with title, cmd etc.
+		 * @example
+		 * // Adds a custom menu item to the editor that inserts contents when clicked
+		 * // The context option allows you to add the menu item to an existing default menu
+		 * tinymce.init({
+		 *    ...
+		 *
+		 *    setup: function(ed) {
+		 *       ed.addMenuItem('example', {
+		 *          text: 'My menu item',
+		 *          context: 'tools',
+		 *          onclick: function() {
+		 *             ed.insertContent('Hello world!!');
+		 *          }
+		 *       });
+		 *    }
+		 * });
+		 */
+		addMenuItem: function(name, settings) {
+			var self = this;
+
+			if (settings.cmd) {
+				settings.onclick = function() {
+					self.execCommand(settings.cmd);
+				};
+			}
+
+			self.menuItems = self.menuItems || {};
+			self.menuItems[name] = settings;
+		},
+
+		/**
+		 * Adds a custom command to the editor, you can also override existing commands with this method.
+		 * The command that you add can be executed with execCommand.
+		 *
+		 * @method addCommand
+		 * @param {String} name Command name to add/override.
+		 * @param {addCommandCallback} callback Function to execute when the command occurs.
+		 * @param {Object} scope Optional scope to execute the function in.
+		 * @example
+		 * // Adds a custom command that later can be executed using execCommand
+		 * tinymce.init({
+		 *    ...
+		 *
+		 *    setup: function(ed) {
+		 *       // Register example command
+		 *       ed.addCommand('mycommand', function(ui, v) {
+		 *          ed.windowManager.alert('Hello world!! Selection: ' + ed.selection.getContent({format: 'text'}));
+		 *       });
+		 *    }
+		 * });
+		 */
+		addCommand: function(name, callback, scope) {
+			/**
+			 * Callback function that gets called when a command is executed.
+			 *
+			 * @callback addCommandCallback
+			 * @param {Boolean} ui Display UI state true/false.
+			 * @param {Object} value Optional value for command.
+			 * @return {Boolean} True/false state if the command was handled or not.
+			 */
+			this.editorCommands.addCommand(name, callback, scope);
+		},
+
+		/**
+		 * Adds a custom query state command to the editor, you can also override existing commands with this method.
+		 * The command that you add can be executed with queryCommandState function.
+		 *
+		 * @method addQueryStateHandler
+		 * @param {String} name Command name to add/override.
+		 * @param {addQueryStateHandlerCallback} callback Function to execute when the command state retrival occurs.
+		 * @param {Object} scope Optional scope to execute the function in.
+		 */
+		addQueryStateHandler: function(name, callback, scope) {
+			/**
+			 * Callback function that gets called when a queryCommandState is executed.
+			 *
+			 * @callback addQueryStateHandlerCallback
+			 * @return {Boolean} True/false state if the command is enabled or not like is it bold.
+			 */
+			this.editorCommands.addQueryStateHandler(name, callback, scope);
+		},
+
+		/**
+		 * Adds a custom query value command to the editor, you can also override existing commands with this method.
+		 * The command that you add can be executed with queryCommandValue function.
+		 *
+		 * @method addQueryValueHandler
+		 * @param {String} name Command name to add/override.
+		 * @param {addQueryValueHandlerCallback} callback Function to execute when the command value retrival occurs.
+		 * @param {Object} scope Optional scope to execute the function in.
+		 */
+		addQueryValueHandler: function(name, callback, scope) {
+			/**
+			 * Callback function that gets called when a queryCommandValue is executed.
+			 *
+			 * @callback addQueryValueHandlerCallback
+			 * @return {Object} Value of the command or undefined.
+			 */
+			this.editorCommands.addQueryValueHandler(name, callback, scope);
+		},
+
+		/**
+		 * Adds a keyboard shortcut for some command or function.
+		 *
+		 * @method addShortcut
+		 * @param {String} pattern Shortcut pattern. Like for example: ctrl+alt+o.
+		 * @param {String} desc Text description for the command.
+		 * @param {String/Function} cmdFunc Command name string or function to execute when the key is pressed.
+		 * @param {Object} sc Optional scope to execute the function in.
+		 * @return {Boolean} true/false state if the shortcut was added or not.
+		 */
+		addShortcut: function(pattern, desc, cmdFunc, scope) {
+			this.shortcuts.add(pattern, desc, cmdFunc, scope);
+		},
+
+		/**
+		 * Executes a command on the current instance. These commands can be TinyMCE internal commands prefixed with "mce" or
+		 * they can be build in browser commands such as "Bold". A compleate list of browser commands is available on MSDN or Mozilla.org.
+		 * This function will dispatch the execCommand function on each plugin, theme or the execcommand_callback option if none of these
+		 * return true it will handle the command as a internal browser command.
+		 *
+		 * @method execCommand
+		 * @param {String} cmd Command name to execute, for example mceLink or Bold.
+		 * @param {Boolean} ui True/false state if a UI (dialog) should be presented or not.
+		 * @param {mixed} value Optional command value, this can be anything.
+		 * @param {Object} args Optional arguments object.
+		 */
+		execCommand: function(cmd, ui, value, args) {
+			return this.editorCommands.execCommand(cmd, ui, value, args);
+		},
+
+		/**
+		 * Returns a command specific state, for example if bold is enabled or not.
+		 *
+		 * @method queryCommandState
+		 * @param {string} cmd Command to query state from.
+		 * @return {Boolean} Command specific state, for example if bold is enabled or not.
+		 */
+		queryCommandState: function(cmd) {
+			return this.editorCommands.queryCommandState(cmd);
+		},
+
+		/**
+		 * Returns a command specific value, for example the current font size.
+		 *
+		 * @method queryCommandValue
+		 * @param {string} cmd Command to query value from.
+		 * @return {Object} Command specific value, for example the current font size.
+		 */
+		queryCommandValue: function(cmd) {
+			return this.editorCommands.queryCommandValue(cmd);
+		},
+
+		/**
+		 * Returns true/false if the command is supported or not.
+		 *
+		 * @method queryCommandSupported
+		 * @param {String} cmd Command that we check support for.
+		 * @return {Boolean} true/false if the command is supported or not.
+		 */
+		queryCommandSupported: function(cmd) {
+			return this.editorCommands.queryCommandSupported(cmd);
+		},
+
+		/**
+		 * Shows the editor and hides any textarea/div that the editor is supposed to replace.
+		 *
+		 * @method show
+		 */
+		show: function() {
+			var self = this;
+
+			if (self.hidden) {
+				self.hidden = false;
+
+				if (self.inline) {
+					self.getBody().contentEditable = true;
+				} else {
+					DOM.show(self.getContainer());
+					DOM.hide(self.id);
+				}
+
+				self.load();
+				self.fire('show');
+			}
+		},
+
+		/**
+		 * Hides the editor and shows any textarea/div that the editor is supposed to replace.
+		 *
+		 * @method hide
+		 */
+		hide: function() {
+			var self = this, doc = self.getDoc();
+
+			if (!self.hidden) {
+				// Fixed bug where IE has a blinking cursor left from the editor
+				if (ie && doc && !self.inline) {
+					doc.execCommand('SelectAll');
+				}
+
+				// We must save before we hide so Safari doesn't crash
+				self.save();
+
+				if (self.inline) {
+					self.getBody().contentEditable = false;
+
+					// Make sure the editor gets blurred
+					if (self == self.editorManager.focusedEditor) {
+						self.editorManager.focusedEditor = null;
+					}
+				} else {
+					DOM.hide(self.getContainer());
+					DOM.setStyle(self.id, 'display', self.orgDisplay);
+				}
+
+				self.hidden = true;
+				self.fire('hide');
+			}
+		},
+
+		/**
+		 * Returns true/false if the editor is hidden or not.
+		 *
+		 * @method isHidden
+		 * @return {Boolean} True/false if the editor is hidden or not.
+		 */
+		isHidden: function() {
+			return !!this.hidden;
+		},
+
+		/**
+		 * Sets the progress state, this will display a throbber/progess for the editor.
+		 * This is ideal for asycronous operations like an AJAX save call.
+		 *
+		 * @method setProgressState
+		 * @param {Boolean} state Boolean state if the progress should be shown or hidden.
+		 * @param {Number} time Optional time to wait before the progress gets shown.
+		 * @return {Boolean} Same as the input state.
+		 * @example
+		 * // Show progress for the active editor
+		 * tinymce.activeEditor.setProgressState(true);
+		 *
+		 * // Hide progress for the active editor
+		 * tinymce.activeEditor.setProgressState(false);
+		 *
+		 * // Show progress after 3 seconds
+		 * tinymce.activeEditor.setProgressState(true, 3000);
+		 */
+		setProgressState: function(state, time) {
+			this.fire('ProgressState', {state: state, time: time});
+		},
+
+		/**
+		 * Loads contents from the textarea or div element that got converted into an editor instance.
+		 * This method will move the contents from that textarea or div into the editor by using setContent
+		 * so all events etc that method has will get dispatched as well.
+		 *
+		 * @method load
+		 * @param {Object} args Optional content object, this gets passed around through the whole load process.
+		 * @return {String} HTML string that got set into the editor.
+		 */
+		load: function(args) {
+			var self = this, elm = self.getElement(), html;
+
+			if (elm) {
+				args = args || {};
+				args.load = true;
+
+				html = self.setContent(elm.value !== undefined ? elm.value : elm.innerHTML, args);
+				args.element = elm;
+
+				if (!args.no_events) {
+					self.fire('LoadContent', args);
+				}
+
+				args.element = elm = null;
+
+				return html;
+			}
+		},
+
+		/**
+		 * Saves the contents from a editor out to the textarea or div element that got converted into an editor instance.
+		 * This method will move the HTML contents from the editor into that textarea or div by getContent
+		 * so all events etc that method has will get dispatched as well.
+		 *
+		 * @method save
+		 * @param {Object} args Optional content object, this gets passed around through the whole save process.
+		 * @return {String} HTML string that got set into the textarea/div.
+		 */
+		save: function(args) {
+			var self = this, elm = self.getElement(), html, form;
+
+			if (!elm || !self.initialized) {
+				return;
+			}
+
+			args = args || {};
+			args.save = true;
+
+			args.element = elm;
+			html = args.content = self.getContent(args);
+
+			if (!args.no_events) {
+				self.fire('SaveContent', args);
+			}
+
+			html = args.content;
+
+			if (!/TEXTAREA|INPUT/i.test(elm.nodeName)) {
+				// Update DIV element when not in inline mode
+				if (!self.inline) {
+					elm.innerHTML = html;
+				}
+
+				// Update hidden form element
+				if ((form = DOM.getParent(self.id, 'form'))) {
+					each(form.elements, function(elm) {
+						if (elm.name == self.id) {
+							elm.value = html;
+							return false;
+						}
+					});
+				}
+			} else {
+				elm.value = html;
+			}
+
+			args.element = elm = null;
+
+			if (args.set_dirty !== false) {
+				self.isNotDirty = true;
+			}
+
+			return html;
+		},
+
+		/**
+		 * Sets the specified content to the editor instance, this will cleanup the content before it gets set using
+		 * the different cleanup rules options.
+		 *
+		 * @method setContent
+		 * @param {String} content Content to set to editor, normally HTML contents but can be other formats as well.
+		 * @param {Object} args Optional content object, this gets passed around through the whole set process.
+		 * @return {String} HTML string that got set into the editor.
+		 * @example
+		 * // Sets the HTML contents of the activeEditor editor
+		 * tinymce.activeEditor.setContent('<span>some</span> html');
+		 *
+		 * // Sets the raw contents of the activeEditor editor
+		 * tinymce.activeEditor.setContent('<span>some</span> html', {format: 'raw'});
+		 *
+		 * // Sets the content of a specific editor (my_editor in this example)
+		 * tinymce.get('my_editor').setContent(data);
+		 *
+		 * // Sets the bbcode contents of the activeEditor editor if the bbcode plugin was added
+		 * tinymce.activeEditor.setContent('[b]some[/b] html', {format: 'bbcode'});
+		 */
+		setContent: function(content, args) {
+			var self = this, body = self.getBody(), forcedRootBlockName;
+
+			// Setup args object
+			args = args || {};
+			args.format = args.format || 'html';
+			args.set = true;
+			args.content = content;
+
+			// Do preprocessing
+			if (!args.no_events) {
+				self.fire('BeforeSetContent', args);
+			}
+
+			content = args.content;
+
+			// Padd empty content in Gecko and Safari. Commands will otherwise fail on the content
+			// It will also be impossible to place the caret in the editor unless there is a BR element present
+			if (content.length === 0 || /^\s+$/.test(content)) {
+				forcedRootBlockName = self.settings.forced_root_block;
+
+				// Check if forcedRootBlock is configured and that the block is a valid child of the body
+				if (forcedRootBlockName && self.schema.isValidChild(body.nodeName.toLowerCase(), forcedRootBlockName.toLowerCase())) {
+					// Padd with bogus BR elements on modern browsers and IE 7 and 8 since they don't render empty P tags properly
+					content = ie && ie < 11 ? '' : '<br data-mce-bogus="1">';
+					content = self.dom.createHTML(forcedRootBlockName, self.settings.forced_root_block_attrs, content);
+				} else if (!ie) {
+					// We need to add a BR when forced_root_block is disabled on non IE browsers to place the caret
+					content = '<br data-mce-bogus="1">';
+				}
+
+				self.dom.setHTML(body, content);
+
+				self.fire('SetContent', args);
+			} else {
+				// Parse and serialize the html
+				if (args.format !== 'raw') {
+					content = new Serializer({}, self.schema).serialize(
+						self.parser.parse(content, {isRootContent: true})
+					);
+				}
+
+				// Set the new cleaned contents to the editor
+				args.content = trim(content);
+				self.dom.setHTML(body, args.content);
+
+				// Do post processing
+				if (!args.no_events) {
+					self.fire('SetContent', args);
+				}
+
+				// Don't normalize selection if the focused element isn't the body in
+				// content editable mode since it will steal focus otherwise
+				/*if (!self.settings.content_editable || document.activeElement === self.getBody()) {
+					self.selection.normalize();
+				}*/
+			}
+
+			return args.content;
+		},
+
+		/**
+		 * Gets the content from the editor instance, this will cleanup the content before it gets returned using
+		 * the different cleanup rules options.
+		 *
+		 * @method getContent
+		 * @param {Object} args Optional content object, this gets passed around through the whole get process.
+		 * @return {String} Cleaned content string, normally HTML contents.
+		 * @example
+		 * // Get the HTML contents of the currently active editor
+		 * console.debug(tinymce.activeEditor.getContent());
+		 *
+		 * // Get the raw contents of the currently active editor
+		 * tinymce.activeEditor.getContent({format: 'raw'});
+		 *
+		 * // Get content of a specific editor:
+		 * tinymce.get('content id').getContent()
+		 */
+		getContent: function(args) {
+			var self = this, content, body = self.getBody();
+
+			// Setup args object
+			args = args || {};
+			args.format = args.format || 'html';
+			args.get = true;
+			args.getInner = true;
+
+			// Do preprocessing
+			if (!args.no_events) {
+				self.fire('BeforeGetContent', args);
+			}
+
+			// Get raw contents or by default the cleaned contents
+			if (args.format == 'raw') {
+				content = body.innerHTML;
+			} else if (args.format == 'text') {
+				content = body.innerText || body.textContent;
+			} else {
+				content = self.serializer.serialize(body, args);
+			}
+
+			// Trim whitespace in beginning/end of HTML
+			if (args.format != 'text') {
+				args.content = trim(content);
+			} else {
+				args.content = content;
+			}
+
+			// Do post processing
+			if (!args.no_events) {
+				self.fire('GetContent', args);
+			}
+
+			return args.content;
+		},
+
+		/**
+		 * Inserts content at caret position.
+		 *
+		 * @method insertContent
+		 * @param {String} content Content to insert.
+		 * @param {Object} args Optional args to pass to insert call.
+		 */
+		insertContent: function(content, args) {
+			if (args) {
+				content = extend({content: content}, args);
+			}
+
+			this.execCommand('mceInsertContent', false, content);
+		},
+
+		/**
+		 * Returns true/false if the editor is dirty or not. It will get dirty if the user has made modifications to the contents.
+		 *
+		 * @method isDirty
+		 * @return {Boolean} True/false if the editor is dirty or not. It will get dirty if the user has made modifications to the contents.
+		 * @example
+		 * if (tinymce.activeEditor.isDirty())
+		 *     alert("You must save your contents.");
+		 */
+		isDirty: function() {
+			return !this.isNotDirty;
+		},
+
+		/**
+		 * Returns the editors container element. The container element wrappes in
+		 * all the elements added to the page for the editor. Such as UI, iframe etc.
+		 *
+		 * @method getContainer
+		 * @return {Element} HTML DOM element for the editor container.
+		 */
+		getContainer: function() {
+			var self = this;
+
+			if (!self.container) {
+				self.container = DOM.get(self.editorContainer || self.id + '_parent');
+			}
+
+			return self.container;
+		},
+
+		/**
+		 * Returns the editors content area container element. The this element is the one who
+		 * holds the iframe or the editable element.
+		 *
+		 * @method getContentAreaContainer
+		 * @return {Element} HTML DOM element for the editor area container.
+		 */
+		getContentAreaContainer: function() {
+			return this.contentAreaContainer;
+		},
+
+		/**
+		 * Returns the target element/textarea that got replaced with a TinyMCE editor instance.
+		 *
+		 * @method getElement
+		 * @return {Element} HTML DOM element for the replaced element.
+		 */
+		getElement: function() {
+			if (!this.targetElm) {
+				this.targetElm = DOM.get(this.id);
+			}
+
+			return this.targetElm;
+		},
+
+		/**
+		 * Returns the iframes window object.
+		 *
+		 * @method getWin
+		 * @return {Window} Iframe DOM window object.
+		 */
+		getWin: function() {
+			var self = this, elm;
+
+			if (!self.contentWindow) {
+				elm = self.iframeElement;
+
+				if (elm) {
+					self.contentWindow = elm.contentWindow;
+				}
+			}
+
+			return self.contentWindow;
+		},
+
+		/**
+		 * Returns the iframes document object.
+		 *
+		 * @method getDoc
+		 * @return {Document} Iframe DOM document object.
+		 */
+		getDoc: function() {
+			var self = this, win;
+
+			if (!self.contentDocument) {
+				win = self.getWin();
+
+				if (win) {
+					self.contentDocument = win.document;
+				}
+			}
+
+			return self.contentDocument;
+		},
+
+		/**
+		 * Returns the root element of the editable area.
+		 * For a non-inline iframe-based editor, returns the iframe's body element.
+		 *
+		 * @method getBody
+		 * @return {Element} The root element of the editable area.
+		 */
+		getBody: function() {
+			return this.bodyElement || this.getDoc().body;
+		},
+
+		/**
+		 * URL converter function this gets executed each time a user adds an img, a or
+		 * any other element that has a URL in it. This will be called both by the DOM and HTML
+		 * manipulation functions.
+		 *
+		 * @method convertURL
+		 * @param {string} url URL to convert.
+		 * @param {string} name Attribute name src, href etc.
+		 * @param {string/HTMLElement} elm Tag name or HTML DOM element depending on HTML or DOM insert.
+		 * @return {string} Converted URL string.
+		 */
+		convertURL: function(url, name, elm) {
+			var self = this, settings = self.settings;
+
+			// Use callback instead
+			if (settings.urlconverter_callback) {
+				return self.execCallback('urlconverter_callback', url, elm, true, name);
+			}
+
+			// Don't convert link href since thats the CSS files that gets loaded into the editor also skip local file URLs
+			if (!settings.convert_urls || (elm && elm.nodeName == 'LINK') || url.indexOf('file:') === 0 || url.length === 0) {
+				return url;
+			}
+
+			// Convert to relative
+			if (settings.relative_urls) {
+				return self.documentBaseURI.toRelative(url);
+			}
+
+			// Convert to absolute
+			url = self.documentBaseURI.toAbsolute(url, settings.remove_script_host);
+
+			return url;
+		},
+
+		/**
+		 * Adds visual aid for tables, anchors etc so they can be more easily edited inside the editor.
+		 *
+		 * @method addVisual
+		 * @param {Element} elm Optional root element to loop though to find tables etc that needs the visual aid.
+		 */
+		addVisual: function(elm) {
+			var self = this, settings = self.settings, dom = self.dom, cls;
+
+			elm = elm || self.getBody();
+
+			if (self.hasVisual === undefined) {
+				self.hasVisual = settings.visual;
+			}
+
+			each(dom.select('table,a', elm), function(elm) {
+				var value;
+
+				switch (elm.nodeName) {
+					case 'TABLE':
+						cls = settings.visual_table_class || 'mce-item-table';
+						value = dom.getAttrib(elm, 'border');
+
+						if ((!value || value == '0') && self.hasVisual) {
+							dom.addClass(elm, cls);
+						} else {
+							dom.removeClass(elm, cls);
+						}
+
+						return;
+
+					case 'A':
+						if (!dom.getAttrib(elm, 'href', false)) {
+							value = dom.getAttrib(elm, 'name') || elm.id;
+							cls = settings.visual_anchor_class || 'mce-item-anchor';
+
+							if (value && self.hasVisual) {
+								dom.addClass(elm, cls);
+							} else {
+								dom.removeClass(elm, cls);
+							}
+						}
+
+						return;
+				}
+			});
+
+			self.fire('VisualAid', {element: elm, hasVisual: self.hasVisual});
+		},
+
+		/**
+		 * Removes the editor from the dom and tinymce collection.
+		 *
+		 * @method remove
+		 */
+		remove: function() {
+			var self = this;
+
+			if (!self.removed) {
+				self.save();
+				self.removed = 1;
+				self.unbindAllNativeEvents();
+
+				// Remove any hidden input
+				if (self.hasHiddenInput) {
+					DOM.remove(self.getElement().nextSibling);
+				}
+
+				if (!self.inline) {
+					// IE 9 has a bug where the selection stops working if you place the
+					// caret inside the editor then remove the iframe
+					if (ie && ie < 10) {
+						self.getDoc().execCommand('SelectAll', false, null);
+					}
+
+					DOM.setStyle(self.id, 'display', self.orgDisplay);
+					self.getBody().onload = null; // Prevent #6816
+				}
+
+				self.fire('remove');
+
+				self.editorManager.remove(self);
+				DOM.remove(self.getContainer());
+				self.destroy();
+			}
+		},
+
+		/**
+		 * Destroys the editor instance by removing all events, element references or other resources
+		 * that could leak memory. This method will be called automatically when the page is unloaded
+		 * but you can also call it directly if you know what you are doing.
+		 *
+		 * @method destroy
+		 * @param {Boolean} automatic Optional state if the destroy is an automatic destroy or user called one.
+		 */
+		destroy: function(automatic) {
+			var self = this, form;
+
+			// One time is enough
+			if (self.destroyed) {
+				return;
+			}
+
+			// If user manually calls destroy and not remove
+			// Users seems to have logic that calls destroy instead of remove
+			if (!automatic && !self.removed) {
+				self.remove();
+				return;
+			}
+
+			if (!automatic) {
+				self.editorManager.off('beforeunload', self._beforeUnload);
+
+				// Manual destroy
+				if (self.theme && self.theme.destroy) {
+					self.theme.destroy();
+				}
+
+				// Destroy controls, selection and dom
+				self.selection.destroy();
+				self.dom.destroy();
+			}
+
+			form = self.formElement;
+			if (form) {
+				if (form._mceOldSubmit) {
+					form.submit = form._mceOldSubmit;
+					form._mceOldSubmit = null;
+				}
+
+				DOM.unbind(form, 'submit reset', self.formEventDelegate);
+			}
+
+			self.contentAreaContainer = self.formElement = self.container = self.editorContainer = null;
+			self.bodyElement = self.contentDocument = self.contentWindow = null;
+			self.iframeElement = self.targetElm = null;
+
+			if (self.selection) {
+				self.selection = self.selection.win = self.selection.dom = self.selection.dom.doc = null;
+			}
+
+			self.destroyed = 1;
+		},
+
+		// Internal functions
+
+		_refreshContentEditable: function() {
+			var self = this, body, parent;
+
+			// Check if the editor was hidden and the re-initalize contentEditable mode by removing and adding the body again
+			if (self._isHidden()) {
+				body = self.getBody();
+				parent = body.parentNode;
+
+				parent.removeChild(body);
+				parent.appendChild(body);
+
+				body.focus();
+			}
+		},
+
+		_isHidden: function() {
+			var sel;
+
+			if (!isGecko) {
+				return 0;
+			}
+
+			// Weird, wheres that cursor selection?
+			sel = this.selection.getSel();
+			return (!sel || !sel.rangeCount || sel.rangeCount === 0);
+		}
+	};
+
+	extend(Editor.prototype, EditorObservable);
+
+	return Editor;
+});
+
+// Included from: js/tinymce/classes/util/I18n.js
+
+/**
+ * I18n.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * I18n class that handles translation of TinyMCE UI.
+ * Uses po style with csharp style parameters.
+ *
+ * @class tinymce.util.I18n
+ */
+define("tinymce/util/I18n", [], function() {
+	"use strict";
+
+	var data = {}, code = "en";
+
+	return {
+		/**
+		 * Sets the current language code.
+		 *
+		 * @method setCode
+		 * @param {String} newCode Current language code.
+		 */
+		setCode: function(newCode) {
+			if (newCode) {
+				code = newCode;
+				this.rtl = this.data[newCode] ? this.data[newCode]._dir === 'rtl' : false;
+			}
+		},
+
+		/**
+		 * Returns the current language code.
+		 *
+		 * @return {String} Current language code.
+		 */
+		getCode: function() {
+			return code;
+		},
+
+		/**
+		 * Property gets set to true if a RTL language pack was loaded.
+		 *
+		 * @property rtl
+		 * @type Boolean
+		 */
+		rtl: false,
+
+		/**
+		 * Adds translations for a specific language code.
+		 *
+		 * @method add
+		 * @param {String} code Language code like sv_SE.
+		 * @param {Array} items Name/value array with English en_US to sv_SE.
+		 */
+		add: function(code, items) {
+			var langData = data[code];
+
+			if (!langData) {
+				data[code] = langData = {};
+			}
+
+			for (var name in items) {
+				langData[name] = items[name];
+			}
+
+			this.setCode(code);
+		},
+
+		/**
+		 * Translates the specified text.
+		 *
+		 * It has a few formats:
+		 * I18n.translate("Text");
+		 * I18n.translate(["Text {0}/{1}", 0, 1]);
+		 * I18n.translate({raw: "Raw string"});
+		 *
+		 * @method translate
+		 * @param {String/Object/Array} text Text to translate.
+		 * @return {String} String that got translated.
+		 */
+		translate: function(text) {
+			var langData;
+
+			langData = data[code];
+			if (!langData) {
+				langData = {};
+			}
+
+			if (typeof text == "undefined") {
+				return text;
+			}
+
+			if (typeof text != "string" && text.raw) {
+				return text.raw;
+			}
+
+			if (text.push) {
+				var values = text.slice(1);
+
+				text = (langData[text[0]] || text[0]).replace(/\{([0-9]+)\}/g, function(match1, match2) {
+					return values[match2];
+				});
+			}
+
+			return (langData[text] || text).replace(/{context:\w+}$/, '');
+		},
+
+		data: data
+	};
+});
+
+// Included from: js/tinymce/classes/FocusManager.js
+
+/**
+ * FocusManager.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class manages the focus/blur state of the editor. This class is needed since some
+ * browsers fire false focus/blur states when the selection is moved to a UI dialog or similar.
+ *
+ * This class will fire two events focus and blur on the editor instances that got affected.
+ * It will also handle the restore of selection when the focus is lost and returned.
+ *
+ * @class tinymce.FocusManager
+ */
+define("tinymce/FocusManager", [
+	"tinymce/dom/DOMUtils",
+	"tinymce/Env"
+], function(DOMUtils, Env) {
+	var selectionChangeHandler, documentFocusInHandler, documentMouseUpHandler, DOM = DOMUtils.DOM;
+
+	/**
+	 * Constructs a new focus manager instance.
+	 *
+	 * @constructor FocusManager
+	 * @param {tinymce.EditorManager} editorManager Editor manager instance to handle focus for.
+	 */
+	function FocusManager(editorManager) {
+		function getActiveElement() {
+			try {
+				return document.activeElement;
+			} catch (ex) {
+				// IE sometimes fails to get the activeElement when resizing table
+				// TODO: Investigate this
+				return document.body;
+			}
+		}
+
+		// We can't store a real range on IE 11 since it gets mutated so we need to use a bookmark object
+		// TODO: Move this to a separate range utils class since it's it's logic is present in Selection as well.
+		function createBookmark(dom, rng) {
+			if (rng && rng.startContainer) {
+				// Verify that the range is within the root of the editor
+				if (!dom.isChildOf(rng.startContainer, dom.getRoot()) || !dom.isChildOf(rng.endContainer, dom.getRoot())) {
+					return;
+				}
+
+				return {
+					startContainer: rng.startContainer,
+					startOffset: rng.startOffset,
+					endContainer: rng.endContainer,
+					endOffset: rng.endOffset
+				};
+			}
+
+			return rng;
+		}
+
+		function bookmarkToRng(editor, bookmark) {
+			var rng;
+
+			if (bookmark.startContainer) {
+				rng = editor.getDoc().createRange();
+				rng.setStart(bookmark.startContainer, bookmark.startOffset);
+				rng.setEnd(bookmark.endContainer, bookmark.endOffset);
+			} else {
+				rng = bookmark;
+			}
+
+			return rng;
+		}
+
+		function isUIElement(elm) {
+			return !!DOM.getParent(elm, FocusManager.isEditorUIElement);
+		}
+
+		function registerEvents(e) {
+			var editor = e.editor;
+
+			editor.on('init', function() {
+				// Gecko/WebKit has ghost selections in iframes and IE only has one selection per browser tab
+				if (editor.inline || Env.ie) {
+					// Use the onbeforedeactivate event when available since it works better see #7023
+					if ("onbeforedeactivate" in document && Env.ie < 9) {
+						editor.dom.bind(editor.getBody(), 'beforedeactivate', function(e) {
+							if (e.target != editor.getBody()) {
+								return;
+							}
+
+							try {
+								editor.lastRng = editor.selection.getRng();
+							} catch (ex) {
+								// IE throws "Unexcpected call to method or property access" some times so lets ignore it
+							}
+						});
+					} else {
+						// On other browsers take snapshot on nodechange in inline mode since they have Ghost selections for iframes
+						editor.on('nodechange mouseup keyup', function(e) {
+							var node = getActiveElement();
+
+							// Only act on manual nodechanges
+							if (e.type == 'nodechange' && e.selectionChange) {
+								return;
+							}
+
+							// IE 11 reports active element as iframe not body of iframe
+							if (node && node.id == editor.id + '_ifr') {
+								node = editor.getBody();
+							}
+
+							if (editor.dom.isChildOf(node, editor.getBody())) {
+								editor.lastRng = editor.selection.getRng();
+							}
+						});
+					}
+
+					// Handles the issue with WebKit not retaining selection within inline document
+					// If the user releases the mouse out side the body since a mouse up event wont occur on the body
+					if (Env.webkit && !selectionChangeHandler) {
+						selectionChangeHandler = function() {
+							var activeEditor = editorManager.activeEditor;
+
+							if (activeEditor && activeEditor.selection) {
+								var rng = activeEditor.selection.getRng();
+
+								// Store when it's non collapsed
+								if (rng && !rng.collapsed) {
+									editor.lastRng = rng;
+								}
+							}
+						};
+
+						DOM.bind(document, 'selectionchange', selectionChangeHandler);
+					}
+				}
+			});
+
+			editor.on('setcontent', function() {
+				editor.lastRng = null;
+			});
+
+			// Remove last selection bookmark on mousedown see #6305
+			editor.on('mousedown', function() {
+				editor.selection.lastFocusBookmark = null;
+			});
+
+			editor.on('focusin', function() {
+				var focusedEditor = editorManager.focusedEditor;
+
+				if (editor.selection.lastFocusBookmark) {
+					editor.selection.setRng(bookmarkToRng(editor, editor.selection.lastFocusBookmark));
+					editor.selection.lastFocusBookmark = null;
+				}
+
+				if (focusedEditor != editor) {
+					if (focusedEditor) {
+						focusedEditor.fire('blur', {focusedEditor: editor});
+					}
+
+					editorManager.setActive(editor);
+					editorManager.focusedEditor = editor;
+					editor.fire('focus', {blurredEditor: focusedEditor});
+					editor.focus(true);
+				}
+
+				editor.lastRng = null;
+			});
+
+			editor.on('focusout', function() {
+				window.setTimeout(function() {
+					var focusedEditor = editorManager.focusedEditor;
+
+					// Still the same editor the the blur was outside any editor UI
+					if (!isUIElement(getActiveElement()) && focusedEditor == editor) {
+						editor.fire('blur', {focusedEditor: null});
+						editorManager.focusedEditor = null;
+
+						// Make sure selection is valid could be invalid if the editor is blured and removed before the timeout occurs
+						if (editor.selection) {
+							editor.selection.lastFocusBookmark = null;
+						}
+					}
+				}, 0);
+			});
+
+			// Check if focus is moved to an element outside the active editor by checking if the target node
+			// isn't within the body of the activeEditor nor a UI element such as a dialog child control
+			if (!documentFocusInHandler) {
+				documentFocusInHandler = function(e) {
+					var activeEditor = editorManager.activeEditor;
+
+					if (activeEditor && e.target.ownerDocument == document) {
+						// Check to make sure we have a valid selection don't update the bookmark if it's
+						// a focusin to the body of the editor see #7025
+						if (activeEditor.selection && e.target != activeEditor.getBody()) {
+							activeEditor.selection.lastFocusBookmark = createBookmark(activeEditor.dom, activeEditor.lastRng);
+						}
+
+						// Fire a blur event if the element isn't a UI element
+						if (e.target != document.body && !isUIElement(e.target) && editorManager.focusedEditor == activeEditor) {
+							activeEditor.fire('blur', {focusedEditor: null});
+							editorManager.focusedEditor = null;
+						}
+					}
+				};
+
+				DOM.bind(document, 'focusin', documentFocusInHandler);
+			}
+
+			// Handle edge case when user starts the selection inside the editor and releases
+			// the mouse outside the editor producing a new selection. This weird workaround is needed since
+			// Gecko doesn't have the "selectionchange" event we need to do this. Fixes: #6843
+			if (editor.inline && !documentMouseUpHandler) {
+				documentMouseUpHandler = function(e) {
+					var activeEditor = editorManager.activeEditor;
+
+					if (activeEditor.inline && !activeEditor.dom.isChildOf(e.target, activeEditor.getBody())) {
+						var rng = activeEditor.selection.getRng();
+
+						if (!rng.collapsed) {
+							activeEditor.lastRng = rng;
+						}
+					}
+				};
+
+				DOM.bind(document, 'mouseup', documentMouseUpHandler);
+			}
+		}
+
+		function unregisterDocumentEvents(e) {
+			if (editorManager.focusedEditor == e.editor) {
+				editorManager.focusedEditor = null;
+			}
+
+			if (!editorManager.activeEditor) {
+				DOM.unbind(document, 'selectionchange', selectionChangeHandler);
+				DOM.unbind(document, 'focusin', documentFocusInHandler);
+				DOM.unbind(document, 'mouseup', documentMouseUpHandler);
+				selectionChangeHandler = documentFocusInHandler = documentMouseUpHandler = null;
+			}
+		}
+
+		editorManager.on('AddEditor', registerEvents);
+		editorManager.on('RemoveEditor', unregisterDocumentEvents);
+	}
+
+	/**
+	 * Returns true if the specified element is part of the UI for example an button or text input.
+	 *
+	 * @method isEditorUIElement
+	 * @param  {Element} elm Element to check if it's part of the UI or not.
+	 * @return {Boolean} True/false state if the element is part of the UI or not.
+	 */
+	FocusManager.isEditorUIElement = function(elm) {
+		// Needs to be converted to string since svg can have focus: #6776
+		return elm.className.toString().indexOf('mce-') !== -1;
+	};
+
+	return FocusManager;
+});
+
+// Included from: js/tinymce/classes/EditorManager.js
+
+/**
+ * EditorManager.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class used as a factory for manager for tinymce.Editor instances.
+ *
+ * @example
+ * tinymce.EditorManager.init({});
+ *
+ * @class tinymce.EditorManager
+ * @mixes tinymce.util.Observable
+ * @static
+ */
+define("tinymce/EditorManager", [
+	"tinymce/Editor",
+	"tinymce/dom/DomQuery",
+	"tinymce/dom/DOMUtils",
+	"tinymce/util/URI",
+	"tinymce/Env",
+	"tinymce/util/Tools",
+	"tinymce/util/Observable",
+	"tinymce/util/I18n",
+	"tinymce/FocusManager"
+], function(Editor, DomQuery, DOMUtils, URI, Env, Tools, Observable, I18n, FocusManager) {
+	var DOM = DOMUtils.DOM;
+	var explode = Tools.explode, each = Tools.each, extend = Tools.extend;
+	var instanceCounter = 0, beforeUnloadDelegate, EditorManager;
+
+	function removeEditorFromList(editor) {
+		var editors = EditorManager.editors, removedFromList;
+
+		delete editors[editor.id];
+
+		for (var i = 0; i < editors.length; i++) {
+			if (editors[i] == editor) {
+				editors.splice(i, 1);
+				removedFromList = true;
+				break;
+			}
+		}
+
+		// Select another editor since the active one was removed
+		if (EditorManager.activeEditor == editor) {
+			EditorManager.activeEditor = editors[0];
+		}
+
+		// Clear focusedEditor if necessary, so that we don't try to blur the destroyed editor
+		if (EditorManager.focusedEditor == editor) {
+			EditorManager.focusedEditor = null;
+		}
+
+		return removedFromList;
+	}
+
+	function purgeDestroyedEditor(editor) {
+		// User has manually destroyed the editor lets clean up the mess
+		if (editor && !(editor.getContainer() || editor.getBody()).parentNode) {
+			removeEditorFromList(editor);
+			editor.unbindAllNativeEvents();
+			editor.destroy(true);
+			editor = null;
+		}
+
+		return editor;
+	}
+
+	EditorManager = {
+		/**
+		 * Dom query instance.
+		 *
+		 * @property $
+		 * @type tinymce.dom.DomQuery
+		 */
+		$: DomQuery,
+
+		/**
+		 * Major version of TinyMCE build.
+		 *
+		 * @property majorVersion
+		 * @type String
+		 */
+		majorVersion: '4',
+
+		/**
+		 * Minor version of TinyMCE build.
+		 *
+		 * @property minorVersion
+		 * @type String
+		 */
+		minorVersion: '1.10',
+
+		/**
+		 * Release date of TinyMCE build.
+		 *
+		 * @property releaseDate
+		 * @type String
+		 */
+		releaseDate: '2015-05-05',
+
+		/**
+		 * Collection of editor instances.
+		 *
+		 * @property editors
+		 * @type Object
+		 * @example
+		 * for (edId in tinymce.editors)
+		 *     tinymce.editors[edId].save();
+		 */
+		editors: [],
+
+		/**
+		 * Collection of language pack data.
+		 *
+		 * @property i18n
+		 * @type Object
+		 */
+		i18n: I18n,
+
+		/**
+		 * Currently active editor instance.
+		 *
+		 * @property activeEditor
+		 * @type tinymce.Editor
+		 * @example
+		 * tinyMCE.activeEditor.selection.getContent();
+		 * tinymce.EditorManager.activeEditor.selection.getContent();
+		 */
+		activeEditor: null,
+
+		setup: function() {
+			var self = this, baseURL, documentBaseURL, suffix = "", preInit, src;
+
+			// Get base URL for the current document
+			documentBaseURL = document.location.href;
+
+			// Check if the URL is a document based format like: http://site/dir/file and file:///
+			// leave other formats like applewebdata://... intact
+			if (/^[^:]+:\/\/\/?[^\/]+\//.test(documentBaseURL)) {
+				documentBaseURL = documentBaseURL.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, '');
+
+				if (!/[\/\\]$/.test(documentBaseURL)) {
+					documentBaseURL += '/';
+				}
+			}
+
+			// If tinymce is defined and has a base use that or use the old tinyMCEPreInit
+			preInit = window.tinymce || window.tinyMCEPreInit;
+			if (preInit) {
+				baseURL = preInit.base || preInit.baseURL;
+				suffix = preInit.suffix;
+			} else {
+				// Get base where the tinymce script is located
+				var scripts = document.getElementsByTagName('script');
+				for (var i = 0; i < scripts.length; i++) {
+					src = scripts[i].src;
+
+					// Script types supported:
+					// tinymce.js tinymce.min.js tinymce.dev.js
+					// tinymce.jquery.js tinymce.jquery.min.js tinymce.jquery.dev.js
+					// tinymce.full.js tinymce.full.min.js tinymce.full.dev.js
+					if (/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(src)) {
+						if (src.indexOf('.min') != -1) {
+							suffix = '.min';
+						}
+
+						baseURL = src.substring(0, src.lastIndexOf('/'));
+						break;
+					}
+				}
+
+				// We didn't find any baseURL by looking at the script elements
+				// Try to use the document.currentScript as a fallback
+				if (!baseURL && document.currentScript) {
+					src = document.currentScript.src;
+
+					if (src.indexOf('.min') != -1) {
+						suffix = '.min';
+					}
+
+					baseURL = src.substring(0, src.lastIndexOf('/'));
+				}
+			}
+
+			/**
+			 * Base URL where the root directory if TinyMCE is located.
+			 *
+			 * @property baseURL
+			 * @type String
+			 */
+			self.baseURL = new URI(documentBaseURL).toAbsolute(baseURL);
+
+			/**
+			 * Document base URL where the current document is located.
+			 *
+			 * @property documentBaseURL
+			 * @type String
+			 */
+			self.documentBaseURL = documentBaseURL;
+
+			/**
+			 * Absolute baseURI for the installation path of TinyMCE.
+			 *
+			 * @property baseURI
+			 * @type tinymce.util.URI
+			 */
+			self.baseURI = new URI(self.baseURL);
+
+			/**
+			 * Current suffix to add to each plugin/theme that gets loaded for example ".min".
+			 *
+			 * @property suffix
+			 * @type String
+			 */
+			self.suffix = suffix;
+
+			self.focusManager = new FocusManager(self);
+		},
+
+		/**
+		 * Initializes a set of editors. This method will create editors based on various settings.
+		 *
+		 * @method init
+		 * @param {Object} settings Settings object to be passed to each editor instance.
+		 * @example
+		 * // Initializes a editor using the longer method
+		 * tinymce.EditorManager.init({
+		 *    some_settings : 'some value'
+		 * });
+		 *
+		 * // Initializes a editor instance using the shorter version
+		 * tinyMCE.init({
+		 *    some_settings : 'some value'
+		 * });
+		 */
+		init: function(settings) {
+			var self = this, editors = [];
+
+			function createId(elm) {
+				var id = elm.id;
+
+				// Use element id, or unique name or generate a unique id
+				if (!id) {
+					id = elm.name;
+
+					if (id && !DOM.get(id)) {
+						id = elm.name;
+					} else {
+						// Generate unique name
+						id = DOM.uniqueId();
+					}
+
+					elm.setAttribute('id', id);
+				}
+
+				return id;
+			}
+
+			function createEditor(id, settings, targetElm) {
+				if (!purgeDestroyedEditor(self.get(id))) {
+					var editor = new Editor(id, settings, self);
+
+					editor.targetElm = editor.targetElm || targetElm;
+					editors.push(editor);
+					editor.render();
+				}
+			}
+
+			function execCallback(name) {
+				var callback = settings[name];
+
+				if (!callback) {
+					return;
+				}
+
+				return callback.apply(self, Array.prototype.slice.call(arguments, 2));
+			}
+
+			function hasClass(elm, className) {
+				return className.constructor === RegExp ? className.test(elm.className) : DOM.hasClass(elm, className);
+			}
+
+			function readyHandler() {
+				var l, co;
+
+				DOM.unbind(window, 'ready', readyHandler);
+
+				execCallback('onpageload');
+
+				if (settings.types) {
+					// Process type specific selector
+					each(settings.types, function(type) {
+						each(DOM.select(type.selector), function(elm) {
+							createEditor(createId(elm), extend({}, settings, type), elm);
+						});
+					});
+
+					return;
+				} else if (settings.selector) {
+					// Process global selector
+					each(DOM.select(settings.selector), function(elm) {
+						createEditor(createId(elm), settings, elm);
+					});
+
+					return;
+				} else if (settings.target) {
+					createEditor(createId(settings.target), settings);
+				}
+
+				// Fallback to old setting
+				switch (settings.mode) {
+					case "exact":
+						l = settings.elements || '';
+
+						if (l.length > 0) {
+							each(explode(l), function(id) {
+								var elm;
+
+								if ((elm = DOM.get(id))) {
+									createEditor(id, settings, elm);
+								} else {
+									each(document.forms, function(f) {
+										each(f.elements, function(e) {
+											if (e.name === id) {
+												id = 'mce_editor_' + instanceCounter++;
+												DOM.setAttrib(e, 'id', id);
+												createEditor(id, settings, e);
+											}
+										});
+									});
+								}
+							});
+						}
+						break;
+
+					case "textareas":
+					case "specific_textareas":
+						each(DOM.select('textarea'), function(elm) {
+							if (settings.editor_deselector && hasClass(elm, settings.editor_deselector)) {
+								return;
+							}
+
+							if (!settings.editor_selector || hasClass(elm, settings.editor_selector)) {
+								createEditor(createId(elm), settings, elm);
+							}
+						});
+						break;
+				}
+
+				// Call onInit when all editors are initialized
+				if (settings.oninit) {
+					l = co = 0;
+
+					each(editors, function(ed) {
+						co++;
+
+						if (!ed.initialized) {
+							// Wait for it
+							ed.on('init', function() {
+								l++;
+
+								// All done
+								if (l == co) {
+									execCallback('oninit');
+								}
+							});
+						} else {
+							l++;
+						}
+
+						// All done
+						if (l == co) {
+							execCallback('oninit');
+						}
+					});
+				}
+			}
+
+			self.settings = settings;
+
+			DOM.bind(window, 'ready', readyHandler);
+		},
+
+		/**
+		 * Returns a editor instance by id.
+		 *
+		 * @method get
+		 * @param {String/Number} id Editor instance id or index to return.
+		 * @return {tinymce.Editor} Editor instance to return.
+		 * @example
+		 * // Adds an onclick event to an editor by id (shorter version)
+		 * tinymce.get('mytextbox').on('click', function(e) {
+		 *    ed.windowManager.alert('Hello world!');
+		 * });
+		 *
+		 * // Adds an onclick event to an editor by id (longer version)
+		 * tinymce.EditorManager.get('mytextbox').on('click', function(e) {
+		 *    ed.windowManager.alert('Hello world!');
+		 * });
+		 */
+		get: function(id) {
+			if (!arguments.length) {
+				return this.editors;
+			}
+
+			return id in this.editors ? this.editors[id] : null;
+		},
+
+		/**
+		 * Adds an editor instance to the editor collection. This will also set it as the active editor.
+		 *
+		 * @method add
+		 * @param {tinymce.Editor} editor Editor instance to add to the collection.
+		 * @return {tinymce.Editor} The same instance that got passed in.
+		 */
+		add: function(editor) {
+			var self = this, editors = self.editors;
+
+			// Add named and index editor instance
+			editors[editor.id] = editor;
+			editors.push(editor);
+
+			// Doesn't call setActive method since we don't want
+			// to fire a bunch of activate/deactivate calls while initializing
+			self.activeEditor = editor;
+
+			/**
+			 * Fires when an editor is added to the EditorManager collection.
+			 *
+			 * @event AddEditor
+			 * @param {Object} e Event arguments.
+			 */
+			self.fire('AddEditor', {editor: editor});
+
+			if (!beforeUnloadDelegate) {
+				beforeUnloadDelegate = function() {
+					self.fire('BeforeUnload');
+				};
+
+				DOM.bind(window, 'beforeunload', beforeUnloadDelegate);
+			}
+
+			return editor;
+		},
+
+		/**
+		 * Creates an editor instance and adds it to the EditorManager collection.
+		 *
+		 * @method createEditor
+		 * @param {String} id Instance id to use for editor.
+		 * @param {Object} settings Editor instance settings.
+		 * @return {tinymce.Editor} Editor instance that got created.
+		 */
+		createEditor: function(id, settings) {
+			return this.add(new Editor(id, settings, this));
+		},
+
+		/**
+		 * Removes a editor or editors form page.
+		 *
+		 * @example
+		 * // Remove all editors bound to divs
+		 * tinymce.remove('div');
+		 *
+		 * // Remove all editors bound to textareas
+		 * tinymce.remove('textarea');
+		 *
+		 * // Remove all editors
+		 * tinymce.remove();
+		 *
+		 * // Remove specific instance by id
+		 * tinymce.remove('#id');
+		 *
+		 * @method remove
+		 * @param {tinymce.Editor/String/Object} [selector] CSS selector or editor instance to remove.
+		 * @return {tinymce.Editor} The editor that got passed in will be return if it was found otherwise null.
+		 */
+		remove: function(selector) {
+			var self = this, i, editors = self.editors, editor;
+
+			// Remove all editors
+			if (!selector) {
+				for (i = editors.length - 1; i >= 0; i--) {
+					self.remove(editors[i]);
+				}
+
+				return;
+			}
+
+			// Remove editors by selector
+			if (typeof selector == "string") {
+				selector = selector.selector || selector;
+
+				each(DOM.select(selector), function(elm) {
+					editor = editors[elm.id];
+
+					if (editor) {
+						self.remove(editor);
+					}
+				});
+
+				return;
+			}
+
+			// Remove specific editor
+			editor = selector;
+
+			// Not in the collection
+			if (!editors[editor.id]) {
+				return null;
+			}
+
+			/**
+			 * Fires when an editor is removed from EditorManager collection.
+			 *
+			 * @event RemoveEditor
+			 * @param {Object} e Event arguments.
+			 */
+			if (removeEditorFromList(editor)) {
+				self.fire('RemoveEditor', {editor: editor});
+			}
+
+			if (!editors.length) {
+				DOM.unbind(window, 'beforeunload', beforeUnloadDelegate);
+			}
+
+			editor.remove();
+
+			return editor;
+		},
+
+		/**
+		 * Executes a specific command on the currently active editor.
+		 *
+		 * @method execCommand
+		 * @param {String} c Command to perform for example Bold.
+		 * @param {Boolean} u Optional boolean state if a UI should be presented for the command or not.
+		 * @param {String} v Optional value parameter like for example an URL to a link.
+		 * @return {Boolean} true/false if the command was executed or not.
+		 */
+		execCommand: function(cmd, ui, value) {
+			var self = this, editor = self.get(value);
+
+			// Manager commands
+			switch (cmd) {
+				case "mceAddEditor":
+					if (!self.get(value)) {
+						new Editor(value, self.settings, self).render();
+					}
+
+					return true;
+
+				case "mceRemoveEditor":
+					if (editor) {
+						editor.remove();
+					}
+
+					return true;
+
+				case 'mceToggleEditor':
+					if (!editor) {
+						self.execCommand('mceAddEditor', 0, value);
+						return true;
+					}
+
+					if (editor.isHidden()) {
+						editor.show();
+					} else {
+						editor.hide();
+					}
+
+					return true;
+			}
+
+			// Run command on active editor
+			if (self.activeEditor) {
+				return self.activeEditor.execCommand(cmd, ui, value);
+			}
+
+			return false;
+		},
+
+		/**
+		 * Calls the save method on all editor instances in the collection. This can be useful when a form is to be submitted.
+		 *
+		 * @method triggerSave
+		 * @example
+		 * // Saves all contents
+		 * tinyMCE.triggerSave();
+		 */
+		triggerSave: function() {
+			each(this.editors, function(editor) {
+				editor.save();
+			});
+		},
+
+		/**
+		 * Adds a language pack, this gets called by the loaded language files like en.js.
+		 *
+		 * @method addI18n
+		 * @param {String} code Optional language code.
+		 * @param {Object} items Name/value object with translations.
+		 */
+		addI18n: function(code, items) {
+			I18n.add(code, items);
+		},
+
+		/**
+		 * Translates the specified string using the language pack items.
+		 *
+		 * @method translate
+		 * @param {String/Array/Object} text String to translate
+		 * @return {String} Translated string.
+		 */
+		translate: function(text) {
+			return I18n.translate(text);
+		},
+
+		/**
+		 * Sets the active editor instance and fires the deactivate/activate events.
+		 *
+		 * @method setActive
+		 * @param {tinymce.Editor} editor Editor instance to set as the active instance.
+		 */
+		setActive: function(editor) {
+			var activeEditor = this.activeEditor;
+
+			if (this.activeEditor != editor) {
+				if (activeEditor) {
+					activeEditor.fire('deactivate', {relatedTarget: editor});
+				}
+
+				editor.fire('activate', {relatedTarget: activeEditor});
+			}
+
+			this.activeEditor = editor;
+		}
+	};
+
+	extend(EditorManager, Observable);
+
+	EditorManager.setup();
+
+	// Export EditorManager as tinymce/tinymce in global namespace
+	window.tinymce = window.tinyMCE = EditorManager;
+
+	return EditorManager;
+});
+
+// Included from: js/tinymce/classes/LegacyInput.js
+
+/**
+ * LegacyInput.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+define("tinymce/LegacyInput", [
+	"tinymce/EditorManager",
+	"tinymce/util/Tools"
+], function(EditorManager, Tools) {
+	var each = Tools.each, explode = Tools.explode;
+
+	EditorManager.on('AddEditor', function(e) {
+		var editor = e.editor;
+
+		editor.on('preInit', function() {
+			var filters, fontSizes, dom, settings = editor.settings;
+
+			function replaceWithSpan(node, styles) {
+				each(styles, function(value, name) {
+					if (value) {
+						dom.setStyle(node, name, value);
+					}
+				});
+
+				dom.rename(node, 'span');
+			}
+
+			function convert(e) {
+				dom = editor.dom;
+
+				if (settings.convert_fonts_to_spans) {
+					each(dom.select('font,u,strike', e.node), function(node) {
+						filters[node.nodeName.toLowerCase()](dom, node);
+					});
+				}
+			}
+
+			if (settings.inline_styles) {
+				fontSizes = explode(settings.font_size_legacy_values);
+
+				filters = {
+					font: function(dom, node) {
+						replaceWithSpan(node, {
+							backgroundColor: node.style.backgroundColor,
+							color: node.color,
+							fontFamily: node.face,
+							fontSize: fontSizes[parseInt(node.size, 10) - 1]
+						});
+					},
+
+					u: function(dom, node) {
+						// HTML5 allows U element
+						if (editor.settings.schema === "html4") {
+							replaceWithSpan(node, {
+								textDecoration: 'underline'
+							});
+						}
+					},
+
+					strike: function(dom, node) {
+						replaceWithSpan(node, {
+							textDecoration: 'line-through'
+						});
+					}
+				};
+
+				editor.on('PreProcess SetContent', convert);
+			}
+		});
+	});
+});
+
+// Included from: js/tinymce/classes/util/XHR.js
+
+/**
+ * XHR.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class enables you to send XMLHTTPRequests cross browser.
+ * @class tinymce.util.XHR
+ * @mixes tinymce.util.Observable
+ * @static
+ * @example
+ * // Sends a low level Ajax request
+ * tinymce.util.XHR.send({
+ *    url: 'someurl',
+ *    success: function(text) {
+ *       console.debug(text);
+ *    }
+ * });
+ *
+ * // Add custom header to XHR request
+ * tinymce.util.XHR.on('beforeSend', function(e) {
+ *     e.xhr.setRequestHeader('X-Requested-With', 'Something');
+ * });
+ */
+define("tinymce/util/XHR", [
+	"tinymce/util/Observable",
+	"tinymce/util/Tools"
+], function(Observable, Tools) {
+	var XHR = {
+		/**
+		 * Sends a XMLHTTPRequest.
+		 * Consult the Wiki for details on what settings this method takes.
+		 *
+		 * @method send
+		 * @param {Object} settings Object will target URL, callbacks and other info needed to make the request.
+		 */
+		send: function(settings) {
+			var xhr, count = 0;
+
+			function ready() {
+				if (!settings.async || xhr.readyState == 4 || count++ > 10000) {
+					if (settings.success && count < 10000 && xhr.status == 200) {
+						settings.success.call(settings.success_scope, '' + xhr.responseText, xhr, settings);
+					} else if (settings.error) {
+						settings.error.call(settings.error_scope, count > 10000 ? 'TIMED_OUT' : 'GENERAL', xhr, settings);
+					}
+
+					xhr = null;
+				} else {
+					setTimeout(ready, 10);
+				}
+			}
+
+			// Default settings
+			settings.scope = settings.scope || this;
+			settings.success_scope = settings.success_scope || settings.scope;
+			settings.error_scope = settings.error_scope || settings.scope;
+			settings.async = settings.async === false ? false : true;
+			settings.data = settings.data || '';
+
+			xhr = new XMLHttpRequest();
+
+			if (xhr) {
+				if (xhr.overrideMimeType) {
+					xhr.overrideMimeType(settings.content_type);
+				}
+
+				xhr.open(settings.type || (settings.data ? 'POST' : 'GET'), settings.url, settings.async);
+
+				if (settings.crossDomain) {
+					xhr.withCredentials = true;
+				}
+
+				if (settings.content_type) {
+					xhr.setRequestHeader('Content-Type', settings.content_type);
+				}
+
+				xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
+
+				xhr = XHR.fire('beforeSend', {xhr: xhr, settings: settings}).xhr;
+				xhr.send(settings.data);
+
+				// Syncronous request
+				if (!settings.async) {
+					return ready();
+				}
+
+				// Wait for response, onReadyStateChange can not be used since it leaks memory in IE
+				setTimeout(ready, 10);
+			}
+		}
+	};
+
+	Tools.extend(XHR, Observable);
+
+	return XHR;
+});
+
+// Included from: js/tinymce/classes/util/JSON.js
+
+/**
+ * JSON.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * JSON parser and serializer class.
+ *
+ * @class tinymce.util.JSON
+ * @static
+ * @example
+ * // JSON parse a string into an object
+ * var obj = tinymce.util.JSON.parse(somestring);
+ *
+ * // JSON serialize a object into an string
+ * var str = tinymce.util.JSON.serialize(obj);
+ */
+define("tinymce/util/JSON", [], function() {
+	function serialize(o, quote) {
+		var i, v, t, name;
+
+		quote = quote || '"';
+
+		if (o === null) {
+			return 'null';
+		}
+
+		t = typeof o;
+
+		if (t == 'string') {
+			v = '\bb\tt\nn\ff\rr\""\'\'\\\\';
+
+			return quote + o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g, function(a, b) {
+				// Make sure single quotes never get encoded inside double quotes for JSON compatibility
+				if (quote === '"' && a === "'") {
+					return a;
+				}
+
+				i = v.indexOf(b);
+
+				if (i + 1) {
+					return '\\' + v.charAt(i + 1);
+				}
+
+				a = b.charCodeAt().toString(16);
+
+				return '\\u' + '0000'.substring(a.length) + a;
+			}) + quote;
+		}
+
+		if (t == 'object') {
+			if (o.hasOwnProperty && Object.prototype.toString.call(o) === '[object Array]') {
+				for (i = 0, v = '['; i < o.length; i++) {
+					v += (i > 0 ? ',' : '') + serialize(o[i], quote);
+				}
+
+				return v + ']';
+			}
+
+			v = '{';
+
+			for (name in o) {
+				if (o.hasOwnProperty(name)) {
+					v += typeof o[name] != 'function' ? (v.length > 1 ? ',' + quote : quote) + name +
+						quote + ':' + serialize(o[name], quote) : '';
+				}
+			}
+
+			return v + '}';
+		}
+
+		return '' + o;
+	}
+
+	return {
+		/**
+		 * Serializes the specified object as a JSON string.
+		 *
+		 * @method serialize
+		 * @param {Object} obj Object to serialize as a JSON string.
+		 * @param {String} quote Optional quote string defaults to ".
+		 * @return {string} JSON string serialized from input.
+		 */
+		serialize: serialize,
+
+		/**
+		 * Unserializes/parses the specified JSON string into a object.
+		 *
+		 * @method parse
+		 * @param {string} s JSON String to parse into a JavaScript object.
+		 * @return {Object} Object from input JSON string or undefined if it failed.
+		 */
+		parse: function(text) {
+			try {
+				// Trick uglify JS
+				return window[String.fromCharCode(101) + 'val']('(' + text + ')');
+			} catch (ex) {
+				// Ignore
+			}
+		}
+
+		/**#@-*/
+	};
+});
+
+// Included from: js/tinymce/classes/util/JSONRequest.js
+
+/**
+ * JSONRequest.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class enables you to use JSON-RPC to call backend methods.
+ *
+ * @class tinymce.util.JSONRequest
+ * @example
+ * var json = new tinymce.util.JSONRequest({
+ *     url: 'somebackend.php'
+ * });
+ *
+ * // Send RPC call 1
+ * json.send({
+ *     method: 'someMethod1',
+ *     params: ['a', 'b'],
+ *     success: function(result) {
+ *         console.dir(result);
+ *     }
+ * });
+ *
+ * // Send RPC call 2
+ * json.send({
+ *     method: 'someMethod2',
+ *     params: ['a', 'b'],
+ *     success: function(result) {
+ *         console.dir(result);
+ *     }
+ * });
+ */
+define("tinymce/util/JSONRequest", [
+	"tinymce/util/JSON",
+	"tinymce/util/XHR",
+	"tinymce/util/Tools"
+], function(JSON, XHR, Tools) {
+	var extend = Tools.extend;
+
+	function JSONRequest(settings) {
+		this.settings = extend({}, settings);
+		this.count = 0;
+	}
+
+	/**
+	 * Simple helper function to send a JSON-RPC request without the need to initialize an object.
+	 * Consult the Wiki API documentation for more details on what you can pass to this function.
+	 *
+	 * @method sendRPC
+	 * @static
+	 * @param {Object} o Call object where there are three field id, method and params this object should also contain callbacks etc.
+	 */
+	JSONRequest.sendRPC = function(o) {
+		return new JSONRequest().send(o);
+	};
+
+	JSONRequest.prototype = {
+		/**
+		 * Sends a JSON-RPC call. Consult the Wiki API documentation for more details on what you can pass to this function.
+		 *
+		 * @method send
+		 * @param {Object} args Call object where there are three field id, method and params this object should also contain callbacks etc.
+		 */
+		send: function(args) {
+			var ecb = args.error, scb = args.success;
+
+			args = extend(this.settings, args);
+
+			args.success = function(c, x) {
+				c = JSON.parse(c);
+
+				if (typeof c == 'undefined') {
+					c = {
+						error: 'JSON Parse error.'
+					};
+				}
+
+				if (c.error) {
+					ecb.call(args.error_scope || args.scope, c.error, x);
+				} else {
+					scb.call(args.success_scope || args.scope, c.result);
+				}
+			};
+
+			args.error = function(ty, x) {
+				if (ecb) {
+					ecb.call(args.error_scope || args.scope, ty, x);
+				}
+			};
+
+			args.data = JSON.serialize({
+				id: args.id || 'c' + (this.count++),
+				method: args.method,
+				params: args.params
+			});
+
+			// JSON content type for Ruby on rails. Bug: #1883287
+			args.content_type = 'application/json';
+
+			XHR.send(args);
+		}
+	};
+
+	return JSONRequest;
+});
+
+// Included from: js/tinymce/classes/util/JSONP.js
+
+/**
+ * JSONP.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+define("tinymce/util/JSONP", [
+	"tinymce/dom/DOMUtils"
+], function(DOMUtils) {
+	return {
+		callbacks: {},
+		count: 0,
+
+		send: function(settings) {
+			var self = this, dom = DOMUtils.DOM, count = settings.count !== undefined ? settings.count : self.count;
+			var id = 'tinymce_jsonp_' + count;
+
+			self.callbacks[count] = function(json) {
+				dom.remove(id);
+				delete self.callbacks[count];
+
+				settings.callback(json);
+			};
+
+			dom.add(dom.doc.body, 'script', {
+				id: id,
+				src: settings.url,
+				type: 'text/javascript'
+			});
+
+			self.count++;
+		}
+	};
+});
+
+// Included from: js/tinymce/classes/util/LocalStorage.js
+
+/**
+ * LocalStorage.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class will simulate LocalStorage on IE 7 and return the native version on modern browsers.
+ * Storage is done using userData on IE 7 and a special serialization format. The format is designed
+ * to be as small as possible by making sure that the keys and values doesn't need to be encoded. This
+ * makes it possible to store for example HTML data.
+ *
+ * Storage format for userData:
+ * <base 32 key length>,<key string>,<base 32 value length>,<value>,...
+ *
+ * For example this data key1=value1,key2=value2 would be:
+ * 4,key1,6,value1,4,key2,6,value2
+ *
+ * @class tinymce.util.LocalStorage
+ * @static
+ * @version 4.0
+ * @example
+ * tinymce.util.LocalStorage.setItem('key', 'value');
+ * var value = tinymce.util.LocalStorage.getItem('key');
+ */
+define("tinymce/util/LocalStorage", [], function() {
+	var LocalStorage, storageElm, items, keys, userDataKey, hasOldIEDataSupport;
+
+	// Check for native support
+	try {
+		if (window.localStorage) {
+			return localStorage;
+		}
+	} catch (ex) {
+		// Ignore
+	}
+
+	userDataKey = "tinymce";
+	storageElm = document.documentElement;
+	hasOldIEDataSupport = !!storageElm.addBehavior;
+
+	if (hasOldIEDataSupport) {
+		storageElm.addBehavior('#default#userData');
+	}
+
+	/**
+	 * Gets the keys names and updates LocalStorage.length property. Since IE7 doesn't have any getters/setters.
+	 */
+	function updateKeys() {
+		keys = [];
+
+		for (var key in items) {
+			keys.push(key);
+		}
+
+		LocalStorage.length = keys.length;
+	}
+
+	/**
+	 * Loads the userData string and parses it into the items structure.
+	 */
+	function load() {
+		var key, data, value, pos = 0;
+
+		items = {};
+
+		// localStorage can be disabled on WebKit/Gecko so make a dummy storage
+		if (!hasOldIEDataSupport) {
+			return;
+		}
+
+		function next(end) {
+			var value, nextPos;
+
+			nextPos = end !== undefined ? pos + end : data.indexOf(',', pos);
+			if (nextPos === -1 || nextPos > data.length) {
+				return null;
+			}
+
+			value = data.substring(pos, nextPos);
+			pos = nextPos + 1;
+
+			return value;
+		}
+
+		storageElm.load(userDataKey);
+		data = storageElm.getAttribute(userDataKey) || '';
+
+		do {
+			var offset = next();
+			if (offset === null) {
+				break;
+			}
+
+			key = next(parseInt(offset, 32) || 0);
+			if (key !== null) {
+				offset = next();
+				if (offset === null) {
+					break;
+				}
+
+				value = next(parseInt(offset, 32) || 0);
+
+				if (key) {
+					items[key] = value;
+				}
+			}
+		} while (key !== null);
+
+		updateKeys();
+	}
+
+	/**
+	 * Saves the items structure into a the userData format.
+	 */
+	function save() {
+		var value, data = '';
+
+		// localStorage can be disabled on WebKit/Gecko so make a dummy storage
+		if (!hasOldIEDataSupport) {
+			return;
+		}
+
+		for (var key in items) {
+			value = items[key];
+			data += (data ? ',' : '') + key.length.toString(32) + ',' + key + ',' + value.length.toString(32) + ',' + value;
+		}
+
+		storageElm.setAttribute(userDataKey, data);
+
+		try {
+			storageElm.save(userDataKey);
+		} catch (ex) {
+			// Ignore disk full
+		}
+
+		updateKeys();
+	}
+
+	LocalStorage = {
+		/**
+		 * Length of the number of items in storage.
+		 *
+		 * @property length
+		 * @type Number
+		 * @return {Number} Number of items in storage.
+		 */
+		//length:0,
+
+		/**
+		 * Returns the key name by index.
+		 *
+		 * @method key
+		 * @param {Number} index Index of key to return.
+		 * @return {String} Key value or null if it wasn't found.
+		 */
+		key: function(index) {
+			return keys[index];
+		},
+
+		/**
+		 * Returns the value if the specified key or null if it wasn't found.
+		 *
+		 * @method getItem
+		 * @param {String} key Key of item to retrive.
+		 * @return {String} Value of the specified item or null if it wasn't found.
+		 */
+		getItem: function(key) {
+			return key in items ? items[key] : null;
+		},
+
+		/**
+		 * Sets the value of the specified item by it's key.
+		 *
+		 * @method setItem
+		 * @param {String} key Key of the item to set.
+		 * @param {String} value Value of the item to set.
+		 */
+		setItem: function(key, value) {
+			items[key] = "" + value;
+			save();
+		},
+
+		/**
+		 * Removes the specified item by key.
+		 *
+		 * @method removeItem
+		 * @param {String} key Key of item to remove.
+		 */
+		removeItem: function(key) {
+			delete items[key];
+			save();
+		},
+
+		/**
+		 * Removes all items.
+		 *
+		 * @method clear
+		 */
+		clear: function() {
+			items = {};
+			save();
+		}
+	};
+
+	load();
+
+	return LocalStorage;
+});
+
+// Included from: js/tinymce/classes/Compat.js
+
+/**
+ * Compat.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * TinyMCE core class.
+ *
+ * @static
+ * @class tinymce
+ * @borrow-members tinymce.EditorManager
+ * @borrow-members tinymce.util.Tools
+ */
+define("tinymce/Compat", [
+	"tinymce/dom/DOMUtils",
+	"tinymce/dom/EventUtils",
+	"tinymce/dom/ScriptLoader",
+	"tinymce/AddOnManager",
+	"tinymce/util/Tools",
+	"tinymce/Env"
+], function(DOMUtils, EventUtils, ScriptLoader, AddOnManager, Tools, Env) {
+	var tinymce = window.tinymce;
+
+	/**
+	 * @property {tinymce.dom.DOMUtils} DOM Global DOM instance.
+	 * @property {tinymce.dom.ScriptLoader} ScriptLoader Global ScriptLoader instance.
+	 * @property {tinymce.AddOnManager} PluginManager Global PluginManager instance.
+	 * @property {tinymce.AddOnManager} ThemeManager Global ThemeManager instance.
+	 */
+	tinymce.DOM = DOMUtils.DOM;
+	tinymce.ScriptLoader = ScriptLoader.ScriptLoader;
+	tinymce.PluginManager = AddOnManager.PluginManager;
+	tinymce.ThemeManager = AddOnManager.ThemeManager;
+
+	tinymce.dom = tinymce.dom || {};
+	tinymce.dom.Event = EventUtils.Event;
+
+	Tools.each(Tools, function(func, key) {
+		tinymce[key] = func;
+	});
+
+	Tools.each('isOpera isWebKit isIE isGecko isMac'.split(' '), function(name) {
+		tinymce[name] = Env[name.substr(2).toLowerCase()];
+	});
+
+	return {};
+});
+
+// Describe the different namespaces
+
+/**
+ * Root level namespace this contains classes directly releated to the TinyMCE editor.
+ *
+ * @namespace tinymce
+ */
+
+/**
+ * Contains classes for handling the browsers DOM.
+ *
+ * @namespace tinymce.dom
+ */
+
+/**
+ * Contains html parser and serializer logic.
+ *
+ * @namespace tinymce.html
+ */
+
+/**
+ * Contains the different UI types such as buttons, listboxes etc.
+ *
+ * @namespace tinymce.ui
+ */
+
+/**
+ * Contains various utility classes such as json parser, cookies etc.
+ *
+ * @namespace tinymce.util
+ */
+
+// Included from: js/tinymce/classes/ui/Layout.js
+
+/**
+ * Layout.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Base layout manager class.
+ *
+ * @class tinymce.ui.Layout
+ */
+define("tinymce/ui/Layout", [
+	"tinymce/util/Class",
+	"tinymce/util/Tools"
+], function(Class, Tools) {
+	"use strict";
+
+	return Class.extend({
+		Defaults: {
+			firstControlClass: 'first',
+			lastControlClass: 'last'
+		},
+
+		/**
+		 * Constructs a layout instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 */
+		init: function(settings) {
+			this.settings = Tools.extend({}, this.Defaults, settings);
+		},
+
+		/**
+		 * This method gets invoked before the layout renders the controls.
+		 *
+		 * @method preRender
+		 * @param {tinymce.ui.Container} container Container instance to preRender.
+		 */
+		preRender: function(container) {
+			container.addClass(this.settings.containerClass, 'body');
+		},
+
+		/**
+		 * Applies layout classes to the container.
+		 *
+		 * @private
+		 */
+		applyClasses: function(container) {
+			var self = this, settings = self.settings, items, firstClass, lastClass;
+
+			items = container.items().filter(':visible');
+			firstClass = settings.firstControlClass;
+			lastClass = settings.lastControlClass;
+
+			items.each(function(item) {
+				item.removeClass(firstClass).removeClass(lastClass);
+
+				if (settings.controlClass) {
+					item.addClass(settings.controlClass);
+				}
+			});
+
+			items.eq(0).addClass(firstClass);
+			items.eq(-1).addClass(lastClass);
+		},
+
+		/**
+		 * Renders the specified container and any layout specific HTML.
+		 *
+		 * @method renderHtml
+		 * @param {tinymce.ui.Container} container Container to render HTML for.
+		 */
+		renderHtml: function(container) {
+			var self = this, settings = self.settings, items, html = '';
+
+			items = container.items();
+			items.eq(0).addClass(settings.firstControlClass);
+			items.eq(-1).addClass(settings.lastControlClass);
+
+			items.each(function(item) {
+				if (settings.controlClass) {
+					item.addClass(settings.controlClass);
+				}
+
+				html += item.renderHtml();
+			});
+
+			return html;
+		},
+
+		/**
+		 * Recalculates the positions of the controls in the specified container.
+		 *
+		 * @method recalc
+		 * @param {tinymce.ui.Container} container Container instance to recalc.
+		 */
+		recalc: function() {
+		},
+
+		/**
+		 * This method gets invoked after the layout renders the controls.
+		 *
+		 * @method postRender
+		 * @param {tinymce.ui.Container} container Container instance to postRender.
+		 */
+		postRender: function() {
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/AbsoluteLayout.js
+
+/**
+ * AbsoluteLayout.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * LayoutManager for absolute positioning. This layout manager is more of
+ * a base class for other layouts but can be created and used directly.
+ *
+ * @-x-less AbsoluteLayout.less
+ * @class tinymce.ui.AbsoluteLayout
+ * @extends tinymce.ui.Layout
+ */
+define("tinymce/ui/AbsoluteLayout", [
+	"tinymce/ui/Layout"
+], function(Layout) {
+	"use strict";
+
+	return Layout.extend({
+		Defaults: {
+			containerClass: 'abs-layout',
+			controlClass: 'abs-layout-item'
+		},
+
+		/**
+		 * Recalculates the positions of the controls in the specified container.
+		 *
+		 * @method recalc
+		 * @param {tinymce.ui.Container} container Container instance to recalc.
+		 */
+		recalc: function(container) {
+			container.items().filter(':visible').each(function(ctrl) {
+				var settings = ctrl.settings;
+
+				ctrl.layoutRect({
+					x: settings.x,
+					y: settings.y,
+					w: settings.w,
+					h: settings.h
+				});
+
+				if (ctrl.recalc) {
+					ctrl.recalc();
+				}
+			});
+		},
+
+		/**
+		 * Renders the specified container and any layout specific HTML.
+		 *
+		 * @method renderHtml
+		 * @param {tinymce.ui.Container} container Container to render HTML for.
+		 */
+		renderHtml: function(container) {
+			return '<div id="' + container._id + '-absend" class="' + container.classPrefix + 'abs-end"></div>' + this._super(container);
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/Tooltip.js
+
+/**
+ * Tooltip.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a tooltip instance.
+ *
+ * @-x-less ToolTip.less
+ * @class tinymce.ui.ToolTip
+ * @extends tinymce.ui.Control
+ * @mixes tinymce.ui.Movable
+ */
+define("tinymce/ui/Tooltip", [
+	"tinymce/ui/Control",
+	"tinymce/ui/Movable"
+], function(Control, Movable) {
+	return Control.extend({
+		Mixins: [Movable],
+
+		Defaults: {
+			classes: 'widget tooltip tooltip-n'
+		},
+
+		/**
+		 * Sets/gets the current label text.
+		 *
+		 * @method text
+		 * @param {String} [text] New label text.
+		 * @return {String|tinymce.ui.Tooltip} Current text or current label instance.
+		 */
+		text: function(value) {
+			var self = this;
+
+			if (typeof value != "undefined") {
+				self._value = value;
+
+				if (self._rendered) {
+					self.getEl().lastChild.innerHTML = self.encode(value);
+				}
+
+				return self;
+			}
+
+			return self._value;
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, prefix = self.classPrefix;
+
+			return (
+				'<div id="' + self._id + '" class="' + self.classes() + '" role="presentation">' +
+					'<div class="' + prefix + 'tooltip-arrow"></div>' +
+					'<div class="' + prefix + 'tooltip-inner">' + self.encode(self._text) + '</div>' +
+				'</div>'
+			);
+		},
+
+		/**
+		 * Repaints the control after a layout operation.
+		 *
+		 * @method repaint
+		 */
+		repaint: function() {
+			var self = this, style, rect;
+
+			style = self.getEl().style;
+			rect = self._layoutRect;
+
+			style.left = rect.x + 'px';
+			style.top = rect.y + 'px';
+			style.zIndex = 0xFFFF + 0xFFFF;
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/Widget.js
+
+/**
+ * Widget.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Widget base class a widget is a control that has a tooltip and some basic states.
+ *
+ * @class tinymce.ui.Widget
+ * @extends tinymce.ui.Control
+ */
+define("tinymce/ui/Widget", [
+	"tinymce/ui/Control",
+	"tinymce/ui/Tooltip"
+], function(Control, Tooltip) {
+	"use strict";
+
+	var tooltip;
+
+	var Widget = Control.extend({
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {String} tooltip Tooltip text to display when hovering.
+		 * @setting {Boolean} autofocus True if the control should be focused when rendered.
+		 * @setting {String} text Text to display inside widget.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self._super(settings);
+			settings = self.settings;
+			self.canFocus = true;
+
+			if (settings.tooltip && Widget.tooltips !== false) {
+				self.on('mouseenter', function(e) {
+					var tooltip = self.tooltip().moveTo(-0xFFFF);
+
+					if (e.control == self) {
+						var rel = tooltip.text(settings.tooltip).show().testMoveRel(self.getEl(), ['bc-tc', 'bc-tl', 'bc-tr']);
+
+						tooltip.toggleClass('tooltip-n', rel == 'bc-tc');
+						tooltip.toggleClass('tooltip-nw', rel == 'bc-tl');
+						tooltip.toggleClass('tooltip-ne', rel == 'bc-tr');
+
+						tooltip.moveRel(self.getEl(), rel);
+					} else {
+						tooltip.hide();
+					}
+				});
+
+				self.on('mouseleave mousedown click', function() {
+					self.tooltip().hide();
+				});
+			}
+
+			self.aria('label', settings.ariaLabel || settings.tooltip);
+		},
+
+		/**
+		 * Returns the current tooltip instance.
+		 *
+		 * @method tooltip
+		 * @return {tinymce.ui.Tooltip} Tooltip instance.
+		 */
+		tooltip: function() {
+			if (!tooltip) {
+				tooltip = new Tooltip({type: 'tooltip'});
+				tooltip.renderTo();
+			}
+
+			return tooltip;
+		},
+
+		/**
+		 * Sets/gets the active state of the widget.
+		 *
+		 * @method active
+		 * @param {Boolean} [state] State if the control is active.
+		 * @return {Boolean|tinymce.ui.Widget} True/false or current widget instance.
+		 */
+		active: function(state) {
+			var self = this, undef;
+
+			if (state !== undef) {
+				self.aria('pressed', state);
+				self.toggleClass('active', state);
+			}
+
+			return self._super(state);
+		},
+
+		/**
+		 * Sets/gets the disabled state of the widget.
+		 *
+		 * @method disabled
+		 * @param {Boolean} [state] State if the control is disabled.
+		 * @return {Boolean|tinymce.ui.Widget} True/false or current widget instance.
+		 */
+		disabled: function(state) {
+			var self = this, undef;
+
+			if (state !== undef) {
+				self.aria('disabled', state);
+				self.toggleClass('disabled', state);
+			}
+
+			return self._super(state);
+		},
+
+		/**
+		 * Called after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this, settings = self.settings;
+
+			self._rendered = true;
+
+			self._super();
+
+			if (!self.parent() && (settings.width || settings.height)) {
+				self.initLayoutRect();
+				self.repaint();
+			}
+
+			if (settings.autofocus) {
+				self.focus();
+			}
+		},
+
+		/**
+		 * Removes the current control from DOM and from UI collections.
+		 *
+		 * @method remove
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		remove: function() {
+			this._super();
+
+			if (tooltip) {
+				tooltip.remove();
+				tooltip = null;
+			}
+		}
+	});
+
+	return Widget;
+});
+
+// Included from: js/tinymce/classes/ui/Button.js
+
+/**
+ * Button.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is used to create buttons. You can create them directly or through the Factory.
+ *
+ * @example
+ * // Create and render a button to the body element
+ * tinymce.ui.Factory.create({
+ *     type: 'button',
+ *     text: 'My button'
+ * }).renderTo(document.body);
+ *
+ * @-x-less Button.less
+ * @class tinymce.ui.Button
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/Button", [
+	"tinymce/ui/Widget"
+], function(Widget) {
+	"use strict";
+
+	return Widget.extend({
+		Defaults: {
+			classes: "widget btn",
+			role: "button"
+		},
+
+		/**
+		 * Constructs a new button instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {String} size Size of the button small|medium|large.
+		 * @setting {String} image Image to use for icon.
+		 * @setting {String} icon Icon to use for button.
+		 */
+		init: function(settings) {
+			var self = this, size;
+
+			self.on('click mousedown', function(e) {
+				e.preventDefault();
+			});
+
+			self._super(settings);
+			size = settings.size;
+
+			if (settings.subtype) {
+				self.addClass(settings.subtype);
+			}
+
+			if (size) {
+				self.addClass('btn-' + size);
+			}
+		},
+
+		/**
+		 * Sets/gets the current button icon.
+		 *
+		 * @method icon
+		 * @param {String} [icon] New icon identifier.
+		 * @return {String|tinymce.ui.MenuButton} Current icon or current MenuButton instance.
+		 */
+		icon: function(icon) {
+			var self = this, prefix = self.classPrefix;
+
+			if (typeof icon == 'undefined') {
+				return self.settings.icon;
+			}
+
+			self.settings.icon = icon;
+			icon = icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : '';
+
+			if (self._rendered) {
+				var btnElm = self.getEl().firstChild, iconElm = btnElm.getElementsByTagName('i')[0];
+
+				if (icon) {
+					if (!iconElm || iconElm != btnElm.firstChild) {
+						iconElm = document.createElement('i');
+						btnElm.insertBefore(iconElm, btnElm.firstChild);
+					}
+
+					iconElm.className = icon;
+				} else if (iconElm) {
+					btnElm.removeChild(iconElm);
+				}
+
+				self.text(self._text); // Set text again to fix whitespace between icon + text
+			}
+
+			return self;
+		},
+
+		/**
+		 * Repaints the button for example after it's been resizes by a layout engine.
+		 *
+		 * @method repaint
+		 */
+		repaint: function() {
+			var btnStyle = this.getEl().firstChild.style;
+
+			btnStyle.width = btnStyle.height = "100%";
+
+			this._super();
+		},
+
+		/**
+		 * Sets/gets the current button text.
+		 *
+		 * @method text
+		 * @param {String} [text] New button text.
+		 * @return {String|tinymce.ui.Button} Current text or current Button instance.
+		 */
+		text: function(text) {
+			var self = this;
+
+			if (self._rendered) {
+				var textNode = self.getEl().lastChild.lastChild;
+				if (textNode) {
+					textNode.data = self.translate(text);
+				}
+			}
+
+			return self._super(text);
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, id = self._id, prefix = self.classPrefix;
+			var icon = self.settings.icon, image;
+
+			image = self.settings.image;
+			if (image) {
+				icon = 'none';
+
+				// Support for [high dpi, low dpi] image sources
+				if (typeof image != "string") {
+					image = window.getSelection ? image[0] : image[1];
+				}
+
+				image = ' style="background-image: url(\'' + image + '\')"';
+			} else {
+				image = '';
+			}
+
+			icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
+
+			return (
+				'<div id="' + id + '" class="' + self.classes() + '" tabindex="-1" aria-labelledby="' + id + '">' +
+					'<button role="presentation" type="button" tabindex="-1">' +
+						(icon ? '<i class="' + icon + '"' + image + '></i>' : '') +
+						(self._text ? (icon ? '\u00a0' : '') + self.encode(self._text) : '') +
+					'</button>' +
+				'</div>'
+			);
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/ButtonGroup.js
+
+/**
+ * ButtonGroup.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This control enables you to put multiple buttons into a group. This is
+ * useful when you want to combine similar toolbar buttons into a group.
+ *
+ * @example
+ * // Create and render a buttongroup with two buttons to the body element
+ * tinymce.ui.Factory.create({
+ *     type: 'buttongroup',
+ *     items: [
+ *         {text: 'Button A'},
+ *         {text: 'Button B'}
+ *     ]
+ * }).renderTo(document.body);
+ *
+ * @-x-less ButtonGroup.less
+ * @class tinymce.ui.ButtonGroup
+ * @extends tinymce.ui.Container
+ */
+define("tinymce/ui/ButtonGroup", [
+	"tinymce/ui/Container"
+], function(Container) {
+	"use strict";
+
+	return Container.extend({
+		Defaults: {
+			defaultType: 'button',
+			role: 'group'
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, layout = self._layout;
+
+			self.addClass('btn-group');
+			self.preRender();
+			layout.preRender(self);
+
+			return (
+				'<div id="' + self._id + '" class="' + self.classes() + '">' +
+					'<div id="' + self._id + '-body">' +
+						(self.settings.html || '') + layout.renderHtml(self) +
+					'</div>' +
+				'</div>'
+			);
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/Checkbox.js
+
+/**
+ * Checkbox.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This control creates a custom checkbox.
+ *
+ * @example
+ * // Create and render a checkbox to the body element
+ * tinymce.ui.Factory.create({
+ *     type: 'checkbox',
+ *     checked: true,
+ *     text: 'My checkbox'
+ * }).renderTo(document.body);
+ *
+ * @-x-less Checkbox.less
+ * @class tinymce.ui.Checkbox
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/Checkbox", [
+	"tinymce/ui/Widget"
+], function(Widget) {
+	"use strict";
+
+	return Widget.extend({
+		Defaults: {
+			classes: "checkbox",
+			role: "checkbox",
+			checked: false
+		},
+
+		/**
+		 * Constructs a new Checkbox instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {Boolean} checked True if the checkbox should be checked by default.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self._super(settings);
+
+			self.on('click mousedown', function(e) {
+				e.preventDefault();
+			});
+
+			self.on('click', function(e) {
+				e.preventDefault();
+
+				if (!self.disabled()) {
+					self.checked(!self.checked());
+				}
+			});
+
+			self.checked(self.settings.checked);
+		},
+
+		/**
+		 * Getter/setter function for the checked state.
+		 *
+		 * @method checked
+		 * @param {Boolean} [state] State to be set.
+		 * @return {Boolean|tinymce.ui.Checkbox} True/false or checkbox if it's a set operation.
+		 */
+		checked: function(state) {
+			var self = this;
+
+			if (typeof state != "undefined") {
+				if (state) {
+					self.addClass('checked');
+				} else {
+					self.removeClass('checked');
+				}
+
+				self._checked = state;
+				self.aria('checked', state);
+
+				return self;
+			}
+
+			return self._checked;
+		},
+
+		/**
+		 * Getter/setter function for the value state.
+		 *
+		 * @method value
+		 * @param {Boolean} [state] State to be set.
+		 * @return {Boolean|tinymce.ui.Checkbox} True/false or checkbox if it's a set operation.
+		 */
+		value: function(state) {
+			return this.checked(state);
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, id = self._id, prefix = self.classPrefix;
+
+			return (
+				'<div id="' + id + '" class="' + self.classes() + '" unselectable="on" aria-labelledby="' + id + '-al" tabindex="-1">' +
+					'<i class="' + prefix + 'ico ' + prefix + 'i-checkbox"></i>' +
+					'<span id="' + id + '-al" class="' + prefix + 'label">' + self.encode(self._text) + '</span>' +
+				'</div>'
+			);
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/ComboBox.js
+
+/**
+ * ComboBox.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class creates a combobox control. Select box that you select a value from or
+ * type a value into.
+ *
+ * @-x-less ComboBox.less
+ * @class tinymce.ui.ComboBox
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/ComboBox", [
+	"tinymce/ui/Widget",
+	"tinymce/ui/Factory",
+	"tinymce/ui/DomUtils"
+], function(Widget, Factory, DomUtils) {
+	"use strict";
+
+	return Widget.extend({
+		/**
+		 * Constructs a new control instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {String} placeholder Placeholder text to display.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self._super(settings);
+			self.addClass('combobox');
+			self.subinput = true;
+			self.ariaTarget = 'inp'; // TODO: Figure out a better way
+
+			settings = self.settings;
+			settings.menu = settings.menu || settings.values;
+
+			if (settings.menu) {
+				settings.icon = 'caret';
+			}
+
+			self.on('click', function(e) {
+				var elm = e.target, root = self.getEl();
+
+				while (elm && elm != root) {
+					if (elm.id && elm.id.indexOf('-open') != -1) {
+						self.fire('action');
+
+						if (settings.menu) {
+							self.showMenu();
+
+							if (e.aria) {
+								self.menu.items()[0].focus();
+							}
+						}
+					}
+
+					elm = elm.parentNode;
+				}
+			});
+
+			// TODO: Rework this
+			self.on('keydown', function(e) {
+				if (e.target.nodeName == "INPUT" && e.keyCode == 13) {
+					self.parents().reverse().each(function(ctrl) {
+						e.preventDefault();
+						self.fire('change');
+
+						if (ctrl.hasEventListeners('submit') && ctrl.toJSON) {
+							ctrl.fire('submit', {data: ctrl.toJSON()});
+							return false;
+						}
+					});
+				}
+			});
+
+			if (settings.placeholder) {
+				self.addClass('placeholder');
+
+				self.on('focusin', function() {
+					if (!self._hasOnChange) {
+						DomUtils.on(self.getEl('inp'), 'change', function() {
+							self.fire('change');
+						});
+
+						self._hasOnChange = true;
+					}
+
+					if (self.hasClass('placeholder')) {
+						self.getEl('inp').value = '';
+						self.removeClass('placeholder');
+					}
+				});
+
+				self.on('focusout', function() {
+					if (self.value().length === 0) {
+						self.getEl('inp').value = settings.placeholder;
+						self.addClass('placeholder');
+					}
+				});
+			}
+		},
+
+		showMenu: function() {
+			var self = this, settings = self.settings, menu;
+
+			if (!self.menu) {
+				menu = settings.menu || [];
+
+				// Is menu array then auto constuct menu control
+				if (menu.length) {
+					menu = {
+						type: 'menu',
+						items: menu
+					};
+				} else {
+					menu.type = menu.type || 'menu';
+				}
+
+				self.menu = Factory.create(menu).parent(self).renderTo(self.getContainerElm());
+				self.fire('createmenu');
+				self.menu.reflow();
+				self.menu.on('cancel', function(e) {
+					if (e.control === self.menu) {
+						self.focus();
+					}
+				});
+
+				self.menu.on('show hide', function(e) {
+					e.control.items().each(function(ctrl) {
+						ctrl.active(ctrl.value() == self.value());
+					});
+				}).fire('show');
+
+				self.menu.on('select', function(e) {
+					self.value(e.control.value());
+				});
+
+				self.on('focusin', function(e) {
+					if (e.target.tagName.toUpperCase() == 'INPUT') {
+						self.menu.hide();
+					}
+				});
+
+				self.aria('expanded', true);
+			}
+
+			self.menu.show();
+			self.menu.layoutRect({w: self.layoutRect().w});
+			self.menu.moveRel(self.getEl(), self.isRtl() ? ['br-tr', 'tr-br'] : ['bl-tl', 'tl-bl']);
+		},
+
+		/**
+		 * Getter/setter function for the control value.
+		 *
+		 * @method value
+		 * @param {String} [value] Value to be set.
+		 * @return {String|tinymce.ui.ComboBox} Value or self if it's a set operation.
+		 */
+		value: function(value) {
+			var self = this;
+
+			if (typeof value != "undefined") {
+				self._value = value;
+				self.removeClass('placeholder');
+
+				if (self._rendered) {
+					self.getEl('inp').value = value;
+				}
+
+				return self;
+			}
+
+			if (self._rendered) {
+				value = self.getEl('inp').value;
+
+				if (value != self.settings.placeholder) {
+					return value;
+				}
+
+				return '';
+			}
+
+			return self._value;
+		},
+
+		/**
+		 * Getter/setter function for the disabled state.
+		 *
+		 * @method value
+		 * @param {Boolean} [state] State to be set.
+		 * @return {Boolean|tinymce.ui.ComboBox} True/false or self if it's a set operation.
+		 */
+		disabled: function(state) {
+			var self = this;
+
+			if (self._rendered && typeof state != 'undefined') {
+				self.getEl('inp').disabled = state;
+			}
+
+			return self._super(state);
+		},
+
+		/**
+		 * Focuses the input area of the control.
+		 *
+		 * @method focus
+		 */
+		focus: function() {
+			this.getEl('inp').focus();
+		},
+
+		/**
+		 * Repaints the control after a layout operation.
+		 *
+		 * @method repaint
+		 */
+		repaint: function() {
+			var self = this, elm = self.getEl(), openElm = self.getEl('open'), rect = self.layoutRect();
+			var width, lineHeight;
+
+			if (openElm) {
+				width = rect.w - DomUtils.getSize(openElm).width - 10;
+			} else {
+				width = rect.w - 10;
+			}
+
+			// Detect old IE 7+8 add lineHeight to align caret vertically in the middle
+			var doc = document;
+			if (doc.all && (!doc.documentMode || doc.documentMode <= 8)) {
+				lineHeight = (self.layoutRect().h - 2) + 'px';
+			}
+
+			DomUtils.css(elm.firstChild, {
+				width: width,
+				lineHeight: lineHeight
+			});
+
+			self._super();
+
+			return self;
+		},
+
+		/**
+		 * Post render method. Called after the control has been rendered to the target.
+		 *
+		 * @method postRender
+		 * @return {tinymce.ui.ComboBox} Current combobox instance.
+		 */
+		postRender: function() {
+			var self = this;
+
+			DomUtils.on(this.getEl('inp'), 'change', function() {
+				self.fire('change');
+			});
+
+			return self._super();
+		},
+
+		remove: function() {
+			DomUtils.off(this.getEl('inp'));
+			this._super();
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, id = self._id, settings = self.settings, prefix = self.classPrefix;
+			var value = settings.value || settings.placeholder || '';
+			var icon, text, openBtnHtml = '', extraAttrs = '';
+
+			if ("spellcheck" in settings) {
+				extraAttrs += ' spellcheck="' + settings.spellcheck + '"';
+			}
+
+			if (settings.maxLength) {
+				extraAttrs += ' maxlength="' + settings.maxLength + '"';
+			}
+
+			if (settings.size) {
+				extraAttrs += ' size="' + settings.size + '"';
+			}
+
+			if (settings.subtype) {
+				extraAttrs += ' type="' + settings.subtype + '"';
+			}
+
+			if (self.disabled()) {
+				extraAttrs += ' disabled="disabled"';
+			}
+
+			icon = settings.icon;
+			if (icon && icon != 'caret') {
+				icon = prefix + 'ico ' + prefix + 'i-' + settings.icon;
+			}
+
+			text = self._text;
+
+			if (icon || text) {
+				openBtnHtml = (
+					'<div id="' + id + '-open" class="' + prefix + 'btn ' + prefix + 'open" tabIndex="-1" role="button">' +
+						'<button id="' + id + '-action" type="button" hidefocus="1" tabindex="-1">' +
+							(icon != 'caret' ? '<i class="' + icon + '"></i>' : '<i class="' + prefix + 'caret"></i>') +
+							(text ? (icon ? ' ' : '') + text : '') +
+						'</button>' +
+					'</div>'
+				);
+
+				self.addClass('has-open');
+			}
+
+			return (
+				'<div id="' + id + '" class="' + self.classes() + '">' +
+					'<input id="' + id + '-inp" class="' + prefix + 'textbox ' + prefix + 'placeholder" value="' +
+					value + '" hidefocus="1"' + extraAttrs + ' />' +
+					openBtnHtml +
+				'</div>'
+			);
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/ColorBox.js
+
+/**
+ * ColorBox.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This widget lets you enter colors and browse for colors by pressing the color button. It also displays
+ * a preview of the current color.
+ *
+ * @-x-less ColorBox.less
+ * @class tinymce.ui.ColorBox
+ * @extends tinymce.ui.ComboBox
+ */
+define("tinymce/ui/ColorBox", [
+	"tinymce/ui/ComboBox"
+], function(ComboBox) {
+	"use strict";
+
+	return ComboBox.extend({
+		/**
+		 * Constructs a new control instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			settings.spellcheck = false;
+
+			if (settings.onaction) {
+				settings.icon = 'none';
+			}
+
+			self._super(settings);
+
+			self.addClass('colorbox');
+			self.on('change keyup postrender', function() {
+				self.repaintColor(self.value());
+			});
+		},
+
+		repaintColor: function(value) {
+			var elm = this.getEl().getElementsByTagName('i')[0];
+
+			if (elm) {
+				try {
+					elm.style.background = value;
+				} catch (ex) {
+					// Ignore
+				}
+			}
+		},
+
+		value: function(value) {
+			var self = this;
+
+			if (typeof value != "undefined") {
+				if (self._rendered) {
+					self.repaintColor(value);
+				}
+			}
+
+			return self._super(value);
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/PanelButton.js
+
+/**
+ * PanelButton.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new panel button.
+ *
+ * @class tinymce.ui.PanelButton
+ * @extends tinymce.ui.Button
+ */
+define("tinymce/ui/PanelButton", [
+	"tinymce/ui/Button",
+	"tinymce/ui/FloatPanel"
+], function(Button, FloatPanel) {
+	"use strict";
+
+	return Button.extend({
+		/**
+		 * Shows the panel for the button.
+		 *
+		 * @method showPanel
+		 */
+		showPanel: function() {
+			var self = this, settings = self.settings;
+
+			self.active(true);
+
+			if (!self.panel) {
+				var panelSettings = settings.panel;
+
+				// Wrap panel in grid layout if type if specified
+				// This makes it possible to add forms or other containers directly in the panel option
+				if (panelSettings.type) {
+					panelSettings = {
+						layout: 'grid',
+						items: panelSettings
+					};
+				}
+
+				panelSettings.role = panelSettings.role || 'dialog';
+				panelSettings.popover = true;
+				panelSettings.autohide = true;
+				panelSettings.ariaRoot = true;
+
+				self.panel = new FloatPanel(panelSettings).on('hide', function() {
+					self.active(false);
+				}).on('cancel', function(e) {
+					e.stopPropagation();
+					self.focus();
+					self.hidePanel();
+				}).parent(self).renderTo(self.getContainerElm());
+
+				self.panel.fire('show');
+				self.panel.reflow();
+			} else {
+				self.panel.show();
+			}
+
+			self.panel.moveRel(self.getEl(), settings.popoverAlign || (self.isRtl() ? ['bc-tr', 'bc-tc'] : ['bc-tl', 'bc-tc']));
+		},
+
+		/**
+		 * Hides the panel for the button.
+		 *
+		 * @method hidePanel
+		 */
+		hidePanel: function() {
+			var self = this;
+
+			if (self.panel) {
+				self.panel.hide();
+			}
+		},
+
+		/**
+		 * Called after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this;
+
+			self.aria('haspopup', true);
+
+			self.on('click', function(e) {
+				if (e.control === self) {
+					if (self.panel && self.panel.visible()) {
+						self.hidePanel();
+					} else {
+						self.showPanel();
+						self.panel.focus(!!e.aria);
+					}
+				}
+			});
+
+			return self._super();
+		},
+
+		remove: function() {
+			if (this.panel) {
+				this.panel.remove();
+				this.panel = null;
+			}
+
+			return this._super();
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/ColorButton.js
+
+/**
+ * ColorButton.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class creates a color button control. This is a split button in which the main
+ * button has a visual representation of the currently selected color. When clicked
+ * the caret button displays a color picker, allowing the user to select a new color.
+ *
+ * @-x-less ColorButton.less
+ * @class tinymce.ui.ColorButton
+ * @extends tinymce.ui.PanelButton
+ */
+define("tinymce/ui/ColorButton", [
+	"tinymce/ui/PanelButton",
+	"tinymce/dom/DOMUtils"
+], function(PanelButton, DomUtils) {
+	"use strict";
+
+	var DOM = DomUtils.DOM;
+
+	return PanelButton.extend({
+		/**
+		 * Constructs a new ColorButton instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 */
+		init: function(settings) {
+			this._super(settings);
+			this.addClass('colorbutton');
+		},
+
+		/**
+		 * Getter/setter for the current color.
+		 *
+		 * @method color
+		 * @param {String} [color] Color to set.
+		 * @return {String|tinymce.ui.ColorButton} Current color or current instance.
+		 */
+		color: function(color) {
+			if (color) {
+				this._color = color;
+				this.getEl('preview').style.backgroundColor = color;
+				return this;
+			}
+
+			return this._color;
+		},
+
+		/**
+		 * Resets the current color.
+		 *
+		 * @method resetColor
+		 * @return {tinymce.ui.ColorButton} Current instance.
+		 */
+		resetColor: function() {
+			this._color = null;
+			this.getEl('preview').style.backgroundColor = null;
+			return this;
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, id = self._id, prefix = self.classPrefix;
+			var icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : '';
+			var image = self.settings.image ? ' style="background-image: url(\'' + self.settings.image + '\')"' : '';
+
+			return (
+				'<div id="' + id + '" class="' + self.classes() + '" role="button" tabindex="-1" aria-haspopup="true">' +
+					'<button role="presentation" hidefocus="1" type="button" tabindex="-1">' +
+						(icon ? '<i class="' + icon + '"' + image + '></i>' : '') +
+						'<span id="' + id + '-preview" class="' + prefix + 'preview"></span>' +
+						(self._text ? (icon ? ' ' : '') + (self._text) : '') +
+					'</button>' +
+					'<button type="button" class="' + prefix + 'open" hidefocus="1" tabindex="-1">' +
+						' <i class="' + prefix + 'caret"></i>' +
+					'</button>' +
+				'</div>'
+			);
+		},
+
+		/**
+		 * Called after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this, onClickHandler = self.settings.onclick;
+
+			self.on('click', function(e) {
+				if (e.aria && e.aria.key == 'down') {
+					return;
+				}
+
+				if (e.control == self && !DOM.getParent(e.target, '.' + self.classPrefix + 'open')) {
+					e.stopImmediatePropagation();
+					onClickHandler.call(self, e);
+				}
+			});
+
+			delete self.settings.onclick;
+
+			return self._super();
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/util/Color.js
+
+/**
+ * Color.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class lets you parse/serialize colors and convert rgb/hsb.
+ *
+ * @class tinymce.util.Color
+ * @example
+ * var white = new tinymce.util.Color({r: 255, g: 255, b: 255});
+ * var red = new tinymce.util.Color('#FF0000');
+ *
+ * console.log(white.toHex(), red.toHsv());
+ */
+define("tinymce/util/Color", [], function() {
+	var min = Math.min, max = Math.max, round = Math.round;
+
+	/**
+	 * Constructs a new color instance.
+	 *
+	 * @constructor
+	 * @method Color
+	 * @param {String} value Optional initial value to parse.
+	 */
+	function Color(value) {
+		var self = this, r = 0, g = 0, b = 0;
+
+		function rgb2hsv(r, g, b) {
+			var h, s, v, d, minRGB, maxRGB;
+
+			h = 0;
+			s = 0;
+			v = 0;
+			r = r / 255;
+			g = g / 255;
+			b = b / 255;
+
+			minRGB = min(r, min(g, b));
+			maxRGB = max(r, max(g, b));
+
+			if (minRGB == maxRGB) {
+				v = minRGB;
+
+				return {
+					h: 0,
+					s: 0,
+					v: v * 100
+				};
+			}
+
+			/*eslint no-nested-ternary:0 */
+			d = (r == minRGB) ? g - b : ((b == minRGB) ? r - g : b - r);
+			h = (r == minRGB) ? 3 : ((b == minRGB) ? 1 : 5);
+			h = 60 * (h - d / (maxRGB - minRGB));
+			s = (maxRGB - minRGB) / maxRGB;
+			v = maxRGB;
+
+			return {
+				h: round(h),
+				s: round(s * 100),
+				v: round(v * 100)
+			};
+		}
+
+		function hsvToRgb(hue, saturation, brightness) {
+			var side, chroma, x, match;
+
+			hue = (parseInt(hue, 10) || 0) % 360;
+			saturation = parseInt(saturation, 10) / 100;
+			brightness = parseInt(brightness, 10) / 100;
+			saturation = max(0, min(saturation, 1));
+			brightness = max(0, min(brightness, 1));
+
+			if (saturation === 0) {
+				r = g = b = round(255 * brightness);
+				return;
+			}
+
+			side = hue / 60;
+			chroma = brightness * saturation;
+			x = chroma * (1 - Math.abs(side % 2 - 1));
+			match = brightness - chroma;
+
+			switch (Math.floor(side)) {
+				case 0:
+					r = chroma;
+					g = x;
+					b = 0;
+					break;
+
+				case 1:
+					r = x;
+					g = chroma;
+					b = 0;
+					break;
+
+				case 2:
+					r = 0;
+					g = chroma;
+					b = x;
+					break;
+
+				case 3:
+					r = 0;
+					g = x;
+					b = chroma;
+					break;
+
+				case 4:
+					r = x;
+					g = 0;
+					b = chroma;
+					break;
+
+				case 5:
+					r = chroma;
+					g = 0;
+					b = x;
+					break;
+
+				default:
+					r = g = b = 0;
+			}
+
+			r = round(255 * (r + match));
+			g = round(255 * (g + match));
+			b = round(255 * (b + match));
+		}
+
+		/**
+		 * Returns the hex string of the current color. For example: #ff00ff
+		 *
+		 * @method toHex
+		 * @return {String} Hex string of current color.
+		 */
+		function toHex() {
+			function hex(val) {
+				val = parseInt(val, 10).toString(16);
+
+				return val.length > 1 ? val : '0' + val;
+			}
+
+			return '#' + hex(r) + hex(g) + hex(b);
+		}
+
+		/**
+		 * Returns the r, g, b values of the color. Each channel has a range from 0-255.
+		 *
+		 * @method toRgb
+		 * @return {Object} Object with r, g, b fields.
+		 */
+		function toRgb() {
+			return {
+				r: r,
+				g: g,
+				b: b
+			};
+		}
+
+		/**
+		 * Returns the h, s, v values of the color. Ranges: h=0-360, s=0-100, v=0-100.
+		 *
+		 * @method toHsv
+		 * @return {Object} Object with h, s, v fields.
+		 */
+		function toHsv() {
+			return rgb2hsv(r, g, b);
+		}
+
+		/**
+		 * Parses the specified value and populates the color instance.
+		 *
+		 * Supported format examples:
+		 *  * rbg(255,0,0)
+		 *  * #ff0000
+		 *  * #fff
+		 *  * {r: 255, g: 0, b: 0}
+		 *  * {h: 360, s: 100, v: 100}
+		 *
+		 * @method parse
+		 * @param {Object/String} value Color value to parse.
+		 * @return {tinymce.util.Color} Current color instance.
+		 */
+		function parse(value) {
+			var matches;
+
+			if (typeof value == 'object') {
+				if ("r" in value) {
+					r = value.r;
+					g = value.g;
+					b = value.b;
+				} else if ("v" in value) {
+					hsvToRgb(value.h, value.s, value.v);
+				}
+			} else {
+				if ((matches = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(value))) {
+					r = parseInt(matches[1], 10);
+					g = parseInt(matches[2], 10);
+					b = parseInt(matches[3], 10);
+				} else if ((matches = /#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(value))) {
+					r = parseInt(matches[1], 16);
+					g = parseInt(matches[2], 16);
+					b = parseInt(matches[3], 16);
+				} else if ((matches = /#([0-F])([0-F])([0-F])/gi.exec(value))) {
+					r = parseInt(matches[1] + matches[1], 16);
+					g = parseInt(matches[2] + matches[2], 16);
+					b = parseInt(matches[3] + matches[3], 16);
+				}
+			}
+
+			r = r < 0 ? 0 : (r > 255 ? 255 : r);
+			g = g < 0 ? 0 : (g > 255 ? 255 : g);
+			b = b < 0 ? 0 : (b > 255 ? 255 : b);
+
+			return self;
+		}
+
+		if (value) {
+			parse(value);
+		}
+
+		self.toRgb = toRgb;
+		self.toHsv = toHsv;
+		self.toHex = toHex;
+		self.parse = parse;
+	}
+
+	return Color;
+});
+
+// Included from: js/tinymce/classes/ui/ColorPicker.js
+
+/**
+ * ColorPicker.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Color picker widget lets you select colors.
+ *
+ * @-x-less ColorPicker.less
+ * @class tinymce.ui.ColorPicker
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/ColorPicker", [
+	"tinymce/ui/Widget",
+	"tinymce/ui/DragHelper",
+	"tinymce/ui/DomUtils",
+	"tinymce/util/Color"
+], function(Widget, DragHelper, DomUtils, Color) {
+	"use strict";
+
+	return Widget.extend({
+		Defaults: {
+			classes: "widget colorpicker"
+		},
+
+		/**
+		 * Constructs a new colorpicker instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {String} color Initial color value.
+		 */
+		init: function(settings) {
+			this._super(settings);
+		},
+
+		postRender: function() {
+			var self = this, color = self.color(), hsv, hueRootElm, huePointElm, svRootElm, svPointElm;
+
+			hueRootElm = self.getEl('h');
+			huePointElm = self.getEl('hp');
+			svRootElm = self.getEl('sv');
+			svPointElm = self.getEl('svp');
+
+			function getPos(elm, event) {
+				var pos = DomUtils.getPos(elm), x, y;
+
+				x = event.pageX - pos.x;
+				y = event.pageY - pos.y;
+
+				x = Math.max(0, Math.min(x / elm.clientWidth, 1));
+				y = Math.max(0, Math.min(y / elm.clientHeight, 1));
+
+				return {
+					x: x,
+					y: y
+				};
+			}
+
+			function updateColor(hsv, hueUpdate) {
+				var hue = (360 - hsv.h) / 360;
+
+				DomUtils.css(huePointElm, {
+					top: (hue * 100) + '%'
+				});
+
+				if (!hueUpdate) {
+					DomUtils.css(svPointElm, {
+						left: hsv.s + '%',
+						top: (100 - hsv.v) + '%'
+					});
+				}
+
+				svRootElm.style.background = new Color({s: 100, v: 100, h: hsv.h}).toHex();
+				self.color().parse({s: hsv.s, v: hsv.v, h: hsv.h});
+			}
+
+			function updateSaturationAndValue(e) {
+				var pos;
+
+				pos = getPos(svRootElm, e);
+				hsv.s = pos.x * 100;
+				hsv.v = (1 - pos.y) * 100;
+
+				updateColor(hsv);
+				self.fire('change');
+			}
+
+			function updateHue(e) {
+				var pos;
+
+				pos = getPos(hueRootElm, e);
+				hsv = color.toHsv();
+				hsv.h = (1 - pos.y) * 360;
+				updateColor(hsv, true);
+				self.fire('change');
+			}
+
+			self._repaint = function() {
+				hsv = color.toHsv();
+				updateColor(hsv);
+			};
+
+			self._super();
+
+			self._svdraghelper = new DragHelper(self._id + '-sv', {
+				start: updateSaturationAndValue,
+				drag: updateSaturationAndValue
+			});
+
+			self._hdraghelper = new DragHelper(self._id + '-h', {
+				start: updateHue,
+				drag: updateHue
+			});
+
+			self._repaint();
+		},
+
+		rgb: function() {
+			return this.color().toRgb();
+		},
+
+		value: function(value) {
+			var self = this;
+
+			if (arguments.length) {
+				self.color().parse(value);
+
+				if (self._rendered) {
+					self._repaint();
+				}
+			} else {
+				return self.color().toHex();
+			}
+		},
+
+		color: function() {
+			if (!this._color) {
+				this._color = new Color();
+			}
+
+			return this._color;
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, id = self._id, prefix = self.classPrefix, hueHtml;
+			var stops = '#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000';
+
+			function getOldIeFallbackHtml() {
+				var i, l, html = '', gradientPrefix, stopsList;
+
+				gradientPrefix = 'filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=';
+				stopsList = stops.split(',');
+				for (i = 0, l = stopsList.length - 1; i < l; i++) {
+					html += (
+						'<div class="' + prefix + 'colorpicker-h-chunk" style="' +
+							'height:' + (100 / l) + '%;' +
+							gradientPrefix + stopsList[i] + ',endColorstr=' + stopsList[i + 1] + ');' +
+							'-ms-' + gradientPrefix + stopsList[i] + ',endColorstr=' + stopsList[i + 1] + ')' +
+						'"></div>'
+					);
+				}
+
+				return html;
+			}
+
+			var gradientCssText = (
+				'background: -ms-linear-gradient(top,' + stops + ');' +
+				'background: linear-gradient(to bottom,' + stops + ');'
+			);
+
+			hueHtml = (
+				'<div id="' + id + '-h" class="' + prefix + 'colorpicker-h" style="' + gradientCssText + '">' +
+					getOldIeFallbackHtml() +
+					'<div id="' + id + '-hp" class="' + prefix + 'colorpicker-h-marker"></div>' +
+				'</div>'
+			);
+
+			return (
+				'<div id="' + id + '" class="' + self.classes() + '">' +
+					'<div id="' + id + '-sv" class="' + prefix + 'colorpicker-sv">' +
+						'<div class="' + prefix + 'colorpicker-overlay1">' +
+							'<div class="' + prefix + 'colorpicker-overlay2">' +
+								'<div id="' + id + '-svp" class="' + prefix + 'colorpicker-selector1">' +
+									'<div class="' + prefix + 'colorpicker-selector2"></div>' +
+								'</div>' +
+							'</div>' +
+						'</div>' +
+					'</div>' +
+					hueHtml +
+				'</div>'
+			);
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/Path.js
+
+/**
+ * Path.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new path control.
+ *
+ * @-x-less Path.less
+ * @class tinymce.ui.Path
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/Path", [
+	"tinymce/ui/Widget"
+], function(Widget) {
+	"use strict";
+
+	return Widget.extend({
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {String} delimiter Delimiter to display between items in path.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			if (!settings.delimiter) {
+				settings.delimiter = '\u00BB';
+			}
+
+			self._super(settings);
+			self.addClass('path');
+			self.canFocus = true;
+
+			self.on('click', function(e) {
+				var index, target = e.target;
+
+				if ((index = target.getAttribute('data-index'))) {
+					self.fire('select', {value: self.data()[index], index: index});
+				}
+			});
+		},
+
+		/**
+		 * Focuses the current control.
+		 *
+		 * @method focus
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		focus: function() {
+			var self = this;
+
+			self.getEl().firstChild.focus();
+
+			return self;
+		},
+
+		/**
+		 * Sets/gets the data to be used for the path.
+		 *
+		 * @method data
+		 * @param {Array} data Array with items name is rendered to path.
+		 */
+		data: function(data) {
+			var self = this;
+
+			if (typeof data !== "undefined") {
+				self._data = data;
+				self.update();
+
+				return self;
+			}
+
+			return self._data;
+		},
+
+		/**
+		 * Updated the path.
+		 *
+		 * @private
+		 */
+		update: function() {
+			this.innerHtml(this._getPathHtml());
+		},
+
+		/**
+		 * Called after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this;
+
+			self._super();
+
+			self.data(self.settings.data);
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this;
+
+			return (
+				'<div id="' + self._id + '" class="' + self.classes() + '">' +
+					self._getPathHtml() +
+				'</div>'
+			);
+		},
+
+		_getPathHtml: function() {
+			var self = this, parts = self._data || [], i, l, html = '', prefix = self.classPrefix;
+
+			for (i = 0, l = parts.length; i < l; i++) {
+				html += (
+					(i > 0 ? '<div class="' + prefix + 'divider" aria-hidden="true"> ' + self.settings.delimiter + ' </div>' : '') +
+					'<div role="button" class="' + prefix + 'path-item' + (i == l - 1 ? ' ' + prefix + 'last' : '') + '" data-index="' +
+					i + '" tabindex="-1" id="' + self._id + '-' + i + '" aria-level="' + i + '">' + parts[i].name + '</div>'
+				);
+			}
+
+			if (!html) {
+				html = '<div class="' + prefix + 'path-item">\u00a0</div>';
+			}
+
+			return html;
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/ElementPath.js
+
+/**
+ * ElementPath.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This control creates an path for the current selections parent elements in TinyMCE.
+ *
+ * @class tinymce.ui.ElementPath
+ * @extends tinymce.ui.Path
+ */
+define("tinymce/ui/ElementPath", [
+	"tinymce/ui/Path",
+	"tinymce/EditorManager"
+], function(Path, EditorManager) {
+	return Path.extend({
+		/**
+		 * Post render method. Called after the control has been rendered to the target.
+		 *
+		 * @method postRender
+		 * @return {tinymce.ui.ElementPath} Current combobox instance.
+		 */
+		postRender: function() {
+			var self = this, editor = EditorManager.activeEditor;
+
+			function isHidden(elm) {
+				if (elm.nodeType === 1) {
+					if (elm.nodeName == "BR" || !!elm.getAttribute('data-mce-bogus')) {
+						return true;
+					}
+
+					if (elm.getAttribute('data-mce-type') === 'bookmark') {
+						return true;
+					}
+				}
+
+				return false;
+			}
+
+			if (editor.settings.elementpath !== false) {
+				self.on('select', function(e) {
+					editor.focus();
+					editor.selection.select(this.data()[e.index].element);
+					editor.nodeChanged();
+				});
+
+				editor.on('nodeChange', function(e) {
+					var outParents = [], parents = e.parents, i = parents.length;
+
+					while (i--) {
+						if (parents[i].nodeType == 1 && !isHidden(parents[i])) {
+							var args = editor.fire('ResolveName', {
+								name: parents[i].nodeName.toLowerCase(),
+								target: parents[i]
+							});
+
+							if (!args.isDefaultPrevented()) {
+								outParents.push({name: args.name, element: parents[i]});
+							}
+
+							if (args.isPropagationStopped()) {
+								break;
+							}
+						}
+					}
+
+					self.data(outParents);
+				});
+			}
+
+			return self._super();
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/FormItem.js
+
+/**
+ * FormItem.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is a container created by the form element with
+ * a label and control item.
+ *
+ * @class tinymce.ui.FormItem
+ * @extends tinymce.ui.Container
+ * @setting {String} label Label to display for the form item.
+ */
+define("tinymce/ui/FormItem", [
+	"tinymce/ui/Container"
+], function(Container) {
+	"use strict";
+
+	return Container.extend({
+		Defaults: {
+			layout: 'flex',
+			align: 'center',
+			defaults: {
+				flex: 1
+			}
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, layout = self._layout, prefix = self.classPrefix;
+
+			self.addClass('formitem');
+			layout.preRender(self);
+
+			return (
+				'<div id="' + self._id + '" class="' + self.classes() + '" hidefocus="1" tabindex="-1">' +
+					(self.settings.title ? ('<div id="' + self._id + '-title" class="' + prefix + 'title">' +
+						self.settings.title + '</div>') : '') +
+					'<div id="' + self._id + '-body" class="' + self.classes('body') + '">' +
+						(self.settings.html || '') + layout.renderHtml(self) +
+					'</div>' +
+				'</div>'
+			);
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/Form.js
+
+/**
+ * Form.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class creates a form container. A form container has the ability
+ * to automatically wrap items in tinymce.ui.FormItem instances.
+ *
+ * Each FormItem instance is a container for the label and the item.
+ *
+ * @example
+ * tinymce.ui.Factory.create({
+ *     type: 'form',
+ *     items: [
+ *         {type: 'textbox', label: 'My text box'}
+ *     ]
+ * }).renderTo(document.body);
+ *
+ * @class tinymce.ui.Form
+ * @extends tinymce.ui.Container
+ */
+define("tinymce/ui/Form", [
+	"tinymce/ui/Container",
+	"tinymce/ui/FormItem",
+	"tinymce/util/Tools"
+], function(Container, FormItem, Tools) {
+	"use strict";
+
+	return Container.extend({
+		Defaults: {
+			containerCls: 'form',
+			layout: 'flex',
+			direction: 'column',
+			align: 'stretch',
+			flex: 1,
+			padding: 20,
+			labelGap: 30,
+			spacing: 10,
+			callbacks: {
+				submit: function() {
+					this.submit();
+				}
+			}
+		},
+
+		/**
+		 * This method gets invoked before the control is rendered.
+		 *
+		 * @method preRender
+		 */
+		preRender: function() {
+			var self = this, items = self.items();
+
+			if (!self.settings.formItemDefaults) {
+				self.settings.formItemDefaults = {
+					layout: 'flex',
+					autoResize: "overflow",
+					defaults: {flex: 1}
+				};
+			}
+
+			// Wrap any labeled items in FormItems
+			items.each(function(ctrl) {
+				var formItem, label = ctrl.settings.label;
+
+				if (label) {
+					formItem = new FormItem(Tools.extend({
+						items: {
+							type: 'label',
+							id: ctrl._id + '-l',
+							text: label,
+							flex: 0,
+							forId: ctrl._id,
+							disabled: ctrl.disabled()
+						}
+					}, self.settings.formItemDefaults));
+
+					formItem.type = 'formitem';
+					ctrl.aria('labelledby', ctrl._id + '-l');
+
+					if (typeof ctrl.settings.flex == "undefined") {
+						ctrl.settings.flex = 1;
+					}
+
+					self.replace(ctrl, formItem);
+					formItem.add(ctrl);
+				}
+			});
+		},
+
+		/**
+		 * Recalcs label widths.
+		 *
+		 * @private
+		 */
+		recalcLabels: function() {
+			var self = this, maxLabelWidth = 0, labels = [], i, labelGap, items;
+
+			if (self.settings.labelGapCalc === false) {
+				return;
+			}
+
+			if (self.settings.labelGapCalc == "children") {
+				items = self.find('formitem');
+			} else {
+				items = self.items();
+			}
+
+			items.filter('formitem').each(function(item) {
+				var labelCtrl = item.items()[0], labelWidth = labelCtrl.getEl().clientWidth;
+
+				maxLabelWidth = labelWidth > maxLabelWidth ? labelWidth : maxLabelWidth;
+				labels.push(labelCtrl);
+			});
+
+			labelGap = self.settings.labelGap || 0;
+
+			i = labels.length;
+			while (i--) {
+				labels[i].settings.minWidth = maxLabelWidth + labelGap;
+			}
+		},
+
+		/**
+		 * Getter/setter for the visibility state.
+		 *
+		 * @method visible
+		 * @param {Boolean} [state] True/false state to show/hide.
+		 * @return {tinymce.ui.Form|Boolean} True/false state or current control.
+		 */
+		visible: function(state) {
+			var val = this._super(state);
+
+			if (state === true && this._rendered) {
+				this.recalcLabels();
+			}
+
+			return val;
+		},
+
+		/**
+		 * Fires a submit event with the serialized form.
+		 *
+		 * @method submit
+		 * @return {Object} Event arguments object.
+		 */
+		submit: function() {
+			return this.fire('submit', {data: this.toJSON()});
+		},
+
+		/**
+		 * Post render method. Called after the control has been rendered to the target.
+		 *
+		 * @method postRender
+		 * @return {tinymce.ui.ComboBox} Current combobox instance.
+		 */
+		postRender: function() {
+			var self = this;
+
+			self._super();
+			self.recalcLabels();
+			self.fromJSON(self.settings.data);
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/FieldSet.js
+
+/**
+ * FieldSet.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class creates fieldset containers.
+ *
+ * @-x-less FieldSet.less
+ * @class tinymce.ui.FieldSet
+ * @extends tinymce.ui.Form
+ */
+define("tinymce/ui/FieldSet", [
+	"tinymce/ui/Form"
+], function(Form) {
+	"use strict";
+
+	return Form.extend({
+		Defaults: {
+			containerCls: 'fieldset',
+			layout: 'flex',
+			direction: 'column',
+			align: 'stretch',
+			flex: 1,
+			padding: "25 15 5 15",
+			labelGap: 30,
+			spacing: 10,
+			border: 1
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, layout = self._layout, prefix = self.classPrefix;
+
+			self.preRender();
+			layout.preRender(self);
+
+			return (
+				'<fieldset id="' + self._id + '" class="' + self.classes() + '" hidefocus="1" tabindex="-1">' +
+					(self.settings.title ? ('<legend id="' + self._id + '-title" class="' + prefix + 'fieldset-title">' +
+						self.settings.title + '</legend>') : '') +
+					'<div id="' + self._id + '-body" class="' + self.classes('body') + '">' +
+						(self.settings.html || '') + layout.renderHtml(self) +
+					'</div>' +
+				'</fieldset>'
+			);
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/FilePicker.js
+
+/**
+ * FilePicker.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+/**
+ * This class creates a file picker control.
+ *
+ * @class tinymce.ui.FilePicker
+ * @extends tinymce.ui.ComboBox
+ */
+define("tinymce/ui/FilePicker", [
+	"tinymce/ui/ComboBox",
+	"tinymce/util/Tools"
+], function(ComboBox, Tools) {
+	"use strict";
+
+	return ComboBox.extend({
+		/**
+		 * Constructs a new control instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 */
+		init: function(settings) {
+			var self = this, editor = tinymce.activeEditor, editorSettings = editor.settings;
+			var actionCallback, fileBrowserCallback, fileBrowserCallbackTypes;
+
+			settings.spellcheck = false;
+
+			fileBrowserCallbackTypes = editorSettings.file_picker_types || editorSettings.file_browser_callback_types;
+			if (fileBrowserCallbackTypes) {
+				fileBrowserCallbackTypes = Tools.makeMap(fileBrowserCallbackTypes, /[, ]/);
+			}
+
+			if (!fileBrowserCallbackTypes || fileBrowserCallbackTypes[settings.filetype]) {
+				fileBrowserCallback = editorSettings.file_picker_callback;
+				if (fileBrowserCallback && (!fileBrowserCallbackTypes || fileBrowserCallbackTypes[settings.filetype])) {
+					actionCallback = function() {
+						var meta = self.fire('beforecall').meta;
+
+						meta = Tools.extend({filetype: settings.filetype}, meta);
+
+						// file_picker_callback(callback, currentValue, metaData)
+						fileBrowserCallback.call(
+							editor,
+							function(value, meta) {
+								self.value(value).fire('change', {meta: meta});
+							},
+							self.value(),
+							meta
+						);
+					};
+				} else {
+					// Legacy callback: file_picker_callback(id, currentValue, filetype, window)
+					fileBrowserCallback = editorSettings.file_browser_callback;
+					if (fileBrowserCallback && (!fileBrowserCallbackTypes || fileBrowserCallbackTypes[settings.filetype])) {
+						actionCallback = function() {
+							fileBrowserCallback(
+								self.getEl('inp').id,
+								self.value(),
+								settings.filetype,
+								window
+							);
+						};
+					}
+				}
+			}
+
+			if (actionCallback) {
+				settings.icon = 'browse';
+				settings.onaction = actionCallback;
+			}
+
+			self._super(settings);
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/FitLayout.js
+
+/**
+ * FitLayout.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This layout manager will resize the control to be the size of it's parent container.
+ * In other words width: 100% and height: 100%.
+ *
+ * @-x-less FitLayout.less
+ * @class tinymce.ui.FitLayout
+ * @extends tinymce.ui.AbsoluteLayout
+ */
+define("tinymce/ui/FitLayout", [
+	"tinymce/ui/AbsoluteLayout"
+], function(AbsoluteLayout) {
+	"use strict";
+
+	return AbsoluteLayout.extend({
+		/**
+		 * Recalculates the positions of the controls in the specified container.
+		 *
+		 * @method recalc
+		 * @param {tinymce.ui.Container} container Container instance to recalc.
+		 */
+		recalc: function(container) {
+			var contLayoutRect = container.layoutRect(), paddingBox = container.paddingBox();
+
+			container.items().filter(':visible').each(function(ctrl) {
+				ctrl.layoutRect({
+					x: paddingBox.left,
+					y: paddingBox.top,
+					w: contLayoutRect.innerW - paddingBox.right - paddingBox.left,
+					h: contLayoutRect.innerH - paddingBox.top - paddingBox.bottom
+				});
+
+				if (ctrl.recalc) {
+					ctrl.recalc();
+				}
+			});
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/FlexLayout.js
+
+/**
+ * FlexLayout.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This layout manager works similar to the CSS flex box.
+ *
+ * @setting {String} direction row|row-reverse|column|column-reverse
+ * @setting {Number} flex A positive-number to flex by.
+ * @setting {String} align start|end|center|stretch
+ * @setting {String} pack start|end|justify
+ *
+ * @class tinymce.ui.FlexLayout
+ * @extends tinymce.ui.AbsoluteLayout
+ */
+define("tinymce/ui/FlexLayout", [
+	"tinymce/ui/AbsoluteLayout"
+], function(AbsoluteLayout) {
+	"use strict";
+
+	return AbsoluteLayout.extend({
+		/**
+		 * Recalculates the positions of the controls in the specified container.
+		 *
+		 * @method recalc
+		 * @param {tinymce.ui.Container} container Container instance to recalc.
+		 */
+		recalc: function(container) {
+			// A ton of variables, needs to be in the same scope for performance
+			var i, l, items, contLayoutRect, contPaddingBox, contSettings, align, pack, spacing, totalFlex, availableSpace, direction;
+			var ctrl, ctrlLayoutRect, ctrlSettings, flex, maxSizeItems = [], size, maxSize, ratio, rect, pos, maxAlignEndPos;
+			var sizeName, minSizeName, posName, maxSizeName, beforeName, innerSizeName, deltaSizeName, contentSizeName;
+			var alignAxisName, alignInnerSizeName, alignSizeName, alignMinSizeName, alignBeforeName, alignAfterName;
+			var alignDeltaSizeName, alignContentSizeName;
+			var max = Math.max, min = Math.min;
+
+			// Get container items, properties and settings
+			items = container.items().filter(':visible');
+			contLayoutRect = container.layoutRect();
+			contPaddingBox = container._paddingBox;
+			contSettings = container.settings;
+			direction = container.isRtl() ? (contSettings.direction || 'row-reversed') : contSettings.direction;
+			align = contSettings.align;
+			pack = container.isRtl() ? (contSettings.pack || 'end') : contSettings.pack;
+			spacing = contSettings.spacing || 0;
+
+			if (direction == "row-reversed" || direction == "column-reverse") {
+				items = items.set(items.toArray().reverse());
+				direction = direction.split('-')[0];
+			}
+
+			// Setup axis variable name for row/column direction since the calculations is the same
+			if (direction == "column") {
+				posName = "y";
+				sizeName = "h";
+				minSizeName = "minH";
+				maxSizeName = "maxH";
+				innerSizeName = "innerH";
+				beforeName = 'top';
+				deltaSizeName = "deltaH";
+				contentSizeName = "contentH";
+
+				alignBeforeName = "left";
+				alignSizeName = "w";
+				alignAxisName = "x";
+				alignInnerSizeName = "innerW";
+				alignMinSizeName = "minW";
+				alignAfterName = "right";
+				alignDeltaSizeName = "deltaW";
+				alignContentSizeName = "contentW";
+			} else {
+				posName = "x";
+				sizeName = "w";
+				minSizeName = "minW";
+				maxSizeName = "maxW";
+				innerSizeName = "innerW";
+				beforeName = 'left';
+				deltaSizeName = "deltaW";
+				contentSizeName = "contentW";
+
+				alignBeforeName = "top";
+				alignSizeName = "h";
+				alignAxisName = "y";
+				alignInnerSizeName = "innerH";
+				alignMinSizeName = "minH";
+				alignAfterName = "bottom";
+				alignDeltaSizeName = "deltaH";
+				alignContentSizeName = "contentH";
+			}
+
+			// Figure out total flex, availableSpace and collect any max size elements
+			availableSpace = contLayoutRect[innerSizeName] - contPaddingBox[beforeName] - contPaddingBox[beforeName];
+			maxAlignEndPos = totalFlex = 0;
+			for (i = 0, l = items.length; i < l; i++) {
+				ctrl = items[i];
+				ctrlLayoutRect = ctrl.layoutRect();
+				ctrlSettings = ctrl.settings;
+				flex = ctrlSettings.flex;
+				availableSpace -= (i < l - 1 ? spacing : 0);
+
+				if (flex > 0) {
+					totalFlex += flex;
+
+					// Flexed item has a max size then we need to check if we will hit that size
+					if (ctrlLayoutRect[maxSizeName]) {
+						maxSizeItems.push(ctrl);
+					}
+
+					ctrlLayoutRect.flex = flex;
+				}
+
+				availableSpace -= ctrlLayoutRect[minSizeName];
+
+				// Calculate the align end position to be used to check for overflow/underflow
+				size = contPaddingBox[alignBeforeName] + ctrlLayoutRect[alignMinSizeName] + contPaddingBox[alignAfterName];
+				if (size > maxAlignEndPos) {
+					maxAlignEndPos = size;
+				}
+			}
+
+			// Calculate minW/minH
+			rect = {};
+			if (availableSpace < 0) {
+				rect[minSizeName] = contLayoutRect[minSizeName] - availableSpace + contLayoutRect[deltaSizeName];
+			} else {
+				rect[minSizeName] = contLayoutRect[innerSizeName] - availableSpace + contLayoutRect[deltaSizeName];
+			}
+
+			rect[alignMinSizeName] = maxAlignEndPos + contLayoutRect[alignDeltaSizeName];
+
+			rect[contentSizeName] = contLayoutRect[innerSizeName] - availableSpace;
+			rect[alignContentSizeName] = maxAlignEndPos;
+			rect.minW = min(rect.minW, contLayoutRect.maxW);
+			rect.minH = min(rect.minH, contLayoutRect.maxH);
+			rect.minW = max(rect.minW, contLayoutRect.startMinWidth);
+			rect.minH = max(rect.minH, contLayoutRect.startMinHeight);
+
+			// Resize container container if minSize was changed
+			if (contLayoutRect.autoResize && (rect.minW != contLayoutRect.minW || rect.minH != contLayoutRect.minH)) {
+				rect.w = rect.minW;
+				rect.h = rect.minH;
+
+				container.layoutRect(rect);
+				this.recalc(container);
+
+				// Forced recalc for example if items are hidden/shown
+				if (container._lastRect === null) {
+					var parentCtrl = container.parent();
+					if (parentCtrl) {
+						parentCtrl._lastRect = null;
+						parentCtrl.recalc();
+					}
+				}
+
+				return;
+			}
+
+			// Handle max size elements, check if they will become to wide with current options
+			ratio = availableSpace / totalFlex;
+			for (i = 0, l = maxSizeItems.length; i < l; i++) {
+				ctrl = maxSizeItems[i];
+				ctrlLayoutRect = ctrl.layoutRect();
+				maxSize = ctrlLayoutRect[maxSizeName];
+				size = ctrlLayoutRect[minSizeName] + ctrlLayoutRect.flex * ratio;
+
+				if (size > maxSize) {
+					availableSpace -= (ctrlLayoutRect[maxSizeName] - ctrlLayoutRect[minSizeName]);
+					totalFlex -= ctrlLayoutRect.flex;
+					ctrlLayoutRect.flex = 0;
+					ctrlLayoutRect.maxFlexSize = maxSize;
+				} else {
+					ctrlLayoutRect.maxFlexSize = 0;
+				}
+			}
+
+			// Setup new ratio, target layout rect, start position
+			ratio = availableSpace / totalFlex;
+			pos = contPaddingBox[beforeName];
+			rect = {};
+
+			// Handle pack setting moves the start position to end, center
+			if (totalFlex === 0) {
+				if (pack == "end") {
+					pos = availableSpace + contPaddingBox[beforeName];
+				} else if (pack == "center") {
+					pos = Math.round(
+						(contLayoutRect[innerSizeName] / 2) - ((contLayoutRect[innerSizeName] - availableSpace) / 2)
+					) + contPaddingBox[beforeName];
+
+					if (pos < 0) {
+						pos = contPaddingBox[beforeName];
+					}
+				} else if (pack == "justify") {
+					pos = contPaddingBox[beforeName];
+					spacing = Math.floor(availableSpace / (items.length - 1));
+				}
+			}
+
+			// Default aligning (start) the other ones needs to be calculated while doing the layout
+			rect[alignAxisName] = contPaddingBox[alignBeforeName];
+
+			// Start laying out controls
+			for (i = 0, l = items.length; i < l; i++) {
+				ctrl = items[i];
+				ctrlLayoutRect = ctrl.layoutRect();
+				size = ctrlLayoutRect.maxFlexSize || ctrlLayoutRect[minSizeName];
+
+				// Align the control on the other axis
+				if (align === "center") {
+					rect[alignAxisName] = Math.round((contLayoutRect[alignInnerSizeName] / 2) - (ctrlLayoutRect[alignSizeName] / 2));
+				} else if (align === "stretch") {
+					rect[alignSizeName] = max(
+						ctrlLayoutRect[alignMinSizeName] || 0,
+						contLayoutRect[alignInnerSizeName] - contPaddingBox[alignBeforeName] - contPaddingBox[alignAfterName]
+					);
+					rect[alignAxisName] = contPaddingBox[alignBeforeName];
+				} else if (align === "end") {
+					rect[alignAxisName] = contLayoutRect[alignInnerSizeName] - ctrlLayoutRect[alignSizeName] - contPaddingBox.top;
+				}
+
+				// Calculate new size based on flex
+				if (ctrlLayoutRect.flex > 0) {
+					size += ctrlLayoutRect.flex * ratio;
+				}
+
+				rect[sizeName] = size;
+				rect[posName] = pos;
+				ctrl.layoutRect(rect);
+
+				// Recalculate containers
+				if (ctrl.recalc) {
+					ctrl.recalc();
+				}
+
+				// Move x/y position
+				pos += size + spacing;
+			}
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/FlowLayout.js
+
+/**
+ * FlowLayout.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This layout manager will place the controls by using the browsers native layout.
+ *
+ * @-x-less FlowLayout.less
+ * @class tinymce.ui.FlowLayout
+ * @extends tinymce.ui.Layout
+ */
+define("tinymce/ui/FlowLayout", [
+	"tinymce/ui/Layout"
+], function(Layout) {
+	return Layout.extend({
+		Defaults: {
+			containerClass: 'flow-layout',
+			controlClass: 'flow-layout-item',
+			endClass: 'break'
+		},
+
+		/**
+		 * Recalculates the positions of the controls in the specified container.
+		 *
+		 * @method recalc
+		 * @param {tinymce.ui.Container} container Container instance to recalc.
+		 */
+		recalc: function(container) {
+			container.items().filter(':visible').each(function(ctrl) {
+				if (ctrl.recalc) {
+					ctrl.recalc();
+				}
+			});
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/FormatControls.js
+
+/**
+ * FormatControls.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Internal class containing all TinyMCE specific control types such as
+ * format listboxes, fontlist boxes, toolbar buttons etc.
+ *
+ * @class tinymce.ui.FormatControls
+ */
+define("tinymce/ui/FormatControls", [
+	"tinymce/ui/Control",
+	"tinymce/ui/Widget",
+	"tinymce/ui/FloatPanel",
+	"tinymce/util/Tools",
+	"tinymce/EditorManager",
+	"tinymce/Env"
+], function(Control, Widget, FloatPanel, Tools, EditorManager, Env) {
+	var each = Tools.each;
+
+	EditorManager.on('AddEditor', function(e) {
+		if (e.editor.rtl) {
+			Control.rtl = true;
+		}
+
+		registerControls(e.editor);
+	});
+
+	Control.translate = function(text) {
+		return EditorManager.translate(text);
+	};
+
+	Widget.tooltips = !Env.iOS;
+
+	function registerControls(editor) {
+		var formatMenu;
+
+		function createListBoxChangeHandler(items, formatName) {
+			return function() {
+				var self = this;
+
+				editor.on('nodeChange', function(e) {
+					var formatter = editor.formatter;
+					var value = null;
+
+					each(e.parents, function(node) {
+						each(items, function(item) {
+							if (formatName) {
+								if (formatter.matchNode(node, formatName, {value: item.value})) {
+									value = item.value;
+								}
+							} else {
+								if (formatter.matchNode(node, item.value)) {
+									value = item.value;
+								}
+							}
+
+							if (value) {
+								return false;
+							}
+						});
+
+						if (value) {
+							return false;
+						}
+					});
+
+					self.value(value);
+				});
+			};
+		}
+
+		function createFormats(formats) {
+			formats = formats.replace(/;$/, '').split(';');
+
+			var i = formats.length;
+			while (i--) {
+				formats[i] = formats[i].split('=');
+			}
+
+			return formats;
+		}
+
+		function createFormatMenu() {
+			var count = 0, newFormats = [];
+
+			var defaultStyleFormats = [
+				{title: 'Headings', items: [
+					{title: 'Heading 1', format: 'h1'},
+					{title: 'Heading 2', format: 'h2'},
+					{title: 'Heading 3', format: 'h3'},
+					{title: 'Heading 4', format: 'h4'},
+					{title: 'Heading 5', format: 'h5'},
+					{title: 'Heading 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'}
+				]}
+			];
+
+			function createMenu(formats) {
+				var menu = [];
+
+				if (!formats) {
+					return;
+				}
+
+				each(formats, function(format) {
+					var menuItem = {
+						text: format.title,
+						icon: format.icon
+					};
+
+					if (format.items) {
+						menuItem.menu = createMenu(format.items);
+					} else {
+						var formatName = format.format || "custom" + count++;
+
+						if (!format.format) {
+							format.name = formatName;
+							newFormats.push(format);
+						}
+
+						menuItem.format = formatName;
+						menuItem.cmd = format.cmd;
+					}
+
+					menu.push(menuItem);
+				});
+
+				return menu;
+			}
+
+			function createStylesMenu() {
+				var menu;
+
+				if (editor.settings.style_formats_merge) {
+					if (editor.settings.style_formats) {
+						menu = createMenu(defaultStyleFormats.concat(editor.settings.style_formats));
+					} else {
+						menu = createMenu(defaultStyleFormats);
+					}
+				} else {
+					menu = createMenu(editor.settings.style_formats || defaultStyleFormats);
+				}
+
+				return menu;
+			}
+
+			editor.on('init', function() {
+				each(newFormats, function(format) {
+					editor.formatter.register(format.name, format);
+				});
+			});
+
+			return {
+				type: 'menu',
+				items: createStylesMenu(),
+				onPostRender: function(e) {
+					editor.fire('renderFormatsMenu', {control: e.control});
+				},
+				itemDefaults: {
+					preview: true,
+
+					textStyle: function() {
+						if (this.settings.format) {
+							return editor.formatter.getCssText(this.settings.format);
+						}
+					},
+
+					onPostRender: function() {
+						var self = this;
+
+						self.parent().on('show', function() {
+							var formatName, command;
+
+							formatName = self.settings.format;
+							if (formatName) {
+								self.disabled(!editor.formatter.canApply(formatName));
+								self.active(editor.formatter.match(formatName));
+							}
+
+							command = self.settings.cmd;
+							if (command) {
+								self.active(editor.queryCommandState(command));
+							}
+						});
+					},
+
+					onclick: function() {
+						if (this.settings.format) {
+							toggleFormat(this.settings.format);
+						}
+
+						if (this.settings.cmd) {
+							editor.execCommand(this.settings.cmd);
+						}
+					}
+				}
+			};
+		}
+
+		formatMenu = createFormatMenu();
+
+		// Simple format controls <control/format>:<UI text>
+		each({
+			bold: 'Bold',
+			italic: 'Italic',
+			underline: 'Underline',
+			strikethrough: 'Strikethrough',
+			subscript: 'Subscript',
+			superscript: 'Superscript'
+		}, function(text, name) {
+			editor.addButton(name, {
+				tooltip: text,
+				onPostRender: function() {
+					var self = this;
+
+					// TODO: Fix this
+					if (editor.formatter) {
+						editor.formatter.formatChanged(name, function(state) {
+							self.active(state);
+						});
+					} else {
+						editor.on('init', function() {
+							editor.formatter.formatChanged(name, function(state) {
+								self.active(state);
+							});
+						});
+					}
+				},
+				onclick: function() {
+					toggleFormat(name);
+				}
+			});
+		});
+
+		// Simple command controls <control>:[<UI text>,<Command>]
+		each({
+			outdent: ['Decrease indent', 'Outdent'],
+			indent: ['Increase indent', 'Indent'],
+			cut: ['Cut', 'Cut'],
+			copy: ['Copy', 'Copy'],
+			paste: ['Paste', 'Paste'],
+			help: ['Help', 'mceHelp'],
+			selectall: ['Select all', 'SelectAll'],
+			removeformat: ['Clear formatting', 'RemoveFormat'],
+			visualaid: ['Visual aids', 'mceToggleVisualAid'],
+			newdocument: ['New document', 'mceNewDocument']
+		}, function(item, name) {
+			editor.addButton(name, {
+				tooltip: item[0],
+				cmd: item[1]
+			});
+		});
+
+		// Simple command controls with format state
+		each({
+			blockquote: ['Blockquote', 'mceBlockQuote'],
+			numlist: ['Numbered list', 'InsertOrderedList'],
+			bullist: ['Bullet list', 'InsertUnorderedList'],
+			subscript: ['Subscript', 'Subscript'],
+			superscript: ['Superscript', 'Superscript'],
+			alignleft: ['Align left', 'JustifyLeft'],
+			aligncenter: ['Align center', 'JustifyCenter'],
+			alignright: ['Align right', 'JustifyRight'],
+			alignjustify: ['Justify', 'JustifyFull']
+		}, function(item, name) {
+			editor.addButton(name, {
+				tooltip: item[0],
+				cmd: item[1],
+				onPostRender: function() {
+					var self = this;
+
+					// TODO: Fix this
+					if (editor.formatter) {
+						editor.formatter.formatChanged(name, function(state) {
+							self.active(state);
+						});
+					} else {
+						editor.on('init', function() {
+							editor.formatter.formatChanged(name, function(state) {
+								self.active(state);
+							});
+						});
+					}
+				}
+			});
+		});
+
+		function toggleUndoRedoState(type) {
+			return function() {
+				var self = this;
+
+				type = type == 'redo' ? 'hasRedo' : 'hasUndo';
+
+				function checkState() {
+					return editor.undoManager ? editor.undoManager[type]() : false;
+				}
+
+				self.disabled(!checkState());
+				editor.on('Undo Redo AddUndo TypingUndo ClearUndos', function() {
+					self.disabled(!checkState());
+				});
+			};
+		}
+
+		function toggleVisualAidState() {
+			var self = this;
+
+			editor.on('VisualAid', function(e) {
+				self.active(e.hasVisual);
+			});
+
+			self.active(editor.hasVisual);
+		}
+
+		editor.addButton('undo', {
+			tooltip: 'Undo',
+			onPostRender: toggleUndoRedoState('undo'),
+			cmd: 'undo'
+		});
+
+		editor.addButton('redo', {
+			tooltip: 'Redo',
+			onPostRender: toggleUndoRedoState('redo'),
+			cmd: 'redo'
+		});
+
+		editor.addMenuItem('newdocument', {
+			text: 'New document',
+			icon: 'newdocument',
+			cmd: 'mceNewDocument'
+		});
+
+		editor.addMenuItem('undo', {
+			text: 'Undo',
+			icon: 'undo',
+			shortcut: 'Meta+Z',
+			onPostRender: toggleUndoRedoState('undo'),
+			cmd: 'undo'
+		});
+
+		editor.addMenuItem('redo', {
+			text: 'Redo',
+			icon: 'redo',
+			shortcut: 'Meta+Y',
+			onPostRender: toggleUndoRedoState('redo'),
+			cmd: 'redo'
+		});
+
+		editor.addMenuItem('visualaid', {
+			text: 'Visual aids',
+			selectable: true,
+			onPostRender: toggleVisualAidState,
+			cmd: 'mceToggleVisualAid'
+		});
+
+		each({
+			cut: ['Cut', 'Cut', 'Meta+X'],
+			copy: ['Copy', 'Copy', 'Meta+C'],
+			paste: ['Paste', 'Paste', 'Meta+V'],
+			selectall: ['Select all', 'SelectAll', 'Meta+A'],
+			bold: ['Bold', 'Bold', 'Meta+B'],
+			italic: ['Italic', 'Italic', 'Meta+I'],
+			underline: ['Underline', 'Underline'],
+			strikethrough: ['Strikethrough', 'Strikethrough'],
+			subscript: ['Subscript', 'Subscript'],
+			superscript: ['Superscript', 'Superscript'],
+			removeformat: ['Clear formatting', 'RemoveFormat']
+		}, function(item, name) {
+			editor.addMenuItem(name, {
+				text: item[0],
+				icon: name,
+				shortcut: item[2],
+				cmd: item[1]
+			});
+		});
+
+		editor.on('mousedown', function() {
+			FloatPanel.hideAll();
+		});
+
+		function toggleFormat(fmt) {
+			if (fmt.control) {
+				fmt = fmt.control.value();
+			}
+
+			if (fmt) {
+				editor.execCommand('mceToggleFormat', false, fmt);
+			}
+		}
+
+		editor.addButton('styleselect', {
+			type: 'menubutton',
+			text: 'Formats',
+			menu: formatMenu
+		});
+
+		editor.addButton('formatselect', function() {
+			var items = [], blocks = createFormats(editor.settings.block_formats ||
+				'Paragraph=p;' +
+				'Heading 1=h1;' +
+				'Heading 2=h2;' +
+				'Heading 3=h3;' +
+				'Heading 4=h4;' +
+				'Heading 5=h5;' +
+				'Heading 6=h6;' +
+				'Preformatted=pre'
+			);
+
+			each(blocks, function(block) {
+				items.push({
+					text: block[0],
+					value: block[1],
+					textStyle: function() {
+						return editor.formatter.getCssText(block[1]);
+					}
+				});
+			});
+
+			return {
+				type: 'listbox',
+				text: blocks[0][0],
+				values: items,
+				fixedWidth: true,
+				onselect: toggleFormat,
+				onPostRender: createListBoxChangeHandler(items)
+			};
+		});
+
+		editor.addButton('fontselect', function() {
+			var defaultFontsFormats =
+				'Andale Mono=andale mono,monospace;' +
+				'Arial=arial,helvetica,sans-serif;' +
+				'Arial Black=arial black,sans-serif;' +
+				'Book Antiqua=book antiqua,palatino,serif;' +
+				'Comic Sans MS=comic sans ms,sans-serif;' +
+				'Courier New=courier new,courier,monospace;' +
+				'Georgia=georgia,palatino,serif;' +
+				'Helvetica=helvetica,arial,sans-serif;' +
+				'Impact=impact,sans-serif;' +
+				'Symbol=symbol;' +
+				'Tahoma=tahoma,arial,helvetica,sans-serif;' +
+				'Terminal=terminal,monaco,monospace;' +
+				'Times New Roman=times new roman,times,serif;' +
+				'Trebuchet MS=trebuchet ms,geneva,sans-serif;' +
+				'Verdana=verdana,geneva,sans-serif;' +
+				'Webdings=webdings;' +
+				'Wingdings=wingdings,zapf dingbats';
+
+			var items = [], fonts = createFormats(editor.settings.font_formats || defaultFontsFormats);
+
+			each(fonts, function(font) {
+				items.push({
+					text: {raw: font[0]},
+					value: font[1],
+					textStyle: font[1].indexOf('dings') == -1 ? 'font-family:' + font[1] : ''
+				});
+			});
+
+			return {
+				type: 'listbox',
+				text: 'Font Family',
+				tooltip: 'Font Family',
+				values: items,
+				fixedWidth: true,
+				onPostRender: createListBoxChangeHandler(items, 'fontname'),
+				onselect: function(e) {
+					if (e.control.settings.value) {
+						editor.execCommand('FontName', false, e.control.settings.value);
+					}
+				}
+			};
+		});
+
+		editor.addButton('fontsizeselect', function() {
+			var items = [], defaultFontsizeFormats = '8pt 10pt 12pt 14pt 18pt 24pt 36pt';
+			var fontsize_formats = editor.settings.fontsize_formats || defaultFontsizeFormats;
+
+			each(fontsize_formats.split(' '), function(item) {
+				var text = item, value = item;
+				// Allow text=value font sizes.
+				var values = item.split('=');
+				if (values.length > 1) {
+					text = values[0];
+					value = values[1];
+				}
+				items.push({text: text, value: value});
+			});
+
+			return {
+				type: 'listbox',
+				text: 'Font Sizes',
+				tooltip: 'Font Sizes',
+				values: items,
+				fixedWidth: true,
+				onPostRender: createListBoxChangeHandler(items, 'fontsize'),
+				onclick: function(e) {
+					if (e.control.settings.value) {
+						editor.execCommand('FontSize', false, e.control.settings.value);
+					}
+				}
+			};
+		});
+
+		editor.addMenuItem('formats', {
+			text: 'Formats',
+			menu: formatMenu
+		});
+	}
+});
+
+// Included from: js/tinymce/classes/ui/GridLayout.js
+
+/**
+ * GridLayout.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This layout manager places controls in a grid.
+ *
+ * @setting {Number} spacing Spacing between controls.
+ * @setting {Number} spacingH Horizontal spacing between controls.
+ * @setting {Number} spacingV Vertical spacing between controls.
+ * @setting {Number} columns Number of columns to use.
+ * @setting {String/Array} alignH start|end|center|stretch or array of values for each column.
+ * @setting {String/Array} alignV start|end|center|stretch or array of values for each column.
+ * @setting {String} pack start|end
+ *
+ * @class tinymce.ui.GridLayout
+ * @extends tinymce.ui.AbsoluteLayout
+ */
+define("tinymce/ui/GridLayout", [
+	"tinymce/ui/AbsoluteLayout"
+], function(AbsoluteLayout) {
+	"use strict";
+
+	return AbsoluteLayout.extend({
+		/**
+		 * Recalculates the positions of the controls in the specified container.
+		 *
+		 * @method recalc
+		 * @param {tinymce.ui.Container} container Container instance to recalc.
+		 */
+		recalc: function(container) {
+			var settings = container.settings, rows, cols, items, contLayoutRect, width, height, rect,
+				ctrlLayoutRect, ctrl, x, y, posX, posY, ctrlSettings, contPaddingBox, align, spacingH, spacingV, alignH, alignV, maxX, maxY,
+				colWidths = [], rowHeights = [], ctrlMinWidth, ctrlMinHeight, availableWidth, availableHeight, reverseRows, idx;
+
+			// Get layout settings
+			settings = container.settings;
+			items = container.items().filter(':visible');
+			contLayoutRect = container.layoutRect();
+			cols = settings.columns || Math.ceil(Math.sqrt(items.length));
+			rows = Math.ceil(items.length / cols);
+			spacingH = settings.spacingH || settings.spacing || 0;
+			spacingV = settings.spacingV || settings.spacing || 0;
+			alignH = settings.alignH || settings.align;
+			alignV = settings.alignV || settings.align;
+			contPaddingBox = container._paddingBox;
+			reverseRows = 'reverseRows' in settings ? settings.reverseRows : container.isRtl();
+
+			if (alignH && typeof alignH == "string") {
+				alignH = [alignH];
+			}
+
+			if (alignV && typeof alignV == "string") {
+				alignV = [alignV];
+			}
+
+			// Zero padd columnWidths
+			for (x = 0; x < cols; x++) {
+				colWidths.push(0);
+			}
+
+			// Zero padd rowHeights
+			for (y = 0; y < rows; y++) {
+				rowHeights.push(0);
+			}
+
+			// Calculate columnWidths and rowHeights
+			for (y = 0; y < rows; y++) {
+				for (x = 0; x < cols; x++) {
+					ctrl = items[y * cols + x];
+
+					// Out of bounds
+					if (!ctrl) {
+						break;
+					}
+
+					ctrlLayoutRect = ctrl.layoutRect();
+					ctrlMinWidth = ctrlLayoutRect.minW;
+					ctrlMinHeight = ctrlLayoutRect.minH;
+
+					colWidths[x] = ctrlMinWidth > colWidths[x] ? ctrlMinWidth : colWidths[x];
+					rowHeights[y] = ctrlMinHeight > rowHeights[y] ? ctrlMinHeight : rowHeights[y];
+				}
+			}
+
+			// Calculate maxX
+			availableWidth = contLayoutRect.innerW - contPaddingBox.left - contPaddingBox.right;
+			for (maxX = 0, x = 0; x < cols; x++) {
+				maxX += colWidths[x] + (x > 0 ? spacingH : 0);
+				availableWidth -= (x > 0 ? spacingH : 0) + colWidths[x];
+			}
+
+			// Calculate maxY
+			availableHeight = contLayoutRect.innerH - contPaddingBox.top - contPaddingBox.bottom;
+			for (maxY = 0, y = 0; y < rows; y++) {
+				maxY += rowHeights[y] + (y > 0 ? spacingV : 0);
+				availableHeight -= (y > 0 ? spacingV : 0) + rowHeights[y];
+			}
+
+			maxX += contPaddingBox.left + contPaddingBox.right;
+			maxY += contPaddingBox.top + contPaddingBox.bottom;
+
+			// Calculate minW/minH
+			rect = {};
+			rect.minW = maxX + (contLayoutRect.w - contLayoutRect.innerW);
+			rect.minH = maxY + (contLayoutRect.h - contLayoutRect.innerH);
+
+			rect.contentW = rect.minW - contLayoutRect.deltaW;
+			rect.contentH = rect.minH - contLayoutRect.deltaH;
+			rect.minW = Math.min(rect.minW, contLayoutRect.maxW);
+			rect.minH = Math.min(rect.minH, contLayoutRect.maxH);
+			rect.minW = Math.max(rect.minW, contLayoutRect.startMinWidth);
+			rect.minH = Math.max(rect.minH, contLayoutRect.startMinHeight);
+
+			// Resize container container if minSize was changed
+			if (contLayoutRect.autoResize && (rect.minW != contLayoutRect.minW || rect.minH != contLayoutRect.minH)) {
+				rect.w = rect.minW;
+				rect.h = rect.minH;
+
+				container.layoutRect(rect);
+				this.recalc(container);
+
+				// Forced recalc for example if items are hidden/shown
+				if (container._lastRect === null) {
+					var parentCtrl = container.parent();
+					if (parentCtrl) {
+						parentCtrl._lastRect = null;
+						parentCtrl.recalc();
+					}
+				}
+
+				return;
+			}
+
+			// Update contentW/contentH so absEnd moves correctly
+			if (contLayoutRect.autoResize) {
+				rect = container.layoutRect(rect);
+				rect.contentW = rect.minW - contLayoutRect.deltaW;
+				rect.contentH = rect.minH - contLayoutRect.deltaH;
+			}
+
+			var flexV;
+
+			if (settings.packV == 'start') {
+				flexV = 0;
+			} else {
+				flexV = availableHeight > 0 ? Math.floor(availableHeight / rows) : 0;
+			}
+
+			// Calculate totalFlex
+			var totalFlex = 0;
+			var flexWidths = settings.flexWidths;
+			if (flexWidths) {
+				for (x = 0; x < flexWidths.length; x++) {
+					totalFlex += flexWidths[x];
+				}
+			} else {
+				totalFlex = cols;
+			}
+
+			// Calculate new column widths based on flex values
+			var ratio = availableWidth / totalFlex;
+			for (x = 0; x < cols; x++) {
+				colWidths[x] += flexWidths ? flexWidths[x] * ratio : ratio;
+			}
+
+			// Move/resize controls
+			posY = contPaddingBox.top;
+			for (y = 0; y < rows; y++) {
+				posX = contPaddingBox.left;
+				height = rowHeights[y] + flexV;
+
+				for (x = 0; x < cols; x++) {
+					if (reverseRows) {
+						idx = y * cols + cols - 1 - x;
+					} else {
+						idx = y * cols + x;
+					}
+
+					ctrl = items[idx];
+
+					// No more controls to render then break
+					if (!ctrl) {
+						break;
+					}
+
+					// Get control settings and calculate x, y
+					ctrlSettings = ctrl.settings;
+					ctrlLayoutRect = ctrl.layoutRect();
+					width = Math.max(colWidths[x], ctrlLayoutRect.startMinWidth);
+					ctrlLayoutRect.x = posX;
+					ctrlLayoutRect.y = posY;
+
+					// Align control horizontal
+					align = ctrlSettings.alignH || (alignH ? (alignH[x] || alignH[0]) : null);
+					if (align == "center") {
+						ctrlLayoutRect.x = posX + (width / 2) - (ctrlLayoutRect.w / 2);
+					} else if (align == "right") {
+						ctrlLayoutRect.x = posX + width - ctrlLayoutRect.w;
+					} else if (align == "stretch") {
+						ctrlLayoutRect.w = width;
+					}
+
+					// Align control vertical
+					align = ctrlSettings.alignV || (alignV ? (alignV[x] || alignV[0]) : null);
+					if (align == "center") {
+						ctrlLayoutRect.y = posY + (height / 2) - (ctrlLayoutRect.h / 2);
+					} else if (align == "bottom") {
+						ctrlLayoutRect.y = posY + height - ctrlLayoutRect.h;
+					} else if (align == "stretch") {
+						ctrlLayoutRect.h = height;
+					}
+
+					ctrl.layoutRect(ctrlLayoutRect);
+
+					posX += width + spacingH;
+
+					if (ctrl.recalc) {
+						ctrl.recalc();
+					}
+				}
+
+				posY += height + spacingV;
+			}
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/Iframe.js
+
+/**
+ * Iframe.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*jshint scripturl:true */
+
+/**
+ * This class creates an iframe.
+ *
+ * @setting {String} url Url to open in the iframe.
+ *
+ * @-x-less Iframe.less
+ * @class tinymce.ui.Iframe
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/Iframe", [
+	"tinymce/ui/Widget"
+], function(Widget) {
+	"use strict";
+
+	return Widget.extend({
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this;
+
+			self.addClass('iframe');
+			self.canFocus = false;
+
+			/*eslint no-script-url:0 */
+			return (
+				'<iframe id="' + self._id + '" class="' + self.classes() + '" tabindex="-1" src="' +
+				(self.settings.url || "javascript:\'\'") + '" frameborder="0"></iframe>'
+			);
+		},
+
+		/**
+		 * Setter for the iframe source.
+		 *
+		 * @method src
+		 * @param {String} src Source URL for iframe.
+		 */
+		src: function(src) {
+			this.getEl().src = src;
+		},
+
+		/**
+		 * Inner HTML for the iframe.
+		 *
+		 * @method html
+		 * @param {String} html HTML string to set as HTML inside the iframe.
+		 * @param {function} callback Optional callback to execute when the iframe body is filled with contents.
+		 * @return {tinymce.ui.Iframe} Current iframe control.
+		 */
+		html: function(html, callback) {
+			var self = this, body = this.getEl().contentWindow.document.body;
+
+			// Wait for iframe to initialize IE 10 takes time
+			if (!body) {
+				setTimeout(function() {
+					self.html(html);
+				}, 0);
+			} else {
+				body.innerHTML = html;
+
+				if (callback) {
+					callback();
+				}
+			}
+
+			return this;
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/Label.js
+
+/**
+ * Label.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class creates a label element. A label is a simple text control
+ * that can be bound to other controls.
+ *
+ * @-x-less Label.less
+ * @class tinymce.ui.Label
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/Label", [
+	"tinymce/ui/Widget",
+	"tinymce/ui/DomUtils"
+], function(Widget, DomUtils) {
+	"use strict";
+
+	return Widget.extend({
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @param {Boolean} multiline Multiline label.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self._super(settings);
+			self.addClass('widget');
+			self.addClass('label');
+			self.canFocus = false;
+
+			if (settings.multiline) {
+				self.addClass('autoscroll');
+			}
+
+			if (settings.strong) {
+				self.addClass('strong');
+			}
+		},
+
+		/**
+		 * Initializes the current controls layout rect.
+		 * This will be executed by the layout managers to determine the
+		 * default minWidth/minHeight etc.
+		 *
+		 * @method initLayoutRect
+		 * @return {Object} Layout rect instance.
+		 */
+		initLayoutRect: function() {
+			var self = this, layoutRect = self._super();
+
+			if (self.settings.multiline) {
+				var size = DomUtils.getSize(self.getEl());
+
+				// Check if the text fits within maxW if not then try word wrapping it
+				if (size.width > layoutRect.maxW) {
+					layoutRect.minW = layoutRect.maxW;
+					self.addClass('multiline');
+				}
+
+				self.getEl().style.width = layoutRect.minW + 'px';
+				layoutRect.startMinH = layoutRect.h = layoutRect.minH = Math.min(layoutRect.maxH, DomUtils.getSize(self.getEl()).height);
+			}
+
+			return layoutRect;
+		},
+
+		/**
+		 * Repaints the control after a layout operation.
+		 *
+		 * @method repaint
+		 */
+		repaint: function() {
+			var self = this;
+
+			if (!self.settings.multiline) {
+				self.getEl().style.lineHeight = self.layoutRect().h + 'px';
+			}
+
+			return self._super();
+		},
+
+		/**
+		 * Sets/gets the current label text.
+		 *
+		 * @method text
+		 * @param {String} [text] New label text.
+		 * @return {String|tinymce.ui.Label} Current text or current label instance.
+		 */
+		text: function(text) {
+			var self = this;
+
+			if (self._rendered && text) {
+				this.innerHtml(self.encode(text));
+			}
+
+			return self._super(text);
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, forId = self.settings.forId;
+
+			return (
+				'<label id="' + self._id + '" class="' + self.classes() + '"' + (forId ? ' for="' + forId + '"' : '') + '>' +
+					self.encode(self._text) +
+				'</label>'
+			);
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/Toolbar.js
+
+/**
+ * Toolbar.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new toolbar.
+ *
+ * @class tinymce.ui.Toolbar
+ * @extends tinymce.ui.Container
+ */
+define("tinymce/ui/Toolbar", [
+	"tinymce/ui/Container"
+], function(Container) {
+	"use strict";
+
+	return Container.extend({
+		Defaults: {
+			role: 'toolbar',
+			layout: 'flow'
+		},
+
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self._super(settings);
+			self.addClass('toolbar');
+		},
+
+		/**
+		 * Called after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this;
+
+			self.items().addClass('toolbar-item');
+
+			return self._super();
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/MenuBar.js
+
+/**
+ * MenuBar.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new menubar.
+ *
+ * @-x-less MenuBar.less
+ * @class tinymce.ui.MenuBar
+ * @extends tinymce.ui.Toolbar
+ */
+define("tinymce/ui/MenuBar", [
+	"tinymce/ui/Toolbar"
+], function(Toolbar) {
+	"use strict";
+
+	return Toolbar.extend({
+		Defaults: {
+			role: 'menubar',
+			containerCls: 'menubar',
+			ariaRoot: true,
+			defaults: {
+				type: 'menubutton'
+			}
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/MenuButton.js
+
+/**
+ * MenuButton.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new menu button.
+ *
+ * @-x-less MenuButton.less
+ * @class tinymce.ui.MenuButton
+ * @extends tinymce.ui.Button
+ */
+define("tinymce/ui/MenuButton", [
+	"tinymce/ui/Button",
+	"tinymce/ui/Factory",
+	"tinymce/ui/MenuBar"
+], function(Button, Factory, MenuBar) {
+	"use strict";
+
+	// TODO: Maybe add as some global function
+	function isChildOf(node, parent) {
+		while (node) {
+			if (parent === node) {
+				return true;
+			}
+
+			node = node.parentNode;
+		}
+
+		return false;
+	}
+
+	var MenuButton = Button.extend({
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self._renderOpen = true;
+			self._super(settings);
+
+			self.addClass('menubtn');
+
+			if (settings.fixedWidth) {
+				self.addClass('fixed-width');
+			}
+
+			self.aria('haspopup', true);
+			self.hasPopup = true;
+		},
+
+		/**
+		 * Shows the menu for the button.
+		 *
+		 * @method showMenu
+		 */
+		showMenu: function() {
+			var self = this, settings = self.settings, menu;
+
+			if (self.menu && self.menu.visible()) {
+				return self.hideMenu();
+			}
+
+			if (!self.menu) {
+				menu = settings.menu || [];
+
+				// Is menu array then auto constuct menu control
+				if (menu.length) {
+					menu = {
+						type: 'menu',
+						items: menu
+					};
+				} else {
+					menu.type = menu.type || 'menu';
+				}
+
+				self.menu = Factory.create(menu).parent(self).renderTo();
+				self.fire('createmenu');
+				self.menu.reflow();
+				self.menu.on('cancel', function(e) {
+					if (e.control.parent() === self.menu) {
+						e.stopPropagation();
+						self.focus();
+						self.hideMenu();
+					}
+				});
+
+				// Move focus to button when a menu item is selected/clicked
+				self.menu.on('select', function() {
+					self.focus();
+				});
+
+				self.menu.on('show hide', function(e) {
+					if (e.control == self.menu) {
+						self.activeMenu(e.type == 'show');
+					}
+
+					self.aria('expanded', e.type == 'show');
+				}).fire('show');
+			}
+
+			self.menu.show();
+			self.menu.layoutRect({w: self.layoutRect().w});
+			self.menu.moveRel(self.getEl(), self.isRtl() ? ['br-tr', 'tr-br'] : ['bl-tl', 'tl-bl']);
+		},
+
+		/**
+		 * Hides the menu for the button.
+		 *
+		 * @method hideMenu
+		 */
+		hideMenu: function() {
+			var self = this;
+
+			if (self.menu) {
+				self.menu.items().each(function(item) {
+					if (item.hideMenu) {
+						item.hideMenu();
+					}
+				});
+
+				self.menu.hide();
+			}
+		},
+
+		/**
+		 * Sets the active menu state.
+		 *
+		 * @private
+		 */
+		activeMenu: function(state) {
+			this.toggleClass('active', state);
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, id = self._id, prefix = self.classPrefix;
+			var icon = self.settings.icon, image;
+
+			image = self.settings.image;
+			if (image) {
+				icon = 'none';
+
+				// Support for [high dpi, low dpi] image sources
+				if (typeof image != "string") {
+					image = window.getSelection ? image[0] : image[1];
+				}
+
+				image = ' style="background-image: url(\'' + image + '\')"';
+			} else {
+				image = '';
+			}
+
+			icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
+
+			self.aria('role', self.parent() instanceof MenuBar ? 'menuitem' : 'button');
+
+			return (
+				'<div id="' + id + '" class="' + self.classes() + '" tabindex="-1" aria-labelledby="' + id + '">' +
+					'<button id="' + id + '-open" role="presentation" type="button" tabindex="-1">' +
+						(icon ? '<i class="' + icon + '"' + image + '></i>' : '') +
+						'<span>' + (self._text ? (icon ? '\u00a0' : '') + self.encode(self._text) : '') + '</span>' +
+						' <i class="' + prefix + 'caret"></i>' +
+					'</button>' +
+				'</div>'
+			);
+		},
+
+		/**
+		 * Gets invoked after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this;
+
+			self.on('click', function(e) {
+				if (e.control === self && isChildOf(e.target, self.getEl())) {
+					self.showMenu();
+
+					if (e.aria) {
+						self.menu.items()[0].focus();
+					}
+				}
+			});
+
+			self.on('mouseenter', function(e) {
+				var overCtrl = e.control, parent = self.parent(), hasVisibleSiblingMenu;
+
+				if (overCtrl && parent && overCtrl instanceof MenuButton && overCtrl.parent() == parent) {
+					parent.items().filter('MenuButton').each(function(ctrl) {
+						if (ctrl.hideMenu && ctrl != overCtrl) {
+							if (ctrl.menu && ctrl.menu.visible()) {
+								hasVisibleSiblingMenu = true;
+							}
+
+							ctrl.hideMenu();
+						}
+					});
+
+					if (hasVisibleSiblingMenu) {
+						overCtrl.focus(); // Fix for: #5887
+						overCtrl.showMenu();
+					}
+				}
+			});
+
+			return self._super();
+		},
+
+		/**
+		 * Sets/gets the current button text.
+		 *
+		 * @method text
+		 * @param {String} [text] New button text.
+		 * @return {String|tinymce.ui.MenuButton} Current text or current MenuButton instance.
+		 */
+		text: function(text) {
+			var self = this, i, children;
+
+			if (self._rendered) {
+				children = self.getEl('open').getElementsByTagName('span');
+				for (i = 0; i < children.length; i++) {
+					children[i].innerHTML = (self.settings.icon && text ? '\u00a0' : '') + self.encode(text);
+				}
+			}
+
+			return this._super(text);
+		},
+
+		/**
+		 * Removes the control and it's menus.
+		 *
+		 * @method remove
+		 */
+		remove: function() {
+			this._super();
+
+			if (this.menu) {
+				this.menu.remove();
+			}
+		}
+	});
+
+	return MenuButton;
+});
+
+// Included from: js/tinymce/classes/ui/ListBox.js
+
+/**
+ * ListBox.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new list box control.
+ *
+ * @-x-less ListBox.less
+ * @class tinymce.ui.ListBox
+ * @extends tinymce.ui.MenuButton
+ */
+define("tinymce/ui/ListBox", [
+	"tinymce/ui/MenuButton"
+], function(MenuButton) {
+	"use strict";
+
+	return MenuButton.extend({
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {Array} values Array with values to add to list box.
+		 */
+		init: function(settings) {
+			var self = this, values, selected, selectedText, lastItemCtrl;
+
+			function setSelected(menuValues) {
+				// Try to find a selected value
+				for (var i = 0; i < menuValues.length; i++) {
+					selected = menuValues[i].selected || settings.value === menuValues[i].value;
+
+					if (selected) {
+						selectedText = selectedText || menuValues[i].text;
+						self._value = menuValues[i].value;
+						break;
+					}
+
+					// If the value has a submenu, try to find the selected values in that menu
+					if (menuValues[i].menu) {
+						setSelected(menuValues[i].menu);
+					}
+				}
+			}
+
+			self._values = values = settings.values;
+			if (values) {
+				setSelected(values);
+
+				// Default with first item
+				if (!selected && values.length > 0) {
+					selectedText = values[0].text;
+					self._value = values[0].value;
+				}
+
+				settings.menu = values;
+			}
+
+			settings.text = settings.text || selectedText || values[0].text;
+
+			self._super(settings);
+			self.addClass('listbox');
+
+			self.on('select', function(e) {
+				var ctrl = e.control;
+
+				if (lastItemCtrl) {
+					e.lastControl = lastItemCtrl;
+				}
+
+				if (settings.multiple) {
+					ctrl.active(!ctrl.active());
+				} else {
+					self.value(e.control.settings.value);
+				}
+
+				lastItemCtrl = ctrl;
+			});
+		},
+
+		/**
+		 * Getter/setter function for the control value.
+		 *
+		 * @method value
+		 * @param {String} [value] Value to be set.
+		 * @return {Boolean/tinymce.ui.ListBox} Value or self if it's a set operation.
+		 */
+		value: function(value) {
+			var self = this, active, selectedText, menu;
+
+			function activateByValue(menu, value) {
+				menu.items().each(function(ctrl) {
+					active = ctrl.value() === value;
+
+					if (active) {
+						selectedText = selectedText || ctrl.text();
+					}
+
+					ctrl.active(active);
+
+					if (ctrl.menu) {
+						activateByValue(ctrl.menu, value);
+					}
+				});
+			}
+
+			function setActiveValues(menuValues) {
+				for (var i = 0; i < menuValues.length; i++) {
+					active = menuValues[i].value == value;
+
+					if (active) {
+						selectedText = selectedText || menuValues[i].text;
+					}
+
+					menuValues[i].active = active;
+
+					if (menuValues[i].menu) {
+						setActiveValues(menuValues[i].menu);
+					}
+				}
+			}
+
+			if (typeof value != "undefined") {
+				if (self.menu) {
+					activateByValue(self.menu, value);
+				} else {
+					menu = self.settings.menu;
+					setActiveValues(menu);
+				}
+
+				self.text(selectedText || this.settings.text);
+			}
+
+			return self._super(value);
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/MenuItem.js
+
+/**
+ * MenuItem.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new menu item.
+ *
+ * @-x-less MenuItem.less
+ * @class tinymce.ui.MenuItem
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/MenuItem", [
+	"tinymce/ui/Widget",
+	"tinymce/ui/Factory",
+	"tinymce/Env"
+], function(Widget, Factory, Env) {
+	"use strict";
+
+	return Widget.extend({
+		Defaults: {
+			border: 0,
+			role: 'menuitem'
+		},
+
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {Boolean} selectable Selectable menu.
+		 * @setting {Array} menu Submenu array with items.
+		 * @setting {String} shortcut Shortcut to display for menu item. Example: Ctrl+X
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self.hasPopup = true;
+
+			self._super(settings);
+
+			settings = self.settings;
+
+			self.addClass('menu-item');
+
+			if (settings.menu) {
+				self.addClass('menu-item-expand');
+			}
+
+			if (settings.preview) {
+				self.addClass('menu-item-preview');
+			}
+
+			if (self._text === '-' || self._text === '|') {
+				self.addClass('menu-item-sep');
+				self.aria('role', 'separator');
+				self._text = '-';
+			}
+
+			if (settings.selectable) {
+				self.aria('role', 'menuitemcheckbox');
+				self.addClass('menu-item-checkbox');
+				settings.icon = 'selected';
+			}
+
+			if (!settings.preview && !settings.selectable) {
+				self.addClass('menu-item-normal');
+			}
+
+			self.on('mousedown', function(e) {
+				e.preventDefault();
+			});
+
+			if (settings.menu && !settings.ariaHideMenu) {
+				self.aria('haspopup', true);
+			}
+		},
+
+		/**
+		 * Returns true/false if the menuitem has sub menu.
+		 *
+		 * @method hasMenus
+		 * @return {Boolean} True/false state if it has submenu.
+		 */
+		hasMenus: function() {
+			return !!this.settings.menu;
+		},
+
+		/**
+		 * Shows the menu for the menu item.
+		 *
+		 * @method showMenu
+		 */
+		showMenu: function() {
+			var self = this, settings = self.settings, menu, parent = self.parent();
+
+			parent.items().each(function(ctrl) {
+				if (ctrl !== self) {
+					ctrl.hideMenu();
+				}
+			});
+
+			if (settings.menu) {
+				menu = self.menu;
+
+				if (!menu) {
+					menu = settings.menu;
+
+					// Is menu array then auto constuct menu control
+					if (menu.length) {
+						menu = {
+							type: 'menu',
+							items: menu
+						};
+					} else {
+						menu.type = menu.type || 'menu';
+					}
+
+					if (parent.settings.itemDefaults) {
+						menu.itemDefaults = parent.settings.itemDefaults;
+					}
+
+					menu = self.menu = Factory.create(menu).parent(self).renderTo();
+					menu.reflow();
+					menu.on('cancel', function(e) {
+						e.stopPropagation();
+						self.focus();
+						menu.hide();
+					});
+					menu.on('show hide', function(e) {
+						e.control.items().each(function(ctrl) {
+							ctrl.active(ctrl.settings.selected);
+						});
+					}).fire('show');
+
+					menu.on('hide', function(e) {
+						if (e.control === menu) {
+							self.removeClass('selected');
+						}
+					});
+
+					menu.submenu = true;
+				} else {
+					menu.show();
+				}
+
+				menu._parentMenu = parent;
+
+				menu.addClass('menu-sub');
+
+				var rel = menu.testMoveRel(
+					self.getEl(),
+					self.isRtl() ? ['tl-tr', 'bl-br', 'tr-tl', 'br-bl'] : ['tr-tl', 'br-bl', 'tl-tr', 'bl-br']
+				);
+
+				menu.moveRel(self.getEl(), rel);
+				menu.rel = rel;
+
+				rel = 'menu-sub-' + rel;
+				menu.removeClass(menu._lastRel);
+				menu.addClass(rel);
+				menu._lastRel = rel;
+
+				self.addClass('selected');
+				self.aria('expanded', true);
+			}
+		},
+
+		/**
+		 * Hides the menu for the menu item.
+		 *
+		 * @method hideMenu
+		 */
+		hideMenu: function() {
+			var self = this;
+
+			if (self.menu) {
+				self.menu.items().each(function(item) {
+					if (item.hideMenu) {
+						item.hideMenu();
+					}
+				});
+
+				self.menu.hide();
+				self.aria('expanded', false);
+			}
+
+			return self;
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, id = self._id, settings = self.settings, prefix = self.classPrefix, text = self.encode(self._text);
+			var icon = self.settings.icon, image = '', shortcut = settings.shortcut;
+
+			// Converts shortcut format to Mac/PC variants
+			function convertShortcut(shortcut) {
+				var i, value, replace = {};
+
+				if (Env.mac) {
+					replace = {
+						alt: '&#x2325;',
+						ctrl: '&#x2318;',
+						shift: '&#x21E7;',
+						meta: '&#x2318;'
+					};
+				} else {
+					replace = {
+						meta: 'Ctrl'
+					};
+				}
+
+				shortcut = shortcut.split('+');
+
+				for (i = 0; i < shortcut.length; i++) {
+					value = replace[shortcut[i].toLowerCase()];
+
+					if (value) {
+						shortcut[i] = value;
+					}
+				}
+
+				return shortcut.join('+');
+			}
+
+			if (icon) {
+				self.parent().addClass('menu-has-icons');
+			}
+
+			if (settings.image) {
+				icon = 'none';
+				image = ' style="background-image: url(\'' + settings.image + '\')"';
+			}
+
+			if (shortcut) {
+				shortcut = convertShortcut(shortcut);
+			}
+
+			icon = prefix + 'ico ' + prefix + 'i-' + (self.settings.icon || 'none');
+
+			return (
+				'<div id="' + id + '" class="' + self.classes() + '" tabindex="-1">' +
+					(text !== '-' ? '<i class="' + icon + '"' + image + '></i>\u00a0' : '') +
+					(text !== '-' ? '<span id="' + id + '-text" class="' + prefix + 'text">' + text + '</span>' : '') +
+					(shortcut ? '<div id="' + id + '-shortcut" class="' + prefix + 'menu-shortcut">' + shortcut + '</div>' : '') +
+					(settings.menu ? '<div class="' + prefix + 'caret"></div>' : '') +
+				'</div>'
+			);
+		},
+
+		/**
+		 * Gets invoked after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this, settings = self.settings;
+
+			var textStyle = settings.textStyle;
+			if (typeof textStyle == "function") {
+				textStyle = textStyle.call(this);
+			}
+
+			if (textStyle) {
+				var textElm = self.getEl('text');
+				if (textElm) {
+					textElm.setAttribute('style', textStyle);
+				}
+			}
+
+			self.on('mouseenter click', function(e) {
+				if (e.control === self) {
+					if (!settings.menu && e.type === 'click') {
+						self.fire('select');
+						self.parent().hideAll();
+					} else {
+						self.showMenu();
+
+						if (e.aria) {
+							self.menu.focus(true);
+						}
+					}
+				}
+			});
+
+			self._super();
+
+			return self;
+		},
+
+		active: function(state) {
+			if (typeof state != "undefined") {
+				this.aria('checked', state);
+			}
+
+			return this._super(state);
+		},
+
+		/**
+		 * Removes the control and it's menus.
+		 *
+		 * @method remove
+		 */
+		remove: function() {
+			this._super();
+
+			if (this.menu) {
+				this.menu.remove();
+			}
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/Menu.js
+
+/**
+ * Menu.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new menu.
+ *
+ * @-x-less Menu.less
+ * @class tinymce.ui.Menu
+ * @extends tinymce.ui.FloatPanel
+ */
+define("tinymce/ui/Menu", [
+	"tinymce/ui/FloatPanel",
+	"tinymce/ui/MenuItem",
+	"tinymce/util/Tools"
+], function(FloatPanel, MenuItem, Tools) {
+	"use strict";
+
+	var Menu = FloatPanel.extend({
+		Defaults: {
+			defaultType: 'menuitem',
+			border: 1,
+			layout: 'stack',
+			role: 'application',
+			bodyRole: 'menu',
+			ariaRoot: true
+		},
+
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			settings.autohide = true;
+			settings.constrainToViewport = true;
+
+			if (settings.itemDefaults) {
+				var items = settings.items, i = items.length;
+
+				while (i--) {
+					items[i] = Tools.extend({}, settings.itemDefaults, items[i]);
+				}
+			}
+
+			self._super(settings);
+			self.addClass('menu');
+		},
+
+		/**
+		 * Repaints the control after a layout operation.
+		 *
+		 * @method repaint
+		 */
+		repaint: function() {
+			this.toggleClass('menu-align', true);
+
+			this._super();
+
+			this.getEl().style.height = '';
+			this.getEl('body').style.height = '';
+
+			return this;
+		},
+
+		/**
+		 * Hides/closes the menu.
+		 *
+		 * @method cancel
+		 */
+		cancel: function() {
+			var self = this;
+
+			self.hideAll();
+			self.fire('select');
+		},
+
+		/**
+		 * Hide menu and all sub menus.
+		 *
+		 * @method hideAll
+		 */
+		hideAll: function() {
+			var self = this;
+
+			this.find('menuitem').exec('hideMenu');
+
+			return self._super();
+		},
+/*
+		getContainerElm: function() {
+			var doc = document, id = this.classPrefix + 'menucontainer';
+
+			var elm = doc.getElementById(id);
+			if (!elm) {
+				elm = doc.createElement('div');
+				elm.id = id;
+				elm.setAttribute('role', 'application');
+				elm.className = this.classPrefix + '-reset';
+				elm.style.position = 'absolute';
+				elm.style.top = elm.style.left = '0';
+				elm.style.overflow = 'visible';
+				doc.body.appendChild(elm);
+			}
+
+			return elm;
+		},
+*/
+		/**
+		 * Invoked before the menu is rendered.
+		 *
+		 * @method preRender
+		 */
+		preRender: function() {
+			var self = this;
+
+			self.items().each(function(ctrl) {
+				var settings = ctrl.settings;
+
+				if (settings.icon || settings.selectable) {
+					self._hasIcons = true;
+					return false;
+				}
+			});
+
+			return self._super();
+		}
+	});
+
+	return Menu;
+});
+
+// Included from: js/tinymce/classes/ui/Radio.js
+
+/**
+ * Radio.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new radio button.
+ *
+ * @-x-less Radio.less
+ * @class tinymce.ui.Radio
+ * @extends tinymce.ui.Checkbox
+ */
+define("tinymce/ui/Radio", [
+	"tinymce/ui/Checkbox"
+], function(Checkbox) {
+	"use strict";
+
+	return Checkbox.extend({
+		Defaults: {
+			classes: "radio",
+			role: "radio"
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/ResizeHandle.js
+
+/**
+ * ResizeHandle.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Renders a resize handle that fires ResizeStart, Resize and ResizeEnd events.
+ *
+ * @-x-less ResizeHandle.less
+ * @class tinymce.ui.ResizeHandle
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/ResizeHandle", [
+	"tinymce/ui/Widget",
+	"tinymce/ui/DragHelper"
+], function(Widget, DragHelper) {
+	"use strict";
+
+	return Widget.extend({
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, prefix = self.classPrefix;
+
+			self.addClass('resizehandle');
+
+			if (self.settings.direction == "both") {
+				self.addClass('resizehandle-both');
+			}
+
+			self.canFocus = false;
+
+			return (
+				'<div id="' + self._id + '" class="' + self.classes() + '">' +
+					'<i class="' + prefix + 'ico ' + prefix + 'i-resize"></i>' +
+				'</div>'
+			);
+		},
+
+		/**
+		 * Called after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this;
+
+			self._super();
+
+			self.resizeDragHelper = new DragHelper(this._id, {
+				start: function() {
+					self.fire('ResizeStart');
+				},
+
+				drag: function(e) {
+					if (self.settings.direction != "both") {
+						e.deltaX = 0;
+					}
+
+					self.fire('Resize', e);
+				},
+
+				stop: function() {
+					self.fire('ResizeEnd');
+				}
+			});
+		},
+
+		remove: function() {
+			if (this.resizeDragHelper) {
+				this.resizeDragHelper.destroy();
+			}
+
+			return this._super();
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/Spacer.js
+
+/**
+ * Spacer.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a spacer. This control is used in flex layouts for example.
+ *
+ * @-x-less Spacer.less
+ * @class tinymce.ui.Spacer
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/Spacer", [
+	"tinymce/ui/Widget"
+], function(Widget) {
+	"use strict";
+
+	return Widget.extend({
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this;
+
+			self.addClass('spacer');
+			self.canFocus = false;
+
+			return '<div id="' + self._id + '" class="' + self.classes() + '"></div>';
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/SplitButton.js
+
+/**
+ * SplitButton.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a split button.
+ *
+ * @-x-less SplitButton.less
+ * @class tinymce.ui.SplitButton
+ * @extends tinymce.ui.MenuButton
+ */
+define("tinymce/ui/SplitButton", [
+	"tinymce/ui/MenuButton",
+	"tinymce/ui/DomUtils"
+], function(MenuButton, DomUtils) {
+	return MenuButton.extend({
+		Defaults: {
+			classes: "widget btn splitbtn",
+			role: "button"
+		},
+
+		/**
+		 * Repaints the control after a layout operation.
+		 *
+		 * @method repaint
+		 */
+		repaint: function() {
+			var self = this, elm = self.getEl(), rect = self.layoutRect(), mainButtonElm, menuButtonElm;
+
+			self._super();
+
+			mainButtonElm = elm.firstChild;
+			menuButtonElm = elm.lastChild;
+
+			DomUtils.css(mainButtonElm, {
+				width: rect.w - DomUtils.getSize(menuButtonElm).width,
+				height: rect.h - 2
+			});
+
+			DomUtils.css(menuButtonElm, {
+				height: rect.h - 2
+			});
+
+			return self;
+		},
+
+		/**
+		 * Sets the active menu state.
+		 *
+		 * @private
+		 */
+		activeMenu: function(state) {
+			var self = this;
+
+			DomUtils.toggleClass(self.getEl().lastChild, self.classPrefix + 'active', state);
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, id = self._id, prefix = self.classPrefix, image;
+			var icon = self.settings.icon;
+
+			image = self.settings.image;
+			if (image) {
+				icon = 'none';
+
+				// Support for [high dpi, low dpi] image sources
+				if (typeof image != "string") {
+					image = window.getSelection ? image[0] : image[1];
+				}
+
+				image = ' style="background-image: url(\'' + image + '\')"';
+			} else {
+				image = '';
+			}
+
+			icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
+
+			return (
+				'<div id="' + id + '" class="' + self.classes() + '" role="button" tabindex="-1">' +
+					'<button type="button" hidefocus="1" tabindex="-1">' +
+						(icon ? '<i class="' + icon + '"' + image + '></i>' : '') +
+						(self._text ? (icon ? ' ' : '') + self._text : '') +
+					'</button>' +
+					'<button type="button" class="' + prefix + 'open" hidefocus="1" tabindex="-1">' +
+						//(icon ? '<i class="' + icon + '"></i>' : '') +
+						(self._menuBtnText ? (icon ? '\u00a0' : '') + self._menuBtnText : '') +
+						' <i class="' + prefix + 'caret"></i>' +
+					'</button>' +
+				'</div>'
+			);
+		},
+
+		/**
+		 * Called after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this, onClickHandler = self.settings.onclick;
+
+			self.on('click', function(e) {
+				var node = e.target;
+
+				if (e.control == this) {
+					// Find clicks that is on the main button
+					while (node) {
+						if ((e.aria && e.aria.key != 'down') || (node.nodeName == 'BUTTON' && node.className.indexOf('open') == -1)) {
+							e.stopImmediatePropagation();
+							onClickHandler.call(this, e);
+							return;
+						}
+
+						node = node.parentNode;
+					}
+				}
+			});
+
+			delete self.settings.onclick;
+
+			return self._super();
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/StackLayout.js
+
+/**
+ * StackLayout.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This layout uses the browsers layout when the items are blocks.
+ *
+ * @-x-less StackLayout.less
+ * @class tinymce.ui.StackLayout
+ * @extends tinymce.ui.FlowLayout
+ */
+define("tinymce/ui/StackLayout", [
+	"tinymce/ui/FlowLayout"
+], function(FlowLayout) {
+	"use strict";
+
+	return FlowLayout.extend({
+		Defaults: {
+			containerClass: 'stack-layout',
+			controlClass: 'stack-layout-item',
+			endClass: 'break'
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/TabPanel.js
+
+/**
+ * TabPanel.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a tab panel control.
+ *
+ * @-x-less TabPanel.less
+ * @class tinymce.ui.TabPanel
+ * @extends tinymce.ui.Panel
+ *
+ * @setting {Number} activeTab Active tab index.
+ */
+define("tinymce/ui/TabPanel", [
+	"tinymce/ui/Panel",
+	"tinymce/ui/DomUtils"
+], function(Panel, DomUtils) {
+	"use strict";
+
+	return Panel.extend({
+		Defaults: {
+			layout: 'absolute',
+			defaults: {
+				type: 'panel'
+			}
+		},
+
+		/**
+		 * Activates the specified tab by index.
+		 *
+		 * @method activateTab
+		 * @param {Number} idx Index of the tab to activate.
+		 */
+		activateTab: function(idx) {
+			var activeTabElm;
+
+			if (this.activeTabId) {
+				activeTabElm = this.getEl(this.activeTabId);
+				DomUtils.removeClass(activeTabElm, this.classPrefix + 'active');
+				activeTabElm.setAttribute('aria-selected', "false");
+			}
+
+			this.activeTabId = 't' + idx;
+
+			activeTabElm = this.getEl('t' + idx);
+			activeTabElm.setAttribute('aria-selected', "true");
+			DomUtils.addClass(activeTabElm, this.classPrefix + 'active');
+
+			this.items()[idx].show().fire('showtab');
+			this.reflow();
+
+			this.items().each(function(item, i) {
+				if (idx != i) {
+					item.hide();
+				}
+			});
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, layout = self._layout, tabsHtml = '', prefix = self.classPrefix;
+
+			self.preRender();
+			layout.preRender(self);
+
+			self.items().each(function(ctrl, i) {
+				var id = self._id + '-t' + i;
+
+				ctrl.aria('role', 'tabpanel');
+				ctrl.aria('labelledby', id);
+
+				tabsHtml += (
+					'<div id="' + id + '" class="' + prefix + 'tab" ' +
+						'unselectable="on" role="tab" aria-controls="' + ctrl._id + '" aria-selected="false" tabIndex="-1">' +
+						self.encode(ctrl.settings.title) +
+					'</div>'
+				);
+			});
+
+			return (
+				'<div id="' + self._id + '" class="' + self.classes() + '" hidefocus="1" tabindex="-1">' +
+					'<div id="' + self._id + '-head" class="' + prefix + 'tabs" role="tablist">' +
+						tabsHtml +
+					'</div>' +
+					'<div id="' + self._id + '-body" class="' + self.classes('body') + '">' +
+						layout.renderHtml(self) +
+					'</div>' +
+				'</div>'
+			);
+		},
+
+		/**
+		 * Called after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this;
+
+			self._super();
+
+			self.settings.activeTab = self.settings.activeTab || 0;
+			self.activateTab(self.settings.activeTab);
+
+			this.on('click', function(e) {
+				var targetParent = e.target.parentNode;
+
+				if (e.target.parentNode.id == self._id + '-head') {
+					var i = targetParent.childNodes.length;
+
+					while (i--) {
+						if (targetParent.childNodes[i] == e.target) {
+							self.activateTab(i);
+						}
+					}
+				}
+			});
+		},
+
+		/**
+		 * Initializes the current controls layout rect.
+		 * This will be executed by the layout managers to determine the
+		 * default minWidth/minHeight etc.
+		 *
+		 * @method initLayoutRect
+		 * @return {Object} Layout rect instance.
+		 */
+		initLayoutRect: function() {
+			var self = this, rect, minW, minH;
+
+			minW = DomUtils.getSize(self.getEl('head')).width;
+			minW = minW < 0 ? 0 : minW;
+			minH = 0;
+
+			self.items().each(function(item) {
+				minW = Math.max(minW, item.layoutRect().minW);
+				minH = Math.max(minH, item.layoutRect().minH);
+			});
+
+			self.items().each(function(ctrl) {
+				ctrl.settings.x = 0;
+				ctrl.settings.y = 0;
+				ctrl.settings.w = minW;
+				ctrl.settings.h = minH;
+
+				ctrl.layoutRect({
+					x: 0,
+					y: 0,
+					w: minW,
+					h: minH
+				});
+			});
+
+			var headH = DomUtils.getSize(self.getEl('head')).height;
+
+			self.settings.minWidth = minW;
+			self.settings.minHeight = minH + headH;
+
+			rect = self._super();
+			rect.deltaH += headH;
+			rect.innerH = rect.h - rect.deltaH;
+
+			return rect;
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/TextBox.js
+
+/**
+ * TextBox.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new textbox.
+ *
+ * @-x-less TextBox.less
+ * @class tinymce.ui.TextBox
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/TextBox", [
+	"tinymce/ui/Widget",
+	"tinymce/ui/DomUtils"
+], function(Widget, DomUtils) {
+	"use strict";
+
+	return Widget.extend({
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {Boolean} multiline True if the textbox is a multiline control.
+		 * @setting {Number} maxLength Max length for the textbox.
+		 * @setting {Number} size Size of the textbox in characters.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self._super(settings);
+
+			self._value = settings.value || '';
+			self.addClass('textbox');
+
+			if (settings.multiline) {
+				self.addClass('multiline');
+			} else {
+				// TODO: Rework this
+				self.on('keydown', function(e) {
+					if (e.keyCode == 13) {
+						self.parents().reverse().each(function(ctrl) {
+							e.preventDefault();
+
+							if (ctrl.hasEventListeners('submit') && ctrl.toJSON) {
+								ctrl.fire('submit', {data: ctrl.toJSON()});
+								return false;
+							}
+						});
+					}
+				});
+			}
+		},
+
+		/**
+		 * Getter/setter function for the disabled state.
+		 *
+		 * @method value
+		 * @param {Boolean} [state] State to be set.
+		 * @return {Boolean|tinymce.ui.ComboBox} True/false or self if it's a set operation.
+		 */
+		disabled: function(state) {
+			var self = this;
+
+			if (self._rendered && typeof state != 'undefined') {
+				self.getEl().disabled = state;
+			}
+
+			return self._super(state);
+		},
+
+		/**
+		 * Getter/setter function for the control value.
+		 *
+		 * @method value
+		 * @param {String} [value] Value to be set.
+		 * @return {String|tinymce.ui.ComboBox} Value or self if it's a set operation.
+		 */
+		value: function(value) {
+			var self = this;
+
+			if (typeof value != "undefined") {
+				self._value = value;
+
+				if (self._rendered) {
+					self.getEl().value = value;
+				}
+
+				return self;
+			}
+
+			if (self._rendered) {
+				return self.getEl().value;
+			}
+
+			return self._value;
+		},
+
+		/**
+		 * Repaints the control after a layout operation.
+		 *
+		 * @method repaint
+		 */
+		repaint: function() {
+			var self = this, style, rect, borderBox, borderW = 0, borderH = 0, lastRepaintRect;
+
+			style = self.getEl().style;
+			rect = self._layoutRect;
+			lastRepaintRect = self._lastRepaintRect || {};
+
+			// Detect old IE 7+8 add lineHeight to align caret vertically in the middle
+			var doc = document;
+			if (!self.settings.multiline && doc.all && (!doc.documentMode || doc.documentMode <= 8)) {
+				style.lineHeight = (rect.h - borderH) + 'px';
+			}
+
+			borderBox = self._borderBox;
+			borderW = borderBox.left + borderBox.right + 8;
+			borderH = borderBox.top + borderBox.bottom + (self.settings.multiline ? 8 : 0);
+
+			if (rect.x !== lastRepaintRect.x) {
+				style.left = rect.x + 'px';
+				lastRepaintRect.x = rect.x;
+			}
+
+			if (rect.y !== lastRepaintRect.y) {
+				style.top = rect.y + 'px';
+				lastRepaintRect.y = rect.y;
+			}
+
+			if (rect.w !== lastRepaintRect.w) {
+				style.width = (rect.w - borderW) + 'px';
+				lastRepaintRect.w = rect.w;
+			}
+
+			if (rect.h !== lastRepaintRect.h) {
+				style.height = (rect.h - borderH) + 'px';
+				lastRepaintRect.h = rect.h;
+			}
+
+			self._lastRepaintRect = lastRepaintRect;
+			self.fire('repaint', {}, false);
+
+			return self;
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, id = self._id, settings = self.settings, value = self.encode(self._value, false), extraAttrs = '';
+
+			if ("spellcheck" in settings) {
+				extraAttrs += ' spellcheck="' + settings.spellcheck + '"';
+			}
+
+			if (settings.maxLength) {
+				extraAttrs += ' maxlength="' + settings.maxLength + '"';
+			}
+
+			if (settings.size) {
+				extraAttrs += ' size="' + settings.size + '"';
+			}
+
+			if (settings.subtype) {
+				extraAttrs += ' type="' + settings.subtype + '"';
+			}
+
+			if (self.disabled()) {
+				extraAttrs += ' disabled="disabled"';
+			}
+
+			if (settings.multiline) {
+				return (
+					'<textarea id="' + id + '" class="' + self.classes() + '" ' +
+					(settings.rows ? ' rows="' + settings.rows + '"' : '') +
+					' hidefocus="1"' + extraAttrs + '>' + value +
+					'</textarea>'
+				);
+			}
+
+			return '<input id="' + id + '" class="' + self.classes() + '" value="' + value + '" hidefocus="1"' + extraAttrs + ' />';
+		},
+
+		/**
+		 * Called after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this;
+
+			DomUtils.on(self.getEl(), 'change', function(e) {
+				self.fire('change', e);
+			});
+
+			return self._super();
+		},
+
+		remove: function() {
+			DomUtils.off(this.getEl());
+			this._super();
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/Throbber.js
+
+/**
+ * Throbber.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class enables you to display a Throbber for any element.
+ *
+ * @-x-less Throbber.less
+ * @class tinymce.ui.Throbber
+ */
+define("tinymce/ui/Throbber", [
+	"tinymce/ui/DomUtils",
+	"tinymce/ui/Control"
+], function(DomUtils, Control) {
+	"use strict";
+
+	/**
+	 * Constructs a new throbber.
+	 *
+	 * @constructor
+	 * @param {Element} elm DOM Html element to display throbber in.
+	 * @param {Boolean} inline Optional true/false state if the throbber should be appended to end of element for infinite scroll.
+	 */
+	return function(elm, inline) {
+		var self = this, state, classPrefix = Control.classPrefix;
+
+		/**
+		 * Shows the throbber.
+		 *
+		 * @method show
+		 * @param {Number} [time] Time to wait before showing.
+		 * @return {tinymce.ui.Throbber} Current throbber instance.
+		 */
+		self.show = function(time) {
+			self.hide();
+
+			state = true;
+
+			window.setTimeout(function() {
+				if (state) {
+					elm.appendChild(DomUtils.createFragment(
+						'<div class="' + classPrefix + 'throbber' + (inline ? ' ' + classPrefix + 'throbber-inline' : '') + '"></div>'
+					));
+				}
+			}, time || 0);
+
+			return self;
+		};
+
+		/**
+		 * Hides the throbber.
+		 *
+		 * @method hide
+		 * @return {tinymce.ui.Throbber} Current throbber instance.
+		 */
+		self.hide = function() {
+			var child = elm.lastChild;
+
+			if (child && child.className.indexOf('throbber') != -1) {
+				child.parentNode.removeChild(child);
+			}
+
+			state = false;
+
+			return self;
+		};
+	};
+});
+
+expose(["tinymce/dom/EventUtils","tinymce/dom/Sizzle","tinymce/Env","tinymce/util/Tools","tinymce/dom/DomQuery","tinymce/html/Styles","tinymce/dom/TreeWalker","tinymce/dom/Range","tinymce/html/Entities","tinymce/dom/DOMUtils","tinymce/dom/ScriptLoader","tinymce/AddOnManager","tinymce/dom/RangeUtils","tinymce/html/Node","tinymce/html/Schema","tinymce/html/SaxParser","tinymce/html/DomParser","tinymce/html/Writer","tinymce/html/Serializer","tinymce/dom/Serializer","tinymce/dom/TridentSelection","tinymce/util/VK","tinymce/dom/ControlSelection","tinymce/dom/BookmarkManager","tinymce/dom/Selection","tinymce/dom/ElementUtils","tinymce/Formatter","tinymce/UndoManager","tinymce/EnterKey","tinymce/ForceBlocks","tinymce/EditorCommands","tinymce/util/URI","tinymce/util/Class","tinymce/util/EventDispatcher","tinymce/ui/Selector","tinymce/ui/Collection","tinymce/ui/DomUtils","tinymce/ui/Control","tinymce/ui/Factory","tinymce/ui/KeyboardNavigation","tinymce/ui/Container","tinymce/ui/DragHelper","tinymce/ui/Scrollable","tinymce/ui/Panel","tinymce/ui/Movable","tinymce/ui/Resizable","tinymce/ui/FloatPanel","tinymce/ui/Window","tinymce/ui/MessageBox","tinymce/WindowManager","tinymce/util/Quirks","tinymce/util/Observable","tinymce/EditorObservable","tinymce/Shortcuts","tinymce/Editor","tinymce/util/I18n","tinymce/FocusManager","tinymce/EditorManager","tinymce/LegacyInput","tinymce/util/XHR","tinymce/util/JSON","tinymce/util/JSONRequest","tinymce/util/JSONP","tinymce/util/LocalStorage","tinymce/Compat","tinymce/ui/Layout","tinymce/ui/AbsoluteLayout","tinymce/ui/Tooltip","tinymce/ui/Widget","tinymce/ui/Button","tinymce/ui/ButtonGroup","tinymce/ui/Checkbox","tinymce/ui/ComboBox","tinymce/ui/ColorBox","tinymce/ui/PanelButton","tinymce/ui/ColorButton","tinymce/util/Color","tinymce/ui/ColorPicker","tinymce/ui/Path","tinymce/ui/ElementPath","tinymce/ui/FormItem","tinymce/ui/Form","tinymce/ui/FieldSet","tinymce/ui/FilePicker","tinymce/ui/FitLayout","tinymce/ui/FlexLayout","tinymce/ui/FlowLayout","tinymce/ui/FormatControls","tinymce/ui/GridLayout","tinymce/ui/Iframe","tinymce/ui/Label","tinymce/ui/Toolbar","tinymce/ui/MenuBar","tinymce/ui/MenuButton","tinymce/ui/ListBox","tinymce/ui/MenuItem","tinymce/ui/Menu","tinymce/ui/Radio","tinymce/ui/ResizeHandle","tinymce/ui/Spacer","tinymce/ui/SplitButton","tinymce/ui/StackLayout","tinymce/ui/TabPanel","tinymce/ui/TextBox","tinymce/ui/Throbber"]);
+})(this);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/tinymce.jquery.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+(function(b,g){var d={};function c(m,n){var l,j=[];for(var k=0;k<m.length;++k){l=d[m[k]]||e(m[k]);if(!l){throw"module definition dependecy not found: "+m[k]}j.push(l)}n.apply(null,j)}function h(k,j,i){if(typeof k!=="string"){throw"invalid module definition, module id must be defined and be a string"}if(j===g){throw"invalid module definition, dependencies must be specified"}if(i===g){throw"invalid module definition, definition function must be specified"}c(j,function(){d[k]=i.apply(null,arguments)})}function f(i){return !!d[i]}function e(l){var j=b;var i=l.split(/[.\/]/);for(var k=0;k<i.length;++k){if(!j[i[k]]){return}j=j[i[k]]}return j}function a(l){for(var k=0;k<l.length;k++){var m=b;var o=l[k];var j=o.split(/[.\/]/);for(var n=0;n<j.length-1;++n){if(m[j[n]]===g){m[j[n]]={}}m=m[j[n]]}m[j[j.length-1]]=d[o]}}h("tinymce/dom/EventUtils",[],function(){var o="mce-data-";var k=/^(?:mouse|contextmenu)|click/;var j={keyLocation:1,layerX:1,layerY:1,returnValue:1};function l(s,r,t,q){if(s.addEventListener){s.addEventListener(r,t,q||false)}else{if(s.attachEvent){s.attachEvent("on"+r,t)}}}function n(s,r,t,q){if(s.removeEventListener){s.removeEventListener(r,t,q||false)}else{if(s.detachEvent){s.detachEvent("on"+r,t)}}}function i(s,w){var r,q=w||{},u;function t(){return false}function v(){return true}for(r in s){if(!j[r]){q[r]=s[r]}}if(!q.target){q.target=q.srcElement||document}if(s&&k.test(s.type)&&s.pageX===u&&s.clientX!==u){var z=q.target.ownerDocument||document;var y=z.documentElement;var x=z.body;q.pageX=s.clientX+(y&&y.scrollLeft||x&&x.scrollLeft||0)-(y&&y.clientLeft||x&&x.clientLeft||0);q.pageY=s.clientY+(y&&y.scrollTop||x&&x.scrollTop||0)-(y&&y.clientTop||x&&x.clientTop||0)}q.preventDefault=function(){q.isDefaultPrevented=v;if(s){if(s.preventDefault){s.preventDefault()}else{s.returnValue=false}}};q.stopPropagation=function(){q.isPropagationStopped=v;if(s){if(s.stopPropagation){s.stopPropagation()}else{s.cancelBubble=true}}};q.stopImmediatePropagation=function(){q.isImmediatePropagationStopped=v;q.stopPropagation()};if(!q.isDefaultPrevented){q.isDefaultPrevented=t;q.isPropagationStopped=t;q.isImmediatePropagationStopped=t}return q}function m(v,x,s){var u=v.document,t={type:"ready"};if(s.domLoaded){x(t);return}function r(){if(!s.domLoaded){s.domLoaded=true;x(t)}}function q(){if(u.readyState==="complete"||(u.readyState==="interactive"&&u.body)){n(u,"readystatechange",q);r()}}function w(){try{u.documentElement.doScroll("left")}catch(y){setTimeout(w,0);return}r()}if(u.addEventListener){if(u.readyState==="complete"){r()}else{l(v,"DOMContentLoaded",r)}}else{l(u,"readystatechange",q);if(u.documentElement.doScroll&&v.self===v.top){w()}}l(v,"load",r)}function p(){var q=this,s={},u,x,r,t,w;x=o+(+new Date()).toString(32);t="onmouseenter" in document.documentElement;r="onfocusin" in document.documentElement;w={mouseenter:"mouseover",mouseleave:"mouseout"};u=1;q.domLoaded=false;q.events=s;function v(B,E){var A,C,z,D,y=s[E];A=y&&y[B.type];if(A){for(C=0,z=A.length;C<z;C++){D=A[C];if(D&&D.func.call(D.scope,B)===false){B.preventDefault()}if(B.isImmediatePropagationStopped()){return}}}}q.bind=function(D,G,J,K){var z,A,B,y,H,F,I,C=window;function E(L){v(i(L||C.event),z)}if(!D||D.nodeType===3||D.nodeType===8){return}if(!D[x]){z=u++;D[x]=z;s[z]={}}else{z=D[x]}K=K||D;G=G.split(" ");B=G.length;while(B--){y=G[B];F=E;H=I=false;if(y==="DOMContentLoaded"){y="ready"}if(q.domLoaded&&y==="ready"&&D.readyState=="complete"){J.call(K,i({type:y}));continue}if(!t){H=w[y];if(H){F=function(L){var N,M;N=L.currentTarget;M=L.relatedTarget;if(M&&N.contains){M=N.contains(M)}else{while(M&&M!==N){M=M.parentNode}}if(!M){L=i(L||C.event);L.type=L.type==="mouseout"?"mouseleave":"mouseenter";L.target=N;v(L,z)}}}}if(!r&&(y==="focusin"||y==="focusout")){I=true;H=y==="focusin"?"focus":"blur";F=function(L){L=i(L||C.event);L.type=L.type==="focus"?"focusin":"focusout";v(L,z)}}A=s[z][y];if(!A){s[z][y]=A=[{func:J,scope:K}];A.fakeName=H;A.capture=I;A.nativeHandler=F;if(y==="ready"){m(D,F,q)}else{l(D,H||y,F,I)}}else{if(y==="ready"&&q.domLoaded){J({type:y})}else{A.push({func:J,scope:K})}}}D=A=0;return J};q.unbind=function(D,G,J){var z,B,C,K,y,A;if(!D||D.nodeType===3||D.nodeType===8){return q}z=D[x];if(z){A=s[z];if(G){G=G.split(" ");C=G.length;while(C--){y=G[C];B=A[y];if(B){if(J){K=B.length;while(K--){if(B[K].func===J){var F=B.nativeHandler;var H=B.fakeName,I=B.capture;B=B.slice(0,K).concat(B.slice(K+1));B.nativeHandler=F;B.fakeName=H;B.capture=I;A[y]=B}}}if(!J||B.length===0){delete A[y];n(D,B.fakeName||y,B.nativeHandler,B.capture)}}}}else{for(y in A){B=A[y];n(D,B.fakeName||y,B.nativeHandler,B.capture)}A={}}for(y in A){return q}delete s[z];try{delete D[x]}catch(E){D[x]=null}}return q};q.fire=function(A,z,y){var B;if(!A||A.nodeType===3||A.nodeType===8){return q}y=i(null,y);y.type=z;y.target=A;do{B=A[x];if(B){v(y,B)}A=A.parentNode||A.ownerDocument||A.defaultView||A.parentWindow}while(A&&!y.isPropagationStopped());return q};q.clean=function(B){var z,y,A=q.unbind;if(!B||B.nodeType===3||B.nodeType===8){return q}if(B[x]){A(B)}if(!B.getElementsByTagName){B=B.document}if(B&&B.getElementsByTagName){A(B);y=B.getElementsByTagName("*");z=y.length;while(z--){B=y[z];if(B[x]){A(B)}}}return q};q.destroy=function(){s={}};q.cancel=function(y){if(y){y.preventDefault();y.stopImmediatePropagation()}return false}}p.Event=new p();p.Event.bind(window,"ready",function(){});return p});h("tinymce/dom/Sizzle",[],function(){if(!window.jQuery){throw new Error("Load jQuery first")}return jQuery.find});h("tinymce/Env",[],function(){var i=navigator,t=i.userAgent;var m,s,j,p,o,l,r,n,k;m=window.opera&&window.opera.buildNumber;k=/Android/.test(t);s=/WebKit/.test(t);j=!s&&!m&&(/MSIE/gi).test(t)&&(/Explorer/gi).test(i.appName);j=j&&/MSIE (\w+)\./.exec(t)[1];p=t.indexOf("Trident/")!=-1&&(t.indexOf("rv:")!=-1||i.appName.indexOf("Netscape")!=-1)?11:false;o=(document.msElementsFromPoint&&!j&&!p)?12:false;j=j||p||o;l=!s&&!p&&/Gecko/.test(t);r=t.indexOf("Mac")!=-1;n=/(iPad|iPhone)/.test(t);if(o){s=false}var q=!n||t.match(/AppleWebKit\/(\d*)/)[1]>=534;return{opera:m,webkit:s,ie:j,gecko:l,mac:r,iOS:n,android:k,contentEditable:q,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:j!=8,range:window.getSelection&&"Range" in window,documentMode:j&&!o?(document.documentMode||7):10}});h("tinymce/util/Tools",["tinymce/Env"],function(i){var z=/^\s*|\s*$/g;function u(A){return(A===null||A===g)?"":(""+A).replace(z,"")}var o=Array.isArray||function(A){return Object.prototype.toString.call(A)==="[object Array]"};function m(B,A){if(!A){return B!==g}if(A=="array"&&o(B)){return true}return typeof B==A}function s(C){var D=C,B,A;if(!o(C)){D=[];for(B=0,A=C.length;B<A;B++){D[B]=C[B]}}return D}function q(A,D,C){var B;A=A||[];D=D||",";if(typeof A=="string"){A=A.split(D)}C=C||{};B=A.length;while(B--){C[A[B]]={}}return C}function k(D,A,C){var E,B;if(!D){return 0}C=C||D;if(D.length!==g){for(E=0,B=D.length;E<B;E++){if(A.call(C,D[E],E,D)===false){return 0}}}else{for(E in D){if(D.hasOwnProperty(E)){if(A.call(C,D[E],E,D)===false){return 0}}}}return 1}function y(C,B){var A=[];k(C,function(D){A.push(B(D))});return A}function n(A,B){var C=[];k(A,function(D){if(!B||B(D)){C.push(D)}});return C}function p(J,A,E){var I=this,B,D,F,G,C,H=0;J=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(J);F=J[3].match(/(^|\.)(\w+)$/i)[2];D=I.createNS(J[3].replace(/\.\w+$/,""),E);if(D[F]){return}if(J[2]=="static"){D[F]=A;if(this.onCreate){this.onCreate(J[2],J[3],D[F])}return}if(!A[F]){A[F]=function(){};H=1}D[F]=A[F];I.extend(D[F].prototype,A);if(J[5]){B=I.resolve(J[5]).prototype;G=J[5].match(/\.(\w+)$/i)[1];C=D[F];if(H){D[F]=function(){return B[G].apply(this,arguments)}}else{D[F]=function(){this.parent=B[G];return C.apply(this,arguments)}}D[F].prototype[F]=D[F];I.each(B,function(K,L){D[F].prototype[L]=B[L]});I.each(A,function(K,L){if(B[L]){D[F].prototype[L]=function(){this.parent=B[L];return K.apply(this,arguments)}}else{if(L!=F){D[F].prototype[L]=K}}})}I.each(A["static"],function(K,L){D[F][L]=K})}function v(B,C){var D,A;if(B){for(D=0,A=B.length;D<A;D++){if(B[D]===C){return D}}}return -1}function w(G,E){var D,A,C,B=arguments,F;for(D=1,A=B.length;D<A;D++){E=B[D];for(C in E){if(E.hasOwnProperty(C)){F=E[C];if(F!==g){G[C]=F}}}}return G}function x(C,B,D,A){A=A||this;if(C){if(D){C=C[D]}k(C,function(F,E){if(B.call(A,F,E,D)===false){return false}x(F,B,D,A)})}}function l(D,C){var B,A;C=C||window;D=D.split(".");for(B=0;B<D.length;B++){A=D[B];if(!C[A]){C[A]={}}C=C[A]}return C}function t(D,C){var B,A;C=C||window;D=D.split(".");for(B=0,A=D.length;B<A;B++){C=C[D[B]];if(!C){break}}return C}function r(A,B){if(!A||m(A,"array")){return A}return y(A.split(B||","),u)}function j(B){var A=i.cacheSuffix;if(A){B+=(B.indexOf("?")===-1?"?":"&")+A}return B}return{trim:u,isArray:o,is:m,toArray:s,makeMap:q,each:k,map:y,grep:n,inArray:v,extend:w,create:p,walk:x,createNS:l,resolve:t,explode:r,_addCacheSuffix:j}});h("tinymce/dom/DomQuery",["tinymce/dom/EventUtils","tinymce/dom/Sizzle","tinymce/util/Tools","tinymce/Env"],function(t,q,n,o){var P=document,v=Array.prototype.push,E=Array.prototype.slice;var B=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/;var O=t.Event,p;function k(Q){return typeof Q!=="undefined"}function y(Q){return typeof Q==="string"}function J(Q){return Q&&Q==Q.window}function D(S,R){var U,T,Q;R=R||P;Q=R.createElement("div");U=R.createDocumentFragment();Q.innerHTML=S;while((T=Q.firstChild)){U.appendChild(T)}return U}function A(Q,T,U,R){var S;if(y(T)){T=D(T,z(Q[0]))}else{if(T.length&&!T.nodeType){T=r.makeArray(T);if(R){for(S=T.length-1;S>=0;S--){A(Q,T[S],U,R)}}else{for(S=0;S<T.length;S++){A(Q,T[S],U,R)}}return Q}}if(T.nodeType){S=Q.length;while(S--){U.call(Q[S],T)}}return Q}function l(R,Q){return R&&Q&&(" "+R.className+" ").indexOf(" "+Q+" ")!==-1}function x(T,U,R){var Q,S;U=r(U)[0];T.each(function(){var V=this;if(!R||Q!=V.parentNode){Q=V.parentNode;S=U.cloneNode(false);V.parentNode.insertBefore(S,V);S.appendChild(V)}else{S.appendChild(V)}});return T}var j=n.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," ");var G=n.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," ");var K={"for":"htmlFor","class":"className",readonly:"readOnly"};var m={"float":"cssFloat"};var M={},N={};function r(Q,R){return new r.fn.init(Q,R)}function H(R,S){var Q;if(S.indexOf){return S.indexOf(R)}Q=S.length;while(Q--){if(S[Q]===R){return Q}}return -1}var L=/^\s*|\s*$/g;function F(Q){return(Q===null||Q===p)?"":(""+Q).replace(L,"")}function s(V,W){var T,R,Q,S,U;if(V){T=V.length;if(T===S){for(R in V){if(V.hasOwnProperty(R)){U=V[R];if(W.call(U,R,U)===false){break}}}}else{for(Q=0;Q<T;Q++){U=V[Q];if(W.call(U,Q,U)===false){break}}}}return V}function w(S,R){var Q=[];s(S,function(T,U){if(R(U,T)){Q.push(U)}});return Q}function z(Q){if(!Q){return P}if(Q.nodeType==9){return Q}return Q.ownerDocument}r.fn=r.prototype={constructor:r,selector:"",context:null,length:0,init:function(Q,T){var R=this,S,U;if(!Q){return R}if(Q.nodeType){R.context=R[0]=Q;R.length=1;return R}if(T&&T.nodeType){R.context=T}else{if(T){return r(Q).attr(T)}else{R.context=T=document}}if(y(Q)){R.selector=Q;if(Q.charAt(0)==="<"&&Q.charAt(Q.length-1)===">"&&Q.length>=3){S=[null,Q,null]}else{S=B.exec(Q)}if(S){if(S[1]){U=D(Q,z(T)).firstChild;while(U){v.call(R,U);U=U.nextSibling}}else{U=z(T).getElementById(S[2]);if(!U){return R}if(U.id!==S[2]){return R.find(Q)}R.length=1;R[0]=U}}else{return r(T).find(Q)}}else{this.add(Q,false)}return R},toArray:function(){return n.toArray(this)},add:function(S,U){var R=this,Q,T;if(y(S)){return R.add(r(S))}if(U!==false){Q=r.unique(R.toArray().concat(r.makeArray(S)));R.length=Q.length;for(T=0;T<Q.length;T++){R[T]=Q[T]}}else{v.apply(R,r.makeArray(S))}return R},attr:function(R,T){var Q=this,S;if(typeof R==="object"){s(R,function(U,V){Q.attr(U,V)})}else{if(k(T)){this.each(function(){var U;if(this.nodeType===1){U=M[R];if(U&&U.set){U.set(this,T);return}if(T===null){this.removeAttribute(R,2)}else{this.setAttribute(R,T,2)}}})}else{if(Q[0]&&Q[0].nodeType===1){S=M[R];if(S&&S.get){return S.get(Q[0],R)}if(G[R]){return Q.prop(R)?R:p}T=Q[0].getAttribute(R,2);if(T===null){T=p}}return T}}return Q},removeAttr:function(Q){return this.attr(Q,null)},prop:function(R,S){var Q=this;R=K[R]||R;if(typeof R==="object"){s(R,function(T,U){Q.prop(T,U)})}else{if(k(S)){this.each(function(){if(this.nodeType==1){this[R]=S}})}else{if(Q[0]&&Q[0].nodeType&&R in Q[0]){return Q[0][R]}return S}}return Q},css:function(S,W){var R=this,X,V;function U(Y){return Y.replace(/-(\D)/g,function(aa,Z){return Z.toUpperCase()})}function Q(Y){return Y.replace(/[A-Z]/g,function(Z){return"-"+Z})}if(typeof S==="object"){s(S,function(Y,Z){R.css(Y,Z)})}else{if(k(W)){S=U(S);if(typeof W==="number"&&!j[S]){W+="px"}R.each(function(){var Z=this.style;V=N[S];if(V&&V.set){V.set(this,W);return}try{this.style[m[S]||S]=W}catch(Y){}if(W===null||W===""){if(Z.removeProperty){Z.removeProperty(Q(S))}else{Z.removeAttribute(S)}}})}else{X=R[0];V=N[S];if(V&&V.get){return V.get(X)}if(X.ownerDocument.defaultView){try{return X.ownerDocument.defaultView.getComputedStyle(X,null).getPropertyValue(Q(S))}catch(T){return p}}else{if(X.currentStyle){return X.currentStyle[U(S)]}}}}return R},remove:function(){var Q=this,S,R=this.length;while(R--){S=Q[R];O.clean(S);if(S.parentNode){S.parentNode.removeChild(S)}}return this},empty:function(){var Q=this,S,R=this.length;while(R--){S=Q[R];while(S.firstChild){S.removeChild(S.firstChild)}}return this},html:function(T){var Q=this,S;if(k(T)){S=Q.length;try{while(S--){Q[S].innerHTML=T}}catch(R){r(Q[S]).empty().append(T)}return Q}return Q[0]?Q[0].innerHTML:""},text:function(S){var Q=this,R;if(k(S)){R=Q.length;while(R--){if("innerText" in Q[R]){Q[R].innerText=S}else{Q[0].textContent=S}}return Q}return Q[0]?(Q[0].innerText||Q[0].textContent):""},append:function(){return A(this,arguments,function(Q){if(this.nodeType===1){this.appendChild(Q)}})},prepend:function(){return A(this,arguments,function(Q){if(this.nodeType===1){this.insertBefore(Q,this.firstChild)}},true)},before:function(){var Q=this;if(Q[0]&&Q[0].parentNode){return A(Q,arguments,function(R){this.parentNode.insertBefore(R,this)})}return Q},after:function(){var Q=this;if(Q[0]&&Q[0].parentNode){return A(Q,arguments,function(R){this.parentNode.insertBefore(R,this.nextSibling)},true)}return Q},appendTo:function(Q){r(Q).append(this);return this},prependTo:function(Q){r(Q).prepend(this);return this},replaceWith:function(Q){return this.before(Q).remove()},wrap:function(Q){return x(this,Q)},wrapAll:function(Q){return x(this,Q,true)},wrapInner:function(Q){this.each(function(){r(this).contents().wrapAll(Q)});return this},unwrap:function(){return this.parent().each(function(){r(this).replaceWith(this.childNodes)})},clone:function(){var Q=[];this.each(function(){Q.push(this.cloneNode(true))});return r(Q)},addClass:function(Q){return this.toggleClass(Q,true)},removeClass:function(Q){return this.toggleClass(Q,false)},toggleClass:function(R,S){var Q=this;if(typeof R!="string"){return Q}if(R.indexOf(" ")!==-1){s(R.split(" "),function(){Q.toggleClass(this,S)})}else{Q.each(function(T,V){var U,W;W=l(V,R);if(W!==S){U=V.className;if(W){V.className=F((" "+U+" ").replace(" "+R+" "," "))}else{V.className+=U?" "+R:R}}})}return Q},hasClass:function(Q){return l(this[0],Q)},each:function(Q){return s(this,Q)},on:function(Q,R){return this.each(function(){O.bind(this,Q,R)})},off:function(Q,R){return this.each(function(){O.unbind(this,Q,R)})},trigger:function(Q){return this.each(function(){if(typeof Q=="object"){O.fire(this,Q.type,Q)}else{O.fire(this,Q)}})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new r(E.apply(this,arguments))},eq:function(Q){return Q===-1?this.slice(Q):this.slice(Q,+Q+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(Q){var T,R,S=[];for(T=0,R=this.length;T<R;T++){r.find(Q,this[T],S)}return r(S)},filter:function(Q){if(typeof Q=="function"){return r(w(this.toArray(),function(S,R){return Q(R,S)}))}return r(r.filter(Q,this.toArray()))},closest:function(R){var Q=[];if(R instanceof r){R=R[0]}this.each(function(S,T){while(T){if(typeof R=="string"&&r(T).is(R)){Q.push(T);break}else{if(T==R){Q.push(T);break}}T=T.parentNode}});return r(Q)},offset:function(T){var W,S,R;var Q=0,V=0,U;if(!T){W=this[0];if(W){S=W.ownerDocument;R=S.documentElement;if(W.getBoundingClientRect){U=W.getBoundingClientRect();Q=U.left+(R.scrollLeft||S.body.scrollLeft)-R.clientLeft;V=U.top+(R.scrollTop||S.body.scrollTop)-R.clientTop}}return{left:Q,top:V}}return this.css(T)},push:v,sort:[].sort,splice:[].splice};n.extend(r,{extend:n.extend,makeArray:function(Q){if(J(Q)||Q.nodeType){return[Q]}return n.toArray(Q)},inArray:H,isArray:n.isArray,each:s,trim:F,grep:w,find:q,expr:q.selectors,unique:q.uniqueSort,text:q.getText,contains:q.contains,filter:function(T,Q,S){var R=Q.length;if(S){T=":not("+T+")"}while(R--){if(Q[R].nodeType!=1){Q.splice(R,1)}}if(Q.length===1){Q=r.find.matchesSelector(Q[0],T)?[Q[0]]:[]}else{Q=r.find.matches(T,Q)}return Q}});function C(R,U,T){var Q=[],S=R[U];if(typeof T!="string"&&T instanceof r){T=T[0]}while(S&&S.nodeType!==9){if(T!==g){if(S===T){break}if(typeof T=="string"&&r(S).is(T)){break}}if(S.nodeType===1){Q.push(S)}S=S[U]}return Q}function I(T,S,R,U){var Q=[];if(U instanceof r){U=U[0]}for(;T;T=T[S]){if(R&&T.nodeType!==R){continue}if(U!==g){if(T===U){break}if(typeof U=="string"&&r(T).is(U)){break}}Q.push(T)}return Q}function i(S,R,Q){for(S=S[R];S;S=S[R]){if(S.nodeType==Q){return S}}return null}s({parent:function(R){var Q=R.parentNode;return Q&&Q.nodeType!==11?Q:null},parents:function(Q){return C(Q,"parentNode")},next:function(Q){return i(Q,"nextSibling",1)},prev:function(Q){return i(Q,"previousSibling",1)},children:function(Q){return I(Q.firstChild,"nextSibling",1)},contents:function(Q){return n.toArray((Q.nodeName==="iframe"?Q.contentDocument||Q.contentWindow.document:Q).childNodes)}},function(Q,R){r.fn[Q]=function(T){var U=this,S=[];U.each(function(){var V=R.call(S,this,T,S);if(V){if(r.isArray(V)){S.push.apply(S,V)}else{S.push(V)}}});if(this.length>1){S=r.unique(S);if(Q.indexOf("parents")===0){S=S.reverse()}}S=r(S);if(T){return S.filter(T)}return S}});s({parentsUntil:function(Q,R){return C(Q,"parentNode",R)},nextUntil:function(Q,R){return I(Q,"nextSibling",1,R).slice(1)},prevUntil:function(Q,R){return I(Q,"previousSibling",1,R).slice(1)}},function(Q,R){r.fn[Q]=function(T,V){var U=this,S=[];U.each(function(){var W=R.call(S,this,T,S);if(W){if(r.isArray(W)){S.push.apply(S,W)}else{S.push(W)}}});if(this.length>1){S=r.unique(S);if(Q.indexOf("parents")===0||Q==="prevUntil"){S=S.reverse()}}S=r(S);if(V){return S.filter(V)}return S}});r.fn.is=function(Q){return !!Q&&this.filter(Q).length>0};r.fn.init.prototype=r.fn;r.overrideDefaults=function(S){var R;function Q(T,U){R=R||S();if(arguments.length===0){T=R.element}if(!U){U=R.context}return new Q.fn.init(T,U)}r.extend(Q,this);return Q};function u(S,R,Q){s(Q,function(T,U){S[T]=S[T]||{};S[T][R]=U})}if(o.ie&&o.ie<8){u(M,"get",{maxlength:function(R){var Q=R.maxLength;if(Q===2147483647){return p}return Q},size:function(R){var Q=R.size;if(Q===20){return p}return Q},"class":function(Q){return Q.className},style:function(R){var Q=R.style.cssText;if(Q.length===0){return p}return Q}});u(M,"set",{"class":function(R,Q){R.className=Q},style:function(R,Q){R.style.cssText=Q}})}if(o.ie&&o.ie<9){m["float"]="styleFloat";u(N,"set",{opacity:function(S,R){var Q=S.style;if(R===null||R===""){Q.removeAttribute("filter")}else{Q.zoom=1;Q.filter="alpha(opacity="+(R*100)+")"}}})}r.attrHooks=M;r.cssHooks=N;return r});h("tinymce/html/Styles",[],function(){return function(o,q){var u=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,r=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,l=/\s*([^:]+):\s*([^;]+);?/g,w=/\s+$/,p,s,k={},t,n,j,v="\uFEFF";o=o||{};if(q){n=q.getValidStyles();j=q.getInvalidStyles()}t=("\\\" \\' \\; \\: ; : "+v).split(" ");for(s=0;s<t.length;s++){k[t[s]]=v+s;k[v+s]=t[s]}function m(x,A,z,i){function y(B){B=parseInt(B,10).toString(16);return B.length>1?B:"0"+B}return"#"+y(A)+y(z)+y(i)}return{toHex:function(i){return i.replace(u,m)},parse:function(C){var I={},A,x,G,B,F=o.url_converter;var H=o.url_converter_scope||this;function z(O,R,L){var Q,M,K,P;Q=I[O+"-top"+R];if(!Q){return}M=I[O+"-right"+R];if(!M){return}K=I[O+"-bottom"+R];if(!K){return}P=I[O+"-left"+R];if(!P){return}var N=[Q,M,K,P];s=N.length-1;while(s--){if(N[s]!==N[s+1]){break}}if(s>-1&&L){return}I[O+R]=s==-1?N[0]:N.join(" ");delete I[O+"-top"+R];delete I[O+"-right"+R];delete I[O+"-bottom"+R];delete I[O+"-left"+R]}function E(L){var M=I[L],K;if(!M){return}M=M.split(" ");K=M.length;while(K--){if(M[K]!==M[0]){return false}}I[L]=M[0];return true}function J(M,L,K,N){if(!E(L)){return}if(!E(K)){return}if(!E(N)){return}I[M]=I[L]+" "+I[K]+" "+I[N];delete I[L];delete I[K];delete I[N]}function D(K){B=true;return k[K]}function i(L,K){if(B){L=L.replace(/\uFEFF[0-9]/g,function(M){return k[M]})}if(!K){L=L.replace(/\\([\'\";:])/g,"$1")}return L}function y(L,K,O,N,Q,M){Q=Q||M;if(Q){Q=i(Q);return"'"+Q.replace(/\'/g,"\\'")+"'"}K=i(K||O||N);if(!o.allow_script_urls){var P=K.replace(/[\s\r\n]+/,"");if(/(java|vb)script:/i.test(P)){return""}if(!o.allow_svg_data_urls&&/^data:image\/svg/i.test(P)){return""}}if(F){K=F.call(H,K,"style")}return"url('"+K.replace(/\'/g,"\\'")+"')"}if(C){C=C.replace(/[\u0000-\u001F]/g,"");C=C.replace(/\\[\"\';:\uFEFF]/g,D).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(K){return K.replace(/[;:]/g,D)});while((A=l.exec(C))){x=A[1].replace(w,"").toLowerCase();G=A[2].replace(w,"");G=G.replace(/\\[0-9a-f]+/g,function(K){return String.fromCharCode(parseInt(K.substr(1),16))});if(x&&G.length>0){if(!o.allow_script_urls&&(x=="behavior"||/expression\s*\(|\/\*|\*\//.test(G))){continue}if(x==="font-weight"&&G==="700"){G="bold"}else{if(x==="color"||x==="background-color"){G=G.toLowerCase()}}G=G.replace(u,m);G=G.replace(r,y);I[x]=B?i(G,true):G}l.lastIndex=A.index+A[0].length}z("border","",true);z("border","-width");z("border","-color");z("border","-style");z("padding","");z("margin","");J("border","border-width","border-style","border-color");if(I.border==="medium none"){delete I.border}if(I["border-image"]==="none"){delete I["border-image"]}}return I},serialize:function(A,i){var z="",y,B;function x(E){var H,F,D,G;H=n[E];if(H){for(F=0,D=H.length;F<D;F++){E=H[F];G=A[E];if(G!==p&&G.length>0){z+=(z.length>0?" ":"")+E+": "+G+";"}}}}function C(E,D){var F;F=j["*"];if(F&&F[E]){return false}F=j[D];if(F&&F[E]){return false}return true}if(i&&n){x("*");x(i)}else{for(y in A){B=A[y];if(B!==p&&B.length>0){if(!j||C(y,i)){z+=(z.length>0?" ":"")+y+": "+B+";"}}}}return z}}}});h("tinymce/dom/TreeWalker",[],function(){return function(j,i){var k=j;function l(q,m,n,r){var p,o;if(q){if(!r&&q[m]){return q[m]}if(q!=i){p=q[n];if(p){return p}for(o=q.parentNode;o&&o!=i;o=o.parentNode){p=o[n];if(p){return p}}}}}this.current=function(){return k};this.next=function(m){k=l(k,"firstChild","nextSibling",m);return k};this.prev=function(m){k=l(k,"lastChild","previousSibling",m);return k}}});h("tinymce/dom/Range",["tinymce/util/Tools"],function(i){function j(k){var o=this,m=k.doc,aa=0,M=1,s=2,L=true,Y=false,ac="startOffset",q="startContainer",W="endContainer",H="endOffset",t=i.extend,w=k.nodeIndex;function E(){return m.createDocumentFragment()}function z(ae,ad){J(L,ae,ad)}function B(ae,ad){J(Y,ae,ad)}function p(ad){z(ad.parentNode,w(ad))}function Q(ad){z(ad.parentNode,w(ad)+1)}function R(ad){B(ad.parentNode,w(ad))}function C(ad){B(ad.parentNode,w(ad)+1)}function I(ad){if(ad){o[W]=o[q];o[H]=o[ac]}else{o[q]=o[W];o[ac]=o[H]}o.collapsed=L}function F(ad){p(ad);C(ad)}function N(ad){z(ad,0);B(ad,ad.nodeType===1?ad.childNodes.length:ad.nodeValue.length)}function D(ah,ad){var ak=o[q],af=o[ac],aj=o[W],ae=o[H],ai=ad.startContainer,am=ad.startOffset,ag=ad.endContainer,al=ad.endOffset;if(ah===0){return O(ak,af,ai,am)}if(ah===1){return O(aj,ae,ai,am)}if(ah===2){return O(aj,ae,ag,al)}if(ah===3){return O(ak,af,ag,al)}}function y(){u(s)}function P(){return u(aa)}function l(){return u(M)}function K(ah){var ae=this[q],ad=this[ac],ag,af;if((ae.nodeType===3||ae.nodeType===4)&&ae.nodeValue){if(!ad){ae.parentNode.insertBefore(ah,ae)}else{if(ad>=ae.nodeValue.length){k.insertAfter(ah,ae)}else{ag=ae.splitText(ad);ae.parentNode.insertBefore(ah,ag)}}}else{if(ae.childNodes.length>0){af=ae.childNodes[ad]}if(af){ae.insertBefore(ah,af)}else{if(ae.nodeType==3){k.insertAfter(ah,ae)}else{ae.appendChild(ah)}}}}function U(ae){var ad=o.extractContents();o.insertNode(ae);ae.appendChild(ad);o.selectNode(ae)}function S(){return t(new j(k),{startContainer:o[q],startOffset:o[ac],endContainer:o[W],endOffset:o[H],collapsed:o.collapsed,commonAncestorContainer:o.commonAncestorContainer})}function V(ad,ae){var af;if(ad.nodeType==3){return ad}if(ae<0){return ad}af=ad.firstChild;while(af&&ae>0){--ae;af=af.nextSibling}if(af){return af}return ad}function v(){return(o[q]==o[W]&&o[ac]==o[H])}function O(ag,ai,ae,ah){var aj,af,ad,ak,am,al;if(ag==ae){if(ai==ah){return 0}if(ai<ah){return -1}return 1}aj=ae;while(aj&&aj.parentNode!=ag){aj=aj.parentNode}if(aj){af=0;ad=ag.firstChild;while(ad!=aj&&af<ai){af++;ad=ad.nextSibling}if(ai<=af){return -1}return 1}aj=ag;while(aj&&aj.parentNode!=ae){aj=aj.parentNode}if(aj){af=0;ad=ae.firstChild;while(ad!=aj&&af<ah){af++;ad=ad.nextSibling}if(af<ah){return -1}return 1}ak=k.findCommonAncestor(ag,ae);am=ag;while(am&&am.parentNode!=ak){am=am.parentNode}if(!am){am=ak}al=ae;while(al&&al.parentNode!=ak){al=al.parentNode}if(!al){al=ak}if(am==al){return 0}ad=ak.firstChild;while(ad){if(ad==am){return -1}if(ad==al){return 1}ad=ad.nextSibling}}function J(ae,ah,ag){var ad,af;if(ae){o[q]=ah;o[ac]=ag}else{o[W]=ah;o[H]=ag}ad=o[W];while(ad.parentNode){ad=ad.parentNode}af=o[q];while(af.parentNode){af=af.parentNode}if(af==ad){if(O(o[q],o[ac],o[W],o[H])>0){o.collapse(ae)}}else{o.collapse(ae)}o.collapsed=v();o.commonAncestorContainer=k.findCommonAncestor(o[q],o[W])}function u(ak){var aj,ag=0,am=0,ae,ai,af,ah,ad,al;if(o[q]==o[W]){return n(ak)}for(aj=o[W],ae=aj.parentNode;ae;aj=ae,ae=ae.parentNode){if(ae==o[q]){return A(aj,ak)}++ag}for(aj=o[q],ae=aj.parentNode;ae;aj=ae,ae=ae.parentNode){if(ae==o[W]){return ab(aj,ak)}++am}ai=am-ag;af=o[q];while(ai>0){af=af.parentNode;ai--}ah=o[W];while(ai<0){ah=ah.parentNode;ai++}for(ad=af.parentNode,al=ah.parentNode;ad!=al;ad=ad.parentNode,al=al.parentNode){af=ad;ah=al}return x(af,ah,ak)}function n(aj){var al,am,ad,af,ag,ak,ah,ae,ai;if(aj!=s){al=E()}if(o[ac]==o[H]){return al}if(o[q].nodeType==3){am=o[q].nodeValue;ad=am.substring(o[ac],o[H]);if(aj!=M){af=o[q];ae=o[ac];ai=o[H]-o[ac];if(ae===0&&ai>=af.nodeValue.length-1){af.parentNode.removeChild(af)}else{af.deleteData(ae,ai)}o.collapse(L)}if(aj==s){return}if(ad.length>0){al.appendChild(m.createTextNode(ad))}return al}af=V(o[q],o[ac]);ag=o[H]-o[ac];while(af&&ag>0){ak=af.nextSibling;ah=G(af,aj);if(al){al.appendChild(ah)}--ag;af=ak}if(aj!=M){o.collapse(L)}return al}function A(ak,ah){var aj,ai,ae,ad,ag,af;if(ah!=s){aj=E()}ai=r(ak,ah);if(aj){aj.appendChild(ai)}ae=w(ak);ad=ae-o[ac];if(ad<=0){if(ah!=M){o.setEndBefore(ak);o.collapse(Y)}return aj}ai=ak.previousSibling;while(ad>0){ag=ai.previousSibling;af=G(ai,ah);if(aj){aj.insertBefore(af,aj.firstChild)}--ad;ai=ag}if(ah!=M){o.setEndBefore(ak);o.collapse(Y)}return aj}function ab(ai,ah){var ak,ae,aj,ad,ag,af;if(ah!=s){ak=E()}aj=X(ai,ah);if(ak){ak.appendChild(aj)}ae=w(ai);++ae;ad=o[H]-ae;aj=ai.nextSibling;while(aj&&ad>0){ag=aj.nextSibling;af=G(aj,ah);if(ak){ak.appendChild(af)}--ad;aj=ag}if(ah!=M){o.setStartAfter(ai);o.collapse(L)}return ak}function x(ah,ad,ak){var ae,am,ai,aj,af,al,ag;if(ak!=s){am=E()}ae=X(ah,ak);if(am){am.appendChild(ae)}ai=w(ah);aj=w(ad);++ai;af=aj-ai;al=ah.nextSibling;while(af>0){ag=al.nextSibling;ae=G(al,ak);if(am){am.appendChild(ae)}al=ag;--af}ae=r(ad,ak);if(am){am.appendChild(ae)}if(ak!=M){o.setStartAfter(ah);o.collapse(L)}return am}function r(aj,ak){var af=V(o[W],o[H]-1),al,ai;var ah,ad,ae,ag=af!=o[W];if(af==aj){return T(af,ag,Y,ak)}al=af.parentNode;ai=T(al,Y,Y,ak);while(al){while(af){ah=af.previousSibling;ad=T(af,ag,Y,ak);if(ak!=s){ai.insertBefore(ad,ai.firstChild)}ag=L;af=ah}if(al==aj){return ai}af=al.previousSibling;al=al.parentNode;ae=T(al,Y,Y,ak);if(ak!=s){ae.appendChild(ai)}ai=ae}}function X(aj,ak){var ag=V(o[q],o[ac]),ah=ag!=o[q];var al,ai,af,ad,ae;if(ag==aj){return T(ag,ah,L,ak)}al=ag.parentNode;ai=T(al,Y,L,ak);while(al){while(ag){af=ag.nextSibling;ad=T(ag,ah,L,ak);if(ak!=s){ai.appendChild(ad)}ah=L;ag=af}if(al==aj){return ai}ag=al.nextSibling;al=al.parentNode;ae=T(al,Y,L,ak);if(ak!=s){ae.appendChild(ai)}ai=ae}}function T(ad,ah,ak,al){var ag,af,ai,ae,aj;if(ah){return G(ad,al)}if(ad.nodeType==3){ag=ad.nodeValue;if(ak){ae=o[ac];af=ag.substring(ae);ai=ag.substring(0,ae)}else{ae=o[H];af=ag.substring(0,ae);ai=ag.substring(ae)}if(al!=M){ad.nodeValue=ai}if(al==s){return}aj=k.clone(ad,Y);aj.nodeValue=af;return aj}if(al==s){return}return k.clone(ad,Y)}function G(ae,ad){if(ad!=s){return ad==M?k.clone(ae,L):ae}ae.parentNode.removeChild(ae)}function Z(){return k.create("body",null,l()).outerText}t(o,{startContainer:m,startOffset:0,endContainer:m,endOffset:0,collapsed:L,commonAncestorContainer:m,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:z,setEnd:B,setStartBefore:p,setStartAfter:Q,setEndBefore:R,setEndAfter:C,collapse:I,selectNode:F,selectNodeContents:N,compareBoundaryPoints:D,deleteContents:y,extractContents:P,cloneContents:l,insertNode:K,surroundContents:U,cloneRange:S,toStringIE:Z});return o}j.prototype.toString=function(){return this.toStringIE()};return j});h("tinymce/html/Entities",["tinymce/util/Tools"],function(l){var m=l.makeMap;var i,r,o,u=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,j=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,q=/[<>&\"\']/g,n=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,t={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"};r={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;","\u0060":"&#96;"};o={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"};function s(v){var w;w=document.createElement("div");w.innerHTML=v;return w.textContent||w.innerText||v}function p(w,z){var x,y,v,A={};if(w){w=w.split(",");z=z||10;for(x=0;x<w.length;x+=2){y=String.fromCharCode(parseInt(w[x],z));if(!r[y]){v="&"+w[x+1]+";";A[y]=v;A[v]=y}}return A}}i=p("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 k={encodeRaw:function(w,v){return w.replace(v?u:j,function(x){return r[x]||x})},encodeAllRaw:function(v){return(""+v).replace(q,function(w){return r[w]||w})},encodeNumeric:function(w,v){return w.replace(v?u:j,function(x){if(x.length>1){return"&#"+(((x.charCodeAt(0)-55296)*1024)+(x.charCodeAt(1)-56320)+65536)+";"}return r[x]||"&#"+x.charCodeAt(0)+";"})},encodeNamed:function(x,v,w){w=w||i;return x.replace(v?u:j,function(y){return r[y]||w[y]||y})},getEncodeFunc:function(v,y){y=p(y)||i;function w(A,z){return A.replace(z?u:j,function(B){return r[B]||y[B]||"&#"+B.charCodeAt(0)+";"||B})}function x(A,z){return k.encodeNamed(A,z,y)}v=m(v.replace(/\+/g,","));if(v.named&&v.numeric){return w}if(v.named){if(y){return x}return k.encodeNamed}if(v.numeric){return k.encodeNumeric}return k.encodeRaw},decode:function(v){return v.replace(n,function(x,w){if(w){if(w.charAt(0).toLowerCase()==="x"){w=parseInt(w.substr(1),16)}else{w=parseInt(w,10)}if(w>65535){w-=65536;return String.fromCharCode(55296+(w>>10),56320+(w&1023))}else{return t[w]||String.fromCharCode(w)}}return o[x]||i[x]||s(x)})}};return k});h("tinymce/dom/StyleSheetLoader",["tinymce/util/Tools"],function(i){return function(j,n){var k=0,m={},p;n=n||{};p=n.maxLoadTime||5000;function l(q){j.getElementsByTagName("head")[0].appendChild(q)}function o(s,w,A){var B,r,t,q;function x(){var E=q.passed,D=E.length;while(D--){E[D]()}q.status=2;q.passed=[];q.failed=[]}function z(){var E=q.failed,D=E.length;while(D--){E[D]()}q.status=3;q.passed=[];q.failed=[]}function C(){var D=navigator.userAgent.match(/WebKit\/(\d*)/);return !!(D&&D[1]<536)}function y(D,E){if(!D()){if((new Date().getTime())-t<p){window.setTimeout(E,0)}else{z()}}}function u(){y(function(){var F=j.styleSheets,G,E=F.length,D;while(E--){G=F[E];D=G.ownerNode?G.ownerNode:G.owningElement;if(D&&D.id===B.id){x();return true}}},u)}function v(){y(function(){try{var D=r.sheet.cssRules;x();return !!D}catch(E){}},v)}s=i._addCacheSuffix(s);if(!m[s]){q={passed:[],failed:[]};m[s]=q}else{q=m[s]}if(w){q.passed.push(w)}if(A){q.failed.push(A)}if(q.status==1){return}if(q.status==2){x();return}if(q.status==3){z();return}q.status=1;B=j.createElement("link");B.rel="stylesheet";B.type="text/css";B.id="u"+(k++);B.async=false;B.defer=false;t=new Date().getTime();if("onload" in B&&!C()){B.onload=u;B.onerror=z}else{if(navigator.userAgent.indexOf("Firefox")>0){r=j.createElement("style");r.textContent='@import "'+s+'"';v();l(r);return}else{u()}}l(B);B.href=s}this.load=o}});h("tinymce/dom/DOMUtils",["tinymce/dom/Sizzle","tinymce/dom/DomQuery","tinymce/html/Styles","tinymce/dom/EventUtils","tinymce/dom/TreeWalker","tinymce/dom/Range","tinymce/html/Entities","tinymce/Env","tinymce/util/Tools","tinymce/dom/StyleSheetLoader"],function(k,o,r,n,p,z,l,j,i,u){var m=i.each,q=i.is,s=i.grep,w=i.trim;var v=j.ie;var t=/^([a-z0-9],?)+$/i;var A=/^[ \t\r\n]*$/;function x(C,E){var D={},B=E.keep_values,F;F={set:function(G,I,H){if(E.url_converter){I=E.url_converter.call(E.url_converter_scope||C,I,H,G[0])}G.attr("data-mce-"+H,I).attr(H,I)},get:function(G,H){return G.attr("data-mce-"+H)||G.attr(H)}};D={style:{set:function(G,H){if(H!==null&&typeof H==="object"){G.css(H);return}if(B){G.attr("data-mce-style",H)}G.attr("style",H)},get:function(G){var H=G.attr("data-mce-style")||G.attr("style");H=C.serializeStyle(C.parseStyle(H),G[0].nodeName);return H}}};if(B){D.href=D.src=F}return D}function y(E,C){var B=this,D;B.doc=E;B.win=window;B.files={};B.counter=0;B.stdMode=!v||E.documentMode>=8;B.boxModel=!v||E.compatMode=="CSS1Compat"||B.stdMode;B.styleSheetLoader=new u(E);B.boundEvents=[];B.settings=C=C||{};B.schema=C.schema;B.styles=new r({url_converter:C.url_converter,url_converter_scope:C.url_converter_scope},C.schema);B.fixDoc(E);B.events=C.ownEvents?new n(C.proxy):n.Event;B.attrHooks=x(B,C);D=C.schema?C.schema.getBlockElements():{};B.$=o.overrideDefaults(function(){return{context:E,element:B.getRoot()}});B.isBlock=function(G){if(!G){return false}var F=G.nodeType;if(F){return !!(F===1&&D[G.nodeName])}return !!D[G]}}y.prototype={$$:function(B){if(typeof B=="string"){B=this.get(B)}return this.$(B)},root:null,fixDoc:function(D){var C=this.settings,B;if(v&&C.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(E){D.createElement(E)});for(B in C.schema.getCustomElements()){D.createElement(B)}}},clone:function(D,B){var C=this,F,E;if(!v||D.nodeType!==1||B){return D.cloneNode(B)}E=C.doc;if(!B){F=E.createElement(D.nodeName);m(C.getAttribs(D),function(G){C.setAttrib(F,G.nodeName,C.getAttrib(D,G.nodeName))});return F}return F.firstChild},getRoot:function(){var B=this;return B.settings.root_element||B.doc.body},getViewPort:function(C){var B,D;C=!C?this.win:C;B=C.document;D=this.boxModel?B.documentElement:B.body;return{x:C.pageXOffset||D.scrollLeft,y:C.pageYOffset||D.scrollTop,w:C.innerWidth||D.clientWidth,h:C.innerHeight||D.clientHeight}},getRect:function(E){var B=this,D,C;E=B.get(E);D=B.getPos(E);C=B.getSize(E);return{x:D.x,y:D.y,w:C.w,h:C.h}},getSize:function(E){var C=this,B,D;E=C.get(E);B=C.getStyle(E,"width");D=C.getStyle(E,"height");if(B.indexOf("px")===-1){B=0}if(D.indexOf("px")===-1){D=0}return{w:parseInt(B,10)||E.offsetWidth||E.clientWidth,h:parseInt(D,10)||E.offsetHeight||E.clientHeight}},getParent:function(D,B,C){return this.getParents(D,B,C,false)},getParents:function(G,C,D,H){var F=this,E,B=[];G=F.get(G);H=H===g;D=D||(F.getRoot().nodeName!="BODY"?F.getRoot().parentNode:null);if(q(C,"string")){E=C;if(C==="*"){C=function(I){return I.nodeType==1}}else{C=function(I){return F.is(I,E)}}}while(G){if(G==D||!G.nodeType||G.nodeType===9){break}if(!C||C(G)){if(H){B.push(G)}else{return G}}G=G.parentNode}return H?B:null},get:function(C){var B;if(C&&this.doc&&typeof C=="string"){B=C;C=this.doc.getElementById(C);if(C&&C.id!==B){return this.doc.getElementsByName(B)[1]}}return C},getNext:function(C,B){return this._findSib(C,B,"nextSibling")},getPrev:function(C,B){return this._findSib(C,B,"previousSibling")},select:function(B,D){var C=this;return k(B,C.get(D)||C.settings.root_element||C.doc,[])},is:function(E,B){var C;if(E.length===g){if(B==="*"){return E.nodeType==1}if(t.test(B)){B=B.toLowerCase().split(/,/);E=E.nodeName.toLowerCase();for(C=B.length-1;C>=0;C--){if(B[C]==E){return true}}return false}}if(E.nodeType&&E.nodeType!=1){return false}var D=E.nodeType?[E]:E;return k(B,D[0].ownerDocument||D[0],null,D).length>0},add:function(G,D,C,F,E){var B=this;return this.run(G,function(I){var H;H=q(D,"string")?B.doc.createElement(D):D;B.setAttribs(H,C);if(F){if(F.nodeType){H.appendChild(F)}else{B.setHTML(H,F)}}return !E?I.appendChild(H):H})},create:function(C,B,D){return this.add(this.doc.createElement(C),C,B,D,1)},createHTML:function(C,B,E){var F="",D;F+="<"+C;for(D in B){if(B.hasOwnProperty(D)&&B[D]!==null&&typeof B[D]!="undefined"){F+=" "+D+'="'+this.encode(B[D])+'"'}}if(typeof E!="undefined"){return F+">"+E+"</"+C+">"}return F+" />"},createFragment:function(C){var F,D,E=this.doc,B;B=E.createElement("div");F=E.createDocumentFragment();if(C){B.innerHTML=C}while((D=B.firstChild)){F.appendChild(D)}return F},remove:function(B,C){B=this.$$(B);if(C){B.each(function(){var D;while((D=this.firstChild)){if(D.nodeType==3&&D.data.length===0){this.removeChild(D)}else{this.parentNode.insertBefore(D,this)}}}).remove()}else{B.remove()}return B.length>1?B.toArray():B[0]},setStyle:function(D,B,C){D=this.$$(D).css(B,C);if(this.settings.update_styles){D.attr("data-mce-style",null)}},getStyle:function(D,B,C){D=this.$$(D);if(C){return D.css(B)}B=B.replace(/-(\D)/g,function(F,E){return E.toUpperCase()});if(B=="float"){B=v?"styleFloat":"cssFloat"}return D[0]&&D[0].style?D[0].style[B]:g},setStyles:function(C,B){C=this.$$(C).css(B);if(this.settings.update_styles){C.attr("data-mce-style",null)}},removeAllAttribs:function(B){return this.run(B,function(E){var D,C=E.attributes;for(D=C.length-1;D>=0;D--){E.removeAttributeNode(C.item(D))}})},setAttrib:function(H,D,G){var C=this,B,F,E=C.settings;if(G===""){G=null}H=C.$$(H);B=H.attr(D);if(!H.length){return}F=C.attrHooks[D];if(F&&F.set){F.set(H,G,D)}else{H.attr(D,G)}if(B!=G&&E.onSetAttrib){E.onSetAttrib({attrElm:H,attrName:D,attrValue:G})}},setAttribs:function(D,C){var B=this;B.$$(D).each(function(E,F){m(C,function(H,G){B.setAttrib(F,G,H)})})},getAttrib:function(G,C,F){var B=this,E,D;G=B.$$(G);if(G.length){E=B.attrHooks[C];if(E&&E.get){D=E.get(G,C)}else{D=G.attr(C)}}if(typeof D=="undefined"){D=F||""}return D},getPos:function(D,E){var J=this,H=0,G=0,B,I=J.doc,C=I.body,F;D=J.get(D);E=E||C;if(D){if(E===C&&D.getBoundingClientRect&&o(C).css("position")==="static"){F=D.getBoundingClientRect();E=J.boxModel?I.documentElement:C;H=F.left+(I.documentElement.scrollLeft||C.scrollLeft)-E.clientLeft;G=F.top+(I.documentElement.scrollTop||C.scrollTop)-E.clientTop;return{x:H,y:G}}B=D;while(B&&B!=E&&B.nodeType){H+=B.offsetLeft||0;G+=B.offsetTop||0;B=B.offsetParent}B=D.parentNode;while(B&&B!=E&&B.nodeType){H-=B.scrollLeft||0;G-=B.scrollTop||0;B=B.parentNode}}return{x:H,y:G}},parseStyle:function(B){return this.styles.parse(B)},serializeStyle:function(C,B){return this.styles.serialize(C,B)},addStyle:function(E){var C=this,F=C.doc,D,G;if(C!==y.DOM&&F===document){var B=y.DOM.addedStyles;B=B||[];if(B[E]){return}B[E]=true;y.DOM.addedStyles=B}G=F.getElementById("mceDefaultStyles");if(!G){G=F.createElement("style");G.id="mceDefaultStyles";G.type="text/css";D=F.getElementsByTagName("head")[0];if(D.firstChild){D.insertBefore(G,D.firstChild)}else{D.appendChild(G)}}if(G.styleSheet){G.styleSheet.cssText+=E}else{G.appendChild(F.createTextNode(E))}},loadCSS:function(C){var B=this,E=B.doc,D;if(B!==y.DOM&&E===document){y.DOM.loadCSS(C);return}if(!C){C=""}D=E.getElementsByTagName("head")[0];m(C.split(","),function(F){var G;F=i._addCacheSuffix(F);if(B.files[F]){return}B.files[F]=true;G=B.create("link",{rel:"stylesheet",href:F});if(v&&E.documentMode&&E.recalc){G.onload=function(){if(E.recalc){E.recalc()}G.onload=null}}D.appendChild(G)})},addClass:function(C,B){this.$$(C).addClass(B)},removeClass:function(C,B){this.toggleClass(C,B,false)},hasClass:function(C,B){return this.$$(C).hasClass(B)},toggleClass:function(D,B,C){this.$$(D).toggleClass(B,C).each(function(){if(this.className===""){o(this).attr("class",null)}})},show:function(B){this.$$(B).show()},hide:function(B){this.$$(B).hide()},isHidden:function(B){return this.$$(B).css("display")=="none"},uniqueId:function(B){return(!B?"mce_":B)+(this.counter++)},setHTML:function(C,B){C=this.$$(C);if(v){C.each(function(E,F){if(F.canHaveHTML===false){return}while(F.firstChild){F.removeChild(F.firstChild)}try{F.innerHTML="<br>"+B;F.removeChild(F.firstChild)}catch(D){o("<div>").html("<br>"+B).contents().slice(1).appendTo(F)}return B})}else{C.html(B)}},getOuterHTML:function(B){B=this.get(B);return B.nodeType==1&&"outerHTML" in B?B.outerHTML:o("<div>").append(o(B).clone()).html()},setOuterHTML:function(D,C){var B=this;B.$$(D).each(function(){try{if("outerHTML" in this){this.outerHTML=C;return}}catch(E){}B.remove(o(this).html(C),true)})},decode:l.decode,encode:l.encodeAllRaw,insertAfter:function(C,B){B=this.get(B);return this.run(C,function(E){var D,F;D=B.parentNode;F=B.nextSibling;if(F){D.insertBefore(E,F)}else{D.appendChild(E)}return E})},replace:function(D,C,E){var B=this;return B.run(C,function(F){if(q(F,"array")){D=D.cloneNode(true)}if(E){m(s(F.childNodes),function(G){D.appendChild(G)})}return F.parentNode.replaceChild(D,F)})},rename:function(E,C){var B=this,D;if(E.nodeName!=C.toUpperCase()){D=B.create(C);m(B.getAttribs(E),function(F){B.setAttrib(D,F.nodeName,B.getAttrib(E,F.nodeName))});B.replace(D,E,1)}return D||E},findCommonAncestor:function(D,B){var E=D,C;while(E){C=B;while(C&&E!=C){C=C.parentNode}if(E==C){break}E=E.parentNode}if(!E&&D.ownerDocument){return D.ownerDocument.documentElement}return E},toHex:function(B){return this.styles.toHex(i.trim(B))},run:function(F,E,D){var C=this,B;if(typeof F==="string"){F=C.get(F)}if(!F){return false}D=D||this;if(!F.nodeType&&(F.length||F.length===0)){B=[];m(F,function(H,G){if(H){if(typeof H=="string"){H=C.get(H)}B.push(E.call(D,H,G))}});return B}return E.call(D,F)},getAttribs:function(D){var B;D=this.get(D);if(!D){return[]}if(v){B=[];if(D.nodeName=="OBJECT"){return D.attributes}if(D.nodeName==="OPTION"&&this.getAttrib(D,"selected")){B.push({specified:1,nodeName:"selected"})}var C=/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi;D.cloneNode(false).outerHTML.replace(C,"").replace(/[\w:\-]+/gi,function(E){B.push({specified:1,nodeName:E})});return B}return D.attributes},isEmpty:function(E,C){var J=this,G,F,I,B,D,H=0;E=E.firstChild;if(E){B=new p(E,E.parentNode);C=C||(J.schema?J.schema.getNonEmptyElements():null);do{I=E.nodeType;if(I===1){if(E.getAttribute("data-mce-bogus")){continue}D=E.nodeName.toLowerCase();if(C&&C[D]){if(D==="br"){H++;continue}return false}F=J.getAttribs(E);G=F.length;while(G--){D=F[G].nodeName;if(D==="name"||D==="data-mce-bookmark"){return false}}}if(I==8){return false}if((I===3&&!A.test(E.nodeValue))){return false}}while((E=B.next()))}return H<=1},createRng:function(){var B=this.doc;return B.createRange?B.createRange():new z(this)},nodeIndex:function(E,F){var B=0,D,C;if(E){for(D=E.nodeType,E=E.previousSibling;E;E=E.previousSibling){C=E.nodeType;if(F&&C==3){if(C==D||!E.nodeValue.length){continue}}B++;D=C}}return B},split:function(F,G,C){var J=this,B=J.createRng(),H,E,I;function D(O){var M,L=O.childNodes,N=O.nodeType;function P(S){var R=S.previousSibling&&S.previousSibling.nodeName=="SPAN";var Q=S.nextSibling&&S.nextSibling.nodeName=="SPAN";return R&&Q}if(N==1&&O.getAttribute("data-mce-type")=="bookmark"){return}for(M=L.length-1;M>=0;M--){D(L[M])}if(N!=9){if(N==3&&O.nodeValue.length>0){var K=w(O.nodeValue).length;if(!J.isBlock(O.parentNode)||K>0||K===0&&P(O)){return}}else{if(N==1){L=O.childNodes;if(L.length==1&&L[0]&&L[0].nodeType==1&&L[0].getAttribute("data-mce-type")=="bookmark"){O.parentNode.insertBefore(L[0],O)}if(L.length||/^(br|hr|input|img)$/i.test(O.nodeName)){return}}}J.remove(O)}return O}if(F&&G){B.setStart(F.parentNode,J.nodeIndex(F));B.setEnd(G.parentNode,J.nodeIndex(G));H=B.extractContents();B=J.createRng();B.setStart(G.parentNode,J.nodeIndex(G)+1);B.setEnd(F.parentNode,J.nodeIndex(F)+1);E=B.extractContents();I=F.parentNode;I.insertBefore(D(H),F);if(C){I.replaceChild(C,G)}else{I.insertBefore(G,F)}I.insertBefore(D(E),F);J.remove(F);return C||G}},bind:function(G,C,F,E){var B=this;if(i.isArray(G)){var D=G.length;while(D--){G[D]=B.bind(G[D],C,F,E)}return G}if(B.settings.collect&&(G===B.doc||G===B.win)){B.boundEvents.push([G,C,F,E])}return B.events.bind(G,C,F,E||B)},unbind:function(G,C,F){var B=this,D;if(i.isArray(G)){D=G.length;while(D--){G[D]=B.unbind(G[D],C,F)}return G}if(B.boundEvents&&(G===B.doc||G===B.win)){D=B.boundEvents.length;while(D--){var E=B.boundEvents[D];if(G==E[0]&&(!C||C==E[1])&&(!F||F==E[2])){this.events.unbind(E[0],E[1],E[2])}}}return this.events.unbind(G,C,F)},fire:function(D,C,B){return this.events.fire(D,C,B)},getContentEditable:function(C){var B;if(!C||C.nodeType!=1){return null}B=C.getAttribute("data-mce-contenteditable");if(B&&B!=="inherit"){return B}return C.contentEditable!=="inherit"?C.contentEditable:null},getContentEditableParent:function(C){var B=this.getRoot(),D=null;for(;C&&C!==B;C=C.parentNode){D=this.getContentEditable(C);if(D!==null){break}}return D},destroy:function(){var B=this;if(B.boundEvents){var C=B.boundEvents.length;while(C--){var D=B.boundEvents[C];this.events.unbind(D[0],D[1],D[2])}B.boundEvents=null}if(k.setDocument){k.setDocument()}B.win=B.doc=B.root=B.events=B.frag=null},isChildOf:function(C,B){while(C){if(B===C){return true}C=C.parentNode}return false},dumpRng:function(B){return("startContainer: "+B.startContainer.nodeName+", startOffset: "+B.startOffset+", endContainer: "+B.endContainer.nodeName+", endOffset: "+B.endOffset)},_findSib:function(F,B,D){var C=this,E=B;if(F){if(typeof E=="string"){E=function(G){return C.is(G,B)}}for(F=F[D];F;F=F[D]){if(E(F)){return F}}}return null}};y.DOM=new y(document);return y});h("tinymce/dom/ScriptLoader",["tinymce/dom/DOMUtils","tinymce/util/Tools"],function(m,i){var k=m.DOM;var l=i.each,j=i.grep;function n(){var p=0,w=1,u=2,x={},v=[],r={},q=[],t=0,s;function o(A,E){var B=k,D,C;function y(){B.remove(C);if(D){D.onreadystatechange=D.onload=D=null}E()}function z(){if(typeof console!=="undefined"&&console.log){console.log("Failed to load: "+A)}}C=B.uniqueId();D=document.createElement("script");D.id=C;D.type="text/javascript";D.src=i._addCacheSuffix(A);if("onreadystatechange" in D){D.onreadystatechange=function(){if(/loaded|complete/.test(D.readyState)){y()}}}else{D.onload=y}D.onerror=z;(document.getElementsByTagName("head")[0]||document.body).appendChild(D)}this.isDone=function(y){return x[y]==u};this.markDone=function(y){x[y]=u};this.add=this.load=function(y,B,z){var A=x[y];if(A==s){v.push(y);x[y]=p}if(B){if(!r[y]){r[y]=[]}r[y].push({func:B,scope:z||this})}};this.loadQueue=function(z,y){this.loadScripts(v,z,y)};this.loadScripts=function(y,C,B){var A;function z(D){l(r[D],function(E){E.func.call(E.scope)});r[D]=s}q.push({func:C,scope:B||this});A=function(){var D=j(y);y.length=0;l(D,function(E){if(x[E]==u){z(E);return}if(x[E]!=w){x[E]=w;t++;o(E,function(){x[E]=u;t--;z(E);A()})}});if(!t){l(q,function(E){E.func.call(E.scope)});q.length=0}};A()}}n.ScriptLoader=new n();return n});h("tinymce/AddOnManager",["tinymce/dom/ScriptLoader","tinymce/util/Tools"],function(l,i){var k=i.each;function j(){var m=this;m.items=[];m.urls={};m.lookup={}}j.prototype={get:function(m){if(this.lookup[m]){return this.lookup[m].instance}else{return g}},dependencies:function(n){var m;if(this.lookup[n]){m=this.lookup[n].dependencies}return m||[]},requireLangPack:function(m,n){var o=j.language;if(o&&j.languageLoad!==false){if(n){n=","+n+",";if(n.indexOf(","+o.substr(0,2)+",")!=-1){o=o.substr(0,2)}else{if(n.indexOf(","+o+",")==-1){return}}}l.ScriptLoader.add(this.urls[m]+"/langs/"+o+".js")}},add:function(o,m,n){this.items.push(m);this.lookup[o]={instance:m,dependencies:n};return m},createUrl:function(m,n){if(typeof n==="object"){return n}else{return{prefix:m.prefix,resource:n,suffix:m.suffix}}},addComponents:function(o,m){var n=this.urls[o];k(m,function(p){l.ScriptLoader.add(n+"/"+p)})},load:function(o,q,s,p){var m=this,n=q;function r(){var t=m.dependencies(o);k(t,function(v){var u=m.createUrl(q,v);m.load(u.resource,u,g,g)});if(s){if(p){s.call(p)}else{s.call(l)}}}if(m.urls[o]){return}if(typeof q==="object"){n=q.prefix+q.resource+q.suffix}if(n.indexOf("/")!==0&&n.indexOf("://")==-1){n=j.baseURL+"/"+n}m.urls[o]=n.substring(0,n.lastIndexOf("/"));if(m.lookup[o]){r()}else{l.ScriptLoader.add(n,r,p)}}};j.PluginManager=new j();j.ThemeManager=new j();return j});h("tinymce/dom/RangeUtils",["tinymce/util/Tools","tinymce/dom/TreeWalker"],function(i,j){var l=i.each;function m(n,o){var p=n.childNodes;o--;if(o>p.length-1){o=p.length-1}else{if(o<0){o=0}}return p[o]||n}function k(n){this.walk=function(o,D){var t=o.startContainer,w=o.startOffset,E=o.endContainer,x=o.endOffset,u,r,z,s,C,B,p;p=n.select("td.mce-item-selected,th.mce-item-selected");if(p.length>0){l(p,function(F){D([F])});return}function q(F){var G;G=F[0];if(G.nodeType===3&&G===t&&w>=G.nodeValue.length){F.splice(0,1)}G=F[F.length-1];if(x===0&&F.length>0&&G===E&&G.nodeType===3){F.splice(F.length-1,1)}return F}function A(H,G,F){var I=[];for(;H&&H!=F;H=H[G]){I.push(H)}return I}function y(G,F){do{if(G.parentNode==F){return G}G=G.parentNode}while(G)}function v(H,G,I){var F=I?"nextSibling":"previousSibling";for(s=H,C=s.parentNode;s&&s!=G;s=C){C=s.parentNode;B=A(s==H?s:s[F],F);if(B.length){if(!I){B.reverse()}D(q(B))}}}if(t.nodeType==1&&t.hasChildNodes()){t=t.childNodes[w]}if(E.nodeType==1&&E.hasChildNodes()){E=m(E,x)}if(t==E){return D(q([t]))}u=n.findCommonAncestor(t,E);for(s=t;s;s=s.parentNode){if(s===E){return v(t,u,true)}if(s===u){break}}for(s=E;s;s=s.parentNode){if(s===t){return v(E,u)}if(s===u){break}}r=y(t,u)||t;z=y(E,u)||E;v(t,r,true);B=A(r==t?r:r.nextSibling,"nextSibling",z==E?z.nextSibling:z);if(B.length){D(q(B))}v(E,z)};this.split=function(p){var s=p.startContainer,o=p.startOffset,t=p.endContainer,r=p.endOffset;function q(u,v){return u.splitText(v)}if(s==t&&s.nodeType==3){if(o>0&&o<s.nodeValue.length){t=q(s,o);s=t.previousSibling;if(r>o){r=r-o;s=t=q(t,r).previousSibling;r=t.nodeValue.length;o=0}else{r=0}}}else{if(s.nodeType==3&&o>0&&o<s.nodeValue.length){s=q(s,o);o=0}if(t.nodeType==3&&r>0&&r<t.nodeValue.length){t=q(t,r).previousSibling;r=t.nodeValue.length}}return{startContainer:s,startOffset:o,endContainer:t,endOffset:r}};this.normalize=function(o){var r,q;function p(u){var t,x,s,z=n.getRoot(),v,y;var B,w;function D(E,F){var G=new j(E,n.getParent(E.parentNode,n.isBlock)||z);while((E=G[F?"prev":"next"]())){if(E.nodeName==="BR"){return true}}}function A(F,E){return F.previousSibling&&F.previousSibling.nodeName==E}function C(H,E){var I,F,G;E=E||t;G=n.getParent(E.parentNode,n.isBlock)||z;if(H&&E.nodeName=="BR"&&w&&n.isEmpty(G)){t=E.parentNode;x=n.nodeIndex(E);r=true;return}I=new j(E,G);while((v=I[H?"prev":"next"]())){if(n.getContentEditableParent(v)==="false"){return}if(v.nodeType===3&&v.nodeValue.length>0){t=v;x=H?v.nodeValue.length:0;r=true;return}if(n.isBlock(v)||y[v.nodeName.toLowerCase()]){return}F=v}if(q&&F){t=F;r=true;x=0}}t=o[(u?"start":"end")+"Container"];x=o[(u?"start":"end")+"Offset"];w=t.nodeType==1&&x===t.childNodes.length;y=n.schema.getNonEmptyElements();B=u;if(t.nodeType==1&&x>t.childNodes.length-1){B=false}if(t.nodeType===9){t=n.getRoot();x=0}if(t===z){if(B){v=t.childNodes[x>0?x-1:0];if(v){if(y[v.nodeName]||v.nodeName=="TABLE"){return}}}if(t.hasChildNodes()){x=Math.min(!B&&x>0?x-1:x,t.childNodes.length-1);t=t.childNodes[x];x=0;if(t.hasChildNodes()&&!/TABLE/.test(t.nodeName)){v=t;s=new j(t,z);do{if(v.nodeType===3&&v.nodeValue.length>0){x=B?0:v.nodeValue.length;t=v;r=true;break}if(y[v.nodeName.toLowerCase()]){x=n.nodeIndex(v);t=v.parentNode;if(v.nodeName=="IMG"&&!B){x++}r=true;break}}while((v=(B?s.next():s.prev())))}}}if(q){if(t.nodeType===3&&x===0){C(true)}if(t.nodeType===1){v=t.childNodes[x];if(!v){v=t.childNodes[x-1]}if(v&&v.nodeName==="BR"&&!A(v,"A")&&!D(v)&&!D(v,true)){C(true,v)}}}if(B&&!q&&t.nodeType===3&&x===t.nodeValue.length){C(false)}if(r){o["set"+(u?"Start":"End")](t,x)}}q=o.collapsed;p(true);if(!q){p()}if(r&&q){o.collapse(true)}return r}}k.compareRanges=function(o,n){if(o&&n){if(o.item||o.duplicate){if(o.item&&n.item&&o.item(0)===n.item(0)){return true}if(o.isEqual&&n.isEqual&&n.isEqual(o)){return true}}else{return o.startContainer==n.startContainer&&o.startOffset==n.startOffset}}return false};k.getCaretRangeFromPoint=function(o,s,r){var p,n;if(r.caretPositionFromPoint){n=r.caretPositionFromPoint(o,s);p=r.createRange();p.setStart(n.offsetNode,n.offset);p.collapse(true)}else{if(r.caretRangeFromPoint){p=r.caretRangeFromPoint(o,s)}else{if(r.body.createTextRange){p=r.body.createTextRange();try{p.moveToPoint(o,s);p.collapse(true)}catch(q){p.collapse(s<r.body.clientHeight)}}}}return p};k.getNode=function(n,o){if(n.nodeType==1&&n.hasChildNodes()){if(o>=n.childNodes.length){o=n.childNodes.length-1}n=n.childNodes[o]}return n};return k});h("tinymce/NodeChange",["tinymce/dom/RangeUtils","tinymce/Env"],function(j,i){return function(k){var m,l=[];function n(o){var p,q;q=k.$(o).parentsUntil(k.getBody()).add(o);if(q.length===l.length){for(p=q.length;p>=0;p--){if(q[p]!==l[p]){break}}if(p===-1){l=q;return true}}l=q;return false}if(!("onselectionchange" in k.getDoc())){k.on("NodeChange Click MouseUp KeyUp Focus",function(p){var q,o;q=k.selection.getRng();o={startContainer:q.startContainer,startOffset:q.startOffset,endContainer:q.endContainer,endOffset:q.endOffset};if(p.type=="nodechange"||!j.compareRanges(o,m)){k.fire("SelectionChange")}m=o})}k.on("contextmenu",function(){k.fire("SelectionChange")});k.on("SelectionChange",function(){var o=k.selection.getStart(true);if(!i.range&&k.selection.isCollapsed()){return}if(!n(o)&&k.dom.isChildOf(o,k.getBody())){k.nodeChanged({selectionChange:true})}});k.on("MouseUp",function(o){if(!o.isDefaultPrevented()){if(k.selection.getNode().nodeName=="IMG"){setTimeout(function(){k.nodeChanged()},0)}else{k.nodeChanged()}}});this.nodeChanged=function(q){var r=k.selection,s,p,o;if(k.initialized&&r&&!k.settings.disable_nodechange&&!k.settings.readonly){o=k.getBody();s=r.getStart()||o;s=s.ownerDocument!=k.getDoc()?k.getBody():s;if(s.nodeName=="IMG"&&r.isCollapsed()){s=s.parentNode}p=[];k.dom.getParent(s,function(t){if(t===o){return true}p.push(t)});q=q||{};q.element=s;q.parents=p;k.fire("NodeChange",q)}}}});h("tinymce/html/Node",[],function(){var k=/^[ \t\r\n]*$/,l={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};function i(r,s,q){var p,o,m=q?"lastChild":"firstChild",n=q?"prev":"next";if(r[m]){return r[m]}if(r!==s){p=r[n];if(p){return p}for(o=r.parent;o&&o!==s;o=o.parent){p=o[n];if(p){return p}}}}function j(m,n){this.name=m;this.type=n;if(n===1){this.attributes=[];this.attributes.map={}}}j.prototype={replace:function(n){var m=this;if(n.parent){n.remove()}m.insert(n,m);m.remove();return m},attr:function(o,r){var m=this,n,p,q;if(typeof o!=="string"){for(p in o){m.attr(p,o[p])}return m}if((n=m.attributes)){if(r!==q){if(r===null){if(o in n.map){delete n.map[o];p=n.length;while(p--){if(n[p].name===o){n=n.splice(p,1);return m}}}return m}if(o in n.map){p=n.length;while(p--){if(n[p].name===o){n[p].value=r;break}}}else{n.push({name:o,value:r})}n.map[o]=r;return m}else{return n.map[o]}}},clone:function(){var n=this,s=new j(n.name,n.type),o,m,r,p,q;if((r=n.attributes)){q=[];q.map={};for(o=0,m=r.length;o<m;o++){p=r[o];if(p.name!=="id"){q[q.length]={name:p.name,value:p.value};q.map[p.name]=p.value}}s.attributes=q}s.value=n.value;s.shortEnded=n.shortEnded;return s},wrap:function(n){var m=this;m.parent.insert(n,m);n.append(m);return m},unwrap:function(){var m=this,o,n;for(o=m.firstChild;o;){n=o.next;m.insert(o,m,true);o=n}m.remove()},remove:function(){var m=this,o=m.parent,n=m.next,p=m.prev;if(o){if(o.firstChild===m){o.firstChild=n;if(n){n.prev=null}}else{p.next=n}if(o.lastChild===m){o.lastChild=p;if(p){p.next=null}}else{n.prev=p}m.parent=m.next=m.prev=null}return m},append:function(o){var m=this,n;if(o.parent){o.remove()}n=m.lastChild;if(n){n.next=o;o.prev=n;m.lastChild=o}else{m.lastChild=m.firstChild=o}o.parent=m;return o},insert:function(o,m,p){var n;if(o.parent){o.remove()}n=m.parent||this;if(p){if(m===n.firstChild){n.firstChild=o}else{m.prev.next=o}o.prev=m.prev;o.next=m;m.prev=o}else{if(m===n.lastChild){n.lastChild=o}else{m.next.prev=o}o.next=m.next;o.prev=m;m.next=o}o.parent=n;return o},getAll:function(n){var m=this,o,p=[];for(o=m.firstChild;o;o=i(o,m)){if(o.name===n){p.push(o)}}return p},empty:function(){var n=this,m,o,p;if(n.firstChild){m=[];for(p=n.firstChild;p;p=i(p,n)){m.push(p)}o=m.length;while(o--){p=m[o];p.parent=p.firstChild=p.lastChild=p.next=p.prev=null}}n.firstChild=n.lastChild=null;return n},isEmpty:function(q){var m=this,p=m.firstChild,o,n;if(p){do{if(p.type===1){if(p.attributes.map["data-mce-bogus"]){continue}if(q[p.name]){return false}o=p.attributes.length;while(o--){n=p.attributes[o].name;if(n==="name"||n.indexOf("data-mce-bookmark")===0){return false}}}if(p.type===8){return false}if((p.type===3&&!k.test(p.value))){return false}}while((p=i(p,m)))}return true},walk:function(m){return i(this,null,m)}};j.create=function(n,m){var p,o;p=new j(n,l[n]||1);if(m){for(o in m){p.attr(o,m[o])}}return p};return j});h("tinymce/html/Schema",["tinymce/util/Tools"],function(j){var k={},m={};var l=j.makeMap,q=j.each,n=j.extend,p=j.explode,s=j.inArray;function o(t,u){return t?t.split(u||" "):[]}function r(A){var x={},B,u;var y,z,t,w;function C(G,D,J){var I,H,K,F=arguments;function E(P,O){var N={},M,L;for(M=0,L=P.length;M<L;M++){N[P[M]]=O||{}}return N}J=J||[];D=D||"";if(typeof J==="string"){J=o(J)}for(H=3;H<F.length;H++){if(typeof F[H]==="string"){F[H]=o(F[H])}J.push.apply(J,F[H])}G=o(G);I=G.length;while(I--){K=[].concat(B,o(D));x[G[I]]={attributes:E(K),attributesOrder:K,children:E(J,m)}}}function v(G,F){var I,E,H,D;G=o(G);I=G.length;F=o(F);while(I--){E=x[G[I]];for(H=0,D=F.length;H<D;H++){E.attributes[F[H]]={};E.attributesOrder.push(F[H])}}}if(k[A]){return k[A]}B=o("id accesskey class dir lang style tabindex title");u=o("address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul");y=o("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");if(A!="html4"){B.push.apply(B,o("contenteditable contextmenu draggable dropzone hidden spellcheck translate"));u.push.apply(u,o("article aside details dialog figure header footer hgroup section nav"));y.push.apply(y,o("audio canvas command datalist mark meter output progress time wbr video ruby bdi keygen"))}if(A!="html5-strict"){B.push("xml:lang");w=o("acronym applet basefont big font strike tt");y.push.apply(y,w);q(w,function(D){C(D,"",y)});t=o("center dir isindex noframes");u.push.apply(u,t);z=[].concat(u,y);q(t,function(D){C(D,"",z)})}z=z||[].concat(u,y);C("html","manifest","head body");C("head","","base command link meta noscript script style title");C("title hr noscript br");C("base","href target");C("link","href rel media hreflang type sizes hreflang");C("meta","name http-equiv content charset");C("style","media type scoped");C("script","src async defer type charset");C("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",z);C("address dt dd div caption","",z);C("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","",y);C("blockquote","cite",z);C("ol","reversed start type","li");C("ul","","li");C("li","value",z);C("dl","","dt dd");C("a","href target rel media hreflang type",y);C("q","cite",y);C("ins del","cite datetime",z);C("img","src sizes srcset alt usemap ismap width height");C("iframe","src name width height",z);C("embed","src type width height");C("object","data type typemustmatch name usemap form width height",z,"param");C("param","name value");C("map","name",z,"area");C("area","alt coords shape href target rel media hreflang type");C("table","border","caption colgroup thead tfoot tbody tr"+(A=="html4"?" col":""));C("colgroup","span","col");C("col","span");C("tbody thead tfoot","","tr");C("tr","","td th");C("td","colspan rowspan headers",z);C("th","colspan rowspan headers scope abbr",z);C("form","accept-charset action autocomplete enctype method name novalidate target",z);C("fieldset","disabled form name",z,"legend");C("label","form for",y);C("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");C("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value",A=="html4"?z:y);C("select","disabled form multiple name required size","option optgroup");C("optgroup","disabled label","option");C("option","disabled label selected value");C("textarea","cols dirname disabled form maxlength name readonly required rows wrap");C("menu","type label",z,"li");C("noscript","",z);if(A!="html4"){C("wbr");C("ruby","",y,"rt rp");C("figcaption","",z);C("mark rt rp summary bdi","",y);C("canvas","width height",z);C("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",z,"track source");C("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",z,"track source");C("picture","","img source");C("source","src srcset type media sizes");C("track","kind src srclang label default");C("datalist","",y,"option");C("article section nav aside header footer","",z);C("hgroup","","h1 h2 h3 h4 h5 h6");C("figure","",z,"figcaption");C("time","datetime",y);C("dialog","open",z);C("command","type label icon disabled checked radiogroup command");C("output","for form name",y);C("progress","value max",y);C("meter","value min max low high optimum",y);C("details","open",z,"summary");C("keygen","autofocus challenge disabled form keytype name")}if(A!="html5-strict"){v("script","language xml:space");v("style","xml:space");v("object","declare classid code codebase codetype archive standby align border hspace vspace");v("embed","align name hspace vspace");v("param","valuetype type");v("a","charset name rev shape coords");v("br","clear");v("applet","codebase archive code object alt name width height align hspace vspace");v("img","name longdesc align border hspace vspace");v("iframe","longdesc frameborder marginwidth marginheight scrolling align");v("font basefont","size color face");v("input","usemap align");v("select","onchange");v("textarea");v("h1 h2 h3 h4 h5 h6 div p legend caption","align");v("ul","type compact");v("li","type");v("ol dl menu dir","compact");v("pre","width xml:space");v("hr","align noshade size width");v("isindex","prompt");v("table","summary width frame rules cellspacing cellpadding align bgcolor");v("col","width align char charoff valign");v("colgroup","width align char charoff valign");v("thead","align char charoff valign");v("tr","align char charoff valign bgcolor");v("th","axis align char charoff valign nowrap bgcolor width height");v("form","accept");v("td","abbr axis scope align char charoff valign nowrap bgcolor width height");v("tfoot","align char charoff valign");v("tbody","align char charoff valign");v("area","nohref");v("body","background bgcolor text link vlink alink")}if(A!="html4"){v("input button select textarea","autofocus");v("input textarea","placeholder");v("a","download");v("link script img","crossorigin");v("iframe","sandbox seamless allowfullscreen")}q(o("a form meter progress dfn"),function(D){if(x[D]){delete x[D].children[D]}});delete x.caption.children.table;k[A]=x;return x}function i(u,v){var t;if(u){t={};if(typeof u=="string"){u={"*":u}}q(u,function(x,w){t[w]=t[w.toUpperCase()]=v=="map"?l(x,/[, ]/):p(x,/[, ]/)})}return t}return function(P){var K=this,I={},x={},w=[],T,t,N;var D,F,O,G,H;var L,C,B,u,S;var E={},y={};function A(W,U,V){var X=P[W];if(!X){X=k[W];if(!X){X=l(U," ",l(U.toUpperCase()," "));X=n(X,V);k[W]=X}}else{X=l(X,/[, ]/,l(X.toUpperCase(),/[, ]/))}return X}P=P||{};N=r(P.schema);if(P.verify_html===false){P.valid_elements="*[*]"}T=i(P.valid_styles);t=i(P.invalid_styles,"map");H=i(P.valid_classes,"map");D=A("whitespace_elements","pre script noscript style textarea video audio iframe object");F=A("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr");O=A("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track");G=A("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls");C=A("non_empty_elements","td th iframe video audio object script",O);B=A("move_caret_before_on_enter_elements","table",C);u=A("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");L=A("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup",u);S=A("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp");q((P.special||"script noscript style textarea").split(" "),function(U){y[U]=new RegExp("</"+U+"[^>]*>","gi")});function v(U){return new RegExp("^"+U.replace(/([?+*])/g,".$1")+"$")}function R(ag){var aa,W,aq,am,V,Y,ak,ao,ae,ap,ar,ad,Z,an,U,ah,X,at,aj,ac=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,af=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,ab=/[*?+]/;if(ag){ag=o(ag,",");if(I["@"]){ah=I["@"].attributes;X=I["@"].attributesOrder}for(aa=0,W=ag.length;aa<W;aa++){V=ac.exec(ag[aa]);if(V){an=V[1];ae=V[2];U=V[3];ao=V[5];ad={};Z=[];Y={attributes:ad,attributesOrder:Z};if(an==="#"){Y.paddEmpty=true}if(an==="-"){Y.removeEmpty=true}if(V[4]==="!"){Y.removeEmptyAttrs=true}if(ah){for(at in ah){ad[at]=ah[at]}Z.push.apply(Z,X)}if(ao){ao=o(ao,"|");for(aq=0,am=ao.length;aq<am;aq++){V=af.exec(ao[aq]);if(V){ak={};ar=V[1];ap=V[2].replace(/::/g,":");an=V[3];aj=V[4];if(ar==="!"){Y.attributesRequired=Y.attributesRequired||[];Y.attributesRequired.push(ap);ak.required=true}if(ar==="-"){delete ad[ap];Z.splice(s(Z,ap),1);continue}if(an){if(an==="="){Y.attributesDefault=Y.attributesDefault||[];Y.attributesDefault.push({name:ap,value:aj});ak.defaultValue=aj}if(an===":"){Y.attributesForced=Y.attributesForced||[];Y.attributesForced.push({name:ap,value:aj});ak.forcedValue=aj}if(an==="<"){ak.validValues=l(aj,"?")}}if(ab.test(ap)){Y.attributePatterns=Y.attributePatterns||[];ak.pattern=v(ap);Y.attributePatterns.push(ak)}else{if(!ad[ap]){Z.push(ap)}ad[ap]=ak}}}}if(!ah&&ae=="@"){ah=ad;X=Z}if(U){Y.outputName=ae;I[U]=Y}if(ab.test(ae)){Y.pattern=v(ae);w.push(Y)}else{I[ae]=Y}}}}}function J(U){I={};w=[];R(U);q(N,function(W,V){x[V]=W.children})}function z(V){var U=/^(~)?(.+)$/;if(V){k.text_block_elements=k.block_elements=null;q(o(V,","),function(aa){var Y=U.exec(aa),Z=Y[1]==="~",ab=Z?"span":"div",X=Y[2];x[X]=x[ab];E[X]=ab;if(!Z){L[X.toUpperCase()]={};L[X]={}}if(!I[X]){var W=I[ab];W=n({},W);delete W.removeEmptyAttrs;delete W.removeEmpty;I[X]=W}q(x,function(ac,ad){if(ac[ab]){x[ad]=ac=n({},x[ad]);ac[X]=ac[ab]}})})}}function M(U){var V=/^([+\-]?)(\w+)\[([^\]]+)\]$/;if(U){q(o(U,","),function(Z){var Y=V.exec(Z),W,X;if(Y){X=Y[1];if(X){W=x[Y[2]]}else{W=x[Y[2]]={"#comment":{}}}W=x[Y[2]];q(o(Y[3],"|"),function(aa){if(X==="-"){x[Y[2]]=W=n({},x[Y[2]]);delete W[aa]}else{W[aa]={}}})}})}}function Q(U){var W=I[U],V;if(W){return W}V=w.length;while(V--){W=w[V];if(W.pattern.test(U)){return W}}}if(!P.valid_elements){q(N,function(V,U){I[U]={attributes:V.attributes,attributesOrder:V.attributesOrder};x[U]=V.children});if(P.schema!="html5"){q(o("strong/b em/i"),function(U){U=o(U,"/");I[U[1]].outputName=U[0]})}I.img.attributesDefault=[{name:"alt",value:""}];q(o("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(U){if(I[U]){I[U].removeEmpty=true}});q(o("p h1 h2 h3 h4 h5 h6 th td pre div address caption"),function(U){I[U].paddEmpty=true});q(o("span"),function(U){I[U].removeEmptyAttrs=true})}else{J(P.valid_elements)}z(P.custom_elements);M(P.valid_children);R(P.extended_valid_elements);M("+ol[ul|ol],+ul[ul|ol]");if(P.invalid_elements){q(p(P.invalid_elements),function(U){if(I[U]){delete I[U]}})}if(!Q("span")){R("span[!data-mce-type|*]")}K.children=x;K.getValidStyles=function(){return T};K.getInvalidStyles=function(){return t};K.getValidClasses=function(){return H};K.getBoolAttrs=function(){return G};K.getBlockElements=function(){return L};K.getTextBlockElements=function(){return u};K.getTextInlineElements=function(){return S};K.getShortEndedElements=function(){return O};K.getSelfClosingElements=function(){return F};K.getNonEmptyElements=function(){return C};K.getMoveCaretBeforeOnEnterElements=function(){return B};K.getWhiteSpaceElements=function(){return D};K.getSpecialElements=function(){return y};K.isValidChild=function(U,W){var V=x[U];return !!(V&&V[W])};K.isValid=function(V,U){var X,W,Y=Q(V);if(Y){if(U){if(Y.attributes[U]){return true}X=Y.attributePatterns;if(X){W=X.length;while(W--){if(X[W].pattern.test(V)){return true}}}}else{return true}}return false};K.getElementRule=Q;K.getCustomElements=function(){return E};K.addValidElements=R;K.setValidElements=J;K.addCustomElements=z;K.addValidChildren=M;K.elements=I}});h("tinymce/html/SaxParser",["tinymce/html/Schema","tinymce/html/Entities","tinymce/util/Tools"],function(l,n,k){var m=k.each;function j(s,q,v){var r=1,o,u,t,p;p=s.getShortEndedElements();t=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g;t.lastIndex=o=v;while((u=t.exec(q))){o=t.lastIndex;if(u[1]==="/"){r--}else{if(!u[1]){if(u[2] in p){continue}r++}}if(r===0){break}}return o}function i(p,r){var o=this;function q(){}p=p||{};o.schema=r=r||new l();if(p.fix_self_closing!==false){p.fix_self_closing=true}m("comment cdata text start end pi doctype".split(" "),function(s){if(s){o[s]=p[s]||q}});o.parse=function(P){var B=this,t,R=0,U,M,L=[],Z,ac,N,D;var K,E,Y,S,aa;var H,A,x,F,ae,ab,Q;var af,X,s;var ad,V,y,O,W,u,I=0;var w=n.decode,J,T=k.makeMap("src,href,data,background,formaction,poster");var v=/((java|vb)script|mhtml):/i,z=/^data:/i;function G(ag){var ai,ah;ai=L.length;while(ai--){if(L[ai].name===ag){break}}if(ai>=0){for(ah=L.length-1;ah>=ai;ah--){ag=L[ah];if(ag.valid){B.end(ag.name)}}L.length=ai}}function C(al,ah,ap,an,am){var aj,ak,ag=/[\s\u0000-\u001F]+/g;ah=ah.toLowerCase();ap=ah in S?ah:w(ap||an||am||"");if(H&&!K&&ah.indexOf("data-")!==0){aj=ab[ah];if(!aj&&Q){ak=Q.length;while(ak--){aj=Q[ak];if(aj.pattern.test(ah)){break}}if(ak===-1){aj=null}}if(!aj){return}if(aj.validValues&&!(ap in aj.validValues)){return}}if(T[ah]&&!p.allow_script_urls){var ai=ap.replace(ag,"");try{ai=decodeURIComponent(ai)}catch(ao){ai=unescape(ai)}if(v.test(ai)){return}if(!p.allow_html_data_urls&&z.test(ai)&&!/^data:image\//i.test(ai)){return}}Z.map[ah]=ap;Z.push({name:ah,value:ap})}y=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-_\\:\\.]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g");O=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g;Y=r.getShortEndedElements();V=p.self_closing_elements||r.getSelfClosingElements();S=r.getBoolAttrs();H=p.validate;E=p.remove_internals;J=p.fix_self_closing;W=r.getSpecialElements();while((t=y.exec(P))){if(R<t.index){B.text(w(P.substr(R,t.index-R)))}if((U=t[6])){U=U.toLowerCase();if(U.charAt(0)===":"){U=U.substr(1)}G(U)}else{if((U=t[7])){U=U.toLowerCase();if(U.charAt(0)===":"){U=U.substr(1)}aa=U in Y;if(J&&V[U]&&L.length>0&&L[L.length-1].name===U){G(U)}if(!H||(A=r.getElementRule(U))){x=true;if(H){ab=A.attributes;Q=A.attributePatterns}if((ae=t[8])){K=ae.indexOf("data-mce-type")!==-1;if(K&&E){x=false}Z=[];Z.map={};ae.replace(O,C)}else{Z=[];Z.map={}}if(H&&!K){af=A.attributesRequired;X=A.attributesDefault;s=A.attributesForced;ad=A.removeEmptyAttrs;if(ad&&!Z.length){x=false}if(s){ac=s.length;while(ac--){F=s[ac];D=F.name;u=F.value;if(u==="{$uid}"){u="mce_"+I++}Z.map[D]=u;Z.push({name:D,value:u})}}if(X){ac=X.length;while(ac--){F=X[ac];D=F.name;if(!(D in Z.map)){u=F.value;if(u==="{$uid}"){u="mce_"+I++}Z.map[D]=u;Z.push({name:D,value:u})}}}if(af){ac=af.length;while(ac--){if(af[ac] in Z.map){break}}if(ac===-1){x=false}}if((F=Z.map["data-mce-bogus"])){if(F==="all"){R=j(r,P,y.lastIndex);y.lastIndex=R;continue}x=false}}if(x){B.start(U,Z,aa)}}else{x=false}if((M=W[U])){M.lastIndex=R=t.index+t[0].length;if((t=M.exec(P))){if(x){N=P.substr(R,t.index-R)}R=t.index+t[0].length}else{N=P.substr(R);R=P.length}if(x){if(N.length>0){B.text(N,true)}B.end(U)}y.lastIndex=R;continue}if(!aa){if(!ae||ae.indexOf("/")!=ae.length-1){L.push({name:U,valid:x})}else{if(x){B.end(U)}}}}else{if((U=t[1])){if(U.charAt(0)===">"){U=" "+U}if(!p.allow_conditional_comments&&U.substr(0,3)==="[if"){U=" "+U}B.comment(U)}else{if((U=t[2])){B.cdata(U)}else{if((U=t[3])){B.doctype(U)}else{if((U=t[4])){B.pi(U,t[5])}}}}}}R=t.index+t[0].length}if(R<P.length){B.text(w(P.substr(R)))}for(ac=L.length-1;ac>=0;ac--){U=L[ac];if(U.valid){B.end(U.name)}}}}i.findEndTag=j;return i});h("tinymce/html/DomParser",["tinymce/html/Node","tinymce/html/Schema","tinymce/html/SaxParser","tinymce/util/Tools"],function(k,m,i,j){var n=j.makeMap,o=j.each,l=j.explode,p=j.extend;return function(u,v){var t=this,s={},r=[],w={},q={};u=u||{};u.validate="validate" in u?u.validate:true;u.root_name=u.root_name||"body";t.schema=v=v||new m();function x(B){var D,E,K,J,M,C,F,z,I;var y,H,A,L,G;H=n("tr,td,th,tbody,thead,tfoot,table");y=v.getNonEmptyElements();A=v.getTextBlockElements();for(D=0;D<B.length;D++){E=B[D];if(!E.parent||E.fixed){continue}if(A[E.name]&&E.parent.name=="li"){L=E.next;while(L){if(A[L.name]){L.name="li";L.fixed=true;E.parent.insert(L,E.parent)}else{break}L=L.next}E.unwrap(E);continue}J=[E];for(K=E.parent;K&&!v.isValidChild(K.name,E.name)&&!H[K.name];K=K.parent){J.push(K)}if(K&&J.length>1){J.reverse();M=C=t.filterNode(J[0].clone());for(I=0;I<J.length-1;I++){if(v.isValidChild(C.name,J[I].name)){F=t.filterNode(J[I].clone());C.append(F)}else{F=C}for(z=J[I].firstChild;z&&z!=J[I+1];){G=z.next;F.append(z);z=G}C=F}if(!M.isEmpty(y)){K.insert(M,J[0],true);K.insert(E,M)}else{K.insert(E,J[0],true)}K=J[0];if(K.isEmpty(y)||K.firstChild===K.lastChild&&K.firstChild.name==="br"){K.empty().remove()}}else{if(E.parent){if(E.name==="li"){L=E.prev;if(L&&(L.name==="ul"||L.name==="ul")){L.append(E);continue}L=E.next;if(L&&(L.name==="ul"||L.name==="ul")){L.insert(E,L.firstChild,true);continue}E.wrap(t.filterNode(new k("ul",1)));continue}if(v.isValidChild(E.parent.name,"div")&&v.isValidChild("div",E.name)){E.wrap(t.filterNode(new k("div",1)))}else{if(E.name==="style"||E.name==="script"){E.empty().remove()}else{E.unwrap()}}}}}}t.filterNode=function(A){var z,y,B;if(y in s){B=w[y];if(B){B.push(A)}else{w[y]=[A]}}z=r.length;while(z--){y=r[z].name;if(y in A.attributes.map){B=q[y];if(B){B.push(A)}else{q[y]=[A]}}}return A};t.addNodeFilter=function(y,z){o(l(y),function(A){var B=s[A];if(!B){s[A]=B=[]}B.push(z)})};t.addAttributeFilter=function(y,z){o(l(y),function(A){var B;for(B=0;B<r.length;B++){if(r[B].name===A){r[B].callbacks.push(z);return}}r.push({name:A,callbacks:[z]})})};t.parse=function(I,z){var A,V,N,M,P,O,J,E,R,Z,L;var B,Q,Y=[],X;var G,y,K,F;var C,H,D;z=z||{};w={};q={};B=p(n("script,style,head,html,body,title,meta,param"),v.getBlockElements());H=v.getNonEmptyElements();C=v.children;L=u.validate;D="forced_root_block" in z?z.forced_root_block:u.forced_root_block;F=v.getWhiteSpaceElements();Q=/^[ \t\r\n]+/;G=/[ \t\r\n]+$/;y=/[ \t\r\n]+/g;K=/^[ \t\r\n]+$/;function S(){var ac=V.firstChild,ab,ad;function aa(ae){if(ae){ac=ae.firstChild;if(ac&&ac.type==3){ac.value=ac.value.replace(Q,"")}ac=ae.lastChild;if(ac&&ac.type==3){ac.value=ac.value.replace(G,"")}}}if(!v.isValidChild(V.name,D.toLowerCase())){return}while(ac){ab=ac.next;if(ac.type==3||(ac.type==1&&ac.name!=="p"&&!B[ac.name]&&!ac.attr("data-mce-type"))){if(!ad){ad=W(D,1);ad.attr(u.forced_root_block_attrs);V.insert(ad,ac);ad.append(ac)}else{ad.append(ac)}}else{aa(ad);ad=null}ac=ab}aa(ad)}function W(aa,ab){var ac=new k(aa,ab),ad;if(aa in s){ad=w[aa];if(ad){ad.push(ac)}else{w[aa]=[ac]}}return ac}function U(ac){var ad,aa,ab;for(ad=ac.prev;ad&&ad.type===3;){aa=ad.value.replace(G,"");if(aa.length>0){ad.value=aa;ad=ad.prev}else{ab=ad.prev;ad.remove();ad=ab}}}function T(ab){var ac,aa={};for(ac in ab){if(ac!=="li"&&ac!="p"){aa[ac]=ab[ac]}}return aa}A=new i({validate:L,allow_script_urls:u.allow_script_urls,allow_conditional_comments:u.allow_conditional_comments,self_closing_elements:T(v.getSelfClosingElements()),cdata:function(aa){N.append(W("#cdata",4)).value=aa},text:function(ac,aa){var ab;if(!X){ac=ac.replace(y," ");if(N.lastChild&&B[N.lastChild.name]){ac=ac.replace(Q,"")}}if(ac.length!==0){ab=W("#text",3);ab.raw=!!aa;N.append(ab).value=ac}},comment:function(aa){N.append(W("#comment",8)).value=aa},pi:function(aa,ab){N.append(W(aa,7)).value=ab;U(N)},doctype:function(ab){var aa;aa=N.append(W("#doctype",10));aa.value=ab;U(N)},start:function(ac,ab,ah){var ae,aa,ag,ad,af;ag=L?v.getElementRule(ac):{};if(ag){ae=W(ag.outputName||ac,1);ae.attributes=ab;ae.shortEnded=ah;N.append(ae);af=C[N.name];if(af&&C[ae.name]&&!af[ae.name]){Y.push(ae)}aa=r.length;while(aa--){ad=r[aa].name;if(ad in ab.map){R=q[ad];if(R){R.push(ae)}else{q[ad]=[ae]}}}if(B[ac]){U(ae)}if(!ah){N=ae}if(!X&&F[ac]){X=true}}},end:function(aa){var af,ac,ae,ab,ad;ac=L?v.getElementRule(aa):{};if(ac){if(B[aa]){if(!X){af=N.firstChild;if(af&&af.type===3){ae=af.value.replace(Q,"");if(ae.length>0){af.value=ae;af=af.next}else{ab=af.next;af.remove();af=ab;while(af&&af.type===3){ae=af.value;ab=af.next;if(ae.length===0||K.test(ae)){af.remove();af=ab}af=ab}}}af=N.lastChild;if(af&&af.type===3){ae=af.value.replace(G,"");if(ae.length>0){af.value=ae;af=af.prev}else{ab=af.prev;af.remove();af=ab;while(af&&af.type===3){ae=af.value;ab=af.prev;if(ae.length===0||K.test(ae)){af.remove();af=ab}af=ab}}}}}if(X&&F[aa]){X=false}if(ac.removeEmpty||ac.paddEmpty){if(N.isEmpty(H)){if(ac.paddEmpty){N.empty().append(new k("#text","3")).value="\u00a0"}else{if(!N.attributes.map.name&&!N.attributes.map.id){ad=N.parent;if(B[N.name]){N.empty().remove()}else{N.unwrap()}N=ad;return}}}}N=N.parent}}},v);V=N=new k(z.context||u.root_name,11);A.parse(I);if(L&&Y.length){if(!z.context){x(Y)}else{z.invalid=true}}if(D&&(V.name=="body"||z.isRootContent)){S()}if(!z.invalid){for(Z in w){R=s[Z];M=w[Z];J=M.length;while(J--){if(!M[J].parent){M.splice(J,1)}}for(P=0,O=R.length;P<O;P++){R[P](M,Z,z)}}for(P=0,O=r.length;P<O;P++){R=r[P];if(R.name in q){M=q[R.name];J=M.length;while(J--){if(!M[J].parent){M.splice(J,1)}}for(J=0,E=R.callbacks.length;J<E;J++){R.callbacks[J](M,R.name,z)}}}}return V};if(u.remove_trailing_brs){t.addNodeFilter("br",function(z){var E,D=z.length,A,J=p({},v.getBlockElements());var y=v.getNonEmptyElements(),H,F,C,I;var G,B;J.body=1;for(E=0;E<D;E++){A=z[E];H=A.parent;if(J[A.parent.name]&&A===H.lastChild){C=A.prev;while(C){I=C.name;if(I!=="span"||C.attr("data-mce-type")!=="bookmark"){if(I!=="br"){break}if(I==="br"){A=null;break}}C=C.prev}if(A){A.remove();if(H.isEmpty(y)){G=v.getElementRule(H.name);if(G){if(G.removeEmpty){H.remove()}else{if(G.paddEmpty){H.empty().append(new k("#text",3)).value="\u00a0"}}}}}}else{F=A;while(H&&H.firstChild===F&&H.lastChild===F){F=H;if(J[H.name]){break}H=H.parent}if(F===H){B=new k("#text",3);B.value="\u00a0";A.replace(B)}}}})}if(!u.allow_html_in_named_anchor){t.addAttributeFilter("id,name",function(y){var A=y.length,C,z,B,D;while(A--){D=y[A];if(D.name==="a"&&D.firstChild&&!D.attr("href")){B=D.parent;C=D.lastChild;do{z=C.prev;B.insert(C,D);C=z}while(C)}}})}if(u.validate&&v.getValidClasses()){t.addAttributeFilter("class",function(z){var D=z.length,C,A,H,F,B;var G=v.getValidClasses(),E,y;while(D--){C=z[D];A=C.attr("class").split(" ");B="";for(H=0;H<A.length;H++){F=A[H];y=false;E=G["*"];if(E&&E[F]){y=true}E=G[C.name];if(!y&&E&&E[F]){y=true}if(y){if(B){B+=" "}B+=F}}if(!B.length){B=null}C.attr("class",B)}})}}});h("tinymce/html/Writer",["tinymce/html/Entities","tinymce/util/Tools"],function(k,i){var j=i.makeMap;return function(p){var n=[],l,m,o,q,r;p=p||{};l=p.indent;m=j(p.indent_before||"");o=j(p.indent_after||"");q=k.getEncodeFunc(p.entity_encoding||"raw",p.entities);r=p.element_format=="html";return{start:function(v,u,y){var w,t,s,x;if(l&&m[v]&&n.length>0){x=n[n.length-1];if(x.length>0&&x!=="\n"){n.push("\n")}}n.push("<",v);if(u){for(w=0,t=u.length;w<t;w++){s=u[w];n.push(" ",s.name,'="',q(s.value,true),'"')}}if(!y||r){n[n.length]=">"}else{n[n.length]=" />"}if(y&&l&&o[v]&&n.length>0){x=n[n.length-1];if(x.length>0&&x!=="\n"){n.push("\n")}}},end:function(s){var t;n.push("</",s,">");if(l&&o[s]&&n.length>0){t=n[n.length-1];if(t.length>0&&t!=="\n"){n.push("\n")}}},text:function(t,s){if(t.length>0){n[n.length]=s?t:q(t)}},cdata:function(s){n.push("<![CDATA[",s,"]]>")},comment:function(s){n.push("<!--",s,"-->")},pi:function(s,t){if(t){n.push("<?",s," ",q(t),"?>")}else{n.push("<?",s,"?>")}if(l){n.push("\n")}},doctype:function(s){n.push("<!DOCTYPE",s,">",l?"\n":"")},reset:function(){n.length=0},getContent:function(){return n.join("").replace(/\n$/,"")}}}});h("tinymce/html/Serializer",["tinymce/html/Writer","tinymce/html/Schema"],function(j,i){return function(l,m){var k=this,n=new j(l);l=l||{};l.validate="validate" in l?l.validate:true;k.schema=m=m||new i();k.writer=n;k.serialize=function(q){var p,r;r=l.validate;p={3:function(s){n.text(s.value,s.raw)},8:function(s){n.comment(s.value)},7:function(s){n.pi(s.name,s.value)},10:function(s){n.doctype(s.value)},4:function(s){n.cdata(s.value)},11:function(s){if((s=s.firstChild)){do{o(s)}while((s=s.next))}}};n.reset();function o(t){var B=p[t.type],s,w,A,z,x,C,v,u,y;if(!B){s=t.name;w=t.shortEnded;A=t.attributes;if(r&&A&&A.length>1){C=[];C.map={};y=m.getElementRule(t.name);for(v=0,u=y.attributesOrder.length;v<u;v++){z=y.attributesOrder[v];if(z in A.map){x=A.map[z];C.map[z]=x;C.push({name:z,value:x})}}for(v=0,u=A.length;v<u;v++){z=A[v].name;if(!(z in C.map)){x=A.map[z];C.map[z]=x;C.push({name:z,value:x})}}A=C}n.start(t.name,A,w);if(!w){if((t=t.firstChild)){do{o(t)}while((t=t.next))}n.end(s)}}else{B(t)}}if(q.type==1&&!l.inner){o(q)}else{p[11](q)}return n.getContent()}}});h("tinymce/dom/Serializer",["tinymce/dom/DOMUtils","tinymce/html/DomParser","tinymce/html/Entities","tinymce/html/Serializer","tinymce/html/Node","tinymce/html/Schema","tinymce/Env","tinymce/util/Tools"],function(p,s,j,o,m,l,n,k){var q=k.each,i=k.trim;var r=p.DOM;return function(v,u){var x,w,t;if(u){x=u.dom;w=u.schema}x=x||r;w=w||new l(v);v.entity_encoding=v.entity_encoding||"named";v.remove_trailing_brs="remove_trailing_brs" in v?v.remove_trailing_brs:true;t=new s(v,w);t.addAttributeFilter("data-mce-tabindex",function(y,z){var A=y.length,B;while(A--){B=y[A];B.attr("tabindex",B.attributes.map["data-mce-tabindex"]);B.attr(z,null)}});t.addAttributeFilter("src,href,style",function(z,y){var D=z.length,A,F,C="data-mce-"+y;var E=v.url_converter,G=v.url_converter_scope,B;while(D--){A=z[D];F=A.attributes.map[C];if(F!==B){A.attr(y,F.length>0?F:null);A.attr(C,null)}else{F=A.attributes.map[y];if(y==="style"){F=x.serializeStyle(x.parseStyle(F),A.name)}else{if(E){F=E.call(G,F,y,A.name)}}A.attr(y,F.length>0?F:null)}}});t.addAttributeFilter("class",function(y){var z=y.length,A,B;while(z--){A=y[z];B=A.attr("class");if(B){B=A.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,"");A.attr("class",B.length>0?B:null)}}});t.addAttributeFilter("data-mce-type",function(y,A,z){var B=y.length,C;while(B--){C=y[B];if(C.attributes.map["data-mce-type"]==="bookmark"&&!z.cleanup){C.remove()}}});t.addNodeFilter("noscript",function(y){var z=y.length,A;while(z--){A=y[z].firstChild;if(A){A.value=j.decode(A.value)}}});t.addNodeFilter("script,style",function(z,A){var B=z.length,D,E,C;function y(F){return F.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,"")}while(B--){D=z[B];E=D.firstChild?D.firstChild.value:"";if(A==="script"){C=D.attr("type");if(C){D.attr("type",C=="mce-no/type"?null:C.replace(/^mce\-/,""))}if(E.length>0){D.firstChild.value="// <![CDATA[\n"+y(E)+"\n// ]]>"}}else{if(E.length>0){D.firstChild.value="<!--\n"+y(E)+"\n-->"}}}});t.addNodeFilter("#comment",function(y){var z=y.length,A;while(z--){A=y[z];if(A.value.indexOf("[CDATA[")===0){A.name="#cdata";A.type=4;A.value=A.value.replace(/^\[CDATA\[|\]\]$/g,"")}else{if(A.value.indexOf("mce:protected ")===0){A.name="#text";A.type=3;A.raw=true;A.value=unescape(A.value).substr(14)}}}});t.addNodeFilter("xml:namespace,input",function(y,z){var A=y.length,B;while(A--){B=y[A];if(B.type===7){B.remove()}else{if(B.type===1){if(z==="input"&&!("type" in B.attributes.map)){B.attr("type","text")}}}}});if(v.fix_list_elements){t.addNodeFilter("ul,ol",function(z){var A=z.length,B,y;while(A--){B=z[A];y=B.parent;if(y.name==="ul"||y.name==="ol"){if(B.prev&&B.prev.name==="li"){B.prev.append(B)}}}})}t.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize",function(y,z){var A=y.length;while(A--){y[A].attr(z,null)}});return{schema:w,addNodeFilter:t.addNodeFilter,addAttributeFilter:t.addAttributeFilter,serialize:function(E,C){var B=this,A,F,z,y,D;if(n.ie&&x.select("script,style,select,map").length>0){D=E.innerHTML;E=E.cloneNode(false);x.setHTML(E,D)}else{E=E.cloneNode(true)}A=E.ownerDocument.implementation;if(A.createHTMLDocument){F=A.createHTMLDocument("");q(E.nodeName=="BODY"?E.childNodes:[E],function(G){F.body.appendChild(F.importNode(G,true))});if(E.nodeName!="BODY"){E=F.body.firstChild}else{E=F.body}z=x.doc;x.doc=F}C=C||{};C.format=C.format||"html";if(C.selection){C.forced_root_block=""}if(!C.no_events){C.node=E;B.onPreProcess(C)}y=new o(v,w);C.content=y.serialize(t.parse(i(C.getInner?E.innerHTML:x.getOuterHTML(E)),C));if(!C.cleanup){C.content=C.content.replace(/\uFEFF/g,"")}if(!C.no_events){B.onPostProcess(C)}if(z){x.doc=z}C.node=null;return C.content},addRules:function(y){w.addValidElements(y)},setRules:function(y){w.setValidElements(y)},onPreProcess:function(y){if(u){u.fire("PreProcess",y)}},onPostProcess:function(y){if(u){u.fire("PostProcess",y)}}}}});h("tinymce/dom/TridentSelection",[],function(){function i(k){var j=this,o=k.dom,m=false;function l(p,q){var r,A=0,x,u,t,s,v,y,w=-1,z;r=p.duplicate();r.collapse(q);z=r.parentElement();if(z.ownerDocument!==k.dom.doc){return}while(z.contentEditable==="false"){z=z.parentNode}if(!z.hasChildNodes()){return{node:z,inside:1}}t=z.children;x=t.length-1;while(A<=x){y=Math.floor((A+x)/2);s=t[y];r.moveToElementText(s);w=r.compareEndPoints(q?"StartToStart":"EndToEnd",p);if(w>0){x=y-1}else{if(w<0){A=y+1}else{return{node:s}}}}if(w<0){if(!s){r.moveToElementText(z);r.collapse(true);s=z;u=true}else{r.collapse(false)}v=0;while(r.compareEndPoints(q?"StartToStart":"StartToEnd",p)!==0){if(r.move("character",1)===0||z!=r.parentElement()){break}v++}}else{r.collapse(true);v=0;while(r.compareEndPoints(q?"StartToStart":"StartToEnd",p)!==0){if(r.move("character",-1)===0||z!=r.parentElement()){break}v++}}return{node:s,position:w,offset:v,inside:u}}function n(){var p=k.getRng(),x=o.createRng(),r,q,v,w,s;r=p.item?p.item(0):p.parentElement();if(r.ownerDocument!=o.doc){return x}q=k.isCollapsed();if(p.item){x.setStart(r.parentNode,o.nodeIndex(r));x.setEnd(x.startContainer,x.startOffset+1);return x}function u(F){var A=l(p,F),y,D,E=0,C,B,z;y=A.node;D=A.offset;if(A.inside&&!y.hasChildNodes()){x[F?"setStart":"setEnd"](y,0);return}if(D===B){x[F?"setStartBefore":"setEndAfter"](y);return}if(A.position<0){C=A.inside?y.firstChild:y.nextSibling;if(!C){x[F?"setStartAfter":"setEndAfter"](y);return}if(!D){if(C.nodeType==3){x[F?"setStart":"setEnd"](C,0)}else{x[F?"setStartBefore":"setEndBefore"](C)}return}while(C){if(C.nodeType==3){z=C.nodeValue;E+=z.length;if(E>=D){y=C;E-=D;E=z.length-E;break}}C=C.nextSibling}}else{C=y.previousSibling;if(!C){return x[F?"setStartBefore":"setEndBefore"](y)}if(!D){if(y.nodeType==3){x[F?"setStart":"setEnd"](C,y.nodeValue.length)}else{x[F?"setStartAfter":"setEndAfter"](C)}return}while(C){if(C.nodeType==3){E+=C.nodeValue.length;if(E>=D){y=C;E-=D;break}}C=C.previousSibling}}x[F?"setStart":"setEnd"](y,E)}try{u(true);if(!q){u()}}catch(t){if(t.number==-2147024809){s=j.getBookmark(2);v=p.duplicate();v.collapse(true);r=v.parentElement();if(!q){v=p.duplicate();v.collapse(false);w=v.parentElement();w.innerHTML=w.innerHTML}r.innerHTML=r.innerHTML;j.moveToBookmark(s);p=k.getRng();u(true);if(!q){u()}}else{throw t}}return x}this.getBookmark=function(s){var p=k.getRng(),r={};function t(z){var y,u,x,w,v=[];y=z.parentNode;u=o.getRoot().parentNode;while(y!=u&&y.nodeType!==9){x=y.children;w=x.length;while(w--){if(z===x[w]){v.push(w);break}}z=y;y=y.parentNode}return v}function q(v){var u;u=l(p,v);if(u){return{position:u.position,offset:u.offset,indexes:t(u.node),inside:u.inside}}}if(s===2){if(!p.item){r.start=q(true);if(!k.isCollapsed()){r.end=q()}}else{r.start={ctrl:true,indexes:t(p.item(0))}}}return r};this.moveToBookmark=function(r){var q,p=o.doc.body;function t(v){var y,x,u,w;y=o.getRoot();for(x=v.length-1;x>=0;x--){w=y.children;u=v[x];if(u<=w.length-1){y=w[u]}}return y}function s(z){var u=r[z?"start":"end"],x,w,v,y;if(u){x=u.position>0;w=p.createTextRange();w.moveToElementText(t(u.indexes));y=u.offset;if(y!==v){w.collapse(u.inside||x);w.moveStart("character",x?-y:y)}else{w.collapse(z)}q.setEndPoint(z?"StartToStart":"EndToStart",w);if(z){q.collapse(true)}}}if(r.start){if(r.start.ctrl){q=p.createControlRange();q.addElement(t(r.start.indexes));q.select()}else{q=p.createTextRange();s(true);s();q.select()}}};this.addRange=function(p){var u,s,r,w,C,x,A,z=k.dom.doc,t=z.body,y,B;function q(I){var E,H,D,G,F;D=o.create("a");E=I?r:C;H=I?w:x;G=u.duplicate();if(E==z||E==z.documentElement){E=t;H=0}if(E.nodeType==3){E.parentNode.insertBefore(D,E);G.moveToElementText(D);G.moveStart("character",H);o.remove(D);u.setEndPoint(I?"StartToStart":"EndToEnd",G)}else{F=E.childNodes;if(F.length){if(H>=F.length){o.insertAfter(D,F[F.length-1])}else{E.insertBefore(D,F[H])}G.moveToElementText(D)}else{if(E.canHaveHTML){E.innerHTML="<span>&#xFEFF;</span>";D=E.firstChild;G.moveToElementText(D);G.collapse(m)}}u.setEndPoint(I?"StartToStart":"EndToEnd",G);o.remove(D)}}r=p.startContainer;w=p.startOffset;C=p.endContainer;x=p.endOffset;u=t.createTextRange();if(r==C&&r.nodeType==1){if(w==x&&!r.hasChildNodes()){if(r.canHaveHTML){A=r.previousSibling;if(A&&!A.hasChildNodes()&&o.isBlock(A)){A.innerHTML="&#xFEFF;"}else{A=null}r.innerHTML="<span>&#xFEFF;</span><span>&#xFEFF;</span>";u.moveToElementText(r.lastChild);u.select();o.doc.selection.clear();r.innerHTML="";if(A){A.innerHTML=""}return}else{w=o.nodeIndex(r);r=r.parentNode}}if(w==x-1){try{B=r.childNodes[w];s=t.createControlRange();s.addElement(B);s.select();y=k.getRng();if(y.item&&B===y.item(0)){return}}catch(v){}}}q(true);q();u.select()};this.getRangeAt=n}return i});h("tinymce/util/VK",["tinymce/Env"],function(i){return{BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(j){return j.shiftKey||j.ctrlKey||j.altKey||this.metaKeyPressed(j)},metaKeyPressed:function(j){return(i.mac?j.metaKey:j.ctrlKey&&!j.altKey)}}});h("tinymce/dom/ControlSelection",["tinymce/util/VK","tinymce/util/Tools","tinymce/Env"],function(k,j,i){return function(y,m){var n=m.dom,T=j.each;var v,ac,O,Q,aa,Y;var D,B,M,L,E,J,R,r;var l,o,w=m.getDoc(),Z=document,u=i.ie&&i.ie<11;var I=Math.abs,X=Math.round,A=m.getBody(),F,p;Q={n:[0.5,0,0,-1],e:[1,0.5,1,0],s:[0.5,1,0,1],w:[0,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 C=".mce-content-body";m.contentStyles.push(C+" div.mce-resizehandle {position: absolute;border: 1px solid black;background: #FFF;width: 5px;height: 5px;z-index: 10000}"+C+" .mce-resizehandle:hover {background: #000}"+C+" img[data-mce-selected], hr[data-mce-selected] {outline: 1px solid black;resize: none}"+C+" .mce-clonedresizable {position: absolute;"+(i.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"+C+" .mce-resize-helper {background: #555;background: rgba(0,0,0,0.75);border-radius: 3px;border: 1px;color: white;display: none;font-family: sans-serif;font-size: 12px;white-space: nowrap;line-height: 14px;margin: 5px 10px;padding: 5px;position: absolute;z-index: 10001}");function U(ae){var ad=m.settings.object_resizing;if(ad===false||i.iOS){return false}if(typeof ad!="string"){ad="table,img,div"}if(ae.getAttribute("data-mce-resize")==="false"){return false}return m.dom.is(ae,ad)}function q(ag){var ae,ad,af;var ai,ah;ae=ag.screenX-D;ad=ag.screenY-B;l=ae*aa[2]+E;o=ad*aa[3]+J;l=l<5?5:l;o=o<5?5:o;if(v.nodeName=="IMG"&&m.settings.resize_img_proportional!==false){af=!k.modifierPressed(ag)}else{af=k.modifierPressed(ag)||(v.nodeName=="IMG"&&aa[2]*aa[3]!==0)}if(af){if(I(ae)>I(ad)){o=X(l*R);l=X(o/R)}else{l=X(o/R);o=X(l*R)}}n.setStyles(ac,{width:l,height:o});ai=aa.startPos.x+ae;ah=aa.startPos.y+ad;ai=ai>0?ai:0;ah=ah>0?ah:0;n.setStyles(O,{left:ai,top:ah,display:"block"});O.innerHTML=l+" &times; "+o;if(aa[2]<0&&ac.clientWidth<=l){n.setStyle(ac,"left",M+(E-l))}if(aa[3]<0&&ac.clientHeight<=o){n.setStyle(ac,"top",L+(J-o))}ae=A.scrollWidth-F;ad=A.scrollHeight-p;if(ae+ad!==0){n.setStyles(O,{left:ai-ae,top:ah-ad})}if(!r){m.fire("ObjectResizeStart",{target:v,width:E,height:J});r=true}}function P(){r=false;function ad(ae,af){if(af){if(v.style[ae]||!m.schema.isValid(v.nodeName.toLowerCase(),ae)){n.setStyle(v,ae,af)}else{n.setAttrib(v,ae,af)}}}ad("width",l);ad("height",o);n.unbind(w,"mousemove",q);n.unbind(w,"mouseup",P);if(Z!=w){n.unbind(Z,"mousemove",q);n.unbind(Z,"mouseup",P)}n.remove(ac);n.remove(O);if(!u||v.nodeName=="TABLE"){K(v)}m.fire("ObjectResized",{target:v,width:l,height:o});n.setAttrib(v,"style",n.getAttrib(v,"style"));m.nodeChanged()}function K(aj,ah,af){var ae,ag,ad,ak,ai;ab();ae=n.getPos(aj,A);M=ae.x;L=ae.y;ai=aj.getBoundingClientRect();ag=ai.width||(ai.right-ai.left);ad=ai.height||(ai.bottom-ai.top);if(v!=aj){V();v=aj;l=o=0}ak=m.fire("ObjectSelected",{target:aj});if(U(aj)&&!ak.isDefaultPrevented()){T(Q,function(ao,am){var an,ap;function al(aq){D=aq.screenX;B=aq.screenY;E=v.clientWidth;J=v.clientHeight;R=J/E;aa=ao;ao.startPos={x:ag*ao[0]+M,y:ad*ao[1]+L};F=A.scrollWidth;p=A.scrollHeight;ac=v.cloneNode(true);n.addClass(ac,"mce-clonedresizable");n.setAttrib(ac,"data-mce-bogus","all");ac.contentEditable=false;ac.unSelectabe=true;n.setStyles(ac,{left:M,top:L,margin:0});ac.removeAttribute("data-mce-selected");A.appendChild(ac);n.bind(w,"mousemove",q);n.bind(w,"mouseup",P);if(Z!=w){n.bind(Z,"mousemove",q);n.bind(Z,"mouseup",P)}O=n.add(A,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},E+" &times; "+J)}if(ah){if(am==ah){al(af)}return}an=n.get("mceResizeHandle"+am);if(!an){ap=A;an=n.add(ap,"div",{id:"mceResizeHandle"+am,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:true,style:"cursor:"+am+"-resize; margin:0; padding:0"});if(i.ie){an.contentEditable=false}}else{n.show(an)}if(!ao.elm){n.bind(an,"mousedown",function(aq){aq.stopImmediatePropagation();aq.preventDefault();al(aq)});ao.elm=an}n.setStyles(an,{left:(ag*ao[0]+M)-(an.offsetWidth/2),top:(ad*ao[1]+L)-(an.offsetHeight/2)})})}else{G()}v.setAttribute("data-mce-selected","1")}function G(){var ad,ae;ab();if(v){v.removeAttribute("data-mce-selected")}for(ad in Q){ae=n.get("mceResizeHandle"+ad);if(ae){n.unbind(ae);n.remove(ae)}}}function H(ag){var af,ad;function ae(ai,ah){if(ai){do{if(ai===ah){return true}}while((ai=ai.parentNode))}}if(r){return}T(n.select("img[data-mce-selected],hr[data-mce-selected]"),function(ah){ah.removeAttribute("data-mce-selected")});ad=ag.type=="mousedown"?ag.target:y.getNode();ad=n.$(ad).closest(u?"table":"table,img,hr")[0];if(ae(ad,A)){N();af=y.getStart(true);if(ae(af,ad)&&ae(y.getEnd(true),ad)){if(!u||(ad!=af&&af.nodeName!=="IMG")){K(ad);return}}}G()}function s(af,ad,ae){if(af&&af.attachEvent){af.attachEvent("on"+ad,ae)}}function z(af,ad,ae){if(af&&af.detachEvent){af.detachEvent("on"+ad,ae)}}function x(af){var ag=af.srcElement,ak,ad,al,aj,ah,ai,ae;ak=ag.getBoundingClientRect();ai=Y.clientX-ak.left;ae=Y.clientY-ak.top;for(ad in Q){al=Q[ad];aj=ag.offsetWidth*al[0];ah=ag.offsetHeight*al[1];if(I(aj-ai)<8&&I(ah-ae)<8){aa=al;break}}r=true;m.fire("ObjectResizeStart",{target:v,width:v.clientWidth,height:v.clientHeight});m.getDoc().selection.empty();K(ag,ad,Y)}function W(ae){var ad=ae.srcElement;if(ad!=v){m.fire("ObjectSelected",{target:ad});V();if(ad.id.indexOf("mceResizeHandle")===0){ae.returnValue=false;return}if(ad.nodeName=="IMG"||ad.nodeName=="TABLE"){G();v=ad;s(ad,"resizestart",x)}}}function V(){z(v,"resizestart",x)}function ab(){for(var ad in Q){var ae=Q[ad];if(ae.elm){n.unbind(ae.elm);delete ae.elm}}}function N(){try{m.getDoc().execCommand("enableObjectResizing",false,false)}catch(ad){}}function t(af){var ae;if(!u){return}ae=w.body.createControlRange();try{ae.addElement(af);ae.select();return true}catch(ad){}}m.on("init",function(){if(u){m.on("ObjectResized",function(ad){if(ad.target.nodeName!="TABLE"){G();t(ad.target)}});s(A,"controlselect",W);m.on("mousedown",function(ad){Y=ad})}else{N();if(i.ie>=11){m.on("mouseup",function(ad){var ae=ad.target.nodeName;if(!r&&/^(TABLE|IMG|HR)$/.test(ae)){m.selection.select(ad.target,ae=="TABLE");m.nodeChanged()}});m.dom.bind(A,"mscontrolselect",function(ad){if(/^(TABLE|IMG|HR)$/.test(ad.target.nodeName)){ad.preventDefault();if(ad.target.tagName=="IMG"){window.setTimeout(function(){m.selection.select(ad.target)},0)}}})}}m.on("nodechange ResizeEditor",H);m.on("keydown keyup",function(ad){if(v&&v.nodeName=="TABLE"){H(ad)}});m.on("hide",G)});m.on("remove",ab);function S(){v=ac=null;if(u){V();z(A,"controlselect",W)}}return{isResizable:U,showResizeRect:K,hideResizeRect:G,updateResizeRect:H,controlSelect:t,destroy:S}}});h("tinymce/dom/BookmarkManager",["tinymce/Env","tinymce/util/Tools"],function(i,k){function j(l){var m=l.dom;this.getBookmark=function(x,z){var o,r,q,u,p,v,t="&#xFEFF;",A;function n(C,D){var B=0;k.each(m.select(C),function(F,E){if(F==D){B=E}});return B}function y(B){function C(H){var D,G,F,E=H?"start":"end";D=B[E+"Container"];G=B[E+"Offset"];if(D.nodeType==1&&D.nodeName=="TR"){F=D.childNodes;D=F[Math.min(H?G:G-1,F.length-1)];if(D){G=H?0:D.childNodes.length;B["set"+(H?"Start":"End")](D,G)}}}C(true);C();return B}function s(){var C=l.getRng(true),B=m.getRoot(),D={};function E(H,M){var G=H[M?"startContainer":"endContainer"],L=H[M?"startOffset":"endOffset"],F=[],I,K,J=0;if(G.nodeType==3){if(z){for(I=G.previousSibling;I&&I.nodeType==3;I=I.previousSibling){L+=I.nodeValue.length}}F.push(L)}else{K=G.childNodes;if(L>=K.length&&K.length){J=1;L=Math.max(0,K.length-1)}F.push(m.nodeIndex(K[L],z)+J)}for(;G&&G!=B;G=G.parentNode){F.push(m.nodeIndex(G,z))}return F}D.start=E(C,true);if(!l.isCollapsed()){D.end=E(C)}return D}if(x==2){v=l.getNode();p=v?v.nodeName:null;if(p=="IMG"){return{name:p,index:n(p,v)}}if(l.tridentSel){return l.tridentSel.getBookmark(x)}return s()}if(x){return{rng:l.getRng()}}o=l.getRng();q=m.uniqueId();u=l.isCollapsed();A="overflow:hidden;line-height:0px";if(o.duplicate||o.item){if(!o.item){r=o.duplicate();try{o.collapse();o.pasteHTML('<span data-mce-type="bookmark" id="'+q+'_start" style="'+A+'">'+t+"</span>");if(!u){r.collapse(false);o.moveToElementText(r.parentElement());if(o.compareEndPoints("StartToEnd",r)===0){r.move("character",-1)}r.pasteHTML('<span data-mce-type="bookmark" id="'+q+'_end" style="'+A+'">'+t+"</span>")}}catch(w){return null}}else{v=o.item(0);p=v.nodeName;return{name:p,index:n(p,v)}}}else{v=l.getNode();p=v.nodeName;if(p=="IMG"){return{name:p,index:n(p,v)}}r=y(o.cloneRange());if(!u){r.collapse(false);r.insertNode(m.create("span",{"data-mce-type":"bookmark",id:q+"_end",style:A},t))}o=y(o);o.collapse(true);o.insertNode(m.create("span",{"data-mce-type":"bookmark",id:q+"_start",style:A},t))}l.moveToBookmark({id:q,keep:1});return{id:q}};this.moveToBookmark=function(s){var n,v,p,w,t,u;function o(C){var x=s[C?"start":"end"],z,A,B,y;if(x){B=x[0];for(A=v,z=x.length-1;z>=1;z--){y=A.childNodes;if(x[z]>y.length-1){return}A=y[x[z]]}if(A.nodeType===3){B=Math.min(x[0],A.nodeValue.length)}if(A.nodeType===1){B=Math.min(x[0],A.childNodes.length)}if(C){n.setStart(A,B)}else{n.setEnd(A,B)}}return true}function q(D){var y=m.get(s.id+"_"+D),C,x,A,B,z=s.keep;if(y){C=y.parentNode;if(D=="start"){if(!z){x=m.nodeIndex(y)}else{C=y.firstChild;x=1}p=w=C;t=u=x}else{if(!z){x=m.nodeIndex(y)}else{C=y.firstChild;x=1}w=C;u=x}if(!z){B=y.previousSibling;A=y.nextSibling;k.each(k.grep(y.childNodes),function(E){if(E.nodeType==3){E.nodeValue=E.nodeValue.replace(/\uFEFF/g,"")}});while((y=m.get(s.id+"_"+D))){m.remove(y,1)}if(B&&A&&B.nodeType==A.nodeType&&B.nodeType==3&&!i.opera){x=B.nodeValue.length;B.appendData(A.nodeValue);m.remove(A);if(D=="start"){p=w=B;t=u=x}else{w=B;u=x}}}}}function r(x){if(m.isBlock(x)&&!x.innerHTML&&!i.ie){x.innerHTML='<br data-mce-bogus="1" />'}return x}if(s){if(s.start){n=m.createRng();v=m.getRoot();if(l.tridentSel){return l.tridentSel.moveToBookmark(s)}if(o(true)&&o()){l.setRng(n)}}else{if(s.id){q("start");q("end");if(p){n=m.createRng();n.setStart(r(p),t);n.setEnd(r(w),u);l.setRng(n)}}else{if(s.name){l.select(m.select(s.name)[s.index])}else{if(s.rng){l.setRng(s.rng)}}}}}}}j.isBookmarkNode=function(l){return l&&l.tagName==="SPAN"&&l.getAttribute("data-mce-type")==="bookmark"};return j});h("tinymce/dom/Selection",["tinymce/dom/TreeWalker","tinymce/dom/TridentSelection","tinymce/dom/ControlSelection","tinymce/dom/RangeUtils","tinymce/dom/BookmarkManager","tinymce/Env","tinymce/util/Tools"],function(q,o,i,m,r,n,l){var p=l.each,k=l.trim;var j=n.ie;function s(x,w,v,u){var t=this;t.dom=x;t.win=w;t.serializer=v;t.editor=u;t.bookmarkManager=new r(t);t.controlSelection=new i(t,u);if(!t.win.getSelection){t.tridentSel=new o(t)}}s.prototype={setCursorLocation:function(v,w){var u=this,t=u.dom.createRng();if(!v){u._moveEndPoint(t,u.editor.getBody(),true);u.setRng(t)}else{t.setStart(v,w);t.setEnd(v,w);u.setRng(t);u.collapse(false)}},getContent:function(x){var v=this,u=v.getRng(),t=v.dom.create("body");var A=v.getSel(),z,y,w;x=x||{};z=y="";x.get=true;x.format=x.format||"html";x.selection=true;v.editor.fire("BeforeGetContent",x);if(x.format=="text"){return v.isCollapsed()?"":(u.text||(A.toString?A.toString():""))}if(u.cloneContents){w=u.cloneContents();if(w){t.appendChild(w)}}else{if(u.item!==g||u.htmlText!==g){t.innerHTML="<br>"+(u.item?u.item(0).outerHTML:u.htmlText);t.removeChild(t.firstChild)}else{t.innerHTML=u.toString()}}if(/^\s/.test(t.innerHTML)){z=" "}if(/\s+$/.test(t.innerHTML)){y=" "}x.getInner=true;x.content=v.isCollapsed()?"":z+v.serializer.serialize(t,x)+y;v.editor.fire("GetContent",x);return x.content},setContent:function(u,w){var B=this,t=B.getRng(),x,y=B.win.document,A,z;w=w||{format:"html"};w.set=true;w.selection=true;u=w.content=u;if(!w.no_events){B.editor.fire("BeforeSetContent",w)}u=w.content;if(t.insertNode){u+='<span id="__caret">_</span>';if(t.startContainer==y&&t.endContainer==y){y.body.innerHTML=u}else{t.deleteContents();if(y.body.childNodes.length===0){y.body.innerHTML=u}else{if(t.createContextualFragment){t.insertNode(t.createContextualFragment(u))}else{A=y.createDocumentFragment();z=y.createElement("div");A.appendChild(z);z.outerHTML=u;t.insertNode(A)}}}x=B.dom.get("__caret");t=y.createRange();t.setStartBefore(x);t.setEndBefore(x);B.setRng(t);B.dom.remove("__caret");try{B.setRng(t)}catch(v){}}else{if(t.item){y.execCommand("Delete",false,null);t=B.getRng()}if(/^\s+/.test(u)){t.pasteHTML('<span id="__mce_tmp">_</span>'+u);B.dom.remove("__mce_tmp")}else{t.pasteHTML(u)}}if(!w.no_events){B.editor.fire("SetContent",w)}},getStart:function(z){var v=this,u=v.getRng(),w,t,y,x;if(u.duplicate||u.item){if(u.item){return u.item(0)}y=u.duplicate();y.collapse(1);w=y.parentElement();if(w.ownerDocument!==v.dom.doc){w=v.dom.getRoot()}t=x=u.parentElement();while((x=x.parentNode)){if(x==w){w=t;break}}return w}else{w=u.startContainer;if(w.nodeType==1&&w.hasChildNodes()){if(!z||!u.collapsed){w=w.childNodes[Math.min(w.childNodes.length-1,u.startOffset)]}}if(w&&w.nodeType==3){return w.parentNode}return w}},getEnd:function(x){var u=this,t=u.getRng(),w,v;if(t.duplicate||t.item){if(t.item){return t.item(0)}t=t.duplicate();t.collapse(0);w=t.parentElement();if(w.ownerDocument!==u.dom.doc){w=u.dom.getRoot()}if(w&&w.nodeName=="BODY"){return w.lastChild||w}return w}else{w=t.endContainer;v=t.endOffset;if(w.nodeType==1&&w.hasChildNodes()){if(!x||!t.collapsed){w=w.childNodes[v>0?v-1:v]}}if(w&&w.nodeType==3){return w.parentNode}return w}},getBookmark:function(t,u){return this.bookmarkManager.getBookmark(t,u)},moveToBookmark:function(t){return this.bookmarkManager.moveToBookmark(t)},select:function(x,w){var v=this,y=v.dom,u=y.createRng(),t;v.lastFocusBookmark=null;if(x){if(!w&&v.controlSelection.controlSelect(x)){return}t=y.nodeIndex(x);u.setStart(x.parentNode,t);u.setEnd(x.parentNode,t+1);if(w){v._moveEndPoint(u,x,true);v._moveEndPoint(u,x)}v.setRng(u)}return x},isCollapsed:function(){var u=this,t=u.getRng(),v=u.getSel();if(!t||t.item){return false}if(t.compareEndPoints){return t.compareEndPoints("StartToEnd",t)===0}return !v||t.collapsed},collapse:function(v){var u=this,t=u.getRng(),w;if(t.item){w=t.item(0);t=u.win.document.body.createTextRange();t.moveToElementText(w)}t.collapse(!!v);u.setRng(t)},getSel:function(){var t=this.win;return t.getSelection?t.getSelection():t.document.selection},getRng:function(z){var C=this,B,t,x,A=C.win.document,v;function y(F,G,D){try{return G.compareBoundaryPoints(F,D)}catch(E){return -1}}if(!z&&C.lastFocusBookmark){var u=C.lastFocusBookmark;if(u.startContainer){t=A.createRange();t.setStart(u.startContainer,u.startOffset);t.setEnd(u.endContainer,u.endOffset)}else{t=u}return t}if(z&&C.tridentSel){return C.tridentSel.getRangeAt(0)}try{if((B=C.getSel())){if(B.rangeCount>0){t=B.getRangeAt(0)}else{t=B.createRange?B.createRange():A.createRange()}}}catch(w){}if(j&&t&&t.setStart&&A.selection){try{v=A.selection.createRange()}catch(w){}if(v&&v.item){x=v.item(0);t=A.createRange();t.setStartBefore(x);t.setEndAfter(x)}}if(!t){t=A.createRange?A.createRange():A.body.createTextRange()}if(t.setStart&&t.startContainer.nodeType===9&&t.collapsed){x=C.dom.getRoot();t.setStart(x,0);t.setEnd(x,0)}if(C.selectedRange&&C.explicitRange){if(y(t.START_TO_START,t,C.selectedRange)===0&&y(t.END_TO_END,t,C.selectedRange)===0){t=C.explicitRange}else{C.selectedRange=null;C.explicitRange=null}}return t},setRng:function(t,v){var u=this,x;if(!t){return}if(t.select){try{t.select()}catch(w){}return}if(!u.tridentSel){x=u.getSel();if(x){u.explicitRange=t;try{x.removeAllRanges();x.addRange(t)}catch(w){}if(v===false&&x.extend){x.collapse(t.endContainer,t.endOffset);x.extend(t.startContainer,t.startOffset)}u.selectedRange=x.rangeCount>0?x.getRangeAt(0):null}}else{if(t.cloneRange){try{u.tridentSel.addRange(t);return}catch(w){}}}},setNode:function(u){var t=this;t.setContent(t.dom.getOuterHTML(u));return u},getNode:function(){var A=this,t=A.getRng(),w;var u=t.startContainer,B=t.endContainer;var x=t.startOffset,y=t.endOffset,z=A.dom.getRoot();function v(D,C){var E=D;while(D&&D.nodeType===3&&D.length===0){D=C?D.nextSibling:D.previousSibling}return D||E}if(!t){return z}if(t.setStart){w=t.commonAncestorContainer;if(!t.collapsed){if(u==B){if(y-x<2){if(u.hasChildNodes()){w=u.childNodes[x]}}}if(u.nodeType===3&&B.nodeType===3){if(u.length===x){u=v(u.nextSibling,true)}else{u=u.parentNode}if(y===0){B=v(B.previousSibling,false)}else{B=B.parentNode}if(u&&u===B){return u}}}if(w&&w.nodeType==3){return w.parentNode}return w}w=t.item?t.item(0):t.parentElement();if(w.ownerDocument!==A.win.document){w=z}return w},getSelectedBlocks:function(w,v){var u=this,A=u.dom,x,t,z=[];t=A.getRoot();w=A.getParent(w||u.getStart(),A.isBlock);v=A.getParent(v||u.getEnd(),A.isBlock);if(w&&w!=t){z.push(w)}if(w&&v&&w!=v){x=w;var y=new q(w,t);while((x=y.next())&&x!=v){if(A.isBlock(x)){z.push(x)}}}if(v&&w!=v&&v!=t){z.push(v)}return z},isForward:function(){var v=this.dom,t=this.getSel(),w,u;if(!t||!t.anchorNode||!t.focusNode){return true}w=v.createRng();w.setStart(t.anchorNode,t.anchorOffset);w.collapse(true);u=v.createRng();u.setStart(t.focusNode,t.focusOffset);u.collapse(true);return w.compareBoundaryPoints(w.START_TO_START,u)<=0},normalize:function(){var u=this,t=u.getRng();if(n.range&&new m(u.dom).normalize(t)){u.setRng(t,u.isForward())}return t},selectorChanged:function(t,w){var u=this,v;if(!u.selectorChangedData){u.selectorChangedData={};v={};u.editor.on("NodeChange",function(A){var z=A.element,B=u.dom,x=B.getParents(z,null,B.getRoot()),y={};p(u.selectorChangedData,function(D,C){p(x,function(E){if(B.is(E,C)){if(!v[C]){p(D,function(F){F(true,{node:E,selector:C,parents:x})});v[C]=D}y[C]=D;return false}})});p(v,function(D,C){if(!y[C]){delete v[C];p(D,function(E){E(false,{node:z,selector:C,parents:x})})}})})}if(!u.selectorChangedData[t]){u.selectorChangedData[t]=[]}u.selectorChangedData[t].push(w);return u},getScrollContainer:function(){var t,u=this.dom.getRoot();while(u&&u.nodeName!="BODY"){if(u.scrollHeight>u.clientHeight){t=u;break}u=u.parentNode}return t},scrollIntoView:function(w){var z,C,D=this,v=D.dom,A=v.getRoot(),t,B;function u(H){var E=0,G=0;var F=H;while(F&&F.nodeType){E+=F.offsetLeft||0;G+=F.offsetTop||0;F=F.offsetParent}return{x:E,y:G}}if(A.nodeName!="BODY"){var x=D.getScrollContainer();if(x){z=u(w).y-u(x).y;B=x.clientHeight;t=x.scrollTop;if(z<t||z+25>t+B){x.scrollTop=z<t?z:z-B+25}return}}C=v.getViewPort(D.editor.getWin());z=v.getPos(w).y;t=C.y;B=C.h;if(z<C.y||z+25>t+B){D.editor.getWin().scrollTo(0,z<t?z:z-B+25)}},placeCaretAt:function(x,w){var y=this.editor.getDoc(),u,t;if(y.caretPositionFromPoint){t=y.caretPositionFromPoint(x,w);u=y.createRange();u.setStart(t.offsetNode,t.offset);u.collapse(true)}else{if(y.caretRangeFromPoint){u=y.caretRangeFromPoint(x,w)}else{if(y.body.createTextRange){u=y.body.createTextRange();try{u.moveToPoint(x,w);u.collapse(true)}catch(v){u.collapse(w<y.body.clientHeight)}}}}this.setRng(u)},_moveEndPoint:function(u,w,y){var t=w,x=new q(w,t);var v=this.dom.schema.getNonEmptyElements();do{if(w.nodeType==3&&k(w.nodeValue).length!==0){if(y){u.setStart(w,0)}else{u.setEnd(w,w.nodeValue.length)}return}if(v[w.nodeName]&&!/^(TD|TH)$/.test(w.nodeName)){if(y){u.setStartBefore(w)}else{if(w.nodeName=="BR"){u.setEndBefore(w)}else{u.setEndAfter(w)}}return}if(n.ie&&n.ie<11&&this.dom.isBlock(w)&&this.dom.isEmpty(w)){if(y){u.setStart(w,0)}else{u.setEnd(w,0)}return}}while((w=(y?x.next():x.prev())));if(t.nodeName=="BODY"){if(y){u.setStart(t,0)}else{u.setEnd(t,t.childNodes.length)}}},destroy:function(){this.win=null;this.controlSelection.destroy()}};return s});h("tinymce/dom/ElementUtils",["tinymce/dom/BookmarkManager","tinymce/util/Tools"],function(i,k){var l=k.each;function j(m){this.compare=function(p,o){if(p.nodeName!=o.nodeName){return false}function n(r){var s={};l(m.getAttribs(r),function(t){var u=t.nodeName.toLowerCase();if(u.indexOf("_")!==0&&u!=="style"&&u!=="data-mce-style"){s[u]=m.getAttrib(r,u)}});return s}function q(u,t){var s,r;for(r in u){if(u.hasOwnProperty(r)){s=t[r];if(typeof s=="undefined"){return false}if(u[r]!=s){return false}delete t[r]}}for(r in t){if(t.hasOwnProperty(r)){return false}}return true}if(!q(n(p),n(o))){return false}if(!q(m.parseStyle(m.getAttrib(p,"style")),m.parseStyle(m.getAttrib(o,"style")))){return false}return !i.isBookmarkNode(p)&&!i.isBookmarkNode(o)}}return j});h("tinymce/fmt/Preview",["tinymce/util/Tools"],function(i){var k=i.each;function j(q,t){var m,n,p=q.dom;var l="",o,s;s=q.settings.preview_styles;if(s===false){return""}if(!s){s="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"}function r(u){return u.replace(/%(\w+)/g,"")}if(typeof t=="string"){t=q.formatter.get(t);if(!t){return}t=t[0]}m=t.block||t.inline||"span";n=p.create(m);k(t.styles,function(v,u){v=r(v);if(v){p.setStyle(n,u,v)}});k(t.attributes,function(v,u){v=r(v);if(v){p.setAttrib(n,u,v)}});k(t.classes,function(u){u=r(u);if(!p.hasClass(n,u)){p.addClass(n,u)}});q.fire("PreviewFormats");p.setStyles(n,{position:"absolute",left:-65535});q.getBody().appendChild(n);o=p.getStyle(q.getBody(),"fontSize",true);o=/px$/.test(o)?parseInt(o,10):0;k(s.split(" "),function(u){var v=p.getStyle(n,u,true);if(u=="background-color"&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(v)){v=p.getStyle(q.getBody(),u,true);if(p.toHex(v).toLowerCase()=="#ffffff"){return}}if(u=="color"){if(p.toHex(v).toLowerCase()=="#000000"){return}}if(u=="font-size"){if(/em|%$/.test(v)){if(o===0){return}v=parseFloat(v,10)/(/%$/.test(v)?100:1);v=(v*o)+"px"}}if(u=="border"&&v){l+="padding:0 2px;"}l+=u+":"+v+";"});q.fire("AfterPreviewFormats");p.remove(n);return l}return{getCssText:j}});h("tinymce/Formatter",["tinymce/dom/TreeWalker","tinymce/dom/RangeUtils","tinymce/dom/BookmarkManager","tinymce/dom/ElementUtils","tinymce/util/Tools","tinymce/fmt/Preview"],function(l,m,i,k,j,n){return function(av){var ah={},p=av.dom,I=av.selection,ae=new m(p),r=av.schema.isValidChild,Y=p.isBlock,B=av.settings.forced_root_block,K=p.nodeIndex,W="\uFEFF",s=/^(src|href|style)$/,ap=false,S=true,ag,T,N=p.getContentEditable,X,z,ab=i.isBookmarkNode;var ak=j.each,at=j.grep,F=j.walk,G=j.extend;function Z(aw){if(aw.nodeType){aw=aw.nodeName}return !!av.schema.getTextBlockElements()[aw.toLowerCase()]}function am(aw){return/^(TH|TD)$/.test(aw.nodeName)}function C(ax,aw){return p.getParents(ax,aw,p.getRoot())}function o(aw){return aw.nodeType===1&&aw.id==="_mce_caret"}function x(){A({valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],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:false,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:false,styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",collapsed:false,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:false,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:true},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:true},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},links:true,remove_similar:true},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:true,remove_similar:true},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:true,deep:true,onmatch:function(){return true},onformat:function(ay,aw,ax){ak(ax,function(aA,az){p.setAttrib(ay,az,aA)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",remove:"all",split:true,expand:false,block_expand:true,deep:true},{selector:"span",attributes:["style","class"],remove:"empty",split:true,expand:false,deep:true},{selector:"*",attributes:["style","class"],split:false,expand:false,deep:true}]});ak("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),function(aw){A(aw,{block:aw,remove:"all"})});A(av.settings.formats)}function ao(){av.addShortcut("meta+b","bold_desc","Bold");av.addShortcut("meta+i","italic_desc","Italic");av.addShortcut("meta+u","underline_desc","Underline");for(var aw=1;aw<=6;aw++){av.addShortcut("access+"+aw,"",["FormatBlock",false,"h"+aw])}av.addShortcut("access+7","",["FormatBlock",false,"p"]);av.addShortcut("access+8","",["FormatBlock",false,"div"]);av.addShortcut("access+9","",["FormatBlock",false,"address"])}function an(aw){return aw?ah[aw]:ah}function A(aw,ax){if(aw){if(typeof aw!=="string"){ak(aw,function(az,ay){A(ay,az)})}else{ax=ax.length?ax:[ax];ak(ax,function(ay){if(ay.deep===T){ay.deep=!ay.selector}if(ay.split===T){ay.split=!ay.selector||ay.inline}if(ay.remove===T&&ay.selector&&!ay.inline){ay.remove="none"}if(ay.selector&&ay.inline){ay.mixed=true;ay.block_expand=true}if(typeof ay.classes==="string"){ay.classes=ay.classes.split(/\s+/)}});ah[aw]=ax}}}function O(aw){if(aw&&ah[aw]){delete ah[aw]}return ah}function w(ax){var aw;av.dom.getParent(ax,function(ay){aw=av.dom.getStyle(ay,"text-decoration");return aw&&aw!=="none"});return aw}function ac(aw){var ax;if(aw.nodeType===1&&aw.parentNode&&aw.parentNode.nodeType===1){ax=w(aw.parentNode);if(av.dom.getStyle(aw,"color")&&ax){av.dom.setStyle(aw,"text-decoration",ax)}else{if(av.dom.getStyle(aw,"text-decoration")===ax){av.dom.setStyle(aw,"text-decoration",null)}}}}function ar(ay,aE,aA){var aB=an(ay),aF=aB[0],aD,ax,aC=!aA&&I.isCollapsed();function aw(aK,aI){aI=aI||aF;if(aK){if(aI.onformat){aI.onformat(aK,aI,aE,aA)}ak(aI.styles,function(aM,aL){p.setStyle(aK,aL,H(aM,aE))});if(aI.styles){var aJ=p.getAttrib(aK,"style");if(aJ){aK.setAttribute("data-mce-style",aJ)}}ak(aI.attributes,function(aM,aL){p.setAttrib(aK,aL,H(aM,aE))});ak(aI.classes,function(aL){aL=H(aL,aE);if(!p.hasClass(aK,aL)){p.addClass(aK,aL)}})}}function az(){function aK(aQ,aO){var aP=new l(aO);for(aA=aP.current();aA;aA=aP.prev()){if(aA.childNodes.length>1||aA==aQ||aA.tagName=="BR"){return aA}}}var aJ=av.selection.getRng();var aN=aJ.startContainer;var aI=aJ.endContainer;if(aN!=aI&&aJ.endOffset===0){var aM=aK(aN,aI);var aL=aM.nodeType==3?aM.length:aM.childNodes.length;aJ.setEnd(aM,aL)}return aJ}function aG(aJ,aL,aO){var aI=[],aN,aK,aM=true;aN=aF.inline||aF.block;aK=p.create(aN);aw(aK);ae.walk(aJ,function(aP){var aQ;function aR(aS){var aX,aV,aT,aU,aW;aW=aM;aX=aS.nodeName.toLowerCase();aV=aS.parentNode.nodeName.toLowerCase();if(aS.nodeType===1&&N(aS)){aW=aM;aM=N(aS)==="true";aU=true}if(u(aX,"br")){aQ=0;if(aF.block){p.remove(aS)}return}if(aF.wrapper&&P(aS,ay,aE)){aQ=0;return}if(aM&&!aU&&aF.block&&!aF.wrapper&&Z(aX)&&r(aV,aN)){aS=p.rename(aS,aN);aw(aS);aI.push(aS);aQ=0;return}if(aF.selector){ak(aB,function(aY){if("collapsed" in aY&&aY.collapsed!==aC){return}if(p.is(aS,aY.selector)&&!o(aS)){aw(aS,aY);aT=true}});if(!aF.inline||aT){aQ=0;return}}if(aM&&!aU&&r(aN,aX)&&r(aV,aN)&&!(!aO&&aS.nodeType===3&&aS.nodeValue.length===1&&aS.nodeValue.charCodeAt(0)===65279)&&!o(aS)&&(!aF.inline||!Y(aS))){if(!aQ){aQ=p.clone(aK,ap);aS.parentNode.insertBefore(aQ,aS);aI.push(aQ)}aQ.appendChild(aS)}else{aQ=0;ak(at(aS.childNodes),aR);if(aU){aM=aW}aQ=0}}ak(aP,aR)});if(aF.links===true){ak(aI,function(aP){function aQ(aR){if(aR.nodeName==="A"){aw(aR,aF)}ak(at(aR.childNodes),aQ)}aQ(aP)})}ak(aI,function(aR){var aP;function aS(aU){var aT=0;ak(aU.childNodes,function(aV){if(!t(aV)&&!ab(aV)){aT++}});return aT}function aQ(aT){var aV,aU;ak(aT.childNodes,function(aW){if(aW.nodeType==1&&!ab(aW)&&!o(aW)){aV=aW;return ap}});if(aV&&!ab(aV)&&v(aV,aF)){aU=p.clone(aV,ap);aw(aU);p.replace(aU,aT,S);p.remove(aV,1)}return aU||aT}aP=aS(aR);if((aI.length>1||!Y(aR))&&aP===0){p.remove(aR,1);return}if(aF.inline||aF.wrapper){if(!aF.exact&&aP===1){aR=aQ(aR)}ak(aB,function(aT){ak(p.select(aT.inline,aR),function(aU){if(ab(aU)){return}au(aT,aE,aU,aT.exact?aU:null)})});if(P(aR.parentNode,ay,aE)){p.remove(aR,1);aR=0;return S}if(aF.merge_with_parents){p.getParent(aR.parentNode,function(aT){if(P(aT,ay,aE)){p.remove(aR,1);aR=0;return S}})}if(aR&&aF.merge_siblings!==false){aR=L(U(aR),aR);aR=L(aR,U(aR,S))}}})}if(aF){if(aA){if(aA.nodeType){ax=p.createRng();ax.setStartBefore(aA);ax.setEndAfter(aA);aG(E(ax,aB),null,true)}else{aG(aA,null,true)}}else{if(!aC||!aF.inline||p.select("td.mce-item-selected,th.mce-item-selected").length){var aH=av.selection.getNode();if(!B&&aB[0].defaultBlock&&!p.getParent(aH,p.isBlock)){ar(aB[0].defaultBlock)}av.selection.setRng(az());aD=I.getBookmark();aG(E(I.getRng(S),aB),aD);if(aF.styles&&(aF.styles.color||aF.styles.textDecoration)){F(aH,ac,"childNodes");ac(aH)}I.moveToBookmark(aD);ai(I.getRng(S));av.nodeChanged()}else{al("apply",ay,aE)}}}}function R(ay,aH,aA,aD){var aB=an(ay),aJ=aB[0],aF,ax,aG=true;function az(aO){var aN,aM,aL,aQ,aP;if(aO.nodeType===1&&N(aO)){aQ=aG;aG=N(aO)==="true";aP=true}aN=at(aO.childNodes);if(aG&&!aP){for(aM=0,aL=aB.length;aM<aL;aM++){if(au(aB[aM],aH,aO,aO)){break}}}if(aJ.deep){if(aN.length){for(aM=0,aL=aN.length;aM<aL;aM++){az(aN[aM])}if(aP){aG=aQ}}}}function aC(aL){var aM;ak(C(aL.parentNode).reverse(),function(aN){var aO;if(!aM&&aN.id!="_start"&&aN.id!="_end"){aO=P(aN,ay,aH,aD);if(aO&&aO.split!==false){aM=aN}}});return aM}function aw(aP,aL,aQ,aT){var aU,aS,aR,aN,aO,aM;if(aP){aM=aP.parentNode;for(aU=aL.parentNode;aU&&aU!=aM;aU=aU.parentNode){aS=p.clone(aU,ap);for(aO=0;aO<aB.length;aO++){if(au(aB[aO],aH,aS,aS)){aS=0;break}}if(aS){if(aR){aS.appendChild(aR)}if(!aN){aN=aS}aR=aS}}if(aT&&(!aJ.mixed||!Y(aP))){aL=p.split(aP,aL)}if(aR){aQ.parentNode.insertBefore(aR,aQ);aN.appendChild(aQ)}}return aL}function aI(aL){return aw(aC(aL),aL,aL,true)}function aE(aN){var aM=p.get(aN?"_start":"_end"),aL=aM[aN?"firstChild":"lastChild"];if(ab(aL)){aL=aL[aN?"firstChild":"lastChild"]}if(aL.nodeType==3&&aL.data.length===0){aL=aN?aM.previousSibling||aM.nextSibling:aM.nextSibling||aM.previousSibling}p.remove(aM,true);return aL}function aK(aL){var aM,aN;var aO=aL.commonAncestorContainer;aL=E(aL,aB,S);if(aJ.split){aM=ad(aL,S);aN=ad(aL);if(aM!=aN){if(/^(TR|TH|TD)$/.test(aM.nodeName)&&aM.firstChild){if(aM.nodeName=="TR"){aM=aM.firstChild.firstChild||aM}else{aM=aM.firstChild||aM}}if(aO&&/^T(HEAD|BODY|FOOT|R)$/.test(aO.nodeName)&&am(aN)&&aN.firstChild){aN=aN.firstChild||aN}if(p.isChildOf(aM,aN)&&!am(aM)&&!am(aN)){aM=aj(aM,"span",{id:"_start","data-mce-type":"bookmark"});aI(aM);aM=aE(S);return}else{aM=aj(aM,"span",{id:"_start","data-mce-type":"bookmark"});aN=aj(aN,"span",{id:"_end","data-mce-type":"bookmark"});aI(aM);aI(aN);aM=aE(S);aN=aE()}}else{aM=aN=aI(aM)}aL.startContainer=aM.parentNode?aM.parentNode:aM;aL.startOffset=K(aM);aL.endContainer=aN.parentNode?aN.parentNode:aN;aL.endOffset=K(aN)+1}ae.walk(aL,function(aP){ak(aP,function(aQ){az(aQ);if(aQ.nodeType===1&&av.dom.getStyle(aQ,"text-decoration")==="underline"&&aQ.parentNode&&w(aQ.parentNode)==="underline"){au({deep:false,exact:true,inline:"span",styles:{textDecoration:"underline"}},null,aQ)}})})}if(aA){if(aA.nodeType){ax=p.createRng();ax.setStartBefore(aA);ax.setEndAfter(aA);aK(ax)}else{aK(aA)}return}if(!I.isCollapsed()||!aJ.inline||p.select("td.mce-item-selected,th.mce-item-selected").length){aF=I.getBookmark();aK(I.getRng(S));I.moveToBookmark(aF);if(aJ.inline&&y(ay,aH,I.getStart())){ai(I.getRng(true))}av.nodeChanged()}else{al("remove",ay,aH,aD)}}function V(ax,az,ay){var aw=an(ax);if(y(ax,az,ay)&&(!("toggle" in aw[0])||aw[0].toggle)){R(ax,az,ay)}else{ar(ax,az,ay)}}function P(ax,aw,aC,aA){var ay=an(aw),aD,aB,az;function aE(aI,aK,aL){var aH,aJ,aF=aK[aL],aG;if(aK.onmatch){return aK.onmatch(aI,aK,aL)}if(aF){if(aF.length===T){for(aH in aF){if(aF.hasOwnProperty(aH)){if(aL==="attributes"){aJ=p.getAttrib(aI,aH)}else{aJ=af(aI,aH)}if(aA&&!aJ&&!aK.exact){return}if((!aA||aK.exact)&&!u(aJ,J(H(aF[aH],aC),aH))){return}}}}else{for(aG=0;aG<aF.length;aG++){if(aL==="attributes"?p.getAttrib(aI,aF[aG]):af(aI,aF[aG])){return aK}}}}return aK}if(ay&&ax){for(aB=0;aB<ay.length;aB++){aD=ay[aB];if(v(ax,aD)&&aE(ax,aD,"attributes")&&aE(ax,aD,"styles")){if((az=aD.classes)){for(aB=0;aB<az.length;aB++){if(!p.hasClass(ax,az[aB])){return}}}return aD}}}}function y(ay,aA,az){var ax;function aw(aC){var aB=p.getRoot();if(aC===aB){return false}aC=p.getParent(aC,function(aD){return aD.parentNode===aB||!!P(aD,ay,aA,true)});return P(aC,ay,aA)}if(az){return aw(az)}az=I.getNode();if(aw(az)){return S}ax=I.getStart();if(ax!=az){if(aw(ax)){return S}}return ap}function M(aA,az){var ax,ay=[],aw={};ax=I.getStart();p.getParent(ax,function(aD){var aC,aB;for(aC=0;aC<aA.length;aC++){aB=aA[aC];if(!aw[aB]&&P(aD,aB,az)){aw[aB]=true;ay.push(aB)}}},p.getRoot());return ay}function Q(aA){var aC=an(aA),az,ay,aB,ax,aw;if(aC){az=I.getStart();ay=C(az);for(ax=aC.length-1;ax>=0;ax--){aw=aC[ax].selector;if(!aw||aC[ax].defaultBlock){return S}for(aB=ay.length-1;aB>=0;aB--){if(p.is(ay[aB],aw)){return S}}}}return ap}function aa(aw,az,ax){var ay;if(!ag){ag={};ay={};av.on("NodeChange",function(aB){var aA=C(aB.element),aC={};aA=j.grep(aA,function(aD){return aD.nodeType==1&&!aD.getAttribute("data-mce-bogus")});ak(ag,function(aD,aE){ak(aA,function(aF){if(P(aF,aE,{},aD.similar)){if(!ay[aE]){ak(aD,function(aG){aG(true,{node:aF,format:aE,parents:aA})});ay[aE]=aD}aC[aE]=aD;return false}})});ak(ay,function(aD,aE){if(!aC[aE]){delete ay[aE];ak(aD,function(aF){aF(false,{node:aB.element,format:aE,parents:aA})})}})})}ak(aw.split(","),function(aA){if(!ag[aA]){ag[aA]=[];ag[aA].similar=ax}ag[aA].push(az)});return this}function aq(aw){return n.getCssText(av,aw)}G(this,{get:an,register:A,unregister:O,apply:ar,remove:R,toggle:V,match:y,matchAll:M,matchNode:P,canApply:Q,formatChanged:aa,getCssText:aq});x();ao();av.on("BeforeGetContent",function(aw){if(z&&aw.format!="raw"){z()}});av.on("mouseup keydown",function(aw){if(X){X(aw)}});function v(aw,ax){if(u(aw,ax.inline)){return S}if(u(aw,ax.block)){return S}if(ax.selector){return aw.nodeType==1&&p.is(aw,ax.selector)}}function u(ax,aw){ax=ax||"";aw=aw||"";ax=""+(ax.nodeName||ax);aw=""+(aw.nodeName||aw);return ax.toLowerCase()==aw.toLowerCase()}function af(ax,aw){return J(p.getStyle(ax,aw),aw)}function J(ax,aw){if(aw=="color"||aw=="backgroundColor"){ax=p.toHex(ax)}if(aw=="fontWeight"&&ax==700){ax="bold"}if(aw=="fontFamily"){ax=ax.replace(/[\'\"]/g,"").replace(/,\s+/g,",")}return""+ax}function H(aw,ax){if(typeof aw!="string"){aw=aw(ax)}else{if(ax){aw=aw.replace(/%(\w+)/g,function(az,ay){return ax[ay]||az})}}return aw}function t(aw){return aw&&aw.nodeType===3&&/^([\t \r\n]+|)$/.test(aw.nodeValue)}function aj(ay,ax,aw){var az=p.create(ax,aw);ay.parentNode.insertBefore(az,ay);az.appendChild(ay);return az}function E(aw,aH,az){var aI,aC,aG,ay=aw.startContainer,aD=aw.startOffset,aL=aw.endContainer,aF=aw.endOffset;function aJ(aS){var aN,aQ,aP,aO,aM;aN=aQ=aS?ay:aL;aO=aS?"previousSibling":"nextSibling";aM=p.getRoot();function aR(aT){return aT.nodeName=="BR"&&aT.getAttribute("data-mce-bogus")&&!aT.nextSibling}if(aN.nodeType==3&&!t(aN)){if(aS?aD>0:aF<aN.nodeValue.length){return aN}}while(true){if(!aH[0].block_expand&&Y(aQ)){return aQ}for(aP=aQ[aO];aP;aP=aP[aO]){if(!ab(aP)&&!t(aP)&&!aR(aP)){return aQ}}if(aQ.parentNode==aM){aN=aQ;break}aQ=aQ.parentNode}return aN}function aB(aM,aN){if(aN===T){aN=aM.nodeType===3?aM.length:aM.childNodes.length}while(aM&&aM.hasChildNodes()){aM=aM.childNodes[aN];if(aM){aN=aM.nodeType===3?aM.length:aM.childNodes.length}}return{node:aM,offset:aN}}if(ay.nodeType==1&&ay.hasChildNodes()){aI=ay.childNodes.length-1;ay=ay.childNodes[aD>aI?aI:aD];if(ay.nodeType==3){aD=0}}if(aL.nodeType==1&&aL.hasChildNodes()){aI=aL.childNodes.length-1;aL=aL.childNodes[aF>aI?aI:aF-1];if(aL.nodeType==3){aF=aL.nodeValue.length}}function aK(aN){var aM=aN;while(aM){if(aM.nodeType===1&&N(aM)){return N(aM)==="false"?aM:aN}aM=aM.parentNode}return aN}function aE(aN,aR,aT){var aQ,aO,aS,aM;function aP(aV,aX){var aY,aU,aW=aV.nodeValue;if(typeof aX=="undefined"){aX=aT?aW.length:0}if(aT){aY=aW.lastIndexOf(" ",aX);aU=aW.lastIndexOf("\u00a0",aX);aY=aY>aU?aY:aU;if(aY!==-1&&!az){aY++}}else{aY=aW.indexOf(" ",aX);aU=aW.indexOf("\u00a0",aX);aY=aY!==-1&&(aU===-1||aY<aU)?aY:aU}return aY}if(aN.nodeType===3){aS=aP(aN,aR);if(aS!==-1){return{container:aN,offset:aS}}aM=aN}aQ=new l(aN,p.getParent(aN,Y)||av.getBody());while((aO=aQ[aT?"prev":"next"]())){if(aO.nodeType===3){aM=aO;aS=aP(aO);if(aS!==-1){return{container:aO,offset:aS}}}else{if(Y(aO)){break}}}if(aM){if(aT){aR=0}else{aR=aM.length}return{container:aM,offset:aR}}}function aA(aN,aM){var aO,aP,aR,aQ;if(aN.nodeType==3&&aN.nodeValue.length===0&&aN[aM]){aN=aN[aM]}aO=C(aN);for(aP=0;aP<aO.length;aP++){for(aR=0;aR<aH.length;aR++){aQ=aH[aR];if("collapsed" in aQ&&aQ.collapsed!==aw.collapsed){continue}if(p.is(aO[aP],aQ.selector)){return aO[aP]}}}return aN}function ax(aO,aM){var aP,aN=p.getRoot();if(!aH[0].wrapper){aP=p.getParent(aO,aH[0].block,aN)}if(!aP){aP=p.getParent(aO.nodeType==3?aO.parentNode:aO,function(aQ){return aQ!=aN&&Z(aQ)})}if(aP&&aH[0].wrapper){aP=C(aP,"ul,ol").reverse()[0]||aP}if(!aP){aP=aO;while(aP[aM]&&!Y(aP[aM])){aP=aP[aM];if(u(aP,"br")){break}}}return aP||aO}ay=aK(ay);aL=aK(aL);if(ab(ay.parentNode)||ab(ay)){ay=ab(ay)?ay:ay.parentNode;ay=ay.nextSibling||ay;if(ay.nodeType==3){aD=0}}if(ab(aL.parentNode)||ab(aL)){aL=ab(aL)?aL:aL.parentNode;aL=aL.previousSibling||aL;if(aL.nodeType==3){aF=aL.length}}if(aH[0].inline){if(aw.collapsed){aG=aE(ay,aD,true);if(aG){ay=aG.container;aD=aG.offset}aG=aE(aL,aF);if(aG){aL=aG.container;aF=aG.offset}}aC=aB(aL,aF);if(aC.node){while(aC.node&&aC.offset===0&&aC.node.previousSibling){aC=aB(aC.node.previousSibling)}if(aC.node&&aC.offset>0&&aC.node.nodeType===3&&aC.node.nodeValue.charAt(aC.offset-1)===" "){if(aC.offset>1){aL=aC.node;aL.splitText(aC.offset-1)}}}}if(aH[0].inline||aH[0].block_expand){if(!aH[0].inline||(ay.nodeType!=3||aD===0)){ay=aJ(true)}if(!aH[0].inline||(aL.nodeType!=3||aF===aL.nodeValue.length)){aL=aJ()}}if(aH[0].selector&&aH[0].expand!==ap&&!aH[0].inline){ay=aA(ay,"previousSibling");aL=aA(aL,"nextSibling")}if(aH[0].block||aH[0].selector){ay=ax(ay,"previousSibling");aL=ax(aL,"nextSibling");if(aH[0].block){if(!Y(ay)){ay=aJ(true)}if(!Y(aL)){aL=aJ()}}}if(ay.nodeType==1){aD=K(ay);ay=ay.parentNode}if(aL.nodeType==1){aF=K(aL)+1;aL=aL.parentNode}return{startContainer:ay,startOffset:aD,endContainer:aL,endOffset:aF}}function q(aw,ax){return ax.links&&aw.tagName=="A"}function au(aC,aB,az,aw){var ay,ax,aA;if(!v(az,aC)&&!q(az,aC)){return ap}if(aC.remove!="all"){ak(aC.styles,function(aE,aD){aE=J(H(aE,aB),aD);if(typeof aD==="number"){aD=aE;aw=0}if(aC.remove_similar||(!aw||u(af(aw,aD),aE))){p.setStyle(az,aD,"")}aA=1});if(aA&&p.getAttrib(az,"style")===""){az.removeAttribute("style");az.removeAttribute("data-mce-style")}ak(aC.attributes,function(aF,aD){var aE;aF=H(aF,aB);if(typeof aD==="number"){aD=aF;aw=0}if(!aw||u(p.getAttrib(aw,aD),aF)){if(aD=="class"){aF=p.getAttrib(az,aD);if(aF){aE="";ak(aF.split(/\s+/),function(aG){if(/mce\-\w+/.test(aG)){aE+=(aE?" ":"")+aG}});if(aE){p.setAttrib(az,aD,aE);return}}}if(aD=="class"){az.removeAttribute("className")}if(s.test(aD)){az.removeAttribute("data-mce-"+aD)}az.removeAttribute(aD)}});ak(aC.classes,function(aD){aD=H(aD,aB);if(!aw||p.hasClass(aw,aD)){p.removeClass(az,aD)}});ax=p.getAttribs(az);for(ay=0;ay<ax.length;ay++){if(ax[ay].nodeName.indexOf("_")!==0){return ap}}}if(aC.remove!="none"){D(az,aC);return S}}function D(ay,az){var aw=ay.parentNode,ax;function aA(aC,aB,aD){aC=U(aC,aB,aD);return !aC||(aC.nodeName=="BR"||Y(aC))}if(az.block){if(!B){if(Y(ay)&&!Y(aw)){if(!aA(ay,ap)&&!aA(ay.firstChild,S,1)){ay.insertBefore(p.create("br"),ay.firstChild)}if(!aA(ay,S)&&!aA(ay.lastChild,ap,1)){ay.appendChild(p.create("br"))}}}else{if(aw==p.getRoot()){if(!az.list_block||!u(ay,az.list_block)){ak(at(ay.childNodes),function(aB){if(r(B,aB.nodeName.toLowerCase())){if(!ax){ax=aj(aB,B);p.setAttribs(ax,av.settings.forced_root_block_attrs)}else{ax.appendChild(aB)}}else{ax=0}})}}}}if(az.selector&&az.inline&&!u(az.inline,ay)){return}p.remove(ay,1)}function U(ax,aw,ay){if(ax){aw=aw?"nextSibling":"previousSibling";for(ax=ay?ax:ax[aw];ax;ax=ax[aw]){if(ax.nodeType==1||!t(ax)){return ax}}}}function L(aA,az){var ay,ax,aw=new k(p);function aB(aD,aC){for(ay=aD;ay;ay=ay[aC]){if(ay.nodeType==3&&ay.nodeValue.length!==0){return aD}if(ay.nodeType==1&&!ab(ay)){return ay}}return aD}if(aA&&az){aA=aB(aA,"previousSibling");az=aB(az,"nextSibling");if(aw.compare(aA,az)){for(ay=aA.nextSibling;ay&&ay!=az;){ax=ay;ay=ay.nextSibling;aA.appendChild(ax)}p.remove(az);ak(at(az.childNodes),function(aC){aA.appendChild(aC)});return aA}}return az}function ad(ax,aA){var aw,az,ay;aw=ax[aA?"startContainer":"endContainer"];az=ax[aA?"startOffset":"endOffset"];if(aw.nodeType==1){ay=aw.childNodes.length-1;if(!aA&&az){az--}aw=aw.childNodes[az>ay?ay:az]}if(aw.nodeType===3&&aA&&az>=aw.nodeValue.length){aw=new l(aw,av.getBody()).next()||aw}if(aw.nodeType===3&&!aA&&az===0){aw=new l(aw,av.getBody()).prev()||aw}return aw}function al(aG,aw,aE,aA){var aH="_mce_caret",ax=av.settings.caret_debug;function ay(aL){var aK=p.create("span",{id:aH,"data-mce-bogus":true,style:ax?"color:red":""});if(aL){aK.appendChild(av.getDoc().createTextNode(W))}return aK}function aF(aL,aK){while(aL){if((aL.nodeType===3&&aL.nodeValue!==W)||aL.childNodes.length>1){return false}if(aK&&aL.nodeType===1){aK.push(aL)}aL=aL.firstChild}return true}function aC(aK){while(aK){if(aK.id===aH){return aK}aK=aK.parentNode}}function aB(aK){var aL;if(aK){aL=new l(aK,aK);for(aK=aL.current();aK;aK=aL.next()){if(aK.nodeType===3){return aK}}}}function az(aM,aL){var aN,aK;if(!aM){aM=aC(I.getStart());if(!aM){while((aM=p.get(aH))){az(aM,false)}}}else{aK=I.getRng(true);if(aF(aM)){if(aL!==false){aK.setStartBefore(aM);aK.setEndBefore(aM)}p.remove(aM)}else{aN=aB(aM);if(aN.nodeValue.charAt(0)===W){aN.deleteData(0,1);if(aK.startContainer==aN&&aK.startOffset>0){aK.setStart(aN,aK.startOffset-1)}if(aK.endContainer==aN&&aK.endOffset>0){aK.setEnd(aN,aK.endOffset-1)}}p.remove(aM,1)}I.setRng(aK)}}function aD(){var aM,aK,aQ,aP,aN,aL,aO;aM=I.getRng(true);aP=aM.startOffset;aL=aM.startContainer;aO=aL.nodeValue;aK=aC(I.getStart());if(aK){aQ=aB(aK)}if(aO&&aP>0&&aP<aO.length&&/\w/.test(aO.charAt(aP))&&/\w/.test(aO.charAt(aP-1))){aN=I.getBookmark();aM.collapse(true);aM=E(aM,an(aw));aM=ae.split(aM);ar(aw,aE,aM);I.moveToBookmark(aN)}else{if(!aK||aQ.nodeValue!==W){aK=ay(true);aQ=aK.firstChild;aM.insertNode(aK);aP=1;ar(aw,aE,aK)}else{ar(aw,aE,aK)}I.setCursorLocation(aQ,aP)}}function aI(){var aK=I.getRng(true),aL,aO,aR,aQ,aM,aU,aT=[],aP,aS;aL=aK.startContainer;aO=aK.startOffset;aM=aL;if(aL.nodeType==3){if(aO!=aL.nodeValue.length){aQ=true}aM=aM.parentNode}while(aM){if(P(aM,aw,aE,aA)){aU=aM;break}if(aM.nextSibling){aQ=true}aT.push(aM);aM=aM.parentNode}if(!aU){return}if(aQ){aR=I.getBookmark();aK.collapse(true);aK=E(aK,an(aw),true);aK=ae.split(aK);R(aw,aE,aK);I.moveToBookmark(aR)}else{aS=ay();aM=aS;for(aP=aT.length-1;aP>=0;aP--){aM.appendChild(p.clone(aT[aP],false));aM=aM.firstChild}aM.appendChild(p.doc.createTextNode(W));aM=aM.firstChild;var aN=p.getParent(aU,Z);if(aN&&p.isEmpty(aN)){aU.parentNode.replaceChild(aS,aU)}else{p.insertAfter(aS,aU)}I.setCursorLocation(aM,1);if(p.isEmpty(aU)){p.remove(aU)}}}function aJ(){var aK;aK=aC(I.getStart());if(aK&&!p.isEmpty(aK)){F(aK,function(aL){if(aL.nodeType==1&&aL.id!==aH&&!p.isEmpty(aL)){p.setAttrib(aL,"data-mce-bogus",null)}},"childNodes")}}if(!av._hasCaretEvents){z=function(){var aK=[],aL;if(aF(aC(I.getStart()),aK)){aL=aK.length;while(aL--){p.setAttrib(aK[aL],"data-mce-bogus","1")}}};X=function(aL){var aK=aL.keyCode;az();if((aK==8&&I.isCollapsed())||aK==37||aK==39){az(aC(I.getStart()))}aJ()};av.on("SetContent",function(aK){if(aK.selection){aJ()}});av._hasCaretEvents=true}if(aG=="apply"){aD()}else{aI()}}function ai(ax){var aw=ax.startContainer,aD=ax.startOffset,az,aC,aB,ay,aA;if(aw.nodeType==3&&aD>=aw.nodeValue.length){aD=K(aw);aw=aw.parentNode;az=true}if(aw.nodeType==1){ay=aw.childNodes;aw=ay[Math.min(aD,ay.length-1)];aC=new l(aw,p.getParent(aw,p.isBlock));if(aD>ay.length-1||az){aC.next()}for(aB=aC.current();aB;aB=aC.next()){if(aB.nodeType==3&&!t(aB)){aA=p.create("a",{"data-mce-bogus":"all"},W);aB.parentNode.insertBefore(aA,aB);ax.setStart(aB,0);I.setRng(ax);p.remove(aA);return}}}}}});h("tinymce/UndoManager",["tinymce/util/VK","tinymce/Env","tinymce/util/Tools","tinymce/html/SaxParser"],function(n,k,l,j){var i=l.trim,m;m=new RegExp(["<span[^>]+data-mce-bogus[^>]+>[\u200B\uFEFF]+<\\/span>",'\\s?data-mce-selected="[^"]+"'].join("|"),"gi");return function(t){var x=this,u=0,q=[],r,v,w=0;function o(){var D=t.getContent({format:"raw",no_events:1});var B=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g;var y,z,F,E,A,C=t.schema;D=D.replace(m,"");A=C.getShortEndedElements();while((E=B.exec(D))){z=B.lastIndex;F=E[0].length;if(A[E[1]]){y=z}else{y=j.findEndTag(C,D,z)}D=D.substring(0,z-F)+D.substring(y);B.lastIndex=z-F}return i(D)}function s(y){t.isNotDirty=!y}function p(y){x.typing=false;x.add({},y)}t.on("init",function(){x.add()});t.on("BeforeExecCommand",function(z){var y=z.command;if(y!="Undo"&&y!="Redo"&&y!="mceRepaint"){x.beforeChange()}});t.on("ExecCommand",function(z){var y=z.command;if(y!="Undo"&&y!="Redo"&&y!="mceRepaint"){p(z)}});t.on("ObjectResizeStart",function(){x.beforeChange()});t.on("SaveContent ObjectResized blur",p);t.on("DragEnd",p);t.on("KeyUp",function(z){var y=z.keyCode;if((y>=33&&y<=36)||(y>=37&&y<=40)||y==45||y==13||z.ctrlKey){p();t.nodeChanged()}if(y==46||y==8||(k.mac&&(y==91||y==93))){t.nodeChanged()}if(v&&x.typing){if(!t.isDirty()){s(q[0]&&o()!=q[0].content);if(!t.isNotDirty){t.fire("change",{level:q[0],lastLevel:null})}}t.fire("TypingUndo");v=false;t.nodeChanged()}});t.on("KeyDown",function(A){var z=A.keyCode;if((z>=33&&z<=36)||(z>=37&&z<=40)||z==45){if(x.typing){p(A)}return}var y=(A.ctrlKey&&!A.altKey)||A.metaKey;if((z<16||z>20)&&z!=224&&z!=91&&!x.typing&&!y){x.beforeChange();x.typing=true;x.add({},A);v=true}});t.on("MouseDown",function(y){if(x.typing){p(y)}});t.addShortcut("meta+z","","Undo");t.addShortcut("meta+y,meta+shift+z","","Redo");t.on("AddUndo Undo Redo ClearUndos",function(y){if(!y.isDefaultPrevented()){t.nodeChanged()}});x={data:q,typing:false,beforeChange:function(){if(!w){r=t.selection.getBookmark(2,true)}},add:function(D,C){var z,A=t.settings,B;D=D||{};D.content=o();if(w||t.removed){return null}B=q[u];if(t.fire("BeforeAddUndo",{level:D,lastLevel:B,originalEvent:C}).isDefaultPrevented()){return null}if(B&&B.content==D.content){return null}if(q[u]){q[u].beforeBookmark=r}if(A.custom_undo_redo_levels){if(q.length>A.custom_undo_redo_levels){for(z=0;z<q.length-1;z++){q[z]=q[z+1]}q.length--;u=q.length}}D.bookmark=t.selection.getBookmark(2,true);if(u<q.length-1){q.length=u+1}q.push(D);u=q.length-1;var y={level:D,lastLevel:B,originalEvent:C};t.fire("AddUndo",y);if(u>0){s(true);t.fire("change",y)}return D},undo:function(){var y;if(x.typing){x.add();x.typing=false}if(u>0){y=q[--u];if(u===0){s(false)}t.setContent(y.content,{format:"raw"});t.selection.moveToBookmark(y.beforeBookmark);t.fire("undo",{level:y})}return y},redo:function(){var y;if(u<q.length-1){y=q[++u];t.setContent(y.content,{format:"raw"});t.selection.moveToBookmark(y.bookmark);s(true);t.fire("redo",{level:y})}return y},clear:function(){q=[];u=0;x.typing=false;t.fire("ClearUndos")},hasUndo:function(){return u>0||(x.typing&&q[0]&&o()!=q[0].content)},hasRedo:function(){return u<q.length-1&&!this.typing},transact:function(y){x.beforeChange();try{w++;y()}finally{w--}x.add()}};return x}});h("tinymce/EnterKey",["tinymce/dom/TreeWalker","tinymce/dom/RangeUtils","tinymce/Env"],function(j,l,i){var k=i.ie&&i.ie<11;return function(r){var o=r.dom,s=r.selection,m=r.settings;var u=r.undoManager,n=r.schema,p=n.getNonEmptyElements(),t=n.getMoveCaretBeforeOnEnterElements();function q(M){var H,R,v,L,G,B,X,N,A,w,z,F,U,J,O;function P(Y){return Y&&o.isBlock(Y)&&!/^(TD|TH|CAPTION|FORM)$/.test(Y.nodeName)&&!/^(fixed|absolute)/i.test(Y.style.position)&&o.getContentEditable(Y)!=="true"}function Q(Z){var Y;if(o.isBlock(Z)){Y=s.getRng();Z.appendChild(o.create("span",null,"\u00a0"));s.select(Z);Z.lastChild.outerHTML="";s.setRng(Y)}}function K(aa){var Z=aa,ab=[],Y;if(!Z){return}while((Z=Z.firstChild)){if(o.isBlock(Z)){return}if(Z.nodeType==1&&!p[Z.nodeName.toLowerCase()]){ab.push(Z)}}Y=ab.length;while(Y--){Z=ab[Y];if(!Z.hasChildNodes()||(Z.firstChild==Z.lastChild&&Z.firstChild.nodeValue==="")){o.remove(Z)}else{if(Z.nodeName=="A"&&(Z.innerText||Z.textContent)===" "){o.remove(Z)}}}}function y(Z){var af,ac,Y,ab=Z,aa;function ae(ag){while(ag){if(ag.nodeType==1||(ag.nodeType==3&&ag.data&&/[\r\n\s]/.test(ag.data))){return ag}ag=ag.nextSibling}}if(!Z){return}if(i.ie&&i.ie<9&&B&&B.firstChild){if(B.firstChild==B.lastChild&&B.firstChild.tagName=="BR"){o.remove(B.firstChild)}}if(/^(LI|DT|DD)$/.test(Z.nodeName)){var ad=ae(Z.firstChild);if(ad&&/^(UL|OL|DL)$/.test(ad.nodeName)){Z.insertBefore(o.doc.createTextNode("\u00a0"),Z.firstChild)}}Y=o.createRng();if(!i.ie){Z.normalize()}if(Z.hasChildNodes()){af=new j(Z,Z);while((ac=af.current())){if(ac.nodeType==3){Y.setStart(ac,0);Y.setEnd(ac,0);break}if(t[ac.nodeName.toLowerCase()]){Y.setStartBefore(ac);Y.setEndBefore(ac);break}ab=ac;ac=af.next()}if(!ac){Y.setStart(ab,0);Y.setEnd(ab,0)}}else{if(Z.nodeName=="BR"){if(Z.nextSibling&&o.isBlock(Z.nextSibling)){if(!X||X<9){aa=o.create("br");Z.parentNode.insertBefore(aa,Z)}Y.setStartBefore(Z);Y.setEndBefore(Z)}else{Y.setStartAfter(Z);Y.setEndAfter(Z)}}else{Y.setStart(Z,0);Y.setEnd(Z,0)}}s.setRng(Y);o.remove(aa);s.scrollIntoView(Z)}function I(Z){var Y=m.forced_root_block;if(Y&&Y.toLowerCase()===Z.tagName.toLowerCase()){o.setAttribs(Z,m.forced_root_block_attrs)}}function D(Z){var ab=L,ad,ac,Y,aa=n.getTextInlineElements();if(Z||F=="TABLE"){ad=o.create(Z||J);I(ad)}else{ad=B.cloneNode(false)}Y=ad;if(m.keep_styles!==false){do{if(aa[ab.nodeName]){if(ab.id=="_mce_caret"){continue}ac=ab.cloneNode(false);o.setAttrib(ac,"id","");if(ad.hasChildNodes()){ac.appendChild(ad.firstChild);ad.appendChild(ac)}else{Y=ac;ad.appendChild(ac)}}}while((ab=ab.parentNode))}if(!k){Y.innerHTML='<br data-mce-bogus="1">'}return ad}function C(ab){var aa,Z,Y;if(L.nodeType==3&&(ab?G>0:G<L.nodeValue.length)){return false}if(L.parentNode==B&&O&&!ab){return true}if(ab&&L.nodeType==1&&L==B.firstChild){return true}if(L.nodeName==="TABLE"||(L.previousSibling&&L.previousSibling.nodeName=="TABLE")){return(O&&!ab)||(!O&&ab)}aa=new j(L,B);if(L.nodeType==3){if(ab&&G===0){aa.prev()}else{if(!ab&&G==L.nodeValue.length){aa.next()}}}while((Z=aa.current())){if(Z.nodeType===1){if(!Z.getAttribute("data-mce-bogus")){Y=Z.nodeName.toLowerCase();if(p[Y]&&Y!=="br"){return false}}}else{if(Z.nodeType===3&&!/^[ \t\r\n]*$/.test(Z.nodeValue)){return false}}if(ab){aa.prev()}else{aa.next()}}return true}function x(Z,ad){var af,aa,ab,ac,ae,Y,ag=J||"P";aa=o.getParent(Z,o.isBlock);Y=r.getBody().nodeName.toLowerCase();if(!aa||!P(aa)){aa=aa||v;if(!aa.hasChildNodes()){af=o.create(ag);I(af);aa.appendChild(af);H.setStart(af,0);H.setEnd(af,0);return af}ac=Z;while(ac.parentNode!=aa){ac=ac.parentNode}while(ac&&!o.isBlock(ac)){ab=ac;ac=ac.previousSibling}if(ab&&n.isValidChild(Y,ag.toLowerCase())){af=o.create(ag);I(af);ab.parentNode.insertBefore(af,ab);ac=ab;while(ac&&!o.isBlock(ac)){ae=ac.nextSibling;af.appendChild(ac);ac=ae}H.setStart(Z,ad);H.setEnd(Z,ad)}}return Z}function S(){function Z(ac){var ab=z[ac?"firstChild":"lastChild"];while(ab){if(ab.nodeType==1){break}ab=ab[ac?"nextSibling":"previousSibling"]}return ab===B}function aa(){var ab=z.parentNode;if(/^(LI|DT|DD)$/.test(ab.nodeName)){return ab}return z}var Y=z.parentNode.nodeName;if(/^(OL|UL|LI)$/.test(Y)){J="LI"}A=J?D(J):o.create("BR");if(Z(true)&&Z()){if(Y=="LI"){o.insertAfter(A,aa())}else{o.replace(A,z)}}else{if(Z(true)){if(Y=="LI"){o.insertAfter(A,aa());A.appendChild(o.doc.createTextNode(" "));A.appendChild(z)}else{z.parentNode.insertBefore(A,z)}}else{if(Z()){o.insertAfter(A,aa());Q(A)}else{z=aa();R=H.cloneRange();R.setStartAfter(B);R.setEndAfter(z);w=R.extractContents();if(J=="LI"&&w.firstChild.nodeName=="LI"){A=w.firstChild;o.insertAfter(w,z)}else{o.insertAfter(w,z);o.insertAfter(A,z)}}}}o.remove(B);y(A);u.add()}function W(){r.execCommand("InsertLineBreak",false,M)}function E(Y){do{if(Y.nodeType===3){Y.nodeValue=Y.nodeValue.replace(/^[\r\n]+/,"")}Y=Y.firstChild}while(Y)}function V(aa){var Y=o.getRoot(),Z,ab;Z=aa;while(Z!==Y&&o.getContentEditable(Z)!=="false"){if(o.getContentEditable(Z)==="true"){ab=Z}Z=Z.parentNode}return Z!==Y?ab:Y}function T(Z){var Y;if(!k){Z.normalize();Y=Z.lastChild;if(!Y||(/^(left|right)$/gi.test(o.getStyle(Y,"float",true)))){o.add(Z,"br")}}}H=s.getRng(true);if(M.isDefaultPrevented()){return}if(!H.collapsed){r.execCommand("Delete");return}new l(o).normalize(H);L=H.startContainer;G=H.startOffset;J=(m.force_p_newlines?"p":"")||m.forced_root_block;J=J?J.toUpperCase():"";X=o.doc.documentMode;N=M.shiftKey;if(L.nodeType==1&&L.hasChildNodes()){O=G>L.childNodes.length-1;L=L.childNodes[Math.min(G,L.childNodes.length-1)]||L;if(O&&L.nodeType==3){G=L.nodeValue.length}else{G=0}}v=V(L);if(!v){return}u.beforeChange();if(!o.isBlock(v)&&v!=o.getRoot()){if(!J||N){W()}return}if((J&&!N)||(!J&&N)){L=x(L,G)}B=o.getParent(L,o.isBlock);z=B?o.getParent(B.parentNode,o.isBlock):null;F=B?B.nodeName.toUpperCase():"";U=z?z.nodeName.toUpperCase():"";if(U=="LI"&&!M.ctrlKey){B=z;F=U}if(/^(LI|DT|DD)$/.test(F)){if(!J&&N){W();return}if(o.isEmpty(B)){S();return}}if(F=="PRE"&&m.br_in_pre!==false){if(!N){W();return}}else{if((!J&&!N&&F!="LI")||(J&&N)){W();return}}if(J&&B===r.getBody()){return}J=J||"P";if(C()){if(/^(H[1-6]|PRE|FIGURE)$/.test(F)&&U!="HGROUP"){A=D(J)}else{A=D()}if(m.end_container_on_empty_block&&P(z)&&o.isEmpty(B)){A=o.split(z,B)}else{o.insertAfter(A,B)}y(A)}else{if(C(true)){A=B.parentNode.insertBefore(D(),B);Q(A);y(B)}else{R=H.cloneRange();R.setEndAfter(B);w=R.extractContents();E(w);A=w.firstChild;o.insertAfter(w,B);K(A);T(B);y(A)}}o.setAttrib(A,"id","");r.fire("NewBlock",{newBlock:A});u.add()}r.on("keydown",function(v){if(v.keyCode==13){if(q(v)!==false){v.preventDefault()}}})}});h("tinymce/ForceBlocks",[],function(){return function(k){var j=k.settings,n=k.dom,i=k.selection;var m=k.schema,l=m.getBlockElements();function o(){var u=i.getStart(),s=k.getBody(),p;var v,A,E,C,t;var w,x=-16777215,B,q;var D,r,z;z=j.forced_root_block;if(!u||u.nodeType!==1||!z){return}while(u&&u!=s){if(l[u.nodeName]){return}u=u.parentNode}p=i.getRng();if(p.setStart){v=p.startContainer;A=p.startOffset;E=p.endContainer;C=p.endOffset;try{q=k.getDoc().activeElement===s}catch(y){}}else{if(p.item){u=p.item(0);p=k.getDoc().body.createTextRange();p.moveToElementText(u)}q=p.parentElement().ownerDocument===k.getDoc();D=p.duplicate();D.collapse(true);A=D.move("character",x)*-1;if(!D.collapsed){D=p.duplicate();D.collapse(false);C=(D.move("character",x)*-1)-A}}u=s.firstChild;r=s.nodeName.toLowerCase();while(u){if(((u.nodeType===3||(u.nodeType==1&&!l[u.nodeName])))&&m.isValidChild(r,z.toLowerCase())){if(u.nodeType===3&&u.nodeValue.length===0){w=u;u=u.nextSibling;n.remove(w);continue}if(!t){t=n.create(z,k.settings.forced_root_block_attrs);u.parentNode.insertBefore(t,u);B=true}w=u;u=u.nextSibling;t.appendChild(w)}else{t=null;u=u.nextSibling}}if(B&&q){if(p.setStart){p.setStart(v,A);p.setEnd(E,C);i.setRng(p)}else{try{p=k.getDoc().body.createTextRange();p.moveToElementText(s);p.collapse(true);p.moveStart("character",A);if(C>0){p.moveEnd("character",C)}p.select()}catch(y){}}k.nodeChanged()}}if(j.forced_root_block){k.on("NodeChange",o)}}});h("tinymce/EditorCommands",["tinymce/html/Serializer","tinymce/Env","tinymce/util/Tools","tinymce/dom/ElementUtils","tinymce/dom/RangeUtils","tinymce/dom/TreeWalker"],function(t,r,m,k,p,w){var v=m.each,s=m.extend;var j=m.map,x=m.inArray,u=m.explode;var i=r.gecko,l=r.ie,o=r.ie&&r.ie<11;var n=true,q=false;return function(B){var M,S,L,E={state:{},exec:{},value:{}},O=B.settings,F;B.on("PreInit",function(){M=B.dom;S=B.selection;O=B.settings;L=B.formatter});function N(aa,Z,Y,T){var V,X,W=0;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(aa)&&(!T||!T.skip_focus)){B.focus()}T=s({},T);T=B.fire("BeforeExecCommand",{command:aa,ui:Z,value:Y});if(T.isDefaultPrevented()){return false}X=aa.toLowerCase();if((V=E.exec[X])){V(X,Z,Y);B.fire("ExecCommand",{command:aa,ui:Z,value:Y});return true}v(B.plugins,function(ab){if(ab.execCommand&&ab.execCommand(aa,Z,Y)){B.fire("ExecCommand",{command:aa,ui:Z,value:Y});W=true;return false}});if(W){return W}if(B.theme&&B.theme.execCommand&&B.theme.execCommand(aa,Z,Y)){B.fire("ExecCommand",{command:aa,ui:Z,value:Y});return true}try{W=B.getDoc().execCommand(aa,Z,Y)}catch(U){}if(W){B.fire("ExecCommand",{command:aa,ui:Z,value:Y});return true}return false}function D(V){var U;if(B._isHidden()){return}V=V.toLowerCase();if((U=E.state[V])){return U(V)}try{return B.getDoc().queryCommandState(V)}catch(T){}return false}function K(V){var U;if(B._isHidden()){return}V=V.toLowerCase();if((U=E.value[V])){return U(V)}try{return B.getDoc().queryCommandValue(V)}catch(T){}}function I(T,U){U=U||"exec";v(T,function(W,V){v(V.toLowerCase().split(","),function(X){E[U][X]=W})})}function H(U,V,T){U=U.toLowerCase();E.exec[U]=function(Z,Y,X,W){return V.call(T||B,Y,X,W)}}function Q(U){U=U.toLowerCase();if(E.exec[U]){return true}try{return B.getDoc().queryCommandSupported(U)}catch(T){}return false}function y(U,V,T){U=U.toLowerCase();E.state[U]=function(){return V.call(T||B)}}function z(U,V,T){U=U.toLowerCase();E.value[U]=function(){return V.call(T||B)}}function A(T){T=T.toLowerCase();return !!E.exec[T]}s(this,{execCommand:N,queryCommandState:D,queryCommandValue:K,queryCommandSupported:Q,addCommands:I,addCommand:H,addQueryStateHandler:y,addQueryValueHandler:z,hasCustomCommand:A});function C(V,U,T){if(U===g){U=q}if(T===g){T=null}return B.getDoc().execCommand(V,U,T)}function P(T){return L.match(T)}function R(T,U){L.toggle(T,U?{value:U}:g);B.nodeChanged()}function J(T){F=S.getBookmark(T)}function G(){S.moveToBookmark(F)}I({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){B.undoManager.add()},"Cut,Copy,Paste":function(X){var V=B.getDoc(),T;try{C(X)}catch(U){T=n}if(T||!V.queryCommandSupported(X)){var W=B.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");if(r.mac){W=W.replace(/Ctrl\+/g,"\u2318+")}B.windowManager.alert(W)}},unlink:function(){if(S.isCollapsed()){var T=S.getNode();if(T.tagName=="A"){B.dom.remove(T,true)}return}L.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(T){var U=T.substring(7);if(U=="full"){U="justify"}v("left,center,right,justify".split(","),function(V){if(U!=V){L.remove("align"+V)}});R("align"+U);N("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(V){var T,U;C(V);T=M.getParent(S.getNode(),"ol,ul");if(T){U=T.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(U.nodeName)){J();M.split(U,T);G()}}},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(T){R(T)},"ForeColor,HiliteColor,FontName":function(V,U,T){R(V,T)},FontSize:function(W,V,U){var T,X;if(U>=1&&U<=7){X=u(O.font_size_style_values);T=u(O.font_size_classes);if(T){U=T[U-1]||U}else{U=X[U-1]||U}}R(W,U)},RemoveFormat:function(T){L.remove(T)},mceBlockQuote:function(){R("blockquote")},FormatBlock:function(V,U,T){return R(T||"p")},mceCleanup:function(){var T=S.getBookmark();B.setContent(B.getContent({cleanup:n}),{cleanup:n});S.moveToBookmark(T)},mceRemoveNode:function(W,V,U){var T=U||S.getNode();if(T!=B.getBody()){J();B.dom.remove(T,n);G()}},mceSelectNodeDepth:function(W,V,U){var T=0;M.getParent(S.getNode(),function(X){if(X.nodeType==1&&T++==U){S.select(X);return q}},B.getBody())},mceSelectNode:function(V,U,T){S.select(T)},mceInsertContent:function(Y,aj,ak){var X,an,ac,ao,U,W;var ab,aa,al,T,ae,Z;var ah=B.schema.getTextInlineElements();function am(au){var at,ar,av;at=S.getRng(true);ar=at.startContainer;av=at.startOffset;function aq(aw){return ar[aw]&&ar[aw].nodeType==3}if(ar.nodeType==3){if(av>0){au=au.replace(/^&nbsp;/," ")}else{if(!aq("previousSibling")){au=au.replace(/^ /,"&nbsp;")}}if(av<ar.length){au=au.replace(/&nbsp;(<br>|)$/," ")}else{if(!aq("nextSibling")){au=au.replace(/(&nbsp;| )(<br>|)$/,"&nbsp;")}}}return au}function V(){var ar,aq,at;ar=S.getRng(true);aq=ar.startContainer;at=ar.startOffset;if(aq.nodeType==3&&ar.collapsed){if(aq.data[at]==="\u00a0"){aq.deleteData(at,1);if(!/[\u00a0| ]$/.test(ak)){ak+=" "}}else{if(aq.data[at-1]==="\u00a0"){aq.deleteData(at-1,1);if(!/[\u00a0| ]$/.test(ak)){ak=" "+ak}}}}}function ad(aq){if(Z){for(al=aq.firstChild;al;al=al.walk(true)){if(ah[al.name]){al.attr("data-mce-new","true")}}}}function ap(){if(Z){var aq=B.getBody(),ar=new k(M);v(M.select("*[data-mce-new]"),function(au){au.removeAttribute("data-mce-new");for(var at=au.parentNode;at&&at!=aq;at=at.parentNode){if(ar.compare(at,au)){M.remove(au,true)}}})}}if(typeof ak!="string"){Z=ak.merge;ak=ak.content}if(/^ | $/.test(ak)){ak=am(ak)}X=B.parser;an=new t({},B.schema);ae='<span id="mce_marker" data-mce-type="bookmark">&#xFEFF;&#x200B;</span>';W={content:ak,format:"html",selection:true};B.fire("BeforeSetContent",W);ak=W.content;if(ak.indexOf("{$caret}")==-1){ak+="{$caret}"}ak=ak.replace(/\{\$caret\}/,ae);aa=S.getRng();var ai=aa.startContainer||(aa.parentElement?aa.parentElement():null);var af=B.getBody();if(ai===af&&S.isCollapsed()){if(M.isBlock(af.firstChild)&&M.isEmpty(af.firstChild)){aa=M.createRng();aa.setStart(af.firstChild,0);aa.setEnd(af.firstChild,0);S.setRng(aa)}}if(!S.isCollapsed()){B.getDoc().execCommand("Delete",false,null);V()}ac=S.getNode();var ag={context:ac.nodeName.toLowerCase()};U=X.parse(ak,ag);ad(U);al=U.lastChild;if(al.attr("id")=="mce_marker"){ab=al;for(al=al.prev;al;al=al.walk(true)){if(al.type==3||!M.isBlock(al.name)){if(B.schema.isValidChild(al.parent.name,"span")){al.parent.insert(ab,al,al.name==="br")}break}}}if(!ag.invalid){ak=an.serialize(U);al=ac.firstChild;T=ac.lastChild;if(!al||(al===T&&al.nodeName==="BR")){M.setHTML(ac,ak)}else{S.setContent(ak)}}else{S.setContent(ae);ac=S.getNode();ao=B.getBody();if(ac.nodeType==9){ac=al=ao}else{al=ac}while(al!==ao){ac=al;al=al.parentNode}ak=ac==ao?ao.innerHTML:M.getOuterHTML(ac);ak=an.serialize(X.parse(ak.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return an.serialize(U)})));if(ac==ao){M.setHTML(ao,ak)}else{M.setOuterHTML(ac,ak)}}ap();ab=M.get("mce_marker");S.scrollIntoView(ab);aa=M.createRng();al=ab.previousSibling;if(al&&al.nodeType==3){aa.setStart(al,al.nodeValue.length);if(!l){T=ab.nextSibling;if(T&&T.nodeType==3){al.appendData(T.data);T.parentNode.removeChild(T)}}}else{aa.setStartBefore(ab);aa.setEndBefore(ab)}M.remove(ab);S.setRng(aa);B.fire("SetContent",W);B.addVisual()},mceInsertRawHTML:function(V,U,T){S.setContent("tiny_mce_marker");B.setContent(B.getContent().replace(/tiny_mce_marker/g,function(){return T}))},mceToggleFormat:function(V,U,T){R(T)},mceSetContent:function(V,U,T){B.setContent(T)},"Indent,Outdent":function(W){var U,T,V;U=O.indentation;T=/[a-z%]+$/i.exec(U);U=parseInt(U,10);if(!D("InsertUnorderedList")&&!D("InsertOrderedList")){if(!O.forced_root_block&&!M.getParent(S.getNode(),M.isBlock)){L.apply("div")}v(S.getSelectedBlocks(),function(Y){if(Y.nodeName!="LI"){var X=B.getParam("indent_use_margin",false)?"margin":"padding";X+=M.getStyle(Y,"direction",true)=="rtl"?"Right":"Left";if(W=="outdent"){V=Math.max(0,parseInt(Y.style[X]||0,10)-U);M.setStyle(Y,X,V?V+T:"")}else{V=(parseInt(Y.style[X]||0,10)+U)+T;M.setStyle(Y,X,V)}}})}else{C(W)}},mceRepaint:function(){if(i){try{J(n);if(S.getSel()){S.getSel().selectAllChildren(B.getBody())}S.collapse(n);G()}catch(T){}}},InsertHorizontalRule:function(){B.execCommand("mceInsertContent",false,"<hr />")},mceToggleVisualAid:function(){B.hasVisual=!B.hasVisual;B.addVisual()},mceReplaceContent:function(V,U,T){B.execCommand("mceInsertContent",false,T.replace(/\{\$selection\}/g,S.getContent({format:"text"})))},mceInsertLink:function(W,V,U){var T;if(typeof U=="string"){U={href:U}}T=M.getParent(S.getNode(),"a");U.href=U.href.replace(" ","%20");if(!T||!U.href){L.remove("link")}if(U.href){L.apply("link",U,T)}},selectAll:function(){var U=M.getRoot(),T;if(S.getRng().setStart){T=M.createRng();T.setStart(U,0);T.setEnd(U,U.childNodes.length);S.setRng(T)}else{T=S.getRng();if(!T.item){T.moveToElementText(U);T.select()}}},"delete":function(){C("Delete");var T=B.getBody();if(M.isEmpty(T)){B.setContent("");if(T.firstChild&&M.isBlock(T.firstChild)){B.selection.setCursorLocation(T.firstChild,0)}else{B.selection.setCursorLocation(T,0)}}},mceNewDocument:function(){B.setContent("")},InsertLineBreak:function(V,af,ah){var ae=ah;var T,ac,aa;var Z=S.getRng(true);new p(M).normalize(Z);var Y=Z.startOffset;var ad=Z.startContainer;if(ad.nodeType==1&&ad.hasChildNodes()){var ai=Y>ad.childNodes.length-1;ad=ad.childNodes[Math.min(Y,ad.childNodes.length-1)]||ad;if(ai&&ad.nodeType==3){Y=ad.nodeValue.length}else{Y=0}}var W=M.getParent(ad,M.isBlock);var X=W?W.nodeName.toUpperCase():"";var U=W?M.getParent(W.parentNode,M.isBlock):null;var aj=U?U.nodeName.toUpperCase():"";var ag=ae&&ae.ctrlKey;if(aj=="LI"&&!ag){W=U;X=aj}function ab(){var an=new w(ad,W),am;var al=B.schema.getNonEmptyElements();while((am=an.next())){if(al[am.nodeName.toLowerCase()]||am.length>0){return true}}}if(ad&&ad.nodeType==3&&Y>=ad.nodeValue.length){if(!o&&!ab()){T=M.create("br");Z.insertNode(T);Z.setStartAfter(T);Z.setEndAfter(T);ac=true}}T=M.create("br");Z.insertNode(T);var ak=M.doc.documentMode;if(o&&X=="PRE"&&(!ak||ak<8)){T.parentNode.insertBefore(M.doc.createTextNode("\r"),T)}aa=M.create("span",{},"&nbsp;");T.parentNode.insertBefore(aa,T);S.scrollIntoView(aa);M.remove(aa);if(!ac){Z.setStartAfter(T);Z.setEndAfter(T)}else{Z.setStartBefore(T);Z.setEndBefore(T)}S.setRng(Z);B.undoManager.add();return n}});I({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(W){var U="align"+W.substring(7);var T=S.isCollapsed()?[M.getParent(S.getNode(),M.isBlock)]:S.getSelectedBlocks();var V=j(T,function(X){return !!L.matchNode(X,U)});return x(V,n)!==-1},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(T){return P(T)},mceBlockQuote:function(){return P("blockquote")},Outdent:function(){var T;if(O.inline_styles){if((T=M.getParent(S.getStart(),M.isBlock))&&parseInt(T.style.paddingLeft,10)>0){return n}if((T=M.getParent(S.getEnd(),M.isBlock))&&parseInt(T.style.paddingLeft,10)>0){return n}}return(D("InsertUnorderedList")||D("InsertOrderedList")||(!O.inline_styles&&!!M.getParent(S.getNode(),"BLOCKQUOTE")))},"InsertUnorderedList,InsertOrderedList":function(U){var T=M.getParent(S.getNode(),"ul,ol");return T&&(U==="insertunorderedlist"&&T.tagName==="UL"||U==="insertorderedlist"&&T.tagName==="OL")}},"state");I({"FontSize,FontName":function(V){var U=0,T;if((T=M.getParent(S.getNode(),"span"))){if(V=="fontsize"){U=T.style.fontSize}else{U=T.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return U}},"value");I({Undo:function(){B.undoManager.undo()},Redo:function(){B.undoManager.redo()}})}});h("tinymce/util/URI",["tinymce/util/Tools"],function(k){var n=k.each,i=k.trim;var l="source protocol authority userInfo user password host port relative path directory file query anchor".split(" ");var m={ftp:21,http:80,https:443,mailto:25};function j(q,r){var p=this,t,s;q=i(q);r=p.settings=r||{};t=r.base_uri;if(/^([\w\-]+):([^\/]{2})/i.test(q)||/^\s*#/.test(q)){p.source=q;return}var o=q.indexOf("//")===0;if(q.indexOf("/")===0&&!o){q=(t?t.protocol||"http":"http")+"://mce_host"+q}if(!/^[\w\-]*:?\/\//.test(q)){s=r.base_uri?r.base_uri.path:new j(location.href).directory;if(r.base_uri.protocol===""){q="//mce_host"+p.toAbsPath(s,q)}else{q=/([^#?]*)([#?]?.*)/.exec(q);q=((t&&t.protocol)||"http")+"://mce_host"+p.toAbsPath(s,q[1])+q[2]}}q=q.replace(/@@/g,"(mce_at)");q=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(q);n(l,function(u,x){var w=q[x];if(w){w=w.replace(/\(mce_at\)/g,"@@")}p[u]=w});if(t){if(!p.protocol){p.protocol=t.protocol}if(!p.userInfo){p.userInfo=t.userInfo}if(!p.port&&p.host==="mce_host"){p.port=t.port}if(!p.host||p.host==="mce_host"){p.host=t.host}p.source=""}if(o){p.protocol=""}}j.prototype={setPath:function(p){var o=this;p=/^(.*?)\/?(\w+)?$/.exec(p);o.path=p[0];o.directory=p[1];o.file=p[2];o.source="";o.getURI()},toRelative:function(s){var p=this,o;if(s==="./"){return s}s=new j(s,{base_uri:p});if((s.host!="mce_host"&&p.host!=s.host&&s.host)||p.port!=s.port||(p.protocol!=s.protocol&&s.protocol!=="")){return s.getURI()}var q=p.getURI(),r=s.getURI();if(q==r||(q.charAt(q.length-1)=="/"&&q.substr(0,q.length-1)==r)){return q}o=p.toRelPath(p.path,s.path);if(s.query){o+="?"+s.query}if(s.anchor){o+="#"+s.anchor}return o},toAbsolute:function(p,o){p=new j(p,{base_uri:this});return p.getURI(o&&this.isSameOrigin(p))},isSameOrigin:function(o){if(this.host==o.host&&this.protocol==o.protocol){if(this.port==o.port){return true}var p=m[this.protocol];if(p&&((this.port||p)==(o.port||p))){return true}}return false},toRelPath:function(t,u){var p,s=0,q="",r,o;t=t.substring(0,t.lastIndexOf("/"));t=t.split("/");p=u.split("/");if(t.length>=p.length){for(r=0,o=t.length;r<o;r++){if(r>=p.length||t[r]!=p[r]){s=r+1;break}}}if(t.length<p.length){for(r=0,o=p.length;r<o;r++){if(r>=t.length||t[r]!=p[r]){s=r+1;break}}}if(s===1){return u}for(r=0,o=t.length-(s-1);r<o;r++){q+="../"}for(r=s-1,o=p.length;r<o;r++){if(r!=s-1){q+="/"+p[r]}else{q+=p[r]}}return q},toAbsPath:function(s,t){var q,p=0,v=[],r,u;r=/\/$/.test(t)?"/":"";s=s.split("/");t=t.split("/");n(s,function(o){if(o){v.push(o)}});s=v;for(q=t.length-1,v=[];q>=0;q--){if(t[q].length===0||t[q]==="."){continue}if(t[q]===".."){p++;continue}if(p>0){p--;continue}v.push(t[q])}q=s.length-p;if(q<=0){u=v.reverse().join("/")}else{u=s.slice(0,q).join("/")+"/"+v.reverse().join("/")}if(u.indexOf("/")!==0){u="/"+u}if(r&&u.lastIndexOf("/")!==u.length-1){u+=r}return u},getURI:function(q){var p,o=this;if(!o.source||q){p="";if(!q){if(o.protocol){p+=o.protocol+"://"}else{p+="//"}if(o.userInfo){p+=o.userInfo+"@"}if(o.host){p+=o.host}if(o.port){p+=":"+o.port}}if(o.path){p+=o.path}if(o.query){p+="?"+o.query}if(o.anchor){p+="#"+o.anchor}o.source=p}return o.source}};return j});h("tinymce/util/Class",["tinymce/util/Tools"],function(l){var m=l.each,n=l.extend;var k,j;function i(){}i.extend=k=function(o){var w=this,v=w.prototype,u,p,t;function q(){var A,x,z,y=this;if(!j){if(y.init){y.init.apply(y,arguments)}x=y.Mixins;if(x){A=x.length;while(A--){z=x[A];if(z.init){z.init.apply(y,arguments)}}}}}function r(){return this}function s(x,y){return function(){var z=this,B=z._super,A;z._super=v[x];A=y.apply(z,arguments);z._super=B;return A}}j=true;u=new w();j=false;if(o.Mixins){m(o.Mixins,function(x){x=x;for(var y in x){if(y!=="init"){o[y]=x[y]}}});if(v.Mixins){o.Mixins=v.Mixins.concat(o.Mixins)}}if(o.Methods){m(o.Methods.split(","),function(x){o[x]=r})}if(o.Properties){m(o.Properties.split(","),function(x){var y="_"+x;o[x]=function(B){var z=this,A;if(B!==A){z[y]=B;return z}return z[y]}})}if(o.Statics){m(o.Statics,function(y,x){q[x]=y})}if(o.Defaults&&v.Defaults){o.Defaults=n({},v.Defaults,o.Defaults)}for(p in o){t=o[p];if(typeof t=="function"&&v[p]){u[p]=s(p,t)}else{u[p]=t}}q.prototype=u;q.constructor=q;q.extend=k;return q};return i});h("tinymce/util/EventDispatcher",["tinymce/util/Tools"],function(j){var k=j.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchend"," ");function i(q){var w=this,v,m={},t;function o(){return false}function r(){return true}q=q||{};v=q.scope||w;t=q.toggleEvent||o;function n(A,z){var y,B,x,C;A=A.toLowerCase();z=z||{};z.type=A;if(!z.target){z.target=v}if(!z.preventDefault){z.preventDefault=function(){z.isDefaultPrevented=r};z.stopPropagation=function(){z.isPropagationStopped=r};z.stopImmediatePropagation=function(){z.isImmediatePropagationStopped=r};z.isDefaultPrevented=o;z.isPropagationStopped=o;z.isImmediatePropagationStopped=o}if(q.beforeFire){q.beforeFire(z)}y=m[A];if(y){for(B=0,x=y.length;B<x;B++){C=y[B];if(C.once){p(A,C.func)}if(z.isImmediatePropagationStopped()){z.stopPropagation();return z}if(C.func.call(v,z)===false){z.preventDefault();return z}}}return z}function s(A,D,z,x){var y,C,B;if(D===false){D=o}if(D){D={func:D};if(x){j.extend(D,x)}C=A.toLowerCase().split(" ");B=C.length;while(B--){A=C[B];y=m[A];if(!y){y=m[A]=[];t(A,true)}if(z){y.unshift(D)}else{y.push(D)}}}return w}function p(z,D){var A,x,B,C,y;if(z){C=z.toLowerCase().split(" ");A=C.length;while(A--){z=C[A];x=m[z];if(!z){for(B in m){t(B,false);delete m[B]}return w}if(x){if(!D){x.length=0}else{y=x.length;while(y--){if(x[y].func===D){x=x.slice(0,y).concat(x.slice(y+1));m[z]=x}}}if(!x.length){t(z,false);delete m[z]}}}}else{for(z in m){t(z,false)}m={}}return w}function l(y,z,x){return s(y,z,x,{once:true})}function u(x){x=x.toLowerCase();return !(!m[x]||m[x].length===0)}w.fire=n;w.on=s;w.off=p;w.once=l;w.has=u}i.isNative=function(l){return !!k[l.toLowerCase()]};return i});h("tinymce/ui/Selector",["tinymce/util/Class"],function(k){function o(s){var p=[],q=s.length,r;while(q--){r=s[q];if(!r.__checked){p.push(r);r.__checked=1}}q=p.length;while(q--){delete p[q].__checked}return p}var n=/^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i;var i=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,m=/^\s*|\s*$/g,l;var j=k.extend({init:function(q){var s=this.match;function r(y){if(y){y=y.toLowerCase();return function(z){return y==="*"||z.type===y}}}function w(y){if(y){return function(z){return z._name===y}}}function t(y){if(y){y=y.split(".");return function(A){var z=y.length;while(z--){if(!A.hasClass(y[z])){return false}}return true}}}function p(z,A,y){if(z){return function(B){var C=B[z]?B[z]():"";return !A?!!y:A==="="?C===y:A==="*="?C.indexOf(y)>=0:A==="~="?(" "+C+" ").indexOf(" "+y+" ")>=0:A==="!="?C!=y:A==="^="?C.indexOf(y)===0:A==="$="?C.substr(C.length-y.length)===y:false}}}function v(y){var z;if(y){y=/(?:not\((.+)\))|(.+)/i.exec(y);if(!y[1]){y=y[2];return function(C,A,B){return y==="first"?A===0:y==="last"?A===B-1:y==="even"?A%2===0:y==="odd"?A%2===1:C[y]?C[y]():false}}else{z=u(y[1],[]);return function(A){return !s(A,z)}}}}function x(y,z,C){var B;function A(D){if(D){z.push(D)}}B=n.exec(y.replace(m,""));A(r(B[1]));A(w(B[2]));A(t(B[3]));A(p(B[4],B[5],B[6]));A(v(B[7]));z.psuedo=!!B[7];z.direct=C;return z}function u(z,B){var D=[],y,C,A;do{i.exec("");C=i.exec(z);if(C){z=C[3];D.push(C[1]);if(C[2]){y=C[3];break}}}while(C);if(y){u(y,B)}z=[];for(A=0;A<D.length;A++){if(D[A]!=">"){z.push(x(D[A],[],D[A-1]===">"))}}B.push(z);return B}this._selectors=u(q,[])},match:function(u,B){var v,r,w,s,t,D,A,q,y,p,z,x,C;B=B||this._selectors;for(v=0,r=B.length;v<r;v++){t=B[v];s=t.length;C=u;x=0;for(w=s-1;w>=0;w--){q=t[w];while(C){if(q.psuedo){z=C.parent().items();y=p=z.length;while(y--){if(z[y]===C){break}}}for(D=0,A=q.length;D<A;D++){if(!q[D](C,y,p)){D=A+1;break}}if(D===A){x++;break}else{if(w===s-1){break}}C=C.parent()}}if(x===s){return true}}return false},find:function(q){var u=[],s,p,r=this._selectors;function t(A,x,z){var y,w,C,B,D,v=x[z];for(y=0,w=A.length;y<w;y++){D=A[y];for(C=0,B=v.length;C<B;C++){if(!v[C](D,y,w)){C=B+1;break}}if(C===B){if(z==x.length-1){u.push(D)}else{if(D.items){t(D.items(),x,z+1)}}}else{if(v.direct){return}}if(D.items){t(D.items(),x,z)}}}if(q.items){for(s=0,p=r.length;s<p;s++){t(q.items(),r[s],0)}if(p>1){u=o(u)}}if(!l){l=j.Collection}return new l(u)}});return j});h("tinymce/ui/Collection",["tinymce/util/Tools","tinymce/ui/Selector","tinymce/util/Class"],function(l,i,j){var m,n,k=Array.prototype.push,o=Array.prototype.slice;n={length:0,init:function(p){if(p){this.add(p)}},add:function(q){var p=this;if(!l.isArray(q)){if(q instanceof m){p.add(q.toArray())}else{k.call(p,q)}}else{k.apply(p,q)}return p},set:function(r){var q=this,p=q.length,s;q.length=0;q.add(r);for(s=q.length;s<p;s++){delete q[s]}return q},filter:function(p){var r=this,t,q,v=[],u,s;if(typeof p==="string"){p=new i(p);s=function(w){return p.match(w)}}else{s=p}for(t=0,q=r.length;t<q;t++){u=r[t];if(s(u)){v.push(u)}}return new m(v)},slice:function(){return new m(o.apply(this,arguments))},eq:function(p){return p===-1?this.slice(p):this.slice(p,+p+1)},each:function(p){l.each(this,p);return this},toArray:function(){return l.toArray(this)},indexOf:function(r){var p=this,q=p.length;while(q--){if(p[q]===r){break}}return q},reverse:function(){return new m(l.toArray(this).reverse())},hasClass:function(p){return this[0]?this[0].hasClass(p):false},prop:function(q,t){var p=this,r,s;if(t!==r){p.each(function(u){if(u[q]){u[q](t)}});return p}s=p[0];if(s&&s[q]){return s[q]()}},exec:function(r){var p=this,q=l.toArray(arguments).slice(1);p.each(function(s){if(s[r]){s[r].apply(s,q)}});return p},remove:function(){var p=this.length;while(p--){this[p].remove()}return this}};l.each("fire on off show hide addClass removeClass append prepend before after reflow".split(" "),function(p){n[p]=function(){var q=l.toArray(arguments);this.each(function(r){if(p in r){r[p].apply(r,q)}});return this}});l.each("text name disabled active selected checked visible parent value data".split(" "),function(p){n[p]=function(q){return this.prop(p,q)}});m=j.extend(n);i.Collection=m;return m});h("tinymce/ui/DomUtils",["tinymce/util/Tools","tinymce/dom/DOMUtils"],function(i,k){var j=0;return{id:function(){return"mceu_"+(j++)},createFragment:function(l){return k.DOM.createFragment(l)},getWindowSize:function(){return k.DOM.getViewPort()},getSize:function(o){var m,l;if(o.getBoundingClientRect){var n=o.getBoundingClientRect();m=Math.max(n.width||(n.right-n.left),o.offsetWidth);l=Math.max(n.height||(n.bottom-n.bottom),o.offsetHeight)}else{m=o.offsetWidth;l=o.offsetHeight}return{width:m,height:l}},getPos:function(m,l){return k.DOM.getPos(m,l)},getViewPort:function(l){return k.DOM.getViewPort(l)},get:function(l){return document.getElementById(l)},addClass:function(m,l){return k.DOM.addClass(m,l)},removeClass:function(m,l){return k.DOM.removeClass(m,l)},hasClass:function(m,l){return k.DOM.hasClass(m,l)},toggleClass:function(n,l,m){return k.DOM.toggleClass(n,l,m)},css:function(n,l,m){return k.DOM.setStyle(n,l,m)},getRuntimeStyle:function(m,l){return k.DOM.getStyle(m,l,true)},on:function(n,l,o,m){return k.DOM.bind(n,l,o,m)},off:function(m,l,n){return k.DOM.unbind(m,l,n)},fire:function(n,m,l){return k.DOM.fire(n,m,l)},innerHtml:function(m,l){k.DOM.setHTML(m,l)}}});h("tinymce/ui/Control",["tinymce/util/Class","tinymce/util/Tools","tinymce/util/EventDispatcher","tinymce/ui/Collection","tinymce/ui/DomUtils"],function(j,o,m,p,i){var l="onmousewheel" in document;var n=false;var r="mce-";function q(s){if(!s._eventDispatcher){s._eventDispatcher=new m({scope:s,toggleEvent:function(t,u){if(u&&m.isNative(t)){if(!s._nativeEvents){s._nativeEvents={}}s._nativeEvents[t]=true;if(s._rendered){s.bindPendingEvents()}}}})}return s._eventDispatcher}var k=j.extend({Statics:{classPrefix:r},isRtl:function(){return k.rtl},classPrefix:r,init:function(v){var s=this,u,t;s.settings=v=o.extend({},s.Defaults,v);s._id=v.id||i.id();s._text=s._name="";s._width=s._height=0;s._aria={role:v.role};this._elmCache={};u=v.classes;if(u){u=u.split(" ");u.map={};t=u.length;while(t--){u.map[u[t]]=true}}s._classes=u||[];s.visible(true);o.each("title text width height name classes visible disabled active value".split(" "),function(w){var y=v[w],x;if(y!==x){s[w](y)}else{if(s["_"+w]===x){s["_"+w]=false}}});s.on("click",function(){if(s.disabled()){return false}});if(v.classes){o.each(v.classes.split(" "),function(w){s.addClass(w)})}s.settings=v;s._borderBox=s.parseBox(v.border);s._paddingBox=s.parseBox(v.padding);s._marginBox=s.parseBox(v.margin);if(v.hidden){s.hide()}},Properties:"parent,title,text,width,height,disabled,active,name,value",Methods:"renderHtml",getContainerElm:function(){return document.body},getParentCtrl:function(u){var s,t=this.getRoot().controlIdLookup;while(u&&t){s=t[u.id];if(s){break}u=u.parentNode}return s},parseBox:function(u){var s,t=10;if(!u){return}if(typeof u==="number"){u=u||0;return{top:u,left:u,bottom:u,right:u}}u=u.split(" ");s=u.length;if(s===1){u[1]=u[2]=u[3]=u[0]}else{if(s===2){u[2]=u[0];u[3]=u[1]}else{if(s===3){u[3]=u[1]}}}return{top:parseInt(u[0],t)||0,right:parseInt(u[1],t)||0,bottom:parseInt(u[2],t)||0,left:parseInt(u[3],t)||0}},borderBox:function(){return this._borderBox},paddingBox:function(){return this._paddingBox},marginBox:function(){return this._marginBox},measureBox:function(v,t){function s(w){var x=document.defaultView;if(x){w=w.replace(/[A-Z]/g,function(y){return"-"+y});return x.getComputedStyle(v,null).getPropertyValue(w)}return v.currentStyle[w]}function u(w){var x=parseFloat(s(w),10);return isNaN(x)?0:x}return{top:u(t+"TopWidth"),right:u(t+"RightWidth"),bottom:u(t+"BottomWidth"),left:u(t+"LeftWidth")}},initLayoutRect:function(){var I=this,A=I.settings,v,E;var C=I.getEl(),z,G,w,F,y;var s,u,H;v=I._borderBox=I._borderBox||I.measureBox(C,"border");I._paddingBox=I._paddingBox||I.measureBox(C,"padding");I._marginBox=I._marginBox||I.measureBox(C,"margin");H=i.getSize(C);s=A.minWidth;u=A.minHeight;w=s||H.width;F=u||H.height;z=A.width;G=A.height;y=A.autoResize;y=typeof y!="undefined"?y:!z&&!G;z=z||w;G=G||F;var B=v.left+v.right;var t=v.top+v.bottom;var x=A.maxWidth||65535;var D=A.maxHeight||65535;I._layoutRect=E={x:A.x||0,y:A.y||0,w:z,h:G,deltaW:B,deltaH:t,contentW:z-B,contentH:G-t,innerW:z-B,innerH:G-t,startMinWidth:s||0,startMinHeight:u||0,minW:Math.min(w,x),minH:Math.min(F,D),maxW:x,maxH:D,autoResize:y,scrollW:0};I._lastLayoutRect={};return E},layoutRect:function(t){var z=this,v=z._layoutRect,y,A,x,w,s,u;if(!v){v=z.initLayoutRect()}if(t){x=v.deltaW;w=v.deltaH;if(t.x!==s){v.x=t.x}if(t.y!==s){v.y=t.y}if(t.minW!==s){v.minW=t.minW}if(t.minH!==s){v.minH=t.minH}A=t.w;if(A!==s){A=A<v.minW?v.minW:A;A=A>v.maxW?v.maxW:A;v.w=A;v.innerW=A-x}A=t.h;if(A!==s){A=A<v.minH?v.minH:A;A=A>v.maxH?v.maxH:A;v.h=A;v.innerH=A-w}A=t.innerW;if(A!==s){A=A<v.minW-x?v.minW-x:A;A=A>v.maxW-x?v.maxW-x:A;v.innerW=A;v.w=A+x}A=t.innerH;if(A!==s){A=A<v.minH-w?v.minH-w:A;A=A>v.maxH-w?v.maxH-w:A;v.innerH=A;v.h=A+w}if(t.contentW!==s){v.contentW=t.contentW}if(t.contentH!==s){v.contentH=t.contentH}y=z._lastLayoutRect;if(y.x!==v.x||y.y!==v.y||y.w!==v.w||y.h!==v.h){u=k.repaintControls;if(u){if(u.map&&!u.map[z._id]){u.push(z);u.map[z._id]=true}}y.x=v.x;y.y=v.y;y.w=v.w;y.h=v.h}return z}return v},repaint:function(){var A=this,t,v,w,s,y=0,u=0,x,z;z=!document.createRange?Math.round:function(B){return B};t=A.getEl().style;w=A._layoutRect;x=A._lastRepaintRect||{};s=A._borderBox;y=s.left+s.right;u=s.top+s.bottom;if(w.x!==x.x){t.left=z(w.x)+"px";x.x=w.x}if(w.y!==x.y){t.top=z(w.y)+"px";x.y=w.y}if(w.w!==x.w){t.width=z(w.w-y)+"px";x.w=w.w}if(w.h!==x.h){t.height=z(w.h-u)+"px";x.h=w.h}if(A._hasBody&&w.innerW!==x.innerW){v=A.getEl("body").style;v.width=z(w.innerW)+"px";x.innerW=w.innerW}if(A._hasBody&&w.innerH!==x.innerH){v=v||A.getEl("body").style;v.height=z(w.innerH)+"px";x.innerH=w.innerH}A._lastRepaintRect=x;A.fire("repaint",{},false)},on:function(u,v){var t=this;function s(w){var y,x;if(typeof w!="string"){return w}return function(z){if(!y){t.parentsAndSelf().each(function(B){var A=B.settings.callbacks;if(A&&(y=A[w])){x=B;return false}})}return y.call(x,z)}}q(t).on(u,s(v));return t},off:function(s,t){q(this).off(s,t);return this},fire:function(v,u,s){var t=this;u=u||{};if(!u.control){u.control=t}u=q(t).fire(v,u);if(s!==false&&t.parent){var w=t.parent();while(w&&!u.isPropagationStopped()){w.fire(v,u,false);w=w.parent()}}return u},hasEventListeners:function(s){return q(this).has(s)},parents:function(s){var t=this,v,u=new p();for(v=t.parent();v;v=v.parent()){u.add(v)}if(s){u=u.filter(s)}return u},parentsAndSelf:function(s){return new p(this).add(this.parents(s))},next:function(){var s=this.parent().items();return s[s.indexOf(this)+1]},prev:function(){var s=this.parent().items();return s[s.indexOf(this)-1]},findCommonAncestor:function(s,u){var t;while(s){t=u;while(t&&s!=t){t=t.parent()}if(s==t){break}s=s.parent()}return s},hasClass:function(s,u){var t=this._classes[u||"control"];s=this.classPrefix+s;return t&&!!t.map[s]},addClass:function(s,v){var t=this,u,w;s=this.classPrefix+s;u=t._classes[v||"control"];if(!u){u=[];u.map={};t._classes[v||"control"]=u}if(!u.map[s]){u.map[s]=s;u.push(s);if(t._rendered){w=t.getEl(v);if(w){w.className=u.join(" ")}}}return t},removeClass:function(s,w){var t=this,v,u,x;s=this.classPrefix+s;v=t._classes[w||"control"];if(v&&v.map[s]){delete v.map[s];u=v.length;while(u--){if(v[u]===s){v.splice(u,1)}}}if(t._rendered){x=t.getEl(w);if(x){x.className=v.join(" ")}}return t},toggleClass:function(s,u,v){var t=this;if(u){t.addClass(s,v)}else{t.removeClass(s,v)}return t},classes:function(t){var s=this._classes[t||"control"];return s?s.join(" "):""},innerHtml:function(s){i.innerHtml(this.getEl(),s);return this},getEl:function(s){var t=s?this._id+"-"+s:this._id;if(!this._elmCache[t]){this._elmCache[t]=i.get(t)}return this._elmCache[t]},visible:function(u){var t=this,s;if(typeof u!=="undefined"){if(t._visible!==u){if(t._rendered){t.getEl().style.display=u?"":"none"}t._visible=u;s=t.parent();if(s){s._lastRect=null}t.fire(u?"show":"hide")}return t}return t._visible},show:function(){return this.visible(true)},hide:function(){return this.visible(false)},focus:function(){try{this.getEl().focus()}catch(s){}return this},blur:function(){this.getEl().blur();return this},aria:function(t,u){var s=this,v=s.getEl(s.ariaTarget);if(typeof u==="undefined"){return s._aria[t]}else{s._aria[t]=u}if(s._rendered){v.setAttribute(t=="role"?t:"aria-"+t,u)}return s},encode:function(t,s){if(s!==false){t=this.translate(t)}return(t||"").replace(/[&<>"]/g,function(u){return"&#"+u.charCodeAt(0)+";"})},translate:function(s){return k.translate?k.translate(s):s},before:function(t){var s=this,u=s.parent();if(u){u.insert(t,u.items().indexOf(s),true)}return s},after:function(t){var s=this,u=s.parent();if(u){u.insert(t,u.items().indexOf(s))}return s},remove:function(){var t=this,y=t.getEl(),w=t.parent(),u,v;if(t.items){var s=t.items().toArray();v=s.length;while(v--){s[v].remove()}}if(w&&w.items){u=[];w.items().each(function(z){if(z!==t){u.push(z)}});w.items().set(u);w._lastRect=null}if(t._eventsRoot&&t._eventsRoot==t){i.off(y)}var x=t.getRoot().controlIdLookup;if(x){delete x[t._id]}if(y&&y.parentNode){y.parentNode.removeChild(y)}t._rendered=false;return t},renderBefore:function(t){var s=this;t.parentNode.insertBefore(i.createFragment(s.renderHtml()),t);s.postRender();return s},renderTo:function(t){var s=this;t=t||s.getContainerElm();t.appendChild(i.createFragment(s.renderHtml()));s.postRender();return s},postRender:function(){var A=this,t=A.settings,v,u,y,s,x;for(s in t){if(s.indexOf("on")===0){A.on(s.substr(2),t[s])}}if(A._eventsRoot){for(y=A.parent();!x&&y;y=y.parent()){x=y._eventsRoot}if(x){for(s in x._nativeEvents){A._nativeEvents[s]=true}}}A.bindPendingEvents();if(t.style){v=A.getEl();if(v){v.setAttribute("style",t.style);v.style.cssText=t.style}}if(!A._visible){i.css(A.getEl(),"display","none")}if(A.settings.border){u=A.borderBox();i.css(A.getEl(),{"border-top-width":u.top,"border-right-width":u.right,"border-bottom-width":u.bottom,"border-left-width":u.left})}var w=A.getRoot();if(!w.controlIdLookup){w.controlIdLookup={}}w.controlIdLookup[A._id]=A;for(var z in A._aria){A.aria(z,A._aria[z])}A.fire("postrender",{},false)},scrollIntoView:function(u){function E(J,H){var F,I,G=J;F=I=0;while(G&&G!=H&&G.nodeType){F+=G.offsetLeft||0;I+=G.offsetTop||0;G=G.offsetParent}return{x:F,y:I}}var w=this.getEl(),v=w.parentNode;var B,A,s,D,C,t;var z=E(w,v);B=z.x;A=z.y;s=w.offsetWidth;D=w.offsetHeight;C=v.clientWidth;t=v.clientHeight;if(u=="end"){B-=C-s;A-=t-D}else{if(u=="center"){B-=(C/2)-(s/2);A-=(t/2)-(D/2)}}v.scrollLeft=B;v.scrollTop=A;return this},bindPendingEvents:function(){var D=this,x,v,B,u,z,t;function A(F){var E=D.getParentCtrl(F.target);if(E){E.fire(F.type,F)}}function w(){var E=u._lastHoverCtrl;if(E){E.fire("mouseleave",{target:E.getEl()});E.parents().each(function(F){F.fire("mouseleave",{target:F.getEl()})});u._lastHoverCtrl=null}}function C(J){var I=D.getParentCtrl(J.target),H=u._lastHoverCtrl,E=0,G,F,K;if(I!==H){u._lastHoverCtrl=I;F=I.parents().toArray().reverse();F.push(I);if(H){K=H.parents().toArray().reverse();K.push(H);for(E=0;E<K.length;E++){if(F[E]!==K[E]){break}}for(G=K.length-1;G>=E;G--){H=K[G];H.fire("mouseleave",{target:H.getEl()})}}for(G=E;G<F.length;G++){I=F[G];I.fire("mouseenter",{target:I.getEl()})}}}function s(E){E.preventDefault();if(E.type=="mousewheel"){E.deltaY=-1/40*E.wheelDelta;if(E.wheelDeltaX){E.deltaX=-1/40*E.wheelDeltaX}}else{E.deltaX=0;E.deltaY=E.detail}E=D.fire("wheel",E)}D._rendered=true;z=D._nativeEvents;if(z){B=D.parents().toArray();B.unshift(D);for(x=0,v=B.length;!u&&x<v;x++){u=B[x]._eventsRoot}if(!u){u=B[B.length-1]||D}D._eventsRoot=u;for(v=x,x=0;x<v;x++){B[x]._eventsRoot=u}var y=u._delegates;if(!y){y=u._delegates={}}for(t in z){if(!z){return false}if(t==="wheel"&&!n){if(l){i.on(D.getEl(),"mousewheel",s)}else{i.on(D.getEl(),"DOMMouseScroll",s)}continue}if(t==="mouseenter"||t==="mouseleave"){if(!u._hasMouseEnter){i.on(u.getEl(),"mouseleave",w);i.on(u.getEl(),"mouseover",C);u._hasMouseEnter=1}}else{if(!y[t]){i.on(u.getEl(),t,A);y[t]=true}}z[t]=false}}},getRoot:function(){var v=this,u,s=[];while(v){if(v.rootControl){u=v.rootControl;break}s.push(v);u=v;v=v.parent()}if(!u){u=this}var t=s.length;while(t--){s[t].rootControl=u}return u},reflow:function(){this.repaint();return this}});return k});h("tinymce/ui/Factory",[],function(){var i={},j;return{add:function(k,l){i[k.toLowerCase()]=l},has:function(k){return !!i[k.toLowerCase()]},create:function(o,n){var k,l,m;if(!j){m=tinymce.ui;for(l in m){i[l.toLowerCase()]=m[l]}j=true}if(typeof o=="string"){n=n||{};n.type=o}else{n=o;o=n.type}o=o.toLowerCase();k=i[o];if(!k){throw new Error("Could not find control by type: "+o)}k=new k(n);k.type=o;return k}}});h("tinymce/ui/KeyboardNavigation",[],function(){return function(A){var w=A.root,i,p;try{i=document.activeElement}catch(z){i=document.body}p=w.getParentCtrl(i);function t(E){E=E||i;return E&&E.getAttribute("role")}function D(G){var F,E=G||i;while((E=E.parentNode)){if((F=t(E))){return F}}}function v(E){var F=i;if(F){return F.getAttribute("aria-"+E)}}function u(F){var E=F.tagName.toUpperCase();return E=="INPUT"||E=="TEXTAREA"}function j(E){if(u(E)&&!E.hidden){return true}if(/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell)$/.test(t(E))){return true}return false}function o(G){var F=[];function E(I){if(I.nodeType!=1||I.style.display=="none"){return}if(j(I)){F.push(I)}for(var H=0;H<I.childNodes.length;H++){E(I.childNodes[H])}}E(G||w.getEl());return F}function n(H){var F,E;H=H||p;E=H.parents().toArray();E.unshift(H);for(var G=0;G<E.length;G++){F=E[G];if(F.settings.ariaRoot){break}}return F}function x(G){var E=n(G);var F=o(E.getEl());if(E.settings.ariaRemember&&"lastAriaIndex" in E){r(E.lastAriaIndex,F)}else{r(0,F)}}function r(E,F){if(E<0){E=F.length-1}else{if(E>=F.length){E=0}}if(F[E]){F[E].focus()}return E}function C(G,I){var E=-1,F=n();I=I||o(F.getEl());for(var H=0;H<I.length;H++){if(I[H]===i){E=H}}E+=G;F.lastAriaIndex=r(E,I)}function m(){var E=D();if(E=="tablist"){C(-1,o(i.parentNode))}else{if(p.parent().submenu){l()}else{C(-1)}}}function B(){var F=t(),E=D();if(E=="tablist"){C(1,o(i.parentNode))}else{if(F=="menuitem"&&E=="menu"&&v("haspopup")){y()}else{C(1)}}}function q(){C(-1)}function s(){var F=t(),E=D();if(F=="menuitem"&&E=="menubar"){y()}else{if(F=="button"&&v("haspopup")){y({key:"down"})}else{C(1)}}}function k(F){var E=D();if(E=="tablist"){var G=o(p.getEl("body"))[0];if(G){G.focus()}}else{C(F.shiftKey?-1:1)}}function l(){p.fire("cancel")}function y(E){E=E||{};p.fire("click",{target:i,aria:E})}w.on("keydown",function(F){function E(H,G){if(u(i)){return}if(G(H)!==false){H.preventDefault()}}if(F.isDefaultPrevented()){return}switch(F.keyCode){case 37:E(F,m);break;case 39:E(F,B);break;case 38:E(F,q);break;case 40:E(F,s);break;case 27:l();break;case 14:case 13:case 32:E(F,y);break;case 9:if(k(F)!==false){F.preventDefault()}break}});w.on("focusin",function(E){i=E.target;p=E.control});return{focusFirst:x}}});h("tinymce/ui/Container",["tinymce/ui/Control","tinymce/ui/Collection","tinymce/ui/Selector","tinymce/ui/Factory","tinymce/ui/KeyboardNavigation","tinymce/util/Tools","tinymce/ui/DomUtils"],function(p,o,k,i,n,m,j){var l={};return p.extend({layout:"",innerClass:"container-inner",init:function(r){var q=this;q._super(r);r=q.settings;q._fixed=r.fixed;q._items=new o();if(q.isRtl()){q.addClass("rtl")}q.addClass("container");q.addClass("container-body","body");if(r.containerCls){q.addClass(r.containerCls)}q._layout=i.create((r.layout||q.layout)+"layout");if(q.settings.items){q.add(q.settings.items)}q._hasBody=true},items:function(){return this._items},find:function(q){q=l[q]=l[q]||new k(q);return q.find(this)},add:function(r){var q=this;q.items().add(q.create(r)).parent(q);return q},focus:function(q){var s=this,u,t,r;if(q){t=s.keyboardNav||s.parents().eq(-1)[0].keyboardNav;if(t){t.focusFirst(s);return}}r=s.find("*");if(s.statusbar){r.add(s.statusbar.items())}r.each(function(v){if(v.settings.autofocus){u=null;return false}if(v.canFocus){u=u||v}});if(u){u.focus()}return s},replace:function(u,t){var s,q=this.items(),r=q.length;while(r--){if(q[r]===u){q[r]=t;break}}if(r>=0){s=t.getEl();if(s){s.parentNode.removeChild(s)}s=u.getEl();if(s){s.parentNode.removeChild(s)}}t.parent(this)},create:function(r){var q=this,t,s=[];if(!m.isArray(r)){r=[r]}m.each(r,function(u){if(u){if(!(u instanceof p)){if(typeof u=="string"){u={type:u}}t=m.extend({},q.settings.defaults,u);u.type=t.type=t.type||u.type||q.settings.defaultType||(t.defaults?t.defaults.type:null);u=i.create(t)}s.push(u)}});return s},renderNew:function(){var q=this;q.items().each(function(t,s){var u,r;t.parent(q);if(!t._rendered){u=q.getEl("body");r=j.createFragment(t.renderHtml());if(u.hasChildNodes()&&s<=u.childNodes.length-1){u.insertBefore(r,u.childNodes[s])}else{u.appendChild(r)}t.postRender()}});q._layout.applyClasses(q);q._lastRect=null;return q},append:function(q){return this.add(q).renderNew()},prepend:function(r){var q=this;q.items().set(q.create(r).concat(q.items().toArray()));return q.renderNew()},insert:function(s,u,w){var r=this,t,q,v;s=r.create(s);t=r.items();if(!w&&u<t.length-1){u+=1}if(u>=0&&u<t.length){q=t.slice(0,u).toArray();v=t.slice(u).toArray();t.set(q.concat(s,v))}return r.renderNew()},fromJSON:function(s){var q=this;for(var r in s){q.find("#"+r).value(s[r])}return q},toJSON:function(){var q=this,r={};q.find("*").each(function(u){var s=u.name(),t=u.value();if(s&&typeof t!="undefined"){r[s]=t}});return r},preRender:function(){},renderHtml:function(){var q=this,r=q._layout,s=this.settings.role;q.preRender();r.preRender(q);return('<div id="'+q._id+'" class="'+q.classes()+'"'+(s?' role="'+this.settings.role+'"':"")+'><div id="'+q._id+'-body" class="'+q.classes("body")+'">'+(q.settings.html||"")+r.renderHtml(q)+"</div></div>")},postRender:function(){var q=this,r;q.items().exec("postRender");q._super();q._layout.postRender(q);q._rendered=true;if(q.settings.style){j.css(q.getEl(),q.settings.style)}if(q.settings.border){r=q.borderBox();j.css(q.getEl(),{"border-top-width":r.top,"border-right-width":r.right,"border-bottom-width":r.bottom,"border-left-width":r.left})}if(!q.parent()){q.keyboardNav=new n({root:q})}return q},initLayoutRect:function(){var q=this,r=q._super();q._layout.recalc(q);return r},recalc:function(){var q=this,s=q._layoutRect,r=q._lastRect;if(!r||r.w!=s.w||r.h!=s.h){q._layout.recalc(q);s=q.layoutRect();q._lastRect={x:s.x,y:s.y,w:s.w,h:s.h};return true}},reflow:function(){var q;if(this.visible()){p.repaintControls=[];p.repaintControls.map={};this.recalc();q=p.repaintControls.length;while(q--){p.repaintControls[q].repaint()}if(this.settings.layout!=="flow"&&this.settings.layout!=="stack"){this.repaint()}p.repaintControls=[]}return this}})});h("tinymce/ui/DragHelper",["tinymce/ui/DomUtils"],function(i){function j(){var r=document,s,n,l,q;var o,t,m,k,p=Math.max;s=r.documentElement;n=r.body;l=p(s.scrollWidth,n.scrollWidth);q=p(s.clientWidth,n.clientWidth);o=p(s.offsetWidth,n.offsetWidth);t=p(s.scrollHeight,n.scrollHeight);m=p(s.clientHeight,n.clientHeight);k=p(s.offsetHeight,n.offsetHeight);return{width:l<o?q:l,height:t<k?m:t}}return function(l,n){var u,t=document,k,m,s,q,p,o;n=n||{};function r(){return t.getElementById(n.handle||l)}m=function(w){var y=j(),v,x;w.preventDefault();k=w.button;v=r();p=w.screenX;o=w.screenY;if(window.getComputedStyle){x=window.getComputedStyle(v,null).getPropertyValue("cursor")}else{x=v.runtimeStyle.cursor}u=t.createElement("div");i.css(u,{position:"absolute",top:0,left:0,width:y.width,height:y.height,zIndex:2147483647,opacity:0.0001,cursor:x});t.body.appendChild(u);i.on(t,"mousemove",q);i.on(t,"mouseup",s);n.start(w)};q=function(v){if(v.button!==k){return s(v)}v.deltaX=v.screenX-p;v.deltaY=v.screenY-o;v.preventDefault();n.drag(v)};s=function(v){i.off(t,"mousemove",q);i.off(t,"mouseup",s);u.parentNode.removeChild(u);if(n.stop){n.stop(v)}};this.destroy=function(){i.off(r())};i.on(r(),"mousedown",m)}});h("tinymce/ui/Scrollable",["tinymce/ui/DomUtils","tinymce/ui/DragHelper"],function(i,j){return{init:function(){var k=this;k.on("repaint",k.renderScroll)},renderScroll:function(){var l=this,m=2;function n(){var r,q,p;function o(w,v,y,E,D,u){var x,B,A;var t,s,z,C;var F,G;B=l.getEl("scroll"+w);if(B){F=v.toLowerCase();G=y.toLowerCase();if(l.getEl("absend")){i.css(l.getEl("absend"),F,l.layoutRect()[E]-1)}if(!D){i.css(B,"display","none");return}i.css(B,"display","block");x=l.getEl("body");A=l.getEl("scroll"+w+"t");t=x["client"+y]-(m*2);t-=r&&q?B["client"+u]:0;s=x["scroll"+y];z=t/s;C={};C[F]=x["offset"+v]+m;C[G]=t;i.css(B,C);C={};C[F]=x["scroll"+v]*z;C[G]=t*z;i.css(A,C)}}p=l.getEl("body");r=p.scrollWidth>p.clientWidth;q=p.scrollHeight>p.clientHeight;o("h","Left","Width","contentW",r,"Height");o("v","Top","Height","contentH",q,"Width")}function k(){function o(v,r,p,w,t){var u,q=l._id+"-scroll"+v,s=l.classPrefix;l.getEl().appendChild(i.createFragment('<div id="'+q+'" class="'+s+"scrollbar "+s+"scrollbar-"+v+'"><div id="'+q+'t" class="'+s+'scrollbar-thumb"></div></div>'));l.draghelper=new j(q+"t",{start:function(){u=l.getEl("body")["scroll"+r];i.addClass(i.get(q),s+"active")},drag:function(A){var x,C,z,B,y=l.layoutRect();C=y.contentW>y.innerW;z=y.contentH>y.innerH;B=l.getEl("body")["client"+p]-(m*2);B-=C&&z?l.getEl("scroll"+v)["client"+t]:0;x=B/l.getEl("body")["scroll"+p];l.getEl("body")["scroll"+r]=u+(A["delta"+w]/x)},stop:function(){i.removeClass(i.get(q),s+"active")}})}l.addClass("scroll");o("v","Top","Height","Y","Width");o("h","Left","Width","X","Height")}if(l.settings.autoScroll){if(!l._hasScroll){l._hasScroll=true;k();l.on("wheel",function(p){var o=l.getEl("body");o.scrollLeft+=(p.deltaX||0)*10;o.scrollTop+=p.deltaY*10;n()});i.on(l.getEl("body"),"scroll",n)}n()}}}});h("tinymce/ui/Panel",["tinymce/ui/Container","tinymce/ui/Scrollable"],function(j,i){return j.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[i],renderHtml:function(){var l=this,m=l._layout,k=l.settings.html;l.preRender();m.preRender(l);if(typeof k=="undefined"){k=('<div id="'+l._id+'-body" class="'+l.classes("body")+'">'+m.renderHtml(l)+"</div>")}else{if(typeof k=="function"){k=k.call(l)}l._hasBody=false}return('<div id="'+l._id+'" class="'+l.classes()+'" hidefocus="1" tabindex="-1" role="group">'+(l._preBodyHtml||"")+k+"</div>")}})});h("tinymce/ui/Movable",["tinymce/ui/DomUtils"],function(i){function j(k,s,v){var u,o,r,p,t,m,q,l,n,w;n=i.getViewPort();o=i.getPos(s);r=o.x;p=o.y;if(k._fixed&&i.getRuntimeStyle(document.body,"position")=="static"){r-=n.x;p-=n.y}u=k.getEl();w=i.getSize(u);t=w.width;m=w.height;w=i.getSize(s);q=w.width;l=w.height;v=(v||"").split("");if(v[0]==="b"){p+=l}if(v[1]==="r"){r+=q}if(v[0]==="c"){p+=Math.round(l/2)}if(v[1]==="c"){r+=Math.round(q/2)}if(v[3]==="b"){p-=m}if(v[4]==="r"){r-=t}if(v[3]==="c"){p-=Math.round(m/2)}if(v[4]==="c"){r-=Math.round(t/2)}return{x:r,y:p,w:t,h:m}}return{testMoveRel:function(o,l){var k=i.getViewPort();for(var m=0;m<l.length;m++){var n=j(this,o,l[m]);if(this._fixed){if(n.x>0&&n.x+n.w<k.w&&n.y>0&&n.y+n.h<k.h){return l[m]}}else{if(n.x>k.x&&n.x+n.w<k.w+k.x&&n.y>k.y&&n.y+n.h<k.h+k.y){return l[m]}}}return l[0]},moveRel:function(m,k){if(typeof k!="string"){k=this.testMoveRel(m,k)}var l=j(this,m,k);return this.moveTo(l.x,l.y)},moveBy:function(m,k){var l=this,n=l.layoutRect();l.moveTo(n.x+m,n.y+k);return l},moveTo:function(k,p){var m=this;function l(s,q,r){if(s<0){return 0}if(s+r>q){s=q-r;return s<0?0:s}return s}if(m.settings.constrainToViewport){var n=i.getViewPort(window);var o=m.layoutRect();k=l(k,n.w+n.x,o.w);p=l(p,n.h+n.y,o.h)}if(m._rendered){m.layoutRect({x:k,y:p}).repaint()}else{m.settings.x=k;m.settings.y=p}m.fire("move",{x:k,y:p});return m}}});h("tinymce/ui/Resizable",["tinymce/ui/DomUtils"],function(i){return{resizeToContent:function(){this._layoutRect.autoResize=true;this._lastRect=null;this.reflow()},resizeTo:function(j,k){if(j<=1||k<=1){var l=i.getWindowSize();j=j<=1?j*l.w:j;k=k<=1?k*l.h:k}this._layoutRect.autoResize=false;return this.layoutRect({minW:j,minH:k,w:j,h:k}).reflow()},resizeBy:function(k,m){var j=this,l=j.layoutRect();return j.resizeTo(l.w+k,l.h+m)}}});h("tinymce/ui/FloatPanel",["tinymce/ui/Panel","tinymce/ui/Movable","tinymce/ui/Resizable","tinymce/ui/DomUtils"],function(w,t,k,i){var q,l,j,x=[];var o=[],y;function u(){function z(B,A){while(B){if(B==A){return true}B=B.parent()}}if(!q){q=function(D){if(D.button==2){return}var C=x.length;while(C--){var B=x[C],A=B.getParentCtrl(D.target);if(B.settings.autohide){if(A){if(z(A,B)||B.parent()===A){continue}}D=B.fire("autohide",{target:D.target});if(!D.isDefaultPrevented()){B.hide()}}}};i.on(document,"click",q)}}function n(){if(!l){l=function(){var z;z=x.length;while(z--){p(x[z])}};i.on(window,"scroll",l)}}function m(){if(!j){var A=document.documentElement,B=A.clientWidth,z=A.clientHeight;j=function(){if(!document.all||B!=A.clientWidth||z!=A.clientHeight){B=A.clientWidth;z=A.clientHeight;r.hideAll()}};i.on(window,"resize",j)}}function p(z){var A=i.getViewPort().y;function B(F,C){var E;for(var D=0;D<x.length;D++){if(x[D]!=z){E=x[D].parent();while(E&&(E=E.parent())){if(E==z){x[D].fixed(F).moveBy(0,C).repaint()}}}}}if(z.settings.autofix){if(!z._fixed){z._autoFixY=z.layoutRect().y;if(z._autoFixY<A){z.fixed(true).layoutRect({y:0}).repaint();B(true,A-z._autoFixY)}}else{if(z._autoFixY>A){z.fixed(false).layoutRect({y:z._autoFixY}).repaint();B(false,z._autoFixY-A)}}}}function v(D,B){var z,E=r.zIndex||65535,A;if(D){o.push(B)}else{z=o.length;while(z--){if(o[z]===B){o.splice(z,1)}}}if(o.length){for(z=0;z<o.length;z++){if(o[z].modal){E++;A=o[z]}o[z].getEl().style.zIndex=E;o[z].zIndex=E;E++}}var C=document.getElementById(B.classPrefix+"modal-block");if(A){i.css(C,"z-index",A.zIndex-1)}else{if(C){C.parentNode.removeChild(C);y=false}}r.currentZIndex=E}var r=w.extend({Mixins:[t,k],init:function(A){var z=this;z._super(A);z._eventsRoot=z;z.addClass("floatpanel");if(A.autohide){u();m();x.push(z)}if(A.autofix){n();z.on("move",function(){p(this)})}z.on("postrender show",function(D){if(D.control==z){var C,B=z.classPrefix;if(z.modal&&!y){C=i.createFragment('<div id="'+B+'modal-block" class="'+B+"reset "+B+'fade"></div>');C=C.firstChild;z.getContainerElm().appendChild(C);setTimeout(function(){i.addClass(C,B+"in");i.addClass(z.getEl(),B+"in")},0);y=true}v(true,z)}});z.on("show",function(){z.parents().each(function(B){if(B._fixed){z.fixed(true);return false}})});if(A.popover){z._preBodyHtml='<div class="'+z.classPrefix+'arrow"></div>';z.addClass("popover").addClass("bottom").addClass(z.isRtl()?"end":"start")}},fixed:function(B){var A=this;if(A._fixed!=B){if(A._rendered){var z=i.getViewPort();if(B){A.layoutRect().y-=z.y}else{A.layoutRect().y+=z.y}}A.toggleClass("fixed",B);A._fixed=B}return A},show:function(){var z=this,A,B=z._super();A=x.length;while(A--){if(x[A]===z){break}}if(A===-1){x.push(z)}return B},hide:function(){s(this);v(false,this);return this._super()},hideAll:function(){r.hideAll()},close:function(){var z=this;if(!z.fire("close").isDefaultPrevented()){z.remove();v(false,z)}return z},remove:function(){s(this);this._super()},postRender:function(){var z=this;if(z.settings.bodyRole){this.getEl("body").setAttribute("role",z.settings.bodyRole)}return z._super()}});r.hideAll=function(){var A=x.length;while(A--){var z=x[A];if(z&&z.settings.autohide){z.hide();x.splice(A,1)}}};function s(z){var A;A=x.length;while(A--){if(x[A]===z){x.splice(A,1)}}A=o.length;while(A--){if(o[A]===z){o.splice(A,1)}}}return r});h("tinymce/ui/Window",["tinymce/ui/FloatPanel","tinymce/ui/Panel","tinymce/ui/DomUtils","tinymce/ui/DragHelper"],function(m,l,i,k){var j=m.extend({modal:true,Defaults:{border:1,layout:"flex",containerCls:"panel",role:"dialog",callbacks:{submit:function(){this.fire("submit",{data:this.toJSON()})},close:function(){this.close()}}},init:function(o){var n=this;n._super(o);if(n.isRtl()){n.addClass("rtl")}n.addClass("window");n._fixed=true;if(o.buttons){n.statusbar=new l({layout:"flex",border:"1 0 0 0",spacing:3,padding:10,align:"center",pack:n.isRtl()?"start":"end",defaults:{type:"button"},items:o.buttons});n.statusbar.addClass("foot");n.statusbar.parent(n)}n.on("click",function(p){if(p.target.className.indexOf(n.classPrefix+"close")!=-1){n.close()}});n.on("cancel",function(){n.close()});n.aria("describedby",n.describedBy||n._id+"-none");n.aria("label",o.title);n._fullscreen=false},recalc:function(){var o=this,r=o.statusbar,q,p,n,s;if(o._fullscreen){o.layoutRect(i.getWindowSize());o.layoutRect().contentH=o.layoutRect().innerH}o._super();q=o.layoutRect();if(o.settings.title&&!o._fullscreen){p=q.headerW;if(p>q.w){n=q.x-Math.max(0,p/2);o.layoutRect({w:p,x:n});s=true}}if(r){r.layoutRect({w:o.layoutRect().innerW}).recalc();p=r.layoutRect().minW+q.deltaW;if(p>q.w){n=q.x-Math.max(0,p-q.w);o.layoutRect({w:p,x:n});s=true}}if(s){o.recalc()}},initLayoutRect:function(){var n=this,r=n._super(),q=0,s;if(n.settings.title&&!n._fullscreen){s=n.getEl("head");var o=i.getSize(s);r.headerW=o.width;r.headerH=o.height;q+=r.headerH}if(n.statusbar){q+=n.statusbar.layoutRect().h}r.deltaH+=q;r.minH+=q;r.h+=q;var p=i.getWindowSize();r.x=Math.max(0,p.w/2-r.w/2);r.y=Math.max(0,p.h/2-r.h/2);return r},renderHtml:function(){var o=this,r=o._layout,u=o._id,s=o.classPrefix;var q=o.settings,n="",t="",p=q.html;o.preRender();r.preRender(o);if(q.title){n=('<div id="'+u+'-head" class="'+s+'window-head"><div id="'+u+'-title" class="'+s+'title">'+o.encode(q.title)+'</div><button type="button" class="'+s+'close" aria-hidden="true">\u00d7</button><div id="'+u+'-dragh" class="'+s+'dragh"></div></div>')}if(q.url){p='<iframe src="'+q.url+'" tabindex="-1"></iframe>'}if(typeof p=="undefined"){p=r.renderHtml(o)}if(o.statusbar){t=o.statusbar.renderHtml()}return('<div id="'+u+'" class="'+o.classes()+'" hidefocus="1"><div class="'+o.classPrefix+'reset" role="application">'+n+'<div id="'+u+'-body" class="'+o.classes("body")+'">'+p+"</div>"+t+"</div></div>")},fullscreen:function(t){var n=this,s=document.documentElement,o,r=n.classPrefix,q;if(t!=n._fullscreen){i.on(window,"resize",function(){var v;if(n._fullscreen){if(!o){v=new Date().getTime();var u=i.getWindowSize();n.moveTo(0,0).resizeTo(u.w,u.h);if((new Date().getTime())-v>50){o=true}}else{if(!n._timer){n._timer=setTimeout(function(){var w=i.getWindowSize();n.moveTo(0,0).resizeTo(w.w,w.h);n._timer=0},50)}}}});q=n.layoutRect();n._fullscreen=t;if(!t){n._borderBox=n.parseBox(n.settings.border);n.getEl("head").style.display="";q.deltaH+=q.headerH;i.removeClass(s,r+"fullscreen");i.removeClass(document.body,r+"fullscreen");n.removeClass("fullscreen");n.moveTo(n._initial.x,n._initial.y).resizeTo(n._initial.w,n._initial.h)}else{n._initial={x:q.x,y:q.y,w:q.w,h:q.h};n._borderBox=n.parseBox("0");n.getEl("head").style.display="none";q.deltaH-=q.headerH+2;i.addClass(s,r+"fullscreen");i.addClass(document.body,r+"fullscreen");n.addClass("fullscreen");var p=i.getWindowSize();n.moveTo(0,0).resizeTo(p.w,p.h)}}return n.reflow()},postRender:function(){var n=this,o;setTimeout(function(){n.addClass("in")},0);n._super();if(n.statusbar){n.statusbar.postRender()}n.focus();this.dragHelper=new k(n._id+"-dragh",{start:function(){o={x:n.layoutRect().x,y:n.layoutRect().y}},drag:function(p){n.moveTo(o.x+p.deltaX,o.y+p.deltaY)}});n.on("submit",function(p){if(!p.isDefaultPrevented()){n.close()}})},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var n=this,o=n.classPrefix;n.dragHelper.destroy();n._super();if(n.statusbar){this.statusbar.remove()}if(n._fullscreen){i.removeClass(document.documentElement,o+"fullscreen");i.removeClass(document.body,o+"fullscreen")}},getContentWindow:function(){var n=this.getEl().getElementsByTagName("iframe")[0];return n?n.contentWindow:null}});return j});h("tinymce/ui/MessageBox",["tinymce/ui/Window"],function(j){var i=j.extend({init:function(k){k={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:true,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:true,maxWidth:500,maxHeight:200}};this._super(k)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(l){var m,n=l.callback||function(){};function k(q,o,p){return{type:"button",text:q,subtype:p?"primary":"",onClick:function(r){r.control.parents()[1].close();n(o)}}}switch(l.buttons){case i.OK_CANCEL:m=[k("Ok",true,true),k("Cancel",false)];break;case i.YES_NO:case i.YES_NO_CANCEL:m=[k("Yes",1,true),k("No",0)];if(l.buttons==i.YES_NO_CANCEL){m.push(k("Cancel",-1))}break;default:m=[k("Ok",true,true)];break}return new j({padding:20,x:l.x,y:l.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:m,title:l.title,role:"alertdialog",items:{type:"label",multiline:true,maxWidth:500,maxHeight:200,text:l.text},onPostRender:function(){this.aria("describedby",this.items()[0]._id)},onClose:l.onClose,onCancel:function(){n(false)}}).renderTo(document.body).reflow()},alert:function(k,l){if(typeof k=="string"){k={text:k}}k.callback=l;return i.msgBox(k)},confirm:function(k,l){if(typeof k=="string"){k={text:k}}k.callback=l;k.buttons=i.OK_CANCEL;return i.msgBox(k)}}});return i});h("tinymce/WindowManager",["tinymce/ui/Window","tinymce/ui/MessageBox"],function(j,i){return function(m){var l=this,n=[];function k(){if(n.length){return n[n.length-1]}}l.windows=n;m.on("remove",function(){var o=n.length;while(o--){n[o].close()}});l.open=function(o,q){var p;m.editorManager.setActive(m);o.title=o.title||" ";o.url=o.url||o.file;if(o.url){o.width=parseInt(o.width||320,10);o.height=parseInt(o.height||240,10)}if(o.body){o.items={defaults:o.defaults,type:o.bodyType||"form",items:o.body}}if(!o.url&&!o.buttons){o.buttons=[{text:"Ok",subtype:"primary",onclick:function(){p.find("form")[0].submit()}},{text:"Cancel",onclick:function(){p.close()}}]}p=new j(o);n.push(p);p.on("close",function(){var r=n.length;while(r--){if(n[r]===p){n.splice(r,1)}}if(!n.length){m.focus()}});if(o.data){p.on("postRender",function(){this.find("*").each(function(s){var r=s.name();if(r in o.data){s.value(o.data[r])}})})}p.features=o||{};p.params=q||{};if(n.length===1){m.nodeChanged()}return p.renderTo().reflow()};l.alert=function(p,q,o){i.alert(p,function(){if(q){q.call(o||this)}else{m.focus()}})};l.confirm=function(p,q,o){i.confirm(p,function(r){q.call(o||this,r)})};l.close=function(){if(k()){k().close()}};l.getParams=function(){return k()?k().params:null};l.setParams=function(o){if(k()){k().params=o}};l.getWindows=function(){return n}}});h("tinymce/util/Quirks",["tinymce/util/VK","tinymce/dom/RangeUtils","tinymce/dom/TreeWalker","tinymce/html/Node","tinymce/html/Entities","tinymce/Env","tinymce/util/Tools"],function(n,m,l,k,o,i,j){return function(p){var aj=j.each,W=p.$;var s=n.BACKSPACE,E=n.DELETE,r=p.dom,G=p.selection,an=p.settings,V=p.parser,L=p.serializer;var u=i.gecko,C=i.ie,ag=i.webkit;var ab="data:text/mce-internal,";var t=C?"Text":"URL";function aa(au,at){try{p.getDoc().execCommand(au,false,at)}catch(ar){}}function J(){var ar=p.getDoc().documentMode;return ar?ar:6}function Z(ar){return ar.isDefaultPrevented()}function Q(at){var ar;if(at.dataTransfer){if(p.selection.isCollapsed()&&at.target.tagName=="IMG"){G.select(at.target)}ar=p.selection.getContent();if(ar.length>0){at.dataTransfer.setData(t,ab+escape(ar))}}}function K(at){var au,ar;if(at.dataTransfer){au=at.dataTransfer.getData(t);if(au&&au.indexOf(ab)>=0){ar=unescape(au.substr(ab.length))}}return ar}function R(ar){if(p.queryCommandSupported("mceInsertClipboardContent")){p.execCommand("mceInsertClipboardContent",false,{content:ar})}else{p.execCommand("mceInsertContent",false,ar)}}function ap(){var aD=p.getDoc(),ax=p.dom,aE=p.selection;var at=window.MutationObserver,ay,aC;if(!at){ay=true;at=function(){var aF=[],aI;function aH(aK){var aJ=aK.relatedNode||aK.target;aF.push({target:aJ,addedNodes:[aJ]})}function aG(aK){var aJ=aK.relatedNode||aK.target;aF.push({target:aJ,attributeName:aK.attrName})}this.observe=function(aJ){aI=aJ;aI.addEventListener("DOMSubtreeModified",aH,false);aI.addEventListener("DOMNodeInsertedIntoDocument",aH,false);aI.addEventListener("DOMNodeInserted",aH,false);aI.addEventListener("DOMAttrModified",aG,false)};this.disconnect=function(){aI.removeEventListener("DOMSubtreeModified",aH,false);aI.removeEventListener("DOMNodeInsertedIntoDocument",aH,false);aI.removeEventListener("DOMNodeInserted",aH,false);aI.removeEventListener("DOMAttrModified",aG,false)};this.takeRecords=function(){return aF}}}function ar(aH){var aG=ax.schema.getBlockElements(),aF=p.getBody();if(aH.nodeName!="BR"){return false}for(aH=aH;aH!=aF&&!aG[aH.nodeName];aH=aH.parentNode){if(aH.nextSibling){return false}}return true}function au(aG,aF){var aH;for(aH=aG.nextSibling;aH&&aH!=aF;aH=aH.nextSibling){if(aH.nodeType==3&&W.trim(aH.data).length===0){continue}if(aH!==aF){return false}}return aH===aF}function az(aI,aH,aG){var aK,aJ,aF;aF=ax.schema.getNonEmptyElements();aK=new l(aG||aI,aI);while((aJ=aK[aH?"next":"prev"]())){if(aF[aJ.nodeName]&&!ar(aJ)){return aJ}if(aJ.nodeType==3&&aJ.data.length>0){return aJ}}}function aB(aG){var aJ,aH,aF,aI,aK;if(aG.collapsed){return}aJ=ax.getParent(m.getNode(aG.startContainer,aG.startOffset),ax.isBlock);aH=ax.getParent(m.getNode(aG.endContainer,aG.endOffset),ax.isBlock);aK=p.schema.getTextBlockElements();if(aJ==aH){return}if(!aK[aJ.nodeName]||!aK[aH.nodeName]){return}if(ax.getContentEditable(aJ)==="false"||ax.getContentEditable(aH)==="false"){return}aG.deleteContents();aF=az(aJ,false);aI=az(aH,true);if(!ax.isEmpty(aH)){W(aJ).append(aH.childNodes)}W(aH).remove();if(aF){if(aF.nodeType==1){if(aF.nodeName=="BR"){aG.setStartBefore(aF);aG.setEndBefore(aF)}else{aG.setStartAfter(aF);aG.setEndAfter(aF)}}else{aG.setStart(aF,aF.data.length);aG.setEnd(aF,aF.data.length)}}else{if(aI){if(aI.nodeType==1){aG.setStartBefore(aI);aG.setEndBefore(aI)}else{aG.setStart(aI,0);aG.setEnd(aI,0)}}}aE.setRng(aG);return true}function aw(aG,aL){var aI,aK,aH,aJ,aF,aM;if(!aG.collapsed){return aG}aF=aG.startContainer;aM=aG.startOffset;if(aF.nodeType==3){if(aL){if(aM<aF.data.length){return aG}}else{if(aM>0){return aG}}}aI=m.getNode(aG.startContainer,aG.startOffset);aH=ax.getParent(aI,ax.isBlock);aK=az(p.getBody(),aL,aI);aJ=ax.getParent(aK,ax.isBlock);if(!aI||!aK){return aG}if(aJ&&aH!=aJ){if(!aL){if(!au(aJ,aH)){return aG}if(aK.nodeType==1){if(aK.nodeName=="BR"){aG.setStartBefore(aK)}else{aG.setStartAfter(aK)}}else{aG.setStart(aK,aK.data.length)}if(aI.nodeType==1){aG.setEnd(aI,0)}else{aG.setEndBefore(aI)}}else{if(!au(aH,aJ)){return aG}if(aI.nodeType==1){if(aI.nodeName=="BR"){aG.setStartBefore(aI)}else{aG.setStartAfter(aI)}}else{aG.setStart(aI,aI.data.length)}if(aK.nodeType==1){aG.setEnd(aK,0)}else{aG.setEndBefore(aK)}}}return aG}function av(aG){var aF=aE.getRng();aF=aw(aF,aG);if(aB(aF)){return true}}function aA(aH){var aG,aF,aI;if(av(aH)){return}j.each(p.getBody().getElementsByTagName("*"),function(aJ){if(aJ.tagName=="SPAN"){aJ.setAttribute("mce-data-marked",1)}if(!aJ.hasAttribute("data-mce-style")&&aJ.hasAttribute("style")){p.dom.setAttrib(aJ,"style",p.dom.getAttrib(aJ,"style"))}});aG=new at(function(){});aG.observe(p.getDoc(),{childList:true,attributes:true,subtree:true,attributeFilter:["style"]});p.getDoc().execCommand(aH?"ForwardDelete":"Delete",false,null);aF=p.selection.getRng();aI=aF.startContainer.parentNode;j.each(aG.takeRecords(),function(aJ){if(!ax.isChildOf(aJ.target,p.getBody())){return}if(aJ.attributeName=="style"){var aK=aJ.target.getAttribute("data-mce-style");if(aK){aJ.target.setAttribute("style",aK)}else{aJ.target.removeAttribute("style")}}j.each(aJ.addedNodes,function(aM){if(aM.nodeName=="SPAN"&&!aM.getAttribute("mce-data-marked")){var aN,aL;if(aM==aI){aN=aF.startOffset;aL=aM.firstChild}ax.remove(aM,true);if(aL){aF.setStart(aL,aN);aF.setEnd(aL,aN);p.selection.setRng(aF)}}})});aG.disconnect();j.each(p.dom.select("span[mce-data-marked]"),function(aJ){aJ.removeAttribute("mce-data-marked")})}p.on("keydown",function(aJ){var aI=aJ.keyCode==E,aF=aJ.ctrlKey||aJ.metaKey;if(!Z(aJ)&&(aI||aJ.keyCode==s)){var aH=p.selection.getRng(),aG=aH.startContainer,aK=aH.startOffset;if(!aF&&aH.collapsed&&aG.nodeType==3){if(aI?aK<aG.data.length:aK>0){return}}aJ.preventDefault();if(aF){p.selection.getSel().modify("extend",aI?"forward":"backward",aJ.metaKey?"lineboundary":"word")}aA(aI)}});p.on("keypress",function(aK){if(!Z(aK)&&!aE.isCollapsed()&&aK.charCode&&!n.metaKeyPressed(aK)){var aF,aL,aJ,aG,aH,aI;aF=p.selection.getRng();aI=String.fromCharCode(aK.charCode);aK.preventDefault();aL=W(aF.startContainer).parents().filter(function(aM,aN){return !!p.schema.getTextInlineElements()[aN.nodeName]});aA(true);aL=aL.filter(function(aM,aN){return !W.contains(p.getBody(),aN)});if(aL.length){aJ=ax.createFragment();aL.each(function(aM,aN){aN=aN.cloneNode(false);if(aJ.hasChildNodes()){aN.appendChild(aJ.firstChild);aJ.appendChild(aN)}else{aH=aN;aJ.appendChild(aN)}aJ.appendChild(aN)});aH.appendChild(p.getDoc().createTextNode(aI));aG=ax.getParent(aF.startContainer,ax.isBlock);if(ax.isEmpty(aG)){W(aG).empty().append(aJ)}else{aF.insertNode(aJ)}aF.setStart(aH.firstChild,1);aF.setEnd(aH.firstChild,1);p.selection.setRng(aF)}else{p.selection.setContent(aI)}}});p.addCommand("Delete",function(){aA()});p.addCommand("ForwardDelete",function(){aA(true)});if(ay){return}p.on("dragstart",function(aF){aC=aE.getRng();Q(aF)});p.on("drop",function(aF){if(!Z(aF)){var aG=K(aF);if(aG){aF.preventDefault();window.setTimeout(function(){var aH=m.getCaretRangeFromPoint(aF.x,aF.y,aD);if(aC){aE.setRng(aC);aC=null}aA();aE.setRng(aH);R(aG)},0)}}});p.on("cut",function(aF){if(!Z(aF)&&aF.clipboardData){aF.preventDefault();aF.clipboardData.clearData();aF.clipboardData.setData("text/html",p.selection.getContent());aF.clipboardData.setData("text/plain",p.selection.getContent({format:"text"}));aA(true)}})}function P(){function ar(av){var au=r.create("body");var aw=av.cloneContents();au.appendChild(aw);return G.serializer.serialize(au,{format:"html"})}function at(au){if(!au.setStart){if(au.item){return false}var ay=au.duplicate();ay.moveToElementText(p.getBody());return m.compareRanges(au,ay)}var aw=ar(au);var ax=r.createRng();ax.selectNode(p.getBody());var av=ar(ax);return aw===av}p.on("keydown",function(ax){var aw=ax.keyCode,av,au;if(!Z(ax)&&(aw==E||aw==s)){av=p.selection.isCollapsed();au=p.getBody();if(av&&!r.isEmpty(au)){return}if(!av&&!at(p.selection.getRng())){return}ax.preventDefault();p.setContent("");if(au.firstChild&&r.isBlock(au.firstChild)){p.selection.setCursorLocation(au.firstChild,0)}else{p.selection.setCursorLocation(au,0)}p.nodeChanged()}})}function ao(){p.shortcuts.add("meta+a",null,"SelectAll")}function aq(){if(!p.settings.content_editable){r.bind(p.getDoc(),"focusin",function(){G.setRng(G.getRng())});r.bind(p.getDoc(),"mousedown mouseup",function(ar){if(ar.target==p.getDoc().documentElement){p.getBody().focus();if(ar.type=="mousedown"){G.placeCaretAt(ar.clientX,ar.clientY)}else{G.setRng(G.getRng())}}})}}function ad(){p.on("keydown",function(au){if(!Z(au)&&au.keyCode===s){if(!p.getBody().getElementsByTagName("hr").length){return}if(G.isCollapsed()&&G.getRng(true).startOffset===0){var at=G.getNode();var ar=at.previousSibling;if(at.nodeName=="HR"){r.remove(at);au.preventDefault();return}if(ar&&ar.nodeName&&ar.nodeName.toLowerCase()==="hr"){r.remove(ar);au.preventDefault()}}}})}function Y(){if(!window.Range.prototype.getClientRects){p.on("mousedown",function(at){if(!Z(at)&&at.target.nodeName==="HTML"){var ar=p.getBody();ar.blur();setTimeout(function(){ar.focus()},0)}})}}function x(){p.on("click",function(at){var ar=at.target;if(/^(IMG|HR)$/.test(ar.nodeName)){at.preventDefault();G.getSel().setBaseAndExtent(ar,0,ar,1);p.nodeChanged()}if(ar.nodeName=="A"&&r.hasClass(ar,"mce-item-anchor")){at.preventDefault();G.select(ar)}})}function ak(){function at(){var au=r.getAttribs(G.getStart().cloneNode(false));return function(){var av=G.getStart();if(av!==p.getBody()){r.setAttrib(av,"style",null);aj(au,function(aw){av.setAttributeNode(aw.cloneNode(true))})}}}function ar(){return !G.isCollapsed()&&r.getParent(G.getStart(),r.isBlock)!=r.getParent(G.getEnd(),r.isBlock)}p.on("keypress",function(av){var au;if(!Z(av)&&(av.keyCode==8||av.keyCode==46)&&ar()){au=at();p.getDoc().execCommand("delete",false,null);au();av.preventDefault();return false}});r.bind(p.getDoc(),"cut",function(av){var au;if(!Z(av)&&ar()){au=at();setTimeout(function(){au()},0)}})}function X(){document.body.setAttribute("role","application")}function U(){p.on("keydown",function(at){if(!Z(at)&&at.keyCode===s){if(G.isCollapsed()&&G.getRng(true).startOffset===0){var ar=G.getNode().previousSibling;if(ar&&ar.nodeName&&ar.nodeName.toLowerCase()==="table"){at.preventDefault();return false}}}})}function ah(){if(J()>7){return}aa("RespectVisibilityInDesign",true);p.contentStyles.push(".mceHideBrInPre pre br {display: none}");r.addClass(p.getBody(),"mceHideBrInPre");V.addNodeFilter("pre",function(ar){var au=ar.length,aw,at,ax,av;while(au--){aw=ar[au].getAll("br");at=aw.length;while(at--){ax=aw[at];av=ax.prev;if(av&&av.type===3&&av.value.charAt(av.value-1)!="\n"){av.value+="\n"}else{ax.parent.insert(new k("#text",3),ax,true).value="\n"}}}});L.addNodeFilter("pre",function(ar){var au=ar.length,aw,at,ax,av;while(au--){aw=ar[au].getAll("br");at=aw.length;while(at--){ax=aw[at];av=ax.prev;if(av&&av.type==3){av.value=av.value.replace(/\r?\n$/,"")}}}})}function w(){r.bind(p.getBody(),"mouseup",function(){var at,ar=G.getNode();if(ar.nodeName=="IMG"){if((at=r.getStyle(ar,"width"))){r.setAttrib(ar,"width",at.replace(/[^0-9%]+/g,""));r.setStyle(ar,"width","")}if((at=r.getStyle(ar,"height"))){r.setAttrib(ar,"height",at.replace(/[^0-9%]+/g,""));r.setStyle(ar,"height","")}}})}function am(){p.on("keydown",function(aw){var au,at,ax,ar,av;if(Z(aw)||aw.keyCode!=n.BACKSPACE){return}au=G.getRng();at=au.startContainer;ax=au.startOffset;ar=r.getRoot();av=at;if(!au.collapsed||ax!==0){return}while(av&&av.parentNode&&av.parentNode.firstChild==av&&av.parentNode!=ar){av=av.parentNode}if(av.tagName==="BLOCKQUOTE"){p.formatter.toggle("blockquote",null,av);au=r.createRng();au.setStart(at,0);au.setEnd(at,0);G.setRng(au)}})}function al(){function ar(){p._refreshContentEditable();aa("StyleWithCSS",false);aa("enableInlineTableEditing",false);if(!an.object_resizing){aa("enableObjectResizing",false)}}if(!an.readonly){p.on("BeforeExecCommand MouseDown",ar)}}function T(){function ar(){aj(r.select("a"),function(av){var at=av.parentNode,au=r.getRoot();if(at.lastChild===av){while(at&&!r.isBlock(at)){if(at.parentNode.lastChild!==at||at===au){return}at=at.parentNode}r.add(at,"br",{"data-mce-bogus":1})}})}p.on("SetContent ExecCommand",function(at){if(at.type=="setcontent"||at.command==="mceInsertLink"){ar()}})}function H(){if(an.forced_root_block){p.on("init",function(){aa("DefaultParagraphSeparator",an.forced_root_block)})}}function N(){p.on("Undo Redo SetContent",function(ar){if(!ar.initial){p.execCommand("mceRepaint")}})}function y(){p.on("keydown",function(at){var ar;if(!Z(at)&&at.keyCode==s){ar=p.getDoc().selection.createRange();if(ar&&ar.item){at.preventDefault();p.undoManager.beforeChange();r.remove(ar.item(0));p.undoManager.add()}}})}function S(){var ar;if(J()>=10){ar="";aj("p div h1 h2 h3 h4 h5 h6".split(" "),function(at,au){ar+=(au>0?",":"")+at+":empty"});p.contentStyles.push(ar+"{padding-right: 1px !important}")}}function ai(){if(J()<9){V.addNodeFilter("noscript",function(ar){var at=ar.length,au,av;while(at--){au=ar[at];av=au.firstChild;if(av){au.attr("data-mce-innertext",av.value)}}});L.addNodeFilter("noscript",function(ar){var at=ar.length,au,aw,av;while(at--){au=ar[at];aw=ar[at].firstChild;if(aw){aw.value=o.decode(aw.value)}else{av=au.attributes.map["data-mce-innertext"];if(av){au.attr("data-mce-innertext",null);aw=new k("#text",3);aw.value=av;aw.raw=true;au.append(aw)}}}})}}function O(){var ay=r.doc,at=ay.body,av,aw,az;function ax(aA,aD){var aB=at.createTextRange();try{aB.moveToPoint(aA,aD)}catch(aC){aB=null}return aB}function au(aB){var aA;if(aB.button){aA=ax(aB.x,aB.y);if(aA){if(aA.compareEndPoints("StartToStart",aw)>0){aA.setEndPoint("StartToStart",aw)}else{aA.setEndPoint("EndToEnd",aw)}aA.select()}}else{ar()}}function ar(){var aA=ay.selection.createRange();if(aw&&!aA.item&&aA.compareEndPoints("StartToEnd",aA)===0){aw.select()}r.unbind(ay,"mouseup",ar);r.unbind(ay,"mousemove",au);aw=av=0}ay.documentElement.unselectable=true;r.bind(ay,"mousedown contextmenu",function(aA){if(aA.target.nodeName==="HTML"){if(av){ar()}az=ay.documentElement;if(az.scrollHeight>az.clientHeight){return}av=1;aw=ax(aA.x,aA.y);if(aw){r.bind(ay,"mouseup",ar);r.bind(ay,"mousemove",au);r.getRoot().focus();aw.select()}}})}function af(){p.on("keyup focusin mouseup",function(ar){if(ar.keyCode!=65||!n.metaKeyPressed(ar)){G.normalize()}},true)}function A(){p.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function B(){if(!p.inline){p.on("keydown",function(){if(document.activeElement==document.body){p.getWin().focus()}})}}function F(){if(!p.inline){p.contentStyles.push("body {min-height: 150px}");p.on("click",function(at){if(at.target.nodeName=="HTML"){var ar;ar=p.selection.getRng();p.getBody().focus();p.selection.setRng(ar);p.selection.normalize();p.nodeChanged()}})}}function D(){if(i.mac){p.on("keydown",function(ar){if(n.metaKeyPressed(ar)&&(ar.keyCode==37||ar.keyCode==39)){ar.preventDefault();p.selection.getSel().modify("move",ar.keyCode==37?"backward":"forward","lineboundary")}})}}function ac(){aa("AutoUrlDetect",false)}function I(){if(!p.inline){p.on("focus blur beforegetcontent",function(){var ar=p.dom.create("br");p.getBody().appendChild(ar);ar.parentNode.removeChild(ar)},true)}}function z(){p.on("click",function(ar){var at=ar.target;do{if(at.tagName==="A"){ar.preventDefault();return}}while((at=at.parentNode))});p.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")}function q(){p.on("touchstart",function(av){var aw,au,at,ar;aw=av.target;au=new Date().getTime();ar=av.changedTouches;if(!ar||ar.length>1){return}at=ar[0];p.once("touchend",function(az){var ay=az.changedTouches[0],ax;if(new Date().getTime()-au>500){return}if(Math.abs(at.clientX-ay.clientX)>5){return}if(Math.abs(at.clientY-ay.clientY)>5){return}ax={target:aw};aj("pageX pageY clientX clientY screenX screenY".split(" "),function(aA){ax[aA]=ay[aA]});ax=p.fire("click",ax);if(!ax.isDefaultPrevented()){p.selection.placeCaretAt(ay.clientX,ay.clientY);p.nodeChanged()}})})}function M(){p.on("init",function(){p.dom.bind(p.getBody(),"submit",function(ar){ar.preventDefault()})})}function ae(){V.addNodeFilter("br",function(ar){var at=ar.length;while(at--){if(ar[at].attr("class")=="Apple-interchange-newline"){ar[at].remove()}}})}function v(){p.on("dragstart",function(ar){Q(ar)});p.on("drop",function(at){if(!Z(at)){var au=K(at);if(au){at.preventDefault();var ar=m.getCaretRangeFromPoint(at.x,at.y,p.getDoc());G.setRng(ar);R(au)}}})}am();P();af();if(ag){ap();aq();x();H();M();U();ae();q();if(i.iOS){B();F();z()}else{ao()}}if(C&&i.ie<11){ad();X();ah();w();y();S();ai();O()}if(i.ie>=11){F();I();U()}if(i.ie){ao();ac();v()}if(u){ad();Y();ak();al();T();N();A();D();U()}}});h("tinymce/util/Observable",["tinymce/util/EventDispatcher"],function(j){function i(k){if(!k._eventDispatcher){k._eventDispatcher=new j({scope:k,toggleEvent:function(l,m){if(j.isNative(l)&&k.toggleNativeEvent){k.toggleNativeEvent(l,m)}}})}return k._eventDispatcher}return{fire:function(n,m,k){var l=this;if(l.removed&&n!=="remove"){return m}m=i(l).fire(n,m,k);if(k!==false&&l.parent){var o=l.parent();while(o&&!m.isPropagationStopped()){o.fire(n,m,false);o=o.parent()}}return m},on:function(l,m,k){return i(this).on(l,m,k)},off:function(k,l){return i(this).off(k,l)},once:function(k,l){return i(this).once(k,l)},hasEventListeners:function(k){return i(this).has(k)}}});h("tinymce/EditorObservable",["tinymce/util/Observable","tinymce/dom/DOMUtils","tinymce/util/Tools"],function(i,n,k){var l=n.DOM,j;function o(r,q){if(q=="selectionchange"){return r.getDoc()}if(!r.inline&&/^mouse|click|contextmenu|drop|dragover|dragend/.test(q)){return r.getDoc().documentElement}if(r.settings.event_root){if(!r.eventRoot){r.eventRoot=l.select(r.settings.event_root)[0]}return r.eventRoot}return r.getBody()}function m(s,q){var t=o(s,q),r;if(!s.delegates){s.delegates={}}if(s.delegates[q]){return}if(s.settings.event_root){if(!j){j={};s.editorManager.on("removeEditor",function(){var u;if(!s.editorManager.activeEditor){if(j){for(u in j){s.dom.unbind(o(s,u))}j=null}}})}if(j[q]){return}r=function(y){var x=y.target,w=s.editorManager.editors,v=w.length;while(v--){var u=w[v].getBody();if(u===x||l.isChildOf(x,u)){if(!w[v].hidden){w[v].fire(q,y)}}}};j[q]=r;l.bind(t,q,r)}else{r=function(u){if(!s.hidden){s.fire(q,u)}};l.bind(t,q,r);s.delegates[q]=r}}var p={bindPendingEventDelegates:function(){var q=this;k.each(q._pendingNativeEvents,function(r){m(q,r)})},toggleNativeEvent:function(r,s){var q=this;if(q.settings.readonly){return}if(r=="focus"||r=="blur"){return}if(s){if(q.initialized){m(q,r)}else{if(!q._pendingNativeEvents){q._pendingNativeEvents=[r]}else{q._pendingNativeEvents.push(r)}}}else{if(q.initialized){q.dom.unbind(o(q,r),r,q.delegates[r]);delete q.delegates[r]}}},unbindAllNativeEvents:function(){var q=this,r;if(q.delegates){for(r in q.delegates){q.dom.unbind(o(q,r),r,q.delegates[r])}delete q.delegates}if(!q.inline){q.getBody().onload=null;q.dom.unbind(q.getWin());q.dom.unbind(q.getDoc())}q.dom.unbind(q.getBody());q.dom.unbind(q.getContainer())}};p=k.extend({},i,p);return p});h("tinymce/Shortcuts",["tinymce/util/Tools","tinymce/Env"],function(k,j){var n=k.each,m=k.explode;var i={f9:120,f10:121,f11:122};var l=k.makeMap("alt,ctrl,shift,meta,access");return function(r){var q=this,o={};function p(w,x,v,u){var y,t,s;s={func:v,scope:u||r,desc:r.translate(x)};n(m(w,"+"),function(z){if(z in l){s[z]=true}else{if(/^[0-9]{2,}$/.test(z)){s.keyCode=parseInt(z,10)}else{s.charCode=z.charCodeAt(0);s.keyCode=i[z]||z.toUpperCase().charCodeAt(0)}}});y=[s.keyCode];for(t in l){if(s[t]){y.push(t)}else{s[t]=false}}s.id=y.join(",");if(s.access){s.alt=true;if(j.mac){s.ctrl=true}else{s.shift=true}}if(s.meta){if(j.mac){s.meta=true}else{s.ctrl=true;s.meta=false}}return s}r.on("keyup keypress keydown",function(s){if((s.altKey||s.ctrlKey||s.metaKey)&&!s.isDefaultPrevented()){n(o,function(t){if(t.ctrl!=s.ctrlKey||t.meta!=s.metaKey){return}if(t.alt!=s.altKey||t.shift!=s.shiftKey){return}if(s.keyCode==t.keyCode||(s.charCode&&s.charCode==t.charCode)){s.preventDefault();if(s.type=="keydown"){t.func.call(t.scope)}return true}})}});q.add=function(v,w,t,s){var u;u=t;if(typeof t==="string"){t=function(){r.execCommand(u,false,null)}}else{if(k.isArray(u)){t=function(){r.execCommand(u[0],u[1],u[2])}}}n(m(v.toLowerCase()),function(y){var x=p(y,w,t,s);o[x.id]=x});return true};q.remove=function(t){var s=p(t);if(o[s.id]){delete o[s.id];return true}return false}}});h("tinymce/Editor",["tinymce/dom/DOMUtils","tinymce/dom/DomQuery","tinymce/AddOnManager","tinymce/NodeChange","tinymce/html/Node","tinymce/dom/Serializer","tinymce/html/Serializer","tinymce/dom/Selection","tinymce/Formatter","tinymce/UndoManager","tinymce/EnterKey","tinymce/ForceBlocks","tinymce/EditorCommands","tinymce/util/URI","tinymce/dom/ScriptLoader","tinymce/dom/EventUtils","tinymce/WindowManager","tinymce/html/Schema","tinymce/html/DomParser","tinymce/util/Quirks","tinymce/Env","tinymce/util/Tools","tinymce/EditorObservable","tinymce/Shortcuts"],function(S,A,C,m,x,K,I,E,y,n,J,G,v,D,s,t,M,o,j,B,N,q,k,P){var z=S.DOM,O=C.ThemeManager,R=C.PluginManager;var p=q.extend,L=q.each,r=q.explode;var Q=q.inArray,i=q.trim,u=q.resolve;var H=t.Event;var l=N.gecko,F=N.ie;function w(Y,V,X){var U=this,T,W;T=U.documentBaseUrl=X.documentBaseURL;W=X.baseURI;U.settings=V=p({id:Y,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:T,add_form_submit_trigger:true,submit_patch:true,add_unload_trigger:true,convert_urls:true,relative_urls:true,remove_script_host:true,object_resizing:true,doctype:"<!DOCTYPE html>",visual:true,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%",forced_root_block:"p",hidden_input:true,padd_empty_editor:true,render_ui:true,indentation:"30px",inline_styles:true,convert_fonts_to_spans:true,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,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,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",validate:true,entity_encoding:"named",url_converter:U.convertURL,url_converter_scope:U,ie7_compat:true},V);C.language=V.language||"en";C.languageLoad=V.language_load;C.baseURL=X.baseURL;U.id=V.id=Y;U.isNotDirty=true;U.plugins={};U.documentBaseURI=new D(V.document_base_url||T,{base_uri:W});U.baseURI=W;U.contentCSS=[];U.contentStyles=[];U.shortcuts=new P(U);U.loadedCSS={};U.editorCommands=new v(U);if(V.target){U.targetElm=V.target}U.suffix=X.suffix;U.editorManager=X;U.inline=V.inline;if(V.cache_suffix){N.cacheSuffix=V.cache_suffix.replace(/^[\?\&]+/,"")}X.fire("SetupEditor",U);U.execCallback("setup",U);U.$=A.overrideDefaults(function(){return{context:U.inline?U.getBody():U.getDoc(),element:U.getBody()}})}w.prototype={render:function(){var T=this,W=T.settings,Z=T.id,Y=T.suffix;function V(){z.unbind(window,"ready",V);T.render()}if(!H.domLoaded){z.bind(window,"ready",V);return}if(!T.getElement()){return}if(!N.contentEditable){return}if(!W.inline){T.orgVisibility=T.getElement().style.visibility;T.getElement().style.visibility="hidden"}else{T.inline=true}var X=T.getElement().form||z.getParent(Z,"form");if(X){T.formElement=X;if(W.hidden_input&&!/TEXTAREA|INPUT/i.test(T.getElement().nodeName)){z.insertAfter(z.create("input",{type:"hidden",name:Z}),Z);T.hasHiddenInput=true}T.formEventDelegate=function(aa){T.fire(aa.type,aa)};z.bind(X,"submit reset",T.formEventDelegate);T.on("reset",function(){T.setContent(T.startContent,{format:"raw"})});if(W.submit_patch&&!X.submit.nodeType&&!X.submit.length&&!X._mceOldSubmit){X._mceOldSubmit=X.submit;X.submit=function(){T.editorManager.triggerSave();T.isNotDirty=true;return X._mceOldSubmit(X)}}}T.windowManager=new M(T);if(W.encoding=="xml"){T.on("GetContent",function(aa){if(aa.save){aa.content=z.encode(aa.content)}})}if(W.add_form_submit_trigger){T.on("submit",function(){if(T.initialized){T.save()}})}if(W.add_unload_trigger){T._beforeUnload=function(){if(T.initialized&&!T.destroyed&&!T.isHidden()){T.save({format:"raw",no_events:true,set_dirty:false})}};T.editorManager.on("BeforeUnload",T._beforeUnload)}function U(){var ab=s.ScriptLoader;if(W.language&&W.language!="en"&&!W.language_url){W.language_url=T.editorManager.baseURL+"/langs/"+W.language+".js"}if(W.language_url){ab.add(W.language_url)}if(W.theme&&typeof W.theme!="function"&&W.theme.charAt(0)!="-"&&!O.urls[W.theme]){var aa=W.theme_url;if(aa){aa=T.documentBaseURI.toAbsolute(aa)}else{aa="themes/"+W.theme+"/theme"+Y+".js"}O.load(W.theme,aa)}if(q.isArray(W.plugins)){W.plugins=W.plugins.join(" ")}L(W.external_plugins,function(ad,ac){R.load(ac,ad);W.plugins+=" "+ac});L(W.plugins.split(/[ ,]/),function(ac){ac=i(ac);if(ac&&!R.urls[ac]){if(ac.charAt(0)=="-"){ac=ac.substr(1,ac.length);var ad=R.dependencies(ac);L(ad,function(af){var ae={prefix:"plugins/",resource:af,suffix:"/plugin"+Y+".js"};af=R.createUrl(ae,af);R.load(af.resource,af)})}else{R.load(ac,{prefix:"plugins/",resource:ac,suffix:"/plugin"+Y+".js"})}}});ab.loadQueue(function(){if(!T.removed){T.init()}})}U()},init:function(){var ab=this,ak=ab.settings,X=ab.getElement();var Z,ai,W,ae,ac,T,U,am,ah,ad,ag,V=[];this.editorManager.i18n.setCode(ak.language);ab.rtl=this.editorManager.i18n.rtl;ab.editorManager.add(ab);ak.aria_label=ak.aria_label||z.getAttrib(X,"aria-label",ab.getLang("aria.rich_text_area"));if(ak.theme){if(typeof ak.theme!="function"){ak.theme=ak.theme.replace(/-/,"");T=O.get(ak.theme);ab.theme=new T(ab,O.urls[ak.theme]);if(ab.theme.init){ab.theme.init(ab,O.urls[ak.theme]||ab.documentBaseUrl.replace(/\/$/,""),ab.$)}}else{ab.theme=ak.theme}}function al(aq){var ap=R.get(aq),ao,an;ao=R.urls[aq]||ab.documentBaseUrl.replace(/\/$/,"");aq=i(aq);if(ap&&Q(V,aq)===-1){L(R.dependencies(aq),function(ar){al(ar)});an=new ap(ab,ao,ab.$);ab.plugins[aq]=an;if(an.init){an.init(ab,ao);V.push(aq)}}}L(ak.plugins.replace(/\-/g,"").split(/[ ,]/),al);if(ak.render_ui&&ab.theme){ab.orgDisplay=X.style.display;if(typeof ak.theme!="function"){Z=ak.width||X.style.width||X.offsetWidth;ai=ak.height||X.style.height||X.offsetHeight;W=ak.min_height||100;ad=/^[0-9\.]+(|px)$/i;if(ad.test(""+Z)){Z=Math.max(parseInt(Z,10),100)}if(ad.test(""+ai)){ai=Math.max(parseInt(ai,10),W)}ac=ab.theme.renderUI({targetNode:X,width:Z,height:ai,deltaWidth:ak.delta_width,deltaHeight:ak.delta_height});if(!ak.content_editable){ai=(ac.iframeHeight||ai)+(typeof ai=="number"?(ac.deltaHeight||0):"");if(ai<W){ai=W}}}else{ac=ak.theme(ab,X);if(ac.editorContainer.nodeType){ac.editorContainer=ac.editorContainer.id=ac.editorContainer.id||ab.id+"_parent"}if(ac.iframeContainer.nodeType){ac.iframeContainer=ac.iframeContainer.id=ac.iframeContainer.id||ab.id+"_iframecontainer"}ai=ac.iframeHeight||X.offsetHeight}ab.editorContainer=ac.editorContainer}if(ak.content_css){L(r(ak.content_css),function(an){ab.contentCSS.push(ab.documentBaseURI.toAbsolute(an))})}if(ak.content_style){ab.contentStyles.push(ak.content_style)}if(ak.content_editable){X=ae=ac=null;return ab.initContentBody()}ab.iframeHTML=ak.doctype+"<html><head>";if(ak.document_base_url!=ab.documentBaseUrl){ab.iframeHTML+='<base href="'+ab.documentBaseURI.getURI()+'" />'}if(!N.caretAfter&&ak.ie7_compat){ab.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=7" />'}ab.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';for(ag=0;ag<ab.contentCSS.length;ag++){var af=ab.contentCSS[ag];ab.iframeHTML+=('<link type="text/css" rel="stylesheet" href="'+q._addCacheSuffix(af)+'" />');ab.loadedCSS[af]=true}am=ak.body_id||"tinymce";if(am.indexOf("=")!=-1){am=ab.getParam("body_id","","hash");am=am[ab.id]||am}ah=ak.body_class||"";if(ah.indexOf("=")!=-1){ah=ab.getParam("body_class","","hash");ah=ah[ab.id]||""}if(ak.content_security_policy){ab.iframeHTML+='<meta http-equiv="Content-Security-Policy" content="'+ak.content_security_policy+'" />'}ab.iframeHTML+='</head><body id="'+am+'" class="mce-content-body '+ah+'" data-id="'+ab.id+'"><br></body></html>';var aa='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+ab.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody(true);})()';if(document.domain!=location.hostname){U=aa}var Y=z.create("iframe",{id:ab.id+"_ifr",frameBorder:"0",allowTransparency:"true",title:ab.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),style:{width:"100%",height:ai,display:"block"}});Y.onload=function(){Y.onload=null;ab.fire("load")};z.setAttrib(Y,"src",U||'javascript:""');ab.contentAreaContainer=ac.iframeContainer;ab.iframeElement=Y;ae=z.add(ac.iframeContainer,Y);if(F){try{ab.getDoc()}catch(aj){ae.src=U=aa}}if(ac.editorContainer){z.get(ac.editorContainer).style.display=ab.orgDisplay;ab.hidden=z.isHidden(ac.editorContainer)}ab.getElement().style.display="none";z.setAttrib(ab.id,"aria-hidden",true);if(!U){ab.initContentBody()}X=ae=ac=null},initContentBody:function(U){var V=this,W=V.settings,X=V.getElement(),Y=V.getDoc(),T,Z;if(!W.inline){V.getElement().style.visibility=V.orgVisibility}if(!U&&!W.content_editable){Y.open();Y.write(V.iframeHTML);Y.close()}if(W.content_editable){V.on("remove",function(){var aa=this.getBody();z.removeClass(aa,"mce-content-body");z.removeClass(aa,"mce-edit-focus");z.setAttrib(aa,"contentEditable",null)});z.addClass(X,"mce-content-body");V.contentDocument=Y=W.content_document||document;V.contentWindow=W.content_window||window;V.bodyElement=X;W.content_document=W.content_window=null;W.root_name=X.nodeName.toLowerCase()}T=V.getBody();T.disabled=true;if(!W.readonly){if(V.inline&&z.getStyle(T,"position",true)=="static"){T.style.position="relative"}T.contentEditable=V.getParam("content_editable_state",true)}T.disabled=false;V.schema=new o(W);V.dom=new S(Y,{keep_values:true,url_converter:V.convertURL,url_converter_scope:V,hex_colors:W.force_hex_style_colors,class_filter:W.class_filter,update_styles:true,root_element:V.inline?V.getBody():null,collect:W.content_editable,schema:V.schema,onSetAttrib:function(aa){V.fire("SetAttrib",aa)}});V.parser=new j(W,V.schema);V.parser.addAttributeFilter("src,href,style,tabindex",function(aa,ab){var ac=aa.length,ae,ag=V.dom,af,ad;while(ac--){ae=aa[ac];af=ae.attr(ab);ad="data-mce-"+ab;if(!ae.attributes.map[ad]){if(ab==="style"){af=ag.serializeStyle(ag.parseStyle(af),ae.name);if(!af.length){af=null}ae.attr(ad,af);ae.attr(ab,af)}else{if(ab==="tabindex"){ae.attr(ad,af);ae.attr(ab,null)}else{ae.attr(ad,V.convertURL(af,ab,ae.name))}}}}});V.parser.addNodeFilter("script",function(aa){var ab=aa.length,ac;while(ab--){ac=aa[ab];ac.attr("type","mce-"+(ac.attr("type")||"no/type"))}});V.parser.addNodeFilter("#cdata",function(aa){var ab=aa.length,ac;while(ab--){ac=aa[ab];ac.type=8;ac.name="#comment";ac.value="[CDATA["+ac.value+"]]"}});V.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(ab){var ac=ab.length,ad,aa=V.schema.getNonEmptyElements();while(ac--){ad=ab[ac];if(ad.isEmpty(aa)){ad.append(new x("br",1)).shortEnded=true}}});V.serializer=new K(W,V);V.selection=new E(V.dom,V.getWin(),V.serializer,V);V.formatter=new y(V);V.undoManager=new n(V);V.forceBlocks=new G(V);V.enterKey=new J(V);V._nodeChangeDispatcher=new m(V);V.fire("PreInit");if(!W.browser_spellcheck&&!W.gecko_spellcheck){Y.body.spellcheck=false;z.setAttrib(T,"spellcheck","false")}V.fire("PostRender");V.quirks=new B(V);if(W.directionality){T.dir=W.directionality}if(W.nowrap){T.style.whiteSpace="nowrap"}if(W.protect){V.on("BeforeSetContent",function(aa){L(W.protect,function(ab){aa.content=aa.content.replace(ab,function(ac){return"<!--mce:protected "+escape(ac)+"-->"})})})}V.on("SetContent",function(){V.addVisual(V.getBody())});if(W.padd_empty_editor){V.on("PostProcess",function(aa){aa.content=aa.content.replace(/^(<p[^>]*>(&nbsp;|&#160;|\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")})}V.load({initial:true,format:"html"});V.startContent=V.getContent({format:"raw"});V.initialized=true;V.bindPendingEventDelegates();V.fire("init");V.focus(true);V.nodeChanged({initial:true});V.execCallback("init_instance_callback",V);if(V.contentStyles.length>0){Z="";L(V.contentStyles,function(aa){Z+=aa+"\r\n"});V.dom.addStyle(Z)}L(V.contentCSS,function(aa){if(!V.loadedCSS[aa]){V.dom.loadCSS(aa);V.loadedCSS[aa]=true}});if(W.auto_focus){setTimeout(function(){var aa;if(W.auto_focus===true){aa=V}else{aa=V.editorManager.get(W.auto_focus)}if(!aa.destroyed){aa.focus()}},100)}X=Y=T=null},focus:function(U){var ab=this,aa=ab.selection,X=ab.settings.content_editable,T;var Y,Z=ab.getDoc(),V;if(!U){T=aa.getRng();if(T.item){Y=T.item(0)}ab._refreshContentEditable();if(!X){if(!N.opera){ab.getBody().focus()}ab.getWin().focus()}if(l||X){V=ab.getBody();if(V.setActive){try{V.setActive()}catch(W){V.focus()}}else{V.focus()}if(X){aa.normalize()}}if(Y&&Y.ownerDocument==Z){T=Z.body.createControlRange();T.addElement(Y);T.select()}}ab.editorManager.setActive(ab)},execCallback:function(U){var T=this,W=T.settings[U],V;if(!W){return}if(T.callbackLookup&&(V=T.callbackLookup[U])){W=V.func;V=V.scope}if(typeof W==="string"){V=W.replace(/\.\w+$/,"");V=V?u(V):0;W=u(W);T.callbackLookup=T.callbackLookup||{};T.callbackLookup[U]={func:W,scope:V}}return W.apply(V||T,Array.prototype.slice.call(arguments,1))},translate:function(V){var U=this.settings.language||"en",T=this.editorManager.i18n;if(!V){return""}return T.data[U+"."+V]||V.replace(/\{\#([^\}]+)\}/g,function(X,W){return T.data[U+"."+W]||"{#"+W+"}"})},getLang:function(T,U){return(this.editorManager.i18n.data[(this.settings.language||"en")+"."+T]||(U!==g?U:"{#"+T+"}"))},getParam:function(U,X,V){var W=U in this.settings?this.settings[U]:X,T;if(V==="hash"){T={};if(typeof W==="string"){L(W.indexOf("=")>0?W.split(/[;,](?![^=;,]*(?:[;,]|$))/):W.split(","),function(Y){Y=Y.split("=");if(Y.length>1){T[i(Y[0])]=i(Y[1])}else{T[i(Y[0])]=i(Y)}})}else{T=W}return T}return W},nodeChanged:function(T){this._nodeChangeDispatcher.nodeChanged(T)},addButton:function(U,V){var T=this;if(V.cmd){V.onclick=function(){T.execCommand(V.cmd)}}if(!V.text&&!V.icon){V.icon=U}T.buttons=T.buttons||{};V.tooltip=V.tooltip||V.title;T.buttons[U]=V},addMenuItem:function(U,V){var T=this;if(V.cmd){V.onclick=function(){T.execCommand(V.cmd)}}T.menuItems=T.menuItems||{};T.menuItems[U]=V},addCommand:function(T,V,U){this.editorCommands.addCommand(T,V,U)},addQueryStateHandler:function(T,V,U){this.editorCommands.addQueryStateHandler(T,V,U)},addQueryValueHandler:function(T,V,U){this.editorCommands.addQueryValueHandler(T,V,U)},addShortcut:function(V,W,U,T){this.shortcuts.add(V,W,U,T)},execCommand:function(W,V,U,T){return this.editorCommands.execCommand(W,V,U,T)},queryCommandState:function(T){return this.editorCommands.queryCommandState(T)},queryCommandValue:function(T){return this.editorCommands.queryCommandValue(T)},queryCommandSupported:function(T){return this.editorCommands.queryCommandSupported(T)},show:function(){var T=this;if(T.hidden){T.hidden=false;if(T.inline){T.getBody().contentEditable=true}else{z.show(T.getContainer());z.hide(T.id)}T.load();T.fire("show")}},hide:function(){var T=this,U=T.getDoc();if(!T.hidden){if(F&&U&&!T.inline){U.execCommand("SelectAll")}T.save();if(T.inline){T.getBody().contentEditable=false;if(T==T.editorManager.focusedEditor){T.editorManager.focusedEditor=null}}else{z.hide(T.getContainer());z.setStyle(T.id,"display",T.orgDisplay)}T.hidden=true;T.fire("hide")}},isHidden:function(){return !!this.hidden},setProgressState:function(T,U){this.fire("ProgressState",{state:T,time:U})},load:function(U){var T=this,W=T.getElement(),V;if(W){U=U||{};U.load=true;V=T.setContent(W.value!==g?W.value:W.innerHTML,U);U.element=W;if(!U.no_events){T.fire("LoadContent",U)}U.element=W=null;return V}},save:function(U){var T=this,X=T.getElement(),V,W;if(!X||!T.initialized){return}U=U||{};U.save=true;U.element=X;V=U.content=T.getContent(U);if(!U.no_events){T.fire("SaveContent",U)}V=U.content;if(!/TEXTAREA|INPUT/i.test(X.nodeName)){if(!T.inline){X.innerHTML=V}if((W=z.getParent(T.id,"form"))){L(W.elements,function(Y){if(Y.name==T.id){Y.value=V;return false}})}}else{X.value=V}U.element=X=null;if(U.set_dirty!==false){T.isNotDirty=true}return V},setContent:function(X,V){var U=this,T=U.getBody(),W;V=V||{};V.format=V.format||"html";V.set=true;V.content=X;if(!V.no_events){U.fire("BeforeSetContent",V)}X=V.content;if(X.length===0||/^\s+$/.test(X)){W=U.settings.forced_root_block;if(W&&U.schema.isValidChild(T.nodeName.toLowerCase(),W.toLowerCase())){X=F&&F<11?"":'<br data-mce-bogus="1">';X=U.dom.createHTML(W,U.settings.forced_root_block_attrs,X)}else{if(!F){X='<br data-mce-bogus="1">'}}U.dom.setHTML(T,X);U.fire("SetContent",V)}else{if(V.format!=="raw"){X=new I({},U.schema).serialize(U.parser.parse(X,{isRootContent:true}))}V.content=i(X);U.dom.setHTML(T,V.content);if(!V.no_events){U.fire("SetContent",V)}}return V.content},getContent:function(V){var U=this,W,T=U.getBody();V=V||{};V.format=V.format||"html";V.get=true;V.getInner=true;if(!V.no_events){U.fire("BeforeGetContent",V)}if(V.format=="raw"){W=T.innerHTML}else{if(V.format=="text"){W=T.innerText||T.textContent}else{W=U.serializer.serialize(T,V)}}if(V.format!="text"){V.content=i(W)}else{V.content=W}if(!V.no_events){U.fire("GetContent",V)}return V.content},insertContent:function(U,T){if(T){U=p({content:U},T)}this.execCommand("mceInsertContent",false,U)},isDirty:function(){return !this.isNotDirty},getContainer:function(){var T=this;if(!T.container){T.container=z.get(T.editorContainer||T.id+"_parent")}return T.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){if(!this.targetElm){this.targetElm=z.get(this.id)}return this.targetElm},getWin:function(){var T=this,U;if(!T.contentWindow){U=T.iframeElement;if(U){T.contentWindow=U.contentWindow}}return T.contentWindow},getDoc:function(){var T=this,U;if(!T.contentDocument){U=T.getWin();if(U){T.contentDocument=U.document}}return T.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(V,U,X){var T=this,W=T.settings;if(W.urlconverter_callback){return T.execCallback("urlconverter_callback",V,X,true,U)}if(!W.convert_urls||(X&&X.nodeName=="LINK")||V.indexOf("file:")===0||V.length===0){return V}if(W.relative_urls){return T.documentBaseURI.toRelative(V)}V=T.documentBaseURI.toAbsolute(V,W.remove_script_host);return V},addVisual:function(X){var U=this,V=U.settings,W=U.dom,T;X=X||U.getBody();if(U.hasVisual===g){U.hasVisual=V.visual}L(W.select("table,a",X),function(Z){var Y;switch(Z.nodeName){case"TABLE":T=V.visual_table_class||"mce-item-table";Y=W.getAttrib(Z,"border");if((!Y||Y=="0")&&U.hasVisual){W.addClass(Z,T)}else{W.removeClass(Z,T)}return;case"A":if(!W.getAttrib(Z,"href",false)){Y=W.getAttrib(Z,"name")||Z.id;T=V.visual_anchor_class||"mce-item-anchor";if(Y&&U.hasVisual){W.addClass(Z,T)}else{W.removeClass(Z,T)}}return}});U.fire("VisualAid",{element:X,hasVisual:U.hasVisual})},remove:function(){var T=this;if(!T.removed){T.save();T.removed=1;T.unbindAllNativeEvents();if(T.hasHiddenInput){z.remove(T.getElement().nextSibling)}if(!T.inline){if(F&&F<10){T.getDoc().execCommand("SelectAll",false,null)}z.setStyle(T.id,"display",T.orgDisplay);T.getBody().onload=null}T.fire("remove");T.editorManager.remove(T);z.remove(T.getContainer());T.destroy()}},destroy:function(V){var T=this,U;if(T.destroyed){return}if(!V&&!T.removed){T.remove();return}if(!V){T.editorManager.off("beforeunload",T._beforeUnload);if(T.theme&&T.theme.destroy){T.theme.destroy()}T.selection.destroy();T.dom.destroy()}U=T.formElement;if(U){if(U._mceOldSubmit){U.submit=U._mceOldSubmit;U._mceOldSubmit=null}z.unbind(U,"submit reset",T.formEventDelegate)}T.contentAreaContainer=T.formElement=T.container=T.editorContainer=null;T.bodyElement=T.contentDocument=T.contentWindow=null;T.iframeElement=T.targetElm=null;if(T.selection){T.selection=T.selection.win=T.selection.dom=T.selection.dom.doc=null}T.destroyed=1},_refreshContentEditable:function(){var U=this,T,V;if(U._isHidden()){T=U.getBody();V=T.parentNode;V.removeChild(T);V.appendChild(T);T.focus()}},_isHidden:function(){var T;if(!l){return 0}T=this.selection.getSel();return(!T||!T.rangeCount||T.rangeCount===0)}};p(w.prototype,k);return w});h("tinymce/util/I18n",[],function(){var j={},i="en";return{setCode:function(k){if(k){i=k;this.rtl=this.data[k]?this.data[k]._dir==="rtl":false}},getCode:function(){return i},rtl:false,add:function(n,l){var k=j[n];if(!k){j[n]=k={}}for(var m in l){k[m]=l[m]}this.setCode(n)},translate:function(m){var k;k=j[i];if(!k){k={}}if(typeof m=="undefined"){return m}if(typeof m!="string"&&m.raw){return m.raw}if(m.push){var l=m.slice(1);m=(k[m[0]]||m[0]).replace(/\{([0-9]+)\}/g,function(o,n){return l[n]})}return(k[m]||m).replace(/{context:\w+}$/,"")},data:j}});h("tinymce/FocusManager",["tinymce/dom/DOMUtils","tinymce/Env"],function(o,j){var k,m,l,n=o.DOM;function i(v){function q(){try{return document.activeElement}catch(w){return document.body}}function u(x,w){if(w&&w.startContainer){if(!x.isChildOf(w.startContainer,x.getRoot())||!x.isChildOf(w.endContainer,x.getRoot())){return}return{startContainer:w.startContainer,startOffset:w.startOffset,endContainer:w.endContainer,endOffset:w.endOffset}}return w}function p(y,x){var w;if(x.startContainer){w=y.getDoc().createRange();w.setStart(x.startContainer,x.startOffset);w.setEnd(x.endContainer,x.endOffset)}else{w=x}return w}function t(w){return !!n.getParent(w,i.isEditorUIElement)}function r(x){var w=x.editor;w.on("init",function(){if(w.inline||j.ie){if("onbeforedeactivate" in document&&j.ie<9){w.dom.bind(w.getBody(),"beforedeactivate",function(z){if(z.target!=w.getBody()){return}try{w.lastRng=w.selection.getRng()}catch(y){}})}else{w.on("nodechange mouseup keyup",function(z){var y=q();if(z.type=="nodechange"&&z.selectionChange){return}if(y&&y.id==w.id+"_ifr"){y=w.getBody()}if(w.dom.isChildOf(y,w.getBody())){w.lastRng=w.selection.getRng()}})}if(j.webkit&&!k){k=function(){var z=v.activeEditor;if(z&&z.selection){var y=z.selection.getRng();if(y&&!y.collapsed){w.lastRng=y}}};n.bind(document,"selectionchange",k)}}});w.on("setcontent",function(){w.lastRng=null});w.on("mousedown",function(){w.selection.lastFocusBookmark=null});w.on("focusin",function(){var y=v.focusedEditor;if(w.selection.lastFocusBookmark){w.selection.setRng(p(w,w.selection.lastFocusBookmark));w.selection.lastFocusBookmark=null}if(y!=w){if(y){y.fire("blur",{focusedEditor:w})}v.setActive(w);v.focusedEditor=w;w.fire("focus",{blurredEditor:y});w.focus(true)}w.lastRng=null});w.on("focusout",function(){window.setTimeout(function(){var y=v.focusedEditor;if(!t(q())&&y==w){w.fire("blur",{focusedEditor:null});v.focusedEditor=null;if(w.selection){w.selection.lastFocusBookmark=null}}},0)});if(!m){m=function(z){var y=v.activeEditor;if(y&&z.target.ownerDocument==document){if(y.selection&&z.target!=y.getBody()){y.selection.lastFocusBookmark=u(y.dom,y.lastRng)}if(z.target!=document.body&&!t(z.target)&&v.focusedEditor==y){y.fire("blur",{focusedEditor:null});v.focusedEditor=null}}};n.bind(document,"focusin",m)}if(w.inline&&!l){l=function(A){var z=v.activeEditor;if(z.inline&&!z.dom.isChildOf(A.target,z.getBody())){var y=z.selection.getRng();if(!y.collapsed){z.lastRng=y}}};n.bind(document,"mouseup",l)}}function s(w){if(v.focusedEditor==w.editor){v.focusedEditor=null}if(!v.activeEditor){n.unbind(document,"selectionchange",k);n.unbind(document,"focusin",m);n.unbind(document,"mouseup",l);k=m=l=null}}v.on("AddEditor",r);v.on("RemoveEditor",s)}i.isEditorUIElement=function(p){return p.className.toString().indexOf("mce-")!==-1};return i});h("tinymce/EditorManager",["tinymce/Editor","tinymce/dom/DomQuery","tinymce/dom/DOMUtils","tinymce/util/URI","tinymce/Env","tinymce/util/Tools","tinymce/util/Observable","tinymce/util/I18n","tinymce/FocusManager"],function(s,k,w,n,j,i,p,t,m){var y=w.DOM;var u=i.explode,l=i.each,x=i.extend;var z=0,q,r;function v(C){var D=r.editors,B;delete D[C.id];for(var A=0;A<D.length;A++){if(D[A]==C){D.splice(A,1);B=true;break}}if(r.activeEditor==C){r.activeEditor=D[0]}if(r.focusedEditor==C){r.focusedEditor=null}return B}function o(A){if(A&&!(A.getContainer()||A.getBody()).parentNode){v(A);A.unbindAllNativeEvents();A.destroy(true);A=null}return A}r={$:k,majorVersion:"4",minorVersion:"1.10",releaseDate:"2015-05-05",editors:[],i18n:t,activeEditor:null,setup:function(){var D=this,F,B,G="",C,H;B=document.location.href;if(/^[^:]+:\/\/\/?[^\/]+\//.test(B)){B=B.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(B)){B+="/"}}C=window.tinymce||window.tinyMCEPreInit;if(C){F=C.base||C.baseURL;G=C.suffix}else{var A=document.getElementsByTagName("script");for(var E=0;E<A.length;E++){H=A[E].src;if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(H)){if(H.indexOf(".min")!=-1){G=".min"}F=H.substring(0,H.lastIndexOf("/"));break}}if(!F&&document.currentScript){H=document.currentScript.src;if(H.indexOf(".min")!=-1){G=".min"}F=H.substring(0,H.lastIndexOf("/"))}}D.baseURL=new n(B).toAbsolute(F);D.documentBaseURL=B;D.baseURI=new n(D.baseURL);D.suffix=G;D.focusManager=new m(D)},init:function(F){var A=this,G=[];function E(J){var I=J.id;if(!I){I=J.name;if(I&&!y.get(I)){I=J.name}else{I=y.uniqueId()}J.setAttribute("id",I)}return I}function C(L,J,K){if(!o(A.get(L))){var I=new s(L,J,A);I.targetElm=I.targetElm||K;G.push(I);I.render()}}function H(I){var J=F[I];if(!J){return}return J.apply(A,Array.prototype.slice.call(arguments,2))}function D(J,I){return I.constructor===RegExp?I.test(J.className):y.hasClass(J,I)}function B(){var I,J;y.unbind(window,"ready",B);H("onpageload");if(F.types){l(F.types,function(K){l(y.select(K.selector),function(L){C(E(L),x({},F,K),L)})});return}else{if(F.selector){l(y.select(F.selector),function(K){C(E(K),F,K)});return}else{if(F.target){C(E(F.target),F)}}}switch(F.mode){case"exact":I=F.elements||"";if(I.length>0){l(u(I),function(L){var K;if((K=y.get(L))){C(L,F,K)}else{l(document.forms,function(M){l(M.elements,function(N){if(N.name===L){L="mce_editor_"+z++;y.setAttrib(N,"id",L);C(L,F,N)}})})}})}break;case"textareas":case"specific_textareas":l(y.select("textarea"),function(K){if(F.editor_deselector&&D(K,F.editor_deselector)){return}if(!F.editor_selector||D(K,F.editor_selector)){C(E(K),F,K)}});break}if(F.oninit){I=J=0;l(G,function(K){J++;if(!K.initialized){K.on("init",function(){I++;if(I==J){H("oninit")}})}else{I++}if(I==J){H("oninit")}})}}A.settings=F;y.bind(window,"ready",B)},get:function(A){if(!arguments.length){return this.editors}return A in this.editors?this.editors[A]:null},add:function(B){var A=this,C=A.editors;C[B.id]=B;C.push(B);A.activeEditor=B;A.fire("AddEditor",{editor:B});if(!q){q=function(){A.fire("BeforeUnload")};y.bind(window,"beforeunload",q)}return B},createEditor:function(B,A){return this.add(new s(B,A,this))},remove:function(A){var B=this,C,E=B.editors,D;if(!A){for(C=E.length-1;C>=0;C--){B.remove(E[C])}return}if(typeof A=="string"){A=A.selector||A;l(y.select(A),function(F){D=E[F.id];if(D){B.remove(D)}});return}D=A;if(!E[D.id]){return null}if(v(D)){B.fire("RemoveEditor",{editor:D})}if(!E.length){y.unbind(window,"beforeunload",q)}D.remove();return D},execCommand:function(E,D,C){var A=this,B=A.get(C);switch(E){case"mceAddEditor":if(!A.get(C)){new s(C,A.settings,A).render()}return true;case"mceRemoveEditor":if(B){B.remove()}return true;case"mceToggleEditor":if(!B){A.execCommand("mceAddEditor",0,C);return true}if(B.isHidden()){B.show()}else{B.hide()}return true}if(A.activeEditor){return A.activeEditor.execCommand(E,D,C)}return false},triggerSave:function(){l(this.editors,function(A){A.save()})},addI18n:function(B,A){t.add(B,A)},translate:function(A){return t.translate(A)},setActive:function(A){var B=this.activeEditor;if(this.activeEditor!=A){if(B){B.fire("deactivate",{relatedTarget:A})}A.fire("activate",{relatedTarget:B})}this.activeEditor=A}};x(r,p);r.setup();window.tinymce=window.tinyMCE=r;return r});h("tinymce/LegacyInput",["tinymce/EditorManager","tinymce/util/Tools"],function(j,i){var l=i.each,k=i.explode;j.on("AddEditor",function(n){var m=n.editor;m.on("preInit",function(){var q,t,s,p=m.settings;function o(v,u){l(u,function(x,w){if(x){s.setStyle(v,w,x)}});s.rename(v,"span")}function r(u){s=m.dom;if(p.convert_fonts_to_spans){l(s.select("font,u,strike",u.node),function(v){q[v.nodeName.toLowerCase()](s,v)})}}if(p.inline_styles){t=k(p.font_size_legacy_values);q={font:function(v,u){o(u,{backgroundColor:u.style.backgroundColor,color:u.color,fontFamily:u.face,fontSize:t[parseInt(u.size,10)-1]})},u:function(v,u){if(m.settings.schema==="html4"){o(u,{textDecoration:"underline"})}},strike:function(v,u){o(u,{textDecoration:"line-through"})}};m.on("PreProcess SetContent",r)}})})});h("tinymce/util/XHR",["tinymce/util/Observable","tinymce/util/Tools"],function(i,j){var k={send:function(m){var o,n=0;function l(){if(!m.async||o.readyState==4||n++>10000){if(m.success&&n<10000&&o.status==200){m.success.call(m.success_scope,""+o.responseText,o,m)}else{if(m.error){m.error.call(m.error_scope,n>10000?"TIMED_OUT":"GENERAL",o,m)}}o=null}else{setTimeout(l,10)}}m.scope=m.scope||this;m.success_scope=m.success_scope||m.scope;m.error_scope=m.error_scope||m.scope;m.async=m.async===false?false:true;m.data=m.data||"";o=new XMLHttpRequest();if(o){if(o.overrideMimeType){o.overrideMimeType(m.content_type)}o.open(m.type||(m.data?"POST":"GET"),m.url,m.async);if(m.crossDomain){o.withCredentials=true}if(m.content_type){o.setRequestHeader("Content-Type",m.content_type)}o.setRequestHeader("X-Requested-With","XMLHttpRequest");o=k.fire("beforeSend",{xhr:o,settings:m}).xhr;o.send(m.data);if(!m.async){return l()}setTimeout(l,10)}}};j.extend(k,i);return k});h("tinymce/util/JSON",[],function(){function i(p,k){var n,j,m,l;k=k||'"';if(p===null){return"null"}m=typeof p;if(m=="string"){j="\bb\tt\nn\ff\rr\"\"''\\\\";return k+p.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(q,o){if(k==='"'&&q==="'"){return q}n=j.indexOf(o);if(n+1){return"\\"+j.charAt(n+1)}q=o.charCodeAt().toString(16);return"\\u"+"0000".substring(q.length)+q})+k}if(m=="object"){if(p.hasOwnProperty&&Object.prototype.toString.call(p)==="[object Array]"){for(n=0,j="[";n<p.length;n++){j+=(n>0?",":"")+i(p[n],k)}return j+"]"}j="{";for(l in p){if(p.hasOwnProperty(l)){j+=typeof p[l]!="function"?(j.length>1?","+k:k)+l+k+":"+i(p[l],k):""}}return j+"}"}return""+p}return{serialize:i,parse:function(k){try{return window[String.fromCharCode(101)+"val"]("("+k+")")}catch(j){}}}});h("tinymce/util/JSONRequest",["tinymce/util/JSON","tinymce/util/XHR","tinymce/util/Tools"],function(l,k,j){var m=j.extend;function i(n){this.settings=m({},n);this.count=0}i.sendRPC=function(n){return new i().send(n)};i.prototype={send:function(p){var o=p.error,n=p.success;p=m(this.settings,p);p.success=function(r,q){r=l.parse(r);if(typeof r=="undefined"){r={error:"JSON Parse error."}}if(r.error){o.call(p.error_scope||p.scope,r.error,q)}else{n.call(p.success_scope||p.scope,r.result)}};p.error=function(r,q){if(o){o.call(p.error_scope||p.scope,r,q)}};p.data=l.serialize({id:p.id||"c"+(this.count++),method:p.method,params:p.params});p.content_type="application/json";k.send(p)}};return i});h("tinymce/util/JSONP",["tinymce/dom/DOMUtils"],function(i){return{callbacks:{},count:0,send:function(k){var j=this,m=i.DOM,l=k.count!==g?k.count:j.count;var n="tinymce_jsonp_"+l;j.callbacks[l]=function(o){m.remove(n);delete j.callbacks[l];k.callback(o)};m.add(m.doc.body,"script",{id:n,src:k.url,type:"text/javascript"});j.count++}}});h("tinymce/util/LocalStorage",[],function(){var l,k,o,q,r,j;try{if(window.localStorage){return localStorage}}catch(n){}r="tinymce";k=document.documentElement;j=!!k.addBehavior;if(j){k.addBehavior("#default#userData")}function i(){q=[];for(var s in o){q.push(s)}l.length=q.length}function p(){var s,v,u,x=0;o={};if(!j){return}function t(y){var A,z;z=y!==g?x+y:v.indexOf(",",x);if(z===-1||z>v.length){return null}A=v.substring(x,z);x=z+1;return A}k.load(r);v=k.getAttribute(r)||"";do{var w=t();if(w===null){break}s=t(parseInt(w,32)||0);if(s!==null){w=t();if(w===null){break}u=t(parseInt(w,32)||0);if(s){o[s]=u}}}while(s!==null);i()}function m(){var v,u="";if(!j){return}for(var t in o){v=o[t];u+=(u?",":"")+t.length.toString(32)+","+t+","+v.length.toString(32)+","+v}k.setAttribute(r,u);try{k.save(r)}catch(s){}i()}l={key:function(s){return q[s]},getItem:function(s){return s in o?o[s]:null},setItem:function(s,t){o[s]=""+t;m()},removeItem:function(s){delete o[s];m()},clear:function(){o={};m()}};p();return l});h("tinymce/Compat",["tinymce/dom/DOMUtils","tinymce/dom/EventUtils","tinymce/dom/ScriptLoader","tinymce/AddOnManager","tinymce/util/Tools","tinymce/Env"],function(m,o,n,l,j,i){var k=window.tinymce;k.DOM=m.DOM;k.ScriptLoader=n.ScriptLoader;k.PluginManager=l.PluginManager;k.ThemeManager=l.ThemeManager;k.dom=k.dom||{};k.dom.Event=o.Event;j.each(j,function(q,p){k[p]=q});j.each("isOpera isWebKit isIE isGecko isMac".split(" "),function(p){k[p]=i[p.substr(2).toLowerCase()]});return{}});h("tinymce/ui/Layout",["tinymce/util/Class","tinymce/util/Tools"],function(i,j){return i.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(k){this.settings=j.extend({},this.Defaults,k)},preRender:function(k){k.addClass(this.settings.containerClass,"body")},applyClasses:function(k){var m=this,p=m.settings,l,o,n;l=k.items().filter(":visible");o=p.firstControlClass;n=p.lastControlClass;l.each(function(q){q.removeClass(o).removeClass(n);if(p.controlClass){q.addClass(p.controlClass)}});l.eq(0).addClass(o);l.eq(-1).addClass(n)},renderHtml:function(k){var m=this,o=m.settings,l,n="";l=k.items();l.eq(0).addClass(o.firstControlClass);l.eq(-1).addClass(o.lastControlClass);l.each(function(p){if(o.controlClass){p.addClass(o.controlClass)}n+=p.renderHtml()});return n},recalc:function(){},postRender:function(){}})});h("tinymce/ui/AbsoluteLayout",["tinymce/ui/Layout"],function(i){return i.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(j){j.items().filter(":visible").each(function(l){var k=l.settings;l.layoutRect({x:k.x,y:k.y,w:k.w,h:k.h});if(l.recalc){l.recalc()}})},renderHtml:function(j){return'<div id="'+j._id+'-absend" class="'+j.classPrefix+'abs-end"></div>'+this._super(j)}})});h("tinymce/ui/Tooltip",["tinymce/ui/Control","tinymce/ui/Movable"],function(j,i){return j.extend({Mixins:[i],Defaults:{classes:"widget tooltip tooltip-n"},text:function(l){var k=this;if(typeof l!="undefined"){k._value=l;if(k._rendered){k.getEl().lastChild.innerHTML=k.encode(l)}return k}return k._value},renderHtml:function(){var k=this,l=k.classPrefix;return('<div id="'+k._id+'" class="'+k.classes()+'" role="presentation"><div class="'+l+'tooltip-arrow"></div><div class="'+l+'tooltip-inner">'+k.encode(k._text)+"</div></div>")},repaint:function(){var k=this,l,m;l=k.getEl().style;m=k._layoutRect;l.left=m.x+"px";l.top=m.y+"px";l.zIndex=65535+65535}})});h("tinymce/ui/Widget",["tinymce/ui/Control","tinymce/ui/Tooltip"],function(k,i){var l;var j=k.extend({init:function(n){var m=this;m._super(n);n=m.settings;m.canFocus=true;if(n.tooltip&&j.tooltips!==false){m.on("mouseenter",function(q){var p=m.tooltip().moveTo(-65535);if(q.control==m){var o=p.text(n.tooltip).show().testMoveRel(m.getEl(),["bc-tc","bc-tl","bc-tr"]);p.toggleClass("tooltip-n",o=="bc-tc");p.toggleClass("tooltip-nw",o=="bc-tl");p.toggleClass("tooltip-ne",o=="bc-tr");p.moveRel(m.getEl(),o)}else{p.hide()}});m.on("mouseleave mousedown click",function(){m.tooltip().hide()})}m.aria("label",n.ariaLabel||n.tooltip)},tooltip:function(){if(!l){l=new i({type:"tooltip"});l.renderTo()}return l},active:function(o){var m=this,n;if(o!==n){m.aria("pressed",o);m.toggleClass("active",o)}return m._super(o)},disabled:function(o){var m=this,n;if(o!==n){m.aria("disabled",o);m.toggleClass("disabled",o)}return m._super(o)},postRender:function(){var m=this,n=m.settings;m._rendered=true;m._super();if(!m.parent()&&(n.width||n.height)){m.initLayoutRect();m.repaint()}if(n.autofocus){m.focus()}},remove:function(){this._super();if(l){l.remove();l=null}}});return j});h("tinymce/ui/Button",["tinymce/ui/Widget"],function(i){return i.extend({Defaults:{classes:"widget btn",role:"button"},init:function(l){var j=this,k;j.on("click mousedown",function(m){m.preventDefault()});j._super(l);k=l.size;if(l.subtype){j.addClass(l.subtype)}if(k){j.addClass("btn-"+k)}},icon:function(m){var l=this,n=l.classPrefix;if(typeof m=="undefined"){return l.settings.icon}l.settings.icon=m;m=m?n+"ico "+n+"i-"+l.settings.icon:"";if(l._rendered){var j=l.getEl().firstChild,k=j.getElementsByTagName("i")[0];if(m){if(!k||k!=j.firstChild){k=document.createElement("i");j.insertBefore(k,j.firstChild)}k.className=m}else{if(k){j.removeChild(k)}}l.text(l._text)}return l},repaint:function(){var j=this.getEl().firstChild.style;j.width=j.height="100%";this._super()},text:function(l){var j=this;if(j._rendered){var k=j.getEl().lastChild.lastChild;if(k){k.data=j.translate(l)}}return j._super(l)},renderHtml:function(){var j=this,n=j._id,l=j.classPrefix;var k=j.settings.icon,m;m=j.settings.image;if(m){k="none";if(typeof m!="string"){m=window.getSelection?m[0]:m[1]}m=" style=\"background-image: url('"+m+"')\""}else{m=""}k=j.settings.icon?l+"ico "+l+"i-"+k:"";return('<div id="'+n+'" class="'+j.classes()+'" tabindex="-1" aria-labelledby="'+n+'"><button role="presentation" type="button" tabindex="-1">'+(k?'<i class="'+k+'"'+m+"></i>":"")+(j._text?(k?"\u00a0":"")+j.encode(j._text):"")+"</button></div>")}})});h("tinymce/ui/ButtonGroup",["tinymce/ui/Container"],function(i){return i.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var j=this,k=j._layout;j.addClass("btn-group");j.preRender();k.preRender(j);return('<div id="'+j._id+'" class="'+j.classes()+'"><div id="'+j._id+'-body">'+(j.settings.html||"")+k.renderHtml(j)+"</div></div>")}})});h("tinymce/ui/Checkbox",["tinymce/ui/Widget"],function(i){return i.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:false},init:function(k){var j=this;j._super(k);j.on("click mousedown",function(l){l.preventDefault()});j.on("click",function(l){l.preventDefault();if(!j.disabled()){j.checked(!j.checked())}});j.checked(j.settings.checked)},checked:function(k){var j=this;if(typeof k!="undefined"){if(k){j.addClass("checked")}else{j.removeClass("checked")}j._checked=k;j.aria("checked",k);return j}return j._checked},value:function(j){return this.checked(j)},renderHtml:function(){var j=this,l=j._id,k=j.classPrefix;return('<div id="'+l+'" class="'+j.classes()+'" unselectable="on" aria-labelledby="'+l+'-al" tabindex="-1"><i class="'+k+"ico "+k+'i-checkbox"></i><span id="'+l+'-al" class="'+k+'label">'+j.encode(j._text)+"</span></div>")}})});h("tinymce/ui/ComboBox",["tinymce/ui/Widget","tinymce/ui/Factory","tinymce/ui/DomUtils"],function(k,i,j){return k.extend({init:function(m){var l=this;l._super(m);l.addClass("combobox");l.subinput=true;l.ariaTarget="inp";m=l.settings;m.menu=m.menu||m.values;if(m.menu){m.icon="caret"}l.on("click",function(o){var p=o.target,n=l.getEl();while(p&&p!=n){if(p.id&&p.id.indexOf("-open")!=-1){l.fire("action");if(m.menu){l.showMenu();if(o.aria){l.menu.items()[0].focus()}}}p=p.parentNode}});l.on("keydown",function(n){if(n.target.nodeName=="INPUT"&&n.keyCode==13){l.parents().reverse().each(function(o){n.preventDefault();l.fire("change");if(o.hasEventListeners("submit")&&o.toJSON){o.fire("submit",{data:o.toJSON()});return false}})}});if(m.placeholder){l.addClass("placeholder");l.on("focusin",function(){if(!l._hasOnChange){j.on(l.getEl("inp"),"change",function(){l.fire("change")});l._hasOnChange=true}if(l.hasClass("placeholder")){l.getEl("inp").value="";l.removeClass("placeholder")}});l.on("focusout",function(){if(l.value().length===0){l.getEl("inp").value=m.placeholder;l.addClass("placeholder")}})}},showMenu:function(){var l=this,m=l.settings,n;if(!l.menu){n=m.menu||[];if(n.length){n={type:"menu",items:n}}else{n.type=n.type||"menu"}l.menu=i.create(n).parent(l).renderTo(l.getContainerElm());l.fire("createmenu");l.menu.reflow();l.menu.on("cancel",function(o){if(o.control===l.menu){l.focus()}});l.menu.on("show hide",function(o){o.control.items().each(function(p){p.active(p.value()==l.value())})}).fire("show");l.menu.on("select",function(o){l.value(o.control.value())});l.on("focusin",function(o){if(o.target.tagName.toUpperCase()=="INPUT"){l.menu.hide()}});l.aria("expanded",true)}l.menu.show();l.menu.layoutRect({w:l.layoutRect().w});l.menu.moveRel(l.getEl(),l.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},value:function(m){var l=this;if(typeof m!="undefined"){l._value=m;l.removeClass("placeholder");if(l._rendered){l.getEl("inp").value=m}return l}if(l._rendered){m=l.getEl("inp").value;if(m!=l.settings.placeholder){return m}return""}return l._value},disabled:function(m){var l=this;if(l._rendered&&typeof m!="undefined"){l.getEl("inp").disabled=m}return l._super(m)},focus:function(){this.getEl("inp").focus()},repaint:function(){var m=this,r=m.getEl(),l=m.getEl("open"),p=m.layoutRect();var o,n;if(l){o=p.w-j.getSize(l).width-10}else{o=p.w-10}var q=document;if(q.all&&(!q.documentMode||q.documentMode<=8)){n=(m.layoutRect().h-2)+"px"}j.css(r.firstChild,{width:o,lineHeight:n});m._super();return m},postRender:function(){var l=this;j.on(this.getEl("inp"),"change",function(){l.fire("change")});return l._super()},remove:function(){j.off(this.getEl("inp"));this._super()},renderHtml:function(){var t=this,l=t._id,m=t.settings,n=t.classPrefix;var q=m.value||m.placeholder||"";var p,s,o="",r="";if("spellcheck" in m){r+=' spellcheck="'+m.spellcheck+'"'}if(m.maxLength){r+=' maxlength="'+m.maxLength+'"'}if(m.size){r+=' size="'+m.size+'"'}if(m.subtype){r+=' type="'+m.subtype+'"'}if(t.disabled()){r+=' disabled="disabled"'}p=m.icon;if(p&&p!="caret"){p=n+"ico "+n+"i-"+m.icon}s=t._text;if(p||s){o=('<div id="'+l+'-open" class="'+n+"btn "+n+'open" tabIndex="-1" role="button"><button id="'+l+'-action" type="button" hidefocus="1" tabindex="-1">'+(p!="caret"?'<i class="'+p+'"></i>':'<i class="'+n+'caret"></i>')+(s?(p?" ":"")+s:"")+"</button></div>");t.addClass("has-open")}return('<div id="'+l+'" class="'+t.classes()+'"><input id="'+l+'-inp" class="'+n+"textbox "+n+'placeholder" value="'+q+'" hidefocus="1"'+r+" />"+o+"</div>")}})});h("tinymce/ui/ColorBox",["tinymce/ui/ComboBox"],function(i){return i.extend({init:function(k){var j=this;k.spellcheck=false;if(k.onaction){k.icon="none"}j._super(k);j.addClass("colorbox");j.on("change keyup postrender",function(){j.repaintColor(j.value())})},repaintColor:function(k){var l=this.getEl().getElementsByTagName("i")[0];if(l){try{l.style.background=k}catch(j){}}},value:function(k){var j=this;if(typeof k!="undefined"){if(j._rendered){j.repaintColor(k)}}return j._super(k)}})});h("tinymce/ui/PanelButton",["tinymce/ui/Button","tinymce/ui/FloatPanel"],function(i,j){return i.extend({showPanel:function(){var k=this,l=k.settings;k.active(true);if(!k.panel){var m=l.panel;if(m.type){m={layout:"grid",items:m}}m.role=m.role||"dialog";m.popover=true;m.autohide=true;m.ariaRoot=true;k.panel=new j(m).on("hide",function(){k.active(false)}).on("cancel",function(n){n.stopPropagation();k.focus();k.hidePanel()}).parent(k).renderTo(k.getContainerElm());k.panel.fire("show");k.panel.reflow()}else{k.panel.show()}k.panel.moveRel(k.getEl(),l.popoverAlign||(k.isRtl()?["bc-tr","bc-tc"]:["bc-tl","bc-tc"]))},hidePanel:function(){var k=this;if(k.panel){k.panel.hide()}},postRender:function(){var k=this;k.aria("haspopup",true);k.on("click",function(l){if(l.control===k){if(k.panel&&k.panel.visible()){k.hidePanel()}else{k.showPanel();k.panel.focus(!!l.aria)}}});return k._super()},remove:function(){if(this.panel){this.panel.remove();this.panel=null}return this._super()}})});h("tinymce/ui/ColorButton",["tinymce/ui/PanelButton","tinymce/dom/DOMUtils"],function(j,i){var k=i.DOM;return j.extend({init:function(l){this._super(l);this.addClass("colorbutton")},color:function(l){if(l){this._color=l;this.getEl("preview").style.backgroundColor=l;return this}return this._color},resetColor:function(){this._color=null;this.getEl("preview").style.backgroundColor=null;return this},renderHtml:function(){var l=this,p=l._id,n=l.classPrefix;var m=l.settings.icon?n+"ico "+n+"i-"+l.settings.icon:"";var o=l.settings.image?" style=\"background-image: url('"+l.settings.image+"')\"":"";return('<div id="'+p+'" class="'+l.classes()+'" role="button" tabindex="-1" aria-haspopup="true"><button role="presentation" hidefocus="1" type="button" tabindex="-1">'+(m?'<i class="'+m+'"'+o+"></i>":"")+'<span id="'+p+'-preview" class="'+n+'preview"></span>'+(l._text?(m?" ":"")+(l._text):"")+'</button><button type="button" class="'+n+'open" hidefocus="1" tabindex="-1"> <i class="'+n+'caret"></i></button></div>')},postRender:function(){var l=this,m=l.settings.onclick;l.on("click",function(n){if(n.aria&&n.aria.key=="down"){return}if(n.control==l&&!k.getParent(n.target,"."+l.classPrefix+"open")){n.stopImmediatePropagation();m.call(l,n)}});delete l.settings.onclick;return l._super()}})});h("tinymce/util/Color",[],function(){var k=Math.min,i=Math.max,j=Math.round;function l(w){var x=this,m=0,t=0,v=0;function p(y,A,C){var z,G,E,B,D,F;z=0;G=0;E=0;y=y/255;A=A/255;C=C/255;D=k(y,k(A,C));F=i(y,i(A,C));if(D==F){E=D;return{h:0,s:0,v:E*100}}B=(y==D)?A-C:((C==D)?y-A:C-y);z=(y==D)?3:((C==D)?1:5);z=60*(z-B/(F-D));G=(F-D)/F;E=F;return{h:j(z),s:j(G*100),v:j(E*100)}}function q(y,C,D){var B,A,r,z;y=(parseInt(y,10)||0)%360;C=parseInt(C,10)/100;D=parseInt(D,10)/100;C=i(0,k(C,1));D=i(0,k(D,1));if(C===0){m=t=v=j(255*D);return}B=y/60;A=D*C;r=A*(1-Math.abs(B%2-1));z=D-A;switch(Math.floor(B)){case 0:m=A;t=r;v=0;break;case 1:m=r;t=A;v=0;break;case 2:m=0;t=A;v=r;break;case 3:m=0;t=r;v=A;break;case 4:m=r;t=0;v=A;break;case 5:m=A;t=0;v=r;break;default:m=t=v=0}m=j(255*(m+z));t=j(255*(t+z));v=j(255*(v+z))}function n(){function r(y){y=parseInt(y,10).toString(16);return y.length>1?y:"0"+y}return"#"+r(m)+r(t)+r(v)}function u(){return{r:m,g:t,b:v}}function s(){return p(m,t,v)}function o(y){var r;if(typeof y=="object"){if("r" in y){m=y.r;t=y.g;v=y.b}else{if("v" in y){q(y.h,y.s,y.v)}}}else{if((r=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(y))){m=parseInt(r[1],10);t=parseInt(r[2],10);v=parseInt(r[3],10)}else{if((r=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(y))){m=parseInt(r[1],16);t=parseInt(r[2],16);v=parseInt(r[3],16)}else{if((r=/#([0-F])([0-F])([0-F])/gi.exec(y))){m=parseInt(r[1]+r[1],16);t=parseInt(r[2]+r[2],16);v=parseInt(r[3]+r[3],16)}}}}m=m<0?0:(m>255?255:m);t=t<0?0:(t>255?255:t);v=v<0?0:(v>255?255:v);return x}if(w){o(w)}x.toRgb=u;x.toHsv=s;x.toHex=n;x.parse=o}return l});h("tinymce/ui/ColorPicker",["tinymce/ui/Widget","tinymce/ui/DragHelper","tinymce/ui/DomUtils","tinymce/util/Color"],function(k,j,i,l){return k.extend({Defaults:{classes:"widget colorpicker"},init:function(m){this._super(m)},postRender:function(){var w=this,q=w.color(),r,t,s,v,o;t=w.getEl("h");s=w.getEl("hp");v=w.getEl("sv");o=w.getEl("svp");function p(D,A){var C=i.getPos(D),z,B;z=A.pageX-C.x;B=A.pageY-C.y;z=Math.max(0,Math.min(z/D.clientWidth,1));B=Math.max(0,Math.min(B/D.clientHeight,1));return{x:z,y:B}}function n(z,y){var x=(360-z.h)/360;i.css(s,{top:(x*100)+"%"});if(!y){i.css(o,{left:z.s+"%",top:(100-z.v)+"%"})}v.style.background=new l({s:100,v:100,h:z.h}).toHex();w.color().parse({s:z.s,v:z.v,h:z.h})}function m(x){var y;y=p(v,x);r.s=y.x*100;r.v=(1-y.y)*100;n(r);w.fire("change")}function u(x){var y;y=p(t,x);r=q.toHsv();r.h=(1-y.y)*360;n(r,true);w.fire("change")}w._repaint=function(){r=q.toHsv();n(r)};w._super();w._svdraghelper=new j(w._id+"-sv",{start:m,drag:m});w._hdraghelper=new j(w._id+"-h",{start:u,drag:u});w._repaint()},rgb:function(){return this.color().toRgb()},value:function(n){var m=this;if(arguments.length){m.color().parse(n);if(m._rendered){m._repaint()}}else{return m.color().toHex()}},color:function(){if(!this._color){this._color=new l()}return this._color},renderHtml:function(){var m=this,s=m._id,q=m.classPrefix,o;var p="#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000";function n(){var w,u,v="",t,x;t="filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=";x=p.split(",");for(w=0,u=x.length-1;w<u;w++){v+=('<div class="'+q+'colorpicker-h-chunk" style="height:'+(100/u)+"%;"+t+x[w]+",endColorstr="+x[w+1]+");-ms-"+t+x[w]+",endColorstr="+x[w+1]+')"></div>')}return v}var r=("background: -ms-linear-gradient(top,"+p+");background: linear-gradient(to bottom,"+p+");");o=('<div id="'+s+'-h" class="'+q+'colorpicker-h" style="'+r+'">'+n()+'<div id="'+s+'-hp" class="'+q+'colorpicker-h-marker"></div></div>');return('<div id="'+s+'" class="'+m.classes()+'"><div id="'+s+'-sv" class="'+q+'colorpicker-sv"><div class="'+q+'colorpicker-overlay1"><div class="'+q+'colorpicker-overlay2"><div id="'+s+'-svp" class="'+q+'colorpicker-selector1"><div class="'+q+'colorpicker-selector2"></div></div></div></div></div>'+o+"</div>")}})});h("tinymce/ui/Path",["tinymce/ui/Widget"],function(i){return i.extend({init:function(k){var j=this;if(!k.delimiter){k.delimiter="\u00BB"}j._super(k);j.addClass("path");j.canFocus=true;j.on("click",function(n){var l,m=n.target;if((l=m.getAttribute("data-index"))){j.fire("select",{value:j.data()[l],index:l})}})},focus:function(){var j=this;j.getEl().firstChild.focus();return j},data:function(k){var j=this;if(typeof k!=="undefined"){j._data=k;j.update();return j}return j._data},update:function(){this.innerHtml(this._getPathHtml())},postRender:function(){var j=this;j._super();j.data(j.settings.data)},renderHtml:function(){var j=this;return('<div id="'+j._id+'" class="'+j.classes()+'">'+j._getPathHtml()+"</div>")},_getPathHtml:function(){var k=this,p=k._data||[],n,j,m="",o=k.classPrefix;for(n=0,j=p.length;n<j;n++){m+=((n>0?'<div class="'+o+'divider" aria-hidden="true"> '+k.settings.delimiter+" </div>":"")+'<div role="button" class="'+o+"path-item"+(n==j-1?" "+o+"last":"")+'" data-index="'+n+'" tabindex="-1" id="'+k._id+"-"+n+'" aria-level="'+n+'">'+p[n].name+"</div>")}if(!m){m='<div class="'+o+'path-item">\u00a0</div>'}return m}})});h("tinymce/ui/ElementPath",["tinymce/ui/Path","tinymce/EditorManager"],function(j,i){return j.extend({postRender:function(){var k=this,m=i.activeEditor;function l(n){if(n.nodeType===1){if(n.nodeName=="BR"||!!n.getAttribute("data-mce-bogus")){return true}if(n.getAttribute("data-mce-type")==="bookmark"){return true}}return false}if(m.settings.elementpath!==false){k.on("select",function(n){m.focus();m.selection.select(this.data()[n.index].element);m.nodeChanged()});m.on("nodeChange",function(r){var n=[],p=r.parents,q=p.length;while(q--){if(p[q].nodeType==1&&!l(p[q])){var o=m.fire("ResolveName",{name:p[q].nodeName.toLowerCase(),target:p[q]});if(!o.isDefaultPrevented()){n.push({name:o.name,element:p[q]})}if(o.isPropagationStopped()){break}}}k.data(n)})}return k._super()}})});h("tinymce/ui/FormItem",["tinymce/ui/Container"],function(i){return i.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var j=this,k=j._layout,l=j.classPrefix;j.addClass("formitem");k.preRender(j);return('<div id="'+j._id+'" class="'+j.classes()+'" hidefocus="1" tabindex="-1">'+(j.settings.title?('<div id="'+j._id+'-title" class="'+l+'title">'+j.settings.title+"</div>"):"")+'<div id="'+j._id+'-body" class="'+j.classes("body")+'">'+(j.settings.html||"")+k.renderHtml(j)+"</div></div>")}})});h("tinymce/ui/Form",["tinymce/ui/Container","tinymce/ui/FormItem","tinymce/util/Tools"],function(i,k,j){return i.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:20,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var m=this,l=m.items();if(!m.settings.formItemDefaults){m.settings.formItemDefaults={layout:"flex",autoResize:"overflow",defaults:{flex:1}}}l.each(function(p){var o,n=p.settings.label;if(n){o=new k(j.extend({items:{type:"label",id:p._id+"-l",text:n,flex:0,forId:p._id,disabled:p.disabled()}},m.settings.formItemDefaults));o.type="formitem";p.aria("labelledby",p._id+"-l");if(typeof p.settings.flex=="undefined"){p.settings.flex=1}m.replace(p,o);o.add(p)}})},recalcLabels:function(){var m=this,p=0,q=[],n,o,l;if(m.settings.labelGapCalc===false){return}if(m.settings.labelGapCalc=="children"){l=m.find("formitem")}else{l=m.items()}l.filter("formitem").each(function(t){var s=t.items()[0],r=s.getEl().clientWidth;p=r>p?r:p;q.push(s)});o=m.settings.labelGap||0;n=q.length;while(n--){q[n].settings.minWidth=p+o}},visible:function(l){var m=this._super(l);if(l===true&&this._rendered){this.recalcLabels()}return m},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){var l=this;l._super();l.recalcLabels();l.fromJSON(l.settings.data)}})});h("tinymce/ui/FieldSet",["tinymce/ui/Form"],function(i){return i.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 j=this,k=j._layout,l=j.classPrefix;j.preRender();k.preRender(j);return('<fieldset id="'+j._id+'" class="'+j.classes()+'" hidefocus="1" tabindex="-1">'+(j.settings.title?('<legend id="'+j._id+'-title" class="'+l+'fieldset-title">'+j.settings.title+"</legend>"):"")+'<div id="'+j._id+'-body" class="'+j.classes("body")+'">'+(j.settings.html||"")+k.renderHtml(j)+"</div></fieldset>")}})});h("tinymce/ui/FilePicker",["tinymce/ui/ComboBox","tinymce/util/Tools"],function(j,i){return j.extend({init:function(o){var m=this,n=tinymce.activeEditor,l=n.settings;var k,q,p;o.spellcheck=false;p=l.file_picker_types||l.file_browser_callback_types;if(p){p=i.makeMap(p,/[, ]/)}if(!p||p[o.filetype]){q=l.file_picker_callback;if(q&&(!p||p[o.filetype])){k=function(){var r=m.fire("beforecall").meta;r=i.extend({filetype:o.filetype},r);q.call(n,function(s,t){m.value(s).fire("change",{meta:t})},m.value(),r)}}else{q=l.file_browser_callback;if(q&&(!p||p[o.filetype])){k=function(){q(m.getEl("inp").id,m.value(),o.filetype,window)}}}}if(k){o.icon="browse";o.onaction=k}m._super(o)}})});h("tinymce/ui/FitLayout",["tinymce/ui/AbsoluteLayout"],function(i){return i.extend({recalc:function(k){var j=k.layoutRect(),l=k.paddingBox();k.items().filter(":visible").each(function(m){m.layoutRect({x:l.left,y:l.top,w:j.innerW-l.right-l.left,h:j.innerH-l.top-l.bottom});if(m.recalc){m.recalc()}})}})});h("tinymce/ui/FlexLayout",["tinymce/ui/AbsoluteLayout"],function(i){return i.extend({recalc:function(L){var X,S,y,V,t,B,R,w,m,Y,n,u;var T,k,o,q,s=[],r,E,P,I,J,W;var O,D,v,p,aa,M,x,N;var F,j,C,Q,H,U;var K,G;var z=Math.max,Z=Math.min;y=L.items().filter(":visible");V=L.layoutRect();t=L._paddingBox;B=L.settings;u=L.isRtl()?(B.direction||"row-reversed"):B.direction;R=B.align;w=L.isRtl()?(B.pack||"end"):B.pack;m=B.spacing||0;if(u=="row-reversed"||u=="column-reverse"){y=y.set(y.toArray().reverse());u=u.split("-")[0]}if(u=="column"){v="y";O="h";D="minH";p="maxH";M="innerH";aa="top";x="deltaH";N="contentH";H="left";C="w";F="x";j="innerW";Q="minW";U="right";K="deltaW";G="contentW"}else{v="x";O="w";D="minW";p="maxW";M="innerW";aa="left";x="deltaW";N="contentW";H="top";C="h";F="y";j="innerH";Q="minH";U="bottom";K="deltaH";G="contentH"}n=V[M]-t[aa]-t[aa];W=Y=0;for(X=0,S=y.length;X<S;X++){T=y[X];k=T.layoutRect();o=T.settings;q=o.flex;n-=(X<S-1?m:0);if(q>0){Y+=q;if(k[p]){s.push(T)}k.flex=q}n-=k[D];r=t[H]+k[Q]+t[U];if(r>W){W=r}}I={};if(n<0){I[D]=V[D]-n+V[x]}else{I[D]=V[M]-n+V[x]}I[Q]=W+V[K];I[N]=V[M]-n;I[G]=W;I.minW=Z(I.minW,V.maxW);I.minH=Z(I.minH,V.maxH);I.minW=z(I.minW,V.startMinWidth);I.minH=z(I.minH,V.startMinHeight);if(V.autoResize&&(I.minW!=V.minW||I.minH!=V.minH)){I.w=I.minW;I.h=I.minH;L.layoutRect(I);this.recalc(L);if(L._lastRect===null){var A=L.parent();if(A){A._lastRect=null;A.recalc()}}return}P=n/Y;for(X=0,S=s.length;X<S;X++){T=s[X];k=T.layoutRect();E=k[p];r=k[D]+k.flex*P;if(r>E){n-=(k[p]-k[D]);Y-=k.flex;k.flex=0;k.maxFlexSize=E}else{k.maxFlexSize=0}}P=n/Y;J=t[aa];I={};if(Y===0){if(w=="end"){J=n+t[aa]}else{if(w=="center"){J=Math.round((V[M]/2)-((V[M]-n)/2))+t[aa];if(J<0){J=t[aa]}}else{if(w=="justify"){J=t[aa];m=Math.floor(n/(y.length-1))}}}}I[F]=t[H];for(X=0,S=y.length;X<S;X++){T=y[X];k=T.layoutRect();r=k.maxFlexSize||k[D];if(R==="center"){I[F]=Math.round((V[j]/2)-(k[C]/2))}else{if(R==="stretch"){I[C]=z(k[Q]||0,V[j]-t[H]-t[U]);I[F]=t[H]}else{if(R==="end"){I[F]=V[j]-k[C]-t.top}}}if(k.flex>0){r+=k.flex*P}I[O]=r;I[v]=J;T.layoutRect(I);if(T.recalc){T.recalc()}J+=r+m}}})});h("tinymce/ui/FlowLayout",["tinymce/ui/Layout"],function(i){return i.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(j){j.items().filter(":visible").each(function(k){if(k.recalc){k.recalc()}})}})});h("tinymce/ui/FormatControls",["tinymce/ui/Control","tinymce/ui/Widget","tinymce/ui/FloatPanel","tinymce/util/Tools","tinymce/EditorManager","tinymce/Env"],function(n,m,p,j,l,i){var o=j.each;l.on("AddEditor",function(q){if(q.editor.rtl){n.rtl=true}k(q.editor)});n.translate=function(q){return l.translate(q)};m.tooltips=!i.iOS;function k(v){var q;function w(y,z){return function(){var A=this;v.on("nodeChange",function(D){var B=v.formatter;var C=null;o(D.parents,function(E){o(y,function(F){if(z){if(B.matchNode(E,z,{value:F.value})){C=F.value}}else{if(B.matchNode(E,F.value)){C=F.value}}if(C){return false}});if(C){return false}});A.value(C)})}}function t(y){y=y.replace(/;$/,"").split(";");var z=y.length;while(z--){y[z]=y[z].split("=")}return y}function s(){var C=0,B=[];var A=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 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"}]}];function y(D){var E=[];if(!D){return}o(D,function(H){var G={text:H.title,icon:H.icon};if(H.items){G.menu=y(H.items)}else{var F=H.format||"custom"+C++;if(!H.format){H.name=F;B.push(H)}G.format=F;G.cmd=H.cmd}E.push(G)});return E}function z(){var D;if(v.settings.style_formats_merge){if(v.settings.style_formats){D=y(A.concat(v.settings.style_formats))}else{D=y(A)}}else{D=y(v.settings.style_formats||A)}return D}v.on("init",function(){o(B,function(D){v.formatter.register(D.name,D)})});return{type:"menu",items:z(),onPostRender:function(D){v.fire("renderFormatsMenu",{control:D.control})},itemDefaults:{preview:true,textStyle:function(){if(this.settings.format){return v.formatter.getCssText(this.settings.format)}},onPostRender:function(){var D=this;D.parent().on("show",function(){var E,F;E=D.settings.format;if(E){D.disabled(!v.formatter.canApply(E));D.active(v.formatter.match(E))}F=D.settings.cmd;if(F){D.active(v.queryCommandState(F))}})},onclick:function(){if(this.settings.format){r(this.settings.format)}if(this.settings.cmd){v.execCommand(this.settings.cmd)}}}}}q=s();o({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(z,y){v.addButton(y,{tooltip:z,onPostRender:function(){var A=this;if(v.formatter){v.formatter.formatChanged(y,function(B){A.active(B)})}else{v.on("init",function(){v.formatter.formatChanged(y,function(B){A.active(B)})})}},onclick:function(){r(y)}})});o({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(z,y){v.addButton(y,{tooltip:z[0],cmd:z[1]})});o({blockquote:["Blockquote","mceBlockQuote"],numlist:["Numbered list","InsertOrderedList"],bullist:["Bullet list","InsertUnorderedList"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"]},function(z,y){v.addButton(y,{tooltip:z[0],cmd:z[1],onPostRender:function(){var A=this;if(v.formatter){v.formatter.formatChanged(y,function(B){A.active(B)})}else{v.on("init",function(){v.formatter.formatChanged(y,function(B){A.active(B)})})}}})});function u(y){return function(){var z=this;y=y=="redo"?"hasRedo":"hasUndo";function A(){return v.undoManager?v.undoManager[y]():false}z.disabled(!A());v.on("Undo Redo AddUndo TypingUndo ClearUndos",function(){z.disabled(!A())})}}function x(){var y=this;v.on("VisualAid",function(z){y.active(z.hasVisual)});y.active(v.hasVisual)}v.addButton("undo",{tooltip:"Undo",onPostRender:u("undo"),cmd:"undo"});v.addButton("redo",{tooltip:"Redo",onPostRender:u("redo"),cmd:"redo"});v.addMenuItem("newdocument",{text:"New document",icon:"newdocument",cmd:"mceNewDocument"});v.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onPostRender:u("undo"),cmd:"undo"});v.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onPostRender:u("redo"),cmd:"redo"});v.addMenuItem("visualaid",{text:"Visual aids",selectable:true,onPostRender:x,cmd:"mceToggleVisualAid"});o({cut:["Cut","Cut","Meta+X"],copy:["Copy","Copy","Meta+C"],paste:["Paste","Paste","Meta+V"],selectall:["Select all","SelectAll","Meta+A"],bold:["Bold","Bold","Meta+B"],italic:["Italic","Italic","Meta+I"],underline:["Underline","Underline"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(z,y){v.addMenuItem(y,{text:z[0],icon:y,shortcut:z[2],cmd:z[1]})});v.on("mousedown",function(){p.hideAll()});function r(y){if(y.control){y=y.control.value()}if(y){v.execCommand("mceToggleFormat",false,y)}}v.addButton("styleselect",{type:"menubutton",text:"Formats",menu:q});v.addButton("formatselect",function(){var y=[],z=t(v.settings.block_formats||"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre");o(z,function(A){y.push({text:A[0],value:A[1],textStyle:function(){return v.formatter.getCssText(A[1])}})});return{type:"listbox",text:z[0][0],values:y,fixedWidth:true,onselect:r,onPostRender:w(y)}});v.addButton("fontselect",function(){var z="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats";var y=[],A=t(v.settings.font_formats||z);o(A,function(B){y.push({text:{raw:B[0]},value:B[1],textStyle:B[1].indexOf("dings")==-1?"font-family:"+B[1]:""})});return{type:"listbox",text:"Font Family",tooltip:"Font Family",values:y,fixedWidth:true,onPostRender:w(y,"fontname"),onselect:function(B){if(B.control.settings.value){v.execCommand("FontName",false,B.control.settings.value)}}}});v.addButton("fontsizeselect",function(){var y=[],A="8pt 10pt 12pt 14pt 18pt 24pt 36pt";var z=v.settings.fontsize_formats||A;o(z.split(" "),function(C){var E=C,D=C;var B=C.split("=");if(B.length>1){E=B[0];D=B[1]}y.push({text:E,value:D})});return{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:y,fixedWidth:true,onPostRender:w(y,"fontsize"),onclick:function(B){if(B.control.settings.value){v.execCommand("FontSize",false,B.control.settings.value)}}}});v.addMenuItem("formats",{text:"Formats",menu:q})}});h("tinymce/ui/GridLayout",["tinymce/ui/AbsoluteLayout"],function(i){return i.extend({recalc:function(F){var T=F.settings,S,v,w,P,k,o,D,n,O,K,J,H,G,q,s,N,t,p,m,Q,A,z,M=[],j=[],B,U,r,u,I,V;T=F.settings;w=F.items().filter(":visible");P=F.layoutRect();v=T.columns||Math.ceil(Math.sqrt(w.length));S=Math.ceil(w.length/v);t=T.spacingH||T.spacing||0;p=T.spacingV||T.spacing||0;m=T.alignH||T.align;Q=T.alignV||T.align;s=F._paddingBox;I="reverseRows" in T?T.reverseRows:F.isRtl();if(m&&typeof m=="string"){m=[m]}if(Q&&typeof Q=="string"){Q=[Q]}for(K=0;K<v;K++){M.push(0)}for(J=0;J<S;J++){j.push(0)}for(J=0;J<S;J++){for(K=0;K<v;K++){O=w[J*v+K];if(!O){break}n=O.layoutRect();B=n.minW;U=n.minH;M[K]=B>M[K]?B:M[K];j[J]=U>j[J]?U:j[J]}}r=P.innerW-s.left-s.right;for(A=0,K=0;K<v;K++){A+=M[K]+(K>0?t:0);r-=(K>0?t:0)+M[K]}u=P.innerH-s.top-s.bottom;for(z=0,J=0;J<S;J++){z+=j[J]+(J>0?p:0);u-=(J>0?p:0)+j[J]}A+=s.left+s.right;z+=s.top+s.bottom;D={};D.minW=A+(P.w-P.innerW);D.minH=z+(P.h-P.innerH);D.contentW=D.minW-P.deltaW;D.contentH=D.minH-P.deltaH;D.minW=Math.min(D.minW,P.maxW);D.minH=Math.min(D.minH,P.maxH);D.minW=Math.max(D.minW,P.startMinWidth);D.minH=Math.max(D.minH,P.startMinHeight);if(P.autoResize&&(D.minW!=P.minW||D.minH!=P.minH)){D.w=D.minW;D.h=D.minH;F.layoutRect(D);this.recalc(F);if(F._lastRect===null){var C=F.parent();if(C){C._lastRect=null;C.recalc()}}return}if(P.autoResize){D=F.layoutRect(D);D.contentW=D.minW-P.deltaW;D.contentH=D.minH-P.deltaH}var E;if(T.packV=="start"){E=0}else{E=u>0?Math.floor(u/S):0}var R=0;var l=T.flexWidths;if(l){for(K=0;K<l.length;K++){R+=l[K]}}else{R=v}var L=r/R;for(K=0;K<v;K++){M[K]+=l?l[K]*L:L}G=s.top;for(J=0;J<S;J++){H=s.left;o=j[J]+E;for(K=0;K<v;K++){if(I){V=J*v+v-1-K}else{V=J*v+K}O=w[V];if(!O){break}q=O.settings;n=O.layoutRect();k=Math.max(M[K],n.startMinWidth);n.x=H;n.y=G;N=q.alignH||(m?(m[K]||m[0]):null);if(N=="center"){n.x=H+(k/2)-(n.w/2)}else{if(N=="right"){n.x=H+k-n.w}else{if(N=="stretch"){n.w=k}}}N=q.alignV||(Q?(Q[K]||Q[0]):null);if(N=="center"){n.y=G+(o/2)-(n.h/2)}else{if(N=="bottom"){n.y=G+o-n.h}else{if(N=="stretch"){n.h=o}}}O.layoutRect(n);H+=k+t;if(O.recalc){O.recalc()}}G+=o+p}}})});h("tinymce/ui/Iframe",["tinymce/ui/Widget"],function(i){return i.extend({renderHtml:function(){var j=this;j.addClass("iframe");j.canFocus=false;return('<iframe id="'+j._id+'" class="'+j.classes()+'" tabindex="-1" src="'+(j.settings.url||"javascript:''")+'" frameborder="0"></iframe>')},src:function(j){this.getEl().src=j},html:function(l,m){var k=this,j=this.getEl().contentWindow.document.body;if(!j){setTimeout(function(){k.html(l)},0)}else{j.innerHTML=l;if(m){m()}}return this}})});h("tinymce/ui/Label",["tinymce/ui/Widget","tinymce/ui/DomUtils"],function(j,i){return j.extend({init:function(l){var k=this;k._super(l);k.addClass("widget");k.addClass("label");k.canFocus=false;if(l.multiline){k.addClass("autoscroll")}if(l.strong){k.addClass("strong")}},initLayoutRect:function(){var k=this,m=k._super();if(k.settings.multiline){var l=i.getSize(k.getEl());if(l.width>m.maxW){m.minW=m.maxW;k.addClass("multiline")}k.getEl().style.width=m.minW+"px";m.startMinH=m.h=m.minH=Math.min(m.maxH,i.getSize(k.getEl()).height)}return m},repaint:function(){var k=this;if(!k.settings.multiline){k.getEl().style.lineHeight=k.layoutRect().h+"px"}return k._super()},text:function(l){var k=this;if(k._rendered&&l){this.innerHtml(k.encode(l))}return k._super(l)},renderHtml:function(){var l=this,k=l.settings.forId;return('<label id="'+l._id+'" class="'+l.classes()+'"'+(k?' for="'+k+'"':"")+">"+l.encode(l._text)+"</label>")}})});h("tinymce/ui/Toolbar",["tinymce/ui/Container"],function(i){return i.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(k){var j=this;j._super(k);j.addClass("toolbar")},postRender:function(){var j=this;j.items().addClass("toolbar-item");return j._super()}})});h("tinymce/ui/MenuBar",["tinymce/ui/Toolbar"],function(i){return i.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:true,defaults:{type:"menubutton"}}})});h("tinymce/ui/MenuButton",["tinymce/ui/Button","tinymce/ui/Factory","tinymce/ui/MenuBar"],function(l,j,k){function i(o,n){while(o){if(n===o){return true}o=o.parentNode}return false}var m=l.extend({init:function(o){var n=this;n._renderOpen=true;n._super(o);n.addClass("menubtn");if(o.fixedWidth){n.addClass("fixed-width")}n.aria("haspopup",true);n.hasPopup=true},showMenu:function(){var n=this,o=n.settings,p;if(n.menu&&n.menu.visible()){return n.hideMenu()}if(!n.menu){p=o.menu||[];if(p.length){p={type:"menu",items:p}}else{p.type=p.type||"menu"}n.menu=j.create(p).parent(n).renderTo();n.fire("createmenu");n.menu.reflow();n.menu.on("cancel",function(q){if(q.control.parent()===n.menu){q.stopPropagation();n.focus();n.hideMenu()}});n.menu.on("select",function(){n.focus()});n.menu.on("show hide",function(q){if(q.control==n.menu){n.activeMenu(q.type=="show")}n.aria("expanded",q.type=="show")}).fire("show")}n.menu.show();n.menu.layoutRect({w:n.layoutRect().w});n.menu.moveRel(n.getEl(),n.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},hideMenu:function(){var n=this;if(n.menu){n.menu.items().each(function(o){if(o.hideMenu){o.hideMenu()}});n.menu.hide()}},activeMenu:function(n){this.toggleClass("active",n)},renderHtml:function(){var n=this,r=n._id,p=n.classPrefix;var o=n.settings.icon,q;q=n.settings.image;if(q){o="none";if(typeof q!="string"){q=window.getSelection?q[0]:q[1]}q=" style=\"background-image: url('"+q+"')\""}else{q=""}o=n.settings.icon?p+"ico "+p+"i-"+o:"";n.aria("role",n.parent() instanceof k?"menuitem":"button");return('<div id="'+r+'" class="'+n.classes()+'" tabindex="-1" aria-labelledby="'+r+'"><button id="'+r+'-open" role="presentation" type="button" tabindex="-1">'+(o?'<i class="'+o+'"'+q+"></i>":"")+"<span>"+(n._text?(o?"\u00a0":"")+n.encode(n._text):"")+'</span> <i class="'+p+'caret"></i></button></div>')},postRender:function(){var n=this;n.on("click",function(o){if(o.control===n&&i(o.target,n.getEl())){n.showMenu();if(o.aria){n.menu.items()[0].focus()}}});n.on("mouseenter",function(r){var o=r.control,q=n.parent(),p;if(o&&q&&o instanceof m&&o.parent()==q){q.items().filter("MenuButton").each(function(s){if(s.hideMenu&&s!=o){if(s.menu&&s.menu.visible()){p=true}s.hideMenu()}});if(p){o.focus();o.showMenu()}}});return n._super()},text:function(q){var n=this,p,o;if(n._rendered){o=n.getEl("open").getElementsByTagName("span");for(p=0;p<o.length;p++){o[p].innerHTML=(n.settings.icon&&q?"\u00a0":"")+n.encode(q)}}return this._super(q)},remove:function(){this._super();if(this.menu){this.menu.remove()}}});return m});h("tinymce/ui/ListBox",["tinymce/ui/MenuButton"],function(i){return i.extend({init:function(n){var l=this,k,m,p,j;function o(q){for(var r=0;r<q.length;r++){m=q[r].selected||n.value===q[r].value;if(m){p=p||q[r].text;l._value=q[r].value;break}if(q[r].menu){o(q[r].menu)}}}l._values=k=n.values;if(k){o(k);if(!m&&k.length>0){p=k[0].text;l._value=k[0].value}n.menu=k}n.text=n.text||p||k[0].text;l._super(n);l.addClass("listbox");l.on("select",function(r){var q=r.control;if(j){r.lastControl=j}if(n.multiple){q.active(!q.active())}else{l.value(r.control.settings.value)}j=q})},value:function(l){var j=this,m,p,o;function n(r,q){r.items().each(function(s){m=s.value()===q;if(m){p=p||s.text()}s.active(m);if(s.menu){n(s.menu,q)}})}function k(q){for(var r=0;r<q.length;r++){m=q[r].value==l;if(m){p=p||q[r].text}q[r].active=m;if(q[r].menu){k(q[r].menu)}}}if(typeof l!="undefined"){if(j.menu){n(j.menu,l)}else{o=j.settings.menu;k(o)}j.text(p||this.settings.text)}return j._super(l)}})});h("tinymce/ui/MenuItem",["tinymce/ui/Widget","tinymce/ui/Factory","tinymce/Env"],function(k,i,j){return k.extend({Defaults:{border:0,role:"menuitem"},init:function(m){var l=this;l.hasPopup=true;l._super(m);m=l.settings;l.addClass("menu-item");if(m.menu){l.addClass("menu-item-expand")}if(m.preview){l.addClass("menu-item-preview")}if(l._text==="-"||l._text==="|"){l.addClass("menu-item-sep");l.aria("role","separator");l._text="-"}if(m.selectable){l.aria("role","menuitemcheckbox");l.addClass("menu-item-checkbox");m.icon="selected"}if(!m.preview&&!m.selectable){l.addClass("menu-item-normal")}l.on("mousedown",function(n){n.preventDefault()});if(m.menu&&!m.ariaHideMenu){l.aria("haspopup",true)}},hasMenus:function(){return !!this.settings.menu},showMenu:function(){var m=this,o=m.settings,p,n=m.parent();n.items().each(function(q){if(q!==m){q.hideMenu()}});if(o.menu){p=m.menu;if(!p){p=o.menu;if(p.length){p={type:"menu",items:p}}else{p.type=p.type||"menu"}if(n.settings.itemDefaults){p.itemDefaults=n.settings.itemDefaults}p=m.menu=i.create(p).parent(m).renderTo();p.reflow();p.on("cancel",function(q){q.stopPropagation();m.focus();p.hide()});p.on("show hide",function(q){q.control.items().each(function(r){r.active(r.settings.selected)})}).fire("show");p.on("hide",function(q){if(q.control===p){m.removeClass("selected")}});p.submenu=true}else{p.show()}p._parentMenu=n;p.addClass("menu-sub");var l=p.testMoveRel(m.getEl(),m.isRtl()?["tl-tr","bl-br","tr-tl","br-bl"]:["tr-tl","br-bl","tl-tr","bl-br"]);p.moveRel(m.getEl(),l);p.rel=l;l="menu-sub-"+l;p.removeClass(p._lastRel);p.addClass(l);p._lastRel=l;m.addClass("selected");m.aria("expanded",true)}},hideMenu:function(){var l=this;if(l.menu){l.menu.items().each(function(m){if(m.hideMenu){m.hideMenu()}});l.menu.hide();l.aria("expanded",false)}return l},renderHtml:function(){var t=this,l=t._id,o=t.settings,q=t.classPrefix,s=t.encode(t._text);var r=t.settings.icon,n="",p=o.shortcut;function m(u){var w,x,v={};if(j.mac){v={alt:"&#x2325;",ctrl:"&#x2318;",shift:"&#x21E7;",meta:"&#x2318;"}}else{v={meta:"Ctrl"}}u=u.split("+");for(w=0;w<u.length;w++){x=v[u[w].toLowerCase()];if(x){u[w]=x}}return u.join("+")}if(r){t.parent().addClass("menu-has-icons")}if(o.image){r="none";n=" style=\"background-image: url('"+o.image+"')\""}if(p){p=m(p)}r=q+"ico "+q+"i-"+(t.settings.icon||"none");return('<div id="'+l+'" class="'+t.classes()+'" tabindex="-1">'+(s!=="-"?'<i class="'+r+'"'+n+"></i>\u00a0":"")+(s!=="-"?'<span id="'+l+'-text" class="'+q+'text">'+s+"</span>":"")+(p?'<div id="'+l+'-shortcut" class="'+q+'menu-shortcut">'+p+"</div>":"")+(o.menu?'<div class="'+q+'caret"></div>':"")+"</div>")},postRender:function(){var m=this,n=m.settings;var o=n.textStyle;if(typeof o=="function"){o=o.call(this)}if(o){var l=m.getEl("text");if(l){l.setAttribute("style",o)}}m.on("mouseenter click",function(p){if(p.control===m){if(!n.menu&&p.type==="click"){m.fire("select");m.parent().hideAll()}else{m.showMenu();if(p.aria){m.menu.focus(true)}}}});m._super();return m},active:function(l){if(typeof l!="undefined"){this.aria("checked",l)}return this._super(l)},remove:function(){this._super();if(this.menu){this.menu.remove()}}})});h("tinymce/ui/Menu",["tinymce/ui/FloatPanel","tinymce/ui/MenuItem","tinymce/util/Tools"],function(l,k,i){var j=l.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:true},init:function(p){var n=this;p.autohide=true;p.constrainToViewport=true;if(p.itemDefaults){var m=p.items,o=m.length;while(o--){m[o]=i.extend({},p.itemDefaults,m[o])}}n._super(p);n.addClass("menu")},repaint:function(){this.toggleClass("menu-align",true);this._super();this.getEl().style.height="";this.getEl("body").style.height="";return this},cancel:function(){var m=this;m.hideAll();m.fire("select")},hideAll:function(){var m=this;this.find("menuitem").exec("hideMenu");return m._super()},preRender:function(){var m=this;m.items().each(function(o){var n=o.settings;if(n.icon||n.selectable){m._hasIcons=true;return false}});return m._super()}});return j});h("tinymce/ui/Radio",["tinymce/ui/Checkbox"],function(i){return i.extend({Defaults:{classes:"radio",role:"radio"}})});h("tinymce/ui/ResizeHandle",["tinymce/ui/Widget","tinymce/ui/DragHelper"],function(j,i){return j.extend({renderHtml:function(){var k=this,l=k.classPrefix;k.addClass("resizehandle");if(k.settings.direction=="both"){k.addClass("resizehandle-both")}k.canFocus=false;return('<div id="'+k._id+'" class="'+k.classes()+'"><i class="'+l+"ico "+l+'i-resize"></i></div>')},postRender:function(){var k=this;k._super();k.resizeDragHelper=new i(this._id,{start:function(){k.fire("ResizeStart")},drag:function(l){if(k.settings.direction!="both"){l.deltaX=0}k.fire("Resize",l)},stop:function(){k.fire("ResizeEnd")}})},remove:function(){if(this.resizeDragHelper){this.resizeDragHelper.destroy()}return this._super()}})});h("tinymce/ui/Spacer",["tinymce/ui/Widget"],function(i){return i.extend({renderHtml:function(){var j=this;j.addClass("spacer");j.canFocus=false;return'<div id="'+j._id+'" class="'+j.classes()+'"></div>'}})});h("tinymce/ui/SplitButton",["tinymce/ui/MenuButton","tinymce/ui/DomUtils"],function(j,i){return j.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var k=this,o=k.getEl(),m=k.layoutRect(),l,n;k._super();l=o.firstChild;n=o.lastChild;i.css(l,{width:m.w-i.getSize(n).width,height:m.h-2});i.css(n,{height:m.h-2});return k},activeMenu:function(l){var k=this;i.toggleClass(k.getEl().lastChild,k.classPrefix+"active",l)},renderHtml:function(){var k=this,o=k._id,m=k.classPrefix,n;var l=k.settings.icon;n=k.settings.image;if(n){l="none";if(typeof n!="string"){n=window.getSelection?n[0]:n[1]}n=" style=\"background-image: url('"+n+"')\""}else{n=""}l=k.settings.icon?m+"ico "+m+"i-"+l:"";return('<div id="'+o+'" class="'+k.classes()+'" role="button" tabindex="-1"><button type="button" hidefocus="1" tabindex="-1">'+(l?'<i class="'+l+'"'+n+"></i>":"")+(k._text?(l?" ":"")+k._text:"")+'</button><button type="button" class="'+m+'open" hidefocus="1" tabindex="-1">'+(k._menuBtnText?(l?"\u00a0":"")+k._menuBtnText:"")+' <i class="'+m+'caret"></i></button></div>')},postRender:function(){var k=this,l=k.settings.onclick;k.on("click",function(n){var m=n.target;if(n.control==this){while(m){if((n.aria&&n.aria.key!="down")||(m.nodeName=="BUTTON"&&m.className.indexOf("open")==-1)){n.stopImmediatePropagation();l.call(this,n);return}m=m.parentNode}}});delete k.settings.onclick;return k._super()}})});h("tinymce/ui/StackLayout",["tinymce/ui/FlowLayout"],function(i){return i.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"}})});h("tinymce/ui/TabPanel",["tinymce/ui/Panel","tinymce/ui/DomUtils"],function(j,i){return j.extend({Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(k){var l;if(this.activeTabId){l=this.getEl(this.activeTabId);i.removeClass(l,this.classPrefix+"active");l.setAttribute("aria-selected","false")}this.activeTabId="t"+k;l=this.getEl("t"+k);l.setAttribute("aria-selected","true");i.addClass(l,this.classPrefix+"active");this.items()[k].show().fire("showtab");this.reflow();this.items().each(function(n,m){if(k!=m){n.hide()}})},renderHtml:function(){var l=this,m=l._layout,k="",n=l.classPrefix;l.preRender();m.preRender(l);l.items().each(function(p,o){var q=l._id+"-t"+o;p.aria("role","tabpanel");p.aria("labelledby",q);k+=('<div id="'+q+'" class="'+n+'tab" unselectable="on" role="tab" aria-controls="'+p._id+'" aria-selected="false" tabIndex="-1">'+l.encode(p.settings.title)+"</div>")});return('<div id="'+l._id+'" class="'+l.classes()+'" hidefocus="1" tabindex="-1"><div id="'+l._id+'-head" class="'+n+'tabs" role="tablist">'+k+'</div><div id="'+l._id+'-body" class="'+l.classes("body")+'">'+m.renderHtml(l)+"</div></div>")},postRender:function(){var k=this;k._super();k.settings.activeTab=k.settings.activeTab||0;k.activateTab(k.settings.activeTab);this.on("click",function(n){var m=n.target.parentNode;if(n.target.parentNode.id==k._id+"-head"){var l=m.childNodes.length;while(l--){if(m.childNodes[l]==n.target){k.activateTab(l)}}}})},initLayoutRect:function(){var l=this,o,k,n;k=i.getSize(l.getEl("head")).width;k=k<0?0:k;n=0;l.items().each(function(p){k=Math.max(k,p.layoutRect().minW);n=Math.max(n,p.layoutRect().minH)});l.items().each(function(p){p.settings.x=0;p.settings.y=0;p.settings.w=k;p.settings.h=n;p.layoutRect({x:0,y:0,w:k,h:n})});var m=i.getSize(l.getEl("head")).height;l.settings.minWidth=k;l.settings.minHeight=n+m;o=l._super();o.deltaH+=m;o.innerH=o.h-o.deltaH;return o}})});h("tinymce/ui/TextBox",["tinymce/ui/Widget","tinymce/ui/DomUtils"],function(j,i){return j.extend({init:function(l){var k=this;k._super(l);k._value=l.value||"";k.addClass("textbox");if(l.multiline){k.addClass("multiline")}else{k.on("keydown",function(m){if(m.keyCode==13){k.parents().reverse().each(function(n){m.preventDefault();if(n.hasEventListeners("submit")&&n.toJSON){n.fire("submit",{data:n.toJSON()});return false}})}})}},disabled:function(l){var k=this;if(k._rendered&&typeof l!="undefined"){k.getEl().disabled=l}return k._super(l)},value:function(l){var k=this;if(typeof l!="undefined"){k._value=l;if(k._rendered){k.getEl().value=l}return k}if(k._rendered){return k.getEl().value}return k._value},repaint:function(){var l=this,n,o,r,m=0,p=0,k;n=l.getEl().style;o=l._layoutRect;k=l._lastRepaintRect||{};var q=document;if(!l.settings.multiline&&q.all&&(!q.documentMode||q.documentMode<=8)){n.lineHeight=(o.h-p)+"px"}r=l._borderBox;m=r.left+r.right+8;p=r.top+r.bottom+(l.settings.multiline?8:0);if(o.x!==k.x){n.left=o.x+"px";k.x=o.x}if(o.y!==k.y){n.top=o.y+"px";k.y=o.y}if(o.w!==k.w){n.width=(o.w-m)+"px";k.w=o.w}if(o.h!==k.h){n.height=(o.h-p)+"px";k.h=o.h}l._lastRepaintRect=k;l.fire("repaint",{},false);return l},renderHtml:function(){var k=this,o=k._id,l=k.settings,n=k.encode(k._value,false),m="";if("spellcheck" in l){m+=' spellcheck="'+l.spellcheck+'"'}if(l.maxLength){m+=' maxlength="'+l.maxLength+'"'}if(l.size){m+=' size="'+l.size+'"'}if(l.subtype){m+=' type="'+l.subtype+'"'}if(k.disabled()){m+=' disabled="disabled"'}if(l.multiline){return('<textarea id="'+o+'" class="'+k.classes()+'" '+(l.rows?' rows="'+l.rows+'"':"")+' hidefocus="1"'+m+">"+n+"</textarea>")}return'<input id="'+o+'" class="'+k.classes()+'" value="'+n+'" hidefocus="1"'+m+" />"},postRender:function(){var k=this;i.on(k.getEl(),"change",function(l){k.fire("change",l)});return k._super()},remove:function(){i.off(this.getEl());this._super()}})});h("tinymce/ui/Throbber",["tinymce/ui/DomUtils","tinymce/ui/Control"],function(i,j){return function(o,n){var l=this,m,k=j.classPrefix;l.show=function(p){l.hide();m=true;window.setTimeout(function(){if(m){o.appendChild(i.createFragment('<div class="'+k+"throbber"+(n?" "+k+"throbber-inline":"")+'"></div>'))}},p||0);return l};l.hide=function(){var p=o.lastChild;if(p&&p.className.indexOf("throbber")!=-1){p.parentNode.removeChild(p)}m=false;return l}}});a(["tinymce/dom/EventUtils","tinymce/dom/Sizzle","tinymce/Env","tinymce/util/Tools","tinymce/dom/DomQuery","tinymce/html/Styles","tinymce/dom/TreeWalker","tinymce/dom/Range","tinymce/html/Entities","tinymce/dom/DOMUtils","tinymce/dom/ScriptLoader","tinymce/AddOnManager","tinymce/dom/RangeUtils","tinymce/html/Node","tinymce/html/Schema","tinymce/html/SaxParser","tinymce/html/DomParser","tinymce/html/Writer","tinymce/html/Serializer","tinymce/dom/Serializer","tinymce/dom/TridentSelection","tinymce/util/VK","tinymce/dom/ControlSelection","tinymce/dom/BookmarkManager","tinymce/dom/Selection","tinymce/dom/ElementUtils","tinymce/Formatter","tinymce/UndoManager","tinymce/EnterKey","tinymce/ForceBlocks","tinymce/EditorCommands","tinymce/util/URI","tinymce/util/Class","tinymce/util/EventDispatcher","tinymce/ui/Selector","tinymce/ui/Collection","tinymce/ui/DomUtils","tinymce/ui/Control","tinymce/ui/Factory","tinymce/ui/KeyboardNavigation","tinymce/ui/Container","tinymce/ui/DragHelper","tinymce/ui/Scrollable","tinymce/ui/Panel","tinymce/ui/Movable","tinymce/ui/Resizable","tinymce/ui/FloatPanel","tinymce/ui/Window","tinymce/ui/MessageBox","tinymce/WindowManager","tinymce/util/Quirks","tinymce/util/Observable","tinymce/EditorObservable","tinymce/Shortcuts","tinymce/Editor","tinymce/util/I18n","tinymce/FocusManager","tinymce/EditorManager","tinymce/LegacyInput","tinymce/util/XHR","tinymce/util/JSON","tinymce/util/JSONRequest","tinymce/util/JSONP","tinymce/util/LocalStorage","tinymce/Compat","tinymce/ui/Layout","tinymce/ui/AbsoluteLayout","tinymce/ui/Tooltip","tinymce/ui/Widget","tinymce/ui/Button","tinymce/ui/ButtonGroup","tinymce/ui/Checkbox","tinymce/ui/ComboBox","tinymce/ui/ColorBox","tinymce/ui/PanelButton","tinymce/ui/ColorButton","tinymce/util/Color","tinymce/ui/ColorPicker","tinymce/ui/Path","tinymce/ui/ElementPath","tinymce/ui/FormItem","tinymce/ui/Form","tinymce/ui/FieldSet","tinymce/ui/FilePicker","tinymce/ui/FitLayout","tinymce/ui/FlexLayout","tinymce/ui/FlowLayout","tinymce/ui/FormatControls","tinymce/ui/GridLayout","tinymce/ui/Iframe","tinymce/ui/Label","tinymce/ui/Toolbar","tinymce/ui/MenuBar","tinymce/ui/MenuButton","tinymce/ui/ListBox","tinymce/ui/MenuItem","tinymce/ui/Menu","tinymce/ui/Radio","tinymce/ui/ResizeHandle","tinymce/ui/Spacer","tinymce/ui/SplitButton","tinymce/ui/StackLayout","tinymce/ui/TabPanel","tinymce/ui/TextBox","tinymce/ui/Throbber"])})(this);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/tinymce.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,38265 @@
+// 4.1.10 (2015-05-05)
+
+/**
+ * Compiled inline version. (Library mode)
+ */
+
+/*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */
+/*globals $code */
+
+(function(exports, undefined) {
+	"use strict";
+
+	var modules = {};
+
+	function require(ids, callback) {
+		var module, defs = [];
+
+		for (var i = 0; i < ids.length; ++i) {
+			module = modules[ids[i]] || resolve(ids[i]);
+			if (!module) {
+				throw 'module definition dependecy not found: ' + ids[i];
+			}
+
+			defs.push(module);
+		}
+
+		callback.apply(null, defs);
+	}
+
+	function define(id, dependencies, definition) {
+		if (typeof id !== 'string') {
+			throw 'invalid module definition, module id must be defined and be a string';
+		}
+
+		if (dependencies === undefined) {
+			throw 'invalid module definition, dependencies must be specified';
+		}
+
+		if (definition === undefined) {
+			throw 'invalid module definition, definition function must be specified';
+		}
+
+		require(dependencies, function() {
+			modules[id] = definition.apply(null, arguments);
+		});
+	}
+
+	function defined(id) {
+		return !!modules[id];
+	}
+
+	function resolve(id) {
+		var target = exports;
+		var fragments = id.split(/[.\/]/);
+
+		for (var fi = 0; fi < fragments.length; ++fi) {
+			if (!target[fragments[fi]]) {
+				return;
+			}
+
+			target = target[fragments[fi]];
+		}
+
+		return target;
+	}
+
+	function expose(ids) {
+		for (var i = 0; i < ids.length; i++) {
+			var target = exports;
+			var id = ids[i];
+			var fragments = id.split(/[.\/]/);
+
+			for (var fi = 0; fi < fragments.length - 1; ++fi) {
+				if (target[fragments[fi]] === undefined) {
+					target[fragments[fi]] = {};
+				}
+
+				target = target[fragments[fi]];
+			}
+
+			target[fragments[fragments.length - 1]] = modules[id];
+		}
+	}
+
+// Included from: js/tinymce/classes/dom/EventUtils.js
+
+/**
+ * EventUtils.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*jshint loopfunc:true*/
+/*eslint no-loop-func:0 */
+
+/**
+ * This class wraps the browsers native event logic with more convenient methods.
+ *
+ * @class tinymce.dom.EventUtils
+ */
+define("tinymce/dom/EventUtils", [], function() {
+	"use strict";
+
+	var eventExpandoPrefix = "mce-data-";
+	var mouseEventRe = /^(?:mouse|contextmenu)|click/;
+	var deprecated = {keyLocation: 1, layerX: 1, layerY: 1, returnValue: 1};
+
+	/**
+	 * Binds a native event to a callback on the speified target.
+	 */
+	function addEvent(target, name, callback, capture) {
+		if (target.addEventListener) {
+			target.addEventListener(name, callback, capture || false);
+		} else if (target.attachEvent) {
+			target.attachEvent('on' + name, callback);
+		}
+	}
+
+	/**
+	 * Unbinds a native event callback on the specified target.
+	 */
+	function removeEvent(target, name, callback, capture) {
+		if (target.removeEventListener) {
+			target.removeEventListener(name, callback, capture || false);
+		} else if (target.detachEvent) {
+			target.detachEvent('on' + name, callback);
+		}
+	}
+
+	/**
+	 * Normalizes a native event object or just adds the event specific methods on a custom event.
+	 */
+	function fix(originalEvent, data) {
+		var name, event = data || {}, undef;
+
+		// Dummy function that gets replaced on the delegation state functions
+		function returnFalse() {
+			return false;
+		}
+
+		// Dummy function that gets replaced on the delegation state functions
+		function returnTrue() {
+			return true;
+		}
+
+		// Copy all properties from the original event
+		for (name in originalEvent) {
+			// layerX/layerY is deprecated in Chrome and produces a warning
+			if (!deprecated[name]) {
+				event[name] = originalEvent[name];
+			}
+		}
+
+		// Normalize target IE uses srcElement
+		if (!event.target) {
+			event.target = event.srcElement || document;
+		}
+
+		// Calculate pageX/Y if missing and clientX/Y available
+		if (originalEvent && mouseEventRe.test(originalEvent.type) && originalEvent.pageX === undef && originalEvent.clientX !== undef) {
+			var eventDoc = event.target.ownerDocument || document;
+			var doc = eventDoc.documentElement;
+			var body = eventDoc.body;
+
+			event.pageX = originalEvent.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) -
+				(doc && doc.clientLeft || body && body.clientLeft || 0);
+
+			event.pageY = originalEvent.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) -
+				(doc && doc.clientTop || body && body.clientTop || 0);
+		}
+
+		// Add preventDefault method
+		event.preventDefault = function() {
+			event.isDefaultPrevented = returnTrue;
+
+			// Execute preventDefault on the original event object
+			if (originalEvent) {
+				if (originalEvent.preventDefault) {
+					originalEvent.preventDefault();
+				} else {
+					originalEvent.returnValue = false; // IE
+				}
+			}
+		};
+
+		// Add stopPropagation
+		event.stopPropagation = function() {
+			event.isPropagationStopped = returnTrue;
+
+			// Execute stopPropagation on the original event object
+			if (originalEvent) {
+				if (originalEvent.stopPropagation) {
+					originalEvent.stopPropagation();
+				} else {
+					originalEvent.cancelBubble = true; // IE
+				}
+			}
+		};
+
+		// Add stopImmediatePropagation
+		event.stopImmediatePropagation = function() {
+			event.isImmediatePropagationStopped = returnTrue;
+			event.stopPropagation();
+		};
+
+		// Add event delegation states
+		if (!event.isDefaultPrevented) {
+			event.isDefaultPrevented = returnFalse;
+			event.isPropagationStopped = returnFalse;
+			event.isImmediatePropagationStopped = returnFalse;
+		}
+
+		return event;
+	}
+
+	/**
+	 * Bind a DOMContentLoaded event across browsers and executes the callback once the page DOM is initialized.
+	 * It will also set/check the domLoaded state of the event_utils instance so ready isn't called multiple times.
+	 */
+	function bindOnReady(win, callback, eventUtils) {
+		var doc = win.document, event = {type: 'ready'};
+
+		if (eventUtils.domLoaded) {
+			callback(event);
+			return;
+		}
+
+		// Gets called when the DOM is ready
+		function readyHandler() {
+			if (!eventUtils.domLoaded) {
+				eventUtils.domLoaded = true;
+				callback(event);
+			}
+		}
+
+		function waitForDomLoaded() {
+			// Check complete or interactive state if there is a body
+			// element on some iframes IE 8 will produce a null body
+			if (doc.readyState === "complete" || (doc.readyState === "interactive" && doc.body)) {
+				removeEvent(doc, "readystatechange", waitForDomLoaded);
+				readyHandler();
+			}
+		}
+
+		function tryScroll() {
+			try {
+				// If IE is used, use the trick by Diego Perini licensed under MIT by request to the author.
+				// http://javascript.nwbox.com/IEContentLoaded/
+				doc.documentElement.doScroll("left");
+			} catch (ex) {
+				setTimeout(tryScroll, 0);
+				return;
+			}
+
+			readyHandler();
+		}
+
+		// Use W3C method
+		if (doc.addEventListener) {
+			if (doc.readyState === "complete") {
+				readyHandler();
+			} else {
+				addEvent(win, 'DOMContentLoaded', readyHandler);
+			}
+		} else {
+			// Use IE method
+			addEvent(doc, "readystatechange", waitForDomLoaded);
+
+			// Wait until we can scroll, when we can the DOM is initialized
+			if (doc.documentElement.doScroll && win.self === win.top) {
+				tryScroll();
+			}
+		}
+
+		// Fallback if any of the above methods should fail for some odd reason
+		addEvent(win, 'load', readyHandler);
+	}
+
+	/**
+	 * This class enables you to bind/unbind native events to elements and normalize it's behavior across browsers.
+	 */
+	function EventUtils() {
+		var self = this, events = {}, count, expando, hasFocusIn, hasMouseEnterLeave, mouseEnterLeave;
+
+		expando = eventExpandoPrefix + (+new Date()).toString(32);
+		hasMouseEnterLeave = "onmouseenter" in document.documentElement;
+		hasFocusIn = "onfocusin" in document.documentElement;
+		mouseEnterLeave = {mouseenter: 'mouseover', mouseleave: 'mouseout'};
+		count = 1;
+
+		// State if the DOMContentLoaded was executed or not
+		self.domLoaded = false;
+		self.events = events;
+
+		/**
+		 * Executes all event handler callbacks for a specific event.
+		 *
+		 * @private
+		 * @param {Event} evt Event object.
+		 * @param {String} id Expando id value to look for.
+		 */
+		function executeHandlers(evt, id) {
+			var callbackList, i, l, callback, container = events[id];
+
+			callbackList = container && container[evt.type];
+			if (callbackList) {
+				for (i = 0, l = callbackList.length; i < l; i++) {
+					callback = callbackList[i];
+
+					// Check if callback exists might be removed if a unbind is called inside the callback
+					if (callback && callback.func.call(callback.scope, evt) === false) {
+						evt.preventDefault();
+					}
+
+					// Should we stop propagation to immediate listeners
+					if (evt.isImmediatePropagationStopped()) {
+						return;
+					}
+				}
+			}
+		}
+
+		/**
+		 * Binds a callback to an event on the specified target.
+		 *
+		 * @method bind
+		 * @param {Object} target Target node/window or custom object.
+		 * @param {String} names Name of the event to bind.
+		 * @param {function} callback Callback function to execute when the event occurs.
+		 * @param {Object} scope Scope to call the callback function on, defaults to target.
+		 * @return {function} Callback function that got bound.
+		 */
+		self.bind = function(target, names, callback, scope) {
+			var id, callbackList, i, name, fakeName, nativeHandler, capture, win = window;
+
+			// Native event handler function patches the event and executes the callbacks for the expando
+			function defaultNativeHandler(evt) {
+				executeHandlers(fix(evt || win.event), id);
+			}
+
+			// Don't bind to text nodes or comments
+			if (!target || target.nodeType === 3 || target.nodeType === 8) {
+				return;
+			}
+
+			// Create or get events id for the target
+			if (!target[expando]) {
+				id = count++;
+				target[expando] = id;
+				events[id] = {};
+			} else {
+				id = target[expando];
+			}
+
+			// Setup the specified scope or use the target as a default
+			scope = scope || target;
+
+			// Split names and bind each event, enables you to bind multiple events with one call
+			names = names.split(' ');
+			i = names.length;
+			while (i--) {
+				name = names[i];
+				nativeHandler = defaultNativeHandler;
+				fakeName = capture = false;
+
+				// Use ready instead of DOMContentLoaded
+				if (name === "DOMContentLoaded") {
+					name = "ready";
+				}
+
+				// DOM is already ready
+				if (self.domLoaded && name === "ready" && target.readyState == 'complete') {
+					callback.call(scope, fix({type: name}));
+					continue;
+				}
+
+				// Handle mouseenter/mouseleaver
+				if (!hasMouseEnterLeave) {
+					fakeName = mouseEnterLeave[name];
+
+					if (fakeName) {
+						nativeHandler = function(evt) {
+							var current, related;
+
+							current = evt.currentTarget;
+							related = evt.relatedTarget;
+
+							// Check if related is inside the current target if it's not then the event should
+							// be ignored since it's a mouseover/mouseout inside the element
+							if (related && current.contains) {
+								// Use contains for performance
+								related = current.contains(related);
+							} else {
+								while (related && related !== current) {
+									related = related.parentNode;
+								}
+							}
+
+							// Fire fake event
+							if (!related) {
+								evt = fix(evt || win.event);
+								evt.type = evt.type === 'mouseout' ? 'mouseleave' : 'mouseenter';
+								evt.target = current;
+								executeHandlers(evt, id);
+							}
+						};
+					}
+				}
+
+				// Fake bubbeling of focusin/focusout
+				if (!hasFocusIn && (name === "focusin" || name === "focusout")) {
+					capture = true;
+					fakeName = name === "focusin" ? "focus" : "blur";
+					nativeHandler = function(evt) {
+						evt = fix(evt || win.event);
+						evt.type = evt.type === 'focus' ? 'focusin' : 'focusout';
+						executeHandlers(evt, id);
+					};
+				}
+
+				// Setup callback list and bind native event
+				callbackList = events[id][name];
+				if (!callbackList) {
+					events[id][name] = callbackList = [{func: callback, scope: scope}];
+					callbackList.fakeName = fakeName;
+					callbackList.capture = capture;
+					//callbackList.callback = callback;
+
+					// Add the nativeHandler to the callback list so that we can later unbind it
+					callbackList.nativeHandler = nativeHandler;
+
+					// Check if the target has native events support
+
+					if (name === "ready") {
+						bindOnReady(target, nativeHandler, self);
+					} else {
+						addEvent(target, fakeName || name, nativeHandler, capture);
+					}
+				} else {
+					if (name === "ready" && self.domLoaded) {
+						callback({type: name});
+					} else {
+						// If it already has an native handler then just push the callback
+						callbackList.push({func: callback, scope: scope});
+					}
+				}
+			}
+
+			target = callbackList = 0; // Clean memory for IE
+
+			return callback;
+		};
+
+		/**
+		 * Unbinds the specified event by name, name and callback or all events on the target.
+		 *
+		 * @method unbind
+		 * @param {Object} target Target node/window or custom object.
+		 * @param {String} names Optional event name to unbind.
+		 * @param {function} callback Optional callback function to unbind.
+		 * @return {EventUtils} Event utils instance.
+		 */
+		self.unbind = function(target, names, callback) {
+			var id, callbackList, i, ci, name, eventMap;
+
+			// Don't bind to text nodes or comments
+			if (!target || target.nodeType === 3 || target.nodeType === 8) {
+				return self;
+			}
+
+			// Unbind event or events if the target has the expando
+			id = target[expando];
+			if (id) {
+				eventMap = events[id];
+
+				// Specific callback
+				if (names) {
+					names = names.split(' ');
+					i = names.length;
+					while (i--) {
+						name = names[i];
+						callbackList = eventMap[name];
+
+						// Unbind the event if it exists in the map
+						if (callbackList) {
+							// Remove specified callback
+							if (callback) {
+								ci = callbackList.length;
+								while (ci--) {
+									if (callbackList[ci].func === callback) {
+										var nativeHandler = callbackList.nativeHandler;
+										var fakeName = callbackList.fakeName, capture = callbackList.capture;
+
+										// Clone callbackList since unbind inside a callback would otherwise break the handlers loop
+										callbackList = callbackList.slice(0, ci).concat(callbackList.slice(ci + 1));
+										callbackList.nativeHandler = nativeHandler;
+										callbackList.fakeName = fakeName;
+										callbackList.capture = capture;
+
+										eventMap[name] = callbackList;
+									}
+								}
+							}
+
+							// Remove all callbacks if there isn't a specified callback or there is no callbacks left
+							if (!callback || callbackList.length === 0) {
+								delete eventMap[name];
+								removeEvent(target, callbackList.fakeName || name, callbackList.nativeHandler, callbackList.capture);
+							}
+						}
+					}
+				} else {
+					// All events for a specific element
+					for (name in eventMap) {
+						callbackList = eventMap[name];
+						removeEvent(target, callbackList.fakeName || name, callbackList.nativeHandler, callbackList.capture);
+					}
+
+					eventMap = {};
+				}
+
+				// Check if object is empty, if it isn't then we won't remove the expando map
+				for (name in eventMap) {
+					return self;
+				}
+
+				// Delete event object
+				delete events[id];
+
+				// Remove expando from target
+				try {
+					// IE will fail here since it can't delete properties from window
+					delete target[expando];
+				} catch (ex) {
+					// IE will set it to null
+					target[expando] = null;
+				}
+			}
+
+			return self;
+		};
+
+		/**
+		 * Fires the specified event on the specified target.
+		 *
+		 * @method fire
+		 * @param {Object} target Target node/window or custom object.
+		 * @param {String} name Event name to fire.
+		 * @param {Object} args Optional arguments to send to the observers.
+		 * @return {EventUtils} Event utils instance.
+		 */
+		self.fire = function(target, name, args) {
+			var id;
+
+			// Don't bind to text nodes or comments
+			if (!target || target.nodeType === 3 || target.nodeType === 8) {
+				return self;
+			}
+
+			// Build event object by patching the args
+			args = fix(null, args);
+			args.type = name;
+			args.target = target;
+
+			do {
+				// Found an expando that means there is listeners to execute
+				id = target[expando];
+				if (id) {
+					executeHandlers(args, id);
+				}
+
+				// Walk up the DOM
+				target = target.parentNode || target.ownerDocument || target.defaultView || target.parentWindow;
+			} while (target && !args.isPropagationStopped());
+
+			return self;
+		};
+
+		/**
+		 * Removes all bound event listeners for the specified target. This will also remove any bound
+		 * listeners to child nodes within that target.
+		 *
+		 * @method clean
+		 * @param {Object} target Target node/window object.
+		 * @return {EventUtils} Event utils instance.
+		 */
+		self.clean = function(target) {
+			var i, children, unbind = self.unbind;
+
+			// Don't bind to text nodes or comments
+			if (!target || target.nodeType === 3 || target.nodeType === 8) {
+				return self;
+			}
+
+			// Unbind any element on the specificed target
+			if (target[expando]) {
+				unbind(target);
+			}
+
+			// Target doesn't have getElementsByTagName it's probably a window object then use it's document to find the children
+			if (!target.getElementsByTagName) {
+				target = target.document;
+			}
+
+			// Remove events from each child element
+			if (target && target.getElementsByTagName) {
+				unbind(target);
+
+				children = target.getElementsByTagName('*');
+				i = children.length;
+				while (i--) {
+					target = children[i];
+
+					if (target[expando]) {
+						unbind(target);
+					}
+				}
+			}
+
+			return self;
+		};
+
+		/**
+		 * Destroys the event object. Call this on IE to remove memory leaks.
+		 */
+		self.destroy = function() {
+			events = {};
+		};
+
+		// Legacy function for canceling events
+		self.cancel = function(e) {
+			if (e) {
+				e.preventDefault();
+				e.stopImmediatePropagation();
+			}
+
+			return false;
+		};
+	}
+
+	EventUtils.Event = new EventUtils();
+	EventUtils.Event.bind(window, 'ready', function() {});
+
+	return EventUtils;
+});
+
+// Included from: js/tinymce/classes/dom/Sizzle.js
+
+/**
+ * Sizzle.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ *
+ * @ignore-file
+ */
+
+/*jshint bitwise:false, expr:true, noempty:false, sub:true, eqnull:true, latedef:false, maxlen:255 */
+/*eslint dot-notation:0, no-empty:0, no-cond-assign:0, no-unused-expressions:0, new-cap:0 */
+/*eslint no-nested-ternary:0, func-style:0, no-bitwise:0, max-len:0, brace-style:0, no-return-assign:0, no-multi-spaces:0 */
+
+/**
+ * Sizzle CSS Selector Engine v@VERSION
+ * http://sizzlejs.com/
+ *
+ * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ *
+ * Date: @DATE
+ */
+define("tinymce/dom/Sizzle", [], function() {
+var i,
+	support,
+	Expr,
+	getText,
+	isXML,
+	tokenize,
+	compile,
+	select,
+	outermostContext,
+	sortInput,
+	hasDuplicate,
+
+	// Local document vars
+	setDocument,
+	document,
+	docElem,
+	documentIsHTML,
+	rbuggyQSA,
+	rbuggyMatches,
+	matches,
+	contains,
+
+	// Instance-specific data
+	expando = "sizzle" + -(new Date()),
+	preferredDoc = window.document,
+	dirruns = 0,
+	done = 0,
+	classCache = createCache(),
+	tokenCache = createCache(),
+	compilerCache = createCache(),
+	sortOrder = function( a, b ) {
+		if ( a === b ) {
+			hasDuplicate = true;
+		}
+		return 0;
+	},
+
+	// General-purpose constants
+	strundefined = typeof undefined,
+	MAX_NEGATIVE = 1 << 31,
+
+	// Instance methods
+	hasOwn = ({}).hasOwnProperty,
+	arr = [],
+	pop = arr.pop,
+	push_native = arr.push,
+	push = arr.push,
+	slice = arr.slice,
+	// Use a stripped-down indexOf if we can't use a native one
+	indexOf = arr.indexOf || function( elem ) {
+		var i = 0,
+			len = this.length;
+		for ( ; i < len; i++ ) {
+			if ( this[i] === elem ) {
+				return i;
+			}
+		}
+		return -1;
+	},
+
+	booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
+
+	// Regular expressions
+
+	// http://www.w3.org/TR/css3-selectors/#whitespace
+	whitespace = "[\\x20\\t\\r\\n\\f]",
+
+	// http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
+	identifier = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
+
+	// Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
+	attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
+		// Operator (capture 2)
+		"*([*^$|!~]?=)" + whitespace +
+		// "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
+		"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
+		"*\\]",
+
+	pseudos = ":(" + identifier + ")(?:\\((" +
+		// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
+		// 1. quoted (capture 3; capture 4 or capture 5)
+		"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
+		// 2. simple (capture 6)
+		"((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
+		// 3. anything else (capture 2)
+		".*" +
+		")\\)|)",
+
+	// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
+	rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
+
+	rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
+	rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
+
+	rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
+
+	rpseudo = new RegExp( pseudos ),
+	ridentifier = new RegExp( "^" + identifier + "$" ),
+
+	matchExpr = {
+		"ID": new RegExp( "^#(" + identifier + ")" ),
+		"CLASS": new RegExp( "^\\.(" + identifier + ")" ),
+		"TAG": new RegExp( "^(" + identifier + "|[*])" ),
+		"ATTR": new RegExp( "^" + attributes ),
+		"PSEUDO": new RegExp( "^" + pseudos ),
+		"CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
+			"*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
+			"*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
+		"bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
+		// For use in libraries implementing .is()
+		// We use this for POS matching in `select`
+		"needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
+			whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
+	},
+
+	rinputs = /^(?:input|select|textarea|button)$/i,
+	rheader = /^h\d$/i,
+
+	rnative = /^[^{]+\{\s*\[native \w/,
+
+	// Easily-parseable/retrievable ID or TAG or CLASS selectors
+	rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
+
+	rsibling = /[+~]/,
+	rescape = /'|\\/g,
+
+	// CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
+	runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
+	funescape = function( _, escaped, escapedWhitespace ) {
+		var high = "0x" + escaped - 0x10000;
+		// NaN means non-codepoint
+		// Support: Firefox<24
+		// Workaround erroneous numeric interpretation of +"0x"
+		return high !== high || escapedWhitespace ?
+			escaped :
+			high < 0 ?
+				// BMP codepoint
+				String.fromCharCode( high + 0x10000 ) :
+				// Supplemental Plane codepoint (surrogate pair)
+				String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
+	};
+
+// Optimize for push.apply( _, NodeList )
+try {
+	push.apply(
+		(arr = slice.call( preferredDoc.childNodes )),
+		preferredDoc.childNodes
+	);
+	// Support: Android<4.0
+	// Detect silently failing push.apply
+	arr[ preferredDoc.childNodes.length ].nodeType;
+} catch ( e ) {
+	push = { apply: arr.length ?
+
+		// Leverage slice if possible
+		function( target, els ) {
+			push_native.apply( target, slice.call(els) );
+		} :
+
+		// Support: IE<9
+		// Otherwise append directly
+		function( target, els ) {
+			var j = target.length,
+				i = 0;
+			// Can't trust NodeList.length
+			while ( (target[j++] = els[i++]) ) {}
+			target.length = j - 1;
+		}
+	};
+}
+
+function Sizzle( selector, context, results, seed ) {
+	var match, elem, m, nodeType,
+		// QSA vars
+		i, groups, old, nid, newContext, newSelector;
+
+	if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
+		setDocument( context );
+	}
+
+	context = context || document;
+	results = results || [];
+
+	if ( !selector || typeof selector !== "string" ) {
+		return results;
+	}
+
+	if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
+		return [];
+	}
+
+	if ( documentIsHTML && !seed ) {
+
+		// Shortcuts
+		if ( (match = rquickExpr.exec( selector )) ) {
+			// Speed-up: Sizzle("#ID")
+			if ( (m = match[1]) ) {
+				if ( nodeType === 9 ) {
+					elem = context.getElementById( m );
+					// Check parentNode to catch when Blackberry 4.6 returns
+					// nodes that are no longer in the document (jQuery #6963)
+					if ( elem && elem.parentNode ) {
+						// Handle the case where IE, Opera, and Webkit return items
+						// by name instead of ID
+						if ( elem.id === m ) {
+							results.push( elem );
+							return results;
+						}
+					} else {
+						return results;
+					}
+				} else {
+					// Context is not a document
+					if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
+						contains( context, elem ) && elem.id === m ) {
+						results.push( elem );
+						return results;
+					}
+				}
+
+			// Speed-up: Sizzle("TAG")
+			} else if ( match[2] ) {
+				push.apply( results, context.getElementsByTagName( selector ) );
+				return results;
+
+			// Speed-up: Sizzle(".CLASS")
+			} else if ( (m = match[3]) && support.getElementsByClassName ) {
+				push.apply( results, context.getElementsByClassName( m ) );
+				return results;
+			}
+		}
+
+		// QSA path
+		if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
+			nid = old = expando;
+			newContext = context;
+			newSelector = nodeType === 9 && selector;
+
+			// qSA works strangely on Element-rooted queries
+			// We can work around this by specifying an extra ID on the root
+			// and working up from there (Thanks to Andrew Dupont for the technique)
+			// IE 8 doesn't work on object elements
+			if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
+				groups = tokenize( selector );
+
+				if ( (old = context.getAttribute("id")) ) {
+					nid = old.replace( rescape, "\\$&" );
+				} else {
+					context.setAttribute( "id", nid );
+				}
+				nid = "[id='" + nid + "'] ";
+
+				i = groups.length;
+				while ( i-- ) {
+					groups[i] = nid + toSelector( groups[i] );
+				}
+				newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context;
+				newSelector = groups.join(",");
+			}
+
+			if ( newSelector ) {
+				try {
+					push.apply( results,
+						newContext.querySelectorAll( newSelector )
+					);
+					return results;
+				} catch(qsaError) {
+				} finally {
+					if ( !old ) {
+						context.removeAttribute("id");
+					}
+				}
+			}
+		}
+	}
+
+	// All others
+	return select( selector.replace( rtrim, "$1" ), context, results, seed );
+}
+
+/**
+ * Create key-value caches of limited size
+ * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
+ *	property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
+ *	deleting the oldest entry
+ */
+function createCache() {
+	var keys = [];
+
+	function cache( key, value ) {
+		// Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
+		if ( keys.push( key + " " ) > Expr.cacheLength ) {
+			// Only keep the most recent entries
+			delete cache[ keys.shift() ];
+		}
+		return (cache[ key + " " ] = value);
+	}
+	return cache;
+}
+
+/**
+ * Mark a function for special use by Sizzle
+ * @param {Function} fn The function to mark
+ */
+function markFunction( fn ) {
+	fn[ expando ] = true;
+	return fn;
+}
+
+/**
+ * Support testing using an element
+ * @param {Function} fn Passed the created div and expects a boolean result
+ */
+function assert( fn ) {
+	var div = document.createElement("div");
+
+	try {
+		return !!fn( div );
+	} catch (e) {
+		return false;
+	} finally {
+		// Remove from its parent by default
+		if ( div.parentNode ) {
+			div.parentNode.removeChild( div );
+		}
+		// release memory in IE
+		div = null;
+	}
+}
+
+/**
+ * Adds the same handler for all of the specified attrs
+ * @param {String} attrs Pipe-separated list of attributes
+ * @param {Function} handler The method that will be applied
+ */
+function addHandle( attrs, handler ) {
+	var arr = attrs.split("|"),
+		i = attrs.length;
+
+	while ( i-- ) {
+		Expr.attrHandle[ arr[i] ] = handler;
+	}
+}
+
+/**
+ * Checks document order of two siblings
+ * @param {Element} a
+ * @param {Element} b
+ * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
+ */
+function siblingCheck( a, b ) {
+	var cur = b && a,
+		diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
+			( ~b.sourceIndex || MAX_NEGATIVE ) -
+			( ~a.sourceIndex || MAX_NEGATIVE );
+
+	// Use IE sourceIndex if available on both nodes
+	if ( diff ) {
+		return diff;
+	}
+
+	// Check if b follows a
+	if ( cur ) {
+		while ( (cur = cur.nextSibling) ) {
+			if ( cur === b ) {
+				return -1;
+			}
+		}
+	}
+
+	return a ? 1 : -1;
+}
+
+/**
+ * Returns a function to use in pseudos for input types
+ * @param {String} type
+ */
+function createInputPseudo( type ) {
+	return function( elem ) {
+		var name = elem.nodeName.toLowerCase();
+		return name === "input" && elem.type === type;
+	};
+}
+
+/**
+ * Returns a function to use in pseudos for buttons
+ * @param {String} type
+ */
+function createButtonPseudo( type ) {
+	return function( elem ) {
+		var name = elem.nodeName.toLowerCase();
+		return (name === "input" || name === "button") && elem.type === type;
+	};
+}
+
+/**
+ * Returns a function to use in pseudos for positionals
+ * @param {Function} fn
+ */
+function createPositionalPseudo( fn ) {
+	return markFunction(function( argument ) {
+		argument = +argument;
+		return markFunction(function( seed, matches ) {
+			var j,
+				matchIndexes = fn( [], seed.length, argument ),
+				i = matchIndexes.length;
+
+			// Match elements found at the specified indexes
+			while ( i-- ) {
+				if ( seed[ (j = matchIndexes[i]) ] ) {
+					seed[j] = !(matches[j] = seed[j]);
+				}
+			}
+		});
+	});
+}
+
+/**
+ * Checks a node for validity as a Sizzle context
+ * @param {Element|Object=} context
+ * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
+ */
+function testContext( context ) {
+	return context && typeof context.getElementsByTagName !== strundefined && context;
+}
+
+// Expose support vars for convenience
+support = Sizzle.support = {};
+
+/**
+ * Detects XML nodes
+ * @param {Element|Object} elem An element or a document
+ * @returns {Boolean} True iff elem is a non-HTML XML node
+ */
+isXML = Sizzle.isXML = function( elem ) {
+	// documentElement is verified for cases where it doesn't yet exist
+	// (such as loading iframes in IE - #4833)
+	var documentElement = elem && (elem.ownerDocument || elem).documentElement;
+	return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+/**
+ * Sets document-related variables once based on the current document
+ * @param {Element|Object} [doc] An element or document object to use to set the document
+ * @returns {Object} Returns the current document
+ */
+setDocument = Sizzle.setDocument = function( node ) {
+	var hasCompare,
+		doc = node ? node.ownerDocument || node : preferredDoc,
+		parent = doc.defaultView;
+
+	// If no document and documentElement is available, return
+	if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
+		return document;
+	}
+
+	// Set our document
+	document = doc;
+	docElem = doc.documentElement;
+
+	// Support tests
+	documentIsHTML = !isXML( doc );
+
+	// Support: IE>8
+	// If iframe document is assigned to "document" variable and if iframe has been reloaded,
+	// IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
+	// IE6-8 do not support the defaultView property so parent will be undefined
+	if ( parent && parent !== parent.top ) {
+		// IE11 does not have attachEvent, so all must suffer
+		if ( parent.addEventListener ) {
+			parent.addEventListener( "unload", function() {
+				setDocument();
+			}, false );
+		} else if ( parent.attachEvent ) {
+			parent.attachEvent( "onunload", function() {
+				setDocument();
+			});
+		}
+	}
+
+	/* Attributes
+	---------------------------------------------------------------------- */
+
+	// Support: IE<8
+	// Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans)
+	support.attributes = assert(function( div ) {
+		div.className = "i";
+		return !div.getAttribute("className");
+	});
+
+	/* getElement(s)By*
+	---------------------------------------------------------------------- */
+
+	// Check if getElementsByTagName("*") returns only elements
+	support.getElementsByTagName = assert(function( div ) {
+		div.appendChild( doc.createComment("") );
+		return !div.getElementsByTagName("*").length;
+	});
+
+	// Support: IE<9
+	support.getElementsByClassName = rnative.test( doc.getElementsByClassName );
+
+	// Support: IE<10
+	// Check if getElementById returns elements by name
+	// The broken getElementById methods don't pick up programatically-set names,
+	// so use a roundabout getElementsByName test
+	support.getById = assert(function( div ) {
+		docElem.appendChild( div ).id = expando;
+		return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
+	});
+
+	// ID find and filter
+	if ( support.getById ) {
+		Expr.find["ID"] = function( id, context ) {
+			if ( typeof context.getElementById !== strundefined && documentIsHTML ) {
+				var m = context.getElementById( id );
+				// Check parentNode to catch when Blackberry 4.6 returns
+				// nodes that are no longer in the document #6963
+				return m && m.parentNode ? [ m ] : [];
+			}
+		};
+		Expr.filter["ID"] = function( id ) {
+			var attrId = id.replace( runescape, funescape );
+			return function( elem ) {
+				return elem.getAttribute("id") === attrId;
+			};
+		};
+	} else {
+		// Support: IE6/7
+		// getElementById is not reliable as a find shortcut
+		delete Expr.find["ID"];
+
+		Expr.filter["ID"] =  function( id ) {
+			var attrId = id.replace( runescape, funescape );
+			return function( elem ) {
+				var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
+				return node && node.value === attrId;
+			};
+		};
+	}
+
+	// Tag
+	Expr.find["TAG"] = support.getElementsByTagName ?
+		function( tag, context ) {
+			if ( typeof context.getElementsByTagName !== strundefined ) {
+				return context.getElementsByTagName( tag );
+			}
+		} :
+		function( tag, context ) {
+			var elem,
+				tmp = [],
+				i = 0,
+				results = context.getElementsByTagName( tag );
+
+			// Filter out possible comments
+			if ( tag === "*" ) {
+				while ( (elem = results[i++]) ) {
+					if ( elem.nodeType === 1 ) {
+						tmp.push( elem );
+					}
+				}
+
+				return tmp;
+			}
+			return results;
+		};
+
+	// Class
+	Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
+		if ( documentIsHTML ) {
+			return context.getElementsByClassName( className );
+		}
+	};
+
+	/* QSA/matchesSelector
+	---------------------------------------------------------------------- */
+
+	// QSA and matchesSelector support
+
+	// matchesSelector(:active) reports false when true (IE9/Opera 11.5)
+	rbuggyMatches = [];
+
+	// qSa(:focus) reports false when true (Chrome 21)
+	// We allow this because of a bug in IE8/9 that throws an error
+	// whenever `document.activeElement` is accessed on an iframe
+	// So, we allow :focus to pass through QSA all the time to avoid the IE error
+	// See http://bugs.jquery.com/ticket/13378
+	rbuggyQSA = [];
+
+	if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
+		// Build QSA regex
+		// Regex strategy adopted from Diego Perini
+		assert(function( div ) {
+			// Select is set to empty string on purpose
+			// This is to test IE's treatment of not explicitly
+			// setting a boolean content attribute,
+			// since its presence should be enough
+			// http://bugs.jquery.com/ticket/12359
+			div.innerHTML = "<select msallowcapture=''><option selected=''></option></select>";
+
+			// Support: IE8, Opera 11-12.16
+			// Nothing should be selected when empty strings follow ^= or $= or *=
+			// The test attribute must be unknown in Opera but "safe" for WinRT
+			// http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
+			if ( div.querySelectorAll("[msallowcapture^='']").length ) {
+				rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
+			}
+
+			// Support: IE8
+			// Boolean attributes and "value" are not treated correctly
+			if ( !div.querySelectorAll("[selected]").length ) {
+				rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
+			}
+
+			// Webkit/Opera - :checked should return selected option elements
+			// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+			// IE8 throws error here and will not see later tests
+			if ( !div.querySelectorAll(":checked").length ) {
+				rbuggyQSA.push(":checked");
+			}
+		});
+
+		assert(function( div ) {
+			// Support: Windows 8 Native Apps
+			// The type and name attributes are restricted during .innerHTML assignment
+			var input = doc.createElement("input");
+			input.setAttribute( "type", "hidden" );
+			div.appendChild( input ).setAttribute( "name", "D" );
+
+			// Support: IE8
+			// Enforce case-sensitivity of name attribute
+			if ( div.querySelectorAll("[name=d]").length ) {
+				rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
+			}
+
+			// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
+			// IE8 throws error here and will not see later tests
+			if ( !div.querySelectorAll(":enabled").length ) {
+				rbuggyQSA.push( ":enabled", ":disabled" );
+			}
+
+			// Opera 10-11 does not throw on post-comma invalid pseudos
+			div.querySelectorAll("*,:x");
+			rbuggyQSA.push(",.*:");
+		});
+	}
+
+	if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
+		docElem.webkitMatchesSelector ||
+		docElem.mozMatchesSelector ||
+		docElem.oMatchesSelector ||
+		docElem.msMatchesSelector) )) ) {
+
+		assert(function( div ) {
+			// Check to see if it's possible to do matchesSelector
+			// on a disconnected node (IE 9)
+			support.disconnectedMatch = matches.call( div, "div" );
+
+			// This should fail with an exception
+			// Gecko does not error, returns false instead
+			matches.call( div, "[s!='']:x" );
+			rbuggyMatches.push( "!=", pseudos );
+		});
+	}
+
+	rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
+	rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
+
+	/* Contains
+	---------------------------------------------------------------------- */
+	hasCompare = rnative.test( docElem.compareDocumentPosition );
+
+	// Element contains another
+	// Purposefully does not implement inclusive descendent
+	// As in, an element does not contain itself
+	contains = hasCompare || rnative.test( docElem.contains ) ?
+		function( a, b ) {
+			var adown = a.nodeType === 9 ? a.documentElement : a,
+				bup = b && b.parentNode;
+			return a === bup || !!( bup && bup.nodeType === 1 && (
+				adown.contains ?
+					adown.contains( bup ) :
+					a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
+			));
+		} :
+		function( a, b ) {
+			if ( b ) {
+				while ( (b = b.parentNode) ) {
+					if ( b === a ) {
+						return true;
+					}
+				}
+			}
+			return false;
+		};
+
+	/* Sorting
+	---------------------------------------------------------------------- */
+
+	// Document order sorting
+	sortOrder = hasCompare ?
+	function( a, b ) {
+
+		// Flag for duplicate removal
+		if ( a === b ) {
+			hasDuplicate = true;
+			return 0;
+		}
+
+		// Sort on method existence if only one input has compareDocumentPosition
+		var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
+		if ( compare ) {
+			return compare;
+		}
+
+		// Calculate position if both inputs belong to the same document
+		compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
+			a.compareDocumentPosition( b ) :
+
+			// Otherwise we know they are disconnected
+			1;
+
+		// Disconnected nodes
+		if ( compare & 1 ||
+			(!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
+
+			// Choose the first element that is related to our preferred document
+			if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
+				return -1;
+			}
+			if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
+				return 1;
+			}
+
+			// Maintain original order
+			return sortInput ?
+				( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
+				0;
+		}
+
+		return compare & 4 ? -1 : 1;
+	} :
+	function( a, b ) {
+		// Exit early if the nodes are identical
+		if ( a === b ) {
+			hasDuplicate = true;
+			return 0;
+		}
+
+		var cur,
+			i = 0,
+			aup = a.parentNode,
+			bup = b.parentNode,
+			ap = [ a ],
+			bp = [ b ];
+
+		// Parentless nodes are either documents or disconnected
+		if ( !aup || !bup ) {
+			return a === doc ? -1 :
+				b === doc ? 1 :
+				aup ? -1 :
+				bup ? 1 :
+				sortInput ?
+				( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
+				0;
+
+		// If the nodes are siblings, we can do a quick check
+		} else if ( aup === bup ) {
+			return siblingCheck( a, b );
+		}
+
+		// Otherwise we need full lists of their ancestors for comparison
+		cur = a;
+		while ( (cur = cur.parentNode) ) {
+			ap.unshift( cur );
+		}
+		cur = b;
+		while ( (cur = cur.parentNode) ) {
+			bp.unshift( cur );
+		}
+
+		// Walk down the tree looking for a discrepancy
+		while ( ap[i] === bp[i] ) {
+			i++;
+		}
+
+		return i ?
+			// Do a sibling check if the nodes have a common ancestor
+			siblingCheck( ap[i], bp[i] ) :
+
+			// Otherwise nodes in our document sort first
+			ap[i] === preferredDoc ? -1 :
+			bp[i] === preferredDoc ? 1 :
+			0;
+	};
+
+	return doc;
+};
+
+Sizzle.matches = function( expr, elements ) {
+	return Sizzle( expr, null, null, elements );
+};
+
+Sizzle.matchesSelector = function( elem, expr ) {
+	// Set document vars if needed
+	if ( ( elem.ownerDocument || elem ) !== document ) {
+		setDocument( elem );
+	}
+
+	// Make sure that attribute selectors are quoted
+	expr = expr.replace( rattributeQuotes, "='$1']" );
+
+	if ( support.matchesSelector && documentIsHTML &&
+		( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
+		( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {
+
+		try {
+			var ret = matches.call( elem, expr );
+
+			// IE 9's matchesSelector returns false on disconnected nodes
+			if ( ret || support.disconnectedMatch ||
+					// As well, disconnected nodes are said to be in a document
+					// fragment in IE 9
+					elem.document && elem.document.nodeType !== 11 ) {
+				return ret;
+			}
+		} catch(e) {}
+	}
+
+	return Sizzle( expr, document, null, [ elem ] ).length > 0;
+};
+
+Sizzle.contains = function( context, elem ) {
+	// Set document vars if needed
+	if ( ( context.ownerDocument || context ) !== document ) {
+		setDocument( context );
+	}
+	return contains( context, elem );
+};
+
+Sizzle.attr = function( elem, name ) {
+	// Set document vars if needed
+	if ( ( elem.ownerDocument || elem ) !== document ) {
+		setDocument( elem );
+	}
+
+	var fn = Expr.attrHandle[ name.toLowerCase() ],
+		// Don't get fooled by Object.prototype properties (jQuery #13807)
+		val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
+			fn( elem, name, !documentIsHTML ) :
+			undefined;
+
+	return val !== undefined ?
+		val :
+		support.attributes || !documentIsHTML ?
+			elem.getAttribute( name ) :
+			(val = elem.getAttributeNode(name)) && val.specified ?
+				val.value :
+				null;
+};
+
+Sizzle.error = function( msg ) {
+	throw new Error( "Syntax error, unrecognized expression: " + msg );
+};
+
+/**
+ * Document sorting and removing duplicates
+ * @param {ArrayLike} results
+ */
+Sizzle.uniqueSort = function( results ) {
+	var elem,
+		duplicates = [],
+		j = 0,
+		i = 0;
+
+	// Unless we *know* we can detect duplicates, assume their presence
+	hasDuplicate = !support.detectDuplicates;
+	sortInput = !support.sortStable && results.slice( 0 );
+	results.sort( sortOrder );
+
+	if ( hasDuplicate ) {
+		while ( (elem = results[i++]) ) {
+			if ( elem === results[ i ] ) {
+				j = duplicates.push( i );
+			}
+		}
+		while ( j-- ) {
+			results.splice( duplicates[ j ], 1 );
+		}
+	}
+
+	// Clear input after sorting to release objects
+	// See https://github.com/jquery/sizzle/pull/225
+	sortInput = null;
+
+	return results;
+};
+
+/**
+ * Utility function for retrieving the text value of an array of DOM nodes
+ * @param {Array|Element} elem
+ */
+getText = Sizzle.getText = function( elem ) {
+	var node,
+		ret = "",
+		i = 0,
+		nodeType = elem.nodeType;
+
+	if ( !nodeType ) {
+		// If no nodeType, this is expected to be an array
+		while ( (node = elem[i++]) ) {
+			// Do not traverse comment nodes
+			ret += getText( node );
+		}
+	} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
+		// Use textContent for elements
+		// innerText usage removed for consistency of new lines (jQuery #11153)
+		if ( typeof elem.textContent === "string" ) {
+			return elem.textContent;
+		} else {
+			// Traverse its children
+			for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+				ret += getText( elem );
+			}
+		}
+	} else if ( nodeType === 3 || nodeType === 4 ) {
+		return elem.nodeValue;
+	}
+	// Do not include comment or processing instruction nodes
+
+	return ret;
+};
+
+Expr = Sizzle.selectors = {
+
+	// Can be adjusted by the user
+	cacheLength: 50,
+
+	createPseudo: markFunction,
+
+	match: matchExpr,
+
+	attrHandle: {},
+
+	find: {},
+
+	relative: {
+		">": { dir: "parentNode", first: true },
+		" ": { dir: "parentNode" },
+		"+": { dir: "previousSibling", first: true },
+		"~": { dir: "previousSibling" }
+	},
+
+	preFilter: {
+		"ATTR": function( match ) {
+			match[1] = match[1].replace( runescape, funescape );
+
+			// Move the given value to match[3] whether quoted or unquoted
+			match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
+
+			if ( match[2] === "~=" ) {
+				match[3] = " " + match[3] + " ";
+			}
+
+			return match.slice( 0, 4 );
+		},
+
+		"CHILD": function( match ) {
+			/* matches from matchExpr["CHILD"]
+				1 type (only|nth|...)
+				2 what (child|of-type)
+				3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
+				4 xn-component of xn+y argument ([+-]?\d*n|)
+				5 sign of xn-component
+				6 x of xn-component
+				7 sign of y-component
+				8 y of y-component
+			*/
+			match[1] = match[1].toLowerCase();
+
+			if ( match[1].slice( 0, 3 ) === "nth" ) {
+				// nth-* requires argument
+				if ( !match[3] ) {
+					Sizzle.error( match[0] );
+				}
+
+				// numeric x and y parameters for Expr.filter.CHILD
+				// remember that false/true cast respectively to 0/1
+				match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
+				match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
+
+			// other types prohibit arguments
+			} else if ( match[3] ) {
+				Sizzle.error( match[0] );
+			}
+
+			return match;
+		},
+
+		"PSEUDO": function( match ) {
+			var excess,
+				unquoted = !match[6] && match[2];
+
+			if ( matchExpr["CHILD"].test( match[0] ) ) {
+				return null;
+			}
+
+			// Accept quoted arguments as-is
+			if ( match[3] ) {
+				match[2] = match[4] || match[5] || "";
+
+			// Strip excess characters from unquoted arguments
+			} else if ( unquoted && rpseudo.test( unquoted ) &&
+				// Get excess from tokenize (recursively)
+				(excess = tokenize( unquoted, true )) &&
+				// advance to the next closing parenthesis
+				(excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
+
+				// excess is a negative index
+				match[0] = match[0].slice( 0, excess );
+				match[2] = unquoted.slice( 0, excess );
+			}
+
+			// Return only captures needed by the pseudo filter method (type and argument)
+			return match.slice( 0, 3 );
+		}
+	},
+
+	filter: {
+
+		"TAG": function( nodeNameSelector ) {
+			var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
+			return nodeNameSelector === "*" ?
+				function() { return true; } :
+				function( elem ) {
+					return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
+				};
+		},
+
+		"CLASS": function( className ) {
+			var pattern = classCache[ className + " " ];
+
+			return pattern ||
+				(pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
+				classCache( className, function( elem ) {
+					return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" );
+				});
+		},
+
+		"ATTR": function( name, operator, check ) {
+			return function( elem ) {
+				var result = Sizzle.attr( elem, name );
+
+				if ( result == null ) {
+					return operator === "!=";
+				}
+				if ( !operator ) {
+					return true;
+				}
+
+				result += "";
+
+				return operator === "=" ? result === check :
+					operator === "!=" ? result !== check :
+					operator === "^=" ? check && result.indexOf( check ) === 0 :
+					operator === "*=" ? check && result.indexOf( check ) > -1 :
+					operator === "$=" ? check && result.slice( -check.length ) === check :
+					operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
+					operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
+					false;
+			};
+		},
+
+		"CHILD": function( type, what, argument, first, last ) {
+			var simple = type.slice( 0, 3 ) !== "nth",
+				forward = type.slice( -4 ) !== "last",
+				ofType = what === "of-type";
+
+			return first === 1 && last === 0 ?
+
+				// Shortcut for :nth-*(n)
+				function( elem ) {
+					return !!elem.parentNode;
+				} :
+
+				function( elem, context, xml ) {
+					var cache, outerCache, node, diff, nodeIndex, start,
+						dir = simple !== forward ? "nextSibling" : "previousSibling",
+						parent = elem.parentNode,
+						name = ofType && elem.nodeName.toLowerCase(),
+						useCache = !xml && !ofType;
+
+					if ( parent ) {
+
+						// :(first|last|only)-(child|of-type)
+						if ( simple ) {
+							while ( dir ) {
+								node = elem;
+								while ( (node = node[ dir ]) ) {
+									if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
+										return false;
+									}
+								}
+								// Reverse direction for :only-* (if we haven't yet done so)
+								start = dir = type === "only" && !start && "nextSibling";
+							}
+							return true;
+						}
+
+						start = [ forward ? parent.firstChild : parent.lastChild ];
+
+						// non-xml :nth-child(...) stores cache data on `parent`
+						if ( forward && useCache ) {
+							// Seek `elem` from a previously-cached index
+							outerCache = parent[ expando ] || (parent[ expando ] = {});
+							cache = outerCache[ type ] || [];
+							nodeIndex = cache[0] === dirruns && cache[1];
+							diff = cache[0] === dirruns && cache[2];
+							node = nodeIndex && parent.childNodes[ nodeIndex ];
+
+							while ( (node = ++nodeIndex && node && node[ dir ] ||
+
+								// Fallback to seeking `elem` from the start
+								(diff = nodeIndex = 0) || start.pop()) ) {
+
+								// When found, cache indexes on `parent` and break
+								if ( node.nodeType === 1 && ++diff && node === elem ) {
+									outerCache[ type ] = [ dirruns, nodeIndex, diff ];
+									break;
+								}
+							}
+
+						// Use previously-cached element index if available
+						} else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
+							diff = cache[1];
+
+						// xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
+						} else {
+							// Use the same loop as above to seek `elem` from the start
+							while ( (node = ++nodeIndex && node && node[ dir ] ||
+								(diff = nodeIndex = 0) || start.pop()) ) {
+
+								if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
+									// Cache the index of each encountered element
+									if ( useCache ) {
+										(node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
+									}
+
+									if ( node === elem ) {
+										break;
+									}
+								}
+							}
+						}
+
+						// Incorporate the offset, then check against cycle size
+						diff -= last;
+						return diff === first || ( diff % first === 0 && diff / first >= 0 );
+					}
+				};
+		},
+
+		"PSEUDO": function( pseudo, argument ) {
+			// pseudo-class names are case-insensitive
+			// http://www.w3.org/TR/selectors/#pseudo-classes
+			// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
+			// Remember that setFilters inherits from pseudos
+			var args,
+				fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
+					Sizzle.error( "unsupported pseudo: " + pseudo );
+
+			// The user may use createPseudo to indicate that
+			// arguments are needed to create the filter function
+			// just as Sizzle does
+			if ( fn[ expando ] ) {
+				return fn( argument );
+			}
+
+			// But maintain support for old signatures
+			if ( fn.length > 1 ) {
+				args = [ pseudo, pseudo, "", argument ];
+				return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
+					markFunction(function( seed, matches ) {
+						var idx,
+							matched = fn( seed, argument ),
+							i = matched.length;
+						while ( i-- ) {
+							idx = indexOf.call( seed, matched[i] );
+							seed[ idx ] = !( matches[ idx ] = matched[i] );
+						}
+					}) :
+					function( elem ) {
+						return fn( elem, 0, args );
+					};
+			}
+
+			return fn;
+		}
+	},
+
+	pseudos: {
+		// Potentially complex pseudos
+		"not": markFunction(function( selector ) {
+			// Trim the selector passed to compile
+			// to avoid treating leading and trailing
+			// spaces as combinators
+			var input = [],
+				results = [],
+				matcher = compile( selector.replace( rtrim, "$1" ) );
+
+			return matcher[ expando ] ?
+				markFunction(function( seed, matches, context, xml ) {
+					var elem,
+						unmatched = matcher( seed, null, xml, [] ),
+						i = seed.length;
+
+					// Match elements unmatched by `matcher`
+					while ( i-- ) {
+						if ( (elem = unmatched[i]) ) {
+							seed[i] = !(matches[i] = elem);
+						}
+					}
+				}) :
+				function( elem, context, xml ) {
+					input[0] = elem;
+					matcher( input, null, xml, results );
+					return !results.pop();
+				};
+		}),
+
+		"has": markFunction(function( selector ) {
+			return function( elem ) {
+				return Sizzle( selector, elem ).length > 0;
+			};
+		}),
+
+		"contains": markFunction(function( text ) {
+			text = text.replace( runescape, funescape );
+			return function( elem ) {
+				return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
+			};
+		}),
+
+		// "Whether an element is represented by a :lang() selector
+		// is based solely on the element's language value
+		// being equal to the identifier C,
+		// or beginning with the identifier C immediately followed by "-".
+		// The matching of C against the element's language value is performed case-insensitively.
+		// The identifier C does not have to be a valid language name."
+		// http://www.w3.org/TR/selectors/#lang-pseudo
+		"lang": markFunction( function( lang ) {
+			// lang value must be a valid identifier
+			if ( !ridentifier.test(lang || "") ) {
+				Sizzle.error( "unsupported lang: " + lang );
+			}
+			lang = lang.replace( runescape, funescape ).toLowerCase();
+			return function( elem ) {
+				var elemLang;
+				do {
+					if ( (elemLang = documentIsHTML ?
+						elem.lang :
+						elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
+
+						elemLang = elemLang.toLowerCase();
+						return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
+					}
+				} while ( (elem = elem.parentNode) && elem.nodeType === 1 );
+				return false;
+			};
+		}),
+
+		// Miscellaneous
+		"target": function( elem ) {
+			var hash = window.location && window.location.hash;
+			return hash && hash.slice( 1 ) === elem.id;
+		},
+
+		"root": function( elem ) {
+			return elem === docElem;
+		},
+
+		"focus": function( elem ) {
+			return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
+		},
+
+		// Boolean properties
+		"enabled": function( elem ) {
+			return elem.disabled === false;
+		},
+
+		"disabled": function( elem ) {
+			return elem.disabled === true;
+		},
+
+		"checked": function( elem ) {
+			// In CSS3, :checked should return both checked and selected elements
+			// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+			var nodeName = elem.nodeName.toLowerCase();
+			return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
+		},
+
+		"selected": function( elem ) {
+			// Accessing this property makes selected-by-default
+			// options in Safari work properly
+			if ( elem.parentNode ) {
+				elem.parentNode.selectedIndex;
+			}
+
+			return elem.selected === true;
+		},
+
+		// Contents
+		"empty": function( elem ) {
+			// http://www.w3.org/TR/selectors/#empty-pseudo
+			// :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
+			//   but not by others (comment: 8; processing instruction: 7; etc.)
+			// nodeType < 6 works because attributes (2) do not appear as children
+			for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+				if ( elem.nodeType < 6 ) {
+					return false;
+				}
+			}
+			return true;
+		},
+
+		"parent": function( elem ) {
+			return !Expr.pseudos["empty"]( elem );
+		},
+
+		// Element/input types
+		"header": function( elem ) {
+			return rheader.test( elem.nodeName );
+		},
+
+		"input": function( elem ) {
+			return rinputs.test( elem.nodeName );
+		},
+
+		"button": function( elem ) {
+			var name = elem.nodeName.toLowerCase();
+			return name === "input" && elem.type === "button" || name === "button";
+		},
+
+		"text": function( elem ) {
+			var attr;
+			return elem.nodeName.toLowerCase() === "input" &&
+				elem.type === "text" &&
+
+				// Support: IE<8
+				// New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
+				( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
+		},
+
+		// Position-in-collection
+		"first": createPositionalPseudo(function() {
+			return [ 0 ];
+		}),
+
+		"last": createPositionalPseudo(function( matchIndexes, length ) {
+			return [ length - 1 ];
+		}),
+
+		"eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
+			return [ argument < 0 ? argument + length : argument ];
+		}),
+
+		"even": createPositionalPseudo(function( matchIndexes, length ) {
+			var i = 0;
+			for ( ; i < length; i += 2 ) {
+				matchIndexes.push( i );
+			}
+			return matchIndexes;
+		}),
+
+		"odd": createPositionalPseudo(function( matchIndexes, length ) {
+			var i = 1;
+			for ( ; i < length; i += 2 ) {
+				matchIndexes.push( i );
+			}
+			return matchIndexes;
+		}),
+
+		"lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+			var i = argument < 0 ? argument + length : argument;
+			for ( ; --i >= 0; ) {
+				matchIndexes.push( i );
+			}
+			return matchIndexes;
+		}),
+
+		"gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+			var i = argument < 0 ? argument + length : argument;
+			for ( ; ++i < length; ) {
+				matchIndexes.push( i );
+			}
+			return matchIndexes;
+		})
+	}
+};
+
+Expr.pseudos["nth"] = Expr.pseudos["eq"];
+
+// Add button/input type pseudos
+for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
+	Expr.pseudos[ i ] = createInputPseudo( i );
+}
+for ( i in { submit: true, reset: true } ) {
+	Expr.pseudos[ i ] = createButtonPseudo( i );
+}
+
+// Easy API for creating new setFilters
+function setFilters() {}
+setFilters.prototype = Expr.filters = Expr.pseudos;
+Expr.setFilters = new setFilters();
+
+tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
+	var matched, match, tokens, type,
+		soFar, groups, preFilters,
+		cached = tokenCache[ selector + " " ];
+
+	if ( cached ) {
+		return parseOnly ? 0 : cached.slice( 0 );
+	}
+
+	soFar = selector;
+	groups = [];
+	preFilters = Expr.preFilter;
+
+	while ( soFar ) {
+
+		// Comma and first run
+		if ( !matched || (match = rcomma.exec( soFar )) ) {
+			if ( match ) {
+				// Don't consume trailing commas as valid
+				soFar = soFar.slice( match[0].length ) || soFar;
+			}
+			groups.push( (tokens = []) );
+		}
+
+		matched = false;
+
+		// Combinators
+		if ( (match = rcombinators.exec( soFar )) ) {
+			matched = match.shift();
+			tokens.push({
+				value: matched,
+				// Cast descendant combinators to space
+				type: match[0].replace( rtrim, " " )
+			});
+			soFar = soFar.slice( matched.length );
+		}
+
+		// Filters
+		for ( type in Expr.filter ) {
+			if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
+				(match = preFilters[ type ]( match ))) ) {
+				matched = match.shift();
+				tokens.push({
+					value: matched,
+					type: type,
+					matches: match
+				});
+				soFar = soFar.slice( matched.length );
+			}
+		}
+
+		if ( !matched ) {
+			break;
+		}
+	}
+
+	// Return the length of the invalid excess
+	// if we're just parsing
+	// Otherwise, throw an error or return tokens
+	return parseOnly ?
+		soFar.length :
+		soFar ?
+			Sizzle.error( selector ) :
+			// Cache the tokens
+			tokenCache( selector, groups ).slice( 0 );
+};
+
+function toSelector( tokens ) {
+	var i = 0,
+		len = tokens.length,
+		selector = "";
+	for ( ; i < len; i++ ) {
+		selector += tokens[i].value;
+	}
+	return selector;
+}
+
+function addCombinator( matcher, combinator, base ) {
+	var dir = combinator.dir,
+		checkNonElements = base && dir === "parentNode",
+		doneName = done++;
+
+	return combinator.first ?
+		// Check against closest ancestor/preceding element
+		function( elem, context, xml ) {
+			while ( (elem = elem[ dir ]) ) {
+				if ( elem.nodeType === 1 || checkNonElements ) {
+					return matcher( elem, context, xml );
+				}
+			}
+		} :
+
+		// Check against all ancestor/preceding elements
+		function( elem, context, xml ) {
+			var oldCache, outerCache,
+				newCache = [ dirruns, doneName ];
+
+			// We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
+			if ( xml ) {
+				while ( (elem = elem[ dir ]) ) {
+					if ( elem.nodeType === 1 || checkNonElements ) {
+						if ( matcher( elem, context, xml ) ) {
+							return true;
+						}
+					}
+				}
+			} else {
+				while ( (elem = elem[ dir ]) ) {
+					if ( elem.nodeType === 1 || checkNonElements ) {
+						outerCache = elem[ expando ] || (elem[ expando ] = {});
+						if ( (oldCache = outerCache[ dir ]) &&
+							oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
+
+							// Assign to newCache so results back-propagate to previous elements
+							return (newCache[ 2 ] = oldCache[ 2 ]);
+						} else {
+							// Reuse newcache so results back-propagate to previous elements
+							outerCache[ dir ] = newCache;
+
+							// A match means we're done; a fail means we have to keep checking
+							if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
+								return true;
+							}
+						}
+					}
+				}
+			}
+		};
+}
+
+function elementMatcher( matchers ) {
+	return matchers.length > 1 ?
+		function( elem, context, xml ) {
+			var i = matchers.length;
+			while ( i-- ) {
+				if ( !matchers[i]( elem, context, xml ) ) {
+					return false;
+				}
+			}
+			return true;
+		} :
+		matchers[0];
+}
+
+function multipleContexts( selector, contexts, results ) {
+	var i = 0,
+		len = contexts.length;
+	for ( ; i < len; i++ ) {
+		Sizzle( selector, contexts[i], results );
+	}
+	return results;
+}
+
+function condense( unmatched, map, filter, context, xml ) {
+	var elem,
+		newUnmatched = [],
+		i = 0,
+		len = unmatched.length,
+		mapped = map != null;
+
+	for ( ; i < len; i++ ) {
+		if ( (elem = unmatched[i]) ) {
+			if ( !filter || filter( elem, context, xml ) ) {
+				newUnmatched.push( elem );
+				if ( mapped ) {
+					map.push( i );
+				}
+			}
+		}
+	}
+
+	return newUnmatched;
+}
+
+function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
+	if ( postFilter && !postFilter[ expando ] ) {
+		postFilter = setMatcher( postFilter );
+	}
+	if ( postFinder && !postFinder[ expando ] ) {
+		postFinder = setMatcher( postFinder, postSelector );
+	}
+	return markFunction(function( seed, results, context, xml ) {
+		var temp, i, elem,
+			preMap = [],
+			postMap = [],
+			preexisting = results.length,
+
+			// Get initial elements from seed or context
+			elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
+
+			// Prefilter to get matcher input, preserving a map for seed-results synchronization
+			matcherIn = preFilter && ( seed || !selector ) ?
+				condense( elems, preMap, preFilter, context, xml ) :
+				elems,
+
+			matcherOut = matcher ?
+				// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
+				postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
+
+					// ...intermediate processing is necessary
+					[] :
+
+					// ...otherwise use results directly
+					results :
+				matcherIn;
+
+		// Find primary matches
+		if ( matcher ) {
+			matcher( matcherIn, matcherOut, context, xml );
+		}
+
+		// Apply postFilter
+		if ( postFilter ) {
+			temp = condense( matcherOut, postMap );
+			postFilter( temp, [], context, xml );
+
+			// Un-match failing elements by moving them back to matcherIn
+			i = temp.length;
+			while ( i-- ) {
+				if ( (elem = temp[i]) ) {
+					matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
+				}
+			}
+		}
+
+		if ( seed ) {
+			if ( postFinder || preFilter ) {
+				if ( postFinder ) {
+					// Get the final matcherOut by condensing this intermediate into postFinder contexts
+					temp = [];
+					i = matcherOut.length;
+					while ( i-- ) {
+						if ( (elem = matcherOut[i]) ) {
+							// Restore matcherIn since elem is not yet a final match
+							temp.push( (matcherIn[i] = elem) );
+						}
+					}
+					postFinder( null, (matcherOut = []), temp, xml );
+				}
+
+				// Move matched elements from seed to results to keep them synchronized
+				i = matcherOut.length;
+				while ( i-- ) {
+					if ( (elem = matcherOut[i]) &&
+						(temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
+
+						seed[temp] = !(results[temp] = elem);
+					}
+				}
+			}
+
+		// Add elements to results, through postFinder if defined
+		} else {
+			matcherOut = condense(
+				matcherOut === results ?
+					matcherOut.splice( preexisting, matcherOut.length ) :
+					matcherOut
+			);
+			if ( postFinder ) {
+				postFinder( null, results, matcherOut, xml );
+			} else {
+				push.apply( results, matcherOut );
+			}
+		}
+	});
+}
+
+function matcherFromTokens( tokens ) {
+	var checkContext, matcher, j,
+		len = tokens.length,
+		leadingRelative = Expr.relative[ tokens[0].type ],
+		implicitRelative = leadingRelative || Expr.relative[" "],
+		i = leadingRelative ? 1 : 0,
+
+		// The foundational matcher ensures that elements are reachable from top-level context(s)
+		matchContext = addCombinator( function( elem ) {
+			return elem === checkContext;
+		}, implicitRelative, true ),
+		matchAnyContext = addCombinator( function( elem ) {
+			return indexOf.call( checkContext, elem ) > -1;
+		}, implicitRelative, true ),
+		matchers = [ function( elem, context, xml ) {
+			return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
+				(checkContext = context).nodeType ?
+					matchContext( elem, context, xml ) :
+					matchAnyContext( elem, context, xml ) );
+		} ];
+
+	for ( ; i < len; i++ ) {
+		if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
+			matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
+		} else {
+			matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
+
+			// Return special upon seeing a positional matcher
+			if ( matcher[ expando ] ) {
+				// Find the next relative operator (if any) for proper handling
+				j = ++i;
+				for ( ; j < len; j++ ) {
+					if ( Expr.relative[ tokens[j].type ] ) {
+						break;
+					}
+				}
+				return setMatcher(
+					i > 1 && elementMatcher( matchers ),
+					i > 1 && toSelector(
+						// If the preceding token was a descendant combinator, insert an implicit any-element `*`
+						tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
+					).replace( rtrim, "$1" ),
+					matcher,
+					i < j && matcherFromTokens( tokens.slice( i, j ) ),
+					j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
+					j < len && toSelector( tokens )
+				);
+			}
+			matchers.push( matcher );
+		}
+	}
+
+	return elementMatcher( matchers );
+}
+
+function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
+	var bySet = setMatchers.length > 0,
+		byElement = elementMatchers.length > 0,
+		superMatcher = function( seed, context, xml, results, outermost ) {
+			var elem, j, matcher,
+				matchedCount = 0,
+				i = "0",
+				unmatched = seed && [],
+				setMatched = [],
+				contextBackup = outermostContext,
+				// We must always have either seed elements or outermost context
+				elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
+				// Use integer dirruns iff this is the outermost matcher
+				dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
+				len = elems.length;
+
+			if ( outermost ) {
+				outermostContext = context !== document && context;
+			}
+
+			// Add elements passing elementMatchers directly to results
+			// Keep `i` a string if there are no elements so `matchedCount` will be "00" below
+			// Support: IE<9, Safari
+			// Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
+			for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
+				if ( byElement && elem ) {
+					j = 0;
+					while ( (matcher = elementMatchers[j++]) ) {
+						if ( matcher( elem, context, xml ) ) {
+							results.push( elem );
+							break;
+						}
+					}
+					if ( outermost ) {
+						dirruns = dirrunsUnique;
+					}
+				}
+
+				// Track unmatched elements for set filters
+				if ( bySet ) {
+					// They will have gone through all possible matchers
+					if ( (elem = !matcher && elem) ) {
+						matchedCount--;
+					}
+
+					// Lengthen the array for every element, matched or not
+					if ( seed ) {
+						unmatched.push( elem );
+					}
+				}
+			}
+
+			// Apply set filters to unmatched elements
+			matchedCount += i;
+			if ( bySet && i !== matchedCount ) {
+				j = 0;
+				while ( (matcher = setMatchers[j++]) ) {
+					matcher( unmatched, setMatched, context, xml );
+				}
+
+				if ( seed ) {
+					// Reintegrate element matches to eliminate the need for sorting
+					if ( matchedCount > 0 ) {
+						while ( i-- ) {
+							if ( !(unmatched[i] || setMatched[i]) ) {
+								setMatched[i] = pop.call( results );
+							}
+						}
+					}
+
+					// Discard index placeholder values to get only actual matches
+					setMatched = condense( setMatched );
+				}
+
+				// Add matches to results
+				push.apply( results, setMatched );
+
+				// Seedless set matches succeeding multiple successful matchers stipulate sorting
+				if ( outermost && !seed && setMatched.length > 0 &&
+					( matchedCount + setMatchers.length ) > 1 ) {
+
+					Sizzle.uniqueSort( results );
+				}
+			}
+
+			// Override manipulation of globals by nested matchers
+			if ( outermost ) {
+				dirruns = dirrunsUnique;
+				outermostContext = contextBackup;
+			}
+
+			return unmatched;
+		};
+
+	return bySet ?
+		markFunction( superMatcher ) :
+		superMatcher;
+}
+
+compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
+	var i,
+		setMatchers = [],
+		elementMatchers = [],
+		cached = compilerCache[ selector + " " ];
+
+	if ( !cached ) {
+		// Generate a function of recursive functions that can be used to check each element
+		if ( !match ) {
+			match = tokenize( selector );
+		}
+		i = match.length;
+		while ( i-- ) {
+			cached = matcherFromTokens( match[i] );
+			if ( cached[ expando ] ) {
+				setMatchers.push( cached );
+			} else {
+				elementMatchers.push( cached );
+			}
+		}
+
+		// Cache the compiled function
+		cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
+
+		// Save selector and tokenization
+		cached.selector = selector;
+	}
+	return cached;
+};
+
+/**
+ * A low-level selection function that works with Sizzle's compiled
+ *  selector functions
+ * @param {String|Function} selector A selector or a pre-compiled
+ *  selector function built with Sizzle.compile
+ * @param {Element} context
+ * @param {Array} [results]
+ * @param {Array} [seed] A set of elements to match against
+ */
+select = Sizzle.select = function( selector, context, results, seed ) {
+	var i, tokens, token, type, find,
+		compiled = typeof selector === "function" && selector,
+		match = !seed && tokenize( (selector = compiled.selector || selector) );
+
+	results = results || [];
+
+	// Try to minimize operations if there is no seed and only one group
+	if ( match.length === 1 ) {
+
+		// Take a shortcut and set the context if the root selector is an ID
+		tokens = match[0] = match[0].slice( 0 );
+		if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
+				support.getById && context.nodeType === 9 && documentIsHTML &&
+				Expr.relative[ tokens[1].type ] ) {
+
+			context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
+			if ( !context ) {
+				return results;
+
+			// Precompiled matchers will still verify ancestry, so step up a level
+			} else if ( compiled ) {
+				context = context.parentNode;
+			}
+
+			selector = selector.slice( tokens.shift().value.length );
+		}
+
+		// Fetch a seed set for right-to-left matching
+		i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
+		while ( i-- ) {
+			token = tokens[i];
+
+			// Abort if we hit a combinator
+			if ( Expr.relative[ (type = token.type) ] ) {
+				break;
+			}
+			if ( (find = Expr.find[ type ]) ) {
+				// Search, expanding context for leading sibling combinators
+				if ( (seed = find(
+					token.matches[0].replace( runescape, funescape ),
+					rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
+				)) ) {
+
+					// If seed is empty or no tokens remain, we can return early
+					tokens.splice( i, 1 );
+					selector = seed.length && toSelector( tokens );
+					if ( !selector ) {
+						push.apply( results, seed );
+						return results;
+					}
+
+					break;
+				}
+			}
+		}
+	}
+
+	// Compile and execute a filtering function if one is not provided
+	// Provide `match` to avoid retokenization if we modified the selector above
+	( compiled || compile( selector, match ) )(
+		seed,
+		context,
+		!documentIsHTML,
+		results,
+		rsibling.test( selector ) && testContext( context.parentNode ) || context
+	);
+	return results;
+};
+
+// One-time assignments
+
+// Sort stability
+support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
+
+// Support: Chrome 14-35+
+// Always assume duplicates if they aren't passed to the comparison function
+support.detectDuplicates = !!hasDuplicate;
+
+// Initialize against the default document
+setDocument();
+
+// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
+// Detached nodes confoundingly follow *each other*
+support.sortDetached = assert(function( div1 ) {
+	// Should return 1, but returns 4 (following)
+	return div1.compareDocumentPosition( document.createElement("div") ) & 1;
+});
+
+// Support: IE<8
+// Prevent attribute/property "interpolation"
+// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
+if ( !assert(function( div ) {
+	div.innerHTML = "<a href='#'></a>";
+	return div.firstChild.getAttribute("href") === "#" ;
+}) ) {
+	addHandle( "type|href|height|width", function( elem, name, isXML ) {
+		if ( !isXML ) {
+			return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
+		}
+	});
+}
+
+// Support: IE<9
+// Use defaultValue in place of getAttribute("value")
+if ( !support.attributes || !assert(function( div ) {
+	div.innerHTML = "<input/>";
+	div.firstChild.setAttribute( "value", "" );
+	return div.firstChild.getAttribute( "value" ) === "";
+}) ) {
+	addHandle( "value", function( elem, name, isXML ) {
+		if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
+			return elem.defaultValue;
+		}
+	});
+}
+
+// Support: IE<9
+// Use getAttributeNode to fetch booleans when getAttribute lies
+if ( !assert(function( div ) {
+	return div.getAttribute("disabled") == null;
+}) ) {
+	addHandle( booleans, function( elem, name, isXML ) {
+		var val;
+		if ( !isXML ) {
+			return elem[ name ] === true ? name.toLowerCase() :
+					(val = elem.getAttributeNode( name )) && val.specified ?
+					val.value :
+				null;
+		}
+	});
+}
+
+// EXPOSE
+return Sizzle;
+});
+
+// Included from: js/tinymce/classes/Env.js
+
+/**
+ * Env.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class contains various environment constants like browser versions etc.
+ * Normally you don't want to sniff specific browser versions but sometimes you have
+ * to when it's impossible to feature detect. So use this with care.
+ *
+ * @class tinymce.Env
+ * @static
+ */
+define("tinymce/Env", [], function() {
+	var nav = navigator, userAgent = nav.userAgent;
+	var opera, webkit, ie, ie11, ie12, gecko, mac, iDevice, android;
+
+	opera = window.opera && window.opera.buildNumber;
+	android = /Android/.test(userAgent);
+	webkit = /WebKit/.test(userAgent);
+	ie = !webkit && !opera && (/MSIE/gi).test(userAgent) && (/Explorer/gi).test(nav.appName);
+	ie = ie && /MSIE (\w+)\./.exec(userAgent)[1];
+	ie11 = userAgent.indexOf('Trident/') != -1 && (userAgent.indexOf('rv:') != -1 || nav.appName.indexOf('Netscape') != -1) ? 11 : false;
+	ie12 = (document.msElementsFromPoint && !ie && !ie11) ? 12 : false;
+	ie = ie || ie11 || ie12;
+	gecko = !webkit && !ie11 && /Gecko/.test(userAgent);
+	mac = userAgent.indexOf('Mac') != -1;
+	iDevice = /(iPad|iPhone)/.test(userAgent);
+
+	if (ie12) {
+		webkit = false;
+	}
+
+	// Is a iPad/iPhone and not on iOS5 sniff the WebKit version since older iOS WebKit versions
+	// says it has contentEditable support but there is no visible caret.
+	var contentEditable = !iDevice || userAgent.match(/AppleWebKit\/(\d*)/)[1] >= 534;
+
+	return {
+		/**
+		 * Constant that is true if the browser is Opera.
+		 *
+		 * @property opera
+		 * @type Boolean
+		 * @final
+		 */
+		opera: opera,
+
+		/**
+		 * Constant that is true if the browser is WebKit (Safari/Chrome).
+		 *
+		 * @property webKit
+		 * @type Boolean
+		 * @final
+		 */
+		webkit: webkit,
+
+		/**
+		 * Constant that is more than zero if the browser is IE.
+		 *
+		 * @property ie
+		 * @type Boolean
+		 * @final
+		 */
+		ie: ie,
+
+		/**
+		 * Constant that is true if the browser is Gecko.
+		 *
+		 * @property gecko
+		 * @type Boolean
+		 * @final
+		 */
+		gecko: gecko,
+
+		/**
+		 * Constant that is true if the os is Mac OS.
+		 *
+		 * @property mac
+		 * @type Boolean
+		 * @final
+		 */
+		mac: mac,
+
+		/**
+		 * Constant that is true if the os is iOS.
+		 *
+		 * @property iOS
+		 * @type Boolean
+		 * @final
+		 */
+		iOS: iDevice,
+
+		/**
+		 * Constant that is true if the os is android.
+		 *
+		 * @property android
+		 * @type Boolean
+		 * @final
+		 */
+		android: android,
+
+		/**
+		 * Constant that is true if the browser supports editing.
+		 *
+		 * @property contentEditable
+		 * @type Boolean
+		 * @final
+		 */
+		contentEditable: contentEditable,
+
+		/**
+		 * Transparent image data url.
+		 *
+		 * @property transparentSrc
+		 * @type Boolean
+		 * @final
+		 */
+		transparentSrc: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
+
+		/**
+		 * Returns true/false if the browser can or can't place the caret after a inline block like an image.
+		 *
+		 * @property noCaretAfter
+		 * @type Boolean
+		 * @final
+		 */
+		caretAfter: ie != 8,
+
+		/**
+		 * Constant that is true if the browser supports native DOM Ranges. IE 9+.
+		 *
+		 * @property range
+		 * @type Boolean
+		 */
+		range: window.getSelection && "Range" in window,
+
+		/**
+		 * Returns the IE document mode for non IE browsers this will fake IE 10.
+		 *
+		 * @property documentMode
+		 * @type Number
+		 */
+		documentMode: ie && !ie12 ? (document.documentMode || 7) : 10
+	};
+});
+
+// Included from: js/tinymce/classes/util/Tools.js
+
+/**
+ * Tools.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class contains various utlity functions. These are also exposed
+ * directly on the tinymce namespace.
+ *
+ * @class tinymce.util.Tools
+ */
+define("tinymce/util/Tools", [
+	"tinymce/Env"
+], function(Env) {
+	/**
+	 * Removes whitespace from the beginning and end of a string.
+	 *
+	 * @method trim
+	 * @param {String} s String to remove whitespace from.
+	 * @return {String} New string with removed whitespace.
+	 */
+	var whiteSpaceRegExp = /^\s*|\s*$/g;
+
+	function trim(str) {
+		return (str === null || str === undefined) ? '' : ("" + str).replace(whiteSpaceRegExp, '');
+	}
+
+	/**
+	 * Returns true/false if the object is an array or not.
+	 *
+	 * @method isArray
+	 * @param {Object} obj Object to check.
+	 * @return {boolean} true/false state if the object is an array or not.
+	 */
+	var isArray = Array.isArray || function(obj) {
+		return Object.prototype.toString.call(obj) === "[object Array]";
+	};
+
+	/**
+	 * Checks if a object is of a specific type for example an array.
+	 *
+	 * @method is
+	 * @param {Object} obj Object to check type of.
+	 * @param {string} type Optional type to check for.
+	 * @return {Boolean} true/false if the object is of the specified type.
+	 */
+	function is(obj, type) {
+		if (!type) {
+			return obj !== undefined;
+		}
+
+		if (type == 'array' && isArray(obj)) {
+			return true;
+		}
+
+		return typeof obj == type;
+	}
+
+	/**
+	 * Converts the specified object into a real JavaScript array.
+	 *
+	 * @method toArray
+	 * @param {Object} obj Object to convert into array.
+	 * @return {Array} Array object based in input.
+	 */
+	function toArray(obj) {
+		var array = obj, i, l;
+
+		if (!isArray(obj)) {
+			array = [];
+			for (i = 0, l = obj.length; i < l; i++) {
+				array[i] = obj[i];
+			}
+		}
+
+		return array;
+	}
+
+	/**
+	 * Makes a name/object map out of an array with names.
+	 *
+	 * @method makeMap
+	 * @param {Array/String} items Items to make map out of.
+	 * @param {String} delim Optional delimiter to split string by.
+	 * @param {Object} map Optional map to add items to.
+	 * @return {Object} Name/value map of items.
+	 */
+	function makeMap(items, delim, map) {
+		var i;
+
+		items = items || [];
+		delim = delim || ',';
+
+		if (typeof items == "string") {
+			items = items.split(delim);
+		}
+
+		map = map || {};
+
+		i = items.length;
+		while (i--) {
+			map[items[i]] = {};
+		}
+
+		return map;
+	}
+
+	/**
+	 * Performs an iteration of all items in a collection such as an object or array. This method will execure the
+	 * callback function for each item in the collection, if the callback returns false the iteration will terminate.
+	 * The callback has the following format: cb(value, key_or_index).
+	 *
+	 * @method each
+	 * @param {Object} o Collection to iterate.
+	 * @param {function} cb Callback function to execute for each item.
+	 * @param {Object} s Optional scope to execute the callback in.
+	 * @example
+	 * // Iterate an array
+	 * tinymce.each([1,2,3], function(v, i) {
+	 *     console.debug("Value: " + v + ", Index: " + i);
+	 * });
+	 *
+	 * // Iterate an object
+	 * tinymce.each({a: 1, b: 2, c: 3], function(v, k) {
+	 *     console.debug("Value: " + v + ", Key: " + k);
+	 * });
+	 */
+	function each(o, cb, s) {
+		var n, l;
+
+		if (!o) {
+			return 0;
+		}
+
+		s = s || o;
+
+		if (o.length !== undefined) {
+			// Indexed arrays, needed for Safari
+			for (n = 0, l = o.length; n < l; n++) {
+				if (cb.call(s, o[n], n, o) === false) {
+					return 0;
+				}
+			}
+		} else {
+			// Hashtables
+			for (n in o) {
+				if (o.hasOwnProperty(n)) {
+					if (cb.call(s, o[n], n, o) === false) {
+						return 0;
+					}
+				}
+			}
+		}
+
+		return 1;
+	}
+
+	/**
+	 * Creates a new array by the return value of each iteration function call. This enables you to convert
+	 * one array list into another.
+	 *
+	 * @method map
+	 * @param {Array} array Array of items to iterate.
+	 * @param {function} callback Function to call for each item. It's return value will be the new value.
+	 * @return {Array} Array with new values based on function return values.
+	 */
+	function map(array, callback) {
+		var out = [];
+
+		each(array, function(item) {
+			out.push(callback(item));
+		});
+
+		return out;
+	}
+
+	/**
+	 * Filters out items from the input array by calling the specified function for each item.
+	 * If the function returns false the item will be excluded if it returns true it will be included.
+	 *
+	 * @method grep
+	 * @param {Array} a Array of items to loop though.
+	 * @param {function} f Function to call for each item. Include/exclude depends on it's return value.
+	 * @return {Array} New array with values imported and filtered based in input.
+	 * @example
+	 * // Filter out some items, this will return an array with 4 and 5
+	 * var items = tinymce.grep([1,2,3,4,5], function(v) {return v > 3;});
+	 */
+	function grep(a, f) {
+		var o = [];
+
+		each(a, function(v) {
+			if (!f || f(v)) {
+				o.push(v);
+			}
+		});
+
+		return o;
+	}
+
+	/**
+	 * Creates a class, subclass or static singleton.
+	 * More details on this method can be found in the Wiki.
+	 *
+	 * @method create
+	 * @param {String} s Class name, inheritage and prefix.
+	 * @param {Object} p Collection of methods to add to the class.
+	 * @param {Object} root Optional root object defaults to the global window object.
+	 * @example
+	 * // Creates a basic class
+	 * tinymce.create('tinymce.somepackage.SomeClass', {
+	 *     SomeClass: function() {
+	 *         // Class constructor
+	 *     },
+	 *
+	 *     method: function() {
+	 *         // Some method
+	 *     }
+	 * });
+	 *
+	 * // Creates a basic subclass class
+	 * tinymce.create('tinymce.somepackage.SomeSubClass:tinymce.somepackage.SomeClass', {
+	 *     SomeSubClass: function() {
+	 *         // Class constructor
+	 *         this.parent(); // Call parent constructor
+	 *     },
+	 *
+	 *     method: function() {
+	 *         // Some method
+	 *         this.parent(); // Call parent method
+	 *     },
+	 *
+	 *     'static': {
+	 *         staticMethod: function() {
+	 *             // Static method
+	 *         }
+	 *     }
+	 * });
+	 *
+	 * // Creates a singleton/static class
+	 * tinymce.create('static tinymce.somepackage.SomeSingletonClass', {
+	 *     method: function() {
+	 *         // Some method
+	 *     }
+	 * });
+	 */
+	function create(s, p, root) {
+		var self = this, sp, ns, cn, scn, c, de = 0;
+
+		// Parse : <prefix> <class>:<super class>
+		s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s);
+		cn = s[3].match(/(^|\.)(\w+)$/i)[2]; // Class name
+
+		// Create namespace for new class
+		ns = self.createNS(s[3].replace(/\.\w+$/, ''), root);
+
+		// Class already exists
+		if (ns[cn]) {
+			return;
+		}
+
+		// Make pure static class
+		if (s[2] == 'static') {
+			ns[cn] = p;
+
+			if (this.onCreate) {
+				this.onCreate(s[2], s[3], ns[cn]);
+			}
+
+			return;
+		}
+
+		// Create default constructor
+		if (!p[cn]) {
+			p[cn] = function() {};
+			de = 1;
+		}
+
+		// Add constructor and methods
+		ns[cn] = p[cn];
+		self.extend(ns[cn].prototype, p);
+
+		// Extend
+		if (s[5]) {
+			sp = self.resolve(s[5]).prototype;
+			scn = s[5].match(/\.(\w+)$/i)[1]; // Class name
+
+			// Extend constructor
+			c = ns[cn];
+			if (de) {
+				// Add passthrough constructor
+				ns[cn] = function() {
+					return sp[scn].apply(this, arguments);
+				};
+			} else {
+				// Add inherit constructor
+				ns[cn] = function() {
+					this.parent = sp[scn];
+					return c.apply(this, arguments);
+				};
+			}
+			ns[cn].prototype[cn] = ns[cn];
+
+			// Add super methods
+			self.each(sp, function(f, n) {
+				ns[cn].prototype[n] = sp[n];
+			});
+
+			// Add overridden methods
+			self.each(p, function(f, n) {
+				// Extend methods if needed
+				if (sp[n]) {
+					ns[cn].prototype[n] = function() {
+						this.parent = sp[n];
+						return f.apply(this, arguments);
+					};
+				} else {
+					if (n != cn) {
+						ns[cn].prototype[n] = f;
+					}
+				}
+			});
+		}
+
+		// Add static methods
+		/*jshint sub:true*/
+		/*eslint dot-notation:0*/
+		self.each(p['static'], function(f, n) {
+			ns[cn][n] = f;
+		});
+	}
+
+	/**
+	 * Returns the index of a value in an array, this method will return -1 if the item wasn't found.
+	 *
+	 * @method inArray
+	 * @param {Array} a Array/Object to search for value in.
+	 * @param {Object} v Value to check for inside the array.
+	 * @return {Number/String} Index of item inside the array inside an object. Or -1 if it wasn't found.
+	 * @example
+	 * // Get index of value in array this will alert 1 since 2 is at that index
+	 * alert(tinymce.inArray([1,2,3], 2));
+	 */
+	function inArray(a, v) {
+		var i, l;
+
+		if (a) {
+			for (i = 0, l = a.length; i < l; i++) {
+				if (a[i] === v) {
+					return i;
+				}
+			}
+		}
+
+		return -1;
+	}
+
+	function extend(obj, ext) {
+		var i, l, name, args = arguments, value;
+
+		for (i = 1, l = args.length; i < l; i++) {
+			ext = args[i];
+			for (name in ext) {
+				if (ext.hasOwnProperty(name)) {
+					value = ext[name];
+
+					if (value !== undefined) {
+						obj[name] = value;
+					}
+				}
+			}
+		}
+
+		return obj;
+	}
+
+	/**
+	 * Executed the specified function for each item in a object tree.
+	 *
+	 * @method walk
+	 * @param {Object} o Object tree to walk though.
+	 * @param {function} f Function to call for each item.
+	 * @param {String} n Optional name of collection inside the objects to walk for example childNodes.
+	 * @param {String} s Optional scope to execute the function in.
+	 */
+	function walk(o, f, n, s) {
+		s = s || this;
+
+		if (o) {
+			if (n) {
+				o = o[n];
+			}
+
+			each(o, function(o, i) {
+				if (f.call(s, o, i, n) === false) {
+					return false;
+				}
+
+				walk(o, f, n, s);
+			});
+		}
+	}
+
+	/**
+	 * Creates a namespace on a specific object.
+	 *
+	 * @method createNS
+	 * @param {String} n Namespace to create for example a.b.c.d.
+	 * @param {Object} o Optional object to add namespace to, defaults to window.
+	 * @return {Object} New namespace object the last item in path.
+	 * @example
+	 * // Create some namespace
+	 * tinymce.createNS('tinymce.somepackage.subpackage');
+	 *
+	 * // Add a singleton
+	 * var tinymce.somepackage.subpackage.SomeSingleton = {
+	 *     method: function() {
+	 *         // Some method
+	 *     }
+	 * };
+	 */
+	function createNS(n, o) {
+		var i, v;
+
+		o = o || window;
+
+		n = n.split('.');
+		for (i = 0; i < n.length; i++) {
+			v = n[i];
+
+			if (!o[v]) {
+				o[v] = {};
+			}
+
+			o = o[v];
+		}
+
+		return o;
+	}
+
+	/**
+	 * Resolves a string and returns the object from a specific structure.
+	 *
+	 * @method resolve
+	 * @param {String} n Path to resolve for example a.b.c.d.
+	 * @param {Object} o Optional object to search though, defaults to window.
+	 * @return {Object} Last object in path or null if it couldn't be resolved.
+	 * @example
+	 * // Resolve a path into an object reference
+	 * var obj = tinymce.resolve('a.b.c.d');
+	 */
+	function resolve(n, o) {
+		var i, l;
+
+		o = o || window;
+
+		n = n.split('.');
+		for (i = 0, l = n.length; i < l; i++) {
+			o = o[n[i]];
+
+			if (!o) {
+				break;
+			}
+		}
+
+		return o;
+	}
+
+	/**
+	 * Splits a string but removes the whitespace before and after each value.
+	 *
+	 * @method explode
+	 * @param {string} s String to split.
+	 * @param {string} d Delimiter to split by.
+	 * @example
+	 * // Split a string into an array with a,b,c
+	 * var arr = tinymce.explode('a, b,   c');
+	 */
+	function explode(s, d) {
+		if (!s || is(s, 'array')) {
+			return s;
+		}
+
+		return map(s.split(d || ','), trim);
+	}
+
+	function _addCacheSuffix(url) {
+		var cacheSuffix = Env.cacheSuffix;
+
+		if (cacheSuffix) {
+			url += (url.indexOf('?') === -1 ? '?' : '&') + cacheSuffix;
+		}
+
+		return url;
+	}
+
+	return {
+		trim: trim,
+		isArray: isArray,
+		is: is,
+		toArray: toArray,
+		makeMap: makeMap,
+		each: each,
+		map: map,
+		grep: grep,
+		inArray: inArray,
+		extend: extend,
+		create: create,
+		walk: walk,
+		createNS: createNS,
+		resolve: resolve,
+		explode: explode,
+		_addCacheSuffix: _addCacheSuffix
+	};
+});
+
+// Included from: js/tinymce/classes/dom/DomQuery.js
+
+/**
+ * DomQuery.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class mimics most of the jQuery API:
+ *
+ * This is whats currently implemented:
+ * - Utility functions
+ * - DOM traversial
+ * - DOM manipulation
+ * - Event binding
+ *
+ * This is not currently implemented:
+ * - Dimension
+ * - Ajax
+ * - Animation
+ * - Advanced chaining
+ *
+ * @example
+ * var $ = tinymce.dom.DomQuery;
+ * $('p').attr('attr', 'value').addClass('class');
+ *
+ * @class tinymce.dom.DomQuery
+ */
+define("tinymce/dom/DomQuery", [
+	"tinymce/dom/EventUtils",
+	"tinymce/dom/Sizzle",
+	"tinymce/util/Tools",
+	"tinymce/Env"
+], function(EventUtils, Sizzle, Tools, Env) {
+	var doc = document, push = Array.prototype.push, slice = Array.prototype.slice;
+	var rquickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/;
+	var Event = EventUtils.Event, undef;
+
+	function isDefined(obj) {
+		return typeof obj !== 'undefined';
+	}
+
+	function isString(obj) {
+		return typeof obj === 'string';
+	}
+
+	function isWindow(obj) {
+		return obj && obj == obj.window;
+	}
+
+	function createFragment(html, fragDoc) {
+		var frag, node, container;
+
+		fragDoc = fragDoc || doc;
+		container = fragDoc.createElement('div');
+		frag = fragDoc.createDocumentFragment();
+		container.innerHTML = html;
+
+		while ((node = container.firstChild)) {
+			frag.appendChild(node);
+		}
+
+		return frag;
+	}
+
+	function domManipulate(targetNodes, sourceItem, callback, reverse) {
+		var i;
+
+		if (isString(sourceItem)) {
+			sourceItem = createFragment(sourceItem, getElementDocument(targetNodes[0]));
+		} else if (sourceItem.length && !sourceItem.nodeType) {
+			sourceItem = DomQuery.makeArray(sourceItem);
+
+			if (reverse) {
+				for (i = sourceItem.length - 1; i >= 0; i--) {
+					domManipulate(targetNodes, sourceItem[i], callback, reverse);
+				}
+			} else {
+				for (i = 0; i < sourceItem.length; i++) {
+					domManipulate(targetNodes, sourceItem[i], callback, reverse);
+				}
+			}
+
+			return targetNodes;
+		}
+
+		if (sourceItem.nodeType) {
+			i = targetNodes.length;
+			while (i--) {
+				callback.call(targetNodes[i], sourceItem);
+			}
+		}
+
+		return targetNodes;
+	}
+
+	function hasClass(node, className) {
+		return node && className && (' ' + node.className + ' ').indexOf(' ' + className + ' ') !== -1;
+	}
+
+	function wrap(elements, wrapper, all) {
+		var lastParent, newWrapper;
+
+		wrapper = DomQuery(wrapper)[0];
+
+		elements.each(function() {
+			var self = this;
+
+			if (!all || lastParent != self.parentNode) {
+				lastParent = self.parentNode;
+				newWrapper = wrapper.cloneNode(false);
+				self.parentNode.insertBefore(newWrapper, self);
+				newWrapper.appendChild(self);
+			} else {
+				newWrapper.appendChild(self);
+			}
+		});
+
+		return elements;
+	}
+
+	var numericCssMap = Tools.makeMap('fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom', ' ');
+	var booleanMap = Tools.makeMap('checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected', ' ');
+	var propFix = {
+		'for': 'htmlFor',
+		'class': 'className',
+		'readonly': 'readOnly'
+	};
+	var cssFix = {
+		'float': 'cssFloat'
+	};
+
+	var attrHooks = {}, cssHooks = {};
+
+	function DomQuery(selector, context) {
+		/*eslint new-cap:0 */
+		return new DomQuery.fn.init(selector, context);
+	}
+
+	function inArray(item, array) {
+		var i;
+
+		if (array.indexOf) {
+			return array.indexOf(item);
+		}
+
+		i = array.length;
+		while (i--) {
+			if (array[i] === item) {
+				return i;
+			}
+		}
+
+		return -1;
+	}
+
+	var whiteSpaceRegExp = /^\s*|\s*$/g;
+
+	function trim(str) {
+		return (str === null || str === undef) ? '' : ("" + str).replace(whiteSpaceRegExp, '');
+	}
+
+	function each(obj, callback) {
+		var length, key, i, undef, value;
+
+		if (obj) {
+			length = obj.length;
+
+			if (length === undef) {
+				// Loop object items
+				for (key in obj) {
+					if (obj.hasOwnProperty(key)) {
+						value = obj[key];
+						if (callback.call(value, key, value) === false) {
+							break;
+						}
+					}
+				}
+			} else {
+				// Loop array items
+				for (i = 0; i < length; i++) {
+					value = obj[i];
+					if (callback.call(value, i, value) === false) {
+						break;
+					}
+				}
+			}
+		}
+
+		return obj;
+	}
+
+	function grep(array, callback) {
+		var out = [];
+
+		each(array, function(i, item) {
+			if (callback(item, i)) {
+				out.push(item);
+			}
+		});
+
+		return out;
+	}
+
+	function getElementDocument(element) {
+		if (!element) {
+			return doc;
+		}
+
+		if (element.nodeType == 9) {
+			return element;
+		}
+
+		return element.ownerDocument;
+	}
+
+	DomQuery.fn = DomQuery.prototype = {
+		constructor: DomQuery,
+
+		/**
+		 * Selector for the current set.
+		 *
+		 * @property selector
+		 * @type String
+		 */
+		selector: "",
+
+		/**
+		 * Context used to create the set.
+		 *
+		 * @property context
+		 * @type Element
+		 */
+		context: null,
+
+		/**
+		 * Number of items in the current set.
+		 *
+		 * @property length
+		 * @type Number
+		 */
+		length: 0,
+
+		/**
+		 * Constructs a new DomQuery instance with the specified selector or context.
+		 *
+		 * @constructor
+		 * @method init
+		 * @param {String/Array/DomQuery} selector Optional CSS selector/Array or array like object or HTML string.
+		 * @param {Document/Element} context Optional context to search in.
+		 */
+		init: function(selector, context) {
+			var self = this, match, node;
+
+			if (!selector) {
+				return self;
+			}
+
+			if (selector.nodeType) {
+				self.context = self[0] = selector;
+				self.length = 1;
+
+				return self;
+			}
+
+			if (context && context.nodeType) {
+				self.context = context;
+			} else {
+				if (context) {
+					return DomQuery(selector).attr(context);
+				} else {
+					self.context = context = document;
+				}
+			}
+
+			if (isString(selector)) {
+				self.selector = selector;
+
+				if (selector.charAt(0) === "<" && selector.charAt(selector.length - 1) === ">" && selector.length >= 3) {
+					match = [null, selector, null];
+				} else {
+					match = rquickExpr.exec(selector);
+				}
+
+				if (match) {
+					if (match[1]) {
+						node = createFragment(selector, getElementDocument(context)).firstChild;
+
+						while (node) {
+							push.call(self, node);
+							node = node.nextSibling;
+						}
+					} else {
+						node = getElementDocument(context).getElementById(match[2]);
+
+						if (!node) {
+							return self;
+						}
+
+						if (node.id !== match[2]) {
+							return self.find(selector);
+						}
+
+						self.length = 1;
+						self[0] = node;
+					}
+				} else {
+					return DomQuery(context).find(selector);
+				}
+			} else {
+				this.add(selector, false);
+			}
+
+			return self;
+		},
+
+		/**
+		 * Converts the current set to an array.
+		 *
+		 * @method toArray
+		 * @param {Array} Array of all nodes in set.
+		 */
+		toArray: function() {
+			return Tools.toArray(this);
+		},
+
+		/**
+		 * Adds new nodes to the set.
+		 *
+		 * @method add
+		 * @param {Array/tinymce.dom.DomQuery} items Array of all nodes to add to set.
+		 * @return {tinymce.dom.DomQuery} New instance with nodes added.
+		 */
+		add: function(items, sort) {
+			var self = this, nodes, i;
+
+			if (isString(items)) {
+				return self.add(DomQuery(items));
+			}
+
+			if (sort !== false) {
+				nodes = DomQuery.unique(self.toArray().concat(DomQuery.makeArray(items)));
+				self.length = nodes.length;
+				for (i = 0; i < nodes.length; i++) {
+					self[i] = nodes[i];
+				}
+			} else {
+				push.apply(self, DomQuery.makeArray(items));
+			}
+
+			return self;
+		},
+
+		/**
+		 * Sets/gets attributes on the elements in the current set.
+		 *
+		 * @method attr
+		 * @param {String/Object} name Name of attribute to get or an object with attributes to set.
+		 * @param {String} value Optional value to set.
+		 * @return {tinymce.dom.DomQuery/String} Current set or the specified attribute when only the name is specified.
+		 */
+		attr: function(name, value) {
+			var self = this, hook;
+
+			if (typeof name === "object") {
+				each(name, function(name, value) {
+					self.attr(name, value);
+				});
+			} else if (isDefined(value)) {
+				this.each(function() {
+					var hook;
+
+					if (this.nodeType === 1) {
+						hook = attrHooks[name];
+						if (hook && hook.set) {
+							hook.set(this, value);
+							return;
+						}
+
+						if (value === null) {
+							this.removeAttribute(name, 2);
+						} else {
+							this.setAttribute(name, value, 2);
+						}
+					}
+				});
+			} else {
+				if (self[0] && self[0].nodeType === 1) {
+					hook = attrHooks[name];
+					if (hook && hook.get) {
+						return hook.get(self[0], name);
+					}
+
+					if (booleanMap[name]) {
+						return self.prop(name) ? name : undef;
+					}
+
+					value = self[0].getAttribute(name, 2);
+
+					if (value === null) {
+						value = undef;
+					}
+				}
+
+				return value;
+			}
+
+			return self;
+		},
+
+		/**
+		 * Removes attributse on the elements in the current set.
+		 *
+		 * @method removeAttr
+		 * @param {String/Object} name Name of attribute to remove.
+		 * @return {tinymce.dom.DomQuery/String} Current set.
+		 */
+		removeAttr: function(name) {
+			return this.attr(name, null);
+		},
+
+		/**
+		 * Sets/gets properties on the elements in the current set.
+		 *
+		 * @method attr
+		 * @param {String/Object} name Name of property to get or an object with properties to set.
+		 * @param {String} value Optional value to set.
+		 * @return {tinymce.dom.DomQuery/String} Current set or the specified property when only the name is specified.
+		 */
+		prop: function(name, value) {
+			var self = this;
+
+			name = propFix[name] || name;
+
+			if (typeof name === "object") {
+				each(name, function(name, value) {
+					self.prop(name, value);
+				});
+			} else if (isDefined(value)) {
+				this.each(function() {
+					if (this.nodeType == 1) {
+						this[name] = value;
+					}
+				});
+			} else {
+				if (self[0] && self[0].nodeType && name in self[0]) {
+					return self[0][name];
+				}
+
+				return value;
+			}
+
+			return self;
+		},
+
+		/**
+		 * Sets/gets styles on the elements in the current set.
+		 *
+		 * @method css
+		 * @param {String/Object} name Name of style to get or an object with styles to set.
+		 * @param {String} value Optional value to set.
+		 * @return {tinymce.dom.DomQuery/String} Current set or the specified style when only the name is specified.
+		 */
+		css: function(name, value) {
+			var self = this, elm, hook;
+
+			function camel(name) {
+				return name.replace(/-(\D)/g, function(a, b) {
+					return b.toUpperCase();
+				});
+			}
+
+			function dashed(name) {
+				return name.replace(/[A-Z]/g, function(a) {
+					return '-' + a;
+				});
+			}
+
+			if (typeof name === "object") {
+				each(name, function(name, value) {
+					self.css(name, value);
+				});
+			} else {
+				if (isDefined(value)) {
+					name = camel(name);
+
+					// Default px suffix on these
+					if (typeof value === 'number' && !numericCssMap[name]) {
+						value += 'px';
+					}
+
+					self.each(function() {
+						var style = this.style;
+
+						hook = cssHooks[name];
+						if (hook && hook.set) {
+							hook.set(this, value);
+							return;
+						}
+
+						try {
+							this.style[cssFix[name] || name] = value;
+						} catch (ex) {
+							// Ignore
+						}
+
+						if (value === null || value === '') {
+							if (style.removeProperty) {
+								style.removeProperty(dashed(name));
+							} else {
+								style.removeAttribute(name);
+							}
+						}
+					});
+				} else {
+					elm = self[0];
+
+					hook = cssHooks[name];
+					if (hook && hook.get) {
+						return hook.get(elm);
+					}
+
+					if (elm.ownerDocument.defaultView) {
+						try {
+							return elm.ownerDocument.defaultView.getComputedStyle(elm, null).getPropertyValue(dashed(name));
+						} catch (ex) {
+							return undef;
+						}
+					} else if (elm.currentStyle) {
+						return elm.currentStyle[camel(name)];
+					}
+				}
+			}
+
+			return self;
+		},
+
+		/**
+		 * Removes all nodes in set from the document.
+		 *
+		 * @method remove
+		 * @return {tinymce.dom.DomQuery} Current set with the removed nodes.
+		 */
+		remove: function() {
+			var self = this, node, i = this.length;
+
+			while (i--) {
+				node = self[i];
+				Event.clean(node);
+
+				if (node.parentNode) {
+					node.parentNode.removeChild(node);
+				}
+			}
+
+			return this;
+		},
+
+		/**
+		 * Empties all elements in set.
+		 *
+		 * @method empty
+		 * @return {tinymce.dom.DomQuery} Current set with the empty nodes.
+		 */
+		empty: function() {
+			var self = this, node, i = this.length;
+
+			while (i--) {
+				node = self[i];
+				while (node.firstChild) {
+					node.removeChild(node.firstChild);
+				}
+			}
+
+			return this;
+		},
+
+		/**
+		 * Sets or gets the HTML of the current set or first set node.
+		 *
+		 * @method html
+		 * @param {String} value Optional innerHTML value to set on each element.
+		 * @return {tinymce.dom.DomQuery/String} Current set or the innerHTML of the first element.
+		 */
+		html: function(value) {
+			var self = this, i;
+
+			if (isDefined(value)) {
+				i = self.length;
+
+				try {
+					while (i--) {
+						self[i].innerHTML = value;
+					}
+				} catch (ex) {
+					// Workaround for "Unknown runtime error" when DIV is added to P on IE
+					DomQuery(self[i]).empty().append(value);
+				}
+
+				return self;
+			}
+
+			return self[0] ? self[0].innerHTML : '';
+		},
+
+		/**
+		 * Sets or gets the text of the current set or first set node.
+		 *
+		 * @method text
+		 * @param {String} value Optional innerText value to set on each element.
+		 * @return {tinymce.dom.DomQuery/String} Current set or the innerText of the first element.
+		 */
+		text: function(value) {
+			var self = this, i;
+
+			if (isDefined(value)) {
+				i = self.length;
+				while (i--) {
+					if ("innerText" in self[i]) {
+						self[i].innerText = value;
+					} else {
+						self[0].textContent = value;
+					}
+				}
+
+				return self;
+			}
+
+			return self[0] ? (self[0].innerText || self[0].textContent) : '';
+		},
+
+		/**
+		 * Appends the specified node/html or node set to the current set nodes.
+		 *
+		 * @method append
+		 * @param {String/Element/Array/tinymce.dom.DomQuery} content Content to append to each element in set.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		append: function() {
+			return domManipulate(this, arguments, function(node) {
+				if (this.nodeType === 1) {
+					this.appendChild(node);
+				}
+			});
+		},
+
+		/**
+		 * Prepends the specified node/html or node set to the current set nodes.
+		 *
+		 * @method prepend
+		 * @param {String/Element/Array/tinymce.dom.DomQuery} content Content to prepend to each element in set.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		prepend: function() {
+			return domManipulate(this, arguments, function(node) {
+				if (this.nodeType === 1) {
+					this.insertBefore(node, this.firstChild);
+				}
+			}, true);
+		},
+
+		/**
+		 * Adds the specified elements before current set nodes.
+		 *
+		 * @method before
+		 * @param {String/Element/Array/tinymce.dom.DomQuery} content Content to add before to each element in set.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		before: function() {
+			var self = this;
+
+			if (self[0] && self[0].parentNode) {
+				return domManipulate(self, arguments, function(node) {
+					this.parentNode.insertBefore(node, this);
+				});
+			}
+
+			return self;
+		},
+
+		/**
+		 * Adds the specified elements after current set nodes.
+		 *
+		 * @method after
+		 * @param {String/Element/Array/tinymce.dom.DomQuery} content Content to add after to each element in set.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		after: function() {
+			var self = this;
+
+			if (self[0] && self[0].parentNode) {
+				return domManipulate(self, arguments, function(node) {
+					this.parentNode.insertBefore(node, this.nextSibling);
+				}, true);
+			}
+
+			return self;
+		},
+
+		/**
+		 * Appends the specified set nodes to the specified selector/instance.
+		 *
+		 * @method appendTo
+		 * @param {String/Element/Array/tinymce.dom.DomQuery} val Item to append the current set to.
+		 * @return {tinymce.dom.DomQuery} Current set with the appended nodes.
+		 */
+		appendTo: function(val) {
+			DomQuery(val).append(this);
+
+			return this;
+		},
+
+		/**
+		 * Prepends the specified set nodes to the specified selector/instance.
+		 *
+		 * @method prependTo
+		 * @param {String/Element/Array/tinymce.dom.DomQuery} val Item to prepend the current set to.
+		 * @return {tinymce.dom.DomQuery} Current set with the prepended nodes.
+		 */
+		prependTo: function(val) {
+			DomQuery(val).prepend(this);
+
+			return this;
+		},
+
+		/**
+		 * Replaces the nodes in set with the specified content.
+		 *
+		 * @method replaceWith
+		 * @param {String/Element/Array/tinymce.dom.DomQuery} content Content to replace nodes with.
+		 * @return {tinymce.dom.DomQuery} Set with replaced nodes.
+		 */
+		replaceWith: function(content) {
+			return this.before(content).remove();
+		},
+
+		/**
+		 * Wraps all elements in set with the specified wrapper.
+		 *
+		 * @method wrap
+		 * @param {String/Element/Array/tinymce.dom.DomQuery} content Content to wrap nodes with.
+		 * @return {tinymce.dom.DomQuery} Set with wrapped nodes.
+		 */
+		wrap: function(wrapper) {
+			return wrap(this, wrapper);
+		},
+
+		/**
+		 * Wraps all nodes in set with the specified wrapper. If the nodes are siblings all of them
+		 * will be wrapped in the same wrapper.
+		 *
+		 * @method wrapAll
+		 * @param {String/Element/Array/tinymce.dom.DomQuery} content Content to wrap nodes with.
+		 * @return {tinymce.dom.DomQuery} Set with wrapped nodes.
+		 */
+		wrapAll: function(wrapper) {
+			return wrap(this, wrapper, true);
+		},
+
+		/**
+		 * Wraps all elements inner contents in set with the specified wrapper.
+		 *
+		 * @method wrapInner
+		 * @param {String/Element/Array/tinymce.dom.DomQuery} content Content to wrap nodes with.
+		 * @return {tinymce.dom.DomQuery} Set with wrapped nodes.
+		 */
+		wrapInner: function(wrapper) {
+			this.each(function() {
+				DomQuery(this).contents().wrapAll(wrapper);
+			});
+
+			return this;
+		},
+
+		/**
+		 * Unwraps all elements by removing the parent element of each item in set.
+		 *
+		 * @method unwrap
+		 * @return {tinymce.dom.DomQuery} Set with unwrapped nodes.
+		 */
+		unwrap: function() {
+			return this.parent().each(function() {
+				DomQuery(this).replaceWith(this.childNodes);
+			});
+		},
+
+		/**
+		 * Clones all nodes in set.
+		 *
+		 * @method clone
+		 * @return {tinymce.dom.DomQuery} Set with cloned nodes.
+		 */
+		clone: function() {
+			var result = [];
+
+			this.each(function() {
+				result.push(this.cloneNode(true));
+			});
+
+			return DomQuery(result);
+		},
+
+		/**
+		 * Adds the specified class name to the current set elements.
+		 *
+		 * @method addClass
+		 * @param {String} className Class name to add.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		addClass: function(className) {
+			return this.toggleClass(className, true);
+		},
+
+		/**
+		 * Removes the specified class name to the current set elements.
+		 *
+		 * @method removeClass
+		 * @param {String} className Class name to remove.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		removeClass: function(className) {
+			return this.toggleClass(className, false);
+		},
+
+		/**
+		 * Toggles the specified class name on the current set elements.
+		 *
+		 * @method toggleClass
+		 * @param {String} className Class name to add/remove.
+		 * @param {Boolean} state Optional state to toggle on/off.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		toggleClass: function(className, state) {
+			var self = this;
+
+			// Functions are not supported
+			if (typeof className != 'string') {
+				return self;
+			}
+
+			if (className.indexOf(' ') !== -1) {
+				each(className.split(' '), function() {
+					self.toggleClass(this, state);
+				});
+			} else {
+				self.each(function(index, node) {
+					var existingClassName, classState;
+
+					classState = hasClass(node, className);
+					if (classState !== state) {
+						existingClassName = node.className;
+
+						if (classState) {
+							node.className = trim((" " + existingClassName + " ").replace(' ' + className + ' ', ' '));
+						} else {
+							node.className += existingClassName ? ' ' + className : className;
+						}
+					}
+				});
+			}
+
+			return self;
+		},
+
+		/**
+		 * Returns true/false if the first item in set has the specified class.
+		 *
+		 * @method hasClass
+		 * @param {String} className Class name to check for.
+		 * @return {Boolean} True/false if the set has the specified class.
+		 */
+		hasClass: function(className) {
+			return hasClass(this[0], className);
+		},
+
+		/**
+		 * Executes the callback function for each item DomQuery collection. If you return false in the
+		 * callback it will break the loop.
+		 *
+		 * @method each
+		 * @param {function} callback Callback function to execute for each item.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		each: function(callback) {
+			return each(this, callback);
+		},
+
+		/**
+		 * Binds an event with callback function to the elements in set.
+		 *
+		 * @method on
+		 * @param {String} name Name of the event to bind.
+		 * @param {function} callback Callback function to execute when the event occurs.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		on: function(name, callback) {
+			return this.each(function() {
+				Event.bind(this, name, callback);
+			});
+		},
+
+		/**
+		 * Unbinds an event with callback function to the elements in set.
+		 *
+		 * @method off
+		 * @param {String} name Optional name of the event to bind.
+		 * @param {function} callback Optional callback function to execute when the event occurs.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		off: function(name, callback) {
+			return this.each(function() {
+				Event.unbind(this, name, callback);
+			});
+		},
+
+		/**
+		 * Triggers the specified event by name or event object.
+		 *
+		 * @method trigger
+		 * @param {String/Object} name Name of the event to trigger or event object.
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		trigger: function(name) {
+			return this.each(function() {
+				if (typeof name == 'object') {
+					Event.fire(this, name.type, name);
+				} else {
+					Event.fire(this, name);
+				}
+			});
+		},
+
+		/**
+		 * Shows all elements in set.
+		 *
+		 * @method show
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		show: function() {
+			return this.css('display', '');
+		},
+
+		/**
+		 * Hides all elements in set.
+		 *
+		 * @method hide
+		 * @return {tinymce.dom.DomQuery} Current set.
+		 */
+		hide: function() {
+			return this.css('display', 'none');
+		},
+
+		/**
+		 * Slices the current set.
+		 *
+		 * @method slice
+		 * @param {Number} start Start index to slice at.
+		 * @param {Number} end Optional ened index to end slice at.
+		 * @return {tinymce.dom.DomQuery} Sliced set.
+		 */
+		slice: function() {
+			return new DomQuery(slice.apply(this, arguments));
+		},
+
+		/**
+		 * Makes the set equal to the specified index.
+		 *
+		 * @method eq
+		 * @param {Number} index Index to set it equal to.
+		 * @return {tinymce.dom.DomQuery} Single item set.
+		 */
+		eq: function(index) {
+			return index === -1 ? this.slice(index) : this.slice(index, +index + 1);
+		},
+
+		/**
+		 * Makes the set equal to first element in set.
+		 *
+		 * @method first
+		 * @return {tinymce.dom.DomQuery} Single item set.
+		 */
+		first: function() {
+			return this.eq(0);
+		},
+
+		/**
+		 * Makes the set equal to last element in set.
+		 *
+		 * @method last
+		 * @return {tinymce.dom.DomQuery} Single item set.
+		 */
+		last: function() {
+			return this.eq(-1);
+		},
+
+		/**
+		 * Finds elements by the specified selector for each element in set.
+		 *
+		 * @method find
+		 * @param {String} selector Selector to find elements by.
+		 * @return {tinymce.dom.DomQuery} Set with matches elements.
+		 */
+		find: function(selector) {
+			var i, l, ret = [];
+
+			for (i = 0, l = this.length; i < l; i++) {
+				DomQuery.find(selector, this[i], ret);
+			}
+
+			return DomQuery(ret);
+		},
+
+		/**
+		 * Filters the current set with the specified selector.
+		 *
+		 * @method filter
+		 * @param {String/function} selector Selector to filter elements by.
+		 * @return {tinymce.dom.DomQuery} Set with filtered elements.
+		 */
+		filter: function(selector) {
+			if (typeof selector == 'function') {
+				return DomQuery(grep(this.toArray(), function(item, i) {
+					return selector(i, item);
+				}));
+			}
+
+			return DomQuery(DomQuery.filter(selector, this.toArray()));
+		},
+
+		/**
+		 * Gets the current node or any partent matching the specified selector.
+		 *
+		 * @method closest
+		 * @param {String/Element/tinymce.dom.DomQuery} selector Selector or element to find.
+		 * @return {tinymce.dom.DomQuery} Set with closest elements.
+		 */
+		closest: function(selector) {
+			var result = [];
+
+			if (selector instanceof DomQuery) {
+				selector = selector[0];
+			}
+
+			this.each(function(i, node) {
+				while (node) {
+					if (typeof selector == 'string' && DomQuery(node).is(selector)) {
+						result.push(node);
+						break;
+					} else if (node == selector) {
+						result.push(node);
+						break;
+					}
+
+					node = node.parentNode;
+				}
+			});
+
+			return DomQuery(result);
+		},
+
+		/**
+		 * Returns the offset of the first element in set or sets the top/left css properties of all elements in set.
+		 *
+		 * @method offset
+		 * @param {Object} offset Optional offset object to set on each item.
+		 * @return {Object/tinymce.dom.DomQuery} Returns the first element offset or the current set if you specified an offset.
+		 */
+		offset: function(offset) {
+			var elm, doc, docElm;
+			var x = 0, y = 0, pos;
+
+			if (!offset) {
+				elm = this[0];
+
+				if (elm) {
+					doc = elm.ownerDocument;
+					docElm = doc.documentElement;
+
+					if (elm.getBoundingClientRect) {
+						pos = elm.getBoundingClientRect();
+						x = pos.left + (docElm.scrollLeft || doc.body.scrollLeft) - docElm.clientLeft;
+						y = pos.top + (docElm.scrollTop || doc.body.scrollTop) - docElm.clientTop;
+					}
+				}
+
+				return {
+					left: x,
+					top: y
+				};
+			}
+
+			return this.css(offset);
+		},
+
+		push: push,
+		sort: [].sort,
+		splice: [].splice
+	};
+
+	// Static members
+	Tools.extend(DomQuery, {
+		/**
+		 * Extends the specified object with one or more objects.
+		 *
+		 * @static
+		 * @method extend
+		 * @param {Object} target Target object to extend with new items.
+		 * @param {Object..} object Object to extend the target with.
+		 * @return {Object} Extended input object.
+		 */
+		extend: Tools.extend,
+
+		/**
+		 * Creates an array out of an array like object.
+		 *
+		 * @static
+		 * @method makeArray
+		 * @param {Object} object Object to convert to array.
+		 * @return {Arrau} Array produced from object.
+		 */
+		makeArray: function(array) {
+			if (isWindow(array) || array.nodeType) {
+				return [array];
+			}
+
+			return Tools.toArray(array);
+		},
+
+		/**
+		 * Returns the index of the specified item inside the array.
+		 *
+		 * @static
+		 * @method inArray
+		 * @param {Object} item Item to look for.
+		 * @param {Array} array Array to look for item in.
+		 * @return {Number} Index of the item or -1.
+		 */
+		inArray: inArray,
+
+		/**
+		 * Returns true/false if the specified object is an array or not.
+		 *
+		 * @static
+		 * @method isArray
+		 * @param {Object} array Object to check if it's an array or not.
+		 * @return {Boolean} True/false if the object is an array.
+		 */
+		isArray: Tools.isArray,
+
+		/**
+		 * Executes the callback function for each item in array/object. If you return false in the
+		 * callback it will break the loop.
+		 *
+		 * @static
+		 * @method each
+		 * @param {Object} obj Object to iterate.
+		 * @param {function} callback Callback function to execute for each item.
+		 */
+		each: each,
+
+		/**
+		 * Removes whitespace from the beginning and end of a string.
+		 *
+		 * @static
+		 * @method trim
+		 * @param {String} str String to remove whitespace from.
+		 * @return {String} New string with removed whitespace.
+		 */
+		trim: trim,
+
+		/**
+		 * Filters out items from the input array by calling the specified function for each item.
+		 * If the function returns false the item will be excluded if it returns true it will be included.
+		 *
+		 * @static
+		 * @method grep
+		 * @param {Array} array Array of items to loop though.
+		 * @param {function} callback Function to call for each item. Include/exclude depends on it's return value.
+		 * @return {Array} New array with values imported and filtered based in input.
+		 * @example
+		 * // Filter out some items, this will return an array with 4 and 5
+		 * var items = DomQuery.grep([1, 2, 3, 4, 5], function(v) {return v > 3;});
+		 */
+		grep: grep,
+
+		// Sizzle
+		find: Sizzle,
+		expr: Sizzle.selectors,
+		unique: Sizzle.uniqueSort,
+		text: Sizzle.getText,
+		contains: Sizzle.contains,
+		filter: function(expr, elems, not) {
+			var i = elems.length;
+
+			if (not) {
+				expr = ":not(" + expr + ")";
+			}
+
+			while (i--) {
+				if (elems[i].nodeType != 1) {
+					elems.splice(i, 1);
+				}
+			}
+
+			if (elems.length === 1) {
+				elems = DomQuery.find.matchesSelector(elems[0], expr) ? [elems[0]] : [];
+			} else {
+				elems = DomQuery.find.matches(expr, elems);
+			}
+
+			return elems;
+		}
+	});
+
+	function dir(el, prop, until) {
+		var matched = [], cur = el[prop];
+
+		if (typeof until != 'string' && until instanceof DomQuery) {
+			until = until[0];
+		}
+
+		while (cur && cur.nodeType !== 9) {
+			if (until !== undefined) {
+				if (cur === until) {
+					break;
+				}
+
+				if (typeof until == 'string' && DomQuery(cur).is(until)) {
+					break;
+				}
+			}
+
+			if (cur.nodeType === 1) {
+				matched.push(cur);
+			}
+
+			cur = cur[prop];
+		}
+
+		return matched;
+	}
+
+	function sibling(node, siblingName, nodeType, until) {
+		var result = [];
+
+		if (until instanceof DomQuery) {
+			until = until[0];
+		}
+
+		for (; node; node = node[siblingName]) {
+			if (nodeType && node.nodeType !== nodeType) {
+				continue;
+			}
+
+			if (until !== undefined) {
+				if (node === until) {
+					break;
+				}
+
+				if (typeof until == 'string' && DomQuery(node).is(until)) {
+					break;
+				}
+			}
+
+			result.push(node);
+		}
+
+		return result;
+	}
+
+	function firstSibling(node, siblingName, nodeType) {
+		for (node = node[siblingName]; node; node = node[siblingName]) {
+			if (node.nodeType == nodeType) {
+				return node;
+			}
+		}
+
+		return null;
+	}
+
+	each({
+		/**
+		 * Returns a new collection with the parent of each item in current collection matching the optional selector.
+		 *
+		 * @method parent
+		 * @param {String} selector Selector to match parents agains.
+		 * @return {tinymce.dom.DomQuery} New DomQuery instance with all matching parents.
+		 */
+		parent: function(node) {
+			var parent = node.parentNode;
+
+			return parent && parent.nodeType !== 11 ? parent : null;
+		},
+
+		/**
+		 * Returns a new collection with the all the parents of each item in current collection matching the optional selector.
+		 *
+		 * @method parents
+		 * @param {String} selector Selector to match parents agains.
+		 * @return {tinymce.dom.DomQuery} New DomQuery instance with all matching parents.
+		 */
+		parents: function(node) {
+			return dir(node, "parentNode");
+		},
+
+		/**
+		 * Returns a new collection with next sibling of each item in current collection matching the optional selector.
+		 *
+		 * @method next
+		 * @param {String} selector Selector to match the next element against.
+		 * @return {tinymce.dom.DomQuery} New DomQuery instance with all matching elements.
+		 */
+		next: function(node) {
+			return firstSibling(node, 'nextSibling', 1);
+		},
+
+		/**
+		 * Returns a new collection with previous sibling of each item in current collection matching the optional selector.
+		 *
+		 * @method prev
+		 * @param {String} selector Selector to match the previous element against.
+		 * @return {tinymce.dom.DomQuery} New DomQuery instance with all matching elements.
+		 */
+		prev: function(node) {
+			return firstSibling(node, 'previousSibling', 1);
+		},
+
+		/**
+		 * Returns all child elements matching the optional selector.
+		 *
+		 * @method children
+		 * @param {String} selector Selector to match the elements against.
+		 * @return {tinymce.dom.DomQuery} New DomQuery instance with all matching elements.
+		 */
+		children: function(node) {
+			return sibling(node.firstChild, 'nextSibling', 1);
+		},
+
+		/**
+		 * Returns all child nodes matching the optional selector.
+		 *
+		 * @method contents
+		 * @return {tinymce.dom.DomQuery} New DomQuery instance with all matching elements.
+		 */
+		contents: function(node) {
+			return Tools.toArray((node.nodeName === "iframe" ? node.contentDocument || node.contentWindow.document : node).childNodes);
+		}
+	}, function(name, fn) {
+		DomQuery.fn[name] = function(selector) {
+			var self = this, result = [];
+
+			self.each(function() {
+				var nodes = fn.call(result, this, selector, result);
+
+				if (nodes) {
+					if (DomQuery.isArray(nodes)) {
+						result.push.apply(result, nodes);
+					} else {
+						result.push(nodes);
+					}
+				}
+			});
+
+			// If traversing on multiple elements we might get the same elements twice
+			if (this.length > 1) {
+				result = DomQuery.unique(result);
+
+				if (name.indexOf('parents') === 0) {
+					result = result.reverse();
+				}
+			}
+
+			result = DomQuery(result);
+
+			if (selector) {
+				return result.filter(selector);
+			}
+
+			return result;
+		};
+	});
+
+	each({
+		/**
+		 * Returns a new collection with the all the parents until the matching selector/element
+		 * of each item in current collection matching the optional selector.
+		 *
+		 * @method parentsUntil
+		 * @param {String/Element/tinymce.dom.DomQuery} until Until the matching selector or element.
+		 * @return {tinymce.dom.DomQuery} New DomQuery instance with all matching parents.
+		 */
+		parentsUntil: function(node, until) {
+			return dir(node, "parentNode", until);
+		},
+
+		/**
+		 * Returns a new collection with all next siblings of each item in current collection matching the optional selector.
+		 *
+		 * @method nextUntil
+		 * @param {String/Element/tinymce.dom.DomQuery} until Until the matching selector or element.
+		 * @return {tinymce.dom.DomQuery} New DomQuery instance with all matching elements.
+		 */
+		nextUntil: function(node, until) {
+			return sibling(node, 'nextSibling', 1, until).slice(1);
+		},
+
+		/**
+		 * Returns a new collection with all previous siblings of each item in current collection matching the optional selector.
+		 *
+		 * @method prevUntil
+		 * @param {String/Element/tinymce.dom.DomQuery} until Until the matching selector or element.
+		 * @return {tinymce.dom.DomQuery} New DomQuery instance with all matching elements.
+		 */
+		prevUntil: function(node, until) {
+			return sibling(node, 'previousSibling', 1, until).slice(1);
+		}
+	}, function(name, fn) {
+		DomQuery.fn[name] = function(selector, filter) {
+			var self = this, result = [];
+
+			self.each(function() {
+				var nodes = fn.call(result, this, selector, result);
+
+				if (nodes) {
+					if (DomQuery.isArray(nodes)) {
+						result.push.apply(result, nodes);
+					} else {
+						result.push(nodes);
+					}
+				}
+			});
+
+			// If traversing on multiple elements we might get the same elements twice
+			if (this.length > 1) {
+				result = DomQuery.unique(result);
+
+				if (name.indexOf('parents') === 0 || name === 'prevUntil') {
+					result = result.reverse();
+				}
+			}
+
+			result = DomQuery(result);
+
+			if (filter) {
+				return result.filter(filter);
+			}
+
+			return result;
+		};
+	});
+
+	/**
+	 * Returns true/false if the current set items matches the selector.
+	 *
+	 * @method is
+	 * @param {String} selector Selector to match the elements against.
+	 * @return {Boolean} True/false if the current set matches the selector.
+	 */
+	DomQuery.fn.is = function(selector) {
+		return !!selector && this.filter(selector).length > 0;
+	};
+
+	DomQuery.fn.init.prototype = DomQuery.fn;
+
+	DomQuery.overrideDefaults = function(callback) {
+		var defaults;
+
+		function sub(selector, context) {
+			defaults = defaults || callback();
+
+			if (arguments.length === 0) {
+				selector = defaults.element;
+			}
+
+			if (!context) {
+				context = defaults.context;
+			}
+
+			return new sub.fn.init(selector, context);
+		}
+
+		DomQuery.extend(sub, this);
+
+		return sub;
+	};
+
+	function appendHooks(targetHooks, prop, hooks) {
+		each(hooks, function(name, func) {
+			targetHooks[name] = targetHooks[name] || {};
+			targetHooks[name][prop] = func;
+		});
+	}
+
+	if (Env.ie && Env.ie < 8) {
+		appendHooks(attrHooks, 'get', {
+			maxlength: function(elm) {
+				var value = elm.maxLength;
+
+				if (value === 0x7fffffff) {
+					return undef;
+				}
+
+				return value;
+			},
+
+			size: function(elm) {
+				var value = elm.size;
+
+				if (value === 20) {
+					return undef;
+				}
+
+				return value;
+			},
+
+			'class': function(elm) {
+				return elm.className;
+			},
+
+			style: function(elm) {
+				var value = elm.style.cssText;
+
+				if (value.length === 0) {
+					return undef;
+				}
+
+				return value;
+			}
+		});
+
+		appendHooks(attrHooks, 'set', {
+			'class': function(elm, value) {
+				elm.className = value;
+			},
+
+			style: function(elm, value) {
+				elm.style.cssText = value;
+			}
+		});
+	}
+
+	if (Env.ie && Env.ie < 9) {
+		/*jshint sub:true */
+		/*eslint dot-notation: 0*/
+		cssFix['float'] = 'styleFloat';
+
+		appendHooks(cssHooks, 'set', {
+			opacity: function(elm, value) {
+				var style = elm.style;
+
+				if (value === null || value === '') {
+					style.removeAttribute('filter');
+				} else {
+					style.zoom = 1;
+					style.filter = 'alpha(opacity=' + (value * 100) + ')';
+				}
+			}
+		});
+	}
+
+	DomQuery.attrHooks = attrHooks;
+	DomQuery.cssHooks = cssHooks;
+
+	return DomQuery;
+});
+
+// Included from: js/tinymce/classes/html/Styles.js
+
+/**
+ * Styles.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is used to parse CSS styles it also compresses styles to reduce the output size.
+ *
+ * @example
+ * var Styles = new tinymce.html.Styles({
+ *    url_converter: function(url) {
+ *       return url;
+ *    }
+ * });
+ *
+ * styles = Styles.parse('border: 1px solid red');
+ * styles.color = 'red';
+ *
+ * console.log(new tinymce.html.StyleSerializer().serialize(styles));
+ *
+ * @class tinymce.html.Styles
+ * @version 3.4
+ */
+define("tinymce/html/Styles", [], function() {
+	return function(settings, schema) {
+		/*jshint maxlen:255 */
+		/*eslint max-len:0 */
+		var rgbRegExp = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,
+			urlOrStrRegExp = /(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,
+			styleRegExp = /\s*([^:]+):\s*([^;]+);?/g,
+			trimRightRegExp = /\s+$/,
+			undef, i, encodingLookup = {}, encodingItems, validStyles, invalidStyles, invisibleChar = '\uFEFF';
+
+		settings = settings || {};
+
+		if (schema) {
+			validStyles = schema.getValidStyles();
+			invalidStyles = schema.getInvalidStyles();
+		}
+
+		encodingItems = ('\\" \\\' \\; \\: ; : ' + invisibleChar).split(' ');
+		for (i = 0; i < encodingItems.length; i++) {
+			encodingLookup[encodingItems[i]] = invisibleChar + i;
+			encodingLookup[invisibleChar + i] = encodingItems[i];
+		}
+
+		function toHex(match, r, g, b) {
+			function hex(val) {
+				val = parseInt(val, 10).toString(16);
+
+				return val.length > 1 ? val : '0' + val; // 0 -> 00
+			}
+
+			return '#' + hex(r) + hex(g) + hex(b);
+		}
+
+		return {
+			/**
+			 * Parses the specified RGB color value and returns a hex version of that color.
+			 *
+			 * @method toHex
+			 * @param {String} color RGB string value like rgb(1,2,3)
+			 * @return {String} Hex version of that RGB value like #FF00FF.
+			 */
+			toHex: function(color) {
+				return color.replace(rgbRegExp, toHex);
+			},
+
+			/**
+			 * Parses the specified style value into an object collection. This parser will also
+			 * merge and remove any redundant items that browsers might have added. It will also convert non hex
+			 * colors to hex values. Urls inside the styles will also be converted to absolute/relative based on settings.
+			 *
+			 * @method parse
+			 * @param {String} css Style value to parse for example: border:1px solid red;.
+			 * @return {Object} Object representation of that style like {border: '1px solid red'}
+			 */
+			parse: function(css) {
+				var styles = {}, matches, name, value, isEncoded, urlConverter = settings.url_converter;
+				var urlConverterScope = settings.url_converter_scope || this;
+
+				function compress(prefix, suffix, noJoin) {
+					var top, right, bottom, left;
+
+					top = styles[prefix + '-top' + suffix];
+					if (!top) {
+						return;
+					}
+
+					right = styles[prefix + '-right' + suffix];
+					if (!right) {
+						return;
+					}
+
+					bottom = styles[prefix + '-bottom' + suffix];
+					if (!bottom) {
+						return;
+					}
+
+					left = styles[prefix + '-left' + suffix];
+					if (!left) {
+						return;
+					}
+
+					var box = [top, right, bottom, left];
+					i = box.length - 1;
+					while (i--) {
+						if (box[i] !== box[i + 1]) {
+							break;
+						}
+					}
+
+					if (i > -1 && noJoin) {
+						return;
+					}
+
+					styles[prefix + suffix] = i == -1 ? box[0] : box.join(' ');
+					delete styles[prefix + '-top' + suffix];
+					delete styles[prefix + '-right' + suffix];
+					delete styles[prefix + '-bottom' + suffix];
+					delete styles[prefix + '-left' + suffix];
+				}
+
+				/**
+				 * Checks if the specific style can be compressed in other words if all border-width are equal.
+				 */
+				function canCompress(key) {
+					var value = styles[key], i;
+
+					if (!value) {
+						return;
+					}
+
+					value = value.split(' ');
+					i = value.length;
+					while (i--) {
+						if (value[i] !== value[0]) {
+							return false;
+						}
+					}
+
+					styles[key] = value[0];
+
+					return true;
+				}
+
+				/**
+				 * Compresses multiple styles into one style.
+				 */
+				function compress2(target, a, b, c) {
+					if (!canCompress(a)) {
+						return;
+					}
+
+					if (!canCompress(b)) {
+						return;
+					}
+
+					if (!canCompress(c)) {
+						return;
+					}
+
+					// Compress
+					styles[target] = styles[a] + ' ' + styles[b] + ' ' + styles[c];
+					delete styles[a];
+					delete styles[b];
+					delete styles[c];
+				}
+
+				// Encodes the specified string by replacing all \" \' ; : with _<num>
+				function encode(str) {
+					isEncoded = true;
+
+					return encodingLookup[str];
+				}
+
+				// Decodes the specified string by replacing all _<num> with it's original value \" \' etc
+				// It will also decode the \" \' if keep_slashes is set to fale or omitted
+				function decode(str, keep_slashes) {
+					if (isEncoded) {
+						str = str.replace(/\uFEFF[0-9]/g, function(str) {
+							return encodingLookup[str];
+						});
+					}
+
+					if (!keep_slashes) {
+						str = str.replace(/\\([\'\";:])/g, "$1");
+					}
+
+					return str;
+				}
+
+				function processUrl(match, url, url2, url3, str, str2) {
+					str = str || str2;
+
+					if (str) {
+						str = decode(str);
+
+						// Force strings into single quote format
+						return "'" + str.replace(/\'/g, "\\'") + "'";
+					}
+
+					url = decode(url || url2 || url3);
+
+					if (!settings.allow_script_urls) {
+						var scriptUrl = url.replace(/[\s\r\n]+/, '');
+
+						if (/(java|vb)script:/i.test(scriptUrl)) {
+							return "";
+						}
+
+						if (!settings.allow_svg_data_urls && /^data:image\/svg/i.test(scriptUrl)) {
+							return "";
+						}
+					}
+
+					// Convert the URL to relative/absolute depending on config
+					if (urlConverter) {
+						url = urlConverter.call(urlConverterScope, url, 'style');
+					}
+
+					// Output new URL format
+					return "url('" + url.replace(/\'/g, "\\'") + "')";
+				}
+
+				if (css) {
+					css = css.replace(/[\u0000-\u001F]/g, '');
+
+					// Encode \" \' % and ; and : inside strings so they don't interfere with the style parsing
+					css = css.replace(/\\[\"\';:\uFEFF]/g, encode).replace(/\"[^\"]+\"|\'[^\']+\'/g, function(str) {
+						return str.replace(/[;:]/g, encode);
+					});
+
+					// Parse styles
+					while ((matches = styleRegExp.exec(css))) {
+						name = matches[1].replace(trimRightRegExp, '').toLowerCase();
+						value = matches[2].replace(trimRightRegExp, '');
+
+						// Decode escaped sequences like \65 -> e
+						/*jshint loopfunc:true*/
+						/*eslint no-loop-func:0 */
+						value = value.replace(/\\[0-9a-f]+/g, function(e) {
+							return String.fromCharCode(parseInt(e.substr(1), 16));
+						});
+
+						if (name && value.length > 0) {
+							// Don't allow behavior name or expression/comments within the values
+							if (!settings.allow_script_urls && (name == "behavior" || /expression\s*\(|\/\*|\*\//.test(value))) {
+								continue;
+							}
+
+							// Opera will produce 700 instead of bold in their style values
+							if (name === 'font-weight' && value === '700') {
+								value = 'bold';
+							} else if (name === 'color' || name === 'background-color') { // Lowercase colors like RED
+								value = value.toLowerCase();
+							}
+
+							// Convert RGB colors to HEX
+							value = value.replace(rgbRegExp, toHex);
+
+							// Convert URLs and force them into url('value') format
+							value = value.replace(urlOrStrRegExp, processUrl);
+							styles[name] = isEncoded ? decode(value, true) : value;
+						}
+
+						styleRegExp.lastIndex = matches.index + matches[0].length;
+					}
+					// Compress the styles to reduce it's size for example IE will expand styles
+					compress("border", "", true);
+					compress("border", "-width");
+					compress("border", "-color");
+					compress("border", "-style");
+					compress("padding", "");
+					compress("margin", "");
+					compress2('border', 'border-width', 'border-style', 'border-color');
+
+					// Remove pointless border, IE produces these
+					if (styles.border === 'medium none') {
+						delete styles.border;
+					}
+
+					// IE 11 will produce a border-image: none when getting the style attribute from <p style="border: 1px solid red"></p>
+					// So lets asume it shouldn't be there
+					if (styles['border-image'] === 'none') {
+						delete styles['border-image'];
+					}
+				}
+
+				return styles;
+			},
+
+			/**
+			 * Serializes the specified style object into a string.
+			 *
+			 * @method serialize
+			 * @param {Object} styles Object to serialize as string for example: {border: '1px solid red'}
+			 * @param {String} elementName Optional element name, if specified only the styles that matches the schema will be serialized.
+			 * @return {String} String representation of the style object for example: border: 1px solid red.
+			 */
+			serialize: function(styles, elementName) {
+				var css = '', name, value;
+
+				function serializeStyles(name) {
+					var styleList, i, l, value;
+
+					styleList = validStyles[name];
+					if (styleList) {
+						for (i = 0, l = styleList.length; i < l; i++) {
+							name = styleList[i];
+							value = styles[name];
+
+							if (value !== undef && value.length > 0) {
+								css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';';
+							}
+						}
+					}
+				}
+
+				function isValid(name, elementName) {
+					var styleMap;
+
+					styleMap = invalidStyles['*'];
+					if (styleMap && styleMap[name]) {
+						return false;
+					}
+
+					styleMap = invalidStyles[elementName];
+					if (styleMap && styleMap[name]) {
+						return false;
+					}
+
+					return true;
+				}
+
+				// Serialize styles according to schema
+				if (elementName && validStyles) {
+					// Serialize global styles and element specific styles
+					serializeStyles('*');
+					serializeStyles(elementName);
+				} else {
+					// Output the styles in the order they are inside the object
+					for (name in styles) {
+						value = styles[name];
+
+						if (value !== undef && value.length > 0) {
+							if (!invalidStyles || isValid(name, elementName)) {
+								css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';';
+							}
+						}
+					}
+				}
+
+				return css;
+			}
+		};
+	};
+});
+
+// Included from: js/tinymce/classes/dom/TreeWalker.js
+
+/**
+ * TreeWalker.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * TreeWalker class enables you to walk the DOM in a linear manner.
+ *
+ * @class tinymce.dom.TreeWalker
+ * @example
+ * var walker = new tinymce.dom.TreeWalker(startNode);
+ *
+ * do {
+ *     console.log(walker.current());
+ * } while (walker.next());
+ */
+define("tinymce/dom/TreeWalker", [], function() {
+	/**
+	 * Constructs a new TreeWalker instance.
+	 *
+	 * @constructor
+	 * @method TreeWalker
+	 * @param {Node} startNode Node to start walking from.
+	 * @param {node} rootNode Optional root node to never walk out of.
+	 */
+	return function(startNode, rootNode) {
+		var node = startNode;
+
+		function findSibling(node, startName, siblingName, shallow) {
+			var sibling, parent;
+
+			if (node) {
+				// Walk into nodes if it has a start
+				if (!shallow && node[startName]) {
+					return node[startName];
+				}
+
+				// Return the sibling if it has one
+				if (node != rootNode) {
+					sibling = node[siblingName];
+					if (sibling) {
+						return sibling;
+					}
+
+					// Walk up the parents to look for siblings
+					for (parent = node.parentNode; parent && parent != rootNode; parent = parent.parentNode) {
+						sibling = parent[siblingName];
+						if (sibling) {
+							return sibling;
+						}
+					}
+				}
+			}
+		}
+
+		/**
+		 * Returns the current node.
+		 *
+		 * @method current
+		 * @return {Node} Current node where the walker is.
+		 */
+		this.current = function() {
+			return node;
+		};
+
+		/**
+		 * Walks to the next node in tree.
+		 *
+		 * @method next
+		 * @return {Node} Current node where the walker is after moving to the next node.
+		 */
+		this.next = function(shallow) {
+			node = findSibling(node, 'firstChild', 'nextSibling', shallow);
+			return node;
+		};
+
+		/**
+		 * Walks to the previous node in tree.
+		 *
+		 * @method prev
+		 * @return {Node} Current node where the walker is after moving to the previous node.
+		 */
+		this.prev = function(shallow) {
+			node = findSibling(node, 'lastChild', 'previousSibling', shallow);
+			return node;
+		};
+	};
+});
+
+// Included from: js/tinymce/classes/dom/Range.js
+
+/**
+ * Range.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+define("tinymce/dom/Range", [
+	"tinymce/util/Tools"
+], function(Tools) {
+	// Range constructor
+	function Range(dom) {
+		var self = this,
+			doc = dom.doc,
+			EXTRACT = 0,
+			CLONE = 1,
+			DELETE = 2,
+			TRUE = true,
+			FALSE = false,
+			START_OFFSET = 'startOffset',
+			START_CONTAINER = 'startContainer',
+			END_CONTAINER = 'endContainer',
+			END_OFFSET = 'endOffset',
+			extend = Tools.extend,
+			nodeIndex = dom.nodeIndex;
+
+		function createDocumentFragment() {
+			return doc.createDocumentFragment();
+		}
+
+		function setStart(n, o) {
+			_setEndPoint(TRUE, n, o);
+		}
+
+		function setEnd(n, o) {
+			_setEndPoint(FALSE, n, o);
+		}
+
+		function setStartBefore(n) {
+			setStart(n.parentNode, nodeIndex(n));
+		}
+
+		function setStartAfter(n) {
+			setStart(n.parentNode, nodeIndex(n) + 1);
+		}
+
+		function setEndBefore(n) {
+			setEnd(n.parentNode, nodeIndex(n));
+		}
+
+		function setEndAfter(n) {
+			setEnd(n.parentNode, nodeIndex(n) + 1);
+		}
+
+		function collapse(ts) {
+			if (ts) {
+				self[END_CONTAINER] = self[START_CONTAINER];
+				self[END_OFFSET] = self[START_OFFSET];
+			} else {
+				self[START_CONTAINER] = self[END_CONTAINER];
+				self[START_OFFSET] = self[END_OFFSET];
+			}
+
+			self.collapsed = TRUE;
+		}
+
+		function selectNode(n) {
+			setStartBefore(n);
+			setEndAfter(n);
+		}
+
+		function selectNodeContents(n) {
+			setStart(n, 0);
+			setEnd(n, n.nodeType === 1 ? n.childNodes.length : n.nodeValue.length);
+		}
+
+		function compareBoundaryPoints(h, r) {
+			var sc = self[START_CONTAINER], so = self[START_OFFSET], ec = self[END_CONTAINER], eo = self[END_OFFSET],
+			rsc = r.startContainer, rso = r.startOffset, rec = r.endContainer, reo = r.endOffset;
+
+			// Check START_TO_START
+			if (h === 0) {
+				return _compareBoundaryPoints(sc, so, rsc, rso);
+			}
+
+			// Check START_TO_END
+			if (h === 1) {
+				return _compareBoundaryPoints(ec, eo, rsc, rso);
+			}
+
+			// Check END_TO_END
+			if (h === 2) {
+				return _compareBoundaryPoints(ec, eo, rec, reo);
+			}
+
+			// Check END_TO_START
+			if (h === 3) {
+				return _compareBoundaryPoints(sc, so, rec, reo);
+			}
+		}
+
+		function deleteContents() {
+			_traverse(DELETE);
+		}
+
+		function extractContents() {
+			return _traverse(EXTRACT);
+		}
+
+		function cloneContents() {
+			return _traverse(CLONE);
+		}
+
+		function insertNode(n) {
+			var startContainer = this[START_CONTAINER],
+				startOffset = this[START_OFFSET], nn, o;
+
+			// Node is TEXT_NODE or CDATA
+			if ((startContainer.nodeType === 3 || startContainer.nodeType === 4) && startContainer.nodeValue) {
+				if (!startOffset) {
+					// At the start of text
+					startContainer.parentNode.insertBefore(n, startContainer);
+				} else if (startOffset >= startContainer.nodeValue.length) {
+					// At the end of text
+					dom.insertAfter(n, startContainer);
+				} else {
+					// Middle, need to split
+					nn = startContainer.splitText(startOffset);
+					startContainer.parentNode.insertBefore(n, nn);
+				}
+			} else {
+				// Insert element node
+				if (startContainer.childNodes.length > 0) {
+					o = startContainer.childNodes[startOffset];
+				}
+
+				if (o) {
+					startContainer.insertBefore(n, o);
+				} else {
+					if (startContainer.nodeType == 3) {
+						dom.insertAfter(n, startContainer);
+					} else {
+						startContainer.appendChild(n);
+					}
+				}
+			}
+		}
+
+		function surroundContents(n) {
+			var f = self.extractContents();
+
+			self.insertNode(n);
+			n.appendChild(f);
+			self.selectNode(n);
+		}
+
+		function cloneRange() {
+			return extend(new Range(dom), {
+				startContainer: self[START_CONTAINER],
+				startOffset: self[START_OFFSET],
+				endContainer: self[END_CONTAINER],
+				endOffset: self[END_OFFSET],
+				collapsed: self.collapsed,
+				commonAncestorContainer: self.commonAncestorContainer
+			});
+		}
+
+		// Private methods
+
+		function _getSelectedNode(container, offset) {
+			var child;
+
+			if (container.nodeType == 3 /* TEXT_NODE */) {
+				return container;
+			}
+
+			if (offset < 0) {
+				return container;
+			}
+
+			child = container.firstChild;
+			while (child && offset > 0) {
+				--offset;
+				child = child.nextSibling;
+			}
+
+			if (child) {
+				return child;
+			}
+
+			return container;
+		}
+
+		function _isCollapsed() {
+			return (self[START_CONTAINER] == self[END_CONTAINER] && self[START_OFFSET] == self[END_OFFSET]);
+		}
+
+		function _compareBoundaryPoints(containerA, offsetA, containerB, offsetB) {
+			var c, offsetC, n, cmnRoot, childA, childB;
+
+			// In the first case the boundary-points have the same container. A is before B
+			// if its offset is less than the offset of B, A is equal to B if its offset is
+			// equal to the offset of B, and A is after B if its offset is greater than the
+			// offset of B.
+			if (containerA == containerB) {
+				if (offsetA == offsetB) {
+					return 0; // equal
+				}
+
+				if (offsetA < offsetB) {
+					return -1; // before
+				}
+
+				return 1; // after
+			}
+
+			// In the second case a child node C of the container of A is an ancestor
+			// container of B. In this case, A is before B if the offset of A is less than or
+			// equal to the index of the child node C and A is after B otherwise.
+			c = containerB;
+			while (c && c.parentNode != containerA) {
+				c = c.parentNode;
+			}
+
+			if (c) {
+				offsetC = 0;
+				n = containerA.firstChild;
+
+				while (n != c && offsetC < offsetA) {
+					offsetC++;
+					n = n.nextSibling;
+				}
+
+				if (offsetA <= offsetC) {
+					return -1; // before
+				}
+
+				return 1; // after
+			}
+
+			// In the third case a child node C of the container of B is an ancestor container
+			// of A. In this case, A is before B if the index of the child node C is less than
+			// the offset of B and A is after B otherwise.
+			c = containerA;
+			while (c && c.parentNode != containerB) {
+				c = c.parentNode;
+			}
+
+			if (c) {
+				offsetC = 0;
+				n = containerB.firstChild;
+
+				while (n != c && offsetC < offsetB) {
+					offsetC++;
+					n = n.nextSibling;
+				}
+
+				if (offsetC < offsetB) {
+					return -1; // before
+				}
+
+				return 1; // after
+			}
+
+			// In the fourth case, none of three other cases hold: the containers of A and B
+			// are siblings or descendants of sibling nodes. In this case, A is before B if
+			// the container of A is before the container of B in a pre-order traversal of the
+			// Ranges' context tree and A is after B otherwise.
+			cmnRoot = dom.findCommonAncestor(containerA, containerB);
+			childA = containerA;
+
+			while (childA && childA.parentNode != cmnRoot) {
+				childA = childA.parentNode;
+			}
+
+			if (!childA) {
+				childA = cmnRoot;
+			}
+
+			childB = containerB;
+			while (childB && childB.parentNode != cmnRoot) {
+				childB = childB.parentNode;
+			}
+
+			if (!childB) {
+				childB = cmnRoot;
+			}
+
+			if (childA == childB) {
+				return 0; // equal
+			}
+
+			n = cmnRoot.firstChild;
+			while (n) {
+				if (n == childA) {
+					return -1; // before
+				}
+
+				if (n == childB) {
+					return 1; // after
+				}
+
+				n = n.nextSibling;
+			}
+		}
+
+		function _setEndPoint(st, n, o) {
+			var ec, sc;
+
+			if (st) {
+				self[START_CONTAINER] = n;
+				self[START_OFFSET] = o;
+			} else {
+				self[END_CONTAINER] = n;
+				self[END_OFFSET] = o;
+			}
+
+			// If one boundary-point of a Range is set to have a root container
+			// other than the current one for the Range, the Range is collapsed to
+			// the new position. This enforces the restriction that both boundary-
+			// points of a Range must have the same root container.
+			ec = self[END_CONTAINER];
+			while (ec.parentNode) {
+				ec = ec.parentNode;
+			}
+
+			sc = self[START_CONTAINER];
+			while (sc.parentNode) {
+				sc = sc.parentNode;
+			}
+
+			if (sc == ec) {
+				// The start position of a Range is guaranteed to never be after the
+				// end position. To enforce this restriction, if the start is set to
+				// be at a position after the end, the Range is collapsed to that
+				// position.
+				if (_compareBoundaryPoints(self[START_CONTAINER], self[START_OFFSET], self[END_CONTAINER], self[END_OFFSET]) > 0) {
+					self.collapse(st);
+				}
+			} else {
+				self.collapse(st);
+			}
+
+			self.collapsed = _isCollapsed();
+			self.commonAncestorContainer = dom.findCommonAncestor(self[START_CONTAINER], self[END_CONTAINER]);
+		}
+
+		function _traverse(how) {
+			var c, endContainerDepth = 0, startContainerDepth = 0, p, depthDiff, startNode, endNode, sp, ep;
+
+			if (self[START_CONTAINER] == self[END_CONTAINER]) {
+				return _traverseSameContainer(how);
+			}
+
+			for (c = self[END_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) {
+				if (p == self[START_CONTAINER]) {
+					return _traverseCommonStartContainer(c, how);
+				}
+
+				++endContainerDepth;
+			}
+
+			for (c = self[START_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) {
+				if (p == self[END_CONTAINER]) {
+					return _traverseCommonEndContainer(c, how);
+				}
+
+				++startContainerDepth;
+			}
+
+			depthDiff = startContainerDepth - endContainerDepth;
+
+			startNode = self[START_CONTAINER];
+			while (depthDiff > 0) {
+				startNode = startNode.parentNode;
+				depthDiff--;
+			}
+
+			endNode = self[END_CONTAINER];
+			while (depthDiff < 0) {
+				endNode = endNode.parentNode;
+				depthDiff++;
+			}
+
+			// ascend the ancestor hierarchy until we have a common parent.
+			for (sp = startNode.parentNode, ep = endNode.parentNode; sp != ep; sp = sp.parentNode, ep = ep.parentNode) {
+				startNode = sp;
+				endNode = ep;
+			}
+
+			return _traverseCommonAncestors(startNode, endNode, how);
+		}
+
+		function _traverseSameContainer(how) {
+			var frag, s, sub, n, cnt, sibling, xferNode, start, len;
+
+			if (how != DELETE) {
+				frag = createDocumentFragment();
+			}
+
+			// If selection is empty, just return the fragment
+			if (self[START_OFFSET] == self[END_OFFSET]) {
+				return frag;
+			}
+
+			// Text node needs special case handling
+			if (self[START_CONTAINER].nodeType == 3 /* TEXT_NODE */) {
+				// get the substring
+				s = self[START_CONTAINER].nodeValue;
+				sub = s.substring(self[START_OFFSET], self[END_OFFSET]);
+
+				// set the original text node to its new value
+				if (how != CLONE) {
+					n = self[START_CONTAINER];
+					start = self[START_OFFSET];
+					len = self[END_OFFSET] - self[START_OFFSET];
+
+					if (start === 0 && len >= n.nodeValue.length - 1) {
+						n.parentNode.removeChild(n);
+					} else {
+						n.deleteData(start, len);
+					}
+
+					// Nothing is partially selected, so collapse to start point
+					self.collapse(TRUE);
+				}
+
+				if (how == DELETE) {
+					return;
+				}
+
+				if (sub.length > 0) {
+					frag.appendChild(doc.createTextNode(sub));
+				}
+
+				return frag;
+			}
+
+			// Copy nodes between the start/end offsets.
+			n = _getSelectedNode(self[START_CONTAINER], self[START_OFFSET]);
+			cnt = self[END_OFFSET] - self[START_OFFSET];
+
+			while (n && cnt > 0) {
+				sibling = n.nextSibling;
+				xferNode = _traverseFullySelected(n, how);
+
+				if (frag) {
+					frag.appendChild(xferNode);
+				}
+
+				--cnt;
+				n = sibling;
+			}
+
+			// Nothing is partially selected, so collapse to start point
+			if (how != CLONE) {
+				self.collapse(TRUE);
+			}
+
+			return frag;
+		}
+
+		function _traverseCommonStartContainer(endAncestor, how) {
+			var frag, n, endIdx, cnt, sibling, xferNode;
+
+			if (how != DELETE) {
+				frag = createDocumentFragment();
+			}
+
+			n = _traverseRightBoundary(endAncestor, how);
+
+			if (frag) {
+				frag.appendChild(n);
+			}
+
+			endIdx = nodeIndex(endAncestor);
+			cnt = endIdx - self[START_OFFSET];
+
+			if (cnt <= 0) {
+				// Collapse to just before the endAncestor, which
+				// is partially selected.
+				if (how != CLONE) {
+					self.setEndBefore(endAncestor);
+					self.collapse(FALSE);
+				}
+
+				return frag;
+			}
+
+			n = endAncestor.previousSibling;
+			while (cnt > 0) {
+				sibling = n.previousSibling;
+				xferNode = _traverseFullySelected(n, how);
+
+				if (frag) {
+					frag.insertBefore(xferNode, frag.firstChild);
+				}
+
+				--cnt;
+				n = sibling;
+			}
+
+			// Collapse to just before the endAncestor, which
+			// is partially selected.
+			if (how != CLONE) {
+				self.setEndBefore(endAncestor);
+				self.collapse(FALSE);
+			}
+
+			return frag;
+		}
+
+		function _traverseCommonEndContainer(startAncestor, how) {
+			var frag, startIdx, n, cnt, sibling, xferNode;
+
+			if (how != DELETE) {
+				frag = createDocumentFragment();
+			}
+
+			n = _traverseLeftBoundary(startAncestor, how);
+			if (frag) {
+				frag.appendChild(n);
+			}
+
+			startIdx = nodeIndex(startAncestor);
+			++startIdx; // Because we already traversed it
+
+			cnt = self[END_OFFSET] - startIdx;
+			n = startAncestor.nextSibling;
+			while (n && cnt > 0) {
+				sibling = n.nextSibling;
+				xferNode = _traverseFullySelected(n, how);
+
+				if (frag) {
+					frag.appendChild(xferNode);
+				}
+
+				--cnt;
+				n = sibling;
+			}
+
+			if (how != CLONE) {
+				self.setStartAfter(startAncestor);
+				self.collapse(TRUE);
+			}
+
+			return frag;
+		}
+
+		function _traverseCommonAncestors(startAncestor, endAncestor, how) {
+			var n, frag, startOffset, endOffset, cnt, sibling, nextSibling;
+
+			if (how != DELETE) {
+				frag = createDocumentFragment();
+			}
+
+			n = _traverseLeftBoundary(startAncestor, how);
+			if (frag) {
+				frag.appendChild(n);
+			}
+
+			startOffset = nodeIndex(startAncestor);
+			endOffset = nodeIndex(endAncestor);
+			++startOffset;
+
+			cnt = endOffset - startOffset;
+			sibling = startAncestor.nextSibling;
+
+			while (cnt > 0) {
+				nextSibling = sibling.nextSibling;
+				n = _traverseFullySelected(sibling, how);
+
+				if (frag) {
+					frag.appendChild(n);
+				}
+
+				sibling = nextSibling;
+				--cnt;
+			}
+
+			n = _traverseRightBoundary(endAncestor, how);
+
+			if (frag) {
+				frag.appendChild(n);
+			}
+
+			if (how != CLONE) {
+				self.setStartAfter(startAncestor);
+				self.collapse(TRUE);
+			}
+
+			return frag;
+		}
+
+		function _traverseRightBoundary(root, how) {
+			var next = _getSelectedNode(self[END_CONTAINER], self[END_OFFSET] - 1), parent, clonedParent;
+			var prevSibling, clonedChild, clonedGrandParent, isFullySelected = next != self[END_CONTAINER];
+
+			if (next == root) {
+				return _traverseNode(next, isFullySelected, FALSE, how);
+			}
+
+			parent = next.parentNode;
+			clonedParent = _traverseNode(parent, FALSE, FALSE, how);
+
+			while (parent) {
+				while (next) {
+					prevSibling = next.previousSibling;
+					clonedChild = _traverseNode(next, isFullySelected, FALSE, how);
+
+					if (how != DELETE) {
+						clonedParent.insertBefore(clonedChild, clonedParent.firstChild);
+					}
+
+					isFullySelected = TRUE;
+					next = prevSibling;
+				}
+
+				if (parent == root) {
+					return clonedParent;
+				}
+
+				next = parent.previousSibling;
+				parent = parent.parentNode;
+
+				clonedGrandParent = _traverseNode(parent, FALSE, FALSE, how);
+
+				if (how != DELETE) {
+					clonedGrandParent.appendChild(clonedParent);
+				}
+
+				clonedParent = clonedGrandParent;
+			}
+		}
+
+		function _traverseLeftBoundary(root, how) {
+			var next = _getSelectedNode(self[START_CONTAINER], self[START_OFFSET]), isFullySelected = next != self[START_CONTAINER];
+			var parent, clonedParent, nextSibling, clonedChild, clonedGrandParent;
+
+			if (next == root) {
+				return _traverseNode(next, isFullySelected, TRUE, how);
+			}
+
+			parent = next.parentNode;
+			clonedParent = _traverseNode(parent, FALSE, TRUE, how);
+
+			while (parent) {
+				while (next) {
+					nextSibling = next.nextSibling;
+					clonedChild = _traverseNode(next, isFullySelected, TRUE, how);
+
+					if (how != DELETE) {
+						clonedParent.appendChild(clonedChild);
+					}
+
+					isFullySelected = TRUE;
+					next = nextSibling;
+				}
+
+				if (parent == root) {
+					return clonedParent;
+				}
+
+				next = parent.nextSibling;
+				parent = parent.parentNode;
+
+				clonedGrandParent = _traverseNode(parent, FALSE, TRUE, how);
+
+				if (how != DELETE) {
+					clonedGrandParent.appendChild(clonedParent);
+				}
+
+				clonedParent = clonedGrandParent;
+			}
+		}
+
+		function _traverseNode(n, isFullySelected, isLeft, how) {
+			var txtValue, newNodeValue, oldNodeValue, offset, newNode;
+
+			if (isFullySelected) {
+				return _traverseFullySelected(n, how);
+			}
+
+			if (n.nodeType == 3 /* TEXT_NODE */) {
+				txtValue = n.nodeValue;
+
+				if (isLeft) {
+					offset = self[START_OFFSET];
+					newNodeValue = txtValue.substring(offset);
+					oldNodeValue = txtValue.substring(0, offset);
+				} else {
+					offset = self[END_OFFSET];
+					newNodeValue = txtValue.substring(0, offset);
+					oldNodeValue = txtValue.substring(offset);
+				}
+
+				if (how != CLONE) {
+					n.nodeValue = oldNodeValue;
+				}
+
+				if (how == DELETE) {
+					return;
+				}
+
+				newNode = dom.clone(n, FALSE);
+				newNode.nodeValue = newNodeValue;
+
+				return newNode;
+			}
+
+			if (how == DELETE) {
+				return;
+			}
+
+			return dom.clone(n, FALSE);
+		}
+
+		function _traverseFullySelected(n, how) {
+			if (how != DELETE) {
+				return how == CLONE ? dom.clone(n, TRUE) : n;
+			}
+
+			n.parentNode.removeChild(n);
+		}
+
+		function toStringIE() {
+			return dom.create('body', null, cloneContents()).outerText;
+		}
+
+		extend(self, {
+			// Inital states
+			startContainer: doc,
+			startOffset: 0,
+			endContainer: doc,
+			endOffset: 0,
+			collapsed: TRUE,
+			commonAncestorContainer: doc,
+
+			// Range constants
+			START_TO_START: 0,
+			START_TO_END: 1,
+			END_TO_END: 2,
+			END_TO_START: 3,
+
+			// Public methods
+			setStart: setStart,
+			setEnd: setEnd,
+			setStartBefore: setStartBefore,
+			setStartAfter: setStartAfter,
+			setEndBefore: setEndBefore,
+			setEndAfter: setEndAfter,
+			collapse: collapse,
+			selectNode: selectNode,
+			selectNodeContents: selectNodeContents,
+			compareBoundaryPoints: compareBoundaryPoints,
+			deleteContents: deleteContents,
+			extractContents: extractContents,
+			cloneContents: cloneContents,
+			insertNode: insertNode,
+			surroundContents: surroundContents,
+			cloneRange: cloneRange,
+			toStringIE: toStringIE
+		});
+
+		return self;
+	}
+
+	// Older IE versions doesn't let you override toString by it's constructor so we have to stick it in the prototype
+	Range.prototype.toString = function() {
+		return this.toStringIE();
+	};
+
+	return Range;
+});
+
+// Included from: js/tinymce/classes/html/Entities.js
+
+/**
+ * Entities.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*jshint bitwise:false */
+/*eslint no-bitwise:0 */
+
+/**
+ * Entity encoder class.
+ *
+ * @class tinymce.html.Entities
+ * @static
+ * @version 3.4
+ */
+define("tinymce/html/Entities", [
+	"tinymce/util/Tools"
+], function(Tools) {
+	var makeMap = Tools.makeMap;
+
+	var namedEntities, baseEntities, reverseEntities,
+		attrsCharsRegExp = /[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
+		textCharsRegExp = /[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
+		rawCharsRegExp = /[<>&\"\']/g,
+		entityRegExp = /&#([a-z0-9]+);?|&([a-z0-9]+);/gi,
+		asciiMap = {
+			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"
+		};
+
+	// Raw entities
+	baseEntities = {
+		'\"': '&quot;', // Needs to be escaped since the YUI compressor would otherwise break the code
+		"'": '&#39;',
+		'<': '&lt;',
+		'>': '&gt;',
+		'&': '&amp;',
+		'\u0060': '&#96;'
+	};
+
+	// Reverse lookup table for raw entities
+	reverseEntities = {
+		'&lt;': '<',
+		'&gt;': '>',
+		'&amp;': '&',
+		'&quot;': '"',
+		'&apos;': "'"
+	};
+
+	// Decodes text by using the browser
+	function nativeDecode(text) {
+		var elm;
+
+		elm = document.createElement("div");
+		elm.innerHTML = text;
+
+		return elm.textContent || elm.innerText || text;
+	}
+
+	// Build a two way lookup table for the entities
+	function buildEntitiesLookup(items, radix) {
+		var i, chr, entity, lookup = {};
+
+		if (items) {
+			items = items.split(',');
+			radix = radix || 10;
+
+			// Build entities lookup table
+			for (i = 0; i < items.length; i += 2) {
+				chr = String.fromCharCode(parseInt(items[i], radix));
+
+				// Only add non base entities
+				if (!baseEntities[chr]) {
+					entity = '&' + items[i + 1] + ';';
+					lookup[chr] = entity;
+					lookup[entity] = chr;
+				}
+			}
+
+			return lookup;
+		}
+	}
+
+	// Unpack entities lookup where the numbers are in radix 32 to reduce the size
+	namedEntities = buildEntitiesLookup(
+		'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 Entities = {
+		/**
+		 * Encodes the specified string using raw entities. This means only the required XML base entities will be endoded.
+		 *
+		 * @method encodeRaw
+		 * @param {String} text Text to encode.
+		 * @param {Boolean} attr Optional flag to specify if the text is attribute contents.
+		 * @return {String} Entity encoded text.
+		 */
+		encodeRaw: function(text, attr) {
+			return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) {
+				return baseEntities[chr] || chr;
+			});
+		},
+
+		/**
+		 * Encoded the specified text with both the attributes and text entities. This function will produce larger text contents
+		 * since it doesn't know if the context is within a attribute or text node. This was added for compatibility
+		 * and is exposed as the DOMUtils.encode function.
+		 *
+		 * @method encodeAllRaw
+		 * @param {String} text Text to encode.
+		 * @return {String} Entity encoded text.
+		 */
+		encodeAllRaw: function(text) {
+			return ('' + text).replace(rawCharsRegExp, function(chr) {
+				return baseEntities[chr] || chr;
+			});
+		},
+
+		/**
+		 * Encodes the specified string using numeric entities. The core entities will be
+		 * encoded as named ones but all non lower ascii characters will be encoded into numeric entities.
+		 *
+		 * @method encodeNumeric
+		 * @param {String} text Text to encode.
+		 * @param {Boolean} attr Optional flag to specify if the text is attribute contents.
+		 * @return {String} Entity encoded text.
+		 */
+		encodeNumeric: function(text, attr) {
+			return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) {
+				// Multi byte sequence convert it to a single entity
+				if (chr.length > 1) {
+					return '&#' + (((chr.charCodeAt(0) - 0xD800) * 0x400) + (chr.charCodeAt(1) - 0xDC00) + 0x10000) + ';';
+				}
+
+				return baseEntities[chr] || '&#' + chr.charCodeAt(0) + ';';
+			});
+		},
+
+		/**
+		 * Encodes the specified string using named entities. The core entities will be encoded
+		 * as named ones but all non lower ascii characters will be encoded into named entities.
+		 *
+		 * @method encodeNamed
+		 * @param {String} text Text to encode.
+		 * @param {Boolean} attr Optional flag to specify if the text is attribute contents.
+		 * @param {Object} entities Optional parameter with entities to use.
+		 * @return {String} Entity encoded text.
+		 */
+		encodeNamed: function(text, attr, entities) {
+			entities = entities || namedEntities;
+
+			return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) {
+				return baseEntities[chr] || entities[chr] || chr;
+			});
+		},
+
+		/**
+		 * Returns an encode function based on the name(s) and it's optional entities.
+		 *
+		 * @method getEncodeFunc
+		 * @param {String} name Comma separated list of encoders for example named,numeric.
+		 * @param {String} entities Optional parameter with entities to use instead of the built in set.
+		 * @return {function} Encode function to be used.
+		 */
+		getEncodeFunc: function(name, entities) {
+			entities = buildEntitiesLookup(entities) || namedEntities;
+
+			function encodeNamedAndNumeric(text, attr) {
+				return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) {
+					return baseEntities[chr] || entities[chr] || '&#' + chr.charCodeAt(0) + ';' || chr;
+				});
+			}
+
+			function encodeCustomNamed(text, attr) {
+				return Entities.encodeNamed(text, attr, entities);
+			}
+
+			// Replace + with , to be compatible with previous TinyMCE versions
+			name = makeMap(name.replace(/\+/g, ','));
+
+			// Named and numeric encoder
+			if (name.named && name.numeric) {
+				return encodeNamedAndNumeric;
+			}
+
+			// Named encoder
+			if (name.named) {
+				// Custom names
+				if (entities) {
+					return encodeCustomNamed;
+				}
+
+				return Entities.encodeNamed;
+			}
+
+			// Numeric
+			if (name.numeric) {
+				return Entities.encodeNumeric;
+			}
+
+			// Raw encoder
+			return Entities.encodeRaw;
+		},
+
+		/**
+		 * Decodes the specified string, this will replace entities with raw UTF characters.
+		 *
+		 * @method decode
+		 * @param {String} text Text to entity decode.
+		 * @return {String} Entity decoded string.
+		 */
+		decode: function(text) {
+			return text.replace(entityRegExp, function(all, numeric) {
+				if (numeric) {
+					if (numeric.charAt(0).toLowerCase() === 'x') {
+						numeric = parseInt(numeric.substr(1), 16);
+					} else {
+						numeric = parseInt(numeric, 10);
+					}
+
+					// Support upper UTF
+					if (numeric > 0xFFFF) {
+						numeric -= 0x10000;
+
+						return String.fromCharCode(0xD800 + (numeric >> 10), 0xDC00 + (numeric & 0x3FF));
+					} else {
+						return asciiMap[numeric] || String.fromCharCode(numeric);
+					}
+				}
+
+				return reverseEntities[all] || namedEntities[all] || nativeDecode(all);
+			});
+		}
+	};
+
+	return Entities;
+});
+
+// Included from: js/tinymce/classes/dom/StyleSheetLoader.js
+
+/**
+ * StyleSheetLoader.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles loading of external stylesheets and fires events when these are loaded.
+ *
+ * @class tinymce.dom.StyleSheetLoader
+ * @private
+ */
+define("tinymce/dom/StyleSheetLoader", [
+	"tinymce/util/Tools"
+], function(Tools) {
+	"use strict";
+
+	return function(document, settings) {
+		var idCount = 0, loadedStates = {}, maxLoadTime;
+
+		settings = settings || {};
+		maxLoadTime = settings.maxLoadTime || 5000;
+
+		function appendToHead(node) {
+			document.getElementsByTagName('head')[0].appendChild(node);
+		}
+
+		/**
+		 * Loads the specified css style sheet file and call the loadedCallback once it's finished loading.
+		 *
+		 * @method load
+		 * @param {String} url Url to be loaded.
+		 * @param {Function} loadedCallback Callback to be executed when loaded.
+		 * @param {Function} errorCallback Callback to be executed when failed loading.
+		 */
+		function load(url, loadedCallback, errorCallback) {
+			var link, style, startTime, state;
+
+			function passed() {
+				var callbacks = state.passed, i = callbacks.length;
+
+				while (i--) {
+					callbacks[i]();
+				}
+
+				state.status = 2;
+				state.passed = [];
+				state.failed = [];
+			}
+
+			function failed() {
+				var callbacks = state.failed, i = callbacks.length;
+
+				while (i--) {
+					callbacks[i]();
+				}
+
+				state.status = 3;
+				state.passed = [];
+				state.failed = [];
+			}
+
+			// Sniffs for older WebKit versions that have the link.onload but a broken one
+			function isOldWebKit() {
+				var webKitChunks = navigator.userAgent.match(/WebKit\/(\d*)/);
+				return !!(webKitChunks && webKitChunks[1] < 536);
+			}
+
+			// Calls the waitCallback until the test returns true or the timeout occurs
+			function wait(testCallback, waitCallback) {
+				if (!testCallback()) {
+					// Wait for timeout
+					if ((new Date().getTime()) - startTime < maxLoadTime) {
+						window.setTimeout(waitCallback, 0);
+					} else {
+						failed();
+					}
+				}
+			}
+
+			// Workaround for WebKit that doesn't properly support the onload event for link elements
+			// Or WebKit that fires the onload event before the StyleSheet is added to the document
+			function waitForWebKitLinkLoaded() {
+				wait(function() {
+					var styleSheets = document.styleSheets, styleSheet, i = styleSheets.length, owner;
+
+					while (i--) {
+						styleSheet = styleSheets[i];
+						owner = styleSheet.ownerNode ? styleSheet.ownerNode : styleSheet.owningElement;
+						if (owner && owner.id === link.id) {
+							passed();
+							return true;
+						}
+					}
+				}, waitForWebKitLinkLoaded);
+			}
+
+			// Workaround for older Geckos that doesn't have any onload event for StyleSheets
+			function waitForGeckoLinkLoaded() {
+				wait(function() {
+					try {
+						// Accessing the cssRules will throw an exception until the CSS file is loaded
+						var cssRules = style.sheet.cssRules;
+						passed();
+						return !!cssRules;
+					} catch (ex) {
+						// Ignore
+					}
+				}, waitForGeckoLinkLoaded);
+			}
+
+			url = Tools._addCacheSuffix(url);
+
+			if (!loadedStates[url]) {
+				state = {
+					passed: [],
+					failed: []
+				};
+
+				loadedStates[url] = state;
+			} else {
+				state = loadedStates[url];
+			}
+
+			if (loadedCallback) {
+				state.passed.push(loadedCallback);
+			}
+
+			if (errorCallback) {
+				state.failed.push(errorCallback);
+			}
+
+			// Is loading wait for it to pass
+			if (state.status == 1) {
+				return;
+			}
+
+			// Has finished loading and was success
+			if (state.status == 2) {
+				passed();
+				return;
+			}
+
+			// Has finished loading and was a failure
+			if (state.status == 3) {
+				failed();
+				return;
+			}
+
+			// Start loading
+			state.status = 1;
+			link = document.createElement('link');
+			link.rel = 'stylesheet';
+			link.type = 'text/css';
+			link.id = 'u' + (idCount++);
+			link.async = false;
+			link.defer = false;
+			startTime = new Date().getTime();
+
+			// Feature detect onload on link element and sniff older webkits since it has an broken onload event
+			if ("onload" in link && !isOldWebKit()) {
+				link.onload = waitForWebKitLinkLoaded;
+				link.onerror = failed;
+			} else {
+				// Sniff for old Firefox that doesn't support the onload event on link elements
+				// TODO: Remove this in the future when everyone uses modern browsers
+				if (navigator.userAgent.indexOf("Firefox") > 0) {
+					style = document.createElement('style');
+					style.textContent = '@import "' + url + '"';
+					waitForGeckoLinkLoaded();
+					appendToHead(style);
+					return;
+				} else {
+					// Use the id owner on older webkits
+					waitForWebKitLinkLoaded();
+				}
+			}
+
+			appendToHead(link);
+			link.href = url;
+		}
+
+		this.load = load;
+	};
+});
+
+// Included from: js/tinymce/classes/dom/DOMUtils.js
+
+/**
+ * DOMUtils.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Utility class for various DOM manipulation and retrieval functions.
+ *
+ * @class tinymce.dom.DOMUtils
+ * @example
+ * // Add a class to an element by id in the page
+ * tinymce.DOM.addClass('someid', 'someclass');
+ *
+ * // Add a class to an element by id inside the editor
+ * tinymce.activeEditor.dom.addClass('someid', 'someclass');
+ */
+define("tinymce/dom/DOMUtils", [
+	"tinymce/dom/Sizzle",
+	"tinymce/dom/DomQuery",
+	"tinymce/html/Styles",
+	"tinymce/dom/EventUtils",
+	"tinymce/dom/TreeWalker",
+	"tinymce/dom/Range",
+	"tinymce/html/Entities",
+	"tinymce/Env",
+	"tinymce/util/Tools",
+	"tinymce/dom/StyleSheetLoader"
+], function(Sizzle, $, Styles, EventUtils, TreeWalker, Range, Entities, Env, Tools, StyleSheetLoader) {
+	// Shorten names
+	var each = Tools.each, is = Tools.is, grep = Tools.grep, trim = Tools.trim;
+	var isIE = Env.ie;
+	var simpleSelectorRe = /^([a-z0-9],?)+$/i;
+	var whiteSpaceRegExp = /^[ \t\r\n]*$/;
+
+	function setupAttrHooks(domUtils, settings) {
+		var attrHooks = {}, keepValues = settings.keep_values, keepUrlHook;
+
+		keepUrlHook = {
+			set: function($elm, value, name) {
+				if (settings.url_converter) {
+					value = settings.url_converter.call(settings.url_converter_scope || domUtils, value, name, $elm[0]);
+				}
+
+				$elm.attr('data-mce-' + name, value).attr(name, value);
+			},
+
+			get: function($elm, name) {
+				return $elm.attr('data-mce-' + name) || $elm.attr(name);
+			}
+		};
+
+		attrHooks = {
+			style: {
+				set: function($elm, value) {
+					if (value !== null && typeof value === 'object') {
+						$elm.css(value);
+						return;
+					}
+
+					if (keepValues) {
+						$elm.attr('data-mce-style', value);
+					}
+
+					$elm.attr('style', value);
+				},
+
+				get: function($elm) {
+					var value = $elm.attr('data-mce-style') || $elm.attr('style');
+
+					value = domUtils.serializeStyle(domUtils.parseStyle(value), $elm[0].nodeName);
+
+					return value;
+				}
+			}
+		};
+
+		if (keepValues) {
+			attrHooks.href = attrHooks.src = keepUrlHook;
+		}
+
+		return attrHooks;
+	}
+
+	/**
+	 * Constructs a new DOMUtils instance. Consult the Wiki for more details on settings etc for this class.
+	 *
+	 * @constructor
+	 * @method DOMUtils
+	 * @param {Document} d Document reference to bind the utility class to.
+	 * @param {settings} s Optional settings collection.
+	 */
+	function DOMUtils(doc, settings) {
+		var self = this, blockElementsMap;
+
+		self.doc = doc;
+		self.win = window;
+		self.files = {};
+		self.counter = 0;
+		self.stdMode = !isIE || doc.documentMode >= 8;
+		self.boxModel = !isIE || doc.compatMode == "CSS1Compat" || self.stdMode;
+		self.styleSheetLoader = new StyleSheetLoader(doc);
+		self.boundEvents = [];
+		self.settings = settings = settings || {};
+		self.schema = settings.schema;
+		self.styles = new Styles({
+			url_converter: settings.url_converter,
+			url_converter_scope: settings.url_converter_scope
+		}, settings.schema);
+
+		self.fixDoc(doc);
+		self.events = settings.ownEvents ? new EventUtils(settings.proxy) : EventUtils.Event;
+		self.attrHooks = setupAttrHooks(self, settings);
+		blockElementsMap = settings.schema ? settings.schema.getBlockElements() : {};
+		self.$ = $.overrideDefaults(function() {
+			return {
+				context: doc,
+				element: self.getRoot()
+			};
+		});
+
+		/**
+		 * Returns true/false if the specified element is a block element or not.
+		 *
+		 * @method isBlock
+		 * @param {Node/String} node Element/Node to check.
+		 * @return {Boolean} True/False state if the node is a block element or not.
+		 */
+		self.isBlock = function(node) {
+			// Fix for #5446
+			if (!node) {
+				return false;
+			}
+
+			// This function is called in module pattern style since it might be executed with the wrong this scope
+			var type = node.nodeType;
+
+			// If it's a node then check the type and use the nodeName
+			if (type) {
+				return !!(type === 1 && blockElementsMap[node.nodeName]);
+			}
+
+			return !!blockElementsMap[node];
+		};
+	}
+
+	DOMUtils.prototype = {
+		$$: function(elm) {
+			if (typeof elm == 'string') {
+				elm = this.get(elm);
+			}
+
+			return this.$(elm);
+		},
+
+		root: null,
+
+		fixDoc: function(doc) {
+			var settings = this.settings, name;
+
+			if (isIE && settings.schema) {
+				// Add missing HTML 4/5 elements to IE
+				('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(name) {
+					doc.createElement(name);
+				});
+
+				// Create all custom elements
+				for (name in settings.schema.getCustomElements()) {
+					doc.createElement(name);
+				}
+			}
+		},
+
+		clone: function(node, deep) {
+			var self = this, clone, doc;
+
+			// TODO: Add feature detection here in the future
+			if (!isIE || node.nodeType !== 1 || deep) {
+				return node.cloneNode(deep);
+			}
+
+			doc = self.doc;
+
+			// Make a HTML5 safe shallow copy
+			if (!deep) {
+				clone = doc.createElement(node.nodeName);
+
+				// Copy attribs
+				each(self.getAttribs(node), function(attr) {
+					self.setAttrib(clone, attr.nodeName, self.getAttrib(node, attr.nodeName));
+				});
+
+				return clone;
+			}
+
+			return clone.firstChild;
+		},
+
+		/**
+		 * Returns the root node of the document. This is normally the body but might be a DIV. Parents like getParent will not
+		 * go above the point of this root node.
+		 *
+		 * @method getRoot
+		 * @return {Element} Root element for the utility class.
+		 */
+		getRoot: function() {
+			var self = this;
+
+			return self.settings.root_element || self.doc.body;
+		},
+
+		/**
+		 * Returns the viewport of the window.
+		 *
+		 * @method getViewPort
+		 * @param {Window} win Optional window to get viewport of.
+		 * @return {Object} Viewport object with fields x, y, w and h.
+		 */
+		getViewPort: function(win) {
+			var doc, rootElm;
+
+			win = !win ? this.win : win;
+			doc = win.document;
+			rootElm = this.boxModel ? doc.documentElement : doc.body;
+
+			// Returns viewport size excluding scrollbars
+			return {
+				x: win.pageXOffset || rootElm.scrollLeft,
+				y: win.pageYOffset || rootElm.scrollTop,
+				w: win.innerWidth || rootElm.clientWidth,
+				h: win.innerHeight || rootElm.clientHeight
+			};
+		},
+
+		/**
+		 * Returns the rectangle for a specific element.
+		 *
+		 * @method getRect
+		 * @param {Element/String} elm Element object or element ID to get rectangle from.
+		 * @return {object} Rectangle for specified element object with x, y, w, h fields.
+		 */
+		getRect: function(elm) {
+			var self = this, pos, size;
+
+			elm = self.get(elm);
+			pos = self.getPos(elm);
+			size = self.getSize(elm);
+
+			return {
+				x: pos.x, y: pos.y,
+				w: size.w, h: size.h
+			};
+		},
+
+		/**
+		 * Returns the size dimensions of the specified element.
+		 *
+		 * @method getSize
+		 * @param {Element/String} elm Element object or element ID to get rectangle from.
+		 * @return {object} Rectangle for specified element object with w, h fields.
+		 */
+		getSize: function(elm) {
+			var self = this, w, h;
+
+			elm = self.get(elm);
+			w = self.getStyle(elm, 'width');
+			h = self.getStyle(elm, 'height');
+
+			// Non pixel value, then force offset/clientWidth
+			if (w.indexOf('px') === -1) {
+				w = 0;
+			}
+
+			// Non pixel value, then force offset/clientWidth
+			if (h.indexOf('px') === -1) {
+				h = 0;
+			}
+
+			return {
+				w: parseInt(w, 10) || elm.offsetWidth || elm.clientWidth,
+				h: parseInt(h, 10) || elm.offsetHeight || elm.clientHeight
+			};
+		},
+
+		/**
+		 * Returns a node by the specified selector function. This function will
+		 * loop through all parent nodes and call the specified function for each node.
+		 * If the function then returns true indicating that it has found what it was looking for, the loop execution will then end
+		 * and the node it found will be returned.
+		 *
+		 * @method getParent
+		 * @param {Node/String} node DOM node to search parents on or ID string.
+		 * @param {function} selector Selection function or CSS selector to execute on each node.
+		 * @param {Node} root Optional root element, never go below this point.
+		 * @return {Node} DOM Node or null if it wasn't found.
+		 */
+		getParent: function(node, selector, root) {
+			return this.getParents(node, selector, root, false);
+		},
+
+		/**
+		 * Returns a node list of all parents matching the specified selector function or pattern.
+		 * If the function then returns true indicating that it has found what it was looking for and that node will be collected.
+		 *
+		 * @method getParents
+		 * @param {Node/String} node DOM node to search parents on or ID string.
+		 * @param {function} selector Selection function to execute on each node or CSS pattern.
+		 * @param {Node} root Optional root element, never go below this point.
+		 * @return {Array} Array of nodes or null if it wasn't found.
+		 */
+		getParents: function(node, selector, root, collect) {
+			var self = this, selectorVal, result = [];
+
+			node = self.get(node);
+			collect = collect === undefined;
+
+			// Default root on inline mode
+			root = root || (self.getRoot().nodeName != 'BODY' ? self.getRoot().parentNode : null);
+
+			// Wrap node name as func
+			if (is(selector, 'string')) {
+				selectorVal = selector;
+
+				if (selector === '*') {
+					selector = function(node) {
+						return node.nodeType == 1;
+					};
+				} else {
+					selector = function(node) {
+						return self.is(node, selectorVal);
+					};
+				}
+			}
+
+			while (node) {
+				if (node == root || !node.nodeType || node.nodeType === 9) {
+					break;
+				}
+
+				if (!selector || selector(node)) {
+					if (collect) {
+						result.push(node);
+					} else {
+						return node;
+					}
+				}
+
+				node = node.parentNode;
+			}
+
+			return collect ? result : null;
+		},
+
+		/**
+		 * Returns the specified element by ID or the input element if it isn't a string.
+		 *
+		 * @method get
+		 * @param {String/Element} n Element id to look for or element to just pass though.
+		 * @return {Element} Element matching the specified id or null if it wasn't found.
+		 */
+		get: function(elm) {
+			var name;
+
+			if (elm && this.doc && typeof elm == 'string') {
+				name = elm;
+				elm = this.doc.getElementById(elm);
+
+				// IE and Opera returns meta elements when they match the specified input ID, but getElementsByName seems to do the trick
+				if (elm && elm.id !== name) {
+					return this.doc.getElementsByName(name)[1];
+				}
+			}
+
+			return elm;
+		},
+
+		/**
+		 * Returns the next node that matches selector or function
+		 *
+		 * @method getNext
+		 * @param {Node} node Node to find siblings from.
+		 * @param {String/function} selector Selector CSS expression or function.
+		 * @return {Node} Next node item matching the selector or null if it wasn't found.
+		 */
+		getNext: function(node, selector) {
+			return this._findSib(node, selector, 'nextSibling');
+		},
+
+		/**
+		 * Returns the previous node that matches selector or function
+		 *
+		 * @method getPrev
+		 * @param {Node} node Node to find siblings from.
+		 * @param {String/function} selector Selector CSS expression or function.
+		 * @return {Node} Previous node item matching the selector or null if it wasn't found.
+		 */
+		getPrev: function(node, selector) {
+			return this._findSib(node, selector, 'previousSibling');
+		},
+
+		// #ifndef jquery
+
+		/**
+		 * Selects specific elements by a CSS level 3 pattern. For example "div#a1 p.test".
+		 * This function is optimized for the most common patterns needed in TinyMCE but it also performs well enough
+		 * on more complex patterns.
+		 *
+		 * @method select
+		 * @param {String} selector CSS level 3 pattern to select/find elements by.
+		 * @param {Object} scope Optional root element/scope element to search in.
+		 * @return {Array} Array with all matched elements.
+		 * @example
+		 * // Adds a class to all paragraphs in the currently active editor
+		 * tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('p'), 'someclass');
+		 *
+		 * // Adds a class to all spans that have the test class in the currently active editor
+		 * tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('span.test'), 'someclass')
+		 */
+		select: function(selector, scope) {
+			var self = this;
+
+			/*eslint new-cap:0 */
+			return Sizzle(selector, self.get(scope) || self.settings.root_element || self.doc, []);
+		},
+
+		/**
+		 * Returns true/false if the specified element matches the specified css pattern.
+		 *
+		 * @method is
+		 * @param {Node/NodeList} elm DOM node to match or an array of nodes to match.
+		 * @param {String} selector CSS pattern to match the element against.
+		 */
+		is: function(elm, selector) {
+			var i;
+
+			// If it isn't an array then try to do some simple selectors instead of Sizzle for to boost performance
+			if (elm.length === undefined) {
+				// Simple all selector
+				if (selector === '*') {
+					return elm.nodeType == 1;
+				}
+
+				// Simple selector just elements
+				if (simpleSelectorRe.test(selector)) {
+					selector = selector.toLowerCase().split(/,/);
+					elm = elm.nodeName.toLowerCase();
+
+					for (i = selector.length - 1; i >= 0; i--) {
+						if (selector[i] == elm) {
+							return true;
+						}
+					}
+
+					return false;
+				}
+			}
+
+			// Is non element
+			if (elm.nodeType && elm.nodeType != 1) {
+				return false;
+			}
+
+			var elms = elm.nodeType ? [elm] : elm;
+
+			/*eslint new-cap:0 */
+			return Sizzle(selector, elms[0].ownerDocument || elms[0], null, elms).length > 0;
+		},
+
+		// #endif
+
+		/**
+		 * Adds the specified element to another element or elements.
+		 *
+		 * @method add
+		 * @param {String/Element/Array} parentElm Element id string, DOM node element or array of ids or elements to add to.
+		 * @param {String/Element} name Name of new element to add or existing element to add.
+		 * @param {Object} attrs Optional object collection with arguments to add to the new element(s).
+		 * @param {String} html Optional inner HTML contents to add for each element.
+		 * @return {Element/Array} Element that got created, or an array of created elements if multiple input elements
+		 * were passed in.
+		 * @example
+		 * // Adds a new paragraph to the end of the active editor
+		 * tinymce.activeEditor.dom.add(tinymce.activeEditor.getBody(), 'p', {title: 'my title'}, 'Some content');
+		 */
+		add: function(parentElm, name, attrs, html, create) {
+			var self = this;
+
+			return this.run(parentElm, function(parentElm) {
+				var newElm;
+
+				newElm = is(name, 'string') ? self.doc.createElement(name) : name;
+				self.setAttribs(newElm, attrs);
+
+				if (html) {
+					if (html.nodeType) {
+						newElm.appendChild(html);
+					} else {
+						self.setHTML(newElm, html);
+					}
+				}
+
+				return !create ? parentElm.appendChild(newElm) : newElm;
+			});
+		},
+
+		/**
+		 * Creates a new element.
+		 *
+		 * @method create
+		 * @param {String} name Name of new element.
+		 * @param {Object} attrs Optional object name/value collection with element attributes.
+		 * @param {String} html Optional HTML string to set as inner HTML of the element.
+		 * @return {Element} HTML DOM node element that got created.
+		 * @example
+		 * // Adds an element where the caret/selection is in the active editor
+		 * var el = tinymce.activeEditor.dom.create('div', {id: 'test', 'class': 'myclass'}, 'some content');
+		 * tinymce.activeEditor.selection.setNode(el);
+		 */
+		create: function(name, attrs, html) {
+			return this.add(this.doc.createElement(name), name, attrs, html, 1);
+		},
+
+		/**
+		 * Creates HTML string for element. The element will be closed unless an empty inner HTML string is passed in.
+		 *
+		 * @method createHTML
+		 * @param {String} name Name of new element.
+		 * @param {Object} attrs Optional object name/value collection with element attributes.
+		 * @param {String} html Optional HTML string to set as inner HTML of the element.
+		 * @return {String} String with new HTML element, for example: <a href="#">test</a>.
+		 * @example
+		 * // Creates a html chunk and inserts it at the current selection/caret location
+		 * tinymce.activeEditor.selection.setContent(tinymce.activeEditor.dom.createHTML('a', {href: 'test.html'}, 'some line'));
+		 */
+		createHTML: function(name, attrs, html) {
+			var outHtml = '', key;
+
+			outHtml += '<' + name;
+
+			for (key in attrs) {
+				if (attrs.hasOwnProperty(key) && attrs[key] !== null && typeof attrs[key] != 'undefined') {
+					outHtml += ' ' + key + '="' + this.encode(attrs[key]) + '"';
+				}
+			}
+
+			// A call to tinymce.is doesn't work for some odd reason on IE9 possible bug inside their JS runtime
+			if (typeof html != "undefined") {
+				return outHtml + '>' + html + '</' + name + '>';
+			}
+
+			return outHtml + ' />';
+		},
+
+		/**
+		 * Creates a document fragment out of the specified HTML string.
+		 *
+		 * @method createFragment
+		 * @param {String} html Html string to create fragment from.
+		 * @return {DocumentFragment} Document fragment node.
+		 */
+		createFragment: function(html) {
+			var frag, node, doc = this.doc, container;
+
+			container = doc.createElement("div");
+			frag = doc.createDocumentFragment();
+
+			if (html) {
+				container.innerHTML = html;
+			}
+
+			while ((node = container.firstChild)) {
+				frag.appendChild(node);
+			}
+
+			return frag;
+		},
+
+		/**
+		 * Removes/deletes the specified element(s) from the DOM.
+		 *
+		 * @method remove
+		 * @param {String/Element/Array} node ID of element or DOM element object or array containing multiple elements/ids.
+		 * @param {Boolean} keepChildren Optional state to keep children or not. If set to true all children will be
+		 * placed at the location of the removed element.
+		 * @return {Element/Array} HTML DOM element that got removed, or an array of removed elements if multiple input elements
+		 * were passed in.
+		 * @example
+		 * // Removes all paragraphs in the active editor
+		 * tinymce.activeEditor.dom.remove(tinymce.activeEditor.dom.select('p'));
+		 *
+		 * // Removes an element by id in the document
+		 * tinymce.DOM.remove('mydiv');
+		 */
+		remove: function(node, keepChildren) {
+			node = this.$$(node);
+
+			if (keepChildren) {
+				node.each(function() {
+					var child;
+
+					while ((child = this.firstChild)) {
+						if (child.nodeType == 3 && child.data.length === 0) {
+							this.removeChild(child);
+						} else {
+							this.parentNode.insertBefore(child, this);
+						}
+					}
+				}).remove();
+			} else {
+				node.remove();
+			}
+
+			return node.length > 1 ? node.toArray() : node[0];
+		},
+
+		/**
+		 * Sets the CSS style value on a HTML element. The name can be a camelcase string
+		 * or the CSS style name like background-color.
+		 *
+		 * @method setStyle
+		 * @param {String/Element/Array} n HTML element/Element ID or Array of elements/ids to set CSS style value on.
+		 * @param {String} na Name of the style value to set.
+		 * @param {String} v Value to set on the style.
+		 * @example
+		 * // Sets a style value on all paragraphs in the currently active editor
+		 * tinymce.activeEditor.dom.setStyle(tinymce.activeEditor.dom.select('p'), 'background-color', 'red');
+		 *
+		 * // Sets a style value to an element by id in the current document
+		 * tinymce.DOM.setStyle('mydiv', 'background-color', 'red');
+		 */
+		setStyle: function(elm, name, value) {
+			elm = this.$$(elm).css(name, value);
+
+			if (this.settings.update_styles) {
+				elm.attr('data-mce-style', null);
+			}
+		},
+
+		/**
+		 * Returns the current style or runtime/computed value of an element.
+		 *
+		 * @method getStyle
+		 * @param {String/Element} elm HTML element or element id string to get style from.
+		 * @param {String} name Style name to return.
+		 * @param {Boolean} computed Computed style.
+		 * @return {String} Current style or computed style value of an element.
+		 */
+		getStyle: function(elm, name, computed) {
+			elm = this.$$(elm);
+
+			if (computed) {
+				return elm.css(name);
+			}
+
+			// Camelcase it, if needed
+			name = name.replace(/-(\D)/g, function(a, b) {
+				return b.toUpperCase();
+			});
+
+			if (name == 'float') {
+				name = isIE ? 'styleFloat' : 'cssFloat';
+			}
+
+			return elm[0] && elm[0].style ? elm[0].style[name] : undefined;
+		},
+
+		/**
+		 * Sets multiple styles on the specified element(s).
+		 *
+		 * @method setStyles
+		 * @param {Element/String/Array} e DOM element, element id string or array of elements/ids to set styles on.
+		 * @param {Object} o Name/Value collection of style items to add to the element(s).
+		 * @example
+		 * // Sets styles on all paragraphs in the currently active editor
+		 * tinymce.activeEditor.dom.setStyles(tinymce.activeEditor.dom.select('p'), {'background-color': 'red', 'color': 'green'});
+		 *
+		 * // Sets styles to an element by id in the current document
+		 * tinymce.DOM.setStyles('mydiv', {'background-color': 'red', 'color': 'green'});
+		 */
+		setStyles: function(elm, styles) {
+			elm = this.$$(elm).css(styles);
+
+			if (this.settings.update_styles) {
+				elm.attr('data-mce-style', null);
+			}
+		},
+
+		/**
+		 * Removes all attributes from an element or elements.
+		 *
+		 * @method removeAllAttribs
+		 * @param {Element/String/Array} e DOM element, element id string or array of elements/ids to remove attributes from.
+		 */
+		removeAllAttribs: function(e) {
+			return this.run(e, function(e) {
+				var i, attrs = e.attributes;
+				for (i = attrs.length - 1; i >= 0; i--) {
+					e.removeAttributeNode(attrs.item(i));
+				}
+			});
+		},
+
+		/**
+		 * Sets the specified attribute of an element or elements.
+		 *
+		 * @method setAttrib
+		 * @param {Element/String/Array} e DOM element, element id string or array of elements/ids to set attribute on.
+		 * @param {String} n Name of attribute to set.
+		 * @param {String} v Value to set on the attribute - if this value is falsy like null, 0 or '' it will remove the attribute instead.
+		 * @example
+		 * // Sets class attribute on all paragraphs in the active editor
+		 * tinymce.activeEditor.dom.setAttrib(tinymce.activeEditor.dom.select('p'), 'class', 'myclass');
+		 *
+		 * // Sets class attribute on a specific element in the current page
+		 * tinymce.dom.setAttrib('mydiv', 'class', 'myclass');
+		 */
+		setAttrib: function(elm, name, value) {
+			var self = this, originalValue, hook, settings = self.settings;
+
+			if (value === '') {
+				value = null;
+			}
+
+			elm = self.$$(elm);
+			originalValue = elm.attr(name);
+
+			if (!elm.length) {
+				return;
+			}
+
+			hook = self.attrHooks[name];
+			if (hook && hook.set) {
+				hook.set(elm, value, name);
+			} else {
+				elm.attr(name, value);
+			}
+
+			if (originalValue != value && settings.onSetAttrib) {
+				settings.onSetAttrib({
+					attrElm: elm,
+					attrName: name,
+					attrValue: value
+				});
+			}
+		},
+
+		/**
+		 * Sets two or more specified attributes of an element or elements.
+		 *
+		 * @method setAttribs
+		 * @param {Element/String/Array} elm DOM element, element id string or array of elements/ids to set attributes on.
+		 * @param {Object} attrs Name/Value collection of attribute items to add to the element(s).
+		 * @example
+		 * // Sets class and title attributes on all paragraphs in the active editor
+		 * tinymce.activeEditor.dom.setAttribs(tinymce.activeEditor.dom.select('p'), {'class': 'myclass', title: 'some title'});
+		 *
+		 * // Sets class and title attributes on a specific element in the current page
+		 * tinymce.DOM.setAttribs('mydiv', {'class': 'myclass', title: 'some title'});
+		 */
+		setAttribs: function(elm, attrs) {
+			var self = this;
+
+			self.$$(elm).each(function(i, node) {
+				each(attrs, function(value, name) {
+					self.setAttrib(node, name, value);
+				});
+			});
+		},
+
+		/**
+		 * Returns the specified attribute by name.
+		 *
+		 * @method getAttrib
+		 * @param {String/Element} elm Element string id or DOM element to get attribute from.
+		 * @param {String} name Name of attribute to get.
+		 * @param {String} defaultVal Optional default value to return if the attribute didn't exist.
+		 * @return {String} Attribute value string, default value or null if the attribute wasn't found.
+		 */
+		getAttrib: function(elm, name, defaultVal) {
+			var self = this, hook, value;
+
+			elm = self.$$(elm);
+
+			if (elm.length) {
+				hook = self.attrHooks[name];
+
+				if (hook && hook.get) {
+					value = hook.get(elm, name);
+				} else {
+					value = elm.attr(name);
+				}
+			}
+
+			if (typeof value == 'undefined') {
+				value = defaultVal || '';
+			}
+
+			return value;
+		},
+
+		/**
+		 * Returns the absolute x, y position of a node. The position will be returned in an object with x, y fields.
+		 *
+		 * @method getPos
+		 * @param {Element/String} elm HTML element or element id to get x, y position from.
+		 * @param {Element} rootElm Optional root element to stop calculations at.
+		 * @return {object} Absolute position of the specified element object with x, y fields.
+		 */
+		getPos: function(elm, rootElm) {
+			var self = this, x = 0, y = 0, offsetParent, doc = self.doc, body = doc.body, pos;
+
+			elm = self.get(elm);
+			rootElm = rootElm || body;
+
+			if (elm) {
+				// Use getBoundingClientRect if it exists since it's faster than looping offset nodes
+				// Fallback to offsetParent calculations if the body isn't static better since it stops at the body root
+				if (rootElm === body && elm.getBoundingClientRect && $(body).css('position') === 'static') {
+					pos = elm.getBoundingClientRect();
+					rootElm = self.boxModel ? doc.documentElement : body;
+
+					// Add scroll offsets from documentElement or body since IE with the wrong box model will use d.body and so do WebKit
+					// Also remove the body/documentelement clientTop/clientLeft on IE 6, 7 since they offset the position
+					x = pos.left + (doc.documentElement.scrollLeft || body.scrollLeft) - rootElm.clientLeft;
+					y = pos.top + (doc.documentElement.scrollTop || body.scrollTop) - rootElm.clientTop;
+
+					return {x: x, y: y};
+				}
+
+				offsetParent = elm;
+				while (offsetParent && offsetParent != rootElm && offsetParent.nodeType) {
+					x += offsetParent.offsetLeft || 0;
+					y += offsetParent.offsetTop || 0;
+					offsetParent = offsetParent.offsetParent;
+				}
+
+				offsetParent = elm.parentNode;
+				while (offsetParent && offsetParent != rootElm && offsetParent.nodeType) {
+					x -= offsetParent.scrollLeft || 0;
+					y -= offsetParent.scrollTop || 0;
+					offsetParent = offsetParent.parentNode;
+				}
+			}
+
+			return {x: x, y: y};
+		},
+
+		/**
+		 * Parses the specified style value into an object collection. This parser will also
+		 * merge and remove any redundant items that browsers might have added. It will also convert non-hex
+		 * colors to hex values. Urls inside the styles will also be converted to absolute/relative based on settings.
+		 *
+		 * @method parseStyle
+		 * @param {String} cssText Style value to parse, for example: border:1px solid red;.
+		 * @return {Object} Object representation of that style, for example: {border: '1px solid red'}
+		 */
+		parseStyle: function(cssText) {
+			return this.styles.parse(cssText);
+		},
+
+		/**
+		 * Serializes the specified style object into a string.
+		 *
+		 * @method serializeStyle
+		 * @param {Object} styles Object to serialize as string, for example: {border: '1px solid red'}
+		 * @param {String} name Optional element name.
+		 * @return {String} String representation of the style object, for example: border: 1px solid red.
+		 */
+		serializeStyle: function(styles, name) {
+			return this.styles.serialize(styles, name);
+		},
+
+		/**
+		 * Adds a style element at the top of the document with the specified cssText content.
+		 *
+		 * @method addStyle
+		 * @param {String} cssText CSS Text style to add to top of head of document.
+		 */
+		addStyle: function(cssText) {
+			var self = this, doc = self.doc, head, styleElm;
+
+			// Prevent inline from loading the same styles twice
+			if (self !== DOMUtils.DOM && doc === document) {
+				var addedStyles = DOMUtils.DOM.addedStyles;
+
+				addedStyles = addedStyles || [];
+				if (addedStyles[cssText]) {
+					return;
+				}
+
+				addedStyles[cssText] = true;
+				DOMUtils.DOM.addedStyles = addedStyles;
+			}
+
+			// Create style element if needed
+			styleElm = doc.getElementById('mceDefaultStyles');
+			if (!styleElm) {
+				styleElm = doc.createElement('style');
+				styleElm.id = 'mceDefaultStyles';
+				styleElm.type = 'text/css';
+
+				head = doc.getElementsByTagName('head')[0];
+				if (head.firstChild) {
+					head.insertBefore(styleElm, head.firstChild);
+				} else {
+					head.appendChild(styleElm);
+				}
+			}
+
+			// Append style data to old or new style element
+			if (styleElm.styleSheet) {
+				styleElm.styleSheet.cssText += cssText;
+			} else {
+				styleElm.appendChild(doc.createTextNode(cssText));
+			}
+		},
+
+		/**
+		 * Imports/loads the specified CSS file into the document bound to the class.
+		 *
+		 * @method loadCSS
+		 * @param {String} u URL to CSS file to load.
+		 * @example
+		 * // Loads a CSS file dynamically into the current document
+		 * tinymce.DOM.loadCSS('somepath/some.css');
+		 *
+		 * // Loads a CSS file into the currently active editor instance
+		 * tinymce.activeEditor.dom.loadCSS('somepath/some.css');
+		 *
+		 * // Loads a CSS file into an editor instance by id
+		 * tinymce.get('someid').dom.loadCSS('somepath/some.css');
+		 *
+		 * // Loads multiple CSS files into the current document
+		 * tinymce.DOM.loadCSS('somepath/some.css,somepath/someother.css');
+		 */
+		loadCSS: function(url) {
+			var self = this, doc = self.doc, head;
+
+			// Prevent inline from loading the same CSS file twice
+			if (self !== DOMUtils.DOM && doc === document) {
+				DOMUtils.DOM.loadCSS(url);
+				return;
+			}
+
+			if (!url) {
+				url = '';
+			}
+
+			head = doc.getElementsByTagName('head')[0];
+
+			each(url.split(','), function(url) {
+				var link;
+
+				url = Tools._addCacheSuffix(url);
+
+				if (self.files[url]) {
+					return;
+				}
+
+				self.files[url] = true;
+				link = self.create('link', {rel: 'stylesheet', href: url});
+
+				// IE 8 has a bug where dynamically loading stylesheets would produce a 1 item remaining bug
+				// This fix seems to resolve that issue by recalcing the document once a stylesheet finishes loading
+				// It's ugly but it seems to work fine.
+				if (isIE && doc.documentMode && doc.recalc) {
+					link.onload = function() {
+						if (doc.recalc) {
+							doc.recalc();
+						}
+
+						link.onload = null;
+					};
+				}
+
+				head.appendChild(link);
+			});
+		},
+
+		/**
+		 * Adds a class to the specified element or elements.
+		 *
+		 * @method addClass
+		 * @param {String/Element/Array} elm Element ID string or DOM element or array with elements or IDs.
+		 * @param {String} cls Class name to add to each element.
+		 * @return {String/Array} String with new class value or array with new class values for all elements.
+		 * @example
+		 * // Adds a class to all paragraphs in the active editor
+		 * tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('p'), 'myclass');
+		 *
+		 * // Adds a class to a specific element in the current page
+		 * tinymce.DOM.addClass('mydiv', 'myclass');
+		 */
+		addClass: function(elm, cls) {
+			this.$$(elm).addClass(cls);
+		},
+
+		/**
+		 * Removes a class from the specified element or elements.
+		 *
+		 * @method removeClass
+		 * @param {String/Element/Array} elm Element ID string or DOM element or array with elements or IDs.
+		 * @param {String} cls Class name to remove from each element.
+		 * @return {String/Array} String of remaining class name(s), or an array of strings if multiple input elements
+		 * were passed in.
+		 * @example
+		 * // Removes a class from all paragraphs in the active editor
+		 * tinymce.activeEditor.dom.removeClass(tinymce.activeEditor.dom.select('p'), 'myclass');
+		 *
+		 * // Removes a class from a specific element in the current page
+		 * tinymce.DOM.removeClass('mydiv', 'myclass');
+		 */
+		removeClass: function(elm, cls) {
+			this.toggleClass(elm, cls, false);
+		},
+
+		/**
+		 * Returns true if the specified element has the specified class.
+		 *
+		 * @method hasClass
+		 * @param {String/Element} n HTML element or element id string to check CSS class on.
+		 * @param {String} c CSS class to check for.
+		 * @return {Boolean} true/false if the specified element has the specified class.
+		 */
+		hasClass: function(elm, cls) {
+			return this.$$(elm).hasClass(cls);
+		},
+
+		/**
+		 * Toggles the specified class on/off.
+		 *
+		 * @method toggleClass
+		 * @param {Element} elm Element to toggle class on.
+		 * @param {[type]} cls Class to toggle on/off.
+		 * @param {[type]} state Optional state to set.
+		 */
+		toggleClass: function(elm, cls, state) {
+			this.$$(elm).toggleClass(cls, state).each(function() {
+				if (this.className === '') {
+					$(this).attr('class', null);
+				}
+			});
+		},
+
+		/**
+		 * Shows the specified element(s) by ID by setting the "display" style.
+		 *
+		 * @method show
+		 * @param {String/Element/Array} elm ID of DOM element or DOM element or array with elements or IDs to show.
+		 */
+		show: function(elm) {
+			this.$$(elm).show();
+		},
+
+		/**
+		 * Hides the specified element(s) by ID by setting the "display" style.
+		 *
+		 * @method hide
+		 * @param {String/Element/Array} e ID of DOM element or DOM element or array with elements or IDs to hide.
+		 * @example
+		 * // Hides an element by id in the document
+		 * tinymce.DOM.hide('myid');
+		 */
+		hide: function(elm) {
+			this.$$(elm).hide();
+		},
+
+		/**
+		 * Returns true/false if the element is hidden or not by checking the "display" style.
+		 *
+		 * @method isHidden
+		 * @param {String/Element} e Id or element to check display state on.
+		 * @return {Boolean} true/false if the element is hidden or not.
+		 */
+		isHidden: function(elm) {
+			return this.$$(elm).css('display') == 'none';
+		},
+
+		/**
+		 * Returns a unique id. This can be useful when generating elements on the fly.
+		 * This method will not check if the element already exists.
+		 *
+		 * @method uniqueId
+		 * @param {String} prefix Optional prefix to add in front of all ids - defaults to "mce_".
+		 * @return {String} Unique id.
+		 */
+		uniqueId: function(prefix) {
+			return (!prefix ? 'mce_' : prefix) + (this.counter++);
+		},
+
+		/**
+		 * Sets the specified HTML content inside the element or elements. The HTML will first be processed. This means
+		 * URLs will get converted, hex color values fixed etc. Check processHTML for details.
+		 *
+		 * @method setHTML
+		 * @param {Element/String/Array} elm DOM element, element id string or array of elements/ids to set HTML inside of.
+		 * @param {String} h HTML content to set as inner HTML of the element.
+		 * @example
+		 * // Sets the inner HTML of all paragraphs in the active editor
+		 * tinymce.activeEditor.dom.setHTML(tinymce.activeEditor.dom.select('p'), 'some inner html');
+		 *
+		 * // Sets the inner HTML of an element by id in the document
+		 * tinymce.DOM.setHTML('mydiv', 'some inner html');
+		 */
+		setHTML: function(elm, html) {
+			elm = this.$$(elm);
+
+			if (isIE) {
+				elm.each(function(i, target) {
+					if (target.canHaveHTML === false) {
+						return;
+					}
+
+					// Remove all child nodes, IE keeps empty text nodes in DOM
+					while (target.firstChild) {
+						target.removeChild(target.firstChild);
+					}
+
+					try {
+						// IE will remove comments from the beginning
+						// unless you padd the contents with something
+						target.innerHTML = '<br>' + html;
+						target.removeChild(target.firstChild);
+					} catch (ex) {
+						// IE sometimes produces an unknown runtime error on innerHTML if it's a div inside a p
+						$('<div>').html('<br>' + html).contents().slice(1).appendTo(target);
+					}
+
+					return html;
+				});
+			} else {
+				elm.html(html);
+			}
+		},
+
+		/**
+		 * Returns the outer HTML of an element.
+		 *
+		 * @method getOuterHTML
+		 * @param {String/Element} elm Element ID or element object to get outer HTML from.
+		 * @return {String} Outer HTML string.
+		 * @example
+		 * tinymce.DOM.getOuterHTML(editorElement);
+		 * tinymce.activeEditor.getOuterHTML(tinymce.activeEditor.getBody());
+		 */
+		getOuterHTML: function(elm) {
+			elm = this.get(elm);
+
+			// Older FF doesn't have outerHTML 3.6 is still used by some orgaizations
+			return elm.nodeType == 1 && "outerHTML" in elm ? elm.outerHTML : $('<div>').append($(elm).clone()).html();
+		},
+
+		/**
+		 * Sets the specified outer HTML on an element or elements.
+		 *
+		 * @method setOuterHTML
+		 * @param {Element/String/Array} elm DOM element, element id string or array of elements/ids to set outer HTML on.
+		 * @param {Object} html HTML code to set as outer value for the element.
+		 * @param {Document} doc Optional document scope to use in this process - defaults to the document of the DOM class.
+		 * @example
+		 * // Sets the outer HTML of all paragraphs in the active editor
+		 * tinymce.activeEditor.dom.setOuterHTML(tinymce.activeEditor.dom.select('p'), '<div>some html</div>');
+		 *
+		 * // Sets the outer HTML of an element by id in the document
+		 * tinymce.DOM.setOuterHTML('mydiv', '<div>some html</div>');
+		 */
+		setOuterHTML: function(elm, html) {
+			var self = this;
+
+			self.$$(elm).each(function() {
+				try {
+					// Older FF doesn't have outerHTML 3.6 is still used by some orgaizations
+					if ("outerHTML" in this) {
+						this.outerHTML = html;
+						return;
+					}
+				} catch (ex) {
+					// Ignore
+				}
+
+				// OuterHTML for IE it sometimes produces an "unknown runtime error"
+				self.remove($(this).html(html), true);
+			});
+		},
+
+		/**
+		 * Entity decodes a string. This method decodes any HTML entities, such as &aring;.
+		 *
+		 * @method decode
+		 * @param {String} s String to decode entities on.
+		 * @return {String} Entity decoded string.
+		 */
+		decode: Entities.decode,
+
+		/**
+		 * Entity encodes a string. This method encodes the most common entities, such as <>"&.
+		 *
+		 * @method encode
+		 * @param {String} text String to encode with entities.
+		 * @return {String} Entity encoded string.
+		 */
+		encode: Entities.encodeAllRaw,
+
+		/**
+		 * Inserts an element after the reference element.
+		 *
+		 * @method insertAfter
+		 * @param {Element} node Element to insert after the reference.
+		 * @param {Element/String/Array} reference_node Reference element, element id or array of elements to insert after.
+		 * @return {Element/Array} Element that got added or an array with elements.
+		 */
+		insertAfter: function(node, referenceNode) {
+			referenceNode = this.get(referenceNode);
+
+			return this.run(node, function(node) {
+				var parent, nextSibling;
+
+				parent = referenceNode.parentNode;
+				nextSibling = referenceNode.nextSibling;
+
+				if (nextSibling) {
+					parent.insertBefore(node, nextSibling);
+				} else {
+					parent.appendChild(node);
+				}
+
+				return node;
+			});
+		},
+
+		/**
+		 * Replaces the specified element or elements with the new element specified. The new element will
+		 * be cloned if multiple input elements are passed in.
+		 *
+		 * @method replace
+		 * @param {Element} newElm New element to replace old ones with.
+		 * @param {Element/String/Array} oldELm Element DOM node, element id or array of elements or ids to replace.
+		 * @param {Boolean} k Optional keep children state, if set to true child nodes from the old object will be added to new ones.
+		 */
+		replace: function(newElm, oldElm, keepChildren) {
+			var self = this;
+
+			return self.run(oldElm, function(oldElm) {
+				if (is(oldElm, 'array')) {
+					newElm = newElm.cloneNode(true);
+				}
+
+				if (keepChildren) {
+					each(grep(oldElm.childNodes), function(node) {
+						newElm.appendChild(node);
+					});
+				}
+
+				return oldElm.parentNode.replaceChild(newElm, oldElm);
+			});
+		},
+
+		/**
+		 * Renames the specified element and keeps its attributes and children.
+		 *
+		 * @method rename
+		 * @param {Element} elm Element to rename.
+		 * @param {String} name Name of the new element.
+		 * @return {Element} New element or the old element if it needed renaming.
+		 */
+		rename: function(elm, name) {
+			var self = this, newElm;
+
+			if (elm.nodeName != name.toUpperCase()) {
+				// Rename block element
+				newElm = self.create(name);
+
+				// Copy attribs to new block
+				each(self.getAttribs(elm), function(attrNode) {
+					self.setAttrib(newElm, attrNode.nodeName, self.getAttrib(elm, attrNode.nodeName));
+				});
+
+				// Replace block
+				self.replace(newElm, elm, 1);
+			}
+
+			return newElm || elm;
+		},
+
+		/**
+		 * Find the common ancestor of two elements. This is a shorter method than using the DOM Range logic.
+		 *
+		 * @method findCommonAncestor
+		 * @param {Element} a Element to find common ancestor of.
+		 * @param {Element} b Element to find common ancestor of.
+		 * @return {Element} Common ancestor element of the two input elements.
+		 */
+		findCommonAncestor: function(a, b) {
+			var ps = a, pe;
+
+			while (ps) {
+				pe = b;
+
+				while (pe && ps != pe) {
+					pe = pe.parentNode;
+				}
+
+				if (ps == pe) {
+					break;
+				}
+
+				ps = ps.parentNode;
+			}
+
+			if (!ps && a.ownerDocument) {
+				return a.ownerDocument.documentElement;
+			}
+
+			return ps;
+		},
+
+		/**
+		 * Parses the specified RGB color value and returns a hex version of that color.
+		 *
+		 * @method toHex
+		 * @param {String} rgbVal RGB string value like rgb(1,2,3)
+		 * @return {String} Hex version of that RGB value like #FF00FF.
+		 */
+		toHex: function(rgbVal) {
+			return this.styles.toHex(Tools.trim(rgbVal));
+		},
+
+		/**
+		 * Executes the specified function on the element by id or dom element node or array of elements/id.
+		 *
+		 * @method run
+		 * @param {String/Element/Array} Element ID or DOM element object or array with ids or elements.
+		 * @param {function} f Function to execute for each item.
+		 * @param {Object} s Optional scope to execute the function in.
+		 * @return {Object/Array} Single object, or an array of objects if multiple input elements were passed in.
+		 */
+		run: function(elm, func, scope) {
+			var self = this, result;
+
+			if (typeof elm === 'string') {
+				elm = self.get(elm);
+			}
+
+			if (!elm) {
+				return false;
+			}
+
+			scope = scope || this;
+			if (!elm.nodeType && (elm.length || elm.length === 0)) {
+				result = [];
+
+				each(elm, function(elm, i) {
+					if (elm) {
+						if (typeof elm == 'string') {
+							elm = self.get(elm);
+						}
+
+						result.push(func.call(scope, elm, i));
+					}
+				});
+
+				return result;
+			}
+
+			return func.call(scope, elm);
+		},
+
+		/**
+		 * Returns a NodeList with attributes for the element.
+		 *
+		 * @method getAttribs
+		 * @param {HTMLElement/string} elm Element node or string id to get attributes from.
+		 * @return {NodeList} NodeList with attributes.
+		 */
+		getAttribs: function(elm) {
+			var attrs;
+
+			elm = this.get(elm);
+
+			if (!elm) {
+				return [];
+			}
+
+			if (isIE) {
+				attrs = [];
+
+				// Object will throw exception in IE
+				if (elm.nodeName == 'OBJECT') {
+					return elm.attributes;
+				}
+
+				// IE doesn't keep the selected attribute if you clone option elements
+				if (elm.nodeName === 'OPTION' && this.getAttrib(elm, 'selected')) {
+					attrs.push({specified: 1, nodeName: 'selected'});
+				}
+
+				// It's crazy that this is faster in IE but it's because it returns all attributes all the time
+				var attrRegExp = /<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi;
+				elm.cloneNode(false).outerHTML.replace(attrRegExp, '').replace(/[\w:\-]+/gi, function(a) {
+					attrs.push({specified: 1, nodeName: a});
+				});
+
+				return attrs;
+			}
+
+			return elm.attributes;
+		},
+
+		/**
+		 * Returns true/false if the specified node is to be considered empty or not.
+		 *
+		 * @example
+		 * tinymce.DOM.isEmpty(node, {img: true});
+		 * @method isEmpty
+		 * @param {Object} elements Optional name/value object with elements that are automatically treated as non-empty elements.
+		 * @return {Boolean} true/false if the node is empty or not.
+		 */
+		isEmpty: function(node, elements) {
+			var self = this, i, attributes, type, walker, name, brCount = 0;
+
+			node = node.firstChild;
+			if (node) {
+				walker = new TreeWalker(node, node.parentNode);
+				elements = elements || (self.schema ? self.schema.getNonEmptyElements() : null);
+
+				do {
+					type = node.nodeType;
+
+					if (type === 1) {
+						// Ignore bogus elements
+						if (node.getAttribute('data-mce-bogus')) {
+							continue;
+						}
+
+						// Keep empty elements like <img />
+						name = node.nodeName.toLowerCase();
+						if (elements && elements[name]) {
+							// Ignore single BR elements in blocks like <p><br /></p> or <p><span><br /></span></p>
+							if (name === 'br') {
+								brCount++;
+								continue;
+							}
+
+							return false;
+						}
+
+						// Keep elements with data-bookmark attributes or name attribute like <a name="1"></a>
+						attributes = self.getAttribs(node);
+						i = attributes.length;
+						while (i--) {
+							name = attributes[i].nodeName;
+							if (name === "name" || name === 'data-mce-bookmark') {
+								return false;
+							}
+						}
+					}
+
+					// Keep comment nodes
+					if (type == 8) {
+						return false;
+					}
+
+					// Keep non whitespace text nodes
+					if ((type === 3 && !whiteSpaceRegExp.test(node.nodeValue))) {
+						return false;
+					}
+				} while ((node = walker.next()));
+			}
+
+			return brCount <= 1;
+		},
+
+		/**
+		 * Creates a new DOM Range object. This will use the native DOM Range API if it's
+		 * available. If it's not, it will fall back to the custom TinyMCE implementation.
+		 *
+		 * @method createRng
+		 * @return {DOMRange} DOM Range object.
+		 * @example
+		 * var rng = tinymce.DOM.createRng();
+		 * alert(rng.startContainer + "," + rng.startOffset);
+		 */
+		createRng: function() {
+			var doc = this.doc;
+
+			return doc.createRange ? doc.createRange() : new Range(this);
+		},
+
+		/**
+		 * Returns the index of the specified node within its parent.
+		 *
+		 * @method nodeIndex
+		 * @param {Node} node Node to look for.
+		 * @param {boolean} normalized Optional true/false state if the index is what it would be after a normalization.
+		 * @return {Number} Index of the specified node.
+		 */
+		nodeIndex: function(node, normalized) {
+			var idx = 0, lastNodeType, nodeType;
+
+			if (node) {
+				for (lastNodeType = node.nodeType, node = node.previousSibling; node; node = node.previousSibling) {
+					nodeType = node.nodeType;
+
+					// Normalize text nodes
+					if (normalized && nodeType == 3) {
+						if (nodeType == lastNodeType || !node.nodeValue.length) {
+							continue;
+						}
+					}
+					idx++;
+					lastNodeType = nodeType;
+				}
+			}
+
+			return idx;
+		},
+
+		/**
+		 * Splits an element into two new elements and places the specified split
+		 * element or elements between the new ones. For example splitting the paragraph at the bold element in
+		 * this example <p>abc<b>abc</b>123</p> would produce <p>abc</p><b>abc</b><p>123</p>.
+		 *
+		 * @method split
+		 * @param {Element} parentElm Parent element to split.
+		 * @param {Element} splitElm Element to split at.
+		 * @param {Element} replacementElm Optional replacement element to replace the split element with.
+		 * @return {Element} Returns the split element or the replacement element if that is specified.
+		 */
+		split: function(parentElm, splitElm, replacementElm) {
+			var self = this, r = self.createRng(), bef, aft, pa;
+
+			// W3C valid browsers tend to leave empty nodes to the left/right side of the contents - this makes sense
+			// but we don't want that in our code since it serves no purpose for the end user
+			// For example splitting this html at the bold element:
+			//   <p>text 1<span><b>CHOP</b></span>text 2</p>
+			// would produce:
+			//   <p>text 1<span></span></p><b>CHOP</b><p><span></span>text 2</p>
+			// this function will then trim off empty edges and produce:
+			//   <p>text 1</p><b>CHOP</b><p>text 2</p>
+			function trimNode(node) {
+				var i, children = node.childNodes, type = node.nodeType;
+
+				function surroundedBySpans(node) {
+					var previousIsSpan = node.previousSibling && node.previousSibling.nodeName == 'SPAN';
+					var nextIsSpan = node.nextSibling && node.nextSibling.nodeName == 'SPAN';
+					return previousIsSpan && nextIsSpan;
+				}
+
+				if (type == 1 && node.getAttribute('data-mce-type') == 'bookmark') {
+					return;
+				}
+
+				for (i = children.length - 1; i >= 0; i--) {
+					trimNode(children[i]);
+				}
+
+				if (type != 9) {
+					// Keep non whitespace text nodes
+					if (type == 3 && node.nodeValue.length > 0) {
+						// If parent element isn't a block or there isn't any useful contents for example "<p>   </p>"
+						// Also keep text nodes with only spaces if surrounded by spans.
+						// eg. "<p><span>a</span> <span>b</span></p>" should keep space between a and b
+						var trimmedLength = trim(node.nodeValue).length;
+						if (!self.isBlock(node.parentNode) || trimmedLength > 0 || trimmedLength === 0 && surroundedBySpans(node)) {
+							return;
+						}
+					} else if (type == 1) {
+						// If the only child is a bookmark then move it up
+						children = node.childNodes;
+
+						// TODO fix this complex if
+						if (children.length == 1 && children[0] && children[0].nodeType == 1 &&
+							children[0].getAttribute('data-mce-type') == 'bookmark') {
+							node.parentNode.insertBefore(children[0], node);
+						}
+
+						// Keep non empty elements or img, hr etc
+						if (children.length || /^(br|hr|input|img)$/i.test(node.nodeName)) {
+							return;
+						}
+					}
+
+					self.remove(node);
+				}
+
+				return node;
+			}
+
+			if (parentElm && splitElm) {
+				// Get before chunk
+				r.setStart(parentElm.parentNode, self.nodeIndex(parentElm));
+				r.setEnd(splitElm.parentNode, self.nodeIndex(splitElm));
+				bef = r.extractContents();
+
+				// Get after chunk
+				r = self.createRng();
+				r.setStart(splitElm.parentNode, self.nodeIndex(splitElm) + 1);
+				r.setEnd(parentElm.parentNode, self.nodeIndex(parentElm) + 1);
+				aft = r.extractContents();
+
+				// Insert before chunk
+				pa = parentElm.parentNode;
+				pa.insertBefore(trimNode(bef), parentElm);
+
+				// Insert middle chunk
+				if (replacementElm) {
+					pa.replaceChild(replacementElm, splitElm);
+				} else {
+					pa.insertBefore(splitElm, parentElm);
+				}
+
+				// Insert after chunk
+				pa.insertBefore(trimNode(aft), parentElm);
+				self.remove(parentElm);
+
+				return replacementElm || splitElm;
+			}
+		},
+
+		/**
+		 * Adds an event handler to the specified object.
+		 *
+		 * @method bind
+		 * @param {Element/Document/Window/Array} target Target element to bind events to.
+		 * handler to or an array of elements/ids/documents.
+		 * @param {String} name Name of event handler to add, for example: click.
+		 * @param {function} func Function to execute when the event occurs.
+		 * @param {Object} scope Optional scope to execute the function in.
+		 * @return {function} Function callback handler the same as the one passed in.
+		 */
+		bind: function(target, name, func, scope) {
+			var self = this;
+
+			if (Tools.isArray(target)) {
+				var i = target.length;
+
+				while (i--) {
+					target[i] = self.bind(target[i], name, func, scope);
+				}
+
+				return target;
+			}
+
+			// Collect all window/document events bound by editor instance
+			if (self.settings.collect && (target === self.doc || target === self.win)) {
+				self.boundEvents.push([target, name, func, scope]);
+			}
+
+			return self.events.bind(target, name, func, scope || self);
+		},
+
+		/**
+		 * Removes the specified event handler by name and function from an element or collection of elements.
+		 *
+		 * @method unbind
+		 * @param {Element/Document/Window/Array} target Target element to unbind events on.
+		 * @param {String} name Event handler name, for example: "click"
+		 * @param {function} func Function to remove.
+		 * @return {bool/Array} Bool state of true if the handler was removed, or an array of states if multiple input elements
+		 * were passed in.
+		 */
+		unbind: function(target, name, func) {
+			var self = this, i;
+
+			if (Tools.isArray(target)) {
+				i = target.length;
+
+				while (i--) {
+					target[i] = self.unbind(target[i], name, func);
+				}
+
+				return target;
+			}
+
+			// Remove any bound events matching the input
+			if (self.boundEvents && (target === self.doc || target === self.win)) {
+				i = self.boundEvents.length;
+
+				while (i--) {
+					var item = self.boundEvents[i];
+
+					if (target == item[0] && (!name || name == item[1]) && (!func || func == item[2])) {
+						this.events.unbind(item[0], item[1], item[2]);
+					}
+				}
+			}
+
+			return this.events.unbind(target, name, func);
+		},
+
+		/**
+		 * Fires the specified event name with object on target.
+		 *
+		 * @method fire
+		 * @param {Node/Document/Window} target Target element or object to fire event on.
+		 * @param {String} name Name of the event to fire.
+		 * @param {Object} evt Event object to send.
+		 * @return {Event} Event object.
+		 */
+		fire: function(target, name, evt) {
+			return this.events.fire(target, name, evt);
+		},
+
+		// Returns the content editable state of a node
+		getContentEditable: function(node) {
+			var contentEditable;
+
+			// Check type
+			if (!node || node.nodeType != 1) {
+				return null;
+			}
+
+			// Check for fake content editable
+			contentEditable = node.getAttribute("data-mce-contenteditable");
+			if (contentEditable && contentEditable !== "inherit") {
+				return contentEditable;
+			}
+
+			// Check for real content editable
+			return node.contentEditable !== "inherit" ? node.contentEditable : null;
+		},
+
+		getContentEditableParent: function(node) {
+			var root = this.getRoot(), state = null;
+
+			for (; node && node !== root; node = node.parentNode) {
+				state = this.getContentEditable(node);
+
+				if (state !== null) {
+					break;
+				}
+			}
+
+			return state;
+		},
+
+		/**
+		 * Destroys all internal references to the DOM to solve IE leak issues.
+		 *
+		 * @method destroy
+		 */
+		destroy: function() {
+			var self = this;
+
+			// Unbind all events bound to window/document by editor instance
+			if (self.boundEvents) {
+				var i = self.boundEvents.length;
+
+				while (i--) {
+					var item = self.boundEvents[i];
+					this.events.unbind(item[0], item[1], item[2]);
+				}
+
+				self.boundEvents = null;
+			}
+
+			// Restore sizzle document to window.document
+			// Since the current document might be removed producing "Permission denied" on IE see #6325
+			if (Sizzle.setDocument) {
+				Sizzle.setDocument();
+			}
+
+			self.win = self.doc = self.root = self.events = self.frag = null;
+		},
+
+		isChildOf: function(node, parent) {
+			while (node) {
+				if (parent === node) {
+					return true;
+				}
+
+				node = node.parentNode;
+			}
+
+			return false;
+		},
+
+		// #ifdef debug
+
+		dumpRng: function(r) {
+			return (
+				'startContainer: ' + r.startContainer.nodeName +
+				', startOffset: ' + r.startOffset +
+				', endContainer: ' + r.endContainer.nodeName +
+				', endOffset: ' + r.endOffset
+			);
+		},
+
+		// #endif
+
+		_findSib: function(node, selector, name) {
+			var self = this, func = selector;
+
+			if (node) {
+				// If expression make a function of it using is
+				if (typeof func == 'string') {
+					func = function(node) {
+						return self.is(node, selector);
+					};
+				}
+
+				// Loop all siblings
+				for (node = node[name]; node; node = node[name]) {
+					if (func(node)) {
+						return node;
+					}
+				}
+			}
+
+			return null;
+		}
+	};
+
+	/**
+	 * Instance of DOMUtils for the current document.
+	 *
+	 * @static
+	 * @property DOM
+	 * @type tinymce.dom.DOMUtils
+	 * @example
+	 * // Example of how to add a class to some element by id
+	 * tinymce.DOM.addClass('someid', 'someclass');
+	 */
+	DOMUtils.DOM = new DOMUtils(document);
+
+	return DOMUtils;
+});
+
+// Included from: js/tinymce/classes/dom/ScriptLoader.js
+
+/**
+ * ScriptLoader.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*globals console*/
+
+/**
+ * This class handles asynchronous/synchronous loading of JavaScript files it will execute callbacks
+ * when various items gets loaded. This class is useful to load external JavaScript files.
+ *
+ * @class tinymce.dom.ScriptLoader
+ * @example
+ * // Load a script from a specific URL using the global script loader
+ * tinymce.ScriptLoader.load('somescript.js');
+ *
+ * // Load a script using a unique instance of the script loader
+ * var scriptLoader = new tinymce.dom.ScriptLoader();
+ *
+ * scriptLoader.load('somescript.js');
+ *
+ * // Load multiple scripts
+ * var scriptLoader = new tinymce.dom.ScriptLoader();
+ *
+ * scriptLoader.add('somescript1.js');
+ * scriptLoader.add('somescript2.js');
+ * scriptLoader.add('somescript3.js');
+ *
+ * scriptLoader.loadQueue(function() {
+ *    alert('All scripts are now loaded.');
+ * });
+ */
+define("tinymce/dom/ScriptLoader", [
+	"tinymce/dom/DOMUtils",
+	"tinymce/util/Tools"
+], function(DOMUtils, Tools) {
+	var DOM = DOMUtils.DOM;
+	var each = Tools.each, grep = Tools.grep;
+
+	function ScriptLoader() {
+		var QUEUED = 0,
+			LOADING = 1,
+			LOADED = 2,
+			states = {},
+			queue = [],
+			scriptLoadedCallbacks = {},
+			queueLoadedCallbacks = [],
+			loading = 0,
+			undef;
+
+		/**
+		 * Loads a specific script directly without adding it to the load queue.
+		 *
+		 * @method load
+		 * @param {String} url Absolute URL to script to add.
+		 * @param {function} callback Optional callback function to execute ones this script gets loaded.
+		 * @param {Object} scope Optional scope to execute callback in.
+		 */
+		function loadScript(url, callback) {
+			var dom = DOM, elm, id;
+
+			// Execute callback when script is loaded
+			function done() {
+				dom.remove(id);
+
+				if (elm) {
+					elm.onreadystatechange = elm.onload = elm = null;
+				}
+
+				callback();
+			}
+
+			function error() {
+				/*eslint no-console:0 */
+
+				// Report the error so it's easier for people to spot loading errors
+				if (typeof console !== "undefined" && console.log) {
+					console.log("Failed to load: " + url);
+				}
+
+				// We can't mark it as done if there is a load error since
+				// A) We don't want to produce 404 errors on the server and
+				// B) the onerror event won't fire on all browsers.
+				// done();
+			}
+
+			id = dom.uniqueId();
+
+			// Create new script element
+			elm = document.createElement('script');
+			elm.id = id;
+			elm.type = 'text/javascript';
+			elm.src = Tools._addCacheSuffix(url);
+
+			// Seems that onreadystatechange works better on IE 10 onload seems to fire incorrectly
+			if ("onreadystatechange" in elm) {
+				elm.onreadystatechange = function() {
+					if (/loaded|complete/.test(elm.readyState)) {
+						done();
+					}
+				};
+			} else {
+				elm.onload = done;
+			}
+
+			// Add onerror event will get fired on some browsers but not all of them
+			elm.onerror = error;
+
+			// Add script to document
+			(document.getElementsByTagName('head')[0] || document.body).appendChild(elm);
+		}
+
+		/**
+		 * Returns true/false if a script has been loaded or not.
+		 *
+		 * @method isDone
+		 * @param {String} url URL to check for.
+		 * @return {Boolean} true/false if the URL is loaded.
+		 */
+		this.isDone = function(url) {
+			return states[url] == LOADED;
+		};
+
+		/**
+		 * Marks a specific script to be loaded. This can be useful if a script got loaded outside
+		 * the script loader or to skip it from loading some script.
+		 *
+		 * @method markDone
+		 * @param {string} u Absolute URL to the script to mark as loaded.
+		 */
+		this.markDone = function(url) {
+			states[url] = LOADED;
+		};
+
+		/**
+		 * Adds a specific script to the load queue of the script loader.
+		 *
+		 * @method add
+		 * @param {String} url Absolute URL to script to add.
+		 * @param {function} callback Optional callback function to execute ones this script gets loaded.
+		 * @param {Object} scope Optional scope to execute callback in.
+		 */
+		this.add = this.load = function(url, callback, scope) {
+			var state = states[url];
+
+			// Add url to load queue
+			if (state == undef) {
+				queue.push(url);
+				states[url] = QUEUED;
+			}
+
+			if (callback) {
+				// Store away callback for later execution
+				if (!scriptLoadedCallbacks[url]) {
+					scriptLoadedCallbacks[url] = [];
+				}
+
+				scriptLoadedCallbacks[url].push({
+					func: callback,
+					scope: scope || this
+				});
+			}
+		};
+
+		/**
+		 * Starts the loading of the queue.
+		 *
+		 * @method loadQueue
+		 * @param {function} callback Optional callback to execute when all queued items are loaded.
+		 * @param {Object} scope Optional scope to execute the callback in.
+		 */
+		this.loadQueue = function(callback, scope) {
+			this.loadScripts(queue, callback, scope);
+		};
+
+		/**
+		 * Loads the specified queue of files and executes the callback ones they are loaded.
+		 * This method is generally not used outside this class but it might be useful in some scenarios.
+		 *
+		 * @method loadScripts
+		 * @param {Array} scripts Array of queue items to load.
+		 * @param {function} callback Optional callback to execute ones all items are loaded.
+		 * @param {Object} scope Optional scope to execute callback in.
+		 */
+		this.loadScripts = function(scripts, callback, scope) {
+			var loadScripts;
+
+			function execScriptLoadedCallbacks(url) {
+				// Execute URL callback functions
+				each(scriptLoadedCallbacks[url], function(callback) {
+					callback.func.call(callback.scope);
+				});
+
+				scriptLoadedCallbacks[url] = undef;
+			}
+
+			queueLoadedCallbacks.push({
+				func: callback,
+				scope: scope || this
+			});
+
+			loadScripts = function() {
+				var loadingScripts = grep(scripts);
+
+				// Current scripts has been handled
+				scripts.length = 0;
+
+				// Load scripts that needs to be loaded
+				each(loadingScripts, function(url) {
+					// Script is already loaded then execute script callbacks directly
+					if (states[url] == LOADED) {
+						execScriptLoadedCallbacks(url);
+						return;
+					}
+
+					// Is script not loading then start loading it
+					if (states[url] != LOADING) {
+						states[url] = LOADING;
+						loading++;
+
+						loadScript(url, function() {
+							states[url] = LOADED;
+							loading--;
+
+							execScriptLoadedCallbacks(url);
+
+							// Load more scripts if they where added by the recently loaded script
+							loadScripts();
+						});
+					}
+				});
+
+				// No scripts are currently loading then execute all pending queue loaded callbacks
+				if (!loading) {
+					each(queueLoadedCallbacks, function(callback) {
+						callback.func.call(callback.scope);
+					});
+
+					queueLoadedCallbacks.length = 0;
+				}
+			};
+
+			loadScripts();
+		};
+	}
+
+	ScriptLoader.ScriptLoader = new ScriptLoader();
+
+	return ScriptLoader;
+});
+
+// Included from: js/tinymce/classes/AddOnManager.js
+
+/**
+ * AddOnManager.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles the loading of themes/plugins or other add-ons and their language packs.
+ *
+ * @class tinymce.AddOnManager
+ */
+define("tinymce/AddOnManager", [
+	"tinymce/dom/ScriptLoader",
+	"tinymce/util/Tools"
+], function(ScriptLoader, Tools) {
+	var each = Tools.each;
+
+	function AddOnManager() {
+		var self = this;
+
+		self.items = [];
+		self.urls = {};
+		self.lookup = {};
+	}
+
+	AddOnManager.prototype = {
+		/**
+		 * Returns the specified add on by the short name.
+		 *
+		 * @method get
+		 * @param {String} name Add-on to look for.
+		 * @return {tinymce.Theme/tinymce.Plugin} Theme or plugin add-on instance or undefined.
+		 */
+		get: function(name) {
+			if (this.lookup[name]) {
+				return this.lookup[name].instance;
+			} else {
+				return undefined;
+			}
+		},
+
+		dependencies: function(name) {
+			var result;
+
+			if (this.lookup[name]) {
+				result = this.lookup[name].dependencies;
+			}
+
+			return result || [];
+		},
+
+		/**
+		 * Loads a language pack for the specified add-on.
+		 *
+		 * @method requireLangPack
+		 * @param {String} name Short name of the add-on.
+		 * @param {String} languages Optional comma or space separated list of languages to check if it matches the name.
+		 */
+		requireLangPack: function(name, languages) {
+			var language = AddOnManager.language;
+
+			if (language && AddOnManager.languageLoad !== false) {
+				if (languages) {
+					languages = ',' + languages + ',';
+
+					// Load short form sv.js or long form sv_SE.js
+					if (languages.indexOf(',' + language.substr(0, 2) + ',') != -1) {
+						language = language.substr(0, 2);
+					} else if (languages.indexOf(',' + language + ',') == -1) {
+						return;
+					}
+				}
+
+				ScriptLoader.ScriptLoader.add(this.urls[name] + '/langs/' + language + '.js');
+			}
+		},
+
+		/**
+		 * Adds a instance of the add-on by it's short name.
+		 *
+		 * @method add
+		 * @param {String} id Short name/id for the add-on.
+		 * @param {tinymce.Theme/tinymce.Plugin} addOn Theme or plugin to add.
+		 * @return {tinymce.Theme/tinymce.Plugin} The same theme or plugin instance that got passed in.
+		 * @example
+		 * // Create a simple plugin
+		 * tinymce.create('tinymce.plugins.TestPlugin', {
+		 *   TestPlugin: function(ed, url) {
+		 *   ed.on('click', function(e) {
+		 *      ed.windowManager.alert('Hello World!');
+		 *   });
+		 *   }
+		 * });
+		 *
+		 * // Register plugin using the add method
+		 * tinymce.PluginManager.add('test', tinymce.plugins.TestPlugin);
+		 *
+		 * // Initialize TinyMCE
+		 * tinymce.init({
+		 *  ...
+		 *  plugins: '-test' // Init the plugin but don't try to load it
+		 * });
+		 */
+		add: function(id, addOn, dependencies) {
+			this.items.push(addOn);
+			this.lookup[id] = {instance: addOn, dependencies: dependencies};
+
+			return addOn;
+		},
+
+		createUrl: function(baseUrl, dep) {
+			if (typeof dep === "object") {
+				return dep;
+			} else {
+				return {prefix: baseUrl.prefix, resource: dep, suffix: baseUrl.suffix};
+			}
+		},
+
+		/**
+		 * Add a set of components that will make up the add-on. Using the url of the add-on name as the base url.
+		 * This should be used in development mode.  A new compressor/javascript munger process will ensure that the
+		 * components are put together into the plugin.js file and compressed correctly.
+		 *
+		 * @method addComponents
+		 * @param {String} pluginName name of the plugin to load scripts from (will be used to get the base url for the plugins).
+		 * @param {Array} scripts Array containing the names of the scripts to load.
+		 */
+		addComponents: function(pluginName, scripts) {
+			var pluginUrl = this.urls[pluginName];
+
+			each(scripts, function(script) {
+				ScriptLoader.ScriptLoader.add(pluginUrl + "/" + script);
+			});
+		},
+
+		/**
+		 * Loads an add-on from a specific url.
+		 *
+		 * @method load
+		 * @param {String} name Short name of the add-on that gets loaded.
+		 * @param {String} addOnUrl URL to the add-on that will get loaded.
+		 * @param {function} callback Optional callback to execute ones the add-on is loaded.
+		 * @param {Object} scope Optional scope to execute the callback in.
+		 * @example
+		 * // Loads a plugin from an external URL
+		 * tinymce.PluginManager.load('myplugin', '/some/dir/someplugin/plugin.js');
+		 *
+		 * // Initialize TinyMCE
+		 * tinymce.init({
+		 *  ...
+		 *  plugins: '-myplugin' // Don't try to load it again
+		 * });
+		 */
+		load: function(name, addOnUrl, callback, scope) {
+			var self = this, url = addOnUrl;
+
+			function loadDependencies() {
+				var dependencies = self.dependencies(name);
+
+				each(dependencies, function(dep) {
+					var newUrl = self.createUrl(addOnUrl, dep);
+
+					self.load(newUrl.resource, newUrl, undefined, undefined);
+				});
+
+				if (callback) {
+					if (scope) {
+						callback.call(scope);
+					} else {
+						callback.call(ScriptLoader);
+					}
+				}
+			}
+
+			if (self.urls[name]) {
+				return;
+			}
+
+			if (typeof addOnUrl === "object") {
+				url = addOnUrl.prefix + addOnUrl.resource + addOnUrl.suffix;
+			}
+
+			if (url.indexOf('/') !== 0 && url.indexOf('://') == -1) {
+				url = AddOnManager.baseURL + '/' + url;
+			}
+
+			self.urls[name] = url.substring(0, url.lastIndexOf('/'));
+
+			if (self.lookup[name]) {
+				loadDependencies();
+			} else {
+				ScriptLoader.ScriptLoader.add(url, loadDependencies, scope);
+			}
+		}
+	};
+
+	AddOnManager.PluginManager = new AddOnManager();
+	AddOnManager.ThemeManager = new AddOnManager();
+
+	return AddOnManager;
+});
+
+/**
+ * TinyMCE theme class.
+ *
+ * @class tinymce.Theme
+ */
+
+/**
+ * This method is responsible for rendering/generating the overall user interface with toolbars, buttons, iframe containers etc.
+ *
+ * @method renderUI
+ * @param {Object} obj Object parameter containing the targetNode DOM node that will be replaced visually with an editor instance.
+ * @return {Object} an object with items like iframeContainer, editorContainer, sizeContainer, deltaWidth, deltaHeight.
+ */
+
+/**
+ * Plugin base class, this is a pseudo class that describes how a plugin is to be created for TinyMCE. The methods below are all optional.
+ *
+ * @class tinymce.Plugin
+ * @example
+ * tinymce.PluginManager.add('example', function(editor, url) {
+ *     // Add a button that opens a window
+ *     editor.addButton('example', {
+ *         text: 'My button',
+ *         icon: false,
+ *         onclick: function() {
+ *             // Open window
+ *             editor.windowManager.open({
+ *                 title: 'Example plugin',
+ *                 body: [
+ *                     {type: 'textbox', name: 'title', label: 'Title'}
+ *                 ],
+ *                 onsubmit: function(e) {
+ *                     // Insert content when the window form is submitted
+ *                     editor.insertContent('Title: ' + e.data.title);
+ *                 }
+ *             });
+ *         }
+ *     });
+ *
+ *     // Adds a menu item to the tools menu
+ *     editor.addMenuItem('example', {
+ *         text: 'Example plugin',
+ *         context: 'tools',
+ *         onclick: function() {
+ *             // Open window with a specific url
+ *             editor.windowManager.open({
+ *                 title: 'TinyMCE site',
+ *                 url: 'http://www.tinymce.com',
+ *                 width: 800,
+ *                 height: 600,
+ *                 buttons: [{
+ *                     text: 'Close',
+ *                     onclick: 'close'
+ *                 }]
+ *             });
+ *         }
+ *     });
+ * });
+ */
+
+// Included from: js/tinymce/classes/dom/RangeUtils.js
+
+/**
+ * RangeUtils.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class contains a few utility methods for ranges.
+ *
+ * @class tinymce.dom.RangeUtils
+ */
+define("tinymce/dom/RangeUtils", [
+	"tinymce/util/Tools",
+	"tinymce/dom/TreeWalker"
+], function(Tools, TreeWalker) {
+	var each = Tools.each;
+
+	function getEndChild(container, index) {
+		var childNodes = container.childNodes;
+
+		index--;
+
+		if (index > childNodes.length - 1) {
+			index = childNodes.length - 1;
+		} else if (index < 0) {
+			index = 0;
+		}
+
+		return childNodes[index] || container;
+	}
+
+	function RangeUtils(dom) {
+		/**
+		 * Walks the specified range like object and executes the callback for each sibling collection it finds.
+		 *
+		 * @method walk
+		 * @param {Object} rng Range like object.
+		 * @param {function} callback Callback function to execute for each sibling collection.
+		 */
+		this.walk = function(rng, callback) {
+			var startContainer = rng.startContainer,
+				startOffset = rng.startOffset,
+				endContainer = rng.endContainer,
+				endOffset = rng.endOffset,
+				ancestor, startPoint,
+				endPoint, node, parent, siblings, nodes;
+
+			// Handle table cell selection the table plugin enables
+			// you to fake select table cells and perform formatting actions on them
+			nodes = dom.select('td.mce-item-selected,th.mce-item-selected');
+			if (nodes.length > 0) {
+				each(nodes, function(node) {
+					callback([node]);
+				});
+
+				return;
+			}
+
+			/**
+			 * Excludes start/end text node if they are out side the range
+			 *
+			 * @private
+			 * @param {Array} nodes Nodes to exclude items from.
+			 * @return {Array} Array with nodes excluding the start/end container if needed.
+			 */
+			function exclude(nodes) {
+				var node;
+
+				// First node is excluded
+				node = nodes[0];
+				if (node.nodeType === 3 && node === startContainer && startOffset >= node.nodeValue.length) {
+					nodes.splice(0, 1);
+				}
+
+				// Last node is excluded
+				node = nodes[nodes.length - 1];
+				if (endOffset === 0 && nodes.length > 0 && node === endContainer && node.nodeType === 3) {
+					nodes.splice(nodes.length - 1, 1);
+				}
+
+				return nodes;
+			}
+
+			/**
+			 * Collects siblings
+			 *
+			 * @private
+			 * @param {Node} node Node to collect siblings from.
+			 * @param {String} name Name of the sibling to check for.
+			 * @return {Array} Array of collected siblings.
+			 */
+			function collectSiblings(node, name, end_node) {
+				var siblings = [];
+
+				for (; node && node != end_node; node = node[name]) {
+					siblings.push(node);
+				}
+
+				return siblings;
+			}
+
+			/**
+			 * Find an end point this is the node just before the common ancestor root.
+			 *
+			 * @private
+			 * @param {Node} node Node to start at.
+			 * @param {Node} root Root/ancestor element to stop just before.
+			 * @return {Node} Node just before the root element.
+			 */
+			function findEndPoint(node, root) {
+				do {
+					if (node.parentNode == root) {
+						return node;
+					}
+
+					node = node.parentNode;
+				} while (node);
+			}
+
+			function walkBoundary(start_node, end_node, next) {
+				var siblingName = next ? 'nextSibling' : 'previousSibling';
+
+				for (node = start_node, parent = node.parentNode; node && node != end_node; node = parent) {
+					parent = node.parentNode;
+					siblings = collectSiblings(node == start_node ? node : node[siblingName], siblingName);
+
+					if (siblings.length) {
+						if (!next) {
+							siblings.reverse();
+						}
+
+						callback(exclude(siblings));
+					}
+				}
+			}
+
+			// If index based start position then resolve it
+			if (startContainer.nodeType == 1 && startContainer.hasChildNodes()) {
+				startContainer = startContainer.childNodes[startOffset];
+			}
+
+			// If index based end position then resolve it
+			if (endContainer.nodeType == 1 && endContainer.hasChildNodes()) {
+				endContainer = getEndChild(endContainer, endOffset);
+			}
+
+			// Same container
+			if (startContainer == endContainer) {
+				return callback(exclude([startContainer]));
+			}
+
+			// Find common ancestor and end points
+			ancestor = dom.findCommonAncestor(startContainer, endContainer);
+
+			// Process left side
+			for (node = startContainer; node; node = node.parentNode) {
+				if (node === endContainer) {
+					return walkBoundary(startContainer, ancestor, true);
+				}
+
+				if (node === ancestor) {
+					break;
+				}
+			}
+
+			// Process right side
+			for (node = endContainer; node; node = node.parentNode) {
+				if (node === startContainer) {
+					return walkBoundary(endContainer, ancestor);
+				}
+
+				if (node === ancestor) {
+					break;
+				}
+			}
+
+			// Find start/end point
+			startPoint = findEndPoint(startContainer, ancestor) || startContainer;
+			endPoint = findEndPoint(endContainer, ancestor) || endContainer;
+
+			// Walk left leaf
+			walkBoundary(startContainer, startPoint, true);
+
+			// Walk the middle from start to end point
+			siblings = collectSiblings(
+				startPoint == startContainer ? startPoint : startPoint.nextSibling,
+				'nextSibling',
+				endPoint == endContainer ? endPoint.nextSibling : endPoint
+			);
+
+			if (siblings.length) {
+				callback(exclude(siblings));
+			}
+
+			// Walk right leaf
+			walkBoundary(endContainer, endPoint);
+		};
+
+		/**
+		 * Splits the specified range at it's start/end points.
+		 *
+		 * @private
+		 * @param {Range/RangeObject} rng Range to split.
+		 * @return {Object} Range position object.
+		 */
+		this.split = function(rng) {
+			var startContainer = rng.startContainer,
+				startOffset = rng.startOffset,
+				endContainer = rng.endContainer,
+				endOffset = rng.endOffset;
+
+			function splitText(node, offset) {
+				return node.splitText(offset);
+			}
+
+			// Handle single text node
+			if (startContainer == endContainer && startContainer.nodeType == 3) {
+				if (startOffset > 0 && startOffset < startContainer.nodeValue.length) {
+					endContainer = splitText(startContainer, startOffset);
+					startContainer = endContainer.previousSibling;
+
+					if (endOffset > startOffset) {
+						endOffset = endOffset - startOffset;
+						startContainer = endContainer = splitText(endContainer, endOffset).previousSibling;
+						endOffset = endContainer.nodeValue.length;
+						startOffset = 0;
+					} else {
+						endOffset = 0;
+					}
+				}
+			} else {
+				// Split startContainer text node if needed
+				if (startContainer.nodeType == 3 && startOffset > 0 && startOffset < startContainer.nodeValue.length) {
+					startContainer = splitText(startContainer, startOffset);
+					startOffset = 0;
+				}
+
+				// Split endContainer text node if needed
+				if (endContainer.nodeType == 3 && endOffset > 0 && endOffset < endContainer.nodeValue.length) {
+					endContainer = splitText(endContainer, endOffset).previousSibling;
+					endOffset = endContainer.nodeValue.length;
+				}
+			}
+
+			return {
+				startContainer: startContainer,
+				startOffset: startOffset,
+				endContainer: endContainer,
+				endOffset: endOffset
+			};
+		};
+
+		/**
+		 * Normalizes the specified range by finding the closest best suitable caret location.
+		 *
+		 * @private
+		 * @param {Range} rng Range to normalize.
+		 * @return {Boolean} True/false if the specified range was normalized or not.
+		 */
+		this.normalize = function(rng) {
+			var normalized, collapsed;
+
+			function normalizeEndPoint(start) {
+				var container, offset, walker, body = dom.getRoot(), node, nonEmptyElementsMap;
+				var directionLeft, isAfterNode;
+
+				function hasBrBeforeAfter(node, left) {
+					var walker = new TreeWalker(node, dom.getParent(node.parentNode, dom.isBlock) || body);
+
+					while ((node = walker[left ? 'prev' : 'next']())) {
+						if (node.nodeName === "BR") {
+							return true;
+						}
+					}
+				}
+
+				function isPrevNode(node, name) {
+					return node.previousSibling && node.previousSibling.nodeName == name;
+				}
+
+				// Walks the dom left/right to find a suitable text node to move the endpoint into
+				// It will only walk within the current parent block or body and will stop if it hits a block or a BR/IMG
+				function findTextNodeRelative(left, startNode) {
+					var walker, lastInlineElement, parentBlockContainer;
+
+					startNode = startNode || container;
+					parentBlockContainer = dom.getParent(startNode.parentNode, dom.isBlock) || body;
+
+					// Lean left before the BR element if it's the only BR within a block element. Gecko bug: #6680
+					// This: <p><br>|</p> becomes <p>|<br></p>
+					if (left && startNode.nodeName == 'BR' && isAfterNode && dom.isEmpty(parentBlockContainer)) {
+						container = startNode.parentNode;
+						offset = dom.nodeIndex(startNode);
+						normalized = true;
+						return;
+					}
+
+					// Walk left until we hit a text node we can move to or a block/br/img
+					walker = new TreeWalker(startNode, parentBlockContainer);
+					while ((node = walker[left ? 'prev' : 'next']())) {
+						// Break if we hit a non content editable node
+						if (dom.getContentEditableParent(node) === "false") {
+							return;
+						}
+
+						// Found text node that has a length
+						if (node.nodeType === 3 && node.nodeValue.length > 0) {
+							container = node;
+							offset = left ? node.nodeValue.length : 0;
+							normalized = true;
+							return;
+						}
+
+						// Break if we find a block or a BR/IMG/INPUT etc
+						if (dom.isBlock(node) || nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
+							return;
+						}
+
+						lastInlineElement = node;
+					}
+
+					// Only fetch the last inline element when in caret mode for now
+					if (collapsed && lastInlineElement) {
+						container = lastInlineElement;
+						normalized = true;
+						offset = 0;
+					}
+				}
+
+				container = rng[(start ? 'start' : 'end') + 'Container'];
+				offset = rng[(start ? 'start' : 'end') + 'Offset'];
+				isAfterNode = container.nodeType == 1 && offset === container.childNodes.length;
+				nonEmptyElementsMap = dom.schema.getNonEmptyElements();
+				directionLeft = start;
+
+				if (container.nodeType == 1 && offset > container.childNodes.length - 1) {
+					directionLeft = false;
+				}
+
+				// If the container is a document move it to the body element
+				if (container.nodeType === 9) {
+					container = dom.getRoot();
+					offset = 0;
+				}
+
+				// If the container is body try move it into the closest text node or position
+				if (container === body) {
+					// If start is before/after a image, table etc
+					if (directionLeft) {
+						node = container.childNodes[offset > 0 ? offset - 1 : 0];
+						if (node) {
+							if (nonEmptyElementsMap[node.nodeName] || node.nodeName == "TABLE") {
+								return;
+							}
+						}
+					}
+
+					// Resolve the index
+					if (container.hasChildNodes()) {
+						offset = Math.min(!directionLeft && offset > 0 ? offset - 1 : offset, container.childNodes.length - 1);
+						container = container.childNodes[offset];
+						offset = 0;
+
+						// Don't walk into elements that doesn't have any child nodes like a IMG
+						if (container.hasChildNodes() && !/TABLE/.test(container.nodeName)) {
+							// Walk the DOM to find a text node to place the caret at or a BR
+							node = container;
+							walker = new TreeWalker(container, body);
+
+							do {
+								// Found a text node use that position
+								if (node.nodeType === 3 && node.nodeValue.length > 0) {
+									offset = directionLeft ? 0 : node.nodeValue.length;
+									container = node;
+									normalized = true;
+									break;
+								}
+
+								// Found a BR/IMG element that we can place the caret before
+								if (nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
+									offset = dom.nodeIndex(node);
+									container = node.parentNode;
+
+									// Put caret after image when moving the end point
+									if (node.nodeName == "IMG" && !directionLeft) {
+										offset++;
+									}
+
+									normalized = true;
+									break;
+								}
+							} while ((node = (directionLeft ? walker.next() : walker.prev())));
+						}
+					}
+				}
+
+				// Lean the caret to the left if possible
+				if (collapsed) {
+					// So this: <b>x</b><i>|x</i>
+					// Becomes: <b>x|</b><i>x</i>
+					// Seems that only gecko has issues with this
+					if (container.nodeType === 3 && offset === 0) {
+						findTextNodeRelative(true);
+					}
+
+					// Lean left into empty inline elements when the caret is before a BR
+					// So this: <i><b></b><i>|<br></i>
+					// Becomes: <i><b>|</b><i><br></i>
+					// Seems that only gecko has issues with this.
+					// Special edge case for <p><a>x</a>|<br></p> since we don't want <p><a>x|</a><br></p>
+					if (container.nodeType === 1) {
+						node = container.childNodes[offset];
+
+						// Offset is after the containers last child
+						// then use the previous child for normalization
+						if (!node) {
+							node = container.childNodes[offset - 1];
+						}
+
+						if (node && node.nodeName === 'BR' && !isPrevNode(node, 'A') &&
+							!hasBrBeforeAfter(node) && !hasBrBeforeAfter(node, true)) {
+							findTextNodeRelative(true, node);
+						}
+					}
+				}
+
+				// Lean the start of the selection right if possible
+				// So this: x[<b>x]</b>
+				// Becomes: x<b>[x]</b>
+				if (directionLeft && !collapsed && container.nodeType === 3 && offset === container.nodeValue.length) {
+					findTextNodeRelative(false);
+				}
+
+				// Set endpoint if it was normalized
+				if (normalized) {
+					rng['set' + (start ? 'Start' : 'End')](container, offset);
+				}
+			}
+
+			collapsed = rng.collapsed;
+
+			normalizeEndPoint(true);
+
+			if (!collapsed) {
+				normalizeEndPoint();
+			}
+
+			// If it was collapsed then make sure it still is
+			if (normalized && collapsed) {
+				rng.collapse(true);
+			}
+
+			return normalized;
+		};
+	}
+
+	/**
+	 * Compares two ranges and checks if they are equal.
+	 *
+	 * @static
+	 * @method compareRanges
+	 * @param {DOMRange} rng1 First range to compare.
+	 * @param {DOMRange} rng2 First range to compare.
+	 * @return {Boolean} true/false if the ranges are equal.
+	 */
+	RangeUtils.compareRanges = function(rng1, rng2) {
+		if (rng1 && rng2) {
+			// Compare native IE ranges
+			if (rng1.item || rng1.duplicate) {
+				// Both are control ranges and the selected element matches
+				if (rng1.item && rng2.item && rng1.item(0) === rng2.item(0)) {
+					return true;
+				}
+
+				// Both are text ranges and the range matches
+				if (rng1.isEqual && rng2.isEqual && rng2.isEqual(rng1)) {
+					return true;
+				}
+			} else {
+				// Compare w3c ranges
+				return rng1.startContainer == rng2.startContainer && rng1.startOffset == rng2.startOffset;
+			}
+		}
+
+		return false;
+	};
+
+	/**
+	 * Gets the caret range for the given x/y location.
+	 *
+	 * @static
+	 * @method getCaretRangeFromPoint
+	 * @param {Number} x X coordinate for range
+	 * @param {Number} y Y coordinate for range
+	 * @param {Document} doc Document that x/y are relative to
+	 * @returns {Range} caret range
+	 */
+	RangeUtils.getCaretRangeFromPoint = function(x, y, doc) {
+		var rng, point;
+
+		if (doc.caretPositionFromPoint) {
+			point = doc.caretPositionFromPoint(x, y);
+			rng = doc.createRange();
+			rng.setStart(point.offsetNode, point.offset);
+			rng.collapse(true);
+		} else if (doc.caretRangeFromPoint) {
+			rng = doc.caretRangeFromPoint(x, y);
+		} else if (doc.body.createTextRange) {
+			rng = doc.body.createTextRange();
+
+			try {
+				rng.moveToPoint(x, y);
+				rng.collapse(true);
+			} catch (ex) {
+				// Append to top or bottom depending on drop location
+				rng.collapse(y < doc.body.clientHeight);
+			}
+		}
+
+		return rng;
+	};
+
+	RangeUtils.getNode = function(container, offset) {
+		if (container.nodeType == 1 && container.hasChildNodes()) {
+			if (offset >= container.childNodes.length) {
+				offset = container.childNodes.length - 1;
+			}
+
+			container = container.childNodes[offset];
+		}
+
+		return container;
+	};
+
+	return RangeUtils;
+});
+
+// Included from: js/tinymce/classes/NodeChange.js
+
+/**
+ * NodeChange.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles the nodechange event dispatching both manual and though selection change events.
+ *
+ * @class tinymce.NodeChange
+ * @private
+ */
+define("tinymce/NodeChange", [
+	"tinymce/dom/RangeUtils",
+	"tinymce/Env"
+], function(RangeUtils, Env) {
+	return function(editor) {
+		var lastRng, lastPath = [];
+
+		/**
+		 * Returns true/false if the current element path has been changed or not.
+		 *
+		 * @private
+		 * @return {Boolean} True if the element path is the same false if it's not.
+		 */
+		function isSameElementPath(startElm) {
+			var i, currentPath;
+
+			currentPath = editor.$(startElm).parentsUntil(editor.getBody()).add(startElm);
+			if (currentPath.length === lastPath.length) {
+				for (i = currentPath.length; i >= 0; i--) {
+					if (currentPath[i] !== lastPath[i]) {
+						break;
+					}
+				}
+
+				if (i === -1) {
+					lastPath = currentPath;
+					return true;
+				}
+			}
+
+			lastPath = currentPath;
+
+			return false;
+		}
+
+		// Gecko doesn't support the "selectionchange" event
+		if (!('onselectionchange' in editor.getDoc())) {
+			editor.on('NodeChange Click MouseUp KeyUp Focus', function(e) {
+				var nativeRng, fakeRng;
+
+				// Since DOM Ranges mutate on modification
+				// of the DOM we need to clone it's contents
+				nativeRng = editor.selection.getRng();
+				fakeRng = {
+					startContainer: nativeRng.startContainer,
+					startOffset: nativeRng.startOffset,
+					endContainer: nativeRng.endContainer,
+					endOffset: nativeRng.endOffset
+				};
+
+				// Always treat nodechange as a selectionchange since applying
+				// formatting to the current range wouldn't update the range but it's parent
+				if (e.type == 'nodechange' || !RangeUtils.compareRanges(fakeRng, lastRng)) {
+					editor.fire('SelectionChange');
+				}
+
+				lastRng = fakeRng;
+			});
+		}
+
+		// IE has a bug where it fires a selectionchange on right click that has a range at the start of the body
+		// When the contextmenu event fires the selection is located at the right location
+		editor.on('contextmenu', function() {
+			editor.fire('SelectionChange');
+		});
+
+		// Selection change is delayed ~200ms on IE when you click inside the current range
+		editor.on('SelectionChange', function() {
+			var startElm = editor.selection.getStart(true);
+
+			// IE 8 will fire a selectionchange event with an incorrect selection
+			// when focusing out of table cells. Click inside cell -> toolbar = Invalid SelectionChange event
+			if (!Env.range && editor.selection.isCollapsed()) {
+				return;
+			}
+
+			if (!isSameElementPath(startElm) && editor.dom.isChildOf(startElm, editor.getBody())) {
+				editor.nodeChanged({selectionChange: true});
+			}
+		});
+
+		// Fire an extra nodeChange on mouseup for compatibility reasons
+		editor.on('MouseUp', function(e) {
+			if (!e.isDefaultPrevented()) {
+				// Delay nodeChanged call for WebKit edge case issue where the range
+				// isn't updated until after you click outside a selected image
+				if (editor.selection.getNode().nodeName == 'IMG') {
+					setTimeout(function() {
+						editor.nodeChanged();
+					}, 0);
+				} else {
+					editor.nodeChanged();
+				}
+			}
+		});
+
+		/**
+		 * Distpaches out a onNodeChange event to all observers. This method should be called when you
+		 * need to update the UI states or element path etc.
+		 *
+		 * @method nodeChanged
+		 * @param {Object} args Optional args to pass to NodeChange event handlers.
+		 */
+		this.nodeChanged = function(args) {
+			var selection = editor.selection, node, parents, root;
+
+			// Fix for bug #1896577 it seems that this can not be fired while the editor is loading
+			if (editor.initialized && selection && !editor.settings.disable_nodechange && !editor.settings.readonly) {
+				// Get start node
+				root = editor.getBody();
+				node = selection.getStart() || root;
+				node = node.ownerDocument != editor.getDoc() ? editor.getBody() : node;
+
+				// Edge case for <p>|<img></p>
+				if (node.nodeName == 'IMG' && selection.isCollapsed()) {
+					node = node.parentNode;
+				}
+
+				// Get parents and add them to object
+				parents = [];
+				editor.dom.getParent(node, function(node) {
+					if (node === root) {
+						return true;
+					}
+
+					parents.push(node);
+				});
+
+				args = args || {};
+				args.element = node;
+				args.parents = parents;
+
+				editor.fire('NodeChange', args);
+			}
+		};
+	};
+});
+
+// Included from: js/tinymce/classes/html/Node.js
+
+/**
+ * Node.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is a minimalistic implementation of a DOM like node used by the DomParser class.
+ *
+ * @example
+ * var node = new tinymce.html.Node('strong', 1);
+ * someRoot.append(node);
+ *
+ * @class tinymce.html.Node
+ * @version 3.4
+ */
+define("tinymce/html/Node", [], function() {
+	var whiteSpaceRegExp = /^[ \t\r\n]*$/, typeLookup = {
+		'#text': 3,
+		'#comment': 8,
+		'#cdata': 4,
+		'#pi': 7,
+		'#doctype': 10,
+		'#document-fragment': 11
+	};
+
+	// Walks the tree left/right
+	function walk(node, root_node, prev) {
+		var sibling, parent, startName = prev ? 'lastChild' : 'firstChild', siblingName = prev ? 'prev' : 'next';
+
+		// Walk into nodes if it has a start
+		if (node[startName]) {
+			return node[startName];
+		}
+
+		// Return the sibling if it has one
+		if (node !== root_node) {
+			sibling = node[siblingName];
+
+			if (sibling) {
+				return sibling;
+			}
+
+			// Walk up the parents to look for siblings
+			for (parent = node.parent; parent && parent !== root_node; parent = parent.parent) {
+				sibling = parent[siblingName];
+
+				if (sibling) {
+					return sibling;
+				}
+			}
+		}
+	}
+
+	/**
+	 * Constructs a new Node instance.
+	 *
+	 * @constructor
+	 * @method Node
+	 * @param {String} name Name of the node type.
+	 * @param {Number} type Numeric type representing the node.
+	 */
+	function Node(name, type) {
+		this.name = name;
+		this.type = type;
+
+		if (type === 1) {
+			this.attributes = [];
+			this.attributes.map = {};
+		}
+	}
+
+	Node.prototype = {
+		/**
+		 * Replaces the current node with the specified one.
+		 *
+		 * @example
+		 * someNode.replace(someNewNode);
+		 *
+		 * @method replace
+		 * @param {tinymce.html.Node} node Node to replace the current node with.
+		 * @return {tinymce.html.Node} The old node that got replaced.
+		 */
+		replace: function(node) {
+			var self = this;
+
+			if (node.parent) {
+				node.remove();
+			}
+
+			self.insert(node, self);
+			self.remove();
+
+			return self;
+		},
+
+		/**
+		 * Gets/sets or removes an attribute by name.
+		 *
+		 * @example
+		 * someNode.attr("name", "value"); // Sets an attribute
+		 * console.log(someNode.attr("name")); // Gets an attribute
+		 * someNode.attr("name", null); // Removes an attribute
+		 *
+		 * @method attr
+		 * @param {String} name Attribute name to set or get.
+		 * @param {String} value Optional value to set.
+		 * @return {String/tinymce.html.Node} String or undefined on a get operation or the current node on a set operation.
+		 */
+		attr: function(name, value) {
+			var self = this, attrs, i, undef;
+
+			if (typeof name !== "string") {
+				for (i in name) {
+					self.attr(i, name[i]);
+				}
+
+				return self;
+			}
+
+			if ((attrs = self.attributes)) {
+				if (value !== undef) {
+					// Remove attribute
+					if (value === null) {
+						if (name in attrs.map) {
+							delete attrs.map[name];
+
+							i = attrs.length;
+							while (i--) {
+								if (attrs[i].name === name) {
+									attrs = attrs.splice(i, 1);
+									return self;
+								}
+							}
+						}
+
+						return self;
+					}
+
+					// Set attribute
+					if (name in attrs.map) {
+						// Set attribute
+						i = attrs.length;
+						while (i--) {
+							if (attrs[i].name === name) {
+								attrs[i].value = value;
+								break;
+							}
+						}
+					} else {
+						attrs.push({name: name, value: value});
+					}
+
+					attrs.map[name] = value;
+
+					return self;
+				} else {
+					return attrs.map[name];
+				}
+			}
+		},
+
+		/**
+		 * Does a shallow clones the node into a new node. It will also exclude id attributes since
+		 * there should only be one id per document.
+		 *
+		 * @example
+		 * var clonedNode = node.clone();
+		 *
+		 * @method clone
+		 * @return {tinymce.html.Node} New copy of the original node.
+		 */
+		clone: function() {
+			var self = this, clone = new Node(self.name, self.type), i, l, selfAttrs, selfAttr, cloneAttrs;
+
+			// Clone element attributes
+			if ((selfAttrs = self.attributes)) {
+				cloneAttrs = [];
+				cloneAttrs.map = {};
+
+				for (i = 0, l = selfAttrs.length; i < l; i++) {
+					selfAttr = selfAttrs[i];
+
+					// Clone everything except id
+					if (selfAttr.name !== 'id') {
+						cloneAttrs[cloneAttrs.length] = {name: selfAttr.name, value: selfAttr.value};
+						cloneAttrs.map[selfAttr.name] = selfAttr.value;
+					}
+				}
+
+				clone.attributes = cloneAttrs;
+			}
+
+			clone.value = self.value;
+			clone.shortEnded = self.shortEnded;
+
+			return clone;
+		},
+
+		/**
+		 * Wraps the node in in another node.
+		 *
+		 * @example
+		 * node.wrap(wrapperNode);
+		 *
+		 * @method wrap
+		 */
+		wrap: function(wrapper) {
+			var self = this;
+
+			self.parent.insert(wrapper, self);
+			wrapper.append(self);
+
+			return self;
+		},
+
+		/**
+		 * Unwraps the node in other words it removes the node but keeps the children.
+		 *
+		 * @example
+		 * node.unwrap();
+		 *
+		 * @method unwrap
+		 */
+		unwrap: function() {
+			var self = this, node, next;
+
+			for (node = self.firstChild; node;) {
+				next = node.next;
+				self.insert(node, self, true);
+				node = next;
+			}
+
+			self.remove();
+		},
+
+		/**
+		 * Removes the node from it's parent.
+		 *
+		 * @example
+		 * node.remove();
+		 *
+		 * @method remove
+		 * @return {tinymce.html.Node} Current node that got removed.
+		 */
+		remove: function() {
+			var self = this, parent = self.parent, next = self.next, prev = self.prev;
+
+			if (parent) {
+				if (parent.firstChild === self) {
+					parent.firstChild = next;
+
+					if (next) {
+						next.prev = null;
+					}
+				} else {
+					prev.next = next;
+				}
+
+				if (parent.lastChild === self) {
+					parent.lastChild = prev;
+
+					if (prev) {
+						prev.next = null;
+					}
+				} else {
+					next.prev = prev;
+				}
+
+				self.parent = self.next = self.prev = null;
+			}
+
+			return self;
+		},
+
+		/**
+		 * Appends a new node as a child of the current node.
+		 *
+		 * @example
+		 * node.append(someNode);
+		 *
+		 * @method append
+		 * @param {tinymce.html.Node} node Node to append as a child of the current one.
+		 * @return {tinymce.html.Node} The node that got appended.
+		 */
+		append: function(node) {
+			var self = this, last;
+
+			if (node.parent) {
+				node.remove();
+			}
+
+			last = self.lastChild;
+			if (last) {
+				last.next = node;
+				node.prev = last;
+				self.lastChild = node;
+			} else {
+				self.lastChild = self.firstChild = node;
+			}
+
+			node.parent = self;
+
+			return node;
+		},
+
+		/**
+		 * Inserts a node at a specific position as a child of the current node.
+		 *
+		 * @example
+		 * parentNode.insert(newChildNode, oldChildNode);
+		 *
+		 * @method insert
+		 * @param {tinymce.html.Node} node Node to insert as a child of the current node.
+		 * @param {tinymce.html.Node} ref_node Reference node to set node before/after.
+		 * @param {Boolean} before Optional state to insert the node before the reference node.
+		 * @return {tinymce.html.Node} The node that got inserted.
+		 */
+		insert: function(node, ref_node, before) {
+			var parent;
+
+			if (node.parent) {
+				node.remove();
+			}
+
+			parent = ref_node.parent || this;
+
+			if (before) {
+				if (ref_node === parent.firstChild) {
+					parent.firstChild = node;
+				} else {
+					ref_node.prev.next = node;
+				}
+
+				node.prev = ref_node.prev;
+				node.next = ref_node;
+				ref_node.prev = node;
+			} else {
+				if (ref_node === parent.lastChild) {
+					parent.lastChild = node;
+				} else {
+					ref_node.next.prev = node;
+				}
+
+				node.next = ref_node.next;
+				node.prev = ref_node;
+				ref_node.next = node;
+			}
+
+			node.parent = parent;
+
+			return node;
+		},
+
+		/**
+		 * Get all children by name.
+		 *
+		 * @method getAll
+		 * @param {String} name Name of the child nodes to collect.
+		 * @return {Array} Array with child nodes matchin the specified name.
+		 */
+		getAll: function(name) {
+			var self = this, node, collection = [];
+
+			for (node = self.firstChild; node; node = walk(node, self)) {
+				if (node.name === name) {
+					collection.push(node);
+				}
+			}
+
+			return collection;
+		},
+
+		/**
+		 * Removes all children of the current node.
+		 *
+		 * @method empty
+		 * @return {tinymce.html.Node} The current node that got cleared.
+		 */
+		empty: function() {
+			var self = this, nodes, i, node;
+
+			// Remove all children
+			if (self.firstChild) {
+				nodes = [];
+
+				// Collect the children
+				for (node = self.firstChild; node; node = walk(node, self)) {
+					nodes.push(node);
+				}
+
+				// Remove the children
+				i = nodes.length;
+				while (i--) {
+					node = nodes[i];
+					node.parent = node.firstChild = node.lastChild = node.next = node.prev = null;
+				}
+			}
+
+			self.firstChild = self.lastChild = null;
+
+			return self;
+		},
+
+		/**
+		 * Returns true/false if the node is to be considered empty or not.
+		 *
+		 * @example
+		 * node.isEmpty({img: true});
+		 * @method isEmpty
+		 * @param {Object} elements Name/value object with elements that are automatically treated as non empty elements.
+		 * @return {Boolean} true/false if the node is empty or not.
+		 */
+		isEmpty: function(elements) {
+			var self = this, node = self.firstChild, i, name;
+
+			if (node) {
+				do {
+					if (node.type === 1) {
+						// Ignore bogus elements
+						if (node.attributes.map['data-mce-bogus']) {
+							continue;
+						}
+
+						// Keep empty elements like <img />
+						if (elements[node.name]) {
+							return false;
+						}
+
+						// Keep bookmark nodes and name attribute like <a name="1"></a>
+						i = node.attributes.length;
+						while (i--) {
+							name = node.attributes[i].name;
+							if (name === "name" || name.indexOf('data-mce-bookmark') === 0) {
+								return false;
+							}
+						}
+					}
+
+					// Keep comments
+					if (node.type === 8) {
+						return false;
+					}
+
+					// Keep non whitespace text nodes
+					if ((node.type === 3 && !whiteSpaceRegExp.test(node.value))) {
+						return false;
+					}
+				} while ((node = walk(node, self)));
+			}
+
+			return true;
+		},
+
+		/**
+		 * Walks to the next or previous node and returns that node or null if it wasn't found.
+		 *
+		 * @method walk
+		 * @param {Boolean} prev Optional previous node state defaults to false.
+		 * @return {tinymce.html.Node} Node that is next to or previous of the current node.
+		 */
+		walk: function(prev) {
+			return walk(this, null, prev);
+		}
+	};
+
+	/**
+	 * Creates a node of a specific type.
+	 *
+	 * @static
+	 * @method create
+	 * @param {String} name Name of the node type to create for example "b" or "#text".
+	 * @param {Object} attrs Name/value collection of attributes that will be applied to elements.
+	 */
+	Node.create = function(name, attrs) {
+		var node, attrName;
+
+		// Create node
+		node = new Node(name, typeLookup[name] || 1);
+
+		// Add attributes if needed
+		if (attrs) {
+			for (attrName in attrs) {
+				node.attr(attrName, attrs[attrName]);
+			}
+		}
+
+		return node;
+	};
+
+	return Node;
+});
+
+// Included from: js/tinymce/classes/html/Schema.js
+
+/**
+ * Schema.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Schema validator class.
+ *
+ * @class tinymce.html.Schema
+ * @example
+ *  if (tinymce.activeEditor.schema.isValidChild('p', 'span'))
+ *    alert('span is valid child of p.');
+ *
+ *  if (tinymce.activeEditor.schema.getElementRule('p'))
+ *    alert('P is a valid element.');
+ *
+ * @class tinymce.html.Schema
+ * @version 3.4
+ */
+define("tinymce/html/Schema", [
+	"tinymce/util/Tools"
+], function(Tools) {
+	var mapCache = {}, dummyObj = {};
+	var makeMap = Tools.makeMap, each = Tools.each, extend = Tools.extend, explode = Tools.explode, inArray = Tools.inArray;
+
+	function split(items, delim) {
+		return items ? items.split(delim || ' ') : [];
+	}
+
+	/**
+	 * Builds a schema lookup table
+	 *
+	 * @private
+	 * @param {String} type html4, html5 or html5-strict schema type.
+	 * @return {Object} Schema lookup table.
+	 */
+	function compileSchema(type) {
+		var schema = {}, globalAttributes, blockContent;
+		var phrasingContent, flowContent, html4BlockContent, html4PhrasingContent;
+
+		function add(name, attributes, children) {
+			var ni, i, attributesOrder, args = arguments;
+
+			function arrayToMap(array, obj) {
+				var map = {}, i, l;
+
+				for (i = 0, l = array.length; i < l; i++) {
+					map[array[i]] = obj || {};
+				}
+
+				return map;
+			}
+
+			children = children || [];
+			attributes = attributes || "";
+
+			if (typeof children === "string") {
+				children = split(children);
+			}
+
+			// Split string children
+			for (i = 3; i < args.length; i++) {
+				if (typeof args[i] === "string") {
+					args[i] = split(args[i]);
+				}
+
+				children.push.apply(children, args[i]);
+			}
+
+			name = split(name);
+			ni = name.length;
+			while (ni--) {
+				attributesOrder = [].concat(globalAttributes, split(attributes));
+				schema[name[ni]] = {
+					attributes: arrayToMap(attributesOrder),
+					attributesOrder: attributesOrder,
+					children: arrayToMap(children, dummyObj)
+				};
+			}
+		}
+
+		function addAttrs(name, attributes) {
+			var ni, schemaItem, i, l;
+
+			name = split(name);
+			ni = name.length;
+			attributes = split(attributes);
+			while (ni--) {
+				schemaItem = schema[name[ni]];
+				for (i = 0, l = attributes.length; i < l; i++) {
+					schemaItem.attributes[attributes[i]] = {};
+					schemaItem.attributesOrder.push(attributes[i]);
+				}
+			}
+		}
+
+		// Use cached schema
+		if (mapCache[type]) {
+			return mapCache[type];
+		}
+
+		// Attributes present on all elements
+		globalAttributes = split("id accesskey class dir lang style tabindex title");
+
+		// Event attributes can be opt-in/opt-out
+		/*eventAttributes = split("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"
+		);*/
+
+		// Block content elements
+		blockContent = split(
+			"address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul"
+		);
+
+		// Phrasing content elements from the HTML5 spec (inline)
+		phrasingContent = split(
+			"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"
+		);
+
+		// Add HTML5 items to globalAttributes, blockContent, phrasingContent
+		if (type != "html4") {
+			globalAttributes.push.apply(globalAttributes, split("contenteditable contextmenu draggable dropzone " +
+				"hidden spellcheck translate"));
+			blockContent.push.apply(blockContent, split("article aside details dialog figure header footer hgroup section nav"));
+			phrasingContent.push.apply(phrasingContent, split("audio canvas command datalist mark meter output progress time wbr " +
+				"video ruby bdi keygen"));
+		}
+
+		// Add HTML4 elements unless it's html5-strict
+		if (type != "html5-strict") {
+			globalAttributes.push("xml:lang");
+
+			html4PhrasingContent = split("acronym applet basefont big font strike tt");
+			phrasingContent.push.apply(phrasingContent, html4PhrasingContent);
+
+			each(html4PhrasingContent, function(name) {
+				add(name, "", phrasingContent);
+			});
+
+			html4BlockContent = split("center dir isindex noframes");
+			blockContent.push.apply(blockContent, html4BlockContent);
+
+			// Flow content elements from the HTML5 spec (block+inline)
+			flowContent = [].concat(blockContent, phrasingContent);
+
+			each(html4BlockContent, function(name) {
+				add(name, "", flowContent);
+			});
+		}
+
+		// Flow content elements from the HTML5 spec (block+inline)
+		flowContent = flowContent || [].concat(blockContent, phrasingContent);
+
+		// HTML4 base schema TODO: Move HTML5 specific attributes to HTML5 specific if statement
+		// Schema items <element name>, <specific attributes>, <children ..>
+		add("html", "manifest", "head body");
+		add("head", "", "base command link meta noscript script style title");
+		add("title hr noscript br");
+		add("base", "href target");
+		add("link", "href rel media hreflang type sizes hreflang");
+		add("meta", "name http-equiv content charset");
+		add("style", "media type scoped");
+		add("script", "src async defer type charset");
+		add("body", "onafterprint onbeforeprint onbeforeunload onblur onerror onfocus " +
+				"onhashchange onload onmessage onoffline ononline onpagehide onpageshow " +
+				"onpopstate onresize onscroll onstorage onunload", flowContent);
+		add("address dt dd div caption", "", flowContent);
+		add("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", "", phrasingContent);
+		add("blockquote", "cite", flowContent);
+		add("ol", "reversed start type", "li");
+		add("ul", "", "li");
+		add("li", "value", flowContent);
+		add("dl", "", "dt dd");
+		add("a", "href target rel media hreflang type", phrasingContent);
+		add("q", "cite", phrasingContent);
+		add("ins del", "cite datetime", flowContent);
+		add("img", "src sizes srcset alt usemap ismap width height");
+		add("iframe", "src name width height", flowContent);
+		add("embed", "src type width height");
+		add("object", "data type typemustmatch name usemap form width height", flowContent, "param");
+		add("param", "name value");
+		add("map", "name", flowContent, "area");
+		add("area", "alt coords shape href target rel media hreflang type");
+		add("table", "border", "caption colgroup thead tfoot tbody tr" + (type == "html4" ? " col" : ""));
+		add("colgroup", "span", "col");
+		add("col", "span");
+		add("tbody thead tfoot", "", "tr");
+		add("tr", "", "td th");
+		add("td", "colspan rowspan headers", flowContent);
+		add("th", "colspan rowspan headers scope abbr", flowContent);
+		add("form", "accept-charset action autocomplete enctype method name novalidate target", flowContent);
+		add("fieldset", "disabled form name", flowContent, "legend");
+		add("label", "form for", phrasingContent);
+		add("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"
+		);
+		add("button", "disabled form formaction formenctype formmethod formnovalidate formtarget name type value",
+			type == "html4" ? flowContent : phrasingContent);
+		add("select", "disabled form multiple name required size", "option optgroup");
+		add("optgroup", "disabled label", "option");
+		add("option", "disabled label selected value");
+		add("textarea", "cols dirname disabled form maxlength name readonly required rows wrap");
+		add("menu", "type label", flowContent, "li");
+		add("noscript", "", flowContent);
+
+		// Extend with HTML5 elements
+		if (type != "html4") {
+			add("wbr");
+			add("ruby", "", phrasingContent, "rt rp");
+			add("figcaption", "", flowContent);
+			add("mark rt rp summary bdi", "", phrasingContent);
+			add("canvas", "width height", flowContent);
+			add("video", "src crossorigin poster preload autoplay mediagroup loop " +
+				"muted controls width height buffered", flowContent, "track source");
+			add("audio", "src crossorigin preload autoplay mediagroup loop muted controls buffered volume", flowContent, "track source");
+			add("picture", "", "img source");
+			add("source", "src srcset type media sizes");
+			add("track", "kind src srclang label default");
+			add("datalist", "", phrasingContent, "option");
+			add("article section nav aside header footer", "", flowContent);
+			add("hgroup", "", "h1 h2 h3 h4 h5 h6");
+			add("figure", "", flowContent, "figcaption");
+			add("time", "datetime", phrasingContent);
+			add("dialog", "open", flowContent);
+			add("command", "type label icon disabled checked radiogroup command");
+			add("output", "for form name", phrasingContent);
+			add("progress", "value max", phrasingContent);
+			add("meter", "value min max low high optimum", phrasingContent);
+			add("details", "open", flowContent, "summary");
+			add("keygen", "autofocus challenge disabled form keytype name");
+		}
+
+		// Extend with HTML4 attributes unless it's html5-strict
+		if (type != "html5-strict") {
+			addAttrs("script", "language xml:space");
+			addAttrs("style", "xml:space");
+			addAttrs("object", "declare classid code codebase codetype archive standby align border hspace vspace");
+			addAttrs("embed", "align name hspace vspace");
+			addAttrs("param", "valuetype type");
+			addAttrs("a", "charset name rev shape coords");
+			addAttrs("br", "clear");
+			addAttrs("applet", "codebase archive code object alt name width height align hspace vspace");
+			addAttrs("img", "name longdesc align border hspace vspace");
+			addAttrs("iframe", "longdesc frameborder marginwidth marginheight scrolling align");
+			addAttrs("font basefont", "size color face");
+			addAttrs("input", "usemap align");
+			addAttrs("select", "onchange");
+			addAttrs("textarea");
+			addAttrs("h1 h2 h3 h4 h5 h6 div p legend caption", "align");
+			addAttrs("ul", "type compact");
+			addAttrs("li", "type");
+			addAttrs("ol dl menu dir", "compact");
+			addAttrs("pre", "width xml:space");
+			addAttrs("hr", "align noshade size width");
+			addAttrs("isindex", "prompt");
+			addAttrs("table", "summary width frame rules cellspacing cellpadding align bgcolor");
+			addAttrs("col", "width align char charoff valign");
+			addAttrs("colgroup", "width align char charoff valign");
+			addAttrs("thead", "align char charoff valign");
+			addAttrs("tr", "align char charoff valign bgcolor");
+			addAttrs("th", "axis align char charoff valign nowrap bgcolor width height");
+			addAttrs("form", "accept");
+			addAttrs("td", "abbr axis scope align char charoff valign nowrap bgcolor width height");
+			addAttrs("tfoot", "align char charoff valign");
+			addAttrs("tbody", "align char charoff valign");
+			addAttrs("area", "nohref");
+			addAttrs("body", "background bgcolor text link vlink alink");
+		}
+
+		// Extend with HTML5 attributes unless it's html4
+		if (type != "html4") {
+			addAttrs("input button select textarea", "autofocus");
+			addAttrs("input textarea", "placeholder");
+			addAttrs("a", "download");
+			addAttrs("link script img", "crossorigin");
+			addAttrs("iframe", "sandbox seamless allowfullscreen"); // Excluded: srcdoc
+		}
+
+		// Special: iframe, ruby, video, audio, label
+
+		// Delete children of the same name from it's parent
+		// For example: form can't have a child of the name form
+		each(split('a form meter progress dfn'), function(name) {
+			if (schema[name]) {
+				delete schema[name].children[name];
+			}
+		});
+
+		// Delete header, footer, sectioning and heading content descendants
+		/*each('dt th address', function(name) {
+			delete schema[name].children[name];
+		});*/
+
+		// Caption can't have tables
+		delete schema.caption.children.table;
+
+		// TODO: LI:s can only have value if parent is OL
+
+		// TODO: Handle transparent elements
+		// a ins del canvas map
+
+		mapCache[type] = schema;
+
+		return schema;
+	}
+
+	function compileElementMap(value, mode) {
+		var styles;
+
+		if (value) {
+			styles = {};
+
+			if (typeof value == 'string') {
+				value = {
+					'*': value
+				};
+			}
+
+			// Convert styles into a rule list
+			each(value, function(value, key) {
+				styles[key] = styles[key.toUpperCase()] = mode == 'map' ? makeMap(value, /[, ]/) : explode(value, /[, ]/);
+			});
+		}
+
+		return styles;
+	}
+
+	/**
+	 * Constructs a new Schema instance.
+	 *
+	 * @constructor
+	 * @method Schema
+	 * @param {Object} settings Name/value settings object.
+	 */
+	return function(settings) {
+		var self = this, elements = {}, children = {}, patternElements = [], validStyles, invalidStyles, schemaItems;
+		var whiteSpaceElementsMap, selfClosingElementsMap, shortEndedElementsMap, boolAttrMap, validClasses;
+		var blockElementsMap, nonEmptyElementsMap, moveCaretBeforeOnEnterElementsMap, textBlockElementsMap, textInlineElementsMap;
+		var customElementsMap = {}, specialElements = {};
+
+		// Creates an lookup table map object for the specified option or the default value
+		function createLookupTable(option, default_value, extendWith) {
+			var value = settings[option];
+
+			if (!value) {
+				// Get cached default map or make it if needed
+				value = mapCache[option];
+
+				if (!value) {
+					value = makeMap(default_value, ' ', makeMap(default_value.toUpperCase(), ' '));
+					value = extend(value, extendWith);
+
+					mapCache[option] = value;
+				}
+			} else {
+				// Create custom map
+				value = makeMap(value, /[, ]/, makeMap(value.toUpperCase(), /[, ]/));
+			}
+
+			return value;
+		}
+
+		settings = settings || {};
+		schemaItems = compileSchema(settings.schema);
+
+		// Allow all elements and attributes if verify_html is set to false
+		if (settings.verify_html === false) {
+			settings.valid_elements = '*[*]';
+		}
+
+		validStyles = compileElementMap(settings.valid_styles);
+		invalidStyles = compileElementMap(settings.invalid_styles, 'map');
+		validClasses = compileElementMap(settings.valid_classes, 'map');
+
+		// Setup map objects
+		whiteSpaceElementsMap = createLookupTable('whitespace_elements', 'pre script noscript style textarea video audio iframe object');
+		selfClosingElementsMap = createLookupTable('self_closing_elements', 'colgroup dd dt li option p td tfoot th thead tr');
+		shortEndedElementsMap = createLookupTable('short_ended_elements', 'area base basefont br col frame hr img input isindex link ' +
+			'meta param embed source wbr track');
+		boolAttrMap = createLookupTable('boolean_attributes', 'checked compact declare defer disabled ismap multiple nohref noresize ' +
+			'noshade nowrap readonly selected autoplay loop controls');
+		nonEmptyElementsMap = createLookupTable('non_empty_elements', 'td th iframe video audio object script', shortEndedElementsMap);
+		moveCaretBeforeOnEnterElementsMap = createLookupTable('move_caret_before_on_enter_elements', 'table', nonEmptyElementsMap);
+		textBlockElementsMap = createLookupTable('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');
+		blockElementsMap = createLookupTable('block_elements', 'hr table tbody thead tfoot ' +
+						'th tr td li ol ul caption dl dt dd noscript menu isindex option ' +
+						'datalist select optgroup', textBlockElementsMap);
+		textInlineElementsMap = createLookupTable('text_inline_elements', 'span strong b em i font strike u var cite ' +
+										'dfn code mark q sup sub samp');
+
+		each((settings.special || 'script noscript style textarea').split(' '), function(name) {
+			specialElements[name] = new RegExp('<\/' + name + '[^>]*>', 'gi');
+		});
+
+		// Converts a wildcard expression string to a regexp for example *a will become /.*a/.
+		function patternToRegExp(str) {
+			return new RegExp('^' + str.replace(/([?+*])/g, '.$1') + '$');
+		}
+
+		// Parses the specified valid_elements string and adds to the current rules
+		// This function is a bit hard to read since it's heavily optimized for speed
+		function addValidElements(validElements) {
+			var ei, el, ai, al, matches, element, attr, attrData, elementName, attrName, attrType, attributes, attributesOrder,
+				prefix, outputName, globalAttributes, globalAttributesOrder, key, value,
+				elementRuleRegExp = /^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,
+				attrRuleRegExp = /^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,
+				hasPatternsRegExp = /[*?+]/;
+
+			if (validElements) {
+				// Split valid elements into an array with rules
+				validElements = split(validElements, ',');
+
+				if (elements['@']) {
+					globalAttributes = elements['@'].attributes;
+					globalAttributesOrder = elements['@'].attributesOrder;
+				}
+
+				// Loop all rules
+				for (ei = 0, el = validElements.length; ei < el; ei++) {
+					// Parse element rule
+					matches = elementRuleRegExp.exec(validElements[ei]);
+					if (matches) {
+						// Setup local names for matches
+						prefix = matches[1];
+						elementName = matches[2];
+						outputName = matches[3];
+						attrData = matches[5];
+
+						// Create new attributes and attributesOrder
+						attributes = {};
+						attributesOrder = [];
+
+						// Create the new element
+						element = {
+							attributes: attributes,
+							attributesOrder: attributesOrder
+						};
+
+						// Padd empty elements prefix
+						if (prefix === '#') {
+							element.paddEmpty = true;
+						}
+
+						// Remove empty elements prefix
+						if (prefix === '-') {
+							element.removeEmpty = true;
+						}
+
+						if (matches[4] === '!') {
+							element.removeEmptyAttrs = true;
+						}
+
+						// Copy attributes from global rule into current rule
+						if (globalAttributes) {
+							for (key in globalAttributes) {
+								attributes[key] = globalAttributes[key];
+							}
+
+							attributesOrder.push.apply(attributesOrder, globalAttributesOrder);
+						}
+
+						// Attributes defined
+						if (attrData) {
+							attrData = split(attrData, '|');
+							for (ai = 0, al = attrData.length; ai < al; ai++) {
+								matches = attrRuleRegExp.exec(attrData[ai]);
+								if (matches) {
+									attr = {};
+									attrType = matches[1];
+									attrName = matches[2].replace(/::/g, ':');
+									prefix = matches[3];
+									value = matches[4];
+
+									// Required
+									if (attrType === '!') {
+										element.attributesRequired = element.attributesRequired || [];
+										element.attributesRequired.push(attrName);
+										attr.required = true;
+									}
+
+									// Denied from global
+									if (attrType === '-') {
+										delete attributes[attrName];
+										attributesOrder.splice(inArray(attributesOrder, attrName), 1);
+										continue;
+									}
+
+									// Default value
+									if (prefix) {
+										// Default value
+										if (prefix === '=') {
+											element.attributesDefault = element.attributesDefault || [];
+											element.attributesDefault.push({name: attrName, value: value});
+											attr.defaultValue = value;
+										}
+
+										// Forced value
+										if (prefix === ':') {
+											element.attributesForced = element.attributesForced || [];
+											element.attributesForced.push({name: attrName, value: value});
+											attr.forcedValue = value;
+										}
+
+										// Required values
+										if (prefix === '<') {
+											attr.validValues = makeMap(value, '?');
+										}
+									}
+
+									// Check for attribute patterns
+									if (hasPatternsRegExp.test(attrName)) {
+										element.attributePatterns = element.attributePatterns || [];
+										attr.pattern = patternToRegExp(attrName);
+										element.attributePatterns.push(attr);
+									} else {
+										// Add attribute to order list if it doesn't already exist
+										if (!attributes[attrName]) {
+											attributesOrder.push(attrName);
+										}
+
+										attributes[attrName] = attr;
+									}
+								}
+							}
+						}
+
+						// Global rule, store away these for later usage
+						if (!globalAttributes && elementName == '@') {
+							globalAttributes = attributes;
+							globalAttributesOrder = attributesOrder;
+						}
+
+						// Handle substitute elements such as b/strong
+						if (outputName) {
+							element.outputName = elementName;
+							elements[outputName] = element;
+						}
+
+						// Add pattern or exact element
+						if (hasPatternsRegExp.test(elementName)) {
+							element.pattern = patternToRegExp(elementName);
+							patternElements.push(element);
+						} else {
+							elements[elementName] = element;
+						}
+					}
+				}
+			}
+		}
+
+		function setValidElements(validElements) {
+			elements = {};
+			patternElements = [];
+
+			addValidElements(validElements);
+
+			each(schemaItems, function(element, name) {
+				children[name] = element.children;
+			});
+		}
+
+		// Adds custom non HTML elements to the schema
+		function addCustomElements(customElements) {
+			var customElementRegExp = /^(~)?(.+)$/;
+
+			if (customElements) {
+				// Flush cached items since we are altering the default maps
+				mapCache.text_block_elements = mapCache.block_elements = null;
+
+				each(split(customElements, ','), function(rule) {
+					var matches = customElementRegExp.exec(rule),
+						inline = matches[1] === '~',
+						cloneName = inline ? 'span' : 'div',
+						name = matches[2];
+
+					children[name] = children[cloneName];
+					customElementsMap[name] = cloneName;
+
+					// If it's not marked as inline then add it to valid block elements
+					if (!inline) {
+						blockElementsMap[name.toUpperCase()] = {};
+						blockElementsMap[name] = {};
+					}
+
+					// Add elements clone if needed
+					if (!elements[name]) {
+						var customRule = elements[cloneName];
+
+						customRule = extend({}, customRule);
+						delete customRule.removeEmptyAttrs;
+						delete customRule.removeEmpty;
+
+						elements[name] = customRule;
+					}
+
+					// Add custom elements at span/div positions
+					each(children, function(element, elmName) {
+						if (element[cloneName]) {
+							children[elmName] = element = extend({}, children[elmName]);
+							element[name] = element[cloneName];
+						}
+					});
+				});
+			}
+		}
+
+		// Adds valid children to the schema object
+		function addValidChildren(validChildren) {
+			var childRuleRegExp = /^([+\-]?)(\w+)\[([^\]]+)\]$/;
+
+			if (validChildren) {
+				each(split(validChildren, ','), function(rule) {
+					var matches = childRuleRegExp.exec(rule), parent, prefix;
+
+					if (matches) {
+						prefix = matches[1];
+
+						// Add/remove items from default
+						if (prefix) {
+							parent = children[matches[2]];
+						} else {
+							parent = children[matches[2]] = {'#comment': {}};
+						}
+
+						parent = children[matches[2]];
+
+						each(split(matches[3], '|'), function(child) {
+							if (prefix === '-') {
+								// Clone the element before we delete
+								// things in it to not mess up default schemas
+								children[matches[2]] = parent = extend({}, children[matches[2]]);
+
+								delete parent[child];
+							} else {
+								parent[child] = {};
+							}
+						});
+					}
+				});
+			}
+		}
+
+		function getElementRule(name) {
+			var element = elements[name], i;
+
+			// Exact match found
+			if (element) {
+				return element;
+			}
+
+			// No exact match then try the patterns
+			i = patternElements.length;
+			while (i--) {
+				element = patternElements[i];
+
+				if (element.pattern.test(name)) {
+					return element;
+				}
+			}
+		}
+
+		if (!settings.valid_elements) {
+			// No valid elements defined then clone the elements from the schema spec
+			each(schemaItems, function(element, name) {
+				elements[name] = {
+					attributes: element.attributes,
+					attributesOrder: element.attributesOrder
+				};
+
+				children[name] = element.children;
+			});
+
+			// Switch these on HTML4
+			if (settings.schema != "html5") {
+				each(split('strong/b em/i'), function(item) {
+					item = split(item, '/');
+					elements[item[1]].outputName = item[0];
+				});
+			}
+
+			// Add default alt attribute for images
+			elements.img.attributesDefault = [{name: 'alt', value: ''}];
+
+			// Remove these if they are empty by default
+			each(split('ol ul sub sup blockquote span font a table tbody tr strong em b i'), function(name) {
+				if (elements[name]) {
+					elements[name].removeEmpty = true;
+				}
+			});
+
+			// Padd these by default
+			each(split('p h1 h2 h3 h4 h5 h6 th td pre div address caption'), function(name) {
+				elements[name].paddEmpty = true;
+			});
+
+			// Remove these if they have no attributes
+			each(split('span'), function(name) {
+				elements[name].removeEmptyAttrs = true;
+			});
+
+			// Remove these by default
+			// TODO: Reenable in 4.1
+			/*each(split('script style'), function(name) {
+				delete elements[name];
+			});*/
+		} else {
+			setValidElements(settings.valid_elements);
+		}
+
+		addCustomElements(settings.custom_elements);
+		addValidChildren(settings.valid_children);
+		addValidElements(settings.extended_valid_elements);
+
+		// Todo: Remove this when we fix list handling to be valid
+		addValidChildren('+ol[ul|ol],+ul[ul|ol]');
+
+		// Delete invalid elements
+		if (settings.invalid_elements) {
+			each(explode(settings.invalid_elements), function(item) {
+				if (elements[item]) {
+					delete elements[item];
+				}
+			});
+		}
+
+		// If the user didn't allow span only allow internal spans
+		if (!getElementRule('span')) {
+			addValidElements('span[!data-mce-type|*]');
+		}
+
+		/**
+		 * Name/value map object with valid parents and children to those parents.
+		 *
+		 * @example
+		 * children = {
+		 *    div:{p:{}, h1:{}}
+		 * };
+		 * @field children
+		 * @type Object
+		 */
+		self.children = children;
+
+		/**
+		 * Name/value map object with valid styles for each element.
+		 *
+		 * @method getValidStyles
+		 * @type Object
+		 */
+		self.getValidStyles = function() {
+			return validStyles;
+		};
+
+		/**
+		 * Name/value map object with valid styles for each element.
+		 *
+		 * @method getInvalidStyles
+		 * @type Object
+		 */
+		self.getInvalidStyles = function() {
+			return invalidStyles;
+		};
+
+		/**
+		 * Name/value map object with valid classes for each element.
+		 *
+		 * @method getValidClasses
+		 * @type Object
+		 */
+		self.getValidClasses = function() {
+			return validClasses;
+		};
+
+		/**
+		 * Returns a map with boolean attributes.
+		 *
+		 * @method getBoolAttrs
+		 * @return {Object} Name/value lookup map for boolean attributes.
+		 */
+		self.getBoolAttrs = function() {
+			return boolAttrMap;
+		};
+
+		/**
+		 * Returns a map with block elements.
+		 *
+		 * @method getBlockElements
+		 * @return {Object} Name/value lookup map for block elements.
+		 */
+		self.getBlockElements = function() {
+			return blockElementsMap;
+		};
+
+		/**
+		 * Returns a map with text block elements. Such as: p,h1-h6,div,address
+		 *
+		 * @method getTextBlockElements
+		 * @return {Object} Name/value lookup map for block elements.
+		 */
+		self.getTextBlockElements = function() {
+			return textBlockElementsMap;
+		};
+
+		/**
+		 * Returns a map of inline text format nodes for example strong/span or ins.
+		 *
+		 * @method getTextInlineElements
+		 * @return {Object} Name/value lookup map for text format elements.
+		 */
+		self.getTextInlineElements = function() {
+			return textInlineElementsMap;
+		};
+
+		/**
+		 * Returns a map with short ended elements such as BR or IMG.
+		 *
+		 * @method getShortEndedElements
+		 * @return {Object} Name/value lookup map for short ended elements.
+		 */
+		self.getShortEndedElements = function() {
+			return shortEndedElementsMap;
+		};
+
+		/**
+		 * Returns a map with self closing tags such as <li>.
+		 *
+		 * @method getSelfClosingElements
+		 * @return {Object} Name/value lookup map for self closing tags elements.
+		 */
+		self.getSelfClosingElements = function() {
+			return selfClosingElementsMap;
+		};
+
+		/**
+		 * Returns a map with elements that should be treated as contents regardless if it has text
+		 * content in them or not such as TD, VIDEO or IMG.
+		 *
+		 * @method getNonEmptyElements
+		 * @return {Object} Name/value lookup map for non empty elements.
+		 */
+		self.getNonEmptyElements = function() {
+			return nonEmptyElementsMap;
+		};
+
+		/**
+		 * Returns a map with elements that the caret should be moved in front of after enter is
+		 * pressed
+		 *
+		 * @method getMoveCaretBeforeOnEnterElements
+		 * @return {Object} Name/value lookup map for elements to place the caret in front of.
+		 */
+		self.getMoveCaretBeforeOnEnterElements = function() {
+			return moveCaretBeforeOnEnterElementsMap;
+		};
+
+		/**
+		 * Returns a map with elements where white space is to be preserved like PRE or SCRIPT.
+		 *
+		 * @method getWhiteSpaceElements
+		 * @return {Object} Name/value lookup map for white space elements.
+		 */
+		self.getWhiteSpaceElements = function() {
+			return whiteSpaceElementsMap;
+		};
+
+		/**
+		 * Returns a map with special elements. These are elements that needs to be parsed
+		 * in a special way such as script, style, textarea etc. The map object values
+		 * are regexps used to find the end of the element.
+		 *
+		 * @method getSpecialElements
+		 * @return {Object} Name/value lookup map for special elements.
+		 */
+		self.getSpecialElements = function() {
+			return specialElements;
+		};
+
+		/**
+		 * Returns true/false if the specified element and it's child is valid or not
+		 * according to the schema.
+		 *
+		 * @method isValidChild
+		 * @param {String} name Element name to check for.
+		 * @param {String} child Element child to verify.
+		 * @return {Boolean} True/false if the element is a valid child of the specified parent.
+		 */
+		self.isValidChild = function(name, child) {
+			var parent = children[name];
+
+			return !!(parent && parent[child]);
+		};
+
+		/**
+		 * Returns true/false if the specified element name and optional attribute is
+		 * valid according to the schema.
+		 *
+		 * @method isValid
+		 * @param {String} name Name of element to check.
+		 * @param {String} attr Optional attribute name to check for.
+		 * @return {Boolean} True/false if the element and attribute is valid.
+		 */
+		self.isValid = function(name, attr) {
+			var attrPatterns, i, rule = getElementRule(name);
+
+			// Check if it's a valid element
+			if (rule) {
+				if (attr) {
+					// Check if attribute name exists
+					if (rule.attributes[attr]) {
+						return true;
+					}
+
+					// Check if attribute matches a regexp pattern
+					attrPatterns = rule.attributePatterns;
+					if (attrPatterns) {
+						i = attrPatterns.length;
+						while (i--) {
+							if (attrPatterns[i].pattern.test(name)) {
+								return true;
+							}
+						}
+					}
+				} else {
+					return true;
+				}
+			}
+
+			// No match
+			return false;
+		};
+
+		/**
+		 * Returns true/false if the specified element is valid or not
+		 * according to the schema.
+		 *
+		 * @method getElementRule
+		 * @param {String} name Element name to check for.
+		 * @return {Object} Element object or undefined if the element isn't valid.
+		 */
+		self.getElementRule = getElementRule;
+
+		/**
+		 * Returns an map object of all custom elements.
+		 *
+		 * @method getCustomElements
+		 * @return {Object} Name/value map object of all custom elements.
+		 */
+		self.getCustomElements = function() {
+			return customElementsMap;
+		};
+
+		/**
+		 * Parses a valid elements string and adds it to the schema. The valid elements
+		 * format is for example "element[attr=default|otherattr]".
+		 * Existing rules will be replaced with the ones specified, so this extends the schema.
+		 *
+		 * @method addValidElements
+		 * @param {String} valid_elements String in the valid elements format to be parsed.
+		 */
+		self.addValidElements = addValidElements;
+
+		/**
+		 * Parses a valid elements string and sets it to the schema. The valid elements
+		 * format is for example "element[attr=default|otherattr]".
+		 * Existing rules will be replaced with the ones specified, so this extends the schema.
+		 *
+		 * @method setValidElements
+		 * @param {String} valid_elements String in the valid elements format to be parsed.
+		 */
+		self.setValidElements = setValidElements;
+
+		/**
+		 * Adds custom non HTML elements to the schema.
+		 *
+		 * @method addCustomElements
+		 * @param {String} custom_elements Comma separated list of custom elements to add.
+		 */
+		self.addCustomElements = addCustomElements;
+
+		/**
+		 * Parses a valid children string and adds them to the schema structure. The valid children
+		 * format is for example: "element[child1|child2]".
+		 *
+		 * @method addValidChildren
+		 * @param {String} valid_children Valid children elements string to parse
+		 */
+		self.addValidChildren = addValidChildren;
+
+		self.elements = elements;
+	};
+});
+
+// Included from: js/tinymce/classes/html/SaxParser.js
+
+/**
+ * SaxParser.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*eslint max-depth:[2, 9] */
+
+/**
+ * This class parses HTML code using pure JavaScript and executes various events for each item it finds. It will
+ * always execute the events in the right order for tag soup code like <b><p></b></p>. It will also remove elements
+ * and attributes that doesn't fit the schema if the validate setting is enabled.
+ *
+ * @example
+ * var parser = new tinymce.html.SaxParser({
+ *     validate: true,
+ *
+ *     comment: function(text) {
+ *         console.log('Comment:', text);
+ *     },
+ *
+ *     cdata: function(text) {
+ *         console.log('CDATA:', text);
+ *     },
+ *
+ *     text: function(text, raw) {
+ *         console.log('Text:', text, 'Raw:', raw);
+ *     },
+ *
+ *     start: function(name, attrs, empty) {
+ *         console.log('Start:', name, attrs, empty);
+ *     },
+ *
+ *     end: function(name) {
+ *         console.log('End:', name);
+ *     },
+ *
+ *     pi: function(name, text) {
+ *         console.log('PI:', name, text);
+ *     },
+ *
+ *     doctype: function(text) {
+ *         console.log('DocType:', text);
+ *     }
+ * }, schema);
+ * @class tinymce.html.SaxParser
+ * @version 3.4
+ */
+define("tinymce/html/SaxParser", [
+	"tinymce/html/Schema",
+	"tinymce/html/Entities",
+	"tinymce/util/Tools"
+], function(Schema, Entities, Tools) {
+	var each = Tools.each;
+
+	/**
+	 * Returns the index of the end tag for a specific start tag. This can be
+	 * used to skip all children of a parent element from being processed.
+	 *
+	 * @private
+	 * @method findEndTag
+	 * @param {tinymce.html.Schema} schema Schema instance to use to match short ended elements.
+	 * @param {String} html HTML string to find the end tag in.
+	 * @param {Number} startIndex Indext to start searching at should be after the start tag.
+	 * @return {Number} Index of the end tag.
+	 */
+	function findEndTag(schema, html, startIndex) {
+		var count = 1, index, matches, tokenRegExp, shortEndedElements;
+
+		shortEndedElements = schema.getShortEndedElements();
+		tokenRegExp = /<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g;
+		tokenRegExp.lastIndex = index = startIndex;
+
+		while ((matches = tokenRegExp.exec(html))) {
+			index = tokenRegExp.lastIndex;
+
+			if (matches[1] === '/') { // End element
+				count--;
+			} else if (!matches[1]) { // Start element
+				if (matches[2] in shortEndedElements) {
+					continue;
+				}
+
+				count++;
+			}
+
+			if (count === 0) {
+				break;
+			}
+		}
+
+		return index;
+	}
+
+	/**
+	 * Constructs a new SaxParser instance.
+	 *
+	 * @constructor
+	 * @method SaxParser
+	 * @param {Object} settings Name/value collection of settings. comment, cdata, text, start and end are callbacks.
+	 * @param {tinymce.html.Schema} schema HTML Schema class to use when parsing.
+	 */
+	function SaxParser(settings, schema) {
+		var self = this;
+
+		function noop() {}
+
+		settings = settings || {};
+		self.schema = schema = schema || new Schema();
+
+		if (settings.fix_self_closing !== false) {
+			settings.fix_self_closing = true;
+		}
+
+		// Add handler functions from settings and setup default handlers
+		each('comment cdata text start end pi doctype'.split(' '), function(name) {
+			if (name) {
+				self[name] = settings[name] || noop;
+			}
+		});
+
+		/**
+		 * Parses the specified HTML string and executes the callbacks for each item it finds.
+		 *
+		 * @example
+		 * new SaxParser({...}).parse('<b>text</b>');
+		 * @method parse
+		 * @param {String} html Html string to sax parse.
+		 */
+		self.parse = function(html) {
+			var self = this, matches, index = 0, value, endRegExp, stack = [], attrList, i, text, name;
+			var isInternalElement, removeInternalElements, shortEndedElements, fillAttrsMap, isShortEnded;
+			var validate, elementRule, isValidElement, attr, attribsValue, validAttributesMap, validAttributePatterns;
+			var attributesRequired, attributesDefault, attributesForced;
+			var anyAttributesRequired, selfClosing, tokenRegExp, attrRegExp, specialElements, attrValue, idCount = 0;
+			var decode = Entities.decode, fixSelfClosing, filteredUrlAttrs = Tools.makeMap('src,href,data,background,formaction,poster');
+			var scriptUriRegExp = /((java|vb)script|mhtml):/i, dataUriRegExp = /^data:/i;
+
+			function processEndTag(name) {
+				var pos, i;
+
+				// Find position of parent of the same type
+				pos = stack.length;
+				while (pos--) {
+					if (stack[pos].name === name) {
+						break;
+					}
+				}
+
+				// Found parent
+				if (pos >= 0) {
+					// Close all the open elements
+					for (i = stack.length - 1; i >= pos; i--) {
+						name = stack[i];
+
+						if (name.valid) {
+							self.end(name.name);
+						}
+					}
+
+					// Remove the open elements from the stack
+					stack.length = pos;
+				}
+			}
+
+			function parseAttribute(match, name, value, val2, val3) {
+				var attrRule, i, trimRegExp = /[\s\u0000-\u001F]+/g;
+
+				name = name.toLowerCase();
+				value = name in fillAttrsMap ? name : decode(value || val2 || val3 || ''); // Handle boolean attribute than value attribute
+
+				// Validate name and value pass through all data- attributes
+				if (validate && !isInternalElement && name.indexOf('data-') !== 0) {
+					attrRule = validAttributesMap[name];
+
+					// Find rule by pattern matching
+					if (!attrRule && validAttributePatterns) {
+						i = validAttributePatterns.length;
+						while (i--) {
+							attrRule = validAttributePatterns[i];
+							if (attrRule.pattern.test(name)) {
+								break;
+							}
+						}
+
+						// No rule matched
+						if (i === -1) {
+							attrRule = null;
+						}
+					}
+
+					// No attribute rule found
+					if (!attrRule) {
+						return;
+					}
+
+					// Validate value
+					if (attrRule.validValues && !(value in attrRule.validValues)) {
+						return;
+					}
+				}
+
+				// Block any javascript: urls or non image data uris
+				if (filteredUrlAttrs[name] && !settings.allow_script_urls) {
+					var uri = value.replace(trimRegExp, '');
+
+					try {
+						// Might throw malformed URI sequence
+						uri = decodeURIComponent(uri);
+					} catch (ex) {
+						// Fallback to non UTF-8 decoder
+						uri = unescape(uri);
+					}
+
+					if (scriptUriRegExp.test(uri)) {
+						return;
+					}
+
+					if (!settings.allow_html_data_urls && dataUriRegExp.test(uri) && !/^data:image\//i.test(uri)) {
+						return;
+					}
+				}
+
+				// Add attribute to list and map
+				attrList.map[name] = value;
+				attrList.push({
+					name: name,
+					value: value
+				});
+			}
+
+			// Precompile RegExps and map objects
+			tokenRegExp = new RegExp('<(?:' +
+				'(?:!--([\\w\\W]*?)-->)|' + // Comment
+				'(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|' + // CDATA
+				'(?:!DOCTYPE([\\w\\W]*?)>)|' + // DOCTYPE
+				'(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|' + // PI
+				'(?:\\/([^>]+)>)|' + // End element
+				'(?:([A-Za-z0-9\\-_\\:\\.]+)((?:\\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\\/|\\s+)>)' + // Start element
+			')', 'g');
+
+			attrRegExp = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g;
+
+			// Setup lookup tables for empty elements and boolean attributes
+			shortEndedElements = schema.getShortEndedElements();
+			selfClosing = settings.self_closing_elements || schema.getSelfClosingElements();
+			fillAttrsMap = schema.getBoolAttrs();
+			validate = settings.validate;
+			removeInternalElements = settings.remove_internals;
+			fixSelfClosing = settings.fix_self_closing;
+			specialElements = schema.getSpecialElements();
+
+			while ((matches = tokenRegExp.exec(html))) {
+				// Text
+				if (index < matches.index) {
+					self.text(decode(html.substr(index, matches.index - index)));
+				}
+
+				if ((value = matches[6])) { // End element
+					value = value.toLowerCase();
+
+					// IE will add a ":" in front of elements it doesn't understand like custom elements or HTML5 elements
+					if (value.charAt(0) === ':') {
+						value = value.substr(1);
+					}
+
+					processEndTag(value);
+				} else if ((value = matches[7])) { // Start element
+					value = value.toLowerCase();
+
+					// IE will add a ":" in front of elements it doesn't understand like custom elements or HTML5 elements
+					if (value.charAt(0) === ':') {
+						value = value.substr(1);
+					}
+
+					isShortEnded = value in shortEndedElements;
+
+					// Is self closing tag for example an <li> after an open <li>
+					if (fixSelfClosing && selfClosing[value] && stack.length > 0 && stack[stack.length - 1].name === value) {
+						processEndTag(value);
+					}
+
+					// Validate element
+					if (!validate || (elementRule = schema.getElementRule(value))) {
+						isValidElement = true;
+
+						// Grab attributes map and patters when validation is enabled
+						if (validate) {
+							validAttributesMap = elementRule.attributes;
+							validAttributePatterns = elementRule.attributePatterns;
+						}
+
+						// Parse attributes
+						if ((attribsValue = matches[8])) {
+							isInternalElement = attribsValue.indexOf('data-mce-type') !== -1; // Check if the element is an internal element
+
+							// If the element has internal attributes then remove it if we are told to do so
+							if (isInternalElement && removeInternalElements) {
+								isValidElement = false;
+							}
+
+							attrList = [];
+							attrList.map = {};
+
+							attribsValue.replace(attrRegExp, parseAttribute);
+						} else {
+							attrList = [];
+							attrList.map = {};
+						}
+
+						// Process attributes if validation is enabled
+						if (validate && !isInternalElement) {
+							attributesRequired = elementRule.attributesRequired;
+							attributesDefault = elementRule.attributesDefault;
+							attributesForced = elementRule.attributesForced;
+							anyAttributesRequired = elementRule.removeEmptyAttrs;
+
+							// Check if any attribute exists
+							if (anyAttributesRequired && !attrList.length) {
+								isValidElement = false;
+							}
+
+							// Handle forced attributes
+							if (attributesForced) {
+								i = attributesForced.length;
+								while (i--) {
+									attr = attributesForced[i];
+									name = attr.name;
+									attrValue = attr.value;
+
+									if (attrValue === '{$uid}') {
+										attrValue = 'mce_' + idCount++;
+									}
+
+									attrList.map[name] = attrValue;
+									attrList.push({name: name, value: attrValue});
+								}
+							}
+
+							// Handle default attributes
+							if (attributesDefault) {
+								i = attributesDefault.length;
+								while (i--) {
+									attr = attributesDefault[i];
+									name = attr.name;
+
+									if (!(name in attrList.map)) {
+										attrValue = attr.value;
+
+										if (attrValue === '{$uid}') {
+											attrValue = 'mce_' + idCount++;
+										}
+
+										attrList.map[name] = attrValue;
+										attrList.push({name: name, value: attrValue});
+									}
+								}
+							}
+
+							// Handle required attributes
+							if (attributesRequired) {
+								i = attributesRequired.length;
+								while (i--) {
+									if (attributesRequired[i] in attrList.map) {
+										break;
+									}
+								}
+
+								// None of the required attributes where found
+								if (i === -1) {
+									isValidElement = false;
+								}
+							}
+
+							// Invalidate element if it's marked as bogus
+							if ((attr = attrList.map['data-mce-bogus'])) {
+								if (attr === 'all') {
+									index = findEndTag(schema, html, tokenRegExp.lastIndex);
+									tokenRegExp.lastIndex = index;
+									continue;
+								}
+
+								isValidElement = false;
+							}
+						}
+
+						if (isValidElement) {
+							self.start(value, attrList, isShortEnded);
+						}
+					} else {
+						isValidElement = false;
+					}
+
+					// Treat script, noscript and style a bit different since they may include code that looks like elements
+					if ((endRegExp = specialElements[value])) {
+						endRegExp.lastIndex = index = matches.index + matches[0].length;
+
+						if ((matches = endRegExp.exec(html))) {
+							if (isValidElement) {
+								text = html.substr(index, matches.index - index);
+							}
+
+							index = matches.index + matches[0].length;
+						} else {
+							text = html.substr(index);
+							index = html.length;
+						}
+
+						if (isValidElement) {
+							if (text.length > 0) {
+								self.text(text, true);
+							}
+
+							self.end(value);
+						}
+
+						tokenRegExp.lastIndex = index;
+						continue;
+					}
+
+					// Push value on to stack
+					if (!isShortEnded) {
+						if (!attribsValue || attribsValue.indexOf('/') != attribsValue.length - 1) {
+							stack.push({name: value, valid: isValidElement});
+						} else if (isValidElement) {
+							self.end(value);
+						}
+					}
+				} else if ((value = matches[1])) { // Comment
+					// Padd comment value to avoid browsers from parsing invalid comments as HTML
+					if (value.charAt(0) === '>') {
+						value = ' ' + value;
+					}
+
+					if (!settings.allow_conditional_comments && value.substr(0, 3) === '[if') {
+						value = ' ' + value;
+					}
+
+					self.comment(value);
+				} else if ((value = matches[2])) { // CDATA
+					self.cdata(value);
+				} else if ((value = matches[3])) { // DOCTYPE
+					self.doctype(value);
+				} else if ((value = matches[4])) { // PI
+					self.pi(value, matches[5]);
+				}
+
+				index = matches.index + matches[0].length;
+			}
+
+			// Text
+			if (index < html.length) {
+				self.text(decode(html.substr(index)));
+			}
+
+			// Close any open elements
+			for (i = stack.length - 1; i >= 0; i--) {
+				value = stack[i];
+
+				if (value.valid) {
+					self.end(value.name);
+				}
+			}
+		};
+	}
+
+	SaxParser.findEndTag = findEndTag;
+
+	return SaxParser;
+});
+
+// Included from: js/tinymce/classes/html/DomParser.js
+
+/**
+ * DomParser.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class parses HTML code into a DOM like structure of nodes it will remove redundant whitespace and make
+ * sure that the node tree is valid according to the specified schema.
+ * So for example: <p>a<p>b</p>c</p> will become <p>a</p><p>b</p><p>c</p>
+ *
+ * @example
+ * var parser = new tinymce.html.DomParser({validate: true}, schema);
+ * var rootNode = parser.parse('<h1>content</h1>');
+ *
+ * @class tinymce.html.DomParser
+ * @version 3.4
+ */
+define("tinymce/html/DomParser", [
+	"tinymce/html/Node",
+	"tinymce/html/Schema",
+	"tinymce/html/SaxParser",
+	"tinymce/util/Tools"
+], function(Node, Schema, SaxParser, Tools) {
+	var makeMap = Tools.makeMap, each = Tools.each, explode = Tools.explode, extend = Tools.extend;
+
+	/**
+	 * Constructs a new DomParser instance.
+	 *
+	 * @constructor
+	 * @method DomParser
+	 * @param {Object} settings Name/value collection of settings. comment, cdata, text, start and end are callbacks.
+	 * @param {tinymce.html.Schema} schema HTML Schema class to use when parsing.
+	 */
+	return function(settings, schema) {
+		var self = this, nodeFilters = {}, attributeFilters = [], matchedNodes = {}, matchedAttributes = {};
+
+		settings = settings || {};
+		settings.validate = "validate" in settings ? settings.validate : true;
+		settings.root_name = settings.root_name || 'body';
+		self.schema = schema = schema || new Schema();
+
+		function fixInvalidChildren(nodes) {
+			var ni, node, parent, parents, newParent, currentNode, tempNode, childNode, i;
+			var nonEmptyElements, nonSplitableElements, textBlockElements, sibling, nextNode;
+
+			nonSplitableElements = makeMap('tr,td,th,tbody,thead,tfoot,table');
+			nonEmptyElements = schema.getNonEmptyElements();
+			textBlockElements = schema.getTextBlockElements();
+
+			for (ni = 0; ni < nodes.length; ni++) {
+				node = nodes[ni];
+
+				// Already removed or fixed
+				if (!node.parent || node.fixed) {
+					continue;
+				}
+
+				// If the invalid element is a text block and the text block is within a parent LI element
+				// Then unwrap the first text block and convert other sibling text blocks to LI elements similar to Word/Open Office
+				if (textBlockElements[node.name] && node.parent.name == 'li') {
+					// Move sibling text blocks after LI element
+					sibling = node.next;
+					while (sibling) {
+						if (textBlockElements[sibling.name]) {
+							sibling.name = 'li';
+							sibling.fixed = true;
+							node.parent.insert(sibling, node.parent);
+						} else {
+							break;
+						}
+
+						sibling = sibling.next;
+					}
+
+					// Unwrap current text block
+					node.unwrap(node);
+					continue;
+				}
+
+				// Get list of all parent nodes until we find a valid parent to stick the child into
+				parents = [node];
+				for (parent = node.parent; parent && !schema.isValidChild(parent.name, node.name) &&
+					!nonSplitableElements[parent.name]; parent = parent.parent) {
+					parents.push(parent);
+				}
+
+				// Found a suitable parent
+				if (parent && parents.length > 1) {
+					// Reverse the array since it makes looping easier
+					parents.reverse();
+
+					// Clone the related parent and insert that after the moved node
+					newParent = currentNode = self.filterNode(parents[0].clone());
+
+					// Start cloning and moving children on the left side of the target node
+					for (i = 0; i < parents.length - 1; i++) {
+						if (schema.isValidChild(currentNode.name, parents[i].name)) {
+							tempNode = self.filterNode(parents[i].clone());
+							currentNode.append(tempNode);
+						} else {
+							tempNode = currentNode;
+						}
+
+						for (childNode = parents[i].firstChild; childNode && childNode != parents[i + 1];) {
+							nextNode = childNode.next;
+							tempNode.append(childNode);
+							childNode = nextNode;
+						}
+
+						currentNode = tempNode;
+					}
+
+					if (!newParent.isEmpty(nonEmptyElements)) {
+						parent.insert(newParent, parents[0], true);
+						parent.insert(node, newParent);
+					} else {
+						parent.insert(node, parents[0], true);
+					}
+
+					// Check if the element is empty by looking through it's contents and special treatment for <p><br /></p>
+					parent = parents[0];
+					if (parent.isEmpty(nonEmptyElements) || parent.firstChild === parent.lastChild && parent.firstChild.name === 'br') {
+						parent.empty().remove();
+					}
+				} else if (node.parent) {
+					// If it's an LI try to find a UL/OL for it or wrap it
+					if (node.name === 'li') {
+						sibling = node.prev;
+						if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) {
+							sibling.append(node);
+							continue;
+						}
+
+						sibling = node.next;
+						if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) {
+							sibling.insert(node, sibling.firstChild, true);
+							continue;
+						}
+
+						node.wrap(self.filterNode(new Node('ul', 1)));
+						continue;
+					}
+
+					// Try wrapping the element in a DIV
+					if (schema.isValidChild(node.parent.name, 'div') && schema.isValidChild('div', node.name)) {
+						node.wrap(self.filterNode(new Node('div', 1)));
+					} else {
+						// We failed wrapping it, then remove or unwrap it
+						if (node.name === 'style' || node.name === 'script') {
+							node.empty().remove();
+						} else {
+							node.unwrap();
+						}
+					}
+				}
+			}
+		}
+
+		/**
+		 * Runs the specified node though the element and attributes filters.
+		 *
+		 * @method filterNode
+		 * @param {tinymce.html.Node} Node the node to run filters on.
+		 * @return {tinymce.html.Node} The passed in node.
+		 */
+		self.filterNode = function(node) {
+			var i, name, list;
+
+			// Run element filters
+			if (name in nodeFilters) {
+				list = matchedNodes[name];
+
+				if (list) {
+					list.push(node);
+				} else {
+					matchedNodes[name] = [node];
+				}
+			}
+
+			// Run attribute filters
+			i = attributeFilters.length;
+			while (i--) {
+				name = attributeFilters[i].name;
+
+				if (name in node.attributes.map) {
+					list = matchedAttributes[name];
+
+					if (list) {
+						list.push(node);
+					} else {
+						matchedAttributes[name] = [node];
+					}
+				}
+			}
+
+			return node;
+		};
+
+		/**
+		 * Adds a node filter function to the parser, the parser will collect the specified nodes by name
+		 * and then execute the callback ones it has finished parsing the document.
+		 *
+		 * @example
+		 * parser.addNodeFilter('p,h1', function(nodes, name) {
+		 *		for (var i = 0; i < nodes.length; i++) {
+		 *			console.log(nodes[i].name);
+		 *		}
+		 * });
+		 * @method addNodeFilter
+		 * @method {String} name Comma separated list of nodes to collect.
+		 * @param {function} callback Callback function to execute once it has collected nodes.
+		 */
+		self.addNodeFilter = function(name, callback) {
+			each(explode(name), function(name) {
+				var list = nodeFilters[name];
+
+				if (!list) {
+					nodeFilters[name] = list = [];
+				}
+
+				list.push(callback);
+			});
+		};
+
+		/**
+		 * Adds a attribute filter function to the parser, the parser will collect nodes that has the specified attributes
+		 * and then execute the callback ones it has finished parsing the document.
+		 *
+		 * @example
+		 * parser.addAttributeFilter('src,href', function(nodes, name) {
+		 *		for (var i = 0; i < nodes.length; i++) {
+		 *			console.log(nodes[i].name);
+		 *		}
+		 * });
+		 * @method addAttributeFilter
+		 * @method {String} name Comma separated list of nodes to collect.
+		 * @param {function} callback Callback function to execute once it has collected nodes.
+		 */
+		self.addAttributeFilter = function(name, callback) {
+			each(explode(name), function(name) {
+				var i;
+
+				for (i = 0; i < attributeFilters.length; i++) {
+					if (attributeFilters[i].name === name) {
+						attributeFilters[i].callbacks.push(callback);
+						return;
+					}
+				}
+
+				attributeFilters.push({name: name, callbacks: [callback]});
+			});
+		};
+
+		/**
+		 * Parses the specified HTML string into a DOM like node tree and returns the result.
+		 *
+		 * @example
+		 * var rootNode = new DomParser({...}).parse('<b>text</b>');
+		 * @method parse
+		 * @param {String} html Html string to sax parse.
+		 * @param {Object} args Optional args object that gets passed to all filter functions.
+		 * @return {tinymce.html.Node} Root node containing the tree.
+		 */
+		self.parse = function(html, args) {
+			var parser, rootNode, node, nodes, i, l, fi, fl, list, name, validate;
+			var blockElements, startWhiteSpaceRegExp, invalidChildren = [], isInWhiteSpacePreservedElement;
+			var endWhiteSpaceRegExp, allWhiteSpaceRegExp, isAllWhiteSpaceRegExp, whiteSpaceElements;
+			var children, nonEmptyElements, rootBlockName;
+
+			args = args || {};
+			matchedNodes = {};
+			matchedAttributes = {};
+			blockElements = extend(makeMap('script,style,head,html,body,title,meta,param'), schema.getBlockElements());
+			nonEmptyElements = schema.getNonEmptyElements();
+			children = schema.children;
+			validate = settings.validate;
+			rootBlockName = "forced_root_block" in args ? args.forced_root_block : settings.forced_root_block;
+
+			whiteSpaceElements = schema.getWhiteSpaceElements();
+			startWhiteSpaceRegExp = /^[ \t\r\n]+/;
+			endWhiteSpaceRegExp = /[ \t\r\n]+$/;
+			allWhiteSpaceRegExp = /[ \t\r\n]+/g;
+			isAllWhiteSpaceRegExp = /^[ \t\r\n]+$/;
+
+			function addRootBlocks() {
+				var node = rootNode.firstChild, next, rootBlockNode;
+
+				// Removes whitespace at beginning and end of block so:
+				// <p> x </p> -> <p>x</p>
+				function trim(rootBlockNode) {
+					if (rootBlockNode) {
+						node = rootBlockNode.firstChild;
+						if (node && node.type == 3) {
+							node.value = node.value.replace(startWhiteSpaceRegExp, '');
+						}
+
+						node = rootBlockNode.lastChild;
+						if (node && node.type == 3) {
+							node.value = node.value.replace(endWhiteSpaceRegExp, '');
+						}
+					}
+				}
+
+				// Check if rootBlock is valid within rootNode for example if P is valid in H1 if H1 is the contentEditabe root
+				if (!schema.isValidChild(rootNode.name, rootBlockName.toLowerCase())) {
+					return;
+				}
+
+				while (node) {
+					next = node.next;
+
+					if (node.type == 3 || (node.type == 1 && node.name !== 'p' &&
+						!blockElements[node.name] && !node.attr('data-mce-type'))) {
+						if (!rootBlockNode) {
+							// Create a new root block element
+							rootBlockNode = createNode(rootBlockName, 1);
+							rootBlockNode.attr(settings.forced_root_block_attrs);
+							rootNode.insert(rootBlockNode, node);
+							rootBlockNode.append(node);
+						} else {
+							rootBlockNode.append(node);
+						}
+					} else {
+						trim(rootBlockNode);
+						rootBlockNode = null;
+					}
+
+					node = next;
+				}
+
+				trim(rootBlockNode);
+			}
+
+			function createNode(name, type) {
+				var node = new Node(name, type), list;
+
+				if (name in nodeFilters) {
+					list = matchedNodes[name];
+
+					if (list) {
+						list.push(node);
+					} else {
+						matchedNodes[name] = [node];
+					}
+				}
+
+				return node;
+			}
+
+			function removeWhitespaceBefore(node) {
+				var textNode, textVal, sibling;
+
+				for (textNode = node.prev; textNode && textNode.type === 3;) {
+					textVal = textNode.value.replace(endWhiteSpaceRegExp, '');
+
+					if (textVal.length > 0) {
+						textNode.value = textVal;
+						textNode = textNode.prev;
+					} else {
+						sibling = textNode.prev;
+						textNode.remove();
+						textNode = sibling;
+					}
+				}
+			}
+
+			function cloneAndExcludeBlocks(input) {
+				var name, output = {};
+
+				for (name in input) {
+					if (name !== 'li' && name != 'p') {
+						output[name] = input[name];
+					}
+				}
+
+				return output;
+			}
+
+			parser = new SaxParser({
+				validate: validate,
+				allow_script_urls: settings.allow_script_urls,
+				allow_conditional_comments: settings.allow_conditional_comments,
+
+				// Exclude P and LI from DOM parsing since it's treated better by the DOM parser
+				self_closing_elements: cloneAndExcludeBlocks(schema.getSelfClosingElements()),
+
+				cdata: function(text) {
+					node.append(createNode('#cdata', 4)).value = text;
+				},
+
+				text: function(text, raw) {
+					var textNode;
+
+					// Trim all redundant whitespace on non white space elements
+					if (!isInWhiteSpacePreservedElement) {
+						text = text.replace(allWhiteSpaceRegExp, ' ');
+
+						if (node.lastChild && blockElements[node.lastChild.name]) {
+							text = text.replace(startWhiteSpaceRegExp, '');
+						}
+					}
+
+					// Do we need to create the node
+					if (text.length !== 0) {
+						textNode = createNode('#text', 3);
+						textNode.raw = !!raw;
+						node.append(textNode).value = text;
+					}
+				},
+
+				comment: function(text) {
+					node.append(createNode('#comment', 8)).value = text;
+				},
+
+				pi: function(name, text) {
+					node.append(createNode(name, 7)).value = text;
+					removeWhitespaceBefore(node);
+				},
+
+				doctype: function(text) {
+					var newNode;
+
+					newNode = node.append(createNode('#doctype', 10));
+					newNode.value = text;
+					removeWhitespaceBefore(node);
+				},
+
+				start: function(name, attrs, empty) {
+					var newNode, attrFiltersLen, elementRule, attrName, parent;
+
+					elementRule = validate ? schema.getElementRule(name) : {};
+					if (elementRule) {
+						newNode = createNode(elementRule.outputName || name, 1);
+						newNode.attributes = attrs;
+						newNode.shortEnded = empty;
+
+						node.append(newNode);
+
+						// Check if node is valid child of the parent node is the child is
+						// unknown we don't collect it since it's probably a custom element
+						parent = children[node.name];
+						if (parent && children[newNode.name] && !parent[newNode.name]) {
+							invalidChildren.push(newNode);
+						}
+
+						attrFiltersLen = attributeFilters.length;
+						while (attrFiltersLen--) {
+							attrName = attributeFilters[attrFiltersLen].name;
+
+							if (attrName in attrs.map) {
+								list = matchedAttributes[attrName];
+
+								if (list) {
+									list.push(newNode);
+								} else {
+									matchedAttributes[attrName] = [newNode];
+								}
+							}
+						}
+
+						// Trim whitespace before block
+						if (blockElements[name]) {
+							removeWhitespaceBefore(newNode);
+						}
+
+						// Change current node if the element wasn't empty i.e not <br /> or <img />
+						if (!empty) {
+							node = newNode;
+						}
+
+						// Check if we are inside a whitespace preserved element
+						if (!isInWhiteSpacePreservedElement && whiteSpaceElements[name]) {
+							isInWhiteSpacePreservedElement = true;
+						}
+					}
+				},
+
+				end: function(name) {
+					var textNode, elementRule, text, sibling, tempNode;
+
+					elementRule = validate ? schema.getElementRule(name) : {};
+					if (elementRule) {
+						if (blockElements[name]) {
+							if (!isInWhiteSpacePreservedElement) {
+								// Trim whitespace of the first node in a block
+								textNode = node.firstChild;
+								if (textNode && textNode.type === 3) {
+									text = textNode.value.replace(startWhiteSpaceRegExp, '');
+
+									// Any characters left after trim or should we remove it
+									if (text.length > 0) {
+										textNode.value = text;
+										textNode = textNode.next;
+									} else {
+										sibling = textNode.next;
+										textNode.remove();
+										textNode = sibling;
+
+										// Remove any pure whitespace siblings
+										while (textNode && textNode.type === 3) {
+											text = textNode.value;
+											sibling = textNode.next;
+
+											if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) {
+												textNode.remove();
+												textNode = sibling;
+											}
+
+											textNode = sibling;
+										}
+									}
+								}
+
+								// Trim whitespace of the last node in a block
+								textNode = node.lastChild;
+								if (textNode && textNode.type === 3) {
+									text = textNode.value.replace(endWhiteSpaceRegExp, '');
+
+									// Any characters left after trim or should we remove it
+									if (text.length > 0) {
+										textNode.value = text;
+										textNode = textNode.prev;
+									} else {
+										sibling = textNode.prev;
+										textNode.remove();
+										textNode = sibling;
+
+										// Remove any pure whitespace siblings
+										while (textNode && textNode.type === 3) {
+											text = textNode.value;
+											sibling = textNode.prev;
+
+											if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) {
+												textNode.remove();
+												textNode = sibling;
+											}
+
+											textNode = sibling;
+										}
+									}
+								}
+							}
+
+							// Trim start white space
+							// Removed due to: #5424
+							/*textNode = node.prev;
+							if (textNode && textNode.type === 3) {
+								text = textNode.value.replace(startWhiteSpaceRegExp, '');
+
+								if (text.length > 0)
+									textNode.value = text;
+								else
+									textNode.remove();
+							}*/
+						}
+
+						// Check if we exited a whitespace preserved element
+						if (isInWhiteSpacePreservedElement && whiteSpaceElements[name]) {
+							isInWhiteSpacePreservedElement = false;
+						}
+
+						// Handle empty nodes
+						if (elementRule.removeEmpty || elementRule.paddEmpty) {
+							if (node.isEmpty(nonEmptyElements)) {
+								if (elementRule.paddEmpty) {
+									node.empty().append(new Node('#text', '3')).value = '\u00a0';
+								} else {
+									// Leave nodes that have a name like <a name="name">
+									if (!node.attributes.map.name && !node.attributes.map.id) {
+										tempNode = node.parent;
+
+										if (blockElements[node.name]) {
+											node.empty().remove();
+										} else {
+											node.unwrap();
+										}
+
+										node = tempNode;
+										return;
+									}
+								}
+							}
+						}
+
+						node = node.parent;
+					}
+				}
+			}, schema);
+
+			rootNode = node = new Node(args.context || settings.root_name, 11);
+
+			parser.parse(html);
+
+			// Fix invalid children or report invalid children in a contextual parsing
+			if (validate && invalidChildren.length) {
+				if (!args.context) {
+					fixInvalidChildren(invalidChildren);
+				} else {
+					args.invalid = true;
+				}
+			}
+
+			// Wrap nodes in the root into block elements if the root is body
+			if (rootBlockName && (rootNode.name == 'body' || args.isRootContent)) {
+				addRootBlocks();
+			}
+
+			// Run filters only when the contents is valid
+			if (!args.invalid) {
+				// Run node filters
+				for (name in matchedNodes) {
+					list = nodeFilters[name];
+					nodes = matchedNodes[name];
+
+					// Remove already removed children
+					fi = nodes.length;
+					while (fi--) {
+						if (!nodes[fi].parent) {
+							nodes.splice(fi, 1);
+						}
+					}
+
+					for (i = 0, l = list.length; i < l; i++) {
+						list[i](nodes, name, args);
+					}
+				}
+
+				// Run attribute filters
+				for (i = 0, l = attributeFilters.length; i < l; i++) {
+					list = attributeFilters[i];
+
+					if (list.name in matchedAttributes) {
+						nodes = matchedAttributes[list.name];
+
+						// Remove already removed children
+						fi = nodes.length;
+						while (fi--) {
+							if (!nodes[fi].parent) {
+								nodes.splice(fi, 1);
+							}
+						}
+
+						for (fi = 0, fl = list.callbacks.length; fi < fl; fi++) {
+							list.callbacks[fi](nodes, list.name, args);
+						}
+					}
+				}
+			}
+
+			return rootNode;
+		};
+
+		// Remove <br> at end of block elements Gecko and WebKit injects BR elements to
+		// make it possible to place the caret inside empty blocks. This logic tries to remove
+		// these elements and keep br elements that where intended to be there intact
+		if (settings.remove_trailing_brs) {
+			self.addNodeFilter('br', function(nodes) {
+				var i, l = nodes.length, node, blockElements = extend({}, schema.getBlockElements());
+				var nonEmptyElements = schema.getNonEmptyElements(), parent, lastParent, prev, prevName;
+				var elementRule, textNode;
+
+				// Remove brs from body element as well
+				blockElements.body = 1;
+
+				// Must loop forwards since it will otherwise remove all brs in <p>a<br><br><br></p>
+				for (i = 0; i < l; i++) {
+					node = nodes[i];
+					parent = node.parent;
+
+					if (blockElements[node.parent.name] && node === parent.lastChild) {
+						// Loop all nodes to the left of the current node and check for other BR elements
+						// excluding bookmarks since they are invisible
+						prev = node.prev;
+						while (prev) {
+							prevName = prev.name;
+
+							// Ignore bookmarks
+							if (prevName !== "span" || prev.attr('data-mce-type') !== 'bookmark') {
+								// Found a non BR element
+								if (prevName !== "br") {
+									break;
+								}
+
+								// Found another br it's a <br><br> structure then don't remove anything
+								if (prevName === 'br') {
+									node = null;
+									break;
+								}
+							}
+
+							prev = prev.prev;
+						}
+
+						if (node) {
+							node.remove();
+
+							// Is the parent to be considered empty after we removed the BR
+							if (parent.isEmpty(nonEmptyElements)) {
+								elementRule = schema.getElementRule(parent.name);
+
+								// Remove or padd the element depending on schema rule
+								if (elementRule) {
+									if (elementRule.removeEmpty) {
+										parent.remove();
+									} else if (elementRule.paddEmpty) {
+										parent.empty().append(new Node('#text', 3)).value = '\u00a0';
+									}
+								}
+							}
+						}
+					} else {
+						// Replaces BR elements inside inline elements like <p><b><i><br></i></b></p>
+						// so they become <p><b><i>&nbsp;</i></b></p>
+						lastParent = node;
+						while (parent && parent.firstChild === lastParent && parent.lastChild === lastParent) {
+							lastParent = parent;
+
+							if (blockElements[parent.name]) {
+								break;
+							}
+
+							parent = parent.parent;
+						}
+
+						if (lastParent === parent) {
+							textNode = new Node('#text', 3);
+							textNode.value = '\u00a0';
+							node.replace(textNode);
+						}
+					}
+				}
+			});
+		}
+
+		// Force anchor names closed, unless the setting "allow_html_in_named_anchor" is explicitly included.
+		if (!settings.allow_html_in_named_anchor) {
+			self.addAttributeFilter('id,name', function(nodes) {
+				var i = nodes.length, sibling, prevSibling, parent, node;
+
+				while (i--) {
+					node = nodes[i];
+					if (node.name === 'a' && node.firstChild && !node.attr('href')) {
+						parent = node.parent;
+
+						// Move children after current node
+						sibling = node.lastChild;
+						do {
+							prevSibling = sibling.prev;
+							parent.insert(sibling, node);
+							sibling = prevSibling;
+						} while (sibling);
+					}
+				}
+			});
+		}
+
+		if (settings.validate && schema.getValidClasses()) {
+			self.addAttributeFilter('class', function(nodes) {
+				var i = nodes.length, node, classList, ci, className, classValue;
+				var validClasses = schema.getValidClasses(), validClassesMap, valid;
+
+				while (i--) {
+					node = nodes[i];
+					classList = node.attr('class').split(' ');
+					classValue = '';
+
+					for (ci = 0; ci < classList.length; ci++) {
+						className = classList[ci];
+						valid = false;
+
+						validClassesMap = validClasses['*'];
+						if (validClassesMap && validClassesMap[className]) {
+							valid = true;
+						}
+
+						validClassesMap = validClasses[node.name];
+						if (!valid && validClassesMap && validClassesMap[className]) {
+							valid = true;
+						}
+
+						if (valid) {
+							if (classValue) {
+								classValue += ' ';
+							}
+
+							classValue += className;
+						}
+					}
+
+					if (!classValue.length) {
+						classValue = null;
+					}
+
+					node.attr('class', classValue);
+				}
+			});
+		}
+	};
+});
+
+// Included from: js/tinymce/classes/html/Writer.js
+
+/**
+ * Writer.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is used to write HTML tags out it can be used with the Serializer or the SaxParser.
+ *
+ * @class tinymce.html.Writer
+ * @example
+ * var writer = new tinymce.html.Writer({indent: true});
+ * var parser = new tinymce.html.SaxParser(writer).parse('<p><br></p>');
+ * console.log(writer.getContent());
+ *
+ * @class tinymce.html.Writer
+ * @version 3.4
+ */
+define("tinymce/html/Writer", [
+	"tinymce/html/Entities",
+	"tinymce/util/Tools"
+], function(Entities, Tools) {
+	var makeMap = Tools.makeMap;
+
+	/**
+	 * Constructs a new Writer instance.
+	 *
+	 * @constructor
+	 * @method Writer
+	 * @param {Object} settings Name/value settings object.
+	 */
+	return function(settings) {
+		var html = [], indent, indentBefore, indentAfter, encode, htmlOutput;
+
+		settings = settings || {};
+		indent = settings.indent;
+		indentBefore = makeMap(settings.indent_before || '');
+		indentAfter = makeMap(settings.indent_after || '');
+		encode = Entities.getEncodeFunc(settings.entity_encoding || 'raw', settings.entities);
+		htmlOutput = settings.element_format == "html";
+
+		return {
+			/**
+			 * Writes the a start element such as <p id="a">.
+			 *
+			 * @method start
+			 * @param {String} name Name of the element.
+			 * @param {Array} attrs Optional attribute array or undefined if it hasn't any.
+			 * @param {Boolean} empty Optional empty state if the tag should end like <br />.
+			 */
+			start: function(name, attrs, empty) {
+				var i, l, attr, value;
+
+				if (indent && indentBefore[name] && html.length > 0) {
+					value = html[html.length - 1];
+
+					if (value.length > 0 && value !== '\n') {
+						html.push('\n');
+					}
+				}
+
+				html.push('<', name);
+
+				if (attrs) {
+					for (i = 0, l = attrs.length; i < l; i++) {
+						attr = attrs[i];
+						html.push(' ', attr.name, '="', encode(attr.value, true), '"');
+					}
+				}
+
+				if (!empty || htmlOutput) {
+					html[html.length] = '>';
+				} else {
+					html[html.length] = ' />';
+				}
+
+				if (empty && indent && indentAfter[name] && html.length > 0) {
+					value = html[html.length - 1];
+
+					if (value.length > 0 && value !== '\n') {
+						html.push('\n');
+					}
+				}
+			},
+
+			/**
+			 * Writes the a end element such as </p>.
+			 *
+			 * @method end
+			 * @param {String} name Name of the element.
+			 */
+			end: function(name) {
+				var value;
+
+				/*if (indent && indentBefore[name] && html.length > 0) {
+					value = html[html.length - 1];
+
+					if (value.length > 0 && value !== '\n')
+						html.push('\n');
+				}*/
+
+				html.push('</', name, '>');
+
+				if (indent && indentAfter[name] && html.length > 0) {
+					value = html[html.length - 1];
+
+					if (value.length > 0 && value !== '\n') {
+						html.push('\n');
+					}
+				}
+			},
+
+			/**
+			 * Writes a text node.
+			 *
+			 * @method text
+			 * @param {String} text String to write out.
+			 * @param {Boolean} raw Optional raw state if true the contents wont get encoded.
+			 */
+			text: function(text, raw) {
+				if (text.length > 0) {
+					html[html.length] = raw ? text : encode(text);
+				}
+			},
+
+			/**
+			 * Writes a cdata node such as <![CDATA[data]]>.
+			 *
+			 * @method cdata
+			 * @param {String} text String to write out inside the cdata.
+			 */
+			cdata: function(text) {
+				html.push('<![CDATA[', text, ']]>');
+			},
+
+			/**
+			 * Writes a comment node such as <!-- Comment -->.
+			 *
+			 * @method cdata
+			 * @param {String} text String to write out inside the comment.
+			 */
+			comment: function(text) {
+				html.push('<!--', text, '-->');
+			},
+
+			/**
+			 * Writes a PI node such as <?xml attr="value" ?>.
+			 *
+			 * @method pi
+			 * @param {String} name Name of the pi.
+			 * @param {String} text String to write out inside the pi.
+			 */
+			pi: function(name, text) {
+				if (text) {
+					html.push('<?', name, ' ', encode(text), '?>');
+				} else {
+					html.push('<?', name, '?>');
+				}
+
+				if (indent) {
+					html.push('\n');
+				}
+			},
+
+			/**
+			 * Writes a doctype node such as <!DOCTYPE data>.
+			 *
+			 * @method doctype
+			 * @param {String} text String to write out inside the doctype.
+			 */
+			doctype: function(text) {
+				html.push('<!DOCTYPE', text, '>', indent ? '\n' : '');
+			},
+
+			/**
+			 * Resets the internal buffer if one wants to reuse the writer.
+			 *
+			 * @method reset
+			 */
+			reset: function() {
+				html.length = 0;
+			},
+
+			/**
+			 * Returns the contents that got serialized.
+			 *
+			 * @method getContent
+			 * @return {String} HTML contents that got written down.
+			 */
+			getContent: function() {
+				return html.join('').replace(/\n$/, '');
+			}
+		};
+	};
+});
+
+// Included from: js/tinymce/classes/html/Serializer.js
+
+/**
+ * Serializer.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is used to serialize down the DOM tree into a string using a Writer instance.
+ *
+ *
+ * @example
+ * new tinymce.html.Serializer().serialize(new tinymce.html.DomParser().parse('<p>text</p>'));
+ * @class tinymce.html.Serializer
+ * @version 3.4
+ */
+define("tinymce/html/Serializer", [
+	"tinymce/html/Writer",
+	"tinymce/html/Schema"
+], function(Writer, Schema) {
+	/**
+	 * Constructs a new Serializer instance.
+	 *
+	 * @constructor
+	 * @method Serializer
+	 * @param {Object} settings Name/value settings object.
+	 * @param {tinymce.html.Schema} schema Schema instance to use.
+	 */
+	return function(settings, schema) {
+		var self = this, writer = new Writer(settings);
+
+		settings = settings || {};
+		settings.validate = "validate" in settings ? settings.validate : true;
+
+		self.schema = schema = schema || new Schema();
+		self.writer = writer;
+
+		/**
+		 * Serializes the specified node into a string.
+		 *
+		 * @example
+		 * new tinymce.html.Serializer().serialize(new tinymce.html.DomParser().parse('<p>text</p>'));
+		 * @method serialize
+		 * @param {tinymce.html.Node} node Node instance to serialize.
+		 * @return {String} String with HTML based on DOM tree.
+		 */
+		self.serialize = function(node) {
+			var handlers, validate;
+
+			validate = settings.validate;
+
+			handlers = {
+				// #text
+				3: function(node) {
+					writer.text(node.value, node.raw);
+				},
+
+				// #comment
+				8: function(node) {
+					writer.comment(node.value);
+				},
+
+				// Processing instruction
+				7: function(node) {
+					writer.pi(node.name, node.value);
+				},
+
+				// Doctype
+				10: function(node) {
+					writer.doctype(node.value);
+				},
+
+				// CDATA
+				4: function(node) {
+					writer.cdata(node.value);
+				},
+
+				// Document fragment
+				11: function(node) {
+					if ((node = node.firstChild)) {
+						do {
+							walk(node);
+						} while ((node = node.next));
+					}
+				}
+			};
+
+			writer.reset();
+
+			function walk(node) {
+				var handler = handlers[node.type], name, isEmpty, attrs, attrName, attrValue, sortedAttrs, i, l, elementRule;
+
+				if (!handler) {
+					name = node.name;
+					isEmpty = node.shortEnded;
+					attrs = node.attributes;
+
+					// Sort attributes
+					if (validate && attrs && attrs.length > 1) {
+						sortedAttrs = [];
+						sortedAttrs.map = {};
+
+						elementRule = schema.getElementRule(node.name);
+						for (i = 0, l = elementRule.attributesOrder.length; i < l; i++) {
+							attrName = elementRule.attributesOrder[i];
+
+							if (attrName in attrs.map) {
+								attrValue = attrs.map[attrName];
+								sortedAttrs.map[attrName] = attrValue;
+								sortedAttrs.push({name: attrName, value: attrValue});
+							}
+						}
+
+						for (i = 0, l = attrs.length; i < l; i++) {
+							attrName = attrs[i].name;
+
+							if (!(attrName in sortedAttrs.map)) {
+								attrValue = attrs.map[attrName];
+								sortedAttrs.map[attrName] = attrValue;
+								sortedAttrs.push({name: attrName, value: attrValue});
+							}
+						}
+
+						attrs = sortedAttrs;
+					}
+
+					writer.start(node.name, attrs, isEmpty);
+
+					if (!isEmpty) {
+						if ((node = node.firstChild)) {
+							do {
+								walk(node);
+							} while ((node = node.next));
+						}
+
+						writer.end(name);
+					}
+				} else {
+					handler(node);
+				}
+			}
+
+			// Serialize element and treat all non elements as fragments
+			if (node.type == 1 && !settings.inner) {
+				walk(node);
+			} else {
+				handlers[11](node);
+			}
+
+			return writer.getContent();
+		};
+	};
+});
+
+// Included from: js/tinymce/classes/dom/Serializer.js
+
+/**
+ * Serializer.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is used to serialize DOM trees into a string. Consult the TinyMCE Wiki API for
+ * more details and examples on how to use this class.
+ *
+ * @class tinymce.dom.Serializer
+ */
+define("tinymce/dom/Serializer", [
+	"tinymce/dom/DOMUtils",
+	"tinymce/html/DomParser",
+	"tinymce/html/Entities",
+	"tinymce/html/Serializer",
+	"tinymce/html/Node",
+	"tinymce/html/Schema",
+	"tinymce/Env",
+	"tinymce/util/Tools"
+], function(DOMUtils, DomParser, Entities, Serializer, Node, Schema, Env, Tools) {
+	var each = Tools.each, trim = Tools.trim;
+	var DOM = DOMUtils.DOM;
+
+	/**
+	 * Constructs a new DOM serializer class.
+	 *
+	 * @constructor
+	 * @method Serializer
+	 * @param {Object} settings Serializer settings object.
+	 * @param {tinymce.Editor} editor Optional editor to bind events to and get schema/dom from.
+	 */
+	return function(settings, editor) {
+		var dom, schema, htmlParser;
+
+		if (editor) {
+			dom = editor.dom;
+			schema = editor.schema;
+		}
+
+		// Default DOM and Schema if they are undefined
+		dom = dom || DOM;
+		schema = schema || new Schema(settings);
+		settings.entity_encoding = settings.entity_encoding || 'named';
+		settings.remove_trailing_brs = "remove_trailing_brs" in settings ? settings.remove_trailing_brs : true;
+
+		htmlParser = new DomParser(settings, schema);
+
+		// Convert tabindex back to elements when serializing contents
+		htmlParser.addAttributeFilter('data-mce-tabindex', function(nodes, name) {
+			var i = nodes.length, node;
+
+			while (i--) {
+				node = nodes[i];
+				node.attr('tabindex', node.attributes.map['data-mce-tabindex']);
+				node.attr(name, null);
+			}
+		});
+
+		// Convert move data-mce-src, data-mce-href and data-mce-style into nodes or process them if needed
+		htmlParser.addAttributeFilter('src,href,style', function(nodes, name) {
+			var i = nodes.length, node, value, internalName = 'data-mce-' + name;
+			var urlConverter = settings.url_converter, urlConverterScope = settings.url_converter_scope, undef;
+
+			while (i--) {
+				node = nodes[i];
+
+				value = node.attributes.map[internalName];
+				if (value !== undef) {
+					// Set external name to internal value and remove internal
+					node.attr(name, value.length > 0 ? value : null);
+					node.attr(internalName, null);
+				} else {
+					// No internal attribute found then convert the value we have in the DOM
+					value = node.attributes.map[name];
+
+					if (name === "style") {
+						value = dom.serializeStyle(dom.parseStyle(value), node.name);
+					} else if (urlConverter) {
+						value = urlConverter.call(urlConverterScope, value, name, node.name);
+					}
+
+					node.attr(name, value.length > 0 ? value : null);
+				}
+			}
+		});
+
+		// Remove internal classes mceItem<..> or mceSelected
+		htmlParser.addAttributeFilter('class', function(nodes) {
+			var i = nodes.length, node, value;
+
+			while (i--) {
+				node = nodes[i];
+				value = node.attr('class');
+
+				if (value) {
+					value = node.attr('class').replace(/(?:^|\s)mce-item-\w+(?!\S)/g, '');
+					node.attr('class', value.length > 0 ? value : null);
+				}
+			}
+		});
+
+		// Remove bookmark elements
+		htmlParser.addAttributeFilter('data-mce-type', function(nodes, name, args) {
+			var i = nodes.length, node;
+
+			while (i--) {
+				node = nodes[i];
+
+				if (node.attributes.map['data-mce-type'] === 'bookmark' && !args.cleanup) {
+					node.remove();
+				}
+			}
+		});
+
+		htmlParser.addNodeFilter('noscript', function(nodes) {
+			var i = nodes.length, node;
+
+			while (i--) {
+				node = nodes[i].firstChild;
+
+				if (node) {
+					node.value = Entities.decode(node.value);
+				}
+			}
+		});
+
+		// Force script into CDATA sections and remove the mce- prefix also add comments around styles
+		htmlParser.addNodeFilter('script,style', function(nodes, name) {
+			var i = nodes.length, node, value, type;
+
+			function trim(value) {
+				/*jshint maxlen:255 */
+				/*eslint max-len:0 */
+				return value.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, '');
+			}
+
+			while (i--) {
+				node = nodes[i];
+				value = node.firstChild ? node.firstChild.value : '';
+
+				if (name === "script") {
+					// Remove mce- prefix from script elements and remove default type since the user specified
+					// a script element without type attribute
+					type = node.attr('type');
+					if (type) {
+						node.attr('type', type == 'mce-no/type' ? null : type.replace(/^mce\-/, ''));
+					}
+
+					if (value.length > 0) {
+						node.firstChild.value = '// <![CDATA[\n' + trim(value) + '\n// ]]>';
+					}
+				} else {
+					if (value.length > 0) {
+						node.firstChild.value = '<!--\n' + trim(value) + '\n-->';
+					}
+				}
+			}
+		});
+
+		// Convert comments to cdata and handle protected comments
+		htmlParser.addNodeFilter('#comment', function(nodes) {
+			var i = nodes.length, node;
+
+			while (i--) {
+				node = nodes[i];
+
+				if (node.value.indexOf('[CDATA[') === 0) {
+					node.name = '#cdata';
+					node.type = 4;
+					node.value = node.value.replace(/^\[CDATA\[|\]\]$/g, '');
+				} else if (node.value.indexOf('mce:protected ') === 0) {
+					node.name = "#text";
+					node.type = 3;
+					node.raw = true;
+					node.value = unescape(node.value).substr(14);
+				}
+			}
+		});
+
+		htmlParser.addNodeFilter('xml:namespace,input', function(nodes, name) {
+			var i = nodes.length, node;
+
+			while (i--) {
+				node = nodes[i];
+				if (node.type === 7) {
+					node.remove();
+				} else if (node.type === 1) {
+					if (name === "input" && !("type" in node.attributes.map)) {
+						node.attr('type', 'text');
+					}
+				}
+			}
+		});
+
+		// Fix list elements, TODO: Replace this later
+		if (settings.fix_list_elements) {
+			htmlParser.addNodeFilter('ul,ol', function(nodes) {
+				var i = nodes.length, node, parentNode;
+
+				while (i--) {
+					node = nodes[i];
+					parentNode = node.parent;
+
+					if (parentNode.name === 'ul' || parentNode.name === 'ol') {
+						if (node.prev && node.prev.name === 'li') {
+							node.prev.append(node);
+						}
+					}
+				}
+			});
+		}
+
+		// Remove internal data attributes
+		htmlParser.addAttributeFilter(
+			'data-mce-src,data-mce-href,data-mce-style,' +
+			'data-mce-selected,data-mce-expando,' +
+			'data-mce-type,data-mce-resize',
+
+			function(nodes, name) {
+				var i = nodes.length;
+
+				while (i--) {
+					nodes[i].attr(name, null);
+				}
+			}
+		);
+
+		// Return public methods
+		return {
+			/**
+			 * Schema instance that was used to when the Serializer was constructed.
+			 *
+			 * @field {tinymce.html.Schema} schema
+			 */
+			schema: schema,
+
+			/**
+			 * Adds a node filter function to the parser used by the serializer, the parser will collect the specified nodes by name
+			 * and then execute the callback ones it has finished parsing the document.
+			 *
+			 * @example
+			 * parser.addNodeFilter('p,h1', function(nodes, name) {
+			 *		for (var i = 0; i < nodes.length; i++) {
+			 *			console.log(nodes[i].name);
+			 *		}
+			 * });
+			 * @method addNodeFilter
+			 * @method {String} name Comma separated list of nodes to collect.
+			 * @param {function} callback Callback function to execute once it has collected nodes.
+			 */
+			addNodeFilter: htmlParser.addNodeFilter,
+
+			/**
+			 * Adds a attribute filter function to the parser used by the serializer, the parser will
+			 * collect nodes that has the specified attributes
+			 * and then execute the callback ones it has finished parsing the document.
+			 *
+			 * @example
+			 * parser.addAttributeFilter('src,href', function(nodes, name) {
+			 *		for (var i = 0; i < nodes.length; i++) {
+			 *			console.log(nodes[i].name);
+			 *		}
+			 * });
+			 * @method addAttributeFilter
+			 * @method {String} name Comma separated list of nodes to collect.
+			 * @param {function} callback Callback function to execute once it has collected nodes.
+			 */
+			addAttributeFilter: htmlParser.addAttributeFilter,
+
+			/**
+			 * Serializes the specified browser DOM node into a HTML string.
+			 *
+			 * @method serialize
+			 * @param {DOMNode} node DOM node to serialize.
+			 * @param {Object} args Arguments option that gets passed to event handlers.
+			 */
+			serialize: function(node, args) {
+				var self = this, impl, doc, oldDoc, htmlSerializer, content;
+
+				// Explorer won't clone contents of script and style and the
+				// selected index of select elements are cleared on a clone operation.
+				if (Env.ie && dom.select('script,style,select,map').length > 0) {
+					content = node.innerHTML;
+					node = node.cloneNode(false);
+					dom.setHTML(node, content);
+				} else {
+					node = node.cloneNode(true);
+				}
+
+				// Nodes needs to be attached to something in WebKit/Opera
+				// This fix will make DOM ranges and make Sizzle happy!
+				impl = node.ownerDocument.implementation;
+				if (impl.createHTMLDocument) {
+					// Create an empty HTML document
+					doc = impl.createHTMLDocument("");
+
+					// Add the element or it's children if it's a body element to the new document
+					each(node.nodeName == 'BODY' ? node.childNodes : [node], function(node) {
+						doc.body.appendChild(doc.importNode(node, true));
+					});
+
+					// Grab first child or body element for serialization
+					if (node.nodeName != 'BODY') {
+						node = doc.body.firstChild;
+					} else {
+						node = doc.body;
+					}
+
+					// set the new document in DOMUtils so createElement etc works
+					oldDoc = dom.doc;
+					dom.doc = doc;
+				}
+
+				args = args || {};
+				args.format = args.format || 'html';
+
+				// Don't wrap content if we want selected html
+				if (args.selection) {
+					args.forced_root_block = '';
+				}
+
+				// Pre process
+				if (!args.no_events) {
+					args.node = node;
+					self.onPreProcess(args);
+				}
+
+				// Setup serializer
+				htmlSerializer = new Serializer(settings, schema);
+
+				// Parse and serialize HTML
+				args.content = htmlSerializer.serialize(
+					htmlParser.parse(trim(args.getInner ? node.innerHTML : dom.getOuterHTML(node)), args)
+				);
+
+				// Replace all BOM characters for now until we can find a better solution
+				if (!args.cleanup) {
+					args.content = args.content.replace(/\uFEFF/g, '');
+				}
+
+				// Post process
+				if (!args.no_events) {
+					self.onPostProcess(args);
+				}
+
+				// Restore the old document if it was changed
+				if (oldDoc) {
+					dom.doc = oldDoc;
+				}
+
+				args.node = null;
+
+				return args.content;
+			},
+
+			/**
+			 * Adds valid elements rules to the serializers schema instance this enables you to specify things
+			 * like what elements should be outputted and what attributes specific elements might have.
+			 * Consult the Wiki for more details on this format.
+			 *
+			 * @method addRules
+			 * @param {String} rules Valid elements rules string to add to schema.
+			 */
+			addRules: function(rules) {
+				schema.addValidElements(rules);
+			},
+
+			/**
+			 * Sets the valid elements rules to the serializers schema instance this enables you to specify things
+			 * like what elements should be outputted and what attributes specific elements might have.
+			 * Consult the Wiki for more details on this format.
+			 *
+			 * @method setRules
+			 * @param {String} rules Valid elements rules string.
+			 */
+			setRules: function(rules) {
+				schema.setValidElements(rules);
+			},
+
+			onPreProcess: function(args) {
+				if (editor) {
+					editor.fire('PreProcess', args);
+				}
+			},
+
+			onPostProcess: function(args) {
+				if (editor) {
+					editor.fire('PostProcess', args);
+				}
+			}
+		};
+	};
+});
+
+// Included from: js/tinymce/classes/dom/TridentSelection.js
+
+/**
+ * TridentSelection.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Selection class for old explorer versions. This one fakes the
+ * native selection object available on modern browsers.
+ *
+ * @class tinymce.dom.TridentSelection
+ */
+define("tinymce/dom/TridentSelection", [], function() {
+	function Selection(selection) {
+		var self = this, dom = selection.dom, FALSE = false;
+
+		function getPosition(rng, start) {
+			var checkRng, startIndex = 0, endIndex, inside,
+				children, child, offset, index, position = -1, parent;
+
+			// Setup test range, collapse it and get the parent
+			checkRng = rng.duplicate();
+			checkRng.collapse(start);
+			parent = checkRng.parentElement();
+
+			// Check if the selection is within the right document
+			if (parent.ownerDocument !== selection.dom.doc) {
+				return;
+			}
+
+			// IE will report non editable elements as it's parent so look for an editable one
+			while (parent.contentEditable === "false") {
+				parent = parent.parentNode;
+			}
+
+			// If parent doesn't have any children then return that we are inside the element
+			if (!parent.hasChildNodes()) {
+				return {node: parent, inside: 1};
+			}
+
+			// Setup node list and endIndex
+			children = parent.children;
+			endIndex = children.length - 1;
+
+			// Perform a binary search for the position
+			while (startIndex <= endIndex) {
+				index = Math.floor((startIndex + endIndex) / 2);
+
+				// Move selection to node and compare the ranges
+				child = children[index];
+				checkRng.moveToElementText(child);
+				position = checkRng.compareEndPoints(start ? 'StartToStart' : 'EndToEnd', rng);
+
+				// Before/after or an exact match
+				if (position > 0) {
+					endIndex = index - 1;
+				} else if (position < 0) {
+					startIndex = index + 1;
+				} else {
+					return {node: child};
+				}
+			}
+
+			// Check if child position is before or we didn't find a position
+			if (position < 0) {
+				// No element child was found use the parent element and the offset inside that
+				if (!child) {
+					checkRng.moveToElementText(parent);
+					checkRng.collapse(true);
+					child = parent;
+					inside = true;
+				} else {
+					checkRng.collapse(false);
+				}
+
+				// Walk character by character in text node until we hit the selected range endpoint,
+				// hit the end of document or parent isn't the right one
+				// We need to walk char by char since rng.text or rng.htmlText will trim line endings
+				offset = 0;
+				while (checkRng.compareEndPoints(start ? 'StartToStart' : 'StartToEnd', rng) !== 0) {
+					if (checkRng.move('character', 1) === 0 || parent != checkRng.parentElement()) {
+						break;
+					}
+
+					offset++;
+				}
+			} else {
+				// Child position is after the selection endpoint
+				checkRng.collapse(true);
+
+				// Walk character by character in text node until we hit the selected range endpoint, hit
+				// the end of document or parent isn't the right one
+				offset = 0;
+				while (checkRng.compareEndPoints(start ? 'StartToStart' : 'StartToEnd', rng) !== 0) {
+					if (checkRng.move('character', -1) === 0 || parent != checkRng.parentElement()) {
+						break;
+					}
+
+					offset++;
+				}
+			}
+
+			return {node: child, position: position, offset: offset, inside: inside};
+		}
+
+		// Returns a W3C DOM compatible range object by using the IE Range API
+		function getRange() {
+			var ieRange = selection.getRng(), domRange = dom.createRng(), element, collapsed, tmpRange, element2, bookmark;
+
+			// If selection is outside the current document just return an empty range
+			element = ieRange.item ? ieRange.item(0) : ieRange.parentElement();
+			if (element.ownerDocument != dom.doc) {
+				return domRange;
+			}
+
+			collapsed = selection.isCollapsed();
+
+			// Handle control selection
+			if (ieRange.item) {
+				domRange.setStart(element.parentNode, dom.nodeIndex(element));
+				domRange.setEnd(domRange.startContainer, domRange.startOffset + 1);
+
+				return domRange;
+			}
+
+			function findEndPoint(start) {
+				var endPoint = getPosition(ieRange, start), container, offset, textNodeOffset = 0, sibling, undef, nodeValue;
+
+				container = endPoint.node;
+				offset = endPoint.offset;
+
+				if (endPoint.inside && !container.hasChildNodes()) {
+					domRange[start ? 'setStart' : 'setEnd'](container, 0);
+					return;
+				}
+
+				if (offset === undef) {
+					domRange[start ? 'setStartBefore' : 'setEndAfter'](container);
+					return;
+				}
+
+				if (endPoint.position < 0) {
+					sibling = endPoint.inside ? container.firstChild : container.nextSibling;
+
+					if (!sibling) {
+						domRange[start ? 'setStartAfter' : 'setEndAfter'](container);
+						return;
+					}
+
+					if (!offset) {
+						if (sibling.nodeType == 3) {
+							domRange[start ? 'setStart' : 'setEnd'](sibling, 0);
+						} else {
+							domRange[start ? 'setStartBefore' : 'setEndBefore'](sibling);
+						}
+
+						return;
+					}
+
+					// Find the text node and offset
+					while (sibling) {
+						if (sibling.nodeType == 3) {
+							nodeValue = sibling.nodeValue;
+							textNodeOffset += nodeValue.length;
+
+							// We are at or passed the position we where looking for
+							if (textNodeOffset >= offset) {
+								container = sibling;
+								textNodeOffset -= offset;
+								textNodeOffset = nodeValue.length - textNodeOffset;
+								break;
+							}
+						}
+
+						sibling = sibling.nextSibling;
+					}
+				} else {
+					// Find the text node and offset
+					sibling = container.previousSibling;
+
+					if (!sibling) {
+						return domRange[start ? 'setStartBefore' : 'setEndBefore'](container);
+					}
+
+					// If there isn't any text to loop then use the first position
+					if (!offset) {
+						if (container.nodeType == 3) {
+							domRange[start ? 'setStart' : 'setEnd'](sibling, container.nodeValue.length);
+						} else {
+							domRange[start ? 'setStartAfter' : 'setEndAfter'](sibling);
+						}
+
+						return;
+					}
+
+					while (sibling) {
+						if (sibling.nodeType == 3) {
+							textNodeOffset += sibling.nodeValue.length;
+
+							// We are at or passed the position we where looking for
+							if (textNodeOffset >= offset) {
+								container = sibling;
+								textNodeOffset -= offset;
+								break;
+							}
+						}
+
+						sibling = sibling.previousSibling;
+					}
+				}
+
+				domRange[start ? 'setStart' : 'setEnd'](container, textNodeOffset);
+			}
+
+			try {
+				// Find start point
+				findEndPoint(true);
+
+				// Find end point if needed
+				if (!collapsed) {
+					findEndPoint();
+				}
+			} catch (ex) {
+				// IE has a nasty bug where text nodes might throw "invalid argument" when you
+				// access the nodeValue or other properties of text nodes. This seems to happend when
+				// text nodes are split into two nodes by a delete/backspace call. So lets detect it and try to fix it.
+				if (ex.number == -2147024809) {
+					// Get the current selection
+					bookmark = self.getBookmark(2);
+
+					// Get start element
+					tmpRange = ieRange.duplicate();
+					tmpRange.collapse(true);
+					element = tmpRange.parentElement();
+
+					// Get end element
+					if (!collapsed) {
+						tmpRange = ieRange.duplicate();
+						tmpRange.collapse(false);
+						element2 = tmpRange.parentElement();
+						element2.innerHTML = element2.innerHTML;
+					}
+
+					// Remove the broken elements
+					element.innerHTML = element.innerHTML;
+
+					// Restore the selection
+					self.moveToBookmark(bookmark);
+
+					// Since the range has moved we need to re-get it
+					ieRange = selection.getRng();
+
+					// Find start point
+					findEndPoint(true);
+
+					// Find end point if needed
+					if (!collapsed) {
+						findEndPoint();
+					}
+				} else {
+					throw ex; // Throw other errors
+				}
+			}
+
+			return domRange;
+		}
+
+		this.getBookmark = function(type) {
+			var rng = selection.getRng(), bookmark = {};
+
+			function getIndexes(node) {
+				var parent, root, children, i, indexes = [];
+
+				parent = node.parentNode;
+				root = dom.getRoot().parentNode;
+
+				while (parent != root && parent.nodeType !== 9) {
+					children = parent.children;
+
+					i = children.length;
+					while (i--) {
+						if (node === children[i]) {
+							indexes.push(i);
+							break;
+						}
+					}
+
+					node = parent;
+					parent = parent.parentNode;
+				}
+
+				return indexes;
+			}
+
+			function getBookmarkEndPoint(start) {
+				var position;
+
+				position = getPosition(rng, start);
+				if (position) {
+					return {
+						position: position.position,
+						offset: position.offset,
+						indexes: getIndexes(position.node),
+						inside: position.inside
+					};
+				}
+			}
+
+			// Non ubstructive bookmark
+			if (type === 2) {
+				// Handle text selection
+				if (!rng.item) {
+					bookmark.start = getBookmarkEndPoint(true);
+
+					if (!selection.isCollapsed()) {
+						bookmark.end = getBookmarkEndPoint();
+					}
+				} else {
+					bookmark.start = {ctrl: true, indexes: getIndexes(rng.item(0))};
+				}
+			}
+
+			return bookmark;
+		};
+
+		this.moveToBookmark = function(bookmark) {
+			var rng, body = dom.doc.body;
+
+			function resolveIndexes(indexes) {
+				var node, i, idx, children;
+
+				node = dom.getRoot();
+				for (i = indexes.length - 1; i >= 0; i--) {
+					children = node.children;
+					idx = indexes[i];
+
+					if (idx <= children.length - 1) {
+						node = children[idx];
+					}
+				}
+
+				return node;
+			}
+
+			function setBookmarkEndPoint(start) {
+				var endPoint = bookmark[start ? 'start' : 'end'], moveLeft, moveRng, undef, offset;
+
+				if (endPoint) {
+					moveLeft = endPoint.position > 0;
+
+					moveRng = body.createTextRange();
+					moveRng.moveToElementText(resolveIndexes(endPoint.indexes));
+
+					offset = endPoint.offset;
+					if (offset !== undef) {
+						moveRng.collapse(endPoint.inside || moveLeft);
+						moveRng.moveStart('character', moveLeft ? -offset : offset);
+					} else {
+						moveRng.collapse(start);
+					}
+
+					rng.setEndPoint(start ? 'StartToStart' : 'EndToStart', moveRng);
+
+					if (start) {
+						rng.collapse(true);
+					}
+				}
+			}
+
+			if (bookmark.start) {
+				if (bookmark.start.ctrl) {
+					rng = body.createControlRange();
+					rng.addElement(resolveIndexes(bookmark.start.indexes));
+					rng.select();
+				} else {
+					rng = body.createTextRange();
+					setBookmarkEndPoint(true);
+					setBookmarkEndPoint();
+					rng.select();
+				}
+			}
+		};
+
+		this.addRange = function(rng) {
+			var ieRng, ctrlRng, startContainer, startOffset, endContainer, endOffset, sibling,
+				doc = selection.dom.doc, body = doc.body, nativeRng, ctrlElm;
+
+			function setEndPoint(start) {
+				var container, offset, marker, tmpRng, nodes;
+
+				marker = dom.create('a');
+				container = start ? startContainer : endContainer;
+				offset = start ? startOffset : endOffset;
+				tmpRng = ieRng.duplicate();
+
+				if (container == doc || container == doc.documentElement) {
+					container = body;
+					offset = 0;
+				}
+
+				if (container.nodeType == 3) {
+					container.parentNode.insertBefore(marker, container);
+					tmpRng.moveToElementText(marker);
+					tmpRng.moveStart('character', offset);
+					dom.remove(marker);
+					ieRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', tmpRng);
+				} else {
+					nodes = container.childNodes;
+
+					if (nodes.length) {
+						if (offset >= nodes.length) {
+							dom.insertAfter(marker, nodes[nodes.length - 1]);
+						} else {
+							container.insertBefore(marker, nodes[offset]);
+						}
+
+						tmpRng.moveToElementText(marker);
+					} else if (container.canHaveHTML) {
+						// Empty node selection for example <div>|</div>
+						// Setting innerHTML with a span marker then remove that marker seems to keep empty block elements open
+						container.innerHTML = '<span>&#xFEFF;</span>';
+						marker = container.firstChild;
+						tmpRng.moveToElementText(marker);
+						tmpRng.collapse(FALSE); // Collapse false works better than true for some odd reason
+					}
+
+					ieRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', tmpRng);
+					dom.remove(marker);
+				}
+			}
+
+			// Setup some shorter versions
+			startContainer = rng.startContainer;
+			startOffset = rng.startOffset;
+			endContainer = rng.endContainer;
+			endOffset = rng.endOffset;
+			ieRng = body.createTextRange();
+
+			// If single element selection then try making a control selection out of it
+			if (startContainer == endContainer && startContainer.nodeType == 1) {
+				// Trick to place the caret inside an empty block element like <p></p>
+				if (startOffset == endOffset && !startContainer.hasChildNodes()) {
+					if (startContainer.canHaveHTML) {
+						// Check if previous sibling is an empty block if it is then we need to render it
+						// IE would otherwise move the caret into the sibling instead of the empty startContainer see: #5236
+						// Example this: <p></p><p>|</p> would become this: <p>|</p><p></p>
+						sibling = startContainer.previousSibling;
+						if (sibling && !sibling.hasChildNodes() && dom.isBlock(sibling)) {
+							sibling.innerHTML = '&#xFEFF;';
+						} else {
+							sibling = null;
+						}
+
+						startContainer.innerHTML = '<span>&#xFEFF;</span><span>&#xFEFF;</span>';
+						ieRng.moveToElementText(startContainer.lastChild);
+						ieRng.select();
+						dom.doc.selection.clear();
+						startContainer.innerHTML = '';
+
+						if (sibling) {
+							sibling.innerHTML = '';
+						}
+						return;
+					} else {
+						startOffset = dom.nodeIndex(startContainer);
+						startContainer = startContainer.parentNode;
+					}
+				}
+
+				if (startOffset == endOffset - 1) {
+					try {
+						ctrlElm = startContainer.childNodes[startOffset];
+						ctrlRng = body.createControlRange();
+						ctrlRng.addElement(ctrlElm);
+						ctrlRng.select();
+
+						// Check if the range produced is on the correct element and is a control range
+						// On IE 8 it will select the parent contentEditable container if you select an inner element see: #5398
+						nativeRng = selection.getRng();
+						if (nativeRng.item && ctrlElm === nativeRng.item(0)) {
+							return;
+						}
+					} catch (ex) {
+						// Ignore
+					}
+				}
+			}
+
+			// Set start/end point of selection
+			setEndPoint(true);
+			setEndPoint();
+
+			// Select the new range and scroll it into view
+			ieRng.select();
+		};
+
+		// Expose range method
+		this.getRangeAt = getRange;
+	}
+
+	return Selection;
+});
+
+// Included from: js/tinymce/classes/util/VK.js
+
+/**
+ * VK.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This file exposes a set of the common KeyCodes for use.  Please grow it as needed.
+ */
+define("tinymce/util/VK", [
+	"tinymce/Env"
+], function(Env) {
+	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 || this.metaKeyPressed(e);
+		},
+
+		metaKeyPressed: function(e) {
+			// Check if ctrl or meta key is pressed. Edge case for AltGr on Windows where it produces ctrlKey+altKey states
+			return (Env.mac ? e.metaKey : e.ctrlKey && !e.altKey);
+		}
+	};
+});
+
+// Included from: js/tinymce/classes/dom/ControlSelection.js
+
+/**
+ * ControlSelection.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles control selection of elements. Controls are elements
+ * that can be resized and needs to be selected as a whole. It adds custom resize handles
+ * to all browser engines that support properly disabling the built in resize logic.
+ *
+ * @class tinymce.dom.ControlSelection
+ */
+define("tinymce/dom/ControlSelection", [
+	"tinymce/util/VK",
+	"tinymce/util/Tools",
+	"tinymce/Env"
+], function(VK, Tools, Env) {
+	return function(selection, editor) {
+		var dom = editor.dom, each = Tools.each;
+		var selectedElm, selectedElmGhost, resizeHelper, resizeHandles, selectedHandle, lastMouseDownEvent;
+		var startX, startY, selectedElmX, selectedElmY, startW, startH, ratio, resizeStarted;
+		var width, height, editableDoc = editor.getDoc(), rootDocument = document, isIE = Env.ie && Env.ie < 11;
+		var abs = Math.abs, round = Math.round, rootElement = editor.getBody(), startScrollWidth, startScrollHeight;
+
+		// Details about each resize handle how to scale etc
+		resizeHandles = {
+			// Name: x multiplier, y multiplier, delta size x, delta size y
+			n: [0.5, 0, 0, -1],
+			e: [1, 0.5, 1, 0],
+			s: [0.5, 1, 0, 1],
+			w: [0, 0.5, -1, 0],
+			nw: [0, 0, -1, -1],
+			ne: [1, 0, 1, -1],
+			se: [1, 1, 1, 1],
+			sw: [0, 1, -1, 1]
+		};
+
+		// Add CSS for resize handles, cloned element and selected
+		var rootClass = '.mce-content-body';
+		editor.contentStyles.push(
+			rootClass + ' div.mce-resizehandle {' +
+				'position: absolute;' +
+				'border: 1px solid black;' +
+				'background: #FFF;' +
+				'width: 5px;' +
+				'height: 5px;' +
+				'z-index: 10000' +
+			'}' +
+			rootClass + ' .mce-resizehandle:hover {' +
+				'background: #000' +
+			'}' +
+			rootClass + ' img[data-mce-selected], hr[data-mce-selected] {' +
+				'outline: 1px solid black;' +
+				'resize: none' + // Have been talks about implementing this in browsers
+			'}' +
+			rootClass + ' .mce-clonedresizable {' +
+				'position: absolute;' +
+				(Env.gecko ? '' : 'outline: 1px dashed black;') + // Gecko produces trails while resizing
+				'opacity: .5;' +
+				'filter: alpha(opacity=50);' +
+				'z-index: 10000' +
+			'}' +
+			rootClass + ' .mce-resize-helper {' +
+				'background: #555;' +
+				'background: rgba(0,0,0,0.75);' +
+				'border-radius: 3px;' +
+				'border: 1px;' +
+				'color: white;' +
+				'display: none;' +
+				'font-family: sans-serif;' +
+				'font-size: 12px;' +
+				'white-space: nowrap;' +
+				'line-height: 14px;' +
+				'margin: 5px 10px;' +
+				'padding: 5px;' +
+				'position: absolute;' +
+				'z-index: 10001' +
+			'}'
+		);
+
+		function isResizable(elm) {
+			var selector = editor.settings.object_resizing;
+
+			if (selector === false || Env.iOS) {
+				return false;
+			}
+
+			if (typeof selector != 'string') {
+				selector = 'table,img,div';
+			}
+
+			if (elm.getAttribute('data-mce-resize') === 'false') {
+				return false;
+			}
+
+			return editor.dom.is(elm, selector);
+		}
+
+		function resizeGhostElement(e) {
+			var deltaX, deltaY, proportional;
+			var resizeHelperX, resizeHelperY;
+
+			// Calc new width/height
+			deltaX = e.screenX - startX;
+			deltaY = e.screenY - startY;
+
+			// Calc new size
+			width = deltaX * selectedHandle[2] + startW;
+			height = deltaY * selectedHandle[3] + startH;
+
+			// Never scale down lower than 5 pixels
+			width = width < 5 ? 5 : width;
+			height = height < 5 ? 5 : height;
+
+			if (selectedElm.nodeName == "IMG" && editor.settings.resize_img_proportional !== false) {
+				proportional = !VK.modifierPressed(e);
+			} else {
+				proportional = VK.modifierPressed(e) || (selectedElm.nodeName == "IMG" && selectedHandle[2] * selectedHandle[3] !== 0);
+			}
+
+			// Constrain proportions
+			if (proportional) {
+				if (abs(deltaX) > abs(deltaY)) {
+					height = round(width * ratio);
+					width = round(height / ratio);
+				} else {
+					width = round(height / ratio);
+					height = round(width * ratio);
+				}
+			}
+
+			// Update ghost size
+			dom.setStyles(selectedElmGhost, {
+				width: width,
+				height: height
+			});
+
+			// Update resize helper position
+			resizeHelperX = selectedHandle.startPos.x + deltaX;
+			resizeHelperY = selectedHandle.startPos.y + deltaY;
+			resizeHelperX = resizeHelperX > 0 ? resizeHelperX : 0;
+			resizeHelperY = resizeHelperY > 0 ? resizeHelperY : 0;
+
+			dom.setStyles(resizeHelper, {
+				left: resizeHelperX,
+				top: resizeHelperY,
+				display: 'block'
+			});
+
+			resizeHelper.innerHTML = width + ' &times; ' + height;
+
+			// Update ghost X position if needed
+			if (selectedHandle[2] < 0 && selectedElmGhost.clientWidth <= width) {
+				dom.setStyle(selectedElmGhost, 'left', selectedElmX + (startW - width));
+			}
+
+			// Update ghost Y position if needed
+			if (selectedHandle[3] < 0 && selectedElmGhost.clientHeight <= height) {
+				dom.setStyle(selectedElmGhost, 'top', selectedElmY + (startH - height));
+			}
+
+			// Calculate how must overflow we got
+			deltaX = rootElement.scrollWidth - startScrollWidth;
+			deltaY = rootElement.scrollHeight - startScrollHeight;
+
+			// Re-position the resize helper based on the overflow
+			if (deltaX + deltaY !== 0) {
+				dom.setStyles(resizeHelper, {
+					left: resizeHelperX - deltaX,
+					top: resizeHelperY - deltaY
+				});
+			}
+
+			if (!resizeStarted) {
+				editor.fire('ObjectResizeStart', {target: selectedElm, width: startW, height: startH});
+				resizeStarted = true;
+			}
+		}
+
+		function endGhostResize() {
+			resizeStarted = false;
+
+			function setSizeProp(name, value) {
+				if (value) {
+					// Resize by using style or attribute
+					if (selectedElm.style[name] || !editor.schema.isValid(selectedElm.nodeName.toLowerCase(), name)) {
+						dom.setStyle(selectedElm, name, value);
+					} else {
+						dom.setAttrib(selectedElm, name, value);
+					}
+				}
+			}
+
+			// Set width/height properties
+			setSizeProp('width', width);
+			setSizeProp('height', height);
+
+			dom.unbind(editableDoc, 'mousemove', resizeGhostElement);
+			dom.unbind(editableDoc, 'mouseup', endGhostResize);
+
+			if (rootDocument != editableDoc) {
+				dom.unbind(rootDocument, 'mousemove', resizeGhostElement);
+				dom.unbind(rootDocument, 'mouseup', endGhostResize);
+			}
+
+			// Remove ghost/helper and update resize handle positions
+			dom.remove(selectedElmGhost);
+			dom.remove(resizeHelper);
+
+			if (!isIE || selectedElm.nodeName == "TABLE") {
+				showResizeRect(selectedElm);
+			}
+
+			editor.fire('ObjectResized', {target: selectedElm, width: width, height: height});
+			dom.setAttrib(selectedElm, 'style', dom.getAttrib(selectedElm, 'style'));
+			editor.nodeChanged();
+		}
+
+		function showResizeRect(targetElm, mouseDownHandleName, mouseDownEvent) {
+			var position, targetWidth, targetHeight, e, rect;
+
+			unbindResizeHandleEvents();
+
+			// Get position and size of target
+			position = dom.getPos(targetElm, rootElement);
+			selectedElmX = position.x;
+			selectedElmY = position.y;
+			rect = targetElm.getBoundingClientRect(); // Fix for Gecko offsetHeight for table with caption
+			targetWidth = rect.width || (rect.right - rect.left);
+			targetHeight = rect.height || (rect.bottom - rect.top);
+
+			// Reset width/height if user selects a new image/table
+			if (selectedElm != targetElm) {
+				detachResizeStartListener();
+				selectedElm = targetElm;
+				width = height = 0;
+			}
+
+			// Makes it possible to disable resizing
+			e = editor.fire('ObjectSelected', {target: targetElm});
+
+			if (isResizable(targetElm) && !e.isDefaultPrevented()) {
+				each(resizeHandles, function(handle, name) {
+					var handleElm, handlerContainerElm;
+
+					function startDrag(e) {
+						startX = e.screenX;
+						startY = e.screenY;
+						startW = selectedElm.clientWidth;
+						startH = selectedElm.clientHeight;
+						ratio = startH / startW;
+						selectedHandle = handle;
+
+						handle.startPos = {
+							x: targetWidth * handle[0] + selectedElmX,
+							y: targetHeight * handle[1] + selectedElmY
+						};
+
+						startScrollWidth = rootElement.scrollWidth;
+						startScrollHeight = rootElement.scrollHeight;
+
+						selectedElmGhost = selectedElm.cloneNode(true);
+						dom.addClass(selectedElmGhost, 'mce-clonedresizable');
+						dom.setAttrib(selectedElmGhost, 'data-mce-bogus', 'all');
+						selectedElmGhost.contentEditable = false; // Hides IE move layer cursor
+						selectedElmGhost.unSelectabe = true;
+						dom.setStyles(selectedElmGhost, {
+							left: selectedElmX,
+							top: selectedElmY,
+							margin: 0
+						});
+
+						selectedElmGhost.removeAttribute('data-mce-selected');
+						rootElement.appendChild(selectedElmGhost);
+
+						dom.bind(editableDoc, 'mousemove', resizeGhostElement);
+						dom.bind(editableDoc, 'mouseup', endGhostResize);
+
+						if (rootDocument != editableDoc) {
+							dom.bind(rootDocument, 'mousemove', resizeGhostElement);
+							dom.bind(rootDocument, 'mouseup', endGhostResize);
+						}
+
+						resizeHelper = dom.add(rootElement, 'div', {
+							'class': 'mce-resize-helper',
+							'data-mce-bogus': 'all'
+						}, startW + ' &times; ' + startH);
+					}
+
+					if (mouseDownHandleName) {
+						// Drag started by IE native resizestart
+						if (name == mouseDownHandleName) {
+							startDrag(mouseDownEvent);
+						}
+
+						return;
+					}
+
+					// Get existing or render resize handle
+					handleElm = dom.get('mceResizeHandle' + name);
+					if (!handleElm) {
+						handlerContainerElm = rootElement;
+
+						handleElm = dom.add(handlerContainerElm, 'div', {
+							id: 'mceResizeHandle' + name,
+							'data-mce-bogus': 'all',
+							'class': 'mce-resizehandle',
+							unselectable: true,
+							style: 'cursor:' + name + '-resize; margin:0; padding:0'
+						});
+
+						// Hides IE move layer cursor
+						// If we set it on Chrome we get this wounderful bug: #6725
+						if (Env.ie) {
+							handleElm.contentEditable = false;
+						}
+					} else {
+						dom.show(handleElm);
+					}
+
+					if (!handle.elm) {
+						dom.bind(handleElm, 'mousedown', function(e) {
+							e.stopImmediatePropagation();
+							e.preventDefault();
+							startDrag(e);
+						});
+
+						handle.elm = handleElm;
+					}
+
+					// Position element
+					dom.setStyles(handleElm, {
+						left: (targetWidth * handle[0] + selectedElmX) - (handleElm.offsetWidth / 2),
+						top: (targetHeight * handle[1] + selectedElmY) - (handleElm.offsetHeight / 2)
+					});
+				});
+			} else {
+				hideResizeRect();
+			}
+
+			selectedElm.setAttribute('data-mce-selected', '1');
+		}
+
+		function hideResizeRect() {
+			var name, handleElm;
+
+			unbindResizeHandleEvents();
+
+			if (selectedElm) {
+				selectedElm.removeAttribute('data-mce-selected');
+			}
+
+			for (name in resizeHandles) {
+				handleElm = dom.get('mceResizeHandle' + name);
+				if (handleElm) {
+					dom.unbind(handleElm);
+					dom.remove(handleElm);
+				}
+			}
+		}
+
+		function updateResizeRect(e) {
+			var startElm, controlElm;
+
+			function isChildOrEqual(node, parent) {
+				if (node) {
+					do {
+						if (node === parent) {
+							return true;
+						}
+					} while ((node = node.parentNode));
+				}
+			}
+
+			// Ignore all events while resizing
+			if (resizeStarted) {
+				return;
+			}
+
+			// Remove data-mce-selected from all elements since they might have been copied using Ctrl+c/v
+			each(dom.select('img[data-mce-selected],hr[data-mce-selected]'), function(img) {
+				img.removeAttribute('data-mce-selected');
+			});
+
+			controlElm = e.type == 'mousedown' ? e.target : selection.getNode();
+			controlElm = dom.$(controlElm).closest(isIE ? 'table' : 'table,img,hr')[0];
+
+			if (isChildOrEqual(controlElm, rootElement)) {
+				disableGeckoResize();
+				startElm = selection.getStart(true);
+
+				if (isChildOrEqual(startElm, controlElm) && isChildOrEqual(selection.getEnd(true), controlElm)) {
+					if (!isIE || (controlElm != startElm && startElm.nodeName !== 'IMG')) {
+						showResizeRect(controlElm);
+						return;
+					}
+				}
+			}
+
+			hideResizeRect();
+		}
+
+		function attachEvent(elm, name, func) {
+			if (elm && elm.attachEvent) {
+				elm.attachEvent('on' + name, func);
+			}
+		}
+
+		function detachEvent(elm, name, func) {
+			if (elm && elm.detachEvent) {
+				elm.detachEvent('on' + name, func);
+			}
+		}
+
+		function resizeNativeStart(e) {
+			var target = e.srcElement, pos, name, corner, cornerX, cornerY, relativeX, relativeY;
+
+			pos = target.getBoundingClientRect();
+			relativeX = lastMouseDownEvent.clientX - pos.left;
+			relativeY = lastMouseDownEvent.clientY - pos.top;
+
+			// Figure out what corner we are draging on
+			for (name in resizeHandles) {
+				corner = resizeHandles[name];
+
+				cornerX = target.offsetWidth * corner[0];
+				cornerY = target.offsetHeight * corner[1];
+
+				if (abs(cornerX - relativeX) < 8 && abs(cornerY - relativeY) < 8) {
+					selectedHandle = corner;
+					break;
+				}
+			}
+
+			// Remove native selection and let the magic begin
+			resizeStarted = true;
+			editor.fire('ObjectResizeStart', {
+				target: selectedElm,
+				width: selectedElm.clientWidth,
+				height: selectedElm.clientHeight
+			});
+			editor.getDoc().selection.empty();
+			showResizeRect(target, name, lastMouseDownEvent);
+		}
+
+		function nativeControlSelect(e) {
+			var target = e.srcElement;
+
+			if (target != selectedElm) {
+				editor.fire('ObjectSelected', {target: target});
+				detachResizeStartListener();
+
+				if (target.id.indexOf('mceResizeHandle') === 0) {
+					e.returnValue = false;
+					return;
+				}
+
+				if (target.nodeName == 'IMG' || target.nodeName == 'TABLE') {
+					hideResizeRect();
+					selectedElm = target;
+					attachEvent(target, 'resizestart', resizeNativeStart);
+				}
+			}
+		}
+
+		function detachResizeStartListener() {
+			detachEvent(selectedElm, 'resizestart', resizeNativeStart);
+		}
+
+		function unbindResizeHandleEvents() {
+			for (var name in resizeHandles) {
+				var handle = resizeHandles[name];
+
+				if (handle.elm) {
+					dom.unbind(handle.elm);
+					delete handle.elm;
+				}
+			}
+		}
+
+		function disableGeckoResize() {
+			try {
+				// Disable object resizing on Gecko
+				editor.getDoc().execCommand('enableObjectResizing', false, false);
+			} catch (ex) {
+				// Ignore
+			}
+		}
+
+		function controlSelect(elm) {
+			var ctrlRng;
+
+			if (!isIE) {
+				return;
+			}
+
+			ctrlRng = editableDoc.body.createControlRange();
+
+			try {
+				ctrlRng.addElement(elm);
+				ctrlRng.select();
+				return true;
+			} catch (ex) {
+				// Ignore since the element can't be control selected for example a P tag
+			}
+		}
+
+		editor.on('init', function() {
+			if (isIE) {
+				// Hide the resize rect on resize and reselect the image
+				editor.on('ObjectResized', function(e) {
+					if (e.target.nodeName != 'TABLE') {
+						hideResizeRect();
+						controlSelect(e.target);
+					}
+				});
+
+				attachEvent(rootElement, 'controlselect', nativeControlSelect);
+
+				editor.on('mousedown', function(e) {
+					lastMouseDownEvent = e;
+				});
+			} else {
+				disableGeckoResize();
+
+				if (Env.ie >= 11) {
+					// TODO: Drag/drop doesn't work
+					editor.on('mouseup', function(e) {
+						var nodeName = e.target.nodeName;
+
+						if (!resizeStarted && /^(TABLE|IMG|HR)$/.test(nodeName)) {
+							editor.selection.select(e.target, nodeName == 'TABLE');
+							editor.nodeChanged();
+						}
+					});
+
+					editor.dom.bind(rootElement, 'mscontrolselect', function(e) {
+						if (/^(TABLE|IMG|HR)$/.test(e.target.nodeName)) {
+							e.preventDefault();
+
+							// This moves the selection from being a control selection to a text like selection like in WebKit #6753
+							// TODO: Fix this the day IE works like other browsers without this nasty native ugly control selections.
+							if (e.target.tagName == 'IMG') {
+								window.setTimeout(function() {
+									editor.selection.select(e.target);
+								}, 0);
+							}
+						}
+					});
+				}
+			}
+
+			editor.on('nodechange ResizeEditor', updateResizeRect);
+
+			// Update resize rect while typing in a table
+			editor.on('keydown keyup', function(e) {
+				if (selectedElm && selectedElm.nodeName == "TABLE") {
+					updateResizeRect(e);
+				}
+			});
+
+			editor.on('hide', hideResizeRect);
+
+			// Hide rect on focusout since it would float on top of windows otherwise
+			//editor.on('focusout', hideResizeRect);
+		});
+
+		editor.on('remove', unbindResizeHandleEvents);
+
+		function destroy() {
+			selectedElm = selectedElmGhost = null;
+
+			if (isIE) {
+				detachResizeStartListener();
+				detachEvent(rootElement, 'controlselect', nativeControlSelect);
+			}
+		}
+
+		return {
+			isResizable: isResizable,
+			showResizeRect: showResizeRect,
+			hideResizeRect: hideResizeRect,
+			updateResizeRect: updateResizeRect,
+			controlSelect: controlSelect,
+			destroy: destroy
+		};
+	};
+});
+
+// Included from: js/tinymce/classes/dom/BookmarkManager.js
+
+/**
+ * BookmarkManager.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles selection bookmarks.
+ *
+ * @class tinymce.dom.BookmarkManager
+ */
+define("tinymce/dom/BookmarkManager", [
+	"tinymce/Env",
+	"tinymce/util/Tools"
+], function(Env, Tools) {
+	/**
+	 * Constructs a new BookmarkManager instance for a specific selection instance.
+	 *
+	 * @constructor
+	 * @method BookmarkManager
+	 * @param {tinymce.dom.Selection} selection Selection instance to handle bookmarks for.
+	 */
+	function BookmarkManager(selection) {
+		var dom = selection.dom;
+
+		/**
+		 * Returns a bookmark location for the current selection. This bookmark object
+		 * can then be used to restore the selection after some content modification to the document.
+		 *
+		 * @method getBookmark
+		 * @param {Number} type Optional state if the bookmark should be simple or not. Default is complex.
+		 * @param {Boolean} normalized Optional state that enables you to get a position that it would be after normalization.
+		 * @return {Object} Bookmark object, use moveToBookmark with this object to restore the selection.
+		 * @example
+		 * // Stores a bookmark of the current selection
+		 * var bm = tinymce.activeEditor.selection.getBookmark();
+		 *
+		 * tinymce.activeEditor.setContent(tinymce.activeEditor.getContent() + 'Some new content');
+		 *
+		 * // Restore the selection bookmark
+		 * tinymce.activeEditor.selection.moveToBookmark(bm);
+		 */
+		this.getBookmark = function(type, normalized) {
+			var rng, rng2, id, collapsed, name, element, chr = '&#xFEFF;', styles;
+
+			function findIndex(name, element) {
+				var index = 0;
+
+				Tools.each(dom.select(name), function(node, i) {
+					if (node == element) {
+						index = i;
+					}
+				});
+
+				return index;
+			}
+
+			function normalizeTableCellSelection(rng) {
+				function moveEndPoint(start) {
+					var container, offset, childNodes, prefix = start ? 'start' : 'end';
+
+					container = rng[prefix + 'Container'];
+					offset = rng[prefix + 'Offset'];
+
+					if (container.nodeType == 1 && container.nodeName == "TR") {
+						childNodes = container.childNodes;
+						container = childNodes[Math.min(start ? offset : offset - 1, childNodes.length - 1)];
+						if (container) {
+							offset = start ? 0 : container.childNodes.length;
+							rng['set' + (start ? 'Start' : 'End')](container, offset);
+						}
+					}
+				}
+
+				moveEndPoint(true);
+				moveEndPoint();
+
+				return rng;
+			}
+
+			function getLocation() {
+				var rng = selection.getRng(true), root = dom.getRoot(), bookmark = {};
+
+				function getPoint(rng, start) {
+					var container = rng[start ? 'startContainer' : 'endContainer'],
+						offset = rng[start ? 'startOffset' : 'endOffset'], point = [], node, childNodes, after = 0;
+
+					if (container.nodeType == 3) {
+						if (normalized) {
+							for (node = container.previousSibling; node && node.nodeType == 3; node = node.previousSibling) {
+								offset += node.nodeValue.length;
+							}
+						}
+
+						point.push(offset);
+					} else {
+						childNodes = container.childNodes;
+
+						if (offset >= childNodes.length && childNodes.length) {
+							after = 1;
+							offset = Math.max(0, childNodes.length - 1);
+						}
+
+						point.push(dom.nodeIndex(childNodes[offset], normalized) + after);
+					}
+
+					for (; container && container != root; container = container.parentNode) {
+						point.push(dom.nodeIndex(container, normalized));
+					}
+
+					return point;
+				}
+
+				bookmark.start = getPoint(rng, true);
+
+				if (!selection.isCollapsed()) {
+					bookmark.end = getPoint(rng);
+				}
+
+				return bookmark;
+			}
+
+			if (type == 2) {
+				element = selection.getNode();
+				name = element ? element.nodeName : null;
+
+				if (name == 'IMG') {
+					return {name: name, index: findIndex(name, element)};
+				}
+
+				if (selection.tridentSel) {
+					return selection.tridentSel.getBookmark(type);
+				}
+
+				return getLocation();
+			}
+
+			// Handle simple range
+			if (type) {
+				return {rng: selection.getRng()};
+			}
+
+			rng = selection.getRng();
+			id = dom.uniqueId();
+			collapsed = selection.isCollapsed();
+			styles = 'overflow:hidden;line-height:0px';
+
+			// Explorer method
+			if (rng.duplicate || rng.item) {
+				// Text selection
+				if (!rng.item) {
+					rng2 = rng.duplicate();
+
+					try {
+						// Insert start marker
+						rng.collapse();
+						rng.pasteHTML('<span data-mce-type="bookmark" id="' + id + '_start" style="' + styles + '">' + chr + '</span>');
+
+						// Insert end marker
+						if (!collapsed) {
+							rng2.collapse(false);
+
+							// Detect the empty space after block elements in IE and move the
+							// end back one character <p></p>] becomes <p>]</p>
+							rng.moveToElementText(rng2.parentElement());
+							if (rng.compareEndPoints('StartToEnd', rng2) === 0) {
+								rng2.move('character', -1);
+							}
+
+							rng2.pasteHTML('<span data-mce-type="bookmark" id="' + id + '_end" style="' + styles + '">' + chr + '</span>');
+						}
+					} catch (ex) {
+						// IE might throw unspecified error so lets ignore it
+						return null;
+					}
+				} else {
+					// Control selection
+					element = rng.item(0);
+					name = element.nodeName;
+
+					return {name: name, index: findIndex(name, element)};
+				}
+			} else {
+				element = selection.getNode();
+				name = element.nodeName;
+				if (name == 'IMG') {
+					return {name: name, index: findIndex(name, element)};
+				}
+
+				// W3C method
+				rng2 = normalizeTableCellSelection(rng.cloneRange());
+
+				// Insert end marker
+				if (!collapsed) {
+					rng2.collapse(false);
+					rng2.insertNode(dom.create('span', {'data-mce-type': "bookmark", id: id + '_end', style: styles}, chr));
+				}
+
+				rng = normalizeTableCellSelection(rng);
+				rng.collapse(true);
+				rng.insertNode(dom.create('span', {'data-mce-type': "bookmark", id: id + '_start', style: styles}, chr));
+			}
+
+			selection.moveToBookmark({id: id, keep: 1});
+
+			return {id: id};
+		};
+
+		/**
+		 * Restores the selection to the specified bookmark.
+		 *
+		 * @method moveToBookmark
+		 * @param {Object} bookmark Bookmark to restore selection from.
+		 * @return {Boolean} true/false if it was successful or not.
+		 * @example
+		 * // Stores a bookmark of the current selection
+		 * var bm = tinymce.activeEditor.selection.getBookmark();
+		 *
+		 * tinymce.activeEditor.setContent(tinymce.activeEditor.getContent() + 'Some new content');
+		 *
+		 * // Restore the selection bookmark
+		 * tinymce.activeEditor.selection.moveToBookmark(bm);
+		 */
+		this.moveToBookmark = function(bookmark) {
+			var rng, root, startContainer, endContainer, startOffset, endOffset;
+
+			function setEndPoint(start) {
+				var point = bookmark[start ? 'start' : 'end'], i, node, offset, children;
+
+				if (point) {
+					offset = point[0];
+
+					// Find container node
+					for (node = root, i = point.length - 1; i >= 1; i--) {
+						children = node.childNodes;
+
+						if (point[i] > children.length - 1) {
+							return;
+						}
+
+						node = children[point[i]];
+					}
+
+					// Move text offset to best suitable location
+					if (node.nodeType === 3) {
+						offset = Math.min(point[0], node.nodeValue.length);
+					}
+
+					// Move element offset to best suitable location
+					if (node.nodeType === 1) {
+						offset = Math.min(point[0], node.childNodes.length);
+					}
+
+					// Set offset within container node
+					if (start) {
+						rng.setStart(node, offset);
+					} else {
+						rng.setEnd(node, offset);
+					}
+				}
+
+				return true;
+			}
+
+			function restoreEndPoint(suffix) {
+				var marker = dom.get(bookmark.id + '_' + suffix), node, idx, next, prev, keep = bookmark.keep;
+
+				if (marker) {
+					node = marker.parentNode;
+
+					if (suffix == 'start') {
+						if (!keep) {
+							idx = dom.nodeIndex(marker);
+						} else {
+							node = marker.firstChild;
+							idx = 1;
+						}
+
+						startContainer = endContainer = node;
+						startOffset = endOffset = idx;
+					} else {
+						if (!keep) {
+							idx = dom.nodeIndex(marker);
+						} else {
+							node = marker.firstChild;
+							idx = 1;
+						}
+
+						endContainer = node;
+						endOffset = idx;
+					}
+
+					if (!keep) {
+						prev = marker.previousSibling;
+						next = marker.nextSibling;
+
+						// Remove all marker text nodes
+						Tools.each(Tools.grep(marker.childNodes), function(node) {
+							if (node.nodeType == 3) {
+								node.nodeValue = node.nodeValue.replace(/\uFEFF/g, '');
+							}
+						});
+
+						// Remove marker but keep children if for example contents where inserted into the marker
+						// Also remove duplicated instances of the marker for example by a
+						// split operation or by WebKit auto split on paste feature
+						while ((marker = dom.get(bookmark.id + '_' + suffix))) {
+							dom.remove(marker, 1);
+						}
+
+						// If siblings are text nodes then merge them unless it's Opera since it some how removes the node
+						// and we are sniffing since adding a lot of detection code for a browser with 3% of the market
+						// isn't worth the effort. Sorry, Opera but it's just a fact
+						if (prev && next && prev.nodeType == next.nodeType && prev.nodeType == 3 && !Env.opera) {
+							idx = prev.nodeValue.length;
+							prev.appendData(next.nodeValue);
+							dom.remove(next);
+
+							if (suffix == 'start') {
+								startContainer = endContainer = prev;
+								startOffset = endOffset = idx;
+							} else {
+								endContainer = prev;
+								endOffset = idx;
+							}
+						}
+					}
+				}
+			}
+
+			function addBogus(node) {
+				// Adds a bogus BR element for empty block elements
+				if (dom.isBlock(node) && !node.innerHTML && !Env.ie) {
+					node.innerHTML = '<br data-mce-bogus="1" />';
+				}
+
+				return node;
+			}
+
+			if (bookmark) {
+				if (bookmark.start) {
+					rng = dom.createRng();
+					root = dom.getRoot();
+
+					if (selection.tridentSel) {
+						return selection.tridentSel.moveToBookmark(bookmark);
+					}
+
+					if (setEndPoint(true) && setEndPoint()) {
+						selection.setRng(rng);
+					}
+				} else if (bookmark.id) {
+					// Restore start/end points
+					restoreEndPoint('start');
+					restoreEndPoint('end');
+
+					if (startContainer) {
+						rng = dom.createRng();
+						rng.setStart(addBogus(startContainer), startOffset);
+						rng.setEnd(addBogus(endContainer), endOffset);
+						selection.setRng(rng);
+					}
+				} else if (bookmark.name) {
+					selection.select(dom.select(bookmark.name)[bookmark.index]);
+				} else if (bookmark.rng) {
+					selection.setRng(bookmark.rng);
+				}
+			}
+		};
+	}
+
+	/**
+	 * Returns true/false if the specified node is a bookmark node or not.
+	 *
+	 * @static
+	 * @method isBookmarkNode
+	 * @param {DOMNode} node DOM Node to check if it's a bookmark node or not.
+	 * @return {Boolean} true/false if the node is a bookmark node or not.
+	 */
+	BookmarkManager.isBookmarkNode = function(node) {
+		return node && node.tagName === 'SPAN' && node.getAttribute('data-mce-type') === 'bookmark';
+	};
+
+	return BookmarkManager;
+});
+
+// Included from: js/tinymce/classes/dom/Selection.js
+
+/**
+ * Selection.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles text and control selection it's an crossbrowser utility class.
+ * Consult the TinyMCE Wiki API for more details and examples on how to use this class.
+ *
+ * @class tinymce.dom.Selection
+ * @example
+ * // Getting the currently selected node for the active editor
+ * alert(tinymce.activeEditor.selection.getNode().nodeName);
+ */
+define("tinymce/dom/Selection", [
+	"tinymce/dom/TreeWalker",
+	"tinymce/dom/TridentSelection",
+	"tinymce/dom/ControlSelection",
+	"tinymce/dom/RangeUtils",
+	"tinymce/dom/BookmarkManager",
+	"tinymce/Env",
+	"tinymce/util/Tools"
+], function(TreeWalker, TridentSelection, ControlSelection, RangeUtils, BookmarkManager, Env, Tools) {
+	var each = Tools.each, trim = Tools.trim;
+	var isIE = Env.ie;
+
+	/**
+	 * Constructs a new selection instance.
+	 *
+	 * @constructor
+	 * @method Selection
+	 * @param {tinymce.dom.DOMUtils} dom DOMUtils object reference.
+	 * @param {Window} win Window to bind the selection object to.
+	 * @param {tinymce.dom.Serializer} serializer DOM serialization class to use for getContent.
+	 */
+	function Selection(dom, win, serializer, editor) {
+		var self = this;
+
+		self.dom = dom;
+		self.win = win;
+		self.serializer = serializer;
+		self.editor = editor;
+		self.bookmarkManager = new BookmarkManager(self);
+		self.controlSelection = new ControlSelection(self, editor);
+
+		// No W3C Range support
+		if (!self.win.getSelection) {
+			self.tridentSel = new TridentSelection(self);
+		}
+	}
+
+	Selection.prototype = {
+		/**
+		 * Move the selection cursor range to the specified node and offset.
+		 * If there is no node specified it will move it to the first suitable location within the body.
+		 *
+		 * @method setCursorLocation
+		 * @param {Node} node Optional node to put the cursor in.
+		 * @param {Number} offset Optional offset from the start of the node to put the cursor at.
+		 */
+		setCursorLocation: function(node, offset) {
+			var self = this, rng = self.dom.createRng();
+
+			if (!node) {
+				self._moveEndPoint(rng, self.editor.getBody(), true);
+				self.setRng(rng);
+			} else {
+				rng.setStart(node, offset);
+				rng.setEnd(node, offset);
+				self.setRng(rng);
+				self.collapse(false);
+			}
+		},
+
+		/**
+		 * Returns the selected contents using the DOM serializer passed in to this class.
+		 *
+		 * @method getContent
+		 * @param {Object} s Optional settings class with for example output format text or html.
+		 * @return {String} Selected contents in for example HTML format.
+		 * @example
+		 * // Alerts the currently selected contents
+		 * alert(tinymce.activeEditor.selection.getContent());
+		 *
+		 * // Alerts the currently selected contents as plain text
+		 * alert(tinymce.activeEditor.selection.getContent({format: 'text'}));
+		 */
+		getContent: function(args) {
+			var self = this, rng = self.getRng(), tmpElm = self.dom.create("body");
+			var se = self.getSel(), whiteSpaceBefore, whiteSpaceAfter, fragment;
+
+			args = args || {};
+			whiteSpaceBefore = whiteSpaceAfter = '';
+			args.get = true;
+			args.format = args.format || 'html';
+			args.selection = true;
+			self.editor.fire('BeforeGetContent', args);
+
+			if (args.format == 'text') {
+				return self.isCollapsed() ? '' : (rng.text || (se.toString ? se.toString() : ''));
+			}
+
+			if (rng.cloneContents) {
+				fragment = rng.cloneContents();
+
+				if (fragment) {
+					tmpElm.appendChild(fragment);
+				}
+			} else if (rng.item !== undefined || rng.htmlText !== undefined) {
+				// IE will produce invalid markup if elements are present that
+				// it doesn't understand like custom elements or HTML5 elements.
+				// Adding a BR in front of the contents and then remoiving it seems to fix it though.
+				tmpElm.innerHTML = '<br>' + (rng.item ? rng.item(0).outerHTML : rng.htmlText);
+				tmpElm.removeChild(tmpElm.firstChild);
+			} else {
+				tmpElm.innerHTML = rng.toString();
+			}
+
+			// Keep whitespace before and after
+			if (/^\s/.test(tmpElm.innerHTML)) {
+				whiteSpaceBefore = ' ';
+			}
+
+			if (/\s+$/.test(tmpElm.innerHTML)) {
+				whiteSpaceAfter = ' ';
+			}
+
+			args.getInner = true;
+
+			args.content = self.isCollapsed() ? '' : whiteSpaceBefore + self.serializer.serialize(tmpElm, args) + whiteSpaceAfter;
+			self.editor.fire('GetContent', args);
+
+			return args.content;
+		},
+
+		/**
+		 * Sets the current selection to the specified content. If any contents is selected it will be replaced
+		 * with the contents passed in to this function. If there is no selection the contents will be inserted
+		 * where the caret is placed in the editor/page.
+		 *
+		 * @method setContent
+		 * @param {String} content HTML contents to set could also be other formats depending on settings.
+		 * @param {Object} args Optional settings object with for example data format.
+		 * @example
+		 * // Inserts some HTML contents at the current selection
+		 * tinymce.activeEditor.selection.setContent('<strong>Some contents</strong>');
+		 */
+		setContent: function(content, args) {
+			var self = this, rng = self.getRng(), caretNode, doc = self.win.document, frag, temp;
+
+			args = args || {format: 'html'};
+			args.set = true;
+			args.selection = true;
+			content = args.content = content;
+
+			// Dispatch before set content event
+			if (!args.no_events) {
+				self.editor.fire('BeforeSetContent', args);
+			}
+
+			content = args.content;
+
+			if (rng.insertNode) {
+				// Make caret marker since insertNode places the caret in the beginning of text after insert
+				content += '<span id="__caret">_</span>';
+
+				// Delete and insert new node
+				if (rng.startContainer == doc && rng.endContainer == doc) {
+					// WebKit will fail if the body is empty since the range is then invalid and it can't insert contents
+					doc.body.innerHTML = content;
+				} else {
+					rng.deleteContents();
+
+					if (doc.body.childNodes.length === 0) {
+						doc.body.innerHTML = content;
+					} else {
+						// createContextualFragment doesn't exists in IE 9 DOMRanges
+						if (rng.createContextualFragment) {
+							rng.insertNode(rng.createContextualFragment(content));
+						} else {
+							// Fake createContextualFragment call in IE 9
+							frag = doc.createDocumentFragment();
+							temp = doc.createElement('div');
+
+							frag.appendChild(temp);
+							temp.outerHTML = content;
+
+							rng.insertNode(frag);
+						}
+					}
+				}
+
+				// Move to caret marker
+				caretNode = self.dom.get('__caret');
+
+				// Make sure we wrap it compleatly, Opera fails with a simple select call
+				rng = doc.createRange();
+				rng.setStartBefore(caretNode);
+				rng.setEndBefore(caretNode);
+				self.setRng(rng);
+
+				// Remove the caret position
+				self.dom.remove('__caret');
+
+				try {
+					self.setRng(rng);
+				} catch (ex) {
+					// Might fail on Opera for some odd reason
+				}
+			} else {
+				if (rng.item) {
+					// Delete content and get caret text selection
+					doc.execCommand('Delete', false, null);
+					rng = self.getRng();
+				}
+
+				// Explorer removes spaces from the beginning of pasted contents
+				if (/^\s+/.test(content)) {
+					rng.pasteHTML('<span id="__mce_tmp">_</span>' + content);
+					self.dom.remove('__mce_tmp');
+				} else {
+					rng.pasteHTML(content);
+				}
+			}
+
+			// Dispatch set content event
+			if (!args.no_events) {
+				self.editor.fire('SetContent', args);
+			}
+		},
+
+		/**
+		 * Returns the start element of a selection range. If the start is in a text
+		 * node the parent element will be returned.
+		 *
+		 * @method getStart
+		 * @param {Boolean} real Optional state to get the real parent when the selection is collapsed not the closest element.
+		 * @return {Element} Start element of selection range.
+		 */
+		getStart: function(real) {
+			var self = this, rng = self.getRng(), startElement, parentElement, checkRng, node;
+
+			if (rng.duplicate || rng.item) {
+				// Control selection, return first item
+				if (rng.item) {
+					return rng.item(0);
+				}
+
+				// Get start element
+				checkRng = rng.duplicate();
+				checkRng.collapse(1);
+				startElement = checkRng.parentElement();
+				if (startElement.ownerDocument !== self.dom.doc) {
+					startElement = self.dom.getRoot();
+				}
+
+				// Check if range parent is inside the start element, then return the inner parent element
+				// This will fix issues when a single element is selected, IE would otherwise return the wrong start element
+				parentElement = node = rng.parentElement();
+				while ((node = node.parentNode)) {
+					if (node == startElement) {
+						startElement = parentElement;
+						break;
+					}
+				}
+
+				return startElement;
+			} else {
+				startElement = rng.startContainer;
+
+				if (startElement.nodeType == 1 && startElement.hasChildNodes()) {
+					if (!real || !rng.collapsed) {
+						startElement = startElement.childNodes[Math.min(startElement.childNodes.length - 1, rng.startOffset)];
+					}
+				}
+
+				if (startElement && startElement.nodeType == 3) {
+					return startElement.parentNode;
+				}
+
+				return startElement;
+			}
+		},
+
+		/**
+		 * Returns the end element of a selection range. If the end is in a text
+		 * node the parent element will be returned.
+		 *
+		 * @method getEnd
+		 * @param {Boolean} real Optional state to get the real parent when the selection is collapsed not the closest element.
+		 * @return {Element} End element of selection range.
+		 */
+		getEnd: function(real) {
+			var self = this, rng = self.getRng(), endElement, endOffset;
+
+			if (rng.duplicate || rng.item) {
+				if (rng.item) {
+					return rng.item(0);
+				}
+
+				rng = rng.duplicate();
+				rng.collapse(0);
+				endElement = rng.parentElement();
+				if (endElement.ownerDocument !== self.dom.doc) {
+					endElement = self.dom.getRoot();
+				}
+
+				if (endElement && endElement.nodeName == 'BODY') {
+					return endElement.lastChild || endElement;
+				}
+
+				return endElement;
+			} else {
+				endElement = rng.endContainer;
+				endOffset = rng.endOffset;
+
+				if (endElement.nodeType == 1 && endElement.hasChildNodes()) {
+					if (!real || !rng.collapsed) {
+						endElement = endElement.childNodes[endOffset > 0 ? endOffset - 1 : endOffset];
+					}
+				}
+
+				if (endElement && endElement.nodeType == 3) {
+					return endElement.parentNode;
+				}
+
+				return endElement;
+			}
+		},
+
+		/**
+		 * Returns a bookmark location for the current selection. This bookmark object
+		 * can then be used to restore the selection after some content modification to the document.
+		 *
+		 * @method getBookmark
+		 * @param {Number} type Optional state if the bookmark should be simple or not. Default is complex.
+		 * @param {Boolean} normalized Optional state that enables you to get a position that it would be after normalization.
+		 * @return {Object} Bookmark object, use moveToBookmark with this object to restore the selection.
+		 * @example
+		 * // Stores a bookmark of the current selection
+		 * var bm = tinymce.activeEditor.selection.getBookmark();
+		 *
+		 * tinymce.activeEditor.setContent(tinymce.activeEditor.getContent() + 'Some new content');
+		 *
+		 * // Restore the selection bookmark
+		 * tinymce.activeEditor.selection.moveToBookmark(bm);
+		 */
+		getBookmark: function(type, normalized) {
+			return this.bookmarkManager.getBookmark(type, normalized);
+		},
+
+		/**
+		 * Restores the selection to the specified bookmark.
+		 *
+		 * @method moveToBookmark
+		 * @param {Object} bookmark Bookmark to restore selection from.
+		 * @return {Boolean} true/false if it was successful or not.
+		 * @example
+		 * // Stores a bookmark of the current selection
+		 * var bm = tinymce.activeEditor.selection.getBookmark();
+		 *
+		 * tinymce.activeEditor.setContent(tinymce.activeEditor.getContent() + 'Some new content');
+		 *
+		 * // Restore the selection bookmark
+		 * tinymce.activeEditor.selection.moveToBookmark(bm);
+		 */
+		moveToBookmark: function(bookmark) {
+			return this.bookmarkManager.moveToBookmark(bookmark);
+		},
+
+		/**
+		 * Selects the specified element. This will place the start and end of the selection range around the element.
+		 *
+		 * @method select
+		 * @param {Element} node HMTL DOM element to select.
+		 * @param {Boolean} content Optional bool state if the contents should be selected or not on non IE browser.
+		 * @return {Element} Selected element the same element as the one that got passed in.
+		 * @example
+		 * // Select the first paragraph in the active editor
+		 * tinymce.activeEditor.selection.select(tinymce.activeEditor.dom.select('p')[0]);
+		 */
+		select: function(node, content) {
+			var self = this, dom = self.dom, rng = dom.createRng(), idx;
+
+			// Clear stored range set by FocusManager
+			self.lastFocusBookmark = null;
+
+			if (node) {
+				if (!content && self.controlSelection.controlSelect(node)) {
+					return;
+				}
+
+				idx = dom.nodeIndex(node);
+				rng.setStart(node.parentNode, idx);
+				rng.setEnd(node.parentNode, idx + 1);
+
+				// Find first/last text node or BR element
+				if (content) {
+					self._moveEndPoint(rng, node, true);
+					self._moveEndPoint(rng, node);
+				}
+
+				self.setRng(rng);
+			}
+
+			return node;
+		},
+
+		/**
+		 * Returns true/false if the selection range is collapsed or not. Collapsed means if it's a caret or a larger selection.
+		 *
+		 * @method isCollapsed
+		 * @return {Boolean} true/false state if the selection range is collapsed or not.
+		 * Collapsed means if it's a caret or a larger selection.
+		 */
+		isCollapsed: function() {
+			var self = this, rng = self.getRng(), sel = self.getSel();
+
+			if (!rng || rng.item) {
+				return false;
+			}
+
+			if (rng.compareEndPoints) {
+				return rng.compareEndPoints('StartToEnd', rng) === 0;
+			}
+
+			return !sel || rng.collapsed;
+		},
+
+		/**
+		 * Collapse the selection to start or end of range.
+		 *
+		 * @method collapse
+		 * @param {Boolean} toStart Optional boolean state if to collapse to end or not. Defaults to start.
+		 */
+		collapse: function(toStart) {
+			var self = this, rng = self.getRng(), node;
+
+			// Control range on IE
+			if (rng.item) {
+				node = rng.item(0);
+				rng = self.win.document.body.createTextRange();
+				rng.moveToElementText(node);
+			}
+
+			rng.collapse(!!toStart);
+			self.setRng(rng);
+		},
+
+		/**
+		 * Returns the browsers internal selection object.
+		 *
+		 * @method getSel
+		 * @return {Selection} Internal browser selection object.
+		 */
+		getSel: function() {
+			var win = this.win;
+
+			return win.getSelection ? win.getSelection() : win.document.selection;
+		},
+
+		/**
+		 * Returns the browsers internal range object.
+		 *
+		 * @method getRng
+		 * @param {Boolean} w3c Forces a compatible W3C range on IE.
+		 * @return {Range} Internal browser range object.
+		 * @see http://www.quirksmode.org/dom/range_intro.html
+		 * @see http://www.dotvoid.com/2001/03/using-the-range-object-in-mozilla/
+		 */
+		getRng: function(w3c) {
+			var self = this, selection, rng, elm, doc = self.win.document, ieRng;
+
+			function tryCompareBoundaryPoints(how, sourceRange, destinationRange) {
+				try {
+					return sourceRange.compareBoundaryPoints(how, destinationRange);
+				} catch (ex) {
+					// Gecko throws wrong document exception if the range points
+					// to nodes that where removed from the dom #6690
+					// Browsers should mutate existing DOMRange instances so that they always point
+					// to something in the document this is not the case in Gecko works fine in IE/WebKit/Blink
+					// For performance reasons just return -1
+					return -1;
+				}
+			}
+
+			// Use last rng passed from FocusManager if it's available this enables
+			// calls to editor.selection.getStart() to work when caret focus is lost on IE
+			if (!w3c && self.lastFocusBookmark) {
+				var bookmark = self.lastFocusBookmark;
+
+				// Convert bookmark to range IE 11 fix
+				if (bookmark.startContainer) {
+					rng = doc.createRange();
+					rng.setStart(bookmark.startContainer, bookmark.startOffset);
+					rng.setEnd(bookmark.endContainer, bookmark.endOffset);
+				} else {
+					rng = bookmark;
+				}
+
+				return rng;
+			}
+
+			// Found tridentSel object then we need to use that one
+			if (w3c && self.tridentSel) {
+				return self.tridentSel.getRangeAt(0);
+			}
+
+			try {
+				if ((selection = self.getSel())) {
+					if (selection.rangeCount > 0) {
+						rng = selection.getRangeAt(0);
+					} else {
+						rng = selection.createRange ? selection.createRange() : doc.createRange();
+					}
+				}
+			} catch (ex) {
+				// IE throws unspecified error here if TinyMCE is placed in a frame/iframe
+			}
+
+			// We have W3C ranges and it's IE then fake control selection since IE9 doesn't handle that correctly yet
+			// IE 11 doesn't support the selection object so we check for that as well
+			if (isIE && rng && rng.setStart && doc.selection) {
+				try {
+					// IE will sometimes throw an exception here
+					ieRng = doc.selection.createRange();
+				} catch (ex) {
+
+				}
+
+				if (ieRng && ieRng.item) {
+					elm = ieRng.item(0);
+					rng = doc.createRange();
+					rng.setStartBefore(elm);
+					rng.setEndAfter(elm);
+				}
+			}
+
+			// No range found then create an empty one
+			// This can occur when the editor is placed in a hidden container element on Gecko
+			// Or on IE when there was an exception
+			if (!rng) {
+				rng = doc.createRange ? doc.createRange() : doc.body.createTextRange();
+			}
+
+			// If range is at start of document then move it to start of body
+			if (rng.setStart && rng.startContainer.nodeType === 9 && rng.collapsed) {
+				elm = self.dom.getRoot();
+				rng.setStart(elm, 0);
+				rng.setEnd(elm, 0);
+			}
+
+			if (self.selectedRange && self.explicitRange) {
+				if (tryCompareBoundaryPoints(rng.START_TO_START, rng, self.selectedRange) === 0 &&
+					tryCompareBoundaryPoints(rng.END_TO_END, rng, self.selectedRange) === 0) {
+					// Safari, Opera and Chrome only ever select text which causes the range to change.
+					// This lets us use the originally set range if the selection hasn't been changed by the user.
+					rng = self.explicitRange;
+				} else {
+					self.selectedRange = null;
+					self.explicitRange = null;
+				}
+			}
+
+			return rng;
+		},
+
+		/**
+		 * Changes the selection to the specified DOM range.
+		 *
+		 * @method setRng
+		 * @param {Range} rng Range to select.
+		 */
+		setRng: function(rng, forward) {
+			var self = this, sel;
+
+			if (!rng) {
+				return;
+			}
+
+			// Is IE specific range
+			if (rng.select) {
+				try {
+					rng.select();
+				} catch (ex) {
+					// Needed for some odd IE bug #1843306
+				}
+
+				return;
+			}
+
+			if (!self.tridentSel) {
+				sel = self.getSel();
+
+				if (sel) {
+					self.explicitRange = rng;
+
+					try {
+						sel.removeAllRanges();
+						sel.addRange(rng);
+					} catch (ex) {
+						// IE might throw errors here if the editor is within a hidden container and selection is changed
+					}
+
+					// Forward is set to false and we have an extend function
+					if (forward === false && sel.extend) {
+						sel.collapse(rng.endContainer, rng.endOffset);
+						sel.extend(rng.startContainer, rng.startOffset);
+					}
+
+					// adding range isn't always successful so we need to check range count otherwise an exception can occur
+					self.selectedRange = sel.rangeCount > 0 ? sel.getRangeAt(0) : null;
+				}
+			} else {
+				// Is W3C Range fake range on IE
+				if (rng.cloneRange) {
+					try {
+						self.tridentSel.addRange(rng);
+						return;
+					} catch (ex) {
+						//IE9 throws an error here if called before selection is placed in the editor
+					}
+				}
+			}
+		},
+
+		/**
+		 * Sets the current selection to the specified DOM element.
+		 *
+		 * @method setNode
+		 * @param {Element} elm Element to set as the contents of the selection.
+		 * @return {Element} Returns the element that got passed in.
+		 * @example
+		 * // Inserts a DOM node at current selection/caret location
+		 * tinymce.activeEditor.selection.setNode(tinymce.activeEditor.dom.create('img', {src: 'some.gif', title: 'some title'}));
+		 */
+		setNode: function(elm) {
+			var self = this;
+
+			self.setContent(self.dom.getOuterHTML(elm));
+
+			return elm;
+		},
+
+		/**
+		 * Returns the currently selected element or the common ancestor element for both start and end of the selection.
+		 *
+		 * @method getNode
+		 * @return {Element} Currently selected element or common ancestor element.
+		 * @example
+		 * // Alerts the currently selected elements node name
+		 * alert(tinymce.activeEditor.selection.getNode().nodeName);
+		 */
+		getNode: function() {
+			var self = this, rng = self.getRng(), elm;
+			var startContainer = rng.startContainer, endContainer = rng.endContainer;
+			var startOffset = rng.startOffset, endOffset = rng.endOffset, root = self.dom.getRoot();
+
+			function skipEmptyTextNodes(node, forwards) {
+				var orig = node;
+
+				while (node && node.nodeType === 3 && node.length === 0) {
+					node = forwards ? node.nextSibling : node.previousSibling;
+				}
+
+				return node || orig;
+			}
+
+			// Range maybe lost after the editor is made visible again
+			if (!rng) {
+				return root;
+			}
+
+			if (rng.setStart) {
+				elm = rng.commonAncestorContainer;
+
+				// Handle selection a image or other control like element such as anchors
+				if (!rng.collapsed) {
+					if (startContainer == endContainer) {
+						if (endOffset - startOffset < 2) {
+							if (startContainer.hasChildNodes()) {
+								elm = startContainer.childNodes[startOffset];
+							}
+						}
+					}
+
+					// If the anchor node is a element instead of a text node then return this element
+					//if (tinymce.isWebKit && sel.anchorNode && sel.anchorNode.nodeType == 1)
+					//	return sel.anchorNode.childNodes[sel.anchorOffset];
+
+					// Handle cases where the selection is immediately wrapped around a node and return that node instead of it's parent.
+					// This happens when you double click an underlined word in FireFox.
+					if (startContainer.nodeType === 3 && endContainer.nodeType === 3) {
+						if (startContainer.length === startOffset) {
+							startContainer = skipEmptyTextNodes(startContainer.nextSibling, true);
+						} else {
+							startContainer = startContainer.parentNode;
+						}
+
+						if (endOffset === 0) {
+							endContainer = skipEmptyTextNodes(endContainer.previousSibling, false);
+						} else {
+							endContainer = endContainer.parentNode;
+						}
+
+						if (startContainer && startContainer === endContainer) {
+							return startContainer;
+						}
+					}
+				}
+
+				if (elm && elm.nodeType == 3) {
+					return elm.parentNode;
+				}
+
+				return elm;
+			}
+
+			elm = rng.item ? rng.item(0) : rng.parentElement();
+
+			// IE 7 might return elements outside the iframe
+			if (elm.ownerDocument !== self.win.document) {
+				elm = root;
+			}
+
+			return elm;
+		},
+
+		getSelectedBlocks: function(startElm, endElm) {
+			var self = this, dom = self.dom, node, root, selectedBlocks = [];
+
+			root = dom.getRoot();
+			startElm = dom.getParent(startElm || self.getStart(), dom.isBlock);
+			endElm = dom.getParent(endElm || self.getEnd(), dom.isBlock);
+
+			if (startElm && startElm != root) {
+				selectedBlocks.push(startElm);
+			}
+
+			if (startElm && endElm && startElm != endElm) {
+				node = startElm;
+
+				var walker = new TreeWalker(startElm, root);
+				while ((node = walker.next()) && node != endElm) {
+					if (dom.isBlock(node)) {
+						selectedBlocks.push(node);
+					}
+				}
+			}
+
+			if (endElm && startElm != endElm && endElm != root) {
+				selectedBlocks.push(endElm);
+			}
+
+			return selectedBlocks;
+		},
+
+		isForward: function() {
+			var dom = this.dom, sel = this.getSel(), anchorRange, focusRange;
+
+			// No support for selection direction then always return true
+			if (!sel || !sel.anchorNode || !sel.focusNode) {
+				return true;
+			}
+
+			anchorRange = dom.createRng();
+			anchorRange.setStart(sel.anchorNode, sel.anchorOffset);
+			anchorRange.collapse(true);
+
+			focusRange = dom.createRng();
+			focusRange.setStart(sel.focusNode, sel.focusOffset);
+			focusRange.collapse(true);
+
+			return anchorRange.compareBoundaryPoints(anchorRange.START_TO_START, focusRange) <= 0;
+		},
+
+		normalize: function() {
+			var self = this, rng = self.getRng();
+
+			if (Env.range && new RangeUtils(self.dom).normalize(rng)) {
+				self.setRng(rng, self.isForward());
+			}
+
+			return rng;
+		},
+
+		/**
+		 * Executes callback when the current selection starts/stops matching the specified selector. The current
+		 * state will be passed to the callback as it's first argument.
+		 *
+		 * @method selectorChanged
+		 * @param {String} selector CSS selector to check for.
+		 * @param {function} callback Callback with state and args when the selector is matches or not.
+		 */
+		selectorChanged: function(selector, callback) {
+			var self = this, currentSelectors;
+
+			if (!self.selectorChangedData) {
+				self.selectorChangedData = {};
+				currentSelectors = {};
+
+				self.editor.on('NodeChange', function(e) {
+					var node = e.element, dom = self.dom, parents = dom.getParents(node, null, dom.getRoot()), matchedSelectors = {};
+
+					// Check for new matching selectors
+					each(self.selectorChangedData, function(callbacks, selector) {
+						each(parents, function(node) {
+							if (dom.is(node, selector)) {
+								if (!currentSelectors[selector]) {
+									// Execute callbacks
+									each(callbacks, function(callback) {
+										callback(true, {node: node, selector: selector, parents: parents});
+									});
+
+									currentSelectors[selector] = callbacks;
+								}
+
+								matchedSelectors[selector] = callbacks;
+								return false;
+							}
+						});
+					});
+
+					// Check if current selectors still match
+					each(currentSelectors, function(callbacks, selector) {
+						if (!matchedSelectors[selector]) {
+							delete currentSelectors[selector];
+
+							each(callbacks, function(callback) {
+								callback(false, {node: node, selector: selector, parents: parents});
+							});
+						}
+					});
+				});
+			}
+
+			// Add selector listeners
+			if (!self.selectorChangedData[selector]) {
+				self.selectorChangedData[selector] = [];
+			}
+
+			self.selectorChangedData[selector].push(callback);
+
+			return self;
+		},
+
+		getScrollContainer: function() {
+			var scrollContainer, node = this.dom.getRoot();
+
+			while (node && node.nodeName != 'BODY') {
+				if (node.scrollHeight > node.clientHeight) {
+					scrollContainer = node;
+					break;
+				}
+
+				node = node.parentNode;
+			}
+
+			return scrollContainer;
+		},
+
+		scrollIntoView: function(elm) {
+			var y, viewPort, self = this, dom = self.dom, root = dom.getRoot(), viewPortY, viewPortH;
+
+			function getPos(elm) {
+				var x = 0, y = 0;
+
+				var offsetParent = elm;
+				while (offsetParent && offsetParent.nodeType) {
+					x += offsetParent.offsetLeft || 0;
+					y += offsetParent.offsetTop || 0;
+					offsetParent = offsetParent.offsetParent;
+				}
+
+				return {x: x, y: y};
+			}
+
+			if (root.nodeName != 'BODY') {
+				var scrollContainer = self.getScrollContainer();
+				if (scrollContainer) {
+					y = getPos(elm).y - getPos(scrollContainer).y;
+					viewPortH = scrollContainer.clientHeight;
+					viewPortY = scrollContainer.scrollTop;
+					if (y < viewPortY || y + 25 > viewPortY + viewPortH) {
+						scrollContainer.scrollTop = y < viewPortY ? y : y - viewPortH + 25;
+					}
+
+					return;
+				}
+			}
+
+			viewPort = dom.getViewPort(self.editor.getWin());
+			y = dom.getPos(elm).y;
+			viewPortY = viewPort.y;
+			viewPortH = viewPort.h;
+			if (y < viewPort.y || y + 25 > viewPortY + viewPortH) {
+				self.editor.getWin().scrollTo(0, y < viewPortY ? y : y - viewPortH + 25);
+			}
+		},
+
+		placeCaretAt: function(clientX, clientY) {
+			var doc = this.editor.getDoc(), rng, point;
+
+			if (doc.caretPositionFromPoint) {
+				point = doc.caretPositionFromPoint(clientX, clientY);
+				rng = doc.createRange();
+				rng.setStart(point.offsetNode, point.offset);
+				rng.collapse(true);
+			} else if (doc.caretRangeFromPoint) {
+				rng = doc.caretRangeFromPoint(clientX, clientY);
+			} else if (doc.body.createTextRange) {
+				rng = doc.body.createTextRange();
+
+				try {
+					rng.moveToPoint(clientX, clientY);
+					rng.collapse(true);
+				} catch (ex) {
+					rng.collapse(clientY < doc.body.clientHeight);
+				}
+			}
+
+			this.setRng(rng);
+		},
+
+		_moveEndPoint: function(rng, node, start) {
+			var root = node, walker = new TreeWalker(node, root);
+			var nonEmptyElementsMap = this.dom.schema.getNonEmptyElements();
+
+			do {
+				// Text node
+				if (node.nodeType == 3 && trim(node.nodeValue).length !== 0) {
+					if (start) {
+						rng.setStart(node, 0);
+					} else {
+						rng.setEnd(node, node.nodeValue.length);
+					}
+
+					return;
+				}
+
+				// BR/IMG/INPUT elements but not table cells
+				if (nonEmptyElementsMap[node.nodeName] && !/^(TD|TH)$/.test(node.nodeName)) {
+					if (start) {
+						rng.setStartBefore(node);
+					} else {
+						if (node.nodeName == 'BR') {
+							rng.setEndBefore(node);
+						} else {
+							rng.setEndAfter(node);
+						}
+					}
+
+					return;
+				}
+
+				// Found empty text block old IE can place the selection inside those
+				if (Env.ie && Env.ie < 11 && this.dom.isBlock(node) && this.dom.isEmpty(node)) {
+					if (start) {
+						rng.setStart(node, 0);
+					} else {
+						rng.setEnd(node, 0);
+					}
+
+					return;
+				}
+			} while ((node = (start ? walker.next() : walker.prev())));
+
+			// Failed to find any text node or other suitable location then move to the root of body
+			if (root.nodeName == 'BODY') {
+				if (start) {
+					rng.setStart(root, 0);
+				} else {
+					rng.setEnd(root, root.childNodes.length);
+				}
+			}
+		},
+
+		destroy: function() {
+			this.win = null;
+			this.controlSelection.destroy();
+		}
+	};
+
+	return Selection;
+});
+
+// Included from: js/tinymce/classes/dom/ElementUtils.js
+
+/**
+ * ElementUtils.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Utility class for various element specific functions.
+ *
+ * @private
+ */
+define("tinymce/dom/ElementUtils", [
+	"tinymce/dom/BookmarkManager",
+	"tinymce/util/Tools"
+], function(BookmarkManager, Tools) {
+	var each = Tools.each;
+
+	function ElementUtils(dom) {
+		/**
+		 * Compares two nodes and checks if it's attributes and styles matches.
+		 * This doesn't compare classes as items since their order is significant.
+		 *
+		 * @method compare
+		 * @param {Node} node1 First node to compare with.
+		 * @param {Node} node2 Second node to compare with.
+		 * @return {boolean} True/false if the nodes are the same or not.
+		 */
+		this.compare = function(node1, node2) {
+			// Not the same name
+			if (node1.nodeName != node2.nodeName) {
+				return false;
+			}
+
+			/**
+			 * Returns all the nodes attributes excluding internal ones, styles and classes.
+			 *
+			 * @private
+			 * @param {Node} node Node to get attributes from.
+			 * @return {Object} Name/value object with attributes and attribute values.
+			 */
+			function getAttribs(node) {
+				var attribs = {};
+
+				each(dom.getAttribs(node), function(attr) {
+					var name = attr.nodeName.toLowerCase();
+
+					// Don't compare internal attributes or style
+					if (name.indexOf('_') !== 0 && name !== 'style' && name !== 'data-mce-style') {
+						attribs[name] = dom.getAttrib(node, name);
+					}
+				});
+
+				return attribs;
+			}
+
+			/**
+			 * Compares two objects checks if it's key + value exists in the other one.
+			 *
+			 * @private
+			 * @param {Object} obj1 First object to compare.
+			 * @param {Object} obj2 Second object to compare.
+			 * @return {boolean} True/false if the objects matches or not.
+			 */
+			function compareObjects(obj1, obj2) {
+				var value, name;
+
+				for (name in obj1) {
+					// Obj1 has item obj2 doesn't have
+					if (obj1.hasOwnProperty(name)) {
+						value = obj2[name];
+
+						// Obj2 doesn't have obj1 item
+						if (typeof value == "undefined") {
+							return false;
+						}
+
+						// Obj2 item has a different value
+						if (obj1[name] != value) {
+							return false;
+						}
+
+						// Delete similar value
+						delete obj2[name];
+					}
+				}
+
+				// Check if obj 2 has something obj 1 doesn't have
+				for (name in obj2) {
+					// Obj2 has item obj1 doesn't have
+					if (obj2.hasOwnProperty(name)) {
+						return false;
+					}
+				}
+
+				return true;
+			}
+
+			// Attribs are not the same
+			if (!compareObjects(getAttribs(node1), getAttribs(node2))) {
+				return false;
+			}
+
+			// Styles are not the same
+			if (!compareObjects(dom.parseStyle(dom.getAttrib(node1, 'style')), dom.parseStyle(dom.getAttrib(node2, 'style')))) {
+				return false;
+			}
+
+			return !BookmarkManager.isBookmarkNode(node1) && !BookmarkManager.isBookmarkNode(node2);
+		};
+	}
+
+	return ElementUtils;
+});
+
+// Included from: js/tinymce/classes/fmt/Preview.js
+
+/**
+ * Preview.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Internal class for generating previews styles for formats.
+ *
+ * Example:
+ *  Preview.getCssText(editor, 'bold');
+ *
+ * @class tinymce.fmt.Preview
+ * @private
+ */
+define("tinymce/fmt/Preview", [
+	"tinymce/util/Tools"
+], function(Tools) {
+	var each = Tools.each;
+
+	function getCssText(editor, format) {
+		var name, previewElm, dom = editor.dom;
+		var previewCss = '', parentFontSize, previewStyles;
+
+		previewStyles = editor.settings.preview_styles;
+
+		// No preview forced
+		if (previewStyles === false) {
+			return '';
+		}
+
+		// Default preview
+		if (!previewStyles) {
+			previewStyles = 'font-family font-size font-weight font-style text-decoration ' +
+				'text-transform color background-color border border-radius outline text-shadow';
+		}
+
+		// Removes any variables since these can't be previewed
+		function removeVars(val) {
+			return val.replace(/%(\w+)/g, '');
+		}
+
+		// Create block/inline element to use for preview
+		if (typeof format == "string") {
+			format = editor.formatter.get(format);
+			if (!format) {
+				return;
+			}
+
+			format = format[0];
+		}
+
+		name = format.block || format.inline || 'span';
+		previewElm = dom.create(name);
+
+		// Add format styles to preview element
+		each(format.styles, function(value, name) {
+			value = removeVars(value);
+
+			if (value) {
+				dom.setStyle(previewElm, name, value);
+			}
+		});
+
+		// Add attributes to preview element
+		each(format.attributes, function(value, name) {
+			value = removeVars(value);
+
+			if (value) {
+				dom.setAttrib(previewElm, name, value);
+			}
+		});
+
+		// Add classes to preview element
+		each(format.classes, function(value) {
+			value = removeVars(value);
+
+			if (!dom.hasClass(previewElm, value)) {
+				dom.addClass(previewElm, value);
+			}
+		});
+
+		editor.fire('PreviewFormats');
+
+		// Add the previewElm outside the visual area
+		dom.setStyles(previewElm, {position: 'absolute', left: -0xFFFF});
+		editor.getBody().appendChild(previewElm);
+
+		// Get parent container font size so we can compute px values out of em/% for older IE:s
+		parentFontSize = dom.getStyle(editor.getBody(), 'fontSize', true);
+		parentFontSize = /px$/.test(parentFontSize) ? parseInt(parentFontSize, 10) : 0;
+
+		each(previewStyles.split(' '), function(name) {
+			var value = dom.getStyle(previewElm, name, true);
+
+			// If background is transparent then check if the body has a background color we can use
+			if (name == 'background-color' && /transparent|rgba\s*\([^)]+,\s*0\)/.test(value)) {
+				value = dom.getStyle(editor.getBody(), name, true);
+
+				// Ignore white since it's the default color, not the nicest fix
+				// TODO: Fix this by detecting runtime style
+				if (dom.toHex(value).toLowerCase() == '#ffffff') {
+					return;
+				}
+			}
+
+			if (name == 'color') {
+				// Ignore black since it's the default color, not the nicest fix
+				// TODO: Fix this by detecting runtime style
+				if (dom.toHex(value).toLowerCase() == '#000000') {
+					return;
+				}
+			}
+
+			// Old IE won't calculate the font size so we need to do that manually
+			if (name == 'font-size') {
+				if (/em|%$/.test(value)) {
+					if (parentFontSize === 0) {
+						return;
+					}
+
+					// Convert font size from em/% to px
+					value = parseFloat(value, 10) / (/%$/.test(value) ? 100 : 1);
+					value = (value * parentFontSize) + 'px';
+				}
+			}
+
+			if (name == "border" && value) {
+				previewCss += 'padding:0 2px;';
+			}
+
+			previewCss += name + ':' + value + ';';
+		});
+
+		editor.fire('AfterPreviewFormats');
+
+		//previewCss += 'line-height:normal';
+
+		dom.remove(previewElm);
+
+		return previewCss;
+	}
+
+	return {
+		getCssText: getCssText
+	};
+});
+
+// Included from: js/tinymce/classes/Formatter.js
+
+/**
+ * Formatter.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Text formatter engine class. This class is used to apply formats like bold, italic, font size
+ * etc to the current selection or specific nodes. This engine was build to replace the browsers
+ * default formatting logic for execCommand due to it's inconsistent and buggy behavior.
+ *
+ * @class tinymce.Formatter
+ * @example
+ *  tinymce.activeEditor.formatter.register('mycustomformat', {
+ *    inline: 'span',
+ *    styles: {color: '#ff0000'}
+ *  });
+ *
+ *  tinymce.activeEditor.formatter.apply('mycustomformat');
+ */
+define("tinymce/Formatter", [
+	"tinymce/dom/TreeWalker",
+	"tinymce/dom/RangeUtils",
+	"tinymce/dom/BookmarkManager",
+	"tinymce/dom/ElementUtils",
+	"tinymce/util/Tools",
+	"tinymce/fmt/Preview"
+], function(TreeWalker, RangeUtils, BookmarkManager, ElementUtils, Tools, Preview) {
+	/**
+	 * Constructs a new formatter instance.
+	 *
+	 * @constructor Formatter
+	 * @param {tinymce.Editor} ed Editor instance to construct the formatter engine to.
+	 */
+	return function(ed) {
+		var formats = {},
+			dom = ed.dom,
+			selection = ed.selection,
+			rangeUtils = new RangeUtils(dom),
+			isValid = ed.schema.isValidChild,
+			isBlock = dom.isBlock,
+			forcedRootBlock = ed.settings.forced_root_block,
+			nodeIndex = dom.nodeIndex,
+			INVISIBLE_CHAR = '\uFEFF',
+			MCE_ATTR_RE = /^(src|href|style)$/,
+			FALSE = false,
+			TRUE = true,
+			formatChangeData,
+			undef,
+			getContentEditable = dom.getContentEditable,
+			disableCaretContainer,
+			markCaretContainersBogus,
+			isBookmarkNode = BookmarkManager.isBookmarkNode;
+
+		var each = Tools.each,
+			grep = Tools.grep,
+			walk = Tools.walk,
+			extend = Tools.extend;
+
+		function isTextBlock(name) {
+			if (name.nodeType) {
+				name = name.nodeName;
+			}
+
+			return !!ed.schema.getTextBlockElements()[name.toLowerCase()];
+		}
+
+		function isTableCell(node) {
+			return /^(TH|TD)$/.test(node.nodeName);
+		}
+
+		function getParents(node, selector) {
+			return dom.getParents(node, selector, dom.getRoot());
+		}
+
+		function isCaretNode(node) {
+			return node.nodeType === 1 && node.id === '_mce_caret';
+		}
+
+		function defaultFormats() {
+			register({
+				valigntop: [
+					{selector: 'td,th', styles: {'verticalAlign': 'top'}}
+				],
+
+				valignmiddle: [
+					{selector: 'td,th', styles: {'verticalAlign': 'middle'}}
+				],
+
+				valignbottom: [
+					{selector: 'td,th', styles: {'verticalAlign': 'bottom'}}
+				],
+
+				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: false, 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: false, styles: {display: 'block', marginLeft: 'auto', marginRight: 'auto'}},
+					{selector: 'table', collapsed: false, 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: false, 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: true},
+					{inline: 'u', remove: 'all'}
+				],
+
+				strikethrough: [
+					{inline: 'span', styles: {textDecoration: 'line-through'}, exact: true},
+					{inline: 'strike', remove: 'all'}
+				],
+
+				forecolor: {inline: 'span', styles: {color: '%value'}, links: true, remove_similar: true},
+				hilitecolor: {inline: 'span', styles: {backgroundColor: '%value'}, links: true, remove_similar: true},
+				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: true, deep: true,
+					onmatch: function() {
+						return true;
+					},
+
+					onformat: function(elm, fmt, vars) {
+						each(vars, function(value, key) {
+							dom.setAttrib(elm, key, value);
+						});
+					}
+				},
+
+				removeformat: [
+					{
+						selector: 'b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins',
+						remove: 'all',
+						split: true,
+						expand: false,
+						block_expand: true,
+						deep: true
+					},
+					{selector: 'span', attributes: ['style', 'class'], remove: 'empty', split: true, expand: false, deep: true},
+					{selector: '*', attributes: ['style', 'class'], split: false, expand: false, deep: true}
+				]
+			});
+
+			// Register default block formats
+			each('p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp'.split(/\s/), function(name) {
+				register(name, {block: name, remove: 'all'});
+			});
+
+			// Register user defined formats
+			register(ed.settings.formats);
+		}
+
+		function addKeyboardShortcuts() {
+			// Add some inline shortcuts
+			ed.addShortcut('meta+b', 'bold_desc', 'Bold');
+			ed.addShortcut('meta+i', 'italic_desc', 'Italic');
+			ed.addShortcut('meta+u', 'underline_desc', 'Underline');
+
+			// BlockFormat shortcuts keys
+			for (var i = 1; i <= 6; i++) {
+				ed.addShortcut('access+' + i, '', ['FormatBlock', false, 'h' + i]);
+			}
+
+			ed.addShortcut('access+7', '', ['FormatBlock', false, 'p']);
+			ed.addShortcut('access+8', '', ['FormatBlock', false, 'div']);
+			ed.addShortcut('access+9', '', ['FormatBlock', false, 'address']);
+		}
+
+		// Public functions
+
+		/**
+		 * Returns the format by name or all formats if no name is specified.
+		 *
+		 * @method get
+		 * @param {String} name Optional name to retrive by.
+		 * @return {Array/Object} Array/Object with all registred formats or a specific format.
+		 */
+		function get(name) {
+			return name ? formats[name] : formats;
+		}
+
+		/**
+		 * Registers a specific format by name.
+		 *
+		 * @method register
+		 * @param {Object/String} name Name of the format for example "bold".
+		 * @param {Object/Array} format Optional format object or array of format variants
+		 * can only be omitted if the first arg is an object.
+		 */
+		function register(name, format) {
+			if (name) {
+				if (typeof name !== 'string') {
+					each(name, function(format, name) {
+						register(name, format);
+					});
+				} else {
+					// Force format into array and add it to internal collection
+					format = format.length ? format : [format];
+
+					each(format, function(format) {
+						// Set deep to false by default on selector formats this to avoid removing
+						// alignment on images inside paragraphs when alignment is changed on paragraphs
+						if (format.deep === undef) {
+							format.deep = !format.selector;
+						}
+
+						// Default to true
+						if (format.split === undef) {
+							format.split = !format.selector || format.inline;
+						}
+
+						// Default to true
+						if (format.remove === undef && format.selector && !format.inline) {
+							format.remove = 'none';
+						}
+
+						// Mark format as a mixed format inline + block level
+						if (format.selector && format.inline) {
+							format.mixed = true;
+							format.block_expand = true;
+						}
+
+						// Split classes if needed
+						if (typeof format.classes === 'string') {
+							format.classes = format.classes.split(/\s+/);
+						}
+					});
+
+					formats[name] = format;
+				}
+			}
+		}
+
+		/**
+		 * Unregister a specific format by name.
+		 *
+		 * @method unregister
+		 * @param {String} name Name of the format for example "bold".
+		 */
+		function unregister(name) {
+			if (name && formats[name]) {
+				delete formats[name];
+			}
+
+			return formats;
+		}
+
+		function getTextDecoration(node) {
+			var decoration;
+
+			ed.dom.getParent(node, function(n) {
+				decoration = ed.dom.getStyle(n, 'text-decoration');
+				return decoration && decoration !== 'none';
+			});
+
+			return decoration;
+		}
+
+		function processUnderlineAndColor(node) {
+			var textDecoration;
+			if (node.nodeType === 1 && node.parentNode && node.parentNode.nodeType === 1) {
+				textDecoration = getTextDecoration(node.parentNode);
+				if (ed.dom.getStyle(node, 'color') && textDecoration) {
+					ed.dom.setStyle(node, 'text-decoration', textDecoration);
+				} else if (ed.dom.getStyle(node, 'text-decoration') === textDecoration) {
+					ed.dom.setStyle(node, 'text-decoration', null);
+				}
+			}
+		}
+
+		/**
+		 * Applies the specified format to the current selection or specified node.
+		 *
+		 * @method apply
+		 * @param {String} name Name of format to apply.
+		 * @param {Object} vars Optional list of variables to replace within format before applying it.
+		 * @param {Node} node Optional node to apply the format to defaults to current selection.
+		 */
+		function apply(name, vars, node) {
+			var formatList = get(name), format = formatList[0], bookmark, rng, isCollapsed = !node && selection.isCollapsed();
+
+			function setElementFormat(elm, fmt) {
+				fmt = fmt || format;
+
+				if (elm) {
+					if (fmt.onformat) {
+						fmt.onformat(elm, fmt, vars, node);
+					}
+
+					each(fmt.styles, function(value, name) {
+						dom.setStyle(elm, name, replaceVars(value, vars));
+					});
+
+					// Needed for the WebKit span spam bug
+					// TODO: Remove this once WebKit/Blink fixes this
+					if (fmt.styles) {
+						var styleVal = dom.getAttrib(elm, 'style');
+
+						if (styleVal) {
+							elm.setAttribute('data-mce-style', styleVal);
+						}
+					}
+
+					each(fmt.attributes, function(value, name) {
+						dom.setAttrib(elm, name, replaceVars(value, vars));
+					});
+
+					each(fmt.classes, function(value) {
+						value = replaceVars(value, vars);
+
+						if (!dom.hasClass(elm, value)) {
+							dom.addClass(elm, value);
+						}
+					});
+				}
+			}
+
+			function adjustSelectionToVisibleSelection() {
+				function findSelectionEnd(start, end) {
+					var walker = new TreeWalker(end);
+					for (node = walker.current(); node; node = walker.prev()) {
+						if (node.childNodes.length > 1 || node == start || node.tagName == 'BR') {
+							return node;
+						}
+					}
+				}
+
+				// Adjust selection so that a end container with a end offset of zero is not included in the selection
+				// as this isn't visible to the user.
+				var rng = ed.selection.getRng();
+				var start = rng.startContainer;
+				var end = rng.endContainer;
+
+				if (start != end && rng.endOffset === 0) {
+					var newEnd = findSelectionEnd(start, end);
+					var endOffset = newEnd.nodeType == 3 ? newEnd.length : newEnd.childNodes.length;
+
+					rng.setEnd(newEnd, endOffset);
+				}
+
+				return rng;
+			}
+
+			function applyRngStyle(rng, bookmark, node_specific) {
+				var newWrappers = [], wrapName, wrapElm, contentEditable = true;
+
+				// Setup wrapper element
+				wrapName = format.inline || format.block;
+				wrapElm = dom.create(wrapName);
+				setElementFormat(wrapElm);
+
+				rangeUtils.walk(rng, function(nodes) {
+					var currentWrapElm;
+
+					/**
+					 * Process a list of nodes wrap them.
+					 */
+					function process(node) {
+						var nodeName, parentName, found, hasContentEditableState, lastContentEditable;
+
+						lastContentEditable = contentEditable;
+						nodeName = node.nodeName.toLowerCase();
+						parentName = node.parentNode.nodeName.toLowerCase();
+
+						// Node has a contentEditable value
+						if (node.nodeType === 1 && getContentEditable(node)) {
+							lastContentEditable = contentEditable;
+							contentEditable = getContentEditable(node) === "true";
+							hasContentEditableState = true; // We don't want to wrap the container only it's children
+						}
+
+						// Stop wrapping on br elements
+						if (isEq(nodeName, 'br')) {
+							currentWrapElm = 0;
+
+							// Remove any br elements when we wrap things
+							if (format.block) {
+								dom.remove(node);
+							}
+
+							return;
+						}
+
+						// If node is wrapper type
+						if (format.wrapper && matchNode(node, name, vars)) {
+							currentWrapElm = 0;
+							return;
+						}
+
+						// Can we rename the block
+						// TODO: Break this if up, too complex
+						if (contentEditable && !hasContentEditableState && format.block &&
+							!format.wrapper && isTextBlock(nodeName) && isValid(parentName, wrapName)) {
+							node = dom.rename(node, wrapName);
+							setElementFormat(node);
+							newWrappers.push(node);
+							currentWrapElm = 0;
+							return;
+						}
+
+						// Handle selector patterns
+						if (format.selector) {
+							// Look for matching formats
+							each(formatList, function(format) {
+								// Check collapsed state if it exists
+								if ('collapsed' in format && format.collapsed !== isCollapsed) {
+									return;
+								}
+
+								if (dom.is(node, format.selector) && !isCaretNode(node)) {
+									setElementFormat(node, format);
+									found = true;
+								}
+							});
+
+							// Continue processing if a selector match wasn't found and a inline element is defined
+							if (!format.inline || found) {
+								currentWrapElm = 0;
+								return;
+							}
+						}
+
+						// Is it valid to wrap this item
+						// TODO: Break this if up, too complex
+						if (contentEditable && !hasContentEditableState && isValid(wrapName, nodeName) && isValid(parentName, wrapName) &&
+								!(!node_specific && node.nodeType === 3 &&
+								node.nodeValue.length === 1 &&
+								node.nodeValue.charCodeAt(0) === 65279) &&
+								!isCaretNode(node) &&
+								(!format.inline || !isBlock(node))) {
+							// Start wrapping
+							if (!currentWrapElm) {
+								// Wrap the node
+								currentWrapElm = dom.clone(wrapElm, FALSE);
+								node.parentNode.insertBefore(currentWrapElm, node);
+								newWrappers.push(currentWrapElm);
+							}
+
+							currentWrapElm.appendChild(node);
+						} else {
+							// Start a new wrapper for possible children
+							currentWrapElm = 0;
+
+							each(grep(node.childNodes), process);
+
+							if (hasContentEditableState) {
+								contentEditable = lastContentEditable; // Restore last contentEditable state from stack
+							}
+
+							// End the last wrapper
+							currentWrapElm = 0;
+						}
+					}
+
+					// Process siblings from range
+					each(nodes, process);
+				});
+
+				// Apply formats to links as well to get the color of the underline to change as well
+				if (format.links === true) {
+					each(newWrappers, function(node) {
+						function process(node) {
+							if (node.nodeName === 'A') {
+								setElementFormat(node, format);
+							}
+
+							each(grep(node.childNodes), process);
+						}
+
+						process(node);
+					});
+				}
+
+				// Cleanup
+				each(newWrappers, function(node) {
+					var childCount;
+
+					function getChildCount(node) {
+						var count = 0;
+
+						each(node.childNodes, function(node) {
+							if (!isWhiteSpaceNode(node) && !isBookmarkNode(node)) {
+								count++;
+							}
+						});
+
+						return count;
+					}
+
+					function mergeStyles(node) {
+						var child, clone;
+
+						each(node.childNodes, function(node) {
+							if (node.nodeType == 1 && !isBookmarkNode(node) && !isCaretNode(node)) {
+								child = node;
+								return FALSE; // break loop
+							}
+						});
+
+						// If child was found and of the same type as the current node
+						if (child && !isBookmarkNode(child) && matchName(child, format)) {
+							clone = dom.clone(child, FALSE);
+							setElementFormat(clone);
+
+							dom.replace(clone, node, TRUE);
+							dom.remove(child, 1);
+						}
+
+						return clone || node;
+					}
+
+					childCount = getChildCount(node);
+
+					// Remove empty nodes but only if there is multiple wrappers and they are not block
+					// elements so never remove single <h1></h1> since that would remove the
+					// currrent empty block element where the caret is at
+					if ((newWrappers.length > 1 || !isBlock(node)) && childCount === 0) {
+						dom.remove(node, 1);
+						return;
+					}
+
+					if (format.inline || format.wrapper) {
+						// Merges the current node with it's children of similar type to reduce the number of elements
+						if (!format.exact && childCount === 1) {
+							node = mergeStyles(node);
+						}
+
+						// Remove/merge children
+						each(formatList, function(format) {
+							// Merge all children of similar type will move styles from child to parent
+							// this: <span style="color:red"><b><span style="color:red; font-size:10px">text</span></b></span>
+							// will become: <span style="color:red"><b><span style="font-size:10px">text</span></b></span>
+							each(dom.select(format.inline, node), function(child) {
+								if (isBookmarkNode(child)) {
+									return;
+								}
+
+								removeFormat(format, vars, child, format.exact ? child : null);
+							});
+						});
+
+						// Remove child if direct parent is of same type
+						if (matchNode(node.parentNode, name, vars)) {
+							dom.remove(node, 1);
+							node = 0;
+							return TRUE;
+						}
+
+						// Look for parent with similar style format
+						if (format.merge_with_parents) {
+							dom.getParent(node.parentNode, function(parent) {
+								if (matchNode(parent, name, vars)) {
+									dom.remove(node, 1);
+									node = 0;
+									return TRUE;
+								}
+							});
+						}
+
+						// Merge next and previous siblings if they are similar <b>text</b><b>text</b> becomes <b>texttext</b>
+						if (node && format.merge_siblings !== false) {
+							node = mergeSiblings(getNonWhiteSpaceSibling(node), node);
+							node = mergeSiblings(node, getNonWhiteSpaceSibling(node, TRUE));
+						}
+					}
+				});
+			}
+
+			if (format) {
+				if (node) {
+					if (node.nodeType) {
+						rng = dom.createRng();
+						rng.setStartBefore(node);
+						rng.setEndAfter(node);
+						applyRngStyle(expandRng(rng, formatList), null, true);
+					} else {
+						applyRngStyle(node, null, true);
+					}
+				} else {
+					if (!isCollapsed || !format.inline || dom.select('td.mce-item-selected,th.mce-item-selected').length) {
+						// Obtain selection node before selection is unselected by applyRngStyle()
+						var curSelNode = ed.selection.getNode();
+
+						// If the formats have a default block and we can't find a parent block then
+						// start wrapping it with a DIV this is for forced_root_blocks: false
+						// It's kind of a hack but people should be using the default block type P since all desktop editors work that way
+						if (!forcedRootBlock && formatList[0].defaultBlock && !dom.getParent(curSelNode, dom.isBlock)) {
+							apply(formatList[0].defaultBlock);
+						}
+
+						// Apply formatting to selection
+						ed.selection.setRng(adjustSelectionToVisibleSelection());
+						bookmark = selection.getBookmark();
+						applyRngStyle(expandRng(selection.getRng(TRUE), formatList), bookmark);
+
+						// Colored nodes should be underlined so that the color of the underline matches the text color.
+						if (format.styles && (format.styles.color || format.styles.textDecoration)) {
+							walk(curSelNode, processUnderlineAndColor, 'childNodes');
+							processUnderlineAndColor(curSelNode);
+						}
+
+						selection.moveToBookmark(bookmark);
+						moveStart(selection.getRng(TRUE));
+						ed.nodeChanged();
+					} else {
+						performCaretAction('apply', name, vars);
+					}
+				}
+			}
+		}
+
+		/**
+		 * Removes the specified format from the current selection or specified node.
+		 *
+		 * @method remove
+		 * @param {String} name Name of format to remove.
+		 * @param {Object} vars Optional list of variables to replace within format before removing it.
+		 * @param {Node/Range} node Optional node or DOM range to remove the format from defaults to current selection.
+		 */
+		function remove(name, vars, node, similar) {
+			var formatList = get(name), format = formatList[0], bookmark, rng, contentEditable = true;
+
+			// Merges the styles for each node
+			function process(node) {
+				var children, i, l, lastContentEditable, hasContentEditableState;
+
+				// Node has a contentEditable value
+				if (node.nodeType === 1 && getContentEditable(node)) {
+					lastContentEditable = contentEditable;
+					contentEditable = getContentEditable(node) === "true";
+					hasContentEditableState = true; // We don't want to wrap the container only it's children
+				}
+
+				// Grab the children first since the nodelist might be changed
+				children = grep(node.childNodes);
+
+				// Process current node
+				if (contentEditable && !hasContentEditableState) {
+					for (i = 0, l = formatList.length; i < l; i++) {
+						if (removeFormat(formatList[i], vars, node, node)) {
+							break;
+						}
+					}
+				}
+
+				// Process the children
+				if (format.deep) {
+					if (children.length) {
+						for (i = 0, l = children.length; i < l; i++) {
+							process(children[i]);
+						}
+
+						if (hasContentEditableState) {
+							contentEditable = lastContentEditable; // Restore last contentEditable state from stack
+						}
+					}
+				}
+			}
+
+			function findFormatRoot(container) {
+				var formatRoot;
+
+				// Find format root
+				each(getParents(container.parentNode).reverse(), function(parent) {
+					var format;
+
+					// Find format root element
+					if (!formatRoot && parent.id != '_start' && parent.id != '_end') {
+						// Is the node matching the format we are looking for
+						format = matchNode(parent, name, vars, similar);
+						if (format && format.split !== false) {
+							formatRoot = parent;
+						}
+					}
+				});
+
+				return formatRoot;
+			}
+
+			function wrapAndSplit(formatRoot, container, target, split) {
+				var parent, clone, lastClone, firstClone, i, formatRootParent;
+
+				// Format root found then clone formats and split it
+				if (formatRoot) {
+					formatRootParent = formatRoot.parentNode;
+
+					for (parent = container.parentNode; parent && parent != formatRootParent; parent = parent.parentNode) {
+						clone = dom.clone(parent, FALSE);
+
+						for (i = 0; i < formatList.length; i++) {
+							if (removeFormat(formatList[i], vars, clone, clone)) {
+								clone = 0;
+								break;
+							}
+						}
+
+						// Build wrapper node
+						if (clone) {
+							if (lastClone) {
+								clone.appendChild(lastClone);
+							}
+
+							if (!firstClone) {
+								firstClone = clone;
+							}
+
+							lastClone = clone;
+						}
+					}
+
+					// Never split block elements if the format is mixed
+					if (split && (!format.mixed || !isBlock(formatRoot))) {
+						container = dom.split(formatRoot, container);
+					}
+
+					// Wrap container in cloned formats
+					if (lastClone) {
+						target.parentNode.insertBefore(lastClone, target);
+						firstClone.appendChild(target);
+					}
+				}
+
+				return container;
+			}
+
+			function splitToFormatRoot(container) {
+				return wrapAndSplit(findFormatRoot(container), container, container, true);
+			}
+
+			function unwrap(start) {
+				var node = dom.get(start ? '_start' : '_end'),
+					out = node[start ? 'firstChild' : 'lastChild'];
+
+				// If the end is placed within the start the result will be removed
+				// So this checks if the out node is a bookmark node if it is it
+				// checks for another more suitable node
+				if (isBookmarkNode(out)) {
+					out = out[start ? 'firstChild' : 'lastChild'];
+				}
+
+				// Since dom.remove removes empty text nodes then we need to try to find a better node
+				if (out.nodeType == 3 && out.data.length === 0) {
+					out = start ? node.previousSibling || node.nextSibling : node.nextSibling || node.previousSibling;
+				}
+
+				dom.remove(node, true);
+
+				return out;
+			}
+
+			function removeRngStyle(rng) {
+				var startContainer, endContainer;
+				var commonAncestorContainer = rng.commonAncestorContainer;
+
+				rng = expandRng(rng, formatList, TRUE);
+
+				if (format.split) {
+					startContainer = getContainer(rng, TRUE);
+					endContainer = getContainer(rng);
+
+					if (startContainer != endContainer) {
+						// WebKit will render the table incorrectly if we wrap a TH or TD in a SPAN
+						// so let's see if we can use the first child instead
+						// This will happen if you triple click a table cell and use remove formatting
+						if (/^(TR|TH|TD)$/.test(startContainer.nodeName) && startContainer.firstChild) {
+							if (startContainer.nodeName == "TR") {
+								startContainer = startContainer.firstChild.firstChild || startContainer;
+							} else {
+								startContainer = startContainer.firstChild || startContainer;
+							}
+						}
+
+						// Try to adjust endContainer as well if cells on the same row were selected - bug #6410
+						if (commonAncestorContainer &&
+							/^T(HEAD|BODY|FOOT|R)$/.test(commonAncestorContainer.nodeName) &&
+							isTableCell(endContainer) && endContainer.firstChild) {
+							endContainer = endContainer.firstChild || endContainer;
+						}
+
+						if (dom.isChildOf(startContainer, endContainer) && !isTableCell(startContainer) && !isTableCell(endContainer)) {
+							startContainer = wrap(startContainer, 'span', {id: '_start', 'data-mce-type': 'bookmark'});
+							splitToFormatRoot(startContainer);
+							startContainer = unwrap(TRUE);
+							return;
+						} else {
+							// Wrap start/end nodes in span element since these might be cloned/moved
+							startContainer = wrap(startContainer, 'span', {id: '_start', 'data-mce-type': 'bookmark'});
+							endContainer = wrap(endContainer, 'span', {id: '_end', 'data-mce-type': 'bookmark'});
+
+							// Split start/end
+							splitToFormatRoot(startContainer);
+							splitToFormatRoot(endContainer);
+
+							// Unwrap start/end to get real elements again
+							startContainer = unwrap(TRUE);
+							endContainer = unwrap();
+						}
+					} else {
+						startContainer = endContainer = splitToFormatRoot(startContainer);
+					}
+
+					// Update range positions since they might have changed after the split operations
+					rng.startContainer = startContainer.parentNode ? startContainer.parentNode : startContainer;
+					rng.startOffset = nodeIndex(startContainer);
+					rng.endContainer = endContainer.parentNode ? endContainer.parentNode : endContainer;
+					rng.endOffset = nodeIndex(endContainer) + 1;
+				}
+
+				// Remove items between start/end
+				rangeUtils.walk(rng, function(nodes) {
+					each(nodes, function(node) {
+						process(node);
+
+						// Remove parent span if it only contains text-decoration: underline, yet a parent node is also underlined.
+						if (node.nodeType === 1 && ed.dom.getStyle(node, 'text-decoration') === 'underline' &&
+							node.parentNode && getTextDecoration(node.parentNode) === 'underline') {
+							removeFormat({
+								'deep': false,
+								'exact': true,
+								'inline': 'span',
+								'styles': {
+									'textDecoration': 'underline'
+								}
+							}, null, node);
+						}
+					});
+				});
+			}
+
+			// Handle node
+			if (node) {
+				if (node.nodeType) {
+					rng = dom.createRng();
+					rng.setStartBefore(node);
+					rng.setEndAfter(node);
+					removeRngStyle(rng);
+				} else {
+					removeRngStyle(node);
+				}
+
+				return;
+			}
+
+			if (!selection.isCollapsed() || !format.inline || dom.select('td.mce-item-selected,th.mce-item-selected').length) {
+				bookmark = selection.getBookmark();
+				removeRngStyle(selection.getRng(TRUE));
+				selection.moveToBookmark(bookmark);
+
+				// Check if start element still has formatting then we are at: "<b>text|</b>text"
+				// and need to move the start into the next text node
+				if (format.inline && match(name, vars, selection.getStart())) {
+					moveStart(selection.getRng(true));
+				}
+
+				ed.nodeChanged();
+			} else {
+				performCaretAction('remove', name, vars, similar);
+			}
+		}
+
+		/**
+		 * Toggles the specified format on/off.
+		 *
+		 * @method toggle
+		 * @param {String} name Name of format to apply/remove.
+		 * @param {Object} vars Optional list of variables to replace within format before applying/removing it.
+		 * @param {Node} node Optional node to apply the format to or remove from. Defaults to current selection.
+		 */
+		function toggle(name, vars, node) {
+			var fmt = get(name);
+
+			if (match(name, vars, node) && (!('toggle' in fmt[0]) || fmt[0].toggle)) {
+				remove(name, vars, node);
+			} else {
+				apply(name, vars, node);
+			}
+		}
+
+		/**
+		 * Return true/false if the specified node has the specified format.
+		 *
+		 * @method matchNode
+		 * @param {Node} node Node to check the format on.
+		 * @param {String} name Format name to check.
+		 * @param {Object} vars Optional list of variables to replace before checking it.
+		 * @param {Boolean} similar Match format that has similar properties.
+		 * @return {Object} Returns the format object it matches or undefined if it doesn't match.
+		 */
+		function matchNode(node, name, vars, similar) {
+			var formatList = get(name), format, i, classes;
+
+			function matchItems(node, format, item_name) {
+				var key, value, items = format[item_name], i;
+
+				// Custom match
+				if (format.onmatch) {
+					return format.onmatch(node, format, item_name);
+				}
+
+				// Check all items
+				if (items) {
+					// Non indexed object
+					if (items.length === undef) {
+						for (key in items) {
+							if (items.hasOwnProperty(key)) {
+								if (item_name === 'attributes') {
+									value = dom.getAttrib(node, key);
+								} else {
+									value = getStyle(node, key);
+								}
+
+								if (similar && !value && !format.exact) {
+									return;
+								}
+
+								if ((!similar || format.exact) && !isEq(value, normalizeStyleValue(replaceVars(items[key], vars), key))) {
+									return;
+								}
+							}
+						}
+					} else {
+						// Only one match needed for indexed arrays
+						for (i = 0; i < items.length; i++) {
+							if (item_name === 'attributes' ? dom.getAttrib(node, items[i]) : getStyle(node, items[i])) {
+								return format;
+							}
+						}
+					}
+				}
+
+				return format;
+			}
+
+			if (formatList && node) {
+				// Check each format in list
+				for (i = 0; i < formatList.length; i++) {
+					format = formatList[i];
+
+					// Name name, attributes, styles and classes
+					if (matchName(node, format) && matchItems(node, format, 'attributes') && matchItems(node, format, 'styles')) {
+						// Match classes
+						if ((classes = format.classes)) {
+							for (i = 0; i < classes.length; i++) {
+								if (!dom.hasClass(node, classes[i])) {
+									return;
+								}
+							}
+						}
+
+						return format;
+					}
+				}
+			}
+		}
+
+		/**
+		 * Matches the current selection or specified node against the specified format name.
+		 *
+		 * @method match
+		 * @param {String} name Name of format to match.
+		 * @param {Object} vars Optional list of variables to replace before checking it.
+		 * @param {Node} node Optional node to check.
+		 * @return {boolean} true/false if the specified selection/node matches the format.
+		 */
+		function match(name, vars, node) {
+			var startNode;
+
+			function matchParents(node) {
+				var root = dom.getRoot();
+
+				if (node === root) {
+					return false;
+				}
+
+				// Find first node with similar format settings
+				node = dom.getParent(node, function(node) {
+					return node.parentNode === root || !!matchNode(node, name, vars, true);
+				});
+
+				// Do an exact check on the similar format element
+				return matchNode(node, name, vars);
+			}
+
+			// Check specified node
+			if (node) {
+				return matchParents(node);
+			}
+
+			// Check selected node
+			node = selection.getNode();
+			if (matchParents(node)) {
+				return TRUE;
+			}
+
+			// Check start node if it's different
+			startNode = selection.getStart();
+			if (startNode != node) {
+				if (matchParents(startNode)) {
+					return TRUE;
+				}
+			}
+
+			return FALSE;
+		}
+
+		/**
+		 * Matches the current selection against the array of formats and returns a new array with matching formats.
+		 *
+		 * @method matchAll
+		 * @param {Array} names Name of format to match.
+		 * @param {Object} vars Optional list of variables to replace before checking it.
+		 * @return {Array} Array with matched formats.
+		 */
+		function matchAll(names, vars) {
+			var startElement, matchedFormatNames = [], checkedMap = {};
+
+			// Check start of selection for formats
+			startElement = selection.getStart();
+			dom.getParent(startElement, function(node) {
+				var i, name;
+
+				for (i = 0; i < names.length; i++) {
+					name = names[i];
+
+					if (!checkedMap[name] && matchNode(node, name, vars)) {
+						checkedMap[name] = true;
+						matchedFormatNames.push(name);
+					}
+				}
+			}, dom.getRoot());
+
+			return matchedFormatNames;
+		}
+
+		/**
+		 * Returns true/false if the specified format can be applied to the current selection or not. It
+		 * will currently only check the state for selector formats, it returns true on all other format types.
+		 *
+		 * @method canApply
+		 * @param {String} name Name of format to check.
+		 * @return {boolean} true/false if the specified format can be applied to the current selection/node.
+		 */
+		function canApply(name) {
+			var formatList = get(name), startNode, parents, i, x, selector;
+
+			if (formatList) {
+				startNode = selection.getStart();
+				parents = getParents(startNode);
+
+				for (x = formatList.length - 1; x >= 0; x--) {
+					selector = formatList[x].selector;
+
+					// Format is not selector based then always return TRUE
+					// Is it has a defaultBlock then it's likely it can be applied for example align on a non block element line
+					if (!selector || formatList[x].defaultBlock) {
+						return TRUE;
+					}
+
+					for (i = parents.length - 1; i >= 0; i--) {
+						if (dom.is(parents[i], selector)) {
+							return TRUE;
+						}
+					}
+				}
+			}
+
+			return FALSE;
+		}
+
+		/**
+		 * Executes the specified callback when the current selection matches the formats or not.
+		 *
+		 * @method formatChanged
+		 * @param {String} formats Comma separated list of formats to check for.
+		 * @param {function} callback Callback with state and args when the format is changed/toggled on/off.
+		 * @param {Boolean} similar True/false state if the match should handle similar or exact formats.
+		 */
+		function formatChanged(formats, callback, similar) {
+			var currentFormats;
+
+			// Setup format node change logic
+			if (!formatChangeData) {
+				formatChangeData = {};
+				currentFormats = {};
+
+				ed.on('NodeChange', function(e) {
+					var parents = getParents(e.element), matchedFormats = {};
+
+					// Ignore bogus nodes like the <a> tag created by moveStart()
+					parents = Tools.grep(parents, function(node) {
+						return node.nodeType == 1 && !node.getAttribute('data-mce-bogus');
+					});
+
+					// Check for new formats
+					each(formatChangeData, function(callbacks, format) {
+						each(parents, function(node) {
+							if (matchNode(node, format, {}, callbacks.similar)) {
+								if (!currentFormats[format]) {
+									// Execute callbacks
+									each(callbacks, function(callback) {
+										callback(true, {node: node, format: format, parents: parents});
+									});
+
+									currentFormats[format] = callbacks;
+								}
+
+								matchedFormats[format] = callbacks;
+								return false;
+							}
+						});
+					});
+
+					// Check if current formats still match
+					each(currentFormats, function(callbacks, format) {
+						if (!matchedFormats[format]) {
+							delete currentFormats[format];
+
+							each(callbacks, function(callback) {
+								callback(false, {node: e.element, format: format, parents: parents});
+							});
+						}
+					});
+				});
+			}
+
+			// Add format listeners
+			each(formats.split(','), function(format) {
+				if (!formatChangeData[format]) {
+					formatChangeData[format] = [];
+					formatChangeData[format].similar = similar;
+				}
+
+				formatChangeData[format].push(callback);
+			});
+
+			return this;
+		}
+
+		/**
+		 * Returns a preview css text for the specified format.
+		 *
+		 * @method getCssText
+		 * @param {String/Object} format Format to generate preview css text for.
+		 * @return {String} Css text for the specified format.
+		 * @example
+		 * var cssText1 = editor.formatter.getCssText('bold');
+		 * var cssText2 = editor.formatter.getCssText({inline: 'b'});
+		 */
+		function getCssText(format) {
+			return Preview.getCssText(ed, format);
+		}
+
+		// Expose to public
+		extend(this, {
+			get: get,
+			register: register,
+			unregister: unregister,
+			apply: apply,
+			remove: remove,
+			toggle: toggle,
+			match: match,
+			matchAll: matchAll,
+			matchNode: matchNode,
+			canApply: canApply,
+			formatChanged: formatChanged,
+			getCssText: getCssText
+		});
+
+		// Initialize
+		defaultFormats();
+		addKeyboardShortcuts();
+		ed.on('BeforeGetContent', function(e) {
+			if (markCaretContainersBogus && e.format != 'raw') {
+				markCaretContainersBogus();
+			}
+		});
+		ed.on('mouseup keydown', function(e) {
+			if (disableCaretContainer) {
+				disableCaretContainer(e);
+			}
+		});
+
+		// Private functions
+
+		/**
+		 * Checks if the specified nodes name matches the format inline/block or selector.
+		 *
+		 * @private
+		 * @param {Node} node Node to match against the specified format.
+		 * @param {Object} format Format object o match with.
+		 * @return {boolean} true/false if the format matches.
+		 */
+		function matchName(node, format) {
+			// Check for inline match
+			if (isEq(node, format.inline)) {
+				return TRUE;
+			}
+
+			// Check for block match
+			if (isEq(node, format.block)) {
+				return TRUE;
+			}
+
+			// Check for selector match
+			if (format.selector) {
+				return node.nodeType == 1 && dom.is(node, format.selector);
+			}
+		}
+
+		/**
+		 * Compares two string/nodes regardless of their case.
+		 *
+		 * @private
+		 * @param {String/Node} Node or string to compare.
+		 * @param {String/Node} Node or string to compare.
+		 * @return {boolean} True/false if they match.
+		 */
+		function isEq(str1, str2) {
+			str1 = str1 || '';
+			str2 = str2 || '';
+
+			str1 = '' + (str1.nodeName || str1);
+			str2 = '' + (str2.nodeName || str2);
+
+			return str1.toLowerCase() == str2.toLowerCase();
+		}
+
+		/**
+		 * Returns the style by name on the specified node. This method modifies the style
+		 * contents to make it more easy to match. This will resolve a few browser issues.
+		 *
+		 * @private
+		 * @param {Node} node to get style from.
+		 * @param {String} name Style name to get.
+		 * @return {String} Style item value.
+		 */
+		function getStyle(node, name) {
+			return normalizeStyleValue(dom.getStyle(node, name), name);
+		}
+
+		/**
+		 * Normalize style value by name. This method modifies the style contents
+		 * to make it more easy to match. This will resolve a few browser issues.
+		 *
+		 * @private
+		 * @param {Node} node to get style from.
+		 * @param {String} name Style name to get.
+		 * @return {String} Style item value.
+		 */
+		function normalizeStyleValue(value, name) {
+			// Force the format to hex
+			if (name == 'color' || name == 'backgroundColor') {
+				value = dom.toHex(value);
+			}
+
+			// Opera will return bold as 700
+			if (name == 'fontWeight' && value == 700) {
+				value = 'bold';
+			}
+
+			// Normalize fontFamily so "'Font name', Font" becomes: "Font name,Font"
+			if (name == 'fontFamily') {
+				value = value.replace(/[\'\"]/g, '').replace(/,\s+/g, ',');
+			}
+
+			return '' + value;
+		}
+
+		/**
+		 * Replaces variables in the value. The variable format is %var.
+		 *
+		 * @private
+		 * @param {String} value Value to replace variables in.
+		 * @param {Object} vars Name/value array with variables to replace.
+		 * @return {String} New value with replaced variables.
+		 */
+		function replaceVars(value, vars) {
+			if (typeof value != "string") {
+				value = value(vars);
+			} else if (vars) {
+				value = value.replace(/%(\w+)/g, function(str, name) {
+					return vars[name] || str;
+				});
+			}
+
+			return value;
+		}
+
+		function isWhiteSpaceNode(node) {
+			return node && node.nodeType === 3 && /^([\t \r\n]+|)$/.test(node.nodeValue);
+		}
+
+		function wrap(node, name, attrs) {
+			var wrapper = dom.create(name, attrs);
+
+			node.parentNode.insertBefore(wrapper, node);
+			wrapper.appendChild(node);
+
+			return wrapper;
+		}
+
+		/**
+		 * Expands the specified range like object to depending on format.
+		 *
+		 * For example on block formats it will move the start/end position
+		 * to the beginning of the current block.
+		 *
+		 * @private
+		 * @param {Object} rng Range like object.
+		 * @param {Array} formats Array with formats to expand by.
+		 * @return {Object} Expanded range like object.
+		 */
+		function expandRng(rng, format, remove) {
+			var lastIdx, leaf, endPoint,
+				startContainer = rng.startContainer,
+				startOffset = rng.startOffset,
+				endContainer = rng.endContainer,
+				endOffset = rng.endOffset;
+
+			// This function walks up the tree if there is no siblings before/after the node
+			function findParentContainer(start) {
+				var container, parent, sibling, siblingName, root;
+
+				container = parent = start ? startContainer : endContainer;
+				siblingName = start ? 'previousSibling' : 'nextSibling';
+				root = dom.getRoot();
+
+				function isBogusBr(node) {
+					return node.nodeName == "BR" && node.getAttribute('data-mce-bogus') && !node.nextSibling;
+				}
+
+				// If it's a text node and the offset is inside the text
+				if (container.nodeType == 3 && !isWhiteSpaceNode(container)) {
+					if (start ? startOffset > 0 : endOffset < container.nodeValue.length) {
+						return container;
+					}
+				}
+
+				/*eslint no-constant-condition:0 */
+				while (true) {
+					// Stop expanding on block elements
+					if (!format[0].block_expand && isBlock(parent)) {
+						return parent;
+					}
+
+					// Walk left/right
+					for (sibling = parent[siblingName]; sibling; sibling = sibling[siblingName]) {
+						if (!isBookmarkNode(sibling) && !isWhiteSpaceNode(sibling) && !isBogusBr(sibling)) {
+							return parent;
+						}
+					}
+
+					// Check if we can move up are we at root level or body level
+					if (parent.parentNode == root) {
+						container = parent;
+						break;
+					}
+
+					parent = parent.parentNode;
+				}
+
+				return container;
+			}
+
+			// This function walks down the tree to find the leaf at the selection.
+			// The offset is also returned as if node initially a leaf, the offset may be in the middle of the text node.
+			function findLeaf(node, offset) {
+				if (offset === undef) {
+					offset = node.nodeType === 3 ? node.length : node.childNodes.length;
+				}
+
+				while (node && node.hasChildNodes()) {
+					node = node.childNodes[offset];
+					if (node) {
+						offset = node.nodeType === 3 ? node.length : node.childNodes.length;
+					}
+				}
+				return {node: node, offset: offset};
+			}
+
+			// If index based start position then resolve it
+			if (startContainer.nodeType == 1 && startContainer.hasChildNodes()) {
+				lastIdx = startContainer.childNodes.length - 1;
+				startContainer = startContainer.childNodes[startOffset > lastIdx ? lastIdx : startOffset];
+
+				if (startContainer.nodeType == 3) {
+					startOffset = 0;
+				}
+			}
+
+			// If index based end position then resolve it
+			if (endContainer.nodeType == 1 && endContainer.hasChildNodes()) {
+				lastIdx = endContainer.childNodes.length - 1;
+				endContainer = endContainer.childNodes[endOffset > lastIdx ? lastIdx : endOffset - 1];
+
+				if (endContainer.nodeType == 3) {
+					endOffset = endContainer.nodeValue.length;
+				}
+			}
+
+			// Expands the node to the closes contentEditable false element if it exists
+			function findParentContentEditable(node) {
+				var parent = node;
+
+				while (parent) {
+					if (parent.nodeType === 1 && getContentEditable(parent)) {
+						return getContentEditable(parent) === "false" ? parent : node;
+					}
+
+					parent = parent.parentNode;
+				}
+
+				return node;
+			}
+
+			function findWordEndPoint(container, offset, start) {
+				var walker, node, pos, lastTextNode;
+
+				function findSpace(node, offset) {
+					var pos, pos2, str = node.nodeValue;
+
+					if (typeof offset == "undefined") {
+						offset = start ? str.length : 0;
+					}
+
+					if (start) {
+						pos = str.lastIndexOf(' ', offset);
+						pos2 = str.lastIndexOf('\u00a0', offset);
+						pos = pos > pos2 ? pos : pos2;
+
+						// Include the space on remove to avoid tag soup
+						if (pos !== -1 && !remove) {
+							pos++;
+						}
+					} else {
+						pos = str.indexOf(' ', offset);
+						pos2 = str.indexOf('\u00a0', offset);
+						pos = pos !== -1 && (pos2 === -1 || pos < pos2) ? pos : pos2;
+					}
+
+					return pos;
+				}
+
+				if (container.nodeType === 3) {
+					pos = findSpace(container, offset);
+
+					if (pos !== -1) {
+						return {container: container, offset: pos};
+					}
+
+					lastTextNode = container;
+				}
+
+				// Walk the nodes inside the block
+				walker = new TreeWalker(container, dom.getParent(container, isBlock) || ed.getBody());
+				while ((node = walker[start ? 'prev' : 'next']())) {
+					if (node.nodeType === 3) {
+						lastTextNode = node;
+						pos = findSpace(node);
+
+						if (pos !== -1) {
+							return {container: node, offset: pos};
+						}
+					} else if (isBlock(node)) {
+						break;
+					}
+				}
+
+				if (lastTextNode) {
+					if (start) {
+						offset = 0;
+					} else {
+						offset = lastTextNode.length;
+					}
+
+					return {container: lastTextNode, offset: offset};
+				}
+			}
+
+			function findSelectorEndPoint(container, sibling_name) {
+				var parents, i, y, curFormat;
+
+				if (container.nodeType == 3 && container.nodeValue.length === 0 && container[sibling_name]) {
+					container = container[sibling_name];
+				}
+
+				parents = getParents(container);
+				for (i = 0; i < parents.length; i++) {
+					for (y = 0; y < format.length; y++) {
+						curFormat = format[y];
+
+						// If collapsed state is set then skip formats that doesn't match that
+						if ("collapsed" in curFormat && curFormat.collapsed !== rng.collapsed) {
+							continue;
+						}
+
+						if (dom.is(parents[i], curFormat.selector)) {
+							return parents[i];
+						}
+					}
+				}
+
+				return container;
+			}
+
+			function findBlockEndPoint(container, sibling_name) {
+				var node, root = dom.getRoot();
+
+				// Expand to block of similar type
+				if (!format[0].wrapper) {
+					node = dom.getParent(container, format[0].block, root);
+				}
+
+				// Expand to first wrappable block element or any block element
+				if (!node) {
+					node = dom.getParent(container.nodeType == 3 ? container.parentNode : container, function(node) {
+						// Fixes #6183 where it would expand to editable parent element in inline mode
+						return node != root && isTextBlock(node);
+					});
+				}
+
+				// Exclude inner lists from wrapping
+				if (node && format[0].wrapper) {
+					node = getParents(node, 'ul,ol').reverse()[0] || node;
+				}
+
+				// Didn't find a block element look for first/last wrappable element
+				if (!node) {
+					node = container;
+
+					while (node[sibling_name] && !isBlock(node[sibling_name])) {
+						node = node[sibling_name];
+
+						// Break on BR but include it will be removed later on
+						// we can't remove it now since we need to check if it can be wrapped
+						if (isEq(node, 'br')) {
+							break;
+						}
+					}
+				}
+
+				return node || container;
+			}
+
+			// Expand to closest contentEditable element
+			startContainer = findParentContentEditable(startContainer);
+			endContainer = findParentContentEditable(endContainer);
+
+			// Exclude bookmark nodes if possible
+			if (isBookmarkNode(startContainer.parentNode) || isBookmarkNode(startContainer)) {
+				startContainer = isBookmarkNode(startContainer) ? startContainer : startContainer.parentNode;
+				startContainer = startContainer.nextSibling || startContainer;
+
+				if (startContainer.nodeType == 3) {
+					startOffset = 0;
+				}
+			}
+
+			if (isBookmarkNode(endContainer.parentNode) || isBookmarkNode(endContainer)) {
+				endContainer = isBookmarkNode(endContainer) ? endContainer : endContainer.parentNode;
+				endContainer = endContainer.previousSibling || endContainer;
+
+				if (endContainer.nodeType == 3) {
+					endOffset = endContainer.length;
+				}
+			}
+
+			if (format[0].inline) {
+				if (rng.collapsed) {
+					// Expand left to closest word boundary
+					endPoint = findWordEndPoint(startContainer, startOffset, true);
+					if (endPoint) {
+						startContainer = endPoint.container;
+						startOffset = endPoint.offset;
+					}
+
+					// Expand right to closest word boundary
+					endPoint = findWordEndPoint(endContainer, endOffset);
+					if (endPoint) {
+						endContainer = endPoint.container;
+						endOffset = endPoint.offset;
+					}
+				}
+
+				// Avoid applying formatting to a trailing space.
+				leaf = findLeaf(endContainer, endOffset);
+				if (leaf.node) {
+					while (leaf.node && leaf.offset === 0 && leaf.node.previousSibling) {
+						leaf = findLeaf(leaf.node.previousSibling);
+					}
+
+					if (leaf.node && leaf.offset > 0 && leaf.node.nodeType === 3 &&
+							leaf.node.nodeValue.charAt(leaf.offset - 1) === ' ') {
+
+						if (leaf.offset > 1) {
+							endContainer = leaf.node;
+							endContainer.splitText(leaf.offset - 1);
+						}
+					}
+				}
+			}
+
+			// Move start/end point up the tree if the leaves are sharp and if we are in different containers
+			// Example * becomes !: !<p><b><i>*text</i><i>text*</i></b></p>!
+			// This will reduce the number of wrapper elements that needs to be created
+			// Move start point up the tree
+			if (format[0].inline || format[0].block_expand) {
+				if (!format[0].inline || (startContainer.nodeType != 3 || startOffset === 0)) {
+					startContainer = findParentContainer(true);
+				}
+
+				if (!format[0].inline || (endContainer.nodeType != 3 || endOffset === endContainer.nodeValue.length)) {
+					endContainer = findParentContainer();
+				}
+			}
+
+			// Expand start/end container to matching selector
+			if (format[0].selector && format[0].expand !== FALSE && !format[0].inline) {
+				// Find new startContainer/endContainer if there is better one
+				startContainer = findSelectorEndPoint(startContainer, 'previousSibling');
+				endContainer = findSelectorEndPoint(endContainer, 'nextSibling');
+			}
+
+			// Expand start/end container to matching block element or text node
+			if (format[0].block || format[0].selector) {
+				// Find new startContainer/endContainer if there is better one
+				startContainer = findBlockEndPoint(startContainer, 'previousSibling');
+				endContainer = findBlockEndPoint(endContainer, 'nextSibling');
+
+				// Non block element then try to expand up the leaf
+				if (format[0].block) {
+					if (!isBlock(startContainer)) {
+						startContainer = findParentContainer(true);
+					}
+
+					if (!isBlock(endContainer)) {
+						endContainer = findParentContainer();
+					}
+				}
+			}
+
+			// Setup index for startContainer
+			if (startContainer.nodeType == 1) {
+				startOffset = nodeIndex(startContainer);
+				startContainer = startContainer.parentNode;
+			}
+
+			// Setup index for endContainer
+			if (endContainer.nodeType == 1) {
+				endOffset = nodeIndex(endContainer) + 1;
+				endContainer = endContainer.parentNode;
+			}
+
+			// Return new range like object
+			return {
+				startContainer: startContainer,
+				startOffset: startOffset,
+				endContainer: endContainer,
+				endOffset: endOffset
+			};
+		}
+
+		function isColorFormatAndAnchor(node, format) {
+			return format.links && node.tagName == 'A';
+		}
+
+		/**
+		 * Removes the specified format for the specified node. It will also remove the node if it doesn't have
+		 * any attributes if the format specifies it to do so.
+		 *
+		 * @private
+		 * @param {Object} format Format object with items to remove from node.
+		 * @param {Object} vars Name/value object with variables to apply to format.
+		 * @param {Node} node Node to remove the format styles on.
+		 * @param {Node} compare_node Optional compare node, if specified the styles will be compared to that node.
+		 * @return {Boolean} True/false if the node was removed or not.
+		 */
+		function removeFormat(format, vars, node, compare_node) {
+			var i, attrs, stylesModified;
+
+			// Check if node matches format
+			if (!matchName(node, format) && !isColorFormatAndAnchor(node, format)) {
+				return FALSE;
+			}
+
+			// Should we compare with format attribs and styles
+			if (format.remove != 'all') {
+				// Remove styles
+				each(format.styles, function(value, name) {
+					value = normalizeStyleValue(replaceVars(value, vars), name);
+
+					// Indexed array
+					if (typeof name === 'number') {
+						name = value;
+						compare_node = 0;
+					}
+
+					if (format.remove_similar || (!compare_node || isEq(getStyle(compare_node, name), value))) {
+						dom.setStyle(node, name, '');
+					}
+
+					stylesModified = 1;
+				});
+
+				// Remove style attribute if it's empty
+				if (stylesModified && dom.getAttrib(node, 'style') === '') {
+					node.removeAttribute('style');
+					node.removeAttribute('data-mce-style');
+				}
+
+				// Remove attributes
+				each(format.attributes, function(value, name) {
+					var valueOut;
+
+					value = replaceVars(value, vars);
+
+					// Indexed array
+					if (typeof name === 'number') {
+						name = value;
+						compare_node = 0;
+					}
+
+					if (!compare_node || isEq(dom.getAttrib(compare_node, name), value)) {
+						// Keep internal classes
+						if (name == 'class') {
+							value = dom.getAttrib(node, name);
+							if (value) {
+								// Build new class value where everything is removed except the internal prefixed classes
+								valueOut = '';
+								each(value.split(/\s+/), function(cls) {
+									if (/mce\-\w+/.test(cls)) {
+										valueOut += (valueOut ? ' ' : '') + cls;
+									}
+								});
+
+								// We got some internal classes left
+								if (valueOut) {
+									dom.setAttrib(node, name, valueOut);
+									return;
+								}
+							}
+						}
+
+						// IE6 has a bug where the attribute doesn't get removed correctly
+						if (name == "class") {
+							node.removeAttribute('className');
+						}
+
+						// Remove mce prefixed attributes
+						if (MCE_ATTR_RE.test(name)) {
+							node.removeAttribute('data-mce-' + name);
+						}
+
+						node.removeAttribute(name);
+					}
+				});
+
+				// Remove classes
+				each(format.classes, function(value) {
+					value = replaceVars(value, vars);
+
+					if (!compare_node || dom.hasClass(compare_node, value)) {
+						dom.removeClass(node, value);
+					}
+				});
+
+				// Check for non internal attributes
+				attrs = dom.getAttribs(node);
+				for (i = 0; i < attrs.length; i++) {
+					if (attrs[i].nodeName.indexOf('_') !== 0) {
+						return FALSE;
+					}
+				}
+			}
+
+			// Remove the inline child if it's empty for example <b> or <span>
+			if (format.remove != 'none') {
+				removeNode(node, format);
+				return TRUE;
+			}
+		}
+
+		/**
+		 * Removes the node and wrap it's children in paragraphs before doing so or
+		 * appends BR elements to the beginning/end of the block element if forcedRootBlocks is disabled.
+		 *
+		 * If the div in the node below gets removed:
+		 *  text<div>text</div>text
+		 *
+		 * Output becomes:
+		 *  text<div><br />text<br /></div>text
+		 *
+		 * So when the div is removed the result is:
+		 *  text<br />text<br />text
+		 *
+		 * @private
+		 * @param {Node} node Node to remove + apply BR/P elements to.
+		 * @param {Object} format Format rule.
+		 * @return {Node} Input node.
+		 */
+		function removeNode(node, format) {
+			var parentNode = node.parentNode, rootBlockElm;
+
+			function find(node, next, inc) {
+				node = getNonWhiteSpaceSibling(node, next, inc);
+
+				return !node || (node.nodeName == 'BR' || isBlock(node));
+			}
+
+			if (format.block) {
+				if (!forcedRootBlock) {
+					// Append BR elements if needed before we remove the block
+					if (isBlock(node) && !isBlock(parentNode)) {
+						if (!find(node, FALSE) && !find(node.firstChild, TRUE, 1)) {
+							node.insertBefore(dom.create('br'), node.firstChild);
+						}
+
+						if (!find(node, TRUE) && !find(node.lastChild, FALSE, 1)) {
+							node.appendChild(dom.create('br'));
+						}
+					}
+				} else {
+					// Wrap the block in a forcedRootBlock if we are at the root of document
+					if (parentNode == dom.getRoot()) {
+						if (!format.list_block || !isEq(node, format.list_block)) {
+							each(grep(node.childNodes), function(node) {
+								if (isValid(forcedRootBlock, node.nodeName.toLowerCase())) {
+									if (!rootBlockElm) {
+										rootBlockElm = wrap(node, forcedRootBlock);
+										dom.setAttribs(rootBlockElm, ed.settings.forced_root_block_attrs);
+									} else {
+										rootBlockElm.appendChild(node);
+									}
+								} else {
+									rootBlockElm = 0;
+								}
+							});
+						}
+					}
+				}
+			}
+
+			// Never remove nodes that isn't the specified inline element if a selector is specified too
+			if (format.selector && format.inline && !isEq(format.inline, node)) {
+				return;
+			}
+
+			dom.remove(node, 1);
+		}
+
+		/**
+		 * Returns the next/previous non whitespace node.
+		 *
+		 * @private
+		 * @param {Node} node Node to start at.
+		 * @param {boolean} next (Optional) Include next or previous node defaults to previous.
+		 * @param {boolean} inc (Optional) Include the current node in checking. Defaults to false.
+		 * @return {Node} Next or previous node or undefined if it wasn't found.
+		 */
+		function getNonWhiteSpaceSibling(node, next, inc) {
+			if (node) {
+				next = next ? 'nextSibling' : 'previousSibling';
+
+				for (node = inc ? node : node[next]; node; node = node[next]) {
+					if (node.nodeType == 1 || !isWhiteSpaceNode(node)) {
+						return node;
+					}
+				}
+			}
+		}
+
+		/**
+		 * Merges the next/previous sibling element if they match.
+		 *
+		 * @private
+		 * @param {Node} prev Previous node to compare/merge.
+		 * @param {Node} next Next node to compare/merge.
+		 * @return {Node} Next node if we didn't merge and prev node if we did.
+		 */
+		function mergeSiblings(prev, next) {
+			var sibling, tmpSibling, elementUtils = new ElementUtils(dom);
+
+			function findElementSibling(node, sibling_name) {
+				for (sibling = node; sibling; sibling = sibling[sibling_name]) {
+					if (sibling.nodeType == 3 && sibling.nodeValue.length !== 0) {
+						return node;
+					}
+
+					if (sibling.nodeType == 1 && !isBookmarkNode(sibling)) {
+						return sibling;
+					}
+				}
+
+				return node;
+			}
+
+			// Check if next/prev exists and that they are elements
+			if (prev && next) {
+				// If previous sibling is empty then jump over it
+				prev = findElementSibling(prev, 'previousSibling');
+				next = findElementSibling(next, 'nextSibling');
+
+				// Compare next and previous nodes
+				if (elementUtils.compare(prev, next)) {
+					// Append nodes between
+					for (sibling = prev.nextSibling; sibling && sibling != next;) {
+						tmpSibling = sibling;
+						sibling = sibling.nextSibling;
+						prev.appendChild(tmpSibling);
+					}
+
+					// Remove next node
+					dom.remove(next);
+
+					// Move children into prev node
+					each(grep(next.childNodes), function(node) {
+						prev.appendChild(node);
+					});
+
+					return prev;
+				}
+			}
+
+			return next;
+		}
+
+		function getContainer(rng, start) {
+			var container, offset, lastIdx;
+
+			container = rng[start ? 'startContainer' : 'endContainer'];
+			offset = rng[start ? 'startOffset' : 'endOffset'];
+
+			if (container.nodeType == 1) {
+				lastIdx = container.childNodes.length - 1;
+
+				if (!start && offset) {
+					offset--;
+				}
+
+				container = container.childNodes[offset > lastIdx ? lastIdx : offset];
+			}
+
+			// If start text node is excluded then walk to the next node
+			if (container.nodeType === 3 && start && offset >= container.nodeValue.length) {
+				container = new TreeWalker(container, ed.getBody()).next() || container;
+			}
+
+			// If end text node is excluded then walk to the previous node
+			if (container.nodeType === 3 && !start && offset === 0) {
+				container = new TreeWalker(container, ed.getBody()).prev() || container;
+			}
+
+			return container;
+		}
+
+		function performCaretAction(type, name, vars, similar) {
+			var caretContainerId = '_mce_caret', debug = ed.settings.caret_debug;
+
+			// Creates a caret container bogus element
+			function createCaretContainer(fill) {
+				var caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true, style: debug ? 'color:red' : ''});
+
+				if (fill) {
+					caretContainer.appendChild(ed.getDoc().createTextNode(INVISIBLE_CHAR));
+				}
+
+				return caretContainer;
+			}
+
+			function isCaretContainerEmpty(node, nodes) {
+				while (node) {
+					if ((node.nodeType === 3 && node.nodeValue !== INVISIBLE_CHAR) || node.childNodes.length > 1) {
+						return false;
+					}
+
+					// Collect nodes
+					if (nodes && node.nodeType === 1) {
+						nodes.push(node);
+					}
+
+					node = node.firstChild;
+				}
+
+				return true;
+			}
+
+			// Returns any parent caret container element
+			function getParentCaretContainer(node) {
+				while (node) {
+					if (node.id === caretContainerId) {
+						return node;
+					}
+
+					node = node.parentNode;
+				}
+			}
+
+			// Finds the first text node in the specified node
+			function findFirstTextNode(node) {
+				var walker;
+
+				if (node) {
+					walker = new TreeWalker(node, node);
+
+					for (node = walker.current(); node; node = walker.next()) {
+						if (node.nodeType === 3) {
+							return node;
+						}
+					}
+				}
+			}
+
+			// Removes the caret container for the specified node or all on the current document
+			function removeCaretContainer(node, move_caret) {
+				var child, rng;
+
+				if (!node) {
+					node = getParentCaretContainer(selection.getStart());
+
+					if (!node) {
+						while ((node = dom.get(caretContainerId))) {
+							removeCaretContainer(node, false);
+						}
+					}
+				} else {
+					rng = selection.getRng(true);
+
+					if (isCaretContainerEmpty(node)) {
+						if (move_caret !== false) {
+							rng.setStartBefore(node);
+							rng.setEndBefore(node);
+						}
+
+						dom.remove(node);
+					} else {
+						child = findFirstTextNode(node);
+
+						if (child.nodeValue.charAt(0) === INVISIBLE_CHAR) {
+							child.deleteData(0, 1);
+
+							// Fix for bug #6976
+							if (rng.startContainer == child && rng.startOffset > 0) {
+								rng.setStart(child, rng.startOffset - 1);
+							}
+
+							if (rng.endContainer == child && rng.endOffset > 0) {
+								rng.setEnd(child, rng.endOffset - 1);
+							}
+						}
+
+						dom.remove(node, 1);
+					}
+
+					selection.setRng(rng);
+				}
+			}
+
+			// Applies formatting to the caret postion
+			function applyCaretFormat() {
+				var rng, caretContainer, textNode, offset, bookmark, container, text;
+
+				rng = selection.getRng(true);
+				offset = rng.startOffset;
+				container = rng.startContainer;
+				text = container.nodeValue;
+
+				caretContainer = getParentCaretContainer(selection.getStart());
+				if (caretContainer) {
+					textNode = findFirstTextNode(caretContainer);
+				}
+
+				// Expand to word is caret is in the middle of a text node and the char before/after is a alpha numeric character
+				if (text && offset > 0 && offset < text.length && /\w/.test(text.charAt(offset)) && /\w/.test(text.charAt(offset - 1))) {
+					// Get bookmark of caret position
+					bookmark = selection.getBookmark();
+
+					// Collapse bookmark range (WebKit)
+					rng.collapse(true);
+
+					// Expand the range to the closest word and split it at those points
+					rng = expandRng(rng, get(name));
+					rng = rangeUtils.split(rng);
+
+					// Apply the format to the range
+					apply(name, vars, rng);
+
+					// Move selection back to caret position
+					selection.moveToBookmark(bookmark);
+				} else {
+					if (!caretContainer || textNode.nodeValue !== INVISIBLE_CHAR) {
+						caretContainer = createCaretContainer(true);
+						textNode = caretContainer.firstChild;
+
+						rng.insertNode(caretContainer);
+						offset = 1;
+
+						apply(name, vars, caretContainer);
+					} else {
+						apply(name, vars, caretContainer);
+					}
+
+					// Move selection to text node
+					selection.setCursorLocation(textNode, offset);
+				}
+			}
+
+			function removeCaretFormat() {
+				var rng = selection.getRng(true), container, offset, bookmark,
+					hasContentAfter, node, formatNode, parents = [], i, caretContainer;
+
+				container = rng.startContainer;
+				offset = rng.startOffset;
+				node = container;
+
+				if (container.nodeType == 3) {
+					if (offset != container.nodeValue.length) {
+						hasContentAfter = true;
+					}
+
+					node = node.parentNode;
+				}
+
+				while (node) {
+					if (matchNode(node, name, vars, similar)) {
+						formatNode = node;
+						break;
+					}
+
+					if (node.nextSibling) {
+						hasContentAfter = true;
+					}
+
+					parents.push(node);
+					node = node.parentNode;
+				}
+
+				// Node doesn't have the specified format
+				if (!formatNode) {
+					return;
+				}
+
+				// Is there contents after the caret then remove the format on the element
+				if (hasContentAfter) {
+					// Get bookmark of caret position
+					bookmark = selection.getBookmark();
+
+					// Collapse bookmark range (WebKit)
+					rng.collapse(true);
+
+					// Expand the range to the closest word and split it at those points
+					rng = expandRng(rng, get(name), true);
+					rng = rangeUtils.split(rng);
+
+					// Remove the format from the range
+					remove(name, vars, rng);
+
+					// Move selection back to caret position
+					selection.moveToBookmark(bookmark);
+				} else {
+					caretContainer = createCaretContainer();
+
+					node = caretContainer;
+					for (i = parents.length - 1; i >= 0; i--) {
+						node.appendChild(dom.clone(parents[i], false));
+						node = node.firstChild;
+					}
+
+					// Insert invisible character into inner most format element
+					node.appendChild(dom.doc.createTextNode(INVISIBLE_CHAR));
+					node = node.firstChild;
+
+					var block = dom.getParent(formatNode, isTextBlock);
+
+					if (block && dom.isEmpty(block)) {
+						// Replace formatNode with caretContainer when removing format from empty block like <p><b>|</b></p>
+						formatNode.parentNode.replaceChild(caretContainer, formatNode);
+					} else {
+						// Insert caret container after the formated node
+						dom.insertAfter(caretContainer, formatNode);
+					}
+
+					// Move selection to text node
+					selection.setCursorLocation(node, 1);
+
+					// If the formatNode is empty, we can remove it safely.
+					if (dom.isEmpty(formatNode)) {
+						dom.remove(formatNode);
+					}
+				}
+			}
+
+			// Checks if the parent caret container node isn't empty if that is the case it
+			// will remove the bogus state on all children that isn't empty
+			function unmarkBogusCaretParents() {
+				var caretContainer;
+
+				caretContainer = getParentCaretContainer(selection.getStart());
+				if (caretContainer && !dom.isEmpty(caretContainer)) {
+					walk(caretContainer, function(node) {
+						if (node.nodeType == 1 && node.id !== caretContainerId && !dom.isEmpty(node)) {
+							dom.setAttrib(node, 'data-mce-bogus', null);
+						}
+					}, 'childNodes');
+				}
+			}
+
+			// Only bind the caret events once
+			if (!ed._hasCaretEvents) {
+				// Mark current caret container elements as bogus when getting the contents so we don't end up with empty elements
+				markCaretContainersBogus = function() {
+					var nodes = [], i;
+
+					if (isCaretContainerEmpty(getParentCaretContainer(selection.getStart()), nodes)) {
+						// Mark children
+						i = nodes.length;
+						while (i--) {
+							dom.setAttrib(nodes[i], 'data-mce-bogus', '1');
+						}
+					}
+				};
+
+				disableCaretContainer = function(e) {
+					var keyCode = e.keyCode;
+
+					removeCaretContainer();
+
+					// Remove caret container on keydown and it's a backspace, enter or left/right arrow keys
+					// Backspace key needs to check if the range is collapsed due to bug #6780
+					if ((keyCode == 8 && selection.isCollapsed()) || keyCode == 37 || keyCode == 39) {
+						removeCaretContainer(getParentCaretContainer(selection.getStart()));
+					}
+
+					unmarkBogusCaretParents();
+				};
+
+				// Remove bogus state if they got filled by contents using editor.selection.setContent
+				ed.on('SetContent', function(e) {
+					if (e.selection) {
+						unmarkBogusCaretParents();
+					}
+				});
+				ed._hasCaretEvents = true;
+			}
+
+			// Do apply or remove caret format
+			if (type == "apply") {
+				applyCaretFormat();
+			} else {
+				removeCaretFormat();
+			}
+		}
+
+		/**
+		 * Moves the start to the first suitable text node.
+		 */
+		function moveStart(rng) {
+			var container = rng.startContainer,
+					offset = rng.startOffset, isAtEndOfText,
+					walker, node, nodes, tmpNode;
+
+			// Convert text node into index if possible
+			if (container.nodeType == 3 && offset >= container.nodeValue.length) {
+				// Get the parent container location and walk from there
+				offset = nodeIndex(container);
+				container = container.parentNode;
+				isAtEndOfText = true;
+			}
+
+			// Move startContainer/startOffset in to a suitable node
+			if (container.nodeType == 1) {
+				nodes = container.childNodes;
+				container = nodes[Math.min(offset, nodes.length - 1)];
+				walker = new TreeWalker(container, dom.getParent(container, dom.isBlock));
+
+				// If offset is at end of the parent node walk to the next one
+				if (offset > nodes.length - 1 || isAtEndOfText) {
+					walker.next();
+				}
+
+				for (node = walker.current(); node; node = walker.next()) {
+					if (node.nodeType == 3 && !isWhiteSpaceNode(node)) {
+						// IE has a "neat" feature where it moves the start node into the closest element
+						// we can avoid this by inserting an element before it and then remove it after we set the selection
+						tmpNode = dom.create('a', {'data-mce-bogus': 'all'}, INVISIBLE_CHAR);
+						node.parentNode.insertBefore(tmpNode, node);
+
+						// Set selection and remove tmpNode
+						rng.setStart(node, 0);
+						selection.setRng(rng);
+						dom.remove(tmpNode);
+
+						return;
+					}
+				}
+			}
+		}
+	};
+});
+
+// Included from: js/tinymce/classes/UndoManager.js
+
+/**
+ * UndoManager.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles the undo/redo history levels for the editor. Since the build in undo/redo has major drawbacks a custom one was needed.
+ *
+ * @class tinymce.UndoManager
+ */
+define("tinymce/UndoManager", [
+	"tinymce/util/VK",
+	"tinymce/Env",
+	"tinymce/util/Tools",
+	"tinymce/html/SaxParser"
+], function(VK, Env, Tools, SaxParser) {
+	var trim = Tools.trim, trimContentRegExp;
+
+	trimContentRegExp = new RegExp([
+		'<span[^>]+data-mce-bogus[^>]+>[\u200B\uFEFF]+<\\/span>', // Trim bogus spans like caret containers
+		'\\s?data-mce-selected="[^"]+"' // Trim temporaty data-mce prefixed attributes like data-mce-selected
+	].join('|'), 'gi');
+
+	return function(editor) {
+		var self = this, index = 0, data = [], beforeBookmark, isFirstTypedCharacter, locks = 0;
+
+		/**
+		 * Returns a trimmed version of the editor contents to be used for the undo level. This
+		 * will remove any data-mce-bogus="all" marked elements since these are used for UI it will also
+		 * remove the data-mce-selected attributes used for selection of objects and caret containers.
+		 * It will keep all data-mce-bogus="1" elements since these can be used to place the caret etc and will
+		 * be removed by the serialization logic when you save.
+		 *
+		 * @private
+		 * @return {String} HTML contents of the editor excluding some internal bogus elements.
+		 */
+		function getContent() {
+			var content = editor.getContent({format: 'raw', no_events: 1});
+			var bogusAllRegExp = /<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g;
+			var endTagIndex, index, matchLength, matches, shortEndedElements, schema = editor.schema;
+
+			content = content.replace(trimContentRegExp, '');
+			shortEndedElements = schema.getShortEndedElements();
+
+			// Remove all bogus elements marked with "all"
+			while ((matches = bogusAllRegExp.exec(content))) {
+				index = bogusAllRegExp.lastIndex;
+				matchLength = matches[0].length;
+
+				if (shortEndedElements[matches[1]]) {
+					endTagIndex = index;
+				} else {
+					endTagIndex = SaxParser.findEndTag(schema, content, index);
+				}
+
+				content = content.substring(0, index - matchLength) + content.substring(endTagIndex);
+				bogusAllRegExp.lastIndex = index - matchLength;
+			}
+
+			return trim(content);
+		}
+
+		function setDirty(state) {
+			editor.isNotDirty = !state;
+		}
+
+		function addNonTypingUndoLevel(e) {
+			self.typing = false;
+			self.add({}, e);
+		}
+
+		// Add initial undo level when the editor is initialized
+		editor.on('init', function() {
+			self.add();
+		});
+
+		// Get position before an execCommand is processed
+		editor.on('BeforeExecCommand', function(e) {
+			var cmd = e.command;
+
+			if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint') {
+				self.beforeChange();
+			}
+		});
+
+		// Add undo level after an execCommand call was made
+		editor.on('ExecCommand', function(e) {
+			var cmd = e.command;
+
+			if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint') {
+				addNonTypingUndoLevel(e);
+			}
+		});
+
+		editor.on('ObjectResizeStart', function() {
+			self.beforeChange();
+		});
+
+		editor.on('SaveContent ObjectResized blur', addNonTypingUndoLevel);
+		editor.on('DragEnd', addNonTypingUndoLevel);
+
+		editor.on('KeyUp', function(e) {
+			var keyCode = e.keyCode;
+
+			if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 45 || keyCode == 13 || e.ctrlKey) {
+				addNonTypingUndoLevel();
+				editor.nodeChanged();
+			}
+
+			if (keyCode == 46 || keyCode == 8 || (Env.mac && (keyCode == 91 || keyCode == 93))) {
+				editor.nodeChanged();
+			}
+
+			// Fire a TypingUndo event on the first character entered
+			if (isFirstTypedCharacter && self.typing) {
+				// Make it dirty if the content was changed after typing the first character
+				if (!editor.isDirty()) {
+					setDirty(data[0] && getContent() != data[0].content);
+
+					// Fire initial change event
+					if (!editor.isNotDirty) {
+						editor.fire('change', {level: data[0], lastLevel: null});
+					}
+				}
+
+				editor.fire('TypingUndo');
+				isFirstTypedCharacter = false;
+				editor.nodeChanged();
+			}
+		});
+
+		editor.on('KeyDown', function(e) {
+			var keyCode = e.keyCode;
+
+			// Is caracter positon keys left,right,up,down,home,end,pgdown,pgup,enter
+			if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 45) {
+				if (self.typing) {
+					addNonTypingUndoLevel(e);
+				}
+
+				return;
+			}
+
+			// If key isn't Ctrl+Alt/AltGr
+			var modKey = (e.ctrlKey && !e.altKey) || e.metaKey;
+			if ((keyCode < 16 || keyCode > 20) && keyCode != 224 && keyCode != 91 && !self.typing && !modKey) {
+				self.beforeChange();
+				self.typing = true;
+				self.add({}, e);
+				isFirstTypedCharacter = true;
+			}
+		});
+
+		editor.on('MouseDown', function(e) {
+			if (self.typing) {
+				addNonTypingUndoLevel(e);
+			}
+		});
+
+		// Add keyboard shortcuts for undo/redo keys
+		editor.addShortcut('meta+z', '', 'Undo');
+		editor.addShortcut('meta+y,meta+shift+z', '', 'Redo');
+
+		editor.on('AddUndo Undo Redo ClearUndos', function(e) {
+			if (!e.isDefaultPrevented()) {
+				editor.nodeChanged();
+			}
+		});
+
+		/*eslint consistent-this:0 */
+		self = {
+			// Explose for debugging reasons
+			data: data,
+
+			/**
+			 * State if the user is currently typing or not. This will add a typing operation into one undo
+			 * level instead of one new level for each keystroke.
+			 *
+			 * @field {Boolean} typing
+			 */
+			typing: false,
+
+			/**
+			 * Stores away a bookmark to be used when performing an undo action so that the selection is before
+			 * the change has been made.
+			 *
+			 * @method beforeChange
+			 */
+			beforeChange: function() {
+				if (!locks) {
+					beforeBookmark = editor.selection.getBookmark(2, true);
+				}
+			},
+
+			/**
+			 * Adds a new undo level/snapshot to the undo list.
+			 *
+			 * @method add
+			 * @param {Object} level Optional undo level object to add.
+			 * @param {DOMEvent} Event Optional event responsible for the creation of the undo level.
+			 * @return {Object} Undo level that got added or null it a level wasn't needed.
+			 */
+			add: function(level, event) {
+				var i, settings = editor.settings, lastLevel;
+
+				level = level || {};
+				level.content = getContent();
+
+				if (locks || editor.removed) {
+					return null;
+				}
+
+				lastLevel = data[index];
+				if (editor.fire('BeforeAddUndo', {level: level, lastLevel: lastLevel, originalEvent: event}).isDefaultPrevented()) {
+					return null;
+				}
+
+				// Add undo level if needed
+				if (lastLevel && lastLevel.content == level.content) {
+					return null;
+				}
+
+				// Set before bookmark on previous level
+				if (data[index]) {
+					data[index].beforeBookmark = beforeBookmark;
+				}
+
+				// Time to compress
+				if (settings.custom_undo_redo_levels) {
+					if (data.length > settings.custom_undo_redo_levels) {
+						for (i = 0; i < data.length - 1; i++) {
+							data[i] = data[i + 1];
+						}
+
+						data.length--;
+						index = data.length;
+					}
+				}
+
+				// Get a non intrusive normalized bookmark
+				level.bookmark = editor.selection.getBookmark(2, true);
+
+				// Crop array if needed
+				if (index < data.length - 1) {
+					data.length = index + 1;
+				}
+
+				data.push(level);
+				index = data.length - 1;
+
+				var args = {level: level, lastLevel: lastLevel, originalEvent: event};
+
+				editor.fire('AddUndo', args);
+
+				if (index > 0) {
+					setDirty(true);
+					editor.fire('change', args);
+				}
+
+				return level;
+			},
+
+			/**
+			 * Undoes the last action.
+			 *
+			 * @method undo
+			 * @return {Object} Undo level or null if no undo was performed.
+			 */
+			undo: function() {
+				var level;
+
+				if (self.typing) {
+					self.add();
+					self.typing = false;
+				}
+
+				if (index > 0) {
+					level = data[--index];
+
+					// Undo to first index then set dirty state to false
+					if (index === 0) {
+						setDirty(false);
+					}
+
+					editor.setContent(level.content, {format: 'raw'});
+					editor.selection.moveToBookmark(level.beforeBookmark);
+
+					editor.fire('undo', {level: level});
+				}
+
+				return level;
+			},
+
+			/**
+			 * Redoes the last action.
+			 *
+			 * @method redo
+			 * @return {Object} Redo level or null if no redo was performed.
+			 */
+			redo: function() {
+				var level;
+
+				if (index < data.length - 1) {
+					level = data[++index];
+
+					editor.setContent(level.content, {format: 'raw'});
+					editor.selection.moveToBookmark(level.bookmark);
+					setDirty(true);
+
+					editor.fire('redo', {level: level});
+				}
+
+				return level;
+			},
+
+			/**
+			 * Removes all undo levels.
+			 *
+			 * @method clear
+			 */
+			clear: function() {
+				data = [];
+				index = 0;
+				self.typing = false;
+				editor.fire('ClearUndos');
+			},
+
+			/**
+			 * Returns true/false if the undo manager has any undo levels.
+			 *
+			 * @method hasUndo
+			 * @return {Boolean} true/false if the undo manager has any undo levels.
+			 */
+			hasUndo: function() {
+				// Has undo levels or typing and content isn't the same as the initial level
+				return index > 0 || (self.typing && data[0] && getContent() != data[0].content);
+			},
+
+			/**
+			 * Returns true/false if the undo manager has any redo levels.
+			 *
+			 * @method hasRedo
+			 * @return {Boolean} true/false if the undo manager has any redo levels.
+			 */
+			hasRedo: function() {
+				return index < data.length - 1 && !this.typing;
+			},
+
+			/**
+			 * Executes the specified function in an undo transation. The selection
+			 * before the modification will be stored to the undo stack and if the DOM changes
+			 * it will add a new undo level. Any methods within the transation that adds undo levels will
+			 * be ignored. So a transation can include calls to execCommand or editor.insertContent.
+			 *
+			 * @method transact
+			 * @param {function} callback Function to execute dom manipulation logic in.
+			 */
+			transact: function(callback) {
+				self.beforeChange();
+
+				try {
+					locks++;
+					callback();
+				} finally {
+					locks--;
+				}
+
+				self.add();
+			}
+		};
+
+		return self;
+	};
+});
+
+// Included from: js/tinymce/classes/EnterKey.js
+
+/**
+ * EnterKey.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Contains logic for handling the enter key to split/generate block elements.
+ */
+define("tinymce/EnterKey", [
+	"tinymce/dom/TreeWalker",
+	"tinymce/dom/RangeUtils",
+	"tinymce/Env"
+], function(TreeWalker, RangeUtils, Env) {
+	var isIE = Env.ie && Env.ie < 11;
+
+	return function(editor) {
+		var dom = editor.dom, selection = editor.selection, settings = editor.settings;
+		var undoManager = editor.undoManager, schema = editor.schema, nonEmptyElementsMap = schema.getNonEmptyElements(),
+			moveCaretBeforeOnEnterElementsMap = schema.getMoveCaretBeforeOnEnterElements();
+
+		function handleEnterKey(evt) {
+			var rng, tmpRng, editableRoot, container, offset, parentBlock, documentMode, shiftKey,
+				newBlock, fragment, containerBlock, parentBlockName, containerBlockName, newBlockName, isAfterLastNodeInContainer;
+
+			// Returns true if the block can be split into two blocks or not
+			function canSplitBlock(node) {
+				return node &&
+					dom.isBlock(node) &&
+					!/^(TD|TH|CAPTION|FORM)$/.test(node.nodeName) &&
+					!/^(fixed|absolute)/i.test(node.style.position) &&
+					dom.getContentEditable(node) !== "true";
+			}
+
+			// Renders empty block on IE
+			function renderBlockOnIE(block) {
+				var oldRng;
+
+				if (dom.isBlock(block)) {
+					oldRng = selection.getRng();
+					block.appendChild(dom.create('span', null, '\u00a0'));
+					selection.select(block);
+					block.lastChild.outerHTML = '';
+					selection.setRng(oldRng);
+				}
+			}
+
+			// Remove the first empty inline element of the block so this: <p><b><em></em></b>x</p> becomes this: <p>x</p>
+			function trimInlineElementsOnLeftSideOfBlock(block) {
+				var node = block, firstChilds = [], i;
+
+				if (!node) {
+					return;
+				}
+
+				// Find inner most first child ex: <p><i><b>*</b></i></p>
+				while ((node = node.firstChild)) {
+					if (dom.isBlock(node)) {
+						return;
+					}
+
+					if (node.nodeType == 1 && !nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
+						firstChilds.push(node);
+					}
+				}
+
+				i = firstChilds.length;
+				while (i--) {
+					node = firstChilds[i];
+					if (!node.hasChildNodes() || (node.firstChild == node.lastChild && node.firstChild.nodeValue === '')) {
+						dom.remove(node);
+					} else {
+						// Remove <a> </a> see #5381
+						if (node.nodeName == "A" && (node.innerText || node.textContent) === ' ') {
+							dom.remove(node);
+						}
+					}
+				}
+			}
+
+			// Moves the caret to a suitable position within the root for example in the first non
+			// pure whitespace text node or before an image
+			function moveToCaretPosition(root) {
+				var walker, node, rng, lastNode = root, tempElm;
+				function firstNonWhiteSpaceNodeSibling(node) {
+					while (node) {
+						if (node.nodeType == 1 || (node.nodeType == 3 && node.data && /[\r\n\s]/.test(node.data))) {
+							return node;
+						}
+
+						node = node.nextSibling;
+					}
+				}
+
+				if (!root) {
+					return;
+				}
+
+				// Old IE versions doesn't properly render blocks with br elements in them
+				// For example <p><br></p> wont be rendered correctly in a contentEditable area
+				// until you remove the br producing <p></p>
+				if (Env.ie && Env.ie < 9 && parentBlock && parentBlock.firstChild) {
+					if (parentBlock.firstChild == parentBlock.lastChild && parentBlock.firstChild.tagName == 'BR') {
+						dom.remove(parentBlock.firstChild);
+					}
+				}
+
+				if (/^(LI|DT|DD)$/.test(root.nodeName)) {
+					var firstChild = firstNonWhiteSpaceNodeSibling(root.firstChild);
+
+					if (firstChild && /^(UL|OL|DL)$/.test(firstChild.nodeName)) {
+						root.insertBefore(dom.doc.createTextNode('\u00a0'), root.firstChild);
+					}
+				}
+
+				rng = dom.createRng();
+
+				// Normalize whitespace to remove empty text nodes. Fix for: #6904
+				// Gecko will be able to place the caret in empty text nodes but it won't render propery
+				// Older IE versions will sometimes crash so for now ignore all IE versions
+				if (!Env.ie) {
+					root.normalize();
+				}
+
+				if (root.hasChildNodes()) {
+					walker = new TreeWalker(root, root);
+
+					while ((node = walker.current())) {
+						if (node.nodeType == 3) {
+							rng.setStart(node, 0);
+							rng.setEnd(node, 0);
+							break;
+						}
+
+						if (moveCaretBeforeOnEnterElementsMap[node.nodeName.toLowerCase()]) {
+							rng.setStartBefore(node);
+							rng.setEndBefore(node);
+							break;
+						}
+
+						lastNode = node;
+						node = walker.next();
+					}
+
+					if (!node) {
+						rng.setStart(lastNode, 0);
+						rng.setEnd(lastNode, 0);
+					}
+				} else {
+					if (root.nodeName == 'BR') {
+						if (root.nextSibling && dom.isBlock(root.nextSibling)) {
+							// Trick on older IE versions to render the caret before the BR between two lists
+							if (!documentMode || documentMode < 9) {
+								tempElm = dom.create('br');
+								root.parentNode.insertBefore(tempElm, root);
+							}
+
+							rng.setStartBefore(root);
+							rng.setEndBefore(root);
+						} else {
+							rng.setStartAfter(root);
+							rng.setEndAfter(root);
+						}
+					} else {
+						rng.setStart(root, 0);
+						rng.setEnd(root, 0);
+					}
+				}
+
+				selection.setRng(rng);
+
+				// Remove tempElm created for old IE:s
+				dom.remove(tempElm);
+				selection.scrollIntoView(root);
+			}
+
+			function setForcedBlockAttrs(node) {
+				var forcedRootBlockName = settings.forced_root_block;
+
+				if (forcedRootBlockName && forcedRootBlockName.toLowerCase() === node.tagName.toLowerCase()) {
+					dom.setAttribs(node, settings.forced_root_block_attrs);
+				}
+			}
+
+			// Creates a new block element by cloning the current one or creating a new one if the name is specified
+			// This function will also copy any text formatting from the parent block and add it to the new one
+			function createNewBlock(name) {
+				var node = container, block, clonedNode, caretNode, textInlineElements = schema.getTextInlineElements();
+
+				if (name || parentBlockName == "TABLE") {
+					block = dom.create(name || newBlockName);
+					setForcedBlockAttrs(block);
+				} else {
+					block = parentBlock.cloneNode(false);
+				}
+
+				caretNode = block;
+
+				// Clone any parent styles
+				if (settings.keep_styles !== false) {
+					do {
+						if (textInlineElements[node.nodeName]) {
+							// Never clone a caret containers
+							if (node.id == '_mce_caret') {
+								continue;
+							}
+
+							clonedNode = node.cloneNode(false);
+							dom.setAttrib(clonedNode, 'id', ''); // Remove ID since it needs to be document unique
+
+							if (block.hasChildNodes()) {
+								clonedNode.appendChild(block.firstChild);
+								block.appendChild(clonedNode);
+							} else {
+								caretNode = clonedNode;
+								block.appendChild(clonedNode);
+							}
+						}
+					} while ((node = node.parentNode));
+				}
+
+				// BR is needed in empty blocks on non IE browsers
+				if (!isIE) {
+					caretNode.innerHTML = '<br data-mce-bogus="1">';
+				}
+
+				return block;
+			}
+
+			// Returns true/false if the caret is at the start/end of the parent block element
+			function isCaretAtStartOrEndOfBlock(start) {
+				var walker, node, name;
+
+				// Caret is in the middle of a text node like "a|b"
+				if (container.nodeType == 3 && (start ? offset > 0 : offset < container.nodeValue.length)) {
+					return false;
+				}
+
+				// If after the last element in block node edge case for #5091
+				if (container.parentNode == parentBlock && isAfterLastNodeInContainer && !start) {
+					return true;
+				}
+
+				// If the caret if before the first element in parentBlock
+				if (start && container.nodeType == 1 && container == parentBlock.firstChild) {
+					return true;
+				}
+
+				// Caret can be before/after a table
+				if (container.nodeName === "TABLE" || (container.previousSibling && container.previousSibling.nodeName == "TABLE")) {
+					return (isAfterLastNodeInContainer && !start) || (!isAfterLastNodeInContainer && start);
+				}
+
+				// Walk the DOM and look for text nodes or non empty elements
+				walker = new TreeWalker(container, parentBlock);
+
+				// If caret is in beginning or end of a text block then jump to the next/previous node
+				if (container.nodeType == 3) {
+					if (start && offset === 0) {
+						walker.prev();
+					} else if (!start && offset == container.nodeValue.length) {
+						walker.next();
+					}
+				}
+
+				while ((node = walker.current())) {
+					if (node.nodeType === 1) {
+						// Ignore bogus elements
+						if (!node.getAttribute('data-mce-bogus')) {
+							// Keep empty elements like <img /> <input /> but not trailing br:s like <p>text|<br></p>
+							name = node.nodeName.toLowerCase();
+							if (nonEmptyElementsMap[name] && name !== 'br') {
+								return false;
+							}
+						}
+					} else if (node.nodeType === 3 && !/^[ \t\r\n]*$/.test(node.nodeValue)) {
+						return false;
+					}
+
+					if (start) {
+						walker.prev();
+					} else {
+						walker.next();
+					}
+				}
+
+				return true;
+			}
+
+			// Wraps any text nodes or inline elements in the specified forced root block name
+			function wrapSelfAndSiblingsInDefaultBlock(container, offset) {
+				var newBlock, parentBlock, startNode, node, next, rootBlockName, blockName = newBlockName || 'P';
+
+				// Not in a block element or in a table cell or caption
+				parentBlock = dom.getParent(container, dom.isBlock);
+				rootBlockName = editor.getBody().nodeName.toLowerCase();
+				if (!parentBlock || !canSplitBlock(parentBlock)) {
+					parentBlock = parentBlock || editableRoot;
+
+					if (!parentBlock.hasChildNodes()) {
+						newBlock = dom.create(blockName);
+						setForcedBlockAttrs(newBlock);
+						parentBlock.appendChild(newBlock);
+						rng.setStart(newBlock, 0);
+						rng.setEnd(newBlock, 0);
+						return newBlock;
+					}
+
+					// Find parent that is the first child of parentBlock
+					node = container;
+					while (node.parentNode != parentBlock) {
+						node = node.parentNode;
+					}
+
+					// Loop left to find start node start wrapping at
+					while (node && !dom.isBlock(node)) {
+						startNode = node;
+						node = node.previousSibling;
+					}
+
+					if (startNode && schema.isValidChild(rootBlockName, blockName.toLowerCase())) {
+						newBlock = dom.create(blockName);
+						setForcedBlockAttrs(newBlock);
+						startNode.parentNode.insertBefore(newBlock, startNode);
+
+						// Start wrapping until we hit a block
+						node = startNode;
+						while (node && !dom.isBlock(node)) {
+							next = node.nextSibling;
+							newBlock.appendChild(node);
+							node = next;
+						}
+
+						// Restore range to it's past location
+						rng.setStart(container, offset);
+						rng.setEnd(container, offset);
+					}
+				}
+
+				return container;
+			}
+
+			// Inserts a block or br before/after or in the middle of a split list of the LI is empty
+			function handleEmptyListItem() {
+				function isFirstOrLastLi(first) {
+					var node = containerBlock[first ? 'firstChild' : 'lastChild'];
+
+					// Find first/last element since there might be whitespace there
+					while (node) {
+						if (node.nodeType == 1) {
+							break;
+						}
+
+						node = node[first ? 'nextSibling' : 'previousSibling'];
+					}
+
+					return node === parentBlock;
+				}
+
+				function getContainerBlock() {
+					var containerBlockParent = containerBlock.parentNode;
+
+					if (/^(LI|DT|DD)$/.test(containerBlockParent.nodeName)) {
+						return containerBlockParent;
+					}
+
+					return containerBlock;
+				}
+
+				// Check if we are in an nested list
+				var containerBlockParentName = containerBlock.parentNode.nodeName;
+				if (/^(OL|UL|LI)$/.test(containerBlockParentName)) {
+					newBlockName = 'LI';
+				}
+
+				newBlock = newBlockName ? createNewBlock(newBlockName) : dom.create('BR');
+
+				if (isFirstOrLastLi(true) && isFirstOrLastLi()) {
+					if (containerBlockParentName == 'LI') {
+						// Nested list is inside a LI
+						dom.insertAfter(newBlock, getContainerBlock());
+					} else {
+						// Is first and last list item then replace the OL/UL with a text block
+						dom.replace(newBlock, containerBlock);
+					}
+				} else if (isFirstOrLastLi(true)) {
+					if (containerBlockParentName == 'LI') {
+						// List nested in an LI then move the list to a new sibling LI
+						dom.insertAfter(newBlock, getContainerBlock());
+						newBlock.appendChild(dom.doc.createTextNode(' ')); // Needed for IE so the caret can be placed
+						newBlock.appendChild(containerBlock);
+					} else {
+						// First LI in list then remove LI and add text block before list
+						containerBlock.parentNode.insertBefore(newBlock, containerBlock);
+					}
+				} else if (isFirstOrLastLi()) {
+					// Last LI in list then remove LI and add text block after list
+					dom.insertAfter(newBlock, getContainerBlock());
+					renderBlockOnIE(newBlock);
+				} else {
+					// Middle LI in list the split the list and insert a text block in the middle
+					// Extract after fragment and insert it after the current block
+					containerBlock = getContainerBlock();
+					tmpRng = rng.cloneRange();
+					tmpRng.setStartAfter(parentBlock);
+					tmpRng.setEndAfter(containerBlock);
+					fragment = tmpRng.extractContents();
+
+					if (newBlockName == 'LI' && fragment.firstChild.nodeName == 'LI') {
+						newBlock = fragment.firstChild;
+						dom.insertAfter(fragment, containerBlock);
+					} else {
+						dom.insertAfter(fragment, containerBlock);
+						dom.insertAfter(newBlock, containerBlock);
+					}
+				}
+
+				dom.remove(parentBlock);
+				moveToCaretPosition(newBlock);
+				undoManager.add();
+			}
+
+			// Inserts a BR element if the forced_root_block option is set to false or empty string
+			function insertBr() {
+				editor.execCommand("InsertLineBreak", false, evt);
+			}
+
+			// Trims any linebreaks at the beginning of node user for example when pressing enter in a PRE element
+			function trimLeadingLineBreaks(node) {
+				do {
+					if (node.nodeType === 3) {
+						node.nodeValue = node.nodeValue.replace(/^[\r\n]+/, '');
+					}
+
+					node = node.firstChild;
+				} while (node);
+			}
+
+			function getEditableRoot(node) {
+				var root = dom.getRoot(), parent, editableRoot;
+
+				// Get all parents until we hit a non editable parent or the root
+				parent = node;
+				while (parent !== root && dom.getContentEditable(parent) !== "false") {
+					if (dom.getContentEditable(parent) === "true") {
+						editableRoot = parent;
+					}
+
+					parent = parent.parentNode;
+				}
+
+				return parent !== root ? editableRoot : root;
+			}
+
+			// Adds a BR at the end of blocks that only contains an IMG or INPUT since
+			// these might be floated and then they won't expand the block
+			function addBrToBlockIfNeeded(block) {
+				var lastChild;
+
+				// IE will render the blocks correctly other browsers needs a BR
+				if (!isIE) {
+					block.normalize(); // Remove empty text nodes that got left behind by the extract
+
+					// Check if the block is empty or contains a floated last child
+					lastChild = block.lastChild;
+					if (!lastChild || (/^(left|right)$/gi.test(dom.getStyle(lastChild, 'float', true)))) {
+						dom.add(block, 'br');
+					}
+				}
+			}
+
+			rng = selection.getRng(true);
+
+			// Event is blocked by some other handler for example the lists plugin
+			if (evt.isDefaultPrevented()) {
+				return;
+			}
+
+			// Delete any selected contents
+			if (!rng.collapsed) {
+				editor.execCommand('Delete');
+				return;
+			}
+
+			// Setup range items and newBlockName
+			new RangeUtils(dom).normalize(rng);
+			container = rng.startContainer;
+			offset = rng.startOffset;
+			newBlockName = (settings.force_p_newlines ? 'p' : '') || settings.forced_root_block;
+			newBlockName = newBlockName ? newBlockName.toUpperCase() : '';
+			documentMode = dom.doc.documentMode;
+			shiftKey = evt.shiftKey;
+
+			// Resolve node index
+			if (container.nodeType == 1 && container.hasChildNodes()) {
+				isAfterLastNodeInContainer = offset > container.childNodes.length - 1;
+
+				container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container;
+				if (isAfterLastNodeInContainer && container.nodeType == 3) {
+					offset = container.nodeValue.length;
+				} else {
+					offset = 0;
+				}
+			}
+
+			// Get editable root node normaly the body element but sometimes a div or span
+			editableRoot = getEditableRoot(container);
+
+			// If there is no editable root then enter is done inside a contentEditable false element
+			if (!editableRoot) {
+				return;
+			}
+
+			undoManager.beforeChange();
+
+			// If editable root isn't block nor the root of the editor
+			if (!dom.isBlock(editableRoot) && editableRoot != dom.getRoot()) {
+				if (!newBlockName || shiftKey) {
+					insertBr();
+				}
+
+				return;
+			}
+
+			// Wrap the current node and it's sibling in a default block if it's needed.
+			// for example this <td>text|<b>text2</b></td> will become this <td><p>text|<b>text2</p></b></td>
+			// This won't happen if root blocks are disabled or the shiftKey is pressed
+			if ((newBlockName && !shiftKey) || (!newBlockName && shiftKey)) {
+				container = wrapSelfAndSiblingsInDefaultBlock(container, offset);
+			}
+
+			// Find parent block and setup empty block paddings
+			parentBlock = dom.getParent(container, dom.isBlock);
+			containerBlock = parentBlock ? dom.getParent(parentBlock.parentNode, dom.isBlock) : null;
+
+			// Setup block names
+			parentBlockName = parentBlock ? parentBlock.nodeName.toUpperCase() : ''; // IE < 9 & HTML5
+			containerBlockName = containerBlock ? containerBlock.nodeName.toUpperCase() : ''; // IE < 9 & HTML5
+
+			// Enter inside block contained within a LI then split or insert before/after LI
+			if (containerBlockName == 'LI' && !evt.ctrlKey) {
+				parentBlock = containerBlock;
+				parentBlockName = containerBlockName;
+			}
+
+			// Handle enter in list item
+			if (/^(LI|DT|DD)$/.test(parentBlockName)) {
+				if (!newBlockName && shiftKey) {
+					insertBr();
+					return;
+				}
+
+				// Handle enter inside an empty list item
+				if (dom.isEmpty(parentBlock)) {
+					handleEmptyListItem();
+					return;
+				}
+			}
+
+			// Don't split PRE tags but insert a BR instead easier when writing code samples etc
+			if (parentBlockName == 'PRE' && settings.br_in_pre !== false) {
+				if (!shiftKey) {
+					insertBr();
+					return;
+				}
+			} else {
+				// If no root block is configured then insert a BR by default or if the shiftKey is pressed
+				if ((!newBlockName && !shiftKey && parentBlockName != 'LI') || (newBlockName && shiftKey)) {
+					insertBr();
+					return;
+				}
+			}
+
+			// If parent block is root then never insert new blocks
+			if (newBlockName && parentBlock === editor.getBody()) {
+				return;
+			}
+
+			// Default block name if it's not configured
+			newBlockName = newBlockName || 'P';
+
+			// Insert new block before/after the parent block depending on caret location
+			if (isCaretAtStartOrEndOfBlock()) {
+				// If the caret is at the end of a header we produce a P tag after it similar to Word unless we are in a hgroup
+				if (/^(H[1-6]|PRE|FIGURE)$/.test(parentBlockName) && containerBlockName != 'HGROUP') {
+					newBlock = createNewBlock(newBlockName);
+				} else {
+					newBlock = createNewBlock();
+				}
+
+				// Split the current container block element if enter is pressed inside an empty inner block element
+				if (settings.end_container_on_empty_block && canSplitBlock(containerBlock) && dom.isEmpty(parentBlock)) {
+					// Split container block for example a BLOCKQUOTE at the current blockParent location for example a P
+					newBlock = dom.split(containerBlock, parentBlock);
+				} else {
+					dom.insertAfter(newBlock, parentBlock);
+				}
+
+				moveToCaretPosition(newBlock);
+			} else if (isCaretAtStartOrEndOfBlock(true)) {
+				// Insert new block before
+				newBlock = parentBlock.parentNode.insertBefore(createNewBlock(), parentBlock);
+				renderBlockOnIE(newBlock);
+				moveToCaretPosition(parentBlock);
+			} else {
+				// Extract after fragment and insert it after the current block
+				tmpRng = rng.cloneRange();
+				tmpRng.setEndAfter(parentBlock);
+				fragment = tmpRng.extractContents();
+				trimLeadingLineBreaks(fragment);
+				newBlock = fragment.firstChild;
+				dom.insertAfter(fragment, parentBlock);
+				trimInlineElementsOnLeftSideOfBlock(newBlock);
+				addBrToBlockIfNeeded(parentBlock);
+				moveToCaretPosition(newBlock);
+			}
+
+			dom.setAttrib(newBlock, 'id', ''); // Remove ID since it needs to be document unique
+
+			// Allow custom handling of new blocks
+			editor.fire('NewBlock', {newBlock: newBlock});
+
+			undoManager.add();
+		}
+
+		editor.on('keydown', function(evt) {
+			if (evt.keyCode == 13) {
+				if (handleEnterKey(evt) !== false) {
+					evt.preventDefault();
+				}
+			}
+		});
+	};
+});
+
+// Included from: js/tinymce/classes/ForceBlocks.js
+
+/**
+ * ForceBlocks.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+define("tinymce/ForceBlocks", [], function() {
+	return function(editor) {
+		var settings = editor.settings, dom = editor.dom, selection = editor.selection;
+		var schema = editor.schema, blockElements = schema.getBlockElements();
+
+		function addRootBlocks() {
+			var node = selection.getStart(), rootNode = editor.getBody(), rng;
+			var startContainer, startOffset, endContainer, endOffset, rootBlockNode;
+			var tempNode, offset = -0xFFFFFF, wrapped, restoreSelection;
+			var tmpRng, rootNodeName, forcedRootBlock;
+
+			forcedRootBlock = settings.forced_root_block;
+
+			if (!node || node.nodeType !== 1 || !forcedRootBlock) {
+				return;
+			}
+
+			// Check if node is wrapped in block
+			while (node && node != rootNode) {
+				if (blockElements[node.nodeName]) {
+					return;
+				}
+
+				node = node.parentNode;
+			}
+
+			// Get current selection
+			rng = selection.getRng();
+			if (rng.setStart) {
+				startContainer = rng.startContainer;
+				startOffset = rng.startOffset;
+				endContainer = rng.endContainer;
+				endOffset = rng.endOffset;
+
+				try {
+					restoreSelection = editor.getDoc().activeElement === rootNode;
+				} catch (ex) {
+					// IE throws unspecified error here sometimes
+				}
+			} else {
+				// Force control range into text range
+				if (rng.item) {
+					node = rng.item(0);
+					rng = editor.getDoc().body.createTextRange();
+					rng.moveToElementText(node);
+				}
+
+				restoreSelection = rng.parentElement().ownerDocument === editor.getDoc();
+				tmpRng = rng.duplicate();
+				tmpRng.collapse(true);
+				startOffset = tmpRng.move('character', offset) * -1;
+
+				if (!tmpRng.collapsed) {
+					tmpRng = rng.duplicate();
+					tmpRng.collapse(false);
+					endOffset = (tmpRng.move('character', offset) * -1) - startOffset;
+				}
+			}
+
+			// Wrap non block elements and text nodes
+			node = rootNode.firstChild;
+			rootNodeName = rootNode.nodeName.toLowerCase();
+			while (node) {
+				// TODO: Break this up, too complex
+				if (((node.nodeType === 3 || (node.nodeType == 1 && !blockElements[node.nodeName]))) &&
+					schema.isValidChild(rootNodeName, forcedRootBlock.toLowerCase())) {
+					// Remove empty text nodes
+					if (node.nodeType === 3 && node.nodeValue.length === 0) {
+						tempNode = node;
+						node = node.nextSibling;
+						dom.remove(tempNode);
+						continue;
+					}
+
+					if (!rootBlockNode) {
+						rootBlockNode = dom.create(forcedRootBlock, editor.settings.forced_root_block_attrs);
+						node.parentNode.insertBefore(rootBlockNode, node);
+						wrapped = true;
+					}
+
+					tempNode = node;
+					node = node.nextSibling;
+					rootBlockNode.appendChild(tempNode);
+				} else {
+					rootBlockNode = null;
+					node = node.nextSibling;
+				}
+			}
+
+			if (wrapped && restoreSelection) {
+				if (rng.setStart) {
+					rng.setStart(startContainer, startOffset);
+					rng.setEnd(endContainer, endOffset);
+					selection.setRng(rng);
+				} else {
+					// Only select if the previous selection was inside the document to prevent auto focus in quirks mode
+					try {
+						rng = editor.getDoc().body.createTextRange();
+						rng.moveToElementText(rootNode);
+						rng.collapse(true);
+						rng.moveStart('character', startOffset);
+
+						if (endOffset > 0) {
+							rng.moveEnd('character', endOffset);
+						}
+
+						rng.select();
+					} catch (ex) {
+						// Ignore
+					}
+				}
+
+				editor.nodeChanged();
+			}
+		}
+
+		// Force root blocks
+		if (settings.forced_root_block) {
+			editor.on('NodeChange', addRootBlocks);
+		}
+	};
+});
+
+// Included from: js/tinymce/classes/EditorCommands.js
+
+/**
+ * EditorCommands.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class enables you to add custom editor commands and it contains
+ * overrides for native browser commands to address various bugs and issues.
+ *
+ * @class tinymce.EditorCommands
+ */
+define("tinymce/EditorCommands", [
+	"tinymce/html/Serializer",
+	"tinymce/Env",
+	"tinymce/util/Tools",
+	"tinymce/dom/ElementUtils",
+	"tinymce/dom/RangeUtils",
+	"tinymce/dom/TreeWalker"
+], function(Serializer, Env, Tools, ElementUtils, RangeUtils, TreeWalker) {
+	// Added for compression purposes
+	var each = Tools.each, extend = Tools.extend;
+	var map = Tools.map, inArray = Tools.inArray, explode = Tools.explode;
+	var isGecko = Env.gecko, isIE = Env.ie, isOldIE = Env.ie && Env.ie < 11;
+	var TRUE = true, FALSE = false;
+
+	return function(editor) {
+		var dom, selection, formatter,
+			commands = {state: {}, exec: {}, value: {}},
+			settings = editor.settings,
+			bookmark;
+
+		editor.on('PreInit', function() {
+			dom = editor.dom;
+			selection = editor.selection;
+			settings = editor.settings;
+			formatter = editor.formatter;
+		});
+
+		/**
+		 * Executes the specified command.
+		 *
+		 * @method execCommand
+		 * @param {String} command Command to execute.
+		 * @param {Boolean} ui Optional user interface state.
+		 * @param {Object} value Optional value for command.
+		 * @return {Boolean} true/false if the command was found or not.
+		 */
+		function execCommand(command, ui, value, args) {
+			var func, customCommand, state = 0;
+
+			if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(command) && (!args || !args.skip_focus)) {
+				editor.focus();
+			}
+
+			args = extend({}, args);
+			args = editor.fire('BeforeExecCommand', {command: command, ui: ui, value: value});
+			if (args.isDefaultPrevented()) {
+				return false;
+			}
+
+			customCommand = command.toLowerCase();
+			if ((func = commands.exec[customCommand])) {
+				func(customCommand, ui, value);
+				editor.fire('ExecCommand', {command: command, ui: ui, value: value});
+				return true;
+			}
+
+			// Plugin commands
+			each(editor.plugins, function(p) {
+				if (p.execCommand && p.execCommand(command, ui, value)) {
+					editor.fire('ExecCommand', {command: command, ui: ui, value: value});
+					state = true;
+					return false;
+				}
+			});
+
+			if (state) {
+				return state;
+			}
+
+			// Theme commands
+			if (editor.theme && editor.theme.execCommand && editor.theme.execCommand(command, ui, value)) {
+				editor.fire('ExecCommand', {command: command, ui: ui, value: value});
+				return true;
+			}
+
+			// Browser commands
+			try {
+				state = editor.getDoc().execCommand(command, ui, value);
+			} catch (ex) {
+				// Ignore old IE errors
+			}
+
+			if (state) {
+				editor.fire('ExecCommand', {command: command, ui: ui, value: value});
+				return true;
+			}
+
+			return false;
+		}
+
+		/**
+		 * Queries the current state for a command for example if the current selection is "bold".
+		 *
+		 * @method queryCommandState
+		 * @param {String} command Command to check the state of.
+		 * @return {Boolean/Number} true/false if the selected contents is bold or not, -1 if it's not found.
+		 */
+		function queryCommandState(command) {
+			var func;
+
+			// Is hidden then return undefined
+			if (editor._isHidden()) {
+				return;
+			}
+
+			command = command.toLowerCase();
+			if ((func = commands.state[command])) {
+				return func(command);
+			}
+
+			// Browser commands
+			try {
+				return editor.getDoc().queryCommandState(command);
+			} catch (ex) {
+				// Fails sometimes see bug: 1896577
+			}
+
+			return false;
+		}
+
+		/**
+		 * Queries the command value for example the current fontsize.
+		 *
+		 * @method queryCommandValue
+		 * @param {String} command Command to check the value of.
+		 * @return {Object} Command value of false if it's not found.
+		 */
+		function queryCommandValue(command) {
+			var func;
+
+			// Is hidden then return undefined
+			if (editor._isHidden()) {
+				return;
+			}
+
+			command = command.toLowerCase();
+			if ((func = commands.value[command])) {
+				return func(command);
+			}
+
+			// Browser commands
+			try {
+				return editor.getDoc().queryCommandValue(command);
+			} catch (ex) {
+				// Fails sometimes see bug: 1896577
+			}
+		}
+
+		/**
+		 * Adds commands to the command collection.
+		 *
+		 * @method addCommands
+		 * @param {Object} command_list Name/value collection with commands to add, the names can also be comma separated.
+		 * @param {String} type Optional type to add, defaults to exec. Can be value or state as well.
+		 */
+		function addCommands(command_list, type) {
+			type = type || 'exec';
+
+			each(command_list, function(callback, command) {
+				each(command.toLowerCase().split(','), function(command) {
+					commands[type][command] = callback;
+				});
+			});
+		}
+
+		function addCommand(command, callback, scope) {
+			command = command.toLowerCase();
+			commands.exec[command] = function(command, ui, value, args) {
+				return callback.call(scope || editor, ui, value, args);
+			};
+		}
+
+		/**
+		 * Returns true/false if the command is supported or not.
+		 *
+		 * @method queryCommandSupported
+		 * @param {String} cmd Command that we check support for.
+		 * @return {Boolean} true/false if the command is supported or not.
+		 */
+		function queryCommandSupported(command) {
+			command = command.toLowerCase();
+
+			if (commands.exec[command]) {
+				return true;
+			}
+
+			// Browser commands
+			try {
+				return editor.getDoc().queryCommandSupported(command);
+			} catch (ex) {
+				// Fails sometimes see bug: 1896577
+			}
+
+			return false;
+		}
+
+		function addQueryStateHandler(command, callback, scope) {
+			command = command.toLowerCase();
+			commands.state[command] = function() {
+				return callback.call(scope || editor);
+			};
+		}
+
+		function addQueryValueHandler(command, callback, scope) {
+			command = command.toLowerCase();
+			commands.value[command] = function() {
+				return callback.call(scope || editor);
+			};
+		}
+
+		function hasCustomCommand(command) {
+			command = command.toLowerCase();
+			return !!commands.exec[command];
+		}
+
+		// Expose public methods
+		extend(this, {
+			execCommand: execCommand,
+			queryCommandState: queryCommandState,
+			queryCommandValue: queryCommandValue,
+			queryCommandSupported: queryCommandSupported,
+			addCommands: addCommands,
+			addCommand: addCommand,
+			addQueryStateHandler: addQueryStateHandler,
+			addQueryValueHandler: addQueryValueHandler,
+			hasCustomCommand: hasCustomCommand
+		});
+
+		// Private methods
+
+		function execNativeCommand(command, ui, value) {
+			if (ui === undefined) {
+				ui = FALSE;
+			}
+
+			if (value === undefined) {
+				value = null;
+			}
+
+			return editor.getDoc().execCommand(command, ui, value);
+		}
+
+		function isFormatMatch(name) {
+			return formatter.match(name);
+		}
+
+		function toggleFormat(name, value) {
+			formatter.toggle(name, value ? {value: value} : undefined);
+			editor.nodeChanged();
+		}
+
+		function storeSelection(type) {
+			bookmark = selection.getBookmark(type);
+		}
+
+		function restoreSelection() {
+			selection.moveToBookmark(bookmark);
+		}
+
+		// Add execCommand overrides
+		addCommands({
+			// Ignore these, added for compatibility
+			'mceResetDesignMode,mceBeginUndoLevel': function() {},
+
+			// Add undo manager logic
+			'mceEndUndoLevel,mceAddUndoLevel': function() {
+				editor.undoManager.add();
+			},
+
+			'Cut,Copy,Paste': function(command) {
+				var doc = editor.getDoc(), failed;
+
+				// Try executing the native command
+				try {
+					execNativeCommand(command);
+				} catch (ex) {
+					// Command failed
+					failed = TRUE;
+				}
+
+				// Present alert message about clipboard access not being available
+				if (failed || !doc.queryCommandSupported(command)) {
+					var msg = editor.translate(
+						"Your browser doesn't support direct access to the clipboard. " +
+						"Please use the Ctrl+X/C/V keyboard shortcuts instead."
+					);
+
+					if (Env.mac) {
+						msg = msg.replace(/Ctrl\+/g, '\u2318+');
+					}
+
+					editor.windowManager.alert(msg);
+				}
+			},
+
+			// Override unlink command
+			unlink: function() {
+				if (selection.isCollapsed()) {
+					var elm = selection.getNode();
+					if (elm.tagName == 'A') {
+						editor.dom.remove(elm, true);
+					}
+
+					return;
+				}
+
+				formatter.remove("link");
+			},
+
+			// Override justify commands to use the text formatter engine
+			'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull': function(command) {
+				var align = command.substring(7);
+
+				if (align == 'full') {
+					align = 'justify';
+				}
+
+				// Remove all other alignments first
+				each('left,center,right,justify'.split(','), function(name) {
+					if (align != name) {
+						formatter.remove('align' + name);
+					}
+				});
+
+				toggleFormat('align' + align);
+				execCommand('mceRepaint');
+			},
+
+			// Override list commands to fix WebKit bug
+			'InsertUnorderedList,InsertOrderedList': function(command) {
+				var listElm, listParent;
+
+				execNativeCommand(command);
+
+				// WebKit produces lists within block elements so we need to split them
+				// we will replace the native list creation logic to custom logic later on
+				// TODO: Remove this when the list creation logic is removed
+				listElm = dom.getParent(selection.getNode(), 'ol,ul');
+				if (listElm) {
+					listParent = listElm.parentNode;
+
+					// If list is within a text block then split that block
+					if (/^(H[1-6]|P|ADDRESS|PRE)$/.test(listParent.nodeName)) {
+						storeSelection();
+						dom.split(listParent, listElm);
+						restoreSelection();
+					}
+				}
+			},
+
+			// Override commands to use the text formatter engine
+			'Bold,Italic,Underline,Strikethrough,Superscript,Subscript': function(command) {
+				toggleFormat(command);
+			},
+
+			// Override commands to use the text formatter engine
+			'ForeColor,HiliteColor,FontName': function(command, ui, value) {
+				toggleFormat(command, value);
+			},
+
+			FontSize: function(command, ui, value) {
+				var fontClasses, fontSizes;
+
+				// Convert font size 1-7 to styles
+				if (value >= 1 && value <= 7) {
+					fontSizes = explode(settings.font_size_style_values);
+					fontClasses = explode(settings.font_size_classes);
+
+					if (fontClasses) {
+						value = fontClasses[value - 1] || value;
+					} else {
+						value = fontSizes[value - 1] || value;
+					}
+				}
+
+				toggleFormat(command, value);
+			},
+
+			RemoveFormat: function(command) {
+				formatter.remove(command);
+			},
+
+			mceBlockQuote: function() {
+				toggleFormat('blockquote');
+			},
+
+			FormatBlock: function(command, ui, value) {
+				return toggleFormat(value || 'p');
+			},
+
+			mceCleanup: function() {
+				var bookmark = selection.getBookmark();
+
+				editor.setContent(editor.getContent({cleanup: TRUE}), {cleanup: TRUE});
+
+				selection.moveToBookmark(bookmark);
+			},
+
+			mceRemoveNode: function(command, ui, value) {
+				var node = value || selection.getNode();
+
+				// Make sure that the body node isn't removed
+				if (node != editor.getBody()) {
+					storeSelection();
+					editor.dom.remove(node, TRUE);
+					restoreSelection();
+				}
+			},
+
+			mceSelectNodeDepth: function(command, ui, value) {
+				var counter = 0;
+
+				dom.getParent(selection.getNode(), function(node) {
+					if (node.nodeType == 1 && counter++ == value) {
+						selection.select(node);
+						return FALSE;
+					}
+				}, editor.getBody());
+			},
+
+			mceSelectNode: function(command, ui, value) {
+				selection.select(value);
+			},
+
+			mceInsertContent: function(command, ui, value) {
+				var parser, serializer, parentNode, rootNode, fragment, args;
+				var marker, rng, node, node2, bookmarkHtml, merge;
+				var textInlineElements = editor.schema.getTextInlineElements();
+
+				function trimOrPaddLeftRight(html) {
+					var rng, container, offset;
+
+					rng = selection.getRng(true);
+					container = rng.startContainer;
+					offset = rng.startOffset;
+
+					function hasSiblingText(siblingName) {
+						return container[siblingName] && container[siblingName].nodeType == 3;
+					}
+
+					if (container.nodeType == 3) {
+						if (offset > 0) {
+							html = html.replace(/^&nbsp;/, ' ');
+						} else if (!hasSiblingText('previousSibling')) {
+							html = html.replace(/^ /, '&nbsp;');
+						}
+
+						if (offset < container.length) {
+							html = html.replace(/&nbsp;(<br>|)$/, ' ');
+						} else if (!hasSiblingText('nextSibling')) {
+							html = html.replace(/(&nbsp;| )(<br>|)$/, '&nbsp;');
+						}
+					}
+
+					return html;
+				}
+
+				// Removes &nbsp; from a [b] c -> a &nbsp;c -> a c
+				function trimNbspAfterDeleteAndPaddValue() {
+					var rng, container, offset;
+
+					rng = selection.getRng(true);
+					container = rng.startContainer;
+					offset = rng.startOffset;
+
+					if (container.nodeType == 3 && rng.collapsed) {
+						if (container.data[offset] === '\u00a0') {
+							container.deleteData(offset, 1);
+
+							if (!/[\u00a0| ]$/.test(value)) {
+								value += ' ';
+							}
+						} else if (container.data[offset - 1] === '\u00a0') {
+							container.deleteData(offset - 1, 1);
+
+							if (!/[\u00a0| ]$/.test(value)) {
+								value = ' ' + value;
+							}
+						}
+					}
+				}
+
+				function markInlineFormatElements(fragment) {
+					if (merge) {
+						for (node = fragment.firstChild; node; node = node.walk(true)) {
+							if (textInlineElements[node.name]) {
+								node.attr('data-mce-new', "true");
+							}
+						}
+					}
+				}
+
+				function reduceInlineTextElements() {
+					if (merge) {
+						var root = editor.getBody(), elementUtils = new ElementUtils(dom);
+
+						each(dom.select('*[data-mce-new]'), function(node) {
+							node.removeAttribute('data-mce-new');
+
+							for (var testNode = node.parentNode; testNode && testNode != root; testNode = testNode.parentNode) {
+								if (elementUtils.compare(testNode, node)) {
+									dom.remove(node, true);
+								}
+							}
+						});
+					}
+				}
+
+				if (typeof value != 'string') {
+					merge = value.merge;
+					value = value.content;
+				}
+
+				// Check for whitespace before/after value
+				if (/^ | $/.test(value)) {
+					value = trimOrPaddLeftRight(value);
+				}
+
+				// Setup parser and serializer
+				parser = editor.parser;
+				serializer = new Serializer({}, editor.schema);
+				bookmarkHtml = '<span id="mce_marker" data-mce-type="bookmark">&#xFEFF;&#x200B;</span>';
+
+				// Run beforeSetContent handlers on the HTML to be inserted
+				args = {content: value, format: 'html', selection: true};
+				editor.fire('BeforeSetContent', args);
+				value = args.content;
+
+				// Add caret at end of contents if it's missing
+				if (value.indexOf('{$caret}') == -1) {
+					value += '{$caret}';
+				}
+
+				// Replace the caret marker with a span bookmark element
+				value = value.replace(/\{\$caret\}/, bookmarkHtml);
+
+				// If selection is at <body>|<p></p> then move it into <body><p>|</p>
+				rng = selection.getRng();
+				var caretElement = rng.startContainer || (rng.parentElement ? rng.parentElement() : null);
+				var body = editor.getBody();
+				if (caretElement === body && selection.isCollapsed()) {
+					if (dom.isBlock(body.firstChild) && dom.isEmpty(body.firstChild)) {
+						rng = dom.createRng();
+						rng.setStart(body.firstChild, 0);
+						rng.setEnd(body.firstChild, 0);
+						selection.setRng(rng);
+					}
+				}
+
+				// Insert node maker where we will insert the new HTML and get it's parent
+				if (!selection.isCollapsed()) {
+					editor.getDoc().execCommand('Delete', false, null);
+					trimNbspAfterDeleteAndPaddValue();
+				}
+
+				parentNode = selection.getNode();
+
+				// Parse the fragment within the context of the parent node
+				var parserArgs = {context: parentNode.nodeName.toLowerCase()};
+				fragment = parser.parse(value, parserArgs);
+
+				markInlineFormatElements(fragment);
+
+				// Move the caret to a more suitable location
+				node = fragment.lastChild;
+				if (node.attr('id') == 'mce_marker') {
+					marker = node;
+
+					for (node = node.prev; node; node = node.walk(true)) {
+						if (node.type == 3 || !dom.isBlock(node.name)) {
+							if (editor.schema.isValidChild(node.parent.name, 'span')) {
+								node.parent.insert(marker, node, node.name === 'br');
+							}
+							break;
+						}
+					}
+				}
+
+				// If parser says valid we can insert the contents into that parent
+				if (!parserArgs.invalid) {
+					value = serializer.serialize(fragment);
+
+					// Check if parent is empty or only has one BR element then set the innerHTML of that parent
+					node = parentNode.firstChild;
+					node2 = parentNode.lastChild;
+					if (!node || (node === node2 && node.nodeName === 'BR')) {
+						dom.setHTML(parentNode, value);
+					} else {
+						selection.setContent(value);
+					}
+				} else {
+					// If the fragment was invalid within that context then we need
+					// to parse and process the parent it's inserted into
+
+					// Insert bookmark node and get the parent
+					selection.setContent(bookmarkHtml);
+					parentNode = selection.getNode();
+					rootNode = editor.getBody();
+
+					// Opera will return the document node when selection is in root
+					if (parentNode.nodeType == 9) {
+						parentNode = node = rootNode;
+					} else {
+						node = parentNode;
+					}
+
+					// Find the ancestor just before the root element
+					while (node !== rootNode) {
+						parentNode = node;
+						node = node.parentNode;
+					}
+
+					// Get the outer/inner HTML depending on if we are in the root and parser and serialize that
+					value = parentNode == rootNode ? rootNode.innerHTML : dom.getOuterHTML(parentNode);
+					value = serializer.serialize(
+						parser.parse(
+							// Need to replace by using a function since $ in the contents would otherwise be a problem
+							value.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i, function() {
+								return serializer.serialize(fragment);
+							})
+						)
+					);
+
+					// Set the inner/outer HTML depending on if we are in the root or not
+					if (parentNode == rootNode) {
+						dom.setHTML(rootNode, value);
+					} else {
+						dom.setOuterHTML(parentNode, value);
+					}
+				}
+
+				reduceInlineTextElements();
+
+				marker = dom.get('mce_marker');
+				selection.scrollIntoView(marker);
+
+				// Move selection before marker and remove it
+				rng = dom.createRng();
+
+				// If previous sibling is a text node set the selection to the end of that node
+				node = marker.previousSibling;
+				if (node && node.nodeType == 3) {
+					rng.setStart(node, node.nodeValue.length);
+
+					// TODO: Why can't we normalize on IE
+					if (!isIE) {
+						node2 = marker.nextSibling;
+						if (node2 && node2.nodeType == 3) {
+							node.appendData(node2.data);
+							node2.parentNode.removeChild(node2);
+						}
+					}
+				} else {
+					// If the previous sibling isn't a text node or doesn't exist set the selection before the marker node
+					rng.setStartBefore(marker);
+					rng.setEndBefore(marker);
+				}
+
+				// Remove the marker node and set the new range
+				dom.remove(marker);
+				selection.setRng(rng);
+
+				// Dispatch after event and add any visual elements needed
+				editor.fire('SetContent', args);
+				editor.addVisual();
+			},
+
+			mceInsertRawHTML: function(command, ui, value) {
+				selection.setContent('tiny_mce_marker');
+				editor.setContent(
+					editor.getContent().replace(/tiny_mce_marker/g, function() {
+						return value;
+					})
+				);
+			},
+
+			mceToggleFormat: function(command, ui, value) {
+				toggleFormat(value);
+			},
+
+			mceSetContent: function(command, ui, value) {
+				editor.setContent(value);
+			},
+
+			'Indent,Outdent': function(command) {
+				var intentValue, indentUnit, value;
+
+				// Setup indent level
+				intentValue = settings.indentation;
+				indentUnit = /[a-z%]+$/i.exec(intentValue);
+				intentValue = parseInt(intentValue, 10);
+
+				if (!queryCommandState('InsertUnorderedList') && !queryCommandState('InsertOrderedList')) {
+					// If forced_root_blocks is set to false we don't have a block to indent so lets create a div
+					if (!settings.forced_root_block && !dom.getParent(selection.getNode(), dom.isBlock)) {
+						formatter.apply('div');
+					}
+
+					each(selection.getSelectedBlocks(), function(element) {
+						if (element.nodeName != "LI") {
+							var indentStyleName = editor.getParam('indent_use_margin', false) ? 'margin' : 'padding';
+
+							indentStyleName += dom.getStyle(element, 'direction', true) == 'rtl' ? 'Right' : 'Left';
+
+							if (command == 'outdent') {
+								value = Math.max(0, parseInt(element.style[indentStyleName] || 0, 10) - intentValue);
+								dom.setStyle(element, indentStyleName, value ? value + indentUnit : '');
+							} else {
+								value = (parseInt(element.style[indentStyleName] || 0, 10) + intentValue) + indentUnit;
+								dom.setStyle(element, indentStyleName, value);
+							}
+						}
+					});
+				} else {
+					execNativeCommand(command);
+				}
+			},
+
+			mceRepaint: function() {
+				if (isGecko) {
+					try {
+						storeSelection(TRUE);
+
+						if (selection.getSel()) {
+							selection.getSel().selectAllChildren(editor.getBody());
+						}
+
+						selection.collapse(TRUE);
+						restoreSelection();
+					} catch (ex) {
+						// Ignore
+					}
+				}
+			},
+
+			InsertHorizontalRule: function() {
+				editor.execCommand('mceInsertContent', false, '<hr />');
+			},
+
+			mceToggleVisualAid: function() {
+				editor.hasVisual = !editor.hasVisual;
+				editor.addVisual();
+			},
+
+			mceReplaceContent: function(command, ui, value) {
+				editor.execCommand('mceInsertContent', false, value.replace(/\{\$selection\}/g, selection.getContent({format: 'text'})));
+			},
+
+			mceInsertLink: function(command, ui, value) {
+				var anchor;
+
+				if (typeof value == 'string') {
+					value = {href: value};
+				}
+
+				anchor = dom.getParent(selection.getNode(), 'a');
+
+				// Spaces are never valid in URLs and it's a very common mistake for people to make so we fix it here.
+				value.href = value.href.replace(' ', '%20');
+
+				// Remove existing links if there could be child links or that the href isn't specified
+				if (!anchor || !value.href) {
+					formatter.remove('link');
+				}
+
+				// Apply new link to selection
+				if (value.href) {
+					formatter.apply('link', value, anchor);
+				}
+			},
+
+			selectAll: function() {
+				var root = dom.getRoot(), rng;
+
+				if (selection.getRng().setStart) {
+					rng = dom.createRng();
+					rng.setStart(root, 0);
+					rng.setEnd(root, root.childNodes.length);
+					selection.setRng(rng);
+				} else {
+					// IE will render it's own root level block elements and sometimes
+					// even put font elements in them when the user starts typing. So we need to
+					// move the selection to a more suitable element from this:
+					// <body>|<p></p></body> to this: <body><p>|</p></body>
+					rng = selection.getRng();
+					if (!rng.item) {
+						rng.moveToElementText(root);
+						rng.select();
+					}
+				}
+			},
+
+			"delete": function() {
+				execNativeCommand("Delete");
+
+				// Check if body is empty after the delete call if so then set the contents
+				// to an empty string and move the caret to any block produced by that operation
+				// this fixes the issue with root blocks not being properly produced after a delete call on IE
+				var body = editor.getBody();
+
+				if (dom.isEmpty(body)) {
+					editor.setContent('');
+
+					if (body.firstChild && dom.isBlock(body.firstChild)) {
+						editor.selection.setCursorLocation(body.firstChild, 0);
+					} else {
+						editor.selection.setCursorLocation(body, 0);
+					}
+				}
+			},
+
+			mceNewDocument: function() {
+				editor.setContent('');
+			},
+
+			InsertLineBreak: function(command, ui, value) {
+				// We load the current event in from EnterKey.js when appropriate to heed
+				// certain event-specific variations such as ctrl-enter in a list
+				var evt = value;
+				var brElm, extraBr, marker;
+				var rng = selection.getRng(true);
+				new RangeUtils(dom).normalize(rng);
+
+				var offset = rng.startOffset;
+				var container = rng.startContainer;
+
+				// Resolve node index
+				if (container.nodeType == 1 && container.hasChildNodes()) {
+					var isAfterLastNodeInContainer = offset > container.childNodes.length - 1;
+
+					container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container;
+					if (isAfterLastNodeInContainer && container.nodeType == 3) {
+						offset = container.nodeValue.length;
+					} else {
+						offset = 0;
+					}
+				}
+
+				var parentBlock = dom.getParent(container, dom.isBlock);
+				var parentBlockName = parentBlock ? parentBlock.nodeName.toUpperCase() : ''; // IE < 9 & HTML5
+				var containerBlock = parentBlock ? dom.getParent(parentBlock.parentNode, dom.isBlock) : null;
+				var containerBlockName = containerBlock ? containerBlock.nodeName.toUpperCase() : ''; // IE < 9 & HTML5
+
+				// Enter inside block contained within a LI then split or insert before/after LI
+				var isControlKey = evt && evt.ctrlKey;
+				if (containerBlockName == 'LI' && !isControlKey) {
+					parentBlock = containerBlock;
+					parentBlockName = containerBlockName;
+				}
+
+				// Walks the parent block to the right and look for BR elements
+				function hasRightSideContent() {
+					var walker = new TreeWalker(container, parentBlock), node;
+					var nonEmptyElementsMap = editor.schema.getNonEmptyElements();
+
+					while ((node = walker.next())) {
+						if (nonEmptyElementsMap[node.nodeName.toLowerCase()] || node.length > 0) {
+							return true;
+						}
+					}
+				}
+
+				if (container && container.nodeType == 3 && offset >= container.nodeValue.length) {
+					// Insert extra BR element at the end block elements
+					if (!isOldIE && !hasRightSideContent()) {
+						brElm = dom.create('br');
+						rng.insertNode(brElm);
+						rng.setStartAfter(brElm);
+						rng.setEndAfter(brElm);
+						extraBr = true;
+					}
+				}
+
+				brElm = dom.create('br');
+				rng.insertNode(brElm);
+
+				// Rendering modes below IE8 doesn't display BR elements in PRE unless we have a \n before it
+				var documentMode = dom.doc.documentMode;
+				if (isOldIE && parentBlockName == 'PRE' && (!documentMode || documentMode < 8)) {
+					brElm.parentNode.insertBefore(dom.doc.createTextNode('\r'), brElm);
+				}
+
+				// Insert temp marker and scroll to that
+				marker = dom.create('span', {}, '&nbsp;');
+				brElm.parentNode.insertBefore(marker, brElm);
+				selection.scrollIntoView(marker);
+				dom.remove(marker);
+
+				if (!extraBr) {
+					rng.setStartAfter(brElm);
+					rng.setEndAfter(brElm);
+				} else {
+					rng.setStartBefore(brElm);
+					rng.setEndBefore(brElm);
+				}
+
+				selection.setRng(rng);
+				editor.undoManager.add();
+
+				return TRUE;
+			}
+		});
+
+		// Add queryCommandState overrides
+		addCommands({
+			// Override justify commands
+			'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull': function(command) {
+				var name = 'align' + command.substring(7);
+				var nodes = selection.isCollapsed() ? [dom.getParent(selection.getNode(), dom.isBlock)] : selection.getSelectedBlocks();
+				var matches = map(nodes, function(node) {
+					return !!formatter.matchNode(node, name);
+				});
+				return inArray(matches, TRUE) !== -1;
+			},
+
+			'Bold,Italic,Underline,Strikethrough,Superscript,Subscript': function(command) {
+				return isFormatMatch(command);
+			},
+
+			mceBlockQuote: function() {
+				return isFormatMatch('blockquote');
+			},
+
+			Outdent: function() {
+				var node;
+
+				if (settings.inline_styles) {
+					if ((node = dom.getParent(selection.getStart(), dom.isBlock)) && parseInt(node.style.paddingLeft, 10) > 0) {
+						return TRUE;
+					}
+
+					if ((node = dom.getParent(selection.getEnd(), dom.isBlock)) && parseInt(node.style.paddingLeft, 10) > 0) {
+						return TRUE;
+					}
+				}
+
+				return (
+					queryCommandState('InsertUnorderedList') ||
+					queryCommandState('InsertOrderedList') ||
+					(!settings.inline_styles && !!dom.getParent(selection.getNode(), 'BLOCKQUOTE'))
+				);
+			},
+
+			'InsertUnorderedList,InsertOrderedList': function(command) {
+				var list = dom.getParent(selection.getNode(), 'ul,ol');
+
+				return list &&
+					(
+						command === 'insertunorderedlist' && list.tagName === 'UL' ||
+						command === 'insertorderedlist' && list.tagName === 'OL'
+					);
+			}
+		}, 'state');
+
+		// Add queryCommandValue overrides
+		addCommands({
+			'FontSize,FontName': function(command) {
+				var value = 0, parent;
+
+				if ((parent = dom.getParent(selection.getNode(), 'span'))) {
+					if (command == 'fontsize') {
+						value = parent.style.fontSize;
+					} else {
+						value = parent.style.fontFamily.replace(/, /g, ',').replace(/[\'\"]/g, '').toLowerCase();
+					}
+				}
+
+				return value;
+			}
+		}, 'value');
+
+		// Add undo manager logic
+		addCommands({
+			Undo: function() {
+				editor.undoManager.undo();
+			},
+
+			Redo: function() {
+				editor.undoManager.redo();
+			}
+		});
+	};
+});
+
+// Included from: js/tinymce/classes/util/URI.js
+
+/**
+ * URI.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles parsing, modification and serialization of URI/URL strings.
+ * @class tinymce.util.URI
+ */
+define("tinymce/util/URI", [
+	"tinymce/util/Tools"
+], function(Tools) {
+	var each = Tools.each, trim = Tools.trim;
+	var queryParts = "source protocol authority userInfo user password host port relative path directory file query anchor".split(' ');
+	var DEFAULT_PORTS = {
+		'ftp': 21,
+		'http': 80,
+		'https': 443,
+		'mailto': 25
+	};
+
+	/**
+	 * Constructs a new URI instance.
+	 *
+	 * @constructor
+	 * @method URI
+	 * @param {String} url URI string to parse.
+	 * @param {Object} settings Optional settings object.
+	 */
+	function URI(url, settings) {
+		var self = this, baseUri, base_url;
+
+		url = trim(url);
+		settings = self.settings = settings || {};
+		baseUri = settings.base_uri;
+
+		// Strange app protocol that isn't http/https or local anchor
+		// For example: mailto,skype,tel etc.
+		if (/^([\w\-]+):([^\/]{2})/i.test(url) || /^\s*#/.test(url)) {
+			self.source = url;
+			return;
+		}
+
+		var isProtocolRelative = url.indexOf('//') === 0;
+
+		// Absolute path with no host, fake host and protocol
+		if (url.indexOf('/') === 0 && !isProtocolRelative) {
+			url = (baseUri ? baseUri.protocol || 'http' : 'http') + '://mce_host' + url;
+		}
+
+		// Relative path http:// or protocol relative //path
+		if (!/^[\w\-]*:?\/\//.test(url)) {
+			base_url = settings.base_uri ? settings.base_uri.path : new URI(location.href).directory;
+			if (settings.base_uri.protocol === "") {
+				url = '//mce_host' + self.toAbsPath(base_url, url);
+			} else {
+				url = /([^#?]*)([#?]?.*)/.exec(url);
+				url = ((baseUri && baseUri.protocol) || 'http') + '://mce_host' + self.toAbsPath(base_url, url[1]) + url[2];
+			}
+		}
+
+		// Parse URL (Credits goes to Steave, http://blog.stevenlevithan.com/archives/parseuri)
+		url = url.replace(/@@/g, '(mce_at)'); // Zope 3 workaround, they use @@something
+
+		/*jshint maxlen: 255 */
+		/*eslint max-len: 0 */
+		url = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(url);
+
+		each(queryParts, function(v, i) {
+			var part = url[i];
+
+			// Zope 3 workaround, they use @@something
+			if (part) {
+				part = part.replace(/\(mce_at\)/g, '@@');
+			}
+
+			self[v] = part;
+		});
+
+		if (baseUri) {
+			if (!self.protocol) {
+				self.protocol = baseUri.protocol;
+			}
+
+			if (!self.userInfo) {
+				self.userInfo = baseUri.userInfo;
+			}
+
+			if (!self.port && self.host === 'mce_host') {
+				self.port = baseUri.port;
+			}
+
+			if (!self.host || self.host === 'mce_host') {
+				self.host = baseUri.host;
+			}
+
+			self.source = '';
+		}
+
+		if (isProtocolRelative) {
+			self.protocol = '';
+		}
+
+		//t.path = t.path || '/';
+	}
+
+	URI.prototype = {
+		/**
+		 * Sets the internal path part of the URI.
+		 *
+		 * @method setPath
+		 * @param {string} path Path string to set.
+		 */
+		setPath: function(path) {
+			var self = this;
+
+			path = /^(.*?)\/?(\w+)?$/.exec(path);
+
+			// Update path parts
+			self.path = path[0];
+			self.directory = path[1];
+			self.file = path[2];
+
+			// Rebuild source
+			self.source = '';
+			self.getURI();
+		},
+
+		/**
+		 * Converts the specified URI into a relative URI based on the current URI instance location.
+		 *
+		 * @method toRelative
+		 * @param {String} uri URI to convert into a relative path/URI.
+		 * @return {String} Relative URI from the point specified in the current URI instance.
+		 * @example
+		 * // Converts an absolute URL to an relative URL url will be somedir/somefile.htm
+		 * var url = new tinymce.util.URI('http://www.site.com/dir/').toRelative('http://www.site.com/dir/somedir/somefile.htm');
+		 */
+		toRelative: function(uri) {
+			var self = this, output;
+
+			if (uri === "./") {
+				return uri;
+			}
+
+			uri = new URI(uri, {base_uri: self});
+
+			// Not on same domain/port or protocol
+			if ((uri.host != 'mce_host' && self.host != uri.host && uri.host) || self.port != uri.port ||
+				(self.protocol != uri.protocol && uri.protocol !== "")) {
+				return uri.getURI();
+			}
+
+			var tu = self.getURI(), uu = uri.getURI();
+
+			// Allow usage of the base_uri when relative_urls = true
+			if (tu == uu || (tu.charAt(tu.length - 1) == "/" && tu.substr(0, tu.length - 1) == uu)) {
+				return tu;
+			}
+
+			output = self.toRelPath(self.path, uri.path);
+
+			// Add query
+			if (uri.query) {
+				output += '?' + uri.query;
+			}
+
+			// Add anchor
+			if (uri.anchor) {
+				output += '#' + uri.anchor;
+			}
+
+			return output;
+		},
+
+		/**
+		 * Converts the specified URI into a absolute URI based on the current URI instance location.
+		 *
+		 * @method toAbsolute
+		 * @param {String} uri URI to convert into a relative path/URI.
+		 * @param {Boolean} noHost No host and protocol prefix.
+		 * @return {String} Absolute URI from the point specified in the current URI instance.
+		 * @example
+		 * // Converts an relative URL to an absolute URL url will be http://www.site.com/dir/somedir/somefile.htm
+		 * var url = new tinymce.util.URI('http://www.site.com/dir/').toAbsolute('somedir/somefile.htm');
+		 */
+		toAbsolute: function(uri, noHost) {
+			uri = new URI(uri, {base_uri: this});
+
+			return uri.getURI(noHost && this.isSameOrigin(uri));
+		},
+
+		/**
+		 * Determine whether the given URI has the same origin as this URI.  Based on RFC-6454.
+		 * Supports default ports for protocols listed in DEFAULT_PORTS.  Unsupported protocols will fail safe: they
+		 * won't match, if the port specifications differ.
+		 *
+		 * @method isSameOrigin
+		 * @param {tinymce.util.URI} uri Uri instance to compare.
+		 * @returns {Boolean} True if the origins are the same.
+		 */
+		isSameOrigin: function(uri) {
+			if (this.host == uri.host && this.protocol == uri.protocol) {
+				if (this.port == uri.port) {
+					return true;
+				}
+
+				var defaultPort = DEFAULT_PORTS[this.protocol];
+				if (defaultPort && ((this.port || defaultPort) == (uri.port || defaultPort))) {
+					return true;
+				}
+			}
+
+			return false;
+		},
+
+		/**
+		 * Converts a absolute path into a relative path.
+		 *
+		 * @method toRelPath
+		 * @param {String} base Base point to convert the path from.
+		 * @param {String} path Absolute path to convert into a relative path.
+		 */
+		toRelPath: function(base, path) {
+			var items, breakPoint = 0, out = '', i, l;
+
+			// Split the paths
+			base = base.substring(0, base.lastIndexOf('/'));
+			base = base.split('/');
+			items = path.split('/');
+
+			if (base.length >= items.length) {
+				for (i = 0, l = base.length; i < l; i++) {
+					if (i >= items.length || base[i] != items[i]) {
+						breakPoint = i + 1;
+						break;
+					}
+				}
+			}
+
+			if (base.length < items.length) {
+				for (i = 0, l = items.length; i < l; i++) {
+					if (i >= base.length || base[i] != items[i]) {
+						breakPoint = i + 1;
+						break;
+					}
+				}
+			}
+
+			if (breakPoint === 1) {
+				return path;
+			}
+
+			for (i = 0, l = base.length - (breakPoint - 1); i < l; i++) {
+				out += "../";
+			}
+
+			for (i = breakPoint - 1, l = items.length; i < l; i++) {
+				if (i != breakPoint - 1) {
+					out += "/" + items[i];
+				} else {
+					out += items[i];
+				}
+			}
+
+			return out;
+		},
+
+		/**
+		 * Converts a relative path into a absolute path.
+		 *
+		 * @method toAbsPath
+		 * @param {String} base Base point to convert the path from.
+		 * @param {String} path Relative path to convert into an absolute path.
+		 */
+		toAbsPath: function(base, path) {
+			var i, nb = 0, o = [], tr, outPath;
+
+			// Split paths
+			tr = /\/$/.test(path) ? '/' : '';
+			base = base.split('/');
+			path = path.split('/');
+
+			// Remove empty chunks
+			each(base, function(k) {
+				if (k) {
+					o.push(k);
+				}
+			});
+
+			base = o;
+
+			// Merge relURLParts chunks
+			for (i = path.length - 1, o = []; i >= 0; i--) {
+				// Ignore empty or .
+				if (path[i].length === 0 || path[i] === ".") {
+					continue;
+				}
+
+				// Is parent
+				if (path[i] === '..') {
+					nb++;
+					continue;
+				}
+
+				// Move up
+				if (nb > 0) {
+					nb--;
+					continue;
+				}
+
+				o.push(path[i]);
+			}
+
+			i = base.length - nb;
+
+			// If /a/b/c or /
+			if (i <= 0) {
+				outPath = o.reverse().join('/');
+			} else {
+				outPath = base.slice(0, i).join('/') + '/' + o.reverse().join('/');
+			}
+
+			// Add front / if it's needed
+			if (outPath.indexOf('/') !== 0) {
+				outPath = '/' + outPath;
+			}
+
+			// Add traling / if it's needed
+			if (tr && outPath.lastIndexOf('/') !== outPath.length - 1) {
+				outPath += tr;
+			}
+
+			return outPath;
+		},
+
+		/**
+		 * Returns the full URI of the internal structure.
+		 *
+		 * @method getURI
+		 * @param {Boolean} noProtoHost Optional no host and protocol part. Defaults to false.
+		 */
+		getURI: function(noProtoHost) {
+			var s, self = this;
+
+			// Rebuild source
+			if (!self.source || noProtoHost) {
+				s = '';
+
+				if (!noProtoHost) {
+					if (self.protocol) {
+						s += self.protocol + '://';
+					} else {
+						s += '//';
+					}
+
+					if (self.userInfo) {
+						s += self.userInfo + '@';
+					}
+
+					if (self.host) {
+						s += self.host;
+					}
+
+					if (self.port) {
+						s += ':' + self.port;
+					}
+				}
+
+				if (self.path) {
+					s += self.path;
+				}
+
+				if (self.query) {
+					s += '?' + self.query;
+				}
+
+				if (self.anchor) {
+					s += '#' + self.anchor;
+				}
+
+				self.source = s;
+			}
+
+			return self.source;
+		}
+	};
+
+	return URI;
+});
+
+// Included from: js/tinymce/classes/util/Class.js
+
+/**
+ * Class.js
+ *
+ * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved.
+ */
+
+/**
+ * This utilitiy class is used for easier inheritage.
+ *
+ * Features:
+ * * Exposed super functions: this._super();
+ * * Mixins
+ * * Dummy functions
+ * * Property functions: var value = object.value(); and object.value(newValue);
+ * * Static functions
+ * * Defaults settings
+ */
+define("tinymce/util/Class", [
+	"tinymce/util/Tools"
+], function(Tools) {
+	var each = Tools.each, extend = Tools.extend;
+
+	var extendClass, initializing;
+
+	function Class() {
+	}
+
+	// Provides classical inheritance, based on code made by John Resig
+	Class.extend = extendClass = function(prop) {
+		var self = this, _super = self.prototype, prototype, name, member;
+
+		// The dummy class constructor
+		function Class() {
+			var i, mixins, mixin, self = this;
+
+			// All construction is actually done in the init method
+			if (!initializing) {
+				// Run class constuctor
+				if (self.init) {
+					self.init.apply(self, arguments);
+				}
+
+				// Run mixin constructors
+				mixins = self.Mixins;
+				if (mixins) {
+					i = mixins.length;
+					while (i--) {
+						mixin = mixins[i];
+						if (mixin.init) {
+							mixin.init.apply(self, arguments);
+						}
+					}
+				}
+			}
+		}
+
+		// Dummy function, needs to be extended in order to provide functionality
+		function dummy() {
+			return this;
+		}
+
+		// Creates a overloaded method for the class
+		// this enables you to use this._super(); to call the super function
+		function createMethod(name, fn) {
+			return function() {
+				var self = this, tmp = self._super, ret;
+
+				self._super = _super[name];
+				ret = fn.apply(self, arguments);
+				self._super = tmp;
+
+				return ret;
+			};
+		}
+
+		// Instantiate a base class (but only create the instance,
+		// don't run the init constructor)
+		initializing = true;
+
+		/*eslint new-cap:0 */
+		prototype = new self();
+		initializing = false;
+
+		// Add mixins
+		if (prop.Mixins) {
+			each(prop.Mixins, function(mixin) {
+				mixin = mixin;
+
+				for (var name in mixin) {
+					if (name !== "init") {
+						prop[name] = mixin[name];
+					}
+				}
+			});
+
+			if (_super.Mixins) {
+				prop.Mixins = _super.Mixins.concat(prop.Mixins);
+			}
+		}
+
+		// Generate dummy methods
+		if (prop.Methods) {
+			each(prop.Methods.split(','), function(name) {
+				prop[name] = dummy;
+			});
+		}
+
+		// Generate property methods
+		if (prop.Properties) {
+			each(prop.Properties.split(','), function(name) {
+				var fieldName = '_' + name;
+
+				prop[name] = function(value) {
+					var self = this, undef;
+
+					// Set value
+					if (value !== undef) {
+						self[fieldName] = value;
+
+						return self;
+					}
+
+					// Get value
+					return self[fieldName];
+				};
+			});
+		}
+
+		// Static functions
+		if (prop.Statics) {
+			each(prop.Statics, function(func, name) {
+				Class[name] = func;
+			});
+		}
+
+		// Default settings
+		if (prop.Defaults && _super.Defaults) {
+			prop.Defaults = extend({}, _super.Defaults, prop.Defaults);
+		}
+
+		// Copy the properties over onto the new prototype
+		for (name in prop) {
+			member = prop[name];
+
+			if (typeof member == "function" && _super[name]) {
+				prototype[name] = createMethod(name, member);
+			} else {
+				prototype[name] = member;
+			}
+		}
+
+		// Populate our constructed prototype object
+		Class.prototype = prototype;
+
+		// Enforce the constructor to be what we expect
+		Class.constructor = Class;
+
+		// And make this class extendible
+		Class.extend = extendClass;
+
+		return Class;
+	};
+
+	return Class;
+});
+
+// Included from: js/tinymce/classes/util/EventDispatcher.js
+
+/**
+ * EventDispatcher.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class lets you add/remove and fire events by name on the specified scope. This makes
+ * it easy to add event listener logic to any class.
+ *
+ * @class tinymce.util.EventDispatcher
+ * @example
+ *  var eventDispatcher = new EventDispatcher();
+ *
+ *  eventDispatcher.on('click', function() {console.log('data');});
+ *  eventDispatcher.fire('click', {data: 123});
+ */
+define("tinymce/util/EventDispatcher", [
+	"tinymce/util/Tools"
+], function(Tools) {
+	var nativeEvents = Tools.makeMap(
+		"focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange " +
+		"mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover " +
+		"draggesture dragdrop drop drag submit " +
+		"compositionstart compositionend compositionupdate touchstart touchend",
+		' '
+	);
+
+	function Dispatcher(settings) {
+		var self = this, scope, bindings = {}, toggleEvent;
+
+		function returnFalse() {
+			return false;
+		}
+
+		function returnTrue() {
+			return true;
+		}
+
+		settings = settings || {};
+		scope = settings.scope || self;
+		toggleEvent = settings.toggleEvent || returnFalse;
+
+		/**
+		 * Fires the specified event by name.
+		 *
+		 * @method fire
+		 * @param {String} name Name of the event to fire.
+		 * @param {Object?} args Event arguments.
+		 * @return {Object} Event args instance passed in.
+		 * @example
+		 * instance.fire('event', {...});
+		 */
+		function fire(name, args) {
+			var handlers, i, l, callback;
+
+			name = name.toLowerCase();
+			args = args || {};
+			args.type = name;
+
+			// Setup target is there isn't one
+			if (!args.target) {
+				args.target = scope;
+			}
+
+			// Add event delegation methods if they are missing
+			if (!args.preventDefault) {
+				// Add preventDefault method
+				args.preventDefault = function() {
+					args.isDefaultPrevented = returnTrue;
+				};
+
+				// Add stopPropagation
+				args.stopPropagation = function() {
+					args.isPropagationStopped = returnTrue;
+				};
+
+				// Add stopImmediatePropagation
+				args.stopImmediatePropagation = function() {
+					args.isImmediatePropagationStopped = returnTrue;
+				};
+
+				// Add event delegation states
+				args.isDefaultPrevented = returnFalse;
+				args.isPropagationStopped = returnFalse;
+				args.isImmediatePropagationStopped = returnFalse;
+			}
+
+			if (settings.beforeFire) {
+				settings.beforeFire(args);
+			}
+
+			handlers = bindings[name];
+			if (handlers) {
+				for (i = 0, l = handlers.length; i < l; i++) {
+					callback = handlers[i];
+
+					// Unbind handlers marked with "once"
+					if (callback.once) {
+						off(name, callback.func);
+					}
+
+					// Stop immediate propagation if needed
+					if (args.isImmediatePropagationStopped()) {
+						args.stopPropagation();
+						return args;
+					}
+
+					// If callback returns false then prevent default and stop all propagation
+					if (callback.func.call(scope, args) === false) {
+						args.preventDefault();
+						return args;
+					}
+				}
+			}
+
+			return args;
+		}
+
+		/**
+		 * Binds an event listener to a specific event by name.
+		 *
+		 * @method on
+		 * @param {String} name Event name or space separated list of events to bind.
+		 * @param {callback} callback Callback to be executed when the event occurs.
+		 * @param {Boolean} first Optional flag if the event should be prepended. Use this with care.
+		 * @return {Object} Current class instance.
+		 * @example
+		 * instance.on('event', function(e) {
+		 *     // Callback logic
+		 * });
+		 */
+		function on(name, callback, prepend, extra) {
+			var handlers, names, i;
+
+			if (callback === false) {
+				callback = returnFalse;
+			}
+
+			if (callback) {
+				callback = {
+					func: callback
+				};
+
+				if (extra) {
+					Tools.extend(callback, extra);
+				}
+
+				names = name.toLowerCase().split(' ');
+				i = names.length;
+				while (i--) {
+					name = names[i];
+					handlers = bindings[name];
+					if (!handlers) {
+						handlers = bindings[name] = [];
+						toggleEvent(name, true);
+					}
+
+					if (prepend) {
+						handlers.unshift(callback);
+					} else {
+						handlers.push(callback);
+					}
+				}
+			}
+
+			return self;
+		}
+
+		/**
+		 * Unbinds an event listener to a specific event by name.
+		 *
+		 * @method off
+		 * @param {String?} name Name of the event to unbind.
+		 * @param {callback?} callback Callback to unbind.
+		 * @return {Object} Current class instance.
+		 * @example
+		 * // Unbind specific callback
+		 * instance.off('event', handler);
+		 *
+		 * // Unbind all listeners by name
+		 * instance.off('event');
+		 *
+		 * // Unbind all events
+		 * instance.off();
+		 */
+		function off(name, callback) {
+			var i, handlers, bindingName, names, hi;
+
+			if (name) {
+				names = name.toLowerCase().split(' ');
+				i = names.length;
+				while (i--) {
+					name = names[i];
+					handlers = bindings[name];
+
+					// Unbind all handlers
+					if (!name) {
+						for (bindingName in bindings) {
+							toggleEvent(bindingName, false);
+							delete bindings[bindingName];
+						}
+
+						return self;
+					}
+
+					if (handlers) {
+						// Unbind all by name
+						if (!callback) {
+							handlers.length = 0;
+						} else {
+							// Unbind specific ones
+							hi = handlers.length;
+							while (hi--) {
+								if (handlers[hi].func === callback) {
+									handlers = handlers.slice(0, hi).concat(handlers.slice(hi + 1));
+									bindings[name] = handlers;
+								}
+							}
+						}
+
+						if (!handlers.length) {
+							toggleEvent(name, false);
+							delete bindings[name];
+						}
+					}
+				}
+			} else {
+				for (name in bindings) {
+					toggleEvent(name, false);
+				}
+
+				bindings = {};
+			}
+
+			return self;
+		}
+
+		/**
+		 * Binds an event listener to a specific event by name
+		 * and automatically unbind the event once the callback fires.
+		 *
+		 * @method once
+		 * @param {String} name Event name or space separated list of events to bind.
+		 * @param {callback} callback Callback to be executed when the event occurs.
+		 * @param {Boolean} first Optional flag if the event should be prepended. Use this with care.
+		 * @return {Object} Current class instance.
+		 * @example
+		 * instance.once('event', function(e) {
+		 *     // Callback logic
+		 * });
+		 */
+		function once(name, callback, prepend) {
+			return on(name, callback, prepend, {once: true});
+		}
+
+		/**
+		 * Returns true/false if the dispatcher has a event of the specified name.
+		 *
+		 * @method has
+		 * @param {String} name Name of the event to check for.
+		 * @return {Boolean} true/false if the event exists or not.
+		 */
+		function has(name) {
+			name = name.toLowerCase();
+			return !(!bindings[name] || bindings[name].length === 0);
+		}
+
+		// Expose
+		self.fire = fire;
+		self.on = on;
+		self.off = off;
+		self.once = once;
+		self.has = has;
+	}
+
+	/**
+	 * Returns true/false if the specified event name is a native browser event or not.
+	 *
+	 * @method isNative
+	 * @param {String} name Name to check if it's native.
+	 * @return {Boolean} true/false if the event is native or not.
+	 * @static
+	 */
+	Dispatcher.isNative = function(name) {
+		return !!nativeEvents[name.toLowerCase()];
+	};
+
+	return Dispatcher;
+});
+
+// Included from: js/tinymce/classes/ui/Selector.js
+
+/**
+ * Selector.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*eslint no-nested-ternary:0 */
+
+/**
+ * Selector engine, enables you to select controls by using CSS like expressions.
+ * We currently only support basic CSS expressions to reduce the size of the core
+ * and the ones we support should be enough for most cases.
+ *
+ * @example
+ * Supported expressions:
+ *  element
+ *  element#name
+ *  element.class
+ *  element[attr]
+ *  element[attr*=value]
+ *  element[attr~=value]
+ *  element[attr!=value]
+ *  element[attr^=value]
+ *  element[attr$=value]
+ *  element:<state>
+ *  element:not(<expression>)
+ *  element:first
+ *  element:last
+ *  element:odd
+ *  element:even
+ *  element element
+ *  element > element
+ *
+ * @class tinymce.ui.Selector
+ */
+define("tinymce/ui/Selector", [
+	"tinymce/util/Class"
+], function(Class) {
+	"use strict";
+
+	/**
+	 * Produces an array with a unique set of objects. It will not compare the values
+	 * but the references of the objects.
+	 *
+	 * @private
+	 * @method unqiue
+	 * @param {Array} array Array to make into an array with unique items.
+	 * @return {Array} Array with unique items.
+	 */
+	function unique(array) {
+		var uniqueItems = [], i = array.length, item;
+
+		while (i--) {
+			item = array[i];
+
+			if (!item.__checked) {
+				uniqueItems.push(item);
+				item.__checked = 1;
+			}
+		}
+
+		i = uniqueItems.length;
+		while (i--) {
+			delete uniqueItems[i].__checked;
+		}
+
+		return uniqueItems;
+	}
+
+	var expression = /^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i;
+
+	/*jshint maxlen:255 */
+	/*eslint max-len:0 */
+	var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+		whiteSpace = /^\s*|\s*$/g,
+		Collection;
+
+	var Selector = Class.extend({
+		/**
+		 * Constructs a new Selector instance.
+		 *
+		 * @constructor
+		 * @method init
+		 * @param {String} selector CSS like selector expression.
+		 */
+		init: function(selector) {
+			var match = this.match;
+
+			function compileNameFilter(name) {
+				if (name) {
+					name = name.toLowerCase();
+
+					return function(item) {
+						return name === '*' || item.type === name;
+					};
+				}
+			}
+
+			function compileIdFilter(id) {
+				if (id) {
+					return function(item) {
+						return item._name === id;
+					};
+				}
+			}
+
+			function compileClassesFilter(classes) {
+				if (classes) {
+					classes = classes.split('.');
+
+					return function(item) {
+						var i = classes.length;
+
+						while (i--) {
+							if (!item.hasClass(classes[i])) {
+								return false;
+							}
+						}
+
+						return true;
+					};
+				}
+			}
+
+			function compileAttrFilter(name, cmp, check) {
+				if (name) {
+					return function(item) {
+						var value = item[name] ? item[name]() : '';
+
+						return !cmp ? !!check :
+							cmp === "=" ? value === check :
+							cmp === "*=" ? value.indexOf(check) >= 0 :
+							cmp === "~=" ? (" " + value + " ").indexOf(" " + check + " ") >= 0 :
+							cmp === "!=" ? value != check :
+							cmp === "^=" ? value.indexOf(check) === 0 :
+							cmp === "$=" ? value.substr(value.length - check.length) === check :
+							false;
+					};
+				}
+			}
+
+			function compilePsuedoFilter(name) {
+				var notSelectors;
+
+				if (name) {
+					name = /(?:not\((.+)\))|(.+)/i.exec(name);
+
+					if (!name[1]) {
+						name = name[2];
+
+						return function(item, index, length) {
+							return name === 'first' ? index === 0 :
+								name === 'last' ? index === length - 1 :
+								name === 'even' ? index % 2 === 0 :
+								name === 'odd' ? index % 2 === 1 :
+								item[name] ? item[name]() :
+								false;
+						};
+					} else {
+						// Compile not expression
+						notSelectors = parseChunks(name[1], []);
+
+						return function(item) {
+							return !match(item, notSelectors);
+						};
+					}
+				}
+			}
+
+			function compile(selector, filters, direct) {
+				var parts;
+
+				function add(filter) {
+					if (filter) {
+						filters.push(filter);
+					}
+				}
+
+				// Parse expression into parts
+				parts = expression.exec(selector.replace(whiteSpace, ''));
+
+				add(compileNameFilter(parts[1]));
+				add(compileIdFilter(parts[2]));
+				add(compileClassesFilter(parts[3]));
+				add(compileAttrFilter(parts[4], parts[5], parts[6]));
+				add(compilePsuedoFilter(parts[7]));
+
+				// Mark the filter with psuedo for performance
+				filters.psuedo = !!parts[7];
+				filters.direct = direct;
+
+				return filters;
+			}
+
+			// Parser logic based on Sizzle by John Resig
+			function parseChunks(selector, selectors) {
+				var parts = [], extra, matches, i;
+
+				do {
+					chunker.exec("");
+					matches = chunker.exec(selector);
+
+					if (matches) {
+						selector = matches[3];
+						parts.push(matches[1]);
+
+						if (matches[2]) {
+							extra = matches[3];
+							break;
+						}
+					}
+				} while (matches);
+
+				if (extra) {
+					parseChunks(extra, selectors);
+				}
+
+				selector = [];
+				for (i = 0; i < parts.length; i++) {
+					if (parts[i] != '>') {
+						selector.push(compile(parts[i], [], parts[i - 1] === '>'));
+					}
+				}
+
+				selectors.push(selector);
+
+				return selectors;
+			}
+
+			this._selectors = parseChunks(selector, []);
+		},
+
+		/**
+		 * Returns true/false if the selector matches the specified control.
+		 *
+		 * @method match
+		 * @param {tinymce.ui.Control} control Control to match agains the selector.
+		 * @param {Array} selectors Optional array of selectors, mostly used internally.
+		 * @return {Boolean} true/false state if the control matches or not.
+		 */
+		match: function(control, selectors) {
+			var i, l, si, sl, selector, fi, fl, filters, index, length, siblings, count, item;
+
+			selectors = selectors || this._selectors;
+			for (i = 0, l = selectors.length; i < l; i++) {
+				selector = selectors[i];
+				sl = selector.length;
+				item = control;
+				count = 0;
+
+				for (si = sl - 1; si >= 0; si--) {
+					filters = selector[si];
+
+					while (item) {
+						// Find the index and length since a psuedo filter like :first needs it
+						if (filters.psuedo) {
+							siblings = item.parent().items();
+							index = length = siblings.length;
+							while (index--) {
+								if (siblings[index] === item) {
+									break;
+								}
+							}
+						}
+
+						for (fi = 0, fl = filters.length; fi < fl; fi++) {
+							if (!filters[fi](item, index, length)) {
+								fi = fl + 1;
+								break;
+							}
+						}
+
+						if (fi === fl) {
+							count++;
+							break;
+						} else {
+							// If it didn't match the right most expression then
+							// break since it's no point looking at the parents
+							if (si === sl - 1) {
+								break;
+							}
+						}
+
+						item = item.parent();
+					}
+				}
+
+				// If we found all selectors then return true otherwise continue looking
+				if (count === sl) {
+					return true;
+				}
+			}
+
+			return false;
+		},
+
+		/**
+		 * Returns a tinymce.ui.Collection with matches of the specified selector inside the specified container.
+		 *
+		 * @method find
+		 * @param {tinymce.ui.Control} container Container to look for items in.
+		 * @return {tinymce.ui.Collection} Collection with matched elements.
+		 */
+		find: function(container) {
+			var matches = [], i, l, selectors = this._selectors;
+
+			function collect(items, selector, index) {
+				var i, l, fi, fl, item, filters = selector[index];
+
+				for (i = 0, l = items.length; i < l; i++) {
+					item = items[i];
+
+					// Run each filter agains the item
+					for (fi = 0, fl = filters.length; fi < fl; fi++) {
+						if (!filters[fi](item, i, l)) {
+							fi = fl + 1;
+							break;
+						}
+					}
+
+					// All filters matched the item
+					if (fi === fl) {
+						// Matched item is on the last expression like: panel toolbar [button]
+						if (index == selector.length - 1) {
+							matches.push(item);
+						} else {
+							// Collect next expression type
+							if (item.items) {
+								collect(item.items(), selector, index + 1);
+							}
+						}
+					} else if (filters.direct) {
+						return;
+					}
+
+					// Collect child items
+					if (item.items) {
+						collect(item.items(), selector, index);
+					}
+				}
+			}
+
+			if (container.items) {
+				for (i = 0, l = selectors.length; i < l; i++) {
+					collect(container.items(), selectors[i], 0);
+				}
+
+				// Unique the matches if needed
+				if (l > 1) {
+					matches = unique(matches);
+				}
+			}
+
+			// Fix for circular reference
+			if (!Collection) {
+				// TODO: Fix me!
+				Collection = Selector.Collection;
+			}
+
+			return new Collection(matches);
+		}
+	});
+
+	return Selector;
+});
+
+// Included from: js/tinymce/classes/ui/Collection.js
+
+/**
+ * Collection.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Control collection, this class contains control instances and it enables you to
+ * perform actions on all the contained items. This is very similar to how jQuery works.
+ *
+ * @example
+ * someCollection.show().disabled(true);
+ *
+ * @class tinymce.ui.Collection
+ */
+define("tinymce/ui/Collection", [
+	"tinymce/util/Tools",
+	"tinymce/ui/Selector",
+	"tinymce/util/Class"
+], function(Tools, Selector, Class) {
+	"use strict";
+
+	var Collection, proto, push = Array.prototype.push, slice = Array.prototype.slice;
+
+	proto = {
+		/**
+		 * Current number of contained control instances.
+		 *
+		 * @field length
+		 * @type Number
+		 */
+		length: 0,
+
+		/**
+		 * Constructor for the collection.
+		 *
+		 * @constructor
+		 * @method init
+		 * @param {Array} items Optional array with items to add.
+		 */
+		init: function(items) {
+			if (items) {
+				this.add(items);
+			}
+		},
+
+		/**
+		 * Adds new items to the control collection.
+		 *
+		 * @method add
+		 * @param {Array} items Array if items to add to collection.
+		 * @return {tinymce.ui.Collection} Current collection instance.
+		 */
+		add: function(items) {
+			var self = this;
+
+			// Force single item into array
+			if (!Tools.isArray(items)) {
+				if (items instanceof Collection) {
+					self.add(items.toArray());
+				} else {
+					push.call(self, items);
+				}
+			} else {
+				push.apply(self, items);
+			}
+
+			return self;
+		},
+
+		/**
+		 * Sets the contents of the collection. This will remove any existing items
+		 * and replace them with the ones specified in the input array.
+		 *
+		 * @method set
+		 * @param {Array} items Array with items to set into the Collection.
+		 * @return {tinymce.ui.Collection} Collection instance.
+		 */
+		set: function(items) {
+			var self = this, len = self.length, i;
+
+			self.length = 0;
+			self.add(items);
+
+			// Remove old entries
+			for (i = self.length; i < len; i++) {
+				delete self[i];
+			}
+
+			return self;
+		},
+
+		/**
+		 * Filters the collection item based on the specified selector expression or selector function.
+		 *
+		 * @method filter
+		 * @param {String} selector Selector expression to filter items by.
+		 * @return {tinymce.ui.Collection} Collection containing the filtered items.
+		 */
+		filter: function(selector) {
+			var self = this, i, l, matches = [], item, match;
+
+			// Compile string into selector expression
+			if (typeof selector === "string") {
+				selector = new Selector(selector);
+
+				match = function(item) {
+					return selector.match(item);
+				};
+			} else {
+				// Use selector as matching function
+				match = selector;
+			}
+
+			for (i = 0, l = self.length; i < l; i++) {
+				item = self[i];
+
+				if (match(item)) {
+					matches.push(item);
+				}
+			}
+
+			return new Collection(matches);
+		},
+
+		/**
+		 * Slices the items within the collection.
+		 *
+		 * @method slice
+		 * @param {Number} index Index to slice at.
+		 * @param {Number} len Optional length to slice.
+		 * @return {tinymce.ui.Collection} Current collection.
+		 */
+		slice: function() {
+			return new Collection(slice.apply(this, arguments));
+		},
+
+		/**
+		 * Makes the current collection equal to the specified index.
+		 *
+		 * @method eq
+		 * @param {Number} index Index of the item to set the collection to.
+		 * @return {tinymce.ui.Collection} Current collection.
+		 */
+		eq: function(index) {
+			return index === -1 ? this.slice(index) : this.slice(index, +index + 1);
+		},
+
+		/**
+		 * Executes the specified callback on each item in collection.
+		 *
+		 * @method each
+		 * @param {function} callback Callback to execute for each item in collection.
+		 * @return {tinymce.ui.Collection} Current collection instance.
+		 */
+		each: function(callback) {
+			Tools.each(this, callback);
+
+			return this;
+		},
+
+		/**
+		 * Returns an JavaScript array object of the contents inside the collection.
+		 *
+		 * @method toArray
+		 * @return {Array} Array with all items from collection.
+		 */
+		toArray: function() {
+			return Tools.toArray(this);
+		},
+
+		/**
+		 * Finds the index of the specified control or return -1 if it isn't in the collection.
+		 *
+		 * @method indexOf
+		 * @param {Control} ctrl Control instance to look for.
+		 * @return {Number} Index of the specified control or -1.
+		 */
+		indexOf: function(ctrl) {
+			var self = this, i = self.length;
+
+			while (i--) {
+				if (self[i] === ctrl) {
+					break;
+				}
+			}
+
+			return i;
+		},
+
+		/**
+		 * Returns a new collection of the contents in reverse order.
+		 *
+		 * @method reverse
+		 * @return {tinymce.ui.Collection} Collection instance with reversed items.
+		 */
+		reverse: function() {
+			return new Collection(Tools.toArray(this).reverse());
+		},
+
+		/**
+		 * Returns true/false if the class exists or not.
+		 *
+		 * @method hasClass
+		 * @param {String} cls Class to check for.
+		 * @return {Boolean} true/false state if the class exists or not.
+		 */
+		hasClass: function(cls) {
+			return this[0] ? this[0].hasClass(cls) : false;
+		},
+
+		/**
+		 * Sets/gets the specific property on the items in the collection. The same as executing control.<property>(<value>);
+		 *
+		 * @method prop
+		 * @param {String} name Property name to get/set.
+		 * @param {Object} value Optional object value to set.
+		 * @return {tinymce.ui.Collection} Current collection instance or value of the first item on a get operation.
+		 */
+		prop: function(name, value) {
+			var self = this, undef, item;
+
+			if (value !== undef) {
+				self.each(function(item) {
+					if (item[name]) {
+						item[name](value);
+					}
+				});
+
+				return self;
+			}
+
+			item = self[0];
+
+			if (item && item[name]) {
+				return item[name]();
+			}
+		},
+
+		/**
+		 * Executes the specific function name with optional arguments an all items in collection if it exists.
+		 *
+		 * @example collection.exec("myMethod", arg1, arg2, arg3);
+		 * @method exec
+		 * @param {String} name Name of the function to execute.
+		 * @param {Object} ... Multiple arguments to pass to each function.
+		 * @return {tinymce.ui.Collection} Current collection.
+		 */
+		exec: function(name) {
+			var self = this, args = Tools.toArray(arguments).slice(1);
+
+			self.each(function(item) {
+				if (item[name]) {
+					item[name].apply(item, args);
+				}
+			});
+
+			return self;
+		},
+
+		/**
+		 * Remove all items from collection and DOM.
+		 *
+		 * @method remove
+		 * @return {tinymce.ui.Collection} Current collection.
+		 */
+		remove: function() {
+			var i = this.length;
+
+			while (i--) {
+				this[i].remove();
+			}
+
+			return this;
+		}
+
+		/**
+		 * Fires the specified event by name and arguments on the control. This will execute all
+		 * bound event handlers.
+		 *
+		 * @method fire
+		 * @param {String} name Name of the event to fire.
+		 * @param {Object} args Optional arguments to pass to the event.
+		 * @return {tinymce.ui.Collection} Current collection instance.
+		 */
+		// fire: function(event, args) {}, -- Generated by code below
+
+		/**
+		 * Binds a callback to the specified event. This event can both be
+		 * native browser events like "click" or custom ones like PostRender.
+		 *
+		 * The callback function will have two parameters the first one being the control that received the event
+		 * the second one will be the event object either the browsers native event object or a custom JS object.
+		 *
+		 * @method on
+		 * @param {String} name Name of the event to bind. For example "click".
+		 * @param {String/function} callback Callback function to execute ones the event occurs.
+		 * @return {tinymce.ui.Collection} Current collection instance.
+		 */
+		// on: function(name, callback) {}, -- Generated by code below
+
+		/**
+		 * Unbinds the specified event and optionally a specific callback. If you omit the name
+		 * parameter all event handlers will be removed. If you omit the callback all event handles
+		 * by the specified name will be removed.
+		 *
+		 * @method off
+		 * @param {String} name Optional name for the event to unbind.
+		 * @param {function} callback Optional callback function to unbind.
+		 * @return {tinymce.ui.Collection} Current collection instance.
+		 */
+		// off: function(name, callback) {}, -- Generated by code below
+
+		/**
+		 * Shows the items in the current collection.
+		 *
+		 * @method show
+		 * @return {tinymce.ui.Collection} Current collection instance.
+		 */
+		// show: function() {}, -- Generated by code below
+
+		/**
+		 * Hides the items in the current collection.
+		 *
+		 * @method hide
+		 * @return {tinymce.ui.Collection} Current collection instance.
+		 */
+		// hide: function() {}, -- Generated by code below
+
+		/**
+		 * Sets/gets the text contents of the items in the current collection.
+		 *
+		 * @method text
+		 * @return {tinymce.ui.Collection} Current collection instance or text value of the first item on a get operation.
+		 */
+		// text: function(value) {}, -- Generated by code below
+
+		/**
+		 * Sets/gets the name contents of the items in the current collection.
+		 *
+		 * @method name
+		 * @return {tinymce.ui.Collection} Current collection instance or name value of the first item on a get operation.
+		 */
+		// name: function(value) {}, -- Generated by code below
+
+		/**
+		 * Sets/gets the disabled state on the items in the current collection.
+		 *
+		 * @method disabled
+		 * @return {tinymce.ui.Collection} Current collection instance or disabled state of the first item on a get operation.
+		 */
+		// disabled: function(state) {}, -- Generated by code below
+
+		/**
+		 * Sets/gets the active state on the items in the current collection.
+		 *
+		 * @method active
+		 * @return {tinymce.ui.Collection} Current collection instance or active state of the first item on a get operation.
+		 */
+		// active: function(state) {}, -- Generated by code below
+
+		/**
+		 * Sets/gets the selected state on the items in the current collection.
+		 *
+		 * @method selected
+		 * @return {tinymce.ui.Collection} Current collection instance or selected state of the first item on a get operation.
+		 */
+		// selected: function(state) {}, -- Generated by code below
+
+		/**
+		 * Sets/gets the selected state on the items in the current collection.
+		 *
+		 * @method visible
+		 * @return {tinymce.ui.Collection} Current collection instance or visible state of the first item on a get operation.
+		 */
+		// visible: function(state) {}, -- Generated by code below
+
+		/**
+		 * Adds a class to all items in the collection.
+		 *
+		 * @method addClass
+		 * @param {String} cls Class to add to each item.
+		 * @return {tinymce.ui.Collection} Current collection instance.
+		 */
+		// addClass: function(cls) {}, -- Generated by code below
+
+		/**
+		 * Removes the specified class from all items in collection.
+		 *
+		 * @method removeClass
+		 * @param {String} cls Class to remove from each item.
+		 * @return {tinymce.ui.Collection} Current collection instance.
+		 */
+		// removeClass: function(cls) {}, -- Generated by code below
+	};
+
+	// Extend tinymce.ui.Collection prototype with some generated control specific methods
+	Tools.each('fire on off show hide addClass removeClass append prepend before after reflow'.split(' '), function(name) {
+		proto[name] = function() {
+			var args = Tools.toArray(arguments);
+
+			this.each(function(ctrl) {
+				if (name in ctrl) {
+					ctrl[name].apply(ctrl, args);
+				}
+			});
+
+			return this;
+		};
+	});
+
+	// Extend tinymce.ui.Collection prototype with some property methods
+	Tools.each('text name disabled active selected checked visible parent value data'.split(' '), function(name) {
+		proto[name] = function(value) {
+			return this.prop(name, value);
+		};
+	});
+
+	// Create class based on the new prototype
+	Collection = Class.extend(proto);
+
+	// Stick Collection into Selector to prevent circual references
+	Selector.Collection = Collection;
+
+	return Collection;
+});
+
+// Included from: js/tinymce/classes/ui/DomUtils.js
+
+/**
+ * DOMUtils.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+define("tinymce/ui/DomUtils", [
+	"tinymce/util/Tools",
+	"tinymce/dom/DOMUtils"
+], function(Tools, DOMUtils) {
+	"use strict";
+
+	var count = 0;
+
+	return {
+		id: function() {
+			return 'mceu_' + (count++);
+		},
+
+		createFragment: function(html) {
+			return DOMUtils.DOM.createFragment(html);
+		},
+
+		getWindowSize: function() {
+			return DOMUtils.DOM.getViewPort();
+		},
+
+		getSize: function(elm) {
+			var width, height;
+
+			if (elm.getBoundingClientRect) {
+				var rect = elm.getBoundingClientRect();
+
+				width = Math.max(rect.width || (rect.right - rect.left), elm.offsetWidth);
+				height = Math.max(rect.height || (rect.bottom - rect.bottom), elm.offsetHeight);
+			} else {
+				width = elm.offsetWidth;
+				height = elm.offsetHeight;
+			}
+
+			return {width: width, height: height};
+		},
+
+		getPos: function(elm, root) {
+			return DOMUtils.DOM.getPos(elm, root);
+		},
+
+		getViewPort: function(win) {
+			return DOMUtils.DOM.getViewPort(win);
+		},
+
+		get: function(id) {
+			return document.getElementById(id);
+		},
+
+		addClass: function(elm, cls) {
+			return DOMUtils.DOM.addClass(elm, cls);
+		},
+
+		removeClass: function(elm, cls) {
+			return DOMUtils.DOM.removeClass(elm, cls);
+		},
+
+		hasClass: function(elm, cls) {
+			return DOMUtils.DOM.hasClass(elm, cls);
+		},
+
+		toggleClass: function(elm, cls, state) {
+			return DOMUtils.DOM.toggleClass(elm, cls, state);
+		},
+
+		css: function(elm, name, value) {
+			return DOMUtils.DOM.setStyle(elm, name, value);
+		},
+
+		getRuntimeStyle: function(elm, name) {
+			return DOMUtils.DOM.getStyle(elm, name, true);
+		},
+
+		on: function(target, name, callback, scope) {
+			return DOMUtils.DOM.bind(target, name, callback, scope);
+		},
+
+		off: function(target, name, callback) {
+			return DOMUtils.DOM.unbind(target, name, callback);
+		},
+
+		fire: function(target, name, args) {
+			return DOMUtils.DOM.fire(target, name, args);
+		},
+
+		innerHtml: function(elm, html) {
+			// Workaround for <div> in <p> bug on IE 8 #6178
+			DOMUtils.DOM.setHTML(elm, html);
+		}
+	};
+});
+
+// Included from: js/tinymce/classes/ui/Control.js
+
+/**
+ * Control.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*eslint consistent-this:0 */
+
+/**
+ * This is the base class for all controls and containers. All UI control instances inherit
+ * from this one as it has the base logic needed by all of them.
+ *
+ * @class tinymce.ui.Control
+ */
+define("tinymce/ui/Control", [
+	"tinymce/util/Class",
+	"tinymce/util/Tools",
+	"tinymce/util/EventDispatcher",
+	"tinymce/ui/Collection",
+	"tinymce/ui/DomUtils"
+], function(Class, Tools, EventDispatcher, Collection, DomUtils) {
+	"use strict";
+
+	var hasMouseWheelEventSupport = "onmousewheel" in document;
+	var hasWheelEventSupport = false;
+	var classPrefix = "mce-";
+
+	function getEventDispatcher(obj) {
+		if (!obj._eventDispatcher) {
+			obj._eventDispatcher = new EventDispatcher({
+				scope: obj,
+				toggleEvent: function(name, state) {
+					if (state && EventDispatcher.isNative(name)) {
+						if (!obj._nativeEvents) {
+							obj._nativeEvents = {};
+						}
+
+						obj._nativeEvents[name] = true;
+
+						if (obj._rendered) {
+							obj.bindPendingEvents();
+						}
+					}
+				}
+			});
+		}
+
+		return obj._eventDispatcher;
+	}
+
+	var Control = Class.extend({
+		Statics: {
+			classPrefix: classPrefix
+		},
+
+		isRtl: function() {
+			return Control.rtl;
+		},
+
+		/**
+		 * Class/id prefix to use for all controls.
+		 *
+		 * @final
+		 * @field {String} classPrefix
+		 */
+		classPrefix: classPrefix,
+
+		/**
+		 * Constructs a new control instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {String} style Style CSS properties to add.
+		 * @setting {String} border Border box values example: 1 1 1 1
+		 * @setting {String} padding Padding box values example: 1 1 1 1
+		 * @setting {String} margin Margin box values example: 1 1 1 1
+		 * @setting {Number} minWidth Minimal width for the control.
+		 * @setting {Number} minHeight Minimal height for the control.
+		 * @setting {String} classes Space separated list of classes to add.
+		 * @setting {String} role WAI-ARIA role to use for control.
+		 * @setting {Boolean} hidden Is the control hidden by default.
+		 * @setting {Boolean} disabled Is the control disabled by default.
+		 * @setting {String} name Name of the control instance.
+		 */
+		init: function(settings) {
+			var self = this, classes, i;
+
+			self.settings = settings = Tools.extend({}, self.Defaults, settings);
+
+			// Initial states
+			self._id = settings.id || DomUtils.id();
+			self._text = self._name = '';
+			self._width = self._height = 0;
+			self._aria = {role: settings.role};
+			this._elmCache = {};
+
+			// Setup classes
+			classes = settings.classes;
+			if (classes) {
+				classes = classes.split(' ');
+				classes.map = {};
+				i = classes.length;
+				while (i--) {
+					classes.map[classes[i]] = true;
+				}
+			}
+
+			self._classes = classes || [];
+			self.visible(true);
+
+			// Set some properties
+			Tools.each('title text width height name classes visible disabled active value'.split(' '), function(name) {
+				var value = settings[name], undef;
+
+				if (value !== undef) {
+					self[name](value);
+				} else if (self['_' + name] === undef) {
+					self['_' + name] = false;
+				}
+			});
+
+			self.on('click', function() {
+				if (self.disabled()) {
+					return false;
+				}
+			});
+
+			// TODO: Is this needed duplicate code see above?
+			if (settings.classes) {
+				Tools.each(settings.classes.split(' '), function(cls) {
+					self.addClass(cls);
+				});
+			}
+
+			/**
+			 * Name/value object with settings for the current control.
+			 *
+			 * @field {Object} settings
+			 */
+			self.settings = settings;
+
+			self._borderBox = self.parseBox(settings.border);
+			self._paddingBox = self.parseBox(settings.padding);
+			self._marginBox = self.parseBox(settings.margin);
+
+			if (settings.hidden) {
+				self.hide();
+			}
+		},
+
+		// Will generate getter/setter methods for these properties
+		Properties: 'parent,title,text,width,height,disabled,active,name,value',
+
+		// Will generate empty dummy functions for these
+		Methods: 'renderHtml',
+
+		/**
+		 * Returns the root element to render controls into.
+		 *
+		 * @method getContainerElm
+		 * @return {Element} HTML DOM element to render into.
+		 */
+		getContainerElm: function() {
+			return document.body;
+		},
+
+		/**
+		 * Returns a control instance for the current DOM element.
+		 *
+		 * @method getParentCtrl
+		 * @param {Element} elm HTML dom element to get parent control from.
+		 * @return {tinymce.ui.Control} Control instance or undefined.
+		 */
+		getParentCtrl: function(elm) {
+			var ctrl, lookup = this.getRoot().controlIdLookup;
+
+			while (elm && lookup) {
+				ctrl = lookup[elm.id];
+				if (ctrl) {
+					break;
+				}
+
+				elm = elm.parentNode;
+			}
+
+			return ctrl;
+		},
+
+		/**
+		 * Parses the specified box value. A box value contains 1-4 properties in clockwise order.
+		 *
+		 * @method parseBox
+		 * @param {String/Number} value Box value "0 1 2 3" or "0" etc.
+		 * @return {Object} Object with top/right/bottom/left properties.
+		 * @private
+		 */
+		parseBox: function(value) {
+			var len, radix = 10;
+
+			if (!value) {
+				return;
+			}
+
+			if (typeof value === "number") {
+				value = value || 0;
+
+				return {
+					top: value,
+					left: value,
+					bottom: value,
+					right: value
+				};
+			}
+
+			value = value.split(' ');
+			len = value.length;
+
+			if (len === 1) {
+				value[1] = value[2] = value[3] = value[0];
+			} else if (len === 2) {
+				value[2] = value[0];
+				value[3] = value[1];
+			} else if (len === 3) {
+				value[3] = value[1];
+			}
+
+			return {
+				top: parseInt(value[0], radix) || 0,
+				right: parseInt(value[1], radix) || 0,
+				bottom: parseInt(value[2], radix) || 0,
+				left: parseInt(value[3], radix) || 0
+			};
+		},
+
+		borderBox: function() {
+			return this._borderBox;
+		},
+
+		paddingBox: function() {
+			return this._paddingBox;
+		},
+
+		marginBox: function() {
+			return this._marginBox;
+		},
+
+		measureBox: function(elm, prefix) {
+			function getStyle(name) {
+				var defaultView = document.defaultView;
+
+				if (defaultView) {
+					// Remove camelcase
+					name = name.replace(/[A-Z]/g, function(a) {
+						return '-' + a;
+					});
+
+					return defaultView.getComputedStyle(elm, null).getPropertyValue(name);
+				}
+
+				return elm.currentStyle[name];
+			}
+
+			function getSide(name) {
+				var val = parseFloat(getStyle(name), 10);
+
+				return isNaN(val) ? 0 : val;
+			}
+
+			return {
+				top: getSide(prefix + "TopWidth"),
+				right: getSide(prefix + "RightWidth"),
+				bottom: getSide(prefix + "BottomWidth"),
+				left: getSide(prefix + "LeftWidth")
+			};
+		},
+
+		/**
+		 * Initializes the current controls layout rect.
+		 * This will be executed by the layout managers to determine the
+		 * default minWidth/minHeight etc.
+		 *
+		 * @method initLayoutRect
+		 * @return {Object} Layout rect instance.
+		 */
+		initLayoutRect: function() {
+			var self = this, settings = self.settings, borderBox, layoutRect;
+			var elm = self.getEl(), width, height, minWidth, minHeight, autoResize;
+			var startMinWidth, startMinHeight, initialSize;
+
+			// Measure the current element
+			borderBox = self._borderBox = self._borderBox || self.measureBox(elm, 'border');
+			self._paddingBox = self._paddingBox || self.measureBox(elm, 'padding');
+			self._marginBox = self._marginBox || self.measureBox(elm, 'margin');
+			initialSize = DomUtils.getSize(elm);
+
+			// Setup minWidth/minHeight and width/height
+			startMinWidth = settings.minWidth;
+			startMinHeight = settings.minHeight;
+			minWidth = startMinWidth || initialSize.width;
+			minHeight = startMinHeight || initialSize.height;
+			width = settings.width;
+			height = settings.height;
+			autoResize = settings.autoResize;
+			autoResize = typeof autoResize != "undefined" ? autoResize : !width && !height;
+
+			width = width || minWidth;
+			height = height || minHeight;
+
+			var deltaW = borderBox.left + borderBox.right;
+			var deltaH = borderBox.top + borderBox.bottom;
+
+			var maxW = settings.maxWidth || 0xFFFF;
+			var maxH = settings.maxHeight || 0xFFFF;
+
+			// Setup initial layout rect
+			self._layoutRect = layoutRect = {
+				x: settings.x || 0,
+				y: settings.y || 0,
+				w: width,
+				h: height,
+				deltaW: deltaW,
+				deltaH: deltaH,
+				contentW: width - deltaW,
+				contentH: height - deltaH,
+				innerW: width - deltaW,
+				innerH: height - deltaH,
+				startMinWidth: startMinWidth || 0,
+				startMinHeight: startMinHeight || 0,
+				minW: Math.min(minWidth, maxW),
+				minH: Math.min(minHeight, maxH),
+				maxW: maxW,
+				maxH: maxH,
+				autoResize: autoResize,
+				scrollW: 0
+			};
+
+			self._lastLayoutRect = {};
+
+			return layoutRect;
+		},
+
+		/**
+		 * Getter/setter for the current layout rect.
+		 *
+		 * @method layoutRect
+		 * @param {Object} [newRect] Optional new layout rect.
+		 * @return {tinymce.ui.Control/Object} Current control or rect object.
+		 */
+		layoutRect: function(newRect) {
+			var self = this, curRect = self._layoutRect, lastLayoutRect, size, deltaWidth, deltaHeight, undef, repaintControls;
+
+			// Initialize default layout rect
+			if (!curRect) {
+				curRect = self.initLayoutRect();
+			}
+
+			// Set new rect values
+			if (newRect) {
+				// Calc deltas between inner and outer sizes
+				deltaWidth = curRect.deltaW;
+				deltaHeight = curRect.deltaH;
+
+				// Set x position
+				if (newRect.x !== undef) {
+					curRect.x = newRect.x;
+				}
+
+				// Set y position
+				if (newRect.y !== undef) {
+					curRect.y = newRect.y;
+				}
+
+				// Set minW
+				if (newRect.minW !== undef) {
+					curRect.minW = newRect.minW;
+				}
+
+				// Set minH
+				if (newRect.minH !== undef) {
+					curRect.minH = newRect.minH;
+				}
+
+				// Set new width and calculate inner width
+				size = newRect.w;
+				if (size !== undef) {
+					size = size < curRect.minW ? curRect.minW : size;
+					size = size > curRect.maxW ? curRect.maxW : size;
+					curRect.w = size;
+					curRect.innerW = size - deltaWidth;
+				}
+
+				// Set new height and calculate inner height
+				size = newRect.h;
+				if (size !== undef) {
+					size = size < curRect.minH ? curRect.minH : size;
+					size = size > curRect.maxH ? curRect.maxH : size;
+					curRect.h = size;
+					curRect.innerH = size - deltaHeight;
+				}
+
+				// Set new inner width and calculate width
+				size = newRect.innerW;
+				if (size !== undef) {
+					size = size < curRect.minW - deltaWidth ? curRect.minW - deltaWidth : size;
+					size = size > curRect.maxW - deltaWidth ? curRect.maxW - deltaWidth : size;
+					curRect.innerW = size;
+					curRect.w = size + deltaWidth;
+				}
+
+				// Set new height and calculate inner height
+				size = newRect.innerH;
+				if (size !== undef) {
+					size = size < curRect.minH - deltaHeight ? curRect.minH - deltaHeight : size;
+					size = size > curRect.maxH - deltaHeight ? curRect.maxH - deltaHeight : size;
+					curRect.innerH = size;
+					curRect.h = size + deltaHeight;
+				}
+
+				// Set new contentW
+				if (newRect.contentW !== undef) {
+					curRect.contentW = newRect.contentW;
+				}
+
+				// Set new contentH
+				if (newRect.contentH !== undef) {
+					curRect.contentH = newRect.contentH;
+				}
+
+				// Compare last layout rect with the current one to see if we need to repaint or not
+				lastLayoutRect = self._lastLayoutRect;
+				if (lastLayoutRect.x !== curRect.x || lastLayoutRect.y !== curRect.y ||
+					lastLayoutRect.w !== curRect.w || lastLayoutRect.h !== curRect.h) {
+					repaintControls = Control.repaintControls;
+
+					if (repaintControls) {
+						if (repaintControls.map && !repaintControls.map[self._id]) {
+							repaintControls.push(self);
+							repaintControls.map[self._id] = true;
+						}
+					}
+
+					lastLayoutRect.x = curRect.x;
+					lastLayoutRect.y = curRect.y;
+					lastLayoutRect.w = curRect.w;
+					lastLayoutRect.h = curRect.h;
+				}
+
+				return self;
+			}
+
+			return curRect;
+		},
+
+		/**
+		 * Repaints the control after a layout operation.
+		 *
+		 * @method repaint
+		 */
+		repaint: function() {
+			var self = this, style, bodyStyle, rect, borderBox, borderW = 0, borderH = 0, lastRepaintRect, round;
+
+			// Use Math.round on all values on IE < 9
+			round = !document.createRange ? Math.round : function(value) {
+				return value;
+			};
+
+			style = self.getEl().style;
+			rect = self._layoutRect;
+			lastRepaintRect = self._lastRepaintRect || {};
+
+			borderBox = self._borderBox;
+			borderW = borderBox.left + borderBox.right;
+			borderH = borderBox.top + borderBox.bottom;
+
+			if (rect.x !== lastRepaintRect.x) {
+				style.left = round(rect.x) + 'px';
+				lastRepaintRect.x = rect.x;
+			}
+
+			if (rect.y !== lastRepaintRect.y) {
+				style.top = round(rect.y) + 'px';
+				lastRepaintRect.y = rect.y;
+			}
+
+			if (rect.w !== lastRepaintRect.w) {
+				style.width = round(rect.w - borderW) + 'px';
+				lastRepaintRect.w = rect.w;
+			}
+
+			if (rect.h !== lastRepaintRect.h) {
+				style.height = round(rect.h - borderH) + 'px';
+				lastRepaintRect.h = rect.h;
+			}
+
+			// Update body if needed
+			if (self._hasBody && rect.innerW !== lastRepaintRect.innerW) {
+				bodyStyle = self.getEl('body').style;
+				bodyStyle.width = round(rect.innerW) + 'px';
+				lastRepaintRect.innerW = rect.innerW;
+			}
+
+			if (self._hasBody && rect.innerH !== lastRepaintRect.innerH) {
+				bodyStyle = bodyStyle || self.getEl('body').style;
+				bodyStyle.height = round(rect.innerH) + 'px';
+				lastRepaintRect.innerH = rect.innerH;
+			}
+
+			self._lastRepaintRect = lastRepaintRect;
+			self.fire('repaint', {}, false);
+		},
+
+		/**
+		 * Binds a callback to the specified event. This event can both be
+		 * native browser events like "click" or custom ones like PostRender.
+		 *
+		 * The callback function will be passed a DOM event like object that enables yout do stop propagation.
+		 *
+		 * @method on
+		 * @param {String} name Name of the event to bind. For example "click".
+		 * @param {String/function} callback Callback function to execute ones the event occurs.
+		 * @return {tinymce.ui.Control} Current control object.
+		 */
+		on: function(name, callback) {
+			var self = this;
+
+			function resolveCallbackName(name) {
+				var callback, scope;
+
+				if (typeof name != 'string') {
+					return name;
+				}
+
+				return function(e) {
+					if (!callback) {
+						self.parentsAndSelf().each(function(ctrl) {
+							var callbacks = ctrl.settings.callbacks;
+
+							if (callbacks && (callback = callbacks[name])) {
+								scope = ctrl;
+								return false;
+							}
+						});
+					}
+
+					return callback.call(scope, e);
+				};
+			}
+
+			getEventDispatcher(self).on(name, resolveCallbackName(callback));
+
+			return self;
+		},
+
+		/**
+		 * Unbinds the specified event and optionally a specific callback. If you omit the name
+		 * parameter all event handlers will be removed. If you omit the callback all event handles
+		 * by the specified name will be removed.
+		 *
+		 * @method off
+		 * @param {String} [name] Name for the event to unbind.
+		 * @param {function} [callback] Callback function to unbind.
+		 * @return {mxex.ui.Control} Current control object.
+		 */
+		off: function(name, callback) {
+			getEventDispatcher(this).off(name, callback);
+			return this;
+		},
+
+		/**
+		 * Fires the specified event by name and arguments on the control. This will execute all
+		 * bound event handlers.
+		 *
+		 * @method fire
+		 * @param {String} name Name of the event to fire.
+		 * @param {Object} [args] Arguments to pass to the event.
+		 * @param {Boolean} [bubble] Value to control bubbeling. Defaults to true.
+		 * @return {Object} Current arguments object.
+		 */
+		fire: function(name, args, bubble) {
+			var self = this;
+
+			args = args || {};
+
+			if (!args.control) {
+				args.control = self;
+			}
+
+			args = getEventDispatcher(self).fire(name, args);
+
+			// Bubble event up to parents
+			if (bubble !== false && self.parent) {
+				var parent = self.parent();
+				while (parent && !args.isPropagationStopped()) {
+					parent.fire(name, args, false);
+					parent = parent.parent();
+				}
+			}
+
+			return args;
+		},
+
+		/**
+		 * Returns true/false if the specified event has any listeners.
+		 *
+		 * @method hasEventListeners
+		 * @param {String} name Name of the event to check for.
+		 * @return {Boolean} True/false state if the event has listeners.
+		 */
+		hasEventListeners: function(name) {
+			return getEventDispatcher(this).has(name);
+		},
+
+		/**
+		 * Returns a control collection with all parent controls.
+		 *
+		 * @method parents
+		 * @param {String} selector Optional selector expression to find parents.
+		 * @return {tinymce.ui.Collection} Collection with all parent controls.
+		 */
+		parents: function(selector) {
+			var self = this, ctrl, parents = new Collection();
+
+			// Add each parent to collection
+			for (ctrl = self.parent(); ctrl; ctrl = ctrl.parent()) {
+				parents.add(ctrl);
+			}
+
+			// Filter away everything that doesn't match the selector
+			if (selector) {
+				parents = parents.filter(selector);
+			}
+
+			return parents;
+		},
+
+		/**
+		 * Returns the current control and it's parents.
+		 *
+		 * @method parentsAndSelf
+		 * @param {String} selector Optional selector expression to find parents.
+		 * @return {tinymce.ui.Collection} Collection with all parent controls.
+		 */
+		parentsAndSelf: function(selector) {
+			return new Collection(this).add(this.parents(selector));
+		},
+
+		/**
+		 * Returns the control next to the current control.
+		 *
+		 * @method next
+		 * @return {tinymce.ui.Control} Next control instance.
+		 */
+		next: function() {
+			var parentControls = this.parent().items();
+
+			return parentControls[parentControls.indexOf(this) + 1];
+		},
+
+		/**
+		 * Returns the control previous to the current control.
+		 *
+		 * @method prev
+		 * @return {tinymce.ui.Control} Previous control instance.
+		 */
+		prev: function() {
+			var parentControls = this.parent().items();
+
+			return parentControls[parentControls.indexOf(this) - 1];
+		},
+
+		/**
+		 * Find the common ancestor for two control instances.
+		 *
+		 * @method findCommonAncestor
+		 * @param {tinymce.ui.Control} ctrl1 First control.
+		 * @param {tinymce.ui.Control} ctrl2 Second control.
+		 * @return {tinymce.ui.Control} Ancestor control instance.
+		 */
+		findCommonAncestor: function(ctrl1, ctrl2) {
+			var parentCtrl;
+
+			while (ctrl1) {
+				parentCtrl = ctrl2;
+
+				while (parentCtrl && ctrl1 != parentCtrl) {
+					parentCtrl = parentCtrl.parent();
+				}
+
+				if (ctrl1 == parentCtrl) {
+					break;
+				}
+
+				ctrl1 = ctrl1.parent();
+			}
+
+			return ctrl1;
+		},
+
+		/**
+		 * Returns true/false if the specific control has the specific class.
+		 *
+		 * @method hasClass
+		 * @param {String} cls Class to check for.
+		 * @param {String} [group] Sub element group name.
+		 * @return {Boolean} True/false if the control has the specified class.
+		 */
+		hasClass: function(cls, group) {
+			var classes = this._classes[group || 'control'];
+
+			cls = this.classPrefix + cls;
+
+			return classes && !!classes.map[cls];
+		},
+
+		/**
+		 * Adds the specified class to the control
+		 *
+		 * @method addClass
+		 * @param {String} cls Class to check for.
+		 * @param {String} [group] Sub element group name.
+		 * @return {tinymce.ui.Control} Current control object.
+		 */
+		addClass: function(cls, group) {
+			var self = this, classes, elm;
+
+			cls = this.classPrefix + cls;
+			classes = self._classes[group || 'control'];
+
+			if (!classes) {
+				classes = [];
+				classes.map = {};
+				self._classes[group || 'control'] = classes;
+			}
+
+			if (!classes.map[cls]) {
+				classes.map[cls] = cls;
+				classes.push(cls);
+
+				if (self._rendered) {
+					elm = self.getEl(group);
+
+					if (elm) {
+						elm.className = classes.join(' ');
+					}
+				}
+			}
+
+			return self;
+		},
+
+		/**
+		 * Removes the specified class from the control.
+		 *
+		 * @method removeClass
+		 * @param {String} cls Class to remove.
+		 * @param {String} [group] Sub element group name.
+		 * @return {tinymce.ui.Control} Current control object.
+		 */
+		removeClass: function(cls, group) {
+			var self = this, classes, i, elm;
+
+			cls = this.classPrefix + cls;
+			classes = self._classes[group || 'control'];
+			if (classes && classes.map[cls]) {
+				delete classes.map[cls];
+
+				i = classes.length;
+				while (i--) {
+					if (classes[i] === cls) {
+						classes.splice(i, 1);
+					}
+				}
+			}
+
+			if (self._rendered) {
+				elm = self.getEl(group);
+
+				if (elm) {
+					elm.className = classes.join(' ');
+				}
+			}
+
+			return self;
+		},
+
+		/**
+		 * Toggles the specified class on the control.
+		 *
+		 * @method toggleClass
+		 * @param {String} cls Class to remove.
+		 * @param {Boolean} state True/false state to add/remove class.
+		 * @param {String} [group] Sub element group name.
+		 * @return {tinymce.ui.Control} Current control object.
+		 */
+		toggleClass: function(cls, state, group) {
+			var self = this;
+
+			if (state) {
+				self.addClass(cls, group);
+			} else {
+				self.removeClass(cls, group);
+			}
+
+			return self;
+		},
+
+		/**
+		 * Returns the class string for the specified group name.
+		 *
+		 * @method classes
+		 * @param {String} [group] Group to get clases by.
+		 * @return {String} Classes for the specified group.
+		 */
+		classes: function(group) {
+			var classes = this._classes[group || 'control'];
+
+			return classes ? classes.join(' ') : '';
+		},
+
+		/**
+		 * Sets the inner HTML of the control element.
+		 *
+		 * @method innerHtml
+		 * @param {String} html Html string to set as inner html.
+		 * @return {tinymce.ui.Control} Current control object.
+		 */
+		innerHtml: function(html) {
+			DomUtils.innerHtml(this.getEl(), html);
+			return this;
+		},
+
+		/**
+		 * Returns the control DOM element or sub element.
+		 *
+		 * @method getEl
+		 * @param {String} [suffix] Suffix to get element by.
+		 * @return {Element} HTML DOM element for the current control or it's children.
+		 */
+		getEl: function(suffix) {
+			var id = suffix ? this._id + '-' + suffix : this._id;
+
+			if (!this._elmCache[id]) {
+				this._elmCache[id] = DomUtils.get(id);
+			}
+
+			return this._elmCache[id];
+		},
+
+		/**
+		 * Sets/gets the visible for the control.
+		 *
+		 * @method visible
+		 * @param {Boolean} state Value to set to control.
+		 * @return {Boolean/tinymce.ui.Control} Current control on a set operation or current state on a get.
+		 */
+		visible: function(state) {
+			var self = this, parentCtrl;
+
+			if (typeof state !== "undefined") {
+				if (self._visible !== state) {
+					if (self._rendered) {
+						self.getEl().style.display = state ? '' : 'none';
+					}
+
+					self._visible = state;
+
+					// Parent container needs to reflow
+					parentCtrl = self.parent();
+					if (parentCtrl) {
+						parentCtrl._lastRect = null;
+					}
+
+					self.fire(state ? 'show' : 'hide');
+				}
+
+				return self;
+			}
+
+			return self._visible;
+		},
+
+		/**
+		 * Sets the visible state to true.
+		 *
+		 * @method show
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		show: function() {
+			return this.visible(true);
+		},
+
+		/**
+		 * Sets the visible state to false.
+		 *
+		 * @method hide
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		hide: function() {
+			return this.visible(false);
+		},
+
+		/**
+		 * Focuses the current control.
+		 *
+		 * @method focus
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		focus: function() {
+			try {
+				this.getEl().focus();
+			} catch (ex) {
+				// Ignore IE error
+			}
+
+			return this;
+		},
+
+		/**
+		 * Blurs the current control.
+		 *
+		 * @method blur
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		blur: function() {
+			this.getEl().blur();
+
+			return this;
+		},
+
+		/**
+		 * Sets the specified aria property.
+		 *
+		 * @method aria
+		 * @param {String} name Name of the aria property to set.
+		 * @param {String} value Value of the aria property.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		aria: function(name, value) {
+			var self = this, elm = self.getEl(self.ariaTarget);
+
+			if (typeof value === "undefined") {
+				return self._aria[name];
+			} else {
+				self._aria[name] = value;
+			}
+
+			if (self._rendered) {
+				elm.setAttribute(name == 'role' ? name : 'aria-' + name, value);
+			}
+
+			return self;
+		},
+
+		/**
+		 * Encodes the specified string with HTML entities. It will also
+		 * translate the string to different languages.
+		 *
+		 * @method encode
+		 * @param {String/Object/Array} text Text to entity encode.
+		 * @param {Boolean} [translate=true] False if the contents shouldn't be translated.
+		 * @return {String} Encoded and possible traslated string.
+		 */
+		encode: function(text, translate) {
+			if (translate !== false) {
+				text = this.translate(text);
+			}
+
+			return (text || '').replace(/[&<>"]/g, function(match) {
+				return '&#' + match.charCodeAt(0) + ';';
+			});
+		},
+
+		/**
+		 * Returns the translated string.
+		 *
+		 * @method translate
+		 * @param {String} text Text to translate.
+		 * @return {String} Translated string or the same as the input.
+		 */
+		translate: function(text) {
+			return Control.translate ? Control.translate(text) : text;
+		},
+
+		/**
+		 * Adds items before the current control.
+		 *
+		 * @method before
+		 * @param {Array/tinymce.ui.Collection} items Array of items to prepend before this control.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		before: function(items) {
+			var self = this, parent = self.parent();
+
+			if (parent) {
+				parent.insert(items, parent.items().indexOf(self), true);
+			}
+
+			return self;
+		},
+
+		/**
+		 * Adds items after the current control.
+		 *
+		 * @method after
+		 * @param {Array/tinymce.ui.Collection} items Array of items to append after this control.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		after: function(items) {
+			var self = this, parent = self.parent();
+
+			if (parent) {
+				parent.insert(items, parent.items().indexOf(self));
+			}
+
+			return self;
+		},
+
+		/**
+		 * Removes the current control from DOM and from UI collections.
+		 *
+		 * @method remove
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		remove: function() {
+			var self = this, elm = self.getEl(), parent = self.parent(), newItems, i;
+
+			if (self.items) {
+				var controls = self.items().toArray();
+				i = controls.length;
+				while (i--) {
+					controls[i].remove();
+				}
+			}
+
+			if (parent && parent.items) {
+				newItems = [];
+
+				parent.items().each(function(item) {
+					if (item !== self) {
+						newItems.push(item);
+					}
+				});
+
+				parent.items().set(newItems);
+				parent._lastRect = null;
+			}
+
+			if (self._eventsRoot && self._eventsRoot == self) {
+				DomUtils.off(elm);
+			}
+
+			var lookup = self.getRoot().controlIdLookup;
+			if (lookup) {
+				delete lookup[self._id];
+			}
+
+			if (elm && elm.parentNode) {
+				elm.parentNode.removeChild(elm);
+			}
+
+			self._rendered = false;
+
+			return self;
+		},
+
+		/**
+		 * Renders the control before the specified element.
+		 *
+		 * @method renderBefore
+		 * @param {Element} elm Element to render before.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		renderBefore: function(elm) {
+			var self = this;
+
+			elm.parentNode.insertBefore(DomUtils.createFragment(self.renderHtml()), elm);
+			self.postRender();
+
+			return self;
+		},
+
+		/**
+		 * Renders the control to the specified element.
+		 *
+		 * @method renderBefore
+		 * @param {Element} elm Element to render to.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		renderTo: function(elm) {
+			var self = this;
+
+			elm = elm || self.getContainerElm();
+			elm.appendChild(DomUtils.createFragment(self.renderHtml()));
+			self.postRender();
+
+			return self;
+		},
+
+		/**
+		 * Post render method. Called after the control has been rendered to the target.
+		 *
+		 * @method postRender
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		postRender: function() {
+			var self = this, settings = self.settings, elm, box, parent, name, parentEventsRoot;
+
+			// Bind on<event> settings
+			for (name in settings) {
+				if (name.indexOf("on") === 0) {
+					self.on(name.substr(2), settings[name]);
+				}
+			}
+
+			if (self._eventsRoot) {
+				for (parent = self.parent(); !parentEventsRoot && parent; parent = parent.parent()) {
+					parentEventsRoot = parent._eventsRoot;
+				}
+
+				if (parentEventsRoot) {
+					for (name in parentEventsRoot._nativeEvents) {
+						self._nativeEvents[name] = true;
+					}
+				}
+			}
+
+			self.bindPendingEvents();
+
+			if (settings.style) {
+				elm = self.getEl();
+				if (elm) {
+					elm.setAttribute('style', settings.style);
+					elm.style.cssText = settings.style;
+				}
+			}
+
+			if (!self._visible) {
+				DomUtils.css(self.getEl(), 'display', 'none');
+			}
+
+			if (self.settings.border) {
+				box = self.borderBox();
+				DomUtils.css(self.getEl(), {
+					'border-top-width': box.top,
+					'border-right-width': box.right,
+					'border-bottom-width': box.bottom,
+					'border-left-width': box.left
+				});
+			}
+
+			// Add instance to lookup
+			var root = self.getRoot();
+			if (!root.controlIdLookup) {
+				root.controlIdLookup = {};
+			}
+
+			root.controlIdLookup[self._id] = self;
+
+			for (var key in self._aria) {
+				self.aria(key, self._aria[key]);
+			}
+
+			self.fire('postrender', {}, false);
+		},
+
+		/**
+		 * Scrolls the current control into view.
+		 *
+		 * @method scrollIntoView
+		 * @param {String} align Alignment in view top|center|bottom.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		scrollIntoView: function(align) {
+			function getOffset(elm, rootElm) {
+				var x, y, parent = elm;
+
+				x = y = 0;
+				while (parent && parent != rootElm && parent.nodeType) {
+					x += parent.offsetLeft || 0;
+					y += parent.offsetTop || 0;
+					parent = parent.offsetParent;
+				}
+
+				return {x: x, y: y};
+			}
+
+			var elm = this.getEl(), parentElm = elm.parentNode;
+			var x, y, width, height, parentWidth, parentHeight;
+			var pos = getOffset(elm, parentElm);
+
+			x = pos.x;
+			y = pos.y;
+			width = elm.offsetWidth;
+			height = elm.offsetHeight;
+			parentWidth = parentElm.clientWidth;
+			parentHeight = parentElm.clientHeight;
+
+			if (align == "end") {
+				x -= parentWidth - width;
+				y -= parentHeight - height;
+			} else if (align == "center") {
+				x -= (parentWidth / 2) - (width / 2);
+				y -= (parentHeight / 2) - (height / 2);
+			}
+
+			parentElm.scrollLeft = x;
+			parentElm.scrollTop = y;
+
+			return this;
+		},
+
+		/**
+		 * Binds pending DOM events.
+		 *
+		 * @private
+		 */
+		bindPendingEvents: function() {
+			var self = this, i, l, parents, eventRootCtrl, nativeEvents, name;
+
+			function delegate(e) {
+				var control = self.getParentCtrl(e.target);
+
+				if (control) {
+					control.fire(e.type, e);
+				}
+			}
+
+			function mouseLeaveHandler() {
+				var ctrl = eventRootCtrl._lastHoverCtrl;
+
+				if (ctrl) {
+					ctrl.fire("mouseleave", {target: ctrl.getEl()});
+
+					ctrl.parents().each(function(ctrl) {
+						ctrl.fire("mouseleave", {target: ctrl.getEl()});
+					});
+
+					eventRootCtrl._lastHoverCtrl = null;
+				}
+			}
+
+			function mouseEnterHandler(e) {
+				var ctrl = self.getParentCtrl(e.target), lastCtrl = eventRootCtrl._lastHoverCtrl, idx = 0, i, parents, lastParents;
+
+				// Over on a new control
+				if (ctrl !== lastCtrl) {
+					eventRootCtrl._lastHoverCtrl = ctrl;
+
+					parents = ctrl.parents().toArray().reverse();
+					parents.push(ctrl);
+
+					if (lastCtrl) {
+						lastParents = lastCtrl.parents().toArray().reverse();
+						lastParents.push(lastCtrl);
+
+						for (idx = 0; idx < lastParents.length; idx++) {
+							if (parents[idx] !== lastParents[idx]) {
+								break;
+							}
+						}
+
+						for (i = lastParents.length - 1; i >= idx; i--) {
+							lastCtrl = lastParents[i];
+							lastCtrl.fire("mouseleave", {
+								target: lastCtrl.getEl()
+							});
+						}
+					}
+
+					for (i = idx; i < parents.length; i++) {
+						ctrl = parents[i];
+						ctrl.fire("mouseenter", {
+							target: ctrl.getEl()
+						});
+					}
+				}
+			}
+
+			function fixWheelEvent(e) {
+				e.preventDefault();
+
+				if (e.type == "mousewheel") {
+					e.deltaY = -1 / 40 * e.wheelDelta;
+
+					if (e.wheelDeltaX) {
+						e.deltaX = -1 / 40 * e.wheelDeltaX;
+					}
+				} else {
+					e.deltaX = 0;
+					e.deltaY = e.detail;
+				}
+
+				e = self.fire("wheel", e);
+			}
+
+			self._rendered = true;
+
+			nativeEvents = self._nativeEvents;
+			if (nativeEvents) {
+				// Find event root element if it exists
+				parents = self.parents().toArray();
+				parents.unshift(self);
+				for (i = 0, l = parents.length; !eventRootCtrl && i < l; i++) {
+					eventRootCtrl = parents[i]._eventsRoot;
+				}
+
+				// Event root wasn't found the use the root control
+				if (!eventRootCtrl) {
+					eventRootCtrl = parents[parents.length - 1] || self;
+				}
+
+				// Set the eventsRoot property on children that didn't have it
+				self._eventsRoot = eventRootCtrl;
+				for (l = i, i = 0; i < l; i++) {
+					parents[i]._eventsRoot = eventRootCtrl;
+				}
+
+				var eventRootDelegates = eventRootCtrl._delegates;
+				if (!eventRootDelegates) {
+					eventRootDelegates = eventRootCtrl._delegates = {};
+				}
+
+				// Bind native event delegates
+				for (name in nativeEvents) {
+					if (!nativeEvents) {
+						return false;
+					}
+
+					if (name === "wheel" && !hasWheelEventSupport) {
+						if (hasMouseWheelEventSupport) {
+							DomUtils.on(self.getEl(), "mousewheel", fixWheelEvent);
+						} else {
+							DomUtils.on(self.getEl(), "DOMMouseScroll", fixWheelEvent);
+						}
+
+						continue;
+					}
+
+					// Special treatment for mousenter/mouseleave since these doesn't bubble
+					if (name === "mouseenter" || name === "mouseleave") {
+						// Fake mousenter/mouseleave
+						if (!eventRootCtrl._hasMouseEnter) {
+							DomUtils.on(eventRootCtrl.getEl(), "mouseleave", mouseLeaveHandler);
+							DomUtils.on(eventRootCtrl.getEl(), "mouseover", mouseEnterHandler);
+							eventRootCtrl._hasMouseEnter = 1;
+						}
+					} else if (!eventRootDelegates[name]) {
+						DomUtils.on(eventRootCtrl.getEl(), name, delegate);
+						eventRootDelegates[name] = true;
+					}
+
+					// Remove the event once it's bound
+					nativeEvents[name] = false;
+				}
+			}
+		},
+
+		getRoot: function() {
+			var ctrl = this, rootControl, parents = [];
+
+			while (ctrl) {
+				if (ctrl.rootControl) {
+					rootControl = ctrl.rootControl;
+					break;
+				}
+
+				parents.push(ctrl);
+				rootControl = ctrl;
+				ctrl = ctrl.parent();
+			}
+
+			if (!rootControl) {
+				rootControl = this;
+			}
+
+			var i = parents.length;
+			while (i--) {
+				parents[i].rootControl = rootControl;
+			}
+
+			return rootControl;
+		},
+
+		/**
+		 * Reflows the current control and it's parents.
+		 * This should be used after you for example append children to the current control so
+		 * that the layout managers know that they need to reposition everything.
+		 *
+		 * @example
+		 * container.append({type: 'button', text: 'My button'}).reflow();
+		 *
+		 * @method reflow
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		reflow: function() {
+			this.repaint();
+
+			return this;
+		}
+
+		/**
+		 * Sets/gets the parent container for the control.
+		 *
+		 * @method parent
+		 * @param {tinymce.ui.Container} parent Optional parent to set.
+		 * @return {tinymce.ui.Control} Parent control or the current control on a set action.
+		 */
+		// parent: function(parent) {} -- Generated
+
+		/**
+		 * Sets/gets the text for the control.
+		 *
+		 * @method text
+		 * @param {String} value Value to set to control.
+		 * @return {String/tinymce.ui.Control} Current control on a set operation or current value on a get.
+		 */
+		// text: function(value) {} -- Generated
+
+		/**
+		 * Sets/gets the width for the control.
+		 *
+		 * @method width
+		 * @param {Number} value Value to set to control.
+		 * @return {Number/tinymce.ui.Control} Current control on a set operation or current value on a get.
+		 */
+		// width: function(value) {} -- Generated
+
+		/**
+		 * Sets/gets the height for the control.
+		 *
+		 * @method height
+		 * @param {Number} value Value to set to control.
+		 * @return {Number/tinymce.ui.Control} Current control on a set operation or current value on a get.
+		 */
+		// height: function(value) {} -- Generated
+
+		/**
+		 * Sets/gets the disabled state on the control.
+		 *
+		 * @method disabled
+		 * @param {Boolean} state Value to set to control.
+		 * @return {Boolean/tinymce.ui.Control} Current control on a set operation or current state on a get.
+		 */
+		// disabled: function(state) {} -- Generated
+
+		/**
+		 * Sets/gets the active for the control.
+		 *
+		 * @method active
+		 * @param {Boolean} state Value to set to control.
+		 * @return {Boolean/tinymce.ui.Control} Current control on a set operation or current state on a get.
+		 */
+		// active: function(state) {} -- Generated
+
+		/**
+		 * Sets/gets the name for the control.
+		 *
+		 * @method name
+		 * @param {String} value Value to set to control.
+		 * @return {String/tinymce.ui.Control} Current control on a set operation or current value on a get.
+		 */
+		// name: function(value) {} -- Generated
+
+		/**
+		 * Sets/gets the title for the control.
+		 *
+		 * @method title
+		 * @param {String} value Value to set to control.
+		 * @return {String/tinymce.ui.Control} Current control on a set operation or current value on a get.
+		 */
+		// title: function(value) {} -- Generated
+	});
+
+	return Control;
+});
+
+// Included from: js/tinymce/classes/ui/Factory.js
+
+/**
+ * Factory.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+/**
+ * This class is a factory for control instances. This enables you
+ * to create instances of controls without having to require the UI controls directly.
+ *
+ * It also allow you to override or add new control types.
+ *
+ * @class tinymce.ui.Factory
+ */
+define("tinymce/ui/Factory", [], function() {
+	"use strict";
+
+	var types = {}, namespaceInit;
+
+	return {
+		/**
+		 * Adds a new control instance type to the factory.
+		 *
+		 * @method add
+		 * @param {String} type Type name for example "button".
+		 * @param {function} typeClass Class type function.
+		 */
+		add: function(type, typeClass) {
+			types[type.toLowerCase()] = typeClass;
+		},
+
+		/**
+		 * Returns true/false if the specified type exists or not.
+		 *
+		 * @method has
+		 * @param {String} type Type to look for.
+		 * @return {Boolean} true/false if the control by name exists.
+		 */
+		has: function(type) {
+			return !!types[type.toLowerCase()];
+		},
+
+		/**
+		 * Creates a new control instance based on the settings provided. The instance created will be
+		 * based on the specified type property it can also create whole structures of components out of
+		 * the specified JSON object.
+		 *
+		 * @example
+		 * tinymce.ui.Factory.create({
+		 *     type: 'button',
+		 *     text: 'Hello world!'
+		 * });
+		 *
+		 * @method create
+		 * @param {Object/String} settings Name/Value object with items used to create the type.
+		 * @return {tinymce.ui.Control} Control instance based on the specified type.
+		 */
+		create: function(type, settings) {
+			var ControlType, name, namespace;
+
+			// Build type lookup
+			if (!namespaceInit) {
+				namespace = tinymce.ui;
+
+				for (name in namespace) {
+					types[name.toLowerCase()] = namespace[name];
+				}
+
+				namespaceInit = true;
+			}
+
+			// If string is specified then use it as the type
+			if (typeof type == 'string') {
+				settings = settings || {};
+				settings.type = type;
+			} else {
+				settings = type;
+				type = settings.type;
+			}
+
+			// Find control type
+			type = type.toLowerCase();
+			ControlType = types[type];
+
+			// #if debug
+
+			if (!ControlType) {
+				throw new Error("Could not find control by type: " + type);
+			}
+
+			// #endif
+
+			ControlType = new ControlType(settings);
+			ControlType.type = type; // Set the type on the instance, this will be used by the Selector engine
+
+			return ControlType;
+		}
+	};
+});
+
+// Included from: js/tinymce/classes/ui/KeyboardNavigation.js
+
+/**
+ * KeyboardNavigation.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles keyboard navigation of controls and elements.
+ *
+ * @class tinymce.ui.KeyboardNavigation
+ */
+define("tinymce/ui/KeyboardNavigation", [
+], function() {
+	"use strict";
+
+	/**
+	 * This class handles all keyboard navigation for WAI-ARIA support. Each root container
+	 * gets an instance of this class.
+	 *
+	 * @constructor
+	 */
+	return function(settings) {
+		var root = settings.root, focusedElement, focusedControl;
+
+		try {
+			focusedElement = document.activeElement;
+		} catch (ex) {
+			// IE sometimes fails to return a proper element
+			focusedElement = document.body;
+		}
+
+		focusedControl = root.getParentCtrl(focusedElement);
+
+		/**
+		 * Returns the currently focused elements wai aria role of the currently
+		 * focused element or specified element.
+		 *
+		 * @private
+		 * @param {Element} elm Optional element to get role from.
+		 * @return {String} Role of specified element.
+		 */
+		function getRole(elm) {
+			elm = elm || focusedElement;
+
+			return elm && elm.getAttribute('role');
+		}
+
+		/**
+		 * Returns the wai role of the parent element of the currently
+		 * focused element or specified element.
+		 *
+		 * @private
+		 * @param {Element} elm Optional element to get parent role from.
+		 * @return {String} Role of the first parent that has a role.
+		 */
+		function getParentRole(elm) {
+			var role, parent = elm || focusedElement;
+
+			while ((parent = parent.parentNode)) {
+				if ((role = getRole(parent))) {
+					return role;
+				}
+			}
+		}
+
+		/**
+		 * Returns a wai aria property by name for example aria-selected.
+		 *
+		 * @private
+		 * @param {String} name Name of the aria property to get for example "disabled".
+		 * @return {String} Aria property value.
+		 */
+		function getAriaProp(name) {
+			var elm = focusedElement;
+
+			if (elm) {
+				return elm.getAttribute('aria-' + name);
+			}
+		}
+
+		/**
+		 * Is the element a text input element or not.
+		 *
+		 * @private
+		 * @param {Element} elm Element to check if it's an text input element or not.
+		 * @return {Boolean} True/false if the element is a text element or not.
+		 */
+		function isTextInputElement(elm) {
+			var tagName = elm.tagName.toUpperCase();
+
+			// Notice: since type can be "email" etc we don't check the type
+			// So all input elements gets treated as text input elements
+			return tagName == "INPUT" || tagName == "TEXTAREA";
+		}
+
+		/**
+		 * Returns true/false if the specified element can be focused or not.
+		 *
+		 * @private
+		 * @param {Element} elm DOM element to check if it can be focused or not.
+		 * @return {Boolean} True/false if the element can have focus.
+		 */
+		function canFocus(elm) {
+			if (isTextInputElement(elm) && !elm.hidden) {
+				return true;
+			}
+
+			if (/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell)$/.test(getRole(elm))) {
+				return true;
+			}
+
+			return false;
+		}
+
+		/**
+		 * Returns an array of focusable visible elements within the specified container element.
+		 *
+		 * @private
+		 * @param {Element} elm DOM element to find focusable elements within.
+		 * @return {Array} Array of focusable elements.
+		 */
+		function getFocusElements(elm) {
+			var elements = [];
+
+			function collect(elm) {
+				if (elm.nodeType != 1 || elm.style.display == 'none') {
+					return;
+				}
+
+				if (canFocus(elm)) {
+					elements.push(elm);
+				}
+
+				for (var i = 0; i < elm.childNodes.length; i++) {
+					collect(elm.childNodes[i]);
+				}
+			}
+
+			collect(elm || root.getEl());
+
+			return elements;
+		}
+
+		/**
+		 * Returns the navigation root control for the specified control. The navigation root
+		 * is the control that the keyboard navigation gets scoped to for example a menubar or toolbar group.
+		 * It will look for parents of the specified target control or the currently focused control if this option is omitted.
+		 *
+		 * @private
+		 * @param {tinymce.ui.Control} targetControl Optional target control to find root of.
+		 * @return {tinymce.ui.Control} Navigation root control.
+		 */
+		function getNavigationRoot(targetControl) {
+			var navigationRoot, controls;
+
+			targetControl = targetControl || focusedControl;
+			controls = targetControl.parents().toArray();
+			controls.unshift(targetControl);
+
+			for (var i = 0; i < controls.length; i++) {
+				navigationRoot = controls[i];
+
+				if (navigationRoot.settings.ariaRoot) {
+					break;
+				}
+			}
+
+			return navigationRoot;
+		}
+
+		/**
+		 * Focuses the first item in the specified targetControl element or the last aria index if the
+		 * navigation root has the ariaRemember option enabled.
+		 *
+		 * @private
+		 * @param {tinymce.ui.Control} targetControl Target control to focus the first item in.
+		 */
+		function focusFirst(targetControl) {
+			var navigationRoot = getNavigationRoot(targetControl);
+			var focusElements = getFocusElements(navigationRoot.getEl());
+
+			if (navigationRoot.settings.ariaRemember && "lastAriaIndex" in navigationRoot) {
+				moveFocusToIndex(navigationRoot.lastAriaIndex, focusElements);
+			} else {
+				moveFocusToIndex(0, focusElements);
+			}
+		}
+
+		/**
+		 * Moves the focus to the specified index within the elements list.
+		 * This will scope the index to the size of the element list if it changed.
+		 *
+		 * @private
+		 * @param {Number} idx Specified index to move to.
+		 * @param {Array} elements Array with dom elements to move focus within.
+		 * @return {Number} Input index or a changed index if it was out of range.
+		 */
+		function moveFocusToIndex(idx, elements) {
+			if (idx < 0) {
+				idx = elements.length - 1;
+			} else if (idx >= elements.length) {
+				idx = 0;
+			}
+
+			if (elements[idx]) {
+				elements[idx].focus();
+			}
+
+			return idx;
+		}
+
+		/**
+		 * Moves the focus forwards or backwards.
+		 *
+		 * @private
+		 * @param {Number} dir Direction to move in positive means forward, negative means backwards.
+		 * @param {Array} elements Optional array of elements to move within defaults to the current navigation roots elements.
+		 */
+		function moveFocus(dir, elements) {
+			var idx = -1, navigationRoot = getNavigationRoot();
+
+			elements = elements || getFocusElements(navigationRoot.getEl());
+
+			for (var i = 0; i < elements.length; i++) {
+				if (elements[i] === focusedElement) {
+					idx = i;
+				}
+			}
+
+			idx += dir;
+			navigationRoot.lastAriaIndex = moveFocusToIndex(idx, elements);
+		}
+
+		/**
+		 * Moves the focus to the left this is called by the left key.
+		 *
+		 * @private
+		 */
+		function left() {
+			var parentRole = getParentRole();
+
+			if (parentRole == "tablist") {
+				moveFocus(-1, getFocusElements(focusedElement.parentNode));
+			} else if (focusedControl.parent().submenu) {
+				cancel();
+			} else {
+				moveFocus(-1);
+			}
+		}
+
+		/**
+		 * Moves the focus to the right this is called by the right key.
+		 *
+		 * @private
+		 */
+		function right() {
+			var role = getRole(), parentRole = getParentRole();
+
+			if (parentRole == "tablist") {
+				moveFocus(1, getFocusElements(focusedElement.parentNode));
+			} else if (role == "menuitem" && parentRole == "menu" && getAriaProp('haspopup')) {
+				enter();
+			} else {
+				moveFocus(1);
+			}
+		}
+
+		/**
+		 * Moves the focus to the up this is called by the up key.
+		 *
+		 * @private
+		 */
+		function up() {
+			moveFocus(-1);
+		}
+
+		/**
+		 * Moves the focus to the up this is called by the down key.
+		 *
+		 * @private
+		 */
+		function down() {
+			var role = getRole(), parentRole = getParentRole();
+
+			if (role == "menuitem" && parentRole == "menubar") {
+				enter();
+			} else if (role == "button" && getAriaProp('haspopup')) {
+				enter({key: 'down'});
+			} else {
+				moveFocus(1);
+			}
+		}
+
+		/**
+		 * Moves the focus to the next item or previous item depending on shift key.
+		 *
+		 * @private
+		 * @param {DOMEvent} e DOM event object.
+		 */
+		function tab(e) {
+			var parentRole = getParentRole();
+
+			if (parentRole == "tablist") {
+				var elm = getFocusElements(focusedControl.getEl('body'))[0];
+
+				if (elm) {
+					elm.focus();
+				}
+			} else {
+				moveFocus(e.shiftKey ? -1 : 1);
+			}
+		}
+
+		/**
+		 * Calls the cancel event on the currently focused control. This is normally done using the Esc key.
+		 *
+		 * @private
+		 */
+		function cancel() {
+			focusedControl.fire('cancel');
+		}
+
+		/**
+		 * Calls the click event on the currently focused control. This is normally done using the Enter/Space keys.
+		 *
+		 * @private
+		 * @param {Object} aria Optional aria data to pass along with the enter event.
+		 */
+		function enter(aria) {
+			aria = aria || {};
+			focusedControl.fire('click', {target: focusedElement, aria: aria});
+		}
+
+		root.on('keydown', function(e) {
+			function handleNonTabOrEscEvent(e, handler) {
+				// Ignore non tab keys for text elements
+				if (isTextInputElement(focusedElement)) {
+					return;
+				}
+
+				if (handler(e) !== false) {
+					e.preventDefault();
+				}
+			}
+
+			if (e.isDefaultPrevented()) {
+				return;
+			}
+
+			switch (e.keyCode) {
+				case 37: // DOM_VK_LEFT
+					handleNonTabOrEscEvent(e, left);
+					break;
+
+				case 39: // DOM_VK_RIGHT
+					handleNonTabOrEscEvent(e, right);
+					break;
+
+				case 38: // DOM_VK_UP
+					handleNonTabOrEscEvent(e, up);
+					break;
+
+				case 40: // DOM_VK_DOWN
+					handleNonTabOrEscEvent(e, down);
+					break;
+
+				case 27: // DOM_VK_ESCAPE
+					cancel();
+					break;
+
+				case 14: // DOM_VK_ENTER
+				case 13: // DOM_VK_RETURN
+				case 32: // DOM_VK_SPACE
+					handleNonTabOrEscEvent(e, enter);
+					break;
+
+				case 9: // DOM_VK_TAB
+					if (tab(e) !== false) {
+						e.preventDefault();
+					}
+					break;
+			}
+		});
+
+		root.on('focusin', function(e) {
+			focusedElement = e.target;
+			focusedControl = e.control;
+		});
+
+		return {
+			focusFirst: focusFirst
+		};
+	};
+});
+
+// Included from: js/tinymce/classes/ui/Container.js
+
+/**
+ * Container.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Container control. This is extended by all controls that can have
+ * children such as panels etc. You can also use this class directly as an
+ * generic container instance. The container doesn't have any specific role or style.
+ *
+ * @-x-less Container.less
+ * @class tinymce.ui.Container
+ * @extends tinymce.ui.Control
+ */
+define("tinymce/ui/Container", [
+	"tinymce/ui/Control",
+	"tinymce/ui/Collection",
+	"tinymce/ui/Selector",
+	"tinymce/ui/Factory",
+	"tinymce/ui/KeyboardNavigation",
+	"tinymce/util/Tools",
+	"tinymce/ui/DomUtils"
+], function(Control, Collection, Selector, Factory, KeyboardNavigation, Tools, DomUtils) {
+	"use strict";
+
+	var selectorCache = {};
+
+	return Control.extend({
+		layout: '',
+		innerClass: 'container-inner',
+
+		/**
+		 * Constructs a new control instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {Array} items Items to add to container in JSON format or control instances.
+		 * @setting {String} layout Layout manager by name to use.
+		 * @setting {Object} defaults Default settings to apply to all items.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self._super(settings);
+			settings = self.settings;
+			self._fixed = settings.fixed;
+			self._items = new Collection();
+
+			if (self.isRtl()) {
+				self.addClass('rtl');
+			}
+
+			self.addClass('container');
+			self.addClass('container-body', 'body');
+
+			if (settings.containerCls) {
+				self.addClass(settings.containerCls);
+			}
+
+			self._layout = Factory.create((settings.layout || self.layout) + 'layout');
+
+			if (self.settings.items) {
+				self.add(self.settings.items);
+			}
+
+			// TODO: Fix this!
+			self._hasBody = true;
+		},
+
+		/**
+		 * Returns a collection of child items that the container currently have.
+		 *
+		 * @method items
+		 * @return {tinymce.ui.Collection} Control collection direct child controls.
+		 */
+		items: function() {
+			return this._items;
+		},
+
+		/**
+		 * Find child controls by selector.
+		 *
+		 * @method find
+		 * @param {String} selector Selector CSS pattern to find children by.
+		 * @return {tinymce.ui.Collection} Control collection with child controls.
+		 */
+		find: function(selector) {
+			selector = selectorCache[selector] = selectorCache[selector] || new Selector(selector);
+
+			return selector.find(this);
+		},
+
+		/**
+		 * Adds one or many items to the current container. This will create instances of
+		 * the object representations if needed.
+		 *
+		 * @method add
+		 * @param {Array/Object/tinymce.ui.Control} items Array or item that will be added to the container.
+		 * @return {tinymce.ui.Collection} Current collection control.
+		 */
+		add: function(items) {
+			var self = this;
+
+			self.items().add(self.create(items)).parent(self);
+
+			return self;
+		},
+
+		/**
+		 * Focuses the current container instance. This will look
+		 * for the first control in the container and focus that.
+		 *
+		 * @method focus
+		 * @param {Boolean} keyboard Optional true/false if the focus was a keyboard focus or not.
+		 * @return {tinymce.ui.Collection} Current instance.
+		 */
+		focus: function(keyboard) {
+			var self = this, focusCtrl, keyboardNav, items;
+
+			if (keyboard) {
+				keyboardNav = self.keyboardNav || self.parents().eq(-1)[0].keyboardNav;
+
+				if (keyboardNav) {
+					keyboardNav.focusFirst(self);
+					return;
+				}
+			}
+
+			items = self.find('*');
+
+			// TODO: Figure out a better way to auto focus alert dialog buttons
+			if (self.statusbar) {
+				items.add(self.statusbar.items());
+			}
+
+			items.each(function(ctrl) {
+				if (ctrl.settings.autofocus) {
+					focusCtrl = null;
+					return false;
+				}
+
+				if (ctrl.canFocus) {
+					focusCtrl = focusCtrl || ctrl;
+				}
+			});
+
+			if (focusCtrl) {
+				focusCtrl.focus();
+			}
+
+			return self;
+		},
+
+		/**
+		 * Replaces the specified child control with a new control.
+		 *
+		 * @method replace
+		 * @param {tinymce.ui.Control} oldItem Old item to be replaced.
+		 * @param {tinymce.ui.Control} newItem New item to be inserted.
+		 */
+		replace: function(oldItem, newItem) {
+			var ctrlElm, items = this.items(), i = items.length;
+
+			// Replace the item in collection
+			while (i--) {
+				if (items[i] === oldItem) {
+					items[i] = newItem;
+					break;
+				}
+			}
+
+			if (i >= 0) {
+				// Remove new item from DOM
+				ctrlElm = newItem.getEl();
+				if (ctrlElm) {
+					ctrlElm.parentNode.removeChild(ctrlElm);
+				}
+
+				// Remove old item from DOM
+				ctrlElm = oldItem.getEl();
+				if (ctrlElm) {
+					ctrlElm.parentNode.removeChild(ctrlElm);
+				}
+			}
+
+			// Adopt the item
+			newItem.parent(this);
+		},
+
+		/**
+		 * Creates the specified items. If any of the items is plain JSON style objects
+		 * it will convert these into real tinymce.ui.Control instances.
+		 *
+		 * @method create
+		 * @param {Array} items Array of items to convert into control instances.
+		 * @return {Array} Array with control instances.
+		 */
+		create: function(items) {
+			var self = this, settings, ctrlItems = [];
+
+			// Non array structure, then force it into an array
+			if (!Tools.isArray(items)) {
+				items = [items];
+			}
+
+			// Add default type to each child control
+			Tools.each(items, function(item) {
+				if (item) {
+					// Construct item if needed
+					if (!(item instanceof Control)) {
+						// Name only then convert it to an object
+						if (typeof item == "string") {
+							item = {type: item};
+						}
+
+						// Create control instance based on input settings and default settings
+						settings = Tools.extend({}, self.settings.defaults, item);
+						item.type = settings.type = settings.type || item.type || self.settings.defaultType ||
+							(settings.defaults ? settings.defaults.type : null);
+						item = Factory.create(settings);
+					}
+
+					ctrlItems.push(item);
+				}
+			});
+
+			return ctrlItems;
+		},
+
+		/**
+		 * Renders new control instances.
+		 *
+		 * @private
+		 */
+		renderNew: function() {
+			var self = this;
+
+			// Render any new items
+			self.items().each(function(ctrl, index) {
+				var containerElm, fragment;
+
+				ctrl.parent(self);
+
+				if (!ctrl._rendered) {
+					containerElm = self.getEl('body');
+					fragment = DomUtils.createFragment(ctrl.renderHtml());
+
+					// Insert or append the item
+					if (containerElm.hasChildNodes() && index <= containerElm.childNodes.length - 1) {
+						containerElm.insertBefore(fragment, containerElm.childNodes[index]);
+					} else {
+						containerElm.appendChild(fragment);
+					}
+
+					ctrl.postRender();
+				}
+			});
+
+			self._layout.applyClasses(self);
+			self._lastRect = null;
+
+			return self;
+		},
+
+		/**
+		 * Appends new instances to the current container.
+		 *
+		 * @method append
+		 * @param {Array/tinymce.ui.Collection} items Array if controls to append.
+		 * @return {tinymce.ui.Container} Current container instance.
+		 */
+		append: function(items) {
+			return this.add(items).renderNew();
+		},
+
+		/**
+		 * Prepends new instances to the current container.
+		 *
+		 * @method prepend
+		 * @param {Array/tinymce.ui.Collection} items Array if controls to prepend.
+		 * @return {tinymce.ui.Container} Current container instance.
+		 */
+		prepend: function(items) {
+			var self = this;
+
+			self.items().set(self.create(items).concat(self.items().toArray()));
+
+			return self.renderNew();
+		},
+
+		/**
+		 * Inserts an control at a specific index.
+		 *
+		 * @method insert
+		 * @param {Array/tinymce.ui.Collection} items Array if controls to insert.
+		 * @param {Number} index Index to insert controls at.
+		 * @param {Boolean} [before=false] Inserts controls before the index.
+		 */
+		insert: function(items, index, before) {
+			var self = this, curItems, beforeItems, afterItems;
+
+			items = self.create(items);
+			curItems = self.items();
+
+			if (!before && index < curItems.length - 1) {
+				index += 1;
+			}
+
+			if (index >= 0 && index < curItems.length) {
+				beforeItems = curItems.slice(0, index).toArray();
+				afterItems = curItems.slice(index).toArray();
+				curItems.set(beforeItems.concat(items, afterItems));
+			}
+
+			return self.renderNew();
+		},
+
+		/**
+		 * Populates the form fields from the specified JSON data object.
+		 *
+		 * Control items in the form that matches the data will have it's value set.
+		 *
+		 * @method fromJSON
+		 * @param {Object} data JSON data object to set control values by.
+		 * @return {tinymce.ui.Container} Current form instance.
+		 */
+		fromJSON: function(data) {
+			var self = this;
+
+			for (var name in data) {
+				self.find('#' + name).value(data[name]);
+			}
+
+			return self;
+		},
+
+		/**
+		 * Serializes the form into a JSON object by getting all items
+		 * that has a name and a value.
+		 *
+		 * @method toJSON
+		 * @return {Object} JSON object with form data.
+		 */
+		toJSON: function() {
+			var self = this, data = {};
+
+			self.find('*').each(function(ctrl) {
+				var name = ctrl.name(), value = ctrl.value();
+
+				if (name && typeof value != "undefined") {
+					data[name] = value;
+				}
+			});
+
+			return data;
+		},
+
+		preRender: function() {
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, layout = self._layout, role = this.settings.role;
+
+			self.preRender();
+			layout.preRender(self);
+
+			return (
+				'<div id="' + self._id + '" class="' + self.classes() + '"' + (role ? ' role="' + this.settings.role + '"' : '') + '>' +
+					'<div id="' + self._id + '-body" class="' + self.classes('body') + '">' +
+						(self.settings.html || '') + layout.renderHtml(self) +
+					'</div>' +
+				'</div>'
+			);
+		},
+
+		/**
+		 * Post render method. Called after the control has been rendered to the target.
+		 *
+		 * @method postRender
+		 * @return {tinymce.ui.Container} Current combobox instance.
+		 */
+		postRender: function() {
+			var self = this, box;
+
+			self.items().exec('postRender');
+			self._super();
+
+			self._layout.postRender(self);
+			self._rendered = true;
+
+			if (self.settings.style) {
+				DomUtils.css(self.getEl(), self.settings.style);
+			}
+
+			if (self.settings.border) {
+				box = self.borderBox();
+				DomUtils.css(self.getEl(), {
+					'border-top-width': box.top,
+					'border-right-width': box.right,
+					'border-bottom-width': box.bottom,
+					'border-left-width': box.left
+				});
+			}
+
+			if (!self.parent()) {
+				self.keyboardNav = new KeyboardNavigation({
+					root: self
+				});
+			}
+
+			return self;
+		},
+
+		/**
+		 * Initializes the current controls layout rect.
+		 * This will be executed by the layout managers to determine the
+		 * default minWidth/minHeight etc.
+		 *
+		 * @method initLayoutRect
+		 * @return {Object} Layout rect instance.
+		 */
+		initLayoutRect: function() {
+			var self = this, layoutRect = self._super();
+
+			// Recalc container size by asking layout manager
+			self._layout.recalc(self);
+
+			return layoutRect;
+		},
+
+		/**
+		 * Recalculates the positions of the controls in the current container.
+		 * This is invoked by the reflow method and shouldn't be called directly.
+		 *
+		 * @method recalc
+		 */
+		recalc: function() {
+			var self = this, rect = self._layoutRect, lastRect = self._lastRect;
+
+			if (!lastRect || lastRect.w != rect.w || lastRect.h != rect.h) {
+				self._layout.recalc(self);
+				rect = self.layoutRect();
+				self._lastRect = {x: rect.x, y: rect.y, w: rect.w, h: rect.h};
+				return true;
+			}
+		},
+
+		/**
+		 * Reflows the current container and it's children and possible parents.
+		 * This should be used after you for example append children to the current control so
+		 * that the layout managers know that they need to reposition everything.
+		 *
+		 * @example
+		 * container.append({type: 'button', text: 'My button'}).reflow();
+		 *
+		 * @method reflow
+		 * @return {tinymce.ui.Container} Current container instance.
+		 */
+		reflow: function() {
+			var i;
+
+			if (this.visible()) {
+				Control.repaintControls = [];
+				Control.repaintControls.map = {};
+
+				this.recalc();
+				i = Control.repaintControls.length;
+
+				while (i--) {
+					Control.repaintControls[i].repaint();
+				}
+
+				// TODO: Fix me!
+				if (this.settings.layout !== "flow" && this.settings.layout !== "stack") {
+					this.repaint();
+				}
+
+				Control.repaintControls = [];
+			}
+
+			return this;
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/DragHelper.js
+
+/**
+ * DragHelper.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Drag/drop helper class.
+ *
+ * @example
+ * var dragHelper = new tinymce.ui.DragHelper('mydiv', {
+ *     start: function(evt) {
+ *     },
+ *
+ *     drag: function(evt) {
+ *     },
+ *
+ *     end: function(evt) {
+ *     }
+ * });
+ *
+ * @class tinymce.ui.DragHelper
+ */
+define("tinymce/ui/DragHelper", [
+	"tinymce/ui/DomUtils"
+], function(DomUtils) {
+	"use strict";
+
+	function getDocumentSize() {
+		var doc = document, documentElement, body, scrollWidth, clientWidth;
+		var offsetWidth, scrollHeight, clientHeight, offsetHeight, max = Math.max;
+
+		documentElement = doc.documentElement;
+		body = doc.body;
+
+		scrollWidth = max(documentElement.scrollWidth, body.scrollWidth);
+		clientWidth = max(documentElement.clientWidth, body.clientWidth);
+		offsetWidth = max(documentElement.offsetWidth, body.offsetWidth);
+
+		scrollHeight = max(documentElement.scrollHeight, body.scrollHeight);
+		clientHeight = max(documentElement.clientHeight, body.clientHeight);
+		offsetHeight = max(documentElement.offsetHeight, body.offsetHeight);
+
+		return {
+			width: scrollWidth < offsetWidth ? clientWidth : scrollWidth,
+			height: scrollHeight < offsetHeight ? clientHeight : scrollHeight
+		};
+	}
+
+	return function(id, settings) {
+		var eventOverlayElm, doc = document, downButton, start, stop, drag, startX, startY;
+
+		settings = settings || {};
+
+		function getHandleElm() {
+			return doc.getElementById(settings.handle || id);
+		}
+
+		start = function(e) {
+			var docSize = getDocumentSize(), handleElm, cursor;
+
+			e.preventDefault();
+			downButton = e.button;
+			handleElm = getHandleElm();
+			startX = e.screenX;
+			startY = e.screenY;
+
+			// Grab cursor from handle
+			if (window.getComputedStyle) {
+				cursor = window.getComputedStyle(handleElm, null).getPropertyValue("cursor");
+			} else {
+				cursor = handleElm.runtimeStyle.cursor;
+			}
+
+			// Create event overlay and add it to document
+			eventOverlayElm = doc.createElement('div');
+			DomUtils.css(eventOverlayElm, {
+				position: "absolute",
+				top: 0, left: 0,
+				width: docSize.width,
+				height: docSize.height,
+				zIndex: 0x7FFFFFFF,
+				opacity: 0.0001,
+				cursor: cursor
+			});
+
+			doc.body.appendChild(eventOverlayElm);
+
+			// Bind mouse events
+			DomUtils.on(doc, 'mousemove', drag);
+			DomUtils.on(doc, 'mouseup', stop);
+
+			// Begin drag
+			settings.start(e);
+		};
+
+		drag = function(e) {
+			if (e.button !== downButton) {
+				return stop(e);
+			}
+
+			e.deltaX = e.screenX - startX;
+			e.deltaY = e.screenY - startY;
+
+			e.preventDefault();
+			settings.drag(e);
+		};
+
+		stop = function(e) {
+			DomUtils.off(doc, 'mousemove', drag);
+			DomUtils.off(doc, 'mouseup', stop);
+
+			eventOverlayElm.parentNode.removeChild(eventOverlayElm);
+
+			if (settings.stop) {
+				settings.stop(e);
+			}
+		};
+
+		/**
+		 * Destroys the drag/drop helper instance.
+		 *
+		 * @method destroy
+		 */
+		this.destroy = function() {
+			DomUtils.off(getHandleElm());
+		};
+
+		DomUtils.on(getHandleElm(), 'mousedown', start);
+	};
+});
+
+// Included from: js/tinymce/classes/ui/Scrollable.js
+
+/**
+ * Scrollable.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This mixin makes controls scrollable using custom scrollbars.
+ *
+ * @-x-less Scrollable.less
+ * @mixin tinymce.ui.Scrollable
+ */
+define("tinymce/ui/Scrollable", [
+	"tinymce/ui/DomUtils",
+	"tinymce/ui/DragHelper"
+], function(DomUtils, DragHelper) {
+	"use strict";
+
+	return {
+		init: function() {
+			var self = this;
+			self.on('repaint', self.renderScroll);
+		},
+
+		renderScroll: function() {
+			var self = this, margin = 2;
+
+			function repaintScroll() {
+				var hasScrollH, hasScrollV, bodyElm;
+
+				function repaintAxis(axisName, posName, sizeName, contentSizeName, hasScroll, ax) {
+					var containerElm, scrollBarElm, scrollThumbElm;
+					var containerSize, scrollSize, ratio, rect;
+					var posNameLower, sizeNameLower;
+
+					scrollBarElm = self.getEl('scroll' + axisName);
+					if (scrollBarElm) {
+						posNameLower = posName.toLowerCase();
+						sizeNameLower = sizeName.toLowerCase();
+
+						if (self.getEl('absend')) {
+							DomUtils.css(self.getEl('absend'), posNameLower, self.layoutRect()[contentSizeName] - 1);
+						}
+
+						if (!hasScroll) {
+							DomUtils.css(scrollBarElm, 'display', 'none');
+							return;
+						}
+
+						DomUtils.css(scrollBarElm, 'display', 'block');
+						containerElm = self.getEl('body');
+						scrollThumbElm = self.getEl('scroll' + axisName + "t");
+						containerSize = containerElm["client" + sizeName] - (margin * 2);
+						containerSize -= hasScrollH && hasScrollV ? scrollBarElm["client" + ax] : 0;
+						scrollSize = containerElm["scroll" + sizeName];
+						ratio = containerSize / scrollSize;
+
+						rect = {};
+						rect[posNameLower] = containerElm["offset" + posName] + margin;
+						rect[sizeNameLower] = containerSize;
+						DomUtils.css(scrollBarElm, rect);
+
+						rect = {};
+						rect[posNameLower] = containerElm["scroll" + posName] * ratio;
+						rect[sizeNameLower] = containerSize * ratio;
+						DomUtils.css(scrollThumbElm, rect);
+					}
+				}
+
+				bodyElm = self.getEl('body');
+				hasScrollH = bodyElm.scrollWidth > bodyElm.clientWidth;
+				hasScrollV = bodyElm.scrollHeight > bodyElm.clientHeight;
+
+				repaintAxis("h", "Left", "Width", "contentW", hasScrollH, "Height");
+				repaintAxis("v", "Top", "Height", "contentH", hasScrollV, "Width");
+			}
+
+			function addScroll() {
+				function addScrollAxis(axisName, posName, sizeName, deltaPosName, ax) {
+					var scrollStart, axisId = self._id + '-scroll' + axisName, prefix = self.classPrefix;
+
+					self.getEl().appendChild(DomUtils.createFragment(
+						'<div id="' + axisId + '" class="' + prefix + 'scrollbar ' + prefix + 'scrollbar-' + axisName + '">' +
+							'<div id="' + axisId + 't" class="' + prefix + 'scrollbar-thumb"></div>' +
+						'</div>'
+					));
+
+					self.draghelper = new DragHelper(axisId + 't', {
+						start: function() {
+							scrollStart = self.getEl('body')["scroll" + posName];
+							DomUtils.addClass(DomUtils.get(axisId), prefix + 'active');
+						},
+
+						drag: function(e) {
+							var ratio, hasScrollH, hasScrollV, containerSize, layoutRect = self.layoutRect();
+
+							hasScrollH = layoutRect.contentW > layoutRect.innerW;
+							hasScrollV = layoutRect.contentH > layoutRect.innerH;
+							containerSize = self.getEl('body')["client" + sizeName] - (margin * 2);
+							containerSize -= hasScrollH && hasScrollV ? self.getEl('scroll' + axisName)["client" + ax] : 0;
+
+							ratio = containerSize / self.getEl('body')["scroll" + sizeName];
+							self.getEl('body')["scroll" + posName] = scrollStart + (e["delta" + deltaPosName] / ratio);
+						},
+
+						stop: function() {
+							DomUtils.removeClass(DomUtils.get(axisId), prefix + 'active');
+						}
+					});
+/*
+					self.on('click', function(e) {
+						if (e.target.id == self._id + '-scrollv') {
+
+						}
+					});*/
+				}
+
+				self.addClass('scroll');
+
+				addScrollAxis("v", "Top", "Height", "Y", "Width");
+				addScrollAxis("h", "Left", "Width", "X", "Height");
+			}
+
+			if (self.settings.autoScroll) {
+				if (!self._hasScroll) {
+					self._hasScroll = true;
+					addScroll();
+
+					self.on('wheel', function(e) {
+						var bodyEl = self.getEl('body');
+
+						bodyEl.scrollLeft += (e.deltaX || 0) * 10;
+						bodyEl.scrollTop += e.deltaY * 10;
+
+						repaintScroll();
+					});
+
+					DomUtils.on(self.getEl('body'), "scroll", repaintScroll);
+				}
+
+				repaintScroll();
+			}
+		}
+	};
+});
+
+// Included from: js/tinymce/classes/ui/Panel.js
+
+/**
+ * Panel.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new panel.
+ *
+ * @-x-less Panel.less
+ * @class tinymce.ui.Panel
+ * @extends tinymce.ui.Container
+ * @mixes tinymce.ui.Scrollable
+ */
+define("tinymce/ui/Panel", [
+	"tinymce/ui/Container",
+	"tinymce/ui/Scrollable"
+], function(Container, Scrollable) {
+	"use strict";
+
+	return Container.extend({
+		Defaults: {
+			layout: 'fit',
+			containerCls: 'panel'
+		},
+
+		Mixins: [Scrollable],
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, layout = self._layout, innerHtml = self.settings.html;
+
+			self.preRender();
+			layout.preRender(self);
+
+			if (typeof innerHtml == "undefined") {
+				innerHtml = (
+					'<div id="' + self._id + '-body" class="' + self.classes('body') + '">' +
+						layout.renderHtml(self) +
+					'</div>'
+				);
+			} else {
+				if (typeof innerHtml == 'function') {
+					innerHtml = innerHtml.call(self);
+				}
+
+				self._hasBody = false;
+			}
+
+			return (
+				'<div id="' + self._id + '" class="' + self.classes() + '" hidefocus="1" tabindex="-1" role="group">' +
+					(self._preBodyHtml || '') +
+					innerHtml +
+				'</div>'
+			);
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/Movable.js
+
+/**
+ * Movable.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Movable mixin. Makes controls movable absolute and relative to other elements.
+ *
+ * @mixin tinymce.ui.Movable
+ */
+define("tinymce/ui/Movable", [
+	"tinymce/ui/DomUtils"
+], function(DomUtils) {
+	"use strict";
+
+	function calculateRelativePosition(ctrl, targetElm, rel) {
+		var ctrlElm, pos, x, y, selfW, selfH, targetW, targetH, viewport, size;
+
+		viewport = DomUtils.getViewPort();
+
+		// Get pos of target
+		pos = DomUtils.getPos(targetElm);
+		x = pos.x;
+		y = pos.y;
+
+		if (ctrl._fixed && DomUtils.getRuntimeStyle(document.body, 'position') == 'static') {
+			x -= viewport.x;
+			y -= viewport.y;
+		}
+
+		// Get size of self
+		ctrlElm = ctrl.getEl();
+		size = DomUtils.getSize(ctrlElm);
+		selfW = size.width;
+		selfH = size.height;
+
+		// Get size of target
+		size = DomUtils.getSize(targetElm);
+		targetW = size.width;
+		targetH = size.height;
+
+		// Parse align string
+		rel = (rel || '').split('');
+
+		// Target corners
+		if (rel[0] === 'b') {
+			y += targetH;
+		}
+
+		if (rel[1] === 'r') {
+			x += targetW;
+		}
+
+		if (rel[0] === 'c') {
+			y += Math.round(targetH / 2);
+		}
+
+		if (rel[1] === 'c') {
+			x += Math.round(targetW / 2);
+		}
+
+		// Self corners
+		if (rel[3] === 'b') {
+			y -= selfH;
+		}
+
+		if (rel[4] === 'r') {
+			x -= selfW;
+		}
+
+		if (rel[3] === 'c') {
+			y -= Math.round(selfH / 2);
+		}
+
+		if (rel[4] === 'c') {
+			x -= Math.round(selfW / 2);
+		}
+
+		return {
+			x: x,
+			y: y,
+			w: selfW,
+			h: selfH
+		};
+	}
+
+	return {
+		/**
+		 * Tests various positions to get the most suitable one.
+		 *
+		 * @method testMoveRel
+		 * @param {DOMElement} elm Element to position against.
+		 * @param {Array} rels Array with relative positions.
+		 * @return {String} Best suitable relative position.
+		 */
+		testMoveRel: function(elm, rels) {
+			var viewPortRect = DomUtils.getViewPort();
+
+			for (var i = 0; i < rels.length; i++) {
+				var pos = calculateRelativePosition(this, elm, rels[i]);
+
+				if (this._fixed) {
+					if (pos.x > 0 && pos.x + pos.w < viewPortRect.w && pos.y > 0 && pos.y + pos.h < viewPortRect.h) {
+						return rels[i];
+					}
+				} else {
+					if (pos.x > viewPortRect.x && pos.x + pos.w < viewPortRect.w + viewPortRect.x &&
+						pos.y > viewPortRect.y && pos.y + pos.h < viewPortRect.h + viewPortRect.y) {
+						return rels[i];
+					}
+				}
+			}
+
+			return rels[0];
+		},
+
+		/**
+		 * Move relative to the specified element.
+		 *
+		 * @method moveRel
+		 * @param {Element} elm Element to move relative to.
+		 * @param {String} rel Relative mode. For example: br-tl.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		moveRel: function(elm, rel) {
+			if (typeof rel != 'string') {
+				rel = this.testMoveRel(elm, rel);
+			}
+
+			var pos = calculateRelativePosition(this, elm, rel);
+			return this.moveTo(pos.x, pos.y);
+		},
+
+		/**
+		 * Move by a relative x, y values.
+		 *
+		 * @method moveBy
+		 * @param {Number} dx Relative x position.
+		 * @param {Number} dy Relative y position.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		moveBy: function(dx, dy) {
+			var self = this, rect = self.layoutRect();
+
+			self.moveTo(rect.x + dx, rect.y + dy);
+
+			return self;
+		},
+
+		/**
+		 * Move to absolute position.
+		 *
+		 * @method moveTo
+		 * @param {Number} x Absolute x position.
+		 * @param {Number} y Absolute y position.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		moveTo: function(x, y) {
+			var self = this;
+
+			// TODO: Move this to some global class
+			function contrain(value, max, size) {
+				if (value < 0) {
+					return 0;
+				}
+
+				if (value + size > max) {
+					value = max - size;
+					return value < 0 ? 0 : value;
+				}
+
+				return value;
+			}
+
+			if (self.settings.constrainToViewport) {
+				var viewPortRect = DomUtils.getViewPort(window);
+				var layoutRect = self.layoutRect();
+
+				x = contrain(x, viewPortRect.w + viewPortRect.x, layoutRect.w);
+				y = contrain(y, viewPortRect.h + viewPortRect.y, layoutRect.h);
+			}
+
+			if (self._rendered) {
+				self.layoutRect({x: x, y: y}).repaint();
+			} else {
+				self.settings.x = x;
+				self.settings.y = y;
+			}
+
+			self.fire('move', {x: x, y: y});
+
+			return self;
+		}
+	};
+});
+
+// Included from: js/tinymce/classes/ui/Resizable.js
+
+/**
+ * Resizable.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Resizable mixin. Enables controls to be resized.
+ *
+ * @mixin tinymce.ui.Resizable
+ */
+define("tinymce/ui/Resizable", [
+	"tinymce/ui/DomUtils"
+], function(DomUtils) {
+	"use strict";
+
+	return {
+		/**
+		 * Resizes the control to contents.
+		 *
+		 * @method resizeToContent
+		 */
+		resizeToContent: function() {
+			this._layoutRect.autoResize = true;
+			this._lastRect = null;
+			this.reflow();
+		},
+
+		/**
+		 * Resizes the control to a specific width/height.
+		 *
+		 * @method resizeTo
+		 * @param {Number} w Control width.
+		 * @param {Number} h Control height.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		resizeTo: function(w, h) {
+			// TODO: Fix hack
+			if (w <= 1 || h <= 1) {
+				var rect = DomUtils.getWindowSize();
+
+				w = w <= 1 ? w * rect.w : w;
+				h = h <= 1 ? h * rect.h : h;
+			}
+
+			this._layoutRect.autoResize = false;
+			return this.layoutRect({minW: w, minH: h, w: w, h: h}).reflow();
+		},
+
+		/**
+		 * Resizes the control to a specific relative width/height.
+		 *
+		 * @method resizeBy
+		 * @param {Number} dw Relative control width.
+		 * @param {Number} dh Relative control height.
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		resizeBy: function(dw, dh) {
+			var self = this, rect = self.layoutRect();
+
+			return self.resizeTo(rect.w + dw, rect.h + dh);
+		}
+	};
+});
+
+// Included from: js/tinymce/classes/ui/FloatPanel.js
+
+/**
+ * FloatPanel.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class creates a floating panel.
+ *
+ * @-x-less FloatPanel.less
+ * @class tinymce.ui.FloatPanel
+ * @extends tinymce.ui.Panel
+ * @mixes tinymce.ui.Movable
+ * @mixes tinymce.ui.Resizable
+ */
+define("tinymce/ui/FloatPanel", [
+	"tinymce/ui/Panel",
+	"tinymce/ui/Movable",
+	"tinymce/ui/Resizable",
+	"tinymce/ui/DomUtils"
+], function(Panel, Movable, Resizable, DomUtils) {
+	"use strict";
+
+	var documentClickHandler, documentScrollHandler, windowResizeHandler, visiblePanels = [];
+	var zOrder = [], hasModal;
+
+	function bindDocumentClickHandler() {
+		function isChildOf(ctrl, parent) {
+			while (ctrl) {
+				if (ctrl == parent) {
+					return true;
+				}
+
+				ctrl = ctrl.parent();
+			}
+		}
+
+		if (!documentClickHandler) {
+			documentClickHandler = function(e) {
+				// Gecko fires click event and in the wrong order on Mac so lets normalize
+				if (e.button == 2) {
+					return;
+				}
+
+				// Hide any float panel when a click is out side that float panel and the
+				// float panels direct parent for example a click on a menu button
+				var i = visiblePanels.length;
+				while (i--) {
+					var panel = visiblePanels[i], clickCtrl = panel.getParentCtrl(e.target);
+
+					if (panel.settings.autohide) {
+						if (clickCtrl) {
+							if (isChildOf(clickCtrl, panel) || panel.parent() === clickCtrl) {
+								continue;
+							}
+						}
+
+						e = panel.fire('autohide', {target: e.target});
+						if (!e.isDefaultPrevented()) {
+							panel.hide();
+						}
+					}
+				}
+			};
+
+			DomUtils.on(document, 'click', documentClickHandler);
+		}
+	}
+
+	function bindDocumentScrollHandler() {
+		if (!documentScrollHandler) {
+			documentScrollHandler = function() {
+				var i;
+
+				i = visiblePanels.length;
+				while (i--) {
+					repositionPanel(visiblePanels[i]);
+				}
+			};
+
+			DomUtils.on(window, 'scroll', documentScrollHandler);
+		}
+	}
+
+	function bindWindowResizeHandler() {
+		if (!windowResizeHandler) {
+			var docElm = document.documentElement, clientWidth = docElm.clientWidth, clientHeight = docElm.clientHeight;
+
+			windowResizeHandler = function() {
+				// Workaround for #7065 IE 7 fires resize events event though the window wasn't resized
+				if (!document.all || clientWidth != docElm.clientWidth || clientHeight != docElm.clientHeight) {
+					clientWidth = docElm.clientWidth;
+					clientHeight = docElm.clientHeight;
+					FloatPanel.hideAll();
+				}
+			};
+
+			DomUtils.on(window, 'resize', windowResizeHandler);
+		}
+	}
+
+	/**
+	 * Repositions the panel to the top of page if the panel is outside of the visual viewport. It will
+	 * also reposition all child panels of the current panel.
+	 */
+	function repositionPanel(panel) {
+		var scrollY = DomUtils.getViewPort().y;
+
+		function toggleFixedChildPanels(fixed, deltaY) {
+			var parent;
+
+			for (var i = 0; i < visiblePanels.length; i++) {
+				if (visiblePanels[i] != panel) {
+					parent = visiblePanels[i].parent();
+
+					while (parent && (parent = parent.parent())) {
+						if (parent == panel) {
+							visiblePanels[i].fixed(fixed).moveBy(0, deltaY).repaint();
+						}
+					}
+				}
+			}
+		}
+
+		if (panel.settings.autofix) {
+			if (!panel._fixed) {
+				panel._autoFixY = panel.layoutRect().y;
+
+				if (panel._autoFixY < scrollY) {
+					panel.fixed(true).layoutRect({y: 0}).repaint();
+					toggleFixedChildPanels(true, scrollY - panel._autoFixY);
+				}
+			} else {
+				if (panel._autoFixY > scrollY) {
+					panel.fixed(false).layoutRect({y: panel._autoFixY}).repaint();
+					toggleFixedChildPanels(false, panel._autoFixY - scrollY);
+				}
+			}
+		}
+	}
+
+	function addRemove(add, ctrl) {
+		var i, zIndex = FloatPanel.zIndex || 0xFFFF, topModal;
+
+		if (add) {
+			zOrder.push(ctrl);
+		} else {
+			i = zOrder.length;
+
+			while (i--) {
+				if (zOrder[i] === ctrl) {
+					zOrder.splice(i, 1);
+				}
+			}
+		}
+
+		if (zOrder.length) {
+			for (i = 0; i < zOrder.length; i++) {
+				if (zOrder[i].modal) {
+					zIndex++;
+					topModal = zOrder[i];
+				}
+
+				zOrder[i].getEl().style.zIndex = zIndex;
+				zOrder[i].zIndex = zIndex;
+				zIndex++;
+			}
+		}
+
+		var modalBlockEl = document.getElementById(ctrl.classPrefix + 'modal-block');
+
+		if (topModal) {
+			DomUtils.css(modalBlockEl, 'z-index', topModal.zIndex - 1);
+		} else if (modalBlockEl) {
+			modalBlockEl.parentNode.removeChild(modalBlockEl);
+			hasModal = false;
+		}
+
+		FloatPanel.currentZIndex = zIndex;
+	}
+
+	var FloatPanel = Panel.extend({
+		Mixins: [Movable, Resizable],
+
+		/**
+		 * Constructs a new control instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {Boolean} autohide Automatically hide the panel.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self._super(settings);
+			self._eventsRoot = self;
+
+			self.addClass('floatpanel');
+
+			// Hide floatpanes on click out side the root button
+			if (settings.autohide) {
+				bindDocumentClickHandler();
+				bindWindowResizeHandler();
+				visiblePanels.push(self);
+			}
+
+			if (settings.autofix) {
+				bindDocumentScrollHandler();
+
+				self.on('move', function() {
+					repositionPanel(this);
+				});
+			}
+
+			self.on('postrender show', function(e) {
+				if (e.control == self) {
+					var modalBlockEl, prefix = self.classPrefix;
+
+					if (self.modal && !hasModal) {
+						modalBlockEl = DomUtils.createFragment('<div id="' + prefix + 'modal-block" class="' +
+							prefix + 'reset ' + prefix + 'fade"></div>');
+						modalBlockEl = modalBlockEl.firstChild;
+
+						self.getContainerElm().appendChild(modalBlockEl);
+
+						setTimeout(function() {
+							DomUtils.addClass(modalBlockEl, prefix + 'in');
+							DomUtils.addClass(self.getEl(), prefix + 'in');
+						}, 0);
+
+						hasModal = true;
+					}
+
+					addRemove(true, self);
+				}
+			});
+
+			self.on('show', function() {
+				self.parents().each(function(ctrl) {
+					if (ctrl._fixed) {
+						self.fixed(true);
+						return false;
+					}
+				});
+			});
+
+			if (settings.popover) {
+				self._preBodyHtml = '<div class="' + self.classPrefix + 'arrow"></div>';
+				self.addClass('popover').addClass('bottom').addClass(self.isRtl() ? 'end' : 'start');
+			}
+		},
+
+		fixed: function(state) {
+			var self = this;
+
+			if (self._fixed != state) {
+				if (self._rendered) {
+					var viewport = DomUtils.getViewPort();
+
+					if (state) {
+						self.layoutRect().y -= viewport.y;
+					} else {
+						self.layoutRect().y += viewport.y;
+					}
+				}
+
+				self.toggleClass('fixed', state);
+				self._fixed = state;
+			}
+
+			return self;
+		},
+
+		/**
+		 * Shows the current float panel.
+		 *
+		 * @method show
+		 * @return {tinymce.ui.FloatPanel} Current floatpanel instance.
+		 */
+		show: function() {
+			var self = this, i, state = self._super();
+
+			i = visiblePanels.length;
+			while (i--) {
+				if (visiblePanels[i] === self) {
+					break;
+				}
+			}
+
+			if (i === -1) {
+				visiblePanels.push(self);
+			}
+
+			return state;
+		},
+
+		/**
+		 * Hides the current float panel.
+		 *
+		 * @method hide
+		 * @return {tinymce.ui.FloatPanel} Current floatpanel instance.
+		 */
+		hide: function() {
+			removeVisiblePanel(this);
+			addRemove(false, this);
+
+			return this._super();
+		},
+
+		/**
+		 * Hide all visible float panels with he autohide setting enabled. This is for
+		 * manually hiding floating menus or panels.
+		 *
+		 * @method hideAll
+		 */
+		hideAll: function() {
+			FloatPanel.hideAll();
+		},
+
+		/**
+		 * Closes the float panel. This will remove the float panel from page and fire the close event.
+		 *
+		 * @method close
+		 */
+		close: function() {
+			var self = this;
+
+			if (!self.fire('close').isDefaultPrevented()) {
+				self.remove();
+				addRemove(false, self);
+			}
+
+			return self;
+		},
+
+		/**
+		 * Removes the float panel from page.
+		 *
+		 * @method remove
+		 */
+		remove: function() {
+			removeVisiblePanel(this);
+			this._super();
+		},
+
+		postRender: function() {
+			var self = this;
+
+			if (self.settings.bodyRole) {
+				this.getEl('body').setAttribute('role', self.settings.bodyRole);
+			}
+
+			return self._super();
+		}
+	});
+
+	/**
+	 * Hide all visible float panels with he autohide setting enabled. This is for
+	 * manually hiding floating menus or panels.
+	 *
+	 * @static
+	 * @method hideAll
+	 */
+	FloatPanel.hideAll = function() {
+		var i = visiblePanels.length;
+
+		while (i--) {
+			var panel = visiblePanels[i];
+
+			if (panel && panel.settings.autohide) {
+				panel.hide();
+				visiblePanels.splice(i, 1);
+			}
+		}
+	};
+
+	function removeVisiblePanel(panel) {
+		var i;
+
+		i = visiblePanels.length;
+		while (i--) {
+			if (visiblePanels[i] === panel) {
+				visiblePanels.splice(i, 1);
+			}
+		}
+
+		i = zOrder.length;
+		while (i--) {
+			if (zOrder[i] === panel) {
+				zOrder.splice(i, 1);
+			}
+		}
+	}
+
+	return FloatPanel;
+});
+
+// Included from: js/tinymce/classes/ui/Window.js
+
+/**
+ * Window.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new window.
+ *
+ * @-x-less Window.less
+ * @class tinymce.ui.Window
+ * @extends tinymce.ui.FloatPanel
+ */
+define("tinymce/ui/Window", [
+	"tinymce/ui/FloatPanel",
+	"tinymce/ui/Panel",
+	"tinymce/ui/DomUtils",
+	"tinymce/ui/DragHelper"
+], function(FloatPanel, Panel, DomUtils, DragHelper) {
+	"use strict";
+
+	var Window = FloatPanel.extend({
+		modal: true,
+
+		Defaults: {
+			border: 1,
+			layout: 'flex',
+			containerCls: 'panel',
+			role: 'dialog',
+			callbacks: {
+				submit: function() {
+					this.fire('submit', {data: this.toJSON()});
+				},
+
+				close: function() {
+					this.close();
+				}
+			}
+		},
+
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self._super(settings);
+
+			if (self.isRtl()) {
+				self.addClass('rtl');
+			}
+
+			self.addClass('window');
+			self._fixed = true;
+
+			// Create statusbar
+			if (settings.buttons) {
+				self.statusbar = new Panel({
+					layout: 'flex',
+					border: '1 0 0 0',
+					spacing: 3,
+					padding: 10,
+					align: 'center',
+					pack: self.isRtl() ? 'start' : 'end',
+					defaults: {
+						type: 'button'
+					},
+					items: settings.buttons
+				});
+
+				self.statusbar.addClass('foot');
+				self.statusbar.parent(self);
+			}
+
+			self.on('click', function(e) {
+				if (e.target.className.indexOf(self.classPrefix + 'close') != -1) {
+					self.close();
+				}
+			});
+
+			self.on('cancel', function() {
+				self.close();
+			});
+
+			self.aria('describedby', self.describedBy || self._id + '-none');
+			self.aria('label', settings.title);
+			self._fullscreen = false;
+		},
+
+		/**
+		 * Recalculates the positions of the controls in the current container.
+		 * This is invoked by the reflow method and shouldn't be called directly.
+		 *
+		 * @method recalc
+		 */
+		recalc: function() {
+			var self = this, statusbar = self.statusbar, layoutRect, width, x, needsRecalc;
+
+			if (self._fullscreen) {
+				self.layoutRect(DomUtils.getWindowSize());
+				self.layoutRect().contentH = self.layoutRect().innerH;
+			}
+
+			self._super();
+
+			layoutRect = self.layoutRect();
+
+			// Resize window based on title width
+			if (self.settings.title && !self._fullscreen) {
+				width = layoutRect.headerW;
+				if (width > layoutRect.w) {
+					x = layoutRect.x - Math.max(0, width / 2);
+					self.layoutRect({w: width, x: x});
+					needsRecalc = true;
+				}
+			}
+
+			// Resize window based on statusbar width
+			if (statusbar) {
+				statusbar.layoutRect({w: self.layoutRect().innerW}).recalc();
+
+				width = statusbar.layoutRect().minW + layoutRect.deltaW;
+				if (width > layoutRect.w) {
+					x = layoutRect.x - Math.max(0, width - layoutRect.w);
+					self.layoutRect({w: width, x: x});
+					needsRecalc = true;
+				}
+			}
+
+			// Recalc body and disable auto resize
+			if (needsRecalc) {
+				self.recalc();
+			}
+		},
+
+		/**
+		 * Initializes the current controls layout rect.
+		 * This will be executed by the layout managers to determine the
+		 * default minWidth/minHeight etc.
+		 *
+		 * @method initLayoutRect
+		 * @return {Object} Layout rect instance.
+		 */
+		initLayoutRect: function() {
+			var self = this, layoutRect = self._super(), deltaH = 0, headEl;
+
+			// Reserve vertical space for title
+			if (self.settings.title && !self._fullscreen) {
+				headEl = self.getEl('head');
+
+				var size = DomUtils.getSize(headEl);
+
+				layoutRect.headerW = size.width;
+				layoutRect.headerH = size.height;
+
+				deltaH += layoutRect.headerH;
+			}
+
+			// Reserve vertical space for statusbar
+			if (self.statusbar) {
+				deltaH += self.statusbar.layoutRect().h;
+			}
+
+			layoutRect.deltaH += deltaH;
+			layoutRect.minH += deltaH;
+			//layoutRect.innerH -= deltaH;
+			layoutRect.h += deltaH;
+
+			var rect = DomUtils.getWindowSize();
+
+			layoutRect.x = Math.max(0, rect.w / 2 - layoutRect.w / 2);
+			layoutRect.y = Math.max(0, rect.h / 2 - layoutRect.h / 2);
+
+			return layoutRect;
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, layout = self._layout, id = self._id, prefix = self.classPrefix;
+			var settings = self.settings, headerHtml = '', footerHtml = '', html = settings.html;
+
+			self.preRender();
+			layout.preRender(self);
+
+			if (settings.title) {
+				headerHtml = (
+					'<div id="' + id + '-head" class="' + prefix + 'window-head">' +
+						'<div id="' + id + '-title" class="' + prefix + 'title">' + self.encode(settings.title) + '</div>' +
+						'<button type="button" class="' + prefix + 'close" aria-hidden="true">\u00d7</button>' +
+						'<div id="' + id + '-dragh" class="' + prefix + 'dragh"></div>' +
+					'</div>'
+				);
+			}
+
+			if (settings.url) {
+				html = '<iframe src="' + settings.url + '" tabindex="-1"></iframe>';
+			}
+
+			if (typeof html == "undefined") {
+				html = layout.renderHtml(self);
+			}
+
+			if (self.statusbar) {
+				footerHtml = self.statusbar.renderHtml();
+			}
+
+			return (
+				'<div id="' + id + '" class="' + self.classes() + '" hidefocus="1">' +
+					'<div class="' + self.classPrefix + 'reset" role="application">' +
+						headerHtml +
+						'<div id="' + id + '-body" class="' + self.classes('body') + '">' +
+							html +
+						'</div>' +
+						footerHtml +
+					'</div>' +
+				'</div>'
+			);
+		},
+
+		/**
+		 * Switches the window fullscreen mode.
+		 *
+		 * @method fullscreen
+		 * @param {Boolean} state True/false state.
+		 * @return {tinymce.ui.Window} Current window instance.
+		 */
+		fullscreen: function(state) {
+			var self = this, documentElement = document.documentElement, slowRendering, prefix = self.classPrefix, layoutRect;
+
+			if (state != self._fullscreen) {
+				DomUtils.on(window, 'resize', function() {
+					var time;
+
+					if (self._fullscreen) {
+						// Time the layout time if it's to slow use a timeout to not hog the CPU
+						if (!slowRendering) {
+							time = new Date().getTime();
+
+							var rect = DomUtils.getWindowSize();
+							self.moveTo(0, 0).resizeTo(rect.w, rect.h);
+
+							if ((new Date().getTime()) - time > 50) {
+								slowRendering = true;
+							}
+						} else {
+							if (!self._timer) {
+								self._timer = setTimeout(function() {
+									var rect = DomUtils.getWindowSize();
+									self.moveTo(0, 0).resizeTo(rect.w, rect.h);
+
+									self._timer = 0;
+								}, 50);
+							}
+						}
+					}
+				});
+
+				layoutRect = self.layoutRect();
+				self._fullscreen = state;
+
+				if (!state) {
+					self._borderBox = self.parseBox(self.settings.border);
+					self.getEl('head').style.display = '';
+					layoutRect.deltaH += layoutRect.headerH;
+					DomUtils.removeClass(documentElement, prefix + 'fullscreen');
+					DomUtils.removeClass(document.body, prefix + 'fullscreen');
+					self.removeClass('fullscreen');
+					self.moveTo(self._initial.x, self._initial.y).resizeTo(self._initial.w, self._initial.h);
+				} else {
+					self._initial = {x: layoutRect.x, y: layoutRect.y, w: layoutRect.w, h: layoutRect.h};
+
+					self._borderBox = self.parseBox('0');
+					self.getEl('head').style.display = 'none';
+					layoutRect.deltaH -= layoutRect.headerH + 2;
+					DomUtils.addClass(documentElement, prefix + 'fullscreen');
+					DomUtils.addClass(document.body, prefix + 'fullscreen');
+					self.addClass('fullscreen');
+
+					var rect = DomUtils.getWindowSize();
+					self.moveTo(0, 0).resizeTo(rect.w, rect.h);
+				}
+			}
+
+			return self.reflow();
+		},
+
+		/**
+		 * Called after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this, startPos;
+
+			setTimeout(function() {
+				self.addClass('in');
+			}, 0);
+
+			self._super();
+
+			if (self.statusbar) {
+				self.statusbar.postRender();
+			}
+
+			self.focus();
+
+			this.dragHelper = new DragHelper(self._id + '-dragh', {
+				start: function() {
+					startPos = {
+						x: self.layoutRect().x,
+						y: self.layoutRect().y
+					};
+				},
+
+				drag: function(e) {
+					self.moveTo(startPos.x + e.deltaX, startPos.y + e.deltaY);
+				}
+			});
+
+			self.on('submit', function(e) {
+				if (!e.isDefaultPrevented()) {
+					self.close();
+				}
+			});
+		},
+
+		/**
+		 * Fires a submit event with the serialized form.
+		 *
+		 * @method submit
+		 * @return {Object} Event arguments object.
+		 */
+		submit: function() {
+			return this.fire('submit', {data: this.toJSON()});
+		},
+
+		/**
+		 * Removes the current control from DOM and from UI collections.
+		 *
+		 * @method remove
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		remove: function() {
+			var self = this, prefix = self.classPrefix;
+
+			self.dragHelper.destroy();
+			self._super();
+
+			if (self.statusbar) {
+				this.statusbar.remove();
+			}
+
+			if (self._fullscreen) {
+				DomUtils.removeClass(document.documentElement, prefix + 'fullscreen');
+				DomUtils.removeClass(document.body, prefix + 'fullscreen');
+			}
+		},
+
+		/**
+		 * Returns the contentWindow object of the iframe if it exists.
+		 *
+		 * @method getContentWindow
+		 * @return {Window} window object or null.
+		 */
+		getContentWindow: function() {
+			var ifr = this.getEl().getElementsByTagName('iframe')[0];
+			return ifr ? ifr.contentWindow : null;
+		}
+	});
+
+	return Window;
+});
+
+// Included from: js/tinymce/classes/ui/MessageBox.js
+
+/**
+ * MessageBox.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is used to create MessageBoxes like alerts/confirms etc.
+ *
+ * @class tinymce.ui.MessageBox
+ * @extends tinymce.ui.Window
+ */
+define("tinymce/ui/MessageBox", [
+	"tinymce/ui/Window"
+], function(Window) {
+	"use strict";
+
+	var MessageBox = Window.extend({
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 */
+		init: function(settings) {
+			settings = {
+				border: 1,
+				padding: 20,
+				layout: 'flex',
+				pack: "center",
+				align: "center",
+				containerCls: 'panel',
+				autoScroll: true,
+				buttons: {type: "button", text: "Ok", action: "ok"},
+				items: {
+					type: "label",
+					multiline: true,
+					maxWidth: 500,
+					maxHeight: 200
+				}
+			};
+
+			this._super(settings);
+		},
+
+		Statics: {
+			/**
+			 * Ok buttons constant.
+			 *
+			 * @static
+			 * @final
+			 * @field {Number} OK
+			 */
+			OK: 1,
+
+			/**
+			 * Ok/cancel buttons constant.
+			 *
+			 * @static
+			 * @final
+			 * @field {Number} OK_CANCEL
+			 */
+			OK_CANCEL: 2,
+
+			/**
+			 * yes/no buttons constant.
+			 *
+			 * @static
+			 * @final
+			 * @field {Number} YES_NO
+			 */
+			YES_NO: 3,
+
+			/**
+			 * yes/no/cancel buttons constant.
+			 *
+			 * @static
+			 * @final
+			 * @field {Number} YES_NO_CANCEL
+			 */
+			YES_NO_CANCEL: 4,
+
+			/**
+			 * Constructs a new message box and renders it to the body element.
+			 *
+			 * @static
+			 * @method msgBox
+			 * @param {Object} settings Name/value object with settings.
+			 */
+			msgBox: function(settings) {
+				var buttons, callback = settings.callback || function() {};
+
+				function createButton(text, status, primary) {
+					return {
+						type: "button",
+						text: text,
+						subtype: primary ? 'primary' : '',
+						onClick: function(e) {
+							e.control.parents()[1].close();
+							callback(status);
+						}
+					};
+				}
+
+				switch (settings.buttons) {
+					case MessageBox.OK_CANCEL:
+						buttons = [
+							createButton('Ok', true, true),
+							createButton('Cancel', false)
+						];
+						break;
+
+					case MessageBox.YES_NO:
+					case MessageBox.YES_NO_CANCEL:
+						buttons = [
+							createButton('Yes', 1, true),
+							createButton('No', 0)
+						];
+
+						if (settings.buttons == MessageBox.YES_NO_CANCEL) {
+							buttons.push(createButton('Cancel', -1));
+						}
+						break;
+
+					default:
+						buttons = [
+							createButton('Ok', true, true)
+						];
+						break;
+				}
+
+				return new Window({
+					padding: 20,
+					x: settings.x,
+					y: settings.y,
+					minWidth: 300,
+					minHeight: 100,
+					layout: "flex",
+					pack: "center",
+					align: "center",
+					buttons: buttons,
+					title: settings.title,
+					role: 'alertdialog',
+					items: {
+						type: "label",
+						multiline: true,
+						maxWidth: 500,
+						maxHeight: 200,
+						text: settings.text
+					},
+					onPostRender: function() {
+						this.aria('describedby', this.items()[0]._id);
+					},
+					onClose: settings.onClose,
+					onCancel: function() {
+						callback(false);
+					}
+				}).renderTo(document.body).reflow();
+			},
+
+			/**
+			 * Creates a new alert dialog.
+			 *
+			 * @method alert
+			 * @param {Object} settings Settings for the alert dialog.
+			 * @param {function} [callback] Callback to execute when the user makes a choice.
+			 */
+			alert: function(settings, callback) {
+				if (typeof settings == "string") {
+					settings = {text: settings};
+				}
+
+				settings.callback = callback;
+				return MessageBox.msgBox(settings);
+			},
+
+			/**
+			 * Creates a new confirm dialog.
+			 *
+			 * @method confirm
+			 * @param {Object} settings Settings for the confirm dialog.
+			 * @param {function} [callback] Callback to execute when the user makes a choice.
+			 */
+			confirm: function(settings, callback) {
+				if (typeof settings == "string") {
+					settings = {text: settings};
+				}
+
+				settings.callback = callback;
+				settings.buttons = MessageBox.OK_CANCEL;
+
+				return MessageBox.msgBox(settings);
+			}
+		}
+	});
+
+	return MessageBox;
+});
+
+// Included from: js/tinymce/classes/WindowManager.js
+
+/**
+ * WindowManager.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles the creation of native windows and dialogs. This class can be extended to provide for example inline dialogs.
+ *
+ * @class tinymce.WindowManager
+ * @example
+ * // Opens a new dialog with the file.htm file and the size 320x240
+ * // It also adds a custom parameter this can be retrieved by using tinyMCEPopup.getWindowArg inside the dialog.
+ * tinymce.activeEditor.windowManager.open({
+ *    url: 'file.htm',
+ *    width: 320,
+ *    height: 240
+ * }, {
+ *    custom_param: 1
+ * });
+ *
+ * // Displays an alert box using the active editors window manager instance
+ * tinymce.activeEditor.windowManager.alert('Hello world!');
+ *
+ * // Displays an confirm box and an alert message will be displayed depending on what you choose in the confirm
+ * tinymce.activeEditor.windowManager.confirm("Do you want to do something", function(s) {
+ *    if (s)
+ *       tinymce.activeEditor.windowManager.alert("Ok");
+ *    else
+ *       tinymce.activeEditor.windowManager.alert("Cancel");
+ * });
+ */
+define("tinymce/WindowManager", [
+	"tinymce/ui/Window",
+	"tinymce/ui/MessageBox"
+], function(Window, MessageBox) {
+	return function(editor) {
+		var self = this, windows = [];
+
+		function getTopMostWindow() {
+			if (windows.length) {
+				return windows[windows.length - 1];
+			}
+		}
+
+		self.windows = windows;
+
+		editor.on('remove', function() {
+			var i = windows.length;
+
+			while (i--) {
+				windows[i].close();
+			}
+		});
+
+		/**
+		 * Opens a new window.
+		 *
+		 * @method open
+		 * @param {Object} args Optional name/value settings collection contains things like width/height/url etc.
+		 * @option {String} title Window title.
+		 * @option {String} file URL of the file to open in the window.
+		 * @option {Number} width Width in pixels.
+		 * @option {Number} height Height in pixels.
+		 * @option {Boolean} autoScroll Specifies whether the popup window can have scrollbars if required (i.e. content
+		 * larger than the popup size specified).
+		 */
+		self.open = function(args, params) {
+			var win;
+
+			editor.editorManager.setActive(editor);
+
+			args.title = args.title || ' ';
+
+			// Handle URL
+			args.url = args.url || args.file; // Legacy
+			if (args.url) {
+				args.width = parseInt(args.width || 320, 10);
+				args.height = parseInt(args.height || 240, 10);
+			}
+
+			// Handle body
+			if (args.body) {
+				args.items = {
+					defaults: args.defaults,
+					type: args.bodyType || 'form',
+					items: args.body
+				};
+			}
+
+			if (!args.url && !args.buttons) {
+				args.buttons = [
+					{text: 'Ok', subtype: 'primary', onclick: function() {
+						win.find('form')[0].submit();
+					}},
+
+					{text: 'Cancel', onclick: function() {
+						win.close();
+					}}
+				];
+			}
+
+			win = new Window(args);
+			windows.push(win);
+
+			win.on('close', function() {
+				var i = windows.length;
+
+				while (i--) {
+					if (windows[i] === win) {
+						windows.splice(i, 1);
+					}
+				}
+
+				if (!windows.length) {
+					editor.focus();
+				}
+			});
+
+			// Handle data
+			if (args.data) {
+				win.on('postRender', function() {
+					this.find('*').each(function(ctrl) {
+						var name = ctrl.name();
+
+						if (name in args.data) {
+							ctrl.value(args.data[name]);
+						}
+					});
+				});
+			}
+
+			// store args and parameters
+			win.features = args || {};
+			win.params = params || {};
+
+			// Takes a snapshot in the FocusManager of the selection before focus is lost to dialog
+			if (windows.length === 1) {
+				editor.nodeChanged();
+			}
+
+			return win.renderTo().reflow();
+		};
+
+		/**
+		 * Creates a alert dialog. Please don't use the blocking behavior of this
+		 * native version use the callback method instead then it can be extended.
+		 *
+		 * @method alert
+		 * @param {String} message Text to display in the new alert dialog.
+		 * @param {function} callback Callback function to be executed after the user has selected ok.
+		 * @param {Object} scope Optional scope to execute the callback in.
+		 * @example
+		 * // Displays an alert box using the active editors window manager instance
+		 * tinymce.activeEditor.windowManager.alert('Hello world!');
+		 */
+		self.alert = function(message, callback, scope) {
+			MessageBox.alert(message, function() {
+				if (callback) {
+					callback.call(scope || this);
+				} else {
+					editor.focus();
+				}
+			});
+		};
+
+		/**
+		 * Creates a confirm dialog. Please don't use the blocking behavior of this
+		 * native version use the callback method instead then it can be extended.
+		 *
+		 * @method confirm
+		 * @param {String} messageText to display in the new confirm dialog.
+		 * @param {function} callback Callback function to be executed after the user has selected ok or cancel.
+		 * @param {Object} scope Optional scope to execute the callback in.
+		 * @example
+		 * // Displays an confirm box and an alert message will be displayed depending on what you choose in the confirm
+		 * tinymce.activeEditor.windowManager.confirm("Do you want to do something", function(s) {
+		 *    if (s)
+		 *       tinymce.activeEditor.windowManager.alert("Ok");
+		 *    else
+		 *       tinymce.activeEditor.windowManager.alert("Cancel");
+		 * });
+		 */
+		self.confirm = function(message, callback, scope) {
+			MessageBox.confirm(message, function(state) {
+				callback.call(scope || this, state);
+			});
+		};
+
+		/**
+		 * Closes the top most window.
+		 *
+		 * @method close
+		 */
+		self.close = function() {
+			if (getTopMostWindow()) {
+				getTopMostWindow().close();
+			}
+		};
+
+		/**
+		 * Returns the params of the last window open call. This can be used in iframe based
+		 * dialog to get params passed from the tinymce plugin.
+		 *
+		 * @example
+		 * var dialogArguments = top.tinymce.activeEditor.windowManager.getParams();
+		 *
+		 * @method getParams
+		 * @return {Object} Name/value object with parameters passed from windowManager.open call.
+		 */
+		self.getParams = function() {
+			return getTopMostWindow() ? getTopMostWindow().params : null;
+		};
+
+		/**
+		 * Sets the params of the last opened window.
+		 *
+		 * @method setParams
+		 * @param {Object} params Params object to set for the last opened window.
+		 */
+		self.setParams = function(params) {
+			if (getTopMostWindow()) {
+				getTopMostWindow().params = params;
+			}
+		};
+
+		/**
+		 * Returns the currently opened window objects.
+		 *
+		 * @method getWindows
+		 * @return {Array} Array of the currently opened windows.
+		 */
+		self.getWindows = function() {
+			return windows;
+		};
+	};
+});
+
+// Included from: js/tinymce/classes/util/Quirks.js
+
+/**
+ * Quirks.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ *
+ * @ignore-file
+ */
+
+/**
+ * This file includes fixes for various browser quirks it's made to make it easy to add/remove browser specific fixes.
+ *
+ * @class tinymce.util.Quirks
+ */
+define("tinymce/util/Quirks", [
+	"tinymce/util/VK",
+	"tinymce/dom/RangeUtils",
+	"tinymce/dom/TreeWalker",
+	"tinymce/html/Node",
+	"tinymce/html/Entities",
+	"tinymce/Env",
+	"tinymce/util/Tools"
+], function(VK, RangeUtils, TreeWalker, Node, Entities, Env, Tools) {
+	return function(editor) {
+		var each = Tools.each, $ = editor.$;
+		var BACKSPACE = VK.BACKSPACE, DELETE = VK.DELETE, dom = editor.dom, selection = editor.selection,
+			settings = editor.settings, parser = editor.parser, serializer = editor.serializer;
+		var isGecko = Env.gecko, isIE = Env.ie, isWebKit = Env.webkit;
+		var mceInternalUrlPrefix = 'data:text/mce-internal,';
+		var mceInternalDataType = isIE ? 'Text' : 'URL';
+
+		/**
+		 * Executes a command with a specific state this can be to enable/disable browser editing features.
+		 */
+		function setEditorCommandState(cmd, state) {
+			try {
+				editor.getDoc().execCommand(cmd, false, state);
+			} catch (ex) {
+				// Ignore
+			}
+		}
+
+		/**
+		 * Returns current IE document mode.
+		 */
+		function getDocumentMode() {
+			var documentMode = editor.getDoc().documentMode;
+
+			return documentMode ? documentMode : 6;
+		}
+
+		/**
+		 * Returns true/false if the event is prevented or not.
+		 *
+		 * @private
+		 * @param {Event} e Event object.
+		 * @return {Boolean} true/false if the event is prevented or not.
+		 */
+		function isDefaultPrevented(e) {
+			return e.isDefaultPrevented();
+		}
+
+		/**
+		 * Sets Text/URL data on the event's dataTransfer object to a special data:text/mce-internal url.
+		 * This is to workaround the inability to set custom contentType on IE and Safari.
+		 * The editor's selected content is encoded into this url so drag and drop between editors will work.
+		 *
+		 * @private
+		 * @param {DragEvent} e Event object
+		 */
+		function setMceInteralContent(e) {
+			var selectionHtml;
+
+			if (e.dataTransfer) {
+				if (editor.selection.isCollapsed() && e.target.tagName == 'IMG') {
+					selection.select(e.target);
+				}
+
+				selectionHtml = editor.selection.getContent();
+
+				// Safari/IE doesn't support custom dataTransfer items so we can only use URL and Text
+				if (selectionHtml.length > 0) {
+					e.dataTransfer.setData(mceInternalDataType, mceInternalUrlPrefix + escape(selectionHtml));
+				}
+			}
+		}
+
+		/**
+		 * Gets content of special data:text/mce-internal url on the event's dataTransfer object.
+		 * This is to workaround the inability to set custom contentType on IE and Safari.
+		 * The editor's selected content is encoded into this url so drag and drop between editors will work.
+		 *
+		 * @private
+		 * @param {DragEvent} e Event object
+		 * @returns {String} mce-internal content
+		 */
+		function getMceInternalContent(e) {
+			var internalContent, content;
+
+			if (e.dataTransfer) {
+				internalContent = e.dataTransfer.getData(mceInternalDataType);
+
+				if (internalContent && internalContent.indexOf(mceInternalUrlPrefix) >= 0) {
+					content = unescape(internalContent.substr(mceInternalUrlPrefix.length));
+				}
+			}
+
+			return content;
+		}
+
+		/**
+		 * Inserts contents using the paste clipboard command if it's available if it isn't it will fallback
+		 * to the core command.
+		 *
+		 * @private
+		 * @param {String} content Content to insert at selection.
+		 */
+		function insertClipboardContents(content) {
+			if (editor.queryCommandSupported('mceInsertClipboardContent')) {
+				editor.execCommand('mceInsertClipboardContent', false, {content: content});
+			} else {
+				editor.execCommand('mceInsertContent', false, content);
+			}
+		}
+
+		/**
+		 * Fixes a WebKit bug when deleting contents using backspace or delete key.
+		 * WebKit will produce a span element if you delete across two block elements.
+		 *
+		 * Example:
+		 * <h1>a</h1><p>|b</p>
+		 *
+		 * Will produce this on backspace:
+		 * <h1>a<span style="<all runtime styles>">b</span></p>
+		 *
+		 * This fixes the backspace to produce:
+		 * <h1>a|b</p>
+		 *
+		 * See bug: https://bugs.webkit.org/show_bug.cgi?id=45784
+		 *
+		 * This fixes the following delete scenarios:
+		 *  1. Delete by pressing backspace key.
+		 *  2. Delete by pressing delete key.
+		 *  3. Delete by pressing backspace key with ctrl/cmd (Word delete).
+		 *  4. Delete by pressing delete key with ctrl/cmd (Word delete).
+		 *  5. Delete by drag/dropping contents inside the editor.
+		 *  6. Delete by using Cut Ctrl+X/Cmd+X.
+		 *  7. Delete by selecting contents and writing a character.
+		 *
+		 * This code is a ugly hack since writing full custom delete logic for just this bug
+		 * fix seemed like a huge task. I hope we can remove this before the year 2030.
+		 */
+		function cleanupStylesWhenDeleting() {
+			var doc = editor.getDoc(), dom = editor.dom, selection = editor.selection;
+			var MutationObserver = window.MutationObserver, olderWebKit, dragStartRng;
+
+			// Add mini polyfill for older WebKits
+			// TODO: Remove this when old Safari versions gets updated
+			if (!MutationObserver) {
+				olderWebKit = true;
+
+				MutationObserver = function() {
+					var records = [], target;
+
+					function nodeInsert(e) {
+						var target = e.relatedNode || e.target;
+						records.push({target: target, addedNodes: [target]});
+					}
+
+					function attrModified(e) {
+						var target = e.relatedNode || e.target;
+						records.push({target: target, attributeName: e.attrName});
+					}
+
+					this.observe = function(node) {
+						target = node;
+						target.addEventListener('DOMSubtreeModified', nodeInsert, false);
+						target.addEventListener('DOMNodeInsertedIntoDocument', nodeInsert, false);
+						target.addEventListener('DOMNodeInserted', nodeInsert, false);
+						target.addEventListener('DOMAttrModified', attrModified, false);
+					};
+
+					this.disconnect = function() {
+						target.removeEventListener('DOMSubtreeModified', nodeInsert, false);
+						target.removeEventListener('DOMNodeInsertedIntoDocument', nodeInsert, false);
+						target.removeEventListener('DOMNodeInserted', nodeInsert, false);
+						target.removeEventListener('DOMAttrModified', attrModified, false);
+					};
+
+					this.takeRecords = function() {
+						return records;
+					};
+				};
+			}
+
+			function isTrailingBr(node) {
+				var blockElements = dom.schema.getBlockElements(), rootNode = editor.getBody();
+
+				if (node.nodeName != 'BR') {
+					return false;
+				}
+
+				for (node = node; node != rootNode && !blockElements[node.nodeName]; node = node.parentNode) {
+					if (node.nextSibling) {
+						return false;
+					}
+				}
+
+				return true;
+			}
+
+			function isSiblingsIgnoreWhiteSpace(node1, node2) {
+				var node;
+
+				for (node = node1.nextSibling; node && node != node2; node = node.nextSibling) {
+					if (node.nodeType == 3 && $.trim(node.data).length === 0) {
+						continue;
+					}
+
+					if (node !== node2) {
+						return false;
+					}
+				}
+
+				return node === node2;
+			}
+
+			function findCaretNode(node, forward, startNode) {
+				var walker, current, nonEmptyElements;
+
+				nonEmptyElements = dom.schema.getNonEmptyElements();
+
+				walker = new TreeWalker(startNode || node, node);
+
+				while ((current = walker[forward ? 'next' : 'prev']())) {
+					if (nonEmptyElements[current.nodeName] && !isTrailingBr(current)) {
+						return current;
+					}
+
+					if (current.nodeType == 3 && current.data.length > 0) {
+						return current;
+					}
+				}
+			}
+
+			function deleteRangeBetweenTextBlocks(rng) {
+				var startBlock, endBlock, caretNodeBefore, caretNodeAfter, textBlockElements;
+
+				if (rng.collapsed) {
+					return;
+				}
+
+				startBlock = dom.getParent(RangeUtils.getNode(rng.startContainer, rng.startOffset), dom.isBlock);
+				endBlock = dom.getParent(RangeUtils.getNode(rng.endContainer, rng.endOffset), dom.isBlock);
+				textBlockElements = editor.schema.getTextBlockElements();
+
+				if (startBlock == endBlock) {
+					return;
+				}
+
+				if (!textBlockElements[startBlock.nodeName] || !textBlockElements[endBlock.nodeName]) {
+					return;
+				}
+
+				if (dom.getContentEditable(startBlock) === "false" || dom.getContentEditable(endBlock) === "false") {
+					return;
+				}
+
+				rng.deleteContents();
+
+				caretNodeBefore = findCaretNode(startBlock, false);
+				caretNodeAfter = findCaretNode(endBlock, true);
+
+				if (!dom.isEmpty(endBlock)) {
+					$(startBlock).append(endBlock.childNodes);
+				}
+
+				$(endBlock).remove();
+
+				if (caretNodeBefore) {
+					if (caretNodeBefore.nodeType == 1) {
+						if (caretNodeBefore.nodeName == "BR") {
+							rng.setStartBefore(caretNodeBefore);
+							rng.setEndBefore(caretNodeBefore);
+						} else {
+							rng.setStartAfter(caretNodeBefore);
+							rng.setEndAfter(caretNodeBefore);
+						}
+					} else {
+						rng.setStart(caretNodeBefore, caretNodeBefore.data.length);
+						rng.setEnd(caretNodeBefore, caretNodeBefore.data.length);
+					}
+				} else if (caretNodeAfter) {
+					if (caretNodeAfter.nodeType == 1) {
+						rng.setStartBefore(caretNodeAfter);
+						rng.setEndBefore(caretNodeAfter);
+					} else {
+						rng.setStart(caretNodeAfter, 0);
+						rng.setEnd(caretNodeAfter, 0);
+					}
+				}
+
+				selection.setRng(rng);
+
+				return true;
+			}
+
+			function expandBetweenBlocks(rng, isForward) {
+				var caretNode, targetCaretNode, textBlock, targetTextBlock, container, offset;
+
+				if (!rng.collapsed) {
+					return rng;
+				}
+
+				container = rng.startContainer;
+				offset = rng.startOffset;
+
+				if (container.nodeType == 3) {
+					if (isForward) {
+						if (offset < container.data.length) {
+							return rng;
+						}
+					} else {
+						if (offset > 0) {
+							return rng;
+						}
+					}
+				}
+
+				caretNode = RangeUtils.getNode(rng.startContainer, rng.startOffset);
+				textBlock = dom.getParent(caretNode, dom.isBlock);
+				targetCaretNode = findCaretNode(editor.getBody(), isForward, caretNode);
+				targetTextBlock = dom.getParent(targetCaretNode, dom.isBlock);
+
+				if (!caretNode || !targetCaretNode) {
+					return rng;
+				}
+
+				if (targetTextBlock && textBlock != targetTextBlock) {
+					if (!isForward) {
+						if (!isSiblingsIgnoreWhiteSpace(targetTextBlock, textBlock)) {
+							return rng;
+						}
+
+						if (targetCaretNode.nodeType == 1) {
+							if (targetCaretNode.nodeName == "BR") {
+								rng.setStartBefore(targetCaretNode);
+							} else {
+								rng.setStartAfter(targetCaretNode);
+							}
+						} else {
+							rng.setStart(targetCaretNode, targetCaretNode.data.length);
+						}
+
+						if (caretNode.nodeType == 1) {
+							rng.setEnd(caretNode, 0);
+						} else {
+							rng.setEndBefore(caretNode);
+						}
+					} else {
+						if (!isSiblingsIgnoreWhiteSpace(textBlock, targetTextBlock)) {
+							return rng;
+						}
+
+						if (caretNode.nodeType == 1) {
+							if (caretNode.nodeName == "BR") {
+								rng.setStartBefore(caretNode);
+							} else {
+								rng.setStartAfter(caretNode);
+							}
+						} else {
+							rng.setStart(caretNode, caretNode.data.length);
+						}
+
+						if (targetCaretNode.nodeType == 1) {
+							rng.setEnd(targetCaretNode, 0);
+						} else {
+							rng.setEndBefore(targetCaretNode);
+						}
+					}
+				}
+
+				return rng;
+			}
+
+			function handleTextBlockMergeDelete(isForward) {
+				var rng = selection.getRng();
+
+				rng = expandBetweenBlocks(rng, isForward);
+
+				if (deleteRangeBetweenTextBlocks(rng)) {
+					return true;
+				}
+			}
+
+			function customDelete(isForward) {
+				var mutationObserver, rng, caretElement;
+
+				if (handleTextBlockMergeDelete(isForward)) {
+					return;
+				}
+
+				Tools.each(editor.getBody().getElementsByTagName('*'), function(elm) {
+					// Mark existing spans
+					if (elm.tagName == 'SPAN') {
+						elm.setAttribute('mce-data-marked', 1);
+					}
+
+					// Make sure all elements has a data-mce-style attribute
+					if (!elm.hasAttribute('data-mce-style') && elm.hasAttribute('style')) {
+						editor.dom.setAttrib(elm, 'style', editor.dom.getAttrib(elm, 'style'));
+					}
+				});
+
+				// Observe added nodes and style attribute changes
+				mutationObserver = new MutationObserver(function() {});
+				mutationObserver.observe(editor.getDoc(), {
+					childList: true,
+					attributes: true,
+					subtree: true,
+					attributeFilter: ['style']
+				});
+
+				editor.getDoc().execCommand(isForward ? 'ForwardDelete' : 'Delete', false, null);
+
+				rng = editor.selection.getRng();
+				caretElement = rng.startContainer.parentNode;
+
+				Tools.each(mutationObserver.takeRecords(), function(record) {
+					if (!dom.isChildOf(record.target, editor.getBody())) {
+						return;
+					}
+
+					// Restore style attribute to previous value
+					if (record.attributeName == "style") {
+						var oldValue = record.target.getAttribute('data-mce-style');
+
+						if (oldValue) {
+							record.target.setAttribute("style", oldValue);
+						} else {
+							record.target.removeAttribute("style");
+						}
+					}
+
+					// Remove all spans that isn't maked and retain selection
+					Tools.each(record.addedNodes, function(node) {
+						if (node.nodeName == "SPAN" && !node.getAttribute('mce-data-marked')) {
+							var offset, container;
+
+							if (node == caretElement) {
+								offset = rng.startOffset;
+								container = node.firstChild;
+							}
+
+							dom.remove(node, true);
+
+							if (container) {
+								rng.setStart(container, offset);
+								rng.setEnd(container, offset);
+								editor.selection.setRng(rng);
+							}
+						}
+					});
+				});
+
+				mutationObserver.disconnect();
+
+				// Remove any left over marks
+				Tools.each(editor.dom.select('span[mce-data-marked]'), function(span) {
+					span.removeAttribute('mce-data-marked');
+				});
+			}
+
+			editor.on('keydown', function(e) {
+				var isForward = e.keyCode == DELETE, isMetaOrCtrl = e.ctrlKey || e.metaKey;
+
+				if (!isDefaultPrevented(e) && (isForward || e.keyCode == BACKSPACE)) {
+					var rng = editor.selection.getRng(), container = rng.startContainer, offset = rng.startOffset;
+
+					// Ignore non meta delete in the where there is text before/after the caret
+					if (!isMetaOrCtrl && rng.collapsed && container.nodeType == 3) {
+						if (isForward ? offset < container.data.length : offset > 0) {
+							return;
+						}
+					}
+
+					e.preventDefault();
+
+					if (isMetaOrCtrl) {
+						editor.selection.getSel().modify("extend", isForward ? "forward" : "backward", e.metaKey ? "lineboundary" : "word");
+					}
+
+					customDelete(isForward);
+				}
+			});
+
+			// Handle case where text is deleted by typing over
+			editor.on('keypress', function(e) {
+				if (!isDefaultPrevented(e) && !selection.isCollapsed() && e.charCode && !VK.metaKeyPressed(e)) {
+					var rng, currentFormatNodes, fragmentNode, blockParent, caretNode, charText;
+
+					rng = editor.selection.getRng();
+					charText = String.fromCharCode(e.charCode);
+					e.preventDefault();
+
+					// Keep track of current format nodes
+					currentFormatNodes = $(rng.startContainer).parents().filter(function(idx, node) {
+						return !!editor.schema.getTextInlineElements()[node.nodeName];
+					});
+
+					customDelete(true);
+
+					// Check if the browser removed them
+					currentFormatNodes = currentFormatNodes.filter(function(idx, node) {
+						return !$.contains(editor.getBody(), node);
+					});
+
+					// Then re-add them
+					if (currentFormatNodes.length) {
+						fragmentNode = dom.createFragment();
+
+						currentFormatNodes.each(function(idx, formatNode) {
+							formatNode = formatNode.cloneNode(false);
+
+							if (fragmentNode.hasChildNodes()) {
+								formatNode.appendChild(fragmentNode.firstChild);
+								fragmentNode.appendChild(formatNode);
+							} else {
+								caretNode = formatNode;
+								fragmentNode.appendChild(formatNode);
+							}
+
+							fragmentNode.appendChild(formatNode);
+						});
+
+						caretNode.appendChild(editor.getDoc().createTextNode(charText));
+
+						// Prevent edge case where older WebKit would add an extra BR element
+						blockParent = dom.getParent(rng.startContainer, dom.isBlock);
+						if (dom.isEmpty(blockParent)) {
+							$(blockParent).empty().append(fragmentNode);
+						} else {
+							rng.insertNode(fragmentNode);
+						}
+
+						rng.setStart(caretNode.firstChild, 1);
+						rng.setEnd(caretNode.firstChild, 1);
+						editor.selection.setRng(rng);
+					} else {
+						editor.selection.setContent(charText);
+					}
+				}
+			});
+
+			editor.addCommand('Delete', function() {
+				customDelete();
+			});
+
+			editor.addCommand('ForwardDelete', function() {
+				customDelete(true);
+			});
+
+			// Older WebKits doesn't properly handle the clipboard so we can't add the rest
+			if (olderWebKit) {
+				return;
+			}
+
+			editor.on('dragstart', function(e) {
+				dragStartRng = selection.getRng();
+				setMceInteralContent(e);
+			});
+
+			editor.on('drop', function(e) {
+				if (!isDefaultPrevented(e)) {
+					var internalContent = getMceInternalContent(e);
+					if (internalContent) {
+						e.preventDefault();
+
+						// Safari has a weird issue where drag/dropping images sometimes
+						// produces a green plus icon. When this happens the caretRangeFromPoint
+						// will return "null" even though the x, y coordinate is correct.
+						// But if we detach the insert from the drop event we will get a proper range
+						window.setTimeout(function() {
+							var pointRng = RangeUtils.getCaretRangeFromPoint(e.x, e.y, doc);
+
+							if (dragStartRng) {
+								selection.setRng(dragStartRng);
+								dragStartRng = null;
+							}
+
+							customDelete();
+							selection.setRng(pointRng);
+							insertClipboardContents(internalContent);
+						}, 0);
+					}
+				}
+			});
+
+			editor.on('cut', function(e) {
+				if (!isDefaultPrevented(e) && e.clipboardData) {
+					e.preventDefault();
+					e.clipboardData.clearData();
+					e.clipboardData.setData('text/html', editor.selection.getContent());
+					e.clipboardData.setData('text/plain', editor.selection.getContent({format: 'text'}));
+					customDelete(true);
+				}
+			});
+		}
+
+		/**
+		 * Makes sure that the editor body becomes empty when backspace or delete is pressed in empty editors.
+		 *
+		 * For example:
+		 * <p><b>|</b></p>
+		 *
+		 * Or:
+		 * <h1>|</h1>
+		 *
+		 * Or:
+		 * [<h1></h1>]
+		 */
+		function emptyEditorWhenDeleting() {
+			function serializeRng(rng) {
+				var body = dom.create("body");
+				var contents = rng.cloneContents();
+				body.appendChild(contents);
+				return selection.serializer.serialize(body, {format: 'html'});
+			}
+
+			function allContentsSelected(rng) {
+				if (!rng.setStart) {
+					if (rng.item) {
+						return false;
+					}
+
+					var bodyRng = rng.duplicate();
+					bodyRng.moveToElementText(editor.getBody());
+					return RangeUtils.compareRanges(rng, bodyRng);
+				}
+
+				var selection = serializeRng(rng);
+
+				var allRng = dom.createRng();
+				allRng.selectNode(editor.getBody());
+
+				var allSelection = serializeRng(allRng);
+				return selection === allSelection;
+			}
+
+			editor.on('keydown', function(e) {
+				var keyCode = e.keyCode, isCollapsed, body;
+
+				// Empty the editor if it's needed for example backspace at <p><b>|</b></p>
+				if (!isDefaultPrevented(e) && (keyCode == DELETE || keyCode == BACKSPACE)) {
+					isCollapsed = editor.selection.isCollapsed();
+					body = editor.getBody();
+
+					// Selection is collapsed but the editor isn't empty
+					if (isCollapsed && !dom.isEmpty(body)) {
+						return;
+					}
+
+					// Selection isn't collapsed but not all the contents is selected
+					if (!isCollapsed && !allContentsSelected(editor.selection.getRng())) {
+						return;
+					}
+
+					// Manually empty the editor
+					e.preventDefault();
+					editor.setContent('');
+
+					if (body.firstChild && dom.isBlock(body.firstChild)) {
+						editor.selection.setCursorLocation(body.firstChild, 0);
+					} else {
+						editor.selection.setCursorLocation(body, 0);
+					}
+
+					editor.nodeChanged();
+				}
+			});
+		}
+
+		/**
+		 * WebKit doesn't select all the nodes in the body when you press Ctrl+A.
+		 * IE selects more than the contents <body>[<p>a</p>]</body> instead of <body><p>[a]</p]</body> see bug #6438
+		 * This selects the whole body so that backspace/delete logic will delete everything
+		 */
+		function selectAll() {
+			editor.shortcuts.add('meta+a', null, 'SelectAll');
+		}
+
+		/**
+		 * WebKit has a weird issue where it some times fails to properly convert keypresses to input method keystrokes.
+		 * The IME on Mac doesn't initialize when it doesn't fire a proper focus event.
+		 *
+		 * This seems to happen when the user manages to click the documentElement element then the window doesn't get proper focus until
+		 * you enter a character into the editor.
+		 *
+		 * It also happens when the first focus in made to the body.
+		 *
+		 * See: https://bugs.webkit.org/show_bug.cgi?id=83566
+		 */
+		function inputMethodFocus() {
+			if (!editor.settings.content_editable) {
+				// Case 1 IME doesn't initialize if you focus the document
+				dom.bind(editor.getDoc(), 'focusin', function() {
+					selection.setRng(selection.getRng());
+				});
+
+				// Case 2 IME doesn't initialize if you click the documentElement it also doesn't properly fire the focusin event
+				// Needs to be both down/up due to weird rendering bug on Chrome Windows
+				dom.bind(editor.getDoc(), 'mousedown mouseup', function(e) {
+					if (e.target == editor.getDoc().documentElement) {
+						editor.getBody().focus();
+
+						if (e.type == 'mousedown') {
+							// Edge case for mousedown, drag select and mousedown again within selection on Chrome Windows to render caret
+							selection.placeCaretAt(e.clientX, e.clientY);
+						} else {
+							selection.setRng(selection.getRng());
+						}
+					}
+				});
+			}
+		}
+
+		/**
+		 * Backspacing in FireFox/IE from a paragraph into a horizontal rule results in a floating text node because the
+		 * browser just deletes the paragraph - the browser fails to merge the text node with a horizontal rule so it is
+		 * left there. TinyMCE sees a floating text node and wraps it in a paragraph on the key up event (ForceBlocks.js
+		 * addRootBlocks), meaning the action does nothing. With this code, FireFox/IE matche the behaviour of other
+		 * browsers.
+		 *
+		 * It also fixes a bug on Firefox where it's impossible to delete HR elements.
+		 */
+		function removeHrOnBackspace() {
+			editor.on('keydown', function(e) {
+				if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {
+					// Check if there is any HR elements this is faster since getRng on IE 7 & 8 is slow
+					if (!editor.getBody().getElementsByTagName('hr').length) {
+						return;
+					}
+
+					if (selection.isCollapsed() && selection.getRng(true).startOffset === 0) {
+						var node = selection.getNode();
+						var previousSibling = node.previousSibling;
+
+						if (node.nodeName == 'HR') {
+							dom.remove(node);
+							e.preventDefault();
+							return;
+						}
+
+						if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === "hr") {
+							dom.remove(previousSibling);
+							e.preventDefault();
+						}
+					}
+				}
+			});
+		}
+
+		/**
+		 * Firefox 3.x has an issue where the body element won't get proper focus if you click out
+		 * side it's rectangle.
+		 */
+		function focusBody() {
+			// Fix for a focus bug in FF 3.x where the body element
+			// wouldn't get proper focus if the user clicked on the HTML element
+			if (!window.Range.prototype.getClientRects) { // Detect getClientRects got introduced in FF 4
+				editor.on('mousedown', function(e) {
+					if (!isDefaultPrevented(e) && e.target.nodeName === "HTML") {
+						var body = editor.getBody();
+
+						// Blur the body it's focused but not correctly focused
+						body.blur();
+
+						// Refocus the body after a little while
+						setTimeout(function() {
+							body.focus();
+						}, 0);
+					}
+				});
+			}
+		}
+
+		/**
+		 * WebKit has a bug where it isn't possible to select image, hr or anchor elements
+		 * by clicking on them so we need to fake that.
+		 */
+		function selectControlElements() {
+			editor.on('click', function(e) {
+				var target = e.target;
+
+				// Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250
+				// WebKit can't even do simple things like selecting an image
+				// Needs to be the setBaseAndExtend or it will fail to select floated images
+				if (/^(IMG|HR)$/.test(target.nodeName)) {
+					e.preventDefault();
+					selection.getSel().setBaseAndExtent(target, 0, target, 1);
+					editor.nodeChanged();
+				}
+
+				if (target.nodeName == 'A' && dom.hasClass(target, 'mce-item-anchor')) {
+					e.preventDefault();
+					selection.select(target);
+				}
+			});
+		}
+
+		/**
+		 * Fixes a Gecko bug where the style attribute gets added to the wrong element when deleting between two block elements.
+		 *
+		 * Fixes do backspace/delete on this:
+		 * <p>bla[ck</p><p style="color:red">r]ed</p>
+		 *
+		 * Would become:
+		 * <p>bla|ed</p>
+		 *
+		 * Instead of:
+		 * <p style="color:red">bla|ed</p>
+		 */
+		function removeStylesWhenDeletingAcrossBlockElements() {
+			function getAttributeApplyFunction() {
+				var template = dom.getAttribs(selection.getStart().cloneNode(false));
+
+				return function() {
+					var target = selection.getStart();
+
+					if (target !== editor.getBody()) {
+						dom.setAttrib(target, "style", null);
+
+						each(template, function(attr) {
+							target.setAttributeNode(attr.cloneNode(true));
+						});
+					}
+				};
+			}
+
+			function isSelectionAcrossElements() {
+				return !selection.isCollapsed() &&
+					dom.getParent(selection.getStart(), dom.isBlock) != dom.getParent(selection.getEnd(), dom.isBlock);
+			}
+
+			editor.on('keypress', function(e) {
+				var applyAttributes;
+
+				if (!isDefaultPrevented(e) && (e.keyCode == 8 || e.keyCode == 46) && isSelectionAcrossElements()) {
+					applyAttributes = getAttributeApplyFunction();
+					editor.getDoc().execCommand('delete', false, null);
+					applyAttributes();
+					e.preventDefault();
+					return false;
+				}
+			});
+
+			dom.bind(editor.getDoc(), 'cut', function(e) {
+				var applyAttributes;
+
+				if (!isDefaultPrevented(e) && isSelectionAcrossElements()) {
+					applyAttributes = getAttributeApplyFunction();
+
+					setTimeout(function() {
+						applyAttributes();
+					}, 0);
+				}
+			});
+		}
+
+		/**
+		 * Screen readers on IE needs to have the role application set on the body.
+		 */
+		function ensureBodyHasRoleApplication() {
+			document.body.setAttribute("role", "application");
+		}
+
+		/**
+		 * Backspacing into a table behaves differently depending upon browser type.
+		 * Therefore, disable Backspace when cursor immediately follows a table.
+		 */
+		function disableBackspaceIntoATable() {
+			editor.on('keydown', function(e) {
+				if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {
+					if (selection.isCollapsed() && selection.getRng(true).startOffset === 0) {
+						var previousSibling = selection.getNode().previousSibling;
+						if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === "table") {
+							e.preventDefault();
+							return false;
+						}
+					}
+				}
+			});
+		}
+
+		/**
+		 * Old IE versions can't properly render BR elements in PRE tags white in contentEditable mode. So this
+		 * logic adds a \n before the BR so that it will get rendered.
+		 */
+		function addNewLinesBeforeBrInPre() {
+			// IE8+ rendering mode does the right thing with BR in PRE
+			if (getDocumentMode() > 7) {
+				return;
+			}
+
+			// Enable display: none in area and add a specific class that hides all BR elements in PRE to
+			// avoid the caret from getting stuck at the BR elements while pressing the right arrow key
+			setEditorCommandState('RespectVisibilityInDesign', true);
+			editor.contentStyles.push('.mceHideBrInPre pre br {display: none}');
+			dom.addClass(editor.getBody(), 'mceHideBrInPre');
+
+			// Adds a \n before all BR elements in PRE to get them visual
+			parser.addNodeFilter('pre', function(nodes) {
+				var i = nodes.length, brNodes, j, brElm, sibling;
+
+				while (i--) {
+					brNodes = nodes[i].getAll('br');
+					j = brNodes.length;
+					while (j--) {
+						brElm = brNodes[j];
+
+						// Add \n before BR in PRE elements on older IE:s so the new lines get rendered
+						sibling = brElm.prev;
+						if (sibling && sibling.type === 3 && sibling.value.charAt(sibling.value - 1) != '\n') {
+							sibling.value += '\n';
+						} else {
+							brElm.parent.insert(new Node('#text', 3), brElm, true).value = '\n';
+						}
+					}
+				}
+			});
+
+			// Removes any \n before BR elements in PRE since other browsers and in contentEditable=false mode they will be visible
+			serializer.addNodeFilter('pre', function(nodes) {
+				var i = nodes.length, brNodes, j, brElm, sibling;
+
+				while (i--) {
+					brNodes = nodes[i].getAll('br');
+					j = brNodes.length;
+					while (j--) {
+						brElm = brNodes[j];
+						sibling = brElm.prev;
+						if (sibling && sibling.type == 3) {
+							sibling.value = sibling.value.replace(/\r?\n$/, '');
+						}
+					}
+				}
+			});
+		}
+
+		/**
+		 * Moves style width/height to attribute width/height when the user resizes an image on IE.
+		 */
+		function removePreSerializedStylesWhenSelectingControls() {
+			dom.bind(editor.getBody(), 'mouseup', function() {
+				var value, node = selection.getNode();
+
+				// Moved styles to attributes on IMG eements
+				if (node.nodeName == 'IMG') {
+					// Convert style width to width attribute
+					if ((value = dom.getStyle(node, 'width'))) {
+						dom.setAttrib(node, 'width', value.replace(/[^0-9%]+/g, ''));
+						dom.setStyle(node, 'width', '');
+					}
+
+					// Convert style height to height attribute
+					if ((value = dom.getStyle(node, 'height'))) {
+						dom.setAttrib(node, 'height', value.replace(/[^0-9%]+/g, ''));
+						dom.setStyle(node, 'height', '');
+					}
+				}
+			});
+		}
+
+		/**
+		 * Removes a blockquote when backspace is pressed at the beginning of it.
+		 *
+		 * For example:
+		 * <blockquote><p>|x</p></blockquote>
+		 *
+		 * Becomes:
+		 * <p>|x</p>
+		 */
+		function removeBlockQuoteOnBackSpace() {
+			// Add block quote deletion handler
+			editor.on('keydown', function(e) {
+				var rng, container, offset, root, parent;
+
+				if (isDefaultPrevented(e) || e.keyCode != VK.BACKSPACE) {
+					return;
+				}
+
+				rng = selection.getRng();
+				container = rng.startContainer;
+				offset = rng.startOffset;
+				root = dom.getRoot();
+				parent = container;
+
+				if (!rng.collapsed || offset !== 0) {
+					return;
+				}
+
+				while (parent && parent.parentNode && parent.parentNode.firstChild == parent && parent.parentNode != root) {
+					parent = parent.parentNode;
+				}
+
+				// Is the cursor at the beginning of a blockquote?
+				if (parent.tagName === 'BLOCKQUOTE') {
+					// Remove the blockquote
+					editor.formatter.toggle('blockquote', null, parent);
+
+					// Move the caret to the beginning of container
+					rng = dom.createRng();
+					rng.setStart(container, 0);
+					rng.setEnd(container, 0);
+					selection.setRng(rng);
+				}
+			});
+		}
+
+		/**
+		 * Sets various Gecko editing options on mouse down and before a execCommand to disable inline table editing that is broken etc.
+		 */
+		function setGeckoEditingOptions() {
+			function setOpts() {
+				editor._refreshContentEditable();
+
+				setEditorCommandState("StyleWithCSS", false);
+				setEditorCommandState("enableInlineTableEditing", false);
+
+				if (!settings.object_resizing) {
+					setEditorCommandState("enableObjectResizing", false);
+				}
+			}
+
+			if (!settings.readonly) {
+				editor.on('BeforeExecCommand MouseDown', setOpts);
+			}
+		}
+
+		/**
+		 * Fixes a gecko link bug, when a link is placed at the end of block elements there is
+		 * no way to move the caret behind the link. This fix adds a bogus br element after the link.
+		 *
+		 * For example this:
+		 * <p><b><a href="#">x</a></b></p>
+		 *
+		 * Becomes this:
+		 * <p><b><a href="#">x</a></b><br></p>
+		 */
+		function addBrAfterLastLinks() {
+			function fixLinks() {
+				each(dom.select('a'), function(node) {
+					var parentNode = node.parentNode, root = dom.getRoot();
+
+					if (parentNode.lastChild === node) {
+						while (parentNode && !dom.isBlock(parentNode)) {
+							if (parentNode.parentNode.lastChild !== parentNode || parentNode === root) {
+								return;
+							}
+
+							parentNode = parentNode.parentNode;
+						}
+
+						dom.add(parentNode, 'br', {'data-mce-bogus': 1});
+					}
+				});
+			}
+
+			editor.on('SetContent ExecCommand', function(e) {
+				if (e.type == "setcontent" || e.command === 'mceInsertLink') {
+					fixLinks();
+				}
+			});
+		}
+
+		/**
+		 * WebKit will produce DIV elements here and there by default. But since TinyMCE uses paragraphs by
+		 * default we want to change that behavior.
+		 */
+		function setDefaultBlockType() {
+			if (settings.forced_root_block) {
+				editor.on('init', function() {
+					setEditorCommandState('DefaultParagraphSeparator', settings.forced_root_block);
+				});
+			}
+		}
+
+		/**
+		 * Removes ghost selections from images/tables on Gecko.
+		 */
+		function removeGhostSelection() {
+			editor.on('Undo Redo SetContent', function(e) {
+				if (!e.initial) {
+					editor.execCommand('mceRepaint');
+				}
+			});
+		}
+
+		/**
+		 * Deletes the selected image on IE instead of navigating to previous page.
+		 */
+		function deleteControlItemOnBackSpace() {
+			editor.on('keydown', function(e) {
+				var rng;
+
+				if (!isDefaultPrevented(e) && e.keyCode == BACKSPACE) {
+					rng = editor.getDoc().selection.createRange();
+					if (rng && rng.item) {
+						e.preventDefault();
+						editor.undoManager.beforeChange();
+						dom.remove(rng.item(0));
+						editor.undoManager.add();
+					}
+				}
+			});
+		}
+
+		/**
+		 * IE10 doesn't properly render block elements with the right height until you add contents to them.
+		 * This fixes that by adding a padding-right to all empty text block elements.
+		 * See: https://connect.microsoft.com/IE/feedback/details/743881
+		 */
+		function renderEmptyBlocksFix() {
+			var emptyBlocksCSS;
+
+			// IE10+
+			if (getDocumentMode() >= 10) {
+				emptyBlocksCSS = '';
+				each('p div h1 h2 h3 h4 h5 h6'.split(' '), function(name, i) {
+					emptyBlocksCSS += (i > 0 ? ',' : '') + name + ':empty';
+				});
+
+				editor.contentStyles.push(emptyBlocksCSS + '{padding-right: 1px !important}');
+			}
+		}
+
+		/**
+		 * Old IE versions can't retain contents within noscript elements so this logic will store the contents
+		 * as a attribute and the insert that value as it's raw text when the DOM is serialized.
+		 */
+		function keepNoScriptContents() {
+			if (getDocumentMode() < 9) {
+				parser.addNodeFilter('noscript', function(nodes) {
+					var i = nodes.length, node, textNode;
+
+					while (i--) {
+						node = nodes[i];
+						textNode = node.firstChild;
+
+						if (textNode) {
+							node.attr('data-mce-innertext', textNode.value);
+						}
+					}
+				});
+
+				serializer.addNodeFilter('noscript', function(nodes) {
+					var i = nodes.length, node, textNode, value;
+
+					while (i--) {
+						node = nodes[i];
+						textNode = nodes[i].firstChild;
+
+						if (textNode) {
+							textNode.value = Entities.decode(textNode.value);
+						} else {
+							// Old IE can't retain noscript value so an attribute is used to store it
+							value = node.attributes.map['data-mce-innertext'];
+							if (value) {
+								node.attr('data-mce-innertext', null);
+								textNode = new Node('#text', 3);
+								textNode.value = value;
+								textNode.raw = true;
+								node.append(textNode);
+							}
+						}
+					}
+				});
+			}
+		}
+
+		/**
+		 * IE has an issue where you can't select/move the caret by clicking outside the body if the document is in standards mode.
+		 */
+		function fixCaretSelectionOfDocumentElementOnIe() {
+			var doc = dom.doc, body = doc.body, started, startRng, htmlElm;
+
+			// Return range from point or null if it failed
+			function rngFromPoint(x, y) {
+				var rng = body.createTextRange();
+
+				try {
+					rng.moveToPoint(x, y);
+				} catch (ex) {
+					// IE sometimes throws and exception, so lets just ignore it
+					rng = null;
+				}
+
+				return rng;
+			}
+
+			// Fires while the selection is changing
+			function selectionChange(e) {
+				var pointRng;
+
+				// Check if the button is down or not
+				if (e.button) {
+					// Create range from mouse position
+					pointRng = rngFromPoint(e.x, e.y);
+
+					if (pointRng) {
+						// Check if pointRange is before/after selection then change the endPoint
+						if (pointRng.compareEndPoints('StartToStart', startRng) > 0) {
+							pointRng.setEndPoint('StartToStart', startRng);
+						} else {
+							pointRng.setEndPoint('EndToEnd', startRng);
+						}
+
+						pointRng.select();
+					}
+				} else {
+					endSelection();
+				}
+			}
+
+			// Removes listeners
+			function endSelection() {
+				var rng = doc.selection.createRange();
+
+				// If the range is collapsed then use the last start range
+				if (startRng && !rng.item && rng.compareEndPoints('StartToEnd', rng) === 0) {
+					startRng.select();
+				}
+
+				dom.unbind(doc, 'mouseup', endSelection);
+				dom.unbind(doc, 'mousemove', selectionChange);
+				startRng = started = 0;
+			}
+
+			// Make HTML element unselectable since we are going to handle selection by hand
+			doc.documentElement.unselectable = true;
+
+			// Detect when user selects outside BODY
+			dom.bind(doc, 'mousedown contextmenu', function(e) {
+				if (e.target.nodeName === 'HTML') {
+					if (started) {
+						endSelection();
+					}
+
+					// Detect vertical scrollbar, since IE will fire a mousedown on the scrollbar and have target set as HTML
+					htmlElm = doc.documentElement;
+					if (htmlElm.scrollHeight > htmlElm.clientHeight) {
+						return;
+					}
+
+					started = 1;
+					// Setup start position
+					startRng = rngFromPoint(e.x, e.y);
+					if (startRng) {
+						// Listen for selection change events
+						dom.bind(doc, 'mouseup', endSelection);
+						dom.bind(doc, 'mousemove', selectionChange);
+
+						dom.getRoot().focus();
+						startRng.select();
+					}
+				}
+			});
+		}
+
+		/**
+		 * Fixes selection issues where the caret can be placed between two inline elements like <b>a</b>|<b>b</b>
+		 * this fix will lean the caret right into the closest inline element.
+		 */
+		function normalizeSelection() {
+			// Normalize selection for example <b>a</b><i>|a</i> becomes <b>a|</b><i>a</i> except for Ctrl+A since it selects everything
+			editor.on('keyup focusin mouseup', function(e) {
+				if (e.keyCode != 65 || !VK.metaKeyPressed(e)) {
+					selection.normalize();
+				}
+			}, true);
+		}
+
+		/**
+		 * Forces Gecko to render a broken image icon if it fails to load an image.
+		 */
+		function showBrokenImageIcon() {
+			editor.contentStyles.push(
+				'img:-moz-broken {' +
+					'-moz-force-broken-image-icon:1;' +
+					'min-width:24px;' +
+					'min-height:24px' +
+				'}'
+			);
+		}
+
+		/**
+		 * iOS has a bug where it's impossible to type if the document has a touchstart event
+		 * bound and the user touches the document while having the on screen keyboard visible.
+		 *
+		 * The touch event moves the focus to the parent document while having the caret inside the iframe
+		 * this fix moves the focus back into the iframe document.
+		 */
+		function restoreFocusOnKeyDown() {
+			if (!editor.inline) {
+				editor.on('keydown', function() {
+					if (document.activeElement == document.body) {
+						editor.getWin().focus();
+					}
+				});
+			}
+		}
+
+		/**
+		 * IE 11 has an annoying issue where you can't move focus into the editor
+		 * by clicking on the white area HTML element. We used to be able to to fix this with
+		 * the fixCaretSelectionOfDocumentElementOnIe fix. But since M$ removed the selection
+		 * object it's not possible anymore. So we need to hack in a ungly CSS to force the
+		 * body to be at least 150px. If the user clicks the HTML element out side this 150px region
+		 * we simply move the focus into the first paragraph. Not ideal since you loose the
+		 * positioning of the caret but goot enough for most cases.
+		 */
+		function bodyHeight() {
+			if (!editor.inline) {
+				editor.contentStyles.push('body {min-height: 150px}');
+				editor.on('click', function(e) {
+					if (e.target.nodeName == 'HTML') {
+						var rng;
+
+						// Need to store away non collapsed ranges since the focus call will mess that up see #7382
+						rng = editor.selection.getRng();
+						editor.getBody().focus();
+						editor.selection.setRng(rng);
+						editor.selection.normalize();
+						editor.nodeChanged();
+					}
+				});
+			}
+		}
+
+		/**
+		 * Firefox on Mac OS will move the browser back to the previous page if you press CMD+Left arrow.
+		 * You might then loose all your work so we need to block that behavior and replace it with our own.
+		 */
+		function blockCmdArrowNavigation() {
+			if (Env.mac) {
+				editor.on('keydown', function(e) {
+					if (VK.metaKeyPressed(e) && (e.keyCode == 37 || e.keyCode == 39)) {
+						e.preventDefault();
+						editor.selection.getSel().modify('move', e.keyCode == 37 ? 'backward' : 'forward', 'lineboundary');
+					}
+				});
+			}
+		}
+
+		/**
+		 * Disables the autolinking in IE 9+ this is then re-enabled by the autolink plugin.
+		 */
+		function disableAutoUrlDetect() {
+			setEditorCommandState("AutoUrlDetect", false);
+		}
+
+		/**
+		 * IE 11 has a fantastic bug where it will produce two trailing BR elements to iframe bodies when
+		 * the iframe is hidden by display: none on a parent container. The DOM is actually out of sync
+		 * with innerHTML in this case. It's like IE adds shadow DOM BR elements that appears on innerHTML
+		 * but not as the lastChild of the body. However is we add a BR element to the body then remove it
+		 * it doesn't seem to add these BR elements makes sence right?!
+		 *
+		 * Example of what happens: <body>text</body> becomes <body>text<br><br></body>
+		 */
+		function doubleTrailingBrElements() {
+			if (!editor.inline) {
+				editor.on('focus blur beforegetcontent', function() {
+					var br = editor.dom.create('br');
+					editor.getBody().appendChild(br);
+					br.parentNode.removeChild(br);
+				}, true);
+			}
+		}
+
+		/**
+		 * iOS 7.1 introduced two new bugs:
+		 * 1) It's possible to open links within a contentEditable area by clicking on them.
+		 * 2) If you hold down the finger it will display the link/image touch callout menu.
+		 */
+		function tapLinksAndImages() {
+			editor.on('click', function(e) {
+				var elm = e.target;
+
+				do {
+					if (elm.tagName === 'A') {
+						e.preventDefault();
+						return;
+					}
+				} while ((elm = elm.parentNode));
+			});
+
+			editor.contentStyles.push('.mce-content-body {-webkit-touch-callout: none}');
+		}
+
+		/**
+		 * iOS Safari and possible other browsers have a bug where it won't fire
+		 * a click event when a contentEditable is focused. This function fakes click events
+		 * by using touchstart/touchend and measuring the time and distance travelled.
+		 */
+		function touchClickEvent() {
+			editor.on('touchstart', function(e) {
+				var elm, time, startTouch, changedTouches;
+
+				elm = e.target;
+				time = new Date().getTime();
+				changedTouches = e.changedTouches;
+
+				if (!changedTouches || changedTouches.length > 1) {
+					return;
+				}
+
+				startTouch = changedTouches[0];
+
+				editor.once('touchend', function(e) {
+					var endTouch = e.changedTouches[0], args;
+
+					if (new Date().getTime() - time > 500) {
+						return;
+					}
+
+					if (Math.abs(startTouch.clientX - endTouch.clientX) > 5) {
+						return;
+					}
+
+					if (Math.abs(startTouch.clientY - endTouch.clientY) > 5) {
+						return;
+					}
+
+					args = {
+						target: elm
+					};
+
+					each('pageX pageY clientX clientY screenX screenY'.split(' '), function(key) {
+						args[key] = endTouch[key];
+					});
+
+					args = editor.fire('click', args);
+
+					if (!args.isDefaultPrevented()) {
+						// iOS WebKit can't place the caret properly once
+						// you bind touch events so we need to do this manually
+						// TODO: Expand to the closest word? Touble tap still works.
+						editor.selection.placeCaretAt(endTouch.clientX, endTouch.clientY);
+						editor.nodeChanged();
+					}
+				});
+			});
+		}
+
+		/**
+		 * WebKit has a bug where it will allow forms to be submitted if they are inside a contentEditable element.
+		 * For example this: <form><button></form>
+		 */
+		function blockFormSubmitInsideEditor() {
+			editor.on('init', function() {
+				editor.dom.bind(editor.getBody(), 'submit', function(e) {
+					e.preventDefault();
+				});
+			});
+		}
+
+		/**
+		 * Sometimes WebKit/Blink generates BR elements with the Apple-interchange-newline class.
+		 *
+		 * Scenario:
+		 *  1) Create a table 2x2.
+		 *  2) Select and copy cells A2-B2.
+		 *  3) Paste and it will add BR element to table cell.
+		 */
+		function removeAppleInterchangeBrs() {
+			parser.addNodeFilter('br', function(nodes) {
+				var i = nodes.length;
+
+				while (i--) {
+					if (nodes[i].attr('class') == 'Apple-interchange-newline') {
+						nodes[i].remove();
+					}
+				}
+			});
+		}
+
+		/**
+		 * IE cannot set custom contentType's on drag events, and also does not properly drag/drop between
+		 * editors. This uses a special data:text/mce-internal URL to pass data when drag/drop between editors.
+		 */
+		function ieInternalDragAndDrop() {
+			editor.on('dragstart', function(e) {
+				setMceInteralContent(e);
+			});
+
+			editor.on('drop', function(e) {
+				if (!isDefaultPrevented(e)) {
+					var internalContent = getMceInternalContent(e);
+					if (internalContent) {
+						e.preventDefault();
+
+						var rng = RangeUtils.getCaretRangeFromPoint(e.x, e.y, editor.getDoc());
+						selection.setRng(rng);
+						insertClipboardContents(internalContent);
+					}
+				}
+			});
+		}
+
+		// All browsers
+		removeBlockQuoteOnBackSpace();
+		emptyEditorWhenDeleting();
+		normalizeSelection();
+
+		// WebKit
+		if (isWebKit) {
+			cleanupStylesWhenDeleting();
+			inputMethodFocus();
+			selectControlElements();
+			setDefaultBlockType();
+			blockFormSubmitInsideEditor();
+			disableBackspaceIntoATable();
+			removeAppleInterchangeBrs();
+			touchClickEvent();
+
+			// iOS
+			if (Env.iOS) {
+				restoreFocusOnKeyDown();
+				bodyHeight();
+				tapLinksAndImages();
+			} else {
+				selectAll();
+			}
+		}
+
+		// IE
+		if (isIE && Env.ie < 11) {
+			removeHrOnBackspace();
+			ensureBodyHasRoleApplication();
+			addNewLinesBeforeBrInPre();
+			removePreSerializedStylesWhenSelectingControls();
+			deleteControlItemOnBackSpace();
+			renderEmptyBlocksFix();
+			keepNoScriptContents();
+			fixCaretSelectionOfDocumentElementOnIe();
+		}
+
+		if (Env.ie >= 11) {
+			bodyHeight();
+			doubleTrailingBrElements();
+			disableBackspaceIntoATable();
+		}
+
+		if (Env.ie) {
+			selectAll();
+			disableAutoUrlDetect();
+			ieInternalDragAndDrop();
+		}
+
+		// Gecko
+		if (isGecko) {
+			removeHrOnBackspace();
+			focusBody();
+			removeStylesWhenDeletingAcrossBlockElements();
+			setGeckoEditingOptions();
+			addBrAfterLastLinks();
+			removeGhostSelection();
+			showBrokenImageIcon();
+			blockCmdArrowNavigation();
+			disableBackspaceIntoATable();
+		}
+	};
+});
+
+// Included from: js/tinymce/classes/util/Observable.js
+
+/**
+ * Observable.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This mixin will add event binding logic to classes.
+ *
+ * @mixin tinymce.util.Observable
+ */
+define("tinymce/util/Observable", [
+	"tinymce/util/EventDispatcher"
+], function(EventDispatcher) {
+	function getEventDispatcher(obj) {
+		if (!obj._eventDispatcher) {
+			obj._eventDispatcher = new EventDispatcher({
+				scope: obj,
+				toggleEvent: function(name, state) {
+					if (EventDispatcher.isNative(name) && obj.toggleNativeEvent) {
+						obj.toggleNativeEvent(name, state);
+					}
+				}
+			});
+		}
+
+		return obj._eventDispatcher;
+	}
+
+	return {
+		/**
+		 * Fires the specified event by name.
+		 *
+		 * @method fire
+		 * @param {String} name Name of the event to fire.
+		 * @param {Object?} args Event arguments.
+		 * @param {Boolean?} bubble True/false if the event is to be bubbled.
+		 * @return {Object} Event args instance passed in.
+		 * @example
+		 * instance.fire('event', {...});
+		 */
+		fire: function(name, args, bubble) {
+			var self = this;
+
+			// Prevent all events except the remove event after the instance has been removed
+			if (self.removed && name !== "remove") {
+				return args;
+			}
+
+			args = getEventDispatcher(self).fire(name, args, bubble);
+
+			// Bubble event up to parents
+			if (bubble !== false && self.parent) {
+				var parent = self.parent();
+				while (parent && !args.isPropagationStopped()) {
+					parent.fire(name, args, false);
+					parent = parent.parent();
+				}
+			}
+
+			return args;
+		},
+
+		/**
+		 * Binds an event listener to a specific event by name.
+		 *
+		 * @method on
+		 * @param {String} name Event name or space separated list of events to bind.
+		 * @param {callback} callback Callback to be executed when the event occurs.
+		 * @param {Boolean} first Optional flag if the event should be prepended. Use this with care.
+		 * @return {Object} Current class instance.
+		 * @example
+		 * instance.on('event', function(e) {
+		 *     // Callback logic
+		 * });
+		 */
+		on: function(name, callback, prepend) {
+			return getEventDispatcher(this).on(name, callback, prepend);
+		},
+
+		/**
+		 * Unbinds an event listener to a specific event by name.
+		 *
+		 * @method off
+		 * @param {String?} name Name of the event to unbind.
+		 * @param {callback?} callback Callback to unbind.
+		 * @return {Object} Current class instance.
+		 * @example
+		 * // Unbind specific callback
+		 * instance.off('event', handler);
+		 *
+		 * // Unbind all listeners by name
+		 * instance.off('event');
+		 *
+		 * // Unbind all events
+		 * instance.off();
+		 */
+		off: function(name, callback) {
+			return getEventDispatcher(this).off(name, callback);
+		},
+
+		/**
+		 * Bind the event callback and once it fires the callback is removed.
+		 *
+		 * @method once
+		 * @param {String} name Name of the event to bind.
+		 * @param {callback} callback Callback to bind only once.
+		 * @return {Object} Current class instance.
+		 */
+		once: function(name, callback) {
+			return getEventDispatcher(this).once(name, callback);
+		},
+
+		/**
+		 * Returns true/false if the object has a event of the specified name.
+		 *
+		 * @method hasEventListeners
+		 * @param {String} name Name of the event to check for.
+		 * @return {Boolean} true/false if the event exists or not.
+		 */
+		hasEventListeners: function(name) {
+			return getEventDispatcher(this).has(name);
+		}
+	};
+});
+
+// Included from: js/tinymce/classes/EditorObservable.js
+
+/**
+ * EditorObservable.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This mixin contains the event logic for the tinymce.Editor class.
+ *
+ * @mixin tinymce.EditorObservable
+ * @extends tinymce.util.Observable
+ */
+define("tinymce/EditorObservable", [
+	"tinymce/util/Observable",
+	"tinymce/dom/DOMUtils",
+	"tinymce/util/Tools"
+], function(Observable, DOMUtils, Tools) {
+	var DOM = DOMUtils.DOM, customEventRootDelegates;
+
+	/**
+	 * Returns the event target so for the specified event. Some events fire
+	 * only on document, some fire on documentElement etc. This also handles the
+	 * custom event root setting where it returns that element instead of the body.
+	 *
+	 * @private
+	 * @param {tinymce.Editor} editor Editor instance to get event target from.
+	 * @param {String} eventName Name of the event for example "click".
+	 * @return {Element/Document} HTML Element or document target to bind on.
+	 */
+	function getEventTarget(editor, eventName) {
+		if (eventName == 'selectionchange') {
+			return editor.getDoc();
+		}
+
+		// Need to bind mousedown/mouseup etc to document not body in iframe mode
+		// Since the user might click on the HTML element not the BODY
+		if (!editor.inline && /^mouse|click|contextmenu|drop|dragover|dragend/.test(eventName)) {
+			return editor.getDoc().documentElement;
+		}
+
+		// Bind to event root instead of body if it's defined
+		if (editor.settings.event_root) {
+			if (!editor.eventRoot) {
+				editor.eventRoot = DOM.select(editor.settings.event_root)[0];
+			}
+
+			return editor.eventRoot;
+		}
+
+		return editor.getBody();
+	}
+
+	/**
+	 * Binds a event delegate for the specified name this delegate will fire
+	 * the event to the editor dispatcher.
+	 *
+	 * @private
+	 * @param {tinymce.Editor} editor Editor instance to get event target from.
+	 * @param {String} eventName Name of the event for example "click".
+	 */
+	function bindEventDelegate(editor, eventName) {
+		var eventRootElm = getEventTarget(editor, eventName), delegate;
+
+		if (!editor.delegates) {
+			editor.delegates = {};
+		}
+
+		if (editor.delegates[eventName]) {
+			return;
+		}
+
+		if (editor.settings.event_root) {
+			if (!customEventRootDelegates) {
+				customEventRootDelegates = {};
+				editor.editorManager.on('removeEditor', function() {
+					var name;
+
+					if (!editor.editorManager.activeEditor) {
+						if (customEventRootDelegates) {
+							for (name in customEventRootDelegates) {
+								editor.dom.unbind(getEventTarget(editor, name));
+							}
+
+							customEventRootDelegates = null;
+						}
+					}
+				});
+			}
+
+			if (customEventRootDelegates[eventName]) {
+				return;
+			}
+
+			delegate = function(e) {
+				var target = e.target, editors = editor.editorManager.editors, i = editors.length;
+
+				while (i--) {
+					var body = editors[i].getBody();
+
+					if (body === target || DOM.isChildOf(target, body)) {
+						if (!editors[i].hidden) {
+							editors[i].fire(eventName, e);
+						}
+					}
+				}
+			};
+
+			customEventRootDelegates[eventName] = delegate;
+			DOM.bind(eventRootElm, eventName, delegate);
+		} else {
+			delegate = function(e) {
+				if (!editor.hidden) {
+					editor.fire(eventName, e);
+				}
+			};
+
+			DOM.bind(eventRootElm, eventName, delegate);
+			editor.delegates[eventName] = delegate;
+		}
+	}
+
+	var EditorObservable = {
+		/**
+		 * Bind any pending event delegates. This gets executed after the target body/document is created.
+		 *
+		 * @private
+		 */
+		bindPendingEventDelegates: function() {
+			var self = this;
+
+			Tools.each(self._pendingNativeEvents, function(name) {
+				bindEventDelegate(self, name);
+			});
+		},
+
+		/**
+		 * Toggles a native event on/off this is called by the EventDispatcher when
+		 * the first native event handler is added and when the last native event handler is removed.
+		 *
+		 * @private
+		 */
+		toggleNativeEvent: function(name, state) {
+			var self = this;
+
+			if (self.settings.readonly) {
+				return;
+			}
+
+			// Never bind focus/blur since the FocusManager fakes those
+			if (name == "focus" || name == "blur") {
+				return;
+			}
+
+			if (state) {
+				if (self.initialized) {
+					bindEventDelegate(self, name);
+				} else {
+					if (!self._pendingNativeEvents) {
+						self._pendingNativeEvents = [name];
+					} else {
+						self._pendingNativeEvents.push(name);
+					}
+				}
+			} else if (self.initialized) {
+				self.dom.unbind(getEventTarget(self, name), name, self.delegates[name]);
+				delete self.delegates[name];
+			}
+		},
+
+		/**
+		 * Unbinds all native event handlers that means delegates, custom events bound using the Events API etc.
+		 *
+		 * @private
+		 */
+		unbindAllNativeEvents: function() {
+			var self = this, name;
+
+			if (self.delegates) {
+				for (name in self.delegates) {
+					self.dom.unbind(getEventTarget(self, name), name, self.delegates[name]);
+				}
+
+				delete self.delegates;
+			}
+
+			if (!self.inline) {
+				self.getBody().onload = null;
+				self.dom.unbind(self.getWin());
+				self.dom.unbind(self.getDoc());
+			}
+
+			self.dom.unbind(self.getBody());
+			self.dom.unbind(self.getContainer());
+		}
+	};
+
+	EditorObservable = Tools.extend({}, Observable, EditorObservable);
+
+	return EditorObservable;
+});
+
+// Included from: js/tinymce/classes/Shortcuts.js
+
+/**
+ * Shortcuts.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Contains all logic for handling of keyboard shortcuts.
+ *
+ * @example
+ * editor.shortcuts.add('ctrl+a', function() {});
+ * editor.shortcuts.add('meta+a', function() {}); // "meta" maps to Command on Mac and Ctrl on PC
+ * editor.shortcuts.add('ctrl+alt+a', function() {});
+ * editor.shortcuts.add('access+a', function() {}); // "access" maps to ctrl+alt on Mac and shift+alt on PC
+ */
+define("tinymce/Shortcuts", [
+	"tinymce/util/Tools",
+	"tinymce/Env"
+], function(Tools, Env) {
+	var each = Tools.each, explode = Tools.explode;
+
+	var keyCodeLookup = {
+		"f9": 120,
+		"f10": 121,
+		"f11": 122
+	};
+
+	var modifierNames = Tools.makeMap('alt,ctrl,shift,meta,access');
+
+	return function(editor) {
+		var self = this, shortcuts = {};
+
+		function createShortcut(pattern, desc, cmdFunc, scope) {
+			var id, key, shortcut;
+
+			shortcut = {
+				func: cmdFunc,
+				scope: scope || editor,
+				desc: editor.translate(desc)
+			};
+
+			// Parse modifiers and keys ctrl+alt+b for example
+			each(explode(pattern, '+'), function(value) {
+				if (value in modifierNames) {
+					shortcut[value] = true;
+				} else {
+					// Allow numeric keycodes like ctrl+219 for ctrl+[
+					if (/^[0-9]{2,}$/.test(value)) {
+						shortcut.keyCode = parseInt(value, 10);
+					} else {
+						shortcut.charCode = value.charCodeAt(0);
+						shortcut.keyCode = keyCodeLookup[value] || value.toUpperCase().charCodeAt(0);
+					}
+				}
+			});
+
+			// Generate unique id for modifier combination and set default state for unused modifiers
+			id = [shortcut.keyCode];
+			for (key in modifierNames) {
+				if (shortcut[key]) {
+					id.push(key);
+				} else {
+					shortcut[key] = false;
+				}
+			}
+			shortcut.id = id.join(',');
+
+			// Handle special access modifier differently depending on Mac/Win
+			if (shortcut.access) {
+				shortcut.alt = true;
+
+				if (Env.mac) {
+					shortcut.ctrl = true;
+				} else {
+					shortcut.shift = true;
+				}
+			}
+
+			// Handle special meta modifier differently depending on Mac/Win
+			if (shortcut.meta) {
+				if (Env.mac) {
+					shortcut.meta = true;
+				} else {
+					shortcut.ctrl = true;
+					shortcut.meta = false;
+				}
+			}
+
+			return shortcut;
+		}
+
+		editor.on('keyup keypress keydown', function(e) {
+			if ((e.altKey || e.ctrlKey || e.metaKey) && !e.isDefaultPrevented()) {
+				each(shortcuts, function(shortcut) {
+					if (shortcut.ctrl != e.ctrlKey || shortcut.meta != e.metaKey) {
+						return;
+					}
+
+					if (shortcut.alt != e.altKey || shortcut.shift != e.shiftKey) {
+						return;
+					}
+
+					if (e.keyCode == shortcut.keyCode || (e.charCode && e.charCode == shortcut.charCode)) {
+						e.preventDefault();
+
+						if (e.type == "keydown") {
+							shortcut.func.call(shortcut.scope);
+						}
+
+						return true;
+					}
+				});
+			}
+		});
+
+		/**
+		 * Adds a keyboard shortcut for some command or function.
+		 *
+		 * @method addShortcut
+		 * @param {String} pattern Shortcut pattern. Like for example: ctrl+alt+o.
+		 * @param {String} desc Text description for the command.
+		 * @param {String/Function} cmdFunc Command name string or function to execute when the key is pressed.
+		 * @param {Object} sc Optional scope to execute the function in.
+		 * @return {Boolean} true/false state if the shortcut was added or not.
+		 */
+		self.add = function(pattern, desc, cmdFunc, scope) {
+			var cmd;
+
+			cmd = cmdFunc;
+
+			if (typeof cmdFunc === 'string') {
+				cmdFunc = function() {
+					editor.execCommand(cmd, false, null);
+				};
+			} else if (Tools.isArray(cmd)) {
+				cmdFunc = function() {
+					editor.execCommand(cmd[0], cmd[1], cmd[2]);
+				};
+			}
+
+			each(explode(pattern.toLowerCase()), function(pattern) {
+				var shortcut = createShortcut(pattern, desc, cmdFunc, scope);
+				shortcuts[shortcut.id] = shortcut;
+			});
+
+			return true;
+		};
+
+		/**
+		 * Remove a keyboard shortcut by pattern.
+		 *
+		 * @method remove
+		 * @param {String} pattern Shortcut pattern. Like for example: ctrl+alt+o.
+		 * @return {Boolean} true/false state if the shortcut was removed or not.
+		 */
+		self.remove = function(pattern) {
+			var shortcut = createShortcut(pattern);
+
+			if (shortcuts[shortcut.id]) {
+				delete shortcuts[shortcut.id];
+				return true;
+			}
+
+			return false;
+		};
+	};
+});
+
+// Included from: js/tinymce/classes/Editor.js
+
+/**
+ * Editor.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*jshint scripturl:true */
+
+/**
+ * Include the base event class documentation.
+ *
+ * @include ../../../tools/docs/tinymce.Event.js
+ */
+
+/**
+ * This class contains the core logic for a TinyMCE editor.
+ *
+ * @class tinymce.Editor
+ * @mixes tinymce.util.Observable
+ * @example
+ * // Add a class to all paragraphs in the editor.
+ * tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('p'), 'someclass');
+ *
+ * // Gets the current editors selection as text
+ * tinymce.activeEditor.selection.getContent({format: 'text'});
+ *
+ * // Creates a new editor instance
+ * var ed = new tinymce.Editor('textareaid', {
+ *     some_setting: 1
+ * }, tinymce.EditorManager);
+ *
+ * // Select each item the user clicks on
+ * ed.on('click', function(e) {
+ *     ed.selection.select(e.target);
+ * });
+ *
+ * ed.render();
+ */
+define("tinymce/Editor", [
+	"tinymce/dom/DOMUtils",
+	"tinymce/dom/DomQuery",
+	"tinymce/AddOnManager",
+	"tinymce/NodeChange",
+	"tinymce/html/Node",
+	"tinymce/dom/Serializer",
+	"tinymce/html/Serializer",
+	"tinymce/dom/Selection",
+	"tinymce/Formatter",
+	"tinymce/UndoManager",
+	"tinymce/EnterKey",
+	"tinymce/ForceBlocks",
+	"tinymce/EditorCommands",
+	"tinymce/util/URI",
+	"tinymce/dom/ScriptLoader",
+	"tinymce/dom/EventUtils",
+	"tinymce/WindowManager",
+	"tinymce/html/Schema",
+	"tinymce/html/DomParser",
+	"tinymce/util/Quirks",
+	"tinymce/Env",
+	"tinymce/util/Tools",
+	"tinymce/EditorObservable",
+	"tinymce/Shortcuts"
+], function(
+	DOMUtils, DomQuery, AddOnManager, NodeChange, Node, DomSerializer, Serializer,
+	Selection, Formatter, UndoManager, EnterKey, ForceBlocks, EditorCommands,
+	URI, ScriptLoader, EventUtils, WindowManager,
+	Schema, DomParser, Quirks, Env, Tools, EditorObservable, Shortcuts
+) {
+	// Shorten these names
+	var DOM = DOMUtils.DOM, ThemeManager = AddOnManager.ThemeManager, PluginManager = AddOnManager.PluginManager;
+	var extend = Tools.extend, each = Tools.each, explode = Tools.explode;
+	var inArray = Tools.inArray, trim = Tools.trim, resolve = Tools.resolve;
+	var Event = EventUtils.Event;
+	var isGecko = Env.gecko, ie = Env.ie;
+
+	/**
+	 * Include documentation for all the events.
+	 *
+	 * @include ../../../tools/docs/tinymce.Editor.js
+	 */
+
+	/**
+	 * Constructs a editor instance by id.
+	 *
+	 * @constructor
+	 * @method Editor
+	 * @param {String} id Unique id for the editor.
+	 * @param {Object} settings Settings for the editor.
+	 * @param {tinymce.EditorManager} editorManager EditorManager instance.
+	 * @author Moxiecode
+	 */
+	function Editor(id, settings, editorManager) {
+		var self = this, documentBaseUrl, baseUri;
+
+		documentBaseUrl = self.documentBaseUrl = editorManager.documentBaseURL;
+		baseUri = editorManager.baseURI;
+
+		/**
+		 * Name/value collection with editor settings.
+		 *
+		 * @property settings
+		 * @type Object
+		 * @example
+		 * // Get the value of the theme setting
+		 * tinymce.activeEditor.windowManager.alert("You are using the " + tinymce.activeEditor.settings.theme + " theme");
+		 */
+		self.settings = settings = extend({
+			id: id,
+			theme: 'modern',
+			delta_width: 0,
+			delta_height: 0,
+			popup_css: '',
+			plugins: '',
+			document_base_url: documentBaseUrl,
+			add_form_submit_trigger: true,
+			submit_patch: true,
+			add_unload_trigger: true,
+			convert_urls: true,
+			relative_urls: true,
+			remove_script_host: true,
+			object_resizing: true,
+			doctype: '<!DOCTYPE html>',
+			visual: true,
+			font_size_style_values: 'xx-small,x-small,small,medium,large,x-large,xx-large',
+
+			// See: http://www.w3.org/TR/CSS2/fonts.html#propdef-font-size
+			font_size_legacy_values: 'xx-small,small,medium,large,x-large,xx-large,300%',
+			forced_root_block: 'p',
+			hidden_input: true,
+			padd_empty_editor: true,
+			render_ui: true,
+			indentation: '30px',
+			inline_styles: true,
+			convert_fonts_to_spans: true,
+			indent: 'simple',
+			indent_before: 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,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,th,ul,ol,li,dl,dt,dd,area,table,thead,' +
+				'tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist',
+			validate: true,
+			entity_encoding: 'named',
+			url_converter: self.convertURL,
+			url_converter_scope: self,
+			ie7_compat: true
+		}, settings);
+
+		AddOnManager.language = settings.language || 'en';
+		AddOnManager.languageLoad = settings.language_load;
+
+		AddOnManager.baseURL = editorManager.baseURL;
+
+		/**
+		 * Editor instance id, normally the same as the div/textarea that was replaced.
+		 *
+		 * @property id
+		 * @type String
+		 */
+		self.id = settings.id = id;
+
+		/**
+		 * State to force the editor to return false on a isDirty call.
+		 *
+		 * @property isNotDirty
+		 * @type Boolean
+		 * @example
+		 * function ajaxSave() {
+		 *     var ed = tinymce.get('elm1');
+		 *
+		 *     // Save contents using some XHR call
+		 *     alert(ed.getContent());
+		 *
+		 *     ed.isNotDirty = true; // Force not dirty state
+		 * }
+		 */
+		self.isNotDirty = true;
+
+		/**
+		 * Name/Value object containting plugin instances.
+		 *
+		 * @property plugins
+		 * @type Object
+		 * @example
+		 * // Execute a method inside a plugin directly
+		 * tinymce.activeEditor.plugins.someplugin.someMethod();
+		 */
+		self.plugins = {};
+
+		/**
+		 * URI object to document configured for the TinyMCE instance.
+		 *
+		 * @property documentBaseURI
+		 * @type tinymce.util.URI
+		 * @example
+		 * // Get relative URL from the location of document_base_url
+		 * tinymce.activeEditor.documentBaseURI.toRelative('/somedir/somefile.htm');
+		 *
+		 * // Get absolute URL from the location of document_base_url
+		 * tinymce.activeEditor.documentBaseURI.toAbsolute('somefile.htm');
+		 */
+		self.documentBaseURI = new URI(settings.document_base_url || documentBaseUrl, {
+			base_uri: baseUri
+		});
+
+		/**
+		 * URI object to current document that holds the TinyMCE editor instance.
+		 *
+		 * @property baseURI
+		 * @type tinymce.util.URI
+		 * @example
+		 * // Get relative URL from the location of the API
+		 * tinymce.activeEditor.baseURI.toRelative('/somedir/somefile.htm');
+		 *
+		 * // Get absolute URL from the location of the API
+		 * tinymce.activeEditor.baseURI.toAbsolute('somefile.htm');
+		 */
+		self.baseURI = baseUri;
+
+		/**
+		 * Array with CSS files to load into the iframe.
+		 *
+		 * @property contentCSS
+		 * @type Array
+		 */
+		self.contentCSS = [];
+
+		/**
+		 * Array of CSS styles to add to head of document when the editor loads.
+		 *
+		 * @property contentStyles
+		 * @type Array
+		 */
+		self.contentStyles = [];
+
+		// Creates all events like onClick, onSetContent etc see Editor.Events.js for the actual logic
+		self.shortcuts = new Shortcuts(self);
+		self.loadedCSS = {};
+		self.editorCommands = new EditorCommands(self);
+
+		if (settings.target) {
+			self.targetElm = settings.target;
+		}
+
+		self.suffix = editorManager.suffix;
+		self.editorManager = editorManager;
+		self.inline = settings.inline;
+
+		if (settings.cache_suffix) {
+			Env.cacheSuffix = settings.cache_suffix.replace(/^[\?\&]+/, '');
+		}
+
+		// Call setup
+		editorManager.fire('SetupEditor', self);
+		self.execCallback('setup', self);
+
+		/**
+		 * Dom query instance with default scope to the editor document and default element is the body of the editor.
+		 *
+		 * @property $
+		 * @type tinymce.dom.DomQuery
+		 * @example
+		 * tinymce.activeEditor.$('p').css('color', 'red');
+		 * tinymce.activeEditor.$().append('<p>new</p>');
+		 */
+		self.$ = DomQuery.overrideDefaults(function() {
+			return {
+				context: self.inline ? self.getBody() : self.getDoc(),
+				element: self.getBody()
+			};
+		});
+	}
+
+	Editor.prototype = {
+		/**
+		 * Renderes the editor/adds it to the page.
+		 *
+		 * @method render
+		 */
+		render: function() {
+			var self = this, settings = self.settings, id = self.id, suffix = self.suffix;
+
+			function readyHandler() {
+				DOM.unbind(window, 'ready', readyHandler);
+				self.render();
+			}
+
+			// Page is not loaded yet, wait for it
+			if (!Event.domLoaded) {
+				DOM.bind(window, 'ready', readyHandler);
+				return;
+			}
+
+			// Element not found, then skip initialization
+			if (!self.getElement()) {
+				return;
+			}
+
+			// No editable support old iOS versions etc
+			if (!Env.contentEditable) {
+				return;
+			}
+
+			// Hide target element early to prevent content flashing
+			if (!settings.inline) {
+				self.orgVisibility = self.getElement().style.visibility;
+				self.getElement().style.visibility = 'hidden';
+			} else {
+				self.inline = true;
+			}
+
+			var form = self.getElement().form || DOM.getParent(id, 'form');
+			if (form) {
+				self.formElement = form;
+
+				// Add hidden input for non input elements inside form elements
+				if (settings.hidden_input && !/TEXTAREA|INPUT/i.test(self.getElement().nodeName)) {
+					DOM.insertAfter(DOM.create('input', {type: 'hidden', name: id}), id);
+					self.hasHiddenInput = true;
+				}
+
+				// Pass submit/reset from form to editor instance
+				self.formEventDelegate = function(e) {
+					self.fire(e.type, e);
+				};
+
+				DOM.bind(form, 'submit reset', self.formEventDelegate);
+
+				// Reset contents in editor when the form is reset
+				self.on('reset', function() {
+					self.setContent(self.startContent, {format: 'raw'});
+				});
+
+				// Check page uses id="submit" or name="submit" for it's submit button
+				if (settings.submit_patch && !form.submit.nodeType && !form.submit.length && !form._mceOldSubmit) {
+					form._mceOldSubmit = form.submit;
+					form.submit = function() {
+						self.editorManager.triggerSave();
+						self.isNotDirty = true;
+
+						return form._mceOldSubmit(form);
+					};
+				}
+			}
+
+			/**
+			 * Window manager reference, use this to open new windows and dialogs.
+			 *
+			 * @property windowManager
+			 * @type tinymce.WindowManager
+			 * @example
+			 * // Shows an alert message
+			 * tinymce.activeEditor.windowManager.alert('Hello world!');
+			 *
+			 * // Opens a new dialog with the file.htm file and the size 320x240
+			 * // It also adds a custom parameter this can be retrieved by using tinyMCEPopup.getWindowArg inside the dialog.
+			 * tinymce.activeEditor.windowManager.open({
+			 *    url: 'file.htm',
+			 *    width: 320,
+			 *    height: 240
+			 * }, {
+			 *    custom_param: 1
+			 * });
+			 */
+			self.windowManager = new WindowManager(self);
+
+			if (settings.encoding == 'xml') {
+				self.on('GetContent', function(e) {
+					if (e.save) {
+						e.content = DOM.encode(e.content);
+					}
+				});
+			}
+
+			if (settings.add_form_submit_trigger) {
+				self.on('submit', function() {
+					if (self.initialized) {
+						self.save();
+					}
+				});
+			}
+
+			if (settings.add_unload_trigger) {
+				self._beforeUnload = function() {
+					if (self.initialized && !self.destroyed && !self.isHidden()) {
+						self.save({format: 'raw', no_events: true, set_dirty: false});
+					}
+				};
+
+				self.editorManager.on('BeforeUnload', self._beforeUnload);
+			}
+
+			// Load scripts
+			function loadScripts() {
+				var scriptLoader = ScriptLoader.ScriptLoader;
+
+				if (settings.language && settings.language != 'en' && !settings.language_url) {
+					settings.language_url = self.editorManager.baseURL + '/langs/' + settings.language + '.js';
+				}
+
+				if (settings.language_url) {
+					scriptLoader.add(settings.language_url);
+				}
+
+				if (settings.theme && typeof settings.theme != "function" &&
+					settings.theme.charAt(0) != '-' && !ThemeManager.urls[settings.theme]) {
+					var themeUrl = settings.theme_url;
+
+					if (themeUrl) {
+						themeUrl = self.documentBaseURI.toAbsolute(themeUrl);
+					} else {
+						themeUrl = 'themes/' + settings.theme + '/theme' + suffix + '.js';
+					}
+
+					ThemeManager.load(settings.theme, themeUrl);
+				}
+
+				if (Tools.isArray(settings.plugins)) {
+					settings.plugins = settings.plugins.join(' ');
+				}
+
+				each(settings.external_plugins, function(url, name) {
+					PluginManager.load(name, url);
+					settings.plugins += ' ' + name;
+				});
+
+				each(settings.plugins.split(/[ ,]/), function(plugin) {
+					plugin = trim(plugin);
+
+					if (plugin && !PluginManager.urls[plugin]) {
+						if (plugin.charAt(0) == '-') {
+							plugin = plugin.substr(1, plugin.length);
+
+							var dependencies = PluginManager.dependencies(plugin);
+
+							each(dependencies, function(dep) {
+								var defaultSettings = {
+									prefix: 'plugins/',
+									resource: dep,
+									suffix: '/plugin' + suffix + '.js'
+								};
+
+								dep = PluginManager.createUrl(defaultSettings, dep);
+								PluginManager.load(dep.resource, dep);
+							});
+						} else {
+							PluginManager.load(plugin, {
+								prefix: 'plugins/',
+								resource: plugin,
+								suffix: '/plugin' + suffix + '.js'
+							});
+						}
+					}
+				});
+
+				scriptLoader.loadQueue(function() {
+					if (!self.removed) {
+						self.init();
+					}
+				});
+			}
+
+			loadScripts();
+		},
+
+		/**
+		 * Initializes the editor this will be called automatically when
+		 * all plugins/themes and language packs are loaded by the rendered method.
+		 * This method will setup the iframe and create the theme and plugin instances.
+		 *
+		 * @method init
+		 */
+		init: function() {
+			var self = this, settings = self.settings, elm = self.getElement();
+			var w, h, minHeight, n, o, Theme, url, bodyId, bodyClass, re, i, initializedPlugins = [];
+
+			this.editorManager.i18n.setCode(settings.language);
+			self.rtl = this.editorManager.i18n.rtl;
+			self.editorManager.add(self);
+
+			settings.aria_label = settings.aria_label || DOM.getAttrib(elm, 'aria-label', self.getLang('aria.rich_text_area'));
+
+			/**
+			 * Reference to the theme instance that was used to generate the UI.
+			 *
+			 * @property theme
+			 * @type tinymce.Theme
+			 * @example
+			 * // Executes a method on the theme directly
+			 * tinymce.activeEditor.theme.someMethod();
+			 */
+			if (settings.theme) {
+				if (typeof settings.theme != "function") {
+					settings.theme = settings.theme.replace(/-/, '');
+					Theme = ThemeManager.get(settings.theme);
+					self.theme = new Theme(self, ThemeManager.urls[settings.theme]);
+
+					if (self.theme.init) {
+						self.theme.init(self, ThemeManager.urls[settings.theme] || self.documentBaseUrl.replace(/\/$/, ''), self.$);
+					}
+				} else {
+					self.theme = settings.theme;
+				}
+			}
+
+			function initPlugin(plugin) {
+				var Plugin = PluginManager.get(plugin), pluginUrl, pluginInstance;
+
+				pluginUrl = PluginManager.urls[plugin] || self.documentBaseUrl.replace(/\/$/, '');
+				plugin = trim(plugin);
+				if (Plugin && inArray(initializedPlugins, plugin) === -1) {
+					each(PluginManager.dependencies(plugin), function(dep) {
+						initPlugin(dep);
+					});
+
+					pluginInstance = new Plugin(self, pluginUrl, self.$);
+
+					self.plugins[plugin] = pluginInstance;
+
+					if (pluginInstance.init) {
+						pluginInstance.init(self, pluginUrl);
+						initializedPlugins.push(plugin);
+					}
+				}
+			}
+
+			// Create all plugins
+			each(settings.plugins.replace(/\-/g, '').split(/[ ,]/), initPlugin);
+
+			// Measure box
+			if (settings.render_ui && self.theme) {
+				self.orgDisplay = elm.style.display;
+
+				if (typeof settings.theme != "function") {
+					w = settings.width || elm.style.width || elm.offsetWidth;
+					h = settings.height || elm.style.height || elm.offsetHeight;
+					minHeight = settings.min_height || 100;
+					re = /^[0-9\.]+(|px)$/i;
+
+					if (re.test('' + w)) {
+						w = Math.max(parseInt(w, 10), 100);
+					}
+
+					if (re.test('' + h)) {
+						h = Math.max(parseInt(h, 10), minHeight);
+					}
+
+					// Render UI
+					o = self.theme.renderUI({
+						targetNode: elm,
+						width: w,
+						height: h,
+						deltaWidth: settings.delta_width,
+						deltaHeight: settings.delta_height
+					});
+
+					// Resize editor
+					if (!settings.content_editable) {
+						h = (o.iframeHeight || h) + (typeof h == 'number' ? (o.deltaHeight || 0) : '');
+						if (h < minHeight) {
+							h = minHeight;
+						}
+					}
+				} else {
+					o = settings.theme(self, elm);
+
+					// Convert element type to id:s
+					if (o.editorContainer.nodeType) {
+						o.editorContainer = o.editorContainer.id = o.editorContainer.id || self.id + "_parent";
+					}
+
+					// Convert element type to id:s
+					if (o.iframeContainer.nodeType) {
+						o.iframeContainer = o.iframeContainer.id = o.iframeContainer.id || self.id + "_iframecontainer";
+					}
+
+					// Use specified iframe height or the targets offsetHeight
+					h = o.iframeHeight || elm.offsetHeight;
+				}
+
+				self.editorContainer = o.editorContainer;
+			}
+
+			// Load specified content CSS last
+			if (settings.content_css) {
+				each(explode(settings.content_css), function(u) {
+					self.contentCSS.push(self.documentBaseURI.toAbsolute(u));
+				});
+			}
+
+			// Load specified content CSS last
+			if (settings.content_style) {
+				self.contentStyles.push(settings.content_style);
+			}
+
+			// Content editable mode ends here
+			if (settings.content_editable) {
+				elm = n = o = null; // Fix IE leak
+				return self.initContentBody();
+			}
+
+			self.iframeHTML = settings.doctype + '<html><head>';
+
+			// We only need to override paths if we have to
+			// IE has a bug where it remove site absolute urls to relative ones if this is specified
+			if (settings.document_base_url != self.documentBaseUrl) {
+				self.iframeHTML += '<base href="' + self.documentBaseURI.getURI() + '" />';
+			}
+
+			// IE8 doesn't support carets behind images setting ie7_compat would force IE8+ to run in IE7 compat mode.
+			if (!Env.caretAfter && settings.ie7_compat) {
+				self.iframeHTML += '<meta http-equiv="X-UA-Compatible" content="IE=7" />';
+			}
+
+			self.iframeHTML += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
+
+			// Load the CSS by injecting them into the HTML this will reduce "flicker"
+			for (i = 0; i < self.contentCSS.length; i++) {
+				var cssUrl = self.contentCSS[i];
+				self.iframeHTML += (
+					'<link type="text/css" ' +
+						'rel="stylesheet" ' +
+						'href="' + Tools._addCacheSuffix(cssUrl) + '" />'
+				);
+				self.loadedCSS[cssUrl] = true;
+			}
+
+			bodyId = settings.body_id || 'tinymce';
+			if (bodyId.indexOf('=') != -1) {
+				bodyId = self.getParam('body_id', '', 'hash');
+				bodyId = bodyId[self.id] || bodyId;
+			}
+
+			bodyClass = settings.body_class || '';
+			if (bodyClass.indexOf('=') != -1) {
+				bodyClass = self.getParam('body_class', '', 'hash');
+				bodyClass = bodyClass[self.id] || '';
+			}
+
+			if (settings.content_security_policy) {
+				self.iframeHTML += '<meta http-equiv="Content-Security-Policy" content="' + settings.content_security_policy + '" />';
+			}
+
+			self.iframeHTML += '</head><body id="' + bodyId +
+				'" class="mce-content-body ' + bodyClass +
+				'" data-id="' + self.id + '"><br></body></html>';
+
+			/*eslint no-script-url:0 */
+			var domainRelaxUrl = 'javascript:(function(){' +
+				'document.open();document.domain="' + document.domain + '";' +
+				'var ed = window.parent.tinymce.get("' + self.id + '");document.write(ed.iframeHTML);' +
+				'document.close();ed.initContentBody(true);})()';
+
+			// Domain relaxing is required since the user has messed around with document.domain
+			if (document.domain != location.hostname) {
+				url = domainRelaxUrl;
+			}
+
+			// Create iframe
+			// TODO: ACC add the appropriate description on this.
+			var ifr = DOM.create('iframe', {
+				id: self.id + "_ifr",
+				//src: url || 'javascript:""', // Workaround for HTTPS warning in IE6/7
+				frameBorder: '0',
+				allowTransparency: "true",
+				title: self.editorManager.translate(
+						"Rich Text Area. Press ALT-F9 for menu. " +
+						"Press ALT-F10 for toolbar. Press ALT-0 for help"
+				),
+				style: {
+					width: '100%',
+					height: h,
+					display: 'block' // Important for Gecko to render the iframe correctly
+				}
+			});
+
+			ifr.onload = function() {
+				ifr.onload = null;
+				self.fire("load");
+			};
+
+			DOM.setAttrib(ifr, "src", url || 'javascript:""');
+
+			self.contentAreaContainer = o.iframeContainer;
+			self.iframeElement = ifr;
+
+			n = DOM.add(o.iframeContainer, ifr);
+
+			// Try accessing the document this will fail on IE when document.domain is set to the same as location.hostname
+			// Then we have to force domain relaxing using the domainRelaxUrl approach very ugly!!
+			if (ie) {
+				try {
+					self.getDoc();
+				} catch (e) {
+					n.src = url = domainRelaxUrl;
+				}
+			}
+
+			if (o.editorContainer) {
+				DOM.get(o.editorContainer).style.display = self.orgDisplay;
+				self.hidden = DOM.isHidden(o.editorContainer);
+			}
+
+			self.getElement().style.display = 'none';
+			DOM.setAttrib(self.id, 'aria-hidden', true);
+
+			if (!url) {
+				self.initContentBody();
+			}
+
+			elm = n = o = null; // Cleanup
+		},
+
+		/**
+		 * This method get called by the init method ones the iframe is loaded.
+		 * It will fill the iframe with contents, setups DOM and selection objects for the iframe.
+		 *
+		 * @method initContentBody
+		 * @private
+		 */
+		initContentBody: function(skipWrite) {
+			var self = this, settings = self.settings, targetElm = self.getElement(), doc = self.getDoc(), body, contentCssText;
+
+			// Restore visibility on target element
+			if (!settings.inline) {
+				self.getElement().style.visibility = self.orgVisibility;
+			}
+
+			// Setup iframe body
+			if (!skipWrite && !settings.content_editable) {
+				doc.open();
+				doc.write(self.iframeHTML);
+				doc.close();
+			}
+
+			if (settings.content_editable) {
+				self.on('remove', function() {
+					var bodyEl = this.getBody();
+
+					DOM.removeClass(bodyEl, 'mce-content-body');
+					DOM.removeClass(bodyEl, 'mce-edit-focus');
+					DOM.setAttrib(bodyEl, 'contentEditable', null);
+				});
+
+				DOM.addClass(targetElm, 'mce-content-body');
+				self.contentDocument = doc = settings.content_document || document;
+				self.contentWindow = settings.content_window || window;
+				self.bodyElement = targetElm;
+
+				// Prevent leak in IE
+				settings.content_document = settings.content_window = null;
+
+				// TODO: Fix this
+				settings.root_name = targetElm.nodeName.toLowerCase();
+			}
+
+			// It will not steal focus while setting contentEditable
+			body = self.getBody();
+			body.disabled = true;
+
+			if (!settings.readonly) {
+				if (self.inline && DOM.getStyle(body, 'position', true) == 'static') {
+					body.style.position = 'relative';
+				}
+
+				body.contentEditable = self.getParam('content_editable_state', true);
+			}
+
+			body.disabled = false;
+
+			/**
+			 * Schema instance, enables you to validate elements and it's children.
+			 *
+			 * @property schema
+			 * @type tinymce.html.Schema
+			 */
+			self.schema = new Schema(settings);
+
+			/**
+			 * DOM instance for the editor.
+			 *
+			 * @property dom
+			 * @type tinymce.dom.DOMUtils
+			 * @example
+			 * // Adds a class to all paragraphs within the editor
+			 * tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('p'), 'someclass');
+			 */
+			self.dom = new DOMUtils(doc, {
+				keep_values: true,
+				url_converter: self.convertURL,
+				url_converter_scope: self,
+				hex_colors: settings.force_hex_style_colors,
+				class_filter: settings.class_filter,
+				update_styles: true,
+				root_element: self.inline ? self.getBody() : null,
+				collect: settings.content_editable,
+				schema: self.schema,
+				onSetAttrib: function(e) {
+					self.fire('SetAttrib', e);
+				}
+			});
+
+			/**
+			 * HTML parser will be used when contents is inserted into the editor.
+			 *
+			 * @property parser
+			 * @type tinymce.html.DomParser
+			 */
+			self.parser = new DomParser(settings, self.schema);
+
+			// Convert src and href into data-mce-src, data-mce-href and data-mce-style
+			self.parser.addAttributeFilter('src,href,style,tabindex', function(nodes, name) {
+				var i = nodes.length, node, dom = self.dom, value, internalName;
+
+				while (i--) {
+					node = nodes[i];
+					value = node.attr(name);
+					internalName = 'data-mce-' + name;
+
+					// Add internal attribute if we need to we don't on a refresh of the document
+					if (!node.attributes.map[internalName]) {
+						if (name === "style") {
+							value = dom.serializeStyle(dom.parseStyle(value), node.name);
+
+							if (!value.length) {
+								value = null;
+							}
+
+							node.attr(internalName, value);
+							node.attr(name, value);
+						} else if (name === "tabindex") {
+							node.attr(internalName, value);
+							node.attr(name, null);
+						} else {
+							node.attr(internalName, self.convertURL(value, name, node.name));
+						}
+					}
+				}
+			});
+
+			// Keep scripts from executing
+			self.parser.addNodeFilter('script', function(nodes) {
+				var i = nodes.length, node;
+
+				while (i--) {
+					node = nodes[i];
+					node.attr('type', 'mce-' + (node.attr('type') || 'no/type'));
+				}
+			});
+
+			self.parser.addNodeFilter('#cdata', function(nodes) {
+				var i = nodes.length, node;
+
+				while (i--) {
+					node = nodes[i];
+					node.type = 8;
+					node.name = '#comment';
+					node.value = '[CDATA[' + node.value + ']]';
+				}
+			});
+
+			self.parser.addNodeFilter('p,h1,h2,h3,h4,h5,h6,div', function(nodes) {
+				var i = nodes.length, node, nonEmptyElements = self.schema.getNonEmptyElements();
+
+				while (i--) {
+					node = nodes[i];
+
+					if (node.isEmpty(nonEmptyElements)) {
+						node.append(new Node('br', 1)).shortEnded = true;
+					}
+				}
+			});
+
+			/**
+			 * DOM serializer for the editor. Will be used when contents is extracted from the editor.
+			 *
+			 * @property serializer
+			 * @type tinymce.dom.Serializer
+			 * @example
+			 * // Serializes the first paragraph in the editor into a string
+			 * tinymce.activeEditor.serializer.serialize(tinymce.activeEditor.dom.select('p')[0]);
+			 */
+			self.serializer = new DomSerializer(settings, self);
+
+			/**
+			 * Selection instance for the editor.
+			 *
+			 * @property selection
+			 * @type tinymce.dom.Selection
+			 * @example
+			 * // Sets some contents to the current selection in the editor
+			 * tinymce.activeEditor.selection.setContent('Some contents');
+			 *
+			 * // Gets the current selection
+			 * alert(tinymce.activeEditor.selection.getContent());
+			 *
+			 * // Selects the first paragraph found
+			 * tinymce.activeEditor.selection.select(tinymce.activeEditor.dom.select('p')[0]);
+			 */
+			self.selection = new Selection(self.dom, self.getWin(), self.serializer, self);
+
+			/**
+			 * Formatter instance.
+			 *
+			 * @property formatter
+			 * @type tinymce.Formatter
+			 */
+			self.formatter = new Formatter(self);
+
+			/**
+			 * Undo manager instance, responsible for handling undo levels.
+			 *
+			 * @property undoManager
+			 * @type tinymce.UndoManager
+			 * @example
+			 * // Undoes the last modification to the editor
+			 * tinymce.activeEditor.undoManager.undo();
+			 */
+			self.undoManager = new UndoManager(self);
+
+			self.forceBlocks = new ForceBlocks(self);
+			self.enterKey = new EnterKey(self);
+			self._nodeChangeDispatcher = new NodeChange(self);
+
+			self.fire('PreInit');
+
+			if (!settings.browser_spellcheck && !settings.gecko_spellcheck) {
+				doc.body.spellcheck = false; // Gecko
+				DOM.setAttrib(body, "spellcheck", "false");
+			}
+
+			self.fire('PostRender');
+
+			self.quirks = new Quirks(self);
+
+			if (settings.directionality) {
+				body.dir = settings.directionality;
+			}
+
+			if (settings.nowrap) {
+				body.style.whiteSpace = "nowrap";
+			}
+
+			if (settings.protect) {
+				self.on('BeforeSetContent', function(e) {
+					each(settings.protect, function(pattern) {
+						e.content = e.content.replace(pattern, function(str) {
+							return '<!--mce:protected ' + escape(str) + '-->';
+						});
+					});
+				});
+			}
+
+			self.on('SetContent', function() {
+				self.addVisual(self.getBody());
+			});
+
+			// Remove empty contents
+			if (settings.padd_empty_editor) {
+				self.on('PostProcess', function(e) {
+					e.content = e.content.replace(/^(<p[^>]*>(&nbsp;|&#160;|\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/, '');
+				});
+			}
+
+			self.load({initial: true, format: 'html'});
+			self.startContent = self.getContent({format: 'raw'});
+
+			/**
+			 * Is set to true after the editor instance has been initialized
+			 *
+			 * @property initialized
+			 * @type Boolean
+			 * @example
+			 * function isEditorInitialized(editor) {
+			 *     return editor && editor.initialized;
+			 * }
+			 */
+			self.initialized = true;
+			self.bindPendingEventDelegates();
+
+			self.fire('init');
+			self.focus(true);
+			self.nodeChanged({initial: true});
+			self.execCallback('init_instance_callback', self);
+
+			// Add editor specific CSS styles
+			if (self.contentStyles.length > 0) {
+				contentCssText = '';
+
+				each(self.contentStyles, function(style) {
+					contentCssText += style + "\r\n";
+				});
+
+				self.dom.addStyle(contentCssText);
+			}
+
+			// Load specified content CSS last
+			each(self.contentCSS, function(cssUrl) {
+				if (!self.loadedCSS[cssUrl]) {
+					self.dom.loadCSS(cssUrl);
+					self.loadedCSS[cssUrl] = true;
+				}
+			});
+
+			// Handle auto focus
+			if (settings.auto_focus) {
+				setTimeout(function() {
+					var editor;
+
+					if (settings.auto_focus === true) {
+						editor = self;
+					} else {
+						editor = self.editorManager.get(settings.auto_focus);
+					}
+
+					if (!editor.destroyed) {
+						editor.focus();
+					}
+				}, 100);
+			}
+
+			// Clean up references for IE
+			targetElm = doc = body = null;
+		},
+
+		/**
+		 * Focuses/activates the editor. This will set this editor as the activeEditor in the tinymce collection
+		 * it will also place DOM focus inside the editor.
+		 *
+		 * @method focus
+		 * @param {Boolean} skipFocus Skip DOM focus. Just set is as the active editor.
+		 */
+		focus: function(skipFocus) {
+			var self = this, selection = self.selection, contentEditable = self.settings.content_editable, rng;
+			var controlElm, doc = self.getDoc(), body;
+
+			if (!skipFocus) {
+				// Get selected control element
+				rng = selection.getRng();
+				if (rng.item) {
+					controlElm = rng.item(0);
+				}
+
+				self._refreshContentEditable();
+
+				// Focus the window iframe
+				if (!contentEditable) {
+					// WebKit needs this call to fire focusin event properly see #5948
+					// But Opera pre Blink engine will produce an empty selection so skip Opera
+					if (!Env.opera) {
+						self.getBody().focus();
+					}
+
+					self.getWin().focus();
+				}
+
+				// Focus the body as well since it's contentEditable
+				if (isGecko || contentEditable) {
+					body = self.getBody();
+
+					// Check for setActive since it doesn't scroll to the element
+					if (body.setActive) {
+						// IE 11 sometimes throws "Invalid function" then fallback to focus
+						try {
+							body.setActive();
+						} catch (ex) {
+							body.focus();
+						}
+					} else {
+						body.focus();
+					}
+
+					if (contentEditable) {
+						selection.normalize();
+					}
+				}
+
+				// Restore selected control element
+				// This is needed when for example an image is selected within a
+				// layer a call to focus will then remove the control selection
+				if (controlElm && controlElm.ownerDocument == doc) {
+					rng = doc.body.createControlRange();
+					rng.addElement(controlElm);
+					rng.select();
+				}
+			}
+
+			self.editorManager.setActive(self);
+		},
+
+		/**
+		 * Executes a legacy callback. This method is useful to call old 2.x option callbacks.
+		 * There new event model is a better way to add callback so this method might be removed in the future.
+		 *
+		 * @method execCallback
+		 * @param {String} name Name of the callback to execute.
+		 * @return {Object} Return value passed from callback function.
+		 */
+		execCallback: function(name) {
+			var self = this, callback = self.settings[name], scope;
+
+			if (!callback) {
+				return;
+			}
+
+			// Look through lookup
+			if (self.callbackLookup && (scope = self.callbackLookup[name])) {
+				callback = scope.func;
+				scope = scope.scope;
+			}
+
+			if (typeof callback === 'string') {
+				scope = callback.replace(/\.\w+$/, '');
+				scope = scope ? resolve(scope) : 0;
+				callback = resolve(callback);
+				self.callbackLookup = self.callbackLookup || {};
+				self.callbackLookup[name] = {func: callback, scope: scope};
+			}
+
+			return callback.apply(scope || self, Array.prototype.slice.call(arguments, 1));
+		},
+
+		/**
+		 * Translates the specified string by replacing variables with language pack items it will also check if there is
+		 * a key mathcin the input.
+		 *
+		 * @method translate
+		 * @param {String} text String to translate by the language pack data.
+		 * @return {String} Translated string.
+		 */
+		translate: function(text) {
+			var lang = this.settings.language || 'en', i18n = this.editorManager.i18n;
+
+			if (!text) {
+				return '';
+			}
+
+			return i18n.data[lang + '.' + text] || text.replace(/\{\#([^\}]+)\}/g, function(a, b) {
+				return i18n.data[lang + '.' + b] || '{#' + b + '}';
+			});
+		},
+
+		/**
+		 * Returns a language pack item by name/key.
+		 *
+		 * @method getLang
+		 * @param {String} name Name/key to get from the language pack.
+		 * @param {String} defaultVal Optional default value to retrive.
+		 */
+		getLang: function(name, defaultVal) {
+			return (
+				this.editorManager.i18n.data[(this.settings.language || 'en') + '.' + name] ||
+				(defaultVal !== undefined ? defaultVal : '{#' + name + '}')
+			);
+		},
+
+		/**
+		 * Returns a configuration parameter by name.
+		 *
+		 * @method getParam
+		 * @param {String} name Configruation parameter to retrive.
+		 * @param {String} defaultVal Optional default value to return.
+		 * @param {String} type Optional type parameter.
+		 * @return {String} Configuration parameter value or default value.
+		 * @example
+		 * // Returns a specific config value from the currently active editor
+		 * var someval = tinymce.activeEditor.getParam('myvalue');
+		 *
+		 * // Returns a specific config value from a specific editor instance by id
+		 * var someval2 = tinymce.get('my_editor').getParam('myvalue');
+		 */
+		getParam: function(name, defaultVal, type) {
+			var value = name in this.settings ? this.settings[name] : defaultVal, output;
+
+			if (type === 'hash') {
+				output = {};
+
+				if (typeof value === 'string') {
+					each(value.indexOf('=') > 0 ? value.split(/[;,](?![^=;,]*(?:[;,]|$))/) : value.split(','), function(value) {
+						value = value.split('=');
+
+						if (value.length > 1) {
+							output[trim(value[0])] = trim(value[1]);
+						} else {
+							output[trim(value[0])] = trim(value);
+						}
+					});
+				} else {
+					output = value;
+				}
+
+				return output;
+			}
+
+			return value;
+		},
+
+		/**
+		 * Distpaches out a onNodeChange event to all observers. This method should be called when you
+		 * need to update the UI states or element path etc.
+		 *
+		 * @method nodeChanged
+		 * @param {Object} args Optional args to pass to NodeChange event handlers.
+		 */
+		nodeChanged: function(args) {
+			this._nodeChangeDispatcher.nodeChanged(args);
+		},
+
+		/**
+		 * Adds a button that later gets created by the theme in the editors toolbars.
+		 *
+		 * @method addButton
+		 * @param {String} name Button name to add.
+		 * @param {Object} settings Settings object with title, cmd etc.
+		 * @example
+		 * // Adds a custom button to the editor that inserts contents when clicked
+		 * tinymce.init({
+		 *    ...
+		 *
+		 *    toolbar: 'example'
+		 *
+		 *    setup: function(ed) {
+		 *       ed.addButton('example', {
+		 *          title: 'My title',
+		 *          image: '../js/tinymce/plugins/example/img/example.gif',
+		 *          onclick: function() {
+		 *             ed.insertContent('Hello world!!');
+		 *          }
+		 *       });
+		 *    }
+		 * });
+		 */
+		addButton: function(name, settings) {
+			var self = this;
+
+			if (settings.cmd) {
+				settings.onclick = function() {
+					self.execCommand(settings.cmd);
+				};
+			}
+
+			if (!settings.text && !settings.icon) {
+				settings.icon = name;
+			}
+
+			self.buttons = self.buttons || {};
+			settings.tooltip = settings.tooltip || settings.title;
+			self.buttons[name] = settings;
+		},
+
+		/**
+		 * Adds a menu item to be used in the menus of the theme. There might be multiple instances
+		 * of this menu item for example it might be used in the main menus of the theme but also in
+		 * the context menu so make sure that it's self contained and supports multiple instances.
+		 *
+		 * @method addMenuItem
+		 * @param {String} name Menu item name to add.
+		 * @param {Object} settings Settings object with title, cmd etc.
+		 * @example
+		 * // Adds a custom menu item to the editor that inserts contents when clicked
+		 * // The context option allows you to add the menu item to an existing default menu
+		 * tinymce.init({
+		 *    ...
+		 *
+		 *    setup: function(ed) {
+		 *       ed.addMenuItem('example', {
+		 *          text: 'My menu item',
+		 *          context: 'tools',
+		 *          onclick: function() {
+		 *             ed.insertContent('Hello world!!');
+		 *          }
+		 *       });
+		 *    }
+		 * });
+		 */
+		addMenuItem: function(name, settings) {
+			var self = this;
+
+			if (settings.cmd) {
+				settings.onclick = function() {
+					self.execCommand(settings.cmd);
+				};
+			}
+
+			self.menuItems = self.menuItems || {};
+			self.menuItems[name] = settings;
+		},
+
+		/**
+		 * Adds a custom command to the editor, you can also override existing commands with this method.
+		 * The command that you add can be executed with execCommand.
+		 *
+		 * @method addCommand
+		 * @param {String} name Command name to add/override.
+		 * @param {addCommandCallback} callback Function to execute when the command occurs.
+		 * @param {Object} scope Optional scope to execute the function in.
+		 * @example
+		 * // Adds a custom command that later can be executed using execCommand
+		 * tinymce.init({
+		 *    ...
+		 *
+		 *    setup: function(ed) {
+		 *       // Register example command
+		 *       ed.addCommand('mycommand', function(ui, v) {
+		 *          ed.windowManager.alert('Hello world!! Selection: ' + ed.selection.getContent({format: 'text'}));
+		 *       });
+		 *    }
+		 * });
+		 */
+		addCommand: function(name, callback, scope) {
+			/**
+			 * Callback function that gets called when a command is executed.
+			 *
+			 * @callback addCommandCallback
+			 * @param {Boolean} ui Display UI state true/false.
+			 * @param {Object} value Optional value for command.
+			 * @return {Boolean} True/false state if the command was handled or not.
+			 */
+			this.editorCommands.addCommand(name, callback, scope);
+		},
+
+		/**
+		 * Adds a custom query state command to the editor, you can also override existing commands with this method.
+		 * The command that you add can be executed with queryCommandState function.
+		 *
+		 * @method addQueryStateHandler
+		 * @param {String} name Command name to add/override.
+		 * @param {addQueryStateHandlerCallback} callback Function to execute when the command state retrival occurs.
+		 * @param {Object} scope Optional scope to execute the function in.
+		 */
+		addQueryStateHandler: function(name, callback, scope) {
+			/**
+			 * Callback function that gets called when a queryCommandState is executed.
+			 *
+			 * @callback addQueryStateHandlerCallback
+			 * @return {Boolean} True/false state if the command is enabled or not like is it bold.
+			 */
+			this.editorCommands.addQueryStateHandler(name, callback, scope);
+		},
+
+		/**
+		 * Adds a custom query value command to the editor, you can also override existing commands with this method.
+		 * The command that you add can be executed with queryCommandValue function.
+		 *
+		 * @method addQueryValueHandler
+		 * @param {String} name Command name to add/override.
+		 * @param {addQueryValueHandlerCallback} callback Function to execute when the command value retrival occurs.
+		 * @param {Object} scope Optional scope to execute the function in.
+		 */
+		addQueryValueHandler: function(name, callback, scope) {
+			/**
+			 * Callback function that gets called when a queryCommandValue is executed.
+			 *
+			 * @callback addQueryValueHandlerCallback
+			 * @return {Object} Value of the command or undefined.
+			 */
+			this.editorCommands.addQueryValueHandler(name, callback, scope);
+		},
+
+		/**
+		 * Adds a keyboard shortcut for some command or function.
+		 *
+		 * @method addShortcut
+		 * @param {String} pattern Shortcut pattern. Like for example: ctrl+alt+o.
+		 * @param {String} desc Text description for the command.
+		 * @param {String/Function} cmdFunc Command name string or function to execute when the key is pressed.
+		 * @param {Object} sc Optional scope to execute the function in.
+		 * @return {Boolean} true/false state if the shortcut was added or not.
+		 */
+		addShortcut: function(pattern, desc, cmdFunc, scope) {
+			this.shortcuts.add(pattern, desc, cmdFunc, scope);
+		},
+
+		/**
+		 * Executes a command on the current instance. These commands can be TinyMCE internal commands prefixed with "mce" or
+		 * they can be build in browser commands such as "Bold". A compleate list of browser commands is available on MSDN or Mozilla.org.
+		 * This function will dispatch the execCommand function on each plugin, theme or the execcommand_callback option if none of these
+		 * return true it will handle the command as a internal browser command.
+		 *
+		 * @method execCommand
+		 * @param {String} cmd Command name to execute, for example mceLink or Bold.
+		 * @param {Boolean} ui True/false state if a UI (dialog) should be presented or not.
+		 * @param {mixed} value Optional command value, this can be anything.
+		 * @param {Object} args Optional arguments object.
+		 */
+		execCommand: function(cmd, ui, value, args) {
+			return this.editorCommands.execCommand(cmd, ui, value, args);
+		},
+
+		/**
+		 * Returns a command specific state, for example if bold is enabled or not.
+		 *
+		 * @method queryCommandState
+		 * @param {string} cmd Command to query state from.
+		 * @return {Boolean} Command specific state, for example if bold is enabled or not.
+		 */
+		queryCommandState: function(cmd) {
+			return this.editorCommands.queryCommandState(cmd);
+		},
+
+		/**
+		 * Returns a command specific value, for example the current font size.
+		 *
+		 * @method queryCommandValue
+		 * @param {string} cmd Command to query value from.
+		 * @return {Object} Command specific value, for example the current font size.
+		 */
+		queryCommandValue: function(cmd) {
+			return this.editorCommands.queryCommandValue(cmd);
+		},
+
+		/**
+		 * Returns true/false if the command is supported or not.
+		 *
+		 * @method queryCommandSupported
+		 * @param {String} cmd Command that we check support for.
+		 * @return {Boolean} true/false if the command is supported or not.
+		 */
+		queryCommandSupported: function(cmd) {
+			return this.editorCommands.queryCommandSupported(cmd);
+		},
+
+		/**
+		 * Shows the editor and hides any textarea/div that the editor is supposed to replace.
+		 *
+		 * @method show
+		 */
+		show: function() {
+			var self = this;
+
+			if (self.hidden) {
+				self.hidden = false;
+
+				if (self.inline) {
+					self.getBody().contentEditable = true;
+				} else {
+					DOM.show(self.getContainer());
+					DOM.hide(self.id);
+				}
+
+				self.load();
+				self.fire('show');
+			}
+		},
+
+		/**
+		 * Hides the editor and shows any textarea/div that the editor is supposed to replace.
+		 *
+		 * @method hide
+		 */
+		hide: function() {
+			var self = this, doc = self.getDoc();
+
+			if (!self.hidden) {
+				// Fixed bug where IE has a blinking cursor left from the editor
+				if (ie && doc && !self.inline) {
+					doc.execCommand('SelectAll');
+				}
+
+				// We must save before we hide so Safari doesn't crash
+				self.save();
+
+				if (self.inline) {
+					self.getBody().contentEditable = false;
+
+					// Make sure the editor gets blurred
+					if (self == self.editorManager.focusedEditor) {
+						self.editorManager.focusedEditor = null;
+					}
+				} else {
+					DOM.hide(self.getContainer());
+					DOM.setStyle(self.id, 'display', self.orgDisplay);
+				}
+
+				self.hidden = true;
+				self.fire('hide');
+			}
+		},
+
+		/**
+		 * Returns true/false if the editor is hidden or not.
+		 *
+		 * @method isHidden
+		 * @return {Boolean} True/false if the editor is hidden or not.
+		 */
+		isHidden: function() {
+			return !!this.hidden;
+		},
+
+		/**
+		 * Sets the progress state, this will display a throbber/progess for the editor.
+		 * This is ideal for asycronous operations like an AJAX save call.
+		 *
+		 * @method setProgressState
+		 * @param {Boolean} state Boolean state if the progress should be shown or hidden.
+		 * @param {Number} time Optional time to wait before the progress gets shown.
+		 * @return {Boolean} Same as the input state.
+		 * @example
+		 * // Show progress for the active editor
+		 * tinymce.activeEditor.setProgressState(true);
+		 *
+		 * // Hide progress for the active editor
+		 * tinymce.activeEditor.setProgressState(false);
+		 *
+		 * // Show progress after 3 seconds
+		 * tinymce.activeEditor.setProgressState(true, 3000);
+		 */
+		setProgressState: function(state, time) {
+			this.fire('ProgressState', {state: state, time: time});
+		},
+
+		/**
+		 * Loads contents from the textarea or div element that got converted into an editor instance.
+		 * This method will move the contents from that textarea or div into the editor by using setContent
+		 * so all events etc that method has will get dispatched as well.
+		 *
+		 * @method load
+		 * @param {Object} args Optional content object, this gets passed around through the whole load process.
+		 * @return {String} HTML string that got set into the editor.
+		 */
+		load: function(args) {
+			var self = this, elm = self.getElement(), html;
+
+			if (elm) {
+				args = args || {};
+				args.load = true;
+
+				html = self.setContent(elm.value !== undefined ? elm.value : elm.innerHTML, args);
+				args.element = elm;
+
+				if (!args.no_events) {
+					self.fire('LoadContent', args);
+				}
+
+				args.element = elm = null;
+
+				return html;
+			}
+		},
+
+		/**
+		 * Saves the contents from a editor out to the textarea or div element that got converted into an editor instance.
+		 * This method will move the HTML contents from the editor into that textarea or div by getContent
+		 * so all events etc that method has will get dispatched as well.
+		 *
+		 * @method save
+		 * @param {Object} args Optional content object, this gets passed around through the whole save process.
+		 * @return {String} HTML string that got set into the textarea/div.
+		 */
+		save: function(args) {
+			var self = this, elm = self.getElement(), html, form;
+
+			if (!elm || !self.initialized) {
+				return;
+			}
+
+			args = args || {};
+			args.save = true;
+
+			args.element = elm;
+			html = args.content = self.getContent(args);
+
+			if (!args.no_events) {
+				self.fire('SaveContent', args);
+			}
+
+			html = args.content;
+
+			if (!/TEXTAREA|INPUT/i.test(elm.nodeName)) {
+				// Update DIV element when not in inline mode
+				if (!self.inline) {
+					elm.innerHTML = html;
+				}
+
+				// Update hidden form element
+				if ((form = DOM.getParent(self.id, 'form'))) {
+					each(form.elements, function(elm) {
+						if (elm.name == self.id) {
+							elm.value = html;
+							return false;
+						}
+					});
+				}
+			} else {
+				elm.value = html;
+			}
+
+			args.element = elm = null;
+
+			if (args.set_dirty !== false) {
+				self.isNotDirty = true;
+			}
+
+			return html;
+		},
+
+		/**
+		 * Sets the specified content to the editor instance, this will cleanup the content before it gets set using
+		 * the different cleanup rules options.
+		 *
+		 * @method setContent
+		 * @param {String} content Content to set to editor, normally HTML contents but can be other formats as well.
+		 * @param {Object} args Optional content object, this gets passed around through the whole set process.
+		 * @return {String} HTML string that got set into the editor.
+		 * @example
+		 * // Sets the HTML contents of the activeEditor editor
+		 * tinymce.activeEditor.setContent('<span>some</span> html');
+		 *
+		 * // Sets the raw contents of the activeEditor editor
+		 * tinymce.activeEditor.setContent('<span>some</span> html', {format: 'raw'});
+		 *
+		 * // Sets the content of a specific editor (my_editor in this example)
+		 * tinymce.get('my_editor').setContent(data);
+		 *
+		 * // Sets the bbcode contents of the activeEditor editor if the bbcode plugin was added
+		 * tinymce.activeEditor.setContent('[b]some[/b] html', {format: 'bbcode'});
+		 */
+		setContent: function(content, args) {
+			var self = this, body = self.getBody(), forcedRootBlockName;
+
+			// Setup args object
+			args = args || {};
+			args.format = args.format || 'html';
+			args.set = true;
+			args.content = content;
+
+			// Do preprocessing
+			if (!args.no_events) {
+				self.fire('BeforeSetContent', args);
+			}
+
+			content = args.content;
+
+			// Padd empty content in Gecko and Safari. Commands will otherwise fail on the content
+			// It will also be impossible to place the caret in the editor unless there is a BR element present
+			if (content.length === 0 || /^\s+$/.test(content)) {
+				forcedRootBlockName = self.settings.forced_root_block;
+
+				// Check if forcedRootBlock is configured and that the block is a valid child of the body
+				if (forcedRootBlockName && self.schema.isValidChild(body.nodeName.toLowerCase(), forcedRootBlockName.toLowerCase())) {
+					// Padd with bogus BR elements on modern browsers and IE 7 and 8 since they don't render empty P tags properly
+					content = ie && ie < 11 ? '' : '<br data-mce-bogus="1">';
+					content = self.dom.createHTML(forcedRootBlockName, self.settings.forced_root_block_attrs, content);
+				} else if (!ie) {
+					// We need to add a BR when forced_root_block is disabled on non IE browsers to place the caret
+					content = '<br data-mce-bogus="1">';
+				}
+
+				self.dom.setHTML(body, content);
+
+				self.fire('SetContent', args);
+			} else {
+				// Parse and serialize the html
+				if (args.format !== 'raw') {
+					content = new Serializer({}, self.schema).serialize(
+						self.parser.parse(content, {isRootContent: true})
+					);
+				}
+
+				// Set the new cleaned contents to the editor
+				args.content = trim(content);
+				self.dom.setHTML(body, args.content);
+
+				// Do post processing
+				if (!args.no_events) {
+					self.fire('SetContent', args);
+				}
+
+				// Don't normalize selection if the focused element isn't the body in
+				// content editable mode since it will steal focus otherwise
+				/*if (!self.settings.content_editable || document.activeElement === self.getBody()) {
+					self.selection.normalize();
+				}*/
+			}
+
+			return args.content;
+		},
+
+		/**
+		 * Gets the content from the editor instance, this will cleanup the content before it gets returned using
+		 * the different cleanup rules options.
+		 *
+		 * @method getContent
+		 * @param {Object} args Optional content object, this gets passed around through the whole get process.
+		 * @return {String} Cleaned content string, normally HTML contents.
+		 * @example
+		 * // Get the HTML contents of the currently active editor
+		 * console.debug(tinymce.activeEditor.getContent());
+		 *
+		 * // Get the raw contents of the currently active editor
+		 * tinymce.activeEditor.getContent({format: 'raw'});
+		 *
+		 * // Get content of a specific editor:
+		 * tinymce.get('content id').getContent()
+		 */
+		getContent: function(args) {
+			var self = this, content, body = self.getBody();
+
+			// Setup args object
+			args = args || {};
+			args.format = args.format || 'html';
+			args.get = true;
+			args.getInner = true;
+
+			// Do preprocessing
+			if (!args.no_events) {
+				self.fire('BeforeGetContent', args);
+			}
+
+			// Get raw contents or by default the cleaned contents
+			if (args.format == 'raw') {
+				content = body.innerHTML;
+			} else if (args.format == 'text') {
+				content = body.innerText || body.textContent;
+			} else {
+				content = self.serializer.serialize(body, args);
+			}
+
+			// Trim whitespace in beginning/end of HTML
+			if (args.format != 'text') {
+				args.content = trim(content);
+			} else {
+				args.content = content;
+			}
+
+			// Do post processing
+			if (!args.no_events) {
+				self.fire('GetContent', args);
+			}
+
+			return args.content;
+		},
+
+		/**
+		 * Inserts content at caret position.
+		 *
+		 * @method insertContent
+		 * @param {String} content Content to insert.
+		 * @param {Object} args Optional args to pass to insert call.
+		 */
+		insertContent: function(content, args) {
+			if (args) {
+				content = extend({content: content}, args);
+			}
+
+			this.execCommand('mceInsertContent', false, content);
+		},
+
+		/**
+		 * Returns true/false if the editor is dirty or not. It will get dirty if the user has made modifications to the contents.
+		 *
+		 * @method isDirty
+		 * @return {Boolean} True/false if the editor is dirty or not. It will get dirty if the user has made modifications to the contents.
+		 * @example
+		 * if (tinymce.activeEditor.isDirty())
+		 *     alert("You must save your contents.");
+		 */
+		isDirty: function() {
+			return !this.isNotDirty;
+		},
+
+		/**
+		 * Returns the editors container element. The container element wrappes in
+		 * all the elements added to the page for the editor. Such as UI, iframe etc.
+		 *
+		 * @method getContainer
+		 * @return {Element} HTML DOM element for the editor container.
+		 */
+		getContainer: function() {
+			var self = this;
+
+			if (!self.container) {
+				self.container = DOM.get(self.editorContainer || self.id + '_parent');
+			}
+
+			return self.container;
+		},
+
+		/**
+		 * Returns the editors content area container element. The this element is the one who
+		 * holds the iframe or the editable element.
+		 *
+		 * @method getContentAreaContainer
+		 * @return {Element} HTML DOM element for the editor area container.
+		 */
+		getContentAreaContainer: function() {
+			return this.contentAreaContainer;
+		},
+
+		/**
+		 * Returns the target element/textarea that got replaced with a TinyMCE editor instance.
+		 *
+		 * @method getElement
+		 * @return {Element} HTML DOM element for the replaced element.
+		 */
+		getElement: function() {
+			if (!this.targetElm) {
+				this.targetElm = DOM.get(this.id);
+			}
+
+			return this.targetElm;
+		},
+
+		/**
+		 * Returns the iframes window object.
+		 *
+		 * @method getWin
+		 * @return {Window} Iframe DOM window object.
+		 */
+		getWin: function() {
+			var self = this, elm;
+
+			if (!self.contentWindow) {
+				elm = self.iframeElement;
+
+				if (elm) {
+					self.contentWindow = elm.contentWindow;
+				}
+			}
+
+			return self.contentWindow;
+		},
+
+		/**
+		 * Returns the iframes document object.
+		 *
+		 * @method getDoc
+		 * @return {Document} Iframe DOM document object.
+		 */
+		getDoc: function() {
+			var self = this, win;
+
+			if (!self.contentDocument) {
+				win = self.getWin();
+
+				if (win) {
+					self.contentDocument = win.document;
+				}
+			}
+
+			return self.contentDocument;
+		},
+
+		/**
+		 * Returns the root element of the editable area.
+		 * For a non-inline iframe-based editor, returns the iframe's body element.
+		 *
+		 * @method getBody
+		 * @return {Element} The root element of the editable area.
+		 */
+		getBody: function() {
+			return this.bodyElement || this.getDoc().body;
+		},
+
+		/**
+		 * URL converter function this gets executed each time a user adds an img, a or
+		 * any other element that has a URL in it. This will be called both by the DOM and HTML
+		 * manipulation functions.
+		 *
+		 * @method convertURL
+		 * @param {string} url URL to convert.
+		 * @param {string} name Attribute name src, href etc.
+		 * @param {string/HTMLElement} elm Tag name or HTML DOM element depending on HTML or DOM insert.
+		 * @return {string} Converted URL string.
+		 */
+		convertURL: function(url, name, elm) {
+			var self = this, settings = self.settings;
+
+			// Use callback instead
+			if (settings.urlconverter_callback) {
+				return self.execCallback('urlconverter_callback', url, elm, true, name);
+			}
+
+			// Don't convert link href since thats the CSS files that gets loaded into the editor also skip local file URLs
+			if (!settings.convert_urls || (elm && elm.nodeName == 'LINK') || url.indexOf('file:') === 0 || url.length === 0) {
+				return url;
+			}
+
+			// Convert to relative
+			if (settings.relative_urls) {
+				return self.documentBaseURI.toRelative(url);
+			}
+
+			// Convert to absolute
+			url = self.documentBaseURI.toAbsolute(url, settings.remove_script_host);
+
+			return url;
+		},
+
+		/**
+		 * Adds visual aid for tables, anchors etc so they can be more easily edited inside the editor.
+		 *
+		 * @method addVisual
+		 * @param {Element} elm Optional root element to loop though to find tables etc that needs the visual aid.
+		 */
+		addVisual: function(elm) {
+			var self = this, settings = self.settings, dom = self.dom, cls;
+
+			elm = elm || self.getBody();
+
+			if (self.hasVisual === undefined) {
+				self.hasVisual = settings.visual;
+			}
+
+			each(dom.select('table,a', elm), function(elm) {
+				var value;
+
+				switch (elm.nodeName) {
+					case 'TABLE':
+						cls = settings.visual_table_class || 'mce-item-table';
+						value = dom.getAttrib(elm, 'border');
+
+						if ((!value || value == '0') && self.hasVisual) {
+							dom.addClass(elm, cls);
+						} else {
+							dom.removeClass(elm, cls);
+						}
+
+						return;
+
+					case 'A':
+						if (!dom.getAttrib(elm, 'href', false)) {
+							value = dom.getAttrib(elm, 'name') || elm.id;
+							cls = settings.visual_anchor_class || 'mce-item-anchor';
+
+							if (value && self.hasVisual) {
+								dom.addClass(elm, cls);
+							} else {
+								dom.removeClass(elm, cls);
+							}
+						}
+
+						return;
+				}
+			});
+
+			self.fire('VisualAid', {element: elm, hasVisual: self.hasVisual});
+		},
+
+		/**
+		 * Removes the editor from the dom and tinymce collection.
+		 *
+		 * @method remove
+		 */
+		remove: function() {
+			var self = this;
+
+			if (!self.removed) {
+				self.save();
+				self.removed = 1;
+				self.unbindAllNativeEvents();
+
+				// Remove any hidden input
+				if (self.hasHiddenInput) {
+					DOM.remove(self.getElement().nextSibling);
+				}
+
+				if (!self.inline) {
+					// IE 9 has a bug where the selection stops working if you place the
+					// caret inside the editor then remove the iframe
+					if (ie && ie < 10) {
+						self.getDoc().execCommand('SelectAll', false, null);
+					}
+
+					DOM.setStyle(self.id, 'display', self.orgDisplay);
+					self.getBody().onload = null; // Prevent #6816
+				}
+
+				self.fire('remove');
+
+				self.editorManager.remove(self);
+				DOM.remove(self.getContainer());
+				self.destroy();
+			}
+		},
+
+		/**
+		 * Destroys the editor instance by removing all events, element references or other resources
+		 * that could leak memory. This method will be called automatically when the page is unloaded
+		 * but you can also call it directly if you know what you are doing.
+		 *
+		 * @method destroy
+		 * @param {Boolean} automatic Optional state if the destroy is an automatic destroy or user called one.
+		 */
+		destroy: function(automatic) {
+			var self = this, form;
+
+			// One time is enough
+			if (self.destroyed) {
+				return;
+			}
+
+			// If user manually calls destroy and not remove
+			// Users seems to have logic that calls destroy instead of remove
+			if (!automatic && !self.removed) {
+				self.remove();
+				return;
+			}
+
+			if (!automatic) {
+				self.editorManager.off('beforeunload', self._beforeUnload);
+
+				// Manual destroy
+				if (self.theme && self.theme.destroy) {
+					self.theme.destroy();
+				}
+
+				// Destroy controls, selection and dom
+				self.selection.destroy();
+				self.dom.destroy();
+			}
+
+			form = self.formElement;
+			if (form) {
+				if (form._mceOldSubmit) {
+					form.submit = form._mceOldSubmit;
+					form._mceOldSubmit = null;
+				}
+
+				DOM.unbind(form, 'submit reset', self.formEventDelegate);
+			}
+
+			self.contentAreaContainer = self.formElement = self.container = self.editorContainer = null;
+			self.bodyElement = self.contentDocument = self.contentWindow = null;
+			self.iframeElement = self.targetElm = null;
+
+			if (self.selection) {
+				self.selection = self.selection.win = self.selection.dom = self.selection.dom.doc = null;
+			}
+
+			self.destroyed = 1;
+		},
+
+		// Internal functions
+
+		_refreshContentEditable: function() {
+			var self = this, body, parent;
+
+			// Check if the editor was hidden and the re-initalize contentEditable mode by removing and adding the body again
+			if (self._isHidden()) {
+				body = self.getBody();
+				parent = body.parentNode;
+
+				parent.removeChild(body);
+				parent.appendChild(body);
+
+				body.focus();
+			}
+		},
+
+		_isHidden: function() {
+			var sel;
+
+			if (!isGecko) {
+				return 0;
+			}
+
+			// Weird, wheres that cursor selection?
+			sel = this.selection.getSel();
+			return (!sel || !sel.rangeCount || sel.rangeCount === 0);
+		}
+	};
+
+	extend(Editor.prototype, EditorObservable);
+
+	return Editor;
+});
+
+// Included from: js/tinymce/classes/util/I18n.js
+
+/**
+ * I18n.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * I18n class that handles translation of TinyMCE UI.
+ * Uses po style with csharp style parameters.
+ *
+ * @class tinymce.util.I18n
+ */
+define("tinymce/util/I18n", [], function() {
+	"use strict";
+
+	var data = {}, code = "en";
+
+	return {
+		/**
+		 * Sets the current language code.
+		 *
+		 * @method setCode
+		 * @param {String} newCode Current language code.
+		 */
+		setCode: function(newCode) {
+			if (newCode) {
+				code = newCode;
+				this.rtl = this.data[newCode] ? this.data[newCode]._dir === 'rtl' : false;
+			}
+		},
+
+		/**
+		 * Returns the current language code.
+		 *
+		 * @return {String} Current language code.
+		 */
+		getCode: function() {
+			return code;
+		},
+
+		/**
+		 * Property gets set to true if a RTL language pack was loaded.
+		 *
+		 * @property rtl
+		 * @type Boolean
+		 */
+		rtl: false,
+
+		/**
+		 * Adds translations for a specific language code.
+		 *
+		 * @method add
+		 * @param {String} code Language code like sv_SE.
+		 * @param {Array} items Name/value array with English en_US to sv_SE.
+		 */
+		add: function(code, items) {
+			var langData = data[code];
+
+			if (!langData) {
+				data[code] = langData = {};
+			}
+
+			for (var name in items) {
+				langData[name] = items[name];
+			}
+
+			this.setCode(code);
+		},
+
+		/**
+		 * Translates the specified text.
+		 *
+		 * It has a few formats:
+		 * I18n.translate("Text");
+		 * I18n.translate(["Text {0}/{1}", 0, 1]);
+		 * I18n.translate({raw: "Raw string"});
+		 *
+		 * @method translate
+		 * @param {String/Object/Array} text Text to translate.
+		 * @return {String} String that got translated.
+		 */
+		translate: function(text) {
+			var langData;
+
+			langData = data[code];
+			if (!langData) {
+				langData = {};
+			}
+
+			if (typeof text == "undefined") {
+				return text;
+			}
+
+			if (typeof text != "string" && text.raw) {
+				return text.raw;
+			}
+
+			if (text.push) {
+				var values = text.slice(1);
+
+				text = (langData[text[0]] || text[0]).replace(/\{([0-9]+)\}/g, function(match1, match2) {
+					return values[match2];
+				});
+			}
+
+			return (langData[text] || text).replace(/{context:\w+}$/, '');
+		},
+
+		data: data
+	};
+});
+
+// Included from: js/tinymce/classes/FocusManager.js
+
+/**
+ * FocusManager.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class manages the focus/blur state of the editor. This class is needed since some
+ * browsers fire false focus/blur states when the selection is moved to a UI dialog or similar.
+ *
+ * This class will fire two events focus and blur on the editor instances that got affected.
+ * It will also handle the restore of selection when the focus is lost and returned.
+ *
+ * @class tinymce.FocusManager
+ */
+define("tinymce/FocusManager", [
+	"tinymce/dom/DOMUtils",
+	"tinymce/Env"
+], function(DOMUtils, Env) {
+	var selectionChangeHandler, documentFocusInHandler, documentMouseUpHandler, DOM = DOMUtils.DOM;
+
+	/**
+	 * Constructs a new focus manager instance.
+	 *
+	 * @constructor FocusManager
+	 * @param {tinymce.EditorManager} editorManager Editor manager instance to handle focus for.
+	 */
+	function FocusManager(editorManager) {
+		function getActiveElement() {
+			try {
+				return document.activeElement;
+			} catch (ex) {
+				// IE sometimes fails to get the activeElement when resizing table
+				// TODO: Investigate this
+				return document.body;
+			}
+		}
+
+		// We can't store a real range on IE 11 since it gets mutated so we need to use a bookmark object
+		// TODO: Move this to a separate range utils class since it's it's logic is present in Selection as well.
+		function createBookmark(dom, rng) {
+			if (rng && rng.startContainer) {
+				// Verify that the range is within the root of the editor
+				if (!dom.isChildOf(rng.startContainer, dom.getRoot()) || !dom.isChildOf(rng.endContainer, dom.getRoot())) {
+					return;
+				}
+
+				return {
+					startContainer: rng.startContainer,
+					startOffset: rng.startOffset,
+					endContainer: rng.endContainer,
+					endOffset: rng.endOffset
+				};
+			}
+
+			return rng;
+		}
+
+		function bookmarkToRng(editor, bookmark) {
+			var rng;
+
+			if (bookmark.startContainer) {
+				rng = editor.getDoc().createRange();
+				rng.setStart(bookmark.startContainer, bookmark.startOffset);
+				rng.setEnd(bookmark.endContainer, bookmark.endOffset);
+			} else {
+				rng = bookmark;
+			}
+
+			return rng;
+		}
+
+		function isUIElement(elm) {
+			return !!DOM.getParent(elm, FocusManager.isEditorUIElement);
+		}
+
+		function registerEvents(e) {
+			var editor = e.editor;
+
+			editor.on('init', function() {
+				// Gecko/WebKit has ghost selections in iframes and IE only has one selection per browser tab
+				if (editor.inline || Env.ie) {
+					// Use the onbeforedeactivate event when available since it works better see #7023
+					if ("onbeforedeactivate" in document && Env.ie < 9) {
+						editor.dom.bind(editor.getBody(), 'beforedeactivate', function(e) {
+							if (e.target != editor.getBody()) {
+								return;
+							}
+
+							try {
+								editor.lastRng = editor.selection.getRng();
+							} catch (ex) {
+								// IE throws "Unexcpected call to method or property access" some times so lets ignore it
+							}
+						});
+					} else {
+						// On other browsers take snapshot on nodechange in inline mode since they have Ghost selections for iframes
+						editor.on('nodechange mouseup keyup', function(e) {
+							var node = getActiveElement();
+
+							// Only act on manual nodechanges
+							if (e.type == 'nodechange' && e.selectionChange) {
+								return;
+							}
+
+							// IE 11 reports active element as iframe not body of iframe
+							if (node && node.id == editor.id + '_ifr') {
+								node = editor.getBody();
+							}
+
+							if (editor.dom.isChildOf(node, editor.getBody())) {
+								editor.lastRng = editor.selection.getRng();
+							}
+						});
+					}
+
+					// Handles the issue with WebKit not retaining selection within inline document
+					// If the user releases the mouse out side the body since a mouse up event wont occur on the body
+					if (Env.webkit && !selectionChangeHandler) {
+						selectionChangeHandler = function() {
+							var activeEditor = editorManager.activeEditor;
+
+							if (activeEditor && activeEditor.selection) {
+								var rng = activeEditor.selection.getRng();
+
+								// Store when it's non collapsed
+								if (rng && !rng.collapsed) {
+									editor.lastRng = rng;
+								}
+							}
+						};
+
+						DOM.bind(document, 'selectionchange', selectionChangeHandler);
+					}
+				}
+			});
+
+			editor.on('setcontent', function() {
+				editor.lastRng = null;
+			});
+
+			// Remove last selection bookmark on mousedown see #6305
+			editor.on('mousedown', function() {
+				editor.selection.lastFocusBookmark = null;
+			});
+
+			editor.on('focusin', function() {
+				var focusedEditor = editorManager.focusedEditor;
+
+				if (editor.selection.lastFocusBookmark) {
+					editor.selection.setRng(bookmarkToRng(editor, editor.selection.lastFocusBookmark));
+					editor.selection.lastFocusBookmark = null;
+				}
+
+				if (focusedEditor != editor) {
+					if (focusedEditor) {
+						focusedEditor.fire('blur', {focusedEditor: editor});
+					}
+
+					editorManager.setActive(editor);
+					editorManager.focusedEditor = editor;
+					editor.fire('focus', {blurredEditor: focusedEditor});
+					editor.focus(true);
+				}
+
+				editor.lastRng = null;
+			});
+
+			editor.on('focusout', function() {
+				window.setTimeout(function() {
+					var focusedEditor = editorManager.focusedEditor;
+
+					// Still the same editor the the blur was outside any editor UI
+					if (!isUIElement(getActiveElement()) && focusedEditor == editor) {
+						editor.fire('blur', {focusedEditor: null});
+						editorManager.focusedEditor = null;
+
+						// Make sure selection is valid could be invalid if the editor is blured and removed before the timeout occurs
+						if (editor.selection) {
+							editor.selection.lastFocusBookmark = null;
+						}
+					}
+				}, 0);
+			});
+
+			// Check if focus is moved to an element outside the active editor by checking if the target node
+			// isn't within the body of the activeEditor nor a UI element such as a dialog child control
+			if (!documentFocusInHandler) {
+				documentFocusInHandler = function(e) {
+					var activeEditor = editorManager.activeEditor;
+
+					if (activeEditor && e.target.ownerDocument == document) {
+						// Check to make sure we have a valid selection don't update the bookmark if it's
+						// a focusin to the body of the editor see #7025
+						if (activeEditor.selection && e.target != activeEditor.getBody()) {
+							activeEditor.selection.lastFocusBookmark = createBookmark(activeEditor.dom, activeEditor.lastRng);
+						}
+
+						// Fire a blur event if the element isn't a UI element
+						if (e.target != document.body && !isUIElement(e.target) && editorManager.focusedEditor == activeEditor) {
+							activeEditor.fire('blur', {focusedEditor: null});
+							editorManager.focusedEditor = null;
+						}
+					}
+				};
+
+				DOM.bind(document, 'focusin', documentFocusInHandler);
+			}
+
+			// Handle edge case when user starts the selection inside the editor and releases
+			// the mouse outside the editor producing a new selection. This weird workaround is needed since
+			// Gecko doesn't have the "selectionchange" event we need to do this. Fixes: #6843
+			if (editor.inline && !documentMouseUpHandler) {
+				documentMouseUpHandler = function(e) {
+					var activeEditor = editorManager.activeEditor;
+
+					if (activeEditor.inline && !activeEditor.dom.isChildOf(e.target, activeEditor.getBody())) {
+						var rng = activeEditor.selection.getRng();
+
+						if (!rng.collapsed) {
+							activeEditor.lastRng = rng;
+						}
+					}
+				};
+
+				DOM.bind(document, 'mouseup', documentMouseUpHandler);
+			}
+		}
+
+		function unregisterDocumentEvents(e) {
+			if (editorManager.focusedEditor == e.editor) {
+				editorManager.focusedEditor = null;
+			}
+
+			if (!editorManager.activeEditor) {
+				DOM.unbind(document, 'selectionchange', selectionChangeHandler);
+				DOM.unbind(document, 'focusin', documentFocusInHandler);
+				DOM.unbind(document, 'mouseup', documentMouseUpHandler);
+				selectionChangeHandler = documentFocusInHandler = documentMouseUpHandler = null;
+			}
+		}
+
+		editorManager.on('AddEditor', registerEvents);
+		editorManager.on('RemoveEditor', unregisterDocumentEvents);
+	}
+
+	/**
+	 * Returns true if the specified element is part of the UI for example an button or text input.
+	 *
+	 * @method isEditorUIElement
+	 * @param  {Element} elm Element to check if it's part of the UI or not.
+	 * @return {Boolean} True/false state if the element is part of the UI or not.
+	 */
+	FocusManager.isEditorUIElement = function(elm) {
+		// Needs to be converted to string since svg can have focus: #6776
+		return elm.className.toString().indexOf('mce-') !== -1;
+	};
+
+	return FocusManager;
+});
+
+// Included from: js/tinymce/classes/EditorManager.js
+
+/**
+ * EditorManager.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class used as a factory for manager for tinymce.Editor instances.
+ *
+ * @example
+ * tinymce.EditorManager.init({});
+ *
+ * @class tinymce.EditorManager
+ * @mixes tinymce.util.Observable
+ * @static
+ */
+define("tinymce/EditorManager", [
+	"tinymce/Editor",
+	"tinymce/dom/DomQuery",
+	"tinymce/dom/DOMUtils",
+	"tinymce/util/URI",
+	"tinymce/Env",
+	"tinymce/util/Tools",
+	"tinymce/util/Observable",
+	"tinymce/util/I18n",
+	"tinymce/FocusManager"
+], function(Editor, DomQuery, DOMUtils, URI, Env, Tools, Observable, I18n, FocusManager) {
+	var DOM = DOMUtils.DOM;
+	var explode = Tools.explode, each = Tools.each, extend = Tools.extend;
+	var instanceCounter = 0, beforeUnloadDelegate, EditorManager;
+
+	function removeEditorFromList(editor) {
+		var editors = EditorManager.editors, removedFromList;
+
+		delete editors[editor.id];
+
+		for (var i = 0; i < editors.length; i++) {
+			if (editors[i] == editor) {
+				editors.splice(i, 1);
+				removedFromList = true;
+				break;
+			}
+		}
+
+		// Select another editor since the active one was removed
+		if (EditorManager.activeEditor == editor) {
+			EditorManager.activeEditor = editors[0];
+		}
+
+		// Clear focusedEditor if necessary, so that we don't try to blur the destroyed editor
+		if (EditorManager.focusedEditor == editor) {
+			EditorManager.focusedEditor = null;
+		}
+
+		return removedFromList;
+	}
+
+	function purgeDestroyedEditor(editor) {
+		// User has manually destroyed the editor lets clean up the mess
+		if (editor && !(editor.getContainer() || editor.getBody()).parentNode) {
+			removeEditorFromList(editor);
+			editor.unbindAllNativeEvents();
+			editor.destroy(true);
+			editor = null;
+		}
+
+		return editor;
+	}
+
+	EditorManager = {
+		/**
+		 * Dom query instance.
+		 *
+		 * @property $
+		 * @type tinymce.dom.DomQuery
+		 */
+		$: DomQuery,
+
+		/**
+		 * Major version of TinyMCE build.
+		 *
+		 * @property majorVersion
+		 * @type String
+		 */
+		majorVersion: '4',
+
+		/**
+		 * Minor version of TinyMCE build.
+		 *
+		 * @property minorVersion
+		 * @type String
+		 */
+		minorVersion: '1.10',
+
+		/**
+		 * Release date of TinyMCE build.
+		 *
+		 * @property releaseDate
+		 * @type String
+		 */
+		releaseDate: '2015-05-05',
+
+		/**
+		 * Collection of editor instances.
+		 *
+		 * @property editors
+		 * @type Object
+		 * @example
+		 * for (edId in tinymce.editors)
+		 *     tinymce.editors[edId].save();
+		 */
+		editors: [],
+
+		/**
+		 * Collection of language pack data.
+		 *
+		 * @property i18n
+		 * @type Object
+		 */
+		i18n: I18n,
+
+		/**
+		 * Currently active editor instance.
+		 *
+		 * @property activeEditor
+		 * @type tinymce.Editor
+		 * @example
+		 * tinyMCE.activeEditor.selection.getContent();
+		 * tinymce.EditorManager.activeEditor.selection.getContent();
+		 */
+		activeEditor: null,
+
+		setup: function() {
+			var self = this, baseURL, documentBaseURL, suffix = "", preInit, src;
+
+			// Get base URL for the current document
+			documentBaseURL = document.location.href;
+
+			// Check if the URL is a document based format like: http://site/dir/file and file:///
+			// leave other formats like applewebdata://... intact
+			if (/^[^:]+:\/\/\/?[^\/]+\//.test(documentBaseURL)) {
+				documentBaseURL = documentBaseURL.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, '');
+
+				if (!/[\/\\]$/.test(documentBaseURL)) {
+					documentBaseURL += '/';
+				}
+			}
+
+			// If tinymce is defined and has a base use that or use the old tinyMCEPreInit
+			preInit = window.tinymce || window.tinyMCEPreInit;
+			if (preInit) {
+				baseURL = preInit.base || preInit.baseURL;
+				suffix = preInit.suffix;
+			} else {
+				// Get base where the tinymce script is located
+				var scripts = document.getElementsByTagName('script');
+				for (var i = 0; i < scripts.length; i++) {
+					src = scripts[i].src;
+
+					// Script types supported:
+					// tinymce.js tinymce.min.js tinymce.dev.js
+					// tinymce.jquery.js tinymce.jquery.min.js tinymce.jquery.dev.js
+					// tinymce.full.js tinymce.full.min.js tinymce.full.dev.js
+					if (/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(src)) {
+						if (src.indexOf('.min') != -1) {
+							suffix = '.min';
+						}
+
+						baseURL = src.substring(0, src.lastIndexOf('/'));
+						break;
+					}
+				}
+
+				// We didn't find any baseURL by looking at the script elements
+				// Try to use the document.currentScript as a fallback
+				if (!baseURL && document.currentScript) {
+					src = document.currentScript.src;
+
+					if (src.indexOf('.min') != -1) {
+						suffix = '.min';
+					}
+
+					baseURL = src.substring(0, src.lastIndexOf('/'));
+				}
+			}
+
+			/**
+			 * Base URL where the root directory if TinyMCE is located.
+			 *
+			 * @property baseURL
+			 * @type String
+			 */
+			self.baseURL = new URI(documentBaseURL).toAbsolute(baseURL);
+
+			/**
+			 * Document base URL where the current document is located.
+			 *
+			 * @property documentBaseURL
+			 * @type String
+			 */
+			self.documentBaseURL = documentBaseURL;
+
+			/**
+			 * Absolute baseURI for the installation path of TinyMCE.
+			 *
+			 * @property baseURI
+			 * @type tinymce.util.URI
+			 */
+			self.baseURI = new URI(self.baseURL);
+
+			/**
+			 * Current suffix to add to each plugin/theme that gets loaded for example ".min".
+			 *
+			 * @property suffix
+			 * @type String
+			 */
+			self.suffix = suffix;
+
+			self.focusManager = new FocusManager(self);
+		},
+
+		/**
+		 * Initializes a set of editors. This method will create editors based on various settings.
+		 *
+		 * @method init
+		 * @param {Object} settings Settings object to be passed to each editor instance.
+		 * @example
+		 * // Initializes a editor using the longer method
+		 * tinymce.EditorManager.init({
+		 *    some_settings : 'some value'
+		 * });
+		 *
+		 * // Initializes a editor instance using the shorter version
+		 * tinyMCE.init({
+		 *    some_settings : 'some value'
+		 * });
+		 */
+		init: function(settings) {
+			var self = this, editors = [];
+
+			function createId(elm) {
+				var id = elm.id;
+
+				// Use element id, or unique name or generate a unique id
+				if (!id) {
+					id = elm.name;
+
+					if (id && !DOM.get(id)) {
+						id = elm.name;
+					} else {
+						// Generate unique name
+						id = DOM.uniqueId();
+					}
+
+					elm.setAttribute('id', id);
+				}
+
+				return id;
+			}
+
+			function createEditor(id, settings, targetElm) {
+				if (!purgeDestroyedEditor(self.get(id))) {
+					var editor = new Editor(id, settings, self);
+
+					editor.targetElm = editor.targetElm || targetElm;
+					editors.push(editor);
+					editor.render();
+				}
+			}
+
+			function execCallback(name) {
+				var callback = settings[name];
+
+				if (!callback) {
+					return;
+				}
+
+				return callback.apply(self, Array.prototype.slice.call(arguments, 2));
+			}
+
+			function hasClass(elm, className) {
+				return className.constructor === RegExp ? className.test(elm.className) : DOM.hasClass(elm, className);
+			}
+
+			function readyHandler() {
+				var l, co;
+
+				DOM.unbind(window, 'ready', readyHandler);
+
+				execCallback('onpageload');
+
+				if (settings.types) {
+					// Process type specific selector
+					each(settings.types, function(type) {
+						each(DOM.select(type.selector), function(elm) {
+							createEditor(createId(elm), extend({}, settings, type), elm);
+						});
+					});
+
+					return;
+				} else if (settings.selector) {
+					// Process global selector
+					each(DOM.select(settings.selector), function(elm) {
+						createEditor(createId(elm), settings, elm);
+					});
+
+					return;
+				} else if (settings.target) {
+					createEditor(createId(settings.target), settings);
+				}
+
+				// Fallback to old setting
+				switch (settings.mode) {
+					case "exact":
+						l = settings.elements || '';
+
+						if (l.length > 0) {
+							each(explode(l), function(id) {
+								var elm;
+
+								if ((elm = DOM.get(id))) {
+									createEditor(id, settings, elm);
+								} else {
+									each(document.forms, function(f) {
+										each(f.elements, function(e) {
+											if (e.name === id) {
+												id = 'mce_editor_' + instanceCounter++;
+												DOM.setAttrib(e, 'id', id);
+												createEditor(id, settings, e);
+											}
+										});
+									});
+								}
+							});
+						}
+						break;
+
+					case "textareas":
+					case "specific_textareas":
+						each(DOM.select('textarea'), function(elm) {
+							if (settings.editor_deselector && hasClass(elm, settings.editor_deselector)) {
+								return;
+							}
+
+							if (!settings.editor_selector || hasClass(elm, settings.editor_selector)) {
+								createEditor(createId(elm), settings, elm);
+							}
+						});
+						break;
+				}
+
+				// Call onInit when all editors are initialized
+				if (settings.oninit) {
+					l = co = 0;
+
+					each(editors, function(ed) {
+						co++;
+
+						if (!ed.initialized) {
+							// Wait for it
+							ed.on('init', function() {
+								l++;
+
+								// All done
+								if (l == co) {
+									execCallback('oninit');
+								}
+							});
+						} else {
+							l++;
+						}
+
+						// All done
+						if (l == co) {
+							execCallback('oninit');
+						}
+					});
+				}
+			}
+
+			self.settings = settings;
+
+			DOM.bind(window, 'ready', readyHandler);
+		},
+
+		/**
+		 * Returns a editor instance by id.
+		 *
+		 * @method get
+		 * @param {String/Number} id Editor instance id or index to return.
+		 * @return {tinymce.Editor} Editor instance to return.
+		 * @example
+		 * // Adds an onclick event to an editor by id (shorter version)
+		 * tinymce.get('mytextbox').on('click', function(e) {
+		 *    ed.windowManager.alert('Hello world!');
+		 * });
+		 *
+		 * // Adds an onclick event to an editor by id (longer version)
+		 * tinymce.EditorManager.get('mytextbox').on('click', function(e) {
+		 *    ed.windowManager.alert('Hello world!');
+		 * });
+		 */
+		get: function(id) {
+			if (!arguments.length) {
+				return this.editors;
+			}
+
+			return id in this.editors ? this.editors[id] : null;
+		},
+
+		/**
+		 * Adds an editor instance to the editor collection. This will also set it as the active editor.
+		 *
+		 * @method add
+		 * @param {tinymce.Editor} editor Editor instance to add to the collection.
+		 * @return {tinymce.Editor} The same instance that got passed in.
+		 */
+		add: function(editor) {
+			var self = this, editors = self.editors;
+
+			// Add named and index editor instance
+			editors[editor.id] = editor;
+			editors.push(editor);
+
+			// Doesn't call setActive method since we don't want
+			// to fire a bunch of activate/deactivate calls while initializing
+			self.activeEditor = editor;
+
+			/**
+			 * Fires when an editor is added to the EditorManager collection.
+			 *
+			 * @event AddEditor
+			 * @param {Object} e Event arguments.
+			 */
+			self.fire('AddEditor', {editor: editor});
+
+			if (!beforeUnloadDelegate) {
+				beforeUnloadDelegate = function() {
+					self.fire('BeforeUnload');
+				};
+
+				DOM.bind(window, 'beforeunload', beforeUnloadDelegate);
+			}
+
+			return editor;
+		},
+
+		/**
+		 * Creates an editor instance and adds it to the EditorManager collection.
+		 *
+		 * @method createEditor
+		 * @param {String} id Instance id to use for editor.
+		 * @param {Object} settings Editor instance settings.
+		 * @return {tinymce.Editor} Editor instance that got created.
+		 */
+		createEditor: function(id, settings) {
+			return this.add(new Editor(id, settings, this));
+		},
+
+		/**
+		 * Removes a editor or editors form page.
+		 *
+		 * @example
+		 * // Remove all editors bound to divs
+		 * tinymce.remove('div');
+		 *
+		 * // Remove all editors bound to textareas
+		 * tinymce.remove('textarea');
+		 *
+		 * // Remove all editors
+		 * tinymce.remove();
+		 *
+		 * // Remove specific instance by id
+		 * tinymce.remove('#id');
+		 *
+		 * @method remove
+		 * @param {tinymce.Editor/String/Object} [selector] CSS selector or editor instance to remove.
+		 * @return {tinymce.Editor} The editor that got passed in will be return if it was found otherwise null.
+		 */
+		remove: function(selector) {
+			var self = this, i, editors = self.editors, editor;
+
+			// Remove all editors
+			if (!selector) {
+				for (i = editors.length - 1; i >= 0; i--) {
+					self.remove(editors[i]);
+				}
+
+				return;
+			}
+
+			// Remove editors by selector
+			if (typeof selector == "string") {
+				selector = selector.selector || selector;
+
+				each(DOM.select(selector), function(elm) {
+					editor = editors[elm.id];
+
+					if (editor) {
+						self.remove(editor);
+					}
+				});
+
+				return;
+			}
+
+			// Remove specific editor
+			editor = selector;
+
+			// Not in the collection
+			if (!editors[editor.id]) {
+				return null;
+			}
+
+			/**
+			 * Fires when an editor is removed from EditorManager collection.
+			 *
+			 * @event RemoveEditor
+			 * @param {Object} e Event arguments.
+			 */
+			if (removeEditorFromList(editor)) {
+				self.fire('RemoveEditor', {editor: editor});
+			}
+
+			if (!editors.length) {
+				DOM.unbind(window, 'beforeunload', beforeUnloadDelegate);
+			}
+
+			editor.remove();
+
+			return editor;
+		},
+
+		/**
+		 * Executes a specific command on the currently active editor.
+		 *
+		 * @method execCommand
+		 * @param {String} c Command to perform for example Bold.
+		 * @param {Boolean} u Optional boolean state if a UI should be presented for the command or not.
+		 * @param {String} v Optional value parameter like for example an URL to a link.
+		 * @return {Boolean} true/false if the command was executed or not.
+		 */
+		execCommand: function(cmd, ui, value) {
+			var self = this, editor = self.get(value);
+
+			// Manager commands
+			switch (cmd) {
+				case "mceAddEditor":
+					if (!self.get(value)) {
+						new Editor(value, self.settings, self).render();
+					}
+
+					return true;
+
+				case "mceRemoveEditor":
+					if (editor) {
+						editor.remove();
+					}
+
+					return true;
+
+				case 'mceToggleEditor':
+					if (!editor) {
+						self.execCommand('mceAddEditor', 0, value);
+						return true;
+					}
+
+					if (editor.isHidden()) {
+						editor.show();
+					} else {
+						editor.hide();
+					}
+
+					return true;
+			}
+
+			// Run command on active editor
+			if (self.activeEditor) {
+				return self.activeEditor.execCommand(cmd, ui, value);
+			}
+
+			return false;
+		},
+
+		/**
+		 * Calls the save method on all editor instances in the collection. This can be useful when a form is to be submitted.
+		 *
+		 * @method triggerSave
+		 * @example
+		 * // Saves all contents
+		 * tinyMCE.triggerSave();
+		 */
+		triggerSave: function() {
+			each(this.editors, function(editor) {
+				editor.save();
+			});
+		},
+
+		/**
+		 * Adds a language pack, this gets called by the loaded language files like en.js.
+		 *
+		 * @method addI18n
+		 * @param {String} code Optional language code.
+		 * @param {Object} items Name/value object with translations.
+		 */
+		addI18n: function(code, items) {
+			I18n.add(code, items);
+		},
+
+		/**
+		 * Translates the specified string using the language pack items.
+		 *
+		 * @method translate
+		 * @param {String/Array/Object} text String to translate
+		 * @return {String} Translated string.
+		 */
+		translate: function(text) {
+			return I18n.translate(text);
+		},
+
+		/**
+		 * Sets the active editor instance and fires the deactivate/activate events.
+		 *
+		 * @method setActive
+		 * @param {tinymce.Editor} editor Editor instance to set as the active instance.
+		 */
+		setActive: function(editor) {
+			var activeEditor = this.activeEditor;
+
+			if (this.activeEditor != editor) {
+				if (activeEditor) {
+					activeEditor.fire('deactivate', {relatedTarget: editor});
+				}
+
+				editor.fire('activate', {relatedTarget: activeEditor});
+			}
+
+			this.activeEditor = editor;
+		}
+	};
+
+	extend(EditorManager, Observable);
+
+	EditorManager.setup();
+
+	// Export EditorManager as tinymce/tinymce in global namespace
+	window.tinymce = window.tinyMCE = EditorManager;
+
+	return EditorManager;
+});
+
+// Included from: js/tinymce/classes/LegacyInput.js
+
+/**
+ * LegacyInput.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+define("tinymce/LegacyInput", [
+	"tinymce/EditorManager",
+	"tinymce/util/Tools"
+], function(EditorManager, Tools) {
+	var each = Tools.each, explode = Tools.explode;
+
+	EditorManager.on('AddEditor', function(e) {
+		var editor = e.editor;
+
+		editor.on('preInit', function() {
+			var filters, fontSizes, dom, settings = editor.settings;
+
+			function replaceWithSpan(node, styles) {
+				each(styles, function(value, name) {
+					if (value) {
+						dom.setStyle(node, name, value);
+					}
+				});
+
+				dom.rename(node, 'span');
+			}
+
+			function convert(e) {
+				dom = editor.dom;
+
+				if (settings.convert_fonts_to_spans) {
+					each(dom.select('font,u,strike', e.node), function(node) {
+						filters[node.nodeName.toLowerCase()](dom, node);
+					});
+				}
+			}
+
+			if (settings.inline_styles) {
+				fontSizes = explode(settings.font_size_legacy_values);
+
+				filters = {
+					font: function(dom, node) {
+						replaceWithSpan(node, {
+							backgroundColor: node.style.backgroundColor,
+							color: node.color,
+							fontFamily: node.face,
+							fontSize: fontSizes[parseInt(node.size, 10) - 1]
+						});
+					},
+
+					u: function(dom, node) {
+						// HTML5 allows U element
+						if (editor.settings.schema === "html4") {
+							replaceWithSpan(node, {
+								textDecoration: 'underline'
+							});
+						}
+					},
+
+					strike: function(dom, node) {
+						replaceWithSpan(node, {
+							textDecoration: 'line-through'
+						});
+					}
+				};
+
+				editor.on('PreProcess SetContent', convert);
+			}
+		});
+	});
+});
+
+// Included from: js/tinymce/classes/util/XHR.js
+
+/**
+ * XHR.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class enables you to send XMLHTTPRequests cross browser.
+ * @class tinymce.util.XHR
+ * @mixes tinymce.util.Observable
+ * @static
+ * @example
+ * // Sends a low level Ajax request
+ * tinymce.util.XHR.send({
+ *    url: 'someurl',
+ *    success: function(text) {
+ *       console.debug(text);
+ *    }
+ * });
+ *
+ * // Add custom header to XHR request
+ * tinymce.util.XHR.on('beforeSend', function(e) {
+ *     e.xhr.setRequestHeader('X-Requested-With', 'Something');
+ * });
+ */
+define("tinymce/util/XHR", [
+	"tinymce/util/Observable",
+	"tinymce/util/Tools"
+], function(Observable, Tools) {
+	var XHR = {
+		/**
+		 * Sends a XMLHTTPRequest.
+		 * Consult the Wiki for details on what settings this method takes.
+		 *
+		 * @method send
+		 * @param {Object} settings Object will target URL, callbacks and other info needed to make the request.
+		 */
+		send: function(settings) {
+			var xhr, count = 0;
+
+			function ready() {
+				if (!settings.async || xhr.readyState == 4 || count++ > 10000) {
+					if (settings.success && count < 10000 && xhr.status == 200) {
+						settings.success.call(settings.success_scope, '' + xhr.responseText, xhr, settings);
+					} else if (settings.error) {
+						settings.error.call(settings.error_scope, count > 10000 ? 'TIMED_OUT' : 'GENERAL', xhr, settings);
+					}
+
+					xhr = null;
+				} else {
+					setTimeout(ready, 10);
+				}
+			}
+
+			// Default settings
+			settings.scope = settings.scope || this;
+			settings.success_scope = settings.success_scope || settings.scope;
+			settings.error_scope = settings.error_scope || settings.scope;
+			settings.async = settings.async === false ? false : true;
+			settings.data = settings.data || '';
+
+			xhr = new XMLHttpRequest();
+
+			if (xhr) {
+				if (xhr.overrideMimeType) {
+					xhr.overrideMimeType(settings.content_type);
+				}
+
+				xhr.open(settings.type || (settings.data ? 'POST' : 'GET'), settings.url, settings.async);
+
+				if (settings.crossDomain) {
+					xhr.withCredentials = true;
+				}
+
+				if (settings.content_type) {
+					xhr.setRequestHeader('Content-Type', settings.content_type);
+				}
+
+				xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
+
+				xhr = XHR.fire('beforeSend', {xhr: xhr, settings: settings}).xhr;
+				xhr.send(settings.data);
+
+				// Syncronous request
+				if (!settings.async) {
+					return ready();
+				}
+
+				// Wait for response, onReadyStateChange can not be used since it leaks memory in IE
+				setTimeout(ready, 10);
+			}
+		}
+	};
+
+	Tools.extend(XHR, Observable);
+
+	return XHR;
+});
+
+// Included from: js/tinymce/classes/util/JSON.js
+
+/**
+ * JSON.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * JSON parser and serializer class.
+ *
+ * @class tinymce.util.JSON
+ * @static
+ * @example
+ * // JSON parse a string into an object
+ * var obj = tinymce.util.JSON.parse(somestring);
+ *
+ * // JSON serialize a object into an string
+ * var str = tinymce.util.JSON.serialize(obj);
+ */
+define("tinymce/util/JSON", [], function() {
+	function serialize(o, quote) {
+		var i, v, t, name;
+
+		quote = quote || '"';
+
+		if (o === null) {
+			return 'null';
+		}
+
+		t = typeof o;
+
+		if (t == 'string') {
+			v = '\bb\tt\nn\ff\rr\""\'\'\\\\';
+
+			return quote + o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g, function(a, b) {
+				// Make sure single quotes never get encoded inside double quotes for JSON compatibility
+				if (quote === '"' && a === "'") {
+					return a;
+				}
+
+				i = v.indexOf(b);
+
+				if (i + 1) {
+					return '\\' + v.charAt(i + 1);
+				}
+
+				a = b.charCodeAt().toString(16);
+
+				return '\\u' + '0000'.substring(a.length) + a;
+			}) + quote;
+		}
+
+		if (t == 'object') {
+			if (o.hasOwnProperty && Object.prototype.toString.call(o) === '[object Array]') {
+				for (i = 0, v = '['; i < o.length; i++) {
+					v += (i > 0 ? ',' : '') + serialize(o[i], quote);
+				}
+
+				return v + ']';
+			}
+
+			v = '{';
+
+			for (name in o) {
+				if (o.hasOwnProperty(name)) {
+					v += typeof o[name] != 'function' ? (v.length > 1 ? ',' + quote : quote) + name +
+						quote + ':' + serialize(o[name], quote) : '';
+				}
+			}
+
+			return v + '}';
+		}
+
+		return '' + o;
+	}
+
+	return {
+		/**
+		 * Serializes the specified object as a JSON string.
+		 *
+		 * @method serialize
+		 * @param {Object} obj Object to serialize as a JSON string.
+		 * @param {String} quote Optional quote string defaults to ".
+		 * @return {string} JSON string serialized from input.
+		 */
+		serialize: serialize,
+
+		/**
+		 * Unserializes/parses the specified JSON string into a object.
+		 *
+		 * @method parse
+		 * @param {string} s JSON String to parse into a JavaScript object.
+		 * @return {Object} Object from input JSON string or undefined if it failed.
+		 */
+		parse: function(text) {
+			try {
+				// Trick uglify JS
+				return window[String.fromCharCode(101) + 'val']('(' + text + ')');
+			} catch (ex) {
+				// Ignore
+			}
+		}
+
+		/**#@-*/
+	};
+});
+
+// Included from: js/tinymce/classes/util/JSONRequest.js
+
+/**
+ * JSONRequest.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class enables you to use JSON-RPC to call backend methods.
+ *
+ * @class tinymce.util.JSONRequest
+ * @example
+ * var json = new tinymce.util.JSONRequest({
+ *     url: 'somebackend.php'
+ * });
+ *
+ * // Send RPC call 1
+ * json.send({
+ *     method: 'someMethod1',
+ *     params: ['a', 'b'],
+ *     success: function(result) {
+ *         console.dir(result);
+ *     }
+ * });
+ *
+ * // Send RPC call 2
+ * json.send({
+ *     method: 'someMethod2',
+ *     params: ['a', 'b'],
+ *     success: function(result) {
+ *         console.dir(result);
+ *     }
+ * });
+ */
+define("tinymce/util/JSONRequest", [
+	"tinymce/util/JSON",
+	"tinymce/util/XHR",
+	"tinymce/util/Tools"
+], function(JSON, XHR, Tools) {
+	var extend = Tools.extend;
+
+	function JSONRequest(settings) {
+		this.settings = extend({}, settings);
+		this.count = 0;
+	}
+
+	/**
+	 * Simple helper function to send a JSON-RPC request without the need to initialize an object.
+	 * Consult the Wiki API documentation for more details on what you can pass to this function.
+	 *
+	 * @method sendRPC
+	 * @static
+	 * @param {Object} o Call object where there are three field id, method and params this object should also contain callbacks etc.
+	 */
+	JSONRequest.sendRPC = function(o) {
+		return new JSONRequest().send(o);
+	};
+
+	JSONRequest.prototype = {
+		/**
+		 * Sends a JSON-RPC call. Consult the Wiki API documentation for more details on what you can pass to this function.
+		 *
+		 * @method send
+		 * @param {Object} args Call object where there are three field id, method and params this object should also contain callbacks etc.
+		 */
+		send: function(args) {
+			var ecb = args.error, scb = args.success;
+
+			args = extend(this.settings, args);
+
+			args.success = function(c, x) {
+				c = JSON.parse(c);
+
+				if (typeof c == 'undefined') {
+					c = {
+						error: 'JSON Parse error.'
+					};
+				}
+
+				if (c.error) {
+					ecb.call(args.error_scope || args.scope, c.error, x);
+				} else {
+					scb.call(args.success_scope || args.scope, c.result);
+				}
+			};
+
+			args.error = function(ty, x) {
+				if (ecb) {
+					ecb.call(args.error_scope || args.scope, ty, x);
+				}
+			};
+
+			args.data = JSON.serialize({
+				id: args.id || 'c' + (this.count++),
+				method: args.method,
+				params: args.params
+			});
+
+			// JSON content type for Ruby on rails. Bug: #1883287
+			args.content_type = 'application/json';
+
+			XHR.send(args);
+		}
+	};
+
+	return JSONRequest;
+});
+
+// Included from: js/tinymce/classes/util/JSONP.js
+
+/**
+ * JSONP.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+define("tinymce/util/JSONP", [
+	"tinymce/dom/DOMUtils"
+], function(DOMUtils) {
+	return {
+		callbacks: {},
+		count: 0,
+
+		send: function(settings) {
+			var self = this, dom = DOMUtils.DOM, count = settings.count !== undefined ? settings.count : self.count;
+			var id = 'tinymce_jsonp_' + count;
+
+			self.callbacks[count] = function(json) {
+				dom.remove(id);
+				delete self.callbacks[count];
+
+				settings.callback(json);
+			};
+
+			dom.add(dom.doc.body, 'script', {
+				id: id,
+				src: settings.url,
+				type: 'text/javascript'
+			});
+
+			self.count++;
+		}
+	};
+});
+
+// Included from: js/tinymce/classes/util/LocalStorage.js
+
+/**
+ * LocalStorage.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class will simulate LocalStorage on IE 7 and return the native version on modern browsers.
+ * Storage is done using userData on IE 7 and a special serialization format. The format is designed
+ * to be as small as possible by making sure that the keys and values doesn't need to be encoded. This
+ * makes it possible to store for example HTML data.
+ *
+ * Storage format for userData:
+ * <base 32 key length>,<key string>,<base 32 value length>,<value>,...
+ *
+ * For example this data key1=value1,key2=value2 would be:
+ * 4,key1,6,value1,4,key2,6,value2
+ *
+ * @class tinymce.util.LocalStorage
+ * @static
+ * @version 4.0
+ * @example
+ * tinymce.util.LocalStorage.setItem('key', 'value');
+ * var value = tinymce.util.LocalStorage.getItem('key');
+ */
+define("tinymce/util/LocalStorage", [], function() {
+	var LocalStorage, storageElm, items, keys, userDataKey, hasOldIEDataSupport;
+
+	// Check for native support
+	try {
+		if (window.localStorage) {
+			return localStorage;
+		}
+	} catch (ex) {
+		// Ignore
+	}
+
+	userDataKey = "tinymce";
+	storageElm = document.documentElement;
+	hasOldIEDataSupport = !!storageElm.addBehavior;
+
+	if (hasOldIEDataSupport) {
+		storageElm.addBehavior('#default#userData');
+	}
+
+	/**
+	 * Gets the keys names and updates LocalStorage.length property. Since IE7 doesn't have any getters/setters.
+	 */
+	function updateKeys() {
+		keys = [];
+
+		for (var key in items) {
+			keys.push(key);
+		}
+
+		LocalStorage.length = keys.length;
+	}
+
+	/**
+	 * Loads the userData string and parses it into the items structure.
+	 */
+	function load() {
+		var key, data, value, pos = 0;
+
+		items = {};
+
+		// localStorage can be disabled on WebKit/Gecko so make a dummy storage
+		if (!hasOldIEDataSupport) {
+			return;
+		}
+
+		function next(end) {
+			var value, nextPos;
+
+			nextPos = end !== undefined ? pos + end : data.indexOf(',', pos);
+			if (nextPos === -1 || nextPos > data.length) {
+				return null;
+			}
+
+			value = data.substring(pos, nextPos);
+			pos = nextPos + 1;
+
+			return value;
+		}
+
+		storageElm.load(userDataKey);
+		data = storageElm.getAttribute(userDataKey) || '';
+
+		do {
+			var offset = next();
+			if (offset === null) {
+				break;
+			}
+
+			key = next(parseInt(offset, 32) || 0);
+			if (key !== null) {
+				offset = next();
+				if (offset === null) {
+					break;
+				}
+
+				value = next(parseInt(offset, 32) || 0);
+
+				if (key) {
+					items[key] = value;
+				}
+			}
+		} while (key !== null);
+
+		updateKeys();
+	}
+
+	/**
+	 * Saves the items structure into a the userData format.
+	 */
+	function save() {
+		var value, data = '';
+
+		// localStorage can be disabled on WebKit/Gecko so make a dummy storage
+		if (!hasOldIEDataSupport) {
+			return;
+		}
+
+		for (var key in items) {
+			value = items[key];
+			data += (data ? ',' : '') + key.length.toString(32) + ',' + key + ',' + value.length.toString(32) + ',' + value;
+		}
+
+		storageElm.setAttribute(userDataKey, data);
+
+		try {
+			storageElm.save(userDataKey);
+		} catch (ex) {
+			// Ignore disk full
+		}
+
+		updateKeys();
+	}
+
+	LocalStorage = {
+		/**
+		 * Length of the number of items in storage.
+		 *
+		 * @property length
+		 * @type Number
+		 * @return {Number} Number of items in storage.
+		 */
+		//length:0,
+
+		/**
+		 * Returns the key name by index.
+		 *
+		 * @method key
+		 * @param {Number} index Index of key to return.
+		 * @return {String} Key value or null if it wasn't found.
+		 */
+		key: function(index) {
+			return keys[index];
+		},
+
+		/**
+		 * Returns the value if the specified key or null if it wasn't found.
+		 *
+		 * @method getItem
+		 * @param {String} key Key of item to retrive.
+		 * @return {String} Value of the specified item or null if it wasn't found.
+		 */
+		getItem: function(key) {
+			return key in items ? items[key] : null;
+		},
+
+		/**
+		 * Sets the value of the specified item by it's key.
+		 *
+		 * @method setItem
+		 * @param {String} key Key of the item to set.
+		 * @param {String} value Value of the item to set.
+		 */
+		setItem: function(key, value) {
+			items[key] = "" + value;
+			save();
+		},
+
+		/**
+		 * Removes the specified item by key.
+		 *
+		 * @method removeItem
+		 * @param {String} key Key of item to remove.
+		 */
+		removeItem: function(key) {
+			delete items[key];
+			save();
+		},
+
+		/**
+		 * Removes all items.
+		 *
+		 * @method clear
+		 */
+		clear: function() {
+			items = {};
+			save();
+		}
+	};
+
+	load();
+
+	return LocalStorage;
+});
+
+// Included from: js/tinymce/classes/Compat.js
+
+/**
+ * Compat.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * TinyMCE core class.
+ *
+ * @static
+ * @class tinymce
+ * @borrow-members tinymce.EditorManager
+ * @borrow-members tinymce.util.Tools
+ */
+define("tinymce/Compat", [
+	"tinymce/dom/DOMUtils",
+	"tinymce/dom/EventUtils",
+	"tinymce/dom/ScriptLoader",
+	"tinymce/AddOnManager",
+	"tinymce/util/Tools",
+	"tinymce/Env"
+], function(DOMUtils, EventUtils, ScriptLoader, AddOnManager, Tools, Env) {
+	var tinymce = window.tinymce;
+
+	/**
+	 * @property {tinymce.dom.DOMUtils} DOM Global DOM instance.
+	 * @property {tinymce.dom.ScriptLoader} ScriptLoader Global ScriptLoader instance.
+	 * @property {tinymce.AddOnManager} PluginManager Global PluginManager instance.
+	 * @property {tinymce.AddOnManager} ThemeManager Global ThemeManager instance.
+	 */
+	tinymce.DOM = DOMUtils.DOM;
+	tinymce.ScriptLoader = ScriptLoader.ScriptLoader;
+	tinymce.PluginManager = AddOnManager.PluginManager;
+	tinymce.ThemeManager = AddOnManager.ThemeManager;
+
+	tinymce.dom = tinymce.dom || {};
+	tinymce.dom.Event = EventUtils.Event;
+
+	Tools.each(Tools, function(func, key) {
+		tinymce[key] = func;
+	});
+
+	Tools.each('isOpera isWebKit isIE isGecko isMac'.split(' '), function(name) {
+		tinymce[name] = Env[name.substr(2).toLowerCase()];
+	});
+
+	return {};
+});
+
+// Describe the different namespaces
+
+/**
+ * Root level namespace this contains classes directly releated to the TinyMCE editor.
+ *
+ * @namespace tinymce
+ */
+
+/**
+ * Contains classes for handling the browsers DOM.
+ *
+ * @namespace tinymce.dom
+ */
+
+/**
+ * Contains html parser and serializer logic.
+ *
+ * @namespace tinymce.html
+ */
+
+/**
+ * Contains the different UI types such as buttons, listboxes etc.
+ *
+ * @namespace tinymce.ui
+ */
+
+/**
+ * Contains various utility classes such as json parser, cookies etc.
+ *
+ * @namespace tinymce.util
+ */
+
+// Included from: js/tinymce/classes/ui/Layout.js
+
+/**
+ * Layout.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Base layout manager class.
+ *
+ * @class tinymce.ui.Layout
+ */
+define("tinymce/ui/Layout", [
+	"tinymce/util/Class",
+	"tinymce/util/Tools"
+], function(Class, Tools) {
+	"use strict";
+
+	return Class.extend({
+		Defaults: {
+			firstControlClass: 'first',
+			lastControlClass: 'last'
+		},
+
+		/**
+		 * Constructs a layout instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 */
+		init: function(settings) {
+			this.settings = Tools.extend({}, this.Defaults, settings);
+		},
+
+		/**
+		 * This method gets invoked before the layout renders the controls.
+		 *
+		 * @method preRender
+		 * @param {tinymce.ui.Container} container Container instance to preRender.
+		 */
+		preRender: function(container) {
+			container.addClass(this.settings.containerClass, 'body');
+		},
+
+		/**
+		 * Applies layout classes to the container.
+		 *
+		 * @private
+		 */
+		applyClasses: function(container) {
+			var self = this, settings = self.settings, items, firstClass, lastClass;
+
+			items = container.items().filter(':visible');
+			firstClass = settings.firstControlClass;
+			lastClass = settings.lastControlClass;
+
+			items.each(function(item) {
+				item.removeClass(firstClass).removeClass(lastClass);
+
+				if (settings.controlClass) {
+					item.addClass(settings.controlClass);
+				}
+			});
+
+			items.eq(0).addClass(firstClass);
+			items.eq(-1).addClass(lastClass);
+		},
+
+		/**
+		 * Renders the specified container and any layout specific HTML.
+		 *
+		 * @method renderHtml
+		 * @param {tinymce.ui.Container} container Container to render HTML for.
+		 */
+		renderHtml: function(container) {
+			var self = this, settings = self.settings, items, html = '';
+
+			items = container.items();
+			items.eq(0).addClass(settings.firstControlClass);
+			items.eq(-1).addClass(settings.lastControlClass);
+
+			items.each(function(item) {
+				if (settings.controlClass) {
+					item.addClass(settings.controlClass);
+				}
+
+				html += item.renderHtml();
+			});
+
+			return html;
+		},
+
+		/**
+		 * Recalculates the positions of the controls in the specified container.
+		 *
+		 * @method recalc
+		 * @param {tinymce.ui.Container} container Container instance to recalc.
+		 */
+		recalc: function() {
+		},
+
+		/**
+		 * This method gets invoked after the layout renders the controls.
+		 *
+		 * @method postRender
+		 * @param {tinymce.ui.Container} container Container instance to postRender.
+		 */
+		postRender: function() {
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/AbsoluteLayout.js
+
+/**
+ * AbsoluteLayout.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * LayoutManager for absolute positioning. This layout manager is more of
+ * a base class for other layouts but can be created and used directly.
+ *
+ * @-x-less AbsoluteLayout.less
+ * @class tinymce.ui.AbsoluteLayout
+ * @extends tinymce.ui.Layout
+ */
+define("tinymce/ui/AbsoluteLayout", [
+	"tinymce/ui/Layout"
+], function(Layout) {
+	"use strict";
+
+	return Layout.extend({
+		Defaults: {
+			containerClass: 'abs-layout',
+			controlClass: 'abs-layout-item'
+		},
+
+		/**
+		 * Recalculates the positions of the controls in the specified container.
+		 *
+		 * @method recalc
+		 * @param {tinymce.ui.Container} container Container instance to recalc.
+		 */
+		recalc: function(container) {
+			container.items().filter(':visible').each(function(ctrl) {
+				var settings = ctrl.settings;
+
+				ctrl.layoutRect({
+					x: settings.x,
+					y: settings.y,
+					w: settings.w,
+					h: settings.h
+				});
+
+				if (ctrl.recalc) {
+					ctrl.recalc();
+				}
+			});
+		},
+
+		/**
+		 * Renders the specified container and any layout specific HTML.
+		 *
+		 * @method renderHtml
+		 * @param {tinymce.ui.Container} container Container to render HTML for.
+		 */
+		renderHtml: function(container) {
+			return '<div id="' + container._id + '-absend" class="' + container.classPrefix + 'abs-end"></div>' + this._super(container);
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/Tooltip.js
+
+/**
+ * Tooltip.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a tooltip instance.
+ *
+ * @-x-less ToolTip.less
+ * @class tinymce.ui.ToolTip
+ * @extends tinymce.ui.Control
+ * @mixes tinymce.ui.Movable
+ */
+define("tinymce/ui/Tooltip", [
+	"tinymce/ui/Control",
+	"tinymce/ui/Movable"
+], function(Control, Movable) {
+	return Control.extend({
+		Mixins: [Movable],
+
+		Defaults: {
+			classes: 'widget tooltip tooltip-n'
+		},
+
+		/**
+		 * Sets/gets the current label text.
+		 *
+		 * @method text
+		 * @param {String} [text] New label text.
+		 * @return {String|tinymce.ui.Tooltip} Current text or current label instance.
+		 */
+		text: function(value) {
+			var self = this;
+
+			if (typeof value != "undefined") {
+				self._value = value;
+
+				if (self._rendered) {
+					self.getEl().lastChild.innerHTML = self.encode(value);
+				}
+
+				return self;
+			}
+
+			return self._value;
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, prefix = self.classPrefix;
+
+			return (
+				'<div id="' + self._id + '" class="' + self.classes() + '" role="presentation">' +
+					'<div class="' + prefix + 'tooltip-arrow"></div>' +
+					'<div class="' + prefix + 'tooltip-inner">' + self.encode(self._text) + '</div>' +
+				'</div>'
+			);
+		},
+
+		/**
+		 * Repaints the control after a layout operation.
+		 *
+		 * @method repaint
+		 */
+		repaint: function() {
+			var self = this, style, rect;
+
+			style = self.getEl().style;
+			rect = self._layoutRect;
+
+			style.left = rect.x + 'px';
+			style.top = rect.y + 'px';
+			style.zIndex = 0xFFFF + 0xFFFF;
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/Widget.js
+
+/**
+ * Widget.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Widget base class a widget is a control that has a tooltip and some basic states.
+ *
+ * @class tinymce.ui.Widget
+ * @extends tinymce.ui.Control
+ */
+define("tinymce/ui/Widget", [
+	"tinymce/ui/Control",
+	"tinymce/ui/Tooltip"
+], function(Control, Tooltip) {
+	"use strict";
+
+	var tooltip;
+
+	var Widget = Control.extend({
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {String} tooltip Tooltip text to display when hovering.
+		 * @setting {Boolean} autofocus True if the control should be focused when rendered.
+		 * @setting {String} text Text to display inside widget.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self._super(settings);
+			settings = self.settings;
+			self.canFocus = true;
+
+			if (settings.tooltip && Widget.tooltips !== false) {
+				self.on('mouseenter', function(e) {
+					var tooltip = self.tooltip().moveTo(-0xFFFF);
+
+					if (e.control == self) {
+						var rel = tooltip.text(settings.tooltip).show().testMoveRel(self.getEl(), ['bc-tc', 'bc-tl', 'bc-tr']);
+
+						tooltip.toggleClass('tooltip-n', rel == 'bc-tc');
+						tooltip.toggleClass('tooltip-nw', rel == 'bc-tl');
+						tooltip.toggleClass('tooltip-ne', rel == 'bc-tr');
+
+						tooltip.moveRel(self.getEl(), rel);
+					} else {
+						tooltip.hide();
+					}
+				});
+
+				self.on('mouseleave mousedown click', function() {
+					self.tooltip().hide();
+				});
+			}
+
+			self.aria('label', settings.ariaLabel || settings.tooltip);
+		},
+
+		/**
+		 * Returns the current tooltip instance.
+		 *
+		 * @method tooltip
+		 * @return {tinymce.ui.Tooltip} Tooltip instance.
+		 */
+		tooltip: function() {
+			if (!tooltip) {
+				tooltip = new Tooltip({type: 'tooltip'});
+				tooltip.renderTo();
+			}
+
+			return tooltip;
+		},
+
+		/**
+		 * Sets/gets the active state of the widget.
+		 *
+		 * @method active
+		 * @param {Boolean} [state] State if the control is active.
+		 * @return {Boolean|tinymce.ui.Widget} True/false or current widget instance.
+		 */
+		active: function(state) {
+			var self = this, undef;
+
+			if (state !== undef) {
+				self.aria('pressed', state);
+				self.toggleClass('active', state);
+			}
+
+			return self._super(state);
+		},
+
+		/**
+		 * Sets/gets the disabled state of the widget.
+		 *
+		 * @method disabled
+		 * @param {Boolean} [state] State if the control is disabled.
+		 * @return {Boolean|tinymce.ui.Widget} True/false or current widget instance.
+		 */
+		disabled: function(state) {
+			var self = this, undef;
+
+			if (state !== undef) {
+				self.aria('disabled', state);
+				self.toggleClass('disabled', state);
+			}
+
+			return self._super(state);
+		},
+
+		/**
+		 * Called after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this, settings = self.settings;
+
+			self._rendered = true;
+
+			self._super();
+
+			if (!self.parent() && (settings.width || settings.height)) {
+				self.initLayoutRect();
+				self.repaint();
+			}
+
+			if (settings.autofocus) {
+				self.focus();
+			}
+		},
+
+		/**
+		 * Removes the current control from DOM and from UI collections.
+		 *
+		 * @method remove
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		remove: function() {
+			this._super();
+
+			if (tooltip) {
+				tooltip.remove();
+				tooltip = null;
+			}
+		}
+	});
+
+	return Widget;
+});
+
+// Included from: js/tinymce/classes/ui/Button.js
+
+/**
+ * Button.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is used to create buttons. You can create them directly or through the Factory.
+ *
+ * @example
+ * // Create and render a button to the body element
+ * tinymce.ui.Factory.create({
+ *     type: 'button',
+ *     text: 'My button'
+ * }).renderTo(document.body);
+ *
+ * @-x-less Button.less
+ * @class tinymce.ui.Button
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/Button", [
+	"tinymce/ui/Widget"
+], function(Widget) {
+	"use strict";
+
+	return Widget.extend({
+		Defaults: {
+			classes: "widget btn",
+			role: "button"
+		},
+
+		/**
+		 * Constructs a new button instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {String} size Size of the button small|medium|large.
+		 * @setting {String} image Image to use for icon.
+		 * @setting {String} icon Icon to use for button.
+		 */
+		init: function(settings) {
+			var self = this, size;
+
+			self.on('click mousedown', function(e) {
+				e.preventDefault();
+			});
+
+			self._super(settings);
+			size = settings.size;
+
+			if (settings.subtype) {
+				self.addClass(settings.subtype);
+			}
+
+			if (size) {
+				self.addClass('btn-' + size);
+			}
+		},
+
+		/**
+		 * Sets/gets the current button icon.
+		 *
+		 * @method icon
+		 * @param {String} [icon] New icon identifier.
+		 * @return {String|tinymce.ui.MenuButton} Current icon or current MenuButton instance.
+		 */
+		icon: function(icon) {
+			var self = this, prefix = self.classPrefix;
+
+			if (typeof icon == 'undefined') {
+				return self.settings.icon;
+			}
+
+			self.settings.icon = icon;
+			icon = icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : '';
+
+			if (self._rendered) {
+				var btnElm = self.getEl().firstChild, iconElm = btnElm.getElementsByTagName('i')[0];
+
+				if (icon) {
+					if (!iconElm || iconElm != btnElm.firstChild) {
+						iconElm = document.createElement('i');
+						btnElm.insertBefore(iconElm, btnElm.firstChild);
+					}
+
+					iconElm.className = icon;
+				} else if (iconElm) {
+					btnElm.removeChild(iconElm);
+				}
+
+				self.text(self._text); // Set text again to fix whitespace between icon + text
+			}
+
+			return self;
+		},
+
+		/**
+		 * Repaints the button for example after it's been resizes by a layout engine.
+		 *
+		 * @method repaint
+		 */
+		repaint: function() {
+			var btnStyle = this.getEl().firstChild.style;
+
+			btnStyle.width = btnStyle.height = "100%";
+
+			this._super();
+		},
+
+		/**
+		 * Sets/gets the current button text.
+		 *
+		 * @method text
+		 * @param {String} [text] New button text.
+		 * @return {String|tinymce.ui.Button} Current text or current Button instance.
+		 */
+		text: function(text) {
+			var self = this;
+
+			if (self._rendered) {
+				var textNode = self.getEl().lastChild.lastChild;
+				if (textNode) {
+					textNode.data = self.translate(text);
+				}
+			}
+
+			return self._super(text);
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, id = self._id, prefix = self.classPrefix;
+			var icon = self.settings.icon, image;
+
+			image = self.settings.image;
+			if (image) {
+				icon = 'none';
+
+				// Support for [high dpi, low dpi] image sources
+				if (typeof image != "string") {
+					image = window.getSelection ? image[0] : image[1];
+				}
+
+				image = ' style="background-image: url(\'' + image + '\')"';
+			} else {
+				image = '';
+			}
+
+			icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
+
+			return (
+				'<div id="' + id + '" class="' + self.classes() + '" tabindex="-1" aria-labelledby="' + id + '">' +
+					'<button role="presentation" type="button" tabindex="-1">' +
+						(icon ? '<i class="' + icon + '"' + image + '></i>' : '') +
+						(self._text ? (icon ? '\u00a0' : '') + self.encode(self._text) : '') +
+					'</button>' +
+				'</div>'
+			);
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/ButtonGroup.js
+
+/**
+ * ButtonGroup.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This control enables you to put multiple buttons into a group. This is
+ * useful when you want to combine similar toolbar buttons into a group.
+ *
+ * @example
+ * // Create and render a buttongroup with two buttons to the body element
+ * tinymce.ui.Factory.create({
+ *     type: 'buttongroup',
+ *     items: [
+ *         {text: 'Button A'},
+ *         {text: 'Button B'}
+ *     ]
+ * }).renderTo(document.body);
+ *
+ * @-x-less ButtonGroup.less
+ * @class tinymce.ui.ButtonGroup
+ * @extends tinymce.ui.Container
+ */
+define("tinymce/ui/ButtonGroup", [
+	"tinymce/ui/Container"
+], function(Container) {
+	"use strict";
+
+	return Container.extend({
+		Defaults: {
+			defaultType: 'button',
+			role: 'group'
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, layout = self._layout;
+
+			self.addClass('btn-group');
+			self.preRender();
+			layout.preRender(self);
+
+			return (
+				'<div id="' + self._id + '" class="' + self.classes() + '">' +
+					'<div id="' + self._id + '-body">' +
+						(self.settings.html || '') + layout.renderHtml(self) +
+					'</div>' +
+				'</div>'
+			);
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/Checkbox.js
+
+/**
+ * Checkbox.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This control creates a custom checkbox.
+ *
+ * @example
+ * // Create and render a checkbox to the body element
+ * tinymce.ui.Factory.create({
+ *     type: 'checkbox',
+ *     checked: true,
+ *     text: 'My checkbox'
+ * }).renderTo(document.body);
+ *
+ * @-x-less Checkbox.less
+ * @class tinymce.ui.Checkbox
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/Checkbox", [
+	"tinymce/ui/Widget"
+], function(Widget) {
+	"use strict";
+
+	return Widget.extend({
+		Defaults: {
+			classes: "checkbox",
+			role: "checkbox",
+			checked: false
+		},
+
+		/**
+		 * Constructs a new Checkbox instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {Boolean} checked True if the checkbox should be checked by default.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self._super(settings);
+
+			self.on('click mousedown', function(e) {
+				e.preventDefault();
+			});
+
+			self.on('click', function(e) {
+				e.preventDefault();
+
+				if (!self.disabled()) {
+					self.checked(!self.checked());
+				}
+			});
+
+			self.checked(self.settings.checked);
+		},
+
+		/**
+		 * Getter/setter function for the checked state.
+		 *
+		 * @method checked
+		 * @param {Boolean} [state] State to be set.
+		 * @return {Boolean|tinymce.ui.Checkbox} True/false or checkbox if it's a set operation.
+		 */
+		checked: function(state) {
+			var self = this;
+
+			if (typeof state != "undefined") {
+				if (state) {
+					self.addClass('checked');
+				} else {
+					self.removeClass('checked');
+				}
+
+				self._checked = state;
+				self.aria('checked', state);
+
+				return self;
+			}
+
+			return self._checked;
+		},
+
+		/**
+		 * Getter/setter function for the value state.
+		 *
+		 * @method value
+		 * @param {Boolean} [state] State to be set.
+		 * @return {Boolean|tinymce.ui.Checkbox} True/false or checkbox if it's a set operation.
+		 */
+		value: function(state) {
+			return this.checked(state);
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, id = self._id, prefix = self.classPrefix;
+
+			return (
+				'<div id="' + id + '" class="' + self.classes() + '" unselectable="on" aria-labelledby="' + id + '-al" tabindex="-1">' +
+					'<i class="' + prefix + 'ico ' + prefix + 'i-checkbox"></i>' +
+					'<span id="' + id + '-al" class="' + prefix + 'label">' + self.encode(self._text) + '</span>' +
+				'</div>'
+			);
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/ComboBox.js
+
+/**
+ * ComboBox.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class creates a combobox control. Select box that you select a value from or
+ * type a value into.
+ *
+ * @-x-less ComboBox.less
+ * @class tinymce.ui.ComboBox
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/ComboBox", [
+	"tinymce/ui/Widget",
+	"tinymce/ui/Factory",
+	"tinymce/ui/DomUtils"
+], function(Widget, Factory, DomUtils) {
+	"use strict";
+
+	return Widget.extend({
+		/**
+		 * Constructs a new control instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {String} placeholder Placeholder text to display.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self._super(settings);
+			self.addClass('combobox');
+			self.subinput = true;
+			self.ariaTarget = 'inp'; // TODO: Figure out a better way
+
+			settings = self.settings;
+			settings.menu = settings.menu || settings.values;
+
+			if (settings.menu) {
+				settings.icon = 'caret';
+			}
+
+			self.on('click', function(e) {
+				var elm = e.target, root = self.getEl();
+
+				while (elm && elm != root) {
+					if (elm.id && elm.id.indexOf('-open') != -1) {
+						self.fire('action');
+
+						if (settings.menu) {
+							self.showMenu();
+
+							if (e.aria) {
+								self.menu.items()[0].focus();
+							}
+						}
+					}
+
+					elm = elm.parentNode;
+				}
+			});
+
+			// TODO: Rework this
+			self.on('keydown', function(e) {
+				if (e.target.nodeName == "INPUT" && e.keyCode == 13) {
+					self.parents().reverse().each(function(ctrl) {
+						e.preventDefault();
+						self.fire('change');
+
+						if (ctrl.hasEventListeners('submit') && ctrl.toJSON) {
+							ctrl.fire('submit', {data: ctrl.toJSON()});
+							return false;
+						}
+					});
+				}
+			});
+
+			if (settings.placeholder) {
+				self.addClass('placeholder');
+
+				self.on('focusin', function() {
+					if (!self._hasOnChange) {
+						DomUtils.on(self.getEl('inp'), 'change', function() {
+							self.fire('change');
+						});
+
+						self._hasOnChange = true;
+					}
+
+					if (self.hasClass('placeholder')) {
+						self.getEl('inp').value = '';
+						self.removeClass('placeholder');
+					}
+				});
+
+				self.on('focusout', function() {
+					if (self.value().length === 0) {
+						self.getEl('inp').value = settings.placeholder;
+						self.addClass('placeholder');
+					}
+				});
+			}
+		},
+
+		showMenu: function() {
+			var self = this, settings = self.settings, menu;
+
+			if (!self.menu) {
+				menu = settings.menu || [];
+
+				// Is menu array then auto constuct menu control
+				if (menu.length) {
+					menu = {
+						type: 'menu',
+						items: menu
+					};
+				} else {
+					menu.type = menu.type || 'menu';
+				}
+
+				self.menu = Factory.create(menu).parent(self).renderTo(self.getContainerElm());
+				self.fire('createmenu');
+				self.menu.reflow();
+				self.menu.on('cancel', function(e) {
+					if (e.control === self.menu) {
+						self.focus();
+					}
+				});
+
+				self.menu.on('show hide', function(e) {
+					e.control.items().each(function(ctrl) {
+						ctrl.active(ctrl.value() == self.value());
+					});
+				}).fire('show');
+
+				self.menu.on('select', function(e) {
+					self.value(e.control.value());
+				});
+
+				self.on('focusin', function(e) {
+					if (e.target.tagName.toUpperCase() == 'INPUT') {
+						self.menu.hide();
+					}
+				});
+
+				self.aria('expanded', true);
+			}
+
+			self.menu.show();
+			self.menu.layoutRect({w: self.layoutRect().w});
+			self.menu.moveRel(self.getEl(), self.isRtl() ? ['br-tr', 'tr-br'] : ['bl-tl', 'tl-bl']);
+		},
+
+		/**
+		 * Getter/setter function for the control value.
+		 *
+		 * @method value
+		 * @param {String} [value] Value to be set.
+		 * @return {String|tinymce.ui.ComboBox} Value or self if it's a set operation.
+		 */
+		value: function(value) {
+			var self = this;
+
+			if (typeof value != "undefined") {
+				self._value = value;
+				self.removeClass('placeholder');
+
+				if (self._rendered) {
+					self.getEl('inp').value = value;
+				}
+
+				return self;
+			}
+
+			if (self._rendered) {
+				value = self.getEl('inp').value;
+
+				if (value != self.settings.placeholder) {
+					return value;
+				}
+
+				return '';
+			}
+
+			return self._value;
+		},
+
+		/**
+		 * Getter/setter function for the disabled state.
+		 *
+		 * @method value
+		 * @param {Boolean} [state] State to be set.
+		 * @return {Boolean|tinymce.ui.ComboBox} True/false or self if it's a set operation.
+		 */
+		disabled: function(state) {
+			var self = this;
+
+			if (self._rendered && typeof state != 'undefined') {
+				self.getEl('inp').disabled = state;
+			}
+
+			return self._super(state);
+		},
+
+		/**
+		 * Focuses the input area of the control.
+		 *
+		 * @method focus
+		 */
+		focus: function() {
+			this.getEl('inp').focus();
+		},
+
+		/**
+		 * Repaints the control after a layout operation.
+		 *
+		 * @method repaint
+		 */
+		repaint: function() {
+			var self = this, elm = self.getEl(), openElm = self.getEl('open'), rect = self.layoutRect();
+			var width, lineHeight;
+
+			if (openElm) {
+				width = rect.w - DomUtils.getSize(openElm).width - 10;
+			} else {
+				width = rect.w - 10;
+			}
+
+			// Detect old IE 7+8 add lineHeight to align caret vertically in the middle
+			var doc = document;
+			if (doc.all && (!doc.documentMode || doc.documentMode <= 8)) {
+				lineHeight = (self.layoutRect().h - 2) + 'px';
+			}
+
+			DomUtils.css(elm.firstChild, {
+				width: width,
+				lineHeight: lineHeight
+			});
+
+			self._super();
+
+			return self;
+		},
+
+		/**
+		 * Post render method. Called after the control has been rendered to the target.
+		 *
+		 * @method postRender
+		 * @return {tinymce.ui.ComboBox} Current combobox instance.
+		 */
+		postRender: function() {
+			var self = this;
+
+			DomUtils.on(this.getEl('inp'), 'change', function() {
+				self.fire('change');
+			});
+
+			return self._super();
+		},
+
+		remove: function() {
+			DomUtils.off(this.getEl('inp'));
+			this._super();
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, id = self._id, settings = self.settings, prefix = self.classPrefix;
+			var value = settings.value || settings.placeholder || '';
+			var icon, text, openBtnHtml = '', extraAttrs = '';
+
+			if ("spellcheck" in settings) {
+				extraAttrs += ' spellcheck="' + settings.spellcheck + '"';
+			}
+
+			if (settings.maxLength) {
+				extraAttrs += ' maxlength="' + settings.maxLength + '"';
+			}
+
+			if (settings.size) {
+				extraAttrs += ' size="' + settings.size + '"';
+			}
+
+			if (settings.subtype) {
+				extraAttrs += ' type="' + settings.subtype + '"';
+			}
+
+			if (self.disabled()) {
+				extraAttrs += ' disabled="disabled"';
+			}
+
+			icon = settings.icon;
+			if (icon && icon != 'caret') {
+				icon = prefix + 'ico ' + prefix + 'i-' + settings.icon;
+			}
+
+			text = self._text;
+
+			if (icon || text) {
+				openBtnHtml = (
+					'<div id="' + id + '-open" class="' + prefix + 'btn ' + prefix + 'open" tabIndex="-1" role="button">' +
+						'<button id="' + id + '-action" type="button" hidefocus="1" tabindex="-1">' +
+							(icon != 'caret' ? '<i class="' + icon + '"></i>' : '<i class="' + prefix + 'caret"></i>') +
+							(text ? (icon ? ' ' : '') + text : '') +
+						'</button>' +
+					'</div>'
+				);
+
+				self.addClass('has-open');
+			}
+
+			return (
+				'<div id="' + id + '" class="' + self.classes() + '">' +
+					'<input id="' + id + '-inp" class="' + prefix + 'textbox ' + prefix + 'placeholder" value="' +
+					value + '" hidefocus="1"' + extraAttrs + ' />' +
+					openBtnHtml +
+				'</div>'
+			);
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/ColorBox.js
+
+/**
+ * ColorBox.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This widget lets you enter colors and browse for colors by pressing the color button. It also displays
+ * a preview of the current color.
+ *
+ * @-x-less ColorBox.less
+ * @class tinymce.ui.ColorBox
+ * @extends tinymce.ui.ComboBox
+ */
+define("tinymce/ui/ColorBox", [
+	"tinymce/ui/ComboBox"
+], function(ComboBox) {
+	"use strict";
+
+	return ComboBox.extend({
+		/**
+		 * Constructs a new control instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			settings.spellcheck = false;
+
+			if (settings.onaction) {
+				settings.icon = 'none';
+			}
+
+			self._super(settings);
+
+			self.addClass('colorbox');
+			self.on('change keyup postrender', function() {
+				self.repaintColor(self.value());
+			});
+		},
+
+		repaintColor: function(value) {
+			var elm = this.getEl().getElementsByTagName('i')[0];
+
+			if (elm) {
+				try {
+					elm.style.background = value;
+				} catch (ex) {
+					// Ignore
+				}
+			}
+		},
+
+		value: function(value) {
+			var self = this;
+
+			if (typeof value != "undefined") {
+				if (self._rendered) {
+					self.repaintColor(value);
+				}
+			}
+
+			return self._super(value);
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/PanelButton.js
+
+/**
+ * PanelButton.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new panel button.
+ *
+ * @class tinymce.ui.PanelButton
+ * @extends tinymce.ui.Button
+ */
+define("tinymce/ui/PanelButton", [
+	"tinymce/ui/Button",
+	"tinymce/ui/FloatPanel"
+], function(Button, FloatPanel) {
+	"use strict";
+
+	return Button.extend({
+		/**
+		 * Shows the panel for the button.
+		 *
+		 * @method showPanel
+		 */
+		showPanel: function() {
+			var self = this, settings = self.settings;
+
+			self.active(true);
+
+			if (!self.panel) {
+				var panelSettings = settings.panel;
+
+				// Wrap panel in grid layout if type if specified
+				// This makes it possible to add forms or other containers directly in the panel option
+				if (panelSettings.type) {
+					panelSettings = {
+						layout: 'grid',
+						items: panelSettings
+					};
+				}
+
+				panelSettings.role = panelSettings.role || 'dialog';
+				panelSettings.popover = true;
+				panelSettings.autohide = true;
+				panelSettings.ariaRoot = true;
+
+				self.panel = new FloatPanel(panelSettings).on('hide', function() {
+					self.active(false);
+				}).on('cancel', function(e) {
+					e.stopPropagation();
+					self.focus();
+					self.hidePanel();
+				}).parent(self).renderTo(self.getContainerElm());
+
+				self.panel.fire('show');
+				self.panel.reflow();
+			} else {
+				self.panel.show();
+			}
+
+			self.panel.moveRel(self.getEl(), settings.popoverAlign || (self.isRtl() ? ['bc-tr', 'bc-tc'] : ['bc-tl', 'bc-tc']));
+		},
+
+		/**
+		 * Hides the panel for the button.
+		 *
+		 * @method hidePanel
+		 */
+		hidePanel: function() {
+			var self = this;
+
+			if (self.panel) {
+				self.panel.hide();
+			}
+		},
+
+		/**
+		 * Called after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this;
+
+			self.aria('haspopup', true);
+
+			self.on('click', function(e) {
+				if (e.control === self) {
+					if (self.panel && self.panel.visible()) {
+						self.hidePanel();
+					} else {
+						self.showPanel();
+						self.panel.focus(!!e.aria);
+					}
+				}
+			});
+
+			return self._super();
+		},
+
+		remove: function() {
+			if (this.panel) {
+				this.panel.remove();
+				this.panel = null;
+			}
+
+			return this._super();
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/ColorButton.js
+
+/**
+ * ColorButton.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class creates a color button control. This is a split button in which the main
+ * button has a visual representation of the currently selected color. When clicked
+ * the caret button displays a color picker, allowing the user to select a new color.
+ *
+ * @-x-less ColorButton.less
+ * @class tinymce.ui.ColorButton
+ * @extends tinymce.ui.PanelButton
+ */
+define("tinymce/ui/ColorButton", [
+	"tinymce/ui/PanelButton",
+	"tinymce/dom/DOMUtils"
+], function(PanelButton, DomUtils) {
+	"use strict";
+
+	var DOM = DomUtils.DOM;
+
+	return PanelButton.extend({
+		/**
+		 * Constructs a new ColorButton instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 */
+		init: function(settings) {
+			this._super(settings);
+			this.addClass('colorbutton');
+		},
+
+		/**
+		 * Getter/setter for the current color.
+		 *
+		 * @method color
+		 * @param {String} [color] Color to set.
+		 * @return {String|tinymce.ui.ColorButton} Current color or current instance.
+		 */
+		color: function(color) {
+			if (color) {
+				this._color = color;
+				this.getEl('preview').style.backgroundColor = color;
+				return this;
+			}
+
+			return this._color;
+		},
+
+		/**
+		 * Resets the current color.
+		 *
+		 * @method resetColor
+		 * @return {tinymce.ui.ColorButton} Current instance.
+		 */
+		resetColor: function() {
+			this._color = null;
+			this.getEl('preview').style.backgroundColor = null;
+			return this;
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, id = self._id, prefix = self.classPrefix;
+			var icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : '';
+			var image = self.settings.image ? ' style="background-image: url(\'' + self.settings.image + '\')"' : '';
+
+			return (
+				'<div id="' + id + '" class="' + self.classes() + '" role="button" tabindex="-1" aria-haspopup="true">' +
+					'<button role="presentation" hidefocus="1" type="button" tabindex="-1">' +
+						(icon ? '<i class="' + icon + '"' + image + '></i>' : '') +
+						'<span id="' + id + '-preview" class="' + prefix + 'preview"></span>' +
+						(self._text ? (icon ? ' ' : '') + (self._text) : '') +
+					'</button>' +
+					'<button type="button" class="' + prefix + 'open" hidefocus="1" tabindex="-1">' +
+						' <i class="' + prefix + 'caret"></i>' +
+					'</button>' +
+				'</div>'
+			);
+		},
+
+		/**
+		 * Called after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this, onClickHandler = self.settings.onclick;
+
+			self.on('click', function(e) {
+				if (e.aria && e.aria.key == 'down') {
+					return;
+				}
+
+				if (e.control == self && !DOM.getParent(e.target, '.' + self.classPrefix + 'open')) {
+					e.stopImmediatePropagation();
+					onClickHandler.call(self, e);
+				}
+			});
+
+			delete self.settings.onclick;
+
+			return self._super();
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/util/Color.js
+
+/**
+ * Color.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class lets you parse/serialize colors and convert rgb/hsb.
+ *
+ * @class tinymce.util.Color
+ * @example
+ * var white = new tinymce.util.Color({r: 255, g: 255, b: 255});
+ * var red = new tinymce.util.Color('#FF0000');
+ *
+ * console.log(white.toHex(), red.toHsv());
+ */
+define("tinymce/util/Color", [], function() {
+	var min = Math.min, max = Math.max, round = Math.round;
+
+	/**
+	 * Constructs a new color instance.
+	 *
+	 * @constructor
+	 * @method Color
+	 * @param {String} value Optional initial value to parse.
+	 */
+	function Color(value) {
+		var self = this, r = 0, g = 0, b = 0;
+
+		function rgb2hsv(r, g, b) {
+			var h, s, v, d, minRGB, maxRGB;
+
+			h = 0;
+			s = 0;
+			v = 0;
+			r = r / 255;
+			g = g / 255;
+			b = b / 255;
+
+			minRGB = min(r, min(g, b));
+			maxRGB = max(r, max(g, b));
+
+			if (minRGB == maxRGB) {
+				v = minRGB;
+
+				return {
+					h: 0,
+					s: 0,
+					v: v * 100
+				};
+			}
+
+			/*eslint no-nested-ternary:0 */
+			d = (r == minRGB) ? g - b : ((b == minRGB) ? r - g : b - r);
+			h = (r == minRGB) ? 3 : ((b == minRGB) ? 1 : 5);
+			h = 60 * (h - d / (maxRGB - minRGB));
+			s = (maxRGB - minRGB) / maxRGB;
+			v = maxRGB;
+
+			return {
+				h: round(h),
+				s: round(s * 100),
+				v: round(v * 100)
+			};
+		}
+
+		function hsvToRgb(hue, saturation, brightness) {
+			var side, chroma, x, match;
+
+			hue = (parseInt(hue, 10) || 0) % 360;
+			saturation = parseInt(saturation, 10) / 100;
+			brightness = parseInt(brightness, 10) / 100;
+			saturation = max(0, min(saturation, 1));
+			brightness = max(0, min(brightness, 1));
+
+			if (saturation === 0) {
+				r = g = b = round(255 * brightness);
+				return;
+			}
+
+			side = hue / 60;
+			chroma = brightness * saturation;
+			x = chroma * (1 - Math.abs(side % 2 - 1));
+			match = brightness - chroma;
+
+			switch (Math.floor(side)) {
+				case 0:
+					r = chroma;
+					g = x;
+					b = 0;
+					break;
+
+				case 1:
+					r = x;
+					g = chroma;
+					b = 0;
+					break;
+
+				case 2:
+					r = 0;
+					g = chroma;
+					b = x;
+					break;
+
+				case 3:
+					r = 0;
+					g = x;
+					b = chroma;
+					break;
+
+				case 4:
+					r = x;
+					g = 0;
+					b = chroma;
+					break;
+
+				case 5:
+					r = chroma;
+					g = 0;
+					b = x;
+					break;
+
+				default:
+					r = g = b = 0;
+			}
+
+			r = round(255 * (r + match));
+			g = round(255 * (g + match));
+			b = round(255 * (b + match));
+		}
+
+		/**
+		 * Returns the hex string of the current color. For example: #ff00ff
+		 *
+		 * @method toHex
+		 * @return {String} Hex string of current color.
+		 */
+		function toHex() {
+			function hex(val) {
+				val = parseInt(val, 10).toString(16);
+
+				return val.length > 1 ? val : '0' + val;
+			}
+
+			return '#' + hex(r) + hex(g) + hex(b);
+		}
+
+		/**
+		 * Returns the r, g, b values of the color. Each channel has a range from 0-255.
+		 *
+		 * @method toRgb
+		 * @return {Object} Object with r, g, b fields.
+		 */
+		function toRgb() {
+			return {
+				r: r,
+				g: g,
+				b: b
+			};
+		}
+
+		/**
+		 * Returns the h, s, v values of the color. Ranges: h=0-360, s=0-100, v=0-100.
+		 *
+		 * @method toHsv
+		 * @return {Object} Object with h, s, v fields.
+		 */
+		function toHsv() {
+			return rgb2hsv(r, g, b);
+		}
+
+		/**
+		 * Parses the specified value and populates the color instance.
+		 *
+		 * Supported format examples:
+		 *  * rbg(255,0,0)
+		 *  * #ff0000
+		 *  * #fff
+		 *  * {r: 255, g: 0, b: 0}
+		 *  * {h: 360, s: 100, v: 100}
+		 *
+		 * @method parse
+		 * @param {Object/String} value Color value to parse.
+		 * @return {tinymce.util.Color} Current color instance.
+		 */
+		function parse(value) {
+			var matches;
+
+			if (typeof value == 'object') {
+				if ("r" in value) {
+					r = value.r;
+					g = value.g;
+					b = value.b;
+				} else if ("v" in value) {
+					hsvToRgb(value.h, value.s, value.v);
+				}
+			} else {
+				if ((matches = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(value))) {
+					r = parseInt(matches[1], 10);
+					g = parseInt(matches[2], 10);
+					b = parseInt(matches[3], 10);
+				} else if ((matches = /#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(value))) {
+					r = parseInt(matches[1], 16);
+					g = parseInt(matches[2], 16);
+					b = parseInt(matches[3], 16);
+				} else if ((matches = /#([0-F])([0-F])([0-F])/gi.exec(value))) {
+					r = parseInt(matches[1] + matches[1], 16);
+					g = parseInt(matches[2] + matches[2], 16);
+					b = parseInt(matches[3] + matches[3], 16);
+				}
+			}
+
+			r = r < 0 ? 0 : (r > 255 ? 255 : r);
+			g = g < 0 ? 0 : (g > 255 ? 255 : g);
+			b = b < 0 ? 0 : (b > 255 ? 255 : b);
+
+			return self;
+		}
+
+		if (value) {
+			parse(value);
+		}
+
+		self.toRgb = toRgb;
+		self.toHsv = toHsv;
+		self.toHex = toHex;
+		self.parse = parse;
+	}
+
+	return Color;
+});
+
+// Included from: js/tinymce/classes/ui/ColorPicker.js
+
+/**
+ * ColorPicker.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Color picker widget lets you select colors.
+ *
+ * @-x-less ColorPicker.less
+ * @class tinymce.ui.ColorPicker
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/ColorPicker", [
+	"tinymce/ui/Widget",
+	"tinymce/ui/DragHelper",
+	"tinymce/ui/DomUtils",
+	"tinymce/util/Color"
+], function(Widget, DragHelper, DomUtils, Color) {
+	"use strict";
+
+	return Widget.extend({
+		Defaults: {
+			classes: "widget colorpicker"
+		},
+
+		/**
+		 * Constructs a new colorpicker instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {String} color Initial color value.
+		 */
+		init: function(settings) {
+			this._super(settings);
+		},
+
+		postRender: function() {
+			var self = this, color = self.color(), hsv, hueRootElm, huePointElm, svRootElm, svPointElm;
+
+			hueRootElm = self.getEl('h');
+			huePointElm = self.getEl('hp');
+			svRootElm = self.getEl('sv');
+			svPointElm = self.getEl('svp');
+
+			function getPos(elm, event) {
+				var pos = DomUtils.getPos(elm), x, y;
+
+				x = event.pageX - pos.x;
+				y = event.pageY - pos.y;
+
+				x = Math.max(0, Math.min(x / elm.clientWidth, 1));
+				y = Math.max(0, Math.min(y / elm.clientHeight, 1));
+
+				return {
+					x: x,
+					y: y
+				};
+			}
+
+			function updateColor(hsv, hueUpdate) {
+				var hue = (360 - hsv.h) / 360;
+
+				DomUtils.css(huePointElm, {
+					top: (hue * 100) + '%'
+				});
+
+				if (!hueUpdate) {
+					DomUtils.css(svPointElm, {
+						left: hsv.s + '%',
+						top: (100 - hsv.v) + '%'
+					});
+				}
+
+				svRootElm.style.background = new Color({s: 100, v: 100, h: hsv.h}).toHex();
+				self.color().parse({s: hsv.s, v: hsv.v, h: hsv.h});
+			}
+
+			function updateSaturationAndValue(e) {
+				var pos;
+
+				pos = getPos(svRootElm, e);
+				hsv.s = pos.x * 100;
+				hsv.v = (1 - pos.y) * 100;
+
+				updateColor(hsv);
+				self.fire('change');
+			}
+
+			function updateHue(e) {
+				var pos;
+
+				pos = getPos(hueRootElm, e);
+				hsv = color.toHsv();
+				hsv.h = (1 - pos.y) * 360;
+				updateColor(hsv, true);
+				self.fire('change');
+			}
+
+			self._repaint = function() {
+				hsv = color.toHsv();
+				updateColor(hsv);
+			};
+
+			self._super();
+
+			self._svdraghelper = new DragHelper(self._id + '-sv', {
+				start: updateSaturationAndValue,
+				drag: updateSaturationAndValue
+			});
+
+			self._hdraghelper = new DragHelper(self._id + '-h', {
+				start: updateHue,
+				drag: updateHue
+			});
+
+			self._repaint();
+		},
+
+		rgb: function() {
+			return this.color().toRgb();
+		},
+
+		value: function(value) {
+			var self = this;
+
+			if (arguments.length) {
+				self.color().parse(value);
+
+				if (self._rendered) {
+					self._repaint();
+				}
+			} else {
+				return self.color().toHex();
+			}
+		},
+
+		color: function() {
+			if (!this._color) {
+				this._color = new Color();
+			}
+
+			return this._color;
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, id = self._id, prefix = self.classPrefix, hueHtml;
+			var stops = '#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000';
+
+			function getOldIeFallbackHtml() {
+				var i, l, html = '', gradientPrefix, stopsList;
+
+				gradientPrefix = 'filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=';
+				stopsList = stops.split(',');
+				for (i = 0, l = stopsList.length - 1; i < l; i++) {
+					html += (
+						'<div class="' + prefix + 'colorpicker-h-chunk" style="' +
+							'height:' + (100 / l) + '%;' +
+							gradientPrefix + stopsList[i] + ',endColorstr=' + stopsList[i + 1] + ');' +
+							'-ms-' + gradientPrefix + stopsList[i] + ',endColorstr=' + stopsList[i + 1] + ')' +
+						'"></div>'
+					);
+				}
+
+				return html;
+			}
+
+			var gradientCssText = (
+				'background: -ms-linear-gradient(top,' + stops + ');' +
+				'background: linear-gradient(to bottom,' + stops + ');'
+			);
+
+			hueHtml = (
+				'<div id="' + id + '-h" class="' + prefix + 'colorpicker-h" style="' + gradientCssText + '">' +
+					getOldIeFallbackHtml() +
+					'<div id="' + id + '-hp" class="' + prefix + 'colorpicker-h-marker"></div>' +
+				'</div>'
+			);
+
+			return (
+				'<div id="' + id + '" class="' + self.classes() + '">' +
+					'<div id="' + id + '-sv" class="' + prefix + 'colorpicker-sv">' +
+						'<div class="' + prefix + 'colorpicker-overlay1">' +
+							'<div class="' + prefix + 'colorpicker-overlay2">' +
+								'<div id="' + id + '-svp" class="' + prefix + 'colorpicker-selector1">' +
+									'<div class="' + prefix + 'colorpicker-selector2"></div>' +
+								'</div>' +
+							'</div>' +
+						'</div>' +
+					'</div>' +
+					hueHtml +
+				'</div>'
+			);
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/Path.js
+
+/**
+ * Path.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new path control.
+ *
+ * @-x-less Path.less
+ * @class tinymce.ui.Path
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/Path", [
+	"tinymce/ui/Widget"
+], function(Widget) {
+	"use strict";
+
+	return Widget.extend({
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {String} delimiter Delimiter to display between items in path.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			if (!settings.delimiter) {
+				settings.delimiter = '\u00BB';
+			}
+
+			self._super(settings);
+			self.addClass('path');
+			self.canFocus = true;
+
+			self.on('click', function(e) {
+				var index, target = e.target;
+
+				if ((index = target.getAttribute('data-index'))) {
+					self.fire('select', {value: self.data()[index], index: index});
+				}
+			});
+		},
+
+		/**
+		 * Focuses the current control.
+		 *
+		 * @method focus
+		 * @return {tinymce.ui.Control} Current control instance.
+		 */
+		focus: function() {
+			var self = this;
+
+			self.getEl().firstChild.focus();
+
+			return self;
+		},
+
+		/**
+		 * Sets/gets the data to be used for the path.
+		 *
+		 * @method data
+		 * @param {Array} data Array with items name is rendered to path.
+		 */
+		data: function(data) {
+			var self = this;
+
+			if (typeof data !== "undefined") {
+				self._data = data;
+				self.update();
+
+				return self;
+			}
+
+			return self._data;
+		},
+
+		/**
+		 * Updated the path.
+		 *
+		 * @private
+		 */
+		update: function() {
+			this.innerHtml(this._getPathHtml());
+		},
+
+		/**
+		 * Called after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this;
+
+			self._super();
+
+			self.data(self.settings.data);
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this;
+
+			return (
+				'<div id="' + self._id + '" class="' + self.classes() + '">' +
+					self._getPathHtml() +
+				'</div>'
+			);
+		},
+
+		_getPathHtml: function() {
+			var self = this, parts = self._data || [], i, l, html = '', prefix = self.classPrefix;
+
+			for (i = 0, l = parts.length; i < l; i++) {
+				html += (
+					(i > 0 ? '<div class="' + prefix + 'divider" aria-hidden="true"> ' + self.settings.delimiter + ' </div>' : '') +
+					'<div role="button" class="' + prefix + 'path-item' + (i == l - 1 ? ' ' + prefix + 'last' : '') + '" data-index="' +
+					i + '" tabindex="-1" id="' + self._id + '-' + i + '" aria-level="' + i + '">' + parts[i].name + '</div>'
+				);
+			}
+
+			if (!html) {
+				html = '<div class="' + prefix + 'path-item">\u00a0</div>';
+			}
+
+			return html;
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/ElementPath.js
+
+/**
+ * ElementPath.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This control creates an path for the current selections parent elements in TinyMCE.
+ *
+ * @class tinymce.ui.ElementPath
+ * @extends tinymce.ui.Path
+ */
+define("tinymce/ui/ElementPath", [
+	"tinymce/ui/Path",
+	"tinymce/EditorManager"
+], function(Path, EditorManager) {
+	return Path.extend({
+		/**
+		 * Post render method. Called after the control has been rendered to the target.
+		 *
+		 * @method postRender
+		 * @return {tinymce.ui.ElementPath} Current combobox instance.
+		 */
+		postRender: function() {
+			var self = this, editor = EditorManager.activeEditor;
+
+			function isHidden(elm) {
+				if (elm.nodeType === 1) {
+					if (elm.nodeName == "BR" || !!elm.getAttribute('data-mce-bogus')) {
+						return true;
+					}
+
+					if (elm.getAttribute('data-mce-type') === 'bookmark') {
+						return true;
+					}
+				}
+
+				return false;
+			}
+
+			if (editor.settings.elementpath !== false) {
+				self.on('select', function(e) {
+					editor.focus();
+					editor.selection.select(this.data()[e.index].element);
+					editor.nodeChanged();
+				});
+
+				editor.on('nodeChange', function(e) {
+					var outParents = [], parents = e.parents, i = parents.length;
+
+					while (i--) {
+						if (parents[i].nodeType == 1 && !isHidden(parents[i])) {
+							var args = editor.fire('ResolveName', {
+								name: parents[i].nodeName.toLowerCase(),
+								target: parents[i]
+							});
+
+							if (!args.isDefaultPrevented()) {
+								outParents.push({name: args.name, element: parents[i]});
+							}
+
+							if (args.isPropagationStopped()) {
+								break;
+							}
+						}
+					}
+
+					self.data(outParents);
+				});
+			}
+
+			return self._super();
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/FormItem.js
+
+/**
+ * FormItem.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is a container created by the form element with
+ * a label and control item.
+ *
+ * @class tinymce.ui.FormItem
+ * @extends tinymce.ui.Container
+ * @setting {String} label Label to display for the form item.
+ */
+define("tinymce/ui/FormItem", [
+	"tinymce/ui/Container"
+], function(Container) {
+	"use strict";
+
+	return Container.extend({
+		Defaults: {
+			layout: 'flex',
+			align: 'center',
+			defaults: {
+				flex: 1
+			}
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, layout = self._layout, prefix = self.classPrefix;
+
+			self.addClass('formitem');
+			layout.preRender(self);
+
+			return (
+				'<div id="' + self._id + '" class="' + self.classes() + '" hidefocus="1" tabindex="-1">' +
+					(self.settings.title ? ('<div id="' + self._id + '-title" class="' + prefix + 'title">' +
+						self.settings.title + '</div>') : '') +
+					'<div id="' + self._id + '-body" class="' + self.classes('body') + '">' +
+						(self.settings.html || '') + layout.renderHtml(self) +
+					'</div>' +
+				'</div>'
+			);
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/Form.js
+
+/**
+ * Form.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class creates a form container. A form container has the ability
+ * to automatically wrap items in tinymce.ui.FormItem instances.
+ *
+ * Each FormItem instance is a container for the label and the item.
+ *
+ * @example
+ * tinymce.ui.Factory.create({
+ *     type: 'form',
+ *     items: [
+ *         {type: 'textbox', label: 'My text box'}
+ *     ]
+ * }).renderTo(document.body);
+ *
+ * @class tinymce.ui.Form
+ * @extends tinymce.ui.Container
+ */
+define("tinymce/ui/Form", [
+	"tinymce/ui/Container",
+	"tinymce/ui/FormItem",
+	"tinymce/util/Tools"
+], function(Container, FormItem, Tools) {
+	"use strict";
+
+	return Container.extend({
+		Defaults: {
+			containerCls: 'form',
+			layout: 'flex',
+			direction: 'column',
+			align: 'stretch',
+			flex: 1,
+			padding: 20,
+			labelGap: 30,
+			spacing: 10,
+			callbacks: {
+				submit: function() {
+					this.submit();
+				}
+			}
+		},
+
+		/**
+		 * This method gets invoked before the control is rendered.
+		 *
+		 * @method preRender
+		 */
+		preRender: function() {
+			var self = this, items = self.items();
+
+			if (!self.settings.formItemDefaults) {
+				self.settings.formItemDefaults = {
+					layout: 'flex',
+					autoResize: "overflow",
+					defaults: {flex: 1}
+				};
+			}
+
+			// Wrap any labeled items in FormItems
+			items.each(function(ctrl) {
+				var formItem, label = ctrl.settings.label;
+
+				if (label) {
+					formItem = new FormItem(Tools.extend({
+						items: {
+							type: 'label',
+							id: ctrl._id + '-l',
+							text: label,
+							flex: 0,
+							forId: ctrl._id,
+							disabled: ctrl.disabled()
+						}
+					}, self.settings.formItemDefaults));
+
+					formItem.type = 'formitem';
+					ctrl.aria('labelledby', ctrl._id + '-l');
+
+					if (typeof ctrl.settings.flex == "undefined") {
+						ctrl.settings.flex = 1;
+					}
+
+					self.replace(ctrl, formItem);
+					formItem.add(ctrl);
+				}
+			});
+		},
+
+		/**
+		 * Recalcs label widths.
+		 *
+		 * @private
+		 */
+		recalcLabels: function() {
+			var self = this, maxLabelWidth = 0, labels = [], i, labelGap, items;
+
+			if (self.settings.labelGapCalc === false) {
+				return;
+			}
+
+			if (self.settings.labelGapCalc == "children") {
+				items = self.find('formitem');
+			} else {
+				items = self.items();
+			}
+
+			items.filter('formitem').each(function(item) {
+				var labelCtrl = item.items()[0], labelWidth = labelCtrl.getEl().clientWidth;
+
+				maxLabelWidth = labelWidth > maxLabelWidth ? labelWidth : maxLabelWidth;
+				labels.push(labelCtrl);
+			});
+
+			labelGap = self.settings.labelGap || 0;
+
+			i = labels.length;
+			while (i--) {
+				labels[i].settings.minWidth = maxLabelWidth + labelGap;
+			}
+		},
+
+		/**
+		 * Getter/setter for the visibility state.
+		 *
+		 * @method visible
+		 * @param {Boolean} [state] True/false state to show/hide.
+		 * @return {tinymce.ui.Form|Boolean} True/false state or current control.
+		 */
+		visible: function(state) {
+			var val = this._super(state);
+
+			if (state === true && this._rendered) {
+				this.recalcLabels();
+			}
+
+			return val;
+		},
+
+		/**
+		 * Fires a submit event with the serialized form.
+		 *
+		 * @method submit
+		 * @return {Object} Event arguments object.
+		 */
+		submit: function() {
+			return this.fire('submit', {data: this.toJSON()});
+		},
+
+		/**
+		 * Post render method. Called after the control has been rendered to the target.
+		 *
+		 * @method postRender
+		 * @return {tinymce.ui.ComboBox} Current combobox instance.
+		 */
+		postRender: function() {
+			var self = this;
+
+			self._super();
+			self.recalcLabels();
+			self.fromJSON(self.settings.data);
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/FieldSet.js
+
+/**
+ * FieldSet.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class creates fieldset containers.
+ *
+ * @-x-less FieldSet.less
+ * @class tinymce.ui.FieldSet
+ * @extends tinymce.ui.Form
+ */
+define("tinymce/ui/FieldSet", [
+	"tinymce/ui/Form"
+], function(Form) {
+	"use strict";
+
+	return Form.extend({
+		Defaults: {
+			containerCls: 'fieldset',
+			layout: 'flex',
+			direction: 'column',
+			align: 'stretch',
+			flex: 1,
+			padding: "25 15 5 15",
+			labelGap: 30,
+			spacing: 10,
+			border: 1
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, layout = self._layout, prefix = self.classPrefix;
+
+			self.preRender();
+			layout.preRender(self);
+
+			return (
+				'<fieldset id="' + self._id + '" class="' + self.classes() + '" hidefocus="1" tabindex="-1">' +
+					(self.settings.title ? ('<legend id="' + self._id + '-title" class="' + prefix + 'fieldset-title">' +
+						self.settings.title + '</legend>') : '') +
+					'<div id="' + self._id + '-body" class="' + self.classes('body') + '">' +
+						(self.settings.html || '') + layout.renderHtml(self) +
+					'</div>' +
+				'</fieldset>'
+			);
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/FilePicker.js
+
+/**
+ * FilePicker.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+/**
+ * This class creates a file picker control.
+ *
+ * @class tinymce.ui.FilePicker
+ * @extends tinymce.ui.ComboBox
+ */
+define("tinymce/ui/FilePicker", [
+	"tinymce/ui/ComboBox",
+	"tinymce/util/Tools"
+], function(ComboBox, Tools) {
+	"use strict";
+
+	return ComboBox.extend({
+		/**
+		 * Constructs a new control instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 */
+		init: function(settings) {
+			var self = this, editor = tinymce.activeEditor, editorSettings = editor.settings;
+			var actionCallback, fileBrowserCallback, fileBrowserCallbackTypes;
+
+			settings.spellcheck = false;
+
+			fileBrowserCallbackTypes = editorSettings.file_picker_types || editorSettings.file_browser_callback_types;
+			if (fileBrowserCallbackTypes) {
+				fileBrowserCallbackTypes = Tools.makeMap(fileBrowserCallbackTypes, /[, ]/);
+			}
+
+			if (!fileBrowserCallbackTypes || fileBrowserCallbackTypes[settings.filetype]) {
+				fileBrowserCallback = editorSettings.file_picker_callback;
+				if (fileBrowserCallback && (!fileBrowserCallbackTypes || fileBrowserCallbackTypes[settings.filetype])) {
+					actionCallback = function() {
+						var meta = self.fire('beforecall').meta;
+
+						meta = Tools.extend({filetype: settings.filetype}, meta);
+
+						// file_picker_callback(callback, currentValue, metaData)
+						fileBrowserCallback.call(
+							editor,
+							function(value, meta) {
+								self.value(value).fire('change', {meta: meta});
+							},
+							self.value(),
+							meta
+						);
+					};
+				} else {
+					// Legacy callback: file_picker_callback(id, currentValue, filetype, window)
+					fileBrowserCallback = editorSettings.file_browser_callback;
+					if (fileBrowserCallback && (!fileBrowserCallbackTypes || fileBrowserCallbackTypes[settings.filetype])) {
+						actionCallback = function() {
+							fileBrowserCallback(
+								self.getEl('inp').id,
+								self.value(),
+								settings.filetype,
+								window
+							);
+						};
+					}
+				}
+			}
+
+			if (actionCallback) {
+				settings.icon = 'browse';
+				settings.onaction = actionCallback;
+			}
+
+			self._super(settings);
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/FitLayout.js
+
+/**
+ * FitLayout.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This layout manager will resize the control to be the size of it's parent container.
+ * In other words width: 100% and height: 100%.
+ *
+ * @-x-less FitLayout.less
+ * @class tinymce.ui.FitLayout
+ * @extends tinymce.ui.AbsoluteLayout
+ */
+define("tinymce/ui/FitLayout", [
+	"tinymce/ui/AbsoluteLayout"
+], function(AbsoluteLayout) {
+	"use strict";
+
+	return AbsoluteLayout.extend({
+		/**
+		 * Recalculates the positions of the controls in the specified container.
+		 *
+		 * @method recalc
+		 * @param {tinymce.ui.Container} container Container instance to recalc.
+		 */
+		recalc: function(container) {
+			var contLayoutRect = container.layoutRect(), paddingBox = container.paddingBox();
+
+			container.items().filter(':visible').each(function(ctrl) {
+				ctrl.layoutRect({
+					x: paddingBox.left,
+					y: paddingBox.top,
+					w: contLayoutRect.innerW - paddingBox.right - paddingBox.left,
+					h: contLayoutRect.innerH - paddingBox.top - paddingBox.bottom
+				});
+
+				if (ctrl.recalc) {
+					ctrl.recalc();
+				}
+			});
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/FlexLayout.js
+
+/**
+ * FlexLayout.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This layout manager works similar to the CSS flex box.
+ *
+ * @setting {String} direction row|row-reverse|column|column-reverse
+ * @setting {Number} flex A positive-number to flex by.
+ * @setting {String} align start|end|center|stretch
+ * @setting {String} pack start|end|justify
+ *
+ * @class tinymce.ui.FlexLayout
+ * @extends tinymce.ui.AbsoluteLayout
+ */
+define("tinymce/ui/FlexLayout", [
+	"tinymce/ui/AbsoluteLayout"
+], function(AbsoluteLayout) {
+	"use strict";
+
+	return AbsoluteLayout.extend({
+		/**
+		 * Recalculates the positions of the controls in the specified container.
+		 *
+		 * @method recalc
+		 * @param {tinymce.ui.Container} container Container instance to recalc.
+		 */
+		recalc: function(container) {
+			// A ton of variables, needs to be in the same scope for performance
+			var i, l, items, contLayoutRect, contPaddingBox, contSettings, align, pack, spacing, totalFlex, availableSpace, direction;
+			var ctrl, ctrlLayoutRect, ctrlSettings, flex, maxSizeItems = [], size, maxSize, ratio, rect, pos, maxAlignEndPos;
+			var sizeName, minSizeName, posName, maxSizeName, beforeName, innerSizeName, deltaSizeName, contentSizeName;
+			var alignAxisName, alignInnerSizeName, alignSizeName, alignMinSizeName, alignBeforeName, alignAfterName;
+			var alignDeltaSizeName, alignContentSizeName;
+			var max = Math.max, min = Math.min;
+
+			// Get container items, properties and settings
+			items = container.items().filter(':visible');
+			contLayoutRect = container.layoutRect();
+			contPaddingBox = container._paddingBox;
+			contSettings = container.settings;
+			direction = container.isRtl() ? (contSettings.direction || 'row-reversed') : contSettings.direction;
+			align = contSettings.align;
+			pack = container.isRtl() ? (contSettings.pack || 'end') : contSettings.pack;
+			spacing = contSettings.spacing || 0;
+
+			if (direction == "row-reversed" || direction == "column-reverse") {
+				items = items.set(items.toArray().reverse());
+				direction = direction.split('-')[0];
+			}
+
+			// Setup axis variable name for row/column direction since the calculations is the same
+			if (direction == "column") {
+				posName = "y";
+				sizeName = "h";
+				minSizeName = "minH";
+				maxSizeName = "maxH";
+				innerSizeName = "innerH";
+				beforeName = 'top';
+				deltaSizeName = "deltaH";
+				contentSizeName = "contentH";
+
+				alignBeforeName = "left";
+				alignSizeName = "w";
+				alignAxisName = "x";
+				alignInnerSizeName = "innerW";
+				alignMinSizeName = "minW";
+				alignAfterName = "right";
+				alignDeltaSizeName = "deltaW";
+				alignContentSizeName = "contentW";
+			} else {
+				posName = "x";
+				sizeName = "w";
+				minSizeName = "minW";
+				maxSizeName = "maxW";
+				innerSizeName = "innerW";
+				beforeName = 'left';
+				deltaSizeName = "deltaW";
+				contentSizeName = "contentW";
+
+				alignBeforeName = "top";
+				alignSizeName = "h";
+				alignAxisName = "y";
+				alignInnerSizeName = "innerH";
+				alignMinSizeName = "minH";
+				alignAfterName = "bottom";
+				alignDeltaSizeName = "deltaH";
+				alignContentSizeName = "contentH";
+			}
+
+			// Figure out total flex, availableSpace and collect any max size elements
+			availableSpace = contLayoutRect[innerSizeName] - contPaddingBox[beforeName] - contPaddingBox[beforeName];
+			maxAlignEndPos = totalFlex = 0;
+			for (i = 0, l = items.length; i < l; i++) {
+				ctrl = items[i];
+				ctrlLayoutRect = ctrl.layoutRect();
+				ctrlSettings = ctrl.settings;
+				flex = ctrlSettings.flex;
+				availableSpace -= (i < l - 1 ? spacing : 0);
+
+				if (flex > 0) {
+					totalFlex += flex;
+
+					// Flexed item has a max size then we need to check if we will hit that size
+					if (ctrlLayoutRect[maxSizeName]) {
+						maxSizeItems.push(ctrl);
+					}
+
+					ctrlLayoutRect.flex = flex;
+				}
+
+				availableSpace -= ctrlLayoutRect[minSizeName];
+
+				// Calculate the align end position to be used to check for overflow/underflow
+				size = contPaddingBox[alignBeforeName] + ctrlLayoutRect[alignMinSizeName] + contPaddingBox[alignAfterName];
+				if (size > maxAlignEndPos) {
+					maxAlignEndPos = size;
+				}
+			}
+
+			// Calculate minW/minH
+			rect = {};
+			if (availableSpace < 0) {
+				rect[minSizeName] = contLayoutRect[minSizeName] - availableSpace + contLayoutRect[deltaSizeName];
+			} else {
+				rect[minSizeName] = contLayoutRect[innerSizeName] - availableSpace + contLayoutRect[deltaSizeName];
+			}
+
+			rect[alignMinSizeName] = maxAlignEndPos + contLayoutRect[alignDeltaSizeName];
+
+			rect[contentSizeName] = contLayoutRect[innerSizeName] - availableSpace;
+			rect[alignContentSizeName] = maxAlignEndPos;
+			rect.minW = min(rect.minW, contLayoutRect.maxW);
+			rect.minH = min(rect.minH, contLayoutRect.maxH);
+			rect.minW = max(rect.minW, contLayoutRect.startMinWidth);
+			rect.minH = max(rect.minH, contLayoutRect.startMinHeight);
+
+			// Resize container container if minSize was changed
+			if (contLayoutRect.autoResize && (rect.minW != contLayoutRect.minW || rect.minH != contLayoutRect.minH)) {
+				rect.w = rect.minW;
+				rect.h = rect.minH;
+
+				container.layoutRect(rect);
+				this.recalc(container);
+
+				// Forced recalc for example if items are hidden/shown
+				if (container._lastRect === null) {
+					var parentCtrl = container.parent();
+					if (parentCtrl) {
+						parentCtrl._lastRect = null;
+						parentCtrl.recalc();
+					}
+				}
+
+				return;
+			}
+
+			// Handle max size elements, check if they will become to wide with current options
+			ratio = availableSpace / totalFlex;
+			for (i = 0, l = maxSizeItems.length; i < l; i++) {
+				ctrl = maxSizeItems[i];
+				ctrlLayoutRect = ctrl.layoutRect();
+				maxSize = ctrlLayoutRect[maxSizeName];
+				size = ctrlLayoutRect[minSizeName] + ctrlLayoutRect.flex * ratio;
+
+				if (size > maxSize) {
+					availableSpace -= (ctrlLayoutRect[maxSizeName] - ctrlLayoutRect[minSizeName]);
+					totalFlex -= ctrlLayoutRect.flex;
+					ctrlLayoutRect.flex = 0;
+					ctrlLayoutRect.maxFlexSize = maxSize;
+				} else {
+					ctrlLayoutRect.maxFlexSize = 0;
+				}
+			}
+
+			// Setup new ratio, target layout rect, start position
+			ratio = availableSpace / totalFlex;
+			pos = contPaddingBox[beforeName];
+			rect = {};
+
+			// Handle pack setting moves the start position to end, center
+			if (totalFlex === 0) {
+				if (pack == "end") {
+					pos = availableSpace + contPaddingBox[beforeName];
+				} else if (pack == "center") {
+					pos = Math.round(
+						(contLayoutRect[innerSizeName] / 2) - ((contLayoutRect[innerSizeName] - availableSpace) / 2)
+					) + contPaddingBox[beforeName];
+
+					if (pos < 0) {
+						pos = contPaddingBox[beforeName];
+					}
+				} else if (pack == "justify") {
+					pos = contPaddingBox[beforeName];
+					spacing = Math.floor(availableSpace / (items.length - 1));
+				}
+			}
+
+			// Default aligning (start) the other ones needs to be calculated while doing the layout
+			rect[alignAxisName] = contPaddingBox[alignBeforeName];
+
+			// Start laying out controls
+			for (i = 0, l = items.length; i < l; i++) {
+				ctrl = items[i];
+				ctrlLayoutRect = ctrl.layoutRect();
+				size = ctrlLayoutRect.maxFlexSize || ctrlLayoutRect[minSizeName];
+
+				// Align the control on the other axis
+				if (align === "center") {
+					rect[alignAxisName] = Math.round((contLayoutRect[alignInnerSizeName] / 2) - (ctrlLayoutRect[alignSizeName] / 2));
+				} else if (align === "stretch") {
+					rect[alignSizeName] = max(
+						ctrlLayoutRect[alignMinSizeName] || 0,
+						contLayoutRect[alignInnerSizeName] - contPaddingBox[alignBeforeName] - contPaddingBox[alignAfterName]
+					);
+					rect[alignAxisName] = contPaddingBox[alignBeforeName];
+				} else if (align === "end") {
+					rect[alignAxisName] = contLayoutRect[alignInnerSizeName] - ctrlLayoutRect[alignSizeName] - contPaddingBox.top;
+				}
+
+				// Calculate new size based on flex
+				if (ctrlLayoutRect.flex > 0) {
+					size += ctrlLayoutRect.flex * ratio;
+				}
+
+				rect[sizeName] = size;
+				rect[posName] = pos;
+				ctrl.layoutRect(rect);
+
+				// Recalculate containers
+				if (ctrl.recalc) {
+					ctrl.recalc();
+				}
+
+				// Move x/y position
+				pos += size + spacing;
+			}
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/FlowLayout.js
+
+/**
+ * FlowLayout.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This layout manager will place the controls by using the browsers native layout.
+ *
+ * @-x-less FlowLayout.less
+ * @class tinymce.ui.FlowLayout
+ * @extends tinymce.ui.Layout
+ */
+define("tinymce/ui/FlowLayout", [
+	"tinymce/ui/Layout"
+], function(Layout) {
+	return Layout.extend({
+		Defaults: {
+			containerClass: 'flow-layout',
+			controlClass: 'flow-layout-item',
+			endClass: 'break'
+		},
+
+		/**
+		 * Recalculates the positions of the controls in the specified container.
+		 *
+		 * @method recalc
+		 * @param {tinymce.ui.Container} container Container instance to recalc.
+		 */
+		recalc: function(container) {
+			container.items().filter(':visible').each(function(ctrl) {
+				if (ctrl.recalc) {
+					ctrl.recalc();
+				}
+			});
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/FormatControls.js
+
+/**
+ * FormatControls.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Internal class containing all TinyMCE specific control types such as
+ * format listboxes, fontlist boxes, toolbar buttons etc.
+ *
+ * @class tinymce.ui.FormatControls
+ */
+define("tinymce/ui/FormatControls", [
+	"tinymce/ui/Control",
+	"tinymce/ui/Widget",
+	"tinymce/ui/FloatPanel",
+	"tinymce/util/Tools",
+	"tinymce/EditorManager",
+	"tinymce/Env"
+], function(Control, Widget, FloatPanel, Tools, EditorManager, Env) {
+	var each = Tools.each;
+
+	EditorManager.on('AddEditor', function(e) {
+		if (e.editor.rtl) {
+			Control.rtl = true;
+		}
+
+		registerControls(e.editor);
+	});
+
+	Control.translate = function(text) {
+		return EditorManager.translate(text);
+	};
+
+	Widget.tooltips = !Env.iOS;
+
+	function registerControls(editor) {
+		var formatMenu;
+
+		function createListBoxChangeHandler(items, formatName) {
+			return function() {
+				var self = this;
+
+				editor.on('nodeChange', function(e) {
+					var formatter = editor.formatter;
+					var value = null;
+
+					each(e.parents, function(node) {
+						each(items, function(item) {
+							if (formatName) {
+								if (formatter.matchNode(node, formatName, {value: item.value})) {
+									value = item.value;
+								}
+							} else {
+								if (formatter.matchNode(node, item.value)) {
+									value = item.value;
+								}
+							}
+
+							if (value) {
+								return false;
+							}
+						});
+
+						if (value) {
+							return false;
+						}
+					});
+
+					self.value(value);
+				});
+			};
+		}
+
+		function createFormats(formats) {
+			formats = formats.replace(/;$/, '').split(';');
+
+			var i = formats.length;
+			while (i--) {
+				formats[i] = formats[i].split('=');
+			}
+
+			return formats;
+		}
+
+		function createFormatMenu() {
+			var count = 0, newFormats = [];
+
+			var defaultStyleFormats = [
+				{title: 'Headings', items: [
+					{title: 'Heading 1', format: 'h1'},
+					{title: 'Heading 2', format: 'h2'},
+					{title: 'Heading 3', format: 'h3'},
+					{title: 'Heading 4', format: 'h4'},
+					{title: 'Heading 5', format: 'h5'},
+					{title: 'Heading 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'}
+				]}
+			];
+
+			function createMenu(formats) {
+				var menu = [];
+
+				if (!formats) {
+					return;
+				}
+
+				each(formats, function(format) {
+					var menuItem = {
+						text: format.title,
+						icon: format.icon
+					};
+
+					if (format.items) {
+						menuItem.menu = createMenu(format.items);
+					} else {
+						var formatName = format.format || "custom" + count++;
+
+						if (!format.format) {
+							format.name = formatName;
+							newFormats.push(format);
+						}
+
+						menuItem.format = formatName;
+						menuItem.cmd = format.cmd;
+					}
+
+					menu.push(menuItem);
+				});
+
+				return menu;
+			}
+
+			function createStylesMenu() {
+				var menu;
+
+				if (editor.settings.style_formats_merge) {
+					if (editor.settings.style_formats) {
+						menu = createMenu(defaultStyleFormats.concat(editor.settings.style_formats));
+					} else {
+						menu = createMenu(defaultStyleFormats);
+					}
+				} else {
+					menu = createMenu(editor.settings.style_formats || defaultStyleFormats);
+				}
+
+				return menu;
+			}
+
+			editor.on('init', function() {
+				each(newFormats, function(format) {
+					editor.formatter.register(format.name, format);
+				});
+			});
+
+			return {
+				type: 'menu',
+				items: createStylesMenu(),
+				onPostRender: function(e) {
+					editor.fire('renderFormatsMenu', {control: e.control});
+				},
+				itemDefaults: {
+					preview: true,
+
+					textStyle: function() {
+						if (this.settings.format) {
+							return editor.formatter.getCssText(this.settings.format);
+						}
+					},
+
+					onPostRender: function() {
+						var self = this;
+
+						self.parent().on('show', function() {
+							var formatName, command;
+
+							formatName = self.settings.format;
+							if (formatName) {
+								self.disabled(!editor.formatter.canApply(formatName));
+								self.active(editor.formatter.match(formatName));
+							}
+
+							command = self.settings.cmd;
+							if (command) {
+								self.active(editor.queryCommandState(command));
+							}
+						});
+					},
+
+					onclick: function() {
+						if (this.settings.format) {
+							toggleFormat(this.settings.format);
+						}
+
+						if (this.settings.cmd) {
+							editor.execCommand(this.settings.cmd);
+						}
+					}
+				}
+			};
+		}
+
+		formatMenu = createFormatMenu();
+
+		// Simple format controls <control/format>:<UI text>
+		each({
+			bold: 'Bold',
+			italic: 'Italic',
+			underline: 'Underline',
+			strikethrough: 'Strikethrough',
+			subscript: 'Subscript',
+			superscript: 'Superscript'
+		}, function(text, name) {
+			editor.addButton(name, {
+				tooltip: text,
+				onPostRender: function() {
+					var self = this;
+
+					// TODO: Fix this
+					if (editor.formatter) {
+						editor.formatter.formatChanged(name, function(state) {
+							self.active(state);
+						});
+					} else {
+						editor.on('init', function() {
+							editor.formatter.formatChanged(name, function(state) {
+								self.active(state);
+							});
+						});
+					}
+				},
+				onclick: function() {
+					toggleFormat(name);
+				}
+			});
+		});
+
+		// Simple command controls <control>:[<UI text>,<Command>]
+		each({
+			outdent: ['Decrease indent', 'Outdent'],
+			indent: ['Increase indent', 'Indent'],
+			cut: ['Cut', 'Cut'],
+			copy: ['Copy', 'Copy'],
+			paste: ['Paste', 'Paste'],
+			help: ['Help', 'mceHelp'],
+			selectall: ['Select all', 'SelectAll'],
+			removeformat: ['Clear formatting', 'RemoveFormat'],
+			visualaid: ['Visual aids', 'mceToggleVisualAid'],
+			newdocument: ['New document', 'mceNewDocument']
+		}, function(item, name) {
+			editor.addButton(name, {
+				tooltip: item[0],
+				cmd: item[1]
+			});
+		});
+
+		// Simple command controls with format state
+		each({
+			blockquote: ['Blockquote', 'mceBlockQuote'],
+			numlist: ['Numbered list', 'InsertOrderedList'],
+			bullist: ['Bullet list', 'InsertUnorderedList'],
+			subscript: ['Subscript', 'Subscript'],
+			superscript: ['Superscript', 'Superscript'],
+			alignleft: ['Align left', 'JustifyLeft'],
+			aligncenter: ['Align center', 'JustifyCenter'],
+			alignright: ['Align right', 'JustifyRight'],
+			alignjustify: ['Justify', 'JustifyFull']
+		}, function(item, name) {
+			editor.addButton(name, {
+				tooltip: item[0],
+				cmd: item[1],
+				onPostRender: function() {
+					var self = this;
+
+					// TODO: Fix this
+					if (editor.formatter) {
+						editor.formatter.formatChanged(name, function(state) {
+							self.active(state);
+						});
+					} else {
+						editor.on('init', function() {
+							editor.formatter.formatChanged(name, function(state) {
+								self.active(state);
+							});
+						});
+					}
+				}
+			});
+		});
+
+		function toggleUndoRedoState(type) {
+			return function() {
+				var self = this;
+
+				type = type == 'redo' ? 'hasRedo' : 'hasUndo';
+
+				function checkState() {
+					return editor.undoManager ? editor.undoManager[type]() : false;
+				}
+
+				self.disabled(!checkState());
+				editor.on('Undo Redo AddUndo TypingUndo ClearUndos', function() {
+					self.disabled(!checkState());
+				});
+			};
+		}
+
+		function toggleVisualAidState() {
+			var self = this;
+
+			editor.on('VisualAid', function(e) {
+				self.active(e.hasVisual);
+			});
+
+			self.active(editor.hasVisual);
+		}
+
+		editor.addButton('undo', {
+			tooltip: 'Undo',
+			onPostRender: toggleUndoRedoState('undo'),
+			cmd: 'undo'
+		});
+
+		editor.addButton('redo', {
+			tooltip: 'Redo',
+			onPostRender: toggleUndoRedoState('redo'),
+			cmd: 'redo'
+		});
+
+		editor.addMenuItem('newdocument', {
+			text: 'New document',
+			icon: 'newdocument',
+			cmd: 'mceNewDocument'
+		});
+
+		editor.addMenuItem('undo', {
+			text: 'Undo',
+			icon: 'undo',
+			shortcut: 'Meta+Z',
+			onPostRender: toggleUndoRedoState('undo'),
+			cmd: 'undo'
+		});
+
+		editor.addMenuItem('redo', {
+			text: 'Redo',
+			icon: 'redo',
+			shortcut: 'Meta+Y',
+			onPostRender: toggleUndoRedoState('redo'),
+			cmd: 'redo'
+		});
+
+		editor.addMenuItem('visualaid', {
+			text: 'Visual aids',
+			selectable: true,
+			onPostRender: toggleVisualAidState,
+			cmd: 'mceToggleVisualAid'
+		});
+
+		each({
+			cut: ['Cut', 'Cut', 'Meta+X'],
+			copy: ['Copy', 'Copy', 'Meta+C'],
+			paste: ['Paste', 'Paste', 'Meta+V'],
+			selectall: ['Select all', 'SelectAll', 'Meta+A'],
+			bold: ['Bold', 'Bold', 'Meta+B'],
+			italic: ['Italic', 'Italic', 'Meta+I'],
+			underline: ['Underline', 'Underline'],
+			strikethrough: ['Strikethrough', 'Strikethrough'],
+			subscript: ['Subscript', 'Subscript'],
+			superscript: ['Superscript', 'Superscript'],
+			removeformat: ['Clear formatting', 'RemoveFormat']
+		}, function(item, name) {
+			editor.addMenuItem(name, {
+				text: item[0],
+				icon: name,
+				shortcut: item[2],
+				cmd: item[1]
+			});
+		});
+
+		editor.on('mousedown', function() {
+			FloatPanel.hideAll();
+		});
+
+		function toggleFormat(fmt) {
+			if (fmt.control) {
+				fmt = fmt.control.value();
+			}
+
+			if (fmt) {
+				editor.execCommand('mceToggleFormat', false, fmt);
+			}
+		}
+
+		editor.addButton('styleselect', {
+			type: 'menubutton',
+			text: 'Formats',
+			menu: formatMenu
+		});
+
+		editor.addButton('formatselect', function() {
+			var items = [], blocks = createFormats(editor.settings.block_formats ||
+				'Paragraph=p;' +
+				'Heading 1=h1;' +
+				'Heading 2=h2;' +
+				'Heading 3=h3;' +
+				'Heading 4=h4;' +
+				'Heading 5=h5;' +
+				'Heading 6=h6;' +
+				'Preformatted=pre'
+			);
+
+			each(blocks, function(block) {
+				items.push({
+					text: block[0],
+					value: block[1],
+					textStyle: function() {
+						return editor.formatter.getCssText(block[1]);
+					}
+				});
+			});
+
+			return {
+				type: 'listbox',
+				text: blocks[0][0],
+				values: items,
+				fixedWidth: true,
+				onselect: toggleFormat,
+				onPostRender: createListBoxChangeHandler(items)
+			};
+		});
+
+		editor.addButton('fontselect', function() {
+			var defaultFontsFormats =
+				'Andale Mono=andale mono,monospace;' +
+				'Arial=arial,helvetica,sans-serif;' +
+				'Arial Black=arial black,sans-serif;' +
+				'Book Antiqua=book antiqua,palatino,serif;' +
+				'Comic Sans MS=comic sans ms,sans-serif;' +
+				'Courier New=courier new,courier,monospace;' +
+				'Georgia=georgia,palatino,serif;' +
+				'Helvetica=helvetica,arial,sans-serif;' +
+				'Impact=impact,sans-serif;' +
+				'Symbol=symbol;' +
+				'Tahoma=tahoma,arial,helvetica,sans-serif;' +
+				'Terminal=terminal,monaco,monospace;' +
+				'Times New Roman=times new roman,times,serif;' +
+				'Trebuchet MS=trebuchet ms,geneva,sans-serif;' +
+				'Verdana=verdana,geneva,sans-serif;' +
+				'Webdings=webdings;' +
+				'Wingdings=wingdings,zapf dingbats';
+
+			var items = [], fonts = createFormats(editor.settings.font_formats || defaultFontsFormats);
+
+			each(fonts, function(font) {
+				items.push({
+					text: {raw: font[0]},
+					value: font[1],
+					textStyle: font[1].indexOf('dings') == -1 ? 'font-family:' + font[1] : ''
+				});
+			});
+
+			return {
+				type: 'listbox',
+				text: 'Font Family',
+				tooltip: 'Font Family',
+				values: items,
+				fixedWidth: true,
+				onPostRender: createListBoxChangeHandler(items, 'fontname'),
+				onselect: function(e) {
+					if (e.control.settings.value) {
+						editor.execCommand('FontName', false, e.control.settings.value);
+					}
+				}
+			};
+		});
+
+		editor.addButton('fontsizeselect', function() {
+			var items = [], defaultFontsizeFormats = '8pt 10pt 12pt 14pt 18pt 24pt 36pt';
+			var fontsize_formats = editor.settings.fontsize_formats || defaultFontsizeFormats;
+
+			each(fontsize_formats.split(' '), function(item) {
+				var text = item, value = item;
+				// Allow text=value font sizes.
+				var values = item.split('=');
+				if (values.length > 1) {
+					text = values[0];
+					value = values[1];
+				}
+				items.push({text: text, value: value});
+			});
+
+			return {
+				type: 'listbox',
+				text: 'Font Sizes',
+				tooltip: 'Font Sizes',
+				values: items,
+				fixedWidth: true,
+				onPostRender: createListBoxChangeHandler(items, 'fontsize'),
+				onclick: function(e) {
+					if (e.control.settings.value) {
+						editor.execCommand('FontSize', false, e.control.settings.value);
+					}
+				}
+			};
+		});
+
+		editor.addMenuItem('formats', {
+			text: 'Formats',
+			menu: formatMenu
+		});
+	}
+});
+
+// Included from: js/tinymce/classes/ui/GridLayout.js
+
+/**
+ * GridLayout.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This layout manager places controls in a grid.
+ *
+ * @setting {Number} spacing Spacing between controls.
+ * @setting {Number} spacingH Horizontal spacing between controls.
+ * @setting {Number} spacingV Vertical spacing between controls.
+ * @setting {Number} columns Number of columns to use.
+ * @setting {String/Array} alignH start|end|center|stretch or array of values for each column.
+ * @setting {String/Array} alignV start|end|center|stretch or array of values for each column.
+ * @setting {String} pack start|end
+ *
+ * @class tinymce.ui.GridLayout
+ * @extends tinymce.ui.AbsoluteLayout
+ */
+define("tinymce/ui/GridLayout", [
+	"tinymce/ui/AbsoluteLayout"
+], function(AbsoluteLayout) {
+	"use strict";
+
+	return AbsoluteLayout.extend({
+		/**
+		 * Recalculates the positions of the controls in the specified container.
+		 *
+		 * @method recalc
+		 * @param {tinymce.ui.Container} container Container instance to recalc.
+		 */
+		recalc: function(container) {
+			var settings = container.settings, rows, cols, items, contLayoutRect, width, height, rect,
+				ctrlLayoutRect, ctrl, x, y, posX, posY, ctrlSettings, contPaddingBox, align, spacingH, spacingV, alignH, alignV, maxX, maxY,
+				colWidths = [], rowHeights = [], ctrlMinWidth, ctrlMinHeight, availableWidth, availableHeight, reverseRows, idx;
+
+			// Get layout settings
+			settings = container.settings;
+			items = container.items().filter(':visible');
+			contLayoutRect = container.layoutRect();
+			cols = settings.columns || Math.ceil(Math.sqrt(items.length));
+			rows = Math.ceil(items.length / cols);
+			spacingH = settings.spacingH || settings.spacing || 0;
+			spacingV = settings.spacingV || settings.spacing || 0;
+			alignH = settings.alignH || settings.align;
+			alignV = settings.alignV || settings.align;
+			contPaddingBox = container._paddingBox;
+			reverseRows = 'reverseRows' in settings ? settings.reverseRows : container.isRtl();
+
+			if (alignH && typeof alignH == "string") {
+				alignH = [alignH];
+			}
+
+			if (alignV && typeof alignV == "string") {
+				alignV = [alignV];
+			}
+
+			// Zero padd columnWidths
+			for (x = 0; x < cols; x++) {
+				colWidths.push(0);
+			}
+
+			// Zero padd rowHeights
+			for (y = 0; y < rows; y++) {
+				rowHeights.push(0);
+			}
+
+			// Calculate columnWidths and rowHeights
+			for (y = 0; y < rows; y++) {
+				for (x = 0; x < cols; x++) {
+					ctrl = items[y * cols + x];
+
+					// Out of bounds
+					if (!ctrl) {
+						break;
+					}
+
+					ctrlLayoutRect = ctrl.layoutRect();
+					ctrlMinWidth = ctrlLayoutRect.minW;
+					ctrlMinHeight = ctrlLayoutRect.minH;
+
+					colWidths[x] = ctrlMinWidth > colWidths[x] ? ctrlMinWidth : colWidths[x];
+					rowHeights[y] = ctrlMinHeight > rowHeights[y] ? ctrlMinHeight : rowHeights[y];
+				}
+			}
+
+			// Calculate maxX
+			availableWidth = contLayoutRect.innerW - contPaddingBox.left - contPaddingBox.right;
+			for (maxX = 0, x = 0; x < cols; x++) {
+				maxX += colWidths[x] + (x > 0 ? spacingH : 0);
+				availableWidth -= (x > 0 ? spacingH : 0) + colWidths[x];
+			}
+
+			// Calculate maxY
+			availableHeight = contLayoutRect.innerH - contPaddingBox.top - contPaddingBox.bottom;
+			for (maxY = 0, y = 0; y < rows; y++) {
+				maxY += rowHeights[y] + (y > 0 ? spacingV : 0);
+				availableHeight -= (y > 0 ? spacingV : 0) + rowHeights[y];
+			}
+
+			maxX += contPaddingBox.left + contPaddingBox.right;
+			maxY += contPaddingBox.top + contPaddingBox.bottom;
+
+			// Calculate minW/minH
+			rect = {};
+			rect.minW = maxX + (contLayoutRect.w - contLayoutRect.innerW);
+			rect.minH = maxY + (contLayoutRect.h - contLayoutRect.innerH);
+
+			rect.contentW = rect.minW - contLayoutRect.deltaW;
+			rect.contentH = rect.minH - contLayoutRect.deltaH;
+			rect.minW = Math.min(rect.minW, contLayoutRect.maxW);
+			rect.minH = Math.min(rect.minH, contLayoutRect.maxH);
+			rect.minW = Math.max(rect.minW, contLayoutRect.startMinWidth);
+			rect.minH = Math.max(rect.minH, contLayoutRect.startMinHeight);
+
+			// Resize container container if minSize was changed
+			if (contLayoutRect.autoResize && (rect.minW != contLayoutRect.minW || rect.minH != contLayoutRect.minH)) {
+				rect.w = rect.minW;
+				rect.h = rect.minH;
+
+				container.layoutRect(rect);
+				this.recalc(container);
+
+				// Forced recalc for example if items are hidden/shown
+				if (container._lastRect === null) {
+					var parentCtrl = container.parent();
+					if (parentCtrl) {
+						parentCtrl._lastRect = null;
+						parentCtrl.recalc();
+					}
+				}
+
+				return;
+			}
+
+			// Update contentW/contentH so absEnd moves correctly
+			if (contLayoutRect.autoResize) {
+				rect = container.layoutRect(rect);
+				rect.contentW = rect.minW - contLayoutRect.deltaW;
+				rect.contentH = rect.minH - contLayoutRect.deltaH;
+			}
+
+			var flexV;
+
+			if (settings.packV == 'start') {
+				flexV = 0;
+			} else {
+				flexV = availableHeight > 0 ? Math.floor(availableHeight / rows) : 0;
+			}
+
+			// Calculate totalFlex
+			var totalFlex = 0;
+			var flexWidths = settings.flexWidths;
+			if (flexWidths) {
+				for (x = 0; x < flexWidths.length; x++) {
+					totalFlex += flexWidths[x];
+				}
+			} else {
+				totalFlex = cols;
+			}
+
+			// Calculate new column widths based on flex values
+			var ratio = availableWidth / totalFlex;
+			for (x = 0; x < cols; x++) {
+				colWidths[x] += flexWidths ? flexWidths[x] * ratio : ratio;
+			}
+
+			// Move/resize controls
+			posY = contPaddingBox.top;
+			for (y = 0; y < rows; y++) {
+				posX = contPaddingBox.left;
+				height = rowHeights[y] + flexV;
+
+				for (x = 0; x < cols; x++) {
+					if (reverseRows) {
+						idx = y * cols + cols - 1 - x;
+					} else {
+						idx = y * cols + x;
+					}
+
+					ctrl = items[idx];
+
+					// No more controls to render then break
+					if (!ctrl) {
+						break;
+					}
+
+					// Get control settings and calculate x, y
+					ctrlSettings = ctrl.settings;
+					ctrlLayoutRect = ctrl.layoutRect();
+					width = Math.max(colWidths[x], ctrlLayoutRect.startMinWidth);
+					ctrlLayoutRect.x = posX;
+					ctrlLayoutRect.y = posY;
+
+					// Align control horizontal
+					align = ctrlSettings.alignH || (alignH ? (alignH[x] || alignH[0]) : null);
+					if (align == "center") {
+						ctrlLayoutRect.x = posX + (width / 2) - (ctrlLayoutRect.w / 2);
+					} else if (align == "right") {
+						ctrlLayoutRect.x = posX + width - ctrlLayoutRect.w;
+					} else if (align == "stretch") {
+						ctrlLayoutRect.w = width;
+					}
+
+					// Align control vertical
+					align = ctrlSettings.alignV || (alignV ? (alignV[x] || alignV[0]) : null);
+					if (align == "center") {
+						ctrlLayoutRect.y = posY + (height / 2) - (ctrlLayoutRect.h / 2);
+					} else if (align == "bottom") {
+						ctrlLayoutRect.y = posY + height - ctrlLayoutRect.h;
+					} else if (align == "stretch") {
+						ctrlLayoutRect.h = height;
+					}
+
+					ctrl.layoutRect(ctrlLayoutRect);
+
+					posX += width + spacingH;
+
+					if (ctrl.recalc) {
+						ctrl.recalc();
+					}
+				}
+
+				posY += height + spacingV;
+			}
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/Iframe.js
+
+/**
+ * Iframe.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*jshint scripturl:true */
+
+/**
+ * This class creates an iframe.
+ *
+ * @setting {String} url Url to open in the iframe.
+ *
+ * @-x-less Iframe.less
+ * @class tinymce.ui.Iframe
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/Iframe", [
+	"tinymce/ui/Widget"
+], function(Widget) {
+	"use strict";
+
+	return Widget.extend({
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this;
+
+			self.addClass('iframe');
+			self.canFocus = false;
+
+			/*eslint no-script-url:0 */
+			return (
+				'<iframe id="' + self._id + '" class="' + self.classes() + '" tabindex="-1" src="' +
+				(self.settings.url || "javascript:\'\'") + '" frameborder="0"></iframe>'
+			);
+		},
+
+		/**
+		 * Setter for the iframe source.
+		 *
+		 * @method src
+		 * @param {String} src Source URL for iframe.
+		 */
+		src: function(src) {
+			this.getEl().src = src;
+		},
+
+		/**
+		 * Inner HTML for the iframe.
+		 *
+		 * @method html
+		 * @param {String} html HTML string to set as HTML inside the iframe.
+		 * @param {function} callback Optional callback to execute when the iframe body is filled with contents.
+		 * @return {tinymce.ui.Iframe} Current iframe control.
+		 */
+		html: function(html, callback) {
+			var self = this, body = this.getEl().contentWindow.document.body;
+
+			// Wait for iframe to initialize IE 10 takes time
+			if (!body) {
+				setTimeout(function() {
+					self.html(html);
+				}, 0);
+			} else {
+				body.innerHTML = html;
+
+				if (callback) {
+					callback();
+				}
+			}
+
+			return this;
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/Label.js
+
+/**
+ * Label.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class creates a label element. A label is a simple text control
+ * that can be bound to other controls.
+ *
+ * @-x-less Label.less
+ * @class tinymce.ui.Label
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/Label", [
+	"tinymce/ui/Widget",
+	"tinymce/ui/DomUtils"
+], function(Widget, DomUtils) {
+	"use strict";
+
+	return Widget.extend({
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @param {Boolean} multiline Multiline label.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self._super(settings);
+			self.addClass('widget');
+			self.addClass('label');
+			self.canFocus = false;
+
+			if (settings.multiline) {
+				self.addClass('autoscroll');
+			}
+
+			if (settings.strong) {
+				self.addClass('strong');
+			}
+		},
+
+		/**
+		 * Initializes the current controls layout rect.
+		 * This will be executed by the layout managers to determine the
+		 * default minWidth/minHeight etc.
+		 *
+		 * @method initLayoutRect
+		 * @return {Object} Layout rect instance.
+		 */
+		initLayoutRect: function() {
+			var self = this, layoutRect = self._super();
+
+			if (self.settings.multiline) {
+				var size = DomUtils.getSize(self.getEl());
+
+				// Check if the text fits within maxW if not then try word wrapping it
+				if (size.width > layoutRect.maxW) {
+					layoutRect.minW = layoutRect.maxW;
+					self.addClass('multiline');
+				}
+
+				self.getEl().style.width = layoutRect.minW + 'px';
+				layoutRect.startMinH = layoutRect.h = layoutRect.minH = Math.min(layoutRect.maxH, DomUtils.getSize(self.getEl()).height);
+			}
+
+			return layoutRect;
+		},
+
+		/**
+		 * Repaints the control after a layout operation.
+		 *
+		 * @method repaint
+		 */
+		repaint: function() {
+			var self = this;
+
+			if (!self.settings.multiline) {
+				self.getEl().style.lineHeight = self.layoutRect().h + 'px';
+			}
+
+			return self._super();
+		},
+
+		/**
+		 * Sets/gets the current label text.
+		 *
+		 * @method text
+		 * @param {String} [text] New label text.
+		 * @return {String|tinymce.ui.Label} Current text or current label instance.
+		 */
+		text: function(text) {
+			var self = this;
+
+			if (self._rendered && text) {
+				this.innerHtml(self.encode(text));
+			}
+
+			return self._super(text);
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, forId = self.settings.forId;
+
+			return (
+				'<label id="' + self._id + '" class="' + self.classes() + '"' + (forId ? ' for="' + forId + '"' : '') + '>' +
+					self.encode(self._text) +
+				'</label>'
+			);
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/Toolbar.js
+
+/**
+ * Toolbar.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new toolbar.
+ *
+ * @class tinymce.ui.Toolbar
+ * @extends tinymce.ui.Container
+ */
+define("tinymce/ui/Toolbar", [
+	"tinymce/ui/Container"
+], function(Container) {
+	"use strict";
+
+	return Container.extend({
+		Defaults: {
+			role: 'toolbar',
+			layout: 'flow'
+		},
+
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self._super(settings);
+			self.addClass('toolbar');
+		},
+
+		/**
+		 * Called after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this;
+
+			self.items().addClass('toolbar-item');
+
+			return self._super();
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/MenuBar.js
+
+/**
+ * MenuBar.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new menubar.
+ *
+ * @-x-less MenuBar.less
+ * @class tinymce.ui.MenuBar
+ * @extends tinymce.ui.Toolbar
+ */
+define("tinymce/ui/MenuBar", [
+	"tinymce/ui/Toolbar"
+], function(Toolbar) {
+	"use strict";
+
+	return Toolbar.extend({
+		Defaults: {
+			role: 'menubar',
+			containerCls: 'menubar',
+			ariaRoot: true,
+			defaults: {
+				type: 'menubutton'
+			}
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/MenuButton.js
+
+/**
+ * MenuButton.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new menu button.
+ *
+ * @-x-less MenuButton.less
+ * @class tinymce.ui.MenuButton
+ * @extends tinymce.ui.Button
+ */
+define("tinymce/ui/MenuButton", [
+	"tinymce/ui/Button",
+	"tinymce/ui/Factory",
+	"tinymce/ui/MenuBar"
+], function(Button, Factory, MenuBar) {
+	"use strict";
+
+	// TODO: Maybe add as some global function
+	function isChildOf(node, parent) {
+		while (node) {
+			if (parent === node) {
+				return true;
+			}
+
+			node = node.parentNode;
+		}
+
+		return false;
+	}
+
+	var MenuButton = Button.extend({
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self._renderOpen = true;
+			self._super(settings);
+
+			self.addClass('menubtn');
+
+			if (settings.fixedWidth) {
+				self.addClass('fixed-width');
+			}
+
+			self.aria('haspopup', true);
+			self.hasPopup = true;
+		},
+
+		/**
+		 * Shows the menu for the button.
+		 *
+		 * @method showMenu
+		 */
+		showMenu: function() {
+			var self = this, settings = self.settings, menu;
+
+			if (self.menu && self.menu.visible()) {
+				return self.hideMenu();
+			}
+
+			if (!self.menu) {
+				menu = settings.menu || [];
+
+				// Is menu array then auto constuct menu control
+				if (menu.length) {
+					menu = {
+						type: 'menu',
+						items: menu
+					};
+				} else {
+					menu.type = menu.type || 'menu';
+				}
+
+				self.menu = Factory.create(menu).parent(self).renderTo();
+				self.fire('createmenu');
+				self.menu.reflow();
+				self.menu.on('cancel', function(e) {
+					if (e.control.parent() === self.menu) {
+						e.stopPropagation();
+						self.focus();
+						self.hideMenu();
+					}
+				});
+
+				// Move focus to button when a menu item is selected/clicked
+				self.menu.on('select', function() {
+					self.focus();
+				});
+
+				self.menu.on('show hide', function(e) {
+					if (e.control == self.menu) {
+						self.activeMenu(e.type == 'show');
+					}
+
+					self.aria('expanded', e.type == 'show');
+				}).fire('show');
+			}
+
+			self.menu.show();
+			self.menu.layoutRect({w: self.layoutRect().w});
+			self.menu.moveRel(self.getEl(), self.isRtl() ? ['br-tr', 'tr-br'] : ['bl-tl', 'tl-bl']);
+		},
+
+		/**
+		 * Hides the menu for the button.
+		 *
+		 * @method hideMenu
+		 */
+		hideMenu: function() {
+			var self = this;
+
+			if (self.menu) {
+				self.menu.items().each(function(item) {
+					if (item.hideMenu) {
+						item.hideMenu();
+					}
+				});
+
+				self.menu.hide();
+			}
+		},
+
+		/**
+		 * Sets the active menu state.
+		 *
+		 * @private
+		 */
+		activeMenu: function(state) {
+			this.toggleClass('active', state);
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, id = self._id, prefix = self.classPrefix;
+			var icon = self.settings.icon, image;
+
+			image = self.settings.image;
+			if (image) {
+				icon = 'none';
+
+				// Support for [high dpi, low dpi] image sources
+				if (typeof image != "string") {
+					image = window.getSelection ? image[0] : image[1];
+				}
+
+				image = ' style="background-image: url(\'' + image + '\')"';
+			} else {
+				image = '';
+			}
+
+			icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
+
+			self.aria('role', self.parent() instanceof MenuBar ? 'menuitem' : 'button');
+
+			return (
+				'<div id="' + id + '" class="' + self.classes() + '" tabindex="-1" aria-labelledby="' + id + '">' +
+					'<button id="' + id + '-open" role="presentation" type="button" tabindex="-1">' +
+						(icon ? '<i class="' + icon + '"' + image + '></i>' : '') +
+						'<span>' + (self._text ? (icon ? '\u00a0' : '') + self.encode(self._text) : '') + '</span>' +
+						' <i class="' + prefix + 'caret"></i>' +
+					'</button>' +
+				'</div>'
+			);
+		},
+
+		/**
+		 * Gets invoked after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this;
+
+			self.on('click', function(e) {
+				if (e.control === self && isChildOf(e.target, self.getEl())) {
+					self.showMenu();
+
+					if (e.aria) {
+						self.menu.items()[0].focus();
+					}
+				}
+			});
+
+			self.on('mouseenter', function(e) {
+				var overCtrl = e.control, parent = self.parent(), hasVisibleSiblingMenu;
+
+				if (overCtrl && parent && overCtrl instanceof MenuButton && overCtrl.parent() == parent) {
+					parent.items().filter('MenuButton').each(function(ctrl) {
+						if (ctrl.hideMenu && ctrl != overCtrl) {
+							if (ctrl.menu && ctrl.menu.visible()) {
+								hasVisibleSiblingMenu = true;
+							}
+
+							ctrl.hideMenu();
+						}
+					});
+
+					if (hasVisibleSiblingMenu) {
+						overCtrl.focus(); // Fix for: #5887
+						overCtrl.showMenu();
+					}
+				}
+			});
+
+			return self._super();
+		},
+
+		/**
+		 * Sets/gets the current button text.
+		 *
+		 * @method text
+		 * @param {String} [text] New button text.
+		 * @return {String|tinymce.ui.MenuButton} Current text or current MenuButton instance.
+		 */
+		text: function(text) {
+			var self = this, i, children;
+
+			if (self._rendered) {
+				children = self.getEl('open').getElementsByTagName('span');
+				for (i = 0; i < children.length; i++) {
+					children[i].innerHTML = (self.settings.icon && text ? '\u00a0' : '') + self.encode(text);
+				}
+			}
+
+			return this._super(text);
+		},
+
+		/**
+		 * Removes the control and it's menus.
+		 *
+		 * @method remove
+		 */
+		remove: function() {
+			this._super();
+
+			if (this.menu) {
+				this.menu.remove();
+			}
+		}
+	});
+
+	return MenuButton;
+});
+
+// Included from: js/tinymce/classes/ui/ListBox.js
+
+/**
+ * ListBox.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new list box control.
+ *
+ * @-x-less ListBox.less
+ * @class tinymce.ui.ListBox
+ * @extends tinymce.ui.MenuButton
+ */
+define("tinymce/ui/ListBox", [
+	"tinymce/ui/MenuButton"
+], function(MenuButton) {
+	"use strict";
+
+	return MenuButton.extend({
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {Array} values Array with values to add to list box.
+		 */
+		init: function(settings) {
+			var self = this, values, selected, selectedText, lastItemCtrl;
+
+			function setSelected(menuValues) {
+				// Try to find a selected value
+				for (var i = 0; i < menuValues.length; i++) {
+					selected = menuValues[i].selected || settings.value === menuValues[i].value;
+
+					if (selected) {
+						selectedText = selectedText || menuValues[i].text;
+						self._value = menuValues[i].value;
+						break;
+					}
+
+					// If the value has a submenu, try to find the selected values in that menu
+					if (menuValues[i].menu) {
+						setSelected(menuValues[i].menu);
+					}
+				}
+			}
+
+			self._values = values = settings.values;
+			if (values) {
+				setSelected(values);
+
+				// Default with first item
+				if (!selected && values.length > 0) {
+					selectedText = values[0].text;
+					self._value = values[0].value;
+				}
+
+				settings.menu = values;
+			}
+
+			settings.text = settings.text || selectedText || values[0].text;
+
+			self._super(settings);
+			self.addClass('listbox');
+
+			self.on('select', function(e) {
+				var ctrl = e.control;
+
+				if (lastItemCtrl) {
+					e.lastControl = lastItemCtrl;
+				}
+
+				if (settings.multiple) {
+					ctrl.active(!ctrl.active());
+				} else {
+					self.value(e.control.settings.value);
+				}
+
+				lastItemCtrl = ctrl;
+			});
+		},
+
+		/**
+		 * Getter/setter function for the control value.
+		 *
+		 * @method value
+		 * @param {String} [value] Value to be set.
+		 * @return {Boolean/tinymce.ui.ListBox} Value or self if it's a set operation.
+		 */
+		value: function(value) {
+			var self = this, active, selectedText, menu;
+
+			function activateByValue(menu, value) {
+				menu.items().each(function(ctrl) {
+					active = ctrl.value() === value;
+
+					if (active) {
+						selectedText = selectedText || ctrl.text();
+					}
+
+					ctrl.active(active);
+
+					if (ctrl.menu) {
+						activateByValue(ctrl.menu, value);
+					}
+				});
+			}
+
+			function setActiveValues(menuValues) {
+				for (var i = 0; i < menuValues.length; i++) {
+					active = menuValues[i].value == value;
+
+					if (active) {
+						selectedText = selectedText || menuValues[i].text;
+					}
+
+					menuValues[i].active = active;
+
+					if (menuValues[i].menu) {
+						setActiveValues(menuValues[i].menu);
+					}
+				}
+			}
+
+			if (typeof value != "undefined") {
+				if (self.menu) {
+					activateByValue(self.menu, value);
+				} else {
+					menu = self.settings.menu;
+					setActiveValues(menu);
+				}
+
+				self.text(selectedText || this.settings.text);
+			}
+
+			return self._super(value);
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/MenuItem.js
+
+/**
+ * MenuItem.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new menu item.
+ *
+ * @-x-less MenuItem.less
+ * @class tinymce.ui.MenuItem
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/MenuItem", [
+	"tinymce/ui/Widget",
+	"tinymce/ui/Factory",
+	"tinymce/Env"
+], function(Widget, Factory, Env) {
+	"use strict";
+
+	return Widget.extend({
+		Defaults: {
+			border: 0,
+			role: 'menuitem'
+		},
+
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {Boolean} selectable Selectable menu.
+		 * @setting {Array} menu Submenu array with items.
+		 * @setting {String} shortcut Shortcut to display for menu item. Example: Ctrl+X
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self.hasPopup = true;
+
+			self._super(settings);
+
+			settings = self.settings;
+
+			self.addClass('menu-item');
+
+			if (settings.menu) {
+				self.addClass('menu-item-expand');
+			}
+
+			if (settings.preview) {
+				self.addClass('menu-item-preview');
+			}
+
+			if (self._text === '-' || self._text === '|') {
+				self.addClass('menu-item-sep');
+				self.aria('role', 'separator');
+				self._text = '-';
+			}
+
+			if (settings.selectable) {
+				self.aria('role', 'menuitemcheckbox');
+				self.addClass('menu-item-checkbox');
+				settings.icon = 'selected';
+			}
+
+			if (!settings.preview && !settings.selectable) {
+				self.addClass('menu-item-normal');
+			}
+
+			self.on('mousedown', function(e) {
+				e.preventDefault();
+			});
+
+			if (settings.menu && !settings.ariaHideMenu) {
+				self.aria('haspopup', true);
+			}
+		},
+
+		/**
+		 * Returns true/false if the menuitem has sub menu.
+		 *
+		 * @method hasMenus
+		 * @return {Boolean} True/false state if it has submenu.
+		 */
+		hasMenus: function() {
+			return !!this.settings.menu;
+		},
+
+		/**
+		 * Shows the menu for the menu item.
+		 *
+		 * @method showMenu
+		 */
+		showMenu: function() {
+			var self = this, settings = self.settings, menu, parent = self.parent();
+
+			parent.items().each(function(ctrl) {
+				if (ctrl !== self) {
+					ctrl.hideMenu();
+				}
+			});
+
+			if (settings.menu) {
+				menu = self.menu;
+
+				if (!menu) {
+					menu = settings.menu;
+
+					// Is menu array then auto constuct menu control
+					if (menu.length) {
+						menu = {
+							type: 'menu',
+							items: menu
+						};
+					} else {
+						menu.type = menu.type || 'menu';
+					}
+
+					if (parent.settings.itemDefaults) {
+						menu.itemDefaults = parent.settings.itemDefaults;
+					}
+
+					menu = self.menu = Factory.create(menu).parent(self).renderTo();
+					menu.reflow();
+					menu.on('cancel', function(e) {
+						e.stopPropagation();
+						self.focus();
+						menu.hide();
+					});
+					menu.on('show hide', function(e) {
+						e.control.items().each(function(ctrl) {
+							ctrl.active(ctrl.settings.selected);
+						});
+					}).fire('show');
+
+					menu.on('hide', function(e) {
+						if (e.control === menu) {
+							self.removeClass('selected');
+						}
+					});
+
+					menu.submenu = true;
+				} else {
+					menu.show();
+				}
+
+				menu._parentMenu = parent;
+
+				menu.addClass('menu-sub');
+
+				var rel = menu.testMoveRel(
+					self.getEl(),
+					self.isRtl() ? ['tl-tr', 'bl-br', 'tr-tl', 'br-bl'] : ['tr-tl', 'br-bl', 'tl-tr', 'bl-br']
+				);
+
+				menu.moveRel(self.getEl(), rel);
+				menu.rel = rel;
+
+				rel = 'menu-sub-' + rel;
+				menu.removeClass(menu._lastRel);
+				menu.addClass(rel);
+				menu._lastRel = rel;
+
+				self.addClass('selected');
+				self.aria('expanded', true);
+			}
+		},
+
+		/**
+		 * Hides the menu for the menu item.
+		 *
+		 * @method hideMenu
+		 */
+		hideMenu: function() {
+			var self = this;
+
+			if (self.menu) {
+				self.menu.items().each(function(item) {
+					if (item.hideMenu) {
+						item.hideMenu();
+					}
+				});
+
+				self.menu.hide();
+				self.aria('expanded', false);
+			}
+
+			return self;
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, id = self._id, settings = self.settings, prefix = self.classPrefix, text = self.encode(self._text);
+			var icon = self.settings.icon, image = '', shortcut = settings.shortcut;
+
+			// Converts shortcut format to Mac/PC variants
+			function convertShortcut(shortcut) {
+				var i, value, replace = {};
+
+				if (Env.mac) {
+					replace = {
+						alt: '&#x2325;',
+						ctrl: '&#x2318;',
+						shift: '&#x21E7;',
+						meta: '&#x2318;'
+					};
+				} else {
+					replace = {
+						meta: 'Ctrl'
+					};
+				}
+
+				shortcut = shortcut.split('+');
+
+				for (i = 0; i < shortcut.length; i++) {
+					value = replace[shortcut[i].toLowerCase()];
+
+					if (value) {
+						shortcut[i] = value;
+					}
+				}
+
+				return shortcut.join('+');
+			}
+
+			if (icon) {
+				self.parent().addClass('menu-has-icons');
+			}
+
+			if (settings.image) {
+				icon = 'none';
+				image = ' style="background-image: url(\'' + settings.image + '\')"';
+			}
+
+			if (shortcut) {
+				shortcut = convertShortcut(shortcut);
+			}
+
+			icon = prefix + 'ico ' + prefix + 'i-' + (self.settings.icon || 'none');
+
+			return (
+				'<div id="' + id + '" class="' + self.classes() + '" tabindex="-1">' +
+					(text !== '-' ? '<i class="' + icon + '"' + image + '></i>\u00a0' : '') +
+					(text !== '-' ? '<span id="' + id + '-text" class="' + prefix + 'text">' + text + '</span>' : '') +
+					(shortcut ? '<div id="' + id + '-shortcut" class="' + prefix + 'menu-shortcut">' + shortcut + '</div>' : '') +
+					(settings.menu ? '<div class="' + prefix + 'caret"></div>' : '') +
+				'</div>'
+			);
+		},
+
+		/**
+		 * Gets invoked after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this, settings = self.settings;
+
+			var textStyle = settings.textStyle;
+			if (typeof textStyle == "function") {
+				textStyle = textStyle.call(this);
+			}
+
+			if (textStyle) {
+				var textElm = self.getEl('text');
+				if (textElm) {
+					textElm.setAttribute('style', textStyle);
+				}
+			}
+
+			self.on('mouseenter click', function(e) {
+				if (e.control === self) {
+					if (!settings.menu && e.type === 'click') {
+						self.fire('select');
+						self.parent().hideAll();
+					} else {
+						self.showMenu();
+
+						if (e.aria) {
+							self.menu.focus(true);
+						}
+					}
+				}
+			});
+
+			self._super();
+
+			return self;
+		},
+
+		active: function(state) {
+			if (typeof state != "undefined") {
+				this.aria('checked', state);
+			}
+
+			return this._super(state);
+		},
+
+		/**
+		 * Removes the control and it's menus.
+		 *
+		 * @method remove
+		 */
+		remove: function() {
+			this._super();
+
+			if (this.menu) {
+				this.menu.remove();
+			}
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/Menu.js
+
+/**
+ * Menu.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new menu.
+ *
+ * @-x-less Menu.less
+ * @class tinymce.ui.Menu
+ * @extends tinymce.ui.FloatPanel
+ */
+define("tinymce/ui/Menu", [
+	"tinymce/ui/FloatPanel",
+	"tinymce/ui/MenuItem",
+	"tinymce/util/Tools"
+], function(FloatPanel, MenuItem, Tools) {
+	"use strict";
+
+	var Menu = FloatPanel.extend({
+		Defaults: {
+			defaultType: 'menuitem',
+			border: 1,
+			layout: 'stack',
+			role: 'application',
+			bodyRole: 'menu',
+			ariaRoot: true
+		},
+
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			settings.autohide = true;
+			settings.constrainToViewport = true;
+
+			if (settings.itemDefaults) {
+				var items = settings.items, i = items.length;
+
+				while (i--) {
+					items[i] = Tools.extend({}, settings.itemDefaults, items[i]);
+				}
+			}
+
+			self._super(settings);
+			self.addClass('menu');
+		},
+
+		/**
+		 * Repaints the control after a layout operation.
+		 *
+		 * @method repaint
+		 */
+		repaint: function() {
+			this.toggleClass('menu-align', true);
+
+			this._super();
+
+			this.getEl().style.height = '';
+			this.getEl('body').style.height = '';
+
+			return this;
+		},
+
+		/**
+		 * Hides/closes the menu.
+		 *
+		 * @method cancel
+		 */
+		cancel: function() {
+			var self = this;
+
+			self.hideAll();
+			self.fire('select');
+		},
+
+		/**
+		 * Hide menu and all sub menus.
+		 *
+		 * @method hideAll
+		 */
+		hideAll: function() {
+			var self = this;
+
+			this.find('menuitem').exec('hideMenu');
+
+			return self._super();
+		},
+/*
+		getContainerElm: function() {
+			var doc = document, id = this.classPrefix + 'menucontainer';
+
+			var elm = doc.getElementById(id);
+			if (!elm) {
+				elm = doc.createElement('div');
+				elm.id = id;
+				elm.setAttribute('role', 'application');
+				elm.className = this.classPrefix + '-reset';
+				elm.style.position = 'absolute';
+				elm.style.top = elm.style.left = '0';
+				elm.style.overflow = 'visible';
+				doc.body.appendChild(elm);
+			}
+
+			return elm;
+		},
+*/
+		/**
+		 * Invoked before the menu is rendered.
+		 *
+		 * @method preRender
+		 */
+		preRender: function() {
+			var self = this;
+
+			self.items().each(function(ctrl) {
+				var settings = ctrl.settings;
+
+				if (settings.icon || settings.selectable) {
+					self._hasIcons = true;
+					return false;
+				}
+			});
+
+			return self._super();
+		}
+	});
+
+	return Menu;
+});
+
+// Included from: js/tinymce/classes/ui/Radio.js
+
+/**
+ * Radio.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new radio button.
+ *
+ * @-x-less Radio.less
+ * @class tinymce.ui.Radio
+ * @extends tinymce.ui.Checkbox
+ */
+define("tinymce/ui/Radio", [
+	"tinymce/ui/Checkbox"
+], function(Checkbox) {
+	"use strict";
+
+	return Checkbox.extend({
+		Defaults: {
+			classes: "radio",
+			role: "radio"
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/ResizeHandle.js
+
+/**
+ * ResizeHandle.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Renders a resize handle that fires ResizeStart, Resize and ResizeEnd events.
+ *
+ * @-x-less ResizeHandle.less
+ * @class tinymce.ui.ResizeHandle
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/ResizeHandle", [
+	"tinymce/ui/Widget",
+	"tinymce/ui/DragHelper"
+], function(Widget, DragHelper) {
+	"use strict";
+
+	return Widget.extend({
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, prefix = self.classPrefix;
+
+			self.addClass('resizehandle');
+
+			if (self.settings.direction == "both") {
+				self.addClass('resizehandle-both');
+			}
+
+			self.canFocus = false;
+
+			return (
+				'<div id="' + self._id + '" class="' + self.classes() + '">' +
+					'<i class="' + prefix + 'ico ' + prefix + 'i-resize"></i>' +
+				'</div>'
+			);
+		},
+
+		/**
+		 * Called after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this;
+
+			self._super();
+
+			self.resizeDragHelper = new DragHelper(this._id, {
+				start: function() {
+					self.fire('ResizeStart');
+				},
+
+				drag: function(e) {
+					if (self.settings.direction != "both") {
+						e.deltaX = 0;
+					}
+
+					self.fire('Resize', e);
+				},
+
+				stop: function() {
+					self.fire('ResizeEnd');
+				}
+			});
+		},
+
+		remove: function() {
+			if (this.resizeDragHelper) {
+				this.resizeDragHelper.destroy();
+			}
+
+			return this._super();
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/Spacer.js
+
+/**
+ * Spacer.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a spacer. This control is used in flex layouts for example.
+ *
+ * @-x-less Spacer.less
+ * @class tinymce.ui.Spacer
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/Spacer", [
+	"tinymce/ui/Widget"
+], function(Widget) {
+	"use strict";
+
+	return Widget.extend({
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this;
+
+			self.addClass('spacer');
+			self.canFocus = false;
+
+			return '<div id="' + self._id + '" class="' + self.classes() + '"></div>';
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/SplitButton.js
+
+/**
+ * SplitButton.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a split button.
+ *
+ * @-x-less SplitButton.less
+ * @class tinymce.ui.SplitButton
+ * @extends tinymce.ui.MenuButton
+ */
+define("tinymce/ui/SplitButton", [
+	"tinymce/ui/MenuButton",
+	"tinymce/ui/DomUtils"
+], function(MenuButton, DomUtils) {
+	return MenuButton.extend({
+		Defaults: {
+			classes: "widget btn splitbtn",
+			role: "button"
+		},
+
+		/**
+		 * Repaints the control after a layout operation.
+		 *
+		 * @method repaint
+		 */
+		repaint: function() {
+			var self = this, elm = self.getEl(), rect = self.layoutRect(), mainButtonElm, menuButtonElm;
+
+			self._super();
+
+			mainButtonElm = elm.firstChild;
+			menuButtonElm = elm.lastChild;
+
+			DomUtils.css(mainButtonElm, {
+				width: rect.w - DomUtils.getSize(menuButtonElm).width,
+				height: rect.h - 2
+			});
+
+			DomUtils.css(menuButtonElm, {
+				height: rect.h - 2
+			});
+
+			return self;
+		},
+
+		/**
+		 * Sets the active menu state.
+		 *
+		 * @private
+		 */
+		activeMenu: function(state) {
+			var self = this;
+
+			DomUtils.toggleClass(self.getEl().lastChild, self.classPrefix + 'active', state);
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, id = self._id, prefix = self.classPrefix, image;
+			var icon = self.settings.icon;
+
+			image = self.settings.image;
+			if (image) {
+				icon = 'none';
+
+				// Support for [high dpi, low dpi] image sources
+				if (typeof image != "string") {
+					image = window.getSelection ? image[0] : image[1];
+				}
+
+				image = ' style="background-image: url(\'' + image + '\')"';
+			} else {
+				image = '';
+			}
+
+			icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
+
+			return (
+				'<div id="' + id + '" class="' + self.classes() + '" role="button" tabindex="-1">' +
+					'<button type="button" hidefocus="1" tabindex="-1">' +
+						(icon ? '<i class="' + icon + '"' + image + '></i>' : '') +
+						(self._text ? (icon ? ' ' : '') + self._text : '') +
+					'</button>' +
+					'<button type="button" class="' + prefix + 'open" hidefocus="1" tabindex="-1">' +
+						//(icon ? '<i class="' + icon + '"></i>' : '') +
+						(self._menuBtnText ? (icon ? '\u00a0' : '') + self._menuBtnText : '') +
+						' <i class="' + prefix + 'caret"></i>' +
+					'</button>' +
+				'</div>'
+			);
+		},
+
+		/**
+		 * Called after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this, onClickHandler = self.settings.onclick;
+
+			self.on('click', function(e) {
+				var node = e.target;
+
+				if (e.control == this) {
+					// Find clicks that is on the main button
+					while (node) {
+						if ((e.aria && e.aria.key != 'down') || (node.nodeName == 'BUTTON' && node.className.indexOf('open') == -1)) {
+							e.stopImmediatePropagation();
+							onClickHandler.call(this, e);
+							return;
+						}
+
+						node = node.parentNode;
+					}
+				}
+			});
+
+			delete self.settings.onclick;
+
+			return self._super();
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/StackLayout.js
+
+/**
+ * StackLayout.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This layout uses the browsers layout when the items are blocks.
+ *
+ * @-x-less StackLayout.less
+ * @class tinymce.ui.StackLayout
+ * @extends tinymce.ui.FlowLayout
+ */
+define("tinymce/ui/StackLayout", [
+	"tinymce/ui/FlowLayout"
+], function(FlowLayout) {
+	"use strict";
+
+	return FlowLayout.extend({
+		Defaults: {
+			containerClass: 'stack-layout',
+			controlClass: 'stack-layout-item',
+			endClass: 'break'
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/TabPanel.js
+
+/**
+ * TabPanel.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a tab panel control.
+ *
+ * @-x-less TabPanel.less
+ * @class tinymce.ui.TabPanel
+ * @extends tinymce.ui.Panel
+ *
+ * @setting {Number} activeTab Active tab index.
+ */
+define("tinymce/ui/TabPanel", [
+	"tinymce/ui/Panel",
+	"tinymce/ui/DomUtils"
+], function(Panel, DomUtils) {
+	"use strict";
+
+	return Panel.extend({
+		Defaults: {
+			layout: 'absolute',
+			defaults: {
+				type: 'panel'
+			}
+		},
+
+		/**
+		 * Activates the specified tab by index.
+		 *
+		 * @method activateTab
+		 * @param {Number} idx Index of the tab to activate.
+		 */
+		activateTab: function(idx) {
+			var activeTabElm;
+
+			if (this.activeTabId) {
+				activeTabElm = this.getEl(this.activeTabId);
+				DomUtils.removeClass(activeTabElm, this.classPrefix + 'active');
+				activeTabElm.setAttribute('aria-selected', "false");
+			}
+
+			this.activeTabId = 't' + idx;
+
+			activeTabElm = this.getEl('t' + idx);
+			activeTabElm.setAttribute('aria-selected', "true");
+			DomUtils.addClass(activeTabElm, this.classPrefix + 'active');
+
+			this.items()[idx].show().fire('showtab');
+			this.reflow();
+
+			this.items().each(function(item, i) {
+				if (idx != i) {
+					item.hide();
+				}
+			});
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, layout = self._layout, tabsHtml = '', prefix = self.classPrefix;
+
+			self.preRender();
+			layout.preRender(self);
+
+			self.items().each(function(ctrl, i) {
+				var id = self._id + '-t' + i;
+
+				ctrl.aria('role', 'tabpanel');
+				ctrl.aria('labelledby', id);
+
+				tabsHtml += (
+					'<div id="' + id + '" class="' + prefix + 'tab" ' +
+						'unselectable="on" role="tab" aria-controls="' + ctrl._id + '" aria-selected="false" tabIndex="-1">' +
+						self.encode(ctrl.settings.title) +
+					'</div>'
+				);
+			});
+
+			return (
+				'<div id="' + self._id + '" class="' + self.classes() + '" hidefocus="1" tabindex="-1">' +
+					'<div id="' + self._id + '-head" class="' + prefix + 'tabs" role="tablist">' +
+						tabsHtml +
+					'</div>' +
+					'<div id="' + self._id + '-body" class="' + self.classes('body') + '">' +
+						layout.renderHtml(self) +
+					'</div>' +
+				'</div>'
+			);
+		},
+
+		/**
+		 * Called after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this;
+
+			self._super();
+
+			self.settings.activeTab = self.settings.activeTab || 0;
+			self.activateTab(self.settings.activeTab);
+
+			this.on('click', function(e) {
+				var targetParent = e.target.parentNode;
+
+				if (e.target.parentNode.id == self._id + '-head') {
+					var i = targetParent.childNodes.length;
+
+					while (i--) {
+						if (targetParent.childNodes[i] == e.target) {
+							self.activateTab(i);
+						}
+					}
+				}
+			});
+		},
+
+		/**
+		 * Initializes the current controls layout rect.
+		 * This will be executed by the layout managers to determine the
+		 * default minWidth/minHeight etc.
+		 *
+		 * @method initLayoutRect
+		 * @return {Object} Layout rect instance.
+		 */
+		initLayoutRect: function() {
+			var self = this, rect, minW, minH;
+
+			minW = DomUtils.getSize(self.getEl('head')).width;
+			minW = minW < 0 ? 0 : minW;
+			minH = 0;
+
+			self.items().each(function(item) {
+				minW = Math.max(minW, item.layoutRect().minW);
+				minH = Math.max(minH, item.layoutRect().minH);
+			});
+
+			self.items().each(function(ctrl) {
+				ctrl.settings.x = 0;
+				ctrl.settings.y = 0;
+				ctrl.settings.w = minW;
+				ctrl.settings.h = minH;
+
+				ctrl.layoutRect({
+					x: 0,
+					y: 0,
+					w: minW,
+					h: minH
+				});
+			});
+
+			var headH = DomUtils.getSize(self.getEl('head')).height;
+
+			self.settings.minWidth = minW;
+			self.settings.minHeight = minH + headH;
+
+			rect = self._super();
+			rect.deltaH += headH;
+			rect.innerH = rect.h - rect.deltaH;
+
+			return rect;
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/TextBox.js
+
+/**
+ * TextBox.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new textbox.
+ *
+ * @-x-less TextBox.less
+ * @class tinymce.ui.TextBox
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/TextBox", [
+	"tinymce/ui/Widget",
+	"tinymce/ui/DomUtils"
+], function(Widget, DomUtils) {
+	"use strict";
+
+	return Widget.extend({
+		/**
+		 * Constructs a instance with the specified settings.
+		 *
+		 * @constructor
+		 * @param {Object} settings Name/value object with settings.
+		 * @setting {Boolean} multiline True if the textbox is a multiline control.
+		 * @setting {Number} maxLength Max length for the textbox.
+		 * @setting {Number} size Size of the textbox in characters.
+		 */
+		init: function(settings) {
+			var self = this;
+
+			self._super(settings);
+
+			self._value = settings.value || '';
+			self.addClass('textbox');
+
+			if (settings.multiline) {
+				self.addClass('multiline');
+			} else {
+				// TODO: Rework this
+				self.on('keydown', function(e) {
+					if (e.keyCode == 13) {
+						self.parents().reverse().each(function(ctrl) {
+							e.preventDefault();
+
+							if (ctrl.hasEventListeners('submit') && ctrl.toJSON) {
+								ctrl.fire('submit', {data: ctrl.toJSON()});
+								return false;
+							}
+						});
+					}
+				});
+			}
+		},
+
+		/**
+		 * Getter/setter function for the disabled state.
+		 *
+		 * @method value
+		 * @param {Boolean} [state] State to be set.
+		 * @return {Boolean|tinymce.ui.ComboBox} True/false or self if it's a set operation.
+		 */
+		disabled: function(state) {
+			var self = this;
+
+			if (self._rendered && typeof state != 'undefined') {
+				self.getEl().disabled = state;
+			}
+
+			return self._super(state);
+		},
+
+		/**
+		 * Getter/setter function for the control value.
+		 *
+		 * @method value
+		 * @param {String} [value] Value to be set.
+		 * @return {String|tinymce.ui.ComboBox} Value or self if it's a set operation.
+		 */
+		value: function(value) {
+			var self = this;
+
+			if (typeof value != "undefined") {
+				self._value = value;
+
+				if (self._rendered) {
+					self.getEl().value = value;
+				}
+
+				return self;
+			}
+
+			if (self._rendered) {
+				return self.getEl().value;
+			}
+
+			return self._value;
+		},
+
+		/**
+		 * Repaints the control after a layout operation.
+		 *
+		 * @method repaint
+		 */
+		repaint: function() {
+			var self = this, style, rect, borderBox, borderW = 0, borderH = 0, lastRepaintRect;
+
+			style = self.getEl().style;
+			rect = self._layoutRect;
+			lastRepaintRect = self._lastRepaintRect || {};
+
+			// Detect old IE 7+8 add lineHeight to align caret vertically in the middle
+			var doc = document;
+			if (!self.settings.multiline && doc.all && (!doc.documentMode || doc.documentMode <= 8)) {
+				style.lineHeight = (rect.h - borderH) + 'px';
+			}
+
+			borderBox = self._borderBox;
+			borderW = borderBox.left + borderBox.right + 8;
+			borderH = borderBox.top + borderBox.bottom + (self.settings.multiline ? 8 : 0);
+
+			if (rect.x !== lastRepaintRect.x) {
+				style.left = rect.x + 'px';
+				lastRepaintRect.x = rect.x;
+			}
+
+			if (rect.y !== lastRepaintRect.y) {
+				style.top = rect.y + 'px';
+				lastRepaintRect.y = rect.y;
+			}
+
+			if (rect.w !== lastRepaintRect.w) {
+				style.width = (rect.w - borderW) + 'px';
+				lastRepaintRect.w = rect.w;
+			}
+
+			if (rect.h !== lastRepaintRect.h) {
+				style.height = (rect.h - borderH) + 'px';
+				lastRepaintRect.h = rect.h;
+			}
+
+			self._lastRepaintRect = lastRepaintRect;
+			self.fire('repaint', {}, false);
+
+			return self;
+		},
+
+		/**
+		 * Renders the control as a HTML string.
+		 *
+		 * @method renderHtml
+		 * @return {String} HTML representing the control.
+		 */
+		renderHtml: function() {
+			var self = this, id = self._id, settings = self.settings, value = self.encode(self._value, false), extraAttrs = '';
+
+			if ("spellcheck" in settings) {
+				extraAttrs += ' spellcheck="' + settings.spellcheck + '"';
+			}
+
+			if (settings.maxLength) {
+				extraAttrs += ' maxlength="' + settings.maxLength + '"';
+			}
+
+			if (settings.size) {
+				extraAttrs += ' size="' + settings.size + '"';
+			}
+
+			if (settings.subtype) {
+				extraAttrs += ' type="' + settings.subtype + '"';
+			}
+
+			if (self.disabled()) {
+				extraAttrs += ' disabled="disabled"';
+			}
+
+			if (settings.multiline) {
+				return (
+					'<textarea id="' + id + '" class="' + self.classes() + '" ' +
+					(settings.rows ? ' rows="' + settings.rows + '"' : '') +
+					' hidefocus="1"' + extraAttrs + '>' + value +
+					'</textarea>'
+				);
+			}
+
+			return '<input id="' + id + '" class="' + self.classes() + '" value="' + value + '" hidefocus="1"' + extraAttrs + ' />';
+		},
+
+		/**
+		 * Called after the control has been rendered.
+		 *
+		 * @method postRender
+		 */
+		postRender: function() {
+			var self = this;
+
+			DomUtils.on(self.getEl(), 'change', function(e) {
+				self.fire('change', e);
+			});
+
+			return self._super();
+		},
+
+		remove: function() {
+			DomUtils.off(this.getEl());
+			this._super();
+		}
+	});
+});
+
+// Included from: js/tinymce/classes/ui/Throbber.js
+
+/**
+ * Throbber.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class enables you to display a Throbber for any element.
+ *
+ * @-x-less Throbber.less
+ * @class tinymce.ui.Throbber
+ */
+define("tinymce/ui/Throbber", [
+	"tinymce/ui/DomUtils",
+	"tinymce/ui/Control"
+], function(DomUtils, Control) {
+	"use strict";
+
+	/**
+	 * Constructs a new throbber.
+	 *
+	 * @constructor
+	 * @param {Element} elm DOM Html element to display throbber in.
+	 * @param {Boolean} inline Optional true/false state if the throbber should be appended to end of element for infinite scroll.
+	 */
+	return function(elm, inline) {
+		var self = this, state, classPrefix = Control.classPrefix;
+
+		/**
+		 * Shows the throbber.
+		 *
+		 * @method show
+		 * @param {Number} [time] Time to wait before showing.
+		 * @return {tinymce.ui.Throbber} Current throbber instance.
+		 */
+		self.show = function(time) {
+			self.hide();
+
+			state = true;
+
+			window.setTimeout(function() {
+				if (state) {
+					elm.appendChild(DomUtils.createFragment(
+						'<div class="' + classPrefix + 'throbber' + (inline ? ' ' + classPrefix + 'throbber-inline' : '') + '"></div>'
+					));
+				}
+			}, time || 0);
+
+			return self;
+		};
+
+		/**
+		 * Hides the throbber.
+		 *
+		 * @method hide
+		 * @return {tinymce.ui.Throbber} Current throbber instance.
+		 */
+		self.hide = function() {
+			var child = elm.lastChild;
+
+			if (child && child.className.indexOf('throbber') != -1) {
+				child.parentNode.removeChild(child);
+			}
+
+			state = false;
+
+			return self;
+		};
+	};
+});
+
+expose(["tinymce/dom/EventUtils","tinymce/dom/Sizzle","tinymce/Env","tinymce/util/Tools","tinymce/dom/DomQuery","tinymce/html/Styles","tinymce/dom/TreeWalker","tinymce/dom/Range","tinymce/html/Entities","tinymce/dom/DOMUtils","tinymce/dom/ScriptLoader","tinymce/AddOnManager","tinymce/dom/RangeUtils","tinymce/html/Node","tinymce/html/Schema","tinymce/html/SaxParser","tinymce/html/DomParser","tinymce/html/Writer","tinymce/html/Serializer","tinymce/dom/Serializer","tinymce/dom/TridentSelection","tinymce/util/VK","tinymce/dom/ControlSelection","tinymce/dom/BookmarkManager","tinymce/dom/Selection","tinymce/dom/ElementUtils","tinymce/Formatter","tinymce/UndoManager","tinymce/EnterKey","tinymce/ForceBlocks","tinymce/EditorCommands","tinymce/util/URI","tinymce/util/Class","tinymce/util/EventDispatcher","tinymce/ui/Selector","tinymce/ui/Collection","tinymce/ui/DomUtils","tinymce/ui/Control","tinymce/ui/Factory","tinymce/ui/KeyboardNavigation","tinymce/ui/Container","tinymce/ui/DragHelper","tinymce/ui/Scrollable","tinymce/ui/Panel","tinymce/ui/Movable","tinymce/ui/Resizable","tinymce/ui/FloatPanel","tinymce/ui/Window","tinymce/ui/MessageBox","tinymce/WindowManager","tinymce/util/Quirks","tinymce/util/Observable","tinymce/EditorObservable","tinymce/Shortcuts","tinymce/Editor","tinymce/util/I18n","tinymce/FocusManager","tinymce/EditorManager","tinymce/LegacyInput","tinymce/util/XHR","tinymce/util/JSON","tinymce/util/JSONRequest","tinymce/util/JSONP","tinymce/util/LocalStorage","tinymce/Compat","tinymce/ui/Layout","tinymce/ui/AbsoluteLayout","tinymce/ui/Tooltip","tinymce/ui/Widget","tinymce/ui/Button","tinymce/ui/ButtonGroup","tinymce/ui/Checkbox","tinymce/ui/ComboBox","tinymce/ui/ColorBox","tinymce/ui/PanelButton","tinymce/ui/ColorButton","tinymce/util/Color","tinymce/ui/ColorPicker","tinymce/ui/Path","tinymce/ui/ElementPath","tinymce/ui/FormItem","tinymce/ui/Form","tinymce/ui/FieldSet","tinymce/ui/FilePicker","tinymce/ui/FitLayout","tinymce/ui/FlexLayout","tinymce/ui/FlowLayout","tinymce/ui/FormatControls","tinymce/ui/GridLayout","tinymce/ui/Iframe","tinymce/ui/Label","tinymce/ui/Toolbar","tinymce/ui/MenuBar","tinymce/ui/MenuButton","tinymce/ui/ListBox","tinymce/ui/MenuItem","tinymce/ui/Menu","tinymce/ui/Radio","tinymce/ui/ResizeHandle","tinymce/ui/Spacer","tinymce/ui/SplitButton","tinymce/ui/StackLayout","tinymce/ui/TabPanel","tinymce/ui/TextBox","tinymce/ui/Throbber"]);
+})(this);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/tinymce.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+(function(b,g){var d={};function c(m,n){var l,j=[];for(var k=0;k<m.length;++k){l=d[m[k]]||e(m[k]);if(!l){throw"module definition dependecy not found: "+m[k]}j.push(l)}n.apply(null,j)}function h(k,j,i){if(typeof k!=="string"){throw"invalid module definition, module id must be defined and be a string"}if(j===g){throw"invalid module definition, dependencies must be specified"}if(i===g){throw"invalid module definition, definition function must be specified"}c(j,function(){d[k]=i.apply(null,arguments)})}function f(i){return !!d[i]}function e(l){var j=b;var i=l.split(/[.\/]/);for(var k=0;k<i.length;++k){if(!j[i[k]]){return}j=j[i[k]]}return j}function a(l){for(var k=0;k<l.length;k++){var m=b;var o=l[k];var j=o.split(/[.\/]/);for(var n=0;n<j.length-1;++n){if(m[j[n]]===g){m[j[n]]={}}m=m[j[n]]}m[j[j.length-1]]=d[o]}}h("tinymce/dom/EventUtils",[],function(){var o="mce-data-";var k=/^(?:mouse|contextmenu)|click/;var j={keyLocation:1,layerX:1,layerY:1,returnValue:1};function l(s,r,t,q){if(s.addEventListener){s.addEventListener(r,t,q||false)}else{if(s.attachEvent){s.attachEvent("on"+r,t)}}}function n(s,r,t,q){if(s.removeEventListener){s.removeEventListener(r,t,q||false)}else{if(s.detachEvent){s.detachEvent("on"+r,t)}}}function i(s,w){var r,q=w||{},u;function t(){return false}function v(){return true}for(r in s){if(!j[r]){q[r]=s[r]}}if(!q.target){q.target=q.srcElement||document}if(s&&k.test(s.type)&&s.pageX===u&&s.clientX!==u){var z=q.target.ownerDocument||document;var y=z.documentElement;var x=z.body;q.pageX=s.clientX+(y&&y.scrollLeft||x&&x.scrollLeft||0)-(y&&y.clientLeft||x&&x.clientLeft||0);q.pageY=s.clientY+(y&&y.scrollTop||x&&x.scrollTop||0)-(y&&y.clientTop||x&&x.clientTop||0)}q.preventDefault=function(){q.isDefaultPrevented=v;if(s){if(s.preventDefault){s.preventDefault()}else{s.returnValue=false}}};q.stopPropagation=function(){q.isPropagationStopped=v;if(s){if(s.stopPropagation){s.stopPropagation()}else{s.cancelBubble=true}}};q.stopImmediatePropagation=function(){q.isImmediatePropagationStopped=v;q.stopPropagation()};if(!q.isDefaultPrevented){q.isDefaultPrevented=t;q.isPropagationStopped=t;q.isImmediatePropagationStopped=t}return q}function m(v,x,s){var u=v.document,t={type:"ready"};if(s.domLoaded){x(t);return}function r(){if(!s.domLoaded){s.domLoaded=true;x(t)}}function q(){if(u.readyState==="complete"||(u.readyState==="interactive"&&u.body)){n(u,"readystatechange",q);r()}}function w(){try{u.documentElement.doScroll("left")}catch(y){setTimeout(w,0);return}r()}if(u.addEventListener){if(u.readyState==="complete"){r()}else{l(v,"DOMContentLoaded",r)}}else{l(u,"readystatechange",q);if(u.documentElement.doScroll&&v.self===v.top){w()}}l(v,"load",r)}function p(){var q=this,s={},u,x,r,t,w;x=o+(+new Date()).toString(32);t="onmouseenter" in document.documentElement;r="onfocusin" in document.documentElement;w={mouseenter:"mouseover",mouseleave:"mouseout"};u=1;q.domLoaded=false;q.events=s;function v(B,E){var A,C,z,D,y=s[E];A=y&&y[B.type];if(A){for(C=0,z=A.length;C<z;C++){D=A[C];if(D&&D.func.call(D.scope,B)===false){B.preventDefault()}if(B.isImmediatePropagationStopped()){return}}}}q.bind=function(D,G,J,K){var z,A,B,y,H,F,I,C=window;function E(L){v(i(L||C.event),z)}if(!D||D.nodeType===3||D.nodeType===8){return}if(!D[x]){z=u++;D[x]=z;s[z]={}}else{z=D[x]}K=K||D;G=G.split(" ");B=G.length;while(B--){y=G[B];F=E;H=I=false;if(y==="DOMContentLoaded"){y="ready"}if(q.domLoaded&&y==="ready"&&D.readyState=="complete"){J.call(K,i({type:y}));continue}if(!t){H=w[y];if(H){F=function(L){var N,M;N=L.currentTarget;M=L.relatedTarget;if(M&&N.contains){M=N.contains(M)}else{while(M&&M!==N){M=M.parentNode}}if(!M){L=i(L||C.event);L.type=L.type==="mouseout"?"mouseleave":"mouseenter";L.target=N;v(L,z)}}}}if(!r&&(y==="focusin"||y==="focusout")){I=true;H=y==="focusin"?"focus":"blur";F=function(L){L=i(L||C.event);L.type=L.type==="focus"?"focusin":"focusout";v(L,z)}}A=s[z][y];if(!A){s[z][y]=A=[{func:J,scope:K}];A.fakeName=H;A.capture=I;A.nativeHandler=F;if(y==="ready"){m(D,F,q)}else{l(D,H||y,F,I)}}else{if(y==="ready"&&q.domLoaded){J({type:y})}else{A.push({func:J,scope:K})}}}D=A=0;return J};q.unbind=function(D,G,J){var z,B,C,K,y,A;if(!D||D.nodeType===3||D.nodeType===8){return q}z=D[x];if(z){A=s[z];if(G){G=G.split(" ");C=G.length;while(C--){y=G[C];B=A[y];if(B){if(J){K=B.length;while(K--){if(B[K].func===J){var F=B.nativeHandler;var H=B.fakeName,I=B.capture;B=B.slice(0,K).concat(B.slice(K+1));B.nativeHandler=F;B.fakeName=H;B.capture=I;A[y]=B}}}if(!J||B.length===0){delete A[y];n(D,B.fakeName||y,B.nativeHandler,B.capture)}}}}else{for(y in A){B=A[y];n(D,B.fakeName||y,B.nativeHandler,B.capture)}A={}}for(y in A){return q}delete s[z];try{delete D[x]}catch(E){D[x]=null}}return q};q.fire=function(A,z,y){var B;if(!A||A.nodeType===3||A.nodeType===8){return q}y=i(null,y);y.type=z;y.target=A;do{B=A[x];if(B){v(y,B)}A=A.parentNode||A.ownerDocument||A.defaultView||A.parentWindow}while(A&&!y.isPropagationStopped());return q};q.clean=function(B){var z,y,A=q.unbind;if(!B||B.nodeType===3||B.nodeType===8){return q}if(B[x]){A(B)}if(!B.getElementsByTagName){B=B.document}if(B&&B.getElementsByTagName){A(B);y=B.getElementsByTagName("*");z=y.length;while(z--){B=y[z];if(B[x]){A(B)}}}return q};q.destroy=function(){s={}};q.cancel=function(y){if(y){y.preventDefault();y.stopImmediatePropagation()}return false}}p.Event=new p();p.Event.bind(window,"ready",function(){});return p});h("tinymce/dom/Sizzle",[],function(){var J,aD,z,S,V,t,ah,aC,aH,T,ai,ak,N,A,au,ao,aB,q,Q,aw="sizzle"+-(new Date()),U=window.document,aE=0,ap=0,l=L(),av=L(),R=L(),P=function(aI,i){if(aI===i){ai=true}return 0},aA=typeof g,ab=1<<31,Z=({}).hasOwnProperty,ay=[],az=ay.pop,X=ay.push,j=ay.push,y=ay.slice,p=ay.indexOf||function(aK){var aJ=0,aI=this.length;for(;aJ<aI;aJ++){if(this[aJ]===aK){return aJ}}return -1},k="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",B="[\\x20\\t\\r\\n\\f]",W="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ar="\\["+B+"*("+W+")(?:"+B+"*([*^$|!~]?=)"+B+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+W+"))|)"+B+"*\\]",w=":("+W+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ar+")*)|.*)\\)|)",D=new RegExp("^"+B+"+|((?:^|[^\\\\])(?:\\\\.)*)"+B+"+$","g"),G=new RegExp("^"+B+"*,"+B+"*"),M=new RegExp("^"+B+"*([>+~]|"+B+")"+B+"*"),F=new RegExp("="+B+"*([^\\]'\"]*?)"+B+"*\\]","g"),ad=new RegExp(w),af=new RegExp("^"+W+"$"),an={ID:new RegExp("^#("+W+")"),CLASS:new RegExp("^\\.("+W+")"),TAG:new RegExp("^("+W+"|[*])"),ATTR:new RegExp("^"+ar),PSEUDO:new RegExp("^"+w),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+B+"*(even|odd|(([+-]|)(\\d*)n|)"+B+"*(?:([+-]|)"+B+"*(\\d+)|))"+B+"*\\)|)","i"),bool:new RegExp("^(?:"+k+")$","i"),needsContext:new RegExp("^"+B+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+B+"*((?:-\\d)?\\d*)"+B+"*\\)|)(?=[^-]|$)","i")},o=/^(?:input|select|textarea|button)$/i,x=/^h\d$/i,aa=/^[^{]+\{\s*\[native \w/,ac=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,am=/[+~]/,Y=/'|\\/g,E=new RegExp("\\\\([\\da-f]{1,6}"+B+"?|("+B+")|.)","ig"),aq=function(i,aK,aI){var aJ="0x"+aK-65536;return aJ!==aJ||aI?aK:aJ<0?String.fromCharCode(aJ+65536):String.fromCharCode(aJ>>10|55296,aJ&1023|56320)};try{j.apply((ay=y.call(U.childNodes)),U.childNodes);ay[U.childNodes.length].nodeType}catch(O){j={apply:ay.length?function(aI,i){X.apply(aI,y.call(i))}:function(aL,aK){var aI=aL.length,aJ=0;while((aL[aI++]=aK[aJ++])){}aL.length=aI-1}}}function H(aQ,aJ,aU,aW){var aV,aN,aO,aS,aT,aM,aL,aI,aK,aR;if((aJ?aJ.ownerDocument||aJ:U)!==N){ak(aJ)}aJ=aJ||N;aU=aU||[];if(!aQ||typeof aQ!=="string"){return aU}if((aS=aJ.nodeType)!==1&&aS!==9){return[]}if(au&&!aW){if((aV=ac.exec(aQ))){if((aO=aV[1])){if(aS===9){aN=aJ.getElementById(aO);if(aN&&aN.parentNode){if(aN.id===aO){aU.push(aN);return aU}}else{return aU}}else{if(aJ.ownerDocument&&(aN=aJ.ownerDocument.getElementById(aO))&&Q(aJ,aN)&&aN.id===aO){aU.push(aN);return aU}}}else{if(aV[2]){j.apply(aU,aJ.getElementsByTagName(aQ));return aU}else{if((aO=aV[3])&&aD.getElementsByClassName){j.apply(aU,aJ.getElementsByClassName(aO));return aU}}}}if(aD.qsa&&(!ao||!ao.test(aQ))){aI=aL=aw;aK=aJ;aR=aS===9&&aQ;if(aS===1&&aJ.nodeName.toLowerCase()!=="object"){aM=t(aQ);if((aL=aJ.getAttribute("id"))){aI=aL.replace(Y,"\\$&")}else{aJ.setAttribute("id",aI)}aI="[id='"+aI+"'] ";aT=aM.length;while(aT--){aM[aT]=aI+u(aM[aT])}aK=am.test(aQ)&&ae(aJ.parentNode)||aJ;aR=aM.join(",")}if(aR){try{j.apply(aU,aK.querySelectorAll(aR));return aU}catch(aP){}finally{if(!aL){aJ.removeAttribute("id")}}}}}return aC(aQ.replace(D,"$1"),aJ,aU,aW)}function L(){var aI=[];function i(aJ,aK){if(aI.push(aJ+" ")>z.cacheLength){delete i[aI.shift()]}return(i[aJ+" "]=aK)}return i}function v(i){i[aw]=true;return i}function r(i){var aJ=N.createElement("div");try{return !!i(aJ)}catch(aI){return false}finally{if(aJ.parentNode){aJ.parentNode.removeChild(aJ)}aJ=null}}function aF(aJ,aL){var aI=aJ.split("|"),aK=aJ.length;while(aK--){z.attrHandle[aI[aK]]=aL}}function m(aI,i){var aK=i&&aI,aJ=aK&&aI.nodeType===1&&i.nodeType===1&&(~i.sourceIndex||ab)-(~aI.sourceIndex||ab);if(aJ){return aJ}if(aK){while((aK=aK.nextSibling)){if(aK===i){return -1}}}return aI?1:-1}function I(i){return function(aJ){var aI=aJ.nodeName.toLowerCase();return aI==="input"&&aJ.type===i}}function n(i){return function(aJ){var aI=aJ.nodeName.toLowerCase();return(aI==="input"||aI==="button")&&aJ.type===i}}function at(i){return v(function(aI){aI=+aI;return v(function(aJ,aN){var aL,aK=i([],aJ.length,aI),aM=aK.length;while(aM--){if(aJ[(aL=aK[aM])]){aJ[aL]=!(aN[aL]=aJ[aL])}}})})}function ae(i){return i&&typeof i.getElementsByTagName!==aA&&i}aD=H.support={};V=H.isXML=function(i){var aI=i&&(i.ownerDocument||i).documentElement;return aI?aI.nodeName!=="HTML":false};ak=H.setDocument=function(aJ){var i,aK=aJ?aJ.ownerDocument||aJ:U,aI=aK.defaultView;if(aK===N||aK.nodeType!==9||!aK.documentElement){return N}N=aK;A=aK.documentElement;au=!V(aK);if(aI&&aI!==aI.top){if(aI.addEventListener){aI.addEventListener("unload",function(){ak()},false)}else{if(aI.attachEvent){aI.attachEvent("onunload",function(){ak()})}}}aD.attributes=r(function(aL){aL.className="i";return !aL.getAttribute("className")});aD.getElementsByTagName=r(function(aL){aL.appendChild(aK.createComment(""));return !aL.getElementsByTagName("*").length});aD.getElementsByClassName=aa.test(aK.getElementsByClassName);aD.getById=r(function(aL){A.appendChild(aL).id=aw;return !aK.getElementsByName||!aK.getElementsByName(aw).length});if(aD.getById){z.find.ID=function(aN,aM){if(typeof aM.getElementById!==aA&&au){var aL=aM.getElementById(aN);return aL&&aL.parentNode?[aL]:[]}};z.filter.ID=function(aM){var aL=aM.replace(E,aq);return function(aN){return aN.getAttribute("id")===aL}}}else{delete z.find.ID;z.filter.ID=function(aM){var aL=aM.replace(E,aq);return function(aO){var aN=typeof aO.getAttributeNode!==aA&&aO.getAttributeNode("id");return aN&&aN.value===aL}}}z.find.TAG=aD.getElementsByTagName?function(aL,aM){if(typeof aM.getElementsByTagName!==aA){return aM.getElementsByTagName(aL)}}:function(aL,aP){var aQ,aO=[],aN=0,aM=aP.getElementsByTagName(aL);if(aL==="*"){while((aQ=aM[aN++])){if(aQ.nodeType===1){aO.push(aQ)}}return aO}return aM};z.find.CLASS=aD.getElementsByClassName&&function(aM,aL){if(au){return aL.getElementsByClassName(aM)}};aB=[];ao=[];if((aD.qsa=aa.test(aK.querySelectorAll))){r(function(aL){aL.innerHTML="<select msallowcapture=''><option selected=''></option></select>";if(aL.querySelectorAll("[msallowcapture^='']").length){ao.push("[*^$]="+B+"*(?:''|\"\")")}if(!aL.querySelectorAll("[selected]").length){ao.push("\\["+B+"*(?:value|"+k+")")}if(!aL.querySelectorAll(":checked").length){ao.push(":checked")}});r(function(aM){var aL=aK.createElement("input");aL.setAttribute("type","hidden");aM.appendChild(aL).setAttribute("name","D");if(aM.querySelectorAll("[name=d]").length){ao.push("name"+B+"*[*^$|!~]?=")}if(!aM.querySelectorAll(":enabled").length){ao.push(":enabled",":disabled")}aM.querySelectorAll("*,:x");ao.push(",.*:")})}if((aD.matchesSelector=aa.test((q=A.matches||A.webkitMatchesSelector||A.mozMatchesSelector||A.oMatchesSelector||A.msMatchesSelector)))){r(function(aL){aD.disconnectedMatch=q.call(aL,"div");q.call(aL,"[s!='']:x");aB.push("!=",w)})}ao=ao.length&&new RegExp(ao.join("|"));aB=aB.length&&new RegExp(aB.join("|"));i=aa.test(A.compareDocumentPosition);Q=i||aa.test(A.contains)?function(aM,aL){var aO=aM.nodeType===9?aM.documentElement:aM,aN=aL&&aL.parentNode;return aM===aN||!!(aN&&aN.nodeType===1&&(aO.contains?aO.contains(aN):aM.compareDocumentPosition&&aM.compareDocumentPosition(aN)&16))}:function(aM,aL){if(aL){while((aL=aL.parentNode)){if(aL===aM){return true}}}return false};P=i?function(aM,aL){if(aM===aL){ai=true;return 0}var aN=!aM.compareDocumentPosition-!aL.compareDocumentPosition;if(aN){return aN}aN=(aM.ownerDocument||aM)===(aL.ownerDocument||aL)?aM.compareDocumentPosition(aL):1;if(aN&1||(!aD.sortDetached&&aL.compareDocumentPosition(aM)===aN)){if(aM===aK||aM.ownerDocument===U&&Q(U,aM)){return -1}if(aL===aK||aL.ownerDocument===U&&Q(U,aL)){return 1}return T?(p.call(T,aM)-p.call(T,aL)):0}return aN&4?-1:1}:function(aM,aL){if(aM===aL){ai=true;return 0}var aS,aP=0,aR=aM.parentNode,aO=aL.parentNode,aN=[aM],aQ=[aL];if(!aR||!aO){return aM===aK?-1:aL===aK?1:aR?-1:aO?1:T?(p.call(T,aM)-p.call(T,aL)):0}else{if(aR===aO){return m(aM,aL)}}aS=aM;while((aS=aS.parentNode)){aN.unshift(aS)}aS=aL;while((aS=aS.parentNode)){aQ.unshift(aS)}while(aN[aP]===aQ[aP]){aP++}return aP?m(aN[aP],aQ[aP]):aN[aP]===U?-1:aQ[aP]===U?1:0};return aK};H.matches=function(aI,i){return H(aI,null,null,i)};H.matchesSelector=function(aI,aK){if((aI.ownerDocument||aI)!==N){ak(aI)}aK=aK.replace(F,"='$1']");if(aD.matchesSelector&&au&&(!aB||!aB.test(aK))&&(!ao||!ao.test(aK))){try{var i=q.call(aI,aK);if(i||aD.disconnectedMatch||aI.document&&aI.document.nodeType!==11){return i}}catch(aJ){}}return H(aK,N,null,[aI]).length>0};H.contains=function(i,aI){if((i.ownerDocument||i)!==N){ak(i)}return Q(i,aI)};H.attr=function(aJ,i){if((aJ.ownerDocument||aJ)!==N){ak(aJ)}var aI=z.attrHandle[i.toLowerCase()],aK=aI&&Z.call(z.attrHandle,i.toLowerCase())?aI(aJ,i,!au):g;return aK!==g?aK:aD.attributes||!au?aJ.getAttribute(i):(aK=aJ.getAttributeNode(i))&&aK.specified?aK.value:null};H.error=function(i){throw new Error("Syntax error, unrecognized expression: "+i)};H.uniqueSort=function(aK){var aL,aM=[],aI=0,aJ=0;ai=!aD.detectDuplicates;T=!aD.sortStable&&aK.slice(0);aK.sort(P);if(ai){while((aL=aK[aJ++])){if(aL===aK[aJ]){aI=aM.push(aJ)}}while(aI--){aK.splice(aM[aI],1)}}T=null;return aK};S=H.getText=function(aM){var aL,aJ="",aK=0,aI=aM.nodeType;if(!aI){while((aL=aM[aK++])){aJ+=S(aL)}}else{if(aI===1||aI===9||aI===11){if(typeof aM.textContent==="string"){return aM.textContent}else{for(aM=aM.firstChild;aM;aM=aM.nextSibling){aJ+=S(aM)}}}else{if(aI===3||aI===4){return aM.nodeValue}}}return aJ};z=H.selectors={cacheLength:50,createPseudo:v,match:an,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:true}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:true},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(i){i[1]=i[1].replace(E,aq);i[3]=(i[3]||i[4]||i[5]||"").replace(E,aq);if(i[2]==="~="){i[3]=" "+i[3]+" "}return i.slice(0,4)},CHILD:function(i){i[1]=i[1].toLowerCase();if(i[1].slice(0,3)==="nth"){if(!i[3]){H.error(i[0])}i[4]=+(i[4]?i[5]+(i[6]||1):2*(i[3]==="even"||i[3]==="odd"));i[5]=+((i[7]+i[8])||i[3]==="odd")}else{if(i[3]){H.error(i[0])}}return i},PSEUDO:function(aI){var i,aJ=!aI[6]&&aI[2];if(an.CHILD.test(aI[0])){return null}if(aI[3]){aI[2]=aI[4]||aI[5]||""}else{if(aJ&&ad.test(aJ)&&(i=t(aJ,true))&&(i=aJ.indexOf(")",aJ.length-i)-aJ.length)){aI[0]=aI[0].slice(0,i);aI[2]=aJ.slice(0,i)}}return aI.slice(0,3)}},filter:{TAG:function(aI){var i=aI.replace(E,aq).toLowerCase();return aI==="*"?function(){return true}:function(aJ){return aJ.nodeName&&aJ.nodeName.toLowerCase()===i}},CLASS:function(i){var aI=l[i+" "];return aI||(aI=new RegExp("(^|"+B+")"+i+"("+B+"|$)"))&&l(i,function(aJ){return aI.test(typeof aJ.className==="string"&&aJ.className||typeof aJ.getAttribute!==aA&&aJ.getAttribute("class")||"")})},ATTR:function(aJ,aI,i){return function(aL){var aK=H.attr(aL,aJ);if(aK==null){return aI==="!="}if(!aI){return true}aK+="";return aI==="="?aK===i:aI==="!="?aK!==i:aI==="^="?i&&aK.indexOf(i)===0:aI==="*="?i&&aK.indexOf(i)>-1:aI==="$="?i&&aK.slice(-i.length)===i:aI==="~="?(" "+aK+" ").indexOf(i)>-1:aI==="|="?aK===i||aK.slice(0,i.length+1)===i+"-":false}},CHILD:function(aI,aL,aK,aM,aJ){var aO=aI.slice(0,3)!=="nth",i=aI.slice(-4)!=="last",aN=aL==="of-type";return aM===1&&aJ===0?function(aP){return !!aP.parentNode}:function(aV,aT,aY){var aP,a1,aW,a0,aX,aS,aU=aO!==i?"nextSibling":"previousSibling",aZ=aV.parentNode,aR=aN&&aV.nodeName.toLowerCase(),aQ=!aY&&!aN;if(aZ){if(aO){while(aU){aW=aV;while((aW=aW[aU])){if(aN?aW.nodeName.toLowerCase()===aR:aW.nodeType===1){return false}}aS=aU=aI==="only"&&!aS&&"nextSibling"}return true}aS=[i?aZ.firstChild:aZ.lastChild];if(i&&aQ){a1=aZ[aw]||(aZ[aw]={});aP=a1[aI]||[];aX=aP[0]===aE&&aP[1];a0=aP[0]===aE&&aP[2];aW=aX&&aZ.childNodes[aX];while((aW=++aX&&aW&&aW[aU]||(a0=aX=0)||aS.pop())){if(aW.nodeType===1&&++a0&&aW===aV){a1[aI]=[aE,aX,a0];break}}}else{if(aQ&&(aP=(aV[aw]||(aV[aw]={}))[aI])&&aP[0]===aE){a0=aP[1]}else{while((aW=++aX&&aW&&aW[aU]||(a0=aX=0)||aS.pop())){if((aN?aW.nodeName.toLowerCase()===aR:aW.nodeType===1)&&++a0){if(aQ){(aW[aw]||(aW[aw]={}))[aI]=[aE,a0]}if(aW===aV){break}}}}}a0-=aJ;return a0===aM||(a0%aM===0&&a0/aM>=0)}}},PSEUDO:function(aK,aJ){var i,aI=z.pseudos[aK]||z.setFilters[aK.toLowerCase()]||H.error("unsupported pseudo: "+aK);if(aI[aw]){return aI(aJ)}if(aI.length>1){i=[aK,aK,"",aJ];return z.setFilters.hasOwnProperty(aK.toLowerCase())?v(function(aN,aP){var aM,aL=aI(aN,aJ),aO=aL.length;while(aO--){aM=p.call(aN,aL[aO]);aN[aM]=!(aP[aM]=aL[aO])}}):function(aL){return aI(aL,0,i)}}return aI}},pseudos:{not:v(function(i){var aI=[],aJ=[],aK=ah(i.replace(D,"$1"));return aK[aw]?v(function(aM,aR,aP,aN){var aQ,aL=aK(aM,null,aN,[]),aO=aM.length;while(aO--){if((aQ=aL[aO])){aM[aO]=!(aR[aO]=aQ)}}}):function(aN,aM,aL){aI[0]=aN;aK(aI,null,aL,aJ);return !aJ.pop()}}),has:v(function(i){return function(aI){return H(i,aI).length>0}}),contains:v(function(i){i=i.replace(E,aq);return function(aI){return(aI.textContent||aI.innerText||S(aI)).indexOf(i)>-1}}),lang:v(function(i){if(!af.test(i||"")){H.error("unsupported lang: "+i)}i=i.replace(E,aq).toLowerCase();return function(aJ){var aI;do{if((aI=au?aJ.lang:aJ.getAttribute("xml:lang")||aJ.getAttribute("lang"))){aI=aI.toLowerCase();return aI===i||aI.indexOf(i+"-")===0}}while((aJ=aJ.parentNode)&&aJ.nodeType===1);return false}}),target:function(i){var aI=window.location&&window.location.hash;return aI&&aI.slice(1)===i.id},root:function(i){return i===A},focus:function(i){return i===N.activeElement&&(!N.hasFocus||N.hasFocus())&&!!(i.type||i.href||~i.tabIndex)},enabled:function(i){return i.disabled===false},disabled:function(i){return i.disabled===true},checked:function(i){var aI=i.nodeName.toLowerCase();return(aI==="input"&&!!i.checked)||(aI==="option"&&!!i.selected)},selected:function(i){if(i.parentNode){i.parentNode.selectedIndex}return i.selected===true},empty:function(i){for(i=i.firstChild;i;i=i.nextSibling){if(i.nodeType<6){return false}}return true},parent:function(i){return !z.pseudos.empty(i)},header:function(i){return x.test(i.nodeName)},input:function(i){return o.test(i.nodeName)},button:function(aI){var i=aI.nodeName.toLowerCase();return i==="input"&&aI.type==="button"||i==="button"},text:function(aI){var i;return aI.nodeName.toLowerCase()==="input"&&aI.type==="text"&&((i=aI.getAttribute("type"))==null||i.toLowerCase()==="text")},first:at(function(){return[0]}),last:at(function(i,aI){return[aI-1]}),eq:at(function(i,aJ,aI){return[aI<0?aI+aJ:aI]}),even:at(function(aI,aK){var aJ=0;for(;aJ<aK;aJ+=2){aI.push(aJ)}return aI}),odd:at(function(aI,aK){var aJ=1;for(;aJ<aK;aJ+=2){aI.push(aJ)}return aI}),lt:at(function(aI,aL,aK){var aJ=aK<0?aK+aL:aK;for(;--aJ>=0;){aI.push(aJ)}return aI}),gt:at(function(aI,aL,aK){var aJ=aK<0?aK+aL:aK;for(;++aJ<aL;){aI.push(aJ)}return aI})}};z.pseudos.nth=z.pseudos.eq;for(J in {radio:true,checkbox:true,file:true,password:true,image:true}){z.pseudos[J]=I(J)}for(J in {submit:true,reset:true}){z.pseudos[J]=n(J)}function ag(){}ag.prototype=z.filters=z.pseudos;z.setFilters=new ag();t=H.tokenize=function(aL,aQ){var aI,aM,aO,aP,aN,aJ,i,aK=av[aL+" "];if(aK){return aQ?0:aK.slice(0)}aN=aL;aJ=[];i=z.preFilter;while(aN){if(!aI||(aM=G.exec(aN))){if(aM){aN=aN.slice(aM[0].length)||aN}aJ.push((aO=[]))}aI=false;if((aM=M.exec(aN))){aI=aM.shift();aO.push({value:aI,type:aM[0].replace(D," ")});aN=aN.slice(aI.length)}for(aP in z.filter){if((aM=an[aP].exec(aN))&&(!i[aP]||(aM=i[aP](aM)))){aI=aM.shift();aO.push({value:aI,type:aP,matches:aM});aN=aN.slice(aI.length)}}if(!aI){break}}return aQ?aN.length:aN?H.error(aL):av(aL,aJ).slice(0)};function u(aL){var aK=0,aJ=aL.length,aI="";for(;aK<aJ;aK++){aI+=aL[aK].value}return aI}function C(aL,aJ,aK){var i=aJ.dir,aM=aK&&i==="parentNode",aI=ap++;return aJ.first?function(aP,aO,aN){while((aP=aP[i])){if(aP.nodeType===1||aM){return aL(aP,aO,aN)}}}:function(aR,aP,aO){var aS,aQ,aN=[aE,aI];if(aO){while((aR=aR[i])){if(aR.nodeType===1||aM){if(aL(aR,aP,aO)){return true}}}}else{while((aR=aR[i])){if(aR.nodeType===1||aM){aQ=aR[aw]||(aR[aw]={});if((aS=aQ[i])&&aS[0]===aE&&aS[1]===aI){return(aN[2]=aS[2])}else{aQ[i]=aN;if((aN[2]=aL(aR,aP,aO))){return true}}}}}}}function aG(i){return i.length>1?function(aL,aK,aI){var aJ=i.length;while(aJ--){if(!i[aJ](aL,aK,aI)){return false}}return true}:i[0]}function K(aJ,aM,aL){var aK=0,aI=aM.length;for(;aK<aI;aK++){H(aJ,aM[aK],aL)}return aL}function al(aI,aJ,aK,aL,aO){var aM,aR=[],aN=0,aP=aI.length,aQ=aJ!=null;for(;aN<aP;aN++){if((aM=aI[aN])){if(!aK||aK(aM,aL,aO)){aR.push(aM);if(aQ){aJ.push(aN)}}}}return aR}function s(aJ,aI,aL,aK,aM,i){if(aK&&!aK[aw]){aK=s(aK)}if(aM&&!aM[aw]){aM=s(aM,i)}return v(function(aX,aU,aP,aW){var aZ,aV,aR,aQ=[],aY=[],aO=aU.length,aN=aX||K(aI||"*",aP.nodeType?[aP]:aP,[]),aS=aJ&&(aX||!aI)?al(aN,aQ,aJ,aP,aW):aN,aT=aL?aM||(aX?aJ:aO||aK)?[]:aU:aS;if(aL){aL(aS,aT,aP,aW)}if(aK){aZ=al(aT,aY);aK(aZ,[],aP,aW);aV=aZ.length;while(aV--){if((aR=aZ[aV])){aT[aY[aV]]=!(aS[aY[aV]]=aR)}}}if(aX){if(aM||aJ){if(aM){aZ=[];aV=aT.length;while(aV--){if((aR=aT[aV])){aZ.push((aS[aV]=aR))}}aM(null,(aT=[]),aZ,aW)}aV=aT.length;while(aV--){if((aR=aT[aV])&&(aZ=aM?p.call(aX,aR):aQ[aV])>-1){aX[aZ]=!(aU[aZ]=aR)}}}}else{aT=al(aT===aU?aT.splice(aO,aT.length):aT);if(aM){aM(null,aU,aT,aW)}else{j.apply(aU,aT)}}})}function ax(aO){var aJ,aM,aK,aN=aO.length,aR=z.relative[aO[0].type],aS=aR||z.relative[" "],aL=aR?1:0,aP=C(function(i){return i===aJ},aS,true),aQ=C(function(i){return p.call(aJ,i)>-1},aS,true),aI=[function(aU,aT,i){return(!aR&&(i||aT!==aH))||((aJ=aT).nodeType?aP(aU,aT,i):aQ(aU,aT,i))}];for(;aL<aN;aL++){if((aM=z.relative[aO[aL].type])){aI=[C(aG(aI),aM)]}else{aM=z.filter[aO[aL].type].apply(null,aO[aL].matches);if(aM[aw]){aK=++aL;for(;aK<aN;aK++){if(z.relative[aO[aK].type]){break}}return s(aL>1&&aG(aI),aL>1&&u(aO.slice(0,aL-1).concat({value:aO[aL-2].type===" "?"*":""})).replace(D,"$1"),aM,aL<aK&&ax(aO.slice(aL,aK)),aK<aN&&ax((aO=aO.slice(aK))),aK<aN&&u(aO))}aI.push(aM)}}return aG(aI)}function aj(aK,aJ){var i=aJ.length>0,aL=aK.length>0,aI=function(aV,aP,aU,aT,aY){var aQ,aR,aW,a0=0,aS="0",aM=aV&&[],a1=[],aZ=aH,aO=aV||aL&&z.find.TAG("*",aY),aN=(aE+=aZ==null?1:Math.random()||0.1),aX=aO.length;if(aY){aH=aP!==N&&aP}for(;aS!==aX&&(aQ=aO[aS])!=null;aS++){if(aL&&aQ){aR=0;while((aW=aK[aR++])){if(aW(aQ,aP,aU)){aT.push(aQ);break}}if(aY){aE=aN}}if(i){if((aQ=!aW&&aQ)){a0--}if(aV){aM.push(aQ)}}}a0+=aS;if(i&&aS!==a0){aR=0;while((aW=aJ[aR++])){aW(aM,a1,aP,aU)}if(aV){if(a0>0){while(aS--){if(!(aM[aS]||a1[aS])){a1[aS]=az.call(aT)}}}a1=al(a1)}j.apply(aT,a1);if(aY&&!aV&&a1.length>0&&(a0+aJ.length)>1){H.uniqueSort(aT)}}if(aY){aE=aN;aH=aZ}return aM};return i?v(aI):aI}ah=H.compile=function(aI,aK){var aL,aJ=[],aN=[],aM=R[aI+" "];if(!aM){if(!aK){aK=t(aI)}aL=aK.length;while(aL--){aM=ax(aK[aL]);if(aM[aw]){aJ.push(aM)}else{aN.push(aM)}}aM=R(aI,aj(aN,aJ));aM.selector=aI}return aM};aC=H.select=function(aK,aI,aL,aO){var aM,aR,aJ,aS,aP,aQ=typeof aK==="function"&&aK,aN=!aO&&t((aK=aQ.selector||aK));aL=aL||[];if(aN.length===1){aR=aN[0]=aN[0].slice(0);if(aR.length>2&&(aJ=aR[0]).type==="ID"&&aD.getById&&aI.nodeType===9&&au&&z.relative[aR[1].type]){aI=(z.find.ID(aJ.matches[0].replace(E,aq),aI)||[])[0];if(!aI){return aL}else{if(aQ){aI=aI.parentNode}}aK=aK.slice(aR.shift().value.length)}aM=an.needsContext.test(aK)?0:aR.length;while(aM--){aJ=aR[aM];if(z.relative[(aS=aJ.type)]){break}if((aP=z.find[aS])){if((aO=aP(aJ.matches[0].replace(E,aq),am.test(aR[0].type)&&ae(aI.parentNode)||aI))){aR.splice(aM,1);aK=aO.length&&u(aR);if(!aK){j.apply(aL,aO);return aL}break}}}}(aQ||ah(aK,aN))(aO,aI,!au,aL,am.test(aK)&&ae(aI.parentNode)||aI);return aL};aD.sortStable=aw.split("").sort(P).join("")===aw;aD.detectDuplicates=!!ai;ak();aD.sortDetached=r(function(i){return i.compareDocumentPosition(N.createElement("div"))&1});if(!r(function(i){i.innerHTML="<a href='#'></a>";return i.firstChild.getAttribute("href")==="#"})){aF("type|href|height|width",function(aI,i,aJ){if(!aJ){return aI.getAttribute(i,i.toLowerCase()==="type"?1:2)}})}if(!aD.attributes||!r(function(i){i.innerHTML="<input/>";i.firstChild.setAttribute("value","");return i.firstChild.getAttribute("value")===""})){aF("value",function(aI,i,aJ){if(!aJ&&aI.nodeName.toLowerCase()==="input"){return aI.defaultValue}})}if(!r(function(i){return i.getAttribute("disabled")==null})){aF(k,function(aI,i,aK){var aJ;if(!aK){return aI[i]===true?i.toLowerCase():(aJ=aI.getAttributeNode(i))&&aJ.specified?aJ.value:null}})}return H});h("tinymce/Env",[],function(){var i=navigator,t=i.userAgent;var m,s,j,p,o,l,r,n,k;m=window.opera&&window.opera.buildNumber;k=/Android/.test(t);s=/WebKit/.test(t);j=!s&&!m&&(/MSIE/gi).test(t)&&(/Explorer/gi).test(i.appName);j=j&&/MSIE (\w+)\./.exec(t)[1];p=t.indexOf("Trident/")!=-1&&(t.indexOf("rv:")!=-1||i.appName.indexOf("Netscape")!=-1)?11:false;o=(document.msElementsFromPoint&&!j&&!p)?12:false;j=j||p||o;l=!s&&!p&&/Gecko/.test(t);r=t.indexOf("Mac")!=-1;n=/(iPad|iPhone)/.test(t);if(o){s=false}var q=!n||t.match(/AppleWebKit\/(\d*)/)[1]>=534;return{opera:m,webkit:s,ie:j,gecko:l,mac:r,iOS:n,android:k,contentEditable:q,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:j!=8,range:window.getSelection&&"Range" in window,documentMode:j&&!o?(document.documentMode||7):10}});h("tinymce/util/Tools",["tinymce/Env"],function(i){var z=/^\s*|\s*$/g;function u(A){return(A===null||A===g)?"":(""+A).replace(z,"")}var o=Array.isArray||function(A){return Object.prototype.toString.call(A)==="[object Array]"};function m(B,A){if(!A){return B!==g}if(A=="array"&&o(B)){return true}return typeof B==A}function s(C){var D=C,B,A;if(!o(C)){D=[];for(B=0,A=C.length;B<A;B++){D[B]=C[B]}}return D}function q(A,D,C){var B;A=A||[];D=D||",";if(typeof A=="string"){A=A.split(D)}C=C||{};B=A.length;while(B--){C[A[B]]={}}return C}function k(D,A,C){var E,B;if(!D){return 0}C=C||D;if(D.length!==g){for(E=0,B=D.length;E<B;E++){if(A.call(C,D[E],E,D)===false){return 0}}}else{for(E in D){if(D.hasOwnProperty(E)){if(A.call(C,D[E],E,D)===false){return 0}}}}return 1}function y(C,B){var A=[];k(C,function(D){A.push(B(D))});return A}function n(A,B){var C=[];k(A,function(D){if(!B||B(D)){C.push(D)}});return C}function p(J,A,E){var I=this,B,D,F,G,C,H=0;J=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(J);F=J[3].match(/(^|\.)(\w+)$/i)[2];D=I.createNS(J[3].replace(/\.\w+$/,""),E);if(D[F]){return}if(J[2]=="static"){D[F]=A;if(this.onCreate){this.onCreate(J[2],J[3],D[F])}return}if(!A[F]){A[F]=function(){};H=1}D[F]=A[F];I.extend(D[F].prototype,A);if(J[5]){B=I.resolve(J[5]).prototype;G=J[5].match(/\.(\w+)$/i)[1];C=D[F];if(H){D[F]=function(){return B[G].apply(this,arguments)}}else{D[F]=function(){this.parent=B[G];return C.apply(this,arguments)}}D[F].prototype[F]=D[F];I.each(B,function(K,L){D[F].prototype[L]=B[L]});I.each(A,function(K,L){if(B[L]){D[F].prototype[L]=function(){this.parent=B[L];return K.apply(this,arguments)}}else{if(L!=F){D[F].prototype[L]=K}}})}I.each(A["static"],function(K,L){D[F][L]=K})}function v(B,C){var D,A;if(B){for(D=0,A=B.length;D<A;D++){if(B[D]===C){return D}}}return -1}function w(G,E){var D,A,C,B=arguments,F;for(D=1,A=B.length;D<A;D++){E=B[D];for(C in E){if(E.hasOwnProperty(C)){F=E[C];if(F!==g){G[C]=F}}}}return G}function x(C,B,D,A){A=A||this;if(C){if(D){C=C[D]}k(C,function(F,E){if(B.call(A,F,E,D)===false){return false}x(F,B,D,A)})}}function l(D,C){var B,A;C=C||window;D=D.split(".");for(B=0;B<D.length;B++){A=D[B];if(!C[A]){C[A]={}}C=C[A]}return C}function t(D,C){var B,A;C=C||window;D=D.split(".");for(B=0,A=D.length;B<A;B++){C=C[D[B]];if(!C){break}}return C}function r(A,B){if(!A||m(A,"array")){return A}return y(A.split(B||","),u)}function j(B){var A=i.cacheSuffix;if(A){B+=(B.indexOf("?")===-1?"?":"&")+A}return B}return{trim:u,isArray:o,is:m,toArray:s,makeMap:q,each:k,map:y,grep:n,inArray:v,extend:w,create:p,walk:x,createNS:l,resolve:t,explode:r,_addCacheSuffix:j}});h("tinymce/dom/DomQuery",["tinymce/dom/EventUtils","tinymce/dom/Sizzle","tinymce/util/Tools","tinymce/Env"],function(t,q,n,o){var P=document,v=Array.prototype.push,E=Array.prototype.slice;var B=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/;var O=t.Event,p;function k(Q){return typeof Q!=="undefined"}function y(Q){return typeof Q==="string"}function J(Q){return Q&&Q==Q.window}function D(S,R){var U,T,Q;R=R||P;Q=R.createElement("div");U=R.createDocumentFragment();Q.innerHTML=S;while((T=Q.firstChild)){U.appendChild(T)}return U}function A(Q,T,U,R){var S;if(y(T)){T=D(T,z(Q[0]))}else{if(T.length&&!T.nodeType){T=r.makeArray(T);if(R){for(S=T.length-1;S>=0;S--){A(Q,T[S],U,R)}}else{for(S=0;S<T.length;S++){A(Q,T[S],U,R)}}return Q}}if(T.nodeType){S=Q.length;while(S--){U.call(Q[S],T)}}return Q}function l(R,Q){return R&&Q&&(" "+R.className+" ").indexOf(" "+Q+" ")!==-1}function x(T,U,R){var Q,S;U=r(U)[0];T.each(function(){var V=this;if(!R||Q!=V.parentNode){Q=V.parentNode;S=U.cloneNode(false);V.parentNode.insertBefore(S,V);S.appendChild(V)}else{S.appendChild(V)}});return T}var j=n.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," ");var G=n.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," ");var K={"for":"htmlFor","class":"className",readonly:"readOnly"};var m={"float":"cssFloat"};var M={},N={};function r(Q,R){return new r.fn.init(Q,R)}function H(R,S){var Q;if(S.indexOf){return S.indexOf(R)}Q=S.length;while(Q--){if(S[Q]===R){return Q}}return -1}var L=/^\s*|\s*$/g;function F(Q){return(Q===null||Q===p)?"":(""+Q).replace(L,"")}function s(V,W){var T,R,Q,S,U;if(V){T=V.length;if(T===S){for(R in V){if(V.hasOwnProperty(R)){U=V[R];if(W.call(U,R,U)===false){break}}}}else{for(Q=0;Q<T;Q++){U=V[Q];if(W.call(U,Q,U)===false){break}}}}return V}function w(S,R){var Q=[];s(S,function(T,U){if(R(U,T)){Q.push(U)}});return Q}function z(Q){if(!Q){return P}if(Q.nodeType==9){return Q}return Q.ownerDocument}r.fn=r.prototype={constructor:r,selector:"",context:null,length:0,init:function(Q,T){var R=this,S,U;if(!Q){return R}if(Q.nodeType){R.context=R[0]=Q;R.length=1;return R}if(T&&T.nodeType){R.context=T}else{if(T){return r(Q).attr(T)}else{R.context=T=document}}if(y(Q)){R.selector=Q;if(Q.charAt(0)==="<"&&Q.charAt(Q.length-1)===">"&&Q.length>=3){S=[null,Q,null]}else{S=B.exec(Q)}if(S){if(S[1]){U=D(Q,z(T)).firstChild;while(U){v.call(R,U);U=U.nextSibling}}else{U=z(T).getElementById(S[2]);if(!U){return R}if(U.id!==S[2]){return R.find(Q)}R.length=1;R[0]=U}}else{return r(T).find(Q)}}else{this.add(Q,false)}return R},toArray:function(){return n.toArray(this)},add:function(S,U){var R=this,Q,T;if(y(S)){return R.add(r(S))}if(U!==false){Q=r.unique(R.toArray().concat(r.makeArray(S)));R.length=Q.length;for(T=0;T<Q.length;T++){R[T]=Q[T]}}else{v.apply(R,r.makeArray(S))}return R},attr:function(R,T){var Q=this,S;if(typeof R==="object"){s(R,function(U,V){Q.attr(U,V)})}else{if(k(T)){this.each(function(){var U;if(this.nodeType===1){U=M[R];if(U&&U.set){U.set(this,T);return}if(T===null){this.removeAttribute(R,2)}else{this.setAttribute(R,T,2)}}})}else{if(Q[0]&&Q[0].nodeType===1){S=M[R];if(S&&S.get){return S.get(Q[0],R)}if(G[R]){return Q.prop(R)?R:p}T=Q[0].getAttribute(R,2);if(T===null){T=p}}return T}}return Q},removeAttr:function(Q){return this.attr(Q,null)},prop:function(R,S){var Q=this;R=K[R]||R;if(typeof R==="object"){s(R,function(T,U){Q.prop(T,U)})}else{if(k(S)){this.each(function(){if(this.nodeType==1){this[R]=S}})}else{if(Q[0]&&Q[0].nodeType&&R in Q[0]){return Q[0][R]}return S}}return Q},css:function(S,W){var R=this,X,V;function U(Y){return Y.replace(/-(\D)/g,function(aa,Z){return Z.toUpperCase()})}function Q(Y){return Y.replace(/[A-Z]/g,function(Z){return"-"+Z})}if(typeof S==="object"){s(S,function(Y,Z){R.css(Y,Z)})}else{if(k(W)){S=U(S);if(typeof W==="number"&&!j[S]){W+="px"}R.each(function(){var Z=this.style;V=N[S];if(V&&V.set){V.set(this,W);return}try{this.style[m[S]||S]=W}catch(Y){}if(W===null||W===""){if(Z.removeProperty){Z.removeProperty(Q(S))}else{Z.removeAttribute(S)}}})}else{X=R[0];V=N[S];if(V&&V.get){return V.get(X)}if(X.ownerDocument.defaultView){try{return X.ownerDocument.defaultView.getComputedStyle(X,null).getPropertyValue(Q(S))}catch(T){return p}}else{if(X.currentStyle){return X.currentStyle[U(S)]}}}}return R},remove:function(){var Q=this,S,R=this.length;while(R--){S=Q[R];O.clean(S);if(S.parentNode){S.parentNode.removeChild(S)}}return this},empty:function(){var Q=this,S,R=this.length;while(R--){S=Q[R];while(S.firstChild){S.removeChild(S.firstChild)}}return this},html:function(T){var Q=this,S;if(k(T)){S=Q.length;try{while(S--){Q[S].innerHTML=T}}catch(R){r(Q[S]).empty().append(T)}return Q}return Q[0]?Q[0].innerHTML:""},text:function(S){var Q=this,R;if(k(S)){R=Q.length;while(R--){if("innerText" in Q[R]){Q[R].innerText=S}else{Q[0].textContent=S}}return Q}return Q[0]?(Q[0].innerText||Q[0].textContent):""},append:function(){return A(this,arguments,function(Q){if(this.nodeType===1){this.appendChild(Q)}})},prepend:function(){return A(this,arguments,function(Q){if(this.nodeType===1){this.insertBefore(Q,this.firstChild)}},true)},before:function(){var Q=this;if(Q[0]&&Q[0].parentNode){return A(Q,arguments,function(R){this.parentNode.insertBefore(R,this)})}return Q},after:function(){var Q=this;if(Q[0]&&Q[0].parentNode){return A(Q,arguments,function(R){this.parentNode.insertBefore(R,this.nextSibling)},true)}return Q},appendTo:function(Q){r(Q).append(this);return this},prependTo:function(Q){r(Q).prepend(this);return this},replaceWith:function(Q){return this.before(Q).remove()},wrap:function(Q){return x(this,Q)},wrapAll:function(Q){return x(this,Q,true)},wrapInner:function(Q){this.each(function(){r(this).contents().wrapAll(Q)});return this},unwrap:function(){return this.parent().each(function(){r(this).replaceWith(this.childNodes)})},clone:function(){var Q=[];this.each(function(){Q.push(this.cloneNode(true))});return r(Q)},addClass:function(Q){return this.toggleClass(Q,true)},removeClass:function(Q){return this.toggleClass(Q,false)},toggleClass:function(R,S){var Q=this;if(typeof R!="string"){return Q}if(R.indexOf(" ")!==-1){s(R.split(" "),function(){Q.toggleClass(this,S)})}else{Q.each(function(T,V){var U,W;W=l(V,R);if(W!==S){U=V.className;if(W){V.className=F((" "+U+" ").replace(" "+R+" "," "))}else{V.className+=U?" "+R:R}}})}return Q},hasClass:function(Q){return l(this[0],Q)},each:function(Q){return s(this,Q)},on:function(Q,R){return this.each(function(){O.bind(this,Q,R)})},off:function(Q,R){return this.each(function(){O.unbind(this,Q,R)})},trigger:function(Q){return this.each(function(){if(typeof Q=="object"){O.fire(this,Q.type,Q)}else{O.fire(this,Q)}})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new r(E.apply(this,arguments))},eq:function(Q){return Q===-1?this.slice(Q):this.slice(Q,+Q+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(Q){var T,R,S=[];for(T=0,R=this.length;T<R;T++){r.find(Q,this[T],S)}return r(S)},filter:function(Q){if(typeof Q=="function"){return r(w(this.toArray(),function(S,R){return Q(R,S)}))}return r(r.filter(Q,this.toArray()))},closest:function(R){var Q=[];if(R instanceof r){R=R[0]}this.each(function(S,T){while(T){if(typeof R=="string"&&r(T).is(R)){Q.push(T);break}else{if(T==R){Q.push(T);break}}T=T.parentNode}});return r(Q)},offset:function(T){var W,S,R;var Q=0,V=0,U;if(!T){W=this[0];if(W){S=W.ownerDocument;R=S.documentElement;if(W.getBoundingClientRect){U=W.getBoundingClientRect();Q=U.left+(R.scrollLeft||S.body.scrollLeft)-R.clientLeft;V=U.top+(R.scrollTop||S.body.scrollTop)-R.clientTop}}return{left:Q,top:V}}return this.css(T)},push:v,sort:[].sort,splice:[].splice};n.extend(r,{extend:n.extend,makeArray:function(Q){if(J(Q)||Q.nodeType){return[Q]}return n.toArray(Q)},inArray:H,isArray:n.isArray,each:s,trim:F,grep:w,find:q,expr:q.selectors,unique:q.uniqueSort,text:q.getText,contains:q.contains,filter:function(T,Q,S){var R=Q.length;if(S){T=":not("+T+")"}while(R--){if(Q[R].nodeType!=1){Q.splice(R,1)}}if(Q.length===1){Q=r.find.matchesSelector(Q[0],T)?[Q[0]]:[]}else{Q=r.find.matches(T,Q)}return Q}});function C(R,U,T){var Q=[],S=R[U];if(typeof T!="string"&&T instanceof r){T=T[0]}while(S&&S.nodeType!==9){if(T!==g){if(S===T){break}if(typeof T=="string"&&r(S).is(T)){break}}if(S.nodeType===1){Q.push(S)}S=S[U]}return Q}function I(T,S,R,U){var Q=[];if(U instanceof r){U=U[0]}for(;T;T=T[S]){if(R&&T.nodeType!==R){continue}if(U!==g){if(T===U){break}if(typeof U=="string"&&r(T).is(U)){break}}Q.push(T)}return Q}function i(S,R,Q){for(S=S[R];S;S=S[R]){if(S.nodeType==Q){return S}}return null}s({parent:function(R){var Q=R.parentNode;return Q&&Q.nodeType!==11?Q:null},parents:function(Q){return C(Q,"parentNode")},next:function(Q){return i(Q,"nextSibling",1)},prev:function(Q){return i(Q,"previousSibling",1)},children:function(Q){return I(Q.firstChild,"nextSibling",1)},contents:function(Q){return n.toArray((Q.nodeName==="iframe"?Q.contentDocument||Q.contentWindow.document:Q).childNodes)}},function(Q,R){r.fn[Q]=function(T){var U=this,S=[];U.each(function(){var V=R.call(S,this,T,S);if(V){if(r.isArray(V)){S.push.apply(S,V)}else{S.push(V)}}});if(this.length>1){S=r.unique(S);if(Q.indexOf("parents")===0){S=S.reverse()}}S=r(S);if(T){return S.filter(T)}return S}});s({parentsUntil:function(Q,R){return C(Q,"parentNode",R)},nextUntil:function(Q,R){return I(Q,"nextSibling",1,R).slice(1)},prevUntil:function(Q,R){return I(Q,"previousSibling",1,R).slice(1)}},function(Q,R){r.fn[Q]=function(T,V){var U=this,S=[];U.each(function(){var W=R.call(S,this,T,S);if(W){if(r.isArray(W)){S.push.apply(S,W)}else{S.push(W)}}});if(this.length>1){S=r.unique(S);if(Q.indexOf("parents")===0||Q==="prevUntil"){S=S.reverse()}}S=r(S);if(V){return S.filter(V)}return S}});r.fn.is=function(Q){return !!Q&&this.filter(Q).length>0};r.fn.init.prototype=r.fn;r.overrideDefaults=function(S){var R;function Q(T,U){R=R||S();if(arguments.length===0){T=R.element}if(!U){U=R.context}return new Q.fn.init(T,U)}r.extend(Q,this);return Q};function u(S,R,Q){s(Q,function(T,U){S[T]=S[T]||{};S[T][R]=U})}if(o.ie&&o.ie<8){u(M,"get",{maxlength:function(R){var Q=R.maxLength;if(Q===2147483647){return p}return Q},size:function(R){var Q=R.size;if(Q===20){return p}return Q},"class":function(Q){return Q.className},style:function(R){var Q=R.style.cssText;if(Q.length===0){return p}return Q}});u(M,"set",{"class":function(R,Q){R.className=Q},style:function(R,Q){R.style.cssText=Q}})}if(o.ie&&o.ie<9){m["float"]="styleFloat";u(N,"set",{opacity:function(S,R){var Q=S.style;if(R===null||R===""){Q.removeAttribute("filter")}else{Q.zoom=1;Q.filter="alpha(opacity="+(R*100)+")"}}})}r.attrHooks=M;r.cssHooks=N;return r});h("tinymce/html/Styles",[],function(){return function(o,q){var u=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,r=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,l=/\s*([^:]+):\s*([^;]+);?/g,w=/\s+$/,p,s,k={},t,n,j,v="\uFEFF";o=o||{};if(q){n=q.getValidStyles();j=q.getInvalidStyles()}t=("\\\" \\' \\; \\: ; : "+v).split(" ");for(s=0;s<t.length;s++){k[t[s]]=v+s;k[v+s]=t[s]}function m(x,A,z,i){function y(B){B=parseInt(B,10).toString(16);return B.length>1?B:"0"+B}return"#"+y(A)+y(z)+y(i)}return{toHex:function(i){return i.replace(u,m)},parse:function(C){var I={},A,x,G,B,F=o.url_converter;var H=o.url_converter_scope||this;function z(O,R,L){var Q,M,K,P;Q=I[O+"-top"+R];if(!Q){return}M=I[O+"-right"+R];if(!M){return}K=I[O+"-bottom"+R];if(!K){return}P=I[O+"-left"+R];if(!P){return}var N=[Q,M,K,P];s=N.length-1;while(s--){if(N[s]!==N[s+1]){break}}if(s>-1&&L){return}I[O+R]=s==-1?N[0]:N.join(" ");delete I[O+"-top"+R];delete I[O+"-right"+R];delete I[O+"-bottom"+R];delete I[O+"-left"+R]}function E(L){var M=I[L],K;if(!M){return}M=M.split(" ");K=M.length;while(K--){if(M[K]!==M[0]){return false}}I[L]=M[0];return true}function J(M,L,K,N){if(!E(L)){return}if(!E(K)){return}if(!E(N)){return}I[M]=I[L]+" "+I[K]+" "+I[N];delete I[L];delete I[K];delete I[N]}function D(K){B=true;return k[K]}function i(L,K){if(B){L=L.replace(/\uFEFF[0-9]/g,function(M){return k[M]})}if(!K){L=L.replace(/\\([\'\";:])/g,"$1")}return L}function y(L,K,O,N,Q,M){Q=Q||M;if(Q){Q=i(Q);return"'"+Q.replace(/\'/g,"\\'")+"'"}K=i(K||O||N);if(!o.allow_script_urls){var P=K.replace(/[\s\r\n]+/,"");if(/(java|vb)script:/i.test(P)){return""}if(!o.allow_svg_data_urls&&/^data:image\/svg/i.test(P)){return""}}if(F){K=F.call(H,K,"style")}return"url('"+K.replace(/\'/g,"\\'")+"')"}if(C){C=C.replace(/[\u0000-\u001F]/g,"");C=C.replace(/\\[\"\';:\uFEFF]/g,D).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(K){return K.replace(/[;:]/g,D)});while((A=l.exec(C))){x=A[1].replace(w,"").toLowerCase();G=A[2].replace(w,"");G=G.replace(/\\[0-9a-f]+/g,function(K){return String.fromCharCode(parseInt(K.substr(1),16))});if(x&&G.length>0){if(!o.allow_script_urls&&(x=="behavior"||/expression\s*\(|\/\*|\*\//.test(G))){continue}if(x==="font-weight"&&G==="700"){G="bold"}else{if(x==="color"||x==="background-color"){G=G.toLowerCase()}}G=G.replace(u,m);G=G.replace(r,y);I[x]=B?i(G,true):G}l.lastIndex=A.index+A[0].length}z("border","",true);z("border","-width");z("border","-color");z("border","-style");z("padding","");z("margin","");J("border","border-width","border-style","border-color");if(I.border==="medium none"){delete I.border}if(I["border-image"]==="none"){delete I["border-image"]}}return I},serialize:function(A,i){var z="",y,B;function x(E){var H,F,D,G;H=n[E];if(H){for(F=0,D=H.length;F<D;F++){E=H[F];G=A[E];if(G!==p&&G.length>0){z+=(z.length>0?" ":"")+E+": "+G+";"}}}}function C(E,D){var F;F=j["*"];if(F&&F[E]){return false}F=j[D];if(F&&F[E]){return false}return true}if(i&&n){x("*");x(i)}else{for(y in A){B=A[y];if(B!==p&&B.length>0){if(!j||C(y,i)){z+=(z.length>0?" ":"")+y+": "+B+";"}}}}return z}}}});h("tinymce/dom/TreeWalker",[],function(){return function(j,i){var k=j;function l(q,m,n,r){var p,o;if(q){if(!r&&q[m]){return q[m]}if(q!=i){p=q[n];if(p){return p}for(o=q.parentNode;o&&o!=i;o=o.parentNode){p=o[n];if(p){return p}}}}}this.current=function(){return k};this.next=function(m){k=l(k,"firstChild","nextSibling",m);return k};this.prev=function(m){k=l(k,"lastChild","previousSibling",m);return k}}});h("tinymce/dom/Range",["tinymce/util/Tools"],function(i){function j(k){var o=this,m=k.doc,aa=0,M=1,s=2,L=true,Y=false,ac="startOffset",q="startContainer",W="endContainer",H="endOffset",t=i.extend,w=k.nodeIndex;function E(){return m.createDocumentFragment()}function z(ae,ad){J(L,ae,ad)}function B(ae,ad){J(Y,ae,ad)}function p(ad){z(ad.parentNode,w(ad))}function Q(ad){z(ad.parentNode,w(ad)+1)}function R(ad){B(ad.parentNode,w(ad))}function C(ad){B(ad.parentNode,w(ad)+1)}function I(ad){if(ad){o[W]=o[q];o[H]=o[ac]}else{o[q]=o[W];o[ac]=o[H]}o.collapsed=L}function F(ad){p(ad);C(ad)}function N(ad){z(ad,0);B(ad,ad.nodeType===1?ad.childNodes.length:ad.nodeValue.length)}function D(ah,ad){var ak=o[q],af=o[ac],aj=o[W],ae=o[H],ai=ad.startContainer,am=ad.startOffset,ag=ad.endContainer,al=ad.endOffset;if(ah===0){return O(ak,af,ai,am)}if(ah===1){return O(aj,ae,ai,am)}if(ah===2){return O(aj,ae,ag,al)}if(ah===3){return O(ak,af,ag,al)}}function y(){u(s)}function P(){return u(aa)}function l(){return u(M)}function K(ah){var ae=this[q],ad=this[ac],ag,af;if((ae.nodeType===3||ae.nodeType===4)&&ae.nodeValue){if(!ad){ae.parentNode.insertBefore(ah,ae)}else{if(ad>=ae.nodeValue.length){k.insertAfter(ah,ae)}else{ag=ae.splitText(ad);ae.parentNode.insertBefore(ah,ag)}}}else{if(ae.childNodes.length>0){af=ae.childNodes[ad]}if(af){ae.insertBefore(ah,af)}else{if(ae.nodeType==3){k.insertAfter(ah,ae)}else{ae.appendChild(ah)}}}}function U(ae){var ad=o.extractContents();o.insertNode(ae);ae.appendChild(ad);o.selectNode(ae)}function S(){return t(new j(k),{startContainer:o[q],startOffset:o[ac],endContainer:o[W],endOffset:o[H],collapsed:o.collapsed,commonAncestorContainer:o.commonAncestorContainer})}function V(ad,ae){var af;if(ad.nodeType==3){return ad}if(ae<0){return ad}af=ad.firstChild;while(af&&ae>0){--ae;af=af.nextSibling}if(af){return af}return ad}function v(){return(o[q]==o[W]&&o[ac]==o[H])}function O(ag,ai,ae,ah){var aj,af,ad,ak,am,al;if(ag==ae){if(ai==ah){return 0}if(ai<ah){return -1}return 1}aj=ae;while(aj&&aj.parentNode!=ag){aj=aj.parentNode}if(aj){af=0;ad=ag.firstChild;while(ad!=aj&&af<ai){af++;ad=ad.nextSibling}if(ai<=af){return -1}return 1}aj=ag;while(aj&&aj.parentNode!=ae){aj=aj.parentNode}if(aj){af=0;ad=ae.firstChild;while(ad!=aj&&af<ah){af++;ad=ad.nextSibling}if(af<ah){return -1}return 1}ak=k.findCommonAncestor(ag,ae);am=ag;while(am&&am.parentNode!=ak){am=am.parentNode}if(!am){am=ak}al=ae;while(al&&al.parentNode!=ak){al=al.parentNode}if(!al){al=ak}if(am==al){return 0}ad=ak.firstChild;while(ad){if(ad==am){return -1}if(ad==al){return 1}ad=ad.nextSibling}}function J(ae,ah,ag){var ad,af;if(ae){o[q]=ah;o[ac]=ag}else{o[W]=ah;o[H]=ag}ad=o[W];while(ad.parentNode){ad=ad.parentNode}af=o[q];while(af.parentNode){af=af.parentNode}if(af==ad){if(O(o[q],o[ac],o[W],o[H])>0){o.collapse(ae)}}else{o.collapse(ae)}o.collapsed=v();o.commonAncestorContainer=k.findCommonAncestor(o[q],o[W])}function u(ak){var aj,ag=0,am=0,ae,ai,af,ah,ad,al;if(o[q]==o[W]){return n(ak)}for(aj=o[W],ae=aj.parentNode;ae;aj=ae,ae=ae.parentNode){if(ae==o[q]){return A(aj,ak)}++ag}for(aj=o[q],ae=aj.parentNode;ae;aj=ae,ae=ae.parentNode){if(ae==o[W]){return ab(aj,ak)}++am}ai=am-ag;af=o[q];while(ai>0){af=af.parentNode;ai--}ah=o[W];while(ai<0){ah=ah.parentNode;ai++}for(ad=af.parentNode,al=ah.parentNode;ad!=al;ad=ad.parentNode,al=al.parentNode){af=ad;ah=al}return x(af,ah,ak)}function n(aj){var al,am,ad,af,ag,ak,ah,ae,ai;if(aj!=s){al=E()}if(o[ac]==o[H]){return al}if(o[q].nodeType==3){am=o[q].nodeValue;ad=am.substring(o[ac],o[H]);if(aj!=M){af=o[q];ae=o[ac];ai=o[H]-o[ac];if(ae===0&&ai>=af.nodeValue.length-1){af.parentNode.removeChild(af)}else{af.deleteData(ae,ai)}o.collapse(L)}if(aj==s){return}if(ad.length>0){al.appendChild(m.createTextNode(ad))}return al}af=V(o[q],o[ac]);ag=o[H]-o[ac];while(af&&ag>0){ak=af.nextSibling;ah=G(af,aj);if(al){al.appendChild(ah)}--ag;af=ak}if(aj!=M){o.collapse(L)}return al}function A(ak,ah){var aj,ai,ae,ad,ag,af;if(ah!=s){aj=E()}ai=r(ak,ah);if(aj){aj.appendChild(ai)}ae=w(ak);ad=ae-o[ac];if(ad<=0){if(ah!=M){o.setEndBefore(ak);o.collapse(Y)}return aj}ai=ak.previousSibling;while(ad>0){ag=ai.previousSibling;af=G(ai,ah);if(aj){aj.insertBefore(af,aj.firstChild)}--ad;ai=ag}if(ah!=M){o.setEndBefore(ak);o.collapse(Y)}return aj}function ab(ai,ah){var ak,ae,aj,ad,ag,af;if(ah!=s){ak=E()}aj=X(ai,ah);if(ak){ak.appendChild(aj)}ae=w(ai);++ae;ad=o[H]-ae;aj=ai.nextSibling;while(aj&&ad>0){ag=aj.nextSibling;af=G(aj,ah);if(ak){ak.appendChild(af)}--ad;aj=ag}if(ah!=M){o.setStartAfter(ai);o.collapse(L)}return ak}function x(ah,ad,ak){var ae,am,ai,aj,af,al,ag;if(ak!=s){am=E()}ae=X(ah,ak);if(am){am.appendChild(ae)}ai=w(ah);aj=w(ad);++ai;af=aj-ai;al=ah.nextSibling;while(af>0){ag=al.nextSibling;ae=G(al,ak);if(am){am.appendChild(ae)}al=ag;--af}ae=r(ad,ak);if(am){am.appendChild(ae)}if(ak!=M){o.setStartAfter(ah);o.collapse(L)}return am}function r(aj,ak){var af=V(o[W],o[H]-1),al,ai;var ah,ad,ae,ag=af!=o[W];if(af==aj){return T(af,ag,Y,ak)}al=af.parentNode;ai=T(al,Y,Y,ak);while(al){while(af){ah=af.previousSibling;ad=T(af,ag,Y,ak);if(ak!=s){ai.insertBefore(ad,ai.firstChild)}ag=L;af=ah}if(al==aj){return ai}af=al.previousSibling;al=al.parentNode;ae=T(al,Y,Y,ak);if(ak!=s){ae.appendChild(ai)}ai=ae}}function X(aj,ak){var ag=V(o[q],o[ac]),ah=ag!=o[q];var al,ai,af,ad,ae;if(ag==aj){return T(ag,ah,L,ak)}al=ag.parentNode;ai=T(al,Y,L,ak);while(al){while(ag){af=ag.nextSibling;ad=T(ag,ah,L,ak);if(ak!=s){ai.appendChild(ad)}ah=L;ag=af}if(al==aj){return ai}ag=al.nextSibling;al=al.parentNode;ae=T(al,Y,L,ak);if(ak!=s){ae.appendChild(ai)}ai=ae}}function T(ad,ah,ak,al){var ag,af,ai,ae,aj;if(ah){return G(ad,al)}if(ad.nodeType==3){ag=ad.nodeValue;if(ak){ae=o[ac];af=ag.substring(ae);ai=ag.substring(0,ae)}else{ae=o[H];af=ag.substring(0,ae);ai=ag.substring(ae)}if(al!=M){ad.nodeValue=ai}if(al==s){return}aj=k.clone(ad,Y);aj.nodeValue=af;return aj}if(al==s){return}return k.clone(ad,Y)}function G(ae,ad){if(ad!=s){return ad==M?k.clone(ae,L):ae}ae.parentNode.removeChild(ae)}function Z(){return k.create("body",null,l()).outerText}t(o,{startContainer:m,startOffset:0,endContainer:m,endOffset:0,collapsed:L,commonAncestorContainer:m,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:z,setEnd:B,setStartBefore:p,setStartAfter:Q,setEndBefore:R,setEndAfter:C,collapse:I,selectNode:F,selectNodeContents:N,compareBoundaryPoints:D,deleteContents:y,extractContents:P,cloneContents:l,insertNode:K,surroundContents:U,cloneRange:S,toStringIE:Z});return o}j.prototype.toString=function(){return this.toStringIE()};return j});h("tinymce/html/Entities",["tinymce/util/Tools"],function(l){var m=l.makeMap;var i,r,o,u=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,j=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,q=/[<>&\"\']/g,n=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,t={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"};r={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;","\u0060":"&#96;"};o={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"};function s(v){var w;w=document.createElement("div");w.innerHTML=v;return w.textContent||w.innerText||v}function p(w,z){var x,y,v,A={};if(w){w=w.split(",");z=z||10;for(x=0;x<w.length;x+=2){y=String.fromCharCode(parseInt(w[x],z));if(!r[y]){v="&"+w[x+1]+";";A[y]=v;A[v]=y}}return A}}i=p("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 k={encodeRaw:function(w,v){return w.replace(v?u:j,function(x){return r[x]||x})},encodeAllRaw:function(v){return(""+v).replace(q,function(w){return r[w]||w})},encodeNumeric:function(w,v){return w.replace(v?u:j,function(x){if(x.length>1){return"&#"+(((x.charCodeAt(0)-55296)*1024)+(x.charCodeAt(1)-56320)+65536)+";"}return r[x]||"&#"+x.charCodeAt(0)+";"})},encodeNamed:function(x,v,w){w=w||i;return x.replace(v?u:j,function(y){return r[y]||w[y]||y})},getEncodeFunc:function(v,y){y=p(y)||i;function w(A,z){return A.replace(z?u:j,function(B){return r[B]||y[B]||"&#"+B.charCodeAt(0)+";"||B})}function x(A,z){return k.encodeNamed(A,z,y)}v=m(v.replace(/\+/g,","));if(v.named&&v.numeric){return w}if(v.named){if(y){return x}return k.encodeNamed}if(v.numeric){return k.encodeNumeric}return k.encodeRaw},decode:function(v){return v.replace(n,function(x,w){if(w){if(w.charAt(0).toLowerCase()==="x"){w=parseInt(w.substr(1),16)}else{w=parseInt(w,10)}if(w>65535){w-=65536;return String.fromCharCode(55296+(w>>10),56320+(w&1023))}else{return t[w]||String.fromCharCode(w)}}return o[x]||i[x]||s(x)})}};return k});h("tinymce/dom/StyleSheetLoader",["tinymce/util/Tools"],function(i){return function(j,n){var k=0,m={},p;n=n||{};p=n.maxLoadTime||5000;function l(q){j.getElementsByTagName("head")[0].appendChild(q)}function o(s,w,A){var B,r,t,q;function x(){var E=q.passed,D=E.length;while(D--){E[D]()}q.status=2;q.passed=[];q.failed=[]}function z(){var E=q.failed,D=E.length;while(D--){E[D]()}q.status=3;q.passed=[];q.failed=[]}function C(){var D=navigator.userAgent.match(/WebKit\/(\d*)/);return !!(D&&D[1]<536)}function y(D,E){if(!D()){if((new Date().getTime())-t<p){window.setTimeout(E,0)}else{z()}}}function u(){y(function(){var F=j.styleSheets,G,E=F.length,D;while(E--){G=F[E];D=G.ownerNode?G.ownerNode:G.owningElement;if(D&&D.id===B.id){x();return true}}},u)}function v(){y(function(){try{var D=r.sheet.cssRules;x();return !!D}catch(E){}},v)}s=i._addCacheSuffix(s);if(!m[s]){q={passed:[],failed:[]};m[s]=q}else{q=m[s]}if(w){q.passed.push(w)}if(A){q.failed.push(A)}if(q.status==1){return}if(q.status==2){x();return}if(q.status==3){z();return}q.status=1;B=j.createElement("link");B.rel="stylesheet";B.type="text/css";B.id="u"+(k++);B.async=false;B.defer=false;t=new Date().getTime();if("onload" in B&&!C()){B.onload=u;B.onerror=z}else{if(navigator.userAgent.indexOf("Firefox")>0){r=j.createElement("style");r.textContent='@import "'+s+'"';v();l(r);return}else{u()}}l(B);B.href=s}this.load=o}});h("tinymce/dom/DOMUtils",["tinymce/dom/Sizzle","tinymce/dom/DomQuery","tinymce/html/Styles","tinymce/dom/EventUtils","tinymce/dom/TreeWalker","tinymce/dom/Range","tinymce/html/Entities","tinymce/Env","tinymce/util/Tools","tinymce/dom/StyleSheetLoader"],function(k,o,r,n,p,z,l,j,i,u){var m=i.each,q=i.is,s=i.grep,w=i.trim;var v=j.ie;var t=/^([a-z0-9],?)+$/i;var A=/^[ \t\r\n]*$/;function x(C,E){var D={},B=E.keep_values,F;F={set:function(G,I,H){if(E.url_converter){I=E.url_converter.call(E.url_converter_scope||C,I,H,G[0])}G.attr("data-mce-"+H,I).attr(H,I)},get:function(G,H){return G.attr("data-mce-"+H)||G.attr(H)}};D={style:{set:function(G,H){if(H!==null&&typeof H==="object"){G.css(H);return}if(B){G.attr("data-mce-style",H)}G.attr("style",H)},get:function(G){var H=G.attr("data-mce-style")||G.attr("style");H=C.serializeStyle(C.parseStyle(H),G[0].nodeName);return H}}};if(B){D.href=D.src=F}return D}function y(E,C){var B=this,D;B.doc=E;B.win=window;B.files={};B.counter=0;B.stdMode=!v||E.documentMode>=8;B.boxModel=!v||E.compatMode=="CSS1Compat"||B.stdMode;B.styleSheetLoader=new u(E);B.boundEvents=[];B.settings=C=C||{};B.schema=C.schema;B.styles=new r({url_converter:C.url_converter,url_converter_scope:C.url_converter_scope},C.schema);B.fixDoc(E);B.events=C.ownEvents?new n(C.proxy):n.Event;B.attrHooks=x(B,C);D=C.schema?C.schema.getBlockElements():{};B.$=o.overrideDefaults(function(){return{context:E,element:B.getRoot()}});B.isBlock=function(G){if(!G){return false}var F=G.nodeType;if(F){return !!(F===1&&D[G.nodeName])}return !!D[G]}}y.prototype={$$:function(B){if(typeof B=="string"){B=this.get(B)}return this.$(B)},root:null,fixDoc:function(D){var C=this.settings,B;if(v&&C.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(E){D.createElement(E)});for(B in C.schema.getCustomElements()){D.createElement(B)}}},clone:function(D,B){var C=this,F,E;if(!v||D.nodeType!==1||B){return D.cloneNode(B)}E=C.doc;if(!B){F=E.createElement(D.nodeName);m(C.getAttribs(D),function(G){C.setAttrib(F,G.nodeName,C.getAttrib(D,G.nodeName))});return F}return F.firstChild},getRoot:function(){var B=this;return B.settings.root_element||B.doc.body},getViewPort:function(C){var B,D;C=!C?this.win:C;B=C.document;D=this.boxModel?B.documentElement:B.body;return{x:C.pageXOffset||D.scrollLeft,y:C.pageYOffset||D.scrollTop,w:C.innerWidth||D.clientWidth,h:C.innerHeight||D.clientHeight}},getRect:function(E){var B=this,D,C;E=B.get(E);D=B.getPos(E);C=B.getSize(E);return{x:D.x,y:D.y,w:C.w,h:C.h}},getSize:function(E){var C=this,B,D;E=C.get(E);B=C.getStyle(E,"width");D=C.getStyle(E,"height");if(B.indexOf("px")===-1){B=0}if(D.indexOf("px")===-1){D=0}return{w:parseInt(B,10)||E.offsetWidth||E.clientWidth,h:parseInt(D,10)||E.offsetHeight||E.clientHeight}},getParent:function(D,B,C){return this.getParents(D,B,C,false)},getParents:function(G,C,D,H){var F=this,E,B=[];G=F.get(G);H=H===g;D=D||(F.getRoot().nodeName!="BODY"?F.getRoot().parentNode:null);if(q(C,"string")){E=C;if(C==="*"){C=function(I){return I.nodeType==1}}else{C=function(I){return F.is(I,E)}}}while(G){if(G==D||!G.nodeType||G.nodeType===9){break}if(!C||C(G)){if(H){B.push(G)}else{return G}}G=G.parentNode}return H?B:null},get:function(C){var B;if(C&&this.doc&&typeof C=="string"){B=C;C=this.doc.getElementById(C);if(C&&C.id!==B){return this.doc.getElementsByName(B)[1]}}return C},getNext:function(C,B){return this._findSib(C,B,"nextSibling")},getPrev:function(C,B){return this._findSib(C,B,"previousSibling")},select:function(B,D){var C=this;return k(B,C.get(D)||C.settings.root_element||C.doc,[])},is:function(E,B){var C;if(E.length===g){if(B==="*"){return E.nodeType==1}if(t.test(B)){B=B.toLowerCase().split(/,/);E=E.nodeName.toLowerCase();for(C=B.length-1;C>=0;C--){if(B[C]==E){return true}}return false}}if(E.nodeType&&E.nodeType!=1){return false}var D=E.nodeType?[E]:E;return k(B,D[0].ownerDocument||D[0],null,D).length>0},add:function(G,D,C,F,E){var B=this;return this.run(G,function(I){var H;H=q(D,"string")?B.doc.createElement(D):D;B.setAttribs(H,C);if(F){if(F.nodeType){H.appendChild(F)}else{B.setHTML(H,F)}}return !E?I.appendChild(H):H})},create:function(C,B,D){return this.add(this.doc.createElement(C),C,B,D,1)},createHTML:function(C,B,E){var F="",D;F+="<"+C;for(D in B){if(B.hasOwnProperty(D)&&B[D]!==null&&typeof B[D]!="undefined"){F+=" "+D+'="'+this.encode(B[D])+'"'}}if(typeof E!="undefined"){return F+">"+E+"</"+C+">"}return F+" />"},createFragment:function(C){var F,D,E=this.doc,B;B=E.createElement("div");F=E.createDocumentFragment();if(C){B.innerHTML=C}while((D=B.firstChild)){F.appendChild(D)}return F},remove:function(B,C){B=this.$$(B);if(C){B.each(function(){var D;while((D=this.firstChild)){if(D.nodeType==3&&D.data.length===0){this.removeChild(D)}else{this.parentNode.insertBefore(D,this)}}}).remove()}else{B.remove()}return B.length>1?B.toArray():B[0]},setStyle:function(D,B,C){D=this.$$(D).css(B,C);if(this.settings.update_styles){D.attr("data-mce-style",null)}},getStyle:function(D,B,C){D=this.$$(D);if(C){return D.css(B)}B=B.replace(/-(\D)/g,function(F,E){return E.toUpperCase()});if(B=="float"){B=v?"styleFloat":"cssFloat"}return D[0]&&D[0].style?D[0].style[B]:g},setStyles:function(C,B){C=this.$$(C).css(B);if(this.settings.update_styles){C.attr("data-mce-style",null)}},removeAllAttribs:function(B){return this.run(B,function(E){var D,C=E.attributes;for(D=C.length-1;D>=0;D--){E.removeAttributeNode(C.item(D))}})},setAttrib:function(H,D,G){var C=this,B,F,E=C.settings;if(G===""){G=null}H=C.$$(H);B=H.attr(D);if(!H.length){return}F=C.attrHooks[D];if(F&&F.set){F.set(H,G,D)}else{H.attr(D,G)}if(B!=G&&E.onSetAttrib){E.onSetAttrib({attrElm:H,attrName:D,attrValue:G})}},setAttribs:function(D,C){var B=this;B.$$(D).each(function(E,F){m(C,function(H,G){B.setAttrib(F,G,H)})})},getAttrib:function(G,C,F){var B=this,E,D;G=B.$$(G);if(G.length){E=B.attrHooks[C];if(E&&E.get){D=E.get(G,C)}else{D=G.attr(C)}}if(typeof D=="undefined"){D=F||""}return D},getPos:function(D,E){var J=this,H=0,G=0,B,I=J.doc,C=I.body,F;D=J.get(D);E=E||C;if(D){if(E===C&&D.getBoundingClientRect&&o(C).css("position")==="static"){F=D.getBoundingClientRect();E=J.boxModel?I.documentElement:C;H=F.left+(I.documentElement.scrollLeft||C.scrollLeft)-E.clientLeft;G=F.top+(I.documentElement.scrollTop||C.scrollTop)-E.clientTop;return{x:H,y:G}}B=D;while(B&&B!=E&&B.nodeType){H+=B.offsetLeft||0;G+=B.offsetTop||0;B=B.offsetParent}B=D.parentNode;while(B&&B!=E&&B.nodeType){H-=B.scrollLeft||0;G-=B.scrollTop||0;B=B.parentNode}}return{x:H,y:G}},parseStyle:function(B){return this.styles.parse(B)},serializeStyle:function(C,B){return this.styles.serialize(C,B)},addStyle:function(E){var C=this,F=C.doc,D,G;if(C!==y.DOM&&F===document){var B=y.DOM.addedStyles;B=B||[];if(B[E]){return}B[E]=true;y.DOM.addedStyles=B}G=F.getElementById("mceDefaultStyles");if(!G){G=F.createElement("style");G.id="mceDefaultStyles";G.type="text/css";D=F.getElementsByTagName("head")[0];if(D.firstChild){D.insertBefore(G,D.firstChild)}else{D.appendChild(G)}}if(G.styleSheet){G.styleSheet.cssText+=E}else{G.appendChild(F.createTextNode(E))}},loadCSS:function(C){var B=this,E=B.doc,D;if(B!==y.DOM&&E===document){y.DOM.loadCSS(C);return}if(!C){C=""}D=E.getElementsByTagName("head")[0];m(C.split(","),function(F){var G;F=i._addCacheSuffix(F);if(B.files[F]){return}B.files[F]=true;G=B.create("link",{rel:"stylesheet",href:F});if(v&&E.documentMode&&E.recalc){G.onload=function(){if(E.recalc){E.recalc()}G.onload=null}}D.appendChild(G)})},addClass:function(C,B){this.$$(C).addClass(B)},removeClass:function(C,B){this.toggleClass(C,B,false)},hasClass:function(C,B){return this.$$(C).hasClass(B)},toggleClass:function(D,B,C){this.$$(D).toggleClass(B,C).each(function(){if(this.className===""){o(this).attr("class",null)}})},show:function(B){this.$$(B).show()},hide:function(B){this.$$(B).hide()},isHidden:function(B){return this.$$(B).css("display")=="none"},uniqueId:function(B){return(!B?"mce_":B)+(this.counter++)},setHTML:function(C,B){C=this.$$(C);if(v){C.each(function(E,F){if(F.canHaveHTML===false){return}while(F.firstChild){F.removeChild(F.firstChild)}try{F.innerHTML="<br>"+B;F.removeChild(F.firstChild)}catch(D){o("<div>").html("<br>"+B).contents().slice(1).appendTo(F)}return B})}else{C.html(B)}},getOuterHTML:function(B){B=this.get(B);return B.nodeType==1&&"outerHTML" in B?B.outerHTML:o("<div>").append(o(B).clone()).html()},setOuterHTML:function(D,C){var B=this;B.$$(D).each(function(){try{if("outerHTML" in this){this.outerHTML=C;return}}catch(E){}B.remove(o(this).html(C),true)})},decode:l.decode,encode:l.encodeAllRaw,insertAfter:function(C,B){B=this.get(B);return this.run(C,function(E){var D,F;D=B.parentNode;F=B.nextSibling;if(F){D.insertBefore(E,F)}else{D.appendChild(E)}return E})},replace:function(D,C,E){var B=this;return B.run(C,function(F){if(q(F,"array")){D=D.cloneNode(true)}if(E){m(s(F.childNodes),function(G){D.appendChild(G)})}return F.parentNode.replaceChild(D,F)})},rename:function(E,C){var B=this,D;if(E.nodeName!=C.toUpperCase()){D=B.create(C);m(B.getAttribs(E),function(F){B.setAttrib(D,F.nodeName,B.getAttrib(E,F.nodeName))});B.replace(D,E,1)}return D||E},findCommonAncestor:function(D,B){var E=D,C;while(E){C=B;while(C&&E!=C){C=C.parentNode}if(E==C){break}E=E.parentNode}if(!E&&D.ownerDocument){return D.ownerDocument.documentElement}return E},toHex:function(B){return this.styles.toHex(i.trim(B))},run:function(F,E,D){var C=this,B;if(typeof F==="string"){F=C.get(F)}if(!F){return false}D=D||this;if(!F.nodeType&&(F.length||F.length===0)){B=[];m(F,function(H,G){if(H){if(typeof H=="string"){H=C.get(H)}B.push(E.call(D,H,G))}});return B}return E.call(D,F)},getAttribs:function(D){var B;D=this.get(D);if(!D){return[]}if(v){B=[];if(D.nodeName=="OBJECT"){return D.attributes}if(D.nodeName==="OPTION"&&this.getAttrib(D,"selected")){B.push({specified:1,nodeName:"selected"})}var C=/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi;D.cloneNode(false).outerHTML.replace(C,"").replace(/[\w:\-]+/gi,function(E){B.push({specified:1,nodeName:E})});return B}return D.attributes},isEmpty:function(E,C){var J=this,G,F,I,B,D,H=0;E=E.firstChild;if(E){B=new p(E,E.parentNode);C=C||(J.schema?J.schema.getNonEmptyElements():null);do{I=E.nodeType;if(I===1){if(E.getAttribute("data-mce-bogus")){continue}D=E.nodeName.toLowerCase();if(C&&C[D]){if(D==="br"){H++;continue}return false}F=J.getAttribs(E);G=F.length;while(G--){D=F[G].nodeName;if(D==="name"||D==="data-mce-bookmark"){return false}}}if(I==8){return false}if((I===3&&!A.test(E.nodeValue))){return false}}while((E=B.next()))}return H<=1},createRng:function(){var B=this.doc;return B.createRange?B.createRange():new z(this)},nodeIndex:function(E,F){var B=0,D,C;if(E){for(D=E.nodeType,E=E.previousSibling;E;E=E.previousSibling){C=E.nodeType;if(F&&C==3){if(C==D||!E.nodeValue.length){continue}}B++;D=C}}return B},split:function(F,G,C){var J=this,B=J.createRng(),H,E,I;function D(O){var M,L=O.childNodes,N=O.nodeType;function P(S){var R=S.previousSibling&&S.previousSibling.nodeName=="SPAN";var Q=S.nextSibling&&S.nextSibling.nodeName=="SPAN";return R&&Q}if(N==1&&O.getAttribute("data-mce-type")=="bookmark"){return}for(M=L.length-1;M>=0;M--){D(L[M])}if(N!=9){if(N==3&&O.nodeValue.length>0){var K=w(O.nodeValue).length;if(!J.isBlock(O.parentNode)||K>0||K===0&&P(O)){return}}else{if(N==1){L=O.childNodes;if(L.length==1&&L[0]&&L[0].nodeType==1&&L[0].getAttribute("data-mce-type")=="bookmark"){O.parentNode.insertBefore(L[0],O)}if(L.length||/^(br|hr|input|img)$/i.test(O.nodeName)){return}}}J.remove(O)}return O}if(F&&G){B.setStart(F.parentNode,J.nodeIndex(F));B.setEnd(G.parentNode,J.nodeIndex(G));H=B.extractContents();B=J.createRng();B.setStart(G.parentNode,J.nodeIndex(G)+1);B.setEnd(F.parentNode,J.nodeIndex(F)+1);E=B.extractContents();I=F.parentNode;I.insertBefore(D(H),F);if(C){I.replaceChild(C,G)}else{I.insertBefore(G,F)}I.insertBefore(D(E),F);J.remove(F);return C||G}},bind:function(G,C,F,E){var B=this;if(i.isArray(G)){var D=G.length;while(D--){G[D]=B.bind(G[D],C,F,E)}return G}if(B.settings.collect&&(G===B.doc||G===B.win)){B.boundEvents.push([G,C,F,E])}return B.events.bind(G,C,F,E||B)},unbind:function(G,C,F){var B=this,D;if(i.isArray(G)){D=G.length;while(D--){G[D]=B.unbind(G[D],C,F)}return G}if(B.boundEvents&&(G===B.doc||G===B.win)){D=B.boundEvents.length;while(D--){var E=B.boundEvents[D];if(G==E[0]&&(!C||C==E[1])&&(!F||F==E[2])){this.events.unbind(E[0],E[1],E[2])}}}return this.events.unbind(G,C,F)},fire:function(D,C,B){return this.events.fire(D,C,B)},getContentEditable:function(C){var B;if(!C||C.nodeType!=1){return null}B=C.getAttribute("data-mce-contenteditable");if(B&&B!=="inherit"){return B}return C.contentEditable!=="inherit"?C.contentEditable:null},getContentEditableParent:function(C){var B=this.getRoot(),D=null;for(;C&&C!==B;C=C.parentNode){D=this.getContentEditable(C);if(D!==null){break}}return D},destroy:function(){var B=this;if(B.boundEvents){var C=B.boundEvents.length;while(C--){var D=B.boundEvents[C];this.events.unbind(D[0],D[1],D[2])}B.boundEvents=null}if(k.setDocument){k.setDocument()}B.win=B.doc=B.root=B.events=B.frag=null},isChildOf:function(C,B){while(C){if(B===C){return true}C=C.parentNode}return false},dumpRng:function(B){return("startContainer: "+B.startContainer.nodeName+", startOffset: "+B.startOffset+", endContainer: "+B.endContainer.nodeName+", endOffset: "+B.endOffset)},_findSib:function(F,B,D){var C=this,E=B;if(F){if(typeof E=="string"){E=function(G){return C.is(G,B)}}for(F=F[D];F;F=F[D]){if(E(F)){return F}}}return null}};y.DOM=new y(document);return y});h("tinymce/dom/ScriptLoader",["tinymce/dom/DOMUtils","tinymce/util/Tools"],function(m,i){var k=m.DOM;var l=i.each,j=i.grep;function n(){var p=0,w=1,u=2,x={},v=[],r={},q=[],t=0,s;function o(A,E){var B=k,D,C;function y(){B.remove(C);if(D){D.onreadystatechange=D.onload=D=null}E()}function z(){if(typeof console!=="undefined"&&console.log){console.log("Failed to load: "+A)}}C=B.uniqueId();D=document.createElement("script");D.id=C;D.type="text/javascript";D.src=i._addCacheSuffix(A);if("onreadystatechange" in D){D.onreadystatechange=function(){if(/loaded|complete/.test(D.readyState)){y()}}}else{D.onload=y}D.onerror=z;(document.getElementsByTagName("head")[0]||document.body).appendChild(D)}this.isDone=function(y){return x[y]==u};this.markDone=function(y){x[y]=u};this.add=this.load=function(y,B,z){var A=x[y];if(A==s){v.push(y);x[y]=p}if(B){if(!r[y]){r[y]=[]}r[y].push({func:B,scope:z||this})}};this.loadQueue=function(z,y){this.loadScripts(v,z,y)};this.loadScripts=function(y,C,B){var A;function z(D){l(r[D],function(E){E.func.call(E.scope)});r[D]=s}q.push({func:C,scope:B||this});A=function(){var D=j(y);y.length=0;l(D,function(E){if(x[E]==u){z(E);return}if(x[E]!=w){x[E]=w;t++;o(E,function(){x[E]=u;t--;z(E);A()})}});if(!t){l(q,function(E){E.func.call(E.scope)});q.length=0}};A()}}n.ScriptLoader=new n();return n});h("tinymce/AddOnManager",["tinymce/dom/ScriptLoader","tinymce/util/Tools"],function(l,i){var k=i.each;function j(){var m=this;m.items=[];m.urls={};m.lookup={}}j.prototype={get:function(m){if(this.lookup[m]){return this.lookup[m].instance}else{return g}},dependencies:function(n){var m;if(this.lookup[n]){m=this.lookup[n].dependencies}return m||[]},requireLangPack:function(m,n){var o=j.language;if(o&&j.languageLoad!==false){if(n){n=","+n+",";if(n.indexOf(","+o.substr(0,2)+",")!=-1){o=o.substr(0,2)}else{if(n.indexOf(","+o+",")==-1){return}}}l.ScriptLoader.add(this.urls[m]+"/langs/"+o+".js")}},add:function(o,m,n){this.items.push(m);this.lookup[o]={instance:m,dependencies:n};return m},createUrl:function(m,n){if(typeof n==="object"){return n}else{return{prefix:m.prefix,resource:n,suffix:m.suffix}}},addComponents:function(o,m){var n=this.urls[o];k(m,function(p){l.ScriptLoader.add(n+"/"+p)})},load:function(o,q,s,p){var m=this,n=q;function r(){var t=m.dependencies(o);k(t,function(v){var u=m.createUrl(q,v);m.load(u.resource,u,g,g)});if(s){if(p){s.call(p)}else{s.call(l)}}}if(m.urls[o]){return}if(typeof q==="object"){n=q.prefix+q.resource+q.suffix}if(n.indexOf("/")!==0&&n.indexOf("://")==-1){n=j.baseURL+"/"+n}m.urls[o]=n.substring(0,n.lastIndexOf("/"));if(m.lookup[o]){r()}else{l.ScriptLoader.add(n,r,p)}}};j.PluginManager=new j();j.ThemeManager=new j();return j});h("tinymce/dom/RangeUtils",["tinymce/util/Tools","tinymce/dom/TreeWalker"],function(i,j){var l=i.each;function m(n,o){var p=n.childNodes;o--;if(o>p.length-1){o=p.length-1}else{if(o<0){o=0}}return p[o]||n}function k(n){this.walk=function(o,D){var t=o.startContainer,w=o.startOffset,E=o.endContainer,x=o.endOffset,u,r,z,s,C,B,p;p=n.select("td.mce-item-selected,th.mce-item-selected");if(p.length>0){l(p,function(F){D([F])});return}function q(F){var G;G=F[0];if(G.nodeType===3&&G===t&&w>=G.nodeValue.length){F.splice(0,1)}G=F[F.length-1];if(x===0&&F.length>0&&G===E&&G.nodeType===3){F.splice(F.length-1,1)}return F}function A(H,G,F){var I=[];for(;H&&H!=F;H=H[G]){I.push(H)}return I}function y(G,F){do{if(G.parentNode==F){return G}G=G.parentNode}while(G)}function v(H,G,I){var F=I?"nextSibling":"previousSibling";for(s=H,C=s.parentNode;s&&s!=G;s=C){C=s.parentNode;B=A(s==H?s:s[F],F);if(B.length){if(!I){B.reverse()}D(q(B))}}}if(t.nodeType==1&&t.hasChildNodes()){t=t.childNodes[w]}if(E.nodeType==1&&E.hasChildNodes()){E=m(E,x)}if(t==E){return D(q([t]))}u=n.findCommonAncestor(t,E);for(s=t;s;s=s.parentNode){if(s===E){return v(t,u,true)}if(s===u){break}}for(s=E;s;s=s.parentNode){if(s===t){return v(E,u)}if(s===u){break}}r=y(t,u)||t;z=y(E,u)||E;v(t,r,true);B=A(r==t?r:r.nextSibling,"nextSibling",z==E?z.nextSibling:z);if(B.length){D(q(B))}v(E,z)};this.split=function(p){var s=p.startContainer,o=p.startOffset,t=p.endContainer,r=p.endOffset;function q(u,v){return u.splitText(v)}if(s==t&&s.nodeType==3){if(o>0&&o<s.nodeValue.length){t=q(s,o);s=t.previousSibling;if(r>o){r=r-o;s=t=q(t,r).previousSibling;r=t.nodeValue.length;o=0}else{r=0}}}else{if(s.nodeType==3&&o>0&&o<s.nodeValue.length){s=q(s,o);o=0}if(t.nodeType==3&&r>0&&r<t.nodeValue.length){t=q(t,r).previousSibling;r=t.nodeValue.length}}return{startContainer:s,startOffset:o,endContainer:t,endOffset:r}};this.normalize=function(o){var r,q;function p(u){var t,x,s,z=n.getRoot(),v,y;var B,w;function D(E,F){var G=new j(E,n.getParent(E.parentNode,n.isBlock)||z);while((E=G[F?"prev":"next"]())){if(E.nodeName==="BR"){return true}}}function A(F,E){return F.previousSibling&&F.previousSibling.nodeName==E}function C(H,E){var I,F,G;E=E||t;G=n.getParent(E.parentNode,n.isBlock)||z;if(H&&E.nodeName=="BR"&&w&&n.isEmpty(G)){t=E.parentNode;x=n.nodeIndex(E);r=true;return}I=new j(E,G);while((v=I[H?"prev":"next"]())){if(n.getContentEditableParent(v)==="false"){return}if(v.nodeType===3&&v.nodeValue.length>0){t=v;x=H?v.nodeValue.length:0;r=true;return}if(n.isBlock(v)||y[v.nodeName.toLowerCase()]){return}F=v}if(q&&F){t=F;r=true;x=0}}t=o[(u?"start":"end")+"Container"];x=o[(u?"start":"end")+"Offset"];w=t.nodeType==1&&x===t.childNodes.length;y=n.schema.getNonEmptyElements();B=u;if(t.nodeType==1&&x>t.childNodes.length-1){B=false}if(t.nodeType===9){t=n.getRoot();x=0}if(t===z){if(B){v=t.childNodes[x>0?x-1:0];if(v){if(y[v.nodeName]||v.nodeName=="TABLE"){return}}}if(t.hasChildNodes()){x=Math.min(!B&&x>0?x-1:x,t.childNodes.length-1);t=t.childNodes[x];x=0;if(t.hasChildNodes()&&!/TABLE/.test(t.nodeName)){v=t;s=new j(t,z);do{if(v.nodeType===3&&v.nodeValue.length>0){x=B?0:v.nodeValue.length;t=v;r=true;break}if(y[v.nodeName.toLowerCase()]){x=n.nodeIndex(v);t=v.parentNode;if(v.nodeName=="IMG"&&!B){x++}r=true;break}}while((v=(B?s.next():s.prev())))}}}if(q){if(t.nodeType===3&&x===0){C(true)}if(t.nodeType===1){v=t.childNodes[x];if(!v){v=t.childNodes[x-1]}if(v&&v.nodeName==="BR"&&!A(v,"A")&&!D(v)&&!D(v,true)){C(true,v)}}}if(B&&!q&&t.nodeType===3&&x===t.nodeValue.length){C(false)}if(r){o["set"+(u?"Start":"End")](t,x)}}q=o.collapsed;p(true);if(!q){p()}if(r&&q){o.collapse(true)}return r}}k.compareRanges=function(o,n){if(o&&n){if(o.item||o.duplicate){if(o.item&&n.item&&o.item(0)===n.item(0)){return true}if(o.isEqual&&n.isEqual&&n.isEqual(o)){return true}}else{return o.startContainer==n.startContainer&&o.startOffset==n.startOffset}}return false};k.getCaretRangeFromPoint=function(o,s,r){var p,n;if(r.caretPositionFromPoint){n=r.caretPositionFromPoint(o,s);p=r.createRange();p.setStart(n.offsetNode,n.offset);p.collapse(true)}else{if(r.caretRangeFromPoint){p=r.caretRangeFromPoint(o,s)}else{if(r.body.createTextRange){p=r.body.createTextRange();try{p.moveToPoint(o,s);p.collapse(true)}catch(q){p.collapse(s<r.body.clientHeight)}}}}return p};k.getNode=function(n,o){if(n.nodeType==1&&n.hasChildNodes()){if(o>=n.childNodes.length){o=n.childNodes.length-1}n=n.childNodes[o]}return n};return k});h("tinymce/NodeChange",["tinymce/dom/RangeUtils","tinymce/Env"],function(j,i){return function(k){var m,l=[];function n(o){var p,q;q=k.$(o).parentsUntil(k.getBody()).add(o);if(q.length===l.length){for(p=q.length;p>=0;p--){if(q[p]!==l[p]){break}}if(p===-1){l=q;return true}}l=q;return false}if(!("onselectionchange" in k.getDoc())){k.on("NodeChange Click MouseUp KeyUp Focus",function(p){var q,o;q=k.selection.getRng();o={startContainer:q.startContainer,startOffset:q.startOffset,endContainer:q.endContainer,endOffset:q.endOffset};if(p.type=="nodechange"||!j.compareRanges(o,m)){k.fire("SelectionChange")}m=o})}k.on("contextmenu",function(){k.fire("SelectionChange")});k.on("SelectionChange",function(){var o=k.selection.getStart(true);if(!i.range&&k.selection.isCollapsed()){return}if(!n(o)&&k.dom.isChildOf(o,k.getBody())){k.nodeChanged({selectionChange:true})}});k.on("MouseUp",function(o){if(!o.isDefaultPrevented()){if(k.selection.getNode().nodeName=="IMG"){setTimeout(function(){k.nodeChanged()},0)}else{k.nodeChanged()}}});this.nodeChanged=function(q){var r=k.selection,s,p,o;if(k.initialized&&r&&!k.settings.disable_nodechange&&!k.settings.readonly){o=k.getBody();s=r.getStart()||o;s=s.ownerDocument!=k.getDoc()?k.getBody():s;if(s.nodeName=="IMG"&&r.isCollapsed()){s=s.parentNode}p=[];k.dom.getParent(s,function(t){if(t===o){return true}p.push(t)});q=q||{};q.element=s;q.parents=p;k.fire("NodeChange",q)}}}});h("tinymce/html/Node",[],function(){var k=/^[ \t\r\n]*$/,l={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};function i(r,s,q){var p,o,m=q?"lastChild":"firstChild",n=q?"prev":"next";if(r[m]){return r[m]}if(r!==s){p=r[n];if(p){return p}for(o=r.parent;o&&o!==s;o=o.parent){p=o[n];if(p){return p}}}}function j(m,n){this.name=m;this.type=n;if(n===1){this.attributes=[];this.attributes.map={}}}j.prototype={replace:function(n){var m=this;if(n.parent){n.remove()}m.insert(n,m);m.remove();return m},attr:function(o,r){var m=this,n,p,q;if(typeof o!=="string"){for(p in o){m.attr(p,o[p])}return m}if((n=m.attributes)){if(r!==q){if(r===null){if(o in n.map){delete n.map[o];p=n.length;while(p--){if(n[p].name===o){n=n.splice(p,1);return m}}}return m}if(o in n.map){p=n.length;while(p--){if(n[p].name===o){n[p].value=r;break}}}else{n.push({name:o,value:r})}n.map[o]=r;return m}else{return n.map[o]}}},clone:function(){var n=this,s=new j(n.name,n.type),o,m,r,p,q;if((r=n.attributes)){q=[];q.map={};for(o=0,m=r.length;o<m;o++){p=r[o];if(p.name!=="id"){q[q.length]={name:p.name,value:p.value};q.map[p.name]=p.value}}s.attributes=q}s.value=n.value;s.shortEnded=n.shortEnded;return s},wrap:function(n){var m=this;m.parent.insert(n,m);n.append(m);return m},unwrap:function(){var m=this,o,n;for(o=m.firstChild;o;){n=o.next;m.insert(o,m,true);o=n}m.remove()},remove:function(){var m=this,o=m.parent,n=m.next,p=m.prev;if(o){if(o.firstChild===m){o.firstChild=n;if(n){n.prev=null}}else{p.next=n}if(o.lastChild===m){o.lastChild=p;if(p){p.next=null}}else{n.prev=p}m.parent=m.next=m.prev=null}return m},append:function(o){var m=this,n;if(o.parent){o.remove()}n=m.lastChild;if(n){n.next=o;o.prev=n;m.lastChild=o}else{m.lastChild=m.firstChild=o}o.parent=m;return o},insert:function(o,m,p){var n;if(o.parent){o.remove()}n=m.parent||this;if(p){if(m===n.firstChild){n.firstChild=o}else{m.prev.next=o}o.prev=m.prev;o.next=m;m.prev=o}else{if(m===n.lastChild){n.lastChild=o}else{m.next.prev=o}o.next=m.next;o.prev=m;m.next=o}o.parent=n;return o},getAll:function(n){var m=this,o,p=[];for(o=m.firstChild;o;o=i(o,m)){if(o.name===n){p.push(o)}}return p},empty:function(){var n=this,m,o,p;if(n.firstChild){m=[];for(p=n.firstChild;p;p=i(p,n)){m.push(p)}o=m.length;while(o--){p=m[o];p.parent=p.firstChild=p.lastChild=p.next=p.prev=null}}n.firstChild=n.lastChild=null;return n},isEmpty:function(q){var m=this,p=m.firstChild,o,n;if(p){do{if(p.type===1){if(p.attributes.map["data-mce-bogus"]){continue}if(q[p.name]){return false}o=p.attributes.length;while(o--){n=p.attributes[o].name;if(n==="name"||n.indexOf("data-mce-bookmark")===0){return false}}}if(p.type===8){return false}if((p.type===3&&!k.test(p.value))){return false}}while((p=i(p,m)))}return true},walk:function(m){return i(this,null,m)}};j.create=function(n,m){var p,o;p=new j(n,l[n]||1);if(m){for(o in m){p.attr(o,m[o])}}return p};return j});h("tinymce/html/Schema",["tinymce/util/Tools"],function(j){var k={},m={};var l=j.makeMap,q=j.each,n=j.extend,p=j.explode,s=j.inArray;function o(t,u){return t?t.split(u||" "):[]}function r(A){var x={},B,u;var y,z,t,w;function C(G,D,J){var I,H,K,F=arguments;function E(P,O){var N={},M,L;for(M=0,L=P.length;M<L;M++){N[P[M]]=O||{}}return N}J=J||[];D=D||"";if(typeof J==="string"){J=o(J)}for(H=3;H<F.length;H++){if(typeof F[H]==="string"){F[H]=o(F[H])}J.push.apply(J,F[H])}G=o(G);I=G.length;while(I--){K=[].concat(B,o(D));x[G[I]]={attributes:E(K),attributesOrder:K,children:E(J,m)}}}function v(G,F){var I,E,H,D;G=o(G);I=G.length;F=o(F);while(I--){E=x[G[I]];for(H=0,D=F.length;H<D;H++){E.attributes[F[H]]={};E.attributesOrder.push(F[H])}}}if(k[A]){return k[A]}B=o("id accesskey class dir lang style tabindex title");u=o("address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul");y=o("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");if(A!="html4"){B.push.apply(B,o("contenteditable contextmenu draggable dropzone hidden spellcheck translate"));u.push.apply(u,o("article aside details dialog figure header footer hgroup section nav"));y.push.apply(y,o("audio canvas command datalist mark meter output progress time wbr video ruby bdi keygen"))}if(A!="html5-strict"){B.push("xml:lang");w=o("acronym applet basefont big font strike tt");y.push.apply(y,w);q(w,function(D){C(D,"",y)});t=o("center dir isindex noframes");u.push.apply(u,t);z=[].concat(u,y);q(t,function(D){C(D,"",z)})}z=z||[].concat(u,y);C("html","manifest","head body");C("head","","base command link meta noscript script style title");C("title hr noscript br");C("base","href target");C("link","href rel media hreflang type sizes hreflang");C("meta","name http-equiv content charset");C("style","media type scoped");C("script","src async defer type charset");C("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",z);C("address dt dd div caption","",z);C("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","",y);C("blockquote","cite",z);C("ol","reversed start type","li");C("ul","","li");C("li","value",z);C("dl","","dt dd");C("a","href target rel media hreflang type",y);C("q","cite",y);C("ins del","cite datetime",z);C("img","src sizes srcset alt usemap ismap width height");C("iframe","src name width height",z);C("embed","src type width height");C("object","data type typemustmatch name usemap form width height",z,"param");C("param","name value");C("map","name",z,"area");C("area","alt coords shape href target rel media hreflang type");C("table","border","caption colgroup thead tfoot tbody tr"+(A=="html4"?" col":""));C("colgroup","span","col");C("col","span");C("tbody thead tfoot","","tr");C("tr","","td th");C("td","colspan rowspan headers",z);C("th","colspan rowspan headers scope abbr",z);C("form","accept-charset action autocomplete enctype method name novalidate target",z);C("fieldset","disabled form name",z,"legend");C("label","form for",y);C("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");C("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value",A=="html4"?z:y);C("select","disabled form multiple name required size","option optgroup");C("optgroup","disabled label","option");C("option","disabled label selected value");C("textarea","cols dirname disabled form maxlength name readonly required rows wrap");C("menu","type label",z,"li");C("noscript","",z);if(A!="html4"){C("wbr");C("ruby","",y,"rt rp");C("figcaption","",z);C("mark rt rp summary bdi","",y);C("canvas","width height",z);C("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",z,"track source");C("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",z,"track source");C("picture","","img source");C("source","src srcset type media sizes");C("track","kind src srclang label default");C("datalist","",y,"option");C("article section nav aside header footer","",z);C("hgroup","","h1 h2 h3 h4 h5 h6");C("figure","",z,"figcaption");C("time","datetime",y);C("dialog","open",z);C("command","type label icon disabled checked radiogroup command");C("output","for form name",y);C("progress","value max",y);C("meter","value min max low high optimum",y);C("details","open",z,"summary");C("keygen","autofocus challenge disabled form keytype name")}if(A!="html5-strict"){v("script","language xml:space");v("style","xml:space");v("object","declare classid code codebase codetype archive standby align border hspace vspace");v("embed","align name hspace vspace");v("param","valuetype type");v("a","charset name rev shape coords");v("br","clear");v("applet","codebase archive code object alt name width height align hspace vspace");v("img","name longdesc align border hspace vspace");v("iframe","longdesc frameborder marginwidth marginheight scrolling align");v("font basefont","size color face");v("input","usemap align");v("select","onchange");v("textarea");v("h1 h2 h3 h4 h5 h6 div p legend caption","align");v("ul","type compact");v("li","type");v("ol dl menu dir","compact");v("pre","width xml:space");v("hr","align noshade size width");v("isindex","prompt");v("table","summary width frame rules cellspacing cellpadding align bgcolor");v("col","width align char charoff valign");v("colgroup","width align char charoff valign");v("thead","align char charoff valign");v("tr","align char charoff valign bgcolor");v("th","axis align char charoff valign nowrap bgcolor width height");v("form","accept");v("td","abbr axis scope align char charoff valign nowrap bgcolor width height");v("tfoot","align char charoff valign");v("tbody","align char charoff valign");v("area","nohref");v("body","background bgcolor text link vlink alink")}if(A!="html4"){v("input button select textarea","autofocus");v("input textarea","placeholder");v("a","download");v("link script img","crossorigin");v("iframe","sandbox seamless allowfullscreen")}q(o("a form meter progress dfn"),function(D){if(x[D]){delete x[D].children[D]}});delete x.caption.children.table;k[A]=x;return x}function i(u,v){var t;if(u){t={};if(typeof u=="string"){u={"*":u}}q(u,function(x,w){t[w]=t[w.toUpperCase()]=v=="map"?l(x,/[, ]/):p(x,/[, ]/)})}return t}return function(P){var K=this,I={},x={},w=[],T,t,N;var D,F,O,G,H;var L,C,B,u,S;var E={},y={};function A(W,U,V){var X=P[W];if(!X){X=k[W];if(!X){X=l(U," ",l(U.toUpperCase()," "));X=n(X,V);k[W]=X}}else{X=l(X,/[, ]/,l(X.toUpperCase(),/[, ]/))}return X}P=P||{};N=r(P.schema);if(P.verify_html===false){P.valid_elements="*[*]"}T=i(P.valid_styles);t=i(P.invalid_styles,"map");H=i(P.valid_classes,"map");D=A("whitespace_elements","pre script noscript style textarea video audio iframe object");F=A("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr");O=A("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track");G=A("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls");C=A("non_empty_elements","td th iframe video audio object script",O);B=A("move_caret_before_on_enter_elements","table",C);u=A("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");L=A("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup",u);S=A("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp");q((P.special||"script noscript style textarea").split(" "),function(U){y[U]=new RegExp("</"+U+"[^>]*>","gi")});function v(U){return new RegExp("^"+U.replace(/([?+*])/g,".$1")+"$")}function R(ag){var aa,W,aq,am,V,Y,ak,ao,ae,ap,ar,ad,Z,an,U,ah,X,at,aj,ac=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,af=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,ab=/[*?+]/;if(ag){ag=o(ag,",");if(I["@"]){ah=I["@"].attributes;X=I["@"].attributesOrder}for(aa=0,W=ag.length;aa<W;aa++){V=ac.exec(ag[aa]);if(V){an=V[1];ae=V[2];U=V[3];ao=V[5];ad={};Z=[];Y={attributes:ad,attributesOrder:Z};if(an==="#"){Y.paddEmpty=true}if(an==="-"){Y.removeEmpty=true}if(V[4]==="!"){Y.removeEmptyAttrs=true}if(ah){for(at in ah){ad[at]=ah[at]}Z.push.apply(Z,X)}if(ao){ao=o(ao,"|");for(aq=0,am=ao.length;aq<am;aq++){V=af.exec(ao[aq]);if(V){ak={};ar=V[1];ap=V[2].replace(/::/g,":");an=V[3];aj=V[4];if(ar==="!"){Y.attributesRequired=Y.attributesRequired||[];Y.attributesRequired.push(ap);ak.required=true}if(ar==="-"){delete ad[ap];Z.splice(s(Z,ap),1);continue}if(an){if(an==="="){Y.attributesDefault=Y.attributesDefault||[];Y.attributesDefault.push({name:ap,value:aj});ak.defaultValue=aj}if(an===":"){Y.attributesForced=Y.attributesForced||[];Y.attributesForced.push({name:ap,value:aj});ak.forcedValue=aj}if(an==="<"){ak.validValues=l(aj,"?")}}if(ab.test(ap)){Y.attributePatterns=Y.attributePatterns||[];ak.pattern=v(ap);Y.attributePatterns.push(ak)}else{if(!ad[ap]){Z.push(ap)}ad[ap]=ak}}}}if(!ah&&ae=="@"){ah=ad;X=Z}if(U){Y.outputName=ae;I[U]=Y}if(ab.test(ae)){Y.pattern=v(ae);w.push(Y)}else{I[ae]=Y}}}}}function J(U){I={};w=[];R(U);q(N,function(W,V){x[V]=W.children})}function z(V){var U=/^(~)?(.+)$/;if(V){k.text_block_elements=k.block_elements=null;q(o(V,","),function(aa){var Y=U.exec(aa),Z=Y[1]==="~",ab=Z?"span":"div",X=Y[2];x[X]=x[ab];E[X]=ab;if(!Z){L[X.toUpperCase()]={};L[X]={}}if(!I[X]){var W=I[ab];W=n({},W);delete W.removeEmptyAttrs;delete W.removeEmpty;I[X]=W}q(x,function(ac,ad){if(ac[ab]){x[ad]=ac=n({},x[ad]);ac[X]=ac[ab]}})})}}function M(U){var V=/^([+\-]?)(\w+)\[([^\]]+)\]$/;if(U){q(o(U,","),function(Z){var Y=V.exec(Z),W,X;if(Y){X=Y[1];if(X){W=x[Y[2]]}else{W=x[Y[2]]={"#comment":{}}}W=x[Y[2]];q(o(Y[3],"|"),function(aa){if(X==="-"){x[Y[2]]=W=n({},x[Y[2]]);delete W[aa]}else{W[aa]={}}})}})}}function Q(U){var W=I[U],V;if(W){return W}V=w.length;while(V--){W=w[V];if(W.pattern.test(U)){return W}}}if(!P.valid_elements){q(N,function(V,U){I[U]={attributes:V.attributes,attributesOrder:V.attributesOrder};x[U]=V.children});if(P.schema!="html5"){q(o("strong/b em/i"),function(U){U=o(U,"/");I[U[1]].outputName=U[0]})}I.img.attributesDefault=[{name:"alt",value:""}];q(o("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(U){if(I[U]){I[U].removeEmpty=true}});q(o("p h1 h2 h3 h4 h5 h6 th td pre div address caption"),function(U){I[U].paddEmpty=true});q(o("span"),function(U){I[U].removeEmptyAttrs=true})}else{J(P.valid_elements)}z(P.custom_elements);M(P.valid_children);R(P.extended_valid_elements);M("+ol[ul|ol],+ul[ul|ol]");if(P.invalid_elements){q(p(P.invalid_elements),function(U){if(I[U]){delete I[U]}})}if(!Q("span")){R("span[!data-mce-type|*]")}K.children=x;K.getValidStyles=function(){return T};K.getInvalidStyles=function(){return t};K.getValidClasses=function(){return H};K.getBoolAttrs=function(){return G};K.getBlockElements=function(){return L};K.getTextBlockElements=function(){return u};K.getTextInlineElements=function(){return S};K.getShortEndedElements=function(){return O};K.getSelfClosingElements=function(){return F};K.getNonEmptyElements=function(){return C};K.getMoveCaretBeforeOnEnterElements=function(){return B};K.getWhiteSpaceElements=function(){return D};K.getSpecialElements=function(){return y};K.isValidChild=function(U,W){var V=x[U];return !!(V&&V[W])};K.isValid=function(V,U){var X,W,Y=Q(V);if(Y){if(U){if(Y.attributes[U]){return true}X=Y.attributePatterns;if(X){W=X.length;while(W--){if(X[W].pattern.test(V)){return true}}}}else{return true}}return false};K.getElementRule=Q;K.getCustomElements=function(){return E};K.addValidElements=R;K.setValidElements=J;K.addCustomElements=z;K.addValidChildren=M;K.elements=I}});h("tinymce/html/SaxParser",["tinymce/html/Schema","tinymce/html/Entities","tinymce/util/Tools"],function(l,n,k){var m=k.each;function j(s,q,v){var r=1,o,u,t,p;p=s.getShortEndedElements();t=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g;t.lastIndex=o=v;while((u=t.exec(q))){o=t.lastIndex;if(u[1]==="/"){r--}else{if(!u[1]){if(u[2] in p){continue}r++}}if(r===0){break}}return o}function i(p,r){var o=this;function q(){}p=p||{};o.schema=r=r||new l();if(p.fix_self_closing!==false){p.fix_self_closing=true}m("comment cdata text start end pi doctype".split(" "),function(s){if(s){o[s]=p[s]||q}});o.parse=function(P){var B=this,t,R=0,U,M,L=[],Z,ac,N,D;var K,E,Y,S,aa;var H,A,x,F,ae,ab,Q;var af,X,s;var ad,V,y,O,W,u,I=0;var w=n.decode,J,T=k.makeMap("src,href,data,background,formaction,poster");var v=/((java|vb)script|mhtml):/i,z=/^data:/i;function G(ag){var ai,ah;ai=L.length;while(ai--){if(L[ai].name===ag){break}}if(ai>=0){for(ah=L.length-1;ah>=ai;ah--){ag=L[ah];if(ag.valid){B.end(ag.name)}}L.length=ai}}function C(al,ah,ap,an,am){var aj,ak,ag=/[\s\u0000-\u001F]+/g;ah=ah.toLowerCase();ap=ah in S?ah:w(ap||an||am||"");if(H&&!K&&ah.indexOf("data-")!==0){aj=ab[ah];if(!aj&&Q){ak=Q.length;while(ak--){aj=Q[ak];if(aj.pattern.test(ah)){break}}if(ak===-1){aj=null}}if(!aj){return}if(aj.validValues&&!(ap in aj.validValues)){return}}if(T[ah]&&!p.allow_script_urls){var ai=ap.replace(ag,"");try{ai=decodeURIComponent(ai)}catch(ao){ai=unescape(ai)}if(v.test(ai)){return}if(!p.allow_html_data_urls&&z.test(ai)&&!/^data:image\//i.test(ai)){return}}Z.map[ah]=ap;Z.push({name:ah,value:ap})}y=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-_\\:\\.]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g");O=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g;Y=r.getShortEndedElements();V=p.self_closing_elements||r.getSelfClosingElements();S=r.getBoolAttrs();H=p.validate;E=p.remove_internals;J=p.fix_self_closing;W=r.getSpecialElements();while((t=y.exec(P))){if(R<t.index){B.text(w(P.substr(R,t.index-R)))}if((U=t[6])){U=U.toLowerCase();if(U.charAt(0)===":"){U=U.substr(1)}G(U)}else{if((U=t[7])){U=U.toLowerCase();if(U.charAt(0)===":"){U=U.substr(1)}aa=U in Y;if(J&&V[U]&&L.length>0&&L[L.length-1].name===U){G(U)}if(!H||(A=r.getElementRule(U))){x=true;if(H){ab=A.attributes;Q=A.attributePatterns}if((ae=t[8])){K=ae.indexOf("data-mce-type")!==-1;if(K&&E){x=false}Z=[];Z.map={};ae.replace(O,C)}else{Z=[];Z.map={}}if(H&&!K){af=A.attributesRequired;X=A.attributesDefault;s=A.attributesForced;ad=A.removeEmptyAttrs;if(ad&&!Z.length){x=false}if(s){ac=s.length;while(ac--){F=s[ac];D=F.name;u=F.value;if(u==="{$uid}"){u="mce_"+I++}Z.map[D]=u;Z.push({name:D,value:u})}}if(X){ac=X.length;while(ac--){F=X[ac];D=F.name;if(!(D in Z.map)){u=F.value;if(u==="{$uid}"){u="mce_"+I++}Z.map[D]=u;Z.push({name:D,value:u})}}}if(af){ac=af.length;while(ac--){if(af[ac] in Z.map){break}}if(ac===-1){x=false}}if((F=Z.map["data-mce-bogus"])){if(F==="all"){R=j(r,P,y.lastIndex);y.lastIndex=R;continue}x=false}}if(x){B.start(U,Z,aa)}}else{x=false}if((M=W[U])){M.lastIndex=R=t.index+t[0].length;if((t=M.exec(P))){if(x){N=P.substr(R,t.index-R)}R=t.index+t[0].length}else{N=P.substr(R);R=P.length}if(x){if(N.length>0){B.text(N,true)}B.end(U)}y.lastIndex=R;continue}if(!aa){if(!ae||ae.indexOf("/")!=ae.length-1){L.push({name:U,valid:x})}else{if(x){B.end(U)}}}}else{if((U=t[1])){if(U.charAt(0)===">"){U=" "+U}if(!p.allow_conditional_comments&&U.substr(0,3)==="[if"){U=" "+U}B.comment(U)}else{if((U=t[2])){B.cdata(U)}else{if((U=t[3])){B.doctype(U)}else{if((U=t[4])){B.pi(U,t[5])}}}}}}R=t.index+t[0].length}if(R<P.length){B.text(w(P.substr(R)))}for(ac=L.length-1;ac>=0;ac--){U=L[ac];if(U.valid){B.end(U.name)}}}}i.findEndTag=j;return i});h("tinymce/html/DomParser",["tinymce/html/Node","tinymce/html/Schema","tinymce/html/SaxParser","tinymce/util/Tools"],function(k,m,i,j){var n=j.makeMap,o=j.each,l=j.explode,p=j.extend;return function(u,v){var t=this,s={},r=[],w={},q={};u=u||{};u.validate="validate" in u?u.validate:true;u.root_name=u.root_name||"body";t.schema=v=v||new m();function x(B){var D,E,K,J,M,C,F,z,I;var y,H,A,L,G;H=n("tr,td,th,tbody,thead,tfoot,table");y=v.getNonEmptyElements();A=v.getTextBlockElements();for(D=0;D<B.length;D++){E=B[D];if(!E.parent||E.fixed){continue}if(A[E.name]&&E.parent.name=="li"){L=E.next;while(L){if(A[L.name]){L.name="li";L.fixed=true;E.parent.insert(L,E.parent)}else{break}L=L.next}E.unwrap(E);continue}J=[E];for(K=E.parent;K&&!v.isValidChild(K.name,E.name)&&!H[K.name];K=K.parent){J.push(K)}if(K&&J.length>1){J.reverse();M=C=t.filterNode(J[0].clone());for(I=0;I<J.length-1;I++){if(v.isValidChild(C.name,J[I].name)){F=t.filterNode(J[I].clone());C.append(F)}else{F=C}for(z=J[I].firstChild;z&&z!=J[I+1];){G=z.next;F.append(z);z=G}C=F}if(!M.isEmpty(y)){K.insert(M,J[0],true);K.insert(E,M)}else{K.insert(E,J[0],true)}K=J[0];if(K.isEmpty(y)||K.firstChild===K.lastChild&&K.firstChild.name==="br"){K.empty().remove()}}else{if(E.parent){if(E.name==="li"){L=E.prev;if(L&&(L.name==="ul"||L.name==="ul")){L.append(E);continue}L=E.next;if(L&&(L.name==="ul"||L.name==="ul")){L.insert(E,L.firstChild,true);continue}E.wrap(t.filterNode(new k("ul",1)));continue}if(v.isValidChild(E.parent.name,"div")&&v.isValidChild("div",E.name)){E.wrap(t.filterNode(new k("div",1)))}else{if(E.name==="style"||E.name==="script"){E.empty().remove()}else{E.unwrap()}}}}}}t.filterNode=function(A){var z,y,B;if(y in s){B=w[y];if(B){B.push(A)}else{w[y]=[A]}}z=r.length;while(z--){y=r[z].name;if(y in A.attributes.map){B=q[y];if(B){B.push(A)}else{q[y]=[A]}}}return A};t.addNodeFilter=function(y,z){o(l(y),function(A){var B=s[A];if(!B){s[A]=B=[]}B.push(z)})};t.addAttributeFilter=function(y,z){o(l(y),function(A){var B;for(B=0;B<r.length;B++){if(r[B].name===A){r[B].callbacks.push(z);return}}r.push({name:A,callbacks:[z]})})};t.parse=function(I,z){var A,V,N,M,P,O,J,E,R,Z,L;var B,Q,Y=[],X;var G,y,K,F;var C,H,D;z=z||{};w={};q={};B=p(n("script,style,head,html,body,title,meta,param"),v.getBlockElements());H=v.getNonEmptyElements();C=v.children;L=u.validate;D="forced_root_block" in z?z.forced_root_block:u.forced_root_block;F=v.getWhiteSpaceElements();Q=/^[ \t\r\n]+/;G=/[ \t\r\n]+$/;y=/[ \t\r\n]+/g;K=/^[ \t\r\n]+$/;function S(){var ac=V.firstChild,ab,ad;function aa(ae){if(ae){ac=ae.firstChild;if(ac&&ac.type==3){ac.value=ac.value.replace(Q,"")}ac=ae.lastChild;if(ac&&ac.type==3){ac.value=ac.value.replace(G,"")}}}if(!v.isValidChild(V.name,D.toLowerCase())){return}while(ac){ab=ac.next;if(ac.type==3||(ac.type==1&&ac.name!=="p"&&!B[ac.name]&&!ac.attr("data-mce-type"))){if(!ad){ad=W(D,1);ad.attr(u.forced_root_block_attrs);V.insert(ad,ac);ad.append(ac)}else{ad.append(ac)}}else{aa(ad);ad=null}ac=ab}aa(ad)}function W(aa,ab){var ac=new k(aa,ab),ad;if(aa in s){ad=w[aa];if(ad){ad.push(ac)}else{w[aa]=[ac]}}return ac}function U(ac){var ad,aa,ab;for(ad=ac.prev;ad&&ad.type===3;){aa=ad.value.replace(G,"");if(aa.length>0){ad.value=aa;ad=ad.prev}else{ab=ad.prev;ad.remove();ad=ab}}}function T(ab){var ac,aa={};for(ac in ab){if(ac!=="li"&&ac!="p"){aa[ac]=ab[ac]}}return aa}A=new i({validate:L,allow_script_urls:u.allow_script_urls,allow_conditional_comments:u.allow_conditional_comments,self_closing_elements:T(v.getSelfClosingElements()),cdata:function(aa){N.append(W("#cdata",4)).value=aa},text:function(ac,aa){var ab;if(!X){ac=ac.replace(y," ");if(N.lastChild&&B[N.lastChild.name]){ac=ac.replace(Q,"")}}if(ac.length!==0){ab=W("#text",3);ab.raw=!!aa;N.append(ab).value=ac}},comment:function(aa){N.append(W("#comment",8)).value=aa},pi:function(aa,ab){N.append(W(aa,7)).value=ab;U(N)},doctype:function(ab){var aa;aa=N.append(W("#doctype",10));aa.value=ab;U(N)},start:function(ac,ab,ah){var ae,aa,ag,ad,af;ag=L?v.getElementRule(ac):{};if(ag){ae=W(ag.outputName||ac,1);ae.attributes=ab;ae.shortEnded=ah;N.append(ae);af=C[N.name];if(af&&C[ae.name]&&!af[ae.name]){Y.push(ae)}aa=r.length;while(aa--){ad=r[aa].name;if(ad in ab.map){R=q[ad];if(R){R.push(ae)}else{q[ad]=[ae]}}}if(B[ac]){U(ae)}if(!ah){N=ae}if(!X&&F[ac]){X=true}}},end:function(aa){var af,ac,ae,ab,ad;ac=L?v.getElementRule(aa):{};if(ac){if(B[aa]){if(!X){af=N.firstChild;if(af&&af.type===3){ae=af.value.replace(Q,"");if(ae.length>0){af.value=ae;af=af.next}else{ab=af.next;af.remove();af=ab;while(af&&af.type===3){ae=af.value;ab=af.next;if(ae.length===0||K.test(ae)){af.remove();af=ab}af=ab}}}af=N.lastChild;if(af&&af.type===3){ae=af.value.replace(G,"");if(ae.length>0){af.value=ae;af=af.prev}else{ab=af.prev;af.remove();af=ab;while(af&&af.type===3){ae=af.value;ab=af.prev;if(ae.length===0||K.test(ae)){af.remove();af=ab}af=ab}}}}}if(X&&F[aa]){X=false}if(ac.removeEmpty||ac.paddEmpty){if(N.isEmpty(H)){if(ac.paddEmpty){N.empty().append(new k("#text","3")).value="\u00a0"}else{if(!N.attributes.map.name&&!N.attributes.map.id){ad=N.parent;if(B[N.name]){N.empty().remove()}else{N.unwrap()}N=ad;return}}}}N=N.parent}}},v);V=N=new k(z.context||u.root_name,11);A.parse(I);if(L&&Y.length){if(!z.context){x(Y)}else{z.invalid=true}}if(D&&(V.name=="body"||z.isRootContent)){S()}if(!z.invalid){for(Z in w){R=s[Z];M=w[Z];J=M.length;while(J--){if(!M[J].parent){M.splice(J,1)}}for(P=0,O=R.length;P<O;P++){R[P](M,Z,z)}}for(P=0,O=r.length;P<O;P++){R=r[P];if(R.name in q){M=q[R.name];J=M.length;while(J--){if(!M[J].parent){M.splice(J,1)}}for(J=0,E=R.callbacks.length;J<E;J++){R.callbacks[J](M,R.name,z)}}}}return V};if(u.remove_trailing_brs){t.addNodeFilter("br",function(z){var E,D=z.length,A,J=p({},v.getBlockElements());var y=v.getNonEmptyElements(),H,F,C,I;var G,B;J.body=1;for(E=0;E<D;E++){A=z[E];H=A.parent;if(J[A.parent.name]&&A===H.lastChild){C=A.prev;while(C){I=C.name;if(I!=="span"||C.attr("data-mce-type")!=="bookmark"){if(I!=="br"){break}if(I==="br"){A=null;break}}C=C.prev}if(A){A.remove();if(H.isEmpty(y)){G=v.getElementRule(H.name);if(G){if(G.removeEmpty){H.remove()}else{if(G.paddEmpty){H.empty().append(new k("#text",3)).value="\u00a0"}}}}}}else{F=A;while(H&&H.firstChild===F&&H.lastChild===F){F=H;if(J[H.name]){break}H=H.parent}if(F===H){B=new k("#text",3);B.value="\u00a0";A.replace(B)}}}})}if(!u.allow_html_in_named_anchor){t.addAttributeFilter("id,name",function(y){var A=y.length,C,z,B,D;while(A--){D=y[A];if(D.name==="a"&&D.firstChild&&!D.attr("href")){B=D.parent;C=D.lastChild;do{z=C.prev;B.insert(C,D);C=z}while(C)}}})}if(u.validate&&v.getValidClasses()){t.addAttributeFilter("class",function(z){var D=z.length,C,A,H,F,B;var G=v.getValidClasses(),E,y;while(D--){C=z[D];A=C.attr("class").split(" ");B="";for(H=0;H<A.length;H++){F=A[H];y=false;E=G["*"];if(E&&E[F]){y=true}E=G[C.name];if(!y&&E&&E[F]){y=true}if(y){if(B){B+=" "}B+=F}}if(!B.length){B=null}C.attr("class",B)}})}}});h("tinymce/html/Writer",["tinymce/html/Entities","tinymce/util/Tools"],function(k,i){var j=i.makeMap;return function(p){var n=[],l,m,o,q,r;p=p||{};l=p.indent;m=j(p.indent_before||"");o=j(p.indent_after||"");q=k.getEncodeFunc(p.entity_encoding||"raw",p.entities);r=p.element_format=="html";return{start:function(v,u,y){var w,t,s,x;if(l&&m[v]&&n.length>0){x=n[n.length-1];if(x.length>0&&x!=="\n"){n.push("\n")}}n.push("<",v);if(u){for(w=0,t=u.length;w<t;w++){s=u[w];n.push(" ",s.name,'="',q(s.value,true),'"')}}if(!y||r){n[n.length]=">"}else{n[n.length]=" />"}if(y&&l&&o[v]&&n.length>0){x=n[n.length-1];if(x.length>0&&x!=="\n"){n.push("\n")}}},end:function(s){var t;n.push("</",s,">");if(l&&o[s]&&n.length>0){t=n[n.length-1];if(t.length>0&&t!=="\n"){n.push("\n")}}},text:function(t,s){if(t.length>0){n[n.length]=s?t:q(t)}},cdata:function(s){n.push("<![CDATA[",s,"]]>")},comment:function(s){n.push("<!--",s,"-->")},pi:function(s,t){if(t){n.push("<?",s," ",q(t),"?>")}else{n.push("<?",s,"?>")}if(l){n.push("\n")}},doctype:function(s){n.push("<!DOCTYPE",s,">",l?"\n":"")},reset:function(){n.length=0},getContent:function(){return n.join("").replace(/\n$/,"")}}}});h("tinymce/html/Serializer",["tinymce/html/Writer","tinymce/html/Schema"],function(j,i){return function(l,m){var k=this,n=new j(l);l=l||{};l.validate="validate" in l?l.validate:true;k.schema=m=m||new i();k.writer=n;k.serialize=function(q){var p,r;r=l.validate;p={3:function(s){n.text(s.value,s.raw)},8:function(s){n.comment(s.value)},7:function(s){n.pi(s.name,s.value)},10:function(s){n.doctype(s.value)},4:function(s){n.cdata(s.value)},11:function(s){if((s=s.firstChild)){do{o(s)}while((s=s.next))}}};n.reset();function o(t){var B=p[t.type],s,w,A,z,x,C,v,u,y;if(!B){s=t.name;w=t.shortEnded;A=t.attributes;if(r&&A&&A.length>1){C=[];C.map={};y=m.getElementRule(t.name);for(v=0,u=y.attributesOrder.length;v<u;v++){z=y.attributesOrder[v];if(z in A.map){x=A.map[z];C.map[z]=x;C.push({name:z,value:x})}}for(v=0,u=A.length;v<u;v++){z=A[v].name;if(!(z in C.map)){x=A.map[z];C.map[z]=x;C.push({name:z,value:x})}}A=C}n.start(t.name,A,w);if(!w){if((t=t.firstChild)){do{o(t)}while((t=t.next))}n.end(s)}}else{B(t)}}if(q.type==1&&!l.inner){o(q)}else{p[11](q)}return n.getContent()}}});h("tinymce/dom/Serializer",["tinymce/dom/DOMUtils","tinymce/html/DomParser","tinymce/html/Entities","tinymce/html/Serializer","tinymce/html/Node","tinymce/html/Schema","tinymce/Env","tinymce/util/Tools"],function(p,s,j,o,m,l,n,k){var q=k.each,i=k.trim;var r=p.DOM;return function(v,u){var x,w,t;if(u){x=u.dom;w=u.schema}x=x||r;w=w||new l(v);v.entity_encoding=v.entity_encoding||"named";v.remove_trailing_brs="remove_trailing_brs" in v?v.remove_trailing_brs:true;t=new s(v,w);t.addAttributeFilter("data-mce-tabindex",function(y,z){var A=y.length,B;while(A--){B=y[A];B.attr("tabindex",B.attributes.map["data-mce-tabindex"]);B.attr(z,null)}});t.addAttributeFilter("src,href,style",function(z,y){var D=z.length,A,F,C="data-mce-"+y;var E=v.url_converter,G=v.url_converter_scope,B;while(D--){A=z[D];F=A.attributes.map[C];if(F!==B){A.attr(y,F.length>0?F:null);A.attr(C,null)}else{F=A.attributes.map[y];if(y==="style"){F=x.serializeStyle(x.parseStyle(F),A.name)}else{if(E){F=E.call(G,F,y,A.name)}}A.attr(y,F.length>0?F:null)}}});t.addAttributeFilter("class",function(y){var z=y.length,A,B;while(z--){A=y[z];B=A.attr("class");if(B){B=A.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,"");A.attr("class",B.length>0?B:null)}}});t.addAttributeFilter("data-mce-type",function(y,A,z){var B=y.length,C;while(B--){C=y[B];if(C.attributes.map["data-mce-type"]==="bookmark"&&!z.cleanup){C.remove()}}});t.addNodeFilter("noscript",function(y){var z=y.length,A;while(z--){A=y[z].firstChild;if(A){A.value=j.decode(A.value)}}});t.addNodeFilter("script,style",function(z,A){var B=z.length,D,E,C;function y(F){return F.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,"")}while(B--){D=z[B];E=D.firstChild?D.firstChild.value:"";if(A==="script"){C=D.attr("type");if(C){D.attr("type",C=="mce-no/type"?null:C.replace(/^mce\-/,""))}if(E.length>0){D.firstChild.value="// <![CDATA[\n"+y(E)+"\n// ]]>"}}else{if(E.length>0){D.firstChild.value="<!--\n"+y(E)+"\n-->"}}}});t.addNodeFilter("#comment",function(y){var z=y.length,A;while(z--){A=y[z];if(A.value.indexOf("[CDATA[")===0){A.name="#cdata";A.type=4;A.value=A.value.replace(/^\[CDATA\[|\]\]$/g,"")}else{if(A.value.indexOf("mce:protected ")===0){A.name="#text";A.type=3;A.raw=true;A.value=unescape(A.value).substr(14)}}}});t.addNodeFilter("xml:namespace,input",function(y,z){var A=y.length,B;while(A--){B=y[A];if(B.type===7){B.remove()}else{if(B.type===1){if(z==="input"&&!("type" in B.attributes.map)){B.attr("type","text")}}}}});if(v.fix_list_elements){t.addNodeFilter("ul,ol",function(z){var A=z.length,B,y;while(A--){B=z[A];y=B.parent;if(y.name==="ul"||y.name==="ol"){if(B.prev&&B.prev.name==="li"){B.prev.append(B)}}}})}t.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize",function(y,z){var A=y.length;while(A--){y[A].attr(z,null)}});return{schema:w,addNodeFilter:t.addNodeFilter,addAttributeFilter:t.addAttributeFilter,serialize:function(E,C){var B=this,A,F,z,y,D;if(n.ie&&x.select("script,style,select,map").length>0){D=E.innerHTML;E=E.cloneNode(false);x.setHTML(E,D)}else{E=E.cloneNode(true)}A=E.ownerDocument.implementation;if(A.createHTMLDocument){F=A.createHTMLDocument("");q(E.nodeName=="BODY"?E.childNodes:[E],function(G){F.body.appendChild(F.importNode(G,true))});if(E.nodeName!="BODY"){E=F.body.firstChild}else{E=F.body}z=x.doc;x.doc=F}C=C||{};C.format=C.format||"html";if(C.selection){C.forced_root_block=""}if(!C.no_events){C.node=E;B.onPreProcess(C)}y=new o(v,w);C.content=y.serialize(t.parse(i(C.getInner?E.innerHTML:x.getOuterHTML(E)),C));if(!C.cleanup){C.content=C.content.replace(/\uFEFF/g,"")}if(!C.no_events){B.onPostProcess(C)}if(z){x.doc=z}C.node=null;return C.content},addRules:function(y){w.addValidElements(y)},setRules:function(y){w.setValidElements(y)},onPreProcess:function(y){if(u){u.fire("PreProcess",y)}},onPostProcess:function(y){if(u){u.fire("PostProcess",y)}}}}});h("tinymce/dom/TridentSelection",[],function(){function i(k){var j=this,o=k.dom,m=false;function l(p,q){var r,A=0,x,u,t,s,v,y,w=-1,z;r=p.duplicate();r.collapse(q);z=r.parentElement();if(z.ownerDocument!==k.dom.doc){return}while(z.contentEditable==="false"){z=z.parentNode}if(!z.hasChildNodes()){return{node:z,inside:1}}t=z.children;x=t.length-1;while(A<=x){y=Math.floor((A+x)/2);s=t[y];r.moveToElementText(s);w=r.compareEndPoints(q?"StartToStart":"EndToEnd",p);if(w>0){x=y-1}else{if(w<0){A=y+1}else{return{node:s}}}}if(w<0){if(!s){r.moveToElementText(z);r.collapse(true);s=z;u=true}else{r.collapse(false)}v=0;while(r.compareEndPoints(q?"StartToStart":"StartToEnd",p)!==0){if(r.move("character",1)===0||z!=r.parentElement()){break}v++}}else{r.collapse(true);v=0;while(r.compareEndPoints(q?"StartToStart":"StartToEnd",p)!==0){if(r.move("character",-1)===0||z!=r.parentElement()){break}v++}}return{node:s,position:w,offset:v,inside:u}}function n(){var p=k.getRng(),x=o.createRng(),r,q,v,w,s;r=p.item?p.item(0):p.parentElement();if(r.ownerDocument!=o.doc){return x}q=k.isCollapsed();if(p.item){x.setStart(r.parentNode,o.nodeIndex(r));x.setEnd(x.startContainer,x.startOffset+1);return x}function u(F){var A=l(p,F),y,D,E=0,C,B,z;y=A.node;D=A.offset;if(A.inside&&!y.hasChildNodes()){x[F?"setStart":"setEnd"](y,0);return}if(D===B){x[F?"setStartBefore":"setEndAfter"](y);return}if(A.position<0){C=A.inside?y.firstChild:y.nextSibling;if(!C){x[F?"setStartAfter":"setEndAfter"](y);return}if(!D){if(C.nodeType==3){x[F?"setStart":"setEnd"](C,0)}else{x[F?"setStartBefore":"setEndBefore"](C)}return}while(C){if(C.nodeType==3){z=C.nodeValue;E+=z.length;if(E>=D){y=C;E-=D;E=z.length-E;break}}C=C.nextSibling}}else{C=y.previousSibling;if(!C){return x[F?"setStartBefore":"setEndBefore"](y)}if(!D){if(y.nodeType==3){x[F?"setStart":"setEnd"](C,y.nodeValue.length)}else{x[F?"setStartAfter":"setEndAfter"](C)}return}while(C){if(C.nodeType==3){E+=C.nodeValue.length;if(E>=D){y=C;E-=D;break}}C=C.previousSibling}}x[F?"setStart":"setEnd"](y,E)}try{u(true);if(!q){u()}}catch(t){if(t.number==-2147024809){s=j.getBookmark(2);v=p.duplicate();v.collapse(true);r=v.parentElement();if(!q){v=p.duplicate();v.collapse(false);w=v.parentElement();w.innerHTML=w.innerHTML}r.innerHTML=r.innerHTML;j.moveToBookmark(s);p=k.getRng();u(true);if(!q){u()}}else{throw t}}return x}this.getBookmark=function(s){var p=k.getRng(),r={};function t(z){var y,u,x,w,v=[];y=z.parentNode;u=o.getRoot().parentNode;while(y!=u&&y.nodeType!==9){x=y.children;w=x.length;while(w--){if(z===x[w]){v.push(w);break}}z=y;y=y.parentNode}return v}function q(v){var u;u=l(p,v);if(u){return{position:u.position,offset:u.offset,indexes:t(u.node),inside:u.inside}}}if(s===2){if(!p.item){r.start=q(true);if(!k.isCollapsed()){r.end=q()}}else{r.start={ctrl:true,indexes:t(p.item(0))}}}return r};this.moveToBookmark=function(r){var q,p=o.doc.body;function t(v){var y,x,u,w;y=o.getRoot();for(x=v.length-1;x>=0;x--){w=y.children;u=v[x];if(u<=w.length-1){y=w[u]}}return y}function s(z){var u=r[z?"start":"end"],x,w,v,y;if(u){x=u.position>0;w=p.createTextRange();w.moveToElementText(t(u.indexes));y=u.offset;if(y!==v){w.collapse(u.inside||x);w.moveStart("character",x?-y:y)}else{w.collapse(z)}q.setEndPoint(z?"StartToStart":"EndToStart",w);if(z){q.collapse(true)}}}if(r.start){if(r.start.ctrl){q=p.createControlRange();q.addElement(t(r.start.indexes));q.select()}else{q=p.createTextRange();s(true);s();q.select()}}};this.addRange=function(p){var u,s,r,w,C,x,A,z=k.dom.doc,t=z.body,y,B;function q(I){var E,H,D,G,F;D=o.create("a");E=I?r:C;H=I?w:x;G=u.duplicate();if(E==z||E==z.documentElement){E=t;H=0}if(E.nodeType==3){E.parentNode.insertBefore(D,E);G.moveToElementText(D);G.moveStart("character",H);o.remove(D);u.setEndPoint(I?"StartToStart":"EndToEnd",G)}else{F=E.childNodes;if(F.length){if(H>=F.length){o.insertAfter(D,F[F.length-1])}else{E.insertBefore(D,F[H])}G.moveToElementText(D)}else{if(E.canHaveHTML){E.innerHTML="<span>&#xFEFF;</span>";D=E.firstChild;G.moveToElementText(D);G.collapse(m)}}u.setEndPoint(I?"StartToStart":"EndToEnd",G);o.remove(D)}}r=p.startContainer;w=p.startOffset;C=p.endContainer;x=p.endOffset;u=t.createTextRange();if(r==C&&r.nodeType==1){if(w==x&&!r.hasChildNodes()){if(r.canHaveHTML){A=r.previousSibling;if(A&&!A.hasChildNodes()&&o.isBlock(A)){A.innerHTML="&#xFEFF;"}else{A=null}r.innerHTML="<span>&#xFEFF;</span><span>&#xFEFF;</span>";u.moveToElementText(r.lastChild);u.select();o.doc.selection.clear();r.innerHTML="";if(A){A.innerHTML=""}return}else{w=o.nodeIndex(r);r=r.parentNode}}if(w==x-1){try{B=r.childNodes[w];s=t.createControlRange();s.addElement(B);s.select();y=k.getRng();if(y.item&&B===y.item(0)){return}}catch(v){}}}q(true);q();u.select()};this.getRangeAt=n}return i});h("tinymce/util/VK",["tinymce/Env"],function(i){return{BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(j){return j.shiftKey||j.ctrlKey||j.altKey||this.metaKeyPressed(j)},metaKeyPressed:function(j){return(i.mac?j.metaKey:j.ctrlKey&&!j.altKey)}}});h("tinymce/dom/ControlSelection",["tinymce/util/VK","tinymce/util/Tools","tinymce/Env"],function(k,j,i){return function(y,m){var n=m.dom,T=j.each;var v,ac,O,Q,aa,Y;var D,B,M,L,E,J,R,r;var l,o,w=m.getDoc(),Z=document,u=i.ie&&i.ie<11;var I=Math.abs,X=Math.round,A=m.getBody(),F,p;Q={n:[0.5,0,0,-1],e:[1,0.5,1,0],s:[0.5,1,0,1],w:[0,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 C=".mce-content-body";m.contentStyles.push(C+" div.mce-resizehandle {position: absolute;border: 1px solid black;background: #FFF;width: 5px;height: 5px;z-index: 10000}"+C+" .mce-resizehandle:hover {background: #000}"+C+" img[data-mce-selected], hr[data-mce-selected] {outline: 1px solid black;resize: none}"+C+" .mce-clonedresizable {position: absolute;"+(i.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"+C+" .mce-resize-helper {background: #555;background: rgba(0,0,0,0.75);border-radius: 3px;border: 1px;color: white;display: none;font-family: sans-serif;font-size: 12px;white-space: nowrap;line-height: 14px;margin: 5px 10px;padding: 5px;position: absolute;z-index: 10001}");function U(ae){var ad=m.settings.object_resizing;if(ad===false||i.iOS){return false}if(typeof ad!="string"){ad="table,img,div"}if(ae.getAttribute("data-mce-resize")==="false"){return false}return m.dom.is(ae,ad)}function q(ag){var ae,ad,af;var ai,ah;ae=ag.screenX-D;ad=ag.screenY-B;l=ae*aa[2]+E;o=ad*aa[3]+J;l=l<5?5:l;o=o<5?5:o;if(v.nodeName=="IMG"&&m.settings.resize_img_proportional!==false){af=!k.modifierPressed(ag)}else{af=k.modifierPressed(ag)||(v.nodeName=="IMG"&&aa[2]*aa[3]!==0)}if(af){if(I(ae)>I(ad)){o=X(l*R);l=X(o/R)}else{l=X(o/R);o=X(l*R)}}n.setStyles(ac,{width:l,height:o});ai=aa.startPos.x+ae;ah=aa.startPos.y+ad;ai=ai>0?ai:0;ah=ah>0?ah:0;n.setStyles(O,{left:ai,top:ah,display:"block"});O.innerHTML=l+" &times; "+o;if(aa[2]<0&&ac.clientWidth<=l){n.setStyle(ac,"left",M+(E-l))}if(aa[3]<0&&ac.clientHeight<=o){n.setStyle(ac,"top",L+(J-o))}ae=A.scrollWidth-F;ad=A.scrollHeight-p;if(ae+ad!==0){n.setStyles(O,{left:ai-ae,top:ah-ad})}if(!r){m.fire("ObjectResizeStart",{target:v,width:E,height:J});r=true}}function P(){r=false;function ad(ae,af){if(af){if(v.style[ae]||!m.schema.isValid(v.nodeName.toLowerCase(),ae)){n.setStyle(v,ae,af)}else{n.setAttrib(v,ae,af)}}}ad("width",l);ad("height",o);n.unbind(w,"mousemove",q);n.unbind(w,"mouseup",P);if(Z!=w){n.unbind(Z,"mousemove",q);n.unbind(Z,"mouseup",P)}n.remove(ac);n.remove(O);if(!u||v.nodeName=="TABLE"){K(v)}m.fire("ObjectResized",{target:v,width:l,height:o});n.setAttrib(v,"style",n.getAttrib(v,"style"));m.nodeChanged()}function K(aj,ah,af){var ae,ag,ad,ak,ai;ab();ae=n.getPos(aj,A);M=ae.x;L=ae.y;ai=aj.getBoundingClientRect();ag=ai.width||(ai.right-ai.left);ad=ai.height||(ai.bottom-ai.top);if(v!=aj){V();v=aj;l=o=0}ak=m.fire("ObjectSelected",{target:aj});if(U(aj)&&!ak.isDefaultPrevented()){T(Q,function(ao,am){var an,ap;function al(aq){D=aq.screenX;B=aq.screenY;E=v.clientWidth;J=v.clientHeight;R=J/E;aa=ao;ao.startPos={x:ag*ao[0]+M,y:ad*ao[1]+L};F=A.scrollWidth;p=A.scrollHeight;ac=v.cloneNode(true);n.addClass(ac,"mce-clonedresizable");n.setAttrib(ac,"data-mce-bogus","all");ac.contentEditable=false;ac.unSelectabe=true;n.setStyles(ac,{left:M,top:L,margin:0});ac.removeAttribute("data-mce-selected");A.appendChild(ac);n.bind(w,"mousemove",q);n.bind(w,"mouseup",P);if(Z!=w){n.bind(Z,"mousemove",q);n.bind(Z,"mouseup",P)}O=n.add(A,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},E+" &times; "+J)}if(ah){if(am==ah){al(af)}return}an=n.get("mceResizeHandle"+am);if(!an){ap=A;an=n.add(ap,"div",{id:"mceResizeHandle"+am,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:true,style:"cursor:"+am+"-resize; margin:0; padding:0"});if(i.ie){an.contentEditable=false}}else{n.show(an)}if(!ao.elm){n.bind(an,"mousedown",function(aq){aq.stopImmediatePropagation();aq.preventDefault();al(aq)});ao.elm=an}n.setStyles(an,{left:(ag*ao[0]+M)-(an.offsetWidth/2),top:(ad*ao[1]+L)-(an.offsetHeight/2)})})}else{G()}v.setAttribute("data-mce-selected","1")}function G(){var ad,ae;ab();if(v){v.removeAttribute("data-mce-selected")}for(ad in Q){ae=n.get("mceResizeHandle"+ad);if(ae){n.unbind(ae);n.remove(ae)}}}function H(ag){var af,ad;function ae(ai,ah){if(ai){do{if(ai===ah){return true}}while((ai=ai.parentNode))}}if(r){return}T(n.select("img[data-mce-selected],hr[data-mce-selected]"),function(ah){ah.removeAttribute("data-mce-selected")});ad=ag.type=="mousedown"?ag.target:y.getNode();ad=n.$(ad).closest(u?"table":"table,img,hr")[0];if(ae(ad,A)){N();af=y.getStart(true);if(ae(af,ad)&&ae(y.getEnd(true),ad)){if(!u||(ad!=af&&af.nodeName!=="IMG")){K(ad);return}}}G()}function s(af,ad,ae){if(af&&af.attachEvent){af.attachEvent("on"+ad,ae)}}function z(af,ad,ae){if(af&&af.detachEvent){af.detachEvent("on"+ad,ae)}}function x(af){var ag=af.srcElement,ak,ad,al,aj,ah,ai,ae;ak=ag.getBoundingClientRect();ai=Y.clientX-ak.left;ae=Y.clientY-ak.top;for(ad in Q){al=Q[ad];aj=ag.offsetWidth*al[0];ah=ag.offsetHeight*al[1];if(I(aj-ai)<8&&I(ah-ae)<8){aa=al;break}}r=true;m.fire("ObjectResizeStart",{target:v,width:v.clientWidth,height:v.clientHeight});m.getDoc().selection.empty();K(ag,ad,Y)}function W(ae){var ad=ae.srcElement;if(ad!=v){m.fire("ObjectSelected",{target:ad});V();if(ad.id.indexOf("mceResizeHandle")===0){ae.returnValue=false;return}if(ad.nodeName=="IMG"||ad.nodeName=="TABLE"){G();v=ad;s(ad,"resizestart",x)}}}function V(){z(v,"resizestart",x)}function ab(){for(var ad in Q){var ae=Q[ad];if(ae.elm){n.unbind(ae.elm);delete ae.elm}}}function N(){try{m.getDoc().execCommand("enableObjectResizing",false,false)}catch(ad){}}function t(af){var ae;if(!u){return}ae=w.body.createControlRange();try{ae.addElement(af);ae.select();return true}catch(ad){}}m.on("init",function(){if(u){m.on("ObjectResized",function(ad){if(ad.target.nodeName!="TABLE"){G();t(ad.target)}});s(A,"controlselect",W);m.on("mousedown",function(ad){Y=ad})}else{N();if(i.ie>=11){m.on("mouseup",function(ad){var ae=ad.target.nodeName;if(!r&&/^(TABLE|IMG|HR)$/.test(ae)){m.selection.select(ad.target,ae=="TABLE");m.nodeChanged()}});m.dom.bind(A,"mscontrolselect",function(ad){if(/^(TABLE|IMG|HR)$/.test(ad.target.nodeName)){ad.preventDefault();if(ad.target.tagName=="IMG"){window.setTimeout(function(){m.selection.select(ad.target)},0)}}})}}m.on("nodechange ResizeEditor",H);m.on("keydown keyup",function(ad){if(v&&v.nodeName=="TABLE"){H(ad)}});m.on("hide",G)});m.on("remove",ab);function S(){v=ac=null;if(u){V();z(A,"controlselect",W)}}return{isResizable:U,showResizeRect:K,hideResizeRect:G,updateResizeRect:H,controlSelect:t,destroy:S}}});h("tinymce/dom/BookmarkManager",["tinymce/Env","tinymce/util/Tools"],function(i,k){function j(l){var m=l.dom;this.getBookmark=function(x,z){var o,r,q,u,p,v,t="&#xFEFF;",A;function n(C,D){var B=0;k.each(m.select(C),function(F,E){if(F==D){B=E}});return B}function y(B){function C(H){var D,G,F,E=H?"start":"end";D=B[E+"Container"];G=B[E+"Offset"];if(D.nodeType==1&&D.nodeName=="TR"){F=D.childNodes;D=F[Math.min(H?G:G-1,F.length-1)];if(D){G=H?0:D.childNodes.length;B["set"+(H?"Start":"End")](D,G)}}}C(true);C();return B}function s(){var C=l.getRng(true),B=m.getRoot(),D={};function E(H,M){var G=H[M?"startContainer":"endContainer"],L=H[M?"startOffset":"endOffset"],F=[],I,K,J=0;if(G.nodeType==3){if(z){for(I=G.previousSibling;I&&I.nodeType==3;I=I.previousSibling){L+=I.nodeValue.length}}F.push(L)}else{K=G.childNodes;if(L>=K.length&&K.length){J=1;L=Math.max(0,K.length-1)}F.push(m.nodeIndex(K[L],z)+J)}for(;G&&G!=B;G=G.parentNode){F.push(m.nodeIndex(G,z))}return F}D.start=E(C,true);if(!l.isCollapsed()){D.end=E(C)}return D}if(x==2){v=l.getNode();p=v?v.nodeName:null;if(p=="IMG"){return{name:p,index:n(p,v)}}if(l.tridentSel){return l.tridentSel.getBookmark(x)}return s()}if(x){return{rng:l.getRng()}}o=l.getRng();q=m.uniqueId();u=l.isCollapsed();A="overflow:hidden;line-height:0px";if(o.duplicate||o.item){if(!o.item){r=o.duplicate();try{o.collapse();o.pasteHTML('<span data-mce-type="bookmark" id="'+q+'_start" style="'+A+'">'+t+"</span>");if(!u){r.collapse(false);o.moveToElementText(r.parentElement());if(o.compareEndPoints("StartToEnd",r)===0){r.move("character",-1)}r.pasteHTML('<span data-mce-type="bookmark" id="'+q+'_end" style="'+A+'">'+t+"</span>")}}catch(w){return null}}else{v=o.item(0);p=v.nodeName;return{name:p,index:n(p,v)}}}else{v=l.getNode();p=v.nodeName;if(p=="IMG"){return{name:p,index:n(p,v)}}r=y(o.cloneRange());if(!u){r.collapse(false);r.insertNode(m.create("span",{"data-mce-type":"bookmark",id:q+"_end",style:A},t))}o=y(o);o.collapse(true);o.insertNode(m.create("span",{"data-mce-type":"bookmark",id:q+"_start",style:A},t))}l.moveToBookmark({id:q,keep:1});return{id:q}};this.moveToBookmark=function(s){var n,v,p,w,t,u;function o(C){var x=s[C?"start":"end"],z,A,B,y;if(x){B=x[0];for(A=v,z=x.length-1;z>=1;z--){y=A.childNodes;if(x[z]>y.length-1){return}A=y[x[z]]}if(A.nodeType===3){B=Math.min(x[0],A.nodeValue.length)}if(A.nodeType===1){B=Math.min(x[0],A.childNodes.length)}if(C){n.setStart(A,B)}else{n.setEnd(A,B)}}return true}function q(D){var y=m.get(s.id+"_"+D),C,x,A,B,z=s.keep;if(y){C=y.parentNode;if(D=="start"){if(!z){x=m.nodeIndex(y)}else{C=y.firstChild;x=1}p=w=C;t=u=x}else{if(!z){x=m.nodeIndex(y)}else{C=y.firstChild;x=1}w=C;u=x}if(!z){B=y.previousSibling;A=y.nextSibling;k.each(k.grep(y.childNodes),function(E){if(E.nodeType==3){E.nodeValue=E.nodeValue.replace(/\uFEFF/g,"")}});while((y=m.get(s.id+"_"+D))){m.remove(y,1)}if(B&&A&&B.nodeType==A.nodeType&&B.nodeType==3&&!i.opera){x=B.nodeValue.length;B.appendData(A.nodeValue);m.remove(A);if(D=="start"){p=w=B;t=u=x}else{w=B;u=x}}}}}function r(x){if(m.isBlock(x)&&!x.innerHTML&&!i.ie){x.innerHTML='<br data-mce-bogus="1" />'}return x}if(s){if(s.start){n=m.createRng();v=m.getRoot();if(l.tridentSel){return l.tridentSel.moveToBookmark(s)}if(o(true)&&o()){l.setRng(n)}}else{if(s.id){q("start");q("end");if(p){n=m.createRng();n.setStart(r(p),t);n.setEnd(r(w),u);l.setRng(n)}}else{if(s.name){l.select(m.select(s.name)[s.index])}else{if(s.rng){l.setRng(s.rng)}}}}}}}j.isBookmarkNode=function(l){return l&&l.tagName==="SPAN"&&l.getAttribute("data-mce-type")==="bookmark"};return j});h("tinymce/dom/Selection",["tinymce/dom/TreeWalker","tinymce/dom/TridentSelection","tinymce/dom/ControlSelection","tinymce/dom/RangeUtils","tinymce/dom/BookmarkManager","tinymce/Env","tinymce/util/Tools"],function(q,o,i,m,r,n,l){var p=l.each,k=l.trim;var j=n.ie;function s(x,w,v,u){var t=this;t.dom=x;t.win=w;t.serializer=v;t.editor=u;t.bookmarkManager=new r(t);t.controlSelection=new i(t,u);if(!t.win.getSelection){t.tridentSel=new o(t)}}s.prototype={setCursorLocation:function(v,w){var u=this,t=u.dom.createRng();if(!v){u._moveEndPoint(t,u.editor.getBody(),true);u.setRng(t)}else{t.setStart(v,w);t.setEnd(v,w);u.setRng(t);u.collapse(false)}},getContent:function(x){var v=this,u=v.getRng(),t=v.dom.create("body");var A=v.getSel(),z,y,w;x=x||{};z=y="";x.get=true;x.format=x.format||"html";x.selection=true;v.editor.fire("BeforeGetContent",x);if(x.format=="text"){return v.isCollapsed()?"":(u.text||(A.toString?A.toString():""))}if(u.cloneContents){w=u.cloneContents();if(w){t.appendChild(w)}}else{if(u.item!==g||u.htmlText!==g){t.innerHTML="<br>"+(u.item?u.item(0).outerHTML:u.htmlText);t.removeChild(t.firstChild)}else{t.innerHTML=u.toString()}}if(/^\s/.test(t.innerHTML)){z=" "}if(/\s+$/.test(t.innerHTML)){y=" "}x.getInner=true;x.content=v.isCollapsed()?"":z+v.serializer.serialize(t,x)+y;v.editor.fire("GetContent",x);return x.content},setContent:function(u,w){var B=this,t=B.getRng(),x,y=B.win.document,A,z;w=w||{format:"html"};w.set=true;w.selection=true;u=w.content=u;if(!w.no_events){B.editor.fire("BeforeSetContent",w)}u=w.content;if(t.insertNode){u+='<span id="__caret">_</span>';if(t.startContainer==y&&t.endContainer==y){y.body.innerHTML=u}else{t.deleteContents();if(y.body.childNodes.length===0){y.body.innerHTML=u}else{if(t.createContextualFragment){t.insertNode(t.createContextualFragment(u))}else{A=y.createDocumentFragment();z=y.createElement("div");A.appendChild(z);z.outerHTML=u;t.insertNode(A)}}}x=B.dom.get("__caret");t=y.createRange();t.setStartBefore(x);t.setEndBefore(x);B.setRng(t);B.dom.remove("__caret");try{B.setRng(t)}catch(v){}}else{if(t.item){y.execCommand("Delete",false,null);t=B.getRng()}if(/^\s+/.test(u)){t.pasteHTML('<span id="__mce_tmp">_</span>'+u);B.dom.remove("__mce_tmp")}else{t.pasteHTML(u)}}if(!w.no_events){B.editor.fire("SetContent",w)}},getStart:function(z){var v=this,u=v.getRng(),w,t,y,x;if(u.duplicate||u.item){if(u.item){return u.item(0)}y=u.duplicate();y.collapse(1);w=y.parentElement();if(w.ownerDocument!==v.dom.doc){w=v.dom.getRoot()}t=x=u.parentElement();while((x=x.parentNode)){if(x==w){w=t;break}}return w}else{w=u.startContainer;if(w.nodeType==1&&w.hasChildNodes()){if(!z||!u.collapsed){w=w.childNodes[Math.min(w.childNodes.length-1,u.startOffset)]}}if(w&&w.nodeType==3){return w.parentNode}return w}},getEnd:function(x){var u=this,t=u.getRng(),w,v;if(t.duplicate||t.item){if(t.item){return t.item(0)}t=t.duplicate();t.collapse(0);w=t.parentElement();if(w.ownerDocument!==u.dom.doc){w=u.dom.getRoot()}if(w&&w.nodeName=="BODY"){return w.lastChild||w}return w}else{w=t.endContainer;v=t.endOffset;if(w.nodeType==1&&w.hasChildNodes()){if(!x||!t.collapsed){w=w.childNodes[v>0?v-1:v]}}if(w&&w.nodeType==3){return w.parentNode}return w}},getBookmark:function(t,u){return this.bookmarkManager.getBookmark(t,u)},moveToBookmark:function(t){return this.bookmarkManager.moveToBookmark(t)},select:function(x,w){var v=this,y=v.dom,u=y.createRng(),t;v.lastFocusBookmark=null;if(x){if(!w&&v.controlSelection.controlSelect(x)){return}t=y.nodeIndex(x);u.setStart(x.parentNode,t);u.setEnd(x.parentNode,t+1);if(w){v._moveEndPoint(u,x,true);v._moveEndPoint(u,x)}v.setRng(u)}return x},isCollapsed:function(){var u=this,t=u.getRng(),v=u.getSel();if(!t||t.item){return false}if(t.compareEndPoints){return t.compareEndPoints("StartToEnd",t)===0}return !v||t.collapsed},collapse:function(v){var u=this,t=u.getRng(),w;if(t.item){w=t.item(0);t=u.win.document.body.createTextRange();t.moveToElementText(w)}t.collapse(!!v);u.setRng(t)},getSel:function(){var t=this.win;return t.getSelection?t.getSelection():t.document.selection},getRng:function(z){var C=this,B,t,x,A=C.win.document,v;function y(F,G,D){try{return G.compareBoundaryPoints(F,D)}catch(E){return -1}}if(!z&&C.lastFocusBookmark){var u=C.lastFocusBookmark;if(u.startContainer){t=A.createRange();t.setStart(u.startContainer,u.startOffset);t.setEnd(u.endContainer,u.endOffset)}else{t=u}return t}if(z&&C.tridentSel){return C.tridentSel.getRangeAt(0)}try{if((B=C.getSel())){if(B.rangeCount>0){t=B.getRangeAt(0)}else{t=B.createRange?B.createRange():A.createRange()}}}catch(w){}if(j&&t&&t.setStart&&A.selection){try{v=A.selection.createRange()}catch(w){}if(v&&v.item){x=v.item(0);t=A.createRange();t.setStartBefore(x);t.setEndAfter(x)}}if(!t){t=A.createRange?A.createRange():A.body.createTextRange()}if(t.setStart&&t.startContainer.nodeType===9&&t.collapsed){x=C.dom.getRoot();t.setStart(x,0);t.setEnd(x,0)}if(C.selectedRange&&C.explicitRange){if(y(t.START_TO_START,t,C.selectedRange)===0&&y(t.END_TO_END,t,C.selectedRange)===0){t=C.explicitRange}else{C.selectedRange=null;C.explicitRange=null}}return t},setRng:function(t,v){var u=this,x;if(!t){return}if(t.select){try{t.select()}catch(w){}return}if(!u.tridentSel){x=u.getSel();if(x){u.explicitRange=t;try{x.removeAllRanges();x.addRange(t)}catch(w){}if(v===false&&x.extend){x.collapse(t.endContainer,t.endOffset);x.extend(t.startContainer,t.startOffset)}u.selectedRange=x.rangeCount>0?x.getRangeAt(0):null}}else{if(t.cloneRange){try{u.tridentSel.addRange(t);return}catch(w){}}}},setNode:function(u){var t=this;t.setContent(t.dom.getOuterHTML(u));return u},getNode:function(){var A=this,t=A.getRng(),w;var u=t.startContainer,B=t.endContainer;var x=t.startOffset,y=t.endOffset,z=A.dom.getRoot();function v(D,C){var E=D;while(D&&D.nodeType===3&&D.length===0){D=C?D.nextSibling:D.previousSibling}return D||E}if(!t){return z}if(t.setStart){w=t.commonAncestorContainer;if(!t.collapsed){if(u==B){if(y-x<2){if(u.hasChildNodes()){w=u.childNodes[x]}}}if(u.nodeType===3&&B.nodeType===3){if(u.length===x){u=v(u.nextSibling,true)}else{u=u.parentNode}if(y===0){B=v(B.previousSibling,false)}else{B=B.parentNode}if(u&&u===B){return u}}}if(w&&w.nodeType==3){return w.parentNode}return w}w=t.item?t.item(0):t.parentElement();if(w.ownerDocument!==A.win.document){w=z}return w},getSelectedBlocks:function(w,v){var u=this,A=u.dom,x,t,z=[];t=A.getRoot();w=A.getParent(w||u.getStart(),A.isBlock);v=A.getParent(v||u.getEnd(),A.isBlock);if(w&&w!=t){z.push(w)}if(w&&v&&w!=v){x=w;var y=new q(w,t);while((x=y.next())&&x!=v){if(A.isBlock(x)){z.push(x)}}}if(v&&w!=v&&v!=t){z.push(v)}return z},isForward:function(){var v=this.dom,t=this.getSel(),w,u;if(!t||!t.anchorNode||!t.focusNode){return true}w=v.createRng();w.setStart(t.anchorNode,t.anchorOffset);w.collapse(true);u=v.createRng();u.setStart(t.focusNode,t.focusOffset);u.collapse(true);return w.compareBoundaryPoints(w.START_TO_START,u)<=0},normalize:function(){var u=this,t=u.getRng();if(n.range&&new m(u.dom).normalize(t)){u.setRng(t,u.isForward())}return t},selectorChanged:function(t,w){var u=this,v;if(!u.selectorChangedData){u.selectorChangedData={};v={};u.editor.on("NodeChange",function(A){var z=A.element,B=u.dom,x=B.getParents(z,null,B.getRoot()),y={};p(u.selectorChangedData,function(D,C){p(x,function(E){if(B.is(E,C)){if(!v[C]){p(D,function(F){F(true,{node:E,selector:C,parents:x})});v[C]=D}y[C]=D;return false}})});p(v,function(D,C){if(!y[C]){delete v[C];p(D,function(E){E(false,{node:z,selector:C,parents:x})})}})})}if(!u.selectorChangedData[t]){u.selectorChangedData[t]=[]}u.selectorChangedData[t].push(w);return u},getScrollContainer:function(){var t,u=this.dom.getRoot();while(u&&u.nodeName!="BODY"){if(u.scrollHeight>u.clientHeight){t=u;break}u=u.parentNode}return t},scrollIntoView:function(w){var z,C,D=this,v=D.dom,A=v.getRoot(),t,B;function u(H){var E=0,G=0;var F=H;while(F&&F.nodeType){E+=F.offsetLeft||0;G+=F.offsetTop||0;F=F.offsetParent}return{x:E,y:G}}if(A.nodeName!="BODY"){var x=D.getScrollContainer();if(x){z=u(w).y-u(x).y;B=x.clientHeight;t=x.scrollTop;if(z<t||z+25>t+B){x.scrollTop=z<t?z:z-B+25}return}}C=v.getViewPort(D.editor.getWin());z=v.getPos(w).y;t=C.y;B=C.h;if(z<C.y||z+25>t+B){D.editor.getWin().scrollTo(0,z<t?z:z-B+25)}},placeCaretAt:function(x,w){var y=this.editor.getDoc(),u,t;if(y.caretPositionFromPoint){t=y.caretPositionFromPoint(x,w);u=y.createRange();u.setStart(t.offsetNode,t.offset);u.collapse(true)}else{if(y.caretRangeFromPoint){u=y.caretRangeFromPoint(x,w)}else{if(y.body.createTextRange){u=y.body.createTextRange();try{u.moveToPoint(x,w);u.collapse(true)}catch(v){u.collapse(w<y.body.clientHeight)}}}}this.setRng(u)},_moveEndPoint:function(u,w,y){var t=w,x=new q(w,t);var v=this.dom.schema.getNonEmptyElements();do{if(w.nodeType==3&&k(w.nodeValue).length!==0){if(y){u.setStart(w,0)}else{u.setEnd(w,w.nodeValue.length)}return}if(v[w.nodeName]&&!/^(TD|TH)$/.test(w.nodeName)){if(y){u.setStartBefore(w)}else{if(w.nodeName=="BR"){u.setEndBefore(w)}else{u.setEndAfter(w)}}return}if(n.ie&&n.ie<11&&this.dom.isBlock(w)&&this.dom.isEmpty(w)){if(y){u.setStart(w,0)}else{u.setEnd(w,0)}return}}while((w=(y?x.next():x.prev())));if(t.nodeName=="BODY"){if(y){u.setStart(t,0)}else{u.setEnd(t,t.childNodes.length)}}},destroy:function(){this.win=null;this.controlSelection.destroy()}};return s});h("tinymce/dom/ElementUtils",["tinymce/dom/BookmarkManager","tinymce/util/Tools"],function(i,k){var l=k.each;function j(m){this.compare=function(p,o){if(p.nodeName!=o.nodeName){return false}function n(r){var s={};l(m.getAttribs(r),function(t){var u=t.nodeName.toLowerCase();if(u.indexOf("_")!==0&&u!=="style"&&u!=="data-mce-style"){s[u]=m.getAttrib(r,u)}});return s}function q(u,t){var s,r;for(r in u){if(u.hasOwnProperty(r)){s=t[r];if(typeof s=="undefined"){return false}if(u[r]!=s){return false}delete t[r]}}for(r in t){if(t.hasOwnProperty(r)){return false}}return true}if(!q(n(p),n(o))){return false}if(!q(m.parseStyle(m.getAttrib(p,"style")),m.parseStyle(m.getAttrib(o,"style")))){return false}return !i.isBookmarkNode(p)&&!i.isBookmarkNode(o)}}return j});h("tinymce/fmt/Preview",["tinymce/util/Tools"],function(i){var k=i.each;function j(q,t){var m,n,p=q.dom;var l="",o,s;s=q.settings.preview_styles;if(s===false){return""}if(!s){s="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"}function r(u){return u.replace(/%(\w+)/g,"")}if(typeof t=="string"){t=q.formatter.get(t);if(!t){return}t=t[0]}m=t.block||t.inline||"span";n=p.create(m);k(t.styles,function(v,u){v=r(v);if(v){p.setStyle(n,u,v)}});k(t.attributes,function(v,u){v=r(v);if(v){p.setAttrib(n,u,v)}});k(t.classes,function(u){u=r(u);if(!p.hasClass(n,u)){p.addClass(n,u)}});q.fire("PreviewFormats");p.setStyles(n,{position:"absolute",left:-65535});q.getBody().appendChild(n);o=p.getStyle(q.getBody(),"fontSize",true);o=/px$/.test(o)?parseInt(o,10):0;k(s.split(" "),function(u){var v=p.getStyle(n,u,true);if(u=="background-color"&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(v)){v=p.getStyle(q.getBody(),u,true);if(p.toHex(v).toLowerCase()=="#ffffff"){return}}if(u=="color"){if(p.toHex(v).toLowerCase()=="#000000"){return}}if(u=="font-size"){if(/em|%$/.test(v)){if(o===0){return}v=parseFloat(v,10)/(/%$/.test(v)?100:1);v=(v*o)+"px"}}if(u=="border"&&v){l+="padding:0 2px;"}l+=u+":"+v+";"});q.fire("AfterPreviewFormats");p.remove(n);return l}return{getCssText:j}});h("tinymce/Formatter",["tinymce/dom/TreeWalker","tinymce/dom/RangeUtils","tinymce/dom/BookmarkManager","tinymce/dom/ElementUtils","tinymce/util/Tools","tinymce/fmt/Preview"],function(l,m,i,k,j,n){return function(av){var ah={},p=av.dom,I=av.selection,ae=new m(p),r=av.schema.isValidChild,Y=p.isBlock,B=av.settings.forced_root_block,K=p.nodeIndex,W="\uFEFF",s=/^(src|href|style)$/,ap=false,S=true,ag,T,N=p.getContentEditable,X,z,ab=i.isBookmarkNode;var ak=j.each,at=j.grep,F=j.walk,G=j.extend;function Z(aw){if(aw.nodeType){aw=aw.nodeName}return !!av.schema.getTextBlockElements()[aw.toLowerCase()]}function am(aw){return/^(TH|TD)$/.test(aw.nodeName)}function C(ax,aw){return p.getParents(ax,aw,p.getRoot())}function o(aw){return aw.nodeType===1&&aw.id==="_mce_caret"}function x(){A({valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],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:false,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:false,styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",collapsed:false,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:false,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:true},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:true},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},links:true,remove_similar:true},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:true,remove_similar:true},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:true,deep:true,onmatch:function(){return true},onformat:function(ay,aw,ax){ak(ax,function(aA,az){p.setAttrib(ay,az,aA)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",remove:"all",split:true,expand:false,block_expand:true,deep:true},{selector:"span",attributes:["style","class"],remove:"empty",split:true,expand:false,deep:true},{selector:"*",attributes:["style","class"],split:false,expand:false,deep:true}]});ak("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),function(aw){A(aw,{block:aw,remove:"all"})});A(av.settings.formats)}function ao(){av.addShortcut("meta+b","bold_desc","Bold");av.addShortcut("meta+i","italic_desc","Italic");av.addShortcut("meta+u","underline_desc","Underline");for(var aw=1;aw<=6;aw++){av.addShortcut("access+"+aw,"",["FormatBlock",false,"h"+aw])}av.addShortcut("access+7","",["FormatBlock",false,"p"]);av.addShortcut("access+8","",["FormatBlock",false,"div"]);av.addShortcut("access+9","",["FormatBlock",false,"address"])}function an(aw){return aw?ah[aw]:ah}function A(aw,ax){if(aw){if(typeof aw!=="string"){ak(aw,function(az,ay){A(ay,az)})}else{ax=ax.length?ax:[ax];ak(ax,function(ay){if(ay.deep===T){ay.deep=!ay.selector}if(ay.split===T){ay.split=!ay.selector||ay.inline}if(ay.remove===T&&ay.selector&&!ay.inline){ay.remove="none"}if(ay.selector&&ay.inline){ay.mixed=true;ay.block_expand=true}if(typeof ay.classes==="string"){ay.classes=ay.classes.split(/\s+/)}});ah[aw]=ax}}}function O(aw){if(aw&&ah[aw]){delete ah[aw]}return ah}function w(ax){var aw;av.dom.getParent(ax,function(ay){aw=av.dom.getStyle(ay,"text-decoration");return aw&&aw!=="none"});return aw}function ac(aw){var ax;if(aw.nodeType===1&&aw.parentNode&&aw.parentNode.nodeType===1){ax=w(aw.parentNode);if(av.dom.getStyle(aw,"color")&&ax){av.dom.setStyle(aw,"text-decoration",ax)}else{if(av.dom.getStyle(aw,"text-decoration")===ax){av.dom.setStyle(aw,"text-decoration",null)}}}}function ar(ay,aE,aA){var aB=an(ay),aF=aB[0],aD,ax,aC=!aA&&I.isCollapsed();function aw(aK,aI){aI=aI||aF;if(aK){if(aI.onformat){aI.onformat(aK,aI,aE,aA)}ak(aI.styles,function(aM,aL){p.setStyle(aK,aL,H(aM,aE))});if(aI.styles){var aJ=p.getAttrib(aK,"style");if(aJ){aK.setAttribute("data-mce-style",aJ)}}ak(aI.attributes,function(aM,aL){p.setAttrib(aK,aL,H(aM,aE))});ak(aI.classes,function(aL){aL=H(aL,aE);if(!p.hasClass(aK,aL)){p.addClass(aK,aL)}})}}function az(){function aK(aQ,aO){var aP=new l(aO);for(aA=aP.current();aA;aA=aP.prev()){if(aA.childNodes.length>1||aA==aQ||aA.tagName=="BR"){return aA}}}var aJ=av.selection.getRng();var aN=aJ.startContainer;var aI=aJ.endContainer;if(aN!=aI&&aJ.endOffset===0){var aM=aK(aN,aI);var aL=aM.nodeType==3?aM.length:aM.childNodes.length;aJ.setEnd(aM,aL)}return aJ}function aG(aJ,aL,aO){var aI=[],aN,aK,aM=true;aN=aF.inline||aF.block;aK=p.create(aN);aw(aK);ae.walk(aJ,function(aP){var aQ;function aR(aS){var aX,aV,aT,aU,aW;aW=aM;aX=aS.nodeName.toLowerCase();aV=aS.parentNode.nodeName.toLowerCase();if(aS.nodeType===1&&N(aS)){aW=aM;aM=N(aS)==="true";aU=true}if(u(aX,"br")){aQ=0;if(aF.block){p.remove(aS)}return}if(aF.wrapper&&P(aS,ay,aE)){aQ=0;return}if(aM&&!aU&&aF.block&&!aF.wrapper&&Z(aX)&&r(aV,aN)){aS=p.rename(aS,aN);aw(aS);aI.push(aS);aQ=0;return}if(aF.selector){ak(aB,function(aY){if("collapsed" in aY&&aY.collapsed!==aC){return}if(p.is(aS,aY.selector)&&!o(aS)){aw(aS,aY);aT=true}});if(!aF.inline||aT){aQ=0;return}}if(aM&&!aU&&r(aN,aX)&&r(aV,aN)&&!(!aO&&aS.nodeType===3&&aS.nodeValue.length===1&&aS.nodeValue.charCodeAt(0)===65279)&&!o(aS)&&(!aF.inline||!Y(aS))){if(!aQ){aQ=p.clone(aK,ap);aS.parentNode.insertBefore(aQ,aS);aI.push(aQ)}aQ.appendChild(aS)}else{aQ=0;ak(at(aS.childNodes),aR);if(aU){aM=aW}aQ=0}}ak(aP,aR)});if(aF.links===true){ak(aI,function(aP){function aQ(aR){if(aR.nodeName==="A"){aw(aR,aF)}ak(at(aR.childNodes),aQ)}aQ(aP)})}ak(aI,function(aR){var aP;function aS(aU){var aT=0;ak(aU.childNodes,function(aV){if(!t(aV)&&!ab(aV)){aT++}});return aT}function aQ(aT){var aV,aU;ak(aT.childNodes,function(aW){if(aW.nodeType==1&&!ab(aW)&&!o(aW)){aV=aW;return ap}});if(aV&&!ab(aV)&&v(aV,aF)){aU=p.clone(aV,ap);aw(aU);p.replace(aU,aT,S);p.remove(aV,1)}return aU||aT}aP=aS(aR);if((aI.length>1||!Y(aR))&&aP===0){p.remove(aR,1);return}if(aF.inline||aF.wrapper){if(!aF.exact&&aP===1){aR=aQ(aR)}ak(aB,function(aT){ak(p.select(aT.inline,aR),function(aU){if(ab(aU)){return}au(aT,aE,aU,aT.exact?aU:null)})});if(P(aR.parentNode,ay,aE)){p.remove(aR,1);aR=0;return S}if(aF.merge_with_parents){p.getParent(aR.parentNode,function(aT){if(P(aT,ay,aE)){p.remove(aR,1);aR=0;return S}})}if(aR&&aF.merge_siblings!==false){aR=L(U(aR),aR);aR=L(aR,U(aR,S))}}})}if(aF){if(aA){if(aA.nodeType){ax=p.createRng();ax.setStartBefore(aA);ax.setEndAfter(aA);aG(E(ax,aB),null,true)}else{aG(aA,null,true)}}else{if(!aC||!aF.inline||p.select("td.mce-item-selected,th.mce-item-selected").length){var aH=av.selection.getNode();if(!B&&aB[0].defaultBlock&&!p.getParent(aH,p.isBlock)){ar(aB[0].defaultBlock)}av.selection.setRng(az());aD=I.getBookmark();aG(E(I.getRng(S),aB),aD);if(aF.styles&&(aF.styles.color||aF.styles.textDecoration)){F(aH,ac,"childNodes");ac(aH)}I.moveToBookmark(aD);ai(I.getRng(S));av.nodeChanged()}else{al("apply",ay,aE)}}}}function R(ay,aH,aA,aD){var aB=an(ay),aJ=aB[0],aF,ax,aG=true;function az(aO){var aN,aM,aL,aQ,aP;if(aO.nodeType===1&&N(aO)){aQ=aG;aG=N(aO)==="true";aP=true}aN=at(aO.childNodes);if(aG&&!aP){for(aM=0,aL=aB.length;aM<aL;aM++){if(au(aB[aM],aH,aO,aO)){break}}}if(aJ.deep){if(aN.length){for(aM=0,aL=aN.length;aM<aL;aM++){az(aN[aM])}if(aP){aG=aQ}}}}function aC(aL){var aM;ak(C(aL.parentNode).reverse(),function(aN){var aO;if(!aM&&aN.id!="_start"&&aN.id!="_end"){aO=P(aN,ay,aH,aD);if(aO&&aO.split!==false){aM=aN}}});return aM}function aw(aP,aL,aQ,aT){var aU,aS,aR,aN,aO,aM;if(aP){aM=aP.parentNode;for(aU=aL.parentNode;aU&&aU!=aM;aU=aU.parentNode){aS=p.clone(aU,ap);for(aO=0;aO<aB.length;aO++){if(au(aB[aO],aH,aS,aS)){aS=0;break}}if(aS){if(aR){aS.appendChild(aR)}if(!aN){aN=aS}aR=aS}}if(aT&&(!aJ.mixed||!Y(aP))){aL=p.split(aP,aL)}if(aR){aQ.parentNode.insertBefore(aR,aQ);aN.appendChild(aQ)}}return aL}function aI(aL){return aw(aC(aL),aL,aL,true)}function aE(aN){var aM=p.get(aN?"_start":"_end"),aL=aM[aN?"firstChild":"lastChild"];if(ab(aL)){aL=aL[aN?"firstChild":"lastChild"]}if(aL.nodeType==3&&aL.data.length===0){aL=aN?aM.previousSibling||aM.nextSibling:aM.nextSibling||aM.previousSibling}p.remove(aM,true);return aL}function aK(aL){var aM,aN;var aO=aL.commonAncestorContainer;aL=E(aL,aB,S);if(aJ.split){aM=ad(aL,S);aN=ad(aL);if(aM!=aN){if(/^(TR|TH|TD)$/.test(aM.nodeName)&&aM.firstChild){if(aM.nodeName=="TR"){aM=aM.firstChild.firstChild||aM}else{aM=aM.firstChild||aM}}if(aO&&/^T(HEAD|BODY|FOOT|R)$/.test(aO.nodeName)&&am(aN)&&aN.firstChild){aN=aN.firstChild||aN}if(p.isChildOf(aM,aN)&&!am(aM)&&!am(aN)){aM=aj(aM,"span",{id:"_start","data-mce-type":"bookmark"});aI(aM);aM=aE(S);return}else{aM=aj(aM,"span",{id:"_start","data-mce-type":"bookmark"});aN=aj(aN,"span",{id:"_end","data-mce-type":"bookmark"});aI(aM);aI(aN);aM=aE(S);aN=aE()}}else{aM=aN=aI(aM)}aL.startContainer=aM.parentNode?aM.parentNode:aM;aL.startOffset=K(aM);aL.endContainer=aN.parentNode?aN.parentNode:aN;aL.endOffset=K(aN)+1}ae.walk(aL,function(aP){ak(aP,function(aQ){az(aQ);if(aQ.nodeType===1&&av.dom.getStyle(aQ,"text-decoration")==="underline"&&aQ.parentNode&&w(aQ.parentNode)==="underline"){au({deep:false,exact:true,inline:"span",styles:{textDecoration:"underline"}},null,aQ)}})})}if(aA){if(aA.nodeType){ax=p.createRng();ax.setStartBefore(aA);ax.setEndAfter(aA);aK(ax)}else{aK(aA)}return}if(!I.isCollapsed()||!aJ.inline||p.select("td.mce-item-selected,th.mce-item-selected").length){aF=I.getBookmark();aK(I.getRng(S));I.moveToBookmark(aF);if(aJ.inline&&y(ay,aH,I.getStart())){ai(I.getRng(true))}av.nodeChanged()}else{al("remove",ay,aH,aD)}}function V(ax,az,ay){var aw=an(ax);if(y(ax,az,ay)&&(!("toggle" in aw[0])||aw[0].toggle)){R(ax,az,ay)}else{ar(ax,az,ay)}}function P(ax,aw,aC,aA){var ay=an(aw),aD,aB,az;function aE(aI,aK,aL){var aH,aJ,aF=aK[aL],aG;if(aK.onmatch){return aK.onmatch(aI,aK,aL)}if(aF){if(aF.length===T){for(aH in aF){if(aF.hasOwnProperty(aH)){if(aL==="attributes"){aJ=p.getAttrib(aI,aH)}else{aJ=af(aI,aH)}if(aA&&!aJ&&!aK.exact){return}if((!aA||aK.exact)&&!u(aJ,J(H(aF[aH],aC),aH))){return}}}}else{for(aG=0;aG<aF.length;aG++){if(aL==="attributes"?p.getAttrib(aI,aF[aG]):af(aI,aF[aG])){return aK}}}}return aK}if(ay&&ax){for(aB=0;aB<ay.length;aB++){aD=ay[aB];if(v(ax,aD)&&aE(ax,aD,"attributes")&&aE(ax,aD,"styles")){if((az=aD.classes)){for(aB=0;aB<az.length;aB++){if(!p.hasClass(ax,az[aB])){return}}}return aD}}}}function y(ay,aA,az){var ax;function aw(aC){var aB=p.getRoot();if(aC===aB){return false}aC=p.getParent(aC,function(aD){return aD.parentNode===aB||!!P(aD,ay,aA,true)});return P(aC,ay,aA)}if(az){return aw(az)}az=I.getNode();if(aw(az)){return S}ax=I.getStart();if(ax!=az){if(aw(ax)){return S}}return ap}function M(aA,az){var ax,ay=[],aw={};ax=I.getStart();p.getParent(ax,function(aD){var aC,aB;for(aC=0;aC<aA.length;aC++){aB=aA[aC];if(!aw[aB]&&P(aD,aB,az)){aw[aB]=true;ay.push(aB)}}},p.getRoot());return ay}function Q(aA){var aC=an(aA),az,ay,aB,ax,aw;if(aC){az=I.getStart();ay=C(az);for(ax=aC.length-1;ax>=0;ax--){aw=aC[ax].selector;if(!aw||aC[ax].defaultBlock){return S}for(aB=ay.length-1;aB>=0;aB--){if(p.is(ay[aB],aw)){return S}}}}return ap}function aa(aw,az,ax){var ay;if(!ag){ag={};ay={};av.on("NodeChange",function(aB){var aA=C(aB.element),aC={};aA=j.grep(aA,function(aD){return aD.nodeType==1&&!aD.getAttribute("data-mce-bogus")});ak(ag,function(aD,aE){ak(aA,function(aF){if(P(aF,aE,{},aD.similar)){if(!ay[aE]){ak(aD,function(aG){aG(true,{node:aF,format:aE,parents:aA})});ay[aE]=aD}aC[aE]=aD;return false}})});ak(ay,function(aD,aE){if(!aC[aE]){delete ay[aE];ak(aD,function(aF){aF(false,{node:aB.element,format:aE,parents:aA})})}})})}ak(aw.split(","),function(aA){if(!ag[aA]){ag[aA]=[];ag[aA].similar=ax}ag[aA].push(az)});return this}function aq(aw){return n.getCssText(av,aw)}G(this,{get:an,register:A,unregister:O,apply:ar,remove:R,toggle:V,match:y,matchAll:M,matchNode:P,canApply:Q,formatChanged:aa,getCssText:aq});x();ao();av.on("BeforeGetContent",function(aw){if(z&&aw.format!="raw"){z()}});av.on("mouseup keydown",function(aw){if(X){X(aw)}});function v(aw,ax){if(u(aw,ax.inline)){return S}if(u(aw,ax.block)){return S}if(ax.selector){return aw.nodeType==1&&p.is(aw,ax.selector)}}function u(ax,aw){ax=ax||"";aw=aw||"";ax=""+(ax.nodeName||ax);aw=""+(aw.nodeName||aw);return ax.toLowerCase()==aw.toLowerCase()}function af(ax,aw){return J(p.getStyle(ax,aw),aw)}function J(ax,aw){if(aw=="color"||aw=="backgroundColor"){ax=p.toHex(ax)}if(aw=="fontWeight"&&ax==700){ax="bold"}if(aw=="fontFamily"){ax=ax.replace(/[\'\"]/g,"").replace(/,\s+/g,",")}return""+ax}function H(aw,ax){if(typeof aw!="string"){aw=aw(ax)}else{if(ax){aw=aw.replace(/%(\w+)/g,function(az,ay){return ax[ay]||az})}}return aw}function t(aw){return aw&&aw.nodeType===3&&/^([\t \r\n]+|)$/.test(aw.nodeValue)}function aj(ay,ax,aw){var az=p.create(ax,aw);ay.parentNode.insertBefore(az,ay);az.appendChild(ay);return az}function E(aw,aH,az){var aI,aC,aG,ay=aw.startContainer,aD=aw.startOffset,aL=aw.endContainer,aF=aw.endOffset;function aJ(aS){var aN,aQ,aP,aO,aM;aN=aQ=aS?ay:aL;aO=aS?"previousSibling":"nextSibling";aM=p.getRoot();function aR(aT){return aT.nodeName=="BR"&&aT.getAttribute("data-mce-bogus")&&!aT.nextSibling}if(aN.nodeType==3&&!t(aN)){if(aS?aD>0:aF<aN.nodeValue.length){return aN}}while(true){if(!aH[0].block_expand&&Y(aQ)){return aQ}for(aP=aQ[aO];aP;aP=aP[aO]){if(!ab(aP)&&!t(aP)&&!aR(aP)){return aQ}}if(aQ.parentNode==aM){aN=aQ;break}aQ=aQ.parentNode}return aN}function aB(aM,aN){if(aN===T){aN=aM.nodeType===3?aM.length:aM.childNodes.length}while(aM&&aM.hasChildNodes()){aM=aM.childNodes[aN];if(aM){aN=aM.nodeType===3?aM.length:aM.childNodes.length}}return{node:aM,offset:aN}}if(ay.nodeType==1&&ay.hasChildNodes()){aI=ay.childNodes.length-1;ay=ay.childNodes[aD>aI?aI:aD];if(ay.nodeType==3){aD=0}}if(aL.nodeType==1&&aL.hasChildNodes()){aI=aL.childNodes.length-1;aL=aL.childNodes[aF>aI?aI:aF-1];if(aL.nodeType==3){aF=aL.nodeValue.length}}function aK(aN){var aM=aN;while(aM){if(aM.nodeType===1&&N(aM)){return N(aM)==="false"?aM:aN}aM=aM.parentNode}return aN}function aE(aN,aR,aT){var aQ,aO,aS,aM;function aP(aV,aX){var aY,aU,aW=aV.nodeValue;if(typeof aX=="undefined"){aX=aT?aW.length:0}if(aT){aY=aW.lastIndexOf(" ",aX);aU=aW.lastIndexOf("\u00a0",aX);aY=aY>aU?aY:aU;if(aY!==-1&&!az){aY++}}else{aY=aW.indexOf(" ",aX);aU=aW.indexOf("\u00a0",aX);aY=aY!==-1&&(aU===-1||aY<aU)?aY:aU}return aY}if(aN.nodeType===3){aS=aP(aN,aR);if(aS!==-1){return{container:aN,offset:aS}}aM=aN}aQ=new l(aN,p.getParent(aN,Y)||av.getBody());while((aO=aQ[aT?"prev":"next"]())){if(aO.nodeType===3){aM=aO;aS=aP(aO);if(aS!==-1){return{container:aO,offset:aS}}}else{if(Y(aO)){break}}}if(aM){if(aT){aR=0}else{aR=aM.length}return{container:aM,offset:aR}}}function aA(aN,aM){var aO,aP,aR,aQ;if(aN.nodeType==3&&aN.nodeValue.length===0&&aN[aM]){aN=aN[aM]}aO=C(aN);for(aP=0;aP<aO.length;aP++){for(aR=0;aR<aH.length;aR++){aQ=aH[aR];if("collapsed" in aQ&&aQ.collapsed!==aw.collapsed){continue}if(p.is(aO[aP],aQ.selector)){return aO[aP]}}}return aN}function ax(aO,aM){var aP,aN=p.getRoot();if(!aH[0].wrapper){aP=p.getParent(aO,aH[0].block,aN)}if(!aP){aP=p.getParent(aO.nodeType==3?aO.parentNode:aO,function(aQ){return aQ!=aN&&Z(aQ)})}if(aP&&aH[0].wrapper){aP=C(aP,"ul,ol").reverse()[0]||aP}if(!aP){aP=aO;while(aP[aM]&&!Y(aP[aM])){aP=aP[aM];if(u(aP,"br")){break}}}return aP||aO}ay=aK(ay);aL=aK(aL);if(ab(ay.parentNode)||ab(ay)){ay=ab(ay)?ay:ay.parentNode;ay=ay.nextSibling||ay;if(ay.nodeType==3){aD=0}}if(ab(aL.parentNode)||ab(aL)){aL=ab(aL)?aL:aL.parentNode;aL=aL.previousSibling||aL;if(aL.nodeType==3){aF=aL.length}}if(aH[0].inline){if(aw.collapsed){aG=aE(ay,aD,true);if(aG){ay=aG.container;aD=aG.offset}aG=aE(aL,aF);if(aG){aL=aG.container;aF=aG.offset}}aC=aB(aL,aF);if(aC.node){while(aC.node&&aC.offset===0&&aC.node.previousSibling){aC=aB(aC.node.previousSibling)}if(aC.node&&aC.offset>0&&aC.node.nodeType===3&&aC.node.nodeValue.charAt(aC.offset-1)===" "){if(aC.offset>1){aL=aC.node;aL.splitText(aC.offset-1)}}}}if(aH[0].inline||aH[0].block_expand){if(!aH[0].inline||(ay.nodeType!=3||aD===0)){ay=aJ(true)}if(!aH[0].inline||(aL.nodeType!=3||aF===aL.nodeValue.length)){aL=aJ()}}if(aH[0].selector&&aH[0].expand!==ap&&!aH[0].inline){ay=aA(ay,"previousSibling");aL=aA(aL,"nextSibling")}if(aH[0].block||aH[0].selector){ay=ax(ay,"previousSibling");aL=ax(aL,"nextSibling");if(aH[0].block){if(!Y(ay)){ay=aJ(true)}if(!Y(aL)){aL=aJ()}}}if(ay.nodeType==1){aD=K(ay);ay=ay.parentNode}if(aL.nodeType==1){aF=K(aL)+1;aL=aL.parentNode}return{startContainer:ay,startOffset:aD,endContainer:aL,endOffset:aF}}function q(aw,ax){return ax.links&&aw.tagName=="A"}function au(aC,aB,az,aw){var ay,ax,aA;if(!v(az,aC)&&!q(az,aC)){return ap}if(aC.remove!="all"){ak(aC.styles,function(aE,aD){aE=J(H(aE,aB),aD);if(typeof aD==="number"){aD=aE;aw=0}if(aC.remove_similar||(!aw||u(af(aw,aD),aE))){p.setStyle(az,aD,"")}aA=1});if(aA&&p.getAttrib(az,"style")===""){az.removeAttribute("style");az.removeAttribute("data-mce-style")}ak(aC.attributes,function(aF,aD){var aE;aF=H(aF,aB);if(typeof aD==="number"){aD=aF;aw=0}if(!aw||u(p.getAttrib(aw,aD),aF)){if(aD=="class"){aF=p.getAttrib(az,aD);if(aF){aE="";ak(aF.split(/\s+/),function(aG){if(/mce\-\w+/.test(aG)){aE+=(aE?" ":"")+aG}});if(aE){p.setAttrib(az,aD,aE);return}}}if(aD=="class"){az.removeAttribute("className")}if(s.test(aD)){az.removeAttribute("data-mce-"+aD)}az.removeAttribute(aD)}});ak(aC.classes,function(aD){aD=H(aD,aB);if(!aw||p.hasClass(aw,aD)){p.removeClass(az,aD)}});ax=p.getAttribs(az);for(ay=0;ay<ax.length;ay++){if(ax[ay].nodeName.indexOf("_")!==0){return ap}}}if(aC.remove!="none"){D(az,aC);return S}}function D(ay,az){var aw=ay.parentNode,ax;function aA(aC,aB,aD){aC=U(aC,aB,aD);return !aC||(aC.nodeName=="BR"||Y(aC))}if(az.block){if(!B){if(Y(ay)&&!Y(aw)){if(!aA(ay,ap)&&!aA(ay.firstChild,S,1)){ay.insertBefore(p.create("br"),ay.firstChild)}if(!aA(ay,S)&&!aA(ay.lastChild,ap,1)){ay.appendChild(p.create("br"))}}}else{if(aw==p.getRoot()){if(!az.list_block||!u(ay,az.list_block)){ak(at(ay.childNodes),function(aB){if(r(B,aB.nodeName.toLowerCase())){if(!ax){ax=aj(aB,B);p.setAttribs(ax,av.settings.forced_root_block_attrs)}else{ax.appendChild(aB)}}else{ax=0}})}}}}if(az.selector&&az.inline&&!u(az.inline,ay)){return}p.remove(ay,1)}function U(ax,aw,ay){if(ax){aw=aw?"nextSibling":"previousSibling";for(ax=ay?ax:ax[aw];ax;ax=ax[aw]){if(ax.nodeType==1||!t(ax)){return ax}}}}function L(aA,az){var ay,ax,aw=new k(p);function aB(aD,aC){for(ay=aD;ay;ay=ay[aC]){if(ay.nodeType==3&&ay.nodeValue.length!==0){return aD}if(ay.nodeType==1&&!ab(ay)){return ay}}return aD}if(aA&&az){aA=aB(aA,"previousSibling");az=aB(az,"nextSibling");if(aw.compare(aA,az)){for(ay=aA.nextSibling;ay&&ay!=az;){ax=ay;ay=ay.nextSibling;aA.appendChild(ax)}p.remove(az);ak(at(az.childNodes),function(aC){aA.appendChild(aC)});return aA}}return az}function ad(ax,aA){var aw,az,ay;aw=ax[aA?"startContainer":"endContainer"];az=ax[aA?"startOffset":"endOffset"];if(aw.nodeType==1){ay=aw.childNodes.length-1;if(!aA&&az){az--}aw=aw.childNodes[az>ay?ay:az]}if(aw.nodeType===3&&aA&&az>=aw.nodeValue.length){aw=new l(aw,av.getBody()).next()||aw}if(aw.nodeType===3&&!aA&&az===0){aw=new l(aw,av.getBody()).prev()||aw}return aw}function al(aG,aw,aE,aA){var aH="_mce_caret",ax=av.settings.caret_debug;function ay(aL){var aK=p.create("span",{id:aH,"data-mce-bogus":true,style:ax?"color:red":""});if(aL){aK.appendChild(av.getDoc().createTextNode(W))}return aK}function aF(aL,aK){while(aL){if((aL.nodeType===3&&aL.nodeValue!==W)||aL.childNodes.length>1){return false}if(aK&&aL.nodeType===1){aK.push(aL)}aL=aL.firstChild}return true}function aC(aK){while(aK){if(aK.id===aH){return aK}aK=aK.parentNode}}function aB(aK){var aL;if(aK){aL=new l(aK,aK);for(aK=aL.current();aK;aK=aL.next()){if(aK.nodeType===3){return aK}}}}function az(aM,aL){var aN,aK;if(!aM){aM=aC(I.getStart());if(!aM){while((aM=p.get(aH))){az(aM,false)}}}else{aK=I.getRng(true);if(aF(aM)){if(aL!==false){aK.setStartBefore(aM);aK.setEndBefore(aM)}p.remove(aM)}else{aN=aB(aM);if(aN.nodeValue.charAt(0)===W){aN.deleteData(0,1);if(aK.startContainer==aN&&aK.startOffset>0){aK.setStart(aN,aK.startOffset-1)}if(aK.endContainer==aN&&aK.endOffset>0){aK.setEnd(aN,aK.endOffset-1)}}p.remove(aM,1)}I.setRng(aK)}}function aD(){var aM,aK,aQ,aP,aN,aL,aO;aM=I.getRng(true);aP=aM.startOffset;aL=aM.startContainer;aO=aL.nodeValue;aK=aC(I.getStart());if(aK){aQ=aB(aK)}if(aO&&aP>0&&aP<aO.length&&/\w/.test(aO.charAt(aP))&&/\w/.test(aO.charAt(aP-1))){aN=I.getBookmark();aM.collapse(true);aM=E(aM,an(aw));aM=ae.split(aM);ar(aw,aE,aM);I.moveToBookmark(aN)}else{if(!aK||aQ.nodeValue!==W){aK=ay(true);aQ=aK.firstChild;aM.insertNode(aK);aP=1;ar(aw,aE,aK)}else{ar(aw,aE,aK)}I.setCursorLocation(aQ,aP)}}function aI(){var aK=I.getRng(true),aL,aO,aR,aQ,aM,aU,aT=[],aP,aS;aL=aK.startContainer;aO=aK.startOffset;aM=aL;if(aL.nodeType==3){if(aO!=aL.nodeValue.length){aQ=true}aM=aM.parentNode}while(aM){if(P(aM,aw,aE,aA)){aU=aM;break}if(aM.nextSibling){aQ=true}aT.push(aM);aM=aM.parentNode}if(!aU){return}if(aQ){aR=I.getBookmark();aK.collapse(true);aK=E(aK,an(aw),true);aK=ae.split(aK);R(aw,aE,aK);I.moveToBookmark(aR)}else{aS=ay();aM=aS;for(aP=aT.length-1;aP>=0;aP--){aM.appendChild(p.clone(aT[aP],false));aM=aM.firstChild}aM.appendChild(p.doc.createTextNode(W));aM=aM.firstChild;var aN=p.getParent(aU,Z);if(aN&&p.isEmpty(aN)){aU.parentNode.replaceChild(aS,aU)}else{p.insertAfter(aS,aU)}I.setCursorLocation(aM,1);if(p.isEmpty(aU)){p.remove(aU)}}}function aJ(){var aK;aK=aC(I.getStart());if(aK&&!p.isEmpty(aK)){F(aK,function(aL){if(aL.nodeType==1&&aL.id!==aH&&!p.isEmpty(aL)){p.setAttrib(aL,"data-mce-bogus",null)}},"childNodes")}}if(!av._hasCaretEvents){z=function(){var aK=[],aL;if(aF(aC(I.getStart()),aK)){aL=aK.length;while(aL--){p.setAttrib(aK[aL],"data-mce-bogus","1")}}};X=function(aL){var aK=aL.keyCode;az();if((aK==8&&I.isCollapsed())||aK==37||aK==39){az(aC(I.getStart()))}aJ()};av.on("SetContent",function(aK){if(aK.selection){aJ()}});av._hasCaretEvents=true}if(aG=="apply"){aD()}else{aI()}}function ai(ax){var aw=ax.startContainer,aD=ax.startOffset,az,aC,aB,ay,aA;if(aw.nodeType==3&&aD>=aw.nodeValue.length){aD=K(aw);aw=aw.parentNode;az=true}if(aw.nodeType==1){ay=aw.childNodes;aw=ay[Math.min(aD,ay.length-1)];aC=new l(aw,p.getParent(aw,p.isBlock));if(aD>ay.length-1||az){aC.next()}for(aB=aC.current();aB;aB=aC.next()){if(aB.nodeType==3&&!t(aB)){aA=p.create("a",{"data-mce-bogus":"all"},W);aB.parentNode.insertBefore(aA,aB);ax.setStart(aB,0);I.setRng(ax);p.remove(aA);return}}}}}});h("tinymce/UndoManager",["tinymce/util/VK","tinymce/Env","tinymce/util/Tools","tinymce/html/SaxParser"],function(n,k,l,j){var i=l.trim,m;m=new RegExp(["<span[^>]+data-mce-bogus[^>]+>[\u200B\uFEFF]+<\\/span>",'\\s?data-mce-selected="[^"]+"'].join("|"),"gi");return function(t){var x=this,u=0,q=[],r,v,w=0;function o(){var D=t.getContent({format:"raw",no_events:1});var B=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g;var y,z,F,E,A,C=t.schema;D=D.replace(m,"");A=C.getShortEndedElements();while((E=B.exec(D))){z=B.lastIndex;F=E[0].length;if(A[E[1]]){y=z}else{y=j.findEndTag(C,D,z)}D=D.substring(0,z-F)+D.substring(y);B.lastIndex=z-F}return i(D)}function s(y){t.isNotDirty=!y}function p(y){x.typing=false;x.add({},y)}t.on("init",function(){x.add()});t.on("BeforeExecCommand",function(z){var y=z.command;if(y!="Undo"&&y!="Redo"&&y!="mceRepaint"){x.beforeChange()}});t.on("ExecCommand",function(z){var y=z.command;if(y!="Undo"&&y!="Redo"&&y!="mceRepaint"){p(z)}});t.on("ObjectResizeStart",function(){x.beforeChange()});t.on("SaveContent ObjectResized blur",p);t.on("DragEnd",p);t.on("KeyUp",function(z){var y=z.keyCode;if((y>=33&&y<=36)||(y>=37&&y<=40)||y==45||y==13||z.ctrlKey){p();t.nodeChanged()}if(y==46||y==8||(k.mac&&(y==91||y==93))){t.nodeChanged()}if(v&&x.typing){if(!t.isDirty()){s(q[0]&&o()!=q[0].content);if(!t.isNotDirty){t.fire("change",{level:q[0],lastLevel:null})}}t.fire("TypingUndo");v=false;t.nodeChanged()}});t.on("KeyDown",function(A){var z=A.keyCode;if((z>=33&&z<=36)||(z>=37&&z<=40)||z==45){if(x.typing){p(A)}return}var y=(A.ctrlKey&&!A.altKey)||A.metaKey;if((z<16||z>20)&&z!=224&&z!=91&&!x.typing&&!y){x.beforeChange();x.typing=true;x.add({},A);v=true}});t.on("MouseDown",function(y){if(x.typing){p(y)}});t.addShortcut("meta+z","","Undo");t.addShortcut("meta+y,meta+shift+z","","Redo");t.on("AddUndo Undo Redo ClearUndos",function(y){if(!y.isDefaultPrevented()){t.nodeChanged()}});x={data:q,typing:false,beforeChange:function(){if(!w){r=t.selection.getBookmark(2,true)}},add:function(D,C){var z,A=t.settings,B;D=D||{};D.content=o();if(w||t.removed){return null}B=q[u];if(t.fire("BeforeAddUndo",{level:D,lastLevel:B,originalEvent:C}).isDefaultPrevented()){return null}if(B&&B.content==D.content){return null}if(q[u]){q[u].beforeBookmark=r}if(A.custom_undo_redo_levels){if(q.length>A.custom_undo_redo_levels){for(z=0;z<q.length-1;z++){q[z]=q[z+1]}q.length--;u=q.length}}D.bookmark=t.selection.getBookmark(2,true);if(u<q.length-1){q.length=u+1}q.push(D);u=q.length-1;var y={level:D,lastLevel:B,originalEvent:C};t.fire("AddUndo",y);if(u>0){s(true);t.fire("change",y)}return D},undo:function(){var y;if(x.typing){x.add();x.typing=false}if(u>0){y=q[--u];if(u===0){s(false)}t.setContent(y.content,{format:"raw"});t.selection.moveToBookmark(y.beforeBookmark);t.fire("undo",{level:y})}return y},redo:function(){var y;if(u<q.length-1){y=q[++u];t.setContent(y.content,{format:"raw"});t.selection.moveToBookmark(y.bookmark);s(true);t.fire("redo",{level:y})}return y},clear:function(){q=[];u=0;x.typing=false;t.fire("ClearUndos")},hasUndo:function(){return u>0||(x.typing&&q[0]&&o()!=q[0].content)},hasRedo:function(){return u<q.length-1&&!this.typing},transact:function(y){x.beforeChange();try{w++;y()}finally{w--}x.add()}};return x}});h("tinymce/EnterKey",["tinymce/dom/TreeWalker","tinymce/dom/RangeUtils","tinymce/Env"],function(j,l,i){var k=i.ie&&i.ie<11;return function(r){var o=r.dom,s=r.selection,m=r.settings;var u=r.undoManager,n=r.schema,p=n.getNonEmptyElements(),t=n.getMoveCaretBeforeOnEnterElements();function q(M){var H,R,v,L,G,B,X,N,A,w,z,F,U,J,O;function P(Y){return Y&&o.isBlock(Y)&&!/^(TD|TH|CAPTION|FORM)$/.test(Y.nodeName)&&!/^(fixed|absolute)/i.test(Y.style.position)&&o.getContentEditable(Y)!=="true"}function Q(Z){var Y;if(o.isBlock(Z)){Y=s.getRng();Z.appendChild(o.create("span",null,"\u00a0"));s.select(Z);Z.lastChild.outerHTML="";s.setRng(Y)}}function K(aa){var Z=aa,ab=[],Y;if(!Z){return}while((Z=Z.firstChild)){if(o.isBlock(Z)){return}if(Z.nodeType==1&&!p[Z.nodeName.toLowerCase()]){ab.push(Z)}}Y=ab.length;while(Y--){Z=ab[Y];if(!Z.hasChildNodes()||(Z.firstChild==Z.lastChild&&Z.firstChild.nodeValue==="")){o.remove(Z)}else{if(Z.nodeName=="A"&&(Z.innerText||Z.textContent)===" "){o.remove(Z)}}}}function y(Z){var af,ac,Y,ab=Z,aa;function ae(ag){while(ag){if(ag.nodeType==1||(ag.nodeType==3&&ag.data&&/[\r\n\s]/.test(ag.data))){return ag}ag=ag.nextSibling}}if(!Z){return}if(i.ie&&i.ie<9&&B&&B.firstChild){if(B.firstChild==B.lastChild&&B.firstChild.tagName=="BR"){o.remove(B.firstChild)}}if(/^(LI|DT|DD)$/.test(Z.nodeName)){var ad=ae(Z.firstChild);if(ad&&/^(UL|OL|DL)$/.test(ad.nodeName)){Z.insertBefore(o.doc.createTextNode("\u00a0"),Z.firstChild)}}Y=o.createRng();if(!i.ie){Z.normalize()}if(Z.hasChildNodes()){af=new j(Z,Z);while((ac=af.current())){if(ac.nodeType==3){Y.setStart(ac,0);Y.setEnd(ac,0);break}if(t[ac.nodeName.toLowerCase()]){Y.setStartBefore(ac);Y.setEndBefore(ac);break}ab=ac;ac=af.next()}if(!ac){Y.setStart(ab,0);Y.setEnd(ab,0)}}else{if(Z.nodeName=="BR"){if(Z.nextSibling&&o.isBlock(Z.nextSibling)){if(!X||X<9){aa=o.create("br");Z.parentNode.insertBefore(aa,Z)}Y.setStartBefore(Z);Y.setEndBefore(Z)}else{Y.setStartAfter(Z);Y.setEndAfter(Z)}}else{Y.setStart(Z,0);Y.setEnd(Z,0)}}s.setRng(Y);o.remove(aa);s.scrollIntoView(Z)}function I(Z){var Y=m.forced_root_block;if(Y&&Y.toLowerCase()===Z.tagName.toLowerCase()){o.setAttribs(Z,m.forced_root_block_attrs)}}function D(Z){var ab=L,ad,ac,Y,aa=n.getTextInlineElements();if(Z||F=="TABLE"){ad=o.create(Z||J);I(ad)}else{ad=B.cloneNode(false)}Y=ad;if(m.keep_styles!==false){do{if(aa[ab.nodeName]){if(ab.id=="_mce_caret"){continue}ac=ab.cloneNode(false);o.setAttrib(ac,"id","");if(ad.hasChildNodes()){ac.appendChild(ad.firstChild);ad.appendChild(ac)}else{Y=ac;ad.appendChild(ac)}}}while((ab=ab.parentNode))}if(!k){Y.innerHTML='<br data-mce-bogus="1">'}return ad}function C(ab){var aa,Z,Y;if(L.nodeType==3&&(ab?G>0:G<L.nodeValue.length)){return false}if(L.parentNode==B&&O&&!ab){return true}if(ab&&L.nodeType==1&&L==B.firstChild){return true}if(L.nodeName==="TABLE"||(L.previousSibling&&L.previousSibling.nodeName=="TABLE")){return(O&&!ab)||(!O&&ab)}aa=new j(L,B);if(L.nodeType==3){if(ab&&G===0){aa.prev()}else{if(!ab&&G==L.nodeValue.length){aa.next()}}}while((Z=aa.current())){if(Z.nodeType===1){if(!Z.getAttribute("data-mce-bogus")){Y=Z.nodeName.toLowerCase();if(p[Y]&&Y!=="br"){return false}}}else{if(Z.nodeType===3&&!/^[ \t\r\n]*$/.test(Z.nodeValue)){return false}}if(ab){aa.prev()}else{aa.next()}}return true}function x(Z,ad){var af,aa,ab,ac,ae,Y,ag=J||"P";aa=o.getParent(Z,o.isBlock);Y=r.getBody().nodeName.toLowerCase();if(!aa||!P(aa)){aa=aa||v;if(!aa.hasChildNodes()){af=o.create(ag);I(af);aa.appendChild(af);H.setStart(af,0);H.setEnd(af,0);return af}ac=Z;while(ac.parentNode!=aa){ac=ac.parentNode}while(ac&&!o.isBlock(ac)){ab=ac;ac=ac.previousSibling}if(ab&&n.isValidChild(Y,ag.toLowerCase())){af=o.create(ag);I(af);ab.parentNode.insertBefore(af,ab);ac=ab;while(ac&&!o.isBlock(ac)){ae=ac.nextSibling;af.appendChild(ac);ac=ae}H.setStart(Z,ad);H.setEnd(Z,ad)}}return Z}function S(){function Z(ac){var ab=z[ac?"firstChild":"lastChild"];while(ab){if(ab.nodeType==1){break}ab=ab[ac?"nextSibling":"previousSibling"]}return ab===B}function aa(){var ab=z.parentNode;if(/^(LI|DT|DD)$/.test(ab.nodeName)){return ab}return z}var Y=z.parentNode.nodeName;if(/^(OL|UL|LI)$/.test(Y)){J="LI"}A=J?D(J):o.create("BR");if(Z(true)&&Z()){if(Y=="LI"){o.insertAfter(A,aa())}else{o.replace(A,z)}}else{if(Z(true)){if(Y=="LI"){o.insertAfter(A,aa());A.appendChild(o.doc.createTextNode(" "));A.appendChild(z)}else{z.parentNode.insertBefore(A,z)}}else{if(Z()){o.insertAfter(A,aa());Q(A)}else{z=aa();R=H.cloneRange();R.setStartAfter(B);R.setEndAfter(z);w=R.extractContents();if(J=="LI"&&w.firstChild.nodeName=="LI"){A=w.firstChild;o.insertAfter(w,z)}else{o.insertAfter(w,z);o.insertAfter(A,z)}}}}o.remove(B);y(A);u.add()}function W(){r.execCommand("InsertLineBreak",false,M)}function E(Y){do{if(Y.nodeType===3){Y.nodeValue=Y.nodeValue.replace(/^[\r\n]+/,"")}Y=Y.firstChild}while(Y)}function V(aa){var Y=o.getRoot(),Z,ab;Z=aa;while(Z!==Y&&o.getContentEditable(Z)!=="false"){if(o.getContentEditable(Z)==="true"){ab=Z}Z=Z.parentNode}return Z!==Y?ab:Y}function T(Z){var Y;if(!k){Z.normalize();Y=Z.lastChild;if(!Y||(/^(left|right)$/gi.test(o.getStyle(Y,"float",true)))){o.add(Z,"br")}}}H=s.getRng(true);if(M.isDefaultPrevented()){return}if(!H.collapsed){r.execCommand("Delete");return}new l(o).normalize(H);L=H.startContainer;G=H.startOffset;J=(m.force_p_newlines?"p":"")||m.forced_root_block;J=J?J.toUpperCase():"";X=o.doc.documentMode;N=M.shiftKey;if(L.nodeType==1&&L.hasChildNodes()){O=G>L.childNodes.length-1;L=L.childNodes[Math.min(G,L.childNodes.length-1)]||L;if(O&&L.nodeType==3){G=L.nodeValue.length}else{G=0}}v=V(L);if(!v){return}u.beforeChange();if(!o.isBlock(v)&&v!=o.getRoot()){if(!J||N){W()}return}if((J&&!N)||(!J&&N)){L=x(L,G)}B=o.getParent(L,o.isBlock);z=B?o.getParent(B.parentNode,o.isBlock):null;F=B?B.nodeName.toUpperCase():"";U=z?z.nodeName.toUpperCase():"";if(U=="LI"&&!M.ctrlKey){B=z;F=U}if(/^(LI|DT|DD)$/.test(F)){if(!J&&N){W();return}if(o.isEmpty(B)){S();return}}if(F=="PRE"&&m.br_in_pre!==false){if(!N){W();return}}else{if((!J&&!N&&F!="LI")||(J&&N)){W();return}}if(J&&B===r.getBody()){return}J=J||"P";if(C()){if(/^(H[1-6]|PRE|FIGURE)$/.test(F)&&U!="HGROUP"){A=D(J)}else{A=D()}if(m.end_container_on_empty_block&&P(z)&&o.isEmpty(B)){A=o.split(z,B)}else{o.insertAfter(A,B)}y(A)}else{if(C(true)){A=B.parentNode.insertBefore(D(),B);Q(A);y(B)}else{R=H.cloneRange();R.setEndAfter(B);w=R.extractContents();E(w);A=w.firstChild;o.insertAfter(w,B);K(A);T(B);y(A)}}o.setAttrib(A,"id","");r.fire("NewBlock",{newBlock:A});u.add()}r.on("keydown",function(v){if(v.keyCode==13){if(q(v)!==false){v.preventDefault()}}})}});h("tinymce/ForceBlocks",[],function(){return function(k){var j=k.settings,n=k.dom,i=k.selection;var m=k.schema,l=m.getBlockElements();function o(){var u=i.getStart(),s=k.getBody(),p;var v,A,E,C,t;var w,x=-16777215,B,q;var D,r,z;z=j.forced_root_block;if(!u||u.nodeType!==1||!z){return}while(u&&u!=s){if(l[u.nodeName]){return}u=u.parentNode}p=i.getRng();if(p.setStart){v=p.startContainer;A=p.startOffset;E=p.endContainer;C=p.endOffset;try{q=k.getDoc().activeElement===s}catch(y){}}else{if(p.item){u=p.item(0);p=k.getDoc().body.createTextRange();p.moveToElementText(u)}q=p.parentElement().ownerDocument===k.getDoc();D=p.duplicate();D.collapse(true);A=D.move("character",x)*-1;if(!D.collapsed){D=p.duplicate();D.collapse(false);C=(D.move("character",x)*-1)-A}}u=s.firstChild;r=s.nodeName.toLowerCase();while(u){if(((u.nodeType===3||(u.nodeType==1&&!l[u.nodeName])))&&m.isValidChild(r,z.toLowerCase())){if(u.nodeType===3&&u.nodeValue.length===0){w=u;u=u.nextSibling;n.remove(w);continue}if(!t){t=n.create(z,k.settings.forced_root_block_attrs);u.parentNode.insertBefore(t,u);B=true}w=u;u=u.nextSibling;t.appendChild(w)}else{t=null;u=u.nextSibling}}if(B&&q){if(p.setStart){p.setStart(v,A);p.setEnd(E,C);i.setRng(p)}else{try{p=k.getDoc().body.createTextRange();p.moveToElementText(s);p.collapse(true);p.moveStart("character",A);if(C>0){p.moveEnd("character",C)}p.select()}catch(y){}}k.nodeChanged()}}if(j.forced_root_block){k.on("NodeChange",o)}}});h("tinymce/EditorCommands",["tinymce/html/Serializer","tinymce/Env","tinymce/util/Tools","tinymce/dom/ElementUtils","tinymce/dom/RangeUtils","tinymce/dom/TreeWalker"],function(t,r,m,k,p,w){var v=m.each,s=m.extend;var j=m.map,x=m.inArray,u=m.explode;var i=r.gecko,l=r.ie,o=r.ie&&r.ie<11;var n=true,q=false;return function(B){var M,S,L,E={state:{},exec:{},value:{}},O=B.settings,F;B.on("PreInit",function(){M=B.dom;S=B.selection;O=B.settings;L=B.formatter});function N(aa,Z,Y,T){var V,X,W=0;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(aa)&&(!T||!T.skip_focus)){B.focus()}T=s({},T);T=B.fire("BeforeExecCommand",{command:aa,ui:Z,value:Y});if(T.isDefaultPrevented()){return false}X=aa.toLowerCase();if((V=E.exec[X])){V(X,Z,Y);B.fire("ExecCommand",{command:aa,ui:Z,value:Y});return true}v(B.plugins,function(ab){if(ab.execCommand&&ab.execCommand(aa,Z,Y)){B.fire("ExecCommand",{command:aa,ui:Z,value:Y});W=true;return false}});if(W){return W}if(B.theme&&B.theme.execCommand&&B.theme.execCommand(aa,Z,Y)){B.fire("ExecCommand",{command:aa,ui:Z,value:Y});return true}try{W=B.getDoc().execCommand(aa,Z,Y)}catch(U){}if(W){B.fire("ExecCommand",{command:aa,ui:Z,value:Y});return true}return false}function D(V){var U;if(B._isHidden()){return}V=V.toLowerCase();if((U=E.state[V])){return U(V)}try{return B.getDoc().queryCommandState(V)}catch(T){}return false}function K(V){var U;if(B._isHidden()){return}V=V.toLowerCase();if((U=E.value[V])){return U(V)}try{return B.getDoc().queryCommandValue(V)}catch(T){}}function I(T,U){U=U||"exec";v(T,function(W,V){v(V.toLowerCase().split(","),function(X){E[U][X]=W})})}function H(U,V,T){U=U.toLowerCase();E.exec[U]=function(Z,Y,X,W){return V.call(T||B,Y,X,W)}}function Q(U){U=U.toLowerCase();if(E.exec[U]){return true}try{return B.getDoc().queryCommandSupported(U)}catch(T){}return false}function y(U,V,T){U=U.toLowerCase();E.state[U]=function(){return V.call(T||B)}}function z(U,V,T){U=U.toLowerCase();E.value[U]=function(){return V.call(T||B)}}function A(T){T=T.toLowerCase();return !!E.exec[T]}s(this,{execCommand:N,queryCommandState:D,queryCommandValue:K,queryCommandSupported:Q,addCommands:I,addCommand:H,addQueryStateHandler:y,addQueryValueHandler:z,hasCustomCommand:A});function C(V,U,T){if(U===g){U=q}if(T===g){T=null}return B.getDoc().execCommand(V,U,T)}function P(T){return L.match(T)}function R(T,U){L.toggle(T,U?{value:U}:g);B.nodeChanged()}function J(T){F=S.getBookmark(T)}function G(){S.moveToBookmark(F)}I({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){B.undoManager.add()},"Cut,Copy,Paste":function(X){var V=B.getDoc(),T;try{C(X)}catch(U){T=n}if(T||!V.queryCommandSupported(X)){var W=B.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");if(r.mac){W=W.replace(/Ctrl\+/g,"\u2318+")}B.windowManager.alert(W)}},unlink:function(){if(S.isCollapsed()){var T=S.getNode();if(T.tagName=="A"){B.dom.remove(T,true)}return}L.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(T){var U=T.substring(7);if(U=="full"){U="justify"}v("left,center,right,justify".split(","),function(V){if(U!=V){L.remove("align"+V)}});R("align"+U);N("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(V){var T,U;C(V);T=M.getParent(S.getNode(),"ol,ul");if(T){U=T.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(U.nodeName)){J();M.split(U,T);G()}}},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(T){R(T)},"ForeColor,HiliteColor,FontName":function(V,U,T){R(V,T)},FontSize:function(W,V,U){var T,X;if(U>=1&&U<=7){X=u(O.font_size_style_values);T=u(O.font_size_classes);if(T){U=T[U-1]||U}else{U=X[U-1]||U}}R(W,U)},RemoveFormat:function(T){L.remove(T)},mceBlockQuote:function(){R("blockquote")},FormatBlock:function(V,U,T){return R(T||"p")},mceCleanup:function(){var T=S.getBookmark();B.setContent(B.getContent({cleanup:n}),{cleanup:n});S.moveToBookmark(T)},mceRemoveNode:function(W,V,U){var T=U||S.getNode();if(T!=B.getBody()){J();B.dom.remove(T,n);G()}},mceSelectNodeDepth:function(W,V,U){var T=0;M.getParent(S.getNode(),function(X){if(X.nodeType==1&&T++==U){S.select(X);return q}},B.getBody())},mceSelectNode:function(V,U,T){S.select(T)},mceInsertContent:function(Y,aj,ak){var X,an,ac,ao,U,W;var ab,aa,al,T,ae,Z;var ah=B.schema.getTextInlineElements();function am(au){var at,ar,av;at=S.getRng(true);ar=at.startContainer;av=at.startOffset;function aq(aw){return ar[aw]&&ar[aw].nodeType==3}if(ar.nodeType==3){if(av>0){au=au.replace(/^&nbsp;/," ")}else{if(!aq("previousSibling")){au=au.replace(/^ /,"&nbsp;")}}if(av<ar.length){au=au.replace(/&nbsp;(<br>|)$/," ")}else{if(!aq("nextSibling")){au=au.replace(/(&nbsp;| )(<br>|)$/,"&nbsp;")}}}return au}function V(){var ar,aq,at;ar=S.getRng(true);aq=ar.startContainer;at=ar.startOffset;if(aq.nodeType==3&&ar.collapsed){if(aq.data[at]==="\u00a0"){aq.deleteData(at,1);if(!/[\u00a0| ]$/.test(ak)){ak+=" "}}else{if(aq.data[at-1]==="\u00a0"){aq.deleteData(at-1,1);if(!/[\u00a0| ]$/.test(ak)){ak=" "+ak}}}}}function ad(aq){if(Z){for(al=aq.firstChild;al;al=al.walk(true)){if(ah[al.name]){al.attr("data-mce-new","true")}}}}function ap(){if(Z){var aq=B.getBody(),ar=new k(M);v(M.select("*[data-mce-new]"),function(au){au.removeAttribute("data-mce-new");for(var at=au.parentNode;at&&at!=aq;at=at.parentNode){if(ar.compare(at,au)){M.remove(au,true)}}})}}if(typeof ak!="string"){Z=ak.merge;ak=ak.content}if(/^ | $/.test(ak)){ak=am(ak)}X=B.parser;an=new t({},B.schema);ae='<span id="mce_marker" data-mce-type="bookmark">&#xFEFF;&#x200B;</span>';W={content:ak,format:"html",selection:true};B.fire("BeforeSetContent",W);ak=W.content;if(ak.indexOf("{$caret}")==-1){ak+="{$caret}"}ak=ak.replace(/\{\$caret\}/,ae);aa=S.getRng();var ai=aa.startContainer||(aa.parentElement?aa.parentElement():null);var af=B.getBody();if(ai===af&&S.isCollapsed()){if(M.isBlock(af.firstChild)&&M.isEmpty(af.firstChild)){aa=M.createRng();aa.setStart(af.firstChild,0);aa.setEnd(af.firstChild,0);S.setRng(aa)}}if(!S.isCollapsed()){B.getDoc().execCommand("Delete",false,null);V()}ac=S.getNode();var ag={context:ac.nodeName.toLowerCase()};U=X.parse(ak,ag);ad(U);al=U.lastChild;if(al.attr("id")=="mce_marker"){ab=al;for(al=al.prev;al;al=al.walk(true)){if(al.type==3||!M.isBlock(al.name)){if(B.schema.isValidChild(al.parent.name,"span")){al.parent.insert(ab,al,al.name==="br")}break}}}if(!ag.invalid){ak=an.serialize(U);al=ac.firstChild;T=ac.lastChild;if(!al||(al===T&&al.nodeName==="BR")){M.setHTML(ac,ak)}else{S.setContent(ak)}}else{S.setContent(ae);ac=S.getNode();ao=B.getBody();if(ac.nodeType==9){ac=al=ao}else{al=ac}while(al!==ao){ac=al;al=al.parentNode}ak=ac==ao?ao.innerHTML:M.getOuterHTML(ac);ak=an.serialize(X.parse(ak.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return an.serialize(U)})));if(ac==ao){M.setHTML(ao,ak)}else{M.setOuterHTML(ac,ak)}}ap();ab=M.get("mce_marker");S.scrollIntoView(ab);aa=M.createRng();al=ab.previousSibling;if(al&&al.nodeType==3){aa.setStart(al,al.nodeValue.length);if(!l){T=ab.nextSibling;if(T&&T.nodeType==3){al.appendData(T.data);T.parentNode.removeChild(T)}}}else{aa.setStartBefore(ab);aa.setEndBefore(ab)}M.remove(ab);S.setRng(aa);B.fire("SetContent",W);B.addVisual()},mceInsertRawHTML:function(V,U,T){S.setContent("tiny_mce_marker");B.setContent(B.getContent().replace(/tiny_mce_marker/g,function(){return T}))},mceToggleFormat:function(V,U,T){R(T)},mceSetContent:function(V,U,T){B.setContent(T)},"Indent,Outdent":function(W){var U,T,V;U=O.indentation;T=/[a-z%]+$/i.exec(U);U=parseInt(U,10);if(!D("InsertUnorderedList")&&!D("InsertOrderedList")){if(!O.forced_root_block&&!M.getParent(S.getNode(),M.isBlock)){L.apply("div")}v(S.getSelectedBlocks(),function(Y){if(Y.nodeName!="LI"){var X=B.getParam("indent_use_margin",false)?"margin":"padding";X+=M.getStyle(Y,"direction",true)=="rtl"?"Right":"Left";if(W=="outdent"){V=Math.max(0,parseInt(Y.style[X]||0,10)-U);M.setStyle(Y,X,V?V+T:"")}else{V=(parseInt(Y.style[X]||0,10)+U)+T;M.setStyle(Y,X,V)}}})}else{C(W)}},mceRepaint:function(){if(i){try{J(n);if(S.getSel()){S.getSel().selectAllChildren(B.getBody())}S.collapse(n);G()}catch(T){}}},InsertHorizontalRule:function(){B.execCommand("mceInsertContent",false,"<hr />")},mceToggleVisualAid:function(){B.hasVisual=!B.hasVisual;B.addVisual()},mceReplaceContent:function(V,U,T){B.execCommand("mceInsertContent",false,T.replace(/\{\$selection\}/g,S.getContent({format:"text"})))},mceInsertLink:function(W,V,U){var T;if(typeof U=="string"){U={href:U}}T=M.getParent(S.getNode(),"a");U.href=U.href.replace(" ","%20");if(!T||!U.href){L.remove("link")}if(U.href){L.apply("link",U,T)}},selectAll:function(){var U=M.getRoot(),T;if(S.getRng().setStart){T=M.createRng();T.setStart(U,0);T.setEnd(U,U.childNodes.length);S.setRng(T)}else{T=S.getRng();if(!T.item){T.moveToElementText(U);T.select()}}},"delete":function(){C("Delete");var T=B.getBody();if(M.isEmpty(T)){B.setContent("");if(T.firstChild&&M.isBlock(T.firstChild)){B.selection.setCursorLocation(T.firstChild,0)}else{B.selection.setCursorLocation(T,0)}}},mceNewDocument:function(){B.setContent("")},InsertLineBreak:function(V,af,ah){var ae=ah;var T,ac,aa;var Z=S.getRng(true);new p(M).normalize(Z);var Y=Z.startOffset;var ad=Z.startContainer;if(ad.nodeType==1&&ad.hasChildNodes()){var ai=Y>ad.childNodes.length-1;ad=ad.childNodes[Math.min(Y,ad.childNodes.length-1)]||ad;if(ai&&ad.nodeType==3){Y=ad.nodeValue.length}else{Y=0}}var W=M.getParent(ad,M.isBlock);var X=W?W.nodeName.toUpperCase():"";var U=W?M.getParent(W.parentNode,M.isBlock):null;var aj=U?U.nodeName.toUpperCase():"";var ag=ae&&ae.ctrlKey;if(aj=="LI"&&!ag){W=U;X=aj}function ab(){var an=new w(ad,W),am;var al=B.schema.getNonEmptyElements();while((am=an.next())){if(al[am.nodeName.toLowerCase()]||am.length>0){return true}}}if(ad&&ad.nodeType==3&&Y>=ad.nodeValue.length){if(!o&&!ab()){T=M.create("br");Z.insertNode(T);Z.setStartAfter(T);Z.setEndAfter(T);ac=true}}T=M.create("br");Z.insertNode(T);var ak=M.doc.documentMode;if(o&&X=="PRE"&&(!ak||ak<8)){T.parentNode.insertBefore(M.doc.createTextNode("\r"),T)}aa=M.create("span",{},"&nbsp;");T.parentNode.insertBefore(aa,T);S.scrollIntoView(aa);M.remove(aa);if(!ac){Z.setStartAfter(T);Z.setEndAfter(T)}else{Z.setStartBefore(T);Z.setEndBefore(T)}S.setRng(Z);B.undoManager.add();return n}});I({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(W){var U="align"+W.substring(7);var T=S.isCollapsed()?[M.getParent(S.getNode(),M.isBlock)]:S.getSelectedBlocks();var V=j(T,function(X){return !!L.matchNode(X,U)});return x(V,n)!==-1},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(T){return P(T)},mceBlockQuote:function(){return P("blockquote")},Outdent:function(){var T;if(O.inline_styles){if((T=M.getParent(S.getStart(),M.isBlock))&&parseInt(T.style.paddingLeft,10)>0){return n}if((T=M.getParent(S.getEnd(),M.isBlock))&&parseInt(T.style.paddingLeft,10)>0){return n}}return(D("InsertUnorderedList")||D("InsertOrderedList")||(!O.inline_styles&&!!M.getParent(S.getNode(),"BLOCKQUOTE")))},"InsertUnorderedList,InsertOrderedList":function(U){var T=M.getParent(S.getNode(),"ul,ol");return T&&(U==="insertunorderedlist"&&T.tagName==="UL"||U==="insertorderedlist"&&T.tagName==="OL")}},"state");I({"FontSize,FontName":function(V){var U=0,T;if((T=M.getParent(S.getNode(),"span"))){if(V=="fontsize"){U=T.style.fontSize}else{U=T.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return U}},"value");I({Undo:function(){B.undoManager.undo()},Redo:function(){B.undoManager.redo()}})}});h("tinymce/util/URI",["tinymce/util/Tools"],function(k){var n=k.each,i=k.trim;var l="source protocol authority userInfo user password host port relative path directory file query anchor".split(" ");var m={ftp:21,http:80,https:443,mailto:25};function j(q,r){var p=this,t,s;q=i(q);r=p.settings=r||{};t=r.base_uri;if(/^([\w\-]+):([^\/]{2})/i.test(q)||/^\s*#/.test(q)){p.source=q;return}var o=q.indexOf("//")===0;if(q.indexOf("/")===0&&!o){q=(t?t.protocol||"http":"http")+"://mce_host"+q}if(!/^[\w\-]*:?\/\//.test(q)){s=r.base_uri?r.base_uri.path:new j(location.href).directory;if(r.base_uri.protocol===""){q="//mce_host"+p.toAbsPath(s,q)}else{q=/([^#?]*)([#?]?.*)/.exec(q);q=((t&&t.protocol)||"http")+"://mce_host"+p.toAbsPath(s,q[1])+q[2]}}q=q.replace(/@@/g,"(mce_at)");q=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(q);n(l,function(u,x){var w=q[x];if(w){w=w.replace(/\(mce_at\)/g,"@@")}p[u]=w});if(t){if(!p.protocol){p.protocol=t.protocol}if(!p.userInfo){p.userInfo=t.userInfo}if(!p.port&&p.host==="mce_host"){p.port=t.port}if(!p.host||p.host==="mce_host"){p.host=t.host}p.source=""}if(o){p.protocol=""}}j.prototype={setPath:function(p){var o=this;p=/^(.*?)\/?(\w+)?$/.exec(p);o.path=p[0];o.directory=p[1];o.file=p[2];o.source="";o.getURI()},toRelative:function(s){var p=this,o;if(s==="./"){return s}s=new j(s,{base_uri:p});if((s.host!="mce_host"&&p.host!=s.host&&s.host)||p.port!=s.port||(p.protocol!=s.protocol&&s.protocol!=="")){return s.getURI()}var q=p.getURI(),r=s.getURI();if(q==r||(q.charAt(q.length-1)=="/"&&q.substr(0,q.length-1)==r)){return q}o=p.toRelPath(p.path,s.path);if(s.query){o+="?"+s.query}if(s.anchor){o+="#"+s.anchor}return o},toAbsolute:function(p,o){p=new j(p,{base_uri:this});return p.getURI(o&&this.isSameOrigin(p))},isSameOrigin:function(o){if(this.host==o.host&&this.protocol==o.protocol){if(this.port==o.port){return true}var p=m[this.protocol];if(p&&((this.port||p)==(o.port||p))){return true}}return false},toRelPath:function(t,u){var p,s=0,q="",r,o;t=t.substring(0,t.lastIndexOf("/"));t=t.split("/");p=u.split("/");if(t.length>=p.length){for(r=0,o=t.length;r<o;r++){if(r>=p.length||t[r]!=p[r]){s=r+1;break}}}if(t.length<p.length){for(r=0,o=p.length;r<o;r++){if(r>=t.length||t[r]!=p[r]){s=r+1;break}}}if(s===1){return u}for(r=0,o=t.length-(s-1);r<o;r++){q+="../"}for(r=s-1,o=p.length;r<o;r++){if(r!=s-1){q+="/"+p[r]}else{q+=p[r]}}return q},toAbsPath:function(s,t){var q,p=0,v=[],r,u;r=/\/$/.test(t)?"/":"";s=s.split("/");t=t.split("/");n(s,function(o){if(o){v.push(o)}});s=v;for(q=t.length-1,v=[];q>=0;q--){if(t[q].length===0||t[q]==="."){continue}if(t[q]===".."){p++;continue}if(p>0){p--;continue}v.push(t[q])}q=s.length-p;if(q<=0){u=v.reverse().join("/")}else{u=s.slice(0,q).join("/")+"/"+v.reverse().join("/")}if(u.indexOf("/")!==0){u="/"+u}if(r&&u.lastIndexOf("/")!==u.length-1){u+=r}return u},getURI:function(q){var p,o=this;if(!o.source||q){p="";if(!q){if(o.protocol){p+=o.protocol+"://"}else{p+="//"}if(o.userInfo){p+=o.userInfo+"@"}if(o.host){p+=o.host}if(o.port){p+=":"+o.port}}if(o.path){p+=o.path}if(o.query){p+="?"+o.query}if(o.anchor){p+="#"+o.anchor}o.source=p}return o.source}};return j});h("tinymce/util/Class",["tinymce/util/Tools"],function(l){var m=l.each,n=l.extend;var k,j;function i(){}i.extend=k=function(o){var w=this,v=w.prototype,u,p,t;function q(){var A,x,z,y=this;if(!j){if(y.init){y.init.apply(y,arguments)}x=y.Mixins;if(x){A=x.length;while(A--){z=x[A];if(z.init){z.init.apply(y,arguments)}}}}}function r(){return this}function s(x,y){return function(){var z=this,B=z._super,A;z._super=v[x];A=y.apply(z,arguments);z._super=B;return A}}j=true;u=new w();j=false;if(o.Mixins){m(o.Mixins,function(x){x=x;for(var y in x){if(y!=="init"){o[y]=x[y]}}});if(v.Mixins){o.Mixins=v.Mixins.concat(o.Mixins)}}if(o.Methods){m(o.Methods.split(","),function(x){o[x]=r})}if(o.Properties){m(o.Properties.split(","),function(x){var y="_"+x;o[x]=function(B){var z=this,A;if(B!==A){z[y]=B;return z}return z[y]}})}if(o.Statics){m(o.Statics,function(y,x){q[x]=y})}if(o.Defaults&&v.Defaults){o.Defaults=n({},v.Defaults,o.Defaults)}for(p in o){t=o[p];if(typeof t=="function"&&v[p]){u[p]=s(p,t)}else{u[p]=t}}q.prototype=u;q.constructor=q;q.extend=k;return q};return i});h("tinymce/util/EventDispatcher",["tinymce/util/Tools"],function(j){var k=j.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchend"," ");function i(q){var w=this,v,m={},t;function o(){return false}function r(){return true}q=q||{};v=q.scope||w;t=q.toggleEvent||o;function n(A,z){var y,B,x,C;A=A.toLowerCase();z=z||{};z.type=A;if(!z.target){z.target=v}if(!z.preventDefault){z.preventDefault=function(){z.isDefaultPrevented=r};z.stopPropagation=function(){z.isPropagationStopped=r};z.stopImmediatePropagation=function(){z.isImmediatePropagationStopped=r};z.isDefaultPrevented=o;z.isPropagationStopped=o;z.isImmediatePropagationStopped=o}if(q.beforeFire){q.beforeFire(z)}y=m[A];if(y){for(B=0,x=y.length;B<x;B++){C=y[B];if(C.once){p(A,C.func)}if(z.isImmediatePropagationStopped()){z.stopPropagation();return z}if(C.func.call(v,z)===false){z.preventDefault();return z}}}return z}function s(A,D,z,x){var y,C,B;if(D===false){D=o}if(D){D={func:D};if(x){j.extend(D,x)}C=A.toLowerCase().split(" ");B=C.length;while(B--){A=C[B];y=m[A];if(!y){y=m[A]=[];t(A,true)}if(z){y.unshift(D)}else{y.push(D)}}}return w}function p(z,D){var A,x,B,C,y;if(z){C=z.toLowerCase().split(" ");A=C.length;while(A--){z=C[A];x=m[z];if(!z){for(B in m){t(B,false);delete m[B]}return w}if(x){if(!D){x.length=0}else{y=x.length;while(y--){if(x[y].func===D){x=x.slice(0,y).concat(x.slice(y+1));m[z]=x}}}if(!x.length){t(z,false);delete m[z]}}}}else{for(z in m){t(z,false)}m={}}return w}function l(y,z,x){return s(y,z,x,{once:true})}function u(x){x=x.toLowerCase();return !(!m[x]||m[x].length===0)}w.fire=n;w.on=s;w.off=p;w.once=l;w.has=u}i.isNative=function(l){return !!k[l.toLowerCase()]};return i});h("tinymce/ui/Selector",["tinymce/util/Class"],function(k){function o(s){var p=[],q=s.length,r;while(q--){r=s[q];if(!r.__checked){p.push(r);r.__checked=1}}q=p.length;while(q--){delete p[q].__checked}return p}var n=/^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i;var i=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,m=/^\s*|\s*$/g,l;var j=k.extend({init:function(q){var s=this.match;function r(y){if(y){y=y.toLowerCase();return function(z){return y==="*"||z.type===y}}}function w(y){if(y){return function(z){return z._name===y}}}function t(y){if(y){y=y.split(".");return function(A){var z=y.length;while(z--){if(!A.hasClass(y[z])){return false}}return true}}}function p(z,A,y){if(z){return function(B){var C=B[z]?B[z]():"";return !A?!!y:A==="="?C===y:A==="*="?C.indexOf(y)>=0:A==="~="?(" "+C+" ").indexOf(" "+y+" ")>=0:A==="!="?C!=y:A==="^="?C.indexOf(y)===0:A==="$="?C.substr(C.length-y.length)===y:false}}}function v(y){var z;if(y){y=/(?:not\((.+)\))|(.+)/i.exec(y);if(!y[1]){y=y[2];return function(C,A,B){return y==="first"?A===0:y==="last"?A===B-1:y==="even"?A%2===0:y==="odd"?A%2===1:C[y]?C[y]():false}}else{z=u(y[1],[]);return function(A){return !s(A,z)}}}}function x(y,z,C){var B;function A(D){if(D){z.push(D)}}B=n.exec(y.replace(m,""));A(r(B[1]));A(w(B[2]));A(t(B[3]));A(p(B[4],B[5],B[6]));A(v(B[7]));z.psuedo=!!B[7];z.direct=C;return z}function u(z,B){var D=[],y,C,A;do{i.exec("");C=i.exec(z);if(C){z=C[3];D.push(C[1]);if(C[2]){y=C[3];break}}}while(C);if(y){u(y,B)}z=[];for(A=0;A<D.length;A++){if(D[A]!=">"){z.push(x(D[A],[],D[A-1]===">"))}}B.push(z);return B}this._selectors=u(q,[])},match:function(u,B){var v,r,w,s,t,D,A,q,y,p,z,x,C;B=B||this._selectors;for(v=0,r=B.length;v<r;v++){t=B[v];s=t.length;C=u;x=0;for(w=s-1;w>=0;w--){q=t[w];while(C){if(q.psuedo){z=C.parent().items();y=p=z.length;while(y--){if(z[y]===C){break}}}for(D=0,A=q.length;D<A;D++){if(!q[D](C,y,p)){D=A+1;break}}if(D===A){x++;break}else{if(w===s-1){break}}C=C.parent()}}if(x===s){return true}}return false},find:function(q){var u=[],s,p,r=this._selectors;function t(A,x,z){var y,w,C,B,D,v=x[z];for(y=0,w=A.length;y<w;y++){D=A[y];for(C=0,B=v.length;C<B;C++){if(!v[C](D,y,w)){C=B+1;break}}if(C===B){if(z==x.length-1){u.push(D)}else{if(D.items){t(D.items(),x,z+1)}}}else{if(v.direct){return}}if(D.items){t(D.items(),x,z)}}}if(q.items){for(s=0,p=r.length;s<p;s++){t(q.items(),r[s],0)}if(p>1){u=o(u)}}if(!l){l=j.Collection}return new l(u)}});return j});h("tinymce/ui/Collection",["tinymce/util/Tools","tinymce/ui/Selector","tinymce/util/Class"],function(l,i,j){var m,n,k=Array.prototype.push,o=Array.prototype.slice;n={length:0,init:function(p){if(p){this.add(p)}},add:function(q){var p=this;if(!l.isArray(q)){if(q instanceof m){p.add(q.toArray())}else{k.call(p,q)}}else{k.apply(p,q)}return p},set:function(r){var q=this,p=q.length,s;q.length=0;q.add(r);for(s=q.length;s<p;s++){delete q[s]}return q},filter:function(p){var r=this,t,q,v=[],u,s;if(typeof p==="string"){p=new i(p);s=function(w){return p.match(w)}}else{s=p}for(t=0,q=r.length;t<q;t++){u=r[t];if(s(u)){v.push(u)}}return new m(v)},slice:function(){return new m(o.apply(this,arguments))},eq:function(p){return p===-1?this.slice(p):this.slice(p,+p+1)},each:function(p){l.each(this,p);return this},toArray:function(){return l.toArray(this)},indexOf:function(r){var p=this,q=p.length;while(q--){if(p[q]===r){break}}return q},reverse:function(){return new m(l.toArray(this).reverse())},hasClass:function(p){return this[0]?this[0].hasClass(p):false},prop:function(q,t){var p=this,r,s;if(t!==r){p.each(function(u){if(u[q]){u[q](t)}});return p}s=p[0];if(s&&s[q]){return s[q]()}},exec:function(r){var p=this,q=l.toArray(arguments).slice(1);p.each(function(s){if(s[r]){s[r].apply(s,q)}});return p},remove:function(){var p=this.length;while(p--){this[p].remove()}return this}};l.each("fire on off show hide addClass removeClass append prepend before after reflow".split(" "),function(p){n[p]=function(){var q=l.toArray(arguments);this.each(function(r){if(p in r){r[p].apply(r,q)}});return this}});l.each("text name disabled active selected checked visible parent value data".split(" "),function(p){n[p]=function(q){return this.prop(p,q)}});m=j.extend(n);i.Collection=m;return m});h("tinymce/ui/DomUtils",["tinymce/util/Tools","tinymce/dom/DOMUtils"],function(i,k){var j=0;return{id:function(){return"mceu_"+(j++)},createFragment:function(l){return k.DOM.createFragment(l)},getWindowSize:function(){return k.DOM.getViewPort()},getSize:function(o){var m,l;if(o.getBoundingClientRect){var n=o.getBoundingClientRect();m=Math.max(n.width||(n.right-n.left),o.offsetWidth);l=Math.max(n.height||(n.bottom-n.bottom),o.offsetHeight)}else{m=o.offsetWidth;l=o.offsetHeight}return{width:m,height:l}},getPos:function(m,l){return k.DOM.getPos(m,l)},getViewPort:function(l){return k.DOM.getViewPort(l)},get:function(l){return document.getElementById(l)},addClass:function(m,l){return k.DOM.addClass(m,l)},removeClass:function(m,l){return k.DOM.removeClass(m,l)},hasClass:function(m,l){return k.DOM.hasClass(m,l)},toggleClass:function(n,l,m){return k.DOM.toggleClass(n,l,m)},css:function(n,l,m){return k.DOM.setStyle(n,l,m)},getRuntimeStyle:function(m,l){return k.DOM.getStyle(m,l,true)},on:function(n,l,o,m){return k.DOM.bind(n,l,o,m)},off:function(m,l,n){return k.DOM.unbind(m,l,n)},fire:function(n,m,l){return k.DOM.fire(n,m,l)},innerHtml:function(m,l){k.DOM.setHTML(m,l)}}});h("tinymce/ui/Control",["tinymce/util/Class","tinymce/util/Tools","tinymce/util/EventDispatcher","tinymce/ui/Collection","tinymce/ui/DomUtils"],function(j,o,m,p,i){var l="onmousewheel" in document;var n=false;var r="mce-";function q(s){if(!s._eventDispatcher){s._eventDispatcher=new m({scope:s,toggleEvent:function(t,u){if(u&&m.isNative(t)){if(!s._nativeEvents){s._nativeEvents={}}s._nativeEvents[t]=true;if(s._rendered){s.bindPendingEvents()}}}})}return s._eventDispatcher}var k=j.extend({Statics:{classPrefix:r},isRtl:function(){return k.rtl},classPrefix:r,init:function(v){var s=this,u,t;s.settings=v=o.extend({},s.Defaults,v);s._id=v.id||i.id();s._text=s._name="";s._width=s._height=0;s._aria={role:v.role};this._elmCache={};u=v.classes;if(u){u=u.split(" ");u.map={};t=u.length;while(t--){u.map[u[t]]=true}}s._classes=u||[];s.visible(true);o.each("title text width height name classes visible disabled active value".split(" "),function(w){var y=v[w],x;if(y!==x){s[w](y)}else{if(s["_"+w]===x){s["_"+w]=false}}});s.on("click",function(){if(s.disabled()){return false}});if(v.classes){o.each(v.classes.split(" "),function(w){s.addClass(w)})}s.settings=v;s._borderBox=s.parseBox(v.border);s._paddingBox=s.parseBox(v.padding);s._marginBox=s.parseBox(v.margin);if(v.hidden){s.hide()}},Properties:"parent,title,text,width,height,disabled,active,name,value",Methods:"renderHtml",getContainerElm:function(){return document.body},getParentCtrl:function(u){var s,t=this.getRoot().controlIdLookup;while(u&&t){s=t[u.id];if(s){break}u=u.parentNode}return s},parseBox:function(u){var s,t=10;if(!u){return}if(typeof u==="number"){u=u||0;return{top:u,left:u,bottom:u,right:u}}u=u.split(" ");s=u.length;if(s===1){u[1]=u[2]=u[3]=u[0]}else{if(s===2){u[2]=u[0];u[3]=u[1]}else{if(s===3){u[3]=u[1]}}}return{top:parseInt(u[0],t)||0,right:parseInt(u[1],t)||0,bottom:parseInt(u[2],t)||0,left:parseInt(u[3],t)||0}},borderBox:function(){return this._borderBox},paddingBox:function(){return this._paddingBox},marginBox:function(){return this._marginBox},measureBox:function(v,t){function s(w){var x=document.defaultView;if(x){w=w.replace(/[A-Z]/g,function(y){return"-"+y});return x.getComputedStyle(v,null).getPropertyValue(w)}return v.currentStyle[w]}function u(w){var x=parseFloat(s(w),10);return isNaN(x)?0:x}return{top:u(t+"TopWidth"),right:u(t+"RightWidth"),bottom:u(t+"BottomWidth"),left:u(t+"LeftWidth")}},initLayoutRect:function(){var I=this,A=I.settings,v,E;var C=I.getEl(),z,G,w,F,y;var s,u,H;v=I._borderBox=I._borderBox||I.measureBox(C,"border");I._paddingBox=I._paddingBox||I.measureBox(C,"padding");I._marginBox=I._marginBox||I.measureBox(C,"margin");H=i.getSize(C);s=A.minWidth;u=A.minHeight;w=s||H.width;F=u||H.height;z=A.width;G=A.height;y=A.autoResize;y=typeof y!="undefined"?y:!z&&!G;z=z||w;G=G||F;var B=v.left+v.right;var t=v.top+v.bottom;var x=A.maxWidth||65535;var D=A.maxHeight||65535;I._layoutRect=E={x:A.x||0,y:A.y||0,w:z,h:G,deltaW:B,deltaH:t,contentW:z-B,contentH:G-t,innerW:z-B,innerH:G-t,startMinWidth:s||0,startMinHeight:u||0,minW:Math.min(w,x),minH:Math.min(F,D),maxW:x,maxH:D,autoResize:y,scrollW:0};I._lastLayoutRect={};return E},layoutRect:function(t){var z=this,v=z._layoutRect,y,A,x,w,s,u;if(!v){v=z.initLayoutRect()}if(t){x=v.deltaW;w=v.deltaH;if(t.x!==s){v.x=t.x}if(t.y!==s){v.y=t.y}if(t.minW!==s){v.minW=t.minW}if(t.minH!==s){v.minH=t.minH}A=t.w;if(A!==s){A=A<v.minW?v.minW:A;A=A>v.maxW?v.maxW:A;v.w=A;v.innerW=A-x}A=t.h;if(A!==s){A=A<v.minH?v.minH:A;A=A>v.maxH?v.maxH:A;v.h=A;v.innerH=A-w}A=t.innerW;if(A!==s){A=A<v.minW-x?v.minW-x:A;A=A>v.maxW-x?v.maxW-x:A;v.innerW=A;v.w=A+x}A=t.innerH;if(A!==s){A=A<v.minH-w?v.minH-w:A;A=A>v.maxH-w?v.maxH-w:A;v.innerH=A;v.h=A+w}if(t.contentW!==s){v.contentW=t.contentW}if(t.contentH!==s){v.contentH=t.contentH}y=z._lastLayoutRect;if(y.x!==v.x||y.y!==v.y||y.w!==v.w||y.h!==v.h){u=k.repaintControls;if(u){if(u.map&&!u.map[z._id]){u.push(z);u.map[z._id]=true}}y.x=v.x;y.y=v.y;y.w=v.w;y.h=v.h}return z}return v},repaint:function(){var A=this,t,v,w,s,y=0,u=0,x,z;z=!document.createRange?Math.round:function(B){return B};t=A.getEl().style;w=A._layoutRect;x=A._lastRepaintRect||{};s=A._borderBox;y=s.left+s.right;u=s.top+s.bottom;if(w.x!==x.x){t.left=z(w.x)+"px";x.x=w.x}if(w.y!==x.y){t.top=z(w.y)+"px";x.y=w.y}if(w.w!==x.w){t.width=z(w.w-y)+"px";x.w=w.w}if(w.h!==x.h){t.height=z(w.h-u)+"px";x.h=w.h}if(A._hasBody&&w.innerW!==x.innerW){v=A.getEl("body").style;v.width=z(w.innerW)+"px";x.innerW=w.innerW}if(A._hasBody&&w.innerH!==x.innerH){v=v||A.getEl("body").style;v.height=z(w.innerH)+"px";x.innerH=w.innerH}A._lastRepaintRect=x;A.fire("repaint",{},false)},on:function(u,v){var t=this;function s(w){var y,x;if(typeof w!="string"){return w}return function(z){if(!y){t.parentsAndSelf().each(function(B){var A=B.settings.callbacks;if(A&&(y=A[w])){x=B;return false}})}return y.call(x,z)}}q(t).on(u,s(v));return t},off:function(s,t){q(this).off(s,t);return this},fire:function(v,u,s){var t=this;u=u||{};if(!u.control){u.control=t}u=q(t).fire(v,u);if(s!==false&&t.parent){var w=t.parent();while(w&&!u.isPropagationStopped()){w.fire(v,u,false);w=w.parent()}}return u},hasEventListeners:function(s){return q(this).has(s)},parents:function(s){var t=this,v,u=new p();for(v=t.parent();v;v=v.parent()){u.add(v)}if(s){u=u.filter(s)}return u},parentsAndSelf:function(s){return new p(this).add(this.parents(s))},next:function(){var s=this.parent().items();return s[s.indexOf(this)+1]},prev:function(){var s=this.parent().items();return s[s.indexOf(this)-1]},findCommonAncestor:function(s,u){var t;while(s){t=u;while(t&&s!=t){t=t.parent()}if(s==t){break}s=s.parent()}return s},hasClass:function(s,u){var t=this._classes[u||"control"];s=this.classPrefix+s;return t&&!!t.map[s]},addClass:function(s,v){var t=this,u,w;s=this.classPrefix+s;u=t._classes[v||"control"];if(!u){u=[];u.map={};t._classes[v||"control"]=u}if(!u.map[s]){u.map[s]=s;u.push(s);if(t._rendered){w=t.getEl(v);if(w){w.className=u.join(" ")}}}return t},removeClass:function(s,w){var t=this,v,u,x;s=this.classPrefix+s;v=t._classes[w||"control"];if(v&&v.map[s]){delete v.map[s];u=v.length;while(u--){if(v[u]===s){v.splice(u,1)}}}if(t._rendered){x=t.getEl(w);if(x){x.className=v.join(" ")}}return t},toggleClass:function(s,u,v){var t=this;if(u){t.addClass(s,v)}else{t.removeClass(s,v)}return t},classes:function(t){var s=this._classes[t||"control"];return s?s.join(" "):""},innerHtml:function(s){i.innerHtml(this.getEl(),s);return this},getEl:function(s){var t=s?this._id+"-"+s:this._id;if(!this._elmCache[t]){this._elmCache[t]=i.get(t)}return this._elmCache[t]},visible:function(u){var t=this,s;if(typeof u!=="undefined"){if(t._visible!==u){if(t._rendered){t.getEl().style.display=u?"":"none"}t._visible=u;s=t.parent();if(s){s._lastRect=null}t.fire(u?"show":"hide")}return t}return t._visible},show:function(){return this.visible(true)},hide:function(){return this.visible(false)},focus:function(){try{this.getEl().focus()}catch(s){}return this},blur:function(){this.getEl().blur();return this},aria:function(t,u){var s=this,v=s.getEl(s.ariaTarget);if(typeof u==="undefined"){return s._aria[t]}else{s._aria[t]=u}if(s._rendered){v.setAttribute(t=="role"?t:"aria-"+t,u)}return s},encode:function(t,s){if(s!==false){t=this.translate(t)}return(t||"").replace(/[&<>"]/g,function(u){return"&#"+u.charCodeAt(0)+";"})},translate:function(s){return k.translate?k.translate(s):s},before:function(t){var s=this,u=s.parent();if(u){u.insert(t,u.items().indexOf(s),true)}return s},after:function(t){var s=this,u=s.parent();if(u){u.insert(t,u.items().indexOf(s))}return s},remove:function(){var t=this,y=t.getEl(),w=t.parent(),u,v;if(t.items){var s=t.items().toArray();v=s.length;while(v--){s[v].remove()}}if(w&&w.items){u=[];w.items().each(function(z){if(z!==t){u.push(z)}});w.items().set(u);w._lastRect=null}if(t._eventsRoot&&t._eventsRoot==t){i.off(y)}var x=t.getRoot().controlIdLookup;if(x){delete x[t._id]}if(y&&y.parentNode){y.parentNode.removeChild(y)}t._rendered=false;return t},renderBefore:function(t){var s=this;t.parentNode.insertBefore(i.createFragment(s.renderHtml()),t);s.postRender();return s},renderTo:function(t){var s=this;t=t||s.getContainerElm();t.appendChild(i.createFragment(s.renderHtml()));s.postRender();return s},postRender:function(){var A=this,t=A.settings,v,u,y,s,x;for(s in t){if(s.indexOf("on")===0){A.on(s.substr(2),t[s])}}if(A._eventsRoot){for(y=A.parent();!x&&y;y=y.parent()){x=y._eventsRoot}if(x){for(s in x._nativeEvents){A._nativeEvents[s]=true}}}A.bindPendingEvents();if(t.style){v=A.getEl();if(v){v.setAttribute("style",t.style);v.style.cssText=t.style}}if(!A._visible){i.css(A.getEl(),"display","none")}if(A.settings.border){u=A.borderBox();i.css(A.getEl(),{"border-top-width":u.top,"border-right-width":u.right,"border-bottom-width":u.bottom,"border-left-width":u.left})}var w=A.getRoot();if(!w.controlIdLookup){w.controlIdLookup={}}w.controlIdLookup[A._id]=A;for(var z in A._aria){A.aria(z,A._aria[z])}A.fire("postrender",{},false)},scrollIntoView:function(u){function E(J,H){var F,I,G=J;F=I=0;while(G&&G!=H&&G.nodeType){F+=G.offsetLeft||0;I+=G.offsetTop||0;G=G.offsetParent}return{x:F,y:I}}var w=this.getEl(),v=w.parentNode;var B,A,s,D,C,t;var z=E(w,v);B=z.x;A=z.y;s=w.offsetWidth;D=w.offsetHeight;C=v.clientWidth;t=v.clientHeight;if(u=="end"){B-=C-s;A-=t-D}else{if(u=="center"){B-=(C/2)-(s/2);A-=(t/2)-(D/2)}}v.scrollLeft=B;v.scrollTop=A;return this},bindPendingEvents:function(){var D=this,x,v,B,u,z,t;function A(F){var E=D.getParentCtrl(F.target);if(E){E.fire(F.type,F)}}function w(){var E=u._lastHoverCtrl;if(E){E.fire("mouseleave",{target:E.getEl()});E.parents().each(function(F){F.fire("mouseleave",{target:F.getEl()})});u._lastHoverCtrl=null}}function C(J){var I=D.getParentCtrl(J.target),H=u._lastHoverCtrl,E=0,G,F,K;if(I!==H){u._lastHoverCtrl=I;F=I.parents().toArray().reverse();F.push(I);if(H){K=H.parents().toArray().reverse();K.push(H);for(E=0;E<K.length;E++){if(F[E]!==K[E]){break}}for(G=K.length-1;G>=E;G--){H=K[G];H.fire("mouseleave",{target:H.getEl()})}}for(G=E;G<F.length;G++){I=F[G];I.fire("mouseenter",{target:I.getEl()})}}}function s(E){E.preventDefault();if(E.type=="mousewheel"){E.deltaY=-1/40*E.wheelDelta;if(E.wheelDeltaX){E.deltaX=-1/40*E.wheelDeltaX}}else{E.deltaX=0;E.deltaY=E.detail}E=D.fire("wheel",E)}D._rendered=true;z=D._nativeEvents;if(z){B=D.parents().toArray();B.unshift(D);for(x=0,v=B.length;!u&&x<v;x++){u=B[x]._eventsRoot}if(!u){u=B[B.length-1]||D}D._eventsRoot=u;for(v=x,x=0;x<v;x++){B[x]._eventsRoot=u}var y=u._delegates;if(!y){y=u._delegates={}}for(t in z){if(!z){return false}if(t==="wheel"&&!n){if(l){i.on(D.getEl(),"mousewheel",s)}else{i.on(D.getEl(),"DOMMouseScroll",s)}continue}if(t==="mouseenter"||t==="mouseleave"){if(!u._hasMouseEnter){i.on(u.getEl(),"mouseleave",w);i.on(u.getEl(),"mouseover",C);u._hasMouseEnter=1}}else{if(!y[t]){i.on(u.getEl(),t,A);y[t]=true}}z[t]=false}}},getRoot:function(){var v=this,u,s=[];while(v){if(v.rootControl){u=v.rootControl;break}s.push(v);u=v;v=v.parent()}if(!u){u=this}var t=s.length;while(t--){s[t].rootControl=u}return u},reflow:function(){this.repaint();return this}});return k});h("tinymce/ui/Factory",[],function(){var i={},j;return{add:function(k,l){i[k.toLowerCase()]=l},has:function(k){return !!i[k.toLowerCase()]},create:function(o,n){var k,l,m;if(!j){m=tinymce.ui;for(l in m){i[l.toLowerCase()]=m[l]}j=true}if(typeof o=="string"){n=n||{};n.type=o}else{n=o;o=n.type}o=o.toLowerCase();k=i[o];if(!k){throw new Error("Could not find control by type: "+o)}k=new k(n);k.type=o;return k}}});h("tinymce/ui/KeyboardNavigation",[],function(){return function(A){var w=A.root,i,p;try{i=document.activeElement}catch(z){i=document.body}p=w.getParentCtrl(i);function t(E){E=E||i;return E&&E.getAttribute("role")}function D(G){var F,E=G||i;while((E=E.parentNode)){if((F=t(E))){return F}}}function v(E){var F=i;if(F){return F.getAttribute("aria-"+E)}}function u(F){var E=F.tagName.toUpperCase();return E=="INPUT"||E=="TEXTAREA"}function j(E){if(u(E)&&!E.hidden){return true}if(/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell)$/.test(t(E))){return true}return false}function o(G){var F=[];function E(I){if(I.nodeType!=1||I.style.display=="none"){return}if(j(I)){F.push(I)}for(var H=0;H<I.childNodes.length;H++){E(I.childNodes[H])}}E(G||w.getEl());return F}function n(H){var F,E;H=H||p;E=H.parents().toArray();E.unshift(H);for(var G=0;G<E.length;G++){F=E[G];if(F.settings.ariaRoot){break}}return F}function x(G){var E=n(G);var F=o(E.getEl());if(E.settings.ariaRemember&&"lastAriaIndex" in E){r(E.lastAriaIndex,F)}else{r(0,F)}}function r(E,F){if(E<0){E=F.length-1}else{if(E>=F.length){E=0}}if(F[E]){F[E].focus()}return E}function C(G,I){var E=-1,F=n();I=I||o(F.getEl());for(var H=0;H<I.length;H++){if(I[H]===i){E=H}}E+=G;F.lastAriaIndex=r(E,I)}function m(){var E=D();if(E=="tablist"){C(-1,o(i.parentNode))}else{if(p.parent().submenu){l()}else{C(-1)}}}function B(){var F=t(),E=D();if(E=="tablist"){C(1,o(i.parentNode))}else{if(F=="menuitem"&&E=="menu"&&v("haspopup")){y()}else{C(1)}}}function q(){C(-1)}function s(){var F=t(),E=D();if(F=="menuitem"&&E=="menubar"){y()}else{if(F=="button"&&v("haspopup")){y({key:"down"})}else{C(1)}}}function k(F){var E=D();if(E=="tablist"){var G=o(p.getEl("body"))[0];if(G){G.focus()}}else{C(F.shiftKey?-1:1)}}function l(){p.fire("cancel")}function y(E){E=E||{};p.fire("click",{target:i,aria:E})}w.on("keydown",function(F){function E(H,G){if(u(i)){return}if(G(H)!==false){H.preventDefault()}}if(F.isDefaultPrevented()){return}switch(F.keyCode){case 37:E(F,m);break;case 39:E(F,B);break;case 38:E(F,q);break;case 40:E(F,s);break;case 27:l();break;case 14:case 13:case 32:E(F,y);break;case 9:if(k(F)!==false){F.preventDefault()}break}});w.on("focusin",function(E){i=E.target;p=E.control});return{focusFirst:x}}});h("tinymce/ui/Container",["tinymce/ui/Control","tinymce/ui/Collection","tinymce/ui/Selector","tinymce/ui/Factory","tinymce/ui/KeyboardNavigation","tinymce/util/Tools","tinymce/ui/DomUtils"],function(p,o,k,i,n,m,j){var l={};return p.extend({layout:"",innerClass:"container-inner",init:function(r){var q=this;q._super(r);r=q.settings;q._fixed=r.fixed;q._items=new o();if(q.isRtl()){q.addClass("rtl")}q.addClass("container");q.addClass("container-body","body");if(r.containerCls){q.addClass(r.containerCls)}q._layout=i.create((r.layout||q.layout)+"layout");if(q.settings.items){q.add(q.settings.items)}q._hasBody=true},items:function(){return this._items},find:function(q){q=l[q]=l[q]||new k(q);return q.find(this)},add:function(r){var q=this;q.items().add(q.create(r)).parent(q);return q},focus:function(q){var s=this,u,t,r;if(q){t=s.keyboardNav||s.parents().eq(-1)[0].keyboardNav;if(t){t.focusFirst(s);return}}r=s.find("*");if(s.statusbar){r.add(s.statusbar.items())}r.each(function(v){if(v.settings.autofocus){u=null;return false}if(v.canFocus){u=u||v}});if(u){u.focus()}return s},replace:function(u,t){var s,q=this.items(),r=q.length;while(r--){if(q[r]===u){q[r]=t;break}}if(r>=0){s=t.getEl();if(s){s.parentNode.removeChild(s)}s=u.getEl();if(s){s.parentNode.removeChild(s)}}t.parent(this)},create:function(r){var q=this,t,s=[];if(!m.isArray(r)){r=[r]}m.each(r,function(u){if(u){if(!(u instanceof p)){if(typeof u=="string"){u={type:u}}t=m.extend({},q.settings.defaults,u);u.type=t.type=t.type||u.type||q.settings.defaultType||(t.defaults?t.defaults.type:null);u=i.create(t)}s.push(u)}});return s},renderNew:function(){var q=this;q.items().each(function(t,s){var u,r;t.parent(q);if(!t._rendered){u=q.getEl("body");r=j.createFragment(t.renderHtml());if(u.hasChildNodes()&&s<=u.childNodes.length-1){u.insertBefore(r,u.childNodes[s])}else{u.appendChild(r)}t.postRender()}});q._layout.applyClasses(q);q._lastRect=null;return q},append:function(q){return this.add(q).renderNew()},prepend:function(r){var q=this;q.items().set(q.create(r).concat(q.items().toArray()));return q.renderNew()},insert:function(s,u,w){var r=this,t,q,v;s=r.create(s);t=r.items();if(!w&&u<t.length-1){u+=1}if(u>=0&&u<t.length){q=t.slice(0,u).toArray();v=t.slice(u).toArray();t.set(q.concat(s,v))}return r.renderNew()},fromJSON:function(s){var q=this;for(var r in s){q.find("#"+r).value(s[r])}return q},toJSON:function(){var q=this,r={};q.find("*").each(function(u){var s=u.name(),t=u.value();if(s&&typeof t!="undefined"){r[s]=t}});return r},preRender:function(){},renderHtml:function(){var q=this,r=q._layout,s=this.settings.role;q.preRender();r.preRender(q);return('<div id="'+q._id+'" class="'+q.classes()+'"'+(s?' role="'+this.settings.role+'"':"")+'><div id="'+q._id+'-body" class="'+q.classes("body")+'">'+(q.settings.html||"")+r.renderHtml(q)+"</div></div>")},postRender:function(){var q=this,r;q.items().exec("postRender");q._super();q._layout.postRender(q);q._rendered=true;if(q.settings.style){j.css(q.getEl(),q.settings.style)}if(q.settings.border){r=q.borderBox();j.css(q.getEl(),{"border-top-width":r.top,"border-right-width":r.right,"border-bottom-width":r.bottom,"border-left-width":r.left})}if(!q.parent()){q.keyboardNav=new n({root:q})}return q},initLayoutRect:function(){var q=this,r=q._super();q._layout.recalc(q);return r},recalc:function(){var q=this,s=q._layoutRect,r=q._lastRect;if(!r||r.w!=s.w||r.h!=s.h){q._layout.recalc(q);s=q.layoutRect();q._lastRect={x:s.x,y:s.y,w:s.w,h:s.h};return true}},reflow:function(){var q;if(this.visible()){p.repaintControls=[];p.repaintControls.map={};this.recalc();q=p.repaintControls.length;while(q--){p.repaintControls[q].repaint()}if(this.settings.layout!=="flow"&&this.settings.layout!=="stack"){this.repaint()}p.repaintControls=[]}return this}})});h("tinymce/ui/DragHelper",["tinymce/ui/DomUtils"],function(i){function j(){var r=document,s,n,l,q;var o,t,m,k,p=Math.max;s=r.documentElement;n=r.body;l=p(s.scrollWidth,n.scrollWidth);q=p(s.clientWidth,n.clientWidth);o=p(s.offsetWidth,n.offsetWidth);t=p(s.scrollHeight,n.scrollHeight);m=p(s.clientHeight,n.clientHeight);k=p(s.offsetHeight,n.offsetHeight);return{width:l<o?q:l,height:t<k?m:t}}return function(l,n){var u,t=document,k,m,s,q,p,o;n=n||{};function r(){return t.getElementById(n.handle||l)}m=function(w){var y=j(),v,x;w.preventDefault();k=w.button;v=r();p=w.screenX;o=w.screenY;if(window.getComputedStyle){x=window.getComputedStyle(v,null).getPropertyValue("cursor")}else{x=v.runtimeStyle.cursor}u=t.createElement("div");i.css(u,{position:"absolute",top:0,left:0,width:y.width,height:y.height,zIndex:2147483647,opacity:0.0001,cursor:x});t.body.appendChild(u);i.on(t,"mousemove",q);i.on(t,"mouseup",s);n.start(w)};q=function(v){if(v.button!==k){return s(v)}v.deltaX=v.screenX-p;v.deltaY=v.screenY-o;v.preventDefault();n.drag(v)};s=function(v){i.off(t,"mousemove",q);i.off(t,"mouseup",s);u.parentNode.removeChild(u);if(n.stop){n.stop(v)}};this.destroy=function(){i.off(r())};i.on(r(),"mousedown",m)}});h("tinymce/ui/Scrollable",["tinymce/ui/DomUtils","tinymce/ui/DragHelper"],function(i,j){return{init:function(){var k=this;k.on("repaint",k.renderScroll)},renderScroll:function(){var l=this,m=2;function n(){var r,q,p;function o(w,v,y,E,D,u){var x,B,A;var t,s,z,C;var F,G;B=l.getEl("scroll"+w);if(B){F=v.toLowerCase();G=y.toLowerCase();if(l.getEl("absend")){i.css(l.getEl("absend"),F,l.layoutRect()[E]-1)}if(!D){i.css(B,"display","none");return}i.css(B,"display","block");x=l.getEl("body");A=l.getEl("scroll"+w+"t");t=x["client"+y]-(m*2);t-=r&&q?B["client"+u]:0;s=x["scroll"+y];z=t/s;C={};C[F]=x["offset"+v]+m;C[G]=t;i.css(B,C);C={};C[F]=x["scroll"+v]*z;C[G]=t*z;i.css(A,C)}}p=l.getEl("body");r=p.scrollWidth>p.clientWidth;q=p.scrollHeight>p.clientHeight;o("h","Left","Width","contentW",r,"Height");o("v","Top","Height","contentH",q,"Width")}function k(){function o(v,r,p,w,t){var u,q=l._id+"-scroll"+v,s=l.classPrefix;l.getEl().appendChild(i.createFragment('<div id="'+q+'" class="'+s+"scrollbar "+s+"scrollbar-"+v+'"><div id="'+q+'t" class="'+s+'scrollbar-thumb"></div></div>'));l.draghelper=new j(q+"t",{start:function(){u=l.getEl("body")["scroll"+r];i.addClass(i.get(q),s+"active")},drag:function(A){var x,C,z,B,y=l.layoutRect();C=y.contentW>y.innerW;z=y.contentH>y.innerH;B=l.getEl("body")["client"+p]-(m*2);B-=C&&z?l.getEl("scroll"+v)["client"+t]:0;x=B/l.getEl("body")["scroll"+p];l.getEl("body")["scroll"+r]=u+(A["delta"+w]/x)},stop:function(){i.removeClass(i.get(q),s+"active")}})}l.addClass("scroll");o("v","Top","Height","Y","Width");o("h","Left","Width","X","Height")}if(l.settings.autoScroll){if(!l._hasScroll){l._hasScroll=true;k();l.on("wheel",function(p){var o=l.getEl("body");o.scrollLeft+=(p.deltaX||0)*10;o.scrollTop+=p.deltaY*10;n()});i.on(l.getEl("body"),"scroll",n)}n()}}}});h("tinymce/ui/Panel",["tinymce/ui/Container","tinymce/ui/Scrollable"],function(j,i){return j.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[i],renderHtml:function(){var l=this,m=l._layout,k=l.settings.html;l.preRender();m.preRender(l);if(typeof k=="undefined"){k=('<div id="'+l._id+'-body" class="'+l.classes("body")+'">'+m.renderHtml(l)+"</div>")}else{if(typeof k=="function"){k=k.call(l)}l._hasBody=false}return('<div id="'+l._id+'" class="'+l.classes()+'" hidefocus="1" tabindex="-1" role="group">'+(l._preBodyHtml||"")+k+"</div>")}})});h("tinymce/ui/Movable",["tinymce/ui/DomUtils"],function(i){function j(k,s,v){var u,o,r,p,t,m,q,l,n,w;n=i.getViewPort();o=i.getPos(s);r=o.x;p=o.y;if(k._fixed&&i.getRuntimeStyle(document.body,"position")=="static"){r-=n.x;p-=n.y}u=k.getEl();w=i.getSize(u);t=w.width;m=w.height;w=i.getSize(s);q=w.width;l=w.height;v=(v||"").split("");if(v[0]==="b"){p+=l}if(v[1]==="r"){r+=q}if(v[0]==="c"){p+=Math.round(l/2)}if(v[1]==="c"){r+=Math.round(q/2)}if(v[3]==="b"){p-=m}if(v[4]==="r"){r-=t}if(v[3]==="c"){p-=Math.round(m/2)}if(v[4]==="c"){r-=Math.round(t/2)}return{x:r,y:p,w:t,h:m}}return{testMoveRel:function(o,l){var k=i.getViewPort();for(var m=0;m<l.length;m++){var n=j(this,o,l[m]);if(this._fixed){if(n.x>0&&n.x+n.w<k.w&&n.y>0&&n.y+n.h<k.h){return l[m]}}else{if(n.x>k.x&&n.x+n.w<k.w+k.x&&n.y>k.y&&n.y+n.h<k.h+k.y){return l[m]}}}return l[0]},moveRel:function(m,k){if(typeof k!="string"){k=this.testMoveRel(m,k)}var l=j(this,m,k);return this.moveTo(l.x,l.y)},moveBy:function(m,k){var l=this,n=l.layoutRect();l.moveTo(n.x+m,n.y+k);return l},moveTo:function(k,p){var m=this;function l(s,q,r){if(s<0){return 0}if(s+r>q){s=q-r;return s<0?0:s}return s}if(m.settings.constrainToViewport){var n=i.getViewPort(window);var o=m.layoutRect();k=l(k,n.w+n.x,o.w);p=l(p,n.h+n.y,o.h)}if(m._rendered){m.layoutRect({x:k,y:p}).repaint()}else{m.settings.x=k;m.settings.y=p}m.fire("move",{x:k,y:p});return m}}});h("tinymce/ui/Resizable",["tinymce/ui/DomUtils"],function(i){return{resizeToContent:function(){this._layoutRect.autoResize=true;this._lastRect=null;this.reflow()},resizeTo:function(j,k){if(j<=1||k<=1){var l=i.getWindowSize();j=j<=1?j*l.w:j;k=k<=1?k*l.h:k}this._layoutRect.autoResize=false;return this.layoutRect({minW:j,minH:k,w:j,h:k}).reflow()},resizeBy:function(k,m){var j=this,l=j.layoutRect();return j.resizeTo(l.w+k,l.h+m)}}});h("tinymce/ui/FloatPanel",["tinymce/ui/Panel","tinymce/ui/Movable","tinymce/ui/Resizable","tinymce/ui/DomUtils"],function(w,t,k,i){var q,l,j,x=[];var o=[],y;function u(){function z(B,A){while(B){if(B==A){return true}B=B.parent()}}if(!q){q=function(D){if(D.button==2){return}var C=x.length;while(C--){var B=x[C],A=B.getParentCtrl(D.target);if(B.settings.autohide){if(A){if(z(A,B)||B.parent()===A){continue}}D=B.fire("autohide",{target:D.target});if(!D.isDefaultPrevented()){B.hide()}}}};i.on(document,"click",q)}}function n(){if(!l){l=function(){var z;z=x.length;while(z--){p(x[z])}};i.on(window,"scroll",l)}}function m(){if(!j){var A=document.documentElement,B=A.clientWidth,z=A.clientHeight;j=function(){if(!document.all||B!=A.clientWidth||z!=A.clientHeight){B=A.clientWidth;z=A.clientHeight;r.hideAll()}};i.on(window,"resize",j)}}function p(z){var A=i.getViewPort().y;function B(F,C){var E;for(var D=0;D<x.length;D++){if(x[D]!=z){E=x[D].parent();while(E&&(E=E.parent())){if(E==z){x[D].fixed(F).moveBy(0,C).repaint()}}}}}if(z.settings.autofix){if(!z._fixed){z._autoFixY=z.layoutRect().y;if(z._autoFixY<A){z.fixed(true).layoutRect({y:0}).repaint();B(true,A-z._autoFixY)}}else{if(z._autoFixY>A){z.fixed(false).layoutRect({y:z._autoFixY}).repaint();B(false,z._autoFixY-A)}}}}function v(D,B){var z,E=r.zIndex||65535,A;if(D){o.push(B)}else{z=o.length;while(z--){if(o[z]===B){o.splice(z,1)}}}if(o.length){for(z=0;z<o.length;z++){if(o[z].modal){E++;A=o[z]}o[z].getEl().style.zIndex=E;o[z].zIndex=E;E++}}var C=document.getElementById(B.classPrefix+"modal-block");if(A){i.css(C,"z-index",A.zIndex-1)}else{if(C){C.parentNode.removeChild(C);y=false}}r.currentZIndex=E}var r=w.extend({Mixins:[t,k],init:function(A){var z=this;z._super(A);z._eventsRoot=z;z.addClass("floatpanel");if(A.autohide){u();m();x.push(z)}if(A.autofix){n();z.on("move",function(){p(this)})}z.on("postrender show",function(D){if(D.control==z){var C,B=z.classPrefix;if(z.modal&&!y){C=i.createFragment('<div id="'+B+'modal-block" class="'+B+"reset "+B+'fade"></div>');C=C.firstChild;z.getContainerElm().appendChild(C);setTimeout(function(){i.addClass(C,B+"in");i.addClass(z.getEl(),B+"in")},0);y=true}v(true,z)}});z.on("show",function(){z.parents().each(function(B){if(B._fixed){z.fixed(true);return false}})});if(A.popover){z._preBodyHtml='<div class="'+z.classPrefix+'arrow"></div>';z.addClass("popover").addClass("bottom").addClass(z.isRtl()?"end":"start")}},fixed:function(B){var A=this;if(A._fixed!=B){if(A._rendered){var z=i.getViewPort();if(B){A.layoutRect().y-=z.y}else{A.layoutRect().y+=z.y}}A.toggleClass("fixed",B);A._fixed=B}return A},show:function(){var z=this,A,B=z._super();A=x.length;while(A--){if(x[A]===z){break}}if(A===-1){x.push(z)}return B},hide:function(){s(this);v(false,this);return this._super()},hideAll:function(){r.hideAll()},close:function(){var z=this;if(!z.fire("close").isDefaultPrevented()){z.remove();v(false,z)}return z},remove:function(){s(this);this._super()},postRender:function(){var z=this;if(z.settings.bodyRole){this.getEl("body").setAttribute("role",z.settings.bodyRole)}return z._super()}});r.hideAll=function(){var A=x.length;while(A--){var z=x[A];if(z&&z.settings.autohide){z.hide();x.splice(A,1)}}};function s(z){var A;A=x.length;while(A--){if(x[A]===z){x.splice(A,1)}}A=o.length;while(A--){if(o[A]===z){o.splice(A,1)}}}return r});h("tinymce/ui/Window",["tinymce/ui/FloatPanel","tinymce/ui/Panel","tinymce/ui/DomUtils","tinymce/ui/DragHelper"],function(m,l,i,k){var j=m.extend({modal:true,Defaults:{border:1,layout:"flex",containerCls:"panel",role:"dialog",callbacks:{submit:function(){this.fire("submit",{data:this.toJSON()})},close:function(){this.close()}}},init:function(o){var n=this;n._super(o);if(n.isRtl()){n.addClass("rtl")}n.addClass("window");n._fixed=true;if(o.buttons){n.statusbar=new l({layout:"flex",border:"1 0 0 0",spacing:3,padding:10,align:"center",pack:n.isRtl()?"start":"end",defaults:{type:"button"},items:o.buttons});n.statusbar.addClass("foot");n.statusbar.parent(n)}n.on("click",function(p){if(p.target.className.indexOf(n.classPrefix+"close")!=-1){n.close()}});n.on("cancel",function(){n.close()});n.aria("describedby",n.describedBy||n._id+"-none");n.aria("label",o.title);n._fullscreen=false},recalc:function(){var o=this,r=o.statusbar,q,p,n,s;if(o._fullscreen){o.layoutRect(i.getWindowSize());o.layoutRect().contentH=o.layoutRect().innerH}o._super();q=o.layoutRect();if(o.settings.title&&!o._fullscreen){p=q.headerW;if(p>q.w){n=q.x-Math.max(0,p/2);o.layoutRect({w:p,x:n});s=true}}if(r){r.layoutRect({w:o.layoutRect().innerW}).recalc();p=r.layoutRect().minW+q.deltaW;if(p>q.w){n=q.x-Math.max(0,p-q.w);o.layoutRect({w:p,x:n});s=true}}if(s){o.recalc()}},initLayoutRect:function(){var n=this,r=n._super(),q=0,s;if(n.settings.title&&!n._fullscreen){s=n.getEl("head");var o=i.getSize(s);r.headerW=o.width;r.headerH=o.height;q+=r.headerH}if(n.statusbar){q+=n.statusbar.layoutRect().h}r.deltaH+=q;r.minH+=q;r.h+=q;var p=i.getWindowSize();r.x=Math.max(0,p.w/2-r.w/2);r.y=Math.max(0,p.h/2-r.h/2);return r},renderHtml:function(){var o=this,r=o._layout,u=o._id,s=o.classPrefix;var q=o.settings,n="",t="",p=q.html;o.preRender();r.preRender(o);if(q.title){n=('<div id="'+u+'-head" class="'+s+'window-head"><div id="'+u+'-title" class="'+s+'title">'+o.encode(q.title)+'</div><button type="button" class="'+s+'close" aria-hidden="true">\u00d7</button><div id="'+u+'-dragh" class="'+s+'dragh"></div></div>')}if(q.url){p='<iframe src="'+q.url+'" tabindex="-1"></iframe>'}if(typeof p=="undefined"){p=r.renderHtml(o)}if(o.statusbar){t=o.statusbar.renderHtml()}return('<div id="'+u+'" class="'+o.classes()+'" hidefocus="1"><div class="'+o.classPrefix+'reset" role="application">'+n+'<div id="'+u+'-body" class="'+o.classes("body")+'">'+p+"</div>"+t+"</div></div>")},fullscreen:function(t){var n=this,s=document.documentElement,o,r=n.classPrefix,q;if(t!=n._fullscreen){i.on(window,"resize",function(){var v;if(n._fullscreen){if(!o){v=new Date().getTime();var u=i.getWindowSize();n.moveTo(0,0).resizeTo(u.w,u.h);if((new Date().getTime())-v>50){o=true}}else{if(!n._timer){n._timer=setTimeout(function(){var w=i.getWindowSize();n.moveTo(0,0).resizeTo(w.w,w.h);n._timer=0},50)}}}});q=n.layoutRect();n._fullscreen=t;if(!t){n._borderBox=n.parseBox(n.settings.border);n.getEl("head").style.display="";q.deltaH+=q.headerH;i.removeClass(s,r+"fullscreen");i.removeClass(document.body,r+"fullscreen");n.removeClass("fullscreen");n.moveTo(n._initial.x,n._initial.y).resizeTo(n._initial.w,n._initial.h)}else{n._initial={x:q.x,y:q.y,w:q.w,h:q.h};n._borderBox=n.parseBox("0");n.getEl("head").style.display="none";q.deltaH-=q.headerH+2;i.addClass(s,r+"fullscreen");i.addClass(document.body,r+"fullscreen");n.addClass("fullscreen");var p=i.getWindowSize();n.moveTo(0,0).resizeTo(p.w,p.h)}}return n.reflow()},postRender:function(){var n=this,o;setTimeout(function(){n.addClass("in")},0);n._super();if(n.statusbar){n.statusbar.postRender()}n.focus();this.dragHelper=new k(n._id+"-dragh",{start:function(){o={x:n.layoutRect().x,y:n.layoutRect().y}},drag:function(p){n.moveTo(o.x+p.deltaX,o.y+p.deltaY)}});n.on("submit",function(p){if(!p.isDefaultPrevented()){n.close()}})},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var n=this,o=n.classPrefix;n.dragHelper.destroy();n._super();if(n.statusbar){this.statusbar.remove()}if(n._fullscreen){i.removeClass(document.documentElement,o+"fullscreen");i.removeClass(document.body,o+"fullscreen")}},getContentWindow:function(){var n=this.getEl().getElementsByTagName("iframe")[0];return n?n.contentWindow:null}});return j});h("tinymce/ui/MessageBox",["tinymce/ui/Window"],function(j){var i=j.extend({init:function(k){k={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:true,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:true,maxWidth:500,maxHeight:200}};this._super(k)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(l){var m,n=l.callback||function(){};function k(q,o,p){return{type:"button",text:q,subtype:p?"primary":"",onClick:function(r){r.control.parents()[1].close();n(o)}}}switch(l.buttons){case i.OK_CANCEL:m=[k("Ok",true,true),k("Cancel",false)];break;case i.YES_NO:case i.YES_NO_CANCEL:m=[k("Yes",1,true),k("No",0)];if(l.buttons==i.YES_NO_CANCEL){m.push(k("Cancel",-1))}break;default:m=[k("Ok",true,true)];break}return new j({padding:20,x:l.x,y:l.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:m,title:l.title,role:"alertdialog",items:{type:"label",multiline:true,maxWidth:500,maxHeight:200,text:l.text},onPostRender:function(){this.aria("describedby",this.items()[0]._id)},onClose:l.onClose,onCancel:function(){n(false)}}).renderTo(document.body).reflow()},alert:function(k,l){if(typeof k=="string"){k={text:k}}k.callback=l;return i.msgBox(k)},confirm:function(k,l){if(typeof k=="string"){k={text:k}}k.callback=l;k.buttons=i.OK_CANCEL;return i.msgBox(k)}}});return i});h("tinymce/WindowManager",["tinymce/ui/Window","tinymce/ui/MessageBox"],function(j,i){return function(m){var l=this,n=[];function k(){if(n.length){return n[n.length-1]}}l.windows=n;m.on("remove",function(){var o=n.length;while(o--){n[o].close()}});l.open=function(o,q){var p;m.editorManager.setActive(m);o.title=o.title||" ";o.url=o.url||o.file;if(o.url){o.width=parseInt(o.width||320,10);o.height=parseInt(o.height||240,10)}if(o.body){o.items={defaults:o.defaults,type:o.bodyType||"form",items:o.body}}if(!o.url&&!o.buttons){o.buttons=[{text:"Ok",subtype:"primary",onclick:function(){p.find("form")[0].submit()}},{text:"Cancel",onclick:function(){p.close()}}]}p=new j(o);n.push(p);p.on("close",function(){var r=n.length;while(r--){if(n[r]===p){n.splice(r,1)}}if(!n.length){m.focus()}});if(o.data){p.on("postRender",function(){this.find("*").each(function(s){var r=s.name();if(r in o.data){s.value(o.data[r])}})})}p.features=o||{};p.params=q||{};if(n.length===1){m.nodeChanged()}return p.renderTo().reflow()};l.alert=function(p,q,o){i.alert(p,function(){if(q){q.call(o||this)}else{m.focus()}})};l.confirm=function(p,q,o){i.confirm(p,function(r){q.call(o||this,r)})};l.close=function(){if(k()){k().close()}};l.getParams=function(){return k()?k().params:null};l.setParams=function(o){if(k()){k().params=o}};l.getWindows=function(){return n}}});h("tinymce/util/Quirks",["tinymce/util/VK","tinymce/dom/RangeUtils","tinymce/dom/TreeWalker","tinymce/html/Node","tinymce/html/Entities","tinymce/Env","tinymce/util/Tools"],function(n,m,l,k,o,i,j){return function(p){var aj=j.each,W=p.$;var s=n.BACKSPACE,E=n.DELETE,r=p.dom,G=p.selection,an=p.settings,V=p.parser,L=p.serializer;var u=i.gecko,C=i.ie,ag=i.webkit;var ab="data:text/mce-internal,";var t=C?"Text":"URL";function aa(au,at){try{p.getDoc().execCommand(au,false,at)}catch(ar){}}function J(){var ar=p.getDoc().documentMode;return ar?ar:6}function Z(ar){return ar.isDefaultPrevented()}function Q(at){var ar;if(at.dataTransfer){if(p.selection.isCollapsed()&&at.target.tagName=="IMG"){G.select(at.target)}ar=p.selection.getContent();if(ar.length>0){at.dataTransfer.setData(t,ab+escape(ar))}}}function K(at){var au,ar;if(at.dataTransfer){au=at.dataTransfer.getData(t);if(au&&au.indexOf(ab)>=0){ar=unescape(au.substr(ab.length))}}return ar}function R(ar){if(p.queryCommandSupported("mceInsertClipboardContent")){p.execCommand("mceInsertClipboardContent",false,{content:ar})}else{p.execCommand("mceInsertContent",false,ar)}}function ap(){var aD=p.getDoc(),ax=p.dom,aE=p.selection;var at=window.MutationObserver,ay,aC;if(!at){ay=true;at=function(){var aF=[],aI;function aH(aK){var aJ=aK.relatedNode||aK.target;aF.push({target:aJ,addedNodes:[aJ]})}function aG(aK){var aJ=aK.relatedNode||aK.target;aF.push({target:aJ,attributeName:aK.attrName})}this.observe=function(aJ){aI=aJ;aI.addEventListener("DOMSubtreeModified",aH,false);aI.addEventListener("DOMNodeInsertedIntoDocument",aH,false);aI.addEventListener("DOMNodeInserted",aH,false);aI.addEventListener("DOMAttrModified",aG,false)};this.disconnect=function(){aI.removeEventListener("DOMSubtreeModified",aH,false);aI.removeEventListener("DOMNodeInsertedIntoDocument",aH,false);aI.removeEventListener("DOMNodeInserted",aH,false);aI.removeEventListener("DOMAttrModified",aG,false)};this.takeRecords=function(){return aF}}}function ar(aH){var aG=ax.schema.getBlockElements(),aF=p.getBody();if(aH.nodeName!="BR"){return false}for(aH=aH;aH!=aF&&!aG[aH.nodeName];aH=aH.parentNode){if(aH.nextSibling){return false}}return true}function au(aG,aF){var aH;for(aH=aG.nextSibling;aH&&aH!=aF;aH=aH.nextSibling){if(aH.nodeType==3&&W.trim(aH.data).length===0){continue}if(aH!==aF){return false}}return aH===aF}function az(aI,aH,aG){var aK,aJ,aF;aF=ax.schema.getNonEmptyElements();aK=new l(aG||aI,aI);while((aJ=aK[aH?"next":"prev"]())){if(aF[aJ.nodeName]&&!ar(aJ)){return aJ}if(aJ.nodeType==3&&aJ.data.length>0){return aJ}}}function aB(aG){var aJ,aH,aF,aI,aK;if(aG.collapsed){return}aJ=ax.getParent(m.getNode(aG.startContainer,aG.startOffset),ax.isBlock);aH=ax.getParent(m.getNode(aG.endContainer,aG.endOffset),ax.isBlock);aK=p.schema.getTextBlockElements();if(aJ==aH){return}if(!aK[aJ.nodeName]||!aK[aH.nodeName]){return}if(ax.getContentEditable(aJ)==="false"||ax.getContentEditable(aH)==="false"){return}aG.deleteContents();aF=az(aJ,false);aI=az(aH,true);if(!ax.isEmpty(aH)){W(aJ).append(aH.childNodes)}W(aH).remove();if(aF){if(aF.nodeType==1){if(aF.nodeName=="BR"){aG.setStartBefore(aF);aG.setEndBefore(aF)}else{aG.setStartAfter(aF);aG.setEndAfter(aF)}}else{aG.setStart(aF,aF.data.length);aG.setEnd(aF,aF.data.length)}}else{if(aI){if(aI.nodeType==1){aG.setStartBefore(aI);aG.setEndBefore(aI)}else{aG.setStart(aI,0);aG.setEnd(aI,0)}}}aE.setRng(aG);return true}function aw(aG,aL){var aI,aK,aH,aJ,aF,aM;if(!aG.collapsed){return aG}aF=aG.startContainer;aM=aG.startOffset;if(aF.nodeType==3){if(aL){if(aM<aF.data.length){return aG}}else{if(aM>0){return aG}}}aI=m.getNode(aG.startContainer,aG.startOffset);aH=ax.getParent(aI,ax.isBlock);aK=az(p.getBody(),aL,aI);aJ=ax.getParent(aK,ax.isBlock);if(!aI||!aK){return aG}if(aJ&&aH!=aJ){if(!aL){if(!au(aJ,aH)){return aG}if(aK.nodeType==1){if(aK.nodeName=="BR"){aG.setStartBefore(aK)}else{aG.setStartAfter(aK)}}else{aG.setStart(aK,aK.data.length)}if(aI.nodeType==1){aG.setEnd(aI,0)}else{aG.setEndBefore(aI)}}else{if(!au(aH,aJ)){return aG}if(aI.nodeType==1){if(aI.nodeName=="BR"){aG.setStartBefore(aI)}else{aG.setStartAfter(aI)}}else{aG.setStart(aI,aI.data.length)}if(aK.nodeType==1){aG.setEnd(aK,0)}else{aG.setEndBefore(aK)}}}return aG}function av(aG){var aF=aE.getRng();aF=aw(aF,aG);if(aB(aF)){return true}}function aA(aH){var aG,aF,aI;if(av(aH)){return}j.each(p.getBody().getElementsByTagName("*"),function(aJ){if(aJ.tagName=="SPAN"){aJ.setAttribute("mce-data-marked",1)}if(!aJ.hasAttribute("data-mce-style")&&aJ.hasAttribute("style")){p.dom.setAttrib(aJ,"style",p.dom.getAttrib(aJ,"style"))}});aG=new at(function(){});aG.observe(p.getDoc(),{childList:true,attributes:true,subtree:true,attributeFilter:["style"]});p.getDoc().execCommand(aH?"ForwardDelete":"Delete",false,null);aF=p.selection.getRng();aI=aF.startContainer.parentNode;j.each(aG.takeRecords(),function(aJ){if(!ax.isChildOf(aJ.target,p.getBody())){return}if(aJ.attributeName=="style"){var aK=aJ.target.getAttribute("data-mce-style");if(aK){aJ.target.setAttribute("style",aK)}else{aJ.target.removeAttribute("style")}}j.each(aJ.addedNodes,function(aM){if(aM.nodeName=="SPAN"&&!aM.getAttribute("mce-data-marked")){var aN,aL;if(aM==aI){aN=aF.startOffset;aL=aM.firstChild}ax.remove(aM,true);if(aL){aF.setStart(aL,aN);aF.setEnd(aL,aN);p.selection.setRng(aF)}}})});aG.disconnect();j.each(p.dom.select("span[mce-data-marked]"),function(aJ){aJ.removeAttribute("mce-data-marked")})}p.on("keydown",function(aJ){var aI=aJ.keyCode==E,aF=aJ.ctrlKey||aJ.metaKey;if(!Z(aJ)&&(aI||aJ.keyCode==s)){var aH=p.selection.getRng(),aG=aH.startContainer,aK=aH.startOffset;if(!aF&&aH.collapsed&&aG.nodeType==3){if(aI?aK<aG.data.length:aK>0){return}}aJ.preventDefault();if(aF){p.selection.getSel().modify("extend",aI?"forward":"backward",aJ.metaKey?"lineboundary":"word")}aA(aI)}});p.on("keypress",function(aK){if(!Z(aK)&&!aE.isCollapsed()&&aK.charCode&&!n.metaKeyPressed(aK)){var aF,aL,aJ,aG,aH,aI;aF=p.selection.getRng();aI=String.fromCharCode(aK.charCode);aK.preventDefault();aL=W(aF.startContainer).parents().filter(function(aM,aN){return !!p.schema.getTextInlineElements()[aN.nodeName]});aA(true);aL=aL.filter(function(aM,aN){return !W.contains(p.getBody(),aN)});if(aL.length){aJ=ax.createFragment();aL.each(function(aM,aN){aN=aN.cloneNode(false);if(aJ.hasChildNodes()){aN.appendChild(aJ.firstChild);aJ.appendChild(aN)}else{aH=aN;aJ.appendChild(aN)}aJ.appendChild(aN)});aH.appendChild(p.getDoc().createTextNode(aI));aG=ax.getParent(aF.startContainer,ax.isBlock);if(ax.isEmpty(aG)){W(aG).empty().append(aJ)}else{aF.insertNode(aJ)}aF.setStart(aH.firstChild,1);aF.setEnd(aH.firstChild,1);p.selection.setRng(aF)}else{p.selection.setContent(aI)}}});p.addCommand("Delete",function(){aA()});p.addCommand("ForwardDelete",function(){aA(true)});if(ay){return}p.on("dragstart",function(aF){aC=aE.getRng();Q(aF)});p.on("drop",function(aF){if(!Z(aF)){var aG=K(aF);if(aG){aF.preventDefault();window.setTimeout(function(){var aH=m.getCaretRangeFromPoint(aF.x,aF.y,aD);if(aC){aE.setRng(aC);aC=null}aA();aE.setRng(aH);R(aG)},0)}}});p.on("cut",function(aF){if(!Z(aF)&&aF.clipboardData){aF.preventDefault();aF.clipboardData.clearData();aF.clipboardData.setData("text/html",p.selection.getContent());aF.clipboardData.setData("text/plain",p.selection.getContent({format:"text"}));aA(true)}})}function P(){function ar(av){var au=r.create("body");var aw=av.cloneContents();au.appendChild(aw);return G.serializer.serialize(au,{format:"html"})}function at(au){if(!au.setStart){if(au.item){return false}var ay=au.duplicate();ay.moveToElementText(p.getBody());return m.compareRanges(au,ay)}var aw=ar(au);var ax=r.createRng();ax.selectNode(p.getBody());var av=ar(ax);return aw===av}p.on("keydown",function(ax){var aw=ax.keyCode,av,au;if(!Z(ax)&&(aw==E||aw==s)){av=p.selection.isCollapsed();au=p.getBody();if(av&&!r.isEmpty(au)){return}if(!av&&!at(p.selection.getRng())){return}ax.preventDefault();p.setContent("");if(au.firstChild&&r.isBlock(au.firstChild)){p.selection.setCursorLocation(au.firstChild,0)}else{p.selection.setCursorLocation(au,0)}p.nodeChanged()}})}function ao(){p.shortcuts.add("meta+a",null,"SelectAll")}function aq(){if(!p.settings.content_editable){r.bind(p.getDoc(),"focusin",function(){G.setRng(G.getRng())});r.bind(p.getDoc(),"mousedown mouseup",function(ar){if(ar.target==p.getDoc().documentElement){p.getBody().focus();if(ar.type=="mousedown"){G.placeCaretAt(ar.clientX,ar.clientY)}else{G.setRng(G.getRng())}}})}}function ad(){p.on("keydown",function(au){if(!Z(au)&&au.keyCode===s){if(!p.getBody().getElementsByTagName("hr").length){return}if(G.isCollapsed()&&G.getRng(true).startOffset===0){var at=G.getNode();var ar=at.previousSibling;if(at.nodeName=="HR"){r.remove(at);au.preventDefault();return}if(ar&&ar.nodeName&&ar.nodeName.toLowerCase()==="hr"){r.remove(ar);au.preventDefault()}}}})}function Y(){if(!window.Range.prototype.getClientRects){p.on("mousedown",function(at){if(!Z(at)&&at.target.nodeName==="HTML"){var ar=p.getBody();ar.blur();setTimeout(function(){ar.focus()},0)}})}}function x(){p.on("click",function(at){var ar=at.target;if(/^(IMG|HR)$/.test(ar.nodeName)){at.preventDefault();G.getSel().setBaseAndExtent(ar,0,ar,1);p.nodeChanged()}if(ar.nodeName=="A"&&r.hasClass(ar,"mce-item-anchor")){at.preventDefault();G.select(ar)}})}function ak(){function at(){var au=r.getAttribs(G.getStart().cloneNode(false));return function(){var av=G.getStart();if(av!==p.getBody()){r.setAttrib(av,"style",null);aj(au,function(aw){av.setAttributeNode(aw.cloneNode(true))})}}}function ar(){return !G.isCollapsed()&&r.getParent(G.getStart(),r.isBlock)!=r.getParent(G.getEnd(),r.isBlock)}p.on("keypress",function(av){var au;if(!Z(av)&&(av.keyCode==8||av.keyCode==46)&&ar()){au=at();p.getDoc().execCommand("delete",false,null);au();av.preventDefault();return false}});r.bind(p.getDoc(),"cut",function(av){var au;if(!Z(av)&&ar()){au=at();setTimeout(function(){au()},0)}})}function X(){document.body.setAttribute("role","application")}function U(){p.on("keydown",function(at){if(!Z(at)&&at.keyCode===s){if(G.isCollapsed()&&G.getRng(true).startOffset===0){var ar=G.getNode().previousSibling;if(ar&&ar.nodeName&&ar.nodeName.toLowerCase()==="table"){at.preventDefault();return false}}}})}function ah(){if(J()>7){return}aa("RespectVisibilityInDesign",true);p.contentStyles.push(".mceHideBrInPre pre br {display: none}");r.addClass(p.getBody(),"mceHideBrInPre");V.addNodeFilter("pre",function(ar){var au=ar.length,aw,at,ax,av;while(au--){aw=ar[au].getAll("br");at=aw.length;while(at--){ax=aw[at];av=ax.prev;if(av&&av.type===3&&av.value.charAt(av.value-1)!="\n"){av.value+="\n"}else{ax.parent.insert(new k("#text",3),ax,true).value="\n"}}}});L.addNodeFilter("pre",function(ar){var au=ar.length,aw,at,ax,av;while(au--){aw=ar[au].getAll("br");at=aw.length;while(at--){ax=aw[at];av=ax.prev;if(av&&av.type==3){av.value=av.value.replace(/\r?\n$/,"")}}}})}function w(){r.bind(p.getBody(),"mouseup",function(){var at,ar=G.getNode();if(ar.nodeName=="IMG"){if((at=r.getStyle(ar,"width"))){r.setAttrib(ar,"width",at.replace(/[^0-9%]+/g,""));r.setStyle(ar,"width","")}if((at=r.getStyle(ar,"height"))){r.setAttrib(ar,"height",at.replace(/[^0-9%]+/g,""));r.setStyle(ar,"height","")}}})}function am(){p.on("keydown",function(aw){var au,at,ax,ar,av;if(Z(aw)||aw.keyCode!=n.BACKSPACE){return}au=G.getRng();at=au.startContainer;ax=au.startOffset;ar=r.getRoot();av=at;if(!au.collapsed||ax!==0){return}while(av&&av.parentNode&&av.parentNode.firstChild==av&&av.parentNode!=ar){av=av.parentNode}if(av.tagName==="BLOCKQUOTE"){p.formatter.toggle("blockquote",null,av);au=r.createRng();au.setStart(at,0);au.setEnd(at,0);G.setRng(au)}})}function al(){function ar(){p._refreshContentEditable();aa("StyleWithCSS",false);aa("enableInlineTableEditing",false);if(!an.object_resizing){aa("enableObjectResizing",false)}}if(!an.readonly){p.on("BeforeExecCommand MouseDown",ar)}}function T(){function ar(){aj(r.select("a"),function(av){var at=av.parentNode,au=r.getRoot();if(at.lastChild===av){while(at&&!r.isBlock(at)){if(at.parentNode.lastChild!==at||at===au){return}at=at.parentNode}r.add(at,"br",{"data-mce-bogus":1})}})}p.on("SetContent ExecCommand",function(at){if(at.type=="setcontent"||at.command==="mceInsertLink"){ar()}})}function H(){if(an.forced_root_block){p.on("init",function(){aa("DefaultParagraphSeparator",an.forced_root_block)})}}function N(){p.on("Undo Redo SetContent",function(ar){if(!ar.initial){p.execCommand("mceRepaint")}})}function y(){p.on("keydown",function(at){var ar;if(!Z(at)&&at.keyCode==s){ar=p.getDoc().selection.createRange();if(ar&&ar.item){at.preventDefault();p.undoManager.beforeChange();r.remove(ar.item(0));p.undoManager.add()}}})}function S(){var ar;if(J()>=10){ar="";aj("p div h1 h2 h3 h4 h5 h6".split(" "),function(at,au){ar+=(au>0?",":"")+at+":empty"});p.contentStyles.push(ar+"{padding-right: 1px !important}")}}function ai(){if(J()<9){V.addNodeFilter("noscript",function(ar){var at=ar.length,au,av;while(at--){au=ar[at];av=au.firstChild;if(av){au.attr("data-mce-innertext",av.value)}}});L.addNodeFilter("noscript",function(ar){var at=ar.length,au,aw,av;while(at--){au=ar[at];aw=ar[at].firstChild;if(aw){aw.value=o.decode(aw.value)}else{av=au.attributes.map["data-mce-innertext"];if(av){au.attr("data-mce-innertext",null);aw=new k("#text",3);aw.value=av;aw.raw=true;au.append(aw)}}}})}}function O(){var ay=r.doc,at=ay.body,av,aw,az;function ax(aA,aD){var aB=at.createTextRange();try{aB.moveToPoint(aA,aD)}catch(aC){aB=null}return aB}function au(aB){var aA;if(aB.button){aA=ax(aB.x,aB.y);if(aA){if(aA.compareEndPoints("StartToStart",aw)>0){aA.setEndPoint("StartToStart",aw)}else{aA.setEndPoint("EndToEnd",aw)}aA.select()}}else{ar()}}function ar(){var aA=ay.selection.createRange();if(aw&&!aA.item&&aA.compareEndPoints("StartToEnd",aA)===0){aw.select()}r.unbind(ay,"mouseup",ar);r.unbind(ay,"mousemove",au);aw=av=0}ay.documentElement.unselectable=true;r.bind(ay,"mousedown contextmenu",function(aA){if(aA.target.nodeName==="HTML"){if(av){ar()}az=ay.documentElement;if(az.scrollHeight>az.clientHeight){return}av=1;aw=ax(aA.x,aA.y);if(aw){r.bind(ay,"mouseup",ar);r.bind(ay,"mousemove",au);r.getRoot().focus();aw.select()}}})}function af(){p.on("keyup focusin mouseup",function(ar){if(ar.keyCode!=65||!n.metaKeyPressed(ar)){G.normalize()}},true)}function A(){p.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function B(){if(!p.inline){p.on("keydown",function(){if(document.activeElement==document.body){p.getWin().focus()}})}}function F(){if(!p.inline){p.contentStyles.push("body {min-height: 150px}");p.on("click",function(at){if(at.target.nodeName=="HTML"){var ar;ar=p.selection.getRng();p.getBody().focus();p.selection.setRng(ar);p.selection.normalize();p.nodeChanged()}})}}function D(){if(i.mac){p.on("keydown",function(ar){if(n.metaKeyPressed(ar)&&(ar.keyCode==37||ar.keyCode==39)){ar.preventDefault();p.selection.getSel().modify("move",ar.keyCode==37?"backward":"forward","lineboundary")}})}}function ac(){aa("AutoUrlDetect",false)}function I(){if(!p.inline){p.on("focus blur beforegetcontent",function(){var ar=p.dom.create("br");p.getBody().appendChild(ar);ar.parentNode.removeChild(ar)},true)}}function z(){p.on("click",function(ar){var at=ar.target;do{if(at.tagName==="A"){ar.preventDefault();return}}while((at=at.parentNode))});p.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")}function q(){p.on("touchstart",function(av){var aw,au,at,ar;aw=av.target;au=new Date().getTime();ar=av.changedTouches;if(!ar||ar.length>1){return}at=ar[0];p.once("touchend",function(az){var ay=az.changedTouches[0],ax;if(new Date().getTime()-au>500){return}if(Math.abs(at.clientX-ay.clientX)>5){return}if(Math.abs(at.clientY-ay.clientY)>5){return}ax={target:aw};aj("pageX pageY clientX clientY screenX screenY".split(" "),function(aA){ax[aA]=ay[aA]});ax=p.fire("click",ax);if(!ax.isDefaultPrevented()){p.selection.placeCaretAt(ay.clientX,ay.clientY);p.nodeChanged()}})})}function M(){p.on("init",function(){p.dom.bind(p.getBody(),"submit",function(ar){ar.preventDefault()})})}function ae(){V.addNodeFilter("br",function(ar){var at=ar.length;while(at--){if(ar[at].attr("class")=="Apple-interchange-newline"){ar[at].remove()}}})}function v(){p.on("dragstart",function(ar){Q(ar)});p.on("drop",function(at){if(!Z(at)){var au=K(at);if(au){at.preventDefault();var ar=m.getCaretRangeFromPoint(at.x,at.y,p.getDoc());G.setRng(ar);R(au)}}})}am();P();af();if(ag){ap();aq();x();H();M();U();ae();q();if(i.iOS){B();F();z()}else{ao()}}if(C&&i.ie<11){ad();X();ah();w();y();S();ai();O()}if(i.ie>=11){F();I();U()}if(i.ie){ao();ac();v()}if(u){ad();Y();ak();al();T();N();A();D();U()}}});h("tinymce/util/Observable",["tinymce/util/EventDispatcher"],function(j){function i(k){if(!k._eventDispatcher){k._eventDispatcher=new j({scope:k,toggleEvent:function(l,m){if(j.isNative(l)&&k.toggleNativeEvent){k.toggleNativeEvent(l,m)}}})}return k._eventDispatcher}return{fire:function(n,m,k){var l=this;if(l.removed&&n!=="remove"){return m}m=i(l).fire(n,m,k);if(k!==false&&l.parent){var o=l.parent();while(o&&!m.isPropagationStopped()){o.fire(n,m,false);o=o.parent()}}return m},on:function(l,m,k){return i(this).on(l,m,k)},off:function(k,l){return i(this).off(k,l)},once:function(k,l){return i(this).once(k,l)},hasEventListeners:function(k){return i(this).has(k)}}});h("tinymce/EditorObservable",["tinymce/util/Observable","tinymce/dom/DOMUtils","tinymce/util/Tools"],function(i,n,k){var l=n.DOM,j;function o(r,q){if(q=="selectionchange"){return r.getDoc()}if(!r.inline&&/^mouse|click|contextmenu|drop|dragover|dragend/.test(q)){return r.getDoc().documentElement}if(r.settings.event_root){if(!r.eventRoot){r.eventRoot=l.select(r.settings.event_root)[0]}return r.eventRoot}return r.getBody()}function m(s,q){var t=o(s,q),r;if(!s.delegates){s.delegates={}}if(s.delegates[q]){return}if(s.settings.event_root){if(!j){j={};s.editorManager.on("removeEditor",function(){var u;if(!s.editorManager.activeEditor){if(j){for(u in j){s.dom.unbind(o(s,u))}j=null}}})}if(j[q]){return}r=function(y){var x=y.target,w=s.editorManager.editors,v=w.length;while(v--){var u=w[v].getBody();if(u===x||l.isChildOf(x,u)){if(!w[v].hidden){w[v].fire(q,y)}}}};j[q]=r;l.bind(t,q,r)}else{r=function(u){if(!s.hidden){s.fire(q,u)}};l.bind(t,q,r);s.delegates[q]=r}}var p={bindPendingEventDelegates:function(){var q=this;k.each(q._pendingNativeEvents,function(r){m(q,r)})},toggleNativeEvent:function(r,s){var q=this;if(q.settings.readonly){return}if(r=="focus"||r=="blur"){return}if(s){if(q.initialized){m(q,r)}else{if(!q._pendingNativeEvents){q._pendingNativeEvents=[r]}else{q._pendingNativeEvents.push(r)}}}else{if(q.initialized){q.dom.unbind(o(q,r),r,q.delegates[r]);delete q.delegates[r]}}},unbindAllNativeEvents:function(){var q=this,r;if(q.delegates){for(r in q.delegates){q.dom.unbind(o(q,r),r,q.delegates[r])}delete q.delegates}if(!q.inline){q.getBody().onload=null;q.dom.unbind(q.getWin());q.dom.unbind(q.getDoc())}q.dom.unbind(q.getBody());q.dom.unbind(q.getContainer())}};p=k.extend({},i,p);return p});h("tinymce/Shortcuts",["tinymce/util/Tools","tinymce/Env"],function(k,j){var n=k.each,m=k.explode;var i={f9:120,f10:121,f11:122};var l=k.makeMap("alt,ctrl,shift,meta,access");return function(r){var q=this,o={};function p(w,x,v,u){var y,t,s;s={func:v,scope:u||r,desc:r.translate(x)};n(m(w,"+"),function(z){if(z in l){s[z]=true}else{if(/^[0-9]{2,}$/.test(z)){s.keyCode=parseInt(z,10)}else{s.charCode=z.charCodeAt(0);s.keyCode=i[z]||z.toUpperCase().charCodeAt(0)}}});y=[s.keyCode];for(t in l){if(s[t]){y.push(t)}else{s[t]=false}}s.id=y.join(",");if(s.access){s.alt=true;if(j.mac){s.ctrl=true}else{s.shift=true}}if(s.meta){if(j.mac){s.meta=true}else{s.ctrl=true;s.meta=false}}return s}r.on("keyup keypress keydown",function(s){if((s.altKey||s.ctrlKey||s.metaKey)&&!s.isDefaultPrevented()){n(o,function(t){if(t.ctrl!=s.ctrlKey||t.meta!=s.metaKey){return}if(t.alt!=s.altKey||t.shift!=s.shiftKey){return}if(s.keyCode==t.keyCode||(s.charCode&&s.charCode==t.charCode)){s.preventDefault();if(s.type=="keydown"){t.func.call(t.scope)}return true}})}});q.add=function(v,w,t,s){var u;u=t;if(typeof t==="string"){t=function(){r.execCommand(u,false,null)}}else{if(k.isArray(u)){t=function(){r.execCommand(u[0],u[1],u[2])}}}n(m(v.toLowerCase()),function(y){var x=p(y,w,t,s);o[x.id]=x});return true};q.remove=function(t){var s=p(t);if(o[s.id]){delete o[s.id];return true}return false}}});h("tinymce/Editor",["tinymce/dom/DOMUtils","tinymce/dom/DomQuery","tinymce/AddOnManager","tinymce/NodeChange","tinymce/html/Node","tinymce/dom/Serializer","tinymce/html/Serializer","tinymce/dom/Selection","tinymce/Formatter","tinymce/UndoManager","tinymce/EnterKey","tinymce/ForceBlocks","tinymce/EditorCommands","tinymce/util/URI","tinymce/dom/ScriptLoader","tinymce/dom/EventUtils","tinymce/WindowManager","tinymce/html/Schema","tinymce/html/DomParser","tinymce/util/Quirks","tinymce/Env","tinymce/util/Tools","tinymce/EditorObservable","tinymce/Shortcuts"],function(S,A,C,m,x,K,I,E,y,n,J,G,v,D,s,t,M,o,j,B,N,q,k,P){var z=S.DOM,O=C.ThemeManager,R=C.PluginManager;var p=q.extend,L=q.each,r=q.explode;var Q=q.inArray,i=q.trim,u=q.resolve;var H=t.Event;var l=N.gecko,F=N.ie;function w(Y,V,X){var U=this,T,W;T=U.documentBaseUrl=X.documentBaseURL;W=X.baseURI;U.settings=V=p({id:Y,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:T,add_form_submit_trigger:true,submit_patch:true,add_unload_trigger:true,convert_urls:true,relative_urls:true,remove_script_host:true,object_resizing:true,doctype:"<!DOCTYPE html>",visual:true,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%",forced_root_block:"p",hidden_input:true,padd_empty_editor:true,render_ui:true,indentation:"30px",inline_styles:true,convert_fonts_to_spans:true,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,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,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",validate:true,entity_encoding:"named",url_converter:U.convertURL,url_converter_scope:U,ie7_compat:true},V);C.language=V.language||"en";C.languageLoad=V.language_load;C.baseURL=X.baseURL;U.id=V.id=Y;U.isNotDirty=true;U.plugins={};U.documentBaseURI=new D(V.document_base_url||T,{base_uri:W});U.baseURI=W;U.contentCSS=[];U.contentStyles=[];U.shortcuts=new P(U);U.loadedCSS={};U.editorCommands=new v(U);if(V.target){U.targetElm=V.target}U.suffix=X.suffix;U.editorManager=X;U.inline=V.inline;if(V.cache_suffix){N.cacheSuffix=V.cache_suffix.replace(/^[\?\&]+/,"")}X.fire("SetupEditor",U);U.execCallback("setup",U);U.$=A.overrideDefaults(function(){return{context:U.inline?U.getBody():U.getDoc(),element:U.getBody()}})}w.prototype={render:function(){var T=this,W=T.settings,Z=T.id,Y=T.suffix;function V(){z.unbind(window,"ready",V);T.render()}if(!H.domLoaded){z.bind(window,"ready",V);return}if(!T.getElement()){return}if(!N.contentEditable){return}if(!W.inline){T.orgVisibility=T.getElement().style.visibility;T.getElement().style.visibility="hidden"}else{T.inline=true}var X=T.getElement().form||z.getParent(Z,"form");if(X){T.formElement=X;if(W.hidden_input&&!/TEXTAREA|INPUT/i.test(T.getElement().nodeName)){z.insertAfter(z.create("input",{type:"hidden",name:Z}),Z);T.hasHiddenInput=true}T.formEventDelegate=function(aa){T.fire(aa.type,aa)};z.bind(X,"submit reset",T.formEventDelegate);T.on("reset",function(){T.setContent(T.startContent,{format:"raw"})});if(W.submit_patch&&!X.submit.nodeType&&!X.submit.length&&!X._mceOldSubmit){X._mceOldSubmit=X.submit;X.submit=function(){T.editorManager.triggerSave();T.isNotDirty=true;return X._mceOldSubmit(X)}}}T.windowManager=new M(T);if(W.encoding=="xml"){T.on("GetContent",function(aa){if(aa.save){aa.content=z.encode(aa.content)}})}if(W.add_form_submit_trigger){T.on("submit",function(){if(T.initialized){T.save()}})}if(W.add_unload_trigger){T._beforeUnload=function(){if(T.initialized&&!T.destroyed&&!T.isHidden()){T.save({format:"raw",no_events:true,set_dirty:false})}};T.editorManager.on("BeforeUnload",T._beforeUnload)}function U(){var ab=s.ScriptLoader;if(W.language&&W.language!="en"&&!W.language_url){W.language_url=T.editorManager.baseURL+"/langs/"+W.language+".js"}if(W.language_url){ab.add(W.language_url)}if(W.theme&&typeof W.theme!="function"&&W.theme.charAt(0)!="-"&&!O.urls[W.theme]){var aa=W.theme_url;if(aa){aa=T.documentBaseURI.toAbsolute(aa)}else{aa="themes/"+W.theme+"/theme"+Y+".js"}O.load(W.theme,aa)}if(q.isArray(W.plugins)){W.plugins=W.plugins.join(" ")}L(W.external_plugins,function(ad,ac){R.load(ac,ad);W.plugins+=" "+ac});L(W.plugins.split(/[ ,]/),function(ac){ac=i(ac);if(ac&&!R.urls[ac]){if(ac.charAt(0)=="-"){ac=ac.substr(1,ac.length);var ad=R.dependencies(ac);L(ad,function(af){var ae={prefix:"plugins/",resource:af,suffix:"/plugin"+Y+".js"};af=R.createUrl(ae,af);R.load(af.resource,af)})}else{R.load(ac,{prefix:"plugins/",resource:ac,suffix:"/plugin"+Y+".js"})}}});ab.loadQueue(function(){if(!T.removed){T.init()}})}U()},init:function(){var ab=this,ak=ab.settings,X=ab.getElement();var Z,ai,W,ae,ac,T,U,am,ah,ad,ag,V=[];this.editorManager.i18n.setCode(ak.language);ab.rtl=this.editorManager.i18n.rtl;ab.editorManager.add(ab);ak.aria_label=ak.aria_label||z.getAttrib(X,"aria-label",ab.getLang("aria.rich_text_area"));if(ak.theme){if(typeof ak.theme!="function"){ak.theme=ak.theme.replace(/-/,"");T=O.get(ak.theme);ab.theme=new T(ab,O.urls[ak.theme]);if(ab.theme.init){ab.theme.init(ab,O.urls[ak.theme]||ab.documentBaseUrl.replace(/\/$/,""),ab.$)}}else{ab.theme=ak.theme}}function al(aq){var ap=R.get(aq),ao,an;ao=R.urls[aq]||ab.documentBaseUrl.replace(/\/$/,"");aq=i(aq);if(ap&&Q(V,aq)===-1){L(R.dependencies(aq),function(ar){al(ar)});an=new ap(ab,ao,ab.$);ab.plugins[aq]=an;if(an.init){an.init(ab,ao);V.push(aq)}}}L(ak.plugins.replace(/\-/g,"").split(/[ ,]/),al);if(ak.render_ui&&ab.theme){ab.orgDisplay=X.style.display;if(typeof ak.theme!="function"){Z=ak.width||X.style.width||X.offsetWidth;ai=ak.height||X.style.height||X.offsetHeight;W=ak.min_height||100;ad=/^[0-9\.]+(|px)$/i;if(ad.test(""+Z)){Z=Math.max(parseInt(Z,10),100)}if(ad.test(""+ai)){ai=Math.max(parseInt(ai,10),W)}ac=ab.theme.renderUI({targetNode:X,width:Z,height:ai,deltaWidth:ak.delta_width,deltaHeight:ak.delta_height});if(!ak.content_editable){ai=(ac.iframeHeight||ai)+(typeof ai=="number"?(ac.deltaHeight||0):"");if(ai<W){ai=W}}}else{ac=ak.theme(ab,X);if(ac.editorContainer.nodeType){ac.editorContainer=ac.editorContainer.id=ac.editorContainer.id||ab.id+"_parent"}if(ac.iframeContainer.nodeType){ac.iframeContainer=ac.iframeContainer.id=ac.iframeContainer.id||ab.id+"_iframecontainer"}ai=ac.iframeHeight||X.offsetHeight}ab.editorContainer=ac.editorContainer}if(ak.content_css){L(r(ak.content_css),function(an){ab.contentCSS.push(ab.documentBaseURI.toAbsolute(an))})}if(ak.content_style){ab.contentStyles.push(ak.content_style)}if(ak.content_editable){X=ae=ac=null;return ab.initContentBody()}ab.iframeHTML=ak.doctype+"<html><head>";if(ak.document_base_url!=ab.documentBaseUrl){ab.iframeHTML+='<base href="'+ab.documentBaseURI.getURI()+'" />'}if(!N.caretAfter&&ak.ie7_compat){ab.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=7" />'}ab.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';for(ag=0;ag<ab.contentCSS.length;ag++){var af=ab.contentCSS[ag];ab.iframeHTML+=('<link type="text/css" rel="stylesheet" href="'+q._addCacheSuffix(af)+'" />');ab.loadedCSS[af]=true}am=ak.body_id||"tinymce";if(am.indexOf("=")!=-1){am=ab.getParam("body_id","","hash");am=am[ab.id]||am}ah=ak.body_class||"";if(ah.indexOf("=")!=-1){ah=ab.getParam("body_class","","hash");ah=ah[ab.id]||""}if(ak.content_security_policy){ab.iframeHTML+='<meta http-equiv="Content-Security-Policy" content="'+ak.content_security_policy+'" />'}ab.iframeHTML+='</head><body id="'+am+'" class="mce-content-body '+ah+'" data-id="'+ab.id+'"><br></body></html>';var aa='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+ab.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody(true);})()';if(document.domain!=location.hostname){U=aa}var Y=z.create("iframe",{id:ab.id+"_ifr",frameBorder:"0",allowTransparency:"true",title:ab.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),style:{width:"100%",height:ai,display:"block"}});Y.onload=function(){Y.onload=null;ab.fire("load")};z.setAttrib(Y,"src",U||'javascript:""');ab.contentAreaContainer=ac.iframeContainer;ab.iframeElement=Y;ae=z.add(ac.iframeContainer,Y);if(F){try{ab.getDoc()}catch(aj){ae.src=U=aa}}if(ac.editorContainer){z.get(ac.editorContainer).style.display=ab.orgDisplay;ab.hidden=z.isHidden(ac.editorContainer)}ab.getElement().style.display="none";z.setAttrib(ab.id,"aria-hidden",true);if(!U){ab.initContentBody()}X=ae=ac=null},initContentBody:function(U){var V=this,W=V.settings,X=V.getElement(),Y=V.getDoc(),T,Z;if(!W.inline){V.getElement().style.visibility=V.orgVisibility}if(!U&&!W.content_editable){Y.open();Y.write(V.iframeHTML);Y.close()}if(W.content_editable){V.on("remove",function(){var aa=this.getBody();z.removeClass(aa,"mce-content-body");z.removeClass(aa,"mce-edit-focus");z.setAttrib(aa,"contentEditable",null)});z.addClass(X,"mce-content-body");V.contentDocument=Y=W.content_document||document;V.contentWindow=W.content_window||window;V.bodyElement=X;W.content_document=W.content_window=null;W.root_name=X.nodeName.toLowerCase()}T=V.getBody();T.disabled=true;if(!W.readonly){if(V.inline&&z.getStyle(T,"position",true)=="static"){T.style.position="relative"}T.contentEditable=V.getParam("content_editable_state",true)}T.disabled=false;V.schema=new o(W);V.dom=new S(Y,{keep_values:true,url_converter:V.convertURL,url_converter_scope:V,hex_colors:W.force_hex_style_colors,class_filter:W.class_filter,update_styles:true,root_element:V.inline?V.getBody():null,collect:W.content_editable,schema:V.schema,onSetAttrib:function(aa){V.fire("SetAttrib",aa)}});V.parser=new j(W,V.schema);V.parser.addAttributeFilter("src,href,style,tabindex",function(aa,ab){var ac=aa.length,ae,ag=V.dom,af,ad;while(ac--){ae=aa[ac];af=ae.attr(ab);ad="data-mce-"+ab;if(!ae.attributes.map[ad]){if(ab==="style"){af=ag.serializeStyle(ag.parseStyle(af),ae.name);if(!af.length){af=null}ae.attr(ad,af);ae.attr(ab,af)}else{if(ab==="tabindex"){ae.attr(ad,af);ae.attr(ab,null)}else{ae.attr(ad,V.convertURL(af,ab,ae.name))}}}}});V.parser.addNodeFilter("script",function(aa){var ab=aa.length,ac;while(ab--){ac=aa[ab];ac.attr("type","mce-"+(ac.attr("type")||"no/type"))}});V.parser.addNodeFilter("#cdata",function(aa){var ab=aa.length,ac;while(ab--){ac=aa[ab];ac.type=8;ac.name="#comment";ac.value="[CDATA["+ac.value+"]]"}});V.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(ab){var ac=ab.length,ad,aa=V.schema.getNonEmptyElements();while(ac--){ad=ab[ac];if(ad.isEmpty(aa)){ad.append(new x("br",1)).shortEnded=true}}});V.serializer=new K(W,V);V.selection=new E(V.dom,V.getWin(),V.serializer,V);V.formatter=new y(V);V.undoManager=new n(V);V.forceBlocks=new G(V);V.enterKey=new J(V);V._nodeChangeDispatcher=new m(V);V.fire("PreInit");if(!W.browser_spellcheck&&!W.gecko_spellcheck){Y.body.spellcheck=false;z.setAttrib(T,"spellcheck","false")}V.fire("PostRender");V.quirks=new B(V);if(W.directionality){T.dir=W.directionality}if(W.nowrap){T.style.whiteSpace="nowrap"}if(W.protect){V.on("BeforeSetContent",function(aa){L(W.protect,function(ab){aa.content=aa.content.replace(ab,function(ac){return"<!--mce:protected "+escape(ac)+"-->"})})})}V.on("SetContent",function(){V.addVisual(V.getBody())});if(W.padd_empty_editor){V.on("PostProcess",function(aa){aa.content=aa.content.replace(/^(<p[^>]*>(&nbsp;|&#160;|\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")})}V.load({initial:true,format:"html"});V.startContent=V.getContent({format:"raw"});V.initialized=true;V.bindPendingEventDelegates();V.fire("init");V.focus(true);V.nodeChanged({initial:true});V.execCallback("init_instance_callback",V);if(V.contentStyles.length>0){Z="";L(V.contentStyles,function(aa){Z+=aa+"\r\n"});V.dom.addStyle(Z)}L(V.contentCSS,function(aa){if(!V.loadedCSS[aa]){V.dom.loadCSS(aa);V.loadedCSS[aa]=true}});if(W.auto_focus){setTimeout(function(){var aa;if(W.auto_focus===true){aa=V}else{aa=V.editorManager.get(W.auto_focus)}if(!aa.destroyed){aa.focus()}},100)}X=Y=T=null},focus:function(U){var ab=this,aa=ab.selection,X=ab.settings.content_editable,T;var Y,Z=ab.getDoc(),V;if(!U){T=aa.getRng();if(T.item){Y=T.item(0)}ab._refreshContentEditable();if(!X){if(!N.opera){ab.getBody().focus()}ab.getWin().focus()}if(l||X){V=ab.getBody();if(V.setActive){try{V.setActive()}catch(W){V.focus()}}else{V.focus()}if(X){aa.normalize()}}if(Y&&Y.ownerDocument==Z){T=Z.body.createControlRange();T.addElement(Y);T.select()}}ab.editorManager.setActive(ab)},execCallback:function(U){var T=this,W=T.settings[U],V;if(!W){return}if(T.callbackLookup&&(V=T.callbackLookup[U])){W=V.func;V=V.scope}if(typeof W==="string"){V=W.replace(/\.\w+$/,"");V=V?u(V):0;W=u(W);T.callbackLookup=T.callbackLookup||{};T.callbackLookup[U]={func:W,scope:V}}return W.apply(V||T,Array.prototype.slice.call(arguments,1))},translate:function(V){var U=this.settings.language||"en",T=this.editorManager.i18n;if(!V){return""}return T.data[U+"."+V]||V.replace(/\{\#([^\}]+)\}/g,function(X,W){return T.data[U+"."+W]||"{#"+W+"}"})},getLang:function(T,U){return(this.editorManager.i18n.data[(this.settings.language||"en")+"."+T]||(U!==g?U:"{#"+T+"}"))},getParam:function(U,X,V){var W=U in this.settings?this.settings[U]:X,T;if(V==="hash"){T={};if(typeof W==="string"){L(W.indexOf("=")>0?W.split(/[;,](?![^=;,]*(?:[;,]|$))/):W.split(","),function(Y){Y=Y.split("=");if(Y.length>1){T[i(Y[0])]=i(Y[1])}else{T[i(Y[0])]=i(Y)}})}else{T=W}return T}return W},nodeChanged:function(T){this._nodeChangeDispatcher.nodeChanged(T)},addButton:function(U,V){var T=this;if(V.cmd){V.onclick=function(){T.execCommand(V.cmd)}}if(!V.text&&!V.icon){V.icon=U}T.buttons=T.buttons||{};V.tooltip=V.tooltip||V.title;T.buttons[U]=V},addMenuItem:function(U,V){var T=this;if(V.cmd){V.onclick=function(){T.execCommand(V.cmd)}}T.menuItems=T.menuItems||{};T.menuItems[U]=V},addCommand:function(T,V,U){this.editorCommands.addCommand(T,V,U)},addQueryStateHandler:function(T,V,U){this.editorCommands.addQueryStateHandler(T,V,U)},addQueryValueHandler:function(T,V,U){this.editorCommands.addQueryValueHandler(T,V,U)},addShortcut:function(V,W,U,T){this.shortcuts.add(V,W,U,T)},execCommand:function(W,V,U,T){return this.editorCommands.execCommand(W,V,U,T)},queryCommandState:function(T){return this.editorCommands.queryCommandState(T)},queryCommandValue:function(T){return this.editorCommands.queryCommandValue(T)},queryCommandSupported:function(T){return this.editorCommands.queryCommandSupported(T)},show:function(){var T=this;if(T.hidden){T.hidden=false;if(T.inline){T.getBody().contentEditable=true}else{z.show(T.getContainer());z.hide(T.id)}T.load();T.fire("show")}},hide:function(){var T=this,U=T.getDoc();if(!T.hidden){if(F&&U&&!T.inline){U.execCommand("SelectAll")}T.save();if(T.inline){T.getBody().contentEditable=false;if(T==T.editorManager.focusedEditor){T.editorManager.focusedEditor=null}}else{z.hide(T.getContainer());z.setStyle(T.id,"display",T.orgDisplay)}T.hidden=true;T.fire("hide")}},isHidden:function(){return !!this.hidden},setProgressState:function(T,U){this.fire("ProgressState",{state:T,time:U})},load:function(U){var T=this,W=T.getElement(),V;if(W){U=U||{};U.load=true;V=T.setContent(W.value!==g?W.value:W.innerHTML,U);U.element=W;if(!U.no_events){T.fire("LoadContent",U)}U.element=W=null;return V}},save:function(U){var T=this,X=T.getElement(),V,W;if(!X||!T.initialized){return}U=U||{};U.save=true;U.element=X;V=U.content=T.getContent(U);if(!U.no_events){T.fire("SaveContent",U)}V=U.content;if(!/TEXTAREA|INPUT/i.test(X.nodeName)){if(!T.inline){X.innerHTML=V}if((W=z.getParent(T.id,"form"))){L(W.elements,function(Y){if(Y.name==T.id){Y.value=V;return false}})}}else{X.value=V}U.element=X=null;if(U.set_dirty!==false){T.isNotDirty=true}return V},setContent:function(X,V){var U=this,T=U.getBody(),W;V=V||{};V.format=V.format||"html";V.set=true;V.content=X;if(!V.no_events){U.fire("BeforeSetContent",V)}X=V.content;if(X.length===0||/^\s+$/.test(X)){W=U.settings.forced_root_block;if(W&&U.schema.isValidChild(T.nodeName.toLowerCase(),W.toLowerCase())){X=F&&F<11?"":'<br data-mce-bogus="1">';X=U.dom.createHTML(W,U.settings.forced_root_block_attrs,X)}else{if(!F){X='<br data-mce-bogus="1">'}}U.dom.setHTML(T,X);U.fire("SetContent",V)}else{if(V.format!=="raw"){X=new I({},U.schema).serialize(U.parser.parse(X,{isRootContent:true}))}V.content=i(X);U.dom.setHTML(T,V.content);if(!V.no_events){U.fire("SetContent",V)}}return V.content},getContent:function(V){var U=this,W,T=U.getBody();V=V||{};V.format=V.format||"html";V.get=true;V.getInner=true;if(!V.no_events){U.fire("BeforeGetContent",V)}if(V.format=="raw"){W=T.innerHTML}else{if(V.format=="text"){W=T.innerText||T.textContent}else{W=U.serializer.serialize(T,V)}}if(V.format!="text"){V.content=i(W)}else{V.content=W}if(!V.no_events){U.fire("GetContent",V)}return V.content},insertContent:function(U,T){if(T){U=p({content:U},T)}this.execCommand("mceInsertContent",false,U)},isDirty:function(){return !this.isNotDirty},getContainer:function(){var T=this;if(!T.container){T.container=z.get(T.editorContainer||T.id+"_parent")}return T.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){if(!this.targetElm){this.targetElm=z.get(this.id)}return this.targetElm},getWin:function(){var T=this,U;if(!T.contentWindow){U=T.iframeElement;if(U){T.contentWindow=U.contentWindow}}return T.contentWindow},getDoc:function(){var T=this,U;if(!T.contentDocument){U=T.getWin();if(U){T.contentDocument=U.document}}return T.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(V,U,X){var T=this,W=T.settings;if(W.urlconverter_callback){return T.execCallback("urlconverter_callback",V,X,true,U)}if(!W.convert_urls||(X&&X.nodeName=="LINK")||V.indexOf("file:")===0||V.length===0){return V}if(W.relative_urls){return T.documentBaseURI.toRelative(V)}V=T.documentBaseURI.toAbsolute(V,W.remove_script_host);return V},addVisual:function(X){var U=this,V=U.settings,W=U.dom,T;X=X||U.getBody();if(U.hasVisual===g){U.hasVisual=V.visual}L(W.select("table,a",X),function(Z){var Y;switch(Z.nodeName){case"TABLE":T=V.visual_table_class||"mce-item-table";Y=W.getAttrib(Z,"border");if((!Y||Y=="0")&&U.hasVisual){W.addClass(Z,T)}else{W.removeClass(Z,T)}return;case"A":if(!W.getAttrib(Z,"href",false)){Y=W.getAttrib(Z,"name")||Z.id;T=V.visual_anchor_class||"mce-item-anchor";if(Y&&U.hasVisual){W.addClass(Z,T)}else{W.removeClass(Z,T)}}return}});U.fire("VisualAid",{element:X,hasVisual:U.hasVisual})},remove:function(){var T=this;if(!T.removed){T.save();T.removed=1;T.unbindAllNativeEvents();if(T.hasHiddenInput){z.remove(T.getElement().nextSibling)}if(!T.inline){if(F&&F<10){T.getDoc().execCommand("SelectAll",false,null)}z.setStyle(T.id,"display",T.orgDisplay);T.getBody().onload=null}T.fire("remove");T.editorManager.remove(T);z.remove(T.getContainer());T.destroy()}},destroy:function(V){var T=this,U;if(T.destroyed){return}if(!V&&!T.removed){T.remove();return}if(!V){T.editorManager.off("beforeunload",T._beforeUnload);if(T.theme&&T.theme.destroy){T.theme.destroy()}T.selection.destroy();T.dom.destroy()}U=T.formElement;if(U){if(U._mceOldSubmit){U.submit=U._mceOldSubmit;U._mceOldSubmit=null}z.unbind(U,"submit reset",T.formEventDelegate)}T.contentAreaContainer=T.formElement=T.container=T.editorContainer=null;T.bodyElement=T.contentDocument=T.contentWindow=null;T.iframeElement=T.targetElm=null;if(T.selection){T.selection=T.selection.win=T.selection.dom=T.selection.dom.doc=null}T.destroyed=1},_refreshContentEditable:function(){var U=this,T,V;if(U._isHidden()){T=U.getBody();V=T.parentNode;V.removeChild(T);V.appendChild(T);T.focus()}},_isHidden:function(){var T;if(!l){return 0}T=this.selection.getSel();return(!T||!T.rangeCount||T.rangeCount===0)}};p(w.prototype,k);return w});h("tinymce/util/I18n",[],function(){var j={},i="en";return{setCode:function(k){if(k){i=k;this.rtl=this.data[k]?this.data[k]._dir==="rtl":false}},getCode:function(){return i},rtl:false,add:function(n,l){var k=j[n];if(!k){j[n]=k={}}for(var m in l){k[m]=l[m]}this.setCode(n)},translate:function(m){var k;k=j[i];if(!k){k={}}if(typeof m=="undefined"){return m}if(typeof m!="string"&&m.raw){return m.raw}if(m.push){var l=m.slice(1);m=(k[m[0]]||m[0]).replace(/\{([0-9]+)\}/g,function(o,n){return l[n]})}return(k[m]||m).replace(/{context:\w+}$/,"")},data:j}});h("tinymce/FocusManager",["tinymce/dom/DOMUtils","tinymce/Env"],function(o,j){var k,m,l,n=o.DOM;function i(v){function q(){try{return document.activeElement}catch(w){return document.body}}function u(x,w){if(w&&w.startContainer){if(!x.isChildOf(w.startContainer,x.getRoot())||!x.isChildOf(w.endContainer,x.getRoot())){return}return{startContainer:w.startContainer,startOffset:w.startOffset,endContainer:w.endContainer,endOffset:w.endOffset}}return w}function p(y,x){var w;if(x.startContainer){w=y.getDoc().createRange();w.setStart(x.startContainer,x.startOffset);w.setEnd(x.endContainer,x.endOffset)}else{w=x}return w}function t(w){return !!n.getParent(w,i.isEditorUIElement)}function r(x){var w=x.editor;w.on("init",function(){if(w.inline||j.ie){if("onbeforedeactivate" in document&&j.ie<9){w.dom.bind(w.getBody(),"beforedeactivate",function(z){if(z.target!=w.getBody()){return}try{w.lastRng=w.selection.getRng()}catch(y){}})}else{w.on("nodechange mouseup keyup",function(z){var y=q();if(z.type=="nodechange"&&z.selectionChange){return}if(y&&y.id==w.id+"_ifr"){y=w.getBody()}if(w.dom.isChildOf(y,w.getBody())){w.lastRng=w.selection.getRng()}})}if(j.webkit&&!k){k=function(){var z=v.activeEditor;if(z&&z.selection){var y=z.selection.getRng();if(y&&!y.collapsed){w.lastRng=y}}};n.bind(document,"selectionchange",k)}}});w.on("setcontent",function(){w.lastRng=null});w.on("mousedown",function(){w.selection.lastFocusBookmark=null});w.on("focusin",function(){var y=v.focusedEditor;if(w.selection.lastFocusBookmark){w.selection.setRng(p(w,w.selection.lastFocusBookmark));w.selection.lastFocusBookmark=null}if(y!=w){if(y){y.fire("blur",{focusedEditor:w})}v.setActive(w);v.focusedEditor=w;w.fire("focus",{blurredEditor:y});w.focus(true)}w.lastRng=null});w.on("focusout",function(){window.setTimeout(function(){var y=v.focusedEditor;if(!t(q())&&y==w){w.fire("blur",{focusedEditor:null});v.focusedEditor=null;if(w.selection){w.selection.lastFocusBookmark=null}}},0)});if(!m){m=function(z){var y=v.activeEditor;if(y&&z.target.ownerDocument==document){if(y.selection&&z.target!=y.getBody()){y.selection.lastFocusBookmark=u(y.dom,y.lastRng)}if(z.target!=document.body&&!t(z.target)&&v.focusedEditor==y){y.fire("blur",{focusedEditor:null});v.focusedEditor=null}}};n.bind(document,"focusin",m)}if(w.inline&&!l){l=function(A){var z=v.activeEditor;if(z.inline&&!z.dom.isChildOf(A.target,z.getBody())){var y=z.selection.getRng();if(!y.collapsed){z.lastRng=y}}};n.bind(document,"mouseup",l)}}function s(w){if(v.focusedEditor==w.editor){v.focusedEditor=null}if(!v.activeEditor){n.unbind(document,"selectionchange",k);n.unbind(document,"focusin",m);n.unbind(document,"mouseup",l);k=m=l=null}}v.on("AddEditor",r);v.on("RemoveEditor",s)}i.isEditorUIElement=function(p){return p.className.toString().indexOf("mce-")!==-1};return i});h("tinymce/EditorManager",["tinymce/Editor","tinymce/dom/DomQuery","tinymce/dom/DOMUtils","tinymce/util/URI","tinymce/Env","tinymce/util/Tools","tinymce/util/Observable","tinymce/util/I18n","tinymce/FocusManager"],function(s,k,w,n,j,i,p,t,m){var y=w.DOM;var u=i.explode,l=i.each,x=i.extend;var z=0,q,r;function v(C){var D=r.editors,B;delete D[C.id];for(var A=0;A<D.length;A++){if(D[A]==C){D.splice(A,1);B=true;break}}if(r.activeEditor==C){r.activeEditor=D[0]}if(r.focusedEditor==C){r.focusedEditor=null}return B}function o(A){if(A&&!(A.getContainer()||A.getBody()).parentNode){v(A);A.unbindAllNativeEvents();A.destroy(true);A=null}return A}r={$:k,majorVersion:"4",minorVersion:"1.10",releaseDate:"2015-05-05",editors:[],i18n:t,activeEditor:null,setup:function(){var D=this,F,B,G="",C,H;B=document.location.href;if(/^[^:]+:\/\/\/?[^\/]+\//.test(B)){B=B.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(B)){B+="/"}}C=window.tinymce||window.tinyMCEPreInit;if(C){F=C.base||C.baseURL;G=C.suffix}else{var A=document.getElementsByTagName("script");for(var E=0;E<A.length;E++){H=A[E].src;if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(H)){if(H.indexOf(".min")!=-1){G=".min"}F=H.substring(0,H.lastIndexOf("/"));break}}if(!F&&document.currentScript){H=document.currentScript.src;if(H.indexOf(".min")!=-1){G=".min"}F=H.substring(0,H.lastIndexOf("/"))}}D.baseURL=new n(B).toAbsolute(F);D.documentBaseURL=B;D.baseURI=new n(D.baseURL);D.suffix=G;D.focusManager=new m(D)},init:function(F){var A=this,G=[];function E(J){var I=J.id;if(!I){I=J.name;if(I&&!y.get(I)){I=J.name}else{I=y.uniqueId()}J.setAttribute("id",I)}return I}function C(L,J,K){if(!o(A.get(L))){var I=new s(L,J,A);I.targetElm=I.targetElm||K;G.push(I);I.render()}}function H(I){var J=F[I];if(!J){return}return J.apply(A,Array.prototype.slice.call(arguments,2))}function D(J,I){return I.constructor===RegExp?I.test(J.className):y.hasClass(J,I)}function B(){var I,J;y.unbind(window,"ready",B);H("onpageload");if(F.types){l(F.types,function(K){l(y.select(K.selector),function(L){C(E(L),x({},F,K),L)})});return}else{if(F.selector){l(y.select(F.selector),function(K){C(E(K),F,K)});return}else{if(F.target){C(E(F.target),F)}}}switch(F.mode){case"exact":I=F.elements||"";if(I.length>0){l(u(I),function(L){var K;if((K=y.get(L))){C(L,F,K)}else{l(document.forms,function(M){l(M.elements,function(N){if(N.name===L){L="mce_editor_"+z++;y.setAttrib(N,"id",L);C(L,F,N)}})})}})}break;case"textareas":case"specific_textareas":l(y.select("textarea"),function(K){if(F.editor_deselector&&D(K,F.editor_deselector)){return}if(!F.editor_selector||D(K,F.editor_selector)){C(E(K),F,K)}});break}if(F.oninit){I=J=0;l(G,function(K){J++;if(!K.initialized){K.on("init",function(){I++;if(I==J){H("oninit")}})}else{I++}if(I==J){H("oninit")}})}}A.settings=F;y.bind(window,"ready",B)},get:function(A){if(!arguments.length){return this.editors}return A in this.editors?this.editors[A]:null},add:function(B){var A=this,C=A.editors;C[B.id]=B;C.push(B);A.activeEditor=B;A.fire("AddEditor",{editor:B});if(!q){q=function(){A.fire("BeforeUnload")};y.bind(window,"beforeunload",q)}return B},createEditor:function(B,A){return this.add(new s(B,A,this))},remove:function(A){var B=this,C,E=B.editors,D;if(!A){for(C=E.length-1;C>=0;C--){B.remove(E[C])}return}if(typeof A=="string"){A=A.selector||A;l(y.select(A),function(F){D=E[F.id];if(D){B.remove(D)}});return}D=A;if(!E[D.id]){return null}if(v(D)){B.fire("RemoveEditor",{editor:D})}if(!E.length){y.unbind(window,"beforeunload",q)}D.remove();return D},execCommand:function(E,D,C){var A=this,B=A.get(C);switch(E){case"mceAddEditor":if(!A.get(C)){new s(C,A.settings,A).render()}return true;case"mceRemoveEditor":if(B){B.remove()}return true;case"mceToggleEditor":if(!B){A.execCommand("mceAddEditor",0,C);return true}if(B.isHidden()){B.show()}else{B.hide()}return true}if(A.activeEditor){return A.activeEditor.execCommand(E,D,C)}return false},triggerSave:function(){l(this.editors,function(A){A.save()})},addI18n:function(B,A){t.add(B,A)},translate:function(A){return t.translate(A)},setActive:function(A){var B=this.activeEditor;if(this.activeEditor!=A){if(B){B.fire("deactivate",{relatedTarget:A})}A.fire("activate",{relatedTarget:B})}this.activeEditor=A}};x(r,p);r.setup();window.tinymce=window.tinyMCE=r;return r});h("tinymce/LegacyInput",["tinymce/EditorManager","tinymce/util/Tools"],function(j,i){var l=i.each,k=i.explode;j.on("AddEditor",function(n){var m=n.editor;m.on("preInit",function(){var q,t,s,p=m.settings;function o(v,u){l(u,function(x,w){if(x){s.setStyle(v,w,x)}});s.rename(v,"span")}function r(u){s=m.dom;if(p.convert_fonts_to_spans){l(s.select("font,u,strike",u.node),function(v){q[v.nodeName.toLowerCase()](s,v)})}}if(p.inline_styles){t=k(p.font_size_legacy_values);q={font:function(v,u){o(u,{backgroundColor:u.style.backgroundColor,color:u.color,fontFamily:u.face,fontSize:t[parseInt(u.size,10)-1]})},u:function(v,u){if(m.settings.schema==="html4"){o(u,{textDecoration:"underline"})}},strike:function(v,u){o(u,{textDecoration:"line-through"})}};m.on("PreProcess SetContent",r)}})})});h("tinymce/util/XHR",["tinymce/util/Observable","tinymce/util/Tools"],function(i,j){var k={send:function(m){var o,n=0;function l(){if(!m.async||o.readyState==4||n++>10000){if(m.success&&n<10000&&o.status==200){m.success.call(m.success_scope,""+o.responseText,o,m)}else{if(m.error){m.error.call(m.error_scope,n>10000?"TIMED_OUT":"GENERAL",o,m)}}o=null}else{setTimeout(l,10)}}m.scope=m.scope||this;m.success_scope=m.success_scope||m.scope;m.error_scope=m.error_scope||m.scope;m.async=m.async===false?false:true;m.data=m.data||"";o=new XMLHttpRequest();if(o){if(o.overrideMimeType){o.overrideMimeType(m.content_type)}o.open(m.type||(m.data?"POST":"GET"),m.url,m.async);if(m.crossDomain){o.withCredentials=true}if(m.content_type){o.setRequestHeader("Content-Type",m.content_type)}o.setRequestHeader("X-Requested-With","XMLHttpRequest");o=k.fire("beforeSend",{xhr:o,settings:m}).xhr;o.send(m.data);if(!m.async){return l()}setTimeout(l,10)}}};j.extend(k,i);return k});h("tinymce/util/JSON",[],function(){function i(p,k){var n,j,m,l;k=k||'"';if(p===null){return"null"}m=typeof p;if(m=="string"){j="\bb\tt\nn\ff\rr\"\"''\\\\";return k+p.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(q,o){if(k==='"'&&q==="'"){return q}n=j.indexOf(o);if(n+1){return"\\"+j.charAt(n+1)}q=o.charCodeAt().toString(16);return"\\u"+"0000".substring(q.length)+q})+k}if(m=="object"){if(p.hasOwnProperty&&Object.prototype.toString.call(p)==="[object Array]"){for(n=0,j="[";n<p.length;n++){j+=(n>0?",":"")+i(p[n],k)}return j+"]"}j="{";for(l in p){if(p.hasOwnProperty(l)){j+=typeof p[l]!="function"?(j.length>1?","+k:k)+l+k+":"+i(p[l],k):""}}return j+"}"}return""+p}return{serialize:i,parse:function(k){try{return window[String.fromCharCode(101)+"val"]("("+k+")")}catch(j){}}}});h("tinymce/util/JSONRequest",["tinymce/util/JSON","tinymce/util/XHR","tinymce/util/Tools"],function(l,k,j){var m=j.extend;function i(n){this.settings=m({},n);this.count=0}i.sendRPC=function(n){return new i().send(n)};i.prototype={send:function(p){var o=p.error,n=p.success;p=m(this.settings,p);p.success=function(r,q){r=l.parse(r);if(typeof r=="undefined"){r={error:"JSON Parse error."}}if(r.error){o.call(p.error_scope||p.scope,r.error,q)}else{n.call(p.success_scope||p.scope,r.result)}};p.error=function(r,q){if(o){o.call(p.error_scope||p.scope,r,q)}};p.data=l.serialize({id:p.id||"c"+(this.count++),method:p.method,params:p.params});p.content_type="application/json";k.send(p)}};return i});h("tinymce/util/JSONP",["tinymce/dom/DOMUtils"],function(i){return{callbacks:{},count:0,send:function(k){var j=this,m=i.DOM,l=k.count!==g?k.count:j.count;var n="tinymce_jsonp_"+l;j.callbacks[l]=function(o){m.remove(n);delete j.callbacks[l];k.callback(o)};m.add(m.doc.body,"script",{id:n,src:k.url,type:"text/javascript"});j.count++}}});h("tinymce/util/LocalStorage",[],function(){var l,k,o,q,r,j;try{if(window.localStorage){return localStorage}}catch(n){}r="tinymce";k=document.documentElement;j=!!k.addBehavior;if(j){k.addBehavior("#default#userData")}function i(){q=[];for(var s in o){q.push(s)}l.length=q.length}function p(){var s,v,u,x=0;o={};if(!j){return}function t(y){var A,z;z=y!==g?x+y:v.indexOf(",",x);if(z===-1||z>v.length){return null}A=v.substring(x,z);x=z+1;return A}k.load(r);v=k.getAttribute(r)||"";do{var w=t();if(w===null){break}s=t(parseInt(w,32)||0);if(s!==null){w=t();if(w===null){break}u=t(parseInt(w,32)||0);if(s){o[s]=u}}}while(s!==null);i()}function m(){var v,u="";if(!j){return}for(var t in o){v=o[t];u+=(u?",":"")+t.length.toString(32)+","+t+","+v.length.toString(32)+","+v}k.setAttribute(r,u);try{k.save(r)}catch(s){}i()}l={key:function(s){return q[s]},getItem:function(s){return s in o?o[s]:null},setItem:function(s,t){o[s]=""+t;m()},removeItem:function(s){delete o[s];m()},clear:function(){o={};m()}};p();return l});h("tinymce/Compat",["tinymce/dom/DOMUtils","tinymce/dom/EventUtils","tinymce/dom/ScriptLoader","tinymce/AddOnManager","tinymce/util/Tools","tinymce/Env"],function(m,o,n,l,j,i){var k=window.tinymce;k.DOM=m.DOM;k.ScriptLoader=n.ScriptLoader;k.PluginManager=l.PluginManager;k.ThemeManager=l.ThemeManager;k.dom=k.dom||{};k.dom.Event=o.Event;j.each(j,function(q,p){k[p]=q});j.each("isOpera isWebKit isIE isGecko isMac".split(" "),function(p){k[p]=i[p.substr(2).toLowerCase()]});return{}});h("tinymce/ui/Layout",["tinymce/util/Class","tinymce/util/Tools"],function(i,j){return i.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(k){this.settings=j.extend({},this.Defaults,k)},preRender:function(k){k.addClass(this.settings.containerClass,"body")},applyClasses:function(k){var m=this,p=m.settings,l,o,n;l=k.items().filter(":visible");o=p.firstControlClass;n=p.lastControlClass;l.each(function(q){q.removeClass(o).removeClass(n);if(p.controlClass){q.addClass(p.controlClass)}});l.eq(0).addClass(o);l.eq(-1).addClass(n)},renderHtml:function(k){var m=this,o=m.settings,l,n="";l=k.items();l.eq(0).addClass(o.firstControlClass);l.eq(-1).addClass(o.lastControlClass);l.each(function(p){if(o.controlClass){p.addClass(o.controlClass)}n+=p.renderHtml()});return n},recalc:function(){},postRender:function(){}})});h("tinymce/ui/AbsoluteLayout",["tinymce/ui/Layout"],function(i){return i.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(j){j.items().filter(":visible").each(function(l){var k=l.settings;l.layoutRect({x:k.x,y:k.y,w:k.w,h:k.h});if(l.recalc){l.recalc()}})},renderHtml:function(j){return'<div id="'+j._id+'-absend" class="'+j.classPrefix+'abs-end"></div>'+this._super(j)}})});h("tinymce/ui/Tooltip",["tinymce/ui/Control","tinymce/ui/Movable"],function(j,i){return j.extend({Mixins:[i],Defaults:{classes:"widget tooltip tooltip-n"},text:function(l){var k=this;if(typeof l!="undefined"){k._value=l;if(k._rendered){k.getEl().lastChild.innerHTML=k.encode(l)}return k}return k._value},renderHtml:function(){var k=this,l=k.classPrefix;return('<div id="'+k._id+'" class="'+k.classes()+'" role="presentation"><div class="'+l+'tooltip-arrow"></div><div class="'+l+'tooltip-inner">'+k.encode(k._text)+"</div></div>")},repaint:function(){var k=this,l,m;l=k.getEl().style;m=k._layoutRect;l.left=m.x+"px";l.top=m.y+"px";l.zIndex=65535+65535}})});h("tinymce/ui/Widget",["tinymce/ui/Control","tinymce/ui/Tooltip"],function(k,i){var l;var j=k.extend({init:function(n){var m=this;m._super(n);n=m.settings;m.canFocus=true;if(n.tooltip&&j.tooltips!==false){m.on("mouseenter",function(q){var p=m.tooltip().moveTo(-65535);if(q.control==m){var o=p.text(n.tooltip).show().testMoveRel(m.getEl(),["bc-tc","bc-tl","bc-tr"]);p.toggleClass("tooltip-n",o=="bc-tc");p.toggleClass("tooltip-nw",o=="bc-tl");p.toggleClass("tooltip-ne",o=="bc-tr");p.moveRel(m.getEl(),o)}else{p.hide()}});m.on("mouseleave mousedown click",function(){m.tooltip().hide()})}m.aria("label",n.ariaLabel||n.tooltip)},tooltip:function(){if(!l){l=new i({type:"tooltip"});l.renderTo()}return l},active:function(o){var m=this,n;if(o!==n){m.aria("pressed",o);m.toggleClass("active",o)}return m._super(o)},disabled:function(o){var m=this,n;if(o!==n){m.aria("disabled",o);m.toggleClass("disabled",o)}return m._super(o)},postRender:function(){var m=this,n=m.settings;m._rendered=true;m._super();if(!m.parent()&&(n.width||n.height)){m.initLayoutRect();m.repaint()}if(n.autofocus){m.focus()}},remove:function(){this._super();if(l){l.remove();l=null}}});return j});h("tinymce/ui/Button",["tinymce/ui/Widget"],function(i){return i.extend({Defaults:{classes:"widget btn",role:"button"},init:function(l){var j=this,k;j.on("click mousedown",function(m){m.preventDefault()});j._super(l);k=l.size;if(l.subtype){j.addClass(l.subtype)}if(k){j.addClass("btn-"+k)}},icon:function(m){var l=this,n=l.classPrefix;if(typeof m=="undefined"){return l.settings.icon}l.settings.icon=m;m=m?n+"ico "+n+"i-"+l.settings.icon:"";if(l._rendered){var j=l.getEl().firstChild,k=j.getElementsByTagName("i")[0];if(m){if(!k||k!=j.firstChild){k=document.createElement("i");j.insertBefore(k,j.firstChild)}k.className=m}else{if(k){j.removeChild(k)}}l.text(l._text)}return l},repaint:function(){var j=this.getEl().firstChild.style;j.width=j.height="100%";this._super()},text:function(l){var j=this;if(j._rendered){var k=j.getEl().lastChild.lastChild;if(k){k.data=j.translate(l)}}return j._super(l)},renderHtml:function(){var j=this,n=j._id,l=j.classPrefix;var k=j.settings.icon,m;m=j.settings.image;if(m){k="none";if(typeof m!="string"){m=window.getSelection?m[0]:m[1]}m=" style=\"background-image: url('"+m+"')\""}else{m=""}k=j.settings.icon?l+"ico "+l+"i-"+k:"";return('<div id="'+n+'" class="'+j.classes()+'" tabindex="-1" aria-labelledby="'+n+'"><button role="presentation" type="button" tabindex="-1">'+(k?'<i class="'+k+'"'+m+"></i>":"")+(j._text?(k?"\u00a0":"")+j.encode(j._text):"")+"</button></div>")}})});h("tinymce/ui/ButtonGroup",["tinymce/ui/Container"],function(i){return i.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var j=this,k=j._layout;j.addClass("btn-group");j.preRender();k.preRender(j);return('<div id="'+j._id+'" class="'+j.classes()+'"><div id="'+j._id+'-body">'+(j.settings.html||"")+k.renderHtml(j)+"</div></div>")}})});h("tinymce/ui/Checkbox",["tinymce/ui/Widget"],function(i){return i.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:false},init:function(k){var j=this;j._super(k);j.on("click mousedown",function(l){l.preventDefault()});j.on("click",function(l){l.preventDefault();if(!j.disabled()){j.checked(!j.checked())}});j.checked(j.settings.checked)},checked:function(k){var j=this;if(typeof k!="undefined"){if(k){j.addClass("checked")}else{j.removeClass("checked")}j._checked=k;j.aria("checked",k);return j}return j._checked},value:function(j){return this.checked(j)},renderHtml:function(){var j=this,l=j._id,k=j.classPrefix;return('<div id="'+l+'" class="'+j.classes()+'" unselectable="on" aria-labelledby="'+l+'-al" tabindex="-1"><i class="'+k+"ico "+k+'i-checkbox"></i><span id="'+l+'-al" class="'+k+'label">'+j.encode(j._text)+"</span></div>")}})});h("tinymce/ui/ComboBox",["tinymce/ui/Widget","tinymce/ui/Factory","tinymce/ui/DomUtils"],function(k,i,j){return k.extend({init:function(m){var l=this;l._super(m);l.addClass("combobox");l.subinput=true;l.ariaTarget="inp";m=l.settings;m.menu=m.menu||m.values;if(m.menu){m.icon="caret"}l.on("click",function(o){var p=o.target,n=l.getEl();while(p&&p!=n){if(p.id&&p.id.indexOf("-open")!=-1){l.fire("action");if(m.menu){l.showMenu();if(o.aria){l.menu.items()[0].focus()}}}p=p.parentNode}});l.on("keydown",function(n){if(n.target.nodeName=="INPUT"&&n.keyCode==13){l.parents().reverse().each(function(o){n.preventDefault();l.fire("change");if(o.hasEventListeners("submit")&&o.toJSON){o.fire("submit",{data:o.toJSON()});return false}})}});if(m.placeholder){l.addClass("placeholder");l.on("focusin",function(){if(!l._hasOnChange){j.on(l.getEl("inp"),"change",function(){l.fire("change")});l._hasOnChange=true}if(l.hasClass("placeholder")){l.getEl("inp").value="";l.removeClass("placeholder")}});l.on("focusout",function(){if(l.value().length===0){l.getEl("inp").value=m.placeholder;l.addClass("placeholder")}})}},showMenu:function(){var l=this,m=l.settings,n;if(!l.menu){n=m.menu||[];if(n.length){n={type:"menu",items:n}}else{n.type=n.type||"menu"}l.menu=i.create(n).parent(l).renderTo(l.getContainerElm());l.fire("createmenu");l.menu.reflow();l.menu.on("cancel",function(o){if(o.control===l.menu){l.focus()}});l.menu.on("show hide",function(o){o.control.items().each(function(p){p.active(p.value()==l.value())})}).fire("show");l.menu.on("select",function(o){l.value(o.control.value())});l.on("focusin",function(o){if(o.target.tagName.toUpperCase()=="INPUT"){l.menu.hide()}});l.aria("expanded",true)}l.menu.show();l.menu.layoutRect({w:l.layoutRect().w});l.menu.moveRel(l.getEl(),l.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},value:function(m){var l=this;if(typeof m!="undefined"){l._value=m;l.removeClass("placeholder");if(l._rendered){l.getEl("inp").value=m}return l}if(l._rendered){m=l.getEl("inp").value;if(m!=l.settings.placeholder){return m}return""}return l._value},disabled:function(m){var l=this;if(l._rendered&&typeof m!="undefined"){l.getEl("inp").disabled=m}return l._super(m)},focus:function(){this.getEl("inp").focus()},repaint:function(){var m=this,r=m.getEl(),l=m.getEl("open"),p=m.layoutRect();var o,n;if(l){o=p.w-j.getSize(l).width-10}else{o=p.w-10}var q=document;if(q.all&&(!q.documentMode||q.documentMode<=8)){n=(m.layoutRect().h-2)+"px"}j.css(r.firstChild,{width:o,lineHeight:n});m._super();return m},postRender:function(){var l=this;j.on(this.getEl("inp"),"change",function(){l.fire("change")});return l._super()},remove:function(){j.off(this.getEl("inp"));this._super()},renderHtml:function(){var t=this,l=t._id,m=t.settings,n=t.classPrefix;var q=m.value||m.placeholder||"";var p,s,o="",r="";if("spellcheck" in m){r+=' spellcheck="'+m.spellcheck+'"'}if(m.maxLength){r+=' maxlength="'+m.maxLength+'"'}if(m.size){r+=' size="'+m.size+'"'}if(m.subtype){r+=' type="'+m.subtype+'"'}if(t.disabled()){r+=' disabled="disabled"'}p=m.icon;if(p&&p!="caret"){p=n+"ico "+n+"i-"+m.icon}s=t._text;if(p||s){o=('<div id="'+l+'-open" class="'+n+"btn "+n+'open" tabIndex="-1" role="button"><button id="'+l+'-action" type="button" hidefocus="1" tabindex="-1">'+(p!="caret"?'<i class="'+p+'"></i>':'<i class="'+n+'caret"></i>')+(s?(p?" ":"")+s:"")+"</button></div>");t.addClass("has-open")}return('<div id="'+l+'" class="'+t.classes()+'"><input id="'+l+'-inp" class="'+n+"textbox "+n+'placeholder" value="'+q+'" hidefocus="1"'+r+" />"+o+"</div>")}})});h("tinymce/ui/ColorBox",["tinymce/ui/ComboBox"],function(i){return i.extend({init:function(k){var j=this;k.spellcheck=false;if(k.onaction){k.icon="none"}j._super(k);j.addClass("colorbox");j.on("change keyup postrender",function(){j.repaintColor(j.value())})},repaintColor:function(k){var l=this.getEl().getElementsByTagName("i")[0];if(l){try{l.style.background=k}catch(j){}}},value:function(k){var j=this;if(typeof k!="undefined"){if(j._rendered){j.repaintColor(k)}}return j._super(k)}})});h("tinymce/ui/PanelButton",["tinymce/ui/Button","tinymce/ui/FloatPanel"],function(i,j){return i.extend({showPanel:function(){var k=this,l=k.settings;k.active(true);if(!k.panel){var m=l.panel;if(m.type){m={layout:"grid",items:m}}m.role=m.role||"dialog";m.popover=true;m.autohide=true;m.ariaRoot=true;k.panel=new j(m).on("hide",function(){k.active(false)}).on("cancel",function(n){n.stopPropagation();k.focus();k.hidePanel()}).parent(k).renderTo(k.getContainerElm());k.panel.fire("show");k.panel.reflow()}else{k.panel.show()}k.panel.moveRel(k.getEl(),l.popoverAlign||(k.isRtl()?["bc-tr","bc-tc"]:["bc-tl","bc-tc"]))},hidePanel:function(){var k=this;if(k.panel){k.panel.hide()}},postRender:function(){var k=this;k.aria("haspopup",true);k.on("click",function(l){if(l.control===k){if(k.panel&&k.panel.visible()){k.hidePanel()}else{k.showPanel();k.panel.focus(!!l.aria)}}});return k._super()},remove:function(){if(this.panel){this.panel.remove();this.panel=null}return this._super()}})});h("tinymce/ui/ColorButton",["tinymce/ui/PanelButton","tinymce/dom/DOMUtils"],function(j,i){var k=i.DOM;return j.extend({init:function(l){this._super(l);this.addClass("colorbutton")},color:function(l){if(l){this._color=l;this.getEl("preview").style.backgroundColor=l;return this}return this._color},resetColor:function(){this._color=null;this.getEl("preview").style.backgroundColor=null;return this},renderHtml:function(){var l=this,p=l._id,n=l.classPrefix;var m=l.settings.icon?n+"ico "+n+"i-"+l.settings.icon:"";var o=l.settings.image?" style=\"background-image: url('"+l.settings.image+"')\"":"";return('<div id="'+p+'" class="'+l.classes()+'" role="button" tabindex="-1" aria-haspopup="true"><button role="presentation" hidefocus="1" type="button" tabindex="-1">'+(m?'<i class="'+m+'"'+o+"></i>":"")+'<span id="'+p+'-preview" class="'+n+'preview"></span>'+(l._text?(m?" ":"")+(l._text):"")+'</button><button type="button" class="'+n+'open" hidefocus="1" tabindex="-1"> <i class="'+n+'caret"></i></button></div>')},postRender:function(){var l=this,m=l.settings.onclick;l.on("click",function(n){if(n.aria&&n.aria.key=="down"){return}if(n.control==l&&!k.getParent(n.target,"."+l.classPrefix+"open")){n.stopImmediatePropagation();m.call(l,n)}});delete l.settings.onclick;return l._super()}})});h("tinymce/util/Color",[],function(){var k=Math.min,i=Math.max,j=Math.round;function l(w){var x=this,m=0,t=0,v=0;function p(y,A,C){var z,G,E,B,D,F;z=0;G=0;E=0;y=y/255;A=A/255;C=C/255;D=k(y,k(A,C));F=i(y,i(A,C));if(D==F){E=D;return{h:0,s:0,v:E*100}}B=(y==D)?A-C:((C==D)?y-A:C-y);z=(y==D)?3:((C==D)?1:5);z=60*(z-B/(F-D));G=(F-D)/F;E=F;return{h:j(z),s:j(G*100),v:j(E*100)}}function q(y,C,D){var B,A,r,z;y=(parseInt(y,10)||0)%360;C=parseInt(C,10)/100;D=parseInt(D,10)/100;C=i(0,k(C,1));D=i(0,k(D,1));if(C===0){m=t=v=j(255*D);return}B=y/60;A=D*C;r=A*(1-Math.abs(B%2-1));z=D-A;switch(Math.floor(B)){case 0:m=A;t=r;v=0;break;case 1:m=r;t=A;v=0;break;case 2:m=0;t=A;v=r;break;case 3:m=0;t=r;v=A;break;case 4:m=r;t=0;v=A;break;case 5:m=A;t=0;v=r;break;default:m=t=v=0}m=j(255*(m+z));t=j(255*(t+z));v=j(255*(v+z))}function n(){function r(y){y=parseInt(y,10).toString(16);return y.length>1?y:"0"+y}return"#"+r(m)+r(t)+r(v)}function u(){return{r:m,g:t,b:v}}function s(){return p(m,t,v)}function o(y){var r;if(typeof y=="object"){if("r" in y){m=y.r;t=y.g;v=y.b}else{if("v" in y){q(y.h,y.s,y.v)}}}else{if((r=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(y))){m=parseInt(r[1],10);t=parseInt(r[2],10);v=parseInt(r[3],10)}else{if((r=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(y))){m=parseInt(r[1],16);t=parseInt(r[2],16);v=parseInt(r[3],16)}else{if((r=/#([0-F])([0-F])([0-F])/gi.exec(y))){m=parseInt(r[1]+r[1],16);t=parseInt(r[2]+r[2],16);v=parseInt(r[3]+r[3],16)}}}}m=m<0?0:(m>255?255:m);t=t<0?0:(t>255?255:t);v=v<0?0:(v>255?255:v);return x}if(w){o(w)}x.toRgb=u;x.toHsv=s;x.toHex=n;x.parse=o}return l});h("tinymce/ui/ColorPicker",["tinymce/ui/Widget","tinymce/ui/DragHelper","tinymce/ui/DomUtils","tinymce/util/Color"],function(k,j,i,l){return k.extend({Defaults:{classes:"widget colorpicker"},init:function(m){this._super(m)},postRender:function(){var w=this,q=w.color(),r,t,s,v,o;t=w.getEl("h");s=w.getEl("hp");v=w.getEl("sv");o=w.getEl("svp");function p(D,A){var C=i.getPos(D),z,B;z=A.pageX-C.x;B=A.pageY-C.y;z=Math.max(0,Math.min(z/D.clientWidth,1));B=Math.max(0,Math.min(B/D.clientHeight,1));return{x:z,y:B}}function n(z,y){var x=(360-z.h)/360;i.css(s,{top:(x*100)+"%"});if(!y){i.css(o,{left:z.s+"%",top:(100-z.v)+"%"})}v.style.background=new l({s:100,v:100,h:z.h}).toHex();w.color().parse({s:z.s,v:z.v,h:z.h})}function m(x){var y;y=p(v,x);r.s=y.x*100;r.v=(1-y.y)*100;n(r);w.fire("change")}function u(x){var y;y=p(t,x);r=q.toHsv();r.h=(1-y.y)*360;n(r,true);w.fire("change")}w._repaint=function(){r=q.toHsv();n(r)};w._super();w._svdraghelper=new j(w._id+"-sv",{start:m,drag:m});w._hdraghelper=new j(w._id+"-h",{start:u,drag:u});w._repaint()},rgb:function(){return this.color().toRgb()},value:function(n){var m=this;if(arguments.length){m.color().parse(n);if(m._rendered){m._repaint()}}else{return m.color().toHex()}},color:function(){if(!this._color){this._color=new l()}return this._color},renderHtml:function(){var m=this,s=m._id,q=m.classPrefix,o;var p="#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000";function n(){var w,u,v="",t,x;t="filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=";x=p.split(",");for(w=0,u=x.length-1;w<u;w++){v+=('<div class="'+q+'colorpicker-h-chunk" style="height:'+(100/u)+"%;"+t+x[w]+",endColorstr="+x[w+1]+");-ms-"+t+x[w]+",endColorstr="+x[w+1]+')"></div>')}return v}var r=("background: -ms-linear-gradient(top,"+p+");background: linear-gradient(to bottom,"+p+");");o=('<div id="'+s+'-h" class="'+q+'colorpicker-h" style="'+r+'">'+n()+'<div id="'+s+'-hp" class="'+q+'colorpicker-h-marker"></div></div>');return('<div id="'+s+'" class="'+m.classes()+'"><div id="'+s+'-sv" class="'+q+'colorpicker-sv"><div class="'+q+'colorpicker-overlay1"><div class="'+q+'colorpicker-overlay2"><div id="'+s+'-svp" class="'+q+'colorpicker-selector1"><div class="'+q+'colorpicker-selector2"></div></div></div></div></div>'+o+"</div>")}})});h("tinymce/ui/Path",["tinymce/ui/Widget"],function(i){return i.extend({init:function(k){var j=this;if(!k.delimiter){k.delimiter="\u00BB"}j._super(k);j.addClass("path");j.canFocus=true;j.on("click",function(n){var l,m=n.target;if((l=m.getAttribute("data-index"))){j.fire("select",{value:j.data()[l],index:l})}})},focus:function(){var j=this;j.getEl().firstChild.focus();return j},data:function(k){var j=this;if(typeof k!=="undefined"){j._data=k;j.update();return j}return j._data},update:function(){this.innerHtml(this._getPathHtml())},postRender:function(){var j=this;j._super();j.data(j.settings.data)},renderHtml:function(){var j=this;return('<div id="'+j._id+'" class="'+j.classes()+'">'+j._getPathHtml()+"</div>")},_getPathHtml:function(){var k=this,p=k._data||[],n,j,m="",o=k.classPrefix;for(n=0,j=p.length;n<j;n++){m+=((n>0?'<div class="'+o+'divider" aria-hidden="true"> '+k.settings.delimiter+" </div>":"")+'<div role="button" class="'+o+"path-item"+(n==j-1?" "+o+"last":"")+'" data-index="'+n+'" tabindex="-1" id="'+k._id+"-"+n+'" aria-level="'+n+'">'+p[n].name+"</div>")}if(!m){m='<div class="'+o+'path-item">\u00a0</div>'}return m}})});h("tinymce/ui/ElementPath",["tinymce/ui/Path","tinymce/EditorManager"],function(j,i){return j.extend({postRender:function(){var k=this,m=i.activeEditor;function l(n){if(n.nodeType===1){if(n.nodeName=="BR"||!!n.getAttribute("data-mce-bogus")){return true}if(n.getAttribute("data-mce-type")==="bookmark"){return true}}return false}if(m.settings.elementpath!==false){k.on("select",function(n){m.focus();m.selection.select(this.data()[n.index].element);m.nodeChanged()});m.on("nodeChange",function(r){var n=[],p=r.parents,q=p.length;while(q--){if(p[q].nodeType==1&&!l(p[q])){var o=m.fire("ResolveName",{name:p[q].nodeName.toLowerCase(),target:p[q]});if(!o.isDefaultPrevented()){n.push({name:o.name,element:p[q]})}if(o.isPropagationStopped()){break}}}k.data(n)})}return k._super()}})});h("tinymce/ui/FormItem",["tinymce/ui/Container"],function(i){return i.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var j=this,k=j._layout,l=j.classPrefix;j.addClass("formitem");k.preRender(j);return('<div id="'+j._id+'" class="'+j.classes()+'" hidefocus="1" tabindex="-1">'+(j.settings.title?('<div id="'+j._id+'-title" class="'+l+'title">'+j.settings.title+"</div>"):"")+'<div id="'+j._id+'-body" class="'+j.classes("body")+'">'+(j.settings.html||"")+k.renderHtml(j)+"</div></div>")}})});h("tinymce/ui/Form",["tinymce/ui/Container","tinymce/ui/FormItem","tinymce/util/Tools"],function(i,k,j){return i.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:20,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var m=this,l=m.items();if(!m.settings.formItemDefaults){m.settings.formItemDefaults={layout:"flex",autoResize:"overflow",defaults:{flex:1}}}l.each(function(p){var o,n=p.settings.label;if(n){o=new k(j.extend({items:{type:"label",id:p._id+"-l",text:n,flex:0,forId:p._id,disabled:p.disabled()}},m.settings.formItemDefaults));o.type="formitem";p.aria("labelledby",p._id+"-l");if(typeof p.settings.flex=="undefined"){p.settings.flex=1}m.replace(p,o);o.add(p)}})},recalcLabels:function(){var m=this,p=0,q=[],n,o,l;if(m.settings.labelGapCalc===false){return}if(m.settings.labelGapCalc=="children"){l=m.find("formitem")}else{l=m.items()}l.filter("formitem").each(function(t){var s=t.items()[0],r=s.getEl().clientWidth;p=r>p?r:p;q.push(s)});o=m.settings.labelGap||0;n=q.length;while(n--){q[n].settings.minWidth=p+o}},visible:function(l){var m=this._super(l);if(l===true&&this._rendered){this.recalcLabels()}return m},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){var l=this;l._super();l.recalcLabels();l.fromJSON(l.settings.data)}})});h("tinymce/ui/FieldSet",["tinymce/ui/Form"],function(i){return i.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 j=this,k=j._layout,l=j.classPrefix;j.preRender();k.preRender(j);return('<fieldset id="'+j._id+'" class="'+j.classes()+'" hidefocus="1" tabindex="-1">'+(j.settings.title?('<legend id="'+j._id+'-title" class="'+l+'fieldset-title">'+j.settings.title+"</legend>"):"")+'<div id="'+j._id+'-body" class="'+j.classes("body")+'">'+(j.settings.html||"")+k.renderHtml(j)+"</div></fieldset>")}})});h("tinymce/ui/FilePicker",["tinymce/ui/ComboBox","tinymce/util/Tools"],function(j,i){return j.extend({init:function(o){var m=this,n=tinymce.activeEditor,l=n.settings;var k,q,p;o.spellcheck=false;p=l.file_picker_types||l.file_browser_callback_types;if(p){p=i.makeMap(p,/[, ]/)}if(!p||p[o.filetype]){q=l.file_picker_callback;if(q&&(!p||p[o.filetype])){k=function(){var r=m.fire("beforecall").meta;r=i.extend({filetype:o.filetype},r);q.call(n,function(s,t){m.value(s).fire("change",{meta:t})},m.value(),r)}}else{q=l.file_browser_callback;if(q&&(!p||p[o.filetype])){k=function(){q(m.getEl("inp").id,m.value(),o.filetype,window)}}}}if(k){o.icon="browse";o.onaction=k}m._super(o)}})});h("tinymce/ui/FitLayout",["tinymce/ui/AbsoluteLayout"],function(i){return i.extend({recalc:function(k){var j=k.layoutRect(),l=k.paddingBox();k.items().filter(":visible").each(function(m){m.layoutRect({x:l.left,y:l.top,w:j.innerW-l.right-l.left,h:j.innerH-l.top-l.bottom});if(m.recalc){m.recalc()}})}})});h("tinymce/ui/FlexLayout",["tinymce/ui/AbsoluteLayout"],function(i){return i.extend({recalc:function(L){var X,S,y,V,t,B,R,w,m,Y,n,u;var T,k,o,q,s=[],r,E,P,I,J,W;var O,D,v,p,aa,M,x,N;var F,j,C,Q,H,U;var K,G;var z=Math.max,Z=Math.min;y=L.items().filter(":visible");V=L.layoutRect();t=L._paddingBox;B=L.settings;u=L.isRtl()?(B.direction||"row-reversed"):B.direction;R=B.align;w=L.isRtl()?(B.pack||"end"):B.pack;m=B.spacing||0;if(u=="row-reversed"||u=="column-reverse"){y=y.set(y.toArray().reverse());u=u.split("-")[0]}if(u=="column"){v="y";O="h";D="minH";p="maxH";M="innerH";aa="top";x="deltaH";N="contentH";H="left";C="w";F="x";j="innerW";Q="minW";U="right";K="deltaW";G="contentW"}else{v="x";O="w";D="minW";p="maxW";M="innerW";aa="left";x="deltaW";N="contentW";H="top";C="h";F="y";j="innerH";Q="minH";U="bottom";K="deltaH";G="contentH"}n=V[M]-t[aa]-t[aa];W=Y=0;for(X=0,S=y.length;X<S;X++){T=y[X];k=T.layoutRect();o=T.settings;q=o.flex;n-=(X<S-1?m:0);if(q>0){Y+=q;if(k[p]){s.push(T)}k.flex=q}n-=k[D];r=t[H]+k[Q]+t[U];if(r>W){W=r}}I={};if(n<0){I[D]=V[D]-n+V[x]}else{I[D]=V[M]-n+V[x]}I[Q]=W+V[K];I[N]=V[M]-n;I[G]=W;I.minW=Z(I.minW,V.maxW);I.minH=Z(I.minH,V.maxH);I.minW=z(I.minW,V.startMinWidth);I.minH=z(I.minH,V.startMinHeight);if(V.autoResize&&(I.minW!=V.minW||I.minH!=V.minH)){I.w=I.minW;I.h=I.minH;L.layoutRect(I);this.recalc(L);if(L._lastRect===null){var A=L.parent();if(A){A._lastRect=null;A.recalc()}}return}P=n/Y;for(X=0,S=s.length;X<S;X++){T=s[X];k=T.layoutRect();E=k[p];r=k[D]+k.flex*P;if(r>E){n-=(k[p]-k[D]);Y-=k.flex;k.flex=0;k.maxFlexSize=E}else{k.maxFlexSize=0}}P=n/Y;J=t[aa];I={};if(Y===0){if(w=="end"){J=n+t[aa]}else{if(w=="center"){J=Math.round((V[M]/2)-((V[M]-n)/2))+t[aa];if(J<0){J=t[aa]}}else{if(w=="justify"){J=t[aa];m=Math.floor(n/(y.length-1))}}}}I[F]=t[H];for(X=0,S=y.length;X<S;X++){T=y[X];k=T.layoutRect();r=k.maxFlexSize||k[D];if(R==="center"){I[F]=Math.round((V[j]/2)-(k[C]/2))}else{if(R==="stretch"){I[C]=z(k[Q]||0,V[j]-t[H]-t[U]);I[F]=t[H]}else{if(R==="end"){I[F]=V[j]-k[C]-t.top}}}if(k.flex>0){r+=k.flex*P}I[O]=r;I[v]=J;T.layoutRect(I);if(T.recalc){T.recalc()}J+=r+m}}})});h("tinymce/ui/FlowLayout",["tinymce/ui/Layout"],function(i){return i.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(j){j.items().filter(":visible").each(function(k){if(k.recalc){k.recalc()}})}})});h("tinymce/ui/FormatControls",["tinymce/ui/Control","tinymce/ui/Widget","tinymce/ui/FloatPanel","tinymce/util/Tools","tinymce/EditorManager","tinymce/Env"],function(n,m,p,j,l,i){var o=j.each;l.on("AddEditor",function(q){if(q.editor.rtl){n.rtl=true}k(q.editor)});n.translate=function(q){return l.translate(q)};m.tooltips=!i.iOS;function k(v){var q;function w(y,z){return function(){var A=this;v.on("nodeChange",function(D){var B=v.formatter;var C=null;o(D.parents,function(E){o(y,function(F){if(z){if(B.matchNode(E,z,{value:F.value})){C=F.value}}else{if(B.matchNode(E,F.value)){C=F.value}}if(C){return false}});if(C){return false}});A.value(C)})}}function t(y){y=y.replace(/;$/,"").split(";");var z=y.length;while(z--){y[z]=y[z].split("=")}return y}function s(){var C=0,B=[];var A=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 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"}]}];function y(D){var E=[];if(!D){return}o(D,function(H){var G={text:H.title,icon:H.icon};if(H.items){G.menu=y(H.items)}else{var F=H.format||"custom"+C++;if(!H.format){H.name=F;B.push(H)}G.format=F;G.cmd=H.cmd}E.push(G)});return E}function z(){var D;if(v.settings.style_formats_merge){if(v.settings.style_formats){D=y(A.concat(v.settings.style_formats))}else{D=y(A)}}else{D=y(v.settings.style_formats||A)}return D}v.on("init",function(){o(B,function(D){v.formatter.register(D.name,D)})});return{type:"menu",items:z(),onPostRender:function(D){v.fire("renderFormatsMenu",{control:D.control})},itemDefaults:{preview:true,textStyle:function(){if(this.settings.format){return v.formatter.getCssText(this.settings.format)}},onPostRender:function(){var D=this;D.parent().on("show",function(){var E,F;E=D.settings.format;if(E){D.disabled(!v.formatter.canApply(E));D.active(v.formatter.match(E))}F=D.settings.cmd;if(F){D.active(v.queryCommandState(F))}})},onclick:function(){if(this.settings.format){r(this.settings.format)}if(this.settings.cmd){v.execCommand(this.settings.cmd)}}}}}q=s();o({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(z,y){v.addButton(y,{tooltip:z,onPostRender:function(){var A=this;if(v.formatter){v.formatter.formatChanged(y,function(B){A.active(B)})}else{v.on("init",function(){v.formatter.formatChanged(y,function(B){A.active(B)})})}},onclick:function(){r(y)}})});o({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(z,y){v.addButton(y,{tooltip:z[0],cmd:z[1]})});o({blockquote:["Blockquote","mceBlockQuote"],numlist:["Numbered list","InsertOrderedList"],bullist:["Bullet list","InsertUnorderedList"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"]},function(z,y){v.addButton(y,{tooltip:z[0],cmd:z[1],onPostRender:function(){var A=this;if(v.formatter){v.formatter.formatChanged(y,function(B){A.active(B)})}else{v.on("init",function(){v.formatter.formatChanged(y,function(B){A.active(B)})})}}})});function u(y){return function(){var z=this;y=y=="redo"?"hasRedo":"hasUndo";function A(){return v.undoManager?v.undoManager[y]():false}z.disabled(!A());v.on("Undo Redo AddUndo TypingUndo ClearUndos",function(){z.disabled(!A())})}}function x(){var y=this;v.on("VisualAid",function(z){y.active(z.hasVisual)});y.active(v.hasVisual)}v.addButton("undo",{tooltip:"Undo",onPostRender:u("undo"),cmd:"undo"});v.addButton("redo",{tooltip:"Redo",onPostRender:u("redo"),cmd:"redo"});v.addMenuItem("newdocument",{text:"New document",icon:"newdocument",cmd:"mceNewDocument"});v.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onPostRender:u("undo"),cmd:"undo"});v.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onPostRender:u("redo"),cmd:"redo"});v.addMenuItem("visualaid",{text:"Visual aids",selectable:true,onPostRender:x,cmd:"mceToggleVisualAid"});o({cut:["Cut","Cut","Meta+X"],copy:["Copy","Copy","Meta+C"],paste:["Paste","Paste","Meta+V"],selectall:["Select all","SelectAll","Meta+A"],bold:["Bold","Bold","Meta+B"],italic:["Italic","Italic","Meta+I"],underline:["Underline","Underline"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(z,y){v.addMenuItem(y,{text:z[0],icon:y,shortcut:z[2],cmd:z[1]})});v.on("mousedown",function(){p.hideAll()});function r(y){if(y.control){y=y.control.value()}if(y){v.execCommand("mceToggleFormat",false,y)}}v.addButton("styleselect",{type:"menubutton",text:"Formats",menu:q});v.addButton("formatselect",function(){var y=[],z=t(v.settings.block_formats||"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre");o(z,function(A){y.push({text:A[0],value:A[1],textStyle:function(){return v.formatter.getCssText(A[1])}})});return{type:"listbox",text:z[0][0],values:y,fixedWidth:true,onselect:r,onPostRender:w(y)}});v.addButton("fontselect",function(){var z="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats";var y=[],A=t(v.settings.font_formats||z);o(A,function(B){y.push({text:{raw:B[0]},value:B[1],textStyle:B[1].indexOf("dings")==-1?"font-family:"+B[1]:""})});return{type:"listbox",text:"Font Family",tooltip:"Font Family",values:y,fixedWidth:true,onPostRender:w(y,"fontname"),onselect:function(B){if(B.control.settings.value){v.execCommand("FontName",false,B.control.settings.value)}}}});v.addButton("fontsizeselect",function(){var y=[],A="8pt 10pt 12pt 14pt 18pt 24pt 36pt";var z=v.settings.fontsize_formats||A;o(z.split(" "),function(C){var E=C,D=C;var B=C.split("=");if(B.length>1){E=B[0];D=B[1]}y.push({text:E,value:D})});return{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:y,fixedWidth:true,onPostRender:w(y,"fontsize"),onclick:function(B){if(B.control.settings.value){v.execCommand("FontSize",false,B.control.settings.value)}}}});v.addMenuItem("formats",{text:"Formats",menu:q})}});h("tinymce/ui/GridLayout",["tinymce/ui/AbsoluteLayout"],function(i){return i.extend({recalc:function(F){var T=F.settings,S,v,w,P,k,o,D,n,O,K,J,H,G,q,s,N,t,p,m,Q,A,z,M=[],j=[],B,U,r,u,I,V;T=F.settings;w=F.items().filter(":visible");P=F.layoutRect();v=T.columns||Math.ceil(Math.sqrt(w.length));S=Math.ceil(w.length/v);t=T.spacingH||T.spacing||0;p=T.spacingV||T.spacing||0;m=T.alignH||T.align;Q=T.alignV||T.align;s=F._paddingBox;I="reverseRows" in T?T.reverseRows:F.isRtl();if(m&&typeof m=="string"){m=[m]}if(Q&&typeof Q=="string"){Q=[Q]}for(K=0;K<v;K++){M.push(0)}for(J=0;J<S;J++){j.push(0)}for(J=0;J<S;J++){for(K=0;K<v;K++){O=w[J*v+K];if(!O){break}n=O.layoutRect();B=n.minW;U=n.minH;M[K]=B>M[K]?B:M[K];j[J]=U>j[J]?U:j[J]}}r=P.innerW-s.left-s.right;for(A=0,K=0;K<v;K++){A+=M[K]+(K>0?t:0);r-=(K>0?t:0)+M[K]}u=P.innerH-s.top-s.bottom;for(z=0,J=0;J<S;J++){z+=j[J]+(J>0?p:0);u-=(J>0?p:0)+j[J]}A+=s.left+s.right;z+=s.top+s.bottom;D={};D.minW=A+(P.w-P.innerW);D.minH=z+(P.h-P.innerH);D.contentW=D.minW-P.deltaW;D.contentH=D.minH-P.deltaH;D.minW=Math.min(D.minW,P.maxW);D.minH=Math.min(D.minH,P.maxH);D.minW=Math.max(D.minW,P.startMinWidth);D.minH=Math.max(D.minH,P.startMinHeight);if(P.autoResize&&(D.minW!=P.minW||D.minH!=P.minH)){D.w=D.minW;D.h=D.minH;F.layoutRect(D);this.recalc(F);if(F._lastRect===null){var C=F.parent();if(C){C._lastRect=null;C.recalc()}}return}if(P.autoResize){D=F.layoutRect(D);D.contentW=D.minW-P.deltaW;D.contentH=D.minH-P.deltaH}var E;if(T.packV=="start"){E=0}else{E=u>0?Math.floor(u/S):0}var R=0;var l=T.flexWidths;if(l){for(K=0;K<l.length;K++){R+=l[K]}}else{R=v}var L=r/R;for(K=0;K<v;K++){M[K]+=l?l[K]*L:L}G=s.top;for(J=0;J<S;J++){H=s.left;o=j[J]+E;for(K=0;K<v;K++){if(I){V=J*v+v-1-K}else{V=J*v+K}O=w[V];if(!O){break}q=O.settings;n=O.layoutRect();k=Math.max(M[K],n.startMinWidth);n.x=H;n.y=G;N=q.alignH||(m?(m[K]||m[0]):null);if(N=="center"){n.x=H+(k/2)-(n.w/2)}else{if(N=="right"){n.x=H+k-n.w}else{if(N=="stretch"){n.w=k}}}N=q.alignV||(Q?(Q[K]||Q[0]):null);if(N=="center"){n.y=G+(o/2)-(n.h/2)}else{if(N=="bottom"){n.y=G+o-n.h}else{if(N=="stretch"){n.h=o}}}O.layoutRect(n);H+=k+t;if(O.recalc){O.recalc()}}G+=o+p}}})});h("tinymce/ui/Iframe",["tinymce/ui/Widget"],function(i){return i.extend({renderHtml:function(){var j=this;j.addClass("iframe");j.canFocus=false;return('<iframe id="'+j._id+'" class="'+j.classes()+'" tabindex="-1" src="'+(j.settings.url||"javascript:''")+'" frameborder="0"></iframe>')},src:function(j){this.getEl().src=j},html:function(l,m){var k=this,j=this.getEl().contentWindow.document.body;if(!j){setTimeout(function(){k.html(l)},0)}else{j.innerHTML=l;if(m){m()}}return this}})});h("tinymce/ui/Label",["tinymce/ui/Widget","tinymce/ui/DomUtils"],function(j,i){return j.extend({init:function(l){var k=this;k._super(l);k.addClass("widget");k.addClass("label");k.canFocus=false;if(l.multiline){k.addClass("autoscroll")}if(l.strong){k.addClass("strong")}},initLayoutRect:function(){var k=this,m=k._super();if(k.settings.multiline){var l=i.getSize(k.getEl());if(l.width>m.maxW){m.minW=m.maxW;k.addClass("multiline")}k.getEl().style.width=m.minW+"px";m.startMinH=m.h=m.minH=Math.min(m.maxH,i.getSize(k.getEl()).height)}return m},repaint:function(){var k=this;if(!k.settings.multiline){k.getEl().style.lineHeight=k.layoutRect().h+"px"}return k._super()},text:function(l){var k=this;if(k._rendered&&l){this.innerHtml(k.encode(l))}return k._super(l)},renderHtml:function(){var l=this,k=l.settings.forId;return('<label id="'+l._id+'" class="'+l.classes()+'"'+(k?' for="'+k+'"':"")+">"+l.encode(l._text)+"</label>")}})});h("tinymce/ui/Toolbar",["tinymce/ui/Container"],function(i){return i.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(k){var j=this;j._super(k);j.addClass("toolbar")},postRender:function(){var j=this;j.items().addClass("toolbar-item");return j._super()}})});h("tinymce/ui/MenuBar",["tinymce/ui/Toolbar"],function(i){return i.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:true,defaults:{type:"menubutton"}}})});h("tinymce/ui/MenuButton",["tinymce/ui/Button","tinymce/ui/Factory","tinymce/ui/MenuBar"],function(l,j,k){function i(o,n){while(o){if(n===o){return true}o=o.parentNode}return false}var m=l.extend({init:function(o){var n=this;n._renderOpen=true;n._super(o);n.addClass("menubtn");if(o.fixedWidth){n.addClass("fixed-width")}n.aria("haspopup",true);n.hasPopup=true},showMenu:function(){var n=this,o=n.settings,p;if(n.menu&&n.menu.visible()){return n.hideMenu()}if(!n.menu){p=o.menu||[];if(p.length){p={type:"menu",items:p}}else{p.type=p.type||"menu"}n.menu=j.create(p).parent(n).renderTo();n.fire("createmenu");n.menu.reflow();n.menu.on("cancel",function(q){if(q.control.parent()===n.menu){q.stopPropagation();n.focus();n.hideMenu()}});n.menu.on("select",function(){n.focus()});n.menu.on("show hide",function(q){if(q.control==n.menu){n.activeMenu(q.type=="show")}n.aria("expanded",q.type=="show")}).fire("show")}n.menu.show();n.menu.layoutRect({w:n.layoutRect().w});n.menu.moveRel(n.getEl(),n.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},hideMenu:function(){var n=this;if(n.menu){n.menu.items().each(function(o){if(o.hideMenu){o.hideMenu()}});n.menu.hide()}},activeMenu:function(n){this.toggleClass("active",n)},renderHtml:function(){var n=this,r=n._id,p=n.classPrefix;var o=n.settings.icon,q;q=n.settings.image;if(q){o="none";if(typeof q!="string"){q=window.getSelection?q[0]:q[1]}q=" style=\"background-image: url('"+q+"')\""}else{q=""}o=n.settings.icon?p+"ico "+p+"i-"+o:"";n.aria("role",n.parent() instanceof k?"menuitem":"button");return('<div id="'+r+'" class="'+n.classes()+'" tabindex="-1" aria-labelledby="'+r+'"><button id="'+r+'-open" role="presentation" type="button" tabindex="-1">'+(o?'<i class="'+o+'"'+q+"></i>":"")+"<span>"+(n._text?(o?"\u00a0":"")+n.encode(n._text):"")+'</span> <i class="'+p+'caret"></i></button></div>')},postRender:function(){var n=this;n.on("click",function(o){if(o.control===n&&i(o.target,n.getEl())){n.showMenu();if(o.aria){n.menu.items()[0].focus()}}});n.on("mouseenter",function(r){var o=r.control,q=n.parent(),p;if(o&&q&&o instanceof m&&o.parent()==q){q.items().filter("MenuButton").each(function(s){if(s.hideMenu&&s!=o){if(s.menu&&s.menu.visible()){p=true}s.hideMenu()}});if(p){o.focus();o.showMenu()}}});return n._super()},text:function(q){var n=this,p,o;if(n._rendered){o=n.getEl("open").getElementsByTagName("span");for(p=0;p<o.length;p++){o[p].innerHTML=(n.settings.icon&&q?"\u00a0":"")+n.encode(q)}}return this._super(q)},remove:function(){this._super();if(this.menu){this.menu.remove()}}});return m});h("tinymce/ui/ListBox",["tinymce/ui/MenuButton"],function(i){return i.extend({init:function(n){var l=this,k,m,p,j;function o(q){for(var r=0;r<q.length;r++){m=q[r].selected||n.value===q[r].value;if(m){p=p||q[r].text;l._value=q[r].value;break}if(q[r].menu){o(q[r].menu)}}}l._values=k=n.values;if(k){o(k);if(!m&&k.length>0){p=k[0].text;l._value=k[0].value}n.menu=k}n.text=n.text||p||k[0].text;l._super(n);l.addClass("listbox");l.on("select",function(r){var q=r.control;if(j){r.lastControl=j}if(n.multiple){q.active(!q.active())}else{l.value(r.control.settings.value)}j=q})},value:function(l){var j=this,m,p,o;function n(r,q){r.items().each(function(s){m=s.value()===q;if(m){p=p||s.text()}s.active(m);if(s.menu){n(s.menu,q)}})}function k(q){for(var r=0;r<q.length;r++){m=q[r].value==l;if(m){p=p||q[r].text}q[r].active=m;if(q[r].menu){k(q[r].menu)}}}if(typeof l!="undefined"){if(j.menu){n(j.menu,l)}else{o=j.settings.menu;k(o)}j.text(p||this.settings.text)}return j._super(l)}})});h("tinymce/ui/MenuItem",["tinymce/ui/Widget","tinymce/ui/Factory","tinymce/Env"],function(k,i,j){return k.extend({Defaults:{border:0,role:"menuitem"},init:function(m){var l=this;l.hasPopup=true;l._super(m);m=l.settings;l.addClass("menu-item");if(m.menu){l.addClass("menu-item-expand")}if(m.preview){l.addClass("menu-item-preview")}if(l._text==="-"||l._text==="|"){l.addClass("menu-item-sep");l.aria("role","separator");l._text="-"}if(m.selectable){l.aria("role","menuitemcheckbox");l.addClass("menu-item-checkbox");m.icon="selected"}if(!m.preview&&!m.selectable){l.addClass("menu-item-normal")}l.on("mousedown",function(n){n.preventDefault()});if(m.menu&&!m.ariaHideMenu){l.aria("haspopup",true)}},hasMenus:function(){return !!this.settings.menu},showMenu:function(){var m=this,o=m.settings,p,n=m.parent();n.items().each(function(q){if(q!==m){q.hideMenu()}});if(o.menu){p=m.menu;if(!p){p=o.menu;if(p.length){p={type:"menu",items:p}}else{p.type=p.type||"menu"}if(n.settings.itemDefaults){p.itemDefaults=n.settings.itemDefaults}p=m.menu=i.create(p).parent(m).renderTo();p.reflow();p.on("cancel",function(q){q.stopPropagation();m.focus();p.hide()});p.on("show hide",function(q){q.control.items().each(function(r){r.active(r.settings.selected)})}).fire("show");p.on("hide",function(q){if(q.control===p){m.removeClass("selected")}});p.submenu=true}else{p.show()}p._parentMenu=n;p.addClass("menu-sub");var l=p.testMoveRel(m.getEl(),m.isRtl()?["tl-tr","bl-br","tr-tl","br-bl"]:["tr-tl","br-bl","tl-tr","bl-br"]);p.moveRel(m.getEl(),l);p.rel=l;l="menu-sub-"+l;p.removeClass(p._lastRel);p.addClass(l);p._lastRel=l;m.addClass("selected");m.aria("expanded",true)}},hideMenu:function(){var l=this;if(l.menu){l.menu.items().each(function(m){if(m.hideMenu){m.hideMenu()}});l.menu.hide();l.aria("expanded",false)}return l},renderHtml:function(){var t=this,l=t._id,o=t.settings,q=t.classPrefix,s=t.encode(t._text);var r=t.settings.icon,n="",p=o.shortcut;function m(u){var w,x,v={};if(j.mac){v={alt:"&#x2325;",ctrl:"&#x2318;",shift:"&#x21E7;",meta:"&#x2318;"}}else{v={meta:"Ctrl"}}u=u.split("+");for(w=0;w<u.length;w++){x=v[u[w].toLowerCase()];if(x){u[w]=x}}return u.join("+")}if(r){t.parent().addClass("menu-has-icons")}if(o.image){r="none";n=" style=\"background-image: url('"+o.image+"')\""}if(p){p=m(p)}r=q+"ico "+q+"i-"+(t.settings.icon||"none");return('<div id="'+l+'" class="'+t.classes()+'" tabindex="-1">'+(s!=="-"?'<i class="'+r+'"'+n+"></i>\u00a0":"")+(s!=="-"?'<span id="'+l+'-text" class="'+q+'text">'+s+"</span>":"")+(p?'<div id="'+l+'-shortcut" class="'+q+'menu-shortcut">'+p+"</div>":"")+(o.menu?'<div class="'+q+'caret"></div>':"")+"</div>")},postRender:function(){var m=this,n=m.settings;var o=n.textStyle;if(typeof o=="function"){o=o.call(this)}if(o){var l=m.getEl("text");if(l){l.setAttribute("style",o)}}m.on("mouseenter click",function(p){if(p.control===m){if(!n.menu&&p.type==="click"){m.fire("select");m.parent().hideAll()}else{m.showMenu();if(p.aria){m.menu.focus(true)}}}});m._super();return m},active:function(l){if(typeof l!="undefined"){this.aria("checked",l)}return this._super(l)},remove:function(){this._super();if(this.menu){this.menu.remove()}}})});h("tinymce/ui/Menu",["tinymce/ui/FloatPanel","tinymce/ui/MenuItem","tinymce/util/Tools"],function(l,k,i){var j=l.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:true},init:function(p){var n=this;p.autohide=true;p.constrainToViewport=true;if(p.itemDefaults){var m=p.items,o=m.length;while(o--){m[o]=i.extend({},p.itemDefaults,m[o])}}n._super(p);n.addClass("menu")},repaint:function(){this.toggleClass("menu-align",true);this._super();this.getEl().style.height="";this.getEl("body").style.height="";return this},cancel:function(){var m=this;m.hideAll();m.fire("select")},hideAll:function(){var m=this;this.find("menuitem").exec("hideMenu");return m._super()},preRender:function(){var m=this;m.items().each(function(o){var n=o.settings;if(n.icon||n.selectable){m._hasIcons=true;return false}});return m._super()}});return j});h("tinymce/ui/Radio",["tinymce/ui/Checkbox"],function(i){return i.extend({Defaults:{classes:"radio",role:"radio"}})});h("tinymce/ui/ResizeHandle",["tinymce/ui/Widget","tinymce/ui/DragHelper"],function(j,i){return j.extend({renderHtml:function(){var k=this,l=k.classPrefix;k.addClass("resizehandle");if(k.settings.direction=="both"){k.addClass("resizehandle-both")}k.canFocus=false;return('<div id="'+k._id+'" class="'+k.classes()+'"><i class="'+l+"ico "+l+'i-resize"></i></div>')},postRender:function(){var k=this;k._super();k.resizeDragHelper=new i(this._id,{start:function(){k.fire("ResizeStart")},drag:function(l){if(k.settings.direction!="both"){l.deltaX=0}k.fire("Resize",l)},stop:function(){k.fire("ResizeEnd")}})},remove:function(){if(this.resizeDragHelper){this.resizeDragHelper.destroy()}return this._super()}})});h("tinymce/ui/Spacer",["tinymce/ui/Widget"],function(i){return i.extend({renderHtml:function(){var j=this;j.addClass("spacer");j.canFocus=false;return'<div id="'+j._id+'" class="'+j.classes()+'"></div>'}})});h("tinymce/ui/SplitButton",["tinymce/ui/MenuButton","tinymce/ui/DomUtils"],function(j,i){return j.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var k=this,o=k.getEl(),m=k.layoutRect(),l,n;k._super();l=o.firstChild;n=o.lastChild;i.css(l,{width:m.w-i.getSize(n).width,height:m.h-2});i.css(n,{height:m.h-2});return k},activeMenu:function(l){var k=this;i.toggleClass(k.getEl().lastChild,k.classPrefix+"active",l)},renderHtml:function(){var k=this,o=k._id,m=k.classPrefix,n;var l=k.settings.icon;n=k.settings.image;if(n){l="none";if(typeof n!="string"){n=window.getSelection?n[0]:n[1]}n=" style=\"background-image: url('"+n+"')\""}else{n=""}l=k.settings.icon?m+"ico "+m+"i-"+l:"";return('<div id="'+o+'" class="'+k.classes()+'" role="button" tabindex="-1"><button type="button" hidefocus="1" tabindex="-1">'+(l?'<i class="'+l+'"'+n+"></i>":"")+(k._text?(l?" ":"")+k._text:"")+'</button><button type="button" class="'+m+'open" hidefocus="1" tabindex="-1">'+(k._menuBtnText?(l?"\u00a0":"")+k._menuBtnText:"")+' <i class="'+m+'caret"></i></button></div>')},postRender:function(){var k=this,l=k.settings.onclick;k.on("click",function(n){var m=n.target;if(n.control==this){while(m){if((n.aria&&n.aria.key!="down")||(m.nodeName=="BUTTON"&&m.className.indexOf("open")==-1)){n.stopImmediatePropagation();l.call(this,n);return}m=m.parentNode}}});delete k.settings.onclick;return k._super()}})});h("tinymce/ui/StackLayout",["tinymce/ui/FlowLayout"],function(i){return i.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"}})});h("tinymce/ui/TabPanel",["tinymce/ui/Panel","tinymce/ui/DomUtils"],function(j,i){return j.extend({Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(k){var l;if(this.activeTabId){l=this.getEl(this.activeTabId);i.removeClass(l,this.classPrefix+"active");l.setAttribute("aria-selected","false")}this.activeTabId="t"+k;l=this.getEl("t"+k);l.setAttribute("aria-selected","true");i.addClass(l,this.classPrefix+"active");this.items()[k].show().fire("showtab");this.reflow();this.items().each(function(n,m){if(k!=m){n.hide()}})},renderHtml:function(){var l=this,m=l._layout,k="",n=l.classPrefix;l.preRender();m.preRender(l);l.items().each(function(p,o){var q=l._id+"-t"+o;p.aria("role","tabpanel");p.aria("labelledby",q);k+=('<div id="'+q+'" class="'+n+'tab" unselectable="on" role="tab" aria-controls="'+p._id+'" aria-selected="false" tabIndex="-1">'+l.encode(p.settings.title)+"</div>")});return('<div id="'+l._id+'" class="'+l.classes()+'" hidefocus="1" tabindex="-1"><div id="'+l._id+'-head" class="'+n+'tabs" role="tablist">'+k+'</div><div id="'+l._id+'-body" class="'+l.classes("body")+'">'+m.renderHtml(l)+"</div></div>")},postRender:function(){var k=this;k._super();k.settings.activeTab=k.settings.activeTab||0;k.activateTab(k.settings.activeTab);this.on("click",function(n){var m=n.target.parentNode;if(n.target.parentNode.id==k._id+"-head"){var l=m.childNodes.length;while(l--){if(m.childNodes[l]==n.target){k.activateTab(l)}}}})},initLayoutRect:function(){var l=this,o,k,n;k=i.getSize(l.getEl("head")).width;k=k<0?0:k;n=0;l.items().each(function(p){k=Math.max(k,p.layoutRect().minW);n=Math.max(n,p.layoutRect().minH)});l.items().each(function(p){p.settings.x=0;p.settings.y=0;p.settings.w=k;p.settings.h=n;p.layoutRect({x:0,y:0,w:k,h:n})});var m=i.getSize(l.getEl("head")).height;l.settings.minWidth=k;l.settings.minHeight=n+m;o=l._super();o.deltaH+=m;o.innerH=o.h-o.deltaH;return o}})});h("tinymce/ui/TextBox",["tinymce/ui/Widget","tinymce/ui/DomUtils"],function(j,i){return j.extend({init:function(l){var k=this;k._super(l);k._value=l.value||"";k.addClass("textbox");if(l.multiline){k.addClass("multiline")}else{k.on("keydown",function(m){if(m.keyCode==13){k.parents().reverse().each(function(n){m.preventDefault();if(n.hasEventListeners("submit")&&n.toJSON){n.fire("submit",{data:n.toJSON()});return false}})}})}},disabled:function(l){var k=this;if(k._rendered&&typeof l!="undefined"){k.getEl().disabled=l}return k._super(l)},value:function(l){var k=this;if(typeof l!="undefined"){k._value=l;if(k._rendered){k.getEl().value=l}return k}if(k._rendered){return k.getEl().value}return k._value},repaint:function(){var l=this,n,o,r,m=0,p=0,k;n=l.getEl().style;o=l._layoutRect;k=l._lastRepaintRect||{};var q=document;if(!l.settings.multiline&&q.all&&(!q.documentMode||q.documentMode<=8)){n.lineHeight=(o.h-p)+"px"}r=l._borderBox;m=r.left+r.right+8;p=r.top+r.bottom+(l.settings.multiline?8:0);if(o.x!==k.x){n.left=o.x+"px";k.x=o.x}if(o.y!==k.y){n.top=o.y+"px";k.y=o.y}if(o.w!==k.w){n.width=(o.w-m)+"px";k.w=o.w}if(o.h!==k.h){n.height=(o.h-p)+"px";k.h=o.h}l._lastRepaintRect=k;l.fire("repaint",{},false);return l},renderHtml:function(){var k=this,o=k._id,l=k.settings,n=k.encode(k._value,false),m="";if("spellcheck" in l){m+=' spellcheck="'+l.spellcheck+'"'}if(l.maxLength){m+=' maxlength="'+l.maxLength+'"'}if(l.size){m+=' size="'+l.size+'"'}if(l.subtype){m+=' type="'+l.subtype+'"'}if(k.disabled()){m+=' disabled="disabled"'}if(l.multiline){return('<textarea id="'+o+'" class="'+k.classes()+'" '+(l.rows?' rows="'+l.rows+'"':"")+' hidefocus="1"'+m+">"+n+"</textarea>")}return'<input id="'+o+'" class="'+k.classes()+'" value="'+n+'" hidefocus="1"'+m+" />"},postRender:function(){var k=this;i.on(k.getEl(),"change",function(l){k.fire("change",l)});return k._super()},remove:function(){i.off(this.getEl());this._super()}})});h("tinymce/ui/Throbber",["tinymce/ui/DomUtils","tinymce/ui/Control"],function(i,j){return function(o,n){var l=this,m,k=j.classPrefix;l.show=function(p){l.hide();m=true;window.setTimeout(function(){if(m){o.appendChild(i.createFragment('<div class="'+k+"throbber"+(n?" "+k+"throbber-inline":"")+'"></div>'))}},p||0);return l};l.hide=function(){var p=o.lastChild;if(p&&p.className.indexOf("throbber")!=-1){p.parentNode.removeChild(p)}m=false;return l}}});a(["tinymce/dom/EventUtils","tinymce/dom/Sizzle","tinymce/Env","tinymce/util/Tools","tinymce/dom/DomQuery","tinymce/html/Styles","tinymce/dom/TreeWalker","tinymce/dom/Range","tinymce/html/Entities","tinymce/dom/DOMUtils","tinymce/dom/ScriptLoader","tinymce/AddOnManager","tinymce/dom/RangeUtils","tinymce/html/Node","tinymce/html/Schema","tinymce/html/SaxParser","tinymce/html/DomParser","tinymce/html/Writer","tinymce/html/Serializer","tinymce/dom/Serializer","tinymce/dom/TridentSelection","tinymce/util/VK","tinymce/dom/ControlSelection","tinymce/dom/BookmarkManager","tinymce/dom/Selection","tinymce/dom/ElementUtils","tinymce/Formatter","tinymce/UndoManager","tinymce/EnterKey","tinymce/ForceBlocks","tinymce/EditorCommands","tinymce/util/URI","tinymce/util/Class","tinymce/util/EventDispatcher","tinymce/ui/Selector","tinymce/ui/Collection","tinymce/ui/DomUtils","tinymce/ui/Control","tinymce/ui/Factory","tinymce/ui/KeyboardNavigation","tinymce/ui/Container","tinymce/ui/DragHelper","tinymce/ui/Scrollable","tinymce/ui/Panel","tinymce/ui/Movable","tinymce/ui/Resizable","tinymce/ui/FloatPanel","tinymce/ui/Window","tinymce/ui/MessageBox","tinymce/WindowManager","tinymce/util/Quirks","tinymce/util/Observable","tinymce/EditorObservable","tinymce/Shortcuts","tinymce/Editor","tinymce/util/I18n","tinymce/FocusManager","tinymce/EditorManager","tinymce/LegacyInput","tinymce/util/XHR","tinymce/util/JSON","tinymce/util/JSONRequest","tinymce/util/JSONP","tinymce/util/LocalStorage","tinymce/Compat","tinymce/ui/Layout","tinymce/ui/AbsoluteLayout","tinymce/ui/Tooltip","tinymce/ui/Widget","tinymce/ui/Button","tinymce/ui/ButtonGroup","tinymce/ui/Checkbox","tinymce/ui/ComboBox","tinymce/ui/ColorBox","tinymce/ui/PanelButton","tinymce/ui/ColorButton","tinymce/util/Color","tinymce/ui/ColorPicker","tinymce/ui/Path","tinymce/ui/ElementPath","tinymce/ui/FormItem","tinymce/ui/Form","tinymce/ui/FieldSet","tinymce/ui/FilePicker","tinymce/ui/FitLayout","tinymce/ui/FlexLayout","tinymce/ui/FlowLayout","tinymce/ui/FormatControls","tinymce/ui/GridLayout","tinymce/ui/Iframe","tinymce/ui/Label","tinymce/ui/Toolbar","tinymce/ui/MenuBar","tinymce/ui/MenuButton","tinymce/ui/ListBox","tinymce/ui/MenuItem","tinymce/ui/Menu","tinymce/ui/Radio","tinymce/ui/ResizeHandle","tinymce/ui/Spacer","tinymce/ui/SplitButton","tinymce/ui/StackLayout","tinymce/ui/TabPanel","tinymce/ui/TextBox","tinymce/ui/Throbber"])})(this);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/jquery.tinymce.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+!function(a){function b(){function b(a){"remove"===a&&this.each(function(a,b){var c=e(b);c&&c.remove()}),this.find("span.mceEditor,div.mceEditor").each(function(a,b){var c=tinymce.get(b.id.replace(/_parent$/,""));c&&c.remove()})}function d(a){var c,d=this;if(null!=a)b.call(d),d.each(function(b,c){var d;(d=tinymce.get(c.id))&&d.setContent(a)});else if(d.length>0&&(c=tinymce.get(d[0].id)))return c.getContent()}function e(a){var b=null;return a&&a.id&&g.tinymce&&(b=tinymce.get(a.id)),b}function f(a){return!!(a&&a.length&&g.tinymce&&a.is(":tinymce"))}var h={};a.each(["text","html","val"],function(b,g){var i=h[g]=a.fn[g],j="text"===g;a.fn[g]=function(b){var g=this;if(!f(g))return i.apply(g,arguments);if(b!==c)return d.call(g.filter(":tinymce"),b),i.apply(g.not(":tinymce"),arguments),g;var h="",k=arguments;return(j?g:g.eq(0)).each(function(b,c){var d=e(c);h+=d?j?d.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):d.getContent({save:!0}):i.apply(a(c),k)}),h}}),a.each(["append","prepend"],function(b,d){var g=h[d]=a.fn[d],i="prepend"===d;a.fn[d]=function(a){var b=this;return f(b)?a!==c?("string"==typeof a&&b.filter(":tinymce").each(function(b,c){var d=e(c);d&&d.setContent(i?a+d.getContent():d.getContent()+a)}),g.apply(b.not(":tinymce"),arguments),b):void 0:g.apply(b,arguments)}}),a.each(["remove","replaceWith","replaceAll","empty"],function(c,d){var e=h[d]=a.fn[d];a.fn[d]=function(){return b.call(this,d),e.apply(this,arguments)}}),h.attr=a.fn.attr,a.fn.attr=function(b,g){var i=this,j=arguments;if(!b||"value"!==b||!f(i))return g!==c?h.attr.apply(i,j):h.attr.apply(i,j);if(g!==c)return d.call(i.filter(":tinymce"),g),h.attr.apply(i.not(":tinymce"),j),i;var k=i[0],l=e(k);return l?l.getContent({save:!0}):h.attr.apply(a(k),j)}}var c,d,e,f=[],g=window;a.fn.tinymce=function(c){function h(){var d=[],f=0;e||(b(),e=!0),l.each(function(a,b){var e,g=b.id,h=c.oninit;g||(b.id=g=tinymce.DOM.uniqueId()),tinymce.get(g)||(e=new tinymce.Editor(g,c,tinymce.EditorManager),d.push(e),e.on("init",function(){var a,b=h;l.css("visibility",""),h&&++f==d.length&&("string"==typeof b&&(a=-1===b.indexOf(".")?null:tinymce.resolve(b.replace(/\.\w+$/,"")),b=tinymce.resolve(b)),b.apply(a||tinymce,d))}))}),a.each(d,function(a,b){b.render()})}var i,j,k,l=this,m="";if(!l.length)return l;if(!c)return window.tinymce?tinymce.get(l[0].id):null;if(l.css("visibility","hidden"),g.tinymce||d||!(i=c.script_url))1===d?f.push(h):h();else{d=1,j=i.substring(0,i.lastIndexOf("/")),-1!=i.indexOf(".min")&&(m=".min"),g.tinymce=g.tinyMCEPreInit||{base:j,suffix:m},-1!=i.indexOf("gzip")&&(k=c.language||"en",i=i+(/\?/.test(i)?"&":"?")+"js=true&core=true&suffix="+escape(m)+"&themes="+escape(c.theme||"modern")+"&plugins="+escape(c.plugins||"")+"&languages="+(k||""),g.tinyMCE_GZ||(g.tinyMCE_GZ={start:function(){function b(a){tinymce.ScriptLoader.markDone(tinymce.baseURI.toAbsolute(a))}b("langs/"+k+".js"),b("themes/"+c.theme+"/theme"+m+".js"),b("themes/"+c.theme+"/langs/"+k+".js"),a.each(c.plugins.split(","),function(a,c){c&&(b("plugins/"+c+"/plugin"+m+".js"),b("plugins/"+c+"/langs/"+k+".js"))})},end:function(){}}));var n=document.createElement("script");n.type="text/javascript",n.onload=n.onreadystatechange=function(b){b=b||window.event,2===d||"load"!=b.type&&!/complete|loaded/.test(n.readyState)||(tinymce.dom.Event.domLoaded=1,d=2,c.script_loaded&&c.script_loaded(),h(),a.each(f,function(a,b){b()}))},n.src=i,document.body.appendChild(n)}return l},a.extend(a.expr[":"],{tinymce:function(a){var b;return a.id&&"tinymce"in window&&(b=tinymce.get(a.id),b&&b.editorManager===tinymce)?!0:!1}})}(jQuery);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/langs/fr.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,200 @@
+tinymce.addI18n('fr',{
+"Cut": "Couper",
+"Heading 5": "En-t\u00eate 5",
+"Header 2": "Titre 2",
+"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "Votre navigateur ne supporte pas la copie directe. Merci d'utiliser les touches Ctrl+X\/C\/V.",
+"Heading 4": "En-t\u00eate 4",
+"Div": "Div",
+"Heading 2": "En-t\u00eate 2",
+"Paste": "Coller",
+"Close": "Fermer",
+"Font Family": "Police",
+"Pre": "Pre",
+"Align right": "Aligner \u00e0 droite",
+"New document": "Nouveau document",
+"Blockquote": "Citation",
+"Numbered list": "Num\u00e9rotation",
+"Heading 1": "En-t\u00eate 1",
+"Headings": "En-t\u00eates",
+"Increase indent": "Augmenter le retrait",
+"Formats": "Formats",
+"Headers": "Titres",
+"Select all": "Tout s\u00e9lectionner",
+"Header 3": "Titre 3",
+"Blocks": "Blocs",
+"Undo": "Annuler",
+"Strikethrough": "Barr\u00e9",
+"Bullet list": "Puces",
+"Header 1": "Titre 1",
+"Superscript": "Exposant",
+"Clear formatting": "Effacer la mise en forme",
+"Font Sizes": "Taille de police",
+"Subscript": "Indice",
+"Header 6": "Titre 6",
+"Redo": "R\u00e9tablir",
+"Paragraph": "Paragraphe",
+"Ok": "Ok",
+"Bold": "Gras",
+"Code": "Code",
+"Italic": "Italique",
+"Align center": "Centrer",
+"Header 5": "Titre 5",
+"Heading 6": "En-t\u00eate 6",
+"Heading 3": "En-t\u00eate 3",
+"Decrease indent": "Diminuer le retrait",
+"Header 4": "Titre 4",
+"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "Le presse-papiers est maintenant en mode \"texte plein\". Les contenus seront coll\u00e9s sans retenir les formatages jusqu'\u00e0 ce que vous d\u00e9sactiviez cette option.",
+"Underline": "Soulign\u00e9",
+"Cancel": "Annuler",
+"Justify": "Justifier",
+"Inline": "En ligne",
+"Copy": "Copier",
+"Align left": "Aligner \u00e0 gauche",
+"Visual aids": "Aides visuelle",
+"Lower Greek": "Grec minuscule",
+"Square": "Carr\u00e9",
+"Default": "Par d\u00e9faut",
+"Lower Alpha": "Alpha minuscule",
+"Circle": "Cercle",
+"Disc": "Disque",
+"Upper Alpha": "Alpha majuscule",
+"Upper Roman": "Romain majuscule",
+"Lower Roman": "Romain minuscule",
+"Name": "Nom",
+"Anchor": "Ancre",
+"You have unsaved changes are you sure you want to navigate away?": "Vous avez des modifications non enregistr\u00e9es, \u00eates-vous s\u00fbr de quitter la page?",
+"Restore last draft": "Restaurer le dernier brouillon",
+"Special character": "Caract\u00e8res sp\u00e9ciaux",
+"Source code": "Code source",
+"Color": "Couleur",
+"Right to left": "Droite \u00e0 gauche",
+"Left to right": "Gauche \u00e0 droite",
+"Emoticons": "Emotic\u00f4nes",
+"Robots": "Robots",
+"Document properties": "Propri\u00e9t\u00e9 du document",
+"Title": "Titre",
+"Keywords": "Mots-cl\u00e9s",
+"Encoding": "Encodage",
+"Description": "Description",
+"Author": "Auteur",
+"Fullscreen": "Plein \u00e9cran",
+"Horizontal line": "Ligne horizontale",
+"Horizontal space": "Espacement horizontal",
+"B": "B",
+"Insert\/edit image": "Ins\u00e9rer\/modifier une image",
+"General": "G\u00e9n\u00e9ral",
+"Advanced": "Avanc\u00e9",
+"G": "V",
+"R": "R",
+"Source": "Source",
+"Border": "Bordure",
+"Constrain proportions": "Conserver les proportions",
+"Vertical space": "Espacement vertical",
+"Image description": "Description de l'image",
+"Style": "Style",
+"Dimensions": "Dimensions",
+"Insert image": "Ins\u00e9rer une image",
+"Insert date\/time": "Ins\u00e9rer date\/heure",
+"Remove link": "Enlever le lien",
+"Url": "Url",
+"Text to display": "Texte \u00e0 afficher",
+"Anchors": "Ancres",
+"Insert link": "Ins\u00e9rer un lien",
+"New window": "Nouvelle fen\u00eatre",
+"None": "n\/a",
+"The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?": "L'URL que vous avez entr\u00e9e semble \u00eatre un lien externe. Voulez-vous ajouter le pr\u00e9fixe http:\/\/ n\u00e9cessaire?",
+"Target": "Cible",
+"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?": "L'URL que vous avez entr\u00e9e semble \u00eatre une adresse e-mail. Voulez-vous ajouter le pr\u00e9fixe mailto: n\u00e9cessaire?",
+"Insert\/edit link": "Ins\u00e9rer\/modifier un lien",
+"Insert\/edit video": "Ins\u00e9rer\/modifier une vid\u00e9o",
+"Poster": "Publier",
+"Alternative source": "Source alternative",
+"Paste your embed code below:": "Collez votre code d'int\u00e9gration ci-dessous :",
+"Insert video": "Ins\u00e9rer une vid\u00e9o",
+"Embed": "Int\u00e9grer",
+"Nonbreaking space": "Espace ins\u00e9cable",
+"Page break": "Saut de page",
+"Paste as text": "Coller comme texte",
+"Preview": "Pr\u00e9visualiser",
+"Print": "Imprimer",
+"Save": "Enregistrer",
+"Could not find the specified string.": "Impossible de trouver la cha\u00eene sp\u00e9cifi\u00e9e.",
+"Replace": "Remplacer",
+"Next": "Suiv",
+"Whole words": "Mots entiers",
+"Find and replace": "Trouver et remplacer",
+"Replace with": "Remplacer par",
+"Find": "Chercher",
+"Replace all": "Tout remplacer",
+"Match case": "Respecter la casse",
+"Prev": "Pr\u00e9c ",
+"Spellcheck": "V\u00e9rification orthographique",
+"Finish": "Finie",
+"Ignore all": "Tout ignorer",
+"Ignore": "Ignorer",
+"Add to Dictionary": "Ajouter au dictionnaire",
+"Insert row before": "Ins\u00e9rer une ligne avant",
+"Rows": "Lignes",
+"Height": "Hauteur",
+"Paste row after": "Coller la ligne apr\u00e8s",
+"Alignment": "Alignement",
+"Border color": "Couleur de la bordure",
+"Column group": "Groupe de colonnes",
+"Row": "Ligne",
+"Insert column before": "Ins\u00e9rer une colonne avant",
+"Split cell": "Diviser la cellule",
+"Cell padding": "Espacement interne cellule",
+"Cell spacing": "Espacement inter-cellulles",
+"Row type": "Type de ligne",
+"Insert table": "Ins\u00e9rer un tableau",
+"Body": "Corps",
+"Caption": "Titre",
+"Footer": "Pied",
+"Delete row": "Effacer la ligne",
+"Paste row before": "Coller la ligne avant",
+"Scope": "Etendue",
+"Delete table": "Supprimer le tableau",
+"H Align": "Alignement H",
+"Top": "Haut",
+"Header cell": "Cellule d'en-t\u00eate",
+"Column": "Colonne",
+"Row group": "Groupe de lignes",
+"Cell": "Cellule",
+"Middle": "Milieu",
+"Cell type": "Type de cellule",
+"Copy row": "Copier la ligne",
+"Row properties": "Propri\u00e9t\u00e9s de la ligne",
+"Table properties": "Propri\u00e9t\u00e9s du tableau",
+"Bottom": "Bas",
+"V Align": "Alignement V",
+"Header": "En-t\u00eate",
+"Right": "Droite",
+"Insert column after": "Ins\u00e9rer une colonne apr\u00e8s",
+"Cols": "Colonnes",
+"Insert row after": "Ins\u00e9rer une ligne apr\u00e8s",
+"Width": "Largeur",
+"Cell properties": "Propri\u00e9t\u00e9s de la cellule",
+"Left": "Gauche",
+"Cut row": "Couper la ligne",
+"Delete column": "Effacer la colonne",
+"Center": "Centr\u00e9",
+"Merge cells": "Fusionner les cellules",
+"Insert template": "Ajouter un th\u00e8me",
+"Templates": "Th\u00e8mes",
+"Background color": "Couleur d'arri\u00e8re-plan",
+"Custom...": "Personnalis\u00e9...",
+"Custom color": "Couleur personnalis\u00e9e",
+"No color": "Aucune couleur",
+"Text color": "Couleur du texte",
+"Show blocks": "Afficher les blocs",
+"Show invisible characters": "Afficher les caract\u00e8res invisibles",
+"Words: {0}": "Mots : {0}",
+"Insert": "Ins\u00e9rer",
+"File": "Fichier",
+"Edit": "Editer",
+"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "Zone Texte Riche. Appuyer sur ALT-F9 pour le menu. Appuyer sur ALT-F10 pour la barre d'outils. Appuyer sur ALT-0 pour de l'aide.",
+"Tools": "Outils",
+"View": "Voir",
+"Table": "Tableau",
+"Format": "Format"
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/langs/readme.md	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,3 @@
+This is where language files should be placed.
+
+Please DO NOT translate these directly use this service: https://www.transifex.com/projects/p/tinymce/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/license.txt	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,504 @@
+		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/advlist/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("advlist",function(a){function b(a,b){var c=[];return tinymce.each(b.split(/[ ,]/),function(a){c.push({text:a.replace(/\-/g," ").replace(/\b\w/g,function(a){return a.toUpperCase()}),data:"default"==a?"":a})}),c}function c(b,c){a.undoManager.transact(function(){var d,e=a.dom,f=a.selection;d=e.getParent(f.getNode(),"ol,ul"),d&&d.nodeName==b&&c!==!1||a.execCommand("UL"==b?"InsertUnorderedList":"InsertOrderedList"),c=c===!1?g[b]:c,g[b]=c,d=e.getParent(f.getNode(),"ol,ul"),d&&(e.setStyle(d,"listStyleType",c?c:null),d.removeAttribute("data-mce-style")),a.focus()})}function d(b){var c=a.dom.getStyle(a.dom.getParent(a.selection.getNode(),"ol,ul"),"listStyleType")||"";b.control.items().each(function(a){a.active(a.settings.data===c)})}var e,f,g={};e=b("OL",a.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman")),f=b("UL",a.getParam("advlist_bullet_styles","default,circle,disc,square")),a.addButton("numlist",{type:"splitbutton",tooltip:"Numbered list",menu:e,onshow:d,onselect:function(a){c("OL",a.control.settings.data)},onclick:function(){c("OL",!1)}}),a.addButton("bullist",{type:"splitbutton",tooltip:"Bullet list",menu:f,onshow:d,onselect:function(a){c("UL",a.control.settings.data)},onclick:function(){c("UL",!1)}})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/anchor/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("anchor",function(a){function b(){var b=a.selection.getNode(),c="";"A"==b.tagName&&(c=b.name||b.id||""),a.windowManager.open({title:"Anchor",body:{type:"textbox",name:"name",size:40,label:"Name",value:c},onsubmit:function(b){a.execCommand("mceInsertContent",!1,a.dom.createHTML("a",{id:b.data.name}))}})}a.addButton("anchor",{icon:"anchor",tooltip:"Anchor",onclick:b,stateSelector:"a:not([href])"}),a.addMenuItem("anchor",{icon:"anchor",text:"Anchor",context:"insert",onclick:b})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/autolink/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("autolink",function(a){function b(a){e(a,-1,"(",!0)}function c(a){e(a,0,"",!0)}function d(a){e(a,-1,"",!1)}function e(a,b,c){function d(a,b){if(0>b&&(b=0),3==a.nodeType){var c=a.data.length;b>c&&(b=c)}return b}function e(a,b){1!=a.nodeType||a.hasChildNodes()?g.setStart(a,d(a,b)):g.setStartBefore(a)}function f(a,b){1!=a.nodeType||a.hasChildNodes()?g.setEnd(a,d(a,b)):g.setEndAfter(a)}var g,h,i,j,k,l,m,n,o,p;if(g=a.selection.getRng(!0).cloneRange(),g.startOffset<5){if(n=g.endContainer.previousSibling,!n){if(!g.endContainer.firstChild||!g.endContainer.firstChild.nextSibling)return;n=g.endContainer.firstChild.nextSibling}if(o=n.length,e(n,o),f(n,o),g.endOffset<5)return;h=g.endOffset,j=n}else{if(j=g.endContainer,3!=j.nodeType&&j.firstChild){for(;3!=j.nodeType&&j.firstChild;)j=j.firstChild;3==j.nodeType&&(e(j,0),f(j,j.nodeValue.length))}h=1==g.endOffset?2:g.endOffset-1-b}i=h;do e(j,h>=2?h-2:0),f(j,h>=1?h-1:0),h-=1,p=g.toString();while(" "!=p&&""!==p&&160!=p.charCodeAt(0)&&h-2>=0&&p!=c);g.toString()==c||160==g.toString().charCodeAt(0)?(e(j,h),f(j,i),h+=1):0===g.startOffset?(e(j,0),f(j,i)):(e(j,h),f(j,i)),l=g.toString(),"."==l.charAt(l.length-1)&&f(j,i-1),l=g.toString(),m=l.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i),m&&("www."==m[1]?m[1]="http://www.":/@$/.test(m[1])&&!/^mailto:/.test(m[1])&&(m[1]="mailto:"+m[1]),k=a.selection.getBookmark(),a.selection.setRng(g),a.execCommand("createlink",!1,m[1]+m[2]),a.selection.moveToBookmark(k),a.nodeChanged())}var f;return a.on("keydown",function(b){return 13==b.keyCode?d(a):void 0}),tinymce.Env.ie?void a.on("focus",function(){if(!f){f=!0;try{a.execCommand("AutoUrlDetect",!1,!0)}catch(b){}}}):(a.on("keypress",function(c){return 41==c.keyCode?b(a):void 0}),void a.on("keyup",function(b){return 32==b.keyCode?c(a):void 0}))});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/autoresize/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("autoresize",function(a){function b(){return a.plugins.fullscreen&&a.plugins.fullscreen.isFullscreen()}function c(d){var g,h,i,j,k,l,m,n,o,p,q,r,s=tinymce.DOM;if(h=a.getDoc()){if(i=h.body,j=h.documentElement,k=e.autoresize_min_height,!i||d&&"setcontent"===d.type&&d.initial||b())return void(i&&j&&(i.style.overflowY="auto",j.style.overflowY="auto"));m=a.dom.getStyle(i,"margin-top",!0),n=a.dom.getStyle(i,"margin-bottom",!0),o=a.dom.getStyle(i,"padding-top",!0),p=a.dom.getStyle(i,"padding-bottom",!0),q=a.dom.getStyle(i,"border-top-width",!0),r=a.dom.getStyle(i,"border-bottom-width",!0),l=i.offsetHeight+parseInt(m,10)+parseInt(n,10)+parseInt(o,10)+parseInt(p,10)+parseInt(q,10)+parseInt(r,10),(isNaN(l)||0>=l)&&(l=tinymce.Env.ie?i.scrollHeight:tinymce.Env.webkit&&0===i.clientHeight?0:i.offsetHeight),l>e.autoresize_min_height&&(k=l),e.autoresize_max_height&&l>e.autoresize_max_height?(k=e.autoresize_max_height,i.style.overflowY="auto",j.style.overflowY="auto"):(i.style.overflowY="hidden",j.style.overflowY="hidden",i.scrollTop=0),k!==f&&(g=k-f,s.setStyle(a.iframeElement,"height",k+"px"),f=k,tinymce.isWebKit&&0>g&&c(d))}}function d(a,b,e){setTimeout(function(){c({}),a--?d(a,b,e):e&&e()},b)}var e=a.settings,f=0;a.settings.inline||(e.autoresize_min_height=parseInt(a.getParam("autoresize_min_height",a.getElement().offsetHeight),10),e.autoresize_max_height=parseInt(a.getParam("autoresize_max_height",0),10),a.on("init",function(){var b,c;b=a.getParam("autoresize_overflow_padding",1),c=a.getParam("autoresize_bottom_margin",50),b!==!1&&a.dom.setStyles(a.getBody(),{paddingLeft:b,paddingRight:b}),c!==!1&&a.dom.setStyles(a.getBody(),{paddingBottom:c})}),a.on("nodechange setcontent keyup FullscreenStateChanged",c),a.getParam("autoresize_on_init",!0)&&a.on("init",function(){d(20,100,function(){d(5,1e3)})}),a.addCommand("mceAutoResize",c))});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/autosave/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce._beforeUnloadHandler=function(){var a;return tinymce.each(tinymce.editors,function(b){b.plugins.autosave&&b.plugins.autosave.storeDraft(),!a&&b.isDirty()&&b.getParam("autosave_ask_before_unload",!0)&&(a=b.translate("You have unsaved changes are you sure you want to navigate away?"))}),a},tinymce.PluginManager.add("autosave",function(a){function b(a,b){var c={s:1e3,m:6e4};return a=/^(\d+)([ms]?)$/.exec(""+(a||b)),(a[2]?c[a[2]]:1)*parseInt(a,10)}function c(){var a=parseInt(n.getItem(k+"time"),10)||0;return(new Date).getTime()-a>m.autosave_retention?(d(!1),!1):!0}function d(b){n.removeItem(k+"draft"),n.removeItem(k+"time"),b!==!1&&a.fire("RemoveDraft")}function e(){!j()&&a.isDirty()&&(n.setItem(k+"draft",a.getContent({format:"raw",no_events:!0})),n.setItem(k+"time",(new Date).getTime()),a.fire("StoreDraft"))}function f(){c()&&(a.setContent(n.getItem(k+"draft"),{format:"raw"}),a.fire("RestoreDraft"))}function g(){l||(setInterval(function(){a.removed||e()},m.autosave_interval),l=!0)}function h(){var b=this;b.disabled(!c()),a.on("StoreDraft RestoreDraft RemoveDraft",function(){b.disabled(!c())}),g()}function i(){a.undoManager.beforeChange(),f(),d(),a.undoManager.add()}function j(b){var c=a.settings.forced_root_block;return b=tinymce.trim("undefined"==typeof b?a.getBody().innerHTML:b),""===b||new RegExp("^<"+c+"[^>]*>((\xa0|&nbsp;|[ 	]|<br[^>]*>)+?|)</"+c+">|<br>$","i").test(b)}var k,l,m=a.settings,n=tinymce.util.LocalStorage;k=m.autosave_prefix||"tinymce-autosave-{path}{query}-{id}-",k=k.replace(/\{path\}/g,document.location.pathname),k=k.replace(/\{query\}/g,document.location.search),k=k.replace(/\{id\}/g,a.id),m.autosave_interval=b(m.autosave_interval,"30s"),m.autosave_retention=b(m.autosave_retention,"20m"),a.addButton("restoredraft",{title:"Restore last draft",onclick:i,onPostRender:h}),a.addMenuItem("restoredraft",{text:"Restore last draft",onclick:i,onPostRender:h,context:"file"}),a.settings.autosave_restore_when_empty!==!1&&(a.on("init",function(){c()&&j()&&f()}),a.on("saveContent",function(){d()})),window.onbeforeunload=tinymce._beforeUnloadHandler,this.hasDraft=c,this.storeDraft=e,this.restoreDraft=f,this.removeDraft=d,this.isEmpty=j});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/bbcode/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+!function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(a){var b=this,c=a.getParam("bbcode_dialect","punbb").toLowerCase();a.on("beforeSetContent",function(a){a.content=b["_"+c+"_bbcode2html"](a.content)}),a.on("postProcess",function(a){a.set&&(a.content=b["_"+c+"_bbcode2html"](a.content)),a.get&&(a.content=b["_"+c+"_html2bbcode"](a.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(a){function b(b,c){a=a.replace(b,c)}return a=tinymce.trim(a),b(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"),b(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),b(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),b(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),b(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),b(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]"),b(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]"),b(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]"),b(/<font>(.*?)<\/font>/gi,"$1"),b(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]"),b(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]"),b(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]"),b(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),b(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),b(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),b(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),b(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),b(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"),b(/<\/(strong|b)>/gi,"[/b]"),b(/<(strong|b)>/gi,"[b]"),b(/<\/(em|i)>/gi,"[/i]"),b(/<(em|i)>/gi,"[i]"),b(/<\/u>/gi,"[/u]"),b(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]"),b(/<u>/gi,"[u]"),b(/<blockquote[^>]*>/gi,"[quote]"),b(/<\/blockquote>/gi,"[/quote]"),b(/<br \/>/gi,"\n"),b(/<br\/>/gi,"\n"),b(/<br>/gi,"\n"),b(/<p>/gi,""),b(/<\/p>/gi,"\n"),b(/&nbsp;|\u00a0/gi," "),b(/&quot;/gi,'"'),b(/&lt;/gi,"<"),b(/&gt;/gi,">"),b(/&amp;/gi,"&"),a},_punbb_bbcode2html:function(a){function b(b,c){a=a.replace(b,c)}return a=tinymce.trim(a),b(/\n/gi,"<br />"),b(/\[b\]/gi,"<strong>"),b(/\[\/b\]/gi,"</strong>"),b(/\[i\]/gi,"<em>"),b(/\[\/i\]/gi,"</em>"),b(/\[u\]/gi,"<u>"),b(/\[\/u\]/gi,"</u>"),b(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>'),b(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>'),b(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />'),b(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>'),b(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span>&nbsp;'),b(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span>&nbsp;'),a}}),tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)}();
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/charmap/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("charmap",function(a){function b(){function b(a){for(;a;){if("TD"==a.nodeName)return a;a=a.parentNode}}var d,e,f,g;d='<table role="presentation" cellspacing="0" class="mce-charmap"><tbody>';var h=25,i=Math.ceil(c.length/h);for(f=0;i>f;f++){for(d+="<tr>",e=0;h>e;e++){var j=f*h+e;if(j<c.length){var k=c[j];d+='<td title="'+k[1]+'"><div tabindex="-1" title="'+k[1]+'" role="button">'+(k?String.fromCharCode(parseInt(k[0],10)):"&nbsp;")+"</div></td>"}else d+="<td />"}d+="</tr>"}d+="</tbody></table>";var l={type:"container",html:d,onclick:function(c){var d=c.target;/^(TD|DIV)$/.test(d.nodeName)&&b(d).firstChild&&(a.execCommand("mceInsertContent",!1,tinymce.trim(d.innerText||d.textContent)),c.ctrlKey||g.close())},onmouseover:function(a){var c=b(a.target);c&&c.firstChild?(g.find("#preview").text(c.firstChild.firstChild.data),g.find("#previewTitle").text(c.title)):(g.find("#preview").text(" "),g.find("#previewTitle").text(" "))}};g=a.windowManager.open({title:"Special character",spacing:10,padding:10,items:[l,{type:"container",layout:"flex",direction:"column",align:"center",spacing:5,minWidth:160,minHeight:160,items:[{type:"label",name:"preview",text:" ",style:"font-size: 40px; text-align: center",border:1,minWidth:140,minHeight:80},{type:"label",name:"previewTitle",text:" ",style:"text-align: center",border:1,minWidth:140,minHeight:80}]}],buttons:[{text:"Close",onclick:function(){g.close()}}]})}var c=[["160","no-break space"],["173","soft hyphen"],["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"]];a.addButton("charmap",{icon:"charmap",tooltip:"Special character",onclick:b}),a.addMenuItem("charmap",{icon:"charmap",text:"Special character",onclick:b,context:"insert"})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/code/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("code",function(a){function b(){var b=a.windowManager.open({title:"Source code",body:{type:"textbox",name:"code",multiline:!0,minWidth:a.getParam("code_dialog_width",600),minHeight:a.getParam("code_dialog_height",Math.min(tinymce.DOM.getViewPort().h-200,500)),spellcheck:!1,style:"direction: ltr; text-align: left"},onSubmit:function(b){a.focus(),a.undoManager.transact(function(){a.setContent(b.data.code)}),a.selection.setCursorLocation(),a.nodeChanged()}});b.find("#code").value(a.getContent({source_view:!0}))}a.addCommand("mceCodeEditor",b),a.addButton("code",{icon:"code",tooltip:"Source code",onclick:b}),a.addMenuItem("code",{icon:"code",text:"Source code",context:"tools",onclick:b})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/colorpicker/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("colorpicker",function(a){function b(b,c){function d(a){var b=new tinymce.util.Color(a),c=b.toRgb();f.fromJSON({r:c.r,g:c.g,b:c.b,hex:b.toHex().substr(1)}),e(b.toHex())}function e(a){f.find("#preview")[0].getEl().style.background=a}var f=a.windowManager.open({title:"Color",items:{type:"container",layout:"flex",direction:"row",align:"stretch",padding:5,spacing:10,items:[{type:"colorpicker",value:c,onchange:function(){var a=this.rgb();f&&(f.find("#r").value(a.r),f.find("#g").value(a.g),f.find("#b").value(a.b),f.find("#hex").value(this.value().substr(1)),e(this.value()))}},{type:"form",padding:0,labelGap:5,defaults:{type:"textbox",size:7,value:"0",flex:1,spellcheck:!1,onchange:function(){var a,b,c=f.find("colorpicker")[0];return a=this.name(),b=this.value(),"hex"==a?(b="#"+b,d(b),void c.value(b)):(b={r:f.find("#r").value(),g:f.find("#g").value(),b:f.find("#b").value()},c.value(b),void d(b))}},items:[{name:"r",label:"R",autofocus:1},{name:"g",label:"G"},{name:"b",label:"B"},{name:"hex",label:"#",value:"000000"},{name:"preview",type:"container",border:1}]}]},onSubmit:function(){b("#"+this.toJSON().hex)}});d(c)}a.settings.color_picker_callback||(a.settings.color_picker_callback=b)});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/contextmenu/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("contextmenu",function(a){var b,c=a.settings.contextmenu_never_use_native;a.on("contextmenu",function(d){var e,f=a.getDoc();if(!d.ctrlKey||c){if(d.preventDefault(),tinymce.Env.mac&&tinymce.Env.webkit&&2==d.button&&f.caretRangeFromPoint&&a.selection.setRng(f.caretRangeFromPoint(d.x,d.y)),e=a.settings.contextmenu||"link image inserttable | cell row column deletetable",b)b.show();else{var g=[];tinymce.each(e.split(/[ ,]/),function(b){var c=a.menuItems[b];"|"==b&&(c={text:b}),c&&(c.shortcut="",g.push(c))});for(var h=0;h<g.length;h++)"|"==g[h].text&&(0===h||h==g.length-1)&&g.splice(h,1);b=new tinymce.ui.Menu({items:g,context:"contextmenu"}).addClass("contextmenu").renderTo(),a.on("remove",function(){b.remove(),b=null})}var i={x:d.pageX,y:d.pageY};a.inline||(i=tinymce.DOM.getPos(a.getContentAreaContainer()),i.x+=d.clientX,i.y+=d.clientY),b.moveTo(i.x,i.y)}})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/directionality/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("directionality",function(a){function b(b){var c,d=a.dom,e=a.selection.getSelectedBlocks();e.length&&(c=d.getAttrib(e[0],"dir"),tinymce.each(e,function(a){d.getParent(a.parentNode,"*[dir='"+b+"']",d.getRoot())||(c!=b?d.setAttrib(a,"dir",b):d.setAttrib(a,"dir",null))}),a.nodeChanged())}function c(a){var b=[];return tinymce.each("h1 h2 h3 h4 h5 h6 div p".split(" "),function(c){b.push(c+"[dir="+a+"]")}),b.join(",")}a.addCommand("mceDirectionLTR",function(){b("ltr")}),a.addCommand("mceDirectionRTL",function(){b("rtl")}),a.addButton("ltr",{title:"Left to right",cmd:"mceDirectionLTR",stateSelector:c("ltr")}),a.addButton("rtl",{title:"Right to left",cmd:"mceDirectionRTL",stateSelector:c("rtl")})});
\ No newline at end of file
Binary file src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-cool.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-cry.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-embarassed.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-foot-in-mouth.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-frown.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-innocent.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-kiss.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-laughing.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-money-mouth.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-sealed.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-smile.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-surprised.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-tongue-out.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-undecided.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-wink.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/img/smiley-yell.gif has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/emoticons/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("emoticons",function(a,b){function c(){var a;return a='<table role="list" class="mce-grid">',tinymce.each(d,function(c){a+="<tr>",tinymce.each(c,function(c){var d=b+"/img/smiley-"+c+".gif";a+='<td><a href="#" data-mce-url="'+d+'" data-mce-alt="'+c+'" tabindex="-1" role="option" aria-label="'+c+'"><img src="'+d+'" style="width: 18px; height: 18px" role="presentation" /></a></td>'}),a+="</tr>"}),a+="</table>"}var d=[["cool","cry","embarassed","foot-in-mouth"],["frown","innocent","kiss","laughing"],["money-mouth","sealed","smile","surprised"],["tongue-out","undecided","wink","yell"]];a.addButton("emoticons",{type:"panelbutton",panel:{role:"application",autohide:!0,html:c,onclick:function(b){var c=a.dom.getParent(b.target,"a");c&&(a.insertContent('<img src="'+c.getAttribute("data-mce-url")+'" alt="'+c.getAttribute("data-mce-alt")+'" />'),this.hide())}},tooltip:"Emoticons"})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/example/dialog.html	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+<body>
+	<h3>Custom dialog</h3>
+	Input some text: <input id="content">
+	<button onclick="top.tinymce.activeEditor.windowManager.getWindows()[0].close();">Close window</button>
+</body>
+</html>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/example/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("example",function(a,b){a.addButton("example",{text:"My button",icon:!1,onclick:function(){a.windowManager.open({title:"Example plugin",body:[{type:"textbox",name:"title",label:"Title"}],onsubmit:function(b){a.insertContent("Title: "+b.data.title)}})}}),a.addMenuItem("example",{text:"Example plugin",context:"tools",onclick:function(){a.windowManager.open({title:"TinyMCE site",url:b+"/dialog.html",width:600,height:400,buttons:[{text:"Insert",onclick:function(){var b=a.windowManager.getWindows()[0];a.insertContent(b.getContentWindow().document.getElementById("content").value),b.close()}},{text:"Close",onclick:"close"}]})}})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/example_dependency/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("example_dependency",function(){},["example"]);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/fullpage/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("fullpage",function(a){function b(){var b=c();a.windowManager.open({title:"Document properties",data:b,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(a){d(tinymce.extend(b,a.data))}})}function c(){function b(a,b){var c=a.attr(b);return c||""}var c,d,f=e(),g={};return g.fontface=a.getParam("fullpage_default_fontface",""),g.fontsize=a.getParam("fullpage_default_fontsize",""),c=f.firstChild,7==c.type&&(g.xml_pi=!0,d=/encoding="([^"]+)"/.exec(c.value),d&&(g.docencoding=d[1])),c=f.getAll("#doctype")[0],c&&(g.doctype="<!DOCTYPE"+c.value+">"),c=f.getAll("title")[0],c&&c.firstChild&&(g.title=c.firstChild.value),k(f.getAll("meta"),function(a){var b,c=a.attr("name"),d=a.attr("http-equiv");c?g[c.toLowerCase()]=a.attr("content"):"Content-Type"==d&&(b=/charset\s*=\s*(.*)\s*/gi.exec(a.attr("content")),b&&(g.docencoding=b[1]))}),c=f.getAll("html")[0],c&&(g.langcode=b(c,"lang")||b(c,"xml:lang")),g.stylesheets=[],tinymce.each(f.getAll("link"),function(a){"stylesheet"==a.attr("rel")&&g.stylesheets.push(a.attr("href"))}),c=f.getAll("body")[0],c&&(g.langdir=b(c,"dir"),g.style=b(c,"style"),g.visited_color=b(c,"vlink"),g.link_color=b(c,"link"),g.active_color=b(c,"alink")),g}function d(b){function c(a,b,c){a.attr(b,c?c:void 0)}function d(a){g.firstChild?g.insert(a,g.firstChild):g.append(a)}var f,g,h,j,m,n=a.dom;f=e(),g=f.getAll("head")[0],g||(j=f.getAll("html")[0],g=new l("head",1),j.firstChild?j.insert(g,j.firstChild,!0):j.append(g)),j=f.firstChild,b.xml_pi?(m='version="1.0"',b.docencoding&&(m+=' encoding="'+b.docencoding+'"'),7!=j.type&&(j=new l("xml",7),f.insert(j,f.firstChild,!0)),j.value=m):j&&7==j.type&&j.remove(),j=f.getAll("#doctype")[0],b.doctype?(j||(j=new l("#doctype",10),b.xml_pi?f.insert(j,f.firstChild):d(j)),j.value=b.doctype.substring(9,b.doctype.length-1)):j&&j.remove(),j=null,k(f.getAll("meta"),function(a){"Content-Type"==a.attr("http-equiv")&&(j=a)}),b.docencoding?(j||(j=new l("meta",1),j.attr("http-equiv","Content-Type"),j.shortEnded=!0,d(j)),j.attr("content","text/html; charset="+b.docencoding)):j&&j.remove(),j=f.getAll("title")[0],b.title?(j?j.empty():(j=new l("title",1),d(j)),j.append(new l("#text",3)).value=b.title):j&&j.remove(),k("keywords,description,author,copyright,robots".split(","),function(a){var c,e,g=f.getAll("meta"),h=b[a];for(c=0;c<g.length;c++)if(e=g[c],e.attr("name")==a)return void(h?e.attr("content",h):e.remove());h&&(j=new l("meta",1),j.attr("name",a),j.attr("content",h),j.shortEnded=!0,d(j))});var o={};tinymce.each(f.getAll("link"),function(a){"stylesheet"==a.attr("rel")&&(o[a.attr("href")]=a)}),tinymce.each(b.stylesheets,function(a){o[a]||(j=new l("link",1),j.attr({rel:"stylesheet",text:"text/css",href:a}),j.shortEnded=!0,d(j)),delete o[a]}),tinymce.each(o,function(a){a.remove()}),j=f.getAll("body")[0],j&&(c(j,"dir",b.langdir),c(j,"style",b.style),c(j,"vlink",b.visited_color),c(j,"link",b.link_color),c(j,"alink",b.active_color),n.setAttribs(a.getBody(),{style:b.style,dir:b.dir,vLink:b.visited_color,link:b.link_color,aLink:b.active_color})),j=f.getAll("html")[0],j&&(c(j,"lang",b.langcode),c(j,"xml:lang",b.langcode)),g.firstChild||g.remove(),h=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(f),i=h.substring(0,h.indexOf("</body>"))}function e(){return new tinymce.html.DomParser({validate:!1,root_name:"#document"}).parse(i)}function f(b){function c(a){return a.replace(/<\/?[A-Z]+/g,function(a){return a.toLowerCase()})}var d,f,h,l,m=b.content,n="",o=a.dom;if(!b.selection&&!("raw"==b.format&&i||b.source_view&&a.getParam("fullpage_hide_in_source_view"))){0!==m.length||b.source_view||(m=tinymce.trim(i)+"\n"+tinymce.trim(m)+"\n"+tinymce.trim(j)),m=m.replace(/<(\/?)BODY/gi,"<$1body"),d=m.indexOf("<body"),-1!=d?(d=m.indexOf(">",d),i=c(m.substring(0,d+1)),f=m.indexOf("</body",d),-1==f&&(f=m.length),b.content=m.substring(d+1,f),j=c(m.substring(f))):(i=g(),j="\n</body>\n</html>"),h=e(),k(h.getAll("style"),function(a){a.firstChild&&(n+=a.firstChild.value)}),l=h.getAll("body")[0],l&&o.setAttribs(a.getBody(),{style:l.attr("style")||"",dir:l.attr("dir")||"",vLink:l.attr("vlink")||"",link:l.attr("link")||"",aLink:l.attr("alink")||""}),o.remove("fullpage_styles");var p=a.getDoc().getElementsByTagName("head")[0];n&&(o.add(p,"style",{id:"fullpage_styles"},n),l=o.get("fullpage_styles"),l.styleSheet&&(l.styleSheet.cssText=n));var q={};tinymce.each(p.getElementsByTagName("link"),function(a){"stylesheet"==a.rel&&a.getAttribute("data-mce-fullpage")&&(q[a.href]=a)}),tinymce.each(h.getAll("link"),function(a){var b=a.attr("href");q[b]||"stylesheet"!=a.attr("rel")||o.add(p,"link",{rel:"stylesheet",text:"text/css",href:b,"data-mce-fullpage":"1"}),delete q[b]}),tinymce.each(q,function(a){a.parentNode.removeChild(a)})}}function g(){var b,c="",d="";return a.getParam("fullpage_default_xml_pi")&&(c+='<?xml version="1.0" encoding="'+a.getParam("fullpage_default_encoding","ISO-8859-1")+'" ?>\n'),c+=a.getParam("fullpage_default_doctype","<!DOCTYPE html>"),c+="\n<html>\n<head>\n",(b=a.getParam("fullpage_default_title"))&&(c+="<title>"+b+"</title>\n"),(b=a.getParam("fullpage_default_encoding"))&&(c+='<meta http-equiv="Content-Type" content="text/html; charset='+b+'" />\n'),(b=a.getParam("fullpage_default_font_family"))&&(d+="font-family: "+b+";"),(b=a.getParam("fullpage_default_font_size"))&&(d+="font-size: "+b+";"),(b=a.getParam("fullpage_default_text_color"))&&(d+="color: "+b+";"),c+="</head>\n<body"+(d?' style="'+d+'"':"")+">\n"}function h(b){b.selection||b.source_view&&a.getParam("fullpage_hide_in_source_view")||(b.content=tinymce.trim(i)+"\n"+tinymce.trim(b.content)+"\n"+tinymce.trim(j))}var i,j,k=tinymce.each,l=tinymce.html.Node;a.addCommand("mceFullPageProperties",b),a.addButton("fullpage",{title:"Document properties",cmd:"mceFullPageProperties"}),a.addMenuItem("fullpage",{text:"Document properties",cmd:"mceFullPageProperties",context:"file"}),a.on("BeforeSetContent",f),a.on("GetContent",h)});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/fullscreen/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("fullscreen",function(a){function b(){var a,b,c=window,d=document,e=d.body;return e.offsetWidth&&(a=e.offsetWidth,b=e.offsetHeight),c.innerWidth&&c.innerHeight&&(a=c.innerWidth,b=c.innerHeight),{w:a,h:b}}function c(){function c(){j.setStyle(m,"height",b().h-(l.clientHeight-m.clientHeight))}var k,l,m,n,o=document.body,p=document.documentElement;i=!i,l=a.getContainer(),k=l.style,m=a.getContentAreaContainer().firstChild,n=m.style,i?(d=n.width,e=n.height,n.width=n.height="100%",g=k.width,h=k.height,k.width=k.height="",j.addClass(o,"mce-fullscreen"),j.addClass(p,"mce-fullscreen"),j.addClass(l,"mce-fullscreen"),j.bind(window,"resize",c),c(),f=c):(n.width=d,n.height=e,g&&(k.width=g),h&&(k.height=h),j.removeClass(o,"mce-fullscreen"),j.removeClass(p,"mce-fullscreen"),j.removeClass(l,"mce-fullscreen"),j.unbind(window,"resize",f)),a.fire("FullscreenStateChanged",{state:i})}var d,e,f,g,h,i=!1,j=tinymce.DOM;return a.settings.inline?void 0:(a.on("init",function(){a.addShortcut("Meta+Alt+F","",c)}),a.on("remove",function(){f&&j.unbind(window,"resize",f)}),a.addCommand("mceFullScreen",c),a.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Meta+Alt+F",selectable:!0,onClick:c,onPostRender:function(){var b=this;a.on("FullscreenStateChanged",function(a){b.active(a.state)})},context:"view"}),a.addButton("fullscreen",{tooltip:"Fullscreen",shortcut:"Meta+Alt+F",onClick:c,onPostRender:function(){var b=this;a.on("FullscreenStateChanged",function(a){b.active(a.state)})}}),{isFullscreen:function(){return i}})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/hr/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("hr",function(a){a.addCommand("InsertHorizontalRule",function(){a.execCommand("mceInsertContent",!1,"<hr />")}),a.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),a.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/image/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("image",function(a){function b(a,b){function c(a,c){d.parentNode&&d.parentNode.removeChild(d),b({width:a,height:c})}var d=document.createElement("img");d.onload=function(){c(d.clientWidth,d.clientHeight)},d.onerror=function(){c()};var e=d.style;e.visibility="hidden",e.position="fixed",e.bottom=e.left=0,e.width=e.height="auto",document.body.appendChild(d),d.src=a}function c(a,b,c){function d(a,c){return c=c||[],tinymce.each(a,function(a){var e={text:a.text||a.title};a.menu?e.menu=d(a.menu):(e.value=a.value,b(e)),c.push(e)}),c}return d(a,c||[])}function d(b){return function(){var c=a.settings.image_list;"string"==typeof c?tinymce.util.XHR.send({url:c,success:function(a){b(tinymce.util.JSON.parse(a))}}):"function"==typeof c?c(b):b(c)}}function e(d){function e(){var a,b,c,d;a=l.find("#width")[0],b=l.find("#height")[0],a&&b&&(c=a.value(),d=b.value(),l.find("#constrain")[0].checked()&&m&&n&&c&&d&&(m!=c?(d=Math.round(c/m*d),isNaN(d)||b.value(d)):(c=Math.round(d/n*c),isNaN(c)||a.value(c))),m=c,n=d)}function f(){function b(b){function c(){b.onload=b.onerror=null,a.selection&&(a.selection.select(b),a.nodeChanged())}b.onload=function(){q.width||q.height||!t||r.setAttribs(b,{width:b.clientWidth,height:b.clientHeight}),c()},b.onerror=c}j(),e(),q=tinymce.extend(q,l.toJSON()),q.alt||(q.alt=""),q.title||(q.title=""),""===q.width&&(q.width=null),""===q.height&&(q.height=null),q.style||(q.style=null),q={src:q.src,alt:q.alt,title:q.title,width:q.width,height:q.height,style:q.style,"class":q["class"]},a.undoManager.transact(function(){return q.src?(""===q.title&&(q.title=null),s?r.setAttribs(s,q):(q.id="__mcenew",a.focus(),a.selection.setContent(r.createHTML("img",q)),s=r.get("__mcenew"),r.setAttrib(s,"id",null)),void b(s)):void(s&&(r.remove(s),a.focus(),a.nodeChanged()))})}function g(a){return a&&(a=a.replace(/px$/,"")),a}function h(c){var d,e,f,g=c.meta||{};o&&o.value(a.convertURL(this.value(),"src")),tinymce.each(g,function(a,b){l.find("#"+b).value(a)}),g.width||g.height||(d=a.convertURL(this.value(),"src"),e=a.settings.image_prepend_url,f=new RegExp("^(?:[a-z]+:)?//","i"),e&&!f.test(d)&&d.substring(0,e.length)!==e&&(d=e+d),this.value(d),b(a.documentBaseURI.toAbsolute(this.value()),function(a){a.width&&a.height&&t&&(m=a.width,n=a.height,l.find("#width").value(m),l.find("#height").value(n))}))}function i(a){if(a.margin){var b=a.margin.split(" ");switch(b.length){case 1:a["margin-top"]=a["margin-top"]||b[0],a["margin-right"]=a["margin-right"]||b[0],a["margin-bottom"]=a["margin-bottom"]||b[0],a["margin-left"]=a["margin-left"]||b[0];break;case 2:a["margin-top"]=a["margin-top"]||b[0],a["margin-right"]=a["margin-right"]||b[1],a["margin-bottom"]=a["margin-bottom"]||b[0],a["margin-left"]=a["margin-left"]||b[1];break;case 3:a["margin-top"]=a["margin-top"]||b[0],a["margin-right"]=a["margin-right"]||b[1],a["margin-bottom"]=a["margin-bottom"]||b[2],a["margin-left"]=a["margin-left"]||b[1];break;case 4:a["margin-top"]=a["margin-top"]||b[0],a["margin-right"]=a["margin-right"]||b[1],a["margin-bottom"]=a["margin-bottom"]||b[2],a["margin-left"]=a["margin-left"]||b[3]}delete a.margin}return a}function j(){function b(a){return a.length>0&&/^[0-9]+$/.test(a)&&(a+="px"),a}if(a.settings.image_advtab){var c=l.toJSON(),d=r.parseStyle(c.style);d=i(d),c.vspace&&(d["margin-top"]=d["margin-bottom"]=b(c.vspace)),c.hspace&&(d["margin-left"]=d["margin-right"]=b(c.hspace)),c.border&&(d["border-width"]=b(c.border)),l.find("#style").value(r.serializeStyle(r.parseStyle(r.serializeStyle(d))))}}function k(){if(a.settings.image_advtab){var b=l.toJSON(),c=r.parseStyle(b.style);l.find("#vspace").value(""),l.find("#hspace").value(""),c=i(c),(c["margin-top"]&&c["margin-bottom"]||c["margin-right"]&&c["margin-left"])&&(l.find("#vspace").value(c["margin-top"]===c["margin-bottom"]?g(c["margin-top"]):""),l.find("#hspace").value(c["margin-right"]===c["margin-left"]?g(c["margin-right"]):"")),c["border-width"]&&l.find("#border").value(g(c["border-width"])),l.find("#style").value(r.serializeStyle(r.parseStyle(r.serializeStyle(c))))}}var l,m,n,o,p,q={},r=a.dom,s=a.selection.getNode(),t=a.settings.image_dimensions!==!1;m=r.getAttrib(s,"width"),n=r.getAttrib(s,"height"),"IMG"!=s.nodeName||s.getAttribute("data-mce-object")||s.getAttribute("data-mce-placeholder")?s=null:q={src:r.getAttrib(s,"src"),alt:r.getAttrib(s,"alt"),title:r.getAttrib(s,"title"),"class":r.getAttrib(s,"class"),width:m,height:n},d&&(o={type:"listbox",label:"Image list",values:c(d,function(b){b.value=a.convertURL(b.value||b.url,"src")},[{text:"None",value:""}]),value:q.src&&a.convertURL(q.src,"src"),onselect:function(a){var b=l.find("#alt");(!b.value()||a.lastControl&&b.value()==a.lastControl.text())&&b.value(a.control.text()),l.find("#src").value(a.control.value()).fire("change")},onPostRender:function(){o=this}}),a.settings.image_class_list&&(p={name:"class",type:"listbox",label:"Class",values:c(a.settings.image_class_list,function(b){b.value&&(b.textStyle=function(){return a.formatter.getCssText({inline:"img",classes:[b.value]})})})});var u=[{name:"src",type:"filepicker",filetype:"image",label:"Source",autofocus:!0,onchange:h},o];a.settings.image_description!==!1&&u.push({name:"alt",type:"textbox",label:"Image description"}),a.settings.image_title&&u.push({name:"title",type:"textbox",label:"Image Title"}),t&&u.push({type:"container",label:"Dimensions",layout:"flex",direction:"row",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:3,onchange:e,ariaLabel:"Width"},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:3,onchange:e,ariaLabel:"Height"},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}),u.push(p),a.settings.image_advtab?(s&&(s.style.marginLeft&&s.style.marginRight&&s.style.marginLeft===s.style.marginRight&&(q.hspace=g(s.style.marginLeft)),s.style.marginTop&&s.style.marginBottom&&s.style.marginTop===s.style.marginBottom&&(q.vspace=g(s.style.marginTop)),s.style.borderWidth&&(q.border=g(s.style.borderWidth)),q.style=a.dom.serializeStyle(a.dom.parseStyle(a.dom.getAttrib(s,"style")))),l=a.windowManager.open({title:"Insert/edit image",data:q,bodyType:"tabpanel",body:[{title:"General",type:"form",items:u},{title:"Advanced",type:"form",pack:"start",items:[{label:"Style",name:"style",type:"textbox",onchange:k},{type:"form",layout:"grid",packV:"start",columns:2,padding:0,alignH:["left","right"],defaults:{type:"textbox",maxWidth:50,onchange:j},items:[{label:"Vertical space",name:"vspace"},{label:"Horizontal space",name:"hspace"},{label:"Border",name:"border"}]}]}],onSubmit:f})):l=a.windowManager.open({title:"Insert/edit image",data:q,body:u,onSubmit:f})}a.addButton("image",{icon:"image",tooltip:"Insert/edit image",onclick:d(e),stateSelector:"img:not([data-mce-object],[data-mce-placeholder])"}),a.addMenuItem("image",{icon:"image",text:"Insert/edit image",onclick:d(e),context:"insert",prependToContext:!0}),a.addCommand("mceImage",d(e))});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/importcss/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("importcss",function(a){function b(a){return"string"==typeof a?function(b){return-1!==b.indexOf(a)}:a instanceof RegExp?function(b){return a.test(b)}:a}function c(b,c){function d(a,b){var g,h=a.href;if(h&&c(h,b)){f(a.imports,function(a){d(a,!0)});try{g=a.cssRules||a.rules}catch(i){}f(g,function(a){a.styleSheet?d(a.styleSheet,!0):a.selectorText&&f(a.selectorText.split(","),function(a){e.push(tinymce.trim(a))})})}}var e=[],g={};f(a.contentCSS,function(a){g[a]=!0}),c||(c=function(a,b){return b||g[a]});try{f(b.styleSheets,function(a){d(a)})}catch(h){}return e}function d(b){var c,d=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(b);if(d){var e=d[1],f=d[2].substr(1).split(".").join(" "),g=tinymce.makeMap("a,img");return d[1]?(c={title:b},a.schema.getTextBlockElements()[e]?c.block=e:a.schema.getBlockElements()[e]||g[e.toLowerCase()]?c.selector=e:c.inline=e):d[2]&&(c={inline:"span",title:b.substr(1),classes:f}),a.settings.importcss_merge_classes!==!1?c.classes=f:c.attributes={"class":f},c}}var e=this,f=tinymce.each;a.on("renderFormatsMenu",function(g){var h=a.settings,i={},j=h.importcss_selector_converter||d,k=b(h.importcss_selector_filter),l=g.control;a.settings.importcss_append||l.items().remove();var m=[];tinymce.each(h.importcss_groups,function(a){a=tinymce.extend({},a),a.filter=b(a.filter),m.push(a)}),f(c(g.doc||a.getDoc(),b(h.importcss_file_filter)),function(b){if(-1===b.indexOf(".mce-")&&!i[b]&&(!k||k(b))){var c,d=j.call(e,b);if(d){var f=d.name||tinymce.DOM.uniqueId();if(m)for(var g=0;g<m.length;g++)if(!m[g].filter||m[g].filter(b)){m[g].item||(m[g].item={text:m[g].title,menu:[]}),c=m[g].item.menu;break}a.formatter.register(f,d);var h=tinymce.extend({},l.settings.itemDefaults,{text:d.title,format:f});c?c.push(h):l.add(h)}i[b]=!0}}),f(m,function(a){l.add(a.item)}),g.control.renderNew()}),e.convertSelectorToFormat=d});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/insertdatetime/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("insertdatetime",function(a){function b(b,c){function d(a,b){if(a=""+a,a.length<b)for(var c=0;c<b-a.length;c++)a="0"+a;return a}return c=c||new Date,b=b.replace("%D","%m/%d/%Y"),b=b.replace("%r","%I:%M:%S %p"),b=b.replace("%Y",""+c.getFullYear()),b=b.replace("%y",""+c.getYear()),b=b.replace("%m",d(c.getMonth()+1,2)),b=b.replace("%d",d(c.getDate(),2)),b=b.replace("%H",""+d(c.getHours(),2)),b=b.replace("%M",""+d(c.getMinutes(),2)),b=b.replace("%S",""+d(c.getSeconds(),2)),b=b.replace("%I",""+((c.getHours()+11)%12+1)),b=b.replace("%p",""+(c.getHours()<12?"AM":"PM")),b=b.replace("%B",""+a.translate(i[c.getMonth()])),b=b.replace("%b",""+a.translate(h[c.getMonth()])),b=b.replace("%A",""+a.translate(g[c.getDay()])),b=b.replace("%a",""+a.translate(f[c.getDay()])),b=b.replace("%%","%")}function c(c){var d=b(c);if(a.settings.insertdatetime_element){var e;e=b(/%[HMSIp]/.test(c)?"%Y-%m-%dT%H:%M":"%Y-%m-%d"),d='<time datetime="'+e+'">'+d+"</time>";var f=a.dom.getParent(a.selection.getStart(),"time");if(f)return void a.dom.setOuterHTML(f,d)}a.insertContent(d)}var d,e,f="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),g="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),h="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),i="January February March April May June July August September October November December".split(" "),j=[];a.addCommand("mceInsertDate",function(){c(a.getParam("insertdatetime_dateformat",a.translate("%Y-%m-%d")))}),a.addCommand("mceInsertTime",function(){c(a.getParam("insertdatetime_timeformat",a.translate("%H:%M:%S")))}),a.addButton("insertdatetime",{type:"splitbutton",title:"Insert date/time",onclick:function(){c(d||e)},menu:j}),tinymce.each(a.settings.insertdatetime_formats||["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"],function(a){e||(e=a),j.push({text:b(a),onclick:function(){d=a,c(a)}})}),a.addMenuItem("insertdatetime",{icon:"date",text:"Insert date/time",menu:j,context:"insert"})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/layer/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("layer",function(a){function b(a){do if(a.className&&-1!=a.className.indexOf("mceItemLayer"))return a;while(a=a.parentNode)}function c(b){var c=a.dom;tinymce.each(c.select("div,p",b),function(a){/^(absolute|relative|fixed)$/i.test(a.style.position)&&(a.hasVisual?c.addClass(a,"mceItemVisualAid"):c.removeClass(a,"mceItemVisualAid"),c.addClass(a,"mceItemLayer"))})}function d(c){var d,e,f=[],g=b(a.selection.getNode()),h=-1,i=-1;for(e=[],tinymce.walk(a.getBody(),function(a){1==a.nodeType&&/^(absolute|relative|static)$/i.test(a.style.position)&&e.push(a)},"childNodes"),d=0;d<e.length;d++)f[d]=e[d].style.zIndex?parseInt(e[d].style.zIndex,10):0,0>h&&e[d]==g&&(h=d);if(0>c){for(d=0;d<f.length;d++)if(f[d]<f[h]){i=d;break}i>-1?(e[h].style.zIndex=f[i],e[i].style.zIndex=f[h]):f[h]>0&&(e[h].style.zIndex=f[h]-1)}else{for(d=0;d<f.length;d++)if(f[d]>f[h]){i=d;break}i>-1?(e[h].style.zIndex=f[i],e[i].style.zIndex=f[h]):e[h].style.zIndex=f[h]+1}a.execCommand("mceRepaint")}function e(){var b=a.dom,c=b.getPos(b.getParent(a.selection.getNode(),"*")),d=a.getBody();a.dom.add(d,"div",{style:{position:"absolute",left:c.x,top:c.y>20?c.y:20,width:100,height:100},"class":"mceItemVisualAid mceItemLayer"},a.selection.getContent()||a.getLang("layer.content")),tinymce.Env.ie&&b.setHTML(d,d.innerHTML)}function f(){var c=b(a.selection.getNode());c||(c=a.dom.getParent(a.selection.getNode(),"DIV,P,IMG")),c&&("absolute"==c.style.position.toLowerCase()?(a.dom.setStyles(c,{position:"",left:"",top:"",width:"",height:""}),a.dom.removeClass(c,"mceItemVisualAid"),a.dom.removeClass(c,"mceItemLayer")):(c.style.left||(c.style.left="20px"),c.style.top||(c.style.top="20px"),c.style.width||(c.style.width=c.width?c.width+"px":"100px"),c.style.height||(c.style.height=c.height?c.height+"px":"100px"),c.style.position="absolute",a.dom.setAttrib(c,"data-mce-style",""),a.addVisual(a.getBody())),a.execCommand("mceRepaint"),a.nodeChanged())}a.addCommand("mceInsertLayer",e),a.addCommand("mceMoveForward",function(){d(1)}),a.addCommand("mceMoveBackward",function(){d(-1)}),a.addCommand("mceMakeAbsolute",function(){f()}),a.addButton("moveforward",{title:"layer.forward_desc",cmd:"mceMoveForward"}),a.addButton("movebackward",{title:"layer.backward_desc",cmd:"mceMoveBackward"}),a.addButton("absolute",{title:"layer.absolute_desc",cmd:"mceMakeAbsolute"}),a.addButton("insertlayer",{title:"layer.insertlayer_desc",cmd:"mceInsertLayer"}),a.on("init",function(){tinymce.Env.ie&&a.getDoc().execCommand("2D-Position",!1,!0)}),a.on("mouseup",function(c){var d=b(c.target);d&&a.dom.setAttrib(d,"data-mce-style","")}),a.on("mousedown",function(c){var d,e=c.target,f=a.getDoc();tinymce.Env.gecko&&(b(e)?"on"!==f.designMode&&(f.designMode="on",e=f.body,d=e.parentNode,d.removeChild(e),d.appendChild(e)):"on"==f.designMode&&(f.designMode="off"))}),a.on("NodeChange",c)});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/legacyoutput/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+!function(a){a.on("AddEditor",function(a){a.editor.settings.inline_styles=!1}),a.PluginManager.add("legacyoutput",function(b,c,d){b.on("init",function(){var c="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",d=a.explode(b.settings.font_size_style_values),e=b.schema;b.formatter.register({alignleft:{selector:c,attributes:{align:"left"}},aligncenter:{selector:c,attributes:{align:"center"}},alignright:{selector:c,attributes:{align:"right"}},alignjustify:{selector:c,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(b){return a.inArray(d,b.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}}),a.each("b,i,u,strike".split(","),function(a){e.addValidElements(a+"[*]")}),e.getElementRule("font")||e.addValidElements("font[face|size|color|style]"),a.each(c.split(","),function(a){var b=e.getElementRule(a);b&&(b.attributes.align||(b.attributes.align={},b.attributesOrder.push("align")))})}),b.addButton("fontsizeselect",function(){var a=[],c="8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7",d=b.settings.fontsize_formats||c;return b.$.each(d.split(" "),function(b,c){var d=c,e=c,f=c.split("=");f.length>1&&(d=f[0],e=f[1]),a.push({text:d,value:e})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:a,fixedWidth:!0,onPostRender:function(){var a=this;b.on("NodeChange",function(){var c;c=b.dom.getParent(b.selection.getNode(),"font"),a.value(c?c.size:"")})},onclick:function(a){a.control.settings.value&&b.execCommand("FontSize",!1,a.control.settings.value)}}}),b.addButton("fontselect",function(){function a(a){a=a.replace(/;$/,"").split(";");for(var b=a.length;b--;)a[b]=a[b].split("=");return a}var c="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",e=[],f=a(b.settings.font_formats||c);return d.each(f,function(a,b){e.push({text:{raw:b[0]},value:b[1],textStyle:-1==b[1].indexOf("dings")?"font-family:"+b[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:e,fixedWidth:!0,onPostRender:function(){var a=this;b.on("NodeChange",function(){var c;c=b.dom.getParent(b.selection.getNode(),"font"),a.value(c?c.face:"")})},onselect:function(a){a.control.settings.value&&b.execCommand("FontName",!1,a.control.settings.value)}}})})}(tinymce);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/link/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("link",function(a){function b(b){return function(){var c=a.settings.link_list;"string"==typeof c?tinymce.util.XHR.send({url:c,success:function(a){b(tinymce.util.JSON.parse(a))}}):"function"==typeof c?c(b):b(c)}}function c(a,b,c){function d(a,c){return c=c||[],tinymce.each(a,function(a){var e={text:a.text||a.title};a.menu?e.menu=d(a.menu):(e.value=a.value,b&&b(e)),c.push(e)}),c}return d(a,c||[])}function d(b){function d(a){var b=l.find("#text");(!b.value()||a.lastControl&&b.value()==a.lastControl.text())&&b.value(a.control.text()),l.find("#href").value(a.control.value())}function e(b){var c=[];return tinymce.each(a.dom.select("a:not([href])"),function(a){var d=a.name||a.id;d&&c.push({text:d,value:"#"+d,selected:-1!=b.indexOf("#"+d)})}),c.length?(c.unshift({text:"None",value:""}),{name:"anchor",type:"listbox",label:"Anchors",values:c,onselect:d}):void 0}function f(){!k&&0===u.text.length&&m&&this.parent().parent().find("#text")[0].value(this.value())}function g(b){var c=b.meta||{};o&&o.value(a.convertURL(this.value(),"href")),tinymce.each(b.meta,function(a,b){l.find("#"+b).value(a)}),c.text||f.call(this)}function h(a){var b=v.getContent();if(/</.test(b)&&(!/^<a [^>]+>[^<]+<\/a>$/.test(b)||-1==b.indexOf("href=")))return!1;if(a){var c,d=a.childNodes;if(0===d.length)return!1;for(c=d.length-1;c>=0;c--)if(3!=d[c].nodeType)return!1}return!0}var i,j,k,l,m,n,o,p,q,r,s,t,u={},v=a.selection,w=a.dom;i=v.getNode(),j=w.getParent(i,"a[href]"),m=h(),u.text=k=j?j.innerText||j.textContent:v.getContent({format:"text"}),u.href=j?w.getAttrib(j,"href"):"",j?u.target=w.getAttrib(j,"target"):a.settings.default_link_target&&(u.target=a.settings.default_link_target),(t=w.getAttrib(j,"rel"))&&(u.rel=t),(t=w.getAttrib(j,"class"))&&(u["class"]=t),(t=w.getAttrib(j,"title"))&&(u.title=t),m&&(n={name:"text",type:"textbox",size:40,label:"Text to display",onchange:function(){u.text=this.value()}}),b&&(o={type:"listbox",label:"Link list",values:c(b,function(b){b.value=a.convertURL(b.value||b.url,"href")},[{text:"None",value:""}]),onselect:d,value:a.convertURL(u.href,"href"),onPostRender:function(){o=this}}),a.settings.target_list!==!1&&(a.settings.target_list||(a.settings.target_list=[{text:"None",value:""},{text:"New window",value:"_blank"}]),q={name:"target",type:"listbox",label:"Target",values:c(a.settings.target_list)}),a.settings.rel_list&&(p={name:"rel",type:"listbox",label:"Rel",values:c(a.settings.rel_list)}),a.settings.link_class_list&&(r={name:"class",type:"listbox",label:"Class",values:c(a.settings.link_class_list,function(b){b.value&&(b.textStyle=function(){return a.formatter.getCssText({inline:"a",classes:[b.value]})})})}),a.settings.link_title!==!1&&(s={name:"title",type:"textbox",label:"Title",value:u.title}),l=a.windowManager.open({title:"Insert link",data:u,body:[{name:"href",type:"filepicker",filetype:"file",size:40,autofocus:!0,label:"Url",onchange:g,onkeyup:f},n,s,e(u.href),o,p,q,r],onSubmit:function(b){function c(b,c){var d=a.selection.getRng();window.setTimeout(function(){a.windowManager.confirm(b,function(b){a.selection.setRng(d),c(b)})},0)}function d(){var b={href:e,target:u.target?u.target:null,rel:u.rel?u.rel:null,"class":u["class"]?u["class"]:null,title:u.title?u.title:null};j?(a.focus(),m&&u.text!=k&&("innerText"in j?j.innerText=u.text:j.textContent=u.text),w.setAttribs(j,b),v.select(j),a.undoManager.add()):m?a.insertContent(w.createHTML("a",b,w.encode(u.text))):a.execCommand("mceInsertLink",!1,b)}var e;return u=tinymce.extend(u,b.data),(e=u.href)?e.indexOf("@")>0&&-1==e.indexOf("//")&&-1==e.indexOf("mailto:")?void c("The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",function(a){a&&(e="mailto:"+e),d()}):a.settings.link_assume_external_targets&&!/^\w+:/i.test(e)||!a.settings.link_assume_external_targets&&/^\s*www\./i.test(e)?void c("The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",function(a){a&&(e="http://"+e),d()}):void d():void a.execCommand("unlink")}})}a.addButton("link",{icon:"link",tooltip:"Insert/edit link",shortcut:"Meta+K",onclick:b(d),stateSelector:"a[href]"}),a.addButton("unlink",{icon:"unlink",tooltip:"Remove link",cmd:"unlink",stateSelector:"a[href]"}),a.addShortcut("Meta+K","",b(d)),a.addCommand("mceLink",b(d)),this.showDialog=d,a.addMenuItem("link",{icon:"link",text:"Insert/edit link",shortcut:"Meta+K",onclick:b(d),stateSelector:"a[href]",context:"insert",prependToContext:!0})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/lists/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("lists",function(a){function b(a){return a&&/^(OL|UL|DL)$/.test(a.nodeName)}function c(a){return a.parentNode.firstChild==a}function d(a){return a.parentNode.lastChild==a}function e(b){return b&&!!a.schema.getTextBlockElements()[b.nodeName]}var f=this;a.on("init",function(){function g(a){function b(b){var d,e,f;e=a[b?"startContainer":"endContainer"],f=a[b?"startOffset":"endOffset"],1==e.nodeType&&(d=v.create("span",{"data-mce-type":"bookmark"}),e.hasChildNodes()?(f=Math.min(f,e.childNodes.length-1),b?e.insertBefore(d,e.childNodes[f]):v.insertAfter(d,e.childNodes[f])):e.appendChild(d),e=d,f=0),c[b?"startContainer":"endContainer"]=e,c[b?"startOffset":"endOffset"]=f}var c={};return b(!0),a.collapsed||b(),c}function h(a){function b(b){function c(a){for(var b=a.parentNode.firstChild,c=0;b;){if(b==a)return c;(1!=b.nodeType||"bookmark"!=b.getAttribute("data-mce-type"))&&c++,b=b.nextSibling}return-1}var d,e,f;d=f=a[b?"startContainer":"endContainer"],e=a[b?"startOffset":"endOffset"],d&&(1==d.nodeType&&(e=c(d),d=d.parentNode,v.remove(f)),a[b?"startContainer":"endContainer"]=d,a[b?"startOffset":"endOffset"]=e)}b(!0),b();var c=v.createRng();c.setStart(a.startContainer,a.startOffset),a.endContainer&&c.setEnd(a.endContainer,a.endOffset),w.setRng(c)}function i(b,c){var d,e,f,g=v.createFragment(),h=a.schema.getBlockElements();if(a.settings.forced_root_block&&(c=c||a.settings.forced_root_block),c&&(e=v.create(c),e.tagName===a.settings.forced_root_block&&v.setAttribs(e,a.settings.forced_root_block_attrs),g.appendChild(e)),b)for(;d=b.firstChild;){var i=d.nodeName;f||"SPAN"==i&&"bookmark"==d.getAttribute("data-mce-type")||(f=!0),h[i]?(g.appendChild(d),e=null):c?(e||(e=v.create(c),g.appendChild(e)),e.appendChild(d)):g.appendChild(d)}return a.settings.forced_root_block?f||tinymce.Env.ie&&!(tinymce.Env.ie>10)||e.appendChild(v.create("br",{"data-mce-bogus":"1"})):g.appendChild(v.create("br")),g}function j(){return tinymce.grep(w.getSelectedBlocks(),function(a){return/^(LI|DT|DD)$/.test(a.nodeName)})}function k(a,b,c){function d(a){tinymce.each(g,function(c){a.parentNode.insertBefore(c,b.parentNode)}),v.remove(a)}var e,f,g,h;for(g=v.select('span[data-mce-type="bookmark"]',a),c=c||i(b),e=v.createRng(),e.setStartAfter(b),e.setEndAfter(a),f=e.extractContents(),h=f.firstChild;h;h=h.firstChild)if("LI"==h.nodeName&&v.isEmpty(h)){v.remove(h);break}v.isEmpty(f)||v.insertAfter(f,a),v.insertAfter(c,a),v.isEmpty(b.parentNode)&&d(b.parentNode),v.remove(b),v.isEmpty(a)&&v.remove(a)}function l(a){var c,d;if(c=a.nextSibling,c&&b(c)&&c.nodeName==a.nodeName){for(;d=c.firstChild;)a.appendChild(d);v.remove(c)}if(c=a.previousSibling,c&&b(c)&&c.nodeName==a.nodeName){for(;d=c.firstChild;)a.insertBefore(d,a.firstChild);v.remove(c)}}function m(a){tinymce.each(tinymce.grep(v.select("ol,ul",a)),function(a){var c,d=a.parentNode;"LI"==d.nodeName&&d.firstChild==a&&(c=d.previousSibling,c&&"LI"==c.nodeName&&(c.appendChild(a),v.isEmpty(d)&&v.remove(d))),b(d)&&(c=d.previousSibling,c&&"LI"==c.nodeName&&c.appendChild(a))})}function n(a){function e(a){v.isEmpty(a)&&v.remove(a)}var f,g=a.parentNode,h=g.parentNode;return"DD"==a.nodeName?(v.rename(a,"DT"),!0):c(a)&&d(a)?("LI"==h.nodeName?(v.insertAfter(a,h),e(h),v.remove(g)):b(h)?v.remove(g,!0):(h.insertBefore(i(a),g),v.remove(g)),!0):c(a)?("LI"==h.nodeName?(v.insertAfter(a,h),a.appendChild(g),e(h)):b(h)?h.insertBefore(a,g):(h.insertBefore(i(a),g),v.remove(a)),!0):d(a)?("LI"==h.nodeName?v.insertAfter(a,h):b(h)?v.insertAfter(a,g):(v.insertAfter(i(a),g),v.remove(a)),!0):("LI"==h.nodeName?(g=h,f=i(a,"LI")):f=b(h)?i(a,"LI"):i(a),k(g,a,f),m(g.parentNode),!0)}function o(a){function c(c,d){var e;if(b(c)){for(;e=a.lastChild.firstChild;)d.appendChild(e);v.remove(c)}}var d,e;return"DT"==a.nodeName?(v.rename(a,"DD"),!0):(d=a.previousSibling,d&&b(d)?(d.appendChild(a),!0):d&&"LI"==d.nodeName&&b(d.lastChild)?(d.lastChild.appendChild(a),c(a.lastChild,d.lastChild),!0):(d=a.nextSibling,d&&b(d)?(d.insertBefore(a,d.firstChild),!0):d&&"LI"==d.nodeName&&b(a.lastChild)?!1:(d=a.previousSibling,d&&"LI"==d.nodeName?(e=v.create(a.parentNode.nodeName),d.appendChild(e),e.appendChild(a),c(a.lastChild,e),!0):!1)))}function p(){var b=j();if(b.length){for(var c=g(w.getRng(!0)),d=0;d<b.length&&(o(b[d])||0!==d);d++);return h(c),a.nodeChanged(),!0}}function q(){var b=j();if(b.length){var c,d,e=g(w.getRng(!0)),f=a.getBody();for(c=b.length;c--;)for(var i=b[c].parentNode;i&&i!=f;){for(d=b.length;d--;)if(b[d]===i){b.splice(c,1);break}i=i.parentNode}for(c=0;c<b.length&&(n(b[c])||0!==c);c++);return h(e),a.nodeChanged(),!0}}function r(c){function d(){function b(a){var b,c;for(b=f[a?"startContainer":"endContainer"],c=f[a?"startOffset":"endOffset"],1==b.nodeType&&(b=b.childNodes[Math.min(c,b.childNodes.length-1)]||b);b.parentNode!=g;){if(e(b))return b;if(/^(TD|TH)$/.test(b.parentNode.nodeName))return b;b=b.parentNode}return b}for(var c,d=[],g=a.getBody(),h=b(!0),i=b(),j=[],k=h;k&&(j.push(k),k!=i);k=k.nextSibling);return tinymce.each(j,function(a){if(e(a))return d.push(a),void(c=null);if(v.isBlock(a)||"BR"==a.nodeName)return"BR"==a.nodeName&&v.remove(a),void(c=null);var b=a.nextSibling;return tinymce.dom.BookmarkManager.isBookmarkNode(a)&&(e(b)||!b&&a.parentNode==g)?void(c=null):(c||(c=v.create("p"),a.parentNode.insertBefore(c,a),d.push(c)),void c.appendChild(a))}),d}var f=w.getRng(!0),i=g(f),j="LI";c=c.toUpperCase(),"DL"==c&&(j="DT"),tinymce.each(d(),function(a){var d,e;e=a.previousSibling,e&&b(e)&&e.nodeName==c?(d=e,a=v.rename(a,j),e.appendChild(a)):(d=v.create(c),a.parentNode.insertBefore(d,a),d.appendChild(a),a=v.rename(a,j)),l(d)}),h(i)}function s(){var c=g(w.getRng(!0)),d=a.getBody();tinymce.each(j(),function(a){var c,e;if(v.isEmpty(a))return void n(a);for(c=a;c&&c!=d;c=c.parentNode)b(c)&&(e=c);k(e,a)}),h(c)}function t(a){var b=v.getParent(w.getStart(),"OL,UL,DL");if(b)if(b.nodeName==a)s(a);else{var c=g(w.getRng(!0));l(v.rename(b,a)),h(c)}else r(a)}function u(b){return function(){var c=v.getParent(a.selection.getStart(),"UL,OL,DL");return c&&c.nodeName==b}}var v=a.dom,w=a.selection;f.backspaceDelete=function(c){function d(b,c){var d,e,f=b.startContainer,g=b.startOffset;if(3==f.nodeType&&(c?g<f.data.length:g>0))return f;for(d=a.schema.getNonEmptyElements(),e=new tinymce.dom.TreeWalker(b.startContainer);f=e[c?"next":"prev"]();){if("LI"==f.nodeName&&!f.hasChildNodes())return f;if(d[f.nodeName])return f;if(3==f.nodeType&&f.data.length>0)return f}}function e(a,c){var d,e,f=a.parentNode;if(b(c.lastChild)&&(e=c.lastChild),d=c.lastChild,d&&"BR"==d.nodeName&&a.hasChildNodes()&&v.remove(d),v.isEmpty(c)&&v.$(c).empty(),!v.isEmpty(a))for(;d=a.firstChild;)c.appendChild(d);e&&c.appendChild(e),v.remove(a),v.isEmpty(f)&&v.remove(f)}if(w.isCollapsed()){var f=v.getParent(w.getStart(),"LI");if(f){var i=w.getRng(!0),j=v.getParent(d(i,c),"LI");if(j&&j!=f){var k=g(i);return c?e(j,f):e(f,j),h(k),!0}if(!j&&!c&&s(f.parentNode.nodeName))return!0}}},a.on("BeforeExecCommand",function(b){var c,d=b.command.toLowerCase();return"indent"==d?p()&&(c=!0):"outdent"==d&&q()&&(c=!0),c?(a.fire("ExecCommand",{command:b.command}),b.preventDefault(),!0):void 0}),a.addCommand("InsertUnorderedList",function(){t("UL")}),a.addCommand("InsertOrderedList",function(){t("OL")}),a.addCommand("InsertDefinitionList",function(){t("DL")}),a.addQueryStateHandler("InsertUnorderedList",u("UL")),a.addQueryStateHandler("InsertOrderedList",u("OL")),a.addQueryStateHandler("InsertDefinitionList",u("DL")),a.on("keydown",function(b){9!=b.keyCode||tinymce.util.VK.metaKeyPressed(b)||a.dom.getParent(a.selection.getStart(),"LI,DT,DD")&&(b.preventDefault(),b.shiftKey?q():p())})}),a.addButton("indent",{icon:"indent",title:"Increase indent",cmd:"Indent",onPostRender:function(){var b=this;a.on("nodechange",function(){for(var d=a.selection.getSelectedBlocks(),e=!1,f=0,g=d.length;!e&&g>f;f++){var h=d[f].nodeName;e="LI"==h&&c(d[f])||"UL"==h||"OL"==h||"DD"==h}b.disabled(e)})}}),a.on("keydown",function(a){a.keyCode==tinymce.util.VK.BACKSPACE?f.backspaceDelete()&&a.preventDefault():a.keyCode==tinymce.util.VK.DELETE&&f.backspaceDelete(!0)&&a.preventDefault()})});
\ No newline at end of file
Binary file src/pyams_skin/resources/js/ext/tinymce/plugins/media/moxieplayer.swf has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/media/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("media",function(a,b){function c(a){return a=a.toLowerCase(),-1!=a.indexOf(".mp3")?"audio/mpeg":-1!=a.indexOf(".wav")?"audio/wav":-1!=a.indexOf(".mp4")?"video/mp4":-1!=a.indexOf(".webm")?"video/webm":-1!=a.indexOf(".ogg")?"video/ogg":-1!=a.indexOf(".swf")?"application/x-shockwave-flash":""}function d(b){var c=a.settings.media_scripts;if(c)for(var d=0;d<c.length;d++)if(-1!==b.indexOf(c[d].filter))return c[d]}function e(){function b(a){var b,c,f,g;b=d.find("#width")[0],c=d.find("#height")[0],f=b.value(),g=c.value(),d.find("#constrain")[0].checked()&&e&&j&&f&&g&&(a.control==b?(g=Math.round(f/e*g),isNaN(g)||c.value(g)):(f=Math.round(g/j*f),isNaN(f)||b.value(f))),e=f,j=g}function c(){k=h(this.value()),this.parent().parent().fromJSON(k)}var d,e,j,k,l=[{name:"source1",type:"filepicker",filetype:"media",size:40,autofocus:!0,label:"Source",onchange:function(a){tinymce.each(a.meta,function(a,b){d.find("#"+b).value(a)})}}];a.settings.media_alt_source!==!1&&l.push({name:"source2",type:"filepicker",filetype:"media",size:40,label:"Alternative source"}),a.settings.media_poster!==!1&&l.push({name:"poster",type:"filepicker",filetype:"image",size:40,label:"Poster"}),a.settings.media_dimensions!==!1&&l.push({type:"container",label:"Dimensions",layout:"flex",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:3,onchange:b,ariaLabel:"Width"},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:3,onchange:b,ariaLabel:"Height"},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}),k=i(a.selection.getNode()),e=k.width,j=k.height;var n={id:"mcemediasource",type:"textbox",flex:1,name:"embed",value:f(),multiline:!0,label:"Source"};n[m]=c,d=a.windowManager.open({title:"Insert/edit video",data:k,bodyType:"tabpanel",body:[{title:"General",type:"form",onShowTab:function(){k=h(this.next().find("#embed").value()),this.fromJSON(k)},items:l},{title:"Embed",type:"panel",layout:"flex",direction:"column",align:"stretch",padding:10,spacing:10,onShowTab:function(){this.find("#embed").value(g(this.parent().toJSON()))},items:[{type:"label",text:"Paste your embed code below:",forId:"mcemediasource"},n]}],onSubmit:function(){var b,c,d,e;for(b=a.dom.select("img[data-mce-object]"),a.insertContent(g(this.toJSON())),c=a.dom.select("img[data-mce-object]"),d=0;d<b.length;d++)for(e=c.length-1;e>=0;e--)b[d]==c[e]&&c.splice(e,1);a.selection.select(c[0]),a.nodeChanged()}})}function f(){var b=a.selection.getNode();return b.getAttribute("data-mce-object")?a.selection.getContent():void 0}function g(e){var f="";if(!e.source1&&(tinymce.extend(e,h(e.embed)),!e.source1))return"";if(e.source2||(e.source2=""),e.poster||(e.poster=""),e.source1=a.convertURL(e.source1,"source"),e.source2=a.convertURL(e.source2,"source"),e.source1mime=c(e.source1),e.source2mime=c(e.source2),e.poster=a.convertURL(e.poster,"poster"),e.flashPlayerUrl=a.convertURL(b+"/moxieplayer.swf","movie"),tinymce.each(l,function(a){var b,c,d;if(b=a.regex.exec(e.source1)){for(d=a.url,c=0;b[c];c++)d=d.replace("$"+c,function(){return b[c]});e.source1=d,e.type=a.type,e.width=e.width||a.w,e.height=e.height||a.h}}),e.embed)f=k(e.embed,e,!0);else{var g=d(e.source1);g&&(e.type="script",e.width=g.width,e.height=g.height),e.width=e.width||300,e.height=e.height||150,tinymce.each(e,function(b,c){e[c]=a.dom.encode(b)}),"iframe"==e.type?f+='<iframe src="'+e.source1+'" width="'+e.width+'" height="'+e.height+'"></iframe>':"application/x-shockwave-flash"==e.source1mime?(f+='<object data="'+e.source1+'" width="'+e.width+'" height="'+e.height+'" type="application/x-shockwave-flash">',e.poster&&(f+='<img src="'+e.poster+'" width="'+e.width+'" height="'+e.height+'" />'),f+="</object>"):-1!=e.source1mime.indexOf("audio")?a.settings.audio_template_callback?f=a.settings.audio_template_callback(e):f+='<audio controls="controls" src="'+e.source1+'">'+(e.source2?'\n<source src="'+e.source2+'"'+(e.source2mime?' type="'+e.source2mime+'"':"")+" />\n":"")+"</audio>":"script"==e.type?f+='<script src="'+e.source1+'"></script>':f=a.settings.video_template_callback?a.settings.video_template_callback(e):'<video width="'+e.width+'" height="'+e.height+'"'+(e.poster?' poster="'+e.poster+'"':"")+' controls="controls">\n<source src="'+e.source1+'"'+(e.source1mime?' type="'+e.source1mime+'"':"")+" />\n"+(e.source2?'<source src="'+e.source2+'"'+(e.source2mime?' type="'+e.source2mime+'"':"")+" />\n":"")+"</video>"}return f}function h(a){var b={};return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!0,special:"script,noscript",start:function(a,c){if(b.source1||"param"!=a||(b.source1=c.map.movie),("iframe"==a||"object"==a||"embed"==a||"video"==a||"audio"==a)&&(b.type||(b.type=a),b=tinymce.extend(c.map,b)),"script"==a){var e=d(c.map.src);if(!e)return;b={type:"script",source1:c.map.src,width:e.width,height:e.height}}"source"==a&&(b.source1?b.source2||(b.source2=c.map.src):b.source1=c.map.src),"img"!=a||b.poster||(b.poster=c.map.src)}}).parse(a),b.source1=b.source1||b.src||b.data,b.source2=b.source2||"",b.poster=b.poster||"",b}function i(b){return b.getAttribute("data-mce-object")?h(a.serializer.serialize(b,{selection:!0})):{}}function j(b){if(a.settings.media_filter_html===!1)return b;var c=new tinymce.html.Writer;return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!1,special:"script,noscript",comment:function(a){c.comment(a)},cdata:function(a){c.cdata(a)},text:function(a,b){c.text(a,b)},start:function(a,b,d){if("script"!=a&&"noscript"!=a){for(var e=0;e<b.length;e++)if(0===b[e].name.indexOf("on"))return;c.start(a,b,d)}},end:function(a){"script"!=a&&"noscript"!=a&&c.end(a)}},new tinymce.html.Schema({})).parse(b),c.getContent()}function k(a,b,c){function d(a,b){var c,d,e,f;for(c in b)if(e=""+b[c],a.map[c])for(d=a.length;d--;)f=a[d],f.name==c&&(e?(a.map[c]=e,f.value=e):(delete a.map[c],a.splice(d,1)));else e&&(a.push({name:c,value:e}),a.map[c]=e)}var e,f=new tinymce.html.Writer,g=0;return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!0,special:"script,noscript",comment:function(a){f.comment(a)},cdata:function(a){f.cdata(a)},text:function(a,b){f.text(a,b)},start:function(a,h,i){switch(a){case"video":case"object":case"embed":case"img":case"iframe":d(h,{width:b.width,height:b.height})}if(c)switch(a){case"video":d(h,{poster:b.poster,src:""}),b.source2&&d(h,{src:""});break;case"iframe":d(h,{src:b.source1});break;case"source":if(g++,2>=g&&(d(h,{src:b["source"+g],type:b["source"+g+"mime"]}),!b["source"+g]))return;break;case"img":if(!b.poster)return;e=!0}f.start(a,h,i)},end:function(a){if("video"==a&&c)for(var h=1;2>=h;h++)if(b["source"+h]){var i=[];i.map={},h>g&&(d(i,{src:b["source"+h],type:b["source"+h+"mime"]}),f.start("source",i,!0))}if(b.poster&&"object"==a&&c&&!e){var j=[];j.map={},d(j,{src:b.poster,width:b.width,height:b.height}),f.start("img",j,!0)}f.end(a)}},new tinymce.html.Schema({})).parse(a),f.getContent()}var l=[{regex:/youtu\.be\/([\w\-.]+)/,type:"iframe",w:425,h:350,url:"//www.youtube.com/embed/$1"},{regex:/youtube\.com(.+)v=([^&]+)/,type:"iframe",w:425,h:350,url:"//www.youtube.com/embed/$2"},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc"},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$2?title=0&amp;byline=0"},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'//maps.google.com/maps/ms?msid=$2&output=embed"'}],m=tinymce.Env.ie&&tinymce.Env.ie<=8?"onChange":"onInput";a.on("ResolveName",function(a){var b;1==a.target.nodeType&&(b=a.target.getAttribute("data-mce-object"))&&(a.name=b)}),a.on("preInit",function(){var b=a.schema.getSpecialElements();tinymce.each("video audio iframe object".split(" "),function(a){b[a]=new RegExp("</"+a+"[^>]*>","gi")});var c=a.schema.getBoolAttrs();tinymce.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),function(a){c[a]={}}),a.parser.addNodeFilter("iframe,video,audio,object,embed,script",function(b,c){for(var e,f,g,h,i,j,k,l,m=b.length;m--;)if(f=b[m],f.parent&&("script"!=f.name||(l=d(f.attr("src"))))){for(g=new tinymce.html.Node("img",1),g.shortEnded=!0,l&&(l.width&&f.attr("width",l.width.toString()),l.height&&f.attr("height",l.height.toString())),j=f.attributes,e=j.length;e--;)h=j[e].name,i=j[e].value,"width"!==h&&"height"!==h&&"style"!==h&&(("data"==h||"src"==h)&&(i=a.convertURL(i,h)),g.attr("data-mce-p-"+h,i));k=f.firstChild&&f.firstChild.value,k&&(g.attr("data-mce-html",escape(k)),g.firstChild=null),g.attr({width:f.attr("width")||"300",height:f.attr("height")||("audio"==c?"30":"150"),style:f.attr("style"),src:tinymce.Env.transparentSrc,"data-mce-object":c,"class":"mce-object mce-object-"+c}),f.replace(g)}}),a.serializer.addAttributeFilter("data-mce-object",function(a,b){for(var c,d,e,f,g,h,i,k=a.length;k--;)if(c=a[k],c.parent){for(i=c.attr(b),d=new tinymce.html.Node(i,1),"audio"!=i&&"script"!=i&&d.attr({width:c.attr("width"),height:c.attr("height")}),d.attr({style:c.attr("style")}),f=c.attributes,e=f.length;e--;){var l=f[e].name;0===l.indexOf("data-mce-p-")&&d.attr(l.substr(11),f[e].value)}"script"==i&&d.attr("type","text/javascript"),g=c.attr("data-mce-html"),g&&(h=new tinymce.html.Node("#text",3),h.raw=!0,h.value=j(unescape(g)),d.append(h)),c.replace(d)}})}),a.on("ObjectSelected",function(a){var b=a.target.getAttribute("data-mce-object");("audio"==b||"script"==b)&&a.preventDefault()}),a.on("objectResized",function(a){var b,c=a.target;c.getAttribute("data-mce-object")&&(b=c.getAttribute("data-mce-html"),b&&(b=unescape(b),c.setAttribute("data-mce-html",escape(k(b,{width:a.width,height:a.height})))))}),a.addButton("media",{tooltip:"Insert/edit video",onclick:e,stateSelector:["img[data-mce-object=video]","img[data-mce-object=iframe]"]}),a.addMenuItem("media",{icon:"media",text:"Insert/edit video",onclick:e,context:"insert",prependToContext:!0})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/nonbreaking/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("nonbreaking",function(a){var b=a.getParam("nonbreaking_force_tab");if(a.addCommand("mceNonBreaking",function(){a.insertContent(a.plugins.visualchars&&a.plugins.visualchars.state?'<span class="mce-nbsp">&nbsp;</span>':"&nbsp;"),a.dom.setAttrib(a.dom.select("span.mce-nbsp"),"data-mce-bogus","1")}),a.addButton("nonbreaking",{title:"Nonbreaking space",cmd:"mceNonBreaking"}),a.addMenuItem("nonbreaking",{text:"Nonbreaking space",cmd:"mceNonBreaking",context:"insert"}),b){var c=+b>1?+b:3;a.on("keydown",function(b){if(9==b.keyCode){if(b.shiftKey)return;b.preventDefault();for(var d=0;c>d;d++)a.execCommand("mceNonBreaking")}})}});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/noneditable/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("noneditable",function(a){function b(a){var b;if(1===a.nodeType){if(b=a.getAttribute(k),b&&"inherit"!==b)return b;if(b=a.contentEditable,"inherit"!==b)return b}return null}function c(a){for(var c;a;){if(c=b(a))return"false"===c?a:null;a=a.parentNode}}function d(){function d(a){for(;a;){if(a.id===n)return a;a=a.parentNode}}function e(a){var b;if(a)for(b=new i(a,a),a=b.current();a;a=b.next())if(3===a.nodeType)return a}function f(c,d){var e,f;return"false"===b(c)&&k.isBlock(c)?void m.select(c):(f=k.createRng(),"true"===b(c)&&(c.firstChild||c.appendChild(a.getDoc().createTextNode("\xa0")),c=c.firstChild,d=!0),e=k.create("span",{id:n,"data-mce-bogus":!0},o),d?c.parentNode.insertBefore(e,c):k.insertAfter(e,c),f.setStart(e.firstChild,1),f.collapse(!0),m.setRng(f),e)}function g(a){var b,c,d;if(a)b=m.getRng(!0),b.setStartBefore(a),b.setEndBefore(a),c=e(a),c&&c.nodeValue.charAt(0)==o&&(c=c.deleteData(0,1)),k.remove(a,!0),m.setRng(b);else for(;(a=k.get(n))&&a!==d;)c=e(a),c&&c.nodeValue.charAt(0)==o&&(c=c.deleteData(0,1)),k.remove(a,!0),d=a}function h(){function a(a,c){var d,e,f,g,h;if(d=j.startContainer,e=j.startOffset,3==d.nodeType){if(h=d.nodeValue.length,e>0&&h>e||(c?e==h:0===e))return}else{if(!(e<d.childNodes.length))return c?null:a;var k=!c&&e>0?e-1:e;d=d.childNodes[k],d.hasChildNodes()&&(d=d.firstChild)}for(f=new i(d,a);g=f[c?"prev":"next"]();){if(3===g.nodeType&&g.nodeValue.length>0)return;if("true"===b(g))return g}return a}var d,e,h,j,k;g(),h=m.isCollapsed(),d=c(m.getStart()),e=c(m.getEnd()),(d||e)&&(j=m.getRng(!0),h?(d=d||e,(k=a(d,!0))?f(k,!0):(k=a(d,!1))?f(k,!1):m.select(d)):(j=m.getRng(!0),d&&j.setStartBefore(d),e&&j.setEndAfter(e),m.setRng(j)))}function j(e){function f(a,b){for(;a=a[b?"previousSibling":"nextSibling"];)if(3!==a.nodeType||a.nodeValue.length>0)return a}function j(a,b){m.select(a),m.collapse(b)}function n(e){function f(a){for(var b=j;b;){if(b===a)return;b=b.parentNode}k.remove(a),h()}function g(){var d,g,h=a.schema.getNonEmptyElements();for(g=new tinymce.dom.TreeWalker(j,a.getBody());(d=e?g.prev():g.next())&&!h[d.nodeName.toLowerCase()]&&!(3===d.nodeType&&tinymce.trim(d.nodeValue).length>0);)if("false"===b(d))return f(d),!0;return c(d)?!0:!1}var i,j,l,n;if(m.isCollapsed()){if(i=m.getRng(!0),j=i.startContainer,l=i.startOffset,j=d(j)||j,n=c(j))return f(n),!1;if(3==j.nodeType&&(e?l>0:l<j.nodeValue.length))return!0;if(1==j.nodeType&&(j=j.childNodes[l]||j),g())return!1}return!0}var o,p,q,r,s=e.keyCode;h(),q=m.getStart(),r=m.getEnd(),o=c(q)||c(r);var t=a.selection.getNode(),u=s==l.LEFT||s==l.RIGHT||s==l.UP||s==l.DOWN,v=s==l.LEFT||s==l.UP;if(o&&(112>s||s>124)&&s!=l.DELETE&&s!=l.BACKSPACE){if((tinymce.isMac?e.metaKey:e.ctrlKey)&&(67==s||88==s||86==s))return;if(e.preventDefault(),u)if(a.dom.isBlock(o)){var w=v?o.previousSibling:o.nextSibling;if(!w||w&&"false"===b(w)){var x=k.create("p",null,"&nbsp;");x.className="mceTmpParagraph";var y=v?o:w;y&&y.parentNode?y.parentNode.insertBefore(x,y):w||v||o.parentNode.appendChild(x),w=x}var z=new i(w,w),A=v?z.prev():z.next();j(A,!v)}else j(o,v)}else if(u||s==l.BACKSPACE||s==l.DELETE){if(p=d(q)){if(s==l.LEFT||s==l.BACKSPACE)if(o=f(p,!0),o&&"false"===b(o)){if(e.preventDefault(),s!=l.LEFT)return void k.remove(o);j(o,!0)}else g(p);if(s==l.RIGHT||s==l.DELETE)if(o=f(p,!0),o&&"false"===b(o)){if(e.preventDefault(),s!=l.RIGHT)return void k.remove(o);j(o,!1)}else g(p)}else{if(u&&t&&-1!==t.className.indexOf("mceTmpParagraph")&&t[v?"previousSibling":"nextSibling"]){var B=t[v?"previousSibling":"nextSibling"];"&nbsp;"===t.innerHTML||""===t.innerHTML||" "===t.innerHTML?k.remove(t):t.className=t.className.replace("mceTmpParagraph",""),j(B,!v)}var C=m.getRng(!0),D=C.endContainer;if(k.isBlock(D)&&k.isBlock(D.nextSibling)&&1==C.endOffset&&s==l.DELETE&&(o=c(D.nextSibling)),o&&(s==l.DELETE||s==l.BACKSPACE)&&k.isBlock(o))return e.preventDefault(),void k.remove(o)}if((s==l.BACKSPACE||s==l.DELETE)&&!n(s==l.BACKSPACE))return e.preventDefault(),!1}}var k=a.dom,m=a.selection,n="mce_noneditablecaret",o="\ufeff";a.on("mousedown",function(c){var d=a.selection.getNode();d&&-1!==d.className.indexOf("mceTmpParagraph")&&d!==c.target&&("&nbsp;"===d.innerHTML||""===d.innerHTML||" "===d.innerHTML?k.remove(d):d.className=d.className.replace("mceTmpParagraph","")),"false"===b(d)&&d==c.target&&h()}),a.on("mouseup",h),a.on("keydown",j)}function e(b){var c=h.length,d=b.content,e=tinymce.trim(g);if("raw"!=b.format){for(;c--;)d=d.replace(h[c],function(b){var c=arguments,f=c[c.length-2];return f>0&&'"'==d.charAt(f-1)?b:'<span class="'+e+'" data-mce-content="'+a.dom.encode(c[0])+'">'+a.dom.encode("string"==typeof c[1]?c[1]:c[0])+"</span>"});b.content=d}}var f,g,h,i=tinymce.dom.TreeWalker,j="contenteditable",k="data-mce-"+j,l=tinymce.util.VK;f=" "+tinymce.trim(a.getParam("noneditable_editable_class","mceEditable"))+" ",g=" "+tinymce.trim(a.getParam("noneditable_noneditable_class","mceNonEditable"))+" ",h=a.getParam("noneditable_regexp"),h&&!h.length&&(h=[h]),a.on("PreInit",function(){d(),h&&a.on("BeforeSetContent",e),a.parser.addAttributeFilter("class",function(a){for(var b,c,d=a.length;d--;)c=a[d],b=" "+c.attr("class")+" ",-1!==b.indexOf(f)?c.attr(k,"true"):-1!==b.indexOf(g)&&c.attr(k,"false")}),a.serializer.addAttributeFilter(k,function(a){for(var b,c=a.length;c--;)b=a[c],h&&b.attr("data-mce-content")?(b.name="#text",b.type=3,b.raw=!0,b.value=b.attr("data-mce-content")):(b.attr(j,null),b.attr(k,null))}),a.parser.addAttributeFilter(j,function(a){for(var b,c=a.length;c--;)b=a[c],b.attr(k,b.attr(j)),b.attr(j,null)})}),a.on("drop",function(a){c(a.target)&&a.preventDefault()})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/pagebreak/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("pagebreak",function(a){var b="mce-pagebreak",c=a.getParam("pagebreak_separator","<!-- pagebreak -->"),d=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(a){return"\\"+a}),"gi"),e='<img src="'+tinymce.Env.transparentSrc+'" class="'+b+'" data-mce-resize="false" />';a.addCommand("mcePageBreak",function(){a.insertContent(a.settings.pagebreak_split_block?"<p>"+e+"</p>":e)}),a.addButton("pagebreak",{title:"Page break",cmd:"mcePageBreak"}),a.addMenuItem("pagebreak",{text:"Page break",icon:"pagebreak",cmd:"mcePageBreak",context:"insert"}),a.on("ResolveName",function(c){"IMG"==c.target.nodeName&&a.dom.hasClass(c.target,b)&&(c.name="pagebreak")}),a.on("click",function(c){c=c.target,"IMG"===c.nodeName&&a.dom.hasClass(c,b)&&a.selection.select(c)}),a.on("BeforeSetContent",function(a){a.content=a.content.replace(d,e)}),a.on("PreInit",function(){a.serializer.addNodeFilter("img",function(b){for(var d,e,f=b.length;f--;)if(d=b[f],e=d.attr("class"),e&&-1!==e.indexOf("mce-pagebreak")){var g=d.parent;if(a.schema.getBlockElements()[g.name]&&a.settings.pagebreak_split_block){g.type=3,g.value=c,g.raw=!0,d.remove();continue}d.type=3,d.value=c,d.raw=!0}})})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/paste/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+!function(a,b){"use strict";function c(a,b){for(var c,d=[],f=0;f<a.length;++f){if(c=g[a[f]]||e(a[f]),!c)throw"module definition dependecy not found: "+a[f];d.push(c)}b.apply(null,d)}function d(a,d,e){if("string"!=typeof a)throw"invalid module definition, module id must be defined and be a string";if(d===b)throw"invalid module definition, dependencies must be specified";if(e===b)throw"invalid module definition, definition function must be specified";c(d,function(){g[a]=e.apply(null,arguments)})}function e(b){for(var c=a,d=b.split(/[.\/]/),e=0;e<d.length;++e){if(!c[d[e]])return;c=c[d[e]]}return c}function f(c){for(var d=0;d<c.length;d++){for(var e=a,f=c[d],h=f.split(/[.\/]/),i=0;i<h.length-1;++i)e[h[i]]===b&&(e[h[i]]={}),e=e[h[i]];e[h[h.length-1]]=g[f]}}var g={};d("tinymce/pasteplugin/Utils",["tinymce/util/Tools","tinymce/html/DomParser","tinymce/html/Schema"],function(a,b,c){function d(b,c){return a.each(c,function(a){b=a.constructor==RegExp?b.replace(a,""):b.replace(a[0],a[1])}),b}function e(e){function f(a){var b=a.name,c=a;if("br"===b)return void(i+="\n");if(j[b]&&(i+=" "),k[b])return void(i+=" ");if(3==a.type&&(i+=a.value),!a.shortEnded&&(a=a.firstChild))do f(a);while(a=a.next);l[b]&&c.next&&(i+="\n","p"==b&&(i+="\n"))}var g=new c,h=new b({},g),i="",j=g.getShortEndedElements(),k=a.makeMap("script noscript style textarea video audio iframe object"," "),l=g.getBlockElements();return e=d(e,[/<!\[[^\]]+\]>/g]),f(h.parse(e)),i}function f(a){function b(a,b,c){return b||c?"\xa0":" "}return a=d(a,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,b],/<br>$/i])}return{filter:d,innerText:e,trimHtml:f}}),d("tinymce/pasteplugin/Clipboard",["tinymce/Env","tinymce/dom/RangeUtils","tinymce/util/VK","tinymce/pasteplugin/Utils"],function(a,b,c,d){return function(e){function f(a){var b,c=e.dom;if(b=e.fire("BeforePastePreProcess",{content:a}),b=e.fire("PastePreProcess",b),a=b.content,!b.isDefaultPrevented()){if(e.hasEventListeners("PastePostProcess")&&!b.isDefaultPrevented()){var d=c.add(e.getBody(),"div",{style:"display:none"},a);b=e.fire("PastePostProcess",{node:d}),c.remove(d),a=b.node.innerHTML}b.isDefaultPrevented()||e.insertContent(a,{merge:e.settings.paste_merge_formats!==!1})}}function g(a){a=e.dom.encode(a).replace(/\r\n/g,"\n");var b,c=e.dom.getParent(e.selection.getStart(),e.dom.isBlock),g=e.settings.forced_root_block;g&&(b=e.dom.createHTML(g,e.settings.forced_root_block_attrs),b=b.substr(0,b.length-3)+">"),c&&/^(PRE|DIV)$/.test(c.nodeName)||!g?a=d.filter(a,[[/\n/g,"<br>"]]):(a=d.filter(a,[[/\n\n/g,"</p>"+b],[/^(.*<\/p>)(<p>)$/,b+"$1"],[/\n/g,"<br />"]]),-1!=a.indexOf("<p>")&&(a=b+a)),f(a)}function h(){function b(a){var b,c,e,f=a.startContainer;if(b=a.getClientRects(),b.length)return b[0];if(a.collapsed&&1==f.nodeType){for(e=f.childNodes[t.startOffset];e&&3==e.nodeType&&!e.data.length;)e=e.nextSibling;if(e)return"BR"==e.tagName&&(c=d.doc.createTextNode("\ufeff"),e.parentNode.insertBefore(c,e),a=d.createRng(),a.setStartBefore(c),a.setEndAfter(c),b=a.getClientRects(),d.remove(c)),b.length?b[0]:void 0}}var c,d=e.dom,f=e.getBody(),g=e.dom.getViewPort(e.getWin()),h=g.y,i=20;if(t=e.selection.getRng(),e.inline&&(c=e.selection.getScrollContainer(),c&&c.scrollTop>0&&(h=c.scrollTop)),t.getClientRects){var j=b(t);if(j)i=h+(j.top-d.getPos(f).y);else{i=h;var k=t.startContainer;k&&(3==k.nodeType&&k.parentNode!=f&&(k=k.parentNode),1==k.nodeType&&(i=d.getPos(k,c||f).y))}}s=d.add(e.getBody(),"div",{id:"mcepastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: absolute; top: "+i+"px;width: 10px; height: 10px; overflow: hidden; opacity: 0"},y),(a.ie||a.gecko)&&d.setStyle(s,"left","rtl"==d.getStyle(f,"direction",!0)?65535:-65535),d.bind(s,"beforedeactivate focusin focusout",function(a){a.stopPropagation()}),s.focus(),e.selection.select(s,!0)}function i(){if(s){for(var a;a=e.dom.get("mcepastebin");)e.dom.remove(a),e.dom.unbind(a);t&&e.selection.setRng(t)}s=t=null}function j(){var a,b,c,d,f="";for(a=e.dom.select("div[id=mcepastebin]"),b=0;b<a.length;b++)c=a[b],c.firstChild&&"mcepastebin"==c.firstChild.id&&(c=c.firstChild),d=c.innerHTML,f!=y&&(f+=d);return f}function k(a){var b={};if(a){if(a.getData){var c=a.getData("Text");c&&c.length>0&&-1==c.indexOf(z)&&(b["text/plain"]=c)}if(a.types)for(var d=0;d<a.types.length;d++){var e=a.types[d];b[e]=a.getData(e)}}return b}function l(a){return k(a.clipboardData||e.getDoc().dataTransfer)}function m(a,b){function c(c){function d(a){b&&(e.selection.setRng(b),b=null),f('<img src="'+a.result+'">')}var g,h,i,j=!1;if(c)for(g=0;g<c.length;g++)h=c[g],/^image\/(jpeg|png|gif|bmp)$/.test(h.type)&&(i=new FileReader,i.onload=d.bind(null,i),i.readAsDataURL(h.getAsFile?h.getAsFile():h),a.preventDefault(),j=!0);return j}var d=a.clipboardData||a.dataTransfer;return e.settings.paste_data_images&&d?c(d.items)||c(d.files):void 0}function n(a){var b=a.clipboardData;return-1!=navigator.userAgent.indexOf("Android")&&b&&b.items&&0===b.items.length}function o(a){return b.getCaretRangeFromPoint(a.clientX,a.clientY,e.getDoc())}function p(a,b){return b in a&&a[b].length>0}function q(a){return c.metaKeyPressed(a)&&86==a.keyCode||a.shiftKey&&45==a.keyCode}function r(){e.on("keydown",function(b){function c(a){q(a)&&!a.isDefaultPrevented()&&i()}if(q(b)&&!b.isDefaultPrevented()){if(u=b.shiftKey&&86==b.keyCode,u&&a.webkit&&-1!=navigator.userAgent.indexOf("Version/"))return;if(b.stopImmediatePropagation(),w=(new Date).getTime(),a.ie&&u)return b.preventDefault(),void e.fire("paste",{ieFake:!0});i(),h(),e.once("keyup",c),e.once("paste",function(){e.off("keyup",c)})}}),e.on("paste",function(b){var c=(new Date).getTime(),k=l(b),o=(new Date).getTime()-c,q=(new Date).getTime()-w-o<1e3,r="text"==v.pasteFormat||u;return u=!1,b.isDefaultPrevented()||n(b)?void i():m(b)?void i():(q||b.preventDefault(),!a.ie||q&&!b.ieFake||(h(),e.dom.bind(s,"paste",function(a){a.stopPropagation()}),e.getDoc().execCommand("Paste",!1,null),k["text/html"]=j()),void setTimeout(function(){var a;return p(k,"text/html")?a=k["text/html"]:(a=j(),a==y&&(r=!0)),a=d.trimHtml(a),s&&s.firstChild&&"mcepastebin"===s.firstChild.id&&(r=!0),i(),a.length||(r=!0),r&&(a=p(k,"text/plain")&&-1==a.indexOf("</p>")?k["text/plain"]:d.innerText(a)),a==y?void(q||e.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.")):void(r?g(a):f(a))},0))}),e.on("dragstart dragend",function(a){x="dragstart"==a.type}),e.on("drop",function(a){var b=o(a);if(!a.isDefaultPrevented()&&!x&&!m(a,b)&&b&&e.settings.paste_filter_drop!==!1){var c=k(a.dataTransfer),h=c["mce-internal"]||c["text/html"]||c["text/plain"];h&&(a.preventDefault(),e.undoManager.transact(function(){c["mce-internal"]&&e.execCommand("Delete"),e.selection.setRng(b),h=d.trimHtml(h),c["text/html"]?f(h):g(h)}))}}),e.on("dragover dragend",function(a){e.settings.paste_data_images&&a.preventDefault()})}var s,t,u,v=this,w=0,x=!1,y="%MCEPASTEBIN%",z="data:text/mce-internal,";v.pasteHtml=f,v.pasteText=g,e.on("preInit",function(){r(),e.parser.addNodeFilter("img",function(b){if(!e.settings.paste_data_images)for(var c=b.length;c--;){var d=b[c].attributes.map.src;d&&/^(data:image|webkit\-fake\-url)/.test(d)&&(b[c].attr("data-mce-object")||d===a.transparentSrc||b[c].remove())}})})}}),d("tinymce/pasteplugin/WordFilter",["tinymce/util/Tools","tinymce/html/DomParser","tinymce/html/Schema","tinymce/html/Serializer","tinymce/html/Node","tinymce/pasteplugin/Utils"],function(a,b,c,d,e,f){function g(a){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(a)||/class="OutlineElement/.test(a)||/id="?docs\-internal\-guid\-/.test(a)}function h(b){var c,d;return d=[/^[IVXLMCD]{1,2}\.[ \u00a0]/,/^[ivxlmcd]{1,2}\.[ \u00a0]/,/^[a-z]{1,2}[\.\)][ \u00a0]/,/^[A-Z]{1,2}[\.\)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/],b=b.replace(/^[\u00a0 ]+/,""),a.each(d,function(a){return a.test(b)?(c=!0,!1):void 0}),c}function i(a){return/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(a)}function j(j){var k=j.settings;j.on("BeforePastePreProcess",function(l){function m(a){function b(a){var c="";if(3===a.type)return a.value;if(a=a.firstChild)do c+=b(a);while(a=a.next);return c}function c(a,b){if(3===a.type&&b.test(a.value))return a.value=a.value.replace(b,""),!1;if(a=a.firstChild)do if(!c(a,b))return!1;while(a=a.next);return!0}function d(a){if(a._listIgnore)return void a.remove();if(a=a.firstChild)do d(a);while(a=a.next)}function f(a,b,f){var h=a._listLevel||k;h!=k&&(k>h?g&&(g=g.parent.parent):(j=g,g=null)),g&&g.name==b?g.append(a):(j=j||g,g=new e(b,1),f>1&&g.attr("start",""+f),a.wrap(g)),a.name="li",h>k&&j&&j.lastChild.append(g),k=h,d(a),c(a,/^\u00a0+/),c(a,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),c(a,/^\u00a0+/)}for(var g,j,k=1,l=[],m=a.firstChild;"undefined"!=typeof m&&null!==m;)if(l.push(m),m=m.walk(),null!==m)for(;"undefined"!=typeof m&&m.parent!==a;)m=m.walk();for(var n=0;n<l.length;n++)if(a=l[n],"p"==a.name&&a.firstChild){var o=b(a);if(i(o)){f(a,"ul");continue}if(h(o)){var p=/([0-9]+)\./.exec(o),q=1;p&&(q=parseInt(p[1],10)),f(a,"ol",q);continue}if(a._listLevel){f(a,"ul",1);continue}g=null}else j=g,g=null}function n(b,c){var d,f={},g=j.dom.parseStyle(c);return a.each(g,function(a,e){switch(e){case"mso-list":d=/\w+ \w+([0-9]+)/i.exec(c),d&&(b._listLevel=parseInt(d[1],10)),/Ignore/i.test(a)&&b.firstChild&&(b._listIgnore=!0,b.firstChild._listIgnore=!0);break;case"horiz-align":e="text-align";break;case"vert-align":e="vertical-align";break;case"font-color":case"mso-foreground":e="color";break;case"mso-background":case"mso-highlight":e="background";break;case"font-weight":case"font-style":return void("normal"!=a&&(f[e]=a));case"mso-element":if(/^(comment|comment-list)$/i.test(a))return void b.remove()}return 0===e.indexOf("mso-comment")?void b.remove():void(0!==e.indexOf("mso-")&&("all"==o||p&&p[e])&&(f[e]=a))}),/(bold)/i.test(f["font-weight"])&&(delete f["font-weight"],b.wrap(new e("b",1))),/(italic)/i.test(f["font-style"])&&(delete f["font-style"],b.wrap(new e("i",1))),f=j.dom.serializeStyle(f,b.name),f?f:null}var o,p,q=l.content;if(q=q.replace(/<b[^>]+id="?docs-internal-[^>]*>/gi,""),q=q.replace(/<br class="?Apple-interchange-newline"?>/gi,""),o=k.paste_retain_style_properties,o&&(p=a.makeMap(o.split(/[, ]/))),k.paste_enable_default_filters!==!1&&g(l.content)){l.wordContent=!0,q=f.filter(q,[/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/&nbsp;/gi,"\xa0"],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(a,b){return b.length>0?b.replace(/./," ").slice(Math.floor(b.length/2)).split("").join("\xa0"):""}]]);var r=k.paste_word_valid_elements;r||(r="-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody");var s=new c({valid_elements:r,valid_children:"-li[p]"});a.each(s.elements,function(a){a.attributes["class"]||(a.attributes["class"]={},a.attributesOrder.push("class")),a.attributes.style||(a.attributes.style={},a.attributesOrder.push("style"))});var t=new b({},s);t.addAttributeFilter("style",function(a){for(var b,c=a.length;c--;)b=a[c],b.attr("style",n(b,b.attr("style"))),"span"==b.name&&b.parent&&!b.attributes.length&&b.unwrap()}),t.addAttributeFilter("class",function(a){for(var b,c,d=a.length;d--;)b=a[d],c=b.attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(c)&&b.remove(),b.attr("class",null)}),t.addNodeFilter("del",function(a){for(var b=a.length;b--;)a[b].remove()}),t.addNodeFilter("a",function(a){for(var b,c,d,e=a.length;e--;)if(b=a[e],c=b.attr("href"),d=b.attr("name"),c&&-1!=c.indexOf("#_msocom_"))b.remove();else if(c&&0===c.indexOf("file://")&&(c=c.split("#")[1],c&&(c="#"+c)),c||d){if(d&&!/^_?(?:toc|edn|ftn)/i.test(d)){b.unwrap();continue}b.attr({href:c,name:d})}else b.unwrap()});var u=t.parse(q);k.paste_convert_word_fake_lists!==!1&&m(u),l.content=new d({},s).serialize(u)}})}return j.isWordContent=g,j}),d("tinymce/pasteplugin/Quirks",["tinymce/Env","tinymce/util/Tools","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Utils"],function(a,b,c,d){return function(e){function f(a){e.on("BeforePastePreProcess",function(b){b.content=a(b.content)})}function g(a){if(!c.isWordContent(a))return a;var f=[];b.each(e.schema.getBlockElements(),function(a,b){f.push(b)});var g=new RegExp("(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*(<\\/?("+f.join("|")+")[^>]*>)(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*","g");return a=d.filter(a,[[g,"$1"]]),a=d.filter(a,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function h(a){if(c.isWordContent(a))return a;var b=e.settings.paste_webkit_styles;if(e.settings.paste_remove_styles_if_webkit===!1||"all"==b)return a;if(b&&(b=b.split(/[, ]/)),b){var d=e.dom,f=e.selection.getNode();a=a.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(a,c,e,g){var h=d.parseStyle(e,"span"),i={};if("none"===b)return c+g;for(var j=0;j<b.length;j++){var k=h[b[j]],l=d.getStyle(f,b[j],!0);/color/.test(b[j])&&(k=d.toHex(k),l=d.toHex(l)),l!=k&&(i[b[j]]=k)}return i=d.serializeStyle(i,"span"),i?c+' style="'+i+'"'+g:c+g})}else a=a.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return a=a.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(a,b,c,d){return b+' style="'+c+'"'+d})}a.webkit&&f(h),a.ie&&f(g)}}),d("tinymce/pasteplugin/Plugin",["tinymce/PluginManager","tinymce/pasteplugin/Clipboard","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Quirks"],function(a,b,c,d){var e;a.add("paste",function(a){function f(){"text"==g.pasteFormat?(this.active(!1),g.pasteFormat="html"):(g.pasteFormat="text",this.active(!0),e||(a.windowManager.alert("Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off."),e=!0))}var g,h=this,i=a.settings;h.clipboard=g=new b(a),h.quirks=new d(a),h.wordFilter=new c(a),a.settings.paste_as_text&&(h.clipboard.pasteFormat="text"),i.paste_preprocess&&a.on("PastePreProcess",function(a){i.paste_preprocess.call(h,h,a)}),i.paste_postprocess&&a.on("PastePostProcess",function(a){i.paste_postprocess.call(h,h,a)}),a.addCommand("mceInsertClipboardContent",function(a,b){b.content&&h.clipboard.pasteHtml(b.content),b.text&&h.clipboard.pasteText(b.text)}),a.paste_block_drop&&a.on("dragend dragover draggesture dragdrop drop drag",function(a){a.preventDefault(),a.stopPropagation()}),a.settings.paste_data_images||a.on("drop",function(a){var b=a.dataTransfer;b&&b.files&&b.files.length>0&&a.preventDefault()}),a.addButton("pastetext",{icon:"pastetext",tooltip:"Paste as text",onclick:f,active:"text"==h.clipboard.pasteFormat}),a.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:g.pasteFormat,onclick:f})})}),f(["tinymce/pasteplugin/Utils"])}(this);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/preview/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("preview",function(a){var b=a.settings,c=!tinymce.Env.ie;a.addCommand("mcePreview",function(){a.windowManager.open({title:"Preview",width:parseInt(a.getParam("plugin_preview_width","650"),10),height:parseInt(a.getParam("plugin_preview_height","500"),10),html:'<iframe src="javascript:\'\'" frameborder="0"'+(c?' sandbox="allow-scripts"':"")+"></iframe>",buttons:{text:"Close",onclick:function(){this.parent().parent().close()}},onPostRender:function(){var d,e="";e+='<base href="'+a.documentBaseURI.getURI()+'">',tinymce.each(a.contentCSS,function(b){e+='<link type="text/css" rel="stylesheet" href="'+a.documentBaseURI.toAbsolute(b)+'">'});var f=b.body_id||"tinymce";-1!=f.indexOf("=")&&(f=a.getParam("body_id","","hash"),f=f[a.id]||f);var g=b.body_class||"";-1!=g.indexOf("=")&&(g=a.getParam("body_class","","hash"),g=g[a.id]||"");var h=a.settings.directionality?' dir="'+a.settings.directionality+'"':"";if(d="<!DOCTYPE html><html><head>"+e+'</head><body id="'+f+'" class="mce-content-body '+g+'"'+h+">"+a.getContent()+"</body></html>",c)this.getEl("body").firstChild.src="data:text/html;charset=utf-8,"+encodeURIComponent(d);else{var i=this.getEl("body").firstChild.contentWindow.document;i.open(),i.write(d),i.close()}}})}),a.addButton("preview",{title:"Preview",cmd:"mcePreview"}),a.addMenuItem("preview",{text:"Preview",cmd:"mcePreview",context:"view"})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/print/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("print",function(a){a.addCommand("mcePrint",function(){a.getWin().print()}),a.addButton("print",{title:"Print",cmd:"mcePrint"}),a.addShortcut("Meta+P","","mcePrint"),a.addMenuItem("print",{text:"Print",cmd:"mcePrint",icon:"print",shortcut:"Meta+P",context:"file"})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/save/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("save",function(a){function b(){var b;return b=tinymce.DOM.getParent(a.id,"form"),!a.getParam("save_enablewhendirty",!0)||a.isDirty()?(tinymce.triggerSave(),a.getParam("save_onsavecallback")?void(a.execCallback("save_onsavecallback",a)&&(a.startContent=tinymce.trim(a.getContent({format:"raw"})),a.nodeChanged())):void(b?(a.isNotDirty=!0,(!b.onsubmit||b.onsubmit())&&("function"==typeof b.submit?b.submit():a.windowManager.alert("Error: Form submit field collision.")),a.nodeChanged()):a.windowManager.alert("Error: No form element found."))):void 0}function c(){var b=tinymce.trim(a.startContent);return a.getParam("save_oncancelcallback")?void a.execCallback("save_oncancelcallback",a):(a.setContent(b),a.undoManager.clear(),void a.nodeChanged())}function d(){var b=this;a.on("nodeChange",function(){b.disabled(a.getParam("save_enablewhendirty",!0)&&!a.isDirty())})}a.addCommand("mceSave",b),a.addCommand("mceCancel",c),a.addButton("save",{icon:"save",text:"Save",cmd:"mceSave",disabled:!0,onPostRender:d}),a.addButton("cancel",{text:"Cancel",icon:!1,cmd:"mceCancel",disabled:!0,onPostRender:d}),a.addShortcut("Meta+S","","mceSave")});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/searchreplace/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+!function(){function a(a,b,c,d,e){function f(a,b){if(b=b||0,!a[0])throw"findAndReplaceDOMText cannot handle zero-length matches";var c=a.index;if(b>0){var d=a[b];if(!d)throw"Invalid capture group";c+=a[0].indexOf(d),a[0]=d}return[c,c+a[0].length,[a[0]]]}function g(a){var b;if(3===a.nodeType)return a.data;if(n[a.nodeName]&&!m[a.nodeName])return"";if(b="",(m[a.nodeName]||o[a.nodeName])&&(b+="\n"),a=a.firstChild)do b+=g(a);while(a=a.nextSibling);return b}function h(a,b,c){var d,e,f,g,h=[],i=0,j=a,k=b.shift(),l=0;a:for(;;){if((m[j.nodeName]||o[j.nodeName])&&i++,3===j.nodeType&&(!e&&j.length+i>=k[1]?(e=j,g=k[1]-i):d&&h.push(j),!d&&j.length+i>k[0]&&(d=j,f=k[0]-i),i+=j.length),d&&e){if(j=c({startNode:d,startNodeIndex:f,endNode:e,endNodeIndex:g,innerNodes:h,match:k[2],matchIndex:l}),i-=e.length-g,d=null,e=null,h=[],k=b.shift(),l++,!k)break}else{if((!n[j.nodeName]||m[j.nodeName])&&j.firstChild){j=j.firstChild;continue}if(j.nextSibling){j=j.nextSibling;continue}}for(;;){if(j.nextSibling){j=j.nextSibling;break}if(j.parentNode===a)break a;j=j.parentNode}}}function i(a){var b;if("function"!=typeof a){var c=a.nodeType?a:l.createElement(a);b=function(a,b){var d=c.cloneNode(!1);return d.setAttribute("data-mce-index",b),a&&d.appendChild(l.createTextNode(a)),d}}else b=a;return function(a){var c,d,e,f=a.startNode,g=a.endNode,h=a.matchIndex;if(f===g){var i=f;e=i.parentNode,a.startNodeIndex>0&&(c=l.createTextNode(i.data.substring(0,a.startNodeIndex)),e.insertBefore(c,i));var j=b(a.match[0],h);return e.insertBefore(j,i),a.endNodeIndex<i.length&&(d=l.createTextNode(i.data.substring(a.endNodeIndex)),e.insertBefore(d,i)),i.parentNode.removeChild(i),j}c=l.createTextNode(f.data.substring(0,a.startNodeIndex)),d=l.createTextNode(g.data.substring(a.endNodeIndex));for(var k=b(f.data.substring(a.startNodeIndex),h),m=[],n=0,o=a.innerNodes.length;o>n;++n){var p=a.innerNodes[n],q=b(p.data,h);p.parentNode.replaceChild(q,p),m.push(q)}var r=b(g.data.substring(0,a.endNodeIndex),h);return e=f.parentNode,e.insertBefore(c,f),e.insertBefore(k,f),e.removeChild(f),e=g.parentNode,e.insertBefore(r,g),e.insertBefore(d,g),e.removeChild(g),r}}var j,k,l,m,n,o,p=[],q=0;if(l=b.ownerDocument,m=e.getBlockElements(),n=e.getWhiteSpaceElements(),o=e.getShortEndedElements(),k=g(b)){if(a.global)for(;j=a.exec(k);)p.push(f(j,d));else j=k.match(a),p.push(f(j,d));return p.length&&(q=p.length,h(b,p,i(c))),q}}function b(b){function c(){function a(){e.statusbar.find("#next").disabled(!g(k+1).length),e.statusbar.find("#prev").disabled(!g(k-1).length)}function c(){tinymce.ui.MessageBox.alert("Could not find the specified string.",function(){e.find("#find")[0].focus()})}var d={},e=tinymce.ui.Factory.create({type:"window",layout:"flex",pack:"center",align:"center",onClose:function(){b.focus(),j.done()},onSubmit:function(b){var f,h,i,l;return b.preventDefault(),h=e.find("#case").checked(),l=e.find("#words").checked(),i=e.find("#find").value(),i.length?d.text==i&&d.caseState==h&&d.wholeWord==l?0===g(k+1).length?void c():(j.next(),void a()):(f=j.find(i,h,l),f||c(),e.statusbar.items().slice(1).disabled(0===f),a(),void(d={text:i,caseState:h,wholeWord:l})):(j.done(!1),void e.statusbar.items().slice(1).disabled(!0))},buttons:[{text:"Find",onclick:function(){e.submit()}},{text:"Replace",disabled:!0,onclick:function(){j.replace(e.find("#replace").value())||(e.statusbar.items().slice(1).disabled(!0),k=-1,d={})}},{text:"Replace all",disabled:!0,onclick:function(){j.replace(e.find("#replace").value(),!0,!0),e.statusbar.items().slice(1).disabled(!0),d={}}},{type:"spacer",flex:1},{text:"Prev",name:"prev",disabled:!0,onclick:function(){j.prev(),a()}},{text:"Next",name:"next",disabled:!0,onclick:function(){j.next(),a()}}],title:"Find and replace",items:{type:"form",padding:20,labelGap:30,spacing:10,items:[{type:"textbox",name:"find",size:40,label:"Find",value:b.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()}function d(a){var b=a.getAttribute("data-mce-index");return"number"==typeof b?""+b:b}function e(c){var d,e;return e=b.dom.create("span",{"data-mce-bogus":1}),e.className="mce-match-marker",d=b.getBody(),j.done(!1),a(c,d,e,!1,b.schema)}function f(a){var b=a.parentNode;a.firstChild&&b.insertBefore(a.firstChild,a),a.parentNode.removeChild(a)}function g(a){var c,e=[];if(c=tinymce.toArray(b.getBody().getElementsByTagName("span")),c.length)for(var f=0;f<c.length;f++){var g=d(c[f]);null!==g&&g.length&&g===a.toString()&&e.push(c[f])}return e}function h(a){var c=k,d=b.dom;a=a!==!1,a?c++:c--,d.removeClass(g(k),"mce-match-marker-selected");var e=g(c);return e.length?(d.addClass(g(c),"mce-match-marker-selected"),b.selection.scrollIntoView(e[0]),c):-1}function i(a){a.parentNode.removeChild(a)}var j=this,k=-1;j.init=function(a){a.addMenuItem("searchreplace",{text:"Find and replace",shortcut:"Meta+F",onclick:c,separator:"before",context:"edit"}),a.addButton("searchreplace",{tooltip:"Find and replace",shortcut:"Meta+F",onclick:c}),a.addCommand("SearchReplace",c),a.shortcuts.add("Meta+F","",c)},j.find=function(a,b,c){a=a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),a=c?"\\b"+a+"\\b":a;var d=e(new RegExp(a,b?"g":"gi"));return d&&(k=-1,k=h(!0)),d},j.next=function(){var a=h(!0);-1!==a&&(k=a)},j.prev=function(){var a=h(!1);-1!==a&&(k=a)},j.replace=function(a,c,e){var h,l,m,n,o,p,q=k;for(c=c!==!1,m=b.getBody(),l=tinymce.toArray(m.getElementsByTagName("span")),h=0;h<l.length;h++){var r=d(l[h]);if(null!==r&&r.length)if(n=o=parseInt(r,10),e||n===k){for(a.length?(l[h].firstChild.nodeValue=a,f(l[h])):i(l[h]);l[++h];)if(n=d(l[h]),null!==r&&r.length){if(n!==o){h--;break}i(l[h])}c&&q--}else o>k&&l[h].setAttribute("data-mce-index",o-1)}return b.undoManager.add(),k=q,c?(p=g(q+1).length>0,j.next()):(p=g(q-1).length>0,j.prev()),!e&&p},j.done=function(a){var c,e,g,h;for(e=tinymce.toArray(b.getBody().getElementsByTagName("span")),c=0;c<e.length;c++){var i=d(e[c]);null!==i&&i.length&&(i===k.toString()&&(g||(g=e[c].firstChild),h=e[c].firstChild),f(e[c]))}if(g&&h){var j=b.dom.createRng();return j.setStart(g,0),j.setEnd(h,h.data.length),a!==!1&&b.selection.setRng(j),j}}}tinymce.PluginManager.add("searchreplace",b)}();
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/spellchecker/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+!function(a,b){"use strict";function c(a,b){for(var c,d=[],f=0;f<a.length;++f){if(c=g[a[f]]||e(a[f]),!c)throw"module definition dependecy not found: "+a[f];d.push(c)}b.apply(null,d)}function d(a,d,e){if("string"!=typeof a)throw"invalid module definition, module id must be defined and be a string";if(d===b)throw"invalid module definition, dependencies must be specified";if(e===b)throw"invalid module definition, definition function must be specified";c(d,function(){g[a]=e.apply(null,arguments)})}function e(b){for(var c=a,d=b.split(/[.\/]/),e=0;e<d.length;++e){if(!c[d[e]])return;c=c[d[e]]}return c}function f(c){for(var d=0;d<c.length;d++){for(var e=a,f=c[d],h=f.split(/[.\/]/),i=0;i<h.length-1;++i)e[h[i]]===b&&(e[h[i]]={}),e=e[h[i]];e[h[h.length-1]]=g[f]}}var g={};d("tinymce/spellcheckerplugin/DomTextMatcher",[],function(){return function(a,b){function c(a,b){if(!a[0])throw"findAndReplaceDOMText cannot handle zero-length matches";return{start:a.index,end:a.index+a[0].length,text:a[0],data:b}}function d(a){var b;if(3===a.nodeType)return a.data;if(x[a.nodeName]&&!w[a.nodeName])return"";if(b="",(w[a.nodeName]||y[a.nodeName])&&(b+="\n"),a=a.firstChild)do b+=d(a);while(a=a.nextSibling);return b}function e(a,b,c){var d,e,f,g,h,i=[],j=0,k=a,l=0;b=b.slice(0),b.sort(function(a,b){return a.start-b.start}),h=b.shift();a:for(;;){if((w[k.nodeName]||y[k.nodeName])&&j++,3===k.nodeType&&(!e&&k.length+j>=h.end?(e=k,g=h.end-j):d&&i.push(k),!d&&k.length+j>h.start&&(d=k,f=h.start-j),j+=k.length),d&&e){if(k=c({startNode:d,startNodeIndex:f,endNode:e,endNodeIndex:g,innerNodes:i,match:h.text,matchIndex:l}),j-=e.length-g,d=null,e=null,i=[],h=b.shift(),l++,!h)break}else{if((!x[k.nodeName]||w[k.nodeName])&&k.firstChild){k=k.firstChild;continue}if(k.nextSibling){k=k.nextSibling;continue}}for(;;){if(k.nextSibling){k=k.nextSibling;break}if(k.parentNode===a)break a;k=k.parentNode}}}function f(a){function b(b,c){var d=z[c];d.stencil||(d.stencil=a(d));var e=d.stencil.cloneNode(!1);return e.setAttribute("data-mce-index",c),b&&e.appendChild(A.doc.createTextNode(b)),e}return function(a){var c,d,e,f=a.startNode,g=a.endNode,h=a.matchIndex,i=A.doc;if(f===g){var j=f;e=j.parentNode,a.startNodeIndex>0&&(c=i.createTextNode(j.data.substring(0,a.startNodeIndex)),e.insertBefore(c,j));var k=b(a.match,h);return e.insertBefore(k,j),a.endNodeIndex<j.length&&(d=i.createTextNode(j.data.substring(a.endNodeIndex)),e.insertBefore(d,j)),j.parentNode.removeChild(j),k}c=i.createTextNode(f.data.substring(0,a.startNodeIndex)),d=i.createTextNode(g.data.substring(a.endNodeIndex));for(var l=b(f.data.substring(a.startNodeIndex),h),m=[],n=0,o=a.innerNodes.length;o>n;++n){var p=a.innerNodes[n],q=b(p.data,h);p.parentNode.replaceChild(q,p),m.push(q)}var r=b(g.data.substring(0,a.endNodeIndex),h);return e=f.parentNode,e.insertBefore(c,f),e.insertBefore(l,f),e.removeChild(f),e=g.parentNode,e.insertBefore(r,g),e.insertBefore(d,g),e.removeChild(g),r}}function g(a){var b=a.parentNode;b.insertBefore(a.firstChild,a),a.parentNode.removeChild(a)}function h(b){var c=a.getElementsByTagName("*"),d=[];b="number"==typeof b?""+b:null;for(var e=0;e<c.length;e++){var f=c[e],g=f.getAttribute("data-mce-index");null!==g&&g.length&&(g===b||null===b)&&d.push(f)}return d}function i(a){for(var b=z.length;b--;)if(z[b]===a)return b;return-1}function j(a){var b=[];return k(function(c,d){a(c,d)&&b.push(c)}),z=b,this}function k(a){for(var b=0,c=z.length;c>b&&a(z[b],b)!==!1;b++);return this}function l(b){return z.length&&e(a,z,f(b)),this}function m(a,b){if(v&&a.global)for(;u=a.exec(v);)z.push(c(u,b));return this}function n(a){var b,c=h(a?i(a):null);for(b=c.length;b--;)g(c[b]);return this}function o(a){return z[a.getAttribute("data-mce-index")]}function p(a){return h(i(a))[0]}function q(a,b,c){return z.push({start:a,end:a+b,text:v.substr(a,b),data:c}),this}function r(a){var c=h(i(a)),d=b.dom.createRng();return d.setStartBefore(c[0]),d.setEndAfter(c[c.length-1]),d}function s(a,c){var d=r(a);return d.deleteContents(),c.length>0&&d.insertNode(b.dom.doc.createTextNode(c)),d}function t(){return z.splice(0,z.length),n(),this}var u,v,w,x,y,z=[],A=b.dom;return w=b.schema.getBlockElements(),x=b.schema.getWhiteSpaceElements(),y=b.schema.getShortEndedElements(),v=d(a),{text:v,matches:z,each:k,filter:j,reset:t,matchFromElement:o,elementFromMatch:p,find:m,add:q,wrap:l,unwrap:n,replace:s,rangeFromMatch:r,indexOf:i}}}),d("tinymce/spellcheckerplugin/Plugin",["tinymce/spellcheckerplugin/DomTextMatcher","tinymce/PluginManager","tinymce/util/Tools","tinymce/ui/Menu","tinymce/dom/DOMUtils","tinymce/util/XHR","tinymce/util/URI","tinymce/util/JSON"],function(a,b,c,d,e,f,g,h){b.add("spellchecker",function(b,i){function j(){return E.textMatcher||(E.textMatcher=new a(b.getBody(),b)),E.textMatcher}function k(a,b){var d=[];return c.each(b,function(a){d.push({selectable:!0,text:a.name,data:a.value})}),d}function l(a){for(var b in a)return!1;return!0}function m(a,f){var g=[],h=A[a];c.each(h,function(a){g.push({text:a,onclick:function(){b.insertContent(b.dom.encode(a)),b.dom.remove(f),r()}})}),g.push({text:"-"}),D&&g.push({text:"Add to Dictionary",onclick:function(){s(a,f)}}),g.push.apply(g,[{text:"Ignore",onclick:function(){t(a,f)}},{text:"Ignore all",onclick:function(){t(a,f,!0)}}]),C=new d({items:g,context:"contextmenu",onautohide:function(a){-1!=a.target.className.indexOf("spellchecker")&&a.preventDefault()},onhide:function(){C.remove(),C=null}}),C.renderTo(document.body);var i=e.DOM.getPos(b.getContentAreaContainer()),j=b.dom.getPos(f[0]),k=b.dom.getRoot();"BODY"==k.nodeName?(j.x-=k.ownerDocument.documentElement.scrollLeft||k.scrollLeft,j.y-=k.ownerDocument.documentElement.scrollTop||k.scrollTop):(j.x-=k.scrollLeft,j.y-=k.scrollTop),i.x+=j.x,i.y+=j.y,C.moveTo(i.x,i.y+f[0].offsetHeight)}function n(){return b.getParam("spellchecker_wordchar_pattern")||new RegExp('[^\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`\xa7\xa9\xab\xae\xb1\xb6\xb7\xb8\xbb\xbc\xbd\xbe\xbf\xd7\xf7\xa4\u201d\u201c\u201e\xa0\u2002\u2003\u2009]+',"g")}function o(a,b,d,e){var j={method:a},k="";"spellcheck"==a&&(j.text=b,j.lang=F.spellchecker_language),"addToDictionary"==a&&(j.word=b),c.each(j,function(a,b){k&&(k+="&"),k+=b+"="+encodeURIComponent(a)}),f.send({url:new g(i).toAbsolute(F.spellchecker_rpc_url),type:"post",content_type:"application/x-www-form-urlencoded",data:k,success:function(a){a=h.parse(a),a?a.error?e(a.error):d(a):e("Sever response wasn't proper JSON.")},error:function(a,b){e("Spellchecker request error: "+b.status)}})}function p(a,b,c,d){var e=F.spellchecker_callback||o;e.call(E,a,b,c,d)}function q(){function a(a){b.windowManager.alert(a),b.setProgressState(!1),u()}return B?void u():(u(),b.setProgressState(!0),p("spellcheck",j().text,y,a),void b.focus())}function r(){b.dom.select("span.mce-spellchecker-word").length||u()}function s(a,c){b.setProgressState(!0),p("addToDictionary",a,function(){b.setProgressState(!1),b.dom.remove(c,!0),r()},function(a){b.windowManager.alert(a),b.setProgressState(!1)})}function t(a,d,e){b.selection.collapse(),e?c.each(b.dom.select("span.mce-spellchecker-word"),function(c){c.getAttribute("data-mce-word")==a&&b.dom.remove(c,!0)}):b.dom.remove(d,!0),r()}function u(){j().reset(),E.textMatcher=null,B&&(B=!1,b.fire("SpellcheckEnd"))}function v(a){var b=a.getAttribute("data-mce-index");return"number"==typeof b?""+b:b}function w(a){var d,e=[];if(d=c.toArray(b.getBody().getElementsByTagName("span")),d.length)for(var f=0;f<d.length;f++){var g=v(d[f]);null!==g&&g.length&&g===a.toString()&&e.push(d[f])}return e}function x(a){var b=F.spellchecker_language;a.control.items().each(function(a){a.active(a.settings.data===b)})}function y(a){var c;return a.words?(D=!!a.dictionary,c=a.words):c=a,b.setProgressState(!1),l(c)?(b.windowManager.alert("No misspellings found"),void(B=!1)):(A=c,j().find(n()).filter(function(a){return!!c[a.text]}).wrap(function(a){return b.dom.create("span",{"class":"mce-spellchecker-word","data-mce-bogus":1,"data-mce-word":a.text})}),B=!0,void b.fire("SpellcheckStart"))}var z,A,B,C,D,E=this,F=b.settings,G=F.spellchecker_languages||"English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr_FR,German=de,Italian=it,Polish=pl,Portuguese=pt_BR,Spanish=es,Swedish=sv";z=k("Language",c.map(G.split(","),function(a){return a=a.split("="),{name:a[0],value:a[1]}})),b.on("click",function(a){var c=a.target;if("mce-spellchecker-word"==c.className){a.preventDefault();var d=w(v(c));if(d.length>0){var e=b.dom.createRng();e.setStartBefore(d[0]),e.setEndAfter(d[d.length-1]),b.selection.setRng(e),m(c.getAttribute("data-mce-word"),d)}}}),b.addMenuItem("spellchecker",{text:"Spellcheck",context:"tools",onclick:q,selectable:!0,onPostRender:function(){var a=this;a.active(B),b.on("SpellcheckStart SpellcheckEnd",function(){a.active(B)})}});var H={tooltip:"Spellcheck",onclick:q,onPostRender:function(){var a=this;b.on("SpellcheckStart SpellcheckEnd",function(){a.active(B)})}};z.length>1&&(H.type="splitbutton",H.menu=z,H.onshow=x,H.onselect=function(a){F.spellchecker_language=a.control.settings.data}),b.addButton("spellchecker",H),b.addCommand("mceSpellCheck",q),b.on("remove",function(){C&&(C.remove(),C=null)}),b.on("change",r),this.getTextMatcher=j,this.getWordCharPattern=n,this.markErrors=y,this.getLanguage=function(){return F.spellchecker_language},F.spellchecker_language=F.spellchecker_language||F.language||"en"})}),f(["tinymce/spellcheckerplugin/DomTextMatcher"])}(this);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/tabfocus/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("tabfocus",function(a){function b(a){9!==a.keyCode||a.ctrlKey||a.altKey||a.metaKey||a.preventDefault()}function c(b){function c(c){function f(a){return"BODY"===a.nodeName||"hidden"!=a.type&&"none"!=a.style.display&&"hidden"!=a.style.visibility&&f(a.parentNode)}function i(a){return/INPUT|TEXTAREA|BUTTON/.test(a.tagName)&&tinymce.get(b.id)&&-1!=a.tabIndex&&f(a)}if(h=d.select(":input:enabled,*[tabindex]:not(iframe)"),e(h,function(b,c){return b.id==a.id?(g=c,!1):void 0}),c>0){for(j=g+1;j<h.length;j++)if(i(h[j]))return h[j]}else for(j=g-1;j>=0;j--)if(i(h[j]))return h[j];return null}var g,h,i,j;if(!(9!==b.keyCode||b.ctrlKey||b.altKey||b.metaKey||b.isDefaultPrevented())&&(i=f(a.getParam("tab_focus",a.getParam("tabfocus_elements",":prev,:next"))),1==i.length&&(i[1]=i[0],i[0]=":prev"),h=b.shiftKey?":prev"==i[0]?c(-1):d.get(i[0]):":next"==i[1]?c(1):d.get(i[1]))){var k=tinymce.get(h.id||h.name);h.id&&k?k.focus():window.setTimeout(function(){tinymce.Env.webkit||window.focus(),h.focus()},10),b.preventDefault()}}var d=tinymce.DOM,e=tinymce.each,f=tinymce.explode;a.on("init",function(){a.inline&&tinymce.DOM.setAttrib(a.getBody(),"tabIndex",null),a.on("keyup",b),tinymce.Env.gecko?a.on("keypress keydown",c):a.on("keydown",c)})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/table/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+!function(a,b){"use strict";function c(a,b){for(var c,d=[],g=0;g<a.length;++g){if(c=f[a[g]]||e(a[g]),!c)throw"module definition dependecy not found: "+a[g];d.push(c)}b.apply(null,d)}function d(a,d,e){if("string"!=typeof a)throw"invalid module definition, module id must be defined and be a string";if(d===b)throw"invalid module definition, dependencies must be specified";if(e===b)throw"invalid module definition, definition function must be specified";c(d,function(){f[a]=e.apply(null,arguments)})}function e(b){for(var c=a,d=b.split(/[.\/]/),e=0;e<d.length;++e){if(!c[d[e]])return;c=c[d[e]]}return c}var f={};d("tinymce/tableplugin/TableGrid",["tinymce/util/Tools","tinymce/Env"],function(a,c){function d(a,b){return parseInt(a.getAttribute(b)||1,10)}var e=a.each;return function(f,g){function h(){var a=0;F=[],G=0,e(["thead","tbody","tfoot"],function(b){var c=L.select("> "+b+" tr",g);e(c,function(c,f){f+=a,e(L.select("> td, > th",c),function(a,c){var e,g,h,i;if(F[f])for(;F[f][c];)c++;for(h=d(a,"rowspan"),i=d(a,"colspan"),g=f;f+h>g;g++)for(F[g]||(F[g]=[]),e=c;c+i>e;e++)F[g][e]={part:b,real:g==f&&e==c,elm:a,rowspan:h,colspan:i};G=Math.max(G,c+1)})}),a+=c.length})}function i(a,b){return a=a.cloneNode(b),a.removeAttribute("id"),a}function j(a,b){var c;return c=F[b],c?c[a]:void 0}function k(a,b,c){a&&(c=parseInt(c,10),1===c?a.removeAttribute(b,1):a.setAttribute(b,c,1))}function l(a){return a&&(L.hasClass(a.elm,"mce-item-selected")||a==J)}function m(){var a=[];return e(g.rows,function(b){e(b.cells,function(c){return L.hasClass(c,"mce-item-selected")||J&&c==J.elm?(a.push(b),!1):void 0})}),a}function n(){var a=L.createRng();a.setStartAfter(g),a.setEndAfter(g),K.setRng(a),L.remove(g)}function o(b){var d,g={};return f.settings.table_clone_elements!==!1&&(g=a.makeMap((f.settings.table_clone_elements||"strong em b i span font h1 h2 h3 h4 h5 h6 p div").toUpperCase(),/[ ,]/)),a.walk(b,function(a){var f;return 3==a.nodeType?(e(L.getParents(a.parentNode,null,b).reverse(),function(a){g[a.nodeName]&&(a=i(a,!1),d?f&&f.appendChild(a):d=f=a,f=a)}),f&&(f.innerHTML=c.ie?"&nbsp;":'<br data-mce-bogus="1" />'),!1):void 0},"childNodes"),b=i(b,!1),k(b,"rowSpan",1),k(b,"colSpan",1),d?b.appendChild(d):(!c.ie||c.ie>10)&&(b.innerHTML='<br data-mce-bogus="1" />'),b}function p(){var a,b=L.createRng();return e(L.select("tr",g),function(a){0===a.cells.length&&L.remove(a)}),0===L.select("tr",g).length?(b.setStartBefore(g),b.setEndBefore(g),K.setRng(b),void L.remove(g)):(e(L.select("thead,tbody,tfoot",g),function(a){0===a.rows.length&&L.remove(a)}),h(),void(H&&(a=F[Math.min(F.length-1,H.y)],a&&(K.select(a[Math.min(a.length-1,H.x)].elm,!0),K.collapse(!0)))))}function q(a,b,c,d){var e,f,g,h,i;for(e=F[b][a].elm.parentNode,g=1;c>=g;g++)if(e=L.getNext(e,"tr")){for(f=a;f>=0;f--)if(i=F[b+g][f].elm,i.parentNode==e){for(h=1;d>=h;h++)L.insertAfter(o(i),i);break}if(-1==f)for(h=1;d>=h;h++)e.insertBefore(o(e.cells[0]),e.cells[0])}}function r(){e(F,function(a,b){e(a,function(a,c){var e,f,g;if(l(a)&&(a=a.elm,e=d(a,"colspan"),f=d(a,"rowspan"),e>1||f>1)){for(k(a,"rowSpan",1),k(a,"colSpan",1),g=0;e-1>g;g++)L.insertAfter(o(a),a);q(c,b,f-1,e)}})})}function s(b,c,d){var f,g,i,m,n,o,q,s,t,u,v;if(b?(f=A(b),g=f.x,i=f.y,m=g+(c-1),n=i+(d-1)):(H=I=null,e(F,function(a,b){e(a,function(a,c){l(a)&&(H||(H={x:c,y:b}),I={x:c,y:b})})}),H&&(g=H.x,i=H.y,m=I.x,n=I.y)),s=j(g,i),t=j(m,n),s&&t&&s.part==t.part){for(r(),h(),s=j(g,i).elm,k(s,"colSpan",m-g+1),k(s,"rowSpan",n-i+1),q=i;n>=q;q++)for(o=g;m>=o;o++)F[q]&&F[q][o]&&(b=F[q][o].elm,b!=s&&(u=a.grep(b.childNodes),e(u,function(a){s.appendChild(a)}),u.length&&(u=a.grep(s.childNodes),v=0,e(u,function(a){"BR"==a.nodeName&&L.getAttrib(a,"data-mce-bogus")&&v++<u.length-1&&s.removeChild(a)})),L.remove(b)));p()}}function t(a){var c,f,g,h,j,m,n,p,q;if(e(F,function(b,d){return e(b,function(b){return l(b)&&(b=b.elm,j=b.parentNode,m=i(j,!1),c=d,a)?!1:void 0}),a?!c:void 0}),c!==b){for(h=0;h<F[0].length;h++)if(F[c][h]&&(f=F[c][h].elm,f!=g)){if(a){if(c>0&&F[c-1][h]&&(p=F[c-1][h].elm,q=d(p,"rowSpan"),q>1)){k(p,"rowSpan",q+1);continue}}else if(q=d(f,"rowspan"),q>1){k(f,"rowSpan",q+1);continue}n=o(f),k(n,"colSpan",f.colSpan),m.appendChild(n),g=f}m.hasChildNodes()&&(a?j.parentNode.insertBefore(m,j):L.insertAfter(m,j))}}function u(a){var b,c;e(F,function(c){return e(c,function(c,d){return l(c)&&(b=d,a)?!1:void 0}),a?!b:void 0}),e(F,function(e,f){var g,h,i;e[b]&&(g=e[b].elm,g!=c&&(i=d(g,"colspan"),h=d(g,"rowspan"),1==i?a?(g.parentNode.insertBefore(o(g),g),q(b,f,h-1,i)):(L.insertAfter(o(g),g),q(b,f,h-1,i)):k(g,"colSpan",g.colSpan+1),c=g))})}function v(){var b=[];e(F,function(c){e(c,function(c,f){l(c)&&-1===a.inArray(b,f)&&(e(F,function(a){var b,c=a[f].elm;b=d(c,"colSpan"),b>1?k(c,"colSpan",b-1):L.remove(c)}),b.push(f))})}),p()}function w(){function a(a){var b,c;e(a.cells,function(a){var c=d(a,"rowSpan");c>1&&(k(a,"rowSpan",c-1),b=A(a),q(b.x,b.y,1,1))}),b=A(a.cells[0]),e(F[b.y],function(a){var b;a=a.elm,a!=c&&(b=d(a,"rowSpan"),1>=b?L.remove(a):k(a,"rowSpan",b-1),c=a)})}var b;b=m(),e(b.reverse(),function(b){a(b)}),p()}function x(){var a=m();return L.remove(a),p(),a}function y(){var a=m();return e(a,function(b,c){a[c]=i(b,!0)}),a}function z(a,b){var c=m(),d=c[b?0:c.length-1],f=d.cells.length;a&&(e(F,function(a){var b;return f=0,e(a,function(a){a.real&&(f+=a.colspan),a.elm.parentNode==d&&(b=1)}),b?!1:void 0}),b||a.reverse(),e(a,function(a){var c,e,g=a.cells.length;for(c=0;g>c;c++)e=a.cells[c],k(e,"colSpan",1),k(e,"rowSpan",1);for(c=g;f>c;c++)a.appendChild(o(a.cells[g-1]));for(c=f;g>c;c++)L.remove(a.cells[c]);b?d.parentNode.insertBefore(a,d):L.insertAfter(a,d)}),L.removeClass(L.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"))}function A(a){var b;return e(F,function(c,d){return e(c,function(c,e){return c.elm==a?(b={x:e,y:d},!1):void 0}),!b}),b}function B(a){H=A(a)}function C(){var a,b;return a=b=0,e(F,function(c,d){e(c,function(c,e){var f,g;l(c)&&(c=F[d][e],e>a&&(a=e),d>b&&(b=d),c.real&&(f=c.colspan-1,g=c.rowspan-1,f&&e+f>a&&(a=e+f),g&&d+g>b&&(b=d+g)))})}),{x:a,y:b}}function D(a){var b,c,d,e,f,g,h,i,j,k;if(I=A(a),H&&I){for(b=Math.min(H.x,I.x),c=Math.min(H.y,I.y),d=Math.max(H.x,I.x),e=Math.max(H.y,I.y),f=d,g=e,k=c;g>=k;k++)a=F[k][b],a.real||b-(a.colspan-1)<b&&(b-=a.colspan-1);for(j=b;f>=j;j++)a=F[c][j],a.real||c-(a.rowspan-1)<c&&(c-=a.rowspan-1);for(k=c;e>=k;k++)for(j=b;d>=j;j++)a=F[k][j],a.real&&(h=a.colspan-1,i=a.rowspan-1,h&&j+h>f&&(f=j+h),i&&k+i>g&&(g=k+i));for(L.removeClass(L.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"),k=c;g>=k;k++)for(j=b;f>=j;j++)F[k][j]&&L.addClass(F[k][j].elm,"mce-item-selected")}}function E(a,b){var c,d,e;c=A(a),d=c.y*G+c.x;do{if(d+=b,e=j(d%G,Math.floor(d/G)),!e)break;if(e.elm!=a)return K.select(e.elm,!0),L.isEmpty(e.elm)&&K.collapse(!0),!0}while(e.elm==a);return!1}var F,G,H,I,J,K=f.selection,L=K.dom;g=g||L.getParent(K.getStart(),"table"),h(),J=L.getParent(K.getStart(),"th,td"),J&&(H=A(J),I=C(),J=j(H.x,H.y)),a.extend(this,{deleteTable:n,split:r,merge:s,insertRow:t,insertCol:u,deleteCols:v,deleteRows:w,cutRows:x,copyRows:y,pasteRows:z,getPos:A,setStartCell:B,setEndCell:D,moveRelIdx:E,refresh:h})}}),d("tinymce/tableplugin/Quirks",["tinymce/util/VK","tinymce/Env","tinymce/util/Tools"],function(a,b,c){function d(a,b){return parseInt(a.getAttribute(b)||1,10)}var e=c.each;return function(c){function f(){function b(b){function f(a,d){var e=a?"previousSibling":"nextSibling",f=c.dom.getParent(d,"tr"),h=f[e];if(h)return q(c,d,h,a),b.preventDefault(),!0;var k=c.dom.getParent(f,"table"),l=f.parentNode,m=l.nodeName.toLowerCase();if("tbody"===m||m===(a?"tfoot":"thead")){var n=g(a,k,l,"tbody");if(null!==n)return i(a,n,d)}return j(a,f,e,k)}function g(a,b,d,e){var f=c.dom.select(">"+e,b),g=f.indexOf(d);if(a&&0===g||!a&&g===f.length-1)return h(a,b);if(-1===g){var i="thead"===d.tagName.toLowerCase()?0:f.length-1;return f[i]}return f[g+(a?-1:1)]}function h(a,b){var d=a?"thead":"tfoot",e=c.dom.select(">"+d,b);return 0!==e.length?e[0]:null}function i(a,d,e){var f=k(d,a);return f&&q(c,e,f,a),b.preventDefault(),!0}function j(a,d,e,g){var h=g[e];if(h)return l(h),!0;var i=c.dom.getParent(g,"td,th");if(i)return f(a,i,b);var j=k(d,!a);return l(j),b.preventDefault(),!1}function k(a,b){var d=a&&a[b?"lastChild":"firstChild"];return d&&"BR"===d.nodeName?c.dom.getParent(d,"td,th"):d}function l(a){c.selection.setCursorLocation(a,0)}function m(){return t==a.UP||t==a.DOWN}function n(a){var b=a.selection.getNode(),c=a.dom.getParent(b,"tr");return null!==c}function o(a){for(var b=0,c=a;c.previousSibling;)c=c.previousSibling,b+=d(c,"colspan");return b}function p(a,b){var c=0,f=0;return e(a.children,function(a,e){return c+=d(a,"colspan"),f=e,c>b?!1:void 0}),f}function q(a,b,d,e){var f=o(c.dom.getParent(b,"td,th")),g=p(d,f),h=d.childNodes[g],i=k(h,e);l(i||h)}function r(a){var b=c.selection.getNode(),d=c.dom.getParent(b,"td,th"),e=c.dom.getParent(a,"td,th");return d&&d!==e&&s(d,e)}function s(a,b){return c.dom.getParent(a,"TABLE")===c.dom.getParent(b,"TABLE")}var t=b.keyCode;if(m()&&n(c)){var u=c.selection.getNode();setTimeout(function(){r(u)&&f(!b.shiftKey&&t===a.UP,u,b)},0)}}c.on("KeyDown",function(a){b(a)})}function g(){function a(a,b){var c,d=b.ownerDocument,e=d.createRange();return e.setStartBefore(b),e.setEnd(a.endContainer,a.endOffset),c=d.createElement("body"),c.appendChild(e.cloneContents()),0===c.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length}c.on("KeyDown",function(b){var d,e,f=c.dom;(37==b.keyCode||38==b.keyCode)&&(d=c.selection.getRng(),e=f.getParent(d.startContainer,"table"),e&&c.getBody().firstChild==e&&a(d,e)&&(d=f.createRng(),d.setStartBefore(e),d.setEndBefore(e),c.selection.setRng(d),b.preventDefault()))})}function h(){c.on("KeyDown SetContent VisualAid",function(){var a;for(a=c.getBody().lastChild;a;a=a.previousSibling)if(3==a.nodeType){if(a.nodeValue.length>0)break}else if(1==a.nodeType&&("BR"==a.tagName||!a.getAttribute("data-mce-bogus")))break;a&&"TABLE"==a.nodeName&&(c.settings.forced_root_block?c.dom.add(c.getBody(),c.settings.forced_root_block,c.settings.forced_root_block_attrs,b.ie&&b.ie<11?"&nbsp;":'<br data-mce-bogus="1" />'):c.dom.add(c.getBody(),"br",{"data-mce-bogus":"1"}))}),c.on("PreProcess",function(a){var b=a.node.lastChild;b&&("BR"==b.nodeName||1==b.childNodes.length&&("BR"==b.firstChild.nodeName||"\xa0"==b.firstChild.nodeValue))&&b.previousSibling&&"TABLE"==b.previousSibling.nodeName&&c.dom.remove(b)})}function i(){function a(a,b,c,d){var e,f,g,h=3,i=a.dom.getParent(b.startContainer,"TABLE");return i&&(e=i.parentNode),f=b.startContainer.nodeType==h&&0===b.startOffset&&0===b.endOffset&&d&&("TR"==c.nodeName||c==e),g=("TD"==c.nodeName||"TH"==c.nodeName)&&!d,f||g}function b(){var b=c.selection.getRng(),d=c.selection.getNode(),e=c.dom.getParent(b.startContainer,"TD,TH");if(a(c,b,d,e)){e||(e=d);for(var f=e.lastChild;f.lastChild;)f=f.lastChild;3==f.nodeType&&(b.setEnd(f,f.data.length),c.selection.setRng(b))}}c.on("KeyDown",function(){b()}),c.on("MouseDown",function(a){2!=a.button&&b()})}function j(){c.on("keydown",function(b){if((b.keyCode==a.DELETE||b.keyCode==a.BACKSPACE)&&!b.isDefaultPrevented()){var d=c.dom.getParent(c.selection.getStart(),"table");if(d){for(var e=c.dom.select("td,th",d),f=e.length;f--;)if(!c.dom.hasClass(e[f],"mce-item-selected"))return;b.preventDefault(),c.execCommand("mceTableDelete")}}})}j(),b.webkit&&(f(),i()),b.gecko&&(g(),h()),b.ie>10&&(g(),h())}}),d("tinymce/tableplugin/CellSelection",["tinymce/tableplugin/TableGrid","tinymce/dom/TreeWalker","tinymce/util/Tools"],function(a,b,c){return function(d){function e(a){d.getBody().style.webkitUserSelect="",(a||l)&&(d.dom.removeClass(d.dom.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"),l=!1)}function f(b){var c,e,f=b.target;if(!j&&h&&(g||f!=h)&&("TD"==f.nodeName||"TH"==f.nodeName)){e=k.getParent(f,"table"),e==i&&(g||(g=new a(d,e),g.setStartCell(h),d.getBody().style.webkitUserSelect="none"),g.setEndCell(f),l=!0),c=d.selection.getSel();try{c.removeAllRanges?c.removeAllRanges():c.empty()}catch(m){}b.preventDefault()}}var g,h,i,j,k=d.dom,l=!0;return d.on("MouseDown",function(a){2==a.button||j||(e(),h=k.getParent(a.target,"td,th"),i=k.getParent(h,"table"))}),d.on("mouseover",f),d.on("remove",function(){k.unbind(d.getDoc(),"mouseover",f)}),d.on("MouseUp",function(){function a(a,d){var f=new b(a,a);do{if(3==a.nodeType&&0!==c.trim(a.nodeValue).length)return void(d?e.setStart(a,0):e.setEnd(a,a.nodeValue.length));if("BR"==a.nodeName)return void(d?e.setStartBefore(a):e.setEndBefore(a))}while(a=d?f.next():f.prev())}var e,f,j,l,m,n=d.selection;if(h){if(g&&(d.getBody().style.webkitUserSelect=""),f=k.select("td.mce-item-selected,th.mce-item-selected"),f.length>0){e=k.createRng(),l=f[0],e.setStartBefore(l),e.setEndAfter(l),a(l,1),j=new b(l,k.getParent(f[0],"table"));do if("TD"==l.nodeName||"TH"==l.nodeName){if(!k.hasClass(l,"mce-item-selected"))break;m=l}while(l=j.next());a(m),n.setRng(e)}d.nodeChanged(),h=g=i=null}}),d.on("KeyUp Drop SetContent",function(a){e("setcontent"==a.type),h=g=i=null,j=!1}),d.on("ObjectResizeStart ObjectResized",function(a){j="objectresized"!=a.type}),{clear:e}}}),d("tinymce/tableplugin/Dialogs",["tinymce/util/Tools","tinymce/Env"],function(a,b){var c=a.each;return function(d){function e(){var a=d.settings.color_picker_callback;return a?function(){var b=this;a.call(d,function(a){b.value(a).fire("change")},b.value())}:void 0}function f(a){return{title:"Advanced",type:"form",defaults:{onchange:function(){l(a,this.parents().reverse()[0],"style"==this.name())}},items:[{label:"Style",name:"style",type:"textbox"},{type:"form",padding:0,formItemDefaults:{layout:"grid",alignH:["start","right"]},defaults:{size:7},items:[{label:"Border color",type:"colorbox",name:"borderColor",onaction:e()},{label:"Background color",type:"colorbox",name:"backgroundColor",onaction:e()}]}]}}function g(a){return a?a.replace(/px$/,""):""}function h(a){return/^[0-9]+$/.test(a)&&(a+="px"),a}function i(a){c("left center right".split(" "),function(b){d.formatter.remove("align"+b,{},a)})}function j(a){c("top middle bottom".split(" "),function(b){d.formatter.remove("valign"+b,{},a)})}function k(b,c,d){function e(b,d){return d=d||[],a.each(b,function(a){var b={text:a.text||a.title};a.menu?b.menu=e(a.menu):(b.value=a.value,c&&c(b)),d.push(b)}),d}return e(b,d||[])}function l(a,b,c){var d=b.toJSON(),e=a.parseStyle(d.style);c?(b.find("#borderColor").value(e["border-color"]||"")[0].fire("change"),b.find("#backgroundColor").value(e["background-color"]||"")[0].fire("change")):(e["border-color"]=d.borderColor,e["background-color"]=d.backgroundColor),b.find("#style").value(a.serializeStyle(a.parseStyle(a.serializeStyle(e))))}function m(a,b,c){var d=a.parseStyle(a.getAttrib(c,"style"));d["border-color"]&&(b.borderColor=d["border-color"]),d["background-color"]&&(b.backgroundColor=d["background-color"]),b.style=a.serializeStyle(d)}function n(a,b,d){var e=a.parseStyle(a.getAttrib(b,"style"));c(d,function(a){e[a.name]=a.value}),a.setAttrib(b,"style",a.serializeStyle(a.parseStyle(a.serializeStyle(e))))}var o=this;o.tableProps=function(){o.table(!0)},o.table=function(e){function j(){function c(a,b,d){if("TD"===a.tagName||"TH"===a.tagName)v.setStyle(a,b,d);else if(a.children)for(var e=0;e<a.children.length;e++)c(a.children[e],b,d)}var e;l(v,this),w=a.extend(w,this.toJSON()),w["class"]===!1&&delete w["class"],d.undoManager.transact(function(){if(p||(p=d.plugins.table.insertTable(w.cols||1,w.rows||1)),d.dom.setAttribs(p,{style:w.style,"class":w["class"]}),d.settings.table_style_by_css){if(u=[],u.push({name:"border",value:w.border}),u.push({name:"border-spacing",value:h(w.cellspacing)}),n(v,p,u),v.setAttribs(p,{"data-mce-border-color":w.borderColor,"data-mce-cell-padding":w.cellpadding,"data-mce-border":w.border}),p.children)for(var a=0;a<p.children.length;a++)c(p.children[a],"border",w.border),c(p.children[a],"padding",h(w.cellpadding))}else d.dom.setAttribs(p,{border:w.border,cellpadding:w.cellpadding,cellspacing:w.cellspacing});v.getAttrib(p,"width")&&!d.settings.table_style_by_css?v.setAttrib(p,"width",g(w.width)):v.setStyle(p,"width",h(w.width)),v.setStyle(p,"height",h(w.height)),e=v.select("caption",p)[0],e&&!w.caption&&v.remove(e),!e&&w.caption&&(e=v.create("caption"),e.innerHTML=b.ie?"\xa0":'<br data-mce-bogus="1"/>',p.insertBefore(e,p.firstChild)),i(p),w.align&&d.formatter.apply("align"+w.align,{},p),d.focus(),d.addVisual()})}function o(a,b){function c(a,c){for(var d=0;d<c.length;d++){var e=v.getStyle(c[d],b);if("undefined"==typeof a&&(a=e),a!=e)return""}return a}var e,f=d.dom.select("td,th",a);return e=c(e,f)}var p,q,r,s,t,u,v=d.dom,w={};e===!0?(p=v.getParent(d.selection.getStart(),"table"),p&&(w={width:g(v.getStyle(p,"width")||v.getAttrib(p,"width")),height:g(v.getStyle(p,"height")||v.getAttrib(p,"height")),cellspacing:g(v.getStyle(p,"border-spacing")||v.getAttrib(p,"cellspacing")),cellpadding:v.getAttrib(p,"data-mce-cell-padding")||v.getAttrib(p,"cellpadding")||o(p,"padding"),border:v.getAttrib(p,"data-mce-border")||v.getAttrib(p,"border")||o(p,"border"),borderColor:v.getAttrib(p,"data-mce-border-color"),caption:!!v.select("caption",p)[0],"class":v.getAttrib(p,"class")},c("left center right".split(" "),function(a){d.formatter.matchNode(p,"align"+a)&&(w.align=a)}))):(q={label:"Cols",name:"cols"},r={label:"Rows",name:"rows"}),d.settings.table_class_list&&(w["class"]&&(w["class"]=w["class"].replace(/\s*mce\-item\-table\s*/g,"")),s={name:"class",type:"listbox",label:"Class",values:k(d.settings.table_class_list,function(a){a.value&&(a.textStyle=function(){return d.formatter.getCssText({block:"table",classes:[a.value]})})})}),t={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",labelGapCalc:!1,padding:0,layout:"grid",columns:2,defaults:{type:"textbox",maxWidth:50},items:d.settings.table_appearance_options!==!1?[q,r,{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"}]:[q,r,{label:"Width",name:"width"},{label:"Height",name:"height"}]},{label:"Alignment",name:"align",type:"listbox",text:"None",values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},s]},d.settings.table_advtab!==!1?(m(v,w,p),d.windowManager.open({title:"Table properties",data:w,bodyType:"tabpanel",body:[{title:"General",type:"form",items:t},f(v)],onsubmit:j})):d.windowManager.open({title:"Table properties",data:w,body:t,onsubmit:j})},o.merge=function(a,b){d.windowManager.open({title:"Merge cells",body:[{label:"Cols",name:"cols",type:"textbox",value:"1",size:10},{label:"Rows",name:"rows",type:"textbox",value:"1",size:10}],onsubmit:function(){var c=this.toJSON();d.undoManager.transact(function(){a.merge(b,c.cols,c.rows)})}})},o.cell=function(){function b(){l(p,this),n=a.extend(n,this.toJSON()),d.undoManager.transact(function(){c(q,function(a){d.dom.setAttribs(a,{scope:n.scope,style:n.style,"class":n["class"]}),d.dom.setStyles(a,{width:h(n.width),height:h(n.height)}),n.type&&a.nodeName.toLowerCase()!=n.type&&(a=p.rename(a,n.type)),i(a),n.align&&d.formatter.apply("align"+n.align,{},a),j(a),n.valign&&d.formatter.apply("valign"+n.valign,{},a)}),d.focus()})}var e,n,o,p=d.dom,q=[];if(q=d.dom.select("td.mce-item-selected,th.mce-item-selected"),e=d.dom.getParent(d.selection.getStart(),"td,th"),!q.length&&e&&q.push(e),e=e||q[0]){n={width:g(p.getStyle(e,"width")||p.getAttrib(e,"width")),height:g(p.getStyle(e,"height")||p.getAttrib(e,"height")),scope:p.getAttrib(e,"scope"),"class":p.getAttrib(e,"class")},n.type=e.nodeName.toLowerCase(),c("left center right".split(" "),function(a){d.formatter.matchNode(e,"align"+a)&&(n.align=a)}),c("top middle bottom".split(" "),function(a){d.formatter.matchNode(e,"valign"+a)&&(n.valign=a)}),d.settings.table_cell_class_list&&(o={name:"class",type:"listbox",label:"Class",values:k(d.settings.table_cell_class_list,function(a){a.value&&(a.textStyle=function(){return d.formatter.getCssText({block:"td",classes:[a.value]})})})});var r={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",layout:"grid",columns:2,labelGapCalc:!1,padding:0,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,values:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{label:"Scope",name:"scope",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{label:"H Align",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"}]},{label:"V Align",name:"valign",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}]}]},o]};d.settings.table_cell_advtab!==!1?(m(p,n,e),d.windowManager.open({title:"Cell properties",bodyType:"tabpanel",data:n,body:[{title:"General",type:"form",items:r},f(p)],onsubmit:b})):d.windowManager.open({title:"Cell properties",data:n,body:r,onsubmit:b})}},o.row=function(){function b(){var b,e,f;l(r,this),p=a.extend(p,this.toJSON()),d.undoManager.transact(function(){var a=p.type;c(s,function(c){d.dom.setAttribs(c,{scope:p.scope,style:p.style,"class":p["class"]}),d.dom.setStyles(c,{height:h(p.height)}),a!=c.parentNode.nodeName.toLowerCase()&&(b=r.getParent(c,"table"),e=c.parentNode,f=r.select(a,b)[0],f||(f=r.create(a),b.firstChild?b.insertBefore(f,b.firstChild):b.appendChild(f)),f.appendChild(c),e.hasChildNodes()||r.remove(e)),i(c),p.align&&d.formatter.apply("align"+p.align,{},c)}),d.focus()})}var e,j,n,o,p,q,r=d.dom,s=[];e=d.dom.getParent(d.selection.getStart(),"table"),j=d.dom.getParent(d.selection.getStart(),"td,th"),c(e.rows,function(a){c(a.cells,function(b){return r.hasClass(b,"mce-item-selected")||b==j?(s.push(a),!1):void 0})}),n=s[0],n&&(p={height:g(r.getStyle(n,"height")||r.getAttrib(n,"height")),scope:r.getAttrib(n,"scope"),"class":r.getAttrib(n,"class")},p.type=n.parentNode.nodeName.toLowerCase(),c("left center right".split(" "),function(a){d.formatter.matchNode(n,"align"+a)&&(p.align=a)}),d.settings.table_row_class_list&&(o={name:"class",type:"listbox",label:"Class",values:k(d.settings.table_row_class_list,function(a){a.value&&(a.textStyle=function(){return d.formatter.getCssText({block:"tr",classes:[a.value]})})})}),q={type:"form",columns:2,padding:0,defaults:{type:"textbox"},items:[{type:"listbox",name:"type",label:"Row type",text:"None",maxWidth:null,values:[{text:"Header",value:"thead"},{text:"Body",value:"tbody"},{text:"Footer",value:"tfoot"}]},{type:"listbox",name:"align",label:"Alignment",text:"None",maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height"},o]},d.settings.table_row_advtab!==!1?(m(r,p,n),d.windowManager.open({title:"Row properties",data:p,bodyType:"tabpanel",body:[{title:"General",type:"form",items:q},f(r)],onsubmit:b})):d.windowManager.open({title:"Row properties",data:p,body:q,onsubmit:b}))}}}),d("tinymce/tableplugin/Plugin",["tinymce/tableplugin/TableGrid","tinymce/tableplugin/Quirks","tinymce/tableplugin/CellSelection","tinymce/tableplugin/Dialogs","tinymce/util/Tools","tinymce/dom/TreeWalker","tinymce/Env","tinymce/PluginManager"],function(a,b,c,d,e,f,g,h){function i(e){function f(a){return function(){e.execCommand(a)}}function h(a,b){var c,d,f,h;for(f='<table id="__mce"><tbody>',c=0;b>c;c++){for(f+="<tr>",d=0;a>d;d++)f+="<td>"+(g.ie?" ":"<br>")+"</td>";f+="</tr>"}return f+="</tbody></table>",e.undoManager.transact(function(){e.insertContent(f),h=e.dom.get("__mce"),e.dom.setAttrib(h,"id",null),e.dom.setAttribs(h,e.settings.table_default_attributes||{}),e.dom.setStyles(h,e.settings.table_default_styles||{})}),h}function i(a,b){function c(){a.disabled(!e.dom.getParent(e.selection.getStart(),b)),e.selection.selectorChanged(b,function(b){a.disabled(!b)})}e.initialized?c():e.on("init",c)}function k(){i(this,"table")}function l(){i(this,"td,th")}function m(){var a="";a='<table role="grid" class="mce-grid mce-grid-border" aria-readonly="true">';for(var b=0;10>b;b++){a+="<tr>";for(var c=0;10>c;c++)a+='<td role="gridcell" tabindex="-1"><a id="mcegrid'+(10*b+c)+'" href="#" data-mce-x="'+c+'" data-mce-y="'+b+'"></a></td>';a+="</tr>"}return a+="</table>",a+='<div class="mce-text-center" role="presentation">1 x 1</div>'}function n(a,b,c){var d,f,g,h,i,j=c.getEl().getElementsByTagName("table")[0],k=c.isRtl()||"tl-tr"==c.parent().rel;for(j.nextSibling.innerHTML=a+1+" x "+(b+1),k&&(a=9-a),f=0;10>f;f++)for(d=0;10>d;d++)h=j.rows[f].childNodes[d].firstChild,i=(k?d>=a:a>=d)&&b>=f,e.dom.toggleClass(h,"mce-active",i),i&&(g=h);return g.parentNode}var o,p=this,q=new d(e);e.settings.table_grid===!1?e.addMenuItem("inserttable",{text:"Insert table",icon:"table",context:"table",onclick:q.table}):e.addMenuItem("inserttable",{text:"Insert table",icon:"table",context:"table",ariaHideMenu:!0,onclick:function(a){a.aria&&(this.parent().hideAll(),a.stopImmediatePropagation(),q.table())},onshow:function(){n(0,0,this.menu.items()[0])},onhide:function(){var a=this.menu.items()[0].getEl().getElementsByTagName("a");e.dom.removeClass(a,"mce-active"),e.dom.addClass(a[0],"mce-active")},menu:[{type:"container",html:m(),onPostRender:function(){this.lastX=this.lastY=0},onmousemove:function(a){var b,c,d=a.target;"A"==d.tagName.toUpperCase()&&(b=parseInt(d.getAttribute("data-mce-x"),10),c=parseInt(d.getAttribute("data-mce-y"),10),(this.isRtl()||"tl-tr"==this.parent().rel)&&(b=9-b),(b!==this.lastX||c!==this.lastY)&&(n(b,c,a.control),this.lastX=b,this.lastY=c))},onclick:function(a){var b=this;"A"==a.target.tagName.toUpperCase()&&(a.preventDefault(),a.stopPropagation(),b.parent().cancel(),e.undoManager.transact(function(){h(b.lastX+1,b.lastY+1)}),e.addVisual())}}]}),e.addMenuItem("tableprops",{text:"Table properties",context:"table",onPostRender:k,onclick:q.tableProps}),e.addMenuItem("deletetable",{text:"Delete table",context:"table",onPostRender:k,cmd:"mceTableDelete"}),e.addMenuItem("cell",{separator:"before",text:"Cell",context:"table",menu:[{text:"Cell properties",onclick:f("mceTableCellProps"),onPostRender:l},{text:"Merge cells",onclick:f("mceTableMergeCells"),onPostRender:l},{text:"Split cell",onclick:f("mceTableSplitCells"),onPostRender:l}]}),e.addMenuItem("row",{text:"Row",context:"table",menu:[{text:"Insert row before",onclick:f("mceTableInsertRowBefore"),onPostRender:l},{text:"Insert row after",onclick:f("mceTableInsertRowAfter"),onPostRender:l},{text:"Delete row",onclick:f("mceTableDeleteRow"),onPostRender:l},{text:"Row properties",onclick:f("mceTableRowProps"),onPostRender:l},{text:"-"},{text:"Cut row",onclick:f("mceTableCutRow"),onPostRender:l},{text:"Copy row",onclick:f("mceTableCopyRow"),onPostRender:l},{text:"Paste row before",onclick:f("mceTablePasteRowBefore"),onPostRender:l},{text:"Paste row after",onclick:f("mceTablePasteRowAfter"),onPostRender:l}]}),e.addMenuItem("column",{text:"Column",context:"table",menu:[{text:"Insert column before",onclick:f("mceTableInsertColBefore"),onPostRender:l},{text:"Insert column after",onclick:f("mceTableInsertColAfter"),onPostRender:l},{text:"Delete column",onclick:f("mceTableDeleteCol"),onPostRender:l}]});var r=[];j("inserttable tableprops deletetable | cell row column".split(" "),function(a){r.push("|"==a?{text:"-"}:e.menuItems[a])}),e.addButton("table",{type:"menubutton",title:"Table",menu:r}),g.isIE||e.on("click",function(a){a=a.target,"TABLE"===a.nodeName&&(e.selection.select(a),e.nodeChanged())}),p.quirks=new b(e),e.on("Init",function(){p.cellSelection=new c(e)}),e.on("PreInit",function(){e.serializer.addAttributeFilter("data-mce-cell-padding,data-mce-border,data-mce-border-color",function(a,b){for(var c=a.length;c--;)a[c].attr(b,null)})}),j({mceTableSplitCells:function(a){a.split()},mceTableMergeCells:function(a){var b;b=e.dom.getParent(e.selection.getStart(),"th,td"),e.dom.select("td.mce-item-selected,th.mce-item-selected").length?a.merge():q.merge(a,b)},mceTableInsertRowBefore:function(a){a.insertRow(!0)},mceTableInsertRowAfter:function(a){a.insertRow()},mceTableInsertColBefore:function(a){a.insertCol(!0)},mceTableInsertColAfter:function(a){a.insertCol()},mceTableDeleteCol:function(a){a.deleteCols()},mceTableDeleteRow:function(a){a.deleteRows()},mceTableCutRow:function(a){o=a.cutRows()},mceTableCopyRow:function(a){o=a.copyRows()},mceTablePasteRowBefore:function(a){a.pasteRows(o,!0)},mceTablePasteRowAfter:function(a){a.pasteRows(o)},mceTableDelete:function(a){a.deleteTable()}},function(b,c){e.addCommand(c,function(){var c=new a(e);c&&(b(c),e.execCommand("mceRepaint"),p.cellSelection.clear())})}),j({mceInsertTable:q.table,mceTableProps:function(){q.table(!0)},mceTableRowProps:q.row,mceTableCellProps:q.cell},function(a,b){e.addCommand(b,function(b,c){a(c)})}),e.settings.table_tab_navigation!==!1&&e.on("keydown",function(b){var c,d,f;9==b.keyCode&&(c=e.dom.getParent(e.selection.getStart(),"th,td"),c&&(b.preventDefault(),d=new a(e),f=b.shiftKey?-1:1,e.undoManager.transact(function(){!d.moveRelIdx(c,f)&&f>0&&(d.insertRow(),d.refresh(),d.moveRelIdx(c,f))})))}),p.insertTable=h}var j=e.each;h.add("table",i)})}(this);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/template/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("template",function(a){function b(b){return function(){var c=a.settings.templates;"string"==typeof c?tinymce.util.XHR.send({url:c,success:function(a){b(tinymce.util.JSON.parse(a))}}):b(c)}}function c(b){function c(b){function c(b){if(-1==b.indexOf("<html>")){var c="";tinymce.each(a.contentCSS,function(b){c+='<link type="text/css" rel="stylesheet" href="'+a.documentBaseURI.toAbsolute(b)+'">'}),b="<!DOCTYPE html><html><head>"+c+"</head><body>"+b+"</body></html>"}b=f(b,"template_preview_replace_values");var e=d.find("iframe")[0].getEl().contentWindow.document;e.open(),e.write(b),e.close()}var g=b.control.value();g.url?tinymce.util.XHR.send({url:g.url,success:function(a){e=a,c(e)}}):(e=g.content,c(e)),d.find("#description")[0].text(b.control.value().description)}var d,e,h=[];return b&&0!==b.length?(tinymce.each(b,function(a){h.push({selected:!h.length,text:a.title,value:{url:a.url,content:a.content,description:a.description}})}),d=a.windowManager.open({title:"Insert template",layout:"flex",direction:"column",align:"stretch",padding:15,spacing:10,items:[{type:"form",flex:0,padding:0,items:[{type:"container",label:"Templates",items:{type:"listbox",label:"Templates",name:"template",values:h,onselect:c}}]},{type:"label",name:"description",label:"Description",text:"\xa0"},{type:"iframe",flex:1,border:1}],onsubmit:function(){g(!1,e)},width:a.getParam("template_popup_width",600),height:a.getParam("template_popup_height",500)}),void d.find("listbox")[0].fire("select")):void a.windowManager.alert("No templates defined")}function d(b,c){function d(a,b){if(a=""+a,a.length<b)for(var c=0;c<b-a.length;c++)a="0"+a;return a}var e="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),f="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),g="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),h="January February March April May June July August September October November December".split(" ");return c=c||new Date,b=b.replace("%D","%m/%d/%Y"),b=b.replace("%r","%I:%M:%S %p"),b=b.replace("%Y",""+c.getFullYear()),b=b.replace("%y",""+c.getYear()),b=b.replace("%m",d(c.getMonth()+1,2)),b=b.replace("%d",d(c.getDate(),2)),b=b.replace("%H",""+d(c.getHours(),2)),b=b.replace("%M",""+d(c.getMinutes(),2)),b=b.replace("%S",""+d(c.getSeconds(),2)),b=b.replace("%I",""+((c.getHours()+11)%12+1)),b=b.replace("%p",""+(c.getHours()<12?"AM":"PM")),b=b.replace("%B",""+a.translate(h[c.getMonth()])),b=b.replace("%b",""+a.translate(g[c.getMonth()])),b=b.replace("%A",""+a.translate(f[c.getDay()])),b=b.replace("%a",""+a.translate(e[c.getDay()])),b=b.replace("%%","%")}function e(b){var c=a.dom,d=a.getParam("template_replace_values");h(c.select("*",b),function(a){h(d,function(b,e){c.hasClass(a,e)&&"function"==typeof d[e]&&d[e](a)})})}function f(b,c){return h(a.getParam(c),function(a,c){"function"!=typeof a&&(b=b.replace(new RegExp("\\{\\$"+c+"\\}","g"),a))}),b}function g(b,c){function g(a,b){return new RegExp("\\b"+b+"\\b","g").test(a.className)}var i,j,k=a.dom,l=a.selection.getContent();c=f(c,"template_replace_values"),i=k.create("div",null,c),j=k.select(".mceTmpl",i),j&&j.length>0&&(i=k.create("div",null),i.appendChild(j[0].cloneNode(!0))),h(k.select("*",i),function(b){g(b,a.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))&&(b.innerHTML=d(a.getParam("template_cdate_format",a.getLang("template.cdate_format")))),g(b,a.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(b.innerHTML=d(a.getParam("template_mdate_format",a.getLang("template.mdate_format")))),g(b,a.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))&&(b.innerHTML=l)}),e(i),a.execCommand("mceInsertContent",!1,i.innerHTML),a.addVisual()}var h=tinymce.each;a.addCommand("mceInsertTemplate",g),a.addButton("template",{title:"Insert template",onclick:b(c)}),a.addMenuItem("template",{text:"Insert template",onclick:b(c),context:"insert"}),a.on("PreProcess",function(b){var c=a.dom;h(c.select("div",b.node),function(b){c.hasClass(b,"mceTmpl")&&(h(c.select("*",b),function(b){c.hasClass(b,a.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(b.innerHTML=d(a.getParam("template_mdate_format",a.getLang("template.mdate_format"))))}),e(b))})})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/textcolor/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("textcolor",function(a){function b(b){var c;return a.dom.getParents(a.selection.getStart(),function(a){var d;(d=a.style["forecolor"==b?"color":"background-color"])&&(c=d)}),c}function c(){var b,c,d=[];for(c=a.settings.textcolor_map||["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","Red violet","FFFFFF","White","FF99CC","Pink","FFCC99","Peach","FFFF99","Light yellow","CCFFCC","Pale green","CCFFFF","Pale cyan","99CCFF","Light sky blue","CC99FF","Plum"],b=0;b<c.length;b+=2)d.push({text:c[b+1],color:"#"+c[b]});return d}function d(){function b(a,b){var c="transparent"==a;return'<td class="mce-grid-cell'+(c?" mce-colorbtn-trans":"")+'"><div id="'+n+"-"+o++ +'" data-mce-color="'+(a?a:"")+'" role="option" tabIndex="-1" style="'+(a?"background-color: "+a:"")+'" title="'+tinymce.translate(b)+'">'+(c?"&#215;":"")+"</div></td>"}var d,e,f,g,h,k,l,m=this,n=m._id,o=0;for(d=c(),d.push({text:tinymce.translate("No color"),color:"transparent"}),f='<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="list" cellspacing="0"><tbody>',g=d.length-1,k=0;j>k;k++){for(f+="<tr>",h=0;i>h;h++)l=k*i+h,l>g?f+="<td></td>":(e=d[l],f+=b(e.color,e.text));f+="</tr>"}if(a.settings.color_picker_callback){for(f+='<tr><td colspan="'+i+'" class="mce-custom-color-btn"><div id="'+n+'-c" class="mce-widget mce-btn mce-btn-small mce-btn-flat" role="button" tabindex="-1" aria-labelledby="'+n+'-c" style="width: 100%"><button type="button" role="presentation" tabindex="-1">'+tinymce.translate("Custom...")+"</button></div></td></tr>",f+="<tr>",h=0;i>h;h++)f+=b("","Custom color");f+="</tr>"}return f+="</tbody></table>"}function e(b,c){a.undoManager.transact(function(){a.focus(),a.formatter.apply(b,{value:c}),a.nodeChanged()})}function f(b){a.undoManager.transact(function(){a.focus(),a.formatter.remove(b,{value:null},null,!0),a.nodeChanged()})}function g(c){function d(a){k.hidePanel(),k.color(a),e(k.settings.format,a)}function g(){k.hidePanel(),k.resetColor(),f(k.settings.format)}function h(a,b){a.style.background=b,a.setAttribute("data-mce-color",b)}var j,k=this.parent();tinymce.DOM.getParent(c.target,".mce-custom-color-btn")&&(k.hidePanel(),a.settings.color_picker_callback.call(a,function(a){var b,c,e,f=k.panel.getEl().getElementsByTagName("table")[0];for(b=tinymce.map(f.rows[f.rows.length-1].childNodes,function(a){return a.firstChild}),e=0;e<b.length&&(c=b[e],c.getAttribute("data-mce-color"));e++);if(e==i)for(e=0;i-1>e;e++)h(b[e],b[e+1].getAttribute("data-mce-color"));h(c,a),d(a)},b(k.settings.format))),j=c.target.getAttribute("data-mce-color"),j?(this.lastId&&document.getElementById(this.lastId).setAttribute("aria-selected",!1),c.target.setAttribute("aria-selected",!0),this.lastId=c.target.id,"transparent"==j?g():d(j)):null!==j&&k.hidePanel()}function h(){var a=this;a._color?e(a.settings.format,a._color):f(a.settings.format)}var i,j;j=a.settings.textcolor_rows||5,i=a.settings.textcolor_cols||8,a.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",format:"forecolor",panel:{role:"application",ariaRemember:!0,html:d,onclick:g},onclick:h}),a.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",format:"hilitecolor",panel:{role:"application",ariaRemember:!0,html:d,onclick:g},onclick:h})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/textpattern/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("textpattern",function(a){function b(){return j&&(i.sort(function(a,b){return a.start.length>b.start.length?-1:a.start.length<b.start.length?1:0}),j=!1),i}function c(a){for(var c=b(),d=0;d<c.length;d++)if(0===a.indexOf(c[d].start)&&(!c[d].end||a.lastIndexOf(c[d].end)==a.length-c[d].end.length))return c[d]}function d(a,c,d){var e,f,g;for(e=b(),g=0;g<e.length;g++)if(f=e[g],f.end&&a.substr(c-f.end.length-d,f.end.length)==f.end)return f}function e(b){function e(){i=i.splitText(k),i.splitText(j-k-o),i.deleteData(0,n.start.length),i.deleteData(i.data.length-n.end.length,n.end.length)}var f,g,h,i,j,k,l,m,n,o,p;return f=a.selection,g=a.dom,f.isCollapsed()&&(h=f.getRng(!0),i=h.startContainer,j=h.startOffset,l=i.data,o=b?1:0,3==i.nodeType&&(n=d(l,j,o),n&&(k=Math.max(0,j-o),k=l.lastIndexOf(n.start,k-n.end.length-1),-1!==k&&(m=g.createRng(),m.setStart(i,k),m.setEnd(i,j-o),n=c(m.toString()),n&&n.end&&!(i.data.length<=n.start.length+n.end.length)))))?(p=a.formatter.get(n.format),p&&p[0].inline?(e(),a.formatter.apply(n.format,{},i),i):void 0):void 0}function f(){var b,d,e,f,g,h,i,j,k,l,m;if(b=a.selection,d=a.dom,b.isCollapsed()&&(i=d.getParent(b.getStart(),"p"))){for(k=new tinymce.dom.TreeWalker(i,i);g=k.next();)if(3==g.nodeType){f=g;break}if(f){if(j=c(f.data),!j)return;if(l=b.getRng(!0),e=l.startContainer,m=l.startOffset,f==e&&(m=Math.max(0,m-j.start.length)),tinymce.trim(f.data).length==j.start.length)return;j.format&&(h=a.formatter.get(j.format),h&&h[0].block&&(f.deleteData(0,j.start.length),a.formatter.apply(j.format,{},f),l.setStart(e,m),l.collapse(!0),b.setRng(l))),j.cmd&&a.undoManager.transact(function(){f.deleteData(0,j.start.length),a.execCommand(j.cmd)})}}}function g(){var b,c;c=e(),c&&(b=a.dom.createRng(),b.setStart(c,c.data.length),b.setEnd(c,c.data.length),a.selection.setRng(b)),f()}function h(){var b,c,d,f,g;b=e(!0),b&&(g=a.dom,c=b.data.slice(-1),/[\u00a0 ]/.test(c)&&(b.deleteData(b.data.length-1,1),d=g.doc.createTextNode(c),b.nextSibling?g.insertAfter(d,b.nextSibling):b.parentNode.appendChild(d),f=g.createRng(),f.setStart(d,1),f.setEnd(d,1),a.selection.setRng(f)))}var i,j=!0;i=a.settings.textpattern_patterns||[{start:"*",end:"*",format:"italic"},{start:"**",end:"**",format:"bold"},{start:"#",format:"h1"},{start:"##",format:"h2"},{start:"###",format:"h3"},{start:"####",format:"h4"},{start:"#####",format:"h5"},{start:"######",format:"h6"},{start:"1. ",cmd:"InsertOrderedList"},{start:"* ",cmd:"InsertUnorderedList"},{start:"- ",cmd:"InsertUnorderedList"}],a.on("keydown",function(a){13!=a.keyCode||tinymce.util.VK.modifierPressed(a)||g()},!0),a.on("keyup",function(a){32!=a.keyCode||tinymce.util.VK.modifierPressed(a)||h()}),this.getPatterns=b,this.setPatterns=function(a){i=a,j=!0}});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/visualblocks/css/visualblocks.css	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,135 @@
+.mce-visualblocks p {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin-left: 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7);
+}
+
+.mce-visualblocks h1 {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin-left: 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==);
+}
+
+.mce-visualblocks h2 {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin-left: 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==);
+}
+
+.mce-visualblocks h3 {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin-left: 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7);
+}
+
+.mce-visualblocks h4 {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin-left: 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==);
+}
+
+.mce-visualblocks h5 {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin-left: 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==);
+}
+
+.mce-visualblocks h6 {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin-left: 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==);
+}
+
+.mce-visualblocks div {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin-left: 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7);
+}
+
+.mce-visualblocks section {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin: 0 0 1em 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=);
+}
+
+.mce-visualblocks article {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin: 0 0 1em 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7);
+}
+
+.mce-visualblocks blockquote {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7);
+}
+
+.mce-visualblocks address {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin: 0 0 1em 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=);
+}
+
+.mce-visualblocks pre {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin-left: 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==);
+}
+
+.mce-visualblocks figure {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin: 0 0 1em 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7);
+}
+
+.mce-visualblocks hgroup {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin: 0 0 1em 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7);
+}
+
+.mce-visualblocks aside {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin: 0 0 1em 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=);
+}
+
+.mce-visualblocks figcaption {
+	border: 1px dashed #BBB;
+}
+
+.mce-visualblocks ul {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin: 0 0 1em 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==)
+}
+
+.mce-visualblocks ol {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin: 0 0 1em 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==);
+}
+
+.mce-visualblocks dl {
+	padding-top: 10px;
+	border: 1px dashed #BBB;
+	margin: 0 0 1em 3px;
+	background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/visualblocks/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("visualblocks",function(a,b){function c(){var b=this;b.active(f),a.on("VisualBlocks",function(){b.active(a.dom.hasClass(a.getBody(),"mce-visualblocks"))})}var d,e,f;window.NodeList&&(a.addCommand("mceVisualBlocks",function(){var c,g=a.dom;d||(d=g.uniqueId(),c=g.create("link",{id:d,rel:"stylesheet",href:b+"/css/visualblocks.css"}),a.getDoc().getElementsByTagName("head")[0].appendChild(c)),a.on("PreviewFormats AfterPreviewFormats",function(b){f&&g.toggleClass(a.getBody(),"mce-visualblocks","afterpreviewformats"==b.type)}),g.toggleClass(a.getBody(),"mce-visualblocks"),f=a.dom.hasClass(a.getBody(),"mce-visualblocks"),e&&e.active(g.hasClass(a.getBody(),"mce-visualblocks")),a.fire("VisualBlocks")}),a.addButton("visualblocks",{title:"Show blocks",cmd:"mceVisualBlocks",onPostRender:c}),a.addMenuItem("visualblocks",{text:"Show blocks",cmd:"mceVisualBlocks",onPostRender:c,selectable:!0,context:"view",prependToContext:!0}),a.on("init",function(){a.settings.visualblocks_default_state&&a.execCommand("mceVisualBlocks",!1,null,{skip_focus:!0})}),a.on("remove",function(){a.dom.removeClass(a.getBody(),"mce-visualblocks")}))});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/visualchars/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("visualchars",function(a){function b(b){function c(a){return'<span data-mce-bogus="1" class="mce-'+n[a]+'">'+a+"</span>"}function f(){var a,b="";for(a in n)b+=a;return new RegExp("["+b+"]","g")}function g(){var a,b="";for(a in n)b&&(b+=","),b+="span.mce-"+n[a];return b}var h,i,j,k,l,m,n,o,p=a.getBody(),q=a.selection;if(n={"\xa0":"nbsp","\xad":"shy"},d=!d,e.state=d,a.fire("VisualChars",{state:d}),o=f(),b&&(m=q.getBookmark()),d)for(i=[],tinymce.walk(p,function(a){3==a.nodeType&&a.nodeValue&&o.test(a.nodeValue)&&i.push(a)},"childNodes"),j=0;j<i.length;j++){for(k=i[j].nodeValue,k=k.replace(o,c),l=a.dom.create("div",null,k);h=l.lastChild;)a.dom.insertAfter(h,i[j]);a.dom.remove(i[j])}else for(i=a.dom.select(g(),p),j=i.length-1;j>=0;j--)a.dom.remove(i[j],1);q.moveToBookmark(m)}function c(){var b=this;a.on("VisualChars",function(a){b.active(a.state)})}var d,e=this;a.addCommand("mceVisualChars",b),a.addButton("visualchars",{title:"Show invisible characters",cmd:"mceVisualChars",onPostRender:c}),a.addMenuItem("visualchars",{text:"Show invisible characters",cmd:"mceVisualChars",onPostRender:c,selectable:!0,context:"view",prependToContext:!0}),a.on("beforegetcontent",function(a){d&&"raw"!=a.format&&!a.draft&&(d=!0,b(!1))})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/plugins/wordcount/plugin.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.PluginManager.add("wordcount",function(a){function b(){a.theme.panel.find("#wordcount").text(["Words: {0}",e.getCount()])}var c,d,e=this;c=a.getParam("wordcount_countregex",/[\w\u2019\x27\-\u00C0-\u1FFF]+/g),d=a.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$?\x27\x22_+=\\\/\-]*/g),a.on("init",function(){var c=a.theme.panel&&a.theme.panel.find("#statusbar")[0];c&&window.setTimeout(function(){c.insert({type:"label",name:"wordcount",text:["Words: {0}",e.getCount()],classes:"wordcount",disabled:a.settings.readonly},0),a.on("setcontent beforeaddundo",b),a.on("keyup",function(a){32==a.keyCode&&b()})},0)}),e.getCount=function(){var b=a.getContent({format:"raw"}),e=0;if(b){b=b.replace(/\.\.\./g," "),b=b.replace(/<.[^<>]*?>/g," ").replace(/&nbsp;|&#160;/gi," "),b=b.replace(/(\w+)(&#?[a-z0-9]+;)+(\w+)/i,"$1$3").replace(/&.+?;/g," "),b=b.replace(d,"");var f=b.match(c);f&&(e=f.length)}return e}});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/content.inline.min.css	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+.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;page-break-before:always}@media print{.mce-pagebreak{border:0}}.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;user-select:all;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,.mce-shy{background:#AAA}.mce-shy::after{content:'-'}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-spellchecker-word{border-bottom:2px solid red;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid green;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}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/content.min.css	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+body{background-color:#FFF;color:#000;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;page-break-before:always}@media print{.mce-pagebreak{border:0}}.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;user-select:all;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,.mce-shy{background:#AAA}.mce-shy::after{content:'-'}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-spellchecker-word{border-bottom:2px solid red;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid green;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}
\ No newline at end of file
Binary file src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/fonts/tinymce-small.eot has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/fonts/tinymce-small.svg	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,62 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata>Generated by IcoMoon</metadata>
+<defs>
+<font id="tinymce-small" horiz-adv-x="1024">
+<font-face units-per-em="1024" ascent="960" descent="-64" />
+<missing-glyph horiz-adv-x="1024" />
+<glyph unicode="&#x20;" d="" horiz-adv-x="512" />
+<glyph unicode="&#xe000;" d="M960 80v591.938l-223.938 224.062h-592.062c-44.182 0-80-35.816-80-80v-736c0-44.184 35.818-80 80-80h736c44.184 0 80 35.816 80 80zM576 768h64v-192h-64v192zM704 128h-384v255.882c0.034 0.042 0.076 0.082 0.116 0.118h383.77c0.040-0.036 0.082-0.076 0.116-0.118l-0.002-255.882zM832 128h-64v256c0 35.2-28.8 64-64 64h-384c-35.2 0-64-28.8-64-64v-256h-64v640h64v-192c0-35.2 28.8-64 64-64h320c35.2 0 64 28.8 64 64v171.010l128-128.072v-490.938z" />
+<glyph unicode="&#xe001;" d="M850.746 717.254l-133.492 133.49c-24.888 24.892-74.054 45.256-109.254 45.256h-416c-35.2 0-64-28.8-64-64v-768c0-35.2 28.8-64 64-64h640c35.2 0 64 28.8 64 64v544c0 35.2-20.366 84.364-45.254 109.254zM805.49 672.002c6.792-6.796 13.792-19.162 18.894-32.002h-184.384v184.386c12.84-5.1 25.204-12.1 32-18.896l133.49-133.488zM831.884 64h-639.77c-0.040 0.034-0.082 0.076-0.114 0.116v767.77c0.034 0.040 0.076 0.082 0.114 0.114h383.886v-256h256v-511.884c-0.034-0.040-0.076-0.082-0.116-0.116z" />
+<glyph unicode="&#xe002;" d="M1024 367.542v160.916l-159.144 15.914c-8.186 30.042-20.088 58.548-35.21 84.98l104.596 127.838-113.052 113.050-127.836-104.596c-26.434 15.124-54.942 27.026-84.982 35.208l-15.914 159.148h-160.916l-15.914-159.146c-30.042-8.186-58.548-20.086-84.98-35.208l-127.838 104.594-113.050-113.050 104.596-127.836c-15.124-26.432-27.026-54.94-35.21-84.98l-159.146-15.916v-160.916l159.146-15.914c8.186-30.042 20.086-58.548 35.21-84.982l-104.596-127.836 113.048-113.048 127.838 104.596c26.432-15.124 54.94-27.028 84.98-35.21l15.916-159.148h160.916l15.914 159.144c30.042 8.186 58.548 20.088 84.982 35.21l127.836-104.596 113.048 113.048-104.596 127.836c15.124 26.434 27.028 54.942 35.21 84.98l159.148 15.92zM704 384l-128-128h-128l-128 128v128l128 128h128l128-128v-128z" />
+<glyph unicode="&#xe003;" d="M64 768h896v-128h-896zM64 384h896v-128h-896zM64 576h576v-128h-576zM64 192h576v-128h-576z" />
+<glyph unicode="&#xe004;" d="M64 768h896v-128h-896zM64 384h896v-128h-896zM256 576h512v-128h-512zM256 192h512v-128h-512z" />
+<glyph unicode="&#xe005;" d="M64 768h896v-128h-896zM64 384h896v-128h-896zM384 576h576v-128h-576zM384 192h576v-128h-576z" />
+<glyph unicode="&#xe006;" d="M64 768h896v-128h-896zM64 384h896v-128h-896zM64 576h896v-128h-896zM64 192h896v-128h-896z" />
+<glyph unicode="&#xe007;" d="M864.408 289.868c-46.47 46.47-106.938 68.004-161.082 62.806l-63.326 63.326 192 192c0 0 128 128 0 256l-320-320-320 320c-128-128 0-256 0-256l192-192-63.326-63.326c-54.144 5.198-114.61-16.338-161.080-62.806-74.98-74.98-85.112-186.418-22.626-248.9 62.482-62.482 173.92-52.354 248.9 22.626 46.47 46.468 68.002 106.938 62.806 161.080l63.326 63.326 63.328-63.328c-5.196-54.144 16.336-114.61 62.806-161.078 74.978-74.98 186.418-85.112 248.898-22.626 62.488 62.482 52.356 173.918-22.624 248.9zM353.124 201.422c-2.212-24.332-15.020-49.826-35.14-69.946-22.212-22.214-51.080-35.476-77.218-35.476-10.524 0-25.298 2.228-35.916 12.848-21.406 21.404-17.376 73.132 22.626 113.136 22.212 22.214 51.080 35.476 77.218 35.476 10.524 0 25.298-2.228 35.916-12.848 13.112-13.11 13.47-32.688 12.514-43.19zM512 352c-35.346 0-64 28.654-64 64s28.654 64 64 64 64-28.654 64-64-28.654-64-64-64zM819.152 108.848c-10.62-10.62-25.392-12.848-35.916-12.848-26.138 0-55.006 13.262-77.218 35.476-20.122 20.12-32.928 45.614-35.138 69.946-0.958 10.502-0.6 30.080 12.514 43.192 10.618 10.622 25.39 12.848 35.916 12.848 26.136 0 55.006-13.262 77.216-35.474 40.004-40.008 44.032-91.736 22.626-113.14z" />
+<glyph unicode="&#xe008;" d="M704 576v160c0 17.6-14.4 32-32 32h-160v64c0 35.2-28.8 64-64 64h-128c-35.204 0-64-28.8-64-64v-64h-160c-17.602 0-32-14.4-32-32v-512c0-17.6 14.398-32 32-32h224v-192h384l192 192v384h-192zM320 831.886c0.034 0.038 0.072 0.078 0.114 0.114h127.768c0.042-0.036 0.082-0.076 0.118-0.114v-63.886h-128v63.886zM192 640v64h384v-64h-384zM704 90.51v101.49h101.49l-101.49-101.49zM832 256h-192v-192h-256v448h448v-256z" />
+<glyph unicode="&#xe009;" d="M888 576h-56v256h64v64h-320v-64h64v-256h-256v256h64v64h-320v-64h64v-256h-56c-39.6 0-72-32.4-72-72v-432c0-39.6 32.4-72 72-72h240c39.6 0 72 32.4 72 72v312h128v-312c0-39.6 32.4-72 72-72h240c39.6 0 72 32.4 72 72v432c0 39.6-32.4 72-72 72zM348 64h-184c-19.8 0-36 14.4-36 32s16.2 32 36 32h184c19.8 0 36-14.4 36-32s-16.2-32-36-32zM544 448h-64c-17.6 0-32 14.4-32 32s14.4 32 32 32h64c17.6 0 32-14.4 32-32s-14.4-32-32-32zM860 64h-184c-19.8 0-36 14.4-36 32s16.2 32 36 32h184c19.8 0 36-14.4 36-32s-16.2-32-36-32z" />
+<glyph unicode="&#xe00a;" d="M384 832h576v-128h-576zM384 512h576v-128h-576zM384 192h576v-128h-576zM128 768c0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64s-64-28.654-64-64zM128 448c0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64s-64-28.654-64-64zM128 128c0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64s-64-28.654-64-64z" />
+<glyph unicode="&#xe00b;" d="M384 832h576v-128h-576zM384 512h576v-128h-576zM384 192h576v-128h-576zM320 430v146h-64v320h-128v-64h64v-256h-64v-64h128v-50l-128-60v-146h128v-64h-128v-64h128v-64h-128v-64h192v320h-128v50z" />
+<glyph unicode="&#xe00c;" d="M64 768h896v-128h-896zM384 384h576v-128h-576zM384 576h576v-128h-576zM64 192h896v-128h-896zM64 576l224-160-224-160z" />
+<glyph unicode="&#xe00d;" d="M64 768h896v-128h-896zM64 384h576v-128h-576zM64 576h576v-128h-576zM64 192h896v-128h-896zM960 576l-224-160 224-160z" />
+<glyph unicode="&#xe00e;" d="M256.428 535.274c105.8 0 191.572-91.17 191.572-203.638 0-112.464-85.772-203.636-191.572-203.636-105.802 0-191.572 91.17-191.572 203.636l-0.856 29.092c0 224.93 171.54 407.272 383.144 407.272v-116.364c-73.1 0-141.826-30.26-193.516-85.204-9.954-10.578-19.034-21.834-27.224-33.656 9.784 1.64 19.806 2.498 30.024 2.498zM768.428 535.274c105.8 0 191.572-91.17 191.572-203.638 0-112.464-85.772-203.636-191.572-203.636-105.802 0-191.572 91.17-191.572 203.636l-0.856 29.092c0 224.93 171.54 407.272 383.144 407.272v-116.364c-73.1 0-141.826-30.26-193.516-85.204-9.956-10.578-19.036-21.834-27.224-33.656 9.784 1.64 19.806 2.498 30.024 2.498z" />
+<glyph unicode="&#xe00f;" d="M704 0c59 199 134.906 455.266-256 446.096v-222.096l-336.002 336 336.002 336v-217.326c468.092 12.2 544-358.674 256-678.674z" />
+<glyph unicode="&#xe010;" d="M576 678.674v217.326l336.002-336-336.002-336v222.096c-390.906 9.17-315-247.096-256-446.096-288 320-212.092 690.874 256 678.674z" />
+<glyph unicode="&#xe011;" d="M927.274 729.784l-133.49 133.488c-21.104 21.104-49.232 32.728-79.198 32.728s-58.094-11.624-79.196-32.726l-165.492-165.49c-43.668-43.668-43.668-114.724 0-158.392l2.746-2.746 67.882 67.882-2.746 2.746c-6.132 6.132-6.132 16.494 0 22.626l165.492 165.492c4.010 4.008 8.808 4.608 11.312 4.608s7.302-0.598 11.312-4.61l133.49-133.488c6.132-6.134 6.132-16.498 0.002-22.628l-165.494-165.494c-4.008-4.008-8.806-4.608-11.31-4.608s-7.302 0.6-11.312 4.612l-2.746 2.746-67.88-67.884 2.742-2.742c21.106-21.108 49.23-32.728 79.2-32.728s58.094 11.624 79.196 32.726l165.494 165.492c43.662 43.666 43.662 114.72-0.004 158.39zM551.356 359.356l-67.882-67.882 2.746-2.746c4.008-4.008 4.61-8.806 4.61-11.31 0-2.506-0.598-7.302-4.606-11.314l-165.494-165.49c-4.010-4.010-8.81-4.61-11.314-4.61s-7.304 0.6-11.314 4.61l-133.492 133.486c-4.010 4.010-4.61 8.81-4.61 11.314s0.598 7.3 4.61 11.312l165.49 165.488c4.010 4.012 8.81 4.612 11.314 4.612s7.304-0.6 11.314-4.612l2.746-2.742 67.882 67.88-2.746 2.746c-21.104 21.104-49.23 32.726-79.196 32.726s-58.092-11.624-79.196-32.726l-165.488-165.486c-21.106-21.104-32.73-49.234-32.73-79.198s11.624-58.094 32.726-79.198l133.49-133.49c21.106-21.102 49.232-32.726 79.198-32.726s58.092 11.624 79.196 32.726l165.494 165.492c21.104 21.104 32.722 49.23 32.722 79.196s-11.624 58.094-32.726 79.196l-2.744 2.746zM352 250c-9.724 0-19.45 3.71-26.87 11.128-14.84 14.84-14.84 38.898 0 53.738l320 320c14.84 14.84 38.896 14.84 53.736 0 14.844-14.84 14.844-38.9 0-53.74l-320-320c-7.416-7.416-17.142-11.126-26.866-11.126z" />
+<glyph unicode="&#xe012;" d="M927.274 729.784l-133.49 133.488c-21.104 21.104-49.232 32.728-79.198 32.728s-58.094-11.624-79.196-32.726l-165.492-165.49c-43.668-43.668-43.668-114.724 0-158.392l2.746-2.746 67.882 67.882-2.746 2.746c-6.132 6.132-6.132 16.494 0 22.626l165.492 165.492c4.010 4.008 8.808 4.608 11.312 4.608s7.302-0.598 11.312-4.61l133.49-133.488c6.132-6.134 6.132-16.498 0.002-22.628l-165.494-165.494c-4.008-4.008-8.806-4.608-11.31-4.608s-7.302 0.6-11.312 4.612l-2.746 2.746-67.88-67.884 2.742-2.742c21.106-21.108 49.23-32.728 79.2-32.728s58.094 11.624 79.196 32.726l165.494 165.492c43.662 43.666 43.662 114.72-0.004 158.39zM551.356 359.356l-67.882-67.882 2.746-2.746c4.008-4.008 4.61-8.806 4.61-11.31 0-2.506-0.598-7.302-4.606-11.314l-165.494-165.49c-4.010-4.010-8.81-4.61-11.314-4.61s-7.304 0.6-11.314 4.61l-133.492 133.486c-4.010 4.010-4.61 8.81-4.61 11.314s0.598 7.3 4.61 11.312l165.49 165.488c4.010 4.012 8.81 4.612 11.314 4.612s7.304-0.6 11.314-4.612l2.746-2.742 67.882 67.88-2.746 2.746c-21.104 21.104-49.23 32.726-79.196 32.726s-58.092-11.624-79.196-32.726l-165.488-165.486c-21.106-21.104-32.73-49.234-32.73-79.198s11.624-58.094 32.726-79.198l133.49-133.49c21.106-21.102 49.232-32.726 79.198-32.726s58.092 11.624 79.196 32.726l165.494 165.492c21.104 21.104 32.722 49.23 32.722 79.196s-11.624 58.094-32.726 79.196l-2.744 2.746zM800 122c-9.724 0-19.45 3.708-26.87 11.13l-128 127.998c-14.844 14.84-14.844 38.898 0 53.738 14.84 14.844 38.896 14.844 53.736 0l128-128c14.844-14.84 14.844-38.896 0-53.736-7.416-7.422-17.142-11.13-26.866-11.13zM608 0c-17.674 0-32 14.326-32 32v128c0 17.674 14.326 32 32 32s32-14.326 32-32v-128c0-17.674-14.326-32-32-32zM928 320h-128c-17.674 0-32 14.326-32 32s14.326 32 32 32h128c17.674 0 32-14.326 32-32s-14.326-32-32-32zM224 774c9.724 0 19.45-3.708 26.87-11.13l128-128c14.842-14.84 14.842-38.898 0-53.738-14.84-14.844-38.898-14.844-53.738 0l-128 128c-14.842 14.84-14.842 38.898 0 53.738 7.418 7.422 17.144 11.13 26.868 11.13zM416 896c17.674 0 32-14.326 32-32v-128c0-17.674-14.326-32-32-32s-32 14.326-32 32v128c0 17.674 14.326 32 32 32zM96 576h128c17.674 0 32-14.326 32-32s-14.326-32-32-32h-128c-17.674 0-32 14.326-32 32s14.326 32 32 32z" />
+<glyph unicode="&#xe013;" d="M256 896v-896l256 256 256-256v896h-512zM704 170.51l-192 192-192-192v661.49h384v-661.49z" />
+<glyph unicode="&#xe014;" d="M896 832h-768c-35.2 0-64-28.8-64-64v-640c0-35.2 28.8-64 64-64h768c35.2 0 64 28.8 64 64v640c0 35.2-28.8 64-64 64zM896 128.116c-0.012-0.014-0.030-0.028-0.042-0.042l-191.958 319.926-160-128-224 288-191.968-479.916c-0.010 0.010-0.022 0.022-0.032 0.032v639.77c0.034 0.040 0.076 0.082 0.114 0.114h767.77c0.040-0.034 0.082-0.076 0.116-0.116v-639.768zM640 608c0-53.019 42.981-96 96-96s96 42.981 96 96c0 53.019-42.981 96-96 96s-96-42.981-96-96z" />
+<glyph unicode="&#xe015;" d="M896 832h-768c-35.2 0-64-28.8-64-64v-640c0-35.2 28.8-64 64-64h768c35.2 0 64 28.8 64 64v640c0 35.2-28.8 64-64 64zM256 128h-128v128h128v-128zM256 384h-128v128h128v-128zM256 640h-128v128h128v-128zM704 128h-384v640h384v-640zM896 128h-128v128h128v-128zM896 384h-128v128h128v-128zM896 640h-128v128h128v-128zM384 640v-384l288 192z" />
+<glyph unicode="&#xe016;" d="M448 256h128v-128h-128v128zM704 704c35.346 0 64-28.654 64-64v-166l-228-154h-92v64l192 128v64h-320v128h384zM512 896c-119.666 0-232.166-46.6-316.784-131.216-84.614-84.618-131.216-197.118-131.216-316.784 0-119.664 46.602-232.168 131.216-316.784 84.618-84.616 197.118-131.216 316.784-131.216 119.664 0 232.168 46.6 316.784 131.216s131.216 197.12 131.216 316.784c0 119.666-46.6 232.166-131.216 316.784-84.616 84.616-197.12 131.216-316.784 131.216z" />
+<glyph unicode="&#xe017;" d="M416 256l-192 192 192 192-64 64-256-256 256-256zM672 704l-64-64 192-192-192-192 64-64 256 256z" />
+<glyph unicode="&#xe018;" d="M77.798 655.376l81.414-50.882c50.802 81.114 128.788 143.454 221.208 174.246l-30.366 91.094c-113.748-37.898-209.728-114.626-272.256-214.458zM673.946 869.834l-30.366-91.094c92.422-30.792 170.404-93.132 221.208-174.248l81.412 50.882c-62.526 99.834-158.506 176.562-272.254 214.46zM607.974 255.992c-4.808 0-9.692 1.090-14.286 3.386l-145.688 72.844v211.778c0 17.672 14.328 32 32 32s32-14.328 32-32v-172.222l110.31-55.156c15.806-7.902 22.214-27.124 14.31-42.932-5.604-11.214-16.908-17.696-28.646-17.698zM512 768c-212.078 0-384-171.922-384-384s171.922-384 384-384c212.078 0 384 171.922 384 384s-171.922 384-384 384zM512 96c-159.058 0-288 128.942-288 288s128.942 288 288 288c159.058 0 288-128.942 288-288s-128.942-288-288-288z" />
+<glyph unicode="&#xe019;" d="M64 504.254c45.318 49.92 97.162 92.36 153.272 125.124 90.332 52.744 192.246 80.622 294.728 80.622 102.48 0 204.396-27.878 294.726-80.624 56.112-32.764 107.956-75.204 153.274-125.124v117.432c-33.010 28.118-68.124 53.14-104.868 74.594-105.006 61.314-223.658 93.722-343.132 93.722s-238.128-32.408-343.134-93.72c-36.742-21.454-71.856-46.478-104.866-74.596v-117.43zM512 640c-183.196 0-345.838-100.556-448-256 102.162-155.448 264.804-256 448-256s345.838 100.552 448 256c-102.162 155.444-264.804 256-448 256zM512 448c0-35.346-28.654-64-64-64s-64 28.654-64 64c0 35.348 28.654 64 64 64s64-28.652 64-64zM728.066 263.338c-67.434-39.374-140.128-59.338-216.066-59.338s-148.632 19.964-216.066 59.338c-51.554 30.104-98.616 71.31-138.114 120.662 39.498 49.35 86.56 90.558 138.116 120.66 13.276 7.752 26.758 14.74 40.426 20.982-10.512-23.742-16.362-50.008-16.362-77.642 0-106.040 85.962-192 192-192 106.040 0 192 85.96 192 192 0 27.634-5.85 53.9-16.36 77.642 13.668-6.244 27.15-13.23 40.426-20.982 51.554-30.102 98.616-71.31 138.116-120.66-39.498-49.352-86.56-90.558-138.116-120.662z" />
+<glyph unicode="&#xe01a;" d="M651.168 676.166c-24.612 81.962-28.876 91.834-107.168 91.834h-64c-79.618 0-82.664-10.152-108.418-96 0-0.002 0-0.002-0.002-0.004l-143.998-479.996h113.636l57.6 192h226.366l57.6-192h113.63l-145.246 484.166zM437.218 512l38.4 136c10.086 33.618 36.38 30 36.38 30s26.294 3.618 36.38-30h0.004l38.4-136h-149.564z" />
+<glyph unicode="&#xe01b;" d="M64 768v-704h896v704h-896zM384 320v128h256v-128h-256zM640 256v-128h-256v128h256zM640 640v-128h-256v128h256zM320 640v-128h-192v128h192zM128 448h192v-128h-192v128zM704 448h192v-128h-192v128zM704 512v128h192v-128h-192zM128 256h192v-128h-192v128zM704 128v128h192v-128h-192z" />
+<glyph unicode="&#xe01c;" d="M64 512h896v-128h-896z" />
+<glyph unicode="&#xe01d;" d="M64 192h512v-128h-512v128zM768 768h-220.558l-183.766-512h-132.288l183.762 512h-223.15v128h576v-128zM929.774 64l-129.774 129.774-129.774-129.774-62.226 62.226 129.774 129.774-129.774 129.774 62.226 62.226 129.774-129.774 129.774 129.774 62.226-62.226-129.774-129.774 129.774-129.774-62.226-62.226z" />
+<glyph unicode="&#xe01e;" d="M768 50v-50h128v-64h-192v146l128 60v50h-128v64h192v-146zM676 704h-136l-188-188-188 188h-136l256-256-256-256h136l188 188 188-188h136l-256 256z" />
+<glyph unicode="&#xe01f;" d="M768 754v-50h128v-64h-192v146l128 60v50h-128v64h192v-146zM676 704h-136l-188-188-188 188h-136l256-256-256-256h136l188 188 188-188h136l-256 256z" />
+<glyph unicode="&#xe020;" d="M704 128v37.004c151.348 61.628 256 193.82 256 346.996 0 212.078-200.576 384-448 384s-448-171.922-448-384c0-153.176 104.654-285.368 256-346.996v-37.004h-192l-64 96v-224h320v222.812c-100.9 51.362-170.666 161.54-170.666 289.188 0 176.732 133.718 320 298.666 320s298.666-143.268 298.666-320c0-127.648-69.766-237.826-170.666-289.188v-222.812h320v224l-64-96h-192z" />
+<glyph unicode="&#xe021;" d="M512 820c99.366 0 192.782-38.694 263.042-108.956s108.958-163.678 108.958-263.044-38.696-192.782-108.958-263.042-163.676-108.958-263.042-108.958-192.782 38.696-263.044 108.958-108.956 163.676-108.956 263.042 38.694 192.782 108.956 263.044 163.678 108.956 263.044 108.956zM512 896c-247.424 0-448-200.576-448-448s200.576-448 448-448 448 200.576 448 448-200.576 448-448 448v0zM320 576c0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64s-64-28.654-64-64zM576 576c0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64s-64-28.654-64-64zM512 304c-101.84 0-192.56 36.874-251.166 94.328 23.126-117.608 126.778-206.328 251.166-206.328s228.040 88.72 251.168 206.328c-58.608-57.454-149.328-94.328-251.168-94.328z" />
+<glyph unicode="&#xe022;" d="M256 832h512v-128h-512v128zM896 640h-768c-35.2 0-64-28.8-64-64v-256c0-35.2 28.796-64 64-64h128v-192h512v192h128c35.2 0 64 28.8 64 64v256c0 35.2-28.8 64-64 64zM704 128h-384v256h384v-256zM910.4 544c0-25.626-20.774-46.4-46.398-46.4s-46.402 20.774-46.402 46.4 20.778 46.4 46.402 46.4c25.626 0 46.398-20.774 46.398-46.4z" />
+<glyph unicode="&#xe023;" d="M480 576l-192 192 128 128h-352v-352l128 128 192-192zM640 480l192 192 128-128v352h-352l128-128-192-192zM544 320l192-192-128-128h352v352l-128-128-192 192zM384 416l-192-192-128 128v-352h352l-128 128 192 192z" />
+<glyph unicode="&#xe024;" d="M960 832v64h-192c-35.202 0-64-28.8-64-64v-320c0-15.856 5.858-30.402 15.496-41.614l-303.496-260.386-142 148-82-70 224-288 416 448h128v64h-192v320h192zM256 448h64v384c0 35.2-28.8 64-64 64h-128c-35.2 0-64-28.8-64-64v-384h64v192h128v-192zM128 704v128h128v-128h-128zM640 512v96c0 35.2-8.8 64-44 64 35.2 0 44 28.8 44 64v96c0 35.2-28.8 64-64 64h-192v-448h192c35.2 0 64 28.8 64 64zM448 832h128v-128h-128v128zM448 640h128v-128h-128v128z" />
+<glyph unicode="&#xe025;" d="M448 448h-128v128h128v128h128v-128h128v-128h-128v-128h-128v128zM960 384v-320h-896v320h128v-192h640v192h128z" />
+<glyph unicode="&#xe026;" d="M512 576h128v-64h-128zM512 192h128v-64h-128zM576 384h128v-64h-128zM768 384v-192h-64v-64h128v256zM384 384h128v-64h-128zM320 192h128v-64h-128zM320 576h128v-64h-128zM192 768v-256h64v192h64v64zM704 512h128v256h-64v-192h-64zM64 896v-896h896v896h-896zM896 64h-768v768h768v-768zM192 384v-256h64v192h64v64zM576 768h128v-64h-128zM384 768h128v-64h-128z" />
+<glyph unicode="&#xe027;" d="M816 896l16-384h-640l16 384h32l16-320h512l16 320h32zM208 0l-16 320h640l-16-320h-32l-16 256h-512l-16-256h-32zM64 448h128v-64h-128zM256 448h128v-64h-128zM448 448h128v-64h-128zM640 448h128v-64h-128zM832 448h128v-64h-128z" />
+<glyph unicode="&#xe028;" d="M576 896c247.424 0 448-200.576 448-448s-200.576-448-448-448v96c94.024 0 182.418 36.614 248.902 103.098s103.098 154.878 103.098 248.902c0 94.022-36.614 182.418-103.098 248.902s-154.878 103.098-248.902 103.098c-94.022 0-182.418-36.614-248.902-103.098-51.14-51.138-84.582-115.246-97.306-184.902h186.208l-224-256-224 256h164.57c31.060 217.102 217.738 384 443.43 384zM768 512v-128h-256v320h128v-192z" />
+<glyph unicode="&#xe02a;" d="M625.442 465.818c48.074 38.15 78.558 94.856 78.558 158.182 0 114.876-100.29 208-224 208h-224v-768h288c123.712 0 224 93.124 224 208 0 88.196-59.118 163.562-142.558 193.818zM384 656c0 26.51 21.49 48 48 48h67.204c42.414 0 76.796-42.98 76.796-96s-34.382-96-76.796-96h-115.204v144zM547.2 192h-115.2c-26.51 0-48 21.49-48 48v144h163.2c42.418 0 76.8-42.98 76.8-96s-34.382-96-76.8-96z" />
+<glyph unicode="&#xe02b;" d="M832 832v-64h-144l-256-640h144v-64h-448v64h144l256 640h-144v64h448z" />
+<glyph unicode="&#xe02c;" d="M192 128h576v-64h-576v64zM640 832v-384c0-31.312-14.7-61.624-41.39-85.352-30.942-27.502-73.068-42.648-118.61-42.648-45.544 0-87.668 15.146-118.608 42.648-26.692 23.728-41.392 54.040-41.392 85.352v384h-128v-384c0-141.382 128.942-256 288-256s288 114.618 288 256v384h-128z" />
+<glyph unicode="&#xe02d;" d="M960 448h-265.876c-50.078 35.42-114.43 54.86-182.124 54.86-89.206 0-164.572 50.242-164.572 109.712s75.366 109.714 164.572 109.714c75.058 0 140.308-35.576 159.12-82.286h113.016c-7.93 50.644-37.58 97.968-84.058 132.826-50.88 38.16-117.676 59.174-188.078 59.174-70.404 0-137.196-21.014-188.074-59.174-54.788-41.090-86.212-99.502-86.212-160.254s31.424-119.164 86.212-160.254c1.956-1.466 3.942-2.898 5.946-4.316h-265.872v-64h512.532c58.208-17.106 100.042-56.27 100.042-100.572 0-59.468-75.368-109.71-164.572-109.71-75.060 0-140.308 35.574-159.118 82.286h-113.016c7.93-50.64 37.582-97.968 84.060-132.826 50.876-38.164 117.668-59.18 188.072-59.18 70.402 0 137.198 21.016 188.074 59.174 54.79 41.090 86.208 99.502 86.208 160.254 0 35.298-10.654 69.792-30.294 100.572h204.012v64z" />
+<glyph unicode="&#xe02e;" d="M384 832c-123.712 0-224-100.288-224-224s100.288-224 224-224v-320h128v640h64v-640h128v640h128v128h-448z" />
+<glyph unicode="&#xe02f;" d="M448 832c-123.712 0-224-100.288-224-224s100.288-224 224-224v-320h128v640h64v-640h128v640h128v128h-448zM64 64l224 192-224 192z" />
+<glyph unicode="&#xe030;" d="M320 832c-123.712 0-224-100.288-224-224s100.288-224 224-224v-320h128v640h64v-640h128v640h128v128h-448zM960 448l-224-192 224-192z" />
+<glyph unicode="&#xe031;" d="M832 640h-192v64l-192 192h-384v-704h384v-192h576v448l-192 192zM832 549.49l101.49-101.49h-101.49v101.49zM448 805.49l101.49-101.49h-101.49v101.49zM128 832h256v-192h192v-384h-448v576zM960 64h-448v128h128v384h128v-192h192v-320z" />
+<glyph unicode="&#xe032;" d="M768 704h64v-64h-64zM640 576h64v-64h-64zM640 448h64v-64h-64zM640 320h64v-64h-64zM512 448h64v-64h-64zM512 320h64v-64h-64zM384 320h64v-64h-64zM768 576h64v-64h-64zM768 448h64v-64h-64zM768 320h64v-64h-64zM768 192h64v-64h-64zM640 192h64v-64h-64zM512 192h64v-64h-64zM384 192h64v-64h-64zM256 192h64v-64h-64z" />
+<glyph unicode="&#xe034;" d="M928 832h-416l-32 64h-352l-64-128h896zM840.34 256h87.66l32 448h-896l64-640h356.080c-104.882 37.776-180.080 138.266-180.080 256 0 149.982 122.018 272 272 272 149.98 0 272-122.018 272-272 0-21.678-2.622-43.15-7.66-64zM874.996 110.25l-134.496 110.692c17.454 28.922 27.5 62.814 27.5 99.058 0 106.040-85.96 192-192 192s-192-85.96-192-192 85.96-192 192-192c36.244 0 70.138 10.046 99.058 27.5l110.692-134.496c22.962-26.678 62.118-28.14 87.006-3.252l5.492 5.492c24.888 24.888 23.426 64.044-3.252 87.006zM576 196c-68.484 0-124 55.516-124 124s55.516 124 124 124 124-55.516 124-124-55.516-124-124-124z" />
+<glyph unicode="&#xe035;" d="M704 576v160c0 17.6-14.4 32-32 32h-160v64c0 35.2-28.8 64-64 64h-128c-35.204 0-64-28.8-64-64v-64h-160c-17.602 0-32-14.4-32-32v-512c0-17.6 14.398-32 32-32h224v-192h576v576h-192zM320 831.886c0.034 0.038 0.072 0.078 0.114 0.114h127.768c0.042-0.036 0.082-0.076 0.118-0.114v-63.886h-128v63.886zM192 640v64h384v-64h-384zM832 64h-448v448h448v-448zM448 448v-128h32l32 64h64v-192h-48v-64h160v64h-48v192h64l32-64h32v128z" />
+</font></defs></svg>
\ No newline at end of file
Binary file src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/fonts/tinymce-small.ttf has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/fonts/tinymce-small.woff has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/fonts/tinymce.eot has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/fonts/tinymce.svg	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,63 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata>Generated by IcoMoon</metadata>
+<defs>
+<font id="tinymce" horiz-adv-x="1024">
+<font-face units-per-em="1024" ascent="960" descent="-64" />
+<missing-glyph horiz-adv-x="1024" />
+<glyph unicode="&#x20;" d="" horiz-adv-x="512" />
+<glyph unicode="&#xe000;" d="M896 960h-896v-1024h1024v896l-128 128zM512 832h128v-256h-128v256zM896 64h-768v768h64v-320h576v320h74.978l53.022-53.018v-714.982z" />
+<glyph unicode="&#xe001;" d="M903.432 760.57l-142.864 142.862c-31.112 31.112-92.568 56.568-136.568 56.568h-480c-44 0-80-36-80-80v-864c0-44 36-80 80-80h736c44 0 80 36 80 80v608c0 44-25.456 105.458-56.568 136.57zM858.178 715.314c3.13-3.13 6.25-6.974 9.28-11.314h-163.458v163.456c4.34-3.030 8.184-6.15 11.314-9.28l142.864-142.862zM896 16c0-8.672-7.328-16-16-16h-736c-8.672 0-16 7.328-16 16v864c0 8.672 7.328 16 16 16h480c4.832 0 10.254-0.61 16-1.704v-254.296h254.296c1.094-5.746 1.704-11.166 1.704-16v-608z" />
+<glyph unicode="&#xe002;" d="M1024 367.542v160.916l-159.144 15.914c-8.186 30.042-20.088 58.548-35.21 84.98l104.596 127.838-113.052 113.050-127.836-104.596c-26.434 15.124-54.942 27.026-84.982 35.208l-15.914 159.148h-160.916l-15.914-159.146c-30.042-8.186-58.548-20.086-84.98-35.208l-127.838 104.594-113.050-113.050 104.596-127.836c-15.124-26.432-27.026-54.94-35.21-84.98l-159.146-15.916v-160.916l159.146-15.914c8.186-30.042 20.086-58.548 35.21-84.982l-104.596-127.836 113.048-113.048 127.838 104.596c26.432-15.124 54.94-27.028 84.98-35.21l15.916-159.148h160.916l15.914 159.144c30.042 8.186 58.548 20.088 84.982 35.21l127.836-104.596 113.048 113.048-104.596 127.836c15.124 26.434 27.028 54.942 35.21 84.98l159.148 15.92zM704 384l-128-128h-128l-128 128v128l128 128h128l128-128v-128z" />
+<glyph unicode="&#xe003;" d="M0 896h1024v-128h-1024zM0 704h640v-128h-640zM0 320h640v-128h-640zM0 512h1024v-128h-1024zM0 128h1024v-128h-1024z" />
+<glyph unicode="&#xe004;" d="M0 896h1024v-128h-1024zM192 704h640v-128h-640zM192 320h640v-128h-640zM0 512h1024v-128h-1024zM0 128h1024v-128h-1024z" />
+<glyph unicode="&#xe005;" d="M0 896h1024v-128h-1024zM384 704h640v-128h-640zM384 320h640v-128h-640zM0 512h1024v-128h-1024zM0 128h1024v-128h-1024z" />
+<glyph unicode="&#xe006;" d="M0 896h1024v-128h-1024zM0 704h1024v-128h-1024zM0 512h1024v-128h-1024zM0 320h1024v-128h-1024zM0 128h1024v-128h-1024z" />
+<glyph unicode="&#xe007;" d="M890.774 250.846c-45.654 45.556-103.728 69.072-157.946 69.072h-29.112l-63.904 64.008 255.62 256.038c63.904 64.010 63.904 192.028 0 256.038l-383.43-384.056-383.432 384.054c-63.904-64.008-63.904-192.028 0-256.038l255.622-256.034-63.906-64.008h-29.114c-54.22 0-112.292-23.518-157.948-69.076-81.622-81.442-92.65-202.484-24.63-270.35 29.97-29.902 70.288-44.494 112.996-44.494 54.216 0 112.29 23.514 157.946 69.072 53.584 53.464 76.742 124 67.084 185.348l65.384 65.488 65.376-65.488c-9.656-61.348 13.506-131.882 67.084-185.348 45.662-45.558 103.732-69.072 157.948-69.072 42.708 0 83.024 14.592 112.994 44.496 68.020 67.866 56.988 188.908-24.632 270.35zM353.024 114.462c-7.698-17.882-19.010-34.346-33.626-48.926-14.636-14.604-31.172-25.918-49.148-33.624-16.132-6.916-32.96-10.568-48.662-10.568-15.146 0-36.612 3.402-52.862 19.612-16.136 16.104-19.52 37.318-19.52 52.288 0 15.542 3.642 32.21 10.526 48.212 7.7 17.884 19.014 34.346 33.626 48.926 14.634 14.606 31.172 25.914 49.15 33.624 16.134 6.914 32.96 10.568 48.664 10.568 15.146 0 36.612-3.4 52.858-19.614 16.134-16.098 19.522-37.316 19.522-52.284 0.002-15.542-3.638-32.216-10.528-48.214zM512.004 293.404c-49.914 0-90.376 40.532-90.376 90.526 0 49.992 40.462 90.52 90.376 90.52s90.372-40.528 90.372-90.52c0-49.998-40.46-90.526-90.372-90.526zM855.272 40.958c-16.248-16.208-37.712-19.612-52.86-19.612-15.704 0-32.53 3.652-48.666 10.568-17.972 7.706-34.508 19.020-49.142 33.624-14.614 14.58-25.926 31.042-33.626 48.926-6.886 15.998-10.526 32.672-10.526 48.212 0 14.966 3.384 36.188 19.52 52.286 16.246 16.208 37.712 19.614 52.86 19.614 15.7 0 32.53-3.654 48.66-10.568 17.978-7.708 34.516-19.018 49.15-33.624 14.61-14.58 25.924-31.042 33.626-48.926 6.884-15.998 10.526-32.67 10.526-48.212-0.002-14.97-3.39-36.186-19.522-52.288z" />
+<glyph unicode="&#xe008;" d="M832 640v160c0 17.6-14.4 32-32 32h-224v64c0 35.2-28.8 64-64 64h-128c-35.204 0-64-28.8-64-64v-64h-224c-17.602 0-32-14.4-32-32v-640c0-17.6 14.398-32 32-32h288v-192h448l192 192v512h-192zM384 895.886c0.034 0.038 0.072 0.078 0.114 0.114h127.768c0.042-0.036 0.082-0.076 0.118-0.114v-63.886h-128v63.886zM192 704v64h512v-64h-512zM832 26.51v101.49h101.49l-101.49-101.49zM960 192h-192v-192h-320v576h512v-384z" />
+<glyph unicode="&#xe009;" d="M64 960h384v-64h-384zM576 960h384v-64h-384zM952 640h-56v256h-256v-256h-256v256h-256v-256h-56c-39.6 0-72-32.4-72-72v-560c0-39.6 32.4-72 72-72h304c39.6 0 72 32.4 72 72v376h128v-376c0-39.6 32.4-72 72-72h304c39.6 0 72 32.4 72 72v560c0 39.6-32.4 72-72 72zM348 0h-248c-19.8 0-36 14.4-36 32s16.2 32 36 32h248c19.8 0 36-14.4 36-32s-16.2-32-36-32zM544 448h-64c-17.6 0-32 14.4-32 32s14.4 32 32 32h64c17.6 0 32-14.4 32-32s-14.4-32-32-32zM924 0h-248c-19.8 0-36 14.4-36 32s16.2 32 36 32h248c19.8 0 36-14.4 36-32s-16.2-32-36-32z" />
+<glyph unicode="&#xe00a;" d="M384 896h640v-128h-640v128zM384 512h640v-128h-640v128zM384 128h640v-128h-640v128zM0 832c0 70.692 57.308 128 128 128s128-57.308 128-128c0-70.692-57.308-128-128-128s-128 57.308-128 128zM0 448c0 70.692 57.308 128 128 128s128-57.308 128-128c0-70.692-57.308-128-128-128s-128 57.308-128 128zM0 64c0 70.692 57.308 128 128 128s128-57.308 128-128c0-70.692-57.308-128-128-128s-128 57.308-128 128z" />
+<glyph unicode="&#xe00b;" d="M384 128h640v-128h-640zM384 512h640v-128h-640zM384 896h640v-128h-640zM192 960v-256h-64v192h-64v64zM128 434v-50h128v-64h-192v146l128 60v50h-128v64h192v-146zM256 256v-320h-192v64h128v64h-128v64h128v64h-128v64z" />
+<glyph unicode="&#xe00c;" d="M0 896h1024v-128h-1024zM384 704h640v-128h-640zM384 512h640v-128h-640zM384 320h640v-128h-640zM0 128h1024v-128h-1024zM0 256v384l256-192z" />
+<glyph unicode="&#xe00d;" d="M0 896h1024v-128h-1024zM384 704h640v-128h-640zM384 512h640v-128h-640zM384 320h640v-128h-640zM0 128h1024v-128h-1024zM256 640v-384l-256 192z" />
+<glyph unicode="&#xe00e;" d="M225 512c123.712 0 224-100.29 224-224 0-123.712-100.288-224-224-224s-224 100.288-224 224l-1 32c0 247.424 200.576 448 448 448v-128c-85.474 0-165.834-33.286-226.274-93.726-11.634-11.636-22.252-24.016-31.83-37.020 11.438 1.8 23.16 2.746 35.104 2.746zM801 512c123.71 0 224-100.29 224-224 0-123.712-100.29-224-224-224s-224 100.288-224 224l-1 32c0 247.424 200.576 448 448 448v-128c-85.474 0-165.834-33.286-226.274-93.726-11.636-11.636-22.254-24.016-31.832-37.020 11.44 1.8 23.16 2.746 35.106 2.746z" />
+<glyph unicode="&#xe00f;" d="M761.862-64c113.726 206.032 132.888 520.306-313.862 509.824v-253.824l-384 384 384 384v-248.372c534.962 13.942 594.57-472.214 313.862-775.628z" />
+<glyph unicode="&#xe010;" d="M576 711.628v248.372l384-384-384-384v253.824c-446.75 10.482-427.588-303.792-313.86-509.824-280.712 303.414-221.1 789.57 313.86 775.628z" />
+<glyph unicode="&#xe011;" d="M320 256c17.6-17.6 47.274-16.726 65.942 1.942l316.118 316.116c18.668 18.668 19.54 48.342 1.94 65.942s-47.274 16.726-65.942-1.942l-316.116-316.116c-18.668-18.668-19.542-48.342-1.942-65.942zM476.888 284.888c4.56-9.050 6.99-19.16 6.99-29.696 0-17.616-6.744-34.060-18.992-46.308l-163.382-163.382c-12.248-12.248-28.694-18.992-46.308-18.992s-34.060 6.744-46.308 18.992l-99.382 99.382c-12.248 12.248-18.992 28.694-18.992 46.308s6.744 34.060 18.992 46.308l163.382 163.382c12.248 12.248 28.694 18.994 46.308 18.994 10.536 0 20.644-2.43 29.696-6.99l65.338 65.338c-27.87 21.41-61.44 32.16-95.034 32.16-39.986 0-79.972-15.166-110.308-45.502l-163.382-163.382c-60.67-60.67-60.67-159.948 0-220.618l99.382-99.382c30.334-30.332 70.32-45.5 110.306-45.5 39.988 0 79.974 15.168 110.308 45.502l163.382 163.382c55.82 55.82 60.238 144.298 13.344 205.344l-65.34-65.34zM978.498 815.116l-99.382 99.382c-30.334 30.336-70.32 45.502-110.308 45.502-39.986 0-79.972-15.166-110.308-45.502l-163.382-163.382c-55.82-55.82-60.238-144.298-13.342-205.342l65.338 65.34c-4.558 9.050-6.988 19.16-6.988 29.694 0 17.616 6.744 34.060 18.992 46.308l163.382 163.382c12.248 12.248 28.694 18.994 46.308 18.994s34.060-6.746 46.308-18.994l99.382-99.382c12.248-12.248 18.992-28.694 18.992-46.308s-6.744-34.060-18.992-46.308l-163.382-163.382c-12.248-12.248-28.694-18.992-46.308-18.992-10.536 0-20.644 2.43-29.696 6.99l-65.338-65.338c27.872-21.41 61.44-32.16 95.034-32.16 39.988 0 79.974 15.168 110.308 45.502l163.382 163.382c60.67 60.666 60.67 159.944 0 220.614z" />
+<glyph unicode="&#xe012;" d="M476.888 284.886c4.56-9.048 6.99-19.158 6.99-29.696 0-17.616-6.744-34.058-18.992-46.308l-163.38-163.38c-12.248-12.248-28.696-18.992-46.308-18.992s-34.060 6.744-46.308 18.992l-99.38 99.38c-12.248 12.25-18.992 28.696-18.992 46.308s6.744 34.060 18.992 46.308l163.38 163.382c12.248 12.246 28.696 18.992 46.308 18.992 10.538 0 20.644-2.43 29.696-6.988l65.338 65.336c-27.87 21.41-61.44 32.16-95.034 32.16-39.986 0-79.972-15.166-110.308-45.502l-163.38-163.382c-60.67-60.67-60.67-159.95 0-220.618l99.38-99.382c30.334-30.332 70.32-45.5 110.306-45.5 39.988 0 79.974 15.168 110.308 45.502l163.38 163.38c55.82 55.82 60.238 144.298 13.344 205.346l-65.34-65.338zM978.496 815.116l-99.38 99.382c-30.334 30.336-70.32 45.502-110.308 45.502-39.986 0-79.97-15.166-110.306-45.502l-163.382-163.382c-55.82-55.82-60.238-144.298-13.342-205.342l65.338 65.34c-4.558 9.050-6.988 19.16-6.988 29.694 0 17.616 6.744 34.060 18.992 46.308l163.382 163.382c12.246 12.248 28.694 18.994 46.306 18.994 17.616 0 34.060-6.746 46.308-18.994l99.38-99.382c12.248-12.248 18.992-28.694 18.992-46.308s-6.744-34.060-18.992-46.308l-163.38-163.382c-12.248-12.248-28.694-18.992-46.308-18.992-10.536 0-20.644 2.43-29.696 6.99l-65.338-65.338c27.872-21.41 61.44-32.16 95.034-32.16 39.988 0 79.974 15.168 110.308 45.504l163.38 163.38c60.672 60.666 60.672 159.944 0 220.614zM233.368 681.376l-191.994 191.994 45.256 45.256 191.994-191.994zM384 960h64v-192h-64zM0 576h192v-64h-192zM790.632 214.624l191.996-191.996-45.256-45.256-191.996 191.996zM576 128h64v-192h-64zM832 384h192v-64h-192z" />
+<glyph unicode="&#xe013;" d="M192 960v-1024l320 320 320-320v1024h-640zM768 90.51l-256 256-256-256v805.49h512v-805.49z" />
+<glyph unicode="&#xe014;" d="M0 832v-832h1024v832h-1024zM960 64h-896v704h896v-704zM704 608c0 53.019 42.981 96 96 96s96-42.981 96-96c0-53.019-42.981-96-96-96s-96 42.981-96 96zM896 128h-768l192 512 256-320 128 96z" />
+<glyph unicode="&#xe015;" d="M0 832v-768h1024v768h-1024zM192 128h-128v128h128v-128zM192 384h-128v128h128v-128zM192 640h-128v128h128v-128zM768 128h-512v640h512v-640zM960 128h-128v128h128v-128zM960 384h-128v128h128v-128zM960 640h-128v128h128v-128zM384 640v-384l256 192z" />
+<glyph unicode="&#xe016;" d="M448 256h128v-128h-128zM704 704c35.346 0 64-28.654 64-64v-192l-192-128h-128v64l192 128v64h-320v128h384zM512 864c-111.118 0-215.584-43.272-294.156-121.844s-121.844-183.038-121.844-294.156c0-111.118 43.272-215.584 121.844-294.156s183.038-121.844 294.156-121.844c111.118 0 215.584 43.272 294.156 121.844s121.844 183.038 121.844 294.156c0 111.118-43.272 215.584-121.844 294.156s-183.038 121.844-294.156 121.844zM512 960v0c282.77 0 512-229.23 512-512s-229.23-512-512-512c-282.77 0-512 229.23-512 512s229.23 512 512 512z" />
+<glyph unicode="&#xe017;" d="M320 704l-256-256 256-256h128l-256 256 256 256zM704 704h-128l256-256-256-256h128l256 256z" />
+<glyph unicode="&#xe018;" d="M512 768c-212.076 0-384-171.922-384-384s171.922-384 384-384c212.074 0 384 171.922 384 384s-171.926 384-384 384zM715.644 180.354c-54.392-54.396-126.716-84.354-203.644-84.354s-149.25 29.958-203.646 84.354c-54.396 54.394-84.354 126.718-84.354 203.646s29.958 149.25 84.354 203.646c54.396 54.396 126.718 84.354 203.646 84.354s149.252-29.958 203.642-84.354c54.402-54.396 84.358-126.718 84.358-203.646s-29.958-149.252-84.356-203.646zM325.93 756.138l-42.94 85.878c-98.874-49.536-179.47-130.132-229.006-229.008l85.876-42.94c40.248 80.336 105.732 145.822 186.070 186.070zM884.134 570.070l85.878 42.938c-49.532 98.876-130.126 179.472-229.004 229.008l-42.944-85.878c80.338-40.248 145.824-105.732 186.070-186.068zM512 576h-64v-192c0-10.11 4.7-19.11 12.022-24.972l-0.012-0.016 160-128 39.976 49.976-147.986 118.39v176.622z" />
+<glyph unicode="&#xe019;" d="M512 640c-209.368 0-395.244-100.556-512-256 116.756-155.446 302.632-256 512-256s395.244 100.554 512 256c-116.756 155.444-302.632 256-512 256zM448 512c35.346 0 64-28.654 64-64s-28.654-64-64-64-64 28.654-64 64 28.654 64 64 64zM773.616 254.704c-39.648-20.258-81.652-35.862-124.846-46.376-44.488-10.836-90.502-16.328-136.77-16.328-46.266 0-92.282 5.492-136.768 16.324-43.194 10.518-85.198 26.122-124.846 46.376-63.020 32.202-120.222 76.41-167.64 129.298 47.418 52.888 104.62 97.1 167.64 129.298 32.336 16.522 66.242 29.946 101.082 40.040-19.888-30.242-31.468-66.434-31.468-105.336 0-106.040 85.962-192 192-192s192 85.96 192 192c0 38.902-11.582 75.094-31.466 105.34 34.838-10.096 68.744-23.52 101.082-40.042 63.022-32.198 120.218-76.408 167.638-129.298-47.42-52.886-104.618-97.1-167.638-129.296zM860.918 716.278c-108.72 55.554-226.112 83.722-348.918 83.722s-240.198-28.168-348.918-83.722c-58.772-30.032-113.732-67.904-163.082-112.076v-109.206c55.338 58.566 120.694 107.754 192.194 144.29 99.62 50.904 207.218 76.714 319.806 76.714s220.186-25.81 319.804-76.716c71.502-36.536 136.858-85.724 192.196-144.29v109.206c-49.35 44.174-104.308 82.046-163.082 112.078z" />
+<glyph unicode="&#xe01a;" d="M322.018 128l57.6 192h264.764l57.6-192h113.632l-191.996 640h-223.236l-192-640h113.636zM475.618 640h72.764l57.6-192h-187.964l57.6 192z" />
+<glyph unicode="&#xe01b;" d="M0 896v-896h1024v896h-1024zM384 320v192h256v-192h-256zM640 256v-192h-256v192h256zM640 768v-192h-256v192h256zM320 768v-192h-256v192h256zM64 512h256v-192h-256v192zM704 512h256v-192h-256v192zM704 576v192h256v-192h-256zM64 256h256v-192h-256v192zM704 64v192h256v-192h-256z" />
+<glyph unicode="&#xe01c;" d="M0 512h1024v-128h-1024z" />
+<glyph unicode="&#xe01d;" d="M0 64h576v-128h-576zM192 960h704v-128h-704zM277.388 128l204.688 784.164 123.85-32.328-196.25-751.836zM929.774-64l-129.774 129.774-129.774-129.774-62.226 62.226 129.774 129.774-129.774 129.774 62.226 62.226 129.774-129.774 129.774 129.774 62.226-62.226-129.774-129.774 129.774-129.774z" />
+<glyph unicode="&#xe01e;" d="M768 50v-50h128v-64h-192v146l128 60v50h-128v64h192v-146zM676 704h-136l-188-188-188 188h-136l256-256-256-256h136l188 188 188-188h136l-256 256z" />
+<glyph unicode="&#xe01f;" d="M768 754v-50h128v-64h-192v146l128 60v50h-128v64h192v-146zM676 704h-136l-188-188-188 188h-136l256-256-256-256h136l188 188 188-188h136l-256 256z" />
+<glyph unicode="&#xe020;" d="M704 64h256l64 128v-256h-384v214.214c131.112 56.484 224 197.162 224 361.786 0 214.432-157.598 382.266-352 382.266-194.406 0-352-167.832-352-382.266 0-164.624 92.886-305.302 224-361.786v-214.214h-384v256l64-128h256v32.59c-187.63 66.46-320 227.402-320 415.41 0 247.424 229.23 448 512 448s512-200.576 512-448c0-188.008-132.37-348.95-320-415.41v-32.59z" />
+<glyph unicode="&#xe021;" d="M512 960c-282.77 0-512-229.228-512-512 0-282.77 229.228-512 512-512 282.77 0 512 229.23 512 512 0 282.772-229.23 512-512 512zM512 16c-238.586 0-432 193.412-432 432 0 238.586 193.414 432 432 432 238.59 0 432-193.414 432-432 0-238.588-193.41-432-432-432zM384 640c0-35.346-28.654-64-64-64s-64 28.654-64 64 28.654 64 64 64 64-28.654 64-64zM768 640c0-35.346-28.652-64-64-64s-64 28.654-64 64 28.652 64 64 64 64-28.654 64-64zM512 308c141.074 0 262.688 57.532 318.462 123.192-20.872-171.22-156.288-303.192-318.462-303.192-162.118 0-297.498 132.026-318.444 303.168 55.786-65.646 177.386-123.168 318.444-123.168z" />
+<glyph unicode="&#xe022;" d="M256 896h512v-128h-512zM960 704h-896c-35.2 0-64-28.8-64-64v-320c0-35.2 28.796-64 64-64h192v-256h512v256h192c35.2 0 64 28.8 64 64v320c0 35.2-28.8 64-64 64zM704 64h-384v320h384v-320zM974.4 608c0-25.626-20.774-46.4-46.398-46.4-25.626 0-46.402 20.774-46.402 46.4s20.776 46.4 46.402 46.4c25.626 0 46.398-20.774 46.398-46.4z" />
+<glyph unicode="&#xe023;" d="M1024 960v-384l-138.26 138.26-212-212-107.48 107.48 212 212-138.26 138.26zM245.74 821.74l212-212-107.48-107.48-212 212-138.26-138.26v384h384zM885.74 181.74l138.26 138.26v-384h-384l138.26 138.26-212 212 107.48 107.48zM457.74 286.26l-212-212 138.26-138.26h-384v384l138.26-138.26 212 212z" />
+<glyph unicode="&#xe024;" d="M128 704h128v-192h64v384c0 35.2-28.8 64-64 64h-128c-35.2 0-64-28.8-64-64v-384h64v192zM128 896h128v-128h-128v128zM960 896v64h-192c-35.202 0-64-28.8-64-64v-320c0-35.2 28.798-64 64-64h192v64h-192v320h192zM640 800v96c0 35.2-28.8 64-64 64h-192v-448h192c35.2 0 64 28.8 64 64v96c0 35.2-8.8 64-44 64 35.2 0 44 28.8 44 64zM576 576h-128v128h128v-128zM576 768h-128v128h128v-128zM832 384l-416-448-224 288 82 70 142-148 352 302z" />
+<glyph unicode="&#xe025;" d="M448 384h-192v128h192v192h128v-192h192v-128h-192v-192h-128zM1024 320v-384h-1024v384h128v-256h768v256z" />
+<glyph unicode="&#xe026;" d="M384 768h128v-64h-128zM576 768h128v-64h-128zM896 768v-256h-192v64h128v128h-64v64zM320 576h128v-64h-128zM512 576h128v-64h-128zM192 704v-128h64v-64h-128v256h192v-64zM384 384h128v-64h-128zM576 384h128v-64h-128zM896 384v-256h-192v64h128v128h-64v64zM320 192h128v-64h-128zM512 192h128v-64h-128zM192 320v-128h64v-64h-128v256h192v-64zM960 896h-896v-896h896v896zM1024 960v0-1024h-1024v1024h1024z" />
+<glyph unicode="&#xe027;" d="M0 448h128v-64h-128zM192 448h192v-64h-192zM448 448h128v-64h-128zM640 448h192v-64h-192zM896 448h128v-64h-128zM880 960l16-448h-768l16 448h32l16-384h640l16 384zM144-64l-16 384h768l-16-384h-32l-16 320h-640l-16-320z" />
+<glyph unicode="&#xe028;" d="M576 896c247.424 0 448-200.576 448-448s-200.576-448-448-448v96c94.024 0 182.418 36.614 248.902 103.098s103.098 154.878 103.098 248.902c0 94.022-36.614 182.418-103.098 248.902s-154.878 103.098-248.902 103.098c-94.022 0-182.418-36.614-248.902-103.098-51.14-51.138-84.582-115.246-97.306-184.902h186.208l-224-256-224 256h164.57c31.060 217.102 217.738 384 443.43 384zM768 512v-128h-256v320h128v-192z" />
+<glyph unicode="&#xe02a;" d="M707.88 475.348c37.498 44.542 60.12 102.008 60.12 164.652 0 141.16-114.842 256-256 256h-320v-896h384c141.158 0 256 114.842 256 256 0 92.956-49.798 174.496-124.12 219.348zM384 768h101.5c55.968 0 101.5-57.42 101.5-128s-45.532-128-101.5-128h-101.5v256zM543 128h-159v256h159c58.45 0 106-57.42 106-128s-47.55-128-106-128z" />
+<glyph unicode="&#xe02b;" d="M896 896v-64h-128l-320-768h128v-64h-448v64h128l320 768h-128v64z" />
+<glyph unicode="&#xe02c;" d="M704 896h128v-416c0-159.058-143.268-288-320-288-176.73 0-320 128.942-320 288v416h128v-416c0-40.166 18.238-78.704 51.354-108.506 36.896-33.204 86.846-51.494 140.646-51.494s103.75 18.29 140.646 51.494c33.116 29.802 51.354 68.34 51.354 108.506v416zM192 128h640v-128h-640z" />
+<glyph unicode="&#xe02d;" d="M731.42 442.964c63.92-47.938 100.58-116.086 100.58-186.964s-36.66-139.026-100.58-186.964c-59.358-44.518-137.284-69.036-219.42-69.036-82.138 0-160.062 24.518-219.42 69.036-63.92 47.938-100.58 116.086-100.58 186.964h128c0-69.382 87.926-128 192-128s192 58.618 192 128c0 69.382-87.926 128-192 128-82.138 0-160.062 24.518-219.42 69.036-63.92 47.94-100.58 116.086-100.58 186.964s36.66 139.024 100.58 186.964c59.358 44.518 137.282 69.036 219.42 69.036 82.136 0 160.062-24.518 219.42-69.036 63.92-47.94 100.58-116.086 100.58-186.964h-128c0 69.382-87.926 128-192 128s-192-58.618-192-128c0-69.382 87.926-128 192-128 82.136 0 160.062-24.518 219.42-69.036zM0 448h1024v-64h-1024z" />
+<glyph unicode="&#xe02e;" d="M384 896h512v-128h-128v-768h-128v768h-128v-768h-128v448c-123.712 0-224 100.288-224 224s100.288 224 224 224z" />
+<glyph unicode="&#xe02f;" d="M448 896h512v-128h-128v-768h-128v768h-128v-768h-128v448c-123.712 0-224 100.288-224 224s100.288 224 224 224zM64 512l256-224-256-224z" />
+<glyph unicode="&#xe030;" d="M256 896h512v-128h-128v-768h-128v768h-128v-768h-128v448c-123.712 0-224 100.288-224 224s100.288 224 224 224zM960 64l-256 224 256 224z" />
+<glyph unicode="&#xe031;" d="M832 704h-192v64l-192 192h-448v-768h384v-256h640v576l-192 192zM832 613.49l101.49-101.49h-101.49v101.49zM448 869.49l101.49-101.49h-101.49v101.49zM64 896h320v-192h192v-448h-512v640zM960 0h-512v192h192v448h128v-192h192v-448z" />
+<glyph unicode="&#xe032;" d="M768 704h64v-64h-64zM640 576h64v-64h-64zM640 448h64v-64h-64zM640 320h64v-64h-64zM512 448h64v-64h-64zM512 320h64v-64h-64zM384 320h64v-64h-64zM768 576h64v-64h-64zM768 448h64v-64h-64zM768 320h64v-64h-64zM768 192h64v-64h-64zM640 192h64v-64h-64zM512 192h64v-64h-64zM384 192h64v-64h-64zM256 192h64v-64h-64z" />
+<glyph unicode="&#xe033;" d="M128 416l288-288 480 480-128 128-352-352-160 160z" />
+<glyph unicode="&#xe034;" d="M928 832h-416l-32 64h-352l-64-128h896zM904.34 256h74.86l44.8 448h-1024l64-640h484.080c-104.882 37.776-180.080 138.266-180.080 256 0 149.982 122.018 272 272 272 149.98 0 272-122.018 272-272 0-21.678-2.622-43.15-7.66-64zM1002.996 46.25l-198.496 174.692c17.454 28.92 27.5 62.814 27.5 99.058 0 106.040-85.96 192-192 192s-192-85.96-192-192 85.96-192 192-192c36.244 0 70.138 10.046 99.058 27.5l174.692-198.496c22.962-26.678 62.118-28.14 87.006-3.252l5.492 5.492c24.888 24.888 23.426 64.044-3.252 87.006zM640 196c-68.484 0-124 55.516-124 124s55.516 124 124 124 124-55.516 124-124-55.516-124-124-124z" />
+<glyph unicode="&#xe035;" d="M512 448v-128h32l32 64h64v-256h-48v-64h224v64h-48v256h64l32-64h32v128zM832 640v160c0 17.6-14.4 32-32 32h-224v64c0 35.2-28.8 64-64 64h-128c-35.204 0-64-28.8-64-64v-64h-224c-17.602 0-32-14.4-32-32v-640c0-17.6 14.398-32 32-32h288v-192h640v704h-192zM384 895.886c0.034 0.038 0.072 0.078 0.114 0.114h127.768c0.042-0.036 0.082-0.076 0.118-0.114v-63.886h-128v63.886zM192 704v64h512v-64h-512zM960 0h-512v576h512v-576z" />
+</font></defs></svg>
\ No newline at end of file
Binary file src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/fonts/tinymce.ttf has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/fonts/tinymce.woff has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/img/anchor.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/img/loader.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/img/object.gif has changed
Binary file src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/img/trans.gif has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/skin.ie7.min.css	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+.mce-container,.mce-container *,.mce-widget,.mce-widget *,.mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:#333;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;font-weight:normal;text-align:left;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-widget button{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.mce-container *[unselectable]{-moz-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none}.mce-fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.mce-fade.mce-in{opacity:1}.mce-tinymce{visibility:inherit !important;position:relative}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;height:100%;z-index:100}div.mce-fullscreen{position:fixed;top:0;left:0;width:100%;height:auto}.mce-tinymce{display:block;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.mce-wordcount{position:absolute;top:0;right:0;padding:8px}div.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 #9e9e9e;width:20px;height:20px;line-height:20px;text-align:center;vertical-align:middle;padding:2px}.mce-charmap td div{text-align:center}.mce-charmap td:hover{background:#d9d9d9}.mce-grid td.mce-grid-cell div{border:1px solid #d6d6d6;width:15px;height:15px;margin:0px;cursor:pointer}.mce-grid td.mce-grid-cell div:focus{border-color:#a1a1a1}.mce-grid td.mce-grid-cell div[disabled]{cursor:not-allowed}.mce-grid{border-spacing:2px;border-collapse:separate}.mce-grid a{display:block;border:1px solid transparent}.mce-grid a:hover,.mce-grid a:focus{border-color:#a1a1a1}.mce-grid-border{margin:0 4px 0 4px}.mce-grid-border a{border-color:#d6d6d6;width:13px;height:13px}.mce-grid-border a:hover,.mce-grid-border a.mce-active{border-color:#a1a1a1;background:#c8def4}.mce-text-center{text-align:center}div.mce-tinymce-inline{width:100%;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-colorbtn-trans div{text-align:center;vertical-align:middle;font-weight:bold;font-size:20px;line-height:16px;color:#707070}.mce-toolbar-grp{padding-bottom:2px}.mce-toolbar-grp .mce-flow-layout-item{margin-bottom:0}.mce-rtl .mce-wordcount{left:0;right:auto}.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: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-fixed{position:fixed}.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{filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;-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);top:0;left:0;background:#fff;border:1px solid #9e9e9e;border:1px solid rgba(0,0,0,0.25)}.mce-floatpanel.mce-popover.mce-bottom{margin-top:10px;*margin-top:0}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#9e9e9e;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 #c5c5c5;position:relative}.mce-window-head .mce-close{position:absolute;right:15px;top:9px;font-size:20px;font-weight:bold;line-height:20px;color:#858585;cursor:pointer;height:20px;overflow:hidden}.mce-close:hover{color:#adadad}.mce-window-head .mce-title{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:#fff;border-top:1px solid #c5c5c5;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.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-rtl .mce-window-head .mce-close{position:absolute;right:auto;left:15px}.mce-rtl .mce-window-head .mce-dragh{left:auto;right:0}.mce-rtl .mce-window-head .mce-title{direction:rtl;text-align:right}.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 #000000;-moz-box-shadow:0 0 5px #000000;box-shadow:0 0 5px #000000}.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-nw,.mce-tooltip-sw{margin-left:-14px}.mce-tooltip-n .mce-tooltip-arrow{top:0px;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-nw .mce-tooltip-arrow{top:0;left:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-ne .mce-tooltip-arrow{top:0;right:10px;border-bottom-style:solid;border-top:none;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:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-sw .mce-tooltip-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-se .mce-tooltip-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:none;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:none;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 #b1b1b1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25) rgba(0,0,0,0.25);position:relative;text-shadow:0 1px 1px rgba(255,255,255,0.75);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);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}.mce-btn:hover,.mce-btn:focus{color:#333;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}.mce-btn.mce-disabled button,.mce-btn.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-btn.mce-active,.mce-btn.mce-active:hover{background-color:#d6d6d6;background-image:-moz-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#c0c0c0));background-image:-webkit-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-o-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:linear-gradient(to bottom, #e6e6e6, #c0c0c0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0);zoom:1;-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:active{background-color:#d6d6d6;background-image:-moz-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#c0c0c0));background-image:-webkit-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-o-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:linear-gradient(to bottom, #e6e6e6, #c0c0c0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0);zoom:1;-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;text-align:center;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{min-width:50px;color:#fff;border:1px solid #b1b1b1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25) rgba(0,0,0,0.25);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}.mce-primary:hover,.mce-primary:focus{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}.mce-primary.mce-disabled button,.mce-primary.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-primary.mce-active,.mce-primary.mce-active:hover,.mce-primary:not(.mce-disabled):active{background-color:#005299;background-image:-moz-linear-gradient(top, #069, #039);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#069), to(#039));background-image:-webkit-linear-gradient(top, #069, #039);background-image:-o-linear-gradient(top, #069, #039);background-image:linear-gradient(to bottom, #069, #039);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff006699', endColorstr='#ff003399', GradientType=0);zoom:1;-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-primary button,.mce-primary button i{color:#fff;text-shadow:1px 1px #333}.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:1px 5px;font-size:12px;*padding-bottom:2px}.mce-btn-small i{line-height:20px;vertical-align:top;*line-height:18px}.mce-btn .mce-caret{margin-top:8px;margin-left:0}.mce-btn-small .mce-caret{margin-top:8px;margin-left:0}.mce-caret{display:inline-block;*display:inline;*zoom:1;width:0;height:0;vertical-align:top;border-top:4px solid #333;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.mce-disabled .mce-caret{border-top-color:#aaa}.mce-caret.mce-up{border-bottom:4px solid #333;border-top:0}.mce-btn-flat{border:0;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-btn-flat:hover,.mce-btn-flat.mce-active,.mce-btn-flat:focus,.mce-btn-flat:active{border:0;background:#e6e6e6;filter:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-rtl .mce-btn button{direction:rtl}.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-first{border-left:1px solid #b1b1b1;border-left:1px solid rgba(0,0,0,0.25);-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 #b1b1b1;border-right:1px solid rgba(0,0,0,0.1);-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, #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;text-indent:-10em;*font-size:0;*line-height:0;*text-indent:0;overflow:hidden}.mce-checked i.mce-i-checkbox{color:#333;font-size:16px;line-height:16px;text-indent:0}.mce-checkbox:focus i.mce-i-checkbox,.mce-checkbox.mce-focus i.mce-i-checkbox{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.65);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65)}.mce-checkbox.mce-disabled .mce-label,.mce-checkbox.mce-disabled i.mce-i-checkbox{color:#acacac}.mce-rtl .mce-checkbox{direction:rtl;text-align:right}.mce-rtl i.mce-i-checkbox{margin:0 0 0 3px}.mce-combobox{display:inline-block;*display:inline;*zoom:1;-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);*height:32px}.mce-combobox input{border:1px solid #c5c5c5;border-right-color:#c5c5c5;height:28px}.mce-combobox.mce-disabled input{color:#adadad}.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.mce-disabled .mce-btn button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-colorbox i{border:1px solid #c5c5c5;width:14px;height:14px}.mce-colorbutton .mce-ico{position:relative}.mce-colorbutton-grid{margin:4px}.mce-colorbutton button{padding-right:4px}.mce-colorbutton .mce-preview{padding-right:3px;display:block;position:absolute;left:50%;top:50%;margin-left:-14px;margin-top:7px;background:gray;width:13px;height:2px;overflow:hidden}.mce-colorbutton.mce-btn-small .mce-preview{margin-left:-16px;padding-right:0;width:16px}.mce-colorbutton .mce-open{padding-left:4px;border-left:1px solid transparent;border-right:1px solid transparent}.mce-colorbutton:hover .mce-open{border-left-color:#bdbdbd;border-right-color:#bdbdbd}.mce-colorbutton.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-colorbutton{direction:rtl}.mce-rtl .mce-colorbutton .mce-preview{margin-left:0;padding-right:0;padding-left:4px;margin-right:-14px}.mce-rtl .mce-colorbutton.mce-btn-small .mce-preview{margin-left:0;padding-right:0;margin-right:-17px;padding-left:0}.mce-rtl .mce-colorbutton button{padding-right:10px;padding-left:10px}.mce-rtl .mce-colorbutton .mce-open{padding-left:4px;padding-right:4px}.mce-colorpicker{position:relative;width:250px;height:220px}.mce-colorpicker-sv{position:absolute;top:0;left:0;width:90%;height:100%;border:1px solid #c5c5c5;cursor:crosshair;overflow:hidden}.mce-colorpicker-h-chunk{width:100%}.mce-colorpicker-overlay1,.mce-colorpicker-overlay2{width:100%;height:100%;position:absolute;top:0;left:0}.mce-colorpicker-overlay1{filter:progid:DXImageTransform.Microsoft.gradient(GradientType=1, startColorstr='#ffffff', endColorstr='#00ffffff');-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff')";background:linear-gradient(to right, #fff, rgba(255,255,255,0))}.mce-colorpicker-overlay2{filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#00000000', endColorstr='#000000');-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00000000', endColorstr='#000000')";background:linear-gradient(to bottom, rgba(0,0,0,0), #000)}.mce-colorpicker-selector1{background:none;position:absolute;width:12px;height:12px;margin:-8px 0 0 -8px;border:1px solid black;border-radius:50%}.mce-colorpicker-selector2{position:absolute;width:10px;height:10px;border:1px solid white;border-radius:50%}.mce-colorpicker-h{position:absolute;top:0;right:0;width:6.5%;height:100%;border:1px solid #c5c5c5;cursor:crosshair}.mce-colorpicker-h-marker{margin-top:-4px;position:absolute;top:0;left:-1px;width:100%;border:1px solid #333;background:#fff;height:4px;z-index:100}.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:#333}.mce-path-item:hover{text-decoration:underline}.mce-path-item:focus{background:#666;color:#fff}.mce-path .mce-divider{display:inline}.mce-disabled .mce-path-item{color:#aaa}.mce-rtl .mce-path{direction:rtl}.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-tinymce-inline .mce-flow-layout{white-space:nowrap}.mce-rtl .mce-flow-layout{text-align:right;direction:rtl}.mce-rtl .mce-flow-layout-item{margin:2px 2px 2px 0}.mce-rtl .mce-flow-layout-item.mce-last{margin-left:2px}.mce-iframe{border:0 solid #9e9e9e;width:100%;height:100%}.mce-label{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 1px rgba(255,255,255,0.75);overflow:hidden}.mce-label.mce-autoscroll{overflow:auto}.mce-label.mce-disabled{color:#aaa}.mce-label.mce-multiline{white-space:pre-wrap}.mce-label.mce-error{color:#a00}.mce-rtl .mce-label{text-align:right;direction:rtl}.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 #c4c4c4}.mce-menubar .mce-menubtn button span{color:#333}.mce-menubar .mce-caret{border-top-color:#333}.mce-menubar .mce-menubtn:hover,.mce-menubar .mce-menubtn.mce-active,.mce-menubar .mce-menubtn:focus{border-color:transparent;background:#e6e6e6;filter:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-menubtn span{color:#333;margin-right:2px;line-height:20px;*line-height:16px}.mce-menubtn.mce-btn-small span{font-size:12px}.mce-menubtn.mce-fixed-width span{display:inline-block;overflow-x:hidden;text-overflow:ellipsis;width:90px}.mce-menubtn.mce-fixed-width.mce-btn-small span{width:70px}.mce-menubtn .mce-caret{*margin-top:6px}.mce-rtl .mce-menubtn button{direction:rtl;text-align:right}.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-rtl .mce-listbox .mce-caret{right:auto;left:8px}.mce-rtl .mce-listbox button{padding-right:10px;padding-left:20px}.mce-menu-item{display:block;padding:6px 15px 6px 12px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap;cursor:pointer;line-height:normal;border-left:4px solid transparent;margin-bottom:1px}.mce-menu-item .mce-ico,.mce-menu-item .mce-text{color:#333}.mce-menu-item.mce-disabled .mce-text,.mce-menu-item.mce-disabled .mce-ico{color:#adadad}.mce-menu-item:hover .mce-text,.mce-menu-item.mce-selected .mce-text,.mce-menu-item:focus .mce-text{color:#fff}.mce-menu-item:hover .mce-ico,.mce-menu-item.mce-selected .mce-ico,.mce-menu-item:focus .mce-ico{color:#fff}.mce-menu-item.mce-disabled:hover{background:#ccc}.mce-menu-shortcut{display:inline-block;color:#adadad}.mce-menu-shortcut{display:inline-block;*display:inline;*zoom:1;padding:0 15px 0 20px}.mce-menu-item:hover .mce-menu-shortcut,.mce-menu-item.mce-selected .mce-menu-shortcut,.mce-menu-item:focus .mce-menu-shortcut{color:#fff}.mce-menu-item .mce-caret{margin-top:4px;*margin-top:3px;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid #333}.mce-menu-item.mce-selected .mce-caret,.mce-menu-item:focus .mce-caret,.mce-menu-item:hover .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.mce-active i{visibility:visible}.mce-menu-item-normal.mce-active{background-color:#c8def4}.mce-menu-item-preview.mce-active{border-left:5px solid #aaa}.mce-menu-item-normal.mce-active .mce-text{color:#333}.mce-menu-item-normal.mce-active:hover .mce-text,.mce-menu-item-normal.mce-active:hover .mce-ico{color:#fff}.mce-menu-item-normal.mce-active:focus .mce-text,.mce-menu-item-normal.mce-active:focus .mce-ico{color:#fff}.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}div.mce-menu .mce-menu-item-sep,.mce-menu-item-sep:hover{border:0;padding:0;height:1px;margin:9px 1px;overflow:hidden;background:#cbcbcb;border-bottom:1px solid #fff;cursor:default;filter:none}.mce-menu.mce-rtl{direction:rtl}.mce-rtl .mce-menu-item{text-align:right;direction:rtl;padding:6px 12px 6px 15px}.mce-menu-align.mce-rtl .mce-menu-shortcut,.mce-menu-align.mce-rtl .mce-caret{right:auto;left:0}.mce-rtl .mce-menu-item .mce-caret{margin-left:6px;margin-right:0;border-right:4px solid #333;border-left:0}.mce-rtl .mce-menu-item.mce-selected .mce-caret,.mce-rtl .mce-menu-item:focus .mce-caret,.mce-rtl .mce-menu-item:hover .mce-caret{border-left-color:transparent;border-right-color:#fff}.mce-menu{position:absolute;left:0;top:0;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 #989898;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);max-height:400px;overflow:auto;overflow-x:hidden}.mce-menu i{display:none}.mce-menu-has-icons i{display:inline-block;*display:inline}.mce-menu-sub-tr-tl{margin:-6px 0 0 -1px}.mce-menu-sub-br-bl{margin:6px 0 0 -1px}.mce-menu-sub-tl-tr{margin:-6px 0 0 1px}.mce-menu-sub-bl-br{margin:6px 0 0 1px}.mce-container-body .mce-resizehandle{position:absolute;right:0;bottom:0;width:16px;height:16px;visibility:visible;cursor:s-resize;margin:0}.mce-container-body .mce-resizehandle-both{cursor:se-resize}i.mce-i-resize{color:#333}.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:#bdbdbd;border-right-color:#bdbdbd}.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-splitbtn.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-splitbtn{direction:rtl;text-align:right}.mce-rtl .mce-splitbtn button{padding-right:10px;padding-left:10px}.mce-rtl .mce-splitbtn .mce-open{padding-left:4px;padding-right:4px}.mce-stack-layout-item{display:block}.mce-tabs{display:block;border-bottom:1px solid #c5c5c5}.mce-tab{display:inline-block;*display:inline;*zoom:1;border:1px solid #c5c5c5;border-width:0 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-rtl .mce-tabs{text-align:right;direction:rtl}.mce-rtl .mce-tab{border-width:0 0 0 1px}.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:pre-wrap;*white-space:pre;color:#333}.mce-textbox:focus,.mce-textbox.mce-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.65);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65)}.mce-placeholder .mce-textbox{color:#aaa}.mce-textbox.mce-multiline{padding:4px}.mce-textbox.mce-disabled{color:#adadad}.mce-rtl .mce-textbox{text-align:right;direction:rtl}.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}.mce-throbber-inline{position:static;height:50px}@font-face{font-family:'tinymce';src:url('fonts/tinymce.eot');src:url('fonts/tinymce.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce.woff') format('woff'),url('fonts/tinymce.ttf') format('truetype'),url('fonts/tinymce.svg#tinymce') format('svg');font-weight:normal;font-style:normal}@font-face{font-family:'tinymce-small';src:url('fonts/tinymce-small.eot');src:url('fonts/tinymce-small.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce-small.woff') format('woff'),url('fonts/tinymce-small.ttf') format('truetype'),url('fonts/tinymce-small.svg#tinymce') format('svg');font-weight:normal;font-style:normal}.mce-ico{font-family:'tinymce';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-btn-small .mce-ico{font-family:'tinymce-small'}.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-insertdatetime{-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-pastetext{-ie7-icon:"\e035"}.mce-i-checkbox,.mce-i-selected{-ie7-icon:"\e033"}.mce-i-selected{visibility:hidden}.mce-i-backcolor{background:#BBB}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/skins/lightgray/skin.min.css	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+.mce-container,.mce-container *,.mce-widget,.mce-widget *,.mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:0 0;text-decoration:none;color:#333;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;font-weight:400;text-align:left;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-widget button{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.mce-container [unselectable]{-moz-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none}.mce-fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.mce-fade.mce-in{opacity:1}.mce-tinymce{visibility:inherit!important;position:relative}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;height:100%;z-index:100}div.mce-fullscreen{position:fixed;top:0;left:0;width:100%;height:auto}.mce-tinymce{display:block;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.mce-wordcount{position:absolute;top:0;right:0;padding:8px}div.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 #9e9e9e;width:20px;height:20px;line-height:20px;text-align:center;vertical-align:middle;padding:2px}.mce-charmap td div{text-align:center}.mce-charmap td:hover{background:#d9d9d9}.mce-grid td.mce-grid-cell div{border:1px solid #d6d6d6;width:15px;height:15px;margin:0;cursor:pointer}.mce-grid td.mce-grid-cell div:focus{border-color:#a1a1a1}.mce-grid td.mce-grid-cell div[disabled]{cursor:not-allowed}.mce-grid{border-spacing:2px;border-collapse:separate}.mce-grid a{display:block;border:1px solid transparent}.mce-grid a:hover,.mce-grid a:focus{border-color:#a1a1a1}.mce-grid-border{margin:0 4px 0 4px}.mce-grid-border a{border-color:#d6d6d6;width:13px;height:13px}.mce-grid-border a:hover,.mce-grid-border a.mce-active{border-color:#a1a1a1;background:#c8def4}.mce-text-center{text-align:center}div.mce-tinymce-inline{width:100%;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-colorbtn-trans div{text-align:center;vertical-align:middle;font-weight:700;font-size:20px;line-height:16px;color:#707070}.mce-toolbar-grp{padding-bottom:2px}.mce-toolbar-grp .mce-flow-layout-item{margin-bottom:0}.mce-rtl .mce-wordcount{left:0;right:auto}.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,.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:0 5px 10px rgba(0,0,0,.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2)}.mce-floatpanel.mce-fixed{position:fixed}.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{filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background:0 0;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);top:0;left:0;background:#fff;border:1px solid #9e9e9e;border:1px solid rgba(0,0,0,.25)}.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:#9e9e9e;border-bottom-color:rgba(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,.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,.3);box-shadow:0 3px 7px rgba(0,0,0,.3);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background:0 0;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 #c5c5c5;position:relative}.mce-window-head .mce-close{position:absolute;right:15px;top:9px;font-size:20px;font-weight:700;line-height:20px;color:#858585;cursor:pointer;height:20px;overflow:hidden}.mce-close:hover{color:#adadad}.mce-window-head .mce-title{line-height:20px;font-size:20px;font-weight:700;text-rendering:optimizelegibility;padding-right:10px}.mce-window .mce-container-body{display:block}.mce-foot{display:block;background-color:#fff;border-top:1px solid #c5c5c5;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.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-rtl .mce-window-head .mce-close{position:absolute;right:auto;left:15px}.mce-rtl .mce-window-head .mce-dragh{left:auto;right:0}.mce-rtl .mce-window-head .mce-title{direction:rtl;text-align:right}.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-nw,.mce-tooltip-sw{margin-left:-14px}.mce-tooltip-n .mce-tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-nw .mce-tooltip-arrow{top:0;left:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-ne .mce-tooltip-arrow{top:0;right:10px;border-bottom-style:solid;border-top:none;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:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-sw .mce-tooltip-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-se .mce-tooltip-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:none;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:none;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 #b1b1b1;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25) rgba(0,0,0,.25);position:relative;text-shadow:0 1px 1px rgba(255,255,255,.75);display:inline-block;;;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);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}.mce-btn:hover,.mce-btn:focus{color:#333;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}.mce-btn.mce-disabled button,.mce-btn.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-btn.mce-active,.mce-btn.mce-active:hover{background-color:#d6d6d6;background-image:-moz-linear-gradient(top,#e6e6e6,silver);background-image:-webkit-gradient(linear,0 0,0 100%,from(#e6e6e6),to(silver));background-image:-webkit-linear-gradient(top,#e6e6e6,silver);background-image:-o-linear-gradient(top,#e6e6e6,silver);background-image:linear-gradient(to bottom,#e6e6e6,silver);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05)}.mce-btn:active{background-color:#d6d6d6;background-image:-moz-linear-gradient(top,#e6e6e6,silver);background-image:-webkit-gradient(linear,0 0,0 100%,from(#e6e6e6),to(silver));background-image:-webkit-linear-gradient(top,#e6e6e6,silver);background-image:-o-linear-gradient(top,#e6e6e6,silver);background-image:linear-gradient(to bottom,#e6e6e6,silver);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05)}.mce-btn button{padding:4px 10px;font-size:14px;line-height:20px;;cursor:pointer;color:#333;text-align:center;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{min-width:50px;color:#fff;border:1px solid #b1b1b1;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25) rgba(0,0,0,.25);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}.mce-primary:hover,.mce-primary:focus{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}.mce-primary.mce-disabled button,.mce-primary.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-primary.mce-active,.mce-primary.mce-active:hover,.mce-primary:not(.mce-disabled):active{background-color:#005299;background-image:-moz-linear-gradient(top,#069,#039);background-image:-webkit-gradient(linear,0 0,0 100%,from(#069),to(#039));background-image:-webkit-linear-gradient(top,#069,#039);background-image:-o-linear-gradient(top,#069,#039);background-image:linear-gradient(to bottom,#069,#039);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff006699', endColorstr='#ff003399', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05)}.mce-primary button,.mce-primary button i{color:#fff;text-shadow:1px 1px #333}.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:1px 5px;font-size:12px;}.mce-btn-small i{line-height:20px;vertical-align:top;}.mce-btn .mce-caret{margin-top:8px;margin-left:0}.mce-btn-small .mce-caret{margin-top:8px;margin-left:0}.mce-caret{display:inline-block;;;width:0;height:0;vertical-align:top;border-top:4px solid #333;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.mce-disabled .mce-caret{border-top-color:#aaa}.mce-caret.mce-up{border-bottom:4px solid #333;border-top:0}.mce-btn-flat{border:0;background:0 0;-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-btn-flat:hover,.mce-btn-flat.mce-active,.mce-btn-flat:focus,.mce-btn-flat:active{border:0;background:#e6e6e6;filter:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-rtl .mce-btn button{direction:rtl}.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-first{border-left:1px solid #b1b1b1;border-left:1px solid rgba(0,0,0,.25);-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 #b1b1b1;border-right:1px solid rgba(0,0,0,.1);-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,.2),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);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;text-indent:-10em;;;;overflow:hidden}.mce-checked i.mce-i-checkbox{color:#333;font-size:16px;line-height:16px;text-indent:0}.mce-checkbox:focus i.mce-i-checkbox,.mce-checkbox.mce-focus i.mce-i-checkbox{border:1px solid rgba(82,168,236,.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.65);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.65);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.65)}.mce-checkbox.mce-disabled .mce-label,.mce-checkbox.mce-disabled i.mce-i-checkbox{color:#acacac}.mce-rtl .mce-checkbox{direction:rtl;text-align:right}.mce-rtl i.mce-i-checkbox{margin:0 0 0 3px}.mce-combobox{display:inline-block;;;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);}.mce-combobox input{border:1px solid #c5c5c5;border-right-color:#c5c5c5;height:28px}.mce-combobox.mce-disabled input{color:#adadad}.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.mce-disabled .mce-btn button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-colorbox i{border:1px solid #c5c5c5;width:14px;height:14px}.mce-colorbutton .mce-ico{position:relative}.mce-colorbutton-grid{margin:4px}.mce-colorbutton button{padding-right:4px}.mce-colorbutton .mce-preview{padding-right:3px;display:block;position:absolute;left:50%;top:50%;margin-left:-14px;margin-top:7px;background:gray;width:13px;height:2px;overflow:hidden}.mce-colorbutton.mce-btn-small .mce-preview{margin-left:-16px;padding-right:0;width:16px}.mce-colorbutton .mce-open{padding-left:4px;border-left:1px solid transparent;border-right:1px solid transparent}.mce-colorbutton:hover .mce-open{border-left-color:#bdbdbd;border-right-color:#bdbdbd}.mce-colorbutton.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-colorbutton{direction:rtl}.mce-rtl .mce-colorbutton .mce-preview{margin-left:0;padding-right:0;padding-left:4px;margin-right:-14px}.mce-rtl .mce-colorbutton.mce-btn-small .mce-preview{margin-left:0;padding-right:0;margin-right:-17px;padding-left:0}.mce-rtl .mce-colorbutton button{padding-right:10px;padding-left:10px}.mce-rtl .mce-colorbutton .mce-open{padding-left:4px;padding-right:4px}.mce-colorpicker{position:relative;width:250px;height:220px}.mce-colorpicker-sv{position:absolute;top:0;left:0;width:90%;height:100%;border:1px solid #c5c5c5;cursor:crosshair;overflow:hidden}.mce-colorpicker-h-chunk{width:100%}.mce-colorpicker-overlay1,.mce-colorpicker-overlay2{width:100%;height:100%;position:absolute;top:0;left:0}.mce-colorpicker-overlay1{filter:progid:DXImageTransform.Microsoft.gradient(GradientType=1, startColorstr='#ffffff', endColorstr='#00ffffff');-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff')";background:linear-gradient(to right,#fff,rgba(255,255,255,0))}.mce-colorpicker-overlay2{filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#00000000', endColorstr='#000000');-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00000000', endColorstr='#000000')";background:linear-gradient(to bottom,rgba(0,0,0,0),#000)}.mce-colorpicker-selector1{background:0 0;position:absolute;width:12px;height:12px;margin:-8px 0 0 -8px;border:1px solid #000;border-radius:50%}.mce-colorpicker-selector2{position:absolute;width:10px;height:10px;border:1px solid #fff;border-radius:50%}.mce-colorpicker-h{position:absolute;top:0;right:0;width:6.5%;height:100%;border:1px solid #c5c5c5;cursor:crosshair}.mce-colorpicker-h-marker{margin-top:-4px;position:absolute;top:0;left:-1px;width:100%;border:1px solid #333;background:#fff;height:4px;z-index:100}.mce-path{display:inline-block;;;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;;;cursor:pointer;color:#333}.mce-path-item:hover{text-decoration:underline}.mce-path-item:focus{background:#666;color:#fff}.mce-path .mce-divider{display:inline}.mce-disabled .mce-path-item{color:#aaa}.mce-rtl .mce-path{direction:rtl}.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;;}.mce-fit-layout-item{position:absolute}.mce-flow-layout-item{display:inline-block;;}.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-tinymce-inline .mce-flow-layout{white-space:nowrap}.mce-rtl .mce-flow-layout{text-align:right;direction:rtl}.mce-rtl .mce-flow-layout-item{margin:2px 2px 2px 0}.mce-rtl .mce-flow-layout-item.mce-last{margin-left:2px}.mce-iframe{border:0 solid #9e9e9e;width:100%;height:100%}.mce-label{display:inline-block;;;text-shadow:0 1px 1px rgba(255,255,255,.75);overflow:hidden}.mce-label.mce-autoscroll{overflow:auto}.mce-label.mce-disabled{color:#aaa}.mce-label.mce-multiline{white-space:pre-wrap}.mce-label.mce-error{color:#a00}.mce-rtl .mce-label{text-align:right;direction:rtl}.mce-menubar .mce-menubtn{border-color:transparent;background:0 0;-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 #c4c4c4}.mce-menubar .mce-menubtn button span{color:#333}.mce-menubar .mce-caret{border-top-color:#333}.mce-menubar .mce-menubtn:hover,.mce-menubar .mce-menubtn.mce-active,.mce-menubar .mce-menubtn:focus{border-color:transparent;background:#e6e6e6;filter:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-menubtn span{color:#333;margin-right:2px;line-height:20px;}.mce-menubtn.mce-btn-small span{font-size:12px}.mce-menubtn.mce-fixed-width span{display:inline-block;overflow-x:hidden;text-overflow:ellipsis;width:90px}.mce-menubtn.mce-fixed-width.mce-btn-small span{width:70px}.mce-rtl .mce-menubtn button{direction:rtl;text-align:right}.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-rtl .mce-listbox .mce-caret{right:auto;left:8px}.mce-rtl .mce-listbox button{padding-right:10px;padding-left:20px}.mce-menu-item{display:block;padding:6px 15px 6px 12px;clear:both;font-weight:400;line-height:20px;color:#333;white-space:nowrap;cursor:pointer;line-height:normal;border-left:4px solid transparent;margin-bottom:1px}.mce-menu-item .mce-ico,.mce-menu-item .mce-text{color:#333}.mce-menu-item.mce-disabled .mce-text,.mce-menu-item.mce-disabled .mce-ico{color:#adadad}.mce-menu-item:hover .mce-text,.mce-menu-item.mce-selected .mce-text,.mce-menu-item:focus .mce-text{color:#fff}.mce-menu-item:hover .mce-ico,.mce-menu-item.mce-selected .mce-ico,.mce-menu-item:focus .mce-ico{color:#fff}.mce-menu-item.mce-disabled:hover{background:#ccc}.mce-menu-shortcut{display:inline-block;color:#adadad}.mce-menu-shortcut{display:inline-block;;;padding:0 15px 0 20px}.mce-menu-item:hover .mce-menu-shortcut,.mce-menu-item.mce-selected .mce-menu-shortcut,.mce-menu-item:focus .mce-menu-shortcut{color:#fff}.mce-menu-item .mce-caret{margin-top:4px;;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid #333}.mce-menu-item.mce-selected .mce-caret,.mce-menu-item:focus .mce-caret,.mce-menu-item:hover .mce-caret{border-left-color:#fff}.mce-menu-align .mce-menu-shortcut,.mce-menu-align .mce-caret{position:absolute;right:0}.mce-menu-item.mce-active i{visibility:visible}.mce-menu-item-normal.mce-active{background-color:#c8def4}.mce-menu-item-preview.mce-active{border-left:5px solid #aaa}.mce-menu-item-normal.mce-active .mce-text{color:#333}.mce-menu-item-normal.mce-active:hover .mce-text,.mce-menu-item-normal.mce-active:hover .mce-ico{color:#fff}.mce-menu-item-normal.mce-active:focus .mce-text,.mce-menu-item-normal.mce-active:focus .mce-ico{color:#fff}.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}div.mce-menu .mce-menu-item-sep,.mce-menu-item-sep:hover{border:0;padding:0;height:1px;margin:9px 1px;overflow:hidden;background:#cbcbcb;border-bottom:1px solid #fff;cursor:default;filter:none}.mce-menu.mce-rtl{direction:rtl}.mce-rtl .mce-menu-item{text-align:right;direction:rtl;padding:6px 12px 6px 15px}.mce-menu-align.mce-rtl .mce-menu-shortcut,.mce-menu-align.mce-rtl .mce-caret{right:auto;left:0}.mce-rtl .mce-menu-item .mce-caret{margin-left:6px;margin-right:0;border-right:4px solid #333;border-left:0}.mce-rtl .mce-menu-item.mce-selected .mce-caret,.mce-rtl .mce-menu-item:focus .mce-caret,.mce-rtl .mce-menu-item:hover .mce-caret{border-left-color:transparent;border-right-color:#fff}.mce-menu{position:absolute;left:0;top:0;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background:0 0;z-index:1000;padding:5px 0 5px 0;margin:2px 0 0;min-width:160px;background:#fff;border:1px solid #989898;border:1px solid rgba(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,.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);max-height:400px;overflow:auto;overflow-x:hidden}.mce-menu i{display:none}.mce-menu-has-icons i{display:inline-block;}.mce-menu-sub-tr-tl{margin:-6px 0 0 -1px}.mce-menu-sub-br-bl{margin:6px 0 0 -1px}.mce-menu-sub-tl-tr{margin:-6px 0 0 1px}.mce-menu-sub-bl-br{margin:6px 0 0 1px}.mce-container-body .mce-resizehandle{position:absolute;right:0;bottom:0;width:16px;height:16px;visibility:visible;cursor:s-resize;margin:0}.mce-container-body .mce-resizehandle-both{cursor:se-resize}i.mce-i-resize{color:#333}.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:#bdbdbd;border-right-color:#bdbdbd}.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,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05)}.mce-splitbtn.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-splitbtn{direction:rtl;text-align:right}.mce-rtl .mce-splitbtn button{padding-right:10px;padding-left:10px}.mce-rtl .mce-splitbtn .mce-open{padding-left:4px;padding-right:4px}.mce-stack-layout-item{display:block}.mce-tabs{display:block;border-bottom:1px solid #c5c5c5}.mce-tab{display:inline-block;;;border:1px solid #c5c5c5;border-width:0 1px 0 0;background:#e3e3e3;padding:8px;text-shadow:0 1px 1px rgba(255,255,255,.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-rtl .mce-tabs{text-align:right;direction:rtl}.mce-rtl .mce-tab{border-width:0 0 0 1px}.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,.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(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:pre-wrap;;color:#333}.mce-textbox:focus,.mce-textbox.mce-focus{border-color:rgba(82,168,236,.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.65);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.65);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.65)}.mce-placeholder .mce-textbox{color:#aaa}.mce-textbox.mce-multiline{padding:4px}.mce-textbox.mce-disabled{color:#adadad}.mce-rtl .mce-textbox{text-align:right;direction:rtl}.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}.mce-throbber-inline{position:static;height:50px}@font-face{font-family:tinymce;src:url(fonts/tinymce.eot);src:url(fonts/tinymce.eot?#iefix) format('embedded-opentype'),url(fonts/tinymce.woff) format('woff'),url(fonts/tinymce.ttf) format('truetype'),url(fonts/tinymce.svg#tinymce) format('svg');font-weight:400;font-style:normal}@font-face{font-family:tinymce-small;src:url(fonts/tinymce-small.eot);src:url(fonts/tinymce-small.eot?#iefix) format('embedded-opentype'),url(fonts/tinymce-small.woff) format('woff'),url(fonts/tinymce-small.ttf) format('truetype'),url(fonts/tinymce-small.svg#tinymce) format('svg');font-weight:400;font-style:normal}.mce-ico{font-family:tinymce,Arial;font-style:normal;font-weight:400;font-variant:normal;font-size:16px;line-height:16px;speak:none;vertical-align:text-top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;background:transparent center center;background-size:cover;width:16px;height:16px;color:#333}.mce-btn-small .mce-ico{font-family:tinymce-small,Arial}.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-insertdatetime: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-visualblocks: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-pastetext:before{content:"\e035"}.mce-i-checkbox:before,.mce-i-selected:before{content:"\e033"}.mce-i-selected{visibility:hidden}i.mce-i-backcolor{text-shadow:none;background:#bbb}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/themes/modern/theme.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,1 @@
+tinymce.ThemeManager.add("modern",function(a){function b(){function b(b){var d,e=[];if(b)return l(b.split(/[ ,]/),function(b){function c(){var c=a.selection;"bullist"==f&&c.selectorChanged("ul > li",function(a,c){for(var d,e=c.parents.length;e--&&(d=c.parents[e].nodeName,"OL"!=d&&"UL"!=d););b.active(a&&"UL"==d)}),"numlist"==f&&c.selectorChanged("ol > li",function(a,c){for(var d,e=c.parents.length;e--&&(d=c.parents[e].nodeName,"OL"!=d&&"UL"!=d););b.active(a&&"OL"==d)}),b.settings.stateSelector&&c.selectorChanged(b.settings.stateSelector,function(a){b.active(a)},!0),b.settings.disabledStateSelector&&c.selectorChanged(b.settings.disabledStateSelector,function(a){b.disabled(a)})}var f;"|"==b?d=null:k.has(b)?(b={type:b},j.toolbar_items_size&&(b.size=j.toolbar_items_size),e.push(b),d=null):(d||(d={type:"buttongroup",items:[]},e.push(d)),a.buttons[b]&&(f=b,b=a.buttons[f],"function"==typeof b&&(b=b()),b.type=b.type||"button",j.toolbar_items_size&&(b.size=j.toolbar_items_size),b=k.create(b),d.items.push(b),a.initialized?c():a.on("init",c)))}),c.push({type:"toolbar",layout:"flow",items:e}),!0}var c=[];if(tinymce.isArray(j.toolbar)){if(0===j.toolbar.length)return;tinymce.each(j.toolbar,function(a,b){j["toolbar"+(b+1)]=a}),delete j.toolbar}for(var d=1;10>d&&b(j["toolbar"+d]);d++);return c.length||j.toolbar===!1||b(j.toolbar||o),c.length?{type:"panel",layout:"stack",classes:"toolbar-grp",ariaRoot:!0,ariaRemember:!0,items:c}:void 0}function c(){function b(b){var c;return"|"==b?{text:"|"}:c=a.menuItems[b]}function c(c){var d,e,f,g,h;if(h=tinymce.makeMap((j.removed_menuitems||"").split(/[ ,]/)),j.menu?(e=j.menu[c],g=!0):e=n[c],e){d={text:e.title},f=[],l((e.items||"").split(/[ ,]/),function(a){var c=b(a);c&&!h[a]&&f.push(b(a))}),g||l(a.menuItems,function(a){a.context==c&&("before"==a.separator&&f.push({text:"|"}),a.prependToContext?f.unshift(a):f.push(a),"after"==a.separator&&f.push({text:"|"}))});for(var i=0;i<f.length;i++)"|"==f[i].text&&(0===i||i==f.length-1)&&f.splice(i,1);if(d.menu=f,!d.menu.length)return null}return d}var d,e=[],f=[];if(j.menu)for(d in j.menu)f.push(d);else for(d in n)f.push(d);for(var g="string"==typeof j.menubar?j.menubar.split(/[ ,]/):f,h=0;h<g.length;h++){var i=g[h];i=c(i),i&&e.push(i)}return e}function d(b){function c(a){var c=b.find(a)[0];c&&c.focus(!0)}a.shortcuts.add("Alt+F9","",function(){c("menubar")}),a.shortcuts.add("Alt+F10","",function(){c("toolbar")}),a.shortcuts.add("Alt+F11","",function(){c("elementpath")}),b.on("cancel",function(){a.focus()})}function e(b,c){function d(a){return{width:a.clientWidth,height:a.clientHeight}}var e,f,g,h;e=a.getContainer(),f=a.getContentAreaContainer().firstChild,g=d(e),h=d(f),null!==b&&(b=Math.max(j.min_width||100,b),b=Math.min(j.max_width||65535,b),m.setStyle(e,"width",b+(g.width-h.width)),m.setStyle(f,"width",b)),c=Math.max(j.min_height||100,c),c=Math.min(j.max_height||65535,c),m.setStyle(f,"height",c),a.fire("ResizeEditor")}function f(b,c){var d=a.getContentAreaContainer();i.resizeTo(d.clientWidth+b,d.clientHeight+c)}function g(e){function f(){if(n&&n.moveRel&&n.visible()&&!n._fixed){var b=a.selection.getScrollContainer(),c=a.getBody(),d=0,e=0;if(b){var f=m.getPos(c),g=m.getPos(b);d=Math.max(0,g.x-f.x),e=Math.max(0,g.y-f.y)}n.fixed(!1).moveRel(c,a.rtl?["tr-br","br-tr"]:["tl-bl","bl-tl","tr-br"]).moveBy(d,e)}}function g(){n&&(n.show(),f(),m.addClass(a.getBody(),"mce-edit-focus"))}function h(){n&&(n.hide(),m.removeClass(a.getBody(),"mce-edit-focus"))}function l(){return n?void(n.visible()||g()):(n=i.panel=k.create({type:o?"panel":"floatpanel",role:"application",classes:"tinymce tinymce-inline",layout:"flex",direction:"column",align:"stretch",autohide:!1,autofix:!0,fixed:!!o,border:1,items:[j.menubar===!1?null:{type:"menubar",border:"0 0 1 0",items:c()},b()]}),a.fire("BeforeRenderUI"),n.renderTo(o||document.body).reflow(),d(n),g(),a.on("nodeChange",f),a.on("activate",g),a.on("deactivate",h),void a.nodeChanged())}var n,o;return j.fixed_toolbar_container&&(o=m.select(j.fixed_toolbar_container)[0]),j.content_editable=!0,a.on("focus",function(){e.skinUiCss?tinymce.DOM.styleSheetLoader.load(e.skinUiCss,l,l):l()}),a.on("blur hide",h),a.on("remove",function(){n&&(n.remove(),n=null)}),e.skinUiCss&&tinymce.DOM.styleSheetLoader.load(e.skinUiCss),{}}function h(f){var g,h,l;return f.skinUiCss&&tinymce.DOM.loadCSS(f.skinUiCss),g=i.panel=k.create({type:"panel",role:"application",classes:"tinymce",style:"visibility: hidden",layout:"stack",border:1,items:[j.menubar===!1?null:{type:"menubar",border:"0 0 1 0",items:c()},b(),{type:"panel",name:"iframe",layout:"stack",classes:"edit-area",html:"",border:"1 0 0 0"}]}),j.resize!==!1&&(h={type:"resizehandle",direction:j.resize,onResizeStart:function(){var b=a.getContentAreaContainer().firstChild;l={width:b.clientWidth,height:b.clientHeight}},onResize:function(a){"both"==j.resize?e(l.width+a.deltaX,l.height+a.deltaY):e(null,l.height+a.deltaY)}}),j.statusbar!==!1&&g.add({type:"panel",name:"statusbar",classes:"statusbar",layout:"flow",border:"1 0 0 0",ariaRoot:!0,items:[{type:"elementpath"},h]}),j.readonly&&g.find("*").disabled(!0),a.fire("BeforeRenderUI"),g.renderBefore(f.targetNode).reflow(),j.width&&tinymce.DOM.setStyle(g.getEl(),"width",j.width),a.on("remove",function(){g.remove(),g=null}),d(g),{iframeContainer:g.find("#iframe")[0].getEl(),editorContainer:g.getEl()}}var i=this,j=a.settings,k=tinymce.ui.Factory,l=tinymce.each,m=tinymce.DOM,n={file:{title:"File",items:"newdocument"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | 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"}},o="undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image";i.renderUI=function(b){var c=j.skin!==!1?j.skin||"lightgray":!1;if(c){var d=j.skin_url;d=d?a.documentBaseURI.toAbsolute(d):tinymce.baseURL+"/skins/"+c,tinymce.Env.documentMode<=7?b.skinUiCss=d+"/skin.ie7.min.css":b.skinUiCss=d+"/skin.min.css",a.contentCSS.push(d+"/content"+(a.inline?".inline":"")+".min.css")}return a.on("ProgressState",function(a){i.throbber=i.throbber||new tinymce.ui.Throbber(i.panel.getEl("body")),a.state?i.throbber.show(a.time):i.throbber.hide()}),j.inline?g(b):h(b)},i.resizeTo=e,i.resizeBy=f});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/tinymce.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,16 @@
+// 4.1.10 (2015-05-05)
+!function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;i<e.length;++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;i<r.length;++i){if(!n[r[i]])return;n=n[r[i]]}return n}function a(n){for(var r=0;r<n.length;r++){for(var i=e,o=n[r],a=o.split(/[.\/]/),l=0;l<a.length-1;++l)i[a[l]]===t&&(i[a[l]]={}),i=i[a[l]];i[a[a.length-1]]=s[o]}}var s={},l="tinymce/dom/EventUtils",c="tinymce/dom/Sizzle",u="tinymce/Env",d="tinymce/util/Tools",f="tinymce/dom/DomQuery",p="tinymce/html/Styles",h="tinymce/dom/TreeWalker",m="tinymce/dom/Range",g="tinymce/html/Entities",v="tinymce/dom/StyleSheetLoader",y="tinymce/dom/DOMUtils",b="tinymce/dom/ScriptLoader",C="tinymce/AddOnManager",x="tinymce/dom/RangeUtils",w="tinymce/NodeChange",_="tinymce/html/Node",E="tinymce/html/Schema",N="tinymce/html/SaxParser",k="tinymce/html/DomParser",S="tinymce/html/Writer",T="tinymce/html/Serializer",R="tinymce/dom/Serializer",A="tinymce/dom/TridentSelection",B="tinymce/util/VK",D="tinymce/dom/ControlSelection",M="tinymce/dom/BookmarkManager",H="tinymce/dom/Selection",L="tinymce/dom/ElementUtils",P="tinymce/fmt/Preview",O="tinymce/Formatter",I="tinymce/UndoManager",F="tinymce/EnterKey",z="tinymce/ForceBlocks",W="tinymce/EditorCommands",V="tinymce/util/URI",U="tinymce/util/Class",$="tinymce/util/EventDispatcher",q="tinymce/ui/Selector",j="tinymce/ui/Collection",K="tinymce/ui/DomUtils",Y="tinymce/ui/Control",G="tinymce/ui/Factory",X="tinymce/ui/KeyboardNavigation",J="tinymce/ui/Container",Q="tinymce/ui/DragHelper",Z="tinymce/ui/Scrollable",ee="tinymce/ui/Panel",te="tinymce/ui/Movable",ne="tinymce/ui/Resizable",re="tinymce/ui/FloatPanel",ie="tinymce/ui/Window",oe="tinymce/ui/MessageBox",ae="tinymce/WindowManager",se="tinymce/util/Quirks",le="tinymce/util/Observable",ce="tinymce/EditorObservable",ue="tinymce/Shortcuts",de="tinymce/Editor",fe="tinymce/util/I18n",pe="tinymce/FocusManager",he="tinymce/EditorManager",me="tinymce/LegacyInput",ge="tinymce/util/XHR",ve="tinymce/util/JSON",ye="tinymce/util/JSONRequest",be="tinymce/util/JSONP",Ce="tinymce/util/LocalStorage",xe="tinymce/Compat",we="tinymce/ui/Layout",_e="tinymce/ui/AbsoluteLayout",Ee="tinymce/ui/Tooltip",Ne="tinymce/ui/Widget",ke="tinymce/ui/Button",Se="tinymce/ui/ButtonGroup",Te="tinymce/ui/Checkbox",Re="tinymce/ui/ComboBox",Ae="tinymce/ui/ColorBox",Be="tinymce/ui/PanelButton",De="tinymce/ui/ColorButton",Me="tinymce/util/Color",He="tinymce/ui/ColorPicker",Le="tinymce/ui/Path",Pe="tinymce/ui/ElementPath",Oe="tinymce/ui/FormItem",Ie="tinymce/ui/Form",Fe="tinymce/ui/FieldSet",ze="tinymce/ui/FilePicker",We="tinymce/ui/FitLayout",Ve="tinymce/ui/FlexLayout",Ue="tinymce/ui/FlowLayout",$e="tinymce/ui/FormatControls",qe="tinymce/ui/GridLayout",je="tinymce/ui/Iframe",Ke="tinymce/ui/Label",Ye="tinymce/ui/Toolbar",Ge="tinymce/ui/MenuBar",Xe="tinymce/ui/MenuButton",Je="tinymce/ui/ListBox",Qe="tinymce/ui/MenuItem",Ze="tinymce/ui/Menu",et="tinymce/ui/Radio",tt="tinymce/ui/ResizeHandle",nt="tinymce/ui/Spacer",rt="tinymce/ui/SplitButton",it="tinymce/ui/StackLayout",ot="tinymce/ui/TabPanel",at="tinymce/ui/TextBox",st="tinymce/ui/Throbber";r(l,[],function(){function e(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)}function t(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)}function n(e,t){function n(){return!1}function r(){return!0}var i,o=t||{},l;for(i in e)s[i]||(o[i]=e[i]);if(o.target||(o.target=o.srcElement||document),e&&a.test(e.type)&&e.pageX===l&&e.clientX!==l){var c=o.target.ownerDocument||document,u=c.documentElement,d=c.body;o.pageX=e.clientX+(u&&u.scrollLeft||d&&d.scrollLeft||0)-(u&&u.clientLeft||d&&d.clientLeft||0),o.pageY=e.clientY+(u&&u.scrollTop||d&&d.scrollTop||0)-(u&&u.clientTop||d&&d.clientTop||0)}return 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 r(n,r,i){function o(){i.domLoaded||(i.domLoaded=!0,r(c))}function a(){("complete"===l.readyState||"interactive"===l.readyState&&l.body)&&(t(l,"readystatechange",a),o())}function s(){try{l.documentElement.doScroll("left")}catch(e){return void setTimeout(s,0)}o()}var l=n.document,c={type:"ready"};return i.domLoaded?void r(c):(l.addEventListener?"complete"===l.readyState?o():e(n,"DOMContentLoaded",o):(e(l,"readystatechange",a),l.documentElement.doScroll&&n.self===n.top&&s()),void e(n,"load",o))}function i(){function i(e,t){var n,r,i,o,a=s[t];if(n=a&&a[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 a=this,s={},l,c,u,d,f;c=o+(+new Date).toString(32),d="onmouseenter"in document.documentElement,u="onfocusin"in document.documentElement,f={mouseenter:"mouseover",mouseleave:"mouseout"},l=1,a.domLoaded=!1,a.events=s,a.bind=function(t,o,p,h){function m(e){i(n(e||_.event),g)}var g,v,y,b,C,x,w,_=window;if(t&&3!==t.nodeType&&8!==t.nodeType){for(t[c]?g=t[c]:(g=l++,t[c]=g,s[g]={}),h=h||t,o=o.split(" "),y=o.length;y--;)b=o[y],x=m,C=w=!1,"DOMContentLoaded"===b&&(b="ready"),a.domLoaded&&"ready"===b&&"complete"==t.readyState?p.call(h,n({type:b})):(d||(C=f[b],C&&(x=function(e){var t,r;if(t=e.currentTarget,r=e.relatedTarget,r&&t.contains)r=t.contains(r);else for(;r&&r!==t;)r=r.parentNode;r||(e=n(e||_.event),e.type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,i(e,g))})),u||"focusin"!==b&&"focusout"!==b||(w=!0,C="focusin"===b?"focus":"blur",x=function(e){e=n(e||_.event),e.type="focus"===e.type?"focusin":"focusout",i(e,g)}),v=s[g][b],v?"ready"===b&&a.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?r(t,x,a):e(t,C||b,x,w)));return t=v=0,p}},a.unbind=function(e,n,r){var i,o,l,u,d,f;if(!e||3===e.nodeType||8===e.nodeType)return a;if(i=e[c]){if(f=s[i],n){for(n=n.split(" "),l=n.length;l--;)if(d=n[l],o=f[d]){if(r)for(u=o.length;u--;)if(o[u].func===r){var p=o.nativeHandler,h=o.fakeName,m=o.capture;o=o.slice(0,u).concat(o.slice(u+1)),o.nativeHandler=p,o.fakeName=h,o.capture=m,f[d]=o}r&&0!==o.length||(delete f[d],t(e,o.fakeName||d,o.nativeHandler,o.capture))}}else{for(d in f)o=f[d],t(e,o.fakeName||d,o.nativeHandler,o.capture);f={}}for(d in f)return a;delete s[i];try{delete e[c]}catch(g){e[c]=null}}return a},a.fire=function(e,t,r){var o;if(!e||3===e.nodeType||8===e.nodeType)return a;r=n(null,r),r.type=t,r.target=e;do o=e[c],o&&i(r,o),e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow;while(e&&!r.isPropagationStopped());return a},a.clean=function(e){var t,n,r=a.unbind;if(!e||3===e.nodeType||8===e.nodeType)return a;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 a},a.destroy=function(){s={}},a.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}}var o="mce-data-",a=/^(?:mouse|contextmenu)|click/,s={keyLocation:1,layerX:1,layerY:1,returnValue:1};return i.Event=new i,i.Event.bind(window,"ready",function(){}),i}),r(c,[],function(){if(!window.jQuery)throw new Error("Load jQuery first");return jQuery.find}),r(u,[],function(){var e=navigator,t=e.userAgent,n,r,i,o,a,s,l,c,u;n=window.opera&&window.opera.buildNumber,u=/Android/.test(t),r=/WebKit/.test(t),i=!r&&!n&&/MSIE/gi.test(t)&&/Explorer/gi.test(e.appName),i=i&&/MSIE (\w+)\./.exec(t)[1],o=-1==t.indexOf("Trident/")||-1==t.indexOf("rv:")&&-1==e.appName.indexOf("Netscape")?!1:11,a=!document.msElementsFromPoint||i||o?!1:12,i=i||o||a,s=!r&&!o&&/Gecko/.test(t),l=-1!=t.indexOf("Mac"),c=/(iPad|iPhone)/.test(t),a&&(r=!1);var d=!c||t.match(/AppleWebKit\/(\d*)/)[1]>=534;return{opera:n,webkit:r,ie:i,gecko:s,mac:l,iOS:c,android:u,contentEditable:d,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!=i,range:window.getSelection&&"Range"in window,documentMode:i&&!a?document.documentMode||7:10}}),r(d,[u],function(e){function n(e){return null===e||e===t?"":(""+e).replace(v,"")}function r(e,n){return n?"array"==n&&y(e)?!0:typeof e==n:e!==t}function i(e){var t=e,n,r;if(!y(e))for(t=[],n=0,r=e.length;r>n;n++)t[n]=e[n];return t}function o(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 a(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 s(e,t){var n=[];return a(e,function(e){n.push(t(e))}),n}function l(e,t){var n=[];return a(e,function(e){(!t||t(e))&&n.push(e)}),n}function c(e,t,n){var r=this,i,o,a,s,l,c=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),a=e[3].match(/(^|\.)(\w+)$/i)[2],o=r.createNS(e[3].replace(/\.\w+$/,""),n),!o[a]){if("static"==e[2])return o[a]=t,void(this.onCreate&&this.onCreate(e[2],e[3],o[a]));t[a]||(t[a]=function(){},c=1),o[a]=t[a],r.extend(o[a].prototype,t),e[5]&&(i=r.resolve(e[5]).prototype,s=e[5].match(/\.(\w+)$/i)[1],l=o[a],c?o[a]=function(){return i[s].apply(this,arguments)}:o[a]=function(){return this.parent=i[s],l.apply(this,arguments)},o[a].prototype[a]=o[a],r.each(i,function(e,t){o[a].prototype[t]=i[t]}),r.each(t,function(e,t){i[t]?o[a].prototype[t]=function(){return this.parent=i[t],e.apply(this,arguments)}:t!=a&&(o[a].prototype[t]=e)})),r.each(t["static"],function(e,t){o[a][t]=e})}}function u(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 d(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 f(e,t,n,r){r=r||this,e&&(n&&(e=e[n]),a(e,function(e,i){return t.call(r,e,i,n)===!1?!1:void f(e,t,n,r)}))}function p(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;n<e.length;n++)r=e[n],t[r]||(t[r]={}),t=t[r];return t}function h(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 m(e,t){return!e||r(e,"array")?e:s(e.split(t||","),n)}function g(t){var n=e.cacheSuffix;return n&&(t+=(-1===t.indexOf("?")?"?":"&")+n),t}var v=/^\s*|\s*$/g,y=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};return{trim:n,isArray:y,is:r,toArray:i,makeMap:o,each:a,map:s,grep:l,inArray:u,extend:d,create:c,walk:f,createNS:p,resolve:h,explode:m,_addCacheSuffix:g}}),r(f,[l,c,d,u],function(e,n,r,i){function o(e){return"undefined"!=typeof e}function a(e){return"string"==typeof e}function s(e){return e&&e==e.window}function l(e,t){var n,r,i;for(t=t||w,i=t.createElement("div"),n=t.createDocumentFragment(),i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return n}function c(e,t,n,r){var i;if(a(t))t=l(t,v(e[0]));else if(t.length&&!t.nodeType){if(t=f.makeArray(t),r)for(i=t.length-1;i>=0;i--)c(e,t[i],n,r);else for(i=0;i<t.length;i++)c(e,t[i],n,r);return e}if(t.nodeType)for(i=e.length;i--;)n.call(e[i],t);return e}function u(e,t){return e&&t&&-1!==(" "+e.className+" ").indexOf(" "+t+" ")}function d(e,t,n){var r,i;return t=f(t)[0],e.each(function(){var e=this;n&&r==e.parentNode?i.appendChild(e):(r=e.parentNode,i=t.cloneNode(!1),e.parentNode.insertBefore(i,e),i.appendChild(e))}),e}function f(e,t){return new f.fn.init(e,t)}function p(e,t){var n;if(t.indexOf)return t.indexOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return-1}function h(e){return null===e||e===S?"":(""+e).replace(H,"")}function m(e,t){var n,r,i,o,a;if(e)if(n=e.length,n===o){for(r in e)if(e.hasOwnProperty(r)&&(a=e[r],t.call(a,r,a)===!1))break}else for(i=0;n>i&&(a=e[i],t.call(a,i,a)!==!1);i++);return e}function g(e,t){var n=[];return m(e,function(e,r){t(r,e)&&n.push(r)}),n}function v(e){return e?9==e.nodeType?e:e.ownerDocument:w}function y(e,n,r){var i=[],o=e[n];for("string"!=typeof r&&r instanceof f&&(r=r[0]);o&&9!==o.nodeType;){if(r!==t){if(o===r)break;if("string"==typeof r&&f(o).is(r))break}1===o.nodeType&&i.push(o),o=o[n]}return i}function b(e,n,r,i){var o=[];for(i instanceof f&&(i=i[0]);e;e=e[n])if(!r||e.nodeType===r){if(i!==t){if(e===i)break;if("string"==typeof i&&f(e).is(i))break}o.push(e)}return o}function C(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType==n)return e;return null}function x(e,t,n){m(n,function(n,r){e[n]=e[n]||{},e[n][t]=r})}var w=document,_=Array.prototype.push,E=Array.prototype.slice,N=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,k=e.Event,S,T=r.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),R=r.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),A={"for":"htmlFor","class":"className",readonly:"readOnly"},B={"float":"cssFloat"},D={},M={},H=/^\s*|\s*$/g;return f.fn=f.prototype={constructor:f,selector:"",context:null,length:0,init:function(e,t){var n=this,r,i;if(!e)return n;if(e.nodeType)return n.context=n[0]=e,n.length=1,n;if(t&&t.nodeType)n.context=t;else{if(t)return f(e).attr(t);n.context=t=document}if(a(e)){if(n.selector=e,r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!r)return f(t).find(e);if(r[1])for(i=l(e,v(t)).firstChild;i;)_.call(n,i),i=i.nextSibling;else{if(i=v(t).getElementById(r[2]),!i)return n;if(i.id!==r[2])return n.find(e);n.length=1,n[0]=i}}else this.add(e,!1);return n},toArray:function(){return r.toArray(this)},add:function(e,t){var n=this,r,i;if(a(e))return n.add(f(e));if(t!==!1)for(r=f.unique(n.toArray().concat(f.makeArray(e))),n.length=r.length,i=0;i<r.length;i++)n[i]=r[i];else _.apply(n,f.makeArray(e));return n},attr:function(e,t){var n=this,r;if("object"==typeof e)m(e,function(e,t){n.attr(e,t)});else{if(!o(t)){if(n[0]&&1===n[0].nodeType){if(r=D[e],r&&r.get)return r.get(n[0],e);if(R[e])return n.prop(e)?e:S;t=n[0].getAttribute(e,2),null===t&&(t=S)}return t}this.each(function(){var n;if(1===this.nodeType){if(n=D[e],n&&n.set)return void n.set(this,t);null===t?this.removeAttribute(e,2):this.setAttribute(e,t,2)}})}return n},removeAttr:function(e){return this.attr(e,null)},prop:function(e,t){var n=this;if(e=A[e]||e,"object"==typeof e)m(e,function(e,t){n.prop(e,t)});else{if(!o(t))return n[0]&&n[0].nodeType&&e in n[0]?n[0][e]:t;this.each(function(){1==this.nodeType&&(this[e]=t)})}return n},css:function(e,t){function n(e){return e.replace(/-(\D)/g,function(e,t){return t.toUpperCase()})}function r(e){return e.replace(/[A-Z]/g,function(e){return"-"+e})}var i=this,a,s;if("object"==typeof e)m(e,function(e,t){i.css(e,t)});else if(o(t))e=n(e),"number"!=typeof t||T[e]||(t+="px"),i.each(function(){var n=this.style;if(s=M[e],s&&s.set)return void s.set(this,t);try{this.style[B[e]||e]=t}catch(i){}(null===t||""===t)&&(n.removeProperty?n.removeProperty(r(e)):n.removeAttribute(e))});else{if(a=i[0],s=M[e],s&&s.get)return s.get(a);if(a.ownerDocument.defaultView)try{return a.ownerDocument.defaultView.getComputedStyle(a,null).getPropertyValue(r(e))}catch(l){return S}else if(a.currentStyle)return a.currentStyle[n(e)]}return i},remove:function(){for(var e=this,t,n=this.length;n--;)t=e[n],k.clean(t),t.parentNode&&t.parentNode.removeChild(t);return this},empty:function(){for(var e=this,t,n=this.length;n--;)for(t=e[n];t.firstChild;)t.removeChild(t.firstChild);return this},html:function(e){var t=this,n;if(o(e)){n=t.length;try{for(;n--;)t[n].innerHTML=e}catch(r){f(t[n]).empty().append(e)}return t}return t[0]?t[0].innerHTML:""},text:function(e){var t=this,n;if(o(e)){for(n=t.length;n--;)"innerText"in t[n]?t[n].innerText=e:t[0].textContent=e;return t}return t[0]?t[0].innerText||t[0].textContent:""},append:function(){return c(this,arguments,function(e){1===this.nodeType&&this.appendChild(e)})},prepend:function(){return c(this,arguments,function(e){1===this.nodeType&&this.insertBefore(e,this.firstChild)},!0)},before:function(){var e=this;return e[0]&&e[0].parentNode?c(e,arguments,function(e){this.parentNode.insertBefore(e,this)}):e},after:function(){var e=this;return e[0]&&e[0].parentNode?c(e,arguments,function(e){this.parentNode.insertBefore(e,this.nextSibling)},!0):e},appendTo:function(e){return f(e).append(this),this},prependTo:function(e){return f(e).prepend(this),this},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){return d(this,e)},wrapAll:function(e){return d(this,e,!0)},wrapInner:function(e){return this.each(function(){f(this).contents().wrapAll(e)}),this},unwrap:function(){return this.parent().each(function(){f(this).replaceWith(this.childNodes)})},clone:function(){var e=[];return this.each(function(){e.push(this.cloneNode(!0))}),f(e)},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(e,t){var n=this;return"string"!=typeof e?n:(-1!==e.indexOf(" ")?m(e.split(" "),function(){n.toggleClass(this,t)}):n.each(function(n,r){var i,o;o=u(r,e),o!==t&&(i=r.className,o?r.className=h((" "+i+" ").replace(" "+e+" "," ")):r.className+=i?" "+e:e)}),n)},hasClass:function(e){return u(this[0],e)},each:function(e){return m(this,e)},on:function(e,t){return this.each(function(){k.bind(this,e,t)})},off:function(e,t){return this.each(function(){k.unbind(this,e,t)})},trigger:function(e){return this.each(function(){"object"==typeof e?k.fire(this,e.type,e):k.fire(this,e)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new f(E.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(e){var t,n,r=[];for(t=0,n=this.length;n>t;t++)f.find(e,this[t],r);return f(r)},filter:function(e){return f("function"==typeof e?g(this.toArray(),function(t,n){return e(n,t)}):f.filter(e,this.toArray()))},closest:function(e){var t=[];return e instanceof f&&(e=e[0]),this.each(function(n,r){for(;r;){if("string"==typeof e&&f(r).is(e)){t.push(r);break}if(r==e){t.push(r);break}r=r.parentNode}}),f(t)},offset:function(e){var t,n,r,i=0,o=0,a;return e?this.css(e):(t=this[0],t&&(n=t.ownerDocument,r=n.documentElement,t.getBoundingClientRect&&(a=t.getBoundingClientRect(),i=a.left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,o=a.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:o})},push:_,sort:[].sort,splice:[].splice},r.extend(f,{extend:r.extend,makeArray:function(e){return s(e)||e.nodeType?[e]:r.toArray(e)},inArray:p,isArray:r.isArray,each:m,trim:h,grep:g,find:n,expr:n.selectors,unique:n.uniqueSort,text:n.getText,contains:n.contains,filter:function(e,t,n){var r=t.length;for(n&&(e=":not("+e+")");r--;)1!=t[r].nodeType&&t.splice(r,1);return t=1===t.length?f.find.matchesSelector(t[0],e)?[t[0]]:[]:f.find.matches(e,t)}}),m({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return y(e,"parentNode")},next:function(e){return C(e,"nextSibling",1)},prev:function(e){return C(e,"previousSibling",1)},children:function(e){return b(e.firstChild,"nextSibling",1)},contents:function(e){return r.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,t){f.fn[e]=function(n){var r=this,i=[];return r.each(function(){var e=t.call(i,this,n,i);e&&(f.isArray(e)?i.push.apply(i,e):i.push(e))}),this.length>1&&(i=f.unique(i),0===e.indexOf("parents")&&(i=i.reverse())),i=f(i),n?i.filter(n):i}}),m({parentsUntil:function(e,t){return y(e,"parentNode",t)},nextUntil:function(e,t){return b(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return b(e,"previousSibling",1,t).slice(1)}},function(e,t){f.fn[e]=function(n,r){var i=this,o=[];return i.each(function(){var e=t.call(o,this,n,o);e&&(f.isArray(e)?o.push.apply(o,e):o.push(e))}),this.length>1&&(o=f.unique(o),(0===e.indexOf("parents")||"prevUntil"===e)&&(o=o.reverse())),o=f(o),r?o.filter(r):o}}),f.fn.is=function(e){return!!e&&this.filter(e).length>0},f.fn.init.prototype=f.fn,f.overrideDefaults=function(e){function t(r,i){return n=n||e(),0===arguments.length&&(r=n.element),i||(i=n.context),new t.fn.init(r,i)}var n;return f.extend(t,this),t},i.ie&&i.ie<8&&(x(D,"get",{maxlength:function(e){var t=e.maxLength;return 2147483647===t?S:t},size:function(e){var t=e.size;return 20===t?S:t},"class":function(e){return e.className},style:function(e){var t=e.style.cssText;return 0===t.length?S:t}}),x(D,"set",{"class":function(e,t){e.className=t},style:function(e,t){e.style.cssText=t}})),i.ie&&i.ie<9&&(B["float"]="styleFloat",x(M,"set",{opacity:function(e,t){var n=e.style;null===t||""===t?n.removeAttribute("filter"):(n.zoom=1,n.filter="alpha(opacity="+100*t+")")}})),f.attrHooks=D,f.cssHooks=M,f}),r(p,[],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,f,p="\ufeff";for(e=e||{},t&&(d=t.getValidStyles(),f=t.getInvalidStyles()),u=("\\\" \\' \\; \\: ; : "+p).split(" "),l=0;l<u.length;l++)c[u[l]]=p+l,c[p+l]=u[l];return{toHex:function(e){return e.replace(r,n)},parse:function(t){function s(e,t,n){var r,i,o,a;if(r=m[e+"-top"+t],r&&(i=m[e+"-right"+t],i&&(o=m[e+"-bottom"+t],o&&(a=m[e+"-left"+t])))){var s=[r,i,o,a];for(l=s.length-1;l--&&s[l]===s[l+1];);l>-1&&n||(m[e+t]=-1==l?s[0]:s.join(" "),delete m[e+"-top"+t],delete m[e+"-right"+t],delete m[e+"-bottom"+t],delete m[e+"-left"+t])}}function u(e){var t=m[e],n;if(t){for(t=t.split(" "),n=t.length;n--;)if(t[n]!==t[0])return!1;return m[e]=t[0],!0}}function d(e,t,n,r){u(t)&&u(n)&&u(r)&&(m[e]=m[t]+" "+m[n]+" "+m[r],delete m[t],delete m[n],delete m[r])}function f(e){return b=!0,c[e]}function p(e,t){return b&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return c[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e}function h(t,n,r,i,o,a){if(o=o||a)return o=p(o),"'"+o.replace(/\'/g,"\\'")+"'";if(n=p(n||r||i),!e.allow_script_urls){var s=n.replace(/[\s\r\n]+/,"");if(/(java|vb)script:/i.test(s))return"";if(!e.allow_svg_data_urls&&/^data:image\/svg/i.test(s))return""}return C&&(n=C.call(x,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"}var m={},g,v,y,b,C=e.url_converter,x=e.url_converter_scope||this;if(t){for(t=t.replace(/[\u0000-\u001F]/g,""),t=t.replace(/\\[\"\';:\uFEFF]/g,f).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,f)});g=o.exec(t);){if(v=g[1].replace(a,"").toLowerCase(),y=g[2].replace(a,""),y=y.replace(/\\[0-9a-f]+/g,function(e){return String.fromCharCode(parseInt(e.substr(1),16))}),v&&y.length>0){if(!e.allow_script_urls&&("behavior"==v||/expression\s*\(|\/\*|\*\//.test(y)))continue;"font-weight"===v&&"700"===y?y="bold":("color"===v||"background-color"===v)&&(y=y.toLowerCase()),y=y.replace(r,n),y=y.replace(i,h),m[v]=b?p(y,!0):y}o.lastIndex=g.index+g[0].length}s("border","",!0),s("border","-width"),s("border","-color"),s("border","-style"),s("padding",""),s("margin",""),d("border","border-width","border-style","border-color"),"medium none"===m.border&&delete m.border,"none"===m["border-image"]&&delete m["border-image"]}return m},serialize:function(e,t){function n(t){var n,r,o,a;if(n=d[t])for(r=0,o=n.length;o>r;r++)t=n[r],a=e[t],a!==s&&a.length>0&&(i+=(i.length>0?" ":"")+t+": "+a+";")}function r(e,t){var n;return n=f["*"],n&&n[e]?!1:(n=f[t],n&&n[e]?!1:!0)}var i="",o,a;if(t&&d)n("*"),n(t);else for(o in e)a=e[o],a!==s&&a.length>0&&(!f||r(o,t))&&(i+=(i.length>0?" ":"")+o+": "+a+";");return i}}}}),r(h,[],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(m,[d],function(e){function t(n){function r(){return L.createDocumentFragment()}function i(e,t){_(F,e,t)}function o(e,t){_(z,e,t)}function a(e){i(e.parentNode,j(e))}function s(e){i(e.parentNode,j(e)+1)}function l(e){o(e.parentNode,j(e))}function c(e){o(e.parentNode,j(e)+1)}function u(e){e?(H[U]=H[V],H[$]=H[W]):(H[V]=H[U],H[W]=H[$]),H.collapsed=F}function d(e){a(e),c(e)}function f(e){i(e,0),o(e,1===e.nodeType?e.childNodes.length:e.nodeValue.length)}function p(e,t){var n=H[V],r=H[W],i=H[U],o=H[$],a=t.startContainer,s=t.startOffset,l=t.endContainer,c=t.endOffset;return 0===e?w(n,r,a,s):1===e?w(i,o,a,s):2===e?w(i,o,l,c):3===e?w(n,r,l,c):void 0}function h(){E(I)}function m(){return E(P)}function g(){return E(O)}function v(e){var t=this[V],r=this[W],i,o;3!==t.nodeType&&4!==t.nodeType||!t.nodeValue?(t.childNodes.length>0&&(o=t.childNodes[r]),o?t.insertBefore(e,o):3==t.nodeType?n.insertAfter(e,t):t.appendChild(e)):r?r>=t.nodeValue.length?n.insertAfter(e,t):(i=t.splitText(r),t.parentNode.insertBefore(e,i)):t.parentNode.insertBefore(e,t)}function y(e){var t=H.extractContents();H.insertNode(e),e.appendChild(t),H.selectNode(e)}function b(){return q(new t(n),{startContainer:H[V],startOffset:H[W],endContainer:H[U],endOffset:H[$],collapsed:H.collapsed,commonAncestorContainer:H.commonAncestorContainer})}function C(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 x(){return H[V]==H[U]&&H[W]==H[$]}function w(e,t,r,i){var o,a,s,l,c,u;if(e==r)return t==i?0:i>t?-1:1;for(o=r;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!=r;)o=o.parentNode;if(o){for(a=0,s=r.firstChild;s!=o&&i>a;)a++,s=s.nextSibling;return i>a?-1:1}for(l=n.findCommonAncestor(e,r),c=e;c&&c.parentNode!=l;)c=c.parentNode;for(c||(c=l),u=r;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 _(e,t,r){var i,o;for(e?(H[V]=t,H[W]=r):(H[U]=t,H[$]=r),i=H[U];i.parentNode;)i=i.parentNode;for(o=H[V];o.parentNode;)o=o.parentNode;o==i?w(H[V],H[W],H[U],H[$])>0&&H.collapse(e):H.collapse(e),H.collapsed=x(),H.commonAncestorContainer=n.findCommonAncestor(H[V],H[U])}function E(e){var t,n=0,r=0,i,o,a,s,l,c;if(H[V]==H[U])return N(e);for(t=H[U],i=t.parentNode;i;t=i,i=i.parentNode){if(i==H[V])return k(t,e);++n}for(t=H[V],i=t.parentNode;i;t=i,i=i.parentNode){if(i==H[U])return S(t,e);++r}for(o=r-n,a=H[V];o>0;)a=a.parentNode,o--;for(s=H[U];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 T(a,s,e)}function N(e){var t,n,i,o,a,s,l,c,u;if(e!=I&&(t=r()),H[W]==H[$])return t;if(3==H[V].nodeType){if(n=H[V].nodeValue,i=n.substring(H[W],H[$]),e!=O&&(o=H[V],c=H[W],u=H[$]-H[W],0===c&&u>=o.nodeValue.length-1?o.parentNode.removeChild(o):o.deleteData(c,u),H.collapse(F)),e==I)return;return i.length>0&&t.appendChild(L.createTextNode(i)),t}for(o=C(H[V],H[W]),a=H[$]-H[W];o&&a>0;)s=o.nextSibling,l=D(o,e),t&&t.appendChild(l),--a,o=s;return e!=O&&H.collapse(F),t}function k(e,t){var n,i,o,a,s,l;if(t!=I&&(n=r()),i=R(e,t),n&&n.appendChild(i),o=j(e),a=o-H[W],0>=a)return t!=O&&(H.setEndBefore(e),H.collapse(z)),n;for(i=e.previousSibling;a>0;)s=i.previousSibling,l=D(i,t),n&&n.insertBefore(l,n.firstChild),--a,i=s;return t!=O&&(H.setEndBefore(e),H.collapse(z)),n}function S(e,t){var n,i,o,a,s,l;for(t!=I&&(n=r()),o=A(e,t),n&&n.appendChild(o),i=j(e),++i,a=H[$]-i,o=e.nextSibling;o&&a>0;)s=o.nextSibling,l=D(o,t),n&&n.appendChild(l),--a,o=s;return t!=O&&(H.setStartAfter(e),H.collapse(F)),n}function T(e,t,n){var i,o,a,s,l,c,u;for(n!=I&&(o=r()),i=A(e,n),o&&o.appendChild(i),a=j(e),s=j(t),++a,l=s-a,c=e.nextSibling;l>0;)u=c.nextSibling,i=D(c,n),o&&o.appendChild(i),c=u,--l;return i=R(t,n),o&&o.appendChild(i),n!=O&&(H.setStartAfter(e),H.collapse(F)),o}function R(e,t){var n=C(H[U],H[$]-1),r,i,o,a,s,l=n!=H[U];if(n==e)return B(n,l,z,t);for(r=n.parentNode,i=B(r,z,z,t);r;){for(;n;)o=n.previousSibling,a=B(n,l,z,t),t!=I&&i.insertBefore(a,i.firstChild),l=F,n=o;if(r==e)return i;n=r.previousSibling,r=r.parentNode,s=B(r,z,z,t),t!=I&&s.appendChild(i),i=s}}function A(e,t){var n=C(H[V],H[W]),r=n!=H[V],i,o,a,s,l;if(n==e)return B(n,r,F,t);for(i=n.parentNode,o=B(i,z,F,t);i;){for(;n;)a=n.nextSibling,s=B(n,r,F,t),t!=I&&o.appendChild(s),r=F,n=a;if(i==e)return o;n=i.nextSibling,i=i.parentNode,l=B(i,z,F,t),t!=I&&l.appendChild(o),o=l}}function B(e,t,r,i){var o,a,s,l,c;if(t)return D(e,i);if(3==e.nodeType){if(o=e.nodeValue,r?(l=H[W],a=o.substring(l),s=o.substring(0,l)):(l=H[$],a=o.substring(0,l),s=o.substring(l)),i!=O&&(e.nodeValue=s),i==I)return;return c=n.clone(e,z),c.nodeValue=a,c}if(i!=I)return n.clone(e,z)}function D(e,t){return t!=I?t==O?n.clone(e,F):e:void e.parentNode.removeChild(e)}function M(){return n.create("body",null,g()).outerText}var H=this,L=n.doc,P=0,O=1,I=2,F=!0,z=!1,W="startOffset",V="startContainer",U="endContainer",$="endOffset",q=e.extend,j=n.nodeIndex;return q(H,{startContainer:L,startOffset:0,endContainer:L,endOffset:0,collapsed:F,commonAncestorContainer:L,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:i,setEnd:o,setStartBefore:a,setStartAfter:s,setEndBefore:l,setEndAfter:c,collapse:u,selectNode:d,selectNodeContents:f,compareBoundaryPoints:p,deleteContents:h,extractContents:m,cloneContents:g,insertNode:v,surroundContents:y,cloneRange:b,toStringIE:M}),H}return t.prototype.toString=function(){return this.toStringIE()},t}),r(g,[d],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;n<e.length;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=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,l=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c=/[<>&\"\']/g,u=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,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;","`":"&#96;"},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){return n?(n="x"===n.charAt(0).toLowerCase()?parseInt(n.substr(1),16):parseInt(n,10),n>65535?(n-=65536,String.fromCharCode(55296+(n>>10),56320+(1023&n))):d[n]||String.fromCharCode(n)):a[e]||i[e]||t(e)})}};return f}),r(v,[d],function(e){return function(t,n){function r(e){t.getElementsByTagName("head")[0].appendChild(e)}function i(n,i,l){function c(){for(var e=y.passed,t=e.length;t--;)e[t]();y.status=2,y.passed=[],y.failed=[]}function u(){for(var e=y.failed,t=e.length;t--;)e[t]();y.status=3,y.passed=[],y.failed=[]}function d(){var e=navigator.userAgent.match(/WebKit\/(\d*)/);return!!(e&&e[1]<536)}function f(e,t){e()||((new Date).getTime()-v<s?window.setTimeout(t,0):u())}function p(){f(function(){for(var e=t.styleSheets,n,r=e.length,i;r--;)if(n=e[r],i=n.ownerNode?n.ownerNode:n.owningElement,i&&i.id===m.id)return c(),!0},p)}function h(){f(function(){try{var e=g.sheet.cssRules;return c(),!!e}catch(t){}},h)}var m,g,v,y;if(n=e._addCacheSuffix(n),a[n]?y=a[n]:(y={passed:[],failed:[]},a[n]=y),i&&y.passed.push(i),l&&y.failed.push(l),1!=y.status){if(2==y.status)return void c();if(3==y.status)return void u();if(y.status=1,m=t.createElement("link"),m.rel="stylesheet",m.type="text/css",m.id="u"+o++,m.async=!1,m.defer=!1,v=(new Date).getTime(),"onload"in m&&!d())m.onload=p,m.onerror=u;else{if(navigator.userAgent.indexOf("Firefox")>0)return g=t.createElement("style"),g.textContent='@import "'+n+'"',h(),void r(g);p()}r(m),m.href=n}}var o=0,a={},s;n=n||{},s=n.maxLoadTime||5e3,this.load=i}}),r(y,[c,f,p,l,h,m,g,u,d,v],function(e,n,r,i,o,a,s,l,c,u){function d(e,t){var n={},r=t.keep_values,i;return i={set:function(n,r,i){t.url_converter&&(r=t.url_converter.call(t.url_converter_scope||e,r,i,n[0])),n.attr("data-mce-"+i,r).attr(i,r)},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}},n={style:{set:function(e,t){return null!==t&&"object"==typeof t?void e.css(t):(r&&e.attr("data-mce-style",t),void e.attr("style",t))},get:function(t){var n=t.attr("data-mce-style")||t.attr("style");return n=e.serializeStyle(e.parseStyle(n),t[0].nodeName)}}},r&&(n.href=n.src=i),n}function f(e,t){var o=this,a;o.doc=e,o.win=window,o.files={},o.counter=0,o.stdMode=!v||e.documentMode>=8,o.boxModel=!v||"CSS1Compat"==e.compatMode||o.stdMode,o.styleSheetLoader=new u(e),o.boundEvents=[],o.settings=t=t||{},o.schema=t.schema,o.styles=new r({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),o.fixDoc(e),o.events=t.ownEvents?new i(t.proxy):i.Event,o.attrHooks=d(o,t),a=t.schema?t.schema.getBlockElements():{},o.$=n.overrideDefaults(function(){return{context:e,element:o.getRoot()}}),o.isBlock=function(e){if(!e)return!1;var t=e.nodeType;return t?!(1!==t||!a[e.nodeName]):!!a[e]}}var p=c.each,h=c.is,m=c.grep,g=c.trim,v=l.ie,y=/^([a-z0-9],?)+$/i,b=/^[ \t\r\n]*$/;return f.prototype={$$:function(e){return"string"==typeof e&&(e=this.get(e)),this.$(e)},root:null,fixDoc:function(e){var t=this.settings,n;if(v&&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!v||1!==e.nodeType||t?e.cloneNode(t):(i=n.doc,t?r.firstChild:(r=i.createElement(e.nodeName),p(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),r))},getRoot:function(){var e=this;return 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),h(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.settings.root_element||r.doc,[])},is:function(n,r){var i;if(n.length===t){if("*"===r)return 1==n.nodeType;if(y.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}}if(n.nodeType&&1!=n.nodeType)return!1;var o=n.nodeType?[n]:n;return e(r,o[0].ownerDocument||o[0],null,o).length>0},add:function(e,t,n,r,i){var o=this;return this.run(e,function(e){var a;return a=h(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,t,n){var r="",i;r+="<"+e;for(i in t)t.hasOwnProperty(i)&&null!==t[i]&&"undefined"!=typeof t[i]&&(r+=" "+i+'="'+this.encode(t[i])+'"');return"undefined"!=typeof n?r+">"+n+"</"+e+">":r+" />"},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 e=this.$$(e),t?e.each(function(){for(var e;e=this.firstChild;)3==e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this)}).remove():e.remove(),e.length>1?e.toArray():e[0]},setStyle:function(e,t,n){e=this.$$(e).css(t,n),this.settings.update_styles&&e.attr("data-mce-style",null)},getStyle:function(e,n,r){return e=this.$$(e),r?e.css(n):(n=n.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),"float"==n&&(n=v?"styleFloat":"cssFloat"),e[0]&&e[0].style?e[0].style[n]:t)},setStyles:function(e,t){e=this.$$(e).css(t),this.settings.update_styles&&e.attr("data-mce-style",null)},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,t,n){var r=this,i,o,a=r.settings;""===n&&(n=null),e=r.$$(e),i=e.attr(t),e.length&&(o=r.attrHooks[t],o&&o.set?o.set(e,n,t):e.attr(t,n),i!=n&&a.onSetAttrib&&a.onSetAttrib({attrElm:e,attrName:t,attrValue:n}))},setAttribs:function(e,t){var n=this;n.$$(e).each(function(e,r){p(t,function(e,t){n.setAttrib(r,t,e)})})},getAttrib:function(e,t,n){var r=this,i,o;return e=r.$$(e),e.length&&(i=r.attrHooks[t],o=i&&i.get?i.get(e,t):e.attr(t)),"undefined"==typeof o&&(o=n||""),o},getPos:function(e,t){var r=this,i=0,o=0,a,s=r.doc,l=s.body,c;if(e=r.get(e),t=t||l,e){if(t===l&&e.getBoundingClientRect&&"static"===n(l).css("position"))return c=e.getBoundingClientRect(),t=r.boxModel?s.documentElement:l,i=c.left+(s.documentElement.scrollLeft||l.scrollLeft)-t.clientLeft,o=c.top+(s.documentElement.scrollTop||l.scrollTop)-t.clientTop,{x:i,y:o};for(a=e;a&&a!=t&&a.nodeType;)i+=a.offsetLeft||0,o+=a.offsetTop||0,a=a.offsetParent;for(a=e.parentNode;a&&a!=t&&a.nodeType;)i-=a.scrollLeft||0,o-=a.scrollTop||0,a=a.parentNode}return{x:i,y:o}},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!==f.DOM&&n===document){var o=f.DOM.addedStyles;if(o=o||[],o[e])return;o[e]=!0,f.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 t=this,n=t.doc,r;return t!==f.DOM&&n===document?void f.DOM.loadCSS(e):(e||(e=""),r=n.getElementsByTagName("head")[0],void p(e.split(","),function(e){var i;e=c._addCacheSuffix(e),t.files[e]||(t.files[e]=!0,i=t.create("link",{rel:"stylesheet",href:e}),v&&n.documentMode&&n.recalc&&(i.onload=function(){n.recalc&&n.recalc(),i.onload=null}),r.appendChild(i))}))},addClass:function(e,t){this.$$(e).addClass(t)},removeClass:function(e,t){this.toggleClass(e,t,!1)},hasClass:function(e,t){return this.$$(e).hasClass(t)},toggleClass:function(e,t,r){this.$$(e).toggleClass(t,r).each(function(){""===this.className&&n(this).attr("class",null)})},show:function(e){this.$$(e).show()},hide:function(e){this.$$(e).hide()},isHidden:function(e){return"none"==this.$$(e).css("display")},uniqueId:function(e){return(e?e:"mce_")+this.counter++},setHTML:function(e,t){e=this.$$(e),v?e.each(function(e,r){if(r.canHaveHTML!==!1){for(;r.firstChild;)r.removeChild(r.firstChild);try{r.innerHTML="<br>"+t,r.removeChild(r.firstChild)}catch(i){n("<div>").html("<br>"+t).contents().slice(1).appendTo(r)}return t}}):e.html(t)},getOuterHTML:function(e){return e=this.get(e),1==e.nodeType&&"outerHTML"in e?e.outerHTML:n("<div>").append(n(e).clone()).html()},setOuterHTML:function(e,t){var r=this;r.$$(e).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}r.remove(n(this).html(t),!0)})},decode:s.decode,encode:s.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 h(t,"array")&&(e=e.cloneNode(!0)),n&&p(m(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),p(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(c.trim(e))},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=[],p(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(v){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,i,a,s,l,c=0;if(e=e.firstChild){s=new o(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(i=n.getAttribs(e),r=i.length;r--;)if(l=i[r].nodeName,"name"===l||"data-mce-bookmark"===l)return!1}if(8==a)return!1;if(3===a&&!b.test(e.nodeValue))return!1}while(e=s.next())}return 1>=c},createRng:function(){var e=this.doc;return e.createRange?e.createRange():new a(this)},nodeIndex:function(e,t){var n=0,r,i;if(e)for(r=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)i=e.nodeType,(!t||3!=i||i!=r&&e.nodeValue.length)&&(n++,r=i);return n},split:function(e,t,n){function r(e){function t(e){var t=e.previousSibling&&"SPAN"==e.previousSibling.nodeName,n=e.nextSibling&&"SPAN"==e.nextSibling.nodeName;return t&&n}var n,o=e.childNodes,a=e.nodeType;if(1!=a||"bookmark"!=e.getAttribute("data-mce-type")){for(n=o.length-1;n>=0;n--)r(o[n]);if(9!=a){if(3==a&&e.nodeValue.length>0){var s=g(e.nodeValue).length;if(!i.isBlock(e.parentNode)||s>0||0===s&&t(e))return}else if(1==a&&(o=e.childNodes,1==o.length&&o[0]&&1==o[0].nodeType&&"bookmark"==o[0].getAttribute("data-mce-type")&&e.parentNode.insertBefore(o[0],e),o.length||/^(br|hr|input|img)$/i.test(e.nodeName)))return;i.remove(e)}return e}}var i=this,o=i.createRng(),a,s,l;return e&&t?(o.setStart(e.parentNode,i.nodeIndex(e)),o.setEnd(t.parentNode,i.nodeIndex(t)),a=o.extractContents(),o=i.createRng(),o.setStart(t.parentNode,i.nodeIndex(t)+1),o.setEnd(e.parentNode,i.nodeIndex(e)+1),s=o.extractContents(),l=e.parentNode,l.insertBefore(r(a),e),n?l.replaceChild(n,t):l.insertBefore(t,e),l.insertBefore(r(s),e),i.remove(e),n||t):void 0},bind:function(e,t,n,r){var i=this;if(c.isArray(e)){for(var o=e.length;o--;)e[o]=i.bind(e[o],t,n,r);return e}return!i.settings.collect||e!==i.doc&&e!==i.win||i.boundEvents.push([e,t,n,r]),i.events.bind(e,t,n,r||i)},unbind:function(e,t,n){var r=this,i;if(c.isArray(e)){for(i=e.length;i--;)e[i]=r.unbind(e[i],t,n);return e}if(r.boundEvents&&(e===r.doc||e===r.win))for(i=r.boundEvents.length;i--;){var o=r.boundEvents[i];e!=o[0]||t&&t!=o[1]||n&&n!=o[2]||this.events.unbind(o[0],o[1],o[2])}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 e&&1==e.nodeType?(t=e.getAttribute("data-mce-contenteditable"),t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null):null},getContentEditableParent:function(e){for(var t=this.getRoot(),n=null;e&&e!==t&&(n=this.getContentEditable(e),null===n);e=e.parentNode);return n},destroy:function(){var t=this;if(t.boundEvents){for(var n=t.boundEvents.length;n--;){var r=t.boundEvents[n];this.events.unbind(r[0],r[1],r[2])}t.boundEvents=null}e.setDocument&&e.setDocument(),t.win=t.doc=t.root=t.events=t.frag=null},isChildOf:function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},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}},f.DOM=new f(document),f}),r(b,[y,d],function(e,t){function n(){function e(e,n){function i(){a.remove(l),s&&(s.onreadystatechange=s.onload=s=null),n()}function o(){"undefined"!=typeof console&&console.log&&console.log("Failed to load: "+e)}var a=r,s,l;l=a.uniqueId(),s=document.createElement("script"),s.id=l,s.type="text/javascript",s.src=t._addCacheSuffix(e),"onreadystatechange"in s?s.onreadystatechange=function(){/loaded|complete/.test(s.readyState)&&i()}:s.onload=i,s.onerror=o,(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}var n=0,a=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(t,n,r){function c(e){i(u[e],function(e){e.func.call(e.scope)}),u[e]=p}var h;d.push({func:n,scope:r||this}),(h=function(){var n=o(t);t.length=0,i(n,function(t){return l[t]==s?void c(t):void(l[t]!=a&&(l[t]=a,f++,e(t,function(){l[t]=s,f--,c(t),h()})))}),f||(i(d,function(e){e.func.call(e.scope)}),d.length=0)})()}}var r=e.DOM,i=t.each,o=t.grep;return n.ScriptLoader=new n,n}),r(C,[b,d],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,n){var i=r.language;if(i&&r.languageLoad!==!1){if(n)if(n=","+n+",",-1!=n.indexOf(","+i.substr(0,2)+","))i=i.substr(0,2);else if(-1==n.indexOf(","+i+","))return;e.ScriptLoader.add(this.urls[t]+"/langs/"+i+".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&&a.call(s?s: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(x,[d,h],function(e,t){function n(e,t){var n=e.childNodes;return t--,t>n.length-1?t=n.length-1:0>t&&(t=0),n[t]||e}function r(e){this.walk=function(t,r){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 i=n?"nextSibling":"previousSibling";for(g=e,v=g.parentNode;g&&g!=t;g=v)v=g.parentNode,y=a(g==e?g:g[i],i),y.length&&(n||y.reverse(),r(o(y)))}var c=t.startContainer,u=t.startOffset,d=t.endContainer,f=t.endOffset,p,h,m,g,v,y,b;if(b=e.select("td.mce-item-selected,th.mce-item-selected"),b.length>0)return void i(b,function(e){r([e])});if(1==c.nodeType&&c.hasChildNodes()&&(c=c.childNodes[u]),1==d.nodeType&&d.hasChildNodes()&&(d=n(d,f)),c==d)return r(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&&r(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&&r<n.nodeValue.length&&(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&&r<n.nodeValue.length&&(n=t(n,r),r=0),3==i.nodeType&&o>0&&o<i.nodeValue.length&&(i=t(i,o).previousSibling,o=i.nodeValue.length)),{startContainer:n,startOffset:r,endContainer:i,endOffset:o}},this.normalize=function(n){function r(r){function a(n,r){for(var i=new t(n,e.getParent(n.parentNode,e.isBlock)||f);n=i[r?"prev":"next"]();)if("BR"===n.nodeName)return!0}function s(e,t){return e.previousSibling&&e.previousSibling.nodeName==t}function l(n,r){var a,s,l;if(r=r||c,l=e.getParent(r.parentNode,e.isBlock)||f,n&&"BR"==r.nodeName&&g&&e.isEmpty(l))return c=r.parentNode,u=e.nodeIndex(r),void(i=!0);for(a=new t(r,l);p=a[n?"prev":"next"]();){if("false"===e.getContentEditableParent(p))return;if(3===p.nodeType&&p.nodeValue.length>0)return c=p,u=n?p.nodeValue.length:0,void(i=!0);if(e.isBlock(p)||h[p.nodeName.toLowerCase()])return;s=p}o&&s&&(c=s,i=!0,u=0)}var c,u,d,f=e.getRoot(),p,h,m,g;if(c=n[(r?"start":"end")+"Container"],u=n[(r?"start":"end")+"Offset"],g=1==c.nodeType&&u===c.childNodes.length,h=e.schema.getNonEmptyElements(),m=r,1==c.nodeType&&u>c.childNodes.length-1&&(m=!1),9===c.nodeType&&(c=e.getRoot(),u=0),c===f){if(m&&(p=c.childNodes[u>0?u-1:0],p&&(h[p.nodeName]||"TABLE"==p.nodeName)))return;if(c.hasChildNodes()&&(u=Math.min(!m&&u>0?u-1:u,c.childNodes.length-1),c=c.childNodes[u],u=0,c.hasChildNodes()&&!/TABLE/.test(c.nodeName))){p=c,d=new t(c,f);do{if(3===p.nodeType&&p.nodeValue.length>0){u=m?0:p.nodeValue.length,c=p,i=!0;break}if(h[p.nodeName.toLowerCase()]){u=e.nodeIndex(p),c=p.parentNode,"IMG"!=p.nodeName||m||u++,i=!0;break}}while(p=m?d.next():d.prev())}}o&&(3===c.nodeType&&0===u&&l(!0),1===c.nodeType&&(p=c.childNodes[u],p||(p=c.childNodes[u-1]),!p||"BR"!==p.nodeName||s(p,"A")||a(p)||a(p,!0)||l(!0,p))),m&&!o&&3===c.nodeType&&u===c.nodeValue.length&&l(!1),i&&n["set"+(r?"Start":"End")](c,u)}var i,o;return o=n.collapsed,r(!0),o||r(),i&&o&&n.collapse(!0),i}}var i=e.each;return r.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},r.getCaretRangeFromPoint=function(e,t,n){var r,i;if(n.caretPositionFromPoint)i=n.caretPositionFromPoint(e,t),r=n.createRange(),r.setStart(i.offsetNode,i.offset),r.collapse(!0);else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(n.body.createTextRange){r=n.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(o){r.collapse(t<n.body.clientHeight)}}return r},r.getNode=function(e,t){return 1==e.nodeType&&e.hasChildNodes()&&(t>=e.childNodes.length&&(t=e.childNodes.length-1),e=e.childNodes[t]),e},r}),r(w,[x,u],function(e,t){return function(n){function r(e){var t,r;if(r=n.$(e).parentsUntil(n.getBody()).add(e),r.length===o.length){for(t=r.length;t>=0&&r[t]===o[t];t--);if(-1===t)return o=r,!0}return o=r,!1}var i,o=[];"onselectionchange"in n.getDoc()||n.on("NodeChange Click MouseUp KeyUp Focus",function(t){var r,o;r=n.selection.getRng(),o={startContainer:r.startContainer,startOffset:r.startOffset,endContainer:r.endContainer,endOffset:r.endOffset},"nodechange"!=t.type&&e.compareRanges(o,i)||n.fire("SelectionChange"),i=o}),n.on("contextmenu",function(){n.fire("SelectionChange")}),n.on("SelectionChange",function(){var e=n.selection.getStart(!0);(t.range||!n.selection.isCollapsed())&&!r(e)&&n.dom.isChildOf(e,n.getBody())&&n.nodeChanged({selectionChange:!0})}),n.on("MouseUp",function(e){e.isDefaultPrevented()||("IMG"==n.selection.getNode().nodeName?setTimeout(function(){n.nodeChanged()},0):n.nodeChanged())}),this.nodeChanged=function(e){var t=n.selection,r,i,o;n.initialized&&t&&!n.settings.disable_nodechange&&!n.settings.readonly&&(o=n.getBody(),r=t.getStart()||o,r=r.ownerDocument!=n.getDoc()?n.getBody():r,"IMG"==r.nodeName&&t.isCollapsed()&&(r=r.parentNode),i=[],n.dom.getParent(r,function(e){return e===o?!0:void i.push(e)}),e=e||{},e.element=r,e.parents=i,n.fire("NodeChange",e))}}}),r(_,[],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-bookmark"))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(E,[d],function(e){function t(e,t){return e?e.split(t||" "):[]}function n(e){function n(e,n,r){function i(e,t){var n={},r,i;for(r=0,i=e.length;i>r;r++)n[e[r]]=t||{};return n}var s,c,u,d=arguments;for(r=r||[],n=n||"","string"==typeof r&&(r=t(r)),c=3;c<d.length;c++)"string"==typeof d[c]&&(d[c]=t(d[c])),r.push.apply(r,d[c]);for(e=t(e),s=e.length;s--;)u=[].concat(l,t(n)),a[e[s]]={attributes:i(u),attributesOrder:u,children:i(r,o)}}function r(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={},l,c,u,d,f,p;return i[e]?i[e]:(l=t("id accesskey class dir lang style tabindex title"),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&&(l.push.apply(l,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&&(l.push("xml:lang"),p=t("acronym applet basefont big font strike tt"),u.push.apply(u,p),s(p,function(e){n(e,"",u)}),f=t("center dir isindex noframes"),c.push.apply(c,f),d=[].concat(c,u),s(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 sizes srcset 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 buffered",d,"track source"),n("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",d,"track source"),n("picture","","img source"),n("source","src srcset type media sizes"),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&&(r("script","language xml:space"),r("style","xml:space"),r("object","declare classid code codebase codetype archive standby align border hspace vspace"),r("embed","align name hspace vspace"),r("param","valuetype type"),r("a","charset name rev shape coords"),r("br","clear"),r("applet","codebase archive code object alt name width height align hspace vspace"),r("img","name longdesc align border hspace vspace"),r("iframe","longdesc frameborder marginwidth marginheight scrolling align"),r("font basefont","size color face"),r("input","usemap align"),r("select","onchange"),r("textarea"),r("h1 h2 h3 h4 h5 h6 div p legend caption","align"),r("ul","type compact"),r("li","type"),r("ol dl menu dir","compact"),r("pre","width xml:space"),r("hr","align noshade size width"),r("isindex","prompt"),r("table","summary width frame rules cellspacing cellpadding align bgcolor"),r("col","width align char charoff valign"),r("colgroup","width align char charoff valign"),r("thead","align char charoff valign"),r("tr","align char charoff valign bgcolor"),r("th","axis align char charoff valign nowrap bgcolor width height"),r("form","accept"),r("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),r("tfoot","align char charoff valign"),r("tbody","align char charoff valign"),r("area","nohref"),r("body","background bgcolor text link vlink alink")),"html4"!=e&&(r("input button select textarea","autofocus"),r("input textarea","placeholder"),
+r("a","download"),r("link script img","crossorigin"),r("iframe","sandbox seamless allowfullscreen")),s(t("a form meter progress dfn"),function(e){a[e]&&delete a[e].children[e]}),delete a.caption.children.table,i[e]=a,a)}function r(e,t){var n;return e&&(n={},"string"==typeof e&&(e={"*":e}),s(e,function(e,r){n[r]=n[r.toUpperCase()]="map"==t?a(e,/[, ]/):c(e,/[, ]/)})),n}var i={},o={},a=e.makeMap,s=e.each,l=e.extend,c=e.explode,u=e.inArray;return function(e){function o(t,n,r){var o=e[t];return o?o=a(o,/[, ]/,a(o.toUpperCase(),/[, ]/)):(o=i[t],o||(o=a(n," ",a(n.toUpperCase()," ")),o=l(o,r),i[t]=o)),o}function d(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")}function f(e){var n,r,i,o,s,l,c,f,p,h,m,g,v,b,x,w,_,E,N,k=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,S=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,T=/[*?+]/;if(e)for(e=t(e,","),y["@"]&&(w=y["@"].attributes,_=y["@"].attributesOrder),n=0,r=e.length;r>n;n++)if(s=k.exec(e[n])){if(b=s[1],p=s[2],x=s[3],f=s[5],g={},v=[],l={attributes:g,attributesOrder:v},"#"===b&&(l.paddEmpty=!0),"-"===b&&(l.removeEmpty=!0),"!"===s[4]&&(l.removeEmptyAttrs=!0),w){for(E in w)g[E]=w[E];v.push.apply(v,_)}if(f)for(f=t(f,"|"),i=0,o=f.length;o>i;i++)if(s=S.exec(f[i])){if(c={},m=s[1],h=s[2].replace(/::/g,":"),b=s[3],N=s[4],"!"===m&&(l.attributesRequired=l.attributesRequired||[],l.attributesRequired.push(h),c.required=!0),"-"===m){delete g[h],v.splice(u(v,h),1);continue}b&&("="===b&&(l.attributesDefault=l.attributesDefault||[],l.attributesDefault.push({name:h,value:N}),c.defaultValue=N),":"===b&&(l.attributesForced=l.attributesForced||[],l.attributesForced.push({name:h,value:N}),c.forcedValue=N),"<"===b&&(c.validValues=a(N,"?"))),T.test(h)?(l.attributePatterns=l.attributePatterns||[],c.pattern=d(h),l.attributePatterns.push(c)):(g[h]||v.push(h),g[h]=c)}w||"@"!=p||(w=g,_=v),x&&(l.outputName=p,y[x]=l),T.test(p)?(l.pattern=d(p),C.push(l)):y[p]=l}}function p(e){y={},C=[],f(e),s(_,function(e,t){b[t]=e.children})}function h(e){var n=/^(~)?(.+)$/;e&&(i.text_block_elements=i.block_elements=null,s(t(e,","),function(e){var t=n.exec(e),r="~"===t[1],i=r?"span":"div",o=t[2];if(b[o]=b[i],H[o]=i,r||(R[o.toUpperCase()]={},R[o]={}),!y[o]){var a=y[i];a=l({},a),delete a.removeEmptyAttrs,delete a.removeEmpty,y[o]=a}s(b,function(e,t){e[i]&&(b[t]=e=l({},b[t]),e[o]=e[i])})}))}function m(e){var n=/^([+\-]?)(\w+)\[([^\]]+)\]$/;e&&s(t(e,","),function(e){var r=n.exec(e),i,o;r&&(o=r[1],i=o?b[r[2]]:b[r[2]]={"#comment":{}},i=b[r[2]],s(t(r[3],"|"),function(e){"-"===o?(b[r[2]]=i=l({},b[r[2]]),delete i[e]):i[e]={}}))})}function g(e){var t=y[e],n;if(t)return t;for(n=C.length;n--;)if(t=C[n],t.pattern.test(e))return t}var v=this,y={},b={},C=[],x,w,_,E,N,k,S,T,R,A,B,D,M,H={},L={};e=e||{},_=n(e.schema),e.verify_html===!1&&(e.valid_elements="*[*]"),x=r(e.valid_styles),w=r(e.invalid_styles,"map"),T=r(e.valid_classes,"map"),E=o("whitespace_elements","pre script noscript style textarea video audio iframe object"),N=o("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),k=o("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),S=o("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),A=o("non_empty_elements","td th iframe video audio object script",k),B=o("move_caret_before_on_enter_elements","table",A),D=o("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"),R=o("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup",D),M=o("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp"),s((e.special||"script noscript style textarea").split(" "),function(e){L[e]=new RegExp("</"+e+"[^>]*>","gi")}),e.valid_elements?p(e.valid_elements):(s(_,function(e,t){y[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},b[t]=e.children}),"html5"!=e.schema&&s(t("strong/b em/i"),function(e){e=t(e,"/"),y[e[1]].outputName=e[0]}),y.img.attributesDefault=[{name:"alt",value:""}],s(t("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){y[e]&&(y[e].removeEmpty=!0)}),s(t("p h1 h2 h3 h4 h5 h6 th td pre div address caption"),function(e){y[e].paddEmpty=!0}),s(t("span"),function(e){y[e].removeEmptyAttrs=!0})),h(e.custom_elements),m(e.valid_children),f(e.extended_valid_elements),m("+ol[ul|ol],+ul[ul|ol]"),e.invalid_elements&&s(c(e.invalid_elements),function(e){y[e]&&delete y[e]}),g("span")||f("span[!data-mce-type|*]"),v.children=b,v.getValidStyles=function(){return x},v.getInvalidStyles=function(){return w},v.getValidClasses=function(){return T},v.getBoolAttrs=function(){return S},v.getBlockElements=function(){return R},v.getTextBlockElements=function(){return D},v.getTextInlineElements=function(){return M},v.getShortEndedElements=function(){return k},v.getSelfClosingElements=function(){return N},v.getNonEmptyElements=function(){return A},v.getMoveCaretBeforeOnEnterElements=function(){return B},v.getWhiteSpaceElements=function(){return E},v.getSpecialElements=function(){return L},v.isValidChild=function(e,t){var n=b[e];return!(!n||!n[t])},v.isValid=function(e,t){var n,r,i=g(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},v.getElementRule=g,v.getCustomElements=function(){return H},v.addValidElements=f,v.setValidElements=p,v.addCustomElements=h,v.addValidChildren=m,v.elements=y}}),r(N,[E,g,d],function(e,t,n){function r(e,t,n){var r=1,i,o,a,s;for(s=e.getShortEndedElements(),a=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g,a.lastIndex=i=n;o=a.exec(t);){if(i=a.lastIndex,"/"===o[1])r--;else if(!o[1]){if(o[2]in s)continue;r++}if(0===r)break}return i}function i(i,a){function s(){}var l=this;i=i||{},l.schema=a=a||new e,i.fix_self_closing!==!1&&(i.fix_self_closing=!0),o("comment cdata text start end pi doctype".split(" "),function(e){e&&(l[e]=i[e]||s)}),l.parse=function(e){function o(e){var t,n;for(t=p.length;t--&&p[t].name!==e;);if(t>=0){for(n=p.length-1;n>=t;n--)e=p[n],e.valid&&l.end(e.name);p.length=t}}function s(e,t,n,r,o){var a,s,l=/[\s\u0000-\u001F]+/g;if(t=t.toLowerCase(),n=t in x?t:z(n||r||o||""),_&&!y&&0!==t.indexOf("data-")){if(a=T[t],!a&&R){for(s=R.length;s--&&(a=R[s],!a.pattern.test(t)););-1===s&&(a=null)}if(!a)return;if(a.validValues&&!(n in a.validValues))return}if(V[t]&&!i.allow_script_urls){var c=n.replace(l,"");try{c=decodeURIComponent(c)}catch(u){c=unescape(c)}if(U.test(c))return;if(!i.allow_html_data_urls&&$.test(c)&&!/^data:image\//i.test(c))return}h.map[t]=n,h.push({name:t,value:n})}var l=this,c,u=0,d,f,p=[],h,m,g,v,y,b,C,x,w,_,E,N,k,S,T,R,A,B,D,M,H,L,P,O,I,F=0,z=t.decode,W,V=n.makeMap("src,href,data,background,formaction,poster"),U=/((java|vb)script|mhtml):/i,$=/^data:/i;for(L=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-_\\:\\.]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),P=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,C=a.getShortEndedElements(),H=i.self_closing_elements||a.getSelfClosingElements(),x=a.getBoolAttrs(),_=i.validate,b=i.remove_internals,W=i.fix_self_closing,O=a.getSpecialElements();c=L.exec(e);){if(u<c.index&&l.text(z(e.substr(u,c.index-u))),d=c[6])d=d.toLowerCase(),":"===d.charAt(0)&&(d=d.substr(1)),o(d);else if(d=c[7]){if(d=d.toLowerCase(),":"===d.charAt(0)&&(d=d.substr(1)),w=d in C,W&&H[d]&&p.length>0&&p[p.length-1].name===d&&o(d),!_||(E=a.getElementRule(d))){if(N=!0,_&&(T=E.attributes,R=E.attributePatterns),(S=c[8])?(y=-1!==S.indexOf("data-mce-type"),y&&b&&(N=!1),h=[],h.map={},S.replace(P,s)):(h=[],h.map={}),_&&!y){if(A=E.attributesRequired,B=E.attributesDefault,D=E.attributesForced,M=E.removeEmptyAttrs,M&&!h.length&&(N=!1),D)for(m=D.length;m--;)k=D[m],v=k.name,I=k.value,"{$uid}"===I&&(I="mce_"+F++),h.map[v]=I,h.push({name:v,value:I});if(B)for(m=B.length;m--;)k=B[m],v=k.name,v in h.map||(I=k.value,"{$uid}"===I&&(I="mce_"+F++),h.map[v]=I,h.push({name:v,value:I}));if(A){for(m=A.length;m--&&!(A[m]in h.map););-1===m&&(N=!1)}if(k=h.map["data-mce-bogus"]){if("all"===k){u=r(a,e,L.lastIndex),L.lastIndex=u;continue}N=!1}}N&&l.start(d,h,w)}else N=!1;if(f=O[d]){f.lastIndex=u=c.index+c[0].length,(c=f.exec(e))?(N&&(g=e.substr(u,c.index-u)),u=c.index+c[0].length):(g=e.substr(u),u=e.length),N&&(g.length>0&&l.text(g,!0),l.end(d)),L.lastIndex=u;continue}w||(S&&S.indexOf("/")==S.length-1?N&&l.end(d):p.push({name:d,valid:N}))}else(d=c[1])?(">"===d.charAt(0)&&(d=" "+d),i.allow_conditional_comments||"[if"!==d.substr(0,3)||(d=" "+d),l.comment(d)):(d=c[2])?l.cdata(d):(d=c[3])?l.doctype(d):(d=c[4])&&l.pi(d,c[5]);u=c.index+c[0].length}for(u<e.length&&l.text(z(e.substr(u))),m=p.length-1;m>=0;m--)d=p[m],d.valid&&l.end(d.name)}}var o=n.each;return i.findEndTag=r,i}),r(k,[_,E,N,d],function(e,t,n,r){var i=r.makeMap,o=r.each,a=r.explode,s=r.extend;return function(r,l){function c(t){var n,r,o,a,s,c,d,f,p,h,m,g,v,y;for(m=i("tr,td,th,tbody,thead,tfoot,table"),h=l.getNonEmptyElements(),g=l.getTextBlockElements(),n=0;n<t.length;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],o=r.parent;o&&!l.isValidChild(o.name,r.name)&&!m[o.name];o=o.parent)a.push(o);if(o&&a.length>1){for(a.reverse(),s=c=u.filterNode(a[0].clone()),p=0;p<a.length-1;p++){for(l.isValidChild(c.name,a[p].name)?(d=u.filterNode(a[p].clone()),c.append(d)):d=c,f=a[p].firstChild;f&&f!=a[p+1];)y=f.next,d.append(f),f=y;c=d}s.isEmpty(h)?o.insert(r,a[0],!0):(o.insert(s,a[0],!0),o.insert(r,s)),o=a[0],(o.isEmpty(h)||o.firstChild===o.lastChild&&"br"===o.firstChild.name)&&o.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(u.filterNode(new e("ul",1)));continue}l.isValidChild(r.parent.name,"div")&&l.isValidChild("div",r.name)?r.wrap(u.filterNode(new e("div",1))):"style"===r.name||"script"===r.name?r.empty().remove():r.unwrap()}}}var u=this,d={},f=[],p={},h={};r=r||{},r.validate="validate"in r?r.validate:!0,r.root_name=r.root_name||"body",u.schema=l=l||new t,u.filterNode=function(e){var t,n,r;n in d&&(r=p[n],r?r.push(e):p[n]=[e]),t=f.length;for(;t--;)n=f[t].name,n in e.attributes.map&&(r=h[n],r?r.push(e):h[n]=[e]);return e},u.addNodeFilter=function(e,t){o(a(e),function(e){var n=d[e];n||(d[e]=n=[]),n.push(t)})},u.addAttributeFilter=function(e,t){o(a(e),function(e){var n;for(n=0;n<f.length;n++)if(f[n].name===e)return void f[n].callbacks.push(t);f.push({name:e,callbacks:[t]})})},u.parse=function(t,o){function a(){function e(e){e&&(t=e.firstChild,t&&3==t.type&&(t.value=t.value.replace(R,"")),t=e.lastChild,t&&3==t.type&&(t.value=t.value.replace(D,"")))}var t=y.firstChild,n,i;if(l.isValidChild(y.name,I.toLowerCase())){for(;t;)n=t.next,3==t.type||1==t.type&&"p"!==t.name&&!T[t.name]&&!t.attr("data-mce-type")?i?i.append(t):(i=u(I,1),i.attr(r.forced_root_block_attrs),y.insert(i,t),i.append(t)):(e(i),i=null),t=n;e(i)}}function u(t,n){var r=new e(t,n),i;return t in d&&(i=p[t],i?i.push(r):p[t]=[r]),r}function m(e){var t,n,r;for(t=e.prev;t&&3===t.type;)n=t.value.replace(D,""),n.length>0?(t.value=n,t=t.prev):(r=t.prev,t.remove(),t=r)}function g(e){var t,n={};for(t in e)"li"!==t&&"p"!=t&&(n[t]=e[t]);return n}var v,y,b,C,x,w,_,E,N,k,S,T,R,A=[],B,D,M,H,L,P,O,I;if(o=o||{},p={},h={},T=s(i("script,style,head,html,body,title,meta,param"),l.getBlockElements()),O=l.getNonEmptyElements(),P=l.children,S=r.validate,I="forced_root_block"in o?o.forced_root_block:r.forced_root_block,L=l.getWhiteSpaceElements(),R=/^[ \t\r\n]+/,D=/[ \t\r\n]+$/,M=/[ \t\r\n]+/g,H=/^[ \t\r\n]+$/,v=new n({validate:S,allow_script_urls:r.allow_script_urls,allow_conditional_comments:r.allow_conditional_comments,self_closing_elements:g(l.getSelfClosingElements()),cdata:function(e){b.append(u("#cdata",4)).value=e},text:function(e,t){var n;B||(e=e.replace(M," "),b.lastChild&&T[b.lastChild.name]&&(e=e.replace(R,""))),0!==e.length&&(n=u("#text",3),n.raw=!!t,b.append(n).value=e)},comment:function(e){b.append(u("#comment",8)).value=e},pi:function(e,t){b.append(u(e,7)).value=t,m(b)},doctype:function(e){var t;t=b.append(u("#doctype",10)),t.value=e,m(b)},start:function(e,t,n){var r,i,o,a,s;if(o=S?l.getElementRule(e):{}){for(r=u(o.outputName||e,1),r.attributes=t,r.shortEnded=n,b.append(r),s=P[b.name],s&&P[r.name]&&!s[r.name]&&A.push(r),i=f.length;i--;)a=f[i].name,a in t.map&&(N=h[a],N?N.push(r):h[a]=[r]);T[e]&&m(r),n||(b=r),!B&&L[e]&&(B=!0)}},end:function(t){var n,r,i,o,a;if(r=S?l.getElementRule(t):{}){if(T[t]&&!B){if(n=b.firstChild,n&&3===n.type)if(i=n.value.replace(R,""),i.length>0)n.value=i,n=n.next;else for(o=n.next,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.next,(0===i.length||H.test(i))&&(n.remove(),n=o),n=o;if(n=b.lastChild,n&&3===n.type)if(i=n.value.replace(D,""),i.length>0)n.value=i,n=n.prev;else for(o=n.prev,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.prev,(0===i.length||H.test(i))&&(n.remove(),n=o),n=o}if(B&&L[t]&&(B=!1),(r.removeEmpty||r.paddEmpty)&&b.isEmpty(O))if(r.paddEmpty)b.empty().append(new e("#text","3")).value="\xa0";else if(!b.attributes.map.name&&!b.attributes.map.id)return a=b.parent,T[b.name]?b.empty().remove():b.unwrap(),void(b=a);b=b.parent}}},l),y=b=new e(o.context||r.root_name,11),v.parse(t),S&&A.length&&(o.context?o.invalid=!0:c(A)),I&&("body"==y.name||o.isRootContent)&&a(),!o.invalid){for(k in p){for(N=d[k],C=p[k],_=C.length;_--;)C[_].parent||C.splice(_,1);for(x=0,w=N.length;w>x;x++)N[x](C,k,o)}for(x=0,w=f.length;w>x;x++)if(N=f[x],N.name in h){for(C=h[N.name],_=C.length;_--;)C[_].parent||C.splice(_,1);for(_=0,E=N.callbacks.length;E>_;_++)N.callbacks[_](C,N.name,o)}}return y},r.remove_trailing_brs&&u.addNodeFilter("br",function(t){var n,r=t.length,i,o=s({},l.getBlockElements()),a=l.getNonEmptyElements(),c,u,d,f,p,h;for(o.body=1,n=0;r>n;n++)if(i=t[n],c=i.parent,o[i.parent.name]&&i===c.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(),c.isEmpty(a)&&(p=l.getElementRule(c.name),p&&(p.removeEmpty?c.remove():p.paddEmpty&&(c.empty().append(new e("#text",3)).value="\xa0"))))}else{for(u=i;c&&c.firstChild===u&&c.lastChild===u&&(u=c,!o[c.name]);)c=c.parent;u===c&&(h=new e("#text",3),h.value="\xa0",i.replace(h))}}),r.allow_html_in_named_anchor||u.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.validate&&l.getValidClasses()&&u.addAttributeFilter("class",function(e){for(var t=e.length,n,r,i,o,a,s=l.getValidClasses(),c,u;t--;){for(n=e[t],r=n.attr("class").split(" "),a="",i=0;i<r.length;i++)o=r[i],u=!1,c=s["*"],c&&c[o]&&(u=!0),c=s[n.name],!u&&c&&c[o]&&(u=!0),u&&(a&&(a+=" "),a+=o);a.length||(a=null),n.attr("class",a)}})}}),r(S,[g,d],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),'"');!n||l?r[r.length]=">":r[r.length]=" />",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," ",s(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(T,[S,E],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(R,[y,k,g,T,_,E,u,d],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("data-mce-tabindex",function(e,t){for(var n=e.length,r;n--;)r=e[n],r.attr("tabindex",r.attributes.map["data-mce-tabindex"]),r.attr(t,null)}),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"),r&&(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.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,a;r--;)i=e[r],o=i.firstChild?i.firstChild.value:"","script"===t?(a=i.attr("type"),a&&i.attr("type","mce-no/type"==a?null:a.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,data-mce-expando,data-mce-type,data-mce-resize",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(A,[],function(){function e(e){function t(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 n(){function n(e){var n=t(o,e),r,i,s=0,l,c,u;if(r=n.node,i=n.offset,n.inside&&!r.hasChildNodes())return void a[e?"setStart":"setEnd"](r,0);if(i===c)return void a[e?"setStartBefore":"setEndAfter"](r);if(n.position<0){if(l=n.inside?r.firstChild:r.nextSibling,!l)return void a[e?"setStartAfter":"setEndAfter"](r);if(!i)return void(3==l.nodeType?a[e?"setStart":"setEnd"](l,0):a[e?"setStartBefore":"setEndBefore"](l));for(;l;){if(3==l.nodeType&&(u=l.nodeValue,s+=u.length,s>=i)){r=l,s-=i,s=u.length-s;break}l=l.nextSibling}}else{if(l=r.previousSibling,!l)return a[e?"setStartBefore":"setEndBefore"](r);if(!i)return void(3==r.nodeType?a[e?"setStart":"setEnd"](l,r.nodeValue.length):a[e?"setStartAfter":"setEndAfter"](l));for(;l;){if(3==l.nodeType&&(s+=l.nodeValue.length,s>=i)){r=l,s-=i;break}l=l.previousSibling}}a[e?"setStart":"setEnd"](r,s)}var o=e.getRng(),a=i.createRng(),s,l,c,u,d;if(s=o.item?o.item(0):o.parentElement(),s.ownerDocument!=i.doc)return a;if(l=e.isCollapsed(),o.item)return a.setStart(s.parentNode,i.nodeIndex(s)),a.setEnd(a.startContainer,a.startOffset+1),a;try{n(!0),l||n()}catch(f){if(-2147024809!=f.number)throw f;d=r.getBookmark(2),c=o.duplicate(),c.collapse(!0),s=c.parentElement(),l||(c=o.duplicate(),c.collapse(!1),u=c.parentElement(),u.innerHTML=u.innerHTML),s.innerHTML=s.innerHTML,r.moveToBookmark(d),o=e.getRng(),n(!0),l||n()}return a}var r=this,i=e.dom,o=!1;this.getBookmark=function(n){function r(e){var t,n,r,o,a=[];for(t=e.parentNode,n=i.getRoot().parentNode;t!=n&&9!==t.nodeType;){for(r=t.children,o=r.length;o--;)if(e===r[o]){a.push(o);break}e=t,t=t.parentNode}return a}function o(e){var n;return n=t(a,e),n?{position:n.position,offset:n.offset,indexes:r(n.node),inside:n.inside}:void 0}var a=e.getRng(),s={};return 2===n&&(a.item?s.start={ctrl:!0,indexes:r(a.item(0))}:(s.start=o(!0),e.isCollapsed()||(s.end=o()))),s},this.moveToBookmark=function(e){function t(e){var t,n,r,o;for(t=i.getRoot(),n=e.length-1;n>=0;n--)o=t.children,r=e[n],r<=o.length-1&&(t=o[r]);return t}function n(n){var i=e[n?"start":"end"],a,s,l,c;i&&(a=i.position>0,s=o.createTextRange(),s.moveToElementText(t(i.indexes)),c=i.offset,c!==l?(s.collapse(i.inside||a),s.moveStart("character",a?-c:c)):s.collapse(n),r.setEndPoint(n?"StartToStart":"EndToStart",s),n&&r.collapse(!0))}var r,o=i.doc.body;e.start&&(e.start.ctrl?(r=o.createControlRange(),r.addElement(t(e.start.indexes)),r.select()):(r=o.createTextRange(),n(!0),n(),r.select()))},this.addRange=function(t){function n(e){var t,n,a,d,h;a=i.create("a"),t=e?s:c,n=e?l:u,d=r.duplicate(),(t==f||t==f.documentElement)&&(t=p,n=0),3==t.nodeType?(t.parentNode.insertBefore(a,t),d.moveToElementText(a),d.moveStart("character",n),i.remove(a),r.setEndPoint(e?"StartToStart":"EndToEnd",d)):(h=t.childNodes,h.length?(n>=h.length?i.insertAfter(a,h[h.length-1]):t.insertBefore(a,h[n]),d.moveToElementText(a)):t.canHaveHTML&&(t.innerHTML="<span>&#xFEFF;</span>",a=t.firstChild,d.moveToElementText(a),d.collapse(o)),r.setEndPoint(e?"StartToStart":"EndToEnd",d),i.remove(a))}var r,a,s,l,c,u,d,f=e.dom.doc,p=f.body,h,m;if(s=t.startContainer,l=t.startOffset,c=t.endContainer,u=t.endOffset,r=p.createTextRange(),s==c&&1==s.nodeType){if(l==u&&!s.hasChildNodes()){if(s.canHaveHTML)return d=s.previousSibling,d&&!d.hasChildNodes()&&i.isBlock(d)?d.innerHTML="&#xFEFF;":d=null,s.innerHTML="<span>&#xFEFF;</span><span>&#xFEFF;</span>",r.moveToElementText(s.lastChild),r.select(),i.doc.selection.clear(),s.innerHTML="",void(d&&(d.innerHTML=""));l=i.nodeIndex(s),s=s.parentNode}if(l==u-1)try{if(m=s.childNodes[l],a=p.createControlRange(),a.addElement(m),a.select(),h=e.getRng(),h.item&&m===h.item(0))return}catch(g){}}n(!0),n(),r.select()},this.getRangeAt=n}return e}),r(B,[u],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||this.metaKeyPressed(e)},metaKeyPressed:function(t){return e.mac?t.metaKey:t.ctrlKey&&!t.altKey}}}),r(D,[B,d,u],function(e,t,n){return function(r,i){function o(e){var t=i.settings.object_resizing;return t===!1||n.iOS?!1:("string"!=typeof t&&(t="table,img,div"),"false"===e.getAttribute("data-mce-resize")?!1:i.dom.is(e,t))}function a(t){var n,r,o,a,s;n=t.screenX-T,r=t.screenY-R,P=n*k[2]+D,O=r*k[3]+M,P=5>P?5:P,O=5>O?5:O,o="IMG"==w.nodeName&&i.settings.resize_img_proportional!==!1?!e.modifierPressed(t):e.modifierPressed(t)||"IMG"==w.nodeName&&k[2]*k[3]!==0,o&&(W(n)>W(r)?(O=V(P*H),P=V(O/H)):(P=V(O/H),O=V(P*H))),C.setStyles(_,{width:P,height:O}),a=k.startPos.x+n,s=k.startPos.y+r,a=a>0?a:0,s=s>0?s:0,C.setStyles(E,{left:a,top:s,display:"block"}),E.innerHTML=P+" &times; "+O,k[2]<0&&_.clientWidth<=P&&C.setStyle(_,"left",A+(D-P)),k[3]<0&&_.clientHeight<=O&&C.setStyle(_,"top",B+(M-O)),n=U.scrollWidth-$,r=U.scrollHeight-q,n+r!==0&&C.setStyles(E,{left:a-n,top:s-r}),L||(i.fire("ObjectResizeStart",{target:w,width:D,height:M}),L=!0)}function s(){function e(e,t){t&&(w.style[e]||!i.schema.isValid(w.nodeName.toLowerCase(),e)?C.setStyle(w,e,t):C.setAttrib(w,e,t))}L=!1,e("width",P),e("height",O),C.unbind(I,"mousemove",a),C.unbind(I,"mouseup",s),F!=I&&(C.unbind(F,"mousemove",a),C.unbind(F,"mouseup",s)),C.remove(_),C.remove(E),z&&"TABLE"!=w.nodeName||l(w),i.fire("ObjectResized",{target:w,width:P,height:O}),C.setAttrib(w,"style",C.getAttrib(w,"style")),i.nodeChanged()}function l(e,t,r){var l,u,d,f,p;g(),l=C.getPos(e,U),A=l.x,B=l.y,p=e.getBoundingClientRect(),u=p.width||p.right-p.left,d=p.height||p.bottom-p.top,w!=e&&(m(),w=e,P=O=0),f=i.fire("ObjectSelected",{target:e}),o(e)&&!f.isDefaultPrevented()?x(N,function(e,i){function o(t){T=t.screenX,R=t.screenY,D=w.clientWidth,M=w.clientHeight,H=M/D,k=e,e.startPos={x:u*e[0]+A,y:d*e[1]+B},$=U.scrollWidth,q=U.scrollHeight,_=w.cloneNode(!0),C.addClass(_,"mce-clonedresizable"),C.setAttrib(_,"data-mce-bogus","all"),_.contentEditable=!1,_.unSelectabe=!0,C.setStyles(_,{left:A,top:B,margin:0}),_.removeAttribute("data-mce-selected"),U.appendChild(_),C.bind(I,"mousemove",a),C.bind(I,"mouseup",s),F!=I&&(C.bind(F,"mousemove",a),C.bind(F,"mouseup",s)),E=C.add(U,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},D+" &times; "+M)}var l,c;return t?void(i==t&&o(r)):(l=C.get("mceResizeHandle"+i),l?C.show(l):(c=U,l=C.add(c,"div",{id:"mceResizeHandle"+i,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+i+"-resize; margin:0; padding:0"}),n.ie&&(l.contentEditable=!1)),e.elm||(C.bind(l,"mousedown",function(e){e.stopImmediatePropagation(),e.preventDefault(),o(e)}),e.elm=l),void C.setStyles(l,{left:u*e[0]+A-l.offsetWidth/2,top:d*e[1]+B-l.offsetHeight/2}))}):c(),w.setAttribute("data-mce-selected","1")}function c(){var e,t;g(),w&&w.removeAttribute("data-mce-selected");for(e in N)t=C.get("mceResizeHandle"+e),t&&(C.unbind(t),C.remove(t))}function u(e){function t(e,t){if(e)do if(e===t)return!0;while(e=e.parentNode)}var n,i;if(!L)return x(C.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),i="mousedown"==e.type?e.target:r.getNode(),i=C.$(i).closest(z?"table":"table,img,hr")[0],t(i,U)&&(v(),n=r.getStart(!0),t(n,i)&&t(r.getEnd(!0),i)&&(!z||i!=n&&"IMG"!==n.nodeName))?void l(i):void c()}function d(e,t,n){e&&e.attachEvent&&e.attachEvent("on"+t,n)}function f(e,t,n){e&&e.detachEvent&&e.detachEvent("on"+t,n)}function p(e){var t=e.srcElement,n,r,o,a,s,c,u;n=t.getBoundingClientRect(),c=S.clientX-n.left,u=S.clientY-n.top;for(r in N)if(o=N[r],a=t.offsetWidth*o[0],s=t.offsetHeight*o[1],W(a-c)<8&&W(s-u)<8){k=o;break}L=!0,i.fire("ObjectResizeStart",{target:w,width:w.clientWidth,height:w.clientHeight}),i.getDoc().selection.empty(),l(t,r,S)}function h(e){var t=e.srcElement;if(t!=w){if(i.fire("ObjectSelected",{target:t}),m(),0===t.id.indexOf("mceResizeHandle"))return void(e.returnValue=!1);("IMG"==t.nodeName||"TABLE"==t.nodeName)&&(c(),w=t,d(t,"resizestart",p))}}function m(){f(w,"resizestart",p)}function g(){for(var e in N){var t=N[e];t.elm&&(C.unbind(t.elm),delete t.elm)}}function v(){try{i.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}}function y(e){var t;if(z){t=I.body.createControlRange();try{return t.addElement(e),t.select(),!0}catch(n){}}}function b(){w=_=null,z&&(m(),f(U,"controlselect",h))}var C=i.dom,x=t.each,w,_,E,N,k,S,T,R,A,B,D,M,H,L,P,O,I=i.getDoc(),F=document,z=n.ie&&n.ie<11,W=Math.abs,V=Math.round,U=i.getBody(),$,q;N={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 j=".mce-content-body";return i.contentStyles.push(j+" div.mce-resizehandle {position: absolute;border: 1px solid black;background: #FFF;width: 5px;height: 5px;z-index: 10000}"+j+" .mce-resizehandle:hover {background: #000}"+j+" img[data-mce-selected], hr[data-mce-selected] {outline: 1px solid black;resize: none}"+j+" .mce-clonedresizable {position: absolute;"+(n.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"+j+" .mce-resize-helper {background: #555;background: rgba(0,0,0,0.75);border-radius: 3px;border: 1px;color: white;display: none;font-family: sans-serif;font-size: 12px;white-space: nowrap;line-height: 14px;margin: 5px 10px;padding: 5px;position: absolute;z-index: 10001}"),i.on("init",function(){z?(i.on("ObjectResized",function(e){"TABLE"!=e.target.nodeName&&(c(),y(e.target))}),d(U,"controlselect",h),i.on("mousedown",function(e){S=e})):(v(),n.ie>=11&&(i.on("mouseup",function(e){var t=e.target.nodeName;!L&&/^(TABLE|IMG|HR)$/.test(t)&&(i.selection.select(e.target,"TABLE"==t),i.nodeChanged())}),i.dom.bind(U,"mscontrolselect",function(e){/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"==e.target.tagName&&window.setTimeout(function(){i.selection.select(e.target)},0))}))),i.on("nodechange ResizeEditor",u),i.on("keydown keyup",function(e){w&&"TABLE"==w.nodeName&&u(e)}),i.on("hide",c)}),i.on("remove",g),{isResizable:o,showResizeRect:l,hideResizeRect:c,updateResizeRect:u,
+controlSelect:y,destroy:b}}}),r(M,[u,d],function(e,t){function n(n){var r=n.dom;this.getBookmark=function(e,i){function o(e,n){var i=0;return t.each(r.select(e),function(e,t){e==n&&(i=t)}),i}function a(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 s(){function e(e,t){var n=e[t?"startContainer":"endContainer"],a=e[t?"startOffset":"endOffset"],s=[],l,c,u=0;if(3==n.nodeType){if(i)for(l=n.previousSibling;l&&3==l.nodeType;l=l.previousSibling)a+=l.nodeValue.length;s.push(a)}else c=n.childNodes,a>=c.length&&c.length&&(u=1,a=Math.max(0,c.length-1)),s.push(r.nodeIndex(c[a],i)+u);for(;n&&n!=o;n=n.parentNode)s.push(r.nodeIndex(n,i));return s}var t=n.getRng(!0),o=r.getRoot(),a={};return a.start=e(t,!0),n.isCollapsed()||(a.end=e(t)),a}var l,c,u,d,f,p,h="&#xFEFF;",m;if(2==e)return p=n.getNode(),f=p?p.nodeName:null,"IMG"==f?{name:f,index:o(f,p)}:n.tridentSel?n.tridentSel.getBookmark(e):s();if(e)return{rng:n.getRng()};if(l=n.getRng(),u=r.uniqueId(),d=n.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:o(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>"))}catch(g){return null}}else{if(p=n.getNode(),f=p.nodeName,"IMG"==f)return{name:f,index:o(f,p)};c=a(l.cloneRange()),d||(c.collapse(!1),c.insertNode(r.create("span",{"data-mce-type":"bookmark",id:u+"_end",style:m},h))),l=a(l),l.collapse(!0),l.insertNode(r.create("span",{"data-mce-type":"bookmark",id:u+"_start",style:m},h))}return n.moveToBookmark({id:u,keep:1}),{id:u}},this.moveToBookmark=function(i){function o(e){var t=i[e?"start":"end"],n,r,o,a;if(t){for(o=t[0],r=c,n=t.length-1;n>=1;n--){if(a=r.childNodes,t[n]>a.length-1)return;r=a[t[n]]}3===r.nodeType&&(o=Math.min(t[0],r.nodeValue.length)),1===r.nodeType&&(o=Math.min(t[0],r.childNodes.length)),e?l.setStart(r,o):l.setEnd(r,o)}return!0}function a(n){var o=r.get(i.id+"_"+n),a,s,l,c,h=i.keep;if(o&&(a=o.parentNode,"start"==n?(h?(a=o.firstChild,s=1):s=r.nodeIndex(o),u=d=a,f=p=s):(h?(a=o.firstChild,s=1):s=r.nodeIndex(o),d=a,p=s),!h)){for(c=o.previousSibling,l=o.nextSibling,t.each(t.grep(o.childNodes),function(e){3==e.nodeType&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});o=r.get(i.id+"_"+n);)r.remove(o,1);c&&l&&c.nodeType==l.nodeType&&3==c.nodeType&&!e.opera&&(s=c.nodeValue.length,c.appendData(l.nodeValue),r.remove(l),"start"==n?(u=d=c,f=p=s):(d=c,p=s))}}function s(t){return!r.isBlock(t)||t.innerHTML||e.ie||(t.innerHTML='<br data-mce-bogus="1" />'),t}var l,c,u,d,f,p;if(i)if(i.start){if(l=r.createRng(),c=r.getRoot(),n.tridentSel)return n.tridentSel.moveToBookmark(i);o(!0)&&o()&&n.setRng(l)}else i.id?(a("start"),a("end"),u&&(l=r.createRng(),l.setStart(s(u),f),l.setEnd(s(d),p),n.setRng(l))):i.name?n.select(r.select(i.name)[i.index]):i.rng&&n.setRng(i.rng)}}return n.isBookmarkNode=function(e){return e&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},n}),r(H,[h,A,D,x,M,u,d],function(e,n,r,i,o,a,s){function l(e,t,i,a){var s=this;s.dom=e,s.win=t,s.serializer=i,s.editor=a,s.bookmarkManager=new o(s),s.controlSelection=new r(s,a),s.win.getSelection||(s.tridentSel=new n(s))}var c=s.each,u=s.trim,d=a.ie;return l.prototype={setCursorLocation:function(e,t){var n=this,r=n.dom.createRng();e?(r.setStart(e,t),r.setEnd(e,t),n.setRng(r),n.collapse(!1)):(n._moveEndPoint(r,n.editor.getBody(),!0),n.setRng(r))},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.toString():""):(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.toString(),/^\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(e){var t=this,n=t.getRng(),r,i,o,a;if(n.duplicate||n.item){if(n.item)return n.item(0);for(o=n.duplicate(),o.collapse(1),r=o.parentElement(),r.ownerDocument!==t.dom.doc&&(r=t.dom.getRoot()),i=a=n.parentElement();a=a.parentNode;)if(a==r){r=i;break}return r}return r=n.startContainer,1==r.nodeType&&r.hasChildNodes()&&(e&&n.collapsed||(r=r.childNodes[Math.min(r.childNodes.length-1,n.startOffset)])),r&&3==r.nodeType?r.parentNode:r},getEnd:function(e){var t=this,n=t.getRng(),r,i;return n.duplicate||n.item?n.item?n.item(0):(n=n.duplicate(),n.collapse(0),r=n.parentElement(),r.ownerDocument!==t.dom.doc&&(r=t.dom.getRoot()),r&&"BODY"==r.nodeName?r.lastChild||r:r):(r=n.endContainer,i=n.endOffset,1==r.nodeType&&r.hasChildNodes()&&(e&&n.collapsed||(r=r.childNodes[i>0?i-1:i])),r&&3==r.nodeType?r.parentNode:r)},getBookmark:function(e,t){return this.bookmarkManager.getBookmark(e,t)},moveToBookmark:function(e){return this.bookmarkManager.moveToBookmark(e)},select:function(e,t){var n=this,r=n.dom,i=r.createRng(),o;if(n.lastFocusBookmark=null,e){if(!t&&n.controlSelection.controlSelect(e))return;o=r.nodeIndex(e),i.setStart(e.parentNode,o),i.setEnd(e.parentNode,o+1),t&&(n._moveEndPoint(i,e,!0),n._moveEndPoint(i,e)),n.setRng(i)}return e},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){function t(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}}var n=this,r,i,o,a=n.win.document,s;if(!e&&n.lastFocusBookmark){var l=n.lastFocusBookmark;return l.startContainer?(i=a.createRange(),i.setStart(l.startContainer,l.startOffset),i.setEnd(l.endContainer,l.endOffset)):i=l,i}if(e&&n.tridentSel)return n.tridentSel.getRangeAt(0);try{(r=n.getSel())&&(i=r.rangeCount>0?r.getRangeAt(0):r.createRange?r.createRange():a.createRange())}catch(c){}if(d&&i&&i.setStart&&a.selection){try{s=a.selection.createRange()}catch(c){}s&&s.item&&(o=s.item(0),i=a.createRange(),i.setStartBefore(o),i.setEndAfter(o))}return i||(i=a.createRange?a.createRange():a.body.createTextRange()),i.setStart&&9===i.startContainer.nodeType&&i.collapsed&&(o=n.dom.getRoot(),i.setStart(o,0),i.setEnd(o,0)),n.selectedRange&&n.explicitRange&&(0===t(i.START_TO_START,i,n.selectedRange)&&0===t(i.END_TO_END,i,n.selectedRange)?i=n.explicitRange:(n.selectedRange=null,n.explicitRange=null)),i},setRng:function(e,t){var n=this,r;if(e)if(e.select)try{e.select()}catch(i){}else if(n.tridentSel){if(e.cloneRange)try{return void n.tridentSel.addRange(e)}catch(i){}}else if(r=n.getSel()){n.explicitRange=e;try{r.removeAllRanges(),r.addRange(e)}catch(i){}t===!1&&r.extend&&(r.collapse(e.endContainer,e.endOffset),r.extend(e.startContainer,e.startOffset)),n.selectedRange=r.rangeCount>0?r.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,l=t.dom.getRoot();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):(r=n.item?n.item(0):n.parentElement(),r.ownerDocument!==t.win.document&&(r=l),r):l},getSelectedBlocks:function(t,n){var r=this,i=r.dom,o,a,s=[];if(a=i.getRoot(),t=i.getParent(t||r.getStart(),i.isBlock),n=i.getParent(n||r.getEnd(),i.isBlock),t&&t!=a&&s.push(t),t&&n&&t!=n){o=t;for(var l=new e(t,a);(o=l.next())&&o!=n;)i.isBlock(o)&&s.push(o)}return n&&t!=n&&n!=a&&s.push(n),s},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),n.compareBoundaryPoints(n.START_TO_START,r)<=0):!0},normalize:function(){var e=this,t=e.getRng();return a.range&&new i(e.dom).normalize(t)&&e.setRng(t,e.isForward()),t},selectorChanged:function(e,t){var n=this,r;return n.selectorChangedData||(n.selectorChangedData={},r={},n.editor.on("NodeChange",function(e){var t=e.element,i=n.dom,o=i.getParents(t,null,i.getRoot()),a={};c(n.selectorChangedData,function(e,t){c(o,function(n){return i.is(n,t)?(r[t]||(c(e,function(e){e(!0,{node:n,selector:t,parents:o})}),r[t]=e),a[t]=e,!1):void 0})}),c(r,function(e,n){a[n]||(delete r[n],c(e,function(e){e(!1,{node:t,selector:n,parents:o})}))})})),n.selectorChangedData[e]||(n.selectorChangedData[e]=[]),n.selectorChangedData[e].push(t),n},getScrollContainer:function(){for(var e,t=this.dom.getRoot();t&&"BODY"!=t.nodeName;){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e){function t(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}}var n,r,i=this,o=i.dom,a=o.getRoot(),s,l;if("BODY"!=a.nodeName){var c=i.getScrollContainer();if(c)return n=t(e).y-t(c).y,l=c.clientHeight,s=c.scrollTop,void((s>n||n+25>s+l)&&(c.scrollTop=s>n?n:n-l+25))}r=o.getViewPort(i.editor.getWin()),n=o.getPos(e).y,s=r.y,l=r.h,(n<r.y||n+25>s+l)&&i.editor.getWin().scrollTo(0,s>n?n:n-l+25)},placeCaretAt:function(e,t){var n=this.editor.getDoc(),r,i;if(n.caretPositionFromPoint)i=n.caretPositionFromPoint(e,t),r=n.createRange(),r.setStart(i.offsetNode,i.offset),r.collapse(!0);else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(n.body.createTextRange){r=n.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(o){r.collapse(t<n.body.clientHeight)}}this.setRng(r)},_moveEndPoint:function(t,n,r){var i=n,o=new e(n,i),s=this.dom.schema.getNonEmptyElements();do{if(3==n.nodeType&&0!==u(n.nodeValue).length)return void(r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length));if(s[n.nodeName]&&!/^(TD|TH)$/.test(n.nodeName))return void(r?t.setStartBefore(n):"BR"==n.nodeName?t.setEndBefore(n):t.setEndAfter(n));if(a.ie&&a.ie<11&&this.dom.isBlock(n)&&this.dom.isEmpty(n))return void(r?t.setStart(n,0):t.setEnd(n,0))}while(n=r?o.next():o.prev());"BODY"==i.nodeName&&(r?t.setStart(i,0):t.setEnd(i,i.childNodes.length))},destroy:function(){this.win=null,this.controlSelection.destroy()}},l}),r(L,[M,d],function(e,t){function n(t){this.compare=function(n,i){function o(e){var n={};return r(t.getAttribs(e),function(r){var i=r.nodeName.toLowerCase();0!==i.indexOf("_")&&"style"!==i&&"data-mce-style"!==i&&(n[i]=t.getAttrib(e,i))}),n}function a(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(n=t[r],"undefined"==typeof n)return!1;if(e[r]!=n)return!1;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return!1;return!0}return n.nodeName!=i.nodeName?!1:a(o(n),o(i))&&a(t.parseStyle(t.getAttrib(n,"style")),t.parseStyle(t.getAttrib(i,"style")))?!e.isBookmarkNode(n)&&!e.isBookmarkNode(i):!1}}var r=t.each;return n}),r(P,[d],function(e){function t(e,t){function r(e){return e.replace(/%(\w+)/g,"")}var i,o,a=e.dom,s="",l,c;if(c=e.settings.preview_styles,c===!1)return"";if(c||(c="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"),"string"==typeof t){if(t=e.formatter.get(t),!t)return;t=t[0]}return i=t.block||t.inline||"span",o=a.create(i),n(t.styles,function(e,t){e=r(e),e&&a.setStyle(o,t,e)}),n(t.attributes,function(e,t){e=r(e),e&&a.setAttrib(o,t,e)}),n(t.classes,function(e){e=r(e),a.hasClass(o,e)||a.addClass(o,e)}),e.fire("PreviewFormats"),a.setStyles(o,{position:"absolute",left:-65535}),e.getBody().appendChild(o),l=a.getStyle(e.getBody(),"fontSize",!0),l=/px$/.test(l)?parseInt(l,10):0,n(c.split(" "),function(t){var n=a.getStyle(o,t,!0);if(!("background-color"==t&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=a.getStyle(e.getBody(),t,!0),"#ffffff"==a.toHex(n).toLowerCase())||"color"==t&&"#000000"==a.toHex(n).toLowerCase())){if("font-size"==t&&/em|%$/.test(n)){if(0===l)return;n=parseFloat(n,10)/(/%$/.test(n)?100:1),n=n*l+"px"}"border"==t&&n&&(s+="padding:0 2px;"),s+=t+":"+n+";"}}),e.fire("AfterPreviewFormats"),a.remove(o),s}var n=e.each;return{getCssText:t}}),r(O,[h,x,M,L,d,P],function(e,t,n,r,i,o){return function(a){function s(e){return e.nodeType&&(e=e.nodeName),!!a.schema.getTextBlockElements()[e.toLowerCase()]}function l(e){return/^(TH|TD)$/.test(e.nodeName)}function c(e,t){return $.getParents(e,t,$.getRoot())}function u(e){return 1===e.nodeType&&"_mce_caret"===e.id}function d(){h({valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],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"},links:!0,remove_similar:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0},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){se(n,function(t,n){$.setAttrib(e,n,t)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",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}]}),se("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),function(e){h(e,{block:e,remove:"all"})}),h(a.settings.formats)}function f(){a.addShortcut("meta+b","bold_desc","Bold"),a.addShortcut("meta+i","italic_desc","Italic"),a.addShortcut("meta+u","underline_desc","Underline");for(var e=1;6>=e;e++)a.addShortcut("access+"+e,"",["FormatBlock",!1,"h"+e]);a.addShortcut("access+7","",["FormatBlock",!1,"p"]),a.addShortcut("access+8","",["FormatBlock",!1,"div"]),a.addShortcut("access+9","",["FormatBlock",!1,"address"])}function p(e){return e?U[e]:U}function h(e,t){e&&("string"!=typeof e?se(e,function(e,t){h(t,e)}):(t=t.length?t:[t],se(t,function(e){e.deep===ne&&(e.deep=!e.selector),e.split===ne&&(e.split=!e.selector||e.inline),e.remove===ne&&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+/))}),U[e]=t))}function m(e){return e&&U[e]&&delete U[e],U}function g(e){var t;return a.dom.getParent(e,function(e){return t=a.dom.getStyle(e,"text-decoration"),t&&"none"!==t}),t}function v(e){var t;1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType&&(t=g(e.parentNode),a.dom.getStyle(e,"color")&&t?a.dom.setStyle(e,"text-decoration",t):a.dom.getStyle(e,"text-decoration")===t&&a.dom.setStyle(e,"text-decoration",null))}function y(t,n,r){function i(e,t){if(t=t||d,e){if(t.onformat&&t.onformat(e,t,n,r),se(t.styles,function(t,r){$.setStyle(e,r,B(t,n))}),t.styles){var i=$.getAttrib(e,"style");i&&e.setAttribute("data-mce-style",i)}se(t.attributes,function(t,r){$.setAttrib(e,r,B(t,n))}),se(t.classes,function(t){t=B(t,n),$.hasClass(e,t)||$.addClass(e,t)})}}function o(){function t(t,n){var i=new e(n);for(r=i.current();r;r=i.prev())if(r.childNodes.length>1||r==t||"BR"==r.tagName)return r}var n=a.selection.getRng(),i=n.startContainer,o=n.endContainer;if(i!=o&&0===n.endOffset){var s=t(i,o),l=3==s.nodeType?s.length:s.childNodes.length;n.setEnd(s,l)}return n}function l(e,r,o){var a=[],l,f,p=!0;l=d.inline||d.block,f=$.create(l),i(f),j.walk(e,function(e){function r(e){var g,v,y,b,C;return C=p,g=e.nodeName.toLowerCase(),v=e.parentNode.nodeName.toLowerCase(),1===e.nodeType&&re(e)&&(C=p,p="true"===re(e),b=!0),T(g,"br")?(h=0,void(d.block&&$.remove(e))):d.wrapper&&x(e,t,n)?void(h=0):p&&!b&&d.block&&!d.wrapper&&s(g)&&K(v,l)?(e=$.rename(e,l),i(e),a.push(e),void(h=0)):d.selector&&(se(c,function(t){"collapsed"in t&&t.collapsed!==m||$.is(e,t.selector)&&!u(e)&&(i(e,t),y=!0)}),!d.inline||y)?void(h=0):void(!p||b||!K(l,g)||!K(v,l)||!o&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||u(e)||d.inline&&Y(e)?(h=0,se(le(e.childNodes),r),b&&(p=C),h=0):(h||(h=$.clone(f,Z),e.parentNode.insertBefore(h,e),a.push(h)),h.appendChild(e)))}var h;se(e,r)}),d.links===!0&&se(a,function(e){function t(e){"A"===e.nodeName&&i(e,d),se(le(e.childNodes),t)}t(e)}),se(a,function(e){function r(e){var t=0;return se(e.childNodes,function(e){D(e)||ae(e)||t++}),t}function o(e){var t,n;return se(e.childNodes,function(e){return 1!=e.nodeType||ae(e)||u(e)?void 0:(t=e,Z)}),t&&!ae(t)&&S(t,d)&&(n=$.clone(t,Z),i(n),$.replace(n,e,ee),$.remove(t,1)),n||e}var s;if(s=r(e),(a.length>1||!Y(e))&&0===s)return void $.remove(e,1);if(d.inline||d.wrapper){if(d.exact||1!==s||(e=o(e)),se(c,function(t){se($.select(t.inline,e),function(e){ae(e)||P(t,n,e,t.exact?e:null)})}),x(e.parentNode,t,n))return $.remove(e,1),e=0,ee;d.merge_with_parents&&$.getParent(e.parentNode,function(r){return x(r,t,n)?($.remove(e,1),e=0,ee):void 0}),e&&d.merge_siblings!==!1&&(e=F(I(e),e),e=F(e,I(e,ee)))}})}var c=p(t),d=c[0],f,h,m=!r&&q.isCollapsed();if(d)if(r)r.nodeType?(h=$.createRng(),h.setStartBefore(r),h.setEndAfter(r),l(H(h,c),null,!0)):l(r,null,!0);else if(m&&d.inline&&!$.select("td.mce-item-selected,th.mce-item-selected").length)W("apply",t,n);else{var g=a.selection.getNode();G||!c[0].defaultBlock||$.getParent(g,$.isBlock)||y(c[0].defaultBlock),a.selection.setRng(o()),f=q.getBookmark(),l(H(q.getRng(ee),c),f),d.styles&&(d.styles.color||d.styles.textDecoration)&&(ce(g,v,"childNodes"),v(g)),q.moveToBookmark(f),V(q.getRng(ee)),a.nodeChanged()}}function b(e,t,n,r){function i(e){var n,r,o,a,s;if(1===e.nodeType&&re(e)&&(a=b,b="true"===re(e),s=!0),n=le(e.childNodes),b&&!s)for(r=0,o=h.length;o>r&&!P(h[r],t,e,e);r++);if(m.deep&&n.length){for(r=0,o=n.length;o>r;r++)i(n[r]);s&&(b=a)}}function o(n){var i;return se(c(n.parentNode).reverse(),function(n){var o;i||"_start"==n.id||"_end"==n.id||(o=x(n,e,t,r),o&&o.split!==!1&&(i=n))}),i}function s(e,n,r,i){var o,a,s,l,c,u;if(e){for(u=e.parentNode,o=n.parentNode;o&&o!=u;o=o.parentNode){for(a=$.clone(o,Z),c=0;c<h.length;c++)if(P(h[c],t,a,a)){a=0;break}a&&(s&&a.appendChild(s),l||(l=a),s=a)}!i||m.mixed&&Y(e)||(n=$.split(e,n)),s&&(r.parentNode.insertBefore(s,r),l.appendChild(r))}return n}function u(e){return s(o(e),e,e,!0)}function d(e){var t=$.get(e?"_start":"_end"),n=t[e?"firstChild":"lastChild"];return ae(n)&&(n=n[e?"firstChild":"lastChild"]),3==n.nodeType&&0===n.data.length&&(n=e?t.previousSibling||t.nextSibling:t.nextSibling||t.previousSibling),$.remove(t,!0),n}function f(e){var t,n,r=e.commonAncestorContainer;if(e=H(e,h,ee),m.split){if(t=z(e,ee),n=z(e),t!=n){if(/^(TR|TH|TD)$/.test(t.nodeName)&&t.firstChild&&(t="TR"==t.nodeName?t.firstChild.firstChild||t:t.firstChild||t),r&&/^T(HEAD|BODY|FOOT|R)$/.test(r.nodeName)&&l(n)&&n.firstChild&&(n=n.firstChild||n),$.isChildOf(t,n)&&!l(t)&&!l(n))return t=M(t,"span",{id:"_start","data-mce-type":"bookmark"}),u(t),void(t=d(ee));t=M(t,"span",{id:"_start","data-mce-type":"bookmark"}),n=M(n,"span",{id:"_end","data-mce-type":"bookmark"}),u(t),u(n),t=d(ee),n=d()}else t=n=u(t);e.startContainer=t.parentNode?t.parentNode:t,e.startOffset=X(t),e.endContainer=n.parentNode?n.parentNode:n,e.endOffset=X(n)+1}j.walk(e,function(e){se(e,function(e){i(e),1===e.nodeType&&"underline"===a.dom.getStyle(e,"text-decoration")&&e.parentNode&&"underline"===g(e.parentNode)&&P({deep:!1,exact:!0,inline:"span",styles:{textDecoration:"underline"}},null,e)})})}var h=p(e),m=h[0],v,y,b=!0;return n?void(n.nodeType?(y=$.createRng(),y.setStartBefore(n),y.setEndAfter(n),f(y)):f(n)):void(q.isCollapsed()&&m.inline&&!$.select("td.mce-item-selected,th.mce-item-selected").length?W("remove",e,t,r):(v=q.getBookmark(),f(q.getRng(ee)),q.moveToBookmark(v),m.inline&&w(e,t,q.getStart())&&V(q.getRng(!0)),a.nodeChanged()))}function C(e,t,n){var r=p(e);!w(e,t,n)||"toggle"in r[0]&&!r[0].toggle?y(e,t,n):b(e,t,n)}function x(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===ne){for(o in s)if(s.hasOwnProperty(o)){if(a="attributes"===i?$.getAttrib(e,o):R(e,o),r&&!a&&!t.exact)return;if((!r||t.exact)&&!T(a,A(B(s[o],n),o)))return}}else for(l=0;l<s.length;l++)if("attributes"===i?$.getAttrib(e,s[l]):R(e,s[l]))return t;return t}var o=p(t),a,s,l;if(o&&e)for(s=0;s<o.length;s++)if(a=o[s],S(e,a)&&i(e,a,"attributes")&&i(e,a,"styles")){if(l=a.classes)for(s=0;s<l.length;s++)if(!$.hasClass(e,l[s]))return;return a}}function w(e,t,n){function r(n){var r=$.getRoot();return n===r?!1:(n=$.getParent(n,function(n){return n.parentNode===r||!!x(n,e,t,!0)}),x(n,e,t))}var i;return n?r(n):(n=q.getNode(),r(n)?ee:(i=q.getStart(),i!=n&&r(i)?ee:Z))}function _(e,t){var n,r=[],i={};return n=q.getStart(),$.getParent(n,function(n){var o,a;for(o=0;o<e.length;o++)a=e[o],!i[a]&&x(n,a,t)&&(i[a]=!0,r.push(a))},$.getRoot()),r}function E(e){var t=p(e),n,r,i,o,a;if(t)for(n=q.getStart(),r=c(n),o=t.length-1;o>=0;o--){if(a=t[o].selector,!a||t[o].defaultBlock)return ee;for(i=r.length-1;i>=0;i--)if($.is(r[i],a))return ee}return Z}function N(e,t,n){var r;return te||(te={},r={},a.on("NodeChange",function(e){var t=c(e.element),n={};t=i.grep(t,function(e){return 1==e.nodeType&&!e.getAttribute("data-mce-bogus")}),se(te,function(e,i){se(t,function(o){return x(o,i,{},e.similar)?(r[i]||(se(e,function(e){e(!0,{node:o,format:i,parents:t})}),r[i]=e),n[i]=e,!1):void 0})}),se(r,function(i,o){n[o]||(delete r[o],se(i,function(n){n(!1,{node:e.element,format:o,parents:t})}))})})),se(e.split(","),function(e){te[e]||(te[e]=[],te[e].similar=n),te[e].push(t)}),this}function k(e){return o.getCssText(a,e)}function S(e,t){return T(e,t.inline)?ee:T(e,t.block)?ee:t.selector?1==e.nodeType&&$.is(e,t.selector):void 0}function T(e,t){return e=e||"",t=t||"",e=""+(e.nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()==t.toLowerCase()}function R(e,t){return A($.getStyle(e,t),t)}function A(e,t){return("color"==t||"backgroundColor"==t)&&(e=$.toHex(e)),"fontWeight"==t&&700==e&&(e="bold"),"fontFamily"==t&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e}function B(e,t){return"string"!=typeof e?e=e(t):t&&(e=e.replace(/%(\w+)/g,function(e,n){return t[n]||e})),e}function D(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)}function M(e,t,n){var r=$.create(t,n);return e.parentNode.insertBefore(r,e),r.appendChild(e),r}function H(t,n,r){function i(e){function t(e){return"BR"==e.nodeName&&e.getAttribute("data-mce-bogus")&&!e.nextSibling}var r,i,o,a,s;if(r=i=e?g:y,a=e?"previousSibling":"nextSibling",s=$.getRoot(),3==r.nodeType&&!D(r)&&(e?v>0:b<r.nodeValue.length))return r;for(;;){if(!n[0].block_expand&&Y(i))return i;for(o=i[a];o;o=o[a])if(!ae(o)&&!D(o)&&!t(o))return i;if(i.parentNode==s){r=i;break}i=i.parentNode}return r}function o(e,t){for(t===ne&&(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 l(e){for(var t=e;t;){if(1===t.nodeType&&re(t))return"false"===re(t)?t:e;t=t.parentNode}return e}function u(t,n,i){function o(e,t){var n,o,a=e.nodeValue;return"undefined"==typeof t&&(t=i?a.length:0),i?(n=a.lastIndexOf(" ",t),o=a.lastIndexOf("\xa0",t),n=n>o?n:o,-1===n||r||n++):(n=a.indexOf(" ",t),o=a.indexOf("\xa0",t),n=-1!==n&&(-1===o||o>n)?n:o),n}var s,l,c,u;if(3===t.nodeType){if(c=o(t,n),-1!==c)return{container:t,offset:c};u=t}for(s=new e(t,$.getParent(t,Y)||a.getBody());l=s[i?"prev":"next"]();)if(3===l.nodeType){if(u=l,c=o(l),-1!==c)return{container:l,offset:c}}else if(Y(l))break;return u?(n=i?0:u.length,{container:u,offset:n}):void 0}function d(e,r){var i,o,a,s;for(3==e.nodeType&&0===e.nodeValue.length&&e[r]&&(e=e[r]),i=c(e),o=0;o<i.length;o++)for(a=0;a<n.length;a++)if(s=n[a],!("collapsed"in s&&s.collapsed!==t.collapsed)&&$.is(i[o],s.selector))return i[o];return e}function f(e,t){var r,i=$.getRoot();if(n[0].wrapper||(r=$.getParent(e,n[0].block,i)),r||(r=$.getParent(3==e.nodeType?e.parentNode:e,function(e){return e!=i&&s(e)})),r&&n[0].wrapper&&(r=c(r,"ul,ol").reverse()[0]||r),!r)for(r=e;r[t]&&!Y(r[t])&&(r=r[t],!T(r,"br")););return r||e}var p,h,m,g=t.startContainer,v=t.startOffset,y=t.endContainer,b=t.endOffset;if(1==g.nodeType&&g.hasChildNodes()&&(p=g.childNodes.length-1,g=g.childNodes[v>p?p:v],3==g.nodeType&&(v=0)),1==y.nodeType&&y.hasChildNodes()&&(p=y.childNodes.length-1,y=y.childNodes[b>p?p:b-1],3==y.nodeType&&(b=y.nodeValue.length)),g=l(g),y=l(y),(ae(g.parentNode)||ae(g))&&(g=ae(g)?g:g.parentNode,g=g.nextSibling||g,3==g.nodeType&&(v=0)),(ae(y.parentNode)||ae(y))&&(y=ae(y)?y:y.parentNode,y=y.previousSibling||y,3==y.nodeType&&(b=y.length)),n[0].inline&&(t.collapsed&&(m=u(g,v,!0),m&&(g=m.container,v=m.offset),m=u(y,b),m&&(y=m.container,b=m.offset)),h=o(y,b),h.node)){for(;h.node&&0===h.offset&&h.node.previousSibling;)h=o(h.node.previousSibling);h.node&&h.offset>0&&3===h.node.nodeType&&" "===h.node.nodeValue.charAt(h.offset-1)&&h.offset>1&&(y=h.node,y.splitText(h.offset-1))}return(n[0].inline||n[0].block_expand)&&(n[0].inline&&3==g.nodeType&&0!==v||(g=i(!0)),n[0].inline&&3==y.nodeType&&b!==y.nodeValue.length||(y=i())),n[0].selector&&n[0].expand!==Z&&!n[0].inline&&(g=d(g,"previousSibling"),y=d(y,"nextSibling")),(n[0].block||n[0].selector)&&(g=f(g,"previousSibling"),y=f(y,"nextSibling"),n[0].block&&(Y(g)||(g=i(!0)),Y(y)||(y=i()))),1==g.nodeType&&(v=X(g),g=g.parentNode),1==y.nodeType&&(b=X(y)+1,y=y.parentNode),{startContainer:g,startOffset:v,endContainer:y,endOffset:b}}function L(e,t){return t.links&&"A"==e.tagName}function P(e,t,n,r){var i,o,a;if(!S(n,e)&&!L(n,e))return Z;if("all"!=e.remove)for(se(e.styles,function(i,o){i=A(B(i,t),o),"number"==typeof o&&(o=i,r=0),(e.remove_similar||!r||T(R(r,o),i))&&$.setStyle(n,o,""),a=1}),a&&""===$.getAttrib(n,"style")&&(n.removeAttribute("style"),n.removeAttribute("data-mce-style")),se(e.attributes,function(e,i){var o;if(e=B(e,t),"number"==typeof i&&(i=e,r=0),!r||T($.getAttrib(r,i),e)){if("class"==i&&(e=$.getAttrib(n,i),e&&(o="",se(e.split(/\s+/),function(e){/mce\-\w+/.test(e)&&(o+=(o?" ":"")+e)}),o)))return void $.setAttrib(n,i,o);"class"==i&&n.removeAttribute("className"),Q.test(i)&&n.removeAttribute("data-mce-"+i),n.removeAttribute(i)}}),se(e.classes,function(e){e=B(e,t),(!r||$.hasClass(r,e))&&$.removeClass(n,e)}),o=$.getAttribs(n),i=0;i<o.length;i++)if(0!==o[i].nodeName.indexOf("_"))return Z;return"none"!=e.remove?(O(n,e),ee):void 0}function O(e,t){function n(e,t,n){return e=I(e,t,n),!e||"BR"==e.nodeName||Y(e)}var r=e.parentNode,i;t.block&&(G?r==$.getRoot()&&(t.list_block&&T(e,t.list_block)||se(le(e.childNodes),function(e){K(G,e.nodeName.toLowerCase())?i?i.appendChild(e):(i=M(e,G),$.setAttribs(i,a.settings.forced_root_block_attrs)):i=0})):Y(e)&&!Y(r)&&(n(e,Z)||n(e.firstChild,ee,1)||e.insertBefore($.create("br"),e.firstChild),n(e,ee)||n(e.lastChild,Z,1)||e.appendChild($.create("br")))),t.selector&&t.inline&&!T(t.inline,e)||$.remove(e,1)}function I(e,t,n){if(e)for(t=t?"nextSibling":"previousSibling",e=n?e:e[t];e;e=e[t])if(1==e.nodeType||!D(e))return e}function F(e,t){function n(e,t){for(i=e;i;i=i[t]){if(3==i.nodeType&&0!==i.nodeValue.length)return e;if(1==i.nodeType&&!ae(i))return i}return e}var i,o,a=new r($);if(e&&t&&(e=n(e,"previousSibling"),t=n(t,"nextSibling"),a.compare(e,t))){for(i=e.nextSibling;i&&i!=t;)o=i,i=i.nextSibling,e.appendChild(o);return $.remove(t),se(le(t.childNodes),function(t){e.appendChild(t)}),e}return t}function z(t,n){var r,i,o;return r=t[n?"startContainer":"endContainer"],i=t[n?"startOffset":"endOffset"],1==r.nodeType&&(o=r.childNodes.length-1,!n&&i&&i--,r=r.childNodes[i>o?o:i]),3===r.nodeType&&n&&i>=r.nodeValue.length&&(r=new e(r,a.getBody()).next()||r),3!==r.nodeType||n||0!==i||(r=new e(r,a.getBody()).prev()||r),r}function W(t,n,r,i){function o(e){var t=$.create("span",{id:g,"data-mce-bogus":!0,style:v?"color:red":""});return e&&t.appendChild(a.getDoc().createTextNode(J)),t}function l(e,t){for(;e;){if(3===e.nodeType&&e.nodeValue!==J||e.childNodes.length>1)return!1;t&&1===e.nodeType&&t.push(e),e=e.firstChild}return!0}function c(e){for(;e;){if(e.id===g)return e;e=e.parentNode}}function u(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 d(e,t){var n,r;if(e)r=q.getRng(!0),l(e)?(t!==!1&&(r.setStartBefore(e),r.setEndBefore(e)),$.remove(e)):(n=u(e),n.nodeValue.charAt(0)===J&&(n.deleteData(0,1),r.startContainer==n&&r.startOffset>0&&r.setStart(n,r.startOffset-1),r.endContainer==n&&r.endOffset>0&&r.setEnd(n,r.endOffset-1)),$.remove(e,1)),q.setRng(r);else if(e=c(q.getStart()),!e)for(;e=$.get(g);)d(e,!1)}function f(){var e,t,i,a,s,l,d;e=q.getRng(!0),a=e.startOffset,l=e.startContainer,d=l.nodeValue,t=c(q.getStart()),t&&(i=u(t)),d&&a>0&&a<d.length&&/\w/.test(d.charAt(a))&&/\w/.test(d.charAt(a-1))?(s=q.getBookmark(),e.collapse(!0),e=H(e,p(n)),e=j.split(e),y(n,r,e),q.moveToBookmark(s)):(t&&i.nodeValue===J?y(n,r,t):(t=o(!0),i=t.firstChild,e.insertNode(t),
+a=1,y(n,r,t)),q.setCursorLocation(i,a))}function h(){var e=q.getRng(!0),t,a,l,c,u,d,f=[],h,m;for(t=e.startContainer,a=e.startOffset,u=t,3==t.nodeType&&(a!=t.nodeValue.length&&(c=!0),u=u.parentNode);u;){if(x(u,n,r,i)){d=u;break}u.nextSibling&&(c=!0),f.push(u),u=u.parentNode}if(d)if(c)l=q.getBookmark(),e.collapse(!0),e=H(e,p(n),!0),e=j.split(e),b(n,r,e),q.moveToBookmark(l);else{for(m=o(),u=m,h=f.length-1;h>=0;h--)u.appendChild($.clone(f[h],!1)),u=u.firstChild;u.appendChild($.doc.createTextNode(J)),u=u.firstChild;var g=$.getParent(d,s);g&&$.isEmpty(g)?d.parentNode.replaceChild(m,d):$.insertAfter(m,d),q.setCursorLocation(u,1),$.isEmpty(d)&&$.remove(d)}}function m(){var e;e=c(q.getStart()),e&&!$.isEmpty(e)&&ce(e,function(e){1!=e.nodeType||e.id===g||$.isEmpty(e)||$.setAttrib(e,"data-mce-bogus",null)},"childNodes")}var g="_mce_caret",v=a.settings.caret_debug;a._hasCaretEvents||(oe=function(){var e=[],t;if(l(c(q.getStart()),e))for(t=e.length;t--;)$.setAttrib(e[t],"data-mce-bogus","1")},ie=function(e){var t=e.keyCode;d(),(8==t&&q.isCollapsed()||37==t||39==t)&&d(c(q.getStart())),m()},a.on("SetContent",function(e){e.selection&&m()}),a._hasCaretEvents=!0),"apply"==t?f():h()}function V(t){var n=t.startContainer,r=t.startOffset,i,o,a,s,l;if(3==n.nodeType&&r>=n.nodeValue.length&&(r=X(n),n=n.parentNode,i=!0),1==n.nodeType)for(s=n.childNodes,n=s[Math.min(r,s.length-1)],o=new e(n,$.getParent(n,$.isBlock)),(r>s.length-1||i)&&o.next(),a=o.current();a;a=o.next())if(3==a.nodeType&&!D(a))return l=$.create("a",{"data-mce-bogus":"all"},J),a.parentNode.insertBefore(l,a),t.setStart(a,0),q.setRng(t),void $.remove(l)}var U={},$=a.dom,q=a.selection,j=new t($),K=a.schema.isValidChild,Y=$.isBlock,G=a.settings.forced_root_block,X=$.nodeIndex,J="\ufeff",Q=/^(src|href|style)$/,Z=!1,ee=!0,te,ne,re=$.getContentEditable,ie,oe,ae=n.isBookmarkNode,se=i.each,le=i.grep,ce=i.walk,ue=i.extend;ue(this,{get:p,register:h,unregister:m,apply:y,remove:b,toggle:C,match:w,matchAll:_,matchNode:x,canApply:E,formatChanged:N,getCssText:k}),d(),f(),a.on("BeforeGetContent",function(e){oe&&"raw"!=e.format&&oe()}),a.on("mouseup keydown",function(e){ie&&ie(e)})}}),r(I,[B,u,d,N],function(e,t,n,r){var i=n.trim,o;return o=new RegExp(["<span[^>]+data-mce-bogus[^>]+>[\u200b\ufeff]+<\\/span>",'\\s?data-mce-selected="[^"]+"'].join("|"),"gi"),function(e){function n(){var t=e.getContent({format:"raw",no_events:1}),n=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,a,s,l,c,u,d=e.schema;for(t=t.replace(o,""),u=d.getShortEndedElements();c=n.exec(t);)s=n.lastIndex,l=c[0].length,a=u[c[1]]?s:r.findEndTag(d,t,s),t=t.substring(0,s-l)+t.substring(a),n.lastIndex=s-l;return i(t)}function a(t){e.isNotDirty=!t}function s(e){l.typing=!1,l.add({},e)}var l=this,c=0,u=[],d,f,p=0;return e.on("init",function(){l.add()}),e.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&l.beforeChange()}),e.on("ExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&s(e)}),e.on("ObjectResizeStart",function(){l.beforeChange()}),e.on("SaveContent ObjectResized blur",s),e.on("DragEnd",s),e.on("KeyUp",function(r){var i=r.keyCode;(i>=33&&36>=i||i>=37&&40>=i||45==i||13==i||r.ctrlKey)&&(s(),e.nodeChanged()),(46==i||8==i||t.mac&&(91==i||93==i))&&e.nodeChanged(),f&&l.typing&&(e.isDirty()||(a(u[0]&&n()!=u[0].content),e.isNotDirty||e.fire("change",{level:u[0],lastLevel:null})),e.fire("TypingUndo"),f=!1,e.nodeChanged())}),e.on("KeyDown",function(e){var t=e.keyCode;if(t>=33&&36>=t||t>=37&&40>=t||45==t)return void(l.typing&&s(e));var n=e.ctrlKey&&!e.altKey||e.metaKey;!(16>t||t>20)||224==t||91==t||l.typing||n||(l.beforeChange(),l.typing=!0,l.add({},e),f=!0)}),e.on("MouseDown",function(e){l.typing&&s(e)}),e.addShortcut("meta+z","","Undo"),e.addShortcut("meta+y,meta+shift+z","","Redo"),e.on("AddUndo Undo Redo ClearUndos",function(t){t.isDefaultPrevented()||e.nodeChanged()}),l={data:u,typing:!1,beforeChange:function(){p||(d=e.selection.getBookmark(2,!0))},add:function(t,r){var i,o=e.settings,s;if(t=t||{},t.content=n(),p||e.removed)return null;if(s=u[c],e.fire("BeforeAddUndo",{level:t,lastLevel:s,originalEvent:r}).isDefaultPrevented())return null;if(s&&s.content==t.content)return null;if(u[c]&&(u[c].beforeBookmark=d),o.custom_undo_redo_levels&&u.length>o.custom_undo_redo_levels){for(i=0;i<u.length-1;i++)u[i]=u[i+1];u.length--,c=u.length}t.bookmark=e.selection.getBookmark(2,!0),c<u.length-1&&(u.length=c+1),u.push(t),c=u.length-1;var l={level:t,lastLevel:s,originalEvent:r};return e.fire("AddUndo",l),c>0&&(a(!0),e.fire("change",l)),t},undo:function(){var t;return l.typing&&(l.add(),l.typing=!1),c>0&&(t=u[--c],0===c&&a(!1),e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(t.beforeBookmark),e.fire("undo",{level:t})),t},redo:function(){var t;return c<u.length-1&&(t=u[++c],e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(t.bookmark),a(!0),e.fire("redo",{level:t})),t},clear:function(){u=[],c=0,l.typing=!1,e.fire("ClearUndos")},hasUndo:function(){return c>0||l.typing&&u[0]&&n()!=u[0].content},hasRedo:function(){return c<u.length-1&&!this.typing},transact:function(e){l.beforeChange();try{p++,e()}finally{p--}l.add()}}}}),r(F,[h,x,u],function(e,t,n){var r=n.ie&&n.ie<11;return function(i){function o(o){function p(e){return e&&a.isBlock(e)&&!/^(TD|TH|CAPTION|FORM)$/.test(e.nodeName)&&!/^(fixed|absolute)/i.test(e.style.position)&&"true"!==a.getContentEditable(e)}function h(e){var t;a.isBlock(e)&&(t=s.getRng(),e.appendChild(a.create("span",null,"\xa0")),s.select(e),e.lastChild.outerHTML="",s.setRng(t))}function m(e){var t=e,n=[],r;if(t){for(;t=t.firstChild;){if(a.isBlock(t))return;1!=t.nodeType||d[t.nodeName.toLowerCase()]||n.push(t)}for(r=n.length;r--;)t=n[r],!t.hasChildNodes()||t.firstChild==t.lastChild&&""===t.firstChild.nodeValue?a.remove(t):"A"==t.nodeName&&" "===(t.innerText||t.textContent)&&a.remove(t)}}function g(t){function r(e){for(;e;){if(1==e.nodeType||3==e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}}var i,o,l,c=t,u;if(t){if(n.ie&&n.ie<9&&B&&B.firstChild&&B.firstChild==B.lastChild&&"BR"==B.firstChild.tagName&&a.remove(B.firstChild),/^(LI|DT|DD)$/.test(t.nodeName)){var d=r(t.firstChild);d&&/^(UL|OL|DL)$/.test(d.nodeName)&&t.insertBefore(a.doc.createTextNode("\xa0"),t.firstChild)}if(l=a.createRng(),n.ie||t.normalize(),t.hasChildNodes()){for(i=new e(t,t);o=i.current();){if(3==o.nodeType){l.setStart(o,0),l.setEnd(o,0);break}if(f[o.nodeName.toLowerCase()]){l.setStartBefore(o),l.setEndBefore(o);break}c=o,o=i.next()}o||(l.setStart(c,0),l.setEnd(c,0))}else"BR"==t.nodeName?t.nextSibling&&a.isBlock(t.nextSibling)?((!D||9>D)&&(u=a.create("br"),t.parentNode.insertBefore(u,t)),l.setStartBefore(t),l.setEndBefore(t)):(l.setStartAfter(t),l.setEndAfter(t)):(l.setStart(t,0),l.setEnd(t,0));s.setRng(l),a.remove(u),s.scrollIntoView(t)}}function v(e){var t=l.forced_root_block;t&&t.toLowerCase()===e.tagName.toLowerCase()&&a.setAttribs(e,l.forced_root_block_attrs)}function y(e){var t=R,n,i,o,s=u.getTextInlineElements();if(e||"TABLE"==O?(n=a.create(e||F),v(n)):n=B.cloneNode(!1),o=n,l.keep_styles!==!1)do if(s[t.nodeName]){if("_mce_caret"==t.id)continue;i=t.cloneNode(!1),a.setAttrib(i,"id",""),n.hasChildNodes()?(i.appendChild(n.firstChild),n.appendChild(i)):(o=i,n.appendChild(i))}while(t=t.parentNode);return r||(o.innerHTML='<br data-mce-bogus="1">'),n}function b(t){var n,r,i;if(3==R.nodeType&&(t?A>0:A<R.nodeValue.length))return!1;if(R.parentNode==B&&z&&!t)return!0;if(t&&1==R.nodeType&&R==B.firstChild)return!0;if("TABLE"===R.nodeName||R.previousSibling&&"TABLE"==R.previousSibling.nodeName)return z&&!t||!z&&t;for(n=new e(R,B),3==R.nodeType&&(t&&0===A?n.prev():t||A!=R.nodeValue.length||n.next());r=n.current();){if(1===r.nodeType){if(!r.getAttribute("data-mce-bogus")&&(i=r.nodeName.toLowerCase(),d[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 C(e,t){var n,r,o,s,l,c,d=F||"P";if(r=a.getParent(e,a.isBlock),c=i.getBody().nodeName.toLowerCase(),!r||!p(r)){if(r=r||T,!r.hasChildNodes())return n=a.create(d),v(n),r.appendChild(n),k.setStart(n,0),k.setEnd(n,0),n;for(s=e;s.parentNode!=r;)s=s.parentNode;for(;s&&!a.isBlock(s);)o=s,s=s.previousSibling;if(o&&u.isValidChild(c,d.toLowerCase())){for(n=a.create(d),v(n),o.parentNode.insertBefore(n,o),s=o;s&&!a.isBlock(s);)l=s.nextSibling,n.appendChild(s),s=l;k.setStart(e,t),k.setEnd(e,t)}}return e}function x(){function e(e){for(var t=P[e?"firstChild":"lastChild"];t&&1!=t.nodeType;)t=t[e?"nextSibling":"previousSibling"];return t===B}function t(){var e=P.parentNode;return/^(LI|DT|DD)$/.test(e.nodeName)?e:P}var n=P.parentNode.nodeName;/^(OL|UL|LI)$/.test(n)&&(F="LI"),H=F?y(F):a.create("BR"),e(!0)&&e()?"LI"==n?a.insertAfter(H,t()):a.replace(H,P):e(!0)?"LI"==n?(a.insertAfter(H,t()),H.appendChild(a.doc.createTextNode(" ")),H.appendChild(P)):P.parentNode.insertBefore(H,P):e()?(a.insertAfter(H,t()),h(H)):(P=t(),S=k.cloneRange(),S.setStartAfter(B),S.setEndAfter(P),L=S.extractContents(),"LI"==F&&"LI"==L.firstChild.nodeName?(H=L.firstChild,a.insertAfter(L,P)):(a.insertAfter(L,P),a.insertAfter(H,P))),a.remove(B),g(H),c.add()}function w(){i.execCommand("InsertLineBreak",!1,o)}function _(e){do 3===e.nodeType&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;while(e)}function E(e){var t=a.getRoot(),n,r;for(n=e;n!==t&&"false"!==a.getContentEditable(n);)"true"===a.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==t?r:t}function N(e){var t;r||(e.normalize(),t=e.lastChild,(!t||/^(left|right)$/gi.test(a.getStyle(t,"float",!0)))&&a.add(e,"br"))}var k,S,T,R,A,B,D,M,H,L,P,O,I,F,z;if(k=s.getRng(!0),!o.isDefaultPrevented()){if(!k.collapsed)return void i.execCommand("Delete");if(new t(a).normalize(k),R=k.startContainer,A=k.startOffset,F=(l.force_p_newlines?"p":"")||l.forced_root_block,F=F?F.toUpperCase():"",D=a.doc.documentMode,M=o.shiftKey,1==R.nodeType&&R.hasChildNodes()&&(z=A>R.childNodes.length-1,R=R.childNodes[Math.min(A,R.childNodes.length-1)]||R,A=z&&3==R.nodeType?R.nodeValue.length:0),T=E(R)){if(c.beforeChange(),!a.isBlock(T)&&T!=a.getRoot())return void((!F||M)&&w());if((F&&!M||!F&&M)&&(R=C(R,A)),B=a.getParent(R,a.isBlock),P=B?a.getParent(B.parentNode,a.isBlock):null,O=B?B.nodeName.toUpperCase():"",I=P?P.nodeName.toUpperCase():"","LI"!=I||o.ctrlKey||(B=P,O=I),/^(LI|DT|DD)$/.test(O)){if(!F&&M)return void w();if(a.isEmpty(B))return void x()}if("PRE"==O&&l.br_in_pre!==!1){if(!M)return void w()}else if(!F&&!M&&"LI"!=O||F&&M)return void w();F&&B===i.getBody()||(F=F||"P",b()?(H=/^(H[1-6]|PRE|FIGURE)$/.test(O)&&"HGROUP"!=I?y(F):y(),l.end_container_on_empty_block&&p(P)&&a.isEmpty(B)?H=a.split(P,B):a.insertAfter(H,B),g(H)):b(!0)?(H=B.parentNode.insertBefore(y(),B),h(H),g(B)):(S=k.cloneRange(),S.setEndAfter(B),L=S.extractContents(),_(L),H=L.firstChild,a.insertAfter(L,B),m(H),N(B),g(H)),a.setAttrib(H,"id",""),i.fire("NewBlock",{newBlock:H}),c.add())}}}var a=i.dom,s=i.selection,l=i.settings,c=i.undoManager,u=i.schema,d=u.getNonEmptyElements(),f=u.getMoveCaretBeforeOnEnterElements();i.on("keydown",function(e){13==e.keyCode&&o(e)!==!1&&e.preventDefault()})}}),r(z,[],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,e.settings.forced_root_block_attrs),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("NodeChange",t)}}),r(W,[T,u,d,L,x,h],function(e,n,r,i,o,a){var s=r.each,l=r.extend,c=r.map,u=r.inArray,d=r.explode,f=n.gecko,p=n.ie,h=n.ie&&n.ie<11,m=!0,g=!1;return function(r){function v(e,t,n,i){var o,a,c=0;if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(e)||i&&i.skip_focus||r.focus(),i=l({},i),i=r.fire("BeforeExecCommand",{command:e,ui:t,value:n}),i.isDefaultPrevented())return!1;if(a=e.toLowerCase(),o=H.exec[a])return o(a,t,n),r.fire("ExecCommand",{command:e,ui:t,value:n}),!0;if(s(r.plugins,function(i){return i.execCommand&&i.execCommand(e,t,n)?(r.fire("ExecCommand",{command:e,ui:t,value:n}),c=!0,!1):void 0}),c)return c;if(r.theme&&r.theme.execCommand&&r.theme.execCommand(e,t,n))return r.fire("ExecCommand",{command:e,ui:t,value:n}),!0;try{c=r.getDoc().execCommand(e,t,n)}catch(u){}return c?(r.fire("ExecCommand",{command:e,ui:t,value:n}),!0):!1}function y(e){var t;if(!r._isHidden()){if(e=e.toLowerCase(),t=H.state[e])return t(e);try{return r.getDoc().queryCommandState(e)}catch(n){}return!1}}function b(e){var t;if(!r._isHidden()){if(e=e.toLowerCase(),t=H.value[e])return t(e);try{return r.getDoc().queryCommandValue(e)}catch(n){}}}function C(e,t){t=t||"exec",s(e,function(e,n){s(n.toLowerCase().split(","),function(n){H[t][n]=e})})}function x(e,t,n){e=e.toLowerCase(),H.exec[e]=function(e,i,o,a){return t.call(n||r,i,o,a)}}function w(e){if(e=e.toLowerCase(),H.exec[e])return!0;try{return r.getDoc().queryCommandSupported(e)}catch(t){}return!1}function _(e,t,n){e=e.toLowerCase(),H.state[e]=function(){return t.call(n||r)}}function E(e,t,n){e=e.toLowerCase(),H.value[e]=function(){return t.call(n||r)}}function N(e){return e=e.toLowerCase(),!!H.exec[e]}function k(e,n,i){return n===t&&(n=g),i===t&&(i=null),r.getDoc().execCommand(e,n,i)}function S(e){return M.match(e)}function T(e,n){M.toggle(e,n?{value:n}:t),r.nodeChanged()}function R(e){P=D.getBookmark(e)}function A(){D.moveToBookmark(P)}var B,D,M,H={state:{},exec:{},value:{}},L=r.settings,P;r.on("PreInit",function(){B=r.dom,D=r.selection,L=r.settings,M=r.formatter}),l(this,{execCommand:v,queryCommandState:y,queryCommandValue:b,queryCommandSupported:w,addCommands:C,addCommand:x,addQueryStateHandler:_,addQueryValueHandler:E,hasCustomCommand:N}),C({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){r.undoManager.add()},"Cut,Copy,Paste":function(e){var t=r.getDoc(),i;try{k(e)}catch(o){i=m}if(i||!t.queryCommandSupported(e)){var a=r.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");n.mac&&(a=a.replace(/Ctrl\+/g,"\u2318+")),r.windowManager.alert(a)}},unlink:function(){if(D.isCollapsed()){var e=D.getNode();return void("A"==e.tagName&&r.dom.remove(e,!0))}M.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t=e.substring(7);"full"==t&&(t="justify"),s("left,center,right,justify".split(","),function(e){t!=e&&M.remove("align"+e)}),T("align"+t),v("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;k(e),t=B.getParent(D.getNode(),"ol,ul"),t&&(n=t.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)&&(R(),B.split(n,t),A()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){T(e)},"ForeColor,HiliteColor,FontName":function(e,t,n){T(e,n)},FontSize:function(e,t,n){var r,i;n>=1&&7>=n&&(i=d(L.font_size_style_values),r=d(L.font_size_classes),n=r?r[n-1]||n:i[n-1]||n),T(e,n)},RemoveFormat:function(e){M.remove(e)},mceBlockQuote:function(){T("blockquote")},FormatBlock:function(e,t,n){return T(n||"p")},mceCleanup:function(){var e=D.getBookmark();r.setContent(r.getContent({cleanup:m}),{cleanup:m}),D.moveToBookmark(e)},mceRemoveNode:function(e,t,n){var i=n||D.getNode();i!=r.getBody()&&(R(),r.dom.remove(i,m),A())},mceSelectNodeDepth:function(e,t,n){var i=0;B.getParent(D.getNode(),function(e){return 1==e.nodeType&&i++==n?(D.select(e),g):void 0},r.getBody())},mceSelectNode:function(e,t,n){D.select(n)},mceInsertContent:function(t,n,o){function a(e){function t(e){return r[e]&&3==r[e].nodeType}var n,r,i;return n=D.getRng(!0),r=n.startContainer,i=n.startOffset,3==r.nodeType&&(i>0?e=e.replace(/^&nbsp;/," "):t("previousSibling")||(e=e.replace(/^ /,"&nbsp;")),i<r.length?e=e.replace(/&nbsp;(<br>|)$/," "):t("nextSibling")||(e=e.replace(/(&nbsp;| )(<br>|)$/,"&nbsp;"))),e}function l(){var e,t,n;e=D.getRng(!0),t=e.startContainer,n=e.startOffset,3==t.nodeType&&e.collapsed&&("\xa0"===t.data[n]?(t.deleteData(n,1),/[\u00a0| ]$/.test(o)||(o+=" ")):"\xa0"===t.data[n-1]&&(t.deleteData(n-1,1),/[\u00a0| ]$/.test(o)||(o=" "+o)))}function c(e){if(_)for(C=e.firstChild;C;C=C.walk(!0))E[C.name]&&C.attr("data-mce-new","true")}function u(){if(_){var e=r.getBody(),t=new i(B);s(B.select("*[data-mce-new]"),function(n){n.removeAttribute("data-mce-new");for(var r=n.parentNode;r&&r!=e;r=r.parentNode)t.compare(r,n)&&B.remove(n,!0)})}}var d,f,h,m,g,v,y,b,C,x,w,_,E=r.schema.getTextInlineElements();"string"!=typeof o&&(_=o.merge,o=o.content),/^ | $/.test(o)&&(o=a(o)),d=r.parser,f=new e({},r.schema),w='<span id="mce_marker" data-mce-type="bookmark">&#xFEFF;&#x200B;</span>',v={content:o,format:"html",selection:!0},r.fire("BeforeSetContent",v),o=v.content,-1==o.indexOf("{$caret}")&&(o+="{$caret}"),o=o.replace(/\{\$caret\}/,w),b=D.getRng();var N=b.startContainer||(b.parentElement?b.parentElement():null),k=r.getBody();N===k&&D.isCollapsed()&&B.isBlock(k.firstChild)&&B.isEmpty(k.firstChild)&&(b=B.createRng(),b.setStart(k.firstChild,0),b.setEnd(k.firstChild,0),D.setRng(b)),D.isCollapsed()||(r.getDoc().execCommand("Delete",!1,null),l()),h=D.getNode();var S={context:h.nodeName.toLowerCase()};if(g=d.parse(o,S),c(g),C=g.lastChild,"mce_marker"==C.attr("id"))for(y=C,C=C.prev;C;C=C.walk(!0))if(3==C.type||!B.isBlock(C.name)){r.schema.isValidChild(C.parent.name,"span")&&C.parent.insert(y,C,"br"===C.name);break}if(S.invalid){for(D.setContent(w),h=D.getNode(),m=r.getBody(),9==h.nodeType?h=C=m:C=h;C!==m;)h=C,C=C.parentNode;o=h==m?m.innerHTML:B.getOuterHTML(h),o=f.serialize(d.parse(o.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return f.serialize(g)}))),h==m?B.setHTML(m,o):B.setOuterHTML(h,o)}else o=f.serialize(g),C=h.firstChild,x=h.lastChild,!C||C===x&&"BR"===C.nodeName?B.setHTML(h,o):D.setContent(o);u(),y=B.get("mce_marker"),D.scrollIntoView(y),b=B.createRng(),C=y.previousSibling,C&&3==C.nodeType?(b.setStart(C,C.nodeValue.length),p||(x=y.nextSibling,x&&3==x.nodeType&&(C.appendData(x.data),x.parentNode.removeChild(x)))):(b.setStartBefore(y),b.setEndBefore(y)),B.remove(y),D.setRng(b),r.fire("SetContent",v),r.addVisual()},mceInsertRawHTML:function(e,t,n){D.setContent("tiny_mce_marker"),r.setContent(r.getContent().replace(/tiny_mce_marker/g,function(){return n}))},mceToggleFormat:function(e,t,n){T(n)},mceSetContent:function(e,t,n){r.setContent(n)},"Indent,Outdent":function(e){var t,n,i;t=L.indentation,n=/[a-z%]+$/i.exec(t),t=parseInt(t,10),y("InsertUnorderedList")||y("InsertOrderedList")?k(e):(L.forced_root_block||B.getParent(D.getNode(),B.isBlock)||M.apply("div"),s(D.getSelectedBlocks(),function(o){if("LI"!=o.nodeName){var a=r.getParam("indent_use_margin",!1)?"margin":"padding";a+="rtl"==B.getStyle(o,"direction",!0)?"Right":"Left","outdent"==e?(i=Math.max(0,parseInt(o.style[a]||0,10)-t),B.setStyle(o,a,i?i+n:"")):(i=parseInt(o.style[a]||0,10)+t+n,B.setStyle(o,a,i))}}))},mceRepaint:function(){if(f)try{R(m),D.getSel()&&D.getSel().selectAllChildren(r.getBody()),D.collapse(m),A()}catch(e){}},InsertHorizontalRule:function(){r.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){r.hasVisual=!r.hasVisual,r.addVisual()},mceReplaceContent:function(e,t,n){r.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,D.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=B.getParent(D.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||M.remove("link"),n.href&&M.apply("link",n,r)},selectAll:function(){var e=B.getRoot(),t;D.getRng().setStart?(t=B.createRng(),t.setStart(e,0),t.setEnd(e,e.childNodes.length),D.setRng(t)):(t=D.getRng(),t.item||(t.moveToElementText(e),t.select()))},"delete":function(){k("Delete");var e=r.getBody();B.isEmpty(e)&&(r.setContent(""),e.firstChild&&B.isBlock(e.firstChild)?r.selection.setCursorLocation(e.firstChild,0):r.selection.setCursorLocation(e,0))},mceNewDocument:function(){r.setContent("")},InsertLineBreak:function(e,t,n){function i(){for(var e=new a(p,v),t,n=r.schema.getNonEmptyElements();t=e.next();)if(n[t.nodeName.toLowerCase()]||t.length>0)return!0}var s=n,l,c,u,d=D.getRng(!0);new o(B).normalize(d);var f=d.startOffset,p=d.startContainer;if(1==p.nodeType&&p.hasChildNodes()){var g=f>p.childNodes.length-1;p=p.childNodes[Math.min(f,p.childNodes.length-1)]||p,f=g&&3==p.nodeType?p.nodeValue.length:0}var v=B.getParent(p,B.isBlock),y=v?v.nodeName.toUpperCase():"",b=v?B.getParent(v.parentNode,B.isBlock):null,C=b?b.nodeName.toUpperCase():"",x=s&&s.ctrlKey;"LI"!=C||x||(v=b,y=C),p&&3==p.nodeType&&f>=p.nodeValue.length&&(h||i()||(l=B.create("br"),d.insertNode(l),d.setStartAfter(l),d.setEndAfter(l),c=!0)),l=B.create("br"),d.insertNode(l);var w=B.doc.documentMode;return h&&"PRE"==y&&(!w||8>w)&&l.parentNode.insertBefore(B.doc.createTextNode("\r"),l),u=B.create("span",{},"&nbsp;"),l.parentNode.insertBefore(u,l),D.scrollIntoView(u),B.remove(u),c?(d.setStartBefore(l),d.setEndBefore(l)):(d.setStartAfter(l),d.setEndAfter(l)),D.setRng(d),r.undoManager.add(),m}}),C({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t="align"+e.substring(7),n=D.isCollapsed()?[B.getParent(D.getNode(),B.isBlock)]:D.getSelectedBlocks(),r=c(n,function(e){return!!M.matchNode(e,t)});return-1!==u(r,m)},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return S(e)},mceBlockQuote:function(){return S("blockquote")},Outdent:function(){var e;if(L.inline_styles){if((e=B.getParent(D.getStart(),B.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return m;if((e=B.getParent(D.getEnd(),B.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return m}return y("InsertUnorderedList")||y("InsertOrderedList")||!L.inline_styles&&!!B.getParent(D.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var t=B.getParent(D.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),C({"FontSize,FontName":function(e){var t=0,n;return(n=B.getParent(D.getNode(),"span"))&&(t="fontsize"==e?n.style.fontSize:n.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()),t}},"value"),C({Undo:function(){r.undoManager.undo()},Redo:function(){r.undoManager.redo()}})}}),r(V,[d],function(e){function t(e,o){var a=this,s,l;if(e=r(e),o=a.settings=o||{},s=o.base_uri,/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))return void(a.source=e);var c=0===e.indexOf("//");0!==e.indexOf("/")||c||(e=(s?s.protocol||"http":"http")+"://mce_host"+e),/^[\w\-]*:?\/\//.test(e)||(l=o.base_uri?o.base_uri.path:new t(location.href).directory,""===o.base_uri.protocol?e="//mce_host"+a.toAbsPath(l,e):(e=/([^#?]*)([#?]?.*)/.exec(e),e=(s&&s.protocol||"http")+"://mce_host"+a.toAbsPath(l,e[1])+e[2])),e=e.replace(/@@/g,"(mce_at)"),e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e),n(i,function(t,n){var r=e[n];r&&(r=r.replace(/\(mce_at\)/g,"@@")),a[t]=r}),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=""),c&&(a.protocol="")}var n=e.each,r=e.trim,i="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),o={ftp:21,http:80,https:443,mailto:25};return t.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 n=this,r;if("./"===e)return e;if(e=new t(e,{base_uri:n}),"mce_host"!=e.host&&n.host!=e.host&&e.host||n.port!=e.port||n.protocol!=e.protocol&&""!==e.protocol)return e.getURI();var i=n.getURI(),o=e.getURI();return i==o||"/"==i.charAt(i.length-1)&&i.substr(0,i.length-1)==o?i:(r=n.toRelPath(n.path,e.path),e.query&&(r+="?"+e.query),e.anchor&&(r+="#"+e.anchor),r)},toAbsolute:function(e,n){return e=new t(e,{base_uri:this}),e.getURI(n&&this.isSameOrigin(e))},isSameOrigin:function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=o[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},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 r,i=0,o=[],a,s;for(a=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),n(e,function(e){e&&o.push(e)}),e=o,r=t.length-1,o=[];r>=0;r--)0!==t[r].length&&"."!==t[r]&&(".."!==t[r]?i>0?i--:o.push(t[r]):i++);return r=e.length-i,s=0>=r?o.reverse().join("/"):e.slice(0,r).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||(t+=n.protocol?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}},t}),r(U,[d],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=this;if(!o&&(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],"function"==typeof f&&c[d]?u[d]=s(d,f):u[d]=f;return t.prototype=u,t.constructor=t,t.extend=i,t},t}),r($,[d],function(e){function t(t){function n(){return!1}function r(){return!0}function i(e,i){var o,s,l,c;if(e=e.toLowerCase(),i=i||{},i.type=e,i.target||(i.target=u),i.preventDefault||(i.preventDefault=function(){i.isDefaultPrevented=r},i.stopPropagation=function(){i.isPropagationStopped=r},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=r},i.isDefaultPrevented=n,i.isPropagationStopped=n,i.isImmediatePropagationStopped=n),t.beforeFire&&t.beforeFire(i),o=d[e])for(s=0,l=o.length;l>s;s++){if(c=o[s],c.once&&a(e,c.func),i.isImmediatePropagationStopped())return i.stopPropagation(),i;if(c.func.call(u,i)===!1)return i.preventDefault(),i}return i}function o(t,r,i,o){var a,s,l;if(r===!1&&(r=n),r)for(r={func:r},o&&e.extend(r,o),s=t.toLowerCase().split(" "),l=s.length;l--;)t=s[l],a=d[t],a||(a=d[t]=[],f(t,!0)),i?a.unshift(r):a.push(r);return c}function a(e,t){var n,r,i,o,a;if(e)for(o=e.toLowerCase().split(" "),n=o.length;n--;){if(e=o[n],r=d[e],!e){for(i in d)f(i,!1),delete d[i];return c}if(r){if(t)for(a=r.length;a--;)r[a].func===t&&(r=r.slice(0,a).concat(r.slice(a+1)),d[e]=r);else r.length=0;r.length||(f(e,!1),delete d[e])}}else{for(e in d)f(e,!1);d={}}return c}function s(e,t,n){return o(e,t,n,{once:!0})}function l(e){return e=e.toLowerCase(),!(!d[e]||0===d[e].length)}var c=this,u,d={},f;t=t||{},u=t.scope||c,f=t.toggleEvent||n,c.fire=i,c.on=o,c.off=a,c.once=s,c.has=l}var n=e.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchend"," ");return t.isNative=function(e){return!!n[e.toLowerCase()]},t}),r(q,[U],function(e){function t(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 n=/^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i,r=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i=/^\s*|\s*$/g,o,a=e.extend({init:function(e){function t(e){return e?(e=e.toLowerCase(),function(t){return"*"===e||t.type===e}):void 0}function o(e){return e?function(t){return t._name===e}:void 0}function a(e){return e?(e=e.split("."),function(t){for(var n=e.length;n--;)if(!t.hasClass(e[n]))return!1;return!0}):void 0}function s(e,t,n){return e?function(r){var i=r[e]?r[e]():"";return t?"="===t?i===n:"*="===t?i.indexOf(n)>=0:"~="===t?(" "+i+" ").indexOf(" "+n+" ")>=0:"!="===t?i!=n:"^="===t?0===i.indexOf(n):"$="===t?i.substr(i.length-n.length)===n:!1:!!n}:void 0}function l(e){var t;return e?(e=/(?:not\((.+)\))|(.+)/i.exec(e),e[1]?(t=u(e[1],[]),function(e){return!d(e,t)}):(e=e[2],function(t,n,r){return"first"===e?0===n:"last"===e?n===r-1:"even"===e?n%2===0:"odd"===e?n%2===1:t[e]?t[e]():!1})):void 0}function c(e,r,c){function u(e){e&&r.push(e)}var d;return d=n.exec(e.replace(i,"")),u(t(d[1])),u(o(d[2])),u(a(d[3])),u(s(d[4],d[5],d[6])),u(l(d[7])),r.psuedo=!!d[7],r.direct=c,r}function u(e,t){var n=[],i,o,a;do if(r.exec(""),o=r.exec(e),o&&(e=o[3],n.push(o[1]),o[2])){i=o[3];break}while(o);for(i&&u(i,t),e=[],a=0;a<n.length;a++)">"!=n[a]&&e.push(c(n[a],[],">"===n[a-1]));return t.push(e),t}var d=this.match;this._selectors=u(e,[])},match:function(e,t){var n,r,i,o,a,s,l,c,u,d,f,p,h;for(t=t||this._selectors,n=0,r=t.length;r>n;n++){for(a=t[n],o=a.length,h=e,p=0,i=o-1;i>=0;i--)for(c=a[i];h;){if(c.psuedo)for(f=h.parent().items(),u=d=f.length;u--&&f[u]!==h;);for(s=0,l=c.length;l>s;s++)if(!c[s](h,u,d)){s=l+1;break}if(s===l){p++;break}if(i===o-1)break;h=h.parent()}if(p===o)return!0}return!1},find:function(e){function n(e,t,i){var o,a,s,l,c,u=t[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==t.length-1?r.push(c):c.items&&n(c.items(),t,i+1);else if(u.direct)return;c.items&&n(c.items(),t,i)}}var r=[],i,s,l=this._selectors;if(e.items){for(i=0,s=l.length;s>i;i++)n(e.items(),l[i],0);s>1&&(r=t(r))}return o||(o=a.Collection),new o(r)}});return a}),r(j,[d,q,U],function(e,t,n){var r,i,o=Array.prototype.push,a=Array.prototype.slice;return i={length:0,init:function(e){e&&this.add(e)},add:function(t){var n=this;return e.isArray(t)?o.apply(n,t):t instanceof r?n.add(t.toArray()):o.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 n=this,i,o,a=[],s,l;for("string"==typeof e?(e=new t(e),l=function(t){return e.match(t)}):l=e,i=0,o=n.length;o>i;i++)s=n[i],l(s)&&a.push(s);
+
+return new r(a)},slice:function(){return new r(a.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 r(e.toArray(this).reverse())},hasClass:function(e){return this[0]?this[0].hasClass(e):!1},prop:function(e,t){var n=this,r,i;return t!==r?(n.each(function(n){n[e]&&n[e](t)}),n):(i=n[0],i&&i[e]?i[e]():void 0)},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},remove:function(){for(var e=this.length;e--;)this[e].remove();return this}},e.each("fire on off show hide addClass removeClass append prepend before after reflow".split(" "),function(t){i[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 disabled active selected checked visible parent value data".split(" "),function(e){i[e]=function(t){return this.prop(e,t)}}),r=n.extend(i),t.Collection=r,r}),r(K,[d,y],function(e,t){var n=0;return{id:function(){return"mceu_"+n++},createFragment:function(e){return t.DOM.createFragment(e)},getWindowSize:function(){return t.DOM.getViewPort()},getSize:function(e){var t,n;if(e.getBoundingClientRect){var r=e.getBoundingClientRect();t=Math.max(r.width||r.right-r.left,e.offsetWidth),n=Math.max(r.height||r.bottom-r.bottom,e.offsetHeight)}else t=e.offsetWidth,n=e.offsetHeight;return{width:t,height:n}},getPos:function(e,n){return t.DOM.getPos(e,n)},getViewPort:function(e){return t.DOM.getViewPort(e)},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)},getRuntimeStyle:function(e,n){return t.DOM.getStyle(e,n,!0)},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)},innerHtml:function(e,n){t.DOM.setHTML(e,n)}}}),r(Y,[U,d,$,j,K],function(e,t,n,r,i){function o(e){return e._eventDispatcher||(e._eventDispatcher=new n({scope:e,toggleEvent:function(t,r){r&&n.isNative(t)&&(e._nativeEvents||(e._nativeEvents={}),e._nativeEvents[t]=!0,e._rendered&&e.bindPendingEvents())}})),e._eventDispatcher}var a="onmousewheel"in document,s=!1,l="mce-",c=e.extend({Statics:{classPrefix:l},isRtl:function(){return c.rtl},classPrefix:l,init:function(e){var n=this,r,o;if(n.settings=e=t.extend({},n.Defaults,e),n._id=e.id||i.id(),n._text=n._name="",n._width=n._height=0,n._aria={role:e.role},this._elmCache={},r=e.classes)for(r=r.split(" "),r.map={},o=r.length;o--;)r.map[r[o]]=!0;n._classes=r||[],n.visible(!0),t.each("title text width height name classes visible disabled active value".split(" "),function(t){var r=e[t],i;r!==i?n[t](r):n["_"+t]===i&&(n["_"+t]=!1)}),n.on("click",function(){return n.disabled()?!1:void 0}),e.classes&&t.each(e.classes.split(" "),function(e){n.addClass(e)}),n.settings=e,n._borderBox=n.parseBox(e.border),n._paddingBox=n.parseBox(e.padding),n._marginBox=n.parseBox(e.margin),e.hidden&&n.hide()},Properties:"parent,title,text,width,height,disabled,active,name,value",Methods:"renderHtml",getContainerElm:function(){return document.body},getParentCtrl:function(e){for(var t,n=this.getRoot().controlIdLookup;e&&n&&!(t=n[e.id]);)e=e.parentNode;return t},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=parseFloat(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,t=e.settings,n,r,o=e.getEl(),a,s,l,c,u,d,f,p;n=e._borderBox=e._borderBox||e.measureBox(o,"border"),e._paddingBox=e._paddingBox||e.measureBox(o,"padding"),e._marginBox=e._marginBox||e.measureBox(o,"margin"),p=i.getSize(o),d=t.minWidth,f=t.minHeight,l=d||p.width,c=f||p.height,a=t.width,s=t.height,u=t.autoResize,u="undefined"!=typeof u?u:!a&&!s,a=a||l,s=s||c;var h=n.left+n.right,m=n.top+n.bottom,g=t.maxWidth||65535,v=t.maxHeight||65535;return e._layoutRect=r={x:t.x||0,y:t.y||0,w:a,h:s,deltaW:h,deltaH:m,contentW:a-h,contentH:s-m,innerW:a-h,innerH:s-m,startMinWidth:d||0,startMinHeight:f||0,minW:Math.min(l,g),minH:Math.min(c,v),maxW:g,maxH:v,autoResize:u,scrollW:0},e._lastLayoutRect={},r},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=i<n.minW?n.minW:i,i=i>n.maxW?n.maxW:i,n.w=i,n.innerW=i-o),i=e.h,i!==s&&(i=i<n.minH?n.minH:i,i=i>n.maxH?n.maxH:i,n.h=i,n.innerH=i-a),i=e.innerW,i!==s&&(i=i<n.minW-o?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=i<n.minH-a?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,l;l=document.createRange?function(e){return e}:Math.round,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=l(r.x)+"px",s.x=r.x),r.y!==s.y&&(t.top=l(r.y)+"px",s.y=r.y),r.w!==s.w&&(t.width=l(r.w-o)+"px",s.w=r.w),r.h!==s.h&&(t.height=l(r.h-a)+"px",s.h=r.h),e._hasBody&&r.innerW!==s.innerW&&(n=e.getEl("body").style,n.width=l(r.innerW)+"px",s.innerW=r.innerW),e._hasBody&&r.innerH!==s.innerH&&(n=n||e.getEl("body").style,n.height=l(r.innerH)+"px",s.innerH=r.innerH),e._lastRepaintRect=s,e.fire("repaint",{},!1)},on:function(e,t){function n(e){var t,n;return"string"!=typeof e?e:function(i){return t||r.parentsAndSelf().each(function(r){var i=r.settings.callbacks;return i&&(t=i[e])?(n=r,!1):void 0}),t.call(n,i)}}var r=this;return o(r).on(e,n(t)),r},off:function(e,t){return o(this).off(e,t),this},fire:function(e,t,n){var r=this;if(t=t||{},t.control||(t.control=r),t=o(r).fire(e,t),n!==!1&&r.parent)for(var i=r.parent();i&&!t.isPropagationStopped();)i.fire(e,t,!1),i=i.parent();return t},hasEventListeners:function(e){return o(this).has(e)},parents:function(e){var t=this,n,i=new r;for(n=t.parent();n;n=n.parent())i.add(n);return e&&(i=i.filter(e)),i},parentsAndSelf:function(e){return new r(this).add(this.parents(e))},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(" "):""},innerHtml:function(e){return i.innerHtml(this.getEl(),e),this},getEl:function(e){var t=e?this._id+"-"+e:this._id;return this._elmCache[t]||(this._elmCache[t]=i.get(t)),this._elmCache[t]},visible:function(e){var t=this,n;return"undefined"!=typeof e?(t._visible!==e&&(t._rendered&&(t.getEl().style.display=e?"":"none"),t._visible=e,n=t.parent(),n&&(n._lastRect=null),t.fire(e?"show":"hide")),t):t._visible},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(e){}return this},blur:function(){return this.getEl().blur(),this},aria:function(e,t){var n=this,r=n.getEl(n.ariaTarget);return"undefined"==typeof t?n._aria[e]:(n._aria[e]=t,n._rendered&&r.setAttribute("role"==e?e:"aria-"+e,t),n)},encode:function(e,t){return t!==!1&&(e=this.translate(e)),(e||"").replace(/[&<>"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},translate:function(e){return c.translate?c.translate(e):e},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,o;if(e.items){var a=e.items().toArray();for(o=a.length;o--;)a[o].remove()}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);var s=e.getRoot().controlIdLookup;return s&&delete s[e._id],t&&t.parentNode&&t.parentNode.removeChild(t),e._rendered=!1,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}));var l=e.getRoot();l.controlIdLookup||(l.controlIdLookup={}),l.controlIdLookup[e._id]=e;for(var c in e._aria)e.aria(c,e._aria[c]);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);return 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,this},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;r<s.length&&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;i<a.length;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,l,c,u,d,f,p;if(o._rendered=!0,f=o._nativeEvents){for(u=o.parents().toArray(),u.unshift(o),l=0,c=u.length;!d&&c>l;l++)d=u[l]._eventsRoot;for(d||(d=u[u.length-1]||o),o._eventsRoot=d,c=l,l=0;c>l;l++)u[l]._eventsRoot=d;var h=d._delegates;h||(h=d._delegates={});for(p in f){if(!f)return!1;"wheel"!==p||s?("mouseenter"===p||"mouseleave"===p?d._hasMouseEnter||(i.on(d.getEl(),"mouseleave",t),i.on(d.getEl(),"mouseover",n),d._hasMouseEnter=1):h[p]||(i.on(d.getEl(),p,e),h[p]=!0),f[p]=!1):a?i.on(o.getEl(),"mousewheel",r):i.on(o.getEl(),"DOMMouseScroll",r)}}},getRoot:function(){for(var e=this,t,n=[];e;){if(e.rootControl){t=e.rootControl;break}n.push(e),t=e,e=e.parent()}t||(t=this);for(var r=n.length;r--;)n[r].rootControl=t;return t},reflow:function(){return this.repaint(),this}});return c}),r(G,[],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 new Error("Could not find control by type: "+n);return i=new i(r),i.type=n,i}}}),r(X,[],function(){return function(e){function t(e){return e=e||b,e&&e.getAttribute("role")}function n(e){for(var n,r=e||b;r=r.parentNode;)if(n=t(r))return n}function r(e){var t=b;return t?t.getAttribute("aria-"+e):void 0}function i(e){var t=e.tagName.toUpperCase();return"INPUT"==t||"TEXTAREA"==t}function o(e){return i(e)&&!e.hidden?!0:/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell)$/.test(t(e))?!0:!1}function a(e){function t(e){if(1==e.nodeType&&"none"!=e.style.display){o(e)&&n.push(e);for(var r=0;r<e.childNodes.length;r++)t(e.childNodes[r])}}var n=[];return t(e||y.getEl()),n}function s(e){var t,n;e=e||C,n=e.parents().toArray(),n.unshift(e);for(var r=0;r<n.length&&(t=n[r],!t.settings.ariaRoot);r++);return t}function l(e){var t=s(e),n=a(t.getEl());t.settings.ariaRemember&&"lastAriaIndex"in t?c(t.lastAriaIndex,n):c(0,n)}function c(e,t){return 0>e?e=t.length-1:e>=t.length&&(e=0),t[e]&&t[e].focus(),e}function u(e,t){var n=-1,r=s();t=t||a(r.getEl());for(var i=0;i<t.length;i++)t[i]===b&&(n=i);n+=e,r.lastAriaIndex=c(n,t)}function d(){var e=n();"tablist"==e?u(-1,a(b.parentNode)):C.parent().submenu?g():u(-1)}function f(){var e=t(),i=n();"tablist"==i?u(1,a(b.parentNode)):"menuitem"==e&&"menu"==i&&r("haspopup")?v():u(1)}function p(){u(-1)}function h(){var e=t(),i=n();"menuitem"==e&&"menubar"==i?v():"button"==e&&r("haspopup")?v({key:"down"}):u(1)}function m(e){var t=n();if("tablist"==t){var r=a(C.getEl("body"))[0];r&&r.focus()}else u(e.shiftKey?-1:1)}function g(){C.fire("cancel")}function v(e){e=e||{},C.fire("click",{target:b,aria:e})}var y=e.root,b,C;try{b=document.activeElement}catch(x){b=document.body}return C=y.getParentCtrl(b),y.on("keydown",function(e){function t(e,t){i(b)||t(e)!==!1&&e.preventDefault()}if(!e.isDefaultPrevented())switch(e.keyCode){case 37:t(e,d);break;case 39:t(e,f);break;case 38:t(e,p);break;case 40:t(e,h);break;case 27:g();break;case 14:case 13:case 32:t(e,v);break;case 9:m(e)!==!1&&e.preventDefault()}}),y.on("focusin",function(e){b=e.target,C=e.control}),{focusFirst:l}}}),r(J,[Y,j,q,G,X,d,K],function(e,t,n,r,i,o,a){var s={};return e.extend({layout:"",innerClass:"container-inner",init:function(e){var n=this;n._super(e),e=n.settings,n._fixed=e.fixed,n._items=new t,n.isRtl()&&n.addClass("rtl"),n.addClass("container"),n.addClass("container-body","body"),e.containerCls&&n.addClass(e.containerCls),n._layout=r.create((e.layout||n.layout)+"layout"),n.settings.items&&n.add(n.settings.items),n._hasBody=!0},items:function(){return this._items},find:function(e){return e=s[e]=s[e]||new n(e),e.find(this)},add:function(e){var t=this;return t.items().add(t.create(e)).parent(t),t},focus:function(e){var t=this,n,r,i;return e&&(r=t.keyboardNav||t.parents().eq(-1)[0].keyboardNav)?void r.focusFirst(t):(i=t.find("*"),t.statusbar&&i.add(t.statusbar.items()),i.each(function(e){return e.settings.autofocus?(n=null,!1):void(e.canFocus&&(n=n||e))}),n&&n.focus(),t)},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,i,a=[];return o.isArray(t)||(t=[t]),o.each(t,function(t){t&&(t instanceof e||("string"==typeof t&&(t={type:t}),i=o.extend({},n.settings.defaults,t),t.type=i.type=i.type||t.type||n.settings.defaultType||(i.defaults?i.defaults.type:null),t=r.create(i)),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()&&n<=r.childNodes.length-1?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<i.length-1&&(t+=1),t>=0&&t<i.length&&(o=i.slice(0,t).toArray(),a=i.slice(t).toArray(),i.set(o.concat(e,a))),r.renderNew()},fromJSON:function(e){var t=this;for(var n in e)t.find("#"+n).value(e[n]);return t},toJSON:function(){var e=this,t={};return e.find("*").each(function(e){var n=e.name(),r=e.value();n&&"undefined"!=typeof r&&(t[n]=r)}),t},preRender:function(){},renderHtml:function(){var e=this,t=e._layout,n=this.settings.role;return e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes()+'"'+(n?' 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.parent()||(e.keyboardNav=new i({root:e})),e},initLayoutRect:function(){var e=this,t=e._super();return e._layout.recalc(e),t},recalc:function(){var e=this,t=e._layoutRect,n=e._lastRect;return n&&n.w==t.w&&n.h==t.h?void 0:(e._layout.recalc(e),t=e.layoutRect(),e._lastRect={x:t.x,y:t.y,w:t.w,h:t.h},!0)},reflow:function(){var t;if(this.visible()){for(e.repaintControls=[],e.repaintControls.map={},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,[K],function(e){function t(){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(n,r){function i(){return a.getElementById(r.handle||n)}var o,a=document,s,l,c,u,d,f;r=r||{},l=function(n){var l=t(),p,h;n.preventDefault(),s=n.button,p=i(),d=n.screenX,f=n.screenY,h=window.getComputedStyle?window.getComputedStyle(p,null).getPropertyValue("cursor"):p.runtimeStyle.cursor,o=a.createElement("div"),e.css(o,{position:"absolute",top:0,left:0,width:l.width,height:l.height,zIndex:2147483647,opacity:1e-4,cursor:h}),a.body.appendChild(o),e.on(a,"mousemove",u),e.on(a,"mouseup",c),r.start(n)},u=function(e){return e.button!==s?c(e):(e.deltaX=e.screenX-d,e.deltaY=e.screenY-f,e.preventDefault(),void r.drag(e))},c=function(t){e.off(a,"mousemove",u),e.off(a,"mouseup",c),o.parentNode.removeChild(o),r.stop&&r.stop(t)},this.destroy=function(){e.off(i())},e.on(i(),"mousedown",l)}}),r(Z,[K,Q],function(e,t){return{init:function(){var e=this;e.on("repaint",e.renderScroll)},renderScroll:function(){function n(){function t(t,a,s,l,c,u){var d,f,p,h,m,g,v,y,b;if(f=i.getEl("scroll"+t)){if(y=a.toLowerCase(),b=s.toLowerCase(),i.getEl("absend")&&e.css(i.getEl("absend"),y,i.layoutRect()[l]-1),!c)return void e.css(f,"display","none");e.css(f,"display","block"),d=i.getEl("body"),p=i.getEl("scroll"+t+"t"),h=d["client"+s]-2*o,h-=n&&r?f["client"+u]:0,m=d["scroll"+s],g=h/m,v={},v[y]=d["offset"+a]+o,v[b]=h,e.css(f,v),v={},v[y]=d["scroll"+a]*g,v[b]=h*g,e.css(p,v)}}var n,r,a;a=i.getEl("body"),n=a.scrollWidth>a.clientWidth,r=a.scrollHeight>a.clientHeight,t("h","Left","Width","contentW",n,"Height"),t("v","Top","Height","contentH",r,"Width")}function r(){function n(n,r,a,s,l){var c,u=i._id+"-scroll"+n,d=i.classPrefix;i.getEl().appendChild(e.createFragment('<div id="'+u+'" class="'+d+"scrollbar "+d+"scrollbar-"+n+'"><div id="'+u+'t" class="'+d+'scrollbar-thumb"></div></div>')),i.draghelper=new t(u+"t",{start:function(){c=i.getEl("body")["scroll"+r],e.addClass(e.get(u),d+"active")},drag:function(e){var t,u,d,f,p=i.layoutRect();u=p.contentW>p.innerW,d=p.contentH>p.innerH,f=i.getEl("body")["client"+a]-2*o,f-=u&&d?i.getEl("scroll"+n)["client"+l]:0,t=f/i.getEl("body")["scroll"+a],i.getEl("body")["scroll"+r]=c+e["delta"+s]/t},stop:function(){e.removeClass(e.get(u),d+"active")}})}i.addClass("scroll"),n("v","Top","Height","Y","Width"),n("h","Left","Width","X","Height")}var i=this,o=2;i.settings.autoScroll&&(i._hasScroll||(i._hasScroll=!0,r(),i.on("wheel",function(e){var t=i.getEl("body");t.scrollLeft+=10*(e.deltaX||0),t.scrollTop+=10*e.deltaY,n()}),e.on(i.getEl("body"),"scroll",n)),n())}}}),r(ee,[J,Z],function(e,t){return e.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[t],renderHtml:function(){var e=this,t=e._layout,n=e.settings.html;return e.preRender(),t.preRender(e),"undefined"==typeof n?n='<div id="'+e._id+'-body" class="'+e.classes("body")+'">'+t.renderHtml(e)+"</div>":("function"==typeof n&&(n=n.call(e)),e._hasBody=!1),'<div id="'+e._id+'" class="'+e.classes()+'" hidefocus="1" tabindex="-1" role="group">'+(e._preBodyHtml||"")+n+"</div>"}})}),r(te,[K],function(e){function t(t,n,r){var i,o,a,s,l,c,u,d,f,p;return f=e.getViewPort(),o=e.getPos(n),a=o.x,s=o.y,t._fixed&&"static"==e.getRuntimeStyle(document.body,"position")&&(a-=f.x,s-=f.y),i=t.getEl(),p=e.getSize(i),l=p.width,c=p.height,p=e.getSize(n),u=p.width,d=p.height,r=(r||"").split(""),"b"===r[0]&&(s+=d),"r"===r[1]&&(a+=u),"c"===r[0]&&(s+=Math.round(d/2)),"c"===r[1]&&(a+=Math.round(u/2)),"b"===r[3]&&(s-=c),"r"===r[4]&&(a-=l),"c"===r[3]&&(s-=Math.round(c/2)),"c"===r[4]&&(a-=Math.round(l/2)),{x:a,y:s,w:l,h:c}}return{testMoveRel:function(n,r){for(var i=e.getViewPort(),o=0;o<r.length;o++){var a=t(this,n,r[o]);if(this._fixed){if(a.x>0&&a.x+a.w<i.w&&a.y>0&&a.y+a.h<i.h)return r[o]}else if(a.x>i.x&&a.x+a.w<i.w+i.x&&a.y>i.y&&a.y+a.h<i.h+i.y)return r[o]}return r[0]},moveRel:function(e,n){"string"!=typeof n&&(n=this.testMoveRel(e,n));var r=t(this,e,n);return this.moveTo(r.x,r.y)},moveBy:function(e,t){var n=this,r=n.layoutRect();return n.moveTo(r.x+e,r.y+t),n},moveTo:function(t,n){function r(e,t,n){return 0>e?0:e+n>t?(e=t-n,0>e?0:e):e}var i=this;if(i.settings.constrainToViewport){var o=e.getViewPort(window),a=i.layoutRect();t=r(t,o.w+o.x,a.w),n=r(n,o.h+o.y,a.h)}return i._rendered?i.layoutRect({x:t,y:n}).repaint():(i.settings.x=t,i.settings.y=n),i.fire("move",{x:t,y:n}),i}}}),r(ne,[K],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(re,[ee,te,ne,K],function(e,t,n,r){function i(){function e(e,t){for(;e;){if(e==t)return!0;e=e.parent()}}u||(u=function(t){if(2!=t.button)for(var n=p.length;n--;){var r=p[n],i=r.getParentCtrl(t.target);if(r.settings.autohide){if(i&&(e(i,r)||r.parent()===i))continue;t=r.fire("autohide",{target:t.target}),t.isDefaultPrevented()||r.hide()}}},r.on(document,"click",u))}function o(){d||(d=function(){var e;for(e=p.length;e--;)s(p[e])},r.on(window,"scroll",d))}function a(){if(!f){var e=document.documentElement,t=e.clientWidth,n=e.clientHeight;f=function(){document.all&&t==e.clientWidth&&n==e.clientHeight||(t=e.clientWidth,n=e.clientHeight,g.hideAll())},r.on(window,"resize",f)}}function s(e){function t(t,n){for(var r,i=0;i<p.length;i++)if(p[i]!=e)for(r=p[i].parent();r&&(r=r.parent());)r==e&&p[i].fixed(t).moveBy(0,n).repaint()}var n=r.getViewPort().y;e.settings.autofix&&(e._fixed?e._autoFixY>n&&(e.fixed(!1).layoutRect({y:e._autoFixY}).repaint(),t(!1,e._autoFixY-n)):(e._autoFixY=e.layoutRect().y,e._autoFixY<n&&(e.fixed(!0).layoutRect({y:0}).repaint(),t(!0,n-e._autoFixY))))}function l(e,t){var n,i=g.zIndex||65535,o;if(e)h.push(t);else for(n=h.length;n--;)h[n]===t&&h.splice(n,1);if(h.length)for(n=0;n<h.length;n++)h[n].modal&&(i++,o=h[n]),h[n].getEl().style.zIndex=i,h[n].zIndex=i,i++;var a=document.getElementById(t.classPrefix+"modal-block");o?r.css(a,"z-index",o.zIndex-1):a&&(a.parentNode.removeChild(a),m=!1),g.currentZIndex=i}function c(e){var t;for(t=p.length;t--;)p[t]===e&&p.splice(t,1);for(t=h.length;t--;)h[t]===e&&h.splice(t,1)}var u,d,f,p=[],h=[],m,g=e.extend({Mixins:[t,n],init:function(e){var t=this;t._super(e),t._eventsRoot=t,t.addClass("floatpanel"),e.autohide&&(i(),a(),p.push(t)),e.autofix&&(o(),t.on("move",function(){s(this)})),t.on("postrender show",function(e){if(e.control==t){var n,i=t.classPrefix;t.modal&&!m&&(n=r.createFragment('<div id="'+i+'modal-block" class="'+i+"reset "+i+'fade"></div>'),n=n.firstChild,t.getContainerElm().appendChild(n),setTimeout(function(){r.addClass(n,i+"in"),r.addClass(t.getEl(),i+"in")},0),m=!0),l(!0,t)}}),t.on("show",function(){t.parents().each(function(e){return e._fixed?(t.fixed(!0),!1):void 0})}),e.popover&&(t._preBodyHtml='<div class="'+t.classPrefix+'arrow"></div>',t.addClass("popover").addClass("bottom").addClass(t.isRtl()?"end":"start"))},fixed:function(e){var t=this;if(t._fixed!=e){if(t._rendered){var n=r.getViewPort();e?t.layoutRect().y-=n.y:t.layoutRect().y+=n.y}t.toggleClass("fixed",e),t._fixed=e}return t},show:function(){var e=this,t,n=e._super();for(t=p.length;t--&&p[t]!==e;);return-1===t&&p.push(e),n},hide:function(){return c(this),l(!1,this),this._super()},hideAll:function(){g.hideAll()},close:function(){var e=this;return e.fire("close").isDefaultPrevented()||(e.remove(),l(!1,e)),e},remove:function(){c(this),this._super()},postRender:function(){var e=this;return e.settings.bodyRole&&this.getEl("body").setAttribute("role",e.settings.bodyRole),e._super()}});return g.hideAll=function(){for(var e=p.length;e--;){var t=p[e];t&&t.settings.autohide&&(t.hide(),p.splice(e,1))}},g}),r(ie,[re,ee,K,Q],function(e,t,n,r){var i=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 n=this;n._super(e),n.isRtl()&&n.addClass("rtl"),n.addClass("window"),n._fixed=!0,e.buttons&&(n.statusbar=new t({layout:"flex",border:"1 0 0 0",spacing:3,padding:10,align:"center",pack:n.isRtl()?"start":"end",defaults:{type:"button"},items:e.buttons}),n.statusbar.addClass("foot"),n.statusbar.parent(n)),n.on("click",function(e){-1!=e.target.className.indexOf(n.classPrefix+"close")&&n.close()}),n.on("cancel",function(){n.close()}),n.aria("describedby",n.describedBy||n._id+"-none"),n.aria("label",e.title),n._fullscreen=!1},recalc:function(){var e=this,t=e.statusbar,r,i,o,a;e._fullscreen&&(e.layoutRect(n.getWindowSize()),e.layoutRect().contentH=e.layoutRect().innerH),e._super(),r=e.layoutRect(),e.settings.title&&!e._fullscreen&&(i=r.headerW,i>r.w&&(o=r.x-Math.max(0,i/2),e.layoutRect({w:i,x:o}),a=!0)),t&&(t.layoutRect({w:e.layoutRect().innerW}).recalc(),i=t.layoutRect().minW+r.deltaW,i>r.w&&(o=r.x-Math.max(0,i-r.w),e.layoutRect({w:i,x:o}),a=!0)),a&&e.recalc()},initLayoutRect:function(){var e=this,t=e._super(),r=0,i;if(e.settings.title&&!e._fullscreen){i=e.getEl("head");var o=n.getSize(i);t.headerW=o.width,t.headerH=o.height,r+=t.headerH}e.statusbar&&(r+=e.statusbar.layoutRect().h),t.deltaH+=r,t.minH+=r,t.h+=r;var a=n.getWindowSize();return t.x=Math.max(0,a.w/2-t.w/2),t.y=Math.max(0,a.h/2-t.h/2),t},renderHtml:function(){var e=this,t=e._layout,n=e._id,r=e.classPrefix,i=e.settings,o="",a="",s=i.html;return e.preRender(),t.preRender(e),i.title&&(o='<div id="'+n+'-head" class="'+r+'window-head"><div id="'+n+'-title" class="'+r+'title">'+e.encode(i.title)+'</div><button type="button" class="'+r+'close" aria-hidden="true">\xd7</button><div id="'+n+'-dragh" class="'+r+'dragh"></div></div>'),i.url&&(s='<iframe src="'+i.url+'" tabindex="-1"></iframe>'),"undefined"==typeof s&&(s=t.renderHtml(e)),e.statusbar&&(a=e.statusbar.renderHtml()),'<div id="'+n+'" class="'+e.classes()+'" hidefocus="1"><div class="'+e.classPrefix+'reset" role="application">'+o+'<div id="'+n+'-body" class="'+e.classes("body")+'">'+s+"</div>"+a+"</div></div>"},fullscreen:function(e){var t=this,r=document.documentElement,i,o=t.classPrefix,a;if(e!=t._fullscreen)if(n.on(window,"resize",function(){var e;if(t._fullscreen)if(i)t._timer||(t._timer=setTimeout(function(){var e=n.getWindowSize();t.moveTo(0,0).resizeTo(e.w,e.h),t._timer=0},50));else{e=(new Date).getTime();var r=n.getWindowSize();t.moveTo(0,0).resizeTo(r.w,r.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,n.addClass(r,o+"fullscreen"),n.addClass(document.body,o+"fullscreen"),t.addClass("fullscreen");var s=n.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,n.removeClass(r,o+"fullscreen"),n.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;setTimeout(function(){e.addClass("in")},0),e._super(),e.statusbar&&e.statusbar.postRender(),e.focus(),this.dragHelper=new r(e._id+"-dragh",{start:function(){t={x:e.layoutRect().x,y:e.layoutRect().y}},drag:function(n){e.moveTo(t.x+n.deltaX,t.y+n.deltaY)}}),e.on("submit",function(t){t.isDefaultPrevented()||e.close()})},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e=this,t=e.classPrefix;e.dragHelper.destroy(),e._super(),e.statusbar&&this.statusbar.remove(),e._fullscreen&&(n.removeClass(document.documentElement,t+"fullscreen"),n.removeClass(document.body,t+"fullscreen"))},getContentWindow:function(){var e=this.getEl().getElementsByTagName("iframe")[0];return e?e.contentWindow:null}});return i}),r(oe,[ie],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){function r(e,t,n){return{type:"button",text:e,subtype:n?"primary":"",onClick:function(e){e.control.parents()[1].close(),o(t)}}}var i,o=n.callback||function(){};switch(n.buttons){case t.OK_CANCEL:i=[r("Ok",!0,!0),r("Cancel",!1)];break;case t.YES_NO:case t.YES_NO_CANCEL:i=[r("Yes",1,!0),r("No",0)],n.buttons==t.YES_NO_CANCEL&&i.push(r("Cancel",-1));break;default:i=[r("Ok",!0,!0)]}return new e({padding:20,x:n.x,y:n.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:i,title:n.title,role:"alertdialog",items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:n.text},onPostRender:function(){this.aria("describedby",this.items()[0]._id)},onClose:n.onClose,onCancel:function(){o(!1)}}).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(ae,[ie,oe],function(e,t){return function(n){function r(){return o.length?o[o.length-1]:void 0}var i=this,o=[];i.windows=o,n.on("remove",function(){for(var e=o.length;e--;)o[e].close()}),i.open=function(t,r){var i;return n.editorManager.setActive(n),t.title=t.title||" ",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",onclick:function(){i.find("form")[0].submit()}},{text:"Cancel",onclick:function(){i.close()}}]),i=new e(t),o.push(i),i.on("close",function(){for(var e=o.length;e--;)o[e]===i&&o.splice(e,1);o.length||n.focus()}),t.data&&i.on("postRender",function(){this.find("*").each(function(e){var n=e.name();n in t.data&&e.value(t.data[n])})}),i.features=t||{},i.params=r||{},1===o.length&&n.nodeChanged(),i.renderTo().reflow()},i.alert=function(e,r,i){t.alert(e,function(){r?r.call(i||this):n.focus()})},i.confirm=function(e,n,r){t.confirm(e,function(e){n.call(r||this,e)})},i.close=function(){r()&&r().close()},i.getParams=function(){return r()?r().params:null},i.setParams=function(e){r()&&(r().params=e)},i.getWindows=function(){return o}}}),r(se,[B,x,h,_,g,u,d],function(e,t,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(e){var t;e.dataTransfer&&(s.selection.isCollapsed()&&"IMG"==e.target.tagName&&Q.select(e.target),t=s.selection.getContent(),t.length>0&&e.dataTransfer.setData(ae,oe+escape(t)))}function f(e){var t,n;return e.dataTransfer&&(t=e.dataTransfer.getData(ae),t&&t.indexOf(oe)>=0&&(n=unescape(t.substr(oe.length)))),n}function p(e){s.queryCommandSupported("mceInsertClipboardContent")?s.execCommand("mceInsertClipboardContent",!1,{content:e}):s.execCommand("mceInsertContent",!1,e)}function h(){function r(e){var t=v.schema.getBlockElements(),n=s.getBody();if("BR"!=e.nodeName)return!1;for(e=e;e!=n&&!t[e.nodeName];e=e.parentNode)if(e.nextSibling)return!1;return!0}function i(e,t){var n;for(n=e.nextSibling;n&&n!=t;n=n.nextSibling)if((3!=n.nodeType||0!==Y.trim(n.data).length)&&n!==t)return!1;return n===t}function o(e,t,i){var o,a,s;for(s=v.schema.getNonEmptyElements(),o=new n(i||e,e);a=o[t?"next":"prev"]();){if(s[a.nodeName]&&!r(a))return a;if(3==a.nodeType&&a.data.length>0)return a}}function l(e){var n,r,i,a,l;if(!e.collapsed&&(n=v.getParent(t.getNode(e.startContainer,e.startOffset),v.isBlock),r=v.getParent(t.getNode(e.endContainer,e.endOffset),v.isBlock),l=s.schema.getTextBlockElements(),n!=r&&l[n.nodeName]&&l[r.nodeName]&&"false"!==v.getContentEditable(n)&&"false"!==v.getContentEditable(r)))return e.deleteContents(),i=o(n,!1),a=o(r,!0),v.isEmpty(r)||Y(n).append(r.childNodes),Y(r).remove(),i?1==i.nodeType?"BR"==i.nodeName?(e.setStartBefore(i),e.setEndBefore(i)):(e.setStartAfter(i),e.setEndAfter(i)):(e.setStart(i,i.data.length),e.setEnd(i,i.data.length)):a&&(1==a.nodeType?(e.setStartBefore(a),e.setEndBefore(a)):(e.setStart(a,0),e.setEnd(a,0))),y.setRng(e),!0}function c(e,n){var r,a,l,c,u,d;if(!e.collapsed)return e;if(u=e.startContainer,d=e.startOffset,3==u.nodeType)if(n){if(d<u.data.length)return e}else if(d>0)return e;if(r=t.getNode(e.startContainer,e.startOffset),l=v.getParent(r,v.isBlock),a=o(s.getBody(),n,r),c=v.getParent(a,v.isBlock),!r||!a)return e;if(c&&l!=c)if(n){if(!i(l,c))return e;1==r.nodeType?"BR"==r.nodeName?e.setStartBefore(r):e.setStartAfter(r):e.setStart(r,r.data.length),1==a.nodeType?e.setEnd(a,0):e.setEndBefore(a)}else{if(!i(c,l))return e;1==a.nodeType?"BR"==a.nodeName?e.setStartBefore(a):e.setStartAfter(a):e.setStart(a,a.data.length),1==r.nodeType?e.setEnd(r,0):e.setEndBefore(r)}return e}function h(e){var t=y.getRng();return t=c(t,e),l(t)?!0:void 0}function m(e){var t,n,r;h(e)||(a.each(s.getBody().getElementsByTagName("*"),function(e){"SPAN"==e.tagName&&e.setAttribute("mce-data-marked",1),!e.hasAttribute("data-mce-style")&&e.hasAttribute("style")&&s.dom.setAttrib(e,"style",s.dom.getAttrib(e,"style"))}),t=new b(function(){}),t.observe(s.getDoc(),{childList:!0,attributes:!0,subtree:!0,attributeFilter:["style"]}),s.getDoc().execCommand(e?"ForwardDelete":"Delete",!1,null),n=s.selection.getRng(),r=n.startContainer.parentNode,a.each(t.takeRecords(),function(e){if(v.isChildOf(e.target,s.getBody())){if("style"==e.attributeName){var t=e.target.getAttribute("data-mce-style");t?e.target.setAttribute("style",t):e.target.removeAttribute("style")}a.each(e.addedNodes,function(e){if("SPAN"==e.nodeName&&!e.getAttribute("mce-data-marked")){var t,i;e==r&&(t=n.startOffset,i=e.firstChild),v.remove(e,!0),i&&(n.setStart(i,t),n.setEnd(i,t),s.selection.setRng(n))}})}}),t.disconnect(),a.each(s.dom.select("span[mce-data-marked]"),function(e){e.removeAttribute("mce-data-marked")}))}var g=s.getDoc(),v=s.dom,y=s.selection,b=window.MutationObserver,C,x;b||(C=!0,b=function(){function e(e){var t=e.relatedNode||e.target;n.push({target:t,addedNodes:[t]})}function t(e){var t=e.relatedNode||e.target;n.push({target:t,attributeName:e.attrName})}var n=[],r;this.observe=function(n){r=n,r.addEventListener("DOMSubtreeModified",e,!1),r.addEventListener("DOMNodeInsertedIntoDocument",e,!1),r.addEventListener("DOMNodeInserted",e,!1),r.addEventListener("DOMAttrModified",t,!1)},this.disconnect=function(){r.removeEventListener("DOMSubtreeModified",e,!1),r.removeEventListener("DOMNodeInsertedIntoDocument",e,!1),r.removeEventListener("DOMNodeInserted",e,!1),r.removeEventListener("DOMAttrModified",t,!1)},this.takeRecords=function(){return n}}),s.on("keydown",function(e){var t=e.keyCode==X,n=e.ctrlKey||e.metaKey;if(!u(e)&&(t||e.keyCode==G)){var r=s.selection.getRng(),i=r.startContainer,o=r.startOffset;if(!n&&r.collapsed&&3==i.nodeType&&(t?o<i.data.length:o>0))return;e.preventDefault(),n&&s.selection.getSel().modify("extend",t?"forward":"backward",e.metaKey?"lineboundary":"word"),m(t)}}),s.on("keypress",function(t){if(!u(t)&&!y.isCollapsed()&&t.charCode&&!e.metaKeyPressed(t)){var n,r,i,o,a,l;n=s.selection.getRng(),l=String.fromCharCode(t.charCode),t.preventDefault(),r=Y(n.startContainer).parents().filter(function(e,t){return!!s.schema.getTextInlineElements()[t.nodeName]}),m(!0),r=r.filter(function(e,t){return!Y.contains(s.getBody(),t)}),r.length?(i=v.createFragment(),r.each(function(e,t){t=t.cloneNode(!1),i.hasChildNodes()?(t.appendChild(i.firstChild),i.appendChild(t)):(a=t,i.appendChild(t)),i.appendChild(t)}),a.appendChild(s.getDoc().createTextNode(l)),o=v.getParent(n.startContainer,v.isBlock),v.isEmpty(o)?Y(o).empty().append(i):n.insertNode(i),n.setStart(a.firstChild,1),n.setEnd(a.firstChild,1),s.selection.setRng(n)):s.selection.setContent(l)}}),s.addCommand("Delete",function(){m()}),s.addCommand("ForwardDelete",function(){m(!0)}),C||(s.on("dragstart",function(e){x=y.getRng(),d(e)}),s.on("drop",function(e){if(!u(e)){var n=f(e);n&&(e.preventDefault(),window.setTimeout(function(){var r=t.getCaretRangeFromPoint(e.x,e.y,g);x&&(y.setRng(x),x=null),m(),y.setRng(r),p(n)},0))}}),s.on("cut",function(e){!u(e)&&e.clipboardData&&(e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/html",s.selection.getContent()),e.clipboardData.setData("text/plain",s.selection.getContent({format:"text"})),m(!0))}))}function m(){function e(e){var t=J.create("body"),n=e.cloneContents();return t.appendChild(n),Q.serializer.serialize(t,{format:"html"})}function n(n){if(!n.setStart){if(n.item)return!1;var r=n.duplicate();return r.moveToElementText(s.getBody()),t.compareRanges(n,r)}var i=e(n),o=J.createRng();o.selectNode(s.getBody());var a=e(o);return i===a}s.on("keydown",function(e){var t=e.keyCode,r,i;if(!u(e)&&(t==X||t==G)){if(r=s.selection.isCollapsed(),i=s.getBody(),r&&!J.isEmpty(i))return;if(!r&&!n(s.selection.getRng()))return;e.preventDefault(),s.setContent(""),i.firstChild&&J.isBlock(i.firstChild)?s.selection.setCursorLocation(i.firstChild,0):s.selection.setCursorLocation(i,0),s.nodeChanged()}})}function g(){s.shortcuts.add("meta+a",null,"SelectAll")}function v(){s.settings.content_editable||(J.bind(s.getDoc(),"focusin",function(){Q.setRng(Q.getRng())}),J.bind(s.getDoc(),"mousedown mouseup",function(e){e.target==s.getDoc().documentElement&&(s.getBody().focus(),"mousedown"==e.type?Q.placeCaretAt(e.clientX,e.clientY):Q.setRng(Q.getRng()))}))}function y(){s.on("keydown",function(e){if(!u(e)&&e.keyCode===G){if(!s.getBody().getElementsByTagName("hr").length)return;if(Q.isCollapsed()&&0===Q.getRng(!0).startOffset){var t=Q.getNode(),n=t.previousSibling;if("HR"==t.nodeName)return J.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(J.remove(n),e.preventDefault())}}})}function b(){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 C(){s.on("click",function(e){var t=e.target;/^(IMG|HR)$/.test(t.nodeName)&&(e.preventDefault(),Q.getSel().setBaseAndExtent(t,0,t,1),s.nodeChanged()),"A"==t.nodeName&&J.hasClass(t,"mce-item-anchor")&&(e.preventDefault(),Q.select(t))})}function x(){function e(){var e=J.getAttribs(Q.getStart().cloneNode(!1));return function(){var t=Q.getStart();t!==s.getBody()&&(J.setAttrib(t,"style",null),K(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}}function t(){return!Q.isCollapsed()&&J.getParent(Q.getStart(),J.isBlock)!=J.getParent(Q.getEnd(),J.isBlock)}s.on("keypress",function(n){var r;return u(n)||8!=n.keyCode&&46!=n.keyCode||!t()?void 0:(r=e(),s.getDoc().execCommand("delete",!1,null),r(),n.preventDefault(),!1)}),J.bind(s.getDoc(),"cut",function(n){var r;!u(n)&&t()&&(r=e(),setTimeout(function(){r()},0))})}function w(){document.body.setAttribute("role","application")}function _(){s.on("keydown",function(e){if(!u(e)&&e.keyCode===G&&Q.isCollapsed()&&0===Q.getRng(!0).startOffset){var t=Q.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})}function E(){c()>7||(l("RespectVisibilityInDesign",!0),s.contentStyles.push(".mceHideBrInPre pre br {display: none}"),J.addClass(s.getBody(),"mceHideBrInPre"),ee.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"}),te.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 N(){J.bind(s.getBody(),"mouseup",function(){var e,t=Q.getNode();"IMG"==t.nodeName&&((e=J.getStyle(t,"width"))&&(J.setAttrib(t,"width",e.replace(/[^0-9%]+/g,"")),J.setStyle(t,"width","")),(e=J.getStyle(t,"height"))&&(J.setAttrib(t,"height",e.replace(/[^0-9%]+/g,"")),J.setStyle(t,"height","")))})}function k(){s.on("keydown",function(t){var n,r,i,o,a;if(!u(t)&&t.keyCode==e.BACKSPACE&&(n=Q.getRng(),r=n.startContainer,i=n.startOffset,o=J.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=J.createRng(),n.setStart(r,0),n.setEnd(r,0),Q.setRng(n))}})}function S(){function e(){s._refreshContentEditable(),l("StyleWithCSS",!1),l("enableInlineTableEditing",!1),Z.object_resizing||l("enableObjectResizing",!1)}Z.readonly||s.on("BeforeExecCommand MouseDown",e)}function T(){function e(){K(J.select("a"),function(e){var t=e.parentNode,n=J.getRoot();if(t.lastChild===e){for(;t&&!J.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}J.add(t,"br",{"data-mce-bogus":1})}})}s.on("SetContent ExecCommand",function(t){("setcontent"==t.type||"mceInsertLink"===t.command)&&e()})}function R(){Z.forced_root_block&&s.on("init",function(){l("DefaultParagraphSeparator",Z.forced_root_block)})}function A(){s.on("Undo Redo SetContent",function(e){e.initial||s.execCommand("mceRepaint")})}function B(){s.on("keydown",function(e){var t;u(e)||e.keyCode!=G||(t=s.getDoc().selection.createRange(),t&&t.item&&(e.preventDefault(),s.undoManager.beforeChange(),J.remove(t.item(0)),s.undoManager.add()))})}function D(){var e;c()>=10&&(e="",K("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 M(){c()<9&&(ee.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)}),te.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(),J.unbind(r,"mouseup",n),J.unbind(r,"mousemove",t),a=o=0}var r=J.doc,i=r.body,o,a,s;r.documentElement.unselectable=!0,J.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&&(J.bind(r,"mouseup",n),J.bind(r,"mousemove",t),J.getRoot().focus(),a.select())}})}function L(){s.on("keyup focusin mouseup",function(t){65==t.keyCode&&e.metaKeyPressed(t)||Q.normalize()},!0)}function P(){s.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function O(){s.inline||s.on("keydown",function(){document.activeElement==document.body&&s.getWin().focus()})}function I(){s.inline||(s.contentStyles.push("body {min-height: 150px}"),s.on("click",function(e){if("HTML"==e.target.nodeName){var t;t=s.selection.getRng(),s.getBody().focus(),s.selection.setRng(t),s.selection.normalize(),s.nodeChanged()}}))}function F(){o.mac&&s.on("keydown",function(t){!e.metaKeyPressed(t)||37!=t.keyCode&&39!=t.keyCode||(t.preventDefault(),s.selection.getSel().modify("move",37==t.keyCode?"backward":"forward","lineboundary"))})}function z(){l("AutoUrlDetect",!1)}function W(){s.inline||s.on("focus blur beforegetcontent",function(){var e=s.dom.create("br");s.getBody().appendChild(e),e.parentNode.removeChild(e)},!0)}function V(){s.on("click",function(e){var t=e.target;do if("A"===t.tagName)return void e.preventDefault();while(t=t.parentNode)}),s.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")}function U(){s.on("touchstart",function(e){var t,n,r,i;t=e.target,n=(new Date).getTime(),i=e.changedTouches,!i||i.length>1||(r=i[0],s.once("touchend",function(e){var i=e.changedTouches[0],o;(new Date).getTime()-n>500||Math.abs(r.clientX-i.clientX)>5||Math.abs(r.clientY-i.clientY)>5||(o={target:t},K("pageX pageY clientX clientY screenX screenY".split(" "),function(e){o[e]=i[e]}),o=s.fire("click",o),o.isDefaultPrevented()||(s.selection.placeCaretAt(i.clientX,i.clientY),s.nodeChanged()))}))})}function $(){s.on("init",function(){s.dom.bind(s.getBody(),"submit",function(e){e.preventDefault()})})}function q(){ee.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"==e[t].attr("class")&&e[t].remove()})}function j(){s.on("dragstart",function(e){d(e)}),s.on("drop",function(e){if(!u(e)){var n=f(e);if(n){e.preventDefault();var r=t.getCaretRangeFromPoint(e.x,e.y,s.getDoc());Q.setRng(r),p(n)}}})}var K=a.each,Y=s.$,G=e.BACKSPACE,X=e.DELETE,J=s.dom,Q=s.selection,Z=s.settings,ee=s.parser,te=s.serializer,ne=o.gecko,re=o.ie,ie=o.webkit,oe="data:text/mce-internal,",ae=re?"Text":"URL";k(),m(),L(),ie&&(h(),v(),C(),R(),$(),_(),q(),U(),o.iOS?(O(),I(),V()):g()),re&&o.ie<11&&(y(),w(),E(),N(),B(),D(),M(),H()),o.ie>=11&&(I(),W(),_()),o.ie&&(g(),z(),j()),ne&&(y(),b(),x(),S(),T(),A(),P(),F(),_())}}),r(le,[$],function(e){function t(t){return t._eventDispatcher||(t._eventDispatcher=new e({scope:t,toggleEvent:function(n,r){e.isNative(n)&&t.toggleNativeEvent&&t.toggleNativeEvent(n,r)}})),t._eventDispatcher}return{fire:function(e,n,r){var i=this;if(i.removed&&"remove"!==e)return n;if(n=t(i).fire(e,n,r),r!==!1&&i.parent)for(var o=i.parent();o&&!n.isPropagationStopped();)o.fire(e,n,!1),o=o.parent();return n},on:function(e,n,r){return t(this).on(e,n,r)},off:function(e,n){return t(this).off(e,n)},once:function(e,n){return t(this).once(e,n)},hasEventListeners:function(e){return t(this).has(e)}}}),r(ce,[le,y,d],function(e,t,n){function r(e,t){return"selectionchange"==t?e.getDoc():!e.inline&&/^mouse|click|contextmenu|drop|dragover|dragend/.test(t)?e.getDoc().documentElement:e.settings.event_root?(e.eventRoot||(e.eventRoot=o.select(e.settings.event_root)[0]),e.eventRoot):e.getBody()}function i(e,t){var n=r(e,t),i;if(e.delegates||(e.delegates={}),!e.delegates[t])if(e.settings.event_root){if(a||(a={},e.editorManager.on("removeEditor",function(){var t;if(!e.editorManager.activeEditor&&a){for(t in a)e.dom.unbind(r(e,t));a=null}})),a[t])return;i=function(n){for(var r=n.target,i=e.editorManager.editors,a=i.length;a--;){var s=i[a].getBody();(s===r||o.isChildOf(r,s))&&(i[a].hidden||i[a].fire(t,n))}},a[t]=i,o.bind(n,t,i)}else i=function(n){e.hidden||e.fire(t,n)},o.bind(n,t,i),e.delegates[t]=i}var o=t.DOM,a,s={bindPendingEventDelegates:function(){var e=this;n.each(e._pendingNativeEvents,function(t){i(e,t)})},toggleNativeEvent:function(e,t){var n=this;n.settings.readonly||"focus"!=e&&"blur"!=e&&(t?n.initialized?i(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(r(n,e),e,n.delegates[e]),delete n.delegates[e]))},unbindAllNativeEvents:function(){var e=this,t;if(e.delegates){for(t in e.delegates)e.dom.unbind(r(e,t),t,e.delegates[t]);delete e.delegates}e.inline||(e.getBody().onload=null,e.dom.unbind(e.getWin()),e.dom.unbind(e.getDoc())),e.dom.unbind(e.getBody()),e.dom.unbind(e.getContainer())}};return s=n.extend({},e,s)}),r(ue,[d,u],function(e,t){var n=e.each,r=e.explode,i={f9:120,f10:121,f11:122},o=e.makeMap("alt,ctrl,shift,meta,access");return function(a){function s(e,s,l,c){var u,d,f;f={func:l,scope:c||a,desc:a.translate(s)},n(r(e,"+"),function(e){e in o?f[e]=!0:/^[0-9]{2,}$/.test(e)?f.keyCode=parseInt(e,10):(f.charCode=e.charCodeAt(0),f.keyCode=i[e]||e.toUpperCase().charCodeAt(0))}),u=[f.keyCode];for(d in o)f[d]?u.push(d):f[d]=!1;return f.id=u.join(","),f.access&&(f.alt=!0,t.mac?f.ctrl=!0:f.shift=!0),f.meta&&(t.mac?f.meta=!0:(f.ctrl=!0,f.meta=!1)),f}var l=this,c={};a.on("keyup keypress keydown",function(e){(e.altKey||e.ctrlKey||e.metaKey)&&!e.isDefaultPrevented()&&n(c,function(t){return t.ctrl==e.ctrlKey&&t.meta==e.metaKey&&t.alt==e.altKey&&t.shift==e.shiftKey&&(e.keyCode==t.keyCode||e.charCode&&e.charCode==t.charCode)?(e.preventDefault(),"keydown"==e.type&&t.func.call(t.scope),!0):void 0})}),l.add=function(t,i,o,l){var u;return u=o,"string"==typeof o?o=function(){a.execCommand(u,!1,null)}:e.isArray(u)&&(o=function(){a.execCommand(u[0],u[1],u[2])}),n(r(t.toLowerCase()),function(e){var t=s(e,i,o,l);c[t.id]=t}),!0},l.remove=function(e){var t=s(e);return c[t.id]?(delete c[t.id],!0):!1}}}),r(de,[y,f,C,w,_,R,T,H,O,I,F,z,W,V,b,l,ae,E,k,se,u,d,ce,ue],function(e,n,r,i,o,a,s,l,c,u,d,f,p,h,m,g,v,y,b,C,x,w,_,E){function N(e,t,i){var o=this,a,s;a=o.documentBaseUrl=i.documentBaseURL,s=i.baseURI,o.settings=t=R({id:e,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:a,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%",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,th,ul,ol,li,dl,dt,dd,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,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",validate:!0,entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o,ie7_compat:!0},t),r.language=t.language||"en",r.languageLoad=t.language_load,r.baseURL=i.baseURL,o.id=t.id=e,o.isNotDirty=!0,o.plugins={},o.documentBaseURI=new h(t.document_base_url||a,{base_uri:s}),o.baseURI=s,o.contentCSS=[],o.contentStyles=[],o.shortcuts=new E(o),o.loadedCSS={},o.editorCommands=new p(o),t.target&&(o.targetElm=t.target),o.suffix=i.suffix,o.editorManager=i,o.inline=t.inline,t.cache_suffix&&(x.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),i.fire("SetupEditor",o),o.execCallback("setup",o),o.$=n.overrideDefaults(function(){return{context:o.inline?o.getBody():o.getDoc(),element:o.getBody()}})}var k=e.DOM,S=r.ThemeManager,T=r.PluginManager,R=w.extend,A=w.each,B=w.explode,D=w.inArray,M=w.trim,H=w.resolve,L=g.Event,P=x.gecko,O=x.ie;return N.prototype={render:function(){function e(){k.unbind(window,"ready",e),n.render()}function t(){var e=m.ScriptLoader;if(r.language&&"en"!=r.language&&!r.language_url&&(r.language_url=n.editorManager.baseURL+"/langs/"+r.language+".js"),r.language_url&&e.add(r.language_url),r.theme&&"function"!=typeof r.theme&&"-"!=r.theme.charAt(0)&&!S.urls[r.theme]){var t=r.theme_url;t=t?n.documentBaseURI.toAbsolute(t):"themes/"+r.theme+"/theme"+o+".js",S.load(r.theme,t)}w.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),A(r.external_plugins,function(e,t){T.load(t,e),r.plugins+=" "+t}),A(r.plugins.split(/[ ,]/),function(e){if(e=M(e),e&&!T.urls[e])if("-"==e.charAt(0)){e=e.substr(1,e.length);var t=T.dependencies(e);A(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=T.createUrl(t,e),T.load(e.resource,e)})}else T.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;if(!L.domLoaded)return void k.bind(window,"ready",e);if(n.getElement()&&x.contentEditable){r.inline?n.inline=!0:(n.orgVisibility=n.getElement().style.visibility,n.getElement().style.visibility="hidden");var a=n.getElement().form||k.getParent(i,"form");a&&(n.formElement=a,r.hidden_input&&!/TEXTAREA|INPUT/i.test(n.getElement().nodeName)&&(k.insertAfter(k.create("input",{type:"hidden",name:i}),i),n.hasHiddenInput=!0),n.formEventDelegate=function(e){n.fire(e.type,e)},k.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=!0,a._mceOldSubmit(a)})),n.windowManager=new v(n),"xml"==r.encoding&&n.on("GetContent",function(e){e.save&&(e.content=k.encode(e.content))}),r.add_form_submit_trigger&&n.on("submit",function(){n.initialized&&n.save()}),r.add_unload_trigger&&(n._beforeUnload=function(){!n.initialized||n.destroyed||n.isHidden()||n.save({format:"raw",no_events:!0,set_dirty:!1})},n.editorManager.on("BeforeUnload",n._beforeUnload)),t()}},init:function(){function e(n){var r=T.get(n),i,o;i=T.urls[n]||t.documentBaseUrl.replace(/\/$/,""),n=M(n),r&&-1===D(m,n)&&(A(T.dependencies(n),function(t){e(t)}),o=new r(t,i,t.$),t.plugins[n]=o,o.init&&(o.init(t,i),m.push(n)))}var t=this,n=t.settings,r=t.getElement(),i,o,a,s,l,c,u,d,f,p,h,m=[];if(this.editorManager.i18n.setCode(n.language),t.rtl=this.editorManager.i18n.rtl,t.editorManager.add(t),n.aria_label=n.aria_label||k.getAttrib(r,"aria-label",t.getLang("aria.rich_text_area")),n.theme&&("function"!=typeof n.theme?(n.theme=n.theme.replace(/-/,""),c=S.get(n.theme),t.theme=new c(t,S.urls[n.theme]),t.theme.init&&t.theme.init(t,S.urls[n.theme]||t.documentBaseUrl.replace(/\/$/,""),t.$)):t.theme=n.theme),A(n.plugins.replace(/\-/g,"").split(/[ ,]/),e),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,p=/^[0-9\.]+(|px)$/i,p.test(""+i)&&(i=Math.max(parseInt(i,10),100)),p.test(""+o)&&(o=Math.max(parseInt(o,10),a)),l=t.theme.renderUI({targetNode:r,width:i,height:o,deltaWidth:n.delta_width,deltaHeight:n.delta_height}),n.content_editable||(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&&A(B(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(t.iframeHTML=n.doctype+"<html><head>",n.document_base_url!=t.documentBaseUrl&&(t.iframeHTML+='<base href="'+t.documentBaseURI.getURI()+'" />'),!x.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" />',h=0;h<t.contentCSS.length;h++){var g=t.contentCSS[h];t.iframeHTML+='<link type="text/css" rel="stylesheet" href="'+w._addCacheSuffix(g)+'" />',t.loadedCSS[g]=!0}d=n.body_id||"tinymce",-1!=d.indexOf("=")&&(d=t.getParam("body_id","","hash"),d=d[t.id]||d),f=n.body_class||"",-1!=f.indexOf("=")&&(f=t.getParam("body_class","","hash"),f=f[t.id]||""),n.content_security_policy&&(t.iframeHTML+='<meta http-equiv="Content-Security-Policy" content="'+n.content_security_policy+'" />'),t.iframeHTML+='</head><body id="'+d+'" class="mce-content-body '+f+'" data-id="'+t.id+'"><br></body></html>';var v='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody(true);})()';document.domain!=location.hostname&&(u=v);var y=k.create("iframe",{id:t.id+"_ifr",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"}});if(y.onload=function(){y.onload=null,t.fire("load")},k.setAttrib(y,"src",u||'javascript:""'),t.contentAreaContainer=l.iframeContainer,t.iframeElement=y,s=k.add(l.iframeContainer,y),O)try{t.getDoc()}catch(b){s.src=u=v}l.editorContainer&&(k.get(l.editorContainer).style.display=t.orgDisplay,t.hidden=k.isHidden(l.editorContainer)),t.getElement().style.display="none",k.setAttrib(t.id,"aria-hidden",!0),u||t.initContentBody(),r=s=l=null},initContentBody:function(t){var n=this,r=n.settings,s=n.getElement(),p=n.getDoc(),h,m;r.inline||(n.getElement().style.visibility=n.orgVisibility),t||r.content_editable||(p.open(),p.write(n.iframeHTML),p.close()),r.content_editable&&(n.on("remove",function(){var e=this.getBody();k.removeClass(e,"mce-content-body"),k.removeClass(e,"mce-edit-focus"),k.setAttrib(e,"contentEditable",null)}),k.addClass(s,"mce-content-body"),n.contentDocument=p=r.content_document||document,n.contentWindow=r.content_window||window,n.bodyElement=s,r.content_document=r.content_window=null,r.root_name=s.nodeName.toLowerCase()),h=n.getBody(),h.disabled=!0,r.readonly||(n.inline&&"static"==k.getStyle(h,"position",!0)&&(h.style.position="relative"),h.contentEditable=n.getParam("content_editable_state",!0)),h.disabled=!1,n.schema=new y(r),n.dom=new e(p,{keep_values:!0,url_converter:n.convertURL,url_converter_scope:n,hex_colors:r.force_hex_style_colors,class_filter:r.class_filter,update_styles:!0,root_element:n.inline?n.getBody():null,collect:r.content_editable,schema:n.schema,onSetAttrib:function(e){n.fire("SetAttrib",e)}}),n.parser=new b(r,n.schema),n.parser.addAttributeFilter("src,href,style,tabindex",function(e,t){for(var r=e.length,i,o=n.dom,a,s;r--;)i=e[r],a=i.attr(t),s="data-mce-"+t,i.attributes.map[s]||("style"===t?(a=o.serializeStyle(o.parseStyle(a),i.name),a.length||(a=null),i.attr(s,a),i.attr(t,a)):"tabindex"===t?(i.attr(s,a),i.attr(t,null)):i.attr(s,n.convertURL(a,t,i.name)))}),n.parser.addNodeFilter("script",function(e){for(var t=e.length,n;t--;)n=e[t],n.attr("type","mce-"+(n.attr("type")||"no/type"))}),n.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+"]]"}),n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t=e.length,r,i=n.schema.getNonEmptyElements();t--;)r=e[t],r.isEmpty(i)&&(r.append(new o("br",1)).shortEnded=!0)}),n.serializer=new a(r,n),n.selection=new l(n.dom,n.getWin(),n.serializer,n),n.formatter=new c(n),n.undoManager=new u(n),n.forceBlocks=new f(n),n.enterKey=new d(n),n._nodeChangeDispatcher=new i(n),n.fire("PreInit"),r.browser_spellcheck||r.gecko_spellcheck||(p.body.spellcheck=!1,k.setAttrib(h,"spellcheck","false")),n.fire("PostRender"),n.quirks=new C(n),r.directionality&&(h.dir=r.directionality),r.nowrap&&(h.style.whiteSpace="nowrap"),r.protect&&n.on("BeforeSetContent",function(e){A(r.protect,function(t){e.content=e.content.replace(t,function(e){return"<!--mce:protected "+escape(e)+"-->"})})}),n.on("SetContent",function(){n.addVisual(n.getBody())}),r.padd_empty_editor&&n.on("PostProcess",function(e){e.content=e.content.replace(/^(<p[^>]*>(&nbsp;|&#160;|\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")}),n.load({initial:!0,format:"html"}),n.startContent=n.getContent({format:"raw"}),n.initialized=!0,n.bindPendingEventDelegates(),n.fire("init"),n.focus(!0),n.nodeChanged({initial:!0}),n.execCallback("init_instance_callback",n),n.contentStyles.length>0&&(m="",A(n.contentStyles,function(e){m+=e+"\r\n"}),n.dom.addStyle(m)),A(n.contentCSS,function(e){n.loadedCSS[e]||(n.dom.loadCSS(e),n.loadedCSS[e]=!0)}),r.auto_focus&&setTimeout(function(){var e;e=r.auto_focus===!0?n:n.editorManager.get(r.auto_focus),e.destroyed||e.focus()},100),s=p=h=null},focus:function(e){var t=this,n=t.selection,r=t.settings.content_editable,i,o,a=t.getDoc(),s;if(!e){if(i=n.getRng(),i.item&&(o=i.item(0)),t._refreshContentEditable(),r||(x.opera||t.getBody().focus(),t.getWin().focus()),P||r){if(s=t.getBody(),s.setActive)try{s.setActive()}catch(l){s.focus()}else s.focus();r&&n.normalize()}o&&o.ownerDocument==a&&(i=a.body.createControlRange(),i.addElement(o),i.select())}t.editorManager.setActive(t)},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.data[t+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,r){return n.data[t+"."+r]||"{#"+r+"}"}):""},getLang:function(e,n){return this.editorManager.i18n.data[(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?A(r.split(r.indexOf("=")>0?/[;,](?![^=;,]*(?:[;,]|$))/:","),function(e){e=e.split("="),e.length>1?i[M(e[0])]=M(e[1]):i[M(e[0])]=M(e)}):i=r,i):r},nodeChanged:function(e){this._nodeChangeDispatcher.nodeChanged(e);
+
+},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.text||t.icon||(t.icon=e),n.buttons=n.buttons||{},t.tooltip=t.tooltip||t.title,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.editorCommands.addCommand(e,t,n)},addQueryStateHandler:function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n)},addQueryValueHandler:function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n)},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},queryCommandState:function(e){return this.editorCommands.queryCommandState(e)},queryCommandValue:function(e){return this.editorCommands.queryCommandValue(e)},queryCommandSupported:function(e){return this.editorCommands.queryCommandSupported(e)},show:function(){var e=this;e.hidden&&(e.hidden=!1,e.inline?e.getBody().contentEditable=!0:(k.show(e.getContainer()),k.hide(e.id)),e.load(),e.fire("show"))},hide:function(){var e=this,t=e.getDoc();e.hidden||(O&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable=!1,e==e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(k.hide(e.getContainer()),k.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"))},isHidden:function(){return!!this.hidden},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):void 0},save:function(e){var t=this,n=t.getElement(),r,i;if(n&&t.initialized)return e=e||{},e.save=!0,e.element=n,r=e.content=t.getContent(e),e.no_events||t.fire("SaveContent",e),r=e.content,/TEXTAREA|INPUT/i.test(n.nodeName)?n.value=r:(t.inline||(n.innerHTML=r),(i=k.getParent(t.id,"form"))&&A(i.elements,function(e){return e.name==t.id?(e.value=r,!1):void 0})),e.element=n=null,e.set_dirty!==!1&&(t.isNotDirty=!0),r},setContent:function(e,t){var n=this,r=n.getBody(),i;return t=t||{},t.format=t.format||"html",t.set=!0,t.content=e,t.no_events||n.fire("BeforeSetContent",t),e=t.content,0===e.length||/^\s+$/.test(e)?(i=n.settings.forced_root_block,i&&n.schema.isValidChild(r.nodeName.toLowerCase(),i.toLowerCase())?(e=O&&11>O?"":'<br data-mce-bogus="1">',e=n.dom.createHTML(i,n.settings.forced_root_block_attrs,e)):O||(e='<br data-mce-bogus="1">'),n.dom.setHTML(r,e),n.fire("SetContent",t)):("raw"!==t.format&&(e=new s({},n.schema).serialize(n.parser.parse(e,{isRootContent:!0}))),t.content=M(e),n.dom.setHTML(r,t.content),t.no_events||n.fire("SetContent",t)),t.content},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),"text"!=e.format?e.content=M(n):e.content=n,e.no_events||t.fire("GetContent",e),e.content},insertContent:function(e,t){t&&(e=R({content:e},t)),this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty},getContainer:function(){var e=this;return e.container||(e.container=k.get(e.editorContainer||e.id+"_parent")),e.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return this.targetElm||(this.targetElm=k.get(this.id)),this.targetElm},getWin:function(){var e=this,t;return e.contentWindow||(t=e.iframeElement,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),A(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":return o=r.visual_table_class||"mce-item-table",t=i.getAttrib(e,"border"),void(t&&"0"!=t||!n.hasVisual?i.removeClass(e,o):i.addClass(e,o));case"A":return void(i.getAttrib(e,"href",!1)||(t=i.getAttrib(e,"name")||e.id,o=r.visual_anchor_class||"mce-item-anchor",t&&n.hasVisual?i.addClass(e,o):i.removeClass(e,o)))}}),n.fire("VisualAid",{element:e,hasVisual:n.hasVisual})},remove:function(){var e=this;e.removed||(e.save(),e.removed=1,e.unbindAllNativeEvents(),e.hasHiddenInput&&k.remove(e.getElement().nextSibling),e.inline||(O&&10>O&&e.getDoc().execCommand("SelectAll",!1,null),k.setStyle(e.id,"display",e.orgDisplay),e.getBody().onload=null),e.fire("remove"),e.editorManager.remove(e),k.remove(e.getContainer()),e.destroy())},destroy:function(e){var t=this,n;if(!t.destroyed){if(!e&&!t.removed)return void t.remove();e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),t.selection.destroy(),t.dom.destroy()),n=t.formElement,n&&(n._mceOldSubmit&&(n.submit=n._mceOldSubmit,n._mceOldSubmit=null),k.unbind(n,"submit reset",t.formEventDelegate)),t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=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 P?(e=this.selection.getSel(),!e||!e.rangeCount||0===e.rangeCount):0}},R(N.prototype,_),N}),r(fe,[],function(){var e={},t="en";return{setCode:function(e){e&&(t=e,this.rtl=this.data[e]?"rtl"===this.data[e]._dir:!1)},getCode:function(){return t},rtl:!1,add:function(t,n){var r=e[t];r||(e[t]=r={});for(var i in n)r[i]=n[i];this.setCode(t)},translate:function(n){var r;if(r=e[t],r||(r={}),"undefined"==typeof n)return n;if("string"!=typeof n&&n.raw)return n.raw;if(n.push){var i=n.slice(1);n=(r[n[0]]||n[0]).replace(/\{([0-9]+)\}/g,function(e,t){return i[t]})}return(r[n]||n).replace(/{context:\w+}$/,"")},data:e}}),r(pe,[y,u],function(e,t){function n(e){function s(){try{return document.activeElement}catch(e){return document.body}}function l(e,t){if(t&&t.startContainer){if(!e.isChildOf(t.startContainer,e.getRoot())||!e.isChildOf(t.endContainer,e.getRoot()))return;return{startContainer:t.startContainer,startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset}}return t}function c(e,t){var n;return t.startContainer?(n=e.getDoc().createRange(),n.setStart(t.startContainer,t.startOffset),n.setEnd(t.endContainer,t.endOffset)):n=t,n}function u(e){return!!a.getParent(e,n.isEditorUIElement)}function d(n){var d=n.editor;d.on("init",function(){(d.inline||t.ie)&&("onbeforedeactivate"in document&&t.ie<9?d.dom.bind(d.getBody(),"beforedeactivate",function(e){if(e.target==d.getBody())try{d.lastRng=d.selection.getRng()}catch(t){}}):d.on("nodechange mouseup keyup",function(e){var t=s();"nodechange"==e.type&&e.selectionChange||(t&&t.id==d.id+"_ifr"&&(t=d.getBody()),d.dom.isChildOf(t,d.getBody())&&(d.lastRng=d.selection.getRng()))}),t.webkit&&!r&&(r=function(){var t=e.activeEditor;if(t&&t.selection){var n=t.selection.getRng();n&&!n.collapsed&&(d.lastRng=n)}},a.bind(document,"selectionchange",r)))}),d.on("setcontent",function(){d.lastRng=null}),d.on("mousedown",function(){d.selection.lastFocusBookmark=null}),d.on("focusin",function(){var t=e.focusedEditor;d.selection.lastFocusBookmark&&(d.selection.setRng(c(d,d.selection.lastFocusBookmark)),d.selection.lastFocusBookmark=null),t!=d&&(t&&t.fire("blur",{focusedEditor:d}),e.setActive(d),e.focusedEditor=d,d.fire("focus",{blurredEditor:t}),d.focus(!0)),d.lastRng=null}),d.on("focusout",function(){window.setTimeout(function(){var t=e.focusedEditor;u(s())||t!=d||(d.fire("blur",{focusedEditor:null}),e.focusedEditor=null,d.selection&&(d.selection.lastFocusBookmark=null))},0)}),i||(i=function(t){var n=e.activeEditor;n&&t.target.ownerDocument==document&&(n.selection&&t.target!=n.getBody()&&(n.selection.lastFocusBookmark=l(n.dom,n.lastRng)),t.target==document.body||u(t.target)||e.focusedEditor!=n||(n.fire("blur",{focusedEditor:null}),e.focusedEditor=null))},a.bind(document,"focusin",i)),d.inline&&!o&&(o=function(t){var n=e.activeEditor;if(n.inline&&!n.dom.isChildOf(t.target,n.getBody())){var r=n.selection.getRng();r.collapsed||(n.lastRng=r)}},a.bind(document,"mouseup",o))}function f(t){e.focusedEditor==t.editor&&(e.focusedEditor=null),e.activeEditor||(a.unbind(document,"selectionchange",r),a.unbind(document,"focusin",i),a.unbind(document,"mouseup",o),r=i=o=null)}e.on("AddEditor",d),e.on("RemoveEditor",f)}var r,i,o,a=e.DOM;return n.isEditorUIElement=function(e){return-1!==e.className.toString().indexOf("mce-")},n}),r(he,[de,f,y,V,u,d,le,fe,pe],function(e,t,n,r,i,o,a,s,l){function c(e){var t=v.editors,n;delete t[e.id];for(var r=0;r<t.length;r++)if(t[r]==e){t.splice(r,1),n=!0;break}return v.activeEditor==e&&(v.activeEditor=t[0]),v.focusedEditor==e&&(v.focusedEditor=null),n}function u(e){return e&&!(e.getContainer()||e.getBody()).parentNode&&(c(e),e.unbindAllNativeEvents(),e.destroy(!0),e=null),e}var d=n.DOM,f=o.explode,p=o.each,h=o.extend,m=0,g,v;return v={$:t,majorVersion:"4",minorVersion:"1.10",releaseDate:"2015-05-05",editors:[],i18n:s,activeEditor:null,setup:function(){var e=this,t,n,i="",o,a;if(n=document.location.href,/^[^:]+:\/\/\/?[^\/]+\//.test(n)&&(n=n.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(n)||(n+="/")),o=window.tinymce||window.tinyMCEPreInit)t=o.base||o.baseURL,i=o.suffix;else{for(var s=document.getElementsByTagName("script"),c=0;c<s.length;c++)if(a=s[c].src,/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(a)){-1!=a.indexOf(".min")&&(i=".min"),t=a.substring(0,a.lastIndexOf("/"));break}!t&&document.currentScript&&(a=document.currentScript.src,-1!=a.indexOf(".min")&&(i=".min"),t=a.substring(0,a.lastIndexOf("/")))}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&&!d.get(t)?e.name:d.uniqueId(),e.setAttribute("id",t)),t}function r(t,n,r){if(!u(s.get(t))){var i=new e(t,n,s);i.targetElm=i.targetElm||r,l.push(i),i.render()}}function i(e){var n=t[e];if(n)return n.apply(s,Array.prototype.slice.call(arguments,2))}function o(e,t){return t.constructor===RegExp?t.test(e.className):d.hasClass(e,t)}function a(){var e,s;if(d.unbind(window,"ready",a),i("onpageload"),t.types)return void p(t.types,function(e){p(d.select(e.selector),function(i){r(n(i),h({},t,e),i)})});if(t.selector)return void p(d.select(t.selector),function(e){r(n(e),t,e)});switch(t.target&&r(n(t.target),t),t.mode){case"exact":e=t.elements||"",e.length>0&&p(f(e),function(e){var n;(n=d.get(e))?r(e,t,n):p(document.forms,function(n){p(n.elements,function(n){n.name===e&&(e="mce_editor_"+m++,d.setAttrib(n,"id",e),r(e,t,n))})})});break;case"textareas":case"specific_textareas":p(d.select("textarea"),function(e){t.editor_deselector&&o(e,t.editor_deselector)||(!t.editor_selector||o(e,t.editor_selector))&&r(n(e),t,e)})}t.oninit&&(e=s=0,p(l,function(t){s++,t.initialized?e++:t.on("init",function(){e++,e==s&&i("oninit")}),e==s&&i("oninit")}))}var s=this,l=[];s.settings=t,d.bind(window,"ready",a)},get:function(e){return arguments.length?e in this.editors?this.editors[e]:null:this.editors},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}),g||(g=function(){t.fire("BeforeUnload")},d.bind(window,"beforeunload",g)),e},createEditor:function(t,n){return this.add(new e(t,n,this))},remove:function(e){var t=this,n,r=t.editors,i;{if(e)return"string"==typeof e?(e=e.selector||e,void p(d.select(e),function(e){i=r[e.id],i&&t.remove(i)})):(i=e,r[i.id]?(c(i)&&t.fire("RemoveEditor",{editor:i}),r.length||d.unbind(window,"beforeunload",g),i.remove(),i):null);for(n=r.length-1;n>=0;n--)t.remove(r[n])}},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(){p(this.editors,function(e){e.save()})},addI18n:function(e,t){s.add(e,t)},translate:function(e){return s.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!=e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e}},h(v,a),v.setup(),window.tinymce=window.tinyMCE=v,v}),r(me,[he,d],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(n,r){"html4"===t.settings.schema&&e(r,{textDecoration:"underline"})},strike:function(t,n){e(n,{textDecoration:"line-through"})}},t.on("PreProcess SetContent",i))})})}),r(ge,[le,d],function(e,t){var n={send:function(e){function t(){!e.async||4==r.readyState||i++>1e4?(e.success&&1e4>i&&200==r.status?e.success.call(e.success_scope,""+r.responseText,r,e):e.error&&e.error.call(e.error_scope,i>1e4?"TIMED_OUT":"GENERAL",r,e),r=null):setTimeout(t,10)}var r,i=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||"",r=new XMLHttpRequest){if(r.overrideMimeType&&r.overrideMimeType(e.content_type),r.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(r.withCredentials=!0),e.content_type&&r.setRequestHeader("Content-Type",e.content_type),r.setRequestHeader("X-Requested-With","XMLHttpRequest"),r=n.fire("beforeSend",{xhr:r,settings:e}).xhr,r.send(e.data),!e.async)return t();setTimeout(t,10)}}};return t.extend(n,e),n}),r(ve,[],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="[";r<t.length;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(ye,[ve,ge,d],function(e,t,n){function r(e){this.settings=i({},e),this.count=0}var i=n.extend;return r.sendRPC=function(e){return(new r).send(e)},r.prototype={send:function(n){var r=n.error,o=n.success;n=i(this.settings,n),n.success=function(t,i){t=e.parse(t),"undefined"==typeof t&&(t={error:"JSON Parse error."}),t.error?r.call(n.error_scope||n.scope,t.error,i):o.call(n.success_scope||n.scope,t.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=e.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",t.send(n)}},r}),r(be,[y],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(Ce,[],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?u+e:i.indexOf(",",u),-1===r||r>i.length?null:(n=i.substring(u,r),u=r+1,n)}var r,i,s,u=0;if(a={},c){o.load(l),i=o.getAttribute(l)||"";do{var d=n();if(null===d)break;if(r=n(parseInt(d,32)||0),null!==r){if(d=n(),null===d)break;s=n(parseInt(d,32)||0),r&&(a[r]=s)}}while(null!==r);e()}}function r(){var t,n="";if(c){for(var r in a)t=a[r],n+=(n?",":"")+r.length.toString(32)+","+r+","+t.length.toString(32)+","+t;o.setAttribute(l,n);try{o.save(l)}catch(i){}e()}}var i,o,a,s,l,c;try{if(window.localStorage)return localStorage}catch(u){}return l="tinymce",o=document.documentElement,c=!!o.addBehavior,c&&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(xe,[y,l,b,C,d,u],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(we,[U,d],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(_e,[we],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(Ee,[Y,te],function(e,t){return e.extend({Mixins:[t],Defaults:{classes:"widget tooltip tooltip-n"},text:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t._rendered&&(t.getEl().lastChild.innerHTML=t.encode(e)),t):t._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(Ne,[Y,Ee],function(e,t){var n,r=e.extend({init:function(e){var t=this;t._super(e),e=t.settings,t.canFocus=!0,e.tooltip&&r.tooltips!==!1&&(t.on("mouseenter",function(n){var r=t.tooltip().moveTo(-65535);if(n.control==t){var i=r.text(e.tooltip).show().testMoveRel(t.getEl(),["bc-tc","bc-tl","bc-tr"]);r.toggleClass("tooltip-n","bc-tc"==i),r.toggleClass("tooltip-nw","bc-tl"==i),r.toggleClass("tooltip-ne","bc-tr"==i),r.moveRel(t.getEl(),i)}else r.hide()}),t.on("mouseleave mousedown click",function(){t.tooltip().hide()})),t.aria("label",e.ariaLabel||e.tooltip)},tooltip:function(){return n||(n=new t({type:"tooltip"}),n.renderTo()),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&&e.focus()},remove:function(){this._super(),n&&(n.remove(),n=null)}});return r}),r(ke,[Ne],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)},icon:function(e){var t=this,n=t.classPrefix;if("undefined"==typeof e)return t.settings.icon;if(t.settings.icon=e,e=e?n+"ico "+n+"i-"+t.settings.icon:"",t._rendered){var r=t.getEl().firstChild,i=r.getElementsByTagName("i")[0];e?(i&&i==r.firstChild||(i=document.createElement("i"),r.insertBefore(i,r.firstChild)),i.className=e):i&&r.removeChild(i),t.text(t._text)}return t},repaint:function(){var e=this.getEl().firstChild.style;e.width=e.height="100%",this._super()},text:function(e){var t=this;if(t._rendered){var n=t.getEl().lastChild.lastChild;n&&(n.data=t.translate(e))}return t._super(e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon,i;return i=e.settings.image,i?(r="none","string"!=typeof i&&(i=window.getSelection?i[0]:i[1]),i=" style=\"background-image: url('"+i+"')\""):i="",r=e.settings.icon?n+"ico "+n+"i-"+r:"",'<div id="'+t+'" class="'+e.classes()+'" tabindex="-1" aria-labelledby="'+t+'"><button role="presentation" type="button" tabindex="-1">'+(r?'<i class="'+r+'"'+i+"></i>":"")+(e._text?(r?"\xa0":"")+e.encode(e._text):"")+"</button></div>"}})}),r(Se,[J],function(e){return e.extend({Defaults:{defaultType:"button",role:"group"},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(Te,[Ne],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 t=this;return"undefined"!=typeof e?(e?t.addClass("checked"):t.removeClass("checked"),t._checked=e,t.aria("checked",e),t):t._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-labelledby="'+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(Re,[Ne,G,K],function(e,t,n){return e.extend({init:function(e){var t=this;t._super(e),t.addClass("combobox"),t.subinput=!0,t.ariaTarget="inp",e=t.settings,e.menu=e.menu||e.values,e.menu&&(e.icon="caret"),t.on("click",function(n){for(var r=n.target,i=t.getEl();r&&r!=i;)r.id&&-1!=r.id.indexOf("-open")&&(t.fire("action"),e.menu&&(t.showMenu(),n.aria&&t.menu.items()[0].focus())),r=r.parentNode}),t.on("keydown",function(e){"INPUT"==e.target.nodeName&&13==e.keyCode&&t.parents().reverse().each(function(n){return e.preventDefault(),t.fire("change"),n.hasEventListeners("submit")&&n.toJSON?(n.fire("submit",{data:n.toJSON()}),!1):void 0})}),e.placeholder&&(t.addClass("placeholder"),t.on("focusin",function(){t._hasOnChange||(n.on(t.getEl("inp"),"change",function(){t.fire("change")}),t._hasOnChange=!0),t.hasClass("placeholder")&&(t.getEl("inp").value="",t.removeClass("placeholder"))}),t.on("focusout",function(){0===t.value().length&&(t.getEl("inp").value=e.placeholder,t.addClass("placeholder"))}))},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.items().each(function(t){t.active(t.value()==e.value())})}).fire("show"),e.menu.on("select",function(t){e.value(t.control.value())}),e.on("focusin",function(t){"INPUT"==t.target.tagName.toUpperCase()&&e.menu.hide()}),e.aria("expanded",!0)),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},value:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t.removeClass("placeholder"),t._rendered&&(t.getEl("inp").value=e),t):t._rendered?(e=t.getEl("inp").value,e!=t.settings.placeholder?e:""):t._value},disabled:function(e){var t=this;return t._rendered&&"undefined"!=typeof e&&(t.getEl("inp").disabled=e),t._super(e)},focus:function(){this.getEl("inp").focus()},repaint:function(){var e=this,t=e.getEl(),r=e.getEl("open"),i=e.layoutRect(),o,a;o=r?i.w-n.getSize(r).width-10:i.w-10;var s=document;return s.all&&(!s.documentMode||s.documentMode<=8)&&(a=e.layoutRect().h-2+"px"),n.css(t.firstChild,{width:o,lineHeight:a}),e._super(),e},postRender:function(){var e=this;return n.on(this.getEl("inp"),"change",function(){e.fire("change")}),e._super()},remove:function(){n.off(this.getEl("inp")),this._super()},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.classPrefix,i=n.value||n.placeholder||"",o,a,s="",l="";return"spellcheck"in n&&(l+=' spellcheck="'+n.spellcheck+'"'),n.maxLength&&(l+=' maxlength="'+n.maxLength+'"'),n.size&&(l+=' size="'+n.size+'"'),n.subtype&&(l+=' type="'+n.subtype+'"'),e.disabled()&&(l+=' disabled="disabled"'),o=n.icon,o&&"caret"!=o&&(o=r+"ico "+r+"i-"+n.icon),a=e._text,(o||a)&&(s='<div id="'+t+'-open" class="'+r+"btn "+r+'open" tabIndex="-1" role="button"><button id="'+t+'-action" type="button" hidefocus="1" tabindex="-1">'+("caret"!=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="1"'+l+" />"+s+"</div>"}})}),r(Ae,[Re],function(e){return e.extend({init:function(e){var t=this;e.spellcheck=!1,e.onaction&&(e.icon="none"),t._super(e),t.addClass("colorbox"),t.on("change keyup postrender",function(){t.repaintColor(t.value())})},repaintColor:function(e){var t=this.getEl().getElementsByTagName("i")[0];if(t)try{t.style.background=e}catch(n){}},value:function(e){var t=this;return"undefined"!=typeof e&&t._rendered&&t.repaintColor(e),t._super(e)}})}),r(Be,[ke,re],function(e,t){return e.extend({showPanel:function(){var e=this,n=e.settings;if(e.active(!0),e.panel)e.panel.show();else{var r=n.panel;r.type&&(r={layout:"grid",items:r}),r.role=r.role||"dialog",r.popover=!0,r.autohide=!0,r.ariaRoot=!0,e.panel=new t(r).on("hide",function(){e.active(!1)}).on("cancel",function(t){t.stopPropagation(),e.focus(),e.hidePanel()}).parent(e).renderTo(e.getContainerElm()),e.panel.fire("show"),e.panel.reflow()}e.panel.moveRel(e.getEl(),n.popoverAlign||(e.isRtl()?["bc-tr","bc-tc"]:["bc-tl","bc-tc"]))},hidePanel:function(){var e=this;e.panel&&e.panel.hide()},postRender:function(){var e=this;return e.aria("haspopup",!0),e.on("click",function(t){t.control===e&&(e.panel&&e.panel.visible()?e.hidePanel():(e.showPanel(),e.panel.focus(!!t.aria)))}),e._super()},remove:function(){return this.panel&&(this.panel.remove(),this.panel=null),this._super()}})}),r(De,[Be,y],function(e,t){var n=t.DOM;return e.extend({init:function(e){this._super(e),this.addClass("colorbutton")},color:function(e){return e?(this._color=e,this.getEl("preview").style.backgroundColor=e,this):this._color},resetColor:function(){return this._color=null,this.getEl("preview").style.backgroundColor=null,this},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()+'" role="button" tabindex="-1" aria-haspopup="true"><button role="presentation" hidefocus="1" type="button" tabindex="-1">'+(r?'<i class="'+r+'"'+i+"></i>":"")+'<span id="'+t+'-preview" class="'+n+'preview"></span>'+(e._text?(r?" ":"")+e._text:"")+'</button><button type="button" class="'+n+'open" hidefocus="1" tabindex="-1"> <i class="'+n+'caret"></i></button></div>'},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(r){r.aria&&"down"==r.aria.key||r.control!=e||n.getParent(r.target,"."+e.classPrefix+"open")||(r.stopImmediatePropagation(),t.call(e,r))}),delete e.settings.onclick,e._super()}})}),r(Me,[],function(){function e(e){function i(e,i,o){var a,s,l,c,u,d;return a=0,s=0,l=0,e/=255,i/=255,o/=255,u=t(e,t(i,o)),d=n(e,n(i,o)),u==d?(l=u,{h:0,s:0,v:100*l}):(c=e==u?i-o:o==u?e-i:o-e,a=e==u?3:o==u?1:5,a=60*(a-c/(d-u)),s=(d-u)/d,l=d,{h:r(a),s:r(100*s),v:r(100*l)})}function o(e,i,o){var a,s,l,c;if(e=(parseInt(e,10)||0)%360,i=parseInt(i,10)/100,o=parseInt(o,10)/100,i=n(0,t(i,1)),o=n(0,t(o,1)),0===i)return void(d=f=p=r(255*o));switch(a=e/60,s=o*i,l=s*(1-Math.abs(a%2-1)),c=o-s,Math.floor(a)){case 0:d=s,f=l,p=0;break;case 1:d=l,f=s,p=0;break;case 2:d=0,f=s,p=l;break;case 3:d=0,f=l,p=s;break;case 4:d=l,f=0,p=s;break;case 5:d=s,f=0,p=l;break;default:d=f=p=0}d=r(255*(d+c)),f=r(255*(f+c)),p=r(255*(p+c))}function a(){function e(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+e(d)+e(f)+e(p)}function s(){return{r:d,g:f,b:p}}function l(){return i(d,f,p)}function c(e){var t;return"object"==typeof e?"r"in e?(d=e.r,f=e.g,p=e.b):"v"in e&&o(e.h,e.s,e.v):(t=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(d=parseInt(t[1],10),f=parseInt(t[2],10),p=parseInt(t[3],10)):(t=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(d=parseInt(t[1],16),f=parseInt(t[2],16),p=parseInt(t[3],16)):(t=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(d=parseInt(t[1]+t[1],16),f=parseInt(t[2]+t[2],16),p=parseInt(t[3]+t[3],16)),d=0>d?0:d>255?255:d,f=0>f?0:f>255?255:f,p=0>p?0:p>255?255:p,u}var u=this,d=0,f=0,p=0;e&&c(e),u.toRgb=s,u.toHsv=l,u.toHex=a,u.parse=c}var t=Math.min,n=Math.max,r=Math.round;return e}),r(He,[Ne,Q,K,Me],function(e,t,n,r){return e.extend({Defaults:{classes:"widget colorpicker"},init:function(e){this._super(e)},postRender:function(){function e(e,t){var r=n.getPos(e),i,o;return i=t.pageX-r.x,o=t.pageY-r.y,i=Math.max(0,Math.min(i/e.clientWidth,1)),o=Math.max(0,Math.min(o/e.clientHeight,1)),{x:i,y:o}}function i(e,t){var i=(360-e.h)/360;n.css(d,{top:100*i+"%"}),t||n.css(p,{left:e.s+"%",top:100-e.v+"%"}),f.style.background=new r({s:100,v:100,h:e.h}).toHex(),s.color().parse({s:e.s,v:e.v,h:e.h})}function o(t){var n;n=e(f,t),c.s=100*n.x,c.v=100*(1-n.y),i(c),s.fire("change")}function a(t){var n;n=e(u,t),c=l.toHsv(),c.h=360*(1-n.y),i(c,!0),s.fire("change")}var s=this,l=s.color(),c,u,d,f,p;u=s.getEl("h"),d=s.getEl("hp"),f=s.getEl("sv"),p=s.getEl("svp"),s._repaint=function(){c=l.toHsv(),i(c)},s._super(),s._svdraghelper=new t(s._id+"-sv",{start:o,drag:o}),s._hdraghelper=new t(s._id+"-h",{start:a,drag:a}),s._repaint()},rgb:function(){return this.color().toRgb()},value:function(e){var t=this;return arguments.length?(t.color().parse(e),void(t._rendered&&t._repaint())):t.color().toHex()},color:function(){return this._color||(this._color=new r),this._color},renderHtml:function(){function e(){var e,t,n="",i,a;for(i="filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=",a=o.split(","),e=0,t=a.length-1;t>e;e++)n+='<div class="'+r+'colorpicker-h-chunk" style="height:'+100/t+"%;"+i+a[e]+",endColorstr="+a[e+1]+");-ms-"+i+a[e]+",endColorstr="+a[e+1]+')"></div>';return n}var t=this,n=t._id,r=t.classPrefix,i,o="#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000",a="background: -ms-linear-gradient(top,"+o+");background: linear-gradient(to bottom,"+o+");";
+
+return i='<div id="'+n+'-h" class="'+r+'colorpicker-h" style="'+a+'">'+e()+'<div id="'+n+'-hp" class="'+r+'colorpicker-h-marker"></div></div>','<div id="'+n+'" class="'+t.classes()+'"><div id="'+n+'-sv" class="'+r+'colorpicker-sv"><div class="'+r+'colorpicker-overlay1"><div class="'+r+'colorpicker-overlay2"><div id="'+n+'-svp" class="'+r+'colorpicker-selector1"><div class="'+r+'colorpicker-selector2"></div></div></div></div></div>'+i+"</div>"}})}),r(Le,[Ne],function(e){return e.extend({init:function(e){var t=this;e.delimiter||(e.delimiter="\xbb"),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.getEl().firstChild.focus(),e},data:function(e){var t=this;return"undefined"!=typeof e?(t._data=e,t.update(),t):t._data},update:function(){this.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.classes()+'">'+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+'" aria-level="'+n+'">'+t[n].name+"</div>";return i||(i='<div class="'+o+'path-item">\xa0</div>'),i}})}),r(Pe,[Le,he],function(e,t){return e.extend({postRender:function(){function e(e){if(1===e.nodeType){if("BR"==e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1}var n=this,r=t.activeEditor;return r.settings.elementpath!==!1&&(n.on("select",function(e){r.focus(),r.selection.select(this.data()[e.index].element),r.nodeChanged()}),r.on("nodeChange",function(t){for(var i=[],o=t.parents,a=o.length;a--;)if(1==o[a].nodeType&&!e(o[a])){var s=r.fire("ResolveName",{name:o[a].nodeName.toLowerCase(),target:o[a]});if(s.isDefaultPrevented()||i.push({name:s.name,element:o[a]}),s.isPropagationStopped())break}n.data(i)})),n._super()}})}),r(Oe,[J],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(Ie,[J,Oe,d],function(e,t,n){return e.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:20,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var e=this,r=e.items();e.settings.formItemDefaults||(e.settings.formItemDefaults={layout:"flex",autoResize:"overflow",defaults:{flex:1}}),r.each(function(r){var i,o=r.settings.label;o&&(i=new t(n.extend({items:{type:"label",id:r._id+"-l",text:o,flex:0,forId:r._id,disabled:r.disabled()}},e.settings.formItemDefaults)),i.type="formitem",r.aria("labelledby",r._id+"-l"),"undefined"==typeof r.settings.flex&&(r.settings.flex=1),e.replace(r,i),i.add(r))})},recalcLabels:function(){var e=this,t=0,n=[],r,i,o;if(e.settings.labelGapCalc!==!1)for(o="children"==e.settings.labelGapCalc?e.find("formitem"):e.items(),o.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},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){var e=this;e._super(),e.recalcLabels(),e.fromJSON(e.settings.data)}})}),r(Fe,[Ie],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(ze,[Re,d],function(e,t){return e.extend({init:function(e){var n=this,r=tinymce.activeEditor,i=r.settings,o,a,s;e.spellcheck=!1,s=i.file_picker_types||i.file_browser_callback_types,s&&(s=t.makeMap(s,/[, ]/)),(!s||s[e.filetype])&&(a=i.file_picker_callback,!a||s&&!s[e.filetype]?(a=i.file_browser_callback,!a||s&&!s[e.filetype]||(o=function(){a(n.getEl("inp").id,n.value(),e.filetype,window)})):o=function(){var i=n.fire("beforecall").meta;i=t.extend({filetype:e.filetype},i),a.call(r,function(e,t){n.value(e).fire("change",{meta:t})},n.value(),i)}),o&&(e.icon="browse",e.onaction=o),n._super(e)}})}),r(We,[_e],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(Ve,[_e],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,_,E,N,k,S,T,R,A,B,D,M,H,L,P,O,I,F,z=Math.max,W=Math.min;for(r=e.items().filter(":visible"),i=e.layoutRect(),o=e._paddingBox,a=e.settings,f=e.isRtl()?a.direction||"row-reversed":a.direction,s=a.align,l=e.isRtl()?a.pack||"end":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",E="h",N="minH",S="maxH",R="innerH",T="top",A="deltaH",B="contentH",P="left",H="w",D="x",M="innerW",L="minW",O="right",I="deltaW",F="contentW"):(k="x",E="w",N="minW",S="maxW",R="innerW",T="left",A="deltaW",B="contentW",P="top",H="h",D="y",M="innerH",L="minH",O="bottom",I="deltaH",F="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[N],y=o[P]+h[L]+o[O],y>_&&(_=y);if(x={},0>d?x[N]=i[N]-d+i[A]:x[N]=i[R]-d+i[A],x[L]=_+i[I],x[B]=i[R]-d,x[F]=_,x.minW=W(x.minW,i.maxW),x.minH=W(x.minH,i.maxH),x.minW=z(x.minW,i.startMinWidth),x.minH=z(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[N]+h.flex*C,y>b?(d-=h[S]-h[N],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[D]=o[P],t=0,n=r.length;n>t;t++)p=r[t],h=p.layoutRect(),y=h.maxFlexSize||h[N],"center"===s?x[D]=Math.round(i[M]/2-h[H]/2):"stretch"===s?(x[H]=z(h[L]||0,i[M]-o[P]-o[O]),x[D]=o[P]):"end"===s&&(x[D]=i[M]-h[H]-o.top),h.flex>0&&(y+=h.flex*C),x[E]=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 V=e.parent();V&&(V._lastRect=null,V.recalc())}}})}),r(Ue,[we],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($e,[Y,Ne,re,d,he,u],function(e,t,n,r,i,o){function a(e){function t(t,n){return function(){var r=this;e.on("nodeChange",function(i){var o=e.formatter,a=null;s(i.parents,function(e){return s(t,function(t){return n?o.matchNode(e,n,{value:t.value})&&(a=t.value):o.matchNode(e,t.value)&&(a=t.value),a?!1:void 0}),a?!1:void 0}),r.value(a)})}}function r(e){e=e.replace(/;$/,"").split(";");for(var t=e.length;t--;)e[t]=e[t].split("=");return e}function i(){function t(e){var n=[];if(e)return s(e,function(e){var o={text:e.title,icon:e.icon};if(e.items)o.menu=t(e.items);else{var a=e.format||"custom"+r++;e.format||(e.name=a,i.push(e)),o.format=a,o.cmd=e.cmd}n.push(o)}),n}function n(){var n;return n=t(e.settings.style_formats_merge?e.settings.style_formats?o.concat(e.settings.style_formats):o:e.settings.style_formats||o)}var r=0,i=[],o=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 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"}]}];return e.on("init",function(){s(i,function(t){e.formatter.register(t.name,t)})}),{type:"menu",items:n(),onPostRender:function(t){e.fire("renderFormatsMenu",{control:t.control})},itemDefaults:{preview:!0,textStyle:function(){return this.settings.format?e.formatter.getCssText(this.settings.format):void 0},onPostRender:function(){var t=this;t.parent().on("show",function(){var n,r;n=t.settings.format,n&&(t.disabled(!e.formatter.canApply(n)),t.active(e.formatter.match(n))),r=t.settings.cmd,r&&t.active(e.queryCommandState(r))})},onclick:function(){this.settings.format&&l(this.settings.format),this.settings.cmd&&e.execCommand(this.settings.cmd)}}}}function o(t){return function(){function n(){return e.undoManager?e.undoManager[t]():!1}var r=this;t="redo"==t?"hasRedo":"hasUndo",r.disabled(!n()),e.on("Undo Redo AddUndo TypingUndo ClearUndos",function(){r.disabled(!n())})}}function a(){var t=this;e.on("VisualAid",function(e){t.active(e.hasVisual)}),t.active(e.hasVisual)}function l(t){t.control&&(t=t.control.value()),t&&e.execCommand("mceToggleFormat",!1,t)}var c;c=i(),s({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(t,n){e.addButton(n,{tooltip:t,onPostRender:function(){var t=this;e.formatter?e.formatter.formatChanged(n,function(e){t.active(e)}):e.on("init",function(){e.formatter.formatChanged(n,function(e){t.active(e)})})},onclick:function(){l(n)}})}),s({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1]})}),s({blockquote:["Blockquote","mceBlockQuote"],numlist:["Numbered list","InsertOrderedList"],bullist:["Bullet list","InsertUnorderedList"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1],onPostRender:function(){var t=this;e.formatter?e.formatter.formatChanged(n,function(e){t.active(e)}):e.on("init",function(){e.formatter.formatChanged(n,function(e){t.active(e)})})}})}),e.addButton("undo",{tooltip:"Undo",onPostRender:o("undo"),cmd:"undo"}),e.addButton("redo",{tooltip:"Redo",onPostRender:o("redo"),cmd:"redo"}),e.addMenuItem("newdocument",{text:"New document",icon:"newdocument",cmd:"mceNewDocument"}),e.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onPostRender:o("undo"),cmd:"undo"}),e.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onPostRender:o("redo"),cmd:"redo"}),e.addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:a,cmd:"mceToggleVisualAid"}),s({cut:["Cut","Cut","Meta+X"],copy:["Copy","Copy","Meta+C"],paste:["Paste","Paste","Meta+V"],selectall:["Select all","SelectAll","Meta+A"],bold:["Bold","Bold","Meta+B"],italic:["Italic","Italic","Meta+I"],underline:["Underline","Underline"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(t,n){e.addMenuItem(n,{text:t[0],icon:n,shortcut:t[2],cmd:t[1]})}),e.on("mousedown",function(){n.hideAll()}),e.addButton("styleselect",{type:"menubutton",text:"Formats",menu:c}),e.addButton("formatselect",function(){var n=[],i=r(e.settings.block_formats||"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre");return s(i,function(t){n.push({text:t[0],value:t[1],textStyle:function(){return e.formatter.getCssText(t[1])}})}),{type:"listbox",text:i[0][0],values:n,fixedWidth:!0,onselect:l,onPostRender:t(n)}}),e.addButton("fontselect",function(){var n="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",i=[],o=r(e.settings.font_formats||n);return s(o,function(e){i.push({text:{raw:e[0]},value:e[1],textStyle:-1==e[1].indexOf("dings")?"font-family:"+e[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:i,fixedWidth:!0,onPostRender:t(i,"fontname"),onselect:function(t){t.control.settings.value&&e.execCommand("FontName",!1,t.control.settings.value)}}}),e.addButton("fontsizeselect",function(){var n=[],r="8pt 10pt 12pt 14pt 18pt 24pt 36pt",i=e.settings.fontsize_formats||r;return s(i.split(" "),function(e){var t=e,r=e,i=e.split("=");i.length>1&&(t=i[0],r=i[1]),n.push({text:t,value:r})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:n,fixedWidth:!0,onPostRender:t(n,"fontsize"),onclick:function(t){t.control.settings.value&&e.execCommand("FontSize",!1,t.control.settings.value)}}}),e.addMenuItem("formats",{text:"Formats",menu:c})}var s=r.each;i.on("AddEditor",function(t){t.editor.rtl&&(e.rtl=!0),a(t.editor)}),e.translate=function(e){return i.translate(e)},t.tooltips=!o.iOS}),r(qe,[_e],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,_,E=[],N=[],k,S,T,R,A,B;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,A="reverseRows"in t?t.reverseRows:e.isRtl(),C&&"string"==typeof C&&(C=[C]),x&&"string"==typeof x&&(x=[x]);for(d=0;r>d;d++)E.push(0);for(f=0;n>f;f++)N.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,E[d]=k>E[d]?k:E[d],N[f]=S>N[f]?S:N[f];for(T=o.innerW-g.left-g.right,w=0,d=0;r>d;d++)w+=E[d]+(d>0?y:0),T-=(d>0?y:0)+E[d];for(R=o.innerH-g.top-g.bottom,_=0,f=0;n>f;f++)_+=N[f]+(f>0?b:0),R-=(f>0?b:0)+N[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 D;D="start"==t.packV?0:R>0?Math.floor(R/n):0;var M=0,H=t.flexWidths;if(H)for(d=0;d<H.length;d++)M+=H[d];else M=r;var L=T/M;for(d=0;r>d;d++)E[d]+=H?H[d]*L:L;for(h=g.top,f=0;n>f;f++){for(p=g.left,s=N[f]+D,d=0;r>d&&(B=A?f*r+r-1-d:f*r+d,u=i[B],u);d++)m=u.settings,c=u.layoutRect(),a=Math.max(E[d],c.startMinWidth),c.x=p,c.y=h,v=m.alignH||(C?C[d]||C[0]:null),"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?x[d]||x[0]:null),"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(je,[Ne],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,t){var n=this,r=this.getEl().contentWindow.document.body;return r?(r.innerHTML=e,t&&t()):setTimeout(function(){n.html(e)},0),this}})}),r(Ke,[Ne,K],function(e,t){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,n=e._super();if(e.settings.multiline){var r=t.getSize(e.getEl());r.width>n.maxW&&(n.minW=n.maxW,e.addClass("multiline")),e.getEl().style.width=n.minW+"px",n.startMinH=n.h=n.minH=Math.min(n.maxH,t.getSize(e.getEl()).height)}return n},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&&this.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(Ye,[J],function(e){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._super()}})}),r(Ge,[Ye],function(e){return e.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:!0,defaults:{type:"menubutton"}}})}),r(Xe,[ke,G,Ge],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"),e.fixedWidth&&t.addClass("fixed-width"),t.aria("haspopup",!0),t.hasPopup=!0},showMenu:function(){var e=this,n=e.settings,r;return e.menu&&e.menu.visible()?e.hideMenu():(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.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control.parent()===e.menu&&(t.stopPropagation(),e.focus(),e.hideMenu())}),e.menu.on("select",function(){e.focus()}),e.menu.on("show hide",function(t){t.control==e.menu&&e.activeMenu("show"==t.type),e.aria("expanded","show"==t.type)}).fire("show")),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),void e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]))},hideMenu:function(){var e=this;e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide())},activeMenu:function(e){this.toggleClass("active",e)},renderHtml:function(){var e=this,t=e._id,r=e.classPrefix,i=e.settings.icon,o;return o=e.settings.image,o?(i="none","string"!=typeof o&&(o=window.getSelection?o[0]:o[1]),o=" style=\"background-image: url('"+o+"')\""):o="",i=e.settings.icon?r+"ico "+r+"i-"+i:"",e.aria("role",e.parent()instanceof n?"menuitem":"button"),'<div id="'+t+'" class="'+e.classes()+'" tabindex="-1" aria-labelledby="'+t+'"><button id="'+t+'-open" role="presentation" type="button" tabindex="-1">'+(i?'<i class="'+i+'"'+o+"></i>":"")+"<span>"+(e._text?(i?"\xa0":"")+e.encode(e._text):"")+'</span> <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.aria&&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.focus(),n.showMenu()))}),e._super()},text:function(e){var t=this,n,r;if(t._rendered)for(r=t.getEl("open").getElementsByTagName("span"),n=0;n<r.length;n++)r[n].innerHTML=(t.settings.icon&&e?"\xa0":"")+t.encode(e);return this._super(e)},remove:function(){this._super(),this.menu&&this.menu.remove()}});return i}),r(Je,[Xe],function(e){return e.extend({init:function(e){function t(r){for(var a=0;a<r.length;a++){if(i=r[a].selected||e.value===r[a].value){o=o||r[a].text,n._value=r[a].value;break}r[a].menu&&t(r[a].menu)}}var n=this,r,i,o,a;n._values=r=e.values,r&&(t(r),!i&&r.length>0&&(o=r[0].text,n._value=r[0].value),e.menu=r),e.text=e.text||o||r[0].text,n._super(e),n.addClass("listbox"),n.on("select",function(t){var r=t.control;a&&(t.lastControl=a),e.multiple?r.active(!r.active()):n.value(t.control.settings.value),a=r})},value:function(e){function t(e,n){e.items().each(function(e){i=e.value()===n,i&&(o=o||e.text()),e.active(i),e.menu&&t(e.menu,n)})}function n(t){for(var r=0;r<t.length;r++)i=t[r].value==e,i&&(o=o||t[r].text),t[r].active=i,t[r].menu&&n(t[r].menu)}var r=this,i,o,a;return"undefined"!=typeof e&&(r.menu?t(r.menu,e):(a=r.settings.menu,n(a)),r.text(o||this.settings.text)),r._super(e)}})}),r(Qe,[Ne,G,u],function(e,t,n){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"),e.preview&&t.addClass("menu-item-preview"),("-"===t._text||"|"===t._text)&&(t.addClass("menu-item-sep"),t.aria("role","separator"),t._text="-"),e.selectable&&(t.aria("role","menuitemcheckbox"),t.addClass("menu-item-checkbox"),e.icon="selected"),e.preview||e.selectable||t.addClass("menu-item-normal"),t.on("mousedown",function(e){e.preventDefault()}),e.menu&&!e.ariaHideMenu&&t.aria("haspopup",!0)},hasMenus:function(){return!!this.settings.menu},showMenu:function(){var e=this,n=e.settings,r,i=e.parent();if(i.items().each(function(t){t!==e&&t.hideMenu()}),n.menu){r=e.menu,r?r.show():(r=n.menu,r.length?r={type:"menu",items:r}:r.type=r.type||"menu",i.settings.itemDefaults&&(r.itemDefaults=i.settings.itemDefaults),r=e.menu=t.create(r).parent(e).renderTo(),r.reflow(),r.on("cancel",function(t){t.stopPropagation(),e.focus(),r.hide()}),r.on("show hide",function(e){e.control.items().each(function(e){e.active(e.settings.selected)})}).fire("show"),r.on("hide",function(t){t.control===r&&e.removeClass("selected")}),r.submenu=!0),r._parentMenu=i,r.addClass("menu-sub");var o=r.testMoveRel(e.getEl(),e.isRtl()?["tl-tr","bl-br","tr-tl","br-bl"]:["tr-tl","br-bl","tl-tr","bl-br"]);r.moveRel(e.getEl(),o),r.rel=o,o="menu-sub-"+o,r.removeClass(r._lastRel),r.addClass(o),r._lastRel=o,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(){function e(e){var t,r,i={};for(i=n.mac?{alt:"&#x2325;",ctrl:"&#x2318;",shift:"&#x21E7;",meta:"&#x2318;"}:{meta:"Ctrl"},e=e.split("+"),t=0;t<e.length;t++)r=i[e[t].toLowerCase()],r&&(e[t]=r);return e.join("+")}var t=this,r=t._id,i=t.settings,o=t.classPrefix,a=t.encode(t._text),s=t.settings.icon,l="",c=i.shortcut;return s&&t.parent().addClass("menu-has-icons"),i.image&&(s="none",l=" style=\"background-image: url('"+i.image+"')\""),c&&(c=e(c)),s=o+"ico "+o+"i-"+(t.settings.icon||"none"),'<div id="'+r+'" class="'+t.classes()+'" tabindex="-1">'+("-"!==a?'<i class="'+s+'"'+l+"></i>\xa0":"")+("-"!==a?'<span id="'+r+'-text" class="'+o+'text">'+a+"</span>":"")+(c?'<div id="'+r+'-shortcut" class="'+o+'menu-shortcut">'+c+"</div>":"")+(i.menu?'<div class="'+o+'caret"></div>':"")+"</div>"},postRender:function(){var e=this,t=e.settings,n=t.textStyle;if("function"==typeof n&&(n=n.call(this)),n){var r=e.getEl("text");r&&r.setAttribute("style",n)}return e.on("mouseenter click",function(n){n.control===e&&(t.menu||"click"!==n.type?(e.showMenu(),n.aria&&e.menu.focus(!0)):(e.fire("select"),e.parent().hideAll()))}),e._super(),e},active:function(e){return"undefined"!=typeof e&&this.aria("checked",e),this._super(e)},remove:function(){this._super(),this.menu&&this.menu.remove()}})}),r(Ze,[re,Qe,d],function(e,t,n){var r=e.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:!0},init:function(e){var t=this;if(e.autohide=!0,e.constrainToViewport=!0,e.itemDefaults)for(var r=e.items,i=r.length;i--;)r[i]=n.extend({},e.itemDefaults,r[i]);t._super(e),t.addClass("menu")},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("select")},hideAll:function(){var e=this;return this.find("menuitem").exec("hideMenu"),e._super()},preRender:function(){var e=this;return e.items().each(function(t){var n=t.settings;return n.icon||n.selectable?(e._hasIcons=!0,!1):void 0}),e._super()}});return r}),r(et,[Te],function(e){return e.extend({Defaults:{classes:"radio",role:"radio"}})}),r(tt,[Ne,Q],function(e,t){return e.extend({renderHtml:function(){var e=this,t=e.classPrefix;return e.addClass("resizehandle"),"both"==e.settings.direction&&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(){var e=this;e._super(),e.resizeDragHelper=new t(this._id,{start:function(){e.fire("ResizeStart")},drag:function(t){"both"!=e.settings.direction&&(t.deltaX=0),e.fire("Resize",t)},stop:function(){e.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}})}),r(nt,[Ne],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(rt,[Xe,K],function(e,t){return e.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var e=this,n=e.getEl(),r=e.layoutRect(),i,o;return e._super(),i=n.firstChild,o=n.lastChild,t.css(i,{width:r.w-t.getSize(o).width,height:r.h-2}),t.css(o,{height:r.h-2}),e},activeMenu:function(e){var n=this;t.toggleClass(n.getEl().lastChild,n.classPrefix+"active",e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r,i=e.settings.icon;return r=e.settings.image,r?(i="none","string"!=typeof r&&(r=window.getSelection?r[0]:r[1]),r=" style=\"background-image: url('"+r+"')\""):r="",i=e.settings.icon?n+"ico "+n+"i-"+i:"",'<div id="'+t+'" class="'+e.classes()+'" role="button" tabindex="-1"><button type="button" hidefocus="1" tabindex="-1">'+(i?'<i class="'+i+'"'+r+"></i>":"")+(e._text?(i?" ":"")+e._text:"")+'</button><button type="button" class="'+n+'open" hidefocus="1" tabindex="-1">'+(e._menuBtnText?(i?"\xa0":"")+e._menuBtnText:"")+' <i class="'+n+'caret"></i></button></div>'},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(e){var n=e.target;if(e.control==this)for(;n;){if(e.aria&&"down"!=e.aria.key||"BUTTON"==n.nodeName&&-1==n.className.indexOf("open"))return e.stopImmediatePropagation(),void t.call(this,e);n=n.parentNode}}),delete e.settings.onclick,e._super()}})}),r(it,[Ue],function(e){return e.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"}})}),r(ot,[ee,K],function(e,t){return e.extend({Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(e){var n;this.activeTabId&&(n=this.getEl(this.activeTabId),t.removeClass(n,this.classPrefix+"active"),n.setAttribute("aria-selected","false")),this.activeTabId="t"+e,n=this.getEl("t"+e),n.setAttribute("aria-selected","true"),t.addClass(n,this.classPrefix+"active"),this.items()[e].show().fire("showtab"),this.reflow(),this.items().each(function(t,n){e!=n&&t.hide()})},renderHtml:function(){var e=this,t=e._layout,n="",r=e.classPrefix;return e.preRender(),t.preRender(e),e.items().each(function(t,i){var o=e._id+"-t"+i;t.aria("role","tabpanel"),t.aria("labelledby",o),n+='<div id="'+o+'" class="'+r+'tab" unselectable="on" role="tab" aria-controls="'+t._id+'" aria-selected="false" tabIndex="-1">'+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" role="tablist">'+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,n,r,i;r=t.getSize(e.getEl("head")).width,r=0>r?0:r,i=0,e.items().each(function(e){r=Math.max(r,e.layoutRect().minW),i=Math.max(i,e.layoutRect().minH)}),e.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=r,e.settings.h=i,e.layoutRect({x:0,y:0,w:r,h:i})});var o=t.getSize(e.getEl("head")).height;return e.settings.minWidth=r,e.settings.minHeight=i+o,n=e._super(),n.deltaH+=o,n.innerH=n.h-n.deltaH,n}})}),r(at,[Ne,K],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t._value=e.value||"",t.addClass("textbox"),e.multiline?t.addClass("multiline"):t.on("keydown",function(e){13==e.keyCode&&t.parents().reverse().each(function(t){return e.preventDefault(),t.hasEventListeners("submit")&&t.toJSON?(t.fire("submit",{data:t.toJSON()}),!1):void 0})})},disabled:function(e){var t=this;return t._rendered&&"undefined"!=typeof e&&(t.getEl().disabled=e),t._super(e)},value:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t._rendered&&(t.getEl().value=e),t):t._rendered?t.getEl().value:t._value},repaint:function(){var e=this,t,n,r,i=0,o=0,a;t=e.getEl().style,n=e._layoutRect,a=e._lastRepaintRect||{};var s=document;return!e.settings.multiline&&s.all&&(!s.documentMode||s.documentMode<=8)&&(t.lineHeight=n.h-o+"px"),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+'"'),e.disabled()&&(i+=' disabled="disabled"'),n.multiline?'<textarea id="'+t+'" class="'+e.classes()+'" '+(n.rows?' rows="'+n.rows+'"':"")+' hidefocus="1"'+i+">"+r+"</textarea>":'<input id="'+t+'" class="'+e.classes()+'" value="'+r+'" hidefocus="1"'+i+" />"},postRender:function(){var e=this;return t.on(e.getEl(),"change",function(t){e.fire("change",t)}),e._super()},remove:function(){t.off(this.getEl()),this._super()}})}),r(st,[K,Y],function(e,t){return function(n,r){var i=this,o,a=t.classPrefix;i.show=function(t){return i.hide(),o=!0,window.setTimeout(function(){o&&n.appendChild(e.createFragment('<div class="'+a+"throbber"+(r?" "+a+"throbber-inline":"")+'"></div>'));
+
+},t||0),i},i.hide=function(){var e=n.lastChild;return e&&-1!=e.className.indexOf("throbber")&&e.parentNode.removeChild(e),o=!1,i}}}),a([l,c,u,d,f,p,h,m,g,y,b,C,x,_,E,N,k,S,T,R,A,B,D,M,H,L,O,I,F,z,W,V,U,$,q,j,K,Y,G,X,J,Q,Z,ee,te,ne,re,ie,oe,ae,se,le,ce,ue,de,fe,pe,he,me,ge,ve,ye,be,Ce,xe,we,_e,Ee,Ne,ke,Se,Te,Re,Ae,Be,De,Me,He,Le,Pe,Oe,Ie,Fe,ze,We,Ve,Ue,$e,qe,je,Ke,Ye,Ge,Xe,Je,Qe,Ze,et,tt,nt,rt,it,ot,at,st])}(this);
\ No newline at end of file
--- a/src/pyams_skin/resources/js/myams.js	Wed May 20 15:01:45 2015 +0200
+++ b/src/pyams_skin/resources/js/myams.js	Wed Jun 17 10:00:10 2015 +0200
@@ -400,9 +400,9 @@
 	 * Copyright Andrew Davy: https://forrst.com/posts/Get_the_URL_of_the_current_javascript_file-Dst
 	 */
 	MyAMS.baseURL = (function () {
-		var script = $('script[src$="/myams.js"], script[src$="/myams.min.js"]');
+		var script = $('script[src*="/myams.js"], script[src*="/myams.min.js"]');
 		var src = script.attr("src");
-		ams.devmode = !src.endsWith('.min.js');
+		ams.devmode = src.indexOf('.min.js') < 0;
 		ams.devext = ams.devmode ? '' : '.min';
 		return src.substring(0, src.lastIndexOf('/') + 1);
 	})();
@@ -980,7 +980,7 @@
 		 */
 		query: function(query, method, options, callback) {
 			ams.ajax.check($.jsonRpc,
-						   ams.baseURL + 'ext/jquery-jsonrpc' + (ams.devmode ? '.js' : '.min.js'),
+						   ams.baseURL + 'ext/jquery-jsonrpc' + ams.devext + '.js',
 						   function() {
 								var result;
 								if (typeof(options) == 'function') {
@@ -1029,7 +1029,7 @@
 		 */
 		post: function(method, data, options, callback) {
 			ams.ajax.check($.jsonRPC,
-						   ams.baseURL + 'ext/jquery-jsonrpc' + (ams.devmode ? '.js' : '.min.js'),
+						   ams.baseURL + 'ext/jquery-jsonrpc' + ams.devext + '.js',
 						   function() {
 								var result;
 								if (typeof(options) == 'function') {
@@ -1092,7 +1092,7 @@
 		 */
 		post: function(url, method, data, options, callback) {
 			ams.ajax.check($.xmlrpc,
-						   ams.baseURL + 'ext/jquery-xmlrpc' + (ams.devmode ? '.js' : '.min.js'),
+						   ams.baseURL + 'ext/jquery-xmlrpc' + ams.devext + '.js',
 						   function() {
 								var result;
 								if (typeof(options) == 'function') {
@@ -1227,10 +1227,10 @@
 			$('.state-error', form).removeClassPrefix('state-');
 			// Check submit button
 			var button = $(form.data('ams-submit-button'));
-			if (button)
+			if (button && !button.data('ams-form-hide-loading'))
 				button.button('loading');
 			ams.ajax.check($.fn.ajaxSubmit,
-						   ams.baseURL + 'ext/jquery-form-3.49' + (ams.devmode ? '.js' : '.min.js'),
+						   ams.baseURL + 'ext/jquery-form-3.49' + ams.devext + '.js',
 						   function() {
 
 								function _submitAjaxForm(form, options) {
@@ -1409,7 +1409,7 @@
 									// and matching named buttons will be deleted (on first form submit)
 									// before JQuery-form plug-in can get them when submitting the form...
 									ams.ajax.check($.progressBar,
-												   ams.baseURL + 'ext/jquery-progressbar' + (ams.devmode ? '.js' : '.min.js'));
+												   ams.baseURL + 'ext/jquery-progressbar' + ams.devext + '.js');
 									var settings = $.extend({}, {
 										uuid: $.progressBar.submit(form)
 									});
@@ -1624,13 +1624,18 @@
 				ams.skin.alert(form, 'error', header, errors);
 			} else {
 				$('.state-error', form).removeClass('state-error');
-				header = errors.widgets && (errors.widgets.length > 1) ? ams.i18n.ERRORS_OCCURED : ams.i18n.ERROR_OCCURED;
+				header = errors.error_header ||
+						 (errors.widgets && (errors.widgets.length > 1) ? ams.i18n.ERRORS_OCCURED : ams.i18n.ERROR_OCCURED);
 				var message = new Array();
 				var index;
 				for (index in errors.messages) {
 					if (!$.isNumeric(index))
 						continue;
-					message.push(errors.messages[index].message || errors.messages[index]);
+					if (errors.messages[index].header) {
+						message.push('<strong>' + errors.messages[index].header + '</strong><br />' + errors.messages[index].message);
+					} else {
+						message.push(errors.messages[index].message || errors.messages[index]);
+					}
 				}
 				for (index in errors.widgets) {
 					if (!$.isNumeric(index))
@@ -1655,7 +1660,7 @@
 						$('li.state-error:first a', form).click();
 					}
 				}
-				ams.skin.alert(form, 'error', header, message, errors.error_message);
+				ams.skin.alert(form, errors.error_level || 'error', header, message, errors.error_message);
 			}
 		}
 	};
@@ -1685,10 +1690,10 @@
 		 */
 		open: function(source, options) {
 			ams.ajax.check($.fn.modalmanager,
-						   ams.baseURL + 'ext/bootstrap-modalmanager' + (ams.devmode ? '.js' : '.min.js'),
+						   ams.baseURL + 'ext/bootstrap-modalmanager' + ams.devext + '.js',
 						   function() {
 								ams.ajax.check($.fn.modal.defaults,
-											   ams.baseURL + 'ext/bootstrap-modal' + (ams.devmode ? '.js' : '.min.js'),
+											   ams.baseURL + 'ext/bootstrap-modal' + ams.devext + '.js',
 								function(first_load) {
 									if (first_load) {
 										$(document).off('click.modal');
@@ -1832,6 +1837,9 @@
 		 */
 		hidden: function(e) {
 			var modal = e.target;
+			// Call registered cleaning callbacks
+			ams.skin.cleanContainer(modal);
+			// Call registered hide callbacks
 			var callbacks = ams.dialog._hide_callbacks;
 			for (var index in callbacks) {
 				callbacks[index].call(modal);
@@ -2013,16 +2021,7 @@
 				}
 			});
 
-			// Run already enabled plug-ins
-			for (var index in ams.plugins.enabled) {
-				if (disabled.indexOf(index) >= 0)
-					continue;
-				var plugin = ams.plugins.enabled[index];
-				if (typeof(plugin) == 'function')
-					plugin(element);
-			}
-
-			// Load, run and register new plug-ins
+			// Load and register new plug-ins
 			var name;
 			$('[data-ams-plugins]', element).each(function() {
 				var source = $(this);
@@ -2050,8 +2049,6 @@
 							var callback = plugin.callback;
 							if (callback) {
 								var called = ams.getFunctionByName(callback);
-								if (typeof(called) == 'function')
-									called.apply(source);
 								if (plugin.register !== false)
 									ams.plugins.enabled[name] = called;
 							} else {
@@ -2068,6 +2065,15 @@
 					}
 				}
 			});
+
+			// Run all enabled plug-ins
+			for (var index in ams.plugins.enabled) {
+				if (disabled.indexOf(index) >= 0)
+					continue;
+				var plugin = ams.plugins.enabled[index];
+				if (typeof(plugin) == 'function')
+					plugin(element);
+			}
 		},
 
 		/**
@@ -2157,9 +2163,9 @@
 				var hints = $('.hint:not(:parents(.nohints))', element);
 				if (hints.length > 0)
 					ams.ajax.check($.fn.tipsy,
-								   ams.baseURL + 'ext/jquery-tipsy' + (ams.devmode ? '.js' : '.min.js'),
+								   ams.baseURL + 'ext/jquery-tipsy' + ams.devext + '.js',
 								   function() {
-										ams.getCSS(ams.baseURL + '../css/ext/jquery-tipsy' + (ams.devmode ? '.css' : '.min.css'),
+										ams.getCSS(ams.baseURL + '../css/ext/jquery-tipsy' + ams.devext + '.css',
 												  'jquery-tipsy');
 										hints.each(function() {
 											var hint = $(this);
@@ -2172,7 +2178,7 @@
 														   hint.attr(data.amsHintTitleAttr || 'title') ||
 														   (data.amsHintHtml ? hint.html() : hint.text());
 												},
-												opacity: data.amsHintOpacity,
+												opacity: data.amsHintOpacity || 0.95,
 												gravity: data.amsHintGravity || 'sw',
 												offset: data.amsHintOffset || 0
 											};
@@ -2185,6 +2191,27 @@
 			},
 
 			/**
+			 * Context menu plug-in
+			 */
+			contextMenu: function(element) {
+				var menus = $('.context-menu', element);
+				if (menus.length > 0) {
+					menus.each(function() {
+						var menu = $(this);
+						var data = menu.data();
+						var data_options = {
+							menuSelector: data.amsContextmenuSelector,
+							menuSelected: ams.helpers.contextMenuHandler
+						};
+						var settings = $.extend({}, data_options, data.amsContextmenuOptions);
+						settings = ams.executeFunctionByName(data.amsContextmenuInitCallback, menu, settings) || settings;
+						var plugin = menu.contextMenu(settings);
+						ams.executeFunctionByName(data.amsContextmenuAfterInitCallback, menu, plugin, settings);
+					});
+				}
+			},
+
+			/**
 			 * Fieldset legend switcher
 			 */
 			switcher: function(element) {
@@ -2269,10 +2296,13 @@
 							input.on('change', function(e) {
 								e.preventDefault();
 								var veto = {};
+								var isChecked = $(this).is(':checked');
 								legend.trigger('ams.checker.before-switch', [legend, veto]);
-								if (veto.veto)
+								if (veto.veto) {
+									// reset checked status because event is fired after change...
+									$(this).prop('checked', !isChecked);
 									return;
-								var isChecked = $(this).is(':checked');
+								}
 								ams.executeFunctionByName(data.amsCheckerChangeHandler, legend, isChecked);
 								if (!data.amsCheckerCancelDefault) {
 									var hidden = input.data('ams-checker-hidden-input');
@@ -2287,7 +2317,7 @@
 										legend.trigger('ams.checker.opened', [legend]);
 									} else {
 										if (data.amsCheckerMode == 'disable')
-											fieldset.attr('disabled', 'disabled');
+											fieldset.prop('disabled', 'disabled');
 										else
 											fieldset.addClass('switched');
 										if (hidden)
@@ -2419,23 +2449,24 @@
 			},
 
 			/**
-			 * Context menu plug-in
+			 * JQuery typeahead plug-in
 			 */
-			contextMenu: function(element) {
-				var menus = $('.context-menu', element);
-				if (menus.length > 0) {
-					menus.each(function() {
-						var menu = $(this);
-						var data = menu.data();
-						var data_options = {
-							menuSelector: data.amsContextmenuSelector,
-							menuSelected: ams.helpers.contextMenuHandler
-						};
-						var settings = $.extend({}, data_options, data.amsContextmenuOptions);
-						settings = ams.executeFunctionByName(data.amsContextmenuInitCallback, menu, settings) || settings;
-						var plugin = menu.contextMenu(settings);
-						ams.executeFunctionByName(data.amsContextmenuAfterInitCallback, menu, plugin, settings);
-					});
+			typeahead: function(element) {
+				var typeaheads = $('.typeahead', element);
+				if (typeaheads.length > 0) {
+					ams.ajax.check($.fn.typeahead,
+								   ams.baseURL + 'ext/jquery-typeahead' + ams.devext + '.js',
+								   function() {
+										typeaheads.each(function() {
+											var input = $(this);
+											var data = input.data();
+											var data_options = {};
+											var settings = $.extend({}, data_options, data.amsTypeaheadOptions);
+											settings = ams.executeFunctionByName(data.amsTypeaheadInitCallback, input, settings) || settings;
+											var plugin = input.typeahead(settings);
+											ams.executeFunctionByName(data.amsTypeaheadAfterInitCallback, input, plugin, settings);
+										});
+								   });
 				}
 			},
 
@@ -2446,7 +2477,7 @@
 				var selects = $('.select2', element);
 				if (selects.length > 0) {
 					ams.ajax.check($.fn.select2,
-								   ams.baseURL + 'ext/jquery-select2-3.5.2' + (ams.devmode ? '.js' : '.min.js'),
+								   ams.baseURL + 'ext/jquery-select2-3.5.2' + ams.devext + '.js',
 								   function() {
 										selects.each(function() {
 											var select = $(this);
@@ -2537,9 +2568,11 @@
 											}
 
 											if (select.attr('readonly')) {
-												data_options.query = function() {
-													return [];
-												};
+												if (select.attr('type') == 'hidden') {
+													data_options.query = function () {
+														return [];
+													};
+												}
 											} else if (data.amsSelect2Query) {
 												// Custom query method
 												data_options.query = ams.getFunctionByName(data.amsSelect2Query);
@@ -2578,7 +2611,7 @@
 													settings = $.extend({}, settings, data.amsSelect2QueryOptions);
 													settings = ams.executeFunctionByName(data.amsSelect2QueryInitCallback, select, settings) || settings;
 													ams.ajax.check($.jsonRPC,
-																   ams.baseURL + 'ext/jquery-jsonrpc' + (ams.devmode ? '.js' : '.min.js'),
+																   ams.baseURL + 'ext/jquery-jsonrpc' + ams.devext + '.js',
 																   function() {
 																		$.jsonRPC.withOptions({
 																			endPoint: data.amsSelect2MethodTarget || ams.jsonrpc.getAddr(),
@@ -2610,9 +2643,8 @@
 											var plugin = select.select2(settings);
 											ams.executeFunctionByName(data.amsSelect2AfterInitCallback, select, plugin, settings);
 											if (select.hasClass('ordered')) {
-												select.addClass('nofloat');
 												ams.ajax.check($.fn.select2Sortable,
-															   ams.baseURL + 'ext/jquery-select2-sortable' + (ams.devmode ? '.js' : '.min.js'),
+															   ams.baseURL + 'ext/jquery-select2-sortable' + ams.devext + '.js',
 															   function() {
 																	select.select2Sortable({
 																		bindOrder: 'sortableStop'
@@ -2661,10 +2693,10 @@
 				var datepickers = $('.datepicker', element);
 				if (datepickers.length > 0) {
 					ams.ajax.check($.fn.datetimepicker,
-								   ams.baseURL + 'ext/jquery-datetimepicker' + (ams.devmode ? '.js': '.min.js'),
+								   ams.baseURL + 'ext/jquery-datetimepicker' + ams.devext + '.js',
 								   function(first_load) {
 										if (first_load) {
-											ams.getCSS(ams.baseURL + '../css/ext/jquery-datetimepicker' + (ams.devmode ? '.css' : '.min.css'), 'jquery-datetimepicker');
+											ams.getCSS(ams.baseURL + '../css/ext/jquery-datetimepicker' + ams.devext + '.css', 'jquery-datetimepicker');
 											ams.dialog.registerHideCallback(ams.helpers.datetimepickerDialogHiddenCallback);
 										}
 										datepickers.each(function() {
@@ -2693,10 +2725,10 @@
 				var datetimepickers = $('.datetimepicker', element);
 				if (datetimepickers.length > 0) {
 					ams.ajax.check($.fn.datetimepicker,
-								   ams.baseURL + 'ext/jquery-datetimepicker' + (ams.devmode ? '.js': '.min.js'),
+								   ams.baseURL + 'ext/jquery-datetimepicker' + ams.devext + '.js',
 								   function(first_load) {
 										if (first_load) {
-											ams.getCSS(ams.baseURL + '../css/ext/jquery-datetimepicker' + (ams.devmode ? '.css' : '.min.css'), 'jquery-datetimepicker');
+											ams.getCSS(ams.baseURL + '../css/ext/jquery-datetimepicker' + ams.devext + '.css', 'jquery-datetimepicker');
 											ams.dialog.registerHideCallback(ams.helpers.datetimepickerDialogHiddenCallback);
 										}
 										datetimepickers.each(function() {
@@ -2725,10 +2757,10 @@
 				var timepickers = $('.timepicker', element);
 				if (timepickers.length > 0) {
 					ams.ajax.check($.fn.datetimepicker,
-								   ams.baseURL + 'ext/jquery-datetimepicker' + (ams.devmode ? '.js': '.min.js'),
+								   ams.baseURL + 'ext/jquery-datetimepicker' + ams.devext + '.js',
 								   function(first_load) {
 										if (first_load) {
-											ams.getCSS(ams.baseURL + '../css/ext/jquery-datetimepicker' + (ams.devmode ? '.css' : '.min.css'), 'jquery-datetimepicker');
+											ams.getCSS(ams.baseURL + '../css/ext/jquery-datetimepicker' + ams.devext + '.css', 'jquery-datetimepicker');
 											ams.dialog.registerHideCallback(ams.helpers.datetimepickerDialogHiddenCallback);
 										}
 										timepickers.each(function() {
@@ -2756,10 +2788,10 @@
 				var colorpickers = $('.colorpicker', element);
 				if (colorpickers.length > 0) {
 					ams.ajax.check($.fn.minicolors,
-								   ams.baseURL + 'ext/jquery-minicolors' + (ams.devmode ? '.js' : '.min.js'),
+								   ams.baseURL + 'ext/jquery-minicolors' + ams.devext + '.js',
 								   function(first_load) {
 										if (first_load) {
-											ams.getCSS(ams.baseURL + '../css/ext/jquery-minicolors' + (ams.devmode ? '.css' : '.min.css'), 'jquery-minicolors');
+											ams.getCSS(ams.baseURL + '../css/ext/jquery-minicolors' + ams.devext + '.css', 'jquery-minicolors');
 										}
 										colorpickers.each(function() {
 											var input = $(this);
@@ -2777,35 +2809,13 @@
 			},
 
 			/**
-			 * JQuery typeahead plug-in
-			 */
-			typeahead: function(element) {
-				var typeaheads = $('.typeahead', element);
-				if (typeaheads.length > 0) {
-					ams.ajax.check($.fn.typeahead,
-								   ams.baseURL + 'ext/jquery-typeahead' + (ams.devmode ? '.js' : '.min.js'),
-								   function() {
-										typeaheads.each(function() {
-											var input = $(this);
-											var data = input.data();
-											var data_options = {};
-											var settings = $.extend({}, data_options, data.amsTypeaheadOptions);
-											settings = ams.executeFunctionByName(data.amsTypeaheadInitCallback, input, settings) || settings;
-											var plugin = input.typeahead(settings);
-											ams.executeFunctionByName(data.amsTypeaheadAfterInitCallback, input, plugin, settings);
-										});
-								   });
-				}
-			},
-
-			/**
 			 * JQuery validation plug-in
 			 */
 			validate: function(element) {
 				var forms = $('FORM:not([novalidate])', element);
 				if (forms.length > 0) {
 					ams.ajax.check($.fn.validate,
-								   ams.baseURL + 'ext/jquery-validate-1.11.1' + (ams.devmode ? '.js' : '.min.js'),
+								   ams.baseURL + 'ext/jquery-validate-1.11.1' + ams.devext + '.js',
 								   function(first_load) {
 										if (first_load) {
 											$.validator.setDefaults({
@@ -2849,7 +2859,7 @@
 																		// before JQuery-form plug-in can get them when submitting the form...
 																		$('.state-error', form).removeClass('state-error');
 																		ams.ajax.check($.fn.ajaxSubmit,
-																					   ams.baseURL + 'ext/jquery-form-3.49' + (ams.devmode ? '.js' : '.min.js'));
+																					   ams.baseURL + 'ext/jquery-form-3.49' + ams.devext + '.js');
 																		return ams.form.submit(form);
 																	}
 																	: ams.getFunctionByName(data.amsFormSubmitHandler)
@@ -2889,7 +2899,7 @@
 				var tables = $('.datatable', element);
 				if (tables.length > 0) {
 					ams.ajax.check($.fn.dataTable,
-								   ams.baseURL + 'ext/jquery-dataTables-1.9.4' + (ams.devmode ? '.js' : '.min.js'),
+								   ams.baseURL + 'ext/jquery-dataTables-1.9.4' + ams.devext + '.js',
 								   function(first_load) {
 										if (first_load) {
 											$.fn.dataTableExt.oSort['numeric-comma-asc']  = function(a, b) {
@@ -2909,7 +2919,7 @@
 										}
 										$(tables).each(function() {
 											ams.ajax.check($.fn.dataTableExt.oPagination['bootstrap_full'],
-														   ams.baseURL + 'myams-dataTables' + (ams.devmode ? '.js' : '.min.js'));
+														   ams.baseURL + 'myams-dataTables' + ams.devext + '.js');
 											var table = $(this);
 											var data = table.data();
 											var extensions = (data.amsDatatableExtensions || '').split(/\s+/);
@@ -2933,6 +2943,7 @@
 												bPaginate: data.amsDatatablePagination !== false,
 												bInfo: data.amsDatatableInfo !== false,
 												bSort: data.amsDatatableSort !== false,
+												aaSorting: data.amsDatatableSorting,
 												bDeferRender: true,
 												bAutoWidth: false,
 												iDisplayLength: data.amsDatatableDisplayLength || 25,
@@ -2951,23 +2962,23 @@
 													switch (extensions[index]) {
 														case 'autofill':
 															ams.ajax.check($.fn.dataTable.AutoFill,
-																		   ams.baseURL + 'ext/jquery-dataTables-autoFill' + (ams.devmode ? '.js' : '.min.js'));
+																		   ams.baseURL + 'ext/jquery-dataTables-autoFill' + ams.devext + '.js');
 															break;
 														case 'columnfilter':
 															ams.ajax.check($.fn.columnFilter,
-																		   ams.baseURL + 'ext/jquery-dataTables-columnFilter' + (ams.devmode ? '.js' : '.min.js'));
+																		   ams.baseURL + 'ext/jquery-dataTables-columnFilter' + ams.devext + '.js');
 															break;
 														case 'colreorder':
 															ams.ajax.check($.fn.dataTable.ColReorder,
-																		   ams.baseURL + 'ext/jquery-dataTables-colReorder' + (ams.devmode ? '.js' : '.min.js'));
+																		   ams.baseURL + 'ext/jquery-dataTables-colReorder' + ams.devext + '.js');
 															break;
 														case 'colreorderwithresize':
 															ams.ajax.check($.fn.dataTable.ColReorder,
-																		   ams.baseURL + 'ext/jquery-dataTables-colReorderWithResize' + (ams.devmode ? '.js' : '.min.js'));
+																		   ams.baseURL + 'ext/jquery-dataTables-colReorderWithResize' + ams.devext + '.js');
 															break;
 														case 'colvis':
 															ams.ajax.check($.fn.dataTable.ColVis,
-																		   ams.baseURL + 'ext/jquery-dataTables-colVis' + (ams.devmode ? '.js' : '.min.js'));
+																		   ams.baseURL + 'ext/jquery-dataTables-colVis' + ams.devext + '.js');
 															var cv_default = {
 																activate: 'click',
 																sAlign: 'right'
@@ -2976,33 +2987,33 @@
 															break;
 														case 'editable':
 															ams.ajax.check($.fn.editable,
-																		   ams.baseURL + 'ext/jquery-jeditable' + (ams.devmode ? '.js' : '.min.js'));
+																		   ams.baseURL + 'ext/jquery-jeditable' + ams.devext + '.js');
 															ams.ajax.check($.fn.makeEditable,
-																		   ams.baseURL + 'ext/jquery-dataTables-editable' + (ams.devmode ? '.js' : '.min.js'));
+																		   ams.baseURL + 'ext/jquery-dataTables-editable' + ams.devext + '.js');
 															break;
 														case 'fixedcolumns':
 															ams.ajax.check($.fn.dataTable.FixedColumns,
-																		   ams.baseURL + 'ext/jquery-dataTables-fixedColumns' + (ams.devmode ? '.js' : '.min.js'));
+																		   ams.baseURL + 'ext/jquery-dataTables-fixedColumns' + ams.devext + '.js');
 															break;
 														case 'fixedheader':
 															ams.ajax.check($.fn.dataTable.FixedHeader,
-																		   ams.baseURL + 'ext/jquery-dataTables-fixedHeader' + (ams.devmode ? '.js' : '.min.js'));
+																		   ams.baseURL + 'ext/jquery-dataTables-fixedHeader' + ams.devext + '.js');
 															break;
 														case 'keytable':
 															ams.ajax.check(window.KeyTable,
-																		   ams.baseURL + 'ext/jquery-dataTables-keyTable' + (ams.devmode ? '.js' : '.min.js'));
+																		   ams.baseURL + 'ext/jquery-dataTables-keyTable' + ams.devext + '.js');
 															break;
 														case 'rowgrouping':
 															ams.ajax.check($.fn.rowGrouping,
-																		   ams.baseURL + 'ext/jquery-dataTables-rowGrouping' + (ams.devmode ? '.js' : '.min.js'));
+																		   ams.baseURL + 'ext/jquery-dataTables-rowGrouping' + ams.devext + '.js');
 															break;
 														case 'rowreordering':
 															ams.ajax.check($.fn.rowReordering,
-																		   ams.baseURL + 'ext/jquery-dataTables-rowReordering' + (ams.devmode ? '.js' : '.min.js'));
+																		   ams.baseURL + 'ext/jquery-dataTables-rowReordering' + ams.devext + '.js');
 															break;
 														case 'scroller':
 															ams.ajax.check($.fn.dataTable.Scroller,
-																		   ams.baseURL + 'ext/jquery-dataTables-scroller' + (ams.devmode ? '.js' : '.min.js'));
+																		   ams.baseURL + 'ext/jquery-dataTables-scroller' + ams.devext + '.js');
 															break;
 														default:
 															break;
@@ -3101,7 +3112,7 @@
 				var tables = $('.table-dnd', element);
 				if (tables.length > 0) {
 					ams.ajax.check($.fn.tableDnD,
-								   ams.baseURL + 'ext/jquery-tablednd' + (ams.devmode ? '.js' : '.min.js'),
+								   ams.baseURL + 'ext/jquery-tablednd' + ams.devext + '.js',
 								   function(first_load) {
 										tables.each(function() {
 											var table = $(this);
@@ -3130,9 +3141,10 @@
 														if (typeof(local_target) == 'function') {
 															local_target.call(table, dnd_table, rows);
 														} else {
-															ams.ajax.post(target, {names: rows});
+															ams.ajax.post(target, {names: JSON.stringify(rows)});
 														}
 													}
+													return false;
 												}
 											};
 											var settings = $.extend({}, data_options, data.amsTabledndOptions);
@@ -3145,16 +3157,133 @@
 			},
 
 			/**
+			 * TinyMCE plug-in
+			 */
+			tinymce: function(element) {
+
+				function cleanEditors() {
+					$('.tinymce', $(this)).each(function() {
+						var editor = tinymce.get($(this).attr('id'));
+						if (editor) {
+							editor.remove();
+						}
+					});
+				}
+
+				var editors = $('.tinymce', element);
+				if (editors.length > 0) {
+					var baseURL = ams.baseURL + 'ext/tinymce' + (ams.devmode ? '/dev' : '');
+					ams.ajax.check(window.tinymce,
+								   baseURL + '/tinymce' + ams.devext + '.js',
+								   function(first_load) {
+										if (first_load) {
+											ams.getScript(baseURL + '/jquery.tinymce' + ams.devext + '.js');
+											tinymce.baseURL = baseURL;
+											tinymce.suffix = ams.devext;
+											ams.skin.registerCleanCallback(cleanEditors);
+										}
+										editors.each(function() {
+											var editor = $(this);
+											var data = editor.data();
+											var data_options = {
+												theme: "modern",
+												language: ams.lang,
+												plugins: [
+													"advlist autosave autolink lists link image charmap print preview hr anchor pagebreak",
+													"searchreplace wordcount visualblocks visualchars code fullscreen",
+													"insertdatetime media nonbreaking save table contextmenu directionality",
+													"emoticons paste textcolor colorpicker textpattern"
+												],
+												toolbar1: "newdocument undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
+												toolbar2: "print preview media | forecolor backcolor emoticons | code fullscreen",
+												content_css: data.amsTinymceContentCss,
+												formats: data.amsTinymceFormats,
+												style_formats: data.amsTinymceStyleFormats,
+												block_formats: data.amsTinymceBlockFormats,
+												valid_classes: data.amsTinymceValidClasses,
+												image_advtab: true,
+												image_list: ams.getFunctionByName(data.amsTinymceImageList) || data.amsTinymceImageList,
+												image_class_list: data.amsTinymceImageClassList,
+												link_list: ams.getFunctionByName(data.amsTinymceLinkList) || data.amsTinymceLinkList,
+												link_class_list: data.amsTinymceLinkClassList,
+												resize: true
+											};
+											if (data.amsTinymceExternalPlugins) {
+												var names = data.amsTinymceExternalPlugins.split(/\s+/);
+												for (var index in names) {
+													var plugin_src = editor.data('ams-tinymce-plugin-' + names[index]);
+													tinymce.PluginManager.load(names[index], ams.getSource(plugin_src));
+												}
+											}
+											var settings = $.extend({}, data_options, data.amsTinymceOptions);
+											settings = ams.executeFunctionByName(data.amsTinymceInitCallback, editor, settings) || settings;
+											var plugin = editor.tinymce(settings);
+											ams.executeFunctionByName(data.amsTinymceAfterInitCallback, editor, plugin, settings);
+										});
+								   });
+				}
+			},
+
+			/**
+			 * Image area select plug-in
+			 */
+			imgareaselect: function(element) {
+				var images = $('.imgareaselect', element);
+				if (images.length > 0) {
+					ams.ajax.check($.fn.imgAreaSelect,
+								   ams.baseURL + 'ext/jquery-imgareaselect-0.9.10' + ams.devext + '.js',
+								   function(first_load) {
+									   if (first_load)
+										   ams.getCSS(ams.baseURL + '../css/ext/jquery-imgareaselect' + ams.devext + '.css');
+									   images.each(function() {
+										   var image = $(this);
+										   var data = image.data();
+										   var parent = data.amsImgareaselectParent ? image.parents(data.amsImgareaselectParent) : 'body';
+										   var data_options = {
+											   instance: true,
+											   handles: true,
+											   parent: parent,
+											   x1: data.amsImgareaselectX1 || 0,
+											   y1: data.amsImgareaselectY1 || 0,
+											   x2: data.amsImgareaselectX2 || data.amsImgareaselectImageWidth,
+											   y2: data.amsImgareaselectY2 || data.amsImgareaselectImageHeight,
+											   imageWidth: data.amsImgareaselectImageWidth,
+											   imageHeight: data.amsImgareaselectImageHeight,
+											   minWidth: 128,
+											   minHeight: 128,
+											   aspectRatio: data.amsImgareaselectRatio,
+											   onSelectEnd: ams.getFunctionByName(data.amsImgareaselectSelectEnd) || function(img, selection) {
+												   var target = data.amsImgareaselectTargetField || 'image_';
+												   $('input[name="' + target + 'x1"]', parent).val(selection.x1);
+												   $('input[name="' + target + 'y1"]', parent).val(selection.y1);
+												   $('input[name="' + target + 'x2"]', parent).val(selection.x2);
+												   $('input[name="' + target + 'y2"]', parent).val(selection.y2);
+											   }
+										   };
+										   var settings = $.extend({}, data_options, data.amsImgareaselectOptions);
+										   settings = ams.executeFunctionByName(data.amsImgareaselectInitCallback, image, settings) || settings;
+										   var plugin = image.imgAreaSelect(settings);
+										   ams.executeFunctionByName(data.amsImgareaselectAfterInitCallback, image, plugin, settings);
+										   // Add update timeout when plug-in is displayed into a modal dialog
+										   setTimeout(function() {
+											   plugin.update();
+										   }, 250);
+									   });
+								   })
+				}
+			},
+
+			/**
 			 * FancyBox plug-in
 			 */
 			fancybox: function(element) {
 				var fancyboxes = $('.fancybox', element);
 				if (fancyboxes.length > 0) {
 					ams.ajax.check($.fn.fancybox,
-								   ams.baseURL + 'ext/jquery-fancybox-2.1.5' + (ams.devmode ? '.js' : '.min.js'),
+								   ams.baseURL + 'ext/jquery-fancybox-2.1.5' + ams.devext + '.js',
 								   function(first_load) {
 										if (first_load)
-											ams.getCSS(ams.baseURL + '../css/ext/jquery-fancybox-2.1.5' + (ams.devmode ? '.css' : '.min.css'));
+											ams.getCSS(ams.baseURL + '../css/ext/jquery-fancybox-2.1.5' + ams.devext + '.css');
 										fancyboxes.each(function() {
 											var fancybox = $(this);
 											var data = fancybox.data();
@@ -3165,15 +3294,15 @@
 													switch (helper) {
 														case 'buttons':
 															ams.ajax.check($.fancybox.helpers.buttons,
-																		   ams.baseURL + 'ext/fancybox-helpers/fancybox-buttons.js' + (ams.devmode ? '.js' : '.min.js'));
+																		   ams.baseURL + 'ext/fancybox-helpers/fancybox-buttons' + ams.devext + '.js');
 															break;
 														case 'thumbs':
 															ams.ajax.check($.fancybox.helpers.thumbs,
-																		   ams.baseURL + 'ext/fancybox-helpers/fancybox-thumbs.js' + (ams.devmode ? '.js' : '.min.js'));
+																		   ams.baseURL + 'ext/fancybox-helpers/fancybox-thumbs' + ams.devext + '.js');
 															break;
 														case 'media':
 															ams.ajax.check($.fancybox.helpers.media,
-																		   ams.baseURL + 'ext/fancybox-helpers/fancybox-media.js' + (ams.devmode ? '.js' : '.min.js'));
+																		   ams.baseURL + 'ext/fancybox-helpers/fancybox-media' + ams.devext + '.js');
 															break;
 														default:
 															break;
@@ -3203,62 +3332,13 @@
 			},
 
 			/**
-			 * Image area select plug-in
-			 */
-			imgareaselect: function(element) {
-				var images = $('.imgareaselect', element);
-				if (images.length > 0) {
-					ams.ajax.check($.fn.imgAreaSelect,
-								   ams.baseURL + 'ext/jquery-imgareaselect-0.9.10' + (ams.devmode ? '.js' : '.min.js'),
-								   function(first_load) {
-										if (first_load)
-											ams.getCSS(ams.baseURL + '../css/ext/jquery-imgareaselect' + (ams.devmode ? '.css' : '.min.css'));
-										images.each(function() {
-											var image = $(this);
-											var data = image.data();
-											var parent = data.amsImgareaselectParent ? image.parents(data.amsImgareaselectParent) : 'body';
-											var data_options = {
-												instance: true,
-												handles: true,
-												parent: parent,
-												x1: data.amsImgareaselectX1 || 0,
-												y1: data.amsImgareaselectY1 || 0,
-												x2: data.amsImgareaselectX2 || data.amsImgareaselectImageWidth,
-												y2: data.amsImgareaselectY2 || data.amsImgareaselectImageHeight,
-												imageWidth: data.amsImgareaselectImageWidth,
-												imageHeight: data.amsImgareaselectImageHeight,
-												minWidth: 128,
-												minHeight: 128,
-												aspectRatio: data.amsImgareaselectRatio,
-												onSelectEnd: ams.getFunctionByName(data.amsImgareaselectSelectEnd) || function(img, selection) {
-													var target = data.amsImgareaselectTargetField || 'image_';
-													$('input[name="' + target + 'x1"]', parent).val(selection.x1);
-													$('input[name="' + target + 'y1"]', parent).val(selection.y1);
-													$('input[name="' + target + 'x2"]', parent).val(selection.x2);
-													$('input[name="' + target + 'y2"]', parent).val(selection.y2);
-												}
-											};
-											var settings = $.extend({}, data_options, data.amsImgareaselectOptions);
-											settings = ams.executeFunctionByName(data.amsImgareaselectInitCallback, image, settings) || settings;
-											var plugin = image.imgAreaSelect(settings);
-											ams.executeFunctionByName(data.amsImgareaselectAfterInitCallback, image, plugin, settings);
-											// Add update timeout when plug-in is displayed into a modal dialog
-											setTimeout(function() {
-												plugin.update();
-											}, 250);
-										});
-								   })
-				}
-			},
-
-			/**
 			 * Sparkline graphs
 			 */
 			graphs: function(element) {
 				var graphs = $('.sparkline', element);
 				if (graphs.length > 0) {
 					ams.ajax.check(ams.graphs,
-								   ams.baseURL + 'myams-graphs' + (ams.devmode ? '.js' : '.min.js'),
+								   ams.baseURL + 'myams-graphs' + ams.devext + '.js',
 								   function() {
 										ams.graphs.init(graphs);
 								   });
@@ -3275,7 +3355,7 @@
 								   ams.baseURL + 'ext/jquery-mousewheel.min.js',
 								   function() {
 										ams.ajax.check($.fn.mCustomScrollbar,
-													   ams.baseURL + 'ext/jquery-mCustomScrollbar' + (ams.devmode ? '.js' : '.min.js'),
+													   ams.baseURL + 'ext/jquery-mCustomScrollbar' + ams.devext + '.js',
 													   function(first_load) {
 															if (first_load)
 																ams.getCSS(ams.baseURL + '../css/ext/jquery-mCustomScrollbar.css',
@@ -3568,7 +3648,7 @@
 				var widgets = $('.ams-widget', element);
 				if (widgets.length > 0)
 					ams.ajax.check($.fn.MyAMSWidget,
-								   ams.baseURL + 'myams-widgets' + (ams.devmode ? '.js' : '.min.js'),
+								   ams.baseURL + 'myams-widgets' + ams.devext + '.js',
 								   function() {
 										widgets.each(function() {
 											var widget = $(this);
@@ -3638,7 +3718,7 @@
 		 */
 		bigBox: function(options, callback) {
 			ams.ajax.check(ams.notify,
-						   ams.baseURL + 'myams-notify' + (ams.devmode ? '.js' : '.min.js'),
+						   ams.baseURL + 'myams-notify' + ams.devext + '.js',
 						   function() {
 								ams.notify.messageBox(options, callback);
 						   });
@@ -3654,7 +3734,7 @@
 				status = 'info';
 			}
 			ams.ajax.check(ams.notify,
-						   ams.baseURL + 'myams-notify' + (ams.devmode ? '.js' : '.min.js'),
+						   ams.baseURL + 'myams-notify' + ams.devext + '.js',
 						   function() {
 								switch (status) {
 									case 'error':
@@ -3685,7 +3765,7 @@
 				status = 'info';
 			}
 			ams.ajax.check(ams.notify,
-						   ams.baseURL + 'myams-notify' + (ams.devmode ? '.js' : '.min.js'),
+						   ams.baseURL + 'myams-notify' + ams.devext + '.js',
 						   function() {
 								switch (status) {
 									case 'error':
@@ -3777,6 +3857,32 @@
 		},
 
 		/**
+		 * List of registered 'cleaning' callbacks
+		 * These callbacks are called before loading a new URL into a given container
+		 * to clean required elements from memory before the DOM elements are removed
+		 */
+		_clean_callbacks: [],
+
+		/**
+		 * Register a callback which should be called before a container is replaced
+		 */
+		registerCleanCallback: function(callback) {
+			var callbacks = ams.skin._clean_callbacks;
+			if (callbacks.indexOf(callback) < 0)
+				callbacks.push(callback);
+		},
+
+		/**
+		 * Call registered cleaning callbacks on given container
+		 */
+		cleanContainer: function(container) {
+			var callbacks = ams.skin._clean_callbacks;
+			for (var index in callbacks) {
+				callbacks[index].call(container);
+			}
+		},
+
+		/**
 		 * Load given URL into container
 		 */
 		loadURL: function(url, container, options, callback) {
@@ -3794,7 +3900,8 @@
 				dataType: 'html',
 				cache: false,
 				beforeSend: function() {
-					container.html('<h1><i class="fa fa-cog fa-spin"></i> Loading... </h1>');
+					ams.skin.cleanContainer(container);
+					container.html('<h1 class="loading"><i class="fa fa-cog fa-spin"></i> Loading... </h1>');
 					if (container[0] == $('#content')[0]) {
 						ams.skin._drawBreadCrumb();
 						document.title = $('.breadcrumb LI:last-child').text();
@@ -3810,6 +3917,7 @@
 						var request_data = ams.ajax.getResponse(request);
 						var data_type = request_data.content_type;
 						var result = request_data.data;
+						$('.loading', container).remove();
 						switch (data_type) {
 							case 'json':
 								ams.ajax.handleJSON(result, container);
@@ -3920,7 +4028,7 @@
 			ams.device = 'mobile';
 			if (ams.enable_fastclick) {
 				ams.ajax.check($.fn.noClickDelay,
-							   ams.baseURL + '/ext/jquery-smartclick' + (ams.devmode ? '.js' : '.min.js'),
+							   ams.baseURL + '/ext/jquery-smartclick' + ams.devext + '.js',
 							   function() {
 								   $('NAV UL A').noClickDelay();
 								   $('#hide-menu A').noClickDelay();
@@ -4050,7 +4158,7 @@
 
 		// Resize events
 		ams.ajax.check($.resize,
-					   ams.baseURL + 'ext/jquery-resize' + (ams.devmode ? '.js' : '.min.js'),
+					   ams.baseURL + 'ext/jquery-resize' + ams.devext + '.js',
 					   function() {
 						   $('#main').resize(function() {
 							   ams.skin._setPageHeight();
@@ -4063,8 +4171,6 @@
 
 		// Init AJAX navigation
 		if (ams.ajax_nav) {
-			if ($('nav').length > 0)
-				ams.skin.checkURL();
 			$(document).on('click', 'a[href="#"]', function(e) {
 				e.preventDefault();
 			});
@@ -4196,6 +4302,13 @@
 			}
 		});
 
+		// Prevent bootstrap dialog from blocking TinyMCE focus
+		$(document).on('focusin', function(e) {
+			if ($(e.target).closest('.mce-window').length) {
+				e.stopImmediatePropagation();
+			}
+		});
+
 		// Disable clicks on disabled tabs
 		$("a[data-toggle=tab]", ".nav-tabs").on("click", function(e) {
 			if ($(this).parent('li').hasClass("disabled")) {
@@ -4217,13 +4330,10 @@
 			}
 		});
 
-		// Init plug-ins required by main layout
-		ams.plugins.enabled.hint(document);
-
-		// Init content when not loaded by AJAX request
-		// or when redirecting to authentication page...
-		if ((window.location.hash == '') || (ams.getQueryVar(window.location.href, 'came_from') != false))
-			ams.initContent(document);
+		// Init page content
+		ams.initContent(document);
+		if (ams.ajax_nav && ($('nav').length > 0))
+			ams.skin.checkURL();
 
 		// Add unload event listener to check for modified forms
 		$(window).on('beforeunload', ams.form.checkBeforeUnload);
--- a/src/pyams_skin/resources/js/myams.min.js	Wed May 20 15:01:45 2015 +0200
+++ b/src/pyams_skin/resources/js/myams.min.js	Wed Jun 17 10:00:10 2015 +0200
@@ -1,1 +1,1 @@
-(function(b){String.prototype.startsWith=function(e){var c=this.length;var d=e.length;if(c<d){return false}return(this.substr(0,d)==e)};String.prototype.endsWith=function(e){var c=this.length;var d=e.length;if(c<d){return false}return(this.substr(c-d)==e)};if(!Array.prototype.indexOf){Array.prototype.indexOf=function(d){var c=this.length;var e=Number(arguments[1])||0;e=(e<0)?Math.ceil(e):Math.floor(e);if(e<0){e+=c}for(;e<c;e++){if(e in this&&this[e]===d){return e}}return -1}}b.expr[":"].econtains=function(e,c,d){return(e.textContent||e.innerText||b(e).text()||"").toLowerCase()==d[3].toLowerCase()};b.expr[":"].withtext=function(e,c,d){return(e.textContent||e.innerText||b(e).text()||"")==d[3]};b.expr[":"].parents=function(e,c,d){return b(e).parents(d[3]).length>0};if(b.scrollbarWidth===undefined){b.scrollbarWidth=function(){var d=b('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body");var e=d.children();var c=e.innerWidth()-e.height(99).innerWidth();d.remove();return c}}b.fn.extend({exists:function(){return b(this).length>0},listattr:function(d){var c=[];this.each(function(){c.push(b(this).attr(d))});return c},style:function(d,g,c){var f=this.get(0);if(typeof f=="undefined"){return}var e=this.get(0).style;if(typeof d!="undefined"){if(typeof g!="undefined"){c=typeof c!="undefined"?c:"";e.setProperty(d,g,c);return this}else{return e.getPropertyValue(d)}}else{return e}},removeClassPrefix:function(c){this.each(function(e,f){var d=f.className.split(" ").map(function(g){return g.startsWith(c)?"":g});f.className=b.trim(d.join(" "))});return this},contextMenu:function(d){function c(g,i,f){var h=b(window)[i](),j=b(d.menuSelector)[i](),e=g;if(g+j>h&&j<g){e-=j}return e}return this.each(function(){b("a",b(d.menuSelector)).each(function(){b(this).data("ams-context-menu",true)});b(this).on("contextmenu",function(f){if(f.ctrlKey){return}b(d.menuSelector).data("invokedOn",b(f.target)).show().css({position:"fixed",left:c(f.clientX,"width","scrollLeft")-10,top:c(f.clientY,"height","scrollTop")-10}).off("click").on("click",function(h){b(this).hide();var g=b(this).data("invokedOn");var i=b(h.target);d.menuSelected.call(this,g,i);a.event.stop(h)});return false});b(document).click(function(){b(d.menuSelector).hide()})})},myams_menu:function(c){var e={accordion:"true",speed:200,closedSign:'<em class="fa fa-angle-down"></em>',openedSign:'<em class="fa fa-angle-up"></em>'};var d=b.extend({},e,c);var f=b(this);f.find("LI").each(function(){var g=b(this);if(g.find("UL").size()>0){g.find("A:first").append("<b class='collapse-sign'>"+d.closedSign+"</b>");var h=g.find("A:first");if(h.attr("href")=="#"){h.click(function(){return false})}}});f.find("LI.active").each(function(){var g=b(this).parents("UL");var h=g.parent("LI");g.slideDown(d.speed);h.find("b:first").html(d.openedSign);h.addClass("open")});f.find("LI A").on("click",function(){var j=b(this);var g=j.parent().find("UL");if(d.accordion){var i=j.parent().parents("UL");var k=f.find("UL:visible");k.each(function(l){var m=true;i.each(function(n){if(i[n]==k[l]){m=false;return false}});if(m){if(g!=k[l]){b(k[l]).slideUp(d.speed,function(){j.parent("LI").find("b:first").html(d.closedSign);j.parent("LI").removeClass("open")})}}})}var h=j.parent().find("UL:first");if(!j.attr("href").replace(/^#/,"")&&h.is(":visible")&&!h.hasClass("active")){h.slideUp(d.speed,function(){j.parent("LI").removeClass("open").find("B:first").delay(d.speed).html(d.closedSign)})}else{h.slideDown(d.speed,function(){j.parent("LI").addClass("open").find("B:first").delay(d.speed).html(d.openedSign)})}})}});b.UTF8={encode:function(e){e=e.replace(/\r\n/g,"\n");var d="";for(var g=0;g<e.length;g++){var f=e.charCodeAt(g);if(f<128){d+=String.fromCharCode(f)}else{if((f>127)&&(f<2048)){d+=String.fromCharCode((f>>6)|192);d+=String.fromCharCode((f&63)|128)}else{d+=String.fromCharCode((f>>12)|224);d+=String.fromCharCode(((f>>6)&63)|128);d+=String.fromCharCode((f&63)|128)}}}return d},decode:function(d){var f="";var h=0,j=0,g=0,e=0;while(h<d.length){j=d.charCodeAt(h);if(j<128){f+=String.fromCharCode(j);h++}else{if((j>191)&&(j<224)){g=d.charCodeAt(h+1);f+=String.fromCharCode(((j&31)<<6)|(g&63));h+=2}else{g=d.charCodeAt(h+1);e=d.charCodeAt(h+2);f+=String.fromCharCode(((j&15)<<12)|((g&63)<<6)|(e&63));h+=3}}}return f}};if(window.MyAMS===undefined){window.MyAMS={devmode:true,devext:"",lang:"en",throttle_delay:350,menu_speed:235,navbar_height:49,ajax_nav:true,enable_widgets:true,enable_mobile:false,enable_fastclick:false,warn_on_form_change:false,ismobile:(/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()))}}var a=MyAMS;MyAMS.baseURL=(function(){var c=b('script[src$="/myams.js"], script[src$="/myams.min.js"]');var d=c.attr("src");a.devmode=!d.endsWith(".min.js");a.devext=a.devmode?"":".min";return d.substring(0,d.lastIndexOf("/")+1)})();MyAMS.getQueryVar=function(e,f){if(e.indexOf("?")<0){return false}if(!e.endsWith("&")){e+="&"}var c=new RegExp(".*?[&\\?]"+f+"=(.*?)&.*");var d=e.replace(c,"$1");return d==e?false:d};MyAMS.rgb2hex=function(c){return"#"+b.map(c.match(/\b(\d+)\b/g),function(d){return("0"+parseInt(d).toString(16)).slice(-2)}).join("")};MyAMS.generateId=function(){function c(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return c()+c()+c()+c()};MyAMS.getFunctionByName=function(h,d){if(h===undefined){return undefined}else{if(typeof(h)=="function"){return h}}var g=h.split(".");var f=g.pop();d=(d===undefined||d===null)?window:d;for(var c=0;c<g.length;c++){try{d=d[g[c]]}catch(j){return undefined}}try{return d[f]}catch(j){return undefined}};MyAMS.executeFunctionByName=function(f,d){var e=a.getFunctionByName(f,window);if(typeof(e)=="function"){var c=Array.prototype.slice.call(arguments,2);return e.apply(d,c)}};MyAMS.getSource=function(c){return c.replace(/{[^{}]*}/g,function(d){return a.getFunctionByName(d.substr(1,d.length-2))})};MyAMS.getScript=function(d,g,c){var f={dataType:"script",url:a.getSource(d),success:g,error:a.error.show,cache:!a.devmode,async:typeof(g)=="function"};var e=b.extend({},f,c);return b.ajax(e)};MyAMS.getCSS=function(c,g){var e=b("HEAD");var d=b('link[data-ams-id="'+g+'"]',e);if(d.length==0){var f=a.getSource(c);if(a.devmode){f+="?_="+new Date().getTime()}b("<link />").attr({rel:"stylesheet",type:"text/css",href:f,"data-ams-id":g}).appendTo(e)}};MyAMS.event={stop:function(c){if(!c){c=window.event}if(c){if(c.stopPropagation){c.stopPropagation();c.preventDefault()}else{c.cancelBubble=true;c.returnValue=false}}}};MyAMS.browser={getInternetExplorerVersion:function(){var e=-1;if(navigator.appName=="Microsoft Internet Explorer"){var c=navigator.userAgent;var d=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");if(d.exec(c)!=null){e=parseFloat(RegExp.$1)}}return e},checkVersion:function(){var d="You're not using Windows Internet Explorer.";var c=this.getInternetExplorerVersion();if(c>-1){if(c>=8){d="You're using a recent copy of Windows Internet Explorer."}else{d="You should upgrade your copy of Windows Internet Explorer."}}alert(d)},isIE8orlower:function(){var d="0";var c=this.getInternetExplorerVersion();if(c>-1){if(c>=9){d=0}else{d=1}}return d}};MyAMS.error={ajax:function(f,e){if(e.statusText=="OK"){return}var c=a.ajax.getResponse(e);if(c.content_type=="json"){a.ajax.handleJSON(c.data)}else{var g=f.statusText||f.type;var d=e.responseText;a.skin.messageBox("error",{title:a.i18n.ERROR_OCCURED,content:"<h4>"+g+"</h4><p>"+d+"</p>",icon:"fa fa-warning animated shake",timeout:10000})}if(window.console){console.error(f);console.debug(e)}},show:function(f,c,e){if(!e){return}var d=a.ajax.getResponse(f);if(d.content_type=="json"){a.ajax.handleJSON(d.data)}else{a.skin.messageBox("error",{title:a.i18n.ERRORS_OCCURED,content:"<h4>"+c+"</h4><p>"+e+"</p>",icon:"fa fa-warning animated shake",timeout:10000})}if(window.console){console.error(e);console.debug(f)}}};MyAMS.ajax={check:function(d,f,h,c){if(typeof(h)=="object"){c=h;h=undefined}var g={async:typeof(h)=="function"};var e=b.extend({},g,c);if(d===undefined){a.getScript(f,function(){if(typeof(h)=="function"){h(true,c)}},e)}else{if(typeof(h)=="function"){h(false,c)}}},getAddr:function(d){var c=d||b("HTML HEAD BASE").attr("href")||window.location.href;return c.substr(0,c.lastIndexOf("/")+1)},start:function(){b("#ajax-gear").show()},stop:function(){b("#ajax-gear").hide()},progress:function(c){if(!c.lengthComputable){return}if(c.loaded>=c.total){return}console.log(parseInt((c.loaded/c.total*100),10)+"%")},post:function(e,g,d,j){if(e.startsWith(window.location.protocol)){var i=e}else{i=this.getAddr()+e}if(typeof(d)=="function"){j=d;d={}}else{if(!d){d={}}}if(typeof(j)=="undefined"){j=d.callback}if(typeof(j)=="string"){j=a.getFunctionByName(j)}delete d.callback;var c=undefined;var h={url:i,type:"post",cache:false,async:typeof(j)=="function",data:b.param(g),dataType:"json",success:j||function(k){c=k.result},error:a.error.show};var f=b.extend({},h,d);b.ajax(f);return c},getResponse:function(f){var d=f.getResponseHeader("content-type"),h,c;if(d){if(d.startsWith("application/javascript")){h="script";c=f.responseText}else{if(d.startsWith("text/html")){h="html";c=f.responseText}else{if(d.startsWith("text/xml")){h="xml";c=f.responseText}else{c=f.responseJSON;if(c){h="json"}else{try{c=JSON.parse(f.responseText);h="json"}catch(g){c=f.responseText;h="text"}}}}}}else{h="json";c={status:"alert",alert:{title:a.i18n.ERROR_OCCURED,content:a.i18n.NO_SERVER_RESPONSE}}}return{content_type:h,data:c}},handleJSON:function(n,e,j){var h=n.status;var c;switch(h){case"alert":alert(n.alert.title+"\n\n"+n.alert.content);break;case"error":a.form.showErrors(e,n);break;case"info":case"success":if(n.close_form!=false){a.dialog.close(e)}break;case"message":case"messagebox":break;case"notify":case"callback":case"callbacks":if(n.close_form!=false){a.dialog.close(e)}break;case"modal":a.dialog.open(n.location);break;case"reload":if(n.close_form!=false){a.dialog.close(e)}c=n.location||window.location.hash;if(c.startsWith("#")){c=c.substr(1)}a.skin.loadURL(c,n.target||j||"#content");break;case"redirect":if(n.close_form==true){a.dialog.close(e)}c=n.location||window.location.href;if(n.window){window.open(c,n.window,n.options)}else{window.location.href=c}break;default:console.log("Unhandled status: "+h);break}if(n.content){var k=n.content;var d=b(k.target||j||e||"#content");if(k.raw==true){d.text(k.text)}else{d.html(k.html);a.initContent(d)}if(!k.keep_hidden){d.removeClass("hidden")}}if(n.contents){var g=n.contents;for(var i in g){k=g[i];d=b(k.target);if(k.raw==true){d.text(k.text)}else{d.html(k.html);a.initContent(d)}if(!k.keep_hidden){d.removeClass("hidden")}}}if(n.message){var m=n.message;if(typeof(m)=="string"){if((h=="info")||(h=="success")){a.skin.smallBox(h,{title:m,icon:"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:3000})}else{a.skin.alert(b(e||"#content"),h,m)}}else{a.skin.alert(b(m.target||j||e||"#content"),m.status||"success",m.header,m.body,m.subtitle)}}if(n.smallbox){a.skin.smallBox(n.smallbox_status||h,{title:n.smallbox,icon:"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:3000})}if(n.messagebox){m=n.messagebox;if(typeof(m)=="string"){a.skin.messageBox("info",{title:a.i18n.ERROR_OCCURED,content:m,timeout:10000})}else{var f=m.status||"info";if(f=="error"&&e&&j){a.executeFunctionByName(e.data("ams-form-submit-error")||"MyAMS.form.finalizeSubmitOnError",e,j)}a.skin.messageBox(f,{title:m.title||a.i18n.ERROR_OCCURED,content:m.content,icon:m.icon,number:m.number,timeout:m.timeout==null?undefined:(m.timeout||10000)})}}if(n.event){e.trigger(n.event,n.event_options)}if(n.callback){a.executeFunctionByName(n.callback,e,n.options)}if(n.callbacks){for(i in n.callbacks){if(!b.isNumeric(i)){continue}var l=n.callbacks[i];a.executeFunctionByName(l,e,l.options)}}}};MyAMS.jsonrpc={getAddr:function(e){var c=e||b("HTML HEAD BASE").attr("href")||window.location.href;var d=c.replace(/\+\+skin\+\+\w+\//,"");return d.substr(0,d.lastIndexOf("/")+1)},query:function(d,f,c,e){a.ajax.check(b.jsonRpc,a.baseURL+"ext/jquery-jsonrpc"+(a.devmode?".js":".min.js"),function(){var g;if(typeof(c)=="function"){e=c;c={}}else{if(!c){c={}}}if(typeof(e)=="undefined"){e=c.callback}if(typeof(e)=="string"){e=a.getFunctionByName(e)}delete c.callback;var i={};if(typeof(d)=="string"){i.query=d}else{if(typeof(d)=="object"){b.extend(i,d)}}b.extend(i,c);var h={url:a.jsonrpc.getAddr(c.url),type:"post",cache:false,method:f,params:i,async:typeof(e)=="function",success:e||function(j){g=j.result},error:a.error.show};b.jsonRpc(h);return g})},post:function(f,d,c,e){a.ajax.check(b.jsonRPC,a.baseURL+"ext/jquery-jsonrpc"+(a.devmode?".js":".min.js"),function(){var g;if(typeof(c)=="function"){e=c;c={}}else{if(!c){c={}}}if(typeof(e)=="undefined"){e=c.callback}if(typeof(e)=="string"){e=a.getFunctionByName(e)}delete c.callback;var g;var i={id:new Date().getTime(),params:d,success:e||function(j){g=j},error:a.error.show};var h=b.extend({},i,c);b.jsonRPC.withOptions({endPoint:a.jsonrpc.getAddr(c.url),namespace:c.namespace,cache:false},function(){b.jsonRPC.request(f,h)});return g})}};MyAMS.xmlrpc={getAddr:function(e){var c=e||b("HTML HEAD BASE").attr("href")||window.location.href;var d=c.replace(/\+\+skin\+\+\w+\//,"");return d.substr(0,d.lastIndexOf("/")+1)},post:function(d,g,e,c,f){a.ajax.check(b.xmlrpc,a.baseURL+"ext/jquery-xmlrpc"+(a.devmode?".js":".min.js"),function(){var h;if(typeof(c)=="function"){f=c;c={}}else{if(!c){c={}}}if(typeof(f)=="undefined"){f=c.callback}if(typeof(f)=="string"){f=a.getFunctionByName(f)}delete c.callback;var j={url:a.xmlrpc.getAddr(d),methodName:g,params:e,success:f||function(k){h=k},error:a.error.show};var i=b.extend({},j,c);b.xmlrpc(i);return h})}};MyAMS.form={init:function(d){if(a.warn_on_form_change){var c=b('FORM[data-ams-warn-on-change!="false"]',d)}else{c=b('FORM[data-ams-warn-on-change="true"]',d)}c.each(function(){var e=b(this);b('INPUT[type="text"], INPUT[type="checkbox"], INPUT[type="radio"], SELECT, TEXTAREA, [data-ams-changed-event]',e).each(function(){var g=b(this);if(g.data("ams-ignore-change")!==true){var f=g.data("ams-changed-event")||"change";g.on(f,function(){b(this).parents("FORM").attr("data-ams-form-changed",true)})}});e.on("reset",function(){b(this).removeAttr("data-ams-form-changed")})})},checkBeforeUnload:function(){var c=b('FORM[data-ams-form-changed="true"]');if(c.exists()){return a.i18n.FORM_CHANGED_WARNING}},confirmChangedForm:function(d,e){if(typeof(d)=="function"){e=d;d=undefined}var c=b('FORM[data-ams-form-changed="true"]',d);if(c.exists()){a.skin.bigBox({title:a.i18n.WARNING,content:'<i class="text-danger fa fa-2x fa-bell shake animated"></i>&nbsp; '+a.i18n.FORM_CHANGED_WARNING,buttons:a.i18n.BTN_OK_CANCEL},function(f){if(f==a.i18n.BTN_OK){e.call(d)}})}else{e.call(d)}},submit:function(e,d,f){e=b(e);if(!e.exists()){return false}if(typeof(d)=="object"){f=d;d=undefined}if(e.data("submitted")){if(!e.data("ams-form-hide-submitted")){a.skin.messageBox("warning",{title:a.i18n.WAIT,content:a.i18n.FORM_SUBMITTED,icon:"fa fa-save shake animated",timeout:e.data("ams-form-alert-timeout")||5000})}return false}if(!a.form._checkSubmitValidators(e)){return false}b(".alert, SPAN.state-error",e).remove();b(".state-error",e).removeClassPrefix("state-");var c=b(e.data("ams-submit-button"));if(c){c.button("loading")}a.ajax.check(b.fn.ajaxSubmit,a.baseURL+"ext/jquery-form-3.49"+(a.devmode?".js":".min.js"),function(){function i(k,m){var j;var C=k.data();var t=C.amsFormOptions;if(f){var o=f.formDataInitCallback}if(o){delete f.formDataInitCallback}else{o=C.amsFormDataInitCallback}if(o){var u={};if(typeof(o)=="function"){var l=o.call(k,u)}else{l=a.executeFunctionByName(o,k,u)}if(u.veto){j=k.data("ams-submit-button");if(j){j.button("reset")}a.form.finalizeSubmitFooter.call(k);return false}}else{l=C.amsFormData||{}}j=b(k.data("ams-submit-button"));var v,y;if(j){v=j.data("ams-form-handler");y=j.data("ams-form-submit-target")}var r=d||v||C.amsFormHandler||"";if(r.startsWith(window.location.protocol)){var n=r}else{var x=k.attr("action").replace(/#/,"");if(x.startsWith(window.location.protocol)){n=x}else{n=a.ajax.getAddr()+x}n+=r}var B=null;if(C.amsFormInitSubmitTarget){B=b(y||C.amsFormSubmitTarget||"#content");a.executeFunctionByName(C.amsFormInitSubmit||"MyAMS.form.initSubmit",k,B)}else{if(!C.amsFormHideSubmitFooter){a.executeFunctionByName(C.amsFormInitSubmit||"MyAMS.form.initSubmitFooter",k)}}var p=typeof(m.uuid)!="undefined";if(p){if(n.indexOf("X-Progress-ID")<0){n+="?X-Progress-ID="+m.uuid}delete m.uuid}var s={url:n,type:"post",cache:false,data:l,dataType:C.amsFormDatatype,beforeSerialize:function(){if(typeof(tinyMCE)!="undefined"){tinyMCE.triggerSave()}},beforeSubmit:function(E,D){D.data("submitted",true)},error:function(H,D,E,G){if(B){a.executeFunctionByName(C.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",G,B)}if(G.is(":visible")){var F=G.data("ams-submit-button");if(F){F.button("reset")}a.form.finalizeSubmitFooter.call(G)}G.data("submitted",false);G.removeData("ams-submit-button")},iframe:p};var w=C.amsFormDownloadTarget;if(w){var q=b('iframe[name="'+w+'"]');if(!q.exists()){q=b("<iframe></iframe>").hide().attr("name",w).appendTo(k)}s=b.extend({},s,{iframe:true,iframeTarget:q,success:function(D,E,I,H){var G=b(H).parents(".modal-dialog");if(G.exists()){a.dialog.close(H)}else{var J;var F=H.data("ams-submit-button");if(F){J=F.data("ams-form-submit-callback")}if(!J){J=a.getFunctionByName(C.amsFormSubmitCallback)||a.form._submitCallback}J.call(H,D,E,I,H);if(H.is(":visible")&&F){F.button("reset")}H.data("submitted",false);H.removeData("ams-submit-button");H.removeAttr("data-ams-form-changed")}}})}else{s=b.extend({},s,{error:function(H,D,E,G){if(B){a.executeFunctionByName(C.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",G,B)}if(G.is(":visible")){var F=G.data("ams-submit-button");if(F){F.button("reset")}a.form.finalizeSubmitFooter.call(G)}G.data("submitted",false);G.removeData("ams-submit-button")},success:function(D,E,H,G){var I;var F=G.data("ams-submit-button");if(F){I=F.data("ams-form-submit-callback")}if(!I){I=a.getFunctionByName(C.amsFormSubmitCallback)||a.form._submitCallback}I.call(G,D,E,H,G);if(G.is(":visible")&&F){F.button("reset")}G.data("submitted",false);G.removeData("ams-submit-button");G.removeAttr("data-ams-form-changed")},iframe:p})}var A=b.extend({},s,m,t,f);b(k).ajaxSubmit(A);if(w){var z=b(k).parents(".modal-dialog");if(z.exists()){a.dialog.close(k)}else{a.form.finalizeSubmitFooter.call(k);if(j){j.button("reset")}k.data("submitted",false);k.removeData("ams-submit-button");k.removeAttr("data-ams-form-changed")}}}var h=b('INPUT[type="file"]',e).length>0;if(h){a.ajax.check(b.progressBar,a.baseURL+"ext/jquery-progressbar"+(a.devmode?".js":".min.js"));var g=b.extend({},{uuid:b.progressBar.submit(e)});i(e,g)}else{i(e,{})}});return false},initSubmit:function(e,d){var c=b(this);var f='<i class="fa fa-3x fa-gear fa-spin"></i>';if(!d){d=c.data("ams-form-submit-message")}if(d){f+="<strong>"+d+"</strong>"}b(e).html('<div class="row margin-20"><div class="text-center">'+f+"</div></div>");b(e).parents(".hidden").removeClass("hidden")},finalizeSubmitOnError:function(c){b("i",c).removeClass("fa-spin").removeClass("fa-gear").addClass("fa-ambulance")},initSubmitFooter:function(d){var c=b(this);var f='<i class="fa fa-3x fa-gear fa-spin"></i>';if(!d){d=b(this).data("ams-form-submit-message")}if(d){f+='<strong class="submit-message align-top padding-left-10 margin-top-10">'+d+"</strong>"}var e=b("footer",c);b("button",e).hide();e.append('<div class="row"><div class="text-center">'+f+"</div></div>")},finalizeSubmitFooter:function(){var c=b(this);var d=b("footer",c);if(d){b(".row",d).remove();b("button",d).show()}},_submitCallback:function(m,e,d,c){if(c.is(":visible")){a.form.finalizeSubmitFooter.call(c);var g=c.data("ams-submit-button");if(g){g.button("reset")}}var f=c.data();if(f.amsFormDatatype){var j=f.amsFormDatatype}else{var h=a.ajax.getResponse(d);j=h.content_type;m=h.data}if(g){var i=b(g.amsFormSubmitTarget||f.amsFormSubmitTarget||"#content")}else{i=b(f.amsFormSubmitTarget||"#content")}switch(j){case"json":a.ajax.handleJSON(m,c,i);break;case"script":break;case"xml":break;case"html":case"text":default:if(g&&(g.data("ams-keep-modal")!==true)){a.dialog.close(c)}if(!i.exists()){i=b("body")}i.parents(".hidden").removeClass("hidden");b(".alert",i.parents(".alerts-container")).remove();i.css({opacity:"0.0"}).html(m).delay(50).animate({opacity:"1.0"},300);a.initContent(i)}var k=d.getResponseHeader("X-AMS-Callback");if(k){var l=d.getResponseHeader("X-AMS-Callback-Options");a.executeFunctionByName(k,c,l===undefined?{}:JSON.parse(l),d)}},_getSubmitValidators:function(d){var c=new Array();var e=d.data("ams-form-validator");if(e){c.push([d,e])}b("[data-ams-form-validator]",d).each(function(){var f=b(this);c.push([f,f.data("ams-form-validator")])});return c},_checkSubmitValidators:function(e){var g=a.form._getSubmitValidators(e);if(!g.length){return true}var f=new Array();var l=true;for(var i in g){if(!b.isNumeric(i)){continue}var d=g[i];var c=d[0];var j=d[1];var k=a.executeFunctionByName(j,e,c);if(k===false){l=false}else{if(typeof(k)=="string"){f.push(k)}else{if(l.length&&(l.length>0)){f=f.concat(l)}}}}if(f.length>0){var h=f.length==1?a.i18n.ERROR_OCCURED:a.i18n.ERRORS_OCCURED;a.skin.alert(e,"danger",h,f);return false}else{return l}},showErrors:function(c,j){if(typeof(j)=="string"){a.skin.alert(c,"error",a.i18n.ERROR_OCCURED,j)}else{if(j instanceof Array){var f=j.length==1?a.i18n.ERROR_OCCURED:a.i18n.ERRORS_OCCURED;a.skin.alert(c,"error",f,j)}else{b(".state-error",c).removeClass("state-error");f=j.widgets&&(j.widgets.length>1)?a.i18n.ERRORS_OCCURED:a.i18n.ERROR_OCCURED;var k=new Array();var i;for(i in j.messages){if(!b.isNumeric(i)){continue}k.push(j.messages[i].message||j.messages[i])}for(i in j.widgets){if(!b.isNumeric(i)){continue}var d=j.widgets[i];var g=b('[name="'+d.name+'"]',c);g.parents("label:first").removeClassPrefix("state-").addClass("state-error").after('<span for="name" class="state-error">'+d.message+"</span>");if(d.label){k.push(d.label+" : "+d.message)}var h=g.parents(".tab-pane").index()+1;if(h>0){var e=b(".nav-tabs",b(g).parents(".tabforms"));b("li:nth-child("+h+")",e).removeClassPrefix("state-").addClass("state-error");b("li.state-error:first a",c).click()}}a.skin.alert(c,"error",f,k,j.error_message)}}}};MyAMS.dialog={_hide_callbacks:[],registerHideCallback:function(d){var c=a.dialog._hide_callbacks;if(c.indexOf(d)<0){c.push(d)}},open:function(d,c){a.ajax.check(b.fn.modalmanager,a.baseURL+"ext/bootstrap-modalmanager"+(a.devmode?".js":".min.js"),function(){a.ajax.check(b.fn.modal.defaults,a.baseURL+"ext/bootstrap-modal"+(a.devmode?".js":".min.js"),function(h){if(h){b(document).off("click.modal");b.fn.modal.defaults.spinner=b.fn.modalmanager.defaults.spinner='<div class="loading-spinner" style="width: 200px; margin-left: -100px;"><div class="progress progress-striped active"><div class="progress-bar" style="width: 100%;"></div></div></div>'}if(typeof(d)=="string"){var g={};var f=d}else{g=d.data();f=d.attr("href")||g.amsUrl;var e=a.getFunctionByName(f);if(typeof(e)=="function"){f=e.call(d)}}if(!f){return}b("body").modalmanager("loading");if(f.indexOf("#")==0){b(f).modal("show")}else{b.ajax({url:f,type:"get",cache:g.amsAllowCache===undefined?false:g.amsAllowCache,data:c,success:function(l,k,j){b("body").modalmanager("removeLoading");var m=a.ajax.getResponse(j);var r=m.content_type;var s=m.data;switch(r){case"json":a.ajax.handleJSON(s,b(b(d).data("ams-json-target")||"#content"));break;case"script":break;case"xml":break;case"html":case"text":default:var n=b(s);var p=b(".modal-dialog",n.wrap("<div></div>").parent());var o=p.data();var q={overflow:o.amsModalOverflow||".modal-viewport",maxHeight:o.amsModalMaxHeight===undefined?function(){return b(window).height()-b(".modal-header",n).outerHeight(true)-b("footer",n).outerHeight(true)-85}:a.getFunctionByName(o.amsModalMaxHeight)};var i=b.extend({},q,o.amsModalOptions);i=a.executeFunctionByName(o.amsModalInitCallback,p,i)||i;b("<div>").addClass("modal fade").append(n).modal(i).on("shown",a.dialog.shown).on("hidden",a.dialog.hidden);a.initContent(n)}}})}})})},shown:function(i){function h(k){var l=b(".scrollmarker.top",c);var j=c.scrollTop();if(j>0){l.show()}else{l.hide()}var e=b(".scrollmarker.bottom",c);if(f+j>=c.get(0).scrollHeight){e.hide()}else{e.show()}}var g=i.target;var c=b(".modal-viewport",g);if(c.length==0){return}var f=parseInt(c.css("max-height"));var d=b.scrollbarWidth();if(c.height()==f){b("<div></div>").addClass("scrollmarker").addClass("top").css("top",0).css("width",c.width()-d).hide().appendTo(c);b("<div></div>").addClass("scrollmarker").addClass("bottom").css("top",f-20).css("width",c.width()-d).appendTo(c);c.scroll(h);c.off("resize").on("resize",h)}else{b(".scrollmarker",c).remove()}},close:function(d){var e=d.parents(".modal").data("modal");if(e){var c=b("body").data("modalmanager");if(c&&(c.getOpenModals().indexOf(e)>=0)){e.hide()}}},hidden:function(g){var f=g.target;var d=a.dialog._hide_callbacks;for(var c in d){d[c].call(f)}}};MyAMS.helpers={select2ClearSelection:function(){var d=b(this);var c=d.parents("label");var e=d.data("ams-select2-target");b('[name="'+e+'"]',c).data("select2").val("")},select2FormatSelection:function(d,c){if(d instanceof Array){b(d).each(function(){if(typeof(this)=="object"){c.append(this.text)}else{c.append(this)}})}else{if(typeof(d)=="object"){c.append(d.text)}else{c.append(d)}}},select2QueryUrlResultsCallback:function(e,d,c){switch(e.status){case"error":a.skin.messageBox("error",{title:a.i18n.ERROR_OCCURED,content:"<h4>"+e.error_message+"</h4>",icon:"fa fa-warning animated shake",timeout:10000});break;case"modal":b(this).data("select2").dropdown.hide();a.dialog.open(result.location);break;default:return{results:e.results||e,more:e.has_more||false,context:e.context}}},select2QueryMethodSuccessCallback:function(g,d,f){var c=g.result;if(typeof(c)=="string"){try{c=JSON.parse(c)}catch(h){}}switch(c.status){case"error":a.skin.messageBox("error",{title:a.i18n.ERROR_OCCURED,content:"<h4>"+c.error_message+"</h4>",icon:"fa fa-warning animated shake",timeout:10000});break;case"modal":b(this).data("select2").dropdown.hide();a.dialog.open(c.location);break;default:f.callback({results:c.results||c,more:c.has_more||false,context:c.context})}},contextMenuHandler:function(f,g){var c=g.data();if(c.toggle=="modal"){a.dialog.open(g)}else{var d=g.attr("href")||c.amsUrl;if(!d||d.startsWith("javascript:")||g.attr("target")){return}a.event.stop();var e=a.getFunctionByName(d);if(typeof(e)=="function"){d=e.call(g,f)}if(typeof(d)=="function"){d.call(g,f)}else{d=d.replace(/\%23/,"#");var f=g.data("ams-target");if(f){a.form.confirmChangedForm(f,function(){a.skin.loadURL(d,f,g.data("ams-link-options"),g.data("ams-link-callback"))})}else{a.form.confirmChangedForm(function(){if(d.startsWith("#")){if(d!=location.hash){if(a.root.hasClass("mobile-view-activated")){a.root.removeClass("hidden-menu");window.setTimeout(function(){window.location.hash=d},150)}else{window.location.hash=d}}}else{window.location=d}})}}}},datetimepickerDialogHiddenCallback:function(){b(".datepicker, .timepicker, .datetimepicker",this).datetimepicker("destroy")}};MyAMS.plugins={init:function(e){a.plugins.initData(e);var f=new Array();b("[data-ams-plugins-disabled]",e).each(function(){var h=b(this).data("ams-plugins-disabled").split(/\s+/);for(var i in h){f.push(h[i])}});for(var d in a.plugins.enabled){if(f.indexOf(d)>=0){continue}var g=a.plugins.enabled[d];if(typeof(g)=="function"){g(e)}}var c;b("[data-ams-plugins]",e).each(function(){var l=b(this);var h={};if(typeof(l.data("ams-plugins"))==="string"){var m=l.data("ams-plugins").split(/\s+/);for(var j in m){c=m[j];var i={src:l.data("ams-plugin-"+c+"-src"),css:l.data("ams-plugin-"+c+"-css"),callback:l.data("ams-plugin-"+c+"-callback"),register:l.data("ams-plugin-"+c+"-register"),async:l.data("ams-plugin-"+c+"-async")};h[c]=i}}else{h=l.data("ams-plugins")}for(c in h){if(a.plugins.enabled[c]===undefined){var k=h[c];a.getScript(k.src,function(){var p=k.callback;if(p){var o=a.getFunctionByName(p);if(typeof(o)=="function"){o.apply(l)}if(k.register!==false){a.plugins.enabled[c]=o}}else{if(k.register!==false){a.plugins.enabled[c]=null}}var n=k.css;if(n){a.getCSS(n,c+"_css")}},{async:k.async===undefined?true:k.async})}}})},initData:function(c){b("[data-ams-data]",c).each(function(){var e=b(this);var f=e.data("ams-data");for(var d in f){e.attr("data-"+d,f[d])}})},register:function(d,c,f){if(typeof(c)=="function"){f=c;c=null}c=c||d.name;if(a.plugins.enabled.indexOf(c)>=0){if(window.console){console.warn("Plugin "+c+" is already registered!")}return}if(typeof(d)=="object"){var e=d.src;if(e){a.ajax.check(d.callback,e,function(g){if(g){a.plugins.enabled[c]=a.getFunctionByName(d.callback);if(d.css){a.getCSS(d.css,c+"_css")}if(f){a.executeFunctionByName(f)}}})}else{a.plugins.enabled[c]=a.getFunctionByName(d.callback);if(d.css){a.getCSS(d.css,c+"_css")}if(f){a.executeFunctionByName(f)}}}else{if(typeof(d)=="function"){a.plugins.enabled[c]=d;if(f){a.executeFunctionByName(f)}}}},enabled:{hint:function(c){var d=b(".hint:not(:parents(.nohints))",c);if(d.length>0){a.ajax.check(b.fn.tipsy,a.baseURL+"ext/jquery-tipsy"+(a.devmode?".js":".min.js"),function(){a.getCSS(a.baseURL+"../css/ext/jquery-tipsy"+(a.devmode?".css":".min.css"),"jquery-tipsy");d.each(function(){var i=b(this);var h=i.data();var f={html:h.amsHintHtml,title:a.getFunctionByName(h.amsHintTitleGetter)||function(){var j=b(this);return j.attr("original-title")||j.attr(h.amsHintTitleAttr||"title")||(h.amsHintHtml?j.html():j.text())},opacity:h.amsHintOpacity,gravity:h.amsHintGravity||"sw",offset:h.amsHintOffset||0};var e=b.extend({},f,h.amsHintOptions);e=a.executeFunctionByName(h.amsHintInitCallback,i,e)||e;var g=i.tipsy(e);a.executeFunctionByName(h.amsHintAfterInitCallback,i,g,e)})})}},switcher:function(c){b("LEGEND.switcher",c).each(function(){var e=b(this);var d=e.parent("fieldset");var f=e.data();if(!f.amsSwitcher){b('<i class="fa fa-fw"></i>').prependTo(b(this)).addClass(f.amsSwitcherState=="open"?(f.amsSwitcherMinusClass||"fa-minus"):(f.amsSwitcherPlusClass||"fa-plus"));e.on("click",function(h){h.preventDefault();var g={};e.trigger("ams.switcher.before-switch",[e,g]);if(g.veto){return}if(d.hasClass("switched")){d.removeClass("switched");b(".fa",e).removeClass(f.amsSwitcherPlusClass||"fa-plus").addClass(f.amsSwitcherMinusClass||"fa-minus");e.trigger("ams.switcher.opened",[e]);var i=e.attr("id");if(i){b('legend.switcher[data-ams-switcher-sync="'+i+'"]',d).each(function(){var j=b(this);if(j.parents("fieldset").hasClass("switched")){j.click()}})}}else{d.addClass("switched");b(".fa",e).removeClass(f.amsSwitcherMinusClass||"fa-minus").addClass(f.amsSwitcherPlusClass||"fa-plus");e.trigger("ams.switcher.closed",[e])}});if(f.amsSwitcherState!="open"){d.addClass("switched")}e.data("ams-switcher","on")}})},checker:function(c){b("LEGEND.checker",c).each(function(){var o=b(this);var p=o.parent("fieldset");var f=o.data();if(!f.amsChecker){var d=b('<label class="checkbox"></label>');var i=f.amsCheckerFieldname||("checker_"+a.generateId());var m=i.replace(/\./,"_");var g=f.amsCheckerHiddenPrefix;var h=null;var l=f.amsCheckerHiddenValueOn||"true";var j=f.amsCheckerHiddenValueOff||"false";var e=f.amsCheckerMarker||false;if(g){h=b('<input type="hidden">').attr("name",g+i).val(f.amsCheckerState=="on"?l:j).prependTo(o)}else{if(e){b('<input type="hidden">').attr("name",e).attr("value",1).prependTo(o)}}var n=b('<input type="checkbox">').attr("name",i).attr("id",m).data("ams-checker-hidden-input",h).data("ams-checker-init",true).val(f.amsCheckerValue||true).attr("checked",f.amsCheckerState=="on"?"checked":null);if(f.amsCheckerReadonly){n.attr("disabled","disabled")}else{n.on("change",function(s){s.preventDefault();var q={};o.trigger("ams.checker.before-switch",[o,q]);if(q.veto){return}var t=b(this).is(":checked");a.executeFunctionByName(f.amsCheckerChangeHandler,o,t);if(!f.amsCheckerCancelDefault){var r=n.data("ams-checker-hidden-input");if(t){if(f.amsCheckerMode=="disable"){p.removeAttr("disabled")}else{p.removeClass("switched")}if(r){r.val(l)}b("[data-required]",p).attr("required","required");o.trigger("ams.checker.opened",[o])}else{if(f.amsCheckerMode=="disable"){p.attr("disabled","disabled")}else{p.addClass("switched")}if(r){r.val(j)}b("[data-required]",p).removeAttr("required");o.trigger("ams.checker.closed",[o])}}})}n.appendTo(d);b(">label",o).attr("for",n.attr("id"));d.append("<i></i>").prependTo(o);var k=b("[required]",p);k.attr("data-required",true);if(f.amsCheckerState=="on"){n.attr("checked",true)}else{if(f.amsCheckerMode=="disable"){p.attr("disabled","disabled")}else{p.addClass("switched")}k.removeAttr("required")}o.data("ams-checker","on")}})},slider:function(c){var d=b(".slider",c);if(d.length>0){a.ajax.check(b.fn.slider,a.baseURL+"ext/bootstrap-slider.min.js",function(){d.each(function(){var h=b(this);var i=h.data();var f={};var e=b.extend({},f,h.data.amsSliderOptions);e=a.executeFunctionByName(i.amsSliderInitCallback,h,e)||e;var g=h.slider(e);a.executeFunctionByName(i.amsSliderAfterInitCallback,h,g,e)})})}},draggable:function(d){var c=b(".draggable",d);if(c.length>0){c.each(function(){var e=b(this);var i=e.data();var g={containment:i.amsDraggableContainment,helper:a.getFunctionByName(i.amsDraggableHelper)||i.amsDraggableHelper,start:a.getFunctionByName(i.amsDraggableStart),stop:a.getFunctionByName(i.amsDraggableStop)};var f=b.extend({},g,i.amsDraggableOptions);f=a.executeFunctionByName(i.amsDraggableInitCallback,e,f)||f;var h=e.draggable(f);e.disableSelection();a.executeFunctionByName(i.amsDraggableAfterInitCallback,e,h,f)})}},sortable:function(c){var d=b(".sortable",c);if(d.length>0){d.each(function(){var i=b(this);var h=i.data();var f={items:h.amsSortableItems,handle:h.amsSortableHandle,connectWith:h.amsSortableConnectwith,start:a.getFunctionByName(h.amsSortableStart),over:a.getFunctionByName(h.amsSortableOver),containment:h.amsSortableContainment,placeholder:h.amsSortablePlaceholder,stop:a.getFunctionByName(h.amsSortableStop)};var e=b.extend({},f,h.amsSortableOptions);e=a.executeFunctionByName(h.amsSortableInitCallback,i,e)||e;var g=i.sortable(e);i.disableSelection();a.executeFunctionByName(h.amsSortableAfterInitCallback,i,g,e)})}},resizable:function(d){var c=b(".resizable",d);if(c.length>0){c.each(function(){var e=b(this);var i=e.data();var g={autoHide:i.amsResizableAutohide===false?true:i.amsResizableAutohide,containment:i.amsResizableContainment,grid:i.amsResizableGrid,handles:i.amsResizableHandles,start:a.getFunctionByName(i.amsResizableStart),stop:a.getFunctionByName(i.amsResizableStop)};var f=b.extend({},g,i.amsResizableOptions);f=a.executeFunctionByName(i.amsResizableInitCallback,e,f)||f;var h=e.resizable(f);e.disableSelection();a.executeFunctionByName(i.amsResizableAfterInitCallback,e,h,f)})}},contextMenu:function(c){var d=b(".context-menu",c);if(d.length>0){d.each(function(){var i=b(this);var h=i.data();var f={menuSelector:h.amsContextmenuSelector,menuSelected:a.helpers.contextMenuHandler};var e=b.extend({},f,h.amsContextmenuOptions);e=a.executeFunctionByName(h.amsContextmenuInitCallback,i,e)||e;var g=i.contextMenu(e);a.executeFunctionByName(h.amsContextmenuAfterInitCallback,i,g,e)})}},select2:function(d){var c=b(".select2",d);if(c.length>0){a.ajax.check(b.fn.select2,a.baseURL+"ext/jquery-select2-3.5.2"+(a.devmode?".js":".min.js"),function(){c.each(function(){var e=b(this);var j=e.data();var h={placeholder:j.amsSelect2Placeholder,multiple:j.amsSelect2Multiple,minimumInputLength:j.amsSelect2MinimumInputLength||0,maximumSelectionSize:j.amsSelect2MaximumSelectionSize,openOnEnter:j.amsSelect2EnterOpen===undefined?true:j.amsSelect2EnterOpen,allowClear:j.amsSelect2AllowClear===undefined?true:j.amsSelect2AllowClear,width:j.amsSelect2Width||"100%",initSelection:a.getFunctionByName(j.amsSelect2InitSelection),formatSelection:j.amsSelect2FormatSelection===undefined?a.helpers.select2FormatSelection:a.getFunctionByName(j.amsSelect2FormatSelection),formatResult:a.getFunctionByName(j.amsSelect2FormatResult),formatMatches:j.amsSelect2FormatMatches===undefined?function(k){if(k==1){return a.i18n.SELECT2_MATCH}else{return k+a.i18n.SELECT2_MATCHES}}:a.getFunctionByName(j.amsSelect2FormatMatches),formatNoMatches:j.amsSelect2FormatResult===undefined?function(k){return a.i18n.SELECT2_NOMATCHES}:a.getFunctionByName(j.amsSelect2FormatResult),formatInputTooShort:j.amsSelect2FormatInputTooShort===undefined?function(k,l){var m=l-k.length;return a.i18n.SELECT2_INPUT_TOOSHORT.replace(/\{0\}/,m).replace(/\{1\}/,m==1?"":a.i18n.SELECT2_PLURAL)}:a.getFunctionByName(j.amsSelect2FormatInputTooShort),formatInputTooLong:j.amsSelect2FormatInputTooLong===undefined?function(l,k){var m=l.length-k;return a.i18n.SELECT2_INPUT_TOOLONG.replace(/\{0\}/,m).replace(/\{1\}/,m==1?"":a.i18n.SELECT2_PLURAL)}:a.getFunctionByName(j.amsSelect2FormatInputTooLong),formatSelectionTooBig:j.amsSelect2FormatSelectionTooBig===undefined?function(k){return a.i18n.SELECT2_SELECTION_TOOBIG.replace(/\{0\}/,k).replace(/\{1\}/,k==1?"":a.i18n.SELECT2_PLURAL)}:a.getFunctionByName(j.amsSelect2FormatSelectionTooBig),formatLoadMore:j.amsSelect2FormatLoadMore===undefined?function(k){return a.i18n.SELECT2_LOADMORE}:a.getFunctionByName(j.amsSelect2FormatLoadMore),formatSearching:j.amsSelect2FormatSearching===undefined?function(){return a.i18n.SELECT2_SEARCHING}:a.getFunctionByName(j.amsSelect2FormatSearching),separator:j.amsSelect2Separator||",",tokenSeparators:j.amsSelect2TokensSeparators||[","],tokenizer:a.getFunctionByName(j.amsSelect2Tokenizer)};switch(e.context.type){case"text":case"hidden":if(!h.initSelection){var f=e.data("ams-select2-values");if(f){h.initSelection=function(k,m){var l=[];b(k.val().split(h.separator)).each(function(){l.push({id:this,text:f[this]||this})});m(l)}}}break;default:break}if(e.attr("readonly")){h.query=function(){return[]}}else{if(j.amsSelect2Query){h.query=a.getFunctionByName(j.amsSelect2Query);h.minimumInputLength=j.amsSelect2MinimumInputLength||1}else{if(j.amsSelect2QueryUrl){h.ajax={url:j.amsSelect2QueryUrl,quietMillis:j.amsSelect2QuietMillis||200,type:j.amsSelect2QueryType||"POST",dataType:j.amsSelect2QueryDatatype||"json",data:function(m,n,l){var k={};k[j.amsSelect2QueryParamName||"query"]=m;k[j.amsSelect2PageParamName||"page"]=n;k[j.amsSelect2ContextParamName||"context"]=l;return b.extend({},k,j.amsSelect2QueryOptions)},results:a.helpers.select2QueryUrlResultsCallback};h.minimumInputLength=j.amsSelect2MinimumInputLength||1}else{if(j.amsSelect2QueryMethod){h.query=function(k){var l={id:new Date().getTime(),params:j.amsSelect2QueryParams||{},success:function(m){return a.helpers.select2QueryMethodSuccessCallback.call(e,m,"success",k)},error:a.error.show};l.params[j.amsSelect2QueryParamName||"query"]=k.term;l.params[j.amsSelect2PageParamName||"page"]=k.page;l.params[j.amsSelect2ContextParamName||"context"]=k.context;l=b.extend({},l,j.amsSelect2QueryOptions);l=a.executeFunctionByName(j.amsSelect2QueryInitCallback,e,l)||l;a.ajax.check(b.jsonRPC,a.baseURL+"ext/jquery-jsonrpc"+(a.devmode?".js":".min.js"),function(){b.jsonRPC.withOptions({endPoint:j.amsSelect2MethodTarget||a.jsonrpc.getAddr(),namespace:j.amsSelect2MethodNamespace,cache:false},function(){b.jsonRPC.request(j.amsSelect2QueryMethod,l)})})};h.minimumInputLength=j.amsSelect2MinimumInputLength||1}else{if(j.amsSelect2Tags){h.tags=j.amsSelect2Tags}else{if(j.amsSelect2Data){h.data=j.amsSelect2Data}}}}}}if(j.amsSelect2EnableFreeTags){h.createSearchChoice=function(k){return{id:k,text:(j.amsSelect2FreeTagsPrefix||a.i18n.SELECT2_FREETAG_PREFIX)+k}}}var g=b.extend({},h,j.amsSelect2Options);g=a.executeFunctionByName(j.amsSelect2InitCallback,e,g)||g;var i=e.select2(g);a.executeFunctionByName(j.amsSelect2AfterInitCallback,e,i,g);if(e.hasClass("ordered")){e.addClass("nofloat");a.ajax.check(b.fn.select2Sortable,a.baseURL+"ext/jquery-select2-sortable"+(a.devmode?".js":".min.js"),function(){e.select2Sortable({bindOrder:"sortableStop"})})}e.on("change",function(){var k=b(e.get(0).form).data("validator");if(k!==undefined){b(e).valid()}})})})}},maskedit:function(d){var c=b("[data-mask]",d);if(c.length>0){a.ajax.check(b.fn.mask,a.baseURL+"ext/jquery-maskedinput-1.3.1.min.js",function(){c.each(function(){var e=b(this);var i=e.data();var g={placeholder:i.amsMaskeditPlaceholder||"X"};var f=b.extend({},g,i.amsMaskeditOptions);f=a.executeFunctionByName(i.amsMaskeditInitCallback,e,f)||f;var h=e.mask(e.attr("data-mask"),f);a.executeFunctionByName(i.amsMaskeditAfterInitCallback,e,h,f)})})}},datepicker:function(c){var d=b(".datepicker",c);if(d.length>0){a.ajax.check(b.fn.datetimepicker,a.baseURL+"ext/jquery-datetimepicker"+(a.devmode?".js":".min.js"),function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-datetimepicker"+(a.devmode?".css":".min.css"),"jquery-datetimepicker");a.dialog.registerHideCallback(a.helpers.datetimepickerDialogHiddenCallback)}d.each(function(){var f=b(this);var j=f.data();var h={lang:j.amsDatetimepickerLang||a.lang,format:j.amsDatetimepickerFormat||"d/m/y",datepicker:true,dayOfWeekStart:1,timepicker:false};var g=b.extend({},h,j.amsDatetimepickerOptions);g=a.executeFunctionByName(j.amsDatetimepickerInitCallback,f,g)||g;var i=f.datetimepicker(g);a.executeFunctionByName(j.amsDatetimepickerAfterInitCallback,f,i,g)})})}},datetimepicker:function(d){var c=b(".datetimepicker",d);if(c.length>0){a.ajax.check(b.fn.datetimepicker,a.baseURL+"ext/jquery-datetimepicker"+(a.devmode?".js":".min.js"),function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-datetimepicker"+(a.devmode?".css":".min.css"),"jquery-datetimepicker");a.dialog.registerHideCallback(a.helpers.datetimepickerDialogHiddenCallback)}c.each(function(){var f=b(this);var j=f.data();var h={lang:j.amsDatetimepickerLang||a.lang,format:j.amsDatetimepickerFormat||"d/m/y H:i",datepicker:true,dayOfWeekStart:1,timepicker:true};var g=b.extend({},h,j.amsDatetimepickerOptions);g=a.executeFunctionByName(j.amsDatetimepickerInitCallback,f,g)||g;var i=f.datetimepicker(g);a.executeFunctionByName(j.amsDatetimepickerAfterInitCallback,f,i,g)})})}},timepicker:function(d){var c=b(".timepicker",d);if(c.length>0){a.ajax.check(b.fn.datetimepicker,a.baseURL+"ext/jquery-datetimepicker"+(a.devmode?".js":".min.js"),function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-datetimepicker"+(a.devmode?".css":".min.css"),"jquery-datetimepicker");a.dialog.registerHideCallback(a.helpers.datetimepickerDialogHiddenCallback)}c.each(function(){var f=b(this);var j=f.data();var h={lang:j.amsDatetimepickerLang||a.lang,format:j.amsDatetimepickerFormat||"H:i",datepicker:false,timepicker:true};var g=b.extend({},h,j.amsDatetimepickerOptions);g=a.executeFunctionByName(j.amsDatetimepickerInitCallback,f,g)||g;var i=f.datetimepicker(g);a.executeFunctionByName(j.amsDatetimepickerAfterInitCallback,f,i,g)})})}},colorpicker:function(c){var d=b(".colorpicker",c);if(d.length>0){a.ajax.check(b.fn.minicolors,a.baseURL+"ext/jquery-minicolors"+(a.devmode?".js":".min.js"),function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-minicolors"+(a.devmode?".css":".min.css"),"jquery-minicolors")}d.each(function(){var f=b(this);var j=f.data();var h={position:j.amsColorpickerPosition||f.closest("label.input").data("ams-colorpicker-position")||"bottom left"};var g=b.extend({},h,j.amsColorpickerOptions);g=a.executeFunctionByName(j.amsColorpickerInitCallback,f,g)||g;var i=f.minicolors(g);a.executeFunctionByName(j.amsDatetimepickerAfterInitCallback,f,i,g)})})}},typeahead:function(d){var c=b(".typeahead",d);if(c.length>0){a.ajax.check(b.fn.typeahead,a.baseURL+"ext/jquery-typeahead"+(a.devmode?".js":".min.js"),function(){c.each(function(){var e=b(this);var i=e.data();var g={};var f=b.extend({},g,i.amsTypeaheadOptions);f=a.executeFunctionByName(i.amsTypeaheadInitCallback,e,f)||f;var h=e.typeahead(f);a.executeFunctionByName(i.amsTypeaheadAfterInitCallback,e,h,f)})})}},validate:function(d){var c=b("FORM:not([novalidate])",d);if(c.length>0){a.ajax.check(b.fn.validate,a.baseURL+"ext/jquery-validate-1.11.1"+(a.devmode?".js":".min.js"),function(g){if(g){b.validator.setDefaults({highlight:function(h){b(h).closest(".form-group, label:not(:parents(.form-group))").addClass("state-error")},unhighlight:function(h){b(h).closest(".form-group, label:not(:parents(.form-group))").removeClass("state-error")},errorElement:"span",errorClass:"state-error",errorPlacement:function(i,j){var h=j.parents("label:first");if(h.length){i.insertAfter(h)}else{i.insertAfter(j)}}});if(a.plugins.i18n){for(var e in a.plugins.i18n.validate){var f=a.plugins.i18n.validate[e];if((typeof(f)=="string")&&(f.indexOf("{0}")>-1)){a.plugins.i18n.validate[e]=b.validator.format(f)}}b.extend(b.validator.messages,a.plugins.i18n.validate)}}c.each(function(){var k=b(this);var l=k.data();var i={ignore:null,submitHandler:k.attr("data-async")!==undefined?l.amsFormSubmitHandler===undefined?function(){b(".state-error",k).removeClass("state-error");a.ajax.check(b.fn.ajaxSubmit,a.baseURL+"ext/jquery-form-3.49"+(a.devmode?".js":".min.js"));return a.form.submit(k)}:a.getFunctionByName(l.amsFormSubmitHandler):undefined,invalidHandler:k.attr("data-async")!==undefined?l.amsFormInvalidHandler===undefined?function(q,p){b(".state-error",k).removeClass("state-error");for(var n in p.errorList){var m=p.errorList[n];var o=b(m.element).parents(".tab-pane").index()+1;if(o>0){var r=b(".nav-tabs",b(m.element).parents(".tabforms"));b("li:nth-child("+o+")",r).removeClassPrefix("state-").addClass("state-error");b("li.state-error:first a",r).click()}}}:a.getFunctionByName(l.amsFormInvalidHandler):undefined};var h=b.extend({},i,l.amsValidateOptions);h=a.executeFunctionByName(l.amsValidateInitCallback,k,h)||h;var j=k.validate(h);a.executeFunctionByName(l.amsValidateAfterInitCallback,k,j,h)})})}},datatable:function(d){var c=b(".datatable",d);if(c.length>0){a.ajax.check(b.fn.dataTable,a.baseURL+"ext/jquery-dataTables-1.9.4"+(a.devmode?".js":".min.js"),function(e){if(e){b.fn.dataTableExt.oSort["numeric-comma-asc"]=function(h,g){var f=h.replace(/,/,".").replace(/ /g,"");var i=g.replace(/,/,".").replace(/ /g,"");f=parseFloat(f);i=parseFloat(i);return((f<i)?-1:((f>i)?1:0))};b.fn.dataTableExt.oSort["numeric-comma-desc"]=function(h,g){var f=h.replace(/,/,".").replace(/ /g,"");var i=g.replace(/,/,".").replace(/ /g,"");f=parseFloat(f);i=parseFloat(i);return((f<i)?1:((f>i)?-1:0))}}b(c).each(function(){a.ajax.check(b.fn.dataTableExt.oPagination.bootstrap_full,a.baseURL+"myams-dataTables"+(a.devmode?".js":".min.js"));var u=b(this);var x=u.data();var w=(x.amsDatatableExtensions||"").split(/\s+/);var h=x.amsDatatableSdom||"W"+((w.indexOf("colreorder")>=0||w.indexOf("colreorderwithresize")>=0)?"R":"")+"<'dt-top-row'"+(w.indexOf("colvis")>=0?"C":"")+((x.amsDatatablePagination===false||x.amsDatatablePaginationSize===false)?"":"L")+(x.amsDatatableGlobalFilter===false?"":"F")+">r<'dt-wrapper't"+(w.indexOf("scroller")>=0?"S":"")+"><'dt-row dt-bottom-row'<'row'<'col-sm-6'"+(x.amsDatatableInformation===false?"":"i")+"><'col-sm-6 text-right'p>>";var r={bJQueryUI:false,bFilter:x.amsDatatableGlobalFilter!==false,bPaginate:x.amsDatatablePagination!==false,bInfo:x.amsDatatableInfo!==false,bSort:x.amsDatatableSort!==false,bDeferRender:true,bAutoWidth:false,iDisplayLength:x.amsDatatableDisplayLength||25,sPaginationType:x.amsDatatablePaginationType||"bootstrap_full",sDom:h,oLanguage:a.plugins.i18n.datatables,fnInitComplete:function(A,z){b(".ColVis_Button").addClass("btn btn-default btn-sm").html((a.plugins.i18n.datatables.sColumns||"Columns")+' <i class="fa fa-fw fa-caret-down"></i>')}};var v=b.extend({},r,x.amsDatatableOptions);var j;if(w.length>0){for(j in w){switch(w[j]){case"autofill":a.ajax.check(b.fn.dataTable.AutoFill,a.baseURL+"ext/jquery-dataTables-autoFill"+(a.devmode?".js":".min.js"));break;case"columnfilter":a.ajax.check(b.fn.columnFilter,a.baseURL+"ext/jquery-dataTables-columnFilter"+(a.devmode?".js":".min.js"));break;case"colreorder":a.ajax.check(b.fn.dataTable.ColReorder,a.baseURL+"ext/jquery-dataTables-colReorder"+(a.devmode?".js":".min.js"));break;case"colreorderwithresize":a.ajax.check(b.fn.dataTable.ColReorder,a.baseURL+"ext/jquery-dataTables-colReorderWithResize"+(a.devmode?".js":".min.js"));break;case"colvis":a.ajax.check(b.fn.dataTable.ColVis,a.baseURL+"ext/jquery-dataTables-colVis"+(a.devmode?".js":".min.js"));var n={activate:"click",sAlign:"right"};v.oColVis=b.extend({},n,x.amsDatatableColvisOptions);break;case"editable":a.ajax.check(b.fn.editable,a.baseURL+"ext/jquery-jeditable"+(a.devmode?".js":".min.js"));a.ajax.check(b.fn.makeEditable,a.baseURL+"ext/jquery-dataTables-editable"+(a.devmode?".js":".min.js"));break;case"fixedcolumns":a.ajax.check(b.fn.dataTable.FixedColumns,a.baseURL+"ext/jquery-dataTables-fixedColumns"+(a.devmode?".js":".min.js"));break;case"fixedheader":a.ajax.check(b.fn.dataTable.FixedHeader,a.baseURL+"ext/jquery-dataTables-fixedHeader"+(a.devmode?".js":".min.js"));break;case"keytable":a.ajax.check(window.KeyTable,a.baseURL+"ext/jquery-dataTables-keyTable"+(a.devmode?".js":".min.js"));break;case"rowgrouping":a.ajax.check(b.fn.rowGrouping,a.baseURL+"ext/jquery-dataTables-rowGrouping"+(a.devmode?".js":".min.js"));break;case"rowreordering":a.ajax.check(b.fn.rowReordering,a.baseURL+"ext/jquery-dataTables-rowReordering"+(a.devmode?".js":".min.js"));break;case"scroller":a.ajax.check(b.fn.dataTable.Scroller,a.baseURL+"ext/jquery-dataTables-scroller"+(a.devmode?".js":".min.js"));break;default:break}}}v=a.executeFunctionByName(x.amsDatatableInitCallback,u,v)||v;var g=u.dataTable(v);a.executeFunctionByName(x.amsDatatableAfterInitCallback,u,g,v);if(w.length>0){for(j in w){switch(w[j]){case"autofill":var y=b.extend({},x.amsDatatableAutofillOptions,v.autofill);y=a.executeFunctionByName(x.amsDatatableAutofillInitCallback,u,y)||y;u.data("ams-autofill",x.amsDatatableAutofillConstructor===undefined?new b.fn.dataTable.AutoFill(u,y):a.executeFunctionByName(x.amsDatatableAutofillConstructor,u,g,y));break;case"columnfilter":var k={sPlaceHolder:"head:after"};var l=b.extend({},k,x.amsDatatableColumnfilterOptions,v.columnfilter);l=a.executeFunctionByName(x.amsDatatableColumnfilterInitCallback,u,l)||l;u.data("ams-columnfilter",x.amsDatatableColumnfilterConstructor===undefined?g.columnFilter(l):a.executeFunctionByName(x.amsDatatableColumnfilterConstructor,u,g,l));break;case"editable":var m=b.extend({},x.amsDatatableEditableOptions,v.editable);m=a.executeFunctionByName(x.amsDatatableEditableInitCallback,u,m)||m;u.data("ams-editable",x.amsDatatableEditableConstructor===undefined?u.makeEditable(m):a.executeFunctionByName(x.amsDatatableEditableConstructor,u,g,m));break;case"fixedcolumns":var f=b.extend({},x.amsDatatableFixedcolumnsOptions,v.fixedcolumns);f=a.executeFunctionByName(x.amsDatatableFixedcolumnsInitCallback,u,f)||f;u.data("ams-fixedcolumns",x.amsDatatableFixedcolumnsConstructor===undefined?new b.fn.dataTable.FixedColumns(u,f):a.executeFunctionByName(x.amsDatatableFixedcolumnsConstructor,u,g,f));break;case"fixedheader":var s=b.extend({},x.amsDatatableFixedheaderOptions,v.fixedheader);s=a.executeFunctionByName(x.amsDatatableFixedheadeInitCallback,u,s)||s;u.data("ams-fixedheader",x.amsDatatableFixedheaderConstructor===undefined?new b.fn.dataTable.FixedHeader(u,s):a.executeFunctionByName(x.amsDatatableFixedheaderConstructor,u,g,s));break;case"keytable":var i={table:u.get(0),datatable:g};var q=b.extend({},i,x.amsDatatableKeytableOptions,v.keytable);q=a.executeFunctionByName(x.amsDatatableKeytableInitCallback,u,q)||q;u.data("ams-keytable",x.amsDatatableKeytableConstructor===undefined?new KeyTable(q):a.executeFunctionByName(x.amsDatatableKeytableConstructor,u,g,q));break;case"rowgrouping":var p=b.extend({},x.amsDatatableRowgroupingOptions,v.rowgrouping);p=a.executeFunctionByName(x.amsDatatableRowgroupingInitCallback,u,p)||p;u.data("ams-rowgrouping",x.amsDatatableRowgroupingConstructor===undefined?u.rowGrouping(p):a.executeFunctionByName(x.amsDatatableRowgroupingConstructor,u,g,p));break;case"rowreordering":var o=b.extend({},x.amsDatatableRowreorderingOptions,v.rowreordering);o=a.executeFunctionByName(x.amsDatatableRowreorderingInitCallback,u,o)||o;u.data("ams-rowreordering",x.amsDatatableRowreorderingConstructor===undefined?u.rowReordering(o):a.executeFunctionByName(x.amsDatatableRowreorderingConstructor,u,g,o));break;default:break}}}var t=(x.amsDatatableFinalizeCallback||"").split(/\s+/);if(t.length>0){for(j in t){a.executeFunctionByName(t[j],u,g,v)}}})})}},tablednd:function(d){var c=b(".table-dnd",d);if(c.length>0){a.ajax.check(b.fn.tableDnD,a.baseURL+"ext/jquery-tablednd"+(a.devmode?".js":".min.js"),function(e){c.each(function(){var i=b(this);b(i).on("mouseover","tr",function(){b(this.cells[0]).addClass("drag-handle")}).on("mouseout","tr",function(){b(this.cells[0]).removeClass("drag-handle")});var j=i.data();var g={onDragClass:j.amsTabledndDragClass||"dragging-row",onDragStart:j.amsTabledndDragStart,dragHandle:j.amsTabledndDragHandle,scrollAmount:j.amsTabledndScrollAmount,onAllowDrop:j.amsTabledndAllowDrop,onDrop:j.amsTabledndDrop||function(m,o){var l=j.amsTabledndDropTarget;if(l){var k=[];b(m.rows).each(function(){var p=b(this).data("ams-element-name");if(p){k.push(p)}});var n=a.getFunctionByName(l);if(typeof(n)=="function"){n.call(i,m,k)}else{a.ajax.post(l,{names:k})}}}};var f=b.extend({},g,j.amsTabledndOptions);f=a.executeFunctionByName(j.amsTabledndInitCallback,i,f)||f;var h=i.tableDnD(f);a.executeFunctionByName(j.amsTabledndAfterInitCallback,i,h,f)})})}},fancybox:function(c){var d=b(".fancybox",c);if(d.length>0){a.ajax.check(b.fn.fancybox,a.baseURL+"ext/jquery-fancybox-2.1.5"+(a.devmode?".js":".min.js"),function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-fancybox-2.1.5"+(a.devmode?".css":".min.css"))}d.each(function(){var f=b(this);var m=f.data();var l=(m.amsFancyboxHelpers||"").split(/\s+/);if(l.length>0){for(var g in l){var k=l[g];switch(k){case"buttons":a.ajax.check(b.fancybox.helpers.buttons,a.baseURL+"ext/fancybox-helpers/fancybox-buttons.js"+(a.devmode?".js":".min.js"));break;case"thumbs":a.ajax.check(b.fancybox.helpers.thumbs,a.baseURL+"ext/fancybox-helpers/fancybox-thumbs.js"+(a.devmode?".js":".min.js"));break;case"media":a.ajax.check(b.fancybox.helpers.media,a.baseURL+"ext/fancybox-helpers/fancybox-media.js"+(a.devmode?".js":".min.js"));break;default:break}}}var i={type:m.amsFancyboxType,padding:m.amsFancyboxPadding||10,margin:m.amsFancyboxMargin||10,beforeLoad:a.getFunctionByName(m.amsFancyboxBeforeLoad)||function(){this.title=a.executeFunctionByName(m.amsFancyboxTitleGetter,this)||b(this.element).attr("original-title")||b(this.element).attr("title")},helpers:{title:{type:"inside"}}};var h=b.extend({},i,m.amsFancyboxOptions);h=a.executeFunctionByName(m.amsFancyboxInitCallback,f,h)||h;var j=f.fancybox(h);a.executeFunctionByName(m.amsFancyboxAfterInitCallback,f,j,h)})})}},imgareaselect:function(d){var c=b(".imgareaselect",d);if(c.length>0){a.ajax.check(b.fn.imgAreaSelect,a.baseURL+"ext/jquery-imgareaselect-0.9.10"+(a.devmode?".js":".min.js"),function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-imgareaselect"+(a.devmode?".css":".min.css"))}c.each(function(){var k=b(this);var j=k.data();var h=j.amsImgareaselectParent?k.parents(j.amsImgareaselectParent):"body";var g={instance:true,handles:true,parent:h,x1:j.amsImgareaselectX1||0,y1:j.amsImgareaselectY1||0,x2:j.amsImgareaselectX2||j.amsImgareaselectImageWidth,y2:j.amsImgareaselectY2||j.amsImgareaselectImageHeight,imageWidth:j.amsImgareaselectImageWidth,imageHeight:j.amsImgareaselectImageHeight,minWidth:128,minHeight:128,aspectRatio:j.amsImgareaselectRatio,onSelectEnd:a.getFunctionByName(j.amsImgareaselectSelectEnd)||function(l,m){var n=j.amsImgareaselectTargetField||"image_";b('input[name="'+n+'x1"]',h).val(m.x1);b('input[name="'+n+'y1"]',h).val(m.y1);b('input[name="'+n+'x2"]',h).val(m.x2);b('input[name="'+n+'y2"]',h).val(m.y2)}};var f=b.extend({},g,j.amsImgareaselectOptions);f=a.executeFunctionByName(j.amsImgareaselectInitCallback,k,f)||f;var i=k.imgAreaSelect(f);a.executeFunctionByName(j.amsImgareaselectAfterInitCallback,k,i,f);setTimeout(function(){i.update()},250)})})}},graphs:function(d){var c=b(".sparkline",d);if(c.length>0){a.ajax.check(a.graphs,a.baseURL+"myams-graphs"+(a.devmode?".js":".min.js"),function(){a.graphs.init(c)})}},scrollbars:function(c){var d=b(".scrollbar",c);if(d.length>0){a.ajax.check(b.event.special.mousewheel,a.baseURL+"ext/jquery-mousewheel.min.js",function(){a.ajax.check(b.fn.mCustomScrollbar,a.baseURL+"ext/jquery-mCustomScrollbar"+(a.devmode?".js":".min.js"),function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-mCustomScrollbar.css","jquery-mCustomScrollbar")}d.each(function(){var j=b(this);var i=j.data();var g={theme:i.amsScrollbarTheme||"light"};var f=b.extend({},g,i.amsScrollbarOptions);f=a.executeFunctionByName(i.amsScrollbarInitCallback,j,f)||f;var h=j.mCustomScrollbar(f);a.executeFunctionByName(i.amsScrollbarAfterInitCallback,j,h,f)})})})}}}};MyAMS.callbacks={init:function(c){b("[data-ams-callback]",c).each(function(){var d=this;var e=b(d).data();var f=a.getFunctionByName(e.amsCallback);if(f===undefined){if(e.amsCallbackSource){a.getScript(e.amsCallbackSource,function(){a.executeFunctionByName(e.amsCallback,d,e.amsCallbackOptions)})}else{if(window.console){console.warn("Undefined callback: "+e.amsCallback)}}}else{f.call(d,e.amsCallbackOptions)}})},alert:function(k){var f=b(this).data();var c=b.extend({},k,f.amsAlertOptions);var i=b(f.amsAlertParent||c.parent||this);var e=f.amsAlertStatus||c.status||"info";var g=f.amsAlertHeader||c.header;var j=f.amsAlertMessage||c.message;var h=f.amsAlertSubtitle||c.subtitle;var d=f.amsAlertMargin===undefined?(c.margin===undefined?false:c.margin):f.amsAlertMargin;a.skin.alert(i,e,g,j,h,d)},messageBox:function(d){var g=b(this).data();var f=b.extend({},d,g.amsMessageboxOptions);var e=b.extend({},f,{title:g.amsMessageboxTitle||f.title||"",content:g.amsMessageboxContent||f.content||"",icon:g.amsMessageboxIcon||f.icon,number:g.amsMessageboxNumber||f.number,timeout:g.amsMessageboxTimeout||f.timeout});var c=g.amsMessageboxStatus||f.status||"info";var h=a.getFunctionByName(g.amsMessageboxCallback||f.callback);a.skin.messageBox(c,e,h)},smallBox:function(d){var g=b(this).data();var f=b.extend({},d,g.amsSmallboxOptions);var e=b.extend({},f,{title:g.amsSmallboxTitle||f.title||"",content:g.amsSmallboxContent||f.content||"",icon:g.amsSmallboxIcon||f.icon,iconSmall:g.amsSmallboxIconSmall||f.iconSmall,timeout:g.amsSmallboxTimeout||f.timeout});var c=g.amsSmallboxStatus||f.status||"info";var h=a.getFunctionByName(g.amsSmallboxCallback||f.callback);a.skin.smallBox(c,e,h)}};MyAMS.events={init:function(c){b("[data-ams-events-handlers]",c).each(function(){var e=b(this);var d=e.data("ams-events-handlers");for(var f in d){e.on(f,a.getFunctionByName(d[f]))}})}};MyAMS.container={changeOrder:function(d,e){var c=b('input[name="'+b(this).data("ams-input-name")+'"]',b(this));c.val(e.join(";"))},deleteElement:function(c){return function(){var d=b(this);MyAMS.skin.bigBox({title:a.i18n.WARNING,content:'<i class="text-danger fa fa-2x fa-bell shake animated"></i>&nbsp; '+a.i18n.DELETE_WARNING,buttons:a.i18n.BTN_OK_CANCEL},function(g){if(g==a.i18n.BTN_OK){var i=d.parents("table");var f=i.data("ams-location")||"";var j=d.parents("tr");var h=j.data("ams-delete-target")||i.data("ams-delete-target")||"delete-element.json";var e=j.data("ams-element-name");MyAMS.ajax.post(f+"/"+h,{object_name:e},function(k,l){if(k.status=="success"){if(i.hasClass("datatable")){i.dataTable().fnDeleteRow(j[0])}else{j.remove()}}})}})}}};MyAMS.skin={_setPageHeight:function(){var e=b("#main").height();var c=a.left_panel.height();var d=b(window).height()-a.navbar_height;if(e>d){a.left_panel.css("min-height",e);a.root.css("min-height",e+a.navbar_height)}else{a.left_panel.css("min-height",d);a.root.css("min-height",d)}},_checkMobileWidth:function(){if(b(window).width()<979){a.root.addClass("mobile-view-activated")}else{if(a.root.hasClass("mobile-view-activated")){a.root.removeClass("mobile-view-activated")}}},_showShortcutButtons:function(){a.shortcuts.animate({height:"show"},200,"easeOutCirc");a.root.addClass("shortcut-on")},_hideShortcutButtons:function(){a.shortcuts.animate({height:"hide"},300,"easeOutCirc");a.root.removeClass("shortcut-on")},checkNotification:function(){$this=b("#activity > .badge");if(parseInt($this.text())>0){$this.removeClass("hidden").addClass("bg-color-red bounceIn animated")}else{$this.addClass("hidden").removeClass("bg-color-red bounceIn animated")}},_initDesktopWidgets:function(c){if(a.enable_widgets){var d=b(".ams-widget",c);if(d.length>0){a.ajax.check(b.fn.MyAMSWidget,a.baseURL+"myams-widgets"+(a.devmode?".js":".min.js"),function(){d.each(function(){var h=b(this);var g=h.data();var f={deleteSettingsKey:"#deletesettingskey-options",deletePositionKey:"#deletepositionkey-options"};var e=b.extend({},f,g.amsWidgetOptions);e=a.executeFunctionByName(g.amsWidgetInitcallback,h,e)||e;h.MyAMSWidget(e)});MyAMSWidget.initWidgetsGrid(b(".ams-widget-grid",c))})}}},_initMobileWidgets:function(c){if(a.enable_mobile&&a.enable_widgets){a.skin._initDesktopWidgets(c)}},alert:function(j,d,e,k,i,c){b(".alert",j).remove();if(d=="error"){d="danger"}var g='<div class="'+(c?"margin-10":"")+" alert alert-block alert-"+d+' fade in"><a class="close" data-dismiss="alert"><i class="fa fa-check"></i></a><h4 class="alert-heading"><i class="fa fa-fw fa-warning"></i> '+e+"</h4>"+(i?("<p>"+i+"</p>"):"");if(typeof(k)=="string"){g+="<ul><li>"+k+"</li></ul>"}else{if(k){g+="<ul>";for(var f in k){if(!b.isNumeric(f)){continue}g+="<li>"+k[f]+"</li>"}g+="</ul>"}}g+="</div>";var h=b(g).prependTo(j);if(j.exists){a.ajax.check(b.scrollTo,a.baseURL+"ext/jquery-scrollTo.min.js",function(){b.scrollTo(j,{offset:{top:-50}})})}},bigBox:function(c,d){a.ajax.check(a.notify,a.baseURL+"myams-notify"+(a.devmode?".js":".min.js"),function(){a.notify.messageBox(c,d)})},messageBox:function(c,d,e){if(typeof(c)=="object"){e=d;d=c||{};c="info"}a.ajax.check(a.notify,a.baseURL+"myams-notify"+(a.devmode?".js":".min.js"),function(){switch(c){case"error":case"danger":d.color="#C46A69";break;case"warning":d.color="#C79121";break;case"success":d.color="#739E73";break;default:d.color=d.color||"#3276B1"}d.sound=false;a.notify.bigBox(d,e)})},smallBox:function(c,d,e){if(typeof(c)=="object"){e=d;d=c||{};c="info"}a.ajax.check(a.notify,a.baseURL+"myams-notify"+(a.devmode?".js":".min.js"),function(){switch(c){case"error":case"danger":d.color="#C46A69";break;case"warning":d.color="#C79121";break;case"success":d.color="#739E73";break;default:d.color=d.color||"#3276B1"}d.sound=false;a.notify.smallBox(d,e)})},_drawBreadCrumb:function(){var c=b("#ribbon OL.breadcrumb");c.empty().append(b("<li></li>").append(b("<a></a>").text(a.i18n.HOME).attr("href",b('nav a[href!="#"]:first').attr("href"))));b("nav LI.active >A").each(function(){var f=b(this);var d=b.trim(f.clone().children(".badge").remove().end().text());var e=b("<li></li>").append(f.attr("href").replace(/^#/,"")?b("<a></a>").html(d).attr("href",f.attr("href")):d);c.append(e)})},checkURL:function(){function c(i){b("nav .active").removeClass("active");i.addClass("open").addClass("active");i.parents("li").addClass("open active").children("ul").addClass("active").show();i.parents("li:first").removeClass("open");i.parents("ul").addClass(i.attr("href").replace(/^#/,"")?"active":"").show()}var f=location.hash;var e=f.replace(/^#/,"");if(e){var d=b("#content");if(!d.exists()){d=b("body")}var g=b('nav A[href="'+f+'"]');if(g.exists()){c(g)}a.skin.loadURL(e,d);document.title=b("[data-ams-page-title]:first",d).data("ams-page-title")||g.attr("title")||document.title}else{var h=b("[data-ams-active-menu]").data("ams-active-menu");if(h){g=b('nav A[href="'+h+'"]')}else{g=b('nav >UL >LI >A[href!="#"]').first()}if(g.exists()){c(g);if(h){a.skin._drawBreadCrumb()}else{window.location.hash=g.attr("href")}}}},loadURL:function(e,c,d,h){if(e.startsWith("#")){e=e.substr(1)}if(typeof(d)=="function"){h=d;d={}}c=b(c);var g={type:"GET",url:e,dataType:"html",cache:false,beforeSend:function(){c.html('<h1><i class="fa fa-cog fa-spin"></i> Loading... </h1>');if(c[0]==b("#content")[0]){a.skin._drawBreadCrumb();document.title=b(".breadcrumb LI:last-child").text();b("html, body").animate({scrollTop:0},"fast")}else{c.animate({scrollTop:0},"fast")}},success:function(m,j,l){if(h){a.executeFunctionByName(h,this,m,j,l,d)}else{var k=a.ajax.getResponse(l);var n=k.content_type;var i=k.data;switch(n){case"json":a.ajax.handleJSON(i,c);break;case"script":break;case"xml":break;case"html":case"text":default:c.parents(".hidden").removeClass("hidden");b(".alert",c.parents(".alerts-container")).remove();c.css({opacity:"0.0"}).html(m).removeClass("hidden").delay(50).animate({opacity:"1.0"},300);a.initContent(c)}if(d&&d.afterLoadCallback){a.executeFunctionByName(d.afterLoadCallback,this)}}},error:function(k,j,i){c.html('<h3 class="error"><i class="fa fa-warning txt-color-orangeDark"></i> '+a.i18n.ERROR+i+"</h3>"+k.responseText)},async:false};var f=b.extend({},g,d);b.ajax(f)},setLanguage:function(d){var f=d.lang;var e=d.handler_type||"json";switch(e){case"json":var g=d.method||"setUserLanguage";a.jsonrpc.post(g,{lang:f},function(){window.location.reload(true)});break;case"ajax":var c=d.href||"setUserLanguage";a.ajax.post(c,{lang:f},function(){window.location.reload(true)});break}},logout:function(){window.location=a.loginURL}};MyAMS.initPage=function(){var c=b("body");a.root=c;a.left_panel=b("#left-panel");a.shortcuts=b("#shortcut");a.plugins.initData(c);var d=b.ajaxSettings.xhr;b.ajaxSetup({progress:a.ajax.progress,progressUpload:a.ajax.progress,xhr:function(){var f=d();if(f&&(typeof(f.addEventListener)=="function")){var e=this;f.addEventListener("progress",function(g){e.progress(g)},false)}return f}});b(document).ajaxStart(a.ajax.start);b(document).ajaxStop(a.ajax.stop);b(document).ajaxError(a.error.ajax);if(!a.isMobile){a.root.addClass("desktop-detected");a.device="desktop"}else{a.root.addClass("mobile-detected");a.device="mobile";if(a.enable_fastclick){a.ajax.check(b.fn.noClickDelay,a.baseURL+"/ext/jquery-smartclick"+(a.devmode?".js":".min.js"),function(){b("NAV UL A").noClickDelay();b("#hide-menu A").noClickDelay()})}}b("#hide-menu >:first-child > A").click(function(f){c.toggleClass("hidden-menu");f.preventDefault()});b("#show-shortcut").click(function(f){if(a.shortcuts.is(":visible")){a.skin._hideShortcutButtons()}else{a.skin._showShortcutButtons()}f.preventDefault()});b(document).mouseup(function(f){if(!a.shortcuts.is(f.target)&&a.shortcuts.has(f.target).length===0){a.skin._hideShortcutButtons()}});b("#search-mobile").click(function(){a.root.addClass("search-mobile")});b("#cancel-search-js").click(function(){a.root.removeClass("search-mobile")});b("#activity").click(function(g){var f=b(this);var h=f.next(".ajax-dropdown");if(!h.is(":visible")){h.css("left",f.position().left-h.innerWidth()/2+f.innerWidth()/2).fadeIn(150);f.addClass("active")}else{h.fadeOut(150);f.removeClass("active")}g.preventDefault()});a.skin.checkNotification();b(document).mouseup(function(f){var g=b(".ajax-dropdown");if(!g.is(f.target)&&g.has(f.target).length===0){g.fadeOut(150).prev().removeClass("active")}});b('input[name="activity"]').change(function(){var e=b(this).data("ams-url");container=b(".ajax-notifications");a.skin.loadURL(e,container)});b("#logout a").click(function(f){f.preventDefault();f.stopPropagation();a.loginURL=b(this).attr("href");a.skin.bigBox({title:"<i class='fa fa-sign-out txt-color-orangeDark'></i> "+a.i18n.LOGOUT+" <span class='txt-color-orangeDark'><strong>"+b("#show-shortcut").text()+"</strong></span> ?",content:a.i18n.LOGOUT_COMMENT,buttons:"["+a.i18n.BTN_NO+"]["+a.i18n.BTN_YES+"]"},function(e){if(e==a.i18n.BTN_YES){a.root.addClass("animated fadeOutUp");setTimeout(a.skin.logout,1000)}})});b("NAV UL").myams_menu({accordion:true,speed:a.menu_speed});b(".minifyme").click(function(f){b("BODY").toggleClass("minified");b(this).effect("highlight",{},500);f.preventDefault()});b("#refresh").click(function(f){a.skin.bigBox({title:"<i class='fa fa-refresh' style='color: green'></i> "+a.i18n.CLEAR_STORAGE_TITLE,content:a.i18n.CLEAR_STORAGE_CONTENT,buttons:"["+a.i18n.BTN_CANCEL+"]["+a.i18n.BTN_OK+"]"},function(e){if(e==a.i18n.BTN_OK&&localStorage){localStorage.clear();location.reload()}});f.preventDefault()});c.on("click",function(g){var f=b(this);if(!f.is(g.target)&&f.has(g.target).length===0&&b(".popover").has(g.target).length===0){f.popover("hide")}});a.ajax.check(b.resize,a.baseURL+"ext/jquery-resize"+(a.devmode?".js":".min.js"),function(){b("#main").resize(function(){a.skin._setPageHeight();a.skin._checkMobileWidth()});b("nav").resize(function(){a.skin._setPageHeight()})});if(a.ajax_nav){if(b("nav").length>0){a.skin.checkURL()}b(document).on("click",'a[href="#"]',function(f){f.preventDefault()});b(document).on("click",'a[href!="#"]:not([data-toggle]), [data-ams-url]:not([data-toggle])',function(j){var h=b(j.currentTarget);var f=h.attr("href")||h.data("ams-url");if(!f||f.startsWith("javascript:")||h.attr("target")||(h.data("ams-context-menu")===true)){return}j.preventDefault();j.stopPropagation();var g=a.getFunctionByName(f);if(typeof(g)=="function"){f=g.call(h)}if(typeof(f)=="function"){f.call(h)}else{f=f.replace(/\%23/,"#");var i=h.data("ams-target");if(i){a.form.confirmChangedForm(i,function(){a.skin.loadURL(f,i,h.data("ams-link-options"),h.data("ams-link-callback"));j.stopPropagation()})}else{a.form.confirmChangedForm(function(){if(f.startsWith("#")){if(f!=location.hash){if(a.root.hasClass("mobile-view-activated")){a.root.removeClass("hidden-menu");window.setTimeout(function(){window.location.hash=f},150)}else{window.location.hash=f}}}else{window.location=f}})}}});b(document).on("click",'a[target="_blank"]',function(f){f.preventDefault();window.open(b(f.currentTarget).attr("href"))});b(document).on("click",'a[target="_top"]',function(f){f.preventDefault();a.form.confirmChangedForm(function(){window.location=b(f.currentTarget).attr("href")})});b(window).on("hashchange",a.skin.checkURL)}b(document).off("click.modal").on("click",'[data-toggle="modal"]',function(g){var f=b(this);if(f.data("ams-context-menu")===true){return}if(f.data("ams-stop-propagation")===true){g.stopPropagation()}g.preventDefault();a.dialog.open(f);if(f.parents("#shortcut").exists()){setTimeout(a.skin._hideShortcutButtons,300)}});b(document).on("click",'button[type="submit"], button.submit',function(){var e=b(this);b(e.get(0).form).data("ams-submit-button",e)});b(document).on("click","[data-ams-click-handler]",function(h){var g=b(this);var f=g.data();if(f.amsClickHandler){if((f.amsStopPropagation===true)||(f.amsClickStopPropagation===true)){h.stopPropagation()}if(f.amsClickKeepDefault!==true){h.preventDefault()}var i=a.getFunctionByName(f.amsClickHandler);if(i!==undefined){i.call(g,f.amsClickHandlerOptions)}}});b(document).on("change","[data-ams-change-handler]",function(h){var g=b(this);var f=g.data();if(f.amsChangeHandler){if(f.amsChangeKeepDefault!==true){h.preventDefault()}var i=a.getFunctionByName(f.amsChangeHandler);if(i!==undefined){i.call(g,f.amsChangeHandlerOptions)}}});b(document).on("reset","[data-ams-reset-handler]",function(h){var f=b(this);var g=f.data();if(g.amsResetHandler){if(g.amsResetKeepDefault!==true){h.preventDefault()}var i=a.getFunctionByName(g.amsResetHandler);if(i!==undefined){i.call(f,g.amsResetHandlerOptions)}}});b(document).on("change",'input[type="file"]',function(h){h.preventDefault();var f=b(this);var g=f.parent(".button");if(g.exists()&&g.parent().hasClass("input-file")){g.next('input[type="text"]').val(f.val())}});b("a[data-toggle=tab]",".nav-tabs").on("click",function(f){if(b(this).parent("li").hasClass("disabled")){f.preventDefault();return false}});b(document).on("show.bs.tab",function(h){var f=b(h.target);var g=f.data();if(g.amsUrl){if(g.amsTabLoaded){return}a.skin.loadURL(g.amsUrl,f.attr("href"));if(g.amsTabLoadOnce){f.data("ams-tab-loaded",true)}}});a.plugins.enabled.hint(document);if((window.location.hash=="")||(a.getQueryVar(window.location.href,"came_from")!=false)){a.initContent(document)}b(window).on("beforeunload",a.form.checkBeforeUnload)};MyAMS.initContent=function(c){b(".tipsy").remove();b("[rel=tooltip]",c).tooltip();b("[rel=popover]",c).popover();b("[rel=popover-hover]",c).popover({trigger:"hover"});a.plugins.init(c);a.callbacks.init(c);a.events.init(c);a.form.init(c);if(a.device==="desktop"){a.skin._initDesktopWidgets(c)}else{a.skin._initMobileWidgets(c)}a.skin._setPageHeight()};MyAMS.i18n={INFO:"Information",WARNING:"!! WARNING !!",ERROR:"ERROR: ",WAIT:"Please wait!",FORM_SUBMITTED:"This form was already submitted...",NO_SERVER_RESPONSE:"No response from server!",ERROR_OCCURED:"An error occured!",ERRORS_OCCURED:"Some errors occured!",BAD_LOGIN_TITLE:"Bad login!",BAD_LOGIN_MESSAGE:"Your anthentication credentials didn't allow you to open a session; please check your credentials or contact administrator.",CONFIRM:"Confirm",CONFIRM_REMOVE:"Removing this content can't be undone. Do you confirm?",CLEAR_STORAGE_TITLE:"Clear Local Storage",CLEAR_STORAGE_CONTENT:"Would you like to RESET all your saved widgets and clear LocalStorage?",BTN_OK:"OK",BTN_CANCEL:"Cancel",BTN_OK_CANCEL:"[OK][Cancel]",BTN_YES:"Yes",BTN_NO:"No",BTN_YES_NO:"[Yes][No]",FORM_CHANGED_WARNING:"Some changes were not saved. These updates will be lost if you leave this page.",DELETE_WARNING:"This change can't be undone. Are you sure that you want to delete this element?",NO_UPDATE:"No changes were applied.",DATA_UPDATED:"Data successfully updated.",HOME:"Home",LOGOUT:"Logout?",LOGOUT_COMMENT:"You can improve your security further after logging out by closing this opened browser",SELECT2_PLURAL:"s",SELECT2_MATCH:"One result is available, press enter to select it.",SELECT2_MATCHES:" results are available, use up and down arrow keys to navigate.",SELECT2_NOMATCHES:"No matches found",SELECT2_SEARCHING:"Searching...",SELECT2_LOADMORE:"Loading more results...",SELECT2_INPUT_TOOSHORT:"Please enter {0} more character{1}",SELECT2_INPUT_TOOLONG:"Please delete {0} character{1}",SELECT2_SELECTION_TOOBIG:"You can only select {0} item{1}",SELECT2_FREETAG_PREFIX:"Free text: ",DT_COLUMNS:"Columns"};b(document).ready(function(){b=jQuery.noConflict();var c=b("HTML");var d=c.attr("lang")||c.attr("xml:lang");if(d&&!d.startsWith("en")){MyAMS.lang=d;MyAMS.getScript(MyAMS.baseURL+"i18n/myams_"+d.substr(0,2)+".js",function(){MyAMS.initPage()})}else{MyAMS.initPage()}})})(jQuery);
\ No newline at end of file
+(function(b){String.prototype.startsWith=function(e){var c=this.length;var d=e.length;if(c<d){return false}return(this.substr(0,d)==e)};String.prototype.endsWith=function(e){var c=this.length;var d=e.length;if(c<d){return false}return(this.substr(c-d)==e)};if(!Array.prototype.indexOf){Array.prototype.indexOf=function(d){var c=this.length;var e=Number(arguments[1])||0;e=(e<0)?Math.ceil(e):Math.floor(e);if(e<0){e+=c}for(;e<c;e++){if(e in this&&this[e]===d){return e}}return -1}}b.expr[":"].econtains=function(e,c,d){return(e.textContent||e.innerText||b(e).text()||"").toLowerCase()==d[3].toLowerCase()};b.expr[":"].withtext=function(e,c,d){return(e.textContent||e.innerText||b(e).text()||"")==d[3]};b.expr[":"].parents=function(e,c,d){return b(e).parents(d[3]).length>0};if(b.scrollbarWidth===undefined){b.scrollbarWidth=function(){var d=b('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body");var e=d.children();var c=e.innerWidth()-e.height(99).innerWidth();d.remove();return c}}b.fn.extend({exists:function(){return b(this).length>0},listattr:function(d){var c=[];this.each(function(){c.push(b(this).attr(d))});return c},style:function(d,g,c){var f=this.get(0);if(typeof f=="undefined"){return}var e=this.get(0).style;if(typeof d!="undefined"){if(typeof g!="undefined"){c=typeof c!="undefined"?c:"";e.setProperty(d,g,c);return this}else{return e.getPropertyValue(d)}}else{return e}},removeClassPrefix:function(c){this.each(function(e,f){var d=f.className.split(" ").map(function(g){return g.startsWith(c)?"":g});f.className=b.trim(d.join(" "))});return this},contextMenu:function(d){function c(g,i,f){var h=b(window)[i](),j=b(d.menuSelector)[i](),e=g;if(g+j>h&&j<g){e-=j}return e}return this.each(function(){b("a",b(d.menuSelector)).each(function(){b(this).data("ams-context-menu",true)});b(this).on("contextmenu",function(f){if(f.ctrlKey){return}b(d.menuSelector).data("invokedOn",b(f.target)).show().css({position:"fixed",left:c(f.clientX,"width","scrollLeft")-10,top:c(f.clientY,"height","scrollTop")-10}).off("click").on("click",function(h){b(this).hide();var g=b(this).data("invokedOn");var i=b(h.target);d.menuSelected.call(this,g,i);a.event.stop(h)});return false});b(document).click(function(){b(d.menuSelector).hide()})})},myams_menu:function(c){var e={accordion:"true",speed:200,closedSign:'<em class="fa fa-angle-down"></em>',openedSign:'<em class="fa fa-angle-up"></em>'};var d=b.extend({},e,c);var f=b(this);f.find("LI").each(function(){var g=b(this);if(g.find("UL").size()>0){g.find("A:first").append("<b class='collapse-sign'>"+d.closedSign+"</b>");var h=g.find("A:first");if(h.attr("href")=="#"){h.click(function(){return false})}}});f.find("LI.active").each(function(){var g=b(this).parents("UL");var h=g.parent("LI");g.slideDown(d.speed);h.find("b:first").html(d.openedSign);h.addClass("open")});f.find("LI A").on("click",function(){var j=b(this);var g=j.parent().find("UL");if(d.accordion){var i=j.parent().parents("UL");var k=f.find("UL:visible");k.each(function(l){var m=true;i.each(function(n){if(i[n]==k[l]){m=false;return false}});if(m){if(g!=k[l]){b(k[l]).slideUp(d.speed,function(){j.parent("LI").find("b:first").html(d.closedSign);j.parent("LI").removeClass("open")})}}})}var h=j.parent().find("UL:first");if(!j.attr("href").replace(/^#/,"")&&h.is(":visible")&&!h.hasClass("active")){h.slideUp(d.speed,function(){j.parent("LI").removeClass("open").find("B:first").delay(d.speed).html(d.closedSign)})}else{h.slideDown(d.speed,function(){j.parent("LI").addClass("open").find("B:first").delay(d.speed).html(d.openedSign)})}})}});b.UTF8={encode:function(e){e=e.replace(/\r\n/g,"\n");var d="";for(var g=0;g<e.length;g++){var f=e.charCodeAt(g);if(f<128){d+=String.fromCharCode(f)}else{if((f>127)&&(f<2048)){d+=String.fromCharCode((f>>6)|192);d+=String.fromCharCode((f&63)|128)}else{d+=String.fromCharCode((f>>12)|224);d+=String.fromCharCode(((f>>6)&63)|128);d+=String.fromCharCode((f&63)|128)}}}return d},decode:function(d){var f="";var h=0,j=0,g=0,e=0;while(h<d.length){j=d.charCodeAt(h);if(j<128){f+=String.fromCharCode(j);h++}else{if((j>191)&&(j<224)){g=d.charCodeAt(h+1);f+=String.fromCharCode(((j&31)<<6)|(g&63));h+=2}else{g=d.charCodeAt(h+1);e=d.charCodeAt(h+2);f+=String.fromCharCode(((j&15)<<12)|((g&63)<<6)|(e&63));h+=3}}}return f}};if(window.MyAMS===undefined){window.MyAMS={devmode:true,devext:"",lang:"en",throttle_delay:350,menu_speed:235,navbar_height:49,ajax_nav:true,enable_widgets:true,enable_mobile:false,enable_fastclick:false,warn_on_form_change:false,ismobile:(/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()))}}var a=MyAMS;MyAMS.baseURL=(function(){var c=b('script[src*="/myams.js"], script[src*="/myams.min.js"]');var d=c.attr("src");a.devmode=d.indexOf(".min.js")<0;a.devext=a.devmode?"":".min";return d.substring(0,d.lastIndexOf("/")+1)})();MyAMS.getQueryVar=function(e,f){if(e.indexOf("?")<0){return false}if(!e.endsWith("&")){e+="&"}var c=new RegExp(".*?[&\\?]"+f+"=(.*?)&.*");var d=e.replace(c,"$1");return d==e?false:d};MyAMS.rgb2hex=function(c){return"#"+b.map(c.match(/\b(\d+)\b/g),function(d){return("0"+parseInt(d).toString(16)).slice(-2)}).join("")};MyAMS.generateId=function(){function c(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return c()+c()+c()+c()};MyAMS.getFunctionByName=function(h,d){if(h===undefined){return undefined}else{if(typeof(h)=="function"){return h}}var g=h.split(".");var f=g.pop();d=(d===undefined||d===null)?window:d;for(var c=0;c<g.length;c++){try{d=d[g[c]]}catch(j){return undefined}}try{return d[f]}catch(j){return undefined}};MyAMS.executeFunctionByName=function(f,d){var e=a.getFunctionByName(f,window);if(typeof(e)=="function"){var c=Array.prototype.slice.call(arguments,2);return e.apply(d,c)}};MyAMS.getSource=function(c){return c.replace(/{[^{}]*}/g,function(d){return a.getFunctionByName(d.substr(1,d.length-2))})};MyAMS.getScript=function(d,g,c){var f={dataType:"script",url:a.getSource(d),success:g,error:a.error.show,cache:!a.devmode,async:typeof(g)=="function"};var e=b.extend({},f,c);return b.ajax(e)};MyAMS.getCSS=function(c,g){var e=b("HEAD");var d=b('link[data-ams-id="'+g+'"]',e);if(d.length==0){var f=a.getSource(c);if(a.devmode){f+="?_="+new Date().getTime()}b("<link />").attr({rel:"stylesheet",type:"text/css",href:f,"data-ams-id":g}).appendTo(e)}};MyAMS.event={stop:function(c){if(!c){c=window.event}if(c){if(c.stopPropagation){c.stopPropagation();c.preventDefault()}else{c.cancelBubble=true;c.returnValue=false}}}};MyAMS.browser={getInternetExplorerVersion:function(){var e=-1;if(navigator.appName=="Microsoft Internet Explorer"){var c=navigator.userAgent;var d=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");if(d.exec(c)!=null){e=parseFloat(RegExp.$1)}}return e},checkVersion:function(){var d="You're not using Windows Internet Explorer.";var c=this.getInternetExplorerVersion();if(c>-1){if(c>=8){d="You're using a recent copy of Windows Internet Explorer."}else{d="You should upgrade your copy of Windows Internet Explorer."}}alert(d)},isIE8orlower:function(){var d="0";var c=this.getInternetExplorerVersion();if(c>-1){if(c>=9){d=0}else{d=1}}return d}};MyAMS.error={ajax:function(f,e){if(e.statusText=="OK"){return}var c=a.ajax.getResponse(e);if(c.content_type=="json"){a.ajax.handleJSON(c.data)}else{var g=f.statusText||f.type;var d=e.responseText;a.skin.messageBox("error",{title:a.i18n.ERROR_OCCURED,content:"<h4>"+g+"</h4><p>"+d+"</p>",icon:"fa fa-warning animated shake",timeout:10000})}if(window.console){console.error(f);console.debug(e)}},show:function(f,c,e){if(!e){return}var d=a.ajax.getResponse(f);if(d.content_type=="json"){a.ajax.handleJSON(d.data)}else{a.skin.messageBox("error",{title:a.i18n.ERRORS_OCCURED,content:"<h4>"+c+"</h4><p>"+e+"</p>",icon:"fa fa-warning animated shake",timeout:10000})}if(window.console){console.error(e);console.debug(f)}}};MyAMS.ajax={check:function(d,f,h,c){if(typeof(h)=="object"){c=h;h=undefined}var g={async:typeof(h)=="function"};var e=b.extend({},g,c);if(d===undefined){a.getScript(f,function(){if(typeof(h)=="function"){h(true,c)}},e)}else{if(typeof(h)=="function"){h(false,c)}}},getAddr:function(d){var c=d||b("HTML HEAD BASE").attr("href")||window.location.href;return c.substr(0,c.lastIndexOf("/")+1)},start:function(){b("#ajax-gear").show()},stop:function(){b("#ajax-gear").hide()},progress:function(c){if(!c.lengthComputable){return}if(c.loaded>=c.total){return}console.log(parseInt((c.loaded/c.total*100),10)+"%")},post:function(e,g,d,j){if(e.startsWith(window.location.protocol)){var i=e}else{i=this.getAddr()+e}if(typeof(d)=="function"){j=d;d={}}else{if(!d){d={}}}if(typeof(j)=="undefined"){j=d.callback}if(typeof(j)=="string"){j=a.getFunctionByName(j)}delete d.callback;var c=undefined;var h={url:i,type:"post",cache:false,async:typeof(j)=="function",data:b.param(g),dataType:"json",success:j||function(k){c=k.result},error:a.error.show};var f=b.extend({},h,d);b.ajax(f);return c},getResponse:function(f){var d=f.getResponseHeader("content-type"),h,c;if(d){if(d.startsWith("application/javascript")){h="script";c=f.responseText}else{if(d.startsWith("text/html")){h="html";c=f.responseText}else{if(d.startsWith("text/xml")){h="xml";c=f.responseText}else{c=f.responseJSON;if(c){h="json"}else{try{c=JSON.parse(f.responseText);h="json"}catch(g){c=f.responseText;h="text"}}}}}}else{h="json";c={status:"alert",alert:{title:a.i18n.ERROR_OCCURED,content:a.i18n.NO_SERVER_RESPONSE}}}return{content_type:h,data:c}},handleJSON:function(n,e,j){var h=n.status;var c;switch(h){case"alert":alert(n.alert.title+"\n\n"+n.alert.content);break;case"error":a.form.showErrors(e,n);break;case"info":case"success":if(n.close_form!=false){a.dialog.close(e)}break;case"message":case"messagebox":break;case"notify":case"callback":case"callbacks":if(n.close_form!=false){a.dialog.close(e)}break;case"modal":a.dialog.open(n.location);break;case"reload":if(n.close_form!=false){a.dialog.close(e)}c=n.location||window.location.hash;if(c.startsWith("#")){c=c.substr(1)}a.skin.loadURL(c,n.target||j||"#content");break;case"redirect":if(n.close_form==true){a.dialog.close(e)}c=n.location||window.location.href;if(n.window){window.open(c,n.window,n.options)}else{window.location.href=c}break;default:console.log("Unhandled status: "+h);break}if(n.content){var k=n.content;var d=b(k.target||j||e||"#content");if(k.raw==true){d.text(k.text)}else{d.html(k.html);a.initContent(d)}if(!k.keep_hidden){d.removeClass("hidden")}}if(n.contents){var g=n.contents;for(var i in g){k=g[i];d=b(k.target);if(k.raw==true){d.text(k.text)}else{d.html(k.html);a.initContent(d)}if(!k.keep_hidden){d.removeClass("hidden")}}}if(n.message){var m=n.message;if(typeof(m)=="string"){if((h=="info")||(h=="success")){a.skin.smallBox(h,{title:m,icon:"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:3000})}else{a.skin.alert(b(e||"#content"),h,m)}}else{a.skin.alert(b(m.target||j||e||"#content"),m.status||"success",m.header,m.body,m.subtitle)}}if(n.smallbox){a.skin.smallBox(n.smallbox_status||h,{title:n.smallbox,icon:"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:3000})}if(n.messagebox){m=n.messagebox;if(typeof(m)=="string"){a.skin.messageBox("info",{title:a.i18n.ERROR_OCCURED,content:m,timeout:10000})}else{var f=m.status||"info";if(f=="error"&&e&&j){a.executeFunctionByName(e.data("ams-form-submit-error")||"MyAMS.form.finalizeSubmitOnError",e,j)}a.skin.messageBox(f,{title:m.title||a.i18n.ERROR_OCCURED,content:m.content,icon:m.icon,number:m.number,timeout:m.timeout==null?undefined:(m.timeout||10000)})}}if(n.event){e.trigger(n.event,n.event_options)}if(n.callback){a.executeFunctionByName(n.callback,e,n.options)}if(n.callbacks){for(i in n.callbacks){if(!b.isNumeric(i)){continue}var l=n.callbacks[i];a.executeFunctionByName(l,e,l.options)}}}};MyAMS.jsonrpc={getAddr:function(e){var c=e||b("HTML HEAD BASE").attr("href")||window.location.href;var d=c.replace(/\+\+skin\+\+\w+\//,"");return d.substr(0,d.lastIndexOf("/")+1)},query:function(d,f,c,e){a.ajax.check(b.jsonRpc,a.baseURL+"ext/jquery-jsonrpc"+a.devext+".js",function(){var g;if(typeof(c)=="function"){e=c;c={}}else{if(!c){c={}}}if(typeof(e)=="undefined"){e=c.callback}if(typeof(e)=="string"){e=a.getFunctionByName(e)}delete c.callback;var i={};if(typeof(d)=="string"){i.query=d}else{if(typeof(d)=="object"){b.extend(i,d)}}b.extend(i,c);var h={url:a.jsonrpc.getAddr(c.url),type:"post",cache:false,method:f,params:i,async:typeof(e)=="function",success:e||function(j){g=j.result},error:a.error.show};b.jsonRpc(h);return g})},post:function(f,d,c,e){a.ajax.check(b.jsonRPC,a.baseURL+"ext/jquery-jsonrpc"+a.devext+".js",function(){var g;if(typeof(c)=="function"){e=c;c={}}else{if(!c){c={}}}if(typeof(e)=="undefined"){e=c.callback}if(typeof(e)=="string"){e=a.getFunctionByName(e)}delete c.callback;var g;var i={id:new Date().getTime(),params:d,success:e||function(j){g=j},error:a.error.show};var h=b.extend({},i,c);b.jsonRPC.withOptions({endPoint:a.jsonrpc.getAddr(c.url),namespace:c.namespace,cache:false},function(){b.jsonRPC.request(f,h)});return g})}};MyAMS.xmlrpc={getAddr:function(e){var c=e||b("HTML HEAD BASE").attr("href")||window.location.href;var d=c.replace(/\+\+skin\+\+\w+\//,"");return d.substr(0,d.lastIndexOf("/")+1)},post:function(d,g,e,c,f){a.ajax.check(b.xmlrpc,a.baseURL+"ext/jquery-xmlrpc"+a.devext+".js",function(){var h;if(typeof(c)=="function"){f=c;c={}}else{if(!c){c={}}}if(typeof(f)=="undefined"){f=c.callback}if(typeof(f)=="string"){f=a.getFunctionByName(f)}delete c.callback;var j={url:a.xmlrpc.getAddr(d),methodName:g,params:e,success:f||function(k){h=k},error:a.error.show};var i=b.extend({},j,c);b.xmlrpc(i);return h})}};MyAMS.form={init:function(d){if(a.warn_on_form_change){var c=b('FORM[data-ams-warn-on-change!="false"]',d)}else{c=b('FORM[data-ams-warn-on-change="true"]',d)}c.each(function(){var e=b(this);b('INPUT[type="text"], INPUT[type="checkbox"], INPUT[type="radio"], SELECT, TEXTAREA, [data-ams-changed-event]',e).each(function(){var g=b(this);if(g.data("ams-ignore-change")!==true){var f=g.data("ams-changed-event")||"change";g.on(f,function(){b(this).parents("FORM").attr("data-ams-form-changed",true)})}});e.on("reset",function(){b(this).removeAttr("data-ams-form-changed")})})},checkBeforeUnload:function(){var c=b('FORM[data-ams-form-changed="true"]');if(c.exists()){return a.i18n.FORM_CHANGED_WARNING}},confirmChangedForm:function(d,e){if(typeof(d)=="function"){e=d;d=undefined}var c=b('FORM[data-ams-form-changed="true"]',d);if(c.exists()){a.skin.bigBox({title:a.i18n.WARNING,content:'<i class="text-danger fa fa-2x fa-bell shake animated"></i>&nbsp; '+a.i18n.FORM_CHANGED_WARNING,buttons:a.i18n.BTN_OK_CANCEL},function(f){if(f==a.i18n.BTN_OK){e.call(d)}})}else{e.call(d)}},submit:function(e,d,f){e=b(e);if(!e.exists()){return false}if(typeof(d)=="object"){f=d;d=undefined}if(e.data("submitted")){if(!e.data("ams-form-hide-submitted")){a.skin.messageBox("warning",{title:a.i18n.WAIT,content:a.i18n.FORM_SUBMITTED,icon:"fa fa-save shake animated",timeout:e.data("ams-form-alert-timeout")||5000})}return false}if(!a.form._checkSubmitValidators(e)){return false}b(".alert, SPAN.state-error",e).remove();b(".state-error",e).removeClassPrefix("state-");var c=b(e.data("ams-submit-button"));if(c&&!c.data("ams-form-hide-loading")){c.button("loading")}a.ajax.check(b.fn.ajaxSubmit,a.baseURL+"ext/jquery-form-3.49"+a.devext+".js",function(){function i(k,m){var j;var C=k.data();var t=C.amsFormOptions;if(f){var o=f.formDataInitCallback}if(o){delete f.formDataInitCallback}else{o=C.amsFormDataInitCallback}if(o){var u={};if(typeof(o)=="function"){var l=o.call(k,u)}else{l=a.executeFunctionByName(o,k,u)}if(u.veto){j=k.data("ams-submit-button");if(j){j.button("reset")}a.form.finalizeSubmitFooter.call(k);return false}}else{l=C.amsFormData||{}}j=b(k.data("ams-submit-button"));var v,y;if(j){v=j.data("ams-form-handler");y=j.data("ams-form-submit-target")}var r=d||v||C.amsFormHandler||"";if(r.startsWith(window.location.protocol)){var n=r}else{var x=k.attr("action").replace(/#/,"");if(x.startsWith(window.location.protocol)){n=x}else{n=a.ajax.getAddr()+x}n+=r}var B=null;if(C.amsFormInitSubmitTarget){B=b(y||C.amsFormSubmitTarget||"#content");a.executeFunctionByName(C.amsFormInitSubmit||"MyAMS.form.initSubmit",k,B)}else{if(!C.amsFormHideSubmitFooter){a.executeFunctionByName(C.amsFormInitSubmit||"MyAMS.form.initSubmitFooter",k)}}var p=typeof(m.uuid)!="undefined";if(p){if(n.indexOf("X-Progress-ID")<0){n+="?X-Progress-ID="+m.uuid}delete m.uuid}var s={url:n,type:"post",cache:false,data:l,dataType:C.amsFormDatatype,beforeSerialize:function(){if(typeof(tinyMCE)!="undefined"){tinyMCE.triggerSave()}},beforeSubmit:function(E,D){D.data("submitted",true)},error:function(H,D,E,G){if(B){a.executeFunctionByName(C.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",G,B)}if(G.is(":visible")){var F=G.data("ams-submit-button");if(F){F.button("reset")}a.form.finalizeSubmitFooter.call(G)}G.data("submitted",false);G.removeData("ams-submit-button")},iframe:p};var w=C.amsFormDownloadTarget;if(w){var q=b('iframe[name="'+w+'"]');if(!q.exists()){q=b("<iframe></iframe>").hide().attr("name",w).appendTo(k)}s=b.extend({},s,{iframe:true,iframeTarget:q,success:function(D,E,I,H){var G=b(H).parents(".modal-dialog");if(G.exists()){a.dialog.close(H)}else{var J;var F=H.data("ams-submit-button");if(F){J=F.data("ams-form-submit-callback")}if(!J){J=a.getFunctionByName(C.amsFormSubmitCallback)||a.form._submitCallback}J.call(H,D,E,I,H);if(H.is(":visible")&&F){F.button("reset")}H.data("submitted",false);H.removeData("ams-submit-button");H.removeAttr("data-ams-form-changed")}}})}else{s=b.extend({},s,{error:function(H,D,E,G){if(B){a.executeFunctionByName(C.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",G,B)}if(G.is(":visible")){var F=G.data("ams-submit-button");if(F){F.button("reset")}a.form.finalizeSubmitFooter.call(G)}G.data("submitted",false);G.removeData("ams-submit-button")},success:function(D,E,H,G){var I;var F=G.data("ams-submit-button");if(F){I=F.data("ams-form-submit-callback")}if(!I){I=a.getFunctionByName(C.amsFormSubmitCallback)||a.form._submitCallback}I.call(G,D,E,H,G);if(G.is(":visible")&&F){F.button("reset")}G.data("submitted",false);G.removeData("ams-submit-button");G.removeAttr("data-ams-form-changed")},iframe:p})}var A=b.extend({},s,m,t,f);b(k).ajaxSubmit(A);if(w){var z=b(k).parents(".modal-dialog");if(z.exists()){a.dialog.close(k)}else{a.form.finalizeSubmitFooter.call(k);if(j){j.button("reset")}k.data("submitted",false);k.removeData("ams-submit-button");k.removeAttr("data-ams-form-changed")}}}var h=b('INPUT[type="file"]',e).length>0;if(h){a.ajax.check(b.progressBar,a.baseURL+"ext/jquery-progressbar"+a.devext+".js");var g=b.extend({},{uuid:b.progressBar.submit(e)});i(e,g)}else{i(e,{})}});return false},initSubmit:function(e,d){var c=b(this);var f='<i class="fa fa-3x fa-gear fa-spin"></i>';if(!d){d=c.data("ams-form-submit-message")}if(d){f+="<strong>"+d+"</strong>"}b(e).html('<div class="row margin-20"><div class="text-center">'+f+"</div></div>");b(e).parents(".hidden").removeClass("hidden")},finalizeSubmitOnError:function(c){b("i",c).removeClass("fa-spin").removeClass("fa-gear").addClass("fa-ambulance")},initSubmitFooter:function(d){var c=b(this);var f='<i class="fa fa-3x fa-gear fa-spin"></i>';if(!d){d=b(this).data("ams-form-submit-message")}if(d){f+='<strong class="submit-message align-top padding-left-10 margin-top-10">'+d+"</strong>"}var e=b("footer",c);b("button",e).hide();e.append('<div class="row"><div class="text-center">'+f+"</div></div>")},finalizeSubmitFooter:function(){var c=b(this);var d=b("footer",c);if(d){b(".row",d).remove();b("button",d).show()}},_submitCallback:function(m,e,d,c){if(c.is(":visible")){a.form.finalizeSubmitFooter.call(c);var g=c.data("ams-submit-button");if(g){g.button("reset")}}var f=c.data();if(f.amsFormDatatype){var j=f.amsFormDatatype}else{var h=a.ajax.getResponse(d);j=h.content_type;m=h.data}if(g){var i=b(g.amsFormSubmitTarget||f.amsFormSubmitTarget||"#content")}else{i=b(f.amsFormSubmitTarget||"#content")}switch(j){case"json":a.ajax.handleJSON(m,c,i);break;case"script":break;case"xml":break;case"html":case"text":default:if(g&&(g.data("ams-keep-modal")!==true)){a.dialog.close(c)}if(!i.exists()){i=b("body")}i.parents(".hidden").removeClass("hidden");b(".alert",i.parents(".alerts-container")).remove();i.css({opacity:"0.0"}).html(m).delay(50).animate({opacity:"1.0"},300);a.initContent(i)}var k=d.getResponseHeader("X-AMS-Callback");if(k){var l=d.getResponseHeader("X-AMS-Callback-Options");a.executeFunctionByName(k,c,l===undefined?{}:JSON.parse(l),d)}},_getSubmitValidators:function(d){var c=new Array();var e=d.data("ams-form-validator");if(e){c.push([d,e])}b("[data-ams-form-validator]",d).each(function(){var f=b(this);c.push([f,f.data("ams-form-validator")])});return c},_checkSubmitValidators:function(e){var g=a.form._getSubmitValidators(e);if(!g.length){return true}var f=new Array();var l=true;for(var i in g){if(!b.isNumeric(i)){continue}var d=g[i];var c=d[0];var j=d[1];var k=a.executeFunctionByName(j,e,c);if(k===false){l=false}else{if(typeof(k)=="string"){f.push(k)}else{if(l.length&&(l.length>0)){f=f.concat(l)}}}}if(f.length>0){var h=f.length==1?a.i18n.ERROR_OCCURED:a.i18n.ERRORS_OCCURED;a.skin.alert(e,"danger",h,f);return false}else{return l}},showErrors:function(c,j){if(typeof(j)=="string"){a.skin.alert(c,"error",a.i18n.ERROR_OCCURED,j)}else{if(j instanceof Array){var f=j.length==1?a.i18n.ERROR_OCCURED:a.i18n.ERRORS_OCCURED;a.skin.alert(c,"error",f,j)}else{b(".state-error",c).removeClass("state-error");f=j.error_header||(j.widgets&&(j.widgets.length>1)?a.i18n.ERRORS_OCCURED:a.i18n.ERROR_OCCURED);var k=new Array();var i;for(i in j.messages){if(!b.isNumeric(i)){continue}if(j.messages[i].header){k.push("<strong>"+j.messages[i].header+"</strong><br />"+j.messages[i].message)}else{k.push(j.messages[i].message||j.messages[i])}}for(i in j.widgets){if(!b.isNumeric(i)){continue}var d=j.widgets[i];var g=b('[name="'+d.name+'"]',c);g.parents("label:first").removeClassPrefix("state-").addClass("state-error").after('<span for="name" class="state-error">'+d.message+"</span>");if(d.label){k.push(d.label+" : "+d.message)}var h=g.parents(".tab-pane").index()+1;if(h>0){var e=b(".nav-tabs",b(g).parents(".tabforms"));b("li:nth-child("+h+")",e).removeClassPrefix("state-").addClass("state-error");b("li.state-error:first a",c).click()}}a.skin.alert(c,j.error_level||"error",f,k,j.error_message)}}}};MyAMS.dialog={_hide_callbacks:[],registerHideCallback:function(d){var c=a.dialog._hide_callbacks;if(c.indexOf(d)<0){c.push(d)}},open:function(d,c){a.ajax.check(b.fn.modalmanager,a.baseURL+"ext/bootstrap-modalmanager"+a.devext+".js",function(){a.ajax.check(b.fn.modal.defaults,a.baseURL+"ext/bootstrap-modal"+a.devext+".js",function(h){if(h){b(document).off("click.modal");b.fn.modal.defaults.spinner=b.fn.modalmanager.defaults.spinner='<div class="loading-spinner" style="width: 200px; margin-left: -100px;"><div class="progress progress-striped active"><div class="progress-bar" style="width: 100%;"></div></div></div>'}if(typeof(d)=="string"){var g={};var f=d}else{g=d.data();f=d.attr("href")||g.amsUrl;var e=a.getFunctionByName(f);if(typeof(e)=="function"){f=e.call(d)}}if(!f){return}b("body").modalmanager("loading");if(f.indexOf("#")==0){b(f).modal("show")}else{b.ajax({url:f,type:"get",cache:g.amsAllowCache===undefined?false:g.amsAllowCache,data:c,success:function(l,k,j){b("body").modalmanager("removeLoading");var m=a.ajax.getResponse(j);var r=m.content_type;var s=m.data;switch(r){case"json":a.ajax.handleJSON(s,b(b(d).data("ams-json-target")||"#content"));break;case"script":break;case"xml":break;case"html":case"text":default:var n=b(s);var p=b(".modal-dialog",n.wrap("<div></div>").parent());var o=p.data();var q={overflow:o.amsModalOverflow||".modal-viewport",maxHeight:o.amsModalMaxHeight===undefined?function(){return b(window).height()-b(".modal-header",n).outerHeight(true)-b("footer",n).outerHeight(true)-85}:a.getFunctionByName(o.amsModalMaxHeight)};var i=b.extend({},q,o.amsModalOptions);i=a.executeFunctionByName(o.amsModalInitCallback,p,i)||i;b("<div>").addClass("modal fade").append(n).modal(i).on("shown",a.dialog.shown).on("hidden",a.dialog.hidden);a.initContent(n)}}})}})})},shown:function(i){function h(k){var l=b(".scrollmarker.top",c);var j=c.scrollTop();if(j>0){l.show()}else{l.hide()}var e=b(".scrollmarker.bottom",c);if(f+j>=c.get(0).scrollHeight){e.hide()}else{e.show()}}var g=i.target;var c=b(".modal-viewport",g);if(c.length==0){return}var f=parseInt(c.css("max-height"));var d=b.scrollbarWidth();if(c.height()==f){b("<div></div>").addClass("scrollmarker").addClass("top").css("top",0).css("width",c.width()-d).hide().appendTo(c);b("<div></div>").addClass("scrollmarker").addClass("bottom").css("top",f-20).css("width",c.width()-d).appendTo(c);c.scroll(h);c.off("resize").on("resize",h)}else{b(".scrollmarker",c).remove()}},close:function(d){var e=d.parents(".modal").data("modal");if(e){var c=b("body").data("modalmanager");if(c&&(c.getOpenModals().indexOf(e)>=0)){e.hide()}}},hidden:function(g){var f=g.target;a.skin.cleanContainer(f);var d=a.dialog._hide_callbacks;for(var c in d){d[c].call(f)}}};MyAMS.helpers={select2ClearSelection:function(){var d=b(this);var c=d.parents("label");var e=d.data("ams-select2-target");b('[name="'+e+'"]',c).data("select2").val("")},select2FormatSelection:function(d,c){if(d instanceof Array){b(d).each(function(){if(typeof(this)=="object"){c.append(this.text)}else{c.append(this)}})}else{if(typeof(d)=="object"){c.append(d.text)}else{c.append(d)}}},select2QueryUrlResultsCallback:function(e,d,c){switch(e.status){case"error":a.skin.messageBox("error",{title:a.i18n.ERROR_OCCURED,content:"<h4>"+e.error_message+"</h4>",icon:"fa fa-warning animated shake",timeout:10000});break;case"modal":b(this).data("select2").dropdown.hide();a.dialog.open(result.location);break;default:return{results:e.results||e,more:e.has_more||false,context:e.context}}},select2QueryMethodSuccessCallback:function(g,d,f){var c=g.result;if(typeof(c)=="string"){try{c=JSON.parse(c)}catch(h){}}switch(c.status){case"error":a.skin.messageBox("error",{title:a.i18n.ERROR_OCCURED,content:"<h4>"+c.error_message+"</h4>",icon:"fa fa-warning animated shake",timeout:10000});break;case"modal":b(this).data("select2").dropdown.hide();a.dialog.open(c.location);break;default:f.callback({results:c.results||c,more:c.has_more||false,context:c.context})}},contextMenuHandler:function(f,g){var c=g.data();if(c.toggle=="modal"){a.dialog.open(g)}else{var d=g.attr("href")||c.amsUrl;if(!d||d.startsWith("javascript:")||g.attr("target")){return}a.event.stop();var e=a.getFunctionByName(d);if(typeof(e)=="function"){d=e.call(g,f)}if(typeof(d)=="function"){d.call(g,f)}else{d=d.replace(/\%23/,"#");var f=g.data("ams-target");if(f){a.form.confirmChangedForm(f,function(){a.skin.loadURL(d,f,g.data("ams-link-options"),g.data("ams-link-callback"))})}else{a.form.confirmChangedForm(function(){if(d.startsWith("#")){if(d!=location.hash){if(a.root.hasClass("mobile-view-activated")){a.root.removeClass("hidden-menu");window.setTimeout(function(){window.location.hash=d},150)}else{window.location.hash=d}}}else{window.location=d}})}}}},datetimepickerDialogHiddenCallback:function(){b(".datepicker, .timepicker, .datetimepicker",this).datetimepicker("destroy")}};MyAMS.plugins={init:function(e){a.plugins.initData(e);var f=new Array();b("[data-ams-plugins-disabled]",e).each(function(){var h=b(this).data("ams-plugins-disabled").split(/\s+/);for(var i in h){f.push(h[i])}});var d;b("[data-ams-plugins]",e).each(function(){var l=b(this);var h={};if(typeof(l.data("ams-plugins"))==="string"){var m=l.data("ams-plugins").split(/\s+/);for(var j in m){d=m[j];var i={src:l.data("ams-plugin-"+d+"-src"),css:l.data("ams-plugin-"+d+"-css"),callback:l.data("ams-plugin-"+d+"-callback"),register:l.data("ams-plugin-"+d+"-register"),async:l.data("ams-plugin-"+d+"-async")};h[d]=i}}else{h=l.data("ams-plugins")}for(d in h){if(a.plugins.enabled[d]===undefined){var k=h[d];a.getScript(k.src,function(){var p=k.callback;if(p){var o=a.getFunctionByName(p);if(k.register!==false){a.plugins.enabled[d]=o}}else{if(k.register!==false){a.plugins.enabled[d]=null}}var n=k.css;if(n){a.getCSS(n,d+"_css")}},{async:k.async===undefined?true:k.async})}}});for(var c in a.plugins.enabled){if(f.indexOf(c)>=0){continue}var g=a.plugins.enabled[c];if(typeof(g)=="function"){g(e)}}},initData:function(c){b("[data-ams-data]",c).each(function(){var e=b(this);var f=e.data("ams-data");for(var d in f){e.attr("data-"+d,f[d])}})},register:function(d,c,f){if(typeof(c)=="function"){f=c;c=null}c=c||d.name;if(a.plugins.enabled.indexOf(c)>=0){if(window.console){console.warn("Plugin "+c+" is already registered!")}return}if(typeof(d)=="object"){var e=d.src;if(e){a.ajax.check(d.callback,e,function(g){if(g){a.plugins.enabled[c]=a.getFunctionByName(d.callback);if(d.css){a.getCSS(d.css,c+"_css")}if(f){a.executeFunctionByName(f)}}})}else{a.plugins.enabled[c]=a.getFunctionByName(d.callback);if(d.css){a.getCSS(d.css,c+"_css")}if(f){a.executeFunctionByName(f)}}}else{if(typeof(d)=="function"){a.plugins.enabled[c]=d;if(f){a.executeFunctionByName(f)}}}},enabled:{hint:function(c){var d=b(".hint:not(:parents(.nohints))",c);if(d.length>0){a.ajax.check(b.fn.tipsy,a.baseURL+"ext/jquery-tipsy"+a.devext+".js",function(){a.getCSS(a.baseURL+"../css/ext/jquery-tipsy"+a.devext+".css","jquery-tipsy");d.each(function(){var i=b(this);var h=i.data();var f={html:h.amsHintHtml,title:a.getFunctionByName(h.amsHintTitleGetter)||function(){var j=b(this);return j.attr("original-title")||j.attr(h.amsHintTitleAttr||"title")||(h.amsHintHtml?j.html():j.text())},opacity:h.amsHintOpacity||0.95,gravity:h.amsHintGravity||"sw",offset:h.amsHintOffset||0};var e=b.extend({},f,h.amsHintOptions);e=a.executeFunctionByName(h.amsHintInitCallback,i,e)||e;var g=i.tipsy(e);a.executeFunctionByName(h.amsHintAfterInitCallback,i,g,e)})})}},contextMenu:function(c){var d=b(".context-menu",c);if(d.length>0){d.each(function(){var i=b(this);var h=i.data();var f={menuSelector:h.amsContextmenuSelector,menuSelected:a.helpers.contextMenuHandler};var e=b.extend({},f,h.amsContextmenuOptions);e=a.executeFunctionByName(h.amsContextmenuInitCallback,i,e)||e;var g=i.contextMenu(e);a.executeFunctionByName(h.amsContextmenuAfterInitCallback,i,g,e)})}},switcher:function(c){b("LEGEND.switcher",c).each(function(){var e=b(this);var d=e.parent("fieldset");var f=e.data();if(!f.amsSwitcher){b('<i class="fa fa-fw"></i>').prependTo(b(this)).addClass(f.amsSwitcherState=="open"?(f.amsSwitcherMinusClass||"fa-minus"):(f.amsSwitcherPlusClass||"fa-plus"));e.on("click",function(h){h.preventDefault();var g={};e.trigger("ams.switcher.before-switch",[e,g]);if(g.veto){return}if(d.hasClass("switched")){d.removeClass("switched");b(".fa",e).removeClass(f.amsSwitcherPlusClass||"fa-plus").addClass(f.amsSwitcherMinusClass||"fa-minus");e.trigger("ams.switcher.opened",[e]);var i=e.attr("id");if(i){b('legend.switcher[data-ams-switcher-sync="'+i+'"]',d).each(function(){var j=b(this);if(j.parents("fieldset").hasClass("switched")){j.click()}})}}else{d.addClass("switched");b(".fa",e).removeClass(f.amsSwitcherMinusClass||"fa-minus").addClass(f.amsSwitcherPlusClass||"fa-plus");e.trigger("ams.switcher.closed",[e])}});if(f.amsSwitcherState!="open"){d.addClass("switched")}e.data("ams-switcher","on")}})},checker:function(c){b("LEGEND.checker",c).each(function(){var o=b(this);var p=o.parent("fieldset");var f=o.data();if(!f.amsChecker){var d=b('<label class="checkbox"></label>');var i=f.amsCheckerFieldname||("checker_"+a.generateId());var m=i.replace(/\./,"_");var g=f.amsCheckerHiddenPrefix;var h=null;var l=f.amsCheckerHiddenValueOn||"true";var j=f.amsCheckerHiddenValueOff||"false";var e=f.amsCheckerMarker||false;if(g){h=b('<input type="hidden">').attr("name",g+i).val(f.amsCheckerState=="on"?l:j).prependTo(o)}else{if(e){b('<input type="hidden">').attr("name",e).attr("value",1).prependTo(o)}}var n=b('<input type="checkbox">').attr("name",i).attr("id",m).data("ams-checker-hidden-input",h).data("ams-checker-init",true).val(f.amsCheckerValue||true).attr("checked",f.amsCheckerState=="on"?"checked":null);if(f.amsCheckerReadonly){n.attr("disabled","disabled")}else{n.on("change",function(s){s.preventDefault();var q={};var t=b(this).is(":checked");o.trigger("ams.checker.before-switch",[o,q]);if(q.veto){b(this).prop("checked",!t);return}a.executeFunctionByName(f.amsCheckerChangeHandler,o,t);if(!f.amsCheckerCancelDefault){var r=n.data("ams-checker-hidden-input");if(t){if(f.amsCheckerMode=="disable"){p.removeAttr("disabled")}else{p.removeClass("switched")}if(r){r.val(l)}b("[data-required]",p).attr("required","required");o.trigger("ams.checker.opened",[o])}else{if(f.amsCheckerMode=="disable"){p.prop("disabled","disabled")}else{p.addClass("switched")}if(r){r.val(j)}b("[data-required]",p).removeAttr("required");o.trigger("ams.checker.closed",[o])}}})}n.appendTo(d);b(">label",o).attr("for",n.attr("id"));d.append("<i></i>").prependTo(o);var k=b("[required]",p);k.attr("data-required",true);if(f.amsCheckerState=="on"){n.attr("checked",true)}else{if(f.amsCheckerMode=="disable"){p.attr("disabled","disabled")}else{p.addClass("switched")}k.removeAttr("required")}o.data("ams-checker","on")}})},slider:function(c){var d=b(".slider",c);if(d.length>0){a.ajax.check(b.fn.slider,a.baseURL+"ext/bootstrap-slider.min.js",function(){d.each(function(){var h=b(this);var i=h.data();var f={};var e=b.extend({},f,h.data.amsSliderOptions);e=a.executeFunctionByName(i.amsSliderInitCallback,h,e)||e;var g=h.slider(e);a.executeFunctionByName(i.amsSliderAfterInitCallback,h,g,e)})})}},draggable:function(d){var c=b(".draggable",d);if(c.length>0){c.each(function(){var e=b(this);var i=e.data();var g={containment:i.amsDraggableContainment,helper:a.getFunctionByName(i.amsDraggableHelper)||i.amsDraggableHelper,start:a.getFunctionByName(i.amsDraggableStart),stop:a.getFunctionByName(i.amsDraggableStop)};var f=b.extend({},g,i.amsDraggableOptions);f=a.executeFunctionByName(i.amsDraggableInitCallback,e,f)||f;var h=e.draggable(f);e.disableSelection();a.executeFunctionByName(i.amsDraggableAfterInitCallback,e,h,f)})}},sortable:function(c){var d=b(".sortable",c);if(d.length>0){d.each(function(){var i=b(this);var h=i.data();var f={items:h.amsSortableItems,handle:h.amsSortableHandle,connectWith:h.amsSortableConnectwith,start:a.getFunctionByName(h.amsSortableStart),over:a.getFunctionByName(h.amsSortableOver),containment:h.amsSortableContainment,placeholder:h.amsSortablePlaceholder,stop:a.getFunctionByName(h.amsSortableStop)};var e=b.extend({},f,h.amsSortableOptions);e=a.executeFunctionByName(h.amsSortableInitCallback,i,e)||e;var g=i.sortable(e);i.disableSelection();a.executeFunctionByName(h.amsSortableAfterInitCallback,i,g,e)})}},resizable:function(d){var c=b(".resizable",d);if(c.length>0){c.each(function(){var e=b(this);var i=e.data();var g={autoHide:i.amsResizableAutohide===false?true:i.amsResizableAutohide,containment:i.amsResizableContainment,grid:i.amsResizableGrid,handles:i.amsResizableHandles,start:a.getFunctionByName(i.amsResizableStart),stop:a.getFunctionByName(i.amsResizableStop)};var f=b.extend({},g,i.amsResizableOptions);f=a.executeFunctionByName(i.amsResizableInitCallback,e,f)||f;var h=e.resizable(f);e.disableSelection();a.executeFunctionByName(i.amsResizableAfterInitCallback,e,h,f)})}},typeahead:function(d){var c=b(".typeahead",d);if(c.length>0){a.ajax.check(b.fn.typeahead,a.baseURL+"ext/jquery-typeahead"+a.devext+".js",function(){c.each(function(){var e=b(this);var i=e.data();var g={};var f=b.extend({},g,i.amsTypeaheadOptions);f=a.executeFunctionByName(i.amsTypeaheadInitCallback,e,f)||f;var h=e.typeahead(f);a.executeFunctionByName(i.amsTypeaheadAfterInitCallback,e,h,f)})})}},select2:function(d){var c=b(".select2",d);if(c.length>0){a.ajax.check(b.fn.select2,a.baseURL+"ext/jquery-select2-3.5.2"+a.devext+".js",function(){c.each(function(){var e=b(this);var j=e.data();var h={placeholder:j.amsSelect2Placeholder,multiple:j.amsSelect2Multiple,minimumInputLength:j.amsSelect2MinimumInputLength||0,maximumSelectionSize:j.amsSelect2MaximumSelectionSize,openOnEnter:j.amsSelect2EnterOpen===undefined?true:j.amsSelect2EnterOpen,allowClear:j.amsSelect2AllowClear===undefined?true:j.amsSelect2AllowClear,width:j.amsSelect2Width||"100%",initSelection:a.getFunctionByName(j.amsSelect2InitSelection),formatSelection:j.amsSelect2FormatSelection===undefined?a.helpers.select2FormatSelection:a.getFunctionByName(j.amsSelect2FormatSelection),formatResult:a.getFunctionByName(j.amsSelect2FormatResult),formatMatches:j.amsSelect2FormatMatches===undefined?function(k){if(k==1){return a.i18n.SELECT2_MATCH}else{return k+a.i18n.SELECT2_MATCHES}}:a.getFunctionByName(j.amsSelect2FormatMatches),formatNoMatches:j.amsSelect2FormatResult===undefined?function(k){return a.i18n.SELECT2_NOMATCHES}:a.getFunctionByName(j.amsSelect2FormatResult),formatInputTooShort:j.amsSelect2FormatInputTooShort===undefined?function(k,l){var m=l-k.length;return a.i18n.SELECT2_INPUT_TOOSHORT.replace(/\{0\}/,m).replace(/\{1\}/,m==1?"":a.i18n.SELECT2_PLURAL)}:a.getFunctionByName(j.amsSelect2FormatInputTooShort),formatInputTooLong:j.amsSelect2FormatInputTooLong===undefined?function(l,k){var m=l.length-k;return a.i18n.SELECT2_INPUT_TOOLONG.replace(/\{0\}/,m).replace(/\{1\}/,m==1?"":a.i18n.SELECT2_PLURAL)}:a.getFunctionByName(j.amsSelect2FormatInputTooLong),formatSelectionTooBig:j.amsSelect2FormatSelectionTooBig===undefined?function(k){return a.i18n.SELECT2_SELECTION_TOOBIG.replace(/\{0\}/,k).replace(/\{1\}/,k==1?"":a.i18n.SELECT2_PLURAL)}:a.getFunctionByName(j.amsSelect2FormatSelectionTooBig),formatLoadMore:j.amsSelect2FormatLoadMore===undefined?function(k){return a.i18n.SELECT2_LOADMORE}:a.getFunctionByName(j.amsSelect2FormatLoadMore),formatSearching:j.amsSelect2FormatSearching===undefined?function(){return a.i18n.SELECT2_SEARCHING}:a.getFunctionByName(j.amsSelect2FormatSearching),separator:j.amsSelect2Separator||",",tokenSeparators:j.amsSelect2TokensSeparators||[","],tokenizer:a.getFunctionByName(j.amsSelect2Tokenizer)};switch(e.context.type){case"text":case"hidden":if(!h.initSelection){var f=e.data("ams-select2-values");if(f){h.initSelection=function(k,m){var l=[];b(k.val().split(h.separator)).each(function(){l.push({id:this,text:f[this]||this})});m(l)}}}break;default:break}if(e.attr("readonly")){if(e.attr("type")=="hidden"){h.query=function(){return[]}}}else{if(j.amsSelect2Query){h.query=a.getFunctionByName(j.amsSelect2Query);h.minimumInputLength=j.amsSelect2MinimumInputLength||1}else{if(j.amsSelect2QueryUrl){h.ajax={url:j.amsSelect2QueryUrl,quietMillis:j.amsSelect2QuietMillis||200,type:j.amsSelect2QueryType||"POST",dataType:j.amsSelect2QueryDatatype||"json",data:function(m,n,l){var k={};k[j.amsSelect2QueryParamName||"query"]=m;k[j.amsSelect2PageParamName||"page"]=n;k[j.amsSelect2ContextParamName||"context"]=l;return b.extend({},k,j.amsSelect2QueryOptions)},results:a.helpers.select2QueryUrlResultsCallback};h.minimumInputLength=j.amsSelect2MinimumInputLength||1}else{if(j.amsSelect2QueryMethod){h.query=function(k){var l={id:new Date().getTime(),params:j.amsSelect2QueryParams||{},success:function(m){return a.helpers.select2QueryMethodSuccessCallback.call(e,m,"success",k)},error:a.error.show};l.params[j.amsSelect2QueryParamName||"query"]=k.term;l.params[j.amsSelect2PageParamName||"page"]=k.page;l.params[j.amsSelect2ContextParamName||"context"]=k.context;l=b.extend({},l,j.amsSelect2QueryOptions);l=a.executeFunctionByName(j.amsSelect2QueryInitCallback,e,l)||l;a.ajax.check(b.jsonRPC,a.baseURL+"ext/jquery-jsonrpc"+a.devext+".js",function(){b.jsonRPC.withOptions({endPoint:j.amsSelect2MethodTarget||a.jsonrpc.getAddr(),namespace:j.amsSelect2MethodNamespace,cache:false},function(){b.jsonRPC.request(j.amsSelect2QueryMethod,l)})})};h.minimumInputLength=j.amsSelect2MinimumInputLength||1}else{if(j.amsSelect2Tags){h.tags=j.amsSelect2Tags}else{if(j.amsSelect2Data){h.data=j.amsSelect2Data}}}}}}if(j.amsSelect2EnableFreeTags){h.createSearchChoice=function(k){return{id:k,text:(j.amsSelect2FreeTagsPrefix||a.i18n.SELECT2_FREETAG_PREFIX)+k}}}var g=b.extend({},h,j.amsSelect2Options);g=a.executeFunctionByName(j.amsSelect2InitCallback,e,g)||g;var i=e.select2(g);a.executeFunctionByName(j.amsSelect2AfterInitCallback,e,i,g);if(e.hasClass("ordered")){a.ajax.check(b.fn.select2Sortable,a.baseURL+"ext/jquery-select2-sortable"+a.devext+".js",function(){e.select2Sortable({bindOrder:"sortableStop"})})}e.on("change",function(){var k=b(e.get(0).form).data("validator");if(k!==undefined){b(e).valid()}})})})}},maskedit:function(d){var c=b("[data-mask]",d);if(c.length>0){a.ajax.check(b.fn.mask,a.baseURL+"ext/jquery-maskedinput-1.3.1.min.js",function(){c.each(function(){var e=b(this);var i=e.data();var g={placeholder:i.amsMaskeditPlaceholder||"X"};var f=b.extend({},g,i.amsMaskeditOptions);f=a.executeFunctionByName(i.amsMaskeditInitCallback,e,f)||f;var h=e.mask(e.attr("data-mask"),f);a.executeFunctionByName(i.amsMaskeditAfterInitCallback,e,h,f)})})}},datepicker:function(c){var d=b(".datepicker",c);if(d.length>0){a.ajax.check(b.fn.datetimepicker,a.baseURL+"ext/jquery-datetimepicker"+a.devext+".js",function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-datetimepicker"+a.devext+".css","jquery-datetimepicker");a.dialog.registerHideCallback(a.helpers.datetimepickerDialogHiddenCallback)}d.each(function(){var f=b(this);var j=f.data();var h={lang:j.amsDatetimepickerLang||a.lang,format:j.amsDatetimepickerFormat||"d/m/y",datepicker:true,dayOfWeekStart:1,timepicker:false};var g=b.extend({},h,j.amsDatetimepickerOptions);g=a.executeFunctionByName(j.amsDatetimepickerInitCallback,f,g)||g;var i=f.datetimepicker(g);a.executeFunctionByName(j.amsDatetimepickerAfterInitCallback,f,i,g)})})}},datetimepicker:function(d){var c=b(".datetimepicker",d);if(c.length>0){a.ajax.check(b.fn.datetimepicker,a.baseURL+"ext/jquery-datetimepicker"+a.devext+".js",function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-datetimepicker"+a.devext+".css","jquery-datetimepicker");a.dialog.registerHideCallback(a.helpers.datetimepickerDialogHiddenCallback)}c.each(function(){var f=b(this);var j=f.data();var h={lang:j.amsDatetimepickerLang||a.lang,format:j.amsDatetimepickerFormat||"d/m/y H:i",datepicker:true,dayOfWeekStart:1,timepicker:true};var g=b.extend({},h,j.amsDatetimepickerOptions);g=a.executeFunctionByName(j.amsDatetimepickerInitCallback,f,g)||g;var i=f.datetimepicker(g);a.executeFunctionByName(j.amsDatetimepickerAfterInitCallback,f,i,g)})})}},timepicker:function(d){var c=b(".timepicker",d);if(c.length>0){a.ajax.check(b.fn.datetimepicker,a.baseURL+"ext/jquery-datetimepicker"+a.devext+".js",function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-datetimepicker"+a.devext+".css","jquery-datetimepicker");a.dialog.registerHideCallback(a.helpers.datetimepickerDialogHiddenCallback)}c.each(function(){var f=b(this);var j=f.data();var h={lang:j.amsDatetimepickerLang||a.lang,format:j.amsDatetimepickerFormat||"H:i",datepicker:false,timepicker:true};var g=b.extend({},h,j.amsDatetimepickerOptions);g=a.executeFunctionByName(j.amsDatetimepickerInitCallback,f,g)||g;var i=f.datetimepicker(g);a.executeFunctionByName(j.amsDatetimepickerAfterInitCallback,f,i,g)})})}},colorpicker:function(c){var d=b(".colorpicker",c);if(d.length>0){a.ajax.check(b.fn.minicolors,a.baseURL+"ext/jquery-minicolors"+a.devext+".js",function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-minicolors"+a.devext+".css","jquery-minicolors")}d.each(function(){var f=b(this);var j=f.data();var h={position:j.amsColorpickerPosition||f.closest("label.input").data("ams-colorpicker-position")||"bottom left"};var g=b.extend({},h,j.amsColorpickerOptions);g=a.executeFunctionByName(j.amsColorpickerInitCallback,f,g)||g;var i=f.minicolors(g);a.executeFunctionByName(j.amsDatetimepickerAfterInitCallback,f,i,g)})})}},validate:function(d){var c=b("FORM:not([novalidate])",d);if(c.length>0){a.ajax.check(b.fn.validate,a.baseURL+"ext/jquery-validate-1.11.1"+a.devext+".js",function(g){if(g){b.validator.setDefaults({highlight:function(h){b(h).closest(".form-group, label:not(:parents(.form-group))").addClass("state-error")},unhighlight:function(h){b(h).closest(".form-group, label:not(:parents(.form-group))").removeClass("state-error")},errorElement:"span",errorClass:"state-error",errorPlacement:function(i,j){var h=j.parents("label:first");if(h.length){i.insertAfter(h)}else{i.insertAfter(j)}}});if(a.plugins.i18n){for(var e in a.plugins.i18n.validate){var f=a.plugins.i18n.validate[e];if((typeof(f)=="string")&&(f.indexOf("{0}")>-1)){a.plugins.i18n.validate[e]=b.validator.format(f)}}b.extend(b.validator.messages,a.plugins.i18n.validate)}}c.each(function(){var k=b(this);var l=k.data();var i={ignore:null,submitHandler:k.attr("data-async")!==undefined?l.amsFormSubmitHandler===undefined?function(){b(".state-error",k).removeClass("state-error");a.ajax.check(b.fn.ajaxSubmit,a.baseURL+"ext/jquery-form-3.49"+a.devext+".js");return a.form.submit(k)}:a.getFunctionByName(l.amsFormSubmitHandler):undefined,invalidHandler:k.attr("data-async")!==undefined?l.amsFormInvalidHandler===undefined?function(q,p){b(".state-error",k).removeClass("state-error");for(var n in p.errorList){var m=p.errorList[n];var o=b(m.element).parents(".tab-pane").index()+1;if(o>0){var r=b(".nav-tabs",b(m.element).parents(".tabforms"));b("li:nth-child("+o+")",r).removeClassPrefix("state-").addClass("state-error");b("li.state-error:first a",r).click()}}}:a.getFunctionByName(l.amsFormInvalidHandler):undefined};var h=b.extend({},i,l.amsValidateOptions);h=a.executeFunctionByName(l.amsValidateInitCallback,k,h)||h;var j=k.validate(h);a.executeFunctionByName(l.amsValidateAfterInitCallback,k,j,h)})})}},datatable:function(d){var c=b(".datatable",d);if(c.length>0){a.ajax.check(b.fn.dataTable,a.baseURL+"ext/jquery-dataTables-1.9.4"+a.devext+".js",function(e){if(e){b.fn.dataTableExt.oSort["numeric-comma-asc"]=function(h,g){var f=h.replace(/,/,".").replace(/ /g,"");var i=g.replace(/,/,".").replace(/ /g,"");f=parseFloat(f);i=parseFloat(i);return((f<i)?-1:((f>i)?1:0))};b.fn.dataTableExt.oSort["numeric-comma-desc"]=function(h,g){var f=h.replace(/,/,".").replace(/ /g,"");var i=g.replace(/,/,".").replace(/ /g,"");f=parseFloat(f);i=parseFloat(i);return((f<i)?1:((f>i)?-1:0))}}b(c).each(function(){a.ajax.check(b.fn.dataTableExt.oPagination.bootstrap_full,a.baseURL+"myams-dataTables"+a.devext+".js");var u=b(this);var x=u.data();var w=(x.amsDatatableExtensions||"").split(/\s+/);var h=x.amsDatatableSdom||"W"+((w.indexOf("colreorder")>=0||w.indexOf("colreorderwithresize")>=0)?"R":"")+"<'dt-top-row'"+(w.indexOf("colvis")>=0?"C":"")+((x.amsDatatablePagination===false||x.amsDatatablePaginationSize===false)?"":"L")+(x.amsDatatableGlobalFilter===false?"":"F")+">r<'dt-wrapper't"+(w.indexOf("scroller")>=0?"S":"")+"><'dt-row dt-bottom-row'<'row'<'col-sm-6'"+(x.amsDatatableInformation===false?"":"i")+"><'col-sm-6 text-right'p>>";var r={bJQueryUI:false,bFilter:x.amsDatatableGlobalFilter!==false,bPaginate:x.amsDatatablePagination!==false,bInfo:x.amsDatatableInfo!==false,bSort:x.amsDatatableSort!==false,aaSorting:x.amsDatatableSorting,bDeferRender:true,bAutoWidth:false,iDisplayLength:x.amsDatatableDisplayLength||25,sPaginationType:x.amsDatatablePaginationType||"bootstrap_full",sDom:h,oLanguage:a.plugins.i18n.datatables,fnInitComplete:function(A,z){b(".ColVis_Button").addClass("btn btn-default btn-sm").html((a.plugins.i18n.datatables.sColumns||"Columns")+' <i class="fa fa-fw fa-caret-down"></i>')}};var v=b.extend({},r,x.amsDatatableOptions);var j;if(w.length>0){for(j in w){switch(w[j]){case"autofill":a.ajax.check(b.fn.dataTable.AutoFill,a.baseURL+"ext/jquery-dataTables-autoFill"+a.devext+".js");break;case"columnfilter":a.ajax.check(b.fn.columnFilter,a.baseURL+"ext/jquery-dataTables-columnFilter"+a.devext+".js");break;case"colreorder":a.ajax.check(b.fn.dataTable.ColReorder,a.baseURL+"ext/jquery-dataTables-colReorder"+a.devext+".js");break;case"colreorderwithresize":a.ajax.check(b.fn.dataTable.ColReorder,a.baseURL+"ext/jquery-dataTables-colReorderWithResize"+a.devext+".js");break;case"colvis":a.ajax.check(b.fn.dataTable.ColVis,a.baseURL+"ext/jquery-dataTables-colVis"+a.devext+".js");var n={activate:"click",sAlign:"right"};v.oColVis=b.extend({},n,x.amsDatatableColvisOptions);break;case"editable":a.ajax.check(b.fn.editable,a.baseURL+"ext/jquery-jeditable"+a.devext+".js");a.ajax.check(b.fn.makeEditable,a.baseURL+"ext/jquery-dataTables-editable"+a.devext+".js");break;case"fixedcolumns":a.ajax.check(b.fn.dataTable.FixedColumns,a.baseURL+"ext/jquery-dataTables-fixedColumns"+a.devext+".js");break;case"fixedheader":a.ajax.check(b.fn.dataTable.FixedHeader,a.baseURL+"ext/jquery-dataTables-fixedHeader"+a.devext+".js");break;case"keytable":a.ajax.check(window.KeyTable,a.baseURL+"ext/jquery-dataTables-keyTable"+a.devext+".js");break;case"rowgrouping":a.ajax.check(b.fn.rowGrouping,a.baseURL+"ext/jquery-dataTables-rowGrouping"+a.devext+".js");break;case"rowreordering":a.ajax.check(b.fn.rowReordering,a.baseURL+"ext/jquery-dataTables-rowReordering"+a.devext+".js");break;case"scroller":a.ajax.check(b.fn.dataTable.Scroller,a.baseURL+"ext/jquery-dataTables-scroller"+a.devext+".js");break;default:break}}}v=a.executeFunctionByName(x.amsDatatableInitCallback,u,v)||v;var g=u.dataTable(v);a.executeFunctionByName(x.amsDatatableAfterInitCallback,u,g,v);if(w.length>0){for(j in w){switch(w[j]){case"autofill":var y=b.extend({},x.amsDatatableAutofillOptions,v.autofill);y=a.executeFunctionByName(x.amsDatatableAutofillInitCallback,u,y)||y;u.data("ams-autofill",x.amsDatatableAutofillConstructor===undefined?new b.fn.dataTable.AutoFill(u,y):a.executeFunctionByName(x.amsDatatableAutofillConstructor,u,g,y));break;case"columnfilter":var k={sPlaceHolder:"head:after"};var l=b.extend({},k,x.amsDatatableColumnfilterOptions,v.columnfilter);l=a.executeFunctionByName(x.amsDatatableColumnfilterInitCallback,u,l)||l;u.data("ams-columnfilter",x.amsDatatableColumnfilterConstructor===undefined?g.columnFilter(l):a.executeFunctionByName(x.amsDatatableColumnfilterConstructor,u,g,l));break;case"editable":var m=b.extend({},x.amsDatatableEditableOptions,v.editable);m=a.executeFunctionByName(x.amsDatatableEditableInitCallback,u,m)||m;u.data("ams-editable",x.amsDatatableEditableConstructor===undefined?u.makeEditable(m):a.executeFunctionByName(x.amsDatatableEditableConstructor,u,g,m));break;case"fixedcolumns":var f=b.extend({},x.amsDatatableFixedcolumnsOptions,v.fixedcolumns);f=a.executeFunctionByName(x.amsDatatableFixedcolumnsInitCallback,u,f)||f;u.data("ams-fixedcolumns",x.amsDatatableFixedcolumnsConstructor===undefined?new b.fn.dataTable.FixedColumns(u,f):a.executeFunctionByName(x.amsDatatableFixedcolumnsConstructor,u,g,f));break;case"fixedheader":var s=b.extend({},x.amsDatatableFixedheaderOptions,v.fixedheader);s=a.executeFunctionByName(x.amsDatatableFixedheadeInitCallback,u,s)||s;u.data("ams-fixedheader",x.amsDatatableFixedheaderConstructor===undefined?new b.fn.dataTable.FixedHeader(u,s):a.executeFunctionByName(x.amsDatatableFixedheaderConstructor,u,g,s));break;case"keytable":var i={table:u.get(0),datatable:g};var q=b.extend({},i,x.amsDatatableKeytableOptions,v.keytable);q=a.executeFunctionByName(x.amsDatatableKeytableInitCallback,u,q)||q;u.data("ams-keytable",x.amsDatatableKeytableConstructor===undefined?new KeyTable(q):a.executeFunctionByName(x.amsDatatableKeytableConstructor,u,g,q));break;case"rowgrouping":var p=b.extend({},x.amsDatatableRowgroupingOptions,v.rowgrouping);p=a.executeFunctionByName(x.amsDatatableRowgroupingInitCallback,u,p)||p;u.data("ams-rowgrouping",x.amsDatatableRowgroupingConstructor===undefined?u.rowGrouping(p):a.executeFunctionByName(x.amsDatatableRowgroupingConstructor,u,g,p));break;case"rowreordering":var o=b.extend({},x.amsDatatableRowreorderingOptions,v.rowreordering);o=a.executeFunctionByName(x.amsDatatableRowreorderingInitCallback,u,o)||o;u.data("ams-rowreordering",x.amsDatatableRowreorderingConstructor===undefined?u.rowReordering(o):a.executeFunctionByName(x.amsDatatableRowreorderingConstructor,u,g,o));break;default:break}}}var t=(x.amsDatatableFinalizeCallback||"").split(/\s+/);if(t.length>0){for(j in t){a.executeFunctionByName(t[j],u,g,v)}}})})}},tablednd:function(d){var c=b(".table-dnd",d);if(c.length>0){a.ajax.check(b.fn.tableDnD,a.baseURL+"ext/jquery-tablednd"+a.devext+".js",function(e){c.each(function(){var i=b(this);b(i).on("mouseover","tr",function(){b(this.cells[0]).addClass("drag-handle")}).on("mouseout","tr",function(){b(this.cells[0]).removeClass("drag-handle")});var j=i.data();var g={onDragClass:j.amsTabledndDragClass||"dragging-row",onDragStart:j.amsTabledndDragStart,dragHandle:j.amsTabledndDragHandle,scrollAmount:j.amsTabledndScrollAmount,onAllowDrop:j.amsTabledndAllowDrop,onDrop:j.amsTabledndDrop||function(m,o){var l=j.amsTabledndDropTarget;if(l){var k=[];b(m.rows).each(function(){var p=b(this).data("ams-element-name");if(p){k.push(p)}});var n=a.getFunctionByName(l);if(typeof(n)=="function"){n.call(i,m,k)}else{a.ajax.post(l,{names:JSON.stringify(k)})}}return false}};var f=b.extend({},g,j.amsTabledndOptions);f=a.executeFunctionByName(j.amsTabledndInitCallback,i,f)||f;var h=i.tableDnD(f);a.executeFunctionByName(j.amsTabledndAfterInitCallback,i,h,f)})})}},tinymce:function(c){function f(){b(".tinymce",b(this)).each(function(){var g=tinymce.get(b(this).attr("id"));if(g){g.remove()}})}var d=b(".tinymce",c);if(d.length>0){var e=a.baseURL+"ext/tinymce"+(a.devmode?"/dev":"");a.ajax.check(window.tinymce,e+"/tinymce"+a.devext+".js",function(g){if(g){a.getScript(e+"/jquery.tinymce"+a.devext+".js");tinymce.baseURL=e;tinymce.suffix=a.devext;a.skin.registerCleanCallback(f)}d.each(function(){var k=b(this);var n=k.data();var j={theme:"modern",language:a.lang,plugins:["advlist autosave autolink lists link image charmap print preview hr anchor pagebreak","searchreplace wordcount visualblocks visualchars code fullscreen","insertdatetime media nonbreaking save table contextmenu directionality","emoticons paste textcolor colorpicker textpattern"],toolbar1:"newdocument undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",toolbar2:"print preview media | forecolor backcolor emoticons | code fullscreen",content_css:n.amsTinymceContentCss,formats:n.amsTinymceFormats,style_formats:n.amsTinymceStyleFormats,block_formats:n.amsTinymceBlockFormats,valid_classes:n.amsTinymceValidClasses,image_advtab:true,image_list:a.getFunctionByName(n.amsTinymceImageList)||n.amsTinymceImageList,image_class_list:n.amsTinymceImageClassList,link_list:a.getFunctionByName(n.amsTinymceLinkList)||n.amsTinymceLinkList,link_class_list:n.amsTinymceLinkClassList,resize:true};if(n.amsTinymceExternalPlugins){var o=n.amsTinymceExternalPlugins.split(/\s+/);for(var h in o){var m=k.data("ams-tinymce-plugin-"+o[h]);tinymce.PluginManager.load(o[h],a.getSource(m))}}var i=b.extend({},j,n.amsTinymceOptions);i=a.executeFunctionByName(n.amsTinymceInitCallback,k,i)||i;var l=k.tinymce(i);a.executeFunctionByName(n.amsTinymceAfterInitCallback,k,l,i)})})}},imgareaselect:function(d){var c=b(".imgareaselect",d);if(c.length>0){a.ajax.check(b.fn.imgAreaSelect,a.baseURL+"ext/jquery-imgareaselect-0.9.10"+a.devext+".js",function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-imgareaselect"+a.devext+".css")}c.each(function(){var k=b(this);var j=k.data();var h=j.amsImgareaselectParent?k.parents(j.amsImgareaselectParent):"body";var g={instance:true,handles:true,parent:h,x1:j.amsImgareaselectX1||0,y1:j.amsImgareaselectY1||0,x2:j.amsImgareaselectX2||j.amsImgareaselectImageWidth,y2:j.amsImgareaselectY2||j.amsImgareaselectImageHeight,imageWidth:j.amsImgareaselectImageWidth,imageHeight:j.amsImgareaselectImageHeight,minWidth:128,minHeight:128,aspectRatio:j.amsImgareaselectRatio,onSelectEnd:a.getFunctionByName(j.amsImgareaselectSelectEnd)||function(l,m){var n=j.amsImgareaselectTargetField||"image_";b('input[name="'+n+'x1"]',h).val(m.x1);b('input[name="'+n+'y1"]',h).val(m.y1);b('input[name="'+n+'x2"]',h).val(m.x2);b('input[name="'+n+'y2"]',h).val(m.y2)}};var f=b.extend({},g,j.amsImgareaselectOptions);f=a.executeFunctionByName(j.amsImgareaselectInitCallback,k,f)||f;var i=k.imgAreaSelect(f);a.executeFunctionByName(j.amsImgareaselectAfterInitCallback,k,i,f);setTimeout(function(){i.update()},250)})})}},fancybox:function(c){var d=b(".fancybox",c);if(d.length>0){a.ajax.check(b.fn.fancybox,a.baseURL+"ext/jquery-fancybox-2.1.5"+a.devext+".js",function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-fancybox-2.1.5"+a.devext+".css")}d.each(function(){var f=b(this);var m=f.data();var l=(m.amsFancyboxHelpers||"").split(/\s+/);if(l.length>0){for(var g in l){var k=l[g];switch(k){case"buttons":a.ajax.check(b.fancybox.helpers.buttons,a.baseURL+"ext/fancybox-helpers/fancybox-buttons"+a.devext+".js");break;case"thumbs":a.ajax.check(b.fancybox.helpers.thumbs,a.baseURL+"ext/fancybox-helpers/fancybox-thumbs"+a.devext+".js");break;case"media":a.ajax.check(b.fancybox.helpers.media,a.baseURL+"ext/fancybox-helpers/fancybox-media"+a.devext+".js");break;default:break}}}var i={type:m.amsFancyboxType,padding:m.amsFancyboxPadding||10,margin:m.amsFancyboxMargin||10,beforeLoad:a.getFunctionByName(m.amsFancyboxBeforeLoad)||function(){this.title=a.executeFunctionByName(m.amsFancyboxTitleGetter,this)||b(this.element).attr("original-title")||b(this.element).attr("title")},helpers:{title:{type:"inside"}}};var h=b.extend({},i,m.amsFancyboxOptions);h=a.executeFunctionByName(m.amsFancyboxInitCallback,f,h)||h;var j=f.fancybox(h);a.executeFunctionByName(m.amsFancyboxAfterInitCallback,f,j,h)})})}},graphs:function(d){var c=b(".sparkline",d);if(c.length>0){a.ajax.check(a.graphs,a.baseURL+"myams-graphs"+a.devext+".js",function(){a.graphs.init(c)})}},scrollbars:function(c){var d=b(".scrollbar",c);if(d.length>0){a.ajax.check(b.event.special.mousewheel,a.baseURL+"ext/jquery-mousewheel.min.js",function(){a.ajax.check(b.fn.mCustomScrollbar,a.baseURL+"ext/jquery-mCustomScrollbar"+a.devext+".js",function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-mCustomScrollbar.css","jquery-mCustomScrollbar")}d.each(function(){var j=b(this);var i=j.data();var g={theme:i.amsScrollbarTheme||"light"};var f=b.extend({},g,i.amsScrollbarOptions);f=a.executeFunctionByName(i.amsScrollbarInitCallback,j,f)||f;var h=j.mCustomScrollbar(f);a.executeFunctionByName(i.amsScrollbarAfterInitCallback,j,h,f)})})})}}}};MyAMS.callbacks={init:function(c){b("[data-ams-callback]",c).each(function(){var d=this;var e=b(d).data();var f=a.getFunctionByName(e.amsCallback);if(f===undefined){if(e.amsCallbackSource){a.getScript(e.amsCallbackSource,function(){a.executeFunctionByName(e.amsCallback,d,e.amsCallbackOptions)})}else{if(window.console){console.warn("Undefined callback: "+e.amsCallback)}}}else{f.call(d,e.amsCallbackOptions)}})},alert:function(k){var f=b(this).data();var c=b.extend({},k,f.amsAlertOptions);var i=b(f.amsAlertParent||c.parent||this);var e=f.amsAlertStatus||c.status||"info";var g=f.amsAlertHeader||c.header;var j=f.amsAlertMessage||c.message;var h=f.amsAlertSubtitle||c.subtitle;var d=f.amsAlertMargin===undefined?(c.margin===undefined?false:c.margin):f.amsAlertMargin;a.skin.alert(i,e,g,j,h,d)},messageBox:function(d){var g=b(this).data();var f=b.extend({},d,g.amsMessageboxOptions);var e=b.extend({},f,{title:g.amsMessageboxTitle||f.title||"",content:g.amsMessageboxContent||f.content||"",icon:g.amsMessageboxIcon||f.icon,number:g.amsMessageboxNumber||f.number,timeout:g.amsMessageboxTimeout||f.timeout});var c=g.amsMessageboxStatus||f.status||"info";var h=a.getFunctionByName(g.amsMessageboxCallback||f.callback);a.skin.messageBox(c,e,h)},smallBox:function(d){var g=b(this).data();var f=b.extend({},d,g.amsSmallboxOptions);var e=b.extend({},f,{title:g.amsSmallboxTitle||f.title||"",content:g.amsSmallboxContent||f.content||"",icon:g.amsSmallboxIcon||f.icon,iconSmall:g.amsSmallboxIconSmall||f.iconSmall,timeout:g.amsSmallboxTimeout||f.timeout});var c=g.amsSmallboxStatus||f.status||"info";var h=a.getFunctionByName(g.amsSmallboxCallback||f.callback);a.skin.smallBox(c,e,h)}};MyAMS.events={init:function(c){b("[data-ams-events-handlers]",c).each(function(){var e=b(this);var d=e.data("ams-events-handlers");for(var f in d){e.on(f,a.getFunctionByName(d[f]))}})}};MyAMS.container={changeOrder:function(d,e){var c=b('input[name="'+b(this).data("ams-input-name")+'"]',b(this));c.val(e.join(";"))},deleteElement:function(c){return function(){var d=b(this);MyAMS.skin.bigBox({title:a.i18n.WARNING,content:'<i class="text-danger fa fa-2x fa-bell shake animated"></i>&nbsp; '+a.i18n.DELETE_WARNING,buttons:a.i18n.BTN_OK_CANCEL},function(g){if(g==a.i18n.BTN_OK){var i=d.parents("table");var f=i.data("ams-location")||"";var j=d.parents("tr");var h=j.data("ams-delete-target")||i.data("ams-delete-target")||"delete-element.json";var e=j.data("ams-element-name");MyAMS.ajax.post(f+"/"+h,{object_name:e},function(k,l){if(k.status=="success"){if(i.hasClass("datatable")){i.dataTable().fnDeleteRow(j[0])}else{j.remove()}}})}})}}};MyAMS.skin={_setPageHeight:function(){var e=b("#main").height();var c=a.left_panel.height();var d=b(window).height()-a.navbar_height;if(e>d){a.left_panel.css("min-height",e);a.root.css("min-height",e+a.navbar_height)}else{a.left_panel.css("min-height",d);a.root.css("min-height",d)}},_checkMobileWidth:function(){if(b(window).width()<979){a.root.addClass("mobile-view-activated")}else{if(a.root.hasClass("mobile-view-activated")){a.root.removeClass("mobile-view-activated")}}},_showShortcutButtons:function(){a.shortcuts.animate({height:"show"},200,"easeOutCirc");a.root.addClass("shortcut-on")},_hideShortcutButtons:function(){a.shortcuts.animate({height:"hide"},300,"easeOutCirc");a.root.removeClass("shortcut-on")},checkNotification:function(){$this=b("#activity > .badge");if(parseInt($this.text())>0){$this.removeClass("hidden").addClass("bg-color-red bounceIn animated")}else{$this.addClass("hidden").removeClass("bg-color-red bounceIn animated")}},_initDesktopWidgets:function(c){if(a.enable_widgets){var d=b(".ams-widget",c);if(d.length>0){a.ajax.check(b.fn.MyAMSWidget,a.baseURL+"myams-widgets"+a.devext+".js",function(){d.each(function(){var h=b(this);var g=h.data();var f={deleteSettingsKey:"#deletesettingskey-options",deletePositionKey:"#deletepositionkey-options"};var e=b.extend({},f,g.amsWidgetOptions);e=a.executeFunctionByName(g.amsWidgetInitcallback,h,e)||e;h.MyAMSWidget(e)});MyAMSWidget.initWidgetsGrid(b(".ams-widget-grid",c))})}}},_initMobileWidgets:function(c){if(a.enable_mobile&&a.enable_widgets){a.skin._initDesktopWidgets(c)}},alert:function(j,d,e,k,i,c){b(".alert",j).remove();if(d=="error"){d="danger"}var g='<div class="'+(c?"margin-10":"")+" alert alert-block alert-"+d+' fade in"><a class="close" data-dismiss="alert"><i class="fa fa-check"></i></a><h4 class="alert-heading"><i class="fa fa-fw fa-warning"></i> '+e+"</h4>"+(i?("<p>"+i+"</p>"):"");if(typeof(k)=="string"){g+="<ul><li>"+k+"</li></ul>"}else{if(k){g+="<ul>";for(var f in k){if(!b.isNumeric(f)){continue}g+="<li>"+k[f]+"</li>"}g+="</ul>"}}g+="</div>";var h=b(g).prependTo(j);if(j.exists){a.ajax.check(b.scrollTo,a.baseURL+"ext/jquery-scrollTo.min.js",function(){b.scrollTo(j,{offset:{top:-50}})})}},bigBox:function(c,d){a.ajax.check(a.notify,a.baseURL+"myams-notify"+a.devext+".js",function(){a.notify.messageBox(c,d)})},messageBox:function(c,d,e){if(typeof(c)=="object"){e=d;d=c||{};c="info"}a.ajax.check(a.notify,a.baseURL+"myams-notify"+a.devext+".js",function(){switch(c){case"error":case"danger":d.color="#C46A69";break;case"warning":d.color="#C79121";break;case"success":d.color="#739E73";break;default:d.color=d.color||"#3276B1"}d.sound=false;a.notify.bigBox(d,e)})},smallBox:function(c,d,e){if(typeof(c)=="object"){e=d;d=c||{};c="info"}a.ajax.check(a.notify,a.baseURL+"myams-notify"+a.devext+".js",function(){switch(c){case"error":case"danger":d.color="#C46A69";break;case"warning":d.color="#C79121";break;case"success":d.color="#739E73";break;default:d.color=d.color||"#3276B1"}d.sound=false;a.notify.smallBox(d,e)})},_drawBreadCrumb:function(){var c=b("#ribbon OL.breadcrumb");c.empty().append(b("<li></li>").append(b("<a></a>").text(a.i18n.HOME).attr("href",b('nav a[href!="#"]:first').attr("href"))));b("nav LI.active >A").each(function(){var f=b(this);var d=b.trim(f.clone().children(".badge").remove().end().text());var e=b("<li></li>").append(f.attr("href").replace(/^#/,"")?b("<a></a>").html(d).attr("href",f.attr("href")):d);c.append(e)})},checkURL:function(){function c(i){b("nav .active").removeClass("active");i.addClass("open").addClass("active");i.parents("li").addClass("open active").children("ul").addClass("active").show();i.parents("li:first").removeClass("open");i.parents("ul").addClass(i.attr("href").replace(/^#/,"")?"active":"").show()}var f=location.hash;var e=f.replace(/^#/,"");if(e){var d=b("#content");if(!d.exists()){d=b("body")}var g=b('nav A[href="'+f+'"]');if(g.exists()){c(g)}a.skin.loadURL(e,d);document.title=b("[data-ams-page-title]:first",d).data("ams-page-title")||g.attr("title")||document.title}else{var h=b("[data-ams-active-menu]").data("ams-active-menu");if(h){g=b('nav A[href="'+h+'"]')}else{g=b('nav >UL >LI >A[href!="#"]').first()}if(g.exists()){c(g);if(h){a.skin._drawBreadCrumb()}else{window.location.hash=g.attr("href")}}}},_clean_callbacks:[],registerCleanCallback:function(d){var c=a.skin._clean_callbacks;if(c.indexOf(d)<0){c.push(d)}},cleanContainer:function(c){var e=a.skin._clean_callbacks;for(var d in e){e[d].call(c)}},loadURL:function(e,c,d,h){if(e.startsWith("#")){e=e.substr(1)}if(typeof(d)=="function"){h=d;d={}}c=b(c);var g={type:"GET",url:e,dataType:"html",cache:false,beforeSend:function(){a.skin.cleanContainer(c);c.html('<h1 class="loading"><i class="fa fa-cog fa-spin"></i> Loading... </h1>');if(c[0]==b("#content")[0]){a.skin._drawBreadCrumb();document.title=b(".breadcrumb LI:last-child").text();b("html, body").animate({scrollTop:0},"fast")}else{c.animate({scrollTop:0},"fast")}},success:function(m,j,l){if(h){a.executeFunctionByName(h,this,m,j,l,d)}else{var k=a.ajax.getResponse(l);var n=k.content_type;var i=k.data;b(".loading",c).remove();switch(n){case"json":a.ajax.handleJSON(i,c);break;case"script":break;case"xml":break;case"html":case"text":default:c.parents(".hidden").removeClass("hidden");b(".alert",c.parents(".alerts-container")).remove();c.css({opacity:"0.0"}).html(m).removeClass("hidden").delay(50).animate({opacity:"1.0"},300);a.initContent(c)}if(d&&d.afterLoadCallback){a.executeFunctionByName(d.afterLoadCallback,this)}}},error:function(k,j,i){c.html('<h3 class="error"><i class="fa fa-warning txt-color-orangeDark"></i> '+a.i18n.ERROR+i+"</h3>"+k.responseText)},async:false};var f=b.extend({},g,d);b.ajax(f)},setLanguage:function(d){var f=d.lang;var e=d.handler_type||"json";switch(e){case"json":var g=d.method||"setUserLanguage";a.jsonrpc.post(g,{lang:f},function(){window.location.reload(true)});break;case"ajax":var c=d.href||"setUserLanguage";a.ajax.post(c,{lang:f},function(){window.location.reload(true)});break}},logout:function(){window.location=a.loginURL}};MyAMS.initPage=function(){var c=b("body");a.root=c;a.left_panel=b("#left-panel");a.shortcuts=b("#shortcut");a.plugins.initData(c);var d=b.ajaxSettings.xhr;b.ajaxSetup({progress:a.ajax.progress,progressUpload:a.ajax.progress,xhr:function(){var f=d();if(f&&(typeof(f.addEventListener)=="function")){var e=this;f.addEventListener("progress",function(g){e.progress(g)},false)}return f}});b(document).ajaxStart(a.ajax.start);b(document).ajaxStop(a.ajax.stop);b(document).ajaxError(a.error.ajax);if(!a.isMobile){a.root.addClass("desktop-detected");a.device="desktop"}else{a.root.addClass("mobile-detected");a.device="mobile";if(a.enable_fastclick){a.ajax.check(b.fn.noClickDelay,a.baseURL+"/ext/jquery-smartclick"+a.devext+".js",function(){b("NAV UL A").noClickDelay();b("#hide-menu A").noClickDelay()})}}b("#hide-menu >:first-child > A").click(function(f){c.toggleClass("hidden-menu");f.preventDefault()});b("#show-shortcut").click(function(f){if(a.shortcuts.is(":visible")){a.skin._hideShortcutButtons()}else{a.skin._showShortcutButtons()}f.preventDefault()});b(document).mouseup(function(f){if(!a.shortcuts.is(f.target)&&a.shortcuts.has(f.target).length===0){a.skin._hideShortcutButtons()}});b("#search-mobile").click(function(){a.root.addClass("search-mobile")});b("#cancel-search-js").click(function(){a.root.removeClass("search-mobile")});b("#activity").click(function(g){var f=b(this);var h=f.next(".ajax-dropdown");if(!h.is(":visible")){h.css("left",f.position().left-h.innerWidth()/2+f.innerWidth()/2).fadeIn(150);f.addClass("active")}else{h.fadeOut(150);f.removeClass("active")}g.preventDefault()});a.skin.checkNotification();b(document).mouseup(function(f){var g=b(".ajax-dropdown");if(!g.is(f.target)&&g.has(f.target).length===0){g.fadeOut(150).prev().removeClass("active")}});b('input[name="activity"]').change(function(){var e=b(this).data("ams-url");container=b(".ajax-notifications");a.skin.loadURL(e,container)});b("#logout a").click(function(f){f.preventDefault();f.stopPropagation();a.loginURL=b(this).attr("href");a.skin.bigBox({title:"<i class='fa fa-sign-out txt-color-orangeDark'></i> "+a.i18n.LOGOUT+" <span class='txt-color-orangeDark'><strong>"+b("#show-shortcut").text()+"</strong></span> ?",content:a.i18n.LOGOUT_COMMENT,buttons:"["+a.i18n.BTN_NO+"]["+a.i18n.BTN_YES+"]"},function(e){if(e==a.i18n.BTN_YES){a.root.addClass("animated fadeOutUp");setTimeout(a.skin.logout,1000)}})});b("NAV UL").myams_menu({accordion:true,speed:a.menu_speed});b(".minifyme").click(function(f){b("BODY").toggleClass("minified");b(this).effect("highlight",{},500);f.preventDefault()});b("#refresh").click(function(f){a.skin.bigBox({title:"<i class='fa fa-refresh' style='color: green'></i> "+a.i18n.CLEAR_STORAGE_TITLE,content:a.i18n.CLEAR_STORAGE_CONTENT,buttons:"["+a.i18n.BTN_CANCEL+"]["+a.i18n.BTN_OK+"]"},function(e){if(e==a.i18n.BTN_OK&&localStorage){localStorage.clear();location.reload()}});f.preventDefault()});c.on("click",function(g){var f=b(this);if(!f.is(g.target)&&f.has(g.target).length===0&&b(".popover").has(g.target).length===0){f.popover("hide")}});a.ajax.check(b.resize,a.baseURL+"ext/jquery-resize"+a.devext+".js",function(){b("#main").resize(function(){a.skin._setPageHeight();a.skin._checkMobileWidth()});b("nav").resize(function(){a.skin._setPageHeight()})});if(a.ajax_nav){b(document).on("click",'a[href="#"]',function(f){f.preventDefault()});b(document).on("click",'a[href!="#"]:not([data-toggle]), [data-ams-url]:not([data-toggle])',function(j){var h=b(j.currentTarget);var f=h.attr("href")||h.data("ams-url");if(!f||f.startsWith("javascript:")||h.attr("target")||(h.data("ams-context-menu")===true)){return}j.preventDefault();j.stopPropagation();var g=a.getFunctionByName(f);if(typeof(g)=="function"){f=g.call(h)}if(typeof(f)=="function"){f.call(h)}else{f=f.replace(/\%23/,"#");var i=h.data("ams-target");if(i){a.form.confirmChangedForm(i,function(){a.skin.loadURL(f,i,h.data("ams-link-options"),h.data("ams-link-callback"));j.stopPropagation()})}else{a.form.confirmChangedForm(function(){if(f.startsWith("#")){if(f!=location.hash){if(a.root.hasClass("mobile-view-activated")){a.root.removeClass("hidden-menu");window.setTimeout(function(){window.location.hash=f},150)}else{window.location.hash=f}}}else{window.location=f}})}}});b(document).on("click",'a[target="_blank"]',function(f){f.preventDefault();window.open(b(f.currentTarget).attr("href"))});b(document).on("click",'a[target="_top"]',function(f){f.preventDefault();a.form.confirmChangedForm(function(){window.location=b(f.currentTarget).attr("href")})});b(window).on("hashchange",a.skin.checkURL)}b(document).off("click.modal").on("click",'[data-toggle="modal"]',function(g){var f=b(this);if(f.data("ams-context-menu")===true){return}if(f.data("ams-stop-propagation")===true){g.stopPropagation()}g.preventDefault();a.dialog.open(f);if(f.parents("#shortcut").exists()){setTimeout(a.skin._hideShortcutButtons,300)}});b(document).on("click",'button[type="submit"], button.submit',function(){var e=b(this);b(e.get(0).form).data("ams-submit-button",e)});b(document).on("click","[data-ams-click-handler]",function(h){var g=b(this);var f=g.data();if(f.amsClickHandler){if((f.amsStopPropagation===true)||(f.amsClickStopPropagation===true)){h.stopPropagation()}if(f.amsClickKeepDefault!==true){h.preventDefault()}var i=a.getFunctionByName(f.amsClickHandler);if(i!==undefined){i.call(g,f.amsClickHandlerOptions)}}});b(document).on("change","[data-ams-change-handler]",function(h){var g=b(this);var f=g.data();if(f.amsChangeHandler){if(f.amsChangeKeepDefault!==true){h.preventDefault()}var i=a.getFunctionByName(f.amsChangeHandler);if(i!==undefined){i.call(g,f.amsChangeHandlerOptions)}}});b(document).on("reset","[data-ams-reset-handler]",function(h){var f=b(this);var g=f.data();if(g.amsResetHandler){if(g.amsResetKeepDefault!==true){h.preventDefault()}var i=a.getFunctionByName(g.amsResetHandler);if(i!==undefined){i.call(f,g.amsResetHandlerOptions)}}});b(document).on("change",'input[type="file"]',function(h){h.preventDefault();var f=b(this);var g=f.parent(".button");if(g.exists()&&g.parent().hasClass("input-file")){g.next('input[type="text"]').val(f.val())}});b(document).on("focusin",function(f){if(b(f.target).closest(".mce-window").length){f.stopImmediatePropagation()}});b("a[data-toggle=tab]",".nav-tabs").on("click",function(f){if(b(this).parent("li").hasClass("disabled")){f.preventDefault();return false}});b(document).on("show.bs.tab",function(h){var f=b(h.target);var g=f.data();if(g.amsUrl){if(g.amsTabLoaded){return}a.skin.loadURL(g.amsUrl,f.attr("href"));if(g.amsTabLoadOnce){f.data("ams-tab-loaded",true)}}});a.initContent(document);if(a.ajax_nav&&(b("nav").length>0)){a.skin.checkURL()}b(window).on("beforeunload",a.form.checkBeforeUnload)};MyAMS.initContent=function(c){b(".tipsy").remove();b("[rel=tooltip]",c).tooltip();b("[rel=popover]",c).popover();b("[rel=popover-hover]",c).popover({trigger:"hover"});a.plugins.init(c);a.callbacks.init(c);a.events.init(c);a.form.init(c);if(a.device==="desktop"){a.skin._initDesktopWidgets(c)}else{a.skin._initMobileWidgets(c)}a.skin._setPageHeight()};MyAMS.i18n={INFO:"Information",WARNING:"!! WARNING !!",ERROR:"ERROR: ",WAIT:"Please wait!",FORM_SUBMITTED:"This form was already submitted...",NO_SERVER_RESPONSE:"No response from server!",ERROR_OCCURED:"An error occured!",ERRORS_OCCURED:"Some errors occured!",BAD_LOGIN_TITLE:"Bad login!",BAD_LOGIN_MESSAGE:"Your anthentication credentials didn't allow you to open a session; please check your credentials or contact administrator.",CONFIRM:"Confirm",CONFIRM_REMOVE:"Removing this content can't be undone. Do you confirm?",CLEAR_STORAGE_TITLE:"Clear Local Storage",CLEAR_STORAGE_CONTENT:"Would you like to RESET all your saved widgets and clear LocalStorage?",BTN_OK:"OK",BTN_CANCEL:"Cancel",BTN_OK_CANCEL:"[OK][Cancel]",BTN_YES:"Yes",BTN_NO:"No",BTN_YES_NO:"[Yes][No]",FORM_CHANGED_WARNING:"Some changes were not saved. These updates will be lost if you leave this page.",DELETE_WARNING:"This change can't be undone. Are you sure that you want to delete this element?",NO_UPDATE:"No changes were applied.",DATA_UPDATED:"Data successfully updated.",HOME:"Home",LOGOUT:"Logout?",LOGOUT_COMMENT:"You can improve your security further after logging out by closing this opened browser",SELECT2_PLURAL:"s",SELECT2_MATCH:"One result is available, press enter to select it.",SELECT2_MATCHES:" results are available, use up and down arrow keys to navigate.",SELECT2_NOMATCHES:"No matches found",SELECT2_SEARCHING:"Searching...",SELECT2_LOADMORE:"Loading more results...",SELECT2_INPUT_TOOSHORT:"Please enter {0} more character{1}",SELECT2_INPUT_TOOLONG:"Please delete {0} character{1}",SELECT2_SELECTION_TOOBIG:"You can only select {0} item{1}",SELECT2_FREETAG_PREFIX:"Free text: ",DT_COLUMNS:"Columns"};b(document).ready(function(){b=jQuery.noConflict();var c=b("HTML");var d=c.attr("lang")||c.attr("xml:lang");if(d&&!d.startsWith("en")){MyAMS.lang=d;MyAMS.getScript(MyAMS.baseURL+"i18n/myams_"+d.substr(0,2)+".js",function(){MyAMS.initPage()})}else{MyAMS.initPage()}})})(jQuery);
\ No newline at end of file
--- a/src/pyams_skin/resources/less/forms.less	Wed May 20 15:01:45 2015 +0200
+++ b/src/pyams_skin/resources/less/forms.less	Wed Jun 17 10:00:10 2015 +0200
@@ -851,6 +851,12 @@
 	.form-group {
 		padding: 5px 10px;
 	}
+	&.form-tight,
+	& .form-tight {
+		.form-group {
+			padding: 1px 10px;
+		}
+	}
 	label {
 		&.checkbox,
 		&.radio {
@@ -1304,6 +1310,25 @@
 			line-height: 1em;
 		}
 	}
+	.input span.textarea-widget,
+	.textarea span.textarea-widget {
+		display: block;
+		width: 100%;
+		min-height: 14px;
+		padding: 4px 0;
+		border-bottom: 1px solid #ccc!important;
+	}
+	.input .i18n-content input,
+	.select .i18n-content select,
+	.textarea .i18n-content textarea {
+		&[readonly] {
+			border-width: 0!important;
+		}
+	}
+	.input .i18n-content .textarea-widget {
+		display: block;
+		min-height: 12px;
+	}
 	.input input:focus + .tooltip,
 	.textarea textarea:focus + .tooltip {
 		opacity: 1;
@@ -2641,6 +2666,10 @@
 	}
 }
 
+.mce-edit-area >iframe {
+	min-height: 400px!important;
+}
+
 .client-form header {
 	padding: 15px 13px;
 	margin: 0;
--- a/src/pyams_skin/resources/less/menus.less	Wed May 20 15:01:45 2015 +0200
+++ b/src/pyams_skin/resources/less/menus.less	Wed Jun 17 10:00:10 2015 +0200
@@ -116,7 +116,7 @@
 			margin: 0;
 			display: none;
 			background: rgba(91,103,113,0.8);
-			padding: 7px 0;
+			padding: 2px 0;
 
 			>li:hover b {
 				color: #D5D9E2;
@@ -125,6 +125,11 @@
 				margin: 0;
 				padding: 0;
 
+				&.divider {
+					height: 1px;
+					margin-left: 30px;
+					padding: 0;
+				}
 				>a {
 					padding-left: 42px;
 					font-size: 12px;
--- a/src/pyams_skin/resources/less/modal.less	Wed May 20 15:01:45 2015 +0200
+++ b/src/pyams_skin/resources/less/modal.less	Wed Jun 17 10:00:10 2015 +0200
@@ -7,6 +7,7 @@
 	position: fixed;
 	width: 100%;
 	height: 100%;
+	z-index: 990;
 }
 
 .modal-dialog {
@@ -32,6 +33,11 @@
 			max-width: 450px;
 		}
 	}
+	.modal-body {
+		.modal-viewport {
+			min-height: 140px;
+		}
+	}
 	.suffix {
 		.alert {
 			margin-bottom: 0;
--- a/src/pyams_skin/resources/less/tables.less	Wed May 20 15:01:45 2015 +0200
+++ b/src/pyams_skin/resources/less/tables.less	Wed Jun 17 10:00:10 2015 +0200
@@ -46,6 +46,13 @@
 		line-height: 1.3!important;
 	}
 }
+.table-small {
+	td,
+	th {
+		padding: 2px 8px!important;
+		line-height: 1.2!important;
+	}
+}
 .table-mini {
 	td,
 	th {
--- a/src/pyams_skin/resources/less/widgets.less	Wed May 20 15:01:45 2015 +0200
+++ b/src/pyams_skin/resources/less/widgets.less	Wed Jun 17 10:00:10 2015 +0200
@@ -303,6 +303,11 @@
 		>h2 {
 			margin-left: 10px;
 			float: left;
+
+			& + .btn,
+			& + .btn-group {
+				margin-left: 20px;
+			}
 		}
 		.rtl & {
 			padding: 0 7px 0 0;
@@ -348,12 +353,12 @@
 		margin: 0;
 		padding: 13px 13px 0;
 		background-color: #fff !important;
-		border-width: 1px 1px 2px;
+		border-width: 1px;
 		border-style: solid;
+		border-color: #ccc!important;
+	}
+	>header+div {
 		border-top: 0;
-		border-right-color: #CCC !important;
-		border-bottom-color: #CCC !important;
-		border-left-color: #CCC !important;
 	}
 	.widget-body {
 		position: relative;
@@ -1120,7 +1125,7 @@
 			display: list-item;
 			background-image: none;
 
-			&.select2-result-with-children>.select2-result-label {
+			&.select2-result-with-children >.select2-result-label {
 				font-weight: 700;
 			}
 		}
@@ -1274,7 +1279,7 @@
 				}
 				.select2-search-choice {
 					padding: 1px 28px 1px 8px;
-					margin: 2px 0 2px 2px;
+					margin: 2px;
 					position: relative;
 					line-height: 18px;
 					color: #fff;
@@ -1298,6 +1303,10 @@
 					}
 					&.ui-sortable-handle {
 						cursor: move;
+
+						.with-icons & {
+							margin-right: 1px;
+						}
 					}
 				}
 			}
@@ -1305,6 +1314,7 @@
 				.select2-choices {
 					li {
 						float: none;
+						cursor: move;
 
 						&.ui-state-highlight {
 							margin: 2px 0 2px 2px;
@@ -1414,8 +1424,8 @@
 	}
 }
 label.with-icon {
-	>i.icon-append + .select2-parent {
-		.select2-choices {
+	>i.icon-append +.select2-parent {
+		>.select2-choices {
 			padding-right: 29px;
 		}
 	}
--- a/src/pyams_skin/table.py	Wed May 20 15:01:45 2015 +0200
+++ b/src/pyams_skin/table.py	Wed Jun 17 10:00:10 2015 +0200
@@ -68,7 +68,8 @@
         return {'tr': {'id': lambda x: '{0}::{1}'.format(self.id, getattr(x, '__name__', '')),
                        'data-ams-element-name': lambda x: getattr(x, '__name__', None),
                        'data-ams-url': lambda x: getattr(get_element_editor(self, x), 'url', None),
-                       'data-toggle': lambda x: 'modal' if getattr(get_element_editor(self, x), 'modal_target', None) else None}}
+                       'data-toggle': lambda x: 'modal' if getattr(get_element_editor(self, x), 'modal_target', None)
+                                                else None}}
 
     batchSize = 10000
     startBatchingAt = 10000
@@ -177,7 +178,7 @@
     permission = None
 
     def renderCell(self, item):
-        if self.permission and not self.request.has_permission(self.permission):
+        if self.permission and not self.request.has_permission(self.permission, context=item):
             return ''
         if self.checker:
             if callable(self.checker):
@@ -211,6 +212,13 @@
         return self.url
 
 
+class ImageColumn(ActionColumn):
+    """Simple image column"""
+
+    def renderCell(self, item):
+        return self.get_icon(item)
+
+
 @adapter_config(name='actions', context=(Interface, IPyAMSLayer, ITableWithActions), provides=IColumn)
 class MenuActionsColumn(I18nColumn, Column):
     """Menu actions column"""
--- a/src/pyams_skin/templates/header.pt	Wed May 20 15:01:45 2015 +0200
+++ b/src/pyams_skin/templates/header.pt	Wed Jun 17 10:00:10 2015 +0200
@@ -1,8 +1,8 @@
 <tal:if define="header view.header"
-		condition="header">
+		condition="header" i18n:domain="pyams_skin">
 	<h1 class="page-title" tal:define="back_url header.back_url | nothing">
 		<a class="font-xs hint" data-ams-target="#content"
-		   title="Back to previous page"
+		   title="Back to previous page" i18n:attributes="title"
 		   tal:condition="back_url"
 		   tal:attributes="href back_url;
 						   data-ams-target header.back_target | default;">
@@ -10,9 +10,15 @@
 		</a>
 		<i tal:attributes="class header.icon_class"></i>
 		<tal:var content="header.title" />
+		<div tal:condition="header.title_badge"
+			 tal:attributes="class header.title_badge_class"
+			 tal:content="header.title_badge"></div>
 		<tal:if condition="header.subtitle">
 			<span><i class="fa fa-angle-right"></i>
 				<tal:var content="header.subtitle" />
+				<div tal:condition="header.subtitle_badge"
+					 tal:attributes="class header.subtitle_badge_class"
+					 tal:content="header.subtitle_badge"></div>
 			</span>
 		</tal:if>
 	</h1>
--- a/src/pyams_skin/templates/layout.pt	Wed May 20 15:01:45 2015 +0200
+++ b/src/pyams_skin/templates/layout.pt	Wed Jun 17 10:00:10 2015 +0200
@@ -1,5 +1,5 @@
 <!DOCTYPE html>
-<html lang="fr-FR"
+<html lang="fr"
 	  tal:define="config extension:configuration;
 				  static extension:static_configuration;
 				  userid request.authenticated_userid;"
@@ -34,7 +34,7 @@
 			<span id="logo"
 				  tal:define="logo config.logo | nothing"
 				  tal:condition="logo">
-				<a tal:attributes="href extension:absolute_url(context, '@@index.html')">
+				<a href="/@@admin.html">
 					<img tal:attributes="src extension:absolute_url(logo, '++thumb++200x36.png');" />
 				</a>
 			</span>
--- a/src/pyams_skin/templates/table.pt	Wed May 20 15:01:45 2015 +0200
+++ b/src/pyams_skin/templates/table.pt	Wed Jun 17 10:00:10 2015 +0200
@@ -1,10 +1,11 @@
-<div class="ams-widget">
-	<header>
+<div class="ams-widget" tal:attributes="data-ams-data extension:object_data(view)">
+	<header tal:condition="not:getattr(view,'hide_header',False)">
 		<span tal:condition="view.widget_icon_class | nothing"
 			  class="widget-icon"><i tal:attributes="class view.widget_icon_class"></i>
 		</span>
 		<h2 tal:content="view.title"></h2>
 		<tal:if condition="not:getattr(view,'hide_toolbar',False)">
+			<tal:var content="structure provider:pyams.widget_title" />
 			<tal:var content="structure provider:pyams.toolbar" />
 		</tal:if>
 	</header>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/templates/widget-layout.pt	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,16 @@
+<tal:var content="structure provider:content_header" />
+<tal:var content="structure provider:content_help" />
+<div class="ams-widget" i18n:domain="onf_website"
+	 tal:attributes="data-ams-data extension:object_data(view)">
+	<header>
+		<span tal:condition="view.widget_icon_class | nothing"
+			  class="widget-icon"><i tal:attributes="class view.widget_icon_class"></i>
+		</span>
+		<h2 tal:content="view.title">Title</h2>
+		<tal:var content="structure provider:pyams.widget_title" />
+		<tal:var content="structure provider:pyams.toolbar" />
+	</header>
+	<div class="widget-body">
+		<tal:var content="structure provider:pagelet" />
+	</div>
+</div>
--- a/src/pyams_skin/viewlet/shortcuts/__init__.py	Wed May 20 15:01:45 2015 +0200
+++ b/src/pyams_skin/viewlet/shortcuts/__init__.py	Wed Jun 17 10:00:10 2015 +0200
@@ -31,6 +31,7 @@
 
 @viewletmanager_config(name='pyams.shortcuts', layer=IPyAMSLayer, provides=IShortcutsViewletManager)
 @template_config(template='manager.pt', layer=IPyAMSLayer)
+@implementer(IShortcutsViewletManager)
 class ShortcutsViewletManager(TemplateBasedViewletManager, WeightOrderedViewletManager):
     """Shortcuts viewlet manager"""
 
@@ -42,6 +43,7 @@
 
     bg_color_class = FieldProperty(IShortcut['bg_color_class'])
     icon_class = FieldProperty(IShortcut['icon_class'])
+    label = FieldProperty(IShortcut['label'])
     url = FieldProperty(IShortcut['url'])
     target = FieldProperty(IShortcut['target'])
     modal_target = FieldProperty(IShortcut['modal_target'])
@@ -56,7 +58,7 @@
 except ImportError:
     pass
 else:
-    @viewlet_config(name='admin.shortcut', manager=ShortcutsViewletManager,
+    @viewlet_config(name='admin.shortcut', manager=IShortcutsViewletManager,
                     layer=IPyAMSLayer, permission='system.view', weight=9999)
     class ManagementInterfaceShortcut(Shortcut):
         """Access to management interface"""
--- a/src/pyams_skin/viewlet/toolbar/__init__.py	Wed May 20 15:01:45 2015 +0200
+++ b/src/pyams_skin/viewlet/toolbar/__init__.py	Wed Jun 17 10:00:10 2015 +0200
@@ -18,7 +18,7 @@
 # import interfaces
 from pyams_skin.interfaces.container import ITableWithActions
 from pyams_skin.interfaces.viewlet import IToolbarViewletManager, IToolbarAction, IToolbarMenu, IToolbarMenuItem, \
-    IContextActions, IToolbarAddingMenu, ITableItemColumnActionsMenu
+    IContextActions, IToolbarAddingMenu, ITableItemColumnActionsMenu, IWidgetTitleViewletManager
 from pyams_skin.layer import IPyAMSLayer
 from pyams_utils.interfaces.tales import ITALESExtension
 from zope.contentprovider.interfaces import IContentProvider
@@ -35,6 +35,11 @@
 from pyams_skin import _
 
 
+@viewletmanager_config(name='pyams.widget_title', view=Interface, layer=IPyAMSLayer, provides=IWidgetTitleViewletManager)
+class WidgetTitleViewletManager(WeightOrderedViewletManager):
+    """Widget title extensions viewlet manager"""
+
+
 @viewletmanager_config(name='pyams.toolbar', view=Interface, layer=IPyAMSLayer, provides=IToolbarViewletManager)
 @template_config(template='manager.pt', layer=IPyAMSLayer)
 class TableToolbarViewletManager(TemplateBasedViewletManager, WeightOrderedViewletManager):
@@ -84,13 +89,15 @@
         return Viewlet.render(self)
 
 
-@viewlet_config(name='pyams.addings', view=Interface, layer=IPyAMSLayer, manager=IToolbarViewletManager)
+@viewlet_config(name='pyams.addings', view=Interface, layer=IPyAMSLayer, manager=IWidgetTitleViewletManager, weight=50)
 @viewletmanager_config(name='pyams.addings', view=Interface, layer=IPyAMSLayer, provides=IToolbarAddingMenu)
 @implementer(IToolbarAddingMenu)
 class ToolbarAddingMenu(ToolbarMenu):
     """Toolbar adding menu"""
 
     label = _("Add...")
+    css_class = 'btn btn-xs btn-success dropdown-toggle'
+    menu_css_class = 'dropdown-menu'
 
 
 @viewletmanager_config(name='pyams.table-item.actions', view=ITableWithActions, layer=IPyAMSLayer,
@@ -136,12 +143,14 @@
     css_class = 'divider'
 
 
+@viewlet_config(name='pyams.actions', view=Interface, layer=IPyAMSLayer, manager=IToolbarViewletManager, weight=999)
 @viewletmanager_config(name='pyams.actions', view=Interface, layer=IPyAMSLayer, provides=IContextActions)
 @template_config(template='menu.pt', layer=IPyAMSLayer)
 @implementer(IContextActions)
 class ContextActionsViewletManager(ToolbarMenu):
     """Context actions viewlet manager"""
 
+    label = _("Other actions...")
     css_class = FieldProperty(IContextActions['css_class'])
 
 
--- a/src/pyams_skin/viewlet/toplinks/__init__.py	Wed May 20 15:01:45 2015 +0200
+++ b/src/pyams_skin/viewlet/toplinks/__init__.py	Wed Jun 17 10:00:10 2015 +0200
@@ -71,7 +71,7 @@
         if self.css_class == 'divider':
             return '<li class="divider"></li>'
         else:
-            label = self.request.localizer.translate(self.label, context=self.request)
+            label = self.request.localizer.translate(self.label)
             return '''<li class="{0}">
                         <a href="{1}" {2}>{3}</a>
                     </li>'''.format(self.css_class,
@@ -83,7 +83,7 @@
         data = self.data.copy()
         if self.click_handler:
             data.update({'data-ams-click-handler': self.click_handler})
-        return ' '.join('%s=%s' % item for item in data.iteritems())
+        return ' '.join('%s=%s' % item for item in data.items())
 
 
 #