[pLog-svn] r7170 - in plog/trunk: . bin-devel class/action/admin class/database class/net class/plugin class/template/smarty/plugins js/tinymce js/tinymce/langs js/tinymce/plugins js/tinymce/plugins/directionality js/tinymce/plugins/directionality/images js/tinymce/plugins/directionality/langs js/tinymce/plugins/emotions js/tinymce/plugins/emotions/images js/tinymce/plugins/emotions/jscripts js/tinymce/plugins/emotions/langs js/tinymce/plugins/fullscreen js/tinymce/plugins/fullscreen/css js/tinymce/plugins/fullscreen/images js/tinymce/plugins/fullscreen/langs js/tinymce/plugins/inlinepopups js/tinymce/plugins/inlinepopups/css js/tinymce/plugins/inlinepopups/images js/tinymce/plugins/inlinepopups/jscripts js/tinymce/plugins/inlinepopups/langs js/tinymce/plugins/insertdatetime js/tinymce/plugins/insertdatetime/images js/tinymce/plugins/insertdatetime/langs js/tinymce/plugins/insertresource js/tinymce/plugins/insertvideo js/tinymce/plugins/more js/tinymce/plugins/table js/tinymce/ plugins/table/css js/tinymce/plugins/table/images js/tinymce/plugins/table/jscripts js/tinymce/plugins/table/langs js/tinymce/themes js/tinymce/themes/advanced js/tinymce/themes/advanced/css js/tinymce/themes/advanced/docs js/tinymce/themes/advanced/docs/en js/tinymce/themes/advanced/docs/en/images js/tinymce/themes/advanced/images js/tinymce/themes/advanced/images/xp js/tinymce/themes/advanced/jscripts js/tinymce/themes/advanced/langs js/tinymce/themes/simple js/tinymce/themes/simple/css js/tinymce/themes/simple/images js/tinymce/utils js/ui templates templates/admin templates/default templates/rss

mark at devel.lifetype.net mark at devel.lifetype.net
Tue Feb 21 09:33:01 EST 2012


Author: mark
Date: 2012-02-21 09:33:00 -0500 (Tue, 21 Feb 2012)
New Revision: 7170

Added:
   plog/trunk/js/tinymce/blank.htm
   plog/trunk/js/tinymce/langs/readme.txt
   plog/trunk/js/tinymce/plugins/directionality/
   plog/trunk/js/tinymce/plugins/directionality/editor_plugin.js
   plog/trunk/js/tinymce/plugins/directionality/editor_plugin_src.js
   plog/trunk/js/tinymce/plugins/directionality/images/
   plog/trunk/js/tinymce/plugins/directionality/images/ltr.gif
   plog/trunk/js/tinymce/plugins/directionality/images/rtl.gif
   plog/trunk/js/tinymce/plugins/directionality/langs/
   plog/trunk/js/tinymce/plugins/directionality/langs/en.js
   plog/trunk/js/tinymce/plugins/directionality/readme.txt
   plog/trunk/js/tinymce/plugins/emotions/
   plog/trunk/js/tinymce/plugins/emotions/editor_plugin.js
   plog/trunk/js/tinymce/plugins/emotions/editor_plugin_src.js
   plog/trunk/js/tinymce/plugins/emotions/emotions.htm
   plog/trunk/js/tinymce/plugins/emotions/images/
   plog/trunk/js/tinymce/plugins/emotions/images/emotions.gif
   plog/trunk/js/tinymce/plugins/emotions/images/readme.txt
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-cool.gif
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-cry.gif
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-embarassed.gif
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-foot-in-mouth.gif
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-frown.gif
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-innocent.gif
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-kiss.gif
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-laughing.gif
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-money-mouth.gif
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-sealed.gif
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-smile.gif
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-surprised.gif
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-tongue-out.gif
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-undecided.gif
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-wink.gif
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-yell.gif
   plog/trunk/js/tinymce/plugins/emotions/jscripts/
   plog/trunk/js/tinymce/plugins/emotions/jscripts/functions.js
   plog/trunk/js/tinymce/plugins/emotions/langs/
   plog/trunk/js/tinymce/plugins/emotions/langs/en.js
   plog/trunk/js/tinymce/plugins/emotions/readme.txt
   plog/trunk/js/tinymce/plugins/fullscreen/
   plog/trunk/js/tinymce/plugins/fullscreen/css/
   plog/trunk/js/tinymce/plugins/fullscreen/css/page.css
   plog/trunk/js/tinymce/plugins/fullscreen/editor_plugin.js
   plog/trunk/js/tinymce/plugins/fullscreen/editor_plugin_src.js
   plog/trunk/js/tinymce/plugins/fullscreen/fullscreen.htm
   plog/trunk/js/tinymce/plugins/fullscreen/images/
   plog/trunk/js/tinymce/plugins/fullscreen/images/fullscreen.gif
   plog/trunk/js/tinymce/plugins/fullscreen/langs/
   plog/trunk/js/tinymce/plugins/fullscreen/langs/en.js
   plog/trunk/js/tinymce/plugins/fullscreen/readme.txt
   plog/trunk/js/tinymce/plugins/inlinepopups/
   plog/trunk/js/tinymce/plugins/inlinepopups/css/
   plog/trunk/js/tinymce/plugins/inlinepopups/css/inlinepopup.css
   plog/trunk/js/tinymce/plugins/inlinepopups/editor_plugin.js
   plog/trunk/js/tinymce/plugins/inlinepopups/editor_plugin_src.js
   plog/trunk/js/tinymce/plugins/inlinepopups/images/
   plog/trunk/js/tinymce/plugins/inlinepopups/images/spacer.gif
   plog/trunk/js/tinymce/plugins/inlinepopups/images/window_close.gif
   plog/trunk/js/tinymce/plugins/inlinepopups/images/window_maximize.gif
   plog/trunk/js/tinymce/plugins/inlinepopups/images/window_minimize.gif
   plog/trunk/js/tinymce/plugins/inlinepopups/images/window_resize.gif
   plog/trunk/js/tinymce/plugins/inlinepopups/jscripts/
   plog/trunk/js/tinymce/plugins/inlinepopups/jscripts/mcwindows.js
   plog/trunk/js/tinymce/plugins/inlinepopups/langs/
   plog/trunk/js/tinymce/plugins/inlinepopups/langs/en.js
   plog/trunk/js/tinymce/plugins/inlinepopups/readme.txt
   plog/trunk/js/tinymce/plugins/insertdatetime/
   plog/trunk/js/tinymce/plugins/insertdatetime/editor_plugin.js
   plog/trunk/js/tinymce/plugins/insertdatetime/editor_plugin_src.js
   plog/trunk/js/tinymce/plugins/insertdatetime/images/
   plog/trunk/js/tinymce/plugins/insertdatetime/images/insertdate.gif
   plog/trunk/js/tinymce/plugins/insertdatetime/images/inserttime.gif
   plog/trunk/js/tinymce/plugins/insertdatetime/langs/
   plog/trunk/js/tinymce/plugins/insertdatetime/langs/en.js
   plog/trunk/js/tinymce/plugins/insertdatetime/readme.txt
   plog/trunk/js/tinymce/plugins/readme.txt
   plog/trunk/js/tinymce/plugins/table/
   plog/trunk/js/tinymce/plugins/table/cell.htm
   plog/trunk/js/tinymce/plugins/table/css/
   plog/trunk/js/tinymce/plugins/table/css/cell.css
   plog/trunk/js/tinymce/plugins/table/css/row.css
   plog/trunk/js/tinymce/plugins/table/css/table.css
   plog/trunk/js/tinymce/plugins/table/editor_plugin.js
   plog/trunk/js/tinymce/plugins/table/editor_plugin_src.js
   plog/trunk/js/tinymce/plugins/table/images/
   plog/trunk/js/tinymce/plugins/table/images/buttons.gif
   plog/trunk/js/tinymce/plugins/table/images/table.gif
   plog/trunk/js/tinymce/plugins/table/images/table_cell_props.gif
   plog/trunk/js/tinymce/plugins/table/images/table_delete.gif
   plog/trunk/js/tinymce/plugins/table/images/table_delete_col.gif
   plog/trunk/js/tinymce/plugins/table/images/table_delete_row.gif
   plog/trunk/js/tinymce/plugins/table/images/table_insert_col_after.gif
   plog/trunk/js/tinymce/plugins/table/images/table_insert_col_before.gif
   plog/trunk/js/tinymce/plugins/table/images/table_insert_row_after.gif
   plog/trunk/js/tinymce/plugins/table/images/table_insert_row_before.gif
   plog/trunk/js/tinymce/plugins/table/images/table_merge_cells.gif
   plog/trunk/js/tinymce/plugins/table/images/table_row_props.gif
   plog/trunk/js/tinymce/plugins/table/images/table_split_cells.gif
   plog/trunk/js/tinymce/plugins/table/jscripts/
   plog/trunk/js/tinymce/plugins/table/jscripts/cell.js
   plog/trunk/js/tinymce/plugins/table/jscripts/merge_cells.js
   plog/trunk/js/tinymce/plugins/table/jscripts/row.js
   plog/trunk/js/tinymce/plugins/table/jscripts/table.js
   plog/trunk/js/tinymce/plugins/table/langs/
   plog/trunk/js/tinymce/plugins/table/langs/en.js
   plog/trunk/js/tinymce/plugins/table/merge_cells.htm
   plog/trunk/js/tinymce/plugins/table/readme.txt
   plog/trunk/js/tinymce/plugins/table/row.htm
   plog/trunk/js/tinymce/plugins/table/table.htm
   plog/trunk/js/tinymce/themes/advanced/css/
   plog/trunk/js/tinymce/themes/advanced/css/colorpicker.css
   plog/trunk/js/tinymce/themes/advanced/css/editor_content.css
   plog/trunk/js/tinymce/themes/advanced/css/editor_popup.css
   plog/trunk/js/tinymce/themes/advanced/css/editor_ui.css
   plog/trunk/js/tinymce/themes/advanced/docs/
   plog/trunk/js/tinymce/themes/advanced/docs/en/
   plog/trunk/js/tinymce/themes/advanced/docs/en/about.htm
   plog/trunk/js/tinymce/themes/advanced/docs/en/common_buttons.htm
   plog/trunk/js/tinymce/themes/advanced/docs/en/create_accessible_content.htm
   plog/trunk/js/tinymce/themes/advanced/docs/en/images/
   plog/trunk/js/tinymce/themes/advanced/docs/en/images/insert_anchor_window.gif
   plog/trunk/js/tinymce/themes/advanced/docs/en/images/insert_image_window.gif
   plog/trunk/js/tinymce/themes/advanced/docs/en/images/insert_link_window.gif
   plog/trunk/js/tinymce/themes/advanced/docs/en/images/insert_table_window.gif
   plog/trunk/js/tinymce/themes/advanced/docs/en/index.htm
   plog/trunk/js/tinymce/themes/advanced/docs/en/insert_anchor_button.htm
   plog/trunk/js/tinymce/themes/advanced/docs/en/insert_image_button.htm
   plog/trunk/js/tinymce/themes/advanced/docs/en/insert_link_button.htm
   plog/trunk/js/tinymce/themes/advanced/docs/en/insert_table_button.htm
   plog/trunk/js/tinymce/themes/advanced/docs/en/style.css
   plog/trunk/js/tinymce/themes/advanced/images/
   plog/trunk/js/tinymce/themes/advanced/images/anchor.gif
   plog/trunk/js/tinymce/themes/advanced/images/anchor_symbol.gif
   plog/trunk/js/tinymce/themes/advanced/images/backcolor.gif
   plog/trunk/js/tinymce/themes/advanced/images/bold.gif
   plog/trunk/js/tinymce/themes/advanced/images/bold_de_se.gif
   plog/trunk/js/tinymce/themes/advanced/images/bold_es.gif
   plog/trunk/js/tinymce/themes/advanced/images/bold_fr.gif
   plog/trunk/js/tinymce/themes/advanced/images/bold_ru.gif
   plog/trunk/js/tinymce/themes/advanced/images/bold_tw.gif
   plog/trunk/js/tinymce/themes/advanced/images/browse.gif
   plog/trunk/js/tinymce/themes/advanced/images/bullist.gif
   plog/trunk/js/tinymce/themes/advanced/images/button_menu.gif
   plog/trunk/js/tinymce/themes/advanced/images/buttons.gif
   plog/trunk/js/tinymce/themes/advanced/images/cancel_button_bg.gif
   plog/trunk/js/tinymce/themes/advanced/images/charmap.gif
   plog/trunk/js/tinymce/themes/advanced/images/cleanup.gif
   plog/trunk/js/tinymce/themes/advanced/images/close.gif
   plog/trunk/js/tinymce/themes/advanced/images/code.gif
   plog/trunk/js/tinymce/themes/advanced/images/color.gif
   plog/trunk/js/tinymce/themes/advanced/images/colors.jpg
   plog/trunk/js/tinymce/themes/advanced/images/copy.gif
   plog/trunk/js/tinymce/themes/advanced/images/custom_1.gif
   plog/trunk/js/tinymce/themes/advanced/images/cut.gif
   plog/trunk/js/tinymce/themes/advanced/images/forecolor.gif
   plog/trunk/js/tinymce/themes/advanced/images/help.gif
   plog/trunk/js/tinymce/themes/advanced/images/hr.gif
   plog/trunk/js/tinymce/themes/advanced/images/image.gif
   plog/trunk/js/tinymce/themes/advanced/images/indent.gif
   plog/trunk/js/tinymce/themes/advanced/images/insert_button_bg.gif
   plog/trunk/js/tinymce/themes/advanced/images/italic.gif
   plog/trunk/js/tinymce/themes/advanced/images/italic_de_se.gif
   plog/trunk/js/tinymce/themes/advanced/images/italic_es.gif
   plog/trunk/js/tinymce/themes/advanced/images/italic_ru.gif
   plog/trunk/js/tinymce/themes/advanced/images/italic_tw.gif
   plog/trunk/js/tinymce/themes/advanced/images/justifycenter.gif
   plog/trunk/js/tinymce/themes/advanced/images/justifyfull.gif
   plog/trunk/js/tinymce/themes/advanced/images/justifyleft.gif
   plog/trunk/js/tinymce/themes/advanced/images/justifyright.gif
   plog/trunk/js/tinymce/themes/advanced/images/link.gif
   plog/trunk/js/tinymce/themes/advanced/images/menu_check.gif
   plog/trunk/js/tinymce/themes/advanced/images/newdocument.gif
   plog/trunk/js/tinymce/themes/advanced/images/numlist.gif
   plog/trunk/js/tinymce/themes/advanced/images/opacity.png
   plog/trunk/js/tinymce/themes/advanced/images/outdent.gif
   plog/trunk/js/tinymce/themes/advanced/images/paste.gif
   plog/trunk/js/tinymce/themes/advanced/images/redo.gif
   plog/trunk/js/tinymce/themes/advanced/images/removeformat.gif
   plog/trunk/js/tinymce/themes/advanced/images/separator.gif
   plog/trunk/js/tinymce/themes/advanced/images/spacer.gif
   plog/trunk/js/tinymce/themes/advanced/images/statusbar_resize.gif
   plog/trunk/js/tinymce/themes/advanced/images/strikethrough.gif
   plog/trunk/js/tinymce/themes/advanced/images/sub.gif
   plog/trunk/js/tinymce/themes/advanced/images/sup.gif
   plog/trunk/js/tinymce/themes/advanced/images/underline.gif
   plog/trunk/js/tinymce/themes/advanced/images/underline_es.gif
   plog/trunk/js/tinymce/themes/advanced/images/underline_fr.gif
   plog/trunk/js/tinymce/themes/advanced/images/underline_ru.gif
   plog/trunk/js/tinymce/themes/advanced/images/underline_tw.gif
   plog/trunk/js/tinymce/themes/advanced/images/undo.gif
   plog/trunk/js/tinymce/themes/advanced/images/unlink.gif
   plog/trunk/js/tinymce/themes/advanced/images/visualaid.gif
   plog/trunk/js/tinymce/themes/advanced/images/xp/
   plog/trunk/js/tinymce/themes/advanced/images/xp/tab_bg.gif
   plog/trunk/js/tinymce/themes/advanced/images/xp/tab_end.gif
   plog/trunk/js/tinymce/themes/advanced/images/xp/tab_sel_bg.gif
   plog/trunk/js/tinymce/themes/advanced/images/xp/tab_sel_end.gif
   plog/trunk/js/tinymce/themes/advanced/images/xp/tabs_bg.gif
   plog/trunk/js/tinymce/themes/advanced/jscripts/
   plog/trunk/js/tinymce/themes/advanced/jscripts/about.js
   plog/trunk/js/tinymce/themes/advanced/jscripts/anchor.js
   plog/trunk/js/tinymce/themes/advanced/jscripts/charmap.js
   plog/trunk/js/tinymce/themes/advanced/jscripts/color_picker.js
   plog/trunk/js/tinymce/themes/advanced/jscripts/image.js
   plog/trunk/js/tinymce/themes/advanced/jscripts/link.js
   plog/trunk/js/tinymce/themes/advanced/jscripts/source_editor.js
   plog/trunk/js/tinymce/themes/simple/
   plog/trunk/js/tinymce/themes/simple/css/
   plog/trunk/js/tinymce/themes/simple/css/editor_content.css
   plog/trunk/js/tinymce/themes/simple/css/editor_popup.css
   plog/trunk/js/tinymce/themes/simple/css/editor_ui.css
   plog/trunk/js/tinymce/themes/simple/editor_template.js
   plog/trunk/js/tinymce/themes/simple/editor_template_src.js
   plog/trunk/js/tinymce/themes/simple/images/
   plog/trunk/js/tinymce/themes/simple/images/bold.gif
   plog/trunk/js/tinymce/themes/simple/images/bold_de_se.gif
   plog/trunk/js/tinymce/themes/simple/images/bold_fr.gif
   plog/trunk/js/tinymce/themes/simple/images/bold_ru.gif
   plog/trunk/js/tinymce/themes/simple/images/bold_tw.gif
   plog/trunk/js/tinymce/themes/simple/images/bullist.gif
   plog/trunk/js/tinymce/themes/simple/images/buttons.gif
   plog/trunk/js/tinymce/themes/simple/images/cleanup.gif
   plog/trunk/js/tinymce/themes/simple/images/italic.gif
   plog/trunk/js/tinymce/themes/simple/images/italic_de_se.gif
   plog/trunk/js/tinymce/themes/simple/images/italic_ru.gif
   plog/trunk/js/tinymce/themes/simple/images/italic_tw.gif
   plog/trunk/js/tinymce/themes/simple/images/numlist.gif
   plog/trunk/js/tinymce/themes/simple/images/redo.gif
   plog/trunk/js/tinymce/themes/simple/images/separator.gif
   plog/trunk/js/tinymce/themes/simple/images/spacer.gif
   plog/trunk/js/tinymce/themes/simple/images/strikethrough.gif
   plog/trunk/js/tinymce/themes/simple/images/underline.gif
   plog/trunk/js/tinymce/themes/simple/images/underline_fr.gif
   plog/trunk/js/tinymce/themes/simple/images/underline_ru.gif
   plog/trunk/js/tinymce/themes/simple/images/underline_tw.gif
   plog/trunk/js/tinymce/themes/simple/images/undo.gif
   plog/trunk/js/tinymce/utils/mclayer.js
Removed:
   plog/trunk/class/database/db.class.php
   plog/trunk/js/tinymce/plugins/advhr/
   plog/trunk/js/tinymce/plugins/advimage/
   plog/trunk/js/tinymce/plugins/advlink/
   plog/trunk/js/tinymce/plugins/advlist/
   plog/trunk/js/tinymce/plugins/autoresize/
   plog/trunk/js/tinymce/plugins/autosave/
   plog/trunk/js/tinymce/plugins/bbcode/
   plog/trunk/js/tinymce/plugins/contextmenu/
   plog/trunk/js/tinymce/plugins/directionality/
   plog/trunk/js/tinymce/plugins/directionality/editor_plugin.js
   plog/trunk/js/tinymce/plugins/directionality/editor_plugin_src.js
   plog/trunk/js/tinymce/plugins/directionality/images/
   plog/trunk/js/tinymce/plugins/directionality/images/ltr.gif
   plog/trunk/js/tinymce/plugins/directionality/images/rtl.gif
   plog/trunk/js/tinymce/plugins/directionality/langs/
   plog/trunk/js/tinymce/plugins/directionality/langs/en.js
   plog/trunk/js/tinymce/plugins/directionality/readme.txt
   plog/trunk/js/tinymce/plugins/emotions/
   plog/trunk/js/tinymce/plugins/emotions/editor_plugin.js
   plog/trunk/js/tinymce/plugins/emotions/editor_plugin_src.js
   plog/trunk/js/tinymce/plugins/emotions/emotions.htm
   plog/trunk/js/tinymce/plugins/emotions/images/
   plog/trunk/js/tinymce/plugins/emotions/images/emotions.gif
   plog/trunk/js/tinymce/plugins/emotions/images/readme.txt
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-cool.gif
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-cry.gif
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-embarassed.gif
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-foot-in-mouth.gif
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-frown.gif
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-innocent.gif
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-kiss.gif
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-laughing.gif
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-money-mouth.gif
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-sealed.gif
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-smile.gif
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-surprised.gif
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-tongue-out.gif
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-undecided.gif
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-wink.gif
   plog/trunk/js/tinymce/plugins/emotions/images/smiley-yell.gif
   plog/trunk/js/tinymce/plugins/emotions/jscripts/
   plog/trunk/js/tinymce/plugins/emotions/jscripts/functions.js
   plog/trunk/js/tinymce/plugins/emotions/langs/
   plog/trunk/js/tinymce/plugins/emotions/langs/en.js
   plog/trunk/js/tinymce/plugins/emotions/readme.txt
   plog/trunk/js/tinymce/plugins/example/
   plog/trunk/js/tinymce/plugins/fullpage/
   plog/trunk/js/tinymce/plugins/fullscreen/
   plog/trunk/js/tinymce/plugins/fullscreen/css/
   plog/trunk/js/tinymce/plugins/fullscreen/css/page.css
   plog/trunk/js/tinymce/plugins/fullscreen/editor_plugin.js
   plog/trunk/js/tinymce/plugins/fullscreen/editor_plugin_src.js
   plog/trunk/js/tinymce/plugins/fullscreen/fullscreen.htm
   plog/trunk/js/tinymce/plugins/fullscreen/images/
   plog/trunk/js/tinymce/plugins/fullscreen/images/fullscreen.gif
   plog/trunk/js/tinymce/plugins/fullscreen/langs/
   plog/trunk/js/tinymce/plugins/fullscreen/langs/en.js
   plog/trunk/js/tinymce/plugins/fullscreen/readme.txt
   plog/trunk/js/tinymce/plugins/iespell/
   plog/trunk/js/tinymce/plugins/inlinepopups/
   plog/trunk/js/tinymce/plugins/inlinepopups/css/
   plog/trunk/js/tinymce/plugins/inlinepopups/css/inlinepopup.css
   plog/trunk/js/tinymce/plugins/inlinepopups/editor_plugin.js
   plog/trunk/js/tinymce/plugins/inlinepopups/editor_plugin_src.js
   plog/trunk/js/tinymce/plugins/inlinepopups/images/
   plog/trunk/js/tinymce/plugins/inlinepopups/images/spacer.gif
   plog/trunk/js/tinymce/plugins/inlinepopups/images/window_close.gif
   plog/trunk/js/tinymce/plugins/inlinepopups/images/window_maximize.gif
   plog/trunk/js/tinymce/plugins/inlinepopups/images/window_minimize.gif
   plog/trunk/js/tinymce/plugins/inlinepopups/images/window_resize.gif
   plog/trunk/js/tinymce/plugins/inlinepopups/jscripts/
   plog/trunk/js/tinymce/plugins/inlinepopups/jscripts/mcwindows.js
   plog/trunk/js/tinymce/plugins/inlinepopups/langs/
   plog/trunk/js/tinymce/plugins/inlinepopups/langs/en.js
   plog/trunk/js/tinymce/plugins/inlinepopups/readme.txt
   plog/trunk/js/tinymce/plugins/insertdatetime/
   plog/trunk/js/tinymce/plugins/insertdatetime/editor_plugin.js
   plog/trunk/js/tinymce/plugins/insertdatetime/editor_plugin_src.js
   plog/trunk/js/tinymce/plugins/insertdatetime/images/
   plog/trunk/js/tinymce/plugins/insertdatetime/images/insertdate.gif
   plog/trunk/js/tinymce/plugins/insertdatetime/images/inserttime.gif
   plog/trunk/js/tinymce/plugins/insertdatetime/langs/
   plog/trunk/js/tinymce/plugins/insertdatetime/langs/en.js
   plog/trunk/js/tinymce/plugins/insertdatetime/readme.txt
   plog/trunk/js/tinymce/plugins/layer/
   plog/trunk/js/tinymce/plugins/legacyoutput/
   plog/trunk/js/tinymce/plugins/media/
   plog/trunk/js/tinymce/plugins/nonbreaking/
   plog/trunk/js/tinymce/plugins/noneditable/
   plog/trunk/js/tinymce/plugins/pagebreak/
   plog/trunk/js/tinymce/plugins/paste/
   plog/trunk/js/tinymce/plugins/preview/
   plog/trunk/js/tinymce/plugins/print/
   plog/trunk/js/tinymce/plugins/save/
   plog/trunk/js/tinymce/plugins/searchreplace/
   plog/trunk/js/tinymce/plugins/spellchecker/
   plog/trunk/js/tinymce/plugins/style/
   plog/trunk/js/tinymce/plugins/tabfocus/
   plog/trunk/js/tinymce/plugins/table/
   plog/trunk/js/tinymce/plugins/table/cell.htm
   plog/trunk/js/tinymce/plugins/table/css/
   plog/trunk/js/tinymce/plugins/table/css/cell.css
   plog/trunk/js/tinymce/plugins/table/css/row.css
   plog/trunk/js/tinymce/plugins/table/css/table.css
   plog/trunk/js/tinymce/plugins/table/editor_plugin.js
   plog/trunk/js/tinymce/plugins/table/editor_plugin_src.js
   plog/trunk/js/tinymce/plugins/table/images/
   plog/trunk/js/tinymce/plugins/table/images/buttons.gif
   plog/trunk/js/tinymce/plugins/table/images/table.gif
   plog/trunk/js/tinymce/plugins/table/images/table_cell_props.gif
   plog/trunk/js/tinymce/plugins/table/images/table_delete.gif
   plog/trunk/js/tinymce/plugins/table/images/table_delete_col.gif
   plog/trunk/js/tinymce/plugins/table/images/table_delete_row.gif
   plog/trunk/js/tinymce/plugins/table/images/table_insert_col_after.gif
   plog/trunk/js/tinymce/plugins/table/images/table_insert_col_before.gif
   plog/trunk/js/tinymce/plugins/table/images/table_insert_row_after.gif
   plog/trunk/js/tinymce/plugins/table/images/table_insert_row_before.gif
   plog/trunk/js/tinymce/plugins/table/images/table_merge_cells.gif
   plog/trunk/js/tinymce/plugins/table/images/table_row_props.gif
   plog/trunk/js/tinymce/plugins/table/images/table_split_cells.gif
   plog/trunk/js/tinymce/plugins/table/jscripts/
   plog/trunk/js/tinymce/plugins/table/jscripts/cell.js
   plog/trunk/js/tinymce/plugins/table/jscripts/merge_cells.js
   plog/trunk/js/tinymce/plugins/table/jscripts/row.js
   plog/trunk/js/tinymce/plugins/table/jscripts/table.js
   plog/trunk/js/tinymce/plugins/table/langs/
   plog/trunk/js/tinymce/plugins/table/langs/en.js
   plog/trunk/js/tinymce/plugins/table/merge_cells.htm
   plog/trunk/js/tinymce/plugins/table/readme.txt
   plog/trunk/js/tinymce/plugins/table/row.htm
   plog/trunk/js/tinymce/plugins/table/table.htm
   plog/trunk/js/tinymce/plugins/template/
   plog/trunk/js/tinymce/plugins/visualchars/
   plog/trunk/js/tinymce/plugins/wordcount/
   plog/trunk/js/tinymce/plugins/xhtmlxtras/
   plog/trunk/js/tinymce/themes/advanced/css/colorpicker.css
   plog/trunk/js/tinymce/themes/advanced/css/editor_content.css
   plog/trunk/js/tinymce/themes/advanced/css/editor_popup.css
   plog/trunk/js/tinymce/themes/advanced/css/editor_ui.css
   plog/trunk/js/tinymce/themes/advanced/docs/en/
   plog/trunk/js/tinymce/themes/advanced/docs/en/about.htm
   plog/trunk/js/tinymce/themes/advanced/docs/en/common_buttons.htm
   plog/trunk/js/tinymce/themes/advanced/docs/en/create_accessible_content.htm
   plog/trunk/js/tinymce/themes/advanced/docs/en/images/
   plog/trunk/js/tinymce/themes/advanced/docs/en/images/insert_anchor_window.gif
   plog/trunk/js/tinymce/themes/advanced/docs/en/images/insert_image_window.gif
   plog/trunk/js/tinymce/themes/advanced/docs/en/images/insert_link_window.gif
   plog/trunk/js/tinymce/themes/advanced/docs/en/images/insert_table_window.gif
   plog/trunk/js/tinymce/themes/advanced/docs/en/index.htm
   plog/trunk/js/tinymce/themes/advanced/docs/en/insert_anchor_button.htm
   plog/trunk/js/tinymce/themes/advanced/docs/en/insert_image_button.htm
   plog/trunk/js/tinymce/themes/advanced/docs/en/insert_link_button.htm
   plog/trunk/js/tinymce/themes/advanced/docs/en/insert_table_button.htm
   plog/trunk/js/tinymce/themes/advanced/docs/en/style.css
   plog/trunk/js/tinymce/themes/advanced/images/anchor.gif
   plog/trunk/js/tinymce/themes/advanced/images/anchor_symbol.gif
   plog/trunk/js/tinymce/themes/advanced/images/backcolor.gif
   plog/trunk/js/tinymce/themes/advanced/images/bold.gif
   plog/trunk/js/tinymce/themes/advanced/images/bold_de_se.gif
   plog/trunk/js/tinymce/themes/advanced/images/bold_es.gif
   plog/trunk/js/tinymce/themes/advanced/images/bold_fr.gif
   plog/trunk/js/tinymce/themes/advanced/images/bold_ru.gif
   plog/trunk/js/tinymce/themes/advanced/images/bold_tw.gif
   plog/trunk/js/tinymce/themes/advanced/images/browse.gif
   plog/trunk/js/tinymce/themes/advanced/images/bullist.gif
   plog/trunk/js/tinymce/themes/advanced/images/button_menu.gif
   plog/trunk/js/tinymce/themes/advanced/images/buttons.gif
   plog/trunk/js/tinymce/themes/advanced/images/cancel_button_bg.gif
   plog/trunk/js/tinymce/themes/advanced/images/charmap.gif
   plog/trunk/js/tinymce/themes/advanced/images/cleanup.gif
   plog/trunk/js/tinymce/themes/advanced/images/close.gif
   plog/trunk/js/tinymce/themes/advanced/images/code.gif
   plog/trunk/js/tinymce/themes/advanced/images/color.gif
   plog/trunk/js/tinymce/themes/advanced/images/colors.jpg
   plog/trunk/js/tinymce/themes/advanced/images/copy.gif
   plog/trunk/js/tinymce/themes/advanced/images/custom_1.gif
   plog/trunk/js/tinymce/themes/advanced/images/cut.gif
   plog/trunk/js/tinymce/themes/advanced/images/forecolor.gif
   plog/trunk/js/tinymce/themes/advanced/images/help.gif
   plog/trunk/js/tinymce/themes/advanced/images/hr.gif
   plog/trunk/js/tinymce/themes/advanced/images/image.gif
   plog/trunk/js/tinymce/themes/advanced/images/indent.gif
   plog/trunk/js/tinymce/themes/advanced/images/insert_button_bg.gif
   plog/trunk/js/tinymce/themes/advanced/images/italic.gif
   plog/trunk/js/tinymce/themes/advanced/images/italic_de_se.gif
   plog/trunk/js/tinymce/themes/advanced/images/italic_es.gif
   plog/trunk/js/tinymce/themes/advanced/images/italic_ru.gif
   plog/trunk/js/tinymce/themes/advanced/images/italic_tw.gif
   plog/trunk/js/tinymce/themes/advanced/images/justifycenter.gif
   plog/trunk/js/tinymce/themes/advanced/images/justifyfull.gif
   plog/trunk/js/tinymce/themes/advanced/images/justifyleft.gif
   plog/trunk/js/tinymce/themes/advanced/images/justifyright.gif
   plog/trunk/js/tinymce/themes/advanced/images/link.gif
   plog/trunk/js/tinymce/themes/advanced/images/menu_check.gif
   plog/trunk/js/tinymce/themes/advanced/images/newdocument.gif
   plog/trunk/js/tinymce/themes/advanced/images/numlist.gif
   plog/trunk/js/tinymce/themes/advanced/images/opacity.png
   plog/trunk/js/tinymce/themes/advanced/images/outdent.gif
   plog/trunk/js/tinymce/themes/advanced/images/paste.gif
   plog/trunk/js/tinymce/themes/advanced/images/redo.gif
   plog/trunk/js/tinymce/themes/advanced/images/removeformat.gif
   plog/trunk/js/tinymce/themes/advanced/images/separator.gif
   plog/trunk/js/tinymce/themes/advanced/images/spacer.gif
   plog/trunk/js/tinymce/themes/advanced/images/statusbar_resize.gif
   plog/trunk/js/tinymce/themes/advanced/images/strikethrough.gif
   plog/trunk/js/tinymce/themes/advanced/images/sub.gif
   plog/trunk/js/tinymce/themes/advanced/images/sup.gif
   plog/trunk/js/tinymce/themes/advanced/images/underline.gif
   plog/trunk/js/tinymce/themes/advanced/images/underline_es.gif
   plog/trunk/js/tinymce/themes/advanced/images/underline_fr.gif
   plog/trunk/js/tinymce/themes/advanced/images/underline_ru.gif
   plog/trunk/js/tinymce/themes/advanced/images/underline_tw.gif
   plog/trunk/js/tinymce/themes/advanced/images/undo.gif
   plog/trunk/js/tinymce/themes/advanced/images/unlink.gif
   plog/trunk/js/tinymce/themes/advanced/images/visualaid.gif
   plog/trunk/js/tinymce/themes/advanced/images/xp/
   plog/trunk/js/tinymce/themes/advanced/images/xp/tab_bg.gif
   plog/trunk/js/tinymce/themes/advanced/images/xp/tab_end.gif
   plog/trunk/js/tinymce/themes/advanced/images/xp/tab_sel_bg.gif
   plog/trunk/js/tinymce/themes/advanced/images/xp/tab_sel_end.gif
   plog/trunk/js/tinymce/themes/advanced/images/xp/tabs_bg.gif
   plog/trunk/js/tinymce/themes/advanced/img/
   plog/trunk/js/tinymce/themes/advanced/js/
   plog/trunk/js/tinymce/themes/advanced/jscripts/about.js
   plog/trunk/js/tinymce/themes/advanced/jscripts/anchor.js
   plog/trunk/js/tinymce/themes/advanced/jscripts/charmap.js
   plog/trunk/js/tinymce/themes/advanced/jscripts/color_picker.js
   plog/trunk/js/tinymce/themes/advanced/jscripts/image.js
   plog/trunk/js/tinymce/themes/advanced/jscripts/link.js
   plog/trunk/js/tinymce/themes/advanced/jscripts/source_editor.js
   plog/trunk/js/tinymce/themes/advanced/langs/en_dlg.js
   plog/trunk/js/tinymce/themes/advanced/skins/
   plog/trunk/js/tinymce/themes/simple/css/
   plog/trunk/js/tinymce/themes/simple/css/editor_content.css
   plog/trunk/js/tinymce/themes/simple/css/editor_popup.css
   plog/trunk/js/tinymce/themes/simple/css/editor_ui.css
   plog/trunk/js/tinymce/themes/simple/editor_template.js
   plog/trunk/js/tinymce/themes/simple/editor_template_src.js
   plog/trunk/js/tinymce/themes/simple/images/
   plog/trunk/js/tinymce/themes/simple/images/bold.gif
   plog/trunk/js/tinymce/themes/simple/images/bold_de_se.gif
   plog/trunk/js/tinymce/themes/simple/images/bold_fr.gif
   plog/trunk/js/tinymce/themes/simple/images/bold_ru.gif
   plog/trunk/js/tinymce/themes/simple/images/bold_tw.gif
   plog/trunk/js/tinymce/themes/simple/images/bullist.gif
   plog/trunk/js/tinymce/themes/simple/images/buttons.gif
   plog/trunk/js/tinymce/themes/simple/images/cleanup.gif
   plog/trunk/js/tinymce/themes/simple/images/italic.gif
   plog/trunk/js/tinymce/themes/simple/images/italic_de_se.gif
   plog/trunk/js/tinymce/themes/simple/images/italic_ru.gif
   plog/trunk/js/tinymce/themes/simple/images/italic_tw.gif
   plog/trunk/js/tinymce/themes/simple/images/numlist.gif
   plog/trunk/js/tinymce/themes/simple/images/redo.gif
   plog/trunk/js/tinymce/themes/simple/images/separator.gif
   plog/trunk/js/tinymce/themes/simple/images/spacer.gif
   plog/trunk/js/tinymce/themes/simple/images/strikethrough.gif
   plog/trunk/js/tinymce/themes/simple/images/underline.gif
   plog/trunk/js/tinymce/themes/simple/images/underline_fr.gif
   plog/trunk/js/tinymce/themes/simple/images/underline_ru.gif
   plog/trunk/js/tinymce/themes/simple/images/underline_tw.gif
   plog/trunk/js/tinymce/themes/simple/images/undo.gif
   plog/trunk/js/tinymce/tiny_mce_gzip.js
Modified:
   plog/trunk/
   plog/trunk/.htaccess
   plog/trunk/bin-devel/build-core-all-svn.sh
   plog/trunk/bin-devel/build-core-diff.sh
   plog/trunk/bin-devel/build-plugin-local.sh
   plog/trunk/bin-devel/build-plugins-all-svn.sh
   plog/trunk/bin-devel/genpluginfeeds.php
   plog/trunk/blog.php
   plog/trunk/class/action/admin/admindefaultaction.class.php
   plog/trunk/class/action/admin/adminloginaction.class.php
   plog/trunk/class/action/admin/adminnewpostaction.class.php
   plog/trunk/class/net/baserequestgenerator.class.php
   plog/trunk/class/net/customurlhandler.class.php
   plog/trunk/class/plugin/pluginmanager.class.php
   plog/trunk/class/template/smarty/plugins/compiler.continue.php
   plog/trunk/js/tinymce/langs/en.js
   plog/trunk/js/tinymce/plugins/insertresource/editor_plugin.js
   plog/trunk/js/tinymce/plugins/insertvideo/editor_plugin.js
   plog/trunk/js/tinymce/plugins/more/editor_plugin.js
   plog/trunk/js/tinymce/themes/advanced/about.htm
   plog/trunk/js/tinymce/themes/advanced/anchor.htm
   plog/trunk/js/tinymce/themes/advanced/charmap.htm
   plog/trunk/js/tinymce/themes/advanced/color_picker.htm
   plog/trunk/js/tinymce/themes/advanced/editor_template.js
   plog/trunk/js/tinymce/themes/advanced/editor_template_src.js
   plog/trunk/js/tinymce/themes/advanced/image.htm
   plog/trunk/js/tinymce/themes/advanced/langs/en.js
   plog/trunk/js/tinymce/themes/advanced/link.htm
   plog/trunk/js/tinymce/themes/advanced/source_editor.htm
   plog/trunk/js/tinymce/tiny_mce-plog.js
   plog/trunk/js/tinymce/tiny_mce.js
   plog/trunk/js/tinymce/tiny_mce_gzip.php
   plog/trunk/js/tinymce/tiny_mce_popup.js
   plog/trunk/js/tinymce/tiny_mce_src.js
   plog/trunk/js/tinymce/utils/editable_selects.js
   plog/trunk/js/tinymce/utils/form_utils.js
   plog/trunk/js/tinymce/utils/mctabs.js
   plog/trunk/js/tinymce/utils/validate.js
   plog/trunk/js/ui/plogui.js
   plog/trunk/templates/.htaccess
   plog/trunk/templates/admin/cleanup.template
   plog/trunk/templates/admin/dashboard.template
   plog/trunk/templates/admin/editpost.template
   plog/trunk/templates/admin/header.template
   plog/trunk/templates/admin/newpost.template
   plog/trunk/templates/default/commentform.template
   plog/trunk/templates/rss/atom.template
   plog/trunk/templates/rss/rss20.template
   plog/trunk/wizard
Log:
Revert from trunk -r 7169:7165. I am testing pushmi and forget to turn off the repository sync functions. Sorry!


Property changes on: plog/trunk
___________________________________________________________________
Modified: svn:mergeinfo
   - /plog/branches/lifetype-1.2:6449-7030
   + /plog/branches/lifetype-1.2:6449-6981

Modified: plog/trunk/.htaccess
===================================================================
--- plog/trunk/.htaccess	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/.htaccess	2012-02-21 14:33:00 UTC (rev 7170)
@@ -2,12 +2,12 @@
 deny from all
 </Files>
 
-<Files config.properties.php> 
-deny from all 
+<Files config.properties.php>
+deny from all
 </Files>
 
-Options -Indexes
-Options +FollowSymLinks
+#Options -Indexes
+#Options +FollowSymLinks
 
 # mod rewrite settings for LifeType mod_rewrite url mode
 


Property changes on: plog/trunk/bin-devel/build-core-all-svn.sh
___________________________________________________________________
Modified: svn:mergeinfo
   - /plog/branches/lifetype-1.2/bin-devel/build-core-all-svn.sh:6934-7030
   + /plog/branches/lifetype-1.2/bin-devel/build-core-all-svn.sh:6934-6981


Property changes on: plog/trunk/bin-devel/build-core-diff.sh
___________________________________________________________________
Modified: svn:mergeinfo
   - /plog/branches/lifetype-1.2/bin-devel/build-core-diff.sh:6934-7030
   + /plog/branches/lifetype-1.2/bin-devel/build-core-diff.sh:6934-6981


Property changes on: plog/trunk/bin-devel/build-plugin-local.sh
___________________________________________________________________
Modified: svn:mergeinfo
   - /plog/branches/lifetype-1.2/bin-devel/build-plugin-local.sh:6934-7030
   + /plog/branches/lifetype-1.2/bin-devel/build-plugin-local.sh:6934-6981


Property changes on: plog/trunk/bin-devel/build-plugins-all-svn.sh
___________________________________________________________________
Modified: svn:mergeinfo
   - /plog/branches/lifetype-1.2/bin-devel/build-plugins-all-svn.sh:6934-7030
   + /plog/branches/lifetype-1.2/bin-devel/build-plugins-all-svn.sh:6934-6981


Property changes on: plog/trunk/bin-devel/genpluginfeeds.php
___________________________________________________________________
Modified: svn:mergeinfo
   - /plog/branches/lifetype-1.2/bin-devel/genpluginfeeds.php:6934-7030
   + /plog/branches/lifetype-1.2/bin-devel/genpluginfeeds.php:6934-6981

Modified: plog/trunk/blog.php
===================================================================
--- plog/trunk/blog.php	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/blog.php	2012-02-21 14:33:00 UTC (rev 7170)
@@ -16,20 +16,14 @@
     }
 
     $server = HttpVars::getServer();
-    $requestParser = new CustomUrlHandler();
+	$requestParser = new CustomUrlHandler();
     // TODO: should check the return value of process() and
     // then display an error page instead of the home page
-    $error = $requestParser->process($server["REQUEST_URI"]);
-    $vars = $requestParser->getVars();
-    $params = $requestParser->getParams();
-    $includeFile = $requestParser->getIncludeFile();
+    $requestParser->process($server["REQUEST_URI"]);
+	$vars = $requestParser->getVars();
+	$params = $requestParser->getParams();
+	$includeFile = $requestParser->getIncludeFile();
 
-    // Hack to force an error page in defaultaction
-    if(!$error){
-      $vars["userId"] = "userId";
-      $params["userId"] = "INVALID";
-    }
-
 	//
 	// fill in the request with the parameters we need
 	//

Modified: plog/trunk/class/action/admin/admindefaultaction.class.php
===================================================================
--- plog/trunk/class/action/admin/admindefaultaction.class.php	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/class/action/admin/admindefaultaction.class.php	2012-02-21 14:33:00 UTC (rev 7170)
@@ -59,6 +59,7 @@
 				$pm =& PluginManager::getPluginManager();
 				$pm->setBlogInfo( $this->_blogInfo );
 				$pm->setUserInfo( $this->_userInfo );
+				$pm->notifyEvent( EVENT_LOGIN_SUCCESS );							
             }
             else {
         		$this->_view = new AdminDefaultView();

Modified: plog/trunk/class/action/admin/adminloginaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminloginaction.class.php	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/class/action/admin/adminloginaction.class.php	2012-02-21 14:33:00 UTC (rev 7170)
@@ -82,7 +82,6 @@
                 return false;
 			}
 			
-          $this->_pm->notifyEvent( EVENT_LOGIN_SUCCESS );							
 			$this->_pm->notifyEvent( EVENT_USER_LOADED, Array( "user" => &$userInfo, "from" => "Login" ));
 
             // get the list of blogs to which the user belongs

Modified: plog/trunk/class/action/admin/adminnewpostaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminnewpostaction.class.php	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/class/action/admin/adminnewpostaction.class.php	2012-02-21 14:33:00 UTC (rev 7170)
@@ -50,13 +50,12 @@
             $postText = $this->_request->getValue( "postText" );
 			
 			// check if javascript code is allowed in posts
-			// $config =& Config::getConfig();
+			$config =& Config::getConfig();
                 // Don't ever allow javascript when directing from the 'bookmarklet'
                 // or perhaps other hackers trying to exploit the poor lifetype user
 //			if( !$config->getValue( "allow_javascript_blocks_in_posts", false ))
             $postText = Textfilter::filterJavaScript( $postText );
-            $postText = trim(Textfilter::xhtmlize( $postText ));
-
+        	$postText = trim(Textfilter::xhtmlize( $postText ));
 			$this->_view->setValue( "postText", $postText );
 
             $this->setCommonData();

Deleted: plog/trunk/class/database/db.class.php
===================================================================
--- plog/trunk/class/database/db.class.php	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/class/database/db.class.php	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,16 +0,0 @@
-<?php
-
-
-
-    /**
-     * \ingroup Database
-     *
-     * @deprecated
-     * This class is left here for compatibility reasons, since as of Lifetype 2.0, the original Db class
-     * was renamed to LtDb in order not to clash with PEAR's Db class. Please modify your plugins and
-     * custom code to refer to the new LtDb class.
-     */
-    class Db extends LtDb
-    {
-    }
-?>

Modified: plog/trunk/class/net/baserequestgenerator.class.php
===================================================================
--- plog/trunk/class/net/baserequestgenerator.class.php	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/class/net/baserequestgenerator.class.php	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,6 +1,6 @@
 <?php
 
-	/**
+	/** 
 	 * \defgroup Net
 	 *
 	 * The Net package includes all the classes that are related to network functionality in one way
@@ -8,16 +8,22 @@
 	 *
 	 * @see Net_HTTP
 	 */
-
+    
     define( "DEFAULT_SCRIPT_NAME", "index.php" );
 
+	/**
+	 * Default folder where resources are installed
+	 */
+	define( "DEFAULT_GalleryConstants::GALLERY_RESOURCES_FOLDER", "./gallery/" );
+
+
     /**
      * \ingroup Net
      *
      * The BaseRequestGenerator class is some sort of proxy class that defines an interface that should be implemented
      * by classes wishing to provide a new request generator (plus some code that can be reused by all request
      * generators)
-     *
+     * 
      * Each request generator defines its own format for its URLs, and by using request generators we can easily
      * change the format of our URLs without the need to alter our templates (and therefore, without the need to hardcode
      * URLs in our templates)
@@ -29,7 +35,7 @@
      *
      * @see RequestGenerator
      */
-	class BaseRequestGenerator
+	class BaseRequestGenerator  
 	{
 
     	var $_params;
@@ -57,22 +63,22 @@
          */
     	function BaseRequestGenerator( $blogInfo = null )
         {
+        	
 
-
             $this->_params = Array();
 
             $this->_blogInfo = $blogInfo;
-            $config =& Config::getConfig();
+            $config =& Config::getConfig();	
             $this->_baseUrl = $config->getValue( "base_url" );
 			$this->_subdomainsBaseUrl = $config->getValue( "subdomains_base_url" );
-
+			
 			// get some information about the configuration of subdomains
 			$this->_subdomainsEnabled = $config->getValue( "subdomains_enabled" );
-			if( $this->_subdomainsEnabled )
+			if( $this->_subdomainsEnabled ) 
 				$this->_includeBlogId = $config->getValue( "include_blog_id_in_url" );
 			else
 				$this->_includeBlogId = true;
-
+		
 			// prepare the correct url if subdomains are enabled...
 			if( $this->_subdomainsEnabled && $blogInfo != null ) {
 				$this->_subdomainsBaseUrl = str_replace("{blogname}",
@@ -87,12 +93,12 @@
                                                         $this->_subdomainsBaseUrl);
 			}
             $this->_scriptName = $config->getValue( "script_name", DEFAULT_SCRIPT_NAME );
-
+			
 			// enable the xhtml mode by default, but it can be turned off
 			// via the setXHTML() method
 			$this->_xhtmlEnabled = true;
         }
-
+		
         /**
          * @return Returns true if subdomains are enabled
          */
@@ -100,7 +106,7 @@
 		{
 			return $this->_subdomainsEnabled;
 		}
-
+		
 		/**
 		 * @returns true if the blog identifier should be included in the  URL. This setting is only meaningful
 		 * when subdomains are enabled and is only used by "raw" URLs
@@ -123,7 +129,7 @@
 			else
 				return $this->_baseUrl;
         }
-
+        
         /**
          * @return Returns the name of the script to which for example forms will be submitted. Defaults to
          * index.php but it can be changed via the script_name configuration parameter.
@@ -132,8 +138,8 @@
         {
             return $this->_scriptName;
         }
-
-        /**
+		
+        /** 
          * @return Returns the URL pointing to the main index file. This URL is built by querying the current
          * base URL and then appending the value of the script_name configuration setting.
          *
@@ -142,19 +148,19 @@
 		 */
         function getIndexUrl( $useSubdomains = true )
         {
-
+			
             $url = $this->getBaseUrl( $useSubdomains )."/".$this->getScriptName();
 
             return $url;
         }
 
-        /**
+        /** 
          * @return Returns the URL pointing to the admin.php file. This URL is built by querying the current
          * base URL and then appending the value of the script_name configuration setting.
          *
 		 * @param useSubdomains If set to true and subdomains are enabled, it will use the base URL as specified
 		 * in the subdomains_base_url setting instead of base_url. It defaults to 'true'.
-		 */
+		 */        
         function getAdminUrl( $useSubdomains = true )
         {
             $url = $this->getBaseUrl( $useSubdomains )."/admin.php";
@@ -162,13 +168,13 @@
             return $url;
         }
 
-        /**
+        /** 
          * @return Returns the URL pointing to the rss.php file. This URL is built by querying the current
          * base URL and then appending the value of the script_name configuration setting.
          *
 		 * @param useSubdomains If set to true and subdomains are enabled, it will use the base URL as specified
 		 * in the subdomains_base_url setting instead of base_url. It defaults to 'true'.
-		 */
+		 */        
         function getRssUrl( $useSubdomains = false )
         {
             $url = $this->getBaseUrl( $useSubdomains )."/rss.php";
@@ -176,13 +182,13 @@
             return $url;
         }
 
-        /**
+        /** 
          * @return Returns the URL pointing to the trackback.php file. This URL is built by querying the current
          * base URL and then appending the value of the script_name configuration setting.
          *
 		 * @param useSubdomains If set to true and subdomains are enabled, it will use the base URL as specified
 		 * in the subdomains_base_url setting instead of base_url. It defaults to 'true'.
-		 */
+		 */        
         function getTrackbackUrl( $useSubdomains = false )
         {
             $url = $this->getBaseUrl( $useSubdomains )."/trackback.php";
@@ -190,13 +196,13 @@
             return $url;
         }
 
-        /**
+        /** 
          * @return Returns the URL pointing to the resserver.php file. This URL is built by querying the current
          * base URL and then appending the value of the script_name configuration setting.
          *
 		 * @param useSubdomains If set to true and subdomains are enabled, it will use the base URL as specified
 		 * in the subdomains_base_url setting instead of base_url. It defaults to 'true'.
-		 */
+		 */        
         function getResourceServerUrl( $useSubdomains = false )
         {
             $url = $this->getBaseUrl( $useSubdomains )."/resserver.php";
@@ -208,7 +214,7 @@
 		 * Returns the base URL to resources
 		 */
 		function getResourcesBaseUrl()
-		{
+		{			
 			$config =& Config::getConfig();
 			// the default value for this setting is to use a relative path that starts with './' so we have to make sure that
 			// that bit is not included in the URL (it wouldn't have any harmful effect, but it'd look ugly)
@@ -216,20 +222,20 @@
 			// make sure that the base URL ends with a forward slash
 			if( $galleryFolder[strlen($galleryFolder)-1] != "/" )
 				$galleryFolder .= "/";
-
+			
 			$url = $this->getBaseUrl().$galleryFolder;
-
+			
 			return( $url );
 		}
 
-        /**
+        /** 
          * @return Returns the URL pointing to the given parameter. This URL is built by querying the current
          * base URL and then appending the value of the $res parameter
          *
          * @param res A valid URL path
 		 * @param useSubdomains If set to true and subdomains are enabled, it will use the base URL as specified
 		 * in the subdomains_base_url setting instead of base_url. It defaults to 'true'.
-		 */
+		 */        
         function getUrl( $res, $useSubdomains = false )
         {
         	$baseUrl = $this->getBaseUrl( $useSubdomains );
@@ -325,8 +331,8 @@
         function categoryRssLink( $category, $profile = "", $blogInfo = null )
         {
 			throw( new Exception( "This function must be implemented by child classes." ));
-	    }
-
+	    }	
+	
         /**
          * Returns the url for the rss feed of user posts. All URL generators use the same
  	 	 * format for this for the time being, so we'll keep the method in this base class.
@@ -342,13 +348,13 @@
         {
 			$rssLink = $this->getRssUrl();
             $rssLink .= "?blogId=".$this->_blogInfo->getId();
-
+            
             if( $profile != "" )
             	$rssLink .= "&profile=$profile";
 
 			$rssLink .= "&userId=".$userInfo->getId();
-            return $rssLink;
-		}
+            return $rssLink;	
+		}	
 
         /**
          * Returns the link of a category. Must be implemented by child classes to generate a valid URL.
@@ -416,7 +422,7 @@
         function rssLink( $profile = "", $blogInfo = null )
         {
         	throw( new Exception( "This function must be implemented by child classes." ));
-        }
+        }	
 
         /**
          * Returns the url to reply to a given comment. Must be implemented by child classes to generate a valid URL.
@@ -474,7 +480,7 @@
          *
          * @param date A String in the format yyyymm
          * @return A valid archive link
-         */
+         */      
         function getArchiveLink( $date )
         {
         	throw( new Exception( "This function must be implemented by child classes." ));
@@ -502,17 +508,17 @@
         {
         	throw( new Exception( "This function must be implemented by child classes." ));
         }
-
+        
         /**
          * Given an album, generates a link to its parent. Must be implemented by child classes to generate
          * a valid URL.
          *
          * @param album The album
-         */
+         */                        
         function parentAlbumLink( $album )
         {
 			throw( new Exception( "This function must be implemented by child classes." ));
-        }
+        }        
 
         /**
          * Given the name of a template file, generate the right link to it. Must be implemented by child
@@ -524,7 +530,7 @@
         function templatePage( $template )
         {
         	throw( new Exception( "This function must be implemented by child classes." ));
-        }
+        }        
 
         /**
          * Returns the link to a resource. Must be implemented by child classes to generate a valid URL.
@@ -543,11 +549,11 @@
          */
         function resourcePreviewLink( $resource )
         {
-            $blogId = ($resource->getOwnerId() ? $resource->getOwnerId() : $this->_blogInfo->getId());
-			$resourceLink = $this->getResourcesBaseUrl().$blogId."/previews/".rawurlencode($resource->getPreviewFileName());
+            $blogId = ($resource->getOwnerId() ? $resource->getOwnerId() : $this->_blogInfo->getId());            
+			$resourceLink = $this->getResourcesBaseUrl().$blogId."/previews/".rawurlencode($resource->getPreviewFileName());            
             return $resourceLink;
         }
-
+		
         /**
          * Returns the link to a resource preview
          *
@@ -555,7 +561,7 @@
          */
         function resourceMediumSizePreviewLink( $resource )
         {
-            $blogId = ($resource->getOwnerId() ? $resource->getOwnerId() : $this->_blogInfo->getId());
+            $blogId = ($resource->getOwnerId() ? $resource->getOwnerId() : $this->_blogInfo->getId());            
 			$resourceLink = $this->getResourcesBaseUrl().$blogId."/previews-med/".rawurlencode($resource->getMediumSizePreviewFileName());
             return $resourceLink;
 		}
@@ -567,7 +573,7 @@
          */
         function resourceDownloadLink( $resource )
         {
-            $blogId = ($resource->getOwnerId() ? $resource->getOwnerId() : $this->_blogInfo->getId());
+            $blogId = ($resource->getOwnerId() ? $resource->getOwnerId() : $this->_blogInfo->getId());            
 			$resourceLink = $this->getResourcesBaseUrl().$blogId."/".rawurlencode($resource->getOriginalSizeFileName());
             return $resourceLink;
         }
@@ -579,11 +585,11 @@
          */
         function rawResourcePreviewLink( $resource )
         {
-            $blogId = ($resource->getOwnerId() ? $resource->getOwnerId() : $this->_blogInfo->getId());
-			$resourceLink = $this->getResourcesBaseUrl().$blogId."/previews/".$resource->getPreviewFileName();
+            $blogId = ($resource->getOwnerId() ? $resource->getOwnerId() : $this->_blogInfo->getId());            
+			$resourceLink = $this->getResourcesBaseUrl().$blogId."/previews/".$resource->getPreviewFileName();            
             return $resourceLink;
         }
-
+		
         /**
          * Returns the link to a resource preview with raw file name, for TinyMCE use only
          *
@@ -591,7 +597,7 @@
          */
         function rawResourceMediumSizePreviewLink( $resource )
         {
-            $blogId = ($resource->getOwnerId() ? $resource->getOwnerId() : $this->_blogInfo->getId());
+            $blogId = ($resource->getOwnerId() ? $resource->getOwnerId() : $this->_blogInfo->getId());            
 			$resourceLink = $this->getResourcesBaseUrl().$blogId."/previews-med/".$resource->getMediumSizePreviewFileName();
             return $resourceLink;
 		}
@@ -603,11 +609,11 @@
          */
         function rawResourceDownloadLink( $resource )
         {
-            $blogId = ($resource->getOwnerId() ? $resource->getOwnerId() : $this->_blogInfo->getId());
+            $blogId = ($resource->getOwnerId() ? $resource->getOwnerId() : $this->_blogInfo->getId());            
 			$resourceLink = $this->getResourcesBaseUrl().$blogId."/".$resource->getOriginalSizeFileName();
             return $resourceLink;
         }
-
+		
 		/**
 		 * whether we should generate valid xhtml requests or not
 		 * (used for example when sending out messages, as some email clients will
@@ -620,7 +626,7 @@
 		{
 			$this->_xhtmlEnabled = $enabled;
 		}
-
+		
 		/**
 		 * whether xhtml mode is enabled or not
 		 *
@@ -630,7 +636,7 @@
 		{
 			return $this->_xhtmlEnabled;
 		}
-
+		
 		/**
 		 * generates a unique atom id for the entry. This is not as easy
 		 * as it sounds, take a look http://diveintomark.org/archives/2004/05/28/howto-atom-id
@@ -640,20 +646,20 @@
 		 */
 		function getAtomUniqueId( $article )
 		{
-
+			  		
 		      $config =& Config::getConfig();
 		      $url = new Url($config->getValue( "base_url" ));
 		      $articleDate = $article->getDateObject();
-
+		      
 		      // Timestamp::getDay() doesn't do two digits, so we'll do it here
 		      $day = $articleDate->getDay();
-		      if( $day < 10 ) $day = "0".$day;
-
+		      if( $day < 10 ) $day = "0".$day;		      
+		      
 		      $date = $articleDate->getYear()."-".$articleDate->getMonth()."-".$day;
 		      $tag = "tag:".$url->getHost().",".$date.":".$article->getId();
-
+		      
 		      return $tag;
-		}
+		}		
 
         /**
          * get user profile picture link. It is not necessary for child classes to implement this method.
@@ -665,7 +671,7 @@
         	if( $blogInfo == null ) {
 				$blogInfo = $this->_blogInfo;
             }
-
+			
             $ownerInfo = $blogInfo->getOwnerInfo();
             $pic = $ownerInfo->getPicture();
             if(!$pic){
@@ -675,8 +681,8 @@
 			    return $this->resourceLink($pic);
             }
         }
-
-
+		
+        
 		/**
 		 * generates the correct path to a file in the template folder, without having to worry
 		 * whether the template was installed in /templates/ or in /templates/blog_X/. It is not necessary
@@ -688,19 +694,19 @@
 		function getTemplateFile( $file )
 		{
 			lt_include( PLOG_CLASS_PATH."class/file/file.class.php" );
-
+			
 		    // get the current template set
 		    $blogSettings = $this->_blogInfo->getSettings();
 		    $template = $blogSettings->getValue( "template" );
-
+		    
 		    // define this couple of things
         	$baseUrl = $this->getBaseUrl();
 			$config =& Config::getConfig();
 			$url = "$baseUrl/".File::expandPath( $config->getValue( "template_folder" ))."/";
-
+		    		    
 		    // is it a blog template?
 		    $blogTemplates = $blogSettings->getValue( "blog_templates" );
-
+		    
 		    if( !is_array($blogTemplates ))
 		        $url .= "$template/$file";
 		    else {
@@ -709,10 +715,10 @@
 		        else
 		          $url .= "$template/$file";
 		    }
-
-            return $url;
-		}
-
+		
+            return $url;		    
+		}		
+		
 		/**
 		 * generates the correct path to a file in the template folder, without having to worry
 		 * whether the template was installed in /templates/ or in /templates/blog_X/
@@ -760,7 +766,7 @@
 
 			return $url;
 		}
-
+		
 		/**
 		 * given the parameters, recalculates the current URL. This method also has support
 		 * for paged urls
@@ -774,7 +780,7 @@
 		{
 			throw( new Exception( "This function must be implemented by child classes." ));
 		}
-
+		
 		/**
 		 * Returns the page format for this URL generator
 		 *
@@ -782,9 +788,9 @@
 		 */
 		function getPageSuffix( $page = "" )
 		{
-			throw( new Exception( "This function must be implemented by child classes." ));
-		}
-
+			throw( new Exception( "This function must be implemented by child classes." ));		
+		}		
+		
 		/**
 		 * Links to a location map
 		 *

Modified: plog/trunk/class/net/customurlhandler.class.php
===================================================================
--- plog/trunk/class/net/customurlhandler.class.php	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/class/net/customurlhandler.class.php	2012-02-21 14:33:00 UTC (rev 7170)
@@ -62,7 +62,7 @@
 			// "search engine friendly" url
 			$this->_fallback = Array( "permalink_format" => $path."/post/{blogid}/{postid}",
 									 "category_link_format" => $path."/category/{blogid}/{catid}",
-									 "blog_link_format" => $path."/{blogid}$",
+									 "blog_link_format" => $path."/{blogid}",
 									 "archive_link_format" => $path."/archives/{blogid}/{year}/{month}/{day}",
 									 "user_posts_link_format" => $path."/user/{blogid}/{userid}",
 									 "post_trackbacks_link_format" => $path."/trackbacks/{blogid}/{postid}",
@@ -70,8 +70,8 @@
 									 "album_link_format" => $path."/album/{blogid}/{albumid}",
 									 "resource_link_format" => $path."/resource/{blogid}/{resourceid}",
 									 "resource_download_link_format" => $path."/get/{blogid}/{resourceid}",
-									 "resource_preview_link_format" => "!INVALID_LIFETYPE_URL",  // this one does not exist
-									 "resource_medium_size_preview_link_format" => "!INVALID_LIFETYPE_URL" ); // this one does not exist either
+									 "resource_preview_link_format" => "",  // this one does not exist
+									 "resource_medium_size_preview_link_format" => "" ); // this one does not exist either
 		}
 		
 		/**
@@ -144,6 +144,7 @@
 			
 			// put the parameter back as a parameter
 			$this->_params["page"] = $page;
+						
 			return( true );
 		}
 		

Modified: plog/trunk/class/plugin/pluginmanager.class.php
===================================================================
--- plog/trunk/class/plugin/pluginmanager.class.php	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/class/plugin/pluginmanager.class.php	2012-02-21 14:33:00 UTC (rev 7170)
@@ -379,14 +379,8 @@
                 $this->_pluginEventList["$eventType"] = Array();
             }
 
-            // don't let a plugin register twice for the same event
-            // takes care of bad programmers, and also double registering on the
-            // plugincenter page
-            if(isset($this->_pluginEventList["$eventType"][$pluginClass->id]))
-                return false;
-
             // and then add the plugin to the list
-            $this->_pluginEventList["$eventType"][$pluginClass->id] =& $pluginClass;
+            $this->_pluginEventList["$eventType"][] =& $pluginClass;
 
             return true;
         }


Property changes on: plog/trunk/class/template/smarty/plugins/compiler.continue.php
___________________________________________________________________
Modified: svn:mergeinfo
   - /plog/branches/lifetype-1.2/class/template/smarty/plugins/compiler.continue.php:6982-7030
   + 

Copied: plog/trunk/js/tinymce/blank.htm (from rev 7165, plog/trunk/js/tinymce/blank.htm)
===================================================================
--- plog/trunk/js/tinymce/blank.htm	                        (rev 0)
+++ plog/trunk/js/tinymce/blank.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,9 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>blank_page</title>
+	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+</head>
+<body class="mceContentBody">
+
+</body>
+</html>

Modified: plog/trunk/js/tinymce/langs/en.js
===================================================================
--- plog/trunk/js/tinymce/langs/en.js	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/js/tinymce/langs/en.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,170 +1,41 @@
-tinyMCE.addI18n({en:{
-common:{
-edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?",
-apply:"Apply",
-insert:"Insert",
-update:"Update",
-cancel:"Cancel",
-close:"Close",
-browse:"Browse",
-class_name:"Class",
-not_set:"-- Not set --",
-clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?",
-clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.",
-popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.",
-invalid_data:"Error: Invalid values entered, these are marked in red.",
-more_colors:"More colors"
-},
-contextmenu:{
-align:"Alignment",
-left:"Left",
-center:"Center",
-right:"Right",
-full:"Full"
-},
-insertdatetime:{
-date_fmt:"%Y-%m-%d",
-time_fmt:"%H:%M:%S",
-insertdate_desc:"Insert date",
-inserttime_desc:"Insert time",
-months_long:"January,February,March,April,May,June,July,August,September,October,November,December",
-months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",
-day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday",
-day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun"
-},
-print:{
-print_desc:"Print"
-},
-preview:{
-preview_desc:"Preview"
-},
-directionality:{
-ltr_desc:"Direction left to right",
-rtl_desc:"Direction right to left"
-},
-layer:{
-insertlayer_desc:"Insert new layer",
-forward_desc:"Move forward",
-backward_desc:"Move backward",
-absolute_desc:"Toggle absolute positioning",
-content:"New layer..."
-},
-save:{
-save_desc:"Save",
-cancel_desc:"Cancel all changes"
-},
-nonbreaking:{
-nonbreaking_desc:"Insert non-breaking space character"
-},
-iespell:{
-iespell_desc:"Run spell checking",
-download:"ieSpell not detected. Do you want to install it now?"
-},
-advhr:{
-advhr_desc:"Horizontal rule"
-},
-emotions:{
-emotions_desc:"Emotions"
-},
-searchreplace:{
-search_desc:"Find",
-replace_desc:"Find/Replace"
-},
-advimage:{
-image_desc:"Insert/edit image"
-},
-advlink:{
-link_desc:"Insert/edit link"
-},
-xhtmlxtras:{
-cite_desc:"Citation",
-abbr_desc:"Abbreviation",
-acronym_desc:"Acronym",
-del_desc:"Deletion",
-ins_desc:"Insertion",
-attribs_desc:"Insert/Edit Attributes"
-},
-style:{
-desc:"Edit CSS Style"
-},
-paste:{
-paste_text_desc:"Paste as Plain Text",
-paste_word_desc:"Paste from Word",
-selectall_desc:"Select All",
-plaintext_mode_sticky:"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.",
-plaintext_mode:"Paste is now in plain text mode. Click again to toggle back to regular paste mode."
-},
-paste_dlg:{
-text_title:"Use CTRL+V on your keyboard to paste the text into the window.",
-text_linebreaks:"Keep linebreaks",
-word_title:"Use CTRL+V on your keyboard to paste the text into the window."
-},
-table:{
-desc:"Inserts a new table",
-row_before_desc:"Insert row before",
-row_after_desc:"Insert row after",
-delete_row_desc:"Delete row",
-col_before_desc:"Insert column before",
-col_after_desc:"Insert column after",
-delete_col_desc:"Remove column",
-split_cells_desc:"Split merged table cells",
-merge_cells_desc:"Merge table cells",
-row_desc:"Table row properties",
-cell_desc:"Table cell properties",
-props_desc:"Table properties",
-paste_row_before_desc:"Paste table row before",
-paste_row_after_desc:"Paste table row after",
-cut_row_desc:"Cut table row",
-copy_row_desc:"Copy table row",
-del:"Delete table",
-row:"Row",
-col:"Column",
-cell:"Cell"
-},
-autosave:{
-unload_msg:"The changes you made will be lost if you navigate away from this page.",
-restore_content:"Restore auto-saved content.",
-warning_message:"If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?."
-},
-fullscreen:{
-desc:"Toggle fullscreen mode"
-},
-media:{
-desc:"Insert / edit embedded media",
-edit:"Edit embedded media"
-},
-fullpage:{
-desc:"Document properties"
-},
-template:{
-desc:"Insert predefined template content"
-},
-visualchars:{
-desc:"Visual control characters on/off."
-},
-spellchecker:{
-desc:"Toggle spellchecker",
-menu:"Spellchecker settings",
-ignore_word:"Ignore word",
-ignore_words:"Ignore all",
-langs:"Languages",
-wait:"Please wait...",
-sug:"Suggestions",
-no_sug:"No suggestions",
-no_mpell:"No misspellings found."
-},
-pagebreak:{
-desc:"Insert page break."
-},
-advlist:{
-types:"Types",
-def:"Default",
-lower_alpha:"Lower alpha",
-lower_greek:"Lower greek",
-lower_roman:"Lower roman",
-upper_alpha:"Upper alpha",
-upper_roman:"Upper roman",
-circle:"Circle",
-disc:"Disc",
-square:"Square"
-}}});
\ No newline at end of file
+// UK lang variables
+
+tinyMCE.addToLang('',{
+bold_desc : 'Bold (Ctrl+B)',
+italic_desc : 'Italic (Ctrl+I)',
+underline_desc : 'Underline (Ctrl+U)',
+striketrough_desc : 'Strikethrough',
+justifyleft_desc : 'Align left',
+justifycenter_desc : 'Align center',
+justifyright_desc : 'Align right',
+justifyfull_desc : 'Align full',
+bullist_desc : 'Unordered list',
+numlist_desc : 'Ordered list',
+outdent_desc : 'Outdent',
+indent_desc : 'Indent',
+undo_desc : 'Undo (Ctrl+Z)',
+redo_desc : 'Redo (Ctrl+Y)',
+link_desc : 'Insert/edit link',
+unlink_desc : 'Unlink',
+image_desc : 'Insert/edit image',
+cleanup_desc : 'Cleanup messy code',
+focus_alert : 'A editor instance must be focused before using this command.',
+edit_confirm : 'Do you want to use the WYSIWYG mode for this textarea?',
+insert_link_title : 'Insert/edit link',
+insert : 'Insert',
+update : 'Update',
+cancel : 'Cancel',
+insert_link_url : 'Link URL',
+insert_link_target : 'Target',
+insert_link_target_same : 'Open link in the same window',
+insert_link_target_blank : 'Open link in a new window',
+insert_image_title : 'Insert/edit image',
+insert_image_src : 'Image URL',
+insert_image_alt : 'Image description',
+help_desc : 'Help',
+bold_img : "bold.gif",
+italic_img : "italic.gif",
+underline_img : "underline.gif",
+clipboard_msg : 'Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?',
+popup_blocked : 'Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.'
+});

Copied: plog/trunk/js/tinymce/langs/readme.txt (from rev 7165, plog/trunk/js/tinymce/langs/readme.txt)
===================================================================
--- plog/trunk/js/tinymce/langs/readme.txt	                        (rev 0)
+++ plog/trunk/js/tinymce/langs/readme.txt	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,9 @@
+Beginning with version 2.0.5 the language packs are no
+longer included with the core distribution.
+Language packs can be downloaded from the TinyMCE website:
+http://tinymce.moxiecode.com/download.php
+
+The language pack codes are based on ISO-639-1:
+http://www.loc.gov/standards/iso639-2/englangn.html
+
+Plrease try using entities if possible. Like å etc for non a-z characters.

Deleted: plog/trunk/js/tinymce/plugins/directionality/editor_plugin.js
===================================================================
--- plog/trunk/js/tinymce/plugins/directionality/editor_plugin.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/directionality/editor_plugin.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1 +0,0 @@
-tinyMCE.importPluginLanguagePack('directionality');var TinyMCE_DirectionalityPlugin={getInfo:function(){return{longname:'Directionality',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},getControlHTML:function(cn){switch(cn){case"ltr":return tinyMCE.getButtonHTML(cn,'lang_directionality_ltr_desc','{$pluginurl}/images/ltr.gif','mceDirectionLTR');case"rtl":return tinyMCE.getButtonHTML(cn,'lang_directionality_rtl_desc','{$pluginurl}/images/rtl.gif','mceDirectionRTL')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceDirectionLTR":var inst=tinyMCE.getInstanceById(editor_id);var elm=tinyMCE.getParentElement(inst.getFocusElement(),"p,div,td,h1,h2,h3,h4,h5,h6,pre,address");if(elm)elm.setAttribute("dir","ltr");tinyMCE.triggerNodeChange(false);return true;case"mceDirectionRTL":va
 r inst=tinyMCE.getInstanceById(editor_id);var elm=tinyMCE.getParentElement(inst.getFocusElement(),"p,div,td,h1,h2,h3,h4,h5,h6,pre,address");if(elm)elm.setAttribute("dir","rtl");tinyMCE.triggerNodeChange(false);return true}return false},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){function getAttrib(elm,name){return elm.getAttribute(name)?elm.getAttribute(name):""}if(node==null)return;var elm=tinyMCE.getParentElement(node,"p,div,td,h1,h2,h3,h4,h5,h6,pre,address");if(!elm){tinyMCE.switchClass(editor_id+'_ltr','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_rtl','mceButtonDisabled');return true}tinyMCE.switchClass(editor_id+'_ltr','mceButtonNormal');tinyMCE.switchClass(editor_id+'_rtl','mceButtonNormal');var dir=getAttrib(elm,"dir");if(dir=="ltr"||dir=="")tinyMCE.switchClass(editor_id+'_ltr','mceButtonSelected');else tinyMCE.switchClass(editor_id+'_rtl','mceButtonSelected');return true}};tinyMCE.addPlugin("directionality",TinyMC
 E_DirectionalityPlugin);
\ No newline at end of file

Copied: plog/trunk/js/tinymce/plugins/directionality/editor_plugin.js (from rev 7165, plog/trunk/js/tinymce/plugins/directionality/editor_plugin.js)
===================================================================
--- plog/trunk/js/tinymce/plugins/directionality/editor_plugin.js	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/directionality/editor_plugin.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1 @@
+tinyMCE.importPluginLanguagePack('directionality');var TinyMCE_DirectionalityPlugin={getInfo:function(){return{longname:'Directionality',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},getControlHTML:function(cn){switch(cn){case"ltr":return tinyMCE.getButtonHTML(cn,'lang_directionality_ltr_desc','{$pluginurl}/images/ltr.gif','mceDirectionLTR');case"rtl":return tinyMCE.getButtonHTML(cn,'lang_directionality_rtl_desc','{$pluginurl}/images/rtl.gif','mceDirectionRTL')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceDirectionLTR":var inst=tinyMCE.getInstanceById(editor_id);var elm=tinyMCE.getParentElement(inst.getFocusElement(),"p,div,td,h1,h2,h3,h4,h5,h6,pre,address");if(elm)elm.setAttribute("dir","ltr");tinyMCE.triggerNodeChange(false);return true;case"mceDirectionRTL":va
 r inst=tinyMCE.getInstanceById(editor_id);var elm=tinyMCE.getParentElement(inst.getFocusElement(),"p,div,td,h1,h2,h3,h4,h5,h6,pre,address");if(elm)elm.setAttribute("dir","rtl");tinyMCE.triggerNodeChange(false);return true}return false},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){function getAttrib(elm,name){return elm.getAttribute(name)?elm.getAttribute(name):""}if(node==null)return;var elm=tinyMCE.getParentElement(node,"p,div,td,h1,h2,h3,h4,h5,h6,pre,address");if(!elm){tinyMCE.switchClass(editor_id+'_ltr','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_rtl','mceButtonDisabled');return true}tinyMCE.switchClass(editor_id+'_ltr','mceButtonNormal');tinyMCE.switchClass(editor_id+'_rtl','mceButtonNormal');var dir=getAttrib(elm,"dir");if(dir=="ltr"||dir=="")tinyMCE.switchClass(editor_id+'_ltr','mceButtonSelected');else tinyMCE.switchClass(editor_id+'_rtl','mceButtonSelected');return true}};tinyMCE.addPlugin("directionality",TinyMC
 E_DirectionalityPlugin);
\ No newline at end of file

Deleted: plog/trunk/js/tinymce/plugins/directionality/editor_plugin_src.js
===================================================================
--- plog/trunk/js/tinymce/plugins/directionality/editor_plugin_src.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/directionality/editor_plugin_src.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,90 +0,0 @@
-/**
- * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
- *
- * @author Moxiecode
- * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
- */
-
-/* Import plugin specific language pack */
-tinyMCE.importPluginLanguagePack('directionality');
-
-var TinyMCE_DirectionalityPlugin = {
-	getInfo : function() {
-		return {
-			longname : 'Directionality',
-			author : 'Moxiecode Systems AB',
-			authorurl : 'http://tinymce.moxiecode.com',
-			infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality',
-			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
-		};
-	},
-
-	getControlHTML : function(cn) {
-		switch (cn) {
-			case "ltr":
-				return tinyMCE.getButtonHTML(cn, 'lang_directionality_ltr_desc', '{$pluginurl}/images/ltr.gif', 'mceDirectionLTR');
-
-			case "rtl":
-				return tinyMCE.getButtonHTML(cn, 'lang_directionality_rtl_desc', '{$pluginurl}/images/rtl.gif', 'mceDirectionRTL');
-		}
-
-		return "";
-	},
-
-	execCommand : function(editor_id, element, command, user_interface, value) {
-		// Handle commands
-		switch (command) {
-			case "mceDirectionLTR":
-				var inst = tinyMCE.getInstanceById(editor_id);
-				var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
-
-				if (elm)
-					elm.setAttribute("dir", "ltr");
-
-				tinyMCE.triggerNodeChange(false);
-				return true;
-
-			case "mceDirectionRTL":
-				var inst = tinyMCE.getInstanceById(editor_id);
-				var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
-
-				if (elm)
-					elm.setAttribute("dir", "rtl");
-
-				tinyMCE.triggerNodeChange(false);
-				return true;
-		}
-
-		// Pass to next handler in chain
-		return false;
-	},
-
-	handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
-		function getAttrib(elm, name) {
-			return elm.getAttribute(name) ? elm.getAttribute(name) : "";
-		}
-
-		if (node == null)
-			return;
-
-		var elm = tinyMCE.getParentElement(node, "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
-		if (!elm) {
-			tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonDisabled');
-			tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonDisabled');
-			return true;
-		}
-
-		tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonNormal');
-		tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonNormal');
-
-		var dir = getAttrib(elm, "dir");
-		if (dir == "ltr" || dir == "")
-			tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonSelected');
-		else
-			tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonSelected');
-
-		return true;
-	}
-};
-
-tinyMCE.addPlugin("directionality", TinyMCE_DirectionalityPlugin);

Copied: plog/trunk/js/tinymce/plugins/directionality/editor_plugin_src.js (from rev 7165, plog/trunk/js/tinymce/plugins/directionality/editor_plugin_src.js)
===================================================================
--- plog/trunk/js/tinymce/plugins/directionality/editor_plugin_src.js	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/directionality/editor_plugin_src.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,90 @@
+/**
+ * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
+ */
+
+/* Import plugin specific language pack */
+tinyMCE.importPluginLanguagePack('directionality');
+
+var TinyMCE_DirectionalityPlugin = {
+	getInfo : function() {
+		return {
+			longname : 'Directionality',
+			author : 'Moxiecode Systems AB',
+			authorurl : 'http://tinymce.moxiecode.com',
+			infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality',
+			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+		};
+	},
+
+	getControlHTML : function(cn) {
+		switch (cn) {
+			case "ltr":
+				return tinyMCE.getButtonHTML(cn, 'lang_directionality_ltr_desc', '{$pluginurl}/images/ltr.gif', 'mceDirectionLTR');
+
+			case "rtl":
+				return tinyMCE.getButtonHTML(cn, 'lang_directionality_rtl_desc', '{$pluginurl}/images/rtl.gif', 'mceDirectionRTL');
+		}
+
+		return "";
+	},
+
+	execCommand : function(editor_id, element, command, user_interface, value) {
+		// Handle commands
+		switch (command) {
+			case "mceDirectionLTR":
+				var inst = tinyMCE.getInstanceById(editor_id);
+				var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
+
+				if (elm)
+					elm.setAttribute("dir", "ltr");
+
+				tinyMCE.triggerNodeChange(false);
+				return true;
+
+			case "mceDirectionRTL":
+				var inst = tinyMCE.getInstanceById(editor_id);
+				var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
+
+				if (elm)
+					elm.setAttribute("dir", "rtl");
+
+				tinyMCE.triggerNodeChange(false);
+				return true;
+		}
+
+		// Pass to next handler in chain
+		return false;
+	},
+
+	handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
+		function getAttrib(elm, name) {
+			return elm.getAttribute(name) ? elm.getAttribute(name) : "";
+		}
+
+		if (node == null)
+			return;
+
+		var elm = tinyMCE.getParentElement(node, "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
+		if (!elm) {
+			tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonDisabled');
+			tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonDisabled');
+			return true;
+		}
+
+		tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonNormal');
+
+		var dir = getAttrib(elm, "dir");
+		if (dir == "ltr" || dir == "")
+			tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonSelected');
+		else
+			tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonSelected');
+
+		return true;
+	}
+};
+
+tinyMCE.addPlugin("directionality", TinyMCE_DirectionalityPlugin);

Deleted: plog/trunk/js/tinymce/plugins/directionality/images/ltr.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/directionality/images/ltr.gif (from rev 7165, plog/trunk/js/tinymce/plugins/directionality/images/ltr.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/directionality/images/rtl.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/directionality/images/rtl.gif (from rev 7165, plog/trunk/js/tinymce/plugins/directionality/images/rtl.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/directionality/langs/en.js
===================================================================
--- plog/trunk/js/tinymce/plugins/directionality/langs/en.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/directionality/langs/en.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,6 +0,0 @@
-// UK lang variables
-
-tinyMCE.addToLang('',{
-directionality_ltr_desc : 'Direction left to right',
-directionality_rtl_desc : 'Direction right to left'
-});

Copied: plog/trunk/js/tinymce/plugins/directionality/langs/en.js (from rev 7165, plog/trunk/js/tinymce/plugins/directionality/langs/en.js)
===================================================================
--- plog/trunk/js/tinymce/plugins/directionality/langs/en.js	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/directionality/langs/en.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,6 @@
+// UK lang variables
+
+tinyMCE.addToLang('',{
+directionality_ltr_desc : 'Direction left to right',
+directionality_rtl_desc : 'Direction right to left'
+});

Deleted: plog/trunk/js/tinymce/plugins/directionality/readme.txt
===================================================================
--- plog/trunk/js/tinymce/plugins/directionality/readme.txt	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/directionality/readme.txt	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1 +0,0 @@
-Check the TinyMCE documentation for details on this plugin.

Copied: plog/trunk/js/tinymce/plugins/directionality/readme.txt (from rev 7165, plog/trunk/js/tinymce/plugins/directionality/readme.txt)
===================================================================
--- plog/trunk/js/tinymce/plugins/directionality/readme.txt	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/directionality/readme.txt	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1 @@
+Check the TinyMCE documentation for details on this plugin.

Deleted: plog/trunk/js/tinymce/plugins/emotions/editor_plugin.js
===================================================================
--- plog/trunk/js/tinymce/plugins/emotions/editor_plugin.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/emotions/editor_plugin.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1 +0,0 @@
-tinyMCE.importPluginLanguagePack('emotions');var TinyMCE_EmotionsPlugin={getInfo:function(){return{longname:'Emotions',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},getControlHTML:function(cn){switch(cn){case"emotions":return tinyMCE.getButtonHTML(cn,'lang_emotions_desc','{$pluginurl}/images/emotions.gif','mceEmotion')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceEmotion":var template=new Array();template['file']='../../plugins/emotions/emotions.htm';template['width']=250;template['height']=160;template['width']+=tinyMCE.getLang('lang_emotions_delta_width',0);template['height']+=tinyMCE.getLang('lang_emotions_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true}return false}};tinyMCE.addPlugin('emotions',TinyMCE_EmotionsPlugin);
\ No newline at end of file

Copied: plog/trunk/js/tinymce/plugins/emotions/editor_plugin.js (from rev 7165, plog/trunk/js/tinymce/plugins/emotions/editor_plugin.js)
===================================================================
--- plog/trunk/js/tinymce/plugins/emotions/editor_plugin.js	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/emotions/editor_plugin.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1 @@
+tinyMCE.importPluginLanguagePack('emotions');var TinyMCE_EmotionsPlugin={getInfo:function(){return{longname:'Emotions',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},getControlHTML:function(cn){switch(cn){case"emotions":return tinyMCE.getButtonHTML(cn,'lang_emotions_desc','{$pluginurl}/images/emotions.gif','mceEmotion')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceEmotion":var template=new Array();template['file']='../../plugins/emotions/emotions.htm';template['width']=250;template['height']=160;template['width']+=tinyMCE.getLang('lang_emotions_delta_width',0);template['height']+=tinyMCE.getLang('lang_emotions_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true}return false}};tinyMCE.addPlugin('emotions',TinyMCE_EmotionsPlugin);
\ No newline at end of file

Deleted: plog/trunk/js/tinymce/plugins/emotions/editor_plugin_src.js
===================================================================
--- plog/trunk/js/tinymce/plugins/emotions/editor_plugin_src.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/emotions/editor_plugin_src.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,63 +0,0 @@
-/**
- * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
- *
- * @author Moxiecode
- * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
- */
-
-/* Import plugin specific language pack */
-tinyMCE.importPluginLanguagePack('emotions');
-
-// Plucin static class
-var TinyMCE_EmotionsPlugin = {
-	getInfo : function() {
-		return {
-			longname : 'Emotions',
-			author : 'Moxiecode Systems AB',
-			authorurl : 'http://tinymce.moxiecode.com',
-			infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions',
-			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
-		};
-	},
-
-	/**
-	 * Returns the HTML contents of the emotions control.
-	 */
-	getControlHTML : function(cn) {
-		switch (cn) {
-			case "emotions":
-				return tinyMCE.getButtonHTML(cn, 'lang_emotions_desc', '{$pluginurl}/images/emotions.gif', 'mceEmotion');
-		}
-
-		return "";
-	},
-
-	/**
-	 * Executes the mceEmotion command.
-	 */
-	execCommand : function(editor_id, element, command, user_interface, value) {
-		// Handle commands
-		switch (command) {
-			case "mceEmotion":
-				var template = new Array();
-
-				template['file'] = '../../plugins/emotions/emotions.htm'; // Relative to theme
-				template['width'] = 250;
-				template['height'] = 160;
-
-				// Language specific width and height addons
-				template['width'] += tinyMCE.getLang('lang_emotions_delta_width', 0);
-				template['height'] += tinyMCE.getLang('lang_emotions_delta_height', 0);
-
-				tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});
-
-				return true;
-		}
-
-		// Pass to next handler in chain
-		return false;
-	}
-};
-
-// Register plugin
-tinyMCE.addPlugin('emotions', TinyMCE_EmotionsPlugin);

Copied: plog/trunk/js/tinymce/plugins/emotions/editor_plugin_src.js (from rev 7165, plog/trunk/js/tinymce/plugins/emotions/editor_plugin_src.js)
===================================================================
--- plog/trunk/js/tinymce/plugins/emotions/editor_plugin_src.js	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/emotions/editor_plugin_src.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,63 @@
+/**
+ * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
+ */
+
+/* Import plugin specific language pack */
+tinyMCE.importPluginLanguagePack('emotions');
+
+// Plucin static class
+var TinyMCE_EmotionsPlugin = {
+	getInfo : function() {
+		return {
+			longname : 'Emotions',
+			author : 'Moxiecode Systems AB',
+			authorurl : 'http://tinymce.moxiecode.com',
+			infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions',
+			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+		};
+	},
+
+	/**
+	 * Returns the HTML contents of the emotions control.
+	 */
+	getControlHTML : function(cn) {
+		switch (cn) {
+			case "emotions":
+				return tinyMCE.getButtonHTML(cn, 'lang_emotions_desc', '{$pluginurl}/images/emotions.gif', 'mceEmotion');
+		}
+
+		return "";
+	},
+
+	/**
+	 * Executes the mceEmotion command.
+	 */
+	execCommand : function(editor_id, element, command, user_interface, value) {
+		// Handle commands
+		switch (command) {
+			case "mceEmotion":
+				var template = new Array();
+
+				template['file'] = '../../plugins/emotions/emotions.htm'; // Relative to theme
+				template['width'] = 250;
+				template['height'] = 160;
+
+				// Language specific width and height addons
+				template['width'] += tinyMCE.getLang('lang_emotions_delta_width', 0);
+				template['height'] += tinyMCE.getLang('lang_emotions_delta_height', 0);
+
+				tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});
+
+				return true;
+		}
+
+		// Pass to next handler in chain
+		return false;
+	}
+};
+
+// Register plugin
+tinyMCE.addPlugin('emotions', TinyMCE_EmotionsPlugin);

Deleted: plog/trunk/js/tinymce/plugins/emotions/emotions.htm
===================================================================
--- plog/trunk/js/tinymce/plugins/emotions/emotions.htm	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/emotions/emotions.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,40 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-	<title>{$lang_emotions_title}</title>
-	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
-	<script language="javascript" type="text/javascript" src="jscripts/functions.js"></script>
-	<base target="_self" />
-</head>
-<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
-	<div align="center">
-		<div class="title">{$lang_emotions_title}:<br /><br /></div>
-
-		<table border="0" cellspacing="0" cellpadding="4">
-		  <tr>
-			<td><a href="javascript:insertEmotion('smiley-cool.gif','lang_emotions_cool');"><img src="images/smiley-cool.gif" width="18" height="18" border="0" alt="{$lang_emotions_cool}" title="{$lang_emotions_cool}" /></a></td>
-			<td><a href="javascript:insertEmotion('smiley-cry.gif','lang_emotions_cry');"><img src="images/smiley-cry.gif" width="18" height="18" border="0" alt="{$lang_emotions_cry}" title="{$lang_emotions_cry}" /></a></td>
-			<td><a href="javascript:insertEmotion('smiley-embarassed.gif','lang_emotions_embarassed');"><img src="images/smiley-embarassed.gif" width="18" height="18" border="0" alt="{$lang_emotions_embarassed}" title="{$lang_emotions_embarassed}" /></a></td>
-			<td><a href="javascript:insertEmotion('smiley-foot-in-mouth.gif','lang_emotions_foot_in_mouth');"><img src="images/smiley-foot-in-mouth.gif" width="18" height="18" border="0" alt="{$lang_emotions_foot_in_mouth}" title="{$lang_emotions_foot_in_mouth}" /></a></td>
-		  </tr>
-		  <tr>
-			<td><a href="javascript:insertEmotion('smiley-frown.gif','lang_emotions_frown');"><img src="images/smiley-frown.gif" width="18" height="18" border="0" alt="{$lang_emotions_frown}" title="{$lang_emotions_frown}" /></a></td>
-			<td><a href="javascript:insertEmotion('smiley-innocent.gif','lang_emotions_innocent');"><img src="images/smiley-innocent.gif" width="18" height="18" border="0" alt="{$lang_emotions_innocent}" title="{$lang_emotions_innocent}" /></a></td>
-			<td><a href="javascript:insertEmotion('smiley-kiss.gif','lang_emotions_kiss');"><img src="images/smiley-kiss.gif" width="18" height="18" border="0" alt="{$lang_emotions_kiss}" title="{$lang_emotions_kiss}" /></a></td>
-			<td><a href="javascript:insertEmotion('smiley-laughing.gif','lang_emotions_laughing');"><img src="images/smiley-laughing.gif" width="18" height="18" border="0" alt="{$lang_emotions_laughing}" title="{$lang_emotions_laughing}" /></a></td>
-		  </tr>
-		  <tr>
-			<td><a href="javascript:insertEmotion('smiley-money-mouth.gif','lang_emotions_money_mouth');"><img src="images/smiley-money-mouth.gif" width="18" height="18" border="0" alt="{$lang_emotions_money_mouth}" title="{$lang_emotions_money_mouth}" /></a></td>
-			<td><a href="javascript:insertEmotion('smiley-sealed.gif','lang_emotions_sealed');"><img src="images/smiley-sealed.gif" width="18" height="18" border="0" alt="{$lang_emotions_sealed}" title="{$lang_emotions_sealed}" /></a></td>
-			<td><a href="javascript:insertEmotion('smiley-smile.gif','lang_emotions_smile');"><img src="images/smiley-smile.gif" width="18" height="18" border="0" alt="{$lang_emotions_smile}" title="{$lang_emotions_smile}" /></a></td>
-			<td><a href="javascript:insertEmotion('smiley-surprised.gif','lang_emotions_surprised');"><img src="images/smiley-surprised.gif" width="18" height="18" border="0" alt="{$lang_emotions_surprised}" title="{$lang_emotions_surprised}" /></a></td>
-		  </tr>
-		  <tr>
-			<td><a href="javascript:insertEmotion('smiley-tongue-out.gif','lang_emotions_tongue_out');"><img src="images/smiley-tongue-out.gif" width="18" height="18" border="0" alt="{$lang_emotions_tongue-out}" title="{$lang_emotions_tongue_out}" /></a></td>
-			<td><a href="javascript:insertEmotion('smiley-undecided.gif','lang_emotions_undecided');"><img src="images/smiley-undecided.gif" width="18" height="18" border="0" alt="{$lang_emotions_undecided}" title="{$lang_emotions_undecided}" /></a></td>
-			<td><a href="javascript:insertEmotion('smiley-wink.gif','lang_emotions_wink');"><img src="images/smiley-wink.gif" width="18" height="18" border="0" alt="{$lang_emotions_wink}" title="{$lang_emotions_wink}" /></a></td>
-			<td><a href="javascript:insertEmotion('smiley-yell.gif','lang_emotions_yell');"><img src="images/smiley-yell.gif" width="18" height="18" border="0" alt="{$lang_emotions_yell}" title="{$lang_emotions_yell}" /></a></td>
-		  </tr>
-		</table>
-	</div>
-</body>
-</html>

Copied: plog/trunk/js/tinymce/plugins/emotions/emotions.htm (from rev 7165, plog/trunk/js/tinymce/plugins/emotions/emotions.htm)
===================================================================
--- plog/trunk/js/tinymce/plugins/emotions/emotions.htm	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/emotions/emotions.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,40 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{$lang_emotions_title}</title>
+	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script language="javascript" type="text/javascript" src="jscripts/functions.js"></script>
+	<base target="_self" />
+</head>
+<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
+	<div align="center">
+		<div class="title">{$lang_emotions_title}:<br /><br /></div>
+
+		<table border="0" cellspacing="0" cellpadding="4">
+		  <tr>
+			<td><a href="javascript:insertEmotion('smiley-cool.gif','lang_emotions_cool');"><img src="images/smiley-cool.gif" width="18" height="18" border="0" alt="{$lang_emotions_cool}" title="{$lang_emotions_cool}" /></a></td>
+			<td><a href="javascript:insertEmotion('smiley-cry.gif','lang_emotions_cry');"><img src="images/smiley-cry.gif" width="18" height="18" border="0" alt="{$lang_emotions_cry}" title="{$lang_emotions_cry}" /></a></td>
+			<td><a href="javascript:insertEmotion('smiley-embarassed.gif','lang_emotions_embarassed');"><img src="images/smiley-embarassed.gif" width="18" height="18" border="0" alt="{$lang_emotions_embarassed}" title="{$lang_emotions_embarassed}" /></a></td>
+			<td><a href="javascript:insertEmotion('smiley-foot-in-mouth.gif','lang_emotions_foot_in_mouth');"><img src="images/smiley-foot-in-mouth.gif" width="18" height="18" border="0" alt="{$lang_emotions_foot_in_mouth}" title="{$lang_emotions_foot_in_mouth}" /></a></td>
+		  </tr>
+		  <tr>
+			<td><a href="javascript:insertEmotion('smiley-frown.gif','lang_emotions_frown');"><img src="images/smiley-frown.gif" width="18" height="18" border="0" alt="{$lang_emotions_frown}" title="{$lang_emotions_frown}" /></a></td>
+			<td><a href="javascript:insertEmotion('smiley-innocent.gif','lang_emotions_innocent');"><img src="images/smiley-innocent.gif" width="18" height="18" border="0" alt="{$lang_emotions_innocent}" title="{$lang_emotions_innocent}" /></a></td>
+			<td><a href="javascript:insertEmotion('smiley-kiss.gif','lang_emotions_kiss');"><img src="images/smiley-kiss.gif" width="18" height="18" border="0" alt="{$lang_emotions_kiss}" title="{$lang_emotions_kiss}" /></a></td>
+			<td><a href="javascript:insertEmotion('smiley-laughing.gif','lang_emotions_laughing');"><img src="images/smiley-laughing.gif" width="18" height="18" border="0" alt="{$lang_emotions_laughing}" title="{$lang_emotions_laughing}" /></a></td>
+		  </tr>
+		  <tr>
+			<td><a href="javascript:insertEmotion('smiley-money-mouth.gif','lang_emotions_money_mouth');"><img src="images/smiley-money-mouth.gif" width="18" height="18" border="0" alt="{$lang_emotions_money_mouth}" title="{$lang_emotions_money_mouth}" /></a></td>
+			<td><a href="javascript:insertEmotion('smiley-sealed.gif','lang_emotions_sealed');"><img src="images/smiley-sealed.gif" width="18" height="18" border="0" alt="{$lang_emotions_sealed}" title="{$lang_emotions_sealed}" /></a></td>
+			<td><a href="javascript:insertEmotion('smiley-smile.gif','lang_emotions_smile');"><img src="images/smiley-smile.gif" width="18" height="18" border="0" alt="{$lang_emotions_smile}" title="{$lang_emotions_smile}" /></a></td>
+			<td><a href="javascript:insertEmotion('smiley-surprised.gif','lang_emotions_surprised');"><img src="images/smiley-surprised.gif" width="18" height="18" border="0" alt="{$lang_emotions_surprised}" title="{$lang_emotions_surprised}" /></a></td>
+		  </tr>
+		  <tr>
+			<td><a href="javascript:insertEmotion('smiley-tongue-out.gif','lang_emotions_tongue_out');"><img src="images/smiley-tongue-out.gif" width="18" height="18" border="0" alt="{$lang_emotions_tongue-out}" title="{$lang_emotions_tongue_out}" /></a></td>
+			<td><a href="javascript:insertEmotion('smiley-undecided.gif','lang_emotions_undecided');"><img src="images/smiley-undecided.gif" width="18" height="18" border="0" alt="{$lang_emotions_undecided}" title="{$lang_emotions_undecided}" /></a></td>
+			<td><a href="javascript:insertEmotion('smiley-wink.gif','lang_emotions_wink');"><img src="images/smiley-wink.gif" width="18" height="18" border="0" alt="{$lang_emotions_wink}" title="{$lang_emotions_wink}" /></a></td>
+			<td><a href="javascript:insertEmotion('smiley-yell.gif','lang_emotions_yell');"><img src="images/smiley-yell.gif" width="18" height="18" border="0" alt="{$lang_emotions_yell}" title="{$lang_emotions_yell}" /></a></td>
+		  </tr>
+		</table>
+	</div>
+</body>
+</html>

Deleted: plog/trunk/js/tinymce/plugins/emotions/images/emotions.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/emotions/images/emotions.gif (from rev 7165, plog/trunk/js/tinymce/plugins/emotions/images/emotions.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/emotions/images/readme.txt
===================================================================
--- plog/trunk/js/tinymce/plugins/emotions/images/readme.txt	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/emotions/images/readme.txt	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,2 +0,0 @@
-These emotions where taken from Mozilla Thunderbird.
-I hope they don't get angry if I use them here after all this is a open source project aswell.

Copied: plog/trunk/js/tinymce/plugins/emotions/images/readme.txt (from rev 7165, plog/trunk/js/tinymce/plugins/emotions/images/readme.txt)
===================================================================
--- plog/trunk/js/tinymce/plugins/emotions/images/readme.txt	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/emotions/images/readme.txt	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,2 @@
+These emotions where taken from Mozilla Thunderbird.
+I hope they don't get angry if I use them here after all this is a open source project aswell.

Deleted: plog/trunk/js/tinymce/plugins/emotions/images/smiley-cool.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/emotions/images/smiley-cool.gif (from rev 7165, plog/trunk/js/tinymce/plugins/emotions/images/smiley-cool.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/emotions/images/smiley-cry.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/emotions/images/smiley-cry.gif (from rev 7165, plog/trunk/js/tinymce/plugins/emotions/images/smiley-cry.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/emotions/images/smiley-embarassed.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/emotions/images/smiley-embarassed.gif (from rev 7165, plog/trunk/js/tinymce/plugins/emotions/images/smiley-embarassed.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/emotions/images/smiley-foot-in-mouth.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/emotions/images/smiley-foot-in-mouth.gif (from rev 7165, plog/trunk/js/tinymce/plugins/emotions/images/smiley-foot-in-mouth.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/emotions/images/smiley-frown.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/emotions/images/smiley-frown.gif (from rev 7165, plog/trunk/js/tinymce/plugins/emotions/images/smiley-frown.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/emotions/images/smiley-innocent.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/emotions/images/smiley-innocent.gif (from rev 7165, plog/trunk/js/tinymce/plugins/emotions/images/smiley-innocent.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/emotions/images/smiley-kiss.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/emotions/images/smiley-kiss.gif (from rev 7165, plog/trunk/js/tinymce/plugins/emotions/images/smiley-kiss.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/emotions/images/smiley-laughing.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/emotions/images/smiley-laughing.gif (from rev 7165, plog/trunk/js/tinymce/plugins/emotions/images/smiley-laughing.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/emotions/images/smiley-money-mouth.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/emotions/images/smiley-money-mouth.gif (from rev 7165, plog/trunk/js/tinymce/plugins/emotions/images/smiley-money-mouth.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/emotions/images/smiley-sealed.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/emotions/images/smiley-sealed.gif (from rev 7165, plog/trunk/js/tinymce/plugins/emotions/images/smiley-sealed.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/emotions/images/smiley-smile.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/emotions/images/smiley-smile.gif (from rev 7165, plog/trunk/js/tinymce/plugins/emotions/images/smiley-smile.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/emotions/images/smiley-surprised.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/emotions/images/smiley-surprised.gif (from rev 7165, plog/trunk/js/tinymce/plugins/emotions/images/smiley-surprised.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/emotions/images/smiley-tongue-out.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/emotions/images/smiley-tongue-out.gif (from rev 7165, plog/trunk/js/tinymce/plugins/emotions/images/smiley-tongue-out.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/emotions/images/smiley-undecided.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/emotions/images/smiley-undecided.gif (from rev 7165, plog/trunk/js/tinymce/plugins/emotions/images/smiley-undecided.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/emotions/images/smiley-wink.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/emotions/images/smiley-wink.gif (from rev 7165, plog/trunk/js/tinymce/plugins/emotions/images/smiley-wink.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/emotions/images/smiley-yell.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/emotions/images/smiley-yell.gif (from rev 7165, plog/trunk/js/tinymce/plugins/emotions/images/smiley-yell.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/emotions/jscripts/functions.js
===================================================================
--- plog/trunk/js/tinymce/plugins/emotions/jscripts/functions.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/emotions/jscripts/functions.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,21 +0,0 @@
-function init() {
-	tinyMCEPopup.resizeToInnerSize();
-}
-
-function insertEmotion(file_name, title) {
-	title = tinyMCE.getLang(title);
-
-	if (title == null)
-		title = "";
-
-	// XML encode
-	title = title.replace(/&/g, '&');
-	title = title.replace(/\"/g, '"');
-	title = title.replace(/</g, '<');
-	title = title.replace(/>/g, '>');
-
-	var html = '<img src="' + tinyMCE.baseURL + "/plugins/emotions/images/" + file_name + '" mce_src="' + tinyMCE.baseURL + "/plugins/emotions/images/" + file_name + '" border="0" alt="' + title + '" title="' + title + '" />';
-
-	tinyMCE.execCommand('mceInsertContent', false, html);
-	tinyMCEPopup.close();
-}

Copied: plog/trunk/js/tinymce/plugins/emotions/jscripts/functions.js (from rev 7165, plog/trunk/js/tinymce/plugins/emotions/jscripts/functions.js)
===================================================================
--- plog/trunk/js/tinymce/plugins/emotions/jscripts/functions.js	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/emotions/jscripts/functions.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,21 @@
+function init() {
+	tinyMCEPopup.resizeToInnerSize();
+}
+
+function insertEmotion(file_name, title) {
+	title = tinyMCE.getLang(title);
+
+	if (title == null)
+		title = "";
+
+	// XML encode
+	title = title.replace(/&/g, '&');
+	title = title.replace(/\"/g, '"');
+	title = title.replace(/</g, '<');
+	title = title.replace(/>/g, '>');
+
+	var html = '<img src="' + tinyMCE.baseURL + "/plugins/emotions/images/" + file_name + '" mce_src="' + tinyMCE.baseURL + "/plugins/emotions/images/" + file_name + '" border="0" alt="' + title + '" title="' + title + '" />';
+
+	tinyMCE.execCommand('mceInsertContent', false, html);
+	tinyMCEPopup.close();
+}

Deleted: plog/trunk/js/tinymce/plugins/emotions/langs/en.js
===================================================================
--- plog/trunk/js/tinymce/plugins/emotions/langs/en.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/emotions/langs/en.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,22 +0,0 @@
-// UK lang variables
-
-tinyMCE.addToLang('emotions',{
-title : 'Insert emotion',
-desc : 'Emotions',
-cool : 'Cool',
-cry : 'Cry',
-embarassed : 'Embarassed',
-foot_in_mouth : 'Foot in mouth',
-frown : 'Frown',
-innocent : 'Innocent',
-kiss : 'Kiss',
-laughing : 'Laughing',
-money_mouth : 'Money mouth',
-sealed : 'Sealed',
-smile : 'Smile',
-surprised : 'Surprised',
-tongue_out : 'Tongue out',
-undecided : 'Undecided',
-wink : 'Wink',
-yell : 'Yell'
-});

Copied: plog/trunk/js/tinymce/plugins/emotions/langs/en.js (from rev 7165, plog/trunk/js/tinymce/plugins/emotions/langs/en.js)
===================================================================
--- plog/trunk/js/tinymce/plugins/emotions/langs/en.js	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/emotions/langs/en.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,22 @@
+// UK lang variables
+
+tinyMCE.addToLang('emotions',{
+title : 'Insert emotion',
+desc : 'Emotions',
+cool : 'Cool',
+cry : 'Cry',
+embarassed : 'Embarassed',
+foot_in_mouth : 'Foot in mouth',
+frown : 'Frown',
+innocent : 'Innocent',
+kiss : 'Kiss',
+laughing : 'Laughing',
+money_mouth : 'Money mouth',
+sealed : 'Sealed',
+smile : 'Smile',
+surprised : 'Surprised',
+tongue_out : 'Tongue out',
+undecided : 'Undecided',
+wink : 'Wink',
+yell : 'Yell'
+});

Deleted: plog/trunk/js/tinymce/plugins/emotions/readme.txt
===================================================================
--- plog/trunk/js/tinymce/plugins/emotions/readme.txt	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/emotions/readme.txt	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1 +0,0 @@
-Check the TinyMCE documentation for details on this plugin.

Copied: plog/trunk/js/tinymce/plugins/emotions/readme.txt (from rev 7165, plog/trunk/js/tinymce/plugins/emotions/readme.txt)
===================================================================
--- plog/trunk/js/tinymce/plugins/emotions/readme.txt	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/emotions/readme.txt	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1 @@
+Check the TinyMCE documentation for details on this plugin.

Deleted: plog/trunk/js/tinymce/plugins/fullscreen/css/page.css
===================================================================
--- plog/trunk/js/tinymce/plugins/fullscreen/css/page.css	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/fullscreen/css/page.css	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,21 +0,0 @@
-/* This class restores all CSS properties to that absolute positioning of fullscreen mode is correct */
-.mceFullscreenPos {
-	display: block !important;
-	position: static !important;
-	left: 0 !important;
-	top: 0 !important;
-	bottom: auto !important;
-	right: auto !important;
-	width: auto !important;
-	height: auto !important;
-	margin: 0 !important;
-	padding: 0 !important;
-	border: 0 !important;
-	overflow: visible;
-	z-index: 1 !important;
-	clear: both;
-}
-
-body.mceFullscreen {
-	overflow: hidden !important;
-}

Copied: plog/trunk/js/tinymce/plugins/fullscreen/css/page.css (from rev 7165, plog/trunk/js/tinymce/plugins/fullscreen/css/page.css)
===================================================================
--- plog/trunk/js/tinymce/plugins/fullscreen/css/page.css	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/fullscreen/css/page.css	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,21 @@
+/* This class restores all CSS properties to that absolute positioning of fullscreen mode is correct */
+.mceFullscreenPos {
+	display: block !important;
+	position: static !important;
+	left: 0 !important;
+	top: 0 !important;
+	bottom: auto !important;
+	right: auto !important;
+	width: auto !important;
+	height: auto !important;
+	margin: 0 !important;
+	padding: 0 !important;
+	border: 0 !important;
+	overflow: visible;
+	z-index: 1 !important;
+	clear: both;
+}
+
+body.mceFullscreen {
+	overflow: hidden !important;
+}

Deleted: plog/trunk/js/tinymce/plugins/fullscreen/editor_plugin.js
===================================================================
--- plog/trunk/js/tinymce/plugins/fullscreen/editor_plugin.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/fullscreen/editor_plugin.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1 +0,0 @@
-tinyMCE.importPluginLanguagePack('fullscreen');var TinyMCE_FullScreenPlugin={getInfo:function(){return{longname:'Fullscreen',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){if(!tinyMCE.settings['fullscreen_skip_plugin_css'])tinyMCE.importCSS(inst.getContainerWin().document,tinyMCE.baseURL+"/plugins/fullscreen/css/page.css")},getControlHTML:function(cn){switch(cn){case"fullscreen":return tinyMCE.getButtonHTML(cn,'lang_fullscreen_desc','{$pluginurl}/images/fullscreen.gif','mceFullScreen')}return""},execCommand:function(editor_id,element,command,user_interface,value){var inst;switch(command){case"mceFullScreen":inst=tinyMCE.getInstanceById(editor_id);if(tinyMCE.getParam('fullscreen_new_window'))this._toggleFullscreenWin(inst);else this._toggleFullscreen(inst);return true}return false},_toggleFullscree
 nWin:function(inst){if(tinyMCE.getParam('fullscreen_is_enabled')){window.opener.tinyMCE.execInstanceCommand(tinyMCE.getParam('fullscreen_editor_id'),'mceSetContent',false,tinyMCE.getContent(inst.editorId));top.close()}else{tinyMCE.setWindowArg('editor_id',inst.editorId);var win=window.open(tinyMCE.baseURL+"/plugins/fullscreen/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{win.resizeTo(screen.availWidth,screen.availHeight)}catch(e){}}},_toggleFullscreen:function(inst){var ds=inst.getData('fullscreen'),editorContainer,tableElm,iframe,vp,cw,cd,re,w,h,si,blo,delta=0,cell,row,fcml,bcml;cw=inst.getContainerWin();cd=cw.document;editorContainer=cd.getElementById(inst.editorId+'_parent');tableElm=editorContainer.firstChild;iframe=inst.iframeElement;re=cd.getElementById(inst.editorId+'_resize');blo=document.getElementById('mce_fullscreen_blocker');fcm=new T
 inyMCE_Layer(inst.editorId+'_fcMenu');fcml=new TinyMCE_Layer(inst.editorId+'_fcMenu');bcml=new TinyMCE_Layer(inst.editorId+'_bcMenu');if(fcml.exists()&&fcml.isVisible()){tinyMCE.switchClass(inst.editorId+'_forecolor','mceMenuButton');fcml.hide()}if(bcml.exists()&&bcml.isVisible()){tinyMCE.switchClass(inst.editorId+'_backcolor','mceMenuButton');bcml.hide()}if(!ds.enabled){if(inst.toolbarElement){delta+=inst.toolbarElement.offsetHeight;cell=tableElm.tBodies[0].insertRow(0).insertCell(-1);cell.className='mceToolbarTop';cell.nowrap=true;ds.oldToolbarParent=inst.toolbarElement.parentNode;ds.toolbarHolder=document.createTextNode('...');cell.appendChild(ds.oldToolbarParent.replaceChild(ds.toolbarHolder,inst.toolbarElement))}ds.parents=[];vp=tinyMCE.getViewPort(cw);ds.scrollX=vp.left;ds.scrollY=vp.top;if(!tinyMCE.isOpera)tinyMCE.addCSSClass(cd.body,'mceFullscreen');tinyMCE.getParentNode(tableElm.parentNode,function(n){if(n.nodeName=='BODY')return true;if(n.nodeType==1)tinyMCE.addCSS
 Class(n,'mceFullscreenPos');return false});if(re)re.style.display='none';vp=tinyMCE.getViewPort(cw);ds.oldWidth=iframe.style.width?iframe.style.width:iframe.offsetWidth;ds.oldHeight=iframe.style.height?iframe.style.height:iframe.offsetHeight;ds.oldTWidth=tableElm.style.width?tableElm.style.width:tableElm.offsetWidth;ds.oldTHeight=tableElm.style.height?tableElm.style.height:tableElm.offsetHeight;if(ds.oldWidth&&ds.oldWidth.indexOf)ds.oldTWidth=ds.oldWidth.indexOf('%')!=-1?ds.oldWidth:ds.oldTWidth;if(!blo&&tinyMCE.isRealIE){blo=tinyMCE.createTag(document,'iframe',{id:'mce_fullscreen_blocker',src:'about:blank',frameBorder:0,width:vp.width,height:vp.height,style:'display: block; position: absolute; left: 0; top: 0; z-index: 999; margin: 0; padding: 0;'});document.body.appendChild(blo)}tableElm.style.position='absolute';tableElm.style.zIndex=1000;tableElm.style.left=tableElm.style.top='0';tableElm.style.width=vp.width+'px';tableElm.style.height=vp.height+'px';if(tinyMCE.isRealIE)
 {iframe.style.width=vp.width+'px';iframe.style.height=vp.height+'px';w=iframe.parentNode.clientWidth-(tableElm.offsetWidth-vp.width);h=iframe.parentNode.clientHeight-(tableElm.offsetHeight-vp.height)}else{w=iframe.parentNode.clientWidth;h=iframe.parentNode.clientHeight}iframe.style.width=w+"px";iframe.style.height=(h+delta)+"px";tinyMCE.switchClass(inst.editorId+'_fullscreen','mceButtonSelected');ds.enabled=true;inst.useCSS=false}else{if(inst.toolbarElement){row=inst.toolbarElement.parentNode.parentNode;row.parentNode.removeChild(row);ds.oldToolbarParent.replaceChild(inst.toolbarElement,ds.toolbarHolder);ds.oldToolbarParent=null;ds.toolbarHolder=null}if(blo)blo.parentNode.removeChild(blo);si=0;tinyMCE.getParentNode(tableElm.parentNode,function(n){if(n.nodeName=='BODY')return true;if(n.nodeType==1)tinyMCE.removeCSSClass(n,'mceFullscreenPos')});if(re&&tinyMCE.getParam("theme_advanced_resizing",false))re.style.display='block';tableElm.style.position='static';tableElm.style.zInd
 ex='';tableElm.style.width='';tableElm.style.height='';tableElm.style.width=ds.oldTWidth?ds.oldTWidth:'';tableElm.style.height=ds.oldTHeight?ds.oldTHeight:'';iframe.style.width=ds.oldWidth?ds.oldWidth:'';iframe.style.height=ds.oldHeight?ds.oldHeight:'';tinyMCE.switchClass(inst.editorId+'_fullscreen','mceButtonNormal');ds.enabled=false;tinyMCE.removeCSSClass(cd.body,'mceFullscreen');cw.scrollTo(ds.scrollX,ds.scrollY);inst.useCSS=false}},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(tinyMCE.getParam('fullscreen_is_enabled'))tinyMCE.switchClass(editor_id+'_fullscreen','mceButtonSelected');return true}};tinyMCE.addPlugin("fullscreen",TinyMCE_FullScreenPlugin);
\ No newline at end of file

Copied: plog/trunk/js/tinymce/plugins/fullscreen/editor_plugin.js (from rev 7165, plog/trunk/js/tinymce/plugins/fullscreen/editor_plugin.js)
===================================================================
--- plog/trunk/js/tinymce/plugins/fullscreen/editor_plugin.js	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/fullscreen/editor_plugin.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1 @@
+tinyMCE.importPluginLanguagePack('fullscreen');var TinyMCE_FullScreenPlugin={getInfo:function(){return{longname:'Fullscreen',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){if(!tinyMCE.settings['fullscreen_skip_plugin_css'])tinyMCE.importCSS(inst.getContainerWin().document,tinyMCE.baseURL+"/plugins/fullscreen/css/page.css")},getControlHTML:function(cn){switch(cn){case"fullscreen":return tinyMCE.getButtonHTML(cn,'lang_fullscreen_desc','{$pluginurl}/images/fullscreen.gif','mceFullScreen')}return""},execCommand:function(editor_id,element,command,user_interface,value){var inst;switch(command){case"mceFullScreen":inst=tinyMCE.getInstanceById(editor_id);if(tinyMCE.getParam('fullscreen_new_window'))this._toggleFullscreenWin(inst);else this._toggleFullscreen(inst);return true}return false},_toggleFullscree
 nWin:function(inst){if(tinyMCE.getParam('fullscreen_is_enabled')){window.opener.tinyMCE.execInstanceCommand(tinyMCE.getParam('fullscreen_editor_id'),'mceSetContent',false,tinyMCE.getContent(inst.editorId));top.close()}else{tinyMCE.setWindowArg('editor_id',inst.editorId);var win=window.open(tinyMCE.baseURL+"/plugins/fullscreen/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{win.resizeTo(screen.availWidth,screen.availHeight)}catch(e){}}},_toggleFullscreen:function(inst){var ds=inst.getData('fullscreen'),editorContainer,tableElm,iframe,vp,cw,cd,re,w,h,si,blo,delta=0,cell,row,fcml,bcml;cw=inst.getContainerWin();cd=cw.document;editorContainer=cd.getElementById(inst.editorId+'_parent');tableElm=editorContainer.firstChild;iframe=inst.iframeElement;re=cd.getElementById(inst.editorId+'_resize');blo=document.getElementById('mce_fullscreen_blocker');fcm=new T
 inyMCE_Layer(inst.editorId+'_fcMenu');fcml=new TinyMCE_Layer(inst.editorId+'_fcMenu');bcml=new TinyMCE_Layer(inst.editorId+'_bcMenu');if(fcml.exists()&&fcml.isVisible()){tinyMCE.switchClass(inst.editorId+'_forecolor','mceMenuButton');fcml.hide()}if(bcml.exists()&&bcml.isVisible()){tinyMCE.switchClass(inst.editorId+'_backcolor','mceMenuButton');bcml.hide()}if(!ds.enabled){if(inst.toolbarElement){delta+=inst.toolbarElement.offsetHeight;cell=tableElm.tBodies[0].insertRow(0).insertCell(-1);cell.className='mceToolbarTop';cell.nowrap=true;ds.oldToolbarParent=inst.toolbarElement.parentNode;ds.toolbarHolder=document.createTextNode('...');cell.appendChild(ds.oldToolbarParent.replaceChild(ds.toolbarHolder,inst.toolbarElement))}ds.parents=[];vp=tinyMCE.getViewPort(cw);ds.scrollX=vp.left;ds.scrollY=vp.top;if(!tinyMCE.isOpera)tinyMCE.addCSSClass(cd.body,'mceFullscreen');tinyMCE.getParentNode(tableElm.parentNode,function(n){if(n.nodeName=='BODY')return true;if(n.nodeType==1)tinyMCE.addCSS
 Class(n,'mceFullscreenPos');return false});if(re)re.style.display='none';vp=tinyMCE.getViewPort(cw);ds.oldWidth=iframe.style.width?iframe.style.width:iframe.offsetWidth;ds.oldHeight=iframe.style.height?iframe.style.height:iframe.offsetHeight;ds.oldTWidth=tableElm.style.width?tableElm.style.width:tableElm.offsetWidth;ds.oldTHeight=tableElm.style.height?tableElm.style.height:tableElm.offsetHeight;if(ds.oldWidth&&ds.oldWidth.indexOf)ds.oldTWidth=ds.oldWidth.indexOf('%')!=-1?ds.oldWidth:ds.oldTWidth;if(!blo&&tinyMCE.isRealIE){blo=tinyMCE.createTag(document,'iframe',{id:'mce_fullscreen_blocker',src:'about:blank',frameBorder:0,width:vp.width,height:vp.height,style:'display: block; position: absolute; left: 0; top: 0; z-index: 999; margin: 0; padding: 0;'});document.body.appendChild(blo)}tableElm.style.position='absolute';tableElm.style.zIndex=1000;tableElm.style.left=tableElm.style.top='0';tableElm.style.width=vp.width+'px';tableElm.style.height=vp.height+'px';if(tinyMCE.isRealIE)
 {iframe.style.width=vp.width+'px';iframe.style.height=vp.height+'px';w=iframe.parentNode.clientWidth-(tableElm.offsetWidth-vp.width);h=iframe.parentNode.clientHeight-(tableElm.offsetHeight-vp.height)}else{w=iframe.parentNode.clientWidth;h=iframe.parentNode.clientHeight}iframe.style.width=w+"px";iframe.style.height=(h+delta)+"px";tinyMCE.switchClass(inst.editorId+'_fullscreen','mceButtonSelected');ds.enabled=true;inst.useCSS=false}else{if(inst.toolbarElement){row=inst.toolbarElement.parentNode.parentNode;row.parentNode.removeChild(row);ds.oldToolbarParent.replaceChild(inst.toolbarElement,ds.toolbarHolder);ds.oldToolbarParent=null;ds.toolbarHolder=null}if(blo)blo.parentNode.removeChild(blo);si=0;tinyMCE.getParentNode(tableElm.parentNode,function(n){if(n.nodeName=='BODY')return true;if(n.nodeType==1)tinyMCE.removeCSSClass(n,'mceFullscreenPos')});if(re&&tinyMCE.getParam("theme_advanced_resizing",false))re.style.display='block';tableElm.style.position='static';tableElm.style.zInd
 ex='';tableElm.style.width='';tableElm.style.height='';tableElm.style.width=ds.oldTWidth?ds.oldTWidth:'';tableElm.style.height=ds.oldTHeight?ds.oldTHeight:'';iframe.style.width=ds.oldWidth?ds.oldWidth:'';iframe.style.height=ds.oldHeight?ds.oldHeight:'';tinyMCE.switchClass(inst.editorId+'_fullscreen','mceButtonNormal');ds.enabled=false;tinyMCE.removeCSSClass(cd.body,'mceFullscreen');cw.scrollTo(ds.scrollX,ds.scrollY);inst.useCSS=false}},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(tinyMCE.getParam('fullscreen_is_enabled'))tinyMCE.switchClass(editor_id+'_fullscreen','mceButtonSelected');return true}};tinyMCE.addPlugin("fullscreen",TinyMCE_FullScreenPlugin);
\ No newline at end of file

Deleted: plog/trunk/js/tinymce/plugins/fullscreen/editor_plugin_src.js
===================================================================
--- plog/trunk/js/tinymce/plugins/fullscreen/editor_plugin_src.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/fullscreen/editor_plugin_src.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,230 +0,0 @@
-/**
- * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
- *
- * @author Moxiecode
- * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
- */
-
-/* Import plugin specific language pack */
-tinyMCE.importPluginLanguagePack('fullscreen');
-
-var TinyMCE_FullScreenPlugin = {
-	getInfo : function() {
-		return {
-			longname : 'Fullscreen',
-			author : 'Moxiecode Systems AB',
-			authorurl : 'http://tinymce.moxiecode.com',
-			infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen',
-			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
-		};
-	},
-
-	initInstance : function(inst) {
-		if (!tinyMCE.settings['fullscreen_skip_plugin_css'])
-			tinyMCE.importCSS(inst.getContainerWin().document, tinyMCE.baseURL + "/plugins/fullscreen/css/page.css");
-	},
-
-	getControlHTML : function(cn) {
-		switch (cn) {
-			case "fullscreen":
-				return tinyMCE.getButtonHTML(cn, 'lang_fullscreen_desc', '{$pluginurl}/images/fullscreen.gif', 'mceFullScreen');
-		}
-
-		return "";
-	},
-
-	execCommand : function(editor_id, element, command, user_interface, value) {
-		var inst;
-
-		// Handle commands
-		switch (command) {
-			case "mceFullScreen":
-				inst = tinyMCE.getInstanceById(editor_id);
-
-				if (tinyMCE.getParam('fullscreen_new_window'))
-					this._toggleFullscreenWin(inst);
-				else
-					this._toggleFullscreen(inst);
-
-				return true;
-		}
-
-		// Pass to next handler in chain
-		return false;
-	},
-
-	_toggleFullscreenWin : function(inst) {
-		if (tinyMCE.getParam('fullscreen_is_enabled')) {
-			// In fullscreen mode
-			window.opener.tinyMCE.execInstanceCommand(tinyMCE.getParam('fullscreen_editor_id'), 'mceSetContent', false, tinyMCE.getContent(inst.editorId));
-			top.close();
-		} else {
-			tinyMCE.setWindowArg('editor_id', inst.editorId);
-
-			var win = window.open(tinyMCE.baseURL + "/plugins/fullscreen/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight);
-			try { win.resizeTo(screen.availWidth, screen.availHeight); } catch (e) {}
-		}
-	},
-
-	_toggleFullscreen : function(inst) {
-		var ds = inst.getData('fullscreen'), editorContainer, tableElm, iframe, vp, cw, cd, re, w, h, si, blo, delta = 0, cell, row, fcml, bcml;
-
-		cw = inst.getContainerWin();
-		cd = cw.document;
-		editorContainer = cd.getElementById(inst.editorId + '_parent');
-		tableElm = editorContainer.firstChild;
-		iframe = inst.iframeElement;
-		re = cd.getElementById(inst.editorId + '_resize');
-		blo = document.getElementById('mce_fullscreen_blocker');
-		fcm = new TinyMCE_Layer(inst.editorId + '_fcMenu');
-		fcml = new TinyMCE_Layer(inst.editorId + '_fcMenu');
-		bcml = new TinyMCE_Layer(inst.editorId + '_bcMenu');
-
-		if (fcml.exists() && fcml.isVisible()) {
-			tinyMCE.switchClass(inst.editorId + '_forecolor', 'mceMenuButton');
-			fcml.hide();
-		}
-
-		if (bcml.exists() && bcml.isVisible()) {
-			tinyMCE.switchClass(inst.editorId + '_backcolor', 'mceMenuButton');
-			bcml.hide();
-		}
-
-		if (!ds.enabled) {
-			// Handle External Toolbar
-			if (inst.toolbarElement) {
-				delta += inst.toolbarElement.offsetHeight;
-
-				cell = tableElm.tBodies[0].insertRow(0).insertCell(-1);
-				cell.className = 'mceToolbarTop';
-				cell.nowrap = true;
-
-				ds.oldToolbarParent = inst.toolbarElement.parentNode;
-				ds.toolbarHolder = document.createTextNode('...');
-
-				cell.appendChild(ds.oldToolbarParent.replaceChild(ds.toolbarHolder, inst.toolbarElement));
-			}
-
-			ds.parents = [];
-
-			vp = tinyMCE.getViewPort(cw);
-			ds.scrollX = vp.left;
-			ds.scrollY = vp.top;
-
-			// Opera has a bug restoring scrollbars
-			if (!tinyMCE.isOpera)
-				tinyMCE.addCSSClass(cd.body, 'mceFullscreen');
-
-			tinyMCE.getParentNode(tableElm.parentNode, function (n) {
-				if (n.nodeName == 'BODY')
-					return true;
-
-				if (n.nodeType == 1)
-					tinyMCE.addCSSClass(n, 'mceFullscreenPos');
-
-				return false;
-			});
-
-			if (re)
-				re.style.display = 'none';
-
-			vp = tinyMCE.getViewPort(cw);
-
-			ds.oldWidth = iframe.style.width ? iframe.style.width : iframe.offsetWidth;
-			ds.oldHeight = iframe.style.height ? iframe.style.height : iframe.offsetHeight;
-			ds.oldTWidth = tableElm.style.width ? tableElm.style.width : tableElm.offsetWidth;
-			ds.oldTHeight = tableElm.style.height ? tableElm.style.height : tableElm.offsetHeight;
-
-			// Handle % width
-			if (ds.oldWidth && ds.oldWidth.indexOf)
-				ds.oldTWidth = ds.oldWidth.indexOf('%') != -1 ? ds.oldWidth : ds.oldTWidth;
-
-			if (!blo && tinyMCE.isRealIE) {
-				blo = tinyMCE.createTag(document, 'iframe', {id : 'mce_fullscreen_blocker', src : 'about:blank', frameBorder : 0, width : vp.width, height : vp.height, style : 'display: block; position: absolute; left: 0; top: 0; z-index: 999; margin: 0; padding: 0;'});
-				document.body.appendChild(blo);
-			}
-
-			tableElm.style.position = 'absolute';
-			tableElm.style.zIndex = 1000;
-			tableElm.style.left = tableElm.style.top = '0';
-
-			tableElm.style.width = vp.width + 'px';
-			tableElm.style.height = vp.height + 'px';
-
-			if (tinyMCE.isRealIE) {
-				iframe.style.width = vp.width + 'px';
-				iframe.style.height = vp.height + 'px';
-
-				// Calc new width/height based on overflow
-				w = iframe.parentNode.clientWidth - (tableElm.offsetWidth - vp.width);
-				h = iframe.parentNode.clientHeight - (tableElm.offsetHeight - vp.height);
-			} else {
-				w = iframe.parentNode.clientWidth;
-				h = iframe.parentNode.clientHeight;
-			}
-
-			iframe.style.width = w + "px";
-			iframe.style.height = (h+delta) + "px";
-
-			tinyMCE.switchClass(inst.editorId + '_fullscreen', 'mceButtonSelected');
-			ds.enabled = true;
-
-			inst.useCSS = false;
-		} else {
-			// Handle External Toolbar
-			if (inst.toolbarElement) {
-				row = inst.toolbarElement.parentNode.parentNode;
-
-				row.parentNode.removeChild(row);
-
-				ds.oldToolbarParent.replaceChild(inst.toolbarElement, ds.toolbarHolder);
-
-				ds.oldToolbarParent = null;
-				ds.toolbarHolder = null;
-			}
-
-			if (blo)
-				blo.parentNode.removeChild(blo);
-
-			si = 0;
-			tinyMCE.getParentNode(tableElm.parentNode, function (n) {
-				if (n.nodeName == 'BODY')
-					return true;
-
-				if (n.nodeType == 1)
-					tinyMCE.removeCSSClass(n, 'mceFullscreenPos');
-			});
-
-			if (re && tinyMCE.getParam("theme_advanced_resizing", false))
-				re.style.display = 'block';
-
-			tableElm.style.position = 'static';
-			tableElm.style.zIndex = '';
-			tableElm.style.width = '';
-			tableElm.style.height = '';
-
-			tableElm.style.width = ds.oldTWidth ? ds.oldTWidth : '';
-			tableElm.style.height = ds.oldTHeight ? ds.oldTHeight : '';
-
-			iframe.style.width = ds.oldWidth ? ds.oldWidth : '';
-			iframe.style.height = ds.oldHeight ? ds.oldHeight : '';
-
-			tinyMCE.switchClass(inst.editorId + '_fullscreen', 'mceButtonNormal');
-			ds.enabled = false;
-
-			tinyMCE.removeCSSClass(cd.body, 'mceFullscreen');
-			cw.scrollTo(ds.scrollX, ds.scrollY);
-
-			inst.useCSS = false;
-		}
-	},
-
-	handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
-		if (tinyMCE.getParam('fullscreen_is_enabled'))
-			tinyMCE.switchClass(editor_id + '_fullscreen', 'mceButtonSelected');
-
-		return true;
-	}
-};
-
-tinyMCE.addPlugin("fullscreen", TinyMCE_FullScreenPlugin);

Copied: plog/trunk/js/tinymce/plugins/fullscreen/editor_plugin_src.js (from rev 7165, plog/trunk/js/tinymce/plugins/fullscreen/editor_plugin_src.js)
===================================================================
--- plog/trunk/js/tinymce/plugins/fullscreen/editor_plugin_src.js	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/fullscreen/editor_plugin_src.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,230 @@
+/**
+ * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
+ */
+
+/* Import plugin specific language pack */
+tinyMCE.importPluginLanguagePack('fullscreen');
+
+var TinyMCE_FullScreenPlugin = {
+	getInfo : function() {
+		return {
+			longname : 'Fullscreen',
+			author : 'Moxiecode Systems AB',
+			authorurl : 'http://tinymce.moxiecode.com',
+			infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen',
+			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+		};
+	},
+
+	initInstance : function(inst) {
+		if (!tinyMCE.settings['fullscreen_skip_plugin_css'])
+			tinyMCE.importCSS(inst.getContainerWin().document, tinyMCE.baseURL + "/plugins/fullscreen/css/page.css");
+	},
+
+	getControlHTML : function(cn) {
+		switch (cn) {
+			case "fullscreen":
+				return tinyMCE.getButtonHTML(cn, 'lang_fullscreen_desc', '{$pluginurl}/images/fullscreen.gif', 'mceFullScreen');
+		}
+
+		return "";
+	},
+
+	execCommand : function(editor_id, element, command, user_interface, value) {
+		var inst;
+
+		// Handle commands
+		switch (command) {
+			case "mceFullScreen":
+				inst = tinyMCE.getInstanceById(editor_id);
+
+				if (tinyMCE.getParam('fullscreen_new_window'))
+					this._toggleFullscreenWin(inst);
+				else
+					this._toggleFullscreen(inst);
+
+				return true;
+		}
+
+		// Pass to next handler in chain
+		return false;
+	},
+
+	_toggleFullscreenWin : function(inst) {
+		if (tinyMCE.getParam('fullscreen_is_enabled')) {
+			// In fullscreen mode
+			window.opener.tinyMCE.execInstanceCommand(tinyMCE.getParam('fullscreen_editor_id'), 'mceSetContent', false, tinyMCE.getContent(inst.editorId));
+			top.close();
+		} else {
+			tinyMCE.setWindowArg('editor_id', inst.editorId);
+
+			var win = window.open(tinyMCE.baseURL + "/plugins/fullscreen/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight);
+			try { win.resizeTo(screen.availWidth, screen.availHeight); } catch (e) {}
+		}
+	},
+
+	_toggleFullscreen : function(inst) {
+		var ds = inst.getData('fullscreen'), editorContainer, tableElm, iframe, vp, cw, cd, re, w, h, si, blo, delta = 0, cell, row, fcml, bcml;
+
+		cw = inst.getContainerWin();
+		cd = cw.document;
+		editorContainer = cd.getElementById(inst.editorId + '_parent');
+		tableElm = editorContainer.firstChild;
+		iframe = inst.iframeElement;
+		re = cd.getElementById(inst.editorId + '_resize');
+		blo = document.getElementById('mce_fullscreen_blocker');
+		fcm = new TinyMCE_Layer(inst.editorId + '_fcMenu');
+		fcml = new TinyMCE_Layer(inst.editorId + '_fcMenu');
+		bcml = new TinyMCE_Layer(inst.editorId + '_bcMenu');
+
+		if (fcml.exists() && fcml.isVisible()) {
+			tinyMCE.switchClass(inst.editorId + '_forecolor', 'mceMenuButton');
+			fcml.hide();
+		}
+
+		if (bcml.exists() && bcml.isVisible()) {
+			tinyMCE.switchClass(inst.editorId + '_backcolor', 'mceMenuButton');
+			bcml.hide();
+		}
+
+		if (!ds.enabled) {
+			// Handle External Toolbar
+			if (inst.toolbarElement) {
+				delta += inst.toolbarElement.offsetHeight;
+
+				cell = tableElm.tBodies[0].insertRow(0).insertCell(-1);
+				cell.className = 'mceToolbarTop';
+				cell.nowrap = true;
+
+				ds.oldToolbarParent = inst.toolbarElement.parentNode;
+				ds.toolbarHolder = document.createTextNode('...');
+
+				cell.appendChild(ds.oldToolbarParent.replaceChild(ds.toolbarHolder, inst.toolbarElement));
+			}
+
+			ds.parents = [];
+
+			vp = tinyMCE.getViewPort(cw);
+			ds.scrollX = vp.left;
+			ds.scrollY = vp.top;
+
+			// Opera has a bug restoring scrollbars
+			if (!tinyMCE.isOpera)
+				tinyMCE.addCSSClass(cd.body, 'mceFullscreen');
+
+			tinyMCE.getParentNode(tableElm.parentNode, function (n) {
+				if (n.nodeName == 'BODY')
+					return true;
+
+				if (n.nodeType == 1)
+					tinyMCE.addCSSClass(n, 'mceFullscreenPos');
+
+				return false;
+			});
+
+			if (re)
+				re.style.display = 'none';
+
+			vp = tinyMCE.getViewPort(cw);
+
+			ds.oldWidth = iframe.style.width ? iframe.style.width : iframe.offsetWidth;
+			ds.oldHeight = iframe.style.height ? iframe.style.height : iframe.offsetHeight;
+			ds.oldTWidth = tableElm.style.width ? tableElm.style.width : tableElm.offsetWidth;
+			ds.oldTHeight = tableElm.style.height ? tableElm.style.height : tableElm.offsetHeight;
+
+			// Handle % width
+			if (ds.oldWidth && ds.oldWidth.indexOf)
+				ds.oldTWidth = ds.oldWidth.indexOf('%') != -1 ? ds.oldWidth : ds.oldTWidth;
+
+			if (!blo && tinyMCE.isRealIE) {
+				blo = tinyMCE.createTag(document, 'iframe', {id : 'mce_fullscreen_blocker', src : 'about:blank', frameBorder : 0, width : vp.width, height : vp.height, style : 'display: block; position: absolute; left: 0; top: 0; z-index: 999; margin: 0; padding: 0;'});
+				document.body.appendChild(blo);
+			}
+
+			tableElm.style.position = 'absolute';
+			tableElm.style.zIndex = 1000;
+			tableElm.style.left = tableElm.style.top = '0';
+
+			tableElm.style.width = vp.width + 'px';
+			tableElm.style.height = vp.height + 'px';
+
+			if (tinyMCE.isRealIE) {
+				iframe.style.width = vp.width + 'px';
+				iframe.style.height = vp.height + 'px';
+
+				// Calc new width/height based on overflow
+				w = iframe.parentNode.clientWidth - (tableElm.offsetWidth - vp.width);
+				h = iframe.parentNode.clientHeight - (tableElm.offsetHeight - vp.height);
+			} else {
+				w = iframe.parentNode.clientWidth;
+				h = iframe.parentNode.clientHeight;
+			}
+
+			iframe.style.width = w + "px";
+			iframe.style.height = (h+delta) + "px";
+
+			tinyMCE.switchClass(inst.editorId + '_fullscreen', 'mceButtonSelected');
+			ds.enabled = true;
+
+			inst.useCSS = false;
+		} else {
+			// Handle External Toolbar
+			if (inst.toolbarElement) {
+				row = inst.toolbarElement.parentNode.parentNode;
+
+				row.parentNode.removeChild(row);
+
+				ds.oldToolbarParent.replaceChild(inst.toolbarElement, ds.toolbarHolder);
+
+				ds.oldToolbarParent = null;
+				ds.toolbarHolder = null;
+			}
+
+			if (blo)
+				blo.parentNode.removeChild(blo);
+
+			si = 0;
+			tinyMCE.getParentNode(tableElm.parentNode, function (n) {
+				if (n.nodeName == 'BODY')
+					return true;
+
+				if (n.nodeType == 1)
+					tinyMCE.removeCSSClass(n, 'mceFullscreenPos');
+			});
+
+			if (re && tinyMCE.getParam("theme_advanced_resizing", false))
+				re.style.display = 'block';
+
+			tableElm.style.position = 'static';
+			tableElm.style.zIndex = '';
+			tableElm.style.width = '';
+			tableElm.style.height = '';
+
+			tableElm.style.width = ds.oldTWidth ? ds.oldTWidth : '';
+			tableElm.style.height = ds.oldTHeight ? ds.oldTHeight : '';
+
+			iframe.style.width = ds.oldWidth ? ds.oldWidth : '';
+			iframe.style.height = ds.oldHeight ? ds.oldHeight : '';
+
+			tinyMCE.switchClass(inst.editorId + '_fullscreen', 'mceButtonNormal');
+			ds.enabled = false;
+
+			tinyMCE.removeCSSClass(cd.body, 'mceFullscreen');
+			cw.scrollTo(ds.scrollX, ds.scrollY);
+
+			inst.useCSS = false;
+		}
+	},
+
+	handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
+		if (tinyMCE.getParam('fullscreen_is_enabled'))
+			tinyMCE.switchClass(editor_id + '_fullscreen', 'mceButtonSelected');
+
+		return true;
+	}
+};
+
+tinyMCE.addPlugin("fullscreen", TinyMCE_FullScreenPlugin);

Deleted: plog/trunk/js/tinymce/plugins/fullscreen/fullscreen.htm
===================================================================
--- plog/trunk/js/tinymce/plugins/fullscreen/fullscreen.htm	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/fullscreen/fullscreen.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,91 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-	<title>{$lang_fullscreen_title}</title>
-	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-	<script language="javascript" type="text/javascript" src="../../tiny_mce.js"></script>
-	<script language="javascript" type="text/javascript">
-		function patchCallback(settings, key) {
-			if (settings[key])
-				settings[key] = "window.opener." + settings[key];
-		}
-
-		var settings = new Array();
-
-		// Clone array
-		for (var name in window.opener.tinyMCE.settings)
-			settings[name] = window.opener.tinyMCE.settings[name];
-
-		// Override options for fullscreen
-		for (var name in window.opener.tinyMCE.settings.fullscreen_settings)
-			settings[name] = window.opener.tinyMCE.settings.fullscreen_settings[name];
-
-		// Patch callbacks, make them point to window.opener
-		patchCallback(settings, 'urlconverter_callback');
-		patchCallback(settings, 'insertlink_callback');
-		patchCallback(settings, 'insertimage_callback');
-		patchCallback(settings, 'setupcontent_callback');
-		patchCallback(settings, 'save_callback');
-		patchCallback(settings, 'onchange_callback');
-		patchCallback(settings, 'init_instance_callback');
-		patchCallback(settings, 'file_browser_callback');
-		patchCallback(settings, 'cleanup_callback');
-		patchCallback(settings, 'execcommand_callback');
-		patchCallback(settings, 'oninit');
-
-		// Set options
-		settings['mode'] = 'exact';
-		settings['elements'] = 'fullscreenarea';
-		settings['ask'] = false;
-		settings['setupcontent_callback'] = 'setupContent';
-		settings['fullscreen_is_enabled'] = true;
-		settings['fullscreen_editor_id'] = window.opener.tinyMCE.getWindowArg("editor_id");
-		settings['theme_advanced_resizing'] = false;
-
-		// Init
-		tinyMCE.init(settings);
-		tinyMCE.documentBasePath = window.opener.tinyMCE.documentBasePath;
-
-		function setupContent(editor_id, body, doc) {
-			var inst = tinyMCE.getInstanceById(editor_id);
-			var content = window.opener.tinyMCE.getContent(tinyMCE.getParam('fullscreen_editor_id'));
-
-			// Setup title
-			var divElm = document.createElement("div");
-			divElm.innerHTML = tinyMCELang['lang_fullscreen_title'];
-			document.title = divElm.innerHTML;
-
-			// Get content
-			inst.execCommand('mceSetContent', false, content);
-		}
-
-		function unloadHandler(e) {
-			moveContent();
-		}
-
-		function moveContent() {
-			var doc = tinyMCE.isMSIE ? window.frames['mce_editor_0'].window.document : document.getElementById('mce_editor_0').contentDocument;
-			window.opener.tinyMCE.setInnerHTML(window.opener.tinyMCE.selectedInstance.getBody(), doc.body.innerHTML);
-		}
-
-		// Add onunload
-		tinyMCE.addEvent(window, "beforeunload", unloadHandler);
-
-		function doParentSubmit() {
-			moveContent();
-
-			if (window.opener.tinyMCE.selectedInstance.formElement.form)
-				window.opener.tinyMCE.selectedInstance.formElement.form.submit();
-
-			window.close();
-
-			return false;
-		}
-	</script>
-	<base target="_self" />
-</head>
-<body style="margin: 0; overflow: hidden; height: 100%" scrolling="no" scroll="no">
-<form onsubmit="doParentSubmit();" style="height: 100%">
-<textarea id="fullscreenarea" style="width: 100%; height: 100%"></textarea>
-</form>
-</body>
-</html>

Copied: plog/trunk/js/tinymce/plugins/fullscreen/fullscreen.htm (from rev 7165, plog/trunk/js/tinymce/plugins/fullscreen/fullscreen.htm)
===================================================================
--- plog/trunk/js/tinymce/plugins/fullscreen/fullscreen.htm	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/fullscreen/fullscreen.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,91 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{$lang_fullscreen_title}</title>
+	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+	<script language="javascript" type="text/javascript" src="../../tiny_mce.js"></script>
+	<script language="javascript" type="text/javascript">
+		function patchCallback(settings, key) {
+			if (settings[key])
+				settings[key] = "window.opener." + settings[key];
+		}
+
+		var settings = new Array();
+
+		// Clone array
+		for (var name in window.opener.tinyMCE.settings)
+			settings[name] = window.opener.tinyMCE.settings[name];
+
+		// Override options for fullscreen
+		for (var name in window.opener.tinyMCE.settings.fullscreen_settings)
+			settings[name] = window.opener.tinyMCE.settings.fullscreen_settings[name];
+
+		// Patch callbacks, make them point to window.opener
+		patchCallback(settings, 'urlconverter_callback');
+		patchCallback(settings, 'insertlink_callback');
+		patchCallback(settings, 'insertimage_callback');
+		patchCallback(settings, 'setupcontent_callback');
+		patchCallback(settings, 'save_callback');
+		patchCallback(settings, 'onchange_callback');
+		patchCallback(settings, 'init_instance_callback');
+		patchCallback(settings, 'file_browser_callback');
+		patchCallback(settings, 'cleanup_callback');
+		patchCallback(settings, 'execcommand_callback');
+		patchCallback(settings, 'oninit');
+
+		// Set options
+		settings['mode'] = 'exact';
+		settings['elements'] = 'fullscreenarea';
+		settings['ask'] = false;
+		settings['setupcontent_callback'] = 'setupContent';
+		settings['fullscreen_is_enabled'] = true;
+		settings['fullscreen_editor_id'] = window.opener.tinyMCE.getWindowArg("editor_id");
+		settings['theme_advanced_resizing'] = false;
+
+		// Init
+		tinyMCE.init(settings);
+		tinyMCE.documentBasePath = window.opener.tinyMCE.documentBasePath;
+
+		function setupContent(editor_id, body, doc) {
+			var inst = tinyMCE.getInstanceById(editor_id);
+			var content = window.opener.tinyMCE.getContent(tinyMCE.getParam('fullscreen_editor_id'));
+
+			// Setup title
+			var divElm = document.createElement("div");
+			divElm.innerHTML = tinyMCELang['lang_fullscreen_title'];
+			document.title = divElm.innerHTML;
+
+			// Get content
+			inst.execCommand('mceSetContent', false, content);
+		}
+
+		function unloadHandler(e) {
+			moveContent();
+		}
+
+		function moveContent() {
+			var doc = tinyMCE.isMSIE ? window.frames['mce_editor_0'].window.document : document.getElementById('mce_editor_0').contentDocument;
+			window.opener.tinyMCE.setInnerHTML(window.opener.tinyMCE.selectedInstance.getBody(), doc.body.innerHTML);
+		}
+
+		// Add onunload
+		tinyMCE.addEvent(window, "beforeunload", unloadHandler);
+
+		function doParentSubmit() {
+			moveContent();
+
+			if (window.opener.tinyMCE.selectedInstance.formElement.form)
+				window.opener.tinyMCE.selectedInstance.formElement.form.submit();
+
+			window.close();
+
+			return false;
+		}
+	</script>
+	<base target="_self" />
+</head>
+<body style="margin: 0; overflow: hidden; height: 100%" scrolling="no" scroll="no">
+<form onsubmit="doParentSubmit();" style="height: 100%">
+<textarea id="fullscreenarea" style="width: 100%; height: 100%"></textarea>
+</form>
+</body>
+</html>

Deleted: plog/trunk/js/tinymce/plugins/fullscreen/images/fullscreen.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/fullscreen/images/fullscreen.gif (from rev 7165, plog/trunk/js/tinymce/plugins/fullscreen/images/fullscreen.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/fullscreen/langs/en.js
===================================================================
--- plog/trunk/js/tinymce/plugins/fullscreen/langs/en.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/fullscreen/langs/en.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,5 +0,0 @@
-// UK lang variables
-
-tinyMCE.addToLang('',{
-fullscreen_desc : 'Toggle fullscreen mode'
-});

Copied: plog/trunk/js/tinymce/plugins/fullscreen/langs/en.js (from rev 7165, plog/trunk/js/tinymce/plugins/fullscreen/langs/en.js)
===================================================================
--- plog/trunk/js/tinymce/plugins/fullscreen/langs/en.js	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/fullscreen/langs/en.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,5 @@
+// UK lang variables
+
+tinyMCE.addToLang('',{
+fullscreen_desc : 'Toggle fullscreen mode'
+});

Deleted: plog/trunk/js/tinymce/plugins/fullscreen/readme.txt
===================================================================
--- plog/trunk/js/tinymce/plugins/fullscreen/readme.txt	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/fullscreen/readme.txt	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1 +0,0 @@
-Check the TinyMCE documentation for details on this plugin.

Copied: plog/trunk/js/tinymce/plugins/fullscreen/readme.txt (from rev 7165, plog/trunk/js/tinymce/plugins/fullscreen/readme.txt)
===================================================================
--- plog/trunk/js/tinymce/plugins/fullscreen/readme.txt	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/fullscreen/readme.txt	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1 @@
+Check the TinyMCE documentation for details on this plugin.

Deleted: plog/trunk/js/tinymce/plugins/inlinepopups/css/inlinepopup.css
===================================================================
--- plog/trunk/js/tinymce/plugins/inlinepopups/css/inlinepopup.css	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/inlinepopups/css/inlinepopup.css	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,69 +0,0 @@
-/* Window classes */
-
-.mceWindow {
-	position: absolute;
-	left: 0;
-	top: 0;
-	border: 1px solid black;
-	background-color: #D4D0C8;
-}
-
-.mceWindowHead {
-	background-color: #334F8D;
-	width: 100%;
-	height: 18px;
-	cursor: move;
-	overflow: hidden;
-}
-
-.mceWindowBody {
-	clear: both;
-	background-color: white;
-}
-
-.mceWindowStatusbar {
-	background-color: #D4D0C8;
-	height: 12px;
-	border-top: 1px solid black;
-}
-
-.mceWindowTitle {
-	float: left;
-	font-family: "MS Sans Serif";
-	font-size: 9pt;
-	font-weight: bold;
-	line-height: 18px;
-	color: white;
-	margin-left: 2px;
-	overflow: hidden;
-}
-
-.mceWindowHeadTools {
-	margin-right: 2px;
-}
-
-.mceWindowClose, .mceWindowMinimize, .mceWindowMaximize {
-	display: block;
-	float: right;
-	overflow: hidden;
-	margin-top: 2px;
-}
-
-.mceWindowClose {
-	margin-left: 2px;
-}
-
-.mceWindowMinimize {
-}
-
-.mceWindowMaximize {
-}
-
-.mceWindowResize {
-	display: block;
-	float: right;
-	overflow: hidden;
-	cursor: se-resize;
-	width: 12px;
-	height: 12px;
-}

Copied: plog/trunk/js/tinymce/plugins/inlinepopups/css/inlinepopup.css (from rev 7165, plog/trunk/js/tinymce/plugins/inlinepopups/css/inlinepopup.css)
===================================================================
--- plog/trunk/js/tinymce/plugins/inlinepopups/css/inlinepopup.css	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/inlinepopups/css/inlinepopup.css	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,69 @@
+/* Window classes */
+
+.mceWindow {
+	position: absolute;
+	left: 0;
+	top: 0;
+	border: 1px solid black;
+	background-color: #D4D0C8;
+}
+
+.mceWindowHead {
+	background-color: #334F8D;
+	width: 100%;
+	height: 18px;
+	cursor: move;
+	overflow: hidden;
+}
+
+.mceWindowBody {
+	clear: both;
+	background-color: white;
+}
+
+.mceWindowStatusbar {
+	background-color: #D4D0C8;
+	height: 12px;
+	border-top: 1px solid black;
+}
+
+.mceWindowTitle {
+	float: left;
+	font-family: "MS Sans Serif";
+	font-size: 9pt;
+	font-weight: bold;
+	line-height: 18px;
+	color: white;
+	margin-left: 2px;
+	overflow: hidden;
+}
+
+.mceWindowHeadTools {
+	margin-right: 2px;
+}
+
+.mceWindowClose, .mceWindowMinimize, .mceWindowMaximize {
+	display: block;
+	float: right;
+	overflow: hidden;
+	margin-top: 2px;
+}
+
+.mceWindowClose {
+	margin-left: 2px;
+}
+
+.mceWindowMinimize {
+}
+
+.mceWindowMaximize {
+}
+
+.mceWindowResize {
+	display: block;
+	float: right;
+	overflow: hidden;
+	cursor: se-resize;
+	width: 12px;
+	height: 12px;
+}

Deleted: plog/trunk/js/tinymce/plugins/inlinepopups/editor_plugin.js
===================================================================
--- plog/trunk/js/tinymce/plugins/inlinepopups/editor_plugin.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/inlinepopups/editor_plugin.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1 +0,0 @@
-var TinyMCE_InlinePopupsPlugin={getInfo:function(){return{longname:'Inline Popups',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}}};tinyMCE.addPlugin("inlinepopups",TinyMCE_InlinePopupsPlugin);TinyMCE_Engine.prototype.orgOpenWindow=TinyMCE_Engine.prototype.openWindow;TinyMCE_Engine.prototype.orgCloseWindow=TinyMCE_Engine.prototype.closeWindow;TinyMCE_Engine.prototype.openWindow=function(template,args){if(args['inline']!="yes"||tinyMCE.isOpera||tinyMCE.getParam("plugins").indexOf('inlinepopups')==-1){mcWindows.selectedWindow=null;args['mce_inside_iframe']=false;this.orgOpenWindow(template,args);return}var url,resizable,scrollbars;args['mce_inside_iframe']=true;tinyMCE.windowArgs=args;if(template['file'].charAt(0)!='/'&&template['file'].indexOf('://')==-1)url=tinyMCE.baseURL+"/themes/"+tinyMCE.getParam("theme")+"/"+template['
 file'];else url=template['file'];if(!(width=parseInt(template['width'])))width=320;if(!(height=parseInt(template['height'])))height=200;if(!(minWidth=parseInt(template['minWidth'])))minWidth=100;if(!(minHeight=parseInt(template['minHeight'])))minHeight=100;resizable=(args&&args['resizable'])?args['resizable']:"no";scrollbars=(args&&args['scrollbars'])?args['scrollbars']:"no";height+=18;for(var name in args){if(typeof(args[name])=='function')continue;url=tinyMCE.replaceVar(url,name,escape(args[name]))}var elm=document.getElementById(this.selectedInstance.editorId+'_parent');if(tinyMCE.hasPlugin('fullscreen')&&this.selectedInstance.getData('fullscreen').enabled)pos={absLeft:0,absTop:0};else pos=tinyMCE.getAbsPosition(elm);pos.absLeft+=Math.round((elm.firstChild.clientWidth/ 2) - (width /2));pos.absTop+=Math.round((elm.firstChild.clientHeight/ 2) - (height /2));mcWindows.open(url,mcWindows.idCounter++,"modal=yes,width="+width+",height="+height+",resizable="+resizable+",scrollba
 rs="+scrollbars+",statusbar="+resizable+",left="+pos.absLeft+",top="+pos.absTop+",minWidth="+minWidth+",minHeight="+minHeight)};TinyMCE_Engine.prototype.closeWindow=function(win){var gotit=false,n,w;for(n in mcWindows.windows){w=mcWindows.windows[n];if(typeof(w)=='function')continue;if(win.name==w.id+'_iframe'){w.close();gotit=true}}if(!gotit)this.orgCloseWindow(win);tinyMCE.selectedInstance.getWin().focus()};TinyMCE_Engine.prototype.setWindowTitle=function(win_ref,title){for(var n in mcWindows.windows){var win=mcWindows.windows[n];if(typeof(win)=='function')continue;if(win_ref.name==win.id+"_iframe")window.frames[win.id+"_iframe"].document.getElementById(win.id+'_title').innerHTML=title}};function TinyMCE_Windows(){this.settings=new Array();this.windows=new Array();this.isMSIE=(navigator.appName=="Microsoft Internet Explorer");this.isGecko=navigator.userAgent.indexOf('Gecko')!=-1;this.isSafari=navigator.userAgent.indexOf('Safari')!=-1;this.isMac=navigator.userAgent.indexOf(
 'Mac')!=-1;this.isMSIE5_0=this.isMSIE&&(navigator.userAgent.indexOf('MSIE 5.0')!=-1);this.action="none";this.selectedWindow=null;this.lastSelectedWindow=null;this.zindex=1001;this.mouseDownScreenX=0;this.mouseDownScreenY=0;this.mouseDownLayerX=0;this.mouseDownLayerY=0;this.mouseDownWidth=0;this.mouseDownHeight=0;this.idCounter=0};TinyMCE_Windows.prototype.init=function(settings){this.settings=settings;if(this.isMSIE)this.addEvent(document,"mousemove",mcWindows.eventDispatcher);else this.addEvent(window,"mousemove",mcWindows.eventDispatcher);this.addEvent(document,"mouseup",mcWindows.eventDispatcher);this.addEvent(window,"resize",mcWindows.eventDispatcher);this.addEvent(document,"scroll",mcWindows.eventDispatcher);this.doc=document};TinyMCE_Windows.prototype.getBounds=function(){if(!this.bounds){var vp=tinyMCE.getViewPort(window);var top,left,bottom,right,docEl=this.doc.documentElement;top=vp.top;left=vp.left;bottom=vp.height+top-2;right=vp.width+left-22;this.bounds=[left,top
 ,right,bottom]}return this.bounds};TinyMCE_Windows.prototype.clampBoxPosition=function(x,y,w,h,minW,minH){var bounds=this.getBounds();x=Math.max(bounds[0],Math.min(bounds[2],x+w)-w);y=Math.max(bounds[1],Math.min(bounds[3],y+h)-h);return this.clampBoxSize(x,y,w,h,minW,minH)};TinyMCE_Windows.prototype.clampBoxSize=function(x,y,w,h,minW,minH){var bounds=this.getBounds();return[x,y,Math.max(minW,Math.min(bounds[2],x+w)-x),Math.max(minH,Math.min(bounds[3],y+h)-y)]};TinyMCE_Windows.prototype.getParam=function(name,default_value){var value=null;value=(typeof(this.settings[name])=="undefined")?default_value:this.settings[name];if(value=="true"||value=="false")return(value=="true");return value};TinyMCE_Windows.prototype.eventDispatcher=function(e){e=typeof(e)=="undefined"?window.event:e;if(mcWindows.selectedWindow==null)return;if(mcWindows.isGecko&&e.type=="mousedown"){var elm=e.currentTarget;for(var n in mcWindows.windows){var win=mcWindows.windows[n];if(win.headElement==elm||win.r
 esizeElement==elm){win.focus();break}}}switch(e.type){case"mousemove":mcWindows.selectedWindow.onMouseMove(e);break;case"mouseup":mcWindows.selectedWindow.onMouseUp(e);break;case"mousedown":mcWindows.selectedWindow.onMouseDown(e);break;case"focus":mcWindows.selectedWindow.onFocus(e);break;case"scroll":case"resize":if(mcWindows.clampUpdateTimeout)clearTimeout(mcWindows.clampUpdateTimeout);mcWindows.clampEventType=e.type;mcWindows.clampUpdateTimeout=setTimeout(function(){mcWindows.updateClamping()},100);break}};TinyMCE_Windows.prototype.updateClamping=function(){var clamp,oversize,etype=mcWindows.clampEventType;this.bounds=null;this.clampUpdateTimeout=null;for(var n in this.windows){win=this.windows[n];if(typeof(win)=='function'||!win.winElement)continue;clamp=mcWindows.clampBoxPosition(win.left,win.top,win.winElement.scrollWidth,win.winElement.scrollHeight,win.features.minWidth,win.features.minHeight);oversize=(clamp[2]!=win.winElement.scrollWidth||clamp[3]!=win.winElement.sc
 rollHeight)?true:false;if(!oversize||win.features.resizable=="yes"||etype!="scroll")win.moveTo(clamp[0],clamp[1]);if(oversize&&win.features.resizable=="yes")win.resizeTo(clamp[2],clamp[3])}};TinyMCE_Windows.prototype.addEvent=function(obj,name,handler){if(this.isMSIE)obj.attachEvent("on"+name,handler);else obj.addEventListener(name,handler,false)};TinyMCE_Windows.prototype.cancelEvent=function(e){if(this.isMSIE){e.returnValue=false;e.cancelBubble=true}else e.preventDefault()};TinyMCE_Windows.prototype.parseFeatures=function(opts){opts=opts.toLowerCase();opts=opts.replace(/;/g,",");opts=opts.replace(/[^0-9a-z=,]/g,"");var optionChunks=opts.split(',');var options=new Array();options['left']="10";options['top']="10";options['width']="300";options['height']="300";options['minwidth']="100";options['minheight']="100";options['resizable']="yes";options['minimizable']="yes";options['maximizable']="yes";options['close']="yes";options['movable']="yes";options['statusbar']="yes";option
 s['scrollbars']="auto";options['modal']="no";if(opts=="")return options;for(var i=0;i<optionChunks.length;i++){var parts=optionChunks[i].split('=');if(parts.length==2)options[parts[0]]=parts[1]}options['left']=parseInt(options['left']);options['top']=parseInt(options['top']);options['width']=parseInt(options['width']);options['height']=parseInt(options['height']);options['minWidth']=parseInt(options['minwidth']);options['minHeight']=parseInt(options['minheight']);return options};TinyMCE_Windows.prototype.open=function(url,name,features){this.lastSelectedWindow=this.selectedWindow;var win=new TinyMCE_Window();var winDiv,html="",id;var imgPath=this.getParam("images_path");features=this.parseFeatures(features);var clamp=mcWindows.clampBoxPosition(features['left'],features['top'],features['width'],features['height'],features['minWidth'],features['minHeight']);features['left']=clamp[0];features['top']=clamp[1];if(features['resizable']=="yes"){features['width']=clamp[2];features['
 height']=clamp[3]}id="mcWindow_"+name;win.deltaHeight=18;if(features['statusbar']=="yes"){win.deltaHeight+=13;if(this.isMSIE)win.deltaHeight+=1}width=parseInt(features['width']);height=parseInt(features['height'])-win.deltaHeight;if(this.isMSIE)width-=2;win.id=id;win.url=url;win.name=name;win.features=features;this.windows[name]=win;iframeWidth=width;iframeHeight=height;html+='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">';html+='<html>';html+='<head>';html+='<title>Wrapper iframe</title>';html+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';html+='<link href="'+this.getParam("css_file")+'" rel="stylesheet" type="text/css" />';html+='</head>';html+='<body onload="parent.mcWindows.onLoad(\''+name+'\');">';html+='<div id="'+id+'_container" class="mceWindow">';html+='<div id="'+id+'_head" class="mceWindowHead" onmousedown="parent.mcWindows.windows[\''+name+'\'].focus();">';html+='  <div id="'+id+'_title" class="mceWindowTitle"';html+='  o
 nselectstart="return false;" unselectable="on" style="-moz-user-select: none !important;"></div>';html+='    <div class="mceWindowHeadTools">';html+='      <a href="javascript:parent.mcWindows.windows[\''+name+'\'].close();" target="_self" onmousedown="return false;" class="mceWindowClose"><img border="0" src="'+imgPath+'/window_close.gif" /></a>';if(features['resizable']=="yes"&&features['maximizable']=="yes")html+='      <a href="javascript:parent.mcWindows.windows[\''+name+'\'].maximize();" target="_self" onmousedown="return false;" class="mceWindowMaximize"><img border="0" src="'+imgPath+'/window_maximize.gif" /></a>';html+='    </div>';html+='</div><div id="'+id+'_body" class="mceWindowBody" style="width: '+width+'px; height: '+height+'px;">';html+='<iframe id="'+id+'_iframe" name="'+id+'_iframe" frameborder="0" width="'+iframeWidth+'" height="'+iframeHeight+'" src="'+url+'" class="mceWindowBodyIframe" scrolling="'+features['scrollbars']+'"></iframe></div>';if(features[
 'statusbar']=="yes"){html+='<div id="'+id+'_statusbar" class="mceWindowStatusbar" onmousedown="parent.mcWindows.windows[\''+name+'\'].focus();">';if(features['resizable']=="yes"){if(this.isGecko)html+='<div id="'+id+'_resize" class="mceWindowResize"><div style="background-image: url(\''+imgPath+'/window_resize.gif\'); width: 12px; height: 12px;"></div></div>';else html+='<div id="'+id+'_resize" class="mceWindowResize"><img onmousedown="parent.mcWindows.windows[\''+name+'\'].focus();" border="0" src="'+imgPath+'/window_resize.gif" /></div>'}html+='</div>'}html+='</div>';html+='</body>';html+='</html>';this.createFloatingIFrame(id,features['left'],features['top'],features['width'],features['height'],html)};TinyMCE_Windows.prototype.setDocumentLock=function(state){var elm=document.getElementById('mcWindowEventBlocker');if(state){if(elm==null){elm=document.createElement("div");elm.id="mcWindowEventBlocker";elm.style.position="absolute";elm.style.left="0";elm.style.top="0";docume
 nt.body.appendChild(elm)}elm.style.display="none";var imgPath=this.getParam("images_path");var width=document.body.clientWidth;var height=document.body.clientHeight;elm.style.width=width;elm.style.height=height;elm.innerHTML='<img src="'+imgPath+'/spacer.gif" width="'+width+'" height="'+height+'" />';elm.style.zIndex=mcWindows.zindex-1;elm.style.display="block"}else if(elm!=null){if(mcWindows.windows.length==0)elm.parentNode.removeChild(elm);else elm.style.zIndex=mcWindows.zindex-1}};TinyMCE_Windows.prototype.onLoad=function(name){var win=mcWindows.windows[name];var id="mcWindow_"+name;var wrapperIframe=window.frames[id+"_iframe"].frames[0];var wrapperDoc=window.frames[id+"_iframe"].document;var doc=window.frames[id+"_iframe"].document;var winDiv=document.getElementById("mcWindow_"+name+"_div");var realIframe=window.frames[id+"_iframe"].frames[0];win.id="mcWindow_"+name;win.winElement=winDiv;win.bodyElement=doc.getElementById(id+'_body');win.iframeElement=doc.getElementById(
 id+'_iframe');win.headElement=doc.getElementById(id+'_head');win.titleElement=doc.getElementById(id+'_title');win.resizeElement=doc.getElementById(id+'_resize');win.containerElement=doc.getElementById(id+'_container');win.left=win.features['left'];win.top=win.features['top'];win.frame=window.frames[id+'_iframe'].frames[0];win.wrapperFrame=window.frames[id+'_iframe'];win.wrapperIFrameElement=document.getElementById(id+"_iframe");mcWindows.addEvent(win.headElement,"mousedown",mcWindows.eventDispatcher);if(win.resizeElement!=null)mcWindows.addEvent(win.resizeElement,"mousedown",mcWindows.eventDispatcher);if(mcWindows.isMSIE){mcWindows.addEvent(realIframe.document,"mousemove",mcWindows.eventDispatcher);mcWindows.addEvent(realIframe.document,"mouseup",mcWindows.eventDispatcher)}else{mcWindows.addEvent(realIframe,"mousemove",mcWindows.eventDispatcher);mcWindows.addEvent(realIframe,"mouseup",mcWindows.eventDispatcher);mcWindows.addEvent(realIframe,"focus",mcWindows.eventDispatcher)
 }for(var i=0;i<window.frames.length;i++){if(!window.frames[i]._hasMouseHandlers){if(mcWindows.isMSIE){mcWindows.addEvent(window.frames[i].document,"mousemove",mcWindows.eventDispatcher);mcWindows.addEvent(window.frames[i].document,"mouseup",mcWindows.eventDispatcher)}else{mcWindows.addEvent(window.frames[i],"mousemove",mcWindows.eventDispatcher);mcWindows.addEvent(window.frames[i],"mouseup",mcWindows.eventDispatcher)}window.frames[i]._hasMouseHandlers=true}}if(mcWindows.isMSIE){mcWindows.addEvent(win.frame.document,"mousemove",mcWindows.eventDispatcher);mcWindows.addEvent(win.frame.document,"mouseup",mcWindows.eventDispatcher)}else{mcWindows.addEvent(win.frame,"mousemove",mcWindows.eventDispatcher);mcWindows.addEvent(win.frame,"mouseup",mcWindows.eventDispatcher);mcWindows.addEvent(win.frame,"focus",mcWindows.eventDispatcher)}var func=this.getParam("on_open_window","");if(func!="")eval(func+"(win);");win.focus();if(win.features['modal']=="yes")mcWindows.setDocumentLock(true)
 };TinyMCE_Windows.prototype.createFloatingIFrame=function(id_prefix,left,top,width,height,html){var iframe=document.createElement("iframe");var div=document.createElement("div"),doc;width=parseInt(width);height=parseInt(height)+1;div.setAttribute("id",id_prefix+"_div");div.setAttribute("width",width);div.setAttribute("height",(height));div.style.position="absolute";div.style.left=left+"px";div.style.top=top+"px";div.style.width=width+"px";div.style.height=(height)+"px";div.style.backgroundColor="white";div.style.display="none";if(this.isGecko){iframeWidth=width+2;iframeHeight=height+2}else{iframeWidth=width;iframeHeight=height+1}iframe.setAttribute("id",id_prefix+"_iframe");iframe.setAttribute("name",id_prefix+"_iframe");iframe.setAttribute("border","0");iframe.setAttribute("frameBorder","0");iframe.setAttribute("marginWidth","0");iframe.setAttribute("marginHeight","0");iframe.setAttribute("leftMargin","0");iframe.setAttribute("topMargin","0");iframe.setAttribute("width",ifr
 ameWidth);iframe.setAttribute("height",iframeHeight);iframe.setAttribute("scrolling","no");iframe.style.width=iframeWidth+"px";iframe.style.height=iframeHeight+"px";iframe.style.backgroundColor="white";div.appendChild(iframe);document.body.appendChild(div);div.innerHTML=div.innerHTML;if(this.isSafari){window.setTimeout(function(){var doc=window.frames[id_prefix+'_iframe'].document;doc.open();doc.write(html);doc.close()},10)}else{doc=window.frames[id_prefix+'_iframe'].window.document;doc.open();doc.write(html);doc.close()}div.style.display="block";return div};function TinyMCE_Window(){};TinyMCE_Window.prototype.focus=function(){if(this!=mcWindows.selectedWindow){this.winElement.style.zIndex=++mcWindows.zindex;mcWindows.lastSelectedWindow=mcWindows.selectedWindow;mcWindows.selectedWindow=this}};TinyMCE_Window.prototype.minimize=function(){};TinyMCE_Window.prototype.maximize=function(){if(this.restoreSize){this.moveTo(this.restoreSize[0],this.restoreSize[1]);this.resizeTo(this.
 restoreSize[2],this.restoreSize[3]);this.updateClamping();this.restoreSize=null}else{var bounds=mcWindows.getBounds();this.restoreSize=[this.left,this.top,this.winElement.scrollWidth,this.winElement.scrollHeight];this.moveTo(bounds[0],bounds[1]);this.resizeTo(bounds[2]-bounds[0],bounds[3]-bounds[1])}};TinyMCE_Window.prototype.startResize=function(){mcWindows.action="resize"};TinyMCE_Window.prototype.startMove=function(e){mcWindows.action="move"};TinyMCE_Window.prototype.close=function(){if(this.frame&&this.frame['tinyMCEPopup'])this.frame['tinyMCEPopup'].restoreSelection();if(mcWindows.lastSelectedWindow!=null)mcWindows.lastSelectedWindow.focus();var mcWindowsNew=new Array();for(var n in mcWindows.windows){var win=mcWindows.windows[n];if(typeof(win)=='function')continue;if(win.name!=this.name)mcWindowsNew[n]=win}mcWindows.windows=mcWindowsNew;var e=mcWindows.doc.getElementById(this.id+"_iframe");e.parentNode.removeChild(e);var e=mcWindows.doc.getElementById(this.id+"_div");e
 .parentNode.removeChild(e);mcWindows.setDocumentLock(false)};TinyMCE_Window.prototype.onMouseMove=function(e){var clamp;var dx=e.screenX-mcWindows.mouseDownScreenX;var dy=e.screenY-mcWindows.mouseDownScreenY;switch(mcWindows.action){case"resize":clamp=mcWindows.clampBoxSize(this.left,this.top,mcWindows.mouseDownWidth+(e.screenX-mcWindows.mouseDownScreenX),mcWindows.mouseDownHeight+(e.screenY-mcWindows.mouseDownScreenY),this.features.minWidth,this.features.minHeight);this.resizeTo(clamp[2],clamp[3]);mcWindows.cancelEvent(e);break;case"move":this.left=mcWindows.mouseDownLayerX+(e.screenX-mcWindows.mouseDownScreenX);this.top=mcWindows.mouseDownLayerY+(e.screenY-mcWindows.mouseDownScreenY);this.updateClamping();mcWindows.cancelEvent(e);break}};TinyMCE_Window.prototype.moveTo=function(x,y){this.left=x;this.top=y;this.winElement.style.left=this.left+"px";this.winElement.style.top=this.top+"px"};TinyMCE_Window.prototype.resizeTo=function(width,height){this.wrapperIFrameElement.styl
 e.width=(width+2)+'px';this.wrapperIFrameElement.style.height=(height+2)+'px';this.wrapperIFrameElement.width=width+2;this.wrapperIFrameElement.height=height+2;this.winElement.style.width=width+'px';this.winElement.style.height=height+'px';height=height-this.deltaHeight;this.containerElement.style.width=width+'px';this.iframeElement.style.width=width+'px';this.iframeElement.style.height=height+'px';this.bodyElement.style.width=width+'px';this.bodyElement.style.height=height+'px';this.headElement.style.width=width+'px';};TinyMCE_Window.prototype.updateClamping=function(){var clamp,oversize;clamp=mcWindows.clampBoxPosition(this.left,this.top,this.winElement.scrollWidth,this.winElement.scrollHeight,this.features.minWidth,this.features.minHeight);oversize=(clamp[2]!=this.winElement.scrollWidth||clamp[3]!=this.winElement.scrollHeight)?true:false;this.moveTo(clamp[0],clamp[1]);if(this.features.resizable=="yes"&&oversize)this.resizeTo(clamp[2],clamp[3])};function debug(msg){documen
 t.getElementById('debug').value+=msg+"\n"}TinyMCE_Window.prototype.onMouseUp=function(e){mcWindows.action="none"};TinyMCE_Window.prototype.onFocus=function(e){var winRef=e.currentTarget;for(var n in mcWindows.windows){var win=mcWindows.windows[n];if(typeof(win)=='function')continue;if(winRef.name==win.id+"_iframe"){win.focus();return}}};TinyMCE_Window.prototype.onMouseDown=function(e){var elm=mcWindows.isMSIE?this.wrapperFrame.event.srcElement:e.target;mcWindows.mouseDownScreenX=e.screenX;mcWindows.mouseDownScreenY=e.screenY;mcWindows.mouseDownLayerX=this.left;mcWindows.mouseDownLayerY=this.top;mcWindows.mouseDownWidth=parseInt(this.winElement.style.width);mcWindows.mouseDownHeight=parseInt(this.winElement.style.height);if(this.resizeElement!=null&&elm==this.resizeElement.firstChild)this.startResize(e);else this.startMove(e);mcWindows.cancelEvent(e)};var mcWindows=new TinyMCE_Windows();mcWindows.init({images_path:tinyMCE.baseURL+"/plugins/inlinepopups/images",css_file:tinyMC
 E.baseURL+"/plugins/inlinepopups/css/inlinepopup.css"});
\ No newline at end of file

Copied: plog/trunk/js/tinymce/plugins/inlinepopups/editor_plugin.js (from rev 7165, plog/trunk/js/tinymce/plugins/inlinepopups/editor_plugin.js)
===================================================================
--- plog/trunk/js/tinymce/plugins/inlinepopups/editor_plugin.js	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/inlinepopups/editor_plugin.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1 @@
+var TinyMCE_InlinePopupsPlugin={getInfo:function(){return{longname:'Inline Popups',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}}};tinyMCE.addPlugin("inlinepopups",TinyMCE_InlinePopupsPlugin);TinyMCE_Engine.prototype.orgOpenWindow=TinyMCE_Engine.prototype.openWindow;TinyMCE_Engine.prototype.orgCloseWindow=TinyMCE_Engine.prototype.closeWindow;TinyMCE_Engine.prototype.openWindow=function(template,args){if(args['inline']!="yes"||tinyMCE.isOpera||tinyMCE.getParam("plugins").indexOf('inlinepopups')==-1){mcWindows.selectedWindow=null;args['mce_inside_iframe']=false;this.orgOpenWindow(template,args);return}var url,resizable,scrollbars;args['mce_inside_iframe']=true;tinyMCE.windowArgs=args;if(template['file'].charAt(0)!='/'&&template['file'].indexOf('://')==-1)url=tinyMCE.baseURL+"/themes/"+tinyMCE.getParam("theme")+"/"+template['
 file'];else url=template['file'];if(!(width=parseInt(template['width'])))width=320;if(!(height=parseInt(template['height'])))height=200;if(!(minWidth=parseInt(template['minWidth'])))minWidth=100;if(!(minHeight=parseInt(template['minHeight'])))minHeight=100;resizable=(args&&args['resizable'])?args['resizable']:"no";scrollbars=(args&&args['scrollbars'])?args['scrollbars']:"no";height+=18;for(var name in args){if(typeof(args[name])=='function')continue;url=tinyMCE.replaceVar(url,name,escape(args[name]))}var elm=document.getElementById(this.selectedInstance.editorId+'_parent');if(tinyMCE.hasPlugin('fullscreen')&&this.selectedInstance.getData('fullscreen').enabled)pos={absLeft:0,absTop:0};else pos=tinyMCE.getAbsPosition(elm);pos.absLeft+=Math.round((elm.firstChild.clientWidth/ 2) - (width /2));pos.absTop+=Math.round((elm.firstChild.clientHeight/ 2) - (height /2));mcWindows.open(url,mcWindows.idCounter++,"modal=yes,width="+width+",height="+height+",resizable="+resizable+",scrollba
 rs="+scrollbars+",statusbar="+resizable+",left="+pos.absLeft+",top="+pos.absTop+",minWidth="+minWidth+",minHeight="+minHeight)};TinyMCE_Engine.prototype.closeWindow=function(win){var gotit=false,n,w;for(n in mcWindows.windows){w=mcWindows.windows[n];if(typeof(w)=='function')continue;if(win.name==w.id+'_iframe'){w.close();gotit=true}}if(!gotit)this.orgCloseWindow(win);tinyMCE.selectedInstance.getWin().focus()};TinyMCE_Engine.prototype.setWindowTitle=function(win_ref,title){for(var n in mcWindows.windows){var win=mcWindows.windows[n];if(typeof(win)=='function')continue;if(win_ref.name==win.id+"_iframe")window.frames[win.id+"_iframe"].document.getElementById(win.id+'_title').innerHTML=title}};function TinyMCE_Windows(){this.settings=new Array();this.windows=new Array();this.isMSIE=(navigator.appName=="Microsoft Internet Explorer");this.isGecko=navigator.userAgent.indexOf('Gecko')!=-1;this.isSafari=navigator.userAgent.indexOf('Safari')!=-1;this.isMac=navigator.userAgent.indexOf(
 'Mac')!=-1;this.isMSIE5_0=this.isMSIE&&(navigator.userAgent.indexOf('MSIE 5.0')!=-1);this.action="none";this.selectedWindow=null;this.lastSelectedWindow=null;this.zindex=1001;this.mouseDownScreenX=0;this.mouseDownScreenY=0;this.mouseDownLayerX=0;this.mouseDownLayerY=0;this.mouseDownWidth=0;this.mouseDownHeight=0;this.idCounter=0};TinyMCE_Windows.prototype.init=function(settings){this.settings=settings;if(this.isMSIE)this.addEvent(document,"mousemove",mcWindows.eventDispatcher);else this.addEvent(window,"mousemove",mcWindows.eventDispatcher);this.addEvent(document,"mouseup",mcWindows.eventDispatcher);this.addEvent(window,"resize",mcWindows.eventDispatcher);this.addEvent(document,"scroll",mcWindows.eventDispatcher);this.doc=document};TinyMCE_Windows.prototype.getBounds=function(){if(!this.bounds){var vp=tinyMCE.getViewPort(window);var top,left,bottom,right,docEl=this.doc.documentElement;top=vp.top;left=vp.left;bottom=vp.height+top-2;right=vp.width+left-22;this.bounds=[left,top
 ,right,bottom]}return this.bounds};TinyMCE_Windows.prototype.clampBoxPosition=function(x,y,w,h,minW,minH){var bounds=this.getBounds();x=Math.max(bounds[0],Math.min(bounds[2],x+w)-w);y=Math.max(bounds[1],Math.min(bounds[3],y+h)-h);return this.clampBoxSize(x,y,w,h,minW,minH)};TinyMCE_Windows.prototype.clampBoxSize=function(x,y,w,h,minW,minH){var bounds=this.getBounds();return[x,y,Math.max(minW,Math.min(bounds[2],x+w)-x),Math.max(minH,Math.min(bounds[3],y+h)-y)]};TinyMCE_Windows.prototype.getParam=function(name,default_value){var value=null;value=(typeof(this.settings[name])=="undefined")?default_value:this.settings[name];if(value=="true"||value=="false")return(value=="true");return value};TinyMCE_Windows.prototype.eventDispatcher=function(e){e=typeof(e)=="undefined"?window.event:e;if(mcWindows.selectedWindow==null)return;if(mcWindows.isGecko&&e.type=="mousedown"){var elm=e.currentTarget;for(var n in mcWindows.windows){var win=mcWindows.windows[n];if(win.headElement==elm||win.r
 esizeElement==elm){win.focus();break}}}switch(e.type){case"mousemove":mcWindows.selectedWindow.onMouseMove(e);break;case"mouseup":mcWindows.selectedWindow.onMouseUp(e);break;case"mousedown":mcWindows.selectedWindow.onMouseDown(e);break;case"focus":mcWindows.selectedWindow.onFocus(e);break;case"scroll":case"resize":if(mcWindows.clampUpdateTimeout)clearTimeout(mcWindows.clampUpdateTimeout);mcWindows.clampEventType=e.type;mcWindows.clampUpdateTimeout=setTimeout(function(){mcWindows.updateClamping()},100);break}};TinyMCE_Windows.prototype.updateClamping=function(){var clamp,oversize,etype=mcWindows.clampEventType;this.bounds=null;this.clampUpdateTimeout=null;for(var n in this.windows){win=this.windows[n];if(typeof(win)=='function'||!win.winElement)continue;clamp=mcWindows.clampBoxPosition(win.left,win.top,win.winElement.scrollWidth,win.winElement.scrollHeight,win.features.minWidth,win.features.minHeight);oversize=(clamp[2]!=win.winElement.scrollWidth||clamp[3]!=win.winElement.sc
 rollHeight)?true:false;if(!oversize||win.features.resizable=="yes"||etype!="scroll")win.moveTo(clamp[0],clamp[1]);if(oversize&&win.features.resizable=="yes")win.resizeTo(clamp[2],clamp[3])}};TinyMCE_Windows.prototype.addEvent=function(obj,name,handler){if(this.isMSIE)obj.attachEvent("on"+name,handler);else obj.addEventListener(name,handler,false)};TinyMCE_Windows.prototype.cancelEvent=function(e){if(this.isMSIE){e.returnValue=false;e.cancelBubble=true}else e.preventDefault()};TinyMCE_Windows.prototype.parseFeatures=function(opts){opts=opts.toLowerCase();opts=opts.replace(/;/g,",");opts=opts.replace(/[^0-9a-z=,]/g,"");var optionChunks=opts.split(',');var options=new Array();options['left']="10";options['top']="10";options['width']="300";options['height']="300";options['minwidth']="100";options['minheight']="100";options['resizable']="yes";options['minimizable']="yes";options['maximizable']="yes";options['close']="yes";options['movable']="yes";options['statusbar']="yes";option
 s['scrollbars']="auto";options['modal']="no";if(opts=="")return options;for(var i=0;i<optionChunks.length;i++){var parts=optionChunks[i].split('=');if(parts.length==2)options[parts[0]]=parts[1]}options['left']=parseInt(options['left']);options['top']=parseInt(options['top']);options['width']=parseInt(options['width']);options['height']=parseInt(options['height']);options['minWidth']=parseInt(options['minwidth']);options['minHeight']=parseInt(options['minheight']);return options};TinyMCE_Windows.prototype.open=function(url,name,features){this.lastSelectedWindow=this.selectedWindow;var win=new TinyMCE_Window();var winDiv,html="",id;var imgPath=this.getParam("images_path");features=this.parseFeatures(features);var clamp=mcWindows.clampBoxPosition(features['left'],features['top'],features['width'],features['height'],features['minWidth'],features['minHeight']);features['left']=clamp[0];features['top']=clamp[1];if(features['resizable']=="yes"){features['width']=clamp[2];features['
 height']=clamp[3]}id="mcWindow_"+name;win.deltaHeight=18;if(features['statusbar']=="yes"){win.deltaHeight+=13;if(this.isMSIE)win.deltaHeight+=1}width=parseInt(features['width']);height=parseInt(features['height'])-win.deltaHeight;if(this.isMSIE)width-=2;win.id=id;win.url=url;win.name=name;win.features=features;this.windows[name]=win;iframeWidth=width;iframeHeight=height;html+='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">';html+='<html>';html+='<head>';html+='<title>Wrapper iframe</title>';html+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';html+='<link href="'+this.getParam("css_file")+'" rel="stylesheet" type="text/css" />';html+='</head>';html+='<body onload="parent.mcWindows.onLoad(\''+name+'\');">';html+='<div id="'+id+'_container" class="mceWindow">';html+='<div id="'+id+'_head" class="mceWindowHead" onmousedown="parent.mcWindows.windows[\''+name+'\'].focus();">';html+='  <div id="'+id+'_title" class="mceWindowTitle"';html+='  o
 nselectstart="return false;" unselectable="on" style="-moz-user-select: none !important;"></div>';html+='    <div class="mceWindowHeadTools">';html+='      <a href="javascript:parent.mcWindows.windows[\''+name+'\'].close();" target="_self" onmousedown="return false;" class="mceWindowClose"><img border="0" src="'+imgPath+'/window_close.gif" /></a>';if(features['resizable']=="yes"&&features['maximizable']=="yes")html+='      <a href="javascript:parent.mcWindows.windows[\''+name+'\'].maximize();" target="_self" onmousedown="return false;" class="mceWindowMaximize"><img border="0" src="'+imgPath+'/window_maximize.gif" /></a>';html+='    </div>';html+='</div><div id="'+id+'_body" class="mceWindowBody" style="width: '+width+'px; height: '+height+'px;">';html+='<iframe id="'+id+'_iframe" name="'+id+'_iframe" frameborder="0" width="'+iframeWidth+'" height="'+iframeHeight+'" src="'+url+'" class="mceWindowBodyIframe" scrolling="'+features['scrollbars']+'"></iframe></div>';if(features[
 'statusbar']=="yes"){html+='<div id="'+id+'_statusbar" class="mceWindowStatusbar" onmousedown="parent.mcWindows.windows[\''+name+'\'].focus();">';if(features['resizable']=="yes"){if(this.isGecko)html+='<div id="'+id+'_resize" class="mceWindowResize"><div style="background-image: url(\''+imgPath+'/window_resize.gif\'); width: 12px; height: 12px;"></div></div>';else html+='<div id="'+id+'_resize" class="mceWindowResize"><img onmousedown="parent.mcWindows.windows[\''+name+'\'].focus();" border="0" src="'+imgPath+'/window_resize.gif" /></div>'}html+='</div>'}html+='</div>';html+='</body>';html+='</html>';this.createFloatingIFrame(id,features['left'],features['top'],features['width'],features['height'],html)};TinyMCE_Windows.prototype.setDocumentLock=function(state){var elm=document.getElementById('mcWindowEventBlocker');if(state){if(elm==null){elm=document.createElement("div");elm.id="mcWindowEventBlocker";elm.style.position="absolute";elm.style.left="0";elm.style.top="0";docume
 nt.body.appendChild(elm)}elm.style.display="none";var imgPath=this.getParam("images_path");var width=document.body.clientWidth;var height=document.body.clientHeight;elm.style.width=width;elm.style.height=height;elm.innerHTML='<img src="'+imgPath+'/spacer.gif" width="'+width+'" height="'+height+'" />';elm.style.zIndex=mcWindows.zindex-1;elm.style.display="block"}else if(elm!=null){if(mcWindows.windows.length==0)elm.parentNode.removeChild(elm);else elm.style.zIndex=mcWindows.zindex-1}};TinyMCE_Windows.prototype.onLoad=function(name){var win=mcWindows.windows[name];var id="mcWindow_"+name;var wrapperIframe=window.frames[id+"_iframe"].frames[0];var wrapperDoc=window.frames[id+"_iframe"].document;var doc=window.frames[id+"_iframe"].document;var winDiv=document.getElementById("mcWindow_"+name+"_div");var realIframe=window.frames[id+"_iframe"].frames[0];win.id="mcWindow_"+name;win.winElement=winDiv;win.bodyElement=doc.getElementById(id+'_body');win.iframeElement=doc.getElementById(
 id+'_iframe');win.headElement=doc.getElementById(id+'_head');win.titleElement=doc.getElementById(id+'_title');win.resizeElement=doc.getElementById(id+'_resize');win.containerElement=doc.getElementById(id+'_container');win.left=win.features['left'];win.top=win.features['top'];win.frame=window.frames[id+'_iframe'].frames[0];win.wrapperFrame=window.frames[id+'_iframe'];win.wrapperIFrameElement=document.getElementById(id+"_iframe");mcWindows.addEvent(win.headElement,"mousedown",mcWindows.eventDispatcher);if(win.resizeElement!=null)mcWindows.addEvent(win.resizeElement,"mousedown",mcWindows.eventDispatcher);if(mcWindows.isMSIE){mcWindows.addEvent(realIframe.document,"mousemove",mcWindows.eventDispatcher);mcWindows.addEvent(realIframe.document,"mouseup",mcWindows.eventDispatcher)}else{mcWindows.addEvent(realIframe,"mousemove",mcWindows.eventDispatcher);mcWindows.addEvent(realIframe,"mouseup",mcWindows.eventDispatcher);mcWindows.addEvent(realIframe,"focus",mcWindows.eventDispatcher)
 }for(var i=0;i<window.frames.length;i++){if(!window.frames[i]._hasMouseHandlers){if(mcWindows.isMSIE){mcWindows.addEvent(window.frames[i].document,"mousemove",mcWindows.eventDispatcher);mcWindows.addEvent(window.frames[i].document,"mouseup",mcWindows.eventDispatcher)}else{mcWindows.addEvent(window.frames[i],"mousemove",mcWindows.eventDispatcher);mcWindows.addEvent(window.frames[i],"mouseup",mcWindows.eventDispatcher)}window.frames[i]._hasMouseHandlers=true}}if(mcWindows.isMSIE){mcWindows.addEvent(win.frame.document,"mousemove",mcWindows.eventDispatcher);mcWindows.addEvent(win.frame.document,"mouseup",mcWindows.eventDispatcher)}else{mcWindows.addEvent(win.frame,"mousemove",mcWindows.eventDispatcher);mcWindows.addEvent(win.frame,"mouseup",mcWindows.eventDispatcher);mcWindows.addEvent(win.frame,"focus",mcWindows.eventDispatcher)}var func=this.getParam("on_open_window","");if(func!="")eval(func+"(win);");win.focus();if(win.features['modal']=="yes")mcWindows.setDocumentLock(true)
 };TinyMCE_Windows.prototype.createFloatingIFrame=function(id_prefix,left,top,width,height,html){var iframe=document.createElement("iframe");var div=document.createElement("div"),doc;width=parseInt(width);height=parseInt(height)+1;div.setAttribute("id",id_prefix+"_div");div.setAttribute("width",width);div.setAttribute("height",(height));div.style.position="absolute";div.style.left=left+"px";div.style.top=top+"px";div.style.width=width+"px";div.style.height=(height)+"px";div.style.backgroundColor="white";div.style.display="none";if(this.isGecko){iframeWidth=width+2;iframeHeight=height+2}else{iframeWidth=width;iframeHeight=height+1}iframe.setAttribute("id",id_prefix+"_iframe");iframe.setAttribute("name",id_prefix+"_iframe");iframe.setAttribute("border","0");iframe.setAttribute("frameBorder","0");iframe.setAttribute("marginWidth","0");iframe.setAttribute("marginHeight","0");iframe.setAttribute("leftMargin","0");iframe.setAttribute("topMargin","0");iframe.setAttribute("width",ifr
 ameWidth);iframe.setAttribute("height",iframeHeight);iframe.setAttribute("scrolling","no");iframe.style.width=iframeWidth+"px";iframe.style.height=iframeHeight+"px";iframe.style.backgroundColor="white";div.appendChild(iframe);document.body.appendChild(div);div.innerHTML=div.innerHTML;if(this.isSafari){window.setTimeout(function(){var doc=window.frames[id_prefix+'_iframe'].document;doc.open();doc.write(html);doc.close()},10)}else{doc=window.frames[id_prefix+'_iframe'].window.document;doc.open();doc.write(html);doc.close()}div.style.display="block";return div};function TinyMCE_Window(){};TinyMCE_Window.prototype.focus=function(){if(this!=mcWindows.selectedWindow){this.winElement.style.zIndex=++mcWindows.zindex;mcWindows.lastSelectedWindow=mcWindows.selectedWindow;mcWindows.selectedWindow=this}};TinyMCE_Window.prototype.minimize=function(){};TinyMCE_Window.prototype.maximize=function(){if(this.restoreSize){this.moveTo(this.restoreSize[0],this.restoreSize[1]);this.resizeTo(this.
 restoreSize[2],this.restoreSize[3]);this.updateClamping();this.restoreSize=null}else{var bounds=mcWindows.getBounds();this.restoreSize=[this.left,this.top,this.winElement.scrollWidth,this.winElement.scrollHeight];this.moveTo(bounds[0],bounds[1]);this.resizeTo(bounds[2]-bounds[0],bounds[3]-bounds[1])}};TinyMCE_Window.prototype.startResize=function(){mcWindows.action="resize"};TinyMCE_Window.prototype.startMove=function(e){mcWindows.action="move"};TinyMCE_Window.prototype.close=function(){if(this.frame&&this.frame['tinyMCEPopup'])this.frame['tinyMCEPopup'].restoreSelection();if(mcWindows.lastSelectedWindow!=null)mcWindows.lastSelectedWindow.focus();var mcWindowsNew=new Array();for(var n in mcWindows.windows){var win=mcWindows.windows[n];if(typeof(win)=='function')continue;if(win.name!=this.name)mcWindowsNew[n]=win}mcWindows.windows=mcWindowsNew;var e=mcWindows.doc.getElementById(this.id+"_iframe");e.parentNode.removeChild(e);var e=mcWindows.doc.getElementById(this.id+"_div");e
 .parentNode.removeChild(e);mcWindows.setDocumentLock(false)};TinyMCE_Window.prototype.onMouseMove=function(e){var clamp;var dx=e.screenX-mcWindows.mouseDownScreenX;var dy=e.screenY-mcWindows.mouseDownScreenY;switch(mcWindows.action){case"resize":clamp=mcWindows.clampBoxSize(this.left,this.top,mcWindows.mouseDownWidth+(e.screenX-mcWindows.mouseDownScreenX),mcWindows.mouseDownHeight+(e.screenY-mcWindows.mouseDownScreenY),this.features.minWidth,this.features.minHeight);this.resizeTo(clamp[2],clamp[3]);mcWindows.cancelEvent(e);break;case"move":this.left=mcWindows.mouseDownLayerX+(e.screenX-mcWindows.mouseDownScreenX);this.top=mcWindows.mouseDownLayerY+(e.screenY-mcWindows.mouseDownScreenY);this.updateClamping();mcWindows.cancelEvent(e);break}};TinyMCE_Window.prototype.moveTo=function(x,y){this.left=x;this.top=y;this.winElement.style.left=this.left+"px";this.winElement.style.top=this.top+"px"};TinyMCE_Window.prototype.resizeTo=function(width,height){this.wrapperIFrameElement.styl
 e.width=(width+2)+'px';this.wrapperIFrameElement.style.height=(height+2)+'px';this.wrapperIFrameElement.width=width+2;this.wrapperIFrameElement.height=height+2;this.winElement.style.width=width+'px';this.winElement.style.height=height+'px';height=height-this.deltaHeight;this.containerElement.style.width=width+'px';this.iframeElement.style.width=width+'px';this.iframeElement.style.height=height+'px';this.bodyElement.style.width=width+'px';this.bodyElement.style.height=height+'px';this.headElement.style.width=width+'px';};TinyMCE_Window.prototype.updateClamping=function(){var clamp,oversize;clamp=mcWindows.clampBoxPosition(this.left,this.top,this.winElement.scrollWidth,this.winElement.scrollHeight,this.features.minWidth,this.features.minHeight);oversize=(clamp[2]!=this.winElement.scrollWidth||clamp[3]!=this.winElement.scrollHeight)?true:false;this.moveTo(clamp[0],clamp[1]);if(this.features.resizable=="yes"&&oversize)this.resizeTo(clamp[2],clamp[3])};function debug(msg){documen
 t.getElementById('debug').value+=msg+"\n"}TinyMCE_Window.prototype.onMouseUp=function(e){mcWindows.action="none"};TinyMCE_Window.prototype.onFocus=function(e){var winRef=e.currentTarget;for(var n in mcWindows.windows){var win=mcWindows.windows[n];if(typeof(win)=='function')continue;if(winRef.name==win.id+"_iframe"){win.focus();return}}};TinyMCE_Window.prototype.onMouseDown=function(e){var elm=mcWindows.isMSIE?this.wrapperFrame.event.srcElement:e.target;mcWindows.mouseDownScreenX=e.screenX;mcWindows.mouseDownScreenY=e.screenY;mcWindows.mouseDownLayerX=this.left;mcWindows.mouseDownLayerY=this.top;mcWindows.mouseDownWidth=parseInt(this.winElement.style.width);mcWindows.mouseDownHeight=parseInt(this.winElement.style.height);if(this.resizeElement!=null&&elm==this.resizeElement.firstChild)this.startResize(e);else this.startMove(e);mcWindows.cancelEvent(e)};var mcWindows=new TinyMCE_Windows();mcWindows.init({images_path:tinyMCE.baseURL+"/plugins/inlinepopups/images",css_file:tinyMC
 E.baseURL+"/plugins/inlinepopups/css/inlinepopup.css"});
\ No newline at end of file

Deleted: plog/trunk/js/tinymce/plugins/inlinepopups/editor_plugin_src.js
===================================================================
--- plog/trunk/js/tinymce/plugins/inlinepopups/editor_plugin_src.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/inlinepopups/editor_plugin_src.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,819 +0,0 @@
-/**
- * $Id: editor_plugin_src.js 268 2007-04-28 15:52:59Z spocke $
- *
- * Moxiecode DHTML Windows script.
- *
- * @author Moxiecode
- * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
- */
-
-// Patch openWindow, closeWindow TinyMCE functions
-
-var TinyMCE_InlinePopupsPlugin = {
-	getInfo : function() {
-		return {
-			longname : 'Inline Popups',
-			author : 'Moxiecode Systems AB',
-			authorurl : 'http://tinymce.moxiecode.com',
-			infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups',
-			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
-		};
-	}
-};
-
-tinyMCE.addPlugin("inlinepopups", TinyMCE_InlinePopupsPlugin);
-
-// Patch openWindow, closeWindow TinyMCE functions
-
-TinyMCE_Engine.prototype.orgOpenWindow = TinyMCE_Engine.prototype.openWindow;
-TinyMCE_Engine.prototype.orgCloseWindow = TinyMCE_Engine.prototype.closeWindow;
-
-TinyMCE_Engine.prototype.openWindow = function(template, args) {
-	// Does the caller support inline
-	if (args['inline'] != "yes" || tinyMCE.isOpera || tinyMCE.getParam("plugins").indexOf('inlinepopups') == -1) {
-		mcWindows.selectedWindow = null;
-		args['mce_inside_iframe'] = false;
-		this.orgOpenWindow(template, args);
-		return;
-	}
-
-	var url, resizable, scrollbars;
-
-	args['mce_inside_iframe'] = true;
-	tinyMCE.windowArgs = args;
-
-	if (template['file'].charAt(0) != '/' && template['file'].indexOf('://') == -1)
-		url = tinyMCE.baseURL + "/themes/" + tinyMCE.getParam("theme") + "/" + template['file'];
-	else
-		url = template['file'];
-
-	if (!(width = parseInt(template['width'])))
-		width = 320;
-
-	if (!(height = parseInt(template['height'])))
-		height = 200;
-
-	if (!(minWidth = parseInt(template['minWidth'])))
-		minWidth = 100;
-
-	if (!(minHeight = parseInt(template['minHeight'])))
-		minHeight = 100;
-
-	resizable = (args && args['resizable']) ? args['resizable'] : "no";
-	scrollbars = (args && args['scrollbars']) ? args['scrollbars'] : "no";
-
-	height += 18;
-
-	// Replace all args as variables in URL
-	for (var name in args) {
-		if (typeof(args[name]) == 'function')
-			continue;
-
-		url = tinyMCE.replaceVar(url, name, escape(args[name]));
-	}
-
-	var elm = document.getElementById(this.selectedInstance.editorId + '_parent');
-
-	if (tinyMCE.hasPlugin('fullscreen') && this.selectedInstance.getData('fullscreen').enabled)
-		pos = { absLeft: 0, absTop: 0 };
-	else
-		pos = tinyMCE.getAbsPosition(elm);
-
-	// Center div in editor area
-	pos.absLeft += Math.round((elm.firstChild.clientWidth / 2) - (width / 2));
-	pos.absTop += Math.round((elm.firstChild.clientHeight / 2) - (height / 2));
-
-	mcWindows.open(url, mcWindows.idCounter++, "modal=yes,width=" + width+ ",height=" + height + ",resizable=" + resizable + ",scrollbars=" + scrollbars + ",statusbar=" + resizable + ",left=" + pos.absLeft + ",top=" + pos.absTop + ",minWidth=" + minWidth + ",minHeight=" + minHeight );
-};
-
-TinyMCE_Engine.prototype.closeWindow = function(win) {
-	var gotit = false, n, w;
-
-	for (n in mcWindows.windows) {
-		w = mcWindows.windows[n];
-
-		if (typeof(w) == 'function')
-			continue;
-
-		if (win.name == w.id + '_iframe') {
-			w.close();
-			gotit = true;
-		}
-	}
-
-	if (!gotit)
-		this.orgCloseWindow(win);
-
-	tinyMCE.selectedInstance.getWin().focus(); 
-};
-
-TinyMCE_Engine.prototype.setWindowTitle = function(win_ref, title) {
-	for (var n in mcWindows.windows) {
-		var win = mcWindows.windows[n];
-		if (typeof(win) == 'function')
-			continue;
-
-		if (win_ref.name == win.id + "_iframe")
-			window.frames[win.id + "_iframe"].document.getElementById(win.id + '_title').innerHTML = title;
-	}
-};
-
-// * * * * * TinyMCE_Windows classes below
-
-// Windows handler
-function TinyMCE_Windows() {
-	this.settings = new Array();
-	this.windows = new Array();
-	this.isMSIE = (navigator.appName == "Microsoft Internet Explorer");
-	this.isGecko = navigator.userAgent.indexOf('Gecko') != -1;
-	this.isSafari = navigator.userAgent.indexOf('Safari') != -1;
-	this.isMac = navigator.userAgent.indexOf('Mac') != -1;
-	this.isMSIE5_0 = this.isMSIE && (navigator.userAgent.indexOf('MSIE 5.0') != -1);
-	this.action = "none";
-	this.selectedWindow = null;
-	this.lastSelectedWindow = null;
-	this.zindex = 1001;
-	this.mouseDownScreenX = 0;
-	this.mouseDownScreenY = 0;
-	this.mouseDownLayerX = 0;
-	this.mouseDownLayerY = 0;
-	this.mouseDownWidth = 0;
-	this.mouseDownHeight = 0;
-	this.idCounter = 0;
-};
-
-TinyMCE_Windows.prototype.init = function(settings) {
-	this.settings = settings;
-
-	if (this.isMSIE)
-		this.addEvent(document, "mousemove", mcWindows.eventDispatcher);
-	else
-		this.addEvent(window, "mousemove", mcWindows.eventDispatcher);
-
-	this.addEvent(document, "mouseup", mcWindows.eventDispatcher);
-
-	this.addEvent(window, "resize", mcWindows.eventDispatcher);
-	this.addEvent(document, "scroll", mcWindows.eventDispatcher);
-
-	this.doc = document;
-};
-
-TinyMCE_Windows.prototype.getBounds = function() {
-	if (!this.bounds) {
-		var vp = tinyMCE.getViewPort(window);
-		var top, left, bottom, right, docEl = this.doc.documentElement;
-
-		top    = vp.top;
-		left   = vp.left;
-		bottom = vp.height + top - 2;
-		right  = vp.width  + left - 22; // TODO this number is platform dependant
-		// x1, y1, x2, y2
-		this.bounds = [left, top, right, bottom];
-	}
-	return this.bounds;
-};
-
-TinyMCE_Windows.prototype.clampBoxPosition = function(x, y, w, h, minW, minH) {
-	var bounds = this.getBounds();
-
-	x = Math.max(bounds[0], Math.min(bounds[2], x + w) - w);
-	y = Math.max(bounds[1], Math.min(bounds[3], y + h) - h);
-
-	return this.clampBoxSize(x, y, w, h, minW, minH);
-};
-
-TinyMCE_Windows.prototype.clampBoxSize = function(x, y, w, h, minW, minH) {
-	var bounds = this.getBounds();
-
-	return [
-		x, y,
-		Math.max(minW, Math.min(bounds[2], x + w) - x),
-		Math.max(minH, Math.min(bounds[3], y + h) - y)
-	];
-};
-
-TinyMCE_Windows.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;
-};
-
-TinyMCE_Windows.prototype.eventDispatcher = function(e) {
-	e = typeof(e) == "undefined" ? window.event : e;
-
-	if (mcWindows.selectedWindow == null)
-		return;
-
-	// Switch focus
-	if (mcWindows.isGecko && e.type == "mousedown") {
-		var elm = e.currentTarget;
-
-		for (var n in mcWindows.windows) {
-			var win = mcWindows.windows[n];
-
-			if (win.headElement == elm || win.resizeElement == elm) {
-				win.focus();
-				break;
-			}
-		}
-	}
-
-	switch (e.type) {
-		case "mousemove":
-			mcWindows.selectedWindow.onMouseMove(e);
-			break;
-
-		case "mouseup":
-			mcWindows.selectedWindow.onMouseUp(e);
-			break;
-
-		case "mousedown":
-			mcWindows.selectedWindow.onMouseDown(e);
-			break;
-
-		case "focus":
-			mcWindows.selectedWindow.onFocus(e);
-			break;
-		case "scroll":
-		case "resize":
-			if (mcWindows.clampUpdateTimeout)
-				clearTimeout(mcWindows.clampUpdateTimeout);
-			mcWindows.clampEventType = e.type;
-			mcWindows.clampUpdateTimeout =
-				setTimeout(function () {mcWindows.updateClamping()}, 100);
-			break;
-	}
-};
-
-TinyMCE_Windows.prototype.updateClamping = function () {
-	var clamp, oversize, etype = mcWindows.clampEventType;
-
-	this.bounds = null; // Recalc window bounds on resize/scroll
-	this.clampUpdateTimeout = null;
-
-	for (var n in this.windows) {
-		win = this.windows[n];
-		if (typeof(win) == 'function' || ! win.winElement) continue;
-
-		clamp = mcWindows.clampBoxPosition(
-			win.left, win.top,
-			win.winElement.scrollWidth,
-			win.winElement.scrollHeight,
-			win.features.minWidth,
-			win.features.minHeight
-		);
-		oversize = (
-			clamp[2] != win.winElement.scrollWidth ||
-			clamp[3] != win.winElement.scrollHeight
-		) ? true : false;
-
-		if (!oversize || win.features.resizable == "yes" || etype != "scroll")
-			win.moveTo(clamp[0], clamp[1]);
-		if (oversize && win.features.resizable == "yes")
-			win.resizeTo(clamp[2], clamp[3]);
-	}
-};
-
-TinyMCE_Windows.prototype.addEvent = function(obj, name, handler) {
-	if (this.isMSIE)
-		obj.attachEvent("on" + name, handler);
-	else
-		obj.addEventListener(name, handler, false);
-};
-
-TinyMCE_Windows.prototype.cancelEvent = function(e) {
-	if (this.isMSIE) {
-		e.returnValue = false;
-		e.cancelBubble = true;
-	} else
-		e.preventDefault();
-};
-
-TinyMCE_Windows.prototype.parseFeatures = function(opts) {
-	// Cleanup the options
-	opts = opts.toLowerCase();
-	opts = opts.replace(/;/g, ",");
-	opts = opts.replace(/[^0-9a-z=,]/g, "");
-
-	var optionChunks = opts.split(',');
-	var options = new Array();
-
-	options['left'] = "10";
-	options['top'] = "10";
-	options['width'] = "300";
-	options['height'] = "300";
-	options['minwidth'] = "100";
-	options['minheight'] = "100";
-	options['resizable'] = "yes";
-	options['minimizable'] = "yes";
-	options['maximizable'] = "yes";
-	options['close'] = "yes";
-	options['movable'] = "yes";
-	options['statusbar'] = "yes";
-	options['scrollbars'] = "auto";
-	options['modal'] = "no";
-
-	if (opts == "")
-		return options;
-
-	for (var i=0; i<optionChunks.length; i++) {
-		var parts = optionChunks[i].split('=');
-
-		if (parts.length == 2)
-			options[parts[0]] = parts[1];
-	}
-
-	options['left'] = parseInt(options['left']);
-	options['top'] = parseInt(options['top']);
-	options['width'] = parseInt(options['width']);
-	options['height'] = parseInt(options['height']);
-	options['minWidth'] = parseInt(options['minwidth']);
-	options['minHeight'] = parseInt(options['minheight']);
-
-	return options;
-};
-
-TinyMCE_Windows.prototype.open = function(url, name, features) {
-	this.lastSelectedWindow = this.selectedWindow;
-
-	var win = new TinyMCE_Window();
-	var winDiv, html = "", id;
-	var imgPath = this.getParam("images_path");
-
-	features = this.parseFeatures(features);
-
-	// Clamp specified dimensions
-	var clamp = mcWindows.clampBoxPosition(
-		features['left'], features['top'],
-		features['width'], features['height'],
-		features['minWidth'], features['minHeight']
-	);
-
-	features['left'] = clamp[0];
-	features['top'] = clamp[1];
-
-	if (features['resizable'] == "yes") {
-		features['width'] = clamp[2];
-		features['height'] = clamp[3];
-	}
-
-	// Create div
-	id = "mcWindow_" + name;
-	win.deltaHeight = 18;
-
-	if (features['statusbar'] == "yes") {
-		win.deltaHeight += 13;
-
-		if (this.isMSIE)
-			win.deltaHeight += 1;
-	}
-
-	width = parseInt(features['width']);
-	height = parseInt(features['height'])-win.deltaHeight;
-
-	if (this.isMSIE)
-		width -= 2;
-
-	// Setup first part of window
-	win.id = id;
-	win.url = url;
-	win.name = name;
-	win.features = features;
-	this.windows[name] = win;
-
-	iframeWidth = width;
-	iframeHeight = height;
-
-	// Create inner content
-	html += '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">';
-	html += '<html>';
-	html += '<head>';
-	html += '<title>Wrapper iframe</title>';
-	html += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';
-	html += '<link href="' + this.getParam("css_file") + '" rel="stylesheet" type="text/css" />';
-	html += '</head>';
-	html += '<body onload="parent.mcWindows.onLoad(\'' + name + '\');">';
-
-	html += '<div id="' + id + '_container" class="mceWindow">';
-	html += '<div id="' + id + '_head" class="mceWindowHead" onmousedown="parent.mcWindows.windows[\'' + name + '\'].focus();">';
-	html += '  <div id="' + id + '_title" class="mceWindowTitle"';
-	html += '  onselectstart="return false;" unselectable="on" style="-moz-user-select: none !important;"></div>';
-	html += '    <div class="mceWindowHeadTools">';
-	html += '      <a href="javascript:parent.mcWindows.windows[\'' + name + '\'].close();" target="_self" onmousedown="return false;" class="mceWindowClose"><img border="0" src="' + imgPath + '/window_close.gif" /></a>';
-	if (features['resizable'] == "yes" && features['maximizable'] == "yes")
-		html += '      <a href="javascript:parent.mcWindows.windows[\'' + name + '\'].maximize();" target="_self" onmousedown="return false;" class="mceWindowMaximize"><img border="0" src="' + imgPath + '/window_maximize.gif" /></a>';
-	// html += '      <a href="javascript:mcWindows.windows[\'' + name + '\'].minimize();" target="_self" onmousedown="return false;" class="mceWindowMinimize"></a>';
-	html += '    </div>';
-	html += '</div><div id="' + id + '_body" class="mceWindowBody" style="width: ' + width + 'px; height: ' + height + 'px;">';
-	html += '<iframe id="' + id + '_iframe" name="' + id + '_iframe" frameborder="0" width="' + iframeWidth + '" height="' + iframeHeight + '" src="' + url + '" class="mceWindowBodyIframe" scrolling="' + features['scrollbars'] + '"></iframe></div>';
-
-	if (features['statusbar'] == "yes") {
-		html += '<div id="' + id + '_statusbar" class="mceWindowStatusbar" onmousedown="parent.mcWindows.windows[\'' + name + '\'].focus();">';
-
-		if (features['resizable'] == "yes") {
-			if (this.isGecko)
-				html += '<div id="' + id + '_resize" class="mceWindowResize"><div style="background-image: url(\'' + imgPath + '/window_resize.gif\'); width: 12px; height: 12px;"></div></div>';
-			else
-				html += '<div id="' + id + '_resize" class="mceWindowResize"><img onmousedown="parent.mcWindows.windows[\'' + name + '\'].focus();" border="0" src="' + imgPath + '/window_resize.gif" /></div>';
-		}
-
-		html += '</div>';
-	}
-
-	html += '</div>';
-
-	html += '</body>';
-	html += '</html>';
-
-	// Create iframe
-	this.createFloatingIFrame(id, features['left'], features['top'], features['width'], features['height'], html);
-};
-
-// Blocks the document events by placing a image over the whole document
-TinyMCE_Windows.prototype.setDocumentLock = function(state) {
-	var elm = document.getElementById('mcWindowEventBlocker');
-
-	if (state) {
-		if (elm == null) {
-			elm = document.createElement("div");
-
-			elm.id = "mcWindowEventBlocker";
-			elm.style.position = "absolute";
-			elm.style.left = "0";
-			elm.style.top = "0";
-
-			document.body.appendChild(elm);
-		}
-
-		elm.style.display = "none";
-
-		var imgPath = this.getParam("images_path");
-		var width = document.body.clientWidth;
-		var height = document.body.clientHeight;
-
-		elm.style.width = width;
-		elm.style.height = height;
-		elm.innerHTML = '<img src="' + imgPath + '/spacer.gif" width="' + width + '" height="' + height + '" />';
-
-		elm.style.zIndex = mcWindows.zindex-1;
-		elm.style.display = "block";
-	} else if (elm != null) {
-		if (mcWindows.windows.length == 0)
-			elm.parentNode.removeChild(elm);
-		else
-			elm.style.zIndex = mcWindows.zindex-1;
-	}
-};
-
-// Gets called when wrapper iframe is initialized
-TinyMCE_Windows.prototype.onLoad = function(name) {
-	var win = mcWindows.windows[name];
-	var id = "mcWindow_" + name;
-	var wrapperIframe = window.frames[id + "_iframe"].frames[0];
-	var wrapperDoc = window.frames[id + "_iframe"].document;
-	var doc = window.frames[id + "_iframe"].document;
-	var winDiv = document.getElementById("mcWindow_" + name + "_div");
-	var realIframe = window.frames[id + "_iframe"].frames[0];
-
-	// Set window data
-	win.id = "mcWindow_" + name;
-	win.winElement = winDiv;
-	win.bodyElement = doc.getElementById(id + '_body');
-	win.iframeElement = doc.getElementById(id + '_iframe');
-	win.headElement = doc.getElementById(id + '_head');
-	win.titleElement = doc.getElementById(id + '_title');
-	win.resizeElement = doc.getElementById(id + '_resize');
-	win.containerElement = doc.getElementById(id + '_container');
-	win.left = win.features['left'];
-	win.top = win.features['top'];
-	win.frame = window.frames[id + '_iframe'].frames[0];
-	win.wrapperFrame = window.frames[id + '_iframe'];
-	win.wrapperIFrameElement = document.getElementById(id + "_iframe");
-
-	// Add event handlers
-	mcWindows.addEvent(win.headElement, "mousedown", mcWindows.eventDispatcher);
-
-	if (win.resizeElement != null)
-		mcWindows.addEvent(win.resizeElement, "mousedown", mcWindows.eventDispatcher);
-
-	if (mcWindows.isMSIE) {
-		mcWindows.addEvent(realIframe.document, "mousemove", mcWindows.eventDispatcher);
-		mcWindows.addEvent(realIframe.document, "mouseup", mcWindows.eventDispatcher);
-	} else {
-		mcWindows.addEvent(realIframe, "mousemove", mcWindows.eventDispatcher);
-		mcWindows.addEvent(realIframe, "mouseup", mcWindows.eventDispatcher);
-		mcWindows.addEvent(realIframe, "focus", mcWindows.eventDispatcher);
-	}
-
-	for (var i=0; i<window.frames.length; i++) {
-		if (!window.frames[i]._hasMouseHandlers) {
-			if (mcWindows.isMSIE) {
-				mcWindows.addEvent(window.frames[i].document, "mousemove", mcWindows.eventDispatcher);
-				mcWindows.addEvent(window.frames[i].document, "mouseup", mcWindows.eventDispatcher);
-			} else {
-				mcWindows.addEvent(window.frames[i], "mousemove", mcWindows.eventDispatcher);
-				mcWindows.addEvent(window.frames[i], "mouseup", mcWindows.eventDispatcher);
-			}
-
-			window.frames[i]._hasMouseHandlers = true;
-		}
-	}
-
-	if (mcWindows.isMSIE) {
-		mcWindows.addEvent(win.frame.document, "mousemove", mcWindows.eventDispatcher);
-		mcWindows.addEvent(win.frame.document, "mouseup", mcWindows.eventDispatcher);
-	} else {
-		mcWindows.addEvent(win.frame, "mousemove", mcWindows.eventDispatcher);
-		mcWindows.addEvent(win.frame, "mouseup", mcWindows.eventDispatcher);
-		mcWindows.addEvent(win.frame, "focus", mcWindows.eventDispatcher);
-	}
-
-	// Dispatch open window event
-	var func = this.getParam("on_open_window", "");
-	if (func != "")
-		eval(func + "(win);");
-
-	win.focus();
-
-	if (win.features['modal'] == "yes")
-		mcWindows.setDocumentLock(true);
-};
-
-TinyMCE_Windows.prototype.createFloatingIFrame = function(id_prefix, left, top, width, height, html) {
-	var iframe = document.createElement("iframe");
-	var div = document.createElement("div"), doc;
-
-	width = parseInt(width);
-	height = parseInt(height)+1;
-
-	// Create wrapper div
-	div.setAttribute("id", id_prefix + "_div");
-	div.setAttribute("width", width);
-	div.setAttribute("height", (height));
-	div.style.position = "absolute";
-
-	div.style.left = left + "px";
-	div.style.top = top + "px";
-	div.style.width = width + "px";
-	div.style.height = (height) + "px";
-	div.style.backgroundColor = "white";
-	div.style.display = "none";
-
-	if (this.isGecko) {
-		iframeWidth = width + 2;
-		iframeHeight = height + 2;
-	} else {
-		iframeWidth = width;
-		iframeHeight = height + 1;
-	}
-
-	// Create iframe
-	iframe.setAttribute("id", id_prefix + "_iframe");
-	iframe.setAttribute("name", id_prefix + "_iframe");
-	iframe.setAttribute("border", "0");
-	iframe.setAttribute("frameBorder", "0");
-	iframe.setAttribute("marginWidth", "0");
-	iframe.setAttribute("marginHeight", "0");
-	iframe.setAttribute("leftMargin", "0");
-	iframe.setAttribute("topMargin", "0");
-	iframe.setAttribute("width", iframeWidth);
-	iframe.setAttribute("height", iframeHeight);
-	// iframe.setAttribute("src", "../jscripts/tiny_mce/blank.htm");
-	// iframe.setAttribute("allowtransparency", "false");
-	iframe.setAttribute("scrolling", "no");
-	iframe.style.width = iframeWidth + "px";
-	iframe.style.height = iframeHeight + "px";
-	iframe.style.backgroundColor = "white";
-	div.appendChild(iframe);
-
-	document.body.appendChild(div);
-
-	// Fixed MSIE 5.0 issue
-	div.innerHTML = div.innerHTML;
-
-	if (this.isSafari) {
-		// Give Safari some time to setup
-		window.setTimeout(function() {
-			var doc = window.frames[id_prefix + '_iframe'].document;
-			doc.open();
-			doc.write(html);
-			doc.close();
-		}, 10);
-	} else {
-		doc = window.frames[id_prefix + '_iframe'].window.document;
-		doc.open();
-		doc.write(html);
-		doc.close();
-	}
-
-	div.style.display = "block";
-
-	return div;
-};
-
-// Window instance
-function TinyMCE_Window() {
-};
-
-TinyMCE_Window.prototype.focus = function() {
-	if (this != mcWindows.selectedWindow) {
-		this.winElement.style.zIndex = ++mcWindows.zindex;
-		mcWindows.lastSelectedWindow = mcWindows.selectedWindow;
-		mcWindows.selectedWindow = this;
-	}
-};
-
-TinyMCE_Window.prototype.minimize = function() {
-};
-
-TinyMCE_Window.prototype.maximize = function() {
-	if (this.restoreSize) {
-		this.moveTo(this.restoreSize[0], this.restoreSize[1]);
-		this.resizeTo(this.restoreSize[2], this.restoreSize[3]);
-		this.updateClamping();
-		this.restoreSize = null;
-	} else {
-		var bounds = mcWindows.getBounds();
-		this.restoreSize = [
-			this.left, this.top,
-			this.winElement.scrollWidth,
-			this.winElement.scrollHeight
-		];
-		this.moveTo(bounds[0], bounds[1]);
-		this.resizeTo(
-			bounds[2] - bounds[0],
-			bounds[3] - bounds[1]
-		);
-	}
-};
-
-TinyMCE_Window.prototype.startResize = function() {
-	mcWindows.action = "resize";
-};
-
-TinyMCE_Window.prototype.startMove = function(e) {
-	mcWindows.action = "move";
-};
-
-TinyMCE_Window.prototype.close = function() {
-	if (this.frame && this.frame['tinyMCEPopup'])
-		this.frame['tinyMCEPopup'].restoreSelection();
-
-	if (mcWindows.lastSelectedWindow != null)
-		mcWindows.lastSelectedWindow.focus();
-
-	var mcWindowsNew = new Array();
-	for (var n in mcWindows.windows) {
-		var win = mcWindows.windows[n];
-		if (typeof(win) == 'function')
-			continue;
-
-		if (win.name != this.name)
-			mcWindowsNew[n] = win;
-	}
-
-	mcWindows.windows = mcWindowsNew;
-
-	// alert(mcWindows.doc.getElementById(this.id + "_iframe"));
-
-	var e = mcWindows.doc.getElementById(this.id + "_iframe");
-	e.parentNode.removeChild(e);
-
-	var e = mcWindows.doc.getElementById(this.id + "_div");
-	e.parentNode.removeChild(e);
-
-	mcWindows.setDocumentLock(false);
-};
-
-TinyMCE_Window.prototype.onMouseMove = function(e) {
-	var clamp;
-	// Calculate real X, Y
-	var dx = e.screenX - mcWindows.mouseDownScreenX;
-	var dy = e.screenY - mcWindows.mouseDownScreenY;
-
-	switch (mcWindows.action) {
-		case "resize":
-			clamp = mcWindows.clampBoxSize(
-				this.left, this.top,
-				mcWindows.mouseDownWidth + (e.screenX - mcWindows.mouseDownScreenX),
-				mcWindows.mouseDownHeight + (e.screenY - mcWindows.mouseDownScreenY),
-				this.features.minWidth, this.features.minHeight
-			);
-
-			this.resizeTo(clamp[2], clamp[3]);
-
-			mcWindows.cancelEvent(e);
-			break;
-
-		case "move":
-			this.left = mcWindows.mouseDownLayerX + (e.screenX - mcWindows.mouseDownScreenX);
-			this.top = mcWindows.mouseDownLayerY + (e.screenY - mcWindows.mouseDownScreenY);
-			this.updateClamping();
-
-			mcWindows.cancelEvent(e);
-			break;
-	}
-};
-
-TinyMCE_Window.prototype.moveTo = function (x, y) {
-	this.left = x;
-	this.top = y;
-
-	this.winElement.style.left = this.left + "px";
-	this.winElement.style.top = this.top + "px";
-};
-
-TinyMCE_Window.prototype.resizeTo = function (width, height) {
-	this.wrapperIFrameElement.style.width = (width+2) + 'px';
-	this.wrapperIFrameElement.style.height = (height+2) + 'px';
-	this.wrapperIFrameElement.width = width+2;
-	this.wrapperIFrameElement.height = height+2;
-	this.winElement.style.width = width + 'px';
-	this.winElement.style.height = height + 'px';
-
-	height = height - this.deltaHeight;
-
-	this.containerElement.style.width = width + 'px';
-	this.iframeElement.style.width = width + 'px';
-	this.iframeElement.style.height = height + 'px';
-	this.bodyElement.style.width = width + 'px';
-	this.bodyElement.style.height = height + 'px';
-	this.headElement.style.width = width + 'px';
-	//this.statusElement.style.width = width + 'px';
-};
-
-TinyMCE_Window.prototype.updateClamping = function () {
-	var clamp, oversize;
-
-	clamp = mcWindows.clampBoxPosition(
-		this.left, this.top,
-		this.winElement.scrollWidth,
-		this.winElement.scrollHeight,
-		this.features.minWidth, this.features.minHeight
-	);
-	oversize = (
-		clamp[2] != this.winElement.scrollWidth ||
-		clamp[3] != this.winElement.scrollHeight
-	) ? true : false;
-
-	this.moveTo(clamp[0], clamp[1]);
-	if (this.features.resizable == "yes" && oversize)
-		this.resizeTo(clamp[2], clamp[3]);
-};
-
-function debug(msg) {
-	document.getElementById('debug').value += msg + "\n";
-}
-
-TinyMCE_Window.prototype.onMouseUp = function(e) {
-	mcWindows.action = "none";
-};
-
-TinyMCE_Window.prototype.onFocus = function(e) {
-	// Gecko only handler
-	var winRef = e.currentTarget;
-
-	for (var n in mcWindows.windows) {
-		var win = mcWindows.windows[n];
-		if (typeof(win) == 'function')
-			continue;
-
-		if (winRef.name == win.id + "_iframe") {
-			win.focus();
-			return;
-		}
-	}
-};
-
-TinyMCE_Window.prototype.onMouseDown = function(e) {
-	var elm = mcWindows.isMSIE ? this.wrapperFrame.event.srcElement : e.target;
-
-	mcWindows.mouseDownScreenX = e.screenX;
-	mcWindows.mouseDownScreenY = e.screenY;
-	mcWindows.mouseDownLayerX = this.left;
-	mcWindows.mouseDownLayerY = this.top;
-	mcWindows.mouseDownWidth = parseInt(this.winElement.style.width);
-	mcWindows.mouseDownHeight = parseInt(this.winElement.style.height);
-
-	if (this.resizeElement != null && elm == this.resizeElement.firstChild)
-		this.startResize(e);
-	else
-		this.startMove(e);
-
-	mcWindows.cancelEvent(e);
-};
-
-// Global instance
-var mcWindows = new TinyMCE_Windows();
-
-// Initialize windows
-mcWindows.init({
-	images_path : tinyMCE.baseURL + "/plugins/inlinepopups/images",
-	css_file : tinyMCE.baseURL + "/plugins/inlinepopups/css/inlinepopup.css"
-});

Copied: plog/trunk/js/tinymce/plugins/inlinepopups/editor_plugin_src.js (from rev 7165, plog/trunk/js/tinymce/plugins/inlinepopups/editor_plugin_src.js)
===================================================================
--- plog/trunk/js/tinymce/plugins/inlinepopups/editor_plugin_src.js	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/inlinepopups/editor_plugin_src.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,819 @@
+/**
+ * $Id: editor_plugin_src.js 268 2007-04-28 15:52:59Z spocke $
+ *
+ * Moxiecode DHTML Windows script.
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
+ */
+
+// Patch openWindow, closeWindow TinyMCE functions
+
+var TinyMCE_InlinePopupsPlugin = {
+	getInfo : function() {
+		return {
+			longname : 'Inline Popups',
+			author : 'Moxiecode Systems AB',
+			authorurl : 'http://tinymce.moxiecode.com',
+			infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups',
+			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+		};
+	}
+};
+
+tinyMCE.addPlugin("inlinepopups", TinyMCE_InlinePopupsPlugin);
+
+// Patch openWindow, closeWindow TinyMCE functions
+
+TinyMCE_Engine.prototype.orgOpenWindow = TinyMCE_Engine.prototype.openWindow;
+TinyMCE_Engine.prototype.orgCloseWindow = TinyMCE_Engine.prototype.closeWindow;
+
+TinyMCE_Engine.prototype.openWindow = function(template, args) {
+	// Does the caller support inline
+	if (args['inline'] != "yes" || tinyMCE.isOpera || tinyMCE.getParam("plugins").indexOf('inlinepopups') == -1) {
+		mcWindows.selectedWindow = null;
+		args['mce_inside_iframe'] = false;
+		this.orgOpenWindow(template, args);
+		return;
+	}
+
+	var url, resizable, scrollbars;
+
+	args['mce_inside_iframe'] = true;
+	tinyMCE.windowArgs = args;
+
+	if (template['file'].charAt(0) != '/' && template['file'].indexOf('://') == -1)
+		url = tinyMCE.baseURL + "/themes/" + tinyMCE.getParam("theme") + "/" + template['file'];
+	else
+		url = template['file'];
+
+	if (!(width = parseInt(template['width'])))
+		width = 320;
+
+	if (!(height = parseInt(template['height'])))
+		height = 200;
+
+	if (!(minWidth = parseInt(template['minWidth'])))
+		minWidth = 100;
+
+	if (!(minHeight = parseInt(template['minHeight'])))
+		minHeight = 100;
+
+	resizable = (args && args['resizable']) ? args['resizable'] : "no";
+	scrollbars = (args && args['scrollbars']) ? args['scrollbars'] : "no";
+
+	height += 18;
+
+	// Replace all args as variables in URL
+	for (var name in args) {
+		if (typeof(args[name]) == 'function')
+			continue;
+
+		url = tinyMCE.replaceVar(url, name, escape(args[name]));
+	}
+
+	var elm = document.getElementById(this.selectedInstance.editorId + '_parent');
+
+	if (tinyMCE.hasPlugin('fullscreen') && this.selectedInstance.getData('fullscreen').enabled)
+		pos = { absLeft: 0, absTop: 0 };
+	else
+		pos = tinyMCE.getAbsPosition(elm);
+
+	// Center div in editor area
+	pos.absLeft += Math.round((elm.firstChild.clientWidth / 2) - (width / 2));
+	pos.absTop += Math.round((elm.firstChild.clientHeight / 2) - (height / 2));
+
+	mcWindows.open(url, mcWindows.idCounter++, "modal=yes,width=" + width+ ",height=" + height + ",resizable=" + resizable + ",scrollbars=" + scrollbars + ",statusbar=" + resizable + ",left=" + pos.absLeft + ",top=" + pos.absTop + ",minWidth=" + minWidth + ",minHeight=" + minHeight );
+};
+
+TinyMCE_Engine.prototype.closeWindow = function(win) {
+	var gotit = false, n, w;
+
+	for (n in mcWindows.windows) {
+		w = mcWindows.windows[n];
+
+		if (typeof(w) == 'function')
+			continue;
+
+		if (win.name == w.id + '_iframe') {
+			w.close();
+			gotit = true;
+		}
+	}
+
+	if (!gotit)
+		this.orgCloseWindow(win);
+
+	tinyMCE.selectedInstance.getWin().focus(); 
+};
+
+TinyMCE_Engine.prototype.setWindowTitle = function(win_ref, title) {
+	for (var n in mcWindows.windows) {
+		var win = mcWindows.windows[n];
+		if (typeof(win) == 'function')
+			continue;
+
+		if (win_ref.name == win.id + "_iframe")
+			window.frames[win.id + "_iframe"].document.getElementById(win.id + '_title').innerHTML = title;
+	}
+};
+
+// * * * * * TinyMCE_Windows classes below
+
+// Windows handler
+function TinyMCE_Windows() {
+	this.settings = new Array();
+	this.windows = new Array();
+	this.isMSIE = (navigator.appName == "Microsoft Internet Explorer");
+	this.isGecko = navigator.userAgent.indexOf('Gecko') != -1;
+	this.isSafari = navigator.userAgent.indexOf('Safari') != -1;
+	this.isMac = navigator.userAgent.indexOf('Mac') != -1;
+	this.isMSIE5_0 = this.isMSIE && (navigator.userAgent.indexOf('MSIE 5.0') != -1);
+	this.action = "none";
+	this.selectedWindow = null;
+	this.lastSelectedWindow = null;
+	this.zindex = 1001;
+	this.mouseDownScreenX = 0;
+	this.mouseDownScreenY = 0;
+	this.mouseDownLayerX = 0;
+	this.mouseDownLayerY = 0;
+	this.mouseDownWidth = 0;
+	this.mouseDownHeight = 0;
+	this.idCounter = 0;
+};
+
+TinyMCE_Windows.prototype.init = function(settings) {
+	this.settings = settings;
+
+	if (this.isMSIE)
+		this.addEvent(document, "mousemove", mcWindows.eventDispatcher);
+	else
+		this.addEvent(window, "mousemove", mcWindows.eventDispatcher);
+
+	this.addEvent(document, "mouseup", mcWindows.eventDispatcher);
+
+	this.addEvent(window, "resize", mcWindows.eventDispatcher);
+	this.addEvent(document, "scroll", mcWindows.eventDispatcher);
+
+	this.doc = document;
+};
+
+TinyMCE_Windows.prototype.getBounds = function() {
+	if (!this.bounds) {
+		var vp = tinyMCE.getViewPort(window);
+		var top, left, bottom, right, docEl = this.doc.documentElement;
+
+		top    = vp.top;
+		left   = vp.left;
+		bottom = vp.height + top - 2;
+		right  = vp.width  + left - 22; // TODO this number is platform dependant
+		// x1, y1, x2, y2
+		this.bounds = [left, top, right, bottom];
+	}
+	return this.bounds;
+};
+
+TinyMCE_Windows.prototype.clampBoxPosition = function(x, y, w, h, minW, minH) {
+	var bounds = this.getBounds();
+
+	x = Math.max(bounds[0], Math.min(bounds[2], x + w) - w);
+	y = Math.max(bounds[1], Math.min(bounds[3], y + h) - h);
+
+	return this.clampBoxSize(x, y, w, h, minW, minH);
+};
+
+TinyMCE_Windows.prototype.clampBoxSize = function(x, y, w, h, minW, minH) {
+	var bounds = this.getBounds();
+
+	return [
+		x, y,
+		Math.max(minW, Math.min(bounds[2], x + w) - x),
+		Math.max(minH, Math.min(bounds[3], y + h) - y)
+	];
+};
+
+TinyMCE_Windows.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;
+};
+
+TinyMCE_Windows.prototype.eventDispatcher = function(e) {
+	e = typeof(e) == "undefined" ? window.event : e;
+
+	if (mcWindows.selectedWindow == null)
+		return;
+
+	// Switch focus
+	if (mcWindows.isGecko && e.type == "mousedown") {
+		var elm = e.currentTarget;
+
+		for (var n in mcWindows.windows) {
+			var win = mcWindows.windows[n];
+
+			if (win.headElement == elm || win.resizeElement == elm) {
+				win.focus();
+				break;
+			}
+		}
+	}
+
+	switch (e.type) {
+		case "mousemove":
+			mcWindows.selectedWindow.onMouseMove(e);
+			break;
+
+		case "mouseup":
+			mcWindows.selectedWindow.onMouseUp(e);
+			break;
+
+		case "mousedown":
+			mcWindows.selectedWindow.onMouseDown(e);
+			break;
+
+		case "focus":
+			mcWindows.selectedWindow.onFocus(e);
+			break;
+		case "scroll":
+		case "resize":
+			if (mcWindows.clampUpdateTimeout)
+				clearTimeout(mcWindows.clampUpdateTimeout);
+			mcWindows.clampEventType = e.type;
+			mcWindows.clampUpdateTimeout =
+				setTimeout(function () {mcWindows.updateClamping()}, 100);
+			break;
+	}
+};
+
+TinyMCE_Windows.prototype.updateClamping = function () {
+	var clamp, oversize, etype = mcWindows.clampEventType;
+
+	this.bounds = null; // Recalc window bounds on resize/scroll
+	this.clampUpdateTimeout = null;
+
+	for (var n in this.windows) {
+		win = this.windows[n];
+		if (typeof(win) == 'function' || ! win.winElement) continue;
+
+		clamp = mcWindows.clampBoxPosition(
+			win.left, win.top,
+			win.winElement.scrollWidth,
+			win.winElement.scrollHeight,
+			win.features.minWidth,
+			win.features.minHeight
+		);
+		oversize = (
+			clamp[2] != win.winElement.scrollWidth ||
+			clamp[3] != win.winElement.scrollHeight
+		) ? true : false;
+
+		if (!oversize || win.features.resizable == "yes" || etype != "scroll")
+			win.moveTo(clamp[0], clamp[1]);
+		if (oversize && win.features.resizable == "yes")
+			win.resizeTo(clamp[2], clamp[3]);
+	}
+};
+
+TinyMCE_Windows.prototype.addEvent = function(obj, name, handler) {
+	if (this.isMSIE)
+		obj.attachEvent("on" + name, handler);
+	else
+		obj.addEventListener(name, handler, false);
+};
+
+TinyMCE_Windows.prototype.cancelEvent = function(e) {
+	if (this.isMSIE) {
+		e.returnValue = false;
+		e.cancelBubble = true;
+	} else
+		e.preventDefault();
+};
+
+TinyMCE_Windows.prototype.parseFeatures = function(opts) {
+	// Cleanup the options
+	opts = opts.toLowerCase();
+	opts = opts.replace(/;/g, ",");
+	opts = opts.replace(/[^0-9a-z=,]/g, "");
+
+	var optionChunks = opts.split(',');
+	var options = new Array();
+
+	options['left'] = "10";
+	options['top'] = "10";
+	options['width'] = "300";
+	options['height'] = "300";
+	options['minwidth'] = "100";
+	options['minheight'] = "100";
+	options['resizable'] = "yes";
+	options['minimizable'] = "yes";
+	options['maximizable'] = "yes";
+	options['close'] = "yes";
+	options['movable'] = "yes";
+	options['statusbar'] = "yes";
+	options['scrollbars'] = "auto";
+	options['modal'] = "no";
+
+	if (opts == "")
+		return options;
+
+	for (var i=0; i<optionChunks.length; i++) {
+		var parts = optionChunks[i].split('=');
+
+		if (parts.length == 2)
+			options[parts[0]] = parts[1];
+	}
+
+	options['left'] = parseInt(options['left']);
+	options['top'] = parseInt(options['top']);
+	options['width'] = parseInt(options['width']);
+	options['height'] = parseInt(options['height']);
+	options['minWidth'] = parseInt(options['minwidth']);
+	options['minHeight'] = parseInt(options['minheight']);
+
+	return options;
+};
+
+TinyMCE_Windows.prototype.open = function(url, name, features) {
+	this.lastSelectedWindow = this.selectedWindow;
+
+	var win = new TinyMCE_Window();
+	var winDiv, html = "", id;
+	var imgPath = this.getParam("images_path");
+
+	features = this.parseFeatures(features);
+
+	// Clamp specified dimensions
+	var clamp = mcWindows.clampBoxPosition(
+		features['left'], features['top'],
+		features['width'], features['height'],
+		features['minWidth'], features['minHeight']
+	);
+
+	features['left'] = clamp[0];
+	features['top'] = clamp[1];
+
+	if (features['resizable'] == "yes") {
+		features['width'] = clamp[2];
+		features['height'] = clamp[3];
+	}
+
+	// Create div
+	id = "mcWindow_" + name;
+	win.deltaHeight = 18;
+
+	if (features['statusbar'] == "yes") {
+		win.deltaHeight += 13;
+
+		if (this.isMSIE)
+			win.deltaHeight += 1;
+	}
+
+	width = parseInt(features['width']);
+	height = parseInt(features['height'])-win.deltaHeight;
+
+	if (this.isMSIE)
+		width -= 2;
+
+	// Setup first part of window
+	win.id = id;
+	win.url = url;
+	win.name = name;
+	win.features = features;
+	this.windows[name] = win;
+
+	iframeWidth = width;
+	iframeHeight = height;
+
+	// Create inner content
+	html += '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">';
+	html += '<html>';
+	html += '<head>';
+	html += '<title>Wrapper iframe</title>';
+	html += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';
+	html += '<link href="' + this.getParam("css_file") + '" rel="stylesheet" type="text/css" />';
+	html += '</head>';
+	html += '<body onload="parent.mcWindows.onLoad(\'' + name + '\');">';
+
+	html += '<div id="' + id + '_container" class="mceWindow">';
+	html += '<div id="' + id + '_head" class="mceWindowHead" onmousedown="parent.mcWindows.windows[\'' + name + '\'].focus();">';
+	html += '  <div id="' + id + '_title" class="mceWindowTitle"';
+	html += '  onselectstart="return false;" unselectable="on" style="-moz-user-select: none !important;"></div>';
+	html += '    <div class="mceWindowHeadTools">';
+	html += '      <a href="javascript:parent.mcWindows.windows[\'' + name + '\'].close();" target="_self" onmousedown="return false;" class="mceWindowClose"><img border="0" src="' + imgPath + '/window_close.gif" /></a>';
+	if (features['resizable'] == "yes" && features['maximizable'] == "yes")
+		html += '      <a href="javascript:parent.mcWindows.windows[\'' + name + '\'].maximize();" target="_self" onmousedown="return false;" class="mceWindowMaximize"><img border="0" src="' + imgPath + '/window_maximize.gif" /></a>';
+	// html += '      <a href="javascript:mcWindows.windows[\'' + name + '\'].minimize();" target="_self" onmousedown="return false;" class="mceWindowMinimize"></a>';
+	html += '    </div>';
+	html += '</div><div id="' + id + '_body" class="mceWindowBody" style="width: ' + width + 'px; height: ' + height + 'px;">';
+	html += '<iframe id="' + id + '_iframe" name="' + id + '_iframe" frameborder="0" width="' + iframeWidth + '" height="' + iframeHeight + '" src="' + url + '" class="mceWindowBodyIframe" scrolling="' + features['scrollbars'] + '"></iframe></div>';
+
+	if (features['statusbar'] == "yes") {
+		html += '<div id="' + id + '_statusbar" class="mceWindowStatusbar" onmousedown="parent.mcWindows.windows[\'' + name + '\'].focus();">';
+
+		if (features['resizable'] == "yes") {
+			if (this.isGecko)
+				html += '<div id="' + id + '_resize" class="mceWindowResize"><div style="background-image: url(\'' + imgPath + '/window_resize.gif\'); width: 12px; height: 12px;"></div></div>';
+			else
+				html += '<div id="' + id + '_resize" class="mceWindowResize"><img onmousedown="parent.mcWindows.windows[\'' + name + '\'].focus();" border="0" src="' + imgPath + '/window_resize.gif" /></div>';
+		}
+
+		html += '</div>';
+	}
+
+	html += '</div>';
+
+	html += '</body>';
+	html += '</html>';
+
+	// Create iframe
+	this.createFloatingIFrame(id, features['left'], features['top'], features['width'], features['height'], html);
+};
+
+// Blocks the document events by placing a image over the whole document
+TinyMCE_Windows.prototype.setDocumentLock = function(state) {
+	var elm = document.getElementById('mcWindowEventBlocker');
+
+	if (state) {
+		if (elm == null) {
+			elm = document.createElement("div");
+
+			elm.id = "mcWindowEventBlocker";
+			elm.style.position = "absolute";
+			elm.style.left = "0";
+			elm.style.top = "0";
+
+			document.body.appendChild(elm);
+		}
+
+		elm.style.display = "none";
+
+		var imgPath = this.getParam("images_path");
+		var width = document.body.clientWidth;
+		var height = document.body.clientHeight;
+
+		elm.style.width = width;
+		elm.style.height = height;
+		elm.innerHTML = '<img src="' + imgPath + '/spacer.gif" width="' + width + '" height="' + height + '" />';
+
+		elm.style.zIndex = mcWindows.zindex-1;
+		elm.style.display = "block";
+	} else if (elm != null) {
+		if (mcWindows.windows.length == 0)
+			elm.parentNode.removeChild(elm);
+		else
+			elm.style.zIndex = mcWindows.zindex-1;
+	}
+};
+
+// Gets called when wrapper iframe is initialized
+TinyMCE_Windows.prototype.onLoad = function(name) {
+	var win = mcWindows.windows[name];
+	var id = "mcWindow_" + name;
+	var wrapperIframe = window.frames[id + "_iframe"].frames[0];
+	var wrapperDoc = window.frames[id + "_iframe"].document;
+	var doc = window.frames[id + "_iframe"].document;
+	var winDiv = document.getElementById("mcWindow_" + name + "_div");
+	var realIframe = window.frames[id + "_iframe"].frames[0];
+
+	// Set window data
+	win.id = "mcWindow_" + name;
+	win.winElement = winDiv;
+	win.bodyElement = doc.getElementById(id + '_body');
+	win.iframeElement = doc.getElementById(id + '_iframe');
+	win.headElement = doc.getElementById(id + '_head');
+	win.titleElement = doc.getElementById(id + '_title');
+	win.resizeElement = doc.getElementById(id + '_resize');
+	win.containerElement = doc.getElementById(id + '_container');
+	win.left = win.features['left'];
+	win.top = win.features['top'];
+	win.frame = window.frames[id + '_iframe'].frames[0];
+	win.wrapperFrame = window.frames[id + '_iframe'];
+	win.wrapperIFrameElement = document.getElementById(id + "_iframe");
+
+	// Add event handlers
+	mcWindows.addEvent(win.headElement, "mousedown", mcWindows.eventDispatcher);
+
+	if (win.resizeElement != null)
+		mcWindows.addEvent(win.resizeElement, "mousedown", mcWindows.eventDispatcher);
+
+	if (mcWindows.isMSIE) {
+		mcWindows.addEvent(realIframe.document, "mousemove", mcWindows.eventDispatcher);
+		mcWindows.addEvent(realIframe.document, "mouseup", mcWindows.eventDispatcher);
+	} else {
+		mcWindows.addEvent(realIframe, "mousemove", mcWindows.eventDispatcher);
+		mcWindows.addEvent(realIframe, "mouseup", mcWindows.eventDispatcher);
+		mcWindows.addEvent(realIframe, "focus", mcWindows.eventDispatcher);
+	}
+
+	for (var i=0; i<window.frames.length; i++) {
+		if (!window.frames[i]._hasMouseHandlers) {
+			if (mcWindows.isMSIE) {
+				mcWindows.addEvent(window.frames[i].document, "mousemove", mcWindows.eventDispatcher);
+				mcWindows.addEvent(window.frames[i].document, "mouseup", mcWindows.eventDispatcher);
+			} else {
+				mcWindows.addEvent(window.frames[i], "mousemove", mcWindows.eventDispatcher);
+				mcWindows.addEvent(window.frames[i], "mouseup", mcWindows.eventDispatcher);
+			}
+
+			window.frames[i]._hasMouseHandlers = true;
+		}
+	}
+
+	if (mcWindows.isMSIE) {
+		mcWindows.addEvent(win.frame.document, "mousemove", mcWindows.eventDispatcher);
+		mcWindows.addEvent(win.frame.document, "mouseup", mcWindows.eventDispatcher);
+	} else {
+		mcWindows.addEvent(win.frame, "mousemove", mcWindows.eventDispatcher);
+		mcWindows.addEvent(win.frame, "mouseup", mcWindows.eventDispatcher);
+		mcWindows.addEvent(win.frame, "focus", mcWindows.eventDispatcher);
+	}
+
+	// Dispatch open window event
+	var func = this.getParam("on_open_window", "");
+	if (func != "")
+		eval(func + "(win);");
+
+	win.focus();
+
+	if (win.features['modal'] == "yes")
+		mcWindows.setDocumentLock(true);
+};
+
+TinyMCE_Windows.prototype.createFloatingIFrame = function(id_prefix, left, top, width, height, html) {
+	var iframe = document.createElement("iframe");
+	var div = document.createElement("div"), doc;
+
+	width = parseInt(width);
+	height = parseInt(height)+1;
+
+	// Create wrapper div
+	div.setAttribute("id", id_prefix + "_div");
+	div.setAttribute("width", width);
+	div.setAttribute("height", (height));
+	div.style.position = "absolute";
+
+	div.style.left = left + "px";
+	div.style.top = top + "px";
+	div.style.width = width + "px";
+	div.style.height = (height) + "px";
+	div.style.backgroundColor = "white";
+	div.style.display = "none";
+
+	if (this.isGecko) {
+		iframeWidth = width + 2;
+		iframeHeight = height + 2;
+	} else {
+		iframeWidth = width;
+		iframeHeight = height + 1;
+	}
+
+	// Create iframe
+	iframe.setAttribute("id", id_prefix + "_iframe");
+	iframe.setAttribute("name", id_prefix + "_iframe");
+	iframe.setAttribute("border", "0");
+	iframe.setAttribute("frameBorder", "0");
+	iframe.setAttribute("marginWidth", "0");
+	iframe.setAttribute("marginHeight", "0");
+	iframe.setAttribute("leftMargin", "0");
+	iframe.setAttribute("topMargin", "0");
+	iframe.setAttribute("width", iframeWidth);
+	iframe.setAttribute("height", iframeHeight);
+	// iframe.setAttribute("src", "../jscripts/tiny_mce/blank.htm");
+	// iframe.setAttribute("allowtransparency", "false");
+	iframe.setAttribute("scrolling", "no");
+	iframe.style.width = iframeWidth + "px";
+	iframe.style.height = iframeHeight + "px";
+	iframe.style.backgroundColor = "white";
+	div.appendChild(iframe);
+
+	document.body.appendChild(div);
+
+	// Fixed MSIE 5.0 issue
+	div.innerHTML = div.innerHTML;
+
+	if (this.isSafari) {
+		// Give Safari some time to setup
+		window.setTimeout(function() {
+			var doc = window.frames[id_prefix + '_iframe'].document;
+			doc.open();
+			doc.write(html);
+			doc.close();
+		}, 10);
+	} else {
+		doc = window.frames[id_prefix + '_iframe'].window.document;
+		doc.open();
+		doc.write(html);
+		doc.close();
+	}
+
+	div.style.display = "block";
+
+	return div;
+};
+
+// Window instance
+function TinyMCE_Window() {
+};
+
+TinyMCE_Window.prototype.focus = function() {
+	if (this != mcWindows.selectedWindow) {
+		this.winElement.style.zIndex = ++mcWindows.zindex;
+		mcWindows.lastSelectedWindow = mcWindows.selectedWindow;
+		mcWindows.selectedWindow = this;
+	}
+};
+
+TinyMCE_Window.prototype.minimize = function() {
+};
+
+TinyMCE_Window.prototype.maximize = function() {
+	if (this.restoreSize) {
+		this.moveTo(this.restoreSize[0], this.restoreSize[1]);
+		this.resizeTo(this.restoreSize[2], this.restoreSize[3]);
+		this.updateClamping();
+		this.restoreSize = null;
+	} else {
+		var bounds = mcWindows.getBounds();
+		this.restoreSize = [
+			this.left, this.top,
+			this.winElement.scrollWidth,
+			this.winElement.scrollHeight
+		];
+		this.moveTo(bounds[0], bounds[1]);
+		this.resizeTo(
+			bounds[2] - bounds[0],
+			bounds[3] - bounds[1]
+		);
+	}
+};
+
+TinyMCE_Window.prototype.startResize = function() {
+	mcWindows.action = "resize";
+};
+
+TinyMCE_Window.prototype.startMove = function(e) {
+	mcWindows.action = "move";
+};
+
+TinyMCE_Window.prototype.close = function() {
+	if (this.frame && this.frame['tinyMCEPopup'])
+		this.frame['tinyMCEPopup'].restoreSelection();
+
+	if (mcWindows.lastSelectedWindow != null)
+		mcWindows.lastSelectedWindow.focus();
+
+	var mcWindowsNew = new Array();
+	for (var n in mcWindows.windows) {
+		var win = mcWindows.windows[n];
+		if (typeof(win) == 'function')
+			continue;
+
+		if (win.name != this.name)
+			mcWindowsNew[n] = win;
+	}
+
+	mcWindows.windows = mcWindowsNew;
+
+	// alert(mcWindows.doc.getElementById(this.id + "_iframe"));
+
+	var e = mcWindows.doc.getElementById(this.id + "_iframe");
+	e.parentNode.removeChild(e);
+
+	var e = mcWindows.doc.getElementById(this.id + "_div");
+	e.parentNode.removeChild(e);
+
+	mcWindows.setDocumentLock(false);
+};
+
+TinyMCE_Window.prototype.onMouseMove = function(e) {
+	var clamp;
+	// Calculate real X, Y
+	var dx = e.screenX - mcWindows.mouseDownScreenX;
+	var dy = e.screenY - mcWindows.mouseDownScreenY;
+
+	switch (mcWindows.action) {
+		case "resize":
+			clamp = mcWindows.clampBoxSize(
+				this.left, this.top,
+				mcWindows.mouseDownWidth + (e.screenX - mcWindows.mouseDownScreenX),
+				mcWindows.mouseDownHeight + (e.screenY - mcWindows.mouseDownScreenY),
+				this.features.minWidth, this.features.minHeight
+			);
+
+			this.resizeTo(clamp[2], clamp[3]);
+
+			mcWindows.cancelEvent(e);
+			break;
+
+		case "move":
+			this.left = mcWindows.mouseDownLayerX + (e.screenX - mcWindows.mouseDownScreenX);
+			this.top = mcWindows.mouseDownLayerY + (e.screenY - mcWindows.mouseDownScreenY);
+			this.updateClamping();
+
+			mcWindows.cancelEvent(e);
+			break;
+	}
+};
+
+TinyMCE_Window.prototype.moveTo = function (x, y) {
+	this.left = x;
+	this.top = y;
+
+	this.winElement.style.left = this.left + "px";
+	this.winElement.style.top = this.top + "px";
+};
+
+TinyMCE_Window.prototype.resizeTo = function (width, height) {
+	this.wrapperIFrameElement.style.width = (width+2) + 'px';
+	this.wrapperIFrameElement.style.height = (height+2) + 'px';
+	this.wrapperIFrameElement.width = width+2;
+	this.wrapperIFrameElement.height = height+2;
+	this.winElement.style.width = width + 'px';
+	this.winElement.style.height = height + 'px';
+
+	height = height - this.deltaHeight;
+
+	this.containerElement.style.width = width + 'px';
+	this.iframeElement.style.width = width + 'px';
+	this.iframeElement.style.height = height + 'px';
+	this.bodyElement.style.width = width + 'px';
+	this.bodyElement.style.height = height + 'px';
+	this.headElement.style.width = width + 'px';
+	//this.statusElement.style.width = width + 'px';
+};
+
+TinyMCE_Window.prototype.updateClamping = function () {
+	var clamp, oversize;
+
+	clamp = mcWindows.clampBoxPosition(
+		this.left, this.top,
+		this.winElement.scrollWidth,
+		this.winElement.scrollHeight,
+		this.features.minWidth, this.features.minHeight
+	);
+	oversize = (
+		clamp[2] != this.winElement.scrollWidth ||
+		clamp[3] != this.winElement.scrollHeight
+	) ? true : false;
+
+	this.moveTo(clamp[0], clamp[1]);
+	if (this.features.resizable == "yes" && oversize)
+		this.resizeTo(clamp[2], clamp[3]);
+};
+
+function debug(msg) {
+	document.getElementById('debug').value += msg + "\n";
+}
+
+TinyMCE_Window.prototype.onMouseUp = function(e) {
+	mcWindows.action = "none";
+};
+
+TinyMCE_Window.prototype.onFocus = function(e) {
+	// Gecko only handler
+	var winRef = e.currentTarget;
+
+	for (var n in mcWindows.windows) {
+		var win = mcWindows.windows[n];
+		if (typeof(win) == 'function')
+			continue;
+
+		if (winRef.name == win.id + "_iframe") {
+			win.focus();
+			return;
+		}
+	}
+};
+
+TinyMCE_Window.prototype.onMouseDown = function(e) {
+	var elm = mcWindows.isMSIE ? this.wrapperFrame.event.srcElement : e.target;
+
+	mcWindows.mouseDownScreenX = e.screenX;
+	mcWindows.mouseDownScreenY = e.screenY;
+	mcWindows.mouseDownLayerX = this.left;
+	mcWindows.mouseDownLayerY = this.top;
+	mcWindows.mouseDownWidth = parseInt(this.winElement.style.width);
+	mcWindows.mouseDownHeight = parseInt(this.winElement.style.height);
+
+	if (this.resizeElement != null && elm == this.resizeElement.firstChild)
+		this.startResize(e);
+	else
+		this.startMove(e);
+
+	mcWindows.cancelEvent(e);
+};
+
+// Global instance
+var mcWindows = new TinyMCE_Windows();
+
+// Initialize windows
+mcWindows.init({
+	images_path : tinyMCE.baseURL + "/plugins/inlinepopups/images",
+	css_file : tinyMCE.baseURL + "/plugins/inlinepopups/css/inlinepopup.css"
+});

Deleted: plog/trunk/js/tinymce/plugins/inlinepopups/images/spacer.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/inlinepopups/images/spacer.gif (from rev 7165, plog/trunk/js/tinymce/plugins/inlinepopups/images/spacer.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/inlinepopups/images/window_close.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/inlinepopups/images/window_close.gif (from rev 7165, plog/trunk/js/tinymce/plugins/inlinepopups/images/window_close.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/inlinepopups/images/window_maximize.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/inlinepopups/images/window_maximize.gif (from rev 7165, plog/trunk/js/tinymce/plugins/inlinepopups/images/window_maximize.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/inlinepopups/images/window_minimize.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/inlinepopups/images/window_minimize.gif (from rev 7165, plog/trunk/js/tinymce/plugins/inlinepopups/images/window_minimize.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/inlinepopups/images/window_resize.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/inlinepopups/images/window_resize.gif (from rev 7165, plog/trunk/js/tinymce/plugins/inlinepopups/images/window_resize.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/inlinepopups/jscripts/mcwindows.js
===================================================================
--- plog/trunk/js/tinymce/plugins/inlinepopups/jscripts/mcwindows.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/inlinepopups/jscripts/mcwindows.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,453 +0,0 @@
-/**
- * $Id: mcwindows.js 18 2006-06-29 14:11:23Z spocke $
- *
- * Moxiecode DHTML Windows script.
- *
- * @author Moxiecode
- * @copyright Copyright © 2004, Moxiecode Systems AB, All rights reserved.
- */
-
-// Windows handler
-function MCWindows() {
-	this.settings = new Array();
-	this.windows = new Array();
-	this.isMSIE = (navigator.appName == "Microsoft Internet Explorer");
-	this.isGecko = navigator.userAgent.indexOf('Gecko') != -1;
-	this.isSafari = navigator.userAgent.indexOf('Safari') != -1;
-	this.isMac = navigator.userAgent.indexOf('Mac') != -1;
-	this.isMSIE5_0 = this.isMSIE && (navigator.userAgent.indexOf('MSIE 5.0') != -1);
-	this.action = "none";
-	this.selectedWindow = null;
-	this.zindex = 100;
-	this.mouseDownScreenX = 0;
-	this.mouseDownScreenY = 0;
-	this.mouseDownLayerX = 0;
-	this.mouseDownLayerY = 0;
-	this.mouseDownWidth = 0;
-	this.mouseDownHeight = 0;
-};
-
-MCWindows.prototype.init = function(settings) {
-	this.settings = settings;
-
-	if (this.isMSIE)
-		this.addEvent(document, "mousemove", mcWindows.eventDispatcher);
-	else
-		this.addEvent(window, "mousemove", mcWindows.eventDispatcher);
-
-	this.addEvent(document, "mouseup", mcWindows.eventDispatcher);
-};
-
-MCWindows.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;
-};
-
-MCWindows.prototype.eventDispatcher = function(e) {
-	e = typeof(e) == "undefined" ? window.event : e;
-
-	if (mcWindows.selectedWindow == null)
-		return;
-
-	// Switch focus
-	if (mcWindows.isGecko && e.type == "mousedown") {
-		var elm = e.currentTarget;
-
-		for (var n in mcWindows.windows) {
-			var win = mcWindows.windows[n];
-			if (typeof(win) == 'function')
-				continue;
-
-			if (win.headElement == elm || win.resizeElement == elm) {
-				win.focus();
-				break;
-			}
-		}
-	}
-
-	switch (e.type) {
-		case "mousemove":
-			mcWindows.selectedWindow.onMouseMove(e);
-			break;
-
-		case "mouseup":
-			mcWindows.selectedWindow.onMouseUp(e);
-			break;
-
-		case "mousedown":
-			mcWindows.selectedWindow.onMouseDown(e);
-			break;
-
-		case "focus":
-			mcWindows.selectedWindow.onFocus(e);
-			break;
-	}
-}
-
-MCWindows.prototype.addEvent = function(obj, name, handler) {
-	if (this.isMSIE)
-		obj.attachEvent("on" + name, handler);
-	else
-		obj.addEventListener(name, handler, true);
-};
-
-MCWindows.prototype.cancelEvent = function(e) {
-	if (this.isMSIE) {
-		e.returnValue = false;
-		e.cancelBubble = true;
-	} else
-		e.preventDefault();
-};
-
-MCWindows.prototype.parseFeatures = function(opts) {
-	// Cleanup the options
-	opts = opts.toLowerCase();
-	opts = opts.replace(/;/g, ",");
-	opts = opts.replace(/[^0-9a-z=,]/g, "");
-
-	var optionChunks = opts.split(',');
-	var options = new Array();
-
-	options['left'] = 10;
-	options['top'] = 10;
-	options['width'] = 300;
-	options['height'] = 300;
-	options['resizable'] = true;
-	options['minimizable'] = true;
-	options['maximizable'] = true;
-	options['close'] = true;
-	options['movable'] = true;
-
-	if (opts == "")
-		return options;
-
-	for (var i=0; i<optionChunks.length; i++) {
-		var parts = optionChunks[i].split('=');
-
-		if (parts.length == 2)
-			options[parts[0]] = parts[1];
-	}
-
-	return options;
-};
-
-MCWindows.prototype.open = function(url, name, features) {
-	var win = new MCWindow();
-	var winDiv, html = "", id;
-
-	features = this.parseFeatures(features);
-
-	// Create div
-	id = "mcWindow_" + name;
-
-	width = parseInt(features['width']);
-	height = parseInt(features['height'])-12-19;
-
-	if (this.isMSIE)
-		width -= 2;
-
-	// Setup first part of window
-	win.id = id;
-	win.url = url;
-	win.name = name;
-	win.features = features;
-	this.windows[name] = win;
-
-	iframeWidth = width;
-	iframeHeight = height;
-
-	// Create inner content
-	html += '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">';
-	html += '<html>';
-	html += '<head>';
-	html += '<title>Wrapper iframe</title>';
-	html += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';
-	html += '<link href="../jscripts/tiny_mce/themes/advanced/css/editor_ui.css" rel="stylesheet" type="text/css" />';
-	html += '</head>';
-	html += '<body onload="parent.mcWindows.onLoad(\'' + name + '\');">';
-
-	html += '<div id="' + id + '_container" class="mceWindow">';
-	html += '<div id="' + id + '_head" class="mceWindowHead" onmousedown="parent.mcWindows.windows[\'' + name + '\'].focus();">';
-	html += '  <div id="' + id + '_title" class="mceWindowTitle"';
-	html += '  onselectstart="return false;" unselectable="on" style="-moz-user-select: none !important;">No name window</div>';
-	html += '    <div class="mceWindowHeadTools">';
-	html += '      <a href="javascript:parent.mcWindows.windows[\'' + name + '\'].close();" onmousedown="return false;" class="mceWindowClose"><img border="0" src="../jscripts/tiny_mce/themes/advanced/images/window_close.gif" /></a>';
-//	html += '      <a href="javascript:mcWindows.windows[\'' + name + '\'].maximize();" onmousedown="return false;" class="mceWindowMaximize"></a>';
-//	html += '      <a href="javascript:mcWindows.windows[\'' + name + '\'].minimize();" onmousedown="return false;" class="mceWindowMinimize"></a>';
-	html += '    </div>';
-	html += '</div><div id="' + id + '_body" class="mceWindowBody" style="width: ' + width + 'px; height: ' + height + 'px;">';
-	html += '<iframe id="' + id + '_iframe" name="' + id + '_iframe" onfocus="parent.mcWindows.windows[\'' + name + '\'].focus();" frameborder="0" width="' + iframeWidth + '" height="' + iframeHeight + '" src="' + url + '" class="mceWindowBodyIframe"></iframe></div>';
-	html += '<div id="' + id + '_statusbar" class="mceWindowStatusbar" onmousedown="parent.mcWindows.windows[\'' + name + '\'].focus();">';
-	html += '<div id="' + id + '_resize" class="mceWindowResize"><img onmousedown="parent.mcWindows.windows[\'' + name + '\'].focus();" border="0" src="../jscripts/tiny_mce/themes/advanced/images/window_resize.gif" /></div>';
-	html += '</div>';
-	html += '</div>';
-
-	html += '</body>';
-	html += '</html>';
-
-	// Create iframe
-	this.createFloatingIFrame(id, features['left'], features['top'], features['width'], features['height'], html);
-};
-
-// Gets called when wrapper iframe is initialized
-MCWindows.prototype.onLoad = function(name) {
-	var win = mcWindows.windows[name];
-	var id = "mcWindow_" + name;
-	var wrapperIframe = window.frames[id + "_iframe"].frames[0];
-	var wrapperDoc = window.frames[id + "_iframe"].document;
-	var doc = window.frames[id + "_iframe"].document;
-	var winDiv = document.getElementById("mcWindow_" + name + "_div");
-	var realIframe = window.frames[id + "_iframe"].frames[0];
-
-	// Set window data
-	win.id = "mcWindow_" + name + "_iframe";
-	win.winElement = winDiv;
-	win.bodyElement = doc.getElementById(id + '_body');
-	win.iframeElement = doc.getElementById(id + '_iframe');
-	win.headElement = doc.getElementById(id + '_head');
-	win.titleElement = doc.getElementById(id + '_title');
-	win.resizeElement = doc.getElementById(id + '_resize');
-	win.containerElement = doc.getElementById(id + '_container');
-	win.left = win.features['left'];
-	win.top = win.features['top'];
-	win.frame = window.frames[id + '_iframe'].frames[0];
-	win.wrapperFrame = window.frames[id + '_iframe'];
-	win.wrapperIFrameElement = document.getElementById(id + "_iframe");
-
-	// Add event handlers
-	mcWindows.addEvent(win.headElement, "mousedown", mcWindows.eventDispatcher);
-	mcWindows.addEvent(win.resizeElement, "mousedown", mcWindows.eventDispatcher);
-
-	if (mcWindows.isMSIE) {
-		mcWindows.addEvent(realIframe.document, "mousemove", mcWindows.eventDispatcher);
-		mcWindows.addEvent(realIframe.document, "mouseup", mcWindows.eventDispatcher);
-	} else {
-		mcWindows.addEvent(realIframe, "mousemove", mcWindows.eventDispatcher);
-		mcWindows.addEvent(realIframe, "mouseup", mcWindows.eventDispatcher);
-		mcWindows.addEvent(realIframe, "focus", mcWindows.eventDispatcher);
-	}
-
-	for (var i=0; i<window.frames.length; i++) {
-		if (!window.frames[i]._hasMouseHandlers) {
-			if (mcWindows.isMSIE) {
-				mcWindows.addEvent(window.frames[i].document, "mousemove", mcWindows.eventDispatcher);
-				mcWindows.addEvent(window.frames[i].document, "mouseup", mcWindows.eventDispatcher);
-			} else {
-				mcWindows.addEvent(window.frames[i], "mousemove", mcWindows.eventDispatcher);
-				mcWindows.addEvent(window.frames[i], "mouseup", mcWindows.eventDispatcher);
-			}
-
-			window.frames[i]._hasMouseHandlers = true;
-		}
-	}
-
-	if (mcWindows.isMSIE) {
-		mcWindows.addEvent(win.frame.document, "mousemove", mcWindows.eventDispatcher);
-		mcWindows.addEvent(win.frame.document, "mouseup", mcWindows.eventDispatcher);
-	} else {
-		mcWindows.addEvent(win.frame, "mousemove", mcWindows.eventDispatcher);
-		mcWindows.addEvent(win.frame, "mouseup", mcWindows.eventDispatcher);
-		mcWindows.addEvent(win.frame, "focus", mcWindows.eventDispatcher);
-	}
-
-	this.selectedWindow = win;
-};
-
-MCWindows.prototype.createFloatingIFrame = function(id_prefix, left, top, width, height, html) {
-	var iframe = document.createElement("iframe");
-	var div = document.createElement("div");
-
-	width = parseInt(width);
-	height = parseInt(height)+1;
-
-	// Create wrapper div
-	div.setAttribute("id", id_prefix + "_div");
-	div.setAttribute("width", width);
-	div.setAttribute("height", (height));
-	div.style.position = "absolute";
-	div.style.left = left + "px";
-	div.style.top = top + "px";
-	div.style.width = width + "px";
-	div.style.height = (height) + "px";
-	div.style.backgroundColor = "white";
-	div.style.display = "none";
-
-	if (this.isGecko) {
-		iframeWidth = width + 2;
-		iframeHeight = height + 2;
-	} else {
-		iframeWidth = width;
-		iframeHeight = height + 1;
-	}
-
-	// Create iframe
-	iframe.setAttribute("id", id_prefix + "_iframe");
-	iframe.setAttribute("name", id_prefix + "_iframe");
-	iframe.setAttribute("border", "0");
-	iframe.setAttribute("frameBorder", "0");
-	iframe.setAttribute("marginWidth", "0");
-	iframe.setAttribute("marginHeight", "0");
-	iframe.setAttribute("leftMargin", "0");
-	iframe.setAttribute("topMargin", "0");
-	iframe.setAttribute("width", iframeWidth);
-	iframe.setAttribute("height", iframeHeight);
-//	iframe.setAttribute("src", "../jscripts/tiny_mce/blank.htm");
-	// iframe.setAttribute("allowtransparency", "false");
-	iframe.setAttribute("scrolling", "no");
-	iframe.style.width = iframeWidth + "px";
-	iframe.style.height = iframeHeight + "px";
-	iframe.style.backgroundColor = "white";
-	div.appendChild(iframe);
-
-	document.body.appendChild(div);
-
-	// Fixed MSIE 5.0 issue
-	div.innerHTML = div.innerHTML;
-
-	if (this.isSafari) {
-		// Give Safari some time to setup
-		window.setTimeout(function() {
-			doc = window.frames[id_prefix + '_iframe'].document;
-			doc.open();
-			doc.write(html);
-			doc.close();
-		}, 10);
-	} else {
-		doc = window.frames[id_prefix + '_iframe'].window.document
-		doc.open();
-		doc.write(html);
-		doc.close();
-	}
-
-	div.style.display = "block";
-
-	return div;
-};
-
-// Window instance
-function MCWindow() {
-};
-
-MCWindow.prototype.focus = function() {
-	this.winElement.style.zIndex = mcWindows.zindex++;
-	mcWindows.selectedWindow = this;
-};
-
-MCWindow.prototype.minimize = function() {
-};
-
-MCWindow.prototype.maximize = function() {
-	
-};
-
-MCWindow.prototype.startResize = function() {
-	mcWindows.action = "resize";
-};
-
-MCWindow.prototype.startMove = function(e) {
-	mcWindows.action = "move";
-};
-
-MCWindow.prototype.close = function() {
-	document.body.removeChild(this.winElement);
-	mcWindows.windows[this.name] = null;
-};
-
-MCWindow.prototype.onMouseMove = function(e) {
-	var scrollX = 0;//this.doc.body.scrollLeft;
-	var scrollY = 0;//this.doc.body.scrollTop;
-
-	// Calculate real X, Y
-	var dx = e.screenX - mcWindows.mouseDownScreenX;
-	var dy = e.screenY - mcWindows.mouseDownScreenY;
-
-	switch (mcWindows.action) {
-		case "resize":
-			width = mcWindows.mouseDownWidth + (e.screenX - mcWindows.mouseDownScreenX);
-			height = mcWindows.mouseDownHeight + (e.screenY - mcWindows.mouseDownScreenY);
-
-			width = width < 100 ? 100 : width;
-			height = height < 100 ? 100 : height;
-
-			this.wrapperIFrameElement.style.width = width+2;
-			this.wrapperIFrameElement.style.height = height+2;
-			this.wrapperIFrameElement.width = width+2;
-			this.wrapperIFrameElement.height = height+2;
-			this.winElement.style.width = width;
-			this.winElement.style.height = height;
-
-			height = height-12-19;
-
-			this.containerElement.style.width = width;
-
-			this.iframeElement.style.width = width;
-			this.iframeElement.style.height = height;
-			this.bodyElement.style.width = width;
-			this.bodyElement.style.height = height;
-			this.headElement.style.width = width;
-			//this.statusElement.style.width = width;
-
-			mcWindows.cancelEvent(e);
-			break;
-
-		case "move":
-			this.left = mcWindows.mouseDownLayerX + (e.screenX - mcWindows.mouseDownScreenX);
-			this.top = mcWindows.mouseDownLayerY + (e.screenY - mcWindows.mouseDownScreenY);
-			this.winElement.style.left = this.left + "px";
-			this.winElement.style.top = this.top + "px";
-
-			mcWindows.cancelEvent(e);
-			break;
-	}
-};
-
-MCWindow.prototype.onMouseUp = function(e) {
-	mcWindows.action = "none";
-};
-
-MCWindow.prototype.onFocus = function(e) {
-	// Gecko only handler
-	var winRef = e.currentTarget;
-
-	for (var n in mcWindows.windows) {
-		var win = mcWindows.windows[n];
-		if (typeof(win) == 'function')
-			continue;
-
-		if (winRef.name == win.id) {
-			win.focus();
-			return;
-		}
-	}
-};
-
-MCWindow.prototype.onMouseDown = function(e) {
-	var elm = mcWindows.isMSIE ? this.wrapperFrame.event.srcElement : e.target;
-
-	var scrollX = 0;//this.doc.body.scrollLeft;
-	var scrollY = 0;//this.doc.body.scrollTop;
-
-	mcWindows.mouseDownScreenX = e.screenX;
-	mcWindows.mouseDownScreenY = e.screenY;
-	mcWindows.mouseDownLayerX = this.left;
-	mcWindows.mouseDownLayerY = this.top;
-	mcWindows.mouseDownWidth = parseInt(this.winElement.style.width);
-	mcWindows.mouseDownHeight = parseInt(this.winElement.style.height);
-
-	if (elm == this.resizeElement.firstChild)
-		this.startResize(e);
-	else
-		this.startMove(e);
-
-	mcWindows.cancelEvent(e);
-};
-
-// Global instance
-var mcWindows = new MCWindows();

Copied: plog/trunk/js/tinymce/plugins/inlinepopups/jscripts/mcwindows.js (from rev 7165, plog/trunk/js/tinymce/plugins/inlinepopups/jscripts/mcwindows.js)
===================================================================
--- plog/trunk/js/tinymce/plugins/inlinepopups/jscripts/mcwindows.js	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/inlinepopups/jscripts/mcwindows.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,453 @@
+/**
+ * $Id: mcwindows.js 18 2006-06-29 14:11:23Z spocke $
+ *
+ * Moxiecode DHTML Windows script.
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004, Moxiecode Systems AB, All rights reserved.
+ */
+
+// Windows handler
+function MCWindows() {
+	this.settings = new Array();
+	this.windows = new Array();
+	this.isMSIE = (navigator.appName == "Microsoft Internet Explorer");
+	this.isGecko = navigator.userAgent.indexOf('Gecko') != -1;
+	this.isSafari = navigator.userAgent.indexOf('Safari') != -1;
+	this.isMac = navigator.userAgent.indexOf('Mac') != -1;
+	this.isMSIE5_0 = this.isMSIE && (navigator.userAgent.indexOf('MSIE 5.0') != -1);
+	this.action = "none";
+	this.selectedWindow = null;
+	this.zindex = 100;
+	this.mouseDownScreenX = 0;
+	this.mouseDownScreenY = 0;
+	this.mouseDownLayerX = 0;
+	this.mouseDownLayerY = 0;
+	this.mouseDownWidth = 0;
+	this.mouseDownHeight = 0;
+};
+
+MCWindows.prototype.init = function(settings) {
+	this.settings = settings;
+
+	if (this.isMSIE)
+		this.addEvent(document, "mousemove", mcWindows.eventDispatcher);
+	else
+		this.addEvent(window, "mousemove", mcWindows.eventDispatcher);
+
+	this.addEvent(document, "mouseup", mcWindows.eventDispatcher);
+};
+
+MCWindows.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;
+};
+
+MCWindows.prototype.eventDispatcher = function(e) {
+	e = typeof(e) == "undefined" ? window.event : e;
+
+	if (mcWindows.selectedWindow == null)
+		return;
+
+	// Switch focus
+	if (mcWindows.isGecko && e.type == "mousedown") {
+		var elm = e.currentTarget;
+
+		for (var n in mcWindows.windows) {
+			var win = mcWindows.windows[n];
+			if (typeof(win) == 'function')
+				continue;
+
+			if (win.headElement == elm || win.resizeElement == elm) {
+				win.focus();
+				break;
+			}
+		}
+	}
+
+	switch (e.type) {
+		case "mousemove":
+			mcWindows.selectedWindow.onMouseMove(e);
+			break;
+
+		case "mouseup":
+			mcWindows.selectedWindow.onMouseUp(e);
+			break;
+
+		case "mousedown":
+			mcWindows.selectedWindow.onMouseDown(e);
+			break;
+
+		case "focus":
+			mcWindows.selectedWindow.onFocus(e);
+			break;
+	}
+}
+
+MCWindows.prototype.addEvent = function(obj, name, handler) {
+	if (this.isMSIE)
+		obj.attachEvent("on" + name, handler);
+	else
+		obj.addEventListener(name, handler, true);
+};
+
+MCWindows.prototype.cancelEvent = function(e) {
+	if (this.isMSIE) {
+		e.returnValue = false;
+		e.cancelBubble = true;
+	} else
+		e.preventDefault();
+};
+
+MCWindows.prototype.parseFeatures = function(opts) {
+	// Cleanup the options
+	opts = opts.toLowerCase();
+	opts = opts.replace(/;/g, ",");
+	opts = opts.replace(/[^0-9a-z=,]/g, "");
+
+	var optionChunks = opts.split(',');
+	var options = new Array();
+
+	options['left'] = 10;
+	options['top'] = 10;
+	options['width'] = 300;
+	options['height'] = 300;
+	options['resizable'] = true;
+	options['minimizable'] = true;
+	options['maximizable'] = true;
+	options['close'] = true;
+	options['movable'] = true;
+
+	if (opts == "")
+		return options;
+
+	for (var i=0; i<optionChunks.length; i++) {
+		var parts = optionChunks[i].split('=');
+
+		if (parts.length == 2)
+			options[parts[0]] = parts[1];
+	}
+
+	return options;
+};
+
+MCWindows.prototype.open = function(url, name, features) {
+	var win = new MCWindow();
+	var winDiv, html = "", id;
+
+	features = this.parseFeatures(features);
+
+	// Create div
+	id = "mcWindow_" + name;
+
+	width = parseInt(features['width']);
+	height = parseInt(features['height'])-12-19;
+
+	if (this.isMSIE)
+		width -= 2;
+
+	// Setup first part of window
+	win.id = id;
+	win.url = url;
+	win.name = name;
+	win.features = features;
+	this.windows[name] = win;
+
+	iframeWidth = width;
+	iframeHeight = height;
+
+	// Create inner content
+	html += '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">';
+	html += '<html>';
+	html += '<head>';
+	html += '<title>Wrapper iframe</title>';
+	html += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';
+	html += '<link href="../jscripts/tiny_mce/themes/advanced/css/editor_ui.css" rel="stylesheet" type="text/css" />';
+	html += '</head>';
+	html += '<body onload="parent.mcWindows.onLoad(\'' + name + '\');">';
+
+	html += '<div id="' + id + '_container" class="mceWindow">';
+	html += '<div id="' + id + '_head" class="mceWindowHead" onmousedown="parent.mcWindows.windows[\'' + name + '\'].focus();">';
+	html += '  <div id="' + id + '_title" class="mceWindowTitle"';
+	html += '  onselectstart="return false;" unselectable="on" style="-moz-user-select: none !important;">No name window</div>';
+	html += '    <div class="mceWindowHeadTools">';
+	html += '      <a href="javascript:parent.mcWindows.windows[\'' + name + '\'].close();" onmousedown="return false;" class="mceWindowClose"><img border="0" src="../jscripts/tiny_mce/themes/advanced/images/window_close.gif" /></a>';
+//	html += '      <a href="javascript:mcWindows.windows[\'' + name + '\'].maximize();" onmousedown="return false;" class="mceWindowMaximize"></a>';
+//	html += '      <a href="javascript:mcWindows.windows[\'' + name + '\'].minimize();" onmousedown="return false;" class="mceWindowMinimize"></a>';
+	html += '    </div>';
+	html += '</div><div id="' + id + '_body" class="mceWindowBody" style="width: ' + width + 'px; height: ' + height + 'px;">';
+	html += '<iframe id="' + id + '_iframe" name="' + id + '_iframe" onfocus="parent.mcWindows.windows[\'' + name + '\'].focus();" frameborder="0" width="' + iframeWidth + '" height="' + iframeHeight + '" src="' + url + '" class="mceWindowBodyIframe"></iframe></div>';
+	html += '<div id="' + id + '_statusbar" class="mceWindowStatusbar" onmousedown="parent.mcWindows.windows[\'' + name + '\'].focus();">';
+	html += '<div id="' + id + '_resize" class="mceWindowResize"><img onmousedown="parent.mcWindows.windows[\'' + name + '\'].focus();" border="0" src="../jscripts/tiny_mce/themes/advanced/images/window_resize.gif" /></div>';
+	html += '</div>';
+	html += '</div>';
+
+	html += '</body>';
+	html += '</html>';
+
+	// Create iframe
+	this.createFloatingIFrame(id, features['left'], features['top'], features['width'], features['height'], html);
+};
+
+// Gets called when wrapper iframe is initialized
+MCWindows.prototype.onLoad = function(name) {
+	var win = mcWindows.windows[name];
+	var id = "mcWindow_" + name;
+	var wrapperIframe = window.frames[id + "_iframe"].frames[0];
+	var wrapperDoc = window.frames[id + "_iframe"].document;
+	var doc = window.frames[id + "_iframe"].document;
+	var winDiv = document.getElementById("mcWindow_" + name + "_div");
+	var realIframe = window.frames[id + "_iframe"].frames[0];
+
+	// Set window data
+	win.id = "mcWindow_" + name + "_iframe";
+	win.winElement = winDiv;
+	win.bodyElement = doc.getElementById(id + '_body');
+	win.iframeElement = doc.getElementById(id + '_iframe');
+	win.headElement = doc.getElementById(id + '_head');
+	win.titleElement = doc.getElementById(id + '_title');
+	win.resizeElement = doc.getElementById(id + '_resize');
+	win.containerElement = doc.getElementById(id + '_container');
+	win.left = win.features['left'];
+	win.top = win.features['top'];
+	win.frame = window.frames[id + '_iframe'].frames[0];
+	win.wrapperFrame = window.frames[id + '_iframe'];
+	win.wrapperIFrameElement = document.getElementById(id + "_iframe");
+
+	// Add event handlers
+	mcWindows.addEvent(win.headElement, "mousedown", mcWindows.eventDispatcher);
+	mcWindows.addEvent(win.resizeElement, "mousedown", mcWindows.eventDispatcher);
+
+	if (mcWindows.isMSIE) {
+		mcWindows.addEvent(realIframe.document, "mousemove", mcWindows.eventDispatcher);
+		mcWindows.addEvent(realIframe.document, "mouseup", mcWindows.eventDispatcher);
+	} else {
+		mcWindows.addEvent(realIframe, "mousemove", mcWindows.eventDispatcher);
+		mcWindows.addEvent(realIframe, "mouseup", mcWindows.eventDispatcher);
+		mcWindows.addEvent(realIframe, "focus", mcWindows.eventDispatcher);
+	}
+
+	for (var i=0; i<window.frames.length; i++) {
+		if (!window.frames[i]._hasMouseHandlers) {
+			if (mcWindows.isMSIE) {
+				mcWindows.addEvent(window.frames[i].document, "mousemove", mcWindows.eventDispatcher);
+				mcWindows.addEvent(window.frames[i].document, "mouseup", mcWindows.eventDispatcher);
+			} else {
+				mcWindows.addEvent(window.frames[i], "mousemove", mcWindows.eventDispatcher);
+				mcWindows.addEvent(window.frames[i], "mouseup", mcWindows.eventDispatcher);
+			}
+
+			window.frames[i]._hasMouseHandlers = true;
+		}
+	}
+
+	if (mcWindows.isMSIE) {
+		mcWindows.addEvent(win.frame.document, "mousemove", mcWindows.eventDispatcher);
+		mcWindows.addEvent(win.frame.document, "mouseup", mcWindows.eventDispatcher);
+	} else {
+		mcWindows.addEvent(win.frame, "mousemove", mcWindows.eventDispatcher);
+		mcWindows.addEvent(win.frame, "mouseup", mcWindows.eventDispatcher);
+		mcWindows.addEvent(win.frame, "focus", mcWindows.eventDispatcher);
+	}
+
+	this.selectedWindow = win;
+};
+
+MCWindows.prototype.createFloatingIFrame = function(id_prefix, left, top, width, height, html) {
+	var iframe = document.createElement("iframe");
+	var div = document.createElement("div");
+
+	width = parseInt(width);
+	height = parseInt(height)+1;
+
+	// Create wrapper div
+	div.setAttribute("id", id_prefix + "_div");
+	div.setAttribute("width", width);
+	div.setAttribute("height", (height));
+	div.style.position = "absolute";
+	div.style.left = left + "px";
+	div.style.top = top + "px";
+	div.style.width = width + "px";
+	div.style.height = (height) + "px";
+	div.style.backgroundColor = "white";
+	div.style.display = "none";
+
+	if (this.isGecko) {
+		iframeWidth = width + 2;
+		iframeHeight = height + 2;
+	} else {
+		iframeWidth = width;
+		iframeHeight = height + 1;
+	}
+
+	// Create iframe
+	iframe.setAttribute("id", id_prefix + "_iframe");
+	iframe.setAttribute("name", id_prefix + "_iframe");
+	iframe.setAttribute("border", "0");
+	iframe.setAttribute("frameBorder", "0");
+	iframe.setAttribute("marginWidth", "0");
+	iframe.setAttribute("marginHeight", "0");
+	iframe.setAttribute("leftMargin", "0");
+	iframe.setAttribute("topMargin", "0");
+	iframe.setAttribute("width", iframeWidth);
+	iframe.setAttribute("height", iframeHeight);
+//	iframe.setAttribute("src", "../jscripts/tiny_mce/blank.htm");
+	// iframe.setAttribute("allowtransparency", "false");
+	iframe.setAttribute("scrolling", "no");
+	iframe.style.width = iframeWidth + "px";
+	iframe.style.height = iframeHeight + "px";
+	iframe.style.backgroundColor = "white";
+	div.appendChild(iframe);
+
+	document.body.appendChild(div);
+
+	// Fixed MSIE 5.0 issue
+	div.innerHTML = div.innerHTML;
+
+	if (this.isSafari) {
+		// Give Safari some time to setup
+		window.setTimeout(function() {
+			doc = window.frames[id_prefix + '_iframe'].document;
+			doc.open();
+			doc.write(html);
+			doc.close();
+		}, 10);
+	} else {
+		doc = window.frames[id_prefix + '_iframe'].window.document
+		doc.open();
+		doc.write(html);
+		doc.close();
+	}
+
+	div.style.display = "block";
+
+	return div;
+};
+
+// Window instance
+function MCWindow() {
+};
+
+MCWindow.prototype.focus = function() {
+	this.winElement.style.zIndex = mcWindows.zindex++;
+	mcWindows.selectedWindow = this;
+};
+
+MCWindow.prototype.minimize = function() {
+};
+
+MCWindow.prototype.maximize = function() {
+	
+};
+
+MCWindow.prototype.startResize = function() {
+	mcWindows.action = "resize";
+};
+
+MCWindow.prototype.startMove = function(e) {
+	mcWindows.action = "move";
+};
+
+MCWindow.prototype.close = function() {
+	document.body.removeChild(this.winElement);
+	mcWindows.windows[this.name] = null;
+};
+
+MCWindow.prototype.onMouseMove = function(e) {
+	var scrollX = 0;//this.doc.body.scrollLeft;
+	var scrollY = 0;//this.doc.body.scrollTop;
+
+	// Calculate real X, Y
+	var dx = e.screenX - mcWindows.mouseDownScreenX;
+	var dy = e.screenY - mcWindows.mouseDownScreenY;
+
+	switch (mcWindows.action) {
+		case "resize":
+			width = mcWindows.mouseDownWidth + (e.screenX - mcWindows.mouseDownScreenX);
+			height = mcWindows.mouseDownHeight + (e.screenY - mcWindows.mouseDownScreenY);
+
+			width = width < 100 ? 100 : width;
+			height = height < 100 ? 100 : height;
+
+			this.wrapperIFrameElement.style.width = width+2;
+			this.wrapperIFrameElement.style.height = height+2;
+			this.wrapperIFrameElement.width = width+2;
+			this.wrapperIFrameElement.height = height+2;
+			this.winElement.style.width = width;
+			this.winElement.style.height = height;
+
+			height = height-12-19;
+
+			this.containerElement.style.width = width;
+
+			this.iframeElement.style.width = width;
+			this.iframeElement.style.height = height;
+			this.bodyElement.style.width = width;
+			this.bodyElement.style.height = height;
+			this.headElement.style.width = width;
+			//this.statusElement.style.width = width;
+
+			mcWindows.cancelEvent(e);
+			break;
+
+		case "move":
+			this.left = mcWindows.mouseDownLayerX + (e.screenX - mcWindows.mouseDownScreenX);
+			this.top = mcWindows.mouseDownLayerY + (e.screenY - mcWindows.mouseDownScreenY);
+			this.winElement.style.left = this.left + "px";
+			this.winElement.style.top = this.top + "px";
+
+			mcWindows.cancelEvent(e);
+			break;
+	}
+};
+
+MCWindow.prototype.onMouseUp = function(e) {
+	mcWindows.action = "none";
+};
+
+MCWindow.prototype.onFocus = function(e) {
+	// Gecko only handler
+	var winRef = e.currentTarget;
+
+	for (var n in mcWindows.windows) {
+		var win = mcWindows.windows[n];
+		if (typeof(win) == 'function')
+			continue;
+
+		if (winRef.name == win.id) {
+			win.focus();
+			return;
+		}
+	}
+};
+
+MCWindow.prototype.onMouseDown = function(e) {
+	var elm = mcWindows.isMSIE ? this.wrapperFrame.event.srcElement : e.target;
+
+	var scrollX = 0;//this.doc.body.scrollLeft;
+	var scrollY = 0;//this.doc.body.scrollTop;
+
+	mcWindows.mouseDownScreenX = e.screenX;
+	mcWindows.mouseDownScreenY = e.screenY;
+	mcWindows.mouseDownLayerX = this.left;
+	mcWindows.mouseDownLayerY = this.top;
+	mcWindows.mouseDownWidth = parseInt(this.winElement.style.width);
+	mcWindows.mouseDownHeight = parseInt(this.winElement.style.height);
+
+	if (elm == this.resizeElement.firstChild)
+		this.startResize(e);
+	else
+		this.startMove(e);
+
+	mcWindows.cancelEvent(e);
+};
+
+// Global instance
+var mcWindows = new MCWindows();

Deleted: plog/trunk/js/tinymce/plugins/inlinepopups/langs/en.js
===================================================================
Copied: plog/trunk/js/tinymce/plugins/inlinepopups/langs/en.js (from rev 7165, plog/trunk/js/tinymce/plugins/inlinepopups/langs/en.js)
===================================================================
Deleted: plog/trunk/js/tinymce/plugins/inlinepopups/readme.txt
===================================================================
Copied: plog/trunk/js/tinymce/plugins/inlinepopups/readme.txt (from rev 7165, plog/trunk/js/tinymce/plugins/inlinepopups/readme.txt)
===================================================================
Deleted: plog/trunk/js/tinymce/plugins/insertdatetime/editor_plugin.js
===================================================================
--- plog/trunk/js/tinymce/plugins/insertdatetime/editor_plugin.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/insertdatetime/editor_plugin.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1 +0,0 @@
-tinyMCE.importPluginLanguagePack('insertdatetime');var TinyMCE_InsertDateTimePlugin={getInfo:function(){return{longname:'Insert date/time',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},getControlHTML:function(cn){switch(cn){case"insertdate":return tinyMCE.getButtonHTML(cn,'lang_insertdate_desc','{$pluginurl}/images/insertdate.gif','mceInsertDate');case"inserttime":return tinyMCE.getButtonHTML(cn,'lang_inserttime_desc','{$pluginurl}/images/inserttime.gif','mceInsertTime')}return""},execCommand:function(editor_id,element,command,user_interface,value){function addZeros(value,len){value=""+value;if(value.length<len){for(var i=0;i<(len-value.length);i++)value="0"+value}return value}function getDateTime(d,fmt){fmt=fmt.replace("%D","%m/%d/%y");fmt=fmt.replace("%r","%I:%M:%S %p");fmt=fmt.replace("%Y",""+d.getFullYear());fmt=fmt
 .replace("%y",""+d.getYear());fmt=fmt.replace("%m",addZeros(d.getMonth()+1,2));fmt=fmt.replace("%d",addZeros(d.getDate(),2));fmt=fmt.replace("%H",""+addZeros(d.getHours(),2));fmt=fmt.replace("%M",""+addZeros(d.getMinutes(),2));fmt=fmt.replace("%S",""+addZeros(d.getSeconds(),2));fmt=fmt.replace("%I",""+((d.getHours()+11)%12+1));fmt=fmt.replace("%p",""+(d.getHours()<12?"AM":"PM"));fmt=fmt.replace("%B",""+tinyMCE.getLang("lang_inserttime_months_long")[d.getMonth()]);fmt=fmt.replace("%b",""+tinyMCE.getLang("lang_inserttime_months_short")[d.getMonth()]);fmt=fmt.replace("%A",""+tinyMCE.getLang("lang_inserttime_day_long")[d.getDay()]);fmt=fmt.replace("%a",""+tinyMCE.getLang("lang_inserttime_day_short")[d.getDay()]);fmt=fmt.replace("%%","%");return fmt}switch(command){case"mceInsertDate":tinyMCE.execInstanceCommand(editor_id,'mceInsertContent',false,getDateTime(new Date(),tinyMCE.getParam("plugin_insertdate_dateFormat",tinyMCE.getLang('lang_insertdate_def_fmt'))));return true;case"m
 ceInsertTime":tinyMCE.execInstanceCommand(editor_id,'mceInsertContent',false,getDateTime(new Date(),tinyMCE.getParam("plugin_insertdate_timeFormat",tinyMCE.getLang('lang_inserttime_def_fmt'))));return true}return false}};tinyMCE.addPlugin("insertdatetime",TinyMCE_InsertDateTimePlugin);
\ No newline at end of file

Copied: plog/trunk/js/tinymce/plugins/insertdatetime/editor_plugin.js (from rev 7165, plog/trunk/js/tinymce/plugins/insertdatetime/editor_plugin.js)
===================================================================
--- plog/trunk/js/tinymce/plugins/insertdatetime/editor_plugin.js	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/insertdatetime/editor_plugin.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1 @@
+tinyMCE.importPluginLanguagePack('insertdatetime');var TinyMCE_InsertDateTimePlugin={getInfo:function(){return{longname:'Insert date/time',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},getControlHTML:function(cn){switch(cn){case"insertdate":return tinyMCE.getButtonHTML(cn,'lang_insertdate_desc','{$pluginurl}/images/insertdate.gif','mceInsertDate');case"inserttime":return tinyMCE.getButtonHTML(cn,'lang_inserttime_desc','{$pluginurl}/images/inserttime.gif','mceInsertTime')}return""},execCommand:function(editor_id,element,command,user_interface,value){function addZeros(value,len){value=""+value;if(value.length<len){for(var i=0;i<(len-value.length);i++)value="0"+value}return value}function getDateTime(d,fmt){fmt=fmt.replace("%D","%m/%d/%y");fmt=fmt.replace("%r","%I:%M:%S %p");fmt=fmt.replace("%Y",""+d.getFullYear());fmt=fmt
 .replace("%y",""+d.getYear());fmt=fmt.replace("%m",addZeros(d.getMonth()+1,2));fmt=fmt.replace("%d",addZeros(d.getDate(),2));fmt=fmt.replace("%H",""+addZeros(d.getHours(),2));fmt=fmt.replace("%M",""+addZeros(d.getMinutes(),2));fmt=fmt.replace("%S",""+addZeros(d.getSeconds(),2));fmt=fmt.replace("%I",""+((d.getHours()+11)%12+1));fmt=fmt.replace("%p",""+(d.getHours()<12?"AM":"PM"));fmt=fmt.replace("%B",""+tinyMCE.getLang("lang_inserttime_months_long")[d.getMonth()]);fmt=fmt.replace("%b",""+tinyMCE.getLang("lang_inserttime_months_short")[d.getMonth()]);fmt=fmt.replace("%A",""+tinyMCE.getLang("lang_inserttime_day_long")[d.getDay()]);fmt=fmt.replace("%a",""+tinyMCE.getLang("lang_inserttime_day_short")[d.getDay()]);fmt=fmt.replace("%%","%");return fmt}switch(command){case"mceInsertDate":tinyMCE.execInstanceCommand(editor_id,'mceInsertContent',false,getDateTime(new Date(),tinyMCE.getParam("plugin_insertdate_dateFormat",tinyMCE.getLang('lang_insertdate_def_fmt'))));return true;case"m
 ceInsertTime":tinyMCE.execInstanceCommand(editor_id,'mceInsertContent',false,getDateTime(new Date(),tinyMCE.getParam("plugin_insertdate_timeFormat",tinyMCE.getLang('lang_inserttime_def_fmt'))));return true}return false}};tinyMCE.addPlugin("insertdatetime",TinyMCE_InsertDateTimePlugin);
\ No newline at end of file

Deleted: plog/trunk/js/tinymce/plugins/insertdatetime/editor_plugin_src.js
===================================================================
--- plog/trunk/js/tinymce/plugins/insertdatetime/editor_plugin_src.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/insertdatetime/editor_plugin_src.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,90 +0,0 @@
-/**
- * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
- *
- * @author Moxiecode
- * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
- */
-
-/* Import plugin specific language pack */
-tinyMCE.importPluginLanguagePack('insertdatetime');
-
-var TinyMCE_InsertDateTimePlugin = {
-	getInfo : function() {
-		return {
-			longname : 'Insert date/time',
-			author : 'Moxiecode Systems AB',
-			authorurl : 'http://tinymce.moxiecode.com',
-			infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime',
-			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
-		};
-	},
-
-	/**
-	 * Returns the HTML contents of the insertdate, inserttime controls.
-	 */
-	getControlHTML : function(cn) {
-		switch (cn) {
-			case "insertdate":
-				return tinyMCE.getButtonHTML(cn, 'lang_insertdate_desc', '{$pluginurl}/images/insertdate.gif', 'mceInsertDate');
-
-			case "inserttime":
-				return tinyMCE.getButtonHTML(cn, 'lang_inserttime_desc', '{$pluginurl}/images/inserttime.gif', 'mceInsertTime');
-		}
-
-		return "";
-	},
-
-	/**
-	 * Executes the mceInsertDate command.
-	 */
-	execCommand : function(editor_id, element, command, user_interface, value) {
-		/* Adds zeros infront of value */
-		function addZeros(value, len) {
-			value = "" + value;
-
-			if (value.length < len) {
-				for (var i=0; i<(len-value.length); i++)
-					value = "0" + value;
-			}
-
-			return value;
-		}
-
-		function getDateTime(d, fmt) {
-			fmt = fmt.replace("%D", "%m/%d/%y");
-			fmt = fmt.replace("%r", "%I:%M:%S %p");
-			fmt = fmt.replace("%Y", "" + d.getFullYear());
-			fmt = fmt.replace("%y", "" + d.getYear());
-			fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2));
-			fmt = fmt.replace("%d", addZeros(d.getDate(), 2));
-			fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2));
-			fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2));
-			fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));
-			fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));
-			fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));
-			fmt = fmt.replace("%B", "" + tinyMCE.getLang("lang_inserttime_months_long")[d.getMonth()]);
-			fmt = fmt.replace("%b", "" + tinyMCE.getLang("lang_inserttime_months_short")[d.getMonth()]);
-			fmt = fmt.replace("%A", "" + tinyMCE.getLang("lang_inserttime_day_long")[d.getDay()]);
-			fmt = fmt.replace("%a", "" + tinyMCE.getLang("lang_inserttime_day_short")[d.getDay()]);
-			fmt = fmt.replace("%%", "%");
-
-			return fmt;
-		}
-
-		// Handle commands
-		switch (command) {
-			case "mceInsertDate":
-				tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false, getDateTime(new Date(), tinyMCE.getParam("plugin_insertdate_dateFormat", tinyMCE.getLang('lang_insertdate_def_fmt'))));
-				return true;
-
-			case "mceInsertTime":
-				tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false, getDateTime(new Date(), tinyMCE.getParam("plugin_insertdate_timeFormat", tinyMCE.getLang('lang_inserttime_def_fmt'))));
-				return true;
-		}
-
-		// Pass to next handler in chain
-		return false;
-	}
-};
-
-tinyMCE.addPlugin("insertdatetime", TinyMCE_InsertDateTimePlugin);

Copied: plog/trunk/js/tinymce/plugins/insertdatetime/editor_plugin_src.js (from rev 7165, plog/trunk/js/tinymce/plugins/insertdatetime/editor_plugin_src.js)
===================================================================
--- plog/trunk/js/tinymce/plugins/insertdatetime/editor_plugin_src.js	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/insertdatetime/editor_plugin_src.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,90 @@
+/**
+ * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
+ */
+
+/* Import plugin specific language pack */
+tinyMCE.importPluginLanguagePack('insertdatetime');
+
+var TinyMCE_InsertDateTimePlugin = {
+	getInfo : function() {
+		return {
+			longname : 'Insert date/time',
+			author : 'Moxiecode Systems AB',
+			authorurl : 'http://tinymce.moxiecode.com',
+			infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime',
+			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+		};
+	},
+
+	/**
+	 * Returns the HTML contents of the insertdate, inserttime controls.
+	 */
+	getControlHTML : function(cn) {
+		switch (cn) {
+			case "insertdate":
+				return tinyMCE.getButtonHTML(cn, 'lang_insertdate_desc', '{$pluginurl}/images/insertdate.gif', 'mceInsertDate');
+
+			case "inserttime":
+				return tinyMCE.getButtonHTML(cn, 'lang_inserttime_desc', '{$pluginurl}/images/inserttime.gif', 'mceInsertTime');
+		}
+
+		return "";
+	},
+
+	/**
+	 * Executes the mceInsertDate command.
+	 */
+	execCommand : function(editor_id, element, command, user_interface, value) {
+		/* Adds zeros infront of value */
+		function addZeros(value, len) {
+			value = "" + value;
+
+			if (value.length < len) {
+				for (var i=0; i<(len-value.length); i++)
+					value = "0" + value;
+			}
+
+			return value;
+		}
+
+		function getDateTime(d, fmt) {
+			fmt = fmt.replace("%D", "%m/%d/%y");
+			fmt = fmt.replace("%r", "%I:%M:%S %p");
+			fmt = fmt.replace("%Y", "" + d.getFullYear());
+			fmt = fmt.replace("%y", "" + d.getYear());
+			fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2));
+			fmt = fmt.replace("%d", addZeros(d.getDate(), 2));
+			fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2));
+			fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2));
+			fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));
+			fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));
+			fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));
+			fmt = fmt.replace("%B", "" + tinyMCE.getLang("lang_inserttime_months_long")[d.getMonth()]);
+			fmt = fmt.replace("%b", "" + tinyMCE.getLang("lang_inserttime_months_short")[d.getMonth()]);
+			fmt = fmt.replace("%A", "" + tinyMCE.getLang("lang_inserttime_day_long")[d.getDay()]);
+			fmt = fmt.replace("%a", "" + tinyMCE.getLang("lang_inserttime_day_short")[d.getDay()]);
+			fmt = fmt.replace("%%", "%");
+
+			return fmt;
+		}
+
+		// Handle commands
+		switch (command) {
+			case "mceInsertDate":
+				tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false, getDateTime(new Date(), tinyMCE.getParam("plugin_insertdate_dateFormat", tinyMCE.getLang('lang_insertdate_def_fmt'))));
+				return true;
+
+			case "mceInsertTime":
+				tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false, getDateTime(new Date(), tinyMCE.getParam("plugin_insertdate_timeFormat", tinyMCE.getLang('lang_inserttime_def_fmt'))));
+				return true;
+		}
+
+		// Pass to next handler in chain
+		return false;
+	}
+};
+
+tinyMCE.addPlugin("insertdatetime", TinyMCE_InsertDateTimePlugin);

Deleted: plog/trunk/js/tinymce/plugins/insertdatetime/images/insertdate.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/insertdatetime/images/insertdate.gif (from rev 7165, plog/trunk/js/tinymce/plugins/insertdatetime/images/insertdate.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/insertdatetime/images/inserttime.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/insertdatetime/images/inserttime.gif (from rev 7165, plog/trunk/js/tinymce/plugins/insertdatetime/images/inserttime.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/insertdatetime/langs/en.js
===================================================================
--- plog/trunk/js/tinymce/plugins/insertdatetime/langs/en.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/insertdatetime/langs/en.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,12 +0,0 @@
-// UK lang variables
-
-tinyMCE.addToLang('',{
-insertdate_def_fmt : '%Y-%m-%d',
-inserttime_def_fmt : '%H:%M:%S',
-insertdate_desc : 'Insert date',
-inserttime_desc : 'Insert time',
-inserttime_months_long : new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"),
-inserttime_months_short : new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"),
-inserttime_day_long : new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"),
-inserttime_day_short : new Array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun")
-});

Copied: plog/trunk/js/tinymce/plugins/insertdatetime/langs/en.js (from rev 7165, plog/trunk/js/tinymce/plugins/insertdatetime/langs/en.js)
===================================================================
--- plog/trunk/js/tinymce/plugins/insertdatetime/langs/en.js	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/insertdatetime/langs/en.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,12 @@
+// UK lang variables
+
+tinyMCE.addToLang('',{
+insertdate_def_fmt : '%Y-%m-%d',
+inserttime_def_fmt : '%H:%M:%S',
+insertdate_desc : 'Insert date',
+inserttime_desc : 'Insert time',
+inserttime_months_long : new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"),
+inserttime_months_short : new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"),
+inserttime_day_long : new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"),
+inserttime_day_short : new Array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun")
+});

Deleted: plog/trunk/js/tinymce/plugins/insertdatetime/readme.txt
===================================================================
--- plog/trunk/js/tinymce/plugins/insertdatetime/readme.txt	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/insertdatetime/readme.txt	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1 +0,0 @@
-Check the TinyMCE documentation for details on this plugin.

Copied: plog/trunk/js/tinymce/plugins/insertdatetime/readme.txt (from rev 7165, plog/trunk/js/tinymce/plugins/insertdatetime/readme.txt)
===================================================================
--- plog/trunk/js/tinymce/plugins/insertdatetime/readme.txt	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/insertdatetime/readme.txt	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1 @@
+Check the TinyMCE documentation for details on this plugin.

Modified: plog/trunk/js/tinymce/plugins/insertresource/editor_plugin.js
===================================================================
--- plog/trunk/js/tinymce/plugins/insertresource/editor_plugin.js	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/js/tinymce/plugins/insertresource/editor_plugin.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -140,7 +140,7 @@
 					attribs = TinyMCE_insertresourcePlugin._parseAttributes( objectTag );
 					
 					var cssClass = "";					
-					if( !attribs || attribs["value"] == undefined || attribs["class"] != "ltPlayer" ) {
+					if( attribs["value"] == undefined || attribs["class"] != "ltPlayer" ) {
 						startPos++;
 						continue;
 					}
@@ -183,7 +183,7 @@
 					var attribs = TinyMCE_insertresourcePlugin._parseAttributes(content.substring(startPos + 4, endPos));
 
 					// If not flash, skip it
-					if (!attribs || attribs['class'] != "ltFlashPlayer" )
+					if (attribs['class'] != "ltFlashPlayer" )
 						continue;					
 
 					type = attribs['class'];

Modified: plog/trunk/js/tinymce/plugins/insertvideo/editor_plugin.js
===================================================================
--- plog/trunk/js/tinymce/plugins/insertvideo/editor_plugin.js	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/js/tinymce/plugins/insertvideo/editor_plugin.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -115,7 +115,7 @@
 					attribs = TinyMCE_insertvideoPlugin._parseAttributes( objectTag );
 					
 					var cssClass = "";					
-					if( !attribs || attribs["data"] == undefined ) {
+					if( attribs["data"] == undefined ) {
 						startPos++;
 						continue;
 					}
@@ -176,7 +176,7 @@
 					var attribs = TinyMCE_insertvideoPlugin._parseAttributes(content.substring(startPos + 4, endPos));
 
 					// Is not flash, skip it
-					if (!attribs || attribs['class'] != "ltVideoYouTube" && attribs['class'] != "ltVideoGoogleVideo" && attribs['class'] != "ltVideoMetacafe" && attribs['class'] != "ltVideoIfilm" && attribs['class'] != "ltVideoGoear" && attribs['class'] != "ltVideoGrouper" && attribs['class'] != "ltVideoDailymot" && attribs['class'] != "ltVideoVimeo")
+					if (attribs['class'] != "ltVideoYouTube" && attribs['class'] != "ltVideoGoogleVideo" && attribs['class'] != "ltVideoMetacafe" && attribs['class'] != "ltVideoIfilm" && attribs['class'] != "ltVideoGoear" && attribs['class'] != "ltVideoGrouper" && attribs['class'] != "ltVideoDailymot" && attribs['class'] != "ltVideoVimeo")
 						continue;
 
 					type = attribs['class'];

Modified: plog/trunk/js/tinymce/plugins/more/editor_plugin.js
===================================================================
--- plog/trunk/js/tinymce/plugins/more/editor_plugin.js	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/js/tinymce/plugins/more/editor_plugin.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -166,7 +166,7 @@
 				var attribs = this._parseAttributes(
                     content.substring(startPos + 4, endPos));
 
-				if (attribs && attribs['class'] == "mce_plugin_more_more") {
+				if (attribs['class'] == "mce_plugin_more_more") {
                     endPos += 2;
 	
                         // Insert embed/object chunk

Copied: plog/trunk/js/tinymce/plugins/readme.txt (from rev 7165, plog/trunk/js/tinymce/plugins/readme.txt)
===================================================================
--- plog/trunk/js/tinymce/plugins/readme.txt	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/readme.txt	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1 @@
+This is the location you place TinyMCE plugins.

Deleted: plog/trunk/js/tinymce/plugins/table/cell.htm
===================================================================
--- plog/trunk/js/tinymce/plugins/table/cell.htm	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/table/cell.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,182 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-	<title>{$lang_table_cell_title}</title>
-	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
-	<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
-	<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
-	<script language="javascript" type="text/javascript" src="jscripts/cell.js"></script>
-	<link href="css/cell.css" rel="stylesheet" type="text/css" />
-	<base target="_self" />
-</head>
-<body id="tablecell" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
-	<form onsubmit="updateAction();return false;" action="#">
-		<div class="tabs">
-			<ul>
-				<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_table_general_tab}</a></span></li>
-				<li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{$lang_table_advanced_tab}</a></span></li>
-			</ul>
-		</div>
-
-		<div class="panel_wrapper">
-			<div id="general_panel" class="panel current">
-				<fieldset>
-					<legend>{$lang_table_general_props}</legend>
-
-					<table border="0" cellpadding="4" cellspacing="0">
-						<tr>
-							<td><label for="align">{$lang_table_align}</label></td>
-							<td>
-								<select id="align" name="align">
-									<option value="">{$lang_not_set}</option>
-									<option value="center">{$lang_table_align_middle}</option>
-									<option value="left">{$lang_table_align_left}</option>
-									<option value="right">{$lang_table_align_right}</option>
-								</select>
-							</td>
-		
-							<td><label for="celltype">{$lang_table_cell_type}</label></td>
-							<td>
-								<select id="celltype" name="celltype">
-									<option value="td">{$lang_table_td}</option>
-									<option value="th">{$lang_table_th}</option>
-								</select>
-							</td>
-						</tr>
-
-						<tr>
-							<td><label for="valign">{$lang_table_valign}</label></td>
-							<td>
-								<select id="valign" name="valign">
-									<option value="">{$lang_not_set}</option>
-									<option value="top">{$lang_table_align_top}</option>
-									<option value="middle">{$lang_table_align_middle}</option>
-									<option value="bottom">{$lang_table_align_bottom}</option>
-								</select>
-							</td>
-
-							<td><label for="scope">{$lang_table_scope}</label></td>
-							<td>
-								<select id="scope" name="scope">
-									<option value="">{$lang_not_set}</option>
-									<option value="col">{$lang_table_col}</option>
-									<option value="row">{$lang_table_row}</option>
-									<option value="rowgroup">{$lang_table_rowgroup}</option>
-									<option value="colgroup">{$lang_table_colgroup}</option>
-								</select>
-							</td>
-
-						</tr>
-
-						<tr>
-							<td><label for="width">{$lang_table_width}</label></td>
-							<td><input id="width" name="width" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
-
-							<td><label for="height">{$lang_table_height}</label></td>
-							<td><input id="height" name="height" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
-						</tr>
-
-						<tr id="styleSelectRow">
-							<td><label for="class">{$lang_class_name}</label></td>
-							<td colspan="3">
-								<select id="class" name="class">
-									<option value="" selected="selected">{$lang_not_set}</option>
-								</select>
-							</td>
-						</tr>
-					</table>
-				</fieldset>
-			</div>
-
-			<div id="advanced_panel" class="panel">
-				<fieldset>
-					<legend>{$lang_table_advanced_props}</legend>
-
-					<table border="0" cellpadding="0" cellspacing="4">
-						<tr>
-							<td class="column1"><label for="id">{$lang_table_id}</label></td> 
-							<td><input id="id" name="id" type="text" value="" style="width: 200px" /></td> 
-						</tr>
-
-						<tr>
-							<td><label for="style">{$lang_table_style}</label></td>
-							<td><input type="text" id="style" name="style" value="" style="width: 200px;" onchange="changedStyle();" /></td>
-						</tr>
-
-						<tr>
-							<td class="column1"><label for="dir">{$lang_table_langdir}</label></td> 
-							<td>
-								<select id="dir" name="dir" style="width: 200px"> 
-										<option value="">{$lang_not_set}</option> 
-										<option value="ltr">{$lang_table_ltr}</option> 
-										<option value="rtl">{$lang_table_rtl}</option> 
-								</select>
-							</td> 
-						</tr>
-
-						<tr>
-							<td class="column1"><label for="lang">{$lang_table_langcode}</label></td> 
-							<td>
-								<input id="lang" name="lang" type="text" value="" style="width: 200px" />
-							</td> 
-						</tr>
-
-						<tr>
-							<td class="column1"><label for="backgroundimage">{$lang_table_bgimage}</label></td> 
-							<td>
-								<table border="0" cellpadding="0" cellspacing="0">
-									<tr>
-										<td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td>
-										<td id="backgroundimagebrowsercontainer"> </td>
-									</tr>
-								</table>
-							</td> 
-						</tr>
-
-						<tr>
-							<td class="column1"><label for="bordercolor">{$lang_table_bordercolor}</label></td> 
-							<td>
-								<table border="0" cellpadding="0" cellspacing="0">
-									<tr>
-										<td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td>
-										<td id="bordercolor_pickcontainer"> </td>
-									</tr>
-								</table>
-							</td> 
-						</tr>
-
-						<tr>
-							<td class="column1"><label for="bgcolor">{$lang_table_bgcolor}</label></td> 
-							<td>
-								<table border="0" cellpadding="0" cellspacing="0">
-									<tr>
-										<td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
-										<td id="bgcolor_pickcontainer"> </td>
-									</tr>
-								</table>
-							</td> 
-						</tr>
-					</table>
-				</fieldset>
-			</div>
-		</div>
-
-		<div class="mceActionPanel">
-			<div>
-				<select id="action" name="action">
-					<option value="cell">{$lang_table_cell_cell}</option>
-					<option value="row">{$lang_table_cell_row}</option>
-					<option value="all">{$lang_table_cell_all}</option>
-				</select>
-			</div>
-
-			<div style="float: left">
-				<div><input type="button" id="insert" name="insert" value="{$lang_update}" onclick="updateAction();" /></div>
-			</div>
-
-			<div style="float: right">
-				<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
-			</div>
-		</div>
-	</form>
-</body>
-</html>

Copied: plog/trunk/js/tinymce/plugins/table/cell.htm (from rev 7165, plog/trunk/js/tinymce/plugins/table/cell.htm)
===================================================================
--- plog/trunk/js/tinymce/plugins/table/cell.htm	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/table/cell.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,182 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{$lang_table_cell_title}</title>
+	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
+	<script language="javascript" type="text/javascript" src="jscripts/cell.js"></script>
+	<link href="css/cell.css" rel="stylesheet" type="text/css" />
+	<base target="_self" />
+</head>
+<body id="tablecell" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
+	<form onsubmit="updateAction();return false;" action="#">
+		<div class="tabs">
+			<ul>
+				<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_table_general_tab}</a></span></li>
+				<li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{$lang_table_advanced_tab}</a></span></li>
+			</ul>
+		</div>
+
+		<div class="panel_wrapper">
+			<div id="general_panel" class="panel current">
+				<fieldset>
+					<legend>{$lang_table_general_props}</legend>
+
+					<table border="0" cellpadding="4" cellspacing="0">
+						<tr>
+							<td><label for="align">{$lang_table_align}</label></td>
+							<td>
+								<select id="align" name="align">
+									<option value="">{$lang_not_set}</option>
+									<option value="center">{$lang_table_align_middle}</option>
+									<option value="left">{$lang_table_align_left}</option>
+									<option value="right">{$lang_table_align_right}</option>
+								</select>
+							</td>
+		
+							<td><label for="celltype">{$lang_table_cell_type}</label></td>
+							<td>
+								<select id="celltype" name="celltype">
+									<option value="td">{$lang_table_td}</option>
+									<option value="th">{$lang_table_th}</option>
+								</select>
+							</td>
+						</tr>
+
+						<tr>
+							<td><label for="valign">{$lang_table_valign}</label></td>
+							<td>
+								<select id="valign" name="valign">
+									<option value="">{$lang_not_set}</option>
+									<option value="top">{$lang_table_align_top}</option>
+									<option value="middle">{$lang_table_align_middle}</option>
+									<option value="bottom">{$lang_table_align_bottom}</option>
+								</select>
+							</td>
+
+							<td><label for="scope">{$lang_table_scope}</label></td>
+							<td>
+								<select id="scope" name="scope">
+									<option value="">{$lang_not_set}</option>
+									<option value="col">{$lang_table_col}</option>
+									<option value="row">{$lang_table_row}</option>
+									<option value="rowgroup">{$lang_table_rowgroup}</option>
+									<option value="colgroup">{$lang_table_colgroup}</option>
+								</select>
+							</td>
+
+						</tr>
+
+						<tr>
+							<td><label for="width">{$lang_table_width}</label></td>
+							<td><input id="width" name="width" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
+
+							<td><label for="height">{$lang_table_height}</label></td>
+							<td><input id="height" name="height" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
+						</tr>
+
+						<tr id="styleSelectRow">
+							<td><label for="class">{$lang_class_name}</label></td>
+							<td colspan="3">
+								<select id="class" name="class">
+									<option value="" selected="selected">{$lang_not_set}</option>
+								</select>
+							</td>
+						</tr>
+					</table>
+				</fieldset>
+			</div>
+
+			<div id="advanced_panel" class="panel">
+				<fieldset>
+					<legend>{$lang_table_advanced_props}</legend>
+
+					<table border="0" cellpadding="0" cellspacing="4">
+						<tr>
+							<td class="column1"><label for="id">{$lang_table_id}</label></td> 
+							<td><input id="id" name="id" type="text" value="" style="width: 200px" /></td> 
+						</tr>
+
+						<tr>
+							<td><label for="style">{$lang_table_style}</label></td>
+							<td><input type="text" id="style" name="style" value="" style="width: 200px;" onchange="changedStyle();" /></td>
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="dir">{$lang_table_langdir}</label></td> 
+							<td>
+								<select id="dir" name="dir" style="width: 200px"> 
+										<option value="">{$lang_not_set}</option> 
+										<option value="ltr">{$lang_table_ltr}</option> 
+										<option value="rtl">{$lang_table_rtl}</option> 
+								</select>
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="lang">{$lang_table_langcode}</label></td> 
+							<td>
+								<input id="lang" name="lang" type="text" value="" style="width: 200px" />
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="backgroundimage">{$lang_table_bgimage}</label></td> 
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td>
+										<td id="backgroundimagebrowsercontainer"> </td>
+									</tr>
+								</table>
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="bordercolor">{$lang_table_bordercolor}</label></td> 
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td>
+										<td id="bordercolor_pickcontainer"> </td>
+									</tr>
+								</table>
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="bgcolor">{$lang_table_bgcolor}</label></td> 
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
+										<td id="bgcolor_pickcontainer"> </td>
+									</tr>
+								</table>
+							</td> 
+						</tr>
+					</table>
+				</fieldset>
+			</div>
+		</div>
+
+		<div class="mceActionPanel">
+			<div>
+				<select id="action" name="action">
+					<option value="cell">{$lang_table_cell_cell}</option>
+					<option value="row">{$lang_table_cell_row}</option>
+					<option value="all">{$lang_table_cell_all}</option>
+				</select>
+			</div>
+
+			<div style="float: left">
+				<div><input type="button" id="insert" name="insert" value="{$lang_update}" onclick="updateAction();" /></div>
+			</div>
+
+			<div style="float: right">
+				<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
+			</div>
+		</div>
+	</form>
+</body>
+</html>

Deleted: plog/trunk/js/tinymce/plugins/table/css/cell.css
===================================================================
--- plog/trunk/js/tinymce/plugins/table/css/cell.css	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/table/css/cell.css	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,17 +0,0 @@
-/* CSS file for cell dialog in the table plugin */
-
-.panel_wrapper div.current {
-	height: 200px;
-}
-
-.advfield {
-	width: 200px;
-}
-
-#action {
-	margin-bottom: 3px;
-}
-
-#class {
-	width: 150px;
-}
\ No newline at end of file

Copied: plog/trunk/js/tinymce/plugins/table/css/cell.css (from rev 7165, plog/trunk/js/tinymce/plugins/table/css/cell.css)
===================================================================
--- plog/trunk/js/tinymce/plugins/table/css/cell.css	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/table/css/cell.css	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,17 @@
+/* CSS file for cell dialog in the table plugin */
+
+.panel_wrapper div.current {
+	height: 200px;
+}
+
+.advfield {
+	width: 200px;
+}
+
+#action {
+	margin-bottom: 3px;
+}
+
+#class {
+	width: 150px;
+}
\ No newline at end of file

Deleted: plog/trunk/js/tinymce/plugins/table/css/row.css
===================================================================
--- plog/trunk/js/tinymce/plugins/table/css/row.css	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/table/css/row.css	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,25 +0,0 @@
-/* CSS file for row dialog in the table plugin */
-
-.panel_wrapper div.current {
-	height: 200px;
-}
-
-.advfield {
-	width: 200px;
-}
-
-#action {
-	margin-bottom: 3px;
-}
-
-#rowtype,#align,#valign,#class,#height {
-	width: 150px;
-}
-
-#height {
-	width: 50px;	
-}
-
-.col2 {
-	padding-left: 20px;
-}

Copied: plog/trunk/js/tinymce/plugins/table/css/row.css (from rev 7165, plog/trunk/js/tinymce/plugins/table/css/row.css)
===================================================================
--- plog/trunk/js/tinymce/plugins/table/css/row.css	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/table/css/row.css	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,25 @@
+/* CSS file for row dialog in the table plugin */
+
+.panel_wrapper div.current {
+	height: 200px;
+}
+
+.advfield {
+	width: 200px;
+}
+
+#action {
+	margin-bottom: 3px;
+}
+
+#rowtype,#align,#valign,#class,#height {
+	width: 150px;
+}
+
+#height {
+	width: 50px;	
+}
+
+.col2 {
+	padding-left: 20px;
+}

Deleted: plog/trunk/js/tinymce/plugins/table/css/table.css
===================================================================
--- plog/trunk/js/tinymce/plugins/table/css/table.css	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/table/css/table.css	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,13 +0,0 @@
-/* CSS file for table dialog in the table plugin */
-
-.panel_wrapper div.current {
-	height: 220px;
-}
-
-.advfield {
-	width: 200px;
-}
-
-#class {
-	width: 150px;
-}

Copied: plog/trunk/js/tinymce/plugins/table/css/table.css (from rev 7165, plog/trunk/js/tinymce/plugins/table/css/table.css)
===================================================================
--- plog/trunk/js/tinymce/plugins/table/css/table.css	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/table/css/table.css	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,13 @@
+/* CSS file for table dialog in the table plugin */
+
+.panel_wrapper div.current {
+	height: 220px;
+}
+
+.advfield {
+	width: 200px;
+}
+
+#class {
+	width: 150px;
+}

Deleted: plog/trunk/js/tinymce/plugins/table/editor_plugin.js
===================================================================
--- plog/trunk/js/tinymce/plugins/table/editor_plugin.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/table/editor_plugin.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1 +0,0 @@
-tinyMCE.importPluginLanguagePack('table');var TinyMCE_TablePlugin={getInfo:function(){return{longname:'Tables',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/table',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){if(tinyMCE.isGecko){var doc=inst.getDoc();tinyMCE.addEvent(doc,"mouseup",TinyMCE_TablePlugin._mouseDownHandler)}inst.tableRowClipboard=null},getControlHTML:function(control_name){var controls=new Array(['table','table.gif','lang_table_desc','mceInsertTable',true],['delete_table','table_delete.gif','lang_table_del','mceTableDelete'],['delete_col','table_delete_col.gif','lang_table_delete_col_desc','mceTableDeleteCol'],['delete_row','table_delete_row.gif','lang_table_delete_row_desc','mceTableDeleteRow'],['col_after','table_insert_col_after.gif','lang_table_col_after_desc','mceTableInsertColAfter'],['col_before','table_insert_col_before.gif','lang_t
 able_col_before_desc','mceTableInsertColBefore'],['row_after','table_insert_row_after.gif','lang_table_row_after_desc','mceTableInsertRowAfter'],['row_before','table_insert_row_before.gif','lang_table_row_before_desc','mceTableInsertRowBefore'],['row_props','table_row_props.gif','lang_table_row_desc','mceTableRowProps',true],['cell_props','table_cell_props.gif','lang_table_cell_desc','mceTableCellProps',true],['split_cells','table_split_cells.gif','lang_table_split_cells_desc','mceTableSplitCells',true],['merge_cells','table_merge_cells.gif','lang_table_merge_cells_desc','mceTableMergeCells',true]);for(var i=0;i<controls.length;i++){var but=controls[i];var cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\''+but[3]+'\', '+(but.length>4?but[4]:false)+(but.length>5?', \''+but[5]+'\'':'')+');return false;';if(but[0]==control_name)return tinyMCE.getButtonHTML(control_name,but[2],'{$pluginurl}/images/'+but[1],but[3],(but.length>4?but[4]:false))}if(control_name=="tablecontrols"){
 var html="";html+=tinyMCE.getControlHTML("table");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("row_props");html+=tinyMCE.getControlHTML("cell_props");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("row_before");html+=tinyMCE.getControlHTML("row_after");html+=tinyMCE.getControlHTML("delete_row");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("col_before");html+=tinyMCE.getControlHTML("col_after");html+=tinyMCE.getControlHTML("delete_col");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("split_cells");html+=tinyMCE.getControlHTML("merge_cells");return html}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceInsertTable":case"mceTableRowProps":case"mceTableCellProps":case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case
 "mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":case"mceTableDelete":var inst=tinyMCE.getInstanceById(editor_id);inst.execCommand('mceBeginUndoLevel');TinyMCE_TablePlugin._doExecCommand(editor_id,element,command,user_interface,value);inst.execCommand('mceEndUndoLevel');return true}return false},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){var colspan="1",rowspan="1",tdElm;var inst=tinyMCE.getInstanceById(editor_id);tinyMCE.switchClass(editor_id+'_table','mceButtonNormal');tinyMCE.switchClass(editor_id+'_delete_table','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_row_props','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_cell_props','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_row_before','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_row_after','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_delete_ro
 w','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_col_before','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_col_after','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_delete_col','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_split_cells','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_merge_cells','mceButtonDisabled');if(tdElm=tinyMCE.getParentElement(node,"td,th")){tinyMCE.switchClass(editor_id+'_cell_props','mceButtonSelected');tinyMCE.switchClass(editor_id+'_delete_table','mceButtonNormal');tinyMCE.switchClass(editor_id+'_row_before','mceButtonNormal');tinyMCE.switchClass(editor_id+'_row_after','mceButtonNormal');tinyMCE.switchClass(editor_id+'_delete_row','mceButtonNormal');tinyMCE.switchClass(editor_id+'_col_before','mceButtonNormal');tinyMCE.switchClass(editor_id+'_col_after','mceButtonNormal');tinyMCE.switchClass(editor_id+'_delete_col','mceButtonNormal');colspan=tinyMCE.getAttrib(tdElm,"colspan");rowspan=tinyMCE.getAttrib(tdElm,"rowspan"
 );colspan=colspan==""?"1":colspan;rowspan=rowspan==""?"1":rowspan;if(colspan!="1"||rowspan!="1")tinyMCE.switchClass(editor_id+'_split_cells','mceButtonNormal')}if(tinyMCE.getParentElement(node,"tr"))tinyMCE.switchClass(editor_id+'_row_props','mceButtonSelected');if(tinyMCE.getParentElement(node,"table")){tinyMCE.switchClass(editor_id+'_table','mceButtonSelected');tinyMCE.switchClass(editor_id+'_merge_cells','mceButtonNormal')}},_mouseDownHandler:function(e){var elm=tinyMCE.isMSIE?event.srcElement:e.target;var focusElm=tinyMCE.selectedInstance.getFocusElement();if(elm.nodeName=="BODY"&&(focusElm.nodeName=="TD"||focusElm.nodeName=="TH"||(focusElm.parentNode&&focusElm.parentNode.nodeName=="TD")||(focusElm.parentNode&&focusElm.parentNode.nodeName=="TH"))){window.setTimeout(function(){var tableElm=tinyMCE.getParentElement(focusElm,"table");tinyMCE.handleVisualAid(tableElm,true,tinyMCE.settings['visual'],tinyMCE.selectedInstance)},10)}},_doExecCommand:function(editor_id,element,co
 mmand,user_interface,value){var inst=tinyMCE.getInstanceById(editor_id);var focusElm=inst.getFocusElement();var trElm=tinyMCE.getParentElement(focusElm,"tr");var tdElm=tinyMCE.getParentElement(focusElm,"td,th");var tableElm=tinyMCE.getParentElement(focusElm,"table");var doc=inst.contentWindow.document;var tableBorder=tableElm?tableElm.getAttribute("border"):"";if(trElm&&tdElm==null)tdElm=trElm.cells[0];function inArray(ar,v){for(var i=0;i<ar.length;i++){if(ar[i].length>0&&inArray(ar[i],v))return true;if(ar[i]==v)return true}return false}function makeTD(){var newTD=doc.createElement("td");newTD.innerHTML=" "}function getColRowSpan(td){var colspan=tinyMCE.getAttrib(td,"colspan");var rowspan=tinyMCE.getAttrib(td,"rowspan");colspan=colspan==""?1:parseInt(colspan);rowspan=rowspan==""?1:parseInt(rowspan);return{colspan:colspan,rowspan:rowspan}}function getCellPos(grid,td){var x,y;for(y=0;y<grid.length;y++){for(x=0;x<grid[y].length;x++){if(grid[y][x]==td)return{cellindex:x,row
 index:y}}}return null}function getCell(grid,row,col){if(grid[row]&&grid[row][col])return grid[row][col];return null}function getTableGrid(table){var grid=new Array(),rows=table.rows,x,y,td,sd,xstart,x2,y2;for(y=0;y<rows.length;y++){for(x=0;x<rows[y].cells.length;x++){td=rows[y].cells[x];sd=getColRowSpan(td);for(xstart=x;grid[y]&&grid[y][xstart];xstart++);for(y2=y;y2<y+sd['rowspan'];y2++){if(!grid[y2])grid[y2]=new Array();for(x2=xstart;x2<xstart+sd['colspan'];x2++)grid[y2][x2]=td}}}return grid}function trimRow(table,tr,td,new_tr){var grid=getTableGrid(table),cpos=getCellPos(grid,td);var cells,lastElm;if(new_tr.cells.length!=tr.childNodes.length){cells=tr.childNodes;lastElm=null;for(var x=0;td=getCell(grid,cpos.rowindex,x);x++){var remove=true;var sd=getColRowSpan(td);if(inArray(cells,td)){new_tr.childNodes[x]._delete=true}else if((lastElm==null||td!=lastElm)&&sd.colspan>1){for(var i=x;i<x+td.colSpan;i++)new_tr.childNodes[i]._delete=true}if((lastElm==null||td!=lastElm)&&sd.row
 span>1)td.rowSpan=sd.rowspan+1;lastElm=td}deleteMarked(tableElm)}}function prevElm(node,name){while((node=node.previousSibling)!=null){if(node.nodeName==name)return node}return null}function nextElm(node,names){var namesAr=names.split(',');while((node=node.nextSibling)!=null){for(var i=0;i<namesAr.length;i++){if(node.nodeName.toLowerCase()==namesAr[i].toLowerCase())return node}}return null}function deleteMarked(tbl){if(tbl.rows==0)return;var tr=tbl.rows[0];do{var next=nextElm(tr,"TR");if(tr._delete){tr.parentNode.removeChild(tr);continue}var td=tr.cells[0];if(td.cells>1){do{var nexttd=nextElm(td,"TD,TH");if(td._delete)td.parentNode.removeChild(td)}while((td=nexttd)!=null)}}while((tr=next)!=null)}function addRows(td_elm,tr_elm,rowspan){td_elm.rowSpan=1;var trNext=nextElm(tr_elm,"TR");for(var i=1;i<rowspan&&trNext;i++){var newTD=doc.createElement("td");newTD.innerHTML=" ";if(tinyMCE.isMSIE)trNext.insertBefore(newTD,trNext.cells(td_elm.cellIndex));else trNext.insertBefore(
 newTD,trNext.cells[td_elm.cellIndex]);trNext=nextElm(trNext,"TR")}}function copyRow(doc,table,tr){var grid=getTableGrid(table);var newTR=tr.cloneNode(false);var cpos=getCellPos(grid,tr.cells[0]);var lastCell=null;var tableBorder=tinyMCE.getAttrib(table,"border");var tdElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){var newTD=null;if(lastCell!=tdElm){for(var i=0;i<tr.cells.length;i++){if(tdElm==tr.cells[i]){newTD=tdElm.cloneNode(true);break}}}if(newTD==null){newTD=doc.createElement("td");newTD.innerHTML=" "}newTD.colSpan=1;newTD.rowSpan=1;newTR.appendChild(newTD);lastCell=tdElm}return newTR}switch(command){case"mceTableRowProps":if(trElm==null)return true;if(user_interface){var template=new Array();template['file']='../../plugins/table/row.htm';template['width']=380;template['height']=295;template['width']+=tinyMCE.getLang('lang_table_rowprops_delta_width',0);template['height']+=tinyMCE.getLang('lang_table_rowprops_delta_height',0);tinyMCE.openWindow(templa
 te,{editor_id:inst.editorId,inline:"yes"})}return true;case"mceTableCellProps":if(tdElm==null)return true;if(user_interface){var template=new Array();template['file']='../../plugins/table/cell.htm';template['width']=380;template['height']=295;template['width']+=tinyMCE.getLang('lang_table_cellprops_delta_width',0);template['height']+=tinyMCE.getLang('lang_table_cellprops_delta_height',0);tinyMCE.openWindow(template,{editor_id:inst.editorId,inline:"yes"})}return true;case"mceInsertTable":if(user_interface){var template=new Array();template['file']='../../plugins/table/table.htm';template['width']=380;template['height']=295;template['width']+=tinyMCE.getLang('lang_table_table_delta_width',0);template['height']+=tinyMCE.getLang('lang_table_table_delta_height',0);tinyMCE.openWindow(template,{editor_id:inst.editorId,inline:"yes",action:value})}return true;case"mceTableDelete":var table=tinyMCE.getParentElement(inst.getFocusElement(),"table");if(table){table.parentNode.removeChild
 (table);inst.repaint()}return true;case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":if(!tableElm)return true;if(trElm&&tableElm!=trElm.parentNode)tableElm=trElm.parentNode;if(tableElm&&trElm){switch(command){case"mceTableCutRow":if(!trElm||!tdElm)return true;inst.tableRowClipboard=copyRow(doc,tableElm,trElm);inst.execCommand("mceTableDeleteRow");break;case"mceTableCopyRow":if(!trElm||!tdElm)return true;inst.tableRowClipboard=copyRow(doc,tableElm,trElm);break;case"mceTablePasteRowBefore":if(!trElm||!tdElm)return true;var newTR=inst.tableRowClipboard.cloneNode(true);var prevTR=prevElm(trElm,"TR");if(prevTR!=null)trimRow(tableElm,prevTR,prevTR.cells[0],newTR);trElm.parentNode.insertBefore(newTR,trElm);break;case"mce
 TablePasteRowAfter":if(!trElm||!tdElm)return true;var nextTR=nextElm(trElm,"TR");var newTR=inst.tableRowClipboard.cloneNode(true);trimRow(tableElm,trElm,tdElm,newTR);if(nextTR==null)trElm.parentNode.appendChild(newTR);else nextTR.parentNode.insertBefore(newTR,nextTR);break;case"mceTableInsertRowBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var newTR=doc.createElement("tr");var lastTDElm=null;cpos.rowindex--;if(cpos.rowindex<0)cpos.rowindex=0;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['rowspan']==1){var newTD=doc.createElement("td");newTD.innerHTML=" ";newTD.colSpan=tdElm.colSpan;newTR.appendChild(newTD)}else tdElm.rowSpan=sd['rowspan']+1;lastTDElm=tdElm}}trElm.parentNode.insertBefore(newTR,trElm);grid=getTableGrid(tableElm);inst.selection.selectNode(getCell(grid,cpos.rowindex+1,cpos.cellindex),tinyMCE.isGecko,true);break;case"mceTableInsertRowAfter":i
 f(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var newTR=doc.createElement("tr");var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['rowspan']==1){var newTD=doc.createElement("td");newTD.innerHTML=" ";newTD.colSpan=tdElm.colSpan;newTR.appendChild(newTD)}else tdElm.rowSpan=sd['rowspan']+1;lastTDElm=tdElm}}if(newTR.hasChildNodes()){var nextTR=nextElm(trElm,"TR");if(nextTR)nextTR.parentNode.insertBefore(newTR,nextTR);else tableElm.appendChild(newTR)}grid=getTableGrid(tableElm);inst.selection.selectNode(getCell(grid,cpos.rowindex,cpos.cellindex),tinyMCE.isGecko,true);break;case"mceTableDeleteRow":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);if(grid.length==1){tableElm=tinyMCE.getParentElement(tableElm,"table");tableElm.parentNode.removeChild(tableElm);return true}var cells=trElm.cells;var nextTR=nextElm(tr
 Elm,"TR");for(var x=0;x<cells.length;x++){if(cells[x].rowSpan>1){var newTD=cells[x].cloneNode(true);var sd=getColRowSpan(cells[x]);newTD.rowSpan=sd.rowspan-1;var nextTD=nextTR.cells[x];if(nextTD==null)nextTR.appendChild(newTD);else nextTR.insertBefore(newTD,nextTD)}}var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd.rowspan>1){tdElm.rowSpan=sd.rowspan-1}else{trElm=tdElm.parentNode;if(trElm.parentNode)trElm._delete=true}lastTDElm=tdElm}}deleteMarked(tableElm);cpos.rowindex--;if(cpos.rowindex<0)cpos.rowindex=0;grid=getTableGrid(tableElm);inst.selection.selectNode(getCell(grid,cpos.rowindex,0),tinyMCE.isGecko,true);break;case"mceTableInsertColBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.create
 Element(tdElm.nodeName);newTD.innerHTML=" ";newTD.rowSpan=tdElm.rowSpan;tdElm.parentNode.insertBefore(newTD,tdElm)}else tdElm.colSpan++;lastTDElm=tdElm}}grid=getTableGrid(tableElm);inst.selection.selectNode(getCell(grid,cpos.rowindex,cpos.cellindex+1),tinyMCE.isGecko,true);break;case"mceTableInsertColAfter":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);newTD.innerHTML=" ";newTD.rowSpan=tdElm.rowSpan;var nextTD=nextElm(tdElm,"TD,TH");if(nextTD==null)tdElm.parentNode.appendChild(newTD);else nextTD.parentNode.insertBefore(newTD,nextTD)}else tdElm.colSpan++;lastTDElm=tdElm}}grid=getTableGrid(tableElm);inst.selection.selectNode(getCell(grid,cpos.rowindex,cpos.cellindex),tinyMCE.isGecko,true);break;case"mceTableDeleteCol":if(!trElm||!tdElm)
 return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;if(grid.length>1&&grid[0].length<=1){tableElm=tinyMCE.getParentElement(tableElm,"table");tableElm.parentNode.removeChild(tableElm);return true}for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']>1)tdElm.colSpan=sd['colspan']-1;else{if(tdElm.parentNode)tdElm.parentNode.removeChild(tdElm)}lastTDElm=tdElm}}cpos.cellindex--;if(cpos.cellindex<0)cpos.cellindex=0;grid=getTableGrid(tableElm);inst.selection.selectNode(getCell(grid,cpos.rowindex,0),tinyMCE.isGecko,true);break;case"mceTableSplitCells":if(!trElm||!tdElm)return true;var spandata=getColRowSpan(tdElm);var colspan=spandata["colspan"];var rowspan=spandata["rowspan"];if(colspan>1||rowspan>1){tdElm.colSpan=1;for(var i=1;i<colspan;i++){var newTD=doc.createElement("td");newTD.innerHTML=" ";trElm.insertBefore(newTD,nextElm(tdElm,"TD,TH"));if(rowspan>1)addRows(newTD
 ,trElm,rowspan)}addRows(tdElm,trElm,rowspan)}tableElm=tinyMCE.getParentElement(inst.getFocusElement(),"table");break;case"mceTableMergeCells":var rows=new Array();var sel=inst.getSel();var grid=getTableGrid(tableElm);if(tinyMCE.isMSIE||sel.rangeCount==1){if(user_interface){var template=new Array();var sp=getColRowSpan(tdElm);template['file']='../../plugins/table/merge_cells.htm';template['width']=250;template['height']=105+(tinyMCE.isNS7?25:0);template['width']+=tinyMCE.getLang('lang_table_merge_cells_delta_width',0);template['height']+=tinyMCE.getLang('lang_table_merge_cells_delta_height',0);tinyMCE.openWindow(template,{editor_id:inst.editorId,inline:"yes",action:"update",numcols:sp.colspan,numrows:sp.rowspan});return true}else{var numRows=parseInt(value['numrows']);var numCols=parseInt(value['numcols']);var cpos=getCellPos(grid,tdElm);if((""+numRows)=="NaN")numRows=1;if((""+numCols)=="NaN")numCols=1;var tRows=tableElm.rows;for(var y=cpos.rowindex;y<grid.length;y++){var row
 Cells=new Array();for(var x=cpos.cellindex;x<grid[y].length;x++){var td=getCell(grid,y,x);if(td&&!inArray(rows,td)&&!inArray(rowCells,td)){var cp=getCellPos(grid,td);if(cp.cellindex<cpos.cellindex+numCols&&cp.rowindex<cpos.rowindex+numRows)rowCells[rowCells.length]=td}}if(rowCells.length>0)rows[rows.length]=rowCells}}}else{var cells=new Array();var sel=inst.getSel();var lastTR=null;var curRow=null;var x1=-1,y1=-1,x2,y2;if(sel.rangeCount<2)return true;for(var i=0;i<sel.rangeCount;i++){var rng=sel.getRangeAt(i);var tdElm=rng.startContainer.childNodes[rng.startOffset];if(!tdElm)break;if(tdElm.nodeName=="TD")cells[cells.length]=tdElm}var tRows=tableElm.rows;for(var y=0;y<tRows.length;y++){var rowCells=new Array();for(var x=0;x<tRows[y].cells.length;x++){var td=tRows[y].cells[x];for(var i=0;i<cells.length;i++){if(td==cells[i]){rowCells[rowCells.length]=td}}}if(rowCells.length>0)rows[rows.length]=rowCells}var curRow=new Array();var lastTR=null;for(var y=0;y<grid.length;y++){for(va
 r x=0;x<grid[y].length;x++){grid[y][x]._selected=false;for(var i=0;i<cells.length;i++){if(grid[y][x]==cells[i]){if(x1==-1){x1=x;y1=y}x2=x;y2=y;grid[y][x]._selected=true}}}}for(var y=y1;y<=y2;y++){for(var x=x1;x<=x2;x++){if(!grid[y][x]._selected){alert("Invalid selection for merge.");return true}}}}var rowSpan=1,colSpan=1;var lastRowSpan=-1;for(var y=0;y<rows.length;y++){var rowColSpan=0;for(var x=0;x<rows[y].length;x++){var sd=getColRowSpan(rows[y][x]);rowColSpan+=sd['colspan'];if(lastRowSpan!=-1&&sd['rowspan']!=lastRowSpan){alert("Invalid selection for merge.");return true}lastRowSpan=sd['rowspan']}if(rowColSpan>colSpan)colSpan=rowColSpan;lastRowSpan=-1}var lastColSpan=-1;for(var x=0;x<rows[0].length;x++){var colRowSpan=0;for(var y=0;y<rows.length;y++){var sd=getColRowSpan(rows[y][x]);colRowSpan+=sd['rowspan'];if(lastColSpan!=-1&&sd['colspan']!=lastColSpan){alert("Invalid selection for merge.");return true}lastColSpan=sd['colspan']}if(colRowSpan>rowSpan)rowSpan=colRowSpan;l
 astColSpan=-1}tdElm=rows[0][0];tdElm.rowSpan=rowSpan;tdElm.colSpan=colSpan;for(var y=0;y<rows.length;y++){for(var x=0;x<rows[y].length;x++){var html=rows[y][x].innerHTML;var chk=tinyMCE.regexpReplace(html,"[ \t\r\n]","");if(chk!="<br/>"&&chk!="<br>"&&chk!=" "&&(x+y>0))tdElm.innerHTML+=html;if(rows[y][x]!=tdElm&&!rows[y][x]._deleted){var cpos=getCellPos(grid,rows[y][x]);var tr=rows[y][x].parentNode;tr.removeChild(rows[y][x]);rows[y][x]._deleted=true;if(!tr.hasChildNodes()){tr.parentNode.removeChild(tr);var lastCell=null;for(var x=0;cellElm=getCell(grid,cpos.rowindex,x);x++){if(cellElm!=lastCell&&cellElm.rowSpan>1)cellElm.rowSpan--;lastCell=cellElm}if(tdElm.rowSpan>1)tdElm.rowSpan--}}}}break}tableElm=tinyMCE.getParentElement(inst.getFocusElement(),"table");tinyMCE.handleVisualAid(tableElm,true,tinyMCE.settings['visual'],tinyMCE.selectedInstance);tinyMCE.triggerNodeChange();inst.repaint()}return true}return false}};tinyMCE.addPlugin("table",TinyMCE_TablePlugin);
\ No newline at end of file

Copied: plog/trunk/js/tinymce/plugins/table/editor_plugin.js (from rev 7165, plog/trunk/js/tinymce/plugins/table/editor_plugin.js)
===================================================================
--- plog/trunk/js/tinymce/plugins/table/editor_plugin.js	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/table/editor_plugin.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1 @@
+tinyMCE.importPluginLanguagePack('table');var TinyMCE_TablePlugin={getInfo:function(){return{longname:'Tables',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/table',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){if(tinyMCE.isGecko){var doc=inst.getDoc();tinyMCE.addEvent(doc,"mouseup",TinyMCE_TablePlugin._mouseDownHandler)}inst.tableRowClipboard=null},getControlHTML:function(control_name){var controls=new Array(['table','table.gif','lang_table_desc','mceInsertTable',true],['delete_table','table_delete.gif','lang_table_del','mceTableDelete'],['delete_col','table_delete_col.gif','lang_table_delete_col_desc','mceTableDeleteCol'],['delete_row','table_delete_row.gif','lang_table_delete_row_desc','mceTableDeleteRow'],['col_after','table_insert_col_after.gif','lang_table_col_after_desc','mceTableInsertColAfter'],['col_before','table_insert_col_before.gif','lang_t
 able_col_before_desc','mceTableInsertColBefore'],['row_after','table_insert_row_after.gif','lang_table_row_after_desc','mceTableInsertRowAfter'],['row_before','table_insert_row_before.gif','lang_table_row_before_desc','mceTableInsertRowBefore'],['row_props','table_row_props.gif','lang_table_row_desc','mceTableRowProps',true],['cell_props','table_cell_props.gif','lang_table_cell_desc','mceTableCellProps',true],['split_cells','table_split_cells.gif','lang_table_split_cells_desc','mceTableSplitCells',true],['merge_cells','table_merge_cells.gif','lang_table_merge_cells_desc','mceTableMergeCells',true]);for(var i=0;i<controls.length;i++){var but=controls[i];var cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\''+but[3]+'\', '+(but.length>4?but[4]:false)+(but.length>5?', \''+but[5]+'\'':'')+');return false;';if(but[0]==control_name)return tinyMCE.getButtonHTML(control_name,but[2],'{$pluginurl}/images/'+but[1],but[3],(but.length>4?but[4]:false))}if(control_name=="tablecontrols"){
 var html="";html+=tinyMCE.getControlHTML("table");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("row_props");html+=tinyMCE.getControlHTML("cell_props");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("row_before");html+=tinyMCE.getControlHTML("row_after");html+=tinyMCE.getControlHTML("delete_row");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("col_before");html+=tinyMCE.getControlHTML("col_after");html+=tinyMCE.getControlHTML("delete_col");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("split_cells");html+=tinyMCE.getControlHTML("merge_cells");return html}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceInsertTable":case"mceTableRowProps":case"mceTableCellProps":case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case
 "mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":case"mceTableDelete":var inst=tinyMCE.getInstanceById(editor_id);inst.execCommand('mceBeginUndoLevel');TinyMCE_TablePlugin._doExecCommand(editor_id,element,command,user_interface,value);inst.execCommand('mceEndUndoLevel');return true}return false},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){var colspan="1",rowspan="1",tdElm;var inst=tinyMCE.getInstanceById(editor_id);tinyMCE.switchClass(editor_id+'_table','mceButtonNormal');tinyMCE.switchClass(editor_id+'_delete_table','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_row_props','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_cell_props','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_row_before','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_row_after','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_delete_ro
 w','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_col_before','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_col_after','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_delete_col','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_split_cells','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_merge_cells','mceButtonDisabled');if(tdElm=tinyMCE.getParentElement(node,"td,th")){tinyMCE.switchClass(editor_id+'_cell_props','mceButtonSelected');tinyMCE.switchClass(editor_id+'_delete_table','mceButtonNormal');tinyMCE.switchClass(editor_id+'_row_before','mceButtonNormal');tinyMCE.switchClass(editor_id+'_row_after','mceButtonNormal');tinyMCE.switchClass(editor_id+'_delete_row','mceButtonNormal');tinyMCE.switchClass(editor_id+'_col_before','mceButtonNormal');tinyMCE.switchClass(editor_id+'_col_after','mceButtonNormal');tinyMCE.switchClass(editor_id+'_delete_col','mceButtonNormal');colspan=tinyMCE.getAttrib(tdElm,"colspan");rowspan=tinyMCE.getAttrib(tdElm,"rowspan"
 );colspan=colspan==""?"1":colspan;rowspan=rowspan==""?"1":rowspan;if(colspan!="1"||rowspan!="1")tinyMCE.switchClass(editor_id+'_split_cells','mceButtonNormal')}if(tinyMCE.getParentElement(node,"tr"))tinyMCE.switchClass(editor_id+'_row_props','mceButtonSelected');if(tinyMCE.getParentElement(node,"table")){tinyMCE.switchClass(editor_id+'_table','mceButtonSelected');tinyMCE.switchClass(editor_id+'_merge_cells','mceButtonNormal')}},_mouseDownHandler:function(e){var elm=tinyMCE.isMSIE?event.srcElement:e.target;var focusElm=tinyMCE.selectedInstance.getFocusElement();if(elm.nodeName=="BODY"&&(focusElm.nodeName=="TD"||focusElm.nodeName=="TH"||(focusElm.parentNode&&focusElm.parentNode.nodeName=="TD")||(focusElm.parentNode&&focusElm.parentNode.nodeName=="TH"))){window.setTimeout(function(){var tableElm=tinyMCE.getParentElement(focusElm,"table");tinyMCE.handleVisualAid(tableElm,true,tinyMCE.settings['visual'],tinyMCE.selectedInstance)},10)}},_doExecCommand:function(editor_id,element,co
 mmand,user_interface,value){var inst=tinyMCE.getInstanceById(editor_id);var focusElm=inst.getFocusElement();var trElm=tinyMCE.getParentElement(focusElm,"tr");var tdElm=tinyMCE.getParentElement(focusElm,"td,th");var tableElm=tinyMCE.getParentElement(focusElm,"table");var doc=inst.contentWindow.document;var tableBorder=tableElm?tableElm.getAttribute("border"):"";if(trElm&&tdElm==null)tdElm=trElm.cells[0];function inArray(ar,v){for(var i=0;i<ar.length;i++){if(ar[i].length>0&&inArray(ar[i],v))return true;if(ar[i]==v)return true}return false}function makeTD(){var newTD=doc.createElement("td");newTD.innerHTML=" "}function getColRowSpan(td){var colspan=tinyMCE.getAttrib(td,"colspan");var rowspan=tinyMCE.getAttrib(td,"rowspan");colspan=colspan==""?1:parseInt(colspan);rowspan=rowspan==""?1:parseInt(rowspan);return{colspan:colspan,rowspan:rowspan}}function getCellPos(grid,td){var x,y;for(y=0;y<grid.length;y++){for(x=0;x<grid[y].length;x++){if(grid[y][x]==td)return{cellindex:x,row
 index:y}}}return null}function getCell(grid,row,col){if(grid[row]&&grid[row][col])return grid[row][col];return null}function getTableGrid(table){var grid=new Array(),rows=table.rows,x,y,td,sd,xstart,x2,y2;for(y=0;y<rows.length;y++){for(x=0;x<rows[y].cells.length;x++){td=rows[y].cells[x];sd=getColRowSpan(td);for(xstart=x;grid[y]&&grid[y][xstart];xstart++);for(y2=y;y2<y+sd['rowspan'];y2++){if(!grid[y2])grid[y2]=new Array();for(x2=xstart;x2<xstart+sd['colspan'];x2++)grid[y2][x2]=td}}}return grid}function trimRow(table,tr,td,new_tr){var grid=getTableGrid(table),cpos=getCellPos(grid,td);var cells,lastElm;if(new_tr.cells.length!=tr.childNodes.length){cells=tr.childNodes;lastElm=null;for(var x=0;td=getCell(grid,cpos.rowindex,x);x++){var remove=true;var sd=getColRowSpan(td);if(inArray(cells,td)){new_tr.childNodes[x]._delete=true}else if((lastElm==null||td!=lastElm)&&sd.colspan>1){for(var i=x;i<x+td.colSpan;i++)new_tr.childNodes[i]._delete=true}if((lastElm==null||td!=lastElm)&&sd.row
 span>1)td.rowSpan=sd.rowspan+1;lastElm=td}deleteMarked(tableElm)}}function prevElm(node,name){while((node=node.previousSibling)!=null){if(node.nodeName==name)return node}return null}function nextElm(node,names){var namesAr=names.split(',');while((node=node.nextSibling)!=null){for(var i=0;i<namesAr.length;i++){if(node.nodeName.toLowerCase()==namesAr[i].toLowerCase())return node}}return null}function deleteMarked(tbl){if(tbl.rows==0)return;var tr=tbl.rows[0];do{var next=nextElm(tr,"TR");if(tr._delete){tr.parentNode.removeChild(tr);continue}var td=tr.cells[0];if(td.cells>1){do{var nexttd=nextElm(td,"TD,TH");if(td._delete)td.parentNode.removeChild(td)}while((td=nexttd)!=null)}}while((tr=next)!=null)}function addRows(td_elm,tr_elm,rowspan){td_elm.rowSpan=1;var trNext=nextElm(tr_elm,"TR");for(var i=1;i<rowspan&&trNext;i++){var newTD=doc.createElement("td");newTD.innerHTML=" ";if(tinyMCE.isMSIE)trNext.insertBefore(newTD,trNext.cells(td_elm.cellIndex));else trNext.insertBefore(
 newTD,trNext.cells[td_elm.cellIndex]);trNext=nextElm(trNext,"TR")}}function copyRow(doc,table,tr){var grid=getTableGrid(table);var newTR=tr.cloneNode(false);var cpos=getCellPos(grid,tr.cells[0]);var lastCell=null;var tableBorder=tinyMCE.getAttrib(table,"border");var tdElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){var newTD=null;if(lastCell!=tdElm){for(var i=0;i<tr.cells.length;i++){if(tdElm==tr.cells[i]){newTD=tdElm.cloneNode(true);break}}}if(newTD==null){newTD=doc.createElement("td");newTD.innerHTML=" "}newTD.colSpan=1;newTD.rowSpan=1;newTR.appendChild(newTD);lastCell=tdElm}return newTR}switch(command){case"mceTableRowProps":if(trElm==null)return true;if(user_interface){var template=new Array();template['file']='../../plugins/table/row.htm';template['width']=380;template['height']=295;template['width']+=tinyMCE.getLang('lang_table_rowprops_delta_width',0);template['height']+=tinyMCE.getLang('lang_table_rowprops_delta_height',0);tinyMCE.openWindow(templa
 te,{editor_id:inst.editorId,inline:"yes"})}return true;case"mceTableCellProps":if(tdElm==null)return true;if(user_interface){var template=new Array();template['file']='../../plugins/table/cell.htm';template['width']=380;template['height']=295;template['width']+=tinyMCE.getLang('lang_table_cellprops_delta_width',0);template['height']+=tinyMCE.getLang('lang_table_cellprops_delta_height',0);tinyMCE.openWindow(template,{editor_id:inst.editorId,inline:"yes"})}return true;case"mceInsertTable":if(user_interface){var template=new Array();template['file']='../../plugins/table/table.htm';template['width']=380;template['height']=295;template['width']+=tinyMCE.getLang('lang_table_table_delta_width',0);template['height']+=tinyMCE.getLang('lang_table_table_delta_height',0);tinyMCE.openWindow(template,{editor_id:inst.editorId,inline:"yes",action:value})}return true;case"mceTableDelete":var table=tinyMCE.getParentElement(inst.getFocusElement(),"table");if(table){table.parentNode.removeChild
 (table);inst.repaint()}return true;case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":if(!tableElm)return true;if(trElm&&tableElm!=trElm.parentNode)tableElm=trElm.parentNode;if(tableElm&&trElm){switch(command){case"mceTableCutRow":if(!trElm||!tdElm)return true;inst.tableRowClipboard=copyRow(doc,tableElm,trElm);inst.execCommand("mceTableDeleteRow");break;case"mceTableCopyRow":if(!trElm||!tdElm)return true;inst.tableRowClipboard=copyRow(doc,tableElm,trElm);break;case"mceTablePasteRowBefore":if(!trElm||!tdElm)return true;var newTR=inst.tableRowClipboard.cloneNode(true);var prevTR=prevElm(trElm,"TR");if(prevTR!=null)trimRow(tableElm,prevTR,prevTR.cells[0],newTR);trElm.parentNode.insertBefore(newTR,trElm);break;case"mce
 TablePasteRowAfter":if(!trElm||!tdElm)return true;var nextTR=nextElm(trElm,"TR");var newTR=inst.tableRowClipboard.cloneNode(true);trimRow(tableElm,trElm,tdElm,newTR);if(nextTR==null)trElm.parentNode.appendChild(newTR);else nextTR.parentNode.insertBefore(newTR,nextTR);break;case"mceTableInsertRowBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var newTR=doc.createElement("tr");var lastTDElm=null;cpos.rowindex--;if(cpos.rowindex<0)cpos.rowindex=0;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['rowspan']==1){var newTD=doc.createElement("td");newTD.innerHTML=" ";newTD.colSpan=tdElm.colSpan;newTR.appendChild(newTD)}else tdElm.rowSpan=sd['rowspan']+1;lastTDElm=tdElm}}trElm.parentNode.insertBefore(newTR,trElm);grid=getTableGrid(tableElm);inst.selection.selectNode(getCell(grid,cpos.rowindex+1,cpos.cellindex),tinyMCE.isGecko,true);break;case"mceTableInsertRowAfter":i
 f(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var newTR=doc.createElement("tr");var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['rowspan']==1){var newTD=doc.createElement("td");newTD.innerHTML=" ";newTD.colSpan=tdElm.colSpan;newTR.appendChild(newTD)}else tdElm.rowSpan=sd['rowspan']+1;lastTDElm=tdElm}}if(newTR.hasChildNodes()){var nextTR=nextElm(trElm,"TR");if(nextTR)nextTR.parentNode.insertBefore(newTR,nextTR);else tableElm.appendChild(newTR)}grid=getTableGrid(tableElm);inst.selection.selectNode(getCell(grid,cpos.rowindex,cpos.cellindex),tinyMCE.isGecko,true);break;case"mceTableDeleteRow":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);if(grid.length==1){tableElm=tinyMCE.getParentElement(tableElm,"table");tableElm.parentNode.removeChild(tableElm);return true}var cells=trElm.cells;var nextTR=nextElm(tr
 Elm,"TR");for(var x=0;x<cells.length;x++){if(cells[x].rowSpan>1){var newTD=cells[x].cloneNode(true);var sd=getColRowSpan(cells[x]);newTD.rowSpan=sd.rowspan-1;var nextTD=nextTR.cells[x];if(nextTD==null)nextTR.appendChild(newTD);else nextTR.insertBefore(newTD,nextTD)}}var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd.rowspan>1){tdElm.rowSpan=sd.rowspan-1}else{trElm=tdElm.parentNode;if(trElm.parentNode)trElm._delete=true}lastTDElm=tdElm}}deleteMarked(tableElm);cpos.rowindex--;if(cpos.rowindex<0)cpos.rowindex=0;grid=getTableGrid(tableElm);inst.selection.selectNode(getCell(grid,cpos.rowindex,0),tinyMCE.isGecko,true);break;case"mceTableInsertColBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.create
 Element(tdElm.nodeName);newTD.innerHTML=" ";newTD.rowSpan=tdElm.rowSpan;tdElm.parentNode.insertBefore(newTD,tdElm)}else tdElm.colSpan++;lastTDElm=tdElm}}grid=getTableGrid(tableElm);inst.selection.selectNode(getCell(grid,cpos.rowindex,cpos.cellindex+1),tinyMCE.isGecko,true);break;case"mceTableInsertColAfter":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);newTD.innerHTML=" ";newTD.rowSpan=tdElm.rowSpan;var nextTD=nextElm(tdElm,"TD,TH");if(nextTD==null)tdElm.parentNode.appendChild(newTD);else nextTD.parentNode.insertBefore(newTD,nextTD)}else tdElm.colSpan++;lastTDElm=tdElm}}grid=getTableGrid(tableElm);inst.selection.selectNode(getCell(grid,cpos.rowindex,cpos.cellindex),tinyMCE.isGecko,true);break;case"mceTableDeleteCol":if(!trElm||!tdElm)
 return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;if(grid.length>1&&grid[0].length<=1){tableElm=tinyMCE.getParentElement(tableElm,"table");tableElm.parentNode.removeChild(tableElm);return true}for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']>1)tdElm.colSpan=sd['colspan']-1;else{if(tdElm.parentNode)tdElm.parentNode.removeChild(tdElm)}lastTDElm=tdElm}}cpos.cellindex--;if(cpos.cellindex<0)cpos.cellindex=0;grid=getTableGrid(tableElm);inst.selection.selectNode(getCell(grid,cpos.rowindex,0),tinyMCE.isGecko,true);break;case"mceTableSplitCells":if(!trElm||!tdElm)return true;var spandata=getColRowSpan(tdElm);var colspan=spandata["colspan"];var rowspan=spandata["rowspan"];if(colspan>1||rowspan>1){tdElm.colSpan=1;for(var i=1;i<colspan;i++){var newTD=doc.createElement("td");newTD.innerHTML=" ";trElm.insertBefore(newTD,nextElm(tdElm,"TD,TH"));if(rowspan>1)addRows(newTD
 ,trElm,rowspan)}addRows(tdElm,trElm,rowspan)}tableElm=tinyMCE.getParentElement(inst.getFocusElement(),"table");break;case"mceTableMergeCells":var rows=new Array();var sel=inst.getSel();var grid=getTableGrid(tableElm);if(tinyMCE.isMSIE||sel.rangeCount==1){if(user_interface){var template=new Array();var sp=getColRowSpan(tdElm);template['file']='../../plugins/table/merge_cells.htm';template['width']=250;template['height']=105+(tinyMCE.isNS7?25:0);template['width']+=tinyMCE.getLang('lang_table_merge_cells_delta_width',0);template['height']+=tinyMCE.getLang('lang_table_merge_cells_delta_height',0);tinyMCE.openWindow(template,{editor_id:inst.editorId,inline:"yes",action:"update",numcols:sp.colspan,numrows:sp.rowspan});return true}else{var numRows=parseInt(value['numrows']);var numCols=parseInt(value['numcols']);var cpos=getCellPos(grid,tdElm);if((""+numRows)=="NaN")numRows=1;if((""+numCols)=="NaN")numCols=1;var tRows=tableElm.rows;for(var y=cpos.rowindex;y<grid.length;y++){var row
 Cells=new Array();for(var x=cpos.cellindex;x<grid[y].length;x++){var td=getCell(grid,y,x);if(td&&!inArray(rows,td)&&!inArray(rowCells,td)){var cp=getCellPos(grid,td);if(cp.cellindex<cpos.cellindex+numCols&&cp.rowindex<cpos.rowindex+numRows)rowCells[rowCells.length]=td}}if(rowCells.length>0)rows[rows.length]=rowCells}}}else{var cells=new Array();var sel=inst.getSel();var lastTR=null;var curRow=null;var x1=-1,y1=-1,x2,y2;if(sel.rangeCount<2)return true;for(var i=0;i<sel.rangeCount;i++){var rng=sel.getRangeAt(i);var tdElm=rng.startContainer.childNodes[rng.startOffset];if(!tdElm)break;if(tdElm.nodeName=="TD")cells[cells.length]=tdElm}var tRows=tableElm.rows;for(var y=0;y<tRows.length;y++){var rowCells=new Array();for(var x=0;x<tRows[y].cells.length;x++){var td=tRows[y].cells[x];for(var i=0;i<cells.length;i++){if(td==cells[i]){rowCells[rowCells.length]=td}}}if(rowCells.length>0)rows[rows.length]=rowCells}var curRow=new Array();var lastTR=null;for(var y=0;y<grid.length;y++){for(va
 r x=0;x<grid[y].length;x++){grid[y][x]._selected=false;for(var i=0;i<cells.length;i++){if(grid[y][x]==cells[i]){if(x1==-1){x1=x;y1=y}x2=x;y2=y;grid[y][x]._selected=true}}}}for(var y=y1;y<=y2;y++){for(var x=x1;x<=x2;x++){if(!grid[y][x]._selected){alert("Invalid selection for merge.");return true}}}}var rowSpan=1,colSpan=1;var lastRowSpan=-1;for(var y=0;y<rows.length;y++){var rowColSpan=0;for(var x=0;x<rows[y].length;x++){var sd=getColRowSpan(rows[y][x]);rowColSpan+=sd['colspan'];if(lastRowSpan!=-1&&sd['rowspan']!=lastRowSpan){alert("Invalid selection for merge.");return true}lastRowSpan=sd['rowspan']}if(rowColSpan>colSpan)colSpan=rowColSpan;lastRowSpan=-1}var lastColSpan=-1;for(var x=0;x<rows[0].length;x++){var colRowSpan=0;for(var y=0;y<rows.length;y++){var sd=getColRowSpan(rows[y][x]);colRowSpan+=sd['rowspan'];if(lastColSpan!=-1&&sd['colspan']!=lastColSpan){alert("Invalid selection for merge.");return true}lastColSpan=sd['colspan']}if(colRowSpan>rowSpan)rowSpan=colRowSpan;l
 astColSpan=-1}tdElm=rows[0][0];tdElm.rowSpan=rowSpan;tdElm.colSpan=colSpan;for(var y=0;y<rows.length;y++){for(var x=0;x<rows[y].length;x++){var html=rows[y][x].innerHTML;var chk=tinyMCE.regexpReplace(html,"[ \t\r\n]","");if(chk!="<br/>"&&chk!="<br>"&&chk!=" "&&(x+y>0))tdElm.innerHTML+=html;if(rows[y][x]!=tdElm&&!rows[y][x]._deleted){var cpos=getCellPos(grid,rows[y][x]);var tr=rows[y][x].parentNode;tr.removeChild(rows[y][x]);rows[y][x]._deleted=true;if(!tr.hasChildNodes()){tr.parentNode.removeChild(tr);var lastCell=null;for(var x=0;cellElm=getCell(grid,cpos.rowindex,x);x++){if(cellElm!=lastCell&&cellElm.rowSpan>1)cellElm.rowSpan--;lastCell=cellElm}if(tdElm.rowSpan>1)tdElm.rowSpan--}}}}break}tableElm=tinyMCE.getParentElement(inst.getFocusElement(),"table");tinyMCE.handleVisualAid(tableElm,true,tinyMCE.settings['visual'],tinyMCE.selectedInstance);tinyMCE.triggerNodeChange();inst.repaint()}return true}return false}};tinyMCE.addPlugin("table",TinyMCE_TablePlugin);
\ No newline at end of file

Deleted: plog/trunk/js/tinymce/plugins/table/editor_plugin_src.js
===================================================================
--- plog/trunk/js/tinymce/plugins/table/editor_plugin_src.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/table/editor_plugin_src.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,1073 +0,0 @@
-/**
- * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
- *
- * @author Moxiecode
- * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
- */
-
-/* Import plugin specific language pack */
-tinyMCE.importPluginLanguagePack('table');
-
-var TinyMCE_TablePlugin = {
-	getInfo : function() {
-		return {
-			longname : 'Tables',
-			author : 'Moxiecode Systems AB',
-			authorurl : 'http://tinymce.moxiecode.com',
-			infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/table',
-			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
-		};
-	},
-
-	initInstance : function(inst) {
-		if (tinyMCE.isGecko) {
-			var doc = inst.getDoc();
-			tinyMCE.addEvent(doc, "mouseup", TinyMCE_TablePlugin._mouseDownHandler);
-		}
-
-		inst.tableRowClipboard = null;
-	},
-
-	/**
-	 * Returns the HTML contents of the table control.
-	 */
-	getControlHTML : function(control_name) {
-		var controls = new Array(
-			['table', 'table.gif', 'lang_table_desc', 'mceInsertTable', true],
-			['delete_table', 'table_delete.gif', 'lang_table_del', 'mceTableDelete'],
-			['delete_col', 'table_delete_col.gif', 'lang_table_delete_col_desc', 'mceTableDeleteCol'],
-			['delete_row', 'table_delete_row.gif', 'lang_table_delete_row_desc', 'mceTableDeleteRow'],
-			['col_after', 'table_insert_col_after.gif', 'lang_table_col_after_desc', 'mceTableInsertColAfter'],
-			['col_before', 'table_insert_col_before.gif', 'lang_table_col_before_desc', 'mceTableInsertColBefore'],
-			['row_after', 'table_insert_row_after.gif', 'lang_table_row_after_desc', 'mceTableInsertRowAfter'],
-			['row_before', 'table_insert_row_before.gif', 'lang_table_row_before_desc', 'mceTableInsertRowBefore'],
-			['row_props', 'table_row_props.gif', 'lang_table_row_desc', 'mceTableRowProps', true],
-			['cell_props', 'table_cell_props.gif', 'lang_table_cell_desc', 'mceTableCellProps', true],
-			['split_cells', 'table_split_cells.gif', 'lang_table_split_cells_desc', 'mceTableSplitCells', true],
-			['merge_cells', 'table_merge_cells.gif', 'lang_table_merge_cells_desc', 'mceTableMergeCells', true]);
-
-		// Render table control
-		for (var i=0; i<controls.length; i++) {
-			var but = controls[i];
-			var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'' + but[3] + '\', ' + (but.length > 4 ? but[4] : false) + (but.length > 5 ? ', \'' + but[5] + '\'' : '') + ');return false;';
-
-			if (but[0] == control_name)
-				return tinyMCE.getButtonHTML(control_name, but[2], '{$pluginurl}/images/'+ but[1], but[3], (but.length > 4 ? but[4] : false));
-		}
-
-		// Special tablecontrols
-		if (control_name == "tablecontrols") {
-			var html = "";
-
-			html += tinyMCE.getControlHTML("table");
-			html += tinyMCE.getControlHTML("separator");
-			html += tinyMCE.getControlHTML("row_props");
-			html += tinyMCE.getControlHTML("cell_props");
-			html += tinyMCE.getControlHTML("separator");
-			html += tinyMCE.getControlHTML("row_before");
-			html += tinyMCE.getControlHTML("row_after");
-			html += tinyMCE.getControlHTML("delete_row");
-			html += tinyMCE.getControlHTML("separator");
-			html += tinyMCE.getControlHTML("col_before");
-			html += tinyMCE.getControlHTML("col_after");
-			html += tinyMCE.getControlHTML("delete_col");
-			html += tinyMCE.getControlHTML("separator");
-			html += tinyMCE.getControlHTML("split_cells");
-			html += tinyMCE.getControlHTML("merge_cells");
-
-			return html;
-		}
-
-		return "";
-	},
-
-	/**
-	 * Executes the table commands.
-	 */
-	execCommand : function(editor_id, element, command, user_interface, value) {
-		// Is table command
-		switch (command) {
-			case "mceInsertTable":
-			case "mceTableRowProps":
-			case "mceTableCellProps":
-			case "mceTableSplitCells":
-			case "mceTableMergeCells":
-			case "mceTableInsertRowBefore":
-			case "mceTableInsertRowAfter":
-			case "mceTableDeleteRow":
-			case "mceTableInsertColBefore":
-			case "mceTableInsertColAfter":
-			case "mceTableDeleteCol":
-			case "mceTableCutRow":
-			case "mceTableCopyRow":
-			case "mceTablePasteRowBefore":
-			case "mceTablePasteRowAfter":
-			case "mceTableDelete":
-				var inst = tinyMCE.getInstanceById(editor_id);
-
-				inst.execCommand('mceBeginUndoLevel');
-				TinyMCE_TablePlugin._doExecCommand(editor_id, element, command, user_interface, value);
-				inst.execCommand('mceEndUndoLevel');
-
-				return true;
-		}
-
-		// Pass to next handler in chain
-		return false;
-	},
-
-	handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
-		var colspan = "1", rowspan = "1", tdElm;
-
-		var inst = tinyMCE.getInstanceById(editor_id);
-
-		// Reset table controls
-		tinyMCE.switchClass(editor_id + '_table', 'mceButtonNormal');
-		tinyMCE.switchClass(editor_id + '_delete_table', 'mceButtonDisabled');
-		tinyMCE.switchClass(editor_id + '_row_props', 'mceButtonDisabled');
-		tinyMCE.switchClass(editor_id + '_cell_props', 'mceButtonDisabled');
-		tinyMCE.switchClass(editor_id + '_row_before', 'mceButtonDisabled');
-		tinyMCE.switchClass(editor_id + '_row_after', 'mceButtonDisabled');
-		tinyMCE.switchClass(editor_id + '_delete_row', 'mceButtonDisabled');
-		tinyMCE.switchClass(editor_id + '_col_before', 'mceButtonDisabled');
-		tinyMCE.switchClass(editor_id + '_col_after', 'mceButtonDisabled');
-		tinyMCE.switchClass(editor_id + '_delete_col', 'mceButtonDisabled');
-		tinyMCE.switchClass(editor_id + '_split_cells', 'mceButtonDisabled');
-		tinyMCE.switchClass(editor_id + '_merge_cells', 'mceButtonDisabled');
-
-		// Within a td element
-		if (tdElm = tinyMCE.getParentElement(node, "td,th")) {
-			tinyMCE.switchClass(editor_id + '_cell_props', 'mceButtonSelected');
-			tinyMCE.switchClass(editor_id + '_delete_table', 'mceButtonNormal');
-			tinyMCE.switchClass(editor_id + '_row_before', 'mceButtonNormal');
-			tinyMCE.switchClass(editor_id + '_row_after', 'mceButtonNormal');
-			tinyMCE.switchClass(editor_id + '_delete_row', 'mceButtonNormal');
-			tinyMCE.switchClass(editor_id + '_col_before', 'mceButtonNormal');
-			tinyMCE.switchClass(editor_id + '_col_after', 'mceButtonNormal');
-			tinyMCE.switchClass(editor_id + '_delete_col', 'mceButtonNormal');
-
-			colspan = tinyMCE.getAttrib(tdElm, "colspan");
-			rowspan = tinyMCE.getAttrib(tdElm, "rowspan");
-
-			colspan = colspan == "" ? "1" : colspan;
-			rowspan = rowspan == "" ? "1" : rowspan;
-
-			if (colspan != "1" || rowspan != "1")
-				tinyMCE.switchClass(editor_id + '_split_cells', 'mceButtonNormal');
-		}
-
-		// Within a tr element
-		if (tinyMCE.getParentElement(node, "tr"))
-			tinyMCE.switchClass(editor_id + '_row_props', 'mceButtonSelected');
-
-		// Within table
-		if (tinyMCE.getParentElement(node, "table")) {
-			tinyMCE.switchClass(editor_id + '_table', 'mceButtonSelected');
-			tinyMCE.switchClass(editor_id + '_merge_cells', 'mceButtonNormal');
-		}
-	},
-
-	// Private plugin internal methods
-
-	_mouseDownHandler : function(e) {
-		var elm = tinyMCE.isMSIE ? event.srcElement : e.target;
-		var focusElm = tinyMCE.selectedInstance.getFocusElement();
-
-		// If press on special Mozilla create TD/TR thingie
-		if (elm.nodeName == "BODY" && (focusElm.nodeName == "TD" || focusElm.nodeName == "TH" || (focusElm.parentNode && focusElm.parentNode.nodeName == "TD") ||(focusElm.parentNode && focusElm.parentNode.nodeName == "TH") )) {
-			window.setTimeout(function() {
-				var tableElm = tinyMCE.getParentElement(focusElm, "table");
-				tinyMCE.handleVisualAid(tableElm, true, tinyMCE.settings['visual'], tinyMCE.selectedInstance);
-			}, 10);
-		}
-	},
-
-	/**
-	 * Executes the table commands.
-	 */
-	_doExecCommand : function(editor_id, element, command, user_interface, value) {
-		var inst = tinyMCE.getInstanceById(editor_id);
-		var focusElm = inst.getFocusElement();
-		var trElm = tinyMCE.getParentElement(focusElm, "tr");
-		var tdElm = tinyMCE.getParentElement(focusElm, "td,th");
-		var tableElm = tinyMCE.getParentElement(focusElm, "table");
-		var doc = inst.contentWindow.document;
-		var tableBorder = tableElm ? tableElm.getAttribute("border") : "";
-
-		// Get first TD if no TD found
-		if (trElm && tdElm == null)
-			tdElm = trElm.cells[0];
-
-		// ------- Inner functions ---------
-		function inArray(ar, v) {
-			for (var i=0; i<ar.length; i++) {
-				// Is array
-				if (ar[i].length > 0 && inArray(ar[i], v))
-					return true;
-
-				// Found value
-				if (ar[i] == v)
-					return true;
-			}
-
-			return false;
-		}
-
-		function makeTD() {
-			var newTD = doc.createElement("td");
-			newTD.innerHTML = " ";
-		}
-
-		function getColRowSpan(td) {
-			var colspan = tinyMCE.getAttrib(td, "colspan");
-			var rowspan = tinyMCE.getAttrib(td, "rowspan");
-
-			colspan = colspan == "" ? 1 : parseInt(colspan);
-			rowspan = rowspan == "" ? 1 : parseInt(rowspan);
-
-			return {colspan : colspan, rowspan : rowspan};
-		}
-
-		function getCellPos(grid, td) {
-			var x, y;
-
-			for (y=0; y<grid.length; y++) {
-				for (x=0; x<grid[y].length; x++) {
-					if (grid[y][x] == td)
-						return {cellindex : x, rowindex : y};
-				}
-			}
-
-			return null;
-		}
-
-		function getCell(grid, row, col) {
-			if (grid[row] && grid[row][col])
-				return grid[row][col];
-
-			return null;
-		}
-
-		function getTableGrid(table) {
-			var grid = new Array(), rows = table.rows, x, y, td, sd, xstart, x2, y2;
-
-			for (y=0; y<rows.length; y++) {
-				for (x=0; x<rows[y].cells.length; x++) {
-					td = rows[y].cells[x];
-					sd = getColRowSpan(td);
-
-					// All ready filled
-					for (xstart = x; grid[y] && grid[y][xstart]; xstart++) ;
-
-					// Fill box
-					for (y2=y; y2<y+sd['rowspan']; y2++) {
-						if (!grid[y2])
-							grid[y2] = new Array();
-
-						for (x2=xstart; x2<xstart+sd['colspan']; x2++)
-							grid[y2][x2] = td;
-					}
-				}
-			}
-
-			return grid;
-		}
-
-		function trimRow(table, tr, td, new_tr) {
-			var grid = getTableGrid(table), cpos = getCellPos(grid, td);
-			var cells, lastElm;
-
-			// Time to crop away some
-			if (new_tr.cells.length != tr.childNodes.length) {
-				cells = tr.childNodes;
-				lastElm = null;
-
-				for (var x=0; td = getCell(grid, cpos.rowindex, x); x++) {
-					var remove = true;
-					var sd = getColRowSpan(td);
-
-					// Remove due to rowspan
-					if (inArray(cells, td)) {
-						new_tr.childNodes[x]._delete = true;
-					} else if ((lastElm == null || td != lastElm) && sd.colspan > 1) { // Remove due to colspan
-						for (var i=x; i<x+td.colSpan; i++)
-							new_tr.childNodes[i]._delete = true;
-					}
-
-					if ((lastElm == null || td != lastElm) && sd.rowspan > 1)
-						td.rowSpan = sd.rowspan + 1;
-
-					lastElm = td;
-				}
-
-				deleteMarked(tableElm);
-			}
-		}
-
-		function prevElm(node, name) {
-			while ((node = node.previousSibling) != null) {
-				if (node.nodeName == name)
-					return node;
-			}
-
-			return null;
-		}
-
-		function nextElm(node, names) {
-			var namesAr = names.split(',');
-
-			while ((node = node.nextSibling) != null) {
-				for (var i=0; i<namesAr.length; i++) {
-					if (node.nodeName.toLowerCase() == namesAr[i].toLowerCase() )
-						return node;
-				}
-			}
-
-			return null;
-		}
-
-		function deleteMarked(tbl) {
-			if (tbl.rows == 0)
-				return;
-
-			var tr = tbl.rows[0];
-			do {
-				var next = nextElm(tr, "TR");
-
-				// Delete row
-				if (tr._delete) {
-					tr.parentNode.removeChild(tr);
-					continue;
-				}
-
-				// Delete cells
-				var td = tr.cells[0];
-				if (td.cells > 1) {
-					do {
-						var nexttd = nextElm(td, "TD,TH");
-
-						if (td._delete)
-							td.parentNode.removeChild(td);
-					} while ((td = nexttd) != null);
-				}
-			} while ((tr = next) != null);
-		}
-
-		function addRows(td_elm, tr_elm, rowspan) {
-			// Add rows
-			td_elm.rowSpan = 1;
-			var trNext = nextElm(tr_elm, "TR");
-			for (var i=1; i<rowspan && trNext; i++) {
-				var newTD = doc.createElement("td");
-				newTD.innerHTML = " ";
-
-				if (tinyMCE.isMSIE)
-					trNext.insertBefore(newTD, trNext.cells(td_elm.cellIndex));
-				else
-					trNext.insertBefore(newTD, trNext.cells[td_elm.cellIndex]);
-
-				trNext = nextElm(trNext, "TR");
-			}
-		}
-
-		function copyRow(doc, table, tr) {
-			var grid = getTableGrid(table);
-			var newTR = tr.cloneNode(false);
-			var cpos = getCellPos(grid, tr.cells[0]);
-			var lastCell = null;
-			var tableBorder = tinyMCE.getAttrib(table, "border");
-			var tdElm = null;
-
-			for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
-				var newTD = null;
-
-				if (lastCell != tdElm) {
-					for (var i=0; i<tr.cells.length; i++) {
-						if (tdElm == tr.cells[i]) {
-							newTD = tdElm.cloneNode(true);
-							break;
-						}
-					}
-				}
-
-				if (newTD == null) {
-					newTD = doc.createElement("td");
-					newTD.innerHTML = " ";
-				}
-
-				// Reset col/row span
-				newTD.colSpan = 1;
-				newTD.rowSpan = 1;
-
-				newTR.appendChild(newTD);
-
-				lastCell = tdElm;
-			}
-
-			return newTR;
-		}
-
-		// ---- Commands -----
-
-		// Handle commands
-		switch (command) {
-			case "mceTableRowProps":
-				if (trElm == null)
-					return true;
-
-				if (user_interface) {
-					// Setup template
-					var template = new Array();
-
-					template['file'] = '../../plugins/table/row.htm';
-					template['width'] = 380;
-					template['height'] = 295;
-
-					// Language specific width and height addons
-					template['width'] += tinyMCE.getLang('lang_table_rowprops_delta_width', 0);
-					template['height'] += tinyMCE.getLang('lang_table_rowprops_delta_height', 0);
-
-					// Open window
-					tinyMCE.openWindow(template, {editor_id : inst.editorId, inline : "yes"});
-				}
-
-				return true;
-
-			case "mceTableCellProps":
-				if (tdElm == null)
-					return true;
-
-				if (user_interface) {
-					// Setup template
-					var template = new Array();
-
-					template['file'] = '../../plugins/table/cell.htm';
-					template['width'] = 380;
-					template['height'] = 295;
-
-					// Language specific width and height addons
-					template['width'] += tinyMCE.getLang('lang_table_cellprops_delta_width', 0);
-					template['height'] += tinyMCE.getLang('lang_table_cellprops_delta_height', 0);
-
-					// Open window
-					tinyMCE.openWindow(template, {editor_id : inst.editorId, inline : "yes"});
-				}
-
-				return true;
-
-			case "mceInsertTable":
-				if (user_interface) {
-					// Setup template
-					var template = new Array();
-
-					template['file'] = '../../plugins/table/table.htm';
-					template['width'] = 380;
-					template['height'] = 295;
-
-					// Language specific width and height addons
-					template['width'] += tinyMCE.getLang('lang_table_table_delta_width', 0);
-					template['height'] += tinyMCE.getLang('lang_table_table_delta_height', 0);
-
-					// Open window
-					tinyMCE.openWindow(template, {editor_id : inst.editorId, inline : "yes", action : value});
-				}
-
-				return true;
-
-			case "mceTableDelete":
-				var table = tinyMCE.getParentElement(inst.getFocusElement(), "table");
-				if (table) {
-					table.parentNode.removeChild(table);
-					inst.repaint();
-				}
-				return true;
-
-			case "mceTableSplitCells":
-			case "mceTableMergeCells":
-			case "mceTableInsertRowBefore":
-			case "mceTableInsertRowAfter":
-			case "mceTableDeleteRow":
-			case "mceTableInsertColBefore":
-			case "mceTableInsertColAfter":
-			case "mceTableDeleteCol":
-			case "mceTableCutRow":
-			case "mceTableCopyRow":
-			case "mceTablePasteRowBefore":
-			case "mceTablePasteRowAfter":
-				// No table just return (invalid command)
-				if (!tableElm)
-					return true;
-
-				// Table has a tbody use that reference
-				// Changed logic by ApTest 2005.07.12 (www.aptest.com)
-				// Now lookk at the focused element and take its parentNode.  That will be a tbody or a table.
-				if (trElm && tableElm != trElm.parentNode)
-					tableElm = trElm.parentNode;
-
-				if (tableElm && trElm) {
-					switch (command) {
-						case "mceTableCutRow":
-							if (!trElm || !tdElm)
-								return true;
-
-							inst.tableRowClipboard = copyRow(doc, tableElm, trElm);
-							inst.execCommand("mceTableDeleteRow");
-							break;
-
-						case "mceTableCopyRow":
-							if (!trElm || !tdElm)
-								return true;
-
-							inst.tableRowClipboard = copyRow(doc, tableElm, trElm);
-							break;
-
-						case "mceTablePasteRowBefore":
-							if (!trElm || !tdElm)
-								return true;
-
-							var newTR = inst.tableRowClipboard.cloneNode(true);
-
-							var prevTR = prevElm(trElm, "TR");
-							if (prevTR != null)
-								trimRow(tableElm, prevTR, prevTR.cells[0], newTR);
-
-							trElm.parentNode.insertBefore(newTR, trElm);
-							break;
-
-						case "mceTablePasteRowAfter":
-							if (!trElm || !tdElm)
-								return true;
-							
-							var nextTR = nextElm(trElm, "TR");
-							var newTR = inst.tableRowClipboard.cloneNode(true);
-
-							trimRow(tableElm, trElm, tdElm, newTR);
-
-							if (nextTR == null)
-								trElm.parentNode.appendChild(newTR);
-							else
-								nextTR.parentNode.insertBefore(newTR, nextTR);
-
-							break;
-
-						case "mceTableInsertRowBefore":
-							if (!trElm || !tdElm)
-								return true;
-
-							var grid = getTableGrid(tableElm);
-							var cpos = getCellPos(grid, tdElm);
-							var newTR = doc.createElement("tr");
-							var lastTDElm = null;
-
-							cpos.rowindex--;
-							if (cpos.rowindex < 0)
-								cpos.rowindex = 0;
-
-							// Create cells
-							for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
-								if (tdElm != lastTDElm) {
-									var sd = getColRowSpan(tdElm);
-
-									if (sd['rowspan'] == 1) {
-										var newTD = doc.createElement("td");
-
-										newTD.innerHTML = " ";
-										newTD.colSpan = tdElm.colSpan;
-
-										newTR.appendChild(newTD);
-									} else
-										tdElm.rowSpan = sd['rowspan'] + 1;
-
-									lastTDElm = tdElm;
-								}
-							}
-
-							trElm.parentNode.insertBefore(newTR, trElm);
-
-							grid = getTableGrid(tableElm);
-							inst.selection.selectNode(getCell(grid, cpos.rowindex + 1, cpos.cellindex), tinyMCE.isGecko, true); // Only collape on gecko
-						break;
-
-						case "mceTableInsertRowAfter":
-							if (!trElm || !tdElm)
-								return true;
-
-							var grid = getTableGrid(tableElm);
-							var cpos = getCellPos(grid, tdElm);
-							var newTR = doc.createElement("tr");
-							var lastTDElm = null;
-
-							// Create cells
-							for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
-								if (tdElm != lastTDElm) {
-									var sd = getColRowSpan(tdElm);
-
-									if (sd['rowspan'] == 1) {
-										var newTD = doc.createElement("td");
-
-										newTD.innerHTML = " ";
-										newTD.colSpan = tdElm.colSpan;
-
-										newTR.appendChild(newTD);
-									} else
-										tdElm.rowSpan = sd['rowspan'] + 1;
-
-									lastTDElm = tdElm;
-								}
-							}
-
-							if (newTR.hasChildNodes()) {
-								var nextTR = nextElm(trElm, "TR");
-								if (nextTR)
-									nextTR.parentNode.insertBefore(newTR, nextTR);
-								else
-									tableElm.appendChild(newTR);
-							}
-
-							grid = getTableGrid(tableElm);
-							inst.selection.selectNode(getCell(grid, cpos.rowindex, cpos.cellindex), tinyMCE.isGecko, true); // Only collape on gecko
-						break;
-
-						case "mceTableDeleteRow":
-							if (!trElm || !tdElm)
-								return true;
-
-							var grid = getTableGrid(tableElm);
-							var cpos = getCellPos(grid, tdElm);
-
-							// Only one row, remove whole table
-							if (grid.length == 1) {
-								tableElm = tinyMCE.getParentElement(tableElm, "table"); // Look for table instead of tbody
-								tableElm.parentNode.removeChild(tableElm);
-								return true;
-							}
-
-							// Move down row spanned cells
-							var cells = trElm.cells;
-							var nextTR = nextElm(trElm, "TR");
-							for (var x=0; x<cells.length; x++) {
-								if (cells[x].rowSpan > 1) {
-									var newTD = cells[x].cloneNode(true);
-									var sd = getColRowSpan(cells[x]);
-
-									newTD.rowSpan = sd.rowspan - 1;
-
-									var nextTD = nextTR.cells[x];
-
-									if (nextTD == null)
-										nextTR.appendChild(newTD);
-									else
-										nextTR.insertBefore(newTD, nextTD);
-								}
-							}
-
-							// Delete cells
-							var lastTDElm = null;
-							for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
-								if (tdElm != lastTDElm) {
-									var sd = getColRowSpan(tdElm);
-
-									if (sd.rowspan > 1) {
-										tdElm.rowSpan = sd.rowspan - 1;
-									} else {
-										trElm = tdElm.parentNode;
-
-										if (trElm.parentNode)
-											trElm._delete = true;
-									}
-
-									lastTDElm = tdElm;
-								}
-							}
-
-							deleteMarked(tableElm);
-
-							cpos.rowindex--;
-							if (cpos.rowindex < 0)
-								cpos.rowindex = 0;
-
-							// Recalculate grid and select
-							grid = getTableGrid(tableElm);
-							inst.selection.selectNode(getCell(grid, cpos.rowindex, 0), tinyMCE.isGecko, true); // Only collape on gecko
-						break;
-
-						case "mceTableInsertColBefore":
-							if (!trElm || !tdElm)
-								return true;
-
-							var grid = getTableGrid(tableElm);
-							var cpos = getCellPos(grid, tdElm);
-							var lastTDElm = null;
-
-							for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) {
-								if (tdElm != lastTDElm) {
-									var sd = getColRowSpan(tdElm);
-
-									if (sd['colspan'] == 1) {
-										var newTD = doc.createElement(tdElm.nodeName);
-
-										newTD.innerHTML = " ";
-										newTD.rowSpan = tdElm.rowSpan;
-
-										tdElm.parentNode.insertBefore(newTD, tdElm);
-									} else
-										tdElm.colSpan++;
-
-									lastTDElm = tdElm;
-								}
-							}
-
-							grid = getTableGrid(tableElm);
-							inst.selection.selectNode(getCell(grid, cpos.rowindex, cpos.cellindex + 1), tinyMCE.isGecko, true); // Only collape on gecko
-						break;
-
-						case "mceTableInsertColAfter":
-							if (!trElm || !tdElm)
-								return true;
-
-							var grid = getTableGrid(tableElm);
-							var cpos = getCellPos(grid, tdElm);
-							var lastTDElm = null;
-
-							for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) {
-								if (tdElm != lastTDElm) {
-									var sd = getColRowSpan(tdElm);
-
-									if (sd['colspan'] == 1) {
-										var newTD = doc.createElement(tdElm.nodeName);
-
-										newTD.innerHTML = " ";
-										newTD.rowSpan = tdElm.rowSpan;
-
-										var nextTD = nextElm(tdElm, "TD,TH");
-										if (nextTD == null)
-											tdElm.parentNode.appendChild(newTD);
-										else
-											nextTD.parentNode.insertBefore(newTD, nextTD);
-									} else
-										tdElm.colSpan++;
-
-									lastTDElm = tdElm;
-								}
-							}
-
-							grid = getTableGrid(tableElm);
-							inst.selection.selectNode(getCell(grid, cpos.rowindex, cpos.cellindex), tinyMCE.isGecko, true); // Only collape on gecko
-						break;
-
-						case "mceTableDeleteCol":
-							if (!trElm || !tdElm)
-								return true;
-
-							var grid = getTableGrid(tableElm);
-							var cpos = getCellPos(grid, tdElm);
-							var lastTDElm = null;
-
-							// Only one col, remove whole table
-							if (grid.length > 1 && grid[0].length <= 1) {
-								tableElm = tinyMCE.getParentElement(tableElm, "table"); // Look for table instead of tbody
-								tableElm.parentNode.removeChild(tableElm);
-								return true;
-							}
-
-							// Delete cells
-							for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) {
-								if (tdElm != lastTDElm) {
-									var sd = getColRowSpan(tdElm);
-
-									if (sd['colspan'] > 1)
-										tdElm.colSpan = sd['colspan'] - 1;
-									else {
-										if (tdElm.parentNode)
-											tdElm.parentNode.removeChild(tdElm);
-									}
-
-									lastTDElm = tdElm;
-								}
-							}
-
-							cpos.cellindex--;
-							if (cpos.cellindex < 0)
-								cpos.cellindex = 0;
-
-							// Recalculate grid and select
-							grid = getTableGrid(tableElm);
-							inst.selection.selectNode(getCell(grid, cpos.rowindex, 0), tinyMCE.isGecko, true); // Only collape on gecko
-						break;
-
-					case "mceTableSplitCells":
-						if (!trElm || !tdElm)
-							return true;
-
-						var spandata = getColRowSpan(tdElm);
-
-						var colspan = spandata["colspan"];
-						var rowspan = spandata["rowspan"];
-
-						// Needs splitting
-						if (colspan > 1 || rowspan > 1) {
-							// Generate cols
-							tdElm.colSpan = 1;
-							for (var i=1; i<colspan; i++) {
-								var newTD = doc.createElement("td");
-
-								newTD.innerHTML = " ";
-
-								trElm.insertBefore(newTD, nextElm(tdElm, "TD,TH"));
-
-								if (rowspan > 1)
-									addRows(newTD, trElm, rowspan);
-							}
-
-							addRows(tdElm, trElm, rowspan);
-						}
-
-						// Apply visual aids
-						tableElm = tinyMCE.getParentElement(inst.getFocusElement(), "table");
-						break;
-
-					case "mceTableMergeCells":
-						var rows = new Array();
-						var sel = inst.getSel();
-						var grid = getTableGrid(tableElm);
-
-						if (tinyMCE.isMSIE || sel.rangeCount == 1) {
-							if (user_interface) {
-								// Setup template
-								var template = new Array();
-								var sp = getColRowSpan(tdElm);
-
-								template['file'] = '../../plugins/table/merge_cells.htm';
-								template['width'] = 250;
-								template['height'] = 105 + (tinyMCE.isNS7 ? 25 : 0);
-
-								// Language specific width and height addons
-								template['width'] += tinyMCE.getLang('lang_table_merge_cells_delta_width', 0);
-								template['height'] += tinyMCE.getLang('lang_table_merge_cells_delta_height', 0);
-
-								// Open window
-								tinyMCE.openWindow(template, {editor_id : inst.editorId, inline : "yes", action : "update", numcols : sp.colspan, numrows : sp.rowspan});
-
-								return true;
-							} else {
-								var numRows = parseInt(value['numrows']);
-								var numCols = parseInt(value['numcols']);
-								var cpos = getCellPos(grid, tdElm);
-
-								if (("" + numRows) == "NaN")
-									numRows = 1;
-
-								if (("" + numCols) == "NaN")
-									numCols = 1;
-
-								// Get rows and cells
-								var tRows = tableElm.rows;
-								for (var y=cpos.rowindex; y<grid.length; y++) {
-									var rowCells = new Array();
-
-									for (var x=cpos.cellindex; x<grid[y].length; x++) {
-										var td = getCell(grid, y, x);
-
-										if (td && !inArray(rows, td) && !inArray(rowCells, td)) {
-											var cp = getCellPos(grid, td);
-
-											// Within range
-											if (cp.cellindex < cpos.cellindex+numCols && cp.rowindex < cpos.rowindex+numRows)
-												rowCells[rowCells.length] = td;
-										}
-									}
-
-									if (rowCells.length > 0)
-										rows[rows.length] = rowCells;
-								}
-
-								//return true;
-							}
-						} else {
-							var cells = new Array();
-							var sel = inst.getSel();
-							var lastTR = null;
-							var curRow = null;
-							var x1 = -1, y1 = -1, x2, y2;
-
-							// Only one cell selected, whats the point?
-							if (sel.rangeCount < 2)
-								return true;
-
-							// Get all selected cells
-							for (var i=0; i<sel.rangeCount; i++) {
-								var rng = sel.getRangeAt(i);
-								var tdElm = rng.startContainer.childNodes[rng.startOffset];
-
-								if (!tdElm)
-									break;
-
-								if (tdElm.nodeName == "TD")
-									cells[cells.length] = tdElm;
-							}
-
-							// Get rows and cells
-							var tRows = tableElm.rows;
-							for (var y=0; y<tRows.length; y++) {
-								var rowCells = new Array();
-
-								for (var x=0; x<tRows[y].cells.length; x++) {
-									var td = tRows[y].cells[x];
-
-									for (var i=0; i<cells.length; i++) {
-										if (td == cells[i]) {
-											rowCells[rowCells.length] = td;
-										}
-									}
-								}
-
-								if (rowCells.length > 0)
-									rows[rows.length] = rowCells;
-							}
-
-							// Find selected cells in grid and box
-							var curRow = new Array();
-							var lastTR = null;
-							for (var y=0; y<grid.length; y++) {
-								for (var x=0; x<grid[y].length; x++) {
-									grid[y][x]._selected = false;
-
-									for (var i=0; i<cells.length; i++) {
-										if (grid[y][x] == cells[i]) {
-											// Get start pos
-											if (x1 == -1) {
-												x1 = x;
-												y1 = y;
-											}
-
-											// Get end pos
-											x2 = x;
-											y2 = y;
-
-											grid[y][x]._selected = true;
-										}
-									}
-								}
-							}
-
-							// Is there gaps, if so deny
-							for (var y=y1; y<=y2; y++) {
-								for (var x=x1; x<=x2; x++) {
-									if (!grid[y][x]._selected) {
-										alert("Invalid selection for merge.");
-										return true;
-									}
-								}
-							}
-						}
-
-						// Validate selection and get total rowspan and colspan
-						var rowSpan = 1, colSpan = 1;
-
-						// Validate horizontal and get total colspan
-						var lastRowSpan = -1;
-						for (var y=0; y<rows.length; y++) {
-							var rowColSpan = 0;
-
-							for (var x=0; x<rows[y].length; x++) {
-								var sd = getColRowSpan(rows[y][x]);
-
-								rowColSpan += sd['colspan'];
-
-								if (lastRowSpan != -1 && sd['rowspan'] != lastRowSpan) {
-									alert("Invalid selection for merge.");
-									return true;
-								}
-
-								lastRowSpan = sd['rowspan'];
-							}
-
-							if (rowColSpan > colSpan)
-								colSpan = rowColSpan;
-
-							lastRowSpan = -1;
-						}
-
-						// Validate vertical and get total rowspan
-						var lastColSpan = -1;
-						for (var x=0; x<rows[0].length; x++) {
-							var colRowSpan = 0;
-
-							for (var y=0; y<rows.length; y++) {
-								var sd = getColRowSpan(rows[y][x]);
-
-								colRowSpan += sd['rowspan'];
-
-								if (lastColSpan != -1 && sd['colspan'] != lastColSpan) {
-									alert("Invalid selection for merge.");
-									return true;
-								}
-
-								lastColSpan = sd['colspan'];
-							}
-
-							if (colRowSpan > rowSpan)
-								rowSpan = colRowSpan;
-
-							lastColSpan = -1;
-						}
-
-						// Setup td
-						tdElm = rows[0][0];
-						tdElm.rowSpan = rowSpan;
-						tdElm.colSpan = colSpan;
-
-						// Merge cells
-						for (var y=0; y<rows.length; y++) {
-							for (var x=0; x<rows[y].length; x++) {
-								var html = rows[y][x].innerHTML;
-								var chk = tinyMCE.regexpReplace(html, "[ \t\r\n]", "");
-
-								if (chk != "<br/>" && chk != "<br>" && chk != " " && (x+y > 0))
-									tdElm.innerHTML += html;
-
-								// Not current cell
-								if (rows[y][x] != tdElm && !rows[y][x]._deleted) {
-									var cpos = getCellPos(grid, rows[y][x]);
-									var tr = rows[y][x].parentNode;
-
-									tr.removeChild(rows[y][x]);
-									rows[y][x]._deleted = true;
-
-									// Empty TR, remove it
-									if (!tr.hasChildNodes()) {
-										tr.parentNode.removeChild(tr);
-
-										var lastCell = null;
-										for (var x=0; cellElm = getCell(grid, cpos.rowindex, x); x++) {
-											if (cellElm != lastCell && cellElm.rowSpan > 1)
-												cellElm.rowSpan--;
-
-											lastCell = cellElm;
-										}
-
-										if (tdElm.rowSpan > 1)
-											tdElm.rowSpan--;
-									}
-								}
-							}
-						}
-
-						break;
-					}
-
-					tableElm = tinyMCE.getParentElement(inst.getFocusElement(), "table");
-					tinyMCE.handleVisualAid(tableElm, true, tinyMCE.settings['visual'], tinyMCE.selectedInstance);
-					tinyMCE.triggerNodeChange();
-					inst.repaint();
-				}
-
-			return true;
-		}
-
-		// Pass to next handler in chain
-		return false;
-	}
-};
-
-tinyMCE.addPlugin("table", TinyMCE_TablePlugin);

Copied: plog/trunk/js/tinymce/plugins/table/editor_plugin_src.js (from rev 7165, plog/trunk/js/tinymce/plugins/table/editor_plugin_src.js)
===================================================================
--- plog/trunk/js/tinymce/plugins/table/editor_plugin_src.js	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/table/editor_plugin_src.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,1073 @@
+/**
+ * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
+ */
+
+/* Import plugin specific language pack */
+tinyMCE.importPluginLanguagePack('table');
+
+var TinyMCE_TablePlugin = {
+	getInfo : function() {
+		return {
+			longname : 'Tables',
+			author : 'Moxiecode Systems AB',
+			authorurl : 'http://tinymce.moxiecode.com',
+			infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/table',
+			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+		};
+	},
+
+	initInstance : function(inst) {
+		if (tinyMCE.isGecko) {
+			var doc = inst.getDoc();
+			tinyMCE.addEvent(doc, "mouseup", TinyMCE_TablePlugin._mouseDownHandler);
+		}
+
+		inst.tableRowClipboard = null;
+	},
+
+	/**
+	 * Returns the HTML contents of the table control.
+	 */
+	getControlHTML : function(control_name) {
+		var controls = new Array(
+			['table', 'table.gif', 'lang_table_desc', 'mceInsertTable', true],
+			['delete_table', 'table_delete.gif', 'lang_table_del', 'mceTableDelete'],
+			['delete_col', 'table_delete_col.gif', 'lang_table_delete_col_desc', 'mceTableDeleteCol'],
+			['delete_row', 'table_delete_row.gif', 'lang_table_delete_row_desc', 'mceTableDeleteRow'],
+			['col_after', 'table_insert_col_after.gif', 'lang_table_col_after_desc', 'mceTableInsertColAfter'],
+			['col_before', 'table_insert_col_before.gif', 'lang_table_col_before_desc', 'mceTableInsertColBefore'],
+			['row_after', 'table_insert_row_after.gif', 'lang_table_row_after_desc', 'mceTableInsertRowAfter'],
+			['row_before', 'table_insert_row_before.gif', 'lang_table_row_before_desc', 'mceTableInsertRowBefore'],
+			['row_props', 'table_row_props.gif', 'lang_table_row_desc', 'mceTableRowProps', true],
+			['cell_props', 'table_cell_props.gif', 'lang_table_cell_desc', 'mceTableCellProps', true],
+			['split_cells', 'table_split_cells.gif', 'lang_table_split_cells_desc', 'mceTableSplitCells', true],
+			['merge_cells', 'table_merge_cells.gif', 'lang_table_merge_cells_desc', 'mceTableMergeCells', true]);
+
+		// Render table control
+		for (var i=0; i<controls.length; i++) {
+			var but = controls[i];
+			var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'' + but[3] + '\', ' + (but.length > 4 ? but[4] : false) + (but.length > 5 ? ', \'' + but[5] + '\'' : '') + ');return false;';
+
+			if (but[0] == control_name)
+				return tinyMCE.getButtonHTML(control_name, but[2], '{$pluginurl}/images/'+ but[1], but[3], (but.length > 4 ? but[4] : false));
+		}
+
+		// Special tablecontrols
+		if (control_name == "tablecontrols") {
+			var html = "";
+
+			html += tinyMCE.getControlHTML("table");
+			html += tinyMCE.getControlHTML("separator");
+			html += tinyMCE.getControlHTML("row_props");
+			html += tinyMCE.getControlHTML("cell_props");
+			html += tinyMCE.getControlHTML("separator");
+			html += tinyMCE.getControlHTML("row_before");
+			html += tinyMCE.getControlHTML("row_after");
+			html += tinyMCE.getControlHTML("delete_row");
+			html += tinyMCE.getControlHTML("separator");
+			html += tinyMCE.getControlHTML("col_before");
+			html += tinyMCE.getControlHTML("col_after");
+			html += tinyMCE.getControlHTML("delete_col");
+			html += tinyMCE.getControlHTML("separator");
+			html += tinyMCE.getControlHTML("split_cells");
+			html += tinyMCE.getControlHTML("merge_cells");
+
+			return html;
+		}
+
+		return "";
+	},
+
+	/**
+	 * Executes the table commands.
+	 */
+	execCommand : function(editor_id, element, command, user_interface, value) {
+		// Is table command
+		switch (command) {
+			case "mceInsertTable":
+			case "mceTableRowProps":
+			case "mceTableCellProps":
+			case "mceTableSplitCells":
+			case "mceTableMergeCells":
+			case "mceTableInsertRowBefore":
+			case "mceTableInsertRowAfter":
+			case "mceTableDeleteRow":
+			case "mceTableInsertColBefore":
+			case "mceTableInsertColAfter":
+			case "mceTableDeleteCol":
+			case "mceTableCutRow":
+			case "mceTableCopyRow":
+			case "mceTablePasteRowBefore":
+			case "mceTablePasteRowAfter":
+			case "mceTableDelete":
+				var inst = tinyMCE.getInstanceById(editor_id);
+
+				inst.execCommand('mceBeginUndoLevel');
+				TinyMCE_TablePlugin._doExecCommand(editor_id, element, command, user_interface, value);
+				inst.execCommand('mceEndUndoLevel');
+
+				return true;
+		}
+
+		// Pass to next handler in chain
+		return false;
+	},
+
+	handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
+		var colspan = "1", rowspan = "1", tdElm;
+
+		var inst = tinyMCE.getInstanceById(editor_id);
+
+		// Reset table controls
+		tinyMCE.switchClass(editor_id + '_table', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_delete_table', 'mceButtonDisabled');
+		tinyMCE.switchClass(editor_id + '_row_props', 'mceButtonDisabled');
+		tinyMCE.switchClass(editor_id + '_cell_props', 'mceButtonDisabled');
+		tinyMCE.switchClass(editor_id + '_row_before', 'mceButtonDisabled');
+		tinyMCE.switchClass(editor_id + '_row_after', 'mceButtonDisabled');
+		tinyMCE.switchClass(editor_id + '_delete_row', 'mceButtonDisabled');
+		tinyMCE.switchClass(editor_id + '_col_before', 'mceButtonDisabled');
+		tinyMCE.switchClass(editor_id + '_col_after', 'mceButtonDisabled');
+		tinyMCE.switchClass(editor_id + '_delete_col', 'mceButtonDisabled');
+		tinyMCE.switchClass(editor_id + '_split_cells', 'mceButtonDisabled');
+		tinyMCE.switchClass(editor_id + '_merge_cells', 'mceButtonDisabled');
+
+		// Within a td element
+		if (tdElm = tinyMCE.getParentElement(node, "td,th")) {
+			tinyMCE.switchClass(editor_id + '_cell_props', 'mceButtonSelected');
+			tinyMCE.switchClass(editor_id + '_delete_table', 'mceButtonNormal');
+			tinyMCE.switchClass(editor_id + '_row_before', 'mceButtonNormal');
+			tinyMCE.switchClass(editor_id + '_row_after', 'mceButtonNormal');
+			tinyMCE.switchClass(editor_id + '_delete_row', 'mceButtonNormal');
+			tinyMCE.switchClass(editor_id + '_col_before', 'mceButtonNormal');
+			tinyMCE.switchClass(editor_id + '_col_after', 'mceButtonNormal');
+			tinyMCE.switchClass(editor_id + '_delete_col', 'mceButtonNormal');
+
+			colspan = tinyMCE.getAttrib(tdElm, "colspan");
+			rowspan = tinyMCE.getAttrib(tdElm, "rowspan");
+
+			colspan = colspan == "" ? "1" : colspan;
+			rowspan = rowspan == "" ? "1" : rowspan;
+
+			if (colspan != "1" || rowspan != "1")
+				tinyMCE.switchClass(editor_id + '_split_cells', 'mceButtonNormal');
+		}
+
+		// Within a tr element
+		if (tinyMCE.getParentElement(node, "tr"))
+			tinyMCE.switchClass(editor_id + '_row_props', 'mceButtonSelected');
+
+		// Within table
+		if (tinyMCE.getParentElement(node, "table")) {
+			tinyMCE.switchClass(editor_id + '_table', 'mceButtonSelected');
+			tinyMCE.switchClass(editor_id + '_merge_cells', 'mceButtonNormal');
+		}
+	},
+
+	// Private plugin internal methods
+
+	_mouseDownHandler : function(e) {
+		var elm = tinyMCE.isMSIE ? event.srcElement : e.target;
+		var focusElm = tinyMCE.selectedInstance.getFocusElement();
+
+		// If press on special Mozilla create TD/TR thingie
+		if (elm.nodeName == "BODY" && (focusElm.nodeName == "TD" || focusElm.nodeName == "TH" || (focusElm.parentNode && focusElm.parentNode.nodeName == "TD") ||(focusElm.parentNode && focusElm.parentNode.nodeName == "TH") )) {
+			window.setTimeout(function() {
+				var tableElm = tinyMCE.getParentElement(focusElm, "table");
+				tinyMCE.handleVisualAid(tableElm, true, tinyMCE.settings['visual'], tinyMCE.selectedInstance);
+			}, 10);
+		}
+	},
+
+	/**
+	 * Executes the table commands.
+	 */
+	_doExecCommand : function(editor_id, element, command, user_interface, value) {
+		var inst = tinyMCE.getInstanceById(editor_id);
+		var focusElm = inst.getFocusElement();
+		var trElm = tinyMCE.getParentElement(focusElm, "tr");
+		var tdElm = tinyMCE.getParentElement(focusElm, "td,th");
+		var tableElm = tinyMCE.getParentElement(focusElm, "table");
+		var doc = inst.contentWindow.document;
+		var tableBorder = tableElm ? tableElm.getAttribute("border") : "";
+
+		// Get first TD if no TD found
+		if (trElm && tdElm == null)
+			tdElm = trElm.cells[0];
+
+		// ------- Inner functions ---------
+		function inArray(ar, v) {
+			for (var i=0; i<ar.length; i++) {
+				// Is array
+				if (ar[i].length > 0 && inArray(ar[i], v))
+					return true;
+
+				// Found value
+				if (ar[i] == v)
+					return true;
+			}
+
+			return false;
+		}
+
+		function makeTD() {
+			var newTD = doc.createElement("td");
+			newTD.innerHTML = " ";
+		}
+
+		function getColRowSpan(td) {
+			var colspan = tinyMCE.getAttrib(td, "colspan");
+			var rowspan = tinyMCE.getAttrib(td, "rowspan");
+
+			colspan = colspan == "" ? 1 : parseInt(colspan);
+			rowspan = rowspan == "" ? 1 : parseInt(rowspan);
+
+			return {colspan : colspan, rowspan : rowspan};
+		}
+
+		function getCellPos(grid, td) {
+			var x, y;
+
+			for (y=0; y<grid.length; y++) {
+				for (x=0; x<grid[y].length; x++) {
+					if (grid[y][x] == td)
+						return {cellindex : x, rowindex : y};
+				}
+			}
+
+			return null;
+		}
+
+		function getCell(grid, row, col) {
+			if (grid[row] && grid[row][col])
+				return grid[row][col];
+
+			return null;
+		}
+
+		function getTableGrid(table) {
+			var grid = new Array(), rows = table.rows, x, y, td, sd, xstart, x2, y2;
+
+			for (y=0; y<rows.length; y++) {
+				for (x=0; x<rows[y].cells.length; x++) {
+					td = rows[y].cells[x];
+					sd = getColRowSpan(td);
+
+					// All ready filled
+					for (xstart = x; grid[y] && grid[y][xstart]; xstart++) ;
+
+					// Fill box
+					for (y2=y; y2<y+sd['rowspan']; y2++) {
+						if (!grid[y2])
+							grid[y2] = new Array();
+
+						for (x2=xstart; x2<xstart+sd['colspan']; x2++)
+							grid[y2][x2] = td;
+					}
+				}
+			}
+
+			return grid;
+		}
+
+		function trimRow(table, tr, td, new_tr) {
+			var grid = getTableGrid(table), cpos = getCellPos(grid, td);
+			var cells, lastElm;
+
+			// Time to crop away some
+			if (new_tr.cells.length != tr.childNodes.length) {
+				cells = tr.childNodes;
+				lastElm = null;
+
+				for (var x=0; td = getCell(grid, cpos.rowindex, x); x++) {
+					var remove = true;
+					var sd = getColRowSpan(td);
+
+					// Remove due to rowspan
+					if (inArray(cells, td)) {
+						new_tr.childNodes[x]._delete = true;
+					} else if ((lastElm == null || td != lastElm) && sd.colspan > 1) { // Remove due to colspan
+						for (var i=x; i<x+td.colSpan; i++)
+							new_tr.childNodes[i]._delete = true;
+					}
+
+					if ((lastElm == null || td != lastElm) && sd.rowspan > 1)
+						td.rowSpan = sd.rowspan + 1;
+
+					lastElm = td;
+				}
+
+				deleteMarked(tableElm);
+			}
+		}
+
+		function prevElm(node, name) {
+			while ((node = node.previousSibling) != null) {
+				if (node.nodeName == name)
+					return node;
+			}
+
+			return null;
+		}
+
+		function nextElm(node, names) {
+			var namesAr = names.split(',');
+
+			while ((node = node.nextSibling) != null) {
+				for (var i=0; i<namesAr.length; i++) {
+					if (node.nodeName.toLowerCase() == namesAr[i].toLowerCase() )
+						return node;
+				}
+			}
+
+			return null;
+		}
+
+		function deleteMarked(tbl) {
+			if (tbl.rows == 0)
+				return;
+
+			var tr = tbl.rows[0];
+			do {
+				var next = nextElm(tr, "TR");
+
+				// Delete row
+				if (tr._delete) {
+					tr.parentNode.removeChild(tr);
+					continue;
+				}
+
+				// Delete cells
+				var td = tr.cells[0];
+				if (td.cells > 1) {
+					do {
+						var nexttd = nextElm(td, "TD,TH");
+
+						if (td._delete)
+							td.parentNode.removeChild(td);
+					} while ((td = nexttd) != null);
+				}
+			} while ((tr = next) != null);
+		}
+
+		function addRows(td_elm, tr_elm, rowspan) {
+			// Add rows
+			td_elm.rowSpan = 1;
+			var trNext = nextElm(tr_elm, "TR");
+			for (var i=1; i<rowspan && trNext; i++) {
+				var newTD = doc.createElement("td");
+				newTD.innerHTML = " ";
+
+				if (tinyMCE.isMSIE)
+					trNext.insertBefore(newTD, trNext.cells(td_elm.cellIndex));
+				else
+					trNext.insertBefore(newTD, trNext.cells[td_elm.cellIndex]);
+
+				trNext = nextElm(trNext, "TR");
+			}
+		}
+
+		function copyRow(doc, table, tr) {
+			var grid = getTableGrid(table);
+			var newTR = tr.cloneNode(false);
+			var cpos = getCellPos(grid, tr.cells[0]);
+			var lastCell = null;
+			var tableBorder = tinyMCE.getAttrib(table, "border");
+			var tdElm = null;
+
+			for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
+				var newTD = null;
+
+				if (lastCell != tdElm) {
+					for (var i=0; i<tr.cells.length; i++) {
+						if (tdElm == tr.cells[i]) {
+							newTD = tdElm.cloneNode(true);
+							break;
+						}
+					}
+				}
+
+				if (newTD == null) {
+					newTD = doc.createElement("td");
+					newTD.innerHTML = " ";
+				}
+
+				// Reset col/row span
+				newTD.colSpan = 1;
+				newTD.rowSpan = 1;
+
+				newTR.appendChild(newTD);
+
+				lastCell = tdElm;
+			}
+
+			return newTR;
+		}
+
+		// ---- Commands -----
+
+		// Handle commands
+		switch (command) {
+			case "mceTableRowProps":
+				if (trElm == null)
+					return true;
+
+				if (user_interface) {
+					// Setup template
+					var template = new Array();
+
+					template['file'] = '../../plugins/table/row.htm';
+					template['width'] = 380;
+					template['height'] = 295;
+
+					// Language specific width and height addons
+					template['width'] += tinyMCE.getLang('lang_table_rowprops_delta_width', 0);
+					template['height'] += tinyMCE.getLang('lang_table_rowprops_delta_height', 0);
+
+					// Open window
+					tinyMCE.openWindow(template, {editor_id : inst.editorId, inline : "yes"});
+				}
+
+				return true;
+
+			case "mceTableCellProps":
+				if (tdElm == null)
+					return true;
+
+				if (user_interface) {
+					// Setup template
+					var template = new Array();
+
+					template['file'] = '../../plugins/table/cell.htm';
+					template['width'] = 380;
+					template['height'] = 295;
+
+					// Language specific width and height addons
+					template['width'] += tinyMCE.getLang('lang_table_cellprops_delta_width', 0);
+					template['height'] += tinyMCE.getLang('lang_table_cellprops_delta_height', 0);
+
+					// Open window
+					tinyMCE.openWindow(template, {editor_id : inst.editorId, inline : "yes"});
+				}
+
+				return true;
+
+			case "mceInsertTable":
+				if (user_interface) {
+					// Setup template
+					var template = new Array();
+
+					template['file'] = '../../plugins/table/table.htm';
+					template['width'] = 380;
+					template['height'] = 295;
+
+					// Language specific width and height addons
+					template['width'] += tinyMCE.getLang('lang_table_table_delta_width', 0);
+					template['height'] += tinyMCE.getLang('lang_table_table_delta_height', 0);
+
+					// Open window
+					tinyMCE.openWindow(template, {editor_id : inst.editorId, inline : "yes", action : value});
+				}
+
+				return true;
+
+			case "mceTableDelete":
+				var table = tinyMCE.getParentElement(inst.getFocusElement(), "table");
+				if (table) {
+					table.parentNode.removeChild(table);
+					inst.repaint();
+				}
+				return true;
+
+			case "mceTableSplitCells":
+			case "mceTableMergeCells":
+			case "mceTableInsertRowBefore":
+			case "mceTableInsertRowAfter":
+			case "mceTableDeleteRow":
+			case "mceTableInsertColBefore":
+			case "mceTableInsertColAfter":
+			case "mceTableDeleteCol":
+			case "mceTableCutRow":
+			case "mceTableCopyRow":
+			case "mceTablePasteRowBefore":
+			case "mceTablePasteRowAfter":
+				// No table just return (invalid command)
+				if (!tableElm)
+					return true;
+
+				// Table has a tbody use that reference
+				// Changed logic by ApTest 2005.07.12 (www.aptest.com)
+				// Now lookk at the focused element and take its parentNode.  That will be a tbody or a table.
+				if (trElm && tableElm != trElm.parentNode)
+					tableElm = trElm.parentNode;
+
+				if (tableElm && trElm) {
+					switch (command) {
+						case "mceTableCutRow":
+							if (!trElm || !tdElm)
+								return true;
+
+							inst.tableRowClipboard = copyRow(doc, tableElm, trElm);
+							inst.execCommand("mceTableDeleteRow");
+							break;
+
+						case "mceTableCopyRow":
+							if (!trElm || !tdElm)
+								return true;
+
+							inst.tableRowClipboard = copyRow(doc, tableElm, trElm);
+							break;
+
+						case "mceTablePasteRowBefore":
+							if (!trElm || !tdElm)
+								return true;
+
+							var newTR = inst.tableRowClipboard.cloneNode(true);
+
+							var prevTR = prevElm(trElm, "TR");
+							if (prevTR != null)
+								trimRow(tableElm, prevTR, prevTR.cells[0], newTR);
+
+							trElm.parentNode.insertBefore(newTR, trElm);
+							break;
+
+						case "mceTablePasteRowAfter":
+							if (!trElm || !tdElm)
+								return true;
+							
+							var nextTR = nextElm(trElm, "TR");
+							var newTR = inst.tableRowClipboard.cloneNode(true);
+
+							trimRow(tableElm, trElm, tdElm, newTR);
+
+							if (nextTR == null)
+								trElm.parentNode.appendChild(newTR);
+							else
+								nextTR.parentNode.insertBefore(newTR, nextTR);
+
+							break;
+
+						case "mceTableInsertRowBefore":
+							if (!trElm || !tdElm)
+								return true;
+
+							var grid = getTableGrid(tableElm);
+							var cpos = getCellPos(grid, tdElm);
+							var newTR = doc.createElement("tr");
+							var lastTDElm = null;
+
+							cpos.rowindex--;
+							if (cpos.rowindex < 0)
+								cpos.rowindex = 0;
+
+							// Create cells
+							for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
+								if (tdElm != lastTDElm) {
+									var sd = getColRowSpan(tdElm);
+
+									if (sd['rowspan'] == 1) {
+										var newTD = doc.createElement("td");
+
+										newTD.innerHTML = " ";
+										newTD.colSpan = tdElm.colSpan;
+
+										newTR.appendChild(newTD);
+									} else
+										tdElm.rowSpan = sd['rowspan'] + 1;
+
+									lastTDElm = tdElm;
+								}
+							}
+
+							trElm.parentNode.insertBefore(newTR, trElm);
+
+							grid = getTableGrid(tableElm);
+							inst.selection.selectNode(getCell(grid, cpos.rowindex + 1, cpos.cellindex), tinyMCE.isGecko, true); // Only collape on gecko
+						break;
+
+						case "mceTableInsertRowAfter":
+							if (!trElm || !tdElm)
+								return true;
+
+							var grid = getTableGrid(tableElm);
+							var cpos = getCellPos(grid, tdElm);
+							var newTR = doc.createElement("tr");
+							var lastTDElm = null;
+
+							// Create cells
+							for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
+								if (tdElm != lastTDElm) {
+									var sd = getColRowSpan(tdElm);
+
+									if (sd['rowspan'] == 1) {
+										var newTD = doc.createElement("td");
+
+										newTD.innerHTML = " ";
+										newTD.colSpan = tdElm.colSpan;
+
+										newTR.appendChild(newTD);
+									} else
+										tdElm.rowSpan = sd['rowspan'] + 1;
+
+									lastTDElm = tdElm;
+								}
+							}
+
+							if (newTR.hasChildNodes()) {
+								var nextTR = nextElm(trElm, "TR");
+								if (nextTR)
+									nextTR.parentNode.insertBefore(newTR, nextTR);
+								else
+									tableElm.appendChild(newTR);
+							}
+
+							grid = getTableGrid(tableElm);
+							inst.selection.selectNode(getCell(grid, cpos.rowindex, cpos.cellindex), tinyMCE.isGecko, true); // Only collape on gecko
+						break;
+
+						case "mceTableDeleteRow":
+							if (!trElm || !tdElm)
+								return true;
+
+							var grid = getTableGrid(tableElm);
+							var cpos = getCellPos(grid, tdElm);
+
+							// Only one row, remove whole table
+							if (grid.length == 1) {
+								tableElm = tinyMCE.getParentElement(tableElm, "table"); // Look for table instead of tbody
+								tableElm.parentNode.removeChild(tableElm);
+								return true;
+							}
+
+							// Move down row spanned cells
+							var cells = trElm.cells;
+							var nextTR = nextElm(trElm, "TR");
+							for (var x=0; x<cells.length; x++) {
+								if (cells[x].rowSpan > 1) {
+									var newTD = cells[x].cloneNode(true);
+									var sd = getColRowSpan(cells[x]);
+
+									newTD.rowSpan = sd.rowspan - 1;
+
+									var nextTD = nextTR.cells[x];
+
+									if (nextTD == null)
+										nextTR.appendChild(newTD);
+									else
+										nextTR.insertBefore(newTD, nextTD);
+								}
+							}
+
+							// Delete cells
+							var lastTDElm = null;
+							for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
+								if (tdElm != lastTDElm) {
+									var sd = getColRowSpan(tdElm);
+
+									if (sd.rowspan > 1) {
+										tdElm.rowSpan = sd.rowspan - 1;
+									} else {
+										trElm = tdElm.parentNode;
+
+										if (trElm.parentNode)
+											trElm._delete = true;
+									}
+
+									lastTDElm = tdElm;
+								}
+							}
+
+							deleteMarked(tableElm);
+
+							cpos.rowindex--;
+							if (cpos.rowindex < 0)
+								cpos.rowindex = 0;
+
+							// Recalculate grid and select
+							grid = getTableGrid(tableElm);
+							inst.selection.selectNode(getCell(grid, cpos.rowindex, 0), tinyMCE.isGecko, true); // Only collape on gecko
+						break;
+
+						case "mceTableInsertColBefore":
+							if (!trElm || !tdElm)
+								return true;
+
+							var grid = getTableGrid(tableElm);
+							var cpos = getCellPos(grid, tdElm);
+							var lastTDElm = null;
+
+							for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) {
+								if (tdElm != lastTDElm) {
+									var sd = getColRowSpan(tdElm);
+
+									if (sd['colspan'] == 1) {
+										var newTD = doc.createElement(tdElm.nodeName);
+
+										newTD.innerHTML = " ";
+										newTD.rowSpan = tdElm.rowSpan;
+
+										tdElm.parentNode.insertBefore(newTD, tdElm);
+									} else
+										tdElm.colSpan++;
+
+									lastTDElm = tdElm;
+								}
+							}
+
+							grid = getTableGrid(tableElm);
+							inst.selection.selectNode(getCell(grid, cpos.rowindex, cpos.cellindex + 1), tinyMCE.isGecko, true); // Only collape on gecko
+						break;
+
+						case "mceTableInsertColAfter":
+							if (!trElm || !tdElm)
+								return true;
+
+							var grid = getTableGrid(tableElm);
+							var cpos = getCellPos(grid, tdElm);
+							var lastTDElm = null;
+
+							for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) {
+								if (tdElm != lastTDElm) {
+									var sd = getColRowSpan(tdElm);
+
+									if (sd['colspan'] == 1) {
+										var newTD = doc.createElement(tdElm.nodeName);
+
+										newTD.innerHTML = " ";
+										newTD.rowSpan = tdElm.rowSpan;
+
+										var nextTD = nextElm(tdElm, "TD,TH");
+										if (nextTD == null)
+											tdElm.parentNode.appendChild(newTD);
+										else
+											nextTD.parentNode.insertBefore(newTD, nextTD);
+									} else
+										tdElm.colSpan++;
+
+									lastTDElm = tdElm;
+								}
+							}
+
+							grid = getTableGrid(tableElm);
+							inst.selection.selectNode(getCell(grid, cpos.rowindex, cpos.cellindex), tinyMCE.isGecko, true); // Only collape on gecko
+						break;
+
+						case "mceTableDeleteCol":
+							if (!trElm || !tdElm)
+								return true;
+
+							var grid = getTableGrid(tableElm);
+							var cpos = getCellPos(grid, tdElm);
+							var lastTDElm = null;
+
+							// Only one col, remove whole table
+							if (grid.length > 1 && grid[0].length <= 1) {
+								tableElm = tinyMCE.getParentElement(tableElm, "table"); // Look for table instead of tbody
+								tableElm.parentNode.removeChild(tableElm);
+								return true;
+							}
+
+							// Delete cells
+							for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) {
+								if (tdElm != lastTDElm) {
+									var sd = getColRowSpan(tdElm);
+
+									if (sd['colspan'] > 1)
+										tdElm.colSpan = sd['colspan'] - 1;
+									else {
+										if (tdElm.parentNode)
+											tdElm.parentNode.removeChild(tdElm);
+									}
+
+									lastTDElm = tdElm;
+								}
+							}
+
+							cpos.cellindex--;
+							if (cpos.cellindex < 0)
+								cpos.cellindex = 0;
+
+							// Recalculate grid and select
+							grid = getTableGrid(tableElm);
+							inst.selection.selectNode(getCell(grid, cpos.rowindex, 0), tinyMCE.isGecko, true); // Only collape on gecko
+						break;
+
+					case "mceTableSplitCells":
+						if (!trElm || !tdElm)
+							return true;
+
+						var spandata = getColRowSpan(tdElm);
+
+						var colspan = spandata["colspan"];
+						var rowspan = spandata["rowspan"];
+
+						// Needs splitting
+						if (colspan > 1 || rowspan > 1) {
+							// Generate cols
+							tdElm.colSpan = 1;
+							for (var i=1; i<colspan; i++) {
+								var newTD = doc.createElement("td");
+
+								newTD.innerHTML = " ";
+
+								trElm.insertBefore(newTD, nextElm(tdElm, "TD,TH"));
+
+								if (rowspan > 1)
+									addRows(newTD, trElm, rowspan);
+							}
+
+							addRows(tdElm, trElm, rowspan);
+						}
+
+						// Apply visual aids
+						tableElm = tinyMCE.getParentElement(inst.getFocusElement(), "table");
+						break;
+
+					case "mceTableMergeCells":
+						var rows = new Array();
+						var sel = inst.getSel();
+						var grid = getTableGrid(tableElm);
+
+						if (tinyMCE.isMSIE || sel.rangeCount == 1) {
+							if (user_interface) {
+								// Setup template
+								var template = new Array();
+								var sp = getColRowSpan(tdElm);
+
+								template['file'] = '../../plugins/table/merge_cells.htm';
+								template['width'] = 250;
+								template['height'] = 105 + (tinyMCE.isNS7 ? 25 : 0);
+
+								// Language specific width and height addons
+								template['width'] += tinyMCE.getLang('lang_table_merge_cells_delta_width', 0);
+								template['height'] += tinyMCE.getLang('lang_table_merge_cells_delta_height', 0);
+
+								// Open window
+								tinyMCE.openWindow(template, {editor_id : inst.editorId, inline : "yes", action : "update", numcols : sp.colspan, numrows : sp.rowspan});
+
+								return true;
+							} else {
+								var numRows = parseInt(value['numrows']);
+								var numCols = parseInt(value['numcols']);
+								var cpos = getCellPos(grid, tdElm);
+
+								if (("" + numRows) == "NaN")
+									numRows = 1;
+
+								if (("" + numCols) == "NaN")
+									numCols = 1;
+
+								// Get rows and cells
+								var tRows = tableElm.rows;
+								for (var y=cpos.rowindex; y<grid.length; y++) {
+									var rowCells = new Array();
+
+									for (var x=cpos.cellindex; x<grid[y].length; x++) {
+										var td = getCell(grid, y, x);
+
+										if (td && !inArray(rows, td) && !inArray(rowCells, td)) {
+											var cp = getCellPos(grid, td);
+
+											// Within range
+											if (cp.cellindex < cpos.cellindex+numCols && cp.rowindex < cpos.rowindex+numRows)
+												rowCells[rowCells.length] = td;
+										}
+									}
+
+									if (rowCells.length > 0)
+										rows[rows.length] = rowCells;
+								}
+
+								//return true;
+							}
+						} else {
+							var cells = new Array();
+							var sel = inst.getSel();
+							var lastTR = null;
+							var curRow = null;
+							var x1 = -1, y1 = -1, x2, y2;
+
+							// Only one cell selected, whats the point?
+							if (sel.rangeCount < 2)
+								return true;
+
+							// Get all selected cells
+							for (var i=0; i<sel.rangeCount; i++) {
+								var rng = sel.getRangeAt(i);
+								var tdElm = rng.startContainer.childNodes[rng.startOffset];
+
+								if (!tdElm)
+									break;
+
+								if (tdElm.nodeName == "TD")
+									cells[cells.length] = tdElm;
+							}
+
+							// Get rows and cells
+							var tRows = tableElm.rows;
+							for (var y=0; y<tRows.length; y++) {
+								var rowCells = new Array();
+
+								for (var x=0; x<tRows[y].cells.length; x++) {
+									var td = tRows[y].cells[x];
+
+									for (var i=0; i<cells.length; i++) {
+										if (td == cells[i]) {
+											rowCells[rowCells.length] = td;
+										}
+									}
+								}
+
+								if (rowCells.length > 0)
+									rows[rows.length] = rowCells;
+							}
+
+							// Find selected cells in grid and box
+							var curRow = new Array();
+							var lastTR = null;
+							for (var y=0; y<grid.length; y++) {
+								for (var x=0; x<grid[y].length; x++) {
+									grid[y][x]._selected = false;
+
+									for (var i=0; i<cells.length; i++) {
+										if (grid[y][x] == cells[i]) {
+											// Get start pos
+											if (x1 == -1) {
+												x1 = x;
+												y1 = y;
+											}
+
+											// Get end pos
+											x2 = x;
+											y2 = y;
+
+											grid[y][x]._selected = true;
+										}
+									}
+								}
+							}
+
+							// Is there gaps, if so deny
+							for (var y=y1; y<=y2; y++) {
+								for (var x=x1; x<=x2; x++) {
+									if (!grid[y][x]._selected) {
+										alert("Invalid selection for merge.");
+										return true;
+									}
+								}
+							}
+						}
+
+						// Validate selection and get total rowspan and colspan
+						var rowSpan = 1, colSpan = 1;
+
+						// Validate horizontal and get total colspan
+						var lastRowSpan = -1;
+						for (var y=0; y<rows.length; y++) {
+							var rowColSpan = 0;
+
+							for (var x=0; x<rows[y].length; x++) {
+								var sd = getColRowSpan(rows[y][x]);
+
+								rowColSpan += sd['colspan'];
+
+								if (lastRowSpan != -1 && sd['rowspan'] != lastRowSpan) {
+									alert("Invalid selection for merge.");
+									return true;
+								}
+
+								lastRowSpan = sd['rowspan'];
+							}
+
+							if (rowColSpan > colSpan)
+								colSpan = rowColSpan;
+
+							lastRowSpan = -1;
+						}
+
+						// Validate vertical and get total rowspan
+						var lastColSpan = -1;
+						for (var x=0; x<rows[0].length; x++) {
+							var colRowSpan = 0;
+
+							for (var y=0; y<rows.length; y++) {
+								var sd = getColRowSpan(rows[y][x]);
+
+								colRowSpan += sd['rowspan'];
+
+								if (lastColSpan != -1 && sd['colspan'] != lastColSpan) {
+									alert("Invalid selection for merge.");
+									return true;
+								}
+
+								lastColSpan = sd['colspan'];
+							}
+
+							if (colRowSpan > rowSpan)
+								rowSpan = colRowSpan;
+
+							lastColSpan = -1;
+						}
+
+						// Setup td
+						tdElm = rows[0][0];
+						tdElm.rowSpan = rowSpan;
+						tdElm.colSpan = colSpan;
+
+						// Merge cells
+						for (var y=0; y<rows.length; y++) {
+							for (var x=0; x<rows[y].length; x++) {
+								var html = rows[y][x].innerHTML;
+								var chk = tinyMCE.regexpReplace(html, "[ \t\r\n]", "");
+
+								if (chk != "<br/>" && chk != "<br>" && chk != " " && (x+y > 0))
+									tdElm.innerHTML += html;
+
+								// Not current cell
+								if (rows[y][x] != tdElm && !rows[y][x]._deleted) {
+									var cpos = getCellPos(grid, rows[y][x]);
+									var tr = rows[y][x].parentNode;
+
+									tr.removeChild(rows[y][x]);
+									rows[y][x]._deleted = true;
+
+									// Empty TR, remove it
+									if (!tr.hasChildNodes()) {
+										tr.parentNode.removeChild(tr);
+
+										var lastCell = null;
+										for (var x=0; cellElm = getCell(grid, cpos.rowindex, x); x++) {
+											if (cellElm != lastCell && cellElm.rowSpan > 1)
+												cellElm.rowSpan--;
+
+											lastCell = cellElm;
+										}
+
+										if (tdElm.rowSpan > 1)
+											tdElm.rowSpan--;
+									}
+								}
+							}
+						}
+
+						break;
+					}
+
+					tableElm = tinyMCE.getParentElement(inst.getFocusElement(), "table");
+					tinyMCE.handleVisualAid(tableElm, true, tinyMCE.settings['visual'], tinyMCE.selectedInstance);
+					tinyMCE.triggerNodeChange();
+					inst.repaint();
+				}
+
+			return true;
+		}
+
+		// Pass to next handler in chain
+		return false;
+	}
+};
+
+tinyMCE.addPlugin("table", TinyMCE_TablePlugin);

Deleted: plog/trunk/js/tinymce/plugins/table/images/buttons.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/table/images/buttons.gif (from rev 7165, plog/trunk/js/tinymce/plugins/table/images/buttons.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/table/images/table.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/table/images/table.gif (from rev 7165, plog/trunk/js/tinymce/plugins/table/images/table.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/table/images/table_cell_props.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/table/images/table_cell_props.gif (from rev 7165, plog/trunk/js/tinymce/plugins/table/images/table_cell_props.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/table/images/table_delete.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/table/images/table_delete.gif (from rev 7165, plog/trunk/js/tinymce/plugins/table/images/table_delete.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/table/images/table_delete_col.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/table/images/table_delete_col.gif (from rev 7165, plog/trunk/js/tinymce/plugins/table/images/table_delete_col.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/table/images/table_delete_row.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/table/images/table_delete_row.gif (from rev 7165, plog/trunk/js/tinymce/plugins/table/images/table_delete_row.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/table/images/table_insert_col_after.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/table/images/table_insert_col_after.gif (from rev 7165, plog/trunk/js/tinymce/plugins/table/images/table_insert_col_after.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/table/images/table_insert_col_before.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/table/images/table_insert_col_before.gif (from rev 7165, plog/trunk/js/tinymce/plugins/table/images/table_insert_col_before.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/table/images/table_insert_row_after.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/table/images/table_insert_row_after.gif (from rev 7165, plog/trunk/js/tinymce/plugins/table/images/table_insert_row_after.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/table/images/table_insert_row_before.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/table/images/table_insert_row_before.gif (from rev 7165, plog/trunk/js/tinymce/plugins/table/images/table_insert_row_before.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/table/images/table_merge_cells.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/table/images/table_merge_cells.gif (from rev 7165, plog/trunk/js/tinymce/plugins/table/images/table_merge_cells.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/table/images/table_row_props.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/table/images/table_row_props.gif (from rev 7165, plog/trunk/js/tinymce/plugins/table/images/table_row_props.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/table/images/table_split_cells.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/plugins/table/images/table_split_cells.gif (from rev 7165, plog/trunk/js/tinymce/plugins/table/images/table_split_cells.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/plugins/table/jscripts/cell.js
===================================================================
--- plog/trunk/js/tinymce/plugins/table/jscripts/cell.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/table/jscripts/cell.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,249 +0,0 @@
-function init() {
-	tinyMCEPopup.resizeToInnerSize();
-
-	document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
-	document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor');
-	document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor')
-
-	var inst = tinyMCE.selectedInstance;
-	var tdElm = tinyMCE.getParentElement(inst.getFocusElement(), "td,th");
-	var formObj = document.forms[0];
-	var st = tinyMCE.parseStyle(tinyMCE.getAttrib(tdElm, "style"));
-
-	// Get table cell data
-	var celltype = tdElm.nodeName.toLowerCase();
-	var align = tinyMCE.getAttrib(tdElm, 'align');
-	var valign = tinyMCE.getAttrib(tdElm, 'valign');
-	var width = trimSize(getStyle(tdElm, 'width', 'width'));
-	var height = trimSize(getStyle(tdElm, 'height', 'height'));
-	var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor'));
-	var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor'));
-	var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(tdElm, 'class'), false);
-	var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");;
-	var id = tinyMCE.getAttrib(tdElm, 'id');
-	var lang = tinyMCE.getAttrib(tdElm, 'lang');
-	var dir = tinyMCE.getAttrib(tdElm, 'dir');
-	var scope = tinyMCE.getAttrib(tdElm, 'scope');
-
-	// Setup form
-	addClassesToList('class', 'table_cell_styles');
-	formObj.bordercolor.value = bordercolor;
-	formObj.bgcolor.value = bgcolor;
-	formObj.backgroundimage.value = backgroundimage;
-	formObj.width.value = width;
-	formObj.height.value = height;
-	formObj.id.value = id;
-	formObj.lang.value = lang;
-	formObj.style.value = tinyMCE.serializeStyle(st);
-	selectByValue(formObj, 'align', align);
-	selectByValue(formObj, 'valign', valign);
-	selectByValue(formObj, 'class', className);
-	selectByValue(formObj, 'celltype', celltype);
-	selectByValue(formObj, 'dir', dir);
-	selectByValue(formObj, 'scope', scope);
-
-	// Resize some elements
-	if (isVisible('backgroundimagebrowser'))
-		document.getElementById('backgroundimage').style.width = '180px';
-
-	updateColor('bordercolor_pick', 'bordercolor');
-	updateColor('bgcolor_pick', 'bgcolor');
-}
-
-function updateAction() {
-	tinyMCEPopup.restoreSelection();
-
-	var inst = tinyMCE.selectedInstance;
-	var tdElm = tinyMCE.getParentElement(inst.getFocusElement(), "td,th");
-	var trElm = tinyMCE.getParentElement(inst.getFocusElement(), "tr");
-	var tableElm = tinyMCE.getParentElement(inst.getFocusElement(), "table");
-	var formObj = document.forms[0];
-
-	inst.execCommand('mceBeginUndoLevel');
-
-	switch (getSelectValue(formObj, 'action')) {
-		case "cell":
-			var celltype = getSelectValue(formObj, 'celltype');
-			var scope = getSelectValue(formObj, 'scope');
-
-			if (tinyMCE.getParam("accessibility_warnings")) {
-				if (celltype == "th" && scope == "")
-					var answer = confirm(tinyMCE.getLang('lang_table_missing_scope', '', true));
-				else
-					var answer = true;
-
-				if (!answer)
-					return;
-			}
-
-			updateCell(tdElm);
-			break;
-
-		case "row":
-			var cell = trElm.firstChild;
-
-			if (cell.nodeName != "TD" && cell.nodeName != "TH")
-				cell = nextCell(cell);
-
-			do {
-				cell = updateCell(cell, true);
-			} while ((cell = nextCell(cell)) != null);
-
-			break;
-
-		case "all":
-			var rows = tableElm.getElementsByTagName("tr");
-
-			for (var i=0; i<rows.length; i++) {
-				var cell = rows[i].firstChild;
-
-				if (cell.nodeName != "TD" && cell.nodeName != "TH")
-					cell = nextCell(cell);
-
-				do {
-					cell = updateCell(cell, true);
-				} while ((cell = nextCell(cell)) != null);
-			}
-
-			break;
-	}
-
-	tinyMCE.handleVisualAid(inst.getBody(), true, inst.visualAid, inst);
-	tinyMCE.triggerNodeChange();
-	inst.execCommand('mceEndUndoLevel');
-	tinyMCEPopup.close();
-}
-
-function nextCell(elm) {
-	while ((elm = elm.nextSibling) != null) {
-		if (elm.nodeName == "TD" || elm.nodeName == "TH")
-			return elm;
-	}
-
-	return null;
-}
-
-function updateCell(td, skip_id) {
-	var inst = tinyMCE.selectedInstance;
-	var formObj = document.forms[0];
-	var curCellType = td.nodeName.toLowerCase();
-	var celltype = getSelectValue(formObj, 'celltype');
-	var doc = inst.getDoc();
-
-	if (!skip_id)
-		td.setAttribute('id', formObj.id.value);
-
-	td.setAttribute('align', formObj.align.value);
-	td.setAttribute('vAlign', formObj.valign.value);
-	td.setAttribute('lang', formObj.lang.value);
-	td.setAttribute('dir', getSelectValue(formObj, 'dir'));
-	td.setAttribute('style', tinyMCE.serializeStyle(tinyMCE.parseStyle(formObj.style.value)));
-	td.setAttribute('scope', formObj.scope.value);
-	tinyMCE.setAttrib(td, 'class', getSelectValue(formObj, 'class'));
-
-	// Clear deprecated attributes
-	tinyMCE.setAttrib(td, 'width', '');
-	tinyMCE.setAttrib(td, 'height', '');
-	tinyMCE.setAttrib(td, 'bgColor', '');
-	tinyMCE.setAttrib(td, 'borderColor', '');
-	tinyMCE.setAttrib(td, 'background', '');
-
-	// Set styles
-	td.style.width = getCSSSize(formObj.width.value);
-	td.style.height = getCSSSize(formObj.height.value);
-	if (formObj.bordercolor.value != "") {
-		td.style.borderColor = formObj.bordercolor.value;
-		td.style.borderStyle = td.style.borderStyle == "" ? "solid" : td.style.borderStyle;
-		td.style.borderWidth = td.style.borderWidth == "" ? "1px" : td.style.borderWidth;
-	} else
-		td.style.borderColor = '';
-
-	td.style.backgroundColor = formObj.bgcolor.value;
-
-	if (formObj.backgroundimage.value != "")
-		td.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')";
-	else
-		td.style.backgroundImage = '';
-
-	if (curCellType != celltype) {
-		// changing to a different node type
-		var newCell = doc.createElement(celltype);
-
-		for (var c=0; c<td.childNodes.length; c++)
-			newCell.appendChild(td.childNodes[c].cloneNode(1));
-
-		for (var a=0; a<td.attributes.length; a++) {
-			var attr = td.attributes[a];
-			newCell.setAttribute(attr.name, attr.value);
-		}
-
-		td.parentNode.replaceChild(newCell, td);
-		td = newCell;
-	}
-
-	return td;
-}
-
-function changedBackgroundImage() {
-	var formObj = document.forms[0];
-	var st = tinyMCE.parseStyle(formObj.style.value);
-
-	st['background-image'] = "url('" + formObj.backgroundimage.value + "')";
-
-	formObj.style.value = tinyMCE.serializeStyle(st);
-}
-
-function changedSize() {
-	var formObj = document.forms[0];
-	var st = tinyMCE.parseStyle(formObj.style.value);
-
-	var width = formObj.width.value;
-	if (width != "")
-		st['width'] = getCSSSize(width);
-	else
-		st['width'] = "";
-
-	var height = formObj.height.value;
-	if (height != "")
-		st['height'] = getCSSSize(height);
-	else
-		st['height'] = "";
-
-	formObj.style.value = tinyMCE.serializeStyle(st);
-}
-
-function changedColor() {
-	var formObj = document.forms[0];
-	var st = tinyMCE.parseStyle(formObj.style.value);
-
-	st['background-color'] = formObj.bgcolor.value;
-	st['border-color'] = formObj.bordercolor.value;
-
-	formObj.style.value = tinyMCE.serializeStyle(st);
-}
-
-function changedStyle() {
-	var formObj = document.forms[0];
-	var st = tinyMCE.parseStyle(formObj.style.value);
-
-	if (st['background-image'])
-		formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
-	else
-		formObj.backgroundimage.value = '';
-
-	if (st['width'])
-		formObj.width.value = trimSize(st['width']);
-
-	if (st['height'])
-		formObj.height.value = trimSize(st['height']);
-
-	if (st['background-color']) {
-		formObj.bgcolor.value = st['background-color'];
-		updateColor('bgcolor_pick','bgcolor');
-	}
-
-	if (st['border-color']) {
-		formObj.bordercolor.value = st['border-color'];
-		updateColor('bordercolor_pick','bordercolor');
-	}
-}

Copied: plog/trunk/js/tinymce/plugins/table/jscripts/cell.js (from rev 7165, plog/trunk/js/tinymce/plugins/table/jscripts/cell.js)
===================================================================
--- plog/trunk/js/tinymce/plugins/table/jscripts/cell.js	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/table/jscripts/cell.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,249 @@
+function init() {
+	tinyMCEPopup.resizeToInnerSize();
+
+	document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
+	document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor');
+	document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor')
+
+	var inst = tinyMCE.selectedInstance;
+	var tdElm = tinyMCE.getParentElement(inst.getFocusElement(), "td,th");
+	var formObj = document.forms[0];
+	var st = tinyMCE.parseStyle(tinyMCE.getAttrib(tdElm, "style"));
+
+	// Get table cell data
+	var celltype = tdElm.nodeName.toLowerCase();
+	var align = tinyMCE.getAttrib(tdElm, 'align');
+	var valign = tinyMCE.getAttrib(tdElm, 'valign');
+	var width = trimSize(getStyle(tdElm, 'width', 'width'));
+	var height = trimSize(getStyle(tdElm, 'height', 'height'));
+	var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor'));
+	var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor'));
+	var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(tdElm, 'class'), false);
+	var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");;
+	var id = tinyMCE.getAttrib(tdElm, 'id');
+	var lang = tinyMCE.getAttrib(tdElm, 'lang');
+	var dir = tinyMCE.getAttrib(tdElm, 'dir');
+	var scope = tinyMCE.getAttrib(tdElm, 'scope');
+
+	// Setup form
+	addClassesToList('class', 'table_cell_styles');
+	formObj.bordercolor.value = bordercolor;
+	formObj.bgcolor.value = bgcolor;
+	formObj.backgroundimage.value = backgroundimage;
+	formObj.width.value = width;
+	formObj.height.value = height;
+	formObj.id.value = id;
+	formObj.lang.value = lang;
+	formObj.style.value = tinyMCE.serializeStyle(st);
+	selectByValue(formObj, 'align', align);
+	selectByValue(formObj, 'valign', valign);
+	selectByValue(formObj, 'class', className);
+	selectByValue(formObj, 'celltype', celltype);
+	selectByValue(formObj, 'dir', dir);
+	selectByValue(formObj, 'scope', scope);
+
+	// Resize some elements
+	if (isVisible('backgroundimagebrowser'))
+		document.getElementById('backgroundimage').style.width = '180px';
+
+	updateColor('bordercolor_pick', 'bordercolor');
+	updateColor('bgcolor_pick', 'bgcolor');
+}
+
+function updateAction() {
+	tinyMCEPopup.restoreSelection();
+
+	var inst = tinyMCE.selectedInstance;
+	var tdElm = tinyMCE.getParentElement(inst.getFocusElement(), "td,th");
+	var trElm = tinyMCE.getParentElement(inst.getFocusElement(), "tr");
+	var tableElm = tinyMCE.getParentElement(inst.getFocusElement(), "table");
+	var formObj = document.forms[0];
+
+	inst.execCommand('mceBeginUndoLevel');
+
+	switch (getSelectValue(formObj, 'action')) {
+		case "cell":
+			var celltype = getSelectValue(formObj, 'celltype');
+			var scope = getSelectValue(formObj, 'scope');
+
+			if (tinyMCE.getParam("accessibility_warnings")) {
+				if (celltype == "th" && scope == "")
+					var answer = confirm(tinyMCE.getLang('lang_table_missing_scope', '', true));
+				else
+					var answer = true;
+
+				if (!answer)
+					return;
+			}
+
+			updateCell(tdElm);
+			break;
+
+		case "row":
+			var cell = trElm.firstChild;
+
+			if (cell.nodeName != "TD" && cell.nodeName != "TH")
+				cell = nextCell(cell);
+
+			do {
+				cell = updateCell(cell, true);
+			} while ((cell = nextCell(cell)) != null);
+
+			break;
+
+		case "all":
+			var rows = tableElm.getElementsByTagName("tr");
+
+			for (var i=0; i<rows.length; i++) {
+				var cell = rows[i].firstChild;
+
+				if (cell.nodeName != "TD" && cell.nodeName != "TH")
+					cell = nextCell(cell);
+
+				do {
+					cell = updateCell(cell, true);
+				} while ((cell = nextCell(cell)) != null);
+			}
+
+			break;
+	}
+
+	tinyMCE.handleVisualAid(inst.getBody(), true, inst.visualAid, inst);
+	tinyMCE.triggerNodeChange();
+	inst.execCommand('mceEndUndoLevel');
+	tinyMCEPopup.close();
+}
+
+function nextCell(elm) {
+	while ((elm = elm.nextSibling) != null) {
+		if (elm.nodeName == "TD" || elm.nodeName == "TH")
+			return elm;
+	}
+
+	return null;
+}
+
+function updateCell(td, skip_id) {
+	var inst = tinyMCE.selectedInstance;
+	var formObj = document.forms[0];
+	var curCellType = td.nodeName.toLowerCase();
+	var celltype = getSelectValue(formObj, 'celltype');
+	var doc = inst.getDoc();
+
+	if (!skip_id)
+		td.setAttribute('id', formObj.id.value);
+
+	td.setAttribute('align', formObj.align.value);
+	td.setAttribute('vAlign', formObj.valign.value);
+	td.setAttribute('lang', formObj.lang.value);
+	td.setAttribute('dir', getSelectValue(formObj, 'dir'));
+	td.setAttribute('style', tinyMCE.serializeStyle(tinyMCE.parseStyle(formObj.style.value)));
+	td.setAttribute('scope', formObj.scope.value);
+	tinyMCE.setAttrib(td, 'class', getSelectValue(formObj, 'class'));
+
+	// Clear deprecated attributes
+	tinyMCE.setAttrib(td, 'width', '');
+	tinyMCE.setAttrib(td, 'height', '');
+	tinyMCE.setAttrib(td, 'bgColor', '');
+	tinyMCE.setAttrib(td, 'borderColor', '');
+	tinyMCE.setAttrib(td, 'background', '');
+
+	// Set styles
+	td.style.width = getCSSSize(formObj.width.value);
+	td.style.height = getCSSSize(formObj.height.value);
+	if (formObj.bordercolor.value != "") {
+		td.style.borderColor = formObj.bordercolor.value;
+		td.style.borderStyle = td.style.borderStyle == "" ? "solid" : td.style.borderStyle;
+		td.style.borderWidth = td.style.borderWidth == "" ? "1px" : td.style.borderWidth;
+	} else
+		td.style.borderColor = '';
+
+	td.style.backgroundColor = formObj.bgcolor.value;
+
+	if (formObj.backgroundimage.value != "")
+		td.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')";
+	else
+		td.style.backgroundImage = '';
+
+	if (curCellType != celltype) {
+		// changing to a different node type
+		var newCell = doc.createElement(celltype);
+
+		for (var c=0; c<td.childNodes.length; c++)
+			newCell.appendChild(td.childNodes[c].cloneNode(1));
+
+		for (var a=0; a<td.attributes.length; a++) {
+			var attr = td.attributes[a];
+			newCell.setAttribute(attr.name, attr.value);
+		}
+
+		td.parentNode.replaceChild(newCell, td);
+		td = newCell;
+	}
+
+	return td;
+}
+
+function changedBackgroundImage() {
+	var formObj = document.forms[0];
+	var st = tinyMCE.parseStyle(formObj.style.value);
+
+	st['background-image'] = "url('" + formObj.backgroundimage.value + "')";
+
+	formObj.style.value = tinyMCE.serializeStyle(st);
+}
+
+function changedSize() {
+	var formObj = document.forms[0];
+	var st = tinyMCE.parseStyle(formObj.style.value);
+
+	var width = formObj.width.value;
+	if (width != "")
+		st['width'] = getCSSSize(width);
+	else
+		st['width'] = "";
+
+	var height = formObj.height.value;
+	if (height != "")
+		st['height'] = getCSSSize(height);
+	else
+		st['height'] = "";
+
+	formObj.style.value = tinyMCE.serializeStyle(st);
+}
+
+function changedColor() {
+	var formObj = document.forms[0];
+	var st = tinyMCE.parseStyle(formObj.style.value);
+
+	st['background-color'] = formObj.bgcolor.value;
+	st['border-color'] = formObj.bordercolor.value;
+
+	formObj.style.value = tinyMCE.serializeStyle(st);
+}
+
+function changedStyle() {
+	var formObj = document.forms[0];
+	var st = tinyMCE.parseStyle(formObj.style.value);
+
+	if (st['background-image'])
+		formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
+	else
+		formObj.backgroundimage.value = '';
+
+	if (st['width'])
+		formObj.width.value = trimSize(st['width']);
+
+	if (st['height'])
+		formObj.height.value = trimSize(st['height']);
+
+	if (st['background-color']) {
+		formObj.bgcolor.value = st['background-color'];
+		updateColor('bgcolor_pick','bgcolor');
+	}
+
+	if (st['border-color']) {
+		formObj.bordercolor.value = st['border-color'];
+		updateColor('bordercolor_pick','bordercolor');
+	}
+}

Deleted: plog/trunk/js/tinymce/plugins/table/jscripts/merge_cells.js
===================================================================
--- plog/trunk/js/tinymce/plugins/table/jscripts/merge_cells.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/table/jscripts/merge_cells.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,24 +0,0 @@
-function init() {
-	tinyMCEPopup.resizeToInnerSize();
-
-	var formObj = document.forms[0];
-
-	formObj.numcols.value = tinyMCE.getWindowArg('numcols', 1);
-	formObj.numrows.value = tinyMCE.getWindowArg('numrows', 1);
-}
-
-function mergeCells() {
-	var args = new Array();
-	var formObj = document.forms[0];
-
-	if (!AutoValidator.validate(formObj)) {
-		alert(tinyMCE.getLang('lang_invalid_data'));
-		return false;
-	}
-
-	args["numcols"] = formObj.numcols.value;
-	args["numrows"] = formObj.numrows.value;
-
-	tinyMCEPopup.execCommand("mceTableMergeCells", false, args);
-	tinyMCEPopup.close();
-}

Copied: plog/trunk/js/tinymce/plugins/table/jscripts/merge_cells.js (from rev 7165, plog/trunk/js/tinymce/plugins/table/jscripts/merge_cells.js)
===================================================================
--- plog/trunk/js/tinymce/plugins/table/jscripts/merge_cells.js	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/table/jscripts/merge_cells.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,24 @@
+function init() {
+	tinyMCEPopup.resizeToInnerSize();
+
+	var formObj = document.forms[0];
+
+	formObj.numcols.value = tinyMCE.getWindowArg('numcols', 1);
+	formObj.numrows.value = tinyMCE.getWindowArg('numrows', 1);
+}
+
+function mergeCells() {
+	var args = new Array();
+	var formObj = document.forms[0];
+
+	if (!AutoValidator.validate(formObj)) {
+		alert(tinyMCE.getLang('lang_invalid_data'));
+		return false;
+	}
+
+	args["numcols"] = formObj.numcols.value;
+	args["numrows"] = formObj.numrows.value;
+
+	tinyMCEPopup.execCommand("mceTableMergeCells", false, args);
+	tinyMCEPopup.close();
+}

Deleted: plog/trunk/js/tinymce/plugins/table/jscripts/row.js
===================================================================
--- plog/trunk/js/tinymce/plugins/table/jscripts/row.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/table/jscripts/row.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,200 +0,0 @@
-function init() {
-	tinyMCEPopup.resizeToInnerSize();
-
-	document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
-	document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
-
-	var inst = tinyMCE.selectedInstance;
-	var trElm = tinyMCE.getParentElement(inst.getFocusElement(), "tr");
-	var formObj = document.forms[0];
-	var st = tinyMCE.parseStyle(tinyMCE.getAttrib(trElm, "style"));
-
-	// Get table row data
-	var rowtype = trElm.parentNode.nodeName.toLowerCase();
-	var align = tinyMCE.getAttrib(trElm, 'align');
-	var valign = tinyMCE.getAttrib(trElm, 'valign');
-	var height = trimSize(getStyle(trElm, 'height', 'height'));
-	var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(trElm, 'class'), false);
-	var bgcolor = convertRGBToHex(getStyle(trElm, 'bgcolor', 'backgroundColor'));
-	var backgroundimage = getStyle(trElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");;
-	var id = tinyMCE.getAttrib(trElm, 'id');
-	var lang = tinyMCE.getAttrib(trElm, 'lang');
-	var dir = tinyMCE.getAttrib(trElm, 'dir');
-
-	// Setup form
-	addClassesToList('class', 'table_row_styles');
-	formObj.bgcolor.value = bgcolor;
-	formObj.backgroundimage.value = backgroundimage;
-	formObj.height.value = height;
-	formObj.id.value = id;
-	formObj.lang.value = lang;
-	formObj.style.value = tinyMCE.serializeStyle(st);
-	selectByValue(formObj, 'align', align);
-	selectByValue(formObj, 'valign', valign);
-	selectByValue(formObj, 'class', className);
-	selectByValue(formObj, 'rowtype', rowtype);
-	selectByValue(formObj, 'dir', dir);
-
-	// Resize some elements
-	if (isVisible('backgroundimagebrowser'))
-		document.getElementById('backgroundimage').style.width = '180px';
-
-	updateColor('bgcolor_pick', 'bgcolor');
-}
-
-function updateAction() {
-	tinyMCEPopup.restoreSelection();
-
-	var inst = tinyMCE.selectedInstance;
-	var trElm = tinyMCE.getParentElement(inst.getFocusElement(), "tr");
-	var tableElm = tinyMCE.getParentElement(inst.getFocusElement(), "table");
-	var formObj = document.forms[0];
-	var action = getSelectValue(formObj, 'action');
-
-	inst.execCommand('mceBeginUndoLevel');
-
-	switch (action) {
-		case "row":
-			updateRow(trElm);
-			break;
-
-		case "all":
-			var rows = tableElm.getElementsByTagName("tr");
-
-			for (var i=0; i<rows.length; i++)
-				updateRow(rows[i], true);
-
-			break;
-
-		case "odd":
-		case "even":
-			var rows = tableElm.getElementsByTagName("tr");
-
-			for (var i=0; i<rows.length; i++) {
-				if ((i % 2 == 0 && action == "odd") || (i % 2 != 0 && action == "even"))
-					updateRow(rows[i], true, true);
-			}
-
-			break;
-	}
-
-	tinyMCE.handleVisualAid(inst.getBody(), true, inst.visualAid, inst);
-	tinyMCE.triggerNodeChange();
-	inst.execCommand('mceEndUndoLevel');
-	tinyMCEPopup.close();
-}
-
-function updateRow(tr_elm, skip_id, skip_parent) {
-	var inst = tinyMCE.selectedInstance;
-	var formObj = document.forms[0];
-	var curRowType = tr_elm.parentNode.nodeName.toLowerCase();
-	var rowtype = getSelectValue(formObj, 'rowtype');
-	var doc = inst.getDoc();
-
-	// Update row element
-	if (!skip_id)
-		tr_elm.setAttribute('id', formObj.id.value);
-
-	tr_elm.setAttribute('align', getSelectValue(formObj, 'align'));
-	tr_elm.setAttribute('vAlign', getSelectValue(formObj, 'valign'));
-	tr_elm.setAttribute('lang', formObj.lang.value);
-	tr_elm.setAttribute('dir', getSelectValue(formObj, 'dir'));
-	tr_elm.setAttribute('style', tinyMCE.serializeStyle(tinyMCE.parseStyle(formObj.style.value)));
-	tinyMCE.setAttrib(tr_elm, 'class', getSelectValue(formObj, 'class'));
-
-	// Clear deprecated attributes
-	tr_elm.setAttribute('background', '');
-	tr_elm.setAttribute('bgColor', '');
-	tr_elm.setAttribute('height', '');
-
-	// Set styles
-	tr_elm.style.height = getCSSSize(formObj.height.value);
-	tr_elm.style.backgroundColor = formObj.bgcolor.value;
-
-	if (formObj.backgroundimage.value != "")
-		tr_elm.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')";
-	else
-		tr_elm.style.backgroundImage = '';
-
-	// Setup new rowtype
-	if (curRowType != rowtype && !skip_parent) {
-		// first, clone the node we are working on
-		var newRow = tr_elm.cloneNode(1);
-
-		// next, find the parent of its new destination (creating it if necessary)
-		var theTable = tinyMCE.getParentElement(tr_elm, "table");
-		var dest = rowtype;
-		var newParent = null;
-		for (var i = 0; i < theTable.childNodes.length; i++) {
-			if (theTable.childNodes[i].nodeName.toLowerCase() == dest)
-				newParent = theTable.childNodes[i];
-		}
-
-		if (newParent == null) {
-			newParent = doc.createElement(dest);
-
-			if (dest == "thead")
-				theTable.insertBefore(newParent, theTable.firstChild);
-			else
-				theTable.appendChild(newParent);
-		}
-
-		// append the row to the new parent
-		newParent.appendChild(newRow);
-
-		// remove the original
-		tr_elm.parentNode.removeChild(tr_elm);
-
-		// set tr_elm to the new node
-		tr_elm = newRow;
-	}
-}
-
-function changedBackgroundImage() {
-	var formObj = document.forms[0];
-	var st = tinyMCE.parseStyle(formObj.style.value);
-
-	st['background-image'] = "url('" + formObj.backgroundimage.value + "')";
-
-	formObj.style.value = tinyMCE.serializeStyle(st);
-}
-
-function changedStyle() {
-	var formObj = document.forms[0];
-	var st = tinyMCE.parseStyle(formObj.style.value);
-
-	if (st['background-image'])
-		formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
-	else
-		formObj.backgroundimage.value = '';
-
-	if (st['height'])
-		formObj.height.value = trimSize(st['height']);
-
-	if (st['background-color']) {
-		formObj.bgcolor.value = st['background-color'];
-		updateColor('bgcolor_pick','bgcolor');
-	}
-}
-
-function changedSize() {
-	var formObj = document.forms[0];
-	var st = tinyMCE.parseStyle(formObj.style.value);
-
-	var height = formObj.height.value;
-	if (height != "")
-		st['height'] = getCSSSize(height);
-	else
-		st['height'] = "";
-
-	formObj.style.value = tinyMCE.serializeStyle(st);
-}
-
-function changedColor() {
-	var formObj = document.forms[0];
-	var st = tinyMCE.parseStyle(formObj.style.value);
-
-	st['background-color'] = formObj.bgcolor.value;
-
-	formObj.style.value = tinyMCE.serializeStyle(st);
-}

Copied: plog/trunk/js/tinymce/plugins/table/jscripts/row.js (from rev 7165, plog/trunk/js/tinymce/plugins/table/jscripts/row.js)
===================================================================
--- plog/trunk/js/tinymce/plugins/table/jscripts/row.js	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/table/jscripts/row.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,200 @@
+function init() {
+	tinyMCEPopup.resizeToInnerSize();
+
+	document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
+	document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
+
+	var inst = tinyMCE.selectedInstance;
+	var trElm = tinyMCE.getParentElement(inst.getFocusElement(), "tr");
+	var formObj = document.forms[0];
+	var st = tinyMCE.parseStyle(tinyMCE.getAttrib(trElm, "style"));
+
+	// Get table row data
+	var rowtype = trElm.parentNode.nodeName.toLowerCase();
+	var align = tinyMCE.getAttrib(trElm, 'align');
+	var valign = tinyMCE.getAttrib(trElm, 'valign');
+	var height = trimSize(getStyle(trElm, 'height', 'height'));
+	var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(trElm, 'class'), false);
+	var bgcolor = convertRGBToHex(getStyle(trElm, 'bgcolor', 'backgroundColor'));
+	var backgroundimage = getStyle(trElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");;
+	var id = tinyMCE.getAttrib(trElm, 'id');
+	var lang = tinyMCE.getAttrib(trElm, 'lang');
+	var dir = tinyMCE.getAttrib(trElm, 'dir');
+
+	// Setup form
+	addClassesToList('class', 'table_row_styles');
+	formObj.bgcolor.value = bgcolor;
+	formObj.backgroundimage.value = backgroundimage;
+	formObj.height.value = height;
+	formObj.id.value = id;
+	formObj.lang.value = lang;
+	formObj.style.value = tinyMCE.serializeStyle(st);
+	selectByValue(formObj, 'align', align);
+	selectByValue(formObj, 'valign', valign);
+	selectByValue(formObj, 'class', className);
+	selectByValue(formObj, 'rowtype', rowtype);
+	selectByValue(formObj, 'dir', dir);
+
+	// Resize some elements
+	if (isVisible('backgroundimagebrowser'))
+		document.getElementById('backgroundimage').style.width = '180px';
+
+	updateColor('bgcolor_pick', 'bgcolor');
+}
+
+function updateAction() {
+	tinyMCEPopup.restoreSelection();
+
+	var inst = tinyMCE.selectedInstance;
+	var trElm = tinyMCE.getParentElement(inst.getFocusElement(), "tr");
+	var tableElm = tinyMCE.getParentElement(inst.getFocusElement(), "table");
+	var formObj = document.forms[0];
+	var action = getSelectValue(formObj, 'action');
+
+	inst.execCommand('mceBeginUndoLevel');
+
+	switch (action) {
+		case "row":
+			updateRow(trElm);
+			break;
+
+		case "all":
+			var rows = tableElm.getElementsByTagName("tr");
+
+			for (var i=0; i<rows.length; i++)
+				updateRow(rows[i], true);
+
+			break;
+
+		case "odd":
+		case "even":
+			var rows = tableElm.getElementsByTagName("tr");
+
+			for (var i=0; i<rows.length; i++) {
+				if ((i % 2 == 0 && action == "odd") || (i % 2 != 0 && action == "even"))
+					updateRow(rows[i], true, true);
+			}
+
+			break;
+	}
+
+	tinyMCE.handleVisualAid(inst.getBody(), true, inst.visualAid, inst);
+	tinyMCE.triggerNodeChange();
+	inst.execCommand('mceEndUndoLevel');
+	tinyMCEPopup.close();
+}
+
+function updateRow(tr_elm, skip_id, skip_parent) {
+	var inst = tinyMCE.selectedInstance;
+	var formObj = document.forms[0];
+	var curRowType = tr_elm.parentNode.nodeName.toLowerCase();
+	var rowtype = getSelectValue(formObj, 'rowtype');
+	var doc = inst.getDoc();
+
+	// Update row element
+	if (!skip_id)
+		tr_elm.setAttribute('id', formObj.id.value);
+
+	tr_elm.setAttribute('align', getSelectValue(formObj, 'align'));
+	tr_elm.setAttribute('vAlign', getSelectValue(formObj, 'valign'));
+	tr_elm.setAttribute('lang', formObj.lang.value);
+	tr_elm.setAttribute('dir', getSelectValue(formObj, 'dir'));
+	tr_elm.setAttribute('style', tinyMCE.serializeStyle(tinyMCE.parseStyle(formObj.style.value)));
+	tinyMCE.setAttrib(tr_elm, 'class', getSelectValue(formObj, 'class'));
+
+	// Clear deprecated attributes
+	tr_elm.setAttribute('background', '');
+	tr_elm.setAttribute('bgColor', '');
+	tr_elm.setAttribute('height', '');
+
+	// Set styles
+	tr_elm.style.height = getCSSSize(formObj.height.value);
+	tr_elm.style.backgroundColor = formObj.bgcolor.value;
+
+	if (formObj.backgroundimage.value != "")
+		tr_elm.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')";
+	else
+		tr_elm.style.backgroundImage = '';
+
+	// Setup new rowtype
+	if (curRowType != rowtype && !skip_parent) {
+		// first, clone the node we are working on
+		var newRow = tr_elm.cloneNode(1);
+
+		// next, find the parent of its new destination (creating it if necessary)
+		var theTable = tinyMCE.getParentElement(tr_elm, "table");
+		var dest = rowtype;
+		var newParent = null;
+		for (var i = 0; i < theTable.childNodes.length; i++) {
+			if (theTable.childNodes[i].nodeName.toLowerCase() == dest)
+				newParent = theTable.childNodes[i];
+		}
+
+		if (newParent == null) {
+			newParent = doc.createElement(dest);
+
+			if (dest == "thead")
+				theTable.insertBefore(newParent, theTable.firstChild);
+			else
+				theTable.appendChild(newParent);
+		}
+
+		// append the row to the new parent
+		newParent.appendChild(newRow);
+
+		// remove the original
+		tr_elm.parentNode.removeChild(tr_elm);
+
+		// set tr_elm to the new node
+		tr_elm = newRow;
+	}
+}
+
+function changedBackgroundImage() {
+	var formObj = document.forms[0];
+	var st = tinyMCE.parseStyle(formObj.style.value);
+
+	st['background-image'] = "url('" + formObj.backgroundimage.value + "')";
+
+	formObj.style.value = tinyMCE.serializeStyle(st);
+}
+
+function changedStyle() {
+	var formObj = document.forms[0];
+	var st = tinyMCE.parseStyle(formObj.style.value);
+
+	if (st['background-image'])
+		formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
+	else
+		formObj.backgroundimage.value = '';
+
+	if (st['height'])
+		formObj.height.value = trimSize(st['height']);
+
+	if (st['background-color']) {
+		formObj.bgcolor.value = st['background-color'];
+		updateColor('bgcolor_pick','bgcolor');
+	}
+}
+
+function changedSize() {
+	var formObj = document.forms[0];
+	var st = tinyMCE.parseStyle(formObj.style.value);
+
+	var height = formObj.height.value;
+	if (height != "")
+		st['height'] = getCSSSize(height);
+	else
+		st['height'] = "";
+
+	formObj.style.value = tinyMCE.serializeStyle(st);
+}
+
+function changedColor() {
+	var formObj = document.forms[0];
+	var st = tinyMCE.parseStyle(formObj.style.value);
+
+	st['background-color'] = formObj.bgcolor.value;
+
+	formObj.style.value = tinyMCE.serializeStyle(st);
+}

Deleted: plog/trunk/js/tinymce/plugins/table/jscripts/table.js
===================================================================
--- plog/trunk/js/tinymce/plugins/table/jscripts/table.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/table/jscripts/table.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,364 +0,0 @@
-var action, orgTableWidth, orgTableHeight;
-
-function insertTable() {
-	var formObj = document.forms[0];
-	var inst = tinyMCE.selectedInstance;
-	var cols = 2, rows = 2, border = 0, cellpadding = -1, cellspacing = -1, align, width, height, className, caption;
-	var html = '', capEl;
-	var elm = tinyMCE.tableElm;
-	var cellLimit, rowLimit, colLimit;
-
-	if (!AutoValidator.validate(formObj)) {
-		alert(tinyMCE.getLang('lang_invalid_data'));
-		return false;
-	}
-
-	tinyMCEPopup.restoreSelection();
-
-	// Get form data
-	cols = formObj.elements['cols'].value;
-	rows = formObj.elements['rows'].value;
-	border = formObj.elements['border'].value != "" ? formObj.elements['border'].value  : 0;
-	cellpadding = formObj.elements['cellpadding'].value != "" ? formObj.elements['cellpadding'].value : "";
-	cellspacing = formObj.elements['cellspacing'].value != "" ? formObj.elements['cellspacing'].value : "";
-	align = formObj.elements['align'].options[formObj.elements['align'].selectedIndex].value;
-	width = formObj.elements['width'].value;
-	height = formObj.elements['height'].value;
-	bordercolor = formObj.elements['bordercolor'].value;
-	bgcolor = formObj.elements['bgcolor'].value;
-	className = formObj.elements['class'].options[formObj.elements['class'].selectedIndex].value;
-	id = formObj.elements['id'].value;
-	summary = formObj.elements['summary'].value;
-	style = formObj.elements['style'].value;
-	dir = formObj.elements['dir'].value;
-	lang = formObj.elements['lang'].value;
-	background = formObj.elements['backgroundimage'].value;
-	caption = formObj.elements['caption'].checked;
-
-	cellLimit = tinyMCE.getParam('table_cell_limit', false);
-	rowLimit = tinyMCE.getParam('table_row_limit', false);
-	colLimit = tinyMCE.getParam('table_col_limit', false);
-
-	// Validate table size
-	if (colLimit && cols > colLimit) {
-		alert(tinyMCE.getLang('lang_table_col_limit', '', true, {cols : colLimit}));
-		return false;
-	} else if (rowLimit && rows > rowLimit) {
-		alert(tinyMCE.getLang('lang_table_row_limit', '', true, {rows : rowLimit}));
-		return false;
-	} else if (cellLimit && cols * rows > cellLimit) {
-		alert(tinyMCE.getLang('lang_table_cell_limit', '', true, {cells : cellLimit}));
-		return false;
-	}
-
-	// Update table
-	if (action == "update") {
-		inst.execCommand('mceBeginUndoLevel');
-
-		tinyMCE.setAttrib(elm, 'cellPadding', cellpadding, true);
-		tinyMCE.setAttrib(elm, 'cellSpacing', cellspacing, true);
-		tinyMCE.setAttrib(elm, 'border', border, true);
-		tinyMCE.setAttrib(elm, 'align', align);
-		tinyMCE.setAttrib(elm, 'class', className);
-		tinyMCE.setAttrib(elm, 'style', style);
-		tinyMCE.setAttrib(elm, 'id', id);
-		tinyMCE.setAttrib(elm, 'summary', summary);
-		tinyMCE.setAttrib(elm, 'dir', dir);
-		tinyMCE.setAttrib(elm, 'lang', lang);
-
-		capEl = elm.getElementsByTagName('caption')[0];
-
-		if (capEl && !caption)
-			capEl.parentNode.removeChild(capEl);
-
-		if (!capEl && caption) {
-			capEl = elm.ownerDocument.createElement('caption');
-			capEl.innerHTML = ' ';
-			elm.insertBefore(capEl, elm.firstChild);
-		}
-
-		// Not inline styles
-		if (!tinyMCE.getParam("inline_styles"))
-			tinyMCE.setAttrib(elm, 'width', width, true);
-
-		// Remove these since they are not valid XHTML
-		tinyMCE.setAttrib(elm, 'borderColor', '');
-		tinyMCE.setAttrib(elm, 'bgColor', '');
-		tinyMCE.setAttrib(elm, 'background', '');
-		tinyMCE.setAttrib(elm, 'height', '');
-
-		if (background != '')
-			elm.style.backgroundImage = "url('" + background + "')";
-		else
-			elm.style.backgroundImage = '';
-
-		if (tinyMCE.getParam("inline_styles"))
-			elm.style.borderWidth = border + "px";
-
-		if (tinyMCE.getParam("inline_styles")) {
-			if (width != '')
-				elm.style.width = getCSSSize(width);
-		}
-
-		if (bordercolor != "") {
-			elm.style.borderColor = bordercolor;
-			elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle;
-			elm.style.borderWidth = border == "" ? "1px" : border;
-		} else
-			elm.style.borderColor = '';
-
-		elm.style.backgroundColor = bgcolor;
-		elm.style.height = getCSSSize(height);
-
-		tinyMCE.handleVisualAid(tinyMCE.tableElm, false, inst.visualAid, inst);
-
-		// Fix for stange MSIE align bug
-		tinyMCE.tableElm.outerHTML = tinyMCE.tableElm.outerHTML;
-
-		tinyMCE.handleVisualAid(inst.getBody(), true, inst.visualAid, inst);
-		tinyMCE.triggerNodeChange();
-		inst.execCommand('mceEndUndoLevel');
-
-		// Repaint if dimensions changed
-		if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight)
-			inst.repaint();
-
-		tinyMCEPopup.close();
-		return true;
-	}
-
-	// Create new table
-	html += '<table';
-
-	html += makeAttrib('id', id);
-	html += makeAttrib('border', border);
-	html += makeAttrib('cellpadding', cellpadding);
-	html += makeAttrib('cellspacing', cellspacing);
-	html += makeAttrib('width', width);
-	//html += makeAttrib('height', height);
-	//html += makeAttrib('bordercolor', bordercolor);
-	//html += makeAttrib('bgcolor', bgcolor);
-	html += makeAttrib('align', align);
-	html += makeAttrib('class', tinyMCE.getVisualAidClass(className, border == 0));
-	html += makeAttrib('style', style);
-	html += makeAttrib('summary', summary);
-	html += makeAttrib('dir', dir);
-	html += makeAttrib('lang', lang);
-	html += '>';
-
-	if (caption)
-		html += '<caption> </caption>';
-
-	for (var y=0; y<rows; y++) {
-		html += "<tr>";
-
-		for (var x=0; x<cols; x++)
-			html += '<td> </td>';
-
-		html += "</tr>";
-	}
-
-	html += "</table>";
-
-	inst.execCommand('mceBeginUndoLevel');
-	inst.execCommand('mceInsertContent', false, html);
-	tinyMCE.handleVisualAid(inst.getBody(), true, tinyMCE.settings['visual']);
-	inst.execCommand('mceEndUndoLevel');
-
-	tinyMCEPopup.close();
-}
-
-function makeAttrib(attrib, value) {
-	var formObj = document.forms[0];
-	var valueElm = formObj.elements[attrib];
-
-	if (typeof(value) == "undefined" || value == null) {
-		value = "";
-
-		if (valueElm)
-			value = valueElm.value;
-	}
-
-	if (value == "")
-		return "";
-
-	// XML encode it
-	value = value.replace(/&/g, '&');
-	value = value.replace(/\"/g, '"');
-	value = value.replace(/</g, '<');
-	value = value.replace(/>/g, '>');
-
-	return ' ' + attrib + '="' + value + '"';
-}
-
-function init() {
-	tinyMCEPopup.resizeToInnerSize();
-
-	document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
-	document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
-	document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor');
-	document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
-
-	var cols = 2, rows = 2, border = tinyMCE.getParam('table_default_border', '0'), cellpadding = tinyMCE.getParam('table_default_cellpadding', ''), cellspacing = tinyMCE.getParam('table_default_cellspacing', '');
-	var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = "";
-	var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "";
-	var inst = tinyMCE.selectedInstance;
-	var formObj = document.forms[0];
-	var elm = tinyMCE.getParentElement(inst.getFocusElement(), "table");
-
-	tinyMCE.tableElm = elm;
-	action = tinyMCE.getWindowArg('action');
-	if (action == null)
-		action = tinyMCE.tableElm ? "update" : "insert";
-
-	if (tinyMCE.tableElm && action != "insert") {
-		var rowsAr = tinyMCE.tableElm.rows;
-		var cols = 0;
-		for (var i=0; i<rowsAr.length; i++)
-			if (rowsAr[i].cells.length > cols)
-				cols = rowsAr[i].cells.length;
-
-		cols = cols;
-		rows = rowsAr.length;
-
-		st = tinyMCE.parseStyle(tinyMCE.getAttrib(tinyMCE.tableElm, "style"));
-		border = trimSize(getStyle(elm, 'border', 'borderWidth'));
-		cellpadding = tinyMCE.getAttrib(tinyMCE.tableElm, 'cellpadding', "");
-		cellspacing = tinyMCE.getAttrib(tinyMCE.tableElm, 'cellspacing', "");
-		width = trimSize(getStyle(elm, 'width', 'width'));
-		height = trimSize(getStyle(elm, 'height', 'height'));
-		bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor'));
-		bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor'));
-		align = tinyMCE.getAttrib(tinyMCE.tableElm, 'align', align);
-		className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(tinyMCE.tableElm, 'class'), false);
-		id = tinyMCE.getAttrib(tinyMCE.tableElm, 'id');
-		summary = tinyMCE.getAttrib(tinyMCE.tableElm, 'summary');
-		style = tinyMCE.serializeStyle(st);
-		dir = tinyMCE.getAttrib(tinyMCE.tableElm, 'dir');
-		lang = tinyMCE.getAttrib(tinyMCE.tableElm, 'lang');
-		background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
-		formObj.caption.checked = tinyMCE.tableElm.getElementsByTagName('caption').length > 0;
-
-		orgTableWidth = width;
-		orgTableHeight = height;
-
-		action = "update";
-	}
-
-	addClassesToList('class', "table_styles");
-
-	// Update form
-	selectByValue(formObj, 'align', align);
-	selectByValue(formObj, 'class', className);
-	formObj.cols.value = cols;
-	formObj.rows.value = rows;
-	formObj.border.value = border;
-	formObj.cellpadding.value = cellpadding;
-	formObj.cellspacing.value = cellspacing;
-	formObj.width.value = width;
-	formObj.height.value = height;
-	formObj.bordercolor.value = bordercolor;
-	formObj.bgcolor.value = bgcolor;
-	formObj.id.value = id;
-	formObj.summary.value = summary;
-	formObj.style.value = style;
-	formObj.dir.value = dir;
-	formObj.lang.value = lang;
-	formObj.backgroundimage.value = background;
-	formObj.insert.value = tinyMCE.getLang('lang_' + action, 'Insert', true); 
-
-	updateColor('bordercolor_pick', 'bordercolor');
-	updateColor('bgcolor_pick', 'bgcolor');
-
-	// Resize some elements
-	if (isVisible('backgroundimagebrowser'))
-		document.getElementById('backgroundimage').style.width = '180px';
-
-	// Disable some fields in update mode
-	if (action == "update") {
-		formObj.cols.disabled = true;
-		formObj.rows.disabled = true;
-	}
-}
-
-function changedSize() {
-	var formObj = document.forms[0];
-	var st = tinyMCE.parseStyle(formObj.style.value);
-
-	var width = formObj.width.value;
-	if (width != "")
-		st['width'] = tinyMCE.getParam("inline_styles") ? getCSSSize(width) : "";
-	else
-		st['width'] = "";
-
-	var height = formObj.height.value;
-	if (height != "")
-		st['height'] = getCSSSize(height);
-	else
-		st['height'] = "";
-
-	formObj.style.value = tinyMCE.serializeStyle(st);
-}
-
-function changedBackgroundImage() {
-	var formObj = document.forms[0];
-	var st = tinyMCE.parseStyle(formObj.style.value);
-
-	st['background-image'] = "url('" + formObj.backgroundimage.value + "')";
-
-	formObj.style.value = tinyMCE.serializeStyle(st);
-}
-
-function changedBorder() {
-	var formObj = document.forms[0];
-	var st = tinyMCE.parseStyle(formObj.style.value);
-
-	// Update border width if the element has a color
-	if (formObj.border.value != "" && formObj.bordercolor.value != "")
-		st['border-width'] = formObj.border.value + "px";
-
-	formObj.style.value = tinyMCE.serializeStyle(st);
-}
-
-function changedColor() {
-	var formObj = document.forms[0];
-	var st = tinyMCE.parseStyle(formObj.style.value);
-
-	st['background-color'] = formObj.bgcolor.value;
-
-	if (formObj.bordercolor.value != "") {
-		st['border-color'] = formObj.bordercolor.value;
-
-		// Add border-width if it's missing
-		if (!st['border-width'])
-			st['border-width'] = formObj.border.value == "" ? "1px" : formObj.border.value + "px";
-	}
-
-	formObj.style.value = tinyMCE.serializeStyle(st);
-}
-
-function changedStyle() {
-	var formObj = document.forms[0];
-	var st = tinyMCE.parseStyle(formObj.style.value);
-
-	if (st['background-image'])
-		formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
-	else
-		formObj.backgroundimage.value = '';
-
-	if (st['width'])
-		formObj.width.value = trimSize(st['width']);
-
-	if (st['height'])
-		formObj.height.value = trimSize(st['height']);
-
-	if (st['background-color']) {
-		formObj.bgcolor.value = st['background-color'];
-		updateColor('bgcolor_pick','bgcolor');
-	}
-
-	if (st['border-color']) {
-		formObj.bordercolor.value = st['border-color'];
-		updateColor('bordercolor_pick','bordercolor');
-	}
-}

Copied: plog/trunk/js/tinymce/plugins/table/jscripts/table.js (from rev 7165, plog/trunk/js/tinymce/plugins/table/jscripts/table.js)
===================================================================
--- plog/trunk/js/tinymce/plugins/table/jscripts/table.js	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/table/jscripts/table.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,364 @@
+var action, orgTableWidth, orgTableHeight;
+
+function insertTable() {
+	var formObj = document.forms[0];
+	var inst = tinyMCE.selectedInstance;
+	var cols = 2, rows = 2, border = 0, cellpadding = -1, cellspacing = -1, align, width, height, className, caption;
+	var html = '', capEl;
+	var elm = tinyMCE.tableElm;
+	var cellLimit, rowLimit, colLimit;
+
+	if (!AutoValidator.validate(formObj)) {
+		alert(tinyMCE.getLang('lang_invalid_data'));
+		return false;
+	}
+
+	tinyMCEPopup.restoreSelection();
+
+	// Get form data
+	cols = formObj.elements['cols'].value;
+	rows = formObj.elements['rows'].value;
+	border = formObj.elements['border'].value != "" ? formObj.elements['border'].value  : 0;
+	cellpadding = formObj.elements['cellpadding'].value != "" ? formObj.elements['cellpadding'].value : "";
+	cellspacing = formObj.elements['cellspacing'].value != "" ? formObj.elements['cellspacing'].value : "";
+	align = formObj.elements['align'].options[formObj.elements['align'].selectedIndex].value;
+	width = formObj.elements['width'].value;
+	height = formObj.elements['height'].value;
+	bordercolor = formObj.elements['bordercolor'].value;
+	bgcolor = formObj.elements['bgcolor'].value;
+	className = formObj.elements['class'].options[formObj.elements['class'].selectedIndex].value;
+	id = formObj.elements['id'].value;
+	summary = formObj.elements['summary'].value;
+	style = formObj.elements['style'].value;
+	dir = formObj.elements['dir'].value;
+	lang = formObj.elements['lang'].value;
+	background = formObj.elements['backgroundimage'].value;
+	caption = formObj.elements['caption'].checked;
+
+	cellLimit = tinyMCE.getParam('table_cell_limit', false);
+	rowLimit = tinyMCE.getParam('table_row_limit', false);
+	colLimit = tinyMCE.getParam('table_col_limit', false);
+
+	// Validate table size
+	if (colLimit && cols > colLimit) {
+		alert(tinyMCE.getLang('lang_table_col_limit', '', true, {cols : colLimit}));
+		return false;
+	} else if (rowLimit && rows > rowLimit) {
+		alert(tinyMCE.getLang('lang_table_row_limit', '', true, {rows : rowLimit}));
+		return false;
+	} else if (cellLimit && cols * rows > cellLimit) {
+		alert(tinyMCE.getLang('lang_table_cell_limit', '', true, {cells : cellLimit}));
+		return false;
+	}
+
+	// Update table
+	if (action == "update") {
+		inst.execCommand('mceBeginUndoLevel');
+
+		tinyMCE.setAttrib(elm, 'cellPadding', cellpadding, true);
+		tinyMCE.setAttrib(elm, 'cellSpacing', cellspacing, true);
+		tinyMCE.setAttrib(elm, 'border', border, true);
+		tinyMCE.setAttrib(elm, 'align', align);
+		tinyMCE.setAttrib(elm, 'class', className);
+		tinyMCE.setAttrib(elm, 'style', style);
+		tinyMCE.setAttrib(elm, 'id', id);
+		tinyMCE.setAttrib(elm, 'summary', summary);
+		tinyMCE.setAttrib(elm, 'dir', dir);
+		tinyMCE.setAttrib(elm, 'lang', lang);
+
+		capEl = elm.getElementsByTagName('caption')[0];
+
+		if (capEl && !caption)
+			capEl.parentNode.removeChild(capEl);
+
+		if (!capEl && caption) {
+			capEl = elm.ownerDocument.createElement('caption');
+			capEl.innerHTML = ' ';
+			elm.insertBefore(capEl, elm.firstChild);
+		}
+
+		// Not inline styles
+		if (!tinyMCE.getParam("inline_styles"))
+			tinyMCE.setAttrib(elm, 'width', width, true);
+
+		// Remove these since they are not valid XHTML
+		tinyMCE.setAttrib(elm, 'borderColor', '');
+		tinyMCE.setAttrib(elm, 'bgColor', '');
+		tinyMCE.setAttrib(elm, 'background', '');
+		tinyMCE.setAttrib(elm, 'height', '');
+
+		if (background != '')
+			elm.style.backgroundImage = "url('" + background + "')";
+		else
+			elm.style.backgroundImage = '';
+
+		if (tinyMCE.getParam("inline_styles"))
+			elm.style.borderWidth = border + "px";
+
+		if (tinyMCE.getParam("inline_styles")) {
+			if (width != '')
+				elm.style.width = getCSSSize(width);
+		}
+
+		if (bordercolor != "") {
+			elm.style.borderColor = bordercolor;
+			elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle;
+			elm.style.borderWidth = border == "" ? "1px" : border;
+		} else
+			elm.style.borderColor = '';
+
+		elm.style.backgroundColor = bgcolor;
+		elm.style.height = getCSSSize(height);
+
+		tinyMCE.handleVisualAid(tinyMCE.tableElm, false, inst.visualAid, inst);
+
+		// Fix for stange MSIE align bug
+		tinyMCE.tableElm.outerHTML = tinyMCE.tableElm.outerHTML;
+
+		tinyMCE.handleVisualAid(inst.getBody(), true, inst.visualAid, inst);
+		tinyMCE.triggerNodeChange();
+		inst.execCommand('mceEndUndoLevel');
+
+		// Repaint if dimensions changed
+		if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight)
+			inst.repaint();
+
+		tinyMCEPopup.close();
+		return true;
+	}
+
+	// Create new table
+	html += '<table';
+
+	html += makeAttrib('id', id);
+	html += makeAttrib('border', border);
+	html += makeAttrib('cellpadding', cellpadding);
+	html += makeAttrib('cellspacing', cellspacing);
+	html += makeAttrib('width', width);
+	//html += makeAttrib('height', height);
+	//html += makeAttrib('bordercolor', bordercolor);
+	//html += makeAttrib('bgcolor', bgcolor);
+	html += makeAttrib('align', align);
+	html += makeAttrib('class', tinyMCE.getVisualAidClass(className, border == 0));
+	html += makeAttrib('style', style);
+	html += makeAttrib('summary', summary);
+	html += makeAttrib('dir', dir);
+	html += makeAttrib('lang', lang);
+	html += '>';
+
+	if (caption)
+		html += '<caption> </caption>';
+
+	for (var y=0; y<rows; y++) {
+		html += "<tr>";
+
+		for (var x=0; x<cols; x++)
+			html += '<td> </td>';
+
+		html += "</tr>";
+	}
+
+	html += "</table>";
+
+	inst.execCommand('mceBeginUndoLevel');
+	inst.execCommand('mceInsertContent', false, html);
+	tinyMCE.handleVisualAid(inst.getBody(), true, tinyMCE.settings['visual']);
+	inst.execCommand('mceEndUndoLevel');
+
+	tinyMCEPopup.close();
+}
+
+function makeAttrib(attrib, value) {
+	var formObj = document.forms[0];
+	var valueElm = formObj.elements[attrib];
+
+	if (typeof(value) == "undefined" || value == null) {
+		value = "";
+
+		if (valueElm)
+			value = valueElm.value;
+	}
+
+	if (value == "")
+		return "";
+
+	// XML encode it
+	value = value.replace(/&/g, '&');
+	value = value.replace(/\"/g, '"');
+	value = value.replace(/</g, '<');
+	value = value.replace(/>/g, '>');
+
+	return ' ' + attrib + '="' + value + '"';
+}
+
+function init() {
+	tinyMCEPopup.resizeToInnerSize();
+
+	document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
+	document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
+	document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor');
+	document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
+
+	var cols = 2, rows = 2, border = tinyMCE.getParam('table_default_border', '0'), cellpadding = tinyMCE.getParam('table_default_cellpadding', ''), cellspacing = tinyMCE.getParam('table_default_cellspacing', '');
+	var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = "";
+	var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "";
+	var inst = tinyMCE.selectedInstance;
+	var formObj = document.forms[0];
+	var elm = tinyMCE.getParentElement(inst.getFocusElement(), "table");
+
+	tinyMCE.tableElm = elm;
+	action = tinyMCE.getWindowArg('action');
+	if (action == null)
+		action = tinyMCE.tableElm ? "update" : "insert";
+
+	if (tinyMCE.tableElm && action != "insert") {
+		var rowsAr = tinyMCE.tableElm.rows;
+		var cols = 0;
+		for (var i=0; i<rowsAr.length; i++)
+			if (rowsAr[i].cells.length > cols)
+				cols = rowsAr[i].cells.length;
+
+		cols = cols;
+		rows = rowsAr.length;
+
+		st = tinyMCE.parseStyle(tinyMCE.getAttrib(tinyMCE.tableElm, "style"));
+		border = trimSize(getStyle(elm, 'border', 'borderWidth'));
+		cellpadding = tinyMCE.getAttrib(tinyMCE.tableElm, 'cellpadding', "");
+		cellspacing = tinyMCE.getAttrib(tinyMCE.tableElm, 'cellspacing', "");
+		width = trimSize(getStyle(elm, 'width', 'width'));
+		height = trimSize(getStyle(elm, 'height', 'height'));
+		bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor'));
+		bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor'));
+		align = tinyMCE.getAttrib(tinyMCE.tableElm, 'align', align);
+		className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(tinyMCE.tableElm, 'class'), false);
+		id = tinyMCE.getAttrib(tinyMCE.tableElm, 'id');
+		summary = tinyMCE.getAttrib(tinyMCE.tableElm, 'summary');
+		style = tinyMCE.serializeStyle(st);
+		dir = tinyMCE.getAttrib(tinyMCE.tableElm, 'dir');
+		lang = tinyMCE.getAttrib(tinyMCE.tableElm, 'lang');
+		background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
+		formObj.caption.checked = tinyMCE.tableElm.getElementsByTagName('caption').length > 0;
+
+		orgTableWidth = width;
+		orgTableHeight = height;
+
+		action = "update";
+	}
+
+	addClassesToList('class', "table_styles");
+
+	// Update form
+	selectByValue(formObj, 'align', align);
+	selectByValue(formObj, 'class', className);
+	formObj.cols.value = cols;
+	formObj.rows.value = rows;
+	formObj.border.value = border;
+	formObj.cellpadding.value = cellpadding;
+	formObj.cellspacing.value = cellspacing;
+	formObj.width.value = width;
+	formObj.height.value = height;
+	formObj.bordercolor.value = bordercolor;
+	formObj.bgcolor.value = bgcolor;
+	formObj.id.value = id;
+	formObj.summary.value = summary;
+	formObj.style.value = style;
+	formObj.dir.value = dir;
+	formObj.lang.value = lang;
+	formObj.backgroundimage.value = background;
+	formObj.insert.value = tinyMCE.getLang('lang_' + action, 'Insert', true); 
+
+	updateColor('bordercolor_pick', 'bordercolor');
+	updateColor('bgcolor_pick', 'bgcolor');
+
+	// Resize some elements
+	if (isVisible('backgroundimagebrowser'))
+		document.getElementById('backgroundimage').style.width = '180px';
+
+	// Disable some fields in update mode
+	if (action == "update") {
+		formObj.cols.disabled = true;
+		formObj.rows.disabled = true;
+	}
+}
+
+function changedSize() {
+	var formObj = document.forms[0];
+	var st = tinyMCE.parseStyle(formObj.style.value);
+
+	var width = formObj.width.value;
+	if (width != "")
+		st['width'] = tinyMCE.getParam("inline_styles") ? getCSSSize(width) : "";
+	else
+		st['width'] = "";
+
+	var height = formObj.height.value;
+	if (height != "")
+		st['height'] = getCSSSize(height);
+	else
+		st['height'] = "";
+
+	formObj.style.value = tinyMCE.serializeStyle(st);
+}
+
+function changedBackgroundImage() {
+	var formObj = document.forms[0];
+	var st = tinyMCE.parseStyle(formObj.style.value);
+
+	st['background-image'] = "url('" + formObj.backgroundimage.value + "')";
+
+	formObj.style.value = tinyMCE.serializeStyle(st);
+}
+
+function changedBorder() {
+	var formObj = document.forms[0];
+	var st = tinyMCE.parseStyle(formObj.style.value);
+
+	// Update border width if the element has a color
+	if (formObj.border.value != "" && formObj.bordercolor.value != "")
+		st['border-width'] = formObj.border.value + "px";
+
+	formObj.style.value = tinyMCE.serializeStyle(st);
+}
+
+function changedColor() {
+	var formObj = document.forms[0];
+	var st = tinyMCE.parseStyle(formObj.style.value);
+
+	st['background-color'] = formObj.bgcolor.value;
+
+	if (formObj.bordercolor.value != "") {
+		st['border-color'] = formObj.bordercolor.value;
+
+		// Add border-width if it's missing
+		if (!st['border-width'])
+			st['border-width'] = formObj.border.value == "" ? "1px" : formObj.border.value + "px";
+	}
+
+	formObj.style.value = tinyMCE.serializeStyle(st);
+}
+
+function changedStyle() {
+	var formObj = document.forms[0];
+	var st = tinyMCE.parseStyle(formObj.style.value);
+
+	if (st['background-image'])
+		formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
+	else
+		formObj.backgroundimage.value = '';
+
+	if (st['width'])
+		formObj.width.value = trimSize(st['width']);
+
+	if (st['height'])
+		formObj.height.value = trimSize(st['height']);
+
+	if (st['background-color']) {
+		formObj.bgcolor.value = st['background-color'];
+		updateColor('bgcolor_pick','bgcolor');
+	}
+
+	if (st['border-color']) {
+		formObj.bordercolor.value = st['border-color'];
+		updateColor('bordercolor_pick','bordercolor');
+	}
+}

Deleted: plog/trunk/js/tinymce/plugins/table/langs/en.js
===================================================================
--- plog/trunk/js/tinymce/plugins/table/langs/en.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/table/langs/en.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,79 +0,0 @@
-// UK lang variables
-
-tinyMCE.addToLang('table',{
-general_tab : 'General',
-advanced_tab : 'Advanced',
-general_props : 'General properties',
-advanced_props : 'Advanced properties',
-desc : 'Inserts a new table',
-row_before_desc : 'Insert row before',
-row_after_desc : 'Insert row after',
-delete_row_desc : 'Delete row',
-col_before_desc : 'Insert column before',
-col_after_desc : 'Insert column after',
-delete_col_desc : 'Remove column',
-rowtype : 'Row in table part',
-title : 'Insert/Modify table',
-width : 'Width',
-height : 'Height',
-cols : 'Columns',
-rows : 'Rows',
-cellspacing : 'Cellspacing',
-cellpadding : 'Cellpadding',
-border : 'Border',
-align : 'Alignment',
-align_default : 'Default',
-align_left : 'Left',
-align_right : 'Right',
-align_middle : 'Center',
-row_title : 'Table row properties',
-cell_title : 'Table cell properties',
-cell_type : 'Cell type',
-row_desc : 'Table row properties',
-cell_desc : 'Table cell properties',
-valign : 'Vertical alignment',
-align_top : 'Top',
-align_bottom : 'Bottom',
-props_desc : 'Table properties',
-bordercolor : 'Border color',
-bgcolor : 'Background color',
-merge_cells_title : 'Merge table cells',
-split_cells_desc : 'Split merged table cells',
-merge_cells_desc : 'Merge table cells',
-cut_row_desc : 'Cut table row',
-copy_row_desc : 'Copy table row',
-paste_row_before_desc : 'Paste table row before',
-paste_row_after_desc : 'Paste table row after',
-id : 'Id',
-style: 'Style',
-langdir : 'Language direction',
-langcode : 'Language code',
-mime : 'Target MIME type',
-ltr : 'Left to right',
-rtl : 'Right to left',
-bgimage : 'Background image',
-summary : 'Summary',
-td : "Data",
-th : "Header",
-cell_cell : 'Update current cell',
-cell_row : 'Update all cells in row',
-cell_all : 'Update all cells in table',
-row_row : 'Update current row',
-row_odd : 'Update odd rows in table',
-row_even : 'Update even rows in table',
-row_all : 'Update all rows in table',
-thead : 'Table Head',
-tbody : 'Table Body',
-tfoot : 'Table Foot',
-del : 'Delete table',
-scope : 'Scope',
-row : 'Row',
-col : 'Col',
-rowgroup : 'Row Group',
-colgroup : 'Col Group',
-col_limit : 'You\'ve exceeded the maximum number of columns of {$cols}.',
-row_limit : 'You\'ve exceeded the maximum number of rows of {$rows}.',
-cell_limit : 'You\'ve exceeded the maximum number of cells of {$cells}.',
-missing_scope: 'Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.',
-caption : 'Table caption'
-});

Copied: plog/trunk/js/tinymce/plugins/table/langs/en.js (from rev 7165, plog/trunk/js/tinymce/plugins/table/langs/en.js)
===================================================================
--- plog/trunk/js/tinymce/plugins/table/langs/en.js	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/table/langs/en.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,79 @@
+// UK lang variables
+
+tinyMCE.addToLang('table',{
+general_tab : 'General',
+advanced_tab : 'Advanced',
+general_props : 'General properties',
+advanced_props : 'Advanced properties',
+desc : 'Inserts a new table',
+row_before_desc : 'Insert row before',
+row_after_desc : 'Insert row after',
+delete_row_desc : 'Delete row',
+col_before_desc : 'Insert column before',
+col_after_desc : 'Insert column after',
+delete_col_desc : 'Remove column',
+rowtype : 'Row in table part',
+title : 'Insert/Modify table',
+width : 'Width',
+height : 'Height',
+cols : 'Columns',
+rows : 'Rows',
+cellspacing : 'Cellspacing',
+cellpadding : 'Cellpadding',
+border : 'Border',
+align : 'Alignment',
+align_default : 'Default',
+align_left : 'Left',
+align_right : 'Right',
+align_middle : 'Center',
+row_title : 'Table row properties',
+cell_title : 'Table cell properties',
+cell_type : 'Cell type',
+row_desc : 'Table row properties',
+cell_desc : 'Table cell properties',
+valign : 'Vertical alignment',
+align_top : 'Top',
+align_bottom : 'Bottom',
+props_desc : 'Table properties',
+bordercolor : 'Border color',
+bgcolor : 'Background color',
+merge_cells_title : 'Merge table cells',
+split_cells_desc : 'Split merged table cells',
+merge_cells_desc : 'Merge table cells',
+cut_row_desc : 'Cut table row',
+copy_row_desc : 'Copy table row',
+paste_row_before_desc : 'Paste table row before',
+paste_row_after_desc : 'Paste table row after',
+id : 'Id',
+style: 'Style',
+langdir : 'Language direction',
+langcode : 'Language code',
+mime : 'Target MIME type',
+ltr : 'Left to right',
+rtl : 'Right to left',
+bgimage : 'Background image',
+summary : 'Summary',
+td : "Data",
+th : "Header",
+cell_cell : 'Update current cell',
+cell_row : 'Update all cells in row',
+cell_all : 'Update all cells in table',
+row_row : 'Update current row',
+row_odd : 'Update odd rows in table',
+row_even : 'Update even rows in table',
+row_all : 'Update all rows in table',
+thead : 'Table Head',
+tbody : 'Table Body',
+tfoot : 'Table Foot',
+del : 'Delete table',
+scope : 'Scope',
+row : 'Row',
+col : 'Col',
+rowgroup : 'Row Group',
+colgroup : 'Col Group',
+col_limit : 'You\'ve exceeded the maximum number of columns of {$cols}.',
+row_limit : 'You\'ve exceeded the maximum number of rows of {$rows}.',
+cell_limit : 'You\'ve exceeded the maximum number of cells of {$cells}.',
+missing_scope: 'Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.',
+caption : 'Table caption'
+});

Deleted: plog/trunk/js/tinymce/plugins/table/merge_cells.htm
===================================================================
--- plog/trunk/js/tinymce/plugins/table/merge_cells.htm	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/table/merge_cells.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,38 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-	<title>{$lang_table_merge_cells_title}</title>
-	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
-	<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
-	<script language="javascript" type="text/javascript" src="../../utils/validate.js"></script>
-	<script language="javascript" type="text/javascript" src="jscripts/merge_cells.js"></script>
-	<base target="_self" />
-</head>
-<body onload="tinyMCEPopup.executeOnLoad('init();');" style="margin: 8px" style="display: none">
-<form onsubmit="insertTable();return false;" action="#">
-	<fieldset>
-		<legend>{$lang_table_merge_cells_title}</legend>
-		  <table border="0" cellpadding="0" cellspacing="3" width="100%">
-			  <tr>
-				<td>{$lang_table_cols}:</td>
-				<td align="right"><input type="text" name="numcols" value="" class="number min1" style="width: 30px" /></td>
-				<td>
-			  </tr>
-			  <tr>
-				<td>{$lang_table_rows}:</td>
-				<td align="right"><input type="text" name="numrows" value="" class="number min1" style="width: 30px" /></td>
-			  </tr>
-		  </table>
-	</fieldset>
-
-	<div class="mceActionPanel">
-		<div style="float: left">
-			<input type="button" id="insert" name="insert" value="{$lang_update}" onclick="mergeCells();" />
-		</div>
-
-		<div style="float: right">
-			<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
-		</div>
-	</div>
-</form>
-</body>
-</html>

Copied: plog/trunk/js/tinymce/plugins/table/merge_cells.htm (from rev 7165, plog/trunk/js/tinymce/plugins/table/merge_cells.htm)
===================================================================
--- plog/trunk/js/tinymce/plugins/table/merge_cells.htm	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/table/merge_cells.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,38 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{$lang_table_merge_cells_title}</title>
+	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script language="javascript" type="text/javascript" src="../../utils/validate.js"></script>
+	<script language="javascript" type="text/javascript" src="jscripts/merge_cells.js"></script>
+	<base target="_self" />
+</head>
+<body onload="tinyMCEPopup.executeOnLoad('init();');" style="margin: 8px" style="display: none">
+<form onsubmit="insertTable();return false;" action="#">
+	<fieldset>
+		<legend>{$lang_table_merge_cells_title}</legend>
+		  <table border="0" cellpadding="0" cellspacing="3" width="100%">
+			  <tr>
+				<td>{$lang_table_cols}:</td>
+				<td align="right"><input type="text" name="numcols" value="" class="number min1" style="width: 30px" /></td>
+				<td>
+			  </tr>
+			  <tr>
+				<td>{$lang_table_rows}:</td>
+				<td align="right"><input type="text" name="numrows" value="" class="number min1" style="width: 30px" /></td>
+			  </tr>
+		  </table>
+	</fieldset>
+
+	<div class="mceActionPanel">
+		<div style="float: left">
+			<input type="button" id="insert" name="insert" value="{$lang_update}" onclick="mergeCells();" />
+		</div>
+
+		<div style="float: right">
+			<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
+		</div>
+	</div>
+</form>
+</body>
+</html>

Deleted: plog/trunk/js/tinymce/plugins/table/readme.txt
===================================================================
--- plog/trunk/js/tinymce/plugins/table/readme.txt	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/table/readme.txt	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1 +0,0 @@
-Check the TinyMCE documentation for details on this plugin.

Copied: plog/trunk/js/tinymce/plugins/table/readme.txt (from rev 7165, plog/trunk/js/tinymce/plugins/table/readme.txt)
===================================================================
--- plog/trunk/js/tinymce/plugins/table/readme.txt	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/table/readme.txt	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1 @@
+Check the TinyMCE documentation for details on this plugin.

Deleted: plog/trunk/js/tinymce/plugins/table/row.htm
===================================================================
--- plog/trunk/js/tinymce/plugins/table/row.htm	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/table/row.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,159 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-	<title>{$lang_table_row_title}</title>
-	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
-	<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
-	<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
-	<script language="javascript" type="text/javascript" src="jscripts/row.js"></script>
-	<link href="css/row.css" rel="stylesheet" type="text/css" />
-	<base target="_self" />
-</head>
-<body id="tablerow" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
-	<form onsubmit="updateAction();return false;">
-		<div class="tabs">
-			<ul>
-				<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_table_general_tab}</a></span></li>
-				<li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{$lang_table_advanced_tab}</a></span></li>
-			</ul>
-		</div>
-
-		<div class="panel_wrapper">
-			<div id="general_panel" class="panel current">
-				<fieldset>
-					<legend>{$lang_table_general_props}</legend>
-
-					<table border="0" cellpadding="4" cellspacing="0">
-						<tr>
-							<td><label for="rowtype">{$lang_table_rowtype}</label></td>
-							<td class="col2">
-								<select id="rowtype" name="rowtype">
-									<option value="thead">{$lang_table_thead}</option>
-									<option value="tbody">{$lang_table_tbody}</option>
-									<option value="tfoot">{$lang_table_tfoot}</option>
-								</select>
-							</td>
-						</tr>
-
-						<tr>
-							<td><label for="align">{$lang_table_align}</label></td>
-							<td class="col2">
-								<select id="align" name="align">
-									<option value="">{$lang_not_set}</option>
-									<option value="center">{$lang_table_align_middle}</option>
-									<option value="left">{$lang_table_align_left}</option>
-									<option value="right">{$lang_table_align_right}</option>
-								</select>
-							</td>
-						</tr>
-
-						<tr>
-							<td><label for="valign">{$lang_table_valign}</label></td>
-							<td class="col2">
-								<select id="valign" name="valign">
-									<option value="">{$lang_not_set}</option>
-									<option value="top">{$lang_table_align_top}</option>
-									<option value="middle">{$lang_table_align_middle}</option>
-									<option value="bottom">{$lang_table_align_bottom}</option>
-								</select>
-							</td>
-						</tr>
-
-						<tr id="styleSelectRow">
-							<td><label for="class">{$lang_class_name}</label></td>
-							<td class="col2">
-								<select id="class" name="class">
-									<option value="" selected="selected">{$lang_not_set}</option>
-								</select>
-							</td>
-						</tr>
-
-						<tr>
-							<td><label for="height">{$lang_table_height}</label></td>
-							<td class="col2"><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
-						</tr>
-					</table>
-				</fieldset>
-			</div>
-
-			<div id="advanced_panel" class="panel">
-				<fieldset>
-					<legend>{$lang_table_advanced_props}</legend>
-
-					<table border="0" cellpadding="0" cellspacing="4">
-						<tr>
-							<td class="column1"><label for="id">{$lang_table_id}</label></td> 
-							<td><input id="id" name="id" type="text" value="" style="width: 200px" /></td> 
-						</tr>
-
-						<tr>
-							<td><label for="style">{$lang_table_style}</label></td>
-							<td><input type="text" id="style" name="style" value="" style="width: 200px;" onchange="changedStyle();" /></td>
-						</tr>
-
-						<tr>
-							<td class="column1"><label for="dir">{$lang_table_langdir}</label></td> 
-							<td>
-								<select id="dir" name="dir" style="width: 200px"> 
-										<option value="">{$lang_not_set}</option> 
-										<option value="ltr">{$lang_table_ltr}</option> 
-										<option value="rtl">{$lang_table_rtl}</option> 
-								</select>
-							</td> 
-						</tr>
-
-						<tr>
-							<td class="column1"><label for="lang">{$lang_table_langcode}</label></td> 
-							<td>
-								<input id="lang" name="lang" type="text" value="" style="width: 200px" />
-							</td> 
-						</tr>
-
-						<tr>
-							<td class="column1"><label for="backgroundimage">{$lang_table_bgimage}</label></td> 
-							<td>
-								<table border="0" cellpadding="0" cellspacing="0">
-									<tr>
-										<td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td>
-										<td id="backgroundimagebrowsercontainer"> </td>
-									</tr>
-								</table>
-							</td> 
-						</tr>
-
-						<tr>
-							<td class="column1"><label for="bgcolor">{$lang_table_bgcolor}</label></td> 
-							<td>
-								<table border="0" cellpadding="0" cellspacing="0">
-									<tr>
-										<td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
-										<td id="bgcolor_pickcontainer"> </td>
-									</tr>
-								</table>
-							</td> 
-						</tr>
-					</table>
-				</fieldset>
-			</div>
-		</div>
-
-		<div class="mceActionPanel">
-			<div>
-				<select id="action" name="action">
-					<option value="row">{$lang_table_row_row}</option>
-					<option value="odd">{$lang_table_row_odd}</option>
-					<option value="even">{$lang_table_row_even}</option>
-					<option value="all">{$lang_table_row_all}</option>
-				</select>
-			</div>
-
-			<div style="float: left">
-				<div><input type="button" id="insert" name="insert" value="{$lang_update}" onclick="updateAction();" /></div>
-			</div>
-
-			<div style="float: right">
-				<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
-			</div>
-		</div>
-	</form>
-</body>
-</html>

Copied: plog/trunk/js/tinymce/plugins/table/row.htm (from rev 7165, plog/trunk/js/tinymce/plugins/table/row.htm)
===================================================================
--- plog/trunk/js/tinymce/plugins/table/row.htm	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/table/row.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,159 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{$lang_table_row_title}</title>
+	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
+	<script language="javascript" type="text/javascript" src="jscripts/row.js"></script>
+	<link href="css/row.css" rel="stylesheet" type="text/css" />
+	<base target="_self" />
+</head>
+<body id="tablerow" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
+	<form onsubmit="updateAction();return false;">
+		<div class="tabs">
+			<ul>
+				<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_table_general_tab}</a></span></li>
+				<li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{$lang_table_advanced_tab}</a></span></li>
+			</ul>
+		</div>
+
+		<div class="panel_wrapper">
+			<div id="general_panel" class="panel current">
+				<fieldset>
+					<legend>{$lang_table_general_props}</legend>
+
+					<table border="0" cellpadding="4" cellspacing="0">
+						<tr>
+							<td><label for="rowtype">{$lang_table_rowtype}</label></td>
+							<td class="col2">
+								<select id="rowtype" name="rowtype">
+									<option value="thead">{$lang_table_thead}</option>
+									<option value="tbody">{$lang_table_tbody}</option>
+									<option value="tfoot">{$lang_table_tfoot}</option>
+								</select>
+							</td>
+						</tr>
+
+						<tr>
+							<td><label for="align">{$lang_table_align}</label></td>
+							<td class="col2">
+								<select id="align" name="align">
+									<option value="">{$lang_not_set}</option>
+									<option value="center">{$lang_table_align_middle}</option>
+									<option value="left">{$lang_table_align_left}</option>
+									<option value="right">{$lang_table_align_right}</option>
+								</select>
+							</td>
+						</tr>
+
+						<tr>
+							<td><label for="valign">{$lang_table_valign}</label></td>
+							<td class="col2">
+								<select id="valign" name="valign">
+									<option value="">{$lang_not_set}</option>
+									<option value="top">{$lang_table_align_top}</option>
+									<option value="middle">{$lang_table_align_middle}</option>
+									<option value="bottom">{$lang_table_align_bottom}</option>
+								</select>
+							</td>
+						</tr>
+
+						<tr id="styleSelectRow">
+							<td><label for="class">{$lang_class_name}</label></td>
+							<td class="col2">
+								<select id="class" name="class">
+									<option value="" selected="selected">{$lang_not_set}</option>
+								</select>
+							</td>
+						</tr>
+
+						<tr>
+							<td><label for="height">{$lang_table_height}</label></td>
+							<td class="col2"><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
+						</tr>
+					</table>
+				</fieldset>
+			</div>
+
+			<div id="advanced_panel" class="panel">
+				<fieldset>
+					<legend>{$lang_table_advanced_props}</legend>
+
+					<table border="0" cellpadding="0" cellspacing="4">
+						<tr>
+							<td class="column1"><label for="id">{$lang_table_id}</label></td> 
+							<td><input id="id" name="id" type="text" value="" style="width: 200px" /></td> 
+						</tr>
+
+						<tr>
+							<td><label for="style">{$lang_table_style}</label></td>
+							<td><input type="text" id="style" name="style" value="" style="width: 200px;" onchange="changedStyle();" /></td>
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="dir">{$lang_table_langdir}</label></td> 
+							<td>
+								<select id="dir" name="dir" style="width: 200px"> 
+										<option value="">{$lang_not_set}</option> 
+										<option value="ltr">{$lang_table_ltr}</option> 
+										<option value="rtl">{$lang_table_rtl}</option> 
+								</select>
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="lang">{$lang_table_langcode}</label></td> 
+							<td>
+								<input id="lang" name="lang" type="text" value="" style="width: 200px" />
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="backgroundimage">{$lang_table_bgimage}</label></td> 
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td>
+										<td id="backgroundimagebrowsercontainer"> </td>
+									</tr>
+								</table>
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="bgcolor">{$lang_table_bgcolor}</label></td> 
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
+										<td id="bgcolor_pickcontainer"> </td>
+									</tr>
+								</table>
+							</td> 
+						</tr>
+					</table>
+				</fieldset>
+			</div>
+		</div>
+
+		<div class="mceActionPanel">
+			<div>
+				<select id="action" name="action">
+					<option value="row">{$lang_table_row_row}</option>
+					<option value="odd">{$lang_table_row_odd}</option>
+					<option value="even">{$lang_table_row_even}</option>
+					<option value="all">{$lang_table_row_all}</option>
+				</select>
+			</div>
+
+			<div style="float: left">
+				<div><input type="button" id="insert" name="insert" value="{$lang_update}" onclick="updateAction();" /></div>
+			</div>
+
+			<div style="float: right">
+				<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
+			</div>
+		</div>
+	</form>
+</body>
+</html>

Deleted: plog/trunk/js/tinymce/plugins/table/table.htm
===================================================================
--- plog/trunk/js/tinymce/plugins/table/table.htm	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/plugins/table/table.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,160 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-	<title>{$lang_table_title}</title>
-	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
-	<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
-	<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
-	<script language="javascript" type="text/javascript" src="../../utils/validate.js"></script>
-	<script language="javascript" type="text/javascript" src="jscripts/table.js"></script>
-	<link href="css/table.css" rel="stylesheet" type="text/css" />
-	<base target="_self" />
-</head>
-<body id="table" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
-	<form onsubmit="insertTable();return false;" action="#">
-		<div class="tabs">
-			<ul>
-				<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_table_general_tab}</a></span></li>
-				<li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{$lang_table_advanced_tab}</a></span></li>
-			</ul>
-		</div>
-
-		<div class="panel_wrapper">
-			<div id="general_panel" class="panel current">
-				<fieldset>
-					<legend>{$lang_table_general_props}</legend>
-
-					  <table border="0" cellpadding="4" cellspacing="0" width="100%">
-							  <tr>
-								<td><label id="colslabel" for="cols">{$lang_table_cols}</label></td>
-								<td><input id="cols" name="cols" type="text" value="" size="3" maxlength="3" class="required number min1" /></td>
-								<td><label id="rowslabel" for="rows">{$lang_table_rows}</label></td>
-								<td><input id="rows" name="rows" type="text" value="" size="3" maxlength="3" class="required number min1" /></td>
-							  </tr>
-							  <tr>
-								<td><label id="cellpaddinglabel" for="cellpadding">{$lang_table_cellpadding}</label></td>
-								<td><input id="cellpadding" name="cellpadding" type="text" value="" size="3" maxlength="3" class="number" /></td>
-								<td><label id="cellspacinglabel" for="cellspacing">{$lang_table_cellspacing}</label></td>
-								<td><input id="cellspacing" name="cellspacing" type="text" value="" size="3" maxlength="3" class="number" /></td>
-							  </tr>
-							  <tr>
-								<td><label id="alignlabel" for="align">{$lang_table_align}</label></td>
-								<td><select id="align" name="align">
-									<option value="">{$lang_not_set}</option>
-									<option value="center">{$lang_table_align_middle}</option>
-									<option value="left">{$lang_table_align_left}</option>
-									<option value="right">{$lang_table_align_right}</option>
-								  </select></td>
-								<td><label id="borderlabel" for="border">{$lang_table_border}</label></td>
-								<td><input id="border" name="border" type="text" value="" size="3" maxlength="3" onchange="changedBorder();" class="number" /></td>
-							  </tr>
-							  <tr id="width_row">
-								<td><label id="widthlabel" for="width">{$lang_table_width}</label></td>
-								<td><input name="width" type="text" id="width" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td>
-								<td><label id="heightlabel" for="height">{$lang_table_height}</label></td>
-								<td><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td>
-							  </tr>
-							  <tr id="styleSelectRow">
-								<td><label id="classlabel" for="class">{$lang_class_name}</label></td>
-								<td colspan="3">
-								 <select id="class" name="class">
-									<option value="" selected>{$lang_not_set}</option>
-								 </select></td>
-							  </tr>
-							  <tr>
-								<td class="column1"><label for="caption">{$lang_table_caption}</label></td> 
-								<td><input id="caption" name="caption" type="checkbox" class="checkbox" value="true" /></td> 
-							  </tr>
-							</table>
-				</fieldset>
-			</div>
-
-			<div id="advanced_panel" class="panel">
-				<fieldset>
-					<legend>{$lang_table_advanced_props}</legend>
-
-					<table border="0" cellpadding="0" cellspacing="4">
-						<tr>
-							<td class="column1"><label for="id">{$lang_table_id}</label></td> 
-							<td><input id="id" name="id" type="text" value="" class="advfield" /></td> 
-						</tr>
-
-						<tr>
-							<td class="column1"><label for="summary">{$lang_table_summary}</label></td> 
-							<td><input id="summary" name="summary" type="text" value="" class="advfield" /></td> 
-						</tr>
-
-						<tr>
-							<td><label for="style">{$lang_table_style}</label></td>
-							<td><input type="text" id="style" name="style" value="" class="advfield" onchange="changedStyle();" /></td>
-						</tr>
-
-						<tr>
-							<td class="column1"><label for="dir">{$lang_table_langdir}</label></td> 
-							<td>
-								<select id="dir" name="dir" class="advfield"> 
-										<option value="">{$lang_not_set}</option> 
-										<option value="ltr">{$lang_table_ltr}</option> 
-										<option value="rtl">{$lang_table_rtl}</option> 
-								</select>
-							</td> 
-						</tr>
-
-						<tr>
-							<td class="column1"><label id="langlabel" for="lang">{$lang_table_langcode}</label></td> 
-							<td>
-								<input id="lang" name="lang" type="text" value="" class="advfield" />
-							</td> 
-						</tr>
-
-						<tr>
-							<td class="column1"><label for="backgroundimage">{$lang_table_bgimage}</label></td> 
-							<td>
-								<table border="0" cellpadding="0" cellspacing="0">
-									<tr>
-										<td><input id="backgroundimage" name="backgroundimage" type="text" value="" class="advfield" onchange="changedBackgroundImage();" /></td>
-										<td id="backgroundimagebrowsercontainer"> </td>
-									</tr>
-								</table>
-							</td> 
-						</tr>
-
-						<tr>
-							<td class="column1"><label for="bordercolor">{$lang_table_bordercolor}</label></td> 
-							<td>
-								<table border="0" cellpadding="0" cellspacing="0">
-									<tr>
-										<td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td>
-										<td id="bordercolor_pickcontainer"> </td>
-									</tr>
-								</table>
-							</td> 
-						</tr>
-
-						<tr>
-							<td class="column1"><label for="bgcolor">{$lang_table_bgcolor}</label></td> 
-							<td>
-								<table border="0" cellpadding="0" cellspacing="0">
-									<tr>
-										<td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
-										<td id="bgcolor_pickcontainer"> </td>
-									</tr>
-								</table>
-							</td> 
-						</tr>
-					</table>
-				</fieldset>
-			</div>
-		</div>
-
-		<div class="mceActionPanel">
-			<div style="float: left">
-				<input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertTable();" />
-			</div>
-
-			<div style="float: right">
-				<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
-			</div>
-		</div>
-	</form>
-</body>
-</html>

Copied: plog/trunk/js/tinymce/plugins/table/table.htm (from rev 7165, plog/trunk/js/tinymce/plugins/table/table.htm)
===================================================================
--- plog/trunk/js/tinymce/plugins/table/table.htm	                        (rev 0)
+++ plog/trunk/js/tinymce/plugins/table/table.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,160 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{$lang_table_title}</title>
+	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
+	<script language="javascript" type="text/javascript" src="../../utils/validate.js"></script>
+	<script language="javascript" type="text/javascript" src="jscripts/table.js"></script>
+	<link href="css/table.css" rel="stylesheet" type="text/css" />
+	<base target="_self" />
+</head>
+<body id="table" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
+	<form onsubmit="insertTable();return false;" action="#">
+		<div class="tabs">
+			<ul>
+				<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_table_general_tab}</a></span></li>
+				<li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{$lang_table_advanced_tab}</a></span></li>
+			</ul>
+		</div>
+
+		<div class="panel_wrapper">
+			<div id="general_panel" class="panel current">
+				<fieldset>
+					<legend>{$lang_table_general_props}</legend>
+
+					  <table border="0" cellpadding="4" cellspacing="0" width="100%">
+							  <tr>
+								<td><label id="colslabel" for="cols">{$lang_table_cols}</label></td>
+								<td><input id="cols" name="cols" type="text" value="" size="3" maxlength="3" class="required number min1" /></td>
+								<td><label id="rowslabel" for="rows">{$lang_table_rows}</label></td>
+								<td><input id="rows" name="rows" type="text" value="" size="3" maxlength="3" class="required number min1" /></td>
+							  </tr>
+							  <tr>
+								<td><label id="cellpaddinglabel" for="cellpadding">{$lang_table_cellpadding}</label></td>
+								<td><input id="cellpadding" name="cellpadding" type="text" value="" size="3" maxlength="3" class="number" /></td>
+								<td><label id="cellspacinglabel" for="cellspacing">{$lang_table_cellspacing}</label></td>
+								<td><input id="cellspacing" name="cellspacing" type="text" value="" size="3" maxlength="3" class="number" /></td>
+							  </tr>
+							  <tr>
+								<td><label id="alignlabel" for="align">{$lang_table_align}</label></td>
+								<td><select id="align" name="align">
+									<option value="">{$lang_not_set}</option>
+									<option value="center">{$lang_table_align_middle}</option>
+									<option value="left">{$lang_table_align_left}</option>
+									<option value="right">{$lang_table_align_right}</option>
+								  </select></td>
+								<td><label id="borderlabel" for="border">{$lang_table_border}</label></td>
+								<td><input id="border" name="border" type="text" value="" size="3" maxlength="3" onchange="changedBorder();" class="number" /></td>
+							  </tr>
+							  <tr id="width_row">
+								<td><label id="widthlabel" for="width">{$lang_table_width}</label></td>
+								<td><input name="width" type="text" id="width" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td>
+								<td><label id="heightlabel" for="height">{$lang_table_height}</label></td>
+								<td><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td>
+							  </tr>
+							  <tr id="styleSelectRow">
+								<td><label id="classlabel" for="class">{$lang_class_name}</label></td>
+								<td colspan="3">
+								 <select id="class" name="class">
+									<option value="" selected>{$lang_not_set}</option>
+								 </select></td>
+							  </tr>
+							  <tr>
+								<td class="column1"><label for="caption">{$lang_table_caption}</label></td> 
+								<td><input id="caption" name="caption" type="checkbox" class="checkbox" value="true" /></td> 
+							  </tr>
+							</table>
+				</fieldset>
+			</div>
+
+			<div id="advanced_panel" class="panel">
+				<fieldset>
+					<legend>{$lang_table_advanced_props}</legend>
+
+					<table border="0" cellpadding="0" cellspacing="4">
+						<tr>
+							<td class="column1"><label for="id">{$lang_table_id}</label></td> 
+							<td><input id="id" name="id" type="text" value="" class="advfield" /></td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="summary">{$lang_table_summary}</label></td> 
+							<td><input id="summary" name="summary" type="text" value="" class="advfield" /></td> 
+						</tr>
+
+						<tr>
+							<td><label for="style">{$lang_table_style}</label></td>
+							<td><input type="text" id="style" name="style" value="" class="advfield" onchange="changedStyle();" /></td>
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="dir">{$lang_table_langdir}</label></td> 
+							<td>
+								<select id="dir" name="dir" class="advfield"> 
+										<option value="">{$lang_not_set}</option> 
+										<option value="ltr">{$lang_table_ltr}</option> 
+										<option value="rtl">{$lang_table_rtl}</option> 
+								</select>
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label id="langlabel" for="lang">{$lang_table_langcode}</label></td> 
+							<td>
+								<input id="lang" name="lang" type="text" value="" class="advfield" />
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="backgroundimage">{$lang_table_bgimage}</label></td> 
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="backgroundimage" name="backgroundimage" type="text" value="" class="advfield" onchange="changedBackgroundImage();" /></td>
+										<td id="backgroundimagebrowsercontainer"> </td>
+									</tr>
+								</table>
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="bordercolor">{$lang_table_bordercolor}</label></td> 
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td>
+										<td id="bordercolor_pickcontainer"> </td>
+									</tr>
+								</table>
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="bgcolor">{$lang_table_bgcolor}</label></td> 
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
+										<td id="bgcolor_pickcontainer"> </td>
+									</tr>
+								</table>
+							</td> 
+						</tr>
+					</table>
+				</fieldset>
+			</div>
+		</div>
+
+		<div class="mceActionPanel">
+			<div style="float: left">
+				<input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertTable();" />
+			</div>
+
+			<div style="float: right">
+				<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
+			</div>
+		</div>
+	</form>
+</body>
+</html>

Modified: plog/trunk/js/tinymce/themes/advanced/about.htm
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/about.htm	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/js/tinymce/themes/advanced/about.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,39 +1,35 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-	<title>{#advanced_dlg.about_title}</title>
-	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
-	<script type="text/javascript" src="../../utils/mctabs.js"></script>
-	<script type="text/javascript" src="js/about.js"></script>
+	<title>{$lang_about_title}</title>
+	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script language="javascript" type="text/javascript" src="jscripts/about.js"></script>
+	<base target="_self" />
 </head>
-<body id="about" style="display: none">
+<body id="about" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
 		<div class="tabs">
 			<ul>
-				<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advanced_dlg.about_general}</a></span></li>
-				<li id="help_tab" style="display:none"><span><a href="javascript:mcTabs.displayTab('help_tab','help_panel');" onmousedown="return false;">{#advanced_dlg.about_help}</a></span></li>
-				<li id="plugins_tab"><span><a href="javascript:mcTabs.displayTab('plugins_tab','plugins_panel');" onmousedown="return false;">{#advanced_dlg.about_plugins}</a></span></li>
+				<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_about}</a></span></li>
+				<li id="help_tab"><span><a href="javascript:mcTabs.displayTab('help_tab','help_panel');" onmousedown="return false;">{$lang_help}</a></span></li>
+				<li id="plugins_tab"><span><a href="javascript:mcTabs.displayTab('plugins_tab','plugins_panel');" onmousedown="return false;">{$lang_plugins}</a></span></li>
 			</ul>
 		</div>
 
 		<div class="panel_wrapper">
 			<div id="general_panel" class="panel current">
-				<h3>{#advanced_dlg.about_title}</h3>
-				<p>Version: <span id="version"></span> (<span id="date"></span>)</p>
+				<h3>{$lang_about_title}</h3>
+				<p>Version: {$tinymce_version} ({$tinymce_releasedate})</p>
 				<p>TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under <a href="../../license.txt" target="_blank">LGPL</a>
 				by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.</p>
-				<p>Copyright © 2003-2008, <a href="http://www.moxiecode.com" target="_blank">Moxiecode Systems AB</a>, All rights reserved.</p>
+				<p>Copyright © 2003-2007, <a href="http://www.moxiecode.com" target="_blank">Moxiecode Systems AB</a>, All rights reserved.</p>
 				<p>For more information about this software visit the <a href="http://tinymce.moxiecode.com" target="_blank">TinyMCE website</a>.</p>
 
-				<div id="buttoncontainer">
-					<a href="http://www.moxiecode.com" target="_blank"><img src="http://tinymce.moxiecode.com/images/gotmoxie.png" alt="Got Moxie?" border="0" /></a>
-					<a href="http://sourceforge.net/projects/tinymce/" target="_blank"><img src="http://sourceforge.net/sflogo.php?group_id=103281" alt="Hosted By Sourceforge" border="0" /></a>
-					<a href="http://www.freshmeat.net/projects/tinymce" target="_blank"><img src="http://tinymce.moxiecode.com/images/fm.gif" alt="Also on freshmeat" border="0" /></a>
-				</div>
+				<div id="buttoncontainer"></div>
 			</div>
 
 			<div id="plugins_panel" class="panel">
 				<div id="pluginscontainer">
-					<h3>{#advanced_dlg.about_loaded}</h3>
+					<h3>{$lang_loaded_plugins}</h3>
 
 					<div id="plugintablecontainer">
 					</div>
@@ -48,7 +44,9 @@
 		</div>
 
 		<div class="mceActionPanel">
-			<input type="button" id="cancel" name="cancel" value="{#close}" onclick="tinyMCEPopup.close();" />
+			<div style="float: right">
+				<input type="button" id="cancel" name="cancel" value="{$lang_close}" onclick="tinyMCEPopup.close();" />
+			</div>
 		</div>
 </body>
 </html>

Modified: plog/trunk/js/tinymce/themes/advanced/anchor.htm
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/anchor.htm	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/js/tinymce/themes/advanced/anchor.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,26 +1,33 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-	<title>{#advanced_dlg.anchor_title}</title>
-	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
-	<script type="text/javascript" src="js/anchor.js"></script>
+	<title>{$lang_insert_anchor_title}</title>
+	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script language="javascript" type="text/javascript" src="jscripts/anchor.js"></script>
+	<base target="_self" />
 </head>
-<body style="display: none">
-<form onsubmit="AnchorDialog.update();return false;" action="#">
+<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
+<form onsubmit="insertAnchor();return false;" action="#">
+
 	<table border="0" cellpadding="4" cellspacing="0">
 		<tr>
-			<td colspan="2" class="title">{#advanced_dlg.anchor_title}</td>
+			<td colspan="2" class="title">{$lang_insert_anchor_title}</td>
 		</tr>
 		<tr>
-			<td class="nowrap">{#advanced_dlg.anchor_name}:</td>
-			<td><input name="anchorName" type="text" class="mceFocus" id="anchorName" value="" style="width: 200px" /></td>
+			<td nowrap="nowrap">{$lang_insert_anchor_name}:</td>
+			<td><input name="anchorName" type="text" id="anchorName" value="" style="width: 200px" /></td>
 		</tr>
 	</table>
 
 	<div class="mceActionPanel">
-		<input type="submit" id="insert" name="insert" value="{#update}" />
-		<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+		<div style="float: left">
+			<input type="button" id="insert" name="insert" value="{$lang_update}" onclick="insertAnchor();" />
+		</div>
+
+		<div style="float: right">
+			<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
+		</div>
 	</div>
+
 </form>
 </body>
 </html>

Modified: plog/trunk/js/tinymce/themes/advanced/charmap.htm
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/charmap.htm	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/js/tinymce/themes/advanced/charmap.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,26 +1,27 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-	<title>{#advanced_dlg.charmap_title}</title>
-	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
-	<script type="text/javascript" src="js/charmap.js"></script>
+	<title>{$lang_theme_charmap_title}</title>
+	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script language="javascript" type="text/javascript" src="jscripts/charmap.js"></script>
+	<base target="_self" />
 </head>
-<body id="charmap" style="display:none">
+<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
 <table align="center" border="0" cellspacing="0" cellpadding="2">
     <tr>
-        <td colspan="2" class="title">{#advanced_dlg.charmap_title}</td>
+        <td colspan="2" class="title">{$lang_theme_charmap_title}</td>
     </tr>
     <tr>
-        <td id="charmapView" rowspan="2" align="left" valign="top">
-			<!-- Chars will be rendered here -->
+        <td rowspan="2" align="left" valign="top">
+            <script language="javascript" type="text/javascript">renderCharMapHTML();</script>
         </td>
         <td width="100" align="center" valign="top">
-            <table border="0" cellpadding="0" cellspacing="0" width="100" style="height:100px">
+            <table border="0" cellpadding="0" cellspacing="0" width="100" style="height: 100px">
                 <tr>
-                    <td id="codeV"> </td>
+                    <td class="charmapOver" style="font-size: 40px; height:80px;" id="codeV"> </td>
                 </tr>
                 <tr>
-                    <td id="codeN"> </td>
+                    <td style="font-size: 10px; font-family: Arial, Helvetica, sans-serif; text-align:center;" id="codeN"> </td>
                 </tr>
             </table>
         </td>

Modified: plog/trunk/js/tinymce/themes/advanced/color_picker.htm
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/color_picker.htm	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/js/tinymce/themes/advanced/color_picker.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,27 +1,27 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-	<title>{#advanced_dlg.colorpicker_title}</title>
-	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
-	<script type="text/javascript" src="../../utils/mctabs.js"></script>
-	<script type="text/javascript" src="js/color_picker.js"></script>
+	<title>{$lang_theme_colorpicker_title}</title>
+	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script language="javascript" type="text/javascript" src="jscripts/color_picker.js"></script>
+	<link href="css/colorpicker.css" rel="stylesheet" type="text/css" />
+	<base target="_self" />
 </head>
-<body id="colorpicker" style="display: none">
-<form onsubmit="insertAction();return false" action="#">
+<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
 	<div class="tabs">
 		<ul>
-			<li id="picker_tab" class="current"><span><a href="javascript:mcTabs.displayTab('picker_tab','picker_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_picker_tab}</a></span></li>
-			<li id="rgb_tab"><span><a href="javascript:;" onclick="generateWebColors();mcTabs.displayTab('rgb_tab','rgb_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_palette_tab}</a></span></li>
-			<li id="named_tab"><span><a  href="javascript:;" onclick="generateNamedColors();javascript:mcTabs.displayTab('named_tab','named_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_named_tab}</a></span></li>
+			<li id="picker_tab" class="current"><span><a href="javascript:mcTabs.displayTab('picker_tab','picker_panel');" onmousedown="return false;">{$lang_color_picker_tab}</a></span></li>
+			<li id="rgb_tab"><span><a href="#" onclick="generateWebColors();mcTabs.displayTab('rgb_tab','rgb_panel');" onmousedown="return false;">{$lang_web_colors_tab}</a></span></li>
+			<li id="named_tab"><span><a  href="#" onclick="generateNamedColors();javascript:mcTabs.displayTab('named_tab','named_panel');" onmousedown="return false;">{$lang_named_colors_tab}</a></span></li>
 		</ul>
 	</div>
 
 	<div class="panel_wrapper">
 		<div id="picker_panel" class="panel current">
 			<fieldset>
-				<legend>{#advanced_dlg.colorpicker_picker_title}</legend>
+				<legend>{$lang_color_picker}</legend>
 				<div id="picker">
-					<img id="colors" src="img/colorpicker.jpg" onclick="computeColor(event)" onmousedown="isMouseDown = true;return false;" onmouseup="isMouseDown = false;" onmousemove="if (isMouseDown && isMouseOver) computeColor(event); return false;" onmouseover="isMouseOver=true;" onmouseout="isMouseOver=false;" alt="" />
+					<img id="colorpicker" src="images/colors.jpg" onclick="computeColor(event)" onmousedown="isMouseDown = true;return false;" onmouseup="isMouseDown = false;" onmousemove="if (isMouseDown && isMouseOver) computeColor(event); return false;" onmouseover="isMouseOver=true;" onmouseout="isMouseOver=false;" />
 
 					<div id="light">
 						<!-- Will be filled with divs -->
@@ -34,7 +34,7 @@
 
 		<div id="rgb_panel" class="panel">
 			<fieldset>
-				<legend>{#advanced_dlg.colorpicker_palette_title}</legend>
+				<legend>{$lang_web_colors}</legend>
 				<div id="webcolors">
 					<!-- Gets filled with web safe colors-->
 				</div>
@@ -45,7 +45,7 @@
 
 		<div id="named_panel" class="panel">
 			<fieldset>
-				<legend>{#advanced_dlg.colorpicker_named_title}</legend>
+				<legend>{$lang_named_colors}</legend>
 				<div id="namedcolors">
 					<!-- Gets filled with named colors-->
 				</div>
@@ -53,21 +53,22 @@
 				<br style="clear: both" />
 
 				<div id="colornamecontainer">
-					{#advanced_dlg.colorpicker_name} <span id="colorname"></span>
+					{$lang_color_name} <span id="colorname"></span>
 				</div>
 			</fieldset>
 		</div>
 	</div>
 
 	<div class="mceActionPanel">
-		<input type="submit" id="insert" name="insert" value="{#apply}" />
+		<div style="float: left">
+			<input type="button" id="insert" name="insert" value="{$lang_theme_colorpicker_apply}" onclick="insertAction();" />
+		</div>
 
 		<div id="preview"></div>
 
 		<div id="previewblock">
-			<label for="color">{#advanced_dlg.colorpicker_color}</label> <input id="color" type="text" size="8" maxlength="8" class="text mceFocus" />
+			<label for="color">{$lang_color}</label> <input id="color" type="text" size="8" maxlength="8" class="text" />
 		</div>
 	</div>
-</form>
 </body>
 </html>

Deleted: plog/trunk/js/tinymce/themes/advanced/css/colorpicker.css
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/css/colorpicker.css	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/themes/advanced/css/colorpicker.css	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,53 +0,0 @@
-/* Colorpicker dialog specific CSS */
-
-#preview {
-	float: right;
-	width: 50px;
-	height: 14px;
-	line-height: 1px;
-	border: 1px solid black;
-	margin-left: 5px;
-}
-
-#colorpicker {
-	float: left;
-	cursor: crosshair;
-}
-
-#light {
-	border: 1px solid gray;
-	margin-left: 5px;
-	float: left;
-	width: 15px;
-	cursor: crosshair;
-}
-
-#light div {
-	overflow: hidden;
-}
-
-#previewblock {
-	float: right;
-	padding-left: 10px;
-	height: 20px;
-}
-
-.panel_wrapper div.current {
-	height: 175px;
-}
-
-#namedcolors {
-	width: 150px;
-}
-
-#namedcolors a {
-	display: block;
-	float: left;
-	width: 10px; height: 10px;
-	margin: 1px 1px 0 0;
-	overflow: hidden;
-}
-
-#colornamecontainer {
-	margin-top: 5px;
-}
\ No newline at end of file

Copied: plog/trunk/js/tinymce/themes/advanced/css/colorpicker.css (from rev 7165, plog/trunk/js/tinymce/themes/advanced/css/colorpicker.css)
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/css/colorpicker.css	                        (rev 0)
+++ plog/trunk/js/tinymce/themes/advanced/css/colorpicker.css	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,53 @@
+/* Colorpicker dialog specific CSS */
+
+#preview {
+	float: right;
+	width: 50px;
+	height: 14px;
+	line-height: 1px;
+	border: 1px solid black;
+	margin-left: 5px;
+}
+
+#colorpicker {
+	float: left;
+	cursor: crosshair;
+}
+
+#light {
+	border: 1px solid gray;
+	margin-left: 5px;
+	float: left;
+	width: 15px;
+	cursor: crosshair;
+}
+
+#light div {
+	overflow: hidden;
+}
+
+#previewblock {
+	float: right;
+	padding-left: 10px;
+	height: 20px;
+}
+
+.panel_wrapper div.current {
+	height: 175px;
+}
+
+#namedcolors {
+	width: 150px;
+}
+
+#namedcolors a {
+	display: block;
+	float: left;
+	width: 10px; height: 10px;
+	margin: 1px 1px 0 0;
+	overflow: hidden;
+}
+
+#colornamecontainer {
+	margin-top: 5px;
+}
\ No newline at end of file

Deleted: plog/trunk/js/tinymce/themes/advanced/css/editor_content.css
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/css/editor_content.css	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/themes/advanced/css/editor_content.css	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,58 +0,0 @@
-/* This file contains the CSS data for the editable area(iframe) of TinyMCE */
-/* You can extend this CSS by adding your own CSS file with the the content_css option */
-
-body, td, pre {
-	font-family: Verdana, Arial, Helvetica, sans-serif;
-	font-size: 13px;
-}
-
-body {
-	background-color: #FFFFFF;
-}
-
-.mceVisualAid {
-	border: 1px dashed #BBBBBB !important;
-}
-
-div.mceVisualAid {
-	background-image:url('../images/spacer.gif');
-	visibility: visible !important;
-}
-
-.mceItemAnchor {
-	width: 12px;
-	line-height: 6px;
-	overflow: hidden;
-	padding-left: 12px;
-	background-image: url('../images/anchor_symbol.gif');
-	background-position: bottom;
-	background-repeat: no-repeat;
-}
-
-/* Important is needed in Gecko browsers inorder to style links */
-/*
-a {
-	color: green !important;
-}
-*/
-
-/* Style selection range colors in Gecko browsers */
-/*
-::-moz-selection {
-	background-color: red;
-	color: green;
-}
-*/
-
-/* MSIE specific */
-
-* html body {
-	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;
-}

Copied: plog/trunk/js/tinymce/themes/advanced/css/editor_content.css (from rev 7165, plog/trunk/js/tinymce/themes/advanced/css/editor_content.css)
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/css/editor_content.css	                        (rev 0)
+++ plog/trunk/js/tinymce/themes/advanced/css/editor_content.css	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,58 @@
+/* This file contains the CSS data for the editable area(iframe) of TinyMCE */
+/* You can extend this CSS by adding your own CSS file with the the content_css option */
+
+body, td, pre {
+	font-family: Verdana, Arial, Helvetica, sans-serif;
+	font-size: 13px;
+}
+
+body {
+	background-color: #FFFFFF;
+}
+
+.mceVisualAid {
+	border: 1px dashed #BBBBBB !important;
+}
+
+div.mceVisualAid {
+	background-image:url('../images/spacer.gif');
+	visibility: visible !important;
+}
+
+.mceItemAnchor {
+	width: 12px;
+	line-height: 6px;
+	overflow: hidden;
+	padding-left: 12px;
+	background-image: url('../images/anchor_symbol.gif');
+	background-position: bottom;
+	background-repeat: no-repeat;
+}
+
+/* Important is needed in Gecko browsers inorder to style links */
+/*
+a {
+	color: green !important;
+}
+*/
+
+/* Style selection range colors in Gecko browsers */
+/*
+::-moz-selection {
+	background-color: red;
+	color: green;
+}
+*/
+
+/* MSIE specific */
+
+* html body {
+	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;
+}

Deleted: plog/trunk/js/tinymce/themes/advanced/css/editor_popup.css
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/css/editor_popup.css	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/themes/advanced/css/editor_popup.css	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,331 +0,0 @@
-/* This file contains the CSS data for all popups in TinyMCE */
-
-body {
-	background-color: #F0F0EE;
-	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;
-	margin: 8px;
-}
-
-td {
-	font-family: Verdana, Arial, Helvetica, sans-serif;
-	font-size: 11px;
-}
-
-input {
-	background: #FFFFFF;
-	border: 1px solid #cccccc;
-}
-
-td, input, select, textarea {
-	font-family: Verdana, Arial, Helvetica, sans-serif;
-	font-size: 10px;
-}
-
-input, select, textarea {
-	border: 1px solid #808080;
-}
-
-.input_noborder {
-	border: 0;
-}
-
-#insert, .updateButton {
-   font-weight: bold;
-   width: 90px;
-   height: 21px;
-   border: 0;
-   background-image: url('../images/insert_button_bg.gif');
-   cursor: pointer;
-}
-
-#cancel {
-   font-weight: bold;
-   width: 90px;
-   height: 21px;
-   border: 0;
-   background-image: url('../images/cancel_button_bg.gif');
-   cursor: pointer;
-}
-
-/* Mozilla only style */
-html>body #insert, html>body #cancel {
-	padding-bottom: 2px;
-}
-
-.title {
-	font-size: 12px;
-	font-weight: bold;
-	color: #2B6FB6;
-}
-
-table.charmap {
-	border-style: solid;
-	border-width: 1px;
-	border-color: #AAAAAA;
-}
-
-td.charmap, td.charmapOver {
-	color: #000000;
-	border-color: #AAAAAA;
-	border-style: solid;
-	border-width: 1px;
-	text-align: center;
-	font-size: 12px;
-}
-
-td.charmapOver {
-	background-color: #CCCCCC;
-	cursor: default;
-}
-
-a.charmap {
-	color: #000000;
-	text-decoration: none
-}
-
-.wordWrapCode {
-	vertical-align: middle;
-	border: 1px none #000000;
-	background-color: transparent;
-}
-
-input.radio {
-	border: 1px none #000000;
-	background-color: transparent;
-	vertical-align: middle;
-}
-
-input.checkbox {
-	border: 1px none #000000;
-	background-color: transparent;
-	vertical-align: middle;
-}
-
-.mceButtonNormal, .mceButtonOver, .mceButtonDown, .mceSeparator, .mceButtonDisabled, .mceButtonSelected {
-	margin-left: 1px;
-}
-
-.mceButtonNormal {
-	border-top: 1px solid;
-	border-left: 1px solid;
-	border-bottom: 1px solid;
-	border-right: 1px solid;
-	border-color: #F0F0EE;
-	cursor: default;
-}
-
-.mceButtonOver {
-	border: 1px solid #0A246A;
-	cursor: default;
-	background-color: #B6BDD2;
-}
-
-.mceButtonDown {
-	cursor: default;
-	border: 1px solid #0A246A;
-	background-color: #8592B5;
-}
-
-.mceButtonDisabled {
-	filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);
-	-moz-opacity:0.3;
-	opacity: 0.3;
-	border-top: 1px solid;
-	border-left: 1px solid;
-	border-bottom: 1px solid;
-	border-right: 1px solid;
-	border-color: #F0F0EE;
-	cursor: default;
-}
-
-.mceActionPanel {
-	margin-top: 5px;
-}
-
-/* Tabs classes */
-
-.tabs {
-	float: left;
-	width: 100%;
-	line-height: normal;
-	background-image: url("../images/xp/tabs_bg.gif");
-}
-
-.tabs ul {
-	margin: 0;
-	padding: 0 0 0;
-	list-style: none;
-}
-
-.tabs li {
-	float: left;
-	background: url("../images/xp/tab_bg.gif") no-repeat left top;
-	margin: 0;
-	margin-left: 0;
-	margin-right: 2px;
-	padding: 0 0 0 10px;
-	line-height: 18px;
-}
-
-.tabs li.current {
-	background: url("../images/xp/tab_sel_bg.gif") no-repeat left top;
-	margin-right: 2px;
-}
-
-.tabs span {
-	float: left;
-	display: block;
-	background: url("../images/xp/tab_end.gif") no-repeat right top;
-	padding: 0px 10px 0 0;
-}
-
-.tabs .current span {
-	background: url("../images/xp/tab_sel_end.gif") no-repeat right top;
-}
-
-.tabs a {
-	text-decoration: none;
-	font-family: Verdana, Arial;
-	font-size: 10px;
-}
-
-.tabs a:link, .tabs a:visited, .tabs a:hover {
-	color: black;
-}
-
-.tabs a:hover {
-}
-
-.tabs .current {
-}
-
-.tabs .current a, .tabs .current a:link, .tabs .current a:visited {
-}
-
-.panel_wrapper div.panel {
-	display: none;
-}
-
-.panel_wrapper div.current {
-	display: block;
-	width: 100%;
-	height: 300px;
-	overflow: visible; /* Should be auto but that breaks Safari */
-}
-
-.panel_wrapper {
-	border: 1px solid #919B9C;
-	border-top: 0px;
-	padding: 10px;
-	padding-top: 5px;
-	clear: both;
-	background-color: white;
-}
-
-fieldset {
-	border: 1px solid #919B9C;
-	font-family: Verdana, Arial;
-	font-size: 10px;
-	padding: 0;
-	margin: 0;
-	padding: 4px;
-}
-
-legend {
-	color: #2B6FB6;
-	font-weight: bold;
-}
-
-.properties {
-	width: 100%;
-}
-
-.properties .column1 {
-}
-
-.properties .column2 {
-	text-align: left;
-}
-
-a:link, a:visited {
-	color: black;
-}
-
-a:hover {
-	color: #2B6FB6;
-}
-
-#plugintable thead {
-	font-weight: bold;
-	background-color: #DDDDDD;
-}
-
-#plugintable, #about #plugintable td {
-	border: 1px solid #919B9C;
-}
-
-#plugintable {
-	width: 99%;
-	margin-top: 10px;
-}
-
-#pluginscontainer {
-	height: 290px;
-	overflow: auto;
-}
-
-/* MSIE Specific styles */
-
-* html .panel_wrapper {
-	width: 100%;
-}
-
-.column {
-	float: left;
-}
-
-h1, h2, h3, h4 {
-	color: #2B6FB6;
-	margin: 0;
-	padding: 0;
-	padding-top: 5px;
-}
-
-h3 {
-	font-size: 14px;
-}
-
-#link .panel_wrapper, #link div.current {
-	height: 125px;
-}
-
-#image .panel_wrapper, #image div.current {
-	height: 190px;
-}
-
-label.msg { display: none; }
-label.invalid { color: #EE0000; display: inline; }
-input.invalid { border: 1px solid #EE0000; }
-
-/* Disables the advanced tab in the table plugin. */
-/*
-#table #advanced_tab {
-	display: none;
-}
-*/
-
-/* Disables the border input field and label in the table plugin. */
-/*
-#table #border, #table #borderlabel {
-	display: none;
-}
-*/

Copied: plog/trunk/js/tinymce/themes/advanced/css/editor_popup.css (from rev 7165, plog/trunk/js/tinymce/themes/advanced/css/editor_popup.css)
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/css/editor_popup.css	                        (rev 0)
+++ plog/trunk/js/tinymce/themes/advanced/css/editor_popup.css	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,331 @@
+/* This file contains the CSS data for all popups in TinyMCE */
+
+body {
+	background-color: #F0F0EE;
+	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;
+	margin: 8px;
+}
+
+td {
+	font-family: Verdana, Arial, Helvetica, sans-serif;
+	font-size: 11px;
+}
+
+input {
+	background: #FFFFFF;
+	border: 1px solid #cccccc;
+}
+
+td, input, select, textarea {
+	font-family: Verdana, Arial, Helvetica, sans-serif;
+	font-size: 10px;
+}
+
+input, select, textarea {
+	border: 1px solid #808080;
+}
+
+.input_noborder {
+	border: 0;
+}
+
+#insert, .updateButton {
+   font-weight: bold;
+   width: 90px;
+   height: 21px;
+   border: 0;
+   background-image: url('../images/insert_button_bg.gif');
+   cursor: pointer;
+}
+
+#cancel {
+   font-weight: bold;
+   width: 90px;
+   height: 21px;
+   border: 0;
+   background-image: url('../images/cancel_button_bg.gif');
+   cursor: pointer;
+}
+
+/* Mozilla only style */
+html>body #insert, html>body #cancel {
+	padding-bottom: 2px;
+}
+
+.title {
+	font-size: 12px;
+	font-weight: bold;
+	color: #2B6FB6;
+}
+
+table.charmap {
+	border-style: solid;
+	border-width: 1px;
+	border-color: #AAAAAA;
+}
+
+td.charmap, td.charmapOver {
+	color: #000000;
+	border-color: #AAAAAA;
+	border-style: solid;
+	border-width: 1px;
+	text-align: center;
+	font-size: 12px;
+}
+
+td.charmapOver {
+	background-color: #CCCCCC;
+	cursor: default;
+}
+
+a.charmap {
+	color: #000000;
+	text-decoration: none
+}
+
+.wordWrapCode {
+	vertical-align: middle;
+	border: 1px none #000000;
+	background-color: transparent;
+}
+
+input.radio {
+	border: 1px none #000000;
+	background-color: transparent;
+	vertical-align: middle;
+}
+
+input.checkbox {
+	border: 1px none #000000;
+	background-color: transparent;
+	vertical-align: middle;
+}
+
+.mceButtonNormal, .mceButtonOver, .mceButtonDown, .mceSeparator, .mceButtonDisabled, .mceButtonSelected {
+	margin-left: 1px;
+}
+
+.mceButtonNormal {
+	border-top: 1px solid;
+	border-left: 1px solid;
+	border-bottom: 1px solid;
+	border-right: 1px solid;
+	border-color: #F0F0EE;
+	cursor: default;
+}
+
+.mceButtonOver {
+	border: 1px solid #0A246A;
+	cursor: default;
+	background-color: #B6BDD2;
+}
+
+.mceButtonDown {
+	cursor: default;
+	border: 1px solid #0A246A;
+	background-color: #8592B5;
+}
+
+.mceButtonDisabled {
+	filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);
+	-moz-opacity:0.3;
+	opacity: 0.3;
+	border-top: 1px solid;
+	border-left: 1px solid;
+	border-bottom: 1px solid;
+	border-right: 1px solid;
+	border-color: #F0F0EE;
+	cursor: default;
+}
+
+.mceActionPanel {
+	margin-top: 5px;
+}
+
+/* Tabs classes */
+
+.tabs {
+	float: left;
+	width: 100%;
+	line-height: normal;
+	background-image: url("../images/xp/tabs_bg.gif");
+}
+
+.tabs ul {
+	margin: 0;
+	padding: 0 0 0;
+	list-style: none;
+}
+
+.tabs li {
+	float: left;
+	background: url("../images/xp/tab_bg.gif") no-repeat left top;
+	margin: 0;
+	margin-left: 0;
+	margin-right: 2px;
+	padding: 0 0 0 10px;
+	line-height: 18px;
+}
+
+.tabs li.current {
+	background: url("../images/xp/tab_sel_bg.gif") no-repeat left top;
+	margin-right: 2px;
+}
+
+.tabs span {
+	float: left;
+	display: block;
+	background: url("../images/xp/tab_end.gif") no-repeat right top;
+	padding: 0px 10px 0 0;
+}
+
+.tabs .current span {
+	background: url("../images/xp/tab_sel_end.gif") no-repeat right top;
+}
+
+.tabs a {
+	text-decoration: none;
+	font-family: Verdana, Arial;
+	font-size: 10px;
+}
+
+.tabs a:link, .tabs a:visited, .tabs a:hover {
+	color: black;
+}
+
+.tabs a:hover {
+}
+
+.tabs .current {
+}
+
+.tabs .current a, .tabs .current a:link, .tabs .current a:visited {
+}
+
+.panel_wrapper div.panel {
+	display: none;
+}
+
+.panel_wrapper div.current {
+	display: block;
+	width: 100%;
+	height: 300px;
+	overflow: visible; /* Should be auto but that breaks Safari */
+}
+
+.panel_wrapper {
+	border: 1px solid #919B9C;
+	border-top: 0px;
+	padding: 10px;
+	padding-top: 5px;
+	clear: both;
+	background-color: white;
+}
+
+fieldset {
+	border: 1px solid #919B9C;
+	font-family: Verdana, Arial;
+	font-size: 10px;
+	padding: 0;
+	margin: 0;
+	padding: 4px;
+}
+
+legend {
+	color: #2B6FB6;
+	font-weight: bold;
+}
+
+.properties {
+	width: 100%;
+}
+
+.properties .column1 {
+}
+
+.properties .column2 {
+	text-align: left;
+}
+
+a:link, a:visited {
+	color: black;
+}
+
+a:hover {
+	color: #2B6FB6;
+}
+
+#plugintable thead {
+	font-weight: bold;
+	background-color: #DDDDDD;
+}
+
+#plugintable, #about #plugintable td {
+	border: 1px solid #919B9C;
+}
+
+#plugintable {
+	width: 99%;
+	margin-top: 10px;
+}
+
+#pluginscontainer {
+	height: 290px;
+	overflow: auto;
+}
+
+/* MSIE Specific styles */
+
+* html .panel_wrapper {
+	width: 100%;
+}
+
+.column {
+	float: left;
+}
+
+h1, h2, h3, h4 {
+	color: #2B6FB6;
+	margin: 0;
+	padding: 0;
+	padding-top: 5px;
+}
+
+h3 {
+	font-size: 14px;
+}
+
+#link .panel_wrapper, #link div.current {
+	height: 125px;
+}
+
+#image .panel_wrapper, #image div.current {
+	height: 190px;
+}
+
+label.msg { display: none; }
+label.invalid { color: #EE0000; display: inline; }
+input.invalid { border: 1px solid #EE0000; }
+
+/* Disables the advanced tab in the table plugin. */
+/*
+#table #advanced_tab {
+	display: none;
+}
+*/
+
+/* Disables the border input field and label in the table plugin. */
+/*
+#table #border, #table #borderlabel {
+	display: none;
+}
+*/

Deleted: plog/trunk/js/tinymce/themes/advanced/css/editor_ui.css
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/css/editor_ui.css	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/themes/advanced/css/editor_ui.css	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,97 +0,0 @@
-/* This file contains the CSS data for the editor UI of TinyMCE instances */
-
-.mceToolbarTop a, .mceToolbarTop a:visited, .mceToolbarTop a:hover, .mceToolbarBottom a, .mceToolbarBottom a:visited, .mceToolbarBottom a:hover {border: 0; margin: 0; padding: 0; background: transparent;}
-.mceSeparatorLine {border: 0; padding: 0; margin-left: 4px; margin-right: 2px;}
-.mceSelectList {font-family: 'MS Sans Serif', sans-serif, Verdana, Arial; font-size: 7pt !important; font-weight: normal; margin-top: 3px; padding: 0; display: inline; vertical-align: top; background-color: #F0F0EE;}
-.mceLabel, .mceLabelDisabled {font-family: 'MS Sans Serif', sans-serif, Verdana, Arial; font-size: 9pt;}
-.mceLabel {color: #000000;}
-.mceLabelDisabled {cursor: text; color: #999999;}
-.mceEditor {background: #F0F0EE; border: 1px solid #cccccc; padding: 0; margin: 0;}
-.mceEditorArea { font-family: 'MS Sans Serif', sans-serif, Verdana, Arial; background: #FFFFFF; padding: 0; margin: 0; }
-.mceToolbarTop, .mceToolbarBottom {background: #F0F0EE; line-height: 1px; font-size: 1px;}
-.mceToolbarTop {border-bottom: 1px solid #cccccc; padding-bottom: 1px;}
-.mceToolbarBottom {border-top: 1px solid #cccccc;}
-.mceToolbarContainer {display: block; position: relative; left: 0; top: 0; width: 100%;}
-.mceStatusbarTop, .mceStatusbarBottom, .mceStatusbar {height: 20px;}
-.mceStatusbarTop .mceStatusbarPathText, .mceStatusbarBottom .mceStatusbarPathText, .mceStatusbar .mceStatusbarPathText {font-family: 'MS Sans Serif', sans-serif, Verdana, Arial; font-size: 9pt; padding: 2px; line-height: 16px; overflow: visible;}
-.mceStatusbarTop {border-bottom: 1px solid #cccccc;}
-.mceStatusbarBottom {border-top: 1px solid #cccccc;}
-.mceStatusbar {border-bottom: 1px solid #cccccc;}
-.mcePathItem, .mcePathItem:link, .mcePathItem:visited, .mcePathItem:hover {text-decoration: none; font-family: 'MS Sans Serif', sans-serif, Verdana, Arial; font-size: 9pt; color: #000000;}
-.mcePathItem:hover {text-decoration: underline;}
-.mceStatusbarPathText {float: left;}
-.mceStatusbarResize {float: right; background-image: url('../images/statusbar_resize.gif'); background-repeat: no-repeat; width: 11px; height: 20px; cursor: se-resize;}
-.mceResizeBox {width: 10px; height: 10px; display: none; border: 1px dotted gray; margin: 0; padding: 0;}
-.mceEditorIframe {border: 0;}
-
-/* Button CSS rules */
-
-a.mceButtonDisabled img, a.mceButtonNormal img, a.mceButtonSelected img {width: 20px; height: 20px; cursor: default; margin-top: 1px; margin-left: 1px;}
-a.mceButtonDisabled img {border: 0 !important;}
-a.mceButtonNormal img, a.mceButtonSelected img {border: 1px solid #F0F0EE !important;}
-a.mceButtonSelected img {border: 1px solid #6779AA !important; background-color: #D4D5D8;}
-a.mceButtonNormal img:hover, a.mceButtonSelected img:hover {border: 1px solid #0A246A !important; cursor: default; background-color: #B6BDD2;}
-a.mceButtonDisabled img {-moz-opacity:0.3; opacity: 0.3; border: 1px solid #F0F0EE !important; cursor: default;}
-a.mceTiledButton img {background-image: url('../images/buttons.gif'); background-repeat: no-repeat;}
-
-/* Menu button CSS rules */
-
-span.mceMenuButton img, span.mceMenuButtonSelected img {border: 1px solid #F0F0EE; margin-left: 1px;}
-span.mceMenuButtonSelected img {border: 1px solid #6779AA; background-color: #B6BDD2;}
-span.mceMenuButtonSelected img.mceMenuButton {border: 1px solid #F0F0EE; background-color: transparent;}
-span.mceMenuButton img.mceMenuButton, span.mceMenuButtonSelected img.mceMenuButton {border-left: 0; margin-left: 0;}
-span.mceMenuButton:hover img, span.mceMenuButtonSelected:hover img {border: 1px solid #0A246A; background-color: #B6BDD2;}
-span.mceMenuButton:hover img.mceMenuButton, span.mceMenuButtonSelected:hover img.mceMenuButton {border-left: 0;}
-span.mceMenuButtonFocus img {border: 1px solid gray; border-right: 0; margin-left: 1px; background-color: #F5F4F2;}
-span.mceMenuButtonFocus img.mceMenuButton {border: 1px solid gray; border-left: 1px solid #F5F4F2; margin-left: 0;}
-span.mceMenuHover img {border: 1px solid #0A246A; background-color: #B6BDD2;}
-span.mceMenuButtonSelected.mceMenuHover img.mceMenuButton {border: 1px solid #0A246A; background-color: #B6BDD2; border-left: 0;}
-
-/* Menu */
-
-.mceMenu {position: absolute; left: 0; top: 0; display: none; z-index: 1000; background-color: white; border: 1px solid gray; font-weight: normal;}
-.mceMenu a, .mceMenuTitle, .mceMenuDisabled {display: block; width: 100%; text-decoration: none; background-color: white; font-family: Tahoma, Verdana, Arial, Helvetica; font-size: 11px; line-height: 20px; color: black;}
-.mceMenu a:hover {background-color: #B6BDD2; color: black; text-decoration: none !important;}
-.mceMenu span {padding-left: 10px; padding-right: 10px; display: block; line-height: 20px;}
-.mceMenuSeparator {border-bottom: 1px solid gray; background-color: gray; height: 1px;}
-.mceMenuTitle span {padding-left: 5px;}
-.mceMenuTitle {background-color: #DDDDDD; font-weight: bold;}
-.mceMenuDisabled {color: gray;}
-span.mceMenuSelectedItem {background-image: url('../images/menu_check.gif'); background-repeat: no-repeat; background-position: 5px 8px; padding-left: 20px;}
-span.mceMenuCheckItem {padding-left: 20px;}
-span.mceMenuLine {display: block; position: absolute; left: 0; top: -1px; background-color: #F5F4F2; width: 30px; height: 1px; overflow: hidden; padding-left: 0; padding-right: 0;}
-.mceColors table, .mceColors td {margin: 0; padding: 2px;}
-a.mceMoreColors {width: auto; padding: 0; margin: 0 3px 3px 3px; text-align: center; border: 1px solid white; text-decoration: none !important;}
-.mceColorPreview {position: absolute; overflow:hidden; left: 0; top: 0; margin-left: 3px; margin-top: 15px; width: 16px; height: 4px; background-color: red;}
-a.mceMoreColors:hover {border: 1px solid #0A246A;}
-.mceColors td a {width: 9px; height: 9px; overflow: hidden; border: 1px solid #808080;}
-
-/* MSIE 6 specific rules */
-
-* html a.mceButtonNormal img, * html a.mceButtonSelected img, * html a.mceButtonDisabled img {border: 0 !important; margin-top: 2px; margin-bottom: 1px;}
-* html a.mceButtonDisabled img {filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30); border: 0 !important;}
-* html a.mceButtonDisabled {border: 1px solid #F0F0EE !important;}
-* html a.mceButtonNormal, * html a.mceButtonSelected {border: 1px solid #F0F0EE !important; cursor: default;}
-* html a.mceButtonSelected {border: 1px solid #6779AA !important; background-color: #D4D5D8;}
-* html a.mceButtonNormal:hover, * html a.mceButtonSelected:hover {border: 1px solid #0A246A !important; background-color: #B6BDD2; cursor: default;}
-* html .mceSelectList {margin-top: 2px;}
-* html span.mceMenuButton, * html span.mceMenuButtonFocus {position: relative; left: 0; top: 0;}
-* html span.mceMenuButton img, * html span.mceMenuButtonSelected img, * html span.mceMenuButtonFocus img {position: relative; top: 1px;}
-* html a.mceMoreColors {width: auto;}
-* html .mceColors td a {width: 10px; height: 10px;}
-* html .mceColorPreview {margin-left: 2px; margin-top: 14px;}
-
-/* MSIE 7 specific rules */
-
-*:first-child+html a.mceButtonNormal img, *:first-child+html a.mceButtonSelected img, *:first-child+html a.mceButtonDisabled img {border: 0 !important; margin-top: 2px; margin-bottom: 1px;}
-*:first-child+html a.mceButtonDisabled img {filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30); border: 0 !important;}
-*:first-child+html a.mceButtonDisabled {border: 1px solid #F0F0EE !important;}
-*:first-child+html a.mceButtonNormal, *:first-child+html a.mceButtonSelected {border: 1px solid #F0F0EE !important; cursor: default;}
-*:first-child+html a.mceButtonSelected {border: 1px solid #6779AA !important; background-color: #D4D5D8;}
-*:first-child+html a.mceButtonNormal:hover, *:first-child+html a.mceButtonSelected:hover {border: 1px solid #0A246A !important; background-color: #B6BDD2; cursor: default;}
-*:first-child+html .mceSelectList {margin-top: 2px;}
-*:first-child+html span.mceMenuButton, *:first-child+html span.mceMenuButtonFocus {position: relative; left: 0; top: 0;}
-*:first-child+html span.mceMenuButton img, *:first-child+html span.mceMenuButtonSelected img, *:first-child+html span.mceMenuButtonFocus img {position: relative; top: 1px;}
-*:first-child+html a.mceMoreColors {width: 137px;}
-*:first-child+html .mceColors td a {width: 10px; height: 10px;}
-*:first-child+html .mceColorPreview {margin: 0; padding-left: 4px; margin-top: 14px; width: 14px;}

Copied: plog/trunk/js/tinymce/themes/advanced/css/editor_ui.css (from rev 7165, plog/trunk/js/tinymce/themes/advanced/css/editor_ui.css)
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/css/editor_ui.css	                        (rev 0)
+++ plog/trunk/js/tinymce/themes/advanced/css/editor_ui.css	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,97 @@
+/* This file contains the CSS data for the editor UI of TinyMCE instances */
+
+.mceToolbarTop a, .mceToolbarTop a:visited, .mceToolbarTop a:hover, .mceToolbarBottom a, .mceToolbarBottom a:visited, .mceToolbarBottom a:hover {border: 0; margin: 0; padding: 0; background: transparent;}
+.mceSeparatorLine {border: 0; padding: 0; margin-left: 4px; margin-right: 2px;}
+.mceSelectList {font-family: 'MS Sans Serif', sans-serif, Verdana, Arial; font-size: 7pt !important; font-weight: normal; margin-top: 3px; padding: 0; display: inline; vertical-align: top; background-color: #F0F0EE;}
+.mceLabel, .mceLabelDisabled {font-family: 'MS Sans Serif', sans-serif, Verdana, Arial; font-size: 9pt;}
+.mceLabel {color: #000000;}
+.mceLabelDisabled {cursor: text; color: #999999;}
+.mceEditor {background: #F0F0EE; border: 1px solid #cccccc; padding: 0; margin: 0;}
+.mceEditorArea { font-family: 'MS Sans Serif', sans-serif, Verdana, Arial; background: #FFFFFF; padding: 0; margin: 0; }
+.mceToolbarTop, .mceToolbarBottom {background: #F0F0EE; line-height: 1px; font-size: 1px;}
+.mceToolbarTop {border-bottom: 1px solid #cccccc; padding-bottom: 1px;}
+.mceToolbarBottom {border-top: 1px solid #cccccc;}
+.mceToolbarContainer {display: block; position: relative; left: 0; top: 0; width: 100%;}
+.mceStatusbarTop, .mceStatusbarBottom, .mceStatusbar {height: 20px;}
+.mceStatusbarTop .mceStatusbarPathText, .mceStatusbarBottom .mceStatusbarPathText, .mceStatusbar .mceStatusbarPathText {font-family: 'MS Sans Serif', sans-serif, Verdana, Arial; font-size: 9pt; padding: 2px; line-height: 16px; overflow: visible;}
+.mceStatusbarTop {border-bottom: 1px solid #cccccc;}
+.mceStatusbarBottom {border-top: 1px solid #cccccc;}
+.mceStatusbar {border-bottom: 1px solid #cccccc;}
+.mcePathItem, .mcePathItem:link, .mcePathItem:visited, .mcePathItem:hover {text-decoration: none; font-family: 'MS Sans Serif', sans-serif, Verdana, Arial; font-size: 9pt; color: #000000;}
+.mcePathItem:hover {text-decoration: underline;}
+.mceStatusbarPathText {float: left;}
+.mceStatusbarResize {float: right; background-image: url('../images/statusbar_resize.gif'); background-repeat: no-repeat; width: 11px; height: 20px; cursor: se-resize;}
+.mceResizeBox {width: 10px; height: 10px; display: none; border: 1px dotted gray; margin: 0; padding: 0;}
+.mceEditorIframe {border: 0;}
+
+/* Button CSS rules */
+
+a.mceButtonDisabled img, a.mceButtonNormal img, a.mceButtonSelected img {width: 20px; height: 20px; cursor: default; margin-top: 1px; margin-left: 1px;}
+a.mceButtonDisabled img {border: 0 !important;}
+a.mceButtonNormal img, a.mceButtonSelected img {border: 1px solid #F0F0EE !important;}
+a.mceButtonSelected img {border: 1px solid #6779AA !important; background-color: #D4D5D8;}
+a.mceButtonNormal img:hover, a.mceButtonSelected img:hover {border: 1px solid #0A246A !important; cursor: default; background-color: #B6BDD2;}
+a.mceButtonDisabled img {-moz-opacity:0.3; opacity: 0.3; border: 1px solid #F0F0EE !important; cursor: default;}
+a.mceTiledButton img {background-image: url('../images/buttons.gif'); background-repeat: no-repeat;}
+
+/* Menu button CSS rules */
+
+span.mceMenuButton img, span.mceMenuButtonSelected img {border: 1px solid #F0F0EE; margin-left: 1px;}
+span.mceMenuButtonSelected img {border: 1px solid #6779AA; background-color: #B6BDD2;}
+span.mceMenuButtonSelected img.mceMenuButton {border: 1px solid #F0F0EE; background-color: transparent;}
+span.mceMenuButton img.mceMenuButton, span.mceMenuButtonSelected img.mceMenuButton {border-left: 0; margin-left: 0;}
+span.mceMenuButton:hover img, span.mceMenuButtonSelected:hover img {border: 1px solid #0A246A; background-color: #B6BDD2;}
+span.mceMenuButton:hover img.mceMenuButton, span.mceMenuButtonSelected:hover img.mceMenuButton {border-left: 0;}
+span.mceMenuButtonFocus img {border: 1px solid gray; border-right: 0; margin-left: 1px; background-color: #F5F4F2;}
+span.mceMenuButtonFocus img.mceMenuButton {border: 1px solid gray; border-left: 1px solid #F5F4F2; margin-left: 0;}
+span.mceMenuHover img {border: 1px solid #0A246A; background-color: #B6BDD2;}
+span.mceMenuButtonSelected.mceMenuHover img.mceMenuButton {border: 1px solid #0A246A; background-color: #B6BDD2; border-left: 0;}
+
+/* Menu */
+
+.mceMenu {position: absolute; left: 0; top: 0; display: none; z-index: 1000; background-color: white; border: 1px solid gray; font-weight: normal;}
+.mceMenu a, .mceMenuTitle, .mceMenuDisabled {display: block; width: 100%; text-decoration: none; background-color: white; font-family: Tahoma, Verdana, Arial, Helvetica; font-size: 11px; line-height: 20px; color: black;}
+.mceMenu a:hover {background-color: #B6BDD2; color: black; text-decoration: none !important;}
+.mceMenu span {padding-left: 10px; padding-right: 10px; display: block; line-height: 20px;}
+.mceMenuSeparator {border-bottom: 1px solid gray; background-color: gray; height: 1px;}
+.mceMenuTitle span {padding-left: 5px;}
+.mceMenuTitle {background-color: #DDDDDD; font-weight: bold;}
+.mceMenuDisabled {color: gray;}
+span.mceMenuSelectedItem {background-image: url('../images/menu_check.gif'); background-repeat: no-repeat; background-position: 5px 8px; padding-left: 20px;}
+span.mceMenuCheckItem {padding-left: 20px;}
+span.mceMenuLine {display: block; position: absolute; left: 0; top: -1px; background-color: #F5F4F2; width: 30px; height: 1px; overflow: hidden; padding-left: 0; padding-right: 0;}
+.mceColors table, .mceColors td {margin: 0; padding: 2px;}
+a.mceMoreColors {width: auto; padding: 0; margin: 0 3px 3px 3px; text-align: center; border: 1px solid white; text-decoration: none !important;}
+.mceColorPreview {position: absolute; overflow:hidden; left: 0; top: 0; margin-left: 3px; margin-top: 15px; width: 16px; height: 4px; background-color: red;}
+a.mceMoreColors:hover {border: 1px solid #0A246A;}
+.mceColors td a {width: 9px; height: 9px; overflow: hidden; border: 1px solid #808080;}
+
+/* MSIE 6 specific rules */
+
+* html a.mceButtonNormal img, * html a.mceButtonSelected img, * html a.mceButtonDisabled img {border: 0 !important; margin-top: 2px; margin-bottom: 1px;}
+* html a.mceButtonDisabled img {filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30); border: 0 !important;}
+* html a.mceButtonDisabled {border: 1px solid #F0F0EE !important;}
+* html a.mceButtonNormal, * html a.mceButtonSelected {border: 1px solid #F0F0EE !important; cursor: default;}
+* html a.mceButtonSelected {border: 1px solid #6779AA !important; background-color: #D4D5D8;}
+* html a.mceButtonNormal:hover, * html a.mceButtonSelected:hover {border: 1px solid #0A246A !important; background-color: #B6BDD2; cursor: default;}
+* html .mceSelectList {margin-top: 2px;}
+* html span.mceMenuButton, * html span.mceMenuButtonFocus {position: relative; left: 0; top: 0;}
+* html span.mceMenuButton img, * html span.mceMenuButtonSelected img, * html span.mceMenuButtonFocus img {position: relative; top: 1px;}
+* html a.mceMoreColors {width: auto;}
+* html .mceColors td a {width: 10px; height: 10px;}
+* html .mceColorPreview {margin-left: 2px; margin-top: 14px;}
+
+/* MSIE 7 specific rules */
+
+*:first-child+html a.mceButtonNormal img, *:first-child+html a.mceButtonSelected img, *:first-child+html a.mceButtonDisabled img {border: 0 !important; margin-top: 2px; margin-bottom: 1px;}
+*:first-child+html a.mceButtonDisabled img {filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30); border: 0 !important;}
+*:first-child+html a.mceButtonDisabled {border: 1px solid #F0F0EE !important;}
+*:first-child+html a.mceButtonNormal, *:first-child+html a.mceButtonSelected {border: 1px solid #F0F0EE !important; cursor: default;}
+*:first-child+html a.mceButtonSelected {border: 1px solid #6779AA !important; background-color: #D4D5D8;}
+*:first-child+html a.mceButtonNormal:hover, *:first-child+html a.mceButtonSelected:hover {border: 1px solid #0A246A !important; background-color: #B6BDD2; cursor: default;}
+*:first-child+html .mceSelectList {margin-top: 2px;}
+*:first-child+html span.mceMenuButton, *:first-child+html span.mceMenuButtonFocus {position: relative; left: 0; top: 0;}
+*:first-child+html span.mceMenuButton img, *:first-child+html span.mceMenuButtonSelected img, *:first-child+html span.mceMenuButtonFocus img {position: relative; top: 1px;}
+*:first-child+html a.mceMoreColors {width: 137px;}
+*:first-child+html .mceColors td a {width: 10px; height: 10px;}
+*:first-child+html .mceColorPreview {margin: 0; padding-left: 4px; margin-top: 14px; width: 14px;}

Deleted: plog/trunk/js/tinymce/themes/advanced/docs/en/about.htm
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/docs/en/about.htm	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/themes/advanced/docs/en/about.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,31 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-<HEAD>
-<TITLE>About TinyMCE</TITLE>
-<link href="style.css" rel="stylesheet" type="text/css">
-</HEAD>
-
-<BODY>
-
-<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pageheader">
-  <tr> 
-    <td><span class="title">About TinyMCE</span></td>
-    <td align="right"><a href="index.htm"><acronym title="Table of contents">TOC</acronym></a></td>
-  </tr>
-</table>
-<hr noshade>
-<br>
-TinyMCE is a small WYSIWYG editor control for web browsers such as MSIE or Mozilla 
-that enables you to edit HTML contents in a more user friendly way. It has common 
-features that are found in most word processors and should not be difficult to 
-use.<br>
-<br>
-<hr noshade>
-<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pagefooter">
-  <tr> 
-    <td>Go to: <a href="index.htm">Table of contents</a></td>
-    <td align="right"><a href="#">Top</a></td>
-  </tr>
-</table>
-<br>
-</BODY>
-</HTML>

Copied: plog/trunk/js/tinymce/themes/advanced/docs/en/about.htm (from rev 7165, plog/trunk/js/tinymce/themes/advanced/docs/en/about.htm)
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/docs/en/about.htm	                        (rev 0)
+++ plog/trunk/js/tinymce/themes/advanced/docs/en/about.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,31 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<HEAD>
+<TITLE>About TinyMCE</TITLE>
+<link href="style.css" rel="stylesheet" type="text/css">
+</HEAD>
+
+<BODY>
+
+<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pageheader">
+  <tr> 
+    <td><span class="title">About TinyMCE</span></td>
+    <td align="right"><a href="index.htm"><acronym title="Table of contents">TOC</acronym></a></td>
+  </tr>
+</table>
+<hr noshade>
+<br>
+TinyMCE is a small WYSIWYG editor control for web browsers such as MSIE or Mozilla 
+that enables you to edit HTML contents in a more user friendly way. It has common 
+features that are found in most word processors and should not be difficult to 
+use.<br>
+<br>
+<hr noshade>
+<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pagefooter">
+  <tr> 
+    <td>Go to: <a href="index.htm">Table of contents</a></td>
+    <td align="right"><a href="#">Top</a></td>
+  </tr>
+</table>
+<br>
+</BODY>
+</HTML>

Deleted: plog/trunk/js/tinymce/themes/advanced/docs/en/common_buttons.htm
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/docs/en/common_buttons.htm	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/themes/advanced/docs/en/common_buttons.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,162 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-<HEAD>
-<TITLE>Common buttons</TITLE>
-<link href="style.css" rel="stylesheet" type="text/css">
-</HEAD>
-
-<BODY>
-
-<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pageheader">
-  <tr> 
-    <td><span class="title">Common buttons</span></td>
-    <td align="right"><a href="index.htm"><acronym title="Table of contents">TOC</acronym></a></td>
-  </tr>
-</table>
-<hr noshade>
-<br>
-Below is a short description about each button.
-<br>
-<br>
-<table border="1" cellpadding="3" cellspacing="0">
-  <tr>
-    <td><img src="../../images/bold.gif" width="20" height="20" alt="Bold text icon" /></td>
-    <td>Bold text style (Ctrl+B).</td>
-  </tr>
-  <tr>
-    <td><img src="../../images/italic.gif" width="20" height="20" alt="Italic text icon" /></td>
-    <td>Italic text style (Ctrl+I).</td>
-  </tr>
-  <tr>
-    <td><img src="../../images/underline.gif" width="20" height="20" alt="Underline text icon." /></td>
-    <td>Underline text style (Ctrl+U).</td>
-  </tr>
-  <tr>
-    <td><img src="../../images/strikethrough.gif" width="20" height="20" alt="Strikethrough text icon." /></td>
-    <td>Strikethrough text style.</td>
-  </tr>
-  <tr>
-    <td><img src="../../images/justifyleft.gif" width="20" height="20" alt="Align left icon." /></td>
-    <td>Align left.</td>
-  </tr>
-  <tr>
-    <td><img src="../../images/justifycenter.gif" width="20" height="20" alt="Align center icon." /></td>
-    <td>Align center.</td>
-  </tr>
-  <tr>
-    <td><img src="../../images/justifyright.gif" width="20" height="20" alt="Align right icon." /></td>
-    <td>Align right.</td>
-  </tr>
-  <tr>
-    <td><img src="../../images/justifyfull.gif" width="20" height="20" alt="Align full icon." /></td>
-    <td>Align full.</td>
-  </tr>
-  <tr>
-    <td><img src="../../images/bullist.gif" width="20" height="20" alt="Unordered list/bullet list icon." /></td>
-    <td>Unordered list/bullet list.</td>
-  </tr>
-  <tr>
-    <td><img src="../../images/numlist.gif" width="20" height="20" alt="Ordered list/numbered list icon." /></td>
-    <td>Ordered list/numbered list</td>
-  </tr>
-  <tr>
-    <td><img src="../../images/outdent.gif" width="20" height="20" alt="Outdent/decrease indentation icon." /></td>
-    <td>Outdent/decrease indentation.</td>
-  </tr>
-  <tr>
-    <td><img src="../../images/indent.gif" width="20" height="20" alt="Indent/increase indentation icon." /></td>
-    <td>Indent/increase indentation.</td>
-  </tr>
-  <tr>
-    <td><img src="../../images/undo.gif" width="20" height="20" alt="Undo the last operation." /></td>
-    <td>Undo the last operation (Ctrl+Z).</td>
-  </tr>
-  <tr>
-    <td><img src="../../images/redo.gif" width="20" height="20" alt="Redo the last operation icon." /></td>
-    <td>Redo the last operation (Ctrl+Y).</td>
-  </tr>
-  <tr>
-    <td><img src="../../images/link.gif" width="20" height="20" alt="Insert a new link icon." /></td>
-    <td>Insert a new link, read more about this function in the <a href="insert_link_button.htm">Insert 
-      link section</a>.</td>
-  </tr>
-  <tr>
-    <td><img src="../../images/unlink.gif" width="20" height="20" alt="Unlinks the current selection icon." /></td>
-    <td>Unlinks the current selection/removes all selected links.</td>
-  </tr>
-  <tr>
-    <td><img src="../../images/anchor.gif" width="20" height="20" alt="Insert a new anchor icon." /></td>
-    <td>Insert a new anchor, read more about this function in the <a href="insert_anchor_button.htm">Insert anchor section.</a></td>
-  </tr>
-  <tr>
-    <td><img src="../../images/image.gif" width="20" height="20" alt="Insert a new image icon." /></td>
-    <td>Insert a new image, read more about this function in the <a href="insert_image_button.htm">Insert 
-      image section</a>.</td>
-  </tr>
-  <tr>
-    <td><img src="../../images/cleanup.gif" width="20" height="20" alt="Cleanup code icon." /></td>
-    <td>Cleanup code/Removes unwanted formating. This function is useful when 
-      you copy contents from for example a office product.</td>
-  </tr>
-  <tr>
-    <td><img src="../../images/help.gif" width="20" height="20" alt="Show help icon." /></td>
-    <td>Shows this help window.</td>
-  </tr>
-  <tr>
-    <td><img src="../../images/code.gif" width="20" height="20" alt="Source code editor icon." /></td>
-    <td>Opens HTML source code editor. </td>
-  </tr>
-  <tr>
-    <td><img src="../../../../plugins/table/images/table.gif" width="20" height="20" alt="Insert table icon." /></td>
-    <td>Inserts a new table at the current location. </td>
-  </tr>
-  <tr>
-    <td><img src="../../../../plugins/table/images/table_insert_row_before.gif" width="20" height="20" alt="Adds a row above icon." /></td>
-    <td>Adds a row above the current one. </td>
-  </tr>
-  <tr>
-    <td><img src="../../../../plugins/table/images/table_insert_row_after.gif" width="20" height="20" alt="Adds a row under icon." /></td>
-    <td>Adds a row under the current one. </td>
-  </tr>
-  <tr>
-    <td><img src="../../../../plugins/table/images/table_delete_row.gif" width="20" height="20" alt="Remove row icon." /></td>
-    <td>Removes the row. </td>
-  </tr>
-  <tr>
-    <td><img src="../../../../plugins/table/images/table_insert_col_before.gif" width="20" height="20" alt="Add column before icon." /></td>
-    <td>Adds a column before the current one.</td>
-  </tr>
-  <tr>
-    <td><img src="../../../../plugins/table/images/table_insert_col_after.gif" width="20" height="20" alt="Add column after icon." /></td>
-    <td>Adds a column after the current one.</td>
-  </tr>
-  <tr>
-    <td><img src="../../../../plugins/table/images/table_delete_col.gif" width="20" height="20" alt="Remove column icon." /></td>
-    <td>Removes the current column.</td>
-  </tr>
-  <tr>
-    <td><img src="../../images/hr.gif" width="20" height="20" alt="Insert horizontal ruler icon." /></td>
-    <td>Inserts a new horizontal ruler </td>
-  </tr>
-  <tr>
-    <td><img src="../../images/removeformat.gif" width="20" height="20" alt="Remove formatting icon." /></td>
-    <td>Removes formatting from the selection. </td>
-  </tr>
-  <tr>
-    <td><img src="../../images/sub.gif" width="20" height="20" alt="Subscript icon." /></td>
-    <td>Makes the selection to be subscript. </td>
-  </tr>
-  <tr>
-    <td><img src="../../images/sup.gif" width="20" height="20" alt="Superscript icon." /></td>
-    <td>Makes the selection to be superscripted. </td>
-  </tr>
-</table>
-<br>
-<hr noshade="noshade" />
-<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pagefooter">
-  <tr> 
-    <td>Go to: <a href="index.htm">Table of contents</a></td>
-    <td align="right"><a href="#">Top</a></td>
-  </tr>
-</table>
-</BODY>
-</HTML>

Copied: plog/trunk/js/tinymce/themes/advanced/docs/en/common_buttons.htm (from rev 7165, plog/trunk/js/tinymce/themes/advanced/docs/en/common_buttons.htm)
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/docs/en/common_buttons.htm	                        (rev 0)
+++ plog/trunk/js/tinymce/themes/advanced/docs/en/common_buttons.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,162 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<HEAD>
+<TITLE>Common buttons</TITLE>
+<link href="style.css" rel="stylesheet" type="text/css">
+</HEAD>
+
+<BODY>
+
+<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pageheader">
+  <tr> 
+    <td><span class="title">Common buttons</span></td>
+    <td align="right"><a href="index.htm"><acronym title="Table of contents">TOC</acronym></a></td>
+  </tr>
+</table>
+<hr noshade>
+<br>
+Below is a short description about each button.
+<br>
+<br>
+<table border="1" cellpadding="3" cellspacing="0">
+  <tr>
+    <td><img src="../../images/bold.gif" width="20" height="20" alt="Bold text icon" /></td>
+    <td>Bold text style (Ctrl+B).</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/italic.gif" width="20" height="20" alt="Italic text icon" /></td>
+    <td>Italic text style (Ctrl+I).</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/underline.gif" width="20" height="20" alt="Underline text icon." /></td>
+    <td>Underline text style (Ctrl+U).</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/strikethrough.gif" width="20" height="20" alt="Strikethrough text icon." /></td>
+    <td>Strikethrough text style.</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/justifyleft.gif" width="20" height="20" alt="Align left icon." /></td>
+    <td>Align left.</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/justifycenter.gif" width="20" height="20" alt="Align center icon." /></td>
+    <td>Align center.</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/justifyright.gif" width="20" height="20" alt="Align right icon." /></td>
+    <td>Align right.</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/justifyfull.gif" width="20" height="20" alt="Align full icon." /></td>
+    <td>Align full.</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/bullist.gif" width="20" height="20" alt="Unordered list/bullet list icon." /></td>
+    <td>Unordered list/bullet list.</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/numlist.gif" width="20" height="20" alt="Ordered list/numbered list icon." /></td>
+    <td>Ordered list/numbered list</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/outdent.gif" width="20" height="20" alt="Outdent/decrease indentation icon." /></td>
+    <td>Outdent/decrease indentation.</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/indent.gif" width="20" height="20" alt="Indent/increase indentation icon." /></td>
+    <td>Indent/increase indentation.</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/undo.gif" width="20" height="20" alt="Undo the last operation." /></td>
+    <td>Undo the last operation (Ctrl+Z).</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/redo.gif" width="20" height="20" alt="Redo the last operation icon." /></td>
+    <td>Redo the last operation (Ctrl+Y).</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/link.gif" width="20" height="20" alt="Insert a new link icon." /></td>
+    <td>Insert a new link, read more about this function in the <a href="insert_link_button.htm">Insert 
+      link section</a>.</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/unlink.gif" width="20" height="20" alt="Unlinks the current selection icon." /></td>
+    <td>Unlinks the current selection/removes all selected links.</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/anchor.gif" width="20" height="20" alt="Insert a new anchor icon." /></td>
+    <td>Insert a new anchor, read more about this function in the <a href="insert_anchor_button.htm">Insert anchor section.</a></td>
+  </tr>
+  <tr>
+    <td><img src="../../images/image.gif" width="20" height="20" alt="Insert a new image icon." /></td>
+    <td>Insert a new image, read more about this function in the <a href="insert_image_button.htm">Insert 
+      image section</a>.</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/cleanup.gif" width="20" height="20" alt="Cleanup code icon." /></td>
+    <td>Cleanup code/Removes unwanted formating. This function is useful when 
+      you copy contents from for example a office product.</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/help.gif" width="20" height="20" alt="Show help icon." /></td>
+    <td>Shows this help window.</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/code.gif" width="20" height="20" alt="Source code editor icon." /></td>
+    <td>Opens HTML source code editor. </td>
+  </tr>
+  <tr>
+    <td><img src="../../../../plugins/table/images/table.gif" width="20" height="20" alt="Insert table icon." /></td>
+    <td>Inserts a new table at the current location. </td>
+  </tr>
+  <tr>
+    <td><img src="../../../../plugins/table/images/table_insert_row_before.gif" width="20" height="20" alt="Adds a row above icon." /></td>
+    <td>Adds a row above the current one. </td>
+  </tr>
+  <tr>
+    <td><img src="../../../../plugins/table/images/table_insert_row_after.gif" width="20" height="20" alt="Adds a row under icon." /></td>
+    <td>Adds a row under the current one. </td>
+  </tr>
+  <tr>
+    <td><img src="../../../../plugins/table/images/table_delete_row.gif" width="20" height="20" alt="Remove row icon." /></td>
+    <td>Removes the row. </td>
+  </tr>
+  <tr>
+    <td><img src="../../../../plugins/table/images/table_insert_col_before.gif" width="20" height="20" alt="Add column before icon." /></td>
+    <td>Adds a column before the current one.</td>
+  </tr>
+  <tr>
+    <td><img src="../../../../plugins/table/images/table_insert_col_after.gif" width="20" height="20" alt="Add column after icon." /></td>
+    <td>Adds a column after the current one.</td>
+  </tr>
+  <tr>
+    <td><img src="../../../../plugins/table/images/table_delete_col.gif" width="20" height="20" alt="Remove column icon." /></td>
+    <td>Removes the current column.</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/hr.gif" width="20" height="20" alt="Insert horizontal ruler icon." /></td>
+    <td>Inserts a new horizontal ruler </td>
+  </tr>
+  <tr>
+    <td><img src="../../images/removeformat.gif" width="20" height="20" alt="Remove formatting icon." /></td>
+    <td>Removes formatting from the selection. </td>
+  </tr>
+  <tr>
+    <td><img src="../../images/sub.gif" width="20" height="20" alt="Subscript icon." /></td>
+    <td>Makes the selection to be subscript. </td>
+  </tr>
+  <tr>
+    <td><img src="../../images/sup.gif" width="20" height="20" alt="Superscript icon." /></td>
+    <td>Makes the selection to be superscripted. </td>
+  </tr>
+</table>
+<br>
+<hr noshade="noshade" />
+<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pagefooter">
+  <tr> 
+    <td>Go to: <a href="index.htm">Table of contents</a></td>
+    <td align="right"><a href="#">Top</a></td>
+  </tr>
+</table>
+</BODY>
+</HTML>

Deleted: plog/trunk/js/tinymce/themes/advanced/docs/en/create_accessible_content.htm
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/docs/en/create_accessible_content.htm	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/themes/advanced/docs/en/create_accessible_content.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,45 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-<HEAD>
-<TITLE>Insert table button</TITLE>
-<link href="style.css" rel="stylesheet" type="text/css">
-</HEAD>
-
-<BODY>
-
-<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pageheader">
-  <tr> 
-    <td><span class="title">Create accessible content</span></td>
-    <td align="right"><a href="index.htm"><acronym title="Table of contents">TOC</acronym></a></td>
-  </tr>
-</table>
-<hr noshade>
-<p>TinyMCE can create HTML content that will be accessible to all users, including those with disabilities using assistive technologies, as well as those using text-based browsers, or those browsing the Web with images turned off. </p>
-
-<p><strong>Things you can do to make your content accessible:</strong></p>
-<ol>
-<li><strong>Include an Image Description:</strong> Blind users, or others who are unable to view images, will rely on the Image Description (or Alt text) to take the place of the image. If an image contains no meaning, such as a decoration or a spacer image, leave the Image Description empty. TinyMCE will then insert an empty Alt text attribute that will force assistive technologies to ignore the image. <br /><br /></li>
-
-<li> <strong>Add Scope to data table header cells:</strong> In the table cell editor dialog window, choose a Scope when creating Header cells so the column or row label in that cell becomes explicitely associated with its data cells. Table cell headers will then be announced with each data cell, making it easier for blind users using a screen reader to understand what the content of each cell represents. <br /><br /></li>
-
-<li><strong> Structure content with properly nested headings:</strong> In the format selection menu choose Heading 1 to Heading 6 to represent headings in your content,  rather than using other font formating options. Blind users using a screen reader can then extract the headings from the page to generate a summary of the content it contains, and use those headings to navigate quickly to subsections within the page.<br /><br /></li>
-
-<li><strong> Include alternate content:</strong> Create an alternate page for non-HTML content such as Flash, Java applets, or  embedded movies. This might be a static image, with a description of the image, and a description of the content that would have appeared in its place. An alternate HTML page could also be created, and a link to it included next to the non-HTML object. This will ensure that the content will be accessible to users of assistive technologies that can not view or play the content, and ensure the content will be available to those who do not have the appropriate plugin or helper application installed.<br /><br /></li>
-
-<li><strong> Check accessbility: </strong> When the AChecker plugin is installed with TinyMCE, click on the Check Accessibility button to generate a report of potential accessibility problems.<br /><br /></li>
-
-</ol>
-
-<p>See the <a href="http://checker.atrc.utoronto.ca" target="_new">AChecker Web Site</a> for further details about creating content that will be accessible to all users.<br />
-</p>
-
-<hr noshade>
-<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pagefooter">
-  <tr> 
-    <td>Go to: <a href="index.htm">Table of contents</a></td>
-    <td align="right"><a href="#">Top</a></td>
-  </tr>
-</table>
-
-<br>
-</BODY>
-</HTML>

Copied: plog/trunk/js/tinymce/themes/advanced/docs/en/create_accessible_content.htm (from rev 7165, plog/trunk/js/tinymce/themes/advanced/docs/en/create_accessible_content.htm)
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/docs/en/create_accessible_content.htm	                        (rev 0)
+++ plog/trunk/js/tinymce/themes/advanced/docs/en/create_accessible_content.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,45 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<HEAD>
+<TITLE>Insert table button</TITLE>
+<link href="style.css" rel="stylesheet" type="text/css">
+</HEAD>
+
+<BODY>
+
+<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pageheader">
+  <tr> 
+    <td><span class="title">Create accessible content</span></td>
+    <td align="right"><a href="index.htm"><acronym title="Table of contents">TOC</acronym></a></td>
+  </tr>
+</table>
+<hr noshade>
+<p>TinyMCE can create HTML content that will be accessible to all users, including those with disabilities using assistive technologies, as well as those using text-based browsers, or those browsing the Web with images turned off. </p>
+
+<p><strong>Things you can do to make your content accessible:</strong></p>
+<ol>
+<li><strong>Include an Image Description:</strong> Blind users, or others who are unable to view images, will rely on the Image Description (or Alt text) to take the place of the image. If an image contains no meaning, such as a decoration or a spacer image, leave the Image Description empty. TinyMCE will then insert an empty Alt text attribute that will force assistive technologies to ignore the image. <br /><br /></li>
+
+<li> <strong>Add Scope to data table header cells:</strong> In the table cell editor dialog window, choose a Scope when creating Header cells so the column or row label in that cell becomes explicitely associated with its data cells. Table cell headers will then be announced with each data cell, making it easier for blind users using a screen reader to understand what the content of each cell represents. <br /><br /></li>
+
+<li><strong> Structure content with properly nested headings:</strong> In the format selection menu choose Heading 1 to Heading 6 to represent headings in your content,  rather than using other font formating options. Blind users using a screen reader can then extract the headings from the page to generate a summary of the content it contains, and use those headings to navigate quickly to subsections within the page.<br /><br /></li>
+
+<li><strong> Include alternate content:</strong> Create an alternate page for non-HTML content such as Flash, Java applets, or  embedded movies. This might be a static image, with a description of the image, and a description of the content that would have appeared in its place. An alternate HTML page could also be created, and a link to it included next to the non-HTML object. This will ensure that the content will be accessible to users of assistive technologies that can not view or play the content, and ensure the content will be available to those who do not have the appropriate plugin or helper application installed.<br /><br /></li>
+
+<li><strong> Check accessbility: </strong> When the AChecker plugin is installed with TinyMCE, click on the Check Accessibility button to generate a report of potential accessibility problems.<br /><br /></li>
+
+</ol>
+
+<p>See the <a href="http://checker.atrc.utoronto.ca" target="_new">AChecker Web Site</a> for further details about creating content that will be accessible to all users.<br />
+</p>
+
+<hr noshade>
+<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pagefooter">
+  <tr> 
+    <td>Go to: <a href="index.htm">Table of contents</a></td>
+    <td align="right"><a href="#">Top</a></td>
+  </tr>
+</table>
+
+<br>
+</BODY>
+</HTML>

Deleted: plog/trunk/js/tinymce/themes/advanced/docs/en/images/insert_anchor_window.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/docs/en/images/insert_anchor_window.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/docs/en/images/insert_anchor_window.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/docs/en/images/insert_image_window.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/docs/en/images/insert_image_window.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/docs/en/images/insert_image_window.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/docs/en/images/insert_link_window.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/docs/en/images/insert_link_window.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/docs/en/images/insert_link_window.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/docs/en/images/insert_table_window.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/docs/en/images/insert_table_window.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/docs/en/images/insert_table_window.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/docs/en/index.htm
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/docs/en/index.htm	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/themes/advanced/docs/en/index.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,27 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-<HEAD>
-<TITLE>Help Index</TITLE>
-<link href="style.css" rel="stylesheet" type="text/css">
-</HEAD>
-<BODY onload="window.focus();">
-<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pageheader">
-  <tr> 
-    <td><span class="title">Table of contents</span></td>
-    <td align="right"> </td>
-  </tr>
-</table>
-<hr noshade>
-<br>
-Click the links below to go to the different help sections. 
-<ul class="toc_ul">
-  <li class="toc_li"><a href="about.htm">About TinyMCE</a></li>
-  <li class="toc_li"><a href="common_buttons.htm">Common buttons</a></li>
-  <li class="toc_li"><a href="insert_image_button.htm">Insert image button</a></li>
-  <li class="toc_li"><a href="insert_link_button.htm">Insert link button</a></li>
-  <li class="toc_li"><a href="insert_anchor_button.htm">Insert anchor button</a></li>
-  <li class="toc_li"><a href="insert_table_button.htm">Insert table button</a></li>
- <li class="toc_li"><a href="create_accessible_content.htm">Create accessible content</a></li>
-</ul>
-<hr noshade>
-</BODY>
-</HTML>

Copied: plog/trunk/js/tinymce/themes/advanced/docs/en/index.htm (from rev 7165, plog/trunk/js/tinymce/themes/advanced/docs/en/index.htm)
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/docs/en/index.htm	                        (rev 0)
+++ plog/trunk/js/tinymce/themes/advanced/docs/en/index.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,27 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<HEAD>
+<TITLE>Help Index</TITLE>
+<link href="style.css" rel="stylesheet" type="text/css">
+</HEAD>
+<BODY onload="window.focus();">
+<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pageheader">
+  <tr> 
+    <td><span class="title">Table of contents</span></td>
+    <td align="right"> </td>
+  </tr>
+</table>
+<hr noshade>
+<br>
+Click the links below to go to the different help sections. 
+<ul class="toc_ul">
+  <li class="toc_li"><a href="about.htm">About TinyMCE</a></li>
+  <li class="toc_li"><a href="common_buttons.htm">Common buttons</a></li>
+  <li class="toc_li"><a href="insert_image_button.htm">Insert image button</a></li>
+  <li class="toc_li"><a href="insert_link_button.htm">Insert link button</a></li>
+  <li class="toc_li"><a href="insert_anchor_button.htm">Insert anchor button</a></li>
+  <li class="toc_li"><a href="insert_table_button.htm">Insert table button</a></li>
+ <li class="toc_li"><a href="create_accessible_content.htm">Create accessible content</a></li>
+</ul>
+<hr noshade>
+</BODY>
+</HTML>

Deleted: plog/trunk/js/tinymce/themes/advanced/docs/en/insert_anchor_button.htm
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/docs/en/insert_anchor_button.htm	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/themes/advanced/docs/en/insert_anchor_button.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,32 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-<HEAD>
-<TITLE>Insert anchor button</TITLE>
-<link href="style.css" rel="stylesheet" type="text/css">
-</HEAD>
-
-<BODY>
-
-<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pageheader">
-  <tr> 
-    <td><span class="title">Insert anchor button</span></td>
-    <td align="right"><a href="index.htm"><acronym title="Table of contents">TOC</acronym></a></td>
-  </tr>
-</table>
-<hr noshade>
-<br>
-This button opens a new window with the insert/edit anchor function.<br>
-<br>
-<img src="images/insert_anchor_window.gif" width="330" height="139" alt="Anchor dialog/window" /><br>
-<br>
-There are one field in this window, this is where you enter the name of you anchor point. Remember the anchor name needs to be unique. <br>
-<br>
-<hr noshade>
-<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pagefooter">
-  <tr> 
-    <td>Go to: <a href="index.htm">Table of contents</a></td>
-    <td align="right"><a href="#">Top</a></td>
-  </tr>
-</table>
-<br>
-</BODY>
-</HTML>

Copied: plog/trunk/js/tinymce/themes/advanced/docs/en/insert_anchor_button.htm (from rev 7165, plog/trunk/js/tinymce/themes/advanced/docs/en/insert_anchor_button.htm)
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/docs/en/insert_anchor_button.htm	                        (rev 0)
+++ plog/trunk/js/tinymce/themes/advanced/docs/en/insert_anchor_button.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,32 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<HEAD>
+<TITLE>Insert anchor button</TITLE>
+<link href="style.css" rel="stylesheet" type="text/css">
+</HEAD>
+
+<BODY>
+
+<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pageheader">
+  <tr> 
+    <td><span class="title">Insert anchor button</span></td>
+    <td align="right"><a href="index.htm"><acronym title="Table of contents">TOC</acronym></a></td>
+  </tr>
+</table>
+<hr noshade>
+<br>
+This button opens a new window with the insert/edit anchor function.<br>
+<br>
+<img src="images/insert_anchor_window.gif" width="330" height="139" alt="Anchor dialog/window" /><br>
+<br>
+There are one field in this window, this is where you enter the name of you anchor point. Remember the anchor name needs to be unique. <br>
+<br>
+<hr noshade>
+<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pagefooter">
+  <tr> 
+    <td>Go to: <a href="index.htm">Table of contents</a></td>
+    <td align="right"><a href="#">Top</a></td>
+  </tr>
+</table>
+<br>
+</BODY>
+</HTML>

Deleted: plog/trunk/js/tinymce/themes/advanced/docs/en/insert_image_button.htm
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/docs/en/insert_image_button.htm	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/themes/advanced/docs/en/insert_image_button.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,65 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-<HEAD>
-<TITLE>Insert image button</TITLE>
-<link href="style.css" rel="stylesheet" type="text/css">
-</HEAD>
-
-<BODY>
-
-<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pageheader">
-  <tr> 
-    <td><span class="title">Insert image button</span></td>
-    <td align="right"><a href="index.htm"><acronym title="Table of contents">TOC</acronym></a></td>
-  </tr>
-</table>
-<hr noshade>
-<br>
-The insert image button opens the window shown below.<br>
-<br>
-<img src="images/insert_image_window.gif" alt="Insert image dialog/window" /><br>
-<br>
-You simply enter a URL to the image you want to link to and enter a image description, 
-this is then displayed as an alternative text descripton of the image on the page.<br>
-<br>
-<strong>Field descriptions:</strong><br>
-<table border="1" cellspacing="0">
-  <tr>
-    <td width="150"><strong>Image URL </strong></td>
-    <td>URL/path to the image.</td>
-  </tr>
-  <tr>
-    <td width="150"><strong>Image description </strong></td>
-    <td>Alternative description of image contents.</td>
-  </tr>
-  <tr>
-    <td><strong>Dimentions</strong></td>
-    <td>Image width/height. </td>
-  </tr>
-  <tr>
-    <td><strong>Alignment</strong></td>
-    <td>Image alignment, useful when wrapping text around images.</td>
-  </tr>
-  <tr>
-    <td><strong>Border</strong></td>
-    <td>Border thickness. </td>
-  </tr>
-  <tr>
-    <td><strong>VSpace</strong></td>
-    <td>Vertical space, useful when wrapping text around images.</td>
-  </tr>
-  <tr>
-    <td><strong>HSpace</strong></td>
-    <td>Horizontal space, useful when wrapping text around images.</td>
-  </tr>
-</table>
-<br>
-<hr noshade>
-<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pagefooter">
-  <tr> 
-    <td>Go to: <a href="index.htm">Table of contents</a></td>
-    <td align="right"><a href="#">Top</a></td>
-  </tr>
-</table>
-<br>
-</BODY>
-</HTML>

Copied: plog/trunk/js/tinymce/themes/advanced/docs/en/insert_image_button.htm (from rev 7165, plog/trunk/js/tinymce/themes/advanced/docs/en/insert_image_button.htm)
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/docs/en/insert_image_button.htm	                        (rev 0)
+++ plog/trunk/js/tinymce/themes/advanced/docs/en/insert_image_button.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,65 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<HEAD>
+<TITLE>Insert image button</TITLE>
+<link href="style.css" rel="stylesheet" type="text/css">
+</HEAD>
+
+<BODY>
+
+<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pageheader">
+  <tr> 
+    <td><span class="title">Insert image button</span></td>
+    <td align="right"><a href="index.htm"><acronym title="Table of contents">TOC</acronym></a></td>
+  </tr>
+</table>
+<hr noshade>
+<br>
+The insert image button opens the window shown below.<br>
+<br>
+<img src="images/insert_image_window.gif" alt="Insert image dialog/window" /><br>
+<br>
+You simply enter a URL to the image you want to link to and enter a image description, 
+this is then displayed as an alternative text descripton of the image on the page.<br>
+<br>
+<strong>Field descriptions:</strong><br>
+<table border="1" cellspacing="0">
+  <tr>
+    <td width="150"><strong>Image URL </strong></td>
+    <td>URL/path to the image.</td>
+  </tr>
+  <tr>
+    <td width="150"><strong>Image description </strong></td>
+    <td>Alternative description of image contents.</td>
+  </tr>
+  <tr>
+    <td><strong>Dimentions</strong></td>
+    <td>Image width/height. </td>
+  </tr>
+  <tr>
+    <td><strong>Alignment</strong></td>
+    <td>Image alignment, useful when wrapping text around images.</td>
+  </tr>
+  <tr>
+    <td><strong>Border</strong></td>
+    <td>Border thickness. </td>
+  </tr>
+  <tr>
+    <td><strong>VSpace</strong></td>
+    <td>Vertical space, useful when wrapping text around images.</td>
+  </tr>
+  <tr>
+    <td><strong>HSpace</strong></td>
+    <td>Horizontal space, useful when wrapping text around images.</td>
+  </tr>
+</table>
+<br>
+<hr noshade>
+<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pagefooter">
+  <tr> 
+    <td>Go to: <a href="index.htm">Table of contents</a></td>
+    <td align="right"><a href="#">Top</a></td>
+  </tr>
+</table>
+<br>
+</BODY>
+</HTML>

Deleted: plog/trunk/js/tinymce/themes/advanced/docs/en/insert_link_button.htm
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/docs/en/insert_link_button.htm	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/themes/advanced/docs/en/insert_link_button.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,33 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-<HEAD>
-<TITLE>Insert link button</TITLE>
-<link href="style.css" rel="stylesheet" type="text/css">
-</HEAD>
-
-<BODY>
-
-<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pageheader">
-  <tr> 
-    <td><span class="title">Insert link button</span></td>
-    <td align="right"><a href="index.htm"><acronym title="Table of contents">TOC</acronym></a></td>
-  </tr>
-</table>
-<hr noshade>
-<br>
-This button opens a new window with the insert/edit link function.<br>
-<br>
-<img src="images/insert_link_window.gif" width="330" height="159" alt="Insert link dialog/window" /><br>
-<br>
-There are two fields in this window the first one "Link URL" is the 
-URL of the link. The target enables you to select how the link is to be opened.<br>
-<br>
-<hr noshade>
-<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pagefooter">
-  <tr> 
-    <td>Go to: <a href="index.htm">Table of contents</a></td>
-    <td align="right"><a href="#">Top</a></td>
-  </tr>
-</table>
-<br>
-</BODY>
-</HTML>

Copied: plog/trunk/js/tinymce/themes/advanced/docs/en/insert_link_button.htm (from rev 7165, plog/trunk/js/tinymce/themes/advanced/docs/en/insert_link_button.htm)
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/docs/en/insert_link_button.htm	                        (rev 0)
+++ plog/trunk/js/tinymce/themes/advanced/docs/en/insert_link_button.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,33 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<HEAD>
+<TITLE>Insert link button</TITLE>
+<link href="style.css" rel="stylesheet" type="text/css">
+</HEAD>
+
+<BODY>
+
+<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pageheader">
+  <tr> 
+    <td><span class="title">Insert link button</span></td>
+    <td align="right"><a href="index.htm"><acronym title="Table of contents">TOC</acronym></a></td>
+  </tr>
+</table>
+<hr noshade>
+<br>
+This button opens a new window with the insert/edit link function.<br>
+<br>
+<img src="images/insert_link_window.gif" width="330" height="159" alt="Insert link dialog/window" /><br>
+<br>
+There are two fields in this window the first one "Link URL" is the 
+URL of the link. The target enables you to select how the link is to be opened.<br>
+<br>
+<hr noshade>
+<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pagefooter">
+  <tr> 
+    <td>Go to: <a href="index.htm">Table of contents</a></td>
+    <td align="right"><a href="#">Top</a></td>
+  </tr>
+</table>
+<br>
+</BODY>
+</HTML>

Deleted: plog/trunk/js/tinymce/themes/advanced/docs/en/insert_table_button.htm
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/docs/en/insert_table_button.htm	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/themes/advanced/docs/en/insert_table_button.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,71 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-<HEAD>
-<TITLE>Insert table button</TITLE>
-<link href="style.css" rel="stylesheet" type="text/css">
-</HEAD>
-
-<BODY>
-
-<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pageheader">
-  <tr> 
-    <td><span class="title">Insert table button</span></td>
-    <td align="right"><a href="index.htm"><acronym title="Table of contents">TOC</acronym></a></td>
-  </tr>
-</table>
-<hr noshade>
-<br>
-The insert table button opens the window shown below. This action enables you to create tables. <br>
-<br>
-<img src="images/insert_table_window.gif" width="340" height="229" alt="Image of table window" /><br>
-<br>
-<strong>Field descriptions:</strong><br>
-<table border="1" cellspacing="0">
-  <tr>
-    <td width="150"><strong>Columns</strong></td>
-    <td>Number of columns in the  table. </td>
-  </tr>
-  <tr>
-    <td width="150"><strong>Rows</strong></td>
-    <td>Number of rows in the new table.</td>
-  </tr>
-  <tr>
-    <td><strong>Cellpadding</strong></td>
-    <td>Cellpadding of the table . </td>
-  </tr>
-  <tr>
-    <td><strong>Cellspacing</strong></td>
-    <td>Cellspacing of the table .</td>
-  </tr>
-  <tr>
-    <td><strong>Alignment</strong></td>
-    <td>Table alignment . </td>
-  </tr>
-  <tr>
-    <td><strong>Border</strong></td>
-    <td>Border thinkness of table.</td>
-  </tr>
-  <tr>
-    <td><strong>Width</strong></td>
-    <td>Width in pixels of table .</td>
-  </tr>
-  <tr>
-    <td><strong>Height</strong></td>
-    <td>Height in pixels of table.</td>
-  </tr>
-  <tr>
-    <td><strong>Class</strong></td>
-    <td>Style or CSS class of table.</td>
-  </tr>
-</table>
-<br>
-<br>
-<hr noshade>
-<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pagefooter">
-  <tr> 
-    <td>Go to: <a href="index.htm">Table of contents</a></td>
-    <td align="right"><a href="#">Top</a></td>
-  </tr>
-</table>
-<br>
-</BODY>
-</HTML>

Copied: plog/trunk/js/tinymce/themes/advanced/docs/en/insert_table_button.htm (from rev 7165, plog/trunk/js/tinymce/themes/advanced/docs/en/insert_table_button.htm)
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/docs/en/insert_table_button.htm	                        (rev 0)
+++ plog/trunk/js/tinymce/themes/advanced/docs/en/insert_table_button.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,71 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<HEAD>
+<TITLE>Insert table button</TITLE>
+<link href="style.css" rel="stylesheet" type="text/css">
+</HEAD>
+
+<BODY>
+
+<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pageheader">
+  <tr> 
+    <td><span class="title">Insert table button</span></td>
+    <td align="right"><a href="index.htm"><acronym title="Table of contents">TOC</acronym></a></td>
+  </tr>
+</table>
+<hr noshade>
+<br>
+The insert table button opens the window shown below. This action enables you to create tables. <br>
+<br>
+<img src="images/insert_table_window.gif" width="340" height="229" alt="Image of table window" /><br>
+<br>
+<strong>Field descriptions:</strong><br>
+<table border="1" cellspacing="0">
+  <tr>
+    <td width="150"><strong>Columns</strong></td>
+    <td>Number of columns in the  table. </td>
+  </tr>
+  <tr>
+    <td width="150"><strong>Rows</strong></td>
+    <td>Number of rows in the new table.</td>
+  </tr>
+  <tr>
+    <td><strong>Cellpadding</strong></td>
+    <td>Cellpadding of the table . </td>
+  </tr>
+  <tr>
+    <td><strong>Cellspacing</strong></td>
+    <td>Cellspacing of the table .</td>
+  </tr>
+  <tr>
+    <td><strong>Alignment</strong></td>
+    <td>Table alignment . </td>
+  </tr>
+  <tr>
+    <td><strong>Border</strong></td>
+    <td>Border thinkness of table.</td>
+  </tr>
+  <tr>
+    <td><strong>Width</strong></td>
+    <td>Width in pixels of table .</td>
+  </tr>
+  <tr>
+    <td><strong>Height</strong></td>
+    <td>Height in pixels of table.</td>
+  </tr>
+  <tr>
+    <td><strong>Class</strong></td>
+    <td>Style or CSS class of table.</td>
+  </tr>
+</table>
+<br>
+<br>
+<hr noshade>
+<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pagefooter">
+  <tr> 
+    <td>Go to: <a href="index.htm">Table of contents</a></td>
+    <td align="right"><a href="#">Top</a></td>
+  </tr>
+</table>
+<br>
+</BODY>
+</HTML>

Deleted: plog/trunk/js/tinymce/themes/advanced/docs/en/style.css
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/docs/en/style.css	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/themes/advanced/docs/en/style.css	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,28 +0,0 @@
-body { background-color: #FFFFFF; }
-body, td, .content { font-family: Verdana, Arial, helvetica, sans-serif; font-size: 12px; }
-.title { font-family: Verdana, Arial, helvetica, sans-serif; font-size: 16px; font-weight: bold; }
-.subtitle { font-size: 12px; font-weight: bold; }
-
-.toc_ul, .toc_li { margin-left: 8px; line-height: 16px; }
-.step_ol, .step_li { margin-left: 11px; line-height: 16px; }
-img { border: #000000 solid 1px; }
-
-a:visited { color: #666666; text-decoration: underline; }
-a:active { color: #666666; text-decoration: underline; }
-a:hover { color: #666666; text-decoration: underline; }
-a { color: #666666; text-decoration: underline; }
-
-.pageheader { border: #E0E0E0 solid 1px; }
-.pagefooter { border: #E0E0E0 solid 1px; }
-.sample { background-color: #FFFFFF; border: #000000 solid 1px; }
-.samplecontent { font-size: 10px; }
-
-.code { background-color: #FFFFFF; border: #000000 solid 1px; }
-.codecontent { font-size: 10px; }
-.codecontent a:visited { color: #666666; text-decoration: none; font-weight: bold }
-.codecontent a:active { color: #666666; text-decoration: none; font-weight: bold  }
-.codecontent a:hover { color: #666666; text-decoration: none; font-weight: bold  }
-.codecontent a { color: #666666; text-decoration: none; font-weight: bold  }
-
-hr { height: 1px; }
-

Copied: plog/trunk/js/tinymce/themes/advanced/docs/en/style.css (from rev 7165, plog/trunk/js/tinymce/themes/advanced/docs/en/style.css)
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/docs/en/style.css	                        (rev 0)
+++ plog/trunk/js/tinymce/themes/advanced/docs/en/style.css	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,28 @@
+body { background-color: #FFFFFF; }
+body, td, .content { font-family: Verdana, Arial, helvetica, sans-serif; font-size: 12px; }
+.title { font-family: Verdana, Arial, helvetica, sans-serif; font-size: 16px; font-weight: bold; }
+.subtitle { font-size: 12px; font-weight: bold; }
+
+.toc_ul, .toc_li { margin-left: 8px; line-height: 16px; }
+.step_ol, .step_li { margin-left: 11px; line-height: 16px; }
+img { border: #000000 solid 1px; }
+
+a:visited { color: #666666; text-decoration: underline; }
+a:active { color: #666666; text-decoration: underline; }
+a:hover { color: #666666; text-decoration: underline; }
+a { color: #666666; text-decoration: underline; }
+
+.pageheader { border: #E0E0E0 solid 1px; }
+.pagefooter { border: #E0E0E0 solid 1px; }
+.sample { background-color: #FFFFFF; border: #000000 solid 1px; }
+.samplecontent { font-size: 10px; }
+
+.code { background-color: #FFFFFF; border: #000000 solid 1px; }
+.codecontent { font-size: 10px; }
+.codecontent a:visited { color: #666666; text-decoration: none; font-weight: bold }
+.codecontent a:active { color: #666666; text-decoration: none; font-weight: bold  }
+.codecontent a:hover { color: #666666; text-decoration: none; font-weight: bold  }
+.codecontent a { color: #666666; text-decoration: none; font-weight: bold  }
+
+hr { height: 1px; }
+

Modified: plog/trunk/js/tinymce/themes/advanced/editor_template.js
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/editor_template.js	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/js/tinymce/themes/advanced/editor_template.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1 +1 @@
-(function(e){var d=e.DOM,b=e.dom.Event,h=e.extend,f=e.each,a=e.util.Cookie,g,c=e.explode;e.ThemeManager.requireLangPack("advanced");e.create("tinymce.themes.AdvancedTheme",{sizes:[8,10,12,14,18,24,36],controls:{bold:["bold_desc","Bold"],italic:["italic_desc","Italic"],underline:["underline_desc","Underline"],strikethrough:["striketrough_desc","Strikethrough"],justifyleft:["justifyleft_desc","JustifyLeft"],justifycenter:["justifycenter_desc","JustifyCenter"],justifyright:["justifyright_desc","JustifyRight"],justifyfull:["justifyfull_desc","JustifyFull"],bullist:["bullist_desc","InsertUnorderedList"],numlist:["numlist_desc","InsertOrderedList"],outdent:["outdent_desc","Outdent"],indent:["indent_desc","Indent"],cut:["cut_desc","Cut"],copy:["copy_desc","Copy"],paste:["paste_desc","Paste"],undo:["undo_desc","Undo"],redo:["redo_desc","Redo"],link:["link_desc","mceLink"],unlink:["unlink_desc","unlink"],image:["image_desc","mceImage"],cleanup:["cleanup_desc","mceCleanup"],help:["hel
 p_desc","mceHelp"],code:["code_desc","mceCodeEditor"],hr:["hr_desc","InsertHorizontalRule"],removeformat:["removeformat_desc","RemoveFormat"],sub:["sub_desc","subscript"],sup:["sup_desc","superscript"],forecolor:["forecolor_desc","ForeColor"],forecolorpicker:["forecolor_desc","mceForeColor"],backcolor:["backcolor_desc","HiliteColor"],backcolorpicker:["backcolor_desc","mceBackColor"],charmap:["charmap_desc","mceCharMap"],visualaid:["visualaid_desc","mceToggleVisualAid"],anchor:["anchor_desc","mceInsertAnchor"],newdocument:["newdocument_desc","mceNewDocument"],blockquote:["blockquote_desc","mceBlockQuote"]},stateControls:["bold","italic","underline","strikethrough","bullist","numlist","justifyleft","justifycenter","justifyright","justifyfull","sub","sup","blockquote"],init:function(j,k){var l=this,m,i,n;l.editor=j;l.url=k;l.onResolveName=new e.util.Dispatcher(this);l.settings=m=h({theme_advanced_path:true,theme_advanced_toolbar_location:"bottom",theme_advanced_buttons1:"bold,i
 talic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advan
 ced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1,theme_advanced_font_sizes:"1,2,3,4,5,6,7",readonly:j.settings.readonly},j.settings);if(!m.font_size_style_values){m.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt"}if(e.is(m.theme_advanced_font_sizes,"string")){m.font_size_style_values=e.explode(m.font_size_style_values);m.font_size_classes=e.explode(m.font_size_classes||"");n={};j.settings.theme_advanced_font_sizes=m.theme_advanced_font_sizes;f(j.getParam("theme_advanced_font_sizes","","hash"),function(q,p){var o;if(p==q&&q>=1&&q<=7){p=q+" ("+l.sizes[q-1]+"pt)";o=m.font_size_classes[q-1];q=m.font_size_style_values[q-1]||(l.sizes[q-1]+"pt")}if(/^\s*\./.test(q)){o=q.replace(/\./g,"")}n[p]=o?{"class":o}:{fontSize:q}});m.theme_advanced_font_sizes=n}if((i=m.theme_advanced_path_location)&&i!="none"){m.theme_advanced_statusbar_location=m.theme_advanced_path_location}if(m.theme_advanced_statusbar_location=="none"){m.theme_advanced_statusbar_location=0}j.onInit.
 add(function(){if(!j.settings.readonly){j.onNodeChange.add(l._nodeChanged,l)}if(j.settings.content_css!==false){j.dom.loadCSS(j.baseURI.toAbsolute(k+"/skins/"+j.settings.skin+"/content.css"))}});j.onSetProgressState.add(function(q,o,r){var s,t=q.id,p;if(o){l.progressTimer=setTimeout(function(){s=q.getContainer();s=s.insertBefore(d.create("DIV",{style:"position:relative"}),s.firstChild);p=d.get(q.id+"_tbl");d.add(s,"div",{id:t+"_blocker","class":"mceBlocker",style:{width:p.clientWidth+2,height:p.clientHeight+2}});d.add(s,"div",{id:t+"_progress","class":"mceProgress",style:{left:p.clientWidth/2,top:p.clientHeight/2}})},r||0)}else{d.remove(t+"_blocker");d.remove(t+"_progress");clearTimeout(l.progressTimer)}});d.loadCSS(m.editor_css?j.documentBaseURI.toAbsolute(m.editor_css):k+"/skins/"+j.settings.skin+"/ui.css");if(m.skin_variant){d.loadCSS(k+"/skins/"+j.settings.skin+"/ui_"+m.skin_variant+".css")}},createControl:function(l,i){var j,k;if(k=i.createControl(l)){return k}switch(l)
 {case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if((j=this.controls[l])){return i.createButton(l,{title:"advanced."+j[0],cmd:j[1],ui:j[2],value:j[3]})}},execCommand:function(k,j,l){var i=this["_"+k];if(i){i.call(this,j,l);return true}return false},_importClasses:function(k){var i=this.editor,j=i.controlManager.get("styleselect");if(j.getLength()==0){f(i.dom.getClasses(),function(n,l){var m="style_"+l;i.formatter.register(m,{inline:"span",attributes:{"class":n["class"]},selector:"*"});j.add(n["class"],m)})}},_createStyleSelect:function(m){var k=this,i=k.editor,j=i.controlManager,l;l=j.createListBox("styleselect",{title:"advanced.style_select",onselect:function(o){var p,n=[];f(l.items,function(q){n.push(q.value)});i.
 focus();i.undoManager.add();p=i.formatter.matchAll(n);if(!o||p[0]==o){i.formatter.remove(p[0])}else{i.formatter.apply(o)}i.undoManager.add();i.nodeChanged();return false}});i.onInit.add(function(){var o=0,n=i.getParam("style_formats");if(n){f(n,function(p){var q,r=0;f(p,function(){r++});if(r>1){q=p.name=p.name||"style_"+(o++);i.formatter.register(q,p);l.add(p.title,q)}else{l.add(p.title)}})}else{f(i.getParam("theme_advanced_styles","","hash"),function(r,q){var p;if(r){p="style_"+(o++);i.formatter.register(p,{inline:"span",classes:r,selector:"*"});l.add(k.editor.translate(q),p)}})}});if(l.getLength()==0){l.onPostRender.add(function(o,p){if(!l.NativeListBox){b.add(p.id+"_text","focus",k._importClasses,k);b.add(p.id+"_text","mousedown",k._importClasses,k);b.add(p.id+"_open","focus",k._importClasses,k);b.add(p.id+"_open","mousedown",k._importClasses,k)}else{b.add(p.id,"focus",k._importClasses,k)}})}return l},_createFontSelect:function(){var k,j=this,i=j.editor;k=i.controlManager
 .createListBox("fontselect",{title:"advanced.fontdefault",onselect:function(l){var m=k.items[k.selectedIndex];if(!l&&m){i.execCommand("FontName",false,m.value);return}i.execCommand("FontName",false,l);k.select(function(n){return l==n});return false}});if(k){f(i.getParam("theme_advanced_fonts",j.settings.theme_advanced_fonts,"hash"),function(m,l){k.add(i.translate(l),m,{style:m.indexOf("dings")==-1?"font-family:"+m:""})})}return k},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(i){var o=n.items[n.selectedIndex];if(!i&&o){o=o.value;if(o["class"]){k.formatter.toggle("fontsize_class",{value:o["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,o.fontSize)}return}if(i["class"]){k.focus();k.undoManager.add();k.formatter.toggle("fontsize_class",{value:i["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,i.f
 ontSize)}n.select(function(p){return i==p});return false}});if(n){f(m.settings.theme_advanced_font_sizes,function(o,i){var p=o.fontSize;if(p>=1&&p<=7){p=m.sizes[parseInt(p)-1]+"pt"}n.add(i,o,{style:"font-size:"+p,"class":"mceFontSize"+(l++)+(" "+(o["class"]||""))})})}return n},_createBlockFormats:function(){var k,i={p:"advanced.paragraph",address:"advanced.address",pre:"advanced.pre",h1:"advanced.h1",h2:"advanced.h2",h3:"advanced.h3",h4:"advanced.h4",h5:"advanced.h5",h6:"advanced.h6",div:"advanced.div",blockquote:"advanced.blockquote",code:"advanced.code",dt:"advanced.dt",dd:"advanced.dd",samp:"advanced.samp"},j=this;k=j.editor.controlManager.createListBox("formatselect",{title:"advanced.block",cmd:"FormatBlock"});if(k){f(j.editor.getParam("theme_advanced_blockformats",j.settings.theme_advanced_blockformats,"hash"),function(m,l){k.add(j.editor.translate(l!=m?l:i[m]),m,{"class":"mce_formatPreview mce_"+m})})}return k},_createForeColorMenu:function(){var m,j=this,k=j.settings,
 l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_text_colors){l.colors=i}if(k.theme_advanced_default_foreground_color){l.default_color=k.theme_advanced_default_foreground_color}l.title="advanced.forecolor_desc";l.cmd="ForeColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("forecolor",l);return m},_createBackColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_background_colors){l.colors=i}if(k.theme_advanced_default_background_color){l.default_color=k.theme_advanced_default_background_color}l.title="advanced.backcolor_desc";l.cmd="HiliteColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("backcolor",l);return m},renderUI:function(k){var m,l,q,v=this,r=v.editor,w=v.settings,u,j
 ,i;m=j=d.create("span",{id:r.id+"_parent","class":"mceEditor "+r.settings.skin+"Skin"+(w.skin_variant?" "+r.settings.skin+"Skin"+v._ufirst(w.skin_variant):"")});if(!d.boxModel){m=d.add(m,"div",{"class":"mceOldBoxModel"})}m=u=d.add(m,"table",{id:r.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});m=q=d.add(m,"tbody");switch((w.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":l=v._rowLayout(w,q,k);break;case"customlayout":l=r.execCallback("theme_advanced_custom_layout",w,q,k,j);break;default:l=v._simpleLayout(w,q,k,j)}m=k.targetNode;i=d.stdMode?u.getElementsByTagName("tr"):u.rows;d.addClass(i[0],"mceFirst");d.addClass(i[i.length-1],"mceLast");f(d.select("tr",q),function(o){d.addClass(o.firstChild,"mceFirst");d.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(d.get(w.theme_advanced_toolbar_container)){d.get(w.theme_advanced_toolbar_container).appendChild(j)}else{d.insertAfter(j,m)}b.add(r.id+"_path_row","click",function(n){n=n.target;if(n.
 nodeName=="A"){v._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return b.cancel(n)}});if(!r.getParam("accessibility_focus")){b.add(d.add(j,"a",{href:"#"},"<!-- IE -->"),"focus",function(){tinyMCE.get(r.id).focus()})}if(w.theme_advanced_toolbar_location=="external"){k.deltaHeight=0}v.deltaHeight=k.deltaHeight;k.targetNode=null;return{iframeContainer:l,editorContainer:r.id+"_parent",sizeContainer:u,deltaHeight:k.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:e.majorVersion+"."+e.minorVersion}},resizeBy:function(i,j){var k=d.get(this.editor.id+"_tbl");this.resizeTo(k.clientWidth+i,k.clientHeight+j)},resizeTo:function(i,l){var j=this.editor,k=this.settings,m=d.get(j.id+"_tbl"),n=d.get(j.id+"_ifr");i=Math.max(k.theme_advanced_resizing_min_width||100,i);l=Math.max(k.theme_advanced_resizing_min_height||100,l);i=Math.min(k.theme_advanced_resizing_max_width||65535,i);l=Math.min
 (k.theme_advanced_resizing_max_height||65535,l);d.setStyle(m,"height","");d.setStyle(n,"height",l);if(k.theme_advanced_resize_horizontal){d.setStyle(m,"width","");d.setStyle(n,"width",i);if(i<m.clientWidth){d.setStyle(n,"width",m.clientWidth)}}},destroy:function(){var i=this.editor.id;b.clear(i+"_resize");b.clear(i+"_path_row");b.clear(i+"_external_close")},_simpleLayout:function(y,r,k,i){var x=this,u=x.editor,v=y.theme_advanced_toolbar_location,m=y.theme_advanced_statusbar_location,l,j,q,w;if(y.readonly){l=d.add(r,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"});return j}if(v=="top"){x._addToolbars(r,k)}if(v=="external"){l=w=d.create("div",{style:"position:relative"});l=d.add(l,"div",{id:u.id+"_external","class":"mceExternalToolbar"});d.add(l,"a",{id:u.id+"_external_close",href:"javascript:;","class":"mceExternalClose"});l=d.add(l,"table",{id:u.id+"_tblext",cellSpacing:0,cellPadding:0});q=d.add(l,"tbody");if(i.firstChild.className=="mceOldBoxModel"){i.firstChild.appen
 dChild(w)}else{i.insertBefore(w,i.firstChild)}x._addToolbars(q,k);u.onMouseUp.add(function(){var o=d.get(u.id+"_external");d.show(o);d.hide(g);var n=b.add(u.id+"_external_close","click",function(){d.hide(u.id+"_external");b.remove(u.id+"_external_close","click",n)});d.show(o);d.setStyle(o,"top",0-d.getRect(u.id+"_tblext").h-1);d.hide(o);d.show(o);o.style.filter="";g=u.id+"_external";o=null})}if(m=="top"){x._addStatusBar(r,k)}if(!y.theme_advanced_toolbar_container){l=d.add(r,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"})}if(v=="bottom"){x._addToolbars(r,k)}if(m=="bottom"){x._addStatusBar(r,k)}return j},_rowLayout:function(w,m,k){var v=this,p=v.editor,u,x,i=p.controlManager,l,j,r,q;u=w.theme_advanced_containers_default_class||"";x=w.theme_advanced_containers_default_align||"center";f(c(w.theme_advanced_containers||""),function(s,o){var n=w["theme_advanced_container_"+s]||"";switch(n.toLowerCase()){case"mceeditor":l=d.add(m,"tr");l=j=d.add(l,"td",{"class":"mceIframeCont
 ainer"});break;case"mceelementpath":v._addStatusBar(m,k);break;default:q=(w["theme_advanced_container_"+s+"_align"]||x).toLowerCase();q="mce"+v._ufirst(q);l=d.add(d.add(m,"tr"),"td",{"class":"mceToolbar "+(w["theme_advanced_container_"+s+"_class"]||u)+" "+q||x});r=i.createToolbar("toolbar"+o);v._addControls(n,r);d.setHTML(l,r.renderHTML());k.deltaHeight-=w.theme_advanced_row_height}});return j},_addControls:function(j,i){var k=this,l=k.settings,m,n=k.editor.controlManager;if(l.theme_advanced_disable&&!k._disabled){m={};f(c(l.theme_advanced_disable),function(o){m[o]=1});k._disabled=m}else{m=k._disabled}f(c(j),function(p){var o;if(m&&m[p]){return}if(p=="tablecontrols"){f(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(q){q=k.createControl(q,n);if(q){i.add(q)}});return}o=k.createControl(p,n);if(o){i.add(o)}})},_addToolbars:function(w,k){var z=this,p,m,r=z.editor,A
 =z.settings,y,j=r.controlManager,u,l,q=[],x;x=A.theme_advanced_toolbar_align.toLowerCase();x="mce"+z._ufirst(x);l=d.add(d.add(w,"tr"),"td",{"class":"mceToolbar "+x});if(!r.getParam("accessibility_focus")){q.push(d.createHTML("a",{href:"#",onfocus:"tinyMCE.get('"+r.id+"').focus();"},"<!-- IE -->"))}q.push(d.createHTML("a",{href:"#",accesskey:"q",title:r.getLang("advanced.toolbar_focus")},"<!-- IE -->"));for(p=1;(y=A["theme_advanced_buttons"+p]);p++){m=j.createToolbar("toolbar"+p,{"class":"mceToolbarRow"+p});if(A["theme_advanced_buttons"+p+"_add"]){y+=","+A["theme_advanced_buttons"+p+"_add"]}if(A["theme_advanced_buttons"+p+"_add_before"]){y=A["theme_advanced_buttons"+p+"_add_before"]+","+y}z._addControls(y,m);q.push(m.renderHTML());k.deltaHeight-=A.theme_advanced_row_height}q.push(d.createHTML("a",{href:"#",accesskey:"z",title:r.getLang("advanced.toolbar_focus"),onfocus:"tinyMCE.getInstanceById('"+r.id+"').focus();"},"<!-- IE -->"));d.setHTML(l,q.join(""))},_addStatusBar:funct
 ion(m,j){var k,v=this,p=v.editor,w=v.settings,i,q,u,l;k=d.add(m,"tr");k=l=d.add(k,"td",{"class":"mceStatusbar"});k=d.add(k,"div",{id:p.id+"_path_row"},w.theme_advanced_path?p.translate("advanced.path")+": ":" ");d.add(k,"a",{href:"#",accesskey:"x"});if(w.theme_advanced_resizing){d.add(l,"a",{id:p.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize"});if(w.theme_advanced_resizing_use_cookie){p.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+p.id+"_size"),r=d.get(p.id+"_tbl");if(!n){return}v.resizeTo(n.cw,n.ch)})}p.onPostRender.add(function(){b.add(p.id+"_resize","mousedown",function(D){var t,r,s,o,C,z,A,F,n,E,x;function y(G){n=A+(G.screenX-C);E=F+(G.screenY-z);v.resizeTo(n,E)}function B(G){b.remove(d.doc,"mousemove",t);b.remove(p.getDoc(),"mousemove",r);b.remove(d.doc,"mouseup",s);b.remove(p.getDoc(),"mouseup",o);if(w.theme_advanced_resizing_use_cookie){a.setHash("TinyMCE_"+p.id+"_size",{cw:n,ch:E})}}D.preventDefault();C=D.screenX;z=D.scree
 nY;x=d.get(v.editor.id+"_ifr");A=n=x.clientWidth;F=E=x.clientHeight;t=b.add(d.doc,"mousemove",y);r=b.add(p.getDoc(),"mousemove",y);s=b.add(d.doc,"mouseup",B);o=b.add(p.getDoc(),"mouseup",B)})})}j.deltaHeight-=21;k=m=null},_nodeChanged:function(r,z,l,x,j){var C=this,i,y=0,B,u,D=C.settings,A,k,w,m,q;e.each(C.stateControls,function(n){z.setActive(n,r.queryCommandState(C.controls[n][1]))});function o(p){var s,n=j.parents,t=p;if(typeof(p)=="string"){t=function(v){return v.nodeName==p}}for(s=0;s<n.length;s++){if(t(n[s])){return n[s]}}}z.setActive("visualaid",r.hasVisual);z.setDisabled("undo",!r.undoManager.hasUndo()&&!r.typing);z.setDisabled("redo",!r.undoManager.hasRedo());z.setDisabled("outdent",!r.queryCommandState("Outdent"));i=o("A");if(u=z.get("link")){if(!i||!i.name){u.setDisabled(!i&&x);u.setActive(!!i)}}if(u=z.get("unlink")){u.setDisabled(!i&&x);u.setActive(!!i&&!i.name)}if(u=z.get("anchor")){u.setActive(!!i&&i.name)}i=o("IMG");if(u=z.get("image")){u.setActive(!!i&&l.clas
 sName.indexOf("mceItem")==-1)}if(u=z.get("styleselect")){C._importClasses();m=[];f(u.items,function(n){m.push(n.value)});q=r.formatter.matchAll(m);u.select(q[0])}if(u=z.get("formatselect")){i=o(d.isBlock);if(i){u.select(i.nodeName.toLowerCase())}}o(function(p){if(p.nodeName==="SPAN"){if(!A&&p.className){A=p.className}if(!k&&p.style.fontSize){k=p.style.fontSize}if(!w&&p.style.fontFamily){w=p.style.fontFamily.replace(/[\"\']+/g,"").replace(/^([^,]+).*/,"$1").toLowerCase()}}return false});if(u=z.get("fontselect")){u.select(function(n){return n.replace(/^([^,]+).*/,"$1").toLowerCase()==w})}if(u=z.get("fontsizeselect")){if(D.theme_advanced_runtime_fontsize&&!k&&!A){k=r.dom.getStyle(l,"fontSize",true)}u.select(function(n){if(n.fontSize&&n.fontSize===k){return true}if(n["class"]&&n["class"]===A){return true}})}if(D.theme_advanced_path&&D.theme_advanced_statusbar_location){i=d.get(r.id+"_path")||d.add(r.id+"_path_row","span",{id:r.id+"_path"});d.setHTML(i,"");o(function(E){var p=E.n
 odeName.toLowerCase(),s,v,t="";if(E.nodeType!=1||E.nodeName==="BR"||(d.hasClass(E,"mceItemHidden")||d.hasClass(E,"mceItemRemoved"))){return}if(B=d.getAttrib(E,"mce_name")){p=B}if(e.isIE&&E.scopeName!=="HTML"){p=E.scopeName+":"+p}p=p.replace(/mce\:/g,"");switch(p){case"b":p="strong";break;case"i":p="em";break;case"img":if(B=d.getAttrib(E,"src")){t+="src: "+B+" "}break;case"a":if(B=d.getAttrib(E,"name")){t+="name: "+B+" ";p+="#"+B}if(B=d.getAttrib(E,"href")){t+="href: "+B+" "}break;case"font":if(B=d.getAttrib(E,"face")){t+="font: "+B+" "}if(B=d.getAttrib(E,"size")){t+="size: "+B+" "}if(B=d.getAttrib(E,"color")){t+="color: "+B+" "}break;case"span":if(B=d.getAttrib(E,"style")){t+="style: "+B+" "}break}if(B=d.getAttrib(E,"id")){t+="id: "+B+" "}if(B=E.className){B=B.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g,"");if(B){t+="class: "+B+" ";if(d.isBlock(E)||p=="img"||p=="span"){p+="."+B}}}p=p.replace(/(html:)/g,"");p={name:p,node:E,title:t};C.onResolveName.dispatch(C,p);t=p.title;p=p
 .name;v=d.create("a",{href:"javascript:;",onmousedown:"return false;",title:t,"class":"mcePath_"+(y++)},p);if(i.hasChildNodes()){i.insertBefore(d.doc.createTextNode(" \u00bb "),i.firstChild);i.insertBefore(v,i.firstChild)}else{i.appendChild(v)}},r.getBody())}},_sel:function(i){this.editor.execCommand("mceSelectNodeDepth",false,i)},_mceInsertAnchor:function(k,j){var i=this.editor;i.windowManager.open({url:this.url+"/anchor.htm",width:320+parseInt(i.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(i.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var i=this.editor;i.windowManager.open({url:this.url+"/charmap.htm",width:550+parseInt(i.getLang("advanced.charmap_delta_width",0)),height:250+parseInt(i.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var i=this.editor;i.windowManager.open({url:this.url+"/about.htm",width:480,height:380,inline:true},{theme_url:this.ur
 l})},_mceColorPicker:function(k,j){var i=this.editor;j=j||{};i.windowManager.open({url:this.url+"/color_picker.htm",width:375+parseInt(i.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(i.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:j.color,func:j.func,theme_url:this.url})},_mceCodeEditor:function(j,k){var i=this.editor;i.windowManager.open({url:this.url+"/source_editor.htm",width:parseInt(i.getParam("theme_advanced_source_editor_width",720)),height:parseInt(i.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(j,k){var i=this.editor;if(i.dom.getAttrib(i.selection.getNode(),"class").indexOf("mceItem")!=-1){return}i.windowManager.open({url:this.url+"/image.htm",width:355+parseInt(i.getLang("advanced.image_delta_width",0)),height:275+parseInt(i.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_m
 ceLink:function(j,k){var i=this.editor;i.windowManager.open({url:this.url+"/link.htm",width:310+parseInt(i.getLang("advanced.link_delta_width",0)),height:200+parseInt(i.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var i=this.editor;i.windowManager.confirm("advanced.newdocument",function(j){if(j){i.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var i=this;this._mceColorPicker(0,{color:i.fgColor,func:function(j){i.fgColor=j;i.editor.execCommand("ForeColor",false,j)}})},_mceBackColor:function(){var i=this;this._mceColorPicker(0,{color:i.bgColor,func:function(j){i.bgColor=j;i.editor.execCommand("HiliteColor",false,j)}})},_ufirst:function(i){return i.substring(0,1).toUpperCase()+i.substring(1)}});e.ThemeManager.add("advanced",e.themes.AdvancedTheme)}(tinymce));
\ No newline at end of file
+tinyMCE.importThemeLanguagePack('advanced');var TinyMCE_AdvancedTheme={_defColors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",_autoImportCSSClasses:true,_resizer:{},_buttons:[['bold','{$lang_bold_img}','lang_bold_desc','Bold'],['italic','{$lang_italic_img}','lang_italic_desc','Italic'],['underline','{$lang_underline_img}','lang_underline_desc','Underline'],['strikethrough','strikethrough.gif','lang_striketrough_desc','Strikethrough'],['justifyleft','justifyleft.gif','lang_justifyleft_desc','JustifyLeft'],['justifycenter','justifycenter.gif','lang_justifycenter_desc','JustifyCenter'],['justifyright','justifyright.gif','lang_justifyright_desc','JustifyRight'],['justifyfull','justifyfull.gif','lang_justifyfull_desc','JustifyFull'],['bullist','b
 ullist.gif','lang_bullist_desc','InsertUnorderedList'],['numlist','numlist.gif','lang_numlist_desc','InsertOrderedList'],['outdent','outdent.gif','lang_outdent_desc','Outdent'],['indent','indent.gif','lang_indent_desc','Indent'],['cut','cut.gif','lang_cut_desc','Cut'],['copy','copy.gif','lang_copy_desc','Copy'],['paste','paste.gif','lang_paste_desc','Paste'],['undo','undo.gif','lang_undo_desc','Undo'],['redo','redo.gif','lang_redo_desc','Redo'],['link','link.gif','lang_link_desc','mceLink',true],['unlink','unlink.gif','lang_unlink_desc','unlink'],['image','image.gif','lang_image_desc','mceImage',true],['cleanup','cleanup.gif','lang_cleanup_desc','mceCleanup'],['help','help.gif','lang_help_desc','mceHelp'],['code','code.gif','lang_theme_code_desc','mceCodeEditor'],['hr','hr.gif','lang_theme_hr_desc','inserthorizontalrule'],['removeformat','removeformat.gif','lang_theme_removeformat_desc','removeformat'],['sub','sub.gif','lang_theme_sub_desc','subscript'],['sup','sup.gif','lan
 g_theme_sup_desc','superscript'],['forecolor','forecolor.gif','lang_theme_forecolor_desc','forecolor',true],['forecolorpicker','forecolor.gif','lang_theme_forecolor_desc','forecolorpicker',true],['backcolor','backcolor.gif','lang_theme_backcolor_desc','HiliteColor',true],['backcolorpicker','backcolor.gif','lang_theme_backcolor_desc','backcolorpicker',true],['charmap','charmap.gif','lang_theme_charmap_desc','mceCharMap'],['visualaid','visualaid.gif','lang_theme_visualaid_desc','mceToggleVisualAid'],['anchor','anchor.gif','lang_theme_anchor_desc','mceInsertAnchor'],['newdocument','newdocument.gif','lang_newdocument_desc','mceNewDocument']],_buttonMap:'anchor,backcolor,bold,bullist,charmap,cleanup,code,copy,cut,forecolor,help,hr,image,indent,italic,justifycenter,justifyfull,justifyleft,justifyright,link,newdocument,numlist,outdent,paste,redo,removeformat,strikethrough,sub,sup,underline,undo,unlink,visualaid,advhr,ltr,rtl,emotions,flash,fullpage,fullscreen,iespell,insertdate,ins
 erttime,pastetext,pasteword,selectall,preview,print,save,replace,search,table,cell_props,delete_col,delete_row,col_after,col_before,row_after,row_before,merge_cells,row_props,split_cells,delete_table',getControlHTML:function(button_name){var i,x,but;for(i=0;i<TinyMCE_AdvancedTheme._buttons.length;i++){but=TinyMCE_AdvancedTheme._buttons[i];if(but[0]==button_name&&(button_name=="forecolor"||button_name=="backcolor"))return tinyMCE.getMenuButtonHTML(but[0],but[2],'{$themeurl}/images/'+but[1],but[3]+"Menu",but[3],(but.length>4?but[4]:false),(but.length>5?but[5]:null));if(but[0]==button_name)return tinyMCE.getButtonHTML(but[0],but[2],'{$themeurl}/images/'+but[1],but[3],(but.length>4?but[4]:false),(but.length>5?but[5]:null))}switch(button_name){case"formatselect":var html='<select id="{$editor_id}_formatSelect" name="{$editor_id}_formatSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FormatBlock\',false
 ,this.options[this.selectedIndex].value);" class="mceSelectList">';var formats=tinyMCE.getParam("theme_advanced_blockformats","p,address,pre,h1,h2,h3,h4,h5,h6",true).split(',');var lookup=[['p','{$lang_theme_paragraph}'],['address','{$lang_theme_address}'],['pre','{$lang_theme_pre}'],['h1','{$lang_theme_h1}'],['h2','{$lang_theme_h2}'],['h3','{$lang_theme_h3}'],['h4','{$lang_theme_h4}'],['h5','{$lang_theme_h5}'],['h6','{$lang_theme_h6}'],['div','{$lang_theme_div}'],['blockquote','{$lang_theme_blockquote}'],['code','{$lang_theme_code}'],['dt','{$lang_theme_dt}'],['dd','{$lang_theme_dd}'],['samp','{$lang_theme_samp}']];html+='<option value="">{$lang_theme_block}</option>';for(var i=0;i<formats.length;i++){for(var x=0;x<lookup.length;x++){if(formats[i]==lookup[x][0])html+='<option value="<'+lookup[x][0]+'>">'+lookup[x][1]+'</option>'}}html+='</select>';return html;case"styleselect":return'<select id="{$editor_id}_styleSelect" onmousedown="tinyMCE.themes.advanced._setupCSSC
 lasses(\'{$editor_id}\');" name="{$editor_id}_styleSelect" onfocus="tinyMCE.addSelectAccessibility(event,this,window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceSetCSSClass\',false,this.options[this.selectedIndex].value);" class="mceSelectList">{$style_select_options}</select>';case"fontselect":var fontHTML='<select id="{$editor_id}_fontNameSelect" name="{$editor_id}_fontNameSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FontName\',false,this.options[this.selectedIndex].value);" class="mceSelectList"><option value="">{$lang_theme_fontdefault}</option>';var iFonts='Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings';var nFonts='Andale Mono=andale mono,
 times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats';var fonts=tinyMCE.getParam("theme_advanced_fonts",nFonts).split(';');for(i=0;i<fonts.length;i++){if(fonts[i]!=''){var parts=fonts[i].split('=');fontHTML+='<option value="'+parts[1]+'">'+parts[0]+'</option>'}}fontHTML+='</select>';return fontHTML;case"fontsizeselect":return'<select id="{$editor_id}_fontSizeSelect" name="{$editor_id}_fontSizeSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FontSize\',false,this.options[this.selectedI
 ndex].value);" class="mceSelectList">'+'<option value="0">{$lang_theme_font_size}</option>'+'<option value="1">1 (8 pt)</option>'+'<option value="2">2 (10 pt)</option>'+'<option value="3">3 (12 pt)</option>'+'<option value="4">4 (14 pt)</option>'+'<option value="5">5 (18 pt)</option>'+'<option value="6">6 (24 pt)</option>'+'<option value="7">7 (36 pt)</option>'+'</select>';case"|":case"separator":return'<img src="{$themeurl}/images/separator.gif" width="2" height="20" class="mceSeparatorLine" alt="" />';case"spacer":return'<img src="{$themeurl}/images/separator.gif" width="2" height="15" border="0" class="mceSeparatorLine" style="vertical-align: middle" alt="" />';case"rowseparator":return'<br />'}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case'mceHelp':tinyMCE.openWindow({file:'about.htm',width:480,height:380},{tinymce_version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion,tinymce_releasedate:tinyMCE.releaseDate,inline:"yes
 "});return true;case"mceLink":var inst=tinyMCE.getInstanceById(editor_id);var doc=inst.getDoc();var selectedText="";if(tinyMCE.isMSIE){var rng=doc.selection.createRange();selectedText=rng.text}else selectedText=inst.getSel().toString();if(!tinyMCE.linkElement){if((tinyMCE.selectedElement.nodeName.toLowerCase()!="img")&&(selectedText.length<=0))return true}var href="",target="",title="",onclick="",action="insert",style_class="";if(tinyMCE.selectedElement.nodeName.toLowerCase()=="a")tinyMCE.linkElement=tinyMCE.selectedElement;if(tinyMCE.linkElement!=null&&tinyMCE.getAttrib(tinyMCE.linkElement,'href')=="")tinyMCE.linkElement=null;if(tinyMCE.linkElement){href=tinyMCE.getAttrib(tinyMCE.linkElement,'href');target=tinyMCE.getAttrib(tinyMCE.linkElement,'target');title=tinyMCE.getAttrib(tinyMCE.linkElement,'title');onclick=tinyMCE.getAttrib(tinyMCE.linkElement,'onclick');style_class=tinyMCE.getAttrib(tinyMCE.linkElement,'class');if(onclick=="")onclick=tinyMCE.getAttrib(tinyMCE.linkEl
 ement,'onclick');onclick=tinyMCE.cleanupEventStr(onclick);href=eval(tinyMCE.settings['urlconverter_callback']+"(href, tinyMCE.linkElement, true);");mceRealHref=tinyMCE.getAttrib(tinyMCE.linkElement,'mce_href');if(mceRealHref!=""){href=mceRealHref;if(tinyMCE.getParam('convert_urls'))href=eval(tinyMCE.settings['urlconverter_callback']+"(href, tinyMCE.linkElement, true);")}action="update"}var template=new Array();template['file']='link.htm';template['width']=310;template['height']=200;template['width']+=tinyMCE.getLang('lang_insert_link_delta_width',0);template['height']+=tinyMCE.getLang('lang_insert_link_delta_height',0);if(inst.settings['insertlink_callback']){var returnVal=eval(inst.settings['insertlink_callback']+"(href, target, title, onclick, action, style_class);");if(returnVal&&returnVal['href'])TinyMCE_AdvancedTheme._insertLink(returnVal['href'],returnVal['target'],returnVal['title'],returnVal['onclick'],returnVal['style_class'])}else{tinyMCE.openWindow(template,{href:
 href,target:target,title:title,onclick:onclick,action:action,className:style_class,inline:"yes"})}return true;case"mceImage":var src="",alt="",border="",hspace="",vspace="",width="",height="",align="";var title="",onmouseover="",onmouseout="",action="insert";var img=tinyMCE.imgElement;var inst=tinyMCE.getInstanceById(editor_id);if(tinyMCE.selectedElement!=null&&tinyMCE.selectedElement.nodeName.toLowerCase()=="img"){img=tinyMCE.selectedElement;tinyMCE.imgElement=img}if(img){if(tinyMCE.getAttrib(img,'name').indexOf('mce_')==0)return true;src=tinyMCE.getAttrib(img,'src');alt=tinyMCE.getAttrib(img,'alt');if(alt=="")alt=tinyMCE.getAttrib(img,'title');if(tinyMCE.isGecko){var w=img.style.width;if(w!=null&&w!="")img.setAttribute("width",w);var h=img.style.height;if(h!=null&&h!="")img.setAttribute("height",h)}border=tinyMCE.getAttrib(img,'border');hspace=tinyMCE.getAttrib(img,'hspace');vspace=tinyMCE.getAttrib(img,'vspace');width=tinyMCE.getAttrib(img,'width');height=tinyMCE.getAttri
 b(img,'height');align=tinyMCE.getAttrib(img,'align');onmouseover=tinyMCE.getAttrib(img,'onmouseover');onmouseout=tinyMCE.getAttrib(img,'onmouseout');title=tinyMCE.getAttrib(img,'title');if(tinyMCE.isMSIE){width=img.attributes['width'].specified?width:"";height=img.attributes['height'].specified?height:""}src=eval(tinyMCE.settings['urlconverter_callback']+"(src, img, true);");mceRealSrc=tinyMCE.getAttrib(img,'mce_src');if(mceRealSrc!=""){src=mceRealSrc;if(tinyMCE.getParam('convert_urls'))src=eval(tinyMCE.settings['urlconverter_callback']+"(src, img, true);")}action="update"}var template=new Array();template['file']='image.htm?src={$src}';template['width']=355;template['height']=265+(tinyMCE.isMSIE?25:0);template['width']+=tinyMCE.getLang('lang_insert_image_delta_width',0);template['height']+=tinyMCE.getLang('lang_insert_image_delta_height',0);if(inst.settings['insertimage_callback']){var returnVal=eval(inst.settings['insertimage_callback']+"(src, alt, border, hspace, vspace, 
 width, height, align, title, onmouseover, onmouseout, action);");if(returnVal&&returnVal['src'])TinyMCE_AdvancedTheme._insertImage(returnVal['src'],returnVal['alt'],returnVal['border'],returnVal['hspace'],returnVal['vspace'],returnVal['width'],returnVal['height'],returnVal['align'],returnVal['title'],returnVal['onmouseover'],returnVal['onmouseout'])}else tinyMCE.openWindow(template,{src:src,alt:alt,border:border,hspace:hspace,vspace:vspace,width:width,height:height,align:align,title:title,onmouseover:onmouseover,onmouseout:onmouseout,action:action,inline:"yes"});return true;case"forecolor":var fcp=new TinyMCE_Layer(editor_id+'_fcPreview',false),p,img,elm;TinyMCE_AdvancedTheme._hideMenus(editor_id);if(!fcp.exists()){fcp.create('div','mceColorPreview',document.getElementById(editor_id+'_toolbar'));elm=fcp.getElement();elm._editor_id=editor_id;elm._command="forecolor";elm._switchId=editor_id+"_forecolor";tinyMCE.addEvent(elm,'click',TinyMCE_AdvancedTheme._handleMenuEvent);tinyM
 CE.addEvent(elm,'mouseover',TinyMCE_AdvancedTheme._handleMenuEvent);tinyMCE.addEvent(elm,'mouseout',TinyMCE_AdvancedTheme._handleMenuEvent)}img=tinyMCE.selectNodes(document.getElementById(editor_id+"_forecolor"),function(n){return n.nodeName=="IMG"})[0];p=tinyMCE.getAbsPosition(img,document.getElementById(editor_id+'_toolbar'));fcp.moveTo(p.absLeft,p.absTop);fcp.getElement().style.backgroundColor=value!=null?value:tinyMCE.getInstanceById(editor_id).foreColor;fcp.show();return false;case"forecolorpicker":this._pickColor(editor_id,'forecolor');return true;case"forecolorMenu":TinyMCE_AdvancedTheme._hideMenus(editor_id);var ml=new TinyMCE_Layer(editor_id+'_fcMenu');if(!ml.exists())ml.create('div','mceMenu',document.body,TinyMCE_AdvancedTheme._getColorHTML(editor_id,'theme_advanced_text_colors','forecolor'));tinyMCE.switchClass(editor_id+'_forecolor','mceMenuButtonFocus');ml.moveRelativeTo(document.getElementById(editor_id+"_forecolor"),'bl');ml.moveBy(tinyMCE.isMSIE&&!tinyMCE.is
 Opera?-1:1,-1);if(tinyMCE.isOpera)ml.moveBy(0,-2);ml.show();return true;case"HiliteColor":var bcp=new TinyMCE_Layer(editor_id+'_bcPreview',false),p,img;TinyMCE_AdvancedTheme._hideMenus(editor_id);if(!bcp.exists()){bcp.create('div','mceColorPreview',document.getElementById(editor_id+'_toolbar'));elm=bcp.getElement();elm._editor_id=editor_id;elm._command="HiliteColor";elm._switchId=editor_id+"_backcolor";tinyMCE.addEvent(elm,'click',TinyMCE_AdvancedTheme._handleMenuEvent);tinyMCE.addEvent(elm,'mouseover',TinyMCE_AdvancedTheme._handleMenuEvent);tinyMCE.addEvent(elm,'mouseout',TinyMCE_AdvancedTheme._handleMenuEvent)}img=tinyMCE.selectNodes(document.getElementById(editor_id+"_backcolor"),function(n){return n.nodeName=="IMG"})[0];p=tinyMCE.getAbsPosition(img,document.getElementById(editor_id+'_toolbar'));bcp.moveTo(p.absLeft,p.absTop);bcp.getElement().style.backgroundColor=value!=null?value:tinyMCE.getInstanceById(editor_id).backColor;bcp.show();return false;case"HiliteColorMenu":
 TinyMCE_AdvancedTheme._hideMenus(editor_id);var ml=new TinyMCE_Layer(editor_id+'_bcMenu');if(!ml.exists())ml.create('div','mceMenu',document.body,TinyMCE_AdvancedTheme._getColorHTML(editor_id,'theme_advanced_background_colors','HiliteColor'));tinyMCE.switchClass(editor_id+'_backcolor','mceMenuButtonFocus');ml.moveRelativeTo(document.getElementById(editor_id+"_backcolor"),'bl');ml.moveBy(tinyMCE.isMSIE&&!tinyMCE.isOpera?-1:1,-1);if(tinyMCE.isOpera)ml.moveBy(0,-2);ml.show();return true;case"backcolorpicker":this._pickColor(editor_id,'HiliteColor');return true;case"mceColorPicker":if(user_interface){var template=[];if(!value['callback']&&!value['color'])value['color']=value['document'].getElementById(value['element_id']).value;template['file']='color_picker.htm';template['width']=380;template['height']=250;template['close_previous']="no";template['width']+=tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_c
 olorpicker_delta_height',0);if(typeof(value['store_selection'])=="undefined")value['store_selection']=true;tinyMCE.lastColorPickerValue=value;tinyMCE.openWindow(template,{editor_id:editor_id,mce_store_selection:value['store_selection'],inline:"yes",command:"mceColorPicker",input_color:value['color']})}else{var savedVal=tinyMCE.lastColorPickerValue,elm;if(savedVal['callback']){savedVal['callback'](value);return true}elm=savedVal['document'].getElementById(savedVal['element_id']);elm.value=value;if(elm.onchange!=null&&elm.onchange!='')eval('elm.onchange();')}return true;case"mceCodeEditor":var template=new Array();template['file']='source_editor.htm';template['width']=parseInt(tinyMCE.getParam("theme_advanced_source_editor_width",720));template['height']=parseInt(tinyMCE.getParam("theme_advanced_source_editor_height",580));tinyMCE.openWindow(template,{editor_id:editor_id,resizable:"yes",scrollbars:"no",inline:"yes"});return true;case"mceCharMap":var template=new Array();templa
 te['file']='charmap.htm';template['width']=550+(tinyMCE.isOpera?40:0);template['height']=250;template['width']+=tinyMCE.getLang('lang_theme_advanced_charmap_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_charmap_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true;case"mceInsertAnchor":var template=new Array();template['file']='anchor.htm';template['width']=320;template['height']=90+(tinyMCE.isNS7?30:0);template['width']+=tinyMCE.getLang('lang_theme_advanced_anchor_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_anchor_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true;case"mceNewDocument":if(confirm(tinyMCE.entityDecode(tinyMCE.getLang('lang_newdocument'))))tinyMCE.execInstanceCommand(editor_id,'mceSetContent',false,' ');return true}return false},getEditorTemplate:function(settings,editorId){function removeFromArray(in_array,remove_array){var 
 outArray=new Array(),skip;for(var i=0;i<in_array.length;i++){skip=false;for(var j=0;j<remove_array.length;j++){if(in_array[i]==remove_array[j]){skip=true}}if(!skip){outArray[outArray.length]=in_array[i]}}return outArray}function addToArray(in_array,add_array){for(var i=0;i<add_array.length;i++){in_array[in_array.length]=add_array[i]}return in_array}var template=new Array();var deltaHeight=0;var resizing=tinyMCE.getParam("theme_advanced_resizing",false);var path=tinyMCE.getParam("theme_advanced_path",true);var statusbarHTML='<div id="{$editor_id}_path" class="mceStatusbarPathText" style="display: '+(path?"block":"none")+'"> </div><div id="{$editor_id}_resize" class="mceStatusbarResize" style="display: '+(resizing?"block":"none")+'" onmousedown="tinyMCE.themes.advanced._setResizing(event,\'{$editor_id}\',true);"></div><br style="clear: both" />';var layoutManager=tinyMCE.getParam("theme_advanced_layout_manager","SimpleLayout");var styleSelectHTML='<option value="">{$lang_
 theme_style_select}</option>';if(settings['theme_advanced_styles']){var stylesAr=settings['theme_advanced_styles'].split(';');for(var i=0;i<stylesAr.length;i++){var key,value;key=stylesAr[i].split('=')[0];value=stylesAr[i].split('=')[1];styleSelectHTML+='<option value="'+value+'">'+key+'</option>'}TinyMCE_AdvancedTheme._autoImportCSSClasses=false}switch(layoutManager){case"SimpleLayout":var toolbarHTML="";var toolbarLocation=tinyMCE.getParam("theme_advanced_toolbar_location","bottom");var toolbarAlign=tinyMCE.getParam("theme_advanced_toolbar_align","center");var pathLocation=tinyMCE.getParam("theme_advanced_path_location","none");var statusbarLocation=tinyMCE.getParam("theme_advanced_statusbar_location",pathLocation);var defVals={theme_advanced_buttons1:"bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,separator,outdent,indent,separator,undo,redo,separ
 ator,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,separator,sub,sup,separator,charmap"};toolbarHTML+='<a href="#" accesskey="q" title="'+tinyMCE.getLang("lang_toolbar_focus")+'"';if(!tinyMCE.getParam("accessibility_focus"))toolbarHTML+=' onfocus="tinyMCE.getInstanceById(\''+editorId+'\').getWin().focus();"';toolbarHTML+='></a>';for(var i=1;i<100;i++){var def=defVals["theme_advanced_buttons"+i];var buttons=tinyMCE.getParam("theme_advanced_buttons"+i,def==null?'':def,true,',');if(buttons.length==0)break;buttons=removeFromArray(buttons,tinyMCE.getParam("theme_advanced_disable","",true,','));buttons=addToArray(buttons,tinyMCE.getParam("theme_advanced_buttons"+i+"_add","",true,','));buttons=addToArray(tinyMCE.getParam("theme_advanced_buttons"+i+"_add_before","",true,','),buttons);for(var b=0;b<buttons.length;b++)toolbarHTML+=tinyMCE.getControlHTML(buttons[b]);if(buttons.length>0){toolbarHTML+="<br />";deltaHeight-=23}}toolbarHTML+
 ='<a href="#" accesskey="z" onfocus="tinyMCE.getInstanceById(\''+editorId+'\').getWin().focus();"></a>';template['html']='<table class="mceEditor" border="0" cellpadding="0" cellspacing="0" width="{$width}" height="{$height}" style="width:{$width_style};height:{$height_style}"><tbody>';if(toolbarLocation=="top")template['html']+='<tr><td dir="ltr" class="mceToolbarTop" align="'+toolbarAlign+'" height="1" nowrap="nowrap"><span id="'+editorId+'_toolbar" class="mceToolbarContainer">'+toolbarHTML+'</span></td></tr>';if(statusbarLocation=="top"){template['html']+='<tr><td class="mceStatusbarTop" height="1">'+statusbarHTML+'</td></tr>';deltaHeight-=23}template['html']+='<tr><td align="center"><span id="{$editor_id}"></span></td></tr>';if(toolbarLocation=="bottom")template['html']+='<tr><td dir="ltr" class="mceToolbarBottom" align="'+toolbarAlign+'" height="1"><span id="'+editorId+'_toolbar" class="mceToolbarContainer">'+toolbarHTML+'</span></td></tr>';if(toolbarLocation=="external
 "){var bod=document.body;var elm=document.createElement("div");toolbarHTML=tinyMCE.replaceVar(toolbarHTML,'style_select_options',styleSelectHTML);toolbarHTML=tinyMCE.applyTemplate(toolbarHTML,{editor_id:editorId});elm.className="mceToolbarExternal";elm.id=editorId+"_toolbar";elm.innerHTML='<table width="100%" border="0" align="center"><tr><td align="center">'+toolbarHTML+'</td></tr></table>';bod.appendChild(elm);deltaHeight=0;tinyMCE.getInstanceById(editorId).toolbarElement=elm;}else{tinyMCE.getInstanceById(editorId).toolbarElement=null}if(statusbarLocation=="bottom"){template['html']+='<tr><td class="mceStatusbarBottom" height="1">'+statusbarHTML+'</td></tr>';deltaHeight-=23}template['html']+='</tbody></table>';break;case"RowLayout":template['html']='<table class="mceEditor" border="0" cellpadding="0" cellspacing="0" width="{$width}" height="{$height}" style="width:{$width}px;height:{$height}px"><tbody>';var containers=tinyMCE.getParam("theme_advanced_containers","",true,",
 ");var defaultContainerCSS=tinyMCE.getParam("theme_advanced_containers_default_class","container");var defaultContainerAlign=tinyMCE.getParam("theme_advanced_containers_default_align","center");for(var i=0;i<containers.length;i++){if(containers[i]=="mceEditor")template['html']+='<tr><td align="center" class="mceEditor_border"><span id="{$editor_id}"></span></td></tr>';else if(containers[i]=="mceElementpath"||containers[i]=="mceStatusbar"){var pathClass="mceStatusbar";if(i==containers.length-1){pathClass="mceStatusbarBottom"}else if(i==0){pathClass="mceStatusbar"}else{deltaHeight-=2}template['html']+='<tr><td class="'+pathClass+'" height="1">'+statusbarHTML+'</td></tr>';deltaHeight-=22}else{var curContainer=tinyMCE.getParam("theme_advanced_container_"+containers[i],"",true,',');var curContainerHTML="";var curAlign=tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_align",defaultContainerAlign);var curCSS=tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_c
 lass",defaultContainerCSS);curContainer=removeFromArray(curContainer,tinyMCE.getParam("theme_advanced_disable","",true,','));for(var j=0;j<curContainer.length;j++)curContainerHTML+=tinyMCE.getControlHTML(curContainer[j]);if(curContainer.length>0){curContainerHTML+="<br />";deltaHeight-=23}template['html']+='<tr><td class="'+curCSS+'" align="'+curAlign+'" height="1">'+curContainerHTML+'</td></tr>'}}template['html']+='</tbody></table>';break;case"CustomLayout":var customLayout=tinyMCE.getParam("theme_advanced_custom_layout","");if(customLayout!=""&&eval("typeof("+customLayout+")")!="undefined"){template=eval(customLayout+"(template);")}break}if(resizing)template['html']+='<span id="{$editor_id}_resize_box" class="mceResizeBox"></span>';template['html']=tinyMCE.replaceVar(template['html'],'style_select_options',styleSelectHTML);if(!template['delta_width'])template['delta_width']=0;if(!template['delta_height'])template['delta_height']=deltaHeight;return template},initInstance:fu
 nction(inst){if(tinyMCE.getParam("theme_advanced_resizing",false)){if(tinyMCE.getParam("theme_advanced_resizing_use_cookie",true)){var w=TinyMCE_AdvancedTheme._getCookie("TinyMCE_"+inst.editorId+"_width");var h=TinyMCE_AdvancedTheme._getCookie("TinyMCE_"+inst.editorId+"_height");TinyMCE_AdvancedTheme._resizeTo(inst,w,h,tinyMCE.getParam("theme_advanced_resize_horizontal",true))}}inst.addShortcut('ctrl','k','lang_link_desc','mceLink')},removeInstance:function(inst){new TinyMCE_Layer(inst.editorId+'_fcMenu').remove();new TinyMCE_Layer(inst.editorId+'_bcMenu').remove()},hideInstance:function(inst){TinyMCE_AdvancedTheme._hideMenus(inst.editorId)},_handleMenuEvent:function(e){var te=tinyMCE.isMSIE?window.event.srcElement:e.target;tinyMCE._menuButtonEvent(e.type=="mouseover"?"over":"out",document.getElementById(te._switchId));if(e.type=="click")tinyMCE.execInstanceCommand(te._editor_id,te._command)},_hideMenus:function(id){var fcml=new TinyMCE_Layer(id+'_fcMenu'),bcml=new TinyMCE_L
 ayer(id+'_bcMenu');if(fcml.exists()&&fcml.isVisible()){tinyMCE.switchClass(id+'_forecolor','mceMenuButton');fcml.hide()}if(bcml.exists()&&bcml.isVisible()){tinyMCE.switchClass(id+'_backcolor','mceMenuButton');bcml.hide()}},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection,setup_content){var alignNode,breakOut,classNode;function selectByValue(select_elm,value,first_index){first_index=typeof(first_index)=="undefined"?false:true;if(select_elm){for(var i=0;i<select_elm.options.length;i++){var ov=""+select_elm.options[i].value;if(first_index&&ov.toLowerCase().indexOf(value.toLowerCase())==0){select_elm.selectedIndex=i;return true}if(ov==value){select_elm.selectedIndex=i;return true}}}return false};if(node==null)return;var pathElm=document.getElementById(editor_id+"_path");var inst=tinyMCE.getInstanceById(editor_id);var doc=inst.getDoc();TinyMCE_AdvancedTheme._hideMenus(editor_id);if(pathElm){var parentNode=node;var path=new Array();while(par
 entNode!=null){if(parentNode.nodeName.toUpperCase()=="BODY"){break}if(parentNode.nodeType==1&&tinyMCE.getAttrib(parentNode,"class").indexOf('mceItemHidden')==-1){path[path.length]=parentNode}parentNode=parentNode.parentNode}var html="";for(var i=path.length-1;i>=0;i--){var nodeName=path[i].nodeName.toLowerCase();var nodeData="";if(nodeName.indexOf("html:")==0)nodeName=nodeName.substring(5);if(nodeName=="b"){nodeName="strong"}if(nodeName=="i"){nodeName="em"}if(nodeName=="span"){var cn=tinyMCE.getAttrib(path[i],"class");if(cn!=""&&cn.indexOf('mceItem')==-1)nodeData+="class: "+cn+" ";var st=tinyMCE.getAttrib(path[i],"style");if(st!=""){st=tinyMCE.serializeStyle(tinyMCE.parseStyle(st));nodeData+="style: "+tinyMCE.xmlEncode(st)+" "}}if(nodeName=="font"){if(tinyMCE.getParam("convert_fonts_to_spans"))nodeName="span";var face=tinyMCE.getAttrib(path[i],"face");if(face!="")nodeData+="font: "+tinyMCE.xmlEncode(face)+" ";var size=tinyMCE.getAttrib(path[i],"size");if(size!="")nodeData+="
 size: "+tinyMCE.xmlEncode(size)+" ";var color=tinyMCE.getAttrib(path[i],"color");if(color!="")nodeData+="color: "+tinyMCE.xmlEncode(color)+" "}if(tinyMCE.getAttrib(path[i],'id')!=""){nodeData+="id: "+path[i].getAttribute('id')+" "}var className=tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i],"class"),false);if(className!=""&&className.indexOf('mceItem')==-1)nodeData+="class: "+className+" ";if(tinyMCE.getAttrib(path[i],'src')!=""){var src=tinyMCE.getAttrib(path[i],"mce_src");if(src=="")src=tinyMCE.getAttrib(path[i],"src");nodeData+="src: "+tinyMCE.xmlEncode(src)+" "}if(path[i].nodeName=='A'&&tinyMCE.getAttrib(path[i],'href')!=""){var href=tinyMCE.getAttrib(path[i],"mce_href");if(href=="")href=tinyMCE.getAttrib(path[i],"href");nodeData+="href: "+tinyMCE.xmlEncode(href)+" "}className=tinyMCE.getAttrib(path[i],"class");if((nodeName=="img"||nodeName=="span")&&className.indexOf('mceItem')!=-1){nodeName=className.replace(/mceItem([a-z]+)/gi,'$1').toLowerCase();nodeData=path[i]
 .getAttribute('title')}if(nodeName=="a"&&(anchor=tinyMCE.getAttrib(path[i],"name"))!=""){nodeName="a";nodeName+="#"+tinyMCE.xmlEncode(anchor);nodeData=""}if(tinyMCE.getAttrib(path[i],'name').indexOf("mce_")!=0){var className=tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i],"class"),false);if(className!=""&&className.indexOf('mceItem')==-1){nodeName+="."+className}}var cmd='tinyMCE.execInstanceCommand(\''+editor_id+'\',\'mceSelectNodeDepth\',false,\''+i+'\');';html+='<a title="'+nodeData+'" href="javascript:'+cmd+'" onclick="'+cmd+'return false;" onmousedown="return false;" target="_self" class="mcePathItem">'+nodeName+'</a>';if(i>0){html+=" » "}}pathElm.innerHTML='<a href="#" accesskey="x"></a>'+tinyMCE.getLang('lang_theme_path')+": "+html+' '}tinyMCE.switchClass(editor_id+'_justifyleft','mceButtonNormal');tinyMCE.switchClass(editor_id+'_justifyright','mceButtonNormal');tinyMCE.switchClass(editor_id+'_justifycenter','mceButtonNormal');tinyMCE.switchClass(editor
 _id+'_justifyfull','mceButtonNormal');tinyMCE.switchClass(editor_id+'_bold','mceButtonNormal');tinyMCE.switchClass(editor_id+'_italic','mceButtonNormal');tinyMCE.switchClass(editor_id+'_underline','mceButtonNormal');tinyMCE.switchClass(editor_id+'_strikethrough','mceButtonNormal');tinyMCE.switchClass(editor_id+'_bullist','mceButtonNormal');tinyMCE.switchClass(editor_id+'_numlist','mceButtonNormal');tinyMCE.switchClass(editor_id+'_sub','mceButtonNormal');tinyMCE.switchClass(editor_id+'_sup','mceButtonNormal');tinyMCE.switchClass(editor_id+'_anchor','mceButtonNormal');tinyMCE.switchClass(editor_id+'_link','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_unlink','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_outdent','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_image','mceButtonNormal');tinyMCE.switchClass(editor_id+'_hr','mceButtonNormal');if(node.nodeName=="A"&&tinyMCE.getAttrib(node,"class").indexOf('mceItemAnchor')!=-1)tinyMCE.switchClass(editor_id+'_ancho
 r','mceButtonSelected');var anchorLink=tinyMCE.getParentElement(node,"a","href");if(anchorLink||any_selection){tinyMCE.switchClass(editor_id+'_link',anchorLink?'mceButtonSelected':'mceButtonNormal');tinyMCE.switchClass(editor_id+'_unlink',anchorLink?'mceButtonSelected':'mceButtonNormal')}tinyMCE.switchClass(editor_id+'_visualaid',visual_aid?'mceButtonSelected':'mceButtonNormal');if(undo_levels!=-1){tinyMCE.switchClass(editor_id+'_undo','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_redo','mceButtonDisabled')}if(tinyMCE.getParentElement(node,"li,blockquote"))tinyMCE.switchClass(editor_id+'_outdent','mceButtonNormal');if(undo_index!=-1&&(undo_index<undo_levels-1&&undo_levels>0))tinyMCE.switchClass(editor_id+'_redo','mceButtonNormal');if(undo_index!=-1&&(undo_index>0&&undo_levels>0))tinyMCE.switchClass(editor_id+'_undo','mceButtonNormal');var selectElm=document.getElementById(editor_id+"_styleSelect");if(selectElm){TinyMCE_AdvancedTheme._setupCSSClasses(editor_id);classNo
 de=node;breakOut=false;var index=0;do{if(classNode&&classNode.className){for(var i=0;i<selectElm.options.length;i++){if(selectElm.options[i].value==classNode.className){index=i;breakOut=true;break}}}}while(!breakOut&&classNode!=null&&(classNode=classNode.parentNode)!=null);selectElm.selectedIndex=index}var selectElm=document.getElementById(editor_id+"_formatSelect");if(selectElm){var elm=tinyMCE.getParentElement(node,"p,div,h1,h2,h3,h4,h5,h6,pre,address");if(elm)selectByValue(selectElm,"<"+elm.nodeName.toLowerCase()+">");else selectByValue(selectElm,"")}var selectElm=document.getElementById(editor_id+"_fontNameSelect");if(selectElm){if(!tinyMCE.isSafari&&!(tinyMCE.isMSIE&&!tinyMCE.isOpera)){var face=inst.queryCommandValue('FontName');face=face==null||face==""?"":face;selectByValue(selectElm,face,face!="")}else{var elm=tinyMCE.getParentElement(node,"font","face");if(elm){var family=tinyMCE.getAttrib(elm,"face");if(family=='')family=''+elm.style.fontFamily;if(!selectByValue(se
 lectElm,family,family!=""))selectByValue(selectElm,"")}else selectByValue(selectElm,"")}}var selectElm=document.getElementById(editor_id+"_fontSizeSelect");if(selectElm){if(!tinyMCE.isSafari&&!tinyMCE.isOpera){var size=inst.queryCommandValue('FontSize');selectByValue(selectElm,size==null||size==""?"0":size)}else{var elm=tinyMCE.getParentElement(node,"font","size");if(elm){var size=tinyMCE.getAttrib(elm,"size");if(size==''){var sizes=new Array('','8px','10px','12px','14px','18px','24px','36px');size=''+elm.style.fontSize;for(var i=0;i<sizes.length;i++){if((''+sizes[i])==size){size=i;break}}}if(!selectByValue(selectElm,size))selectByValue(selectElm,"")}else selectByValue(selectElm,"0")}}alignNode=node;breakOut=false;do{if(!alignNode.getAttribute||!alignNode.getAttribute('align'))continue;switch(alignNode.getAttribute('align').toLowerCase()){case"left":tinyMCE.switchClass(editor_id+'_justifyleft','mceButtonSelected');breakOut=true;break;case"right":tinyMCE.switchClass(editor_id
 +'_justifyright','mceButtonSelected');breakOut=true;break;case"middle":case"center":tinyMCE.switchClass(editor_id+'_justifycenter','mceButtonSelected');breakOut=true;break;case"justify":tinyMCE.switchClass(editor_id+'_justifyfull','mceButtonSelected');breakOut=true;break}}while(!breakOut&&(alignNode=alignNode.parentNode)!=null);var div=tinyMCE.getParentElement(node,"div");if(div&&div.style.textAlign=="center")tinyMCE.switchClass(editor_id+'_justifycenter','mceButtonSelected');if(!setup_content){var ar=new Array("Bold","_bold","Italic","_italic","Strikethrough","_strikethrough","superscript","_sup","subscript","_sub");for(var i=0;i<ar.length;i+=2){if(inst.queryCommandState(ar[i]))tinyMCE.switchClass(editor_id+ar[i+1],'mceButtonSelected')}if(inst.queryCommandState("Underline")&&(node.parentNode==null||node.parentNode.nodeName!="A"))tinyMCE.switchClass(editor_id+'_underline','mceButtonSelected')}do{switch(node.nodeName){case"UL":tinyMCE.switchClass(editor_id+'_bullist','mceButt
 onSelected');break;case"OL":tinyMCE.switchClass(editor_id+'_numlist','mceButtonSelected');break;case"HR":tinyMCE.switchClass(editor_id+'_hr','mceButtonSelected');break;case"IMG":if(tinyMCE.getAttrib(node,'name').indexOf('mce_')!=0&&tinyMCE.getAttrib(node,'class').indexOf('mceItem')==-1){tinyMCE.switchClass(editor_id+'_image','mceButtonSelected')}break}}while((node=node.parentNode)!=null)},_setupCSSClasses:function(editor_id){var i,selectElm;if(!TinyMCE_AdvancedTheme._autoImportCSSClasses)return;selectElm=document.getElementById(editor_id+'_styleSelect');if(selectElm&&selectElm.getAttribute('cssImported')!='true'){var csses=tinyMCE.getCSSClasses(editor_id);if(csses&&selectElm){for(i=0;i<csses.length;i++)selectElm.options[selectElm.options.length]=new Option(csses[i],csses[i])}if(csses!=null&&csses.length>0)selectElm.setAttribute('cssImported','true')}},_setCookie:function(name,value,expires,path,domain,secure){var curCookie=name+"="+escape(value)+((expires)?"; expires="+expir
 es.toGMTString():"")+((path)?"; path="+escape(path):"")+((domain)?"; domain="+domain:"")+((secure)?"; secure":"");document.cookie=curCookie},_getCookie:function(name){var dc=document.cookie;var prefix=name+"=";var begin=dc.indexOf("; "+prefix);if(begin==-1){begin=dc.indexOf(prefix);if(begin!=0)return null}else begin+=2;var end=document.cookie.indexOf(";",begin);if(end==-1)end=dc.length;return unescape(dc.substring(begin+prefix.length,end))},_resizeTo:function(inst,w,h,set_w){var editorContainer=document.getElementById(inst.editorId+'_parent');var tableElm=editorContainer.firstChild;var iframe=inst.iframeElement;if(w==null||w=="null"){set_w=false;w=0}if(h==null||h=="null")return;w=parseInt(w);h=parseInt(h);if(tinyMCE.isGecko){w+=2;h+=2}var dx=w-tableElm.clientWidth;var dy=h-tableElm.clientHeight;w=w<1?30:w;h=h<1?30:h;if(set_w)tableElm.style.width=w+"px";tableElm.style.height=h+"px";iw=iframe.clientWidth+dx;ih=iframe.clientHeight+dy;iw=iw<1?30:iw;ih=ih<1?30:ih;if(tinyMCE.isGec
 ko){iw-=2;ih-=2}if(set_w)iframe.style.width=iw+"px";iframe.style.height=ih+"px";if(set_w){var tableBodyElm=tableElm.firstChild;var minIframeWidth=tableBodyElm.scrollWidth;if(inst.iframeElement.clientWidth<minIframeWidth){dx=minIframeWidth-inst.iframeElement.clientWidth;inst.iframeElement.style.width=(iw+dx)+"px"}}inst.useCSS=false},_resizeEventHandler:function(e){var resizer=TinyMCE_AdvancedTheme._resizer;if(!resizer.resizing)return;e=typeof(e)=="undefined"?window.event:e;var dx=e.screenX-resizer.downX;var dy=e.screenY-resizer.downY;var resizeBox=resizer.resizeBox;var editorId=resizer.editorId;switch(e.type){case"mousemove":var w,h;w=resizer.width+dx;h=resizer.height+dy;w=w<1?1:w;h=h<1?1:h;if(resizer.horizontal)resizeBox.style.width=w+"px";resizeBox.style.height=h+"px";break;case"mouseup":TinyMCE_AdvancedTheme._setResizing(e,editorId,false);TinyMCE_AdvancedTheme._resizeTo(tinyMCE.getInstanceById(editorId),resizer.width+dx,resizer.height+dy,resizer.horizontal);if(tinyMCE.getP
 aram("theme_advanced_resizing_use_cookie",true)){var expires=new Date();expires.setTime(expires.getTime()+3600000*24*30);TinyMCE_AdvancedTheme._setCookie("TinyMCE_"+editorId+"_width",""+(resizer.horizontal?resizer.width+dx:""),expires);TinyMCE_AdvancedTheme._setCookie("TinyMCE_"+editorId+"_height",""+(resizer.height+dy),expires)}break}},_setResizing:function(e,editor_id,state){e=typeof(e)=="undefined"?window.event:e;var resizer=TinyMCE_AdvancedTheme._resizer;var editorContainer=document.getElementById(editor_id+'_parent');var editorArea=document.getElementById(editor_id+'_parent').firstChild;var resizeBox=document.getElementById(editor_id+'_resize_box');var inst=tinyMCE.getInstanceById(editor_id);if(state){var width=editorArea.clientWidth;var height=editorArea.clientHeight;resizeBox.style.width=width+"px";resizeBox.style.height=height+"px";resizer.iframeWidth=inst.iframeElement.clientWidth;resizer.iframeHeight=inst.iframeElement.clientHeight;editorArea.style.display="none";r
 esizeBox.style.display="block";if(!resizer.eventHandlers){if(tinyMCE.isMSIE)tinyMCE.addEvent(document,"mousemove",TinyMCE_AdvancedTheme._resizeEventHandler);else tinyMCE.addEvent(window,"mousemove",TinyMCE_AdvancedTheme._resizeEventHandler);tinyMCE.addEvent(document,"mouseup",TinyMCE_AdvancedTheme._resizeEventHandler);resizer.eventHandlers=true}resizer.resizing=true;resizer.downX=e.screenX;resizer.downY=e.screenY;resizer.width=parseInt(resizeBox.style.width);resizer.height=parseInt(resizeBox.style.height);resizer.editorId=editor_id;resizer.resizeBox=resizeBox;resizer.horizontal=tinyMCE.getParam("theme_advanced_resize_horizontal",true)}else{resizer.resizing=false;resizeBox.style.display="none";editorArea.style.display=tinyMCE.isMSIE&&!tinyMCE.isOpera?"block":"table";tinyMCE.execCommand('mceResetDesignMode')}},_getColorHTML:function(id,n,cm){var i,h,cl;h='<span class="mceMenuLine"></span>';cl=tinyMCE.getParam(n,TinyMCE_AdvancedTheme._defColors).split(',');h+='<table class="mce
 Colors"><tr>';for(i=0;i<cl.length;i++){c='tinyMCE.execInstanceCommand(\''+id+'\', \''+cm+'\', false, \'#'+cl[i]+'\');';h+='<td><a href="javascript:'+c+'" style="background-color: #'+cl[i]+'" onclick="'+c+';return false;"></a></td>';if((i+1)%8==0)h+='</tr><tr>'}h+='</tr></table>';if(tinyMCE.getParam("theme_advanced_more_colors",true))h+='<a href="javascript:void(0);" onclick="TinyMCE_AdvancedTheme._pickColor(\''+id+'\',\''+cm+'\');" class="mceMoreColors">'+tinyMCE.getLang('lang_more_colors')+'</a>';return h},_pickColor:function(id,cm){var inputColor,inst=tinyMCE.selectedInstance;if(cm=='forecolor'&&inst)inputColor=inst.foreColor;if((cm=='backcolor'||cm=='HiliteColor')&&inst)inputColor=inst.backColor;tinyMCE.execCommand('mceColorPicker',true,{color:inputColor,callback:function(c){tinyMCE.execInstanceCommand(id,cm,false,c)}})},_insertImage:function(src,alt,border,hspace,vspace,width,height,align,title,onmouseover,onmouseout){tinyMCE.execCommand("mceInsertContent",false,tinyMCE.
 createTagHTML('img',{src:tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],src),mce_src:src,alt:alt,border:border,hspace:hspace,vspace:vspace,width:width,height:height,align:align,title:title,onmouseover:onmouseover,onmouseout:onmouseout}))},_insertLink:function(href,target,title,onclick,style_class){tinyMCE.execCommand('mceBeginUndoLevel');if(tinyMCE.selectedInstance&&tinyMCE.selectedElement&&tinyMCE.selectedElement.nodeName.toLowerCase()=="img"){var doc=tinyMCE.selectedInstance.getDoc();var linkElement=tinyMCE.getParentElement(tinyMCE.selectedElement,"a");var newLink=false;if(!linkElement){linkElement=doc.createElement("a");newLink=true}var mhref=href;var thref=eval(tinyMCE.settings['urlconverter_callback']+"(href, linkElement);");mhref=tinyMCE.getParam('convert_urls')?href:mhref;tinyMCE.setAttrib(linkElement,'href',thref);tinyMCE.setAttrib(linkElement,'mce_href',mhref);tinyMCE.setAttrib(linkElement,'target',target);tinyMCE.setAttrib(linkElement,'title',ti
 tle);tinyMCE.setAttrib(linkElement,'onclick',onclick);tinyMCE.setAttrib(linkElement,'class',style_class);if(newLink){linkElement.appendChild(tinyMCE.selectedElement.cloneNode(true));tinyMCE.selectedElement.parentNode.replaceChild(linkElement,tinyMCE.selectedElement)}return}if(!tinyMCE.linkElement&&tinyMCE.selectedInstance){if(tinyMCE.isSafari){tinyMCE.execCommand("mceInsertContent",false,'<a href="'+tinyMCE.uniqueURL+'">'+tinyMCE.selectedInstance.selection.getSelectedHTML()+'</a>')}else tinyMCE.selectedInstance.contentDocument.execCommand("createlink",false,tinyMCE.uniqueURL);tinyMCE.linkElement=tinyMCE.getElementByAttributeValue(tinyMCE.selectedInstance.contentDocument.body,"a","href",tinyMCE.uniqueURL);var elementArray=tinyMCE.getElementsByAttributeValue(tinyMCE.selectedInstance.contentDocument.body,"a","href",tinyMCE.uniqueURL);for(var i=0;i<elementArray.length;i++){var mhref=href;var thref=eval(tinyMCE.settings['urlconverter_callback']+"(href, elementArray[i]);");mhref=t
 inyMCE.getParam('convert_urls')?href:mhref;tinyMCE.setAttrib(elementArray[i],'href',thref);tinyMCE.setAttrib(elementArray[i],'mce_href',mhref);tinyMCE.setAttrib(elementArray[i],'target',target);tinyMCE.setAttrib(elementArray[i],'title',title);tinyMCE.setAttrib(elementArray[i],'onclick',onclick);tinyMCE.setAttrib(elementArray[i],'class',style_class)}tinyMCE.linkElement=elementArray[0]}if(tinyMCE.linkElement){var mhref=href;href=eval(tinyMCE.settings['urlconverter_callback']+"(href, tinyMCE.linkElement);");mhref=tinyMCE.getParam('convert_urls')?href:mhref;tinyMCE.setAttrib(tinyMCE.linkElement,'href',href);tinyMCE.setAttrib(tinyMCE.linkElement,'mce_href',mhref);tinyMCE.setAttrib(tinyMCE.linkElement,'target',target);tinyMCE.setAttrib(tinyMCE.linkElement,'title',title);tinyMCE.setAttrib(tinyMCE.linkElement,'onclick',onclick);tinyMCE.setAttrib(tinyMCE.linkElement,'class',style_class)}tinyMCE.execCommand('mceEndUndoLevel')}};tinyMCE.addTheme("advanced",TinyMCE_AdvancedTheme);tinyMC
 E.addButtonMap(TinyMCE_AdvancedTheme._buttonMap);
\ No newline at end of file

Modified: plog/trunk/js/tinymce/themes/advanced/editor_template_src.js
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/editor_template_src.js	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/js/tinymce/themes/advanced/editor_template_src.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,1217 +1,1516 @@
 /**
- * editor_template_src.js
+ * $Id: editor_template_src.js 296 2007-08-21 10:36:35Z spocke $
  *
- * Copyright 2009, Moxiecode Systems AB
- * Released under LGPL License.
- *
- * License: http://tinymce.moxiecode.com/license
- * Contributing: http://tinymce.moxiecode.com/contributing
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
  */
 
-(function(tinymce) {
-	var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, each = tinymce.each, Cookie = tinymce.util.Cookie, lastExtID, explode = tinymce.explode;
+/* Import theme specific language pack */
+tinyMCE.importThemeLanguagePack('advanced');
 
-	// Tell it to load theme specific language pack(s)
-	tinymce.ThemeManager.requireLangPack('advanced');
+var TinyMCE_AdvancedTheme = {
+	// Private theme fields
+	_defColors : "000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",
+	_autoImportCSSClasses : true,
+	_resizer : {},
+	_buttons : [
+		// Control id, button img, button title, command, user_interface, value
+		['bold', '{$lang_bold_img}', 'lang_bold_desc', 'Bold'],
+		['italic', '{$lang_italic_img}', 'lang_italic_desc', 'Italic'],
+		['underline', '{$lang_underline_img}', 'lang_underline_desc', 'Underline'],
+		['strikethrough', 'strikethrough.gif', 'lang_striketrough_desc', 'Strikethrough'],
+		['justifyleft', 'justifyleft.gif', 'lang_justifyleft_desc', 'JustifyLeft'],
+		['justifycenter', 'justifycenter.gif', 'lang_justifycenter_desc', 'JustifyCenter'],
+		['justifyright', 'justifyright.gif', 'lang_justifyright_desc', 'JustifyRight'],
+		['justifyfull', 'justifyfull.gif', 'lang_justifyfull_desc', 'JustifyFull'],
+		['bullist', 'bullist.gif', 'lang_bullist_desc', 'InsertUnorderedList'],
+		['numlist', 'numlist.gif', 'lang_numlist_desc', 'InsertOrderedList'],
+		['outdent', 'outdent.gif', 'lang_outdent_desc', 'Outdent'],
+		['indent', 'indent.gif', 'lang_indent_desc', 'Indent'],
+		['cut', 'cut.gif', 'lang_cut_desc', 'Cut'],
+		['copy', 'copy.gif', 'lang_copy_desc', 'Copy'],
+		['paste', 'paste.gif', 'lang_paste_desc', 'Paste'],
+		['undo', 'undo.gif', 'lang_undo_desc', 'Undo'],
+		['redo', 'redo.gif', 'lang_redo_desc', 'Redo'],
+		['link', 'link.gif', 'lang_link_desc', 'mceLink', true],
+		['unlink', 'unlink.gif', 'lang_unlink_desc', 'unlink'],
+		['image', 'image.gif', 'lang_image_desc', 'mceImage', true],
+		['cleanup', 'cleanup.gif', 'lang_cleanup_desc', 'mceCleanup'],
+		['help', 'help.gif', 'lang_help_desc', 'mceHelp'],
+		['code', 'code.gif', 'lang_theme_code_desc', 'mceCodeEditor'],
+		['hr', 'hr.gif', 'lang_theme_hr_desc', 'inserthorizontalrule'],
+		['removeformat', 'removeformat.gif', 'lang_theme_removeformat_desc', 'removeformat'],
+		['sub', 'sub.gif', 'lang_theme_sub_desc', 'subscript'],
+		['sup', 'sup.gif', 'lang_theme_sup_desc', 'superscript'],
+		['forecolor', 'forecolor.gif', 'lang_theme_forecolor_desc', 'forecolor', true],
+		['forecolorpicker', 'forecolor.gif', 'lang_theme_forecolor_desc', 'forecolorpicker', true],
+		['backcolor', 'backcolor.gif', 'lang_theme_backcolor_desc', 'HiliteColor', true],
+		['backcolorpicker', 'backcolor.gif', 'lang_theme_backcolor_desc', 'backcolorpicker', true],
+		['charmap', 'charmap.gif', 'lang_theme_charmap_desc', 'mceCharMap'],
+		['visualaid', 'visualaid.gif', 'lang_theme_visualaid_desc', 'mceToggleVisualAid'],
+		['anchor', 'anchor.gif', 'lang_theme_anchor_desc', 'mceInsertAnchor'],
+		['newdocument', 'newdocument.gif', 'lang_newdocument_desc', 'mceNewDocument']
+	],
 
-	tinymce.create('tinymce.themes.AdvancedTheme', {
-		sizes : [8, 10, 12, 14, 18, 24, 36],
+	_buttonMap : 'anchor,backcolor,bold,bullist,charmap,cleanup,code,copy,cut,forecolor,help,hr,image,indent,italic,justifycenter,justifyfull,justifyleft,justifyright,link,newdocument,numlist,outdent,paste,redo,removeformat,strikethrough,sub,sup,underline,undo,unlink,visualaid,advhr,ltr,rtl,emotions,flash,fullpage,fullscreen,iespell,insertdate,inserttime,pastetext,pasteword,selectall,preview,print,save,replace,search,table,cell_props,delete_col,delete_row,col_after,col_before,row_after,row_before,merge_cells,row_props,split_cells,delete_table',
 
-		// Control name lookup, format: title, command
-		controls : {
-			bold : ['bold_desc', 'Bold'],
-			italic : ['italic_desc', 'Italic'],
-			underline : ['underline_desc', 'Underline'],
-			strikethrough : ['striketrough_desc', 'Strikethrough'],
-			justifyleft : ['justifyleft_desc', 'JustifyLeft'],
-			justifycenter : ['justifycenter_desc', 'JustifyCenter'],
-			justifyright : ['justifyright_desc', 'JustifyRight'],
-			justifyfull : ['justifyfull_desc', 'JustifyFull'],
-			bullist : ['bullist_desc', 'InsertUnorderedList'],
-			numlist : ['numlist_desc', 'InsertOrderedList'],
-			outdent : ['outdent_desc', 'Outdent'],
-			indent : ['indent_desc', 'Indent'],
-			cut : ['cut_desc', 'Cut'],
-			copy : ['copy_desc', 'Copy'],
-			paste : ['paste_desc', 'Paste'],
-			undo : ['undo_desc', 'Undo'],
-			redo : ['redo_desc', 'Redo'],
-			link : ['link_desc', 'mceLink'],
-			unlink : ['unlink_desc', 'unlink'],
-			image : ['image_desc', 'mceImage'],
-			cleanup : ['cleanup_desc', 'mceCleanup'],
-			help : ['help_desc', 'mceHelp'],
-			code : ['code_desc', 'mceCodeEditor'],
-			hr : ['hr_desc', 'InsertHorizontalRule'],
-			removeformat : ['removeformat_desc', 'RemoveFormat'],
-			sub : ['sub_desc', 'subscript'],
-			sup : ['sup_desc', 'superscript'],
-			forecolor : ['forecolor_desc', 'ForeColor'],
-			forecolorpicker : ['forecolor_desc', 'mceForeColor'],
-			backcolor : ['backcolor_desc', 'HiliteColor'],
-			backcolorpicker : ['backcolor_desc', 'mceBackColor'],
-			charmap : ['charmap_desc', 'mceCharMap'],
-			visualaid : ['visualaid_desc', 'mceToggleVisualAid'],
-			anchor : ['anchor_desc', 'mceInsertAnchor'],
-			newdocument : ['newdocument_desc', 'mceNewDocument'],
-			blockquote : ['blockquote_desc', 'mceBlockQuote']
-		},
+	/**
+	 * Returns HTML code for the specificed control.
+	 */
+	getControlHTML : function(button_name) {
+		var i, x, but;
 
-		stateControls : ['bold', 'italic', 'underline', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'sub', 'sup', 'blockquote'],
+		// Lookup button in button list
+		for (i=0; i<TinyMCE_AdvancedTheme._buttons.length; i++) {
+			but = TinyMCE_AdvancedTheme._buttons[i];
 
-		init : function(ed, url) {
-			var t = this, s, v, o;
-	
-			t.editor = ed;
-			t.url = url;
-			t.onResolveName = new tinymce.util.Dispatcher(this);
+			if (but[0] == button_name && (button_name == "forecolor" || button_name == "backcolor"))
+				return tinyMCE.getMenuButtonHTML(but[0], but[2], '{$themeurl}/images/' + but[1], but[3] + "Menu", but[3], (but.length > 4 ? but[4] : false), (but.length > 5 ? but[5] : null));
 
-			// Default settings
-			t.settings = s = extend({
-				theme_advanced_path : true,
-				theme_advanced_toolbar_location : 'bottom',
-				theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",
-				theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",
-				theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap",
-				theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6",
-				theme_advanced_toolbar_align : "center",
-				theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",
-				theme_advanced_more_colors : 1,
-				theme_advanced_row_height : 23,
-				theme_advanced_resize_horizontal : 1,
-				theme_advanced_resizing_use_cookie : 1,
-				theme_advanced_font_sizes : "1,2,3,4,5,6,7",
-				readonly : ed.settings.readonly
-			}, ed.settings);
+			if (but[0] == button_name)
+				return tinyMCE.getButtonHTML(but[0], but[2], '{$themeurl}/images/' + but[1], but[3], (but.length > 4 ? but[4] : false), (but.length > 5 ? but[5] : null));
+		}
 
-			// Setup default font_size_style_values
-			if (!s.font_size_style_values)
-				s.font_size_style_values = "8pt,10pt,12pt,14pt,18pt,24pt,36pt";
+		// Custom controlls other than buttons
+		switch (button_name) {
+			case "formatselect":
+				var html = '<select id="{$editor_id}_formatSelect" name="{$editor_id}_formatSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FormatBlock\',false,this.options[this.selectedIndex].value);" class="mceSelectList">';
+				var formats = tinyMCE.getParam("theme_advanced_blockformats", "p,address,pre,h1,h2,h3,h4,h5,h6", true).split(',');
+				var lookup = [
+					['p', '{$lang_theme_paragraph}'],
+					['address', '{$lang_theme_address}'],
+					['pre', '{$lang_theme_pre}'],
+					['h1', '{$lang_theme_h1}'],
+					['h2', '{$lang_theme_h2}'],
+					['h3', '{$lang_theme_h3}'],
+					['h4', '{$lang_theme_h4}'],
+					['h5', '{$lang_theme_h5}'],
+					['h6', '{$lang_theme_h6}'],
+					['div', '{$lang_theme_div}'],
+					['blockquote', '{$lang_theme_blockquote}'],
+					['code', '{$lang_theme_code}'],
+					['dt', '{$lang_theme_dt}'],
+					['dd', '{$lang_theme_dd}'],
+					['samp', '{$lang_theme_samp}']
+				];
 
-			if (tinymce.is(s.theme_advanced_font_sizes, 'string')) {
-				s.font_size_style_values = tinymce.explode(s.font_size_style_values);
-				s.font_size_classes = tinymce.explode(s.font_size_classes || '');
+				html += '<option value="">{$lang_theme_block}</option>';
 
-				// Parse string value
-				o = {};
-				ed.settings.theme_advanced_font_sizes = s.theme_advanced_font_sizes;
-				each(ed.getParam('theme_advanced_font_sizes', '', 'hash'), function(v, k) {
-					var cl;
+				// Build format select
+				for (var i=0; i<formats.length; i++) {
+					for (var x=0; x<lookup.length; x++) {
+						if (formats[i] == lookup[x][0])
+							html += '<option value="<' + lookup[x][0] + '>">' + lookup[x][1] + '</option>';
+					}
+				}
 
-					if (k == v && v >= 1 && v <= 7) {
-						k = v + ' (' + t.sizes[v - 1] + 'pt)';
-						cl = s.font_size_classes[v - 1];
-						v = s.font_size_style_values[v - 1] || (t.sizes[v - 1] + 'pt');
+				html += '</select>';
+
+				return html;
+
+			case "styleselect":
+				return '<select id="{$editor_id}_styleSelect" onmousedown="tinyMCE.themes.advanced._setupCSSClasses(\'{$editor_id}\');" name="{$editor_id}_styleSelect" onfocus="tinyMCE.addSelectAccessibility(event,this,window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceSetCSSClass\',false,this.options[this.selectedIndex].value);" class="mceSelectList">{$style_select_options}</select>';
+
+			case "fontselect":
+				var fontHTML = '<select id="{$editor_id}_fontNameSelect" name="{$editor_id}_fontNameSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FontName\',false,this.options[this.selectedIndex].value);" class="mceSelectList"><option value="">{$lang_theme_fontdefault}</option>';
+				var iFonts = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings';
+				var nFonts = 'Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats';
+				var fonts = tinyMCE.getParam("theme_advanced_fonts", nFonts).split(';');
+				for (i=0; i<fonts.length; i++) {
+					if (fonts[i] != '') {
+						var parts = fonts[i].split('=');
+						fontHTML += '<option value="' + parts[1] + '">' + parts[0] + '</option>';
 					}
+				}
 
-					if (/^\s*\./.test(v))
-						cl = v.replace(/\./g, '');
+				fontHTML += '</select>';
+				return fontHTML;
 
-					o[k] = cl ? {'class' : cl} : {fontSize : v};
-				});
+			case "fontsizeselect":
+				return '<select id="{$editor_id}_fontSizeSelect" name="{$editor_id}_fontSizeSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FontSize\',false,this.options[this.selectedIndex].value);" class="mceSelectList">'+
+						'<option value="0">{$lang_theme_font_size}</option>'+
+						'<option value="1">1 (8 pt)</option>'+
+						'<option value="2">2 (10 pt)</option>'+
+						'<option value="3">3 (12 pt)</option>'+
+						'<option value="4">4 (14 pt)</option>'+
+						'<option value="5">5 (18 pt)</option>'+
+						'<option value="6">6 (24 pt)</option>'+
+						'<option value="7">7 (36 pt)</option>'+
+						'</select>';
 
-				s.theme_advanced_font_sizes = o;
-			}
+			case "|":
+			case "separator":
+				return '<img src="{$themeurl}/images/separator.gif" width="2" height="20" class="mceSeparatorLine" alt="" />';
 
-			if ((v = s.theme_advanced_path_location) && v != 'none')
-				s.theme_advanced_statusbar_location = s.theme_advanced_path_location;
+			case "spacer":
+				return '<img src="{$themeurl}/images/separator.gif" width="2" height="15" border="0" class="mceSeparatorLine" style="vertical-align: middle" alt="" />';
 
-			if (s.theme_advanced_statusbar_location == 'none')
-				s.theme_advanced_statusbar_location = 0;
+			case "rowseparator":
+				return '<br />';
+		}
 
-			// Init editor
-			ed.onInit.add(function() {
-				if (!ed.settings.readonly)
-					ed.onNodeChange.add(t._nodeChanged, t);
+		return "";
+	},
 
-				if (ed.settings.content_css !== false)
-					ed.dom.loadCSS(ed.baseURI.toAbsolute(url + "/skins/" + ed.settings.skin + "/content.css"));
-			});
+	/**
+	 * Theme specific execcommand handling.
+	 */
+	execCommand : function(editor_id, element, command, user_interface, value) {
+		switch (command) {
+			case 'mceHelp':
+				tinyMCE.openWindow({
+					file : 'about.htm',
+					width : 480,
+					height : 380
+				}, {
+					tinymce_version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion,
+					tinymce_releasedate : tinyMCE.releaseDate,
+					inline : "yes"
+				});
+			return true;
 
-			ed.onSetProgressState.add(function(ed, b, ti) {
-				var co, id = ed.id, tb;
+			case "mceLink":
+				var inst = tinyMCE.getInstanceById(editor_id);
+				var doc = inst.getDoc();
+				var selectedText = "";
 
-				if (b) {
-					t.progressTimer = setTimeout(function() {
-						co = ed.getContainer();
-						co = co.insertBefore(DOM.create('DIV', {style : 'position:relative'}), co.firstChild);
-						tb = DOM.get(ed.id + '_tbl');
+				if (tinyMCE.isMSIE) {
+					var rng = doc.selection.createRange();
+					selectedText = rng.text;
+				} else
+					selectedText = inst.getSel().toString();
 
-						DOM.add(co, 'div', {id : id + '_blocker', 'class' : 'mceBlocker', style : {width : tb.clientWidth + 2, height : tb.clientHeight + 2}});
-						DOM.add(co, 'div', {id : id + '_progress', 'class' : 'mceProgress', style : {left : tb.clientWidth / 2, top : tb.clientHeight / 2}});
-					}, ti || 0);
-				} else {
-					DOM.remove(id + '_blocker');
-					DOM.remove(id + '_progress');
-					clearTimeout(t.progressTimer);
+				if (!tinyMCE.linkElement) {
+					if ((tinyMCE.selectedElement.nodeName.toLowerCase() != "img") && (selectedText.length <= 0))
+						return true;
 				}
-			});
 
-			DOM.loadCSS(s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : url + "/skins/" + ed.settings.skin + "/ui.css");
+				var href = "", target = "", title = "", onclick = "", action = "insert", style_class = "";
 
-			if (s.skin_variant)
-				DOM.loadCSS(url + "/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css");
-		},
+				if (tinyMCE.selectedElement.nodeName.toLowerCase() == "a")
+					tinyMCE.linkElement = tinyMCE.selectedElement;
 
-		createControl : function(n, cf) {
-			var cd, c;
+				// Is anchor not a link
+				if (tinyMCE.linkElement != null && tinyMCE.getAttrib(tinyMCE.linkElement, 'href') == "")
+					tinyMCE.linkElement = null;
 
-			if (c = cf.createControl(n))
-				return c;
+				if (tinyMCE.linkElement) {
+					href = tinyMCE.getAttrib(tinyMCE.linkElement, 'href');
+					target = tinyMCE.getAttrib(tinyMCE.linkElement, 'target');
+					title = tinyMCE.getAttrib(tinyMCE.linkElement, 'title');
+					onclick = tinyMCE.getAttrib(tinyMCE.linkElement, 'onclick');
+					style_class = tinyMCE.getAttrib(tinyMCE.linkElement, 'class');
 
-			switch (n) {
-				case "styleselect":
-					return this._createStyleSelect();
+					// Try old onclick to if copy/pasted content
+					if (onclick == "")
+						onclick = tinyMCE.getAttrib(tinyMCE.linkElement, 'onclick');
 
-				case "formatselect":
-					return this._createBlockFormats();
+					onclick = tinyMCE.cleanupEventStr(onclick);
 
-				case "fontselect":
-					return this._createFontSelect();
+					href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement, true);");
 
-				case "fontsizeselect":
-					return this._createFontSizeSelect();
+					// Use mce_href if defined
+					mceRealHref = tinyMCE.getAttrib(tinyMCE.linkElement, 'mce_href');
+					if (mceRealHref != "") {
+						href = mceRealHref;
 
-				case "forecolor":
-					return this._createForeColorMenu();
+						if (tinyMCE.getParam('convert_urls'))
+							href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement, true);");
+					}
 
-				case "backcolor":
-					return this._createBackColorMenu();
-			}
+					action = "update";
+				}
 
-			if ((cd = this.controls[n]))
-				return cf.createButton(n, {title : "advanced." + cd[0], cmd : cd[1], ui : cd[2], value : cd[3]});
-		},
+				var template = new Array();
 
-		execCommand : function(cmd, ui, val) {
-			var f = this['_' + cmd];
+				template['file'] = 'link.htm';
+				template['width'] = 310;
+				template['height'] = 200;
 
-			if (f) {
-				f.call(this, ui, val);
+				// Language specific width and height addons
+				template['width'] += tinyMCE.getLang('lang_insert_link_delta_width', 0);
+				template['height'] += tinyMCE.getLang('lang_insert_link_delta_height', 0);
+
+				if (inst.settings['insertlink_callback']) {
+					var returnVal = eval(inst.settings['insertlink_callback'] + "(href, target, title, onclick, action, style_class);");
+					if (returnVal && returnVal['href'])
+						TinyMCE_AdvancedTheme._insertLink(returnVal['href'], returnVal['target'], returnVal['title'], returnVal['onclick'], returnVal['style_class']);
+				} else {
+					tinyMCE.openWindow(template, {href : href, target : target, title : title, onclick : onclick, action : action, className : style_class, inline : "yes"});
+				}
+
 				return true;
-			}
 
-			return false;
-		},
+			case "mceImage":
+				var src = "", alt = "", border = "", hspace = "", vspace = "", width = "", height = "", align = "";
+				var title = "", onmouseover = "", onmouseout = "", action = "insert";
+				var img = tinyMCE.imgElement;
+				var inst = tinyMCE.getInstanceById(editor_id);
 
-		_importClasses : function(e) {
-			var ed = this.editor, ctrl = ed.controlManager.get('styleselect');
+				if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "img") {
+					img = tinyMCE.selectedElement;
+					tinyMCE.imgElement = img;
+				}
 
-			if (ctrl.getLength() == 0) {
-				each(ed.dom.getClasses(), function(o, idx) {
-					var name = 'style_' + idx;
+				if (img) {
+					// Is it a internal MCE visual aid image, then skip this one.
+					if (tinyMCE.getAttrib(img, 'name').indexOf('mce_') == 0)
+						return true;
 
-					ed.formatter.register(name, {
-						inline : 'span',
-						attributes : {'class' : o['class']},
-						selector : '*'
-					});
+					src = tinyMCE.getAttrib(img, 'src');
+					alt = tinyMCE.getAttrib(img, 'alt');
 
-					ctrl.add(o['class'], name);
-				});
-			}
-		},
+					// Try polling out the title
+					if (alt == "")
+						alt = tinyMCE.getAttrib(img, 'title');
 
-		_createStyleSelect : function(n) {
-			var t = this, ed = t.editor, ctrlMan = ed.controlManager, ctrl;
+					// Fix width/height attributes if the styles is specified
+					if (tinyMCE.isGecko) {
+						var w = img.style.width;
+						if (w != null && w != "")
+							img.setAttribute("width", w);
 
-			// Setup style select box
-			ctrl = ctrlMan.createListBox('styleselect', {
-				title : 'advanced.style_select',
-				onselect : function(name) {
-					var matches, formatNames = [];
+						var h = img.style.height;
+						if (h != null && h != "")
+							img.setAttribute("height", h);
+					}
 
-					each(ctrl.items, function(item) {
-						formatNames.push(item.value);
-					});
+					border = tinyMCE.getAttrib(img, 'border');
+					hspace = tinyMCE.getAttrib(img, 'hspace');
+					vspace = tinyMCE.getAttrib(img, 'vspace');
+					width = tinyMCE.getAttrib(img, 'width');
+					height = tinyMCE.getAttrib(img, 'height');
+					align = tinyMCE.getAttrib(img, 'align');
+					onmouseover = tinyMCE.getAttrib(img, 'onmouseover');
+					onmouseout = tinyMCE.getAttrib(img, 'onmouseout');
+					title = tinyMCE.getAttrib(img, 'title');
 
-					ed.focus();
-					ed.undoManager.add();
+					// Is realy specified?
+					if (tinyMCE.isMSIE) {
+						width = img.attributes['width'].specified ? width : "";
+						height = img.attributes['height'].specified ? height : "";
+					}
 
-					// Toggle off the current format
-					matches = ed.formatter.matchAll(formatNames);
-					if (!name || matches[0] == name)
-						ed.formatter.remove(matches[0]);
-					else
-						ed.formatter.apply(name);
+					//onmouseover = tinyMCE.getImageSrc(tinyMCE.cleanupEventStr(onmouseover));
+					//onmouseout = tinyMCE.getImageSrc(tinyMCE.cleanupEventStr(onmouseout));
 
-					ed.undoManager.add();
-					ed.nodeChanged();
+					src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, img, true);");
 
-					return false; // No auto select
+					// Use mce_src if defined
+					mceRealSrc = tinyMCE.getAttrib(img, 'mce_src');
+					if (mceRealSrc != "") {
+						src = mceRealSrc;
+
+						if (tinyMCE.getParam('convert_urls'))
+							src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, img, true);");
+					}
+
+					//if (onmouseover != "")
+					//	onmouseover = eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseover, img, true);");
+
+					//if (onmouseout != "")
+					//	onmouseout = eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseout, img, true);");
+
+					action = "update";
 				}
-			});
 
-			// Handle specified format
-			ed.onInit.add(function() {
-				var counter = 0, formats = ed.getParam('style_formats');
+				var template = new Array();
 
-				if (formats) {
-					each(formats, function(fmt) {
-						var name, keys = 0;
+				template['file'] = 'image.htm?src={$src}';
+				template['width'] = 355;
+				template['height'] = 265 + (tinyMCE.isMSIE ? 25 : 0);
 
-						each(fmt, function() {keys++;});
+				// Language specific width and height addons
+				template['width'] += tinyMCE.getLang('lang_insert_image_delta_width', 0);
+				template['height'] += tinyMCE.getLang('lang_insert_image_delta_height', 0);
 
-						if (keys > 1) {
-							name = fmt.name = fmt.name || 'style_' + (counter++);
-							ed.formatter.register(name, fmt);
-							ctrl.add(fmt.title, name);
-						} else
-							ctrl.add(fmt.title);
-					});
-				} else {
-					each(ed.getParam('theme_advanced_styles', '', 'hash'), function(val, key) {
-						var name;
+				if (inst.settings['insertimage_callback']) {
+					var returnVal = eval(inst.settings['insertimage_callback'] + "(src, alt, border, hspace, vspace, width, height, align, title, onmouseover, onmouseout, action);");
+					if (returnVal && returnVal['src'])
+						TinyMCE_AdvancedTheme._insertImage(returnVal['src'], returnVal['alt'], returnVal['border'], returnVal['hspace'], returnVal['vspace'], returnVal['width'], returnVal['height'], returnVal['align'], returnVal['title'], returnVal['onmouseover'], returnVal['onmouseout']);
+				} else
+					tinyMCE.openWindow(template, {src : src, alt : alt, border : border, hspace : hspace, vspace : vspace, width : width, height : height, align : align, title : title, onmouseover : onmouseover, onmouseout : onmouseout, action : action, inline : "yes"});
 
-						if (val) {
-							name = 'style_' + (counter++);
+				return true;
 
-							ed.formatter.register(name, {
-								inline : 'span',
-								classes : val,
-								selector : '*'
-							});
+			case "forecolor":
+				var fcp = new TinyMCE_Layer(editor_id + '_fcPreview', false), p, img, elm;
 
-							ctrl.add(t.editor.translate(key), name);
-						}
-					});
+				TinyMCE_AdvancedTheme._hideMenus(editor_id);
+
+				if (!fcp.exists()) {
+					fcp.create('div', 'mceColorPreview', document.getElementById(editor_id + '_toolbar'));
+					elm = fcp.getElement();
+					elm._editor_id = editor_id;
+					elm._command = "forecolor";
+					elm._switchId = editor_id + "_forecolor";
+					tinyMCE.addEvent(elm, 'click', TinyMCE_AdvancedTheme._handleMenuEvent);
+					tinyMCE.addEvent(elm, 'mouseover', TinyMCE_AdvancedTheme._handleMenuEvent);
+					tinyMCE.addEvent(elm, 'mouseout', TinyMCE_AdvancedTheme._handleMenuEvent);
 				}
-			});
 
-			// Auto import classes if the ctrl box is empty
-			if (ctrl.getLength() == 0) {
-				ctrl.onPostRender.add(function(ed, n) {
-					if (!ctrl.NativeListBox) {
-						Event.add(n.id + '_text', 'focus', t._importClasses, t);
-						Event.add(n.id + '_text', 'mousedown', t._importClasses, t);
-						Event.add(n.id + '_open', 'focus', t._importClasses, t);
-						Event.add(n.id + '_open', 'mousedown', t._importClasses, t);
-					} else
-						Event.add(n.id, 'focus', t._importClasses, t);
-				});
-			}
+				img = tinyMCE.selectNodes(document.getElementById(editor_id + "_forecolor"), function(n) {return n.nodeName == "IMG";})[0];
+				p = tinyMCE.getAbsPosition(img, document.getElementById(editor_id + '_toolbar'));
 
-			return ctrl;
-		},
+				fcp.moveTo(p.absLeft, p.absTop);
+				fcp.getElement().style.backgroundColor = value != null ? value : tinyMCE.getInstanceById(editor_id).foreColor;
+				fcp.show();
 
-		_createFontSelect : function() {
-			var c, t = this, ed = t.editor;
+				return false;
 
-			c = ed.controlManager.createListBox('fontselect', {
-				title : 'advanced.fontdefault',
-				onselect : function(v) {
-					var cur = c.items[c.selectedIndex];
+			case "forecolorpicker":
+				this._pickColor(editor_id, 'forecolor');
+				return true;
 
-					if (!v && cur) {
-						ed.execCommand('FontName', false, cur.value);
-						return;
-					}
+			case "forecolorMenu":
+				TinyMCE_AdvancedTheme._hideMenus(editor_id);
 
-					ed.execCommand('FontName', false, v);
+				// Create color layer
+				var ml = new TinyMCE_Layer(editor_id + '_fcMenu');
 
-					// Fake selection, execCommand will fire a nodeChange and update the selection
-					c.select(function(sv) {
-						return v == sv;
-					});
+				if (!ml.exists())
+					ml.create('div', 'mceMenu', document.body, TinyMCE_AdvancedTheme._getColorHTML(editor_id, 'theme_advanced_text_colors', 'forecolor'));
 
-					return false; // No auto select
+				tinyMCE.switchClass(editor_id + '_forecolor', 'mceMenuButtonFocus');
+				ml.moveRelativeTo(document.getElementById(editor_id + "_forecolor"), 'bl');
+
+				ml.moveBy(tinyMCE.isMSIE && !tinyMCE.isOpera ? -1 : 1, -1);
+
+				if (tinyMCE.isOpera)
+					ml.moveBy(0, -2);
+
+				ml.show();
+			return true;
+
+			case "HiliteColor":
+				var bcp = new TinyMCE_Layer(editor_id + '_bcPreview', false), p, img;
+
+				TinyMCE_AdvancedTheme._hideMenus(editor_id);
+
+				if (!bcp.exists()) {
+					bcp.create('div', 'mceColorPreview', document.getElementById(editor_id + '_toolbar'));
+					elm = bcp.getElement();
+					elm._editor_id = editor_id;
+					elm._command = "HiliteColor";
+					elm._switchId = editor_id + "_backcolor";
+					tinyMCE.addEvent(elm, 'click', TinyMCE_AdvancedTheme._handleMenuEvent);
+					tinyMCE.addEvent(elm, 'mouseover', TinyMCE_AdvancedTheme._handleMenuEvent);
+					tinyMCE.addEvent(elm, 'mouseout', TinyMCE_AdvancedTheme._handleMenuEvent);
 				}
-			});
 
-			if (c) {
-				each(ed.getParam('theme_advanced_fonts', t.settings.theme_advanced_fonts, 'hash'), function(v, k) {
-					c.add(ed.translate(k), v, {style : v.indexOf('dings') == -1 ? 'font-family:' + v : ''});
-				});
-			}
+				img = tinyMCE.selectNodes(document.getElementById(editor_id + "_backcolor"), function(n) {return n.nodeName == "IMG";})[0];
+				p = tinyMCE.getAbsPosition(img, document.getElementById(editor_id + '_toolbar'));
 
-			return c;
-		},
+				bcp.moveTo(p.absLeft, p.absTop);
+				bcp.getElement().style.backgroundColor = value != null ? value : tinyMCE.getInstanceById(editor_id).backColor;
+				bcp.show();
 
-		_createFontSizeSelect : function() {
-			var t = this, ed = t.editor, c, i = 0, cl = [];
+				return false;
 
-			c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) {
-				var cur = c.items[c.selectedIndex];
+			case "HiliteColorMenu":
+				TinyMCE_AdvancedTheme._hideMenus(editor_id);
 
-				if (!v && cur) {
-					cur = cur.value;
+				// Create color layer
+				var ml = new TinyMCE_Layer(editor_id + '_bcMenu');
 
-					if (cur['class']) {
-						ed.formatter.toggle('fontsize_class', {value : cur['class']});
-						ed.undoManager.add();
-						ed.nodeChanged();
-					} else {
-						ed.execCommand('FontSize', false, cur.fontSize);
+				if (!ml.exists())
+					ml.create('div', 'mceMenu', document.body, TinyMCE_AdvancedTheme._getColorHTML(editor_id, 'theme_advanced_background_colors', 'HiliteColor'));
+
+				tinyMCE.switchClass(editor_id + '_backcolor', 'mceMenuButtonFocus');
+				ml.moveRelativeTo(document.getElementById(editor_id + "_backcolor"), 'bl');
+
+				ml.moveBy(tinyMCE.isMSIE && !tinyMCE.isOpera ? -1 : 1, -1);
+
+				if (tinyMCE.isOpera)
+					ml.moveBy(0, -2);
+
+				ml.show();
+			return true;
+	
+			case "backcolorpicker":
+				this._pickColor(editor_id, 'HiliteColor');
+				return true;
+
+			case "mceColorPicker":
+				if (user_interface) {
+					var template = [];
+	
+					if (!value['callback'] && !value['color'])
+						value['color'] = value['document'].getElementById(value['element_id']).value;
+
+					template['file'] = 'color_picker.htm';
+					template['width'] = 380;
+					template['height'] = 250;
+					template['close_previous'] = "no";
+
+					template['width'] += tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_width', 0);
+					template['height'] += tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_height', 0);
+
+					if (typeof(value['store_selection']) == "undefined")
+						value['store_selection'] = true;
+
+					tinyMCE.lastColorPickerValue = value;
+					tinyMCE.openWindow(template, {editor_id : editor_id, mce_store_selection : value['store_selection'], inline : "yes", command : "mceColorPicker", input_color : value['color']});
+				} else {
+					var savedVal = tinyMCE.lastColorPickerValue, elm;
+
+					if (savedVal['callback']) {
+						savedVal['callback'](value);
+						return true;
 					}
 
-					return;
+					elm = savedVal['document'].getElementById(savedVal['element_id']);
+					elm.value = value;
+
+					if (elm.onchange != null && elm.onchange != '')
+						eval('elm.onchange();');
 				}
+			return true;
 
-				if (v['class']) {
-					ed.focus();
-					ed.undoManager.add();
-					ed.formatter.toggle('fontsize_class', {value : v['class']});
-					ed.undoManager.add();
-					ed.nodeChanged();
-				} else
-					ed.execCommand('FontSize', false, v.fontSize);
+			case "mceCodeEditor":
+				var template = new Array();
 
-				// Fake selection, execCommand will fire a nodeChange and update the selection
-				c.select(function(sv) {
-					return v == sv;
-				});
+				template['file'] = 'source_editor.htm';
+				template['width'] = parseInt(tinyMCE.getParam("theme_advanced_source_editor_width", 720));
+				template['height'] = parseInt(tinyMCE.getParam("theme_advanced_source_editor_height", 580));
 
-				return false; // No auto select
-			}});
+				tinyMCE.openWindow(template, {editor_id : editor_id, resizable : "yes", scrollbars : "no", inline : "yes"});
+				return true;
 
-			if (c) {
-				each(t.settings.theme_advanced_font_sizes, function(v, k) {
-					var fz = v.fontSize;
+			case "mceCharMap":
+				var template = new Array();
 
-					if (fz >= 1 && fz <= 7)
-						fz = t.sizes[parseInt(fz) - 1] + 'pt';
+				template['file'] = 'charmap.htm';
+				template['width'] = 550 + (tinyMCE.isOpera ? 40 : 0);
+				template['height'] = 250;
 
-					c.add(k, v, {'style' : 'font-size:' + fz, 'class' : 'mceFontSize' + (i++) + (' ' + (v['class'] || ''))});
-				});
-			}
+				template['width'] += tinyMCE.getLang('lang_theme_advanced_charmap_delta_width', 0);
+				template['height'] += tinyMCE.getLang('lang_theme_advanced_charmap_delta_height', 0);
 
-			return c;
-		},
+				tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});
+				return true;
 
-		_createBlockFormats : function() {
-			var c, fmts = {
-				p : 'advanced.paragraph',
-				address : 'advanced.address',
-				pre : 'advanced.pre',
-				h1 : 'advanced.h1',
-				h2 : 'advanced.h2',
-				h3 : 'advanced.h3',
-				h4 : 'advanced.h4',
-				h5 : 'advanced.h5',
-				h6 : 'advanced.h6',
-				div : 'advanced.div',
-				blockquote : 'advanced.blockquote',
-				code : 'advanced.code',
-				dt : 'advanced.dt',
-				dd : 'advanced.dd',
-				samp : 'advanced.samp'
-			}, t = this;
+			case "mceInsertAnchor":
+				var template = new Array();
 
-			c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', cmd : 'FormatBlock'});
-			if (c) {
-				each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k) {
-					c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v});
-				});
-			}
+				template['file'] = 'anchor.htm';
+				template['width'] = 320;
+				template['height'] = 90 + (tinyMCE.isNS7 ? 30 : 0);
 
-			return c;
-		},
+				template['width'] += tinyMCE.getLang('lang_theme_advanced_anchor_delta_width', 0);
+				template['height'] += tinyMCE.getLang('lang_theme_advanced_anchor_delta_height', 0);
 
-		_createForeColorMenu : function() {
-			var c, t = this, s = t.settings, o = {}, v;
+				tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});
+				return true;
 
-			if (s.theme_advanced_more_colors) {
-				o.more_colors_func = function() {
-					t._mceColorPicker(0, {
-						color : c.value,
-						func : function(co) {
-							c.setColor(co);
-						}
-					});
-				};
+			case "mceNewDocument":
+				if (confirm(tinyMCE.entityDecode(tinyMCE.getLang('lang_newdocument'))))
+					tinyMCE.execInstanceCommand(editor_id, 'mceSetContent', false, ' ');
+
+				return true;
+		}
+
+		return false;
+	},
+
+	/**
+	 * Editor instance template function.
+	 */
+	getEditorTemplate : function(settings, editorId) {
+		function removeFromArray(in_array, remove_array) {
+			var outArray = new Array(), skip;
+			
+			for (var i=0; i<in_array.length; i++) {
+				skip = false;
+
+				for (var j=0; j<remove_array.length; j++) {
+					if (in_array[i] == remove_array[j]) {
+						skip = true;
+					}
+				}
+
+				if (!skip) {
+					outArray[outArray.length] = in_array[i];
+				}
 			}
 
-			if (v = s.theme_advanced_text_colors)
-				o.colors = v;
+			return outArray;
+		}
 
-			if (s.theme_advanced_default_foreground_color)
-				o.default_color = s.theme_advanced_default_foreground_color;
+		function addToArray(in_array, add_array) {
+			for (var i=0; i<add_array.length; i++) {
+				in_array[in_array.length] = add_array[i];
+			}
 
-			o.title = 'advanced.forecolor_desc';
-			o.cmd = 'ForeColor';
-			o.scope = this;
+			return in_array;
+		}
 
-			c = t.editor.controlManager.createColorSplitButton('forecolor', o);
+		var template = new Array();
+		var deltaHeight = 0;
+		var resizing = tinyMCE.getParam("theme_advanced_resizing", false);
+		var path = tinyMCE.getParam("theme_advanced_path", true);
+		var statusbarHTML = '<div id="{$editor_id}_path" class="mceStatusbarPathText" style="display: ' + (path ? "block" : "none") + '"> </div><div id="{$editor_id}_resize" class="mceStatusbarResize" style="display: ' + (resizing ? "block" : "none") + '" onmousedown="tinyMCE.themes.advanced._setResizing(event,\'{$editor_id}\',true);"></div><br style="clear: both" />';
+		var layoutManager = tinyMCE.getParam("theme_advanced_layout_manager", "SimpleLayout");
 
-			return c;
-		},
+		// Setup style select options -- MOVED UP FOR EXTERNAL TOOLBAR COMPATABILITY!
+		var styleSelectHTML = '<option value="">{$lang_theme_style_select}</option>';
+		if (settings['theme_advanced_styles']) {
+			var stylesAr = settings['theme_advanced_styles'].split(';');
+			
+			for (var i=0; i<stylesAr.length; i++) {
+				var key, value;
 
-		_createBackColorMenu : function() {
-			var c, t = this, s = t.settings, o = {}, v;
+				key = stylesAr[i].split('=')[0];
+				value = stylesAr[i].split('=')[1];
 
-			if (s.theme_advanced_more_colors) {
-				o.more_colors_func = function() {
-					t._mceColorPicker(0, {
-						color : c.value,
-						func : function(co) {
-							c.setColor(co);
-						}
-					});
-				};
+				styleSelectHTML += '<option value="' + value + '">' + key + '</option>';
 			}
 
-			if (v = s.theme_advanced_background_colors)
-				o.colors = v;
+			TinyMCE_AdvancedTheme._autoImportCSSClasses = false;
+		}
 
-			if (s.theme_advanced_default_background_color)
-				o.default_color = s.theme_advanced_default_background_color;
+		switch(layoutManager) {
+			case "SimpleLayout" : //the default TinyMCE Layout (for backwards compatibility)...
+				var toolbarHTML = "";
+				var toolbarLocation = tinyMCE.getParam("theme_advanced_toolbar_location", "bottom");
+				var toolbarAlign = tinyMCE.getParam("theme_advanced_toolbar_align", "center");
+				var pathLocation = tinyMCE.getParam("theme_advanced_path_location", "none"); // Compatiblity
+				var statusbarLocation = tinyMCE.getParam("theme_advanced_statusbar_location", pathLocation);
+				var defVals = {
+					theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,styleselect,formatselect",
+					theme_advanced_buttons2 : "bullist,numlist,separator,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,image,cleanup,help,code",
+					theme_advanced_buttons3 : "hr,removeformat,visualaid,separator,sub,sup,separator,charmap"
+				};
 
-			o.title = 'advanced.backcolor_desc';
-			o.cmd = 'HiliteColor';
-			o.scope = this;
+				// Add accessibility control
+				toolbarHTML += '<a href="#" accesskey="q" title="' + tinyMCE.getLang("lang_toolbar_focus") + '"';
 
-			c = t.editor.controlManager.createColorSplitButton('backcolor', o);
+				if (!tinyMCE.getParam("accessibility_focus"))
+					toolbarHTML += ' onfocus="tinyMCE.getInstanceById(\'' + editorId + '\').getWin().focus();"';
 
-			return c;
-		},
+				toolbarHTML += '></a>';
 
-		renderUI : function(o) {
-			var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl;
+				// Render rows
+				for (var i=1; i<100; i++) {
+					var def = defVals["theme_advanced_buttons" + i];
 
-			n = p = DOM.create('span', {id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '')});
+					var buttons = tinyMCE.getParam("theme_advanced_buttons" + i, def == null ? '' : def, true, ',');
+					if (buttons.length == 0)
+						break;
 
-			if (!DOM.boxModel)
-				n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'});
+					buttons = removeFromArray(buttons, tinyMCE.getParam("theme_advanced_disable", "", true, ','));
+					buttons = addToArray(buttons, tinyMCE.getParam("theme_advanced_buttons" + i + "_add", "", true, ','));
+					buttons = addToArray(tinyMCE.getParam("theme_advanced_buttons" + i + "_add_before", "", true, ','), buttons);
 
-			n = sc = DOM.add(n, 'table', {id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0});
-			n = tb = DOM.add(n, 'tbody');
+					for (var b=0; b<buttons.length; b++)
+						toolbarHTML += tinyMCE.getControlHTML(buttons[b]);
 
-			switch ((s.theme_advanced_layout_manager || '').toLowerCase()) {
-				case "rowlayout":
-					ic = t._rowLayout(s, tb, o);
-					break;
+					if (buttons.length > 0) {
+						toolbarHTML += "<br />";
+						deltaHeight -= 23;
+					}
+				}
 
-				case "customlayout":
-					ic = ed.execCallback("theme_advanced_custom_layout", s, tb, o, p);
-					break;
+				// Add accessibility control
+				toolbarHTML += '<a href="#" accesskey="z" onfocus="tinyMCE.getInstanceById(\'' + editorId + '\').getWin().focus();"></a>';
 
-				default:
-					ic = t._simpleLayout(s, tb, o, p);
-			}
+				// Setup template html
+				template['html'] = '<table class="mceEditor" border="0" cellpadding="0" cellspacing="0" width="{$width}" height="{$height}" style="width:{$width_style};height:{$height_style}"><tbody>';
 
-			n = o.targetNode;
+				if (toolbarLocation == "top")
+					template['html'] += '<tr><td dir="ltr" class="mceToolbarTop" align="' + toolbarAlign + '" height="1" nowrap="nowrap"><span id="' + editorId + '_toolbar" class="mceToolbarContainer">' + toolbarHTML + '</span></td></tr>';
 
-			// Add classes to first and last TRs
-			nl = DOM.stdMode ? sc.getElementsByTagName('tr') : sc.rows; // Quick fix for IE 8
-			DOM.addClass(nl[0], 'mceFirst');
-			DOM.addClass(nl[nl.length - 1], 'mceLast');
+				if (statusbarLocation == "top") {
+					template['html'] += '<tr><td class="mceStatusbarTop" height="1">' + statusbarHTML + '</td></tr>';
+					deltaHeight -= 23;
+				}
 
-			// Add classes to first and last TDs
-			each(DOM.select('tr', tb), function(n) {
-				DOM.addClass(n.firstChild, 'mceFirst');
-				DOM.addClass(n.childNodes[n.childNodes.length - 1], 'mceLast');
-			});
+				template['html'] += '<tr><td align="center"><span id="{$editor_id}"></span></td></tr>';
 
-			if (DOM.get(s.theme_advanced_toolbar_container))
-				DOM.get(s.theme_advanced_toolbar_container).appendChild(p);
-			else
-				DOM.insertAfter(p, n);
+				if (toolbarLocation == "bottom")
+					template['html'] += '<tr><td dir="ltr" class="mceToolbarBottom" align="' + toolbarAlign + '" height="1"><span id="' + editorId + '_toolbar" class="mceToolbarContainer">' + toolbarHTML + '</span></td></tr>';
 
-			Event.add(ed.id + '_path_row', 'click', function(e) {
-				e = e.target;
+				// External toolbar changes
+				if (toolbarLocation == "external") {
+					var bod = document.body;
+					var elm = document.createElement ("div");
 
-				if (e.nodeName == 'A') {
-					t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/, '$1'));
+					toolbarHTML = tinyMCE.replaceVar(toolbarHTML, 'style_select_options', styleSelectHTML);
+					toolbarHTML = tinyMCE.applyTemplate(toolbarHTML, {editor_id : editorId});
 
-					return Event.cancel(e);
+					elm.className = "mceToolbarExternal";
+					elm.id = editorId+"_toolbar";
+					elm.innerHTML = '<table width="100%" border="0" align="center"><tr><td align="center">'+toolbarHTML+'</td></tr></table>';
+					bod.appendChild (elm);
+					// bod.style.marginTop = elm.offsetHeight + "px";
+
+					deltaHeight = 0;
+					tinyMCE.getInstanceById(editorId).toolbarElement = elm;
+
+					//template['html'] = '<div id="mceExternalToolbar" align="center" class="mceToolbarExternal"><table width="100%" border="0" align="center"><tr><td align="center">'+toolbarHTML+'</td></tr></table></div>' + template["html"];
+				} else {
+					tinyMCE.getInstanceById(editorId).toolbarElement = null;
 				}
-			});
-/*
-			if (DOM.get(ed.id + '_path_row')) {
-				Event.add(ed.id + '_tbl', 'mouseover', function(e) {
-					var re;
-	
-					e = e.target;
 
-					if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) {
-						re = DOM.get(ed.id + '_path_row');
-						t.lastPath = re.innerHTML;
-						DOM.setHTML(re, e.parentNode.title);
-					}
-				});
+				if (statusbarLocation == "bottom") {
+					template['html'] += '<tr><td class="mceStatusbarBottom" height="1">' + statusbarHTML + '</td></tr>';
+					deltaHeight -= 23;
+				}
 
-				Event.add(ed.id + '_tbl', 'mouseout', function(e) {
-					if (t.lastPath) {
-						DOM.setHTML(ed.id + '_path_row', t.lastPath);
-						t.lastPath = 0;
-					}
-				});
-			}
-*/
+				template['html'] += '</tbody></table>';
+				//"SimpleLayout"
+			break;
 
-			if (!ed.getParam('accessibility_focus'))
-				Event.add(DOM.add(p, 'a', {href : '#'}, '<!-- IE -->'), 'focus', function() {tinyMCE.get(ed.id).focus();});
+			case "RowLayout" : //Container Layout - containers defined in "theme_advanced_containers" are rendered from top to bottom.
+				template['html'] = '<table class="mceEditor" border="0" cellpadding="0" cellspacing="0" width="{$width}" height="{$height}" style="width:{$width}px;height:{$height}px"><tbody>';
 
-			if (s.theme_advanced_toolbar_location == 'external')
-				o.deltaHeight = 0;
+				var containers = tinyMCE.getParam("theme_advanced_containers", "", true, ",");
+				var defaultContainerCSS = tinyMCE.getParam("theme_advanced_containers_default_class", "container");
+				var defaultContainerAlign = tinyMCE.getParam("theme_advanced_containers_default_align", "center");
 
-			t.deltaHeight = o.deltaHeight;
-			o.targetNode = null;
+				//Render Containers:
+				for (var i = 0; i < containers.length; i++)
+				{
+					if (containers[i] == "mceEditor") //Exceptions for mceEditor and ...
+						template['html'] += '<tr><td align="center" class="mceEditor_border"><span id="{$editor_id}"></span></td></tr>';
+					else if (containers[i] == "mceElementpath" || containers[i] == "mceStatusbar") // ... mceElementpath:
+					{
+						var pathClass = "mceStatusbar";
 
-			return {
-				iframeContainer : ic,
-				editorContainer : ed.id + '_parent',
-				sizeContainer : sc,
-				deltaHeight : o.deltaHeight
-			};
-		},
+						if (i == containers.length-1)
+						{
+							pathClass = "mceStatusbarBottom";
+						}
+						else if (i == 0)
+						{
+							pathClass = "mceStatusbar";
+						}
+						else
+						{
+							deltaHeight-=2;
+						}
 
-		getInfo : function() {
-			return {
-				longname : 'Advanced theme',
-				author : 'Moxiecode Systems AB',
-				authorurl : 'http://tinymce.moxiecode.com',
-				version : tinymce.majorVersion + "." + tinymce.minorVersion
-			}
-		},
+						template['html'] += '<tr><td class="' + pathClass + '" height="1">' + statusbarHTML + '</td></tr>';
+						deltaHeight -= 22;
+					} else { // Render normal Container
+						var curContainer = tinyMCE.getParam("theme_advanced_container_"+containers[i], "", true, ',');
+						var curContainerHTML = "";
+						var curAlign = tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_align", defaultContainerAlign);
+						var curCSS = tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_class", defaultContainerCSS);
 
-		resizeBy : function(dw, dh) {
-			var e = DOM.get(this.editor.id + '_tbl');
+						curContainer = removeFromArray(curContainer, tinyMCE.getParam("theme_advanced_disable", "", true, ','));
 
-			this.resizeTo(e.clientWidth + dw, e.clientHeight + dh);
-		},
+						for (var j=0; j<curContainer.length; j++)
+							curContainerHTML += tinyMCE.getControlHTML(curContainer[j]);
 
-		resizeTo : function(w, h) {
-			var ed = this.editor, s = this.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr');
+						if (curContainer.length > 0) {
+							curContainerHTML += "<br />";
+							deltaHeight -= 23;
+						}
 
-			// Boundery fix box
-			w = Math.max(s.theme_advanced_resizing_min_width || 100, w);
-			h = Math.max(s.theme_advanced_resizing_min_height || 100, h);
-			w = Math.min(s.theme_advanced_resizing_max_width || 0xFFFF, w);
-			h = Math.min(s.theme_advanced_resizing_max_height || 0xFFFF, h);
+						template['html'] += '<tr><td class="' + curCSS + '" align="' + curAlign + '" height="1">' + curContainerHTML + '</td></tr>';
+					}
+				}
 
-			// Resize iframe and container
-			DOM.setStyle(e, 'height', '');
-			DOM.setStyle(ifr, 'height', h);
+				template['html'] += '</tbody></table>';
+				//RowLayout
+			break;
 
-			if (s.theme_advanced_resize_horizontal) {
-				DOM.setStyle(e, 'width', '');
-				DOM.setStyle(ifr, 'width', w);
+			case "CustomLayout" : //User defined layout callback...
+				var customLayout = tinyMCE.getParam("theme_advanced_custom_layout","");
 
-				// Make sure that the size is never smaller than the over all ui
-				if (w < e.clientWidth)
-					DOM.setStyle(ifr, 'width', e.clientWidth);
-			}
-		},
+				if (customLayout != "" && eval("typeof(" + customLayout + ")") != "undefined") {
+					template = eval(customLayout + "(template);");
+				}
+			break;
+		}
 
-		destroy : function() {
-			var id = this.editor.id;
+		if (resizing)
+			template['html'] += '<span id="{$editor_id}_resize_box" class="mceResizeBox"></span>';
 
-			Event.clear(id + '_resize');
-			Event.clear(id + '_path_row');
-			Event.clear(id + '_external_close');
-		},
+		template['html'] = tinyMCE.replaceVar(template['html'], 'style_select_options', styleSelectHTML);
 
-		// Internal functions
+		// Set to default values
+		if (!template['delta_width'])
+			template['delta_width'] = 0;
 
-		_simpleLayout : function(s, tb, o, p) {
-			var t = this, ed = t.editor, lo = s.theme_advanced_toolbar_location, sl = s.theme_advanced_statusbar_location, n, ic, etb, c;
+		if (!template['delta_height'])
+			template['delta_height'] = deltaHeight;
 
-			if (s.readonly) {
-				n = DOM.add(tb, 'tr');
-				n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});
-				return ic;
+		return template;
+	},
+
+	initInstance : function(inst) {
+		if (tinyMCE.getParam("theme_advanced_resizing", false)) {
+			if (tinyMCE.getParam("theme_advanced_resizing_use_cookie", true)) {
+				var w = TinyMCE_AdvancedTheme._getCookie("TinyMCE_" + inst.editorId + "_width");
+				var h = TinyMCE_AdvancedTheme._getCookie("TinyMCE_" + inst.editorId + "_height");
+
+				TinyMCE_AdvancedTheme._resizeTo(inst, w, h, tinyMCE.getParam("theme_advanced_resize_horizontal", true));
 			}
+		}
 
-			// Create toolbar container at top
-			if (lo == 'top')
-				t._addToolbars(tb, o);
+		inst.addShortcut('ctrl', 'k', 'lang_link_desc', 'mceLink');
+	},
 
-			// Create external toolbar
-			if (lo == 'external') {
-				n = c = DOM.create('div', {style : 'position:relative'});
-				n = DOM.add(n, 'div', {id : ed.id + '_external', 'class' : 'mceExternalToolbar'});
-				DOM.add(n, 'a', {id : ed.id + '_external_close', href : 'javascript:;', 'class' : 'mceExternalClose'});
-				n = DOM.add(n, 'table', {id : ed.id + '_tblext', cellSpacing : 0, cellPadding : 0});
-				etb = DOM.add(n, 'tbody');
+	removeInstance : function(inst) {
+		new TinyMCE_Layer(inst.editorId + '_fcMenu').remove();
+		new TinyMCE_Layer(inst.editorId + '_bcMenu').remove();
+	},
 
-				if (p.firstChild.className == 'mceOldBoxModel')
-					p.firstChild.appendChild(c);
-				else
-					p.insertBefore(c, p.firstChild);
+	hideInstance : function(inst) {
+		TinyMCE_AdvancedTheme._hideMenus(inst.editorId);
+	},
 
-				t._addToolbars(etb, o);
+	_handleMenuEvent : function(e) {
+		var te = tinyMCE.isMSIE ? window.event.srcElement : e.target;
+		tinyMCE._menuButtonEvent(e.type == "mouseover" ? "over" : "out", document.getElementById(te._switchId));
 
-				ed.onMouseUp.add(function() {
-					var e = DOM.get(ed.id + '_external');
-					DOM.show(e);
+		if (e.type == "click")
+			tinyMCE.execInstanceCommand(te._editor_id, te._command);
+	},
 
-					DOM.hide(lastExtID);
+	_hideMenus : function(id) {
+		var fcml = new TinyMCE_Layer(id + '_fcMenu'), bcml = new TinyMCE_Layer(id + '_bcMenu');
 
-					var f = Event.add(ed.id + '_external_close', 'click', function() {
-						DOM.hide(ed.id + '_external');
-						Event.remove(ed.id + '_external_close', 'click', f);
-					});
+		if (fcml.exists() && fcml.isVisible()) {
+			tinyMCE.switchClass(id + '_forecolor', 'mceMenuButton');
+			fcml.hide();
+		}
 
-					DOM.show(e);
-					DOM.setStyle(e, 'top', 0 - DOM.getRect(ed.id + '_tblext').h - 1);
+		if (bcml.exists() && bcml.isVisible()) {
+			tinyMCE.switchClass(id + '_backcolor', 'mceMenuButton');
+			bcml.hide();
+		}
+	},
 
-					// Fixes IE rendering bug
-					DOM.hide(e);
-					DOM.show(e);
-					e.style.filter = '';
+	/**
+	 * Node change handler.
+	 */
+	handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection, setup_content) {
+		var alignNode, breakOut, classNode;
 
-					lastExtID = ed.id + '_external';
+		function selectByValue(select_elm, value, first_index) {
+			first_index = typeof(first_index) == "undefined" ? false : true;
 
-					e = null;
-				});
-			}
+			if (select_elm) {
+				for (var i=0; i<select_elm.options.length; i++) {
+					var ov = "" + select_elm.options[i].value;
 
-			if (sl == 'top')
-				t._addStatusBar(tb, o);
+					if (first_index && ov.toLowerCase().indexOf(value.toLowerCase()) == 0) {
+						select_elm.selectedIndex = i;
+						return true;
+					}
 
-			// Create iframe container
-			if (!s.theme_advanced_toolbar_container) {
-				n = DOM.add(tb, 'tr');
-				n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});
+					if (ov == value) {
+						select_elm.selectedIndex = i;
+						return true;
+					}
+				}
 			}
 
-			// Create toolbar container at bottom
-			if (lo == 'bottom')
-				t._addToolbars(tb, o);
+			return false;
+		};
 
-			if (sl == 'bottom')
-				t._addStatusBar(tb, o);
+		// No node provided
+		if (node == null)
+			return;
 
-			return ic;
-		},
+		// Update path
+		var pathElm = document.getElementById(editor_id + "_path");
+		var inst = tinyMCE.getInstanceById(editor_id);
+		var doc = inst.getDoc();
+		TinyMCE_AdvancedTheme._hideMenus(editor_id);
 
-		_rowLayout : function(s, tb, o) {
-			var t = this, ed = t.editor, dc, da, cf = ed.controlManager, n, ic, to, a;
+		if (pathElm) {
+			// Get node path
+			var parentNode = node;
+			var path = new Array();
+			
+			while (parentNode != null) {
+				if (parentNode.nodeName.toUpperCase() == "BODY") {
+					break;
+				}
 
-			dc = s.theme_advanced_containers_default_class || '';
-			da = s.theme_advanced_containers_default_align || 'center';
+				// Only append element nodes to path
+				if (parentNode.nodeType == 1 && tinyMCE.getAttrib(parentNode, "class").indexOf('mceItemHidden') == -1) {
+					path[path.length] = parentNode;
+				}
 
-			each(explode(s.theme_advanced_containers || ''), function(c, i) {
-				var v = s['theme_advanced_container_' + c] || '';
+				parentNode = parentNode.parentNode;
+			}
 
-				switch (v.toLowerCase()) {
-					case 'mceeditor':
-						n = DOM.add(tb, 'tr');
-						n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});
-						break;
+			// Setup HTML
+			var html = "";
+			for (var i=path.length-1; i>=0; i--) {
+				var nodeName = path[i].nodeName.toLowerCase();
+				var nodeData = "";
 
-					case 'mceelementpath':
-						t._addStatusBar(tb, o);
-						break;
+				if (nodeName.indexOf("html:") == 0)
+					nodeName = nodeName.substring(5);
 
-					default:
-						a = (s['theme_advanced_container_' + c + '_align'] || da).toLowerCase();
-						a = 'mce' + t._ufirst(a);
+				if (nodeName == "b") {
+					nodeName = "strong";
+				}
 
-						n = DOM.add(DOM.add(tb, 'tr'), 'td', {
-							'class' : 'mceToolbar ' + (s['theme_advanced_container_' + c + '_class'] || dc) + ' ' + a || da
-						});
+				if (nodeName == "i") {
+					nodeName = "em";
+				}
 
-						to = cf.createToolbar("toolbar" + i);
-						t._addControls(v, to);
-						DOM.setHTML(n, to.renderHTML());
-						o.deltaHeight -= s.theme_advanced_row_height;
+				if (nodeName == "span") {
+					var cn = tinyMCE.getAttrib(path[i], "class");
+					if (cn != "" && cn.indexOf('mceItem') == -1)
+						nodeData += "class: " + cn + " ";
+
+					var st = tinyMCE.getAttrib(path[i], "style");
+					if (st != "") {
+						st = tinyMCE.serializeStyle(tinyMCE.parseStyle(st));
+						nodeData += "style: " + tinyMCE.xmlEncode(st) + " ";
+					}
 				}
-			});
 
-			return ic;
-		},
+				if (nodeName == "font") {
+					if (tinyMCE.getParam("convert_fonts_to_spans"))
+						nodeName = "span";
 
-		_addControls : function(v, tb) {
-			var t = this, s = t.settings, di, cf = t.editor.controlManager;
+					var face = tinyMCE.getAttrib(path[i], "face");
+					if (face != "")
+						nodeData += "font: " + tinyMCE.xmlEncode(face) + " ";
 
-			if (s.theme_advanced_disable && !t._disabled) {
-				di = {};
+					var size = tinyMCE.getAttrib(path[i], "size");
+					if (size != "")
+						nodeData += "size: " + tinyMCE.xmlEncode(size) + " ";
 
-				each(explode(s.theme_advanced_disable), function(v) {
-					di[v] = 1;
-				});
+					var color = tinyMCE.getAttrib(path[i], "color");
+					if (color != "")
+						nodeData += "color: " + tinyMCE.xmlEncode(color) + " ";
+				}
 
-				t._disabled = di;
-			} else
-				di = t._disabled;
+				if (tinyMCE.getAttrib(path[i], 'id') != "") {
+					nodeData += "id: " + path[i].getAttribute('id') + " ";
+				}
 
-			each(explode(v), function(n) {
-				var c;
+				var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i], "class"), false);
+				if (className != "" && className.indexOf('mceItem') == -1)
+					nodeData += "class: " + className + " ";
 
-				if (di && di[n])
-					return;
+				if (tinyMCE.getAttrib(path[i], 'src') != "") {
+					var src = tinyMCE.getAttrib(path[i], "mce_src");
 
-				// Compatiblity with 2.x
-				if (n == 'tablecontrols') {
-					each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"], function(n) {
-						n = t.createControl(n, cf);
+					if (src == "")
+						 src = tinyMCE.getAttrib(path[i], "src");
 
-						if (n)
-							tb.add(n);
-					});
-
-					return;
+					nodeData += "src: " + tinyMCE.xmlEncode(src) + " ";
 				}
 
-				c = t.createControl(n, cf);
+				if (path[i].nodeName == 'A' && tinyMCE.getAttrib(path[i], 'href') != "") {
+					var href = tinyMCE.getAttrib(path[i], "mce_href");
 
-				if (c)
-					tb.add(c);
-			});
-		},
+					if (href == "")
+						 href = tinyMCE.getAttrib(path[i], "href");
 
-		_addToolbars : function(c, o) {
-			var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a;
+					nodeData += "href: " + tinyMCE.xmlEncode(href) + " ";
+				}
 
-			a = s.theme_advanced_toolbar_align.toLowerCase();
-			a = 'mce' + t._ufirst(a);
+				className = tinyMCE.getAttrib(path[i], "class");
+				if ((nodeName == "img" || nodeName == "span") && className.indexOf('mceItem') != -1) {
+					nodeName = className.replace(/mceItem([a-z]+)/gi, '$1').toLowerCase();
+					nodeData = path[i].getAttribute('title');
+				}
 
-			n = DOM.add(DOM.add(c, 'tr'), 'td', {'class' : 'mceToolbar ' + a});
+				if (nodeName == "a" && (anchor = tinyMCE.getAttrib(path[i], "name")) != "") {
+					nodeName = "a";
+					nodeName += "#" + tinyMCE.xmlEncode(anchor);
+					nodeData = "";
+				}
 
-			if (!ed.getParam('accessibility_focus'))
-				h.push(DOM.createHTML('a', {href : '#', onfocus : 'tinyMCE.get(\'' + ed.id + '\').focus();'}, '<!-- IE -->'));
+				if (tinyMCE.getAttrib(path[i], 'name').indexOf("mce_") != 0) {
+					var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i], "class"), false);
+					if (className != "" && className.indexOf('mceItem') == -1) {
+						nodeName += "." + className;
+					}
+				}
 
-			h.push(DOM.createHTML('a', {href : '#', accesskey : 'q', title : ed.getLang("advanced.toolbar_focus")}, '<!-- IE -->'));
+				var cmd = 'tinyMCE.execInstanceCommand(\'' + editor_id + '\',\'mceSelectNodeDepth\',false,\'' + i + '\');';
+				html += '<a title="' + nodeData + '" href="javascript:' + cmd + '" onclick="' + cmd + 'return false;" onmousedown="return false;" target="_self" class="mcePathItem">' + nodeName + '</a>';
 
-			// Create toolbar and add the controls
-			for (i=1; (v = s['theme_advanced_buttons' + i]); i++) {
-				tb = cf.createToolbar("toolbar" + i, {'class' : 'mceToolbarRow' + i});
+				if (i > 0) {
+					html += " » ";
+				}
+			}
 
-				if (s['theme_advanced_buttons' + i + '_add'])
-					v += ',' + s['theme_advanced_buttons' + i + '_add'];
+			pathElm.innerHTML = '<a href="#" accesskey="x"></a>' + tinyMCE.getLang('lang_theme_path') + ": " + html + ' ';
+		}
 
-				if (s['theme_advanced_buttons' + i + '_add_before'])
-					v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v;
+		// Reset old states
+		tinyMCE.switchClass(editor_id + '_justifyleft', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_justifyright', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_justifycenter', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_justifyfull', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_bold', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_italic', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_underline', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_strikethrough', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_bullist', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_numlist', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_sub', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_sup', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_anchor', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_link', 'mceButtonDisabled');
+		tinyMCE.switchClass(editor_id + '_unlink', 'mceButtonDisabled');
+		tinyMCE.switchClass(editor_id + '_outdent', 'mceButtonDisabled');
+		tinyMCE.switchClass(editor_id + '_image', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_hr', 'mceButtonNormal');
 
-				t._addControls(v, tb);
+		if (node.nodeName == "A" && tinyMCE.getAttrib(node, "class").indexOf('mceItemAnchor') != -1)
+			tinyMCE.switchClass(editor_id + '_anchor', 'mceButtonSelected');
 
-				//n.appendChild(n = tb.render());
-				h.push(tb.renderHTML());
+		// Get link
+		var anchorLink = tinyMCE.getParentElement(node, "a", "href");
 
-				o.deltaHeight -= s.theme_advanced_row_height;
-			}
+		if (anchorLink || any_selection) {
+			tinyMCE.switchClass(editor_id + '_link', anchorLink ? 'mceButtonSelected' : 'mceButtonNormal');
+			tinyMCE.switchClass(editor_id + '_unlink', anchorLink ? 'mceButtonSelected' : 'mceButtonNormal');
+		}
 
-			h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '<!-- IE -->'));
-			DOM.setHTML(n, h.join(''));
-		},
+		// Handle visual aid
+		tinyMCE.switchClass(editor_id + '_visualaid', visual_aid ? 'mceButtonSelected' : 'mceButtonNormal');
 
-		_addStatusBar : function(tb, o) {
-			var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td;
+		if (undo_levels != -1) {
+			tinyMCE.switchClass(editor_id + '_undo', 'mceButtonDisabled');
+			tinyMCE.switchClass(editor_id + '_redo', 'mceButtonDisabled');
+		}
 
-			n = DOM.add(tb, 'tr');
-			n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'});
-			n = DOM.add(n, 'div', {id : ed.id + '_path_row'}, s.theme_advanced_path ? ed.translate('advanced.path') + ': ' : ' ');
-			DOM.add(n, 'a', {href : '#', accesskey : 'x'});
+		// Within li, blockquote
+		if (tinyMCE.getParentElement(node, "li,blockquote"))
+			tinyMCE.switchClass(editor_id + '_outdent', 'mceButtonNormal');
 
-			if (s.theme_advanced_resizing) {
-				DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize'});
+		// Has redo levels
+		if (undo_index != -1 && (undo_index < undo_levels-1 && undo_levels > 0))
+			tinyMCE.switchClass(editor_id + '_redo', 'mceButtonNormal');
 
-				if (s.theme_advanced_resizing_use_cookie) {
-					ed.onPostRender.add(function() {
-						var o = Cookie.getHash("TinyMCE_" + ed.id + "_size"), c = DOM.get(ed.id + '_tbl');
+		// Has undo levels
+		if (undo_index != -1 && (undo_index > 0 && undo_levels > 0))
+			tinyMCE.switchClass(editor_id + '_undo', 'mceButtonNormal');
 
-						if (!o)
-							return;
+		// Select class in select box
+		var selectElm = document.getElementById(editor_id + "_styleSelect");
+		
+		if (selectElm) {
+			TinyMCE_AdvancedTheme._setupCSSClasses(editor_id);
 
-						t.resizeTo(o.cw, o.ch);
-					});
+			classNode = node;
+			breakOut = false;
+			var index = 0;
+
+			do {
+				if (classNode && classNode.className) {
+					for (var i=0; i<selectElm.options.length; i++) {
+						if (selectElm.options[i].value == classNode.className) {
+							index = i;
+							breakOut = true;
+							break;
+						}
+					}
 				}
+			} while (!breakOut && classNode != null && (classNode = classNode.parentNode) != null);
 
-				ed.onPostRender.add(function() {
-					Event.add(ed.id + '_resize', 'mousedown', function(e) {
-						var mouseMoveHandler1, mouseMoveHandler2,
-							mouseUpHandler1, mouseUpHandler2,
-							startX, startY, startWidth, startHeight, width, height, ifrElm;
+			selectElm.selectedIndex = index;
+		}
 
-						function resizeOnMove(e) {
-							width = startWidth + (e.screenX - startX);
-							height = startHeight + (e.screenY - startY);
+		// Select formatblock
+		var selectElm = document.getElementById(editor_id + "_formatSelect");
+		if (selectElm) {
+			var elm = tinyMCE.getParentElement(node, "p,div,h1,h2,h3,h4,h5,h6,pre,address");
 
-							t.resizeTo(width, height);
-						};
+			if (elm)
+				selectByValue(selectElm, "<" + elm.nodeName.toLowerCase() + ">");
+			else
+				selectByValue(selectElm, "");
+		}
 
-						function endResize(e) {
-							// Stop listening
-							Event.remove(DOM.doc, 'mousemove', mouseMoveHandler1);
-							Event.remove(ed.getDoc(), 'mousemove', mouseMoveHandler2);
-							Event.remove(DOM.doc, 'mouseup', mouseUpHandler1);
-							Event.remove(ed.getDoc(), 'mouseup', mouseUpHandler2);
+		// Select fontselect
+		var selectElm = document.getElementById(editor_id + "_fontNameSelect");
+		if (selectElm) {
+			if (!tinyMCE.isSafari && !(tinyMCE.isMSIE && !tinyMCE.isOpera)) {
+				var face = inst.queryCommandValue('FontName');
 
-							// Store away the size
-							if (s.theme_advanced_resizing_use_cookie) {
-								Cookie.setHash("TinyMCE_" + ed.id + "_size", {
-									cw : width,
-									ch : height
-								});
-							}
-						};
+				face = face == null || face == "" ? "" : face;
 
-						e.preventDefault();
+				selectByValue(selectElm, face, face != "");
+			} else {
+				var elm = tinyMCE.getParentElement(node, "font", "face");
 
-						// Get the current rect size
-						startX = e.screenX;
-						startY = e.screenY;
-						ifrElm = DOM.get(t.editor.id + '_ifr');
-						startWidth = width = ifrElm.clientWidth;
-						startHeight = height = ifrElm.clientHeight;
+				if (elm) {
+					var family = tinyMCE.getAttrib(elm, "face");
 
-						// Register envent handlers
-						mouseMoveHandler1 = Event.add(DOM.doc, 'mousemove', resizeOnMove);
-						mouseMoveHandler2 = Event.add(ed.getDoc(), 'mousemove', resizeOnMove);
-						mouseUpHandler1 = Event.add(DOM.doc, 'mouseup', endResize);
-						mouseUpHandler2 = Event.add(ed.getDoc(), 'mouseup', endResize);
-					});
-				});
+					if (family == '')
+						family = '' + elm.style.fontFamily;
+
+					if (!selectByValue(selectElm, family, family != ""))
+						selectByValue(selectElm, "");
+				} else
+					selectByValue(selectElm, "");
 			}
+		}
 
-			o.deltaHeight -= 21;
-			n = tb = null;
-		},
+		// Select fontsize
+		var selectElm = document.getElementById(editor_id + "_fontSizeSelect");
+		if (selectElm) {
+			if (!tinyMCE.isSafari && !tinyMCE.isOpera) {
+				var size = inst.queryCommandValue('FontSize');
+				selectByValue(selectElm, size == null || size == "" ? "0" : size);
+			} else {
+				var elm = tinyMCE.getParentElement(node, "font", "size");
+				if (elm) {
+					var size = tinyMCE.getAttrib(elm, "size");
 
-		_nodeChanged : function(ed, cm, n, co, ob) {
-			var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn, formatNames, matches;
+					if (size == '') {
+						var sizes = new Array('', '8px', '10px', '12px', '14px', '18px', '24px', '36px');
 
-			tinymce.each(t.stateControls, function(c) {
-				cm.setActive(c, ed.queryCommandState(t.controls[c][1]));
-			});
+						size = '' + elm.style.fontSize;
 
-			function getParent(name) {
-				var i, parents = ob.parents, func = name;
+						for (var i=0; i<sizes.length; i++) {
+							if (('' + sizes[i]) == size) {
+								size = i;
+								break;
+							}
+						}
+					}
 
-				if (typeof(name) == 'string') {
-					func = function(node) {
-						return node.nodeName == name;
-					};
-				}
+					if (!selectByValue(selectElm, size))
+						selectByValue(selectElm, "");
+				} else
+					selectByValue(selectElm, "0");
+			}
+		}
 
-				for (i = 0; i < parents.length; i++) {
-					if (func(parents[i]))
-						return parents[i];
-				}
-			};
+		// Handle align attributes
+		alignNode = node;
+		breakOut = false;
+		do {
+			if (!alignNode.getAttribute || !alignNode.getAttribute('align'))
+				continue;
 
-			cm.setActive('visualaid', ed.hasVisual);
-			cm.setDisabled('undo', !ed.undoManager.hasUndo() && !ed.typing);
-			cm.setDisabled('redo', !ed.undoManager.hasRedo());
-			cm.setDisabled('outdent', !ed.queryCommandState('Outdent'));
+			switch (alignNode.getAttribute('align').toLowerCase()) {
+				case "left":
+					tinyMCE.switchClass(editor_id + '_justifyleft', 'mceButtonSelected');
+					breakOut = true;
+				break;
 
-			p = getParent('A');
-			if (c = cm.get('link')) {
-				if (!p || !p.name) {
-					c.setDisabled(!p && co);
-					c.setActive(!!p);
-				}
-			}
+				case "right":
+					tinyMCE.switchClass(editor_id + '_justifyright', 'mceButtonSelected');
+					breakOut = true;
+				break;
 
-			if (c = cm.get('unlink')) {
-				c.setDisabled(!p && co);
-				c.setActive(!!p && !p.name);
+				case "middle":
+				case "center":
+					tinyMCE.switchClass(editor_id + '_justifycenter', 'mceButtonSelected');
+					breakOut = true;
+				break;
+
+				case "justify":
+					tinyMCE.switchClass(editor_id + '_justifyfull', 'mceButtonSelected');
+					breakOut = true;
+				break;
 			}
+		} while (!breakOut && (alignNode = alignNode.parentNode) != null);
 
-			if (c = cm.get('anchor')) {
-				c.setActive(!!p && p.name);
+		// Div justification
+		var div = tinyMCE.getParentElement(node, "div");
+		if (div && div.style.textAlign == "center")
+			tinyMCE.switchClass(editor_id + '_justifycenter', 'mceButtonSelected');
+
+		// Do special text
+		if (!setup_content) {
+			// , "JustifyLeft", "_justifyleft", "JustifyCenter", "justifycenter", "JustifyRight", "justifyright", "JustifyFull", "justifyfull", "InsertUnorderedList", "bullist", "InsertOrderedList", "numlist", "InsertUnorderedList", "bullist", "Outdent", "outdent", "Indent", "indent", "subscript", "sub"
+			var ar = new Array("Bold", "_bold", "Italic", "_italic", "Strikethrough", "_strikethrough", "superscript", "_sup", "subscript", "_sub");
+			for (var i=0; i<ar.length; i+=2) {
+				if (inst.queryCommandState(ar[i]))
+					tinyMCE.switchClass(editor_id + ar[i+1], 'mceButtonSelected');
 			}
 
-			p = getParent('IMG');
-			if (c = cm.get('image'))
-				c.setActive(!!p && n.className.indexOf('mceItem') == -1);
+			if (inst.queryCommandState("Underline") && (node.parentNode == null || node.parentNode.nodeName != "A"))
+				tinyMCE.switchClass(editor_id + '_underline', 'mceButtonSelected');
+		}
 
-			if (c = cm.get('styleselect')) {
-				t._importClasses();
+		// Handle elements
+		do {
+			switch (node.nodeName) {
+				case "UL":
+					tinyMCE.switchClass(editor_id + '_bullist', 'mceButtonSelected');
+				break;
 
-				formatNames = [];
-				each(c.items, function(item) {
-					formatNames.push(item.value);
-				});
+				case "OL":
+					tinyMCE.switchClass(editor_id + '_numlist', 'mceButtonSelected');
+				break;
 
-				matches = ed.formatter.matchAll(formatNames);
-				c.select(matches[0]);
+				case "HR":
+					 tinyMCE.switchClass(editor_id + '_hr', 'mceButtonSelected');
+				break;
+
+				case "IMG":
+				if (tinyMCE.getAttrib(node, 'name').indexOf('mce_') != 0 && tinyMCE.getAttrib(node, 'class').indexOf('mceItem') == -1) {
+					tinyMCE.switchClass(editor_id + '_image', 'mceButtonSelected');
+				}
+				break;
 			}
+		} while ((node = node.parentNode) != null);
+	},
 
-			if (c = cm.get('formatselect')) {
-				p = getParent(DOM.isBlock);
+	// Private theme internal functions
 
-				if (p)
-					c.select(p.nodeName.toLowerCase());
+	// This function auto imports CSS classes into the class selection droplist
+	_setupCSSClasses : function(editor_id) {
+		var i, selectElm;
+
+		if (!TinyMCE_AdvancedTheme._autoImportCSSClasses)
+			return;
+
+		selectElm = document.getElementById(editor_id + '_styleSelect');
+
+		if (selectElm && selectElm.getAttribute('cssImported') != 'true') {
+			var csses = tinyMCE.getCSSClasses(editor_id);
+			if (csses && selectElm)	{
+				for (i=0; i<csses.length; i++)
+					selectElm.options[selectElm.options.length] = new Option(csses[i], csses[i]);
 			}
 
-			// Find out current fontSize, fontFamily and fontClass
-			getParent(function(n) {
-				if (n.nodeName === 'SPAN') {
-					if (!cl && n.className)
-						cl = n.className;
+			// Only do this once
+			if (csses != null && csses.length > 0)
+				selectElm.setAttribute('cssImported', 'true');
+		}
+	},
 
-					if (!fz && n.style.fontSize)
-						fz = n.style.fontSize;
+	_setCookie : function(name, value, expires, path, domain, secure) {
+		var curCookie = name + "=" + escape(value) +
+			((expires) ? "; expires=" + expires.toGMTString() : "") +
+			((path) ? "; path=" + escape(path) : "") +
+			((domain) ? "; domain=" + domain : "") +
+			((secure) ? "; secure" : "");
 
-					if (!fn && n.style.fontFamily)
-						fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase();
-				}
+		document.cookie = curCookie;
+	},
 
-				return false;
-			});
+	_getCookie : function(name) {
+		var dc = document.cookie;
+		var prefix = name + "=";
+		var begin = dc.indexOf("; " + prefix);
 
-			if (c = cm.get('fontselect')) {
-				c.select(function(v) {
-					return v.replace(/^([^,]+).*/, '$1').toLowerCase() == fn;
-				});
-			}
+		if (begin == -1) {
+			begin = dc.indexOf(prefix);
 
-			// Select font size
-			if (c = cm.get('fontsizeselect')) {
-				// Use computed style
-				if (s.theme_advanced_runtime_fontsize && !fz && !cl)
-					fz = ed.dom.getStyle(n, 'fontSize', true);
+			if (begin != 0)
+				return null;
+		} else
+			begin += 2;
 
-				c.select(function(v) {
-					if (v.fontSize && v.fontSize === fz)
-						return true;
+		var end = document.cookie.indexOf(";", begin);
 
-					if (v['class'] && v['class'] === cl)
-						return true;
-				});
-			}
+		if (end == -1)
+			end = dc.length;
 
-			if (s.theme_advanced_path && s.theme_advanced_statusbar_location) {
-				p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'});
-				DOM.setHTML(p, '');
+		return unescape(dc.substring(begin + prefix.length, end));
+	},
 
-				getParent(function(n) {
-					var na = n.nodeName.toLowerCase(), u, pi, ti = '';
+	_resizeTo : function(inst, w, h, set_w) {
+		var editorContainer = document.getElementById(inst.editorId + '_parent');
+		var tableElm = editorContainer.firstChild;
+		var iframe = inst.iframeElement;
 
-					/*if (n.getAttribute('_mce_bogus'))
-						return;
-*/
-					// Ignore non element and hidden elements
-					if (n.nodeType != 1 || n.nodeName === 'BR' || (DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved')))
-						return;
+		if (w == null || w == "null") {
+			set_w = false;
+			w = 0;
+		}
 
-					// Fake name
-					if (v = DOM.getAttrib(n, 'mce_name'))
-						na = v;
+		if (h == null || h == "null")
+			return;
 
-					// Handle prefix
-					if (tinymce.isIE && n.scopeName !== 'HTML')
-						na = n.scopeName + ':' + na;
+		w = parseInt(w);
+		h = parseInt(h);
 
-					// Remove internal prefix
-					na = na.replace(/mce\:/g, '');
+		if (tinyMCE.isGecko) {
+			w += 2;
+			h += 2;
+		}
 
-					// Handle node name
-					switch (na) {
-						case 'b':
-							na = 'strong';
-							break;
+		var dx = w - tableElm.clientWidth;
+		var dy = h - tableElm.clientHeight;
 
-						case 'i':
-							na = 'em';
-							break;
+		w = w < 1 ? 30 : w;
+		h = h < 1 ? 30 : h;
 
-						case 'img':
-							if (v = DOM.getAttrib(n, 'src'))
-								ti += 'src: ' + v + ' ';
+		if (set_w)
+			tableElm.style.width = w + "px";
 
-							break;
+		tableElm.style.height = h + "px";
 
-						case 'a':
-							if (v = DOM.getAttrib(n, 'name')) {
-								ti += 'name: ' + v + ' ';
-								na += '#' + v;
-							}
+		iw = iframe.clientWidth + dx;
+		ih = iframe.clientHeight + dy;
 
-							if (v = DOM.getAttrib(n, 'href'))
-								ti += 'href: ' + v + ' ';
+		iw = iw < 1 ? 30 : iw;
+		ih = ih < 1 ? 30 : ih;
 
-							break;
+		if (tinyMCE.isGecko) {
+			iw -= 2;
+			ih -= 2;
+		}
 
-						case 'font':
-							if (v = DOM.getAttrib(n, 'face'))
-								ti += 'font: ' + v + ' ';
+		if (set_w)
+			iframe.style.width = iw + "px";
 
-							if (v = DOM.getAttrib(n, 'size'))
-								ti += 'size: ' + v + ' ';
+		iframe.style.height = ih + "px";
 
-							if (v = DOM.getAttrib(n, 'color'))
-								ti += 'color: ' + v + ' ';
+		// Is it to small, make it bigger again
+		if (set_w) {
+			var tableBodyElm = tableElm.firstChild;
+			var minIframeWidth = tableBodyElm.scrollWidth;
+			if (inst.iframeElement.clientWidth < minIframeWidth) {
+				dx = minIframeWidth - inst.iframeElement.clientWidth;
 
-							break;
+				inst.iframeElement.style.width = (iw + dx) + "px";
+			}
+		}
 
-						case 'span':
-							if (v = DOM.getAttrib(n, 'style'))
-								ti += 'style: ' + v + ' ';
+		// Remove pesky table controls
+		inst.useCSS = false;
+	},
 
-							break;
-					}
+	/**
+	 * Handles resizing events.
+	 */
+	_resizeEventHandler : function(e) {
+		var resizer = TinyMCE_AdvancedTheme._resizer;
 
-					if (v = DOM.getAttrib(n, 'id'))
-						ti += 'id: ' + v + ' ';
+		// Do nothing
+		if (!resizer.resizing)
+			return;
 
-					if (v = n.className) {
-						v = v.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g, '')
+		e = typeof(e) == "undefined" ? window.event : e;
 
-						if (v) {
-							ti += 'class: ' + v + ' ';
+		var dx = e.screenX - resizer.downX;
+		var dy = e.screenY - resizer.downY;
+		var resizeBox = resizer.resizeBox;
+		var editorId = resizer.editorId;
 
-							if (DOM.isBlock(n) || na == 'img' || na == 'span')
-								na += '.' + v;
-						}
-					}
+		switch (e.type) {
+			case "mousemove":
+				var w, h;
 
-					na = na.replace(/(html:)/g, '');
-					na = {name : na, node : n, title : ti};
-					t.onResolveName.dispatch(t, na);
-					ti = na.title;
-					na = na.name;
+				w = resizer.width + dx;
+				h = resizer.height + dy;
 
-					//u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');";
-					pi = DOM.create('a', {'href' : "javascript:;", onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na);
+				w = w < 1 ? 1 : w;
+				h = h < 1 ? 1 : h;
 
-					if (p.hasChildNodes()) {
-						p.insertBefore(DOM.doc.createTextNode(' \u00bb '), p.firstChild);
-						p.insertBefore(pi, p.firstChild);
-					} else
-						p.appendChild(pi);
-				}, ed.getBody());
+				if (resizer.horizontal)
+					resizeBox.style.width = w + "px";
+
+				resizeBox.style.height = h + "px";
+				break;
+
+			case "mouseup":
+				TinyMCE_AdvancedTheme._setResizing(e, editorId, false);
+				TinyMCE_AdvancedTheme._resizeTo(tinyMCE.getInstanceById(editorId), resizer.width + dx, resizer.height + dy, resizer.horizontal);
+
+				// Expire in a month
+				if (tinyMCE.getParam("theme_advanced_resizing_use_cookie", true)) {
+					var expires = new Date();
+					expires.setTime(expires.getTime() + 3600000 * 24 * 30);
+
+					// Set the cookies
+					TinyMCE_AdvancedTheme._setCookie("TinyMCE_" + editorId + "_width", "" + (resizer.horizontal ? resizer.width + dx : ""), expires);
+					TinyMCE_AdvancedTheme._setCookie("TinyMCE_" + editorId + "_height", "" + (resizer.height + dy), expires);
+				}
+				break;
+		}
+	},
+
+	/**
+	 * Starts/stops the editor resizing.
+	 */
+	_setResizing : function(e, editor_id, state) {
+		e = typeof(e) == "undefined" ? window.event : e;
+
+		var resizer = TinyMCE_AdvancedTheme._resizer;
+		var editorContainer = document.getElementById(editor_id + '_parent');
+		var editorArea = document.getElementById(editor_id + '_parent').firstChild;
+		var resizeBox = document.getElementById(editor_id + '_resize_box');
+		var inst = tinyMCE.getInstanceById(editor_id);
+
+		if (state) {
+			// Place box over editor area
+			var width = editorArea.clientWidth;
+			var height = editorArea.clientHeight;
+
+			resizeBox.style.width = width + "px";
+			resizeBox.style.height = height + "px";
+
+			resizer.iframeWidth = inst.iframeElement.clientWidth;
+			resizer.iframeHeight = inst.iframeElement.clientHeight;
+
+			// Hide editor and show resize box
+			editorArea.style.display = "none";
+			resizeBox.style.display = "block";
+
+			// Add event handlers, only once
+			if (!resizer.eventHandlers) {
+				if (tinyMCE.isMSIE)
+					tinyMCE.addEvent(document, "mousemove", TinyMCE_AdvancedTheme._resizeEventHandler);
+				else
+					tinyMCE.addEvent(window, "mousemove", TinyMCE_AdvancedTheme._resizeEventHandler);
+
+				tinyMCE.addEvent(document, "mouseup", TinyMCE_AdvancedTheme._resizeEventHandler);
+
+				resizer.eventHandlers = true;
 			}
-		},
 
-		// Commands gets called by execCommand
+			resizer.resizing = true;
+			resizer.downX = e.screenX;
+			resizer.downY = e.screenY;
+			resizer.width = parseInt(resizeBox.style.width);
+			resizer.height = parseInt(resizeBox.style.height);
+			resizer.editorId = editor_id;
+			resizer.resizeBox = resizeBox;
+			resizer.horizontal = tinyMCE.getParam("theme_advanced_resize_horizontal", true);
+		} else {
+			resizer.resizing = false;
+			resizeBox.style.display = "none";
+			editorArea.style.display = tinyMCE.isMSIE && !tinyMCE.isOpera ? "block" : "table";
+			tinyMCE.execCommand('mceResetDesignMode');
+		}
+	},
 
-		_sel : function(v) {
-			this.editor.execCommand('mceSelectNodeDepth', false, v);
-		},
+	_getColorHTML : function(id, n, cm) {
+		var i, h, cl;
 
-		_mceInsertAnchor : function(ui, v) {
-			var ed = this.editor;
+		h = '<span class="mceMenuLine"></span>';
+		cl = tinyMCE.getParam(n, TinyMCE_AdvancedTheme._defColors).split(',');
 
-			ed.windowManager.open({
-				url : this.url + '/anchor.htm',
-				width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)),
-				height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)),
-				inline : true
-			}, {
-				theme_url : this.url
-			});
-		},
+		h += '<table class="mceColors"><tr>';
+		for (i=0; i<cl.length; i++) {
+			c = 'tinyMCE.execInstanceCommand(\'' + id + '\', \'' + cm + '\', false, \'#' + cl[i] + '\');';
+			h += '<td><a href="javascript:' + c + '" style="background-color: #' + cl[i] + '" onclick="' + c + ';return false;"></a></td>';
 
-		_mceCharMap : function() {
-			var ed = this.editor;
+			if ((i+1) % 8 == 0)
+				h += '</tr><tr>';
+		}
 
-			ed.windowManager.open({
-				url : this.url + '/charmap.htm',
-				width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)),
-				height : 250 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)),
-				inline : true
-			}, {
-				theme_url : this.url
-			});
-		},
+		h += '</tr></table>';
 
-		_mceHelp : function() {
-			var ed = this.editor;
+		if (tinyMCE.getParam("theme_advanced_more_colors", true))
+			h += '<a href="javascript:void(0);" onclick="TinyMCE_AdvancedTheme._pickColor(\'' + id + '\',\'' + cm + '\');" class="mceMoreColors">' + tinyMCE.getLang('lang_more_colors') + '</a>';
 
-			ed.windowManager.open({
-				url : this.url + '/about.htm',
-				width : 480,
-				height : 380,
-				inline : true
-			}, {
-				theme_url : this.url
-			});
-		},
+		return h;
+	},
 
-		_mceColorPicker : function(u, v) {
-			var ed = this.editor;
+	_pickColor : function(id, cm) {
+		var inputColor, inst = tinyMCE.selectedInstance;
 
-			v = v || {};
+		if (cm == 'forecolor' && inst)
+			inputColor = inst.foreColor;
 
-			ed.windowManager.open({
-				url : this.url + '/color_picker.htm',
-				width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)),
-				height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)),
-				close_previous : false,
-				inline : true
-			}, {
-				input_color : v.color,
-				func : v.func,
-				theme_url : this.url
-			});
-		},
+		if ((cm == 'backcolor' || cm == 'HiliteColor') && inst)
+			inputColor = inst.backColor;
 
-		_mceCodeEditor : function(ui, val) {
-			var ed = this.editor;
+		tinyMCE.execCommand('mceColorPicker', true, {color : inputColor, callback : function(c) {
+			tinyMCE.execInstanceCommand(id, cm, false, c);
+		}});
+	},
 
-			ed.windowManager.open({
-				url : this.url + '/source_editor.htm',
-				width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)),
-				height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)),
-				inline : true,
-				resizable : true,
-				maximizable : true
-			}, {
-				theme_url : this.url
-			});
-		},
+	_insertImage : function(src, alt, border, hspace, vspace, width, height, align, title, onmouseover, onmouseout) {
+		tinyMCE.execCommand("mceInsertContent", false, tinyMCE.createTagHTML('img', {
+			src : tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], src), // Force absolute
+			mce_src : src,
+			alt : alt,
+			border : border,
+			hspace : hspace,
+			vspace : vspace,
+			width : width,
+			height : height,
+			align : align,
+			title : title,
+			onmouseover : onmouseover,
+			onmouseout : onmouseout
+		}));
+	},
 
-		_mceImage : function(ui, val) {
-			var ed = this.editor;
+	_insertLink : function(href, target, title, onclick, style_class) {
+		tinyMCE.execCommand('mceBeginUndoLevel');
 
-			// Internal image object like a flash placeholder
-			if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1)
-				return;
+		if (tinyMCE.selectedInstance && tinyMCE.selectedElement && tinyMCE.selectedElement.nodeName.toLowerCase() == "img") {
+			var doc = tinyMCE.selectedInstance.getDoc();
+			var linkElement = tinyMCE.getParentElement(tinyMCE.selectedElement, "a");
+			var newLink = false;
 
-			ed.windowManager.open({
-				url : this.url + '/image.htm',
-				width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)),
-				height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)),
-				inline : true
-			}, {
-				theme_url : this.url
-			});
-		},
+			if (!linkElement) {
+				linkElement = doc.createElement("a");
+				newLink = true;
+			}
 
-		_mceLink : function(ui, val) {
-			var ed = this.editor;
+			var mhref = href;
+			var thref = eval(tinyMCE.settings['urlconverter_callback'] + "(href, linkElement);");
+			mhref = tinyMCE.getParam('convert_urls') ? href : mhref;
 
-			ed.windowManager.open({
-				url : this.url + '/link.htm',
-				width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)),
-				height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)),
-				inline : true
-			}, {
-				theme_url : this.url
-			});
-		},
+			tinyMCE.setAttrib(linkElement, 'href', thref);
+			tinyMCE.setAttrib(linkElement, 'mce_href', mhref);
+			tinyMCE.setAttrib(linkElement, 'target', target);
+			tinyMCE.setAttrib(linkElement, 'title', title);
+			tinyMCE.setAttrib(linkElement, 'onclick', onclick);
+			tinyMCE.setAttrib(linkElement, 'class', style_class);
 
-		_mceNewDocument : function() {
-			var ed = this.editor;
+			if (newLink) {
+				linkElement.appendChild(tinyMCE.selectedElement.cloneNode(true));
+				tinyMCE.selectedElement.parentNode.replaceChild(linkElement, tinyMCE.selectedElement);
+			}
 
-			ed.windowManager.confirm('advanced.newdocument', function(s) {
-				if (s)
-					ed.execCommand('mceSetContent', false, '');
-			});
-		},
+			return;
+		}
 
-		_mceForeColor : function() {
-			var t = this;
+		if (!tinyMCE.linkElement && tinyMCE.selectedInstance) {
+			if (tinyMCE.isSafari) {
+				tinyMCE.execCommand("mceInsertContent", false, '<a href="' + tinyMCE.uniqueURL + '">' + tinyMCE.selectedInstance.selection.getSelectedHTML() + '</a>');
+			} else
+				tinyMCE.selectedInstance.contentDocument.execCommand("createlink", false, tinyMCE.uniqueURL);
 
-			this._mceColorPicker(0, {
-				color: t.fgColor,
-				func : function(co) {
-					t.fgColor = co;
-					t.editor.execCommand('ForeColor', false, co);
-				}
-			});
-		},
+			tinyMCE.linkElement = tinyMCE.getElementByAttributeValue(tinyMCE.selectedInstance.contentDocument.body, "a", "href", tinyMCE.uniqueURL);
 
-		_mceBackColor : function() {
-			var t = this;
+			var elementArray = tinyMCE.getElementsByAttributeValue(tinyMCE.selectedInstance.contentDocument.body, "a", "href", tinyMCE.uniqueURL);
 
-			this._mceColorPicker(0, {
-				color: t.bgColor,
-				func : function(co) {
-					t.bgColor = co;
-					t.editor.execCommand('HiliteColor', false, co);
-				}
-			});
-		},
+			for (var i=0; i<elementArray.length; i++) {
+				var mhref = href;
+				var thref = eval(tinyMCE.settings['urlconverter_callback'] + "(href, elementArray[i]);");
+				mhref = tinyMCE.getParam('convert_urls') ? href : mhref;
 
-		_ufirst : function(s) {
-			return s.substring(0, 1).toUpperCase() + s.substring(1);
+				tinyMCE.setAttrib(elementArray[i], 'href', thref);
+				tinyMCE.setAttrib(elementArray[i], 'mce_href', mhref);
+				tinyMCE.setAttrib(elementArray[i], 'target', target);
+				tinyMCE.setAttrib(elementArray[i], 'title', title);
+				tinyMCE.setAttrib(elementArray[i], 'onclick', onclick);
+				tinyMCE.setAttrib(elementArray[i], 'class', style_class);
+			}
+
+			tinyMCE.linkElement = elementArray[0];
 		}
-	});
 
-	tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme);
-}(tinymce));
\ No newline at end of file
+		if (tinyMCE.linkElement) {
+			var mhref = href;
+			href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement);");
+			mhref = tinyMCE.getParam('convert_urls') ? href : mhref;
+
+			tinyMCE.setAttrib(tinyMCE.linkElement, 'href', href);
+			tinyMCE.setAttrib(tinyMCE.linkElement, 'mce_href', mhref);
+			tinyMCE.setAttrib(tinyMCE.linkElement, 'target', target);
+			tinyMCE.setAttrib(tinyMCE.linkElement, 'title', title);
+			tinyMCE.setAttrib(tinyMCE.linkElement, 'onclick', onclick);
+			tinyMCE.setAttrib(tinyMCE.linkElement, 'class', style_class);
+		}
+
+		tinyMCE.execCommand('mceEndUndoLevel');
+	}
+};
+
+tinyMCE.addTheme("advanced", TinyMCE_AdvancedTheme);
+
+// Add default buttons maps for advanced theme and all internal plugins
+tinyMCE.addButtonMap(TinyMCE_AdvancedTheme._buttonMap);

Modified: plog/trunk/js/tinymce/themes/advanced/image.htm
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/image.htm	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/js/tinymce/themes/advanced/image.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,17 +1,17 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-	<title>{#advanced_dlg.image_title}</title>
-	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
-	<script type="text/javascript" src="../../utils/mctabs.js"></script>
-	<script type="text/javascript" src="../../utils/form_utils.js"></script>
-	<script type="text/javascript" src="js/image.js"></script>
+	<title>{$lang_insert_image_title}</title>
+	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
+	<script language="javascript" type="text/javascript" src="jscripts/image.js"></script>
+	<base target="_self" />
 </head>
-<body id="image" style="display: none">
-<form onsubmit="ImageDialog.update();return false;" action="#">
+<body id="image" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
+<form onsubmit="insertImage();return false;" action="#">
 	<div class="tabs">
 		<ul>
-			<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advanced_dlg.image_title}</a></span></li>
+			<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_insert_image_title}</a></span></li>
 		</ul>
 	</div>
 
@@ -19,61 +19,81 @@
 		<div id="general_panel" class="panel current">
      <table border="0" cellpadding="4" cellspacing="0">
           <tr>
-            <td class="nowrap"><label for="src">{#advanced_dlg.image_src}</label></td>
+            <td nowrap="nowrap"><label for="src">{$lang_insert_image_src}</label></td>
             <td><table border="0" cellspacing="0" cellpadding="0">
                 <tr>
-                  <td><input id="src" name="src" type="text" class="mceFocus" value="" style="width: 200px" onchange="ImageDialog.getImageData();" /></td>
+                  <td><input id="src" name="src" type="text" value="" style="width: 200px" onchange="getImageData();" /></td>
                   <td id="srcbrowsercontainer"> </td>
                 </tr>
               </table></td>
           </tr>
-		  <tr>
-			<td><label for="image_list">{#advanced_dlg.image_list}</label></td>
-			<td><select id="image_list" name="image_list" onchange="document.getElementById('src').value=this.options[this.selectedIndex].value;document.getElementById('alt').value=this.options[this.selectedIndex].text;"></select></td>
-		  </tr>
+		  <!-- Image list -->
+		  <script language="javascript">
+			if (typeof(tinyMCEImageList) != "undefined" && tinyMCEImageList.length > 0) {
+				var html = "";
+
+				html += '<tr><td><label for="image_list">{$lang_image_list}</label></td>';
+				html += '<td><select id="image_list" name="image_list" style="width: 200px" onchange="this.form.src.value=this.options[this.selectedIndex].value;resetImageData();getImageData();">';
+				html += '<option value="">---</option>';
+
+				for (var i=0; i<tinyMCEImageList.length; i++)
+					html += '<option value="' + tinyMCEImageList[i][1] + '">' + tinyMCEImageList[i][0] + '</option>';
+
+				html += '</select></td></tr>';
+
+				document.write(html);
+			}
+		  </script>
+		  <!-- /Image list -->
           <tr>
-            <td class="nowrap"><label for="alt">{#advanced_dlg.image_alt}</label></td>
+            <td nowrap="nowrap"><label for="alt">{$lang_insert_image_alt}</label></td>
             <td><input id="alt" name="alt" type="text" value="" style="width: 200px" /></td>
           </tr>
           <tr>
-            <td class="nowrap"><label for="align">{#advanced_dlg.image_align}</label></td>
-            <td><select id="align" name="align" onchange="ImageDialog.updateStyle();">
-                <option value="">{#not_set}</option>
-                <option value="baseline">{#advanced_dlg.image_align_baseline}</option>
-                <option value="top">{#advanced_dlg.image_align_top}</option>
-                <option value="middle">{#advanced_dlg.image_align_middle}</option>
-                <option value="bottom">{#advanced_dlg.image_align_bottom}</option>
-                <option value="text-top">{#advanced_dlg.image_align_texttop}</option>
-                <option value="text-bottom">{#advanced_dlg.image_align_textbottom}</option>
-                <option value="left">{#advanced_dlg.image_align_left}</option>
-                <option value="right">{#advanced_dlg.image_align_right}</option>
+            <td nowrap="nowrap"><label for="align">{$lang_insert_image_align}</label></td>
+            <td><select id="align" name="align">
+                <option value="">{$lang_insert_image_align_default}</option>
+                <option value="baseline">{$lang_insert_image_align_baseline}</option>
+                <option value="top">{$lang_insert_image_align_top}</option>
+                <option value="middle">{$lang_insert_image_align_middle}</option>
+                <option value="bottom">{$lang_insert_image_align_bottom}</option>
+                <option value="texttop">{$lang_insert_image_align_texttop}</option>
+                <option value="absmiddle">{$lang_insert_image_align_absmiddle}</option>
+                <option value="absbottom">{$lang_insert_image_align_absbottom}</option>
+                <option value="left">{$lang_insert_image_align_left}</option>
+                <option value="right">{$lang_insert_image_align_right}</option>
               </select></td>
           </tr>
           <tr>
-            <td class="nowrap"><label for="width">{#advanced_dlg.image_dimensions}</label></td>
+            <td nowrap="nowrap"><label for="width">{$lang_insert_image_dimensions}</label></td>
             <td><input id="width" name="width" type="text" value="" size="3" maxlength="5" />
               x
               <input id="height" name="height" type="text" value="" size="3" maxlength="5" /></td>
           </tr>
           <tr>
-            <td class="nowrap"><label for="border">{#advanced_dlg.image_border}</label></td>
-            <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td>
+            <td nowrap="nowrap"><label for="border">{$lang_insert_image_border}</label></td>
+            <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" /></td>
           </tr>
           <tr>
-            <td class="nowrap"><label for="vspace">{#advanced_dlg.image_vspace}</label></td>
-            <td><input id="vspace" name="vspace" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td>
+            <td nowrap="nowrap"><label for="vspace">{$lang_insert_image_vspace}</label></td>
+            <td><input id="vspace" name="vspace" type="text" value="" size="3" maxlength="3" /></td>
           </tr>
           <tr>
-            <td class="nowrap"><label for="hspace">{#advanced_dlg.image_hspace}</label></td>
-            <td><input id="hspace" name="hspace" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td>
+            <td nowrap="nowrap"><label for="hspace">{$lang_insert_image_hspace}</label></td>
+            <td><input id="hspace" name="hspace" type="text" value="" size="3" maxlength="3" /></td>
           </tr>
         </table>
 		</div>
 	</div>
 
 	<div class="mceActionPanel">
-		<input type="submit" id="insert" name="insert" value="{#insert}" />
-		<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+		<div style="float: left">
+			<input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertImage();" />
+		</div>
+
+		<div style="float: right">
+			<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
+		</div>
 	</div>
 </form>
 </body>

Deleted: plog/trunk/js/tinymce/themes/advanced/images/anchor.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/anchor.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/anchor.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/anchor_symbol.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/anchor_symbol.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/anchor_symbol.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/backcolor.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/backcolor.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/backcolor.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/bold.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/bold.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/bold.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/bold_de_se.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/bold_de_se.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/bold_de_se.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/bold_es.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/bold_es.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/bold_es.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/bold_fr.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/bold_fr.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/bold_fr.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/bold_ru.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/bold_ru.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/bold_ru.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/bold_tw.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/bold_tw.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/bold_tw.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/browse.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/browse.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/browse.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/bullist.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/bullist.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/bullist.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/button_menu.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/button_menu.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/button_menu.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/buttons.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/buttons.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/buttons.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/cancel_button_bg.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/cancel_button_bg.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/cancel_button_bg.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/charmap.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/charmap.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/charmap.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/cleanup.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/cleanup.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/cleanup.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/close.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/close.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/close.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/code.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/code.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/code.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/color.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/color.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/color.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/colors.jpg
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/colors.jpg (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/colors.jpg)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/copy.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/copy.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/copy.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/custom_1.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/custom_1.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/custom_1.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/cut.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/cut.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/cut.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/forecolor.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/forecolor.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/forecolor.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/help.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/help.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/help.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/hr.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/hr.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/hr.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/image.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/image.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/image.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/indent.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/indent.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/indent.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/insert_button_bg.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/insert_button_bg.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/insert_button_bg.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/italic.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/italic.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/italic.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/italic_de_se.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/italic_de_se.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/italic_de_se.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/italic_es.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/italic_es.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/italic_es.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/italic_ru.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/italic_ru.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/italic_ru.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/italic_tw.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/italic_tw.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/italic_tw.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/justifycenter.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/justifycenter.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/justifycenter.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/justifyfull.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/justifyfull.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/justifyfull.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/justifyleft.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/justifyleft.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/justifyleft.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/justifyright.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/justifyright.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/justifyright.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/link.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/link.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/link.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/menu_check.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/menu_check.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/menu_check.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/newdocument.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/newdocument.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/newdocument.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/numlist.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/numlist.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/numlist.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/opacity.png
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/opacity.png (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/opacity.png)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/outdent.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/outdent.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/outdent.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/paste.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/paste.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/paste.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/redo.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/redo.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/redo.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/removeformat.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/removeformat.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/removeformat.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/separator.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/separator.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/separator.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/spacer.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/spacer.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/spacer.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/statusbar_resize.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/statusbar_resize.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/statusbar_resize.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/strikethrough.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/strikethrough.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/strikethrough.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/sub.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/sub.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/sub.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/sup.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/sup.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/sup.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/underline.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/underline.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/underline.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/underline_es.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/underline_es.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/underline_es.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/underline_fr.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/underline_fr.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/underline_fr.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/underline_ru.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/underline_ru.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/underline_ru.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/underline_tw.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/underline_tw.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/underline_tw.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/undo.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/undo.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/undo.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/unlink.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/unlink.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/unlink.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/visualaid.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/visualaid.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/visualaid.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/xp/tab_bg.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/xp/tab_bg.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/xp/tab_bg.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/xp/tab_end.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/xp/tab_end.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/xp/tab_end.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/xp/tab_sel_bg.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/xp/tab_sel_bg.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/xp/tab_sel_bg.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/xp/tab_sel_end.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/xp/tab_sel_end.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/xp/tab_sel_end.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/images/xp/tabs_bg.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/advanced/images/xp/tabs_bg.gif (from rev 7165, plog/trunk/js/tinymce/themes/advanced/images/xp/tabs_bg.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/advanced/jscripts/about.js
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/jscripts/about.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/themes/advanced/jscripts/about.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,75 +0,0 @@
-function init() {
-	var inst;
-
-	tinyMCEPopup.resizeToInnerSize();
-	inst = tinyMCE.selectedInstance;
-
-	// Give FF some time
-	window.setTimeout('insertHelpIFrame();', 10);
-
-	var tcont = document.getElementById('plugintablecontainer');
-	var plugins = tinyMCE.getParam('plugins', '', true, ',');
-	if (plugins.length == 0)
-		document.getElementById('plugins_tab').style.display = 'none';
-
-	var html = "";
-	html += '<table id="plugintable">';
-	html += '<thead>';
-	html += '<tr>';
-	html += '<td>' + tinyMCE.getLang('lang_plugin') + '</td>';
-	html += '<td>' + tinyMCE.getLang('lang_author') + '</td>';
-	html += '<td>' + tinyMCE.getLang('lang_version') + '</td>';
-	html += '</tr>';
-	html += '</thead>';
-	html += '<tbody>';
-
-	for (var i=0; i<inst.plugins.length; i++) {
-		var info = getPluginInfo(inst.plugins[i]);
-
-		html += '<tr>';
-
-		if (info.infourl != null && info.infourl != '')
-			html += '<td width="50%" title="' + plugins[i] + '"><a href="' + info.infourl + '" target="mceplugin">' + info.longname + '</a></td>';
-		else
-			html += '<td width="50%" title="' + plugins[i] + '">' + info.longname + '</td>';
-
-		if (info.authorurl != null && info.authorurl != '')
-			html += '<td width="35%"><a href="' + info.authorurl + '" target="mceplugin">' + info.author + '</a></td>';
-		else
-			html += '<td width="35%">' + info.author + '</td>';
-
-		html += '<td width="15%">' + info.version + '</td>';
-		html += '</tr>';
-	}
-
-	html += '</tbody>';
-	html += '</table>';
-
-	tcont.innerHTML = html;
-}
-
-function getPluginInfo(name) {
-	if (tinyMCE.plugins[name].getInfo)
-		return tinyMCE.plugins[name].getInfo();
-
-	return {
-		longname : name,
-		authorurl : '',
-		infourl : '',
-		author : '--',
-		version : '--'
-	};
-}
-
-function insertHelpIFrame() {
-	var html = '<iframe width="100%" height="300" src="' + tinyMCE.themeURL + "/docs/" + tinyMCE.settings['docs_language'] + "/index.htm" + '"></iframe>';
-
-	document.getElementById('iframecontainer').innerHTML = html;
-
-	html = '';
-	html += '<a href="http://www.moxiecode.com" target="_blank"><img src="http://tinymce.moxiecode.com/images/gotmoxie.png" alt="Got Moxie?" border="0" /></a> ';
-	html += '<a href="http://sourceforge.net/projects/tinymce/" target="_blank"><img src="http://sourceforge.net/sflogo.php?group_id=103281" alt="Hosted By Sourceforge" border="0" /></a> ';
-	html += '<a href="http://www.freshmeat.net/projects/tinymce" target="_blank"><img src="http://tinymce.moxiecode.com/images/fm.gif" alt="Also on freshmeat" border="0" /></a> ';
-
-	document.getElementById('buttoncontainer').innerHTML = html;
-}

Copied: plog/trunk/js/tinymce/themes/advanced/jscripts/about.js (from rev 7165, plog/trunk/js/tinymce/themes/advanced/jscripts/about.js)
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/jscripts/about.js	                        (rev 0)
+++ plog/trunk/js/tinymce/themes/advanced/jscripts/about.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,75 @@
+function init() {
+	var inst;
+
+	tinyMCEPopup.resizeToInnerSize();
+	inst = tinyMCE.selectedInstance;
+
+	// Give FF some time
+	window.setTimeout('insertHelpIFrame();', 10);
+
+	var tcont = document.getElementById('plugintablecontainer');
+	var plugins = tinyMCE.getParam('plugins', '', true, ',');
+	if (plugins.length == 0)
+		document.getElementById('plugins_tab').style.display = 'none';
+
+	var html = "";
+	html += '<table id="plugintable">';
+	html += '<thead>';
+	html += '<tr>';
+	html += '<td>' + tinyMCE.getLang('lang_plugin') + '</td>';
+	html += '<td>' + tinyMCE.getLang('lang_author') + '</td>';
+	html += '<td>' + tinyMCE.getLang('lang_version') + '</td>';
+	html += '</tr>';
+	html += '</thead>';
+	html += '<tbody>';
+
+	for (var i=0; i<inst.plugins.length; i++) {
+		var info = getPluginInfo(inst.plugins[i]);
+
+		html += '<tr>';
+
+		if (info.infourl != null && info.infourl != '')
+			html += '<td width="50%" title="' + plugins[i] + '"><a href="' + info.infourl + '" target="mceplugin">' + info.longname + '</a></td>';
+		else
+			html += '<td width="50%" title="' + plugins[i] + '">' + info.longname + '</td>';
+
+		if (info.authorurl != null && info.authorurl != '')
+			html += '<td width="35%"><a href="' + info.authorurl + '" target="mceplugin">' + info.author + '</a></td>';
+		else
+			html += '<td width="35%">' + info.author + '</td>';
+
+		html += '<td width="15%">' + info.version + '</td>';
+		html += '</tr>';
+	}
+
+	html += '</tbody>';
+	html += '</table>';
+
+	tcont.innerHTML = html;
+}
+
+function getPluginInfo(name) {
+	if (tinyMCE.plugins[name].getInfo)
+		return tinyMCE.plugins[name].getInfo();
+
+	return {
+		longname : name,
+		authorurl : '',
+		infourl : '',
+		author : '--',
+		version : '--'
+	};
+}
+
+function insertHelpIFrame() {
+	var html = '<iframe width="100%" height="300" src="' + tinyMCE.themeURL + "/docs/" + tinyMCE.settings['docs_language'] + "/index.htm" + '"></iframe>';
+
+	document.getElementById('iframecontainer').innerHTML = html;
+
+	html = '';
+	html += '<a href="http://www.moxiecode.com" target="_blank"><img src="http://tinymce.moxiecode.com/images/gotmoxie.png" alt="Got Moxie?" border="0" /></a> ';
+	html += '<a href="http://sourceforge.net/projects/tinymce/" target="_blank"><img src="http://sourceforge.net/sflogo.php?group_id=103281" alt="Hosted By Sourceforge" border="0" /></a> ';
+	html += '<a href="http://www.freshmeat.net/projects/tinymce" target="_blank"><img src="http://tinymce.moxiecode.com/images/fm.gif" alt="Also on freshmeat" border="0" /></a> ';
+
+	document.getElementById('buttoncontainer').innerHTML = html;
+}

Deleted: plog/trunk/js/tinymce/themes/advanced/jscripts/anchor.js
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/jscripts/anchor.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/themes/advanced/jscripts/anchor.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,74 +0,0 @@
-var action, element;
-
-function init() {
-	tinyMCEPopup.resizeToInnerSize();
-
-	var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
-	var anchor = tinyMCE.getParentElement(inst.getFocusElement(), "a", "name");
-	var img = inst.getFocusElement();
-	action = 'insert';
-
-	if (anchor != null) {
-		element = anchor;
-		action = "update";
-	}
-
-	if (tinyMCE.getAttrib(img, "class") == "mceItemAnchor") {
-		element = img;
-		action = "update";
-	}
-
-	if (action == "update")
-		document.forms[0].anchorName.value = element.nodeName == "IMG" ? element.getAttribute("title") : element.getAttribute("name");
-
-	document.forms[0].insert.value = tinyMCE.getLang('lang_' + action, 'Insert', true);
-}
-
-function insertAnchor() {
-	var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
-	var name = document.forms[0].anchorName.value, e;
-
-	tinyMCEPopup.execCommand("mceBeginUndoLevel");
-
-	if (action == "update") {
-		if (element.nodeName == "IMG")
-			element.setAttribute("title", name);
-		else
-			element.setAttribute("name", name);
-	} else {
-		var rng = inst.getRng();
-
-		if (rng.collapse)
-			rng.collapse(false);
-
-		name = name.replace(/&/g, '&');
-		name = name.replace(/\"/g, '"');
-		name = name.replace(/</g, '<');
-		name = name.replace(/>/g, '>');
-
-		// Fix for bug #1447335
-		if (tinyMCE.isGecko)
-			html = '<a id="mceNewAnchor" name="' + name + '"></a>';
-		else
-			html = '<a name="' + name + '"></a>';
-
-		tinyMCEPopup.execCommand("mceInsertContent", false, html);
-
-		// Fix for bug #1447335 force cursor after the anchor element
-		if (tinyMCE.isGecko) {
-			e = inst.getDoc().getElementById('mceNewAnchor');
-
-			if (e) {
-				inst.selection.selectNode(e, true, false, false);
-				e.removeAttribute('id');
-			}
-		}
-
-		tinyMCE.handleVisualAid(inst.getBody(), true, inst.visualAid, inst);
-	}
-
-	tinyMCEPopup.execCommand("mceEndUndoLevel");
-
-	tinyMCE.triggerNodeChange();
-	tinyMCEPopup.close();
-}

Copied: plog/trunk/js/tinymce/themes/advanced/jscripts/anchor.js (from rev 7165, plog/trunk/js/tinymce/themes/advanced/jscripts/anchor.js)
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/jscripts/anchor.js	                        (rev 0)
+++ plog/trunk/js/tinymce/themes/advanced/jscripts/anchor.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,74 @@
+var action, element;
+
+function init() {
+	tinyMCEPopup.resizeToInnerSize();
+
+	var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
+	var anchor = tinyMCE.getParentElement(inst.getFocusElement(), "a", "name");
+	var img = inst.getFocusElement();
+	action = 'insert';
+
+	if (anchor != null) {
+		element = anchor;
+		action = "update";
+	}
+
+	if (tinyMCE.getAttrib(img, "class") == "mceItemAnchor") {
+		element = img;
+		action = "update";
+	}
+
+	if (action == "update")
+		document.forms[0].anchorName.value = element.nodeName == "IMG" ? element.getAttribute("title") : element.getAttribute("name");
+
+	document.forms[0].insert.value = tinyMCE.getLang('lang_' + action, 'Insert', true);
+}
+
+function insertAnchor() {
+	var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
+	var name = document.forms[0].anchorName.value, e;
+
+	tinyMCEPopup.execCommand("mceBeginUndoLevel");
+
+	if (action == "update") {
+		if (element.nodeName == "IMG")
+			element.setAttribute("title", name);
+		else
+			element.setAttribute("name", name);
+	} else {
+		var rng = inst.getRng();
+
+		if (rng.collapse)
+			rng.collapse(false);
+
+		name = name.replace(/&/g, '&');
+		name = name.replace(/\"/g, '"');
+		name = name.replace(/</g, '<');
+		name = name.replace(/>/g, '>');
+
+		// Fix for bug #1447335
+		if (tinyMCE.isGecko)
+			html = '<a id="mceNewAnchor" name="' + name + '"></a>';
+		else
+			html = '<a name="' + name + '"></a>';
+
+		tinyMCEPopup.execCommand("mceInsertContent", false, html);
+
+		// Fix for bug #1447335 force cursor after the anchor element
+		if (tinyMCE.isGecko) {
+			e = inst.getDoc().getElementById('mceNewAnchor');
+
+			if (e) {
+				inst.selection.selectNode(e, true, false, false);
+				e.removeAttribute('id');
+			}
+		}
+
+		tinyMCE.handleVisualAid(inst.getBody(), true, inst.visualAid, inst);
+	}
+
+	tinyMCEPopup.execCommand("mceEndUndoLevel");
+
+	tinyMCE.triggerNodeChange();
+	tinyMCEPopup.close();
+}

Deleted: plog/trunk/js/tinymce/themes/advanced/jscripts/charmap.js
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/jscripts/charmap.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/themes/advanced/jscripts/charmap.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,326 +0,0 @@
-function init() {
-	tinyMCEPopup.resizeToInnerSize();
-}
-
-var charmap = new Array();
-
-// for mor details please see w3c.org
-// now here is the complete list ;)
-
-charmap = [
-	[' ',    ' ',  true, 'no-break space'],
-	['&',     '&',   true, 'ampersand'],
-	['"',    '"',   true, 'quotation mark'],
-// finance
-	['¢',    '¢',  true, 'cent sign'],
-	['€',    '€', true, 'euro sign'],
-	['£',   '£',  true, 'pound sign'],
-	['¥',     '¥',  true, 'yen sign'],
-// signs
-	['©',    '©',  true, 'copyright sign'],
-	['®',     '®',  true, 'registered sign'],
-	['™',   '™', true, 'trade mark sign'],
-	['‰',  '‰', true, 'per mille sign'],
-	['µ',   'µ',  true, 'micro sign'],
-	['·',  '·',  true, 'middle dot'],
-	['•',    '•', true, 'bullet'],
-	['…',  '…', true, 'three dot leader'],
-	['′',   '′', true, 'minutes / feet'],
-	['″',   '″', true, 'seconds / inches'],
-	['§',    '§',  true, 'section sign'],
-	['¶',    '¶',  true, 'paragraph sign'],
-	['ß',   'ß',  true, 'sharp s / ess-zed'],
-// quotations
-	['‹',  '‹', true, 'single left-pointing angle quotation mark'],
-	['›',  '›', true, 'single right-pointing angle quotation mark'],
-	['«',   '«',  true, 'left pointing guillemet'],
-	['»',   '»',  true, 'right pointing guillemet'],
-	['‘',   '‘', true, 'left single quotation mark'],
-	['’',   '’', true, 'right single quotation mark'],
-	['“',   '“', true, 'left double quotation mark'],
-	['”',   '”', true, 'right double quotation mark'],
-	['‚',   '‚', true, 'single low-9 quotation mark'],
-	['„',   '„', true, 'double low-9 quotation mark'],
-	['<',      '<',   true, 'less-than sign'],
-	['>',      '>',   true, 'greater-than sign'],
-	['≤',      '≤', true, 'less-than or equal to'],
-	['≥',      '≥', true, 'greater-than or equal to'],
-	['–',   '–', true, 'en dash'],
-	['—',   '—', true, 'em dash'],
-	['¯',    '¯',  true, 'macron'],
-	['‾',   '‾', true, 'overline'],
-	['¤',  '¤',  true, 'currency sign'],
-	['¦',  '¦',  true, 'broken bar'],
-	['¨',     '¨',  true, 'diaeresis'],
-	['¡',   '¡',  true, 'inverted exclamation mark'],
-	['¿',  '¿',  true, 'turned question mark'],
-	['ˆ',    'ˆ',  true, 'circumflex accent'],
-	['˜',   '˜',  true, 'small tilde'],
-	['°',     '°',  true, 'degree sign'],
-	['−',   '−', true, 'minus sign'],
-	['±',  '±',  true, 'plus-minus sign'],
-	['÷',  '÷',  true, 'division sign'],
-	['⁄',   '⁄', true, 'fraction slash'],
-	['×',   '×',  true, 'multiplication sign'],
-	['&sup1;',    '¹',  true, 'superscript one'],
-	['&sup2;',    '²',  true, 'superscript two'],
-	['&sup3;',    '³',  true, 'superscript three'],
-	['&frac14;',  '¼',  true, 'fraction one quarter'],
-	['&frac12;',  '½',  true, 'fraction one half'],
-	['&frac34;',  '¾',  true, 'fraction three quarters'],
-// math / logical
-	['ƒ',    'ƒ',  true, 'function / florin'],
-	['∫',     '∫', true, 'integral'],
-	['∑',     '∑', true, 'n-ary sumation'],
-	['∞',   '∞', true, 'infinity'],
-	['√',   '√', true, 'square root'],
-	['∼',     '∼', false,'similar to'],
-	['≅',    '≅', false,'approximately equal to'],
-	['≈',   '≈', true, 'almost equal to'],
-	['≠',      '≠', true, 'not equal to'],
-	['≡',   '≡', true, 'identical to'],
-	['∈',    '∈', false,'element of'],
-	['∉',   '∉', false,'not an element of'],
-	['∋',      '∋', false,'contains as member'],
-	['∏',    '∏', true, 'n-ary product'],
-	['∧',     '∧', false,'logical and'],
-	['∨',      '∨', false,'logical or'],
-	['¬',     '¬',  true, 'not sign'],
-	['∩',     '∩', true, 'intersection'],
-	['∪',     '∪', false,'union'],
-	['∂',    '∂', true, 'partial differential'],
-	['∀',  '∀', false,'for all'],
-	['∃',   '∃', false,'there exists'],
-	['∅',   '∅', false,'diameter'],
-	['∇',   '∇', false,'backward difference'],
-	['∗',  '∗', false,'asterisk operator'],
-	['∝',    '∝', false,'proportional to'],
-	['∠',     '∠', false,'angle'],
-// undefined
-	['´',   '´',  true, 'acute accent'],
-	['¸',   '¸',  true, 'cedilla'],
-	['ª',    'ª',  true, 'feminine ordinal indicator'],
-	['º',    'º',  true, 'masculine ordinal indicator'],
-	['†',  '†', true, 'dagger'],
-	['‡',  '‡', true, 'double dagger'],
-// alphabetical special chars
-	['À',  'À',  true, 'A - grave'],
-	['Á',  'Á',  true, 'A - acute'],
-	['Â',   'Â',  true, 'A - circumflex'],
-	['Ã',  'Ã',  true, 'A - tilde'],
-	['Ä',    'Ä',  true, 'A - diaeresis'],
-	['Å',   'Å',  true, 'A - ring above'],
-	['Æ',   'Æ',  true, 'ligature AE'],
-	['Ç',  'Ç',  true, 'C - cedilla'],
-	['È',  'È',  true, 'E - grave'],
-	['É',  'É',  true, 'E - acute'],
-	['Ê',   'Ê',  true, 'E - circumflex'],
-	['Ë',    'Ë',  true, 'E - diaeresis'],
-	['Ì',  'Ì',  true, 'I - grave'],
-	['Í',  'Í',  true, 'I - acute'],
-	['Î',   'Î',  true, 'I - circumflex'],
-	['Ï',    'Ï',  true, 'I - diaeresis'],
-	['Ð',     'Ð',  true, 'ETH'],
-	['Ñ',  'Ñ',  true, 'N - tilde'],
-	['Ò',  'Ò',  true, 'O - grave'],
-	['Ó',  'Ó',  true, 'O - acute'],
-	['Ô',   'Ô',  true, 'O - circumflex'],
-	['Õ',  'Õ',  true, 'O - tilde'],
-	['Ö',    'Ö',  true, 'O - diaeresis'],
-	['Ø',  'Ø',  true, 'O - slash'],
-	['Œ',   'Œ',  true, 'ligature OE'],
-	['Š',  'Š',  true, 'S - caron'],
-	['Ù',  'Ù',  true, 'U - grave'],
-	['Ú',  'Ú',  true, 'U - acute'],
-	['Û',   'Û',  true, 'U - circumflex'],
-	['Ü',    'Ü',  true, 'U - diaeresis'],
-	['Ý',  'Ý',  true, 'Y - acute'],
-	['Ÿ',    'Ÿ',  true, 'Y - diaeresis'],
-	['Þ',   'Þ',  true, 'THORN'],
-	['à',  'à',  true, 'a - grave'],
-	['á',  'á',  true, 'a - acute'],
-	['â',   'â',  true, 'a - circumflex'],
-	['ã',  'ã',  true, 'a - tilde'],
-	['ä',    'ä',  true, 'a - diaeresis'],
-	['å',   'å',  true, 'a - ring above'],
-	['æ',   'æ',  true, 'ligature ae'],
-	['ç',  'ç',  true, 'c - cedilla'],
-	['è',  'è',  true, 'e - grave'],
-	['é',  'é',  true, 'e - acute'],
-	['ê',   'ê',  true, 'e - circumflex'],
-	['ë',    'ë',  true, 'e - diaeresis'],
-	['ì',  'ì',  true, 'i - grave'],
-	['í',  'í',  true, 'i - acute'],
-	['î',   'î',  true, 'i - circumflex'],
-	['ï',    'ï',  true, 'i - diaeresis'],
-	['ð',     'ð',  true, 'eth'],
-	['ñ',  'ñ',  true, 'n - tilde'],
-	['ò',  'ò',  true, 'o - grave'],
-	['ó',  'ó',  true, 'o - acute'],
-	['ô',   'ô',  true, 'o - circumflex'],
-	['õ',  'õ',  true, 'o - tilde'],
-	['ö',    'ö',  true, 'o - diaeresis'],
-	['ø',  'ø',  true, 'o slash'],
-	['œ',   'œ',  true, 'ligature oe'],
-	['š',  'š',  true, 's - caron'],
-	['ù',  'ù',  true, 'u - grave'],
-	['ú',  'ú',  true, 'u - acute'],
-	['û',   'û',  true, 'u - circumflex'],
-	['ü',    'ü',  true, 'u - diaeresis'],
-	['ý',  'ý',  true, 'y - acute'],
-	['þ',   'þ',  true, 'thorn'],
-	['ÿ',    'ÿ',  true, 'y - diaeresis'],
-    ['Α',   'Α',  true, 'Alpha'],
-	['Β',    'Β',  true, 'Beta'],
-	['Γ',   'Γ',  true, 'Gamma'],
-	['Δ',   'Δ',  true, 'Delta'],
-	['Ε', 'Ε',  true, 'Epsilon'],
-	['Ζ',    'Ζ',  true, 'Zeta'],
-	['Η',     'Η',  true, 'Eta'],
-	['Θ',   'Θ',  true, 'Theta'],
-	['Ι',    'Ι',  true, 'Iota'],
-	['Κ',   'Κ',  true, 'Kappa'],
-	['Λ',  'Λ',  true, 'Lambda'],
-	['Μ',      'Μ',  true, 'Mu'],
-	['Ν',      'Ν',  true, 'Nu'],
-	['Ξ',      'Ξ',  true, 'Xi'],
-	['Ο', 'Ο',  true, 'Omicron'],
-	['Π',      'Π',  true, 'Pi'],
-	['Ρ',     'Ρ',  true, 'Rho'],
-	['Σ',   'Σ',  true, 'Sigma'],
-	['Τ',     'Τ',  true, 'Tau'],
-	['Υ', 'Υ',  true, 'Upsilon'],
-	['Φ',     'Φ',  true, 'Phi'],
-	['Χ',     'Χ',  true, 'Chi'],
-	['Ψ',     'Ψ',  true, 'Psi'],
-	['Ω',   'Ω',  true, 'Omega'],
-	['α',   'α',  true, 'alpha'],
-	['β',    'β',  true, 'beta'],
-	['γ',   'γ',  true, 'gamma'],
-	['δ',   'δ',  true, 'delta'],
-	['ε', 'ε',  true, 'epsilon'],
-	['ζ',    'ζ',  true, 'zeta'],
-	['η',     'η',  true, 'eta'],
-	['θ',   'θ',  true, 'theta'],
-	['ι',    'ι',  true, 'iota'],
-	['κ',   'κ',  true, 'kappa'],
-	['λ',  'λ',  true, 'lambda'],
-	['μ',      'μ',  true, 'mu'],
-	['ν',      'ν',  true, 'nu'],
-	['ξ',      'ξ',  true, 'xi'],
-	['ο', 'ο',  true, 'omicron'],
-	['π',      'π',  true, 'pi'],
-	['ρ',     'ρ',  true, 'rho'],
-	['ς',  'ς',  true, 'final sigma'],
-	['σ',   'σ',  true, 'sigma'],
-	['τ',     'τ',  true, 'tau'],
-	['υ', 'υ',  true, 'upsilon'],
-	['φ',     'φ',  true, 'phi'],
-	['χ',     'χ',  true, 'chi'],
-	['ψ',     'ψ',  true, 'psi'],
-	['ω',   'ω',  true, 'omega'],
-// symbols
-	['ℵ', 'ℵ', false,'alef symbol'],
-	['ϖ',     'ϖ',  false,'pi symbol'],
-	['ℜ',    'ℜ', false,'real part symbol'],
-	['ϑ','ϑ',  false,'theta symbol'],
-	['ϒ',   'ϒ',  false,'upsilon - hook symbol'],
-	['℘',  '℘', false,'Weierstrass p'],
-	['ℑ',   'ℑ', false,'imaginary part'],
-// arrows
-	['←',    '←', true, 'leftwards arrow'],
-	['↑',    '↑', true, 'upwards arrow'],
-	['→',    '→', true, 'rightwards arrow'],
-	['↓',    '↓', true, 'downwards arrow'],
-	['↔',    '↔', true, 'left right arrow'],
-	['↵',   '↵', false,'carriage return'],
-	['⇐',    '⇐', false,'leftwards double arrow'],
-	['⇑',    '⇑', false,'upwards double arrow'],
-	['⇒',    '⇒', false,'rightwards double arrow'],
-	['⇓',    '⇓', false,'downwards double arrow'],
-	['⇔',    '⇔', false,'left right double arrow'],
-	['&there4;',  '∴', false,'therefore'],
-	['⊂',     '⊂', false,'subset of'],
-	['⊃',     '⊃', false,'superset of'],
-	['⊄',    '⊄', false,'not a subset of'],
-	['⊆',    '⊆', false,'subset of or equal to'],
-	['⊇',    '⊇', false,'superset of or equal to'],
-	['⊕',   '⊕', false,'circled plus'],
-	['⊗',  '⊗', false,'circled times'],
-	['⊥',    '⊥', false,'perpendicular'],
-	['⋅',    '⋅', false,'dot operator'],
-	['⌈',   '⌈', false,'left ceiling'],
-	['⌉',   '⌉', false,'right ceiling'],
-	['⌊',  '⌊', false,'left floor'],
-	['⌋',  '⌋', false,'right floor'],
-	['⟨',    '〈', false,'left-pointing angle bracket'],
-	['⟩',    '〉', false,'right-pointing angle bracket'],
-	['◊',     '◊', true,'lozenge'],
-	['♠',  '♠', false,'black spade suit'],
-	['♣',   '♣', true, 'black club suit'],
-	['♥',  '♥', true, 'black heart suit'],
-	['♦',   '♦', true, 'black diamond suit'],
-	[' ',    ' ', false,'en space'],
-	[' ',    ' ', false,'em space'],
-	[' ',  ' ', false,'thin space'],
-	['‌',    '‌', false,'zero width non-joiner'],
-	['‍',     '‍', false,'zero width joiner'],
-	['‎',     '‎', false,'left-to-right mark'],
-	['‏',     '‏', false,'right-to-left mark'],
-	['­',     '­',  false,'soft hyphen']
-];
-
-function renderCharMapHTML() {
-	var charsPerRow = 20, tdWidth=20, tdHeight=20;
-	var html = '<table border="0" cellspacing="1" cellpadding="0" width="' + (tdWidth*charsPerRow) + '"><tr height="' + tdHeight + '">';
-	var cols=-1;
-	for (var i=0; i<charmap.length; i++) {
-		if (charmap[i][2]==true) {
-			cols++;
-			html += ''
-				+ '<td width="' + tdWidth + '" height="' + tdHeight + '" class="charmap"'
-				+ ' onmouseover="this.className=\'charmapOver\';'
-				+ 'previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');"'
-				+ ' onmouseout="this.className=\'charmap\';"'
-				+ ' nowrap="nowrap" onclick="insertChar(\'' + charmap[i][1].substring(2,charmap[i][1].length-1) + '\');"><a style="text-decoration: none;" onfocus="previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');" href="javascript:insertChar(\'' + charmap[i][1].substring(2,charmap[i][1].length-1) + '\');" onclick="return false;" onmousedown="return false;" title="' + charmap[i][3] + '">'
-				+ charmap[i][1]
-				+ '</a></td>';
-			if ((cols+1) % charsPerRow == 0)
-				html += '</tr><tr height="' + tdHeight + '">';
-		}
-	 }
-	if (cols % charsPerRow > 0) {
-		var padd = charsPerRow - (cols % charsPerRow);
-		for (var i=0; i<padd-1; i++)
-			html += '<td width="' + tdWidth + '" height="' + tdHeight + '" class="charmap"> </td>';
-	}
-	html += '</tr></table>';
-	document.write(html);
-}
-
-function insertChar(chr) {
-	tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';');
-
-	// Refocus in window
-	if (tinyMCEPopup.isWindow)
-		window.focus();
-
-	tinyMCEPopup.close();
-}
-
-function previewChar(codeA, codeB, codeN) {
-	var elmA = document.getElementById('codeA');
-	var elmB = document.getElementById('codeB');
-	var elmV = document.getElementById('codeV');
-	var elmN = document.getElementById('codeN');
-
-	if (codeA=='#160;') {
-		elmV.innerHTML = '__';
-	} else {
-		elmV.innerHTML = '&' + codeA;
-	}
-
-	elmB.innerHTML = '&' + codeA;
-	elmA.innerHTML = '&' + codeB;
-	elmN.innerHTML = codeN;
-}

Copied: plog/trunk/js/tinymce/themes/advanced/jscripts/charmap.js (from rev 7165, plog/trunk/js/tinymce/themes/advanced/jscripts/charmap.js)
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/jscripts/charmap.js	                        (rev 0)
+++ plog/trunk/js/tinymce/themes/advanced/jscripts/charmap.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,326 @@
+function init() {
+	tinyMCEPopup.resizeToInnerSize();
+}
+
+var charmap = new Array();
+
+// for mor details please see w3c.org
+// now here is the complete list ;)
+
+charmap = [
+	[' ',    ' ',  true, 'no-break space'],
+	['&',     '&',   true, 'ampersand'],
+	['"',    '"',   true, 'quotation mark'],
+// finance
+	['¢',    '¢',  true, 'cent sign'],
+	['€',    '€', true, 'euro sign'],
+	['£',   '£',  true, 'pound sign'],
+	['¥',     '¥',  true, 'yen sign'],
+// signs
+	['©',    '©',  true, 'copyright sign'],
+	['®',     '®',  true, 'registered sign'],
+	['™',   '™', true, 'trade mark sign'],
+	['‰',  '‰', true, 'per mille sign'],
+	['µ',   'µ',  true, 'micro sign'],
+	['·',  '·',  true, 'middle dot'],
+	['•',    '•', true, 'bullet'],
+	['…',  '…', true, 'three dot leader'],
+	['′',   '′', true, 'minutes / feet'],
+	['″',   '″', true, 'seconds / inches'],
+	['§',    '§',  true, 'section sign'],
+	['¶',    '¶',  true, 'paragraph sign'],
+	['ß',   'ß',  true, 'sharp s / ess-zed'],
+// quotations
+	['‹',  '‹', true, 'single left-pointing angle quotation mark'],
+	['›',  '›', true, 'single right-pointing angle quotation mark'],
+	['«',   '«',  true, 'left pointing guillemet'],
+	['»',   '»',  true, 'right pointing guillemet'],
+	['‘',   '‘', true, 'left single quotation mark'],
+	['’',   '’', true, 'right single quotation mark'],
+	['“',   '“', true, 'left double quotation mark'],
+	['”',   '”', true, 'right double quotation mark'],
+	['‚',   '‚', true, 'single low-9 quotation mark'],
+	['„',   '„', true, 'double low-9 quotation mark'],
+	['<',      '<',   true, 'less-than sign'],
+	['>',      '>',   true, 'greater-than sign'],
+	['≤',      '≤', true, 'less-than or equal to'],
+	['≥',      '≥', true, 'greater-than or equal to'],
+	['–',   '–', true, 'en dash'],
+	['—',   '—', true, 'em dash'],
+	['¯',    '¯',  true, 'macron'],
+	['‾',   '‾', true, 'overline'],
+	['¤',  '¤',  true, 'currency sign'],
+	['¦',  '¦',  true, 'broken bar'],
+	['¨',     '¨',  true, 'diaeresis'],
+	['¡',   '¡',  true, 'inverted exclamation mark'],
+	['¿',  '¿',  true, 'turned question mark'],
+	['ˆ',    'ˆ',  true, 'circumflex accent'],
+	['˜',   '˜',  true, 'small tilde'],
+	['°',     '°',  true, 'degree sign'],
+	['−',   '−', true, 'minus sign'],
+	['±',  '±',  true, 'plus-minus sign'],
+	['÷',  '÷',  true, 'division sign'],
+	['⁄',   '⁄', true, 'fraction slash'],
+	['×',   '×',  true, 'multiplication sign'],
+	['&sup1;',    '¹',  true, 'superscript one'],
+	['&sup2;',    '²',  true, 'superscript two'],
+	['&sup3;',    '³',  true, 'superscript three'],
+	['&frac14;',  '¼',  true, 'fraction one quarter'],
+	['&frac12;',  '½',  true, 'fraction one half'],
+	['&frac34;',  '¾',  true, 'fraction three quarters'],
+// math / logical
+	['ƒ',    'ƒ',  true, 'function / florin'],
+	['∫',     '∫', true, 'integral'],
+	['∑',     '∑', true, 'n-ary sumation'],
+	['∞',   '∞', true, 'infinity'],
+	['√',   '√', true, 'square root'],
+	['∼',     '∼', false,'similar to'],
+	['≅',    '≅', false,'approximately equal to'],
+	['≈',   '≈', true, 'almost equal to'],
+	['≠',      '≠', true, 'not equal to'],
+	['≡',   '≡', true, 'identical to'],
+	['∈',    '∈', false,'element of'],
+	['∉',   '∉', false,'not an element of'],
+	['∋',      '∋', false,'contains as member'],
+	['∏',    '∏', true, 'n-ary product'],
+	['∧',     '∧', false,'logical and'],
+	['∨',      '∨', false,'logical or'],
+	['¬',     '¬',  true, 'not sign'],
+	['∩',     '∩', true, 'intersection'],
+	['∪',     '∪', false,'union'],
+	['∂',    '∂', true, 'partial differential'],
+	['∀',  '∀', false,'for all'],
+	['∃',   '∃', false,'there exists'],
+	['∅',   '∅', false,'diameter'],
+	['∇',   '∇', false,'backward difference'],
+	['∗',  '∗', false,'asterisk operator'],
+	['∝',    '∝', false,'proportional to'],
+	['∠',     '∠', false,'angle'],
+// undefined
+	['´',   '´',  true, 'acute accent'],
+	['¸',   '¸',  true, 'cedilla'],
+	['ª',    'ª',  true, 'feminine ordinal indicator'],
+	['º',    'º',  true, 'masculine ordinal indicator'],
+	['†',  '†', true, 'dagger'],
+	['‡',  '‡', true, 'double dagger'],
+// alphabetical special chars
+	['À',  'À',  true, 'A - grave'],
+	['Á',  'Á',  true, 'A - acute'],
+	['Â',   'Â',  true, 'A - circumflex'],
+	['Ã',  'Ã',  true, 'A - tilde'],
+	['Ä',    'Ä',  true, 'A - diaeresis'],
+	['Å',   'Å',  true, 'A - ring above'],
+	['Æ',   'Æ',  true, 'ligature AE'],
+	['Ç',  'Ç',  true, 'C - cedilla'],
+	['È',  'È',  true, 'E - grave'],
+	['É',  'É',  true, 'E - acute'],
+	['Ê',   'Ê',  true, 'E - circumflex'],
+	['Ë',    'Ë',  true, 'E - diaeresis'],
+	['Ì',  'Ì',  true, 'I - grave'],
+	['Í',  'Í',  true, 'I - acute'],
+	['Î',   'Î',  true, 'I - circumflex'],
+	['Ï',    'Ï',  true, 'I - diaeresis'],
+	['Ð',     'Ð',  true, 'ETH'],
+	['Ñ',  'Ñ',  true, 'N - tilde'],
+	['Ò',  'Ò',  true, 'O - grave'],
+	['Ó',  'Ó',  true, 'O - acute'],
+	['Ô',   'Ô',  true, 'O - circumflex'],
+	['Õ',  'Õ',  true, 'O - tilde'],
+	['Ö',    'Ö',  true, 'O - diaeresis'],
+	['Ø',  'Ø',  true, 'O - slash'],
+	['Œ',   'Œ',  true, 'ligature OE'],
+	['Š',  'Š',  true, 'S - caron'],
+	['Ù',  'Ù',  true, 'U - grave'],
+	['Ú',  'Ú',  true, 'U - acute'],
+	['Û',   'Û',  true, 'U - circumflex'],
+	['Ü',    'Ü',  true, 'U - diaeresis'],
+	['Ý',  'Ý',  true, 'Y - acute'],
+	['Ÿ',    'Ÿ',  true, 'Y - diaeresis'],
+	['Þ',   'Þ',  true, 'THORN'],
+	['à',  'à',  true, 'a - grave'],
+	['á',  'á',  true, 'a - acute'],
+	['â',   'â',  true, 'a - circumflex'],
+	['ã',  'ã',  true, 'a - tilde'],
+	['ä',    'ä',  true, 'a - diaeresis'],
+	['å',   'å',  true, 'a - ring above'],
+	['æ',   'æ',  true, 'ligature ae'],
+	['ç',  'ç',  true, 'c - cedilla'],
+	['è',  'è',  true, 'e - grave'],
+	['é',  'é',  true, 'e - acute'],
+	['ê',   'ê',  true, 'e - circumflex'],
+	['ë',    'ë',  true, 'e - diaeresis'],
+	['ì',  'ì',  true, 'i - grave'],
+	['í',  'í',  true, 'i - acute'],
+	['î',   'î',  true, 'i - circumflex'],
+	['ï',    'ï',  true, 'i - diaeresis'],
+	['ð',     'ð',  true, 'eth'],
+	['ñ',  'ñ',  true, 'n - tilde'],
+	['ò',  'ò',  true, 'o - grave'],
+	['ó',  'ó',  true, 'o - acute'],
+	['ô',   'ô',  true, 'o - circumflex'],
+	['õ',  'õ',  true, 'o - tilde'],
+	['ö',    'ö',  true, 'o - diaeresis'],
+	['ø',  'ø',  true, 'o slash'],
+	['œ',   'œ',  true, 'ligature oe'],
+	['š',  'š',  true, 's - caron'],
+	['ù',  'ù',  true, 'u - grave'],
+	['ú',  'ú',  true, 'u - acute'],
+	['û',   'û',  true, 'u - circumflex'],
+	['ü',    'ü',  true, 'u - diaeresis'],
+	['ý',  'ý',  true, 'y - acute'],
+	['þ',   'þ',  true, 'thorn'],
+	['ÿ',    'ÿ',  true, 'y - diaeresis'],
+    ['Α',   'Α',  true, 'Alpha'],
+	['Β',    'Β',  true, 'Beta'],
+	['Γ',   'Γ',  true, 'Gamma'],
+	['Δ',   'Δ',  true, 'Delta'],
+	['Ε', 'Ε',  true, 'Epsilon'],
+	['Ζ',    'Ζ',  true, 'Zeta'],
+	['Η',     'Η',  true, 'Eta'],
+	['Θ',   'Θ',  true, 'Theta'],
+	['Ι',    'Ι',  true, 'Iota'],
+	['Κ',   'Κ',  true, 'Kappa'],
+	['Λ',  'Λ',  true, 'Lambda'],
+	['Μ',      'Μ',  true, 'Mu'],
+	['Ν',      'Ν',  true, 'Nu'],
+	['Ξ',      'Ξ',  true, 'Xi'],
+	['Ο', 'Ο',  true, 'Omicron'],
+	['Π',      'Π',  true, 'Pi'],
+	['Ρ',     'Ρ',  true, 'Rho'],
+	['Σ',   'Σ',  true, 'Sigma'],
+	['Τ',     'Τ',  true, 'Tau'],
+	['Υ', 'Υ',  true, 'Upsilon'],
+	['Φ',     'Φ',  true, 'Phi'],
+	['Χ',     'Χ',  true, 'Chi'],
+	['Ψ',     'Ψ',  true, 'Psi'],
+	['Ω',   'Ω',  true, 'Omega'],
+	['α',   'α',  true, 'alpha'],
+	['β',    'β',  true, 'beta'],
+	['γ',   'γ',  true, 'gamma'],
+	['δ',   'δ',  true, 'delta'],
+	['ε', 'ε',  true, 'epsilon'],
+	['ζ',    'ζ',  true, 'zeta'],
+	['η',     'η',  true, 'eta'],
+	['θ',   'θ',  true, 'theta'],
+	['ι',    'ι',  true, 'iota'],
+	['κ',   'κ',  true, 'kappa'],
+	['λ',  'λ',  true, 'lambda'],
+	['μ',      'μ',  true, 'mu'],
+	['ν',      'ν',  true, 'nu'],
+	['ξ',      'ξ',  true, 'xi'],
+	['ο', 'ο',  true, 'omicron'],
+	['π',      'π',  true, 'pi'],
+	['ρ',     'ρ',  true, 'rho'],
+	['ς',  'ς',  true, 'final sigma'],
+	['σ',   'σ',  true, 'sigma'],
+	['τ',     'τ',  true, 'tau'],
+	['υ', 'υ',  true, 'upsilon'],
+	['φ',     'φ',  true, 'phi'],
+	['χ',     'χ',  true, 'chi'],
+	['ψ',     'ψ',  true, 'psi'],
+	['ω',   'ω',  true, 'omega'],
+// symbols
+	['ℵ', 'ℵ', false,'alef symbol'],
+	['ϖ',     'ϖ',  false,'pi symbol'],
+	['ℜ',    'ℜ', false,'real part symbol'],
+	['ϑ','ϑ',  false,'theta symbol'],
+	['ϒ',   'ϒ',  false,'upsilon - hook symbol'],
+	['℘',  '℘', false,'Weierstrass p'],
+	['ℑ',   'ℑ', false,'imaginary part'],
+// arrows
+	['←',    '←', true, 'leftwards arrow'],
+	['↑',    '↑', true, 'upwards arrow'],
+	['→',    '→', true, 'rightwards arrow'],
+	['↓',    '↓', true, 'downwards arrow'],
+	['↔',    '↔', true, 'left right arrow'],
+	['↵',   '↵', false,'carriage return'],
+	['⇐',    '⇐', false,'leftwards double arrow'],
+	['⇑',    '⇑', false,'upwards double arrow'],
+	['⇒',    '⇒', false,'rightwards double arrow'],
+	['⇓',    '⇓', false,'downwards double arrow'],
+	['⇔',    '⇔', false,'left right double arrow'],
+	['&there4;',  '∴', false,'therefore'],
+	['⊂',     '⊂', false,'subset of'],
+	['⊃',     '⊃', false,'superset of'],
+	['⊄',    '⊄', false,'not a subset of'],
+	['⊆',    '⊆', false,'subset of or equal to'],
+	['⊇',    '⊇', false,'superset of or equal to'],
+	['⊕',   '⊕', false,'circled plus'],
+	['⊗',  '⊗', false,'circled times'],
+	['⊥',    '⊥', false,'perpendicular'],
+	['⋅',    '⋅', false,'dot operator'],
+	['⌈',   '⌈', false,'left ceiling'],
+	['⌉',   '⌉', false,'right ceiling'],
+	['⌊',  '⌊', false,'left floor'],
+	['⌋',  '⌋', false,'right floor'],
+	['⟨',    '〈', false,'left-pointing angle bracket'],
+	['⟩',    '〉', false,'right-pointing angle bracket'],
+	['◊',     '◊', true,'lozenge'],
+	['♠',  '♠', false,'black spade suit'],
+	['♣',   '♣', true, 'black club suit'],
+	['♥',  '♥', true, 'black heart suit'],
+	['♦',   '♦', true, 'black diamond suit'],
+	[' ',    ' ', false,'en space'],
+	[' ',    ' ', false,'em space'],
+	[' ',  ' ', false,'thin space'],
+	['‌',    '‌', false,'zero width non-joiner'],
+	['‍',     '‍', false,'zero width joiner'],
+	['‎',     '‎', false,'left-to-right mark'],
+	['‏',     '‏', false,'right-to-left mark'],
+	['­',     '­',  false,'soft hyphen']
+];
+
+function renderCharMapHTML() {
+	var charsPerRow = 20, tdWidth=20, tdHeight=20;
+	var html = '<table border="0" cellspacing="1" cellpadding="0" width="' + (tdWidth*charsPerRow) + '"><tr height="' + tdHeight + '">';
+	var cols=-1;
+	for (var i=0; i<charmap.length; i++) {
+		if (charmap[i][2]==true) {
+			cols++;
+			html += ''
+				+ '<td width="' + tdWidth + '" height="' + tdHeight + '" class="charmap"'
+				+ ' onmouseover="this.className=\'charmapOver\';'
+				+ 'previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');"'
+				+ ' onmouseout="this.className=\'charmap\';"'
+				+ ' nowrap="nowrap" onclick="insertChar(\'' + charmap[i][1].substring(2,charmap[i][1].length-1) + '\');"><a style="text-decoration: none;" onfocus="previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');" href="javascript:insertChar(\'' + charmap[i][1].substring(2,charmap[i][1].length-1) + '\');" onclick="return false;" onmousedown="return false;" title="' + charmap[i][3] + '">'
+				+ charmap[i][1]
+				+ '</a></td>';
+			if ((cols+1) % charsPerRow == 0)
+				html += '</tr><tr height="' + tdHeight + '">';
+		}
+	 }
+	if (cols % charsPerRow > 0) {
+		var padd = charsPerRow - (cols % charsPerRow);
+		for (var i=0; i<padd-1; i++)
+			html += '<td width="' + tdWidth + '" height="' + tdHeight + '" class="charmap"> </td>';
+	}
+	html += '</tr></table>';
+	document.write(html);
+}
+
+function insertChar(chr) {
+	tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';');
+
+	// Refocus in window
+	if (tinyMCEPopup.isWindow)
+		window.focus();
+
+	tinyMCEPopup.close();
+}
+
+function previewChar(codeA, codeB, codeN) {
+	var elmA = document.getElementById('codeA');
+	var elmB = document.getElementById('codeB');
+	var elmV = document.getElementById('codeV');
+	var elmN = document.getElementById('codeN');
+
+	if (codeA=='#160;') {
+		elmV.innerHTML = '__';
+	} else {
+		elmV.innerHTML = '&' + codeA;
+	}
+
+	elmB.innerHTML = '&' + codeA;
+	elmA.innerHTML = '&' + codeB;
+	elmN.innerHTML = codeN;
+}

Deleted: plog/trunk/js/tinymce/themes/advanced/jscripts/color_picker.js
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/jscripts/color_picker.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/themes/advanced/jscripts/color_picker.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,240 +0,0 @@
-var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false;
-
-var colors = new Array(
-	"#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033",
-	"#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099",
-	"#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff",
-	"#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033",
-	"#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399",
-	"#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff",
-	"#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333",
-	"#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399",
-	"#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff",
-	"#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633",
-	"#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699",
-	"#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff",
-	"#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633",
-	"#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999",
-	"#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff",
-	"#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933",
-	"#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999",
-	"#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff",
-	"#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33",
-	"#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99",
-	"#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff",
-	"#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33",
-	"#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99",
-	"#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff",
-	"#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33",
-	"#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99",
-	"#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff"
-);
-
-var named = {
-	'#F0F8FF':'AliceBlue','#FAEBD7':'AntiqueWhite','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige',
-	'#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'BlanchedAlmond','#0000FF':'Blue','#8A2BE2':'BlueViolet','#A52A2A':'Brown',
-	'#DEB887':'BurlyWood','#5F9EA0':'CadetBlue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'CornflowerBlue',
-	'#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'DarkBlue','#008B8B':'DarkCyan','#B8860B':'DarkGoldenRod',
-	'#A9A9A9':'DarkGray','#A9A9A9':'DarkGrey','#006400':'DarkGreen','#BDB76B':'DarkKhaki','#8B008B':'DarkMagenta','#556B2F':'DarkOliveGreen',
-	'#FF8C00':'Darkorange','#9932CC':'DarkOrchid','#8B0000':'DarkRed','#E9967A':'DarkSalmon','#8FBC8F':'DarkSeaGreen','#483D8B':'DarkSlateBlue',
-	'#2F4F4F':'DarkSlateGray','#2F4F4F':'DarkSlateGrey','#00CED1':'DarkTurquoise','#9400D3':'DarkViolet','#FF1493':'DeepPink','#00BFFF':'DeepSkyBlue',
-	'#696969':'DimGray','#696969':'DimGrey','#1E90FF':'DodgerBlue','#B22222':'FireBrick','#FFFAF0':'FloralWhite','#228B22':'ForestGreen',
-	'#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'GhostWhite','#FFD700':'Gold','#DAA520':'GoldenRod','#808080':'Gray','#808080':'Grey',
-	'#008000':'Green','#ADFF2F':'GreenYellow','#F0FFF0':'HoneyDew','#FF69B4':'HotPink','#CD5C5C':'IndianRed','#4B0082':'Indigo','#FFFFF0':'Ivory',
-	'#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'LavenderBlush','#7CFC00':'LawnGreen','#FFFACD':'LemonChiffon','#ADD8E6':'LightBlue',
-	'#F08080':'LightCoral','#E0FFFF':'LightCyan','#FAFAD2':'LightGoldenRodYellow','#D3D3D3':'LightGray','#D3D3D3':'LightGrey','#90EE90':'LightGreen',
-	'#FFB6C1':'LightPink','#FFA07A':'LightSalmon','#20B2AA':'LightSeaGreen','#87CEFA':'LightSkyBlue','#778899':'LightSlateGray','#778899':'LightSlateGrey',
-	'#B0C4DE':'LightSteelBlue','#FFFFE0':'LightYellow','#00FF00':'Lime','#32CD32':'LimeGreen','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon',
-	'#66CDAA':'MediumAquaMarine','#0000CD':'MediumBlue','#BA55D3':'MediumOrchid','#9370D8':'MediumPurple','#3CB371':'MediumSeaGreen','#7B68EE':'MediumSlateBlue',
-	'#00FA9A':'MediumSpringGreen','#48D1CC':'MediumTurquoise','#C71585':'MediumVioletRed','#191970':'MidnightBlue','#F5FFFA':'MintCream','#FFE4E1':'MistyRose','#FFE4B5':'Moccasin',
-	'#FFDEAD':'NavajoWhite','#000080':'Navy','#FDF5E6':'OldLace','#808000':'Olive','#6B8E23':'OliveDrab','#FFA500':'Orange','#FF4500':'OrangeRed','#DA70D6':'Orchid',
-	'#EEE8AA':'PaleGoldenRod','#98FB98':'PaleGreen','#AFEEEE':'PaleTurquoise','#D87093':'PaleVioletRed','#FFEFD5':'PapayaWhip','#FFDAB9':'PeachPuff',
-	'#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'PowderBlue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'RosyBrown','#4169E1':'RoyalBlue',
-	'#8B4513':'SaddleBrown','#FA8072':'Salmon','#F4A460':'SandyBrown','#2E8B57':'SeaGreen','#FFF5EE':'SeaShell','#A0522D':'Sienna','#C0C0C0':'Silver',
-	'#87CEEB':'SkyBlue','#6A5ACD':'SlateBlue','#708090':'SlateGray','#708090':'SlateGrey','#FFFAFA':'Snow','#00FF7F':'SpringGreen',
-	'#4682B4':'SteelBlue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet',
-	'#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'WhiteSmoke','#FFFF00':'Yellow','#9ACD32':'YellowGreen'
-};
-
-function init() {
-	var inputColor = convertRGBToHex(tinyMCE.getWindowArg('input_color'));
-
-	if (tinyMCE.isMSIE)
-		tinyMCEPopup.resizeToInnerSize();
-
-	generatePicker();
-
-	if (inputColor) {
-		changeFinalColor(inputColor);
-
-		col = convertHexToRGB(inputColor);
-
-		if (col)
-			updateLight(col.r, col.g, col.b);
-	}
-}
-
-function insertAction() {
-	var color = document.getElementById("color").value;
-
-	tinyMCEPopup.execCommand(tinyMCE.getWindowArg('command'), false, color);
-	tinyMCEPopup.close();
-}
-
-function showColor(color, name) {
-	if (name)
-		document.getElementById("colorname").innerHTML = name;
-
-	document.getElementById("preview").style.backgroundColor = color;
-	document.getElementById("color").value = color;
-}
-
-function convertRGBToHex(col) {
-	var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
-
-	if (!col)
-		return col;
-
-	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 {r : r, g : g, b : b};
-	}
-
-	return null;
-}
-
-function generatePicker() {
-	var el = document.getElementById('light'), h = '', i;
-
-	for (i = 0; i < detail; i++){
-		h += '<div id="gs'+i+'" style="background-color:#000000; width:15px; height:3px; border-style:none; border-width:0px;"'
-		+ ' onclick="changeFinalColor(this.style.backgroundColor)"'
-		+ ' onmousedown="isMouseDown = true; return false;"'
-		+ ' onmouseup="isMouseDown = false;"'
-		+ ' onmousemove="if (isMouseDown && isMouseOver) changeFinalColor(this.style.backgroundColor); return false;"'
-		+ ' onmouseover="isMouseOver = true;"'
-		+ ' onmouseout="isMouseOver = false;"'
-		+ '></div>';
-	}
-
-	el.innerHTML = h;
-}
-
-function generateWebColors() {
-	var el = document.getElementById('webcolors'), h = '', i;
-
-	if (el.className == 'generated')
-		return;
-
-	h += '<table border="0" cellspacing="1" cellpadding="0">'
-		+ '<tr>';
-
-	for (i=0; i<colors.length; i++) {
-		h += '<td bgcolor="' + colors[i] + '">'
-			+ '<a href="javascript:insertAction();" onfocus="showColor(\'' + colors[i] +  '\');" onmouseover="showColor(\'' + colors[i] +  '\');">'
-			+ '<img border="0" src="images/spacer.gif" width="10" height="10" title="' + colors[i] +  '" alt="' + colors[i] +  '" /></a></td>';
-		if ((i+1) % 18 == 0)
-			h += '</tr><tr>';
-	}
-
-	h += '</table>';
-
-	el.innerHTML = h;
-	el.className = 'generated';
-}
-
-function generateNamedColors() {
-	var el = document.getElementById('namedcolors'), h = '', n, v, i = 0;
-
-	if (el.className == 'generated')
-		return;
-
-	for (n in named) {
-		v = named[n];
-		h += '<a href="javascript:insertAction();" onmouseover="showColor(\'' + n +  '\',\'' + v + '\');" style="background-color: ' + n + '"><!-- IE --></a>'
-	}
-
-	el.innerHTML = h;
-	el.className = 'generated';
-}
-
-function dechex(n) {
-	return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16);
-}
-
-function computeColor(e) {
-	var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB;
-
-	x = e.offsetX ? e.offsetX : (e.target ? e.clientX - e.target.x : 0);
-	y = e.offsetY ? e.offsetY : (e.target ? e.clientY - e.target.y : 0);
-
-	partWidth = document.getElementById('colorpicker').width / 6;
-	partDetail = detail / 2;
-	imHeight = document.getElementById('colorpicker').height;
-
-	r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255;
-	g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255	+ (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth);
-	b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth);
-
-	coef = (imHeight - y) / imHeight;
-	r = 128 + (r - 128) * coef;
-	g = 128 + (g - 128) * coef;
-	b = 128 + (b - 128) * coef;
-
-	changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b));
-	updateLight(r, g, b);
-}
-
-function updateLight(r, g, b) {
-	var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color;
-
-	for (i=0; i<detail; i++) {
-		if ((i>=0) && (i<partDetail)) {
-			finalCoef = i / partDetail;
-			finalR = dechex(255 - (255 - r) * finalCoef);
-			finalG = dechex(255 - (255 - g) * finalCoef);
-			finalB = dechex(255 - (255 - b) * finalCoef);
-		} else {
-			finalCoef = 2 - i / partDetail;
-			finalR = dechex(r * finalCoef);
-			finalG = dechex(g * finalCoef);
-			finalB = dechex(b * finalCoef);
-		}
-
-		color = finalR + finalG + finalB;
-
-		document.getElementById('gs' + i).style.backgroundColor = '#'+color;
-	}
-}
-
-function changeFinalColor(color) {
-	if (color.indexOf('#') == -1)
-		color = convertRGBToHex(color);
-
-	document.getElementById('preview').style.backgroundColor = color;
-	document.getElementById('color').value = color;
-}
-
-window.focus();
\ No newline at end of file

Copied: plog/trunk/js/tinymce/themes/advanced/jscripts/color_picker.js (from rev 7165, plog/trunk/js/tinymce/themes/advanced/jscripts/color_picker.js)
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/jscripts/color_picker.js	                        (rev 0)
+++ plog/trunk/js/tinymce/themes/advanced/jscripts/color_picker.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,240 @@
+var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false;
+
+var colors = new Array(
+	"#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033",
+	"#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099",
+	"#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff",
+	"#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033",
+	"#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399",
+	"#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff",
+	"#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333",
+	"#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399",
+	"#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff",
+	"#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633",
+	"#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699",
+	"#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff",
+	"#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633",
+	"#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999",
+	"#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff",
+	"#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933",
+	"#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999",
+	"#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff",
+	"#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33",
+	"#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99",
+	"#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff",
+	"#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33",
+	"#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99",
+	"#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff",
+	"#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33",
+	"#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99",
+	"#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff"
+);
+
+var named = {
+	'#F0F8FF':'AliceBlue','#FAEBD7':'AntiqueWhite','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige',
+	'#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'BlanchedAlmond','#0000FF':'Blue','#8A2BE2':'BlueViolet','#A52A2A':'Brown',
+	'#DEB887':'BurlyWood','#5F9EA0':'CadetBlue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'CornflowerBlue',
+	'#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'DarkBlue','#008B8B':'DarkCyan','#B8860B':'DarkGoldenRod',
+	'#A9A9A9':'DarkGray','#A9A9A9':'DarkGrey','#006400':'DarkGreen','#BDB76B':'DarkKhaki','#8B008B':'DarkMagenta','#556B2F':'DarkOliveGreen',
+	'#FF8C00':'Darkorange','#9932CC':'DarkOrchid','#8B0000':'DarkRed','#E9967A':'DarkSalmon','#8FBC8F':'DarkSeaGreen','#483D8B':'DarkSlateBlue',
+	'#2F4F4F':'DarkSlateGray','#2F4F4F':'DarkSlateGrey','#00CED1':'DarkTurquoise','#9400D3':'DarkViolet','#FF1493':'DeepPink','#00BFFF':'DeepSkyBlue',
+	'#696969':'DimGray','#696969':'DimGrey','#1E90FF':'DodgerBlue','#B22222':'FireBrick','#FFFAF0':'FloralWhite','#228B22':'ForestGreen',
+	'#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'GhostWhite','#FFD700':'Gold','#DAA520':'GoldenRod','#808080':'Gray','#808080':'Grey',
+	'#008000':'Green','#ADFF2F':'GreenYellow','#F0FFF0':'HoneyDew','#FF69B4':'HotPink','#CD5C5C':'IndianRed','#4B0082':'Indigo','#FFFFF0':'Ivory',
+	'#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'LavenderBlush','#7CFC00':'LawnGreen','#FFFACD':'LemonChiffon','#ADD8E6':'LightBlue',
+	'#F08080':'LightCoral','#E0FFFF':'LightCyan','#FAFAD2':'LightGoldenRodYellow','#D3D3D3':'LightGray','#D3D3D3':'LightGrey','#90EE90':'LightGreen',
+	'#FFB6C1':'LightPink','#FFA07A':'LightSalmon','#20B2AA':'LightSeaGreen','#87CEFA':'LightSkyBlue','#778899':'LightSlateGray','#778899':'LightSlateGrey',
+	'#B0C4DE':'LightSteelBlue','#FFFFE0':'LightYellow','#00FF00':'Lime','#32CD32':'LimeGreen','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon',
+	'#66CDAA':'MediumAquaMarine','#0000CD':'MediumBlue','#BA55D3':'MediumOrchid','#9370D8':'MediumPurple','#3CB371':'MediumSeaGreen','#7B68EE':'MediumSlateBlue',
+	'#00FA9A':'MediumSpringGreen','#48D1CC':'MediumTurquoise','#C71585':'MediumVioletRed','#191970':'MidnightBlue','#F5FFFA':'MintCream','#FFE4E1':'MistyRose','#FFE4B5':'Moccasin',
+	'#FFDEAD':'NavajoWhite','#000080':'Navy','#FDF5E6':'OldLace','#808000':'Olive','#6B8E23':'OliveDrab','#FFA500':'Orange','#FF4500':'OrangeRed','#DA70D6':'Orchid',
+	'#EEE8AA':'PaleGoldenRod','#98FB98':'PaleGreen','#AFEEEE':'PaleTurquoise','#D87093':'PaleVioletRed','#FFEFD5':'PapayaWhip','#FFDAB9':'PeachPuff',
+	'#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'PowderBlue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'RosyBrown','#4169E1':'RoyalBlue',
+	'#8B4513':'SaddleBrown','#FA8072':'Salmon','#F4A460':'SandyBrown','#2E8B57':'SeaGreen','#FFF5EE':'SeaShell','#A0522D':'Sienna','#C0C0C0':'Silver',
+	'#87CEEB':'SkyBlue','#6A5ACD':'SlateBlue','#708090':'SlateGray','#708090':'SlateGrey','#FFFAFA':'Snow','#00FF7F':'SpringGreen',
+	'#4682B4':'SteelBlue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet',
+	'#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'WhiteSmoke','#FFFF00':'Yellow','#9ACD32':'YellowGreen'
+};
+
+function init() {
+	var inputColor = convertRGBToHex(tinyMCE.getWindowArg('input_color'));
+
+	if (tinyMCE.isMSIE)
+		tinyMCEPopup.resizeToInnerSize();
+
+	generatePicker();
+
+	if (inputColor) {
+		changeFinalColor(inputColor);
+
+		col = convertHexToRGB(inputColor);
+
+		if (col)
+			updateLight(col.r, col.g, col.b);
+	}
+}
+
+function insertAction() {
+	var color = document.getElementById("color").value;
+
+	tinyMCEPopup.execCommand(tinyMCE.getWindowArg('command'), false, color);
+	tinyMCEPopup.close();
+}
+
+function showColor(color, name) {
+	if (name)
+		document.getElementById("colorname").innerHTML = name;
+
+	document.getElementById("preview").style.backgroundColor = color;
+	document.getElementById("color").value = color;
+}
+
+function convertRGBToHex(col) {
+	var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
+
+	if (!col)
+		return col;
+
+	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 {r : r, g : g, b : b};
+	}
+
+	return null;
+}
+
+function generatePicker() {
+	var el = document.getElementById('light'), h = '', i;
+
+	for (i = 0; i < detail; i++){
+		h += '<div id="gs'+i+'" style="background-color:#000000; width:15px; height:3px; border-style:none; border-width:0px;"'
+		+ ' onclick="changeFinalColor(this.style.backgroundColor)"'
+		+ ' onmousedown="isMouseDown = true; return false;"'
+		+ ' onmouseup="isMouseDown = false;"'
+		+ ' onmousemove="if (isMouseDown && isMouseOver) changeFinalColor(this.style.backgroundColor); return false;"'
+		+ ' onmouseover="isMouseOver = true;"'
+		+ ' onmouseout="isMouseOver = false;"'
+		+ '></div>';
+	}
+
+	el.innerHTML = h;
+}
+
+function generateWebColors() {
+	var el = document.getElementById('webcolors'), h = '', i;
+
+	if (el.className == 'generated')
+		return;
+
+	h += '<table border="0" cellspacing="1" cellpadding="0">'
+		+ '<tr>';
+
+	for (i=0; i<colors.length; i++) {
+		h += '<td bgcolor="' + colors[i] + '">'
+			+ '<a href="javascript:insertAction();" onfocus="showColor(\'' + colors[i] +  '\');" onmouseover="showColor(\'' + colors[i] +  '\');">'
+			+ '<img border="0" src="images/spacer.gif" width="10" height="10" title="' + colors[i] +  '" alt="' + colors[i] +  '" /></a></td>';
+		if ((i+1) % 18 == 0)
+			h += '</tr><tr>';
+	}
+
+	h += '</table>';
+
+	el.innerHTML = h;
+	el.className = 'generated';
+}
+
+function generateNamedColors() {
+	var el = document.getElementById('namedcolors'), h = '', n, v, i = 0;
+
+	if (el.className == 'generated')
+		return;
+
+	for (n in named) {
+		v = named[n];
+		h += '<a href="javascript:insertAction();" onmouseover="showColor(\'' + n +  '\',\'' + v + '\');" style="background-color: ' + n + '"><!-- IE --></a>'
+	}
+
+	el.innerHTML = h;
+	el.className = 'generated';
+}
+
+function dechex(n) {
+	return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16);
+}
+
+function computeColor(e) {
+	var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB;
+
+	x = e.offsetX ? e.offsetX : (e.target ? e.clientX - e.target.x : 0);
+	y = e.offsetY ? e.offsetY : (e.target ? e.clientY - e.target.y : 0);
+
+	partWidth = document.getElementById('colorpicker').width / 6;
+	partDetail = detail / 2;
+	imHeight = document.getElementById('colorpicker').height;
+
+	r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255;
+	g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255	+ (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth);
+	b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth);
+
+	coef = (imHeight - y) / imHeight;
+	r = 128 + (r - 128) * coef;
+	g = 128 + (g - 128) * coef;
+	b = 128 + (b - 128) * coef;
+
+	changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b));
+	updateLight(r, g, b);
+}
+
+function updateLight(r, g, b) {
+	var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color;
+
+	for (i=0; i<detail; i++) {
+		if ((i>=0) && (i<partDetail)) {
+			finalCoef = i / partDetail;
+			finalR = dechex(255 - (255 - r) * finalCoef);
+			finalG = dechex(255 - (255 - g) * finalCoef);
+			finalB = dechex(255 - (255 - b) * finalCoef);
+		} else {
+			finalCoef = 2 - i / partDetail;
+			finalR = dechex(r * finalCoef);
+			finalG = dechex(g * finalCoef);
+			finalB = dechex(b * finalCoef);
+		}
+
+		color = finalR + finalG + finalB;
+
+		document.getElementById('gs' + i).style.backgroundColor = '#'+color;
+	}
+}
+
+function changeFinalColor(color) {
+	if (color.indexOf('#') == -1)
+		color = convertRGBToHex(color);
+
+	document.getElementById('preview').style.backgroundColor = color;
+	document.getElementById('color').value = color;
+}
+
+window.focus();
\ No newline at end of file

Deleted: plog/trunk/js/tinymce/themes/advanced/jscripts/image.js
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/jscripts/image.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/themes/advanced/jscripts/image.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,81 +0,0 @@
-var url = tinyMCE.getParam("external_image_list_url");
-if (url != null) {
-	// Fix relative
-	if (url.charAt(0) != '/' && url.indexOf('://') == -1)
-		url = tinyMCE.documentBasePath + "/" + url;
-
-	document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '"></sc'+'ript>');
-}
-
-function insertImage() {
-	var src = document.forms[0].src.value;
-	var alt = document.forms[0].alt.value;
-	var border = document.forms[0].border.value;
-	var vspace = document.forms[0].vspace.value;
-	var hspace = document.forms[0].hspace.value;
-	var width = document.forms[0].width.value;
-	var height = document.forms[0].height.value;
-	var align = document.forms[0].align.options[document.forms[0].align.selectedIndex].value;
-
-	tinyMCEPopup.restoreSelection();
-	tinyMCE.themes['advanced']._insertImage(src, alt, border, hspace, vspace, width, height, align);
-	tinyMCEPopup.close();
-}
-
-function init() {
-	tinyMCEPopup.resizeToInnerSize();
-
-	document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image');
-
-	var formObj = document.forms[0];
-
-	for (var i=0; i<document.forms[0].align.options.length; i++) {
-		if (document.forms[0].align.options[i].value == tinyMCE.getWindowArg('align'))
-			document.forms[0].align.options.selectedIndex = i;
-	}
-
-	formObj.src.value = tinyMCE.getWindowArg('src');
-	formObj.alt.value = tinyMCE.getWindowArg('alt');
-	formObj.border.value = tinyMCE.getWindowArg('border');
-	formObj.vspace.value = tinyMCE.getWindowArg('vspace');
-	formObj.hspace.value = tinyMCE.getWindowArg('hspace');
-	formObj.width.value = tinyMCE.getWindowArg('width');
-	formObj.height.value = tinyMCE.getWindowArg('height');
-	formObj.insert.value = tinyMCE.getLang('lang_' + tinyMCE.getWindowArg('action'), 'Insert', true); 
-
-	// Handle file browser
-	if (isVisible('srcbrowser'))
-		document.getElementById('src').style.width = '180px';
-
-	// Auto select image in list
-	if (typeof(tinyMCEImageList) != "undefined" && tinyMCEImageList.length > 0) {
-		for (var i=0; i<formObj.image_list.length; i++) {
-			if (formObj.image_list.options[i].value == tinyMCE.getWindowArg('src'))
-				formObj.image_list.options[i].selected = true;
-		}
-	}
-}
-
-var preloadImg = new Image();
-
-function resetImageData() {
-	var formObj = document.forms[0];
-	formObj.width.value = formObj.height.value = "";	
-}
-
-function updateImageData() {
-	var formObj = document.forms[0];
-
-	if (formObj.width.value == "")
-		formObj.width.value = preloadImg.width;
-
-	if (formObj.height.value == "")
-		formObj.height.value = preloadImg.height;
-}
-
-function getImageData() {
-	preloadImg = new Image();
-	tinyMCE.addEvent(preloadImg, "load", updateImageData);
-	tinyMCE.addEvent(preloadImg, "error", function () {var formObj = document.forms[0];formObj.width.value = formObj.height.value = "";});
-	preloadImg.src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], document.forms[0].src.value);
-}

Copied: plog/trunk/js/tinymce/themes/advanced/jscripts/image.js (from rev 7165, plog/trunk/js/tinymce/themes/advanced/jscripts/image.js)
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/jscripts/image.js	                        (rev 0)
+++ plog/trunk/js/tinymce/themes/advanced/jscripts/image.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,81 @@
+var url = tinyMCE.getParam("external_image_list_url");
+if (url != null) {
+	// Fix relative
+	if (url.charAt(0) != '/' && url.indexOf('://') == -1)
+		url = tinyMCE.documentBasePath + "/" + url;
+
+	document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '"></sc'+'ript>');
+}
+
+function insertImage() {
+	var src = document.forms[0].src.value;
+	var alt = document.forms[0].alt.value;
+	var border = document.forms[0].border.value;
+	var vspace = document.forms[0].vspace.value;
+	var hspace = document.forms[0].hspace.value;
+	var width = document.forms[0].width.value;
+	var height = document.forms[0].height.value;
+	var align = document.forms[0].align.options[document.forms[0].align.selectedIndex].value;
+
+	tinyMCEPopup.restoreSelection();
+	tinyMCE.themes['advanced']._insertImage(src, alt, border, hspace, vspace, width, height, align);
+	tinyMCEPopup.close();
+}
+
+function init() {
+	tinyMCEPopup.resizeToInnerSize();
+
+	document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image');
+
+	var formObj = document.forms[0];
+
+	for (var i=0; i<document.forms[0].align.options.length; i++) {
+		if (document.forms[0].align.options[i].value == tinyMCE.getWindowArg('align'))
+			document.forms[0].align.options.selectedIndex = i;
+	}
+
+	formObj.src.value = tinyMCE.getWindowArg('src');
+	formObj.alt.value = tinyMCE.getWindowArg('alt');
+	formObj.border.value = tinyMCE.getWindowArg('border');
+	formObj.vspace.value = tinyMCE.getWindowArg('vspace');
+	formObj.hspace.value = tinyMCE.getWindowArg('hspace');
+	formObj.width.value = tinyMCE.getWindowArg('width');
+	formObj.height.value = tinyMCE.getWindowArg('height');
+	formObj.insert.value = tinyMCE.getLang('lang_' + tinyMCE.getWindowArg('action'), 'Insert', true); 
+
+	// Handle file browser
+	if (isVisible('srcbrowser'))
+		document.getElementById('src').style.width = '180px';
+
+	// Auto select image in list
+	if (typeof(tinyMCEImageList) != "undefined" && tinyMCEImageList.length > 0) {
+		for (var i=0; i<formObj.image_list.length; i++) {
+			if (formObj.image_list.options[i].value == tinyMCE.getWindowArg('src'))
+				formObj.image_list.options[i].selected = true;
+		}
+	}
+}
+
+var preloadImg = new Image();
+
+function resetImageData() {
+	var formObj = document.forms[0];
+	formObj.width.value = formObj.height.value = "";	
+}
+
+function updateImageData() {
+	var formObj = document.forms[0];
+
+	if (formObj.width.value == "")
+		formObj.width.value = preloadImg.width;
+
+	if (formObj.height.value == "")
+		formObj.height.value = preloadImg.height;
+}
+
+function getImageData() {
+	preloadImg = new Image();
+	tinyMCE.addEvent(preloadImg, "load", updateImageData);
+	tinyMCE.addEvent(preloadImg, "error", function () {var formObj = document.forms[0];formObj.width.value = formObj.height.value = "";});
+	preloadImg.src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], document.forms[0].src.value);
+}

Deleted: plog/trunk/js/tinymce/themes/advanced/jscripts/link.js
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/jscripts/link.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/themes/advanced/jscripts/link.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,74 +0,0 @@
-var url = tinyMCE.getParam("external_link_list_url");
-if (url != null) {
-	// Fix relative
-	if (url.charAt(0) != '/' && url.indexOf('://') == -1)
-		url = tinyMCE.documentBasePath + "/" + url;
-
-	document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '"></sc'+'ript>');
-}
-
-function init() {
-	tinyMCEPopup.resizeToInnerSize();
-
-	document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','theme_advanced_link');
-
-	// Handle file browser
-	if (isVisible('hrefbrowser'))
-		document.getElementById('href').style.width = '180px';
-
-	var formObj = document.forms[0];
-
-	for (var i=0; i<document.forms[0].target.options.length; i++) {
-		var option = document.forms[0].target.options[i];
-
-		if (option.value == tinyMCE.getWindowArg('target'))
-			option.selected = true;
-	}
-
-	document.forms[0].href.value = tinyMCE.getWindowArg('href');
-	document.forms[0].linktitle.value = tinyMCE.getWindowArg('title');
-	document.forms[0].insert.value = tinyMCE.getLang('lang_' + tinyMCE.getWindowArg('action'), 'Insert', true); 
-
-	addClassesToList('styleSelect', 'theme_advanced_link_styles');
-	selectByValue(formObj, 'styleSelect', tinyMCE.getWindowArg('className'), true);
-
-	// Hide css select row if no CSS classes
-	if (formObj.styleSelect && formObj.styleSelect.options.length <= 1) {
-		var sr = document.getElementById('styleSelectRow');
-		sr.style.display = 'none';
-		sr.parentNode.removeChild(sr);
-	}
-
-	// Auto select link in list
-	if (typeof(tinyMCELinkList) != "undefined" && tinyMCELinkList.length > 0) {
-		var formObj = document.forms[0];
-
-		for (var i=0; i<formObj.link_list.length; i++) {
-			if (formObj.link_list.options[i].value == tinyMCE.getWindowArg('href'))
-				formObj.link_list.options[i].selected = true;
-		}
-	}
-}
-
-function checkPrefix(n) {
-	if (Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCE.getLang('lang_is_email')))
-		n.value = 'mailto:' + n.value;
-
-	if (/^\s*www./i.test(n.value) && confirm(tinyMCE.getLang('lang_is_external')))
-		n.value = 'http://' + n.value;
-}
-
-function insertLink() {
-	var href = document.forms[0].href.value;
-	var target = document.forms[0].target.options[document.forms[0].target.selectedIndex].value;
-	var title = document.forms[0].linktitle.value;
-	var style_class = document.forms[0].styleSelect ? document.forms[0].styleSelect.value : "";
-	var dummy;
-
-	if (target == '_self')
-		target = '';
-
-	tinyMCEPopup.restoreSelection();
-	tinyMCE.themes['advanced']._insertLink(href, target, title, dummy, style_class);
-	tinyMCEPopup.close();
-}

Copied: plog/trunk/js/tinymce/themes/advanced/jscripts/link.js (from rev 7165, plog/trunk/js/tinymce/themes/advanced/jscripts/link.js)
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/jscripts/link.js	                        (rev 0)
+++ plog/trunk/js/tinymce/themes/advanced/jscripts/link.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,74 @@
+var url = tinyMCE.getParam("external_link_list_url");
+if (url != null) {
+	// Fix relative
+	if (url.charAt(0) != '/' && url.indexOf('://') == -1)
+		url = tinyMCE.documentBasePath + "/" + url;
+
+	document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '"></sc'+'ript>');
+}
+
+function init() {
+	tinyMCEPopup.resizeToInnerSize();
+
+	document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','theme_advanced_link');
+
+	// Handle file browser
+	if (isVisible('hrefbrowser'))
+		document.getElementById('href').style.width = '180px';
+
+	var formObj = document.forms[0];
+
+	for (var i=0; i<document.forms[0].target.options.length; i++) {
+		var option = document.forms[0].target.options[i];
+
+		if (option.value == tinyMCE.getWindowArg('target'))
+			option.selected = true;
+	}
+
+	document.forms[0].href.value = tinyMCE.getWindowArg('href');
+	document.forms[0].linktitle.value = tinyMCE.getWindowArg('title');
+	document.forms[0].insert.value = tinyMCE.getLang('lang_' + tinyMCE.getWindowArg('action'), 'Insert', true); 
+
+	addClassesToList('styleSelect', 'theme_advanced_link_styles');
+	selectByValue(formObj, 'styleSelect', tinyMCE.getWindowArg('className'), true);
+
+	// Hide css select row if no CSS classes
+	if (formObj.styleSelect && formObj.styleSelect.options.length <= 1) {
+		var sr = document.getElementById('styleSelectRow');
+		sr.style.display = 'none';
+		sr.parentNode.removeChild(sr);
+	}
+
+	// Auto select link in list
+	if (typeof(tinyMCELinkList) != "undefined" && tinyMCELinkList.length > 0) {
+		var formObj = document.forms[0];
+
+		for (var i=0; i<formObj.link_list.length; i++) {
+			if (formObj.link_list.options[i].value == tinyMCE.getWindowArg('href'))
+				formObj.link_list.options[i].selected = true;
+		}
+	}
+}
+
+function checkPrefix(n) {
+	if (Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCE.getLang('lang_is_email')))
+		n.value = 'mailto:' + n.value;
+
+	if (/^\s*www./i.test(n.value) && confirm(tinyMCE.getLang('lang_is_external')))
+		n.value = 'http://' + n.value;
+}
+
+function insertLink() {
+	var href = document.forms[0].href.value;
+	var target = document.forms[0].target.options[document.forms[0].target.selectedIndex].value;
+	var title = document.forms[0].linktitle.value;
+	var style_class = document.forms[0].styleSelect ? document.forms[0].styleSelect.value : "";
+	var dummy;
+
+	if (target == '_self')
+		target = '';
+
+	tinyMCEPopup.restoreSelection();
+	tinyMCE.themes['advanced']._insertLink(href, target, title, dummy, style_class);
+	tinyMCEPopup.close();
+}

Deleted: plog/trunk/js/tinymce/themes/advanced/jscripts/source_editor.js
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/jscripts/source_editor.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/themes/advanced/jscripts/source_editor.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,59 +0,0 @@
-function saveContent() {
-	tinyMCE.setContent(document.getElementById('htmlSource').value);
-	tinyMCE.closeWindow(window);
-}
-
-function onLoadInit() {
-	tinyMCEPopup.resizeToInnerSize();
-
-	// Remove Gecko spellchecking
-	if (tinyMCE.isGecko)
-		document.body.spellcheck = tinyMCE.getParam("gecko_spellcheck");
-
-	document.getElementById('htmlSource').value = tinyMCE.getContent(tinyMCE.getWindowArg('editor_id'));
-
-	resizeInputs();
-
-	if (tinyMCE.getParam("theme_advanced_source_editor_wrap", true)) {
-		setWrap('soft');
-		document.getElementById('wraped').checked = true;
-	}
-}
-
-function setWrap(val) {
-	var s = document.getElementById('htmlSource');
-
-	s.wrap = val;
-
-	if (tinyMCE.isGecko || tinyMCE.isOpera) {
-		var v = s.value;
-		var n = s.cloneNode(false);
-		n.setAttribute("wrap", val);
-		s.parentNode.replaceChild(n, s);
-		n.value = v;
-	}
-}
-
-function toggleWordWrap(elm) {
-	if (elm.checked)
-		setWrap('soft');
-	else
-		setWrap('off');
-}
-
-var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
-
-function resizeInputs() {
-	var el = document.getElementById('htmlSource');
-
-	if (!tinyMCE.isMSIE) {
-		 wHeight = self.innerHeight - 60;
-		 wWidth = self.innerWidth - 16;
-	} else {
-		 wHeight = document.body.clientHeight - 60;
-		 wWidth = document.body.clientWidth - 16;
-	}
-
-	el.style.height = Math.abs(wHeight) + 'px';
-	el.style.width  = Math.abs(wWidth) + 'px';
-}

Copied: plog/trunk/js/tinymce/themes/advanced/jscripts/source_editor.js (from rev 7165, plog/trunk/js/tinymce/themes/advanced/jscripts/source_editor.js)
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/jscripts/source_editor.js	                        (rev 0)
+++ plog/trunk/js/tinymce/themes/advanced/jscripts/source_editor.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,59 @@
+function saveContent() {
+	tinyMCE.setContent(document.getElementById('htmlSource').value);
+	tinyMCE.closeWindow(window);
+}
+
+function onLoadInit() {
+	tinyMCEPopup.resizeToInnerSize();
+
+	// Remove Gecko spellchecking
+	if (tinyMCE.isGecko)
+		document.body.spellcheck = tinyMCE.getParam("gecko_spellcheck");
+
+	document.getElementById('htmlSource').value = tinyMCE.getContent(tinyMCE.getWindowArg('editor_id'));
+
+	resizeInputs();
+
+	if (tinyMCE.getParam("theme_advanced_source_editor_wrap", true)) {
+		setWrap('soft');
+		document.getElementById('wraped').checked = true;
+	}
+}
+
+function setWrap(val) {
+	var s = document.getElementById('htmlSource');
+
+	s.wrap = val;
+
+	if (tinyMCE.isGecko || tinyMCE.isOpera) {
+		var v = s.value;
+		var n = s.cloneNode(false);
+		n.setAttribute("wrap", val);
+		s.parentNode.replaceChild(n, s);
+		n.value = v;
+	}
+}
+
+function toggleWordWrap(elm) {
+	if (elm.checked)
+		setWrap('soft');
+	else
+		setWrap('off');
+}
+
+var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
+
+function resizeInputs() {
+	var el = document.getElementById('htmlSource');
+
+	if (!tinyMCE.isMSIE) {
+		 wHeight = self.innerHeight - 60;
+		 wWidth = self.innerWidth - 16;
+	} else {
+		 wHeight = document.body.clientHeight - 60;
+		 wWidth = document.body.clientWidth - 16;
+	}
+
+	el.style.height = Math.abs(wHeight) + 'px';
+	el.style.width  = Math.abs(wWidth) + 'px';
+}

Modified: plog/trunk/js/tinymce/themes/advanced/langs/en.js
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/langs/en.js	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/js/tinymce/themes/advanced/langs/en.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,62 +1,93 @@
-tinyMCE.addI18n('en.advanced',{
-style_select:"Styles",
-font_size:"Font size",
-fontdefault:"Font family",
-block:"Format",
-paragraph:"Paragraph",
-div:"Div",
-address:"Address",
-pre:"Preformatted",
-h1:"Heading 1",
-h2:"Heading 2",
-h3:"Heading 3",
-h4:"Heading 4",
-h5:"Heading 5",
-h6:"Heading 6",
-blockquote:"Blockquote",
-code:"Code",
-samp:"Code sample",
-dt:"Definition term ",
-dd:"Definition description",
-bold_desc:"Bold (Ctrl+B)",
-italic_desc:"Italic (Ctrl+I)",
-underline_desc:"Underline (Ctrl+U)",
-striketrough_desc:"Strikethrough",
-justifyleft_desc:"Align left",
-justifycenter_desc:"Align center",
-justifyright_desc:"Align right",
-justifyfull_desc:"Align full",
-bullist_desc:"Unordered list",
-numlist_desc:"Ordered list",
-outdent_desc:"Outdent",
-indent_desc:"Indent",
-undo_desc:"Undo (Ctrl+Z)",
-redo_desc:"Redo (Ctrl+Y)",
-link_desc:"Insert/edit link",
-unlink_desc:"Unlink",
-image_desc:"Insert/edit image",
-cleanup_desc:"Cleanup messy code",
-code_desc:"Edit HTML Source",
-sub_desc:"Subscript",
-sup_desc:"Superscript",
-hr_desc:"Insert horizontal ruler",
-removeformat_desc:"Remove formatting",
-custom1_desc:"Your custom description here",
-forecolor_desc:"Select text color",
-backcolor_desc:"Select background color",
-charmap_desc:"Insert custom character",
-visualaid_desc:"Toggle guidelines/invisible elements",
-anchor_desc:"Insert/edit anchor",
-cut_desc:"Cut",
-copy_desc:"Copy",
-paste_desc:"Paste",
-image_props_desc:"Image properties",
-newdocument_desc:"New document",
-help_desc:"Help",
-blockquote_desc:"Blockquote",
-clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?",
-path:"Path",
-newdocument:"Are you sure you want clear all contents?",
-toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X",
-more_colors:"More colors"
-});
\ No newline at end of file
+// UK lang variables
+
+tinyMCE.addToLang('',{
+theme_style_select : '-- Styles --',
+theme_code_desc : 'Edit HTML Source',
+theme_code_title : 'HTML Source Editor',
+theme_code_wordwrap : 'Word wrap',
+theme_sub_desc : 'Subscript',
+theme_sup_desc : 'Superscript',
+theme_hr_desc : 'Insert horizontal ruler',
+theme_removeformat_desc : 'Remove formatting',
+theme_custom1_desc : 'Your custom description here',
+insert_image_border : 'Border',
+insert_image_dimensions : 'Dimensions',
+insert_image_vspace : 'Vertical space',
+insert_image_hspace : 'Horizontal space',
+insert_image_align : 'Alignment',
+insert_image_align_default : '-- Not set --',
+insert_image_align_baseline : 'Baseline',
+insert_image_align_top : 'Top',
+insert_image_align_middle : 'Middle',
+insert_image_align_bottom : 'Bottom',
+insert_image_align_texttop : 'TextTop',
+insert_image_align_absmiddle : 'Absolute Middle',
+insert_image_align_absbottom : 'Absolute Bottom',
+insert_image_align_left : 'Left',
+insert_image_align_right : 'Right',
+theme_font_size : '-- Font size --',
+theme_fontdefault : '-- Font family --',
+theme_block : '-- Format --',
+theme_paragraph : 'Paragraph',
+theme_div : 'Div',
+theme_address : 'Address',
+theme_pre : 'Preformatted',
+theme_h1 : 'Heading 1',
+theme_h2 : 'Heading 2',
+theme_h3 : 'Heading 3',
+theme_h4 : 'Heading 4',
+theme_h5 : 'Heading 5',
+theme_h6 : 'Heading 6',
+theme_blockquote : 'Blockquote',
+theme_code : 'Code',
+theme_samp : 'Code sample',
+theme_dt : 'Definition term ',
+theme_dd : 'Definition description',
+theme_colorpicker_title : 'Select a color',
+theme_colorpicker_apply : 'Apply',
+theme_forecolor_desc : 'Select text color',
+theme_backcolor_desc : 'Select background color',
+theme_charmap_title : 'Select custom character',
+theme_charmap_desc : 'Insert custom character',
+theme_visualaid_desc : 'Toggle guidelines/invisible elements',
+insert_anchor_title : 'Insert/edit anchor',
+insert_anchor_name : 'Anchor name',
+theme_anchor_desc : 'Insert/edit anchor',
+theme_insert_link_titlefield : 'Title',
+theme_clipboard_msg : 'Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?',
+theme_path : 'Path',
+cut_desc : 'Cut',
+copy_desc : 'Copy',
+paste_desc : 'Paste',
+link_list : 'Link list',
+image_list : 'Image list',
+browse : 'Browse',
+image_props_desc : 'Image properties',
+newdocument_desc : 'New document',
+class_name : 'Class',
+newdocument : 'Are you sure you want clear all contents?',
+about_title : 'About TinyMCE',
+about : 'About',
+license : 'License',
+plugins : 'Plugins',
+plugin : 'Plugin',
+author : 'Author',
+version : 'Version',
+loaded_plugins : 'Loaded plugins',
+help : 'Help',
+not_set : '-- Not set --',
+close : 'Close',
+toolbar_focus : 'Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X',
+invalid_data : 'Error: Invalid values entered, these are marked in red.',
+more_colors : 'More colors',
+color_picker_tab : 'Picker',
+color_picker : 'Color picker',
+web_colors_tab : 'Palette',
+web_colors : 'Palette colors',
+named_colors_tab : 'Named',
+named_colors : 'Named colors',
+color : 'Color:',
+color_name : 'Name:',
+is_email : 'The URL you entered seems to be an email address, do you want to add the required mailto: prefix?',
+is_external : 'The URL you entered seems to external link, do you want to add the required http:// prefix?'
+});

Deleted: plog/trunk/js/tinymce/themes/advanced/langs/en_dlg.js
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/langs/en_dlg.js	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/js/tinymce/themes/advanced/langs/en_dlg.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,51 +0,0 @@
-tinyMCE.addI18n('en.advanced_dlg',{
-about_title:"About TinyMCE",
-about_general:"About",
-about_help:"Help",
-about_license:"License",
-about_plugins:"Plugins",
-about_plugin:"Plugin",
-about_author:"Author",
-about_version:"Version",
-about_loaded:"Loaded plugins",
-anchor_title:"Insert/edit anchor",
-anchor_name:"Anchor name",
-code_title:"HTML Source Editor",
-code_wordwrap:"Word wrap",
-colorpicker_title:"Select a color",
-colorpicker_picker_tab:"Picker",
-colorpicker_picker_title:"Color picker",
-colorpicker_palette_tab:"Palette",
-colorpicker_palette_title:"Palette colors",
-colorpicker_named_tab:"Named",
-colorpicker_named_title:"Named colors",
-colorpicker_color:"Color:",
-colorpicker_name:"Name:",
-charmap_title:"Select custom character",
-image_title:"Insert/edit image",
-image_src:"Image URL",
-image_alt:"Image description",
-image_list:"Image list",
-image_border:"Border",
-image_dimensions:"Dimensions",
-image_vspace:"Vertical space",
-image_hspace:"Horizontal space",
-image_align:"Alignment",
-image_align_baseline:"Baseline",
-image_align_top:"Top",
-image_align_middle:"Middle",
-image_align_bottom:"Bottom",
-image_align_texttop:"Text top",
-image_align_textbottom:"Text bottom",
-image_align_left:"Left",
-image_align_right:"Right",
-link_title:"Insert/edit link",
-link_url:"Link URL",
-link_target:"Target",
-link_target_same:"Open link in the same window",
-link_target_blank:"Open link in a new window",
-link_titlefield:"Title",
-link_is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",
-link_is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?",
-link_list:"Link list"
-});
\ No newline at end of file

Modified: plog/trunk/js/tinymce/themes/advanced/link.htm
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/link.htm	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/js/tinymce/themes/advanced/link.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,18 +1,18 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-	<title>{#advanced_dlg.link_title}</title>
-	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
-	<script type="text/javascript" src="../../utils/mctabs.js"></script>
-	<script type="text/javascript" src="../../utils/form_utils.js"></script>
-	<script type="text/javascript" src="../../utils/validate.js"></script>
-	<script type="text/javascript" src="js/link.js"></script>
+	<title>{$lang_insert_link_title}</title>
+	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
+	<script language="javascript" type="text/javascript" src="../../utils/validate.js"></script>
+	<script language="javascript" type="text/javascript" src="jscripts/link.js"></script>
+	<base target="_self" />
 </head>
-<body id="link" style="display: none">
-<form onsubmit="LinkDialog.update();return false;" action="#">
+<body id="link" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
+<form onsubmit="insertLink();return false;" action="#">
 	<div class="tabs">
 		<ul>
-			<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advanced_dlg.link_title}</a></span></li>
+			<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_insert_link_title}</a></span></li>
 		</ul>
 	</div>
 
@@ -21,37 +21,80 @@
 
 		<table border="0" cellpadding="4" cellspacing="0">
           <tr>
-            <td class="nowrap"><label for="href">{#advanced_dlg.link_url}</label></td>
+            <td nowrap="nowrap"><label for="href">{$lang_insert_link_url}</label></td>
             <td><table border="0" cellspacing="0" cellpadding="0"> 
 				  <tr> 
-					<td><input id="href" name="href" type="text" class="mceFocus" value="" style="width: 200px" onchange="LinkDialog.checkPrefix(this);" /></td> 
+					<td><input id="href" name="href" type="text" value="" style="width: 200px" onchange="checkPrefix(this);" /></td> 
 					<td id="hrefbrowsercontainer"> </td>
 				  </tr> 
 				</table></td>
           </tr>
-		  <tr>
-			<td><label for="link_list">{#advanced_dlg.link_list}</label></td>
-			<td><select id="link_list" name="link_list" onchange="document.getElementById('href').value=this.options[this.selectedIndex].value;"></select></td>
-		  </tr>
-		<tr>
-			<td><label id="targetlistlabel" for="targetlist">{#advanced_dlg.link_target}</label></td>
-			<td><select id="target_list" name="target_list"></select></td>
-		</tr>
+		  <!-- Link list -->
+		  <script language="javascript">
+			if (typeof(tinyMCELinkList) != "undefined" && tinyMCELinkList.length > 0) {
+				var html = "";
+
+				html += '<tr><td><label for="link_list">{$lang_link_list}</label></td>';
+				html += '<td><select id="link_list" name="link_list" style="width: 200px" onchange="this.form.href.value=this.options[this.selectedIndex].value;">';
+				html += '<option value="">---</option>';
+
+				for (var i=0; i<tinyMCELinkList.length; i++)
+					html += '<option value="' + tinyMCELinkList[i][1] + '">' + tinyMCELinkList[i][0] + '</option>';
+
+				html += '</select></td></tr>';
+
+				document.write(html);
+			}
+		  </script>
+		  <!-- /Link list -->
           <tr>
-            <td class="nowrap"><label for="linktitle">{#advanced_dlg.link_titlefield}</label></td>
-            <td><input id="linktitle" name="linktitle" type="text" value="" style="width: 200px" /></td>
+            <td nowrap="nowrap"><label for="target">{$lang_insert_link_target}</label></td>
+            <td><select id="target" name="target" style="width: 200px">
+                <option value="_self">{$lang_insert_link_target_same}</option>
+                <option value="_blank">{$lang_insert_link_target_blank}</option>
+				<script language="javascript">
+					var html = "";
+					var targets = tinyMCE.getParam('theme_advanced_link_targets', '').split(';');
+
+					for (var i=0; i<targets.length; i++) {
+						var key, value;
+
+						if (targets[i] == "")
+							continue;
+
+						key = targets[i].split('=')[0];
+						value = targets[i].split('=')[1];
+
+						html += '<option value="' + value + '">' + key + '</option>';
+					}
+
+					document.write(html);
+				</script>
+            </select></td>
           </tr>
-			<tr>
-				<td><label for="class_list">{#class_name}</label></td>
-				<td><select id="class_list" name="class_list"></select></td>
-			</tr>
+          <tr>
+            <td nowrap="nowrap"><label for="linktitle">{$lang_theme_insert_link_titlefield}</label></td>
+            <td><input id="linktitle" name="linktitle" type="text" value="" style="width: 200px"></td>
+          </tr>
+          <tr id="styleSelectRow">
+            <td><label for="styleSelect">{$lang_class_name}</label></td>
+            <td>
+			 <select id="styleSelect" name="styleSelect">
+                <option value="" selected>{$lang_theme_style_select}</option>
+             </select></td>
+          </tr>
         </table>
 		</div>
 	</div>
 
 	<div class="mceActionPanel">
-		<input type="submit" id="insert" name="insert" value="{#insert}" />
-		<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+		<div style="float: left">
+			<input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertLink();" />
+		</div>
+
+		<div style="float: right">
+			<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
+		</div>
 	</div>
 </form>
 </body>

Modified: plog/trunk/js/tinymce/themes/advanced/source_editor.htm
===================================================================
--- plog/trunk/js/tinymce/themes/advanced/source_editor.htm	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/js/tinymce/themes/advanced/source_editor.htm	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,24 +1,31 @@
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-	<title>{#advanced_dlg.code_title}</title>
-	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
-	<script type="text/javascript" src="js/source_editor.js"></script>
+	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+	<title>{$lang_theme_code_title}</title>
+	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script language="javascript" type="text/javascript" src="jscripts/source_editor.js"></script>
+	<base target="_self" />
 </head>
-<body onresize="resizeInputs();" style="display:none; overflow:hidden;">
-	<form name="source" onsubmit="saveContent();return false;" action="#">
-		<div style="float: left" class="title">{#advanced_dlg.code_title}</div>
+<body onload="tinyMCEPopup.executeOnLoad('onLoadInit();');" onresize="resizeInputs();" style="display: none">
+	<form name="source" onsubmit="saveContent();" action="#">
+		<div style="float: left" class="title">{$lang_theme_code_title}</div>
 
 		<div id="wrapline" style="float: right">
-			<input type="checkbox" name="wraped" id="wraped" onclick="toggleWordWrap(this);" class="wordWrapCode" /><label for="wraped">{#advanced_dlg.code_wordwrap}</label>
+			<input type="checkbox" name="wraped" id="wraped" onclick="toggleWordWrap(this);" class="wordWrapCode" /><label for="wraped">{$lang_theme_code_wordwrap}</label>
 		</div>
 
 		<br style="clear: both" />
 
-		<textarea name="htmlSource" id="htmlSource" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,monospace; font-size: 12px;" dir="ltr" wrap="off" class="mceFocus"></textarea>
+		<textarea name="htmlSource" id="htmlSource" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,monospace; font-size: 12px" dir="ltr" wrap="off"></textarea>
 
 		<div class="mceActionPanel">
-			<input type="submit" name="insert" value="{#update}" id="insert" />
-			<input type="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" />
+			<div style="float: left">
+				<input type="button" name="insert" value="{$lang_update}" onclick="saveContent();" id="insert" />
+			</div>
+
+			<div style="float: right">
+				<input type="button" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" id="cancel" />
+			</div>
 		</div>
 	</form>
 </body>

Deleted: plog/trunk/js/tinymce/themes/simple/css/editor_content.css
===================================================================
--- plog/trunk/js/tinymce/themes/simple/css/editor_content.css	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/themes/simple/css/editor_content.css	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,25 +0,0 @@
-body, td, pre {
-	font-family: Verdana, Arial, Helvetica, sans-serif;
-	font-size: 10px;
-}
-
-body {
-	background-color: #FFFFFF;
-}
-
-.mceVisualAid {
-	border: 1px dashed #BBBBBB;
-}
-
-/* MSIE specific */
-
-* html body {
-	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;	
-}

Copied: plog/trunk/js/tinymce/themes/simple/css/editor_content.css (from rev 7165, plog/trunk/js/tinymce/themes/simple/css/editor_content.css)
===================================================================
--- plog/trunk/js/tinymce/themes/simple/css/editor_content.css	                        (rev 0)
+++ plog/trunk/js/tinymce/themes/simple/css/editor_content.css	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,25 @@
+body, td, pre {
+	font-family: Verdana, Arial, Helvetica, sans-serif;
+	font-size: 10px;
+}
+
+body {
+	background-color: #FFFFFF;
+}
+
+.mceVisualAid {
+	border: 1px dashed #BBBBBB;
+}
+
+/* MSIE specific */
+
+* html body {
+	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;	
+}

Deleted: plog/trunk/js/tinymce/themes/simple/css/editor_popup.css
===================================================================
--- plog/trunk/js/tinymce/themes/simple/css/editor_popup.css	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/themes/simple/css/editor_popup.css	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,41 +0,0 @@
-body {
-	background-color: #F0F0EE;
-	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;
-}
-
-td {
-	font-family: Verdana, Arial, Helvetica, sans-serif;
-	font-size: 11px;
-}
-
-input {
-	background: #FFFFFF;
-	border: 1px solid #cccccc;
-}
-
-td, input, select, textarea {
-	font-family: Verdana, Arial, Helvetica, sans-serif;
-	font-size: 10px;
-}
-
-input, select, textarea {
-	border: 1px solid #808080;
-}
-
-.input_noborder {
-	border: 0;
-}
-
-.title {
-	font-size: 12px;
-	font-weight: bold;
-}
\ No newline at end of file

Copied: plog/trunk/js/tinymce/themes/simple/css/editor_popup.css (from rev 7165, plog/trunk/js/tinymce/themes/simple/css/editor_popup.css)
===================================================================
--- plog/trunk/js/tinymce/themes/simple/css/editor_popup.css	                        (rev 0)
+++ plog/trunk/js/tinymce/themes/simple/css/editor_popup.css	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,41 @@
+body {
+	background-color: #F0F0EE;
+	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;
+}
+
+td {
+	font-family: Verdana, Arial, Helvetica, sans-serif;
+	font-size: 11px;
+}
+
+input {
+	background: #FFFFFF;
+	border: 1px solid #cccccc;
+}
+
+td, input, select, textarea {
+	font-family: Verdana, Arial, Helvetica, sans-serif;
+	font-size: 10px;
+}
+
+input, select, textarea {
+	border: 1px solid #808080;
+}
+
+.input_noborder {
+	border: 0;
+}
+
+.title {
+	font-size: 12px;
+	font-weight: bold;
+}
\ No newline at end of file

Deleted: plog/trunk/js/tinymce/themes/simple/css/editor_ui.css
===================================================================
--- plog/trunk/js/tinymce/themes/simple/css/editor_ui.css	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/themes/simple/css/editor_ui.css	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,125 +0,0 @@
-.mceSeparatorLine {
-	border: 0;
-	padding: 0;
-	margin-left: 4px;
-	margin-right: 2px;
-}
-
-.mceSelectList {
-	font-family: "MS Sans Serif";
-	font-size: 7pt;
-	font-weight: normal;
-	margin-top: 2px;
-}
-
-.mceLabel, .mceLabelDisabled {
-	font-family: "MS Sans Serif";
-	font-size: 9pt;
-}
-
-.mceLabel {
-	color: #000000;
-}
-
-.mceLabelDisabled {
-	cursor: text;
-	color: #999999;
-}
-
-.mceEditor {
-	background: #F0F0EE;
-	border: 1px solid #cccccc;
-}
-
-.mceEditorArea {
-	font-family: "MS Sans Serif";
-	background: #FFFFFF;
-}
-
-.mceToolbar {
-	background: #F0F0EE;
-	border-top: 1px solid #cccccc;
-	line-height: 1px;
-	font-size: 1px;
-	padding-bottom: 1px;
-}
-
-.mceEditorIframe {
-	border: 0;
-}
-
-/* Button CSS rules */
-
-a.mceButtonDisabled img, a.mceButtonNormal img, a.mceButtonSelected img {
-	width: 20px;
-	height: 20px;
-	cursor: default;
-	margin-top: 1px;
-	margin-left: 1px;
-}
-
-a.mceButtonDisabled img {
-	border: 0 !important;
-}
-
-a.mceButtonNormal img, a.mceButtonSelected img {
-	border: 1px solid #F0F0EE !important;
-}
-
-a.mceButtonSelected img {
-	border: 1px solid #C0C0BB !important;
-}
-
-a.mceButtonNormal img:hover, a.mceButtonSelected img:hover {
-	border: 1px solid #0A246A !important;
-	cursor: default;
-	background-color: #B6BDD2;
-}
-
-a.mceButtonDisabled img {
-	-moz-opacity:0.3;
-	opacity: 0.3;
-	border: 1px solid #F0F0EE !important;
-	cursor: default;
-}
-
-a.mceTiledButton img {
-	background-image: url('../images/buttons.gif');
-	background-repeat: no-repeat;
-}
-
-/* MSIE specific rules */
-
-* html a.mceButtonNormal img, * html a.mceButtonSelected img, * html a.mceButtonDisabled img {
-	border: 0px !important;
-	margin-top: 2px;
-	margin-bottom: 1px;
-}
-
-* html a.mceButtonDisabled img {
-	filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);
-	border: 0px !important;
-}
-
-* html a.mceButtonDisabled {
-	border: 1px solid #F0F0EE !important;
-}
-
-* html a.mceButtonNormal, * html a.mceButtonSelected {
-	border: 1px solid #F0F0EE;
-	cursor: default;
-}
-
-* html a.mceButtonSelected {
-	border: 1px solid #C0C0BB;
-}
-
-* html a.mceButtonNormal:hover, * html a.mceButtonSelected:hover {
-	border: 1px solid #0A246A;
-	cursor: default;
-	background-color: #B6BDD2;
-}
-
-* html .mceSelectList {
-	margin-top: 2px;
-}

Copied: plog/trunk/js/tinymce/themes/simple/css/editor_ui.css (from rev 7165, plog/trunk/js/tinymce/themes/simple/css/editor_ui.css)
===================================================================
--- plog/trunk/js/tinymce/themes/simple/css/editor_ui.css	                        (rev 0)
+++ plog/trunk/js/tinymce/themes/simple/css/editor_ui.css	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,125 @@
+.mceSeparatorLine {
+	border: 0;
+	padding: 0;
+	margin-left: 4px;
+	margin-right: 2px;
+}
+
+.mceSelectList {
+	font-family: "MS Sans Serif";
+	font-size: 7pt;
+	font-weight: normal;
+	margin-top: 2px;
+}
+
+.mceLabel, .mceLabelDisabled {
+	font-family: "MS Sans Serif";
+	font-size: 9pt;
+}
+
+.mceLabel {
+	color: #000000;
+}
+
+.mceLabelDisabled {
+	cursor: text;
+	color: #999999;
+}
+
+.mceEditor {
+	background: #F0F0EE;
+	border: 1px solid #cccccc;
+}
+
+.mceEditorArea {
+	font-family: "MS Sans Serif";
+	background: #FFFFFF;
+}
+
+.mceToolbar {
+	background: #F0F0EE;
+	border-top: 1px solid #cccccc;
+	line-height: 1px;
+	font-size: 1px;
+	padding-bottom: 1px;
+}
+
+.mceEditorIframe {
+	border: 0;
+}
+
+/* Button CSS rules */
+
+a.mceButtonDisabled img, a.mceButtonNormal img, a.mceButtonSelected img {
+	width: 20px;
+	height: 20px;
+	cursor: default;
+	margin-top: 1px;
+	margin-left: 1px;
+}
+
+a.mceButtonDisabled img {
+	border: 0 !important;
+}
+
+a.mceButtonNormal img, a.mceButtonSelected img {
+	border: 1px solid #F0F0EE !important;
+}
+
+a.mceButtonSelected img {
+	border: 1px solid #C0C0BB !important;
+}
+
+a.mceButtonNormal img:hover, a.mceButtonSelected img:hover {
+	border: 1px solid #0A246A !important;
+	cursor: default;
+	background-color: #B6BDD2;
+}
+
+a.mceButtonDisabled img {
+	-moz-opacity:0.3;
+	opacity: 0.3;
+	border: 1px solid #F0F0EE !important;
+	cursor: default;
+}
+
+a.mceTiledButton img {
+	background-image: url('../images/buttons.gif');
+	background-repeat: no-repeat;
+}
+
+/* MSIE specific rules */
+
+* html a.mceButtonNormal img, * html a.mceButtonSelected img, * html a.mceButtonDisabled img {
+	border: 0px !important;
+	margin-top: 2px;
+	margin-bottom: 1px;
+}
+
+* html a.mceButtonDisabled img {
+	filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);
+	border: 0px !important;
+}
+
+* html a.mceButtonDisabled {
+	border: 1px solid #F0F0EE !important;
+}
+
+* html a.mceButtonNormal, * html a.mceButtonSelected {
+	border: 1px solid #F0F0EE;
+	cursor: default;
+}
+
+* html a.mceButtonSelected {
+	border: 1px solid #C0C0BB;
+}
+
+* html a.mceButtonNormal:hover, * html a.mceButtonSelected:hover {
+	border: 1px solid #0A246A;
+	cursor: default;
+	background-color: #B6BDD2;
+}
+
+* html .mceSelectList {
+	margin-top: 2px;
+}

Deleted: plog/trunk/js/tinymce/themes/simple/editor_template.js
===================================================================
--- plog/trunk/js/tinymce/themes/simple/editor_template.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/themes/simple/editor_template.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1 +0,0 @@
-var TinyMCE_SimpleTheme={_buttonMap:'bold,bullist,cleanup,italic,numlist,redo,strikethrough,underline,undo',getEditorTemplate:function(){var html='';html+='<table class="mceEditor" border="0" cellpadding="0" cellspacing="0" width="{$width}" height="{$height}">';html+='<tr><td align="center">';html+='<span id="{$editor_id}">IFRAME</span>';html+='</td></tr>';html+='<tr><td class="mceToolbar" align="center" height="1">';html+=tinyMCE.getButtonHTML('bold','lang_bold_desc','{$themeurl}/images/{$lang_bold_img}','Bold');html+=tinyMCE.getButtonHTML('italic','lang_italic_desc','{$themeurl}/images/{$lang_italic_img}','Italic');html+=tinyMCE.getButtonHTML('underline','lang_underline_desc','{$themeurl}/images/{$lang_underline_img}','Underline');html+=tinyMCE.getButtonHTML('strikethrough','lang_striketrough_desc','{$themeurl}/images/strikethrough.gif','Strikethrough');html+='<img src="{$themeurl}/images/separator.gif" width="2" height="20" class="mceSeparatorLine" />';html+=tinyMCE.getBu
 ttonHTML('undo','lang_undo_desc','{$themeurl}/images/undo.gif','Undo');html+=tinyMCE.getButtonHTML('redo','lang_redo_desc','{$themeurl}/images/redo.gif','Redo');html+='<img src="{$themeurl}/images/separator.gif" width="2" height="20" class="mceSeparatorLine" />';html+=tinyMCE.getButtonHTML('cleanup','lang_cleanup_desc','{$themeurl}/images/cleanup.gif','mceCleanup');html+='<img src="{$themeurl}/images/separator.gif" width="2" height="20" class="mceSeparatorLine" />';html+=tinyMCE.getButtonHTML('bullist','lang_bullist_desc','{$themeurl}/images/bullist.gif','InsertUnorderedList');html+=tinyMCE.getButtonHTML('numlist','lang_numlist_desc','{$themeurl}/images/numlist.gif','InsertOrderedList');html+='</td></tr></table>';return{delta_width:0,delta_height:20,html:html}},handleNodeChange:function(editor_id,node){tinyMCE.switchClass(editor_id+'_bold','mceButtonNormal');tinyMCE.switchClass(editor_id+'_italic','mceButtonNormal');tinyMCE.switchClass(editor_id+'_underline','mceButtonNormal
 ');tinyMCE.switchClass(editor_id+'_strikethrough','mceButtonNormal');tinyMCE.switchClass(editor_id+'_bullist','mceButtonNormal');tinyMCE.switchClass(editor_id+'_numlist','mceButtonNormal');do{switch(node.nodeName.toLowerCase()){case"b":case"strong":tinyMCE.switchClass(editor_id+'_bold','mceButtonSelected');break;case"i":case"em":tinyMCE.switchClass(editor_id+'_italic','mceButtonSelected');break;case"u":tinyMCE.switchClass(editor_id+'_underline','mceButtonSelected');break;case"strike":tinyMCE.switchClass(editor_id+'_strikethrough','mceButtonSelected');break;case"ul":tinyMCE.switchClass(editor_id+'_bullist','mceButtonSelected');break;case"ol":tinyMCE.switchClass(editor_id+'_numlist','mceButtonSelected');break}}while((node=node.parentNode)!=null)}};tinyMCE.addTheme("simple",TinyMCE_SimpleTheme);tinyMCE.addButtonMap(TinyMCE_SimpleTheme._buttonMap);
\ No newline at end of file

Copied: plog/trunk/js/tinymce/themes/simple/editor_template.js (from rev 7165, plog/trunk/js/tinymce/themes/simple/editor_template.js)
===================================================================
--- plog/trunk/js/tinymce/themes/simple/editor_template.js	                        (rev 0)
+++ plog/trunk/js/tinymce/themes/simple/editor_template.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1 @@
+var TinyMCE_SimpleTheme={_buttonMap:'bold,bullist,cleanup,italic,numlist,redo,strikethrough,underline,undo',getEditorTemplate:function(){var html='';html+='<table class="mceEditor" border="0" cellpadding="0" cellspacing="0" width="{$width}" height="{$height}">';html+='<tr><td align="center">';html+='<span id="{$editor_id}">IFRAME</span>';html+='</td></tr>';html+='<tr><td class="mceToolbar" align="center" height="1">';html+=tinyMCE.getButtonHTML('bold','lang_bold_desc','{$themeurl}/images/{$lang_bold_img}','Bold');html+=tinyMCE.getButtonHTML('italic','lang_italic_desc','{$themeurl}/images/{$lang_italic_img}','Italic');html+=tinyMCE.getButtonHTML('underline','lang_underline_desc','{$themeurl}/images/{$lang_underline_img}','Underline');html+=tinyMCE.getButtonHTML('strikethrough','lang_striketrough_desc','{$themeurl}/images/strikethrough.gif','Strikethrough');html+='<img src="{$themeurl}/images/separator.gif" width="2" height="20" class="mceSeparatorLine" />';html+=tinyMCE.getBu
 ttonHTML('undo','lang_undo_desc','{$themeurl}/images/undo.gif','Undo');html+=tinyMCE.getButtonHTML('redo','lang_redo_desc','{$themeurl}/images/redo.gif','Redo');html+='<img src="{$themeurl}/images/separator.gif" width="2" height="20" class="mceSeparatorLine" />';html+=tinyMCE.getButtonHTML('cleanup','lang_cleanup_desc','{$themeurl}/images/cleanup.gif','mceCleanup');html+='<img src="{$themeurl}/images/separator.gif" width="2" height="20" class="mceSeparatorLine" />';html+=tinyMCE.getButtonHTML('bullist','lang_bullist_desc','{$themeurl}/images/bullist.gif','InsertUnorderedList');html+=tinyMCE.getButtonHTML('numlist','lang_numlist_desc','{$themeurl}/images/numlist.gif','InsertOrderedList');html+='</td></tr></table>';return{delta_width:0,delta_height:20,html:html}},handleNodeChange:function(editor_id,node){tinyMCE.switchClass(editor_id+'_bold','mceButtonNormal');tinyMCE.switchClass(editor_id+'_italic','mceButtonNormal');tinyMCE.switchClass(editor_id+'_underline','mceButtonNormal
 ');tinyMCE.switchClass(editor_id+'_strikethrough','mceButtonNormal');tinyMCE.switchClass(editor_id+'_bullist','mceButtonNormal');tinyMCE.switchClass(editor_id+'_numlist','mceButtonNormal');do{switch(node.nodeName.toLowerCase()){case"b":case"strong":tinyMCE.switchClass(editor_id+'_bold','mceButtonSelected');break;case"i":case"em":tinyMCE.switchClass(editor_id+'_italic','mceButtonSelected');break;case"u":tinyMCE.switchClass(editor_id+'_underline','mceButtonSelected');break;case"strike":tinyMCE.switchClass(editor_id+'_strikethrough','mceButtonSelected');break;case"ul":tinyMCE.switchClass(editor_id+'_bullist','mceButtonSelected');break;case"ol":tinyMCE.switchClass(editor_id+'_numlist','mceButtonSelected');break}}while((node=node.parentNode)!=null)}};tinyMCE.addTheme("simple",TinyMCE_SimpleTheme);tinyMCE.addButtonMap(TinyMCE_SimpleTheme._buttonMap);
\ No newline at end of file

Deleted: plog/trunk/js/tinymce/themes/simple/editor_template_src.js
===================================================================
--- plog/trunk/js/tinymce/themes/simple/editor_template_src.js	2011-12-15 16:34:32 UTC (rev 7165)
+++ plog/trunk/js/tinymce/themes/simple/editor_template_src.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,84 +0,0 @@
-/**
- * $Id: editor_template_src.js 162 2007-01-03 16:16:52Z spocke $
- *
- * @author Moxiecode
- * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
- */
-
-var TinyMCE_SimpleTheme = {
-	// List of button ids in tile map
-	_buttonMap : 'bold,bullist,cleanup,italic,numlist,redo,strikethrough,underline,undo',
-
-	getEditorTemplate : function() {
-		var html = '';
-
-		html += '<table class="mceEditor" border="0" cellpadding="0" cellspacing="0" width="{$width}" height="{$height}">';
-		html += '<tr><td align="center">';
-		html += '<span id="{$editor_id}">IFRAME</span>';
-		html += '</td></tr>';
-		html += '<tr><td class="mceToolbar" align="center" height="1">';
-		html += tinyMCE.getButtonHTML('bold', 'lang_bold_desc', '{$themeurl}/images/{$lang_bold_img}', 'Bold');
-		html += tinyMCE.getButtonHTML('italic', 'lang_italic_desc', '{$themeurl}/images/{$lang_italic_img}', 'Italic');
-		html += tinyMCE.getButtonHTML('underline', 'lang_underline_desc', '{$themeurl}/images/{$lang_underline_img}', 'Underline');
-		html += tinyMCE.getButtonHTML('strikethrough', 'lang_striketrough_desc', '{$themeurl}/images/strikethrough.gif', 'Strikethrough');
-		html += '<img src="{$themeurl}/images/separator.gif" width="2" height="20" class="mceSeparatorLine" />';
-		html += tinyMCE.getButtonHTML('undo', 'lang_undo_desc', '{$themeurl}/images/undo.gif', 'Undo');
-		html += tinyMCE.getButtonHTML('redo', 'lang_redo_desc', '{$themeurl}/images/redo.gif', 'Redo');
-		html += '<img src="{$themeurl}/images/separator.gif" width="2" height="20" class="mceSeparatorLine" />';
-		html += tinyMCE.getButtonHTML('cleanup', 'lang_cleanup_desc', '{$themeurl}/images/cleanup.gif', 'mceCleanup');
-		html += '<img src="{$themeurl}/images/separator.gif" width="2" height="20" class="mceSeparatorLine" />';
-		html += tinyMCE.getButtonHTML('bullist', 'lang_bullist_desc', '{$themeurl}/images/bullist.gif', 'InsertUnorderedList');
-		html += tinyMCE.getButtonHTML('numlist', 'lang_numlist_desc', '{$themeurl}/images/numlist.gif', 'InsertOrderedList');
-		html += '</td></tr></table>';
-
-		return {
-			delta_width : 0,
-			delta_height : 20,
-			html : html
-		};
-	},
-
-	handleNodeChange : function(editor_id, node) {
-		// Reset old states
-		tinyMCE.switchClass(editor_id + '_bold', 'mceButtonNormal');
-		tinyMCE.switchClass(editor_id + '_italic', 'mceButtonNormal');
-		tinyMCE.switchClass(editor_id + '_underline', 'mceButtonNormal');
-		tinyMCE.switchClass(editor_id + '_strikethrough', 'mceButtonNormal');
-		tinyMCE.switchClass(editor_id + '_bullist', 'mceButtonNormal');
-		tinyMCE.switchClass(editor_id + '_numlist', 'mceButtonNormal');
-
-		// Handle elements
-		do {
-			switch (node.nodeName.toLowerCase()) {
-				case "b":
-				case "strong":
-					tinyMCE.switchClass(editor_id + '_bold', 'mceButtonSelected');
-				break;
-
-				case "i":
-				case "em":
-					tinyMCE.switchClass(editor_id + '_italic', 'mceButtonSelected');
-				break;
-
-				case "u":
-					tinyMCE.switchClass(editor_id + '_underline', 'mceButtonSelected');
-				break;
-
-				case "strike":
-					tinyMCE.switchClass(editor_id + '_strikethrough', 'mceButtonSelected');
-				break;
-				
-				case "ul":
-					tinyMCE.switchClass(editor_id + '_bullist', 'mceButtonSelected');
-				break;
-
-				case "ol":
-					tinyMCE.switchClass(editor_id + '_numlist', 'mceButtonSelected');
-				break;
-			}
-		} while ((node = node.parentNode) != null);
-	}
-};
-
-tinyMCE.addTheme("simple", TinyMCE_SimpleTheme);
-tinyMCE.addButtonMap(TinyMCE_SimpleTheme._buttonMap);

Copied: plog/trunk/js/tinymce/themes/simple/editor_template_src.js (from rev 7165, plog/trunk/js/tinymce/themes/simple/editor_template_src.js)
===================================================================
--- plog/trunk/js/tinymce/themes/simple/editor_template_src.js	                        (rev 0)
+++ plog/trunk/js/tinymce/themes/simple/editor_template_src.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,84 @@
+/**
+ * $Id: editor_template_src.js 162 2007-01-03 16:16:52Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
+ */
+
+var TinyMCE_SimpleTheme = {
+	// List of button ids in tile map
+	_buttonMap : 'bold,bullist,cleanup,italic,numlist,redo,strikethrough,underline,undo',
+
+	getEditorTemplate : function() {
+		var html = '';
+
+		html += '<table class="mceEditor" border="0" cellpadding="0" cellspacing="0" width="{$width}" height="{$height}">';
+		html += '<tr><td align="center">';
+		html += '<span id="{$editor_id}">IFRAME</span>';
+		html += '</td></tr>';
+		html += '<tr><td class="mceToolbar" align="center" height="1">';
+		html += tinyMCE.getButtonHTML('bold', 'lang_bold_desc', '{$themeurl}/images/{$lang_bold_img}', 'Bold');
+		html += tinyMCE.getButtonHTML('italic', 'lang_italic_desc', '{$themeurl}/images/{$lang_italic_img}', 'Italic');
+		html += tinyMCE.getButtonHTML('underline', 'lang_underline_desc', '{$themeurl}/images/{$lang_underline_img}', 'Underline');
+		html += tinyMCE.getButtonHTML('strikethrough', 'lang_striketrough_desc', '{$themeurl}/images/strikethrough.gif', 'Strikethrough');
+		html += '<img src="{$themeurl}/images/separator.gif" width="2" height="20" class="mceSeparatorLine" />';
+		html += tinyMCE.getButtonHTML('undo', 'lang_undo_desc', '{$themeurl}/images/undo.gif', 'Undo');
+		html += tinyMCE.getButtonHTML('redo', 'lang_redo_desc', '{$themeurl}/images/redo.gif', 'Redo');
+		html += '<img src="{$themeurl}/images/separator.gif" width="2" height="20" class="mceSeparatorLine" />';
+		html += tinyMCE.getButtonHTML('cleanup', 'lang_cleanup_desc', '{$themeurl}/images/cleanup.gif', 'mceCleanup');
+		html += '<img src="{$themeurl}/images/separator.gif" width="2" height="20" class="mceSeparatorLine" />';
+		html += tinyMCE.getButtonHTML('bullist', 'lang_bullist_desc', '{$themeurl}/images/bullist.gif', 'InsertUnorderedList');
+		html += tinyMCE.getButtonHTML('numlist', 'lang_numlist_desc', '{$themeurl}/images/numlist.gif', 'InsertOrderedList');
+		html += '</td></tr></table>';
+
+		return {
+			delta_width : 0,
+			delta_height : 20,
+			html : html
+		};
+	},
+
+	handleNodeChange : function(editor_id, node) {
+		// Reset old states
+		tinyMCE.switchClass(editor_id + '_bold', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_italic', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_underline', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_strikethrough', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_bullist', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_numlist', 'mceButtonNormal');
+
+		// Handle elements
+		do {
+			switch (node.nodeName.toLowerCase()) {
+				case "b":
+				case "strong":
+					tinyMCE.switchClass(editor_id + '_bold', 'mceButtonSelected');
+				break;
+
+				case "i":
+				case "em":
+					tinyMCE.switchClass(editor_id + '_italic', 'mceButtonSelected');
+				break;
+
+				case "u":
+					tinyMCE.switchClass(editor_id + '_underline', 'mceButtonSelected');
+				break;
+
+				case "strike":
+					tinyMCE.switchClass(editor_id + '_strikethrough', 'mceButtonSelected');
+				break;
+				
+				case "ul":
+					tinyMCE.switchClass(editor_id + '_bullist', 'mceButtonSelected');
+				break;
+
+				case "ol":
+					tinyMCE.switchClass(editor_id + '_numlist', 'mceButtonSelected');
+				break;
+			}
+		} while ((node = node.parentNode) != null);
+	}
+};
+
+tinyMCE.addTheme("simple", TinyMCE_SimpleTheme);
+tinyMCE.addButtonMap(TinyMCE_SimpleTheme._buttonMap);

Deleted: plog/trunk/js/tinymce/themes/simple/images/bold.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/simple/images/bold.gif (from rev 7165, plog/trunk/js/tinymce/themes/simple/images/bold.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/simple/images/bold_de_se.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/simple/images/bold_de_se.gif (from rev 7165, plog/trunk/js/tinymce/themes/simple/images/bold_de_se.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/simple/images/bold_fr.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/simple/images/bold_fr.gif (from rev 7165, plog/trunk/js/tinymce/themes/simple/images/bold_fr.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/simple/images/bold_ru.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/simple/images/bold_ru.gif (from rev 7165, plog/trunk/js/tinymce/themes/simple/images/bold_ru.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/simple/images/bold_tw.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/simple/images/bold_tw.gif (from rev 7165, plog/trunk/js/tinymce/themes/simple/images/bold_tw.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/simple/images/bullist.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/simple/images/bullist.gif (from rev 7165, plog/trunk/js/tinymce/themes/simple/images/bullist.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/simple/images/buttons.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/simple/images/buttons.gif (from rev 7165, plog/trunk/js/tinymce/themes/simple/images/buttons.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/simple/images/cleanup.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/simple/images/cleanup.gif (from rev 7165, plog/trunk/js/tinymce/themes/simple/images/cleanup.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/simple/images/italic.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/simple/images/italic.gif (from rev 7165, plog/trunk/js/tinymce/themes/simple/images/italic.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/simple/images/italic_de_se.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/simple/images/italic_de_se.gif (from rev 7165, plog/trunk/js/tinymce/themes/simple/images/italic_de_se.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/simple/images/italic_ru.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/simple/images/italic_ru.gif (from rev 7165, plog/trunk/js/tinymce/themes/simple/images/italic_ru.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/simple/images/italic_tw.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/simple/images/italic_tw.gif (from rev 7165, plog/trunk/js/tinymce/themes/simple/images/italic_tw.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/simple/images/numlist.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/simple/images/numlist.gif (from rev 7165, plog/trunk/js/tinymce/themes/simple/images/numlist.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/simple/images/redo.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/simple/images/redo.gif (from rev 7165, plog/trunk/js/tinymce/themes/simple/images/redo.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/simple/images/separator.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/simple/images/separator.gif (from rev 7165, plog/trunk/js/tinymce/themes/simple/images/separator.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/simple/images/spacer.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/simple/images/spacer.gif (from rev 7165, plog/trunk/js/tinymce/themes/simple/images/spacer.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/simple/images/strikethrough.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/simple/images/strikethrough.gif (from rev 7165, plog/trunk/js/tinymce/themes/simple/images/strikethrough.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/simple/images/underline.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/simple/images/underline.gif (from rev 7165, plog/trunk/js/tinymce/themes/simple/images/underline.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/simple/images/underline_fr.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/simple/images/underline_fr.gif (from rev 7165, plog/trunk/js/tinymce/themes/simple/images/underline_fr.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/simple/images/underline_ru.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/simple/images/underline_ru.gif (from rev 7165, plog/trunk/js/tinymce/themes/simple/images/underline_ru.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/simple/images/underline_tw.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/simple/images/underline_tw.gif (from rev 7165, plog/trunk/js/tinymce/themes/simple/images/underline_tw.gif)
===================================================================
(Binary files differ)

Deleted: plog/trunk/js/tinymce/themes/simple/images/undo.gif
===================================================================
(Binary files differ)

Copied: plog/trunk/js/tinymce/themes/simple/images/undo.gif (from rev 7165, plog/trunk/js/tinymce/themes/simple/images/undo.gif)
===================================================================
(Binary files differ)

Modified: plog/trunk/js/tinymce/tiny_mce-plog.js
===================================================================
--- plog/trunk/js/tinymce/tiny_mce-plog.js	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/js/tinymce/tiny_mce-plog.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,29 +1,282 @@
-tinyMCE_GZ.init({
-            // user-defined plugins and themes should be identical to those in "tinyMCE.init" below.-->
-      plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",
-      themes : 'advanced',
-      languages : 'en',
-      disk_cache : false,
-      debug : false
-});
-
-
 tinyMCE.init({
-            // General options
-            mode : "exact",
-            elements : "postText,postExtendedText",
-            theme : "advanced",
-            plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",
-            
-                // Theme options
-            theme_advanced_buttons1: "formatselect,fontsizeselect,fontselect,forecolor,backcolor,bold,italic,underline,strikethrough,sub,sup,|,justifyleft,justifycenter,justifyright,justifyfull,|,cleanup,removeformat",
-            theme_advanced_buttons2: "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,indent,outdent,blockquote,|,undo,redo,|,link,unlink,anchor,|,hr,advhr,charmap,insertdate,inserttime,nonbreaking,|,fullscreen",
-            theme_advanced_buttons3 : "emotions,image,insertresource,insertvideo,insertaudio,media,|,code,pagebreak",
-            theme_advanced_buttons4 : "",
-            theme_advanced_toolbar_location : "top",
-            theme_advanced_toolbar_align : "left",
-            theme_advanced_statusbar_location : "bottom",
-            theme_advanced_resizing : true,
-            theme_advanced_resize_horizontal : false,
-
+	mode : "exact",
+	elements : "postText,postExtendedText",
+	theme : "advanced",
+	plugins : "fullscreen,table,inlinepopups,insertdatetime,emotions,insertresource,insertvideo,insertaudio,more",
+	relative_urls : false,
+    fix_list_elements : true,
+	remove_script_host : false,
+	force_p_newlines : true,
+    hide_selects_on_submit: false,
+	cleanup_on_startup : true,	
+    theme_advanced_buttons1: "fontsizeselect,fontselect,forecolor,backcolor,bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,cleanup,removeformat",
+    theme_advanced_buttons2: "bullist,numlist,indent,outdent,separator,undo,redo,separator,link,unlink,image,insertresource,insertvideo,insertaudio,emotions,separator,hr,charmap,insertdate,inserttime,separator,fullscreen,separator,code,more",
+    theme_advanced_buttons3: "",
+	theme_advanced_toolbar_location : "top",
+	theme_advanced_toolbar_align : "left",
+	theme_advanced_path_location : "bottom",
+	theme_advanced_resizing : true,
+	theme_advanced_resize_horizontal : false,
+	convert_fonts_to_spans: true,
+    remove_linebreaks: false,
+	extended_valid_elements : "a[class|name|id|href|target|title|onclick|rel],img[class|src|border|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
+	verify_html : true,
+	apply_source_formatting : true,
+	valid_elements : ""
+	+"a[accesskey|charset|class|coords|dir<ltr?rtl|href|hreflang|id|lang|name"
+	  +"|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup"
+	  +"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|rel|rev"
+	  +"|shape<circle?default?poly?rect|style|tabindex|title|target|type],"
+	+"abbr[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
+	  +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
+	  +"|title],"
+	+"acronym[class|dir<ltr?rtl|id|id|lang|onclick|ondblclick|onkeydown|onkeypress"
+	  +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
+	  +"|title],"
+	+"address[class|align|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
+	  +"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
+	  +"|onmouseup|style|title],"
+	+"applet[align<bottom?left?middle?right?top|alt|archive|class|code|codebase"
+	  +"|height|hspace|id|name|object|style|title|vspace|width],"
+	+"area[accesskey|alt|class|coords|dir<ltr?rtl|href|id|lang|nohref<nohref"
+	  +"|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup"
+	  +"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup"
+	  +"|shape<circle?default?poly?rect|style|tabindex|title|target],"
+	+"base[href|target],"
+	+"basefont[color|face|id|size],"
+	+"bdo[class|dir<ltr?rtl|id|lang|style|title],"
+	+"big[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
+	  +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
+	  +"|title],"
+	+"blockquote[dir|style|cite|class|dir<ltr?rtl|id|lang|onclick|ondblclick"
+	  +"|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout"
+	  +"|onmouseover|onmouseup|style|title],"
+	+"body[alink|background|bgcolor|class|dir<ltr?rtl|id|lang|link|onclick"
+	  +"|ondblclick|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove"
+	  +"|onmouseout|onmouseover|onmouseup|onunload|style|title|text|vlink],"
+	+"br[class|clear<all?left?none?right|id|style|title],"
+	+"button[accesskey|class|dir<ltr?rtl|disabled<disabled|id|lang|name|onblur"
+	  +"|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup|onmousedown"
+	  +"|onmousemove|onmouseout|onmouseover|onmouseup|style|tabindex|title|type"
+	  +"|value],"
+	+"caption[align<bottom?left?right?top|class|dir<ltr?rtl|id|lang|onclick"
+	  +"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
+	  +"|onmouseout|onmouseover|onmouseup|style|title],"
+	+"center[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
+	  +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
+	  +"|title],"
+	+"cite[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
+	  +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
+	  +"|title],"
+	+"code[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
+	  +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
+	  +"|title],"
+	+"col[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id"
+	  +"|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown"
+	  +"|onmousemove|onmouseout|onmouseover|onmouseup|span|style|title"
+	  +"|valign<baseline?bottom?middle?top|width],"
+	+"colgroup[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl"
+	  +"|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown"
+	  +"|onmousemove|onmouseout|onmouseover|onmouseup|span|style|title"
+	  +"|valign<baseline?bottom?middle?top|width],"
+	+"dd[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
+	  +"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],"
+	+"del[cite|class|datetime|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
+	  +"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
+	  +"|onmouseup|style|title],"
+	+"dfn[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
+	  +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
+	  +"|title],"
+	+"dir[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
+	  +"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
+	  +"|onmouseup|style|title],"
+	+"div[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
+	  +"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
+	  +"|onmouseout|onmouseover|onmouseup|style|title],"
+	+"dl[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
+	  +"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
+	  +"|onmouseup|style|title],"
+	+"dt[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
+	  +"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],"
+	+"em/i[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
+	  +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
+	  +"|title],"
+	+"fieldset[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
+	  +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
+	  +"|title],"
+	+"font[class|color|dir<ltr?rtl|face|id|lang|size|style|title],"
+	+"form[accept|accept-charset|action|class|dir<ltr?rtl|enctype|id|lang"
+	  +"|method<get?post|name|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
+	  +"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onreset|onsubmit"
+	  +"|style|title|target],"
+	+"frame[class|frameborder|id|longdesc|marginheight|marginwidth|name"
+	  +"|noresize<noresize|scrolling<auto?no?yes|src|style|title],"
+	+"frameset[class|cols|id|onload|onunload|rows|style|title],"
+	+"h1[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
+	  +"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
+	  +"|onmouseout|onmouseover|onmouseup|style|title],"
+	+"h2[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
+	  +"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
+	  +"|onmouseout|onmouseover|onmouseup|style|title],"
+	+"h3[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
+	  +"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
+	  +"|onmouseout|onmouseover|onmouseup|style|title],"
+	+"h4[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
+	  +"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
+	  +"|onmouseout|onmouseover|onmouseup|style|title],"
+	+"h5[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
+	  +"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
+	  +"|onmouseout|onmouseover|onmouseup|style|title],"
+	+"h6[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
+	  +"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
+	  +"|onmouseout|onmouseover|onmouseup|style|title],"
+	+"head[dir<ltr?rtl|lang|profile],"
+	+"hr[align<center?left?right|class|dir<ltr?rtl|id|lang|noshade<noshade|onclick"
+	  +"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
+	  +"|onmouseout|onmouseover|onmouseup|size|style|title|width],"
+	+"html[dir<ltr?rtl|lang|version],"
+	+"iframe[align<bottom?left?middle?right?top|class|frameborder|height|id"
+	  +"|longdesc|marginheight|marginwidth|name|scrolling<auto?no?yes|src|style"
+	  +"|title|width],"
+	+"img[align<bottom?left?middle?right?top|alt|border|class|dir<ltr?rtl|height"
+	  +"|hspace|id|ismap<ismap|lang|longdesc|name|onclick|ondblclick|onkeydown"
+	  +"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
+	  +"|onmouseup|src|style|title|usemap|vspace|width],"
+	+"input[accept|accesskey|align<bottom?left?middle?right?top|alt"
+	  +"|checked<checked|class|dir<ltr?rtl|disabled<disabled|id|ismap<ismap|lang"
+	  +"|maxlength|name|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress"
+	  +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onselect"
+	  +"|readonly<readonly|size|src|style|tabindex|title"
+	  +"|type<button?checkbox?file?hidden?image?password?radio?reset?submit?text"
+	  +"|usemap|value],"
+	+"ins[cite|class|datetime|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
+	  +"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
+	  +"|onmouseup|style|title],"
+	+"isindex[class|dir<ltr?rtl|id|lang|prompt|style|title],"
+	+"kbd[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
+	  +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
+	  +"|title],"
+	+"label[accesskey|class|dir<ltr?rtl|for|id|lang|onblur|onclick|ondblclick"
+	  +"|onfocus|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout"
+	  +"|onmouseover|onmouseup|style|title],"
+	+"legend[align<bottom?left?right?top|accesskey|class|dir<ltr?rtl|id|lang"
+	  +"|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
+	  +"|onmouseout|onmouseover|onmouseup|style|title],"
+	+"li[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
+	  +"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title|type"
+	  +"|value],"
+	+"link[charset|class|dir<ltr?rtl|href|hreflang|id|lang|media|onclick"
+	  +"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
+	  +"|onmouseout|onmouseover|onmouseup|rel|rev|style|title|target|type],"
+	+"map[class|dir<ltr?rtl|id|lang|name|onclick|ondblclick|onkeydown|onkeypress"
+	  +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
+	  +"|title],"
+	+"menu[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
+	  +"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
+	  +"|onmouseup|style|title],"
+	+"meta[content|dir<ltr?rtl|http-equiv|lang|name|scheme],"
+	+"noframes[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
+	  +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
+	  +"|title],"
+	+"noscript[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
+	  +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
+	  +"|title],"
+	+"object[align<bottom?left?middle?right?top|archive|border|class|classid"
+	  +"|codebase|codetype|data|declare|dir<ltr?rtl|height|hspace|id|lang|name"
+	  +"|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
+	  +"|onmouseout|onmouseover|onmouseup|standby|style|tabindex|title|type|usemap"
+	  +"|vspace|width|flashvars|data],"
+	+"ol[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
+	  +"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
+	  +"|onmouseup|start|style|title|type],"
+	+"optgroup[class|dir<ltr?rtl|disabled<disabled|id|label|lang|onclick"
+	  +"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
+	  +"|onmouseout|onmouseover|onmouseup|style|title],"
+	+"option[class|dir<ltr?rtl|disabled<disabled|id|label|lang|onclick|ondblclick"
+	  +"|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout"
+	  +"|onmouseover|onmouseup|selected<selected|style|title|value],"
+	+"p[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick"
+	  +"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
+	  +"|onmouseout|onmouseover|onmouseup|style|title],"
+	+"param[id|name|type|value|valuetype<DATA?OBJECT?REF],"
+	+"pre/listing/plaintext/xmp[align|class|dir<ltr?rtl|id|lang|onclick|ondblclick"
+	  +"|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout"
+	  +"|onmouseover|onmouseup|style|title|width],"
+	+"q[cite|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
+	  +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
+	  +"|title],"
+	+"s[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
+	  +"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],"
+	+"samp[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
+	  +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
+	  +"|title],"
+	+"script[charset|defer|language|src|type],"
+	+"select[class|dir<ltr?rtl|disabled<disabled|id|lang|multiple<multiple|name"
+	  +"|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup"
+	  +"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|size|style"
+	  +"|tabindex|title],"
+	+"small[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
+	  +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
+	  +"|title],"
+	+"span[align|class|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
+	  +"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
+	  +"|onmouseup|style|title],"
+	+"strike[class|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
+	  +"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
+	  +"|onmouseup|style|title],"
+	+"strong/b[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
+	  +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
+	  +"|title],"
+	+"style[dir<ltr?rtl|lang|media|title|type],"
+	+"sub[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
+	  +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
+	  +"|title],"
+	+"sup[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
+	  +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
+	  +"|title],"
+	+"table[align<center?left?right|bgcolor|border|cellpadding|cellspacing|class"
+	  +"|dir<ltr?rtl|frame|height|id|lang|onclick|ondblclick|onkeydown|onkeypress"
+	  +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|rules"
+	  +"|style|summary|title|width],"
+	+"tbody[align<center?char?justify?left?right|char|class|charoff|dir<ltr?rtl|id"
+	  +"|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown"
+	  +"|onmousemove|onmouseout|onmouseover|onmouseup|style|title"
+	  +"|valign<baseline?bottom?middle?top],"
+	+"td[abbr|align<center?char?justify?left?right|axis|bgcolor|char|charoff|class"
+	  +"|colspan|dir<ltr?rtl|headers|height|id|lang|nowrap<nowrap|onclick"
+	  +"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
+	  +"|onmouseout|onmouseover|onmouseup|rowspan|scope<col?colgroup?row?rowgroup"
+	  +"|style|title|valign<baseline?bottom?middle?top|width],"
+	+"textarea[accesskey|class|cols|dir<ltr?rtl|disabled<disabled|id|lang|name"
+	  +"|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup"
+	  +"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onselect"
+	  +"|readonly<readonly|rows|style|tabindex|title],"
+	+"tfoot[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id"
+	  +"|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown"
+	  +"|onmousemove|onmouseout|onmouseover|onmouseup|style|title"
+	  +"|valign<baseline?bottom?middle?top],"
+	+"th[abbr|align<center?char?justify?left?right|axis|bgcolor|char|charoff|class"
+	  +"|colspan|dir<ltr?rtl|headers|height|id|lang|nowrap<nowrap|onclick"
+	  +"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove"
+	  +"|onmouseout|onmouseover|onmouseup|rowspan|scope<col?colgroup?row?rowgroup"
+	  +"|style|title|valign<baseline?bottom?middle?top|width],"
+	+"thead[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id"
+	  +"|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown"
+	  +"|onmousemove|onmouseout|onmouseover|onmouseup|style|title"
+	  +"|valign<baseline?bottom?middle?top],"
+	+"title[dir<ltr?rtl|lang],"
+	+"tr[abbr|align<center?char?justify?left?right|bgcolor|char|charoff|class"
+	  +"|rowspan|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
+	  +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
+	  +"|title|valign<baseline?bottom?middle?top],"
+	+"tt[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
+	  +"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],"
+	+"u[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup"
+	  +"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],"
+	+"ul[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown"
+	  +"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
+	  +"|onmouseup|style|title|type],"
+	+"var[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress"
+	  +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style"
+	  +"|title]"	
 });

Modified: plog/trunk/js/tinymce/tiny_mce.js
===================================================================
--- plog/trunk/js/tinymce/tiny_mce.js	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/js/tinymce/tiny_mce.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1 +1 @@
-(function(c){var a=/^\s*|\s*$/g,d;var b={majorVersion:"3",minorVersion:"3.9",releaseDate:"2010-09-08",_init:function(){var r=this,o=document,m=navigator,f=m.userAgent,l,e,k,j,h,q;r.isOpera=c.opera&&opera.buildNumber;r.isWebKit=/WebKit/.test(f);r.isIE=!r.isWebKit&&!r.isOpera&&(/MSIE/gi).test(f)&&(/Explorer/gi).test(m.appName);r.isIE6=r.isIE&&/MSIE [56]/.test(f);r.isGecko=!r.isWebKit&&/Gecko/.test(f);r.isMac=f.indexOf("Mac")!=-1;r.isAir=/adobeair/i.test(f);r.isIDevice=/(iPad|iPhone)/.test(f);if(c.tinyMCEPreInit){r.suffix=tinyMCEPreInit.suffix;r.baseURL=tinyMCEPreInit.base;r.query=tinyMCEPreInit.query;return}r.suffix="";e=o.getElementsByTagName("base");for(l=0;l<e.length;l++){if(q=e[l].href){if(/^https?:\/\/[^\/]+$/.test(q)){q+="/"}j=q?q.match(/.*\//)[0]:""}}function g(i){if(i.src&&/tiny_mce(|_gzip|_jquery|_prototype|_full)(_dev|_src)?.js/.test(i.src)){if(/_(src|dev)\.js/g.test(i.src)){r.suffix="_src"}if((h=i.src.indexOf("?"))!=-1){r.query=i.src.substring(h+1)}r.baseURL=i.src.s
 ubstring(0,i.src.lastIndexOf("/"));if(j&&r.baseURL.indexOf("://")==-1&&r.baseURL.indexOf("/")!==0){r.baseURL=j+r.baseURL}return r.baseURL}return null}e=o.getElementsByTagName("script");for(l=0;l<e.length;l++){if(g(e[l])){return}}k=o.getElementsByTagName("head")[0];if(k){e=k.getElementsByTagName("script");for(l=0;l<e.length;l++){if(g(e[l])){return}}}return},is:function(f,e){if(!e){return f!==d}if(e=="array"&&(f.hasOwnProperty&&f instanceof Array)){return true}return typeof(f)==e},each:function(h,e,g){var i,f;if(!h){return 0}g=g||h;if(h.length!==d){for(i=0,f=h.length;i<f;i++){if(e.call(g,h[i],i,h)===false){return 0}}}else{for(i in h){if(h.hasOwnProperty(i)){if(e.call(g,h[i],i,h)===false){return 0}}}}return 1},map:function(e,g){var h=[];b.each(e,function(f){h.push(g(f))});return h},grep:function(e,g){var h=[];b.each(e,function(f){if(!g||g(f)){h.push(f)}});return h},inArray:function(f,g){var h,e;if(f){for(h=0,e=f.length;h<e;h++){if(f[h]===g){return h}}}return -1},extend:function
 (k,j){var h,g,f=arguments;for(h=1,g=f.length;h<g;h++){j=f[h];b.each(j,function(e,i){if(e!==d){k[i]=e}})}return k},trim:function(e){return(e?""+e:"").replace(a,"")},create:function(m,e){var l=this,f,h,i,j,g,k=0;m=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(m);i=m[3].match(/(^|\.)(\w+)$/i)[2];h=l.createNS(m[3].replace(/\.\w+$/,""));if(h[i]){return}if(m[2]=="static"){h[i]=e;if(this.onCreate){this.onCreate(m[2],m[3],h[i])}return}if(!e[i]){e[i]=function(){};k=1}h[i]=e[i];l.extend(h[i].prototype,e);if(m[5]){f=l.resolve(m[5]).prototype;j=m[5].match(/\.(\w+)$/i)[1];g=h[i];if(k){h[i]=function(){return f[j].apply(this,arguments)}}else{h[i]=function(){this.parent=f[j];return g.apply(this,arguments)}}h[i].prototype[i]=h[i];l.each(f,function(o,p){h[i].prototype[p]=f[p]});l.each(e,function(o,p){if(f[p]){h[i].prototype[p]=function(){this.parent=f[p];return o.apply(this,arguments)}}else{if(p!=i){h[i].prototype[p]=o}}})}l.each(e["static"],function(o,p){h[i][p]=o});if(this.onCreate){this.onCreat
 e(m[2],m[3],h[i].prototype)}},walk:function(h,g,i,e){e=e||this;if(h){if(i){h=h[i]}b.each(h,function(j,f){if(g.call(e,j,f,i)===false){return false}b.walk(j,g,i,e)})}},createNS:function(h,g){var f,e;g=g||c;h=h.split(".");for(f=0;f<h.length;f++){e=h[f];if(!g[e]){g[e]={}}g=g[e]}return g},resolve:function(h,g){var f,e;g=g||c;h=h.split(".");for(f=0,e=h.length;f<e;f++){g=g[h[f]];if(!g){break}}return g},addUnload:function(i,h){var g=this;i={func:i,scope:h||this};if(!g.unloads){function e(){var f=g.unloads,k,l;if(f){for(l in f){k=f[l];if(k&&k.func){k.func.call(k.scope,1)}}if(c.detachEvent){c.detachEvent("onbeforeunload",j);c.detachEvent("onunload",e)}else{if(c.removeEventListener){c.removeEventListener("unload",e,false)}}g.unloads=k=f=w=e=0;if(c.CollectGarbage){CollectGarbage()}}}function j(){var k=document;if(k.readyState=="interactive"){function f(){k.detachEvent("onstop",f);if(e){e()}k=0}if(k){k.attachEvent("onstop",f)}c.setTimeout(function(){if(k){k.detachEvent("onstop",f)}},0)}}
 if(c.attachEvent){c.attachEvent("onunload",e);c.attachEvent("onbeforeunload",j)}else{if(c.addEventListener){c.addEventListener("unload",e,false)}}g.unloads=[i]}else{g.unloads.push(i)}return i},removeUnload:function(h){var e=this.unloads,g=null;b.each(e,function(j,f){if(j&&j.func==h){e.splice(f,1);g=h;return false}});return g},explode:function(e,f){return e?b.map(e.split(f||","),b.trim):e},_addVer:function(f){var e;if(!this.query){return f}e=(f.indexOf("?")==-1?"?":"&")+this.query;if(f.indexOf("#")==-1){return f+e}return f.replace("#",e+"#")}};b._init();c.tinymce=c.tinyMCE=b})(window);tinymce.create("tinymce.util.Dispatcher",{scope:null,listeners:null,Dispatcher:function(a){this.scope=a||this;this.listeners=[]},add:function(a,b){this.listeners.push({cb:a,scope:b||this.scope});return a},addToTop:function(a,b){this.listeners.unshift({cb:a,scope:b||this.scope});return a},remove:function(a){var b=this.listeners,c=null;tinymce.each(b,function(e,d){if(a==e.cb){c=a;b.splice(d,1);ret
 urn false}});return c},dispatch:function(){var f,d=arguments,e,b=this.listeners,g;for(e=0;e<b.length;e++){g=b[e];f=g.cb.apply(g.scope,d);if(f===false){break}}return f}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,h,d,c;e=tinymce.trim(e);g=f.settings=g||{};if(/^(mailto|tel|news|javascript|about|data):/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^\w*:?\/\//.test(e)){e=(g.base_uri.protocol||"http")+"://mce_host"+f.toAbsPath(g.base_uri.path,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j
 ){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});if(c=g.base_uri){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host=="mce_host"){f.port=c.port}if(!f.host||f.host=="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var c=this,d;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:c});if((b.host!="mce_host"&&c.host!=b.host&&b.host)||c.port!=b.port||c.protocol!=b.protocol){return b.getURI()}d=c.toRelPath(c.path,b.path);if(b.query){d+="?"+b.query}if(b.anchor){d+="#"+b.anchor}return d},toAbsolute:function(b,c){var b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host&&this.protocol==b.protocol?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e<b;e++){if(e>=c.
 length||g[e]!=c[e]){f=e+1;break}}}if(g.length<c.length){for(e=0,b=c.length;e<b;e++){if(e>=g.length||g[e]!=c[e]){f=e+1;break}}}if(f==1){return h}for(e=0,b=g.length-(f-1);e<b;e++){d+="../"}for(e=f-1,b=c.length;e<b;e++){if(e!=f-1){d+="/"+c[e]}else{d+=c[e]}}return d},toAbsPath:function(e,f){var c,b=0,h=[],d,g;d=/\/$/.test(f)?"/":"";e=e.split("/");f=f.split("/");a(e,function(i){if(i){h.push(i)}});e=h;for(c=f.length-1,h=[];c>=0;c--){if(f[c].length==0||f[c]=="."){continue}if(f[c]==".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return
  b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!=0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();tinymce.create("static tinymce.util.JSON",{serialize:function(e){var c,a,d=tinymce.util.JSON.serialize,b;if(e==null){return"null"}b=typeof e;if(b=
 ="string"){a="\bb\tt\nn\ff\rr\"\"''\\\\";return'"'+e.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g,function(g,f){c=a.indexOf(f);if(c+1){return"\\"+a.charAt(c+1)}g=f.charCodeAt().toString(16);return"\\u"+"0000".substring(g.length)+g})+'"'}if(b=="object"){if(e.hasOwnProperty&&e instanceof Array){for(c=0,a="[";c<e.length;c++){a+=(c>0?",":"")+d(e[c])}return a+"]"}a="{";for(c in e){a+=typeof e[c]!="function"?(a.length>1?',"':'"')+c+'":'+d(e[c]):""}return a+"}"}return""+e},parse:function(s){try{return eval("("+s+")")}catch(ex){}}});tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.
 data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){e.call(f.error_scope||f.scope,h,g)};f.data=b.serial
 ize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(m){var k=m.each,j=m.is,i=m.isWebKit,d=m.isIE,a=/^(H[1-6R]|P|DIV|ADDRESS|PRE|FORM|T(ABLE|BODY|HEAD|FOOT|H|R|D)|LI|OL|UL|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|MENU|ISINDEX|SAMP)$/,e=g("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),f=g("src,href,style,coords,shape"),c={"&":"&",'"':""","<":"<",">":">"},n=/[<>&\"]/g,b=/^([a-z0-9],?)+$/i,h=/<(\w+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)(\s*\/?)>/g,l=/(\w+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;function g(q){var p={},o;q=q.split(",");for(o=q.length;o>=0;o--){p[q[o]]=1}return p}m.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,pixelStyles:/^(top|left|bottom|right|width|heigh
 t|borderWidth)$/,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},DOMUtils:function(u,q){var p=this,o;p.doc=u;p.win=window;p.files={};p.cssFlicker=false;p.counter=0;p.boxModel=!m.isIE||u.compatMode=="CSS1Compat";p.stdMode=u.documentMode===8;p.settings=q=m.extend({keep_values:false,hex_colors:1,process_html:1},q);if(m.isIE6){try{u.execCommand("BackgroundImageCache",false,true)}catch(r){p.cssFlicker=true}}if(q.valid_styles){p._styles={};k(q.valid_styles,function(t,s){p._styles[s]=m.explode(t)})}m.addUnload(p.destroy,p)},getRoot:function(){var o=this,p=o.settings;return(p&&o.get(p.root_element))||o.doc.body},getViewPort:function(p){var q,o;p=!p?this.win:p;q=p.document;o=this.boxModel?q.documentElement:q.body;return{x:p.pageXOffset||o.scrollLeft,y:p.pageYOffset||o.scrollTop,w:p.innerWidth||o.clientWidth,h:p.innerHeight
 ||o.clientHeight}},getRect:function(s){var r,o=this,q;s=o.get(s);r=o.getPos(s);q=o.getSize(s);return{x:r.x,y:r.y,w:q.w,h:q.h}},getSize:function(r){var p=this,o,q;r=p.get(r);o=p.getStyle(r,"width");q=p.getStyle(r,"height");if(o.indexOf("px")===-1){o=0}if(q.indexOf("px")===-1){q=0}return{w:parseInt(o)||r.offsetWidth||r.clientWidth,h:parseInt(q)||r.offsetHeight||r.clientHeight}},getParent:function(q,p,o){return this.getParents(q,p,o,false)},getParents:function(z,v,s,y){var q=this,p,u=q.settings,x=[];z=q.get(z);y=y===undefined;if(u.strict_root){s=s||q.getRoot()}if(j(v,"string")){p=v;if(v==="*"){v=function(o){return o.nodeType==1}}else{v=function(o){return q.is(o,p)}}}while(z){if(z==s||!z.nodeType||z.nodeType===9){break}if(!v||v(z)){if(y){x.push(z)}else{return z}}z=z.parentNode}return y?x:null},get:function(o){var p;if(o&&this.doc&&typeof(o)=="string"){p=o;o=this.doc.getElementById(o);if(o&&o.id!==p){return this.doc.getElementsByName(p)[1]}}return o},getNext:function(p,o){return 
 this._findSib(p,o,"nextSibling")},getPrev:function(p,o){return this._findSib(p,o,"previousSibling")},select:function(q,p){var o=this;return m.dom.Sizzle(q,o.get(p)||o.get(o.settings.root_element)||o.doc,[])},is:function(q,o){var p;if(q.length===undefined){if(o==="*"){return q.nodeType==1}if(b.test(o)){o=o.toLowerCase().split(/,/);q=q.nodeName.toLowerCase();for(p=o.length-1;p>=0;p--){if(o[p]==q){return true}}return false}}return m.dom.Sizzle.matches(o,q.nodeType?[q]:q).length>0},add:function(s,v,o,r,u){var q=this;return this.run(s,function(y){var x,t;x=j(v,"string")?q.doc.createElement(v):v;q.setAttribs(x,o);if(r){if(r.nodeType){x.appendChild(r)}else{q.setHTML(x,r)}}return !u?y.appendChild(x):x})},create:function(q,o,p){return this.add(this.doc.createElement(q),q,o,p,1)},createHTML:function(v,p,s){var u="",r=this,q;u+="<"+v;for(q in p){if(p.hasOwnProperty(q)){u+=" "+q+'="'+r.encode(p[q])+'"'}}if(m.is(s)){return u+">"+s+"</"+v+">"}return u+" />"},remove:function(o,p){return th
 is.run(o,function(r){var q,s;q=r.parentNode;if(!q){return null}if(p){while(s=r.firstChild){if(!m.isIE||s.nodeType!==3||s.nodeValue){q.insertBefore(s,r)}else{r.removeChild(s)}}}return q.removeChild(r)})},setStyle:function(r,o,p){var q=this;return q.run(r,function(v){var u,t;u=v.style;o=o.replace(/-(\D)/g,function(x,s){return s.toUpperCase()});if(q.pixelStyles.test(o)&&(m.is(p,"number")||/^[\-0-9\.]+$/.test(p))){p+="px"}switch(o){case"opacity":if(d){u.filter=p===""?"":"alpha(opacity="+(p*100)+")";if(!r.currentStyle||!r.currentStyle.hasLayout){u.display="inline-block"}}u[o]=u["-moz-opacity"]=u["-khtml-opacity"]=p||"";break;case"float":d?u.styleFloat=p:u.cssFloat=p;break;default:u[o]=p||""}if(q.settings.update_styles){q.setAttrib(v,"_mce_style")}})},getStyle:function(r,o,q){r=this.get(r);if(!r){return false}if(this.doc.defaultView&&q){o=o.replace(/[A-Z]/g,function(s){return"-"+s});try{return this.doc.defaultView.getComputedStyle(r,null).getPropertyValue(o)}catch(p){return null}}
 o=o.replace(/-(\D)/g,function(t,s){return s.toUpperCase()});if(o=="float"){o=d?"styleFloat":"cssFloat"}if(r.currentStyle&&q){return r.currentStyle[o]}return r.style[o]},setStyles:function(u,v){var q=this,r=q.settings,p;p=r.update_styles;r.update_styles=0;k(v,function(o,s){q.setStyle(u,s,o)});r.update_styles=p;if(r.update_styles){q.setAttrib(u,r.cssText)}},setAttrib:function(q,r,o){var p=this;if(!q||!r){return}if(p.settings.strict){r=r.toLowerCase()}return this.run(q,function(u){var t=p.settings;switch(r){case"style":if(!j(o,"string")){k(o,function(s,x){p.setStyle(u,x,s)});return}if(t.keep_values){if(o&&!p._isRes(o)){u.setAttribute("_mce_style",o,2)}else{u.removeAttribute("_mce_style",2)}}u.style.cssText=o;break;case"class":u.className=o||"";break;case"src":case"href":if(t.keep_values){if(t.url_converter){o=t.url_converter.call(t.url_converter_scope||p,o,r,u)}p.setAttrib(u,"_mce_"+r,o,2)}break;case"shape":u.setAttribute("_mce_style",o);break}if(j(o)&&o!==null&&o.length!==0){u
 .setAttribute(r,""+o,2)}else{u.removeAttribute(r,2)}})},setAttribs:function(q,r){var p=this;return this.run(q,function(o){k(r,function(s,t){p.setAttrib(o,t,s)})})},getAttrib:function(r,s,q){var o,p=this;r=p.get(r);if(!r||r.nodeType!==1){return false}if(!j(q)){q=""}if(/^(src|href|style|coords|shape)$/.test(s)){o=r.getAttribute("_mce_"+s);if(o){return o}}if(d&&p.props[s]){o=r[p.props[s]];o=o&&o.nodeValue?o.nodeValue:o}if(!o){o=r.getAttribute(s,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(s)){if(r[p.props[s]]===true&&o===""){return s}return o?s:""}if(r.nodeName==="FORM"&&r.getAttributeNode(s)){return r.getAttributeNode(s).nodeValue}if(s==="style"){o=o||r.style.cssText;if(o){o=p.serializeStyle(p.parseStyle(o),r.nodeName);if(p.settings.keep_values&&!p._isRes(o)){r.setAttribute("_mce_style",o)}}}if(i&&s==="class"&&o){o=o.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(d){switch(s){case"rowspan":case"colspan":if(o===1){o
 =""}break;case"size":if(o==="+0"||o===20||o===0){o=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(o===0){o=""}break;case"hspace":if(o===-1){o=""}break;case"maxlength":case"tabindex":if(o===32768||o===2147483647||o==="32768"){o=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(o===65535){return s}return q;case"shape":o=o.toLowerCase();break;default:if(s.indexOf("on")===0&&o){o=(""+o).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1")}}}return(o!==undefined&&o!==null&&o!=="")?""+o:q},getPos:function(A,s){var p=this,o=0,z=0,u,v=p.doc,q;A=p.get(A);s=s||v.body;if(A){if(d&&!p.stdMode){A=A.getBoundingClientRect();u=p.boxModel?v.documentElement:v.body;o=p.getStyle(p.select("html")[0],"borderWidth");o=(o=="medium"||p.boxModel&&!p.isIE6)&&2||o;return{x:A.left+u.scrollLeft-o,y:A.top+u.scrollTop-o}}q=A;while(q&&q!=s&&q.nodeType){o+=q.offsetLeft||0;z+=q.offsetTop||0;q=q.offsetParent}q=A.parentNode;while(q&&q!=s&&q.nodeTy
 pe){o-=q.scrollLeft||0;z-=q.scrollTop||0;q=q.parentNode}}return{x:o,y:z}},parseStyle:function(r){var u=this,v=u.settings,x={};if(!r){return x}function p(D,A,C){var z,B,o,y;z=x[D+"-top"+A];if(!z){return}B=x[D+"-right"+A];if(z!=B){return}o=x[D+"-bottom"+A];if(B!=o){return}y=x[D+"-left"+A];if(o!=y){return}x[C]=y;delete x[D+"-top"+A];delete x[D+"-right"+A];delete x[D+"-bottom"+A];delete x[D+"-left"+A]}function q(y,s,o,A){var z;z=x[s];if(!z){return}z=x[o];if(!z){return}z=x[A];if(!z){return}x[y]=x[s]+" "+x[o]+" "+x[A];delete x[s];delete x[o];delete x[A]}r=r.replace(/&(#?[a-z0-9]+);/g,"&$1_MCE_SEMI_");k(r.split(";"),function(s){var o,t=[];if(s){s=s.replace(/_MCE_SEMI_/g,";");s=s.replace(/url\([^\)]+\)/g,function(y){t.push(y);return"url("+t.length+")"});s=s.split(":");o=m.trim(s[1]);o=o.replace(/url\(([^\)]+)\)/g,function(z,y){return t[parseInt(y)-1]});o=o.replace(/rgb\([^\)]+\)/g,function(y){return u.toHex(y)});if(v.url_converter){o=o.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g,fu
 nction(y,z){return"url("+v.url_converter.call(v.url_converter_scope||u,u.decode(z),"style",null)+")"})}x[m.trim(s[0]).toLowerCase()]=o}});p("border","","border");p("border","-width","border-width");p("border","-color","border-color");p("border","-style","border-style");p("padding","","padding");p("margin","","margin");q("border","border-width","border-style","border-color");if(d){if(x.border=="medium none"){x.border=""}}return x},serializeStyle:function(v,p){var q=this,r="";function u(s,o){if(o&&s){if(o.indexOf("-")===0){return}switch(o){case"font-weight":if(s==700){s="bold"}break;case"color":case"background-color":s=s.toLowerCase();break}r+=(r?" ":"")+o+": "+s+";"}}if(p&&q._styles){k(q._styles["*"],function(o){u(v[o],o)});k(q._styles[p.toLowerCase()],function(o){u(v[o],o)})}else{k(v,u)}return r},loadCSS:function(o){var q=this,r=q.doc,p;if(!o){o=""}p=q.select("head")[0];k(o.split(","),function(s){var t;if(q.files[s]){return}q.files[s]=true;t=q.create("link",{rel:"stylesheet"
 ,href:m._addVer(s)});if(d&&r.documentMode){t.onload=function(){r.recalc();t.onload=null}}p.appendChild(t)})},addClass:function(o,p){return this.run(o,function(q){var r;if(!p){return 0}if(this.hasClass(q,p)){return q.className}r=this.removeClass(q,p);return q.className=(r!=""?(r+" "):"")+p})},removeClass:function(q,r){var o=this,p;return o.run(q,function(t){var s;if(o.hasClass(t,r)){if(!p){p=new RegExp("(^|\\s+)"+r+"(\\s+|$)","g")}s=t.className.replace(p," ");s=m.trim(s!=" "?s:"");t.className=s;if(!s){t.removeAttribute("class");t.removeAttribute("className")}return s}return t.className})},hasClass:function(p,o){p=this.get(p);if(!p||!o){return false}return(" "+p.className+" ").indexOf(" "+o+" ")!==-1},show:function(o){return this.setStyle(o,"display","block")},hide:function(o){return this.setStyle(o,"display","none")},isHidden:function(o){o=this.get(o);return !o||o.style.display=="none"||this.getStyle(o,"display")=="none"},uniqueId:function(o){return(!o?"mce_":o)+(this.counter
 ++)},setHTML:function(q,p){var o=this;return this.run(q,function(v){var r,t,s,z,u,r;p=o.processHTML(p);if(d){function y(){while(v.firstChild){v.firstChild.removeNode()}try{v.innerHTML="<br />"+p;v.removeChild(v.firstChild)}catch(x){r=o.create("div");r.innerHTML="<br />"+p;k(r.childNodes,function(B,A){if(A){v.appendChild(B)}})}}if(o.settings.fix_ie_paragraphs){p=p.replace(/<p><\/p>|<p([^>]+)><\/p>|<p[^\/+]\/>/gi,'<p$1 _mce_keep="true"> </p>')}y();if(o.settings.fix_ie_paragraphs){s=v.getElementsByTagName("p");for(t=s.length-1,r=0;t>=0;t--){z=s[t];if(!z.hasChildNodes()){if(!z._mce_keep){r=1;break}z.removeAttribute("_mce_keep")}}}if(r){p=p.replace(/<p ([^>]+)>|<p>/ig,'<div $1 _mce_tmp="1">');p=p.replace(/<\/p>/gi,"</div>");y();if(o.settings.fix_ie_paragraphs){s=v.getElementsByTagName("DIV");for(t=s.length-1;t>=0;t--){z=s[t];if(z._mce_tmp){u=o.doc.createElement("p");z.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(A,x){var B;if(x!=="_mce_tmp"){B=z.getAttribu
 te(x);if(!B&&x==="class"){B=z.className}u.setAttribute(x,B)}});for(r=0;r<z.childNodes.length;r++){u.appendChild(z.childNodes[r].cloneNode(true))}z.swapNode(u)}}}}}else{v.innerHTML=p}return p})},processHTML:function(r){var p=this,q=p.settings,v=[];if(!q.process_html){return r}if(d){r=r.replace(/'/g,"'");r=r.replace(/\s+(disabled|checked|readonly|selected)\s*=\s*[\"\']?(false|0)[\"\']?/gi,"")}r=r.replace(/<a( )([^>]+)\/>|<a\/>/gi,"<a$1$2></a>");if(q.keep_values){if(/<script|noscript|style/i.test(r)){function o(t){t=t.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n");t=t.replace(/^[\r\n]*|[\r\n]*$/g,"");t=t.replace(/^\s*(\/\/\s*<!--|\/\/\s*<!\[CDATA\[|<!--|<!\[CDATA\[)[\r\n]*/g,"");t=t.replace(/\s*(\/\/\s*\]\]>|\/\/\s*-->|\]\]>|-->|\]\]-->)\s*$/g,"");return t}r=r.replace(/<script([^>]+|)>([\s\S]*?)<\/script>/gi,function(s,x,t){if(!x){x=' type="text/javascript"'}x=x.replace(/src=\"([^\"]+)\"?/i,function(y,z){if(q.url_converter){z=p.encode(q.url_converter.call(q.url_converter_sco
 pe||p,p.decode(z),"src","script"))}return'_mce_src="'+z+'"'});if(m.trim(t)){v.push(o(t));t="<!--\nMCE_SCRIPT:"+(v.length-1)+"\n// -->"}return"<mce:script"+x+">"+t+"</mce:script>"});r=r.replace(/<style([^>]+|)>([\s\S]*?)<\/style>/gi,function(s,x,t){if(t){v.push(o(t));t="<!--\nMCE_SCRIPT:"+(v.length-1)+"\n-->"}return"<mce:style"+x+">"+t+"</mce:style><style "+x+' _mce_bogus="1">'+t+"</style>"});r=r.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g,function(s,x,t){return"<mce:noscript"+x+"><!--"+p.encode(t).replace(/--/g,"--")+"--></mce:noscript>"})}r=r.replace(/<!\[CDATA\[([\s\S]+)\]\]>/g,"<!--[CDATA[$1]]-->");function u(s){return s.replace(h,function(y,z,x,t){return"<"+z+x.replace(l,function(B,A,E,D,C){var F;A=A.toLowerCase();E=E||D||C||"";if(e[A]){if(E==="false"||E==="0"){return}return A+'="'+A+'"'}if(f[A]&&x.indexOf("_mce_"+A)==-1){F=p.decode(E);if(q.url_converter&&(A=="src"||A=="href")){F=q.url_converter.call(q.url_converter_scope||p,F,A,z)}if(A=="style"){F=p.seri
 alizeStyle(p.parseStyle(F),A)}return A+'="'+E+'" _mce_'+A+'="'+p.encode(F)+'"'}return B})+t+">"})}r=u(r);r=r.replace(/MCE_SCRIPT:([0-9]+)/g,function(t,s){return v[s]})}return r},getOuterHTML:function(o){var p;o=this.get(o);if(!o){return null}if(o.outerHTML!==undefined){return o.outerHTML}p=(o.ownerDocument||this.doc).createElement("body");p.appendChild(o.cloneNode(true));return p.innerHTML},setOuterHTML:function(r,p,s){var o=this;function q(u,t,x){var y,v;v=x.createElement("body");v.innerHTML=t;y=v.lastChild;while(y){o.insertAfter(y.cloneNode(true),u);y=y.previousSibling}o.remove(u)}return this.run(r,function(u){u=o.get(u);if(u.nodeType==1){s=s||u.ownerDocument||o.doc;if(d){try{if(d&&u.nodeType==1){u.outerHTML=p}else{q(u,p,s)}}catch(t){q(u,p,s)}}else{q(u,p,s)}}})},decode:function(p){var q,r,o;if(/&[\w#]+;/.test(p)){q=this.doc.createElement("div");q.innerHTML=p;r=q.firstChild;o="";if(r){do{o+=r.nodeValue}while(r=r.nextSibling)}return o||p}return p},encode:function(o){return("
 "+o).replace(n,function(p){return c[p]})},insertAfter:function(o,p){p=this.get(p);return this.run(o,function(r){var q,s;q=p.parentNode;s=p.nextSibling;if(s){q.insertBefore(r,s)}else{q.appendChild(r)}return r})},isBlock:function(o){if(o.nodeType&&o.nodeType!==1){return false}o=o.nodeName||o;return a.test(o)},replace:function(s,r,p){var q=this;if(j(r,"array")){s=s.cloneNode(true)}return q.run(r,function(t){if(p){k(m.grep(t.childNodes),function(o){s.appendChild(o)})}return t.parentNode.replaceChild(s,t)})},rename:function(r,o){var q=this,p;if(r.nodeName!=o.toUpperCase()){p=q.create(o);k(q.getAttribs(r),function(s){q.setAttrib(p,s.nodeName,q.getAttrib(r,s.nodeName))});q.replace(p,r,1)}return p||r},findCommonAncestor:function(q,o){var r=q,p;while(r){p=o;while(p&&r!=p){p=p.parentNode}if(r==p){break}r=r.parentNode}if(!r&&q.ownerDocument){return q.ownerDocument.documentElement}return r},toHex:function(o){var q=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.
 exec(o);function p(r){r=parseInt(r).toString(16);return r.length>1?r:"0"+r}if(q){o="#"+p(q[1])+p(q[2])+p(q[3]);return o}return o},getClasses:function(){var s=this,o=[],r,u={},v=s.settings.class_filter,q;if(s.classes){return s.classes}function x(t){k(t.imports,function(y){x(y)});k(t.cssRules||t.rules,function(y){switch(y.type||1){case 1:if(y.selectorText){k(y.selectorText.split(","),function(z){z=z.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(z)||!/\.[\w\-]+$/.test(z)){return}q=z;z=z.replace(/.*\.([a-z0-9_\-]+).*/i,"$1");if(v&&!(z=v(z,q))){return}if(!u[z]){o.push({"class":z});u[z]=1}})}break;case 3:x(y.styleSheet);break}})}try{k(s.doc.styleSheets,x)}catch(p){}if(o.length>0){s.classes=o}return o},run:function(u,r,q){var p=this,v;if(p.doc&&typeof(u)==="string"){u=p.get(u)}if(!u){return false}q=q||this;if(!u.nodeType&&(u.length||u.length===0)){v=[];k(u,function(s,o){if(s){if(typeof(s)=="string"){s=p.doc.getElementById(s)}v.push(r.call(q,s,o))}});return v}return r.call(q,u)},ge
 tAttribs:function(q){var p;q=this.get(q);if(!q){return[]}if(d){p=[];if(q.nodeName=="OBJECT"){return q.attributes}if(q.nodeName==="OPTION"&&this.getAttrib(q,"selected")){p.push({specified:1,nodeName:"selected"})}q.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(o){p.push({specified:1,nodeName:o})});return p}return q.attributes},destroy:function(p){var o=this;if(o.events){o.events.destroy()}o.win=o.doc=o.root=o.events=null;if(!p){m.removeUnload(o.destroy)}},createRng:function(){var o=this.doc;return o.createRange?o.createRange():new m.dom.Range(this)},nodeIndex:function(s,t){var o=0,q,r,p;if(s){for(q=s.nodeType,s=s.previousSibling,r=s;s;s=s.previousSibling){p=s.nodeType;if(t&&p==3){if(p==q||!s.nodeValue.length){continue}}o++;q=p}}return o},split:function(u,s,y){var z=this,o=z.createRng(),v,q,x;function p(A){var t,r=A.childNodes;if(A.nodeType==1&&A.getAttribute("_mce_type")=="bookmark"){return}for(t=r.
 length-1;t>=0;t--){p(r[t])}if(A.nodeType!=9){if(A.nodeType==3&&A.nodeValue.length>0){return}if(A.nodeType==1){r=A.childNodes;if(r.length==1&&r[0]&&r[0].nodeType==1&&r[0].getAttribute("_mce_type")=="bookmark"){A.parentNode.insertBefore(r[0],A)}if(r.length||/^(br|hr|input|img)$/i.test(A.nodeName)){return}}z.remove(A)}return A}if(u&&s){o.setStart(u.parentNode,z.nodeIndex(u));o.setEnd(s.parentNode,z.nodeIndex(s));v=o.extractContents();o=z.createRng();o.setStart(s.parentNode,z.nodeIndex(s)+1);o.setEnd(u.parentNode,z.nodeIndex(u)+1);q=o.extractContents();x=u.parentNode;x.insertBefore(p(v),u);if(y){x.replaceChild(y,s)}else{x.insertBefore(s,u)}x.insertBefore(p(q),u);z.remove(u);return y||s}},bind:function(s,o,r,q){var p=this;if(!p.events){p.events=new m.dom.EventUtils()}return p.events.add(s,o,r,q||this)},unbind:function(r,o,q){var p=this;if(!p.events){p.events=new m.dom.EventUtils()}return p.events.remove(r,o,q)},_findSib:function(r,o,p){var q=this,s=o;if(r){if(j(s,"string")){s=fun
 ction(t){return q.is(t,o)}}for(r=r[p];r;r=r[p]){if(s(r)){return r}}}return null},_isRes:function(o){return/^(top|left|bottom|right|width|height)/i.test(o)||/;\s*(top|left|bottom|right|width|height)/i.test(o)}});m.DOM=new m.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var N=this,e=c.doc,S=0,E=1,j=2,D=true,R=false,U="startOffset",h="startContainer",P="endContainer",z="endOffset",k=tinymce.extend,n=c.nodeIndex;k(N,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:D,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:q,setEnd:s,setStartBefore:g,setStartAfter:I,setEndBefore:J,setEndAfter:u,collapse:A,selectNode:x,selectNodeContents:F,compareBoundaryPoints:v,deleteContents:p,extractContents:H,cloneContents:d,insertNode:C,surroundContents:M,cloneRange:K});function q(V,t){B(D,V,t)}function s(V,t){B(R,V,t)}function g(t){q(t.parentNode,n(t))}function I(t){q(t.parentNode,n(t)+1)}function J(t)
 {s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t)+1)}function A(t){if(t){N[P]=N[h];N[z]=N[U]}else{N[h]=N[P];N[U]=N[z]}N.collapsed=D}function x(t){g(t);u(t)}function F(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(W,X){var Z=N[h],Y=N[U],V=N[P],t=N[z];if(W===0){return G(Z,Y,Z,Y)}if(W===1){return G(Z,Y,V,t)}if(W===2){return G(V,t,V,t)}if(W===3){return G(V,t,Z,Y)}}function p(){m(j)}function H(){return m(S)}function d(){return m(E)}function C(Y){var V=this[h],t=this[U],X,W;if((V.nodeType===3||V.nodeType===4)&&V.nodeValue){if(!t){V.parentNode.insertBefore(Y,V)}else{if(t>=V.nodeValue.length){c.insertAfter(Y,V)}else{X=V.splitText(t);V.parentNode.insertBefore(Y,X)}}}else{if(V.childNodes.length>0){W=V.childNodes[t]}if(W){V.insertBefore(Y,W)}else{V.appendChild(Y)}}}function M(V){var t=N.extractContents();N.insertNode(V);V.appendChild(t);N.selectNode(V)}function K(){return k(new b(c),{startContainer:N[h],startOffset:N[U],endContainer:N[P],endOffse
 t:N[z],collapsed:N.collapsed,commonAncestorContainer:N.commonAncestorContainer})}function O(t,V){var W;if(t.nodeType==3){return t}if(V<0){return t}W=t.firstChild;while(W&&V>0){--V;W=W.nextSibling}if(W){return W}return t}function l(){return(N[h]==N[P]&&N[U]==N[z])}function G(X,Z,V,Y){var aa,W,t,ab,ad,ac;if(X==V){if(Z==Y){return 0}if(Z<Y){return -1}return 1}aa=V;while(aa&&aa.parentNode!=X){aa=aa.parentNode}if(aa){W=0;t=X.firstChild;while(t!=aa&&W<Z){W++;t=t.nextSibling}if(Z<=W){return -1}return 1}aa=X;while(aa&&aa.parentNode!=V){aa=aa.parentNode}if(aa){W=0;t=V.firstChild;while(t!=aa&&W<Y){W++;t=t.nextSibling}if(W<Y){return -1}return 1}ab=c.findCommonAncestor(X,V);ad=X;while(ad&&ad.parentNode!=ab){ad=ad.parentNode}if(!ad){ad=ab}ac=V;while(ac&&ac.parentNode!=ab){ac=ac.parentNode}if(!ac){ac=ab}if(ad==ac){return 0}t=ab.firstChild;while(t){if(t==ad){return -1}if(t==ac){return 1}t=t.nextSibling}}function B(V,Y,X){var t,W;if(V){N[h]=Y;N[U]=X}else{N[P]=Y;N[z]=X}t=N[P];while(t.parentNo
 de){t=t.parentNode}W=N[h];while(W.parentNode){W=W.parentNode}if(W==t){if(G(N[h],N[U],N[P],N[z])>0){N.collapse(V)}}else{N.collapse(V)}N.collapsed=l();N.commonAncestorContainer=c.findCommonAncestor(N[h],N[P])}function m(ab){var aa,X=0,ad=0,V,Z,W,Y,t,ac;if(N[h]==N[P]){return f(ab)}for(aa=N[P],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[h]){return r(aa,ab)}++X}for(aa=N[h],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[P]){return T(aa,ab)}++ad}Z=ad-X;W=N[h];while(Z>0){W=W.parentNode;Z--}Y=N[P];while(Z<0){Y=Y.parentNode;Z++}for(t=W.parentNode,ac=Y.parentNode;t!=ac;t=t.parentNode,ac=ac.parentNode){W=t;Y=ac}return o(W,Y,ab)}function f(Z){var ab,Y,X,aa,t,W,V;if(Z!=j){ab=e.createDocumentFragment()}if(N[U]==N[z]){return ab}if(N[h].nodeType==3){Y=N[h].nodeValue;X=Y.substring(N[U],N[z]);if(Z!=E){N[h].deleteData(N[U],N[z]-N[U]);N.collapse(D)}if(Z==j){return}ab.appendChild(e.createTextNode(X));return ab}aa=O(N[h],N[U]);t=N[z]-N[U];while(t>0){W=aa.nextSibling;V=y(aa,Z);if(ab){ab.appendCh
 ild(V)}--t;aa=W}if(Z!=E){N.collapse(D)}return ab}function r(ab,Y){var aa,Z,V,t,X,W;if(Y!=j){aa=e.createDocumentFragment()}Z=i(ab,Y);if(aa){aa.appendChild(Z)}V=n(ab);t=V-N[U];if(t<=0){if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}Z=ab.previousSibling;while(t>0){X=Z.previousSibling;W=y(Z,Y);if(aa){aa.insertBefore(W,aa.firstChild)}--t;Z=X}if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}function T(Z,Y){var ab,V,aa,t,X,W;if(Y!=j){ab=e.createDocumentFragment()}aa=Q(Z,Y);if(ab){ab.appendChild(aa)}V=n(Z);++V;t=N[z]-V;aa=Z.nextSibling;while(t>0){X=aa.nextSibling;W=y(aa,Y);if(ab){ab.appendChild(W)}--t;aa=X}if(Y!=E){N.setStartAfter(Z);N.collapse(D)}return ab}function o(Z,t,ac){var W,ae,Y,aa,ab,V,ad,X;if(ac!=j){ae=e.createDocumentFragment()}W=Q(Z,ac);if(ae){ae.appendChild(W)}Y=Z.parentNode;aa=n(Z);ab=n(t);++aa;V=ab-aa;ad=Z.nextSibling;while(V>0){X=ad.nextSibling;W=y(ad,ac);if(ae){ae.appendChild(W)}ad=X;--V}W=i(t,ac);if(ae){ae.appendChild(W)}if(ac!=E){N.setStartAfter(Z);N.colla
 pse(D)}return ae}function i(aa,ab){var W=O(N[P],N[z]-1),ac,Z,Y,t,V,X=W!=N[P];if(W==aa){return L(W,X,R,ab)}ac=W.parentNode;Z=L(ac,R,R,ab);while(ac){while(W){Y=W.previousSibling;t=L(W,X,R,ab);if(ab!=j){Z.insertBefore(t,Z.firstChild)}X=D;W=Y}if(ac==aa){return Z}W=ac.previousSibling;ac=ac.parentNode;V=L(ac,R,R,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function Q(aa,ab){var X=O(N[h],N[U]),Y=X!=N[h],ac,Z,W,t,V;if(X==aa){return L(X,Y,D,ab)}ac=X.parentNode;Z=L(ac,R,D,ab);while(ac){while(X){W=X.nextSibling;t=L(X,Y,D,ab);if(ab!=j){Z.appendChild(t)}Y=D;X=W}if(ac==aa){return Z}X=ac.nextSibling;ac=ac.parentNode;V=L(ac,R,D,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function L(t,Y,ab,ac){var X,W,Z,V,aa;if(Y){return y(t,ac)}if(t.nodeType==3){X=t.nodeValue;if(ab){V=N[U];W=X.substring(V);Z=X.substring(0,V)}else{V=N[z];W=X.substring(0,V);Z=X.substring(V)}if(ac!=E){t.nodeValue=Z}if(ac==j){return}aa=t.cloneNode(R);aa.nodeValue=W;return aa}if(ac==j){return}return t.cloneNode(R)}function y(V,t){if(t!=j){return
  t==E?V.cloneNode(D):V}V.parentNode.removeChild(V)}}a.Range=b})(tinymce.dom);(function(){function a(g){var i=this,j="\uFEFF",e,h,d=g.dom,c=true,f=false;function b(){var n=g.getRng(),k=d.createRng(),m,o;m=n.item?n.item(0):n.parentElement();if(m.ownerDocument!=d.doc){return k}if(n.item||!m.hasChildNodes()){k.setStart(m.parentNode,d.nodeIndex(m));k.setEnd(k.startContainer,k.startOffset+1);return k}o=g.isCollapsed();function l(s){var u,q,t,p,A=0,x,y,z,r,v;r=n.duplicate();r.collapse(s);u=d.create("a");z=r.parentElement();if(!z.hasChildNodes()){k[s?"setStart":"setEnd"](z,0);return}z.appendChild(u);r.moveToElementText(u);v=n.compareEndPoints(s?"StartToStart":"EndToEnd",r);if(v>0){k[s?"setStartAfter":"setEndAfter"](z);d.remove(u);return}p=tinymce.grep(z.childNodes);x=p.length-1;while(A<=x){y=Math.floor((A+x)/2);z.insertBefore(u,p[y]);r.moveToElementText(u);v=n.compareEndPoints(s?"StartToStart":"EndToEnd",r);if(v>0){A=y+1}else{if(v<0){x=y-1}else{found=true;break}}}q=v>0||y==0?u.nextS
 ibling:u.previousSibling;if(q.nodeType==1){d.remove(u);t=d.nodeIndex(q);q=q.parentNode;if(!s||y>0){t++}}else{if(v>0||y==0){r.setEndPoint(s?"StartToStart":"EndToEnd",n);t=r.text.length}else{r.setEndPoint(s?"StartToStart":"EndToEnd",n);t=q.nodeValue.length-r.text.length}d.remove(u)}k[s?"setStart":"setEnd"](q,t)}l(true);if(!o){l()}return k}this.addRange=function(k){var p,n,m,r,u,s,t=g.dom.doc,o=t.body;function l(B){var x,A,v,z,y;v=d.create("a");x=B?m:u;A=B?r:s;z=p.duplicate();if(x==t){x=o;A=0}if(x.nodeType==3){x.parentNode.insertBefore(v,x);z.moveToElementText(v);z.moveStart("character",A);d.remove(v);p.setEndPoint(B?"StartToStart":"EndToEnd",z)}else{y=x.childNodes;if(y.length){if(A>=y.length){d.insertAfter(v,y[y.length-1])}else{x.insertBefore(v,y[A])}z.moveToElementText(v)}else{v=t.createTextNode(j);x.appendChild(v);z.moveToElementText(v.parentNode);z.collapse(c)}p.setEndPoint(B?"StartToStart":"EndToEnd",z);d.remove(v)}}this.destroy();m=k.startContainer;r=k.startOffset;u=k.end
 Container;s=k.endOffset;p=o.createTextRange();if(m==u&&m.nodeType==1&&r==s-1){if(r==s-1){try{n=o.createControlRange();n.addElement(m.childNodes[r]);n.select();n.scrollIntoView();return}catch(q){}}}l(true);l();p.select();p.scrollIntoView()};this.getRangeAt=function(){if(!e||!tinymce.dom.RangeUtils.compareRanges(h,g.getRng())){e=b();h=g.getRng()}try{e.startContainer.nextSibling}catch(k){e=b();h=null}return e};this.destroy=function(){h=e=null};if(g.dom.boxModel){(function(){var q=d.doc,l=q.body,n,o;q.documentElement.unselectable=c;function p(r,u){var s=l.createTextRange();try{s.moveToPoint(r,u)}catch(t){s=null}return s}function m(s){var r;if(s.button){r=p(s.x,s.y);if(r){if(r.compareEndPoints("StartToStart",o)>0){r.setEndPoint("StartToStart",o)}else{r.setEndPoint("EndToEnd",o)}r.select()}}else{k()}}function k(){d.unbind(q,"mouseup",k);d.unbind(q,"mousemove",m);n=0}d.bind(q,"mousedown",function(r){if(r.target.nodeName==="HTML"){if(n){k()}n=1;o=p(r.x,r.y);if(o){d.bind(q,"mouseup",
 k);d.bind(q,"mousemove",m);o.select()}}})})()}}tinymce.dom.TridentSelection=a})();(function(){var p=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,j=0,d=Object.prototype.toString,o=false,i=true;[0,0].sort(function(){i=false;return 0});var b=function(v,e,z,A){z=z||[];e=e||document;var C=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!v||typeof v!=="string"){return z}var x=[],s,E,H,r,u=true,t=b.isXML(e),B=v,D,G,F,y;do{p.exec("");s=p.exec(B);if(s){B=s[3];x.push(s[1]);if(s[2]){r=s[3];break}}}while(s);if(x.length>1&&k.exec(v)){if(x.length===2&&f.relative[x[0]]){E=h(x[0]+x[1],e)}else{E=f.relative[x[0]]?[e]:b(x.shift(),e);while(x.length){v=x.shift();if(f.relative[v]){v+=x.shift()}E=h(v,E)}}}else{if(!A&&x.length>1&&e.nodeType===9&&!t&&f.match.ID.test(x[0])&&!f.match.ID.test(x[x.length-1])){D=b.find(x.shift(),e,t);e=D.expr?b.filter(D.expr,D.set)[0]:D.set[0]}if(e){D=A?{expr:x.pop(),set:a(A)}:b.fin
 d(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&e.parentNode?e.parentNode:e,t);E=D.expr?b.filter(D.expr,D.set):D.set;if(x.length>0){H=a(E)}else{u=false}while(x.length){G=x.pop();F=G;if(!f.relative[G]){G=""}else{F=x.pop()}if(F==null){F=e}f.relative[G](H,F,t)}}else{H=x=[]}}if(!H){H=E}if(!H){b.error(G||v)}if(d.call(H)==="[object Array]"){if(!u){z.push.apply(z,H)}else{if(e&&e.nodeType===1){for(y=0;H[y]!=null;y++){if(H[y]&&(H[y]===true||H[y].nodeType===1&&b.contains(e,H[y]))){z.push(E[y])}}}else{for(y=0;H[y]!=null;y++){if(H[y]&&H[y].nodeType===1){z.push(E[y])}}}}}else{a(H,z)}if(r){b(r,C,z,A);b.uniqueSort(z)}return z};b.uniqueSort=function(r){if(c){o=i;r.sort(c);if(o){for(var e=1;e<r.length;e++){if(r[e]===r[e-1]){r.splice(e--,1)}}}}return r};b.matches=function(e,r){return b(e,null,null,r)};b.find=function(y,e,z){var x;if(!y){return[]}for(var t=0,s=f.order.length;t<s;t++){var v=f.order[t],u;if((u=f.leftMatch[v].exec(y))){var r=u[1];u.splice(1,1);if(r.substr(r.length-1)!=="\\"){u[
 1]=(u[1]||"").replace(/\\/g,"");x=f.find[v](u,e,z);if(x!=null){y=y.replace(f.match[v],"");break}}}}if(!x){x=e.getElementsByTagName("*")}return{set:x,expr:y}};b.filter=function(C,B,F,u){var s=C,H=[],z=B,x,e,y=B&&B[0]&&b.isXML(B[0]);while(C&&B.length){for(var A in f.filter){if((x=f.leftMatch[A].exec(C))!=null&&x[2]){var r=f.filter[A],G,E,t=x[1];e=false;x.splice(1,1);if(t.substr(t.length-1)==="\\"){continue}if(z===H){H=[]}if(f.preFilter[A]){x=f.preFilter[A](x,z,F,H,u,y);if(!x){e=G=true}else{if(x===true){continue}}}if(x){for(var v=0;(E=z[v])!=null;v++){if(E){G=r(E,x,v,z);var D=u^!!G;if(F&&G!=null){if(D){e=true}else{z[v]=false}}else{if(D){H.push(E);e=true}}}}}if(G!==undefined){if(!F){z=H}C=C.replace(f.match[A],"");if(!e){return[]}break}}}if(C===s){if(e==null){b.error(C)}else{break}}s=C}return z};b.error=function(e){throw"Syntax error, unrecognized expression: "+e};var f=b.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFF
 F\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")}},relative:{"+":function(x,r){var t=typeof r==="string",v=t&&!/\W/.test(r),y=t&&!v;if(v){r=r.toLowerCase()}for(var s=0,e=x.length,u;s<e;s++){if((u=x[s])){while((u=u.previousSibling)&&u.nodeType!==1){}x[s]=y||u&&u.nodeName.toLowerCase()===r?u||false:u===r}}if(y){b.filter(r,x,true)}},">":function(x,r){var u=typeof r==="string",v,s=0,e=x.length;if(u&&!/\W/.test(r)){r=r.toLowerCase();for(;s<e;s++){v=x[s];if(v){var t=v.parentNode;x[s]=t.nodeName.toLowerCase()===r?
 t:false}}}else{for(;s<e;s++){v=x[s];if(v){x[s]=u?v.parentNode:v.parentNode===r}}if(u){b.filter(r,x,true)}}},"":function(t,r,v){var s=j++,e=q,u;if(typeof r==="string"&&!/\W/.test(r)){r=r.toLowerCase();u=r;e=n}e("parentNode",r,s,t,u,v)},"~":function(t,r,v){var s=j++,e=q,u;if(typeof r==="string"&&!/\W/.test(r)){r=r.toLowerCase();u=r;e=n}e("previousSibling",r,s,t,u,v)}},find:{ID:function(r,s,t){if(typeof s.getElementById!=="undefined"&&!t){var e=s.getElementById(r[1]);return e?[e]:[]}},NAME:function(s,v){if(typeof v.getElementsByName!=="undefined"){var r=[],u=v.getElementsByName(s[1]);for(var t=0,e=u.length;t<e;t++){if(u[t].getAttribute("name")===s[1]){r.push(u[t])}}return r.length===0?null:r}},TAG:function(e,r){return r.getElementsByTagName(e[1])}},preFilter:{CLASS:function(t,r,s,e,x,y){t=" "+t[1].replace(/\\/g,"")+" ";if(y){return t}for(var u=0,v;(v=r[u])!=null;u++){if(v){if(x^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(t)>=0)){if(!s){e.push(v)}}else{if(
 s){r[u]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(r,e){return r[1].toLowerCase()},CHILD:function(e){if(e[1]==="nth"){var r=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(r[1]+(r[2]||1))-0;e[3]=r[3]-0}e[0]=j++;return e},ATTR:function(u,r,s,e,v,x){var t=u[1].replace(/\\/g,"");if(!x&&f.attrMap[t]){u[1]=f.attrMap[t]}if(u[2]==="~="){u[4]=" "+u[4]+" "}return u},PSEUDO:function(u,r,s,e,v){if(u[1]==="not"){if((p.exec(u[3])||"").length>1||/^\w/.test(u[3])){u[3]=b(u[3],null,null,r)}else{var t=b.filter(u[3],r,s,true^v);if(!s){e.push.apply(e,t)}return false}}else{if(f.match.POS.test(u[0])||f.match.CHILD.test(u[0])){return true}}return u},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.s
 electedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(s,r,e){return !!b(e[3],s).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toLowerCase()==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)}},setFilters:{first:function(r,e){return e===0},last:function(s,r,e,t){return r===t.length-1},even:function(r,e){return e%2===0},odd:function(r,e){return e%2===1},lt:function(s,r,e){return r<e[3]-0},gt:function(s,r,e){return r>e[3]-0},nth:function(s,r,e){return e[3]-
 0===r},eq:function(s,r,e){return e[3]-0===r}},filter:{PSEUDO:function(s,y,x,z){var e=y[1],r=f.filters[e];if(r){return r(s,x,y,z)}else{if(e==="contains"){return(s.textContent||s.innerText||b.getText([s])||"").indexOf(y[3])>=0}else{if(e==="not"){var t=y[3];for(var v=0,u=t.length;v<u;v++){if(t[v]===s){return false}}return true}else{b.error("Syntax error, unrecognized expression: "+e)}}}},CHILD:function(e,t){var x=t[1],r=e;switch(x){case"only":case"first":while((r=r.previousSibling)){if(r.nodeType===1){return false}}if(x==="first"){return true}r=e;case"last":while((r=r.nextSibling)){if(r.nodeType===1){return false}}return true;case"nth":var s=t[2],A=t[3];if(s===1&&A===0){return true}var v=t[0],z=e.parentNode;if(z&&(z.sizcache!==v||!e.nodeIndex)){var u=0;for(r=z.firstChild;r;r=r.nextSibling){if(r.nodeType===1){r.nodeIndex=++u}}z.sizcache=v}var y=e.nodeIndex-A;if(s===0){return y===0}else{return(y%s===0&&y/s>=0)}}},ID:function(r,e){return r.nodeType===1&&r.getAttribute("id")===e},T
 AG:function(r,e){return(e==="*"&&r.nodeType===1)||r.nodeName.toLowerCase()===e},CLASS:function(r,e){return(" "+(r.className||r.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(v,t){var s=t[1],e=f.attrHandle[s]?f.attrHandle[s](v):v[s]!=null?v[s]:v.getAttribute(s),x=e+"",u=t[2],r=t[4];return e==null?u==="!=":u==="="?x===r:u==="*="?x.indexOf(r)>=0:u==="~="?(" "+x+" ").indexOf(r)>=0:!r?x&&e!==false:u==="!="?x!==r:u==="^="?x.indexOf(r)===0:u==="$="?x.substr(x.length-r.length)===r:u==="|="?x===r||x.substr(0,r.length+1)===r+"-":false},POS:function(u,r,s,v){var e=r[2],t=f.setFilters[e];if(t){return t(u,s,r,v)}}}};var k=f.match.POS,g=function(r,e){return"\\"+(e-0+1)};for(var m in f.match){f.match[m]=new RegExp(f.match[m].source+(/(?![^\[]*\])(?![^\(]*\))/.source));f.leftMatch[m]=new RegExp(/(^(?:.|\r|\n)*?)/.source+f.match[m].source.replace(/\\(\d+)/g,g))}var a=function(r,e){r=Array.prototype.slice.call(r,0);if(e){e.push.apply(e,r);return e}return r};try{Array.prototype.slice
 .call(document.documentElement.childNodes,0)[0].nodeType}catch(l){a=function(u,t){var r=t||[],s=0;if(d.call(u)==="[object Array]"){Array.prototype.push.apply(r,u)}else{if(typeof u.length==="number"){for(var e=u.length;s<e;s++){r.push(u[s])}}else{for(;u[s];s++){r.push(u[s])}}}return r}}var c;if(document.documentElement.compareDocumentPosition){c=function(r,e){if(!r.compareDocumentPosition||!e.compareDocumentPosition){if(r==e){o=true}return r.compareDocumentPosition?-1:1}var s=r.compareDocumentPosition(e)&4?-1:r===e?0:1;if(s===0){o=true}return s}}else{if("sourceIndex" in document.documentElement){c=function(r,e){if(!r.sourceIndex||!e.sourceIndex){if(r==e){o=true}return r.sourceIndex?-1:1}var s=r.sourceIndex-e.sourceIndex;if(s===0){o=true}return s}}else{if(document.createRange){c=function(t,r){if(!t.ownerDocument||!r.ownerDocument){if(t==r){o=true}return t.ownerDocument?-1:1}var s=t.ownerDocument.createRange(),e=r.ownerDocument.createRange();s.setStart(t,0);s.setEnd(t,0);e.setS
 tart(r,0);e.setEnd(r,0);var u=s.compareBoundaryPoints(Range.START_TO_END,e);if(u===0){o=true}return u}}}}b.getText=function(e){var r="",t;for(var s=0;e[s];s++){t=e[s];if(t.nodeType===3||t.nodeType===4){r+=t.nodeValue}else{if(t.nodeType!==8){r+=b.getText(t.childNodes)}}}return r};(function(){var r=document.createElement("div"),s="script"+(new Date()).getTime();r.innerHTML="<a name='"+s+"'/>";var e=document.documentElement;e.insertBefore(r,e.firstChild);if(document.getElementById(s)){f.find.ID=function(u,v,x){if(typeof v.getElementById!=="undefined"&&!x){var t=v.getElementById(u[1]);return t?t.id===u[1]||typeof t.getAttributeNode!=="undefined"&&t.getAttributeNode("id").nodeValue===u[1]?[t]:undefined:[]}};f.filter.ID=function(v,t){var u=typeof v.getAttributeNode!=="undefined"&&v.getAttributeNode("id");return v.nodeType===1&&u&&u.nodeValue===t}}e.removeChild(r);e=r=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElements
 ByTagName("*").length>0){f.find.TAG=function(r,v){var u=v.getElementsByTagName(r[1]);if(r[1]==="*"){var t=[];for(var s=0;u[s];s++){if(u[s].nodeType===1){t.push(u[s])}}u=t}return u}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(r){return r.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=b,s=document.createElement("div");s.innerHTML="<p class='TEST'></p>";if(s.querySelectorAll&&s.querySelectorAll(".TEST").length===0){return}b=function(x,v,t,u){v=v||document;if(!u&&v.nodeType===9&&!b.isXML(v)){try{return a(v.querySelectorAll(x),t)}catch(y){}}return e(x,v,t,u)};for(var r in e){b[r]=e[r]}s=null})()}(function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsB
 yClassName("e").length===1){return}f.order.splice(1,0,"CLASS");f.find.CLASS=function(r,s,t){if(typeof s.getElementsByClassName!=="undefined"&&!t){return s.getElementsByClassName(r[1])}};e=null})();function n(r,x,v,A,y,z){for(var t=0,s=A.length;t<s;t++){var e=A[t];if(e){e=e[r];var u=false;while(e){if(e.sizcache===v){u=A[e.sizset];break}if(e.nodeType===1&&!z){e.sizcache=v;e.sizset=t}if(e.nodeName.toLowerCase()===x){u=e;break}e=e[r]}A[t]=u}}}function q(r,x,v,A,y,z){for(var t=0,s=A.length;t<s;t++){var e=A[t];if(e){e=e[r];var u=false;while(e){if(e.sizcache===v){u=A[e.sizset];break}if(e.nodeType===1){if(!z){e.sizcache=v;e.sizset=t}if(typeof x!=="string"){if(e===x){u=true;break}}else{if(b.filter(x,[e]).length>0){u=e;break}}}e=e[r]}A[t]=u}}}b.contains=document.compareDocumentPosition?function(r,e){return !!(r.compareDocumentPosition(e)&16)}:function(r,e){return r!==e&&(r.contains?r.contains(e):true)};b.isXML=function(e){var r=(e?e.ownerDocument||e:0).documentElement;return r?r.nodeN
 ame!=="HTML":false};var h=function(e,y){var t=[],u="",v,s=y.nodeType?[y]:y;while((v=f.match.PSEUDO.exec(e))){u+=v[0];e=e.replace(f.match.PSEUDO,"")}e=f.relative[e]?e+"*":e;for(var x=0,r=s.length;x<r;x++){b(e,s[x],t)}return b.filter(u,t)};window.tinymce.dom.Sizzle=b})();(function(d){var f=d.each,c=d.DOM,b=d.isIE,e=d.isWebKit,a;d.create("tinymce.dom.EventUtils",{EventUtils:function(){this.inits=[];this.events=[]},add:function(m,p,l,j){var g,h=this,i=h.events,k;if(p instanceof Array){k=[];f(p,function(o){k.push(h.add(m,o,l,j))});return k}if(m&&m.hasOwnProperty&&m instanceof Array){k=[];f(m,function(n){n=c.get(n);k.push(h.add(n,p,l,j))});return k}m=c.get(m);if(!m){return}g=function(n){if(h.disabled){return}n=n||window.event;if(n&&b){if(!n.target){n.target=n.srcElement}d.extend(n,h._stoppers)}if(!j){return l(n)}return l.call(j,n)};if(p=="unload"){d.unloads.unshift({func:g});return g}if(p=="init"){if(h.domLoaded){g()}else{h.inits.push(g)}return g}i.push({obj:m,name:p,func:l,cfunc:
 g,scope:j});h._add(m,p,g);return l},remove:function(l,m,k){var h=this,g=h.events,i=false,j;if(l&&l.hasOwnProperty&&l instanceof Array){j=[];f(l,function(n){n=c.get(n);j.push(h.remove(n,m,k))});return j}l=c.get(l);f(g,function(o,n){if(o.obj==l&&o.name==m&&(!k||(o.func==k||o.cfunc==k))){g.splice(n,1);h._remove(l,m,o.cfunc);i=true;return false}});return i},clear:function(l){var j=this,g=j.events,h,k;if(l){l=c.get(l);for(h=g.length-1;h>=0;h--){k=g[h];if(k.obj===l){j._remove(k.obj,k.name,k.cfunc);k.obj=k.cfunc=null;g.splice(h,1)}}}},cancel:function(g){if(!g){return false}this.stop(g);return this.prevent(g)},stop:function(g){if(g.stopPropagation){g.stopPropagation()}else{g.cancelBubble=true}return false},prevent:function(g){if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}return false},destroy:function(){var g=this;f(g.events,function(j,h){g._remove(j.obj,j.name,j.cfunc);j.obj=j.cfunc=null});g.events=[];g=null},_add:function(h,i,g){if(h.attachEvent){h.attachEvent("
 on"+i,g)}else{if(h.addEventListener){h.addEventListener(i,g,false)}else{h["on"+i]=g}}},_remove:function(i,j,h){if(i){try{if(i.detachEvent){i.detachEvent("on"+j,h)}else{if(i.removeEventListener){i.removeEventListener(j,h,false)}else{i["on"+j]=null}}}catch(g){}}},_pageInit:function(h){var g=this;if(g.domLoaded){return}g.domLoaded=true;f(g.inits,function(i){i()});g.inits=[]},_wait:function(i){var g=this,h=i.document;if(i.tinyMCE_GZ&&tinyMCE_GZ.loaded){g.domLoaded=1;return}if(h.attachEvent){h.attachEvent("onreadystatechange",function(){if(h.readyState==="complete"){h.detachEvent("onreadystatechange",arguments.callee);g._pageInit(i)}});if(h.documentElement.doScroll&&i==i.top){(function(){if(g.domLoaded){return}try{h.documentElement.doScroll("left")}catch(j){setTimeout(arguments.callee,0);return}g._pageInit(i)})()}}else{if(h.addEventListener){g._add(i,"DOMContentLoaded",function(){g._pageInit(i)})}}g._add(i,"load",function(){g._pageInit(i)})},_stoppers:{preventDefault:function(){t
 his.returnValue=false},stopPropagation:function(){this.cancelBubble=true}}});a=d.dom.Event=new d.dom.EventUtils();a._wait(window);d.addUnload(function(){a.destroy()})})(tinymce);(function(a){a.dom.Element=function(f,d){var b=this,e,c;b.settings=d=d||{};b.id=f;b.dom=e=d.dom||a.DOM;if(!a.isIE){c=e.get(b.id)}a.each(("getPos,getRect,getParent,add,setStyle,getStyle,setStyles,setAttrib,setAttribs,getAttrib,addClass,removeClass,hasClass,getOuterHTML,setOuterHTML,remove,show,hide,isHidden,setHTML,get").split(/,/),function(g){b[g]=function(){var h=[f],j;for(j=0;j<arguments.length;j++){h.push(arguments[j])}h=e[g].apply(e,h);b.update(g);return h}});a.extend(b,{on:function(i,h,g){return a.dom.Event.add(b.id,i,h,g)},getXY:function(){return{x:parseInt(b.getStyle("left")),y:parseInt(b.getStyle("top"))}},getSize:function(){var g=e.get(b.id);return{w:parseInt(b.getStyle("width")||g.clientWidth),h:parseInt(b.getStyle("height")||g.clientHeight)}},moveTo:function(g,h){b.setStyles({left:g,top:h}
 )},moveBy:function(g,i){var h=b.getXY();b.moveTo(h.x+g,h.y+i)},resizeTo:function(g,i){b.setStyles({width:g,height:i})},resizeBy:function(g,j){var i=b.getSize();b.resizeTo(i.w+g,i.h+j)},update:function(h){var g;if(a.isIE6&&d.blocker){h=h||"";if(h.indexOf("get")===0||h.indexOf("has")===0||h.indexOf("is")===0){return}if(h=="remove"){e.remove(b.blocker);return}if(!b.blocker){b.blocker=e.uniqueId();g=e.add(d.container||e.getRoot(),"iframe",{id:b.blocker,style:"position:absolute;",frameBorder:0,src:'javascript:""'});e.setStyle(g,"opacity",0)}else{g=e.get(b.blocker)}e.setStyles(g,{left:b.getStyle("left",1),top:b.getStyle("top",1),width:b.getStyle("width",1),height:b.getStyle("height",1),display:b.getStyle("display",1),zIndex:parseInt(b.getStyle("zIndex",1)||0)-1})}}})}})(tinymce);(function(c){function e(f){return f.replace(/[\n\r]+/g,"")}var b=c.is,a=c.isIE,d=c.each;c.create("tinymce.dom.Selection",{Selection:function(i,h,g){var f=this;f.dom=i;f.win=h;f.serializer=g;d(["onBeforeSet
 Content","onBeforeGetContent","onSetContent","onGetContent"],function(j){f[j]=new c.util.Dispatcher(f)});if(!f.win.getSelection){f.tridentSel=new c.dom.TridentSelection(f)}c.addUnload(f.destroy,f)},getContent:function(g){var f=this,h=f.getRng(),l=f.dom.create("body"),j=f.getSel(),i,k,m;g=g||{};i=k="";g.get=true;g.format=g.format||"html";f.onBeforeGetContent.dispatch(f,g);if(g.format=="text"){return f.isCollapsed()?"":(h.text||(j.toString?j.toString():""))}if(h.cloneContents){m=h.cloneContents();if(m){l.appendChild(m)}}else{if(b(h.item)||b(h.htmlText)){l.innerHTML=h.item?h.item(0).outerHTML:h.htmlText}else{l.innerHTML=h.toString()}}if(/^\s/.test(l.innerHTML)){i=" "}if(/\s+$/.test(l.innerHTML)){k=" "}g.getInner=true;g.content=f.isCollapsed()?"":i+f.serializer.serialize(l,g)+k;f.onGetContent.dispatch(f,g);return g.content},setContent:function(i,g){var f=this,j=f.getRng(),l,k=f.win.document;g=g||{format:"html"};g.set=true;i=g.content=f.dom.processHTML(i);f.onBeforeSetContent.dis
 patch(f,g);i=g.content;if(j.insertNode){i+='<span id="__caret">_</span>';if(j.startContainer==k&&j.endContainer==k){k.body.innerHTML=i}else{j.deleteContents();if(k.body.childNodes.length==0){k.body.innerHTML=i}else{j.insertNode(j.createContextualFragment(i))}}l=f.dom.get("__caret");j=k.createRange();j.setStartBefore(l);j.setEndBefore(l);f.setRng(j);f.dom.remove("__caret")}else{if(j.item){k.execCommand("Delete",false,null);j=f.getRng()}j.pasteHTML(i)}f.onSetContent.dispatch(f,g)},getStart:function(){var g=this.getRng(),h,f,j,i;if(g.duplicate||g.item){if(g.item){return g.item(0)}j=g.duplicate();j.collapse(1);h=j.parentElement();f=i=g.parentElement();while(i=i.parentNode){if(i==h){h=f;break}}if(h&&h.nodeName=="BODY"){return h.firstChild||h}return h}else{h=g.startContainer;if(h.nodeType==1&&h.hasChildNodes()){h=h.childNodes[Math.min(h.childNodes.length-1,g.startOffset)]}if(h&&h.nodeType==3){return h.parentNode}return h}},getEnd:function(){var g=this,h=g.getRng(),i,f;if(h.duplica
 te||h.item){if(h.item){return h.item(0)}h=h.duplicate();h.collapse(0);i=h.parentElement();if(i&&i.nodeName=="BODY"){return i.lastChild||i}return i}else{i=h.endContainer;f=h.endOffset;if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[f>0?f-1:f]}if(i&&i.nodeType==3){return i.parentNode}return i}},getBookmark:function(q,r){var u=this,m=u.dom,g,j,i,n,h,o,p,l="\uFEFF",s;function f(v,x){var t=0;d(m.select(v),function(z,y){if(z==x){t=y}});return t}if(q==2){function k(){var v=u.getRng(true),t=m.getRoot(),x={};function y(B,G){var A=B[G?"startContainer":"endContainer"],F=B[G?"startOffset":"endOffset"],z=[],C,E,D=0;if(A.nodeType==3){if(r){for(C=A.previousSibling;C&&C.nodeType==3;C=C.previousSibling){F+=C.nodeValue.length}}z.push(F)}else{E=A.childNodes;if(F>=E.length&&E.length){D=1;F=Math.max(0,E.length-1)}z.push(u.dom.nodeIndex(E[F],r)+D)}for(;A&&A!=t;A=A.parentNode){z.push(u.dom.nodeIndex(A,r))}return z}x.start=y(v,true);if(!u.isCollapsed()){x.end=y(v)}return x}return k()}if(q){retu
 rn{rng:u.getRng()}}g=u.getRng();i=m.uniqueId();n=tinyMCE.activeEditor.selection.isCollapsed();s="overflow:hidden;line-height:0px";if(g.duplicate||g.item){if(!g.item){j=g.duplicate();g.collapse();g.pasteHTML('<span _mce_type="bookmark" id="'+i+'_start" style="'+s+'">'+l+"</span>");if(!n){j.collapse(false);j.pasteHTML('<span _mce_type="bookmark" id="'+i+'_end" style="'+s+'">'+l+"</span>")}}else{o=g.item(0);h=o.nodeName;return{name:h,index:f(h,o)}}}else{o=u.getNode();h=o.nodeName;if(h=="IMG"){return{name:h,index:f(h,o)}}j=g.cloneRange();if(!n){j.collapse(false);j.insertNode(m.create("span",{_mce_type:"bookmark",id:i+"_end",style:s},l))}g.collapse(true);g.insertNode(m.create("span",{_mce_type:"bookmark",id:i+"_start",style:s},l))}u.moveToBookmark({id:i,keep:1});return{id:i}},moveToBookmark:function(n){var r=this,l=r.dom,i,h,f,q,j,s,o,p;if(r.tridentSel){r.tridentSel.destroy()}if(n){if(n.start){f=l.createRng();q=l.getRoot();function g(z){var t=n[z?"start":"end"],v,x,y,u;if(t){for(
 x=q,v=t.length-1;v>=1;v--){u=x.childNodes;if(u.length){x=u[t[v]]}}if(z){f.setStart(x,t[0])}else{f.setEnd(x,t[0])}}}g(true);g();r.setRng(f)}else{if(n.id){function k(A){var u=l.get(n.id+"_"+A),z,t,x,y,v=n.keep;if(u){z=u.parentNode;if(A=="start"){if(!v){t=l.nodeIndex(u)}else{z=u.firstChild;t=1}j=s=z;o=p=t}else{if(!v){t=l.nodeIndex(u)}else{z=u.firstChild;t=1}s=z;p=t}if(!v){y=u.previousSibling;x=u.nextSibling;d(c.grep(u.childNodes),function(B){if(B.nodeType==3){B.nodeValue=B.nodeValue.replace(/\uFEFF/g,"")}});while(u=l.get(n.id+"_"+A)){l.remove(u,1)}if(y&&x&&y.nodeType==x.nodeType&&y.nodeType==3){t=y.nodeValue.length;y.appendData(x.nodeValue);l.remove(x);if(A=="start"){j=s=y;o=p=t}else{s=y;p=t}}}}}function m(t){if(!a&&l.isBlock(t)&&!t.innerHTML){t.innerHTML='<br _mce_bogus="1" />'}return t}k("start");k("end");if(j){f=l.createRng();f.setStart(m(j),o);f.setEnd(m(s),p);r.setRng(f)}}else{if(n.name){r.select(l.select(n.name)[n.index])}else{if(n.rng){r.setRng(n.rng)}}}}}},select:functi
 on(k,j){var i=this,l=i.dom,g=l.createRng(),f;f=l.nodeIndex(k);g.setStart(k.parentNode,f);g.setEnd(k.parentNode,f+1);if(j){function h(m,o){var n=new c.dom.TreeWalker(m,m);do{if(m.nodeType==3&&c.trim(m.nodeValue).length!=0){if(o){g.setStart(m,0)}else{g.setEnd(m,m.nodeValue.length)}return}if(m.nodeName=="BR"){if(o){g.setStartBefore(m)}else{g.setEndBefore(m)}return}}while(m=(o?n.next():n.prev()))}h(k,1);h(k)}i.setRng(g);return k},isCollapsed:function(){var f=this,h=f.getRng(),g=f.getSel();if(!h||h.item){return false}if(h.compareEndPoints){return h.compareEndPoints("StartToEnd",h)===0}return !g||h.collapsed},collapse:function(f){var g=this,h=g.getRng(),i;if(h.item){i=h.item(0);h=this.win.document.body.createTextRange();h.moveToElementText(i)}h.collapse(!!f);g.setRng(h)},getSel:function(){var g=this,f=this.win;return f.getSelection?f.getSelection():f.document.selection},getRng:function(j){var g=this,h,i;if(j&&g.tridentSel){return g.tridentSel.getRangeAt(0)}try{if(h=g.getSel()){i=h
 .rangeCount>0?h.getRangeAt(0):(h.createRange?h.createRange():g.win.document.createRange())}}catch(f){}if(!i){i=g.win.document.createRange?g.win.document.createRange():g.win.document.body.createTextRange()}if(g.selectedRange&&g.explicitRange){if(i.compareBoundaryPoints(i.START_TO_START,g.selectedRange)===0&&i.compareBoundaryPoints(i.END_TO_END,g.selectedRange)===0){i=g.explicitRange}else{g.selectedRange=null;g.explicitRange=null}}return i},setRng:function(i){var h,g=this;if(!g.tridentSel){h=g.getSel();if(h){g.explicitRange=i;h.removeAllRanges();h.addRange(i);g.selectedRange=h.getRangeAt(0)}}else{if(i.cloneRange){g.tridentSel.addRange(i);return}try{i.select()}catch(f){}}},setNode:function(g){var f=this;f.setContent(f.dom.getOuterHTML(g));return g},getNode:function(){var g=this,f=g.getRng(),h=g.getSel(),i;if(f.setStart){if(!f){return g.dom.getRoot()}i=f.commonAncestorContainer;if(!f.collapsed){if(f.startContainer==f.endContainer){if(f.startOffset-f.endOffset<2){if(f.startContai
 ner.hasChildNodes()){i=f.startContainer.childNodes[f.startOffset]}}}if(c.isWebKit&&h.anchorNode&&h.anchorNode.nodeType==1){return h.anchorNode.childNodes[h.anchorOffset]}}if(i&&i.nodeType==3){return i.parentNode}return i}return f.item?f.item(0):f.parentElement()},getSelectedBlocks:function(g,f){var i=this,j=i.dom,m,h,l,k=[];m=j.getParent(g||i.getStart(),j.isBlock);h=j.getParent(f||i.getEnd(),j.isBlock);if(m){k.push(m)}if(m&&h&&m!=h){l=m;while((l=l.nextSibling)&&l!=h){if(j.isBlock(l)){k.push(l)}}}if(h&&m!=h){k.push(h)}return k},destroy:function(g){var f=this;f.win=null;if(f.tridentSel){f.tridentSel.destroy()}if(!g){c.removeUnload(f.destroy)}}})})(tinymce);(function(a){a.create("tinymce.dom.XMLWriter",{node:null,XMLWriter:function(c){function b(){var e=document.implementation;if(!e||!e.createDocument){try{return new ActiveXObject("MSXML2.DOMDocument")}catch(d){}try{return new ActiveXObject("Microsoft.XmlDom")}catch(d){}}else{return e.createDocument("","",null)}}this.doc=b();th
 is.valid=a.isOpera||a.isWebKit;this.reset()},reset:function(){var b=this,c=b.doc;if(c.firstChild){c.removeChild(c.firstChild)}b.node=c.appendChild(c.createElement("html"))},writeStartElement:function(c){var b=this;b.node=b.node.appendChild(b.doc.createElement(c))},writeAttribute:function(c,b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.setAttribute(c,b)},writeEndElement:function(){this.node=this.node.parentNode},writeFullEndElement:function(){var b=this,c=b.node;c.appendChild(b.doc.createTextNode(""));b.node=c.parentNode},writeText:function(b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.appendChild(this.doc.createTextNode(b))},writeCDATA:function(b){this.node.appendChild(this.doc.createCDATASection(b))},writeComment:function(b){if(a.isIE){b=b.replace(/^\-|\-$/g," ")}this.node.appendChild(this.doc.createComment(b.replace(/\-\-/g," ")))},getContent:function(){var b;b=this.doc.xml||new XMLSerializer().serializeToString(this.doc);b=b.replace(/<\?[^?]+\?>|<html>|<
 \/html>|<html\/>|<!DOCTYPE[^>]+>/g,"");b=b.replace(/ ?\/>/g," />");if(this.valid){b=b.replace(/\%MCGT%/g,">")}return b}})})(tinymce);(function(a){a.create("tinymce.dom.StringWriter",{str:null,tags:null,count:0,settings:null,indent:null,StringWriter:function(b){this.settings=a.extend({indent_char:" ",indentation:0},b);this.reset()},reset:function(){this.indent="";this.str="";this.tags=[];this.count=0},writeStartElement:function(b){this._writeAttributesEnd();this.writeRaw("<"+b);this.tags.push(b);this.inAttr=true;this.count++;this.elementCount=this.count},writeAttribute:function(d,b){var c=this;c.writeRaw(" "+c.encode(d)+'="'+c.encode(b)+'"')},writeEndElement:function(){var b;if(this.tags.length>0){b=this.tags.pop();if(this._writeAttributesEnd(1)){this.writeRaw("</"+b+">")}if(this.settings.indentation>0){this.writeRaw("\n")}}},writeFullEndElement:function(){if(this.tags.length>0){this._writeAttributesEnd();this.writeRaw("</"+this.tags.pop()+">");if(this.settings.indentation
 >0){this.writeRaw("\n")}}},writeText:function(b){this._writeAttributesEnd();this.writeRaw(this.encode(b));this.count++},writeCDATA:function(b){this._writeAttributesEnd();this.writeRaw("<![CDATA["+b+"]]>");this.count++},writeComment:function(b){this._writeAttributesEnd();this.writeRaw("<!-- "+b+"-->");this.count++},writeRaw:function(b){this.str+=b},encode:function(b){return b.replace(/[<>&"]/g,function(c){switch(c){case"<":return"<";case">":return">";case"&":return"&";case'"':return"""}return c})},getContent:function(){return this.str},_writeAttributesEnd:function(b){if(!this.inAttr){return}this.inAttr=false;if(b&&this.elementCount==this.count){this.writeRaw(" />");return false}this.writeRaw(">");return true}})})(tinymce);(function(e){var g=e.extend,f=e.each,b=e.util.Dispatcher,d=e.isIE,a=e.isGecko;function c(h){return h.replace(/([?+*])/g,".$1")}e.create("tinymce.dom.Serializer",{Serializer:function(j){var i=this;i.key=0;i.onPreProcess=new b(i);i.onPostProcess
 =new b(i);try{i.writer=new e.dom.XMLWriter()}catch(h){i.writer=new e.dom.StringWriter()}i.settings=j=g({dom:e.DOM,valid_nodes:0,node_filter:0,attr_filter:0,invalid_attrs:/^(_mce_|_moz_|sizset|sizcache)/,closed:/^(br|hr|input|meta|img|link|param|area)$/,entity_encoding:"named",entities:"160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,ae
 lig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,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,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,870
 4,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro",valid_elements:"*[*]",extended_valid_elements:0,invalid_elements:0,fix_table_elements:1,fix_list_elements:true,fix_content_duplication:true,convert_fonts_to_spans:false,font_size_classes:0,apply
 _source_formatting:0,indent_mode:"simple",indent_char:"\t",indent_levels:1,remove_linebreaks:1,remove_redundant_brs:1,element_format:"xhtml"},j);i.dom=j.dom;i.schema=j.schema;if(j.entity_encoding=="named"&&!j.entities){j.entity_encoding="raw"}if(j.remove_redundant_brs){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/(<br \/>\s*)+<\/(p|h[1-6]|div|li)>/gi,function(n,m,o){if(/^<br \/>\s*<\//.test(n)){return"</"+o+">"}return n})})}if(j.element_format=="html"){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/<([^>]+) \/>/g,"<$1>")})}if(j.fix_list_elements){i.onPreProcess.add(function(v,s){var l,z,y=["ol","ul"],u,t,q,k=/^(OL|UL)$/,A;function m(r,x){var o=x.split(","),p;while((r=r.previousSibling)!=null){for(p=0;p<o.length;p++){if(r.nodeName==o[p]){return r}}}return null}for(z=0;z<y.length;z++){l=i.dom.select(y[z],s.node);for(u=0;u<l.length;u++){t=l[u];q=t.parentNode;if(k.test(q.nodeName)){A=m(t,"LI");if(!A){A=i.dom.create("li");A.innerHTML=" ";A.a
 ppendChild(t);q.insertBefore(A,q.firstChild)}else{A.appendChild(t)}}}}})}if(j.fix_table_elements){i.onPreProcess.add(function(k,l){if(!e.isOpera||opera.buildNumber()>=1767){f(i.dom.select("p table",l.node).reverse(),function(p){var o=i.dom.getParent(p.parentNode,"table,p");if(o.nodeName!="TABLE"){try{i.dom.split(o,p)}catch(m){}}})}})}},setEntities:function(o){var n=this,j,m,h={},k;if(n.entityLookup){return}j=o.split(",");for(m=0;m<j.length;m+=2){k=j[m];if(k==34||k==38||k==60||k==62){continue}h[String.fromCharCode(j[m])]=j[m+1];k=parseInt(j[m]).toString(16)}n.entityLookup=h},setRules:function(i){var h=this;h._setup();h.rules={};h.wildRules=[];h.validElements={};return h.addRules(i)},addRules:function(i){var h=this,j;if(!i){return}h._setup();f(i.split(","),function(m){var q=m.split(/\[|\]/),l=q[0].split("/"),r,k,o,n=[];if(j){k=e.extend([],j.attribs)}if(q.length>1){f(q[1].split("|"),function(u){var p={},t;k=k||[];u=u.replace(/::/g,"~");u=/^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/
 .exec(u);u[2]=u[2].replace(/~/g,":");if(u[1]=="!"){r=r||[];r.push(u[2])}if(u[1]=="-"){for(t=0;t<k.length;t++){if(k[t].name==u[2]){k.splice(t,1);return}}}switch(u[3]){case"=":p.defaultVal=u[4]||"";break;case":":p.forcedVal=u[4];break;case"<":p.validVals=u[4].split("?");break}if(/[*.?]/.test(u[2])){o=o||[];p.nameRE=new RegExp("^"+c(u[2])+"$");o.push(p)}else{p.name=u[2];k.push(p)}n.push(u[2])})}f(l,function(v,u){var y=v.charAt(0),t=1,p={};if(j){if(j.noEmpty){p.noEmpty=j.noEmpty}if(j.fullEnd){p.fullEnd=j.fullEnd}if(j.padd){p.padd=j.padd}}switch(y){case"-":p.noEmpty=true;break;case"+":p.fullEnd=true;break;case"#":p.padd=true;break;default:t=0}l[u]=v=v.substring(t);h.validElements[v]=1;if(/[*.?]/.test(l[0])){p.nameRE=new RegExp("^"+c(l[0])+"$");h.wildRules=h.wildRules||{};h.wildRules.push(p)}else{p.name=l[0];if(l[0]=="@"){j=p}h.rules[v]=p}p.attribs=k;if(r){p.requiredAttribs=r}if(o){v="";f(n,function(s){if(v){v+="|"}v+="("+c(s)+")"});p.validAttribsRE=new RegExp("^"+v.toLowerCase()+
 "$");p.wildAttribs=o}})});i="";f(h.validElements,function(m,l){if(i){i+="|"}if(l!="@"){i+=l}});h.validElementsRE=new RegExp("^("+c(i.toLowerCase())+")$")},findRule:function(m){var j=this,l=j.rules,h,k;j._setup();k=l[m];if(k){return k}l=j.wildRules;for(h=0;h<l.length;h++){if(l[h].nameRE.test(m)){return l[h]}}return null},findAttribRule:function(h,l){var j,k=h.wildAttribs;for(j=0;j<k.length;j++){if(k[j].nameRE.test(l)){return k[j]}}return null},serialize:function(r,q){var m,k=this,p,i,j,l;k._setup();q=q||{};q.format=q.format||"html";k.processObj=q;if(d){l=[];f(r.getElementsByTagName("option"),function(o){var h=k.dom.getAttrib(o,"selected");l.push(h?h:null)})}r=r.cloneNode(true);if(d){f(r.getElementsByTagName("option"),function(o,h){k.dom.setAttrib(o,"selected",l[h])})}j=r.ownerDocument.implementation;if(j.createHTMLDocument&&(e.isOpera&&opera.buildNumber()>=1767)){p=j.createHTMLDocument("");f(r.nodeName=="BODY"?r.childNodes:[r],function(h){p.body.appendChild(p.importNode(h,tru
 e))});if(r.nodeName!="BODY"){r=p.body.firstChild}else{r=p.body}i=k.dom.doc;k.dom.doc=p}k.key=""+(parseInt(k.key)+1);if(!q.no_events){q.node=r;k.onPreProcess.dispatch(k,q)}k.writer.reset();k._info=q;k._serializeNode(r,q.getInner);q.content=k.writer.getContent();if(i){k.dom.doc=i}if(!q.no_events){k.onPostProcess.dispatch(k,q)}k._postProcess(q);q.node=null;return e.trim(q.content)},_postProcess:function(n){var i=this,k=i.settings,j=n.content,m=[],l;if(n.format=="html"){l=i._protect({content:j,patterns:[{pattern:/(<script[^>]*>)(.*?)(<\/script>)/g},{pattern:/(<noscript[^>]*>)(.*?)(<\/noscript>)/g},{pattern:/(<style[^>]*>)(.*?)(<\/style>)/g},{pattern:/(<pre[^>]*>)(.*?)(<\/pre>)/g,encode:1},{pattern:/(<!--\[CDATA\[)(.*?)(\]\]-->)/g}]});j=l.content;if(k.entity_encoding!=="raw"){j=i._encode(j)}if(!n.set){j=j.replace(/<p>\s+<\/p>|<p([^>]+)>\s+<\/p>/g,k.entity_encoding=="numeric"?"<p$1> </p>":"<p$1> </p>");if(k.remove_linebreaks){j=j.replace(/\r?\n|\r/g," ");j=j.replace(/(<[
 ^>]+>)\s+/g,"$1 ");j=j.replace(/\s+(<\/[^>]+>)/g," $1");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g,"<$1 $2>");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g,"<$1>");j=j.replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g,"</$1>")}if(k.apply_source_formatting&&k.indent_mode=="simple"){j=j.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g,"\n<$1$2$3>\n");j=j.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g,"\n<$1$2>");j=j.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g,"</$1>\n");j=j.replace(/\n\n/g,"\n")}}j=i._unprotect(j,l);j=j.replace(/<!--\[CDATA\[([\s\S]+)\]\]-->/g,"<![CDATA[$1]]>");if(k.entity_encoding=="raw"){j=j.replace(/<p> <\/p>|<p([^>]+)>&
 nbsp;<\/p>/g,"<p$1>\u00a0</p>")}j=j.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g,function(h,p,o){return"<noscript"+p+">"+i.dom.decode(o.replace(/<!--|-->/g,""))+"</noscript>"})}n.content=j},_serializeNode:function(E,J){var A=this,B=A.settings,y=A.writer,q,j,u,G,F,I,C,h,z,k,r,D,p,m,H,o,x;if(!B.node_filter||B.node_filter(E)){switch(E.nodeType){case 1:if(E.hasAttribute?E.hasAttribute("_mce_bogus"):E.getAttribute("_mce_bogus")){return}p=H=false;q=E.hasChildNodes();k=E.getAttribute("_mce_name")||E.nodeName.toLowerCase();o=E.getAttribute("_mce_type");if(o){if(!A._info.cleanup){p=true;return}else{H=1}}if(d){x=E.scopeName;if(x&&x!=="HTML"&&x!=="html"){k=x+":"+k}}if(k.indexOf("mce:")===0){k=k.substring(4)}if(!H){if(!A.validElementsRE||!A.validElementsRE.test(k)||(A.invalidElementsRE&&A.invalidElementsRE.test(k))||J){p=true;break}}if(d){if(B.fix_content_duplication){if(E._mce_serialized==A.key){return}E._mce_serialized=A.key}if(k.charAt(0)=="/"){k=k.substring(1)}}else{if(a){if(
 E.nodeName==="BR"&&E.getAttribute("type")=="_moz"){return}}}if(B.validate_children){if(A.elementName&&!A.schema.isValid(A.elementName,k)){p=true;break}A.elementName=k}r=A.findRule(k);if(!r){p=true;break}k=r.name||k;m=B.closed.test(k);if((!q&&r.noEmpty)||(d&&!k)){p=true;break}if(r.requiredAttribs){I=r.requiredAttribs;for(G=I.length-1;G>=0;G--){if(this.dom.getAttrib(E,I[G])!==""){break}}if(G==-1){p=true;break}}y.writeStartElement(k);if(r.attribs){for(G=0,C=r.attribs,F=C.length;G<F;G++){I=C[G];z=A._getAttrib(E,I);if(z!==null){y.writeAttribute(I.name,z)}}}if(r.validAttribsRE){C=A.dom.getAttribs(E);for(G=C.length-1;G>-1;G--){h=C[G];if(h.specified){I=h.nodeName.toLowerCase();if(B.invalid_attrs.test(I)||!r.validAttribsRE.test(I)){continue}D=A.findAttribRule(r,I);z=A._getAttrib(E,D,I);if(z!==null){y.writeAttribute(I,z)}}}}if(o&&H){y.writeAttribute("_mce_type",o)}if(k==="script"&&e.trim(E.innerHTML)){y.writeText("// ");y.writeCDATA(E.innerHTML.replace(/<!--|-->|<\[CDATA\[|\]\]>/g,"")
 );q=false;break}if(r.padd){if(q&&(u=E.firstChild)&&u.nodeType===1&&E.childNodes.length===1){if(u.hasAttribute?u.hasAttribute("_mce_bogus"):u.getAttribute("_mce_bogus")){y.writeText("\u00a0")}}else{if(!q){y.writeText("\u00a0")}}}break;case 3:if(B.validate_children&&A.elementName&&!A.schema.isValid(A.elementName,"#text")){return}return y.writeText(E.nodeValue);case 4:return y.writeCDATA(E.nodeValue);case 8:return y.writeComment(E.nodeValue)}}else{if(E.nodeType==1){q=E.hasChildNodes()}}if(q&&!m){u=E.firstChild;while(u){A._serializeNode(u);A.elementName=k;u=u.nextSibling}}if(!p){if(!m){y.writeFullEndElement()}else{y.writeEndElement()}}},_protect:function(j){var i=this;j.items=j.items||[];function h(l){return l.replace(/[\r\n\\]/g,function(m){if(m==="\n"){return"\\n"}else{if(m==="\\"){return"\\\\"}}return"\\r"})}function k(l){return l.replace(/\\[\\rn]/g,function(m){if(m==="\\n"){return"\n"}else{if(m==="\\\\"){return"\\"}}return"\r"})}f(j.patterns,function(l){j.content=k(h(j.cont
 ent).replace(l.pattern,function(n,o,m,p){m=k(m);if(l.encode){m=i._encode(m)}j.items.push(m);return o+"<!--mce:"+(j.items.length-1)+"-->"+p}))});return j},_unprotect:function(i,j){i=i.replace(/\<!--mce:([0-9]+)--\>/g,function(k,h){return j.items[parseInt(h)]});j.items=[];return i},_encode:function(m){var j=this,k=j.settings,i;if(k.entity_encoding!=="raw"){if(k.entity_encoding.indexOf("named")!=-1){j.setEntities(k.entities);i=j.entityLookup;m=m.replace(/[\u007E-\uFFFF]/g,function(h){var l;if(l=i[h]){h="&"+l+";"}return h})}if(k.entity_encoding.indexOf("numeric")!=-1){m=m.replace(/[\u007E-\uFFFF]/g,function(h){return"&#"+h.charCodeAt(0)+";"})}}return m},_setup:function(){var h=this,i=this.settings;if(h.done){return}h.done=1;h.setRules(i.valid_elements);h.addRules(i.extended_valid_elements);if(i.invalid_elements){h.invalidElementsRE=new RegExp("^("+c(i.invalid_elements.replace(/,/g,"|").toLowerCase())+")$")}if(i.attrib_value_filter){h.attribValueFilter=i.attribValueFilter}},_getA
 ttrib:function(m,j,h){var l,k;h=h||j.name;if(j.forcedVal&&(k=j.forcedVal)){if(k==="{$uid}"){return this.dom.uniqueId()}return k}k=this.dom.getAttrib(m,h);switch(h){case"rowspan":case"colspan":if(k=="1"){k=""}break}if(this.attribValueFilter){k=this.attribValueFilter(h,k,m)}if(j.validVals){for(l=j.validVals.length-1;l>=0;l--){if(k==j.validVals[l]){break}}if(l==-1){return null}}if(k===""&&typeof(j.defaultVal)!="undefined"){k=j.defaultVal;if(k==="{$uid}"){return this.dom.uniqueId()}return k}else{if(h=="class"&&this.processObj.get){k=k.replace(/\s?mceItem\w+\s?/g,"")}}if(k===""){return null}return k}})})(tinymce);(function(a){a.dom.ScriptLoader=function(h){var c=0,k=1,i=2,l={},j=[],f={},d=[],g=0,e;function b(m,u){var v=this,q=a.DOM,s,o,r,n;function p(){q.remove(n);if(s){s.onreadystatechange=s.onload=s=null}u()}n=q.uniqueId();if(a.isIE6){o=new a.util.URI(m);r=location;if(o.host==r.hostname&&o.port==r.port&&(o.protocol+":")==r.protocol){a.util.XHR.send({url:a._addVer(o.getURI()),su
 ccess:function(x){var t=q.create("script",{type:"text/javascript"});t.text=x;document.getElementsByTagName("head")[0].appendChild(t);q.remove(t);p()}});return}}s=q.create("script",{id:n,type:"text/javascript",src:a._addVer(m)});s.onload=p;s.onreadystatechange=function(){var t=s.readyState;if(t=="complete"||t=="loaded"){p()}};(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}this.isDone=function(m){return l[m]==i};this.markDone=function(m){l[m]=i};this.add=this.load=function(m,q,n){var o,p=l[m];if(p==e){j.push(m);l[m]=c}if(q){if(!f[m]){f[m]=[]}f[m].push({func:q,scope:n||this})}};this.loadQueue=function(n,m){this.loadScripts(j,n,m)};this.loadScripts=function(m,q,p){var o;function n(r){a.each(f[r],function(s){s.func.call(s.scope)});f[r]=e}d.push({func:q,scope:p||this});o=function(){var r=a.grep(m);m.length=0;a.each(r,function(s){if(l[s]==i){n(s);return}if(l[s]!=k){l[s]=k;g++;b(s,function(){l[s]=i;g--;n(s);o()})}});if(!g){a.each(d,function(s){s.func.call(s
 .scope)});d.length=0}};o()}};a.ScriptLoader=new a.dom.ScriptLoader()})(tinymce);tinymce.dom.TreeWalker=function(a,c){var b=a;function d(i,f,e,j){var h,g;if(i){if(!j&&i[f]){return i[f]}if(i!=c){h=i[e];if(h){return h}for(g=i.parentNode;g&&g!=c;g=g.parentNode){h=g[e];if(h){return h}}}}}this.current=function(){return b};this.next=function(e){return(b=d(b,"firstChild","nextSibling",e))};this.prev=function(e){return(b=d(b,"lastChild","lastSibling",e))}};(function(){var a={};function b(f,e){var d;function c(g){return g.replace(/[A-Z]+/g,function(h){return c(f[h])})}for(d in f){if(f.hasOwnProperty(d)){f[d]=c(f[d])}}c(e).replace(/#/g,"#text").replace(/(\w+)\[([^\]]+)\]/g,function(l,g,j){var h,k={};j=j.split(/\|/);for(h=j.length-1;h>=0;h--){k[j[h]]=1}a[g]=k})}b({Z:"#|H|K|N|O|P",Y:"#|X|form|R|Q",X:"p|T|div|U|W|isindex|fieldset|table",W:"pre|hr|blockquote|address|center|noframes",U:"ul|ol|dl|menu|dir",ZC:"#|p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",T:"h1|h2|h3|h4|h5|h6"
 ,ZB:"#|X|S|Q",S:"R|P",ZA:"#|a|G|J|M|O|P",R:"#|a|H|K|N|O",Q:"noscript|P",P:"ins|del|script",O:"input|select|textarea|label|button",N:"M|L",M:"em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",L:"sub|sup",K:"J|I",J:"tt|i|b|u|s|strike",I:"big|small|font|basefont",H:"G|F",G:"br|span|bdo",F:"object|applet|img|map|iframe"},"script[]style[]object[#|param|X|form|a|H|K|N|O|Q]param[]p[S]a[Z]br[]span[S]bdo[S]applet[#|param|X|form|a|H|K|N|O|Q]h1[S]img[]map[X|form|Q|area]h2[S]iframe[#|X|form|a|H|K|N|O|Q]h3[S]tt[S]i[S]b[S]u[S]s[S]strike[S]big[S]small[S]font[S]basefont[]em[S]strong[S]dfn[S]code[S]q[S]samp[S]kbd[S]var[S]cite[S]abbr[S]acronym[S]sub[S]sup[S]input[]select[optgroup|option]optgroup[option]option[]textarea[]label[S]button[#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[S]ins[#|X|form|a|H|K|N|O|Q]h5[S]del[#|X|form|a|H|K|N|O|Q]h6[S]div[#|X|form|a|H|K|N|O|Q]ul[li]li[#|X|form|a|H|K|N|O|Q]ol[li]dl[dt|dd]dt[S]dd[#|X|form|a|H|K|N|O|Q]menu[li]dir[li]pre[ZA]hr[]blockquote[#|X|form
 |a|H|K|N|O|Q]address[S|p]center[#|X|form|a|H|K|N|O|Q]noframes[#|X|form|a|H|K|N|O|Q]isindex[]fieldset[#|legend|X|form|a|H|K|N|O|Q]legend[S]table[caption|col|colgroup|thead|tfoot|tbody|tr]caption[S]col[]colgroup[col]thead[tr]tr[th|td]th[#|X|form|a|H|K|N|O|Q]form[#|X|a|H|K|N|O|Q]noscript[#|X|form|a|H|K|N|O|Q]td[#|X|form|a|H|K|N|O|Q]tfoot[tr]tbody[tr]area[]base[]body[#|X|form|a|H|K|N|O|Q]");tinymce.dom.Schema=function(){var c=this,d=a;c.isValid=function(f,e){var g=d[f];return !!(g&&(!e||g[e]))}}})();(function(a){a.dom.RangeUtils=function(c){var b="\uFEFF";this.walk=function(d,r){var h=d.startContainer,k=d.startOffset,s=d.endContainer,l=d.endOffset,i,f,n,g,q,p,e;e=c.select("td.mceSelected,th.mceSelected");if(e.length>0){a.each(e,function(t){r([t])});return}function o(v,u,t){var x=[];for(;v&&v!=t;v=v[u]){x.push(v)}return x}function m(u,t){do{if(u.parentNode==t){return u}u=u.parentNode}while(u)}function j(v,u,x){var t=x?"nextSibling":"previousSibling";for(g=v,q=g.parentNode;g&&g!=u
 ;g=q){q=g.parentNode;p=o(g==v?g:g[t],t);if(p.length){if(!x){p.reverse()}r(p)}}}if(h.nodeType==1&&h.hasChildNodes()){h=h.childNodes[k]}if(s.nodeType==1&&s.hasChildNodes()){s=s.childNodes[Math.min(k==l?l:l-1,s.childNodes.length-1)]}i=c.findCommonAncestor(h,s);if(h==s){return r([h])}for(g=h;g;g=g.parentNode){if(g==s){return j(h,i,true)}if(g==i){break}}for(g=s;g;g=g.parentNode){if(g==h){return j(s,i)}if(g==i){break}}f=m(h,i)||h;n=m(s,i)||s;j(h,f,true);p=o(f==h?f:f.nextSibling,"nextSibling",n==s?n.nextSibling:n);if(p.length){r(p)}j(s,n)}};a.dom.RangeUtils.compareRanges=function(c,b){if(c&&b){if(c.item||c.duplicate){if(c.item&&b.item&&c.item(0)===b.item(0)){return true}if(c.isEqual&&b.isEqual&&b.isEqual(c)){return true}}else{return c.startContainer==b.startContainer&&c.startOffset==b.startOffset}}return false}})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(e,d){this.id=e;this.settings=d=d||{};this.rendered=false;this.onRender=new c.util.
 Dispatcher(this);this.classPrefix="";this.scope=d.scope||this;this.disabled=0;this.active=0},setDisabled:function(d){var f;if(d!=this.disabled){f=b.get(this.id);if(f&&this.settings.unavailable_prefix){if(d){this.prevTitle=f.title;f.title=this.settings.unavailable_prefix+": "+f.title}else{f.title=this.prevTitle}}this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy
 ()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(b,a){this.parent(b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator"},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Me
 nu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),
 g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"
 ),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.clientWidth,j.max_width):g.clientWidth;k=j.max_height?Math.min(g.clientHeight,j.max_height):g.clientHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeight<j.max_height){c.setStyle(l,"overflow","hidden")}}},showMenu:function(p,n,r){var z=this,A=z.settings,o,g=c.getViewPort(),u,l,v,q,i=2,k,j,m=z.classPrefix;z.collapse(1);if(z.isMenuVisible){return}if(!z.rendered){o=c.add(z.settings.container,z.renderNode());f(z.items,function(h){h.postRender()});z.element=new b("menu_"+z.id,{blocker:1,container:A.container})}else{o=c.get("menu_"+z.id)}if(!e.isOpera){c.setStyles(o,{left:-65535,top:-65535})}c.show(o);z.update();p+=A.offset_x||0;n+=A.offset_y||0;g.w-=4;g.h-=4;if(A.constrain){u=o.clientWidth-i;l=o.clientHeight-i;v=g.x+g.w;q=g.y+g.h;if((p+A.vp_offset_x+u)>v){p=r?r-u:Mat
 h.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return a.cancel(s)}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(x){var h,t,s;x=x.target;if(x&&(x=c.getParent(x,"tr"))){h=z.items[x.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(x&&c.hasClass(x,m+"ItemSub")){t=c.getRect(x);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}z.onShowMenu.dispatch(z);if(A.keyboard_focus){a.add(o,"keydown",z._keyHandler,z);c.select("a","menu_"+z.id)[0].focus();z._focusIdx=0}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!
 g.isMenuVisible){return}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);a.remove(h,"mouseover",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000"});k=c.add(g,"div",{id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["c
 lass"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_keyHandler:function(j){var i=this,h=j.keyCode;function g(m){var k=i._focusIdx+m,l=c.select("a","menu_"+i.id)[k];if(l){i._focusIdx=k;l.focus()}}switch(h){case 38:g(-1);return;case 40:g(1);return;case 13:return;case 27:return this.hideMenu()}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,"td");i=p=c.add(i,"a",{href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});c.addClass(k,q["class"]);g=c.add(i,"span",{
 "class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(d,c){this.parent(d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='<a id="'+this.id+'" href="javascript:;" class="'+f+" "+f+"Enabled "+e["class"]+(c?" "+f+"Labeled":"")+'" onmousedown="return false;" onclick="return false;" title="'+a.encode(e.title)+'">';if(e.image){d+='<img class="mceIcon" src="'+e.image+'" /
 >'+c+"</a>"}else{d+='<span class="mceIcon '+e["class"]+'"></span>'+(c?'<span class="'+f+'Label">'+c+"</span>":"")+"</a>"}return d},postRender:function(){var c=this,d=c.settings;b.dom.Event.add(c.id,"click",function(f){if(!c.isDisabled()){return d.onclick.call(d.scope,f)}})}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(h,g){var f=this;f.parent(h,g);f.items=[];f.onChange=new a(f);f.onPostRender=new a(f);f.onAdd=new a(f);f.onRenderMenu=new d.util.Dispatcher(this);f.classPrefix="mceListBox"},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){var g=this,h,i;if(f!=g.selectedIndex){h=c.get(g.id+"_text");i=g.items[f];if(i){g.selectedValue=i.value;g.sel
 ectedIndex=f;c.setHTML(h,c.encode(i.title));c.removeClass(h,"mceTitle")}else{c.setHTML(h,c.encode(g.settings.title));c.addClass(h,"mceTitle");g.selectedValue=g.selectedIndex=null}h=0}},add:function(i,f,h){var g=this;h=h||{};h=d.extend(h,{title:i,value:f});g.items.push(h);g.onAdd.dispatch(g,h)},getLength:function(){return this.items.length},renderHTML:function(){var i="",f=this,g=f.settings,j=f.classPrefix;i='<table id="'+f.id+'" cellpadding="0" cellspacing="0" class="'+j+" "+j+"Enabled"+(g["class"]?(" "+g["class"]):"")+'"><tbody><tr>';i+="<td>"+c.createHTML("a",{id:f.id+"_text",href:"javascript:;","class":"mceText",onclick:"return false;",onmousedown:"return false;"},c.encode(f.settings.title))+"</td>";i+="<td>"+c.createHTML("a",{id:f.id+"_open",tabindex:-1,href:"javascript:;","class":"mceOpen",onclick:"return false;",onmousedown:"return false;"},"<span></span>")+"</td>";i+="</tr></tbody></table>";return i},showMenu:function(){var g=this,j,i,h=c.get(this.id),f;if(g.isDisable
 d()||g.items.length==0){return}if(g.menu&&g.menu.isMenuVisible){return g.hideMenu()}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}j=c.getPos(this.settings.menu_container);i=c.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.keyboard_focus=!d.isOpera;if(g.oldID){f.items[g.oldID].setSelected(0)}e(g.items,function(k){if(k.value===g.selectedValue){f.items[k.id].setSelected(1);g.oldID=k.id}});f.showMenu(0,h.clientHeight);b.add(c.doc,"mousedown",g.hideMenu,g);c.addClass(g.id,g.classPrefix+"Selected")},hideMenu:function(g){var f=this;if(f.menu&&f.menu.isMenuVisible){if(g&&g.type=="mousedown"&&(g.target.id==f.id+"_text"||g.target.id==f.id+"_open")){return}if(!g||!c.getParent(g.target,".mceMenu")){c.removeClass(f.id,f.classPrefix+"Selected");b.remove(c.doc,"mousedown",f.hideMenu,f);f.menu.hideMenu()}}},renderMenu:function(){var g=this,f;f=g.settings.control_manager.createDropMenu(g.id+"_menu",{menu_line:1,"class":g.classPrefix+"Menu mceNoIcon
 s",max_width:150,max_height:150});f.onHideMenu.add(g.hideMenu,g);f.add({title:g.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}});e(g.items,function(h){if(h.value===undefined){f.add({title:h.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}})}else{h.id=c.uniqueId();h.onclick=function(){if(g.settings.onselect(h.value)!==false){g.select(h.value)}};f.add(h)}});g.onRenderMenu.dispatch(g,f);g.menu=f},postRender:function(){var f=this,g=f.classPrefix;b.add(f.id,"click",f.showMenu,f);b.add(f.id+"_text","focus",function(){if(!f._focused){f.keyDownHandler=b.add(f.id+"_text","keydown",function(k){var h=-1,i,j=k.keyCode;e(f.items,function(l,m){if(f.selectedValue==l.value){h=m}});if(j==38){i=f.items[h-1]}else{if(j==40){i=f.items[h+1]}else{if(j==13){i=f.selectedValue;f.selectedValue=null;f.settings.onselect(i);return b.cancel(k)}}}if(i){f.hideMenu();f.select(i.value)}})}f._
 focused=1});b.add(f.id+"_text","blur",function(){b.remove(f.id+"_text","keydown",f.keyDownHandler);f._focused=0});if(d.isIE6||!c.boxModel){b.add(f.id,"mouseover",function(){if(!c.hasClass(f.id,g+"Disabled")){c.addClass(f.id,g+"Hover")}});b.add(f.id,"mouseout",function(){if(!c.hasClass(f.id,g+"Disabled")){c.removeClass(f.id,g+"Hover")}})}f.onPostRender.dispatch(f,c.get(f.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(g,f){this.parent(g,f);this.classPrefix="mceNativeListBox"},setDisabled:function(f){c.get(this.id).disabled=f},isDisabled:function(){return c.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.select
 ByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){c.get(this.id).selectedIndex=f+1;this.selectedValue=this.items[f]?this.items[f].value:null},add:function(j,g,f){var i,h=this;f=f||{};f.value=g;if(h.isRendered()){c.add(c.get(this.id),"option",f,j)}i={title:j,value:g,attribs:f};h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return this.items.length},renderHTML:function(){var g,f=this;g=c.createHTML("option",{value:""},"-- "+f.settings.title+" --");e(f.items,function(h){g+=c.createHTML("option",{value:h.value},h.title)});g=c.createHTML("select",{id:f.id,"class":"mceNativeListBox"},g);return g},postRender:function(){var g=this,h;g.rendered=true;function f(j){var i=g.items[j.target.selectedIndex-1];if(i&&(i=i.value)){g.onChange.dispatch(g,i);if(g.settings.onselect){g.settings.onselect(i)}}}b.add(g.id,"change",f);b.add(g.id,"keydown",function(j){var i;b.remove(g.id,"change",h);i=b.add(g.id,"blur",function(){b.add(g.id,"change",f);b.rem
 ove(g.id,"blur",i)});if(j.keyCode==13||j.keyCode==32){f(j);return b.cancel(j)}});g.onPostRender.dispatch(g,c.get(g.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(f,e){this.parent(f,e);this.onRenderMenu=new c.util.Dispatcher(this);e.menu_container=e.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Me
 nu",icons:f.settings.icons});e.onHideMenu.add(f.hideMenu,f);f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(f,e){this.parent(f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="<tbody><tr>";if(g.image){e=b.createHTML("img ",{src:g.image,"class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}i+="<td>"+b.createHTML("a",{id:f.id+"
 _action",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";e=b.createHTML("span",{"class":"mceOpen "+g["class"]});i+="<td>"+b.createHTML("a",{id:f.id+"_open",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";i+="</tr></tbody>";return b.createHTML("table",{id:f.id,"class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",onmousedown:"return false;",title:g.title},i)},postRender:function(){var e=this,f=e.settings;if(f.onclick){a.add(e.id+"_action","click",function(){if(!e.isDisabled()){f.onclick(e.value)}})}a.add(e.id+"_open","click",e.showMenu,e);a.add(e.id+"_open","focus",function(){e._focused=1});a.add(e.id+"_open","blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHove
 r")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(h,g){var f=this;f.parent(h,g);f.settings=g=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},f.settings);f.onShowMenu=new d.util.Dispatcher(f);f.onHideMenu=new d.util.Dispatcher(f);f.value=g.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=
 true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.isMenuVisible=1},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.onHideMenu.dispatch(f);f.isMenuVisible=0},renderMenu:function(){var k=this,f,j=0,l=k.settings,p,h,o,g;g=c.add(l.menu_container,"div",{id:k.id+"_menu","class":l.menu_class+" "+l["class"],style:"position:absolute;left:
 0;top:-1000px;"});f=c.add(g,"div",{"class":l["class"]+" mceSplitButtonMenu"});c.add(f,"span",{"class":"mceMenuLine"});p=c.add(f,"table",{"class":"mceColorSplitMenu"});h=c.add(p,"tbody");j=0;e(b(l.colors,"array")?l.colors:l.colors.split(","),function(i){i=i.replace(/^#/,"");if(!j--){o=c.add(h,"tr");j=l.grid_width-1}p=c.add(o,"td");p=c.add(p,"a",{href:"javascript:;",style:{backgroundColor:"#"+i},_mce_color:"#"+i})});if(l.more_colors_func){p=c.add(h,"tr");p=c.add(p,"td",{colspan:l.grid_width,"class":"mceMoreColors"});p=c.add(p,"a",{id:k.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},l.more_colors_title);a.add(p,"click",function(i){l.more_colors_func.call(l.more_colors_scope||this);return a.cancel(i)})}c.addClass(f,"mceColorSplitMenu");a.add(k.id+"_menu","click",function(i){var m;i=i.target;if(i.nodeName=="A"&&(m=i.getAttribute("_mce_color"))){k.setColor(m)}return a.cancel(i)});return g},setColor:function(g){var f=this;c.setStyle(f.id+"_preview",
 "backgroundColor",g);f.value=g;f.hideMenu();f.settings.onselect(g)},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){this.parent();a.clear(this.id+"_menu");a.clear(this.id+"_more");c.remove(this.id+"_menu")}})})(tinymce);tinymce.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var l=this,e="",g,j,b=tinymce.DOM,m=l.settings,d,a,f,k;k=l.controls;for(d=0;d<k.length;d++){j=k[d];a=k[d-1];f=k[d+1];if(d===0){g="mceToolbarStart";if(j.Button){g+=" mceToolbarStartButton"}else{if(j.SplitButton){g+=" mceToolbarStartSplitButton"}else{if(j.ListBox){g+=" mceToolbarStartListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,"<!-- IE -->"))}if(a&&j.ListBox){if(a.Button||a.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarEnd"},b.createHTML("span",null,"<!-- IE -->"))}}if(b.stdMode){e+='<td style="position: re
 lative">'+j.renderHTML()+"</td>"}else{e+="<td>"+j.renderHTML()+"</td>"}if(f&&j.ListBox){if(f.Button||f.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarStart"},b.createHTML("span",null,"<!-- IE -->"))}}}g="mceToolbarEnd";if(j.Button){g+=" mceToolbarEndButton"}else{if(j.SplitButton){g+=" mceToolbarEndSplitButton"}else{if(j.ListBox){g+=" mceToolbarEndListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,"<!-- IE -->"));return b.createHTML("table",{id:l.id,"class":"mceToolbar"+(m["class"]?" "+m["class"]:""),cellpadding:"0",cellspacing:"0",align:l.settings.align||""},"<tbody><tr>"+e+"</tr></tbody>")}});(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{AddOnManager:function(){var d=this;d.items=[];d.urls={};d.lookup={};d.onAdd=new a(d)},get:function(d){return this.lookup[d]},requireLangPack:function(e){var d=b.settings;if(d&&d.language){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(e,d){this.items.push(
 d);this.lookup[e]=d;this.onAdd.dispatch(this,e,d);return d},load:function(h,e,d,g){var f=this;if(f.urls[h]){return}if(e.indexOf("/")!=0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}f.urls[h]=e.substring(0,e.lastIndexOf("/"));if(!f.lookup[h]){b.ScriptLoader.add(e,d,g)}}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(j){var g=j.each,d=j.extend,k=j.DOM,i=j.dom.Event,f=j.ThemeManager,b=j.PluginManager,e=j.explode,h=j.util.Dispatcher,a,c=0;j.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(j.documentBaseURL)){j.documentBaseURL+="/"}j.baseURL=new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL);j.baseURI=new j.util.URI(j.baseURL);j.onBeforeUnload=new h(j);i.add(window,"beforeunload",function(l){j.onBeforeUnload.dispatch(j,l)});j.onAddEditor=new h(j);j.onRemoveEditor=new h(j);j.EditorManager=d(j,{editors:[],i18n:{},activeEditor:null,init:function(q){var n=this,p,l=j.ScriptLoade
 r,u,o=[],m;function r(x,y,t){var v=x[y];if(!v){return}if(j.is(v,"string")){t=v.replace(/\.\w+$/,"");t=t?j.resolve(t):0;v=j.resolve(v)}return v.apply(t||this,Array.prototype.slice.call(arguments,2))}q=d({theme:"simple",language:"en"},q);n.settings=q;i.add(document,"init",function(){var s,v;r(q,"onpageload");switch(q.mode){case"exact":s=q.elements||"";if(s.length>0){g(e(s),function(x){if(k.get(x)){m=new j.Editor(x,q);o.push(m);m.render(1)}else{g(document.forms,function(y){g(y.elements,function(z){if(z.name===x){x="mce_editor_"+c++;k.setAttrib(z,"id",x);m=new j.Editor(x,q);o.push(m);m.render(1)}})})}})}break;case"textareas":case"specific_textareas":function t(y,x){return x.constructor===RegExp?x.test(y.className):k.hasClass(y,x)}g(k.select("textarea"),function(x){if(q.editor_deselector&&t(x,q.editor_deselector)){return}if(!q.editor_selector||t(x,q.editor_selector)){u=k.get(x.name);if(!x.id&&!u){x.id=x.name}if(!x.id||n.get(x.id)){x.id=k.uniqueId()}m=new j.Editor(x.id,q);o.push(m
 );m.render(1)}});break}if(q.oninit){s=v=0;g(o,function(x){v++;if(!x.initialized){x.onInit.add(function(){s++;if(s==v){r(q,"oninit")}})}else{s++}if(s==v){r(q,"oninit")}})}})},get:function(l){if(l===a){return this.editors}return this.editors[l]},getInstanceById:function(l){return this.get(l)},add:function(m){var l=this,n=l.editors;n[m.id]=m;n.push(m);l._setActive(m);l.onAddEditor.dispatch(l,m);return m},remove:function(n){var m=this,l,o=m.editors;if(!o[n.id]){return null}delete o[n.id];for(l=0;l<o.length;l++){if(o[l]==n){o.splice(l,1);break}}if(m.activeEditor==n){m._setActive(o[0])}n.destroy();m.onRemoveEditor.dispatch(m,n);return n},execCommand:function(r,p,o){var q=this,n=q.get(o),l;switch(r){case"mceFocus":n.focus();return true;case"mceAddEditor":case"mceAddControl":if(!q.get(o)){new j.Editor(o,q.settings).render()}return true;case"mceAddFrameControl":l=o.window;l.tinyMCE=tinyMCE;l.tinymce=j;j.DOM.doc=l.document;j.DOM.win=l;n=new j.Editor(o.element_id,o);n.render();if(j.isI
 E){function m(){n.destroy();l.detachEvent("onunload",m);l=l.tinyMCE=l.tinymce=null}l.attachEvent("onunload",m)}o.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":if(n){n.remove()}return true;case"mceToggleEditor":if(!n){q.execCommand("mceAddControl",0,o);return true}if(n.isHidden()){n.show()}else{n.hide()}return true}if(q.activeEditor){return q.activeEditor.execCommand(r,p,o)}return false},execInstanceCommand:function(p,o,n,m){var l=this.get(p);if(l){return l.execCommand(o,n,m)}return false},triggerSave:function(){g(this.editors,function(l){l.save()})},addI18n:function(n,q){var l,m=this.i18n;if(!j.is(n,"string")){g(n,function(r,p){g(r,function(t,s){g(t,function(v,u){if(s==="common"){m[p+"."+u]=v}else{m[p+"."+s+"."+u]=v}})})})}else{g(q,function(r,p){m[n+"."+p]=r})}},_setActive:function(l){this.selectedInstance=this.activeEditor=l}})})(tinymce);(function(m){var n=m.DOM,j=m.dom.Event,f=m.extend,k=m.util.Dispatcher,i=m.each,a=m.isGecko,b=m.isIE,e=m.isWeb
 Kit,d=m.is,h=m.ThemeManager,c=m.PluginManager,o=m.inArray,l=m.grep,g=m.explode;m.create("tinymce.Editor",{Editor:function(r,q){var p=this;p.id=p.editorId=r;p.execCommands={};p.queryStateCommands={};p.queryValueCommands={};p.isNotDirty=false;p.plugins={};i(["onPreInit","onBeforeRenderUI","onPostRender","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState"],function(s){p[s]=new k(p)});p.settings=q=f({id:r,language:"en",docs_language:"en",theme:"simple",skin:"default",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:m.documentBaseURL,add_form_submit_trigger:1,submit_patch:1,ad
 d_unload_trigger:1,convert_urls:1,relative_urls:1,remove_script_host:1,table_inline_editing:0,object_resizing:1,cleanup:1,accessibility_focus:1,custom_shortcuts:1,custom_undo_redo_keyboard_shortcuts:1,custom_undo_redo_restore_selection:1,custom_undo_redo:1,doctype:m.isIE6?'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">':"<!DOCTYPE>",visual_table_class:"mceItemTable",visual:1,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",apply_source_formatting:1,directionality:"ltr",forced_root_block:"p",valid_elements:"@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p,-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite],-table
 [border|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value|tabindex|accesskey],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|sele
 cted|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big",hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,force_p_newlines:1,indentation:"30px",keep_styles:1,fix_table_elements:1,inline_styles:1,convert_fonts_to_spans:true},q);p.documentBaseURI=new m.util.URI(q.document_base_url||m.documentBaseURL,{base_uri:tinyMCE.baseURI});p.baseURI=m.baseURI;p.execCallback("setup",p)},render:function(r){var u=this,v=u.settings,x=u.id,p=m.ScriptLoader;if(!j.domLoaded){j.add(document,"init",function(){u.render()});return}tinyMCE.settings=v;if(!u.getElement()){return}if(m.isIDevice){return}if(!/TEXTAREA|INPUT/i.test(u.getElement().nodeName)&&v.hidden_input&&n.getParent(x,"form")){n.insertAfter(n.create("input",{type:"hidden",name:x}),x)}if(m.WindowManager){u.windowManager=new m.WindowManager(u)}if(v.encoding=="xml"){u.onGetContent.add(function(s,t){if(t.save){t.content=n.encode(t.content)}})}if(v.add_form_submit_trig
 ger){u.onSubmit.addToTop(function(){if(u.initialized){u.save();u.isNotDirty=1}})}if(v.add_unload_trigger){u._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(u.initialized&&!u.destroyed&&!u.isHidden()){u.save({format:"raw",no_events:true})}})}m.addUnload(u.destroy,u);if(v.submit_patch){u.onBeforeRenderUI.add(function(){var s=u.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){u.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){m.triggerSave();u.isNotDirty=1;return u.formElement._mceOldSubmit(u.formElement)}}s=null})}function q(){if(v.language){p.add(m.baseURL+"/langs/"+v.language+".js")}if(v.theme&&v.theme.charAt(0)!="-"&&!h.urls[v.theme]){h.load(v.theme,"themes/"+v.theme+"/editor_template"+m.suffix+".js")}i(g(v.plugins),function(s){if(s&&s.charAt(0)!="-"&&!c.urls[s]){if(s=="safari"){return}c.load(s,"plugins/"+s+"/editor_plugin"+m.suffix+".js")}});p.loadQueue(function(){if(!u.removed){u.init()}})}q()},init:funct
 ion(){var r,E=this,F=E.settings,B,y,A=E.getElement(),q,p,C,x,z,D;m.add(E);if(F.theme){F.theme=F.theme.replace(/-/,"");q=h.get(F.theme);E.theme=new q();if(E.theme.init&&F.init_theme){E.theme.init(E,h.urls[F.theme]||m.documentBaseURL.replace(/\/$/,""))}}i(g(F.plugins.replace(/\-/g,"")),function(G){var H=c.get(G),t=c.urls[G]||m.documentBaseURL.replace(/\/$/,""),s;if(H){s=new H(E,t);E.plugins[G]=s;if(s.init){s.init(E,t)}}});if(F.popup_css!==false){if(F.popup_css){F.popup_css=E.documentBaseURI.toAbsolute(F.popup_css)}else{F.popup_css=E.baseURI.toAbsolute("themes/"+F.theme+"/skins/"+F.skin+"/dialog.css")}}if(F.popup_css_add){F.popup_css+=","+E.documentBaseURI.toAbsolute(F.popup_css_add)}E.controlManager=new m.ControlManager(E);if(F.custom_undo_redo){E.onBeforeExecCommand.add(function(t,G,u,H,s){if(G!="Undo"&&G!="Redo"&&G!="mceRepaint"&&(!s||!s.skip_undo)){if(!E.undoManager.hasUndo()){E.undoManager.add()}}});E.onExecCommand.add(function(t,G,u,H,s){if(G!="Undo"&&G!="Redo"&&G!="mceRe
 paint"&&(!s||!s.skip_undo)){E.undoManager.add()}})}E.onExecCommand.add(function(s,t){if(!/^(FontName|FontSize)$/.test(t)){E.nodeChanged()}});if(a){function v(s,t){if(!t||!t.initial){E.execCommand("mceRepaint")}}E.onUndo.add(v);E.onRedo.add(v);E.onSetContent.add(v)}E.onBeforeRenderUI.dispatch(E,E.controlManager);if(F.render_ui){B=F.width||A.style.width||A.offsetWidth;y=F.height||A.style.height||A.offsetHeight;E.orgDisplay=A.style.display;D=/^[0-9\.]+(|px)$/i;if(D.test(""+B)){B=Math.max(parseInt(B)+(q.deltaWidth||0),100)}if(D.test(""+y)){y=Math.max(parseInt(y)+(q.deltaHeight||0),100)}q=E.theme.renderUI({targetNode:A,width:B,height:y,deltaWidth:F.delta_width,deltaHeight:F.delta_height});E.editorContainer=q.editorContainer}if(document.domain&&location.hostname!=document.domain){m.relaxedDomain=document.domain}n.setStyles(q.sizeContainer||q.editorContainer,{width:B,height:y});y=(q.iframeHeight||y)+(typeof(y)=="number"?(q.deltaHeight||0):"");if(y<100){y=100}E.iframeHTML=F.doctype+
 '<html><head xmlns="http://www.w3.org/1999/xhtml">';if(F.document_base_url!=m.documentBaseURL){E.iframeHTML+='<base href="'+E.documentBaseURI.getURI()+'" />'}E.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=7" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';if(m.relaxedDomain){E.iframeHTML+='<script type="text/javascript">document.domain = "'+m.relaxedDomain+'";<\/script>'}x=F.body_id||"tinymce";if(x.indexOf("=")!=-1){x=E.getParam("body_id","","hash");x=x[E.id]||x}z=F.body_class||"";if(z.indexOf("=")!=-1){z=E.getParam("body_class","","hash");z=z[E.id]||""}E.iframeHTML+='</head><body id="'+x+'" class="mceContentBody '+z+'"></body></html>';if(m.relaxedDomain){if(b||(m.isOpera&&parseFloat(opera.version())>=9.5)){C='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+E.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'}else{if(m.isOpera){C='javascript:(f
 unction(){document.open();document.domain="'+document.domain+'";document.close();ed.setupIframe();})()'}}}r=n.add(q.iframeContainer,"iframe",{id:E.id+"_ifr",src:C||'javascript:""',frameBorder:"0",style:{width:"100%",height:y}});E.contentAreaContainer=q.iframeContainer;n.get(q.editorContainer).style.display=E.orgDisplay;n.get(E.id).style.display="none";if(!b||!m.relaxedDomain){E.setupIframe()}A=r=q=null},setupIframe:function(){var z=this,A=z.settings,r=n.get(z.id),u=z.getDoc(),q,x;if(!b||!m.relaxedDomain){u.open();u.write(z.iframeHTML);u.close()}if(!b){try{if(!A.readonly){u.designMode="On"}}catch(v){}}if(b){x=z.getBody();n.hide(x);if(!A.readonly){x.contentEditable=true}n.show(x)}z.dom=new m.dom.DOMUtils(z.getDoc(),{keep_values:true,url_converter:z.convertURL,url_converter_scope:z,hex_colors:A.force_hex_style_colors,class_filter:A.class_filter,update_styles:1,fix_ie_paragraphs:1,valid_styles:A.valid_styles});z.schema=new m.dom.Schema();z.serializer=new m.dom.Serializer(f(A,{va
 lid_elements:A.verify_html===false?"*[*]":A.valid_elements,dom:z.dom,schema:z.schema}));z.selection=new m.dom.Selection(z.dom,z.getWin(),z.serializer);z.formatter=new m.Formatter(this);z.formatter.register({alignleft:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"left"}},{selector:"img,table",styles:{"float":"left"}}],aligncenter:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"center"}},{selector:"img",styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"right"}},{selector:"img,table",styles:{"float":"right"}}],alignfull:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"justify"}}],bold:[{inline:"strong"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b"}],italic:[{inline:"em"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i"}],underline:[{i
 nline:"span",styles:{textDecoration:"underline"},exact:true},{inline:"u"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:true},{inline:"u"}],forecolor:{inline:"span",styles:{color:"%value"}},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"}},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"},removeformat:[{selector:"b,strong,em,i,font,u,strike",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}]});i("p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp".split(/\s/),function(s){z.formatter.register(s,{block:s,remove:"all"})});z.formatter.register(z.settings.formats);z.undoManager
 =new m.UndoManager(z);z.undoManager.onAdd.add(function(t,s){if(!s.initial){return z.onChange.dispatch(z,s,t)}});z.undoManager.onUndo.add(function(t,s){return z.onUndo.dispatch(z,s,t)});z.undoManager.onRedo.add(function(t,s){return z.onRedo.dispatch(z,s,t)});z.forceBlocks=new m.ForceBlocks(z,{forced_root_block:A.forced_root_block});z.editorCommands=new m.EditorCommands(z);z.serializer.onPreProcess.add(function(s,t){return z.onPreProcess.dispatch(z,t,s)});z.serializer.onPostProcess.add(function(s,t){return z.onPostProcess.dispatch(z,t,s)});z.onPreInit.dispatch(z);if(!A.gecko_spellcheck){z.getBody().spellcheck=0}if(!A.readonly){z._addEvents()}z.controlManager.onPostRender.dispatch(z,z.controlManager);z.onPostRender.dispatch(z);if(A.directionality){z.getBody().dir=A.directionality}if(A.nowrap){z.getBody().style.whiteSpace="nowrap"}if(A.custom_elements){function y(s,t){i(g(A.custom_elements),function(B){var C;if(B.indexOf("~")===0){B=B.substring(1);C="span"}else{C="div"}t.content
 =t.content.replace(new RegExp("<("+B+")([^>]*)>","g"),"<"+C+' _mce_name="$1"$2>');t.content=t.content.replace(new RegExp("</("+B+")>","g"),"</"+C+">")})}z.onBeforeSetContent.add(y);z.onPostProcess.add(function(s,t){if(t.set){y(s,t)}})}if(A.handle_node_change_callback){z.onNodeChange.add(function(t,s,B){z.execCallback("handle_node_change_callback",z.id,B,-1,-1,true,z.selection.isCollapsed())})}if(A.save_callback){z.onSaveContent.add(function(s,B){var t=z.execCallback("save_callback",z.id,B.content,z.getBody());if(t){B.content=t}})}if(A.onchange_callback){z.onChange.add(function(t,s){z.execCallback("onchange_callback",z,s)})}if(A.convert_newlines_to_brs){z.onBeforeSetContent.add(function(s,t){if(t.initial){t.content=t.content.replace(/\r?\n/g,"<br />")}})}if(A.fix_nesting&&b){z.onBeforeSetContent.add(function(s,t){t.content=z._fixNesting(t.content)})}if(A.preformatted){z.onPostProcess.add(function(s,t){t.content=t.content.replace(/^\s*<pre.*?>/,"");t.content=t.content.replace(
 /<\/pre>\s*$/,"");if(t.set){t.content='<pre class="mceItemHidden">'+t.content+"</pre>"}})}if(A.verify_css_classes){z.serializer.attribValueFilter=function(D,B){var C,t;if(D=="class"){if(!z.classesRE){t=z.dom.getClasses();if(t.length>0){C="";i(t,function(s){C+=(C?"|":"")+s["class"]});z.classesRE=new RegExp("("+C+")","gi")}}return !z.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(B)||z.classesRE.test(B)?B:""}return B}}if(A.cleanup_callback){z.onBeforeSetContent.add(function(s,t){t.content=z.execCallback("cleanup_callback","insert_to_editor",t.content,t)});z.onPreProcess.add(function(s,t){if(t.set){z.execCallback("cleanup_callback","insert_to_editor_dom",t.node,t)}if(t.get){z.execCallback("cleanup_callback","get_from_editor_dom",t.node,t)}});z.onPostProcess.add(function(s,t){if(t.set){t.content=z.execCallback("cleanup_callback","insert_to_editor",t.content,t)}if(t.get){t.content=z.execCallback("cleanup_callback","get_from_editor",t.content,t)}})}if(A.save_callback){z.onGetC
 ontent.add(function(s,t){if(t.save){t.content=z.execCallback("save_callback",z.id,t.content,z.getBody())}})}if(A.handle_event_callback){z.onEvent.add(function(s,t,B){if(z.execCallback("handle_event_callback",t,s,B)===false){j.cancel(t)}})}z.onSetContent.add(function(){z.addVisual(z.getBody())});if(A.padd_empty_editor){z.onPostProcess.add(function(s,t){t.content=t.content.replace(/^(<p[^>]*>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")})}if(a){function p(s,t){i(s.dom.select("a"),function(C){var B=C.parentNode;if(s.dom.isBlock(B)&&B.lastChild===C){s.dom.add(B,"br",{_mce_bogus:1})}})}z.onExecCommand.add(function(s,t){if(t==="CreateLink"){p(s)}});z.onSetContent.add(z.selection.onSetContent.add(p));if(!A.readonly){try{u.designMode="Off";u.designMode="On"}catch(v){}}}setTimeout(function(){if(z.removed){return}z.load({initial:true,format:(A.cleanup_on_startup?"html":"raw")});z.startContent=z.getContent({format:"raw"});z.initialized=true;z.onInit.dispatch(z);z.execCal
 lback("setupcontent_callback",z.id,z.getBody(),z.getDoc());z.execCallback("init_instance_callback",z);z.focus(true);z.nodeChanged({initial:1});if(A.content_css){m.each(g(A.content_css),function(s){z.dom.loadCSS(z.documentBaseURI.toAbsolute(s))})}if(A.auto_focus){setTimeout(function(){var s=m.get(A.auto_focus);s.selection.select(s.getBody(),1);s.selection.collapse(1);s.getWin().focus()},100)}},1);r=null},focus:function(s){var x,q=this,v=q.settings.content_editable,r,p,u=q.getDoc();if(!s){r=q.selection.getRng();if(r.item){p=r.item(0)}if(!v){q.getWin().focus()}if(p&&p.ownerDocument==u){r=u.body.createControlRange();r.addElement(p);r.select()}}if(m.activeEditor!=q){if((x=m.activeEditor)!=null){x.onDeactivate.dispatch(x,q)}q.onActivate.dispatch(q,x)}m._setActive(q)},execCallback:function(u){var p=this,r=p.settings[u],q;if(!r){return}if(p.callbackLookup&&(q=p.callbackLookup[u])){r=q.func;q=q.scope}if(d(r,"string")){q=r.replace(/\.\w+$/,"");q=q?m.resolve(q):0;r=m.resolve(r);p.callb
 ackLookup=p.callbackLookup||{};p.callbackLookup[u]={func:r,scope:q}}return r.apply(q||p,Array.prototype.slice.call(arguments,1))},translate:function(p){var r=this.settings.language||"en",q=m.i18n;if(!p){return""}return q[r+"."+p]||p.replace(/{\#([^}]+)\}/g,function(t,s){return q[r+"."+s]||"{#"+s+"}"})},getLang:function(q,p){return m.i18n[(this.settings.language||"en")+"."+q]||(d(p)?p:"{#"+q+"}")},getParam:function(u,r,p){var s=m.trim,q=d(this.settings[u])?this.settings[u]:r,t;if(p==="hash"){t={};if(d(q,"string")){i(q.indexOf("=")>0?q.split(/[;,](?![^=;,]*(?:[;,]|$))/):q.split(","),function(x){x=x.split("=");if(x.length>1){t[s(x[0])]=s(x[1])}else{t[s(x[0])]=s(x)}})}else{t=q}return t}return q},nodeChanged:function(r){var p=this,q=p.selection,u=(b?q.getNode():q.getStart())||p.getBody();if(p.initialized){r=r||{};u=b&&u.ownerDocument!=p.getDoc()?p.getBody():u;r.parents=[];p.dom.getParent(u,function(s){if(s.nodeName=="BODY"){return true}r.parents.push(s)});p.onNodeChange.dispatch(
 p,r?r.controlManager||p.controlManager:p.controlManager,u,q.isCollapsed(),r)}},addButton:function(r,q){var p=this;p.buttons=p.buttons||{};p.buttons[r]=q},addCommand:function(r,q,p){this.execCommands[r]={func:q,scope:p||this}},addQueryStateHandler:function(r,q,p){this.queryStateCommands[r]={func:q,scope:p||this}},addQueryValueHandler:function(r,q,p){this.queryValueCommands[r]={func:q,scope:p||this}},addShortcut:function(r,u,p,s){var q=this,v;if(!q.settings.custom_shortcuts){return false}q.shortcuts=q.shortcuts||{};if(d(p,"string")){v=p;p=function(){q.execCommand(v,false,null)}}if(d(p,"object")){v=p;p=function(){q.execCommand(v[0],v[1],v[2])}}i(g(r),function(t){var x={func:p,scope:s||this,desc:u,alt:false,ctrl:false,shift:false};i(g(t,"+"),function(y){switch(y){case"alt":case"ctrl":case"shift":x[y]=true;break;default:x.charCode=y.charCodeAt(0);x.keyCode=y.toUpperCase().charCodeAt(0)}});q.shortcuts[(x.ctrl?"ctrl":"")+","+(x.alt?"alt":"")+","+(x.shift?"shift":"")+","+x.keyCode]=
 x});return true},execCommand:function(x,v,z,p){var r=this,u=0,y,q;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(x)&&(!p||!p.skip_focus)){r.focus()}y={};r.onBeforeExecCommand.dispatch(r,x,v,z,y);if(y.terminate){return false}if(r.execCallback("execcommand_callback",r.id,r.selection.getNode(),x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(y=r.execCommands[x]){q=y.func.call(y.scope,v,z);if(q!==true){r.onExecCommand.dispatch(r,x,v,z,p);return q}}i(r.plugins,function(s){if(s.execCommand&&s.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);u=1;return false}});if(u){return true}if(r.theme&&r.theme.execCommand&&r.theme.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(m.GlobalCommands.execCommand(r,x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(r.editorCommands.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}r.getDoc().execCommand(x,v,z);r.onExecCommand.dispatch(r,x,v,z,p)},
 queryCommandState:function(u){var q=this,v,r;if(q._isHidden()){return}if(v=q.queryStateCommands[u]){r=v.func.call(v.scope);if(r!==true){return r}}v=q.editorCommands.queryCommandState(u);if(v!==-1){return v}try{return this.getDoc().queryCommandState(u)}catch(p){}},queryCommandValue:function(v){var q=this,u,r;if(q._isHidden()){return}if(u=q.queryValueCommands[v]){r=u.func.call(u.scope);if(r!==true){return r}}u=q.editorCommands.queryCommandValue(v);if(d(u)){return u}try{return this.getDoc().queryCommandValue(v)}catch(p){}},show:function(){var p=this;n.show(p.getContainer());n.hide(p.id);p.load()},hide:function(){var p=this,q=p.getDoc();if(b&&q){q.execCommand("SelectAll")}p.save();n.hide(p.getContainer());n.setStyle(p.id,"display",p.orgDisplay)},isHidden:function(){return !n.isHidden(this.id)},setProgressState:function(p,q,r){this.onSetProgressState.dispatch(this,p,q,r);return p},load:function(s){var p=this,r=p.getElement(),q;if(r){s=s||{};s.load=true;q=p.setContent(d(r.value)?r
 .value:r.innerHTML,s);s.element=r;if(!s.no_events){p.onLoadContent.dispatch(p,s)}s.element=r=null;return q}},save:function(u){var p=this,s=p.getElement(),q,r;if(!s||!p.initialized){return}u=u||{};u.save=true;if(!u.no_events){p.undoManager.typing=0;p.undoManager.add()}u.element=s;q=u.content=p.getContent(u);if(!u.no_events){p.onSaveContent.dispatch(p,u)}q=u.content;if(!/TEXTAREA|INPUT/i.test(s.nodeName)){s.innerHTML=q;if(r=n.getParent(p.id,"form")){i(r.elements,function(t){if(t.name==p.id){t.value=q;return false}})}}else{s.value=q}u.element=s=null;return q},setContent:function(q,r){var p=this;r=r||{};r.format=r.format||"html";r.set=true;r.content=q;if(!r.no_events){p.onBeforeSetContent.dispatch(p,r)}if(!m.isIE&&(q.length===0||/^\s+$/.test(q))){r.content=p.dom.setHTML(p.getBody(),'<br _mce_bogus="1" />');r.format="raw"}r.content=p.dom.setHTML(p.getBody(),m.trim(r.content));if(r.format!="raw"&&p.settings.cleanup){r.getInner=true;r.content=p.dom.setHTML(p.getBody(),p.serializer.
 serialize(p.getBody(),r))}if(!r.no_events){p.onSetContent.dispatch(p,r)}return r.content},getContent:function(r){var p=this,q;r=r||{};r.format=r.format||"html";r.get=true;if(!r.no_events){p.onBeforeGetContent.dispatch(p,r)}if(r.format!="raw"&&p.settings.cleanup){r.getInner=true;q=p.serializer.serialize(p.getBody(),r)}else{q=p.getBody().innerHTML}q=q.replace(/^\s*|\s*$/g,"");r.content=q;if(!r.no_events){p.onGetContent.dispatch(p,r)}return r.content},isDirty:function(){var p=this;return m.trim(p.startContent)!=m.trim(p.getContent({format:"raw",no_events:1}))&&!p.isNotDirty},getContainer:function(){var p=this;if(!p.container){p.container=n.get(p.editorContainer||p.id+"_parent")}return p.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return n.get(this.settings.content_element||this.id)},getWin:function(){var p=this,q;if(!p.contentWindow){q=n.get(p.id+"_ifr");if(q){p.contentWindow=q.contentWindow}}return p.contentWindow},getD
 oc:function(){var q=this,p;if(!q.contentDocument){p=q.getWin();if(p){q.contentDocument=p.document}}return q.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(p,x,v){var q=this,r=q.settings;if(r.urlconverter_callback){return q.execCallback("urlconverter_callback",p,v,true,x)}if(!r.convert_urls||(v&&v.nodeName=="LINK")||p.indexOf("file:")===0){return p}if(r.relative_urls){return q.documentBaseURI.toRelative(p)}p=q.documentBaseURI.toAbsolute(p,r.remove_script_host);return p},addVisual:function(r){var p=this,q=p.settings;r=r||p.getBody();if(!d(p.hasVisual)){p.hasVisual=q.visual}i(p.dom.select("table,a",r),function(t){var s;switch(t.nodeName){case"TABLE":s=p.dom.getAttrib(t,"border");if(!s||s=="0"){if(p.hasVisual){p.dom.addClass(t,q.visual_table_class)}else{p.dom.removeClass(t,q.visual_table_class)}}return;case"A":s=p.dom.getAttrib(t,"name");if(s){if(p.hasVisual){p.dom.addClass(t,"mceItemAnchor")}else{p.dom.removeClass(t,"mceItem
 Anchor")}}return}});p.onVisualAid.dispatch(p,r,p.hasVisual)},remove:function(){var p=this,q=p.getContainer();p.removed=1;p.hide();p.execCallback("remove_instance_callback",p);p.onRemove.dispatch(p);p.onExecCommand.listeners=[];m.remove(p);n.remove(q)},destroy:function(q){var p=this;if(p.destroyed){return}if(!q){m.removeUnload(p.destroy);tinyMCE.onBeforeUnload.remove(p._beforeUnload);if(p.theme&&p.theme.destroy){p.theme.destroy()}p.controlManager.destroy();p.selection.destroy();p.dom.destroy();if(!p.settings.content_editable){j.clear(p.getWin());j.clear(p.getDoc())}j.clear(p.getBody());j.clear(p.formElement)}if(p.formElement){p.formElement.submit=p.formElement._mceOldSubmit;p.formElement._mceOldSubmit=null}p.contentAreaContainer=p.formElement=p.container=p.settings.content_element=p.bodyElement=p.contentDocument=p.contentWindow=null;if(p.selection){p.selection=p.selection.win=p.selection.dom=p.selection.dom.doc=null}p.destroyed=1},_addEvents:function(){var v=this,u,y=v.settin
 gs,x={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function r(t,A){var s=t.type;if(v.removed){return}if(v.onEvent.dispatch(v,t,A)!==false){v[x[t.fakeType||t.type]].dispatch(v,t,A)}}i(x,function(t,s){switch(s){case"contextmenu":if(m.isOpera){v.dom.bind(v.getBody(),"mousedown",function(A){if(A.ctrlKey){A.fakeType="contextmenu";r(A)}})}else{v.dom.bind(v.getBody(),s,r)}break;case"paste":v.dom.bind(v.getBody(),s,function(A){r(A)});break;case"submit":case"reset":v.dom.bind(v.getElement().form||n.getParent(v.id,"form"),s,r);break;default:v.dom.bind(y.content_editable?v.getBody():v.getDoc(),s,r)}});v.dom.bind(y.content_editable?v.getBody():(a?v.getDoc():v.getWin()),"focus",function(s){v.focus(true)});if(m.isGecko){v.dom.bind(v.getDoc(),"DOMNodeInserted",function(t){var s;t=t.target;if(t.nodeType===1&&t.nodeName=
 =="IMG"&&(s=t.getAttribute("_mce_src"))){t.src=v.documentBaseURI.toAbsolute(s)}})}if(a){function p(){var B=this,D=B.getDoc(),C=B.settings;if(a&&!C.readonly){if(B._isHidden()){try{if(!C.content_editable){D.designMode="On"}}catch(A){}}try{D.execCommand("styleWithCSS",0,false)}catch(A){if(!B._isHidden()){try{D.execCommand("useCSS",0,true)}catch(A){}}}if(!C.table_inline_editing){try{D.execCommand("enableInlineTableEditing",false,false)}catch(A){}}if(!C.object_resizing){try{D.execCommand("enableObjectResizing",false,false)}catch(A){}}}}v.onBeforeExecCommand.add(p);v.onMouseDown.add(p)}if(m.isWebKit){v.onClick.add(function(s,t){t=t.target;if(t.nodeName=="IMG"||(t.nodeName=="A"&&v.dom.hasClass(t,"mceItemAnchor"))){v.selection.getSel().setBaseAndExtent(t,0,t,1)}})}v.onMouseUp.add(v.nodeChanged);v.onKeyUp.add(function(s,t){var A=t.keyCode;if((A>=33&&A<=36)||(A>=37&&A<=40)||A==13||A==45||A==46||A==8||(m.isMac&&(A==91||A==93))||t.ctrlKey){v.nodeChanged()}});v.onReset.add(function(){v.s
 etContent(v.startContent,{format:"raw"})});if(y.custom_shortcuts){if(y.custom_undo_redo_keyboard_shortcuts){v.addShortcut("ctrl+z",v.getLang("undo_desc"),"Undo");v.addShortcut("ctrl+y",v.getLang("redo_desc"),"Redo")}v.addShortcut("ctrl+b",v.getLang("bold_desc"),"Bold");v.addShortcut("ctrl+i",v.getLang("italic_desc"),"Italic");v.addShortcut("ctrl+u",v.getLang("underline_desc"),"Underline");for(u=1;u<=6;u++){v.addShortcut("ctrl+"+u,"",["FormatBlock",false,"h"+u])}v.addShortcut("ctrl+7","",["FormatBlock",false,"<p>"]);v.addShortcut("ctrl+8","",["FormatBlock",false,"<div>"]);v.addShortcut("ctrl+9","",["FormatBlock",false,"<address>"]);function z(t){var s=null;if(!t.altKey&&!t.ctrlKey&&!t.metaKey){return s}i(v.shortcuts,function(A){if(m.isMac&&A.ctrl!=t.metaKey){return}else{if(!m.isMac&&A.ctrl!=t.ctrlKey){return}}if(A.alt!=t.altKey){return}if(A.shift!=t.shiftKey){return}if(t.keyCode==A.keyCode||(t.charCode&&t.charCode==A.charCode)){s=A;return false}});return s}v.onKeyUp.add(funct
 ion(s,t){var A=z(t);if(A){return j.cancel(t)}});v.onKeyPress.add(function(s,t){var A=z(t);if(A){return j.cancel(t)}});v.onKeyDown.add(function(s,t){var A=z(t);if(A){A.func.call(A.scope);return j.cancel(t)}})}if(m.isIE){v.dom.bind(v.getDoc(),"controlselect",function(A){var t=v.resizeInfo,s;A=A.target;if(A.nodeName!=="IMG"){return}if(t){v.dom.unbind(t.node,t.ev,t.cb)}if(!v.dom.hasClass(A,"mceItemNoResize")){ev="resizeend";s=v.dom.bind(A,ev,function(C){var B;C=C.target;if(B=v.dom.getStyle(C,"width")){v.dom.setAttrib(C,"width",B.replace(/[^0-9%]+/g,""));v.dom.setStyle(C,"width","")}if(B=v.dom.getStyle(C,"height")){v.dom.setAttrib(C,"height",B.replace(/[^0-9%]+/g,""));v.dom.setStyle(C,"height","")}})}else{ev="resizestart";s=v.dom.bind(A,"resizestart",j.cancel,j)}t=v.resizeInfo={node:A,ev:ev,cb:s}});v.onKeyDown.add(function(s,t){switch(t.keyCode){case 8:if(v.selection.getRng().item){s.dom.remove(v.selection.getRng().item(0));return j.cancel(t)}}})}if(m.isOpera){v.onClick.add(funct
 ion(s,t){j.prevent(t)})}if(y.custom_undo_redo){function q(){v.undoManager.typing=0;v.undoManager.add()}v.dom.bind(v.getDoc(),"focusout",function(s){if(!v.removed&&v.undoManager.typing){q()}});v.onKeyUp.add(function(s,t){if((t.keyCode>=33&&t.keyCode<=36)||(t.keyCode>=37&&t.keyCode<=40)||t.keyCode==13||t.keyCode==45||t.ctrlKey){q()}});v.onKeyDown.add(function(t,D){var s,C,B;if(b&&D.keyCode==46){s=v.selection.getRng();if(s.parentElement){C=s.parentElement();if(D.ctrlKey){s.moveEnd("word",1);s.select()}v.selection.getSel().clear();if(s.parentElement()==C){B=v.selection.getBookmark();try{C.innerHTML=C.innerHTML}catch(A){}v.selection.moveToBookmark(B)}D.preventDefault();return}}if((D.keyCode>=33&&D.keyCode<=36)||(D.keyCode>=37&&D.keyCode<=40)||D.keyCode==13||D.keyCode==45){if(v.undoManager.typing){q()}return}if(!v.undoManager.typing){v.undoManager.add();v.undoManager.typing=1}});v.onMouseDown.add(function(){if(v.undoManager.typing){q()}})}},_isHidden:function(){var p;if(!a){return
  0}p=this.selection.getSel();return(!p||!p.rangeCount||p.rangeCount==0)},_fixNesting:function(q){var r=[],p;q=q.replace(/<(\/)?([^\s>]+)[^>]*?>/g,function(t,s,v){var u;if(s==="/"){if(!r.length){return""}if(v!==r[r.length-1].tag){for(p=r.length-1;p>=0;p--){if(r[p].tag===v){r[p].close=1;break}}return""}else{r.pop();if(r.length&&r[r.length-1].close){t=t+"</"+r[r.length-1].tag+">";r.pop()}}}else{if(/^(br|hr|input|meta|img|link|param)$/i.test(v)){return t}if(/\/>$/.test(t)){return t}r.push({tag:v})}return t});for(p=r.length-1;p>=0;p--){q+="</"+r[p].tag+">"}return q}})})(tinymce);(function(c){var d=c.each,e,a=true,b=false;c.EditorCommands=function(n){var l=n.dom,p=n.selection,j={state:{},exec:{},value:{}},k=n.settings,o;function q(y,x,v){var u;y=y.toLowerCase();if(u=j.exec[y]){u(y,x,v);return a}return b}function m(v){var u;v=v.toLowerCase();if(u=j.state[v]){return u(v)}return -1}function h(v){var u;v=v.toLowerCase();if(u=j.value[v]){return u(v)}return b}function t(u,v){v=v||"exec"
 ;d(u,function(y,x){d(x.toLowerCase().split(","),function(z){j[v][z]=y})})}c.extend(this,{execCommand:q,queryCommandState:m,queryCommandValue:h,addCommands:t});function f(x,v,u){if(v===e){v=b}if(u===e){u=null}return n.getDoc().execCommand(x,v,u)}function s(u){return n.formatter.match(u)}function r(u,v){n.formatter.toggle(u,v?{value:v}:e)}function i(u){o=p.getBookmark(u)}function g(){p.moveToBookmark(o)}t({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(y){var x=n.getDoc(),u;try{f(y)}catch(v){u=a}if(u||!x.queryCommandSupported(y)){if(c.isGecko){n.windowManager.confirm(n.getLang("clipboard_msg"),function(z){if(z){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{n.windowManager.alert(n.getLang("clipboard_no_support"))}}},unlink:function(u){if(p.isCollapsed()){p.select(p.getNode())}f(u);p.collapse(b)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFul
 l":function(u){var v=u.substring(7);d("left,center,right,full".split(","),function(x){if(v!=x){n.formatter.remove("align"+x)}});r("align"+v)},"InsertUnorderedList,InsertOrderedList":function(x){var u,v;f(x);u=l.getParent(p.getNode(),"ol,ul");if(u){v=u.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(v.nodeName)){i();l.split(v,u);g()}}},"Bold,Italic,Underline,Strikethrough":function(u){r(u)},"ForeColor,HiliteColor,FontName":function(x,v,u){r(x,u)},FontSize:function(y,x,v){var u,z;if(v>=1&&v<=7){z=c.explode(k.font_size_style_values);u=c.explode(k.font_size_classes);if(u){v=u[v-1]||v}else{v=z[v-1]||v}}r(y,v)},RemoveFormat:function(u){n.formatter.remove(u)},mceBlockQuote:function(u){r("blockquote")},FormatBlock:function(x,v,u){return r(u||"p")},mceCleanup:function(){var u=p.getBookmark();n.setContent(n.getContent({cleanup:a}),{cleanup:a});p.moveToBookmark(u)},mceRemoveNode:function(y,x,v){var u=v||p.getNode();if(u!=n.getBody()){i();n.dom.remove(u,a);g()}},mceSelectNodeDepth:functio
 n(y,x,v){var u=0;l.getParent(p.getNode(),function(z){if(z.nodeType==1&&u++==v){p.select(z);return b}},n.getBody())},mceSelectNode:function(x,v,u){p.select(u)},mceInsertContent:function(x,v,u){p.setContent(u)},mceInsertRawHTML:function(x,v,u){p.setContent("tiny_mce_marker");n.setContent(n.getContent().replace(/tiny_mce_marker/g,function(){return u}))},mceSetContent:function(x,v,u){n.setContent(u)},"Indent,Outdent":function(y){var v,u,x;v=k.indentation;u=/[a-z%]+$/i.exec(v);v=parseInt(v);if(!m("InsertUnorderedList")&&!m("InsertOrderedList")){d(p.getSelectedBlocks(),function(z){if(y=="outdent"){x=Math.max(0,parseInt(z.style.paddingLeft||0)-v);l.setStyle(z,"paddingLeft",x?x+u:"")}else{l.setStyle(z,"paddingLeft",(parseInt(z.style.paddingLeft||0)+v)+u)}})}else{f(y)}},mceRepaint:function(){var v;if(c.isGecko){try{i(a);if(p.getSel()){p.getSel().selectAllChildren(n.getBody())}p.collapse(a);g()}catch(u){}}},mceToggleFormat:function(x,v,u){n.formatter.toggle(u)},InsertHorizontalRule:fu
 nction(){p.setContent("<hr />")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual;n.addVisual()},mceReplaceContent:function(x,v,u){p.setContent(u.replace(/\{\$selection\}/g,p.getContent({format:"text"})))},mceInsertLink:function(y,x,v){var u=l.getParent(p.getNode(),"a");if(c.is(v,"string")){v={href:v}}if(!u){f("CreateLink",b,"javascript:mctmp(0);");d(l.select("a[href=javascript:mctmp(0);]"),function(z){l.setAttribs(z,v)})}else{if(v.href){l.setAttribs(u,v)}else{n.dom.remove(u,a)}}},selectAll:function(){var v=l.getRoot(),u=l.createRng();u.setStart(v,0);u.setEnd(v,v.childNodes.length);n.selection.setRng(u)}});t({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(u){return s("align"+u.substring(7))},"Bold,Italic,Underline,Strikethrough":function(u){return s(u)},mceBlockQuote:function(){return s("blockquote")},Outdent:function(){var u;if(k.inline_styles){if((u=l.getParent(p.getStart(),l.isBlock))&&parseInt(u.style.paddingLeft)>0){return a}if((u=l.getParent(p.getE
 nd(),l.isBlock))&&parseInt(u.style.paddingLeft)>0){return a}}return m("InsertUnorderedList")||m("InsertOrderedList")||(!k.inline_styles&&!!l.getParent(p.getNode(),"BLOCKQUOTE"))},"InsertUnorderedList,InsertOrderedList":function(u){return l.getParent(p.getNode(),u=="insertunorderedlist"?"UL":"OL")}},"state");t({"FontSize,FontName":function(x){var v=0,u;if(u=l.getParent(p.getNode(),"span")){if(x=="fontsize"){v=u.style.fontSize}else{v=u.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return v}},"value");if(k.custom_undo_redo){t({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}}})(tinymce);(function(b){var a=b.util.Dispatcher;b.UndoManager=function(e){var c,d=0,g=[];function f(){return b.trim(e.getContent({format:"raw",no_events:1}))}return c={typing:0,onAdd:new a(c),onUndo:new a(c),onRedo:new a(c),add:function(l){var h,j=e.settings,k;l=l||{};l.content=f();k=g[d];if(k&&k.content==l.content){if(d>0||g.length==1){return null}}
 if(j.custom_undo_redo_levels){if(g.length>j.custom_undo_redo_levels){for(h=0;h<g.length-1;h++){g[h]=g[h+1]}g.length--;d=g.length}}l.bookmark=e.selection.getBookmark(2,true);if(d<g.length-1){if(d==0){g=[]}else{g.length=d+1}}g.push(l);d=g.length-1;c.onAdd.dispatch(c,l);e.isNotDirty=0;return l},undo:function(){var j,h;if(c.typing){c.add();c.typing=0}if(d>0){j=g[--d];e.setContent(j.content,{format:"raw"});e.selection.moveToBookmark(j.bookmark);c.onUndo.dispatch(c,j)}return j},redo:function(){var h;if(d<g.length-1){h=g[++d];e.setContent(h.content,{format:"raw"});e.selection.moveToBookmark(h.bookmark);c.onRedo.dispatch(c,h)}return h},clear:function(){g=[];d=c.typing=0},hasUndo:function(){return d>0||c.typing},hasRedo:function(){return d<g.length-1}}}})(tinymce);(function(m){var k=m.dom.Event,c=m.isIE,a=m.isGecko,b=m.isOpera,j=m.each,i=m.extend,d=true,h=false;function l(p){var q,o,n;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(p.nodeName)){if(q){o=p.cloneNode(false);o.appendCh
 ild(q);q=o}else{q=n=p.cloneNode(false)}q.removeAttribute("id")}}while(p=p.parentNode);if(q){return{wrapper:q,inner:n}}}function g(o,p){var n=p.ownerDocument.createRange();n.setStart(o.endContainer,o.endOffset);n.setEndAfter(p);return n.cloneContents().textContent.length==0}function f(o){o=o.innerHTML;o=o.replace(/<(img|hr|table|input|select|textarea)[ \>]/gi,"-");o=o.replace(/<[^>]+>/g,"");return o.replace(/[ \u00a0\t\r\n]+/g,"")==""}function e(p,r,n){var o,q;if(f(n)){o=r.getParent(n,"ul,ol");if(!r.getParent(o.parentNode,"ul,ol")){r.split(o,n);q=r.create("p",0,'<br _mce_bogus="1" />');r.replace(q,n);p.select(q,1)}return h}return d}m.create("tinymce.ForceBlocks",{ForceBlocks:function(o){var p=this,q=o.settings,r;p.editor=o;p.dom=o.dom;r=(q.forced_root_block||"p").toLowerCase();q.element=r.toUpperCase();o.onPreInit.add(p.setup,p);p.reOpera=new RegExp("(\\u00a0| | )</"+r+">","gi");p.rePadd=new RegExp("<p( )([^>]+)><\\/p>|<p( )([^>]+)\\/>|<p( )([^>]+)>\\s+<\\/p>|<p><\\
 /p>|<p\\/>|<p>\\s+<\\/p>".replace(/p/g,r),"gi");p.reNbsp2BR1=new RegExp("<p( )([^>]+)>[\\s\\u00a0]+<\\/p>|<p>[\\s\\u00a0]+<\\/p>".replace(/p/g,r),"gi");p.reNbsp2BR2=new RegExp("<%p()([^>]+)>( | )<\\/%p>|<%p>( | )<\\/%p>".replace(/%p/g,r),"gi");p.reBR2Nbsp=new RegExp("<p( )([^>]+)>\\s*<br \\/>\\s*<\\/p>|<p>\\s*<br \\/>\\s*<\\/p>".replace(/p/g,r),"gi");function n(s,t){if(b){t.content=t.content.replace(p.reOpera,"</"+r+">")}t.content=t.content.replace(p.rePadd,"<"+r+"$1$2$3$4$5$6>\u00a0</"+r+">");if(!c&&!b&&t.set){t.content=t.content.replace(p.reNbsp2BR1,"<"+r+"$1$2><br /></"+r+">");t.content=t.content.replace(p.reNbsp2BR2,"<"+r+"$1$2><br /></"+r+">")}else{t.content=t.content.replace(p.reBR2Nbsp,"<"+r+"$1$2>\u00a0</"+r+">")}}o.onBeforeSetContent.add(n);o.onPostProcess.add(n);if(q.forced_root_block){o.onInit.add(p.forceRoots,p);o.onSetContent.add(p.forceRoots,p);o.onBeforeGetContent.add(p.forceRoots,p)}},setup:function(){var o=this,n=o.editor,q=n.settings,u=n
 .dom,p=n.selection;if(q.forced_root_block){n.onBeforeExecCommand.add(o.forceRoots,o);n.onKeyUp.add(o.forceRoots,o);n.onPreProcess.add(o.forceRoots,o)}if(q.force_br_newlines){if(c){n.onKeyPress.add(function(s,t){var v;if(t.keyCode==13&&p.getNode().nodeName!="LI"){p.setContent('<br id="__" /> ',{format:"raw"});v=u.get("__");v.removeAttribute("id");p.select(v);p.collapse();return k.cancel(t)}})}}if(q.force_p_newlines){if(!c){n.onKeyPress.add(function(s,t){if(t.keyCode==13&&!t.shiftKey&&!o.insertPara(t)){k.cancel(t)}})}else{m.addUnload(function(){o._previousFormats=0});n.onKeyPress.add(function(s,t){o._previousFormats=0;if(t.keyCode==13&&!t.shiftKey&&s.selection.isCollapsed()&&q.keep_styles){o._previousFormats=l(s.selection.getStart())}});n.onKeyUp.add(function(t,x){if(x.keyCode==13&&!x.shiftKey){var v=t.selection.getStart(),s=o._previousFormats;if(!v.hasChildNodes()&&s){v=u.getParent(v,u.isBlock);if(v&&v.nodeName!="LI"){v.innerHTML="";if(o._previousFormats){v.appendChild(s.wrap
 per);s.inner.innerHTML="\uFEFF"}else{v.innerHTML="\uFEFF"}p.select(v,1);t.getDoc().execCommand("Delete",false,null);o._previousFormats=0}}}})}if(a){n.onKeyDown.add(function(s,t){if((t.keyCode==8||t.keyCode==46)&&!t.shiftKey){o.backspaceDelete(t,t.keyCode==8)}})}}if(m.isWebKit){function r(t){var s=p.getRng(),v,z=u.create("div",null," "),y,x=u.getViewPort(t.getWin()).h;s.insertNode(v=u.create("br"));s.setStartAfter(v);s.setEndAfter(v);p.setRng(s);if(p.getSel().focusNode==v.previousSibling){p.select(u.insertAfter(u.doc.createTextNode("\u00a0"),v));p.collapse(d)}u.insertAfter(z,v);y=u.getPos(z).y;u.remove(z);if(y>x){t.getWin().scrollTo(0,y)}}n.onKeyPress.add(function(s,t){if(t.keyCode==13&&(t.shiftKey||(q.force_br_newlines&&!u.getParent(p.getNode(),"h1,h2,h3,h4,h5,h6,ol,ul")))){r(s);k.cancel(t)}})}n.onPreProcess.add(function(s,t){j(u.select("p,h1,h2,h3,h4,h5,h6,div",t.node),function(v){if(f(v)){j(u.select("span,em,strong,b,i",t.node),function(x){if(!x.hasChildNodes()){x.appendCh
 ild(s.getDoc().createTextNode("\u00a0"));return h}})}})});if(c){if(q.element!="P"){n.onKeyPress.add(function(s,t){o.lastElm=p.getNode().nodeName});n.onKeyUp.add(function(t,v){var y,x=p.getNode(),s=t.getBody();if(s.childNodes.length===1&&x.nodeName=="P"){x=u.rename(x,q.element);p.select(x);p.collapse();t.nodeChanged()}else{if(v.keyCode==13&&!v.shiftKey&&o.lastElm!="P"){y=u.getParent(x,"p");if(y){u.rename(y,q.element);t.nodeChanged()}}}})}}},find:function(v,q,r){var p=this.editor,o=p.getDoc().createTreeWalker(v,4,null,h),u=-1;while(v=o.nextNode()){u++;if(q==0&&v==r){return u}if(q==1&&u==r){return v}}return -1},forceRoots:function(x,I){var z=this,x=z.editor,M=x.getBody(),J=x.getDoc(),P=x.selection,A=P.getSel(),B=P.getRng(),N=-2,v,G,o,p,K=-16777215;var L,q,O,F,C,u=M.childNodes,E,D,y;for(E=u.length-1;E>=0;E--){L=u[E];if(L.nodeType===1&&L.getAttribute("_mce_type")){q=null;continue}if(L.nodeType===3||(!z.dom.isBlock(L)&&L.nodeType!==8&&!/^(script|mce:script|style|mce:style)$/i.test
 (L.nodeName))){if(!q){if(L.nodeType!=3||/[^\s]/g.test(L.nodeValue)){if(N==-2&&B){if(!c){if(B.startContainer.nodeType==1&&(D=B.startContainer.childNodes[B.startOffset])&&D.nodeType==1){y=D.getAttribute("id");D.setAttribute("id","__mce")}else{if(x.dom.getParent(B.startContainer,function(n){return n===M})){G=B.startOffset;o=B.endOffset;N=z.find(M,0,B.startContainer);v=z.find(M,0,B.endContainer)}}}else{if(B.item){p=J.body.createTextRange();p.moveToElementText(B.item(0));B=p}p=J.body.createTextRange();p.moveToElementText(M);p.collapse(1);O=p.move("character",K)*-1;p=B.duplicate();p.collapse(1);F=p.move("character",K)*-1;p=B.duplicate();p.collapse(0);C=(p.move("character",K)*-1)-F;N=F-O;v=C}}q=x.dom.create(x.settings.forced_root_block);L.parentNode.replaceChild(q,L);q.appendChild(L)}}else{if(q.hasChildNodes()){q.insertBefore(L,q.firstChild)}else{q.appendChild(L)}}}else{q=null}}if(N!=-2){if(!c){q=M.getElementsByTagName(x.settings.element)[0];B=J.createRange();if(N!=-1){B.setStart(z
 .find(M,1,N),G)}else{B.setStart(q,0)}if(v!=-1){B.setEnd(z.find(M,1,v),o)}else{B.setEnd(q,0)}if(A){A.removeAllRanges();A.addRange(B)}}else{try{B=A.createRange();B.moveToElementText(M);B.collapse(1);B.moveStart("character",N);B.moveEnd("character",v);B.select()}catch(H){}}}else{if(!c&&(D=x.dom.get("__mce"))){if(y){D.setAttribute("id",y)}else{D.removeAttribute("id")}B=J.createRange();B.setStartBefore(D);B.setEndBefore(D);P.setRng(B)}}},getParentBlock:function(p){var o=this.dom;return o.getParent(p,o.isBlock)},insertPara:function(S){var G=this,x=G.editor,O=x.dom,T=x.getDoc(),X=x.settings,H=x.selection.getSel(),I=H.getRangeAt(0),W=T.body;var L,M,J,Q,P,u,p,v,A,o,E,V,q,z,K,N=O.getViewPort(x.getWin()),D,F,C;L=T.createRange();L.setStart(H.anchorNode,H.anchorOffset);L.collapse(d);M=T.createRange();M.setStart(H.focusNode,H.focusOffset);M.collapse(d);J=L.compareBoundaryPoints(L.START_TO_END,M)<0;Q=J?H.anchorNode:H.focusNode;P=J?H.anchorOffset:H.focusOffset;u=J?H.focusNode:H.anchorNode;p
 =J?H.focusOffset:H.anchorOffset;if(Q===u&&/^(TD|TH)$/.test(Q.nodeName)){if(Q.firstChild.nodeName=="BR"){O.remove(Q.firstChild)}if(Q.childNodes.length==0){x.dom.add(Q,X.element,null,"<br />");V=x.dom.add(Q,X.element,null,"<br />")}else{K=Q.innerHTML;Q.innerHTML="";x.dom.add(Q,X.element,null,K);V=x.dom.add(Q,X.element,null,"<br />")}I=T.createRange();I.selectNodeContents(V);I.collapse(1);x.selection.setRng(I);return h}if(Q==W&&u==W&&W.firstChild&&x.dom.isBlock(W.firstChild)){Q=u=Q.firstChild;P=p=0;L=T.createRange();L.setStart(Q,0);M=T.createRange();M.setStart(u,0)}Q=Q.nodeName=="HTML"?T.body:Q;Q=Q.nodeName=="BODY"?Q.firstChild:Q;u=u.nodeName=="HTML"?T.body:u;u=u.nodeName=="BODY"?u.firstChild:u;v=G.getParentBlock(Q);A=G.getParentBlock(u);o=v?v.nodeName:X.element;if(K=G.dom.getParent(v,"li,pre")){if(K.nodeName=="LI"){return e(x.selection,G.dom,K)}return d}if(v&&(v.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(O.getStyle(v,"position",1)))){o=X.element;v=null}if(A&&(A.node
 Name=="CAPTION"||/absolute|relative|fixed/gi.test(O.getStyle(v,"position",1)))){o=X.element;A=null}if(/(TD|TABLE|TH|CAPTION)/.test(o)||(v&&o=="DIV"&&/left|right/gi.test(O.getStyle(v,"float",1)))){o=X.element;v=A=null}E=(v&&v.nodeName==o)?v.cloneNode(0):x.dom.create(o);V=(A&&A.nodeName==o)?A.cloneNode(0):x.dom.create(o);V.removeAttribute("id");if(/^(H[1-6])$/.test(o)&&g(I,v)){V=x.dom.create(X.element)}K=q=Q;do{if(K==W||K.nodeType==9||G.dom.isBlock(K)||/(TD|TABLE|TH|CAPTION)/.test(K.nodeName)){break}q=K}while((K=K.previousSibling?K.previousSibling:K.parentNode));K=z=u;do{if(K==W||K.nodeType==9||G.dom.isBlock(K)||/(TD|TABLE|TH|CAPTION)/.test(K.nodeName)){break}z=K}while((K=K.nextSibling?K.nextSibling:K.parentNode));if(q.nodeName==o){L.setStart(q,0)}else{L.setStartBefore(q)}L.setEnd(Q,P);E.appendChild(L.cloneContents()||T.createTextNode(""));try{M.setEndAfter(z)}catch(R){}M.setStart(u,p);V.appendChild(M.cloneContents()||T.createTextNode(""));I=T.createRange();if(!q.previousSibli
 ng&&q.parentNode.nodeName==o){I.setStartBefore(q.parentNode)}else{if(L.startContainer.nodeName==o&&L.startOffset==0){I.setStartBefore(L.startContainer)}else{I.setStart(L.startContainer,L.startOffset)}}if(!z.nextSibling&&z.parentNode.nodeName==o){I.setEndAfter(z.parentNode)}else{I.setEnd(M.endContainer,M.endOffset)}I.deleteContents();if(b){x.getWin().scrollTo(0,N.y)}if(E.firstChild&&E.firstChild.nodeName==o){E.innerHTML=E.firstChild.innerHTML}if(V.firstChild&&V.firstChild.nodeName==o){V.innerHTML=V.firstChild.innerHTML}if(f(E)){E.innerHTML="<br />"}function U(y,s){var r=[],Z,Y,t;y.innerHTML="";if(X.keep_styles){Y=s;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(Y.nodeName)){Z=Y.cloneNode(h);O.setAttrib(Z,"id","");r.push(Z)}}while(Y=Y.parentNode)}if(r.length>0){for(t=r.length-1,Z=y;t>=0;t--){Z=Z.appendChild(r[t])}r[0].innerHTML=b?" ":"<br />";return r[0]}else{y.innerHTML=b?" ":"<br />"}}if(f(V)){C=U(V,u)}if(b&&parseFloat(opera.version())<9.5){I.insertNode(E);I.ins
 ertNode(V)}else{I.insertNode(V);I.insertNode(E)}V.normalize();E.normalize();function B(r){return T.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,h).nextNode()||r}I=T.createRange();I.selectNodeContents(a?B(C||V):C||V);I.collapse(1);H.removeAllRanges();H.addRange(I);D=x.dom.getPos(V).y;F=V.clientHeight;if(D<N.y||D+F>N.y+N.h){x.getWin().scrollTo(0,D<N.y?D:D-N.h+25)}return h},backspaceDelete:function(v,C){var D=this,u=D.editor,z=u.getBody(),s=u.dom,q,x=u.selection,p=x.getRng(),y=p.startContainer,q,A,B,o;if(!C&&p.collapsed&&y.nodeType==1&&p.startOffset==y.childNodes.length){o=new m.dom.TreeWalker(y.lastChild,y);for(q=y.lastChild;q;q=o.prev()){if(q.nodeType==3){p.setStart(q,q.nodeValue.length);p.collapse(true);x.setRng(p);return}}}if(y&&u.dom.isBlock(y)&&!/^(TD|TH)$/.test(y.nodeName)&&C){if(y.childNodes.length==0||(y.childNodes.length==1&&y.firstChild.nodeName=="BR")){q=y;while((q=q.previousSibling)&&!u.dom.isBlock(q)){}if(q){if(y!=z.firstChild){A=u.dom.doc.createTreeWalker(q,NodeF
 ilter.SHOW_TEXT,null,h);while(B=A.nextNode()){q=B}p=u.getDoc().createRange();p.setStart(q,q.nodeValue?q.nodeValue.length:0);p.setEnd(q,q.nodeValue?q.nodeValue.length:0);x.setRng(p);u.dom.remove(y)}return k.cancel(v)}}}}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(i){var h,g=this,f=g.editor;d(f.plugins,function(j){if(j.createC
 ontrol){h=j.createControl(i,g);if(h){return false}}});switch(i){case"|":case"separator":return g.createSeparator()}if(!h&&f.buttons&&(h=f.buttons[i])){return g.createButton(i,h)}return g.add(h)},createDropMenu:function(f,n,h){var m=this,i=m.editor,j,g,k,l;n=e({"class":"mceDropDown",constrain:i.settings.constrain_menus},n);n["class"]=n["class"]+" "+i.getParam("skin")+"Skin";if(k=i.getParam("skin_variant")){n["class"]+=" "+i.getParam("skin")+"Skin"+k.substring(0,1).toUpperCase()+k.substring(1)}f=m.prefix+f;l=h||m._cls.dropmenu||c.ui.DropMenu;j=m.controls[f]=new l(f,n);j.onAddItem.add(function(r,q){var p=q.settings;p.title=i.getLang(p.title,p.title);if(!p.onclick){p.onclick=function(o){if(p.cmd){i.execCommand(p.cmd,p.ui||false,p.value)}}}});i.onRemove.add(function(){j.destroy()});if(c.isIE){j.onShowMenu.add(function(){i.focus();g=i.selection.getBookmark(1)});j.onHideMenu.add(function(){if(g){i.selection.moveToBookmark(g);g=0}})}return m.add(j)},createListBox:function(m,i,l){var
  h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;if(g.settings.use_native_selects){k=new c.ui.NativeListBox(m,i)}else{f=l||h._cls.listbox||c.ui.ListBox;k=new f(m,i)}h.controls[m]=k;if(c.isWebKit){k.onPostRender.add(function(p,o){a.add(o,"mousedown",function(){g.bookmark=g.selection.getBookmark(1)});a.add(o,"focus",function(){g.selection.moveToBookmark(g.bookmark);g.bookmark=null})})}if(k.hideMenu){g.onMouseDown.add(k.hideMenu,k)}return h.add(k)},createButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.label=g.translate(i.label);i.scope=i.scope||g;if(!i.onclick&&!i.menu_button){i.onclick=function(){g.execCommand(i.cmd,i.ui||false,i.value)}}i=e({title:i.title,"class":"mce_"+m,unavailable_prefix:g.getLang("un
 available",""),scope:i.scope,control_manager:h},i);m=h.prefix+m;if(i.menu_button){f=l||h._cls.menubutton||c.ui.MenuButton;k=new f(m,i);g.onMouseDown.add(k.hideMenu,k)}else{f=h._cls.button||c.ui.Button;k=new f(m,i)}return h.add(k)},createMenuButton:function(h,f,g){f=f||{};f.menu_button=1;return this.createButton(h,f,g)},createSplitButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onclick){i.onclick=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;f=l||h._cls.splitbutton||c.ui.SplitButton;k=h.add(new f(m,i));g.onMouseDown.add(k.hideMenu,k);return k},createColorSplitButton:function(f,n,h){var l=this,j=l.editor,i,k,m,g;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onclick){n.onclick=function(o)
 {if(c.isIE){g=j.selection.getBookmark(1)}j.execCommand(n.cmd,n.ui||false,o||n.value)}}if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,menu_class:j.getParam("skin")+"Skin",scope:n.scope,more_colors_title:j.getLang("more_colors")},n);f=l.prefix+f;m=h||l._cls.colorsplitbutton||c.ui.ColorSplitButton;k=new m(f,n);j.onMouseDown.add(k.hideMenu,k);j.onRemove.add(function(){k.destroy()});if(c.isIE){k.onShowMenu.add(function(){j.focus();g=j.selection.getBookmark(1)});k.onHideMenu.add(function(){if(g){j.selection.moveToBookmark(g);g=0}})}return l.add(k)},createToolbar:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||g._cls.toolbar||c.ui.Toolbar;i=new f(k,h);if(g.get(k)){return null}return g.add(i)},createSeparator:function(g){var f=g||this._cls.separator||c.ui.Separator;return new f()},setControlType:function(g,f){return this._cls[g.toLowerCase()]=f},destroy:function(){d(this.controls,function(f){f.destroy()});this
 .controls=null}})})(tinymce);(function(d){var a=d.util.Dispatcher,e=d.each,c=d.isIE,b=d.isOpera;d.create("tinymce.WindowManager",{WindowManager:function(f){var g=this;g.editor=f;g.onOpen=new a(g);g.onClose=new a(g);g.params={};g.features={}},open:function(z,h){var v=this,k="",n,m,i=v.editor.settings.dialog_type=="modal",q,o,j,g=d.DOM.getViewPort(),r;z=z||{};h=h||{};o=b?g.w:screen.width;j=b?g.h:screen.height;z.name=z.name||"mc_"+new Date().getTime();z.width=parseInt(z.width||320);z.height=parseInt(z.height||240);z.resizable=true;z.left=z.left||parseInt(o/2)-(z.width/2);z.top=z.top||parseInt(j/2)-(z.height/2);h.inline=false;h.mce_width=z.width;h.mce_height=z.height;h.mce_auto_focus=z.auto_focus;if(i){if(c){z.center=true;z.help=false;z.dialogWidth=z.width+"px";z.dialogHeight=z.height+"px";z.scroll=z.scrollbars||false}}e(z,function(p,f){if(d.is(p,"boolean")){p=p?"yes":"no"}if(!/^(name|url)$/.test(f)){if(c&&i){k+=(k?";":"")+f+":"+p}else{k+=(k?",":"")+f+"="+p}}});v.features=z;v.pa
 rams=h;v.onOpen.dispatch(v,z,h);r=z.url||z.file;r=d._addVer(r);try{if(c&&i){q=1;window.showModalDialog(r,window,k)}else{q=window.open(r,z.name,k)}}catch(l){}if(!q){alert(v.editor.getLang("popup_blocked"))}},close:function(f){f.close();this.onClose.dispatch(this)},createInstance:function(i,h,g,m,l,k){var j=d.resolve(i);return new j(h,g,m,l,k)},confirm:function(h,f,i,g){g=g||window;f.call(i||this,g.confirm(this._decode(this.editor.getLang(h,h))))},alert:function(h,f,j,g){var i=this;g=g||window;g.alert(i._decode(i.editor.getLang(h,h)));if(f){f.call(j||i)}},resizeBy:function(f,g,h){h.resizeBy(f,g)},_decode:function(f){return d.DOM.decode(f).replace(/\\n/g,"\n")}})}(tinymce));(function(a){function b(){var d={},c={},e={};function f(j,i,h,g){if(typeof(i)=="string"){i=[i]}a.each(i,function(k){j[k.toLowerCase()]={func:h,scope:g}})}a.extend(this,{add:function(i,h,g){f(d,i,h,g)},addQueryStateHandler:function(i,h,g){f(c,i,h,g)},addQueryValueHandler:function(i,h,g){f(e,i,h,g)},execComman
 d:function(h,k,j,i,g){if(k=d[k.toLowerCase()]){if(k.func.call(h||k.scope,j,i,g)!==false){return true}}},queryCommandValue:function(){if(cmd=e[cmd.toLowerCase()]){return cmd.func.call(scope||cmd.scope,ui,value,args)}},queryCommandState:function(){if(cmd=c[cmd.toLowerCase()]){return cmd.func.call(scope||cmd.scope,ui,value,args)}}})}a.GlobalCommands=new b()})(tinymce);(function(a){a.Formatter=function(T){var K={},M=a.each,c=T.dom,p=T.selection,s=a.dom.TreeWalker,I=new a.dom.RangeUtils(c),d=T.schema.isValid,E=c.isBlock,k=T.settings.forced_root_block,r=c.nodeIndex,D="\uFEFF",e=/^(src|href|style)$/,Q=false,A=true,o,N={apply:[],remove:[]};function y(U){return U instanceof Array}function l(V,U){return c.getParents(V,U,c.getRoot())}function b(U){return U.nodeType===1&&(U.face==="mceinline"||U.style.fontFamily==="mceinline")}function P(U){return U?K[U]:K}function j(U,V){if(U){if(typeof(U)!=="string"){M(U,function(X,W){j(W,X)})}else{V=V.length?V:[V];M(V,function(W){if(W.deep===o){W.dee
 p=!W.selector}if(W.split===o){W.split=!W.selector||W.inline}if(W.remove===o&&W.selector&&!W.inline){W.remove="none"}if(W.selector&&W.inline){W.mixed=true;W.block_expand=true}if(typeof(W.classes)==="string"){W.classes=W.classes.split(/\s+/)}});K[U]=V}}}function R(W,ac,Y){var Z=P(W),ad=Z[0],ab,V,aa;function X(ag){var af=ag.startContainer,aj=ag.startOffset,ai,ah;if(af.nodeType==1||af.nodeValue===""){af=af.nodeType==1?af.childNodes[aj]:af;if(af){ai=new s(af,af.parentNode);for(ah=ai.current();ah;ah=ai.next()){if(ah.nodeType==3&&!f(ah)){ag.setStart(ah,0);break}}}}return ag}function U(ag,af){af=af||ad;if(ag){M(af.styles,function(ai,ah){c.setStyle(ag,ah,q(ai,ac))});M(af.attributes,function(ai,ah){c.setAttrib(ag,ah,q(ai,ac))});M(af.classes,function(ah){ah=q(ah,ac);if(!c.hasClass(ag,ah)){c.addClass(ag,ah)}})}}function ae(ag){var af=[],ai,ah;ai=ad.inline||ad.block;ah=c.create(ai);U(ah);I.walk(ag,function(aj){var ak;function al(am){var ap=am.nodeName.toLowerCase(),ao=am.parentNode.nodeN
 ame.toLowerCase(),an;if(g(ap,"br")){ak=0;if(ad.block){c.remove(am)}return}if(ad.wrapper&&v(am,W,ac)){ak=0;return}if(ad.block&&!ad.wrapper&&F(ap)){am=c.rename(am,ai);U(am);af.push(am);ak=0;return}if(ad.selector){M(Z,function(aq){if(c.is(am,aq.selector)&&!b(am)){U(am,aq);an=true}});if(!ad.inline||an){ak=0;return}}if(d(ai,ap)&&d(ao,ai)){if(!ak){ak=ah.cloneNode(Q);am.parentNode.insertBefore(ak,am);af.push(ak)}ak.appendChild(am)}else{ak=0;M(a.grep(am.childNodes),al);ak=0}}M(aj,al)});M(af,function(al){var aj;function am(ao){var an=0;M(ao.childNodes,function(ap){if(!f(ap)&&!G(ap)){an++}});return an}function ak(an){var ap,ao;M(an.childNodes,function(aq){if(aq.nodeType==1&&!G(aq)&&!b(aq)){ap=aq;return Q}});if(ap&&h(ap,ad)){ao=ap.cloneNode(Q);U(ao);c.replace(ao,an,A);c.remove(ap,1)}return ao||an}aj=am(al);if(aj===0){c.remove(al,1);return}if(ad.inline||ad.wrapper){if(!ad.exact&&aj===1){al=ak(al)}M(Z,function(an){M(c.select(an.inline,al),function(ao){S(an,ac,ao,an.exact?ao:null)})});if(
 v(al.parentNode,W,ac)){c.remove(al,1);al=0;return A}if(ad.merge_with_parents){c.getParent(al.parentNode,function(an){if(v(an,W,ac)){c.remove(al,1);al=0;return A}})}if(al){al=t(B(al),al);al=t(al,B(al,A))}}})}if(ad){if(Y){V=c.createRng();V.setStartBefore(Y);V.setEndAfter(Y);ae(n(V,Z))}else{if(!p.isCollapsed()||!ad.inline){ab=p.getBookmark();ae(n(p.getRng(A),Z));p.moveToBookmark(ab);p.setRng(X(p.getRng(A)));T.nodeChanged()}else{O("apply",W,ac)}}}}function z(W,af,Z){var aa=P(W),ah=aa[0],ae,ad,V;function Y(ak){var aj=ak.startContainer,ap=ak.startOffset,ao,an,al,am;if(aj.nodeType==3&&ap>=aj.nodeValue.length-1){aj=aj.parentNode;ap=r(aj)+1}if(aj.nodeType==1){al=aj.childNodes;aj=al[Math.min(ap,al.length-1)];ao=new s(aj);if(ap>al.length-1){ao.next()}for(an=ao.current();an;an=ao.next()){if(an.nodeType==3&&!f(an)){am=c.create("a",null,D);an.parentNode.insertBefore(am,an);ak.setStart(an,0);p.setRng(ak);c.remove(am);return}}}}function X(am){var al,ak,aj;al=a.grep(am.childNodes);for(ak=0,a
 j=aa.length;ak<aj;ak++){if(S(aa[ak],af,am,am)){break}}if(ah.deep){for(ak=0,aj=al.length;ak<aj;ak++){X(al[ak])}}}function ab(aj){var ak;M(l(aj.parentNode).reverse(),function(al){var am;if(!ak&&al.id!="_start"&&al.id!="_end"){am=v(al,W,af);if(am&&am.split!==false){ak=al}}});return ak}function U(am,aj,ao,ar){var at,aq,ap,al,an,ak;if(am){ak=am.parentNode;for(at=aj.parentNode;at&&at!=ak;at=at.parentNode){aq=at.cloneNode(Q);for(an=0;an<aa.length;an++){if(S(aa[an],af,aq,aq)){aq=0;break}}if(aq){if(ap){aq.appendChild(ap)}if(!al){al=aq}ap=aq}}if(ar&&(!ah.mixed||!E(am))){aj=c.split(am,aj)}if(ap){ao.parentNode.insertBefore(ap,ao);al.appendChild(ao)}}return aj}function ag(aj){return U(ab(aj),aj,aj,true)}function ac(al){var ak=c.get(al?"_start":"_end"),aj=ak[al?"firstChild":"lastChild"];if(G(aj)){aj=aj[al?"firstChild":"lastChild"]}c.remove(ak,true);return aj}function ai(aj){var ak,al;aj=n(aj,aa,A);if(ah.split){ak=H(aj,A);al=H(aj);if(ak!=al){ak=L(ak,"span",{id:"_start",_mce_type:"bookmark"
 });al=L(al,"span",{id:"_end",_mce_type:"bookmark"});ag(ak);ag(al);ak=ac(A);al=ac()}else{ak=al=ag(ak)}aj.startContainer=ak.parentNode;aj.startOffset=r(ak);aj.endContainer=al.parentNode;aj.endOffset=r(al)+1}I.walk(aj,function(am){M(am,function(an){X(an)})})}if(Z){V=c.createRng();V.setStartBefore(Z);V.setEndAfter(Z);ai(V);return}if(!p.isCollapsed()||!ah.inline){ae=p.getBookmark();ai(p.getRng(A));p.moveToBookmark(ae);if(i(W,af,p.getStart())){Y(p.getRng(true))}T.nodeChanged()}else{O("remove",W,af)}}function C(U,W,V){if(i(U,W,V)){z(U,W,V)}else{R(U,W,V)}}function v(V,U,aa,Y){var W=P(U),ab,Z,X;function ac(ag,ai,aj){var af,ah,ad=ai[aj],ae;if(ad){if(ad.length===o){for(af in ad){if(ad.hasOwnProperty(af)){if(aj==="attributes"){ah=c.getAttrib(ag,af)}else{ah=J(ag,af)}if(Y&&!ah&&!ai.exact){return}if((!Y||ai.exact)&&!g(ah,q(ad[af],aa))){return}}}}else{for(ae=0;ae<ad.length;ae++){if(aj==="attributes"?c.getAttrib(ag,ad[ae]):J(ag,ad[ae])){return ai}}}}return ai}if(W&&V){for(Z=0;Z<W.length;Z++)
 {ab=W[Z];if(h(V,ab)&&ac(V,ab,"attributes")&&ac(V,ab,"styles")){if(X=ab.classes){for(Z=0;Z<X.length;Z++){if(!c.hasClass(V,X[Z])){return}}}return ab}}}}function i(W,Z,Y){var V,X;function U(aa){aa=c.getParent(aa,function(ab){return !!v(ab,W,Z,true)});return v(aa,W,Z)}if(Y){return U(Y)}if(p.isCollapsed()){for(X=N.apply.length-1;X>=0;X--){if(N.apply[X].name==W){return true}}for(X=N.remove.length-1;X>=0;X--){if(N.remove[X].name==W){return false}}return U(p.getNode())}Y=p.getNode();if(U(Y)){return A}V=p.getStart();if(V!=Y){if(U(V)){return A}}return Q}function u(ab,aa){var Y,Z=[],X={},W,V,U;if(p.isCollapsed()){for(V=0;V<ab.length;V++){for(W=N.remove.length-1;W>=0;W--){U=ab[V];if(N.remove[W].name==U){X[U]=true;break}}}for(W=N.apply.length-1;W>=0;W--){for(V=0;V<ab.length;V++){U=ab[V];if(!X[U]&&N.apply[W].name==U){X[U]=true;Z.push(U)}}}}Y=p.getStart();c.getParent(Y,function(ae){var ad,ac;for(ad=0;ad<ab.length;ad++){ac=ab[ad];if(!X[ac]&&v(ae,ac,aa)){X[ac]=true;Z.push(ac)}}});return Z}fu
 nction x(Y){var aa=P(Y),X,W,Z,V,U;if(aa){X=p.getStart();W=l(X);for(V=aa.length-1;V>=0;V--){U=aa[V].selector;if(!U){return A}for(Z=W.length-1;Z>=0;Z--){if(c.is(W[Z],U)){return A}}}}return Q}a.extend(this,{get:P,register:j,apply:R,remove:z,toggle:C,match:i,matchAll:u,matchNode:v,canApply:x});function h(U,V){if(g(U,V.inline)){return A}if(g(U,V.block)){return A}if(V.selector){return c.is(U,V.selector)}}function g(V,U){V=V||"";U=U||"";V=""+(V.nodeName||V);U=""+(U.nodeName||U);return V.toLowerCase()==U.toLowerCase()}function J(V,U){var W=c.getStyle(V,U);if(U=="color"||U=="backgroundColor"){W=c.toHex(W)}if(U=="fontWeight"&&W==700){W="bold"}return""+W}function q(U,V){if(typeof(U)!="string"){U=U(V)}else{if(V){U=U.replace(/%(\w+)/g,function(X,W){return V[W]||X})}}return U}function f(U){return U&&U.nodeType===3&&/^([\s\r\n]+|)$/.test(U.nodeValue)}function L(W,V,U){var X=c.create(V,U);W.parentNode.insertBefore(X,W);X.appendChild(W);return X}function n(U,ac,X){var W=U.startContainer,Z=U.
 startOffset,af=U.endContainer,aa=U.endOffset,ae,ab;function ad(ai,aj,ag,ah){var ak,al;ah=ah||c.getRoot();for(;;){ak=ai.parentNode;if(ak==ah||(!ac[0].block_expand&&E(ak))){return ai}for(ae=ak[aj];ae&&ae!=ai;ae=ae[ag]){if(ae.nodeType==1&&!G(ae)){return ai}if(ae.nodeType==3&&!f(ae)){return ai}}ai=ai.parentNode}return ai}if(W.nodeType==1&&W.hasChildNodes()){ab=W.childNodes.length-1;W=W.childNodes[Z>ab?ab:Z];if(W.nodeType==3){Z=0}}if(af.nodeType==1&&af.hasChildNodes()){ab=af.childNodes.length-1;af=af.childNodes[aa>ab?ab:aa-1];if(af.nodeType==3){aa=af.nodeValue.length}}if(G(W.parentNode)){W=W.parentNode}if(G(W)){W=W.nextSibling||W}if(G(af.parentNode)){af=af.parentNode}if(G(af)){af=af.previousSibling||af}if(ac[0].inline||ac[0].block_expand){W=ad(W,"firstChild","nextSibling");af=ad(af,"lastChild","previousSibling")}if(ac[0].selector&&ac[0].expand!==Q&&!ac[0].inline){function Y(ah,ag){var ai,aj,ak;if(ah.nodeType==3&&ah.nodeValue.length==0&&ah[ag]){ah=ah[ag]}ai=l(ah);for(aj=0;aj<ai.le
 ngth;aj++){for(ak=0;ak<ac.length;ak++){if(c.is(ai[aj],ac[ak].selector)){return ai[aj]}}}return ah}W=Y(W,"previousSibling");af=Y(af,"nextSibling")}if(ac[0].block||ac[0].selector){function V(ah,ag,aj){var ai;if(!ac[0].wrapper){ai=c.getParent(ah,ac[0].block)}if(!ai){ai=c.getParent(ah.nodeType==3?ah.parentNode:ah,E)}if(ai&&ac[0].wrapper){ai=l(ai,"ul,ol").reverse()[0]||ai}if(!ai){ai=ah;while(ai[ag]&&!E(ai[ag])){ai=ai[ag];if(g(ai,"br")){break}}}return ai||ah}W=V(W,"previousSibling");af=V(af,"nextSibling");if(ac[0].block){if(!E(W)){W=ad(W,"firstChild","nextSibling")}if(!E(af)){af=ad(af,"lastChild","previousSibling")}}}if(W.nodeType==1){Z=r(W);W=W.parentNode}if(af.nodeType==1){aa=r(af)+1;af=af.parentNode}return{startContainer:W,startOffset:Z,endContainer:af,endOffset:aa}}function S(aa,Z,X,U){var W,V,Y;if(!h(X,aa)){return Q}if(aa.remove!="all"){M(aa.styles,function(ac,ab){ac=q(ac,Z);if(typeof(ab)==="number"){ab=ac;U=0}if(!U||g(J(U,ab),ac)){c.setStyle(X,ab,"")}Y=1});if(Y&&c.getAttrib(
 X,"style")==""){X.removeAttribute("style");X.removeAttribute("_mce_style")}M(aa.attributes,function(ad,ab){var ac;ad=q(ad,Z);if(typeof(ab)==="number"){ab=ad;U=0}if(!U||g(c.getAttrib(U,ab),ad)){if(ab=="class"){ad=c.getAttrib(X,ab);if(ad){ac="";M(ad.split(/\s+/),function(ae){if(/mce\w+/.test(ae)){ac+=(ac?" ":"")+ae}});if(ac){c.setAttrib(X,ab,ac);return}}}if(ab=="class"){X.removeAttribute("className")}if(e.test(ab)){X.removeAttribute("_mce_"+ab)}X.removeAttribute(ab)}});M(aa.classes,function(ab){ab=q(ab,Z);if(!U||c.hasClass(U,ab)){c.removeClass(X,ab)}});V=c.getAttribs(X);for(W=0;W<V.length;W++){if(V[W].nodeName.indexOf("_")!==0){return Q}}}if(aa.remove!="none"){m(X,aa);return A}}function m(W,X){var U=W.parentNode,V;if(X.block){if(!k){function Y(aa,Z,ab){aa=B(aa,Z,ab);return !aa||(aa.nodeName=="BR"||E(aa))}if(E(W)&&!E(U)){if(!Y(W,Q)&&!Y(W.firstChild,A,1)){W.insertBefore(c.create("br"),W.firstChild)}if(!Y(W,A)&&!Y(W.lastChild,Q,1)){W.appendChild(c.create("br"))}}}else{if(U==c.get
 Root()){if(!X.list_block||!g(W,X.list_block)){M(a.grep(W.childNodes),function(Z){if(d(k,Z.nodeName.toLowerCase())){if(!V){V=L(Z,k)}else{V.appendChild(Z)}}else{V=0}})}}}}if(X.selector&&X.inline&&!g(X.inline,W)){return}c.remove(W,1)}function B(V,U,W){if(V){U=U?"nextSibling":"previousSibling";for(V=W?V:V[U];V;V=V[U]){if(V.nodeType==1||!f(V)){return V}}}}function G(U){return U&&U.nodeType==1&&U.getAttribute("_mce_type")=="bookmark"}function t(Y,X){var U,W,V;function aa(ad,ac){if(ad.nodeName!=ac.nodeName){return Q}function ab(af){var ag={};M(c.getAttribs(af),function(ah){var ai=ah.nodeName.toLowerCase();if(ai.indexOf("_")!==0&&ai!=="style"){ag[ai]=c.getAttrib(af,ai)}});return ag}function ae(ai,ah){var ag,af;for(af in ai){if(ai.hasOwnProperty(af)){ag=ah[af];if(ag===o){return Q}if(ai[af]!=ag){return Q}delete ah[af]}}for(af in ah){if(ah.hasOwnProperty(af)){return Q}}return A}if(!ae(ab(ad),ab(ac))){return Q}if(!ae(c.parseStyle(c.getAttrib(ad,"style")),c.parseStyle(c.getAttrib(ac,"sty
 le")))){return Q}return A}if(Y&&X){function Z(ac,ab){for(W=ac;W;W=W[ab]){if(W.nodeType==3&&!f(W)){return ac}if(W.nodeType==1&&!G(W)){return W}}return ac}Y=Z(Y,"previousSibling");X=Z(X,"nextSibling");if(aa(Y,X)){for(W=Y.nextSibling;W&&W!=X;){V=W;W=W.nextSibling;Y.appendChild(V)}c.remove(X);M(a.grep(X.childNodes),function(ab){Y.appendChild(ab)});return Y}}return X}function F(U){return/^(h[1-6]|p|div|pre|address|dl|dt|dd)$/.test(U)}function H(V,Y){var U,X,W;U=V[Y?"startContainer":"endContainer"];X=V[Y?"startOffset":"endOffset"];if(U.nodeType==1){W=U.childNodes.length-1;if(!Y&&X){X--}U=U.childNodes[X>W?W:X]}return U}function O(Z,V,Y){var W,U=N[Z],aa=N[Z=="apply"?"remove":"apply"];function ab(){return N.apply.length||N.remove.length}function X(){N.apply=[];N.remove=[]}function ac(ad){M(N.apply.reverse(),function(ae){R(ae.name,ae.vars,ad)});M(N.remove.reverse(),function(ae){z(ae.name,ae.vars,ad)});c.remove(ad,1);X()}for(W=U.length-1;W>=0;W--){if(U[W].name==V){return}}U.push({name:
 V,vars:Y});for(W=aa.length-1;W>=0;W--){if(aa[W].name==V){aa.splice(W,1)}}if(ab()){T.getDoc().execCommand("FontName",false,"mceinline");N.lastRng=p.getRng();M(c.select("font,span"),function(ae){var ad;if(b(ae)){ad=p.getBookmark();ac(ae);p.moveToBookmark(ad);T.nodeChanged()}});if(!N.isListening&&ab()){N.isListening=true;M("onKeyDown,onKeyUp,onKeyPress,onMouseUp".split(","),function(ad){T[ad].addToTop(function(ae,af){if(ab()&&!a.dom.RangeUtils.compareRanges(N.lastRng,p.getRng())){M(c.select("font,span"),function(ah){var ai,ag;if(b(ah)){ai=ah.firstChild;if(ai){ac(ah);ag=c.createRng();ag.setStart(ai,ai.nodeValue.length);ag.setEnd(ai,ai.nodeValue.length);p.setRng(ag);ae.nodeChanged()}else{c.remove(ah)}}});if(af.type=="keyup"||af.type=="mouseup"){X()}}})})}}}}})(tinymce);tinymce.onAddEditor.add(function(e,a){var d,h,g,c=a.settings;if(c.inline_styles){h=e.explode(c.font_size_style_values);function b(j,i){e.each(i,function(l,k){if(l){g.setStyle(j,k,l)}});g.rename(j,"span")}d={font:fu
 nction(j,i){b(i,{backgroundColor:i.style.backgroundColor,color:i.color,fontFamily:i.face,fontSize:h[parseInt(i.size)-1]})},u:function(j,i){b(i,{textDecoration:"underline"})},strike:function(j,i){b(i,{textDecoration:"line-through"})}};function f(i,j){g=i.dom;if(c.convert_fonts_to_spans){e.each(g.select("font,u,strike",j.node),function(k){d[k.nodeName.toLowerCase()](a.dom,k)})}}a.onPreProcess.add(f);a.onInit.add(function(){a.selection.onSetContent.add(f)})}});
\ No newline at end of file
+function TinyMCE_Engine(){var ua;this.majorVersion="2";this.minorVersion="1.3";this.releaseDate="2007-11-27";this.instances=[];this.switchClassCache=[];this.windowArgs=[];this.loadedFiles=[];this.pendingFiles=[];this.loadingIndex=0;this.configs=[];this.currentConfig=0;this.eventHandlers=[];this.log=[];this.undoLevels=[];this.undoIndex=0;this.typingUndoIndex=-1;this.settings=[];ua=navigator.userAgent;this.isMSIE=(navigator.appName=="Microsoft Internet Explorer");this.isMSIE5=this.isMSIE&&(ua.indexOf('MSIE 5')!=-1);this.isMSIE5_0=this.isMSIE&&(ua.indexOf('MSIE 5.0')!=-1);this.isMSIE7=this.isMSIE&&(ua.indexOf('MSIE 7')!=-1);this.isGecko=ua.indexOf('Gecko')!=-1;this.isSafari=ua.indexOf('Safari')!=-1;this.isOpera=window['opera']&&opera.buildNumber?true:false;this.isMac=ua.indexOf('Mac')!=-1;this.isNS7=ua.indexOf('Netscape/7')!=-1;this.isNS71=ua.indexOf('Netscape/7.1')!=-1;this.dialogCounter=0;this.plugins=[];this.themes=[];this.menus=[];this.loadedPlugins=[];this.buttonMap=[];thi
 s.isLoaded=false;if(this.isOpera){this.isMSIE=true;this.isGecko=false;this.isSafari=false}this.isIE=this.isMSIE;this.isRealIE=this.isMSIE&&!this.isOpera;this.idCounter=0};TinyMCE_Engine.prototype={init:function(settings){var theme,nl,baseHREF="",i,cssPath,entities,h,p,src,elements=[],head;if(this.isMSIE5_0)return;this.settings=settings;if(typeof(document.execCommand)=='undefined')return;if(!tinyMCE.baseURL){head=document.getElementsByTagName('head')[0];if(head){for(i=0,nl=head.getElementsByTagName('script');i<nl.length;i++)elements.push(nl[i])}for(i=0,nl=document.getElementsByTagName('script');i<nl.length;i++)elements.push(nl[i]);nl=document.getElementsByTagName('base');for(i=0;i<nl.length;i++){if(nl[i].href)baseHREF=nl[i].href}for(i=0;i<elements.length;i++){if(elements[i].src&&(elements[i].src.indexOf("tiny_mce.js")!=-1||elements[i].src.indexOf("tiny_mce_dev.js")!=-1||elements[i].src.indexOf("tiny_mce_src.js")!=-1||elements[i].src.indexOf("tiny_mce_gzip")!=-1)){src=elements
 [i].src;tinyMCE.srcMode=(src.indexOf('_src')!=-1||src.indexOf('_dev')!=-1)?'_src':'';tinyMCE.gzipMode=src.indexOf('_gzip')!=-1;src=src.substring(0,src.lastIndexOf('/'));if(settings.exec_mode=="src"||settings.exec_mode=="normal")tinyMCE.srcMode=settings.exec_mode=="src"?'_src':'';if(baseHREF!==''&&src.indexOf('://')==-1)tinyMCE.baseURL=baseHREF+src;else tinyMCE.baseURL=src;break}}}this.documentBasePath=document.location.href;if(this.documentBasePath.indexOf('?')!=-1)this.documentBasePath=this.documentBasePath.substring(0,this.documentBasePath.indexOf('?'));this.documentURL=this.documentBasePath;this.documentBasePath=this.documentBasePath.substring(0,this.documentBasePath.lastIndexOf('/'));if(tinyMCE.baseURL.indexOf('://')==-1&&tinyMCE.baseURL.charAt(0)!='/'){tinyMCE.baseURL=this.documentBasePath+"/"+tinyMCE.baseURL}this._def("mode","none");this._def("theme","advanced");this._def("plugins","",true);this._def("language","en");this._def("docs_language",this.settings.language);th
 is._def("elements","");this._def("textarea_trigger","mce_editable");this._def("editor_selector","");this._def("editor_deselector","mceNoEditor");this._def("valid_elements","+a[id|style|rel|rev|charset|hreflang|dir|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],-strong/-b[class|style],-em/-i[class|style],-strike[class|style],-u[class|style],#p[id|style|dir|class|align],-ol[class|style],-ul[class|style],-li[class|style],br,img[id|dir|lang|longdesc|usemap|style|class|src|onmouseover|onmouseout|border|alt=|title|hspace|vspace|width|height|align],-sub[style|class],-sup[style|class],-blockquote[dir|style],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|style|dir|id|lang|bgcolor|background|bordercolor],-tr[id|lang|dir|class|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor],tbody[id|class],thead[id|class],t
 foot[id|class],#td[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor|scope],-th[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|scope],caption[id|lang|dir|class|style],-div[id|dir|class|align|style],-span[style|class|align],-pre[class|align|style],address[class|align|style],-h1[id|style|dir|class|align],-h2[id|style|dir|class|align],-h3[id|style|dir|class|align],-h4[id|style|dir|class|align],-h5[id|style|dir|class|align],-h6[id|style|dir|class|align],hr[class|style],-font[face|size|style|id|class|dir|color],dd[id|class|title|style|dir|lang],dl[id|class|title|style|dir|lang],dt[id|class|title|style|dir|lang],cite[title|id|class|style|dir|lang],abbr[title|id|class|style|dir|lang],acronym[title|id|class|style|dir|lang],del[title|id|class|style|dir|lang|datetime|cite],ins[title|id|class|style|dir|lang|datetime|cite]");this._def("extended_valid_elements","");this._def("invalid_elements","");this._def("encoding","");
 this._def("urlconverter_callback",tinyMCE.getParam("urlconvertor_callback","TinyMCE_Engine.prototype.convertURL"));this._def("save_callback","");this._def("force_br_newlines",false);this._def("force_p_newlines",true);this._def("add_form_submit_trigger",true);this._def("relative_urls",true);this._def("remove_script_host",true);this._def("focus_alert",true);this._def("document_base_url",this.documentURL);this._def("visual",true);this._def("visual_table_class","mceVisualAid");this._def("setupcontent_callback","");this._def("fix_content_duplication",true);this._def("custom_undo_redo",true);this._def("custom_undo_redo_levels",-1);this._def("custom_undo_redo_keyboard_shortcuts",true);this._def("custom_undo_redo_restore_selection",true);this._def("custom_undo_redo_global",false);this._def("verify_html",true);this._def("apply_source_formatting",false);this._def("directionality","ltr");this._def("cleanup_on_startup",false);this._def("inline_styles",false);this._def("convert_newlines_
 to_brs",false);this._def("auto_reset_designmode",true);this._def("entities","39,#39,160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,25
 0,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,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,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747
 ,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,34,quot,38,amp,60,lt,62,gt,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro",true);this._def("entity_encoding","named");this._def("cleanup_callback","");this._def("add_unload_trigger",true);this._def("ask",false);this._def("nowrap",false);this._def("auto_resize",false);this._def("auto_focus",false);this._def("cleanup",true);this._def("remove_linebreaks",true);this._def("button_tile_map",false);this._def("submit_patch",true);this._def("browsers
 ","msie,safari,gecko,opera",true);this._def("dialog_type","window");this._def("accessibility_warnings",true);this._def("accessibility_focus",true);this._def("merge_styles_invalid_parents","");this._def("force_hex_style_colors",true);this._def("trim_span_elements",true);this._def("convert_fonts_to_spans",false);this._def("doctype",'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">');this._def("font_size_classes",'');this._def("font_size_style_values",'xx-small,x-small,small,medium,large,x-large,xx-large',true);this._def("event_elements",'a,img',true);this._def("convert_urls",true);this._def("table_inline_editing",false);this._def("object_resizing",true);this._def("custom_shortcuts",true);this._def("convert_on_click",false);this._def("content_css",'');this._def("fix_list_elements",true);this._def("fix_table_elements",false);this._def("strict_loading_mode",document.contentType=='application/xhtml+xml');this._def("hidden_tab_class",'');this._def("display_tab_class",
 '');this._def("gecko_spellcheck",false);this._def("hide_selects_on_submit",true);this._def("forced_root_block",false);this._def("remove_trailing_nbsp",false);this._def("save_on_tinymce_forms",false);if(this.isMSIE&&!this.isOpera)this.settings.strict_loading_mode=false;if(this.isMSIE&&this.settings.browsers.indexOf('msie')==-1)return;if(this.isGecko&&this.settings.browsers.indexOf('gecko')==-1)return;if(this.isSafari&&this.settings.browsers.indexOf('safari')==-1)return;if(this.isOpera&&this.settings.browsers.indexOf('opera')==-1)return;baseHREF=tinyMCE.settings.document_base_url;h=document.location.href;p=h.indexOf('://');if(p>0&&document.location.protocol!="file:"){p=h.indexOf('/',p+3);h=h.substring(0,p);if(baseHREF.indexOf('://')==-1)baseHREF=h+baseHREF;tinyMCE.settings.document_base_url=baseHREF;tinyMCE.settings.document_base_prefix=h}if(baseHREF.indexOf('?')!=-1)baseHREF=baseHREF.substring(0,baseHREF.indexOf('?'));this.settings.base_href=baseHREF.substring(0,baseHREF.last
 IndexOf('/'))+"/";theme=this.settings.theme;this.inlineStrict='A|BR|SPAN|BDO|MAP|OBJECT|IMG|TT|I|B|BIG|SMALL|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|#text|#comment';this.inlineTransitional='A|BR|SPAN|BDO|OBJECT|APPLET|IMG|MAP|IFRAME|TT|I|B|U|S|STRIKE|BIG|SMALL|FONT|BASEFONT|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|INPUT|SELECT|TEXTAREA|LABEL|BUTTON|#text|#comment';this.blockElms='H[1-6]|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP';this.blockRegExp=new RegExp("^("+this.blockElms+")$","i");this.posKeyCodes=[13,45,36,35,33,34,37,38,39,40];this.uniqueURL='javascript:void(091039730);';this.uniqueTag='<div id="mceTMPElement" style="display: none">TMP</div>';this.callbacks=['onInit','getInfo','getEditorTemplate','setupContent','onChange','onPageLoad','handleNodeChange','initInstance','execCommand','getControlHTML','handleEvent','cleanup','removeInstance'];thi
 s.settings.theme_href=tinyMCE.baseURL+"/themes/"+theme;if(!tinyMCE.isIE||tinyMCE.isOpera)this.settings.force_br_newlines=false;if(tinyMCE.getParam("popups_css",false)){cssPath=tinyMCE.getParam("popups_css","");if(cssPath.indexOf('://')==-1&&cssPath.charAt(0)!='/')this.settings.popups_css=this.documentBasePath+"/"+cssPath;else this.settings.popups_css=cssPath}else this.settings.popups_css=tinyMCE.baseURL+"/themes/"+theme+"/css/editor_popup.css";if(tinyMCE.getParam("editor_css",false)){cssPath=tinyMCE.getParam("editor_css","");if(cssPath.indexOf('://')==-1&&cssPath.charAt(0)!='/')this.settings.editor_css=this.documentBasePath+"/"+cssPath;else this.settings.editor_css=cssPath}else{if(this.settings.editor_css!=='')this.settings.editor_css=tinyMCE.baseURL+"/themes/"+theme+"/css/editor_ui.css"}if(this.configs.length==0){if(typeof(TinyMCECompressed)=="undefined"){tinyMCE.addEvent(window,"DOMContentLoaded",TinyMCE_Engine.prototype.onLoad);if(tinyMCE.isRealIE){if(document.body)tinyMC
 E.addEvent(document.body,"readystatechange",TinyMCE_Engine.prototype.onLoad);else tinyMCE.addEvent(document,"readystatechange",TinyMCE_Engine.prototype.onLoad)}tinyMCE.addEvent(window,"load",TinyMCE_Engine.prototype.onLoad);tinyMCE._addUnloadEvents()}}this.loadScript(tinyMCE.baseURL+'/themes/'+this.settings.theme+'/editor_template'+tinyMCE.srcMode+'.js');this.loadScript(tinyMCE.baseURL+'/langs/'+this.settings.language+'.js');this.loadCSS(this.settings.editor_css);p=tinyMCE.getParam('plugins','',true,',');if(p.length>0){for(i=0;i<p.length;i++){if(p[i].charAt(0)!='-')this.loadScript(tinyMCE.baseURL+'/plugins/'+p[i]+'/editor_plugin'+tinyMCE.srcMode+'.js')}}if(tinyMCE.getParam('entity_encoding')=='named'){settings.cleanup_entities=[];entities=tinyMCE.getParam('entities','',true,',');for(i=0;i<entities.length;i+=2)settings.cleanup_entities['c'+entities[i]]=entities[i+1]}settings.index=this.configs.length;this.configs[this.configs.length]=settings;this.loadNextScript();if(this.isI
 E&&!this.isOpera){try{document.execCommand('BackgroundImageCache',false,true)}catch(e){}}this.xmlEncodeRe=new RegExp('[<>&"]','g')},_addUnloadEvents:function(){var st=tinyMCE.settings.add_unload_trigger;if(tinyMCE.isIE){if(st){tinyMCE.addEvent(window,"unload",TinyMCE_Engine.prototype.unloadHandler);tinyMCE.addEvent(window.document,"beforeunload",TinyMCE_Engine.prototype.unloadHandler)}}else{if(st)tinyMCE.addEvent(window,"unload",function(){tinyMCE.triggerSave(true,true)})}},_def:function(key,def_val,t){var v=tinyMCE.getParam(key,def_val);v=t?v.replace(/\s+/g,""):v;this.settings[key]=v},hasPlugin:function(n){return typeof(this.plugins[n])!="undefined"&&this.plugins[n]!=null},addPlugin:function(n,p){var op=this.plugins[n];p.baseURL=op?op.baseURL:tinyMCE.baseURL+"/plugins/"+n;this.plugins[n]=p;this.loadNextScript()},setPluginBaseURL:function(n,u){var op=this.plugins[n];if(op)op.baseURL=u;else this.plugins[n]={baseURL:u}},loadPlugin:function(n,u){u=u.indexOf('.js')!=-1?u.substri
 ng(0,u.lastIndexOf('/')):u;u=u.charAt(u.length-1)=='/'?u.substring(0,u.length-1):u;this.plugins[n]={baseURL:u};this.loadScript(u+"/editor_plugin"+(tinyMCE.srcMode?'_src':'')+".js")},hasTheme:function(n){return typeof(this.themes[n])!="undefined"&&this.themes[n]!=null},addTheme:function(n,t){this.themes[n]=t;this.loadNextScript()},addMenu:function(n,m){this.menus[n]=m},hasMenu:function(n){return typeof(this.plugins[n])!="undefined"&&this.plugins[n]!=null},loadScript:function(url){var i;for(i=0;i<this.loadedFiles.length;i++){if(this.loadedFiles[i]==url)return}if(tinyMCE.settings.strict_loading_mode)this.pendingFiles[this.pendingFiles.length]=url;else document.write('<sc'+'ript language="javascript" type="text/javascript" src="'+url+'"></script>');this.loadedFiles[this.loadedFiles.length]=url},loadNextScript:function(){var d=document,se;if(!tinyMCE.settings.strict_loading_mode)return;if(this.loadingIndex<this.pendingFiles.length){se=d.createElementNS('http://www.w3.org/1999/xht
 ml','script');se.setAttribute('language','javascript');se.setAttribute('type','text/javascript');se.setAttribute('src',this.pendingFiles[this.loadingIndex++]);d.getElementsByTagName("head")[0].appendChild(se)}else this.loadingIndex=-1;},loadCSS:function(url){var ar=url.replace(/\s+/,'').split(',');var lflen=0,csslen=0,skip=false;var x=0,i=0,nl,le;for(x=0,csslen=ar.length;x<csslen;x++){if(ar[x]!=null&&ar[x]!='null'&&ar[x].length>0){for(i=0,lflen=this.loadedFiles.length;i<lflen;i++){if(this.loadedFiles[i]==ar[x]){skip=true;break}}if(!skip){if(tinyMCE.settings.strict_loading_mode){nl=document.getElementsByTagName("head");le=document.createElement('link');le.setAttribute('href',ar[x]);le.setAttribute('rel','stylesheet');le.setAttribute('type','text/css');nl[0].appendChild(le)}else document.write('<link href="'+ar[x]+'" rel="stylesheet" type="text/css" />');this.loadedFiles[this.loadedFiles.length]=ar[x]}}}},importCSS:function(doc,css){var css_ary=css.replace(/\s+/,'').split(',')
 ;var csslen,elm,headArr,x,css_file;for(x=0,csslen=css_ary.length;x<csslen;x++){css_file=css_ary[x];if(css_file!=null&&css_file!='null'&&css_file.length>0){if(css_file.indexOf('://')==-1&&css_file.charAt(0)!='/')css_file=this.documentBasePath+"/"+css_file;if(typeof(doc.createStyleSheet)=="undefined"){elm=doc.createElement("link");elm.rel="stylesheet";elm.href=css_file;if((headArr=doc.getElementsByTagName("head"))!=null&&headArr.length>0)headArr[0].appendChild(elm)}else doc.createStyleSheet(css_file)}}},confirmAdd:function(e,settings){var elm=tinyMCE.isIE?event.srcElement:e.target;var elementId=elm.name?elm.name:elm.id;tinyMCE.settings=settings;if(tinyMCE.settings.convert_on_click||(!elm.getAttribute('mce_noask')&&confirm(tinyMCELang.lang_edit_confirm)))tinyMCE.addMCEControl(elm,elementId);elm.setAttribute('mce_noask','true')},updateContent:function(form_element_name){var formElement,n,inst,doc;formElement=document.getElementById(form_element_name);for(n in tinyMCE.instances){
 inst=tinyMCE.instances[n];if(!tinyMCE.isInstance(inst))continue;inst.switchSettings();if(inst.formElement==formElement){doc=inst.getDoc();tinyMCE._setHTML(doc,inst.formElement.value);if(!tinyMCE.isIE)doc.body.innerHTML=tinyMCE._cleanupHTML(inst,doc,this.settings,doc.body,inst.visualAid)}}},addMCEControl:function(replace_element,form_element_name,target_document){var id="mce_editor_"+tinyMCE.idCounter++;var inst=new TinyMCE_Control(tinyMCE.settings);inst.editorId=id;this.instances[id]=inst;inst._onAdd(replace_element,form_element_name,target_document)},removeInstance:function(ti){var t=[],n,i;for(n in tinyMCE.instances){i=tinyMCE.instances[n];if(tinyMCE.isInstance(i)&&ti!=i)t[n]=i}tinyMCE.instances=t;n=[];t=tinyMCE.undoLevels;for(i=0;i<t.length;i++){if(t[i]!=ti)n.push(t[i])}tinyMCE.undoLevels=n;tinyMCE.undoIndex=n.length;tinyMCE.dispatchCallback(ti,'remove_instance_callback','removeInstance',ti);return ti},removeMCEControl:function(editor_id){var inst=tinyMCE.getInstanceById(
 editor_id),h,re,ot,tn,n;if(inst){inst.switchSettings();editor_id=inst.editorId;h=tinyMCE.getContent(editor_id);this.removeInstance(inst);tinyMCE.selectedElement=null;tinyMCE.selectedInstance=null;tinyMCE.selectedElement=null;tinyMCE.selectedInstance=null;for(n in tinyMCE.instances){if(!tinyMCE.isInstance(tinyMCE.instances[n]))continue;tinyMCE.selectedInstance=tinyMCE.instances[n];break}re=document.getElementById(editor_id+"_parent");ot=inst.oldTargetElement;tn=ot.nodeName.toLowerCase();if(tn=="textarea"||tn=="input"){re.parentNode.removeChild(re);ot.style.display="inline";ot.value=h}else{ot.innerHTML=h;ot.style.display='block';re.parentNode.insertBefore(ot,re);re.parentNode.removeChild(re)}}},triggerSave:function(skip_cleanup,skip_callback){var inst,n;if(typeof(skip_cleanup)=="undefined")skip_cleanup=false;if(typeof(skip_callback)=="undefined")skip_callback=false;for(n in tinyMCE.instances){inst=tinyMCE.instances[n];if(!tinyMCE.isInstance(inst))continue;inst.triggerSave(skip
 _cleanup,skip_callback)}},resetForm:function(form_index){var i,inst,n,formObj=document.forms[form_index];for(n in tinyMCE.instances){inst=tinyMCE.instances[n];if(!tinyMCE.isInstance(inst))continue;inst.switchSettings();for(i=0;i<formObj.elements.length;i++){if(inst.formTargetElementId==formObj.elements[i].name)inst.getBody().innerHTML=inst.startContent}}},execInstanceCommand:function(editor_id,command,user_interface,value,focus){var inst=tinyMCE.getInstanceById(editor_id),r;if(inst){r=inst.selection.getRng();if(typeof(focus)=="undefined")focus=true;if(focus&&(!r||!r.item))inst.contentWindow.focus();inst.autoResetDesignMode();this.selectedElement=inst.getFocusElement();inst.select();tinyMCE.execCommand(command,user_interface,value);if(tinyMCE.isIE&&window.event!=null)tinyMCE.cancelEvent(window.event)}},execCommand:function(command,user_interface,value){var inst=tinyMCE.selectedInstance,n,pe,te;user_interface=user_interface?user_interface:false;value=value?value:null;if(inst)i
 nst.switchSettings();switch(command){case"Undo":if(this.getParam('custom_undo_redo_global')){if(this.undoIndex>0){tinyMCE.nextUndoRedoAction='Undo';inst=this.undoLevels[--this.undoIndex];inst.select();if(!tinyMCE.nextUndoRedoInstanceId)inst.execCommand('Undo')}}else inst.execCommand('Undo');return true;case"Redo":if(this.getParam('custom_undo_redo_global')){if(this.undoIndex<=this.undoLevels.length-1){tinyMCE.nextUndoRedoAction='Redo';inst=this.undoLevels[this.undoIndex++];inst.select();if(!tinyMCE.nextUndoRedoInstanceId)inst.execCommand('Redo')}}else inst.execCommand('Redo');return true;case'mceFocus':inst=tinyMCE.getInstanceById(value);if(inst)inst.getWin().focus();return;case"mceAddControl":case"mceAddEditor":tinyMCE.addMCEControl(tinyMCE._getElementById(value),value);return;case"mceAddFrameControl":tinyMCE.addMCEControl(tinyMCE._getElementById(value.element,value.document),value.element,value.document);return;case"mceRemoveControl":case"mceRemoveEditor":tinyMCE.removeMCE
 Control(value);return;case"mceToggleEditor":inst=tinyMCE.getInstanceById(value);if(inst){pe=document.getElementById(inst.editorId+'_parent');te=inst.oldTargetElement;if(typeof(inst.enabled)=='undefined')inst.enabled=true;inst.enabled=!inst.enabled;if(!inst.enabled){pe.style.display='none';if(te.nodeName=='TEXTAREA'||te.nodeName=='INPUT')te.value=inst.getHTML();else te.innerHTML=inst.getHTML();te.style.display=inst.oldTargetDisplay;tinyMCE.dispatchCallback(inst,'hide_instance_callback','hideInstance',inst)}else{pe.style.display='block';te.style.display='none';if(te.nodeName=='TEXTAREA'||te.nodeName=='INPUT')inst.setHTML(te.value);else inst.setHTML(te.innerHTML);inst.useCSS=false;tinyMCE.dispatchCallback(inst,'show_instance_callback','showInstance',inst)}}else tinyMCE.addMCEControl(tinyMCE._getElementById(value),value);return;case"mceResetDesignMode":if(tinyMCE.isGecko){for(n in tinyMCE.instances){if(!tinyMCE.isInstance(tinyMCE.instances[n]))continue;try{tinyMCE.instances[n].g
 etDoc().designMode="off";tinyMCE.instances[n].getDoc().designMode="on";tinyMCE.instances[n].useCSS=false}catch(e){}}}return}if(inst){inst.execCommand(command,user_interface,value)}else if(tinyMCE.settings.focus_alert)alert(tinyMCELang.lang_focus_alert)},_createIFrame:function(replace_element,doc,win){var iframe,id=replace_element.getAttribute("id");var aw,ah;if(typeof(doc)=="undefined")doc=document;if(typeof(win)=="undefined")win=window;iframe=doc.createElement("iframe");aw=""+tinyMCE.settings.area_width;ah=""+tinyMCE.settings.area_height;if(aw.indexOf('%')==-1){aw=parseInt(aw);aw=(isNaN(aw)||aw<0)?300:aw;aw=aw+"px"}if(ah.indexOf('%')==-1){ah=parseInt(ah);ah=(isNaN(ah)||ah<0)?240:ah;ah=ah+"px"}iframe.setAttribute("id",id);iframe.setAttribute("name",id);iframe.setAttribute("class","mceEditorIframe");iframe.setAttribute("border","0");iframe.setAttribute("frameBorder","0");iframe.setAttribute("marginWidth","0");iframe.setAttribute("marginHeight","0");iframe.setAttribute("leftMa
 rgin","0");iframe.setAttribute("topMargin","0");iframe.setAttribute("width",aw);iframe.setAttribute("height",ah);iframe.setAttribute("allowtransparency","true");iframe.className='mceEditorIframe';if(tinyMCE.settings.auto_resize)iframe.setAttribute("scrolling","no");if(tinyMCE.isRealIE)iframe.setAttribute("src",this.settings.default_document);iframe.style.width=aw;iframe.style.height=ah;if(tinyMCE.settings.strict_loading_mode)iframe.style.marginBottom='-5px';if(tinyMCE.isRealIE)replace_element.outerHTML=iframe.outerHTML;else replace_element.parentNode.replaceChild(iframe,replace_element);if(tinyMCE.isRealIE)return win.frames[id];else return iframe},setupContent:function(editor_id){var inst=tinyMCE.instances[editor_id],i,doc=inst.getDoc(),head=doc.getElementsByTagName('head').item(0);var content=inst.startContent,contentElement,body;if(tinyMCE.settings.strict_loading_mode){content=content.replace(/</g,'<');content=content.replace(/>/g,'>');content=content.replace(/"
 /g,'"');content=content.replace(/&/g,'&')}tinyMCE.selectedInstance=inst;inst.switchSettings();if(!tinyMCE.isIE&&tinyMCE.getParam("setupcontent_reload",false)&&doc.title!="blank_page"){try{doc.location.href=tinyMCE.baseURL+"/blank.htm"}catch(ex){}window.setTimeout("tinyMCE.setupContent('"+editor_id+"');",1000);return}if(!head||!doc.body){window.setTimeout("tinyMCE.setupContent('"+editor_id+"');",10);return}tinyMCE.importCSS(inst.getDoc(),tinyMCE.baseURL+"/themes/"+inst.settings.theme+"/css/editor_content.css");tinyMCE.importCSS(inst.getDoc(),inst.settings.content_css);tinyMCE.dispatchCallback(inst,'init_instance_callback','initInstance',inst);if(tinyMCE.getParam('custom_undo_redo_keyboard_shortcuts')){inst.addShortcut('ctrl','z','lang_undo_desc','Undo');inst.addShortcut('ctrl','y','lang_redo_desc','Redo')}for(i=1;i<=6;i++)inst.addShortcut('ctrl',''+i,'','FormatBlock',false,'<h'+i+'>');inst.addShortcut('ctrl','7','','FormatBlock',false,'<p>');inst.addShortcut('ctrl','8',''
 ,'FormatBlock',false,'<div>');inst.addShortcut('ctrl','9','','FormatBlock',false,'<address>');if(tinyMCE.isGecko){inst.addShortcut('ctrl','b','lang_bold_desc','Bold');inst.addShortcut('ctrl','i','lang_italic_desc','Italic');inst.addShortcut('ctrl','u','lang_underline_desc','Underline')}if(tinyMCE.getParam("convert_fonts_to_spans"))inst.getBody().setAttribute('id','mceSpanFonts');if(tinyMCE.settings.nowrap)doc.body.style.whiteSpace="nowrap";doc.body.dir=this.settings.directionality;doc.editorId=editor_id;if(!tinyMCE.isIE)doc.documentElement.editorId=editor_id;inst.setBaseHREF(tinyMCE.settings.base_href);if(tinyMCE.settings.convert_newlines_to_brs){content=tinyMCE.regexpReplace(content,"\r\n","<br />","gi");content=tinyMCE.regexpReplace(content,"\r","<br />","gi");content=tinyMCE.regexpReplace(content,"\n","<br />","gi")}content=tinyMCE.storeAwayURLs(content);content=tinyMCE._customCleanup(inst,"insert_to_editor",content);if(tinyMCE.isIE){window.setInterval('try{tinyMCE.getCSS
 Classes(tinyMCE.instances["'+editor_id+'"].getDoc(), "'+editor_id+'");}catch(e){}',500);if(tinyMCE.settings.force_br_newlines)doc.styleSheets[0].addRule("p","margin: 0;");body=inst.getBody();body.editorId=editor_id}content=tinyMCE.cleanupHTMLCode(content);if(!tinyMCE.isIE){contentElement=inst.getDoc().createElement("body");doc=inst.getDoc();contentElement.innerHTML=content;if(tinyMCE.settings.cleanup_on_startup)tinyMCE.setInnerHTML(inst.getBody(),tinyMCE._cleanupHTML(inst,doc,this.settings,contentElement));else tinyMCE.setInnerHTML(inst.getBody(),content);tinyMCE.convertAllRelativeURLs(inst.getBody())}else{if(tinyMCE.settings.cleanup_on_startup){tinyMCE._setHTML(inst.getDoc(),content);try{tinyMCE.setInnerHTML(inst.getBody(),tinyMCE._cleanupHTML(inst,inst.contentDocument,this.settings,inst.getBody()))}catch(e){}}else tinyMCE._setHTML(inst.getDoc(),content)}tinyMCE.handleVisualAid(inst.getBody(),true,tinyMCE.settings.visual,inst);tinyMCE.dispatchCallback(inst,'setupcontent_cal
 lback','setupContent',editor_id,inst.getBody(),inst.getDoc());if(!tinyMCE.isIE)tinyMCE.addEventHandlers(inst);if(tinyMCE.isIE){tinyMCE.addEvent(inst.getBody(),"blur",TinyMCE_Engine.prototype._eventPatch);tinyMCE.addEvent(inst.getBody(),"beforedeactivate",TinyMCE_Engine.prototype._eventPatch);if(!tinyMCE.isOpera){tinyMCE.addEvent(doc.body,"mousemove",TinyMCE_Engine.prototype.onMouseMove);tinyMCE.addEvent(doc.body,"beforepaste",TinyMCE_Engine.prototype._eventPatch);tinyMCE.addEvent(doc.body,"drop",TinyMCE_Engine.prototype._eventPatch)}}inst.select();tinyMCE.selectedElement=inst.contentWindow.document.body;tinyMCE._customCleanup(inst,"insert_to_editor_dom",inst.getBody());tinyMCE._customCleanup(inst,"setup_content_dom",inst.getBody());tinyMCE._setEventsEnabled(inst.getBody(),false);tinyMCE.cleanupAnchors(inst.getDoc());if(tinyMCE.getParam("convert_fonts_to_spans"))tinyMCE.convertSpansToFonts(inst.getDoc());inst.startContent=tinyMCE.trim(inst.getBody().innerHTML);inst.undoRedo.a
 dd({content:inst.startContent});if(tinyMCE.isGecko){tinyMCE.selectNodes(inst.getBody(),function(n){if(n.nodeType==3||n.nodeType==8)n.nodeValue=n.nodeValue.replace(new RegExp('\\s(mce_src|mce_href)=\"[^\"]*\"','gi'),"");return false})}if(tinyMCE.isGecko)inst.getBody().spellcheck=tinyMCE.getParam("gecko_spellcheck");tinyMCE._removeInternal(inst.getBody());inst.select();tinyMCE.triggerNodeChange(false,true)},storeAwayURLs:function(s){if(!s.match(/(mce_src|mce_href)/gi,s)){s=s.replace(new RegExp('src\\s*=\\s*[\"\']([^ >\"]*)[\"\']','gi'),'src="$1" mce_src="$1"');s=s.replace(new RegExp('href\\s*=\\s*[\"\']([^ >\"]*)[\"\']','gi'),'href="$1" mce_href="$1"')}return s},_removeInternal:function(n){if(tinyMCE.isGecko){tinyMCE.selectNodes(n,function(n){if(n.nodeType==3||n.nodeType==8)n.nodeValue=n.nodeValue.replace(new RegExp('\\s(mce_src|mce_href)=\"[^\"]*\"','gi'),"");return false})}},removeTinyMCEFormElements:function(form_obj){var i,elementId;if(!tinyMCE.getParam('hide_selects_on_su
 bmit'))return;if(typeof(form_obj)=="undefined"||form_obj==null)return;if(form_obj.nodeName!="FORM"){if(form_obj.form)form_obj=form_obj.form;else form_obj=tinyMCE.getParentElement(form_obj,"form")}if(form_obj==null)return;for(i=0;i<form_obj.elements.length;i++){elementId=form_obj.elements[i].name?form_obj.elements[i].name:form_obj.elements[i].id;if(elementId.indexOf('mce_editor_')==0)form_obj.elements[i].disabled=true}},handleEvent:function(e){var inst=tinyMCE.selectedInstance,i,elm,keys;if(typeof(tinyMCE)=="undefined")return true;if(tinyMCE.executeCallback(tinyMCE.selectedInstance,'handle_event_callback','handleEvent',e))return false;switch(e.type){case"beforedeactivate":case"blur":if(tinyMCE.selectedInstance)tinyMCE.selectedInstance.execCommand('mceEndTyping');tinyMCE.hideMenus();return;case"drop":case"beforepaste":return;case"submit":tinyMCE.formSubmit(tinyMCE.isMSIE?window.event.srcElement:e.target);return;case"reset":var formObj=tinyMCE.isIE?window.event.srcElement:e.tar
 get;for(i=0;i<document.forms.length;i++){if(document.forms[i]==formObj)window.setTimeout('tinyMCE.resetForm('+i+');',10)}return;case"keypress":if(inst&&inst.handleShortcut(e))return false;if(e.target.editorId){tinyMCE.instances[e.target.editorId].select()}else{if(e.target.ownerDocument.editorId)tinyMCE.instances[e.target.ownerDocument.editorId].select()}if(tinyMCE.selectedInstance)tinyMCE.selectedInstance.switchSettings();if((tinyMCE.isGecko||tinyMCE.isOpera||tinyMCE.isSafari)&&tinyMCE.settings.force_p_newlines&&e.keyCode==13&&!e.shiftKey){if(TinyMCE_ForceParagraphs._insertPara(tinyMCE.selectedInstance,e)){tinyMCE.execCommand("mceAddUndoLevel");return tinyMCE.cancelEvent(e)}}if((tinyMCE.isGecko&&!tinyMCE.isSafari)&&tinyMCE.settings.force_p_newlines&&(e.keyCode==8||e.keyCode==46)&&!e.shiftKey){if(TinyMCE_ForceParagraphs._handleBackSpace(tinyMCE.selectedInstance,e.type)){tinyMCE.execCommand("mceAddUndoLevel");return tinyMCE.cancelEvent(e)}}if(tinyMCE.isIE&&tinyMCE.settings.for
 ce_br_newlines&&e.keyCode==13){if(e.target.editorId)tinyMCE.instances[e.target.editorId].select();if(tinyMCE.selectedInstance){var sel=tinyMCE.selectedInstance.getDoc().selection;var rng=sel.createRange();if(tinyMCE.getParentElement(rng.parentElement(),"li")!=null)return false;e.returnValue=false;e.cancelBubble=true;rng.pasteHTML("<br />");rng.collapse(false);rng.select();tinyMCE.execCommand("mceAddUndoLevel");tinyMCE.triggerNodeChange(false);return false}}if(e.keyCode==8||e.keyCode==46){tinyMCE.selectedElement=e.target;tinyMCE.linkElement=tinyMCE.getParentElement(e.target,"a");tinyMCE.imgElement=tinyMCE.getParentElement(e.target,"img");tinyMCE.triggerNodeChange(false)}return false;case"keyup":case"keydown":tinyMCE.hideMenus();tinyMCE.hasMouseMoved=false;if(inst&&inst.handleShortcut(e))return false;inst._fixRootBlocks();if(inst.settings.remove_trailing_nbsp)inst._fixTrailingNbsp();if(e.target.editorId)tinyMCE.instances[e.target.editorId].select();if(tinyMCE.selectedInstance)
 tinyMCE.selectedInstance.switchSettings();inst=tinyMCE.selectedInstance;if(tinyMCE.isGecko&&tinyMCE.settings.force_p_newlines&&(e.keyCode==8||e.keyCode==46)&&!e.shiftKey){if(TinyMCE_ForceParagraphs._handleBackSpace(tinyMCE.selectedInstance,e.type)){tinyMCE.execCommand("mceAddUndoLevel");e.preventDefault();return false}}tinyMCE.selectedElement=null;tinyMCE.selectedNode=null;elm=tinyMCE.selectedInstance.getFocusElement();tinyMCE.linkElement=tinyMCE.getParentElement(elm,"a");tinyMCE.imgElement=tinyMCE.getParentElement(elm,"img");tinyMCE.selectedElement=elm;if(tinyMCE.isGecko&&e.type=="keyup"&&e.keyCode==9)tinyMCE.handleVisualAid(tinyMCE.selectedInstance.getBody(),true,tinyMCE.settings.visual,tinyMCE.selectedInstance);if(tinyMCE.isIE&&e.type=="keydown"&&e.keyCode==13)tinyMCE.enterKeyElement=tinyMCE.selectedInstance.getFocusElement();if(tinyMCE.isIE&&e.type=="keyup"&&e.keyCode==13){elm=tinyMCE.enterKeyElement;if(elm){var re=new RegExp('^HR|IMG|BR$','g');var dre=new RegExp('^H[1-6
 ]$','g');if(!elm.hasChildNodes()&&!re.test(elm.nodeName)){if(dre.test(elm.nodeName))elm.innerHTML="  ";else elm.innerHTML=" "}}}keys=tinyMCE.posKeyCodes;var posKey=false;for(i=0;i<keys.length;i++){if(keys[i]==e.keyCode){posKey=true;break}}if(tinyMCE.isIE&&tinyMCE.settings.custom_undo_redo){keys=[8,46];for(i=0;i<keys.length;i++){if(keys[i]==e.keyCode){if(e.type=="keyup")tinyMCE.triggerNodeChange(false)}}}if(e.keyCode==17)return true;if(tinyMCE.isGecko){if(!posKey&&e.type=="keyup"&&!e.ctrlKey||(e.ctrlKey&&(e.keyCode==86||e.keyCode==88)))tinyMCE.execCommand("mceStartTyping")}else{if(!posKey&&e.type=="keyup")tinyMCE.execCommand("mceStartTyping")}if(e.type=="keydown"&&(posKey||e.ctrlKey)&&inst)inst.undoBookmark=inst.selection.getBookmark();if(e.type=="keyup"&&(posKey||e.ctrlKey))tinyMCE.execCommand("mceEndTyping");if(posKey&&e.type=="keyup")tinyMCE.triggerNodeChange(false);if(tinyMCE.isIE&&e.ctrlKey)window.setTimeout('tinyMCE.triggerNodeChange(false);',1);break;cas
 e"mousedown":case"mouseup":case"click":case"dblclick":case"focus":tinyMCE.hideMenus();if(tinyMCE.selectedInstance){tinyMCE.selectedInstance.switchSettings();tinyMCE.selectedInstance.isFocused=true}var targetBody=tinyMCE.getParentElement(e.target,"html");for(var instanceName in tinyMCE.instances){if(!tinyMCE.isInstance(tinyMCE.instances[instanceName]))continue;inst=tinyMCE.instances[instanceName];inst.autoResetDesignMode();if(inst.getBody().parentNode==targetBody){inst.select();tinyMCE.selectedElement=e.target;tinyMCE.linkElement=tinyMCE.getParentElement(tinyMCE.selectedElement,"a");tinyMCE.imgElement=tinyMCE.getParentElement(tinyMCE.selectedElement,"img");break}}if(!tinyMCE.selectedInstance.undoRedo.undoLevels[0].bookmark&&(e.type=="mouseup"||e.type=="dblclick"))tinyMCE.selectedInstance.undoRedo.undoLevels[0].bookmark=tinyMCE.selectedInstance.selection.getBookmark();if(e.type!="focus")tinyMCE.selectedNode=null;tinyMCE.triggerNodeChange(false);tinyMCE.execCommand("mceEndTypin
 g");if(e.type=="mouseup")tinyMCE.execCommand("mceAddUndoLevel");if(!tinyMCE.selectedInstance&&e.target.editorId)tinyMCE.instances[e.target.editorId].select();return false}},getButtonHTML:function(id,lang,img,cmd,ui,val){var h='',m,x,io='';cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\''+cmd+'\'';if(typeof(ui)!="undefined"&&ui!=null)cmd+=','+ui;if(typeof(val)!="undefined"&&val!=null)cmd+=",'"+val+"'";cmd+=');';if(tinyMCE.isRealIE)io='onmouseover="tinyMCE.lastHover = this;"';if(tinyMCE.getParam('button_tile_map')&&(!tinyMCE.isIE||tinyMCE.isOpera)&&(m=this.buttonMap[id])!=null&&(tinyMCE.getParam("language")=="en"||img.indexOf('$lang')==-1)){x=0-(m*20)==0?'0':0-(m*20);h+='<a id="{$editor_id}_'+id+'" href="javascript:'+cmd+'" onclick="'+cmd+'return false;" onmousedown="return false;" '+io+' class="mceTiledButton mceButtonNormal" target="_self">';h+='<img src="{$themeurl}/images/spacer.gif" style="background-position: '+x+'px 0" alt="{$'+lang+'}" title="{$'+lang+'}" />';h+='<
 /a>'}else{h+='<a id="{$editor_id}_'+id+'" href="javascript:'+cmd+'" onclick="'+cmd+'return false;" onmousedown="return false;" '+io+' class="mceButtonNormal" target="_self">';h+='<img src="'+img+'" alt="{$'+lang+'}" title="{$'+lang+'}" />';h+='</a>'}return h},getMenuButtonHTML:function(id,lang,img,mcmd,cmd,ui,val){var h='',m,x;mcmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\''+mcmd+'\');';cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\''+cmd+'\'';if(typeof(ui)!="undefined"&&ui!=null)cmd+=','+ui;if(typeof(val)!="undefined"&&val!=null)cmd+=",'"+val+"'";cmd+=');';if(tinyMCE.getParam('button_tile_map')&&(!tinyMCE.isIE||tinyMCE.isOpera)&&(m=tinyMCE.buttonMap[id])!=null&&(tinyMCE.getParam("language")=="en"||img.indexOf('$lang')==-1)){x=0-(m*20)==0?'0':0-(m*20);if(tinyMCE.isRealIE)h+='<span id="{$editor_id}_'+id+'" class="mceMenuButton" onmouseover="tinyMCE._menuButtonEvent(\'over\',this);tinyMCE.lastHover = this;" onmouseout="tinyMCE._menuButtonEvent(\'out\',this);">';else
  h+='<span id="{$editor_id}_'+id+'" class="mceMenuButton">';h+='<a href="javascript:'+cmd+'" onclick="'+cmd+'return false;" onmousedown="return false;" class="mceTiledButton mceMenuButtonNormal" target="_self">';h+='<img src="{$themeurl}/images/spacer.gif" style="width: 20px; height: 20px; background-position: '+x+'px 0" title="{$'+lang+'}" /></a>';h+='<a href="javascript:'+mcmd+'" onclick="'+mcmd+'return false;" onmousedown="return false;"><img src="{$themeurl}/images/button_menu.gif" title="{$'+lang+'}" class="mceMenuButton" />';h+='</a></span>'}else{if(tinyMCE.isRealIE)h+='<span id="{$editor_id}_'+id+'" dir="ltr" class="mceMenuButton" onmouseover="tinyMCE._menuButtonEvent(\'over\',this);tinyMCE.lastHover = this;" onmouseout="tinyMCE._menuButtonEvent(\'out\',this);">';else h+='<span id="{$editor_id}_'+id+'" dir="ltr" class="mceMenuButton">';h+='<a href="javascript:'+cmd+'" onclick="'+cmd+'return false;" onmousedown="return false;" class="mceMenuButtonNormal" target="_self"
 >';h+='<img src="'+img+'" title="{$'+lang+'}" /></a>';h+='<a href="javascript:'+mcmd+'" onclick="'+mcmd+'return false;" onmousedown="return false;"><img src="{$themeurl}/images/button_menu.gif" title="{$'+lang+'}" class="mceMenuButton" />';h+='</a></span>'}return h},_menuButtonEvent:function(e,o){if(o.className=='mceMenuButtonFocus')return;if(e=='over')o.className=o.className+' mceMenuHover';else o.className=o.className.replace(/\s.*$/,'')},addButtonMap:function(m){var i,a=m.replace(/\s+/,'').split(',');for(i=0;i<a.length;i++)this.buttonMap[a[i]]=i},formSubmit:function(f,p){var n,inst,found=false;if(f.form)f=f.form;if(tinyMCE.getParam('save_on_tinymce_forms')){for(n in tinyMCE.instances){inst=tinyMCE.instances[n];if(!tinyMCE.isInstance(inst))continue;if(inst.formElement){if(f==inst.formElement.form){found=true;inst.isNotDirty=true}}}}else found=true;if(found){tinyMCE.removeTinyMCEFormElements(f);tinyMCE.triggerSave()}if(f.mceOldSubmit&&p)f.mceOldSubmit()},submitPatch:functio
 n(){tinyMCE.formSubmit(this,true)},onLoad:function(){var r,i,c,mode,trigger,elements,element,settings,elementId,elm;var selector,deselector,elementRefAr,form;if(tinyMCE.settings.strict_loading_mode&&this.loadingIndex!=-1){window.setTimeout('tinyMCE.onLoad();',1);return}if(tinyMCE.isRealIE&&window.event.type=="readystatechange"&&document.readyState!="complete")return true;if(tinyMCE.isLoaded)return true;tinyMCE.isLoaded=true;if(tinyMCE.isRealIE&&document.body&&window.location.href!=window.top.location.href){r=document.body.createTextRange();r.collapse(true);r.select()}tinyMCE.dispatchCallback(null,'onpageload','onPageLoad');for(c=0;c<tinyMCE.configs.length;c++){tinyMCE.settings=tinyMCE.configs[c];selector=tinyMCE.getParam("editor_selector");deselector=tinyMCE.getParam("editor_deselector");elementRefAr=[];if(document.forms&&tinyMCE.settings.add_form_submit_trigger&&!tinyMCE.submitTriggers){for(i=0;i<document.forms.length;i++){form=document.forms[i];tinyMCE.addEvent(form,"submi
 t",TinyMCE_Engine.prototype.handleEvent);tinyMCE.addEvent(form,"reset",TinyMCE_Engine.prototype.handleEvent);tinyMCE.submitTriggers=true;if(tinyMCE.settings.submit_patch){try{form.mceOldSubmit=form.submit;form.submit=TinyMCE_Engine.prototype.submitPatch}catch(e){}}}}mode=tinyMCE.settings.mode;switch(mode){case"exact":elements=tinyMCE.getParam('elements','',true,',');for(i=0;i<elements.length;i++){element=tinyMCE._getElementById(elements[i]);trigger=element?element.getAttribute(tinyMCE.settings.textarea_trigger):"";if(new RegExp('\\b'+deselector+'\\b').test(tinyMCE.getAttrib(element,"class")))continue;if(trigger=="false")continue;if((tinyMCE.settings.ask||tinyMCE.settings.convert_on_click)&&element){elementRefAr[elementRefAr.length]=element;continue}if(element)tinyMCE.addMCEControl(element,elements[i])}break;case"specific_textareas":case"textareas":elements=document.getElementsByTagName("textarea");for(i=0;i<elements.length;i++){elm=elements.item(i);trigger=elm.getAttribute(t
 inyMCE.settings.textarea_trigger);if(selector!==''&&!new RegExp('\\b'+selector+'\\b').test(tinyMCE.getAttrib(elm,"class")))continue;if(selector!=='')trigger=selector!==''?"true":"";if(new RegExp('\\b'+deselector+'\\b').test(tinyMCE.getAttrib(elm,"class")))continue;if((mode=="specific_textareas"&&trigger=="true")||(mode=="textareas"&&trigger!="false"))elementRefAr[elementRefAr.length]=elm}break}for(i=0;i<elementRefAr.length;i++){element=elementRefAr[i];elementId=element.name?element.name:element.id;if(tinyMCE.settings.ask||tinyMCE.settings.convert_on_click){if(tinyMCE.isGecko){settings=tinyMCE.settings;tinyMCE.addEvent(element,"focus",function(e){window.setTimeout(function(){TinyMCE_Engine.prototype.confirmAdd(e,settings)},10)});if(element.nodeName!="TEXTAREA"&&element.nodeName!="INPUT")tinyMCE.addEvent(element,"click",function(e){window.setTimeout(function(){TinyMCE_Engine.prototype.confirmAdd(e,settings)},10)});}else{settings=tinyMCE.settings;tinyMCE.addEvent(element,"focus
 ",function(){TinyMCE_Engine.prototype.confirmAdd(null,settings)});tinyMCE.addEvent(element,"click",function(){TinyMCE_Engine.prototype.confirmAdd(null,settings)});}}else tinyMCE.addMCEControl(element,elementId)}if(tinyMCE.settings.auto_focus){window.setTimeout(function(){var inst=tinyMCE.getInstanceById(tinyMCE.settings.auto_focus);inst.selection.selectNode(inst.getBody(),true,true);inst.contentWindow.focus()},100)}tinyMCE.dispatchCallback(null,'oninit','onInit')}},isInstance:function(o){return o!=null&&typeof(o)=="object"&&o.isTinyMCE_Control},getParam:function(name,default_value,strip_whitespace,split_chr){var i,outArray,value=(typeof(this.settings[name])=="undefined")?default_value:this.settings[name];if(value=="true"||value=="false")return(value=="true");if(strip_whitespace)value=tinyMCE.regexpReplace(value,"[ \t\r\n]","");if(typeof(split_chr)!="undefined"&&split_chr!=null){value=value.split(split_chr);outArray=[];for(i=0;i<value.length;i++){if(value[i]&&value[i]!=='')ou
 tArray[outArray.length]=value[i]}value=outArray}return value},getLang:function(name,default_value,parse_entities,va){var v=(typeof(tinyMCELang[name])=="undefined")?default_value:tinyMCELang[name],n;if(parse_entities)v=tinyMCE.entityDecode(v);if(va){for(n in va)v=this.replaceVar(v,n,va[n])}return v},entityDecode:function(s){var e=document.createElement("div");e.innerHTML=s;return!e.firstChild?s:e.firstChild.nodeValue},addToLang:function(prefix,ar){var k;for(k in ar){if(typeof(ar[k])=='function')continue;tinyMCELang[(k.indexOf('lang_')==-1?'lang_':'')+(prefix!==''?(prefix+"_"):'')+k]=ar[k]}this.loadNextScript()},triggerNodeChange:function(focus,setup_content){var elm,inst,editorId,undoIndex=-1,undoLevels=-1,doc,anySelection,st;if(tinyMCE.selectedInstance){inst=tinyMCE.selectedInstance;elm=(typeof(setup_content)!="undefined"&&setup_content)?tinyMCE.selectedElement:inst.getFocusElement();editorId=inst.editorId;st=inst.selection.getSelectedText();if(tinyMCE.settings.auto_resize)i
 nst.resizeToContent();if(setup_content&&tinyMCE.isGecko&&inst.isHidden())elm=inst.getBody();inst.switchSettings();anySelection=!inst.selection.isCollapsed();if(tinyMCE.settings.custom_undo_redo){undoIndex=inst.undoRedo.undoIndex;undoLevels=inst.undoRedo.undoLevels.length}tinyMCE.dispatchCallback(inst,'handle_node_change_callback','handleNodeChange',editorId,elm,undoIndex,undoLevels,inst.visualAid,anySelection,setup_content)}if(this.selectedInstance&&(typeof(focus)=="undefined"||focus))this.selectedInstance.contentWindow.focus()},_customCleanup:function(inst,type,content){var pl,po,i,customCleanup;customCleanup=tinyMCE.settings.cleanup_callback;if(customCleanup!='')content=tinyMCE.resolveDots(tinyMCE.settings.cleanup_callback,window)(type,content,inst);po=tinyMCE.themes[tinyMCE.settings.theme];if(po&&po.cleanup)content=po.cleanup(type,content,inst);pl=inst.plugins;for(i=0;i<pl.length;i++){po=tinyMCE.plugins[pl[i]];if(po&&po.cleanup)content=po.cleanup(type,content,inst)}return
  content},setContent:function(h){if(tinyMCE.selectedInstance){tinyMCE.selectedInstance.execCommand('mceSetContent',false,h);tinyMCE.selectedInstance.repaint()}},importThemeLanguagePack:function(name){if(typeof(name)=="undefined")name=tinyMCE.settings.theme;tinyMCE.loadScript(tinyMCE.baseURL+'/themes/'+name+'/langs/'+tinyMCE.settings.language+'.js')},importPluginLanguagePack:function(name){var b=tinyMCE.baseURL+'/plugins/'+name;if(this.plugins[name])b=this.plugins[name].baseURL;tinyMCE.loadScript(b+'/langs/'+tinyMCE.settings.language+'.js')},applyTemplate:function(h,ag){return h.replace(new RegExp('\\{\\$([a-z0-9_]+)\\}','gi'),function(m,s){if(s.indexOf('lang_')==0&&tinyMCELang[s])return tinyMCELang[s];if(ag&&ag[s])return ag[s];if(tinyMCE.settings[s])return tinyMCE.settings[s];if(m=='themeurl')return tinyMCE.themeURL;return m})},replaceVar:function(h,r,v){return h.replace(new RegExp('{\\\$'+r+'}','g'),v)},openWindow:function(template,args){var html,width,height,x,y,resizable,
 scrollbars,url,name,win,modal,features;args=!args?{}:args;args.mce_template_file=template.file;args.mce_width=template.width;args.mce_height=template.height;tinyMCE.windowArgs=args;html=template.html;if(!(width=parseInt(template.width)))width=320;if(!(height=parseInt(template.height)))height=200;if(tinyMCE.isIE)height+=40;else height+=20;x=parseInt(screen.width/ 2.0) - (width /2.0);y=parseInt(screen.height/ 2.0) - (height /2.0);resizable=(args&&args.resizable)?args.resizable:"no";scrollbars=(args&&args.scrollbars)?args.scrollbars:"no";if(template.file.charAt(0)!='/'&&template.file.indexOf('://')==-1)url=tinyMCE.baseURL+"/themes/"+tinyMCE.getParam("theme")+"/"+template.file;else url=template.file;for(name in args){if(typeof(args[name])=='function')continue;url=tinyMCE.replaceVar(url,name,escape(args[name]))}if(html){html=tinyMCE.replaceVar(html,"css",this.settings.popups_css);html=tinyMCE.applyTemplate(html,args);win=window.open("","mcePopup"+new Date().getTime(),"top="+y+",l
 eft="+x+",scrollbars="+scrollbars+",dialog=yes,minimizable="+resizable+",modal=yes,width="+width+",height="+height+",resizable="+resizable);if(win==null){alert(tinyMCELang.lang_popup_blocked);return}win.document.write(html);win.document.close();win.resizeTo(width,height);win.focus()}else{if((tinyMCE.isRealIE)&&resizable!='yes'&&tinyMCE.settings.dialog_type=="modal"){height+=10;features="resizable:"+resizable+";scroll:"+scrollbars+";status:yes;center:yes;help:no;dialogWidth:"+width+"px;dialogHeight:"+height+"px;";window.showModalDialog(url,window,features)}else{modal=(resizable=="yes")?"no":"yes";if(tinyMCE.isGecko&&tinyMCE.isMac)modal="no";if(template.close_previous!="no")try{tinyMCE.lastWindow.close()}catch(ex){}win=window.open(url,"mcePopup"+new Date().getTime(),"top="+y+",left="+x+",scrollbars="+scrollbars+",dialog="+modal+",minimizable="+resizable+",modal="+modal+",width="+width+",height="+height+",resizable="+resizable);if(win==null){alert(tinyMCELang.lang_popup_blocked
 );return}if(template.close_previous!="no")tinyMCE.lastWindow=win;try{win.resizeTo(width,height)}catch(e){}if(tinyMCE.isGecko&&win.document){if(win.document.defaultView.statusbar.visible)win.resizeBy(0,tinyMCE.isMac?10:24)}win.focus()}}},closeWindow:function(win){win.close()},getVisualAidClass:function(class_name,state){var i,classNames,ar,className,aidClass=tinyMCE.settings.visual_table_class;if(typeof(state)=="undefined")state=tinyMCE.settings.visual;classNames=[];ar=class_name.split(' ');for(i=0;i<ar.length;i++){if(ar[i]==aidClass)ar[i]="";if(ar[i]!=='')classNames[classNames.length]=ar[i]}if(state)classNames[classNames.length]=aidClass;className="";for(i=0;i<classNames.length;i++){if(i>0)className+=" ";className+=classNames[i]}return className},handleVisualAid:function(el,deep,state,inst,skip_dispatch){var i,x,y,tableElement,anchorName,oldW,oldH,bo,cn;if(!el)return;if(!skip_dispatch)tinyMCE.dispatchCallback(inst,'handle_visual_aid_callback','handleVisualAid',el,deep,state,
 inst);tableElement=null;switch(el.nodeName){case"TABLE":oldW=el.style.width;oldH=el.style.height;bo=tinyMCE.getAttrib(el,"border");bo=bo==''||bo=="0"?true:false;tinyMCE.setAttrib(el,"class",tinyMCE.getVisualAidClass(tinyMCE.getAttrib(el,"class"),state&&bo));el.style.width=oldW;el.style.height=oldH;for(y=0;y<el.rows.length;y++){for(x=0;x<el.rows[y].cells.length;x++){cn=tinyMCE.getVisualAidClass(tinyMCE.getAttrib(el.rows[y].cells[x],"class"),state&&bo);tinyMCE.setAttrib(el.rows[y].cells[x],"class",cn)}}break;case"A":anchorName=tinyMCE.getAttrib(el,"name");if(anchorName!==''&&state){el.title=anchorName;tinyMCE.addCSSClass(el,'mceItemAnchor')}else if(anchorName!==''&&!state)el.className='';break}if(deep&&el.hasChildNodes()){for(i=0;i<el.childNodes.length;i++)tinyMCE.handleVisualAid(el.childNodes[i],deep,state,inst,true)}},fixGeckoBaseHREFBug:function(m,e,h){var xsrc,xhref;if(tinyMCE.isGecko){if(m==1){h=h.replace(/\ssrc=/gi," mce_tsrc=");h=h.replace(/\shref=/gi," mce_thref=");ret
 urn h}else{if(!new RegExp('(src|href)=','g').test(h))return h;tinyMCE.selectElements(e,'A,IMG,SELECT,AREA,IFRAME,BASE,INPUT,SCRIPT,EMBED,OBJECT,LINK',function(n){xsrc=tinyMCE.getAttrib(n,"mce_tsrc");xhref=tinyMCE.getAttrib(n,"mce_thref");if(xsrc!==''){try{n.src=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings.base_href,xsrc)}catch(e){}n.removeAttribute("mce_tsrc")}if(xhref!==''){try{n.href=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings.base_href,xhref)}catch(e){}n.removeAttribute("mce_thref")}return false});tinyMCE.selectNodes(e,function(n){if(n.nodeType==3||n.nodeType==8){n.nodeValue=n.nodeValue.replace(/\smce_tsrc=/gi," src=");n.nodeValue=n.nodeValue.replace(/\smce_thref=/gi," href=")}return false})}}return h},_setHTML:function(doc,html_content){var i,html,paras,node;html_content=tinyMCE.cleanupHTMLCode(html_content);try{tinyMCE.setInnerHTML(doc.body,html_content)}catch(e){if(this.isMSIE)doc.body.createTextRange().pasteHTML(html_content)}if(tinyMCE.isIE&&tinyMC
 E.settings.fix_content_duplication){paras=doc.getElementsByTagName("P");for(i=0;i<paras.length;i++){node=paras[i];while((node=node.parentNode)!=null){if(node.nodeName=="P")node.outerHTML=node.innerHTML}}html=doc.body.innerHTML;tinyMCE.setInnerHTML(doc.body,html)}tinyMCE.cleanupAnchors(doc);if(tinyMCE.getParam("convert_fonts_to_spans"))tinyMCE.convertSpansToFonts(doc)},getEditorId:function(form_element){var inst=this.getInstanceById(form_element);if(!inst)return null;return inst.editorId},getInstanceById:function(editor_id){var inst=this.instances[editor_id],n;if(!inst){for(n in tinyMCE.instances){inst=tinyMCE.instances[n];if(!tinyMCE.isInstance(inst))continue;if(inst.formTargetElementId==editor_id)return inst}}else return inst;return null},queryInstanceCommandValue:function(editor_id,command){var inst=tinyMCE.getInstanceById(editor_id);if(inst)return inst.queryCommandValue(command);return false},queryInstanceCommandState:function(editor_id,command){var inst=tinyMCE.getInstan
 ceById(editor_id);if(inst)return inst.queryCommandState(command);return null},setWindowArg:function(n,v){this.windowArgs[n]=v},getWindowArg:function(n,d){return(typeof(this.windowArgs[n])=="undefined")?d:this.windowArgs[n]},getCSSClasses:function(editor_id,doc){var i,c,x,rule,styles,rules,csses,selectorText,inst=tinyMCE.getInstanceById(editor_id);var cssClass,addClass,p;if(!inst)inst=tinyMCE.selectedInstance;if(!inst)return[];if(!doc)doc=inst.getDoc();if(inst&&inst.cssClasses.length>0)return inst.cssClasses;if(!doc)return;styles=doc.styleSheets;if(styles&&styles.length>0){for(x=0;x<styles.length;x++){csses=null;try{csses=tinyMCE.isIE?doc.styleSheets(x).rules:styles[x].cssRules}catch(e){}if(!csses)return[];for(i=0;i<csses.length;i++){selectorText=csses[i].selectorText;if(selectorText){rules=selectorText.split(',');for(c=0;c<rules.length;c++){rule=rules[c];while(rule.indexOf(' ')==0)rule=rule.substring(1);if(rule.indexOf(' ')!=-1||rule.indexOf(':')!=-1||rule.indexOf('mceItem')
 !=-1)continue;if(rule.indexOf(tinyMCE.settings.visual_table_class)!=-1||rule.indexOf('mceEditable')!=-1||rule.indexOf('mceNonEditable')!=-1)continue;if(rule.indexOf('.')!=-1){cssClass=rule.substring(rule.indexOf('.')+1);addClass=true;for(p=0;p<inst.cssClasses.length&&addClass;p++){if(inst.cssClasses[p]==cssClass)addClass=false}if(addClass)inst.cssClasses[inst.cssClasses.length]=cssClass}}}}}}return inst.cssClasses},regexpReplace:function(in_str,reg_exp,replace_str,opts){var re;if(in_str==null)return in_str;if(typeof(opts)=="undefined")opts='g';re=new RegExp(reg_exp,opts);return in_str.replace(re,replace_str)},trim:function(s){return s.replace(/^\s*|\s*$/g,"")},cleanupEventStr:function(s){s=""+s;s=s.replace('function anonymous()\n{\n','');s=s.replace('\n}','');s=s.replace(/^return true;/gi,'');return s},getControlHTML:function(c){var i,l,n,o,v,rtl=tinyMCE.getLang('lang_dir')=='rtl';l=tinyMCE.plugins;for(n in l){o=l[n];if(o.getControlHTML&&(v=o.getControlHTML(c))!==''){if(rtl)
 return'<span dir="rtl">'+tinyMCE.replaceVar(v,"pluginurl",o.baseURL)+'</span>';return tinyMCE.replaceVar(v,"pluginurl",o.baseURL)}}o=tinyMCE.themes[tinyMCE.settings.theme];if(o.getControlHTML&&(v=o.getControlHTML(c))!==''){if(rtl)return'<span dir="rtl">'+v+'</span>';return v}return''},evalFunc:function(f,idx,a,o){o=!o?window:o;f=typeof(f)=='function'?f:o[f];return f.apply(o,Array.prototype.slice.call(a,idx))},dispatchCallback:function(i,p,n){return this.callFunc(i,p,n,0,this.dispatchCallback.arguments)},executeCallback:function(i,p,n){return this.callFunc(i,p,n,1,this.executeCallback.arguments)},execCommandCallback:function(i,p,n){return this.callFunc(i,p,n,2,this.execCommandCallback.arguments)},callFunc:function(ins,p,n,m,a){var l,i,on,o,s,v;s=m==2;l=tinyMCE.getParam(p,'');if(l!==''&&(v=tinyMCE.evalFunc(l,3,a))==s&&m>0)return true;if(ins!=null){for(i=0,l=ins.plugins;i<l.length;i++){o=tinyMCE.plugins[l[i]];if(o[n]&&(v=tinyMCE.evalFunc(n,3,a,o))==s&&m>0)return true}}l=tinyMCE
 .themes;for(on in l){o=l[on];if(o[n]&&(v=tinyMCE.evalFunc(n,3,a,o))==s&&m>0)return true}return false},resolveDots:function(s,o){var i;if(typeof(s)=='string'){for(i=0,s=s.split('.');i<s.length;i++)o=o[s[i]]}else o=s;return o},xmlEncode:function(s){return s?(''+s).replace(this.xmlEncodeRe,function(c,b){switch(c){case'&':return'&';case'"':return'"';case'<':return'<';case'>':return'>'}return c}):s},add:function(c,m){var n;for(n in m){if(m.hasOwnProperty(n))c.prototype[n]=m[n]}},extend:function(p,np){var o={},n;o.parent=p;for(n in p){if(p.hasOwnProperty(n))o[n]=p[n]}for(n in np){if(np.hasOwnProperty(n))o[n]=np[n]}return o},hideMenus:function(){var e=tinyMCE.lastSelectedMenuBtn;if(tinyMCE.lastMenu){tinyMCE.lastMenu.hide();tinyMCE.lastMenu=null}if(e){tinyMCE.switchClass(e,tinyMCE.lastMenuBtnClass);tinyMCE.lastSelectedMenuBtn=null}}};var TinyMCE=TinyMCE_Engine;var tinyMCE=new TinyMCE_Engine();var tinyMCELang={};function TinyMCE_Control(settings){var t,i,tos,fu,p,x,fn,
 fu,pn,s=settings;this.undoRedoLevel=true;this.isTinyMCE_Control=true;this.enabled=true;this.settings=s;this.settings.theme=tinyMCE.getParam("theme","default");this.settings.width=tinyMCE.getParam("width",-1);this.settings.height=tinyMCE.getParam("height",-1);this.selection=new TinyMCE_Selection(this);this.undoRedo=new TinyMCE_UndoRedo(this);this.cleanup=new TinyMCE_Cleanup();this.shortcuts=[];this.hasMouseMoved=false;this.foreColor=this.backColor="#999999";this.data={};this.cssClasses=[];this.cleanup.init({valid_elements:s.valid_elements,extended_valid_elements:s.extended_valid_elements,valid_child_elements:s.valid_child_elements,entities:s.entities,entity_encoding:s.entity_encoding,debug:s.cleanup_debug,indent:s.apply_source_formatting,invalid_elements:s.invalid_elements,verify_html:s.verify_html,fix_content_duplication:s.fix_content_duplication,convert_fonts_to_spans:s.convert_fonts_to_spans});t=this.settings.theme;if(!tinyMCE.hasTheme(t)){fn=tinyMCE.callbacks;tos={};for(i
 =0;i<fn.length;i++){if((fu=window['TinyMCE_'+t+"_"+fn[i]]))tos[fn[i]]=fu}tinyMCE.addTheme(t,tos)}this.plugins=[];p=tinyMCE.getParam('plugins','',true,',');if(p.length>0){for(i=0;i<p.length;i++){pn=p[i];if(pn.charAt(0)=='-')pn=pn.substring(1);if(!tinyMCE.hasPlugin(pn)){fn=tinyMCE.callbacks;tos={};for(x=0;x<fn.length;x++){if((fu=window['TinyMCE_'+pn+"_"+fn[x]]))tos[fn[x]]=fu}tinyMCE.addPlugin(pn,tos)}this.plugins[this.plugins.length]=pn}}};TinyMCE_Control.prototype={selection:null,settings:null,cleanup:null,getData:function(na){var o=this.data[na];if(!o)o=this.data[na]={};return o},hasPlugin:function(n){var i;for(i=0;i<this.plugins.length;i++){if(this.plugins[i]==n)return true}return false},addPlugin:function(n,p){if(!this.hasPlugin(n)){tinyMCE.addPlugin(n,p);this.plugins[this.plugins.length]=n}},repaint:function(){var s,b,ex;if(tinyMCE.isRealIE)return;try{s=this.selection;b=s.getBookmark(true);this.getBody().style.display='none';this.getDoc().execCommand('selectall',false,nul
 l);this.getSel().collapseToStart();this.getBody().style.display='block';s.moveToBookmark(b)}catch(ex){}},switchSettings:function(){if(tinyMCE.configs.length>1&&tinyMCE.currentConfig!=this.settings.index){tinyMCE.settings=this.settings;tinyMCE.currentConfig=this.settings.index}},select:function(){var oldInst=tinyMCE.selectedInstance;if(oldInst!=this){if(oldInst)oldInst.execCommand('mceEndTyping');tinyMCE.dispatchCallback(this,'select_instance_callback','selectInstance',this,oldInst);tinyMCE.selectedInstance=this}},getBody:function(){return this.contentBody?this.contentBody:this.getDoc().body},getDoc:function(){return this.contentWindow.document},getWin:function(){return this.contentWindow},getContainerWin:function(){return this.containerWindow?this.containerWindow:window},getViewPort:function(){return tinyMCE.getViewPort(this.getWin())},getParentNode:function(n,f){return tinyMCE.getParentNode(n,f,this.getBody())},getParentElement:function(n,na,f){return tinyMCE.getParentEleme
 nt(n,na,f,this.getBody())},getParentBlockElement:function(n){return tinyMCE.getParentBlockElement(n,this.getBody())},resizeToContent:function(){var d=this.getDoc(),b=d.body,de=d.documentElement;this.iframeElement.style.height=(tinyMCE.isRealIE)?b.scrollHeight:de.offsetHeight+'px'},addShortcut:function(m,k,d,cmd,ui,va){var n=typeof(k)=="number",ie=tinyMCE.isIE,c,sc,i,scl=this.shortcuts;if(!tinyMCE.getParam('custom_shortcuts'))return false;m=m.toLowerCase();k=ie&&!n?k.toUpperCase():k;c=n?null:k.charCodeAt(0);d=d&&d.indexOf('lang_')==0?tinyMCE.getLang(d):d;sc={alt:m.indexOf('alt')!=-1,ctrl:m.indexOf('ctrl')!=-1,shift:m.indexOf('shift')!=-1,charCode:c,keyCode:n?k:(ie?c:null),desc:d,cmd:cmd,ui:ui,val:va};for(i=0;i<scl.length;i++){if(sc.alt==scl[i].alt&&sc.ctrl==scl[i].ctrl&&sc.shift==scl[i].shift&&sc.charCode==scl[i].charCode&&sc.keyCode==scl[i].keyCode){return false}}scl[scl.length]=sc;return true},handleShortcut:function(e){var i,s,o;if(!e.altKey&&!e.ctrlKey)return false;s=this
 .shortcuts;for(i=0;i<s.length;i++){o=s[i];if(o.alt==e.altKey&&o.ctrl==e.ctrlKey&&(o.keyCode==e.keyCode||o.charCode==e.charCode)){if(o.cmd&&(e.type=="keydown"||(e.type=="keypress"&&!tinyMCE.isOpera)))tinyMCE.execCommand(o.cmd,o.ui,o.val);tinyMCE.cancelEvent(e);return true}}return false},autoResetDesignMode:function(){if(!tinyMCE.isIE&&this.isHidden()&&tinyMCE.getParam('auto_reset_designmode'))eval('try { this.getDoc().designMode = "On"; this.useCSS = false; } catch(e) {}')},isHidden:function(){var s;if(tinyMCE.isIE)return false;s=this.getSel();return(!s||!s.rangeCount||s.rangeCount==0)},isDirty:function(){return tinyMCE.trim(this.startContent)!=tinyMCE.trim(this.getBody().innerHTML)&&!this.isNotDirty},_mergeElements:function(scmd,pa,ch,override){var st,stc,className,n;if(scmd=="removeformat"){pa.className="";pa.style.cssText="";ch.className="";ch.style.cssText="";return}st=tinyMCE.parseStyle(tinyMCE.getAttrib(pa,"style"));stc=tinyMCE.parseStyle(tinyMCE.getAttrib(ch,"style"));
 className=tinyMCE.getAttrib(pa,"class");className=tinyMCE.getAttrib(ch,"class");if(override){for(n in st){if(typeof(st[n])=='function')continue;stc[n]=st[n]}}else{for(n in stc){if(typeof(stc[n])=='function')continue;st[n]=stc[n]}}tinyMCE.setAttrib(pa,"style",tinyMCE.serializeStyle(st));tinyMCE.setAttrib(pa,"class",tinyMCE.trim(className));ch.className="";ch.style.cssText="";ch.removeAttribute("class");ch.removeAttribute("style")},_fixRootBlocks:function(){var rb,b,ne,be,nx,bm;rb=tinyMCE.getParam('forced_root_block');if(!rb)return;b=this.getBody();ne=b.firstChild;while(ne){nx=ne.nextSibling;if((ne.nodeType==3&&ne.nodeValue.replace(/\s+/g,'')!='')||(ne.nodeType==1&&!tinyMCE.blockRegExp.test(ne.nodeName))){if(!bm)bm=this.selection.getBookmark();if(!be){be=this.getDoc().createElement(rb);be.appendChild(ne.cloneNode(true));b.replaceChild(be,ne)}else{be.appendChild(ne.cloneNode(true));b.removeChild(ne)}}else be=null;ne=nx}if(bm)this.selection.moveToBookmark(bm)},_fixTrailingNbsp:f
 unction(){var s=this.selection,e=s.getFocusElement(),bm,v;if(e&&tinyMCE.blockRegExp.test(e.nodeName)&&e.firstChild){v=e.firstChild.nodeValue;if(v&&v.length>1&&/(^\u00a0|\u00a0$)/.test(v)){e.firstChild.nodeValue=v.replace(/(^\u00a0|\u00a0$)/,'');s.selectNode(e.firstChild,true,false,false);}}},_setUseCSS:function(b){var d=this.getDoc();try{d.execCommand("useCSS",false,!b)}catch(ex){}try{d.execCommand("styleWithCSS",false,b)}catch(ex){}if(!tinyMCE.getParam("table_inline_editing"))try{d.execCommand('enableInlineTableEditing',false,"false")}catch(ex){}if(!tinyMCE.getParam("object_resizing"))try{d.execCommand('enableObjectResizing',false,"false")}catch(ex){}},execCommand:function(command,user_interface,value){var i,x,z,align,img,div,doc=this.getDoc(),win=this.getWin(),focusElm=this.getFocusElement();if(!new RegExp('mceStartTyping|mceEndTyping|mceBeginUndoLevel|mceEndUndoLevel|mceAddUndoLevel','gi').test(command))this.undoBookmark=null;if(!tinyMCE.isIE&&!this.useCSS){this._setUseCS
 S(false);this.useCSS=true}this.contentDocument=doc;if(!/mceStartTyping|mceEndTyping/.test(command)){if(tinyMCE.execCommandCallback(this,'execcommand_callback','execCommand',this.editorId,this.getBody(),command,user_interface,value))return}if(focusElm&&focusElm.nodeName=="IMG"){align=focusElm.getAttribute('align');img=command=="JustifyCenter"?focusElm.cloneNode(false):focusElm;switch(command){case"JustifyLeft":if(align=='left'){img.setAttribute('align','');img.removeAttribute('align')}else img.setAttribute('align','left');div=focusElm.parentNode;if(div&&div.nodeName=="DIV"&&div.childNodes.length==1&&div.parentNode)div.parentNode.replaceChild(img,div);this.selection.selectNode(img);this.repaint();tinyMCE.triggerNodeChange();return;case"JustifyCenter":img.setAttribute('align','');img.removeAttribute('align');div=tinyMCE.getParentElement(focusElm,"div");if(div&&div.style.textAlign=="center"){if(div.nodeName=="DIV"&&div.childNodes.length==1&&div.parentNode)div.parentNode.replaceC
 hild(img,div)}else{div=this.getDoc().createElement("div");div.style.textAlign='center';div.appendChild(img);focusElm.parentNode.replaceChild(div,focusElm)}this.selection.selectNode(img);this.repaint();tinyMCE.triggerNodeChange();return;case"JustifyRight":if(align=='right'){img.setAttribute('align','');img.removeAttribute('align')}else img.setAttribute('align','right');div=focusElm.parentNode;if(div&&div.nodeName=="DIV"&&div.childNodes.length==1&&div.parentNode)div.parentNode.replaceChild(img,div);this.selection.selectNode(img);this.repaint();tinyMCE.triggerNodeChange();return}}if(tinyMCE.settings.force_br_newlines){var alignValue="";if(doc.selection.type!="Control"){switch(command){case"JustifyLeft":alignValue="left";break;case"JustifyCenter":alignValue="center";break;case"JustifyFull":alignValue="justify";break;case"JustifyRight":alignValue="right";break}if(alignValue!==''){var rng=doc.selection.createRange();if((divElm=tinyMCE.getParentElement(rng.parentElement(),"div"))!=
 null)divElm.setAttribute("align",alignValue);else if(rng.pasteHTML&&rng.htmlText.length>0)rng.pasteHTML('<div align="'+alignValue+'">'+rng.htmlText+"</div>");tinyMCE.triggerNodeChange();return}}}switch(command){case"mceRepaint":this.repaint();return true;case"JustifyLeft":case"JustifyCenter":case"JustifyFull":case"JustifyRight":var el=tinyMCE.getParentNode(focusElm,function(n){return tinyMCE.getAttrib(n,'align')});if(el){el.setAttribute('align','');el.removeAttribute('align')}else this.getDoc().execCommand(command,user_interface,value);tinyMCE.triggerNodeChange();return true;case"unlink":if(tinyMCE.isGecko&&this.getSel().isCollapsed){focusElm=tinyMCE.getParentElement(focusElm,'A');if(focusElm)this.selection.selectNode(focusElm,false)}this.getDoc().execCommand(command,user_interface,value);tinyMCE.isGecko&&this.getSel().collapseToEnd();tinyMCE.triggerNodeChange();return true;case"InsertUnorderedList":case"InsertOrderedList":this.getDoc().execCommand(command,user_interface,val
 ue);tinyMCE.triggerNodeChange();break;case"Strikethrough":this.getDoc().execCommand(command,user_interface,value);tinyMCE.triggerNodeChange();break;case"mceSelectNode":this.selection.selectNode(value);tinyMCE.triggerNodeChange();tinyMCE.selectedNode=value;break;case"FormatBlock":if(value==null||value==''){var elm=tinyMCE.getParentElement(this.getFocusElement(),"p,div,h1,h2,h3,h4,h5,h6,pre,address,blockquote,dt,dl,dd,samp");if(elm)this.execCommand("mceRemoveNode",false,elm)}else{if(!this.cleanup.isValid(value))return true;if(tinyMCE.isGecko&&new RegExp('<(div|blockquote|code|dt|dd|dl|samp)>','gi').test(value))value=value.replace(/[^a-z]/gi,'');if(tinyMCE.isIE&&new RegExp('blockquote|code|samp','gi').test(value)){var b=this.selection.getBookmark();this.getDoc().execCommand("FormatBlock",false,'<p>');tinyMCE.renameElement(tinyMCE.getParentBlockElement(this.getFocusElement()),value);this.selection.moveToBookmark(b)}else this.getDoc().execCommand("FormatBlock",false,value)}tinyMC
 E.triggerNodeChange();break;case"mceRemoveNode":if(!value)value=tinyMCE.getParentElement(this.getFocusElement());if(tinyMCE.isIE){value.outerHTML=value.innerHTML}else{var rng=value.ownerDocument.createRange();rng.setStartBefore(value);rng.setEndAfter(value);rng.deleteContents();rng.insertNode(rng.createContextualFragment(value.innerHTML))}tinyMCE.triggerNodeChange();break;case"mceSelectNodeDepth":var parentNode=this.getFocusElement();for(i=0;parentNode;i++){if(parentNode.nodeName.toLowerCase()=="body")break;if(parentNode.nodeName.toLowerCase()=="#text"){i--;parentNode=parentNode.parentNode;continue}if(i==value){this.selection.selectNode(parentNode,false);tinyMCE.triggerNodeChange();tinyMCE.selectedNode=parentNode;return}parentNode=parentNode.parentNode}break;case"mceSetStyleInfo":case"SetStyleInfo":var rng=this.getRng();var sel=this.getSel();var scmd=value.command;var sname=value.name;var svalue=value.value==null?'':value.value;var wrapper=value.wrapper?value.wrapper:"span";
 var parentElm=null;var invalidRe=new RegExp("^BODY|HTML$","g");var invalidParentsRe=tinyMCE.settings.merge_styles_invalid_parents!==''?new RegExp(tinyMCE.settings.merge_styles_invalid_parents,"gi"):null;if(tinyMCE.isIE){if(rng.item)parentElm=rng.item(0);else{var pelm=rng.parentElement();var prng=doc.selection.createRange();prng.moveToElementText(pelm);if(rng.htmlText==prng.htmlText||rng.boundingWidth==0){if(invalidParentsRe==null||!invalidParentsRe.test(pelm.nodeName))parentElm=pelm}}}else{var felm=this.getFocusElement();if(sel.isCollapsed||(new RegExp('td|tr|tbody|table|img','gi').test(felm.nodeName)&&sel.anchorNode==felm.parentNode))parentElm=felm}if(parentElm&&!invalidRe.test(parentElm.nodeName)){if(scmd=="setstyle")tinyMCE.setStyleAttrib(parentElm,sname,svalue);if(scmd=="setattrib")tinyMCE.setAttrib(parentElm,sname,svalue);if(scmd=="removeformat"){parentElm.style.cssText='';tinyMCE.setAttrib(parentElm,'class','')}var ch=tinyMCE.getNodeTree(parentElm,[],1);for(z=0;z<ch.le
 ngth;z++){if(ch[z]==parentElm)continue;if(scmd=="setstyle")tinyMCE.setStyleAttrib(ch[z],sname,'');if(scmd=="setattrib")tinyMCE.setAttrib(ch[z],sname,'');if(scmd=="removeformat"){ch[z].style.cssText='';tinyMCE.setAttrib(ch[z],'class','')}}}else{this._setUseCSS(false);doc.execCommand("FontName",false,"#mce_temp_font#");var elementArray=tinyMCE.getElementsByAttributeValue(this.getBody(),"font","face","#mce_temp_font#");for(x=0;x<elementArray.length;x++){elm=elementArray[x];if(elm){var spanElm=doc.createElement(wrapper);if(scmd=="setstyle")tinyMCE.setStyleAttrib(spanElm,sname,svalue);if(scmd=="setattrib")tinyMCE.setAttrib(spanElm,sname,svalue);if(scmd=="removeformat"){spanElm.style.cssText='';tinyMCE.setAttrib(spanElm,'class','')}if(elm.hasChildNodes()){for(i=0;i<elm.childNodes.length;i++)spanElm.appendChild(elm.childNodes[i].cloneNode(true))}spanElm.setAttribute("mce_new","true");elm.parentNode.replaceChild(spanElm,elm);var ch=tinyMCE.getNodeTree(spanElm,[],1);for(z=0;z<ch.leng
 th;z++){if(ch[z]==spanElm)continue;if(scmd=="setstyle")tinyMCE.setStyleAttrib(ch[z],sname,'');if(scmd=="setattrib")tinyMCE.setAttrib(ch[z],sname,'');if(scmd=="removeformat"){ch[z].style.cssText='';tinyMCE.setAttrib(ch[z],'class','')}}}}}var nodes=doc.getElementsByTagName(wrapper);for(i=nodes.length-1;i>=0;i--){var elm=nodes[i];var isNew=tinyMCE.getAttrib(elm,"mce_new")=="true";elm.removeAttribute("mce_new");if(elm.childNodes&&elm.childNodes.length==1&&elm.childNodes[0].nodeType==1){this._mergeElements(scmd,elm,elm.childNodes[0],isNew);continue}if(elm.parentNode.childNodes.length==1&&!invalidRe.test(elm.nodeName)&&!invalidRe.test(elm.parentNode.nodeName)){if(invalidParentsRe==null||!invalidParentsRe.test(elm.parentNode.nodeName))this._mergeElements(scmd,elm.parentNode,elm,false)}}var nodes=doc.getElementsByTagName(wrapper);for(i=nodes.length-1;i>=0;i--){var elm=nodes[i],isEmpty=true;var tmp=doc.createElement("body");tmp.appendChild(elm.cloneNode(false));tmp.innerHTML=tmp.inne
 rHTML.replace(new RegExp('style=""|class=""','gi'),'');if(new RegExp('<span>','gi').test(tmp.innerHTML)){for(x=0;x<elm.childNodes.length;x++){if(elm.parentNode!=null)elm.parentNode.insertBefore(elm.childNodes[x].cloneNode(true),elm)}elm.parentNode.removeChild(elm)}}if(scmd=="removeformat")tinyMCE.handleVisualAid(this.getBody(),true,this.visualAid,this);tinyMCE.triggerNodeChange();break;case"FontName":if(value==null){var s=this.getSel();if(tinyMCE.isGecko&&s.isCollapsed){var f=tinyMCE.getParentElement(this.getFocusElement(),"font");if(f!=null)this.selection.selectNode(f,false)}this.getDoc().execCommand("RemoveFormat",false,null);if(f!=null&&tinyMCE.isGecko){var r=this.getRng().cloneRange();r.collapse(true);s.removeAllRanges();s.addRange(r)}}else this.getDoc().execCommand('FontName',false,value);if(tinyMCE.isGecko)window.setTimeout('tinyMCE.triggerNodeChange(false);',1);return;case"FontSize":this.getDoc().execCommand('FontSize',false,value);if(tinyMCE.isGecko)window.setTimeout
 ('tinyMCE.triggerNodeChange(false);',1);return;case"forecolor":value=value==null?this.foreColor:value;value=tinyMCE.trim(value);value=value.charAt(0)!='#'?(isNaN('0x'+value)?value:'#'+value):value;this.foreColor=value;this.getDoc().execCommand('forecolor',false,value);break;case"HiliteColor":value=value==null?this.backColor:value;value=tinyMCE.trim(value);value=value.charAt(0)!='#'?(isNaN('0x'+value)?value:'#'+value):value;this.backColor=value;if(tinyMCE.isGecko||tinyMCE.isOpera){this._setUseCSS(true);this.getDoc().execCommand('hilitecolor',false,value);this._setUseCSS(false)}else this.getDoc().execCommand('BackColor',false,value);break;case"Cut":case"Copy":case"Paste":var cmdFailed=false;eval('try {this.getDoc().execCommand(command, user_interface, value);} catch (e) {cmdFailed = true;}');if(tinyMCE.isOpera&&cmdFailed)alert('Currently not supported by your browser, use keyboard shortcuts instead.');if(tinyMCE.isGecko&&cmdFailed){if(confirm(tinyMCE.entityDecode(tinyMCE.getLa
 ng('lang_clipboard_msg'))))window.open('http://www.mozilla.org/editor/midasdemo/securityprefs.html','mceExternal');return}else tinyMCE.triggerNodeChange();break;case"mceSetContent":if(!value)value="";value=tinyMCE.storeAwayURLs(value);value=tinyMCE._customCleanup(this,"insert_to_editor",value);if(this.getBody().nodeName=='BODY')tinyMCE._setHTML(doc,value);else this.getBody().innerHTML=value;tinyMCE.setInnerHTML(this.getBody(),tinyMCE._cleanupHTML(this,doc,this.settings,this.getBody(),false,false,false,true));tinyMCE.convertAllRelativeURLs(this.getBody());tinyMCE._removeInternal(this.getBody());if(tinyMCE.getParam("convert_fonts_to_spans"))tinyMCE.convertSpansToFonts(doc);tinyMCE.handleVisualAid(this.getBody(),true,this.visualAid,this);tinyMCE._setEventsEnabled(this.getBody(),false);this._addBogusBR();return true;case"mceCleanup":var b=this.selection.getBookmark();tinyMCE._setHTML(this.contentDocument,this.getBody().innerHTML);tinyMCE.setInnerHTML(this.getBody(),tinyMCE._clea
 nupHTML(this,this.contentDocument,this.settings,this.getBody(),this.visualAid));tinyMCE.convertAllRelativeURLs(doc.body);if(tinyMCE.getParam("convert_fonts_to_spans"))tinyMCE.convertSpansToFonts(doc);tinyMCE.handleVisualAid(this.getBody(),true,this.visualAid,this);tinyMCE._setEventsEnabled(this.getBody(),false);this._addBogusBR();this.repaint();this.selection.moveToBookmark(b);tinyMCE.triggerNodeChange();break;case"mceReplaceContent":if(!value)value='';this.getWin().focus();var selectedText="";if(tinyMCE.isIE){var rng=doc.selection.createRange();selectedText=rng.text}else selectedText=this.getSel().toString();if(selectedText.length>0){value=tinyMCE.replaceVar(value,"selection",selectedText);tinyMCE.execCommand('mceInsertContent',false,value)}this._addBogusBR();tinyMCE.triggerNodeChange();break;case"mceSetAttribute":if(typeof(value)=='object'){var targetElms=(typeof(value.targets)=="undefined")?"p,img,span,div,td,h1,h2,h3,h4,h5,h6,pre,address":value.targets;var targetNode=tin
 yMCE.getParentElement(this.getFocusElement(),targetElms);if(targetNode){targetNode.setAttribute(value.name,value.value);tinyMCE.triggerNodeChange()}}break;case"mceSetCSSClass":this.execCommand("mceSetStyleInfo",false,{command:"setattrib",name:"class",value:value});break;case"mceInsertRawHTML":var key='tiny_mce_marker';this.execCommand('mceBeginUndoLevel');this.execCommand('mceInsertContent',false,key);var scrollX=this.getBody().scrollLeft+this.getDoc().documentElement.scrollLeft;var scrollY=this.getBody().scrollTop+this.getDoc().documentElement.scrollTop;var html=this.getBody().innerHTML;if((pos=html.indexOf(key))!=-1)tinyMCE.setInnerHTML(this.getBody(),html.substring(0,pos)+value+html.substring(pos+key.length));this.contentWindow.scrollTo(scrollX,scrollY);this.execCommand('mceEndUndoLevel');break;case"mceInsertContent":if(!value)value='';var insertHTMLFailed=false;if(tinyMCE.isGecko||tinyMCE.isOpera){try{if(value.indexOf('<')==-1&&!value.match(/(&| |<|>)/g)
 ){var r=this.getRng();var n=this.getDoc().createTextNode(tinyMCE.entityDecode(value));var s=this.getSel();var r2=r.cloneRange();s.removeAllRanges();r.deleteContents();r.insertNode(n);r2.selectNode(n);r2.collapse(false);s.removeAllRanges();s.addRange(r2)}else{value=tinyMCE.fixGeckoBaseHREFBug(1,this.getDoc(),value);this.getDoc().execCommand('inserthtml',false,value);tinyMCE.fixGeckoBaseHREFBug(2,this.getDoc(),value)}}catch(ex){insertHTMLFailed=true}if(!insertHTMLFailed){tinyMCE.triggerNodeChange();return}}if(!tinyMCE.isIE){var isHTML=value.indexOf('<')!=-1;var sel=this.getSel();var rng=this.getRng();if(isHTML){if(tinyMCE.isSafari){var tmpRng=this.getDoc().createRange();tmpRng.setStart(this.getBody(),0);tmpRng.setEnd(this.getBody(),0);value=tmpRng.createContextualFragment(value)}else value=rng.createContextualFragment(value)}else{value=doc.createTextNode(tinyMCE.entityDecode(value))}if(tinyMCE.isSafari&&!isHTML){this.execCommand('InsertText',false,value.nodeValue);tinyMCE.trig
 gerNodeChange();return true}else if(tinyMCE.isSafari&&isHTML){rng.deleteContents();rng.insertNode(value);tinyMCE.triggerNodeChange();return true}rng.deleteContents();if(rng.startContainer.nodeType==3){var node=rng.startContainer.splitText(rng.startOffset);node.parentNode.insertBefore(value,node)}else rng.insertNode(value);if(!isHTML){sel.selectAllChildren(doc.body);sel.removeAllRanges();var rng=doc.createRange();rng.selectNode(value);rng.collapse(false);sel.addRange(rng)}else rng.collapse(false);tinyMCE.fixGeckoBaseHREFBug(2,this.getDoc(),value)}else{var rng=doc.selection.createRange(),tmpRng=null;var c=value.indexOf('<!--')!=-1;if(c)value=tinyMCE.uniqueTag+value;if(rng.item)rng.item(0).outerHTML=value;else rng.pasteHTML(value);if(c){var e=this.getDoc().getElementById('mceTMPElement');e.parentNode.removeChild(e)}}tinyMCE.execCommand("mceAddUndoLevel");tinyMCE.triggerNodeChange();break;case"mceStartTyping":if(tinyMCE.settings.custom_undo_redo&&this.undoRedo.typingUndoIndex==-
 1){this.undoRedo.typingUndoIndex=this.undoRedo.undoIndex;tinyMCE.typingUndoIndex=tinyMCE.undoIndex;this.execCommand('mceAddUndoLevel')}break;case"mceEndTyping":if(tinyMCE.settings.custom_undo_redo&&this.undoRedo.typingUndoIndex!=-1){this.execCommand('mceAddUndoLevel');this.undoRedo.typingUndoIndex=-1}tinyMCE.typingUndoIndex=-1;break;case"mceBeginUndoLevel":this.undoRedoLevel=false;break;case"mceEndUndoLevel":this.undoRedoLevel=true;this.execCommand('mceAddUndoLevel');break;case"mceAddUndoLevel":if(tinyMCE.settings.custom_undo_redo&&this.undoRedoLevel){if(this.undoRedo.add())tinyMCE.triggerNodeChange(false)}break;case"Undo":if(tinyMCE.settings.custom_undo_redo){tinyMCE.execCommand("mceEndTyping");this.undoRedo.undo();tinyMCE.triggerNodeChange()}else this.getDoc().execCommand(command,user_interface,value);break;case"Redo":if(tinyMCE.settings.custom_undo_redo){tinyMCE.execCommand("mceEndTyping");this.undoRedo.redo();tinyMCE.triggerNodeChange()}else this.getDoc().execCommand(com
 mand,user_interface,value);break;case"mceToggleVisualAid":this.visualAid=!this.visualAid;tinyMCE.handleVisualAid(this.getBody(),true,this.visualAid,this);tinyMCE.triggerNodeChange();break;case"Indent":this.getDoc().execCommand(command,user_interface,value);tinyMCE.triggerNodeChange();if(tinyMCE.isIE){var n=tinyMCE.getParentElement(this.getFocusElement(),"blockquote");do{if(n&&n.nodeName=="BLOCKQUOTE"){n.removeAttribute("dir");n.removeAttribute("style")}}while(n!=null&&(n=n.parentNode)!=null)}break;case"RemoveFormat":case"removeformat":var text=this.selection.getSelectedText();if(tinyMCE.isOpera){this.getDoc().execCommand("RemoveFormat",false,null);return}if(tinyMCE.isIE){try{var rng=doc.selection.createRange();rng.execCommand("RemoveFormat",false,null)}catch(e){}this.execCommand("mceSetStyleInfo",false,{command:"removeformat"})}else{this.getDoc().execCommand(command,user_interface,value);this.execCommand("mceSetStyleInfo",false,{command:"removeformat"})}if(text.length==0)thi
 s.execCommand("mceSetCSSClass",false,"");tinyMCE.triggerNodeChange();break;default:this.getDoc().execCommand(command,user_interface,value);if(tinyMCE.isGecko)window.setTimeout('tinyMCE.triggerNodeChange(false);',1);else tinyMCE.triggerNodeChange()}if(command!="mceAddUndoLevel"&&command!="Undo"&&command!="Redo"&&command!="mceStartTyping"&&command!="mceEndTyping")tinyMCE.execCommand("mceAddUndoLevel")},queryCommandValue:function(c){try{return this.getDoc().queryCommandValue(c)}catch(e){return null}},queryCommandState:function(c){return this.getDoc().queryCommandState(c)},_addBogusBR:function(){var b=this.getBody();if(tinyMCE.isGecko&&!b.hasChildNodes())b.innerHTML='<br _moz_editor_bogus_node="TRUE" />'},_onAdd:function(replace_element,form_element_name,target_document){var hc,th,tos,editorTemplate,targetDoc,deltaWidth,deltaHeight,html,rng,fragment;var dynamicIFrame,tElm,doc,parentElm;th=this.settings.theme;tos=tinyMCE.themes[th];targetDoc=target_document?target_document:docume
 nt;this.targetDoc=targetDoc;tinyMCE.themeURL=tinyMCE.baseURL+"/themes/"+this.settings.theme;this.settings.themeurl=tinyMCE.themeURL;if(!replace_element){alert("Error: Could not find the target element.");return false}if(tos.getEditorTemplate)editorTemplate=tos.getEditorTemplate(this.settings,this.editorId);deltaWidth=editorTemplate.delta_width?editorTemplate.delta_width:0;deltaHeight=editorTemplate.delta_height?editorTemplate.delta_height:0;html='<span id="'+this.editorId+'_parent" class="mceEditorContainer">'+editorTemplate.html;html=tinyMCE.replaceVar(html,"editor_id",this.editorId);if(!this.settings.default_document)this.settings.default_document=tinyMCE.baseURL+"/blank.htm";this.settings.old_width=this.settings.width;this.settings.old_height=this.settings.height;if(this.settings.width==-1)this.settings.width=replace_element.offsetWidth;if(this.settings.height==-1)this.settings.height=replace_element.offsetHeight;if(this.settings.width==0)this.settings.width=replace_eleme
 nt.style.width;if(this.settings.height==0)this.settings.height=replace_element.style.height;if(this.settings.width==0)this.settings.width=320;if(this.settings.height==0)this.settings.height=240;this.settings.area_width=parseInt(this.settings.width);this.settings.area_height=parseInt(this.settings.height);this.settings.area_width+=deltaWidth;this.settings.area_height+=deltaHeight;this.settings.width_style=""+this.settings.width;this.settings.height_style=""+this.settings.height;if((""+this.settings.width).indexOf('%')!=-1)this.settings.area_width="100%";else this.settings.width_style+='px';if((""+this.settings.height).indexOf('%')!=-1)this.settings.area_height="100%";else this.settings.height_style+='px';if((""+replace_element.style.width).indexOf('%')!=-1){this.settings.width=replace_element.style.width;this.settings.area_width="100%";this.settings.width_style="100%"}if((""+replace_element.style.height).indexOf('%')!=-1){this.settings.height=replace_element.style.height;this
 .settings.area_height="100%";this.settings.height_style="100%"}html=tinyMCE.applyTemplate(html);this.settings.width=this.settings.old_width;this.settings.height=this.settings.old_height;this.visualAid=this.settings.visual;this.formTargetElementId=form_element_name;if(replace_element.nodeName=="TEXTAREA"||replace_element.nodeName=="INPUT")this.startContent=replace_element.value;else this.startContent=replace_element.innerHTML;if(replace_element.nodeName!="TEXTAREA"&&replace_element.nodeName!="INPUT"){this.oldTargetElement=replace_element;hc='<input type="hidden" id="'+form_element_name+'" name="'+form_element_name+'" />';this.oldTargetDisplay=tinyMCE.getStyle(this.oldTargetElement,'display','inline');this.oldTargetElement.style.display="none";html+='</span>';if(tinyMCE.isGecko)html=hc+html;else html+=hc;if(tinyMCE.isGecko){rng=replace_element.ownerDocument.createRange();rng.setStartBefore(replace_element);fragment=rng.createContextualFragment(html);tinyMCE.insertAfter(fragmen
 t,replace_element)}else replace_element.insertAdjacentHTML("beforeBegin",html)}else{html+='</span>';this.oldTargetElement=replace_element;this.oldTargetDisplay=tinyMCE.getStyle(this.oldTargetElement,'display','inline');this.oldTargetElement.style.display="none";if(tinyMCE.isGecko){rng=replace_element.ownerDocument.createRange();rng.setStartBefore(replace_element);fragment=rng.createContextualFragment(html);tinyMCE.insertAfter(fragment,replace_element)}else replace_element.insertAdjacentHTML("beforeBegin",html)}dynamicIFrame=false;tElm=targetDoc.getElementById(this.editorId);if(!tinyMCE.isIE){if(tElm&&(tElm.nodeName=="SPAN"||tElm.nodeName=="span")){tElm=tinyMCE._createIFrame(tElm,targetDoc);dynamicIFrame=true}this.targetElement=tElm;this.iframeElement=tElm;this.contentDocument=tElm.contentDocument;this.contentWindow=tElm.contentWindow;}else{if(tElm&&tElm.nodeName=="SPAN")tElm=tinyMCE._createIFrame(tElm,targetDoc,targetDoc.parentWindow);else tElm=targetDoc.frames[this.editorId
 ];this.targetElement=tElm;this.iframeElement=targetDoc.getElementById(this.editorId);if(tinyMCE.isOpera){this.contentDocument=this.iframeElement.contentDocument;this.contentWindow=this.iframeElement.contentWindow;dynamicIFrame=true}else{this.contentDocument=tElm.window.document;this.contentWindow=tElm.window}this.getDoc().designMode="on"}doc=this.contentDocument;if(dynamicIFrame){html=tinyMCE.getParam('doctype')+'<html><head xmlns="http://www.w3.org/1999/xhtml"><base href="'+tinyMCE.settings.base_href+'" /><title>blank_page</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body class="mceContentBody"></body></html>';try{if(!this.isHidden())this.getDoc().designMode="on";doc.open();doc.write(html);doc.close()}catch(e){this.getDoc().location.href=tinyMCE.baseURL+"/blank.htm"}}if(tinyMCE.isIE)window.setTimeout("tinyMCE.addEventHandlers(tinyMCE.instances[\""+this.editorId+"\"]);",1);parentElm=this.targetDoc.getElementById(this.editorId+'_parent');t
 his.formElement=tinyMCE.isGecko?parentElm.previousSibling:parentElm.nextSibling;tinyMCE.setupContent(this.editorId,true);return true},setBaseHREF:function(u){var h,b,d,nl;d=this.getDoc();nl=d.getElementsByTagName("base");b=nl.length>0?nl[0]:null;if(!b){nl=d.getElementsByTagName("head");h=nl.length>0?nl[0]:null;b=d.createElement("base");b.setAttribute('href',u);h.appendChild(b)}else{if(u==''||u==null)b.parentNode.removeChild(b);else b.setAttribute('href',u)}},getHTML:function(r){var h,d=this.getDoc(),b=this.getBody();if(r)return b.innerHTML;h=tinyMCE._cleanupHTML(this,d,this.settings,b,false,true,false,true);if(tinyMCE.getParam("convert_fonts_to_spans"))tinyMCE.convertSpansToFonts(d);return h},setHTML:function(h){this.execCommand('mceSetContent',false,h);this.repaint()},getFocusElement:function(){return this.selection.getFocusElement()},getSel:function(){return this.selection.getSel()},getRng:function(){return this.selection.getRng()},triggerSave:function(skip_cleanup,skip_ca
 llback){var e,nl=[],i,s,content,htm;if(!this.enabled)return;this.switchSettings();s=tinyMCE.settings;if(tinyMCE.isRealIE){e=this.iframeElement;do{if(e.style&&e.style.display=='none'){e.style.display='block';nl[nl.length]={elm:e,type:'style'}}if(e.style&&s.hidden_tab_class.length>0&&e.className.indexOf(s.hidden_tab_class)!=-1){e.className=s.display_tab_class;nl[nl.length]={elm:e,type:'class'}}}while((e=e.parentNode)!=null)}tinyMCE.settings.preformatted=false;if(typeof(skip_cleanup)=="undefined")skip_cleanup=false;if(typeof(skip_callback)=="undefined")skip_callback=false;tinyMCE._setHTML(this.getDoc(),this.getBody().innerHTML);if(this.settings.cleanup==false){tinyMCE.handleVisualAid(this.getBody(),true,false,this);tinyMCE._setEventsEnabled(this.getBody(),true)}tinyMCE._customCleanup(this,"submit_content_dom",this.contentWindow.document.body);htm=skip_cleanup?this.getBody().innerHTML:tinyMCE._cleanupHTML(this,this.getDoc(),this.settings,this.getBody(),tinyMCE.visualAid,true,tru
 e);htm=tinyMCE._customCleanup(this,"submit_content",htm);if(!skip_callback&&tinyMCE.settings.save_callback!=='')content=tinyMCE.resolveDots(tinyMCE.settings.save_callback,window)(this.formTargetElementId,htm,this.getBody());if((typeof(content)!="undefined")&&content!=null)htm=content;htm=tinyMCE.regexpReplace(htm,"(","(","gi");htm=tinyMCE.regexpReplace(htm,")",")","gi");htm=tinyMCE.regexpReplace(htm,";",";","gi");htm=tinyMCE.regexpReplace(htm,""",""","gi");htm=tinyMCE.regexpReplace(htm,"^","^","gi");if(this.formElement)this.formElement.value=htm;if(tinyMCE.isSafari&&this.formElement)this.formElement.innerText=htm;for(i=0;i<nl.length;i++){if(nl[i].type=='style')nl[i].elm.style.display='none';else nl[i].elm.className=s.hidden_tab_class}}};tinyMCE.add(TinyMCE_Engine,{cleanupHTMLCode:function(s){s=s.replace(new RegExp('<p \\/>','gi'),'<p> </p>');s=s.replace(new RegExp('<p>\\s*<\\/p>','gi'),'<p> </p>');s=s.replace(new RegExp('<br>\\s*<\\/br>','g
 i'),'<br />');s=s.replace(new RegExp('<(h[1-6]|p|div|address|pre|form|table|li|ol|ul|td|b|font|em|strong|i|strike|u|span|a|ul|ol|li|blockquote)([a-z]*)([^\\\\|>]*)\\/>','gi'),'<$1$2$3></$1$2>');s=s.replace(new RegExp('\\s+></','gi'),'></');s=s.replace(new RegExp('<(img|br|hr)([^>]*)><\\/(img|br|hr)>','gi'),'<$1$2 />');if(tinyMCE.isIE)s=s.replace(new RegExp('<p><hr \\/><\\/p>','gi'),"<hr>");if(tinyMCE.isIE)s=s.replace(/<!(\s*)\/>/g,'');return s},parseStyle:function(str){var ar=[],st,i,re,pa;if(str==null)return ar;st=str.split(';');tinyMCE.clearArray(ar);for(i=0;i<st.length;i++){if(st[i]=='')continue;re=new RegExp('^\\s*([^:]*):\\s*(.*)\\s*$');pa=st[i].replace(re,'$1||$2').split('||');if(pa.length==2)ar[pa[0].toLowerCase()]=pa[1]}return ar},compressStyle:function(ar,pr,sf,res){var box=[],i,a;box[0]=ar[pr+'-top'+sf];box[1]=ar[pr+'-left'+sf];box[2]=ar[pr+'-right'+sf];box[3]=ar[pr+'-bottom'+sf];for(i=0;i<box.length;i++){if(box[i]==null)return;if(i&&box[i]!=box[i-1])return}ar[res]
 =box[0];ar[pr+'-top'+sf]=null;ar[pr+'-left'+sf]=null;ar[pr+'-right'+sf]=null;ar[pr+'-bottom'+sf]=null},serializeStyle:function(ar){var str="",key,val,m;tinyMCE.compressStyle(ar,"border","","border");tinyMCE.compressStyle(ar,"border","-width","border-width");tinyMCE.compressStyle(ar,"border","-color","border-color");tinyMCE.compressStyle(ar,"border","-style","border-style");tinyMCE.compressStyle(ar,"padding","","padding");tinyMCE.compressStyle(ar,"margin","","margin");for(key in ar){val=ar[key];if(typeof(val)=='function')continue;if(key.indexOf('mso-')==0)continue;if(val!=null&&val!==''){val=''+val;val=val.replace(new RegExp("url\\(\\'?([^\\']*)\\'?\\)",'gi'),"url('$1')");if(val.indexOf('url(')!=-1&&tinyMCE.getParam('convert_urls')){m=new RegExp("url\\('(.*?)'\\)").exec(val);if(m.length>1)val="url('"+eval(tinyMCE.getParam('urlconverter_callback')+"(m[1], null, true);")+"')"}if(tinyMCE.getParam("force_hex_style_colors"))val=tinyMCE.convertRGBToHex(val,true);val=val.replace(/\"
 /g,'\'');if(val!="url('')")str+=key.toLowerCase()+": "+val+"; "}}if(new RegExp('; $').test(str))str=str.substring(0,str.length-2);return str},convertRGBToHex:function(s,k){var re,rgb;if(s.toLowerCase().indexOf('rgb')!=-1){re=new RegExp("(.*?)rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)(.*?)","gi");rgb=s.replace(re,"$1,$2,$3,$4,$5").split(',');if(rgb.length==5){r=parseInt(rgb[1]).toString(16);g=parseInt(rgb[2]).toString(16);b=parseInt(rgb[3]).toString(16);r=r.length==1?'0'+r:r;g=g.length==1?'0'+g:g;b=b.length==1?'0'+b:b;s="#"+r+g+b;if(k)s=rgb[0]+s+rgb[4]}}return s},convertHexToRGB:function(s){if(s.indexOf('#')!=-1){s=s.replace(new RegExp('[^0-9A-F]','gi'),'');return"rgb("+parseInt(s.substring(0,2),16)+","+parseInt(s.substring(2,4),16)+","+parseInt(s.substring(4,6),16)+")"}return s},convertSpansToFonts:function(doc){var s,i,size,fSize,x,fFace,fColor,sizes=tinyMCE.getParam('font_size_style_values').replace(/\s+/,'').split(',');s=tinyMCE.selectElements(doc,'s
 pan,font');for(i=0;i<s.length;i++){size=tinyMCE.trim(s[i].style.fontSize).toLowerCase();fSize=0;for(x=0;x<sizes.length;x++){if(sizes[x]==size){fSize=x+1;break}}if(fSize>0){tinyMCE.setAttrib(s[i],'size',fSize);s[i].style.fontSize=''}fFace=s[i].style.fontFamily;if(fFace!=null&&fFace!==''){tinyMCE.setAttrib(s[i],'face',fFace);s[i].style.fontFamily=''}fColor=s[i].style.color;if(fColor!=null&&fColor!==''){tinyMCE.setAttrib(s[i],'color',tinyMCE.convertRGBToHex(fColor));s[i].style.color=''}}},convertFontsToSpans:function(doc){var fsClasses,s,i,fSize,fFace,fColor,sizes=tinyMCE.getParam('font_size_style_values').replace(/\s+/,'').split(',');fsClasses=tinyMCE.getParam('font_size_classes');if(fsClasses!=='')fsClasses=fsClasses.replace(/\s+/,'').split(',');else fsClasses=null;s=tinyMCE.selectElements(doc,'span,font');for(i=0;i<s.length;i++){fSize=tinyMCE.getAttrib(s[i],'size');fFace=tinyMCE.getAttrib(s[i],'face');fColor=tinyMCE.getAttrib(s[i],'color');if(fSize!==''){fSize=parseInt(fSize
 );if(fSize>0&&fSize<8){if(fsClasses!=null)tinyMCE.setAttrib(s[i],'class',fsClasses[fSize-1]);else s[i].style.fontSize=sizes[fSize-1]}s[i].removeAttribute('size')}if(fFace!==''){s[i].style.fontFamily=fFace;s[i].removeAttribute('face')}if(fColor!==''){s[i].style.color=fColor;s[i].removeAttribute('color')}}},cleanupAnchors:function(doc){var i,cn,x,an=doc.getElementsByTagName("a");for(i=an.length-1;i>=0;i--){if(tinyMCE.getAttrib(an[i],"name")!==''&&tinyMCE.getAttrib(an[i],"href")==''){cn=an[i].childNodes;for(x=cn.length-1;x>=0;x--)tinyMCE.insertAfter(cn[x],an[i])}}},getContent:function(editor_id){if(typeof(editor_id)!="undefined")tinyMCE.getInstanceById(editor_id).select();if(tinyMCE.selectedInstance)return tinyMCE.selectedInstance.getHTML();return null},_fixListElements:function(d){var nl,x,a=['ol','ul'],i,n,p,r=new RegExp('^(OL|UL)$'),np;for(x=0;x<a.length;x++){nl=d.getElementsByTagName(a[x]);for(i=0;i<nl.length;i++){n=nl[i];p=n.parentNode;if(r.test(p.nodeName)){np=tinyMCE.pre
 vNode(n,'LI');if(!np){np=d.createElement('li');np.innerHTML=' ';np.appendChild(n);p.insertBefore(np,p.firstChild)}else np.appendChild(n)}}}},_fixTables:function(d){var nl,i,n,p,np,x,t;nl=d.getElementsByTagName('table');for(i=0;i<nl.length;i++){n=nl[i];if((p=tinyMCE.getParentElement(n,'p,h1,h2,h3,h4,h5,h6'))!=null){np=p.cloneNode(false);np.removeAttribute('id');t=n;while((n=n.nextSibling))np.appendChild(n);tinyMCE.insertAfter(np,p);tinyMCE.insertAfter(t,p)}}},_cleanupHTML:function(inst,doc,config,elm,visual,on_save,on_submit,inn){var h,d,t1,t2,t3,t4,t5,c,s,nb;if(!tinyMCE.getParam('cleanup'))return elm.innerHTML;on_save=typeof(on_save)=='undefined'?false:on_save;c=inst.cleanup;s=inst.settings;d=c.settings.debug;if(d)t1=new Date().getTime();inst._fixRootBlocks();if(tinyMCE.getParam("convert_fonts_to_spans"))tinyMCE.convertFontsToSpans(doc);if(tinyMCE.getParam("fix_list_elements"))tinyMCE._fixListElements(doc);if(tinyMCE.getParam("fix_table_elements"))tinyMCE._fixTables(doc
 );tinyMCE._customCleanup(inst,on_save?"get_from_editor_dom":"insert_to_editor_dom",doc.body);if(d)t2=new Date().getTime();c.settings.on_save=on_save;c.idCount=0;c.serializationId++;c.serializedNodes=[];c.sourceIndex=-1;if(s.cleanup_serializer=="xml")h=c.serializeNodeAsXML(elm,inn);else h=c.serializeNodeAsHTML(elm,inn);if(d)t3=new Date().getTime();nb=tinyMCE.getParam('entity_encoding')=='numeric'?' ':' ';h=h.replace(/<\/?(body|head|html)[^>]*>/gi,'');h=h.replace(new RegExp(' (rowspan="1"|colspan="1")','g'),'');h=h.replace(/<p><hr \/><\/p>/g,'<hr />');h=h.replace(/<p>( | )<\/p><hr \/><p>( | )<\/p>/g,'<hr />');h=h.replace(/<td>\s*<br \/>\s*<\/td>/g,'<td>'+nb+'</td>');h=h.replace(/<p>\s*<br \/>\s*<\/p>/g,'<p>'+nb+'</p>');h=h.replace(/<br \/>$/,'');h=h.replace(/<br \/><\/p>/g,'</p>');h=h.replace(/<p>\s*( | )\s*<br \/>\s*( | )\s*<\/p>/g,'<p>'+nb+'</p>');h=h.replace(/<p>\s*( | )\s*<br \/>\s*<\/p>/g,'<p>'+nb+'</p>');h=h.rep
 lace(/<p>\s*<br \/>\s* \s*<\/p>/g,'<p>'+nb+'</p>');h=h.replace(new RegExp('<a>(.*?)<\\/a>','g'),'$1');h=h.replace(/<p([^>]*)>\s*<\/p>/g,'<p$1>'+nb+'</p>');if(/^\s*(<br \/>|<p> <\/p>|<p> <\/p>|<p><\/p>)\s*$/.test(h))h='';if(s.preformatted){h=h.replace(/^<pre>/,'');h=h.replace(/<\/pre>$/,'');h='<pre>'+h+'</pre>'}if(tinyMCE.isGecko){h=h.replace(/<br \/>\s*<\/li>/g,'</li>');h=h.replace(/ \s*<\/(dd|dt)>/g,'</$1>');h=h.replace(/<o:p _moz-userdefined="" \/>/g,'');h=h.replace(/<td([^>]*)>\s*<br \/>\s*<\/td>/g,'<td$1>'+nb+'</td>')}if(s.force_br_newlines)h=h.replace(/<p>( | )<\/p>/g,'<br />');h=tinyMCE._customCleanup(inst,on_save?"get_from_editor":"insert_to_editor",h);if(on_save){h=h.replace(new RegExp(' ?(mceItem[a-zA-Z0-9]*|'+s.visual_table_class+')','g'),'');h=h.replace(new RegExp(' ?class=""','g'),'')}if(s.remove_linebreaks&&!c.settings.indent)h=h.replace(/\n|\r/g,' ');if(d)t4=new Date().getTime();if(on_save&&c.settings.indent)h=c.formatHTML(h);if(on
 _submit&&(s.encoding=="xml"||s.encoding=="html"))h=c.xmlEncode(h);if(d)t5=new Date().getTime();if(c.settings.debug)tinyMCE.debug("Cleanup in ms: Pre="+(t2-t1)+", Serialize: "+(t3-t2)+", Post: "+(t4-t3)+", Format: "+(t5-t4)+", Sum: "+(t5-t1)+".");return h}});function TinyMCE_Cleanup(){this.isIE=(navigator.appName=="Microsoft Internet Explorer");this.rules=tinyMCE.clearArray([]);this.settings={indent_elements:'head,table,tbody,thead,tfoot,form,tr,ul,ol,blockquote,object',newline_before_elements:'h1,h2,h3,h4,h5,h6,pre,address,div,ul,ol,li,meta,option,area,title,link,base,script,td',newline_after_elements:'br,hr,p,pre,address,div,ul,ol,meta,option,area,link,base,script',newline_before_after_elements:'html,head,body,table,thead,tbody,tfoot,tr,form,ul,ol,blockquote,p,object,param,hr,div',indent_char:'\t',indent_levels:1,entity_encoding:'raw',valid_elements:'*[*]',entities:'',url_converter:'',invalid_elements:'',verify_html:false};this.vElements=tinyMCE.clearArray([]);this.vElement
 sRe='';this.closeElementsRe=/^(IMG|BR|HR|LINK|META|BASE|INPUT|AREA)$/;this.codeElementsRe=/^(SCRIPT|STYLE)$/;this.serializationId=0;this.mceAttribs={href:'mce_href',src:'mce_src',type:'mce_type'}}TinyMCE_Cleanup.prototype={init:function(s){var n,a,i,ir,or,st;for(n in s)this.settings[n]=s[n];s=this.settings;this.inRe=this._arrayToRe(s.indent_elements.split(','),'','^<(',')[^>]*');this.ouRe=this._arrayToRe(s.indent_elements.split(','),'','^<\\/(',')[^>]*');this.nlBeforeRe=this._arrayToRe(s.newline_before_elements.split(','),'gi','<(',')([^>]*)>');this.nlAfterRe=this._arrayToRe(s.newline_after_elements.split(','),'gi','<(',')([^>]*)>');this.nlBeforeAfterRe=this._arrayToRe(s.newline_before_after_elements.split(','),'gi','<(\\/?)(',')([^>]*)>');this.serializedNodes=[];this.serializationId=0;if(s.invalid_elements!=='')this.iveRe=this._arrayToRe(s.invalid_elements.toUpperCase().split(','),'g','^(',')$');else this.iveRe=null;st='';for(i=0;i<s.indent_levels;i++)st+=s.indent_char;this
 .inStr=st;if(!s.verify_html){s.valid_elements='*[*]';s.extended_valid_elements=''}this.fillStr=s.entity_encoding=="named"?" ":" ";this.idCount=0;this.xmlEncodeRe=new RegExp('[\u007F-\uFFFF<>&"]','g')},addRuleStr:function(s){var r=this.parseRuleStr(s),n;for(n in r){if(r[n])this.rules[n]=r[n]}this.vElements=tinyMCE.clearArray([]);for(n in this.rules){if(this.rules[n])this.vElements[this.vElements.length]=this.rules[n].tag}this.vElementsRe=this._arrayToRe(this.vElements,'')},isValid:function(n){if(!this.rulesDone)this._setupRules();if(!n)return true;n=n.replace(/[^a-z0-9]+/gi,'').toUpperCase();return!tinyMCE.getParam('cleanup')||this.vElementsRe.test(n)},addChildRemoveRuleStr:function(s){var x,y,p,i,t,tn,ta,cl,r;if(!s)return;ta=s.split(',');for(x=0;x<ta.length;x++){s=ta[x];p=this.split(/\[|\]/,s);if(p==null||p.length<1)t=s.toUpperCase();else t=p[0].toUpperCase();tn=this.split('/',t);for(y=0;y<tn.length;y++){r="^(";cl=this.split(/\|/,p[1]);for(i=0;i<cl.length;i++){if(c
 l[i]=='%istrict')r+=tinyMCE.inlineStrict;else if(cl[i]=='%itrans')r+=tinyMCE.inlineTransitional;else if(cl[i]=='%istrict_na')r+=tinyMCE.inlineStrict.substring(2);else if(cl[i]=='%itrans_na')r+=tinyMCE.inlineTransitional.substring(2);else if(cl[i]=='%btrans')r+=tinyMCE.blockElms;else if(cl[i]=='%strict')r+=tinyMCE.blockStrict;else r+=(cl[i].charAt(0)!='#'?cl[i].toUpperCase():cl[i]);r+=(i!=cl.length-1?'|':'')}r+=')$';if(this.childRules==null)this.childRules=tinyMCE.clearArray([]);this.childRules[tn[y]]=new RegExp(r);if(p.length>1)this.childRules[tn[y]].wrapTag=p[2]}}},parseRuleStr:function(s){var ta,p,r,a,i,x,px,t,tn,y,av,or=tinyMCE.clearArray([]),dv;if(s==null||s.length==0)return or;ta=s.split(',');for(x=0;x<ta.length;x++){s=ta[x];if(s.length==0)continue;p=this.split(/\[|\]/,s);if(p==null||p.length<1)t=s.toUpperCase();else t=p[0].toUpperCase();tn=this.split('/',t);for(y=0;y<tn.length;y++){r={};r.tag=tn[y];r.forceAttribs=null;r.defaultAttribs=null;r.validAttribValues=null;px=r
 .tag.charAt(0);r.forceOpen=px=='+';r.removeEmpty=px=='-';r.fill=px=='#';r.tag=r.tag.replace(/\+|-|#/g,'');r.oTagName=tn[0].replace(/\+|-|#/g,'').toLowerCase();r.isWild=new RegExp('\\*|\\?|\\+','g').test(r.tag);r.validRe=new RegExp(this._wildcardToRe('^'+r.tag+'$'));if(p.length>1){r.vAttribsRe='^(';a=this.split(/\|/,p[1]);for(i=0;i<a.length;i++){t=a[i];if(t.charAt(0)=='!'){a[i]=t=t.substring(1);if(!r.reqAttribsRe)r.reqAttribsRe='\\s+('+t;else r.reqAttribsRe+='|'+t}av=new RegExp('(=|:|<)(.*?)$').exec(t);t=t.replace(new RegExp('(=|:|<).*?$'),'');if(av&&av.length>0){if(av[0].charAt(0)==':'){if(!r.forceAttribs)r.forceAttribs=tinyMCE.clearArray([]);r.forceAttribs[t.toLowerCase()]=av[0].substring(1)}else if(av[0].charAt(0)=='='){if(!r.defaultAttribs)r.defaultAttribs=tinyMCE.clearArray([]);dv=av[0].substring(1);r.defaultAttribs[t.toLowerCase()]=dv==''?"mce_empty":dv}else if(av[0].charAt(0)=='<'){if(!r.validAttribValues)r.validAttribValues=tinyMCE.clearArray([]);r.validAttribValues[t
 .toLowerCase()]=this._arrayToRe(this.split('?',av[0].substring(1)),'i')}}r.vAttribsRe+=''+t.toLowerCase()+(i!=a.length-1?'|':'');a[i]=t.toLowerCase()}if(r.reqAttribsRe)r.reqAttribsRe=new RegExp(r.reqAttribsRe+')=\"','g');r.vAttribsRe+=')$';r.vAttribsRe=this._wildcardToRe(r.vAttribsRe);r.vAttribsReIsWild=new RegExp('\\*|\\?|\\+','g').test(r.vAttribsRe);r.vAttribsRe=new RegExp(r.vAttribsRe);r.vAttribs=a.reverse();}else{r.vAttribsRe='';r.vAttribs=tinyMCE.clearArray([]);r.vAttribsReIsWild=false}or[r.tag]=r}}return or},serializeNodeAsXML:function(n){var s,b;if(!this.xmlDoc){if(this.isIE){try{this.xmlDoc=new ActiveXObject('MSXML2.DOMDocument')}catch(e){}if(!this.xmlDoc)try{this.xmlDoc=new ActiveXObject('Microsoft.XmlDom')}catch(e){}}else this.xmlDoc=document.implementation.createDocument('','',null);if(!this.xmlDoc)alert("Error XML Parser could not be found.")}if(this.xmlDoc.firstChild)this.xmlDoc.removeChild(this.xmlDoc.firstChild);b=this.xmlDoc.createElement("html");b=this.xmlDo
 c.appendChild(b);this._convertToXML(n,b);if(this.isIE)return this.xmlDoc.xml;else return new XMLSerializer().serializeToString(this.xmlDoc)},_convertToXML:function(n,xn){var xd,el,i,l,cn,at,no,hc=false;if(tinyMCE.isRealIE&&this._isDuplicate(n))return;xd=this.xmlDoc;switch(n.nodeType){case 1:hc=n.hasChildNodes();el=xd.createElement(n.nodeName.toLowerCase());at=n.attributes;for(i=at.length-1;i>-1;i--){no=at[i];if(no.specified&&no.nodeValue)el.setAttribute(no.nodeName.toLowerCase(),no.nodeValue)}if(!hc&&!this.closeElementsRe.test(n.nodeName))el.appendChild(xd.createTextNode(""));xn=xn.appendChild(el);break;case 3:xn.appendChild(xd.createTextNode(n.nodeValue));return;case 8:xn.appendChild(xd.createComment(n.nodeValue));return}if(hc){cn=n.childNodes;for(i=0,l=cn.length;i<l;i++)this._convertToXML(cn[i],xn)}},serializeNodeAsHTML:function(n,inn){var en,no,h='',i,l,t,st,r,cn,va=false,f=false,at,hc,cr,nn;if(!this.rulesDone)this._setupRules();if(tinyMCE.isRealIE&&this._isDuplicate(n))r
 eturn'';if(n.parentNode&&this.childRules!=null){cr=this.childRules[n.parentNode.nodeName];if(typeof(cr)!="undefined"&&!cr.test(n.nodeName)){st=true;t=null}}switch(n.nodeType){case 1:hc=n.hasChildNodes();if(st)break;nn=n.nodeName;if(tinyMCE.isRealIE){if(n.nodeName.indexOf('/')!=-1)break;if(n.scopeName&&n.scopeName!='HTML')nn=n.scopeName.toUpperCase()+':'+nn.toUpperCase()}else if(tinyMCE.isOpera&&nn.indexOf(':')>0)nn=nn.toUpperCase();if(this.settings.convert_fonts_to_spans){if(this.settings.on_save&&nn=='FONT')nn='SPAN';if(!this.settings.on_save&&nn=='SPAN')nn='FONT'}if(this.vElementsRe.test(nn)&&(!this.iveRe||!this.iveRe.test(nn))&&!inn){va=true;r=this.rules[nn];if(!r){at=this.rules;for(no in at){if(at[no]&&at[no].validRe.test(nn)){r=at[no];break}}}en=r.isWild?nn.toLowerCase():r.oTagName;f=r.fill;if(r.removeEmpty&&!hc)return"";t='<'+en;if(r.vAttribsReIsWild){at=n.attributes;for(i=at.length-1;i>-1;i--){no=at[i];if(no.specified&&r.vAttribsRe.test(no.nodeName))t+=this._serialize
 Attribute(n,r,no.nodeName)}}else{for(i=r.vAttribs.length-1;i>-1;i--)t+=this._serializeAttribute(n,r,r.vAttribs[i])}if(!this.settings.on_save){at=this.mceAttribs;for(no in at){if(at[no])t+=this._serializeAttribute(n,r,at[no])}}if(r.reqAttribsRe&&!t.match(r.reqAttribsRe))t=null;if(t!=null&&this.closeElementsRe.test(nn))return t+' />';if(t!=null)h+=t+'>';if(this.isIE&&this.codeElementsRe.test(nn))h+=n.innerHTML}break;case 3:if(st)break;if(n.parentNode&&this.codeElementsRe.test(n.parentNode.nodeName))return this.isIE?'':n.nodeValue;return this.xmlEncode(n.nodeValue);case 8:if(st)break;return"<!--"+this._trimComment(n.nodeValue)+"-->"}if(hc){cn=n.childNodes;for(i=0,l=cn.length;i<l;i++)h+=this.serializeNodeAsHTML(cn[i])}if(f&&!hc)h+=this.fillStr;if(t!=null&&va)h+='</'+en+'>';return h},_serializeAttribute:function(n,r,an){var av='',t,os=this.settings.on_save;if(os&&(an.indexOf('mce_')==0||an.indexOf('_moz')==0))return'';if(os&&this.mceAttribs[an])av=this._getAttrib(n,this.mceAttrib
 s[an]);if(av.length==0)av=this._getAttrib(n,an);if(av.length==0&&r.defaultAttribs&&(t=r.defaultAttribs[an])){av=t;if(av=="mce_empty")return" "+an+'=""'}if(r.forceAttribs&&(t=r.forceAttribs[an]))av=t;if(os&&av.length!=0&&/^(src|href|longdesc)$/.test(an))av=this._urlConverter(this,n,av);if(av.length!=0&&r.validAttribValues&&r.validAttribValues[an]&&!r.validAttribValues[an].test(av))return"";if(av.length!=0&&av=="{$uid}")av="uid_"+(this.idCount++);if(av.length!=0){if(an.indexOf('on')!=0)av=this.xmlEncode(av,1);return" "+an+"="+'"'+av+'"'}return""},formatHTML:function(h){var s=this.settings,p='',i=0,li=0,o='',l;h=h.replace(/<pre([^>]*)>(.*?)<\/pre>/gi,function(a,b,c){c=c.replace(/<br\s*\/>/gi,'\n');return'<pre'+b+'>'+c+'</pre>'});h=h.replace(/\r/g,'');h='\n'+h;h=h.replace(new RegExp('\\n\\s+','gi'),'\n');h=h.replace(this.nlBeforeRe,'\n<$1$2>');h=h.replace(this.nlAfterRe,'<$1$2>\n');h=h.replace(this.nlBeforeAfterRe,'\n<$1$2$3>\n');h+='\n';while((i=h.indexOf('\n',i+1))!=-1){if((l=
 h.substring(li+1,i)).length!=0){if(this.ouRe.test(l)&&p.length>=s.indent_levels)p=p.substring(s.indent_levels);o+=p+l+'\n';if(this.inRe.test(l))p+=this.inStr}li=i}return o},xmlEncode:function(s){var cl=this,re=this.xmlEncodeRe;if(!this.entitiesDone)this._setupEntities();switch(this.settings.entity_encoding){case"raw":return tinyMCE.xmlEncode(s);case"named":return s.replace(re,function(c){var b=cl.entities[c.charCodeAt(0)];return b?'&'+b+';':c});case"numeric":return s.replace(re,function(c){return'&#'+c.charCodeAt(0)+';'})}return s},split:function(re,s){var i,l,o=[],c=s.split(re);for(i=0,l=c.length;i<l;i++){if(c[i]!=='')o[i]=c[i]}return o},_trimComment:function(s){s=s.replace(new RegExp('\\smce_src=\"[^\"]*\"','gi'),"");s=s.replace(new RegExp('\\smce_href=\"[^\"]*\"','gi'),"");return s},_getAttrib:function(e,n,d){var v,ex,nn;if(typeof(d)=="undefined")d="";if(!e||e.nodeType!=1)return d;try{v=e.getAttribute(n,0)}catch(ex){v=e.getAttribute(n,2)}if(n=="class"&&!v)v=e.className;if
 (this.isIE){if(n=="http-equiv")v=e.httpEquiv;nn=e.nodeName;if(nn=="FORM"&&n=="enctype"&&v=="application/x-www-form-urlencoded")v="";if(nn=="INPUT"&&n=="size"&&v=="20")v="";if(nn=="INPUT"&&n=="maxlength"&&v=="2147483647")v="";if(n=="width"||n=="height")v=e.getAttribute(n,2)}if(n=='style'&&v){if(!tinyMCE.isOpera)v=e.style.cssText;v=tinyMCE.serializeStyle(tinyMCE.parseStyle(v))}if(this.settings.on_save&&n.indexOf('on')!=-1&&this.settings.on_save&&v&&v!=='')v=tinyMCE.cleanupEventStr(v);return(v&&v!=='')?''+v:d},_urlConverter:function(c,n,v){if(!c.settings.on_save)return tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings.base_href,v);else if(tinyMCE.getParam('convert_urls')){if(!this.urlConverter)this.urlConverter=eval(tinyMCE.settings.urlconverter_callback);return this.urlConverter(v,n,true)}return v},_arrayToRe:function(a,op,be,af){var i,r;op=typeof(op)=="undefined"?"gi":op;be=typeof(be)=="undefined"?"^(":be;af=typeof(af)=="undefined"?")$":af;r=be;for(i=0;i<a.length;i++)r+=t
 his._wildcardToRe(a[i])+(i!=a.length-1?"|":"");r+=af;return new RegExp(r,op)},_wildcardToRe:function(s){s=s.replace(/\?/g,'(\\S?)');s=s.replace(/\+/g,'(\\S+)');s=s.replace(/\*/g,'(\\S*)');return s},_setupEntities:function(){var n,a,i,s=this.settings;if(s.entity_encoding=="named"){n=tinyMCE.clearArray([]);a=this.split(',',s.entities);for(i=0;i<a.length;i+=2)n[a[i]]=a[i+1];this.entities=n}this.entitiesDone=true},_setupRules:function(){var s=this.settings;this.addRuleStr(s.valid_elements);this.addRuleStr(s.extended_valid_elements);this.addChildRemoveRuleStr(s.valid_child_elements);this.rulesDone=true},_isDuplicate:function(n){var i,l,sn;if(!this.settings.fix_content_duplication)return false;if(tinyMCE.isRealIE&&n.nodeType==1){if(n.mce_serialized==this.serializationId)return true;n.setAttribute('mce_serialized',this.serializationId)}else{sn=this.serializedNodes;for(i=0,l=sn.length;i<l;i++){if(sn[i]==n)return true}sn.push(n)}return false}};tinyMCE.add(TinyMCE_Engine,{createTagHTM
 L:function(tn,a,h){var o='',f=tinyMCE.xmlEncode,n;o='<'+tn;if(a){for(n in a){if(typeof(a[n])!='function'&&a[n]!=null)o+=' '+f(n)+'="'+f(''+a[n])+'"'}}o+=!h?' />':'>'+h+'</'+tn+'>';return o},createTag:function(d,tn,a,h){var o=d.createElement(tn),n;if(a){for(n in a){if(typeof(a[n])!='function'&&a[n]!=null)tinyMCE.setAttrib(o,n,a[n])}}if(h)o.innerHTML=h;return o},getElementByAttributeValue:function(n,e,a,v){return(n=this.getElementsByAttributeValue(n,e,a,v)).length==0?null:n[0]},getElementsByAttributeValue:function(n,e,a,v){var i,nl=n.getElementsByTagName(e),o=[];for(i=0;i<nl.length;i++){if(tinyMCE.getAttrib(nl[i],a).indexOf(v)!=-1)o[o.length]=nl[i]}return o},isBlockElement:function(n){return n!=null&&n.nodeType==1&&this.blockRegExp.test(n.nodeName)},getParentBlockElement:function(n,r){return this.getParentNode(n,function(n){return tinyMCE.isBlockElement(n)},r);return null},insertAfter:function(n,r){if(r.nextSibling)r.parentNode.insertBefore(n,r.nextSibling);else r.parentNode.a
 ppendChild(n)},setInnerHTML:function(e,h){var i,nl,n;if(tinyMCE.isGecko){h=h.replace(/<embed([^>]*)>/gi,'<tmpembed$1>');h=h.replace(/<em([^>]*)>/gi,'<i$1>');h=h.replace(/<tmpembed([^>]*)>/gi,'<embed$1>');h=h.replace(/<strong([^>]*)>/gi,'<b$1>');h=h.replace(/<\/strong>/gi,'</b>');h=h.replace(/<\/em>/gi,'</i>')}if(tinyMCE.isRealIE){h=h.replace(/\s\/>/g,'>');h=h.replace(/<p([^>]*)>\u00A0?<\/p>/gi,'<p$1 mce_keep="true"> </p>');h=h.replace(/<p([^>]*)>\s* \s*<\/p>/gi,'<p$1 mce_keep="true"> </p>');h=h.replace(/<p([^>]*)>\s+<\/p>/gi,'<p$1 mce_keep="true"> </p>');e.innerHTML=tinyMCE.uniqueTag+h;e.firstChild.removeNode(true);nl=e.getElementsByTagName("p");for(i=nl.length-1;i>=0;i--){n=nl[i];if(n.nodeName=='P'&&!n.hasChildNodes()&&!n.mce_keep)n.parentNode.removeChild(n)}}else{h=this.fixGeckoBaseHREFBug(1,e,h);e.innerHTML=h;this.fixGeckoBaseHREFBug(2,e,h)}},getOuterHTML:function(e){var d;if(tinyMCE.isIE)return e.outerHTML;d=e.ownerDocument.createElement("body");d.app
 endChild(e.cloneNode(true));return d.innerHTML},setOuterHTML:function(e,h,d){var d=typeof(d)=="undefined"?e.ownerDocument:d,i,nl,t;if(tinyMCE.isIE&&e.nodeType==1)e.outerHTML=h;else{t=d.createElement("body");t.innerHTML=h;for(i=0,nl=t.childNodes;i<nl.length;i++)e.parentNode.insertBefore(nl[i].cloneNode(true),e);e.parentNode.removeChild(e)}},_getElementById:function(id,d){var e,i,j,f;if(typeof(d)=="undefined")d=document;e=d.getElementById(id);if(!e){f=d.forms;for(i=0;i<f.length;i++){for(j=0;j<f[i].elements.length;j++){if(f[i].elements[j].name==id){e=f[i].elements[j];break}}}}return e},getNodeTree:function(n,na,t,nn){return this.selectNodes(n,function(n){return(!t||n.nodeType==t)&&(!nn||n.nodeName==nn)},na?na:[])},getParentElement:function(n,na,f,r){var re=na?new RegExp('^('+na.toUpperCase().replace(/,/g,'|')+')$'):0,v;if(f&&typeof(f)=='string')return this.getParentElement(n,na,function(no){return tinyMCE.getAttrib(no,f)!==''});return this.getParentNode(n,function(n){return((n.
 nodeType==1&&!re)||(re&&re.test(n.nodeName)))&&(!f||f(n))},r)},getParentNode:function(n,f,r){while(n){if(n==r)return null;if(f(n))return n;n=n.parentNode}return null},getAttrib:function(elm,name,dv){var v;if(typeof(dv)=="undefined")dv="";if(!elm||elm.nodeType!=1)return dv;try{v=elm.getAttribute(name,0)}catch(ex){v=elm.getAttribute(name,2)}if(name=="class"&&!v)v=elm.className;if(tinyMCE.isGecko){if(name=="src"&&elm.src!=null&&elm.src!=='')v=elm.src;if(name=="href"&&elm.href!=null&&elm.href!=='')v=elm.href}else if(tinyMCE.isIE){switch(name){case"http-equiv":v=elm.httpEquiv;break;case"width":case"height":v=elm.getAttribute(name,2);break}}if(name=="style"&&!tinyMCE.isOpera)v=elm.style.cssText;return(v&&v!=='')?v:dv},setAttrib:function(el,name,va,fix){if(typeof(va)=="number"&&va!=null)va=""+va;if(fix){if(va==null)va="";va=va.replace(/[^0-9%]/g,'')}if(name=="style")el.style.cssText=va;if(name=="class")el.className=va;if(va!=null&&va!==''&&va!=-1)el.setAttribute(name,va);else el.re
 moveAttribute(name)},setStyleAttrib:function(e,n,v){e.style[n]=v;if(tinyMCE.isIE&&v==null||v==''){v=tinyMCE.serializeStyle(tinyMCE.parseStyle(e.style.cssText));e.style.cssText=v;e.setAttribute("style",v)}},switchClass:function(ei,c){var e;if(tinyMCE.switchClassCache[ei])e=tinyMCE.switchClassCache[ei];else e=tinyMCE.switchClassCache[ei]=document.getElementById(ei);if(e){if(tinyMCE.settings.button_tile_map&&e.className&&e.className.indexOf('mceTiledButton')==0)c='mceTiledButton '+c;e.className=c}},getAbsPosition:function(n,cn){var l=0,t=0;while(n&&n!=cn){l+=n.offsetLeft;t+=n.offsetTop;n=n.offsetParent}return{absLeft:l,absTop:t}},prevNode:function(e,n){var a=n.split(','),i;while((e=e.previousSibling)!=null){for(i=0;i<a.length;i++){if(e.nodeName==a[i])return e}}return null},nextNode:function(e,n){var a=n.split(','),i;while((e=e.nextSibling)!=null){for(i=0;i<a.length;i++){if(e.nodeName==a[i])return e}}return null},selectElements:function(n,na,f){var i,a=[],nl,x;for(x=0,na=na.spli
 t(',');x<na.length;x++)for(i=0,nl=n.getElementsByTagName(na[x]);i<nl.length;i++)(!f||f(nl[i]))&&a.push(nl[i]);return a},selectNodes:function(n,f,a){var i;if(!a)a=[];if(f(n))a[a.length]=n;if(n.hasChildNodes()){for(i=0;i<n.childNodes.length;i++)tinyMCE.selectNodes(n.childNodes[i],f,a)}return a},addCSSClass:function(e,c,b){var o=this.removeCSSClass(e,c);return e.className=b?c+(o!==''?(' '+o):''):(o!==''?(o+' '):'')+c},removeCSSClass:function(e,c){c=e.className.replace(new RegExp("(^|\\s+)"+c+"(\\s+|$)"),' ');return e.className=c!=' '?c:''},hasCSSClass:function(n,c){return new RegExp('\\b'+c+'\\b','g').test(n.className)},renameElement:function(e,n,d){var ne,i,ar;d=typeof(d)=="undefined"?tinyMCE.selectedInstance.getDoc():d;if(e){ne=d.createElement(n);ar=e.attributes;for(i=ar.length-1;i>-1;i--){if(ar[i].specified&&ar[i].nodeValue)ne.setAttribute(ar[i].nodeName.toLowerCase(),ar[i].nodeValue)}ar=e.childNodes;for(i=0;i<ar.length;i++)ne.appendChild(ar[i].cloneNode(true));e.parentNode.
 replaceChild(ne,e)}},getViewPort:function(w){var d=w.document,m=d.compatMode=='CSS1Compat',b=d.body,de=d.documentElement;return{left:w.pageXOffset||(m?de.scrollLeft:b.scrollLeft),top:w.pageYOffset||(m?de.scrollTop:b.scrollTop),width:w.innerWidth||(m?de.clientWidth:b.clientWidth),height:w.innerHeight||(m?de.clientHeight:b.clientHeight)}},getStyle:function(n,na,d){if(!n)return false;if(tinyMCE.isGecko&&n.ownerDocument.defaultView){try{return n.ownerDocument.defaultView.getComputedStyle(n,null).getPropertyValue(na)}catch(n){return null}}na=na.replace(/-(\D)/g,function(a,b){return b.toUpperCase()});if(n.currentStyle)return n.currentStyle[na];return false}});tinyMCE.add(TinyMCE_Engine,{parseURL:function(url_str){var urlParts=[],i,pos,lastPos,chr;if(url_str){pos=url_str.indexOf('://');if(pos!=-1){urlParts.protocol=url_str.substring(0,pos);lastPos=pos+3}for(i=lastPos;i<url_str.length;i++){chr=url_str.charAt(i);if(chr==':')break;if(chr=='/')break}pos=i;urlParts.host=url_str.substrin
 g(lastPos,pos);urlParts.port="";lastPos=pos;if(url_str.charAt(pos)==':'){pos=url_str.indexOf('/',lastPos);urlParts.port=url_str.substring(lastPos+1,pos)}lastPos=pos;pos=url_str.indexOf('?',lastPos);if(pos==-1)pos=url_str.indexOf('#',lastPos);if(pos==-1)pos=url_str.length;urlParts.path=url_str.substring(lastPos,pos);lastPos=pos;if(url_str.charAt(pos)=='?'){pos=url_str.indexOf('#');pos=(pos==-1)?url_str.length:pos;urlParts.query=url_str.substring(lastPos+1,pos)}lastPos=pos;if(url_str.charAt(pos)=='#'){pos=url_str.length;urlParts.anchor=url_str.substring(lastPos+1,pos)}}return urlParts},serializeURL:function(up){var o="";if(up.protocol)o+=up.protocol+"://";if(up.host)o+=up.host;if(up.port)o+=":"+up.port;if(up.path)o+=up.path;if(up.query)o+="?"+up.query;if(up.anchor)o+="#"+up.anchor;return o},convertAbsoluteURLToRelativeURL:function(base_url,url_to_relative){var baseURL=this.parseURL(base_url),targetURL=this.parseURL(url_to_relative);var i,strTok1,strTok2,breakPoint=0,outPath=""
 ,forceSlash=false;var fileName,pos;if(targetURL.path=='')targetURL.path="/";else forceSlash=true;base_url=baseURL.path.substring(0,baseURL.path.lastIndexOf('/'));strTok1=base_url.split('/');strTok2=targetURL.path.split('/');if(strTok1.length>=strTok2.length){for(i=0;i<strTok1.length;i++){if(i>=strTok2.length||strTok1[i]!=strTok2[i]){breakPoint=i+1;break}}}if(strTok1.length<strTok2.length){for(i=0;i<strTok2.length;i++){if(i>=strTok1.length||strTok1[i]!=strTok2[i]){breakPoint=i+1;break}}}if(breakPoint==1)return targetURL.path;for(i=0;i<(strTok1.length-(breakPoint-1));i++)outPath+="../";for(i=breakPoint-1;i<strTok2.length;i++){if(i!=(breakPoint-1))outPath+="/"+strTok2[i];else outPath+=strTok2[i]}targetURL.protocol=null;targetURL.host=null;targetURL.port=null;targetURL.path=outPath==''&&forceSlash?"/":outPath;fileName=baseURL.path;if((pos=fileName.lastIndexOf('/'))!=-1)fileName=fileName.substring(pos+1);if(fileName==targetURL.path&&targetURL.anchor!=='')targetURL.path="";if(targ
 etURL.path==''&&!targetURL.anchor)targetURL.path=fileName!==''?fileName:"/";return this.serializeURL(targetURL)},convertRelativeToAbsoluteURL:function(base_url,relative_url){var baseURL=this.parseURL(base_url),baseURLParts,relURLParts,newRelURLParts,numBack,relURL=this.parseURL(relative_url),i;var len,absPath,start,end,newBaseURLParts;if(relative_url==''||relative_url.indexOf('://')!=-1||/^(mailto:|javascript:|#|\/)/.test(relative_url))return relative_url;baseURLParts=baseURL.path.split('/');relURLParts=relURL.path.split('/');newBaseURLParts=[];for(i=baseURLParts.length-1;i>=0;i--){if(baseURLParts[i].length==0)continue;newBaseURLParts[newBaseURLParts.length]=baseURLParts[i]}baseURLParts=newBaseURLParts.reverse();newRelURLParts=[];numBack=0;for(i=relURLParts.length-1;i>=0;i--){if(relURLParts[i].length==0||relURLParts[i]==".")continue;if(relURLParts[i]=='..'){numBack++;continue}if(numBack>0){numBack--;continue}newRelURLParts[newRelURLParts.length]=relURLParts[i]}relURLParts=ne
 wRelURLParts.reverse();len=baseURLParts.length-numBack;absPath=(len<=0?"":"/")+baseURLParts.slice(0,len).join('/')+"/"+relURLParts.join('/');start="";end="";relURL.protocol=baseURL.protocol;relURL.host=baseURL.host;relURL.port=baseURL.port;if(relURL.path.charAt(relURL.path.length-1)=="/")absPath+="/";relURL.path=absPath;return this.serializeURL(relURL)},convertURL:function(url,node,on_save){var dl=document.location,start,portPart,urlParts,baseUrlParts,tmpUrlParts,curl;var prot=dl.protocol,host=dl.hostname,port=dl.port;if(prot=="file:")return url;url=tinyMCE.regexpReplace(url,'(http|https):///','/');if(url.indexOf('mailto:')!=-1||url.indexOf('javascript:')!=-1||/^[ \t\r\n\+]*[#\?]/.test(url))return url;if(!tinyMCE.isIE&&!on_save&&url.indexOf("://")==-1&&url.charAt(0)!='/')return tinyMCE.settings.base_href+url;if(on_save&&tinyMCE.getParam('relative_urls')){curl=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings.base_href,url);if(curl.charAt(0)=='/')curl=tinyMCE.settings.doc
 ument_base_prefix+curl;urlParts=tinyMCE.parseURL(curl);tmpUrlParts=tinyMCE.parseURL(tinyMCE.settings.document_base_url);if(urlParts.host==tmpUrlParts.host&&(urlParts.port==tmpUrlParts.port))return tinyMCE.convertAbsoluteURLToRelativeURL(tinyMCE.settings.document_base_url,curl)}if(!tinyMCE.getParam('relative_urls')){urlParts=tinyMCE.parseURL(url);baseUrlParts=tinyMCE.parseURL(tinyMCE.settings.base_href);url=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings.base_href,url);if(urlParts.anchor&&urlParts.path==baseUrlParts.path)return"#"+urlParts.anchor}if(tinyMCE.getParam('remove_script_host')){start="";portPart="";if(port!=='')portPart=":"+port;start=prot+"//"+host+portPart+"/";if(url.indexOf(start)==0)url=url.substring(start.length-1)}return url},convertAllRelativeURLs:function(body){var i,elms,src,href,mhref,msrc;elms=body.getElementsByTagName("img");for(i=0;i<elms.length;i++){src=tinyMCE.getAttrib(elms[i],'src');msrc=tinyMCE.getAttrib(elms[i],'mce_src');if(msrc!=='')src=m
 src;if(src!==''){src=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings.base_href,src);elms[i].setAttribute("src",src)}}elms=body.getElementsByTagName("a");for(i=0;i<elms.length;i++){href=tinyMCE.getAttrib(elms[i],'href');mhref=tinyMCE.getAttrib(elms[i],'mce_href');if(mhref!=='')href=mhref;if(href&&href!==''){href=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings.base_href,href);elms[i].setAttribute("href",href)}}}});tinyMCE.add(TinyMCE_Engine,{clearArray:function(a){var n;for(n in a)a[n]=null;return a},explode:function(d,s){var ar=s.split(d),oar=[],i;for(i=0;i<ar.length;i++){if(ar[i]!=='')oar[oar.length]=ar[i]}return oar}});tinyMCE.add(TinyMCE_Engine,{_setEventsEnabled:function(node,state){var evs,x,y,elms,i,event;var events=['onfocus','onblur','onclick','ondblclick','onmousedown','onmouseup','onmouseover','onmousemove','onmouseout','onkeypress','onkeydown','onkeydown','onkeyup'];evs=tinyMCE.settings.event_elements.split(',');for(y=0;y<evs.length;y++){elms=node.getEl
 ementsByTagName(evs[y]);for(i=0;i<elms.length;i++){event="";for(x=0;x<events.length;x++){if((event=tinyMCE.getAttrib(elms[i],events[x]))!==''){event=tinyMCE.cleanupEventStr(""+event);if(!state)event="return true;"+event;else event=event.replace(/^return true;/gi,'');elms[i].removeAttribute(events[x]);elms[i].setAttribute(events[x],event)}}}}},_eventPatch:function(editor_id){var n,inst,win,e;if(typeof(tinyMCE)=="undefined")return true;try{if(tinyMCE.selectedInstance){win=tinyMCE.selectedInstance.getWin();if(win&&win.event){e=win.event;if(!e.target)e.target=e.srcElement;TinyMCE_Engine.prototype.handleEvent(e);return}}for(n in tinyMCE.instances){inst=tinyMCE.instances[n];if(!tinyMCE.isInstance(inst))continue;inst.select();win=inst.getWin();if(win&&win.event){e=win.event;if(!e.target)e.target=e.srcElement;TinyMCE_Engine.prototype.handleEvent(e);return}}}catch(ex){}},findEvent:function(e){var n,inst;if(e)return e;for(n in tinyMCE.instances){inst=tinyMCE.instances[n];if(tinyMCE.is
 Instance(inst)&&inst.getWin().event)return inst.getWin().event}return null},unloadHandler:function(){tinyMCE.triggerSave(true,true)},addEventHandlers:function(inst){this.setEventHandlers(inst,1)},setEventHandlers:function(inst,s){var doc=inst.getDoc(),ie,ot,i,f=s?tinyMCE.addEvent:tinyMCE.removeEvent;ie=['keypress','keyup','keydown','click','mouseup','mousedown','controlselect','dblclick'];ot=['keypress','keyup','keydown','click','mouseup','mousedown','focus','blur','dragdrop'];inst.switchSettings();if(tinyMCE.isIE){for(i=0;i<ie.length;i++)f(doc,ie[i],TinyMCE_Engine.prototype._eventPatch)}else{for(i=0;i<ot.length;i++)f(doc,ot[i],tinyMCE.handleEvent);try{doc.designMode="On"}catch(e){}}},onMouseMove:function(){var inst,lh;if(tinyMCE.lastHover){lh=tinyMCE.lastHover;if(lh.className.indexOf('mceMenu')!=-1)tinyMCE._menuButtonEvent('out',lh);else lh.className=lh.className;tinyMCE.lastHover=null}if(!tinyMCE.hasMouseMoved){inst=tinyMCE.selectedInstance;if(inst.isFocused){inst.undoBook
 mark=inst.selection.getBookmark();tinyMCE.hasMouseMoved=true}}},cancelEvent:function(e){if(!e)return false;if(tinyMCE.isIE){e.returnValue=false;e.cancelBubble=true}else{e.preventDefault();e.stopPropagation&&e.stopPropagation()}return false},addEvent:function(o,n,h){if(n!='unload'){function clean(){var ex;try{tinyMCE.removeEvent(o,n,h);tinyMCE.removeEvent(window,'unload',clean);o=n=h=null}catch(ex){}}tinyMCE.addEvent(window,'unload',clean)}if(o.attachEvent)o.attachEvent("on"+n,h);else o.addEventListener(n,h,false)},removeEvent:function(o,n,h){if(o.detachEvent)o.detachEvent("on"+n,h);else o.removeEventListener(n,h,false)},addSelectAccessibility:function(e,s,w){if(!s._isAccessible){s.onkeydown=tinyMCE.accessibleEventHandler;s.onblur=tinyMCE.accessibleEventHandler;s._isAccessible=true;s._win=w}return false},accessibleEventHandler:function(e){var elm,win=this._win;e=tinyMCE.isIE?win.event:e;elm=tinyMCE.isIE?e.srcElement:e.target;if(e.type=="blur"){if(elm.oldonchange){elm.onchange
 =elm.oldonchange;elm.oldonchange=null}return true}if(elm.nodeName=="SELECT"&&!elm.oldonchange){elm.oldonchange=elm.onchange;elm.onchange=null}if(e.keyCode==13||e.keyCode==32){elm.onchange=elm.oldonchange;elm.onchange();elm.oldonchange=null;tinyMCE.cancelEvent(e);return false}return true},_resetIframeHeight:function(){var ife;if(tinyMCE.isRealIE){ife=tinyMCE.selectedInstance.iframeElement;if(ife._oldHeight){ife.style.height=ife._oldHeight;ife.height=ife._oldHeight}}}});function TinyMCE_Selection(inst){this.instance=inst};TinyMCE_Selection.prototype={getSelectedHTML:function(){var inst=this.instance,e,r=this.getRng(),h;if(!r)return null;e=document.createElement("body");if(r.cloneContents)e.appendChild(document.importNode(r.cloneContents(),true));else if(typeof(r.item)!='undefined'||typeof(r.htmlText)!='undefined')e.innerHTML=r.item?r.item(0).outerHTML:r.htmlText;else e.innerHTML=r.toString();h=tinyMCE._cleanupHTML(inst,inst.contentDocument,inst.settings,e,e,false,true,false);r
 eturn h},getSelectedText:function(){var inst=this.instance,d,r,s,t;if(tinyMCE.isIE){d=inst.getDoc();if(d.selection.type=="Text"){r=d.selection.createRange();t=r.text}else t=''}else{s=this.getSel();if(s&&s.toString)t=s.toString();else t=''}return t},getBookmark:function(simple){var inst=this.instance,rng=this.getRng(),doc=inst.getDoc(),b=inst.getBody();var trng,sx,sy,xx=-999999999,vp=inst.getViewPort();var sp,le,s,e,nl,i,si,ei,w;sx=vp.left;sy=vp.top;if(simple)return{rng:rng,scrollX:sx,scrollY:sy};if(tinyMCE.isRealIE){if(rng.item){e=rng.item(0);nl=b.getElementsByTagName(e.nodeName);for(i=0;i<nl.length;i++){if(e==nl[i]){sp=i;break}}return{tag:e.nodeName,index:sp,scrollX:sx,scrollY:sy}}else{trng=doc.body.createTextRange();trng.moveToElementText(inst.getBody());trng.collapse(true);bp=Math.abs(trng.move('character',xx));trng=rng.duplicate();trng.collapse(true);sp=Math.abs(trng.move('character',xx));trng=rng.duplicate();trng.collapse(false);le=Math.abs(trng.move('character',xx))-sp
 ;return{start:sp-bp,length:le,scrollX:sx,scrollY:sy}}}else{s=this.getSel();e=this.getFocusElement();if(!s)return null;if(e&&e.nodeName=='IMG'){return{start:-1,end:-1,index:sp,scrollX:sx,scrollY:sy}}if(s.anchorNode==s.focusNode&&s.anchorOffset==s.focusOffset){e=this._getPosText(b,s.anchorNode,s.focusNode);if(!e)return{scrollX:sx,scrollY:sy};return{start:e.start+s.anchorOffset,end:e.end+s.focusOffset,scrollX:sx,scrollY:sy}}else{e=this._getPosText(b,rng.startContainer,rng.endContainer);if(!e)return{scrollX:sx,scrollY:sy};return{start:e.start+rng.startOffset,end:e.end+rng.endOffset,scrollX:sx,scrollY:sy}}}return null},moveToBookmark:function(bookmark){var inst=this.instance,rng,nl,i,ex,b=inst.getBody(),sd;var doc=inst.getDoc(),win=inst.getWin(),sel=this.getSel();if(!bookmark)return false;if(tinyMCE.isSafari&&bookmark.rng){sel.setBaseAndExtent(bookmark.rng.startContainer,bookmark.rng.startOffset,bookmark.rng.endContainer,bookmark.rng.endOffset);return true}if(tinyMCE.isRealIE){if
 (bookmark.rng){try{bookmark.rng.select()}catch(ex){}return true}win.focus();if(bookmark.tag){rng=b.createControlRange();nl=b.getElementsByTagName(bookmark.tag);if(nl.length>bookmark.index){try{rng.addElement(nl[bookmark.index])}catch(ex){}}}else{try{if(bookmark.start<0)return true;rng=inst.getSel().createRange();rng.moveToElementText(inst.getBody());rng.collapse(true);rng.moveStart('character',bookmark.start);rng.moveEnd('character',bookmark.length)}catch(ex){return true}}rng.select();win.scrollTo(bookmark.scrollX,bookmark.scrollY);return true}if(tinyMCE.isGecko||tinyMCE.isOpera){if(!sel)return false;if(bookmark.rng){sel.removeAllRanges();sel.addRange(bookmark.rng)}if(bookmark.start!=-1&&bookmark.end!=-1){try{sd=this._getTextPos(b,bookmark.start,bookmark.end);rng=doc.createRange();rng.setStart(sd.startNode,sd.startOffset);rng.setEnd(sd.endNode,sd.endOffset);sel.removeAllRanges();sel.addRange(rng);if(!tinyMCE.isOpera)win.focus()}catch(ex){}}win.scrollTo(bookmark.scrollX,bookm
 ark.scrollY);return true}return false},_getPosText:function(r,sn,en){var w=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,false),n,p=0,d={};while((n=w.nextNode())!=null){if(n==sn)d.start=p;if(n==en){d.end=p;return d}p+=n.nodeValue?n.nodeValue.length:0}return null},_getTextPos:function(r,sp,ep){var w=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,false),n,p=0,d={};while((n=w.nextNode())!=null){p+=n.nodeValue?n.nodeValue.length:0;if(p>=sp&&!d.startNode){d.startNode=n;d.startOffset=sp-(p-n.nodeValue.length)}if(p>=ep){d.endNode=n;d.endOffset=ep-(p-n.nodeValue.length);return d}}return null},selectNode:function(node,collapse,select_text_node,to_start){var inst=this.instance,sel,rng,nodes;if(!node)return;if(typeof(collapse)=="undefined")collapse=true;if(typeof(select_text_node)=="undefined")select_text_node=false;if(typeof(to_start)=="undefined")to_start=true;if(inst.settings.auto_resize)inst.resizeToContent();if(tinyMCE.isRealIE){rng=inst.getDoc().body.createTextRang
 e();try{rng.moveToElementText(node);if(collapse)rng.collapse(to_start);rng.select()}catch(e){}}else{sel=this.getSel();if(!sel)return;if(tinyMCE.isSafari){sel.setBaseAndExtent(node,0,node,node.innerText.length);if(collapse){if(to_start)sel.collapseToStart();else sel.collapseToEnd()}this.scrollToNode(node);return}rng=inst.getDoc().createRange();if(select_text_node){nodes=tinyMCE.getNodeTree(node,[],3);if(nodes.length>0)rng.selectNodeContents(nodes[0]);else rng.selectNodeContents(node)}else rng.selectNode(node);if(collapse){if(!to_start&&node.nodeType==3){rng.setStart(node,node.nodeValue.length);rng.setEnd(node,node.nodeValue.length)}else rng.collapse(to_start)}sel.removeAllRanges();sel.addRange(rng)}this.scrollToNode(node);tinyMCE.selectedElement=null;if(node.nodeType==1)tinyMCE.selectedElement=node},scrollToNode:function(node){var inst=this.instance,w=inst.getWin(),vp=inst.getViewPort(),pos=tinyMCE.getAbsPosition(node),cvp,p,cwin;if(pos.absLeft<vp.left||pos.absLeft>vp.left+vp
 .width||pos.absTop<vp.top||pos.absTop>vp.top+(vp.height-25))w.scrollTo(pos.absLeft,pos.absTop-vp.height+25);if(inst.settings.auto_resize){cwin=inst.getContainerWin();cvp=tinyMCE.getViewPort(cwin);p=this.getAbsPosition(node);if(p.absLeft<cvp.left||p.absLeft>cvp.left+cvp.width||p.absTop<cvp.top||p.absTop>cvp.top+cvp.height)cwin.scrollTo(p.absLeft,p.absTop-cvp.height+25)}},getAbsPosition:function(n){var pos=tinyMCE.getAbsPosition(n),ipos=tinyMCE.getAbsPosition(this.instance.iframeElement);return{absLeft:ipos.absLeft+pos.absLeft,absTop:ipos.absTop+pos.absTop}},getSel:function(){var inst=this.instance;if(tinyMCE.isRealIE)return inst.getDoc().selection;return inst.contentWindow.getSelection()},getRng:function(){var s=this.getSel();if(s==null)return null;if(tinyMCE.isRealIE)return s.createRange();if(tinyMCE.isSafari&&!s.getRangeAt)return''+window.getSelection();if(s.rangeCount>0)return s.getRangeAt(0);return null},isCollapsed:function(){var r=this.getRng();if(r.item)return false;re
 turn r.boundingWidth==0||this.getSel().isCollapsed},collapse:function(b){var r=this.getRng(),s=this.getSel();if(r.select){r.collapse(b);r.select()}else{if(b)s.collapseToStart();else s.collapseToEnd()}},getFocusElement:function(){var inst=this.instance,doc,rng,sel,elm;if(tinyMCE.isRealIE){doc=inst.getDoc();rng=doc.selection.createRange();elm=rng.item?rng.item(0):rng.parentElement()}else{if(!tinyMCE.isSafari&&inst.isHidden())return inst.getBody();sel=this.getSel();rng=this.getRng();if(!sel||!rng)return null;elm=rng.commonAncestorContainer;if(!rng.collapsed){if(rng.startContainer==rng.endContainer){if(rng.startOffset-rng.endOffset<2){if(rng.startContainer.hasChildNodes())elm=rng.startContainer.childNodes[rng.startOffset]}}}elm=tinyMCE.getParentElement(elm);}return elm}};function TinyMCE_UndoRedo(inst){this.instance=inst;this.undoLevels=[];this.undoIndex=0;this.typingUndoIndex=-1;this.undoRedo=true};TinyMCE_UndoRedo.prototype={add:function(l){var b,customUndoLevels,newHTML,inst=
 this.instance,i,ul,ur;if(l){this.undoLevels[this.undoLevels.length]=l;return true}if(this.typingUndoIndex!=-1){this.undoIndex=this.typingUndoIndex;if(tinyMCE.typingUndoIndex!=-1)tinyMCE.undoIndex=tinyMCE.typingUndoIndex}newHTML=tinyMCE.trim(inst.getBody().innerHTML);if(this.undoLevels[this.undoIndex]&&newHTML!=this.undoLevels[this.undoIndex].content){inst.isNotDirty=false;tinyMCE.dispatchCallback(inst,'onchange_callback','onChange',inst);customUndoLevels=tinyMCE.settings.custom_undo_redo_levels;if(customUndoLevels!=-1&&this.undoLevels.length>customUndoLevels){for(i=0;i<this.undoLevels.length-1;i++)this.undoLevels[i]=this.undoLevels[i+1];this.undoLevels.length--;this.undoIndex--;}b=inst.undoBookmark;if(!b)b=inst.selection.getBookmark();this.undoIndex++;this.undoLevels[this.undoIndex]={content:newHTML,bookmark:b};ul=tinyMCE.undoLevels;for(i=tinyMCE.undoIndex+1;i<ul.length;i++){ur=ul[i].undoRedo;if(ur.undoIndex==ur.undoLevels.length-1)ur.undoIndex--;ur.undoLevels.length--}tinyM
 CE.undoLevels[tinyMCE.undoIndex++]=inst;tinyMCE.undoLevels.length=tinyMCE.undoIndex;this.undoLevels.length=this.undoIndex+1;return true}return false},undo:function(){var inst=this.instance;if(this.undoIndex>0){this.undoIndex--;tinyMCE.setInnerHTML(inst.getBody(),this.undoLevels[this.undoIndex].content);inst.repaint();if(inst.settings.custom_undo_redo_restore_selection)inst.selection.moveToBookmark(this.undoLevels[this.undoIndex].bookmark)}},redo:function(){var inst=this.instance;tinyMCE.execCommand("mceEndTyping");if(this.undoIndex<(this.undoLevels.length-1)){this.undoIndex++;tinyMCE.setInnerHTML(inst.getBody(),this.undoLevels[this.undoIndex].content);inst.repaint();if(inst.settings.custom_undo_redo_restore_selection)inst.selection.moveToBookmark(this.undoLevels[this.undoIndex].bookmark)}tinyMCE.triggerNodeChange()}};var TinyMCE_ForceParagraphs={_insertPara:function(inst,e){var doc=inst.getDoc(),sel=inst.getSel(),body=inst.getBody(),win=inst.contentWindow,rng=sel.getRangeAt(
 0);var rootElm=doc.documentElement,blockName="P",startNode,endNode,startBlock,endBlock;var rngBefore,rngAfter,direct,startNode,startOffset,endNode,endOffset,b=tinyMCE.isOpera?inst.selection.getBookmark():null;var paraBefore,paraAfter,startChop,endChop,contents,i;function isEmpty(para){var nodes;function isEmptyHTML(html){return html.replace(new RegExp('[ \t\r\n]+','g'),'').toLowerCase()==''}if(para.getElementsByTagName("img").length>0)return false;if(para.getElementsByTagName("table").length>0)return false;if(para.getElementsByTagName("hr").length>0)return false;nodes=tinyMCE.getNodeTree(para,[],3);for(i=0;i<nodes.length;i++){if(!isEmptyHTML(nodes[i].nodeValue))return false}return true}rngBefore=doc.createRange();rngBefore.setStart(sel.anchorNode,sel.anchorOffset);rngBefore.collapse(true);rngAfter=doc.createRange();rngAfter.setStart(sel.focusNode,sel.focusOffset);rngAfter.collapse(true);direct=rngBefore.compareBoundaryPoints(rngBefore.START_TO_END,rngAfter)<0;startNode=direc
 t?sel.anchorNode:sel.focusNode;startOffset=direct?sel.anchorOffset:sel.focusOffset;endNode=direct?sel.focusNode:sel.anchorNode;endOffset=direct?sel.focusOffset:sel.anchorOffset;startNode=startNode.nodeName=="HTML"?doc.body:startNode;startNode=startNode.nodeName=="BODY"?startNode.firstChild:startNode;endNode=endNode.nodeName=="BODY"?endNode.firstChild:endNode;startBlock=inst.getParentBlockElement(startNode);endBlock=inst.getParentBlockElement(endNode);if(startBlock&&(startBlock.nodeName=='CAPTION'||/absolute|relative|static/gi.test(startBlock.style.position)))startBlock=null;if(endBlock&&(endBlock.nodeName=='CAPTION'||/absolute|relative|static/gi.test(endBlock.style.position)))endBlock=null;if(startBlock!=null){blockName=startBlock.nodeName;if(/(TD|TABLE|TH|CAPTION)/.test(blockName)||(blockName=="DIV"&&/left|right/gi.test(startBlock.style.cssFloat)))blockName="P"}if(tinyMCE.getParentElement(startBlock,"OL,UL",null,body)!=null)return false;if((startBlock!=null&&startBlock.node
 Name=="TABLE")||(endBlock!=null&&endBlock.nodeName=="TABLE"))startBlock=endBlock=null;paraBefore=(startBlock!=null&&startBlock.nodeName==blockName)?startBlock.cloneNode(false):doc.createElement(blockName);paraAfter=(endBlock!=null&&endBlock.nodeName==blockName)?endBlock.cloneNode(false):doc.createElement(blockName);if(/^(H[1-6])$/.test(blockName))paraAfter=doc.createElement("p");startChop=startNode;endChop=endNode;node=startChop;do{if(node==body||node.nodeType==9||tinyMCE.isBlockElement(node))break;startChop=node}while((node=node.previousSibling?node.previousSibling:node.parentNode));node=endChop;do{if(node==body||node.nodeType==9||tinyMCE.isBlockElement(node))break;endChop=node}while((node=node.nextSibling?node.nextSibling:node.parentNode));if(startChop.nodeName=="TD")startChop=startChop.firstChild;if(endChop.nodeName=="TD")endChop=endChop.lastChild;if(startBlock==null){rng.deleteContents();if(!tinyMCE.isSafari)sel.removeAllRanges();if(startChop!=rootElm&&endChop!=rootElm){
 rngBefore=rng.cloneRange();if(startChop==body)rngBefore.setStart(startChop,0);else rngBefore.setStartBefore(startChop);paraBefore.appendChild(rngBefore.cloneContents());if(endChop.parentNode.nodeName==blockName)endChop=endChop.parentNode;rng.setEndAfter(endChop);if(endChop.nodeName!="#text"&&endChop.nodeName!="BODY")rngBefore.setEndAfter(endChop);contents=rng.cloneContents();if(contents.firstChild&&(contents.firstChild.nodeName==blockName||contents.firstChild.nodeName=="BODY"))paraAfter.innerHTML=contents.firstChild.innerHTML;else paraAfter.appendChild(contents);if(isEmpty(paraBefore))paraBefore.innerHTML=" ";if(isEmpty(paraAfter))paraAfter.innerHTML=" ";rng.deleteContents();rngAfter.deleteContents();rngBefore.deleteContents();if(tinyMCE.isOpera){paraBefore.normalize();rngBefore.insertNode(paraBefore);paraAfter.normalize();rngBefore.insertNode(paraAfter)}else{paraAfter.normalize();rngBefore.insertNode(paraAfter);paraBefore.normalize();rngBefore.insertNode(paraBefor
 e)}}else{body.innerHTML="<"+blockName+"> </"+blockName+"><"+blockName+"> </"+blockName+">";paraAfter=body.childNodes[1]}inst.selection.moveToBookmark(b);inst.selection.selectNode(paraAfter,true,true);return true}if(startChop.nodeName==blockName)rngBefore.setStart(startChop,0);else rngBefore.setStartBefore(startChop);rngBefore.setEnd(startNode,startOffset);paraBefore.appendChild(rngBefore.cloneContents());rngAfter.setEndAfter(endChop);rngAfter.setStart(endNode,endOffset);contents=rngAfter.cloneContents();if(contents.firstChild&&contents.firstChild.nodeName==blockName){paraAfter.innerHTML=contents.firstChild.innerHTML}else paraAfter.appendChild(contents);if(isEmpty(paraBefore))paraBefore.innerHTML=" ";if(isEmpty(paraAfter))paraAfter.innerHTML=" ";rng=doc.createRange();if(!startChop.previousSibling&&startChop.parentNode.nodeName.toUpperCase()==blockName){rng.setStartBefore(startChop.parentNode)}else{if(rngBefore.startContainer.nodeName.toUpperCase()==blockNa
 me&&rngBefore.startOffset==0)rng.setStartBefore(rngBefore.startContainer);else rng.setStart(rngBefore.startContainer,rngBefore.startOffset)}if(!endChop.nextSibling&&endChop.parentNode.nodeName.toUpperCase()==blockName)rng.setEndAfter(endChop.parentNode);else rng.setEnd(rngAfter.endContainer,rngAfter.endOffset);rng.deleteContents();if(tinyMCE.isOpera){rng.insertNode(paraBefore);rng.insertNode(paraAfter)}else{rng.insertNode(paraAfter);rng.insertNode(paraBefore)}paraAfter.normalize();paraBefore.normalize();inst.selection.moveToBookmark(b);inst.selection.selectNode(paraAfter,true,true);return true},_handleBackSpace:function(inst){var r=inst.getRng(),sn=r.startContainer,nv,s=false;if(sn&&sn.nextSibling&&sn.nextSibling.nodeName=="BR"&&sn.parentNode.nodeName!="BODY"){nv=sn.nodeValue;if(nv!=null&&r.startOffset==nv.length)sn.nextSibling.parentNode.removeChild(sn.nextSibling)}if(inst.settings.auto_resize)inst.resizeToContent();return s}};function TinyMCE_Layer(id,bm){this.id=id;this.b
 lockerElement=null;this.events=false;this.element=null;this.blockMode=typeof(bm)!='undefined'?bm:true;this.doc=document};TinyMCE_Layer.prototype={moveRelativeTo:function(re,p){var rep=this.getAbsPosition(re),e=this.getElement(),x,y;var w=parseInt(re.offsetWidth),h=parseInt(re.offsetHeight);var ew=parseInt(e.offsetWidth),eh=parseInt(e.offsetHeight);switch(p){case"tl":x=rep.absLeft;y=rep.absTop;break;case"tr":x=rep.absLeft+w;y=rep.absTop;break;case"bl":x=rep.absLeft;y=rep.absTop+h;break;case"br":x=rep.absLeft+w;y=rep.absTop+h;break;case"cc":x=rep.absLeft+(w/ 2) - (ew /2);y=rep.absTop+(h/ 2) - (eh /2);break}this.moveTo(x,y)},moveBy:function(x,y){var e=this.getElement();this.moveTo(parseInt(e.style.left)+x,parseInt(e.style.top)+y)},moveTo:function(x,y){var e=this.getElement();e.style.left=x+"px";e.style.top=y+"px";this.updateBlocker()},resizeBy:function(w,h){var e=this.getElement();this.resizeTo(parseInt(e.style.width)+w,parseInt(e.style.height)+h)},resizeTo:function(w,h){var e=
 this.getElement();if(w!=null)e.style.width=w+"px";if(h!=null)e.style.height=h+"px";this.updateBlocker()},show:function(){var el=this.getElement();if(el){el.style.display='block';this.updateBlocker()}},hide:function(){var el=this.getElement();if(el){el.style.display='none';this.updateBlocker()}},isVisible:function(){return this.getElement().style.display=='block'},getElement:function(){if(!this.element)this.element=this.doc.getElementById(this.id);return this.element},setBlockMode:function(s){this.blockMode=s},updateBlocker:function(){var e,b,x,y,w,h;b=this.getBlocker();if(b){if(this.blockMode){e=this.getElement();x=this.parseInt(e.style.left);y=this.parseInt(e.style.top);w=this.parseInt(e.offsetWidth);h=this.parseInt(e.offsetHeight);b.style.left=x+'px';b.style.top=y+'px';b.style.width=w+'px';b.style.height=h+'px';b.style.display=e.style.display}else b.style.display='none'}},getBlocker:function(){var d,b;if(!this.blockerElement&&this.blockMode){d=this.doc;b=d.getElementById(t
 his.id+"_blocker");if(!b){b=d.createElement("iframe");b.setAttribute('id',this.id+"_blocker");b.style.cssText='display: none; position: absolute; left: 0; top: 0';b.src='javascript:false;';b.frameBorder='0';b.scrolling='no';d.body.appendChild(b)}this.blockerElement=b}return this.blockerElement},getAbsPosition:function(n){var p={absLeft:0,absTop:0};while(n){p.absLeft+=n.offsetLeft;p.absTop+=n.offsetTop;n=n.offsetParent}return p},create:function(n,c,p,h){var d=this.doc,e=d.createElement(n);e.setAttribute('id',this.id);if(c)e.className=c;if(!p)p=d.body;if(h)e.innerHTML=h;p.appendChild(e);return this.element=e},exists:function(){return this.doc.getElementById(this.id)!=null},parseInt:function(s){if(s==null||s=='')return 0;return parseInt(s)},remove:function(){var e=this.getElement(),b=this.getBlocker();if(e)e.parentNode.removeChild(e);if(b)b.parentNode.removeChild(b)}};function TinyMCE_Menu(){var id;if(typeof(tinyMCE.menuCounter)=="undefined")tinyMCE.menuCounter=0;id="mc_menu_"+
 tinyMCE.menuCounter++;TinyMCE_Layer.call(this,id,true);this.id=id;this.items=[];this.needsUpdate=true};TinyMCE_Menu.prototype=tinyMCE.extend(TinyMCE_Layer.prototype,{init:function(s){var n;this.settings={separator_class:'mceMenuSeparator',title_class:'mceMenuTitle',disabled_class:'mceMenuDisabled',menu_class:'mceMenu',drop_menu:true};for(n in s)this.settings[n]=s[n];this.create('div',this.settings.menu_class)},clear:function(){this.items=[]},addTitle:function(t){this.add({type:'title',text:t})},addDisabled:function(t){this.add({type:'disabled',text:t})},addSeparator:function(){this.add({type:'separator'})},addItem:function(t,js){this.add({text:t,js:js})},add:function(mi){this.items[this.items.length]=mi;this.needsUpdate=true},update:function(){var e=this.getElement(),h='',i,t,m=this.items,s=this.settings;if(this.settings.drop_menu)h+='<span class="mceMenuLine"></span>';h+='<table border="0" cellpadding="0" cellspacing="0">';for(i=0;i<m.length;i++){t=tinyMCE.xmlEncode(m[i].te
 xt);c=m[i].class_name?' class="'+m[i].class_name+'"':'';switch(m[i].type){case'separator':h+='<tr class="'+s.separator_class+'"><td>';break;case'title':h+='<tr class="'+s.title_class+'"><td><span'+c+'>'+t+'</span>';break;case'disabled':h+='<tr class="'+s.disabled_class+'"><td><span'+c+'>'+t+'</span>';break;default:h+='<tr><td><a href="'+tinyMCE.xmlEncode(m[i].js)+'" onmousedown="'+tinyMCE.xmlEncode(m[i].js)+';return tinyMCE.cancelEvent(event);" onclick="return tinyMCE.cancelEvent(event);" onmouseup="return tinyMCE.cancelEvent(event);"><span'+c+'>'+t+'</span></a>'}h+='</td></tr>'}h+='</table>';e.innerHTML=h;this.needsUpdate=false;this.updateBlocker()},show:function(){var nl,i;if(tinyMCE.lastMenu==this)return;if(this.needsUpdate)this.update();if(tinyMCE.lastMenu&&tinyMCE.lastMenu!=this)tinyMCE.lastMenu.hide();TinyMCE_Layer.prototype.show.call(this);if(!tinyMCE.isOpera){}tinyMCE.lastMenu=this}});tinyMCE.add(TinyMCE_Engine,{debug:function(){var m="",a,i,l=tinyMCE.log.length;for(
 i=0,a=this.debug.arguments;i<a.length;i++){m+=a[i];if(i<a.length-1)m+=', '}if(l<1000)tinyMCE.log[l]="[debug] "+m}});
\ No newline at end of file

Deleted: plog/trunk/js/tinymce/tiny_mce_gzip.js
===================================================================
--- plog/trunk/js/tinymce/tiny_mce_gzip.js	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/js/tinymce/tiny_mce_gzip.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,134 +0,0 @@
-var tinyMCE_GZ = {
-	settings : {
-		themes : '',
-		plugins : '',
-		languages : '',
-		disk_cache : false,
-		page_name : 'tiny_mce_gzip.php',
-		debug : true,
-		suffix : ''
-	},
-
-	init : function(s, cb, sc) {
-		var t = this, n, i, nl = document.getElementsByTagName('script');
-
-		for (n in s)
-			t.settings[n] = s[n];
-
-		s = t.settings;
-
-		for (i=0; i<nl.length; i++) {
-			n = nl[i];
-
-			if (n.src && n.src.indexOf('tiny_mce') != -1)
-				t.baseURL = n.src.substring(0, n.src.lastIndexOf('/'));
-		}
-
-		if (!t.coreLoaded)
-			t.loadScripts(1, s.themes, s.plugins, s.languages, cb, sc);
-	},
-
-	loadScripts : function(co, th, pl, la, cb, sc) {
-		var t = this, x, w = window, q, c = 0, ti, s = t.settings;
-
-		function get(s) {
-			x = 0;
-
-			try {
-				x = new ActiveXObject(s);
-			} catch (s) {
-			}
-
-			return x;
-		};
-
-		// Build query string
-		q = 'js=true&diskcache=' + (s.disk_cache ? 'true' : 'false') + '&core=' + (co ? 'true' : 'false') + '&suffix=' + escape(s.suffix) + '&themes=' + escape(th) + '&plugins=' + escape(pl) + '&languages=' + escape(la);
-
-		if (co)
-			t.coreLoaded = 1;
-
-		// Send request
-		x = w.XMLHttpRequest ? new XMLHttpRequest() : get('Msxml2.XMLHTTP') || get('Microsoft.XMLHTTP');
-		x.overrideMimeType && x.overrideMimeType('text/javascript');
-		x.open('GET', t.baseURL + '/' + s.page_name + '?' + q, !!cb);
-//		x.setRequestHeader('Content-Type', 'text/javascript');
-		x.send('');
-
-		// Handle asyncronous loading
-		if (cb) {
-			// Wait for response
-			ti = w.setInterval(function() {
-				if (x.readyState == 4 || c++ > 10000) {
-					w.clearInterval(ti);
-
-					if (c < 10000 && x.status == 200) {
-						t.loaded = 1;
-						t.eval(x.responseText);
-						tinymce.dom.Event.domLoaded = true;
-						cb.call(sc || t, x);
-					}
-
-					ti = x = null;
-				}
-			}, 10);
-		} else
-			t.eval(x.responseText);
-	},
-
-	start : function() {
-		var t = this, each = tinymce.each, s = t.settings, ln = s.languages.split(',');
-
-		tinymce.suffix = s.suffix;
-
-		function load(u) {
-			tinymce.ScriptLoader.markDone(tinyMCE.baseURI.toAbsolute(u));
-		};
-
-		// Add core languages
-		each(ln, function(c) {
-			if (c)
-				load('langs/' + c + '.js');
-		});
-
-		// Add themes with languages
-		each(s.themes.split(','), function(n) {
-			if (n) {
-				load('themes/' + n + '/editor_template' + s.suffix + '.js');
-
-				each (ln, function(c) {
-					if (c)
-						load('themes/' + n + '/langs/' + c + '.js');
-				});
-			}
-		});
-
-		// Add plugins with languages
-		each(s.plugins.split(','), function(n) {
-			if (n) {
-				load('plugins/' + n + '/editor_plugin' + s.suffix + '.js');
-
-				each(ln, function(c) {
-					if (c)
-						load('plugins/' + n + '/langs/' + c + '.js');
-				});
-			}
-		});
-	},
-
-	end : function() {
-	},
-
-	eval : function(co) {
-		var w = window;
-
-		// Evaluate script
-		if (!w.execScript) {
-			if (/Gecko/.test(navigator.userAgent))
-				eval(co, w); // Firefox 3.0
-			else
-				eval.call(w, co);
-		} else
-			w.execScript(co); // IE
-	}
-};

Modified: plog/trunk/js/tinymce/tiny_mce_gzip.php
===================================================================
--- plog/trunk/js/tinymce/tiny_mce_gzip.php	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/js/tinymce/tiny_mce_gzip.php	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,7 +1,10 @@
 <?php
 /**
- * $Id: tiny_mce_gzip.php 315 2007-10-25 14:03:43Z spocke $
+ * $RCSfile: tiny_mce_gzip.php,v $
+ * $Revision: $
+ * $Date: $
  *
+ * @version 1.08
  * @author Moxiecode
  * @copyright Copyright © 2005-2006, Moxiecode Systems AB, All rights reserved.
  *
@@ -10,174 +13,256 @@
  * Notice: This script defaults the button_tile_map option to true for extra performance.
  */
 
-	// Set the error reporting to minimal.
-	@error_reporting(E_ERROR | E_WARNING | E_PARSE);
+// General options
+$suffix = "";							// Set to "_src" to use source version
+$expiresOffset = 3600 * 24 * 10;		// 10 days util client cache expires
+$diskCache = false;						// If you enable this option gzip files will be cached on disk.
+$cacheDir = realpath(".");				// Absolute directory path to where cached gz files will be stored
+$debug = false;							// Enable this option if you need debuging info
 
-	// Get input
-	$plugins = explode(',', getParam("plugins", ""));
-	$languages = explode(',', getParam("languages", ""));
-	$themes = explode(',', getParam("themes", ""));
-	$diskCache = getParam("diskcache", "") == "true";
-	$isJS = getParam("js", "") == "true";
-	$compress = getParam("compress", "true") == "true";
-	$core = getParam("core", "true") == "true";
-	$suffix = getParam("suffix", "_src") == "_src" ? "_src" : "";
-	$cachePath = realpath("."); // Cache path, this is where the .gz files will be stored
-	$expiresOffset = 3600 * 24 * 10; // Cache for 10 days in browser cache
-	$content = "";
-	$encodings = array();
-	$supportsGzip = false;
-	$enc = "";
-	$cacheKey = "";
+// Headers
+header("Content-type: text/javascript; charset: UTF-8");
+// header("Cache-Control: must-revalidate");
+header("Vary: Accept-Encoding"); // Handle proxies
+header("Expires: " . gmdate("D, d M Y H:i:s", time() + $expiresOffset) . " GMT");
 
-	// Custom extra javascripts to pack
-	$custom = array(/*
-		"some custom .js file",
-		"some custom .js file"
-	*/);
+// Get data to load
+$theme = isset($_GET['theme']) ? TinyMCE_cleanInput($_GET['theme']) : "";
+$language = isset($_GET['language']) ? TinyMCE_cleanInput($_GET['language']) : "";
+$plugins = isset($_GET['plugins']) ? TinyMCE_cleanInput($_GET['plugins']) : "";
+$lang = isset($_GET['lang']) ? TinyMCE_cleanInput($_GET['lang']) : "en";
+$index = isset($_GET['index']) ? TinyMCE_cleanInput($_GET['index']) : -1;
+$cacheKey = md5($theme . $language . $plugins . $lang . $index . $debug);
+$cacheFile = $cacheDir == "" ? "" : $cacheDir . "/" . "tinymce_" .  $cacheKey . ".gz";
+$cacheData = "";
 
-	// Headers
-	header("Content-type: text/javascript");
-	header("Vary: Accept-Encoding");  // Handle proxies
-	header("Expires: " . gmdate("D, d M Y H:i:s", time() + $expiresOffset) . " GMT");
-
-	// Is called directly then auto init with default settings
-	if (!$isJS) {
-		echo getFileContents("tiny_mce_gzip.js");
-		echo "tinyMCE_GZ.init({});";
-		die();
+// Patch older versions of PHP < 4.3.0
+if (!function_exists('file_get_contents')) {
+	function file_get_contents($filename) {
+		$fd = fopen($filename, 'rb');
+		$content = fread($fd, filesize($filename));
+		fclose($fd);
+		return $content;
 	}
+}
 
-	// Setup cache info
-	if ($diskCache) {
-		if (!$cachePath)
-			die("alert('Real path failed.');");
+// Security check function, can only contain a-z 0-9 , _ - and whitespace.
+function TinyMCE_cleanInput($str) {
+	return preg_replace("/[^0-9a-z\-_,]+/i", "", $str); // Remove anything but 0-9,a-z,-_
+}
 
-		$cacheKey = getParam("plugins", "") . getParam("languages", "") . getParam("themes", "") . $suffix;
+function TinyMCE_echo($str) {
+	global $cacheData, $diskCache;
 
-		foreach ($custom as $file)
-			$cacheKey .= $file;
+	if ($diskCache)
+		$cacheData .= $str;
+	else
+		echo $str;
+}
 
-		$cacheKey = md5($cacheKey);
+// Only gzip the contents if clients and server support it
+$encodings = array();
 
-		if ($compress)
-			$cacheFile = $cachePath . "/tiny_mce_" . $cacheKey . ".gz";
-		else
-			$cacheFile = $cachePath . "/tiny_mce_" . $cacheKey . ".js";
+if (isset($_SERVER['HTTP_ACCEPT_ENCODING']))
+	$encodings = explode(',', strtolower(preg_replace("/\s+/", "", $_SERVER['HTTP_ACCEPT_ENCODING'])));
+
+// Check for gzip header or northon internet securities
+if ((in_array('gzip', $encodings) || in_array('x-gzip', $encodings) || isset($_SERVER['---------------'])) && function_exists('ob_gzhandler') && !ini_get('zlib.output_compression')) {
+	$enc = in_array('x-gzip', $encodings) ? "x-gzip" : "gzip";
+
+	// Use cached file if it exists but not in debug mode
+	if (file_exists($cacheFile) && !$debug) {
+		header("Content-Encoding: " . $enc);
+		echo file_get_contents($cacheFile);
+		die;
 	}
 
-	// Check if it supports gzip
-	if (isset($_SERVER['HTTP_ACCEPT_ENCODING']))
-		$encodings = explode(',', strtolower(preg_replace("/\s+/", "", $_SERVER['HTTP_ACCEPT_ENCODING'])));
+	if (!$diskCache)
+		ob_start("ob_gzhandler");
+} else
+	$diskCache = false;
 
-	if ((in_array('gzip', $encodings) || in_array('x-gzip', $encodings) || isset($_SERVER['---------------'])) && function_exists('ob_gzhandler') && !ini_get('zlib.output_compression')) {
-		$enc = in_array('x-gzip', $encodings) ? "x-gzip" : "gzip";
-		$supportsGzip = true;
+if ($index > -1) {
+	// Write main script and patch some things
+	if ($index == 0) {
+		TinyMCE_echo(file_get_contents(realpath("tiny_mce" . $suffix . ".js")));
+		TinyMCE_echo('TinyMCE.prototype.orgLoadScript = TinyMCE.prototype.loadScript;');
+		TinyMCE_echo('TinyMCE.prototype.loadScript = function() {};var realTinyMCE = tinyMCE;');
+	} else
+		TinyMCE_echo('tinyMCE = realTinyMCE;');
+
+	// Do init based on index
+	TinyMCE_echo("tinyMCE.init(tinyMCECompressed.configs[" . $index . "]);");
+
+	// Load external plugins
+	if ($index == 0)
+		TinyMCE_echo("tinyMCECompressed.loadPlugins();");
+
+	// Load theme, language pack and theme language packs
+	if ($theme) {
+		TinyMCE_echo(file_get_contents(realpath("themes/" . $theme . "/editor_template" . $suffix . ".js")));
+		TinyMCE_echo(file_get_contents(realpath("themes/" . $theme . "/langs/" . $lang . ".js")));
 	}
 
-	// Use cached file disk cache
-	if ($diskCache && $supportsGzip && file_exists($cacheFile)) {
-		if ($compress)
-			header("Content-Encoding: " . $enc);
+	if ($language)
+		TinyMCE_echo(file_get_contents(realpath("langs/" . $language . ".js")));
 
-		echo getFileContents($cacheFile);
-		die();
+	// Load all plugins and their language packs
+	$plugins = explode(",", $plugins);
+	foreach ($plugins as $plugin) {
+		$pluginFile = realpath("plugins/" . $plugin . "/editor_plugin" . $suffix . ".js");
+		$languageFile = realpath("plugins/" . $plugin . "/langs/" . $lang . ".js");
+
+		if ($pluginFile)
+			TinyMCE_echo(file_get_contents($pluginFile));
+
+		if ($languageFile)
+			TinyMCE_echo(file_get_contents($languageFile));
 	}
 
-	// Add core
-	if ($core == "true") {
-		$content .= getFileContents("tiny_mce" . $suffix . ".js");
+	// Reset tinyMCE compressor engine
+	TinyMCE_echo("tinyMCE = tinyMCECompressed;");
 
-		// Patch loading functions
-		$content .= "tinyMCE_GZ.start();";
+	// Write to cache
+	if ($diskCache) {
+		// Calculate compression ratio and debug target output path
+		if ($debug) {
+			$ratio = round(100 - strlen(gzencode($cacheData, 9, FORCE_GZIP)) / strlen($cacheData) * 100.0);
+			TinyMCE_echo("alert('TinyMCE was compressed by " . $ratio . "%.\\nOutput cache file: " . $cacheFile . "');");
+		}
+
+		$cacheData = gzencode($cacheData, 9, FORCE_GZIP);
+
+		// Write to file if possible
+		$fp = @fopen($cacheFile, "wb");
+		if ($fp) {
+			fwrite($fp, $cacheData);
+			fclose($fp);
+		}
+
+		// Output
+		header("Content-Encoding: " . $enc);
+		echo $cacheData;
 	}
 
-	// Add core languages
-	foreach ($languages as $lang)
-		$content .= getFileContents("langs/" . $lang . ".js");
+	die;
+}
+?>
 
-	// Add themes
-	foreach ($themes as $theme) {
-		$content .= getFileContents( "themes/" . $theme . "/editor_template" . $suffix . ".js");
+function TinyMCECompressed() {
+	this.configs = new Array();
+	this.loadedFiles = new Array();
+	this.externalPlugins = new Array();
+	this.loadAdded = false;
+	this.isLoaded = false;
+}
 
-		foreach ($languages as $lang)
-			$content .= getFileContents("themes/" . $theme . "/langs/" . $lang . ".js");
+TinyMCECompressed.prototype.init = function(settings) {
+	var elements = document.getElementsByTagName('script');
+	var scriptURL = "";
+
+	for (var i=0; i<elements.length; i++) {
+		if (elements[i].src && elements[i].src.indexOf("tiny_mce_gzip.php") != -1) {
+			scriptURL = elements[i].src;
+			break;
+		}
 	}
 
-	// Add plugins
-	foreach ($plugins as $plugin) {
-		$content .= getFileContents("plugins/" . $plugin . "/editor_plugin" . $suffix . ".js");
+	settings["theme"] = typeof(settings["theme"]) != "undefined" ? settings["theme"] : "default";
+	settings["plugins"] = typeof(settings["plugins"]) != "undefined" ? settings["plugins"] : "";
+	settings["language"] = typeof(settings["language"]) != "undefined" ? settings["language"] : "en";
+	settings["button_tile_map"] = typeof(settings["button_tile_map"]) != "undefined" ? settings["button_tile_map"] : true;
+	this.configs[this.configs.length] = settings;
+	this.settings = settings;
 
-		foreach ($languages as $lang)
-			$content .= getFileContents("plugins/" . $plugin . "/langs/" . $lang . ".js");
+	scriptURL += "?theme=" + escape(this.getOnce(settings["theme"])) + "&language=" + escape(this.getOnce(settings["language"])) + "&plugins=" + escape(this.getOnce(settings["plugins"])) + "&lang=" + settings["language"] + "&index=" + escape(this.configs.length-1);
+	document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + scriptURL + '"></script>');
+
+	if (!this.loadAdded) {
+		tinyMCE.addEvent(window, "DOMContentLoaded", TinyMCECompressed.prototype.onLoad);
+		tinyMCE.addEvent(window, "load", TinyMCECompressed.prototype.onLoad);
+		this.loadAdded = true;
 	}
+}
 
-	// Add custom files
-	foreach ($custom as $file)
-		$content .= getFileContents($file);
+TinyMCECompressed.prototype.onLoad = function() {
+	if (tinyMCE.isLoaded)
+		return true;
 
-	// Restore loading functions
-	if ($core == "true")
-		$content .= "tinyMCE_GZ.end();";
+	tinyMCE = realTinyMCE;
+	TinyMCE_Engine.prototype.onLoad();
+	tinyMCE._addUnloadEvents();
 
-	// Generate GZIP'd content
-	if ($supportsGzip) {
-		if ($compress) {
-			header("Content-Encoding: " . $enc);
-			$cacheData = gzencode($content, 9, FORCE_GZIP);
-		} else
-			$cacheData = $content;
+	tinyMCE.isLoaded = true;
+}
 
-		// Write gz file
-		if ($diskCache && $cacheKey != "")
-			putFileContents($cacheFile, $cacheData);
+TinyMCECompressed.prototype.addEvent = function(o, n, h) {
+	if (o.attachEvent)
+		o.attachEvent("on" + n, h);
+	else
+		o.addEventListener(n, h, false);
+}
 
-		// Stream to client
-		echo $cacheData;
-	} else {
-		// Stream uncompressed content
-		echo $content;
+TinyMCECompressed.prototype.getOnce = function(str) {
+	var ar = str.replace(/\s+/g, '').split(',');
+
+	for (var i=0; i<ar.length; i++) {
+		if (ar[i] == '' || ar[i].charAt(0) == '-') {
+			ar[i] = null;
+			continue;
+		}
+
+		// Skip load
+		for (var x=0; x<this.loadedFiles.length; x++) {
+			if (this.loadedFiles[x] == ar[i])
+				ar[i] = null;
+		}
+
+		this.loadedFiles[this.loadedFiles.length] = ar[i];
 	}
 
-	/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+	// Glue
+	str = "";
+	for (var i=0; i<ar.length; i++) {
+		if (ar[i] == null)
+			continue;
 
-	function getParam($name, $def = false) {
-		if (!isset($_GET[$name]))
-			return $def;
+		str += ar[i];
 
-		return preg_replace("/[^0-9a-z\-_,]+/i", "", $_GET[$name]); // Remove anything but 0-9,a-z,-_
+		if (i != ar.length-1)
+			str += ",";
 	}
 
-	function getFileContents($path) {
-		$path = realpath($path);
+	return str;
+};
 
-		if (!$path || !@is_file($path))
-			return "";
+TinyMCECompressed.prototype.loadPlugins = function() {
+	var i, ar;
 
-		if (function_exists("file_get_contents"))
-			return @file_get_contents($path);
+	TinyMCE.prototype.loadScript = TinyMCE.prototype.orgLoadScript;
+	tinyMCE = realTinyMCE;
 
-		$content = "";
-		$fp = @fopen($path, "r");
-		if (!$fp)
-			return "";
+	ar = tinyMCECompressed.externalPlugins;
+	for (i=0; i<ar.length; i++)
+		tinyMCE.loadPlugin(ar[i].name, ar[i].url);
 
-		while (!feof($fp))
-			$content .= fgets($fp);
+	TinyMCE.prototype.loadScript = function() {};
+};
 
-		fclose($fp);
+TinyMCECompressed.prototype.loadPlugin = function(n, u) {
+	this.externalPlugins[this.externalPlugins.length] = {name : n, url : u};
+};
 
-		return $content;
-	}
+TinyMCECompressed.prototype.importPluginLanguagePack = function(n, v) {
+	tinyMCE = realTinyMCE;
+	TinyMCE.prototype.loadScript = TinyMCE.prototype.orgLoadScript;
+	tinyMCE.importPluginLanguagePack(n, v);
+};
 
-	function putFileContents($path, $content) {
-		if (function_exists("file_put_contents"))
-			return @file_put_contents($path, $content);
+TinyMCECompressed.prototype.addPlugin = function(n, p) {
+	tinyMCE = realTinyMCE;
+	tinyMCE.addPlugin(n, p);
+};
 
-		$fp = @fopen($path, "wb");
-		if ($fp) {
-			fwrite($fp, $content);
-			fclose($fp);
-		}
-	}
-?>
\ No newline at end of file
+var tinyMCE = new TinyMCECompressed();
+var tinyMCECompressed = tinyMCE;

Modified: plog/trunk/js/tinymce/tiny_mce_popup.js
===================================================================
--- plog/trunk/js/tinymce/tiny_mce_popup.js	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/js/tinymce/tiny_mce_popup.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,5 +1,294 @@
-
-// Uncomment and change this document.domain value if you are loading the script cross subdomains
-// document.domain = 'moxiecode.com';
-
-var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_foc
 us=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},0)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:func
 tion(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(){var a=window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.domLoaded){return}b.domLoaded=1;if(b.features.translate_i18n!==false){c=docum
 ent.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}document.body.style.display="";if(tinymce.isIE){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){tinymce.dom.Event._add(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(
 f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){a=a.target||a.srcElement;if(a.onchange){a.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_wait:function(){if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);tinyMCEPopup._onDOMLoaded()}});if(document.documentElement.doScroll&&window==window.top){(function(){if(tinyMCEPopup.domLoaded){return}try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}tinyMCEPopup._onDOMLoaded()})()}document.attachEvent("onload",tinyMCEPopup._onDOMLoaded)}else{if(document.addEventListener){window.addEventListener("DOMContentLoaded",tinyMCEPopup._onDOMLoaded,false);win
 dow.addEventListener("load",tinyMCEPopup._onDOMLoaded,false)}}}};tinyMCEPopup.init();tinyMCEPopup._wait();
\ No newline at end of file
+// Some global instances, this will be filled later
+var tinyMCE = null, tinyMCELang = null;
+
+function TinyMCE_Popup() {
+};
+
+TinyMCE_Popup.prototype = {
+	findWin : function(w) {
+		var c;
+
+		// Check parents
+		c = w;
+		while (c && (c = c.parent) != null) {
+			if (typeof(c.tinyMCE) != "undefined")
+				return c;
+		}
+
+		// Check openers
+		c = w;
+		while (c && (c = c.opener) != null) {
+			if (typeof(c.tinyMCE) != "undefined")
+				return c;
+		}
+
+		// Try top
+		if (typeof(top.tinyMCE) != "undefined")
+			return top;
+
+		return null;
+	},
+
+	init : function() {
+		var win = window.opener ? window.opener : window.dialogArguments, c;
+		var inst, re, title, divElm;
+
+		if (!win)
+			win = this.findWin(window);
+
+		if (!win) {
+			alert("tinyMCE object reference not found from popup.");
+			return;
+		}
+
+		window.opener = win;
+		this.windowOpener = win;
+		this.onLoadEval = "";
+
+		// Setup parent references
+		tinyMCE = win.tinyMCE;
+		tinyMCELang = win.tinyMCELang;
+
+		inst = tinyMCE.selectedInstance;
+		this.isWindow = tinyMCE.getWindowArg('mce_inside_iframe', false) == false;
+		this.storeSelection = (tinyMCE.isRealIE) && !this.isWindow && tinyMCE.getWindowArg('mce_store_selection', true);
+
+		if (this.isWindow)
+			window.focus();
+
+		// Store selection
+		if (this.storeSelection)
+			inst.selectionBookmark = inst.selection.getBookmark(true);
+
+		// Setup dir
+		if (tinyMCELang.lang_dir)
+			document.dir = tinyMCELang.lang_dir;
+
+		// Setup title
+		re = new RegExp('{|\\\$|}', 'g');
+		title = document.title.replace(re, "");
+		if (typeof(tinyMCELang[title]) != "undefined") {
+			divElm = document.createElement("div");
+			divElm.innerHTML = tinyMCELang[title];
+			document.title = divElm.innerHTML;
+
+			if (typeof(tinyMCE.setWindowTitle) != 'undefined')
+				tinyMCE.setWindowTitle(window, divElm.innerHTML);
+		}
+
+		// Output Popup CSS class
+		document.write('<link href="' + tinyMCE.getParam("popups_css") + '" rel="stylesheet" type="text/css">');
+
+		if (tinyMCE.getParam("popups_css_add")) {
+			c = tinyMCE.getParam("popups_css_add");
+
+			// Is relative
+			if (c.indexOf('://') == -1 && c.charAt(0) != '/')
+				c = tinyMCE.documentBasePath + "/" + c;
+
+			document.write('<link href="' + c + '" rel="stylesheet" type="text/css">');
+		}
+
+		tinyMCE.addEvent(window, "load", this.onLoad);
+	},
+
+	onLoad : function() {
+		var dir, i, elms, body = document.body;
+
+		if (tinyMCE.getWindowArg('mce_replacevariables', true))
+			body.innerHTML = tinyMCE.applyTemplate(body.innerHTML, tinyMCE.windowArgs);
+
+		dir = tinyMCE.selectedInstance.settings.directionality;
+		if (dir == "rtl" && document.forms && document.forms.length > 0) {
+			elms = document.forms[0].elements;
+			for (i=0; i<elms.length; i++) {
+				if ((elms[i].type == "text" || elms[i].type == "textarea") && elms[i].getAttribute("dir") != "ltr")
+					elms[i].dir = dir;
+			}
+		}
+
+		if (body.style.display == 'none')
+			body.style.display = 'block';
+
+		// Execute real onload (Opera fix)
+		if (tinyMCEPopup.onLoadEval !== '')
+			eval(tinyMCEPopup.onLoadEval);
+	},
+
+	executeOnLoad : function(str) {
+		if (tinyMCE.isOpera && parseFloat(opera.version()) < 9.5)
+			this.onLoadEval = str;
+		else
+			eval(str);
+	},
+
+	resizeToInnerSize : function() {
+		var i, doc, body, oldMargin, wrapper, iframe, nodes, dx, dy;
+
+		// Netscape 7.1 workaround
+		if (this.isWindow && tinyMCE.isNS71) {
+			window.resizeBy(0, 10);
+			return;
+		}
+
+		if (this.isWindow) {
+			doc = document;
+			body = doc.body;
+
+			if (body.style.display == 'none')
+				body.style.display = 'block';
+
+			// Remove margin
+			oldMargin = body.style.margin;
+			body.style.margin = '0';
+
+			// Create wrapper
+			wrapper = doc.createElement("div");
+			wrapper.id = 'mcBodyWrapper';
+			wrapper.style.display = 'none';
+			wrapper.style.margin = '0';
+
+			// Wrap body elements
+			nodes = doc.body.childNodes;
+			for (i=nodes.length-1; i>=0; i--) {
+				if (wrapper.hasChildNodes())
+					wrapper.insertBefore(nodes[i].cloneNode(true), wrapper.firstChild);
+				else
+					wrapper.appendChild(nodes[i].cloneNode(true));
+
+				nodes[i].parentNode.removeChild(nodes[i]);
+			}
+
+			// Add wrapper
+			doc.body.appendChild(wrapper);
+
+			// Create iframe
+			iframe = document.createElement("iframe");
+			iframe.id = "mcWinIframe";
+			iframe.src = document.location.href.toLowerCase().indexOf('https') == -1 ? "about:blank" : tinyMCE.settings.default_document;
+			iframe.width = "100%";
+			iframe.height = "100%";
+			iframe.style.margin = '0';
+
+			// Add iframe
+			doc.body.appendChild(iframe);
+
+			// Measure iframe
+			iframe = document.getElementById('mcWinIframe');
+			dx = tinyMCE.getWindowArg('mce_width') - iframe.clientWidth;
+			dy = tinyMCE.getWindowArg('mce_height') - iframe.clientHeight;
+
+			// Resize window
+			// tinyMCE.debug(tinyMCE.getWindowArg('mce_width') + "," + tinyMCE.getWindowArg('mce_height') + " - " + dx + "," + dy);
+			window.resizeBy(dx, dy);
+
+			// Hide iframe and show wrapper
+			body.style.margin = oldMargin;
+			iframe.style.display = 'none';
+			wrapper.style.display = 'block';
+		}
+	},
+
+	resizeToContent : function() {
+		var isMSIE = (navigator.appName == "Microsoft Internet Explorer");
+		var isOpera = (navigator.userAgent.indexOf("Opera") != -1);
+		var elm, width, height, x, y, dx, dy;
+
+		if (isOpera)
+			return;
+
+		if (isMSIE) {
+			try { window.resizeTo(10, 10); } catch (e) {}
+
+			elm = document.body;
+			width = elm.offsetWidth;
+			height = elm.offsetHeight;
+			dx = (elm.scrollWidth - width) + 4;
+			dy = elm.scrollHeight - height;
+
+			try { window.resizeBy(dx, dy); } catch (e) {}
+		} else {
+			window.scrollBy(1000, 1000);
+			if (window.scrollX > 0 || window.scrollY > 0) {
+				window.resizeBy(window.innerWidth * 2, window.innerHeight * 2);
+				window.sizeToContent();
+				window.scrollTo(0, 0);
+				x = parseInt(screen.width / 2.0) - (window.outerWidth / 2.0);
+				y = parseInt(screen.height / 2.0) - (window.outerHeight / 2.0);
+				window.moveTo(x, y);
+			}
+		}
+	},
+
+	getWindowArg : function(name, default_value) {
+		return tinyMCE.getWindowArg(name, default_value);
+	},
+
+	restoreSelection : function() {
+		var inst;
+
+		if (this.storeSelection) {
+			inst = tinyMCE.selectedInstance;
+
+			inst.getWin().focus();
+
+			if (inst.selectionBookmark)
+				inst.selection.moveToBookmark(inst.selectionBookmark);
+		}
+	},
+
+	execCommand : function(command, user_interface, value) {
+		var inst = tinyMCE.selectedInstance;
+
+		this.restoreSelection();
+		inst.execCommand(command, user_interface, value);
+
+		// Store selection
+		if (this.storeSelection)
+			inst.selectionBookmark = inst.selection.getBookmark(true);
+	},
+
+	close : function() {
+		tinyMCE.closeWindow(window);
+	},
+
+	pickColor : function(e, element_id) {
+		tinyMCE.selectedInstance.execCommand('mceColorPicker', true, {
+			element_id : element_id,
+			document : document,
+			window : window,
+			store_selection : false
+		});
+	},
+
+	openBrowser : function(element_id, type, option) {
+		var cb = tinyMCE.getParam(option, tinyMCE.getParam("file_browser_callback"));
+		var url = document.getElementById(element_id).value;
+
+		tinyMCE.setWindowArg("window", window);
+		tinyMCE.setWindowArg("document", document);
+
+		// Call to external callback
+		if (eval('typeof(tinyMCEPopup.windowOpener.' + cb + ')') == "undefined")
+			alert("Callback function: " + cb + " could not be found.");
+		else
+			eval("tinyMCEPopup.windowOpener." + cb + "(element_id, url, type, window);");
+	},
+
+	importClass : function(c) {
+		var n;
+
+		window[c] = function() {};
+
+		for (n in window.opener[c].prototype)
+			window[c].prototype[n] = window.opener[c].prototype[n];
+
+		window[c].constructor = window.opener[c].constructor;
+	}
+
+	};
+
+// Setup global instance
+var tinyMCEPopup = new TinyMCE_Popup();
+
+tinyMCEPopup.init();

Modified: plog/trunk/js/tinymce/tiny_mce_src.js
===================================================================
--- plog/trunk/js/tinymce/tiny_mce_src.js	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/js/tinymce/tiny_mce_src.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,14181 +1,7607 @@
-(function(win) {
-	var whiteSpaceRe = /^\s*|\s*$/g,
-		undefined;
 
-	var tinymce = {
-		majorVersion : '3',
+/* file:jscripts/tiny_mce/classes/TinyMCE_Engine.class.js */
 
-		minorVersion : '3.9',
+function TinyMCE_Engine() {
+	var ua;
 
-		releaseDate : '2010-09-08',
+	this.majorVersion = "2";
+	this.minorVersion = "1.3";
+	this.releaseDate = "2007-11-27";
 
-		_init : function() {
-			var t = this, d = document, na = navigator, ua = na.userAgent, i, nl, n, base, p, v;
+	this.instances = [];
+	this.switchClassCache = [];
+	this.windowArgs = [];
+	this.loadedFiles = [];
+	this.pendingFiles = [];
+	this.loadingIndex = 0;
+	this.configs = [];
+	this.currentConfig = 0;
+	this.eventHandlers = [];
+	this.log = [];
+	this.undoLevels = [];
+	this.undoIndex = 0;
+	this.typingUndoIndex = -1;
+	this.settings = [];
 
-			t.isOpera = win.opera && opera.buildNumber;
+	// Browser check
+	ua = navigator.userAgent;
+	this.isMSIE = (navigator.appName == "Microsoft Internet Explorer");
+	this.isMSIE5 = this.isMSIE && (ua.indexOf('MSIE 5') != -1);
+	this.isMSIE5_0 = this.isMSIE && (ua.indexOf('MSIE 5.0') != -1);
+	this.isMSIE7 = this.isMSIE && (ua.indexOf('MSIE 7') != -1);
+	this.isGecko = ua.indexOf('Gecko') != -1; // Will also be true on Safari
+	this.isSafari = ua.indexOf('Safari') != -1;
+	this.isOpera = window['opera'] && opera.buildNumber ? true : false;
+	this.isMac = ua.indexOf('Mac') != -1;
+	this.isNS7 = ua.indexOf('Netscape/7') != -1;
+	this.isNS71 = ua.indexOf('Netscape/7.1') != -1;
+	this.dialogCounter = 0;
+	this.plugins = [];
+	this.themes = [];
+	this.menus = [];
+	this.loadedPlugins = [];
+	this.buttonMap = [];
+	this.isLoaded = false;
 
-			t.isWebKit = /WebKit/.test(ua);
+	// Fake MSIE on Opera and if Opera fakes IE, Gecko or Safari cancel those
+	if (this.isOpera) {
+		this.isMSIE = true;
+		this.isGecko = false;
+		this.isSafari =  false;
+	}
 
-			t.isIE = !t.isWebKit && !t.isOpera && (/MSIE/gi).test(ua) && (/Explorer/gi).test(na.appName);
+	this.isIE = this.isMSIE;
+	this.isRealIE = this.isMSIE && !this.isOpera;
 
-			t.isIE6 = t.isIE && /MSIE [56]/.test(ua);
+	// TinyMCE editor id instance counter
+	this.idCounter = 0;
+};
 
-			t.isGecko = !t.isWebKit && /Gecko/.test(ua);
+TinyMCE_Engine.prototype = {
+	init : function(settings) {
+		var theme, nl, baseHREF = "", i, cssPath, entities, h, p, src, elements = [], head;
 
-			t.isMac = ua.indexOf('Mac') != -1;
+		// IE 5.0x is no longer supported since 5.5, 6.0 and 7.0 now exists. We can't support old browsers forever, sorry.
+		if (this.isMSIE5_0)
+			return;
 
-			t.isAir = /adobeair/i.test(ua);
+		this.settings = settings;
 
-			t.isIDevice = /(iPad|iPhone)/.test(ua);
+		// Check if valid browser has execcommand support
+		if (typeof(document.execCommand) == 'undefined')
+			return;
 
-			// TinyMCE .NET webcontrol might be setting the values for TinyMCE
-			if (win.tinyMCEPreInit) {
-				t.suffix = tinyMCEPreInit.suffix;
-				t.baseURL = tinyMCEPreInit.base;
-				t.query = tinyMCEPreInit.query;
-				return;
+		// Get script base path
+		if (!tinyMCE.baseURL) {
+			// Search through head
+			head = document.getElementsByTagName('head')[0];
+
+			if (head) {
+				for (i=0, nl = head.getElementsByTagName('script'); i<nl.length; i++)
+					elements.push(nl[i]);
 			}
 
-			// Get suffix and base
-			t.suffix = '';
+			// Search through rest of document
+			for (i=0, nl = document.getElementsByTagName('script'); i<nl.length; i++)
+				elements.push(nl[i]);
 
 			// If base element found, add that infront of baseURL
-			nl = d.getElementsByTagName('base');
+			nl = document.getElementsByTagName('base');
 			for (i=0; i<nl.length; i++) {
-				if (v = nl[i].href) {
-					// Host only value like http://site.com or http://site.com:8008
-					if (/^https?:\/\/[^\/]+$/.test(v))
-						v += '/';
-
-					base = v ? v.match(/.*\//)[0] : ''; // Get only directory
-				}
+				if (nl[i].href)
+					baseHREF = nl[i].href;
 			}
 
-			function getBase(n) {
-				if (n.src && /tiny_mce(|_gzip|_jquery|_prototype|_full)(_dev|_src)?.js/.test(n.src)) {
-					if (/_(src|dev)\.js/g.test(n.src))
-						t.suffix = '_src';
+			for (i=0; i<elements.length; i++) {
+				if (elements[i].src && (elements[i].src.indexOf("tiny_mce.js") != -1 || elements[i].src.indexOf("tiny_mce_dev.js") != -1 || elements[i].src.indexOf("tiny_mce_src.js") != -1 || elements[i].src.indexOf("tiny_mce_gzip") != -1)) {
+					src = elements[i].src;
 
-					if ((p = n.src.indexOf('?')) != -1)
-						t.query = n.src.substring(p + 1);
+					tinyMCE.srcMode = (src.indexOf('_src') != -1 || src.indexOf('_dev') != -1) ? '_src' : '';
+					tinyMCE.gzipMode = src.indexOf('_gzip') != -1;
+					src = src.substring(0, src.lastIndexOf('/'));
 
-					t.baseURL = n.src.substring(0, n.src.lastIndexOf('/'));
+					if (settings.exec_mode == "src" || settings.exec_mode == "normal")
+						tinyMCE.srcMode = settings.exec_mode == "src" ? '_src' : '';
 
-					// If path to script is relative and a base href was found add that one infront
-					// the src property will always be an absolute one on non IE browsers and IE 8
-					// so this logic will basically only be executed on older IE versions
-					if (base && t.baseURL.indexOf('://') == -1 && t.baseURL.indexOf('/') !== 0)
-						t.baseURL = base + t.baseURL;
+					// Force it absolute if page has a base href
+					if (baseHREF !== '' && src.indexOf('://') == -1)
+						tinyMCE.baseURL = baseHREF + src;
+					else
+						tinyMCE.baseURL = src;
 
-					return t.baseURL;
+					break;
 				}
-
-				return null;
-			};
-
-			// Check document
-			nl = d.getElementsByTagName('script');
-			for (i=0; i<nl.length; i++) {
-				if (getBase(nl[i]))
-					return;
 			}
+		}
 
-			// Check head
-			n = d.getElementsByTagName('head')[0];
-			if (n) {
-				nl = n.getElementsByTagName('script');
-				for (i=0; i<nl.length; i++) {
-					if (getBase(nl[i]))
-						return;
-				}
-			}
+		// Get document base path
+		this.documentBasePath = document.location.href;
+		if (this.documentBasePath.indexOf('?') != -1)
+			this.documentBasePath = this.documentBasePath.substring(0, this.documentBasePath.indexOf('?'));
+		this.documentURL = this.documentBasePath;
+		this.documentBasePath = this.documentBasePath.substring(0, this.documentBasePath.lastIndexOf('/'));
 
-			return;
-		},
+		// If not HTTP absolute
+		if (tinyMCE.baseURL.indexOf('://') == -1 && tinyMCE.baseURL.charAt(0) != '/') {
+			// If site absolute
+			tinyMCE.baseURL = this.documentBasePath + "/" + tinyMCE.baseURL;
+		}
 
-		is : function(o, t) {
-			if (!t)
-				return o !== undefined;
+		// Set default values on settings
+		this._def("mode", "none");
+		this._def("theme", "advanced");
+		this._def("plugins", "", true);
+		this._def("language", "en");
+		this._def("docs_language", this.settings.language);
+		this._def("elements", "");
+		this._def("textarea_trigger", "mce_editable");
+		this._def("editor_selector", "");
+		this._def("editor_deselector", "mceNoEditor");
+		this._def("valid_elements", "+a[id|style|rel|rev|charset|hreflang|dir|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],-strong/-b[class|style],-em/-i[class|style],-strike[class|style],-u[class|style],#p[id|style|dir|class|align],-ol[class|style],-ul[class|style],-li[class|style],br,img[id|dir|lang|longdesc|usemap|style|class|src|onmouseover|onmouseout|border|alt=|title|hspace|vspace|width|height|align],-sub[style|class],-sup[style|class],-blockquote[dir|style],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|style|dir|id|lang|bgcolor|background|bordercolor],-tr[id|lang|dir|class|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor],tbody[id|class],thead[id|class],tfoot[id|class],#td[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor|scope],-th[id|lang|dir|cla
 ss|colspan|rowspan|width|height|align|valign|style|scope],caption[id|lang|dir|class|style],-div[id|dir|class|align|style],-span[style|class|align],-pre[class|align|style],address[class|align|style],-h1[id|style|dir|class|align],-h2[id|style|dir|class|align],-h3[id|style|dir|class|align],-h4[id|style|dir|class|align],-h5[id|style|dir|class|align],-h6[id|style|dir|class|align],hr[class|style],-font[face|size|style|id|class|dir|color],dd[id|class|title|style|dir|lang],dl[id|class|title|style|dir|lang],dt[id|class|title|style|dir|lang],cite[title|id|class|style|dir|lang],abbr[title|id|class|style|dir|lang],acronym[title|id|class|style|dir|lang],del[title|id|class|style|dir|lang|datetime|cite],ins[title|id|class|style|dir|lang|datetime|cite]");
+		this._def("extended_valid_elements", "");
+		this._def("invalid_elements", "");
+		this._def("encoding", "");
+		this._def("urlconverter_callback", tinyMCE.getParam("urlconvertor_callback", "TinyMCE_Engine.prototype.convertURL"));
+		this._def("save_callback", "");
+		this._def("force_br_newlines", false);
+		this._def("force_p_newlines", true);
+		this._def("add_form_submit_trigger", true);
+		this._def("relative_urls", true);
+		this._def("remove_script_host", true);
+		this._def("focus_alert", true);
+		this._def("document_base_url", this.documentURL);
+		this._def("visual", true);
+		this._def("visual_table_class", "mceVisualAid");
+		this._def("setupcontent_callback", "");
+		this._def("fix_content_duplication", true);
+		this._def("custom_undo_redo", true);
+		this._def("custom_undo_redo_levels", -1);
+		this._def("custom_undo_redo_keyboard_shortcuts", true);
+		this._def("custom_undo_redo_restore_selection", true);
+		this._def("custom_undo_redo_global", false);
+		this._def("verify_html", true);
+		this._def("apply_source_formatting", false);
+		this._def("directionality", "ltr");
+		this._def("cleanup_on_startup", false);
+		this._def("inline_styles", false);
+		this._def("convert_newlines_to_brs", false);
+		this._def("auto_reset_designmode", true);
+		this._def("entities", "39,#39,160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255
 ,yuml,402,fnof,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,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,
 ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,34,quot,38,amp,60,lt,62,gt,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro", true);
+		this._def("entity_encoding", "named");
+		this._def("cleanup_callback", "");
+		this._def("add_unload_trigger", true);
+		this._def("ask", false);
+		this._def("nowrap", false);
+		this._def("auto_resize", false);
+		this._def("auto_focus", false);
+		this._def("cleanup", true);
+		this._def("remove_linebreaks", true);
+		this._def("button_tile_map", false);
+		this._def("submit_patch", true);
+		this._def("browsers", "msie,safari,gecko,opera", true);
+		this._def("dialog_type", "window");
+		this._def("accessibility_warnings", true);
+		this._def("accessibility_focus", true);
+		this._def("merge_styles_invalid_parents", "");
+		this._def("force_hex_style_colors", true);
+		this._def("trim_span_elements", true);
+		this._def("convert_fonts_to_spans", false);
+		this._def("doctype", '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">');
+		this._def("font_size_classes", '');
+		this._def("font_size_style_values", 'xx-small,x-small,small,medium,large,x-large,xx-large', true);
+		this._def("event_elements", 'a,img', true);
+		this._def("convert_urls", true);
+		this._def("table_inline_editing", false);
+		this._def("object_resizing", true);
+		this._def("custom_shortcuts", true);
+		this._def("convert_on_click", false);
+		this._def("content_css", '');
+		this._def("fix_list_elements", true);
+		this._def("fix_table_elements", false);
+		this._def("strict_loading_mode", document.contentType == 'application/xhtml+xml');
+		this._def("hidden_tab_class", '');
+		this._def("display_tab_class", '');
+		this._def("gecko_spellcheck", false);
+		this._def("hide_selects_on_submit", true);
+		this._def("forced_root_block", false);
+		this._def("remove_trailing_nbsp", false);
+		this._def("save_on_tinymce_forms", false);
 
-			if (t == 'array' && (o.hasOwnProperty && o instanceof Array))
-				return true;
+		// Force strict loading mode to false on non Gecko browsers
+		if (this.isMSIE && !this.isOpera)
+			this.settings.strict_loading_mode = false;
 
-			return typeof(o) == t;
-		},
+		// Browser check IE
+		if (this.isMSIE && this.settings.browsers.indexOf('msie') == -1)
+			return;
 
-		each : function(o, cb, s) {
-			var n, l;
+		// Browser check Gecko
+		if (this.isGecko && this.settings.browsers.indexOf('gecko') == -1)
+			return;
 
-			if (!o)
-				return 0;
+		// Browser check Safari
+		if (this.isSafari && this.settings.browsers.indexOf('safari') == -1)
+			return;
 
-			s = s || o;
+		// Browser check Opera
+		if (this.isOpera && this.settings.browsers.indexOf('opera') == -1)
+			return;
 
-			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;
-					}
-				}
-			}
+		// If not super absolute make it so
+		baseHREF = tinyMCE.settings.document_base_url;
+		h = document.location.href;
+		p = h.indexOf('://');
+		if (p > 0 && document.location.protocol != "file:") {
+			p = h.indexOf('/', p + 3);
+			h = h.substring(0, p);
 
-			return 1;
-		},
+			if (baseHREF.indexOf('://') == -1)
+				baseHREF = h + baseHREF;
 
+			tinyMCE.settings.document_base_url = baseHREF;
+			tinyMCE.settings.document_base_prefix = h;
+		}
 
-		map : function(a, f) {
-			var o = [];
+		// Trim away query part
+		if (baseHREF.indexOf('?') != -1)
+			baseHREF = baseHREF.substring(0, baseHREF.indexOf('?'));
 
-			tinymce.each(a, function(v) {
-				o.push(f(v));
-			});
+		this.settings.base_href = baseHREF.substring(0, baseHREF.lastIndexOf('/')) + "/";
 
-			return o;
-		},
+		theme = this.settings.theme;
+		this.inlineStrict = 'A|BR|SPAN|BDO|MAP|OBJECT|IMG|TT|I|B|BIG|SMALL|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|#text|#comment';
+		this.inlineTransitional = 'A|BR|SPAN|BDO|OBJECT|APPLET|IMG|MAP|IFRAME|TT|I|B|U|S|STRIKE|BIG|SMALL|FONT|BASEFONT|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|INPUT|SELECT|TEXTAREA|LABEL|BUTTON|#text|#comment';
+		this.blockElms = 'H[1-6]|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP';
+		this.blockRegExp = new RegExp("^(" + this.blockElms + ")$", "i");
+		this.posKeyCodes = [13,45,36,35,33,34,37,38,39,40];
+		this.uniqueURL = 'javascript:void(091039730);'; // Make unique URL non real URL
+		this.uniqueTag = '<div id="mceTMPElement" style="display: none">TMP</div>';
+		this.callbacks = ['onInit', 'getInfo', 'getEditorTemplate', 'setupContent', 'onChange', 'onPageLoad', 'handleNodeChange', 'initInstance', 'execCommand', 'getControlHTML', 'handleEvent', 'cleanup', 'removeInstance'];
 
-		grep : function(a, f) {
-			var o = [];
+		// Theme url
+		this.settings.theme_href = tinyMCE.baseURL + "/themes/" + theme;
 
-			tinymce.each(a, function(v) {
-				if (!f || f(v))
-					o.push(v);
-			});
+		if (!tinyMCE.isIE || tinyMCE.isOpera)
+			this.settings.force_br_newlines = false;
 
-			return o;
-		},
+		if (tinyMCE.getParam("popups_css", false)) {
+			cssPath = tinyMCE.getParam("popups_css", "");
 
-		inArray : function(a, v) {
-			var i, l;
+			// Is relative
+			if (cssPath.indexOf('://') == -1 && cssPath.charAt(0) != '/')
+				this.settings.popups_css = this.documentBasePath + "/" + cssPath;
+			else
+				this.settings.popups_css = cssPath;
+		} else
+			this.settings.popups_css = tinyMCE.baseURL + "/themes/" + theme + "/css/editor_popup.css";
 
-			if (a) {
-				for (i = 0, l = a.length; i < l; i++) {
-					if (a[i] === v)
-						return i;
-				}
-			}
+		if (tinyMCE.getParam("editor_css", false)) {
+			cssPath = tinyMCE.getParam("editor_css", "");
 
-			return -1;
-		},
+			// Is relative
+			if (cssPath.indexOf('://') == -1 && cssPath.charAt(0) != '/')
+				this.settings.editor_css = this.documentBasePath + "/" + cssPath;
+			else
+				this.settings.editor_css = cssPath;
+		} else {
+			if (this.settings.editor_css !== '')
+				this.settings.editor_css = tinyMCE.baseURL + "/themes/" + theme + "/css/editor_ui.css";
+		}
 
-		extend : function(o, e) {
-			var i, l, a = arguments;
+		// Only do this once
+		if (this.configs.length == 0) {
+			if (typeof(TinyMCECompressed) == "undefined") {
+				tinyMCE.addEvent(window, "DOMContentLoaded", TinyMCE_Engine.prototype.onLoad);
 
-			for (i = 1, l = a.length; i < l; i++) {
-				e = a[i];
-
-				tinymce.each(e, function(v, n) {
-					if (v !== undefined)
-						o[n] = v;
-				});
-			}
-
-			return o;
-		},
-
-
-		trim : function(s) {
-			return (s ? '' + s : '').replace(whiteSpaceRe, '');
-		},
-
-		create : function(s, p) {
-			var t = 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 = t.createNS(s[3].replace(/\.\w+$/, ''));
-
-			// 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];
-			t.extend(ns[cn].prototype, p);
-
-			// Extend
-			if (s[5]) {
-				sp = t.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);
-					};
+				if (tinyMCE.isRealIE) {
+					if (document.body)
+						tinyMCE.addEvent(document.body, "readystatechange", TinyMCE_Engine.prototype.onLoad);
+					else
+						tinyMCE.addEvent(document, "readystatechange", TinyMCE_Engine.prototype.onLoad);
 				}
-				ns[cn].prototype[cn] = ns[cn];
 
-				// Add super methods
-				t.each(sp, function(f, n) {
-					ns[cn].prototype[n] = sp[n];
-				});
-
-				// Add overridden methods
-				t.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;
-					}
-				});
+				tinyMCE.addEvent(window, "load", TinyMCE_Engine.prototype.onLoad);
+				tinyMCE._addUnloadEvents();
 			}
+		}
 
-			// Add static methods
-			t.each(p['static'], function(f, n) {
-				ns[cn][n] = f;
-			});
+		this.loadScript(tinyMCE.baseURL + '/themes/' + this.settings.theme + '/editor_template' + tinyMCE.srcMode + '.js');
+		this.loadScript(tinyMCE.baseURL + '/langs/' + this.settings.language +  '.js');
+		this.loadCSS(this.settings.editor_css);
 
-			if (this.onCreate)
-				this.onCreate(s[2], s[3], ns[cn].prototype);
-		},
-
-		walk : function(o, f, n, s) {
-			s = s || this;
-
-			if (o) {
-				if (n)
-					o = o[n];
-
-				tinymce.each(o, function(o, i) {
-					if (f.call(s, o, i, n) === false)
-						return false;
-
-					tinymce.walk(o, f, n, s);
-				});
+		// Add plugins
+		p = tinyMCE.getParam('plugins', '', true, ',');
+		if (p.length > 0) {
+			for (i=0; i<p.length; i++) {
+				if (p[i].charAt(0) != '-')
+					this.loadScript(tinyMCE.baseURL + '/plugins/' + p[i] + '/editor_plugin' + tinyMCE.srcMode + '.js');
 			}
-		},
+		}
 
-		createNS : function(n, o) {
-			var i, v;
+		// Setup entities
+		if (tinyMCE.getParam('entity_encoding') == 'named') {
+			settings.cleanup_entities = [];
+			entities = tinyMCE.getParam('entities', '', true, ',');
+			for (i=0; i<entities.length; i+=2)
+				settings.cleanup_entities['c' + entities[i]] = entities[i+1];
+		}
 
-			o = o || win;
+		// Save away this config
+		settings.index = this.configs.length;
+		this.configs[this.configs.length] = settings;
 
-			n = n.split('.');
-			for (i=0; i<n.length; i++) {
-				v = n[i];
+		// Start loading first one in chain
+		this.loadNextScript();
 
-				if (!o[v])
-					o[v] = {};
-
-				o = o[v];
+		// Force flicker free CSS backgrounds in IE
+		if (this.isIE && !this.isOpera) {
+			try {
+				document.execCommand('BackgroundImageCache', false, true);
+			} catch (e) {
+				// Ignore
 			}
+		}
 
-			return o;
-		},
+		// Setup XML encoding regexps
+		this.xmlEncodeRe = new RegExp('[<>&"]', 'g');
+	},
 
-		resolve : function(n, o) {
-			var i, l;
+	_addUnloadEvents : function() {
+		var st = tinyMCE.settings.add_unload_trigger;
 
-			o = o || win;
-
-			n = n.split('.');
-			for (i = 0, l = n.length; i < l; i++) {
-				o = o[n[i]];
-
-				if (!o)
-					break;
+		if (tinyMCE.isIE) {
+			if (st) {
+				tinyMCE.addEvent(window, "unload", TinyMCE_Engine.prototype.unloadHandler);
+				tinyMCE.addEvent(window.document, "beforeunload", TinyMCE_Engine.prototype.unloadHandler);
 			}
+		} else {
+			if (st)
+				tinyMCE.addEvent(window, "unload", function () {tinyMCE.triggerSave(true, true);});
+		}
+	},
 
-			return o;
-		},
+	_def : function(key, def_val, t) {
+		var v = tinyMCE.getParam(key, def_val);
 
-		addUnload : function(f, s) {
-			var t = this;
+		v = t ? v.replace(/\s+/g, "") : v;
 
-			f = {func : f, scope : s || this};
+		this.settings[key] = v;
+	},
 
-			if (!t.unloads) {
-				function unload() {
-					var li = t.unloads, o, n;
+	hasPlugin : function(n) {
+		return typeof(this.plugins[n]) != "undefined" && this.plugins[n] != null;
+	},
 
-					if (li) {
-						// Call unload handlers
-						for (n in li) {
-							o = li[n];
+	addPlugin : function(n, p) {
+		var op = this.plugins[n];
 
-							if (o && o.func)
-								o.func.call(o.scope, 1); // Send in one arg to distinct unload and user destroy
-						}
+		// Use the previous plugin object base URL used when loading external plugins
+		p.baseURL = op ? op.baseURL : tinyMCE.baseURL + "/plugins/" + n;
+		this.plugins[n] = p;
 
-						// Detach unload function
-						if (win.detachEvent) {
-							win.detachEvent('onbeforeunload', fakeUnload);
-							win.detachEvent('onunload', unload);
-						} else if (win.removeEventListener)
-							win.removeEventListener('unload', unload, false);
+		this.loadNextScript();
+	},
 
-						// Destroy references
-						t.unloads = o = li = w = unload = 0;
+	setPluginBaseURL : function(n, u) {
+		var op = this.plugins[n];
 
-						// Run garbarge collector on IE
-						if (win.CollectGarbage)
-							CollectGarbage();
-					}
-				};
+		if (op)
+			op.baseURL = u;
+		else
+			this.plugins[n] = {baseURL : u};
+	},
 
-				function fakeUnload() {
-					var d = document;
+	loadPlugin : function(n, u) {
+		u = u.indexOf('.js') != -1 ? u.substring(0, u.lastIndexOf('/')) : u;
+		u = u.charAt(u.length-1) == '/' ? u.substring(0, u.length-1) : u;
+		this.plugins[n] = {baseURL : u};
+		this.loadScript(u + "/editor_plugin" + (tinyMCE.srcMode ? '_src' : '') + ".js");
+	},
 
-					// Is there things still loading, then do some magic
-					if (d.readyState == 'interactive') {
-						function stop() {
-							// Prevent memory leak
-							d.detachEvent('onstop', stop);
-
-							// Call unload handler
-							if (unload)
-								unload();
-
-							d = 0;
-						};
-
-						// Fire unload when the currently loading page is stopped
-						if (d)
-							d.attachEvent('onstop', stop);
-
-						// Remove onstop listener after a while to prevent the unload function
-						// to execute if the user presses cancel in an onbeforeunload
-						// confirm dialog and then presses the browser stop button
-						win.setTimeout(function() {
-							if (d)
-								d.detachEvent('onstop', stop);
-						}, 0);
-					}
-				};
-
-				// Attach unload handler
-				if (win.attachEvent) {
-					win.attachEvent('onunload', unload);
-					win.attachEvent('onbeforeunload', fakeUnload);
-				} else if (win.addEventListener)
-					win.addEventListener('unload', unload, false);
-
-				// Setup initial unload handler array
-				t.unloads = [f];
-			} else
-				t.unloads.push(f);
-
-			return f;
-		},
-
-		removeUnload : function(f) {
-			var u = this.unloads, r = null;
-
-			tinymce.each(u, function(o, i) {
-				if (o && o.func == f) {
-					u.splice(i, 1);
-					r = f;
-					return false;
-				}
-			});
-
-			return r;
-		},
-
-		explode : function(s, d) {
-			return s ? tinymce.map(s.split(d || ','), tinymce.trim) : s;
-		},
-
-		_addVer : function(u) {
-			var v;
-
-			if (!this.query)
-				return u;
-
-			v = (u.indexOf('?') == -1 ? '?' : '&') + this.query;
-
-			if (u.indexOf('#') == -1)
-				return u + v;
-
-			return u.replace('#', v + '#');
-		}
-
-		};
-
-	// Initialize the API
-	tinymce._init();
-
-	// Expose tinymce namespace to the global namespace (window)
-	win.tinymce = win.tinyMCE = tinymce;
-})(window);
-
-
-tinymce.create('tinymce.util.Dispatcher', {
-	scope : null,
-	listeners : null,
-
-	Dispatcher : function(s) {
-		this.scope = s || this;
-		this.listeners = [];
+	hasTheme : function(n) {
+		return typeof(this.themes[n]) != "undefined" && this.themes[n] != null;
 	},
 
-	add : function(cb, s) {
-		this.listeners.push({cb : cb, scope : s || this.scope});
+	addTheme : function(n, t) {
+		this.themes[n] = t;
 
-		return cb;
+		this.loadNextScript();
 	},
 
-	addToTop : function(cb, s) {
-		this.listeners.unshift({cb : cb, scope : s || this.scope});
-
-		return cb;
+	addMenu : function(n, m) {
+		this.menus[n] = m;
 	},
 
-	remove : function(cb) {
-		var l = this.listeners, o = null;
-
-		tinymce.each(l, function(c, i) {
-			if (cb == c.cb) {
-				o = cb;
-				l.splice(i, 1);
-				return false;
-			}
-		});
-
-		return o;
+	hasMenu : function(n) {
+		return typeof(this.plugins[n]) != "undefined" && this.plugins[n] != null;
 	},
 
-	dispatch : function() {
-		var s, a = arguments, i, li = this.listeners, c;
+	loadScript : function(url) {
+		var i;
 
-		// Needs to be a real loop since the listener count might change while looping
-		// And this is also more efficient
-		for (i = 0; i<li.length; i++) {
-			c = li[i];
-			s = c.cb.apply(c.scope, a);
-
-			if (s === false)
-				break;
+		for (i=0; i<this.loadedFiles.length; i++) {
+			if (this.loadedFiles[i] == url)
+				return;
 		}
 
-		return s;
-	}
+		if (tinyMCE.settings.strict_loading_mode)
+			this.pendingFiles[this.pendingFiles.length] = url;
+		else
+			document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '"></script>');
 
-	});
+		this.loadedFiles[this.loadedFiles.length] = url;
+	},
 
-(function() {
-	var each = tinymce.each;
+	loadNextScript : function() {
+		var d = document, se;
 
-	tinymce.create('tinymce.util.URI', {
-		URI : function(u, s) {
-			var t = this, o, a, b;
+		if (!tinyMCE.settings.strict_loading_mode)
+			return;
 
-			// Trim whitespace
-			u = tinymce.trim(u);
+		if (this.loadingIndex < this.pendingFiles.length) {
+			se = d.createElementNS('http://www.w3.org/1999/xhtml', 'script');
+			se.setAttribute('language', 'javascript');
+			se.setAttribute('type', 'text/javascript');
+			se.setAttribute('src', this.pendingFiles[this.loadingIndex++]);
 
-			// Default settings
-			s = t.settings = s || {};
+			d.getElementsByTagName("head")[0].appendChild(se);
+		} else
+			this.loadingIndex = -1; // Done with loading
+	},
 
-			// Strange app protocol or local anchor
-			if (/^(mailto|tel|news|javascript|about|data):/i.test(u) || /^\s*#/.test(u)) {
-				t.source = u;
-				return;
-			}
+	loadCSS : function(url) {
+		var ar = url.replace(/\s+/, '').split(',');
+		var lflen = 0, csslen = 0, skip = false;
+		var x = 0, i = 0, nl, le;
 
-			// Absolute path with no host, fake host and protocol
-			if (u.indexOf('/') === 0 && u.indexOf('//') !== 0)
-				u = (s.base_uri ? s.base_uri.protocol || 'http' : 'http') + '://mce_host' + u;
-
-			// Relative path http:// or protocol relative //path
-			if (!/^\w*:?\/\//.test(u))
-				u = (s.base_uri.protocol || 'http') + '://mce_host' + t.toAbsPath(s.base_uri.path, u);
-
-			// Parse URL (Credits goes to Steave, http://blog.stevenlevithan.com/archives/parseuri)
-			u = u.replace(/@@/g, '(mce_at)'); // Zope 3 workaround, they use @@something
-			u = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(u);
-			each(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], function(v, i) {
-				var s = u[i];
-
-				// Zope 3 workaround, they use @@something
-				if (s)
-					s = s.replace(/\(mce_at\)/g, '@@');
-
-				t[v] = s;
-			});
-
-			if (b = s.base_uri) {
-				if (!t.protocol)
-					t.protocol = b.protocol;
-
-				if (!t.userInfo)
-					t.userInfo = b.userInfo;
-
-				if (!t.port && t.host == 'mce_host')
-					t.port = b.port;
-
-				if (!t.host || t.host == 'mce_host')
-					t.host = b.host;
-
-				t.source = '';
-			}
-
-			//t.path = t.path || '/';
-		},
-
-		setPath : function(p) {
-			var t = this;
-
-			p = /^(.*?)\/?(\w+)?$/.exec(p);
-
-			// Update path parts
-			t.path = p[0];
-			t.directory = p[1];
-			t.file = p[2];
-
-			// Rebuild source
-			t.source = '';
-			t.getURI();
-		},
-
-		toRelative : function(u) {
-			var t = this, o;
-
-			if (u === "./")
-				return u;
-
-			u = new tinymce.util.URI(u, {base_uri : t});
-
-			// Not on same domain/port or protocol
-			if ((u.host != 'mce_host' && t.host != u.host && u.host) || t.port != u.port || t.protocol != u.protocol)
-				return u.getURI();
-
-			o = t.toRelPath(t.path, u.path);
-
-			// Add query
-			if (u.query)
-				o += '?' + u.query;
-
-			// Add anchor
-			if (u.anchor)
-				o += '#' + u.anchor;
-
-			return o;
-		},
-	
-		toAbsolute : function(u, nh) {
-			var u = new tinymce.util.URI(u, {base_uri : this});
-
-			return u.getURI(this.host == u.host && this.protocol == u.protocol ? nh : 0);
-		},
-
-		toRelPath : function(base, path) {
-			var items, bp = 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]) {
-						bp = i + 1;
+		for (x = 0,csslen = ar.length; x<csslen; x++) {
+			if (ar[x] != null && ar[x] != 'null' && ar[x].length > 0) {
+				/* Make sure it doesn't exist. */
+				for (i=0, lflen=this.loadedFiles.length; i<lflen; i++) {
+					if (this.loadedFiles[i] == ar[x]) {
+						skip = true;
 						break;
 					}
 				}
-			}
 
-			if (base.length < items.length) {
-				for (i = 0, l = items.length; i < l; i++) {
-					if (i >= base.length || base[i] != items[i]) {
-						bp = i + 1;
-						break;
-					}
-				}
-			}
+				if (!skip) {
+					if (tinyMCE.settings.strict_loading_mode) {
+						nl = document.getElementsByTagName("head");
 
-			if (bp == 1)
-				return path;
+						le = document.createElement('link');
+						le.setAttribute('href', ar[x]);
+						le.setAttribute('rel', 'stylesheet');
+						le.setAttribute('type', 'text/css');
 
-			for (i = 0, l = base.length - (bp - 1); i < l; i++)
-				out += "../";
+						nl[0].appendChild(le);			
+					} else
+						document.write('<link href="' + ar[x] + '" rel="stylesheet" type="text/css" />');
 
-			for (i = bp - 1, l = items.length; i < l; i++) {
-				if (i != bp - 1)
-					out += "/" + items[i];
-				else
-					out += items[i];
+					this.loadedFiles[this.loadedFiles.length] = ar[x];
+				}
 			}
+		}
+	},
 
-			return out;
-		},
+	importCSS : function(doc, css) {
+		var css_ary = css.replace(/\s+/, '').split(',');
+		var csslen, elm, headArr, x, css_file;
 
-		toAbsPath : function(base, path) {
-			var i, nb = 0, o = [], tr, outPath;
+		for (x = 0, csslen = css_ary.length; x<csslen; x++) {
+			css_file = css_ary[x];
 
-			// Split paths
-			tr = /\/$/.test(path) ? '/' : '';
-			base = base.split('/');
-			path = path.split('/');
+			if (css_file != null && css_file != 'null' && css_file.length > 0) {
+				// Is relative, make absolute
+				if (css_file.indexOf('://') == -1 && css_file.charAt(0) != '/')
+					css_file = this.documentBasePath + "/" + css_file;
 
-			// Remove empty chunks
-			each(base, function(k) {
-				if (k)
-					o.push(k);
-			});
+				if (typeof(doc.createStyleSheet) == "undefined") {
+					elm = doc.createElement("link");
 
-			base = o;
+					elm.rel = "stylesheet";
+					elm.href = css_file;
 
-			// 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]);
+					if ((headArr = doc.getElementsByTagName("head")) != null && headArr.length > 0)
+						headArr[0].appendChild(elm);
+				} else
+					doc.createStyleSheet(css_file);
 			}
+		}
+	},
 
-			i = base.length - nb;
+	confirmAdd : function(e, settings) {
+		var elm = tinyMCE.isIE ? event.srcElement : e.target;
+		var elementId = elm.name ? elm.name : elm.id;
 
-			// If /a/b/c or /
-			if (i <= 0)
-				outPath = o.reverse().join('/');
-			else
-				outPath = base.slice(0, i).join('/') + '/' + o.reverse().join('/');
+		tinyMCE.settings = settings;
 
-			// Add front / if it's needed
-			if (outPath.indexOf('/') !== 0)
-				outPath = '/' + outPath;
+		if (tinyMCE.settings.convert_on_click || (!elm.getAttribute('mce_noask') && confirm(tinyMCELang.lang_edit_confirm)))
+			tinyMCE.addMCEControl(elm, elementId);
 
-			// Add traling / if it's needed
-			if (tr && outPath.lastIndexOf('/') !== outPath.length - 1)
-				outPath += tr;
+		elm.setAttribute('mce_noask', 'true');
+	},
 
-			return outPath;
-		},
+	updateContent : function(form_element_name) {
+		var formElement, n, inst, doc;
 
-		getURI : function(nh) {
-			var s, t = this;
+		// Find MCE instance linked to given form element and copy it's value
+		formElement = document.getElementById(form_element_name);
+		for (n in tinyMCE.instances) {
+			inst = tinyMCE.instances[n];
 
-			// Rebuild source
-			if (!t.source || nh) {
-				s = '';
+			if (!tinyMCE.isInstance(inst))
+				continue;
 
-				if (!nh) {
-					if (t.protocol)
-						s += t.protocol + '://';
+			inst.switchSettings();
 
-					if (t.userInfo)
-						s += t.userInfo + '@';
+			if (inst.formElement == formElement) {
+				doc = inst.getDoc();
 
-					if (t.host)
-						s += t.host;
+				tinyMCE._setHTML(doc, inst.formElement.value);
 
-					if (t.port)
-						s += ':' + t.port;
-				}
-
-				if (t.path)
-					s += t.path;
-
-				if (t.query)
-					s += '?' + t.query;
-
-				if (t.anchor)
-					s += '#' + t.anchor;
-
-				t.source = s;
+				if (!tinyMCE.isIE)
+					doc.body.innerHTML = tinyMCE._cleanupHTML(inst, doc, this.settings, doc.body, inst.visualAid);
 			}
-
-			return t.source;
 		}
-	});
-})();
+	},
 
-(function() {
-	var each = tinymce.each;
+	addMCEControl : function(replace_element, form_element_name, target_document) {
+		var id = "mce_editor_" + tinyMCE.idCounter++;
+		var inst = new TinyMCE_Control(tinyMCE.settings);
 
-	tinymce.create('static tinymce.util.Cookie', {
-		getHash : function(n) {
-			var v = this.get(n), h;
+		inst.editorId = id;
+		this.instances[id] = inst;
 
-			if (v) {
-				each(v.split('&'), function(v) {
-					v = v.split('=');
-					h = h || {};
-					h[unescape(v[0])] = unescape(v[1]);
-				});
-			}
+		inst._onAdd(replace_element, form_element_name, target_document);
+	},
 
-			return h;
-		},
+	removeInstance : function(ti) {
+		var t = [], n, i;
 
-		setHash : function(n, v, e, p, d, s) {
-			var o = '';
+		// Remove from instances
+		for (n in tinyMCE.instances) {
+			i = tinyMCE.instances[n];
 
-			each(v, function(v, k) {
-				o += (!o ? '' : '&') + escape(k) + '=' + escape(v);
-			});
+			if (tinyMCE.isInstance(i) && ti != i)
+					t[n] = i;
+		}
 
-			this.set(n, o, e, p, d, s);
-		},
+		tinyMCE.instances = t;
 
-		get : function(n) {
-			var c = document.cookie, e, p = n + "=", b;
+		// Remove from global undo/redo
+		n = [];
+		t = tinyMCE.undoLevels;
 
-			// Strict mode
-			if (!c)
-				return;
-
-			b = c.indexOf("; " + p);
-
-			if (b == -1) {
-				b = c.indexOf(p);
-
-				if (b != 0)
-					return null;
-			} else
-				b += 2;
-
-			e = c.indexOf(";", b);
-
-			if (e == -1)
-				e = c.length;
-
-			return unescape(c.substring(b + p.length, e));
-		},
-
-		set : function(n, v, e, p, d, s) {
-			document.cookie = n + "=" + escape(v) +
-				((e) ? "; expires=" + e.toGMTString() : "") +
-				((p) ? "; path=" + escape(p) : "") +
-				((d) ? "; domain=" + d : "") +
-				((s) ? "; secure" : "");
-		},
-
-		remove : function(n, p) {
-			var d = new Date();
-
-			d.setTime(d.getTime() - 1000);
-
-			this.set(n, '', d, p, d);
+		for (i=0; i<t.length; i++) {
+			if (t[i] != ti)
+				n.push(t[i]);
 		}
-	});
-})();
 
-tinymce.create('static tinymce.util.JSON', {
-	serialize : function(o) {
-		var i, v, s = tinymce.util.JSON.serialize, t;
+		tinyMCE.undoLevels = n;
+		tinyMCE.undoIndex = n.length;
 
-		if (o == null)
-			return 'null';
+		// Dispatch remove instance call
+		tinyMCE.dispatchCallback(ti, 'remove_instance_callback', 'removeInstance', ti);
 
-		t = typeof o;
+		return ti;
+	},
 
-		if (t == 'string') {
-			v = '\bb\tt\nn\ff\rr\""\'\'\\\\';
+	removeMCEControl : function(editor_id) {
+		var inst = tinyMCE.getInstanceById(editor_id), h, re, ot, tn, n;
 
-			return '"' + o.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g, function(a, b) {
-				i = v.indexOf(b);
+		if (inst) {
+			inst.switchSettings();
 
-				if (i + 1)
-					return '\\' + v.charAt(i + 1);
+			editor_id = inst.editorId;
+			h = tinyMCE.getContent(editor_id);
 
-				a = b.charCodeAt().toString(16);
+			this.removeInstance(inst);
 
-				return '\\u' + '0000'.substring(a.length) + a;
-			}) + '"';
-		}
+			tinyMCE.selectedElement = null;
+			tinyMCE.selectedInstance = null;
 
-		if (t == 'object') {
-			if (o.hasOwnProperty && o instanceof Array) {
-					for (i=0, v = '['; i<o.length; i++)
-						v += (i > 0 ? ',' : '') + s(o[i]);
+			tinyMCE.selectedElement = null;
+			tinyMCE.selectedInstance = null;
 
-					return v + ']';
-				}
+			// Try finding an instance
+			for (n in tinyMCE.instances) {
+				if (!tinyMCE.isInstance(tinyMCE.instances[n]))
+					continue;
 
-				v = '{';
+				tinyMCE.selectedInstance = tinyMCE.instances[n];
+				break;
+			}
 
-				for (i in o)
-					v += typeof o[i] != 'function' ? (v.length > 1 ? ',"' : '"') + i + '":' + s(o[i]) : '';
+			// Remove element
+			re = document.getElementById(editor_id + "_parent");
+			ot = inst.oldTargetElement;
+			tn = ot.nodeName.toLowerCase();
 
-				return v + '}';
+			if (tn == "textarea" || tn == "input") {
+				re.parentNode.removeChild(re);
+				ot.style.display = "inline";
+				ot.value = h;
+			} else {
+				ot.innerHTML = h;
+				ot.style.display = 'block';
+				re.parentNode.insertBefore(ot, re);
+				re.parentNode.removeChild(re);
+			}
 		}
-
-		return '' + o;
 	},
 
-	parse : function(s) {
-		try {
-			return eval('(' + s + ')');
-		} catch (ex) {
-			// Ignore
-		}
-	}
+	triggerSave : function(skip_cleanup, skip_callback) {
+		var inst, n;
 
-	});
+		// Default to false
+		if (typeof(skip_cleanup) == "undefined")
+			skip_cleanup = false;
 
-tinymce.create('static tinymce.util.XHR', {
-	send : function(o) {
-		var x, t, w = window, c = 0;
+		// Default to false
+		if (typeof(skip_callback) == "undefined")
+			skip_callback = false;
 
-		// Default settings
-		o.scope = o.scope || this;
-		o.success_scope = o.success_scope || o.scope;
-		o.error_scope = o.error_scope || o.scope;
-		o.async = o.async === false ? false : true;
-		o.data = o.data || '';
+		// Cleanup and set all form fields
+		for (n in tinyMCE.instances) {
+			inst = tinyMCE.instances[n];
 
-		function get(s) {
-			x = 0;
+			if (!tinyMCE.isInstance(inst))
+				continue;
 
-			try {
-				x = new ActiveXObject(s);
-			} catch (ex) {
-			}
-
-			return x;
-		};
-
-		x = w.XMLHttpRequest ? new XMLHttpRequest() : get('Microsoft.XMLHTTP') || get('Msxml2.XMLHTTP');
-
-		if (x) {
-			if (x.overrideMimeType)
-				x.overrideMimeType(o.content_type);
-
-			x.open(o.type || (o.data ? 'POST' : 'GET'), o.url, o.async);
-
-			if (o.content_type)
-				x.setRequestHeader('Content-Type', o.content_type);
-
-			x.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
-
-			x.send(o.data);
-
-			function ready() {
-				if (!o.async || x.readyState == 4 || c++ > 10000) {
-					if (o.success && c < 10000 && x.status == 200)
-						o.success.call(o.success_scope, '' + x.responseText, x, o);
-					else if (o.error)
-						o.error.call(o.error_scope, c > 10000 ? 'TIMED_OUT' : 'GENERAL', x, o);
-
-					x = null;
-				} else
-					w.setTimeout(ready, 10);
-			};
-
-			// Syncronous request
-			if (!o.async)
-				return ready();
-
-			// Wait for response, onReadyStateChange can not be used since it leaks memory in IE
-			t = w.setTimeout(ready, 10);
+			inst.triggerSave(skip_cleanup, skip_callback);
 		}
-	}
-});
+	},
 
-(function() {
-	var extend = tinymce.extend, JSON = tinymce.util.JSON, XHR = tinymce.util.XHR;
+	resetForm : function(form_index) {
+		var i, inst, n, formObj = document.forms[form_index];
 
-	tinymce.create('tinymce.util.JSONRequest', {
-		JSONRequest : function(s) {
-			this.settings = extend({
-			}, s);
-			this.count = 0;
-		},
+		for (n in tinyMCE.instances) {
+			inst = tinyMCE.instances[n];
 
-		send : function(o) {
-			var ecb = o.error, scb = o.success;
+			if (!tinyMCE.isInstance(inst))
+				continue;
 
-			o = extend(this.settings, o);
+			inst.switchSettings();
 
-			o.success = function(c, x) {
-				c = JSON.parse(c);
-
-				if (typeof(c) == 'undefined') {
-					c = {
-						error : 'JSON Parse error.'
-					};
-				}
-
-				if (c.error)
-					ecb.call(o.error_scope || o.scope, c.error, x);
-				else
-					scb.call(o.success_scope || o.scope, c.result);
-			};
-
-			o.error = function(ty, x) {
-				ecb.call(o.error_scope || o.scope, ty, x);
-			};
-
-			o.data = JSON.serialize({
-				id : o.id || 'c' + (this.count++),
-				method : o.method,
-				params : o.params
-			});
-
-			// JSON content type for Ruby on rails. Bug: #1883287
-			o.content_type = 'application/json';
-
-			XHR.send(o);
-		},
-
-		'static' : {
-			sendRPC : function(o) {
-				return new tinymce.util.JSONRequest().send(o);
+			for (i=0; i<formObj.elements.length; i++) {
+				if (inst.formTargetElementId == formObj.elements[i].name)
+					inst.getBody().innerHTML = inst.startContent;
 			}
 		}
-	});
-}());
-(function(tinymce) {
-	// Shorten names
-	var each = tinymce.each,
-		is = tinymce.is,
-		isWebKit = tinymce.isWebKit,
-		isIE = tinymce.isIE,
-		blockRe = /^(H[1-6R]|P|DIV|ADDRESS|PRE|FORM|T(ABLE|BODY|HEAD|FOOT|H|R|D)|LI|OL|UL|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|MENU|ISINDEX|SAMP)$/,
-		boolAttrs = makeMap('checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected'),
-		mceAttribs = makeMap('src,href,style,coords,shape'),
-		encodedChars = {'&' : '&', '"' : '"', '<' : '<', '>' : '>'},
-		encodeCharsRe = /[<>&\"]/g,
-		simpleSelectorRe = /^([a-z0-9],?)+$/i,
-		tagRegExp = /<(\w+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)(\s*\/?)>/g,
-		attrRegExp = /(\w+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;
+	},
 
-	function makeMap(str) {
-		var map = {}, i;
+	execInstanceCommand : function(editor_id, command, user_interface, value, focus) {
+		var inst = tinyMCE.getInstanceById(editor_id), r;
 
-		str = str.split(',');
-		for (i = str.length; i >= 0; i--)
-			map[str[i]] = 1;
+		if (inst) {
+			r = inst.selection.getRng();
 
-		return map;
-	};
+			if (typeof(focus) == "undefined")
+				focus = true;
 
-	tinymce.create('tinymce.dom.DOMUtils', {
-		doc : null,
-		root : null,
-		files : null,
-		pixelStyles : /^(top|left|bottom|right|width|height|borderWidth)$/,
-		props : {
-			"for" : "htmlFor",
-			"class" : "className",
-			className : "className",
-			checked : "checked",
-			disabled : "disabled",
-			maxlength : "maxLength",
-			readonly : "readOnly",
-			selected : "selected",
-			value : "value",
-			id : "id",
-			name : "name",
-			type : "type"
-		},
+			// IE bug lost focus on images in absolute divs Bug #1534575
+			if (focus && (!r || !r.item))
+				inst.contentWindow.focus();
 
-		DOMUtils : function(d, s) {
-			var t = this, globalStyle;
+			// Reset design mode if lost
+			inst.autoResetDesignMode();
 
-			t.doc = d;
-			t.win = window;
-			t.files = {};
-			t.cssFlicker = false;
-			t.counter = 0;
-			t.boxModel = !tinymce.isIE || d.compatMode == "CSS1Compat"; 
-			t.stdMode = d.documentMode === 8;
+			this.selectedElement = inst.getFocusElement();
+			inst.select();
+			tinyMCE.execCommand(command, user_interface, value);
 
-			t.settings = s = tinymce.extend({
-				keep_values : false,
-				hex_colors : 1,
-				process_html : 1
-			}, s);
+			// Cancel event so it doesn't call onbeforeonunlaod
+			if (tinyMCE.isIE && window.event != null)
+				tinyMCE.cancelEvent(window.event);
+		}
+	},
 
-			// Fix IE6SP2 flicker and check it failed for pre SP2
-			if (tinymce.isIE6) {
-				try {
-					d.execCommand('BackgroundImageCache', false, true);
-				} catch (e) {
-					t.cssFlicker = true;
-				}
-			}
+	execCommand : function(command, user_interface, value) {
+		var inst = tinyMCE.selectedInstance, n, pe, te;
 
-			// Build styles list
-			if (s.valid_styles) {
-				t._styles = {};
+		// Default input
+		user_interface = user_interface ? user_interface : false;
+		value = value ? value : null;
 
-				// Convert styles into a rule list
-				each(s.valid_styles, function(value, key) {
-					t._styles[key] = tinymce.explode(value);
-				});
-			}
+		if (inst)
+			inst.switchSettings();
 
-			tinymce.addUnload(t.destroy, t);
-		},
+		switch (command) {
+			case "Undo":
+				if (this.getParam('custom_undo_redo_global')) {
+					if (this.undoIndex > 0) {
+						tinyMCE.nextUndoRedoAction = 'Undo';
+						inst = this.undoLevels[--this.undoIndex];
+						inst.select();
 
-		getRoot : function() {
-			var t = this, s = t.settings;
+						if (!tinyMCE.nextUndoRedoInstanceId)
+							inst.execCommand('Undo');
+					}
+				} else
+					inst.execCommand('Undo');
+				return true;
 
-			return (s && t.get(s.root_element)) || t.doc.body;
-		},
+			case "Redo":
+				if (this.getParam('custom_undo_redo_global')) {
+					if (this.undoIndex <= this.undoLevels.length - 1) {
+						tinyMCE.nextUndoRedoAction = 'Redo';
+						inst = this.undoLevels[this.undoIndex++];
+						inst.select();
 
-		getViewPort : function(w) {
-			var d, b;
+						if (!tinyMCE.nextUndoRedoInstanceId)
+							inst.execCommand('Redo');
+					}
+				} else
+					inst.execCommand('Redo');
 
-			w = !w ? this.win : w;
-			d = w.document;
-			b = this.boxModel ? d.documentElement : d.body;
+				return true;
 
-			// Returns viewport size excluding scrollbars
-			return {
-				x : w.pageXOffset || b.scrollLeft,
-				y : w.pageYOffset || b.scrollTop,
-				w : w.innerWidth || b.clientWidth,
-				h : w.innerHeight || b.clientHeight
-			};
-		},
+			case 'mceFocus':
+				inst = tinyMCE.getInstanceById(value);
 
-		getRect : function(e) {
-			var p, t = this, sr;
+				if (inst)
+					inst.getWin().focus();
+			return;
 
-			e = t.get(e);
-			p = t.getPos(e);
-			sr = t.getSize(e);
+			case "mceAddControl":
+			case "mceAddEditor":
+				tinyMCE.addMCEControl(tinyMCE._getElementById(value), value);
+				return;
 
-			return {
-				x : p.x,
-				y : p.y,
-				w : sr.w,
-				h : sr.h
-			};
-		},
+			case "mceAddFrameControl":
+				tinyMCE.addMCEControl(tinyMCE._getElementById(value.element, value.document), value.element, value.document);
+				return;
 
-		getSize : function(e) {
-			var t = this, w, h;
+			case "mceRemoveControl":
+			case "mceRemoveEditor":
+				tinyMCE.removeMCEControl(value);
+				return;
 
-			e = t.get(e);
-			w = t.getStyle(e, 'width');
-			h = t.getStyle(e, 'height');
+			case "mceToggleEditor":
+				inst = tinyMCE.getInstanceById(value);
 
-			// Non pixel value, then force offset/clientWidth
-			if (w.indexOf('px') === -1)
-				w = 0;
+				if (inst) {
+					pe = document.getElementById(inst.editorId + '_parent');
+					te = inst.oldTargetElement;
 
-			// Non pixel value, then force offset/clientWidth
-			if (h.indexOf('px') === -1)
-				h = 0;
+					if (typeof(inst.enabled) == 'undefined')
+						inst.enabled = true;
 
-			return {
-				w : parseInt(w) || e.offsetWidth || e.clientWidth,
-				h : parseInt(h) || e.offsetHeight || e.clientHeight
-			};
-		},
+					inst.enabled = !inst.enabled;
 
-		getParent : function(n, f, r) {
-			return this.getParents(n, f, r, false);
-		},
+					if (!inst.enabled) {
+						pe.style.display = 'none';
 
-		getParents : function(n, f, r, c) {
-			var t = this, na, se = t.settings, o = [];
+						if (te.nodeName == 'TEXTAREA' || te.nodeName == 'INPUT')
+							te.value = inst.getHTML();
+						else
+							te.innerHTML = inst.getHTML();
 
-			n = t.get(n);
-			c = c === undefined;
+						te.style.display = inst.oldTargetDisplay;
+						tinyMCE.dispatchCallback(inst, 'hide_instance_callback', 'hideInstance', inst);
+					} else {
+						pe.style.display = 'block';
+						te.style.display = 'none';
 
-			if (se.strict_root)
-				r = r || t.getRoot();
+						if (te.nodeName == 'TEXTAREA' || te.nodeName == 'INPUT')
+							inst.setHTML(te.value);
+						else
+							inst.setHTML(te.innerHTML);
 
-			// Wrap node name as func
-			if (is(f, 'string')) {
-				na = f;
+						inst.useCSS = false;
+						tinyMCE.dispatchCallback(inst, 'show_instance_callback', 'showInstance', inst);
+					}
+				} else
+					tinyMCE.addMCEControl(tinyMCE._getElementById(value), value);
 
-				if (f === '*') {
-					f = function(n) {return n.nodeType == 1;};
-				} else {
-					f = function(n) {
-						return t.is(n, na);
-					};
-				}
-			}
+				return;
 
-			while (n) {
-				if (n == r || !n.nodeType || n.nodeType === 9)
-					break;
+			case "mceResetDesignMode":
+				// Resets the designmode state of the editors in Gecko
+				if (tinyMCE.isGecko) {
+					for (n in tinyMCE.instances) {
+						if (!tinyMCE.isInstance(tinyMCE.instances[n]))
+							continue;
 
-				if (!f || f(n)) {
-					if (c)
-						o.push(n);
-					else
-						return n;
+						try {
+							tinyMCE.instances[n].getDoc().designMode = "off";
+							tinyMCE.instances[n].getDoc().designMode = "on";
+							tinyMCE.instances[n].useCSS = false;
+						} catch (e) {
+							// Ignore any errors
+						}
+					}
 				}
 
-				n = n.parentNode;
-			}
+				return;
+		}
 
-			return c ? o : null;
-		},
+		if (inst) {
+			inst.execCommand(command, user_interface, value);
+		} else if (tinyMCE.settings.focus_alert)
+			alert(tinyMCELang.lang_focus_alert);
+	},
 
-		get : function(e) {
-			var n;
+	_createIFrame : function(replace_element, doc, win) {
+		var iframe, id = replace_element.getAttribute("id");
+		var aw, ah;
 
-			if (e && this.doc && typeof(e) == 'string') {
-				n = e;
-				e = this.doc.getElementById(e);
+		if (typeof(doc) == "undefined")
+			doc = document;
 
-				// IE and Opera returns meta elements when they match the specified input ID, but getElementsByName seems to do the trick
-				if (e && e.id !== n)
-					return this.doc.getElementsByName(n)[1];
-			}
+		if (typeof(win) == "undefined")
+			win = window;
 
-			return e;
-		},
+		iframe = doc.createElement("iframe");
 
-		getNext : function(node, selector) {
-			return this._findSib(node, selector, 'nextSibling');
-		},
+		aw = "" + tinyMCE.settings.area_width;
+		ah = "" + tinyMCE.settings.area_height;
 
-		getPrev : function(node, selector) {
-			return this._findSib(node, selector, 'previousSibling');
-		},
+		if (aw.indexOf('%') == -1) {
+			aw = parseInt(aw);
+			aw = (isNaN(aw) || aw < 0) ? 300 : aw;
+			aw = aw + "px";
+		}
 
+		if (ah.indexOf('%') == -1) {
+			ah = parseInt(ah);
+			ah = (isNaN(ah) || ah < 0) ? 240 : ah;
+			ah = ah + "px";
+		}
 
-		select : function(pa, s) {
-			var t = this;
+		iframe.setAttribute("id", id);
+		iframe.setAttribute("name", id);
+		iframe.setAttribute("class", "mceEditorIframe");
+		iframe.setAttribute("border", "0");
+		iframe.setAttribute("frameBorder", "0");
+		iframe.setAttribute("marginWidth", "0");
+		iframe.setAttribute("marginHeight", "0");
+		iframe.setAttribute("leftMargin", "0");
+		iframe.setAttribute("topMargin", "0");
+		iframe.setAttribute("width", aw);
+		iframe.setAttribute("height", ah);
+		iframe.setAttribute("allowtransparency", "true");
+		iframe.className = 'mceEditorIframe';
 
-			return tinymce.dom.Sizzle(pa, t.get(s) || t.get(t.settings.root_element) || t.doc, []);
-		},
+		if (tinyMCE.settings.auto_resize)
+			iframe.setAttribute("scrolling", "no");
 
-		is : function(n, selector) {
-			var i;
+		// Must have a src element in MSIE HTTPs breaks aswell as absoute URLs
+		if (tinyMCE.isRealIE)
+			iframe.setAttribute("src", this.settings.default_document);
 
-			// If it isn't an array then try to do some simple selectors instead of Sizzle for to boost performance
-			if (n.length === undefined) {
-				// Simple all selector
-				if (selector === '*')
-					return n.nodeType == 1;
+		iframe.style.width = aw;
+		iframe.style.height = ah;
 
-				// Simple selector just elements
-				if (simpleSelectorRe.test(selector)) {
-					selector = selector.toLowerCase().split(/,/);
-					n = n.nodeName.toLowerCase();
+		// Ugly hack for Gecko problem in strict mode
+		if (tinyMCE.settings.strict_loading_mode)
+			iframe.style.marginBottom = '-5px';
 
-					for (i = selector.length - 1; i >= 0; i--) {
-						if (selector[i] == n)
-							return true;
-					}
+		// MSIE 5.0 issue
+		if (tinyMCE.isRealIE)
+			replace_element.outerHTML = iframe.outerHTML;
+		else
+			replace_element.parentNode.replaceChild(iframe, replace_element);
 
-					return false;
-				}
-			}
+		if (tinyMCE.isRealIE)
+			return win.frames[id];
+		else
+			return iframe;
+	},
 
-			return tinymce.dom.Sizzle.matches(selector, n.nodeType ? [n] : n).length > 0;
-		},
+	setupContent : function(editor_id) {
+		var inst = tinyMCE.instances[editor_id], i, doc = inst.getDoc(), head = doc.getElementsByTagName('head').item(0);
+		var content = inst.startContent, contentElement, body;
 
+		// HTML values get XML encoded in strict mode
+		if (tinyMCE.settings.strict_loading_mode) {
+			content = content.replace(/</g, '<');
+			content = content.replace(/>/g, '>');
+			content = content.replace(/"/g, '"');
+			content = content.replace(/&/g, '&');
+		}
 
-		add : function(p, n, a, h, c) {
-			var t = this;
+		tinyMCE.selectedInstance = inst;
+		inst.switchSettings();
 
-			return this.run(p, function(p) {
-				var e, k;
+		// Not loaded correctly hit it again, Mozilla bug #997860
+		if (!tinyMCE.isIE && tinyMCE.getParam("setupcontent_reload", false) && doc.title != "blank_page") {
+			// This part will remove the designMode status
+			// Failes first time in Firefox 1.5b2 on Mac
+			try {doc.location.href = tinyMCE.baseURL + "/blank.htm";} catch (ex) {}
+			window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 1000);
+			return;
+		}
 
-				e = is(n, 'string') ? t.doc.createElement(n) : n;
-				t.setAttribs(e, a);
+		// Wait for it to load
+		if (!head || !doc.body) {
+			window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 10);
+			return;
+		}
 
-				if (h) {
-					if (h.nodeType)
-						e.appendChild(h);
-					else
-						t.setHTML(e, h);
-				}
+		// Import theme specific content CSS the user specific
+		tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/themes/" + inst.settings.theme + "/css/editor_content.css");
+		tinyMCE.importCSS(inst.getDoc(), inst.settings.content_css);
+		tinyMCE.dispatchCallback(inst, 'init_instance_callback', 'initInstance', inst);
 
-				return !c ? p.appendChild(e) : e;
-			});
-		},
+		// Setup keyboard shortcuts
+		if (tinyMCE.getParam('custom_undo_redo_keyboard_shortcuts')) {
+			inst.addShortcut('ctrl', 'z', 'lang_undo_desc', 'Undo');
+			inst.addShortcut('ctrl', 'y', 'lang_redo_desc', 'Redo');
+		}
 
-		create : function(n, a, h) {
-			return this.add(this.doc.createElement(n), n, a, h, 1);
-		},
+		// BlockFormat shortcuts keys
+		for (i=1; i<=6; i++)
+			inst.addShortcut('ctrl', '' + i, '', 'FormatBlock', false, '<h' + i + '>');
 
-		createHTML : function(n, a, h) {
-			var o = '', t = this, k;
+		inst.addShortcut('ctrl', '7', '', 'FormatBlock', false, '<p>');
+		inst.addShortcut('ctrl', '8', '', 'FormatBlock', false, '<div>');
+		inst.addShortcut('ctrl', '9', '', 'FormatBlock', false, '<address>');
 
-			o += '<' + n;
+		// Add default shortcuts for gecko
+		if (tinyMCE.isGecko) {
+			inst.addShortcut('ctrl', 'b', 'lang_bold_desc', 'Bold');
+			inst.addShortcut('ctrl', 'i', 'lang_italic_desc', 'Italic');
+			inst.addShortcut('ctrl', 'u', 'lang_underline_desc', 'Underline');
+		}
 
-			for (k in a) {
-				if (a.hasOwnProperty(k))
-					o += ' ' + k + '="' + t.encode(a[k]) + '"';
-			}
+		// Setup span styles
+		if (tinyMCE.getParam("convert_fonts_to_spans"))
+			inst.getBody().setAttribute('id', 'mceSpanFonts');
 
-			if (tinymce.is(h))
-				return o + '>' + h + '</' + n + '>';
+		if (tinyMCE.settings.nowrap)
+			doc.body.style.whiteSpace = "nowrap";
 
-			return o + ' />';
-		},
+		doc.body.dir = this.settings.directionality;
+		doc.editorId = editor_id;
 
-		remove : function(node, keep_children) {
-			return this.run(node, function(node) {
-				var parent, child;
+		// Add on document element in Mozilla
+		if (!tinyMCE.isIE)
+			doc.documentElement.editorId = editor_id;
 
-				parent = node.parentNode;
+		inst.setBaseHREF(tinyMCE.settings.base_href);
 
-				if (!parent)
-					return null;
+		// Replace new line characters to BRs
+		if (tinyMCE.settings.convert_newlines_to_brs) {
+			content = tinyMCE.regexpReplace(content, "\r\n", "<br />", "gi");
+			content = tinyMCE.regexpReplace(content, "\r", "<br />", "gi");
+			content = tinyMCE.regexpReplace(content, "\n", "<br />", "gi");
+		}
 
-				if (keep_children) {
-					while (child = node.firstChild) {
-						// IE 8 will crash if you don't remove completely empty text nodes
-						if (!tinymce.isIE || child.nodeType !== 3 || child.nodeValue)
-							parent.insertBefore(child, node);
-						else
-							node.removeChild(child);
-					}
-				}
+		// Open closed anchors
+	//	content = content.replace(new RegExp('<a(.*?)/>', 'gi'), '<a$1></a>');
 
-				return parent.removeChild(node);
-			});
-		},
+		// Call custom cleanup code
+		content = tinyMCE.storeAwayURLs(content);
+		content = tinyMCE._customCleanup(inst, "insert_to_editor", content);
 
-		setStyle : function(n, na, v) {
-			var t = this;
+		if (tinyMCE.isIE) {
+			// Ugly!!!
+			window.setInterval('try{tinyMCE.getCSSClasses(tinyMCE.instances["' + editor_id + '"].getDoc(), "' + editor_id + '");}catch(e){}', 500);
 
-			return t.run(n, function(e) {
-				var s, i;
+			if (tinyMCE.settings.force_br_newlines)
+				doc.styleSheets[0].addRule("p", "margin: 0;");
 
-				s = e.style;
+			body = inst.getBody();
+			body.editorId = editor_id;
+		}
 
-				// Camelcase it, if needed
-				na = na.replace(/-(\D)/g, function(a, b){
-					return b.toUpperCase();
-				});
+		content = tinyMCE.cleanupHTMLCode(content);
 
-				// Default px suffix on these
-				if (t.pixelStyles.test(na) && (tinymce.is(v, 'number') || /^[\-0-9\.]+$/.test(v)))
-					v += 'px';
+		// Fix for bug #958637
+		if (!tinyMCE.isIE) {
+			contentElement = inst.getDoc().createElement("body");
+			doc = inst.getDoc();
 
-				switch (na) {
-					case 'opacity':
-						// IE specific opacity
-						if (isIE) {
-							s.filter = v === '' ? '' : "alpha(opacity=" + (v * 100) + ")";
+			contentElement.innerHTML = content;
 
-							if (!n.currentStyle || !n.currentStyle.hasLayout)
-								s.display = 'inline-block';
-						}
+			if (tinyMCE.settings.cleanup_on_startup)
+				tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, doc, this.settings, contentElement));
+			else
+				tinyMCE.setInnerHTML(inst.getBody(), content);
 
-						// Fix for older browsers
-						s[na] = s['-moz-opacity'] = s['-khtml-opacity'] = v || '';
-						break;
+			tinyMCE.convertAllRelativeURLs(inst.getBody());
+		} else {
+			if (tinyMCE.settings.cleanup_on_startup) {
+				tinyMCE._setHTML(inst.getDoc(), content);
 
-					case 'float':
-						isIE ? s.styleFloat = v : s.cssFloat = v;
-						break;
-					
-					default:
-						s[na] = v || '';
+				// Produces permission denied error in MSIE 5.5
+				try {
+					tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, inst.contentDocument, this.settings, inst.getBody()));
+				} catch(e) {
+					// Ignore
 				}
+			} else
+				tinyMCE._setHTML(inst.getDoc(), content);
+		}
 
-				// Force update of the style data
-				if (t.settings.update_styles)
-					t.setAttrib(e, '_mce_style');
-			});
-		},
+		// Fix for bug #957681
+		//inst.getDoc().designMode = inst.getDoc().designMode;
 
-		getStyle : function(n, na, c) {
-			n = this.get(n);
+		tinyMCE.handleVisualAid(inst.getBody(), true, tinyMCE.settings.visual, inst);
+		tinyMCE.dispatchCallback(inst, 'setupcontent_callback', 'setupContent', editor_id, inst.getBody(), inst.getDoc());
 
-			if (!n)
-				return false;
+		// Re-add design mode on mozilla
+		if (!tinyMCE.isIE)
+			tinyMCE.addEventHandlers(inst);
 
-			// Gecko
-			if (this.doc.defaultView && c) {
-				// Remove camelcase
-				na = na.replace(/[A-Z]/g, function(a){
-					return '-' + a;
-				});
+		// Add blur handler
+		if (tinyMCE.isIE) {
+			tinyMCE.addEvent(inst.getBody(), "blur", TinyMCE_Engine.prototype._eventPatch);
+			tinyMCE.addEvent(inst.getBody(), "beforedeactivate", TinyMCE_Engine.prototype._eventPatch); // Bug #1439953
 
-				try {
-					return this.doc.defaultView.getComputedStyle(n, null).getPropertyValue(na);
-				} catch (ex) {
-					// Old safari might fail
-					return null;
-				}
+			// Workaround for drag drop/copy paste base href bug
+			if (!tinyMCE.isOpera) {
+				tinyMCE.addEvent(doc.body, "mousemove", TinyMCE_Engine.prototype.onMouseMove);
+				tinyMCE.addEvent(doc.body, "beforepaste", TinyMCE_Engine.prototype._eventPatch);
+				tinyMCE.addEvent(doc.body, "drop", TinyMCE_Engine.prototype._eventPatch);
 			}
+		}
 
-			// Camelcase it, if needed
-			na = na.replace(/-(\D)/g, function(a, b){
-				return b.toUpperCase();
-			});
+		// Trigger node change, this call locks buttons for tables and so forth
+		inst.select();
+		tinyMCE.selectedElement = inst.contentWindow.document.body;
 
-			if (na == 'float')
-				na = isIE ? 'styleFloat' : 'cssFloat';
+		// Call custom DOM cleanup
+		tinyMCE._customCleanup(inst, "insert_to_editor_dom", inst.getBody());
+		tinyMCE._customCleanup(inst, "setup_content_dom", inst.getBody());
+		tinyMCE._setEventsEnabled(inst.getBody(), false);
+		tinyMCE.cleanupAnchors(inst.getDoc());
 
-			// IE & Opera
-			if (n.currentStyle && c)
-				return n.currentStyle[na];
+		if (tinyMCE.getParam("convert_fonts_to_spans"))
+			tinyMCE.convertSpansToFonts(inst.getDoc());
 
-			return n.style[na];
-		},
+		inst.startContent = tinyMCE.trim(inst.getBody().innerHTML);
+		inst.undoRedo.add({ content : inst.startContent });
 
-		setStyles : function(e, o) {
-			var t = this, s = t.settings, ol;
+		// Cleanup any mess left from storyAwayURLs
+		if (tinyMCE.isGecko) {
+			// Remove mce_src from textnodes and comments
+			tinyMCE.selectNodes(inst.getBody(), function(n) {
+				if (n.nodeType == 3 || n.nodeType == 8)
+					n.nodeValue = n.nodeValue.replace(new RegExp('\\s(mce_src|mce_href)=\"[^\"]*\"', 'gi'), "");
 
-			ol = s.update_styles;
-			s.update_styles = 0;
-
-			each(o, function(v, n) {
-				t.setStyle(e, n, v);
+				return false;
 			});
+		}
 
-			// Update style info
-			s.update_styles = ol;
-			if (s.update_styles)
-				t.setAttrib(e, s.cssText);
-		},
+		// Remove Gecko spellchecking
+		if (tinyMCE.isGecko)
+			inst.getBody().spellcheck = tinyMCE.getParam("gecko_spellcheck");
 
-		setAttrib : function(e, n, v) {
-			var t = this;
+		// Cleanup any mess left from storyAwayURLs
+		tinyMCE._removeInternal(inst.getBody());
 
-			// Whats the point
-			if (!e || !n)
-				return;
+		inst.select();
+		tinyMCE.triggerNodeChange(false, true);
+	},
 
-			// Strict XML mode
-			if (t.settings.strict)
-				n = n.toLowerCase();
+	storeAwayURLs : function(s) {
+		// Remove all mce_src, mce_href and replace them with new ones
+		// s = s.replace(new RegExp('mce_src\\s*=\\s*\"[^ >\"]*\"', 'gi'), '');
+		// s = s.replace(new RegExp('mce_href\\s*=\\s*\"[^ >\"]*\"', 'gi'), '');
 
-			return this.run(e, function(e) {
-				var s = t.settings;
+		if (!s.match(/(mce_src|mce_href)/gi, s)) {
+			s = s.replace(new RegExp('src\\s*=\\s*[\"\']([^ >\"]*)[\"\']', 'gi'), 'src="$1" mce_src="$1"');
+			s = s.replace(new RegExp('href\\s*=\\s*[\"\']([^ >\"]*)[\"\']', 'gi'), 'href="$1" mce_href="$1"');
+		}
 
-				switch (n) {
-					case "style":
-						if (!is(v, 'string')) {
-							each(v, function(v, n) {
-								t.setStyle(e, n, v);
-							});
+		return s;
+	},
 
-							return;
-						}
+	_removeInternal : function(n) {
+		if (tinyMCE.isGecko) {
+			// Remove mce_src from textnodes and comments
+			tinyMCE.selectNodes(n, function(n) {
+				if (n.nodeType == 3 || n.nodeType == 8)
+					n.nodeValue = n.nodeValue.replace(new RegExp('\\s(mce_src|mce_href)=\"[^\"]*\"', 'gi'), "");
 
-						// No mce_style for elements with these since they might get resized by the user
-						if (s.keep_values) {
-							if (v && !t._isRes(v))
-								e.setAttribute('_mce_style', v, 2);
-							else
-								e.removeAttribute('_mce_style', 2);
-						}
-
-						e.style.cssText = v;
-						break;
-
-					case "class":
-						e.className = v || ''; // Fix IE null bug
-						break;
-
-					case "src":
-					case "href":
-						if (s.keep_values) {
-							if (s.url_converter)
-								v = s.url_converter.call(s.url_converter_scope || t, v, n, e);
-
-							t.setAttrib(e, '_mce_' + n, v, 2);
-						}
-
-						break;
-					
-					case "shape":
-						e.setAttribute('_mce_style', v);
-						break;
-				}
-
-				if (is(v) && v !== null && v.length !== 0)
-					e.setAttribute(n, '' + v, 2);
-				else
-					e.removeAttribute(n, 2);
+				return false;
 			});
-		},
+		}
+	},
 
-		setAttribs : function(e, o) {
-			var t = this;
+	removeTinyMCEFormElements : function(form_obj) {
+		var i, elementId;
 
-			return this.run(e, function(e) {
-				each(o, function(v, n) {
-					t.setAttrib(e, n, v);
-				});
-			});
-		},
+		// Skip form element removal
+		if (!tinyMCE.getParam('hide_selects_on_submit'))
+			return;
 
-		getAttrib : function(e, n, dv) {
-			var v, t = this;
+		// Check if form is valid
+		if (typeof(form_obj) == "undefined" || form_obj == null)
+			return;
 
-			e = t.get(e);
+		// If not a form, find the form
+		if (form_obj.nodeName != "FORM") {
+			if (form_obj.form)
+				form_obj = form_obj.form;
+			else
+				form_obj = tinyMCE.getParentElement(form_obj, "form");
+		}
 
-			if (!e || e.nodeType !== 1)
-				return false;
+		// Still nothing
+		if (form_obj == null)
+			return;
 
-			if (!is(dv))
-				dv = '';
+		// Disable all UI form elements that TinyMCE created
+		for (i=0; i<form_obj.elements.length; i++) {
+			elementId = form_obj.elements[i].name ? form_obj.elements[i].name : form_obj.elements[i].id;
 
-			// Try the mce variant for these
-			if (/^(src|href|style|coords|shape)$/.test(n)) {
-				v = e.getAttribute("_mce_" + n);
+			if (elementId.indexOf('mce_editor_') == 0)
+				form_obj.elements[i].disabled = true;
+		}
+	},
 
-				if (v)
-					return v;
-			}
+	handleEvent : function(e) {
+		var inst = tinyMCE.selectedInstance, i, elm, keys;
 
-			if (isIE && t.props[n]) {
-				v = e[t.props[n]];
-				v = v && v.nodeValue ? v.nodeValue : v;
-			}
+		// Remove odd, error
+		if (typeof(tinyMCE) == "undefined")
+			return true;
 
-			if (!v)
-				v = e.getAttribute(n, 2);
+		//tinyMCE.debug(e.type + " " + e.target.nodeName + " " + (e.relatedTarget ? e.relatedTarget.nodeName : ""));
 
-			// Check boolean attribs
-			if (/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(n)) {
-				if (e[t.props[n]] === true && v === '')
-					return n;
+		if (tinyMCE.executeCallback(tinyMCE.selectedInstance, 'handle_event_callback', 'handleEvent', e))
+			return false;
 
-				return v ? n : '';
-			}
+		switch (e.type) {
+			case "beforedeactivate": // Was added due to bug #1439953
+			case "blur":
+				if (tinyMCE.selectedInstance)
+					tinyMCE.selectedInstance.execCommand('mceEndTyping');
 
-			// Inner input elements will override attributes on form elements
-			if (e.nodeName === "FORM" && e.getAttributeNode(n))
-				return e.getAttributeNode(n).nodeValue;
+				tinyMCE.hideMenus();
 
-			if (n === 'style') {
-				v = v || e.style.cssText;
+				return;
 
-				if (v) {
-					v = t.serializeStyle(t.parseStyle(v), e.nodeName);
+			// Workaround for drag drop/copy paste base href bug
+			case "drop":
+			case "beforepaste":
+/*				if (tinyMCE.selectedInstance)
+					tinyMCE.selectedInstance.setBaseHREF(null);
 
-					if (t.settings.keep_values && !t._isRes(v))
-						e.setAttribute('_mce_style', v);
+				// Fixes odd MSIE bug where drag/droping elements in a iframe with height 100% breaks
+				// This logic forces the width/height to be in pixels while the user is drag/dropping
+				// NOTE: This has been disabled for now since it messes up copy/paste that is far more important than image drag
+				if (tinyMCE.isRealIE) {
+					var ife = tinyMCE.selectedInstance.iframeElement;
+
+					if (ife.style.height.indexOf('%') != -1) {
+						ife._oldHeight = ife.style.height;
+						ife.style.height = ife.clientHeight;
+					}
 				}
-			}
 
-			// Remove Apple and WebKit stuff
-			if (isWebKit && n === "class" && v)
-				v = v.replace(/(apple|webkit)\-[a-z\-]+/gi, '');
+				window.setTimeout("tinyMCE.selectedInstance.setBaseHREF(tinyMCE.settings.base_href);tinyMCE._resetIframeHeight();", 1);
+				*/
+				return;
 
-			// Handle IE issues
-			if (isIE) {
-				switch (n) {
-					case 'rowspan':
-					case 'colspan':
-						// IE returns 1 as default value
-						if (v === 1)
-							v = '';
+			case "submit":
+				tinyMCE.formSubmit(tinyMCE.isMSIE ? window.event.srcElement : e.target);
+				return;
 
-						break;
+			case "reset":
+				var formObj = tinyMCE.isIE ? window.event.srcElement : e.target;
 
-					case 'size':
-						// IE returns +0 as default value for size
-						if (v === '+0' || v === 20 || v === 0)
-							v = '';
-
-						break;
-
-					case 'width':
-					case 'height':
-					case 'vspace':
-					case 'checked':
-					case 'disabled':
-					case 'readonly':
-						if (v === 0)
-							v = '';
-
-						break;
-
-					case 'hspace':
-						// IE returns -1 as default value
-						if (v === -1)
-							v = '';
-
-						break;
-
-					case 'maxlength':
-					case 'tabindex':
-						// IE returns default value
-						if (v === 32768 || v === 2147483647 || v === '32768')
-							v = '';
-
-						break;
-
-					case 'multiple':
-					case 'compact':
-					case 'noshade':
-					case 'nowrap':
-						if (v === 65535)
-							return n;
-
-						return dv;
-
-					case 'shape':
-						v = v.toLowerCase();
-						break;
-
-					default:
-						// IE has odd anonymous function for event attributes
-						if (n.indexOf('on') === 0 && v)
-							v = ('' + v).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/, '$1');
+				for (i=0; i<document.forms.length; i++) {
+					if (document.forms[i] == formObj)
+						window.setTimeout('tinyMCE.resetForm(' + i + ');', 10);
 				}
-			}
 
-			return (v !== undefined && v !== null && v !== '') ? '' + v : dv;
-		},
+				return;
 
-		getPos : function(n, ro) {
-			var t = this, x = 0, y = 0, e, d = t.doc, r;
+			case "keypress":
+				if (inst && inst.handleShortcut(e))
+					return false;
 
-			n = t.get(n);
-			ro = ro || d.body;
-
-			if (n) {
-				// Use getBoundingClientRect on IE, Opera has it but it's not perfect
-				if (isIE && !t.stdMode) {
-					n = n.getBoundingClientRect();
-					e = t.boxModel ? d.documentElement : d.body;
-					x = t.getStyle(t.select('html')[0], 'borderWidth'); // Remove border
-					x = (x == 'medium' || t.boxModel && !t.isIE6) && 2 || x;
-
-					return {x : n.left + e.scrollLeft - x, y : n.top + e.scrollTop - x};
+				if (e.target.editorId) {
+					tinyMCE.instances[e.target.editorId].select();
+				} else {
+					if (e.target.ownerDocument.editorId)
+						tinyMCE.instances[e.target.ownerDocument.editorId].select();
 				}
 
-				r = n;
-				while (r && r != ro && r.nodeType) {
-					x += r.offsetLeft || 0;
-					y += r.offsetTop || 0;
-					r = r.offsetParent;
-				}
+				if (tinyMCE.selectedInstance)
+					tinyMCE.selectedInstance.switchSettings();
 
-				r = n.parentNode;
-				while (r && r != ro && r.nodeType) {
-					x -= r.scrollLeft || 0;
-					y -= r.scrollTop || 0;
-					r = r.parentNode;
+				// Insert P element
+				if ((tinyMCE.isGecko || tinyMCE.isOpera || tinyMCE.isSafari) && tinyMCE.settings.force_p_newlines && e.keyCode == 13 && !e.shiftKey) {
+					// Insert P element instead of BR
+					if (TinyMCE_ForceParagraphs._insertPara(tinyMCE.selectedInstance, e)) {
+						// Cancel event
+						tinyMCE.execCommand("mceAddUndoLevel");
+						return tinyMCE.cancelEvent(e);
+					}
 				}
-			}
 
-			return {x : x, y : y};
-		},
-
-		parseStyle : function(st) {
-			var t = this, s = t.settings, o = {};
-
-			if (!st)
-				return o;
-
-			function compress(p, s, ot) {
-				var t, r, b, l;
-
-				// Get values and check it it needs compressing
-				t = o[p + '-top' + s];
-				if (!t)
-					return;
-
-				r = o[p + '-right' + s];
-				if (t != r)
-					return;
-
-				b = o[p + '-bottom' + s];
-				if (r != b)
-					return;
-
-				l = o[p + '-left' + s];
-				if (b != l)
-					return;
-
-				// Compress
-				o[ot] = l;
-				delete o[p + '-top' + s];
-				delete o[p + '-right' + s];
-				delete o[p + '-bottom' + s];
-				delete o[p + '-left' + s];
-			};
-
-			function compress2(ta, a, b, c) {
-				var t;
-
-				t = o[a];
-				if (!t)
-					return;
-
-				t = o[b];
-				if (!t)
-					return;
-
-				t = o[c];
-				if (!t)
-					return;
-
-				// Compress
-				o[ta] = o[a] + ' ' + o[b] + ' ' + o[c];
-				delete o[a];
-				delete o[b];
-				delete o[c];
-			};
-
-			st = st.replace(/&(#?[a-z0-9]+);/g, '&$1_MCE_SEMI_'); // Protect entities
-
-			each(st.split(';'), function(v) {
-				var sv, ur = [];
-
-				if (v) {
-					v = v.replace(/_MCE_SEMI_/g, ';'); // Restore entities
-					v = v.replace(/url\([^\)]+\)/g, function(v) {ur.push(v);return 'url(' + ur.length + ')';});
-					v = v.split(':');
-					sv = tinymce.trim(v[1]);
-					sv = sv.replace(/url\(([^\)]+)\)/g, function(a, b) {return ur[parseInt(b) - 1];});
-
-					sv = sv.replace(/rgb\([^\)]+\)/g, function(v) {
-						return t.toHex(v);
-					});
-
-					if (s.url_converter) {
-						sv = sv.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g, function(x, c) {
-							return 'url(' + s.url_converter.call(s.url_converter_scope || t, t.decode(c), 'style', null) + ')';
-						});
+				// Handle backspace
+				if ((tinyMCE.isGecko && !tinyMCE.isSafari) && tinyMCE.settings.force_p_newlines && (e.keyCode == 8 || e.keyCode == 46) && !e.shiftKey) {
+					// Insert P element instead of BR
+					if (TinyMCE_ForceParagraphs._handleBackSpace(tinyMCE.selectedInstance, e.type)) {
+						// Cancel event
+						tinyMCE.execCommand("mceAddUndoLevel");
+						return tinyMCE.cancelEvent(e);
 					}
-
-					o[tinymce.trim(v[0]).toLowerCase()] = sv;
 				}
-			});
 
-			compress("border", "", "border");
-			compress("border", "-width", "border-width");
-			compress("border", "-color", "border-color");
-			compress("border", "-style", "border-style");
-			compress("padding", "", "padding");
-			compress("margin", "", "margin");
-			compress2('border', 'border-width', 'border-style', 'border-color');
+				// Return key pressed
+				if (tinyMCE.isIE && tinyMCE.settings.force_br_newlines && e.keyCode == 13) {
+					if (e.target.editorId)
+						tinyMCE.instances[e.target.editorId].select();
 
-			if (isIE) {
-				// Remove pointless border
-				if (o.border == 'medium none')
-					o.border = '';
-			}
+					if (tinyMCE.selectedInstance) {
+						var sel = tinyMCE.selectedInstance.getDoc().selection;
+						var rng = sel.createRange();
 
-			return o;
-		},
+						if (tinyMCE.getParentElement(rng.parentElement(), "li") != null)
+							return false;
 
-		serializeStyle : function(o, name) {
-			var t = this, s = '';
+						// Cancel event
+						e.returnValue = false;
+						e.cancelBubble = true;
 
-			function add(v, k) {
-				if (k && v) {
-					// Remove browser specific styles like -moz- or -webkit-
-					if (k.indexOf('-') === 0)
-						return;
+						// Insert BR element
+						rng.pasteHTML("<br />");
+						rng.collapse(false);
+						rng.select();
 
-					switch (k) {
-						case 'font-weight':
-							// Opera will output bold as 700
-							if (v == 700)
-								v = 'bold';
-
-							break;
-
-						case 'color':
-						case 'background-color':
-							v = v.toLowerCase();
-							break;
+						tinyMCE.execCommand("mceAddUndoLevel");
+						tinyMCE.triggerNodeChange(false);
+						return false;
 					}
-
-					s += (s ? ' ' : '') + k + ': ' + v + ';';
 				}
-			};
 
-			// Validate style output
-			if (name && t._styles) {
-				each(t._styles['*'], function(name) {
-					add(o[name], name);
-				});
-
-				each(t._styles[name.toLowerCase()], function(name) {
-					add(o[name], name);
-				});
-			} else
-				each(o, add);
-
-			return s;
-		},
-
-		loadCSS : function(u) {
-			var t = this, d = t.doc, head;
-
-			if (!u)
-				u = '';
-
-			head = t.select('head')[0];
-
-			each(u.split(','), function(u) {
-				var link;
-
-				if (t.files[u])
-					return;
-
-				t.files[u] = true;
-				link = t.create('link', {rel : 'stylesheet', href : tinymce._addVer(u)});
-
-				// IE 8 has a bug where dynamically loading stylesheets would produce a 1 item remaining bug
-				// This fix seems to resolve that issue by realcing the document ones a stylesheet finishes loading
-				// It's ugly but it seems to work fine.
-				if (isIE && d.documentMode) {
-					link.onload = function() {
-						d.recalc();
-						link.onload = null;
-					};
+				// Backspace or delete
+				if (e.keyCode == 8 || e.keyCode == 46) {
+					tinyMCE.selectedElement = e.target;
+					tinyMCE.linkElement = tinyMCE.getParentElement(e.target, "a");
+					tinyMCE.imgElement = tinyMCE.getParentElement(e.target, "img");
+					tinyMCE.triggerNodeChange(false);
 				}
 
-				head.appendChild(link);
-			});
-		},
+				return false;
 
-		addClass : function(e, c) {
-			return this.run(e, function(e) {
-				var o;
+			case "keyup":
+			case "keydown":
+				tinyMCE.hideMenus();
+				tinyMCE.hasMouseMoved = false;
 
-				if (!c)
-					return 0;
+				if (inst && inst.handleShortcut(e))
+					return false;
 
-				if (this.hasClass(e, c))
-					return e.className;
+				inst._fixRootBlocks();
 
-				o = this.removeClass(e, c);
+				if (inst.settings.remove_trailing_nbsp)
+					inst._fixTrailingNbsp();
 
-				return e.className = (o != '' ? (o + ' ') : '') + c;
-			});
-		},
+				if (e.target.editorId)
+					tinyMCE.instances[e.target.editorId].select();
 
-		removeClass : function(e, c) {
-			var t = this, re;
+				if (tinyMCE.selectedInstance)
+					tinyMCE.selectedInstance.switchSettings();
 
-			return t.run(e, function(e) {
-				var v;
+				inst = tinyMCE.selectedInstance;
 
-				if (t.hasClass(e, c)) {
-					if (!re)
-						re = new RegExp("(^|\\s+)" + c + "(\\s+|$)", "g");
-
-					v = e.className.replace(re, ' ');
-					v = tinymce.trim(v != ' ' ? v : '');
-
-					e.className = v;
-
-					// Empty class attr
-					if (!v) {
-						e.removeAttribute('class');
-						e.removeAttribute('className');
+				// Handle backspace
+				if (tinyMCE.isGecko && tinyMCE.settings.force_p_newlines && (e.keyCode == 8 || e.keyCode == 46) && !e.shiftKey) {
+					// Insert P element instead of BR
+					if (TinyMCE_ForceParagraphs._handleBackSpace(tinyMCE.selectedInstance, e.type)) {
+						// Cancel event
+						tinyMCE.execCommand("mceAddUndoLevel");
+						e.preventDefault();
+						return false;
 					}
-
-					return v;
 				}
 
-				return e.className;
-			});
-		},
+				tinyMCE.selectedElement = null;
+				tinyMCE.selectedNode = null;
+				elm = tinyMCE.selectedInstance.getFocusElement();
+				tinyMCE.linkElement = tinyMCE.getParentElement(elm, "a");
+				tinyMCE.imgElement = tinyMCE.getParentElement(elm, "img");
+				tinyMCE.selectedElement = elm;
 
-		hasClass : function(n, c) {
-			n = this.get(n);
+				// Update visualaids on tabs
+				if (tinyMCE.isGecko && e.type == "keyup" && e.keyCode == 9)
+					tinyMCE.handleVisualAid(tinyMCE.selectedInstance.getBody(), true, tinyMCE.settings.visual, tinyMCE.selectedInstance);
 
-			if (!n || !c)
-				return false;
+				// Fix empty elements on return/enter, check where enter occured
+				if (tinyMCE.isIE && e.type == "keydown" && e.keyCode == 13)
+					tinyMCE.enterKeyElement = tinyMCE.selectedInstance.getFocusElement();
 
-			return (' ' + n.className + ' ').indexOf(' ' + c + ' ') !== -1;
-		},
+				// Fix empty elements on return/enter
+				if (tinyMCE.isIE && e.type == "keyup" && e.keyCode == 13) {
+					elm = tinyMCE.enterKeyElement;
+					if (elm) {
+						var re = new RegExp('^HR|IMG|BR$','g'); // Skip these
+						var dre = new RegExp('^H[1-6]$','g'); // Add double on these
 
-		show : function(e) {
-			return this.setStyle(e, 'display', 'block');
-		},
-
-		hide : function(e) {
-			return this.setStyle(e, 'display', 'none');
-		},
-
-		isHidden : function(e) {
-			e = this.get(e);
-
-			return !e || e.style.display == 'none' || this.getStyle(e, 'display') == 'none';
-		},
-
-		uniqueId : function(p) {
-			return (!p ? 'mce_' : p) + (this.counter++);
-		},
-
-		setHTML : function(e, h) {
-			var t = this;
-
-			return this.run(e, function(e) {
-				var x, i, nl, n, p, x;
-
-				h = t.processHTML(h);
-
-				if (isIE) {
-					function set() {
-						// Remove all child nodes
-						while (e.firstChild)
-							e.firstChild.removeNode();
-
-						try {
-							// IE will remove comments from the beginning
-							// unless you padd the contents with something
-							e.innerHTML = '<br />' + h;
-							e.removeChild(e.firstChild);
-						} catch (ex) {
-							// IE sometimes produces an unknown runtime error on innerHTML if it's an block element within a block element for example a div inside a p
-							// This seems to fix this problem
-
-							// Create new div with HTML contents and a BR infront to keep comments
-							x = t.create('div');
-							x.innerHTML = '<br />' + h;
-
-							// Add all children from div to target
-							each (x.childNodes, function(n, i) {
-								// Skip br element
-								if (i)
-									e.appendChild(n);
-							});
+						if (!elm.hasChildNodes() && !re.test(elm.nodeName)) {
+							if (dre.test(elm.nodeName))
+								elm.innerHTML = "  ";
+							else
+								elm.innerHTML = " ";
 						}
-					};
-
-					// IE has a serious bug when it comes to paragraphs it can produce an invalid
-					// DOM tree if contents like this <p><ul><li>Item 1</li></ul></p> is inserted
-					// It seems to be that IE doesn't like a root block element placed inside another root block element
-					if (t.settings.fix_ie_paragraphs)
-						h = h.replace(/<p><\/p>|<p([^>]+)><\/p>|<p[^\/+]\/>/gi, '<p$1 _mce_keep="true"> </p>');
-
-					set();
-
-					if (t.settings.fix_ie_paragraphs) {
-						// Check for odd paragraphs this is a sign of a broken DOM
-						nl = e.getElementsByTagName("p");
-						for (i = nl.length - 1, x = 0; i >= 0; i--) {
-							n = nl[i];
-
-							if (!n.hasChildNodes()) {
-								if (!n._mce_keep) {
-									x = 1; // Is broken
-									break;
-								}
-
-								n.removeAttribute('_mce_keep');
-							}
-						}
 					}
+				}
 
-					// Time to fix the madness IE left us
-					if (x) {
-						// So if we replace the p elements with divs and mark them and then replace them back to paragraphs
-						// after we use innerHTML we can fix the DOM tree
-						h = h.replace(/<p ([^>]+)>|<p>/ig, '<div $1 _mce_tmp="1">');
-						h = h.replace(/<\/p>/gi, '</div>');
-
-						// Set the new HTML with DIVs
-						set();
-
-						// Replace all DIV elements with the _mce_tmp attibute back to paragraphs
-						// This is needed since IE has a annoying bug see above for details
-						// This is a slow process but it has to be done. :(
-						if (t.settings.fix_ie_paragraphs) {
-							nl = e.getElementsByTagName("DIV");
-							for (i = nl.length - 1; i >= 0; i--) {
-								n = nl[i];
-
-								// Is it a temp div
-								if (n._mce_tmp) {
-									// Create new paragraph
-									p = t.doc.createElement('p');
-
-									// Copy all attributes
-									n.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi, function(a, b) {
-										var v;
-
-										if (b !== '_mce_tmp') {
-											v = n.getAttribute(b);
-
-											if (!v && b === 'class')
-												v = n.className;
-
-											p.setAttribute(b, v);
-										}
-									});
-
-									// Append all children to new paragraph
-									for (x = 0; x<n.childNodes.length; x++)
-										p.appendChild(n.childNodes[x].cloneNode(true));
-
-									// Replace div with new paragraph
-									n.swapNode(p);
-								}
-							}
-						}
+				// Check if it's a position key
+				keys = tinyMCE.posKeyCodes;
+				var posKey = false;
+				for (i=0; i<keys.length; i++) {
+					if (keys[i] == e.keyCode) {
+						posKey = true;
+						break;
 					}
-				} else
-					e.innerHTML = h;
-
-				return h;
-			});
-		},
-
-		processHTML : function(h) {
-			var t = this, s = t.settings, codeBlocks = [];
-
-			if (!s.process_html)
-				return h;
-
-			if (isIE) {
-				h = h.replace(/'/g, '''); // IE can't handle apos
-				h = h.replace(/\s+(disabled|checked|readonly|selected)\s*=\s*[\"\']?(false|0)[\"\']?/gi, ''); // IE doesn't handle default values correct
-			}
-
-			// Fix some issues
-			h = h.replace(/<a( )([^>]+)\/>|<a\/>/gi, '<a$1$2></a>'); // Force open
-
-			// Store away src and href in _mce_src and mce_href since browsers mess them up
-			if (s.keep_values) {
-				// Wrap scripts and styles in comments for serialization purposes
-				if (/<script|noscript|style/i.test(h)) {
-					function trim(s) {
-						// Remove prefix and suffix code for element
-						s = s.replace(/(<!--\[CDATA\[|\]\]-->)/g, '\n');
-						s = s.replace(/^[\r\n]*|[\r\n]*$/g, '');
-						s = s.replace(/^\s*(\/\/\s*<!--|\/\/\s*<!\[CDATA\[|<!--|<!\[CDATA\[)[\r\n]*/g, '');
-						s = s.replace(/\s*(\/\/\s*\]\]>|\/\/\s*-->|\]\]>|-->|\]\]-->)\s*$/g, '');
-
-						return s;
-					};
-
-					// Wrap the script contents in CDATA and keep them from executing
-					h = h.replace(/<script([^>]+|)>([\s\S]*?)<\/script>/gi, function(v, attribs, text) {
-						// Force type attribute
-						if (!attribs)
-							attribs = ' type="text/javascript"';
-
-						// Convert the src attribute of the scripts
-						attribs = attribs.replace(/src=\"([^\"]+)\"?/i, function(a, url) {
-							if (s.url_converter)
-								url = t.encode(s.url_converter.call(s.url_converter_scope || t, t.decode(url), 'src', 'script'));
-
-							return '_mce_src="' + url + '"';
-						});
-
-						// Wrap text contents
-						if (tinymce.trim(text)) {
-							codeBlocks.push(trim(text));
-							text = '<!--\nMCE_SCRIPT:' + (codeBlocks.length - 1) + '\n// -->';
-						}
-
-						return '<mce:script' + attribs + '>' + text + '</mce:script>';
-					});
-
-					// Wrap style elements
-					h = h.replace(/<style([^>]+|)>([\s\S]*?)<\/style>/gi, function(v, attribs, text) {
-						// Wrap text contents
-						if (text) {
-							codeBlocks.push(trim(text));
-							text = '<!--\nMCE_SCRIPT:' + (codeBlocks.length - 1) + '\n-->';
-						}
-
-						return '<mce:style' + attribs + '>' + text + '</mce:style><style ' + attribs + ' _mce_bogus="1">' + text + '</style>';
-					});
-
-					// Wrap noscript elements
-					h = h.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g, function(v, attribs, text) {
-						return '<mce:noscript' + attribs + '><!--' + t.encode(text).replace(/--/g, '--') + '--></mce:noscript>';
-					});
 				}
 
-				h = h.replace(/<!\[CDATA\[([\s\S]+)\]\]>/g, '<!--[CDATA[$1]]-->');
+				// MSIE custom key handling
+				if (tinyMCE.isIE && tinyMCE.settings.custom_undo_redo) {
+					keys = [8, 46]; // Backspace,Delete
 
-				// This function processes the attributes in the HTML string to force boolean
-				// attributes to the attr="attr" format and convert style, src and href to _mce_ versions
-				function processTags(html) {
-					return html.replace(tagRegExp, function(match, elm_name, attrs, end) {
-						return '<' + elm_name + attrs.replace(attrRegExp, function(match, name, value, val2, val3) {
-							var mceValue;
-
-							name = name.toLowerCase();
-							value = value || val2 || val3 || "";
-
-							// Treat boolean attributes
-							if (boolAttrs[name]) {
-								// false or 0 is treated as a missing attribute
-								if (value === 'false' || value === '0')
-									return;
-
-								return name + '="' + name + '"';
-							}
-
-							// Is attribute one that needs special treatment
-							if (mceAttribs[name] && attrs.indexOf('_mce_' + name) == -1) {
-								mceValue = t.decode(value);
-
-								// Convert URLs to relative/absolute ones
-								if (s.url_converter && (name == "src" || name == "href"))
-									mceValue = s.url_converter.call(s.url_converter_scope || t, mceValue, name, elm_name);
-
-								// Process styles lowercases them and compresses them
-								if (name == 'style')
-									mceValue = t.serializeStyle(t.parseStyle(mceValue), name);
-
-								return name + '="' + value + '"' + ' _mce_' + name + '="' + t.encode(mceValue) + '"';
-							}
-
-							return match;
-						}) + end + '>';
-					});
-				};
-
-				h = processTags(h);
-
-				// Restore script blocks
-				h = h.replace(/MCE_SCRIPT:([0-9]+)/g, function(val, idx) {
-					return codeBlocks[idx];
-				});
-			}
-
-			return h;
-		},
-
-		getOuterHTML : function(e) {
-			var d;
-
-			e = this.get(e);
-
-			if (!e)
-				return null;
-
-			if (e.outerHTML !== undefined)
-				return e.outerHTML;
-
-			d = (e.ownerDocument || this.doc).createElement("body");
-			d.appendChild(e.cloneNode(true));
-
-			return d.innerHTML;
-		},
-
-		setOuterHTML : function(e, h, d) {
-			var t = this;
-
-			function setHTML(e, h, d) {
-				var n, tp;
-
-				tp = d.createElement("body");
-				tp.innerHTML = h;
-
-				n = tp.lastChild;
-				while (n) {
-					t.insertAfter(n.cloneNode(true), e);
-					n = n.previousSibling;
-				}
-
-				t.remove(e);
-			};
-
-			return this.run(e, function(e) {
-				e = t.get(e);
-
-				// Only set HTML on elements
-				if (e.nodeType == 1) {
-					d = d || e.ownerDocument || t.doc;
-
-					if (isIE) {
-						try {
-							// Try outerHTML for IE it sometimes produces an unknown runtime error
-							if (isIE && e.nodeType == 1)
-								e.outerHTML = h;
-							else
-								setHTML(e, h, d);
-						} catch (ex) {
-							// Fix for unknown runtime error
-							setHTML(e, h, d);
+					for (i=0; i<keys.length; i++) {
+						if (keys[i] == e.keyCode) {
+							if (e.type == "keyup")
+								tinyMCE.triggerNodeChange(false);
 						}
-					} else
-						setHTML(e, h, d);
+					}
 				}
-			});
-		},
 
-		decode : function(s) {
-			var e, n, v;
+				// If Ctrl key
+				if (e.keyCode == 17)
+					return true;
 
-			// Look for entities to decode
-			if (/&[\w#]+;/.test(s)) {
-				// Decode the entities using a div element not super efficient but less code
-				e = this.doc.createElement("div");
-				e.innerHTML = s;
-				n = e.firstChild;
-				v = '';
+				// Handle Undo/Redo when typing content
 
-				if (n) {
-					do {
-						v += n.nodeValue;
-					} while (n = n.nextSibling);
+				if (tinyMCE.isGecko) {
+					// Start typing (not a position key or ctrl key, but ctrl+x and ctrl+p is ok)
+					if (!posKey && e.type == "keyup" && !e.ctrlKey || (e.ctrlKey && (e.keyCode == 86 || e.keyCode == 88)))
+						tinyMCE.execCommand("mceStartTyping");
+				} else {
+					// IE seems to be working better with this setting
+					if (!posKey && e.type == "keyup")
+						tinyMCE.execCommand("mceStartTyping");
 				}
 
-				return v || s;
-			}
+				// Store undo bookmark
+				if (e.type == "keydown" && (posKey || e.ctrlKey) && inst)
+					inst.undoBookmark = inst.selection.getBookmark();
 
-			return s;
-		},
+				// End typing (position key) or some Ctrl event
+				if (e.type == "keyup" && (posKey || e.ctrlKey))
+					tinyMCE.execCommand("mceEndTyping");
 
-		encode : function(str) {
-			return ('' + str).replace(encodeCharsRe, function(chr) {
-				return encodedChars[chr];
-			});
-		},
+				if (posKey && e.type == "keyup")
+					tinyMCE.triggerNodeChange(false);
 
-		insertAfter : function(node, reference_node) {
-			reference_node = this.get(reference_node);
+				if (tinyMCE.isIE && e.ctrlKey)
+					window.setTimeout('tinyMCE.triggerNodeChange(false);', 1);
+			break;
 
-			return this.run(node, function(node) {
-				var parent, nextSibling;
+			case "mousedown":
+			case "mouseup":
+			case "click":
+			case "dblclick":
+			case "focus":
+				tinyMCE.hideMenus();
 
-				parent = reference_node.parentNode;
-				nextSibling = reference_node.nextSibling;
-
-				if (nextSibling)
-					parent.insertBefore(node, nextSibling);
-				else
-					parent.appendChild(node);
-
-				return node;
-			});
-		},
-
-		isBlock : function(n) {
-			if (n.nodeType && n.nodeType !== 1)
-				return false;
-
-			n = n.nodeName || n;
-
-			return blockRe.test(n);
-		},
-
-		replace : function(n, o, k) {
-			var t = this;
-
-			if (is(o, 'array'))
-				n = n.cloneNode(true);
-
-			return t.run(o, function(o) {
-				if (k) {
-					each(tinymce.grep(o.childNodes), function(c) {
-						n.appendChild(c);
-					});
+				if (tinyMCE.selectedInstance) {
+					tinyMCE.selectedInstance.switchSettings();
+					tinyMCE.selectedInstance.isFocused = true;
 				}
 
-				return o.parentNode.replaceChild(n, o);
-			});
-		},
+				// Check instance event trigged on
+				var targetBody = tinyMCE.getParentElement(e.target, "html");
+				for (var instanceName in tinyMCE.instances) {
+					if (!tinyMCE.isInstance(tinyMCE.instances[instanceName]))
+						continue;
 
-		rename : function(elm, name) {
-			var t = this, newElm;
+					inst = tinyMCE.instances[instanceName];
 
-			if (elm.nodeName != name.toUpperCase()) {
-				// Rename block element
-				newElm = t.create(name);
+					// Reset design mode if lost (on everything just in case)
+					inst.autoResetDesignMode();
 
-				// Copy attribs to new block
-				each(t.getAttribs(elm), function(attr_node) {
-					t.setAttrib(newElm, attr_node.nodeName, t.getAttrib(elm, attr_node.nodeName));
-				});
-
-				// Replace block
-				t.replace(newElm, elm, 1);
-			}
-
-			return newElm || elm;
-		},
-
-		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;
-		},
-
-		toHex : function(s) {
-			var c = /^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(s);
-
-			function hex(s) {
-				s = parseInt(s).toString(16);
-
-				return s.length > 1 ? s : '0' + s; // 0 -> 00
-			};
-
-			if (c) {
-				s = '#' + hex(c[1]) + hex(c[2]) + hex(c[3]);
-
-				return s;
-			}
-
-			return s;
-		},
-
-		getClasses : function() {
-			var t = this, cl = [], i, lo = {}, f = t.settings.class_filter, ov;
-
-			if (t.classes)
-				return t.classes;
-
-			function addClasses(s) {
-				// IE style imports
-				each(s.imports, function(r) {
-					addClasses(r);
-				});
-
-				each(s.cssRules || s.rules, function(r) {
-					// Real type or fake it on IE
-					switch (r.type || 1) {
-						// Rule
-						case 1:
-							if (r.selectorText) {
-								each(r.selectorText.split(','), function(v) {
-									v = v.replace(/^\s*|\s*$|^\s\./g, "");
-
-									// Is internal or it doesn't contain a class
-									if (/\.mce/.test(v) || !/\.[\w\-]+$/.test(v))
-										return;
-
-									// Remove everything but class name
-									ov = v;
-									v = v.replace(/.*\.([a-z0-9_\-]+).*/i, '$1');
-
-									// Filter classes
-									if (f && !(v = f(v, ov)))
-										return;
-
-									if (!lo[v]) {
-										cl.push({'class' : v});
-										lo[v] = 1;
-									}
-								});
-							}
-							break;
-
-						// Import
-						case 3:
-							addClasses(r.styleSheet);
-							break;
+					// Use HTML element since users might click outside of body element
+					if (inst.getBody().parentNode == targetBody) {
+						inst.select();
+						tinyMCE.selectedElement = e.target;
+						tinyMCE.linkElement = tinyMCE.getParentElement(tinyMCE.selectedElement, "a");
+						tinyMCE.imgElement = tinyMCE.getParentElement(tinyMCE.selectedElement, "img");
+						break;
 					}
-				});
-			};
+				}
 
-			try {
-				each(t.doc.styleSheets, addClasses);
-			} catch (ex) {
-				// Ignore
-			}
+				// Add first bookmark location
+				if (!tinyMCE.selectedInstance.undoRedo.undoLevels[0].bookmark && (e.type == "mouseup" || e.type == "dblclick"))
+					tinyMCE.selectedInstance.undoRedo.undoLevels[0].bookmark = tinyMCE.selectedInstance.selection.getBookmark();
 
-			if (cl.length > 0)
-				t.classes = cl;
+				// Reset selected node
+				if (e.type != "focus")
+					tinyMCE.selectedNode = null;
 
-			return cl;
-		},
+				tinyMCE.triggerNodeChange(false);
+				tinyMCE.execCommand("mceEndTyping");
 
-		run : function(e, f, s) {
-			var t = this, o;
+				if (e.type == "mouseup")
+					tinyMCE.execCommand("mceAddUndoLevel");
 
-			if (t.doc && typeof(e) === 'string')
-				e = t.get(e);
+				// Just in case
+				if (!tinyMCE.selectedInstance && e.target.editorId)
+					tinyMCE.instances[e.target.editorId].select();
 
-			if (!e)
 				return false;
+		}
+	},
 
-			s = s || this;
-			if (!e.nodeType && (e.length || e.length === 0)) {
-				o = [];
+	getButtonHTML : function(id, lang, img, cmd, ui, val) {
+		var h = '', m, x, io = '';
 
-				each(e, function(e, i) {
-					if (e) {
-						if (typeof(e) == 'string')
-							e = t.doc.getElementById(e);
+		cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'' + cmd + '\'';
 
-						o.push(f.call(s, e, i));
-					}
-				});
+		if (typeof(ui) != "undefined" && ui != null)
+			cmd += ',' + ui;
 
-				return o;
-			}
+		if (typeof(val) != "undefined" && val != null)
+			cmd += ",'" + val + "'";
 
-			return f.call(s, e);
-		},
+		cmd += ');';
 
-		getAttribs : function(n) {
-			var o;
+		// Patch for IE7 bug with hover out not restoring correctly
+		if (tinyMCE.isRealIE)
+			io = 'onmouseover="tinyMCE.lastHover = this;"';
 
-			n = this.get(n);
+		// Use tilemaps when enabled and found and never in MSIE since it loads the tile each time from cache if cahce is disabled
+		if (tinyMCE.getParam('button_tile_map') && (!tinyMCE.isIE || tinyMCE.isOpera) && (m = this.buttonMap[id]) != null && (tinyMCE.getParam("language") == "en" || img.indexOf('$lang') == -1)) {
+			// Tiled button
+			x = 0 - (m * 20) == 0 ? '0' : 0 - (m * 20);
+			h += '<a id="{$editor_id}_' + id + '" href="javascript:' + cmd + '" onclick="' + cmd + 'return false;" onmousedown="return false;" ' + io + ' class="mceTiledButton mceButtonNormal" target="_self">';
+			h += '<img src="{$themeurl}/images/spacer.gif" style="background-position: ' + x + 'px 0" alt="{$'+lang+'}" title="{$' + lang + '}" />';
+			h += '</a>';
+		} else {
+			// Normal button
+			h += '<a id="{$editor_id}_' + id + '" href="javascript:' + cmd + '" onclick="' + cmd + 'return false;" onmousedown="return false;" ' + io + ' class="mceButtonNormal" target="_self">';
+			h += '<img src="' + img + '" alt="{$'+lang+'}" title="{$' + lang + '}" />';
+			h += '</a>';
+		}
 
-			if (!n)
-				return [];
+		return h;
+	},
 
-			if (isIE) {
-				o = [];
+	getMenuButtonHTML : function(id, lang, img, mcmd, cmd, ui, val) {
+		var h = '', m, x;
 
-				// Object will throw exception in IE
-				if (n.nodeName == 'OBJECT')
-					return n.attributes;
+		mcmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'' + mcmd + '\');';
+		cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'' + cmd + '\'';
 
-				// IE doesn't keep the selected attribute if you clone option elements
-				if (n.nodeName === 'OPTION' && this.getAttrib(n, 'selected'))
-					o.push({specified : 1, nodeName : 'selected'});
+		if (typeof(ui) != "undefined" && ui != null)
+			cmd += ',' + ui;
 
-				// It's crazy that this is faster in IE but it's because it returns all attributes all the time
-				n.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi, '').replace(/[\w:\-]+/gi, function(a) {
-					o.push({specified : 1, nodeName : a});
-				});
+		if (typeof(val) != "undefined" && val != null)
+			cmd += ",'" + val + "'";
 
-				return o;
-			}
+		cmd += ');';
 
-			return n.attributes;
-		},
+		// Use tilemaps when enabled and found and never in MSIE since it loads the tile each time from cache if cahce is disabled
+		if (tinyMCE.getParam('button_tile_map') && (!tinyMCE.isIE || tinyMCE.isOpera) && (m = tinyMCE.buttonMap[id]) != null && (tinyMCE.getParam("language") == "en" || img.indexOf('$lang') == -1)) {
+			x = 0 - (m * 20) == 0 ? '0' : 0 - (m * 20);
 
-		destroy : function(s) {
-			var t = this;
+			if (tinyMCE.isRealIE)
+				h += '<span id="{$editor_id}_' + id + '" class="mceMenuButton" onmouseover="tinyMCE._menuButtonEvent(\'over\',this);tinyMCE.lastHover = this;" onmouseout="tinyMCE._menuButtonEvent(\'out\',this);">';
+			else
+				h += '<span id="{$editor_id}_' + id + '" class="mceMenuButton">';
 
-			if (t.events)
-				t.events.destroy();
+			h += '<a href="javascript:' + cmd + '" onclick="' + cmd + 'return false;" onmousedown="return false;" class="mceTiledButton mceMenuButtonNormal" target="_self">';
+			h += '<img src="{$themeurl}/images/spacer.gif" style="width: 20px; height: 20px; background-position: ' + x + 'px 0" title="{$' + lang + '}" /></a>';
+			h += '<a href="javascript:' + mcmd + '" onclick="' + mcmd + 'return false;" onmousedown="return false;"><img src="{$themeurl}/images/button_menu.gif" title="{$' + lang + '}" class="mceMenuButton" />';
+			h += '</a></span>';
+		} else {
+			if (tinyMCE.isRealIE)
+				h += '<span id="{$editor_id}_' + id + '" dir="ltr" class="mceMenuButton" onmouseover="tinyMCE._menuButtonEvent(\'over\',this);tinyMCE.lastHover = this;" onmouseout="tinyMCE._menuButtonEvent(\'out\',this);">';
+			else
+				h += '<span id="{$editor_id}_' + id + '" dir="ltr" class="mceMenuButton">';
 
-			t.win = t.doc = t.root = t.events = null;
+			h += '<a href="javascript:' + cmd + '" onclick="' + cmd + 'return false;" onmousedown="return false;" class="mceMenuButtonNormal" target="_self">';
+			h += '<img src="' + img + '" title="{$' + lang + '}" /></a>';
+			h += '<a href="javascript:' + mcmd + '" onclick="' + mcmd + 'return false;" onmousedown="return false;"><img src="{$themeurl}/images/button_menu.gif" title="{$' + lang + '}" class="mceMenuButton" />';
+			h += '</a></span>';
+		}
 
-			// Manual destroy then remove unload handler
-			if (!s)
-				tinymce.removeUnload(t.destroy);
-		},
+		return h;
+	},
 
-		createRng : function() {
-			var d = this.doc;
+	_menuButtonEvent : function(e, o) {
+		if (o.className == 'mceMenuButtonFocus')
+			return;
 
-			return d.createRange ? d.createRange() : new tinymce.dom.Range(this);
-		},
+		if (e == 'over')
+			o.className = o.className + ' mceMenuHover';
+		else
+			o.className = o.className.replace(/\s.*$/, '');
+	},
 
-		nodeIndex : function(node, normalized) {
-			var idx = 0, lastNodeType, lastNode, nodeType;
+	addButtonMap : function(m) {
+		var i, a = m.replace(/\s+/, '').split(',');
 
-			if (node) {
-				for (lastNodeType = node.nodeType, node = node.previousSibling, lastNode = node; node; node = node.previousSibling) {
-					nodeType = node.nodeType;
+		for (i=0; i<a.length; i++)
+			this.buttonMap[a[i]] = i;
+	},
 
-					// Normalize text nodes
-					if (normalized && nodeType == 3) {
-						if (nodeType == lastNodeType || !node.nodeValue.length)
-							continue;
-					}
+	formSubmit : function(f, p) {
+		var n, inst, found = false;
 
-					idx++;
-					lastNodeType = nodeType;
-				}
-			}
+		if (f.form)
+			f = f.form;
 
-			return idx;
-		},
+		// Is it a form that has a TinyMCE instance
+		if (tinyMCE.getParam('save_on_tinymce_forms')) {
+			for (n in tinyMCE.instances) {
+				inst = tinyMCE.instances[n];
 
-		split : function(pe, e, re) {
-			var t = this, r = t.createRng(), bef, aft, pa;
+				if (!tinyMCE.isInstance(inst))
+					continue;
 
-			// 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 if this is chopped:
-			//   <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 of empty edges and produce:
-			//   <p>text 1</p><b>CHOP</b><p>text 2</p>
-			function trim(node) {
-				var i, children = node.childNodes;
-
-				if (node.nodeType == 1 && node.getAttribute('_mce_type') == 'bookmark')
-					return;
-
-				for (i = children.length - 1; i >= 0; i--)
-					trim(children[i]);
-
-				if (node.nodeType != 9) {
-					// Keep non whitespace text nodes
-					if (node.nodeType == 3 && node.nodeValue.length > 0)
-						return;
-
-					if (node.nodeType == 1) {
-						// If the only child is a bookmark then move it up
-						children = node.childNodes;
-						if (children.length == 1 && children[0] && children[0].nodeType == 1 && children[0].getAttribute('_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;
+				if (inst.formElement) {
+					if (f == inst.formElement.form) {
+						found = true;
+						inst.isNotDirty = true;
 					}
-
-					t.remove(node);
 				}
-
-				return node;
-			};
-
-			if (pe && e) {
-				// Get before chunk
-				r.setStart(pe.parentNode, t.nodeIndex(pe));
-				r.setEnd(e.parentNode, t.nodeIndex(e));
-				bef = r.extractContents();
-
-				// Get after chunk
-				r = t.createRng();
-				r.setStart(e.parentNode, t.nodeIndex(e) + 1);
-				r.setEnd(pe.parentNode, t.nodeIndex(pe) + 1);
-				aft = r.extractContents();
-
-				// Insert before chunk
-				pa = pe.parentNode;
-				pa.insertBefore(trim(bef), pe);
-
-				// Insert middle chunk
-				if (re)
-					pa.replaceChild(re, e);
-				else
-					pa.insertBefore(e, pe);
-
-				// Insert after chunk
-				pa.insertBefore(trim(aft), pe);
-				t.remove(pe);
-
-				return re || e;
 			}
-		},
+		} else
+			found  = true;
 
-		bind : function(target, name, func, scope) {
-			var t = this;
+		// Is valid
+		if (found) {
+			tinyMCE.removeTinyMCEFormElements(f);
+			tinyMCE.triggerSave();
+		}
 
-			if (!t.events)
-				t.events = new tinymce.dom.EventUtils();
+		// Is it patched
+		if (f.mceOldSubmit && p)
+			f.mceOldSubmit();
+	},
 
-			return t.events.add(target, name, func, scope || this);
-		},
+	submitPatch : function() {
+		tinyMCE.formSubmit(this, true);
+	},
 
-		unbind : function(target, name, func) {
-			var t = this;
+	onLoad : function() {
+		var r, i, c, mode, trigger, elements, element, settings, elementId, elm;
+		var selector, deselector, elementRefAr, form;
 
-			if (!t.events)
-				t.events = new tinymce.dom.EventUtils();
-
-			return t.events.remove(target, name, func);
-		},
-
-
-		_findSib : function(node, selector, name) {
-			var t = this, f = selector;
-
-			if (node) {
-				// If expression make a function of it using is
-				if (is(f, 'string')) {
-					f = function(node) {
-						return t.is(node, selector);
-					};
-				}
-
-				// Loop all siblings
-				for (node = node[name]; node; node = node[name]) {
-					if (f(node))
-						return node;
-				}
-			}
-
-			return null;
-		},
-
-		_isRes : function(c) {
-			// Is live resizble element
-			return /^(top|left|bottom|right|width|height)/i.test(c) || /;\s*(top|left|bottom|right|width|height)/i.test(c);
+		// Wait for everything to be loaded first
+		if (tinyMCE.settings.strict_loading_mode && this.loadingIndex != -1) {
+			window.setTimeout('tinyMCE.onLoad();', 1);
+			return;
 		}
 
-		/*
-		walk : function(n, f, s) {
-			var d = this.doc, w;
+		if (tinyMCE.isRealIE && window.event.type == "readystatechange" && document.readyState != "complete")
+			return true;
 
-			if (d.createTreeWalker) {
-				w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false);
+		if (tinyMCE.isLoaded)
+			return true;
 
-				while ((n = w.nextNode()) != null)
-					f.call(s || this, n);
-			} else
-				tinymce.walk(n, f, 'childNodes', s);
-		}
-		*/
+		tinyMCE.isLoaded = true;
 
-		/*
-		toRGB : function(s) {
-			var c = /^\s*?#([0-9A-F]{2})([0-9A-F]{1,2})([0-9A-F]{2})?\s*?$/.exec(s);
-
-			if (c) {
-				// #FFF -> #FFFFFF
-				if (!is(c[3]))
-					c[3] = c[2] = c[1];
-
-				return "rgb(" + parseInt(c[1], 16) + "," + parseInt(c[2], 16) + "," + parseInt(c[3], 16) + ")";
-			}
-
-			return s;
+		// IE produces JS error if TinyMCE is placed in a frame
+		// It seems to have something to do with the selection not beeing
+		// correctly initialized in IE so this hack solves the problem
+		if (tinyMCE.isRealIE && document.body && window.location.href != window.top.location.href) {
+			r = document.body.createTextRange();
+			r.collapse(true);
+			r.select();
 		}
-		*/
-	});
 
-	tinymce.DOM = new tinymce.dom.DOMUtils(document, {process_html : 0});
-})(tinymce);
+		tinyMCE.dispatchCallback(null, 'onpageload', 'onPageLoad');
 
-(function(ns) {
-	// Range constructor
-	function Range(dom) {
-		var t = 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 = tinymce.extend,
-			nodeIndex = dom.nodeIndex;
+		for (c=0; c<tinyMCE.configs.length; c++) {
+			tinyMCE.settings = tinyMCE.configs[c];
 
-		extend(t, {
-			// Inital states
-			startContainer : doc,
-			startOffset : 0,
-			endContainer : doc,
-			endOffset : 0,
-			collapsed : TRUE,
-			commonAncestorContainer : doc,
+			selector = tinyMCE.getParam("editor_selector");
+			deselector = tinyMCE.getParam("editor_deselector");
+			elementRefAr = [];
 
-			// Range constants
-			START_TO_START : 0,
-			START_TO_END : 1,
-			END_TO_END : 2,
-			END_TO_START : 3,
+			// Add submit triggers
+			if (document.forms && tinyMCE.settings.add_form_submit_trigger && !tinyMCE.submitTriggers) {
+				for (i=0; i<document.forms.length; i++) {
+					form = document.forms[i];
 
-			// 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
-		});
+					tinyMCE.addEvent(form, "submit", TinyMCE_Engine.prototype.handleEvent);
+					tinyMCE.addEvent(form, "reset", TinyMCE_Engine.prototype.handleEvent);
+					tinyMCE.submitTriggers = true; // Do it only once
 
-		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) {
-				t[END_CONTAINER] = t[START_CONTAINER];
-				t[END_OFFSET] = t[START_OFFSET];
-			} else {
-				t[START_CONTAINER] = t[END_CONTAINER];
-				t[START_OFFSET] = t[END_OFFSET];
-			}
-
-			t.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 = t[START_CONTAINER], so = t[START_OFFSET], ec = t[END_CONTAINER], eo = t[END_OFFSET];
-
-			// Check START_TO_START
-			if (h === 0)
-				return _compareBoundaryPoints(sc, so, sc, so);
-
-			// Check START_TO_END
-			if (h === 1)
-				return _compareBoundaryPoints(sc, so, ec, eo);
-
-			// Check END_TO_END
-			if (h === 2)
-				return _compareBoundaryPoints(ec, eo, ec, eo);
-
-			// Check END_TO_START
-			if (h === 3)
-				return _compareBoundaryPoints(ec, eo, sc, so);
-		};
-
-		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);
+					// Patch the form.submit function
+					if (tinyMCE.settings.submit_patch) {
+						try {
+							form.mceOldSubmit = form.submit;
+							form.submit = TinyMCE_Engine.prototype.submitPatch;
+						} catch (e) {
+							// Do nothing
+						}
+					}
 				}
-			} else {
-				// Insert element node
-				if (startContainer.childNodes.length > 0)
-					o = startContainer.childNodes[startOffset];
-
-				if (o)
-					startContainer.insertBefore(n, o);
-				else
-					startContainer.appendChild(n);
 			}
-		};
 
-		function surroundContents(n) {
-			var f = t.extractContents();
+			// Add editor instances based on mode
+			mode = tinyMCE.settings.mode;
+			switch (mode) {
+				case "exact":
+					elements = tinyMCE.getParam('elements', '', true, ',');
 
-			t.insertNode(n);
-			n.appendChild(f);
-			t.selectNode(n);
-		};
+					for (i=0; i<elements.length; i++) {
+						element = tinyMCE._getElementById(elements[i]);
+						trigger = element ? element.getAttribute(tinyMCE.settings.textarea_trigger) : "";
 
-		function cloneRange() {
-			return extend(new Range(dom), {
-				startContainer : t[START_CONTAINER],
-				startOffset : t[START_OFFSET],
-				endContainer : t[END_CONTAINER],
-				endOffset : t[END_OFFSET],
-				collapsed : t.collapsed,
-				commonAncestorContainer : t.commonAncestorContainer
-			});
-		};
+						if (new RegExp('\\b' + deselector + '\\b').test(tinyMCE.getAttrib(element, "class")))
+							continue;
 
-		// Private methods
+						if (trigger == "false")
+							continue;
 
-		function _getSelectedNode(container, offset) {
-			var child;
+						if ((tinyMCE.settings.ask || tinyMCE.settings.convert_on_click) && element) {
+							elementRefAr[elementRefAr.length] = element;
+							continue;
+						}
 
-			if (container.nodeType == 3 /* TEXT_NODE */)
-				return container;
+						if (element)
+							tinyMCE.addMCEControl(element, elements[i]);
+					}
+				break;
 
-			if (offset < 0)
-				return container;
+				case "specific_textareas":
+				case "textareas":
+					elements = document.getElementsByTagName("textarea");
 
-			child = container.firstChild;
-			while (child && offset > 0) {
-				--offset;
-				child = child.nextSibling;
-			}
+					for (i=0; i<elements.length; i++) {
+						elm = elements.item(i);
+						trigger = elm.getAttribute(tinyMCE.settings.textarea_trigger);
 
-			if (child)
-				return child;
+						if (selector !== '' && !new RegExp('\\b' + selector + '\\b').test(tinyMCE.getAttrib(elm, "class")))
+							continue;
 
-			return container;
-		};
+						if (selector !== '')
+							trigger = selector !== '' ? "true" : "";
 
-		function _isCollapsed() {
-			return (t[START_CONTAINER] == t[END_CONTAINER] && t[START_OFFSET] == t[END_OFFSET]);
-		};
+						if (new RegExp('\\b' + deselector + '\\b').test(tinyMCE.getAttrib(elm, "class")))
+							continue;
 
-		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
+						if ((mode == "specific_textareas" && trigger == "true") || (mode == "textareas" && trigger != "false"))
+							elementRefAr[elementRefAr.length] = elm;
+					}
+				break;
 			}
 
-			// 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;
+			for (i=0; i<elementRefAr.length; i++) {
+				element = elementRefAr[i];
+				elementId = element.name ? element.name : element.id;
 
-			if (c) {
-				offsetC = 0;
-				n = containerA.firstChild;
+				if (tinyMCE.settings.ask || tinyMCE.settings.convert_on_click) {
+					// Focus breaks in Mozilla
+					if (tinyMCE.isGecko) {
+						settings = tinyMCE.settings;
 
-				while (n != c && offsetC < offsetA) {
-					offsetC++;
-					n = n.nextSibling;
-				}
+						tinyMCE.addEvent(element, "focus", function (e) {window.setTimeout(function() {TinyMCE_Engine.prototype.confirmAdd(e, settings);}, 10);});
 
-				if (offsetA <= offsetC)
-					return -1; // before
+						if (element.nodeName != "TEXTAREA" && element.nodeName != "INPUT")
+							tinyMCE.addEvent(element, "click", function (e) {window.setTimeout(function() {TinyMCE_Engine.prototype.confirmAdd(e, settings);}, 10);});
+						// tinyMCE.addEvent(element, "mouseover", function (e) {window.setTimeout(function() {TinyMCE_Engine.prototype.confirmAdd(e, settings);}, 10);});
+					} else {
+						settings = tinyMCE.settings;
 
-				return 1; // after
+						tinyMCE.addEvent(element, "focus", function () { TinyMCE_Engine.prototype.confirmAdd(null, settings); });
+						tinyMCE.addEvent(element, "click", function () { TinyMCE_Engine.prototype.confirmAdd(null, settings); });
+						// tinyMCE.addEvent(element, "mouseenter", function () { TinyMCE_Engine.prototype.confirmAdd(null, settings); });
+					}
+				} else
+					tinyMCE.addMCEControl(element, elementId);
 			}
 
-			// 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;
+			// Handle auto focus
+			if (tinyMCE.settings.auto_focus) {
+				window.setTimeout(function () {
+					var inst = tinyMCE.getInstanceById(tinyMCE.settings.auto_focus);
+					inst.selection.selectNode(inst.getBody(), true, true);
+					inst.contentWindow.focus();
+				}, 100);
 			}
 
-			if (c) {
-				offsetC = 0;
-				n = containerB.firstChild;
+			tinyMCE.dispatchCallback(null, 'oninit', 'onInit');
+		}
+	},
 
-				while (n != c && offsetC < offsetB) {
-					offsetC++;
-					n = n.nextSibling;
-				}
+	isInstance : function(o) {
+		return o != null && typeof(o) == "object" && o.isTinyMCE_Control;
+	},
 
-				if (offsetC < offsetB)
-					return -1; // before
+	getParam : function(name, default_value, strip_whitespace, split_chr) {
+		var i, outArray, value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name];
 
-				return 1; // after
-			}
+		// Fix bool values
+		if (value == "true" || value == "false")
+			return (value == "true");
 
-			// 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;
+		if (strip_whitespace)
+			value = tinyMCE.regexpReplace(value, "[ \t\r\n]", "");
 
-			while (childA && childA.parentNode != cmnRoot)
-				childA = childA.parentNode;
+		if (typeof(split_chr) != "undefined" && split_chr != null) {
+			value = value.split(split_chr);
+			outArray = [];
 
-			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;
+			for (i=0; i<value.length; i++) {
+				if (value[i] && value[i] !== '')
+					outArray[outArray.length] = value[i];
 			}
-		};
 
-		function _setEndPoint(st, n, o) {
-			var ec, sc;
+			value = outArray;
+		}
 
-			if (st) {
-				t[START_CONTAINER] = n;
-				t[START_OFFSET] = o;
-			} else {
-				t[END_CONTAINER] = n;
-				t[END_OFFSET] = o;
-			}
+		return value;
+	},
 
-			// 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 = t[END_CONTAINER];
-			while (ec.parentNode)
-				ec = ec.parentNode;
+	getLang : function(name, default_value, parse_entities, va) {
+		var v = (typeof(tinyMCELang[name]) == "undefined") ? default_value : tinyMCELang[name], n;
 
-			sc = t[START_CONTAINER];
-			while (sc.parentNode)
-				sc = sc.parentNode;
+		if (parse_entities)
+			v = tinyMCE.entityDecode(v);
 
-			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(t[START_CONTAINER], t[START_OFFSET], t[END_CONTAINER], t[END_OFFSET]) > 0)
-					t.collapse(st);
-			} else
-				t.collapse(st);
+		if (va) {
+			for (n in va)
+				v = this.replaceVar(v, n, va[n]);
+		}
 
-			t.collapsed = _isCollapsed();
-			t.commonAncestorContainer = dom.findCommonAncestor(t[START_CONTAINER], t[END_CONTAINER]);
-		};
+		return v;
+	},
 
-		function _traverse(how) {
-			var c, endContainerDepth = 0, startContainerDepth = 0, p, depthDiff, startNode, endNode, sp, ep;
+	entityDecode : function(s) {
+		var e = document.createElement("div");
 
-			if (t[START_CONTAINER] == t[END_CONTAINER])
-				return _traverseSameContainer(how);
+		e.innerHTML = s;
 
-			for (c = t[END_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) {
-				if (p == t[START_CONTAINER])
-					return _traverseCommonStartContainer(c, how);
+		return !e.firstChild ? s : e.firstChild.nodeValue;
+	},
 
-				++endContainerDepth;
-			}
+	addToLang : function(prefix, ar) {
+		var k;
 
-			for (c = t[START_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) {
-				if (p == t[END_CONTAINER])
-					return _traverseCommonEndContainer(c, how);
+		for (k in ar) {
+			if (typeof(ar[k]) == 'function')
+				continue;
 
-				++startContainerDepth;
-			}
+			tinyMCELang[(k.indexOf('lang_') == -1 ? 'lang_' : '') + (prefix !== '' ? (prefix + "_") : '') + k] = ar[k];
+		}
 
-			depthDiff = startContainerDepth - endContainerDepth;
+		this.loadNextScript();
+	},
 
-			startNode = t[START_CONTAINER];
-			while (depthDiff > 0) {
-				startNode = startNode.parentNode;
-				depthDiff--;
-			}
+	triggerNodeChange : function(focus, setup_content) {
+		var elm, inst, editorId, undoIndex = -1, undoLevels = -1, doc, anySelection, st;
 
-			endNode = t[END_CONTAINER];
-			while (depthDiff < 0) {
-				endNode = endNode.parentNode;
-				depthDiff++;
-			}
+		if (tinyMCE.selectedInstance) {
+			inst = tinyMCE.selectedInstance;
+			elm = (typeof(setup_content) != "undefined" && setup_content) ? tinyMCE.selectedElement : inst.getFocusElement();
 
-			// 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;
-			}
+/*			if (elm == inst.lastTriggerEl)
+				return;
 
-			return _traverseCommonAncestors(startNode, endNode, how);
-		};
+			inst.lastTriggerEl = elm;*/
 
-		 function _traverseSameContainer(how) {
-			var frag, s, sub, n, cnt, sibling, xferNode;
+			editorId = inst.editorId;
+			st = inst.selection.getSelectedText();
 
-			if (how != DELETE)
-				frag = doc.createDocumentFragment();
+			if (tinyMCE.settings.auto_resize)
+				inst.resizeToContent();
 
-			// If selection is empty, just return the fragment
-			if (t[START_OFFSET] == t[END_OFFSET])
-				return frag;
+			if (setup_content && tinyMCE.isGecko && inst.isHidden())
+				elm = inst.getBody();
 
-			// Text node needs special case handling
-			if (t[START_CONTAINER].nodeType == 3 /* TEXT_NODE */) {
-				// get the substring
-				s = t[START_CONTAINER].nodeValue;
-				sub = s.substring(t[START_OFFSET], t[END_OFFSET]);
+			inst.switchSettings();
+			anySelection = !inst.selection.isCollapsed();
 
-				// set the original text node to its new value
-				if (how != CLONE) {
-					t[START_CONTAINER].deleteData(t[START_OFFSET], t[END_OFFSET] - t[START_OFFSET]);
-
-					// Nothing is partially selected, so collapse to start point
-					t.collapse(TRUE);
-				}
-
-				if (how == DELETE)
-					return;
-
-				frag.appendChild(doc.createTextNode(sub));
-				return frag;
+			if (tinyMCE.settings.custom_undo_redo) {
+				undoIndex = inst.undoRedo.undoIndex;
+				undoLevels = inst.undoRedo.undoLevels.length;
 			}
 
-			// Copy nodes between the start/end offsets.
-			n = _getSelectedNode(t[START_CONTAINER], t[START_OFFSET]);
-			cnt = t[END_OFFSET] - t[START_OFFSET];
+			tinyMCE.dispatchCallback(inst, 'handle_node_change_callback', 'handleNodeChange', editorId, elm, undoIndex, undoLevels, inst.visualAid, anySelection, setup_content);
+		}
 
-			while (cnt > 0) {
-				sibling = n.nextSibling;
-				xferNode = _traverseFullySelected(n, how);
+		if (this.selectedInstance && (typeof(focus) == "undefined" || focus))
+			this.selectedInstance.contentWindow.focus();
+	},
 
-				if (frag)
-					frag.appendChild( xferNode );
+	_customCleanup : function(inst, type, content) {
+		var pl, po, i, customCleanup;
 
-				--cnt;
-				n = sibling;
-			}
+		// Call custom cleanup
+		customCleanup = tinyMCE.settings.cleanup_callback;
+		if (customCleanup != '')
+			content = tinyMCE.resolveDots(tinyMCE.settings.cleanup_callback, window)(type, content, inst);
 
-			// Nothing is partially selected, so collapse to start point
-			if (how != CLONE)
-				t.collapse(TRUE);
+		// Trigger theme cleanup
+		po = tinyMCE.themes[tinyMCE.settings.theme];
+		if (po && po.cleanup)
+			content = po.cleanup(type, content, inst);
 
-			return frag;
-		};
+		// Trigger plugin cleanups
+		pl = inst.plugins;
+		for (i=0; i<pl.length; i++) {
+			po = tinyMCE.plugins[pl[i]];
 
-		function _traverseCommonStartContainer(endAncestor, how) {
-			var frag, n, endIdx, cnt, sibling, xferNode;
+			if (po && po.cleanup)
+				content = po.cleanup(type, content, inst);
+		}
 
-			if (how != DELETE)
-				frag = doc.createDocumentFragment();
+		return content;
+	},
 
-			n = _traverseRightBoundary(endAncestor, how);
+	setContent : function(h) {
+		if (tinyMCE.selectedInstance) {
+			tinyMCE.selectedInstance.execCommand('mceSetContent', false, h);
+			tinyMCE.selectedInstance.repaint();
+		}
+	},
 
-			if (frag)
-				frag.appendChild(n);
+	importThemeLanguagePack : function(name) {
+		if (typeof(name) == "undefined")
+			name = tinyMCE.settings.theme;
 
-			endIdx = nodeIndex(endAncestor);
-			cnt = endIdx - t[START_OFFSET];
+		tinyMCE.loadScript(tinyMCE.baseURL + '/themes/' + name + '/langs/' + tinyMCE.settings.language + '.js');
+	},
 
-			if (cnt <= 0) {
-				// Collapse to just before the endAncestor, which
-				// is partially selected.
-				if (how != CLONE) {
-					t.setEndBefore(endAncestor);
-					t.collapse(FALSE);
-				}
+	importPluginLanguagePack : function(name) {
+		var b = tinyMCE.baseURL + '/plugins/' + name;
 
-				return frag;
-			}
+		if (this.plugins[name])
+			b = this.plugins[name].baseURL;
 
-			n = endAncestor.previousSibling;
-			while (cnt > 0) {
-				sibling = n.previousSibling;
-				xferNode = _traverseFullySelected(n, how);
+		tinyMCE.loadScript(b + '/langs/' + tinyMCE.settings.language +  '.js');
+	},
 
-				if (frag)
-					frag.insertBefore(xferNode, frag.firstChild);
+	applyTemplate : function(h, ag) {
+		return h.replace(new RegExp('\\{\\$([a-z0-9_]+)\\}', 'gi'), function(m, s) {
+			if (s.indexOf('lang_') == 0 && tinyMCELang[s])
+				return tinyMCELang[s];
 
-				--cnt;
-				n = sibling;
-			}
+			if (ag && ag[s])
+				return ag[s];
 
-			// Collapse to just before the endAncestor, which
-			// is partially selected.
-			if (how != CLONE) {
-				t.setEndBefore(endAncestor);
-				t.collapse(FALSE);
-			}
+			if (tinyMCE.settings[s])
+				return tinyMCE.settings[s];
 
-			return frag;
-		};
+			if (m == 'themeurl')
+				return tinyMCE.themeURL;
 
-		function _traverseCommonEndContainer(startAncestor, how) {
-			var frag, startIdx, n, cnt, sibling, xferNode;
+			return m;
+		});
+	},
 
-			if (how != DELETE)
-				frag = doc.createDocumentFragment();
+	replaceVar : function(h, r, v) {
+		return h.replace(new RegExp('{\\\$' + r + '}', 'g'), v);
+	},
 
-			n = _traverseLeftBoundary(startAncestor, how);
-			if (frag)
-				frag.appendChild(n);
+	openWindow : function(template, args) {
+		var html, width, height, x, y, resizable, scrollbars, url, name, win, modal, features;
 
-			startIdx = nodeIndex(startAncestor);
-			++startIdx;  // Because we already traversed it....
+		args = !args ? {} : args;
 
-			cnt = t[END_OFFSET] - startIdx;
-			n = startAncestor.nextSibling;
-			while (cnt > 0) {
-				sibling = n.nextSibling;
-				xferNode = _traverseFullySelected(n, how);
+		args.mce_template_file = template.file;
+		args.mce_width = template.width;
+		args.mce_height = template.height;
+		tinyMCE.windowArgs = args;
 
-				if (frag)
-					frag.appendChild(xferNode);
+		html = template.html;
+		if (!(width = parseInt(template.width)))
+			width = 320;
 
-				--cnt;
-				n = sibling;
-			}
+		if (!(height = parseInt(template.height)))
+			height = 200;
 
-			if (how != CLONE) {
-				t.setStartAfter(startAncestor);
-				t.collapse(TRUE);
-			}
+		// Add to height in M$ due to SP2 WHY DON'T YOU GUYS IMPLEMENT innerWidth of windows!!
+		if (tinyMCE.isIE)
+			height += 40;
+		else
+			height += 20;
 
-			return frag;
-		};
+		x = parseInt(screen.width / 2.0) - (width / 2.0);
+		y = parseInt(screen.height / 2.0) - (height / 2.0);
 
-		function _traverseCommonAncestors(startAncestor, endAncestor, how) {
-			var n, frag, commonParent, startOffset, endOffset, cnt, sibling, nextSibling;
+		resizable = (args && args.resizable) ? args.resizable : "no";
+		scrollbars = (args && args.scrollbars) ? args.scrollbars : "no";
 
-			if (how != DELETE)
-				frag = doc.createDocumentFragment();
+		if (template.file.charAt(0) != '/' && template.file.indexOf('://') == -1)
+			url = tinyMCE.baseURL + "/themes/" + tinyMCE.getParam("theme") + "/" + template.file;
+		else
+			url = template.file;
 
-			n = _traverseLeftBoundary(startAncestor, how);
-			if (frag)
-				frag.appendChild(n);
+		// Replace all args as variables in URL
+		for (name in args) {
+			if (typeof(args[name]) == 'function')
+				continue;
 
-			commonParent = startAncestor.parentNode;
-			startOffset = nodeIndex(startAncestor);
-			endOffset = nodeIndex(endAncestor);
-			++startOffset;
+			url = tinyMCE.replaceVar(url, name, escape(args[name]));
+		}
 
-			cnt = endOffset - startOffset;
-			sibling = startAncestor.nextSibling;
+		if (html) {
+			html = tinyMCE.replaceVar(html, "css", this.settings.popups_css);
+			html = tinyMCE.applyTemplate(html, args);
 
-			while (cnt > 0) {
-				nextSibling = sibling.nextSibling;
-				n = _traverseFullySelected(sibling, how);
-
-				if (frag)
-					frag.appendChild(n);
-
-				sibling = nextSibling;
-				--cnt;
+			win = window.open("", "mcePopup" + new Date().getTime(), "top=" + y + ",left=" + x + ",scrollbars=" + scrollbars + ",dialog=yes,minimizable=" + resizable + ",modal=yes,width=" + width + ",height=" + height + ",resizable=" + resizable);
+			if (win == null) {
+				alert(tinyMCELang.lang_popup_blocked);
+				return;
 			}
 
-			n = _traverseRightBoundary(endAncestor, how);
+			win.document.write(html);
+			win.document.close();
+			win.resizeTo(width, height);
+			win.focus();
+		} else {
+			if ((tinyMCE.isRealIE) && resizable != 'yes' && tinyMCE.settings.dialog_type == "modal") {
+				height += 10;
 
-			if (frag)
-				frag.appendChild(n);
+				features = "resizable:" + resizable + ";scroll:" + scrollbars + ";status:yes;center:yes;help:no;dialogWidth:" + width + "px;dialogHeight:" + height + "px;";
 
-			if (how != CLONE) {
-				t.setStartAfter(startAncestor);
-				t.collapse(TRUE);
-			}
+				window.showModalDialog(url, window, features);
+			} else {
+				modal = (resizable == "yes") ? "no" : "yes";
 
-			return frag;
-		};
+				if (tinyMCE.isGecko && tinyMCE.isMac)
+					modal = "no";
 
-		function _traverseRightBoundary(root, how) {
-			var next = _getSelectedNode(t[END_CONTAINER], t[END_OFFSET] - 1), parent, clonedParent, prevSibling, clonedChild, clonedGrandParent, isFullySelected = next != t[END_CONTAINER];
+				if (template.close_previous != "no")
+					try {tinyMCE.lastWindow.close();} catch (ex) {}
 
-			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;
+				win = window.open(url, "mcePopup" + new Date().getTime(), "top=" + y + ",left=" + x + ",scrollbars=" + scrollbars + ",dialog=" + modal + ",minimizable=" + resizable + ",modal=" + modal + ",width=" + width + ",height=" + height + ",resizable=" + resizable);
+				if (win == null) {
+					alert(tinyMCELang.lang_popup_blocked);
+					return;
 				}
 
-				if (parent == root)
-					return clonedParent;
+				if (template.close_previous != "no")
+					tinyMCE.lastWindow = win;
 
-				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(t[START_CONTAINER], t[START_OFFSET]), isFullySelected = next != t[START_CONTAINER], 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;
+				try {
+					win.resizeTo(width, height);
+				} catch(e) {
+					// Ignore
 				}
 
-				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 = t[START_OFFSET];
-					newNodeValue = txtValue.substring(offset);
-					oldNodeValue = txtValue.substring(0, offset);
-				} else {
-					offset = t[END_OFFSET];
-					newNodeValue = txtValue.substring(0, offset);
-					oldNodeValue = txtValue.substring(offset);
+				// Make it bigger if statusbar is forced
+				if (tinyMCE.isGecko && win.document) {
+					if (win.document.defaultView.statusbar.visible)
+						win.resizeBy(0, tinyMCE.isMac ? 10 : 24);
 				}
 
-				if (how != CLONE)
-					n.nodeValue = oldNodeValue;
-
-				if (how == DELETE)
-					return;
-
-				newNode = n.cloneNode(FALSE);
-				newNode.nodeValue = newNodeValue;
-
-				return newNode;
+				win.focus();
 			}
+		}
+	},
 
-			if (how == DELETE)
-				return;
+	closeWindow : function(win) {
+		win.close();
+	},
 
-			return n.cloneNode(FALSE);
-		};
+	getVisualAidClass : function(class_name, state) {
+		var i, classNames, ar, className, aidClass = tinyMCE.settings.visual_table_class;
 
-		function _traverseFullySelected(n, how) {
-			if (how != DELETE)
-				return how == CLONE ? n.cloneNode(TRUE) : n;
+		if (typeof(state) == "undefined")
+			state = tinyMCE.settings.visual;
 
-			n.parentNode.removeChild(n);
-		};
-	};
+		// Split
+		classNames = [];
+		ar = class_name.split(' ');
+		for (i=0; i<ar.length; i++) {
+			if (ar[i] == aidClass)
+				ar[i] = "";
 
-	ns.Range = Range;
-})(tinymce.dom);
+			if (ar[i] !== '')
+				classNames[classNames.length] = ar[i];
+		}
 
-(function() {
-	function Selection(selection) {
-		var t = this, invisibleChar = '\uFEFF', range, lastIERng, dom = selection.dom, TRUE = true, FALSE = false;
+		if (state)
+			classNames[classNames.length] = aidClass;
 
-		// Returns a W3C DOM compatible range object by using the IE Range API
-		function getRange() {
-			var ieRange = selection.getRng(), domRange = dom.createRng(), element, collapsed;
+		// Glue
+		className = "";
+		for (i=0; i<classNames.length; i++) {
+			if (i > 0)
+				className += " ";
 
-			// 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;
+			className += classNames[i];
+		}
 
-			// Handle control selection or text selection of a image
-			if (ieRange.item || !element.hasChildNodes()) {
-				domRange.setStart(element.parentNode, dom.nodeIndex(element));
-				domRange.setEnd(domRange.startContainer, domRange.startOffset + 1);
+		return className;
+	},
 
-				return domRange;
-			}
+	handleVisualAid : function(el, deep, state, inst, skip_dispatch) {
+		var i, x, y, tableElement, anchorName, oldW, oldH, bo, cn;
 
-			collapsed = selection.isCollapsed();
+		if (!el)
+			return;
 
-			function findEndPoint(start) {
-				var marker, container, offset, nodes, startIndex = 0, endIndex, index, parent, checkRng, position;
+		if (!skip_dispatch)
+			tinyMCE.dispatchCallback(inst, 'handle_visual_aid_callback', 'handleVisualAid', el, deep, state, inst);
 
-				// Setup temp range and collapse it
-				checkRng = ieRange.duplicate();
-				checkRng.collapse(start);
+		tableElement = null;
 
-				// Create marker and insert it at the end of the endpoints parent
-				marker = dom.create('a');
-				parent = checkRng.parentElement();
+		switch (el.nodeName) {
+			case "TABLE":
+				oldW = el.style.width;
+				oldH = el.style.height;
+				bo = tinyMCE.getAttrib(el, "border");
 
-				// If parent doesn't have any children then set the container to that parent and the index to 0
-				if (!parent.hasChildNodes()) {
-					domRange[start ? 'setStart' : 'setEnd'](parent, 0);
-					return;
-				}
+				bo = bo == '' || bo == "0" ? true : false;
 
-				parent.appendChild(marker);
-				checkRng.moveToElementText(marker);
-				position = ieRange.compareEndPoints(start ? 'StartToStart' : 'EndToEnd', checkRng);
-				if (position > 0) {
-					// The position is after the end of the parent element.
-					// This is the case where IE puts the caret to the left edge of a table.
-					domRange[start ? 'setStartAfter' : 'setEndAfter'](parent);
-					dom.remove(marker);
-					return;
-				}
+				tinyMCE.setAttrib(el, "class", tinyMCE.getVisualAidClass(tinyMCE.getAttrib(el, "class"), state && bo));
 
-				// Setup node list and endIndex
-				nodes = tinymce.grep(parent.childNodes);
-				endIndex = nodes.length - 1;
-				// Perform a binary search for the position
-				while (startIndex <= endIndex) {
-					index = Math.floor((startIndex + endIndex) / 2);
+				el.style.width = oldW;
+				el.style.height = oldH;
 
-					// Insert marker and check it's position relative to the selection
-					parent.insertBefore(marker, nodes[index]);
-					checkRng.moveToElementText(marker);
-					position = ieRange.compareEndPoints(start ? 'StartToStart' : 'EndToEnd', checkRng);
-					if (position > 0) {
-						// Marker is to the right
-						startIndex = index + 1;
-					} else if (position < 0) {
-						// Marker is to the left
-						endIndex = index - 1;
-					} else {
-						// Maker is where we are
-						found = true;
-						break;
+				for (y=0; y<el.rows.length; y++) {
+					for (x=0; x<el.rows[y].cells.length; x++) {
+						cn = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(el.rows[y].cells[x], "class"), state && bo);
+						tinyMCE.setAttrib(el.rows[y].cells[x], "class", cn);
 					}
 				}
 
-				// Setup container
-				container = position > 0 || index == 0 ? marker.nextSibling : marker.previousSibling;
+				break;
 
-				// Handle element selection
-				if (container.nodeType == 1) {
-					dom.remove(marker);
+			case "A":
+				anchorName = tinyMCE.getAttrib(el, "name");
 
-					// Find offset and container
-					offset = dom.nodeIndex(container);
-					container = container.parentNode;
+				if (anchorName !== '' && state) {
+					el.title = anchorName;
+					tinyMCE.addCSSClass(el, 'mceItemAnchor');
+				} else if (anchorName !== '' && !state)
+					el.className = '';
 
-					// Move the offset if we are setting the end or the position is after an element
-					if (!start || index > 0)
-						offset++;
-				} else {
-					// Calculate offset within text node
-					if (position > 0 || index == 0) {
-						checkRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', ieRange);
-						offset = checkRng.text.length;
-					} else {
-						checkRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', ieRange);
-						offset = container.nodeValue.length - checkRng.text.length;
-					}
+				break;
+		}
 
-					dom.remove(marker);
-				}
+		if (deep && el.hasChildNodes()) {
+			for (i=0; i<el.childNodes.length; i++)
+				tinyMCE.handleVisualAid(el.childNodes[i], deep, state, inst, true);
+		}
+	},
 
-				domRange[start ? 'setStart' : 'setEnd'](container, offset);
-			};
+	fixGeckoBaseHREFBug : function(m, e, h) {
+		var xsrc, xhref;
 
-			// Find start point
-			findEndPoint(true);
+		if (tinyMCE.isGecko) {
+			if (m == 1) {
+				h = h.replace(/\ssrc=/gi, " mce_tsrc=");
+				h = h.replace(/\shref=/gi, " mce_thref=");
 
-			// Find end point if needed
-			if (!collapsed)
-				findEndPoint();
+				return h;
+			} else {
+				// Why bother if there is no src or href broken
+				if (!new RegExp('(src|href)=', 'g').test(h))
+					return h;
 
-			return domRange;
-		};
+				// Restore src and href that gets messed up by Gecko
+				tinyMCE.selectElements(e, 'A,IMG,SELECT,AREA,IFRAME,BASE,INPUT,SCRIPT,EMBED,OBJECT,LINK', function (n) {
+					xsrc = tinyMCE.getAttrib(n, "mce_tsrc");
+					xhref = tinyMCE.getAttrib(n, "mce_thref");
 
-		this.addRange = function(rng) {
-			var ieRng, ctrlRng, startContainer, startOffset, endContainer, endOffset, doc = selection.dom.doc, body = doc.body;
+					if (xsrc !== '') {
+						try {
+							n.src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings.base_href, xsrc);
+						} catch (e) {
+							// Ignore, Firefox cast exception if local file wasn't found
+						}
 
-			function setEndPoint(start) {
-				var container, offset, marker, tmpRng, nodes;
+						n.removeAttribute("mce_tsrc");
+					}
 
-				marker = dom.create('a');
-				container = start ? startContainer : endContainer;
-				offset = start ? startOffset : endOffset;
-				tmpRng = ieRng.duplicate();
-
-				if (container == doc) {
-					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]);
+					if (xhref !== '') {
+						try {
+							n.href = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings.base_href, xhref);
+						} catch (e) {
+							// Ignore, Firefox cast exception if local file wasn't found
 						}
 
-						tmpRng.moveToElementText(marker);
-					} else {
-						// Empty node selection for example <div>|</div>
-						marker = doc.createTextNode(invisibleChar);
-						container.appendChild(marker);
-						tmpRng.moveToElementText(marker.parentNode);
-						tmpRng.collapse(TRUE);
+						n.removeAttribute("mce_thref");
 					}
 
-					ieRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', tmpRng);
-					dom.remove(marker);
-				}
-			}
+					return false;
+				});
 
-			// Destroy cached range
-			this.destroy();
-
-			// 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 && startOffset == endOffset - 1) {
-				if (startOffset == endOffset - 1) {
-					try {
-						ctrlRng = body.createControlRange();
-						ctrlRng.addElement(startContainer.childNodes[startOffset]);
-						ctrlRng.select();
-						ctrlRng.scrollIntoView();
-						return;
-					} catch (ex) {
-						// Ignore
+				// Restore text/comment nodes
+				tinyMCE.selectNodes(e, function(n) {
+					if (n.nodeType == 3 || n.nodeType == 8) {
+						n.nodeValue = n.nodeValue.replace(/\smce_tsrc=/gi, " src=");
+						n.nodeValue = n.nodeValue.replace(/\smce_thref=/gi, " href=");
 					}
-				}
-			}
 
-			// Set start/end point of selection
-			setEndPoint(true);
-			setEndPoint();
-
-			// Select the new range and scroll it into view
-			ieRng.select();
-			ieRng.scrollIntoView();
-		};
-
-		this.getRangeAt = function() {
-			// Setup new range if the cache is empty
-			if (!range || !tinymce.dom.RangeUtils.compareRanges(lastIERng, selection.getRng())) {
-				range = getRange();
-
-				// Store away text range for next call
-				lastIERng = selection.getRng();
+					return false;
+				});
 			}
+		}
 
-			// IE will say that the range is equal then produce an invalid argument exception
-			// if you perform specific operations in a keyup event. For example Ctrl+Del.
-			// This hack will invalidate the range cache if the exception occurs
-			try {
-				range.startContainer.nextSibling;
-			} catch (ex) {
-				range = getRange();
-				lastIERng = null;
-			}
+		return h;
+	},
 
-			// Return cached range
-			return range;
-		};
+	_setHTML : function(doc, html_content) {
+		var i, html, paras, node;
 
-		this.destroy = function() {
-			// Destroy cached range and last IE range to avoid memory leaks
-			lastIERng = range = null;
-		};
+		// Force closed anchors open
+		//html_content = html_content.replace(new RegExp('<a(.*?)/>', 'gi'), '<a$1></a>');
 
-		// IE has an issue where you can't select/move the caret by clicking outside the body if the document is in standards mode
-		if (selection.dom.boxModel) {
-			(function() {
-				var doc = dom.doc, body = doc.body, started, startRng;
+		html_content = tinyMCE.cleanupHTMLCode(html_content);
 
-				// Make HTML element unselectable since we are going to handle selection by hand
-				doc.documentElement.unselectable = TRUE;
+		// Try innerHTML if it fails use pasteHTML in MSIE
+		try {
+			tinyMCE.setInnerHTML(doc.body, html_content);
+		} catch (e) {
+			if (this.isMSIE)
+				doc.body.createTextRange().pasteHTML(html_content);
+		}
 
-				// Return range from point or null if it failed
-				function rngFromPoint(x, y) {
-					var rng = body.createTextRange();
+		// Content duplication bug fix
+		if (tinyMCE.isIE && tinyMCE.settings.fix_content_duplication) {
+			// Remove P elements in P elements
+			paras = doc.getElementsByTagName("P");
+			for (i=0; i<paras.length; i++) {
+				node = paras[i];
 
-					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();
+				while ((node = node.parentNode) != null) {
+					if (node.nodeName == "P")
+						node.outerHTML = node.innerHTML;
 				}
+			}
 
-				// Removes listeners
-				function endSelection() {
-					dom.unbind(doc, 'mouseup', endSelection);
-					dom.unbind(doc, 'mousemove', selectionChange);
-					started = 0;
-				};
+			// Content duplication bug fix (Seems to be word crap)
+			html = doc.body.innerHTML;
 
-				// Detect when user selects outside BODY
-				dom.bind(doc, 'mousedown', function(e) {
-					if (e.target.nodeName === 'HTML') {
-						if (started)
-							endSelection();
-
-						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);
-
-							startRng.select();
-						}
-					}
-				});
-			})();
+			// Always set the htmlText output
+			tinyMCE.setInnerHTML(doc.body, html);
 		}
-	};
 
-	// Expose the selection object
-	tinymce.dom.TridentSelection = Selection;
-})();
+		tinyMCE.cleanupAnchors(doc);
 
+		if (tinyMCE.getParam("convert_fonts_to_spans"))
+			tinyMCE.convertSpansToFonts(doc);
+	},
 
-/*
- * Sizzle CSS Selector Engine - v1.0
- *  Copyright 2009, The Dojo Foundation
- *  Released under the MIT, BSD, and GPL Licenses.
- *  More information: http://sizzlejs.com/
- */
-(function(){
+	getEditorId : function(form_element) {
+		var inst = this.getInstanceById(form_element);
 
-var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
-	done = 0,
-	toString = Object.prototype.toString,
-	hasDuplicate = false,
-	baseHasDuplicate = true;
+		if (!inst)
+			return null;
 
-// Here we check if the JavaScript engine is using some sort of
-// optimization where it does not always call our comparision
-// function. If that is the case, discard the hasDuplicate value.
-//   Thus far that includes Google Chrome.
-[0, 0].sort(function(){
-	baseHasDuplicate = false;
-	return 0;
-});
+		return inst.editorId;
+	},
 
-var Sizzle = function(selector, context, results, seed) {
-	results = results || [];
-	context = context || document;
+	getInstanceById : function(editor_id) {
+		var inst = this.instances[editor_id], n;
 
-	var origContext = context;
+		if (!inst) {
+			for (n in tinyMCE.instances) {
+				inst = tinyMCE.instances[n];
 
-	if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
-		return [];
-	}
-	
-	if ( !selector || typeof selector !== "string" ) {
-		return results;
-	}
+				if (!tinyMCE.isInstance(inst))
+					continue;
 
-	var parts = [], m, set, checkSet, extra, prune = true, contextXML = Sizzle.isXML(context),
-		soFar = selector, ret, cur, pop, i;
-	
-	// Reset the position of the chunker regexp (start from head)
-	do {
-		chunker.exec("");
-		m = chunker.exec(soFar);
-
-		if ( m ) {
-			soFar = m[3];
-		
-			parts.push( m[1] );
-		
-			if ( m[2] ) {
-				extra = m[3];
-				break;
+				if (inst.formTargetElementId == editor_id)
+					return inst;
 			}
-		}
-	} while ( m );
+		} else
+			return inst;
 
-	if ( parts.length > 1 && origPOS.exec( selector ) ) {
-		if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
-			set = posProcess( parts[0] + parts[1], context );
-		} else {
-			set = Expr.relative[ parts[0] ] ?
-				[ context ] :
-				Sizzle( parts.shift(), context );
+		return null;
+	},
 
-			while ( parts.length ) {
-				selector = parts.shift();
+	queryInstanceCommandValue : function(editor_id, command) {
+		var inst = tinyMCE.getInstanceById(editor_id);
 
-				if ( Expr.relative[ selector ] ) {
-					selector += parts.shift();
-				}
-				
-				set = posProcess( selector, set );
-			}
-		}
-	} else {
-		// Take a shortcut and set the context if the root selector is an ID
-		// (but not if it'll be faster if the inner selector is an ID)
-		if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
-				Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
-			ret = Sizzle.find( parts.shift(), context, contextXML );
-			context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0];
-		}
+		if (inst)
+			return inst.queryCommandValue(command);
 
-		if ( context ) {
-			ret = seed ?
-				{ expr: parts.pop(), set: makeArray(seed) } :
-				Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
-			set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set;
+		return false;
+	},
 
-			if ( parts.length > 0 ) {
-				checkSet = makeArray(set);
-			} else {
-				prune = false;
-			}
+	queryInstanceCommandState : function(editor_id, command) {
+		var inst = tinyMCE.getInstanceById(editor_id);
 
-			while ( parts.length ) {
-				cur = parts.pop();
-				pop = cur;
+		if (inst)
+			return inst.queryCommandState(command);
 
-				if ( !Expr.relative[ cur ] ) {
-					cur = "";
-				} else {
-					pop = parts.pop();
-				}
+		return null;
+	},
 
-				if ( pop == null ) {
-					pop = context;
-				}
+	setWindowArg : function(n, v) {
+		this.windowArgs[n] = v;
+	},
 
-				Expr.relative[ cur ]( checkSet, pop, contextXML );
-			}
-		} else {
-			checkSet = parts = [];
-		}
-	}
+	getWindowArg : function(n, d) {
+		return (typeof(this.windowArgs[n]) == "undefined") ? d : this.windowArgs[n];
+	},
 
-	if ( !checkSet ) {
-		checkSet = set;
-	}
+	getCSSClasses : function(editor_id, doc) {
+		var i, c, x, rule, styles, rules, csses, selectorText, inst = tinyMCE.getInstanceById(editor_id);
+		var cssClass, addClass, p;
 
-	if ( !checkSet ) {
-		Sizzle.error( cur || selector );
-	}
+		if (!inst)
+			inst = tinyMCE.selectedInstance;
 
-	if ( toString.call(checkSet) === "[object Array]" ) {
-		if ( !prune ) {
-			results.push.apply( results, checkSet );
-		} else if ( context && context.nodeType === 1 ) {
-			for ( i = 0; checkSet[i] != null; i++ ) {
-				if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
-					results.push( set[i] );
-				}
-			}
-		} else {
-			for ( i = 0; checkSet[i] != null; i++ ) {
-				if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
-					results.push( set[i] );
-				}
-			}
-		}
-	} else {
-		makeArray( checkSet, results );
-	}
+		if (!inst)
+			return [];
 
-	if ( extra ) {
-		Sizzle( extra, origContext, results, seed );
-		Sizzle.uniqueSort( results );
-	}
+		if (!doc)
+			doc = inst.getDoc();
 
-	return results;
-};
+		// Is cached, use that
+		if (inst && inst.cssClasses.length > 0)
+			return inst.cssClasses;
 
-Sizzle.uniqueSort = function(results){
-	if ( sortOrder ) {
-		hasDuplicate = baseHasDuplicate;
-		results.sort(sortOrder);
+		if (!doc)
+			return;
 
-		if ( hasDuplicate ) {
-			for ( var i = 1; i < results.length; i++ ) {
-				if ( results[i] === results[i-1] ) {
-					results.splice(i--, 1);
-				}
-			}
-		}
-	}
+		styles = doc.styleSheets;
 
-	return results;
-};
+		if (styles && styles.length > 0) {
+			for (x=0; x<styles.length; x++) {
+				csses = null;
 
-Sizzle.matches = function(expr, set){
-	return Sizzle(expr, null, null, set);
-};
-
-Sizzle.find = function(expr, context, isXML){
-	var set;
-
-	if ( !expr ) {
-		return [];
-	}
-
-	for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
-		var type = Expr.order[i], match;
-		
-		if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
-			var left = match[1];
-			match.splice(1,1);
-
-			if ( left.substr( left.length - 1 ) !== "\\" ) {
-				match[1] = (match[1] || "").replace(/\\/g, "");
-				set = Expr.find[ type ]( match, context, isXML );
-				if ( set != null ) {
-					expr = expr.replace( Expr.match[ type ], "" );
-					break;
+				try {
+					csses = tinyMCE.isIE ? doc.styleSheets(x).rules : styles[x].cssRules;
+				} catch(e) {
+					// Just ignore any errors I know this is ugly!!
 				}
-			}
-		}
-	}
+	
+				if (!csses)
+					return [];
 
-	if ( !set ) {
-		set = context.getElementsByTagName("*");
-	}
+				for (i=0; i<csses.length; i++) {
+					selectorText = csses[i].selectorText;
 
-	return {set: set, expr: expr};
-};
+					// Can be multiple rules per selector
+					if (selectorText) {
+						rules = selectorText.split(',');
+						for (c=0; c<rules.length; c++) {
+							rule = rules[c];
 
-Sizzle.filter = function(expr, set, inplace, not){
-	var old = expr, result = [], curLoop = set, match, anyFound,
-		isXMLFilter = set && set[0] && Sizzle.isXML(set[0]);
+							// Strip spaces between selectors
+							while (rule.indexOf(' ') == 0)
+								rule = rule.substring(1);
 
-	while ( expr && set.length ) {
-		for ( var type in Expr.filter ) {
-			if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
-				var filter = Expr.filter[ type ], found, item, left = match[1];
-				anyFound = false;
+							// Invalid rule
+							if (rule.indexOf(' ') != -1 || rule.indexOf(':') != -1 || rule.indexOf('mceItem') != -1)
+								continue;
 
-				match.splice(1,1);
+							if (rule.indexOf(tinyMCE.settings.visual_table_class) != -1 || rule.indexOf('mceEditable') != -1 || rule.indexOf('mceNonEditable') != -1)
+								continue;
 
-				if ( left.substr( left.length - 1 ) === "\\" ) {
-					continue;
-				}
+							// Is class rule
+							if (rule.indexOf('.') != -1) {
+								cssClass = rule.substring(rule.indexOf('.') + 1);
+								addClass = true;
 
-				if ( curLoop === result ) {
-					result = [];
-				}
-
-				if ( Expr.preFilter[ type ] ) {
-					match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
-
-					if ( !match ) {
-						anyFound = found = true;
-					} else if ( match === true ) {
-						continue;
-					}
-				}
-
-				if ( match ) {
-					for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
-						if ( item ) {
-							found = filter( item, match, i, curLoop );
-							var pass = not ^ !!found;
-
-							if ( inplace && found != null ) {
-								if ( pass ) {
-									anyFound = true;
-								} else {
-									curLoop[i] = false;
+								for (p=0; p<inst.cssClasses.length && addClass; p++) {
+									if (inst.cssClasses[p] == cssClass)
+										addClass = false;
 								}
-							} else if ( pass ) {
-								result.push( item );
-								anyFound = true;
+
+								if (addClass)
+									inst.cssClasses[inst.cssClasses.length] = cssClass;
 							}
 						}
 					}
 				}
+			}
+		}
 
-				if ( found !== undefined ) {
-					if ( !inplace ) {
-						curLoop = result;
-					}
+		return inst.cssClasses;
+	},
 
-					expr = expr.replace( Expr.match[ type ], "" );
+	regexpReplace : function(in_str, reg_exp, replace_str, opts) {
+		var re;
 
-					if ( !anyFound ) {
-						return [];
-					}
+		if (in_str == null)
+			return in_str;
 
-					break;
-				}
-			}
-		}
+		if (typeof(opts) == "undefined")
+			opts = 'g';
 
-		// Improper expression
-		if ( expr === old ) {
-			if ( anyFound == null ) {
-				Sizzle.error( expr );
-			} else {
-				break;
-			}
-		}
+		re = new RegExp(reg_exp, opts);
 
-		old = expr;
-	}
+		return in_str.replace(re, replace_str);
+	},
 
-	return curLoop;
-};
+	trim : function(s) {
+		return s.replace(/^\s*|\s*$/g, "");
+	},
 
-Sizzle.error = function( msg ) {
-	throw "Syntax error, unrecognized expression: " + msg;
-};
+	cleanupEventStr : function(s) {
+		s = "" + s;
+		s = s.replace('function anonymous()\n{\n', '');
+		s = s.replace('\n}', '');
+		s = s.replace(/^return true;/gi, ''); // Remove event blocker
 
-var Expr = Sizzle.selectors = {
-	order: [ "ID", "NAME", "TAG" ],
-	match: {
-		ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
-		CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
-		NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
-		ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
-		TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
-		CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,
-		POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
-		PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
+		return s;
 	},
-	leftMatch: {},
-	attrMap: {
-		"class": "className",
-		"for": "htmlFor"
-	},
-	attrHandle: {
-		href: function(elem){
-			return elem.getAttribute("href");
-		}
-	},
-	relative: {
-		"+": function(checkSet, part){
-			var isPartStr = typeof part === "string",
-				isTag = isPartStr && !/\W/.test(part),
-				isPartStrNotTag = isPartStr && !isTag;
 
-			if ( isTag ) {
-				part = part.toLowerCase();
-			}
+	getControlHTML : function(c) {
+		var i, l, n, o, v, rtl = tinyMCE.getLang('lang_dir') == 'rtl';
 
-			for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
-				if ( (elem = checkSet[i]) ) {
-					while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
+		l = tinyMCE.plugins;
+		for (n in l) {
+			o = l[n];
 
-					checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
-						elem || false :
-						elem === part;
-				}
-			}
+			if (o.getControlHTML && (v = o.getControlHTML(c)) !== '') {
+				if (rtl)
+					return '<span dir="rtl">' + tinyMCE.replaceVar(v, "pluginurl", o.baseURL) + '</span>';
 
-			if ( isPartStrNotTag ) {
-				Sizzle.filter( part, checkSet, true );
+				return tinyMCE.replaceVar(v, "pluginurl", o.baseURL);
 			}
-		},
-		">": function(checkSet, part){
-			var isPartStr = typeof part === "string",
-				elem, i = 0, l = checkSet.length;
+		}
 
-			if ( isPartStr && !/\W/.test(part) ) {
-				part = part.toLowerCase();
+		o = tinyMCE.themes[tinyMCE.settings.theme];
+		if (o.getControlHTML && (v = o.getControlHTML(c)) !== '') {
+			if (rtl)
+				return '<span dir="rtl">' + v + '</span>';
 
-				for ( ; i < l; i++ ) {
-					elem = checkSet[i];
-					if ( elem ) {
-						var parent = elem.parentNode;
-						checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
-					}
-				}
-			} else {
-				for ( ; i < l; i++ ) {
-					elem = checkSet[i];
-					if ( elem ) {
-						checkSet[i] = isPartStr ?
-							elem.parentNode :
-							elem.parentNode === part;
-					}
-				}
+			return v;
+		}
 
-				if ( isPartStr ) {
-					Sizzle.filter( part, checkSet, true );
-				}
-			}
-		},
-		"": function(checkSet, part, isXML){
-			var doneName = done++, checkFn = dirCheck, nodeCheck;
+		return '';
+	},
 
-			if ( typeof part === "string" && !/\W/.test(part) ) {
-				part = part.toLowerCase();
-				nodeCheck = part;
-				checkFn = dirNodeCheck;
-			}
+	evalFunc : function(f, idx, a, o) {
+		o = !o ? window : o;
+		f = typeof(f) == 'function' ? f : o[f];
 
-			checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
-		},
-		"~": function(checkSet, part, isXML){
-			var doneName = done++, checkFn = dirCheck, nodeCheck;
+		return f.apply(o, Array.prototype.slice.call(a, idx));
+	},
 
-			if ( typeof part === "string" && !/\W/.test(part) ) {
-				part = part.toLowerCase();
-				nodeCheck = part;
-				checkFn = dirNodeCheck;
-			}
+	dispatchCallback : function(i, p, n) {
+		return this.callFunc(i, p, n, 0, this.dispatchCallback.arguments);
+	},
 
-			checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
-		}
+	executeCallback : function(i, p, n) {
+		return this.callFunc(i, p, n, 1, this.executeCallback.arguments);
 	},
-	find: {
-		ID: function(match, context, isXML){
-			if ( typeof context.getElementById !== "undefined" && !isXML ) {
-				var m = context.getElementById(match[1]);
-				return m ? [m] : [];
-			}
-		},
-		NAME: function(match, context){
-			if ( typeof context.getElementsByName !== "undefined" ) {
-				var ret = [], results = context.getElementsByName(match[1]);
 
-				for ( var i = 0, l = results.length; i < l; i++ ) {
-					if ( results[i].getAttribute("name") === match[1] ) {
-						ret.push( results[i] );
-					}
-				}
-
-				return ret.length === 0 ? null : ret;
-			}
-		},
-		TAG: function(match, context){
-			return context.getElementsByTagName(match[1]);
-		}
+	execCommandCallback : function(i, p, n) {
+		return this.callFunc(i, p, n, 2, this.execCommandCallback.arguments);
 	},
-	preFilter: {
-		CLASS: function(match, curLoop, inplace, result, not, isXML){
-			match = " " + match[1].replace(/\\/g, "") + " ";
 
-			if ( isXML ) {
-				return match;
-			}
+	callFunc : function(ins, p, n, m, a) {
+		var l, i, on, o, s, v;
 
-			for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
-				if ( elem ) {
-					if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) {
-						if ( !inplace ) {
-							result.push( elem );
-						}
-					} else if ( inplace ) {
-						curLoop[i] = false;
-					}
-				}
-			}
+		s = m == 2;
 
-			return false;
-		},
-		ID: function(match){
-			return match[1].replace(/\\/g, "");
-		},
-		TAG: function(match, curLoop){
-			return match[1].toLowerCase();
-		},
-		CHILD: function(match){
-			if ( match[1] === "nth" ) {
-				// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
-				var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
-					match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
-					!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
+		l = tinyMCE.getParam(p, '');
 
-				// calculate the numbers (first)n+(last) including if they are negative
-				match[2] = (test[1] + (test[2] || 1)) - 0;
-				match[3] = test[3] - 0;
-			}
+		if (l !== '' && (v = tinyMCE.evalFunc(l, 3, a)) == s && m > 0)
+			return true;
 
-			// TODO: Move to normal caching system
-			match[0] = done++;
+		if (ins != null) {
+			for (i=0, l = ins.plugins; i<l.length; i++) {
+				o = tinyMCE.plugins[l[i]];
 
-			return match;
-		},
-		ATTR: function(match, curLoop, inplace, result, not, isXML){
-			var name = match[1].replace(/\\/g, "");
-			
-			if ( !isXML && Expr.attrMap[name] ) {
-				match[1] = Expr.attrMap[name];
+				if (o[n] && (v = tinyMCE.evalFunc(n, 3, a, o)) == s && m > 0)
+					return true;
 			}
+		}
 
-			if ( match[2] === "~=" ) {
-				match[4] = " " + match[4] + " ";
-			}
+		l = tinyMCE.themes;
+		for (on in l) {
+			o = l[on];
 
-			return match;
-		},
-		PSEUDO: function(match, curLoop, inplace, result, not){
-			if ( match[1] === "not" ) {
-				// If we're dealing with a complex expression, or a simple one
-				if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
-					match[3] = Sizzle(match[3], null, null, curLoop);
-				} else {
-					var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
-					if ( !inplace ) {
-						result.push.apply( result, ret );
-					}
-					return false;
-				}
-			} else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
+			if (o[n] && (v = tinyMCE.evalFunc(n, 3, a, o)) == s && m > 0)
 				return true;
-			}
-			
-			return match;
-		},
-		POS: function(match){
-			match.unshift( true );
-			return match;
 		}
+
+		return false;
 	},
-	filters: {
-		enabled: function(elem){
-			return elem.disabled === false && elem.type !== "hidden";
-		},
-		disabled: function(elem){
-			return elem.disabled === true;
-		},
-		checked: function(elem){
-			return elem.checked === true;
-		},
-		selected: function(elem){
-			// Accessing this property makes selected-by-default
-			// options in Safari work properly
-			elem.parentNode.selectedIndex;
-			return elem.selected === true;
-		},
-		parent: function(elem){
-			return !!elem.firstChild;
-		},
-		empty: function(elem){
-			return !elem.firstChild;
-		},
-		has: function(elem, i, match){
-			return !!Sizzle( match[3], elem ).length;
-		},
-		header: function(elem){
-			return (/h\d/i).test( elem.nodeName );
-		},
-		text: function(elem){
-			return "text" === elem.type;
-		},
-		radio: function(elem){
-			return "radio" === elem.type;
-		},
-		checkbox: function(elem){
-			return "checkbox" === elem.type;
-		},
-		file: function(elem){
-			return "file" === elem.type;
-		},
-		password: function(elem){
-			return "password" === elem.type;
-		},
-		submit: function(elem){
-			return "submit" === elem.type;
-		},
-		image: function(elem){
-			return "image" === elem.type;
-		},
-		reset: function(elem){
-			return "reset" === elem.type;
-		},
-		button: function(elem){
-			return "button" === elem.type || elem.nodeName.toLowerCase() === "button";
-		},
-		input: function(elem){
-			return (/input|select|textarea|button/i).test(elem.nodeName);
-		}
-	},
-	setFilters: {
-		first: function(elem, i){
-			return i === 0;
-		},
-		last: function(elem, i, match, array){
-			return i === array.length - 1;
-		},
-		even: function(elem, i){
-			return i % 2 === 0;
-		},
-		odd: function(elem, i){
-			return i % 2 === 1;
-		},
-		lt: function(elem, i, match){
-			return i < match[3] - 0;
-		},
-		gt: function(elem, i, match){
-			return i > match[3] - 0;
-		},
-		nth: function(elem, i, match){
-			return match[3] - 0 === i;
-		},
-		eq: function(elem, i, match){
-			return match[3] - 0 === i;
-		}
-	},
-	filter: {
-		PSEUDO: function(elem, match, i, array){
-			var name = match[1], filter = Expr.filters[ name ];
 
-			if ( filter ) {
-				return filter( elem, i, match, array );
-			} else if ( name === "contains" ) {
-				return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0;
-			} else if ( name === "not" ) {
-				var not = match[3];
+	resolveDots : function(s, o) {
+		var i;
 
-				for ( var j = 0, l = not.length; j < l; j++ ) {
-					if ( not[j] === elem ) {
-						return false;
-					}
-				}
+		if (typeof(s) == 'string') {
+			for (i=0, s=s.split('.'); i<s.length; i++)
+				o = o[s[i]];
+		} else
+			o = s;
 
-				return true;
-			} else {
-				Sizzle.error( "Syntax error, unrecognized expression: " + name );
-			}
-		},
-		CHILD: function(elem, match){
-			var type = match[1], node = elem;
-			switch (type) {
-				case 'only':
-				case 'first':
-					while ( (node = node.previousSibling) )	 {
-						if ( node.nodeType === 1 ) { 
-							return false; 
-						}
-					}
-					if ( type === "first" ) { 
-						return true; 
-					}
-					node = elem;
-				case 'last':
-					while ( (node = node.nextSibling) )	 {
-						if ( node.nodeType === 1 ) { 
-							return false; 
-						}
-					}
-					return true;
-				case 'nth':
-					var first = match[2], last = match[3];
+		return o;
+	},
 
-					if ( first === 1 && last === 0 ) {
-						return true;
-					}
-					
-					var doneName = match[0],
-						parent = elem.parentNode;
-	
-					if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
-						var count = 0;
-						for ( node = parent.firstChild; node; node = node.nextSibling ) {
-							if ( node.nodeType === 1 ) {
-								node.nodeIndex = ++count;
-							}
-						} 
-						parent.sizcache = doneName;
-					}
-					
-					var diff = elem.nodeIndex - last;
-					if ( first === 0 ) {
-						return diff === 0;
-					} else {
-						return ( diff % first === 0 && diff / first >= 0 );
-					}
-			}
-		},
-		ID: function(elem, match){
-			return elem.nodeType === 1 && elem.getAttribute("id") === match;
-		},
-		TAG: function(elem, match){
-			return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;
-		},
-		CLASS: function(elem, match){
-			return (" " + (elem.className || elem.getAttribute("class")) + " ")
-				.indexOf( match ) > -1;
-		},
-		ATTR: function(elem, match){
-			var name = match[1],
-				result = Expr.attrHandle[ name ] ?
-					Expr.attrHandle[ name ]( elem ) :
-					elem[ name ] != null ?
-						elem[ name ] :
-						elem.getAttribute( name ),
-				value = result + "",
-				type = match[2],
-				check = match[4];
+	xmlEncode : function(s) {
+		return s ? ('' + s).replace(this.xmlEncodeRe, function (c, b) {
+			switch (c) {
+				case '&':
+					return '&';
 
-			return result == null ?
-				type === "!=" :
-				type === "=" ?
-				value === check :
-				type === "*=" ?
-				value.indexOf(check) >= 0 :
-				type === "~=" ?
-				(" " + value + " ").indexOf(check) >= 0 :
-				!check ?
-				value && result !== false :
-				type === "!=" ?
-				value !== check :
-				type === "^=" ?
-				value.indexOf(check) === 0 :
-				type === "$=" ?
-				value.substr(value.length - check.length) === check :
-				type === "|=" ?
-				value === check || value.substr(0, check.length + 1) === check + "-" :
-				false;
-		},
-		POS: function(elem, match, i, array){
-			var name = match[2], filter = Expr.setFilters[ name ];
+				case '"':
+					return '"';
 
-			if ( filter ) {
-				return filter( elem, i, match, array );
+				case '<':
+					return '<';
+
+				case '>':
+					return '>';
 			}
-		}
-	}
-};
 
-var origPOS = Expr.match.POS,
-	fescape = function(all, num){
-		return "\\" + (num - 0 + 1);
-	};
+			return c;
+		}) : s;
+	},
 
-for ( var type in Expr.match ) {
-	Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
-	Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
-}
+	add : function(c, m) {
+		var n;
 
-var makeArray = function(array, results) {
-	array = Array.prototype.slice.call( array, 0 );
+		for (n in m) {
+			if (m.hasOwnProperty(n))
+				c.prototype[n] = m[n];
+		}
+	},
 
-	if ( results ) {
-		results.push.apply( results, array );
-		return results;
-	}
-	
-	return array;
-};
+	extend : function(p, np) {
+		var o = {}, n;
 
-// Perform a simple check to determine if the browser is capable of
-// converting a NodeList to an array using builtin methods.
-// Also verifies that the returned array holds DOM nodes
-// (which is not the case in the Blackberry browser)
-try {
-	Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
+		o.parent = p;
 
-// Provide a fallback method if it does not work
-} catch(e){
-	makeArray = function(array, results) {
-		var ret = results || [], i = 0;
+		for (n in p) {
+			if (p.hasOwnProperty(n))
+				o[n] = p[n];
+		}
 
-		if ( toString.call(array) === "[object Array]" ) {
-			Array.prototype.push.apply( ret, array );
-		} else {
-			if ( typeof array.length === "number" ) {
-				for ( var l = array.length; i < l; i++ ) {
-					ret.push( array[i] );
-				}
-			} else {
-				for ( ; array[i]; i++ ) {
-					ret.push( array[i] );
-				}
-			}
+		for (n in np) {
+			if (np.hasOwnProperty(n))
+				o[n] = np[n];
 		}
 
-		return ret;
-	};
-}
+		return o;
+	},
 
-var sortOrder;
+	hideMenus : function() {
+		var e = tinyMCE.lastSelectedMenuBtn;
 
-if ( document.documentElement.compareDocumentPosition ) {
-	sortOrder = function( a, b ) {
-		if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
-			if ( a == b ) {
-				hasDuplicate = true;
-			}
-			return a.compareDocumentPosition ? -1 : 1;
+		if (tinyMCE.lastMenu) {
+			tinyMCE.lastMenu.hide();
+			tinyMCE.lastMenu = null;
 		}
 
-		var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
-		if ( ret === 0 ) {
-			hasDuplicate = true;
+		if (e) {
+			tinyMCE.switchClass(e, tinyMCE.lastMenuBtnClass);
+			tinyMCE.lastSelectedMenuBtn = null;
 		}
-		return ret;
-	};
-} else if ( "sourceIndex" in document.documentElement ) {
-	sortOrder = function( a, b ) {
-		if ( !a.sourceIndex || !b.sourceIndex ) {
-			if ( a == b ) {
-				hasDuplicate = true;
-			}
-			return a.sourceIndex ? -1 : 1;
-		}
+	}
 
-		var ret = a.sourceIndex - b.sourceIndex;
-		if ( ret === 0 ) {
-			hasDuplicate = true;
-		}
-		return ret;
 	};
-} else if ( document.createRange ) {
-	sortOrder = function( a, b ) {
-		if ( !a.ownerDocument || !b.ownerDocument ) {
-			if ( a == b ) {
-				hasDuplicate = true;
-			}
-			return a.ownerDocument ? -1 : 1;
-		}
 
-		var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
-		aRange.setStart(a, 0);
-		aRange.setEnd(a, 0);
-		bRange.setStart(b, 0);
-		bRange.setEnd(b, 0);
-		var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
-		if ( ret === 0 ) {
-			hasDuplicate = true;
-		}
-		return ret;
-	};
-}
+// Global instances
+var TinyMCE = TinyMCE_Engine; // Compatiblity with gzip compressors
+var tinyMCE = new TinyMCE_Engine();
+var tinyMCELang = {};
 
-// Utility function for retreiving the text value of an array of DOM nodes
-Sizzle.getText = function( elems ) {
-	var ret = "", elem;
+/* file:jscripts/tiny_mce/classes/TinyMCE_Control.class.js */
 
-	for ( var i = 0; elems[i]; i++ ) {
-		elem = elems[i];
+function TinyMCE_Control(settings) {
+	var t, i, tos, fu, p, x, fn, fu, pn, s = settings;
 
-		// Get the text from text nodes and CDATA nodes
-		if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
-			ret += elem.nodeValue;
+	this.undoRedoLevel = true;
+	this.isTinyMCE_Control = true;
 
-		// Traverse everything else, except comment nodes
-		} else if ( elem.nodeType !== 8 ) {
-			ret += Sizzle.getText( elem.childNodes );
-		}
-	}
+	// Default settings
+	this.enabled = true;
+	this.settings = s;
+	this.settings.theme = tinyMCE.getParam("theme", "default");
+	this.settings.width = tinyMCE.getParam("width", -1);
+	this.settings.height = tinyMCE.getParam("height", -1);
+	this.selection = new TinyMCE_Selection(this);
+	this.undoRedo = new TinyMCE_UndoRedo(this);
+	this.cleanup = new TinyMCE_Cleanup();
+	this.shortcuts = [];
+	this.hasMouseMoved = false;
+	this.foreColor = this.backColor = "#999999";
+	this.data = {};
+	this.cssClasses = [];
 
-	return ret;
-};
+	this.cleanup.init({
+		valid_elements : s.valid_elements,
+		extended_valid_elements : s.extended_valid_elements,
+		valid_child_elements : s.valid_child_elements,
+		entities : s.entities,
+		entity_encoding : s.entity_encoding,
+		debug : s.cleanup_debug,
+		indent : s.apply_source_formatting,
+		invalid_elements : s.invalid_elements,
+		verify_html : s.verify_html,
+		fix_content_duplication : s.fix_content_duplication,
+		convert_fonts_to_spans : s.convert_fonts_to_spans
+	});
 
-// Check to see if the browser returns elements by name when
-// querying by getElementById (and provide a workaround)
-(function(){
-	// We're going to inject a fake input element with a specified name
-	var form = document.createElement("div"),
-		id = "script" + (new Date()).getTime();
-	form.innerHTML = "<a name='" + id + "'/>";
+	// Wrap old theme
+	t = this.settings.theme;
+	if (!tinyMCE.hasTheme(t)) {
+		fn = tinyMCE.callbacks;
+		tos = {};
 
-	// Inject it into the root element, check its status, and remove it quickly
-	var root = document.documentElement;
-	root.insertBefore( form, root.firstChild );
+		for (i=0; i<fn.length; i++) {
+			if ((fu = window['TinyMCE_' + t + "_" + fn[i]]))
+				tos[fn[i]] = fu;
+		}
 
-	// The workaround has to do additional checks after a getElementById
-	// Which slows things down for other browsers (hence the branching)
-	if ( document.getElementById( id ) ) {
-		Expr.find.ID = function(match, context, isXML){
-			if ( typeof context.getElementById !== "undefined" && !isXML ) {
-				var m = context.getElementById(match[1]);
-				return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
-			}
-		};
-
-		Expr.filter.ID = function(elem, match){
-			var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
-			return elem.nodeType === 1 && node && node.nodeValue === match;
-		};
+		tinyMCE.addTheme(t, tos);
 	}
 
-	root.removeChild( form );
-	root = form = null; // release memory in IE
-})();
+	// Wrap old plugins
+	this.plugins = [];
+	p = tinyMCE.getParam('plugins', '', true, ',');
+	if (p.length > 0) {
+		for (i=0; i<p.length; i++) {
+			pn = p[i];
 
-(function(){
-	// Check to see if the browser returns only elements
-	// when doing getElementsByTagName("*")
+			if (pn.charAt(0) == '-')
+				pn = pn.substring(1);
 
-	// Create a fake element
-	var div = document.createElement("div");
-	div.appendChild( document.createComment("") );
+			if (!tinyMCE.hasPlugin(pn)) {
+				fn = tinyMCE.callbacks;
+				tos = {};
 
-	// Make sure no comments are found
-	if ( div.getElementsByTagName("*").length > 0 ) {
-		Expr.find.TAG = function(match, context){
-			var results = context.getElementsByTagName(match[1]);
-
-			// Filter out possible comments
-			if ( match[1] === "*" ) {
-				var tmp = [];
-
-				for ( var i = 0; results[i]; i++ ) {
-					if ( results[i].nodeType === 1 ) {
-						tmp.push( results[i] );
-					}
+				for (x=0; x<fn.length; x++) {
+					if ((fu = window['TinyMCE_' + pn + "_" + fn[x]]))
+						tos[fn[x]] = fu;
 				}
 
-				results = tmp;
+				tinyMCE.addPlugin(pn, tos);
 			}
 
-			return results;
-		};
+			this.plugins[this.plugins.length] = pn; 
+		}
 	}
+};
 
-	// Check to see if an attribute returns normalized href attributes
-	div.innerHTML = "<a href='#'></a>";
-	if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
-			div.firstChild.getAttribute("href") !== "#" ) {
-		Expr.attrHandle.href = function(elem){
-			return elem.getAttribute("href", 2);
-		};
-	}
+TinyMCE_Control.prototype = {
+	selection : null,
 
-	div = null; // release memory in IE
-})();
+	settings : null,
 
-if ( document.querySelectorAll ) {
-	(function(){
-		var oldSizzle = Sizzle, div = document.createElement("div");
-		div.innerHTML = "<p class='TEST'></p>";
+	cleanup : null,
 
-		// Safari can't handle uppercase or unicode characters when
-		// in quirks mode.
-		if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
-			return;
-		}
-	
-		Sizzle = function(query, context, extra, seed){
-			context = context || document;
+	getData : function(na) {
+		var o = this.data[na];
 
-			// Only use querySelectorAll on non-XML documents
-			// (ID selectors don't work in non-HTML documents)
-			if ( !seed && context.nodeType === 9 && !Sizzle.isXML(context) ) {
-				try {
-					return makeArray( context.querySelectorAll(query), extra );
-				} catch(e){}
-			}
-		
-			return oldSizzle(query, context, extra, seed);
-		};
+		if (!o)
+			o = this.data[na] = {};
 
-		for ( var prop in oldSizzle ) {
-			Sizzle[ prop ] = oldSizzle[ prop ];
-		}
+		return o;
+	},
 
-		div = null; // release memory in IE
-	})();
-}
+	hasPlugin : function(n) {
+		var i;
 
-(function(){
-	var div = document.createElement("div");
+		for (i=0; i<this.plugins.length; i++) {
+			if (this.plugins[i] == n)
+				return true;
+		}
 
-	div.innerHTML = "<div class='test e'></div><div class='test'></div>";
+		return false;
+	},
 
-	// Opera can't find a second classname (in 9.6)
-	// Also, make sure that getElementsByClassName actually exists
-	if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
-		return;
-	}
-
-	// Safari caches class attributes, doesn't catch changes (in 3.2)
-	div.lastChild.className = "e";
-
-	if ( div.getElementsByClassName("e").length === 1 ) {
-		return;
-	}
-	
-	Expr.order.splice(1, 0, "CLASS");
-	Expr.find.CLASS = function(match, context, isXML) {
-		if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
-			return context.getElementsByClassName(match[1]);
+	addPlugin : function(n, p) {
+		if (!this.hasPlugin(n)) {
+			tinyMCE.addPlugin(n, p);
+			this.plugins[this.plugins.length] = n;
 		}
-	};
+	},
 
-	div = null; // release memory in IE
-})();
+	repaint : function() {
+		var s, b, ex;
 
-function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
-	for ( var i = 0, l = checkSet.length; i < l; i++ ) {
-		var elem = checkSet[i];
-		if ( elem ) {
-			elem = elem[dir];
-			var match = false;
+		if (tinyMCE.isRealIE)
+			return;
 
-			while ( elem ) {
-				if ( elem.sizcache === doneName ) {
-					match = checkSet[elem.sizset];
-					break;
-				}
+		try {
+			s = this.selection;
+			b = s.getBookmark(true);
+			this.getBody().style.display = 'none';
+			this.getDoc().execCommand('selectall', false, null);
+			this.getSel().collapseToStart();
+			this.getBody().style.display = 'block';
+			s.moveToBookmark(b);
+		} catch (ex) {
+			// Ignore
+		}
+	},
 
-				if ( elem.nodeType === 1 && !isXML ){
-					elem.sizcache = doneName;
-					elem.sizset = i;
-				}
+	switchSettings : function() {
+		if (tinyMCE.configs.length > 1 && tinyMCE.currentConfig != this.settings.index) {
+			tinyMCE.settings = this.settings;
+			tinyMCE.currentConfig = this.settings.index;
+		}
+	},
 
-				if ( elem.nodeName.toLowerCase() === cur ) {
-					match = elem;
-					break;
-				}
+	select : function() {
+		var oldInst = tinyMCE.selectedInstance;
 
-				elem = elem[dir];
-			}
+		if (oldInst != this) {
+			if (oldInst)
+				oldInst.execCommand('mceEndTyping');
 
-			checkSet[i] = match;
+			tinyMCE.dispatchCallback(this, 'select_instance_callback', 'selectInstance', this, oldInst);
+			tinyMCE.selectedInstance = this;
 		}
-	}
-}
+	},
 
-function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
-	for ( var i = 0, l = checkSet.length; i < l; i++ ) {
-		var elem = checkSet[i];
-		if ( elem ) {
-			elem = elem[dir];
-			var match = false;
+	getBody : function() {
+		return this.contentBody ? this.contentBody : this.getDoc().body;
+	},
 
-			while ( elem ) {
-				if ( elem.sizcache === doneName ) {
-					match = checkSet[elem.sizset];
-					break;
-				}
+	getDoc : function() {
+//		return this.contentDocument ? this.contentDocument : this.contentWindow.document; // Removed due to IE 5.5 ?
+		return this.contentWindow.document;
+	},
 
-				if ( elem.nodeType === 1 ) {
-					if ( !isXML ) {
-						elem.sizcache = doneName;
-						elem.sizset = i;
-					}
-					if ( typeof cur !== "string" ) {
-						if ( elem === cur ) {
-							match = true;
-							break;
-						}
+	getWin : function() {
+		return this.contentWindow;
+	},
 
-					} else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
-						match = elem;
-						break;
-					}
-				}
+	getContainerWin : function() {
+		return this.containerWindow ? this.containerWindow : window;
+	},
 
-				elem = elem[dir];
-			}
+	getViewPort : function() {
+		return tinyMCE.getViewPort(this.getWin());
+	},
 
-			checkSet[i] = match;
-		}
-	}
-}
+	getParentNode : function(n, f) {
+		return tinyMCE.getParentNode(n, f, this.getBody());
+	},
 
-Sizzle.contains = document.compareDocumentPosition ? function(a, b){
-	return !!(a.compareDocumentPosition(b) & 16);
-} : function(a, b){
-	return a !== b && (a.contains ? a.contains(b) : true);
-};
+	getParentElement : function(n, na, f) {
+		return tinyMCE.getParentElement(n, na, f, this.getBody());
+	},
 
-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 : 0).documentElement;
-	return documentElement ? documentElement.nodeName !== "HTML" : false;
-};
+	getParentBlockElement : function(n) {
+		return tinyMCE.getParentBlockElement(n, this.getBody());
+	},
 
-var posProcess = function(selector, context){
-	var tmpSet = [], later = "", match,
-		root = context.nodeType ? [context] : context;
+	resizeToContent : function() {
+		var d = this.getDoc(), b = d.body, de = d.documentElement;
 
-	// Position selectors must be done after the filter
-	// And so must :not(positional) so we move all PSEUDOs to the end
-	while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
-		later += match[0];
-		selector = selector.replace( Expr.match.PSEUDO, "" );
-	}
+		this.iframeElement.style.height = (tinyMCE.isRealIE) ? b.scrollHeight : de.offsetHeight + 'px';
+	},
 
-	selector = Expr.relative[selector] ? selector + "*" : selector;
+	addShortcut : function(m, k, d, cmd, ui, va) {
+		var n = typeof(k) == "number", ie = tinyMCE.isIE, c, sc, i, scl = this.shortcuts;
 
-	for ( var i = 0, l = root.length; i < l; i++ ) {
-		Sizzle( selector, root[i], tmpSet );
-	}
+		if (!tinyMCE.getParam('custom_shortcuts'))
+			return false;
 
-	return Sizzle.filter( later, tmpSet );
-};
+		m = m.toLowerCase();
+		k = ie && !n ? k.toUpperCase() : k;
+		c = n ? null : k.charCodeAt(0);
+		d = d && d.indexOf('lang_') == 0 ? tinyMCE.getLang(d) : d;
 
-// EXPOSE
+		sc = {
+			alt : m.indexOf('alt') != -1,
+			ctrl : m.indexOf('ctrl') != -1,
+			shift : m.indexOf('shift') != -1,
+			charCode : c,
+			keyCode : n ? k : (ie ? c : null),
+			desc : d,
+			cmd : cmd,
+			ui : ui,
+			val : va
+		};
 
-window.tinymce.dom.Sizzle = Sizzle;
+		for (i=0; i<scl.length; i++) {
+			if (sc.alt == scl[i].alt && sc.ctrl == scl[i].ctrl && sc.shift == scl[i].shift
+				&& sc.charCode == scl[i].charCode && sc.keyCode == scl[i].keyCode) {
+				return false;
+			}
+		}
 
-})();
+		scl[scl.length] = sc;
 
+		return true;
+	},
 
-(function(tinymce) {
-	// Shorten names
-	var each = tinymce.each, DOM = tinymce.DOM, isIE = tinymce.isIE, isWebKit = tinymce.isWebKit, Event;
+	handleShortcut : function(e) {
+		var i, s, o;
 
-	tinymce.create('tinymce.dom.EventUtils', {
-		EventUtils : function() {
-			this.inits = [];
-			this.events = [];
-		},
+		// Normal key press, then ignore it
+		if (!e.altKey && !e.ctrlKey)
+			return false;
 
-		add : function(o, n, f, s) {
-			var cb, t = this, el = t.events, r;
+		s = this.shortcuts;
 
-			if (n instanceof Array) {
-				r = [];
+		for (i=0; i<s.length; i++) {
+			o = s[i];
 
-				each(n, function(n) {
-					r.push(t.add(o, n, f, s));
-				});
+			if (o.alt == e.altKey && o.ctrl == e.ctrlKey && (o.keyCode == e.keyCode || o.charCode == e.charCode)) {
+				if (o.cmd && (e.type == "keydown" || (e.type == "keypress" && !tinyMCE.isOpera)))
+					tinyMCE.execCommand(o.cmd, o.ui, o.val);
 
-				return r;
+				tinyMCE.cancelEvent(e);
+				return true;
 			}
+		}
 
-			// Handle array
-			if (o && o.hasOwnProperty && o instanceof Array) {
-				r = [];
+		return false;
+	},
 
-				each(o, function(o) {
-					o = DOM.get(o);
-					r.push(t.add(o, n, f, s));
-				});
+	autoResetDesignMode : function() {
+		// Add fix for tab/style.display none/block problems in Gecko
+		if (!tinyMCE.isIE && this.isHidden() && tinyMCE.getParam('auto_reset_designmode'))
+			eval('try { this.getDoc().designMode = "On"; this.useCSS = false; } catch(e) {}');
+	},
 
-				return r;
-			}
+	isHidden : function() {
+		var s;
 
-			o = DOM.get(o);
+		if (tinyMCE.isIE)
+			return false;
 
-			if (!o)
-				return;
+		s = this.getSel();
 
-			// Setup event callback
-			cb = function(e) {
-				// Is all events disabled
-				if (t.disabled)
-					return;
+		// Weird, wheres that cursor selection?
+		return (!s || !s.rangeCount || s.rangeCount == 0);
+	},
 
-				e = e || window.event;
+	isDirty : function() {
+		// Is content modified and not in a submit procedure
+		return tinyMCE.trim(this.startContent) != tinyMCE.trim(this.getBody().innerHTML) && !this.isNotDirty;
+	},
 
-				// Patch in target, preventDefault and stopPropagation in IE it's W3C valid
-				if (e && isIE) {
-					if (!e.target)
-						e.target = e.srcElement;
+	_mergeElements : function(scmd, pa, ch, override) {
+		var st, stc, className, n;
 
-					// Patch in preventDefault, stopPropagation methods for W3C compatibility
-					tinymce.extend(e, t._stoppers);
-				}
+		if (scmd == "removeformat") {
+			pa.className = "";
+			pa.style.cssText = "";
+			ch.className = "";
+			ch.style.cssText = "";
+			return;
+		}
 
-				if (!s)
-					return f(e);
+		st = tinyMCE.parseStyle(tinyMCE.getAttrib(pa, "style"));
+		stc = tinyMCE.parseStyle(tinyMCE.getAttrib(ch, "style"));
+		className = tinyMCE.getAttrib(pa, "class");
 
-				return f.call(s, e);
-			};
+		// Removed class adding due to bug #1478272
+		className = tinyMCE.getAttrib(ch, "class");
 
-			if (n == 'unload') {
-				tinymce.unloads.unshift({func : cb});
-				return cb;
+		if (override) {
+			for (n in st) {
+				if (typeof(st[n]) == 'function')
+					continue;
+
+				stc[n] = st[n];
 			}
+		} else {
+			for (n in stc) {
+				if (typeof(stc[n]) == 'function')
+					continue;
 
-			if (n == 'init') {
-				if (t.domLoaded)
-					cb();
-				else
-					t.inits.push(cb);
-
-				return cb;
+				st[n] = stc[n];
 			}
+		}
 
-			// Store away listener reference
-			el.push({
-				obj : o,
-				name : n,
-				func : f,
-				cfunc : cb,
-				scope : s
-			});
+		tinyMCE.setAttrib(pa, "style", tinyMCE.serializeStyle(st));
+		tinyMCE.setAttrib(pa, "class", tinyMCE.trim(className));
+		ch.className = "";
+		ch.style.cssText = "";
+		ch.removeAttribute("class");
+		ch.removeAttribute("style");
+	},
 
-			t._add(o, n, cb);
+	_fixRootBlocks : function() {
+		var rb, b, ne, be, nx, bm;
 
-			return f;
-		},
+		rb = tinyMCE.getParam('forced_root_block');
+		if (!rb)
+			return;
 
-		remove : function(o, n, f) {
-			var t = this, a = t.events, s = false, r;
+		b = this.getBody();
+		ne = b.firstChild;
 
-			// Handle array
-			if (o && o.hasOwnProperty && o instanceof Array) {
-				r = [];
+		while (ne) {
+			nx = ne.nextSibling;
 
-				each(o, function(o) {
-					o = DOM.get(o);
-					r.push(t.remove(o, n, f));
-				});
+			// If text node or inline element wrap it in a block element
+			if ((ne.nodeType == 3 && ne.nodeValue.replace(/\s+/g, '') != '') || (ne.nodeType == 1 && !tinyMCE.blockRegExp.test(ne.nodeName))) {
+				if (!bm)
+					bm = this.selection.getBookmark();
 
-				return r;
-			}
-
-			o = DOM.get(o);
-
-			each(a, function(e, i) {
-				if (e.obj == o && e.name == n && (!f || (e.func == f || e.cfunc == f))) {
-					a.splice(i, 1);
-					t._remove(o, n, e.cfunc);
-					s = true;
-					return false;
+				if (!be) {
+					be = this.getDoc().createElement(rb);
+					be.appendChild(ne.cloneNode(true));
+					b.replaceChild(be, ne);
+				} else {
+					be.appendChild(ne.cloneNode(true));
+					b.removeChild(ne);
 				}
-			});
+			} else
+				be = null;
 
-			return s;
-		},
+			ne = nx;
+		}
 
-		clear : function(o) {
-			var t = this, a = t.events, i, e;
+		if (bm)
+			this.selection.moveToBookmark(bm);
+	},
 
-			if (o) {
-				o = DOM.get(o);
+	_fixTrailingNbsp : function() {
+		var s = this.selection, e = s.getFocusElement(), bm, v;
 
-				for (i = a.length - 1; i >= 0; i--) {
-					e = a[i];
+		if (e && tinyMCE.blockRegExp.test(e.nodeName) && e.firstChild) {
+			v = e.firstChild.nodeValue;
 
-					if (e.obj === o) {
-						t._remove(e.obj, e.name, e.cfunc);
-						e.obj = e.cfunc = null;
-						a.splice(i, 1);
-					}
-				}
+			if (v && v.length > 1 && /(^\u00a0|\u00a0$)/.test(v)) {
+				e.firstChild.nodeValue = v.replace(/(^\u00a0|\u00a0$)/, '');
+				s.selectNode(e.firstChild, true, false, false); // Select and collapse
 			}
-		},
+		}
+	},
 
-		cancel : function(e) {
-			if (!e)
-				return false;
+	_setUseCSS : function(b) {
+		var d = this.getDoc();
 
-			this.stop(e);
+		try {d.execCommand("useCSS", false, !b);} catch (ex) {}
+		try {d.execCommand("styleWithCSS", false, b);} catch (ex) {}
 
-			return this.prevent(e);
-		},
+		if (!tinyMCE.getParam("table_inline_editing"))
+			try {d.execCommand('enableInlineTableEditing', false, "false");} catch (ex) {}
 
-		stop : function(e) {
-			if (e.stopPropagation)
-				e.stopPropagation();
-			else
-				e.cancelBubble = true;
+		if (!tinyMCE.getParam("object_resizing"))
+			try {d.execCommand('enableObjectResizing', false, "false");} catch (ex) {}
+	},
 
-			return false;
-		},
+	execCommand : function(command, user_interface, value) {
+		var i, x, z, align, img, div, doc = this.getDoc(), win = this.getWin(), focusElm = this.getFocusElement();
 
-		prevent : function(e) {
-			if (e.preventDefault)
-				e.preventDefault();
-			else
-				e.returnValue = false;
+		// Is not a undo specific command
+		if (!new RegExp('mceStartTyping|mceEndTyping|mceBeginUndoLevel|mceEndUndoLevel|mceAddUndoLevel', 'gi').test(command))
+			this.undoBookmark = null;
 
-			return false;
-		},
+		// Mozilla issue
+		if (!tinyMCE.isIE && !this.useCSS) {
+			this._setUseCSS(false);
+			this.useCSS = true;
+		}
 
-		destroy : function() {
-			var t = this;
+		//debug("command: " + command + ", user_interface: " + user_interface + ", value: " + value);
+		this.contentDocument = doc; // <-- Strange, unless this is applied Mozilla 1.3 breaks
 
-			each(t.events, function(e, i) {
-				t._remove(e.obj, e.name, e.cfunc);
-				e.obj = e.cfunc = null;
-			});
-
-			t.events = [];
-			t = null;
-		},
-
-		_add : function(o, n, f) {
-			if (o.attachEvent)
-				o.attachEvent('on' + n, f);
-			else if (o.addEventListener)
-				o.addEventListener(n, f, false);
-			else
-				o['on' + n] = f;
-		},
-
-		_remove : function(o, n, f) {
-			if (o) {
-				try {
-					if (o.detachEvent)
-						o.detachEvent('on' + n, f);
-					else if (o.removeEventListener)
-						o.removeEventListener(n, f, false);
-					else
-						o['on' + n] = null;
-				} catch (ex) {
-					// Might fail with permission denined on IE so we just ignore that
-				}
-			}
-		},
-
-		_pageInit : function(win) {
-			var t = this;
-
-			// Keep it from running more than once
-			if (t.domLoaded)
+		// Don't dispatch key commands
+		if (!/mceStartTyping|mceEndTyping/.test(command)) {
+			if (tinyMCE.execCommandCallback(this, 'execcommand_callback', 'execCommand', this.editorId, this.getBody(), command, user_interface, value))
 				return;
+		}
 
-			t.domLoaded = true;
+		// Fix align on images
+		if (focusElm && focusElm.nodeName == "IMG") {
+			align = focusElm.getAttribute('align');
+			img = command == "JustifyCenter" ? focusElm.cloneNode(false) : focusElm;
 
-			each(t.inits, function(c) {
-				c();
-			});
+			switch (command) {
+				case "JustifyLeft":
+					if (align == 'left') {
+						img.setAttribute('align', ''); // Needed for IE
+						img.removeAttribute('align');
+					} else
+						img.setAttribute('align', 'left');
 
-			t.inits = [];
-		},
+					// Remove the div
+					div = focusElm.parentNode;
+					if (div && div.nodeName == "DIV" && div.childNodes.length == 1 && div.parentNode)
+						div.parentNode.replaceChild(img, div);
 
-		_wait : function(win) {
-			var t = this, doc = win.document;
+					this.selection.selectNode(img);
+					this.repaint();
+					tinyMCE.triggerNodeChange();
+					return;
 
-			// No need since the document is already loaded
-			if (win.tinyMCE_GZ && tinyMCE_GZ.loaded) {
-				t.domLoaded = 1;
-				return;
-			}
+				case "JustifyCenter":
+					img.setAttribute('align', ''); // Needed for IE
+					img.removeAttribute('align');
 
-			// Use IE method
-			if (doc.attachEvent) {
-				doc.attachEvent("onreadystatechange", function() {
-					if (doc.readyState === "complete") {
-						doc.detachEvent("onreadystatechange", arguments.callee);
-						t._pageInit(win);
+					// Is centered
+					div = tinyMCE.getParentElement(focusElm, "div");
+					if (div && div.style.textAlign == "center") {
+						// Remove div
+						if (div.nodeName == "DIV" && div.childNodes.length == 1 && div.parentNode)
+							div.parentNode.replaceChild(img, div);
+					} else {
+						// Add div
+						div = this.getDoc().createElement("div");
+						div.style.textAlign = 'center';
+						div.appendChild(img);
+						focusElm.parentNode.replaceChild(div, focusElm);
 					}
-				});
 
-				if (doc.documentElement.doScroll && win == win.top) {
-					(function() {
-						if (t.domLoaded)
-							return;
+					this.selection.selectNode(img);
+					this.repaint();
+					tinyMCE.triggerNodeChange();
+					return;
 
-						try {
-							// If IE is used, use the trick by Diego Perini
-							// http://javascript.nwbox.com/IEContentLoaded/
-							doc.documentElement.doScroll("left");
-						} catch (ex) {
-							setTimeout(arguments.callee, 0);
-							return;
-						}
+				case "JustifyRight":
+					if (align == 'right') {
+						img.setAttribute('align', ''); // Needed for IE
+						img.removeAttribute('align');
+					} else
+						img.setAttribute('align', 'right');
 
-						t._pageInit(win);
-					})();
-				}
-			} else if (doc.addEventListener) {
-				t._add(win, 'DOMContentLoaded', function() {
-					t._pageInit(win);
-				});
-			}
+					// Remove the div
+					div = focusElm.parentNode;
+					if (div && div.nodeName == "DIV" && div.childNodes.length == 1 && div.parentNode)
+						div.parentNode.replaceChild(img, div);
 
-			t._add(win, 'load', function() {
-				t._pageInit(win);
-			});
-		},
-
-		_stoppers : {
-			preventDefault :  function() {
-				this.returnValue = false;
-			},
-
-			stopPropagation : function() {
-				this.cancelBubble = true;
+					this.selection.selectNode(img);
+					this.repaint();
+					tinyMCE.triggerNodeChange();
+					return;
 			}
 		}
-	});
 
-	Event = tinymce.dom.Event = new tinymce.dom.EventUtils();
+		if (tinyMCE.settings.force_br_newlines) {
+			var alignValue = "";
 
-	// Dispatch DOM content loaded event for IE and Safari
-	Event._wait(window);
+			if (doc.selection.type != "Control") {
+				switch (command) {
+						case "JustifyLeft":
+							alignValue = "left";
+							break;
 
-	tinymce.addUnload(function() {
-		Event.destroy();
-	});
-})(tinymce);
+						case "JustifyCenter":
+							alignValue = "center";
+							break;
 
-(function(tinymce) {
-	tinymce.dom.Element = function(id, settings) {
-		var t = this, dom, el;
+						case "JustifyFull":
+							alignValue = "justify";
+							break;
 
-		t.settings = settings = settings || {};
-		t.id = id;
-		t.dom = dom = settings.dom || tinymce.DOM;
+						case "JustifyRight":
+							alignValue = "right";
+							break;
+				}
 
-		// Only IE leaks DOM references, this is a lot faster
-		if (!tinymce.isIE)
-			el = dom.get(t.id);
+				if (alignValue !== '') {
+					var rng = doc.selection.createRange();
 
-		tinymce.each(
-				('getPos,getRect,getParent,add,setStyle,getStyle,setStyles,' + 
-				'setAttrib,setAttribs,getAttrib,addClass,removeClass,' + 
-				'hasClass,getOuterHTML,setOuterHTML,remove,show,hide,' + 
-				'isHidden,setHTML,get').split(/,/)
-			, function(k) {
-				t[k] = function() {
-					var a = [id], i;
+					if ((divElm = tinyMCE.getParentElement(rng.parentElement(), "div")) != null)
+						divElm.setAttribute("align", alignValue);
+					else if (rng.pasteHTML && rng.htmlText.length > 0)
+						rng.pasteHTML('<div align="' + alignValue + '">' + rng.htmlText + "</div>");
 
-					for (i = 0; i < arguments.length; i++)
-						a.push(arguments[i]);
-
-					a = dom[k].apply(dom, a);
-					t.update(k);
-
-					return a;
-				};
-		});
-
-		tinymce.extend(t, {
-			on : function(n, f, s) {
-				return tinymce.dom.Event.add(t.id, n, f, s);
-			},
-
-			getXY : function() {
-				return {
-					x : parseInt(t.getStyle('left')),
-					y : parseInt(t.getStyle('top'))
-				};
-			},
-
-			getSize : function() {
-				var n = dom.get(t.id);
-
-				return {
-					w : parseInt(t.getStyle('width') || n.clientWidth),
-					h : parseInt(t.getStyle('height') || n.clientHeight)
-				};
-			},
-
-			moveTo : function(x, y) {
-				t.setStyles({left : x, top : y});
-			},
-
-			moveBy : function(x, y) {
-				var p = t.getXY();
-
-				t.moveTo(p.x + x, p.y + y);
-			},
-
-			resizeTo : function(w, h) {
-				t.setStyles({width : w, height : h});
-			},
-
-			resizeBy : function(w, h) {
-				var s = t.getSize();
-
-				t.resizeTo(s.w + w, s.h + h);
-			},
-
-			update : function(k) {
-				var b;
-
-				if (tinymce.isIE6 && settings.blocker) {
-					k = k || '';
-
-					// Ignore getters
-					if (k.indexOf('get') === 0 || k.indexOf('has') === 0 || k.indexOf('is') === 0)
-						return;
-
-					// Remove blocker on remove
-					if (k == 'remove') {
-						dom.remove(t.blocker);
-						return;
-					}
-
-					if (!t.blocker) {
-						t.blocker = dom.uniqueId();
-						b = dom.add(settings.container || dom.getRoot(), 'iframe', {id : t.blocker, style : 'position:absolute;', frameBorder : 0, src : 'javascript:""'});
-						dom.setStyle(b, 'opacity', 0);
-					} else
-						b = dom.get(t.blocker);
-
-					dom.setStyles(b, {
-						left : t.getStyle('left', 1),
-						top : t.getStyle('top', 1),
-						width : t.getStyle('width', 1),
-						height : t.getStyle('height', 1),
-						display : t.getStyle('display', 1),
-						zIndex : parseInt(t.getStyle('zIndex', 1) || 0) - 1
-					});
+					tinyMCE.triggerNodeChange();
+					return;
 				}
 			}
-		});
-	};
-})(tinymce);
+		}
 
-(function(tinymce) {
-	function trimNl(s) {
-		return s.replace(/[\n\r]+/g, '');
-	};
+		switch (command) {
+			case "mceRepaint":
+				this.repaint();
+				return true;
 
-	// Shorten names
-	var is = tinymce.is, isIE = tinymce.isIE, each = tinymce.each;
+			case "JustifyLeft":
+			case "JustifyCenter":
+			case "JustifyFull":
+			case "JustifyRight":
+				var el = tinyMCE.getParentNode(focusElm, function(n) {return tinyMCE.getAttrib(n, 'align');});
 
-	tinymce.create('tinymce.dom.Selection', {
-		Selection : function(dom, win, serializer) {
-			var t = this;
+				if (el) {
+					el.setAttribute('align', ''); // Needed for IE
+					el.removeAttribute('align');
+				} else
+					this.getDoc().execCommand(command, user_interface, value);
 
-			t.dom = dom;
-			t.win = win;
-			t.serializer = serializer;
+				tinyMCE.triggerNodeChange();
 
-			// Add events
-			each([
-				'onBeforeSetContent',
-				'onBeforeGetContent',
-				'onSetContent',
-				'onGetContent'
-			], function(e) {
-				t[e] = new tinymce.util.Dispatcher(t);
-			});
+				return true;
 
-			// No W3C Range support
-			if (!t.win.getSelection)
-				t.tridentSel = new tinymce.dom.TridentSelection(t);
+			case "unlink":
+				// Unlink if caret is inside link
+				if (tinyMCE.isGecko && this.getSel().isCollapsed) {
+					focusElm = tinyMCE.getParentElement(focusElm, 'A');
 
-			// Prevent leaks
-			tinymce.addUnload(t.destroy, t);
-		},
+					if (focusElm)
+						this.selection.selectNode(focusElm, false);
+				}
 
-		getContent : function(s) {
-			var t = this, r = t.getRng(), e = t.dom.create("body"), se = t.getSel(), wb, wa, n;
+				this.getDoc().execCommand(command, user_interface, value);
 
-			s = s || {};
-			wb = wa = '';
-			s.get = true;
-			s.format = s.format || 'html';
-			t.onBeforeGetContent.dispatch(t, s);
+				tinyMCE.isGecko && this.getSel().collapseToEnd();
 
-			if (s.format == 'text')
-				return t.isCollapsed() ? '' : (r.text || (se.toString ? se.toString() : ''));
+				tinyMCE.triggerNodeChange();
 
-			if (r.cloneContents) {
-				n = r.cloneContents();
+				return true;
 
-				if (n)
-					e.appendChild(n);
-			} else if (is(r.item) || is(r.htmlText))
-				e.innerHTML = r.item ? r.item(0).outerHTML : r.htmlText;
-			else
-				e.innerHTML = r.toString();
+			case "InsertUnorderedList":
+			case "InsertOrderedList":
+				this.getDoc().execCommand(command, user_interface, value);
+				tinyMCE.triggerNodeChange();
+				break;
 
-			// Keep whitespace before and after
-			if (/^\s/.test(e.innerHTML))
-				wb = ' ';
+			case "Strikethrough":
+				this.getDoc().execCommand(command, user_interface, value);
+				tinyMCE.triggerNodeChange();
+				break;
 
-			if (/\s+$/.test(e.innerHTML))
-				wa = ' ';
+			case "mceSelectNode":
+				this.selection.selectNode(value);
+				tinyMCE.triggerNodeChange();
+				tinyMCE.selectedNode = value;
+				break;
 
-			s.getInner = true;
+			case "FormatBlock":
+				if (value == null || value == '') {
+					var elm = tinyMCE.getParentElement(this.getFocusElement(), "p,div,h1,h2,h3,h4,h5,h6,pre,address,blockquote,dt,dl,dd,samp");
 
-			s.content = t.isCollapsed() ? '' : wb + t.serializer.serialize(e, s) + wa;
-			t.onGetContent.dispatch(t, s);
+					if (elm)
+						this.execCommand("mceRemoveNode", false, elm);
+				} else {
+					if (!this.cleanup.isValid(value))
+						return true;
 
-			return s.content;
-		},
+					if (tinyMCE.isGecko && new RegExp('<(div|blockquote|code|dt|dd|dl|samp)>', 'gi').test(value))
+						value = value.replace(/[^a-z]/gi, '');
 
-		setContent : function(h, s) {
-			var t = this, r = t.getRng(), c, d = t.win.document;
+					if (tinyMCE.isIE && new RegExp('blockquote|code|samp', 'gi').test(value)) {
+						var b = this.selection.getBookmark();
+						this.getDoc().execCommand("FormatBlock", false, '<p>');
+						tinyMCE.renameElement(tinyMCE.getParentBlockElement(this.getFocusElement()), value);
+						this.selection.moveToBookmark(b);
+					} else
+						this.getDoc().execCommand("FormatBlock", false, value);
+				}
 
-			s = s || {format : 'html'};
-			s.set = true;
-			h = s.content = t.dom.processHTML(h);
+				tinyMCE.triggerNodeChange();
 
-			// Dispatch before set content event
-			t.onBeforeSetContent.dispatch(t, s);
-			h = s.content;
+				break;
 
-			if (r.insertNode) {
-				// Make caret marker since insertNode places the caret in the beginning of text after insert
-				h += '<span id="__caret">_</span>';
+			case "mceRemoveNode":
+				if (!value)
+					value = tinyMCE.getParentElement(this.getFocusElement());
 
-				// Delete and insert new node
-				
-				if (r.startContainer == d && r.endContainer ==  d) {
-					// WebKit will fail if the body is empty since the range is then invalid and it can't insert contents
-					d.body.innerHTML = h;
+				if (tinyMCE.isIE) {
+					value.outerHTML = value.innerHTML;
 				} else {
-					r.deleteContents();
-					if (d.body.childNodes.length == 0) {
-						d.body.innerHTML = h;
-					} else {
-						r.insertNode(r.createContextualFragment(h));
-					}
+					var rng = value.ownerDocument.createRange();
+					rng.setStartBefore(value);
+					rng.setEndAfter(value);
+					rng.deleteContents();
+					rng.insertNode(rng.createContextualFragment(value.innerHTML));
 				}
 
-				// Move to caret marker
-				c = t.dom.get('__caret');
-				// Make sure we wrap it compleatly, Opera fails with a simple select call
-				r = d.createRange();
-				r.setStartBefore(c);
-				r.setEndBefore(c);
-				t.setRng(r);
+				tinyMCE.triggerNodeChange();
 
-				// Remove the caret position
-				t.dom.remove('__caret');
-			} else {
-				if (r.item) {
-					// Delete content and get caret text selection
-					d.execCommand('Delete', false, null);
-					r = t.getRng();
-				}
+				break;
 
-				r.pasteHTML(h);
-			}
+			case "mceSelectNodeDepth":
+				var parentNode = this.getFocusElement();
+				for (i=0; parentNode; i++) {
+					if (parentNode.nodeName.toLowerCase() == "body")
+						break;
 
-			// Dispatch set content event
-			t.onSetContent.dispatch(t, s);
-		},
+					if (parentNode.nodeName.toLowerCase() == "#text") {
+						i--;
+						parentNode = parentNode.parentNode;
+						continue;
+					}
 
-		getStart : function() {
-			var rng = this.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();
-
-				// 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;
+					if (i == value) {
+						this.selection.selectNode(parentNode, false);
+						tinyMCE.triggerNodeChange();
+						tinyMCE.selectedNode = parentNode;
+						return;
 					}
+
+					parentNode = parentNode.parentNode;
 				}
 
-				// If start element is body element try to move to the first child if it exists
-				if (startElement && startElement.nodeName == 'BODY')
-					return startElement.firstChild || startElement;
+				break;
 
-				return startElement;
-			} else {
-				startElement = rng.startContainer;
+			case "mceSetStyleInfo":
+			case "SetStyleInfo":
+				var rng = this.getRng();
+				var sel = this.getSel();
+				var scmd = value.command;
+				var sname = value.name;
+				var svalue = value.value == null ? '' : value.value;
+				//var svalue = value['value'] == null ? '' : value['value'];
+				var wrapper = value.wrapper ? value.wrapper : "span";
+				var parentElm = null;
+				var invalidRe = new RegExp("^BODY|HTML$", "g");
+				var invalidParentsRe = tinyMCE.settings.merge_styles_invalid_parents !== '' ? new RegExp(tinyMCE.settings.merge_styles_invalid_parents, "gi") : null;
 
-				if (startElement.nodeType == 1 && startElement.hasChildNodes())
-					startElement = startElement.childNodes[Math.min(startElement.childNodes.length - 1, rng.startOffset)];
+				// Whole element selected check
+				if (tinyMCE.isIE) {
+					// Control range
+					if (rng.item)
+						parentElm = rng.item(0);
+					else {
+						var pelm = rng.parentElement();
+						var prng = doc.selection.createRange();
+						prng.moveToElementText(pelm);
 
-				if (startElement && startElement.nodeType == 3)
-					return startElement.parentNode;
-
-				return startElement;
-			}
-		},
-
-		getEnd : function() {
-			var t = this, r = t.getRng(), e, eo;
-
-			if (r.duplicate || r.item) {
-				if (r.item)
-					return r.item(0);
-
-				r = r.duplicate();
-				r.collapse(0);
-				e = r.parentElement();
-
-				if (e && e.nodeName == 'BODY')
-					return e.lastChild || e;
-
-				return e;
-			} else {
-				e = r.endContainer;
-				eo = r.endOffset;
-
-				if (e.nodeType == 1 && e.hasChildNodes())
-					e = e.childNodes[eo > 0 ? eo - 1 : eo];
-
-				if (e && e.nodeType == 3)
-					return e.parentNode;
-
-				return e;
-			}
-		},
-
-		getBookmark : function(type, normalized) {
-			var t = this, dom = t.dom, rng, rng2, id, collapsed, name, element, index, chr = '\uFEFF', styles;
-
-			function findIndex(name, element) {
-				var index = 0;
-
-				each(dom.select(name), function(node, i) {
-					if (node == element)
-						index = i;
-				});
-
-				return index;
-			};
-
-			if (type == 2) {
-				function getLocation() {
-					var rng = t.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(t.dom.nodeIndex(childNodes[offset], normalized) + after);
+						if (rng.htmlText == prng.htmlText || rng.boundingWidth == 0) {
+							if (invalidParentsRe == null || !invalidParentsRe.test(pelm.nodeName))
+								parentElm = pelm;
 						}
-
-						for (; container && container != root; container = container.parentNode)
-							point.push(t.dom.nodeIndex(container, normalized));
-
-						return point;
-					};
-
-					bookmark.start = getPoint(rng, true);
-
-					if (!t.isCollapsed())
-						bookmark.end = getPoint(rng);
-
-					return bookmark;
-				};
-
-				return getLocation();
-			}
-
-			// Handle simple range
-			if (type)
-				return {rng : t.getRng()};
-
-			rng = t.getRng();
-			id = dom.uniqueId();
-			collapsed = tinyMCE.activeEditor.selection.isCollapsed();
-			styles = 'overflow:hidden;line-height:0px';
-
-			// Explorer method
-			if (rng.duplicate || rng.item) {
-				// Text selection
-				if (!rng.item) {
-					rng2 = rng.duplicate();
-
-					// Insert start marker
-					rng.collapse();
-					rng.pasteHTML('<span _mce_type="bookmark" id="' + id + '_start" style="' + styles + '">' + chr + '</span>');
-
-					// Insert end marker
-					if (!collapsed) {
-						rng2.collapse(false);
-						rng2.pasteHTML('<span _mce_type="bookmark" id="' + id + '_end" style="' + styles + '">' + chr + '</span>');
 					}
 				} else {
-					// Control selection
-					element = rng.item(0);
-					name = element.nodeName;
-
-					return {name : name, index : findIndex(name, element)};
+					var felm = this.getFocusElement();
+					if (sel.isCollapsed || (new RegExp('td|tr|tbody|table|img', 'gi').test(felm.nodeName) && sel.anchorNode == felm.parentNode))
+						parentElm = felm;
 				}
-			} else {
-				element = t.getNode();
-				name = element.nodeName;
-				if (name == 'IMG')
-					return {name : name, index : findIndex(name, element)};
 
-				// W3C method
-				rng2 = rng.cloneRange();
+				// Whole element selected
+				if (parentElm && !invalidRe.test(parentElm.nodeName)) {
+					if (scmd == "setstyle")
+						tinyMCE.setStyleAttrib(parentElm, sname, svalue);
 
-				// Insert end marker
-				if (!collapsed) {
-					rng2.collapse(false);
-					rng2.insertNode(dom.create('span', {_mce_type : "bookmark", id : id + '_end', style : styles}, chr));
-				}
+					if (scmd == "setattrib")
+						tinyMCE.setAttrib(parentElm, sname, svalue);
 
-				rng.collapse(true);
-				rng.insertNode(dom.create('span', {_mce_type : "bookmark", id : id + '_start', style : styles}, chr));
-			}
+					if (scmd == "removeformat") {
+						parentElm.style.cssText = '';
+						tinyMCE.setAttrib(parentElm, 'class', '');
+					}
 
-			t.moveToBookmark({id : id, keep : 1});
+					// Remove style/attribs from all children
+					var ch = tinyMCE.getNodeTree(parentElm, [], 1);
+					for (z=0; z<ch.length; z++) {
+						if (ch[z] == parentElm)
+							continue;
 
-			return {id : id};
-		},
+						if (scmd == "setstyle")
+							tinyMCE.setStyleAttrib(ch[z], sname, '');
 
-		moveToBookmark : function(bookmark) {
-			var t = this, dom = t.dom, marker1, marker2, rng, root, startContainer, endContainer, startOffset, endOffset;
+						if (scmd == "setattrib")
+							tinyMCE.setAttrib(ch[z], sname, '');
 
-			// Clear selection cache
-			if (t.tridentSel)
-				t.tridentSel.destroy();
+						if (scmd == "removeformat") {
+							ch[z].style.cssText = '';
+							tinyMCE.setAttrib(ch[z], 'class', '');
+						}
+					}
+				} else {
+					this._setUseCSS(false); // Bug in FF when running in fullscreen
+					doc.execCommand("FontName", false, "#mce_temp_font#");
+					var elementArray = tinyMCE.getElementsByAttributeValue(this.getBody(), "font", "face", "#mce_temp_font#");
 
-			if (bookmark) {
-				if (bookmark.start) {
-					rng = dom.createRng();
-					root = dom.getRoot();
+					// Change them all
+					for (x=0; x<elementArray.length; x++) {
+						elm = elementArray[x];
+						if (elm) {
+							var spanElm = doc.createElement(wrapper);
 
-					function setEndPoint(start) {
-						var point = bookmark[start ? 'start' : 'end'], i, node, offset, children;
+							if (scmd == "setstyle")
+								tinyMCE.setStyleAttrib(spanElm, sname, svalue);
 
-						if (point) {
-							// Find container node
-							for (node = root, i = point.length - 1; i >= 1; i--) {
-								children = node.childNodes;
+							if (scmd == "setattrib")
+								tinyMCE.setAttrib(spanElm, sname, svalue);
 
-								if (children.length)
-									node = children[point[i]];
+							if (scmd == "removeformat") {
+								spanElm.style.cssText = '';
+								tinyMCE.setAttrib(spanElm, 'class', '');
 							}
 
-							// Set offset within container node
-							if (start)
-								rng.setStart(node, point[0]);
-							else
-								rng.setEnd(node, point[0]);
-						}
-					};
-
-					setEndPoint(true);
-					setEndPoint();
-
-					t.setRng(rng);
-				} else if (bookmark.id) {
-					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 (elm.hasChildNodes()) {
+								for (i=0; i<elm.childNodes.length; i++)
+									spanElm.appendChild(elm.childNodes[i].cloneNode(true));
 							}
 
-							if (!keep) {
-								prev = marker.previousSibling;
-								next = marker.nextSibling;
+							spanElm.setAttribute("mce_new", "true");
+							elm.parentNode.replaceChild(spanElm, elm);
 
-								// Remove all marker text nodes
-								each(tinymce.grep(marker.childNodes), function(node) {
-									if (node.nodeType == 3)
-										node.nodeValue = node.nodeValue.replace(/\uFEFF/g, '');
-								});
+							// Remove style/attribs from all children
+							var ch = tinyMCE.getNodeTree(spanElm, [], 1);
+							for (z=0; z<ch.length; z++) {
+								if (ch[z] == spanElm)
+									continue;
 
-								// 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 (scmd == "setstyle")
+									tinyMCE.setStyleAttrib(ch[z], sname, '');
 
-								// If siblings are text nodes then merge them
-								if (prev && next && prev.nodeType == next.nodeType && prev.nodeType == 3) {
-									idx = prev.nodeValue.length;
-									prev.appendData(next.nodeValue);
-									dom.remove(next);
+								if (scmd == "setattrib")
+									tinyMCE.setAttrib(ch[z], sname, '');
 
-									if (suffix == 'start') {
-										startContainer = endContainer = prev;
-										startOffset = endOffset = idx;
-									} else {
-										endContainer = prev;
-										endOffset = idx;
-									}
+								if (scmd == "removeformat") {
+									ch[z].style.cssText = '';
+									tinyMCE.setAttrib(ch[z], 'class', '');
 								}
 							}
 						}
-					};
-
-					function addBogus(node) {
-						// Adds a bogus BR element for empty block elements
-						// on non IE browsers just to have a place to put the caret
-						if (!isIE && dom.isBlock(node) && !node.innerHTML)
-							node.innerHTML = '<br _mce_bogus="1" />';
-
-						return node;
-					};
-
-					// Restore start/end points
-					restoreEndPoint('start');
-					restoreEndPoint('end');
-
-					if (startContainer) {
-						rng = dom.createRng();
-						rng.setStart(addBogus(startContainer), startOffset);
-						rng.setEnd(addBogus(endContainer), endOffset);
-						t.setRng(rng);
 					}
-				} else if (bookmark.name) {
-					t.select(dom.select(bookmark.name)[bookmark.index]);
-				} else if (bookmark.rng)
-					t.setRng(bookmark.rng);
-			}
-		},
-
-		select : function(node, content) {
-			var t = this, dom = t.dom, rng = dom.createRng(), idx;
-
-			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) {
-				function setPoint(node, start) {
-					var walker = new tinymce.dom.TreeWalker(node, node);
-
-					do {
-						// Text node
-						if (node.nodeType == 3 && tinymce.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()));
-				};
-
-				setPoint(node, 1);
-				setPoint(node);
-			}
-
-			t.setRng(rng);
-
-			return node;
-		},
-
-		isCollapsed : function() {
-			var t = this, r = t.getRng(), s = t.getSel();
-
-			if (!r || r.item)
-				return false;
-
-			if (r.compareEndPoints)
-				return r.compareEndPoints('StartToEnd', r) === 0;
-
-			return !s || r.collapsed;
-		},
-
-		collapse : function(b) {
-			var t = this, r = t.getRng(), n;
-
-			// Control range on IE
-			if (r.item) {
-				n = r.item(0);
-				r = this.win.document.body.createTextRange();
-				r.moveToElementText(n);
-			}
-
-			r.collapse(!!b);
-			t.setRng(r);
-		},
-
-		getSel : function() {
-			var t = this, w = this.win;
-
-			return w.getSelection ? w.getSelection() : w.document.selection;
-		},
-
-		getRng : function(w3c) {
-			var t = this, s, r;
-
-			// Found tridentSel object then we need to use that one
-			if (w3c && t.tridentSel)
-				return t.tridentSel.getRangeAt(0);
-
-			try {
-				if (s = t.getSel())
-					r = s.rangeCount > 0 ? s.getRangeAt(0) : (s.createRange ? s.createRange() : t.win.document.createRange());
-			} catch (ex) {
-				// IE throws unspecified error here if TinyMCE is placed in a frame/iframe
-			}
-
-			// 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 (!r)
-				r = t.win.document.createRange ? t.win.document.createRange() : t.win.document.body.createTextRange();
-
-			if (t.selectedRange && t.explicitRange) {
-				if (r.compareBoundaryPoints(r.START_TO_START, t.selectedRange) === 0 && r.compareBoundaryPoints(r.END_TO_END, t.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.
-					r = t.explicitRange;
-				} else {
-					t.selectedRange = null;
-					t.explicitRange = null;
 				}
-			}
-			return r;
-		},
 
-		setRng : function(r) {
-			var s, t = this;
-			
-			if (!t.tridentSel) {
-				s = t.getSel();
+				// Cleaup wrappers
+				var nodes = doc.getElementsByTagName(wrapper);
+				for (i=nodes.length-1; i>=0; i--) {
+					var elm = nodes[i];
+					var isNew = tinyMCE.getAttrib(elm, "mce_new") == "true";
 
-				if (s) {
-					t.explicitRange = r;
-					s.removeAllRanges();
-					s.addRange(r);
-					t.selectedRange = s.getRangeAt(0);
-				}
-			} else {
-				// Is W3C Range
-				if (r.cloneRange) {
-					t.tridentSel.addRange(r);
-					return;
-				}
+					elm.removeAttribute("mce_new");
 
-				// Is IE specific range
-				try {
-					r.select();
-				} catch (ex) {
-					// Needed for some odd IE bug #1843306
-				}
-			}
-		},
-
-		setNode : function(n) {
-			var t = this;
-
-			t.setContent(t.dom.getOuterHTML(n));
-
-			return n;
-		},
-
-		getNode : function() {
-			var t = this, rng = t.getRng(), sel = t.getSel(), elm;
-
-			if (rng.setStart) {
-				// Range maybe lost after the editor is made visible again
-				if (!rng)
-					return t.dom.getRoot();
-
-				elm = rng.commonAncestorContainer;
-
-				// Handle selection a image or other control like element such as anchors
-				if (!rng.collapsed) {
-					if (rng.startContainer == rng.endContainer) {
-						if (rng.startOffset - rng.endOffset < 2) {
-							if (rng.startContainer.hasChildNodes())
-								elm = rng.startContainer.childNodes[rng.startOffset];
-						}
+					// Is only child a element
+					if (elm.childNodes && elm.childNodes.length == 1 && elm.childNodes[0].nodeType == 1) {
+						//tinyMCE.debug("merge1" + isNew);
+						this._mergeElements(scmd, elm, elm.childNodes[0], isNew);
+						continue;
 					}
 
-					// 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]; 
+					// Is I the only child
+					if (elm.parentNode.childNodes.length == 1 && !invalidRe.test(elm.nodeName) && !invalidRe.test(elm.parentNode.nodeName)) {
+						//tinyMCE.debug("merge2" + isNew + "," + elm.nodeName + "," + elm.parentNode.nodeName);
+						if (invalidParentsRe == null || !invalidParentsRe.test(elm.parentNode.nodeName))
+							this._mergeElements(scmd, elm.parentNode, elm, false);
+					}
 				}
 
-				if (elm && elm.nodeType == 3)
-					return elm.parentNode;
+				// Remove empty wrappers
+				var nodes = doc.getElementsByTagName(wrapper);
+				for (i=nodes.length-1; i>=0; i--) {
+					var elm = nodes[i], isEmpty = true;
 
-				return elm;
-			}
+					// Check if it has any attribs
+					var tmp = doc.createElement("body");
+					tmp.appendChild(elm.cloneNode(false));
 
-			return rng.item ? rng.item(0) : rng.parentElement();
-		},
+					// Is empty span, remove it
+					tmp.innerHTML = tmp.innerHTML.replace(new RegExp('style=""|class=""', 'gi'), '');
+					//tinyMCE.debug(tmp.innerHTML);
+					if (new RegExp('<span>', 'gi').test(tmp.innerHTML)) {
+						for (x=0; x<elm.childNodes.length; x++) {
+							if (elm.parentNode != null)
+								elm.parentNode.insertBefore(elm.childNodes[x].cloneNode(true), elm);
+						}
 
-		getSelectedBlocks : function(st, en) {
-			var t = this, dom = t.dom, sb, eb, n, bl = [];
-
-			sb = dom.getParent(st || t.getStart(), dom.isBlock);
-			eb = dom.getParent(en || t.getEnd(), dom.isBlock);
-
-			if (sb)
-				bl.push(sb);
-
-			if (sb && eb && sb != eb) {
-				n = sb;
-
-				while ((n = n.nextSibling) && n != eb) {
-					if (dom.isBlock(n))
-						bl.push(n);
+						elm.parentNode.removeChild(elm);
+					}
 				}
-			}
 
-			if (eb && sb != eb)
-				bl.push(eb);
+				// Re add the visual aids
+				if (scmd == "removeformat")
+					tinyMCE.handleVisualAid(this.getBody(), true, this.visualAid, this);
 
-			return bl;
-		},
+				tinyMCE.triggerNodeChange();
 
-		destroy : function(s) {
-			var t = this;
+				break;
 
-			t.win = null;
+			case "FontName":
+				if (value == null) {
+					var s = this.getSel();
 
-			if (t.tridentSel)
-				t.tridentSel.destroy();
+					// Find font and select it
+					if (tinyMCE.isGecko && s.isCollapsed) {
+						var f = tinyMCE.getParentElement(this.getFocusElement(), "font");
 
-			// Manual destroy then remove unload handler
-			if (!s)
-				tinymce.removeUnload(t.destroy);
-		}
-	});
-})(tinymce);
+						if (f != null)
+							this.selection.selectNode(f, false);
+					}
 
-(function(tinymce) {
-	tinymce.create('tinymce.dom.XMLWriter', {
-		node : null,
+					// Remove format
+					this.getDoc().execCommand("RemoveFormat", false, null);
 
-		XMLWriter : function(s) {
-			// Get XML document
-			function getXML() {
-				var i = document.implementation;
-
-				if (!i || !i.createDocument) {
-					// Try IE objects
-					try {return new ActiveXObject('MSXML2.DOMDocument');} catch (ex) {}
-					try {return new ActiveXObject('Microsoft.XmlDom');} catch (ex) {}
+					// Collapse range if font was found
+					if (f != null && tinyMCE.isGecko) {
+						var r = this.getRng().cloneRange();
+						r.collapse(true);
+						s.removeAllRanges();
+						s.addRange(r);
+					}
 				} else
-					return i.createDocument('', '', null);
-			};
+					this.getDoc().execCommand('FontName', false, value);
 
-			this.doc = getXML();
-			
-			// Since Opera and WebKit doesn't escape > into > we need to do it our self to normalize the output for all browsers
-			this.valid = tinymce.isOpera || tinymce.isWebKit;
+				if (tinyMCE.isGecko)
+					window.setTimeout('tinyMCE.triggerNodeChange(false);', 1);
 
-			this.reset();
-		},
+				return;
 
-		reset : function() {
-			var t = this, d = t.doc;
+			case "FontSize":
+				this.getDoc().execCommand('FontSize', false, value);
 
-			if (d.firstChild)
-				d.removeChild(d.firstChild);
+				if (tinyMCE.isGecko)
+					window.setTimeout('tinyMCE.triggerNodeChange(false);', 1);
 
-			t.node = d.appendChild(d.createElement("html"));
-		},
+				return;
 
-		writeStartElement : function(n) {
-			var t = this;
+			case "forecolor":
+				value = value == null ? this.foreColor : value;
+				value = tinyMCE.trim(value);
+				value = value.charAt(0) != '#' ? (isNaN('0x' + value) ? value : '#' + value) : value;
 
-			t.node = t.node.appendChild(t.doc.createElement(n));
-		},
+				this.foreColor = value;
+				this.getDoc().execCommand('forecolor', false, value);
+				break;
 
-		writeAttribute : function(n, v) {
-			if (this.valid)
-				v = v.replace(/>/g, '%MCGT%');
+			case "HiliteColor":
+				value = value == null ? this.backColor : value;
+				value = tinyMCE.trim(value);
+				value = value.charAt(0) != '#' ? (isNaN('0x' + value) ? value : '#' + value) : value;
+				this.backColor = value;
 
-			this.node.setAttribute(n, v);
-		},
+				if (tinyMCE.isGecko || tinyMCE.isOpera) {
+					this._setUseCSS(true);
+					this.getDoc().execCommand('hilitecolor', false, value);
+					this._setUseCSS(false);
+				} else
+					this.getDoc().execCommand('BackColor', false, value);
+				break;
 
-		writeEndElement : function() {
-			this.node = this.node.parentNode;
-		},
+			case "Cut":
+			case "Copy":
+			case "Paste":
+				var cmdFailed = false;
 
-		writeFullEndElement : function() {
-			var t = this, n = t.node;
+				// Try executing command
+				eval('try {this.getDoc().execCommand(command, user_interface, value);} catch (e) {cmdFailed = true;}');
 
-			n.appendChild(t.doc.createTextNode(""));
-			t.node = n.parentNode;
-		},
+				if (tinyMCE.isOpera && cmdFailed)
+					alert('Currently not supported by your browser, use keyboard shortcuts instead.');
 
-		writeText : function(v) {
-			if (this.valid)
-				v = v.replace(/>/g, '%MCGT%');
+				// Alert error in gecko if command failed
+				if (tinyMCE.isGecko && cmdFailed) {
+					// Confirm more info
+					if (confirm(tinyMCE.entityDecode(tinyMCE.getLang('lang_clipboard_msg'))))
+						window.open('http://www.mozilla.org/editor/midasdemo/securityprefs.html', 'mceExternal');
 
-			this.node.appendChild(this.doc.createTextNode(v));
-		},
+					return;
+				} else
+					tinyMCE.triggerNodeChange();
+			break;
 
-		writeCDATA : function(v) {
-			this.node.appendChild(this.doc.createCDATASection(v));
-		},
+			case "mceSetContent":
+				if (!value)
+					value = "";
 
-		writeComment : function(v) {
-			// Fix for bug #2035694
-			if (tinymce.isIE)
-				v = v.replace(/^\-|\-$/g, ' ');
+				// Call custom cleanup code
+				value = tinyMCE.storeAwayURLs(value);
+				value = tinyMCE._customCleanup(this, "insert_to_editor", value);
 
-			this.node.appendChild(this.doc.createComment(v.replace(/\-\-/g, ' ')));
-		},
+				if (this.getBody().nodeName == 'BODY')
+					tinyMCE._setHTML(doc, value);
+				else
+					this.getBody().innerHTML = value;
 
-		getContent : function() {
-			var h;
+				tinyMCE.setInnerHTML(this.getBody(), tinyMCE._cleanupHTML(this, doc, this.settings, this.getBody(), false, false, false, true));
+				tinyMCE.convertAllRelativeURLs(this.getBody());
 
-			h = this.doc.xml || new XMLSerializer().serializeToString(this.doc);
-			h = h.replace(/<\?[^?]+\?>|<html>|<\/html>|<html\/>|<!DOCTYPE[^>]+>/g, '');
-			h = h.replace(/ ?\/>/g, ' />');
+				// Cleanup any mess left from storyAwayURLs
+				tinyMCE._removeInternal(this.getBody());
 
-			if (this.valid)
-				h = h.replace(/\%MCGT%/g, '>');
+				// When editing always use fonts internaly
+				if (tinyMCE.getParam("convert_fonts_to_spans"))
+					tinyMCE.convertSpansToFonts(doc);
 
-			return h;
-		}
-	});
-})(tinymce);
+				tinyMCE.handleVisualAid(this.getBody(), true, this.visualAid, this);
+				tinyMCE._setEventsEnabled(this.getBody(), false);
+				this._addBogusBR();
 
-(function(tinymce) {
-	tinymce.create('tinymce.dom.StringWriter', {
-		str : null,
-		tags : null,
-		count : 0,
-		settings : null,
-		indent : null,
+				return true;
 
-		StringWriter : function(s) {
-			this.settings = tinymce.extend({
-				indent_char : ' ',
-				indentation : 0
-			}, s);
+			case "mceCleanup":
+				var b = this.selection.getBookmark();
+				tinyMCE._setHTML(this.contentDocument, this.getBody().innerHTML);
+				tinyMCE.setInnerHTML(this.getBody(), tinyMCE._cleanupHTML(this, this.contentDocument, this.settings, this.getBody(), this.visualAid));
+				tinyMCE.convertAllRelativeURLs(doc.body);
 
-			this.reset();
-		},
+				// When editing always use fonts internaly
+				if (tinyMCE.getParam("convert_fonts_to_spans"))
+					tinyMCE.convertSpansToFonts(doc);
 
-		reset : function() {
-			this.indent = '';
-			this.str = "";
-			this.tags = [];
-			this.count = 0;
-		},
+				tinyMCE.handleVisualAid(this.getBody(), true, this.visualAid, this);
+				tinyMCE._setEventsEnabled(this.getBody(), false);
+				this._addBogusBR();
+				this.repaint();
+				this.selection.moveToBookmark(b);
+				tinyMCE.triggerNodeChange();
+			break;
 
-		writeStartElement : function(n) {
-			this._writeAttributesEnd();
-			this.writeRaw('<' + n);
-			this.tags.push(n);
-			this.inAttr = true;
-			this.count++;
-			this.elementCount = this.count;
-		},
+			case "mceReplaceContent":
+				// Force empty string
+				if (!value)
+					value = '';
 
-		writeAttribute : function(n, v) {
-			var t = this;
+				this.getWin().focus();
 
-			t.writeRaw(" " + t.encode(n) + '="' + t.encode(v) + '"');
-		},
+				var selectedText = "";
 
-		writeEndElement : function() {
-			var n;
+				if (tinyMCE.isIE) {
+					var rng = doc.selection.createRange();
+					selectedText = rng.text;
+				} else
+					selectedText = this.getSel().toString();
 
-			if (this.tags.length > 0) {
-				n = this.tags.pop();
-
-				if (this._writeAttributesEnd(1))
-					this.writeRaw('</' + n + '>');
-
-				if (this.settings.indentation > 0)
-					this.writeRaw('\n');
-			}
-		},
-
-		writeFullEndElement : function() {
-			if (this.tags.length > 0) {
-				this._writeAttributesEnd();
-				this.writeRaw('</' + this.tags.pop() + '>');
-
-				if (this.settings.indentation > 0)
-					this.writeRaw('\n');
-			}
-		},
-
-		writeText : function(v) {
-			this._writeAttributesEnd();
-			this.writeRaw(this.encode(v));
-			this.count++;
-		},
-
-		writeCDATA : function(v) {
-			this._writeAttributesEnd();
-			this.writeRaw('<![CDATA[' + v + ']]>');
-			this.count++;
-		},
-
-		writeComment : function(v) {
-			this._writeAttributesEnd();
-			this.writeRaw('<!-- ' + v + '-->');
-			this.count++;
-		},
-
-		writeRaw : function(v) {
-			this.str += v;
-		},
-
-		encode : function(s) {
-			return s.replace(/[<>&"]/g, function(v) {
-				switch (v) {
-					case '<':
-						return '<';
-
-					case '>':
-						return '>';
-
-					case '&':
-						return '&';
-
-					case '"':
-						return '"';
+				if (selectedText.length > 0) {
+					value = tinyMCE.replaceVar(value, "selection", selectedText);
+					tinyMCE.execCommand('mceInsertContent', false, value);
 				}
 
-				return v;
-			});
-		},
+				this._addBogusBR();
+				tinyMCE.triggerNodeChange();
+			break;
 
-		getContent : function() {
-			return this.str;
-		},
+			case "mceSetAttribute":
+				if (typeof(value) == 'object') {
+					var targetElms = (typeof(value.targets) == "undefined") ? "p,img,span,div,td,h1,h2,h3,h4,h5,h6,pre,address" : value.targets;
+					var targetNode = tinyMCE.getParentElement(this.getFocusElement(), targetElms);
 
-		_writeAttributesEnd : function(s) {
-			if (!this.inAttr)
-				return;
-
-			this.inAttr = false;
-
-			if (s && this.elementCount == this.count) {
-				this.writeRaw(' />');
-				return false;
-			}
-
-			this.writeRaw('>');
-
-			return true;
-		}
-	});
-})(tinymce);
-
-(function(tinymce) {
-	// Shorten names
-	var extend = tinymce.extend, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher, isIE = tinymce.isIE, isGecko = tinymce.isGecko;
-
-	function wildcardToRE(s) {
-		return s.replace(/([?+*])/g, '.$1');
-	};
-
-	tinymce.create('tinymce.dom.Serializer', {
-		Serializer : function(s) {
-			var t = this;
-
-			t.key = 0;
-			t.onPreProcess = new Dispatcher(t);
-			t.onPostProcess = new Dispatcher(t);
-
-			try {
-				t.writer = new tinymce.dom.XMLWriter();
-			} catch (ex) {
-				// IE might throw exception if ActiveX is disabled so we then switch to the slightly slower StringWriter
-				t.writer = new tinymce.dom.StringWriter();
-			}
-
-			// Default settings
-			t.settings = s = extend({
-				dom : tinymce.DOM,
-				valid_nodes : 0,
-				node_filter : 0,
-				attr_filter : 0,
-				invalid_attrs : /^(_mce_|_moz_|sizset|sizcache)/,
-				closed : /^(br|hr|input|meta|img|link|param|area)$/,
-				entity_encoding : 'named',
-				entities : '160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,9
 13,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,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,88
 04,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro',
-				valid_elements : '*[*]',
-				extended_valid_elements : 0,
-				invalid_elements : 0,
-				fix_table_elements : 1,
-				fix_list_elements : true,
-				fix_content_duplication : true,
-				convert_fonts_to_spans : false,
-				font_size_classes : 0,
-				apply_source_formatting : 0,
-				indent_mode : 'simple',
-				indent_char : '\t',
-				indent_levels : 1,
-				remove_linebreaks : 1,
-				remove_redundant_brs : 1,
-				element_format : 'xhtml'
-			}, s);
-
-			t.dom = s.dom;
-			t.schema = s.schema;
-
-			// Use raw entities if no entities are defined
-			if (s.entity_encoding == 'named' && !s.entities)
-				s.entity_encoding = 'raw';
-
-			if (s.remove_redundant_brs) {
-				t.onPostProcess.add(function(se, o) {
-					// Remove single BR at end of block elements since they get rendered
-					o.content = o.content.replace(/(<br \/>\s*)+<\/(p|h[1-6]|div|li)>/gi, function(a, b, c) {
-						// Check if it's a single element
-						if (/^<br \/>\s*<\//.test(a))
-							return '</' + c + '>';
-
-						return a;
-					});
-				});
-			}
-
-			// Remove XHTML element endings i.e. produce crap :) XHTML is better
-			if (s.element_format == 'html') {
-				t.onPostProcess.add(function(se, o) {
-					o.content = o.content.replace(/<([^>]+) \/>/g, '<$1>');
-				});
-			}
-
-			if (s.fix_list_elements) {
-				t.onPreProcess.add(function(se, o) {
-					var nl, x, a = ['ol', 'ul'], i, n, p, r = /^(OL|UL)$/, np;
-
-					function prevNode(e, n) {
-						var a = n.split(','), i;
-
-						while ((e = e.previousSibling) != null) {
-							for (i=0; i<a.length; i++) {
-								if (e.nodeName == a[i])
-									return e;
-							}
-						}
-
-						return null;
-					};
-
-					for (x=0; x<a.length; x++) {
-						nl = t.dom.select(a[x], o.node);
-
-						for (i=0; i<nl.length; i++) {
-							n = nl[i];
-							p = n.parentNode;
-
-							if (r.test(p.nodeName)) {
-								np = prevNode(n, 'LI');
-
-								if (!np) {
-									np = t.dom.create('li');
-									np.innerHTML = ' ';
-									np.appendChild(n);
-									p.insertBefore(np, p.firstChild);
-								} else
-									np.appendChild(n);
-							}
-						}
+					if (targetNode) {
+						targetNode.setAttribute(value.name, value.value);
+						tinyMCE.triggerNodeChange();
 					}
-				});
-			}
+				}
+			break;
 
-			if (s.fix_table_elements) {
-				t.onPreProcess.add(function(se, o) {
-					// Since Opera will crash if you attach the node to a dynamic document we need to brrowser sniff a specific build
-					// so Opera users with an older version will have to live with less compaible output not much we can do here
-					if (!tinymce.isOpera || opera.buildNumber() >= 1767) {
-						each(t.dom.select('p table', o.node).reverse(), function(n) {
-							var parent = t.dom.getParent(n.parentNode, 'table,p');
+			case "mceSetCSSClass":
+				this.execCommand("mceSetStyleInfo", false, {command : "setattrib", name : "class", value : value});
+			break;
 
-							if (parent.nodeName != 'TABLE') {
-								try {
-									t.dom.split(parent, n);
-								} catch (ex) {
-									// IE can sometimes fire an unknown runtime error so we just ignore it
-								}
-							}
-						});
-					}
-				});
-			}
-		},
+			case "mceInsertRawHTML":
+				var key = 'tiny_mce_marker';
 
-		setEntities : function(s) {
-			var t = this, a, i, l = {}, v;
+				this.execCommand('mceBeginUndoLevel');
 
-			// No need to setup more than once
-			if (t.entityLookup)
-				return;
+				// Insert marker key
+				this.execCommand('mceInsertContent', false, key);
 
-			// Build regex and lookup array
-			a = s.split(',');
-			for (i = 0; i < a.length; i += 2) {
-				v = a[i];
+				// Store away scroll pos
+				var scrollX = this.getBody().scrollLeft + this.getDoc().documentElement.scrollLeft;
+				var scrollY = this.getBody().scrollTop + this.getDoc().documentElement.scrollTop;
 
-				// Don't add default & " etc.
-				if (v == 34 || v == 38 || v == 60 || v == 62)
-					continue;
+				// Find marker and replace with RAW HTML
+				var html = this.getBody().innerHTML;
+				if ((pos = html.indexOf(key)) != -1)
+					tinyMCE.setInnerHTML(this.getBody(), html.substring(0, pos) + value + html.substring(pos + key.length));
 
-				l[String.fromCharCode(a[i])] = a[i + 1];
+				// Restore scoll pos
+				this.contentWindow.scrollTo(scrollX, scrollY);
 
-				v = parseInt(a[i]).toString(16);
-			}
+				this.execCommand('mceEndUndoLevel');
 
-			t.entityLookup = l;
-		},
+				break;
 
-		setRules : function(s) {
-			var t = this;
+			case "mceInsertContent":
+				// Force empty string
+				if (!value)
+					value = '';
 
-			t._setup();
-			t.rules = {};
-			t.wildRules = [];
-			t.validElements = {};
+				var insertHTMLFailed = false;
 
-			return t.addRules(s);
-		},
+				// Removed since it produced problems in IE
+				// this.getWin().focus();
 
-		addRules : function(s) {
-			var t = this, dr;
+				if (tinyMCE.isGecko || tinyMCE.isOpera) {
+					try {
+						// Is plain text or HTML, &,   etc will be encoded wrong in FF
+						if (value.indexOf('<') == -1 && !value.match(/(&| |<|>)/g)) {
+							var r = this.getRng();
+							var n = this.getDoc().createTextNode(tinyMCE.entityDecode(value));
+							var s = this.getSel();
+							var r2 = r.cloneRange();
 
-			if (!s)
-				return;
+							// Insert text at cursor position
+							s.removeAllRanges();
+							r.deleteContents();
+							r.insertNode(n);
 
-			t._setup();
-
-			each(s.split(','), function(s) {
-				var p = s.split(/\[|\]/), tn = p[0].split('/'), ra, at, wat, va = [];
-
-				// Extend with default rules
-				if (dr)
-					at = tinymce.extend([], dr.attribs);
-
-				// Parse attributes
-				if (p.length > 1) {
-					each(p[1].split('|'), function(s) {
-						var ar = {}, i;
-
-						at = at || [];
-
-						// Parse attribute rule
-						s = s.replace(/::/g, '~');
-						s = /^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(s);
-						s[2] = s[2].replace(/~/g, ':');
-
-						// Add required attributes
-						if (s[1] == '!') {
-							ra = ra || [];
-							ra.push(s[2]);
-						}
-
-						// Remove inherited attributes
-						if (s[1] == '-') {
-							for (i = 0; i <at.length; i++) {
-								if (at[i].name == s[2]) {
-									at.splice(i, 1);
-									return;
-								}
-							}
-						}
-
-						switch (s[3]) {
-							// Add default attrib values
-							case '=':
-								ar.defaultVal = s[4] || '';
-								break;
-
-							// Add forced attrib values
-							case ':':
-								ar.forcedVal = s[4];
-								break;
-
-							// Add validation values
-							case '<':
-								ar.validVals = s[4].split('?');
-								break;
-						}
-
-						if (/[*.?]/.test(s[2])) {
-							wat = wat || [];
-							ar.nameRE = new RegExp('^' + wildcardToRE(s[2]) + '$');
-							wat.push(ar);
+							// Move the cursor to the end of text
+							r2.selectNode(n);
+							r2.collapse(false);
+							s.removeAllRanges();
+							s.addRange(r2);
 						} else {
-							ar.name = s[2];
-							at.push(ar);
+							value = tinyMCE.fixGeckoBaseHREFBug(1, this.getDoc(), value);
+							this.getDoc().execCommand('inserthtml', false, value);
+							tinyMCE.fixGeckoBaseHREFBug(2, this.getDoc(), value);
 						}
-
-						va.push(s[2]);
-					});
-				}
-
-				// Handle element names
-				each(tn, function(s, i) {
-					var pr = s.charAt(0), x = 1, ru = {};
-
-					// Extend with default rule data
-					if (dr) {
-						if (dr.noEmpty)
-							ru.noEmpty = dr.noEmpty;
-
-						if (dr.fullEnd)
-							ru.fullEnd = dr.fullEnd;
-
-						if (dr.padd)
-							ru.padd = dr.padd;
+					} catch (ex) {
+						insertHTMLFailed = true;
 					}
 
-					// Handle prefixes
-					switch (pr) {
-						case '-':
-							ru.noEmpty = true;
-							break;
-
-						case '+':
-							ru.fullEnd = true;
-							break;
-
-						case '#':
-							ru.padd = true;
-							break;
-
-						default:
-							x = 0;
+					if (!insertHTMLFailed) {
+						tinyMCE.triggerNodeChange();
+						return;
 					}
+				}
 
-					tn[i] = s = s.substring(x);
-					t.validElements[s] = 1;
+				if (!tinyMCE.isIE) {
+					var isHTML = value.indexOf('<') != -1;
+					var sel = this.getSel();
+					var rng = this.getRng();
 
-					// Add element name or element regex
-					if (/[*.?]/.test(tn[0])) {
-						ru.nameRE = new RegExp('^' + wildcardToRE(tn[0]) + '$');
-						t.wildRules = t.wildRules || {};
-						t.wildRules.push(ru);
-					} else {
-						ru.name = tn[0];
+					if (isHTML) {
+						if (tinyMCE.isSafari) {
+							var tmpRng = this.getDoc().createRange();
 
-						// Store away default rule
-						if (tn[0] == '@')
-							dr = ru;
+							tmpRng.setStart(this.getBody(), 0);
+							tmpRng.setEnd(this.getBody(), 0);
 
-						t.rules[s] = ru;
+							value = tmpRng.createContextualFragment(value);
+						} else
+							value = rng.createContextualFragment(value);
+					} else {
+						// Setup text node
+						value = doc.createTextNode(tinyMCE.entityDecode(value));
 					}
 
-					ru.attribs = at;
-
-					if (ra)
-						ru.requiredAttribs = ra;
-
-					if (wat) {
-						// Build valid attributes regexp
-						s = '';
-						each(va, function(v) {
-							if (s)
-								s += '|';
-
-							s += '(' + wildcardToRE(v) + ')';
-						});
-						ru.validAttribsRE = new RegExp('^' + s.toLowerCase() + '$');
-						ru.wildAttribs = wat;
+					// Insert plain text in Safari
+					if (tinyMCE.isSafari && !isHTML) {
+						this.execCommand('InsertText', false, value.nodeValue);
+						tinyMCE.triggerNodeChange();
+						return true;
+					} else if (tinyMCE.isSafari && isHTML) {
+						rng.deleteContents();
+						rng.insertNode(value);
+						tinyMCE.triggerNodeChange();
+						return true;
 					}
-				});
-			});
 
-			// Build valid elements regexp
-			s = '';
-			each(t.validElements, function(v, k) {
-				if (s)
-					s += '|';
+					rng.deleteContents();
 
-				if (k != '@')
-					s += k;
-			});
-			t.validElementsRE = new RegExp('^(' + wildcardToRE(s.toLowerCase()) + ')$');
+					// If target node is text do special treatment, (Mozilla 1.3 fix)
+					if (rng.startContainer.nodeType == 3) {
+						var node = rng.startContainer.splitText(rng.startOffset);
+						node.parentNode.insertBefore(value, node); 
+					} else
+						rng.insertNode(value);
 
-			//console.debug(t.validElementsRE.toString());
-			//console.dir(t.rules);
-			//console.dir(t.wildRules);
-		},
+					if (!isHTML) {
+						// Removes weird selection trails
+						sel.selectAllChildren(doc.body);
+						sel.removeAllRanges();
 
-		findRule : function(n) {
-			var t = this, rl = t.rules, i, r;
+						// Move cursor to end of content
+						var rng = doc.createRange();
 
-			t._setup();
+						rng.selectNode(value);
+						rng.collapse(false);
 
-			// Exact match
-			r = rl[n];
-			if (r)
-				return r;
+						sel.addRange(rng);
+					} else
+						rng.collapse(false);
 
-			// Try wildcards
-			rl = t.wildRules;
-			for (i = 0; i < rl.length; i++) {
-				if (rl[i].nameRE.test(n))
-					return rl[i];
-			}
+					tinyMCE.fixGeckoBaseHREFBug(2, this.getDoc(), value);
+				} else {
+					var rng = doc.selection.createRange(), tmpRng = null;
+					var c = value.indexOf('<!--') != -1;
 
-			return null;
-		},
+					// Fix comment bug, add tag before comments
+					if (c)
+						value = tinyMCE.uniqueTag + value;
 
-		findAttribRule : function(ru, n) {
-			var i, wa = ru.wildAttribs;
+					//	tmpRng = rng.duplicate(); // Store away range (Fixes Undo bookmark bug in IE)
 
-			for (i = 0; i < wa.length; i++) {
-				if (wa[i].nameRE.test(n))
-					return wa[i];
-			}
+					if (rng.item)
+						rng.item(0).outerHTML = value;
+					else
+						rng.pasteHTML(value);
 
-			return null;
-		},
+					//if (tmpRng)
+					//	tmpRng.select(); // Restore range  (Fixes Undo bookmark bug in IE)
 
-		serialize : function(n, o) {
-			var h, t = this, doc, oldDoc, impl, selected;
-
-			t._setup();
-			o = o || {};
-			o.format = o.format || 'html';
-			t.processObj = o;
-
-			// IE looses the selected attribute on option elements so we need to store it
-			// See: http://support.microsoft.com/kb/829907
-			if (isIE) {
-				selected = [];
-				each(n.getElementsByTagName('option'), function(n) {
-					var v = t.dom.getAttrib(n, 'selected');
-
-					selected.push(v ? v : null);
-				});
-			}
-
-			n = n.cloneNode(true);
-
-			// IE looses the selected attribute on option elements so we need to restore it
-			if (isIE) {
-				each(n.getElementsByTagName('option'), function(n, i) {
-					t.dom.setAttrib(n, 'selected', selected[i]);
-				});
-			}
-
-			// Nodes needs to be attached to something in WebKit/Opera
-			// Older builds of Opera crashes if you attach the node to an document created dynamically
-			// and since we can't feature detect a crash we need to sniff the acutal build number
-			// This fix will make DOM ranges and make Sizzle happy!
-			impl = n.ownerDocument.implementation;
-			if (impl.createHTMLDocument && (tinymce.isOpera && opera.buildNumber() >= 1767)) {
-				// 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(n.nodeName == 'BODY' ? n.childNodes : [n], function(node) {
-					doc.body.appendChild(doc.importNode(node, true));
-				});
-
-				// Grab first child or body element for serialization
-				if (n.nodeName != 'BODY')
-					n = doc.body.firstChild;
-				else
-					n = doc.body;
-
-				// set the new document in DOMUtils so createElement etc works
-				oldDoc = t.dom.doc;
-				t.dom.doc = doc;
-			}
-
-			t.key = '' + (parseInt(t.key) + 1);
-
-			// Pre process
-			if (!o.no_events) {
-				o.node = n;
-				t.onPreProcess.dispatch(t, o);
-			}
-
-			// Serialize HTML DOM into a string
-			t.writer.reset();
-			t._info = o;
-			t._serializeNode(n, o.getInner);
-
-			// Post process
-			o.content = t.writer.getContent();
-
-			// Restore the old document if it was changed
-			if (oldDoc)
-				t.dom.doc = oldDoc;
-
-			if (!o.no_events)
-				t.onPostProcess.dispatch(t, o);
-
-			t._postProcess(o);
-			o.node = null;
-
-			return tinymce.trim(o.content);
-		},
-
-		// Internal functions
-
-		_postProcess : function(o) {
-			var t = this, s = t.settings, h = o.content, sc = [], p;
-
-			if (o.format == 'html') {
-				// Protect some elements
-				p = t._protect({
-					content : h,
-					patterns : [
-						{pattern : /(<script[^>]*>)(.*?)(<\/script>)/g},
-						{pattern : /(<noscript[^>]*>)(.*?)(<\/noscript>)/g},
-						{pattern : /(<style[^>]*>)(.*?)(<\/style>)/g},
-						{pattern : /(<pre[^>]*>)(.*?)(<\/pre>)/g, encode : 1},
-						{pattern : /(<!--\[CDATA\[)(.*?)(\]\]-->)/g}
-					]
-				});
-
-				h = p.content;
-
-				// Entity encode
-				if (s.entity_encoding !== 'raw')
-					h = t._encode(h);
-
-				// Use BR instead of   padded P elements inside editor and use <p> </p> outside editor
-/*				if (o.set)
-					h = h.replace(/<p>\s+( | |\u00a0|<br \/>)\s+<\/p>/g, '<p><br /></p>');
-				else
-					h = h.replace(/<p>\s+( | |\u00a0|<br \/>)\s+<\/p>/g, '<p>$1</p>');*/
-
-				// Since Gecko and Safari keeps whitespace in the DOM we need to
-				// remove it inorder to match other browsers. But I think Gecko and Safari is right.
-				// This process is only done when getting contents out from the editor.
-				if (!o.set) {
-					// We need to replace paragraph whitespace with an nbsp before indentation to keep the \u00a0 char
-					h = h.replace(/<p>\s+<\/p>|<p([^>]+)>\s+<\/p>/g, s.entity_encoding == 'numeric' ? '<p$1> </p>' : '<p$1> </p>');
-
-					if (s.remove_linebreaks) {
-						h = h.replace(/\r?\n|\r/g, ' ');
-						h = h.replace(/(<[^>]+>)\s+/g, '$1 ');
-						h = h.replace(/\s+(<\/[^>]+>)/g, ' $1');
-						h = h.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g, '<$1 $2>'); // Trim block start
-						h = h.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g, '<$1>'); // Trim block start
-						h = h.replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g, '</$1>'); // Trim block end
+					// Remove unique tag
+					if (c) {
+						var e = this.getDoc().getElementById('mceTMPElement');
+						e.parentNode.removeChild(e);
 					}
-
-					// Simple indentation
-					if (s.apply_source_formatting && s.indent_mode == 'simple') {
-						// Add line breaks before and after block elements
-						h = h.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g, '\n<$1$2$3>\n');
-						h = h.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g, '\n<$1$2>');
-						h = h.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g, '</$1>\n');
-						h = h.replace(/\n\n/g, '\n');
-					}
 				}
 
-				h = t._unprotect(h, p);
+				tinyMCE.execCommand("mceAddUndoLevel");
+				tinyMCE.triggerNodeChange();
+			break;
 
-				// Restore CDATA sections
-				h = h.replace(/<!--\[CDATA\[([\s\S]+)\]\]-->/g, '<![CDATA[$1]]>');
+			case "mceStartTyping":
+				if (tinyMCE.settings.custom_undo_redo && this.undoRedo.typingUndoIndex == -1) {
+					this.undoRedo.typingUndoIndex = this.undoRedo.undoIndex;
+					tinyMCE.typingUndoIndex = tinyMCE.undoIndex;
+					this.execCommand('mceAddUndoLevel');
+				}
+				break;
 
-				// Restore the \u00a0 character if raw mode is enabled
-				if (s.entity_encoding == 'raw')
-					h = h.replace(/<p> <\/p>|<p([^>]+)> <\/p>/g, '<p$1>\u00a0</p>');
+			case "mceEndTyping":
+				if (tinyMCE.settings.custom_undo_redo && this.undoRedo.typingUndoIndex != -1) {
+					this.execCommand('mceAddUndoLevel');
+					this.undoRedo.typingUndoIndex = -1;
+				}
 
-				// Restore noscript elements
-				h = h.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g, function(v, attribs, text) {
-					return '<noscript' + attribs + '>' + t.dom.decode(text.replace(/<!--|-->/g, '')) + '</noscript>';
-				});
-			}
+				tinyMCE.typingUndoIndex = -1;
+				break;
 
-			o.content = h;
-		},
+			case "mceBeginUndoLevel":
+				this.undoRedoLevel = false;
+				break;
 
-		_serializeNode : function(n, inner) {
-			var t = this, s = t.settings, w = t.writer, hc, el, cn, i, l, a, at, no, v, nn, ru, ar, iv, closed, keep, type, scopeName;
+			case "mceEndUndoLevel":
+				this.undoRedoLevel = true;
+				this.execCommand('mceAddUndoLevel');
+				break;
 
-			if (!s.node_filter || s.node_filter(n)) {
-				switch (n.nodeType) {
-					case 1: // Element
-						if (n.hasAttribute ? n.hasAttribute('_mce_bogus') : n.getAttribute('_mce_bogus'))
-							return;
+			case "mceAddUndoLevel":
+				if (tinyMCE.settings.custom_undo_redo && this.undoRedoLevel) {
+					if (this.undoRedo.add())
+						tinyMCE.triggerNodeChange(false);
+				}
+				break;
 
-						iv = keep = false;
-						hc = n.hasChildNodes();
-						nn = n.getAttribute('_mce_name') || n.nodeName.toLowerCase();
+			case "Undo":
+				if (tinyMCE.settings.custom_undo_redo) {
+					tinyMCE.execCommand("mceEndTyping");
+					this.undoRedo.undo();
+					tinyMCE.triggerNodeChange();
+				} else
+					this.getDoc().execCommand(command, user_interface, value);
+				break;
 
-						// Get internal type
-						type = n.getAttribute('_mce_type');
-						if (type) {
-							if (!t._info.cleanup) {
-								iv = true;
-								return;
-							} else
-								keep = 1;
-						}
+			case "Redo":
+				if (tinyMCE.settings.custom_undo_redo) {
+					tinyMCE.execCommand("mceEndTyping");
+					this.undoRedo.redo();
+					tinyMCE.triggerNodeChange();
+				} else
+					this.getDoc().execCommand(command, user_interface, value);
+				break;
 
-						// Add correct prefix on IE
-						if (isIE) {
-							scopeName = n.scopeName;
-							if (scopeName && scopeName !== 'HTML' && scopeName !== 'html')
-								nn = scopeName + ':' + nn;
-						}
+			case "mceToggleVisualAid":
+				this.visualAid = !this.visualAid;
+				tinyMCE.handleVisualAid(this.getBody(), true, this.visualAid, this);
+				tinyMCE.triggerNodeChange();
+				break;
 
-						// Remove mce prefix on IE needed for the abbr element
-						if (nn.indexOf('mce:') === 0)
-							nn = nn.substring(4);
+			case "Indent":
+				this.getDoc().execCommand(command, user_interface, value);
+				tinyMCE.triggerNodeChange();
 
-						// Check if valid
-						if (!keep) {
-							if (!t.validElementsRE || !t.validElementsRE.test(nn) || (t.invalidElementsRE && t.invalidElementsRE.test(nn)) || inner) {
-								iv = true;
-								break;
-							}
+				if (tinyMCE.isIE) {
+					var n = tinyMCE.getParentElement(this.getFocusElement(), "blockquote");
+					do {
+						if (n && n.nodeName == "BLOCKQUOTE") {
+							n.removeAttribute("dir");
+							n.removeAttribute("style");
 						}
+					} while (n != null && (n = n.parentNode) != null);
+				}
+				break;
 
-						if (isIE) {
-							// Fix IE content duplication (DOM can have multiple copies of the same node)
-							if (s.fix_content_duplication) {
-								if (n._mce_serialized == t.key)
-									return;
+			case "RemoveFormat":
+			case "removeformat":
+				var text = this.selection.getSelectedText();
 
-								n._mce_serialized = t.key;
-							}
+				if (tinyMCE.isOpera) {
+					this.getDoc().execCommand("RemoveFormat", false, null);
+					return;
+				}
 
-							// IE sometimes adds a / infront of the node name
-							if (nn.charAt(0) == '/')
-								nn = nn.substring(1);
-						} else if (isGecko) {
-							// Ignore br elements
-							if (n.nodeName === 'BR' && n.getAttribute('type') == '_moz')
-								return;
-						}
+				if (tinyMCE.isIE) {
+					try {
+						var rng = doc.selection.createRange();
+						rng.execCommand("RemoveFormat", false, null);
+					} catch (e) {
+						// Do nothing
+					}
 
-						// Check if valid child
-						if (s.validate_children) {
-							if (t.elementName && !t.schema.isValid(t.elementName, nn)) {
-								iv = true;
-								break;
-							}
+					this.execCommand("mceSetStyleInfo", false, {command : "removeformat"});
+				} else {
+					this.getDoc().execCommand(command, user_interface, value);
 
-							t.elementName = nn;
-						}
+					this.execCommand("mceSetStyleInfo", false, {command : "removeformat"});
+				}
 
-						ru = t.findRule(nn);
-						
-						// No valid rule for this element could be found then skip it
-						if (!ru) {
-							iv = true;
-							break;
-						}
+				// Remove class
+				if (text.length == 0)
+					this.execCommand("mceSetCSSClass", false, "");
 
-						nn = ru.name || nn;
-						closed = s.closed.test(nn);
+				tinyMCE.triggerNodeChange();
+				break;
 
-						// Skip empty nodes or empty node name in IE
-						if ((!hc && ru.noEmpty) || (isIE && !nn)) {
-							iv = true;
-							break;
-						}
+			default:
+				this.getDoc().execCommand(command, user_interface, value);
 
-						// Check required
-						if (ru.requiredAttribs) {
-							a = ru.requiredAttribs;
+				if (tinyMCE.isGecko)
+					window.setTimeout('tinyMCE.triggerNodeChange(false);', 1);
+				else
+					tinyMCE.triggerNodeChange();
+		}
 
-							for (i = a.length - 1; i >= 0; i--) {
-								if (this.dom.getAttrib(n, a[i]) !== '')
-									break;
-							}
+		// Add undo level after modification
+		if (command != "mceAddUndoLevel" && command != "Undo" && command != "Redo" && command != "mceStartTyping" && command != "mceEndTyping")
+			tinyMCE.execCommand("mceAddUndoLevel");
+	},
 
-							// None of the required was there
-							if (i == -1) {
-								iv = true;
-								break;
-							}
-						}
+	queryCommandValue : function(c) {
+		try {
+			return this.getDoc().queryCommandValue(c);
+		} catch (e) {
+			return null;
+		}
+	},
 
-						w.writeStartElement(nn);
+	queryCommandState : function(c) {
+		return this.getDoc().queryCommandState(c);
+	},
 
-						// Add ordered attributes
-						if (ru.attribs) {
-							for (i=0, at = ru.attribs, l = at.length; i<l; i++) {
-								a = at[i];
-								v = t._getAttrib(n, a);
+	_addBogusBR : function() {
+		var b = this.getBody();
 
-								if (v !== null)
-									w.writeAttribute(a.name, v);
-							}
-						}
+		if (tinyMCE.isGecko && !b.hasChildNodes())
+			b.innerHTML = '<br _moz_editor_bogus_node="TRUE" />';
+	},
 
-						// Add wild attributes
-						if (ru.validAttribsRE) {
-							at = t.dom.getAttribs(n);
-							for (i=at.length-1; i>-1; i--) {
-								no = at[i];
+	_onAdd : function(replace_element, form_element_name, target_document) {
+		var hc, th, tos, editorTemplate, targetDoc, deltaWidth, deltaHeight, html, rng, fragment;
+		var dynamicIFrame, tElm, doc, parentElm;
 
-								if (no.specified) {
-									a = no.nodeName.toLowerCase();
+		th = this.settings.theme;
+		tos = tinyMCE.themes[th];
 
-									if (s.invalid_attrs.test(a) || !ru.validAttribsRE.test(a))
-										continue;
+		targetDoc = target_document ? target_document : document;
 
-									ar = t.findAttribRule(ru, a);
-									v = t._getAttrib(n, ar, a);
+		this.targetDoc = targetDoc;
 
-									if (v !== null)
-										w.writeAttribute(a, v);
-								}
-							}
-						}
+		tinyMCE.themeURL = tinyMCE.baseURL + "/themes/" + this.settings.theme;
+		this.settings.themeurl = tinyMCE.themeURL;
 
-						// Keep type attribute
-						if (type && keep)
-							w.writeAttribute('_mce_type', type);
+		if (!replace_element) {
+			alert("Error: Could not find the target element.");
+			return false;
+		}
 
-						// Write text from script
-						if (nn === 'script' && tinymce.trim(n.innerHTML)) {
-							w.writeText('// '); // Padd it with a comment so it will parse on older browsers
-							w.writeCDATA(n.innerHTML.replace(/<!--|-->|<\[CDATA\[|\]\]>/g, '')); // Remove comments and cdata stuctures
-							hc = false;
-							break;
-						}
+		if (tos.getEditorTemplate)
+			editorTemplate = tos.getEditorTemplate(this.settings, this.editorId);
 
-						// Padd empty nodes with a  
-						if (ru.padd) {
-							// If it has only one bogus child, padd it anyway workaround for <td><br /></td> bug
-							if (hc && (cn = n.firstChild) && cn.nodeType === 1 && n.childNodes.length === 1) {
-								if (cn.hasAttribute ? cn.hasAttribute('_mce_bogus') : cn.getAttribute('_mce_bogus'))
-									w.writeText('\u00a0');
-							} else if (!hc)
-								w.writeText('\u00a0'); // No children then padd it
-						}
+		deltaWidth = editorTemplate.delta_width ? editorTemplate.delta_width : 0;
+		deltaHeight = editorTemplate.delta_height ? editorTemplate.delta_height : 0;
+		html = '<span id="' + this.editorId + '_parent" class="mceEditorContainer">' + editorTemplate.html;
 
-						break;
+		html = tinyMCE.replaceVar(html, "editor_id", this.editorId);
 
-					case 3: // Text
-						// Check if valid child
-						if (s.validate_children && t.elementName && !t.schema.isValid(t.elementName, '#text'))
-							return;
+		if (!this.settings.default_document)
+			this.settings.default_document = tinyMCE.baseURL + "/blank.htm";
 
-						return w.writeText(n.nodeValue);
+		this.settings.old_width = this.settings.width;
+		this.settings.old_height = this.settings.height;
 
-					case 4: // CDATA
-						return w.writeCDATA(n.nodeValue);
+		// Set default width, height
+		if (this.settings.width == -1)
+			this.settings.width = replace_element.offsetWidth;
 
-					case 8: // Comment
-						return w.writeComment(n.nodeValue);
-				}
-			} else if (n.nodeType == 1)
-				hc = n.hasChildNodes();
+		if (this.settings.height == -1)
+			this.settings.height = replace_element.offsetHeight;
 
-			if (hc && !closed) {
-				cn = n.firstChild;
+		// Try the style width
+		if (this.settings.width == 0)
+			this.settings.width = replace_element.style.width;
 
-				while (cn) {
-					t._serializeNode(cn);
-					t.elementName = nn;
-					cn = cn.nextSibling;
-				}
-			}
+		// Try the style height
+		if (this.settings.height == 0)
+			this.settings.height = replace_element.style.height; 
 
-			// Write element end
-			if (!iv) {
-				if (!closed)
-					w.writeFullEndElement();
-				else
-					w.writeEndElement();
-			}
-		},
+		// If no width/height then default to 320x240, better than nothing
+		if (this.settings.width == 0)
+			this.settings.width = 320;
 
-		_protect : function(o) {
-			var t = this;
+		if (this.settings.height == 0)
+			this.settings.height = 240;
 
-			o.items = o.items || [];
+		this.settings.area_width = parseInt(this.settings.width);
+		this.settings.area_height = parseInt(this.settings.height);
+		this.settings.area_width += deltaWidth;
+		this.settings.area_height += deltaHeight;
+		this.settings.width_style = "" + this.settings.width;
+		this.settings.height_style = "" + this.settings.height;
 
-			function enc(s) {
-				return s.replace(/[\r\n\\]/g, function(c) {
-					if (c === '\n')
-						return '\\n';
-					else if (c === '\\')
-						return '\\\\';
+		// Special % handling
+		if (("" + this.settings.width).indexOf('%') != -1)
+			this.settings.area_width = "100%";
+		else
+			this.settings.width_style += 'px';
 
-					return '\\r';
-				});
-			};
+		if (("" + this.settings.height).indexOf('%') != -1)
+			this.settings.area_height = "100%";
+		else
+			this.settings.height_style += 'px';
 
-			function dec(s) {
-				return s.replace(/\\[\\rn]/g, function(c) {
-					if (c === '\\n')
-						return '\n';
-					else if (c === '\\\\')
-						return '\\';
+		if (("" + replace_element.style.width).indexOf('%') != -1) {
+			this.settings.width = replace_element.style.width;
+			this.settings.area_width = "100%";
+			this.settings.width_style = "100%";
+		}
 
-					return '\r';
-				});
-			};
+		if (("" + replace_element.style.height).indexOf('%') != -1) {
+			this.settings.height = replace_element.style.height;
+			this.settings.area_height = "100%";
+			this.settings.height_style = "100%";
+		}
 
-			each(o.patterns, function(p) {
-				o.content = dec(enc(o.content).replace(p.pattern, function(x, a, b, c) {
-					b = dec(b);
+		html = tinyMCE.applyTemplate(html);
 
-					if (p.encode)
-						b = t._encode(b);
+		this.settings.width = this.settings.old_width;
+		this.settings.height = this.settings.old_height;
 
-					o.items.push(b);
-					return a + '<!--mce:' + (o.items.length - 1) + '-->' + c;
-				}));
-			});
+		this.visualAid = this.settings.visual;
+		this.formTargetElementId = form_element_name;
 
-			return o;
-		},
+		// Get replace_element contents
+		if (replace_element.nodeName == "TEXTAREA" || replace_element.nodeName == "INPUT")
+			this.startContent = replace_element.value;
+		else
+			this.startContent = replace_element.innerHTML;
 
-		_unprotect : function(h, o) {
-			h = h.replace(/\<!--mce:([0-9]+)--\>/g, function(a, b) {
-				return o.items[parseInt(b)];
-			});
+		// If not text area or input
+		if (replace_element.nodeName != "TEXTAREA" && replace_element.nodeName != "INPUT") {
+			this.oldTargetElement = replace_element;
 
-			o.items = [];
+			// Debug mode
+			hc = '<input type="hidden" id="' + form_element_name + '" name="' + form_element_name + '" />';
+			this.oldTargetDisplay = tinyMCE.getStyle(this.oldTargetElement, 'display', 'inline');
+			this.oldTargetElement.style.display = "none";
 
-			return h;
-		},
+			html += '</span>';
 
-		_encode : function(h) {
-			var t = this, s = t.settings, l;
+			if (tinyMCE.isGecko)
+				html = hc + html;
+			else
+				html += hc;
 
-			// Entity encode
-			if (s.entity_encoding !== 'raw') {
-				if (s.entity_encoding.indexOf('named') != -1) {
-					t.setEntities(s.entities);
-					l = t.entityLookup;
+			// Output HTML and set editable
+			if (tinyMCE.isGecko) {
+				rng = replace_element.ownerDocument.createRange();
+				rng.setStartBefore(replace_element);
 
-					h = h.replace(/[\u007E-\uFFFF]/g, function(a) {
-						var v;
+				fragment = rng.createContextualFragment(html);
+				tinyMCE.insertAfter(fragment, replace_element);
+			} else
+				replace_element.insertAdjacentHTML("beforeBegin", html);
+		} else {
+			html += '</span>';
 
-						if (v = l[a])
-							a = '&' + v + ';';
+			// Just hide the textarea element
+			this.oldTargetElement = replace_element;
 
-						return a;
-					});
-				}
+			this.oldTargetDisplay = tinyMCE.getStyle(this.oldTargetElement, 'display', 'inline');
+			this.oldTargetElement.style.display = "none";
 
-				if (s.entity_encoding.indexOf('numeric') != -1) {
-					h = h.replace(/[\u007E-\uFFFF]/g, function(a) {
-						return '&#' + a.charCodeAt(0) + ';';
-					});
-				}
-			}
+			// Output HTML and set editable
+			if (tinyMCE.isGecko) {
+				rng = replace_element.ownerDocument.createRange();
+				rng.setStartBefore(replace_element);
 
-			return h;
-		},
+				fragment = rng.createContextualFragment(html);
+				tinyMCE.insertAfter(fragment, replace_element);
+			} else
+				replace_element.insertAdjacentHTML("beforeBegin", html);
+		}
 
-		_setup : function() {
-			var t = this, s = this.settings;
+		// Setup iframe
+		dynamicIFrame = false;
+		tElm = targetDoc.getElementById(this.editorId);
 
-			if (t.done)
-				return;
-
-			t.done = 1;
-
-			t.setRules(s.valid_elements);
-			t.addRules(s.extended_valid_elements);
-
-			if (s.invalid_elements)
-				t.invalidElementsRE = new RegExp('^(' + wildcardToRE(s.invalid_elements.replace(/,/g, '|').toLowerCase()) + ')$');
-
-			if (s.attrib_value_filter)
-				t.attribValueFilter = s.attribValueFilter;
-		},
-
-		_getAttrib : function(n, a, na) {
-			var i, v;
-
-			na = na || a.name;
-
-			if (a.forcedVal && (v = a.forcedVal)) {
-				if (v === '{$uid}')
-					return this.dom.uniqueId();
-
-				return v;
+		if (!tinyMCE.isIE) {
+			// Node case is preserved in XML strict mode
+			if (tElm && (tElm.nodeName == "SPAN" || tElm.nodeName == "span")) {
+				tElm = tinyMCE._createIFrame(tElm, targetDoc);
+				dynamicIFrame = true;
 			}
 
-			v = this.dom.getAttrib(n, na);
+			this.targetElement = tElm;
+			this.iframeElement = tElm;
+			this.contentDocument = tElm.contentDocument;
+			this.contentWindow = tElm.contentWindow;
 
-			switch (na) {
-				case 'rowspan':
-				case 'colspan':
-					// Whats the point? Remove usless attribute value
-					if (v == '1')
-						v = '';
+			//this.getDoc().designMode = "on";
+		} else {
+			if (tElm && tElm.nodeName == "SPAN")
+				tElm = tinyMCE._createIFrame(tElm, targetDoc, targetDoc.parentWindow);
+			else
+				tElm = targetDoc.frames[this.editorId];
 
-					break;
-			}
+			this.targetElement = tElm;
+			this.iframeElement = targetDoc.getElementById(this.editorId);
 
-			if (this.attribValueFilter)
-				v = this.attribValueFilter(na, v, n);
-
-			if (a.validVals) {
-				for (i = a.validVals.length - 1; i >= 0; i--) {
-					if (v == a.validVals[i])
-						break;
-				}
-
-				if (i == -1)
-					return null;
-			}
-
-			if (v === '' && typeof(a.defaultVal) != 'undefined') {
-				v = a.defaultVal;
-
-				if (v === '{$uid}')
-					return this.dom.uniqueId();
-
-				return v;
+			if (tinyMCE.isOpera) {
+				this.contentDocument = this.iframeElement.contentDocument;
+				this.contentWindow = this.iframeElement.contentWindow;
+				dynamicIFrame = true;
 			} else {
-				// Remove internal mceItemXX classes when content is extracted from editor
-				if (na == 'class' && this.processObj.get)
-					v = v.replace(/\s?mceItem\w+\s?/g, '');
+				this.contentDocument = tElm.window.document;
+				this.contentWindow = tElm.window;
 			}
 
-			if (v === '')
-				return null;
-
-
-			return v;
+			this.getDoc().designMode = "on";
 		}
-	});
-})(tinymce);
 
-(function(tinymce) {
-	tinymce.dom.ScriptLoader = function(settings) {
-		var QUEUED = 0,
-			LOADING = 1,
-			LOADED = 2,
-			states = {},
-			queue = [],
-			scriptLoadedCallbacks = {},
-			queueLoadedCallbacks = [],
-			loading = 0,
-			undefined;
+		// Setup base HTML
+		doc = this.contentDocument;
+		if (dynamicIFrame) {
+			html = tinyMCE.getParam('doctype') + '<html><head xmlns="http://www.w3.org/1999/xhtml"><base href="' + tinyMCE.settings.base_href + '" /><title>blank_page</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body class="mceContentBody"></body></html>';
 
-		function loadScript(url, callback) {
-			var t = this, dom = tinymce.DOM, elm, uri, loc, id;
+			try {
+				if (!this.isHidden())
+					this.getDoc().designMode = "on";
 
-			// Execute callback when script is loaded
-			function done() {
-				dom.remove(id);
-
-				if (elm)
-					elm.onreadystatechange = elm.onload = elm = null;
-
-				callback();
-			};
-
-			id = dom.uniqueId();
-
-			if (tinymce.isIE6) {
-				uri = new tinymce.util.URI(url);
-				loc = location;
-
-				// If script is from same domain and we
-				// use IE 6 then use XHR since it's more reliable
-				if (uri.host == loc.hostname && uri.port == loc.port && (uri.protocol + ':') == loc.protocol) {
-					tinymce.util.XHR.send({
-						url : tinymce._addVer(uri.getURI()),
-						success : function(content) {
-							// Create new temp script element
-							var script = dom.create('script', {
-								type : 'text/javascript'
-							});
-
-							// Evaluate script in global scope
-							script.text = content;
-							document.getElementsByTagName('head')[0].appendChild(script);
-							dom.remove(script);
-
-							done();
-						}
-					});
-
-					return;
-				}
+				doc.open();
+				doc.write(html);
+				doc.close();
+			} catch (e) {
+				// Failed Mozilla 1.3
+				this.getDoc().location.href = tinyMCE.baseURL + "/blank.htm";
 			}
+		}
 
-			// Create new script element
-			elm = dom.create('script', {
-				id : id,
-				type : 'text/javascript',
-				src : tinymce._addVer(url)
-			});
+		// This timeout is needed in MSIE 5.5 for some odd reason
+		// it seems that the document.frames isn't initialized yet?
+		if (tinyMCE.isIE)
+			window.setTimeout("tinyMCE.addEventHandlers(tinyMCE.instances[\"" + this.editorId + "\"]);", 1);
 
-			// Add onload and readystate listeners
-			elm.onload = done;
-			elm.onreadystatechange = function() {
-				var state = elm.readyState;
+		// Setup element references
+		parentElm = this.targetDoc.getElementById(this.editorId + '_parent');
+		this.formElement = tinyMCE.isGecko ? parentElm.previousSibling : parentElm.nextSibling;
 
-				// Loaded state is passed on IE 6 however there
-				// are known issues with this method but we can't use
-				// XHR in a cross domain loading
-				if (state == 'complete' || state == 'loaded')
-					done();
-			};
+		tinyMCE.setupContent(this.editorId, true);
 
-			// Most browsers support this feature so we report errors
-			// for those at least to help users track their missing plugins etc
-			// todo: Removed since it produced error if the document is unloaded by navigating away, re-add it as an option
-			/*elm.onerror = function() {
-				alert('Failed to load: ' + url);
-			};*/
+		return true;
+	},
 
-			// Add script to document
-			(document.getElementsByTagName('head')[0] || document.body).appendChild(elm);
-		};
+	setBaseHREF : function(u) {
+		var h, b, d, nl;
 
-		this.isDone = function(url) {
-			return states[url] == LOADED;
-		};
+		d = this.getDoc();
+		nl = d.getElementsByTagName("base");
+		b = nl.length > 0 ? nl[0] : null;
 
-		this.markDone = function(url) {
-			states[url] = LOADED;
-		};
+		if (!b) {
+			nl = d.getElementsByTagName("head");
+			h = nl.length > 0 ? nl[0] : null;
 
-		this.add = this.load = function(url, callback, scope) {
-			var item, state = states[url];
+			b = d.createElement("base");
+			b.setAttribute('href', u);
+			h.appendChild(b);
+		} else {
+			if (u == '' || u == null)
+				b.parentNode.removeChild(b);
+			else
+				b.setAttribute('href', u);
+		}
+	},
 
-			// Add url to load queue
-			if (state == undefined) {
-				queue.push(url);
-				states[url] = QUEUED;
-			}
+	getHTML : function(r) {
+		var h, d = this.getDoc(), b = this.getBody();
 
-			if (callback) {
-				// Store away callback for later execution
-				if (!scriptLoadedCallbacks[url])
-					scriptLoadedCallbacks[url] = [];
+		if (r)
+			return b.innerHTML;
 
-				scriptLoadedCallbacks[url].push({
-					func : callback,
-					scope : scope || this
-				});
-			}
-		};
+		h = tinyMCE._cleanupHTML(this, d, this.settings, b, false, true, false, true);
 
-		this.loadQueue = function(callback, scope) {
-			this.loadScripts(queue, callback, scope);
-		};
+		if (tinyMCE.getParam("convert_fonts_to_spans"))
+			tinyMCE.convertSpansToFonts(d);
 
-		this.loadScripts = function(scripts, callback, scope) {
-			var loadScripts;
+		return h;
+	},
 
-			function execScriptLoadedCallbacks(url) {
-				// Execute URL callback functions
-				tinymce.each(scriptLoadedCallbacks[url], function(callback) {
-					callback.func.call(callback.scope);
-				});
+	setHTML : function(h) {
+		this.execCommand('mceSetContent', false, h);
+		this.repaint();
+	},
 
-				scriptLoadedCallbacks[url] = undefined;
-			};
+	getFocusElement : function() {
+		return this.selection.getFocusElement();
+	},
 
-			queueLoadedCallbacks.push({
-				func : callback,
-				scope : scope || this
-			});
+	getSel : function() {
+		return this.selection.getSel();
+	},
 
-			loadScripts = function() {
-				var loadingScripts = tinymce.grep(scripts);
+	getRng : function() {
+		return this.selection.getRng();
+	},
 
-				// Current scripts has been handled
-				scripts.length = 0;
+	triggerSave : function(skip_cleanup, skip_callback) {
+		var e, nl = [], i, s, content, htm;
 
-				// Load scripts that needs to be loaded
-				tinymce.each(loadingScripts, function(url) {
-					// Script is already loaded then execute script callbacks directly
-					if (states[url] == LOADED) {
-						execScriptLoadedCallbacks(url);
-						return;
-					}
+		if (!this.enabled)
+			return;
 
-					// Is script not loading then start loading it
-					if (states[url] != LOADING) {
-						states[url] = LOADING;
-						loading++;
+		this.switchSettings();
+		s = tinyMCE.settings;
 
-						loadScript(url, function() {
-							states[url] = LOADED;
-							loading--;
+		// Force hidden tabs visible while serializing
+		if (tinyMCE.isRealIE) {
+			e = this.iframeElement;
 
-							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) {
-					tinymce.each(queueLoadedCallbacks, function(callback) {
-						callback.func.call(callback.scope);
-					});
-
-					queueLoadedCallbacks.length = 0;
+			do {
+				if (e.style && e.style.display == 'none') {
+					e.style.display = 'block';
+					nl[nl.length] = {elm : e, type : 'style'};
 				}
-			};
 
-			loadScripts();
-		};
-	};
-
-	// Global script loader
-	tinymce.ScriptLoader = new tinymce.dom.ScriptLoader();
-})(tinymce);
-
-tinymce.dom.TreeWalker = function(start_node, root_node) {
-	var node = start_node;
-
-	function findSibling(node, start_name, sibling_name, shallow) {
-		var sibling, parent;
-
-		if (node) {
-			// Walk into nodes if it has a start
-			if (!shallow && node[start_name])
-				return node[start_name];
-
-			// Return the sibling if it has one
-			if (node != root_node) {
-				sibling = node[sibling_name];
-				if (sibling)
-					return sibling;
-
-				// Walk up the parents to look for siblings
-				for (parent = node.parentNode; parent && parent != root_node; parent = parent.parentNode) {
-					sibling = parent[sibling_name];
-					if (sibling)
-						return sibling;
+				if (e.style && s.hidden_tab_class.length > 0 && e.className.indexOf(s.hidden_tab_class) != -1) {
+					e.className = s.display_tab_class;
+					nl[nl.length] = {elm : e, type : 'class'};
 				}
-			}
+			} while ((e = e.parentNode) != null)
 		}
-	};
 
-	this.current = function() {
-		return node;
-	};
+		tinyMCE.settings.preformatted = false;
 
-	this.next = function(shallow) {
-		return (node = findSibling(node, 'firstChild', 'nextSibling', shallow));
-	};
+		// Default to false
+		if (typeof(skip_cleanup) == "undefined")
+			skip_cleanup = false;
 
-	this.prev = function(shallow) {
-		return (node = findSibling(node, 'lastChild', 'lastSibling', shallow));
-	};
-};
+		// Default to false
+		if (typeof(skip_callback) == "undefined")
+			skip_callback = false;
 
-(function() {
-	var transitional = {};
+		tinyMCE._setHTML(this.getDoc(), this.getBody().innerHTML);
 
-	function unpack(lookup, data) {
-		var key;
-
-		function replace(value) {
-			return value.replace(/[A-Z]+/g, function(key) {
-				return replace(lookup[key]);
-			});
-		};
-
-		// Unpack lookup
-		for (key in lookup) {
-			if (lookup.hasOwnProperty(key))
-				lookup[key] = replace(lookup[key]);
+		// Remove visual aids when cleanup is disabled
+		if (this.settings.cleanup == false) {
+			tinyMCE.handleVisualAid(this.getBody(), true, false, this);
+			tinyMCE._setEventsEnabled(this.getBody(), true);
 		}
 
-		// Unpack and parse data into object map
-		replace(data).replace(/#/g, '#text').replace(/(\w+)\[([^\]]+)\]/g, function(str, name, children) {
-			var i, map = {};
+		tinyMCE._customCleanup(this, "submit_content_dom", this.contentWindow.document.body);
+		htm = skip_cleanup ? this.getBody().innerHTML : tinyMCE._cleanupHTML(this, this.getDoc(), this.settings, this.getBody(), tinyMCE.visualAid, true, true);
+		htm = tinyMCE._customCleanup(this, "submit_content", htm);
 
-			children = children.split(/\|/);
+		if (!skip_callback && tinyMCE.settings.save_callback !== '')
+			content = tinyMCE.resolveDots(tinyMCE.settings.save_callback, window)(this.formTargetElementId,htm,this.getBody());
 
-			for (i = children.length - 1; i >= 0; i--)
-				map[children[i]] = 1;
+		// Use callback content if available
+		if ((typeof(content) != "undefined") && content != null)
+			htm = content;
 
-			transitional[name] = map;
-		});
-	};
+		// Replace some weird entities (Bug: #1056343)
+		htm = tinyMCE.regexpReplace(htm, "(", "(", "gi");
+		htm = tinyMCE.regexpReplace(htm, ")", ")", "gi");
+		htm = tinyMCE.regexpReplace(htm, ";", ";", "gi");
+		htm = tinyMCE.regexpReplace(htm, """, """, "gi");
+		htm = tinyMCE.regexpReplace(htm, "^", "^", "gi");
 
-	// This is the XHTML 1.0 transitional elements with it's children packed to reduce it's size
-	// we will later include the attributes here and use it as a default for valid elements but it
-	// requires us to rewrite the serializer engine
-	unpack({
-		Z : '#|H|K|N|O|P',
-		Y : '#|X|form|R|Q',
-		X : 'p|T|div|U|W|isindex|fieldset|table',
-		W : 'pre|hr|blockquote|address|center|noframes',
-		U : 'ul|ol|dl|menu|dir',
-		ZC : '#|p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q',
-		T : 'h1|h2|h3|h4|h5|h6',
-		ZB : '#|X|S|Q',
-		S : 'R|P',
-		ZA : '#|a|G|J|M|O|P',
-		R : '#|a|H|K|N|O',
-		Q : 'noscript|P',
-		P : 'ins|del|script',
-		O : 'input|select|textarea|label|button',
-		N : 'M|L',
-		M : 'em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym',
-		L : 'sub|sup',
-		K : 'J|I',
-		J : 'tt|i|b|u|s|strike',
-		I : 'big|small|font|basefont',
-		H : 'G|F',
-		G : 'br|span|bdo',
-		F : 'object|applet|img|map|iframe'
-	}, 'script[]' + 
-		'style[]' + 
-		'object[#|param|X|form|a|H|K|N|O|Q]' + 
-		'param[]' + 
-		'p[S]' + 
-		'a[Z]' + 
-		'br[]' + 
-		'span[S]' + 
-		'bdo[S]' + 
-		'applet[#|param|X|form|a|H|K|N|O|Q]' + 
-		'h1[S]' + 
-		'img[]' + 
-		'map[X|form|Q|area]' + 
-		'h2[S]' + 
-		'iframe[#|X|form|a|H|K|N|O|Q]' + 
-		'h3[S]' + 
-		'tt[S]' + 
-		'i[S]' + 
-		'b[S]' + 
-		'u[S]' + 
-		's[S]' + 
-		'strike[S]' + 
-		'big[S]' + 
-		'small[S]' + 
-		'font[S]' + 
-		'basefont[]' + 
-		'em[S]' + 
-		'strong[S]' + 
-		'dfn[S]' + 
-		'code[S]' + 
-		'q[S]' + 
-		'samp[S]' + 
-		'kbd[S]' + 
-		'var[S]' + 
-		'cite[S]' + 
-		'abbr[S]' + 
-		'acronym[S]' + 
-		'sub[S]' + 
-		'sup[S]' + 
-		'input[]' + 
-		'select[optgroup|option]' + 
-		'optgroup[option]' + 
-		'option[]' + 
-		'textarea[]' + 
-		'label[S]' + 
-		'button[#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]' + 
-		'h4[S]' + 
-		'ins[#|X|form|a|H|K|N|O|Q]' + 
-		'h5[S]' + 
-		'del[#|X|form|a|H|K|N|O|Q]' + 
-		'h6[S]' + 
-		'div[#|X|form|a|H|K|N|O|Q]' + 
-		'ul[li]' + 
-		'li[#|X|form|a|H|K|N|O|Q]' + 
-		'ol[li]' + 
-		'dl[dt|dd]' + 
-		'dt[S]' + 
-		'dd[#|X|form|a|H|K|N|O|Q]' + 
-		'menu[li]' + 
-		'dir[li]' + 
-		'pre[ZA]' + 
-		'hr[]' + 
-		'blockquote[#|X|form|a|H|K|N|O|Q]' + 
-		'address[S|p]' + 
-		'center[#|X|form|a|H|K|N|O|Q]' + 
-		'noframes[#|X|form|a|H|K|N|O|Q]' + 
-		'isindex[]' + 
-		'fieldset[#|legend|X|form|a|H|K|N|O|Q]' + 
-		'legend[S]' + 
-		'table[caption|col|colgroup|thead|tfoot|tbody|tr]' + 
-		'caption[S]' + 
-		'col[]' + 
-		'colgroup[col]' + 
-		'thead[tr]' + 
-		'tr[th|td]' + 
-		'th[#|X|form|a|H|K|N|O|Q]' + 
-		'form[#|X|a|H|K|N|O|Q]' + 
-		'noscript[#|X|form|a|H|K|N|O|Q]' + 
-		'td[#|X|form|a|H|K|N|O|Q]' + 
-		'tfoot[tr]' + 
-		'tbody[tr]' + 
-		'area[]' + 
-		'base[]' + 
-		'body[#|X|form|a|H|K|N|O|Q]'
-	);
+		if (this.formElement)
+			this.formElement.value = htm;
 
-	tinymce.dom.Schema = function() {
-		var t = this, elements = transitional;
+		if (tinyMCE.isSafari && this.formElement)
+			this.formElement.innerText = htm;
 
-		t.isValid = function(name, child_name) {
-			var element = elements[name];
+		// Hide them again (tabs in MSIE)
+		for (i=0; i<nl.length; i++) {
+			if (nl[i].type == 'style')
+				nl[i].elm.style.display = 'none';
+			else
+				nl[i].elm.className = s.hidden_tab_class;
+		}
+	}
 
-			return !!(element && (!child_name || element[child_name]));
-		};
 	};
-})();
-(function(tinymce) {
-	tinymce.dom.RangeUtils = function(dom) {
-		var INVISIBLE_CHAR = '\uFEFF';
 
-		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;
+/* file:jscripts/tiny_mce/classes/TinyMCE_Cleanup.class.js */
 
-			// Handle table cell selection the table plugin enables
-			// you to fake select table cells and perform formatting actions on them
-			nodes = dom.select('td.mceSelected,th.mceSelected');
-			if (nodes.length > 0) {
-				tinymce.each(nodes, function(node) {
-					callback([node]);
-				});
+tinyMCE.add(TinyMCE_Engine, {
+	cleanupHTMLCode : function(s) {
+		s = s.replace(new RegExp('<p \\/>', 'gi'), '<p> </p>');
+		s = s.replace(new RegExp('<p>\\s*<\\/p>', 'gi'), '<p> </p>');
 
-				return;
-			}
+		// Fix close BR elements
+		s = s.replace(new RegExp('<br>\\s*<\\/br>', 'gi'), '<br />');
 
-			function collectSiblings(node, name, end_node) {
-				var siblings = [];
+		// Open closed tags like <b/> to <b></b>
+		s = s.replace(new RegExp('<(h[1-6]|p|div|address|pre|form|table|li|ol|ul|td|b|font|em|strong|i|strike|u|span|a|ul|ol|li|blockquote)([a-z]*)([^\\\\|>]*)\\/>', 'gi'), '<$1$2$3></$1$2>');
 
-				for (; node && node != end_node; node = node[name])
-					siblings.push(node);
+		// Remove trailing space <b > to <b>
+		s = s.replace(new RegExp('\\s+></', 'gi'), '></');
 
-				return siblings;
-			};
+		// Close tags <img></img> to <img/>
+		s = s.replace(new RegExp('<(img|br|hr)([^>]*)><\\/(img|br|hr)>', 'gi'), '<$1$2 />');
 
-			function findEndPoint(node, root) {
-				do {
-					if (node.parentNode == root)
-						return node;
+		// Weird MSIE bug, <p><hr /></p> breaks runtime?
+		if (tinyMCE.isIE)
+			s = s.replace(new RegExp('<p><hr \\/><\\/p>', 'gi'), "<hr>");
 
-					node = node.parentNode;
-				} while(node);
-			};
+		// Weird tags will make IE error #bug: 1538495
+		if (tinyMCE.isIE)
+			s = s.replace(/<!(\s*)\/>/g, '');
 
-			function walkBoundary(start_node, end_node, next) {
-				var siblingName = next ? 'nextSibling' : 'previousSibling';
+		// Convert relative anchors to absolute URLs ex: #something to file.htm#something
+		// Removed: Since local document anchors should never be forced absolute example edit.php?id=something
+		//if (tinyMCE.getParam('convert_urls'))
+		//	s = s.replace(new RegExp('(href=\"{0,1})(\\s*#)', 'gi'), '$1' + tinyMCE.settings.document_base_url + "#");
 
-				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);
+		return s;
+	},
 
-					if (siblings.length) {
-						if (!next)
-							siblings.reverse();
+	parseStyle : function(str) {
+		var ar = [], st, i, re, pa;
 
-						callback(siblings);
-					}
-				}
-			};
+		if (str == null)
+			return ar;
 
-			// If index based start position then resolve it
-			if (startContainer.nodeType == 1 && startContainer.hasChildNodes())
-				startContainer = startContainer.childNodes[startOffset];
+		st = str.split(';');
 
-			// If index based end position then resolve it
-			if (endContainer.nodeType == 1 && endContainer.hasChildNodes())
-				endContainer = endContainer.childNodes[Math.min(startOffset == endOffset ? endOffset : endOffset - 1, endContainer.childNodes.length - 1)];
+		tinyMCE.clearArray(ar);
 
-			// Find common ancestor and end points
-			ancestor = dom.findCommonAncestor(startContainer, endContainer);
+		for (i=0; i<st.length; i++) {
+			if (st[i] == '')
+				continue;
 
-			// Same container
-			if (startContainer == endContainer)
-				return callback([startContainer]);
+			re = new RegExp('^\\s*([^:]*):\\s*(.*)\\s*$');
+			pa = st[i].replace(re, '$1||$2').split('||');
+	//tinyMCE.debug(str, pa[0] + "=" + pa[1], st[i].replace(re, '$1||$2'));
+			if (pa.length == 2)
+				ar[pa[0].toLowerCase()] = pa[1];
+		}
 
-			// Process left side
-			for (node = startContainer; node; node = node.parentNode) {
-				if (node == endContainer)
-					return walkBoundary(startContainer, ancestor, true);
+		return ar;
+	},
 
-				if (node == ancestor)
-					break;
-			}
+	compressStyle : function(ar, pr, sf, res) {
+		var box = [], i, a;
 
-			// Process right side
-			for (node = endContainer; node; node = node.parentNode) {
-				if (node == startContainer)
-					return walkBoundary(endContainer, ancestor);
+		box[0] = ar[pr + '-top' + sf];
+		box[1] = ar[pr + '-left' + sf];
+		box[2] = ar[pr + '-right' + sf];
+		box[3] = ar[pr + '-bottom' + sf];
 
-				if (node == ancestor)
-					break;
-			}
+		for (i=0; i<box.length; i++) {
+			if (box[i] == null)
+				return;
 
-			// Find start/end point
-			startPoint = findEndPoint(startContainer, ancestor) || startContainer;
-			endPoint = findEndPoint(endContainer, ancestor) || endContainer;
+			if (i && box[i] != box[i-1])
+				return;
+		}
 
-			// Walk left leaf
-			walkBoundary(startContainer, startPoint, true);
+		// They are all the same
+		ar[res] = box[0];
+		ar[pr + '-top' + sf] = null;
+		ar[pr + '-left' + sf] = null;
+		ar[pr + '-right' + sf] = null;
+		ar[pr + '-bottom' + sf] = null;
+	},
 
-			// Walk the middle from start to end point
-			siblings = collectSiblings(
-				startPoint == startContainer ? startPoint : startPoint.nextSibling,
-				'nextSibling',
-				endPoint == endContainer ? endPoint.nextSibling : endPoint
-			);
+	serializeStyle : function(ar) {
+		var str = "", key, val, m;
 
-			if (siblings.length)
-				callback(siblings);
+		// Compress box
+		tinyMCE.compressStyle(ar, "border", "", "border");
+		tinyMCE.compressStyle(ar, "border", "-width", "border-width");
+		tinyMCE.compressStyle(ar, "border", "-color", "border-color");
+		tinyMCE.compressStyle(ar, "border", "-style", "border-style");
+		tinyMCE.compressStyle(ar, "padding", "", "padding");
+		tinyMCE.compressStyle(ar, "margin", "", "margin");
 
-			// Walk right leaf
-			walkBoundary(endContainer, endPoint);
-		};
+		for (key in ar) {
+			val = ar[key];
 
-		/*		this.split = function(rng) {
-			var startContainer = rng.startContainer,
-				startOffset = rng.startOffset,
-				endContainer = rng.endContainer,
-				endOffset = rng.endOffset;
+			if (typeof(val) == 'function')
+				continue;
 
-			function splitText(node, offset) {
-				if (offset == node.nodeValue.length)
-					node.appendData(INVISIBLE_CHAR);
+			if (key.indexOf('mso-') == 0)
+				continue;
 
-				node = node.splitText(offset);
+			if (val != null && val !== '') {
+				val = '' + val; // Force string
 
-				if (node.nodeValue === INVISIBLE_CHAR)
-					node.nodeValue = '';
+				// Fix style URL
+				val = val.replace(new RegExp("url\\(\\'?([^\\']*)\\'?\\)", 'gi'), "url('$1')");
 
-				return node;
-			};
+				// Convert URL
+				if (val.indexOf('url(') != -1 && tinyMCE.getParam('convert_urls')) {
+					m = new RegExp("url\\('(.*?)'\\)").exec(val);
 
-			// Handle single text node
-			if (startContainer == endContainer) {
-				if (startContainer.nodeType == 3) {
-					if (startOffset != 0)
-						startContainer = endContainer = splitText(startContainer, startOffset);
-
-					if (endOffset - startOffset != startContainer.nodeValue.length)
-						splitText(startContainer, endOffset - startOffset);
+					if (m.length > 1)
+						val = "url('" + eval(tinyMCE.getParam('urlconverter_callback') + "(m[1], null, true);") + "')";
 				}
-			} else {
-				// Split startContainer text node if needed
-				if (startContainer.nodeType == 3 && startOffset != 0) {
-					startContainer = splitText(startContainer, startOffset);
-					startOffset = 0;
-				}
 
-				// Split endContainer text node if needed
-				if (endContainer.nodeType == 3 && endOffset != endContainer.nodeValue.length) {
-					endContainer = splitText(endContainer, endOffset).previousSibling;
-					endOffset = endContainer.nodeValue.length;
-				}
-			}
+				// Force HEX colors
+				if (tinyMCE.getParam("force_hex_style_colors"))
+					val = tinyMCE.convertRGBToHex(val, true);
 
-			return {
-				startContainer : startContainer,
-				startOffset : startOffset,
-				endContainer : endContainer,
-				endOffset : endOffset
-			};
-		};
-*/
-	};
+				val = val.replace(/\"/g, '\'');
 
-	tinymce.dom.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;
+				if (val != "url('')")
+					str += key.toLowerCase() + ": " + val + "; ";
 			}
 		}
 
-		return false;
-	};
-})(tinymce);
+		if (new RegExp('; $').test(str))
+			str = str.substring(0, str.length - 2);
 
-(function(tinymce) {
-	// Shorten class names
-	var DOM = tinymce.DOM, is = tinymce.is;
+		return str;
+	},
 
-	tinymce.create('tinymce.ui.Control', {
-		Control : function(id, s) {
-			this.id = id;
-			this.settings = s = s || {};
-			this.rendered = false;
-			this.onRender = new tinymce.util.Dispatcher(this);
-			this.classPrefix = '';
-			this.scope = s.scope || this;
-			this.disabled = 0;
-			this.active = 0;
-		},
+	convertRGBToHex : function(s, k) {
+		var re, rgb;
 
-		setDisabled : function(s) {
-			var e;
+		if (s.toLowerCase().indexOf('rgb') != -1) {
+			re = new RegExp("(.*?)rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)(.*?)", "gi");
+			rgb = s.replace(re, "$1,$2,$3,$4,$5").split(',');
 
-			if (s != this.disabled) {
-				e = DOM.get(this.id);
+			if (rgb.length == 5) {
+				r = parseInt(rgb[1]).toString(16);
+				g = parseInt(rgb[2]).toString(16);
+				b = parseInt(rgb[3]).toString(16);
 
-				// Add accessibility title for unavailable actions
-				if (e && this.settings.unavailable_prefix) {
-					if (s) {
-						this.prevTitle = e.title;
-						e.title = this.settings.unavailable_prefix + ": " + e.title;
-					} else
-						e.title = this.prevTitle;
-				}
+				r = r.length == 1 ? '0' + r : r;
+				g = g.length == 1 ? '0' + g : g;
+				b = b.length == 1 ? '0' + b : b;
 
-				this.setState('Disabled', s);
-				this.setState('Enabled', !s);
-				this.disabled = s;
-			}
-		},
+				s = "#" + r + g + b;
 
-		isDisabled : function() {
-			return this.disabled;
-		},
-
-		setActive : function(s) {
-			if (s != this.active) {
-				this.setState('Active', s);
-				this.active = s;
+				if (k)
+					s = rgb[0] + s + rgb[4];
 			}
-		},
-
-		isActive : function() {
-			return this.active;
-		},
-
-		setState : function(c, s) {
-			var n = DOM.get(this.id);
-
-			c = this.classPrefix + c;
-
-			if (s)
-				DOM.addClass(n, c);
-			else
-				DOM.removeClass(n, c);
-		},
-
-		isRendered : function() {
-			return this.rendered;
-		},
-
-		renderHTML : function() {
-		},
-
-		renderTo : function(n) {
-			DOM.setHTML(n, this.renderHTML());
-		},
-
-		postRender : function() {
-			var t = this, b;
-
-			// Set pending states
-			if (is(t.disabled)) {
-				b = t.disabled;
-				t.disabled = -1;
-				t.setDisabled(b);
-			}
-
-			if (is(t.active)) {
-				b = t.active;
-				t.active = -1;
-				t.setActive(b);
-			}
-		},
-
-		remove : function() {
-			DOM.remove(this.id);
-			this.destroy();
-		},
-
-		destroy : function() {
-			tinymce.dom.Event.clear(this.id);
 		}
-	});
-})(tinymce);
-tinymce.create('tinymce.ui.Container:tinymce.ui.Control', {
-	Container : function(id, s) {
-		this.parent(id, s);
 
-		this.controls = [];
-
-		this.lookup = {};
+		return s;
 	},
 
-	add : function(c) {
-		this.lookup[c.id] = c;
-		this.controls.push(c);
+	convertHexToRGB : function(s) {
+		if (s.indexOf('#') != -1) {
+			s = s.replace(new RegExp('[^0-9A-F]', 'gi'), '');
+			return "rgb(" + parseInt(s.substring(0, 2), 16) + "," + parseInt(s.substring(2, 4), 16) + "," + parseInt(s.substring(4, 6), 16) + ")";
+		}
 
-		return c;
+		return s;
 	},
 
-	get : function(n) {
-		return this.lookup[n];
-	}
-});
+	convertSpansToFonts : function(doc) {
+		var s, i, size, fSize, x, fFace, fColor, sizes = tinyMCE.getParam('font_size_style_values').replace(/\s+/, '').split(',');
 
+		s = tinyMCE.selectElements(doc, 'span,font');
+		for (i=0; i<s.length; i++) {
+			size = tinyMCE.trim(s[i].style.fontSize).toLowerCase();
+			fSize = 0;
 
-tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
-	Separator : function(id, s) {
-		this.parent(id, s);
-		this.classPrefix = 'mceSeparator';
-	},
-
-	renderHTML : function() {
-		return tinymce.DOM.createHTML('span', {'class' : this.classPrefix});
-	}
-});
-
-(function(tinymce) {
-	var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, walk = tinymce.walk;
-
-	tinymce.create('tinymce.ui.MenuItem:tinymce.ui.Control', {
-		MenuItem : function(id, s) {
-			this.parent(id, s);
-			this.classPrefix = 'mceMenuItem';
-		},
-
-		setSelected : function(s) {
-			this.setState('Selected', s);
-			this.selected = s;
-		},
-
-		isSelected : function() {
-			return this.selected;
-		},
-
-		postRender : function() {
-			var t = this;
-			
-			t.parent();
-
-			// Set pending state
-			if (is(t.selected))
-				t.setSelected(t.selected);
-		}
-	});
-})(tinymce);
-
-(function(tinymce) {
-	var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, walk = tinymce.walk;
-
-	tinymce.create('tinymce.ui.Menu:tinymce.ui.MenuItem', {
-		Menu : function(id, s) {
-			var t = this;
-
-			t.parent(id, s);
-			t.items = {};
-			t.collapsed = false;
-			t.menuCount = 0;
-			t.onAddItem = new tinymce.util.Dispatcher(this);
-		},
-
-		expand : function(d) {
-			var t = this;
-
-			if (d) {
-				walk(t, function(o) {
-					if (o.expand)
-						o.expand();
-				}, 'items', t);
+			for (x=0; x<sizes.length; x++) {
+				if (sizes[x] == size) {
+					fSize = x + 1;
+					break;
+				}
 			}
 
-			t.collapsed = false;
-		},
-
-		collapse : function(d) {
-			var t = this;
-
-			if (d) {
-				walk(t, function(o) {
-					if (o.collapse)
-						o.collapse();
-				}, 'items', t);
+			if (fSize > 0) {
+				tinyMCE.setAttrib(s[i], 'size', fSize);
+				s[i].style.fontSize = '';
 			}
 
-			t.collapsed = true;
-		},
-
-		isCollapsed : function() {
-			return this.collapsed;
-		},
-
-		add : function(o) {
-			if (!o.settings)
-				o = new tinymce.ui.MenuItem(o.id || DOM.uniqueId(), o);
-
-			this.onAddItem.dispatch(this, o);
-
-			return this.items[o.id] = o;
-		},
-
-		addSeparator : function() {
-			return this.add({separator : true});
-		},
-
-		addMenu : function(o) {
-			if (!o.collapse)
-				o = this.createMenu(o);
-
-			this.menuCount++;
-
-			return this.add(o);
-		},
-
-		hasMenus : function() {
-			return this.menuCount !== 0;
-		},
-
-		remove : function(o) {
-			delete this.items[o.id];
-		},
-
-		removeAll : function() {
-			var t = this;
-
-			walk(t, function(o) {
-				if (o.removeAll)
-					o.removeAll();
-				else
-					o.remove();
-
-				o.destroy();
-			}, 'items', t);
-
-			t.items = {};
-		},
-
-		createMenu : function(o) {
-			var m = new tinymce.ui.Menu(o.id || DOM.uniqueId(), o);
-
-			m.onAddItem.add(this.onAddItem.dispatch, this.onAddItem);
-
-			return m;
-		}
-	});
-})(tinymce);
-(function(tinymce) {
-	var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, Event = tinymce.dom.Event, Element = tinymce.dom.Element;
-
-	tinymce.create('tinymce.ui.DropMenu:tinymce.ui.Menu', {
-		DropMenu : function(id, s) {
-			s = s || {};
-			s.container = s.container || DOM.doc.body;
-			s.offset_x = s.offset_x || 0;
-			s.offset_y = s.offset_y || 0;
-			s.vp_offset_x = s.vp_offset_x || 0;
-			s.vp_offset_y = s.vp_offset_y || 0;
-
-			if (is(s.icons) && !s.icons)
-				s['class'] += ' mceNoIcons';
-
-			this.parent(id, s);
-			this.onShowMenu = new tinymce.util.Dispatcher(this);
-			this.onHideMenu = new tinymce.util.Dispatcher(this);
-			this.classPrefix = 'mceMenu';
-		},
-
-		createMenu : function(s) {
-			var t = this, cs = t.settings, m;
-
-			s.container = s.container || cs.container;
-			s.parent = t;
-			s.constrain = s.constrain || cs.constrain;
-			s['class'] = s['class'] || cs['class'];
-			s.vp_offset_x = s.vp_offset_x || cs.vp_offset_x;
-			s.vp_offset_y = s.vp_offset_y || cs.vp_offset_y;
-			m = new tinymce.ui.DropMenu(s.id || DOM.uniqueId(), s);
-
-			m.onAddItem.add(t.onAddItem.dispatch, t.onAddItem);
-
-			return m;
-		},
-
-		update : function() {
-			var t = this, s = t.settings, tb = DOM.get('menu_' + t.id + '_tbl'), co = DOM.get('menu_' + t.id + '_co'), tw, th;
-
-			tw = s.max_width ? Math.min(tb.clientWidth, s.max_width) : tb.clientWidth;
-			th = s.max_height ? Math.min(tb.clientHeight, s.max_height) : tb.clientHeight;
-
-			if (!DOM.boxModel)
-				t.element.setStyles({width : tw + 2, height : th + 2});
-			else
-				t.element.setStyles({width : tw, height : th});
-
-			if (s.max_width)
-				DOM.setStyle(co, 'width', tw);
-
-			if (s.max_height) {
-				DOM.setStyle(co, 'height', th);
-
-				if (tb.clientHeight < s.max_height)
-					DOM.setStyle(co, 'overflow', 'hidden');
+			fFace = s[i].style.fontFamily;
+			if (fFace != null && fFace !== '') {
+				tinyMCE.setAttrib(s[i], 'face', fFace);
+				s[i].style.fontFamily = '';
 			}
-		},
 
-		showMenu : function(x, y, px) {
-			var t = this, s = t.settings, co, vp = DOM.getViewPort(), w, h, mx, my, ot = 2, dm, tb, cp = t.classPrefix;
-
-			t.collapse(1);
-
-			if (t.isMenuVisible)
-				return;
-
-			if (!t.rendered) {
-				co = DOM.add(t.settings.container, t.renderNode());
-
-				each(t.items, function(o) {
-					o.postRender();
-				});
-
-				t.element = new Element('menu_' + t.id, {blocker : 1, container : s.container});
-			} else
-				co = DOM.get('menu_' + t.id);
-
-			// Move layer out of sight unless it's Opera since it scrolls to top of page due to an bug
-			if (!tinymce.isOpera)
-				DOM.setStyles(co, {left : -0xFFFF , top : -0xFFFF});
-
-			DOM.show(co);
-			t.update();
-
-			x += s.offset_x || 0;
-			y += s.offset_y || 0;
-			vp.w -= 4;
-			vp.h -= 4;
-
-			// Move inside viewport if not submenu
-			if (s.constrain) {
-				w = co.clientWidth - ot;
-				h = co.clientHeight - ot;
-				mx = vp.x + vp.w;
-				my = vp.y + vp.h;
-
-				if ((x + s.vp_offset_x + w) > mx)
-					x = px ? px - w : Math.max(0, (mx - s.vp_offset_x) - w);
-
-				if ((y + s.vp_offset_y + h) > my)
-					y = Math.max(0, (my - s.vp_offset_y) - h);
+			fColor = s[i].style.color;
+			if (fColor != null && fColor !== '') {
+				tinyMCE.setAttrib(s[i], 'color', tinyMCE.convertRGBToHex(fColor));
+				s[i].style.color = '';
 			}
+		}
+	},
 
-			DOM.setStyles(co, {left : x , top : y});
-			t.element.update();
+	convertFontsToSpans : function(doc) {
+		var fsClasses, s, i, fSize, fFace, fColor, sizes = tinyMCE.getParam('font_size_style_values').replace(/\s+/, '').split(',');
 
-			t.isMenuVisible = 1;
-			t.mouseClickFunc = Event.add(co, 'click', function(e) {
-				var m;
+		fsClasses = tinyMCE.getParam('font_size_classes');
+		if (fsClasses !== '')
+			fsClasses = fsClasses.replace(/\s+/, '').split(',');
+		else
+			fsClasses = null;
 
-				e = e.target;
+		s = tinyMCE.selectElements(doc, 'span,font');
+		for (i=0; i<s.length; i++) {
+			fSize = tinyMCE.getAttrib(s[i], 'size');
+			fFace = tinyMCE.getAttrib(s[i], 'face');
+			fColor = tinyMCE.getAttrib(s[i], 'color');
 
-				if (e && (e = DOM.getParent(e, 'tr')) && !DOM.hasClass(e, cp + 'ItemSub')) {
-					m = t.items[e.id];
+			if (fSize !== '') {
+				fSize = parseInt(fSize);
 
-					if (m.isDisabled())
-						return;
-
-					dm = t;
-
-					while (dm) {
-						if (dm.hideMenu)
-							dm.hideMenu();
-
-						dm = dm.settings.parent;
-					}
-
-					if (m.settings.onclick)
-						m.settings.onclick(e);
-
-					return Event.cancel(e); // Cancel to fix onbeforeunload problem
+				if (fSize > 0 && fSize < 8) {
+					if (fsClasses != null)
+						tinyMCE.setAttrib(s[i], 'class', fsClasses[fSize-1]);
+					else
+						s[i].style.fontSize = sizes[fSize-1];
 				}
-			});
 
-			if (t.hasMenus()) {
-				t.mouseOverFunc = Event.add(co, 'mouseover', function(e) {
-					var m, r, mi;
-
-					e = e.target;
-					if (e && (e = DOM.getParent(e, 'tr'))) {
-						m = t.items[e.id];
-
-						if (t.lastMenu)
-							t.lastMenu.collapse(1);
-
-						if (m.isDisabled())
-							return;
-
-						if (e && DOM.hasClass(e, cp + 'ItemSub')) {
-							//p = DOM.getPos(s.container);
-							r = DOM.getRect(e);
-							m.showMenu((r.x + r.w - ot), r.y - ot, r.x);
-							t.lastMenu = m;
-							DOM.addClass(DOM.get(m.id).firstChild, cp + 'ItemActive');
-						}
-					}
-				});
+				s[i].removeAttribute('size');
 			}
 
-			t.onShowMenu.dispatch(t);
-
-			if (s.keyboard_focus) {
-				Event.add(co, 'keydown', t._keyHandler, t);
-				DOM.select('a', 'menu_' + t.id)[0].focus(); // Select first link
-				t._focusIdx = 0;
+			if (fFace !== '') {
+				s[i].style.fontFamily = fFace;
+				s[i].removeAttribute('face');
 			}
-		},
 
-		hideMenu : function(c) {
-			var t = this, co = DOM.get('menu_' + t.id), e;
-
-			if (!t.isMenuVisible)
-				return;
-
-			Event.remove(co, 'mouseover', t.mouseOverFunc);
-			Event.remove(co, 'click', t.mouseClickFunc);
-			Event.remove(co, 'keydown', t._keyHandler);
-			DOM.hide(co);
-			t.isMenuVisible = 0;
-
-			if (!c)
-				t.collapse(1);
-
-			if (t.element)
-				t.element.hide();
-
-			if (e = DOM.get(t.id))
-				DOM.removeClass(e.firstChild, t.classPrefix + 'ItemActive');
-
-			t.onHideMenu.dispatch(t);
-		},
-
-		add : function(o) {
-			var t = this, co;
-
-			o = t.parent(o);
-
-			if (t.isRendered && (co = DOM.get('menu_' + t.id)))
-				t._add(DOM.select('tbody', co)[0], o);
-
-			return o;
-		},
-
-		collapse : function(d) {
-			this.parent(d);
-			this.hideMenu(1);
-		},
-
-		remove : function(o) {
-			DOM.remove(o.id);
-			this.destroy();
-
-			return this.parent(o);
-		},
-
-		destroy : function() {
-			var t = this, co = DOM.get('menu_' + t.id);
-
-			Event.remove(co, 'mouseover', t.mouseOverFunc);
-			Event.remove(co, 'click', t.mouseClickFunc);
-
-			if (t.element)
-				t.element.remove();
-
-			DOM.remove(co);
-		},
-
-		renderNode : function() {
-			var t = this, s = t.settings, n, tb, co, w;
-
-			w = DOM.create('div', {id : 'menu_' + t.id, 'class' : s['class'], 'style' : 'position:absolute;left:0;top:0;z-index:200000'});
-			co = DOM.add(w, 'div', {id : 'menu_' + t.id + '_co', 'class' : t.classPrefix + (s['class'] ? ' ' + s['class'] : '')});
-			t.element = new Element('menu_' + t.id, {blocker : 1, container : s.container});
-
-			if (s.menu_line)
-				DOM.add(co, 'span', {'class' : t.classPrefix + 'Line'});
-
-//			n = DOM.add(co, 'div', {id : 'menu_' + t.id + '_co', 'class' : 'mceMenuContainer'});
-			n = DOM.add(co, 'table', {id : 'menu_' + t.id + '_tbl', border : 0, cellPadding : 0, cellSpacing : 0});
-			tb = DOM.add(n, 'tbody');
-
-			each(t.items, function(o) {
-				t._add(tb, o);
-			});
-
-			t.rendered = true;
-
-			return w;
-		},
-
-		// Internal functions
-
-		_keyHandler : function(e) {
-			var t = this, kc = e.keyCode;
-
-			function focus(d) {
-				var i = t._focusIdx + d, e = DOM.select('a', 'menu_' + t.id)[i];
-
-				if (e) {
-					t._focusIdx = i;
-					e.focus();
-				}
-			};
-
-			switch (kc) {
-				case 38:
-					focus(-1); // Select first link
-					return;
-
-				case 40:
-					focus(1);
-					return;
-
-				case 13:
-					return;
-
-				case 27:
-					return this.hideMenu();
+			if (fColor !== '') {
+				s[i].style.color = fColor;
+				s[i].removeAttribute('color');
 			}
-		},
+		}
+	},
 
-		_add : function(tb, o) {
-			var n, s = o.settings, a, ro, it, cp = this.classPrefix, ic;
+	cleanupAnchors : function(doc) {
+		var i, cn, x, an = doc.getElementsByTagName("a");
 
-			if (s.separator) {
-				ro = DOM.add(tb, 'tr', {id : o.id, 'class' : cp + 'ItemSeparator'});
-				DOM.add(ro, 'td', {'class' : cp + 'ItemSeparator'});
+		// Loops backwards due to bug #1467987
+		for (i=an.length-1; i>=0; i--) {
+			if (tinyMCE.getAttrib(an[i], "name") !== '' && tinyMCE.getAttrib(an[i], "href") == '') {
+				cn = an[i].childNodes;
 
-				if (n = ro.previousSibling)
-					DOM.addClass(n, 'mceLast');
-
-				return;
+				for (x=cn.length-1; x>=0; x--)
+					tinyMCE.insertAfter(cn[x], an[i]);
 			}
-
-			n = ro = DOM.add(tb, 'tr', {id : o.id, 'class' : cp + 'Item ' + cp + 'ItemEnabled'});
-			n = it = DOM.add(n, 'td');
-			n = a = DOM.add(n, 'a', {href : 'javascript:;', onclick : "return false;", onmousedown : 'return false;'});
-
-			DOM.addClass(it, s['class']);
-//			n = DOM.add(n, 'span', {'class' : 'item'});
-
-			ic = DOM.add(n, 'span', {'class' : 'mceIcon' + (s.icon ? ' mce_' + s.icon : '')});
-
-			if (s.icon_src)
-				DOM.add(ic, 'img', {src : s.icon_src});
-
-			n = DOM.add(n, s.element || 'span', {'class' : 'mceText', title : o.settings.title}, o.settings.title);
-
-			if (o.settings.style)
-				DOM.setAttrib(n, 'style', o.settings.style);
-
-			if (tb.childNodes.length == 1)
-				DOM.addClass(ro, 'mceFirst');
-
-			if ((n = ro.previousSibling) && DOM.hasClass(n, cp + 'ItemSeparator'))
-				DOM.addClass(ro, 'mceFirst');
-
-			if (o.collapse)
-				DOM.addClass(ro, cp + 'ItemSub');
-
-			if (n = ro.previousSibling)
-				DOM.removeClass(n, 'mceLast');
-
-			DOM.addClass(ro, 'mceLast');
 		}
-	});
-})(tinymce);
-(function(tinymce) {
-	var DOM = tinymce.DOM;
+	},
 
-	tinymce.create('tinymce.ui.Button:tinymce.ui.Control', {
-		Button : function(id, s) {
-			this.parent(id, s);
-			this.classPrefix = 'mceButton';
-		},
+	getContent : function(editor_id) {
+		if (typeof(editor_id) != "undefined")
+			 tinyMCE.getInstanceById(editor_id).select();
 
-		renderHTML : function() {
-			var cp = this.classPrefix, s = this.settings, h, l;
+		if (tinyMCE.selectedInstance)
+			return tinyMCE.selectedInstance.getHTML();
 
-			l = DOM.encode(s.label || '');
-			h = '<a id="' + this.id + '" href="javascript:;" class="' + cp + ' ' + cp + 'Enabled ' + s['class'] + (l ? ' ' + cp + 'Labeled' : '') +'" onmousedown="return false;" onclick="return false;" title="' + DOM.encode(s.title) + '">';
+		return null;
+	},
 
-			if (s.image)
-				h += '<img class="mceIcon" src="' + s.image + '" />' + l + '</a>';
-			else
-				h += '<span class="mceIcon ' + s['class'] + '"></span>' + (l ? '<span class="' + cp + 'Label">' + l + '</span>' : '') + '</a>';
+	_fixListElements : function(d) {
+		var nl, x, a = ['ol', 'ul'], i, n, p, r = new RegExp('^(OL|UL)$'), np;
 
-			return h;
-		},
+		for (x=0; x<a.length; x++) {
+			nl = d.getElementsByTagName(a[x]);
 
-		postRender : function() {
-			var t = this, s = t.settings;
+			for (i=0; i<nl.length; i++) {
+				n = nl[i];
+				p = n.parentNode;
 
-			tinymce.dom.Event.add(t.id, 'click', function(e) {
-				if (!t.isDisabled())
-					return s.onclick.call(s.scope, e);
-			});
-		}
-	});
-})(tinymce);
+				if (r.test(p.nodeName)) {
+					np = tinyMCE.prevNode(n, 'LI');
 
-(function(tinymce) {
-	var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher;
-
-	tinymce.create('tinymce.ui.ListBox:tinymce.ui.Control', {
-		ListBox : function(id, s) {
-			var t = this;
-
-			t.parent(id, s);
-
-			t.items = [];
-
-			t.onChange = new Dispatcher(t);
-
-			t.onPostRender = new Dispatcher(t);
-
-			t.onAdd = new Dispatcher(t);
-
-			t.onRenderMenu = new tinymce.util.Dispatcher(this);
-
-			t.classPrefix = 'mceListBox';
-		},
-
-		select : function(va) {
-			var t = this, fv, f;
-
-			if (va == undefined)
-				return t.selectByIndex(-1);
-
-			// Is string or number make function selector
-			if (va && va.call)
-				f = va;
-			else {
-				f = function(v) {
-					return v == va;
-				};
-			}
-
-			// Do we need to do something?
-			if (va != t.selectedValue) {
-				// Find item
-				each(t.items, function(o, i) {
-					if (f(o.value)) {
-						fv = 1;
-						t.selectByIndex(i);
-						return false;
-					}
-				});
-
-				if (!fv)
-					t.selectByIndex(-1);
-			}
-		},
-
-		selectByIndex : function(idx) {
-			var t = this, e, o;
-
-			if (idx != t.selectedIndex) {
-				e = DOM.get(t.id + '_text');
-				o = t.items[idx];
-
-				if (o) {
-					t.selectedValue = o.value;
-					t.selectedIndex = idx;
-					DOM.setHTML(e, DOM.encode(o.title));
-					DOM.removeClass(e, 'mceTitle');
-				} else {
-					DOM.setHTML(e, DOM.encode(t.settings.title));
-					DOM.addClass(e, 'mceTitle');
-					t.selectedValue = t.selectedIndex = null;
+					if (!np) {
+						np = d.createElement('li');
+						np.innerHTML = ' ';
+						np.appendChild(n);
+						p.insertBefore(np, p.firstChild);
+					} else
+						np.appendChild(n);
 				}
-
-				e = 0;
 			}
-		},
+		}
+	},
 
-		add : function(n, v, o) {
-			var t = this;
+	_fixTables : function(d) {
+		var nl, i, n, p, np, x, t;
 
-			o = o || {};
-			o = tinymce.extend(o, {
-				title : n,
-				value : v
-			});
+		nl = d.getElementsByTagName('table');
+		for (i=0; i<nl.length; i++) {
+			n = nl[i];
 
-			t.items.push(o);
-			t.onAdd.dispatch(t, o);
-		},
+			if ((p = tinyMCE.getParentElement(n, 'p,h1,h2,h3,h4,h5,h6')) != null) {
+				np = p.cloneNode(false);
+				np.removeAttribute('id');
 
-		getLength : function() {
-			return this.items.length;
-		},
+				t = n;
 
-		renderHTML : function() {
-			var h = '', t = this, s = t.settings, cp = t.classPrefix;
+				while ((n = n.nextSibling))
+					np.appendChild(n);
 
-			h = '<table id="' + t.id + '" cellpadding="0" cellspacing="0" class="' + cp + ' ' + cp + 'Enabled' + (s['class'] ? (' ' + s['class']) : '') + '"><tbody><tr>';
-			h += '<td>' + DOM.createHTML('a', {id : t.id + '_text', href : 'javascript:;', 'class' : 'mceText', onclick : "return false;", onmousedown : 'return false;'}, DOM.encode(t.settings.title)) + '</td>';
-			h += '<td>' + DOM.createHTML('a', {id : t.id + '_open', tabindex : -1, href : 'javascript:;', 'class' : 'mceOpen', onclick : "return false;", onmousedown : 'return false;'}, '<span></span>') + '</td>';
-			h += '</tr></tbody></table>';
-
-			return h;
-		},
-
-		showMenu : function() {
-			var t = this, p1, p2, e = DOM.get(this.id), m;
-
-			if (t.isDisabled() || t.items.length == 0)
-				return;
-
-			if (t.menu && t.menu.isMenuVisible)
-				return t.hideMenu();
-
-			if (!t.isMenuRendered) {
-				t.renderMenu();
-				t.isMenuRendered = true;
+				tinyMCE.insertAfter(np, p);
+				tinyMCE.insertAfter(t, p);
 			}
+		}
+	},
 
-			p1 = DOM.getPos(this.settings.menu_container);
-			p2 = DOM.getPos(e);
+	_cleanupHTML : function(inst, doc, config, elm, visual, on_save, on_submit, inn) {
+		var h, d, t1, t2, t3, t4, t5, c, s, nb;
 
-			m = t.menu;
-			m.settings.offset_x = p2.x;
-			m.settings.offset_y = p2.y;
-			m.settings.keyboard_focus = !tinymce.isOpera; // Opera is buggy when it comes to auto focus
+		if (!tinyMCE.getParam('cleanup'))
+			return elm.innerHTML;
 
-			// Select in menu
-			if (t.oldID)
-				m.items[t.oldID].setSelected(0);
+		on_save = typeof(on_save) == 'undefined' ? false : on_save;
 
-			each(t.items, function(o) {
-				if (o.value === t.selectedValue) {
-					m.items[o.id].setSelected(1);
-					t.oldID = o.id;
-				}
-			});
+		c = inst.cleanup;
+		s = inst.settings;
+		d = c.settings.debug;
 
-			m.showMenu(0, e.clientHeight);
+		if (d)
+			t1 = new Date().getTime();
 
-			Event.add(DOM.doc, 'mousedown', t.hideMenu, t);
-			DOM.addClass(t.id, t.classPrefix + 'Selected');
+		inst._fixRootBlocks();
 
-			//DOM.get(t.id + '_text').focus();
-		},
+		if (tinyMCE.getParam("convert_fonts_to_spans"))
+			tinyMCE.convertFontsToSpans(doc);
 
-		hideMenu : function(e) {
-			var t = this;
+		if (tinyMCE.getParam("fix_list_elements"))
+			tinyMCE._fixListElements(doc);
 
-			if (t.menu && t.menu.isMenuVisible) {
-				// Prevent double toogles by canceling the mouse click event to the button
-				if (e && e.type == "mousedown" && (e.target.id == t.id + '_text' || e.target.id == t.id + '_open'))
-					return;
+		if (tinyMCE.getParam("fix_table_elements"))
+			tinyMCE._fixTables(doc);
 
-				if (!e || !DOM.getParent(e.target, '.mceMenu')) {
-					DOM.removeClass(t.id, t.classPrefix + 'Selected');
-					Event.remove(DOM.doc, 'mousedown', t.hideMenu, t);
-					t.menu.hideMenu();
-				}
-			}
-		},
+		// Call custom cleanup code
+		tinyMCE._customCleanup(inst, on_save ? "get_from_editor_dom" : "insert_to_editor_dom", doc.body);
 
-		renderMenu : function() {
-			var t = this, m;
+		if (d)
+			t2 = new Date().getTime();
 
-			m = t.settings.control_manager.createDropMenu(t.id + '_menu', {
-				menu_line : 1,
-				'class' : t.classPrefix + 'Menu mceNoIcons',
-				max_width : 150,
-				max_height : 150
-			});
+		c.settings.on_save = on_save;
 
-			m.onHideMenu.add(t.hideMenu, t);
+		c.idCount = 0;
+		c.serializationId++; // Unique ID needed for the content duplication bug
+		c.serializedNodes = [];
+		c.sourceIndex = -1;
 
-			m.add({
-				title : t.settings.title,
-				'class' : 'mceMenuItemTitle',
-				onclick : function() {
-					if (t.settings.onselect('') !== false)
-						t.select(''); // Must be runned after
-				}
-			});
+		if (s.cleanup_serializer == "xml")
+			h = c.serializeNodeAsXML(elm, inn);
+		else
+			h = c.serializeNodeAsHTML(elm, inn);
 
-			each(t.items, function(o) {
-				// No value then treat it as a title
-				if (o.value === undefined) {
-					m.add({
-						title : o.title,
-						'class' : 'mceMenuItemTitle',
-						onclick : function() {
-							if (t.settings.onselect('') !== false)
-								t.select(''); // Must be runned after
-						}
-					});
-				} else {
-					o.id = DOM.uniqueId();
-					o.onclick = function() {
-						if (t.settings.onselect(o.value) !== false)
-							t.select(o.value); // Must be runned after
-					};
+		if (d)
+			t3 = new Date().getTime();
 
-					m.add(o);
-				}
-			});
+		// Post processing
+		nb = tinyMCE.getParam('entity_encoding') == 'numeric' ? ' ' : ' ';
+		h = h.replace(/<\/?(body|head|html)[^>]*>/gi, '');
+		h = h.replace(new RegExp(' (rowspan="1"|colspan="1")', 'g'), '');
+		h = h.replace(/<p><hr \/><\/p>/g, '<hr />');
+		h = h.replace(/<p>( | )<\/p><hr \/><p>( | )<\/p>/g, '<hr />');
+		h = h.replace(/<td>\s*<br \/>\s*<\/td>/g, '<td>' + nb + '</td>');
+		h = h.replace(/<p>\s*<br \/>\s*<\/p>/g, '<p>' + nb + '</p>');
+		h = h.replace(/<br \/>$/, ''); // Remove last BR for Gecko
+		h = h.replace(/<br \/><\/p>/g, '</p>'); // Remove last BR in P tags for Gecko
+		h = h.replace(/<p>\s*( | )\s*<br \/>\s*( | )\s*<\/p>/g, '<p>' + nb + '</p>');
+		h = h.replace(/<p>\s*( | )\s*<br \/>\s*<\/p>/g, '<p>' + nb + '</p>');
+		h = h.replace(/<p>\s*<br \/>\s* \s*<\/p>/g, '<p>' + nb + '</p>');
+		h = h.replace(new RegExp('<a>(.*?)<\\/a>', 'g'), '$1');
+		h = h.replace(/<p([^>]*)>\s*<\/p>/g, '<p$1>' + nb + '</p>');
 
-			t.onRenderMenu.dispatch(t, m);
-			t.menu = m;
-		},
+		// Clean body
+		if (/^\s*(<br \/>|<p> <\/p>|<p> <\/p>|<p><\/p>)\s*$/.test(h))
+			h = '';
 
-		postRender : function() {
-			var t = this, cp = t.classPrefix;
+		// If preformatted
+		if (s.preformatted) {
+			h = h.replace(/^<pre>/, '');
+			h = h.replace(/<\/pre>$/, '');
+			h = '<pre>' + h + '</pre>';
+		}
 
-			Event.add(t.id, 'click', t.showMenu, t);
-			Event.add(t.id + '_text', 'focus', function() {
-				if (!t._focused) {
-					t.keyDownHandler = Event.add(t.id + '_text', 'keydown', function(e) {
-						var idx = -1, v, kc = e.keyCode;
+		// Gecko specific processing
+		if (tinyMCE.isGecko) {
+			// Makes no sence but FF generates it!!
+			h = h.replace(/<br \/>\s*<\/li>/g, '</li>');
+			h = h.replace(/ \s*<\/(dd|dt)>/g, '</$1>');
+			h = h.replace(/<o:p _moz-userdefined="" \/>/g, '');
+			h = h.replace(/<td([^>]*)>\s*<br \/>\s*<\/td>/g, '<td$1>' + nb + '</td>');
+		}
 
-						// Find current index
-						each(t.items, function(v, i) {
-							if (t.selectedValue == v.value)
-								idx = i;
-						});
+		if (s.force_br_newlines)
+			h = h.replace(/<p>( | )<\/p>/g, '<br />');
 
-						// Move up/down
-						if (kc == 38)
-							v = t.items[idx - 1];
-						else if (kc == 40)
-							v = t.items[idx + 1];
-						else if (kc == 13) {
-							// Fake select on enter
-							v = t.selectedValue;
-							t.selectedValue = null; // Needs to be null to fake change
-							t.settings.onselect(v);
-							return Event.cancel(e);
-						}
+		// Call custom cleanup code
+		h = tinyMCE._customCleanup(inst, on_save ? "get_from_editor" : "insert_to_editor", h);
 
-						if (v) {
-							t.hideMenu();
-							t.select(v.value);
-						}
-					});
-				}
-
-				t._focused = 1;
-			});
-			Event.add(t.id + '_text', 'blur', function() {Event.remove(t.id + '_text', 'keydown', t.keyDownHandler); t._focused = 0;});
-
-			// Old IE doesn't have hover on all elements
-			if (tinymce.isIE6 || !DOM.boxModel) {
-				Event.add(t.id, 'mouseover', function() {
-					if (!DOM.hasClass(t.id, cp + 'Disabled'))
-						DOM.addClass(t.id, cp + 'Hover');
-				});
-
-				Event.add(t.id, 'mouseout', function() {
-					if (!DOM.hasClass(t.id, cp + 'Disabled'))
-						DOM.removeClass(t.id, cp + 'Hover');
-				});
-			}
-
-			t.onPostRender.dispatch(t, DOM.get(t.id));
-		},
-
-		destroy : function() {
-			this.parent();
-
-			Event.clear(this.id + '_text');
-			Event.clear(this.id + '_open');
+		// Remove internal classes
+		if (on_save) {
+			h = h.replace(new RegExp(' ?(mceItem[a-zA-Z0-9]*|' + s.visual_table_class + ')', 'g'), '');
+			h = h.replace(new RegExp(' ?class=""', 'g'), '');
 		}
-	});
-})(tinymce);
-(function(tinymce) {
-	var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher;
 
-	tinymce.create('tinymce.ui.NativeListBox:tinymce.ui.ListBox', {
-		NativeListBox : function(id, s) {
-			this.parent(id, s);
-			this.classPrefix = 'mceNativeListBox';
-		},
+		if (s.remove_linebreaks && !c.settings.indent)
+			h = h.replace(/\n|\r/g, ' ');
 
-		setDisabled : function(s) {
-			DOM.get(this.id).disabled = s;
-		},
+		if (d)
+			t4 = new Date().getTime();
 
-		isDisabled : function() {
-			return DOM.get(this.id).disabled;
-		},
+		if (on_save && c.settings.indent)
+			h = c.formatHTML(h);
 
-		select : function(va) {
-			var t = this, fv, f;
+		// If encoding (not recommended option)
+		if (on_submit && (s.encoding == "xml" || s.encoding == "html"))
+			h = c.xmlEncode(h);
 
-			if (va == undefined)
-				return t.selectByIndex(-1);
+		if (d)
+			t5 = new Date().getTime();
 
-			// Is string or number make function selector
-			if (va && va.call)
-				f = va;
-			else {
-				f = function(v) {
-					return v == va;
-				};
-			}
+		if (c.settings.debug)
+			tinyMCE.debug("Cleanup in ms: Pre=" + (t2-t1) + ", Serialize: " + (t3-t2) + ", Post: " + (t4-t3) + ", Format: " + (t5-t4) + ", Sum: " + (t5-t1) + ".");
 
-			// Do we need to do something?
-			if (va != t.selectedValue) {
-				// Find item
-				each(t.items, function(o, i) {
-					if (f(o.value)) {
-						fv = 1;
-						t.selectByIndex(i);
-						return false;
-					}
-				});
+		return h;
+	}
+});
 
-				if (!fv)
-					t.selectByIndex(-1);
-			}
-		},
+function TinyMCE_Cleanup() {
+	this.isIE = (navigator.appName == "Microsoft Internet Explorer");
+	this.rules = tinyMCE.clearArray([]);
 
-		selectByIndex : function(idx) {
-			DOM.get(this.id).selectedIndex = idx + 1;
-			this.selectedValue = this.items[idx] ? this.items[idx].value : null;
-		},
+	// Default config
+	this.settings = {
+		indent_elements : 'head,table,tbody,thead,tfoot,form,tr,ul,ol,blockquote,object',
+		newline_before_elements : 'h1,h2,h3,h4,h5,h6,pre,address,div,ul,ol,li,meta,option,area,title,link,base,script,td',
+		newline_after_elements : 'br,hr,p,pre,address,div,ul,ol,meta,option,area,link,base,script',
+		newline_before_after_elements : 'html,head,body,table,thead,tbody,tfoot,tr,form,ul,ol,blockquote,p,object,param,hr,div',
+		indent_char : '\t',
+		indent_levels : 1,
+		entity_encoding : 'raw',
+		valid_elements : '*[*]',
+		entities : '',
+		url_converter : '',
+		invalid_elements : '',
+		verify_html : false
+	};
 
-		add : function(n, v, a) {
-			var o, t = this;
+	this.vElements = tinyMCE.clearArray([]);
+	this.vElementsRe = '';
+	this.closeElementsRe = /^(IMG|BR|HR|LINK|META|BASE|INPUT|AREA)$/;
+	this.codeElementsRe = /^(SCRIPT|STYLE)$/;
+	this.serializationId = 0;
+	this.mceAttribs = {
+		href : 'mce_href',
+		src : 'mce_src',
+		type : 'mce_type'
+	};
+}
 
-			a = a || {};
-			a.value = v;
+TinyMCE_Cleanup.prototype = {
+	init : function(s) {
+		var n, a, i, ir, or, st;
 
-			if (t.isRendered())
-				DOM.add(DOM.get(this.id), 'option', a, n);
+		for (n in s)
+			this.settings[n] = s[n];
 
-			o = {
-				title : n,
-				value : v,
-				attribs : a
-			};
+		// Setup code formating
+		s = this.settings;
 
-			t.items.push(o);
-			t.onAdd.dispatch(t, o);
-		},
+		// Setup regexps
+		this.inRe = this._arrayToRe(s.indent_elements.split(','), '', '^<(', ')[^>]*');
+		this.ouRe = this._arrayToRe(s.indent_elements.split(','), '', '^<\\/(', ')[^>]*');
+		this.nlBeforeRe = this._arrayToRe(s.newline_before_elements.split(','), 'gi', '<(',  ')([^>]*)>');
+		this.nlAfterRe = this._arrayToRe(s.newline_after_elements.split(','), 'gi', '<(',  ')([^>]*)>');
+		this.nlBeforeAfterRe = this._arrayToRe(s.newline_before_after_elements.split(','), 'gi', '<(\\/?)(', ')([^>]*)>');
+		this.serializedNodes = [];
+		this.serializationId = 0;
 
-		getLength : function() {
-			return this.items.length;
-		},
+		if (s.invalid_elements !== '')
+			this.iveRe = this._arrayToRe(s.invalid_elements.toUpperCase().split(','), 'g', '^(', ')$');
+		else
+			this.iveRe = null;
 
-		renderHTML : function() {
-			var h, t = this;
+		// Setup separator
+		st = '';
+		for (i=0; i<s.indent_levels; i++)
+			st += s.indent_char;
 
-			h = DOM.createHTML('option', {value : ''}, '-- ' + t.settings.title + ' --');
+		this.inStr = st;
 
-			each(t.items, function(it) {
-				h += DOM.createHTML('option', {value : it.value}, it.title);
-			});
+		// If verify_html if false force *[*]
+		if (!s.verify_html) {
+			s.valid_elements = '*[*]';
+			s.extended_valid_elements = '';
+		}
 
-			h = DOM.createHTML('select', {id : t.id, 'class' : 'mceNativeListBox'}, h);
+		this.fillStr = s.entity_encoding == "named" ? " " : " ";
+		this.idCount = 0;
+		this.xmlEncodeRe = new RegExp('[\u007F-\uFFFF<>&"]', 'g');
+	},
 
-			return h;
-		},
+	addRuleStr : function(s) {
+		var r = this.parseRuleStr(s), n;
 
-		postRender : function() {
-			var t = this, ch;
+		for (n in r) {
+			if (r[n])
+				this.rules[n] = r[n];
+		}
 
-			t.rendered = true;
+		this.vElements = tinyMCE.clearArray([]);
 
-			function onChange(e) {
-				var v = t.items[e.target.selectedIndex - 1];
-
-				if (v && (v = v.value)) {
-					t.onChange.dispatch(t, v);
-
-					if (t.settings.onselect)
-						t.settings.onselect(v);
-				}
-			};
-
-			Event.add(t.id, 'change', onChange);
-
-			// Accessibility keyhandler
-			Event.add(t.id, 'keydown', function(e) {
-				var bf;
-
-				Event.remove(t.id, 'change', ch);
-
-				bf = Event.add(t.id, 'blur', function() {
-					Event.add(t.id, 'change', onChange);
-					Event.remove(t.id, 'blur', bf);
-				});
-
-				if (e.keyCode == 13 || e.keyCode == 32) {
-					onChange(e);
-					return Event.cancel(e);
-				}
-			});
-
-			t.onPostRender.dispatch(t, DOM.get(t.id));
+		for (n in this.rules) {
+			if (this.rules[n])
+				this.vElements[this.vElements.length] = this.rules[n].tag;
 		}
-	});
-})(tinymce);
-(function(tinymce) {
-	var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each;
 
-	tinymce.create('tinymce.ui.MenuButton:tinymce.ui.Button', {
-		MenuButton : function(id, s) {
-			this.parent(id, s);
+		this.vElementsRe = this._arrayToRe(this.vElements, '');
+	},
 
-			this.onRenderMenu = new tinymce.util.Dispatcher(this);
+	isValid : function(n) {
+		if (!this.rulesDone)
+			this._setupRules(); // Will initialize cleanup rules
 
-			s.menu_container = s.menu_container || DOM.doc.body;
-		},
+		// Empty is true since it removes formatting
+		if (!n)
+			return true;
 
-		showMenu : function() {
-			var t = this, p1, p2, e = DOM.get(t.id), m;
+		// Clean the name up a bit
+		n = n.replace(/[^a-z0-9]+/gi, '').toUpperCase();
 
-			if (t.isDisabled())
-				return;
+		return !tinyMCE.getParam('cleanup') || this.vElementsRe.test(n);
+	},
 
-			if (!t.isMenuRendered) {
-				t.renderMenu();
-				t.isMenuRendered = true;
-			}
+	addChildRemoveRuleStr : function(s) {
+		var x, y, p, i, t, tn, ta, cl, r;
 
-			if (t.isMenuVisible)
-				return t.hideMenu();
+		if (!s)
+			return;
 
-			p1 = DOM.getPos(t.settings.menu_container);
-			p2 = DOM.getPos(e);
+		ta = s.split(',');
+		for (x=0; x<ta.length; x++) {
+			s = ta[x];
 
-			m = t.menu;
-			m.settings.offset_x = p2.x;
-			m.settings.offset_y = p2.y;
-			m.settings.vp_offset_x = p2.x;
-			m.settings.vp_offset_y = p2.y;
-			m.settings.keyboard_focus = t._focused;
-			m.showMenu(0, e.clientHeight);
+			// Split tag/children
+			p = this.split(/\[|\]/, s);
+			if (p == null || p.length < 1)
+				t = s.toUpperCase();
+			else
+				t = p[0].toUpperCase();
 
-			Event.add(DOM.doc, 'mousedown', t.hideMenu, t);
-			t.setState('Selected', 1);
+			// Handle all tag names
+			tn = this.split('/', t);
+			for (y=0; y<tn.length; y++) {
+				r = "^(";
 
-			t.isMenuVisible = 1;
-		},
+				// Build regex
+				cl = this.split(/\|/, p[1]);
+				for (i=0; i<cl.length; i++) {
+					if (cl[i] == '%istrict')
+						r += tinyMCE.inlineStrict;
+					else if (cl[i] == '%itrans')
+						r += tinyMCE.inlineTransitional;
+					else if (cl[i] == '%istrict_na')
+						r += tinyMCE.inlineStrict.substring(2);
+					else if (cl[i] == '%itrans_na')
+						r += tinyMCE.inlineTransitional.substring(2);
+					else if (cl[i] == '%btrans')
+						r += tinyMCE.blockElms;
+					else if (cl[i] == '%strict')
+						r += tinyMCE.blockStrict;
+					else
+						r += (cl[i].charAt(0) != '#' ? cl[i].toUpperCase() : cl[i]);
 
-		renderMenu : function() {
-			var t = this, m;
+					r += (i != cl.length - 1 ? '|' : '');
+				}
 
-			m = t.settings.control_manager.createDropMenu(t.id + '_menu', {
-				menu_line : 1,
-				'class' : this.classPrefix + 'Menu',
-				icons : t.settings.icons
-			});
+				r += ')$';
 
-			m.onHideMenu.add(t.hideMenu, t);
+				if (this.childRules == null)
+					this.childRules = tinyMCE.clearArray([]);
 
-			t.onRenderMenu.dispatch(t, m);
-			t.menu = m;
-		},
+				this.childRules[tn[y]] = new RegExp(r);
 
-		hideMenu : function(e) {
-			var t = this;
-
-			// Prevent double toogles by canceling the mouse click event to the button
-			if (e && e.type == "mousedown" && DOM.getParent(e.target, function(e) {return e.id === t.id || e.id === t.id + '_open';}))
-				return;
-
-			if (!e || !DOM.getParent(e.target, '.mceMenu')) {
-				t.setState('Selected', 0);
-				Event.remove(DOM.doc, 'mousedown', t.hideMenu, t);
-				if (t.menu)
-					t.menu.hideMenu();
+				if (p.length > 1)
+					this.childRules[tn[y]].wrapTag = p[2];
 			}
-
-			t.isMenuVisible = 0;
-		},
-
-		postRender : function() {
-			var t = this, s = t.settings;
-
-			Event.add(t.id, 'click', function() {
-				if (!t.isDisabled()) {
-					if (s.onclick)
-						s.onclick(t.value);
-
-					t.showMenu();
-				}
-			});
 		}
-	});
-})(tinymce);
+	},
 
-(function(tinymce) {
-	var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each;
+	parseRuleStr : function(s) {
+		var ta, p, r, a, i, x, px, t, tn, y, av, or = tinyMCE.clearArray([]), dv;
 
-	tinymce.create('tinymce.ui.SplitButton:tinymce.ui.MenuButton', {
-		SplitButton : function(id, s) {
-			this.parent(id, s);
-			this.classPrefix = 'mceSplitButton';
-		},
+		if (s == null || s.length == 0)
+			return or;
 
-		renderHTML : function() {
-			var h, t = this, s = t.settings, h1;
+		ta = s.split(',');
+		for (x=0; x<ta.length; x++) {
+			s = ta[x];
+			if (s.length == 0)
+				continue;
 
-			h = '<tbody><tr>';
-
-			if (s.image)
-				h1 = DOM.createHTML('img ', {src : s.image, 'class' : 'mceAction ' + s['class']});
+			// Split tag/attrs
+			p = this.split(/\[|\]/, s);
+			if (p == null || p.length < 1)
+				t = s.toUpperCase();
 			else
-				h1 = DOM.createHTML('span', {'class' : 'mceAction ' + s['class']}, '');
+				t = p[0].toUpperCase();
 
-			h += '<td>' + DOM.createHTML('a', {id : t.id + '_action', href : 'javascript:;', 'class' : 'mceAction ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + '</td>';
-	
-			h1 = DOM.createHTML('span', {'class' : 'mceOpen ' + s['class']});
-			h += '<td>' + DOM.createHTML('a', {id : t.id + '_open', href : 'javascript:;', 'class' : 'mceOpen ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + '</td>';
+			// Handle all tag names
+			tn = this.split('/', t);
+			for (y=0; y<tn.length; y++) {
+				r = {};
 
-			h += '</tr></tbody>';
+				r.tag = tn[y];
+				r.forceAttribs = null;
+				r.defaultAttribs = null;
+				r.validAttribValues = null;
 
-			return DOM.createHTML('table', {id : t.id, 'class' : 'mceSplitButton mceSplitButtonEnabled ' + s['class'], cellpadding : '0', cellspacing : '0', onmousedown : 'return false;', title : s.title}, h);
-		},
+				// Handle prefixes
+				px = r.tag.charAt(0);
+				r.forceOpen = px == '+';
+				r.removeEmpty = px == '-';
+				r.fill = px == '#';
+				r.tag = r.tag.replace(/\+|-|#/g, '');
+				r.oTagName = tn[0].replace(/\+|-|#/g, '').toLowerCase();
+				r.isWild = new RegExp('\\*|\\?|\\+', 'g').test(r.tag);
+				r.validRe = new RegExp(this._wildcardToRe('^' + r.tag + '$'));
 
-		postRender : function() {
-			var t = this, s = t.settings;
+				// Setup valid attributes
+				if (p.length > 1) {
+					r.vAttribsRe = '^(';
+					a = this.split(/\|/, p[1]);
 
-			if (s.onclick) {
-				Event.add(t.id + '_action', 'click', function() {
-					if (!t.isDisabled())
-						s.onclick(t.value);
-				});
-			}
+					for (i=0; i<a.length; i++) {
+						t = a[i];
 
-			Event.add(t.id + '_open', 'click', t.showMenu, t);
-			Event.add(t.id + '_open', 'focus', function() {t._focused = 1;});
-			Event.add(t.id + '_open', 'blur', function() {t._focused = 0;});
+						if (t.charAt(0) == '!') {
+							a[i] = t = t.substring(1);
 
-			// Old IE doesn't have hover on all elements
-			if (tinymce.isIE6 || !DOM.boxModel) {
-				Event.add(t.id, 'mouseover', function() {
-					if (!DOM.hasClass(t.id, 'mceSplitButtonDisabled'))
-						DOM.addClass(t.id, 'mceSplitButtonHover');
-				});
+							if (!r.reqAttribsRe)
+								r.reqAttribsRe = '\\s+(' + t;
+							else
+								r.reqAttribsRe += '|' + t;
+						}
 
-				Event.add(t.id, 'mouseout', function() {
-					if (!DOM.hasClass(t.id, 'mceSplitButtonDisabled'))
-						DOM.removeClass(t.id, 'mceSplitButtonHover');
-				});
-			}
-		},
+						av = new RegExp('(=|:|<)(.*?)$').exec(t);
+						t = t.replace(new RegExp('(=|:|<).*?$'), '');
+						if (av && av.length > 0) {
+							if (av[0].charAt(0) == ':') {
+								if (!r.forceAttribs)
+									r.forceAttribs = tinyMCE.clearArray([]);
 
-		destroy : function() {
-			this.parent();
+								r.forceAttribs[t.toLowerCase()] = av[0].substring(1);
+							} else if (av[0].charAt(0) == '=') {
+								if (!r.defaultAttribs)
+									r.defaultAttribs = tinyMCE.clearArray([]);
 
-			Event.clear(this.id + '_action');
-			Event.clear(this.id + '_open');
-		}
-	});
-})(tinymce);
+								dv = av[0].substring(1);
 
-(function(tinymce) {
-	var DOM = tinymce.DOM, Event = tinymce.dom.Event, is = tinymce.is, each = tinymce.each;
+								r.defaultAttribs[t.toLowerCase()] = dv == '' ? "mce_empty" : dv;
+							} else if (av[0].charAt(0) == '<') {
+								if (!r.validAttribValues)
+									r.validAttribValues = tinyMCE.clearArray([]);
 
-	tinymce.create('tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton', {
-		ColorSplitButton : function(id, s) {
-			var t = this;
+								r.validAttribValues[t.toLowerCase()] = this._arrayToRe(this.split('?', av[0].substring(1)), 'i');
+							}
+						}
 
-			t.parent(id, s);
+						r.vAttribsRe += '' + t.toLowerCase() + (i != a.length - 1 ? '|' : '');
 
-			t.settings = s = tinymce.extend({
-				colors : '000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF',
-				grid_width : 8,
-				default_color : '#888888'
-			}, t.settings);
+						a[i] = t.toLowerCase();
+					}
 
-			t.onShowMenu = new tinymce.util.Dispatcher(t);
+					if (r.reqAttribsRe)
+						r.reqAttribsRe = new RegExp(r.reqAttribsRe + ')=\"', 'g');
 
-			t.onHideMenu = new tinymce.util.Dispatcher(t);
+					r.vAttribsRe += ')$';
+					r.vAttribsRe = this._wildcardToRe(r.vAttribsRe);
+					r.vAttribsReIsWild = new RegExp('\\*|\\?|\\+', 'g').test(r.vAttribsRe);
+					r.vAttribsRe = new RegExp(r.vAttribsRe);
+					r.vAttribs = a.reverse();
 
-			t.value = s.default_color;
-		},
-
-		showMenu : function() {
-			var t = this, r, p, e, p2;
-
-			if (t.isDisabled())
-				return;
-
-			if (!t.isMenuRendered) {
-				t.renderMenu();
-				t.isMenuRendered = true;
-			}
-
-			if (t.isMenuVisible)
-				return t.hideMenu();
-
-			e = DOM.get(t.id);
-			DOM.show(t.id + '_menu');
-			DOM.addClass(e, 'mceSplitButtonSelected');
-			p2 = DOM.getPos(e);
-			DOM.setStyles(t.id + '_menu', {
-				left : p2.x,
-				top : p2.y + e.clientHeight,
-				zIndex : 200000
-			});
-			e = 0;
-
-			Event.add(DOM.doc, 'mousedown', t.hideMenu, t);
-			t.onShowMenu.dispatch(t);
-
-			if (t._focused) {
-				t._keyHandler = Event.add(t.id + '_menu', 'keydown', function(e) {
-					if (e.keyCode == 27)
-						t.hideMenu();
-				});
-
-				DOM.select('a', t.id + '_menu')[0].focus(); // Select first link
-			}
-
-			t.isMenuVisible = 1;
-		},
-
-		hideMenu : function(e) {
-			var t = this;
-
-			// Prevent double toogles by canceling the mouse click event to the button
-			if (e && e.type == "mousedown" && DOM.getParent(e.target, function(e) {return e.id === t.id + '_open';}))
-				return;
-
-			if (!e || !DOM.getParent(e.target, '.mceSplitButtonMenu')) {
-				DOM.removeClass(t.id, 'mceSplitButtonSelected');
-				Event.remove(DOM.doc, 'mousedown', t.hideMenu, t);
-				Event.remove(t.id + '_menu', 'keydown', t._keyHandler);
-				DOM.hide(t.id + '_menu');
-			}
-
-			t.onHideMenu.dispatch(t);
-
-			t.isMenuVisible = 0;
-		},
-
-		renderMenu : function() {
-			var t = this, m, i = 0, s = t.settings, n, tb, tr, w;
-
-			w = DOM.add(s.menu_container, 'div', {id : t.id + '_menu', 'class' : s['menu_class'] + ' ' + s['class'], style : 'position:absolute;left:0;top:-1000px;'});
-			m = DOM.add(w, 'div', {'class' : s['class'] + ' mceSplitButtonMenu'});
-			DOM.add(m, 'span', {'class' : 'mceMenuLine'});
-
-			n = DOM.add(m, 'table', {'class' : 'mceColorSplitMenu'});
-			tb = DOM.add(n, 'tbody');
-
-			// Generate color grid
-			i = 0;
-			each(is(s.colors, 'array') ? s.colors : s.colors.split(','), function(c) {
-				c = c.replace(/^#/, '');
-
-				if (!i--) {
-					tr = DOM.add(tb, 'tr');
-					i = s.grid_width - 1;
+					//tinyMCE.debug(r.tag, r.oTagName, r.vAttribsRe, r.vAttribsReWC);
+				} else {
+					r.vAttribsRe = '';
+					r.vAttribs = tinyMCE.clearArray([]);
+					r.vAttribsReIsWild = false;
 				}
 
-				n = DOM.add(tr, 'td');
-
-				n = DOM.add(n, 'a', {
-					href : 'javascript:;',
-					style : {
-						backgroundColor : '#' + c
-					},
-					_mce_color : '#' + c
-				});
-			});
-
-			if (s.more_colors_func) {
-				n = DOM.add(tb, 'tr');
-				n = DOM.add(n, 'td', {colspan : s.grid_width, 'class' : 'mceMoreColors'});
-				n = DOM.add(n, 'a', {id : t.id + '_more', href : 'javascript:;', onclick : 'return false;', 'class' : 'mceMoreColors'}, s.more_colors_title);
-
-				Event.add(n, 'click', function(e) {
-					s.more_colors_func.call(s.more_colors_scope || this);
-					return Event.cancel(e); // Cancel to fix onbeforeunload problem
-				});
+				or[r.tag] = r;
 			}
-
-			DOM.addClass(m, 'mceColorSplitMenu');
-
-			Event.add(t.id + '_menu', 'click', function(e) {
-				var c;
-
-				e = e.target;
-
-				if (e.nodeName == 'A' && (c = e.getAttribute('_mce_color')))
-					t.setColor(c);
-
-				return Event.cancel(e); // Prevent IE auto save warning
-			});
-
-			return w;
-		},
-
-		setColor : function(c) {
-			var t = this;
-
-			DOM.setStyle(t.id + '_preview', 'backgroundColor', c);
-
-			t.value = c;
-			t.hideMenu();
-			t.settings.onselect(c);
-		},
-
-		postRender : function() {
-			var t = this, id = t.id;
-
-			t.parent();
-			DOM.add(id + '_action', 'div', {id : id + '_preview', 'class' : 'mceColorPreview'});
-			DOM.setStyle(t.id + '_preview', 'backgroundColor', t.value);
-		},
-
-		destroy : function() {
-			this.parent();
-
-			Event.clear(this.id + '_menu');
-			Event.clear(this.id + '_more');
-			DOM.remove(this.id + '_menu');
 		}
-	});
-})(tinymce);
 
-tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
-	renderHTML : function() {
-		var t = this, h = '', c, co, dom = tinymce.DOM, s = t.settings, i, pr, nx, cl;
+		return or;
+	},
 
-		cl = t.controls;
-		for (i=0; i<cl.length; i++) {
-			// Get current control, prev control, next control and if the control is a list box or not
-			co = cl[i];
-			pr = cl[i - 1];
-			nx = cl[i + 1];
+	serializeNodeAsXML : function(n) {
+		var s, b;
 
-			// Add toolbar start
-			if (i === 0) {
-				c = 'mceToolbarStart';
+		if (!this.xmlDoc) {
+			if (this.isIE) {
+				try {this.xmlDoc = new ActiveXObject('MSXML2.DOMDocument');} catch (e) {}
 
-				if (co.Button)
-					c += ' mceToolbarStartButton';
-				else if (co.SplitButton)
-					c += ' mceToolbarStartSplitButton';
-				else if (co.ListBox)
-					c += ' mceToolbarStartListBox';
+				if (!this.xmlDoc)
+					try {this.xmlDoc = new ActiveXObject('Microsoft.XmlDom');} catch (e) {}
+			} else
+				this.xmlDoc = document.implementation.createDocument('', '', null);
 
-				h += dom.createHTML('td', {'class' : c}, dom.createHTML('span', null, '<!-- IE -->'));
-			}
-
-			// Add toolbar end before list box and after the previous button
-			// This is to fix the o2k7 editor skins
-			if (pr && co.ListBox) {
-				if (pr.Button || pr.SplitButton)
-					h += dom.createHTML('td', {'class' : 'mceToolbarEnd'}, dom.createHTML('span', null, '<!-- IE -->'));
-			}
-
-			// Render control HTML
-
-			// IE 8 quick fix, needed to propertly generate a hit area for anchors
-			if (dom.stdMode)
-				h += '<td style="position: relative">' + co.renderHTML() + '</td>';
-			else
-				h += '<td>' + co.renderHTML() + '</td>';
-
-			// Add toolbar start after list box and before the next button
-			// This is to fix the o2k7 editor skins
-			if (nx && co.ListBox) {
-				if (nx.Button || nx.SplitButton)
-					h += dom.createHTML('td', {'class' : 'mceToolbarStart'}, dom.createHTML('span', null, '<!-- IE -->'));
-			}
+			if (!this.xmlDoc)
+				alert("Error XML Parser could not be found.");
 		}
 
-		c = 'mceToolbarEnd';
+		if (this.xmlDoc.firstChild)
+			this.xmlDoc.removeChild(this.xmlDoc.firstChild);
 
-		if (co.Button)
-			c += ' mceToolbarEndButton';
-		else if (co.SplitButton)
-			c += ' mceToolbarEndSplitButton';
-		else if (co.ListBox)
-			c += ' mceToolbarEndListBox';
+		b = this.xmlDoc.createElement("html");
+		b = this.xmlDoc.appendChild(b);
 
-		h += dom.createHTML('td', {'class' : c}, dom.createHTML('span', null, '<!-- IE -->'));
+		this._convertToXML(n, b);
 
-		return dom.createHTML('table', {id : t.id, 'class' : 'mceToolbar' + (s['class'] ? ' ' + s['class'] : ''), cellpadding : '0', cellspacing : '0', align : t.settings.align || ''}, '<tbody><tr>' + h + '</tr></tbody>');
-	}
-});
+		if (this.isIE)
+			return this.xmlDoc.xml;
+		else
+			return new XMLSerializer().serializeToString(this.xmlDoc);
+	},
 
-(function(tinymce) {
-	var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each;
+	_convertToXML : function(n, xn) {
+		var xd, el, i, l, cn, at, no, hc = false;
 
-	tinymce.create('tinymce.AddOnManager', {
-		AddOnManager : function() {
-			var self = this;
+		if (tinyMCE.isRealIE && this._isDuplicate(n))
+			return;
 
-			self.items = [];
-			self.urls = {};
-			self.lookup = {};
-			self.onAdd = new Dispatcher(self);
-		},
+		xd = this.xmlDoc;
 
-		get : function(n) {
-			return this.lookup[n];
-		},
+		switch (n.nodeType) {
+			case 1: // Element
+				hc = n.hasChildNodes();
 
-		requireLangPack : function(n) {
-			var s = tinymce.settings;
+				el = xd.createElement(n.nodeName.toLowerCase());
 
-			if (s && s.language)
-				tinymce.ScriptLoader.add(this.urls[n] + '/langs/' + s.language + '.js');
-		},
+				at = n.attributes;
+				for (i=at.length-1; i>-1; i--) {
+					no = at[i];
 
-		add : function(id, o) {
-			this.items.push(o);
-			this.lookup[id] = o;
-			this.onAdd.dispatch(this, id, o);
+					if (no.specified && no.nodeValue)
+						el.setAttribute(no.nodeName.toLowerCase(), no.nodeValue);
+				}
 
-			return o;
-		},
+				if (!hc && !this.closeElementsRe.test(n.nodeName))
+					el.appendChild(xd.createTextNode(""));
 
-		load : function(n, u, cb, s) {
-			var t = this;
+				xn = xn.appendChild(el);
+				break;
 
-			if (t.urls[n])
+			case 3: // Text
+				xn.appendChild(xd.createTextNode(n.nodeValue));
 				return;
 
-			if (u.indexOf('/') != 0 && u.indexOf('://') == -1)
-				u = tinymce.baseURL + '/' +  u;
+			case 8: // Comment
+				xn.appendChild(xd.createComment(n.nodeValue));
+				return;
+		}
 
-			t.urls[n] = u.substring(0, u.lastIndexOf('/'));
+		if (hc) {
+			cn = n.childNodes;
 
-			if (!t.lookup[n])
-				tinymce.ScriptLoader.add(u, cb, s);
+			for (i=0, l=cn.length; i<l; i++)
+				this._convertToXML(cn[i], xn);
 		}
-	});
+	},
 
-	// Create plugin and theme managers
-	tinymce.PluginManager = new tinymce.AddOnManager();
-	tinymce.ThemeManager = new tinymce.AddOnManager();
-}(tinymce));
+	serializeNodeAsHTML : function(n, inn) {
+		var en, no, h = '', i, l, t, st, r, cn, va = false, f = false, at, hc, cr, nn;
 
-(function(tinymce) {
-	// Shorten names
-	var each = tinymce.each, extend = tinymce.extend,
-		DOM = tinymce.DOM, Event = tinymce.dom.Event,
-		ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager,
-		explode = tinymce.explode,
-		Dispatcher = tinymce.util.Dispatcher, undefined, instanceCounter = 0;
+		if (!this.rulesDone)
+			this._setupRules(); // Will initialize cleanup rules
 
-	// Setup some URLs where the editor API is located and where the document is
-	tinymce.documentBaseURL = window.location.href.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, '');
-	if (!/[\/\\]$/.test(tinymce.documentBaseURL))
-		tinymce.documentBaseURL += '/';
+		if (tinyMCE.isRealIE && this._isDuplicate(n))
+			return '';
 
-	tinymce.baseURL = new tinymce.util.URI(tinymce.documentBaseURL).toAbsolute(tinymce.baseURL);
+		// Skip non valid child elements
+		if (n.parentNode && this.childRules != null) {
+			cr = this.childRules[n.parentNode.nodeName];
 
-	tinymce.baseURI = new tinymce.util.URI(tinymce.baseURL);
+			if (typeof(cr) != "undefined" && !cr.test(n.nodeName)) {
+				st = true;
+				t = null;
+			}
+		}
 
-	// Add before unload listener
-	// This was required since IE was leaking memory if you added and removed beforeunload listeners
-	// with attachEvent/detatchEvent so this only adds one listener and instances can the attach to the onBeforeUnload event
-	tinymce.onBeforeUnload = new Dispatcher(tinymce);
+		switch (n.nodeType) {
+			case 1: // Element
+				hc = n.hasChildNodes();
 
-	// Must be on window or IE will leak if the editor is placed in frame or iframe
-	Event.add(window, 'beforeunload', function(e) {
-		tinymce.onBeforeUnload.dispatch(tinymce, e);
-	});
+				if (st)
+					break;
 
-	tinymce.onAddEditor = new Dispatcher(tinymce);
+				nn = n.nodeName;
 
-	tinymce.onRemoveEditor = new Dispatcher(tinymce);
+				if (tinyMCE.isRealIE) {
+					// MSIE sometimes produces <//tag>
+					if (n.nodeName.indexOf('/') != -1)
+						break;
 
-	tinymce.EditorManager = extend(tinymce, {
-		editors : [],
+					// MSIE has it's NS in a separate attrib
+					if (n.scopeName && n.scopeName != 'HTML')
+						nn = n.scopeName.toUpperCase() + ':' + nn.toUpperCase();
+				} else if (tinyMCE.isOpera && nn.indexOf(':') > 0)
+					nn = nn.toUpperCase();
 
-		i18n : {},
+				// Convert fonts to spans
+				if (this.settings.convert_fonts_to_spans) {
+					// On get content FONT -> SPAN
+					if (this.settings.on_save && nn == 'FONT')
+						nn = 'SPAN';
 
-		activeEditor : null,
-
-		init : function(s) {
-			var t = this, pl, sl = tinymce.ScriptLoader, e, el = [], ed;
-
-			function execCallback(se, n, s) {
-				var f = se[n];
-
-				if (!f)
-					return;
-
-				if (tinymce.is(f, 'string')) {
-					s = f.replace(/\.\w+$/, '');
-					s = s ? tinymce.resolve(s) : 0;
-					f = tinymce.resolve(f);
+					// On insert content SPAN -> FONT
+					if (!this.settings.on_save && nn == 'SPAN')
+						nn = 'FONT';
 				}
 
-				return f.apply(s || this, Array.prototype.slice.call(arguments, 2));
-			};
+				if (this.vElementsRe.test(nn) && (!this.iveRe || !this.iveRe.test(nn)) && !inn) {
+					va = true;
 
-			s = extend({
-				theme : "simple",
-				language : "en"
-			}, s);
+					r = this.rules[nn];
+					if (!r) {
+						at = this.rules;
+						for (no in at) {
+							if (at[no] && at[no].validRe.test(nn)) {
+								r = at[no];
+								break;
+							}
+						}
+					}
 
-			t.settings = s;
+					en = r.isWild ? nn.toLowerCase() : r.oTagName;
+					f = r.fill;
 
-			// Legacy call
-			Event.add(document, 'init', function() {
-				var l, co;
+					if (r.removeEmpty && !hc)
+						return "";
 
-				execCallback(s, 'onpageload');
+					t = '<' + en;
 
-				switch (s.mode) {
-					case "exact":
-						l = s.elements || '';
+					if (r.vAttribsReIsWild) {
+						// Serialize wildcard attributes
+						at = n.attributes;
+						for (i=at.length-1; i>-1; i--) {
+							no = at[i];
+							if (no.specified && r.vAttribsRe.test(no.nodeName))
+								t += this._serializeAttribute(n, r, no.nodeName);
+						}
+					} else {
+						// Serialize specific attributes
+						for (i=r.vAttribs.length-1; i>-1; i--)
+							t += this._serializeAttribute(n, r, r.vAttribs[i]);
+					}
 
-						if(l.length > 0) {
-							each(explode(l), function(v) {
-								if (DOM.get(v)) {
-									ed = new tinymce.Editor(v, s);
-									el.push(ed);
-									ed.render(1);
-								} else {
-									each(document.forms, function(f) {
-										each(f.elements, function(e) {
-											if (e.name === v) {
-												v = 'mce_editor_' + instanceCounter++;
-												DOM.setAttrib(e, 'id', v);
+					// Serialize mce_ atts
+					if (!this.settings.on_save) {
+						at = this.mceAttribs;
 
-												ed = new tinymce.Editor(v, s);
-												el.push(ed);
-												ed.render(1);
-											}
-										});
-									});
-								}
-							});
+						for (no in at) {
+							if (at[no])
+								t += this._serializeAttribute(n, r, at[no]);
 						}
-						break;
+					}
 
-					case "textareas":
-					case "specific_textareas":
-						function hasClass(n, c) {
-							return c.constructor === RegExp ? c.test(n.className) : DOM.hasClass(n, c);
-						};
+					// Check for required attribs
+					if (r.reqAttribsRe && !t.match(r.reqAttribsRe))
+						t = null;
 
-						each(DOM.select('textarea'), function(v) {
-							if (s.editor_deselector && hasClass(v, s.editor_deselector))
-								return;
+					// Close these
+					if (t != null && this.closeElementsRe.test(nn))
+						return t + ' />';
 
-							if (!s.editor_selector || hasClass(v, s.editor_selector)) {
-								// Can we use the name
-								e = DOM.get(v.name);
-								if (!v.id && !e)
-									v.id = v.name;
+					if (t != null)
+						h += t + '>';
 
-								// Generate unique name if missing or already exists
-								if (!v.id || t.get(v.id))
-									v.id = DOM.uniqueId();
-
-								ed = new tinymce.Editor(v.id, s);
-								el.push(ed);
-								ed.render(1);
-							}
-						});
-						break;
+					if (this.isIE && this.codeElementsRe.test(nn))
+						h += n.innerHTML;
 				}
+			break;
 
-				// Call onInit when all editors are initialized
-				if (s.oninit) {
-					l = co = 0;
+			case 3: // Text
+				if (st)
+					break;
 
-					each(el, function(ed) {
-						co++;
+				if (n.parentNode && this.codeElementsRe.test(n.parentNode.nodeName))
+					return this.isIE ? '' : n.nodeValue;
 
-						if (!ed.initialized) {
-							// Wait for it
-							ed.onInit.add(function() {
-								l++;
+				return this.xmlEncode(n.nodeValue);
 
-								// All done
-								if (l == co)
-									execCallback(s, 'oninit');
-							});
-						} else
-							l++;
+			case 8: // Comment
+				if (st)
+					break;
 
-						// All done
-						if (l == co)
-							execCallback(s, 'oninit');					
-					});
-				}
-			});
-		},
+				return "<!--" + this._trimComment(n.nodeValue) + "-->";
+		}
 
-		get : function(id) {
-			if (id === undefined)
-				return this.editors;
+		if (hc) {
+			cn = n.childNodes;
 
-			return this.editors[id];
-		},
+			for (i=0, l=cn.length; i<l; i++)
+				h += this.serializeNodeAsHTML(cn[i]);
+		}
 
-		getInstanceById : function(id) {
-			return this.get(id);
-		},
+		// Fill empty nodes
+		if (f && !hc)
+			h += this.fillStr;
 
-		add : function(editor) {
-			var self = this, editors = self.editors;
+		// End element
+		if (t != null && va)
+			h += '</' + en + '>';
 
-			// Add named and index editor instance
-			editors[editor.id] = editor;
-			editors.push(editor);
+		return h;
+	},
 
-			self._setActive(editor);
-			self.onAddEditor.dispatch(self, editor);
+	_serializeAttribute : function(n, r, an) {
+		var av = '', t, os = this.settings.on_save;
 
+		if (os && (an.indexOf('mce_') == 0 || an.indexOf('_moz') == 0))
+			return '';
 
-			return editor;
-		},
+		if (os && this.mceAttribs[an])
+			av = this._getAttrib(n, this.mceAttribs[an]);
 
-		remove : function(editor) {
-			var t = this, i, editors = t.editors;
+		if (av.length == 0)
+			av = this._getAttrib(n, an);
 
-			// Not in the collection
-			if (!editors[editor.id])
-				return null;
+		if (av.length == 0 && r.defaultAttribs && (t = r.defaultAttribs[an])) {
+			av = t;
 
-			delete editors[editor.id];
+			if (av == "mce_empty")
+				return " " + an + '=""';
+		}
 
-			for (i = 0; i < editors.length; i++) {
-				if (editors[i] == editor) {
-					editors.splice(i, 1);
-					break;
-				}
-			}
+		if (r.forceAttribs && (t = r.forceAttribs[an]))
+			av = t;
 
-			// Select another editor since the active one was removed
-			if (t.activeEditor == editor)
-				t._setActive(editors[0]);
+		if (os && av.length != 0 && /^(src|href|longdesc)$/.test(an))
+			av = this._urlConverter(this, n, av);
 
-			editor.destroy();
-			t.onRemoveEditor.dispatch(t, editor);
+		if (av.length != 0 && r.validAttribValues && r.validAttribValues[an] && !r.validAttribValues[an].test(av))
+			return "";
 
-			return editor;
-		},
+		if (av.length != 0 && av == "{$uid}")
+			av = "uid_" + (this.idCount++);
 
-		execCommand : function(c, u, v) {
-			var t = this, ed = t.get(v), w;
+		if (av.length != 0) {
+			if (an.indexOf('on') != 0)
+				av = this.xmlEncode(av, 1);
 
-			// Manager commands
-			switch (c) {
-				case "mceFocus":
-					ed.focus();
-					return true;
+			return " " + an + "=" + '"' + av + '"';
+		}
 
-				case "mceAddEditor":
-				case "mceAddControl":
-					if (!t.get(v))
-						new tinymce.Editor(v, t.settings).render();
+		return "";
+	},
 
-					return true;
+	formatHTML : function(h) {
+		var s = this.settings, p = '', i = 0, li = 0, o = '', l;
 
-				case "mceAddFrameControl":
-					w = v.window;
+		// Replace BR in pre elements to \n
+		h = h.replace(/<pre([^>]*)>(.*?)<\/pre>/gi, function (a, b, c) {
+			c = c.replace(/<br\s*\/>/gi, '\n');
+			return '<pre' + b + '>' + c + '</pre>';
+		});
 
-					// Add tinyMCE global instance and tinymce namespace to specified window
-					w.tinyMCE = tinyMCE;
-					w.tinymce = tinymce;
+		h = h.replace(/\r/g, ''); // Windows sux, isn't carriage return a thing of the past :)
+		h = '\n' + h;
+		h = h.replace(new RegExp('\\n\\s+', 'gi'), '\n'); // Remove previous formatting
+		h = h.replace(this.nlBeforeRe, '\n<$1$2>');
+		h = h.replace(this.nlAfterRe, '<$1$2>\n');
+		h = h.replace(this.nlBeforeAfterRe, '\n<$1$2$3>\n');
+		h += '\n';
 
-					tinymce.DOM.doc = w.document;
-					tinymce.DOM.win = w;
+		//tinyMCE.debug(h);
 
-					ed = new tinymce.Editor(v.element_id, v);
-					ed.render();
+		while ((i = h.indexOf('\n', i + 1)) != -1) {
+			if ((l = h.substring(li + 1, i)).length != 0) {
+				if (this.ouRe.test(l) && p.length >= s.indent_levels)
+					p = p.substring(s.indent_levels);
 
-					// Fix IE memory leaks
-					if (tinymce.isIE) {
-						function clr() {
-							ed.destroy();
-							w.detachEvent('onunload', clr);
-							w = w.tinyMCE = w.tinymce = null; // IE leak
-						};
-
-						w.attachEvent('onunload', clr);
-					}
-
-					v.page_window = null;
-
-					return true;
-
-				case "mceRemoveEditor":
-				case "mceRemoveControl":
-					if (ed)
-						ed.remove();
-
-					return true;
-
-				case 'mceToggleEditor':
-					if (!ed) {
-						t.execCommand('mceAddControl', 0, v);
-						return true;
-					}
-
-					if (ed.isHidden())
-						ed.show();
-					else
-						ed.hide();
-
-					return true;
+				o += p + l + '\n';
+	
+				if (this.inRe.test(l))
+					p += this.inStr;
 			}
 
-			// Run command on active editor
-			if (t.activeEditor)
-				return t.activeEditor.execCommand(c, u, v);
+			li = i;
+		}
 
-			return false;
-		},
+		//tinyMCE.debug(h);
 
-		execInstanceCommand : function(id, c, u, v) {
-			var ed = this.get(id);
+		return o;
+	},
 
-			if (ed)
-				return ed.execCommand(c, u, v);
+	xmlEncode : function(s) {
+		var cl = this, re = this.xmlEncodeRe;
 
-			return false;
-		},
+		if (!this.entitiesDone)
+			this._setupEntities(); // Will intialize lookup table
 
-		triggerSave : function() {
-			each(this.editors, function(e) {
-				e.save();
-			});
-		},
+		switch (this.settings.entity_encoding) {
+			case "raw":
+				return tinyMCE.xmlEncode(s);
 
-		addI18n : function(p, o) {
-			var lo, i18n = this.i18n;
+			case "named":
+				return s.replace(re, function (c) {
+					var b = cl.entities[c.charCodeAt(0)];
 
-			if (!tinymce.is(p, 'string')) {
-				each(p, function(o, lc) {
-					each(o, function(o, g) {
-						each(o, function(o, k) {
-							if (g === 'common')
-								i18n[lc + '.' + k] = o;
-							else
-								i18n[lc + '.' + g + '.' + k] = o;
-						});
-					});
+					return b ? '&' + b + ';' : c;
 				});
-			} else {
-				each(o, function(o, k) {
-					i18n[p + '.' + k] = o;
-				});
-			}
-		},
 
-		// Private methods
-
-		_setActive : function(editor) {
-			this.selectedInstance = this.activeEditor = editor;
+			case "numeric":
+				return s.replace(re, function (c) {
+					return '&#' + c.charCodeAt(0) + ';';
+				});
 		}
-	});
-})(tinymce);
 
-(function(tinymce) {
-	// Shorten these names
-	var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend,
-		Dispatcher = tinymce.util.Dispatcher, each = tinymce.each, isGecko = tinymce.isGecko,
-		isIE = tinymce.isIE, isWebKit = tinymce.isWebKit, is = tinymce.is,
-		ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager,
-		inArray = tinymce.inArray, grep = tinymce.grep, explode = tinymce.explode;
+		return s;
+	},
 
-	tinymce.create('tinymce.Editor', {
-		Editor : function(id, s) {
-			var t = this;
+	split : function(re, s) {
+		var i, l, o = [], c = s.split(re);
 
-			t.id = t.editorId = id;
+		for (i=0, l=c.length; i<l; i++) {
+			if (c[i] !== '')
+				o[i] = c[i];
+		}
 
-			t.execCommands = {};
-			t.queryStateCommands = {};
-			t.queryValueCommands = {};
+		return o;
+	},
 
-			t.isNotDirty = false;
+	_trimComment : function(s) {
+		// Remove mce_src, mce_href
+		s = s.replace(new RegExp('\\smce_src=\"[^\"]*\"', 'gi'), "");
+		s = s.replace(new RegExp('\\smce_href=\"[^\"]*\"', 'gi'), "");
 
-			t.plugins = {};
+		return s;
+	},
 
-			// Add events to the editor
-			each([
-				'onPreInit',
+	_getAttrib : function(e, n, d) {
+		var v, ex, nn;
 
-				'onBeforeRenderUI',
+		if (typeof(d) == "undefined")
+			d = "";
 
-				'onPostRender',
+		if (!e || e.nodeType != 1)
+			return d;
 
-				'onInit',
+		try {
+			v = e.getAttribute(n, 0);
+		} catch (ex) {
+			// IE 7 may cast exception on invalid attributes
+			v = e.getAttribute(n, 2);
+		}
 
-				'onRemove',
+		if (n == "class" && !v)
+			v = e.className;
 
-				'onActivate',
+		if (this.isIE) {
+			if (n == "http-equiv")
+				v = e.httpEquiv;
 
-				'onDeactivate',
+			nn = e.nodeName;
 
-				'onClick',
+			// Skip the default values that IE returns
+			if (nn == "FORM" && n == "enctype" && v == "application/x-www-form-urlencoded")
+				v = "";
 
-				'onEvent',
+			if (nn == "INPUT" && n == "size" && v == "20")
+				v = "";
 
-				'onMouseUp',
+			if (nn == "INPUT" && n == "maxlength" && v == "2147483647")
+				v = "";
 
-				'onMouseDown',
+			// Images
+			if (n == "width" || n == "height")
+				v = e.getAttribute(n, 2);
+		}
 
-				'onDblClick',
+		if (n == 'style' && v) {
+			if (!tinyMCE.isOpera)
+				v = e.style.cssText;
 
-				'onKeyDown',
+			v = tinyMCE.serializeStyle(tinyMCE.parseStyle(v));
+		}
 
-				'onKeyUp',
+		if (this.settings.on_save && n.indexOf('on') != -1 && this.settings.on_save && v && v !== '')
+			v = tinyMCE.cleanupEventStr(v);
 
-				'onKeyPress',
+		return (v && v !== '') ? '' + v : d;
+	},
 
-				'onContextMenu',
+	_urlConverter : function(c, n, v) {
+		if (!c.settings.on_save)
+			return tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings.base_href, v);
+		else if (tinyMCE.getParam('convert_urls')) {
+			if (!this.urlConverter)
+				this.urlConverter = eval(tinyMCE.settings.urlconverter_callback);
 
-				'onSubmit',
+			return this.urlConverter(v, n, true);
+		}
 
-				'onReset',
+		return v;
+	},
 
-				'onPaste',
+	_arrayToRe : function(a, op, be, af) {
+		var i, r;
 
-				'onPreProcess',
+		op = typeof(op) == "undefined" ? "gi" : op;
+		be = typeof(be) == "undefined" ? "^(" : be;
+		af = typeof(af) == "undefined" ? ")$" : af;
 
-				'onPostProcess',
+		r = be;
 
-				'onBeforeSetContent',
+		for (i=0; i<a.length; i++)
+			r += this._wildcardToRe(a[i]) + (i != a.length-1 ? "|" : "");
 
-				'onBeforeGetContent',
+		r += af;
 
-				'onSetContent',
+		return new RegExp(r, op);
+	},
 
-				'onGetContent',
+	_wildcardToRe : function(s) {
+		s = s.replace(/\?/g, '(\\S?)');
+		s = s.replace(/\+/g, '(\\S+)');
+		s = s.replace(/\*/g, '(\\S*)');
 
-				'onLoadContent',
+		return s;
+	},
 
-				'onSaveContent',
+	_setupEntities : function() {
+		var n, a, i, s = this.settings;
 
-				'onNodeChange',
+		// Setup entities
+		if (s.entity_encoding == "named") {
+			n = tinyMCE.clearArray([]);
+			a = this.split(',', s.entities);
+			for (i=0; i<a.length; i+=2)
+				n[a[i]] = a[i+1];
 
-				'onChange',
+			this.entities = n;
+		}
 
-				'onBeforeExecCommand',
+		this.entitiesDone = true;
+	},
 
-				'onExecCommand',
+	_setupRules : function() {
+		var s = this.settings;
 
-				'onUndo',
+		// Setup default rule
+		this.addRuleStr(s.valid_elements);
+		this.addRuleStr(s.extended_valid_elements);
+		this.addChildRemoveRuleStr(s.valid_child_elements);
 
-				'onRedo',
+		this.rulesDone = true;
+	},
 
-				'onVisualAid',
+	_isDuplicate : function(n) {
+		var i, l, sn;
 
-				'onSetProgressState'
-			], function(e) {
-				t[e] = new Dispatcher(t);
-			});
+		if (!this.settings.fix_content_duplication)
+			return false;
 
-			t.settings = s = extend({
-				id : id,
-				language : 'en',
-				docs_language : 'en',
-				theme : 'simple',
-				skin : 'default',
-				delta_width : 0,
-				delta_height : 0,
-				popup_css : '',
-				plugins : '',
-				document_base_url : tinymce.documentBaseURL,
-				add_form_submit_trigger : 1,
-				submit_patch : 1,
-				add_unload_trigger : 1,
-				convert_urls : 1,
-				relative_urls : 1,
-				remove_script_host : 1,
-				table_inline_editing : 0,
-				object_resizing : 1,
-				cleanup : 1,
-				accessibility_focus : 1,
-				custom_shortcuts : 1,
-				custom_undo_redo_keyboard_shortcuts : 1,
-				custom_undo_redo_restore_selection : 1,
-				custom_undo_redo : 1,
-				doctype : tinymce.isIE6 ? '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">' : '<!DOCTYPE>', // Use old doctype on IE 6 to avoid horizontal scroll
-				visual_table_class : 'mceItemTable',
-				visual : 1,
-				font_size_style_values : 'xx-small,x-small,small,medium,large,x-large,xx-large',
-				apply_source_formatting : 1,
-				directionality : 'ltr',
-				forced_root_block : 'p',
-				valid_elements : '@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p,-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite],-table[border|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],p
 aram[name|value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value|tabindex|accesskey],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big',
-				hidden_input : 1,
-				padd_empty_editor : 1,
-				render_ui : 1,
-				init_theme : 1,
-				force_p_newlines : 1,
-				indentation : '30px',
-				keep_styles : 1,
-				fix_table_elements : 1,
-				inline_styles : 1,
-				convert_fonts_to_spans : true
-			}, s);
+		if (tinyMCE.isRealIE && n.nodeType == 1) {
+			// Mark elements
+			if (n.mce_serialized == this.serializationId)
+				return true;
 
-			t.documentBaseURI = new tinymce.util.URI(s.document_base_url || tinymce.documentBaseURL, {
-				base_uri : tinyMCE.baseURI
-			});
+			n.setAttribute('mce_serialized', this.serializationId);
+		} else {
+			sn = this.serializedNodes;
 
-			t.baseURI = tinymce.baseURI;
-
-			// Call setup
-			t.execCallback('setup', t);
-		},
-
-		render : function(nst) {
-			var t = this, s = t.settings, id = t.id, sl = tinymce.ScriptLoader;
-
-			// Page is not loaded yet, wait for it
-			if (!Event.domLoaded) {
-				Event.add(document, 'init', function() {
-					t.render();
-				});
-				return;
+			// Search lookup table for text nodes  and comments
+			for (i=0, l = sn.length; i<l; i++) {
+				if (sn[i] == n)
+					return true;
 			}
 
-			tinyMCE.settings = s;
+			sn.push(n);
+		}
 
-			// Element not found, then skip initialization
-			if (!t.getElement())
-				return;
+		return false;
+	}
 
-			// Is a iPad/iPhone, then skip initialization. We need to sniff here since the
-			// browser says it has contentEditable support but there is no visible caret
-			// We will remove this check ones Apple implements full contentEditable support
-			if (tinymce.isIDevice)
-				return;
+	};
 
-			// Add hidden input for non input elements inside form elements
-			if (!/TEXTAREA|INPUT/i.test(t.getElement().nodeName) && s.hidden_input && DOM.getParent(id, 'form'))
-				DOM.insertAfter(DOM.create('input', {type : 'hidden', name : id}), id);
+/* file:jscripts/tiny_mce/classes/TinyMCE_DOMUtils.class.js */
 
-			if (tinymce.WindowManager)
-				t.windowManager = new tinymce.WindowManager(t);
+tinyMCE.add(TinyMCE_Engine, {
+	createTagHTML : function(tn, a, h) {
+		var o = '', f = tinyMCE.xmlEncode, n;
 
-			if (s.encoding == 'xml') {
-				t.onGetContent.add(function(ed, o) {
-					if (o.save)
-						o.content = DOM.encode(o.content);
-				});
-			}
+		o = '<' + tn;
 
-			if (s.add_form_submit_trigger) {
-				t.onSubmit.addToTop(function() {
-					if (t.initialized) {
-						t.save();
-						t.isNotDirty = 1;
-					}
-				});
+		if (a) {
+			for (n in a) {
+				if (typeof(a[n]) != 'function' && a[n] != null)
+					o += ' ' + f(n) + '="' + f('' + a[n]) + '"';
 			}
+		}
 
-			if (s.add_unload_trigger) {
-				t._beforeUnload = tinyMCE.onBeforeUnload.add(function() {
-					if (t.initialized && !t.destroyed && !t.isHidden())
-						t.save({format : 'raw', no_events : true});
-				});
-			}
+		o += !h ? ' />' : '>' + h + '</' + tn + '>';
 
-			tinymce.addUnload(t.destroy, t);
+		return o;
+	},
 
-			if (s.submit_patch) {
-				t.onBeforeRenderUI.add(function() {
-					var n = t.getElement().form;
+	createTag : function(d, tn, a, h) {
+		var o = d.createElement(tn), n;
 
-					if (!n)
-						return;
-
-					// Already patched
-					if (n._mceOldSubmit)
-						return;
-
-					// Check page uses id="submit" or name="submit" for it's submit button
-					if (!n.submit.nodeType && !n.submit.length) {
-						t.formElement = n;
-						n._mceOldSubmit = n.submit;
-						n.submit = function() {
-							// Save all instances
-							tinymce.triggerSave();
-							t.isNotDirty = 1;
-
-							return t.formElement._mceOldSubmit(t.formElement);
-						};
-					}
-
-					n = null;
-				});
+		if (a) {
+			for (n in a) {
+				if (typeof(a[n]) != 'function' && a[n] != null)
+					tinyMCE.setAttrib(o, n, a[n]);
 			}
+		}
 
-			// Load scripts
-			function loadScripts() {
-				if (s.language)
-					sl.add(tinymce.baseURL + '/langs/' + s.language + '.js');
+		if (h)
+			o.innerHTML = h;
 
-				if (s.theme && s.theme.charAt(0) != '-' && !ThemeManager.urls[s.theme])
-					ThemeManager.load(s.theme, 'themes/' + s.theme + '/editor_template' + tinymce.suffix + '.js');
+		return o;
+	},
 
-				each(explode(s.plugins), function(p) {
-					if (p && p.charAt(0) != '-' && !PluginManager.urls[p]) {
-						// Skip safari plugin, since it is removed as of 3.3b1
-						if (p == 'safari')
-							return;
+	getElementByAttributeValue : function(n, e, a, v) {
+		return (n = this.getElementsByAttributeValue(n, e, a, v)).length == 0 ? null : n[0];
+	},
 
-						PluginManager.load(p, 'plugins/' + p + '/editor_plugin' + tinymce.suffix + '.js');
-					}
-				});
+	getElementsByAttributeValue : function(n, e, a, v) {
+		var i, nl = n.getElementsByTagName(e), o = [];
 
-				// Init when que is loaded
-				sl.loadQueue(function() {
-					if (!t.removed)
-						t.init();
-				});
-			};
+		for (i=0; i<nl.length; i++) {
+			if (tinyMCE.getAttrib(nl[i], a).indexOf(v) != -1)
+				o[o.length] = nl[i];
+		}
 
-			loadScripts();
-		},
+		return o;
+	},
 
-		init : function() {
-			var n, t = this, s = t.settings, w, h, e = t.getElement(), o, ti, u, bi, bc, re;
+	isBlockElement : function(n) {
+		return n != null && n.nodeType == 1 && this.blockRegExp.test(n.nodeName);
+	},
 
-			tinymce.add(t);
+	getParentBlockElement : function(n, r) {
+		return this.getParentNode(n, function(n) {
+			return tinyMCE.isBlockElement(n);
+		}, r);
 
-			if (s.theme) {
-				s.theme = s.theme.replace(/-/, '');
-				o = ThemeManager.get(s.theme);
-				t.theme = new o();
+		return null;
+	},
 
-				if (t.theme.init && s.init_theme)
-					t.theme.init(t, ThemeManager.urls[s.theme] || tinymce.documentBaseURL.replace(/\/$/, ''));
-			}
+	insertAfter : function(n, r){
+		if (r.nextSibling)
+			r.parentNode.insertBefore(n, r.nextSibling);
+		else
+			r.parentNode.appendChild(n);
+	},
 
-			// Create all plugins
-			each(explode(s.plugins.replace(/\-/g, '')), function(p) {
-				var c = PluginManager.get(p), u = PluginManager.urls[p] || tinymce.documentBaseURL.replace(/\/$/, ''), po;
+	setInnerHTML : function(e, h) {
+		var i, nl, n;
 
-				if (c) {
-					po = new c(t, u);
+		// Convert all strong/em to b/i in Gecko
+		if (tinyMCE.isGecko) {
+			h = h.replace(/<embed([^>]*)>/gi, '<tmpembed$1>');
+			h = h.replace(/<em([^>]*)>/gi, '<i$1>');
+			h = h.replace(/<tmpembed([^>]*)>/gi, '<embed$1>');
+			h = h.replace(/<strong([^>]*)>/gi, '<b$1>');
+			h = h.replace(/<\/strong>/gi, '</b>');
+			h = h.replace(/<\/em>/gi, '</i>');
+		}
 
-					t.plugins[p] = po;
+		if (tinyMCE.isRealIE) {
+			// Since MSIE handles invalid HTML better that valid XHTML we
+			// need to make some things invalid. <hr /> gets converted to <hr>.
+			h = h.replace(/\s\/>/g, '>');
 
-					if (po.init)
-						po.init(t, u);
-				}
-			});
+			// Since MSIE auto generated emtpy P tags some times we must tell it to keep the real ones
+			h = h.replace(/<p([^>]*)>\u00A0?<\/p>/gi, '<p$1 mce_keep="true"> </p>'); // Keep empty paragraphs
+			h = h.replace(/<p([^>]*)>\s* \s*<\/p>/gi, '<p$1 mce_keep="true"> </p>'); // Keep empty paragraphs
+			h = h.replace(/<p([^>]*)>\s+<\/p>/gi, '<p$1 mce_keep="true"> </p>'); // Keep empty paragraphs
 
-			// Setup popup CSS path(s)
-			if (s.popup_css !== false) {
-				if (s.popup_css)
-					s.popup_css = t.documentBaseURI.toAbsolute(s.popup_css);
-				else
-					s.popup_css = t.baseURI.toAbsolute("themes/" + s.theme + "/skins/" + s.skin + "/dialog.css");
-			}
+			// Remove first comment
+			e.innerHTML = tinyMCE.uniqueTag + h;
+			e.firstChild.removeNode(true);
 
-			if (s.popup_css_add)
-				s.popup_css += ',' + t.documentBaseURI.toAbsolute(s.popup_css_add);
+			// Remove weird auto generated empty paragraphs unless it's supposed to be there
+			nl = e.getElementsByTagName("p");
+			for (i=nl.length-1; i>=0; i--) {
+				n = nl[i];
 
-			t.controlManager = new tinymce.ControlManager(t);
-
-			if (s.custom_undo_redo) {
-				// Add initial undo level
-				t.onBeforeExecCommand.add(function(ed, cmd, ui, val, a) {
-					if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint' && (!a || !a.skip_undo)) {
-						if (!t.undoManager.hasUndo())
-							t.undoManager.add();
-					}
-				});
-
-				t.onExecCommand.add(function(ed, cmd, ui, val, a) {
-					if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint' && (!a || !a.skip_undo))
-						t.undoManager.add();
-				});
+				if (n.nodeName == 'P' && !n.hasChildNodes() && !n.mce_keep)
+					n.parentNode.removeChild(n);
 			}
+		} else {
+			h = this.fixGeckoBaseHREFBug(1, e, h);
+			e.innerHTML = h;
+			this.fixGeckoBaseHREFBug(2, e, h);
+		}
+	},
 
-			t.onExecCommand.add(function(ed, c) {
-				// Don't refresh the select lists until caret move
-				if (!/^(FontName|FontSize)$/.test(c))
-					t.nodeChanged();
-			});
+	getOuterHTML : function(e) {
+		var d;
 
-			// Remove ghost selections on images and tables in Gecko
-			if (isGecko) {
-				function repaint(a, o) {
-					if (!o || !o.initial)
-						t.execCommand('mceRepaint');
-				};
+		if (tinyMCE.isIE)
+			return e.outerHTML;
 
-				t.onUndo.add(repaint);
-				t.onRedo.add(repaint);
-				t.onSetContent.add(repaint);
-			}
+		d = e.ownerDocument.createElement("body");
+		d.appendChild(e.cloneNode(true));
 
-			// Enables users to override the control factory
-			t.onBeforeRenderUI.dispatch(t, t.controlManager);
+		return d.innerHTML;
+	},
 
-			// Measure box
-			if (s.render_ui) {
-				w = s.width || e.style.width || e.offsetWidth;
-				h = s.height || e.style.height || e.offsetHeight;
-				t.orgDisplay = e.style.display;
-				re = /^[0-9\.]+(|px)$/i;
+	setOuterHTML : function(e, h, d) {
+		var d = typeof(d) == "undefined" ? e.ownerDocument : d, i, nl, t;
 
-				if (re.test('' + w))
-					w = Math.max(parseInt(w) + (o.deltaWidth || 0), 100);
+		if (tinyMCE.isIE && e.nodeType == 1)
+			e.outerHTML = h;
+		else {
+			t = d.createElement("body");
+			t.innerHTML = h;
 
-				if (re.test('' + h))
-					h = Math.max(parseInt(h) + (o.deltaHeight || 0), 100);
+			for (i=0, nl=t.childNodes; i<nl.length; i++)
+				e.parentNode.insertBefore(nl[i].cloneNode(true), e);
 
-				// Render UI
-				o = t.theme.renderUI({
-					targetNode : e,
-					width : w,
-					height : h,
-					deltaWidth : s.delta_width,
-					deltaHeight : s.delta_height
-				});
+			e.parentNode.removeChild(e);
+		}
+	},
 
-				t.editorContainer = o.editorContainer;
-			}
+	_getElementById : function(id, d) {
+		var e, i, j, f;
 
+		if (typeof(d) == "undefined")
+			d = document;
 
-			// User specified a document.domain value
-			if (document.domain && location.hostname != document.domain)
-				tinymce.relaxedDomain = document.domain;
+		e = d.getElementById(id);
+		if (!e) {
+			f = d.forms;
 
-			// Resize editor
-			DOM.setStyles(o.sizeContainer || o.editorContainer, {
-				width : w,
-				height : h
-			});
-
-			h = (o.iframeHeight || h) + (typeof(h) == 'number' ? (o.deltaHeight || 0) : '');
-			if (h < 100)
-				h = 100;
-
-			t.iframeHTML = s.doctype + '<html><head xmlns="http://www.w3.org/1999/xhtml">';
-
-			// 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 (s.document_base_url != tinymce.documentBaseURL)
-				t.iframeHTML += '<base href="' + t.documentBaseURI.getURI() + '" />';
-
-			t.iframeHTML += '<meta http-equiv="X-UA-Compatible" content="IE=7" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
-
-			if (tinymce.relaxedDomain)
-				t.iframeHTML += '<script type="text/javascript">document.domain = "' + tinymce.relaxedDomain + '";</script>';
-
-			bi = s.body_id || 'tinymce';
-			if (bi.indexOf('=') != -1) {
-				bi = t.getParam('body_id', '', 'hash');
-				bi = bi[t.id] || bi;
-			}
-
-			bc = s.body_class || '';
-			if (bc.indexOf('=') != -1) {
-				bc = t.getParam('body_class', '', 'hash');
-				bc = bc[t.id] || '';
-			}
-
-			t.iframeHTML += '</head><body id="' + bi + '" class="mceContentBody ' + bc + '"></body></html>';
-
-			// Domain relaxing enabled, then set document domain
-			if (tinymce.relaxedDomain) {
-				// We need to write the contents here in IE since multiple writes messes up refresh button and back button
-				if (isIE || (tinymce.isOpera && parseFloat(opera.version()) >= 9.5))
-					u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";var ed = window.parent.tinyMCE.get("' + t.id + '");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()';
-				else if (tinymce.isOpera)
-					u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";document.close();ed.setupIframe();})()';					
-			}
-
-			// Create iframe
-			n = DOM.add(o.iframeContainer, 'iframe', {
-				id : t.id + "_ifr",
-				src : u || 'javascript:""', // Workaround for HTTPS warning in IE6/7
-				frameBorder : '0',
-				style : {
-					width : '100%',
-					height : h
+			for (i=0; i<f.length; i++) {
+				for (j=0; j<f[i].elements.length; j++) {
+					if (f[i].elements[j].name == id) {
+						e = f[i].elements[j];
+						break;
+					}
 				}
-			});
-
-			t.contentAreaContainer = o.iframeContainer;
-			DOM.get(o.editorContainer).style.display = t.orgDisplay;
-			DOM.get(t.id).style.display = 'none';
-
-			if (!isIE || !tinymce.relaxedDomain)
-				t.setupIframe();
-
-			e = n = o = null; // Cleanup
-		},
-
-		setupIframe : function() {
-			var t = this, s = t.settings, e = DOM.get(t.id), d = t.getDoc(), h, b;
-
-			// Setup iframe body
-			if (!isIE || !tinymce.relaxedDomain) {
-				d.open();
-				d.write(t.iframeHTML);
-				d.close();
 			}
+		}
 
-			// Design mode needs to be added here Ctrl+A will fail otherwise
-			if (!isIE) {
-				try {
-					if (!s.readonly)
-						d.designMode = 'On';
-				} catch (ex) {
-					// Will fail on Gecko if the editor is placed in an hidden container element
-					// The design mode will be set ones the editor is focused
-				}
-			}
+		return e;
+	},
 
-			// IE needs to use contentEditable or it will display non secure items for HTTPS
-			if (isIE) {
-				// It will not steal focus if we hide it while setting contentEditable
-				b = t.getBody();
-				DOM.hide(b);
+	getNodeTree : function(n, na, t, nn) {
+		return this.selectNodes(n, function(n) {
+			return (!t || n.nodeType == t) && (!nn || n.nodeName == nn);
+		}, na ? na : []);
+	},
 
-				if (!s.readonly)
-					b.contentEditable = true;
+	getParentElement : function(n, na, f, r) {
+		var re = na ? new RegExp('^(' + na.toUpperCase().replace(/,/g, '|') + ')$') : 0, v;
 
-				DOM.show(b);
-			}
+		// Compatiblity with old scripts where f param was a attribute string
+		if (f && typeof(f) == 'string')
+			return this.getParentElement(n, na, function(no) {return tinyMCE.getAttrib(no, f) !== '';});
 
-			t.dom = new tinymce.dom.DOMUtils(t.getDoc(), {
-				keep_values : true,
-				url_converter : t.convertURL,
-				url_converter_scope : t,
-				hex_colors : s.force_hex_style_colors,
-				class_filter : s.class_filter,
-				update_styles : 1,
-				fix_ie_paragraphs : 1,
-				valid_styles : s.valid_styles
-			});
+		return this.getParentNode(n, function(n) {
+			return ((n.nodeType == 1 && !re) || (re && re.test(n.nodeName))) && (!f || f(n));
+		}, r);
+	},
 
-			t.schema = new tinymce.dom.Schema();
+	getParentNode : function(n, f, r) {
+		while (n) {
+			if (n == r)
+				return null;
 
-			t.serializer = new tinymce.dom.Serializer(extend(s, {
-				valid_elements : s.verify_html === false ? '*[*]' : s.valid_elements,
-				dom : t.dom,
-				schema : t.schema
-			}));
+			if (f(n))
+				return n;
 
-			t.selection = new tinymce.dom.Selection(t.dom, t.getWin(), t.serializer);
+			n = n.parentNode;
+		}
 
-			t.formatter = new tinymce.Formatter(this);
+		return null;
+	},
 
-			// Register default formats
-			t.formatter.register({
-				alignleft : [
-					{selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'left'}},
-					{selector : 'img,table', styles : {'float' : 'left'}}
-				],
+	getAttrib : function(elm, name, dv) {
+		var v;
 
-				aligncenter : [
-					{selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'center'}},
-					{selector : 'img', styles : {display : 'block', marginLeft : 'auto', marginRight : 'auto'}},
-					{selector : 'table', styles : {marginLeft : 'auto', marginRight : 'auto'}}
-				],
+		if (typeof(dv) == "undefined")
+			dv = "";
 
-				alignright : [
-					{selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'right'}},
-					{selector : 'img,table', styles : {'float' : 'right'}}
-				],
+		// Not a element
+		if (!elm || elm.nodeType != 1)
+			return dv;
 
-				alignfull : [
-					{selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'justify'}}
-				],
+		try {
+			v = elm.getAttribute(name, 0);
+		} catch (ex) {
+			// IE 7 may cast exception on invalid attributes
+			v = elm.getAttribute(name, 2);
+		}
 
-				bold : [
-					{inline : 'strong'},
-					{inline : 'span', styles : {fontWeight : 'bold'}},
-					{inline : 'b'}
-				],
+		// Try className for class attrib
+		if (name == "class" && !v)
+			v = elm.className;
 
-				italic : [
-					{inline : 'em'},
-					{inline : 'span', styles : {fontStyle : 'italic'}},
-					{inline : 'i'}
-				],
+		// Workaround for a issue with Firefox 1.5rc2+
+		if (tinyMCE.isGecko) {
+			if (name == "src" && elm.src != null && elm.src !== '')
+				v = elm.src;
 
-				underline : [
-					{inline : 'span', styles : {textDecoration : 'underline'}, exact : true},
-					{inline : 'u'}
-				],
+			// Workaround for a issue with Firefox 1.5rc2+
+			if (name == "href" && elm.href != null && elm.href !== '')
+				v = elm.href;
+		} else if (tinyMCE.isIE) {
+			switch (name) {
+				case "http-equiv":
+					v = elm.httpEquiv;
+					break;
 
-				strikethrough : [
-					{inline : 'span', styles : {textDecoration : 'line-through'}, exact : true},
-					{inline : 'u'}
-				],
+				case "width":
+				case "height":
+					v = elm.getAttribute(name, 2);
+					break;
+			}
+		}
 
-				forecolor : {inline : 'span', styles : {color : '%value'}},
-				hilitecolor : {inline : 'span', styles : {backgroundColor : '%value'}},
-				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'},
+		if (name == "style" && !tinyMCE.isOpera)
+			v = elm.style.cssText;
 
-				removeformat : [
-					{selector : 'b,strong,em,i,font,u,strike', 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}
-				]
-			});
+		return (v && v !== '') ? v : dv;
+	},
 
-			// Register default block formats
-			each('p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp'.split(/\s/), function(name) {
-				t.formatter.register(name, {block : name, remove : 'all'});
-			});
+	setAttrib : function(el, name, va, fix) {
+		if (typeof(va) == "number" && va != null)
+			va = "" + va;
 
-			// Register user defined formats
-			t.formatter.register(t.settings.formats);
+		if (fix) {
+			if (va == null)
+				va = "";
 
-			t.undoManager = new tinymce.UndoManager(t);
+			va = va.replace(/[^0-9%]/g, '');
+		}
 
-			// Pass through
-			t.undoManager.onAdd.add(function(um, l) {
-				if (!l.initial)
-					return t.onChange.dispatch(t, l, um);
-			});
+		if (name == "style")
+			el.style.cssText = va;
 
-			t.undoManager.onUndo.add(function(um, l) {
-				return t.onUndo.dispatch(t, l, um);
-			});
+		if (name == "class")
+			el.className = va;
 
-			t.undoManager.onRedo.add(function(um, l) {
-				return t.onRedo.dispatch(t, l, um);
-			});
+		if (va != null && va !== '' && va != -1)
+			el.setAttribute(name, va);
+		else
+			el.removeAttribute(name);
+	},
 
-			t.forceBlocks = new tinymce.ForceBlocks(t, {
-				forced_root_block : s.forced_root_block
-			});
+	setStyleAttrib : function(e, n, v) {
+		e.style[n] = v;
 
-			t.editorCommands = new tinymce.EditorCommands(t);
+		// Style attrib deleted in IE
+		if (tinyMCE.isIE && v == null || v == '') {
+			v = tinyMCE.serializeStyle(tinyMCE.parseStyle(e.style.cssText));
+			e.style.cssText = v;
+			e.setAttribute("style", v);
+		}
+	},
 
-			// Pass through
-			t.serializer.onPreProcess.add(function(se, o) {
-				return t.onPreProcess.dispatch(t, o, se);
-			});
+	switchClass : function(ei, c) {
+		var e;
 
-			t.serializer.onPostProcess.add(function(se, o) {
-				return t.onPostProcess.dispatch(t, o, se);
-			});
+		if (tinyMCE.switchClassCache[ei])
+			e = tinyMCE.switchClassCache[ei];
+		else
+			e = tinyMCE.switchClassCache[ei] = document.getElementById(ei);
 
-			t.onPreInit.dispatch(t);
+		if (e) {
+			// Keep tile mode
+			if (tinyMCE.settings.button_tile_map && e.className && e.className.indexOf('mceTiledButton') == 0)
+				c = 'mceTiledButton ' + c;
 
-			if (!s.gecko_spellcheck)
-				t.getBody().spellcheck = 0;
+			e.className = c;
+		}
+	},
 
-			if (!s.readonly)
-				t._addEvents();
+	getAbsPosition : function(n, cn) {
+		var l = 0, t = 0;
 
-			t.controlManager.onPostRender.dispatch(t, t.controlManager);
-			t.onPostRender.dispatch(t);
+		while (n && n != cn) {
+			l += n.offsetLeft;
+			t += n.offsetTop;
+			n = n.offsetParent;
+		}
 
-			if (s.directionality)
-				t.getBody().dir = s.directionality;
+		return {absLeft : l, absTop : t};
+	},
 
-			if (s.nowrap)
-				t.getBody().style.whiteSpace = "nowrap";
+	prevNode : function(e, n) {
+		var a = n.split(','), i;
 
-			if (s.custom_elements) {
-				function handleCustom(ed, o) {
-					each(explode(s.custom_elements), function(v) {
-						var n;
-
-						if (v.indexOf('~') === 0) {
-							v = v.substring(1);
-							n = 'span';
-						} else
-							n = 'div';
-
-						o.content = o.content.replace(new RegExp('<(' + v + ')([^>]*)>', 'g'), '<' + n + ' _mce_name="$1"$2>');
-						o.content = o.content.replace(new RegExp('</(' + v + ')>', 'g'), '</' + n + '>');
-					});
-				};
-
-				t.onBeforeSetContent.add(handleCustom);
-				t.onPostProcess.add(function(ed, o) {
-					if (o.set)
-						handleCustom(ed, o);
-				});
+		while ((e = e.previousSibling) != null) {
+			for (i=0; i<a.length; i++) {
+				if (e.nodeName == a[i])
+					return e;
 			}
+		}
 
-			if (s.handle_node_change_callback) {
-				t.onNodeChange.add(function(ed, cm, n) {
-					t.execCallback('handle_node_change_callback', t.id, n, -1, -1, true, t.selection.isCollapsed());
-				});
-			}
+		return null;
+	},
 
-			if (s.save_callback) {
-				t.onSaveContent.add(function(ed, o) {
-					var h = t.execCallback('save_callback', t.id, o.content, t.getBody());
+	nextNode : function(e, n) {
+		var a = n.split(','), i;
 
-					if (h)
-						o.content = h;
-				});
+		while ((e = e.nextSibling) != null) {
+			for (i=0; i<a.length; i++) {
+				if (e.nodeName == a[i])
+					return e;
 			}
+		}
 
-			if (s.onchange_callback) {
-				t.onChange.add(function(ed, l) {
-					t.execCallback('onchange_callback', t, l);
-				});
-			}
+		return null;
+	},
 
-			if (s.convert_newlines_to_brs) {
-				t.onBeforeSetContent.add(function(ed, o) {
-					if (o.initial)
-						o.content = o.content.replace(/\r?\n/g, '<br />');
-				});
-			}
+	selectElements : function(n, na, f) {
+		var i, a = [], nl, x;
 
-			if (s.fix_nesting && isIE) {
-				t.onBeforeSetContent.add(function(ed, o) {
-					o.content = t._fixNesting(o.content);
-				});
-			}
+		for (x=0, na = na.split(','); x<na.length; x++)
+			for (i=0, nl = n.getElementsByTagName(na[x]); i<nl.length; i++)
+				(!f || f(nl[i])) && a.push(nl[i]);
 
-			if (s.preformatted) {
-				t.onPostProcess.add(function(ed, o) {
-					o.content = o.content.replace(/^\s*<pre.*?>/, '');
-					o.content = o.content.replace(/<\/pre>\s*$/, '');
+		return a;
+	},
 
-					if (o.set)
-						o.content = '<pre class="mceItemHidden">' + o.content + '</pre>';
-				});
-			}
+	selectNodes : function(n, f, a) {
+		var i;
 
-			if (s.verify_css_classes) {
-				t.serializer.attribValueFilter = function(n, v) {
-					var s, cl;
+		if (!a)
+			a = [];
 
-					if (n == 'class') {
-						// Build regexp for classes
-						if (!t.classesRE) {
-							cl = t.dom.getClasses();
+		if (f(n))
+			a[a.length] = n;
 
-							if (cl.length > 0) {
-								s = '';
+		if (n.hasChildNodes()) {
+			for (i=0; i<n.childNodes.length; i++)
+				tinyMCE.selectNodes(n.childNodes[i], f, a);
+		}
 
-								each (cl, function(o) {
-									s += (s ? '|' : '') + o['class'];
-								});
+		return a;
+	},
 
-								t.classesRE = new RegExp('(' + s + ')', 'gi');
-							}
-						}
+	addCSSClass : function(e, c, b) {
+		var o = this.removeCSSClass(e, c);
+		return e.className = b ? c + (o !== '' ? (' ' + o) : '') : (o !== '' ? (o + ' ') : '') + c;
+	},
 
-						return !t.classesRE || /(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(v) || t.classesRE.test(v) ? v : '';
-					}
+	removeCSSClass : function(e, c) {
+		c = e.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' ');
+		return e.className = c != ' ' ? c : '';
+	},
 
-					return v;
-				};
-			}
+	hasCSSClass : function(n, c) {
+		return new RegExp('\\b' + c + '\\b', 'g').test(n.className);
+	},
 
-			if (s.cleanup_callback) {
-				t.onBeforeSetContent.add(function(ed, o) {
-					o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o);
-				});
+	renameElement : function(e, n, d) {
+		var ne, i, ar;
 
-				t.onPreProcess.add(function(ed, o) {
-					if (o.set)
-						t.execCallback('cleanup_callback', 'insert_to_editor_dom', o.node, o);
+		d = typeof(d) == "undefined" ? tinyMCE.selectedInstance.getDoc() : d;
 
-					if (o.get)
-						t.execCallback('cleanup_callback', 'get_from_editor_dom', o.node, o);
-				});
+		if (e) {
+			ne = d.createElement(n);
 
-				t.onPostProcess.add(function(ed, o) {
-					if (o.set)
-						o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o);
-
-					if (o.get)						
-						o.content = t.execCallback('cleanup_callback', 'get_from_editor', o.content, o);
-				});
+			ar = e.attributes;
+			for (i=ar.length-1; i>-1; i--) {
+				if (ar[i].specified && ar[i].nodeValue)
+					ne.setAttribute(ar[i].nodeName.toLowerCase(), ar[i].nodeValue);
 			}
 
-			if (s.save_callback) {
-				t.onGetContent.add(function(ed, o) {
-					if (o.save)
-						o.content = t.execCallback('save_callback', t.id, o.content, t.getBody());
-				});
-			}
+			ar = e.childNodes;
+			for (i=0; i<ar.length; i++)
+				ne.appendChild(ar[i].cloneNode(true));
 
-			if (s.handle_event_callback) {
-				t.onEvent.add(function(ed, e, o) {
-					if (t.execCallback('handle_event_callback', e, ed, o) === false)
-						Event.cancel(e);
-				});
-			}
+			e.parentNode.replaceChild(ne, e);
+		}
+	},
 
-			// Add visual aids when new contents is added
-			t.onSetContent.add(function() {
-				t.addVisual(t.getBody());
-			});
+	getViewPort : function(w) {
+		var d = w.document, m = d.compatMode == 'CSS1Compat', b = d.body, de = d.documentElement;
 
-			// Remove empty contents
-			if (s.padd_empty_editor) {
-				t.onPostProcess.add(function(ed, o) {
-					o.content = o.content.replace(/^(<p[^>]*>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/, '');
-				});
-			}
+		return {
+			left : w.pageXOffset || (m ? de.scrollLeft : b.scrollLeft),
+			top : w.pageYOffset || (m ? de.scrollTop : b.scrollTop),
+			width : w.innerWidth || (m ? de.clientWidth : b.clientWidth),
+			height : w.innerHeight || (m ? de.clientHeight : b.clientHeight)
+		};
+	},
 
-			if (isGecko) {
-				// Fix 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
-				function fixLinks(ed, o) {
-					each(ed.dom.select('a'), function(n) {
-						var pn = n.parentNode;
+	getStyle : function(n, na, d) {
+		if (!n)
+			return false;
 
-						if (ed.dom.isBlock(pn) && pn.lastChild === n)
-							ed.dom.add(pn, 'br', {'_mce_bogus' : 1});
-					});
-				};
-
-				t.onExecCommand.add(function(ed, cmd) {
-					if (cmd === 'CreateLink')
-						fixLinks(ed);
-				});
-
-				t.onSetContent.add(t.selection.onSetContent.add(fixLinks));
-
-				if (!s.readonly) {
-					try {
-						// Design mode must be set here once again to fix a bug where
-						// Ctrl+A/Delete/Backspace didn't work if the editor was added using mceAddControl then removed then added again
-						d.designMode = 'Off';
-						d.designMode = 'On';
-					} catch (ex) {
-						// Will fail on Gecko if the editor is placed in an hidden container element
-						// The design mode will be set ones the editor is focused
-					}
-				}
+		// Gecko
+		if (tinyMCE.isGecko && n.ownerDocument.defaultView) {
+			try {
+				return n.ownerDocument.defaultView.getComputedStyle(n, null).getPropertyValue(na);
+			} catch (n) {
+				// Old safari might fail
+				return null;
 			}
+		}
 
-			// A small timeout was needed since firefox will remove. Bug: #1838304
-			setTimeout(function () {
-				if (t.removed)
-					return;
+		// Camelcase it, if needed
+		na = na.replace(/-(\D)/g, function(a, b){
+			return b.toUpperCase();
+		});
 
-				t.load({initial : true, format : (s.cleanup_on_startup ? 'html' : 'raw')});
-				t.startContent = t.getContent({format : 'raw'});
-				t.initialized = true;
+		// IE & Opera
+		if (n.currentStyle)
+			return n.currentStyle[na];
 
-				t.onInit.dispatch(t);
-				t.execCallback('setupcontent_callback', t.id, t.getBody(), t.getDoc());
-				t.execCallback('init_instance_callback', t);
-				t.focus(true);
-				t.nodeChanged({initial : 1});
+		return false;
+	}
 
-				// Load specified content CSS last
-				if (s.content_css) {
-					tinymce.each(explode(s.content_css), function(u) {
-						t.dom.loadCSS(t.documentBaseURI.toAbsolute(u));
-					});
-				}
+	});
 
-				// Handle auto focus
-				if (s.auto_focus) {
-					setTimeout(function () {
-						var ed = tinymce.get(s.auto_focus);
+/* file:jscripts/tiny_mce/classes/TinyMCE_URL.class.js */
 
-						ed.selection.select(ed.getBody(), 1);
-						ed.selection.collapse(1);
-						ed.getWin().focus();
-					}, 100);
-				}
-			}, 1);
-	
-			e = null;
-		},
+tinyMCE.add(TinyMCE_Engine, {
+	parseURL : function(url_str) {
+		var urlParts = [], i, pos, lastPos, chr;
 
-
-		focus : function(sf) {
-			var oed, t = this, ce = t.settings.content_editable, ieRng, controlElm, doc = t.getDoc();
-
-			if (!sf) {
-				// Get selected control element
-				ieRng = t.selection.getRng();
-				if (ieRng.item) {
-					controlElm = ieRng.item(0);
-				}
-
-				// Is not content editable
-				if (!ce)
-					t.getWin().focus();
-
-				// 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) {
-					ieRng = doc.body.createControlRange();
-					ieRng.addElement(controlElm);
-					ieRng.select();
-				}
-
+		if (url_str) {
+			// Parse protocol part
+			pos = url_str.indexOf('://');
+			if (pos != -1) {
+				urlParts.protocol = url_str.substring(0, pos);
+				lastPos = pos + 3;
 			}
 
-			if (tinymce.activeEditor != t) {
-				if ((oed = tinymce.activeEditor) != null)
-					oed.onDeactivate.dispatch(oed, t);
+			// Find port or path start
+			for (i=lastPos; i<url_str.length; i++) {
+				chr = url_str.charAt(i);
 
-				t.onActivate.dispatch(t, oed);
-			}
+				if (chr == ':')
+					break;
 
-			tinymce._setActive(t);
-		},
-
-		execCallback : function(n) {
-			var t = this, f = t.settings[n], s;
-
-			if (!f)
-				return;
-
-			// Look through lookup
-			if (t.callbackLookup && (s = t.callbackLookup[n])) {
-				f = s.func;
-				s = s.scope;
+				if (chr == '/')
+					break;
 			}
+			pos = i;
 
-			if (is(f, 'string')) {
-				s = f.replace(/\.\w+$/, '');
-				s = s ? tinymce.resolve(s) : 0;
-				f = tinymce.resolve(f);
-				t.callbackLookup = t.callbackLookup || {};
-				t.callbackLookup[n] = {func : f, scope : s};
-			}
+			// Get host
+			urlParts.host = url_str.substring(lastPos, pos);
 
-			return f.apply(s || t, Array.prototype.slice.call(arguments, 1));
-		},
-
-		translate : function(s) {
-			var c = this.settings.language || 'en', i18n = tinymce.i18n;
-
-			if (!s)
-				return '';
-
-			return i18n[c + '.' + s] || s.replace(/{\#([^}]+)\}/g, function(a, b) {
-				return i18n[c + '.' + b] || '{#' + b + '}';
-			});
-		},
-
-		getLang : function(n, dv) {
-			return tinymce.i18n[(this.settings.language || 'en') + '.' + n] || (is(dv) ? dv : '{#' + n + '}');
-		},
-
-		getParam : function(n, dv, ty) {
-			var tr = tinymce.trim, v = is(this.settings[n]) ? this.settings[n] : dv, o;
-
-			if (ty === 'hash') {
-				o = {};
-
-				if (is(v, 'string')) {
-					each(v.indexOf('=') > 0 ? v.split(/[;,](?![^=;,]*(?:[;,]|$))/) : v.split(','), function(v) {
-						v = v.split('=');
-
-						if (v.length > 1)
-							o[tr(v[0])] = tr(v[1]);
-						else
-							o[tr(v[0])] = tr(v);
-					});
-				} else
-					o = v;
-
-				return o;
+			// Get port
+			urlParts.port = "";
+			lastPos = pos;
+			if (url_str.charAt(pos) == ':') {
+				pos = url_str.indexOf('/', lastPos);
+				urlParts.port = url_str.substring(lastPos+1, pos);
 			}
 
-			return v;
-		},
+			// Get path
+			lastPos = pos;
+			pos = url_str.indexOf('?', lastPos);
 
-		nodeChanged : function(o) {
-			var t = this, s = t.selection, n = (isIE ? s.getNode() : s.getStart()) || t.getBody();
+			if (pos == -1)
+				pos = url_str.indexOf('#', lastPos);
 
-			// Fix for bug #1896577 it seems that this can not be fired while the editor is loading
-			if (t.initialized) {
-				o = o || {};
-				n = isIE && n.ownerDocument != t.getDoc() ? t.getBody() : n; // Fix for IE initial state
+			if (pos == -1)
+				pos = url_str.length;
 
-				// Get parents and add them to object
-				o.parents = [];
-				t.dom.getParent(n, function(node) {
-					if (node.nodeName == 'BODY')
-						return true;
+			urlParts.path = url_str.substring(lastPos, pos);
 
-					o.parents.push(node);
-				});
-
-				t.onNodeChange.dispatch(
-					t,
-					o ? o.controlManager || t.controlManager : t.controlManager,
-					n,
-					s.isCollapsed(),
-					o
-				);
+			// Get query
+			lastPos = pos;
+			if (url_str.charAt(pos) == '?') {
+				pos = url_str.indexOf('#');
+				pos = (pos == -1) ? url_str.length : pos;
+				urlParts.query = url_str.substring(lastPos+1, pos);
 			}
-		},
 
-		addButton : function(n, s) {
-			var t = this;
-
-			t.buttons = t.buttons || {};
-			t.buttons[n] = s;
-		},
-
-		addCommand : function(n, f, s) {
-			this.execCommands[n] = {func : f, scope : s || this};
-		},
-
-		addQueryStateHandler : function(n, f, s) {
-			this.queryStateCommands[n] = {func : f, scope : s || this};
-		},
-
-		addQueryValueHandler : function(n, f, s) {
-			this.queryValueCommands[n] = {func : f, scope : s || this};
-		},
-
-		addShortcut : function(pa, desc, cmd_func, sc) {
-			var t = this, c;
-
-			if (!t.settings.custom_shortcuts)
-				return false;
-
-			t.shortcuts = t.shortcuts || {};
-
-			if (is(cmd_func, 'string')) {
-				c = cmd_func;
-
-				cmd_func = function() {
-					t.execCommand(c, false, null);
-				};
+			// Get anchor
+			lastPos = pos;
+			if (url_str.charAt(pos) == '#') {
+				pos = url_str.length;
+				urlParts.anchor = url_str.substring(lastPos+1, pos);
 			}
+		}
 
-			if (is(cmd_func, 'object')) {
-				c = cmd_func;
+		return urlParts;
+	},
 
-				cmd_func = function() {
-					t.execCommand(c[0], c[1], c[2]);
-				};
-			}
+	serializeURL : function(up) {
+		var o = "";
 
-			each(explode(pa), function(pa) {
-				var o = {
-					func : cmd_func,
-					scope : sc || this,
-					desc : desc,
-					alt : false,
-					ctrl : false,
-					shift : false
-				};
+		if (up.protocol)
+			o += up.protocol + "://";
 
-				each(explode(pa, '+'), function(v) {
-					switch (v) {
-						case 'alt':
-						case 'ctrl':
-						case 'shift':
-							o[v] = true;
-							break;
+		if (up.host)
+			o += up.host;
 
-						default:
-							o.charCode = v.charCodeAt(0);
-							o.keyCode = v.toUpperCase().charCodeAt(0);
-					}
-				});
+		if (up.port)
+			o += ":" + up.port;
 
-				t.shortcuts[(o.ctrl ? 'ctrl' : '') + ',' + (o.alt ? 'alt' : '') + ',' + (o.shift ? 'shift' : '') + ',' + o.keyCode] = o;
-			});
+		if (up.path)
+			o += up.path;
 
-			return true;
-		},
+		if (up.query)
+			o += "?" + up.query;
 
-		execCommand : function(cmd, ui, val, a) {
-			var t = this, s = 0, o, st;
+		if (up.anchor)
+			o += "#" + up.anchor;
 
-			if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(cmd) && (!a || !a.skip_focus))
-				t.focus();
+		return o;
+	},
 
-			o = {};
-			t.onBeforeExecCommand.dispatch(t, cmd, ui, val, o);
-			if (o.terminate)
-				return false;
+	convertAbsoluteURLToRelativeURL : function(base_url, url_to_relative) {
+		var baseURL = this.parseURL(base_url), targetURL = this.parseURL(url_to_relative);
+		var i, strTok1, strTok2, breakPoint = 0, outPath = "", forceSlash = false;
+		var fileName, pos;
 
-			// Command callback
-			if (t.execCallback('execcommand_callback', t.id, t.selection.getNode(), cmd, ui, val)) {
-				t.onExecCommand.dispatch(t, cmd, ui, val, a);
-				return true;
-			}
+		if (targetURL.path == '')
+			targetURL.path = "/";
+		else
+			forceSlash = true;
 
-			// Registred commands
-			if (o = t.execCommands[cmd]) {
-				st = o.func.call(o.scope, ui, val);
+		// Crop away last path part
+		base_url = baseURL.path.substring(0, baseURL.path.lastIndexOf('/'));
+		strTok1 = base_url.split('/');
+		strTok2 = targetURL.path.split('/');
 
-				// Fall through on true
-				if (st !== true) {
-					t.onExecCommand.dispatch(t, cmd, ui, val, a);
-					return st;
+		if (strTok1.length >= strTok2.length) {
+			for (i=0; i<strTok1.length; i++) {
+				if (i >= strTok2.length || strTok1[i] != strTok2[i]) {
+					breakPoint = i + 1;
+					break;
 				}
 			}
+		}
 
-			// Plugin commands
-			each(t.plugins, function(p) {
-				if (p.execCommand && p.execCommand(cmd, ui, val)) {
-					t.onExecCommand.dispatch(t, cmd, ui, val, a);
-					s = 1;
-					return false;
+		if (strTok1.length < strTok2.length) {
+			for (i=0; i<strTok2.length; i++) {
+				if (i >= strTok1.length || strTok1[i] != strTok2[i]) {
+					breakPoint = i + 1;
+					break;
 				}
-			});
-
-			if (s)
-				return true;
-
-			// Theme commands
-			if (t.theme && t.theme.execCommand && t.theme.execCommand(cmd, ui, val)) {
-				t.onExecCommand.dispatch(t, cmd, ui, val, a);
-				return true;
 			}
+		}
 
-			// Execute global commands
-			if (tinymce.GlobalCommands.execCommand(t, cmd, ui, val)) {
-				t.onExecCommand.dispatch(t, cmd, ui, val, a);
-				return true;
-			}
+		if (breakPoint == 1)
+			return targetURL.path;
 
-			// Editor commands
-			if (t.editorCommands.execCommand(cmd, ui, val)) {
-				t.onExecCommand.dispatch(t, cmd, ui, val, a);
-				return true;
-			}
+		for (i=0; i<(strTok1.length-(breakPoint-1)); i++)
+			outPath += "../";
 
-			// Browser commands
-			t.getDoc().execCommand(cmd, ui, val);
-			t.onExecCommand.dispatch(t, cmd, ui, val, a);
-		},
+		for (i=breakPoint-1; i<strTok2.length; i++) {
+			if (i != (breakPoint-1))
+				outPath += "/" + strTok2[i];
+			else
+				outPath += strTok2[i];
+		}
 
-		queryCommandState : function(cmd) {
-			var t = this, o, s;
+		targetURL.protocol = null;
+		targetURL.host = null;
+		targetURL.port = null;
+		targetURL.path = outPath == '' && forceSlash ? "/" : outPath;
 
-			// Is hidden then return undefined
-			if (t._isHidden())
-				return;
+		// Remove document prefix from local anchors
+		fileName = baseURL.path;
 
-			// Registred commands
-			if (o = t.queryStateCommands[cmd]) {
-				s = o.func.call(o.scope);
+		if ((pos = fileName.lastIndexOf('/')) != -1)
+			fileName = fileName.substring(pos + 1);
 
-				// Fall though on true
-				if (s !== true)
-					return s;
-			}
+		// Is local anchor
+		if (fileName == targetURL.path && targetURL.anchor !== '')
+			targetURL.path = "";
 
-			// Registred commands
-			o = t.editorCommands.queryCommandState(cmd);
-			if (o !== -1)
-				return o;
+		// If empty and not local anchor force filename or slash
+		if (targetURL.path == '' && !targetURL.anchor)
+			targetURL.path = fileName !== '' ? fileName : "/";
 
-			// Browser commands
-			try {
-				return this.getDoc().queryCommandState(cmd);
-			} catch (ex) {
-				// Fails sometimes see bug: 1896577
-			}
-		},
+		return this.serializeURL(targetURL);
+	},
 
-		queryCommandValue : function(c) {
-			var t = this, o, s;
+	convertRelativeToAbsoluteURL : function(base_url, relative_url) {
+		var baseURL = this.parseURL(base_url), baseURLParts, relURLParts, newRelURLParts, numBack, relURL = this.parseURL(relative_url), i;
+		var len, absPath, start, end, newBaseURLParts;
 
-			// Is hidden then return undefined
-			if (t._isHidden())
-				return;
+		if (relative_url == '' || relative_url.indexOf('://') != -1 || /^(mailto:|javascript:|#|\/)/.test(relative_url))
+			return relative_url;
 
-			// Registred commands
-			if (o = t.queryValueCommands[c]) {
-				s = o.func.call(o.scope);
+		// Split parts
+		baseURLParts = baseURL.path.split('/');
+		relURLParts = relURL.path.split('/');
 
-				// Fall though on true
-				if (s !== true)
-					return s;
-			}
+		// Remove empty chunks
+		newBaseURLParts = [];
+		for (i=baseURLParts.length-1; i>=0; i--) {
+			if (baseURLParts[i].length == 0)
+				continue;
 
-			// Registred commands
-			o = t.editorCommands.queryCommandValue(c);
-			if (is(o))
-				return o;
+			newBaseURLParts[newBaseURLParts.length] = baseURLParts[i];
+		}
+		baseURLParts = newBaseURLParts.reverse();
 
-			// Browser commands
-			try {
-				return this.getDoc().queryCommandValue(c);
-			} catch (ex) {
-				// Fails sometimes see bug: 1896577
-			}
-		},
+		// Merge relURLParts chunks
+		newRelURLParts = [];
+		numBack = 0;
+		for (i=relURLParts.length-1; i>=0; i--) {
+			if (relURLParts[i].length == 0 || relURLParts[i] == ".")
+				continue;
 
-		show : function() {
-			var t = this;
-
-			DOM.show(t.getContainer());
-			DOM.hide(t.id);
-			t.load();
-		},
-
-		hide : function() {
-			var t = this, d = t.getDoc();
-
-			// Fixed bug where IE has a blinking cursor left from the editor
-			if (isIE && d)
-				d.execCommand('SelectAll');
-
-			// We must save before we hide so Safari doesn't crash
-			t.save();
-			DOM.hide(t.getContainer());
-			DOM.setStyle(t.id, 'display', t.orgDisplay);
-		},
-
-		isHidden : function() {
-			return !DOM.isHidden(this.id);
-		},
-
-		setProgressState : function(b, ti, o) {
-			this.onSetProgressState.dispatch(this, b, ti, o);
-
-			return b;
-		},
-
-		load : function(o) {
-			var t = this, e = t.getElement(), h;
-
-			if (e) {
-				o = o || {};
-				o.load = true;
-
-				// Double encode existing entities in the value
-				h = t.setContent(is(e.value) ? e.value : e.innerHTML, o);
-				o.element = e;
-
-				if (!o.no_events)
-					t.onLoadContent.dispatch(t, o);
-
-				o.element = e = null;
-
-				return h;
+			if (relURLParts[i] == '..') {
+				numBack++;
+				continue;
 			}
-		},
 
-		save : function(o) {
-			var t = this, e = t.getElement(), h, f;
-
-			if (!e || !t.initialized)
-				return;
-
-			o = o || {};
-			o.save = true;
-
-			// Add undo level will trigger onchange event
-			if (!o.no_events) {
-				t.undoManager.typing = 0;
-				t.undoManager.add();
+			if (numBack > 0) {
+				numBack--;
+				continue;
 			}
 
-			o.element = e;
-			h = o.content = t.getContent(o);
+			newRelURLParts[newRelURLParts.length] = relURLParts[i];
+		}
 
-			if (!o.no_events)
-				t.onSaveContent.dispatch(t, o);
+		relURLParts = newRelURLParts.reverse();
 
-			h = o.content;
+		// Remove end from absolute path
+		len = baseURLParts.length-numBack;
+		absPath = (len <= 0 ? "" : "/") + baseURLParts.slice(0, len).join('/') + "/" + relURLParts.join('/');
+		start = "";
+		end = "";
 
-			if (!/TEXTAREA|INPUT/i.test(e.nodeName)) {
-				e.innerHTML = h;
+		// Build output URL
+		relURL.protocol = baseURL.protocol;
+		relURL.host = baseURL.host;
+		relURL.port = baseURL.port;
 
-				// Update hidden form element
-				if (f = DOM.getParent(t.id, 'form')) {
-					each(f.elements, function(e) {
-						if (e.name == t.id) {
-							e.value = h;
-							return false;
-						}
-					});
-				}
-			} else
-				e.value = h;
+		// Re-add trailing slash if it's removed
+		if (relURL.path.charAt(relURL.path.length-1) == "/")
+			absPath += "/";
 
-			o.element = e = null;
+		relURL.path = absPath;
 
-			return h;
-		},
+		return this.serializeURL(relURL);
+	},
 
-		setContent : function(h, o) {
-			var t = this;
+	convertURL : function(url, node, on_save) {
+		var dl = document.location, start, portPart, urlParts, baseUrlParts, tmpUrlParts, curl;
+		var prot = dl.protocol, host = dl.hostname, port = dl.port;
 
-			o = o || {};
-			o.format = o.format || 'html';
-			o.set = true;
-			o.content = h;
+		// Pass through file protocol
+		if (prot == "file:")
+			return url;
 
-			if (!o.no_events)
-				t.onBeforeSetContent.dispatch(t, o);
+		// Something is wrong, remove weirdness
+		url = tinyMCE.regexpReplace(url, '(http|https):///', '/');
 
-			// 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 (!tinymce.isIE && (h.length === 0 || /^\s+$/.test(h))) {
-				o.content = t.dom.setHTML(t.getBody(), '<br _mce_bogus="1" />');
-				o.format = 'raw';
-			}
+		// Mailto link or anchor (Pass through)
+		if (url.indexOf('mailto:') != -1 || url.indexOf('javascript:') != -1 || /^[ \t\r\n\+]*[#\?]/.test(url))
+			return url;
 
-			o.content = t.dom.setHTML(t.getBody(), tinymce.trim(o.content));
+		// Fix relative/Mozilla
+		if (!tinyMCE.isIE && !on_save && url.indexOf("://") == -1 && url.charAt(0) != '/')
+			return tinyMCE.settings.base_href + url;
 
-			if (o.format != 'raw' && t.settings.cleanup) {
-				o.getInner = true;
-				o.content = t.dom.setHTML(t.getBody(), t.serializer.serialize(t.getBody(), o));
-			}
+		// Handle relative URLs
+		if (on_save && tinyMCE.getParam('relative_urls')) {
+			curl = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings.base_href, url);
+			if (curl.charAt(0) == '/')
+				curl = tinyMCE.settings.document_base_prefix + curl;
 
-			if (!o.no_events)
-				t.onSetContent.dispatch(t, o);
+			urlParts = tinyMCE.parseURL(curl);
+			tmpUrlParts = tinyMCE.parseURL(tinyMCE.settings.document_base_url);
 
-			return o.content;
-		},
+			// Force relative
+			if (urlParts.host == tmpUrlParts.host && (urlParts.port == tmpUrlParts.port))
+				return tinyMCE.convertAbsoluteURLToRelativeURL(tinyMCE.settings.document_base_url, curl);
+		}
 
-		getContent : function(o) {
-			var t = this, h;
+		// Handle absolute URLs
+		if (!tinyMCE.getParam('relative_urls')) {
+			urlParts = tinyMCE.parseURL(url);
+			baseUrlParts = tinyMCE.parseURL(tinyMCE.settings.base_href);
 
-			o = o || {};
-			o.format = o.format || 'html';
-			o.get = true;
+			// Force absolute URLs from relative URLs
+			url = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings.base_href, url);
 
-			if (!o.no_events)
-				t.onBeforeGetContent.dispatch(t, o);
+			// If anchor and path is the same page
+			if (urlParts.anchor && urlParts.path == baseUrlParts.path)
+				return "#" + urlParts.anchor;
+		}
 
-			if (o.format != 'raw' && t.settings.cleanup) {
-				o.getInner = true;
-				h = t.serializer.serialize(t.getBody(), o);
-			} else
-				h = t.getBody().innerHTML;
+		// Remove current domain
+		if (tinyMCE.getParam('remove_script_host')) {
+			start = "";
+			portPart = "";
 
-			h = h.replace(/^\s*|\s*$/g, '');
-			o.content = h;
+			if (port !== '')
+				portPart = ":" + port;
 
-			if (!o.no_events)
-				t.onGetContent.dispatch(t, o);
+			start = prot + "//" + host + portPart + "/";
 
-			return o.content;
-		},
+			if (url.indexOf(start) == 0)
+				url = url.substring(start.length-1);
+		}
 
-		isDirty : function() {
-			var t = this;
+		return url;
+	},
 
-			return tinymce.trim(t.startContent) != tinymce.trim(t.getContent({format : 'raw', no_events : 1})) && !t.isNotDirty;
-		},
+	convertAllRelativeURLs : function(body) {
+		var i, elms, src, href, mhref, msrc;
 
-		getContainer : function() {
-			var t = this;
+		// Convert all image URL:s to absolute URL
+		elms = body.getElementsByTagName("img");
+		for (i=0; i<elms.length; i++) {
+			src = tinyMCE.getAttrib(elms[i], 'src');
 
-			if (!t.container)
-				t.container = DOM.get(t.editorContainer || t.id + '_parent');
+			msrc = tinyMCE.getAttrib(elms[i], 'mce_src');
+			if (msrc !== '')
+				src = msrc;
 
-			return t.container;
-		},
-
-		getContentAreaContainer : function() {
-			return this.contentAreaContainer;
-		},
-
-		getElement : function() {
-			return DOM.get(this.settings.content_element || this.id);
-		},
-
-		getWin : function() {
-			var t = this, e;
-
-			if (!t.contentWindow) {
-				e = DOM.get(t.id + "_ifr");
-
-				if (e)
-					t.contentWindow = e.contentWindow;
+			if (src !== '') {
+				src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings.base_href, src);
+				elms[i].setAttribute("src", src);
 			}
+		}
 
-			return t.contentWindow;
-		},
+		// Convert all link URL:s to absolute URL
+		elms = body.getElementsByTagName("a");
+		for (i=0; i<elms.length; i++) {
+			href = tinyMCE.getAttrib(elms[i], 'href');
 
-		getDoc : function() {
-			var t = this, w;
+			mhref = tinyMCE.getAttrib(elms[i], 'mce_href');
+			if (mhref !== '')
+				href = mhref;
 
-			if (!t.contentDocument) {
-				w = t.getWin();
-
-				if (w)
-					t.contentDocument = w.document;
+			if (href && href !== '') {
+				href = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings.base_href, href);
+				elms[i].setAttribute("href", href);
 			}
+		}
+	}
 
-			return t.contentDocument;
-		},
+	});
 
-		getBody : function() {
-			return this.bodyElement || this.getDoc().body;
-		},
+/* file:jscripts/tiny_mce/classes/TinyMCE_Array.class.js */
 
-		convertURL : function(u, n, e) {
-			var t = this, s = t.settings;
+tinyMCE.add(TinyMCE_Engine, {
+	clearArray : function(a) {
+		var n;
 
-			// Use callback instead
-			if (s.urlconverter_callback)
-				return t.execCallback('urlconverter_callback', u, e, true, n);
+		for (n in a)
+			a[n] = null;
 
-			// Don't convert link href since thats the CSS files that gets loaded into the editor also skip local file URLs
-			if (!s.convert_urls || (e && e.nodeName == 'LINK') || u.indexOf('file:') === 0)
-				return u;
+		return a;
+	},
 
-			// Convert to relative
-			if (s.relative_urls)
-				return t.documentBaseURI.toRelative(u);
+	explode : function(d, s) {
+		var ar = s.split(d), oar = [], i;
 
-			// Convert to absolute
-			u = t.documentBaseURI.toAbsolute(u, s.remove_script_host);
+		for (i = 0; i<ar.length; i++) {
+			if (ar[i] !== '')
+				oar[oar.length] = ar[i];
+		}
 
-			return u;
-		},
+		return oar;
+	}
+});
 
-		addVisual : function(e) {
-			var t = this, s = t.settings;
+/* file:jscripts/tiny_mce/classes/TinyMCE_Event.class.js */
 
-			e = e || t.getBody();
+tinyMCE.add(TinyMCE_Engine, {
+	_setEventsEnabled : function(node, state) {
+		var evs, x, y, elms, i, event;
+		var events = ['onfocus','onblur','onclick','ondblclick',
+					'onmousedown','onmouseup','onmouseover','onmousemove',
+					'onmouseout','onkeypress','onkeydown','onkeydown','onkeyup'];
 
-			if (!is(t.hasVisual))
-				t.hasVisual = s.visual;
+		evs = tinyMCE.settings.event_elements.split(',');
+		for (y=0; y<evs.length; y++){
+			elms = node.getElementsByTagName(evs[y]);
+			for (i=0; i<elms.length; i++) {
+				event = "";
 
-			each(t.dom.select('table,a', e), function(e) {
-				var v;
+				for (x=0; x<events.length; x++) {
+					if ((event = tinyMCE.getAttrib(elms[i], events[x])) !== '') {
+						event = tinyMCE.cleanupEventStr("" + event);
 
-				switch (e.nodeName) {
-					case 'TABLE':
-						v = t.dom.getAttrib(e, 'border');
+						if (!state)
+							event = "return true;" + event;
+						else
+							event = event.replace(/^return true;/gi, '');
 
-						if (!v || v == '0') {
-							if (t.hasVisual)
-								t.dom.addClass(e, s.visual_table_class);
-							else
-								t.dom.removeClass(e, s.visual_table_class);
-						}
-
-						return;
-
-					case 'A':
-						v = t.dom.getAttrib(e, 'name');
-
-						if (v) {
-							if (t.hasVisual)
-								t.dom.addClass(e, 'mceItemAnchor');
-							else
-								t.dom.removeClass(e, 'mceItemAnchor');
-						}
-
-						return;
+						elms[i].removeAttribute(events[x]);
+						elms[i].setAttribute(events[x], event);
+					}
 				}
-			});
-
-			t.onVisualAid.dispatch(t, e, t.hasVisual);
-		},
-
-		remove : function() {
-			var t = this, e = t.getContainer();
-
-			t.removed = 1; // Cancels post remove event execution
-			t.hide();
-
-			t.execCallback('remove_instance_callback', t);
-			t.onRemove.dispatch(t);
-
-			// Clear all execCommand listeners this is required to avoid errors if the editor was removed inside another command
-			t.onExecCommand.listeners = [];
-
-			tinymce.remove(t);
-			DOM.remove(e);
-		},
-
-		destroy : function(s) {
-			var t = this;
-
-			// One time is enough
-			if (t.destroyed)
-				return;
-
-			if (!s) {
-				tinymce.removeUnload(t.destroy);
-				tinyMCE.onBeforeUnload.remove(t._beforeUnload);
-
-				// Manual destroy
-				if (t.theme && t.theme.destroy)
-					t.theme.destroy();
-
-				// Destroy controls, selection and dom
-				t.controlManager.destroy();
-				t.selection.destroy();
-				t.dom.destroy();
-
-				// Remove all events
-
-				// Don't clear the window or document if content editable
-				// is enabled since other instances might still be present
-				if (!t.settings.content_editable) {
-					Event.clear(t.getWin());
-					Event.clear(t.getDoc());
-				}
-
-				Event.clear(t.getBody());
-				Event.clear(t.formElement);
 			}
+		}
+	},
 
-			if (t.formElement) {
-				t.formElement.submit = t.formElement._mceOldSubmit;
-				t.formElement._mceOldSubmit = null;
-			}
+	_eventPatch : function(editor_id) {
+		var n, inst, win, e;
 
-			t.contentAreaContainer = t.formElement = t.container = t.settings.content_element = t.bodyElement = t.contentDocument = t.contentWindow = null;
+		// Remove odd, error
+		if (typeof(tinyMCE) == "undefined")
+			return true;
 
-			if (t.selection)
-				t.selection = t.selection.win = t.selection.dom = t.selection.dom.doc = null;
+		try {
+			// Try selected instance first
+			if (tinyMCE.selectedInstance) {
+				win = tinyMCE.selectedInstance.getWin();
 
-			t.destroyed = 1;
-		},
+				if (win && win.event) {
+					e = win.event;
 
-		// Internal functions
+					if (!e.target)
+						e.target = e.srcElement;
 
-		_addEvents : function() {
-			// 'focus', 'blur', 'dblclick', 'beforedeactivate', submit, reset
-			var t = this, i, s = t.settings, lo = {
-				mouseup : 'onMouseUp',
-				mousedown : 'onMouseDown',
-				click : 'onClick',
-				keyup : 'onKeyUp',
-				keydown : 'onKeyDown',
-				keypress : 'onKeyPress',
-				submit : 'onSubmit',
-				reset : 'onReset',
-				contextmenu : 'onContextMenu',
-				dblclick : 'onDblClick',
-				paste : 'onPaste' // Doesn't work in all browsers yet
-			};
-
-			function eventHandler(e, o) {
-				var ty = e.type;
-
-				// Don't fire events when it's removed
-				if (t.removed)
+					TinyMCE_Engine.prototype.handleEvent(e);
 					return;
-
-				// Generic event handler
-				if (t.onEvent.dispatch(t, e, o) !== false) {
-					// Specific event handler
-					t[lo[e.fakeType || e.type]].dispatch(t, e, o);
 				}
-			};
-
-			// Add DOM events
-			each(lo, function(v, k) {
-				switch (k) {
-					case 'contextmenu':
-						if (tinymce.isOpera) {
-							// Fake contextmenu on Opera
-							t.dom.bind(t.getBody(), 'mousedown', function(e) {
-								if (e.ctrlKey) {
-									e.fakeType = 'contextmenu';
-									eventHandler(e);
-								}
-							});
-						} else
-							t.dom.bind(t.getBody(), k, eventHandler);
-						break;
-
-					case 'paste':
-						t.dom.bind(t.getBody(), k, function(e) {
-							eventHandler(e);
-						});
-						break;
-
-					case 'submit':
-					case 'reset':
-						t.dom.bind(t.getElement().form || DOM.getParent(t.id, 'form'), k, eventHandler);
-						break;
-
-					default:
-						t.dom.bind(s.content_editable ? t.getBody() : t.getDoc(), k, eventHandler);
-				}
-			});
-
-			t.dom.bind(s.content_editable ? t.getBody() : (isGecko ? t.getDoc() : t.getWin()), 'focus', function(e) {
-				t.focus(true);
-			});
-
-
-			// Fixes bug where a specified document_base_uri could result in broken images
-			// This will also fix drag drop of images in Gecko
-			if (tinymce.isGecko) {
-				// Convert all images to absolute URLs
-/*				t.onSetContent.add(function(ed, o) {
-					each(ed.dom.select('img'), function(e) {
-						var v;
-
-						if (v = e.getAttribute('_mce_src'))
-							e.src = t.documentBaseURI.toAbsolute(v);
-					})
-				});*/
-
-				t.dom.bind(t.getDoc(), 'DOMNodeInserted', function(e) {
-					var v;
-
-					e = e.target;
-
-					if (e.nodeType === 1 && e.nodeName === 'IMG' && (v = e.getAttribute('_mce_src')))
-						e.src = t.documentBaseURI.toAbsolute(v);
-				});
 			}
 
-			// Set various midas options in Gecko
-			if (isGecko) {
-				function setOpts() {
-					var t = this, d = t.getDoc(), s = t.settings;
+			// Search for it
+			for (n in tinyMCE.instances) {
+				inst = tinyMCE.instances[n];
 
-					if (isGecko && !s.readonly) {
-						if (t._isHidden()) {
-							try {
-								if (!s.content_editable)
-									d.designMode = 'On';
-							} catch (ex) {
-								// Fails if it's hidden
-							}
-						}
+				if (!tinyMCE.isInstance(inst))
+					continue;
 
-						try {
-							// Try new Gecko method
-							d.execCommand("styleWithCSS", 0, false);
-						} catch (ex) {
-							// Use old method
-							if (!t._isHidden())
-								try {d.execCommand("useCSS", 0, true);} catch (ex) {}
-						}
+				inst.select();
+				win = inst.getWin();
 
-						if (!s.table_inline_editing)
-							try {d.execCommand('enableInlineTableEditing', false, false);} catch (ex) {}
+				if (win && win.event) {
+					e = win.event;
 
-						if (!s.object_resizing)
-							try {d.execCommand('enableObjectResizing', false, false);} catch (ex) {}
-					}
-				};
+					if (!e.target)
+						e.target = e.srcElement;
 
-				t.onBeforeExecCommand.add(setOpts);
-				t.onMouseDown.add(setOpts);
-			}
-
-			// Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250
-			// WebKit can't even do simple things like selecting an image
-			// This also fixes so it's possible to select mceItemAnchors
-			if (tinymce.isWebKit) {
-				t.onClick.add(function(ed, e) {
-					e = e.target;
-
-					// Needs tobe the setBaseAndExtend or it will fail to select floated images
-					if (e.nodeName == 'IMG' || (e.nodeName == 'A' && t.dom.hasClass(e, 'mceItemAnchor')))
-						t.selection.getSel().setBaseAndExtent(e, 0, e, 1);
-				});
-			}
-
-			// Add node change handlers
-			t.onMouseUp.add(t.nodeChanged);
-			//t.onClick.add(t.nodeChanged);
-			t.onKeyUp.add(function(ed, e) {
-				var c = e.keyCode;
-
-				if ((c >= 33 && c <= 36) || (c >= 37 && c <= 40) || c == 13 || c == 45 || c == 46 || c == 8 || (tinymce.isMac && (c == 91 || c == 93)) || e.ctrlKey)
-					t.nodeChanged();
-			});
-
-			// Add reset handler
-			t.onReset.add(function() {
-				t.setContent(t.startContent, {format : 'raw'});
-			});
-
-			// Add shortcuts
-			if (s.custom_shortcuts) {
-				if (s.custom_undo_redo_keyboard_shortcuts) {
-					t.addShortcut('ctrl+z', t.getLang('undo_desc'), 'Undo');
-					t.addShortcut('ctrl+y', t.getLang('redo_desc'), 'Redo');
+					TinyMCE_Engine.prototype.handleEvent(e);
+					return;
 				}
-
-				// Add default shortcuts for gecko
-				t.addShortcut('ctrl+b', t.getLang('bold_desc'), 'Bold');
-				t.addShortcut('ctrl+i', t.getLang('italic_desc'), 'Italic');
-				t.addShortcut('ctrl+u', t.getLang('underline_desc'), 'Underline');
-
-				// BlockFormat shortcuts keys
-				for (i=1; i<=6; i++)
-					t.addShortcut('ctrl+' + i, '', ['FormatBlock', false, 'h' + i]);
-
-				t.addShortcut('ctrl+7', '', ['FormatBlock', false, '<p>']);
-				t.addShortcut('ctrl+8', '', ['FormatBlock', false, '<div>']);
-				t.addShortcut('ctrl+9', '', ['FormatBlock', false, '<address>']);
-
-				function find(e) {
-					var v = null;
-
-					if (!e.altKey && !e.ctrlKey && !e.metaKey)
-						return v;
-
-					each(t.shortcuts, function(o) {
-						if (tinymce.isMac && o.ctrl != e.metaKey)
-							return;
-						else if (!tinymce.isMac && o.ctrl != e.ctrlKey)
-							return;
-
-						if (o.alt != e.altKey)
-							return;
-
-						if (o.shift != e.shiftKey)
-							return;
-
-						if (e.keyCode == o.keyCode || (e.charCode && e.charCode == o.charCode)) {
-							v = o;
-							return false;
-						}
-					});
-
-					return v;
-				};
-
-				t.onKeyUp.add(function(ed, e) {
-					var o = find(e);
-
-					if (o)
-						return Event.cancel(e);
-				});
-
-				t.onKeyPress.add(function(ed, e) {
-					var o = find(e);
-
-					if (o)
-						return Event.cancel(e);
-				});
-
-				t.onKeyDown.add(function(ed, e) {
-					var o = find(e);
-
-					if (o) {
-						o.func.call(o.scope);
-						return Event.cancel(e);
-					}
-				});
 			}
+		} catch (ex) {
+			// Ignore error if iframe is pointing to external URL
+		}
+	},
 
-			if (tinymce.isIE) {
-				// Fix so resize will only update the width and height attributes not the styles of an image
-				// It will also block mceItemNoResize items
-				t.dom.bind(t.getDoc(), 'controlselect', function(e) {
-					var re = t.resizeInfo, cb;
+	findEvent : function(e) {
+		var n, inst;
 
-					e = e.target;
+		if (e)
+			return e;
 
-					// Don't do this action for non image elements
-					if (e.nodeName !== 'IMG')
-						return;
+		for (n in tinyMCE.instances) {
+			inst = tinyMCE.instances[n];
 
-					if (re)
-						t.dom.unbind(re.node, re.ev, re.cb);
+			if (tinyMCE.isInstance(inst) && inst.getWin().event)
+				return inst.getWin().event;
+		}
 
-					if (!t.dom.hasClass(e, 'mceItemNoResize')) {
-						ev = 'resizeend';
-						cb = t.dom.bind(e, ev, function(e) {
-							var v;
+		return null;
+	},
 
-							e = e.target;
+	unloadHandler : function() {
+		tinyMCE.triggerSave(true, true);
+	},
 
-							if (v = t.dom.getStyle(e, 'width')) {
-								t.dom.setAttrib(e, 'width', v.replace(/[^0-9%]+/g, ''));
-								t.dom.setStyle(e, 'width', '');
-							}
+	addEventHandlers : function(inst) {
+		this.setEventHandlers(inst, 1);
+	},
 
-							if (v = t.dom.getStyle(e, 'height')) {
-								t.dom.setAttrib(e, 'height', v.replace(/[^0-9%]+/g, ''));
-								t.dom.setStyle(e, 'height', '');
-							}
-						});
-					} else {
-						ev = 'resizestart';
-						cb = t.dom.bind(e, 'resizestart', Event.cancel, Event);
-					}
+	setEventHandlers : function(inst, s) {
+		var doc = inst.getDoc(), ie, ot, i, f = s ? tinyMCE.addEvent : tinyMCE.removeEvent;
 
-					re = t.resizeInfo = {
-						node : e,
-						ev : ev,
-						cb : cb
-					};
-				});
+		ie = ['keypress', 'keyup', 'keydown', 'click', 'mouseup', 'mousedown', 'controlselect', 'dblclick'];
+		ot = ['keypress', 'keyup', 'keydown', 'click', 'mouseup', 'mousedown', 'focus', 'blur', 'dragdrop'];
 
-				t.onKeyDown.add(function(ed, e) {
-					switch (e.keyCode) {
-						case 8:
-							// Fix IE control + backspace browser bug
-							if (t.selection.getRng().item) {
-								ed.dom.remove(t.selection.getRng().item(0));
-								return Event.cancel(e);
-							}
-					}
-				});
+		inst.switchSettings();
 
-				/*if (t.dom.boxModel) {
-					t.getBody().style.height = '100%';
+		if (tinyMCE.isIE) {
+			for (i=0; i<ie.length; i++)
+				f(doc, ie[i], TinyMCE_Engine.prototype._eventPatch);
+		} else {
+			for (i=0; i<ot.length; i++)
+				f(doc, ot[i], tinyMCE.handleEvent);
 
-					Event.add(t.getWin(), 'resize', function(e) {
-						var docElm = t.getDoc().documentElement;
-
-						docElm.style.height = (docElm.offsetHeight - 10) + 'px';
-					});
-				}*/
+			// Force designmode
+			try {
+				doc.designMode = "On";
+			} catch (e) {
+				// Ignore
 			}
+		}
+	},
 
-			if (tinymce.isOpera) {
-				t.onClick.add(function(ed, e) {
-					Event.prevent(e);
-				});
-			}
+	onMouseMove : function() {
+		var inst, lh;
 
-			// Add custom undo/redo handlers
-			if (s.custom_undo_redo) {
-				function addUndo() {
-					t.undoManager.typing = 0;
-					t.undoManager.add();
-				};
+		// Fix for IE7 bug where it's not restoring hover on anchors correctly
+		if (tinyMCE.lastHover) {
+			lh = tinyMCE.lastHover;
 
-				t.dom.bind(t.getDoc(), 'focusout', function(e) {
-					if (!t.removed && t.undoManager.typing)
-						addUndo();
-				});
+			// Call out on menus and refresh class on normal buttons
+			if (lh.className.indexOf('mceMenu') != -1)
+				tinyMCE._menuButtonEvent('out', lh);
+			else
+				lh.className = lh.className;
 
-				t.onKeyUp.add(function(ed, e) {
-					if ((e.keyCode >= 33 && e.keyCode <= 36) || (e.keyCode >= 37 && e.keyCode <= 40) || e.keyCode == 13 || e.keyCode == 45 || e.ctrlKey)
-						addUndo();
-				});
+			tinyMCE.lastHover = null;
+		}
 
-				t.onKeyDown.add(function(ed, e) {
-					var rng, parent, bookmark;
+		if (!tinyMCE.hasMouseMoved) {
+			inst = tinyMCE.selectedInstance;
 
-					// IE has a really odd bug where the DOM might include an node that doesn't have
-					// a proper structure. If you try to access nodeValue it would throw an illegal value exception.
-					// This seems to only happen when you delete contents and it seems to be avoidable if you refresh the element
-					// after you delete contents from it. See: #3008923
-					if (isIE && e.keyCode == 46) {
-						rng = t.selection.getRng();
-
-						if (rng.parentElement) {
-							parent = rng.parentElement();
-
-							// Select next word when ctrl key is used in combo with delete
-							if (e.ctrlKey) {
-								rng.moveEnd('word', 1);
-								rng.select();
-							}
-
-							// Delete contents
-							t.selection.getSel().clear();
-
-							// Check if we are within the same parent
-							if (rng.parentElement() == parent) {
-								bookmark = t.selection.getBookmark();
-
-								try {
-									// Update the HTML and hopefully it will remove the artifacts
-									parent.innerHTML = parent.innerHTML;
-								} catch (ex) {
-									// And since it's IE it can sometimes produce an unknown runtime error
-								}
-
-								// Restore the caret position
-								t.selection.moveToBookmark(bookmark);
-							}
-
-							// Block the default delete behavior since it might be broken
-							e.preventDefault();
-							return;
-						}
-					}
-
-					// Is caracter positon keys
-					if ((e.keyCode >= 33 && e.keyCode <= 36) || (e.keyCode >= 37 && e.keyCode <= 40) || e.keyCode == 13 || e.keyCode == 45) {
-						if (t.undoManager.typing)
-							addUndo();
-
-						return;
-					}
-
-					if (!t.undoManager.typing) {
-						t.undoManager.add();
-						t.undoManager.typing = 1;
-					}
-				});
-
-				t.onMouseDown.add(function() {
-					if (t.undoManager.typing)
-						addUndo();
-				});
+			// Workaround for bug #1437457 (Odd MSIE bug)
+			if (inst.isFocused) {
+				inst.undoBookmark = inst.selection.getBookmark();
+				tinyMCE.hasMouseMoved = true;
 			}
-		},
+		}
 
-		_isHidden : function() {
-			var s;
+	//	tinyMCE.cancelEvent(inst.getWin().event);
+	//	return false;
+	},
 
-			if (!isGecko)
-				return 0;
+	cancelEvent : function(e) {
+		if (!e)
+			return false;
 
-			// Weird, wheres that cursor selection?
-			s = this.selection.getSel();
-			return (!s || !s.rangeCount || s.rangeCount == 0);
-		},
-
-		// Fix for bug #1867292
-		_fixNesting : function(s) {
-			var d = [], i;
-
-			s = s.replace(/<(\/)?([^\s>]+)[^>]*?>/g, function(a, b, c) {
-				var e;
-
-				// Handle end element
-				if (b === '/') {
-					if (!d.length)
-						return '';
-
-					if (c !== d[d.length - 1].tag) {
-						for (i=d.length - 1; i>=0; i--) {
-							if (d[i].tag === c) {
-								d[i].close = 1;
-								break;
-							}
-						}
-
-						return '';
-					} else {
-						d.pop();
-
-						if (d.length && d[d.length - 1].close) {
-							a = a + '</' + d[d.length - 1].tag + '>';
-							d.pop();
-						}
-					}
-				} else {
-					// Ignore these
-					if (/^(br|hr|input|meta|img|link|param)$/i.test(c))
-						return a;
-
-					// Ignore closed ones
-					if (/\/>$/.test(a))
-						return a;
-
-					d.push({tag : c}); // Push start element
-				}
-
-				return a;
-			});
-
-			// End all open tags
-			for (i=d.length - 1; i>=0; i--)
-				s += '</' + d[i].tag + '>';
-
-			return s;
+		if (tinyMCE.isIE) {
+			e.returnValue = false;
+			e.cancelBubble = true;
+		} else {
+			e.preventDefault();
+			e.stopPropagation && e.stopPropagation();
 		}
-	});
-})(tinymce);
 
-(function(tinymce) {
-	// Added for compression purposes
-	var each = tinymce.each, undefined, TRUE = true, FALSE = false;
+		return false;
+	},
 
-	tinymce.EditorCommands = function(editor) {
-		var dom = editor.dom,
-			selection = editor.selection,
-			commands = {state: {}, exec : {}, value : {}},
-			settings = editor.settings,
-			bookmark;
+	addEvent : function(o, n, h) {
+		// Add cleanup for all non unload events
+		if (n != 'unload') {
+			function clean() {
+				var ex;
 
-		function execCommand(command, ui, value) {
-			var func;
-
-			command = command.toLowerCase();
-			if (func = commands.exec[command]) {
-				func(command, ui, value);
-				return TRUE;
-			}
-
-			return FALSE;
-		};
-
-		function queryCommandState(command) {
-			var func;
-
-			command = command.toLowerCase();
-			if (func = commands.state[command])
-				return func(command);
-
-			return -1;
-		};
-
-		function queryCommandValue(command) {
-			var func;
-
-			command = command.toLowerCase();
-			if (func = commands.value[command])
-				return func(command);
-
-			return FALSE;
-		};
-
-		function addCommands(command_list, type) {
-			type = type || 'exec';
-
-			each(command_list, function(callback, command) {
-				each(command.toLowerCase().split(','), function(command) {
-					commands[type][command] = callback;
-				});
-			});
-		};
-
-		// Expose public methods
-		tinymce.extend(this, {
-			execCommand : execCommand,
-			queryCommandState : queryCommandState,
-			queryCommandValue : queryCommandValue,
-			addCommands : addCommands
-		});
-
-		// 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 editor.formatter.match(name);
-		};
-
-		function toggleFormat(name, value) {
-			editor.formatter.toggle(name, value ? {value : value} : undefined);
-		};
-
-		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);
+					tinyMCE.removeEvent(o, n, h);
+					tinyMCE.removeEvent(window, 'unload', clean);
+					o = n = h = null;
 				} catch (ex) {
-					// Command failed
-					failed = TRUE;
+					// IE may produce access denied exception on unload
 				}
-
-				// Present alert message about clipboard access not being available
-				if (failed || !doc.queryCommandSupported(command)) {
-					if (tinymce.isGecko) {
-						editor.windowManager.confirm(editor.getLang('clipboard_msg'), function(state) {
-							if (state)
-								open('http://www.mozilla.org/editor/midasdemo/securityprefs.html', '_blank');
-						});
-					} else
-						editor.windowManager.alert(editor.getLang('clipboard_no_support'));
-				}
-			},
-
-			// Override unlink command
-			unlink : function(command) {
-				if (selection.isCollapsed())
-					selection.select(selection.getNode());
-
-				execNativeCommand(command);
-				selection.collapse(FALSE);
-			},
-
-			// Override justify commands to use the text formatter engine
-			'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull' : function(command) {
-				var align = command.substring(7);
-
-				// Remove all other alignments first
-				each('left,center,right,full'.split(','), function(name) {
-					if (align != name)
-						editor.formatter.remove('align' + name);
-				});
-
-				toggleFormat('align' + align);
-			},
-
-			// 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' : 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 = tinymce.explode(settings.font_size_style_values);
-					fontClasses = tinymce.explode(settings.font_size_classes);
-
-					if (fontClasses)
-						value = fontClasses[value - 1] || value;
-					else
-						value = fontSizes[value - 1] || value;
-				}
-
-				toggleFormat(command, value);
-			},
-
-			RemoveFormat : function(command) {
-				editor.formatter.remove(command);
-			},
-
-			mceBlockQuote : function(command) {
-				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) {
-				selection.setContent(value);
-			},
-
-			mceInsertRawHTML : function(command, ui, value) {
-				selection.setContent('tiny_mce_marker');
-				editor.setContent(editor.getContent().replace(/tiny_mce_marker/g, function() { return 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);
-
-				if (!queryCommandState('InsertUnorderedList') && !queryCommandState('InsertOrderedList')) {
-					each(selection.getSelectedBlocks(), function(element) {
-						if (command == 'outdent') {
-							value = Math.max(0, parseInt(element.style.paddingLeft || 0) - intentValue);
-							dom.setStyle(element, 'paddingLeft', value ? value + indentUnit : '');
-						} else
-							dom.setStyle(element, 'paddingLeft', (parseInt(element.style.paddingLeft || 0) + intentValue) + indentUnit);
-					});
-				} else
-					execNativeCommand(command);
-			},
-
-			mceRepaint : function() {
-				var bookmark;
-
-				if (tinymce.isGecko) {
-					try {
-						storeSelection(TRUE);
-
-						if (selection.getSel())
-							selection.getSel().selectAllChildren(editor.getBody());
-
-						selection.collapse(TRUE);
-						restoreSelection();
-					} catch (ex) {
-						// Ignore
-					}
-				}
-			},
-
-			mceToggleFormat : function(command, ui, value) {
-				editor.formatter.toggle(value);
-			},
-
-			InsertHorizontalRule : function() {
-				selection.setContent('<hr />');
-			},
-
-			mceToggleVisualAid : function() {
-				editor.hasVisual = !editor.hasVisual;
-				editor.addVisual();
-			},
-
-			mceReplaceContent : function(command, ui, value) {
-				selection.setContent(value.replace(/\{\$selection\}/g, selection.getContent({format : 'text'})));
-			},
-
-			mceInsertLink : function(command, ui, value) {
-				var link = dom.getParent(selection.getNode(), 'a');
-
-				if (tinymce.is(value, 'string'))
-					value = {href : value};
-
-				if (!link) {
-					execNativeCommand('CreateLink', FALSE, 'javascript:mctmp(0);');
-					each(dom.select('a[href=javascript:mctmp(0);]'), function(link) {
-						dom.setAttribs(link, value);
-					});
-				} else {
-					if (value.href)
-						dom.setAttribs(link, value);
-					else
-						editor.dom.remove(link, TRUE);
-				}
-			},
-			
-			selectAll : function() {
-				var root = dom.getRoot(), rng = dom.createRng();
-
-				rng.setStart(root, 0);
-				rng.setEnd(root, root.childNodes.length);
-
-				editor.selection.setRng(rng);
 			}
-		});
 
-		// Add queryCommandState overrides
-		addCommands({
-			// Override justify commands
-			'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull' : function(command) {
-				return isFormatMatch('align' + command.substring(7));
-			},
+			// Add memory cleaner
+			tinyMCE.addEvent(window, 'unload', clean);
+		}
 
-			'Bold,Italic,Underline,Strikethrough' : function(command) {
-				return isFormatMatch(command);
-			},
+		if (o.attachEvent)
+			o.attachEvent("on" + n, h);
+		else
+			o.addEventListener(n, h, false);
+	},
 
-			mceBlockQuote : function() {
-				return isFormatMatch('blockquote');
-			},
+	removeEvent : function(o, n, h) {
+		if (o.detachEvent)
+			o.detachEvent("on" + n, h);
+		else
+			o.removeEventListener(n, h, false);
+	},
 
-			Outdent : function() {
-				var node;
+	addSelectAccessibility : function(e, s, w) {
+		// Add event handlers 
+		if (!s._isAccessible) {
+			s.onkeydown = tinyMCE.accessibleEventHandler;
+			s.onblur = tinyMCE.accessibleEventHandler;
+			s._isAccessible = true;
+			s._win = w;
+		}
 
-				if (settings.inline_styles) {
-					if ((node = dom.getParent(selection.getStart(), dom.isBlock)) && parseInt(node.style.paddingLeft) > 0)
-						return TRUE;
+		return false;
+	},
 
-					if ((node = dom.getParent(selection.getEnd(), dom.isBlock)) && parseInt(node.style.paddingLeft) > 0)
-						return TRUE;
-				}
+	accessibleEventHandler : function(e) {
+		var elm, win = this._win;
 
-				return queryCommandState('InsertUnorderedList') || queryCommandState('InsertOrderedList') || (!settings.inline_styles && !!dom.getParent(selection.getNode(), 'BLOCKQUOTE'));
-			},
+		e = tinyMCE.isIE ? win.event : e;
+		elm = tinyMCE.isIE ? e.srcElement : e.target;
 
-			'InsertUnorderedList,InsertOrderedList' : function(command) {
-				return dom.getParent(selection.getNode(), command == 'insertunorderedlist' ? 'UL' : 'OL');
+		// Unpiggyback onchange on blur
+		if (e.type == "blur") {
+			if (elm.oldonchange) {
+				elm.onchange = elm.oldonchange;
+				elm.oldonchange = null;
 			}
-		}, 'state');
 
-		// Add queryCommandValue overrides
-		addCommands({
-			'FontSize,FontName' : function(command) {
-				var value = 0, parent;
+			return true;
+		}
 
-				if (parent = dom.getParent(selection.getNode(), 'span')) {
-					if (command == 'fontsize')
-						value = parent.style.fontSize;
-					else
-						value = parent.style.fontFamily.replace(/, /g, ',').replace(/[\'\"]/g, '').toLowerCase();
-				}
+		// Piggyback onchange
+		if (elm.nodeName == "SELECT" && !elm.oldonchange) {
+			elm.oldonchange = elm.onchange;
+			elm.onchange = null;
+		}
 
-				return value;
-			}
-		}, 'value');
+		// Execute onchange and remove piggyback
+		if (e.keyCode == 13 || e.keyCode == 32) {
+			elm.onchange = elm.oldonchange;
+			elm.onchange();
+			elm.oldonchange = null;
 
-		// Add undo manager logic
-		if (settings.custom_undo_redo) {
-			addCommands({
-				Undo : function() {
-					editor.undoManager.undo();
-				},
-
-				Redo : function() {
-					editor.undoManager.redo();
-				}
-			});
+			tinyMCE.cancelEvent(e);
+			return false;
 		}
-	};
-})(tinymce);
-(function(tinymce) {
-	var Dispatcher = tinymce.util.Dispatcher;
 
-	tinymce.UndoManager = function(editor) {
-		var self, index = 0, data = [];
+		return true;
+	},
 
-		function getContent() {
-			return tinymce.trim(editor.getContent({format : 'raw', no_events : 1}));
-		};
+	_resetIframeHeight : function() {
+		var ife;
 
-		return self = {
-			typing : 0,
+		if (tinyMCE.isRealIE) {
+			ife = tinyMCE.selectedInstance.iframeElement;
 
-			onAdd : new Dispatcher(self),
-			onUndo : new Dispatcher(self),
-			onRedo : new Dispatcher(self),
+	/*		if (ife._oldWidth) {
+				ife.style.width = ife._oldWidth;
+				ife.width = ife._oldWidth;
+			}*/
 
-			add : function(level) {
-				var i, settings = editor.settings, lastLevel;
-
-				level = level || {};
-				level.content = getContent();
-
-				// Add undo level if needed
-				lastLevel = data[index];
-				if (lastLevel && lastLevel.content == level.content) {
-					if (index > 0 || data.length == 1)
-						return null;
-				}
-
-				// 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) {
-					// Treat first level as initial
-					if (index == 0)
-						data = [];
-					else
-						data.length = index + 1;
-				}
-
-				data.push(level);
-				index = data.length - 1;
-
-				self.onAdd.dispatch(self, level);
-				editor.isNotDirty = 0;
-
-				return level;
-			},
-
-			undo : function() {
-				var level, i;
-
-				if (self.typing) {
-					self.add();
-					self.typing = 0;
-				}
-
-				if (index > 0) {
-					level = data[--index];
-
-					editor.setContent(level.content, {format : 'raw'});
-					editor.selection.moveToBookmark(level.bookmark);
-
-					self.onUndo.dispatch(self, level);
-				}
-
-				return level;
-			},
-
-			redo : function() {
-				var level;
-
-				if (index < data.length - 1) {
-					level = data[++index];
-
-					editor.setContent(level.content, {format : 'raw'});
-					editor.selection.moveToBookmark(level.bookmark);
-
-					self.onRedo.dispatch(self, level);
-				}
-
-				return level;
-			},
-
-			clear : function() {
-				data = [];
-				index = self.typing = 0;
-			},
-
-			hasUndo : function() {
-				return index > 0 || self.typing;
-			},
-
-			hasRedo : function() {
-				return index < data.length - 1;
+			if (ife._oldHeight) {
+				ife.style.height = ife._oldHeight;
+				ife.height = ife._oldHeight;
 			}
-		};
-	};
-})(tinymce);
+		}
+	}
 
-(function(tinymce) {
-	// Shorten names
-	var Event = tinymce.dom.Event,
-		isIE = tinymce.isIE,
-		isGecko = tinymce.isGecko,
-		isOpera = tinymce.isOpera,
-		each = tinymce.each,
-		extend = tinymce.extend,
-		TRUE = true,
-		FALSE = false;
+	});
 
-	function cloneFormats(node) {
-		var clone, temp, inner;
+/* file:jscripts/tiny_mce/classes/TinyMCE_Selection.class.js */
 
-		do {
-			if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(node.nodeName)) {
-				if (clone) {
-					temp = node.cloneNode(false);
-					temp.appendChild(clone);
-					clone = temp;
-				} else {
-					clone = inner = node.cloneNode(false);
-				}
+function TinyMCE_Selection(inst) {
+	this.instance = inst;
+};
 
-				clone.removeAttribute('id');
-			}
-		} while (node = node.parentNode);
+TinyMCE_Selection.prototype = {
+	getSelectedHTML : function() {
+		var inst = this.instance, e, r = this.getRng(), h;
 
-		if (clone)
-			return {wrapper : clone, inner : inner};
-	};
+		if (!r)
+			return null;
 
-	// Checks if the selection/caret is at the end of the specified block element
-	function isAtEnd(rng, par) {
-		var rng2 = par.ownerDocument.createRange();
+		e = document.createElement("body");
 
-		rng2.setStart(rng.endContainer, rng.endOffset);
-		rng2.setEndAfter(par);
+		if (r.cloneContents)
+			e.appendChild(document.importNode(r.cloneContents(), true));
+		else if (typeof(r.item) != 'undefined' || typeof(r.htmlText) != 'undefined')
+			e.innerHTML = r.item ? r.item(0).outerHTML : r.htmlText;
+		else
+			e.innerHTML = r.toString(); // Failed, use text for now
 
-		// Get number of characters to the right of the cursor if it's zero then we are at the end and need to merge the next block element
-		return rng2.cloneContents().textContent.length == 0;
-	};
+		h = tinyMCE._cleanupHTML(inst, inst.contentDocument, inst.settings, e, e, false, true, false);
 
-	function isEmpty(n) {
-		n = n.innerHTML;
+		// When editing always use fonts internaly
+		//if (tinyMCE.getParam("convert_fonts_to_spans"))
+		//	tinyMCE.convertSpansToFonts(inst.getDoc());
 
-		n = n.replace(/<(img|hr|table|input|select|textarea)[ \>]/gi, '-'); // Keep these convert them to - chars
-		n = n.replace(/<[^>]+>/g, ''); // Remove all tags
+		return h;
+	},
 
-		return n.replace(/[ \u00a0\t\r\n]+/g, '') == '';
-	};
+	getSelectedText : function() {
+		var inst = this.instance, d, r, s, t;
 
-	function splitList(selection, dom, li) {
-		var listBlock, block;
+		if (tinyMCE.isIE) {
+			d = inst.getDoc();
 
-		if (isEmpty(li)) {
-			listBlock = dom.getParent(li, 'ul,ol');
+			if (d.selection.type == "Text") {
+				r = d.selection.createRange();
+				t = r.text;
+			} else
+				t = '';
+		} else {
+			s = this.getSel();
 
-			if (!dom.getParent(listBlock.parentNode, 'ul,ol')) {
-				dom.split(listBlock, li);
-				block = dom.create('p', 0, '<br _mce_bogus="1" />');
-				dom.replace(block, li);
-				selection.select(block, 1);
-			}
-
-			return FALSE;
+			if (s && s.toString)
+				t = s.toString();
+			else
+				t = '';
 		}
 
-		return TRUE;
-	};
+		return t;
+	},
 
-	tinymce.create('tinymce.ForceBlocks', {
-		ForceBlocks : function(ed) {
-			var t = this, s = ed.settings, elm;
+	getBookmark : function(simple) {
+		var inst = this.instance, rng = this.getRng(), doc = inst.getDoc(), b = inst.getBody();
+		var trng, sx, sy, xx = -999999999, vp = inst.getViewPort();
+		var sp, le, s, e, nl, i, si, ei, w;
 
-			t.editor = ed;
-			t.dom = ed.dom;
-			elm = (s.forced_root_block || 'p').toLowerCase();
-			s.element = elm.toUpperCase();
+		sx = vp.left;
+		sy = vp.top;
 
-			ed.onPreInit.add(t.setup, t);
+		if (simple)
+			return {rng : rng, scrollX : sx, scrollY : sy};
 
-			t.reOpera = new RegExp('(\\u00a0| | )<\/' + elm + '>', 'gi');
-			t.rePadd = new RegExp('<p( )([^>]+)><\\\/p>|<p( )([^>]+)\\\/>|<p( )([^>]+)>\\s+<\\\/p>|<p><\\\/p>|<p\\\/>|<p>\\s+<\\\/p>'.replace(/p/g, elm), 'gi');
-			t.reNbsp2BR1 = new RegExp('<p( )([^>]+)>[\\s\\u00a0]+<\\\/p>|<p>[\\s\\u00a0]+<\\\/p>'.replace(/p/g, elm), 'gi');
-			t.reNbsp2BR2 = new RegExp('<%p()([^>]+)>( | )<\\\/%p>|<%p>( | )<\\\/%p>'.replace(/%p/g, elm), 'gi');
-			t.reBR2Nbsp = new RegExp('<p( )([^>]+)>\\s*<br \\\/>\\s*<\\\/p>|<p>\\s*<br \\\/>\\s*<\\\/p>'.replace(/p/g, elm), 'gi');
+		if (tinyMCE.isRealIE) {
+			if (rng.item) {
+				e = rng.item(0);
 
-			function padd(ed, o) {
-				if (isOpera)
-					o.content = o.content.replace(t.reOpera, '</' + elm + '>');
-
-				o.content = o.content.replace(t.rePadd, '<' + elm + '$1$2$3$4$5$6>\u00a0</' + elm + '>');
-
-				if (!isIE && !isOpera && o.set) {
-					// Use   instead of BR in padded paragraphs
-					o.content = o.content.replace(t.reNbsp2BR1, '<' + elm + '$1$2><br /></' + elm + '>');
-					o.content = o.content.replace(t.reNbsp2BR2, '<' + elm + '$1$2><br /></' + elm + '>');
-				} else
-					o.content = o.content.replace(t.reBR2Nbsp, '<' + elm + '$1$2>\u00a0</' + elm + '>');
-			};
-
-			ed.onBeforeSetContent.add(padd);
-			ed.onPostProcess.add(padd);
-
-			if (s.forced_root_block) {
-				ed.onInit.add(t.forceRoots, t);
-				ed.onSetContent.add(t.forceRoots, t);
-				ed.onBeforeGetContent.add(t.forceRoots, t);
-			}
-		},
-
-		setup : function() {
-			var t = this, ed = t.editor, s = ed.settings, dom = ed.dom, selection = ed.selection;
-
-			// Force root blocks when typing and when getting output
-			if (s.forced_root_block) {
-				ed.onBeforeExecCommand.add(t.forceRoots, t);
-				ed.onKeyUp.add(t.forceRoots, t);
-				ed.onPreProcess.add(t.forceRoots, t);
-			}
-
-			if (s.force_br_newlines) {
-				// Force IE to produce BRs on enter
-				if (isIE) {
-					ed.onKeyPress.add(function(ed, e) {
-						var n;
-
-						if (e.keyCode == 13 && selection.getNode().nodeName != 'LI') {
-							selection.setContent('<br id="__" /> ', {format : 'raw'});
-							n = dom.get('__');
-							n.removeAttribute('id');
-							selection.select(n);
-							selection.collapse();
-							return Event.cancel(e);
-						}
-					});
+				nl = b.getElementsByTagName(e.nodeName);
+				for (i=0; i<nl.length; i++) {
+					if (e == nl[i]) {
+						sp = i;
+						break;
+					}
 				}
-			}
 
-			if (s.force_p_newlines) {
-				if (!isIE) {
-					ed.onKeyPress.add(function(ed, e) {
-						if (e.keyCode == 13 && !e.shiftKey && !t.insertPara(e))
-							Event.cancel(e);
-					});
-				} else {
-					// Ungly hack to for IE to preserve the formatting when you press
-					// enter at the end of a block element with formatted contents
-					// This logic overrides the browsers default logic with
-					// custom logic that enables us to control the output
-					tinymce.addUnload(function() {
-						t._previousFormats = 0; // Fix IE leak
-					});
+				return {
+					tag : e.nodeName,
+					index : sp,
+					scrollX : sx,
+					scrollY : sy
+				};
+			} else {
+				trng = doc.body.createTextRange();
+				trng.moveToElementText(inst.getBody());
+				trng.collapse(true);
+				bp = Math.abs(trng.move('character', xx));
 
-					ed.onKeyPress.add(function(ed, e) {
-						t._previousFormats = 0;
+				trng = rng.duplicate();
+				trng.collapse(true);
+				sp = Math.abs(trng.move('character', xx));
 
-						// Clone the current formats, this will later be applied to the new block contents
-						if (e.keyCode == 13 && !e.shiftKey && ed.selection.isCollapsed() && s.keep_styles)
-							t._previousFormats = cloneFormats(ed.selection.getStart());
-					});
+				trng = rng.duplicate();
+				trng.collapse(false);
+				le = Math.abs(trng.move('character', xx)) - sp;
 
-					ed.onKeyUp.add(function(ed, e) {
-						// Let IE break the element and the wrap the new caret location in the previous formats
-						if (e.keyCode == 13 && !e.shiftKey) {
-							var parent = ed.selection.getStart(), fmt = t._previousFormats;
-
-							// Parent is an empty block
-							if (!parent.hasChildNodes() && fmt) {
-								parent = dom.getParent(parent, dom.isBlock);
-
-								if (parent && parent.nodeName != 'LI') {
-									parent.innerHTML = '';
-
-									if (t._previousFormats) {
-										parent.appendChild(fmt.wrapper);
-										fmt.inner.innerHTML = '\uFEFF';
-									} else
-										parent.innerHTML = '\uFEFF';
-
-									selection.select(parent, 1);
-									ed.getDoc().execCommand('Delete', false, null);
-									t._previousFormats = 0;
-								}
-							}
-						}
-					});
-				}
-
-				if (isGecko) {
-					ed.onKeyDown.add(function(ed, e) {
-						if ((e.keyCode == 8 || e.keyCode == 46) && !e.shiftKey)
-							t.backspaceDelete(e, e.keyCode == 8);
-					});
-				}
+				return {
+					start : sp - bp,
+					length : le,
+					scrollX : sx,
+					scrollY : sy
+				};
 			}
+		} else {
+			s = this.getSel();
+			e = this.getFocusElement();
 
-			// Workaround for missing shift+enter support, http://bugs.webkit.org/show_bug.cgi?id=16973
-			if (tinymce.isWebKit) {
-				function insertBr(ed) {
-					var rng = selection.getRng(), br, div = dom.create('div', null, ' '), divYPos, vpHeight = dom.getViewPort(ed.getWin()).h;
+			if (!s)
+				return null;
 
-					// Insert BR element
-					rng.insertNode(br = dom.create('br'));
-
-					// Place caret after BR
-					rng.setStartAfter(br);
-					rng.setEndAfter(br);
-					selection.setRng(rng);
-
-					// Could not place caret after BR then insert an nbsp entity and move the caret
-					if (selection.getSel().focusNode == br.previousSibling) {
-						selection.select(dom.insertAfter(dom.doc.createTextNode('\u00a0'), br));
-						selection.collapse(TRUE);
+			if (e && e.nodeName == 'IMG') {
+				/*nl = b.getElementsByTagName('IMG');
+				for (i=0; i<nl.length; i++) {
+					if (e == nl[i]) {
+						sp = i;
+						break;
 					}
+				}*/
 
-					// Create a temporary DIV after the BR and get the position as it
-					// seems like getPos() returns 0 for text nodes and BR elements.
-					dom.insertAfter(div, br);
-					divYPos = dom.getPos(div).y;
-					dom.remove(div);
-
-					// Scroll to new position, scrollIntoView can't be used due to bug: http://bugs.webkit.org/show_bug.cgi?id=16117
-					if (divYPos > vpHeight) // It is not necessary to scroll if the DIV is inside the view port.
-						ed.getWin().scrollTo(0, divYPos);
+				return {
+					start : -1,
+					end : -1,
+					index : sp,
+					scrollX : sx,
+					scrollY : sy
 				};
-
-				ed.onKeyPress.add(function(ed, e) {
-					if (e.keyCode == 13 && (e.shiftKey || (s.force_br_newlines && !dom.getParent(selection.getNode(), 'h1,h2,h3,h4,h5,h6,ol,ul')))) {
-						insertBr(ed);
-						Event.cancel(e);
-					}
-				});
 			}
 
-			// Padd empty inline elements within block elements
-			// For example: <p><strong><em></em></strong></p> becomes <p><strong><em> </em></strong></p>
-			ed.onPreProcess.add(function(ed, o) {
-				each(dom.select('p,h1,h2,h3,h4,h5,h6,div', o.node), function(p) {
-					if (isEmpty(p)) {
-						each(dom.select('span,em,strong,b,i', o.node), function(n) {
-							if (!n.hasChildNodes()) {
-								n.appendChild(ed.getDoc().createTextNode('\u00a0'));
-								return FALSE; // Break the loop one padding is enough
-							}
-						});
-					}
-				});
-			});
+			// Caret or selection
+			if (s.anchorNode == s.focusNode && s.anchorOffset == s.focusOffset) {
+				e = this._getPosText(b, s.anchorNode, s.focusNode);
 
-			// IE specific fixes
-			if (isIE) {
-				// Replaces IE:s auto generated paragraphs with the specified element name
-				if (s.element != 'P') {
-					ed.onKeyPress.add(function(ed, e) {
-						t.lastElm = selection.getNode().nodeName;
-					});
+				if (!e)
+					return {scrollX : sx, scrollY : sy};
 
-					ed.onKeyUp.add(function(ed, e) {
-						var bl, n = selection.getNode(), b = ed.getBody();
+				return {
+					start : e.start + s.anchorOffset,
+					end : e.end + s.focusOffset,
+					scrollX : sx,
+					scrollY : sy
+				};
+			} else {
+				e = this._getPosText(b, rng.startContainer, rng.endContainer);
 
-						if (b.childNodes.length === 1 && n.nodeName == 'P') {
-							n = dom.rename(n, s.element);
-							selection.select(n);
-							selection.collapse();
-							ed.nodeChanged();
-						} else if (e.keyCode == 13 && !e.shiftKey && t.lastElm != 'P') {
-							bl = dom.getParent(n, 'p');
+				if (!e)
+					return {scrollX : sx, scrollY : sy};
 
-							if (bl) {
-								dom.rename(bl, s.element);
-								ed.nodeChanged();
-							}
-						}
-					});
-				}
+				return {
+					start : e.start + rng.startOffset,
+					end : e.end + rng.endOffset,
+					scrollX : sx,
+					scrollY : sy
+				};
 			}
-		},
+		}
 
-		find : function(n, t, s) {
-			var ed = this.editor, w = ed.getDoc().createTreeWalker(n, 4, null, FALSE), c = -1;
+		return null;
+	},
 
-			while (n = w.nextNode()) {
-				c++;
+	moveToBookmark : function(bookmark) {
+		var inst = this.instance, rng, nl, i, ex, b = inst.getBody(), sd;
+		var doc = inst.getDoc(), win = inst.getWin(), sel = this.getSel();
 
-				// Index by node
-				if (t == 0 && n == s)
-					return c;
+		if (!bookmark)
+			return false;
 
-				// Node by index
-				if (t == 1 && c == s)
-					return n;
-			}
+		if (tinyMCE.isSafari && bookmark.rng) {
+			sel.setBaseAndExtent(bookmark.rng.startContainer, bookmark.rng.startOffset, bookmark.rng.endContainer, bookmark.rng.endOffset);
+			return true;
+		}
 
-			return -1;
-		},
-
-		forceRoots : function(ed, e) {
-			var t = this, ed = t.editor, b = ed.getBody(), d = ed.getDoc(), se = ed.selection, s = se.getSel(), r = se.getRng(), si = -2, ei, so, eo, tr, c = -0xFFFFFF;
-			var nx, bl, bp, sp, le, nl = b.childNodes, i, n, eid;
-
-			// Fix for bug #1863847
-			//if (e && e.keyCode == 13)
-			//	return TRUE;
-
-			// Wrap non blocks into blocks
-			for (i = nl.length - 1; i >= 0; i--) {
-				nx = nl[i];
-
-				// Ignore internal elements
-				if (nx.nodeType === 1 && nx.getAttribute('_mce_type')) {
-					bl = null;
-					continue;
+		if (tinyMCE.isRealIE) {
+			if (bookmark.rng) {
+				try {
+					bookmark.rng.select();
+				} catch (ex) {
+					// Ignore
 				}
 
-				// Is text or non block element
-				if (nx.nodeType === 3 || (!t.dom.isBlock(nx) && nx.nodeType !== 8 && !/^(script|mce:script|style|mce:style)$/i.test(nx.nodeName))) {
-					if (!bl) {
-						// Create new block but ignore whitespace
-						if (nx.nodeType != 3 || /[^\s]/g.test(nx.nodeValue)) {
-							// Store selection
-							if (si == -2 && r) {
-								if (!isIE) {
-									// If selection is element then mark it
-									if (r.startContainer.nodeType == 1 && (n = r.startContainer.childNodes[r.startOffset]) && n.nodeType == 1) {
-										// Save the id of the selected element
-										eid = n.getAttribute("id");
-										n.setAttribute("id", "__mce");
-									} else {
-										// If element is inside body, might not be the case in contentEdiable mode
-										if (ed.dom.getParent(r.startContainer, function(e) {return e === b;})) {
-											so = r.startOffset;
-											eo = r.endOffset;
-											si = t.find(b, 0, r.startContainer);
-											ei = t.find(b, 0, r.endContainer);
-										}
-									}
-								} else {
-									// Force control range into text range
-									if (r.item) {
-										tr = d.body.createTextRange();
-										tr.moveToElementText(r.item(0));
-										r = tr;
-									}
-
-									tr = d.body.createTextRange();
-									tr.moveToElementText(b);
-									tr.collapse(1);
-									bp = tr.move('character', c) * -1;
-
-									tr = r.duplicate();
-									tr.collapse(1);
-									sp = tr.move('character', c) * -1;
-
-									tr = r.duplicate();
-									tr.collapse(0);
-									le = (tr.move('character', c) * -1) - sp;
-
-									si = sp - bp;
-									ei = le;
-								}
-							}
-
-							// Uses replaceChild instead of cloneNode since it removes selected attribute from option elements on IE
-							// See: http://support.microsoft.com/kb/829907
-							bl = ed.dom.create(ed.settings.forced_root_block);
-							nx.parentNode.replaceChild(bl, nx);
-							bl.appendChild(nx);
-						}
-					} else {
-						if (bl.hasChildNodes())
-							bl.insertBefore(nx, bl.firstChild);
-						else
-							bl.appendChild(nx);
-					}
-				} else
-					bl = null; // Time to create new block
+				return true;
 			}
 
-			// Restore selection
-			if (si != -2) {
-				if (!isIE) {
-					bl = b.getElementsByTagName(ed.settings.element)[0];
-					r = d.createRange();
+			win.focus();
 
-					// Select last location or generated block
-					if (si != -1)
-						r.setStart(t.find(b, 1, si), so);
-					else
-						r.setStart(bl, 0);
+			if (bookmark.tag) {
+				rng = b.createControlRange();
 
-					// Select last location or generated block
-					if (ei != -1)
-						r.setEnd(t.find(b, 1, ei), eo);
-					else
-						r.setEnd(bl, 0);
+				nl = b.getElementsByTagName(bookmark.tag);
 
-					if (s) {
-						s.removeAllRanges();
-						s.addRange(r);
-					}
-				} else {
+				if (nl.length > bookmark.index) {
 					try {
-						r = s.createRange();
-						r.moveToElementText(b);
-						r.collapse(1);
-						r.moveStart('character', si);
-						r.moveEnd('character', ei);
-						r.select();
+						rng.addElement(nl[bookmark.index]);
 					} catch (ex) {
-						// Ignore
+						// Might be thrown if the node no longer exists
 					}
 				}
-			} else if (!isIE && (n = ed.dom.get('__mce'))) {
-				// Restore the id of the selected element
-				if (eid)
-					n.setAttribute('id', eid);
-				else
-					n.removeAttribute('id');
-
-				// Move caret before selected element
-				r = d.createRange();
-				r.setStartBefore(n);
-				r.setEndBefore(n);
-				se.setRng(r);
-			}
-		},
-
-		getParentBlock : function(n) {
-			var d = this.dom;
-
-			return d.getParent(n, d.isBlock);
-		},
-
-		insertPara : function(e) {
-			var t = this, ed = t.editor, dom = ed.dom, d = ed.getDoc(), se = ed.settings, s = ed.selection.getSel(), r = s.getRangeAt(0), b = d.body;
-			var rb, ra, dir, sn, so, en, eo, sb, eb, bn, bef, aft, sc, ec, n, vp = dom.getViewPort(ed.getWin()), y, ch, car;
-
-			// If root blocks are forced then use Operas default behavior since it's really good
-// Removed due to bug: #1853816
-//			if (se.forced_root_block && isOpera)
-//				return TRUE;
-
-			// Setup before range
-			rb = d.createRange();
-
-			// If is before the first block element and in body, then move it into first block element
-			rb.setStart(s.anchorNode, s.anchorOffset);
-			rb.collapse(TRUE);
-
-			// Setup after range
-			ra = d.createRange();
-
-			// If is before the first block element and in body, then move it into first block element
-			ra.setStart(s.focusNode, s.focusOffset);
-			ra.collapse(TRUE);
-
-			// Setup start/end points
-			dir = rb.compareBoundaryPoints(rb.START_TO_END, ra) < 0;
-			sn = dir ? s.anchorNode : s.focusNode;
-			so = dir ? s.anchorOffset : s.focusOffset;
-			en = dir ? s.focusNode : s.anchorNode;
-			eo = dir ? s.focusOffset : s.anchorOffset;
-
-			// If selection is in empty table cell
-			if (sn === en && /^(TD|TH)$/.test(sn.nodeName)) {
-				if (sn.firstChild.nodeName == 'BR')
-					dom.remove(sn.firstChild); // Remove BR
-
-				// Create two new block elements
-				if (sn.childNodes.length == 0) {
-					ed.dom.add(sn, se.element, null, '<br />');
-					aft = ed.dom.add(sn, se.element, null, '<br />');
-				} else {
-					n = sn.innerHTML;
-					sn.innerHTML = '';
-					ed.dom.add(sn, se.element, null, n);
-					aft = ed.dom.add(sn, se.element, null, '<br />');
-				}
-
-				// Move caret into the last one
-				r = d.createRange();
-				r.selectNodeContents(aft);
-				r.collapse(1);
-				ed.selection.setRng(r);
-
-				return FALSE;
-			}
-
-			// If the caret is in an invalid location in FF we need to move it into the first block
-			if (sn == b && en == b && b.firstChild && ed.dom.isBlock(b.firstChild)) {
-				sn = en = sn.firstChild;
-				so = eo = 0;
-				rb = d.createRange();
-				rb.setStart(sn, 0);
-				ra = d.createRange();
-				ra.setStart(en, 0);
-			}
-
-			// Never use body as start or end node
-			sn = sn.nodeName == "HTML" ? d.body : sn; // Fix for Opera bug: https://bugs.opera.com/show_bug.cgi?id=273224&comments=yes
-			sn = sn.nodeName == "BODY" ? sn.firstChild : sn;
-			en = en.nodeName == "HTML" ? d.body : en; // Fix for Opera bug: https://bugs.opera.com/show_bug.cgi?id=273224&comments=yes
-			en = en.nodeName == "BODY" ? en.firstChild : en;
-
-			// Get start and end blocks
-			sb = t.getParentBlock(sn);
-			eb = t.getParentBlock(en);
-			bn = sb ? sb.nodeName : se.element; // Get block name to create
-
-			// Return inside list use default browser behavior
-			if (n = t.dom.getParent(sb, 'li,pre')) {
-				if (n.nodeName == 'LI')
-					return splitList(ed.selection, t.dom, n);
-
-				return TRUE;
-			}
-
-			// If caption or absolute layers then always generate new blocks within
-			if (sb && (sb.nodeName == 'CAPTION' || /absolute|relative|fixed/gi.test(dom.getStyle(sb, 'position', 1)))) {
-				bn = se.element;
-				sb = null;
-			}
-
-			// If caption or absolute layers then always generate new blocks within
-			if (eb && (eb.nodeName == 'CAPTION' || /absolute|relative|fixed/gi.test(dom.getStyle(sb, 'position', 1)))) {
-				bn = se.element;
-				eb = null;
-			}
-
-			// Use P instead
-			if (/(TD|TABLE|TH|CAPTION)/.test(bn) || (sb && bn == "DIV" && /left|right/gi.test(dom.getStyle(sb, 'float', 1)))) {
-				bn = se.element;
-				sb = eb = null;
-			}
-
-			// Setup new before and after blocks
-			bef = (sb && sb.nodeName == bn) ? sb.cloneNode(0) : ed.dom.create(bn);
-			aft = (eb && eb.nodeName == bn) ? eb.cloneNode(0) : ed.dom.create(bn);
-
-			// Remove id from after clone
-			aft.removeAttribute('id');
-
-			// Is header and cursor is at the end, then force paragraph under
-			if (/^(H[1-6])$/.test(bn) && isAtEnd(r, sb))
-				aft = ed.dom.create(se.element);
-
-			// Find start chop node
-			n = sc = sn;
-			do {
-				if (n == b || n.nodeType == 9 || t.dom.isBlock(n) || /(TD|TABLE|TH|CAPTION)/.test(n.nodeName))
-					break;
-
-				sc = n;
-			} while ((n = n.previousSibling ? n.previousSibling : n.parentNode));
-
-			// Find end chop node
-			n = ec = en;
-			do {
-				if (n == b || n.nodeType == 9 || t.dom.isBlock(n) || /(TD|TABLE|TH|CAPTION)/.test(n.nodeName))
-					break;
-
-				ec = n;
-			} while ((n = n.nextSibling ? n.nextSibling : n.parentNode));
-
-			// Place first chop part into before block element
-			if (sc.nodeName == bn)
-				rb.setStart(sc, 0);
-			else
-				rb.setStartBefore(sc);
-
-			rb.setEnd(sn, so);
-			bef.appendChild(rb.cloneContents() || d.createTextNode('')); // Empty text node needed for Safari
-
-			// Place secnd chop part within new block element
-			try {
-				ra.setEndAfter(ec);
-			} catch(ex) {
-				//console.debug(s.focusNode, s.focusOffset);
-			}
-
-			ra.setStart(en, eo);
-			aft.appendChild(ra.cloneContents() || d.createTextNode('')); // Empty text node needed for Safari
-
-			// Create range around everything
-			r = d.createRange();
-			if (!sc.previousSibling && sc.parentNode.nodeName == bn) {
-				r.setStartBefore(sc.parentNode);
 			} else {
-				if (rb.startContainer.nodeName == bn && rb.startOffset == 0)
-					r.setStartBefore(rb.startContainer);
-				else
-					r.setStart(rb.startContainer, rb.startOffset);
-			}
+				// Try/catch needed since this operation breaks when TinyMCE is placed in hidden divs/tabs
+				try {
+					// Incorrect bookmark
+					if (bookmark.start < 0)
+						return true;
 
-			if (!ec.nextSibling && ec.parentNode.nodeName == bn)
-				r.setEndAfter(ec.parentNode);
-			else
-				r.setEnd(ra.endContainer, ra.endOffset);
-
-			// Delete and replace it with new block elements
-			r.deleteContents();
-
-			if (isOpera)
-				ed.getWin().scrollTo(0, vp.y);
-
-			// Never wrap blocks in blocks
-			if (bef.firstChild && bef.firstChild.nodeName == bn)
-				bef.innerHTML = bef.firstChild.innerHTML;
-
-			if (aft.firstChild && aft.firstChild.nodeName == bn)
-				aft.innerHTML = aft.firstChild.innerHTML;
-
-			// Padd empty blocks
-			if (isEmpty(bef))
-				bef.innerHTML = '<br />';
-
-			function appendStyles(e, en) {
-				var nl = [], nn, n, i;
-
-				e.innerHTML = '';
-
-				// Make clones of style elements
-				if (se.keep_styles) {
-					n = en;
-					do {
-						// We only want style specific elements
-						if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(n.nodeName)) {
-							nn = n.cloneNode(FALSE);
-							dom.setAttrib(nn, 'id', ''); // Remove ID since it needs to be unique
-							nl.push(nn);
-						}
-					} while (n = n.parentNode);
+					rng = inst.getSel().createRange();
+					rng.moveToElementText(inst.getBody());
+					rng.collapse(true);
+					rng.moveStart('character', bookmark.start);
+					rng.moveEnd('character', bookmark.length);
+				} catch (ex) {
+					return true;
 				}
-
-				// Append style elements to aft
-				if (nl.length > 0) {
-					for (i = nl.length - 1, nn = e; i >= 0; i--)
-						nn = nn.appendChild(nl[i]);
-
-					// Padd most inner style element
-					nl[0].innerHTML = isOpera ? ' ' : '<br />'; // Extra space for Opera so that the caret can move there
-					return nl[0]; // Move caret to most inner element
-				} else
-					e.innerHTML = isOpera ? ' ' : '<br />'; // Extra space for Opera so that the caret can move there
-			};
-
-			// Fill empty afterblook with current style
-			if (isEmpty(aft))
-				car = appendStyles(aft, en);
-
-			// Opera needs this one backwards for older versions
-			if (isOpera && parseFloat(opera.version()) < 9.5) {
-				r.insertNode(bef);
-				r.insertNode(aft);
-			} else {
-				r.insertNode(aft);
-				r.insertNode(bef);
 			}
 
-			// Normalize
-			aft.normalize();
-			bef.normalize();
+			rng.select();
 
-			function first(n) {
-				return d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, FALSE).nextNode() || n;
-			};
+			win.scrollTo(bookmark.scrollX, bookmark.scrollY);
+			return true;
+		}
 
-			// Move cursor and scroll into view
-			r = d.createRange();
-			r.selectNodeContents(isGecko ? first(car || aft) : car || aft);
-			r.collapse(1);
-			s.removeAllRanges();
-			s.addRange(r);
+		if (tinyMCE.isGecko || tinyMCE.isOpera) {
+			if (!sel)
+				return false;
 
-			// scrollIntoView seems to scroll the parent window in most browsers now including FF 3.0b4 so it's time to stop using it and do it our selfs
-			y = ed.dom.getPos(aft).y;
-			ch = aft.clientHeight;
-
-			// Is element within viewport
-			if (y < vp.y || y + ch > vp.y + vp.h) {
-				ed.getWin().scrollTo(0, y < vp.y ? y : y - vp.h + 25); // Needs to be hardcoded to roughly one line of text if a huge text block is broken into two blocks
-				//console.debug('SCROLL!', 'vp.y: ' + vp.y, 'y' + y, 'vp.h' + vp.h, 'clientHeight' + aft.clientHeight, 'yyy: ' + (y < vp.y ? y : y - vp.h + aft.clientHeight));
+			if (bookmark.rng) {
+				sel.removeAllRanges();
+				sel.addRange(bookmark.rng);
 			}
 
-			return FALSE;
-		},
+			if (bookmark.start != -1 && bookmark.end != -1) {
+				try {
+					sd = this._getTextPos(b, bookmark.start, bookmark.end);
+					rng = doc.createRange();
+					rng.setStart(sd.startNode, sd.startOffset);
+					rng.setEnd(sd.endNode, sd.endOffset);
+					sel.removeAllRanges();
+					sel.addRange(rng);
 
-		backspaceDelete : function(e, bs) {
-			var t = this, ed = t.editor, b = ed.getBody(), dom = ed.dom, n, se = ed.selection, r = se.getRng(), sc = r.startContainer, n, w, tn, walker;
-
-			// Delete when caret is behind a element doesn't work correctly on Gecko see #3011651
-			if (!bs && r.collapsed && sc.nodeType == 1 && r.startOffset == sc.childNodes.length) {
-				walker = new tinymce.dom.TreeWalker(sc.lastChild, sc);
-
-				// Walk the dom backwards until we find a text node
-				for (n = sc.lastChild; n; n = walker.prev()) {
-					if (n.nodeType == 3) {
-						r.setStart(n, n.nodeValue.length);
-						r.collapse(true);
-						se.setRng(r);
-						return;
-					}
+					if (!tinyMCE.isOpera)
+						win.focus();
+				} catch (ex) {
+					// Ignore
 				}
 			}
 
-			// The caret sometimes gets stuck in Gecko if you delete empty paragraphs
-			// This workaround removes the element by hand and moves the caret to the previous element
-			if (sc && ed.dom.isBlock(sc) && !/^(TD|TH)$/.test(sc.nodeName) && bs) {
-				if (sc.childNodes.length == 0 || (sc.childNodes.length == 1 && sc.firstChild.nodeName == 'BR')) {
-					// Find previous block element
-					n = sc;
-					while ((n = n.previousSibling) && !ed.dom.isBlock(n)) ;
-
-					if (n) {
-						if (sc != b.firstChild) {
-							// Find last text node
-							w = ed.dom.doc.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, FALSE);
-							while (tn = w.nextNode())
-								n = tn;
-
-							// Place caret at the end of last text node
-							r = ed.getDoc().createRange();
-							r.setStart(n, n.nodeValue ? n.nodeValue.length : 0);
-							r.setEnd(n, n.nodeValue ? n.nodeValue.length : 0);
-							se.setRng(r);
-
-							// Remove the target container
-							ed.dom.remove(sc);
-						}
-
-						return Event.cancel(e);
+			/*
+			if (typeof(bookmark.index) != 'undefined') {
+				tinyMCE.selectElements(b, 'IMG', function (n) {
+					if (bookmark.index-- == 0) {
+						// Select image in Gecko here
 					}
-				}
-			}
-		}
-	});
-})(tinymce);
 
-(function(tinymce) {
-	// Shorten names
-	var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, extend = tinymce.extend;
-
-	tinymce.create('tinymce.ControlManager', {
-		ControlManager : function(ed, s) {
-			var t = this, i;
-
-			s = s || {};
-			t.editor = ed;
-			t.controls = {};
-			t.onAdd = new tinymce.util.Dispatcher(t);
-			t.onPostRender = new tinymce.util.Dispatcher(t);
-			t.prefix = s.prefix || ed.id + '_';
-			t._cls = {};
-
-			t.onPostRender.add(function() {
-				each(t.controls, function(c) {
-					c.postRender();
+					return false;
 				});
-			});
-		},
+			}
+			*/
 
-		get : function(id) {
-			return this.controls[this.prefix + id] || this.controls[id];
-		},
+			win.scrollTo(bookmark.scrollX, bookmark.scrollY);
+			return true;
+		}
 
-		setActive : function(id, s) {
-			var c = null;
+		return false;
+	},
 
-			if (c = this.get(id))
-				c.setActive(s);
+	_getPosText : function(r, sn, en) {
+		var w = document.createTreeWalker(r, NodeFilter.SHOW_TEXT, null, false), n, p = 0, d = {};
 
-			return c;
-		},
+		while ((n = w.nextNode()) != null) {
+			if (n == sn)
+				d.start = p;
 
-		setDisabled : function(id, s) {
-			var c = null;
-
-			if (c = this.get(id))
-				c.setDisabled(s);
-
-			return c;
-		},
-
-		add : function(c) {
-			var t = this;
-
-			if (c) {
-				t.controls[c.id] = c;
-				t.onAdd.dispatch(c, t);
+			if (n == en) {
+				d.end = p;
+				return d;
 			}
 
-			return c;
-		},
+			p += n.nodeValue ? n.nodeValue.length : 0;
+		}
 
-		createControl : function(n) {
-			var c, t = this, ed = t.editor;
+		return null;
+	},
 
-			each(ed.plugins, function(p) {
-				if (p.createControl) {
-					c = p.createControl(n, t);
+	_getTextPos : function(r, sp, ep) {
+		var w = document.createTreeWalker(r, NodeFilter.SHOW_TEXT, null, false), n, p = 0, d = {};
 
-					if (c)
-						return false;
-				}
-			});
+		while ((n = w.nextNode()) != null) {
+			p += n.nodeValue ? n.nodeValue.length : 0;
 
-			switch (n) {
-				case "|":
-				case "separator":
-					return t.createSeparator();
+			if (p >= sp && !d.startNode) {
+				d.startNode = n;
+				d.startOffset = sp - (p - n.nodeValue.length);
 			}
 
-			if (!c && ed.buttons && (c = ed.buttons[n]))
-				return t.createButton(n, c);
+			if (p >= ep) {
+				d.endNode = n;
+				d.endOffset = ep - (p - n.nodeValue.length);
 
-			return t.add(c);
-		},
-
-		createDropMenu : function(id, s, cc) {
-			var t = this, ed = t.editor, c, bm, v, cls;
-
-			s = extend({
-				'class' : 'mceDropDown',
-				constrain : ed.settings.constrain_menus
-			}, s);
-
-			s['class'] = s['class'] + ' ' + ed.getParam('skin') + 'Skin';
-			if (v = ed.getParam('skin_variant'))
-				s['class'] += ' ' + ed.getParam('skin') + 'Skin' + v.substring(0, 1).toUpperCase() + v.substring(1);
-
-			id = t.prefix + id;
-			cls = cc || t._cls.dropmenu || tinymce.ui.DropMenu;
-			c = t.controls[id] = new cls(id, s);
-			c.onAddItem.add(function(c, o) {
-				var s = o.settings;
-
-				s.title = ed.getLang(s.title, s.title);
-
-				if (!s.onclick) {
-					s.onclick = function(v) {
-						if (s.cmd)
-							ed.execCommand(s.cmd, s.ui || false, s.value);
-					};
-				}
-			});
-
-			ed.onRemove.add(function() {
-				c.destroy();
-			});
-
-			// Fix for bug #1897785, #1898007
-			if (tinymce.isIE) {
-				c.onShowMenu.add(function() {
-					// IE 8 needs focus in order to store away a range with the current collapsed caret location
-					ed.focus();
-
-					bm = ed.selection.getBookmark(1);
-				});
-
-				c.onHideMenu.add(function() {
-					if (bm) {
-						ed.selection.moveToBookmark(bm);
-						bm = 0;
-					}
-				});
+				return d;
 			}
+		}
 
-			return t.add(c);
-		},
+		return null;
+	},
 
-		createListBox : function(id, s, cc) {
-			var t = this, ed = t.editor, cmd, c, cls;
+	selectNode : function(node, collapse, select_text_node, to_start) {
+		var inst = this.instance, sel, rng, nodes;
 
-			if (t.get(id))
-				return null;
+		if (!node)
+			return;
 
-			s.title = ed.translate(s.title);
-			s.scope = s.scope || ed;
+		if (typeof(collapse) == "undefined")
+			collapse = true;
 
-			if (!s.onselect) {
-				s.onselect = function(v) {
-					ed.execCommand(s.cmd, s.ui || false, v || s.value);
-				};
-			}
+		if (typeof(select_text_node) == "undefined")
+			select_text_node = false;
 
-			s = extend({
-				title : s.title,
-				'class' : 'mce_' + id,
-				scope : s.scope,
-				control_manager : t
-			}, s);
+		if (typeof(to_start) == "undefined")
+			to_start = true;
 
-			id = t.prefix + id;
+		if (inst.settings.auto_resize)
+			inst.resizeToContent();
 
-			if (ed.settings.use_native_selects)
-				c = new tinymce.ui.NativeListBox(id, s);
-			else {
-				cls = cc || t._cls.listbox || tinymce.ui.ListBox;
-				c = new cls(id, s);
-			}
+		if (tinyMCE.isRealIE) {
+			rng = inst.getDoc().body.createTextRange();
 
-			t.controls[id] = c;
+			try {
+				rng.moveToElementText(node);
 
-			// Fix focus problem in Safari
-			if (tinymce.isWebKit) {
-				c.onPostRender.add(function(c, n) {
-					// Store bookmark on mousedown
-					Event.add(n, 'mousedown', function() {
-						ed.bookmark = ed.selection.getBookmark(1);
-					});
+				if (collapse)
+					rng.collapse(to_start);
 
-					// Restore on focus, since it might be lost
-					Event.add(n, 'focus', function() {
-						ed.selection.moveToBookmark(ed.bookmark);
-						ed.bookmark = null;
-					});
-				});
+				rng.select();
+			} catch (e) {
+				// Throws illigal agrument in MSIE some times
 			}
+		} else {
+			sel = this.getSel();
 
-			if (c.hideMenu)
-				ed.onMouseDown.add(c.hideMenu, c);
+			if (!sel)
+				return;
 
-			return t.add(c);
-		},
+			if (tinyMCE.isSafari) {
+				sel.setBaseAndExtent(node, 0, node, node.innerText.length);
 
-		createButton : function(id, s, cc) {
-			var t = this, ed = t.editor, o, c, cls;
+				if (collapse) {
+					if (to_start)
+						sel.collapseToStart();
+					else
+						sel.collapseToEnd();
+				}
 
-			if (t.get(id))
-				return null;
+				this.scrollToNode(node);
 
-			s.title = ed.translate(s.title);
-			s.label = ed.translate(s.label);
-			s.scope = s.scope || ed;
-
-			if (!s.onclick && !s.menu_button) {
-				s.onclick = function() {
-					ed.execCommand(s.cmd, s.ui || false, s.value);
-				};
+				return;
 			}
 
-			s = extend({
-				title : s.title,
-				'class' : 'mce_' + id,
-				unavailable_prefix : ed.getLang('unavailable', ''),
-				scope : s.scope,
-				control_manager : t
-			}, s);
+			rng = inst.getDoc().createRange();
 
-			id = t.prefix + id;
+			if (select_text_node) {
+				// Find first textnode in tree
+				nodes = tinyMCE.getNodeTree(node, [], 3);
+				if (nodes.length > 0)
+					rng.selectNodeContents(nodes[0]);
+				else
+					rng.selectNodeContents(node);
+			} else
+				rng.selectNode(node);
 
-			if (s.menu_button) {
-				cls = cc || t._cls.menubutton || tinymce.ui.MenuButton;
-				c = new cls(id, s);
-				ed.onMouseDown.add(c.hideMenu, c);
-			} else {
-				cls = t._cls.button || tinymce.ui.Button;
-				c = new cls(id, s);
+			if (collapse) {
+				// Special treatment of textnode collapse
+				if (!to_start && node.nodeType == 3) {
+					rng.setStart(node, node.nodeValue.length);
+					rng.setEnd(node, node.nodeValue.length);
+				} else
+					rng.collapse(to_start);
 			}
 
-			return t.add(c);
-		},
+			sel.removeAllRanges();
+			sel.addRange(rng);
+		}
 
-		createMenuButton : function(id, s, cc) {
-			s = s || {};
-			s.menu_button = 1;
+		this.scrollToNode(node);
 
-			return this.createButton(id, s, cc);
-		},
+		// Set selected element
+		tinyMCE.selectedElement = null;
+		if (node.nodeType == 1)
+			tinyMCE.selectedElement = node;
+	},
 
-		createSplitButton : function(id, s, cc) {
-			var t = this, ed = t.editor, cmd, c, cls;
+	scrollToNode : function(node) {
+		var inst = this.instance, w = inst.getWin(), vp = inst.getViewPort(), pos = tinyMCE.getAbsPosition(node), cvp, p, cwin;
 
-			if (t.get(id))
-				return null;
+		// Only scroll if out of visible area
+		if (pos.absLeft < vp.left || pos.absLeft > vp.left + vp.width || pos.absTop < vp.top || pos.absTop > vp.top + (vp.height-25))
+			w.scrollTo(pos.absLeft, pos.absTop - vp.height + 25);
 
-			s.title = ed.translate(s.title);
-			s.scope = s.scope || ed;
+		// Scroll container window
+		if (inst.settings.auto_resize) {
+			cwin = inst.getContainerWin();
+			cvp = tinyMCE.getViewPort(cwin);
+			p = this.getAbsPosition(node);
 
-			if (!s.onclick) {
-				s.onclick = function(v) {
-					ed.execCommand(s.cmd, s.ui || false, v || s.value);
-				};
-			}
+			if (p.absLeft < cvp.left || p.absLeft > cvp.left + cvp.width || p.absTop < cvp.top || p.absTop > cvp.top + cvp.height)
+				cwin.scrollTo(p.absLeft, p.absTop - cvp.height + 25);
+		}
+	},
 
-			if (!s.onselect) {
-				s.onselect = function(v) {
-					ed.execCommand(s.cmd, s.ui || false, v || s.value);
-				};
-			}
+	getAbsPosition : function(n) {
+		var pos = tinyMCE.getAbsPosition(n), ipos = tinyMCE.getAbsPosition(this.instance.iframeElement);
 
-			s = extend({
-				title : s.title,
-				'class' : 'mce_' + id,
-				scope : s.scope,
-				control_manager : t
-			}, s);
+		return {
+			absLeft : ipos.absLeft + pos.absLeft,
+			absTop : ipos.absTop + pos.absTop
+		};
+	},
 
-			id = t.prefix + id;
-			cls = cc || t._cls.splitbutton || tinymce.ui.SplitButton;
-			c = t.add(new cls(id, s));
-			ed.onMouseDown.add(c.hideMenu, c);
+	getSel : function() {
+		var inst = this.instance;
 
-			return c;
-		},
+		if (tinyMCE.isRealIE)
+			return inst.getDoc().selection;
 
-		createColorSplitButton : function(id, s, cc) {
-			var t = this, ed = t.editor, cmd, c, cls, bm;
+		return inst.contentWindow.getSelection();
+	},
 
-			if (t.get(id))
-				return null;
+	getRng : function() {
+		var s = this.getSel();
 
-			s.title = ed.translate(s.title);
-			s.scope = s.scope || ed;
+		if (s == null)
+			return null;
 
-			if (!s.onclick) {
-				s.onclick = function(v) {
-					if (tinymce.isIE)
-						bm = ed.selection.getBookmark(1);
+		if (tinyMCE.isRealIE)
+			return s.createRange();
 
-					ed.execCommand(s.cmd, s.ui || false, v || s.value);
-				};
-			}
+		if (tinyMCE.isSafari && !s.getRangeAt)
+			return '' + window.getSelection();
 
-			if (!s.onselect) {
-				s.onselect = function(v) {
-					ed.execCommand(s.cmd, s.ui || false, v || s.value);
-				};
-			}
+		if (s.rangeCount > 0)
+			return s.getRangeAt(0);
 
-			s = extend({
-				title : s.title,
-				'class' : 'mce_' + id,
-				'menu_class' : ed.getParam('skin') + 'Skin',
-				scope : s.scope,
-				more_colors_title : ed.getLang('more_colors')
-			}, s);
+		return null;
+	},
 
-			id = t.prefix + id;
-			cls = cc || t._cls.colorsplitbutton || tinymce.ui.ColorSplitButton;
-			c = new cls(id, s);
-			ed.onMouseDown.add(c.hideMenu, c);
+	isCollapsed : function() {
+		var r = this.getRng();
 
-			// Remove the menu element when the editor is removed
-			ed.onRemove.add(function() {
-				c.destroy();
-			});
+		if (r.item)
+			return false;
 
-			// Fix for bug #1897785, #1898007
-			if (tinymce.isIE) {
-				c.onShowMenu.add(function() {
-					// IE 8 needs focus in order to store away a range with the current collapsed caret location
-					ed.focus();
-					bm = ed.selection.getBookmark(1);
-				});
+		return r.boundingWidth == 0 || this.getSel().isCollapsed;
+	},
 
-				c.onHideMenu.add(function() {
-					if (bm) {
-						ed.selection.moveToBookmark(bm);
-						bm = 0;
-					}
-				});
-			}
+	collapse : function(b) {
+		var r = this.getRng(), s = this.getSel();
 
-			return t.add(c);
-		},
-
-		createToolbar : function(id, s, cc) {
-			var c, t = this, cls;
-
-			id = t.prefix + id;
-			cls = cc || t._cls.toolbar || tinymce.ui.Toolbar;
-			c = new cls(id, s);
-
-			if (t.get(id))
-				return null;
-
-			return t.add(c);
-		},
-
-		createSeparator : function(cc) {
-			var cls = cc || this._cls.separator || tinymce.ui.Separator;
-
-			return new cls();
-		},
-
-		setControlType : function(n, c) {
-			return this._cls[n.toLowerCase()] = c;
-		},
-	
-		destroy : function() {
-			each(this.controls, function(c) {
-				c.destroy();
-			});
-
-			this.controls = null;
+		if (r.select) {
+			r.collapse(b);
+			r.select();
+		} else {
+			if (b)
+				s.collapseToStart();
+			else
+				s.collapseToEnd();
 		}
-	});
-})(tinymce);
+	},
 
-(function(tinymce) {
-	var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each, isIE = tinymce.isIE, isOpera = tinymce.isOpera;
+	getFocusElement : function() {
+		var inst = this.instance, doc, rng, sel, elm;
 
-	tinymce.create('tinymce.WindowManager', {
-		WindowManager : function(ed) {
-			var t = this;
+		if (tinyMCE.isRealIE) {
+			doc = inst.getDoc();
+			rng = doc.selection.createRange();
 
-			t.editor = ed;
-			t.onOpen = new Dispatcher(t);
-			t.onClose = new Dispatcher(t);
-			t.params = {};
-			t.features = {};
-		},
+	//		if (rng.collapse)
+	//			rng.collapse(true);
 
-		open : function(s, p) {
-			var t = this, f = '', x, y, mo = t.editor.settings.dialog_type == 'modal', w, sw, sh, vp = tinymce.DOM.getViewPort(), u;
+			elm = rng.item ? rng.item(0) : rng.parentElement();
+		} else {
+			if (!tinyMCE.isSafari && inst.isHidden())
+				return inst.getBody();
 
-			// Default some options
-			s = s || {};
-			p = p || {};
-			sw = isOpera ? vp.w : screen.width; // Opera uses windows inside the Opera window
-			sh = isOpera ? vp.h : screen.height;
-			s.name = s.name || 'mc_' + new Date().getTime();
-			s.width = parseInt(s.width || 320);
-			s.height = parseInt(s.height || 240);
-			s.resizable = true;
-			s.left = s.left || parseInt(sw / 2.0) - (s.width / 2.0);
-			s.top = s.top || parseInt(sh / 2.0) - (s.height / 2.0);
-			p.inline = false;
-			p.mce_width = s.width;
-			p.mce_height = s.height;
-			p.mce_auto_focus = s.auto_focus;
+			sel = this.getSel();
+			rng = this.getRng();
 
-			if (mo) {
-				if (isIE) {
-					s.center = true;
-					s.help = false;
-					s.dialogWidth = s.width + 'px';
-					s.dialogHeight = s.height + 'px';
-					s.scroll = s.scrollbars || false;
-				}
-			}
+			if (!sel || !rng)
+				return null;
 
-			// Build features string
-			each(s, function(v, k) {
-				if (tinymce.is(v, 'boolean'))
-					v = v ? 'yes' : 'no';
+			elm = rng.commonAncestorContainer;
+			//elm = (sel && sel.anchorNode) ? sel.anchorNode : null;
 
-				if (!/^(name|url)$/.test(k)) {
-					if (isIE && mo)
-						f += (f ? ';' : '') + k + ':' + v;
-					else
-						f += (f ? ',' : '') + k + '=' + v;
+			// Handle selection a image or other control like element such as anchors
+			if (!rng.collapsed) {
+				// Is selection small
+				if (rng.startContainer == rng.endContainer) {
+					if (rng.startOffset - rng.endOffset < 2) {
+						if (rng.startContainer.hasChildNodes())
+							elm = rng.startContainer.childNodes[rng.startOffset];
+					}
 				}
-			});
-
-			t.features = s;
-			t.params = p;
-			t.onOpen.dispatch(t, s, p);
-
-			u = s.url || s.file;
-			u = tinymce._addVer(u);
-
-			try {
-				if (isIE && mo) {
-					w = 1;
-					window.showModalDialog(u, window, f);
-				} else
-					w = window.open(u, s.name, f);
-			} catch (ex) {
-				// Ignore
 			}
 
-			if (!w)
-				alert(t.editor.getLang('popup_blocked'));
-		},
+			// Get the element parent of the node
+			elm = tinyMCE.getParentElement(elm);
 
-		close : function(w) {
-			w.close();
-			this.onClose.dispatch(this);
-		},
-
-		createInstance : function(cl, a, b, c, d, e) {
-			var f = tinymce.resolve(cl);
-
-			return new f(a, b, c, d, e);
-		},
-
-		confirm : function(t, cb, s, w) {
-			w = w || window;
-
-			cb.call(s || this, w.confirm(this._decode(this.editor.getLang(t, t))));
-		},
-
-		alert : function(tx, cb, s, w) {
-			var t = this;
-
-			w = w || window;
-			w.alert(t._decode(t.editor.getLang(tx, tx)));
-
-			if (cb)
-				cb.call(s || t);
-		},
-
-		resizeBy : function(dw, dh, win) {
-			win.resizeBy(dw, dh);
-		},
-
-		// Internal functions
-
-		_decode : function(s) {
-			return tinymce.DOM.decode(s).replace(/\\n/g, '\n');
+			//if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "img")
+			//	elm = tinyMCE.selectedElement;
 		}
-	});
-}(tinymce));
-(function(tinymce) {
-	function CommandManager() {
-		var execCommands = {}, queryStateCommands = {}, queryValueCommands = {};
 
-		function add(collection, cmd, func, scope) {
-			if (typeof(cmd) == 'string')
-				cmd = [cmd];
+		return elm;
+	}
 
-			tinymce.each(cmd, function(cmd) {
-				collection[cmd.toLowerCase()] = {func : func, scope : scope};
-			});
-		};
-
-		tinymce.extend(this, {
-			add : function(cmd, func, scope) {
-				add(execCommands, cmd, func, scope);
-			},
-
-			addQueryStateHandler : function(cmd, func, scope) {
-				add(queryStateCommands, cmd, func, scope);
-			},
-
-			addQueryValueHandler : function(cmd, func, scope) {
-				add(queryValueCommands, cmd, func, scope);
-			},
-
-			execCommand : function(scope, cmd, ui, value, args) {
-				if (cmd = execCommands[cmd.toLowerCase()]) {
-					if (cmd.func.call(scope || cmd.scope, ui, value, args) !== false)
-						return true;
-				}
-			},
-
-			queryCommandValue : function() {
-				if (cmd = queryValueCommands[cmd.toLowerCase()])
-					return cmd.func.call(scope || cmd.scope, ui, value, args);
-			},
-
-			queryCommandState : function() {
-				if (cmd = queryStateCommands[cmd.toLowerCase()])
-					return cmd.func.call(scope || cmd.scope, ui, value, args);
-			}
-		});
 	};
 
-	tinymce.GlobalCommands = new CommandManager();
-})(tinymce);
-(function(tinymce) {
-	tinymce.Formatter = function(ed) {
-		var formats = {},
-			each = tinymce.each,
-			dom = ed.dom,
-			selection = ed.selection,
-			TreeWalker = tinymce.dom.TreeWalker,
-			rangeUtils = new tinymce.dom.RangeUtils(dom),
-			isValid = ed.schema.isValid,
-			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,
-			undefined,
-			pendingFormats = {apply : [], remove : []};
+/* file:jscripts/tiny_mce/classes/TinyMCE_UndoRedo.class.js */
 
-		function isArray(obj) {
-			return obj instanceof Array;
-		};
+function TinyMCE_UndoRedo(inst) {
+	this.instance = inst;
+	this.undoLevels = [];
+	this.undoIndex = 0;
+	this.typingUndoIndex = -1;
+	this.undoRedo = true;
+};
 
-		function getParents(node, selector) {
-			return dom.getParents(node, selector, dom.getRoot());
-		};
+TinyMCE_UndoRedo.prototype = {
+	add : function(l) {
+		var b, customUndoLevels, newHTML, inst = this.instance, i, ul, ur;
 
-		function isCaretNode(node) {
-			return node.nodeType === 1 && (node.face === 'mceinline' || node.style.fontFamily === 'mceinline');
-		};
+		if (l) {
+			this.undoLevels[this.undoLevels.length] = l;
+			return true;
+		}
 
-		// Public functions
+		if (this.typingUndoIndex != -1) {
+			this.undoIndex = this.typingUndoIndex;
 
-		function get(name) {
-			return name ? formats[name] : formats;
-		};
+			if (tinyMCE.typingUndoIndex != -1)
+				tinyMCE.undoIndex = tinyMCE.typingUndoIndex;
+		}
 
-		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];
+		newHTML = tinyMCE.trim(inst.getBody().innerHTML);
+		if (this.undoLevels[this.undoIndex] && newHTML != this.undoLevels[this.undoIndex].content) {
+			//tinyMCE.debug(newHTML, this.undoLevels[this.undoIndex].content);
 
-					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 === undefined)
-							format.deep = !format.selector;
+			// Is dirty again
+			inst.isNotDirty = false;
 
-						// Default to true
-						if (format.split === undefined)
-							format.split = !format.selector || format.inline;
+			tinyMCE.dispatchCallback(inst, 'onchange_callback', 'onChange', inst);
 
-						// Default to true
-						if (format.remove === undefined && format.selector && !format.inline)
-							format.remove = 'none';
+			// Time to compress
+			customUndoLevels = tinyMCE.settings.custom_undo_redo_levels;
+			if (customUndoLevels != -1 && this.undoLevels.length > customUndoLevels) {
+				for (i=0; i<this.undoLevels.length-1; i++)
+					this.undoLevels[i] = this.undoLevels[i+1];
 
-						// Mark format as a mixed format inline + block level
-						if (format.selector && format.inline) {
-							format.mixed = true;
-							format.block_expand = true;
-						}
+				this.undoLevels.length--;
+				this.undoIndex--;
 
-						// Split classes if needed
-						if (typeof(format.classes) === 'string')
-							format.classes = format.classes.split(/\s+/);
-					});
-
-					formats[name] = format;
-				}
+				// Todo: Implement global undo/redo logic here
 			}
-		};
 
-		function apply(name, vars, node) {
-			var formatList = get(name), format = formatList[0], bookmark, rng, i;
+			b = inst.undoBookmark;
 
-			function moveStart(rng) {
-				var container = rng.startContainer,
-					offset = rng.startOffset,
-					walker, node;
+			if (!b)
+				b = inst.selection.getBookmark();
 
-				// Move startContainer/startOffset in to a suitable node
-				if (container.nodeType == 1 || container.nodeValue === "") {
-					container = container.nodeType == 1 ? container.childNodes[offset] : container;
-
-					// Might fail if the offset is behind the last element in it's container
-					if (container) {
-						walker = new TreeWalker(container, container.parentNode);
-						for (node = walker.current(); node; node = walker.next()) {
-							if (node.nodeType == 3 && !isWhiteSpaceNode(node)) {
-								rng.setStart(node, 0);
-								break;
-							}
-						}
-					}
-				}
-
-				return rng;
+			this.undoIndex++;
+			this.undoLevels[this.undoIndex] = {
+				content : newHTML,
+				bookmark : b
 			};
 
-			function setElementFormat(elm, fmt) {
-				fmt = fmt || format;
+			// Remove all above from global undo/redo
+			ul = tinyMCE.undoLevels;
+			for (i=tinyMCE.undoIndex + 1; i<ul.length; i++) {
+				ur = ul[i].undoRedo;
 
-				if (elm) {
-					each(fmt.styles, function(value, name) {
-						dom.setStyle(elm, name, replaceVars(value, vars));
-					});
+				if (ur.undoIndex == ur.undoLevels.length -1)
+					ur.undoIndex--;
 
-					each(fmt.attributes, function(value, name) {
-						dom.setAttrib(elm, name, replaceVars(value, vars));
-					});
+				ur.undoLevels.length--;
+			}
 
-					each(fmt.classes, function(value) {
-						value = replaceVars(value, vars);
+			// Add global undo level
+			tinyMCE.undoLevels[tinyMCE.undoIndex++] = inst;
+			tinyMCE.undoLevels.length = tinyMCE.undoIndex;
 
-						if (!dom.hasClass(elm, value))
-							dom.addClass(elm, value);
-					});
-				}
-			};
+			this.undoLevels.length = this.undoIndex + 1;
 
-			function applyRngStyle(rng) {
-				var newWrappers = [], wrapName, wrapElm;
+			return true;
+		}
 
-				// Setup wrapper element
-				wrapName = format.inline || format.block;
-				wrapElm = dom.create(wrapName);
-				setElementFormat(wrapElm);
+		return false;
+	},
 
-				rangeUtils.walk(rng, function(nodes) {
-					var currentWrapElm;
+	undo : function() {
+		var inst = this.instance;
 
-					function process(node) {
-						var nodeName = node.nodeName.toLowerCase(), parentName = node.parentNode.nodeName.toLowerCase(), found;
+		// Do undo
+		if (this.undoIndex > 0) {
+			this.undoIndex--;
 
-						// Stop wrapping on br elements
-						if (isEq(nodeName, 'br')) {
-							currentWrapElm = 0;
+			tinyMCE.setInnerHTML(inst.getBody(), this.undoLevels[this.undoIndex].content);
+			inst.repaint();
 
-							// Remove any br elements when we wrap things
-							if (format.block)
-								dom.remove(node);
+			if (inst.settings.custom_undo_redo_restore_selection)
+				inst.selection.moveToBookmark(this.undoLevels[this.undoIndex].bookmark);
+		}
+	},
 
-							return;
-						}
+	redo : function() {
+		var inst = this.instance;
 
-						// If node is wrapper type
-						if (format.wrapper && matchNode(node, name, vars)) {
-							currentWrapElm = 0;
-							return;
-						}
+		tinyMCE.execCommand("mceEndTyping");
 
-						// Can we rename the block
-						if (format.block && !format.wrapper && isTextBlock(nodeName)) {
-							node = dom.rename(node, wrapName);
-							setElementFormat(node);
-							newWrappers.push(node);
-							currentWrapElm = 0;
-							return;
-						}
+		if (this.undoIndex < (this.undoLevels.length-1)) {
+			this.undoIndex++;
 
-						// Handle selector patterns
-						if (format.selector) {
-							// Look for matching formats
-							each(formatList, function(format) {
-								if (dom.is(node, format.selector) && !isCaretNode(node)) {
-									setElementFormat(node, format);
-									found = true;
-								}
-							});
+			tinyMCE.setInnerHTML(inst.getBody(), this.undoLevels[this.undoIndex].content);
+			inst.repaint();
 
-							// Continue processing if a selector match wasn't found and a inline element is defined
-							if (!format.inline || found) {
-								currentWrapElm = 0;
-								return;
-							}
-						}
+			if (inst.settings.custom_undo_redo_restore_selection)
+				inst.selection.moveToBookmark(this.undoLevels[this.undoIndex].bookmark);
+		}
 
-						// Is it valid to wrap this item
-						if (isValid(wrapName, nodeName) && isValid(parentName, wrapName)) {
-							// Start wrapping
-							if (!currentWrapElm) {
-								// Wrap the node
-								currentWrapElm = wrapElm.cloneNode(FALSE);
-								node.parentNode.insertBefore(currentWrapElm, node);
-								newWrappers.push(currentWrapElm);
-							}
+		tinyMCE.triggerNodeChange();
+	}
 
-							currentWrapElm.appendChild(node);
-						} else {
-							// Start a new wrapper for possible children
-							currentWrapElm = 0;
+	};
 
-							each(tinymce.grep(node.childNodes), process);
+/* file:jscripts/tiny_mce/classes/TinyMCE_ForceParagraphs.class.js */
 
-							// End the last wrapper
-							currentWrapElm = 0;
-						}
-					};
+var TinyMCE_ForceParagraphs = {
+	_insertPara : function(inst, e) {
+		var doc = inst.getDoc(), sel = inst.getSel(), body = inst.getBody(), win = inst.contentWindow, rng = sel.getRangeAt(0);
+		var rootElm = doc.documentElement, blockName = "P", startNode, endNode, startBlock, endBlock;
+		var rngBefore, rngAfter, direct, startNode, startOffset, endNode, endOffset, b = tinyMCE.isOpera ? inst.selection.getBookmark() : null;
+		var paraBefore, paraAfter, startChop, endChop, contents, i;
 
-					// Process siblings from range
-					each(nodes, process);
-				});
+		function isEmpty(para) {
+			var nodes;
 
-				// Cleanup
-				each(newWrappers, function(node) {
-					var childCount;
+			function isEmptyHTML(html) {
+				return html.replace(new RegExp('[ \t\r\n]+', 'g'), '').toLowerCase() == '';
+			}
 
-					function getChildCount(node) {
-						var count = 0;
+			// Check for images
+			if (para.getElementsByTagName("img").length > 0)
+				return false;
 
-						each(node.childNodes, function(node) {
-							if (!isWhiteSpaceNode(node) && !isBookmarkNode(node))
-								count++;
-						});
+			// Check for tables
+			if (para.getElementsByTagName("table").length > 0)
+				return false;
 
-						return count;
-					};
+			// Check for HRs
+			if (para.getElementsByTagName("hr").length > 0)
+				return false;
 
-					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 && matchName(child, format)) {
-							clone = child.cloneNode(FALSE);
-							setElementFormat(clone);
-
-							dom.replace(clone, node, TRUE);
-							dom.remove(child, 1);
-						}
-
-						return clone || node;
-					};
-
-					childCount = getChildCount(node);
-
-					// Remove empty nodes
-					if (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) {
-								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) {
-							node = mergeSiblings(getNonWhiteSpaceSibling(node), node);
-							node = mergeSiblings(node, getNonWhiteSpaceSibling(node, TRUE));
-						}
-					}
-				});
-			};
-
-			if (format) {
-				if (node) {
-					rng = dom.createRng();
-
-					rng.setStartBefore(node);
-					rng.setEndAfter(node);
-
-					applyRngStyle(expandRng(rng, formatList));
-				} else {
-					if (!selection.isCollapsed() || !format.inline) {
-						// Apply formatting to selection
-						bookmark = selection.getBookmark();
-						applyRngStyle(expandRng(selection.getRng(TRUE), formatList));
-
-						selection.moveToBookmark(bookmark);
-						selection.setRng(moveStart(selection.getRng(TRUE)));
-						ed.nodeChanged();
-					} else
-						performCaretAction('apply', name, vars);
-				}
+			// Check all textnodes
+			nodes = tinyMCE.getNodeTree(para, [], 3);
+			for (i=0; i<nodes.length; i++) {
+				if (!isEmptyHTML(nodes[i].nodeValue))
+					return false;
 			}
-		};
 
-		function remove(name, vars, node) {
-			var formatList = get(name), format = formatList[0], bookmark, i, rng;
+			// No images, no tables, no hrs, no text content then it's empty
+			return true;
+		}
 
-			function moveStart(rng) {
-				var container = rng.startContainer,
-					offset = rng.startOffset,
-					walker, node, nodes, tmpNode;
+	//	tinyMCE.debug(body.innerHTML);
 
-				// Convert text node into index if possible
-				if (container.nodeType == 3 && offset >= container.nodeValue.length - 1) {
-					container = container.parentNode;
-					offset = nodeIndex(container) + 1;
-				}
+	//	debug(e.target, sel.anchorNode.nodeName, sel.focusNode.nodeName, rng.startContainer, rng.endContainer, rng.commonAncestorContainer, sel.anchorOffset, sel.focusOffset, rng.toString());
 
-				// 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);
+		// Setup before range
+		rngBefore = doc.createRange();
+		rngBefore.setStart(sel.anchorNode, sel.anchorOffset);
+		rngBefore.collapse(true);
 
-					// If offset is at end of the parent node walk to the next one
-					if (offset > nodes.length - 1)
-						walker.next();
+		// Setup after range
+		rngAfter = doc.createRange();
+		rngAfter.setStart(sel.focusNode, sel.focusOffset);
+		rngAfter.collapse(true);
 
-					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', null, INVISIBLE_CHAR);
-							node.parentNode.insertBefore(tmpNode, node);
+		// Setup start/end points
+		direct = rngBefore.compareBoundaryPoints(rngBefore.START_TO_END, rngAfter) < 0;
+		startNode = direct ? sel.anchorNode : sel.focusNode;
+		startOffset = direct ? sel.anchorOffset : sel.focusOffset;
+		endNode = direct ? sel.focusNode : sel.anchorNode;
+		endOffset = direct ? sel.focusOffset : sel.anchorOffset;
 
-							// Set selection and remove tmpNode
-							rng.setStart(node, 0);
-							selection.setRng(rng);
-							dom.remove(tmpNode);
+		startNode = startNode.nodeName == "HTML" ? doc.body : startNode; // Fix for Opera bug: https://bugs.opera.com/show_bug.cgi?id=273224&comments=yes
+		startNode = startNode.nodeName == "BODY" ? startNode.firstChild : startNode;
+		endNode = endNode.nodeName == "BODY" ? endNode.firstChild : endNode;
 
-							return;
-						}
-					}
-				}
-			};
+		// Get block elements
+		startBlock = inst.getParentBlockElement(startNode);
+		endBlock = inst.getParentBlockElement(endNode);
 
-			// Merges the styles for each node
-			function process(node) {
-				var children, i, l;
+		// If absolute force paragraph generation within
+		if (startBlock && (startBlock.nodeName == 'CAPTION' || /absolute|relative|static/gi.test(startBlock.style.position)))
+			startBlock = null;
 
-				// Grab the children first since the nodelist might be changed
-				children = tinymce.grep(node.childNodes);
+		if (endBlock && (endBlock.nodeName == 'CAPTION' || /absolute|relative|static/gi.test(endBlock.style.position)))
+			endBlock = null;
 
-				// Process current node
-				for (i = 0, l = formatList.length; i < l; i++) {
-					if (removeFormat(formatList[i], vars, node, node))
-						break;
-				}
+		// Use current block name
+		if (startBlock != null) {
+			blockName = startBlock.nodeName;
 
-				// Process the children
-				if (format.deep) {
-					for (i = 0, l = children.length; i < l; i++)
-						process(children[i]);
-				}
-			};
+			// Use P instead
+			if (/(TD|TABLE|TH|CAPTION)/.test(blockName) || (blockName == "DIV" && /left|right/gi.test(startBlock.style.cssFloat)))
+				blockName = "P";
+		}
 
-			function findFormatRoot(container) {
-				var formatRoot;
+		// Within a list use normal behaviour
+		if (tinyMCE.getParentElement(startBlock, "OL,UL", null, body) != null)
+			return false;
 
-				// Find format root
-				each(getParents(container.parentNode).reverse(), function(parent) {
-					var format;
+		// Within a table create new paragraphs
+		if ((startBlock != null && startBlock.nodeName == "TABLE") || (endBlock != null && endBlock.nodeName == "TABLE"))
+			startBlock = endBlock = null;
 
-					// 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);
-						if (format && format.split !== false)
-							formatRoot = parent;
-					}
-				});
+		// Setup new paragraphs
+		paraBefore = (startBlock != null && startBlock.nodeName == blockName) ? startBlock.cloneNode(false) : doc.createElement(blockName);
+		paraAfter = (endBlock != null && endBlock.nodeName == blockName) ? endBlock.cloneNode(false) : doc.createElement(blockName);
 
-				return formatRoot;
-			};
+		// Is header, then force paragraph under
+		if (/^(H[1-6])$/.test(blockName))
+			paraAfter = doc.createElement("p");
 
-			function wrapAndSplit(format_root, container, target, split) {
-				var parent, clone, lastClone, firstClone, i, formatRootParent;
+		// Setup chop nodes
+		startChop = startNode;
+		endChop = endNode;
 
-				// Format root found then clone formats and split it
-				if (format_root) {
-					formatRootParent = format_root.parentNode;
+		// Get startChop node
+		node = startChop;
+		do {
+			if (node == body || node.nodeType == 9 || tinyMCE.isBlockElement(node))
+				break;
 
-					for (parent = container.parentNode; parent && parent != formatRootParent; parent = parent.parentNode) {
-						clone = parent.cloneNode(FALSE);
+			startChop = node;
+		} while ((node = node.previousSibling ? node.previousSibling : node.parentNode));
 
-						for (i = 0; i < formatList.length; i++) {
-							if (removeFormat(formatList[i], vars, clone, clone)) {
-								clone = 0;
-								break;
-							}
-						}
+		// Get endChop node
+		node = endChop;
+		do {
+			if (node == body || node.nodeType == 9 || tinyMCE.isBlockElement(node))
+				break;
 
-						// Build wrapper node
-						if (clone) {
-							if (lastClone)
-								clone.appendChild(lastClone);
+			endChop = node;
+		} while ((node = node.nextSibling ? node.nextSibling : node.parentNode));
 
-							if (!firstClone)
-								firstClone = clone;
+		// Fix when only a image is within the TD
+		if (startChop.nodeName == "TD")
+			startChop = startChop.firstChild;
 
-							lastClone = clone;
-						}
-					}
+		if (endChop.nodeName == "TD")
+			endChop = endChop.lastChild;
 
-					// Never split block elements if the format is mixed
-					if (split && (!format.mixed || !isBlock(format_root)))
-						container = dom.split(format_root, container);
+		// If not in a block element
+		if (startBlock == null) {
+			// Delete selection
+			rng.deleteContents();
 
-					// Wrap container in cloned formats
-					if (lastClone) {
-						target.parentNode.insertBefore(lastClone, target);
-						firstClone.appendChild(target);
-					}
-				}
+			if (!tinyMCE.isSafari)
+				sel.removeAllRanges();
 
-				return container;
-			};
+			if (startChop != rootElm && endChop != rootElm) {
+				// Insert paragraph before
+				rngBefore = rng.cloneRange();
 
-			function splitToFormatRoot(container) {
-				return wrapAndSplit(findFormatRoot(container), container, container, true);
-			};
+				if (startChop == body)
+					rngBefore.setStart(startChop, 0);
+				else
+					rngBefore.setStartBefore(startChop);
 
-			function unwrap(start) {
-				var node = dom.get(start ? '_start' : '_end'),
-					out = node[start ? 'firstChild' : 'lastChild'];
+				paraBefore.appendChild(rngBefore.cloneContents());
 
-				// 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'];
+				// Insert paragraph after
+				if (endChop.parentNode.nodeName == blockName)
+					endChop = endChop.parentNode;
 
-				dom.remove(node, true);
+				// If not after image
+				//if (rng.startContainer.nodeName != "BODY" && rng.endContainer.nodeName != "BODY")
+					rng.setEndAfter(endChop);
 
-				return out;
-			};
+				if (endChop.nodeName != "#text" && endChop.nodeName != "BODY")
+					rngBefore.setEndAfter(endChop);
 
-			function removeRngStyle(rng) {
-				var startContainer, endContainer;
+				contents = rng.cloneContents();
+				if (contents.firstChild && (contents.firstChild.nodeName == blockName || contents.firstChild.nodeName == "BODY"))
+					paraAfter.innerHTML = contents.firstChild.innerHTML;
+				else
+					paraAfter.appendChild(contents);
 
-				rng = expandRng(rng, formatList, TRUE);
+				// Check if it's a empty paragraph
+				if (isEmpty(paraBefore))
+					paraBefore.innerHTML = " ";
 
-				if (format.split) {
-					startContainer = getContainer(rng, TRUE);
-					endContainer = getContainer(rng);
+				// Check if it's a empty paragraph
+				if (isEmpty(paraAfter))
+					paraAfter.innerHTML = " ";
 
-					if (startContainer != endContainer) {
-						// Wrap start/end nodes in span element since these might be cloned/moved
-						startContainer = wrap(startContainer, 'span', {id : '_start', _mce_type : 'bookmark'});
-						endContainer = wrap(endContainer, 'span', {id : '_end', _mce_type : 'bookmark'});
+				// Delete old contents
+				rng.deleteContents();
+				rngAfter.deleteContents();
+				rngBefore.deleteContents();
 
-						// 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;
-					rng.startOffset = nodeIndex(startContainer);
-					rng.endContainer = endContainer.parentNode;
-					rng.endOffset = nodeIndex(endContainer) + 1;
+				// Insert new paragraphs
+				if (tinyMCE.isOpera) {
+					paraBefore.normalize();
+					rngBefore.insertNode(paraBefore);
+					paraAfter.normalize();
+					rngBefore.insertNode(paraAfter);
+				} else {
+					paraAfter.normalize();
+					rngBefore.insertNode(paraAfter);
+					paraBefore.normalize();
+					rngBefore.insertNode(paraBefore);
 				}
 
-				// Remove items between start/end
-				rangeUtils.walk(rng, function(nodes) {
-					each(nodes, function(node) {
-						process(node);
-					});
-				});
-			};
-
-			// Handle node
-			if (node) {
-				rng = dom.createRng();
-				rng.setStartBefore(node);
-				rng.setEndAfter(node);
-				removeRngStyle(rng);
-				return;
+				//tinyMCE.debug("1: ", paraBefore.innerHTML, paraAfter.innerHTML);
+			} else {
+				body.innerHTML = "<" + blockName + "> </" + blockName + "><" + blockName + "> </" + blockName + ">";
+				paraAfter = body.childNodes[1];
 			}
 
-			if (!selection.isCollapsed() || !format.inline) {
-				bookmark = selection.getBookmark();
-				removeRngStyle(selection.getRng(TRUE));
-				selection.moveToBookmark(bookmark);
+			inst.selection.moveToBookmark(b);
+			inst.selection.selectNode(paraAfter, true, true);
 
-				// 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 (match(name, vars, selection.getStart())) {
-					moveStart(selection.getRng(true));
-				}
+			return true;
+		}
 
-				ed.nodeChanged();
-			} else
-				performCaretAction('remove', name, vars);
-		};
+		// Place first part within new paragraph
+		if (startChop.nodeName == blockName)
+			rngBefore.setStart(startChop, 0);
+		else
+			rngBefore.setStartBefore(startChop);
 
-		function toggle(name, vars, node) {
-			if (match(name, vars, node))
-				remove(name, vars, node);
-			else
-				apply(name, vars, node);
-		};
+		rngBefore.setEnd(startNode, startOffset);
+		paraBefore.appendChild(rngBefore.cloneContents());
 
-		function matchNode(node, name, vars, similar) {
-			var formatList = get(name), format, i, classes;
+		// Place secound part within new paragraph
+		rngAfter.setEndAfter(endChop);
+		rngAfter.setStart(endNode, endOffset);
+		contents = rngAfter.cloneContents();
 
-			function matchItems(node, format, item_name) {
-				var key, value, items = format[item_name], i;
-
-				// Check all items
-				if (items) {
-					// Non indexed object
-					if (items.length === undefined) {
-						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, replaceVars(items[key], vars)))
-									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;
-					}
-				}
+		if (contents.firstChild && contents.firstChild.nodeName == blockName) {
+	/*		var nodes = contents.firstChild.childNodes;
+			for (i=0; i<nodes.length; i++) {
+				//tinyMCE.debug(nodes[i].nodeName);
+				if (nodes[i].nodeName != "BODY")
+					paraAfter.appendChild(nodes[i]);
 			}
-		};
+	*/
+			paraAfter.innerHTML = contents.firstChild.innerHTML;
+		} else
+			paraAfter.appendChild(contents);
 
-		function match(name, vars, node) {
-			var startNode, i;
+		// Check if it's a empty paragraph
+		if (isEmpty(paraBefore))
+			paraBefore.innerHTML = " ";
 
-			function matchParents(node) {
-				// Find first node with similar format settings
-				node = dom.getParent(node, function(node) {
-					return !!matchNode(node, name, vars, true);
-				});
+		// Check if it's a empty paragraph
+		if (isEmpty(paraAfter))
+			paraAfter.innerHTML = " ";
 
-				// Do an exact check on the similar format element
-				return matchNode(node, name, vars);
-			};
+		// Create a range around everything
+		rng = doc.createRange();
 
-			// Check specified node
-			if (node)
-				return matchParents(node);
+		if (!startChop.previousSibling && startChop.parentNode.nodeName.toUpperCase() == blockName) {
+			rng.setStartBefore(startChop.parentNode);
+		} else {
+			if (rngBefore.startContainer.nodeName.toUpperCase() == blockName && rngBefore.startOffset == 0)
+				rng.setStartBefore(rngBefore.startContainer);
+			else
+				rng.setStart(rngBefore.startContainer, rngBefore.startOffset);
+		}
 
-			// Check pending formats
-			if (selection.isCollapsed()) {
-				for (i = pendingFormats.apply.length - 1; i >= 0; i--) {
-					if (pendingFormats.apply[i].name == name)
-						return true;
-				}
+		if (!endChop.nextSibling && endChop.parentNode.nodeName.toUpperCase() == blockName)
+			rng.setEndAfter(endChop.parentNode);
+		else
+			rng.setEnd(rngAfter.endContainer, rngAfter.endOffset);
 
-				for (i = pendingFormats.remove.length - 1; i >= 0; i--) {
-					if (pendingFormats.remove[i].name == name)
-						return false;
-				}
+		// Delete all contents and insert new paragraphs
+		rng.deleteContents();
 
-				return matchParents(selection.getNode());
-			}
+		if (tinyMCE.isOpera) {
+			rng.insertNode(paraBefore);
+			rng.insertNode(paraAfter);
+		} else {
+			rng.insertNode(paraAfter);
+			rng.insertNode(paraBefore);
+		}
 
-			// Check selected node
-			node = selection.getNode();
-			if (matchParents(node))
-				return TRUE;
+		//tinyMCE.debug("2", paraBefore.innerHTML, paraAfter.innerHTML);
 
-			// Check start node if it's different
-			startNode = selection.getStart();
-			if (startNode != node) {
-				if (matchParents(startNode))
-					return TRUE;
-			}
+		// Normalize
+		paraAfter.normalize();
+		paraBefore.normalize();
 
-			return FALSE;
-		};
+		inst.selection.moveToBookmark(b);
+		inst.selection.selectNode(paraAfter, true, true);
 
-		function matchAll(names, vars) {
-			var startElement, matchedFormatNames = [], checkedMap = {}, i, ni, name;
+		return true;
+	},
 
-			// If the selection is collapsed then check pending formats
-			if (selection.isCollapsed()) {
-				for (ni = 0; ni < names.length; ni++) {
-					// If the name is to be removed, then stop it from being added
-					for (i = pendingFormats.remove.length - 1; i >= 0; i--) {
-						name = names[ni];
+	_handleBackSpace : function(inst) {
+		var r = inst.getRng(), sn = r.startContainer, nv, s = false;
 
-						if (pendingFormats.remove[i].name == name) {
-							checkedMap[name] = true;
-							break;
-						}
-					}
-				}
+		// Added body check for bug #1527787
+		if (sn && sn.nextSibling && sn.nextSibling.nodeName == "BR" && sn.parentNode.nodeName != "BODY") {
+			nv = sn.nodeValue;
 
-				// If the format is to be applied
-				for (i = pendingFormats.apply.length - 1; i >= 0; i--) {
-					for (ni = 0; ni < names.length; ni++) {
-						name = names[ni];
+			// Handle if a backspace is pressed after a space character #bug 1466054 removed since fix for #1527787
+			/*if (nv != null && nv.length >= r.startOffset && nv.charAt(r.startOffset - 1) == ' ')
+				s = true;*/
 
-						if (!checkedMap[name] && pendingFormats.apply[i].name == name) {
-							checkedMap[name] = true;
-							matchedFormatNames.push(name);
-						}
-					}
-				}
-			}
+			// Only remove BRs if we are at the end of line #bug 1464152
+			if (nv != null && r.startOffset == nv.length)
+				sn.nextSibling.parentNode.removeChild(sn.nextSibling);
+		}
 
-			// Check start of selection for formats
-			startElement = selection.getStart();
-			dom.getParent(startElement, function(node) {
-				var i, name;
+		if (inst.settings.auto_resize)
+			inst.resizeToContent();
 
-				for (i = 0; i < names.length; i++) {
-					name = names[i];
+		return s;
+	}
 
-					if (!checkedMap[name] && matchNode(node, name, vars)) {
-						checkedMap[name] = true;
-						matchedFormatNames.push(name);
-					}
-				}
-			});
+	};
 
-			return matchedFormatNames;
-		};
+/* file:jscripts/tiny_mce/classes/TinyMCE_Layer.class.js */
 
-		function canApply(name) {
-			var formatList = get(name), startNode, parents, i, x, selector;
+function TinyMCE_Layer(id, bm) {
+	this.id = id;
+	this.blockerElement = null;
+	this.events = false;
+	this.element = null;
+	this.blockMode = typeof(bm) != 'undefined' ? bm : true;
+	this.doc = document;
+};
 
-			if (formatList) {
-				startNode = selection.getStart();
-				parents = getParents(startNode);
+TinyMCE_Layer.prototype = {
+	moveRelativeTo : function(re, p) {
+		var rep = this.getAbsPosition(re), e = this.getElement(), x, y;
+		var w = parseInt(re.offsetWidth), h = parseInt(re.offsetHeight);
+		var ew = parseInt(e.offsetWidth), eh = parseInt(e.offsetHeight);
 
-				for (x = formatList.length - 1; x >= 0; x--) {
-					selector = formatList[x].selector;
+		switch (p) {
+			case "tl":
+				x = rep.absLeft;
+				y = rep.absTop;
+				break;
 
-					// Format is not selector based, then always return TRUE
-					if (!selector)
-						return TRUE;
+			case "tr":
+				x = rep.absLeft + w;
+				y = rep.absTop;
+				break;
 
-					for (i = parents.length - 1; i >= 0; i--) {
-						if (dom.is(parents[i], selector))
-							return TRUE;
-					}
-				}
-			}
+			case "bl":
+				x = rep.absLeft;
+				y = rep.absTop + h;
+				break;
 
-			return FALSE;
-		};
+			case "br":
+				x = rep.absLeft + w;
+				y = rep.absTop + h;
+				break;
 
-		// Expose to public
-		tinymce.extend(this, {
-			get : get,
-			register : register,
-			apply : apply,
-			remove : remove,
-			toggle : toggle,
-			match : match,
-			matchAll : matchAll,
-			matchNode : matchNode,
-			canApply : canApply
-		});
+			case "cc":
+				x = rep.absLeft + (w / 2) - (ew / 2);
+				y = rep.absTop + (h / 2) - (eh / 2);
+				break;
+		}
 
-		// Private functions
+		this.moveTo(x, y);
+	},
 
-		function matchName(node, format) {
-			// Check for inline match
-			if (isEq(node, format.inline))
-				return TRUE;
+	moveBy : function(x, y) {
+		var e = this.getElement();
+		this.moveTo(parseInt(e.style.left) + x, parseInt(e.style.top) + y);
+	},
 
-			// Check for block match
-			if (isEq(node, format.block))
-				return TRUE;
+	moveTo : function(x, y) {
+		var e = this.getElement();
 
-			// Check for selector match
-			if (format.selector)
-				return dom.is(node, format.selector);
-		};
+		e.style.left = x + "px";
+		e.style.top = y + "px";
 
-		function isEq(str1, str2) {
-			str1 = str1 || '';
-			str2 = str2 || '';
+		this.updateBlocker();
+	},
 
-			str1 = '' + (str1.nodeName || str1);
-			str2 = '' + (str2.nodeName || str2);
+	resizeBy : function(w, h) {
+		var e = this.getElement();
+		this.resizeTo(parseInt(e.style.width) + w, parseInt(e.style.height) + h);
+	},
 
-			return str1.toLowerCase() == str2.toLowerCase();
-		};
+	resizeTo : function(w, h) {
+		var e = this.getElement();
 
-		function getStyle(node, name) {
-			var styleVal = dom.getStyle(node, name);
+		if (w != null)
+			e.style.width = w + "px";
 
-			// Force the format to hex
-			if (name == 'color' || name == 'backgroundColor')
-				styleVal = dom.toHex(styleVal);
+		if (h != null)
+			e.style.height = h + "px";
 
-			// Opera will return bold as 700
-			if (name == 'fontWeight' && styleVal == 700)
-				styleVal = 'bold';
+		this.updateBlocker();
+	},
 
-			return '' + styleVal;
-		};
+	show : function() {
+		var el = this.getElement();
 
-		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;
-				});
-			}
+		if (el) {
+			el.style.display = 'block';
+			this.updateBlocker();
+		}
+	},
 
-			return value;
-		};
+	hide : function() {
+		var el = this.getElement();
 
-		function isWhiteSpaceNode(node) {
-			return node && node.nodeType === 3 && /^([\s\r\n]+|)$/.test(node.nodeValue);
-		};
+		if (el) {
+			el.style.display = 'none';
+			this.updateBlocker();
+		}
+	},
 
-		function wrap(node, name, attrs) {
-			var wrapper = dom.create(name, attrs);
+	isVisible : function() {
+		return this.getElement().style.display == 'block';
+	},
 
-			node.parentNode.insertBefore(wrapper, node);
-			wrapper.appendChild(node);
+	getElement : function() {
+		if (!this.element)
+			this.element = this.doc.getElementById(this.id);
 
-			return wrapper;
-		};
+		return this.element;
+	},
 
-		function expandRng(rng, format, remove) {
-			var startContainer = rng.startContainer,
-				startOffset = rng.startOffset,
-				endContainer = rng.endContainer,
-				endOffset = rng.endOffset, sibling, lastIdx;
+	setBlockMode : function(s) {
+		this.blockMode = s;
+	},
 
-			// This function walks up the tree if there is no siblings before/after the node
-			function findParentContainer(container, child_name, sibling_name, root) {
-				var parent, child;
+	updateBlocker : function() {
+		var e, b, x, y, w, h;
 
-				root = root || dom.getRoot();
+		b = this.getBlocker();
+		if (b) {
+			if (this.blockMode) {
+				e = this.getElement();
+				x = this.parseInt(e.style.left);
+				y = this.parseInt(e.style.top);
+				w = this.parseInt(e.offsetWidth);
+				h = this.parseInt(e.offsetHeight);
 
-				for (;;) {
-					// Check if we can move up are we at root level or body level
-					parent = container.parentNode;
+				b.style.left = x + 'px';
+				b.style.top = y + 'px';
+				b.style.width = w + 'px';
+				b.style.height = h + 'px';
+				b.style.display = e.style.display;
+			} else
+				b.style.display = 'none';
+		}
+	},
 
-					// Stop expanding on block elements or root depending on format
-					if (parent == root || (!format[0].block_expand && isBlock(parent)))
-						return container;
+	getBlocker : function() {
+		var d, b;
 
-					for (sibling = parent[child_name]; sibling && sibling != container; sibling = sibling[sibling_name]) {
-						if (sibling.nodeType == 1 && !isBookmarkNode(sibling))
-							return container;
+		if (!this.blockerElement && this.blockMode) {
+			d = this.doc;
+			b = d.getElementById(this.id + "_blocker");
 
-						if (sibling.nodeType == 3 && !isWhiteSpaceNode(sibling))
-							return container;
-					}
+			if (!b) {
+				b = d.createElement("iframe");
 
-					container = container.parentNode;
-				}
-
-				return container;
-			};
-
-			// 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;
+				b.setAttribute('id', this.id + "_blocker");
+				b.style.cssText = 'display: none; position: absolute; left: 0; top: 0';
+				b.src = 'javascript:false;';
+				b.frameBorder = '0';
+				b.scrolling = 'no';
+	
+				d.body.appendChild(b);
 			}
 
-			// 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];
+			this.blockerElement = b;
+		}
 
-				if (endContainer.nodeType == 3)
-					endOffset = endContainer.nodeValue.length;
-			}
+		return this.blockerElement;
+	},
 
-			// Exclude bookmark nodes if possible
-			if (isBookmarkNode(startContainer.parentNode))
-				startContainer = startContainer.parentNode;
+	getAbsPosition : function(n) {
+		var p = {absLeft : 0, absTop : 0};
 
-			if (isBookmarkNode(startContainer))
-				startContainer = startContainer.nextSibling || startContainer;
-
-			if (isBookmarkNode(endContainer.parentNode))
-				endContainer = endContainer.parentNode;
-
-			if (isBookmarkNode(endContainer))
-				endContainer = endContainer.previousSibling || endContainer;
-
-			// 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) {
-				startContainer = findParentContainer(startContainer, 'firstChild', 'nextSibling');
-				endContainer = findParentContainer(endContainer, 'lastChild', 'previousSibling');
-			}
-
-			// Expand start/end container to matching selector
-			if (format[0].selector && format[0].expand !== FALSE && !format[0].inline) {
-				function findSelectorEndPoint(container, sibling_name) {
-					var parents, i, y;
-
-					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++) {
-							if (dom.is(parents[i], format[y].selector))
-								return parents[i];
-						}
-					}
-
-					return container;
-				};
-
-				// 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) {
-				function findBlockEndPoint(container, sibling_name, sibling_name2) {
-					var node;
-
-					// Expand to block of similar type
-					if (!format[0].wrapper)
-						node = dom.getParent(container, format[0].block);
-
-					// Expand to first wrappable block element or any block element
-					if (!node)
-						node = dom.getParent(container.nodeType == 3 ? container.parentNode : container, isBlock);
-
-					// 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;
-				};
-
-				// 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(startContainer, 'firstChild', 'nextSibling');
-
-					if (!isBlock(endContainer))
-						endContainer = findParentContainer(endContainer, 'lastChild', 'previousSibling');
-				}
-			}
-
-			// 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
-			};
+		while (n) {
+			p.absLeft += n.offsetLeft;
+			p.absTop += n.offsetTop;
+			n = n.offsetParent;
 		}
 
-		function removeFormat(format, vars, node, compare_node) {
-			var i, attrs, stylesModified;
+		return p;
+	},
 
-			// Check if node matches format
-			if (!matchName(node, format))
-				return FALSE;
+	create : function(n, c, p, h) {
+		var d = this.doc, e = d.createElement(n);
 
-			// Should we compare with format attribs and styles
-			if (format.remove != 'all') {
-				// Remove styles
-				each(format.styles, function(value, name) {
-					value = replaceVars(value, vars);
+		e.setAttribute('id', this.id);
 
-					// Indexed array
-					if (typeof(name) === 'number') {
-						name = value;
-						compare_node = 0;
-					}
+		if (c)
+			e.className = c;
 
-					if (!compare_node || isEq(getStyle(compare_node, name), value))
-						dom.setStyle(node, name, '');
+		if (!p)
+			p = d.body;
 
-					stylesModified = 1;
-				});
+		if (h)
+			e.innerHTML = h;
 
-				// Remove style attribute if it's empty
-				if (stylesModified && dom.getAttrib(node, 'style') == '') {
-					node.removeAttribute('style');
-					node.removeAttribute('_mce_style');
-				}
+		p.appendChild(e);
 
-				// Remove attributes
-				each(format.attributes, function(value, name) {
-					var valueOut;
+		return this.element = e;
+	},
 
-					value = replaceVars(value, vars);
+	exists : function() {
+		return this.doc.getElementById(this.id) != null;
+	},
 
-					// Indexed array
-					if (typeof(name) === 'number') {
-						name = value;
-						compare_node = 0;
-					}
+	parseInt : function(s) {
+		if (s == null || s == '')
+			return 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;
-								});
+		return parseInt(s);
+	},
 
-								// We got some internal classes left
-								if (valueOut) {
-									dom.setAttrib(node, name, valueOut);
-									return;
-								}
-							}
-						}
+	remove : function() {
+		var e = this.getElement(), b = this.getBlocker();
 
-						// IE6 has a bug where the attribute doesn't get removed correctly
-						if (name == "class")
-							node.removeAttribute('className');
+		if (e)
+			e.parentNode.removeChild(e);
 
-						// Remove mce prefixed attributes
-						if (MCE_ATTR_RE.test(name))
-							node.removeAttribute('_mce_' + name);
+		if (b)
+			b.parentNode.removeChild(b);
+	}
 
-						node.removeAttribute(name);
-					}
-				});
+	};
 
-				// Remove classes
-				each(format.classes, function(value) {
-					value = replaceVars(value, vars);
+/* file:jscripts/tiny_mce/classes/TinyMCE_Menu.class.js */
 
-					if (!compare_node || dom.hasClass(compare_node, value))
-						dom.removeClass(node, value);
-				});
+function TinyMCE_Menu() {
+	var id;
 
-				// Check for non internal attributes
-				attrs = dom.getAttribs(node);
-				for (i = 0; i < attrs.length; i++) {
-					if (attrs[i].nodeName.indexOf('_') !== 0)
-						return FALSE;
-				}
-			}
+	if (typeof(tinyMCE.menuCounter) == "undefined")
+		tinyMCE.menuCounter = 0;
 
-			// Remove the inline child if it's empty for example <b> or <span>
-			if (format.remove != 'none') {
-				removeNode(node, format);
-				return TRUE;
-			}
-		};
+	id = "mc_menu_" + tinyMCE.menuCounter++;
 
-		function removeNode(node, format) {
-			var parentNode = node.parentNode, rootBlockElm;
+	TinyMCE_Layer.call(this, id, true);
 
-			if (format.block) {
-				if (!forcedRootBlock) {
-					function find(node, next, inc) {
-						node = getNonWhiteSpaceSibling(node, next, inc);
+	this.id = id;
+	this.items = [];
+	this.needsUpdate = true;
+};
 
-						return !node || (node.nodeName == 'BR' || isBlock(node));
-					};
+TinyMCE_Menu.prototype = tinyMCE.extend(TinyMCE_Layer.prototype, {
+	init : function(s) {
+		var n;
 
-					// 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(tinymce.grep(node.childNodes), function(node) {
-								if (isValid(forcedRootBlock, node.nodeName.toLowerCase())) {
-									if (!rootBlockElm)
-										rootBlockElm = wrap(node, forcedRootBlock);
-									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);
+		// Default params
+		this.settings = {
+			separator_class : 'mceMenuSeparator',
+			title_class : 'mceMenuTitle',
+			disabled_class : 'mceMenuDisabled',
+			menu_class : 'mceMenu',
+			drop_menu : true
 		};
 
-		function getNonWhiteSpaceSibling(node, next, inc) {
-			if (node) {
-				next = next ? 'nextSibling' : 'previousSibling';
+		for (n in s)
+			this.settings[n] = s[n];
 
-				for (node = inc ? node : node[next]; node; node = node[next]) {
-					if (node.nodeType == 1 || !isWhiteSpaceNode(node))
-						return node;
-				}
-			}
-		};
+		this.create('div', this.settings.menu_class);
+	},
 
-		function isBookmarkNode(node) {
-			return node && node.nodeType == 1 && node.getAttribute('_mce_type') == 'bookmark';
-		};
+	clear : function() {
+		this.items = [];
+	},
 
-		function mergeSiblings(prev, next) {
-			var marker, sibling, tmpSibling;
+	addTitle : function(t) {
+		this.add({type : 'title', text : t});
+	},
 
-			function compareElements(node1, node2) {
-				// Not the same name
-				if (node1.nodeName != node2.nodeName)
-					return FALSE;
+	addDisabled : function(t) {
+		this.add({type : 'disabled', text : t});
+	},
 
-				function getAttribs(node) {
-					var attribs = {};
+	addSeparator : function() {
+		this.add({type : 'separator'});
+	},
 
-					each(dom.getAttribs(node), function(attr) {
-						var name = attr.nodeName.toLowerCase();
+	addItem : function(t, js) {
+		this.add({text : t, js : js});
+	},
 
-						// Don't compare internal attributes or style
-						if (name.indexOf('_') !== 0 && name !== 'style')
-							attribs[name] = dom.getAttrib(node, name);
-					});
+	add : function(mi) {
+		this.items[this.items.length] = mi;
+		this.needsUpdate = true;
+	},
 
-					return attribs;
-				};
+	update : function() {
+		var e = this.getElement(), h = '', i, t, m = this.items, s = this.settings;
 
-				function compareObjects(obj1, obj2) {
-					var value, name;
+		if (this.settings.drop_menu)
+			h += '<span class="mceMenuLine"></span>';
 
-					for (name in obj1) {
-						// Obj1 has item obj2 doesn't have
-						if (obj1.hasOwnProperty(name)) {
-							value = obj2[name];
+		h += '<table border="0" cellpadding="0" cellspacing="0">';
 
-							// Obj2 doesn't have obj1 item
-							if (value === undefined)
-								return FALSE;
+		for (i=0; i<m.length; i++) {
+			t = tinyMCE.xmlEncode(m[i].text);
+			c = m[i].class_name ? ' class="' + m[i].class_name + '"' : '';
 
-							// Obj2 item has a different value
-							if (obj1[name] != value)
-								return FALSE;
+			switch (m[i].type) {
+				case 'separator':
+					h += '<tr class="' + s.separator_class + '"><td>';
+					break;
 
-							// Delete similar value
-							delete obj2[name];
-						}
-					}
+				case 'title':
+					h += '<tr class="' + s.title_class + '"><td><span' + c +'>' + t + '</span>';
+					break;
 
-					// 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;
-					}
+				case 'disabled':
+					h += '<tr class="' + s.disabled_class + '"><td><span' + c +'>' + t + '</span>';
+					break;
 
-					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 TRUE;
-			};
-
-			// Check if next/prev exists and that they are elements
-			if (prev && next) {
-				function findElementSibling(node, sibling_name) {
-					for (sibling = node; sibling; sibling = sibling[sibling_name]) {
-						if (sibling.nodeType == 3 && !isWhiteSpaceNode(sibling))
-							return node;
-
-						if (sibling.nodeType == 1 && !isBookmarkNode(sibling))
-							return sibling;
-					}
-
-					return node;
-				};
-
-				// If previous sibling is empty then jump over it
-				prev = findElementSibling(prev, 'previousSibling');
-				next = findElementSibling(next, 'nextSibling');
-
-				// Compare next and previous nodes
-				if (compareElements(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(tinymce.grep(next.childNodes), function(node) {
-						prev.appendChild(node);
-					});
-
-					return prev;
-				}
+				default:
+					h += '<tr><td><a href="' + tinyMCE.xmlEncode(m[i].js) + '" onmousedown="' + tinyMCE.xmlEncode(m[i].js) + ';return tinyMCE.cancelEvent(event);" onclick="return tinyMCE.cancelEvent(event);" onmouseup="return tinyMCE.cancelEvent(event);"><span' + c +'>' + t + '</span></a>';
 			}
 
-			return next;
-		};
+			h += '</td></tr>';
+		}
 
-		function isTextBlock(name) {
-			return /^(h[1-6]|p|div|pre|address|dl|dt|dd)$/.test(name);
-		};
+		h += '</table>';
 
-		function getContainer(rng, start) {
-			var container, offset, lastIdx;
+		e.innerHTML = h;
 
-			container = rng[start ? 'startContainer' : 'endContainer'];
-			offset = rng[start ? 'startOffset' : 'endOffset'];
+		this.needsUpdate = false;
+		this.updateBlocker();
+	},
 
-			if (container.nodeType == 1) {
-				lastIdx = container.childNodes.length - 1;
+	show : function() {
+		var nl, i;
 
-				if (!start && offset)
-					offset--;
+		if (tinyMCE.lastMenu == this)
+			return;
 
-				container = container.childNodes[offset > lastIdx ? lastIdx : offset];
-			}
+		if (this.needsUpdate)
+			this.update();
 
-			return container;
-		};
+		if (tinyMCE.lastMenu && tinyMCE.lastMenu != this)
+			tinyMCE.lastMenu.hide();
 
-		function performCaretAction(type, name, vars) {
-			var i, currentPendingFormats = pendingFormats[type],
-				otherPendingFormats = pendingFormats[type == 'apply' ? 'remove' : 'apply'];
+		TinyMCE_Layer.prototype.show.call(this);
 
-			function hasPending() {
-				return pendingFormats.apply.length || pendingFormats.remove.length;
-			};
+		if (!tinyMCE.isOpera) {
+			// Accessibility stuff
+/*			nl = this.getElement().getElementsByTagName("a");
+			if (nl.length > 0)
+				nl[0].focus();*/
+		}
 
-			function resetPending() {
-				pendingFormats.apply = [];
-				pendingFormats.remove = [];
-			};
+		tinyMCE.lastMenu = this;
+	}
 
-			function perform(caret_node) {
-				// Apply pending formats
-				each(pendingFormats.apply.reverse(), function(item) {
-					apply(item.name, item.vars, caret_node);
-				});
+	});
 
-				// Remove pending formats
-				each(pendingFormats.remove.reverse(), function(item) {
-					remove(item.name, item.vars, caret_node);
-				});
+/* file:jscripts/tiny_mce/classes/TinyMCE_Debug.class.js */
 
-				dom.remove(caret_node, 1);
-				resetPending();
-			};
+tinyMCE.add(TinyMCE_Engine, {
+	debug : function() {
+		var m = "", a, i, l = tinyMCE.log.length;
 
-			// Check if it already exists then ignore it
-			for (i = currentPendingFormats.length - 1; i >= 0; i--) {
-				if (currentPendingFormats[i].name == name)
-					return;
-			}
+		for (i=0, a = this.debug.arguments; i<a.length; i++) {
+			m += a[i];
 
-			currentPendingFormats.push({name : name, vars : vars});
+			if (i<a.length-1)
+				m += ', ';
+		}
 
-			// Check if it's in the other type, then remove it
-			for (i = otherPendingFormats.length - 1; i >= 0; i--) {
-				if (otherPendingFormats[i].name == name)
-					otherPendingFormats.splice(i, 1);
-			}
-
-			// Pending apply or remove formats
-			if (hasPending()) {
-				ed.getDoc().execCommand('FontName', false, 'mceinline');
-				pendingFormats.lastRng = selection.getRng();
-
-				// IE will convert the current word
-				each(dom.select('font,span'), function(node) {
-					var bookmark;
-
-					if (isCaretNode(node)) {
-						bookmark = selection.getBookmark();
-						perform(node);
-						selection.moveToBookmark(bookmark);
-						ed.nodeChanged();
-					}
-				});
-
-				// Only register listeners once if we need to
-				if (!pendingFormats.isListening && hasPending()) {
-					pendingFormats.isListening = true;
-
-					each('onKeyDown,onKeyUp,onKeyPress,onMouseUp'.split(','), function(event) {
-						ed[event].addToTop(function(ed, e) {
-							// Do we have pending formats and is the selection moved has moved
-							if (hasPending() && !tinymce.dom.RangeUtils.compareRanges(pendingFormats.lastRng, selection.getRng())) {
-								each(dom.select('font,span'), function(node) {
-									var textNode, rng;
-
-									// Look for marker
-									if (isCaretNode(node)) {
-										textNode = node.firstChild;
-
-										if (textNode) {
-											perform(node);
-
-											rng = dom.createRng();
-											rng.setStart(textNode, textNode.nodeValue.length);
-											rng.setEnd(textNode, textNode.nodeValue.length);
-											selection.setRng(rng);
-											ed.nodeChanged();
-										} else
-											dom.remove(node);
-									}
-								});
-
-								// Always unbind and clear pending styles on keyup
-								if (e.type == 'keyup' || e.type == 'mouseup')
-									resetPending();
-							}
-						});
-					});
-				}
-			}
-		};
-	};
-})(tinymce);
-
-tinymce.onAddEditor.add(function(tinymce, ed) {
-	var filters, fontSizes, dom, settings = ed.settings;
-
-	if (settings.inline_styles) {
-		fontSizes = tinymce.explode(settings.font_size_style_values);
-
-		function replaceWithSpan(node, styles) {
-			tinymce.each(styles, function(value, name) {
-				if (value)
-					dom.setStyle(node, name, value);
-			});
-
-			dom.rename(node, 'span');
-		};
-
-		filters = {
-			font : function(dom, node) {
-				replaceWithSpan(node, {
-					backgroundColor : node.style.backgroundColor,
-					color : node.color,
-					fontFamily : node.face,
-					fontSize : fontSizes[parseInt(node.size) - 1]
-				});
-			},
-
-			u : function(dom, node) {
-				replaceWithSpan(node, {
-					textDecoration : 'underline'
-				});
-			},
-
-			strike : function(dom, node) {
-				replaceWithSpan(node, {
-					textDecoration : 'line-through'
-				});
-			}
-		};
-
-		function convert(editor, params) {
-			dom = editor.dom;
-
-			if (settings.convert_fonts_to_spans) {
-				tinymce.each(dom.select('font,u,strike', params.node), function(node) {
-					filters[node.nodeName.toLowerCase()](ed.dom, node);
-				});
-			}
-		};
-
-		ed.onPreProcess.add(convert);
-
-		ed.onInit.add(function() {
-			ed.selection.onSetContent.add(convert);
-		});
+		if (l < 1000)
+			tinyMCE.log[l] = "[debug] " + m;
 	}
-});
 
+	});
+

Modified: plog/trunk/js/tinymce/utils/editable_selects.js
===================================================================
--- plog/trunk/js/tinymce/utils/editable_selects.js	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/js/tinymce/utils/editable_selects.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,11 +1,10 @@
 /**
- * editable_selects.js
+ * $Id: editable_selects.js 162 2007-01-03 16:16:52Z spocke $
  *
- * Copyright 2009, Moxiecode Systems AB
- * Released under LGPL License.
+ * Makes select boxes editable.
  *
- * License: http://tinymce.moxiecode.com/license
- * Contributing: http://tinymce.moxiecode.com/contributing
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
  */
 
 var TinyMCE_EditableSelects = {
@@ -21,13 +20,13 @@
 				o.className = 'mceAddSelectValue';
 
 				nl[i].options[nl[i].options.length] = o;
-				nl[i].onchange = TinyMCE_EditableSelects.onChangeEditableSelect;
+				nl[i].setAttribute('onchange', 'TinyMCE_EditableSelects.onChangeEditableSelect(this);');
 			}
 		}
 	},
 
-	onChangeEditableSelect : function(e) {
-		var d = document, ne, se = window.event ? window.event.srcElement : e.target;
+	onChangeEditableSelect : function(se) {
+		var d = document, ne;
 
 		if (se.options[se.selectedIndex].value == '__mce_add_custom__') {
 			ne = d.createElement("input");
@@ -35,12 +34,11 @@
 			ne.name = se.name + "_custom";
 			ne.type = "text";
 
-			ne.style.width = se.offsetWidth + 'px';
+			ne.style.width = se.clientWidth;
 			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;
 		}
 	},
@@ -59,12 +57,5 @@
 			se.parentNode.removeChild(se.previousSibling);
 			TinyMCE_EditableSelects.editSelectElm = null;
 		}
-	},
-
-	onKeyDown : function(e) {
-		e = e || window.event;
-
-		if (e.keyCode == 13)
-			TinyMCE_EditableSelects.onBlurEditableSelectInput();
 	}
 };

Modified: plog/trunk/js/tinymce/utils/form_utils.js
===================================================================
--- plog/trunk/js/tinymce/utils/form_utils.js	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/js/tinymce/utils/form_utils.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,24 +1,33 @@
 /**
- * form_utils.js
+ * $Id: form_utils.js 162 2007-01-03 16:16:52Z spocke $
  *
- * Copyright 2009, Moxiecode Systems AB
- * Released under LGPL License.
+ * Various form utilitiy functions.
  *
- * License: http://tinymce.moxiecode.com/license
- * Contributing: http://tinymce.moxiecode.com/contributing
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
  */
 
-var themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme"));
+var themeBaseURL = tinyMCE.baseURL + '/themes/' + tinyMCE.getParam("theme");
 
 function getColorPickerHTML(id, target_form_element) {
 	var h = "";
 
-	h += '<a 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') + '"> </span></a>';
+	h += '<a id="' + id + '_link" href="javascript:void(0);" onkeydown="pickColor(event,\'' + target_form_element +'\');" onmousedown="pickColor(event,\'' + target_form_element +'\');return false;">';
+	h += '<img id="' + id + '" src="' + themeBaseURL + '/images/color.gif"';
+	h += ' onmouseover="this.className=\'mceButtonOver\'"';
+	h += ' onmouseout="this.className=\'mceButtonNormal\'"';
+	h += ' onmousedown="this.className=\'mceButtonDown\'"';
+	h += ' width="20" height="16" border="0" title="' + tinyMCE.getLang('lang_browse') + '"';
+	h += ' class="mceButtonNormal" alt="' + tinyMCE.getLang('lang_browse') + '" /></a>';
 
 	return h;
 }
 
+function pickColor(e, target_form_element) {
+	if ((e.keyCode == 32 || e.keyCode == 13) || e.type == "mousedown")
+		tinyMCEPopup.pickColor(e, target_form_element);
+}
+
 function updateColor(img_id, form_element_id) {
 	document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value;
 }
@@ -31,32 +40,34 @@
 		if (state) {
 			lnk.setAttribute("realhref", lnk.getAttribute("href"));
 			lnk.removeAttribute("href");
-			tinyMCEPopup.dom.addClass(img, 'disabled');
+			tinyMCE.switchClass(img, 'mceButtonDisabled', true);
 		} else {
-			if (lnk.getAttribute("realhref"))
-				lnk.setAttribute("href", lnk.getAttribute("realhref"));
-
-			tinyMCEPopup.dom.removeClass(img, 'disabled');
+			lnk.setAttribute("href", lnk.getAttribute("realhref"));
+			tinyMCE.switchClass(img, 'mceButtonNormal', false);
 		}
 	}
 }
 
 function getBrowserHTML(id, target_form_element, type, prefix) {
-	var option = prefix + "_" + type + "_browser_callback", cb, html;
+	var option = prefix + "_" + type + "_browser_callback";
+	var cb = tinyMCE.getParam(option, tinyMCE.getParam("file_browser_callback"));
+	if (cb == null)
+		return "";
 
-	cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback"));
+	var html = "";
 
-	if (!cb)
-		return "";
+	html += '<a id="' + id + '_link" href="javascript:openBrower(\'' + id + '\',\'' + target_form_element + '\', \'' + type + '\',\'' + option + '\');" onmousedown="return false;">';
+	html += '<img id="' + id + '" src="' + themeBaseURL + '/images/browse.gif"';
+	html += ' onmouseover="this.className=\'mceButtonOver\';"';
+	html += ' onmouseout="this.className=\'mceButtonNormal\';"';
+	html += ' onmousedown="this.className=\'mceButtonDown\';"';
+	html += ' width="20" height="18" border="0" title="' + tinyMCE.getLang('lang_browse') + '"';
+	html += ' class="mceButtonNormal" alt="' + tinyMCE.getLang('lang_browse') + '" /></a>';
 
-	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') + '"> </span></a>';
-
 	return html;
 }
 
-function openBrowser(img_id, target_form_element, type, option) {
+function openBrower(img_id, target_form_element, type, option) {
 	var img = document.getElementById(img_id);
 
 	if (img.className != "mceButtonDisabled")
@@ -93,7 +104,7 @@
 function getSelectValue(form_obj, field_name) {
 	var elm = form_obj.elements[field_name];
 
-	if (elm == null || elm.options == null || elm.selectedIndex === -1)
+	if (elm == null || elm.options == null)
 		return "";
 
 	return elm.options[elm.selectedIndex].value;
@@ -108,8 +119,8 @@
 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);
+	var styles = tinyMCE.getParam('theme_advanced_styles', false);
+	styles = tinyMCE.getParam(specific_option, styles);
 
 	if (styles) {
 		var stylesAr = styles.split(';');
@@ -125,9 +136,10 @@
 			}
 		}
 	} else {
-		tinymce.each(tinyMCEPopup.editor.dom.getClasses(), function(o) {
-			styleSelectElm.options[styleSelectElm.length] = new Option(o.title || o['class'], o['class']);
-		});
+		// Use auto impored classes
+		var csses = tinyMCE.getCSSClasses(tinyMCE.getWindowArg('editor_id'));
+		for (var i=0; i<csses.length; i++)
+			styleSelectElm.options[styleSelectElm.length] = new Option(csses[i], csses[i]);
 	}
 }
 
@@ -171,7 +183,7 @@
 }
 
 function trimSize(size) {
-	return size.replace(/([0-9\.]+)px|(%|in|cm|mm|em|ex|pt|pc)/, '$1$2');
+	return size.replace(new RegExp('[^0-9%]', 'gi'), '');
 }
 
 function getCSSSize(size) {
@@ -180,15 +192,11 @@
 	if (size == "")
 		return "";
 
-	// Add px
-	if (/^[0-9]+$/.test(size))
-		size += 'px';
-
-	return size;
+	return size.indexOf('%') != -1 ? size : size + "px";
 }
 
 function getStyle(elm, attrib, style) {
-	var val = tinyMCEPopup.dom.getAttrib(elm, attrib);
+	var val = tinyMCE.getAttrib(elm, attrib);
 
 	if (val != '')
 		return '' + val;
@@ -196,5 +204,7 @@
 	if (typeof(style) == 'undefined')
 		style = attrib;
 
-	return tinyMCEPopup.dom.getStyle(elm, style);
+	val = eval('elm.style.' + style);
+
+	return val == null ? '' : '' + val;
 }

Copied: plog/trunk/js/tinymce/utils/mclayer.js (from rev 7165, plog/trunk/js/tinymce/utils/mclayer.js)
===================================================================
--- plog/trunk/js/tinymce/utils/mclayer.js	                        (rev 0)
+++ plog/trunk/js/tinymce/utils/mclayer.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -0,0 +1,210 @@
+/**
+ * $Id: mclayer.js 162 2007-01-03 16:16:52Z spocke $
+ *
+ * Moxiecode floating layer script.
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
+ */
+
+function MCLayer(id) {
+	this.id = id;
+	this.settings = new Array();
+	this.blockerElement = null;
+	this.isMSIE = navigator.appName == "Microsoft Internet Explorer";
+	this.events = false;
+	this.autoHideCallback = null;
+}
+
+MCLayer.prototype = {
+	moveRelativeTo : function(re, p, a) {
+		var rep = this.getAbsPosition(re);
+		var w = parseInt(re.offsetWidth);
+		var h = parseInt(re.offsetHeight);
+		var x, y;
+
+		switch (p) {
+			case "tl":
+				break;
+
+			case "tr":
+				x = rep.absLeft + w;
+				y = rep.absTop;
+				break;
+
+			case "bl":
+				break;
+
+			case "br":
+				break;
+		}
+
+		this.moveTo(x, y);
+	},
+
+	moveBy : function(dx, dy) {
+		var e = this.getElement();
+		var x = parseInt(e.style.left);
+		var y = parseInt(e.style.top);
+
+		e.style.left = (x + dx) + "px";
+		e.style.top = (y + dy) + "px";
+
+		this.updateBlocker();
+	},
+
+	moveTo : function(x, y) {
+		var e = this.getElement();
+
+		e.style.left = x + "px";
+		e.style.top = y + "px";
+
+		this.updateBlocker();
+	},
+
+	show : function() {
+		MCLayer.visibleLayer = this;
+
+		this.getElement().style.display = 'block';
+		this.updateBlocker();
+	},
+
+	hide : function() {
+		this.getElement().style.display = 'none';
+		this.updateBlocker();
+	},
+
+	setAutoHide : function(s, cb) {
+		this.autoHideCallback = cb;
+		this.registerEventHandlers();
+	},
+
+	getElement : function() {
+		return document.getElementById(this.id);
+	},
+
+	updateBlocker : function() {
+		if (!this.isMSIE)
+			return;
+
+		var e = this.getElement();
+		var b = this.getBlocker();
+		var x = this.parseInt(e.style.left);
+		var y = this.parseInt(e.style.top);
+		var w = this.parseInt(e.offsetWidth);
+		var h = this.parseInt(e.offsetHeight);
+
+		b.style.left = x + 'px';
+		b.style.top = y + 'px';
+		b.style.width = w + 'px';
+		b.style.height = h + 'px';
+		b.style.display = e.style.display;
+	},
+
+	getBlocker : function() {
+		if (!this.blockerElement) {
+			var d = document, b = d.createElement("iframe");
+
+			b.style.cssText = 'display: none; left: 0px; position: absolute; top: 0';
+			b.src = 'javascript:false;';
+			b.frameBorder = '0';
+			b.scrolling = 'no';
+
+			d.body.appendChild(b);
+			this.blockerElement = b;
+		}
+
+		return this.blockerElement;
+	},
+
+	getAbsPosition : function(n) {
+		var p = {absLeft : 0, absTop : 0};
+
+		while (n) {
+			p.absLeft += n.offsetLeft;
+			p.absTop += n.offsetTop;
+			n = n.offsetParent;
+		}
+
+		return p;
+	},
+
+	registerEventHandlers : function() {
+		if (!this.events) {
+			var d = document;
+
+			this.addEvent(d, 'mousedown', MCLayer.prototype.onMouseDown);
+
+			this.events = true;
+		}
+	},
+
+	addEvent : function(o, n, h) {
+		if (o.attachEvent)
+			o.attachEvent("on" + n, h);
+		else
+			o.addEventListener(n, h, false);
+	},
+
+	onMouseDown : function(e) {
+		e = typeof(e) == "undefined" ? window.event : e;
+		var b = document.body;
+		var l = MCLayer.visibleLayer;
+
+		if (l) {
+			var mx = l.isMSIE ? e.clientX + b.scrollLeft : e.pageX;
+			var my = l.isMSIE ? e.clientY + b.scrollTop : e.pageY;
+			var el = l.getElement();
+			var x = parseInt(el.style.left);
+			var y = parseInt(el.style.top);
+			var w = parseInt(el.offsetWidth);
+			var h = parseInt(el.offsetHeight);
+
+			if (!(mx > x && mx < x + w && my > y && my < y + h)) {
+				MCLayer.visibleLayer = null;
+
+				if (l.autoHideCallback && l.autoHideCallback(l, e, mx, my))
+					return true;
+
+				l.hide();
+			}
+		}
+	},
+
+	addCSSClass : function(e, c) {
+		this.removeCSSClass(e, c);
+		var a = this.explode(' ', e.className);
+		a[a.length] = c;
+		e.className = a.join(' ');
+	},
+
+	removeCSSClass : function(e, c) {
+		var a = this.explode(' ', e.className), i;
+
+		for (i=0; i<a.length; i++) {
+			if (a[i] == c)
+				a[i] = '';
+		}
+
+		e.className = a.join(' ');
+	},
+
+	explode : function(d, s) {
+		var ar = s.split(d);
+		var oar = new Array();
+
+		for (var i = 0; i<ar.length; i++) {
+			if (ar[i] != "")
+				oar[oar.length] = ar[i];
+		}
+
+		return oar;
+	},
+
+	parseInt : function(s) {
+		if (s == null || s == '')
+			return 0;
+
+		return parseInt(s);
+	}
+}

Modified: plog/trunk/js/tinymce/utils/mctabs.js
===================================================================
--- plog/trunk/js/tinymce/utils/mctabs.js	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/js/tinymce/utils/mctabs.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,15 +1,14 @@
 /**
- * mctabs.js
+ * $Id: mctabs.js 162 2007-01-03 16:16:52Z spocke $
  *
- * Copyright 2009, Moxiecode Systems AB
- * Released under LGPL License.
+ * Moxiecode DHTML Tabs script.
  *
- * License: http://tinymce.moxiecode.com/license
- * Contributing: http://tinymce.moxiecode.com/contributing
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
  */
 
 function MCTabs() {
-	this.settings = [];
+	this.settings = new Array();
 };
 
 MCTabs.prototype.init = function(settings) {
@@ -29,19 +28,17 @@
 };
 
 MCTabs.prototype.displayTab = function(tab_id, panel_id) {
-	var panelElm, panelContainerElm, tabElm, tabContainerElm, selectionClass, nodes, i;
+	var panelElm = document.getElementById(panel_id);
+	var panelContainerElm = panelElm ? panelElm.parentNode : null;
+	var tabElm = document.getElementById(tab_id);
+	var tabContainerElm = tabElm ? tabElm.parentNode : null;
+	var selectionClass = this.getParam('selection_class', 'current');
 
-	panelElm= document.getElementById(panel_id);
-	panelContainerElm = panelElm ? panelElm.parentNode : null;
-	tabElm = document.getElementById(tab_id);
-	tabContainerElm = tabElm ? tabElm.parentNode : null;
-	selectionClass = this.getParam('selection_class', 'current');
-
 	if (tabElm && tabContainerElm) {
-		nodes = tabContainerElm.childNodes;
+		var nodes = tabContainerElm.childNodes;
 
 		// Hide all other tabs
-		for (i = 0; i < nodes.length; i++) {
+		for (var i=0; i<nodes.length; i++) {
 			if (nodes[i].nodeName == "LI")
 				nodes[i].className = '';
 		}
@@ -51,10 +48,10 @@
 	}
 
 	if (panelElm && panelContainerElm) {
-		nodes = panelContainerElm.childNodes;
+		var nodes = panelContainerElm.childNodes;
 
 		// Hide all other panels
-		for (i = 0; i < nodes.length; i++) {
+		for (var i=0; i<nodes.length; i++) {
 			if (nodes[i].nodeName == "DIV")
 				nodes[i].className = 'panel';
 		}

Modified: plog/trunk/js/tinymce/utils/validate.js
===================================================================
--- plog/trunk/js/tinymce/utils/validate.js	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/js/tinymce/utils/validate.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,11 +1,10 @@
 /**
- * validate.js
+ * $Id: validate.js 162 2007-01-03 16:16:52Z spocke $
  *
- * Copyright 2009, Moxiecode Systems AB
- * Released under LGPL License.
+ * Various form validation methods.
  *
- * License: http://tinymce.moxiecode.com/license
- * Contributing: http://tinymce.moxiecode.com/contributing
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
  */
 
 /**
@@ -32,7 +31,7 @@
 	},
 
 	isSize : function(s) {
-		return this.test(s, '^[0-9]+(%|in|cm|mm|em|ex|pt|pc|px)?$');
+		return this.test(s, '^[0-9]+(px|%)?$');
 	},
 
 	isId : function(s) {
@@ -111,7 +110,7 @@
 	},
 
 	reset : function(e) {
-		var t = ['label', 'input', 'select', 'textarea'];
+		var t = new Array('label', 'input', 'select', 'textarea');
 		var i, j, nl, s = this.settings;
 
 		if (e == null)

Modified: plog/trunk/js/ui/plogui.js
===================================================================
--- plog/trunk/js/ui/plogui.js	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/js/ui/plogui.js	2012-02-21 14:33:00 UTC (rev 7170)
@@ -4,4 +4,4 @@
    button.style.display = "none";     
    bar = document.getElementById("status_bar");
    bar.style.display = "block";
-}
\ No newline at end of file
+}

Modified: plog/trunk/templates/.htaccess
===================================================================
--- plog/trunk/templates/.htaccess	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/templates/.htaccess	2012-02-21 14:33:00 UTC (rev 7170)
@@ -3,10 +3,4 @@
 #
 # <Files *.template> 
 # deny from all 
-# </Files>
-
-#<IfModule mod_expires.c>
-#  ExpiresActive On
-#  ExpiresDefault "access plus 2 days"
-#  ExpiresByType image/* "access plus 1 month"
-#</IfModule>
\ No newline at end of file
+# </Files>
\ No newline at end of file

Modified: plog/trunk/templates/admin/cleanup.template
===================================================================
--- plog/trunk/templates/admin/cleanup.template	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/templates/admin/cleanup.template	2012-02-21 14:33:00 UTC (rev 7170)
@@ -47,6 +47,7 @@
 {include file="$admintemplatepath/footer.template"}
 {if $continue}
 <script type="text/javascript">
-  setTimeout( function() {literal}{{/literal} window.location = "{$dest}".replace(/\&/g,'&'); {literal}}{/literal}, 750 ); 
+  //window.location = "{$dest}";
+  setTimeout( function() {literal}{{/literal} window.location = "{$dest}" {literal}}{/literal}, 750 ); 
 </script>
-{/if}
+{/if}
\ No newline at end of file

Modified: plog/trunk/templates/admin/dashboard.template
===================================================================
--- plog/trunk/templates/admin/dashboard.template	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/templates/admin/dashboard.template	2012-02-21 14:33:00 UTC (rev 7170)
@@ -101,12 +101,11 @@
                                 <div class="list_action_button">
                                 <a href="?op=blogSelect&blogId={$blog->getId()}&action=deleteComment&commentId={$comment->getId()}&articleId={$article->getId()}"><img src="imgs/admin/icon_delete-16.png" alt="{$locale->tr("delete")}" /></a>
 								{if $bayesian_filter_enabled}
-                                {if $comment->getStatus() != 1}
+                                {if $comment->getStatus() == 0}
                                     <a href="?op=blogSelect&blogId={$blog->getId()}&action=markComment&mode=1&articleId={$comment->getArticleId()}&commentId={$comment->getId()}">
                                      <img src="imgs/admin/icon_spam-16.png" alt="{$locale->tr("mark_as_spam")}" />
                                     </a>
-                                {/if}
-                                {if $comment->getStatus() != 0}
+                                {elseif $comment->getStatus() == 1}
                                     <a href="?op=blogSelect&blogId={$blog->getId()}&action=markComment&mode=0&articleId={$comment->getArticleId()}&commentId={$comment->getId()}">
                                      <img src="imgs/admin/icon_nospam-16.png" alt="{$locale->tr("mark_as_no_spam")}" />
                                     </a>

Modified: plog/trunk/templates/admin/editpost.template
===================================================================
--- plog/trunk/templates/admin/editpost.template	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/templates/admin/editpost.template	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,5 +1,3 @@
-{assign var=editor value=1}
-{assign var=htmlarea value=$blogsettings->getValue("htmlarea_enabled")}
 {include file="$admintemplatepath/header.template"}
 {include file="$admintemplatepath/navigation.template" showOpt=editPosts title=$locale->tr("editPost")}
 {if $location_data_enabled}
@@ -13,6 +11,13 @@
 <script type="text/javascript" src="js/jscalendar/lang/calendar-en.js"></script>
 <script type="text/javascript" src="js/jscalendar/calendar-setup_stripped.js"></script>
 {js src="js/ui/pages/posts.js"}
+{assign var=htmlarea value=$blogsettings->getValue("htmlarea_enabled")}
+ {if $htmlarea}
+  <script type="text/javascript" src="js/tinymce/tiny_mce_gzip.php"></script>
+  <script type="text/javascript" src="js/tinymce/tiny_mce-plog.js"></script>
+ {else}
+  <script type="text/javascript" src="js/editor/lifetypeeditor.js"></script>
+ {/if}
  <script type="text/javascript">
   // this needs to be pre-initialized
   Lifetype.UI.Pages.Posts.preview = false;

Modified: plog/trunk/templates/admin/header.template
===================================================================
--- plog/trunk/templates/admin/header.template	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/templates/admin/header.template	2012-02-21 14:33:00 UTC (rev 7170)
@@ -17,14 +17,6 @@
 <!--[if IE ]>
 <link rel="stylesheet" href="styles/admin-ie.css" type="text/css" media="screen" />
 <![endif] -->
- {if $editor}
-   {if $htmlarea}
-     <script type="text/javascript" src="js/tinymce/tiny_mce_gzip.js"></script>
-     <script type="text/javascript" src="js/tinymce/tiny_mce-plog.js"></script>
-   {else}
-     <script type="text/javascript" src="js/editor/lifetypeeditor.js"></script>
-   {/if}
- {/if}
 <!-- Yahoo UI Library -->
 {js src="js/yui/yahoo/yahoo-min.js"}
 {js src="js/yui/dom/dom-min.js"}

Modified: plog/trunk/templates/admin/newpost.template
===================================================================
--- plog/trunk/templates/admin/newpost.template	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/templates/admin/newpost.template	2012-02-21 14:33:00 UTC (rev 7170)
@@ -1,5 +1,3 @@
-{assign var=editor value=1}
-{assign var=htmlarea value=$blogsettings->getValue("htmlarea_enabled")}
 {include file="$admintemplatepath/header.template"}
 {js src="js/ui/pages/posts.js"}
 {if $location_data_enabled}
@@ -9,11 +7,18 @@
 {js src="js/location/selector.js"}
 {/if}
 {include file="$admintemplatepath/navigation.template" showOpt=newPost title=$locale->tr("newPost")}
+{assign var=htmlarea value=$blogsettings->getValue("htmlarea_enabled")}
  <link rel="stylesheet" type="text/css" media="all" href="js/jscalendar/calendar-win2k-cold-1.css" title="win2k-cold-1" />
  <script type="text/javascript" src="js/jscalendar/calendar_stripped.js"></script>
  <script type="text/javascript" src="js/jscalendar/lang/calendar-en.js"></script>
  <script type="text/javascript" src="js/jscalendar/calendar-setup_stripped.js"></script>
  <script type="text/javascript" src="js/ui/autosave.js"></script>
+ {if $htmlarea}
+  <script type="text/javascript" src="js/tinymce/tiny_mce_gzip.php"></script>
+  <script type="text/javascript" src="js/tinymce/tiny_mce-plog.js"></script>
+ {else}
+  <script type="text/javascript" src="js/editor/lifetypeeditor.js"></script>
+ {/if}
  <script type="text/javascript">
   // this needs to be pre-initialized
   Lifetype.UI.Pages.Posts.preview = false;
@@ -190,7 +195,7 @@
       <div class="field">
        	<br /><label for="bookmarklet">{$locale->tr("bookmarklet")}</label>
        	<div class="formHelp">{$locale->tr("bookmarklet_help")}</div>
-		<a href="javascript:bm=document.selection?document.selection.createRange().text:window.getSelection();void(ltbm=window.open('{$url->getAdminUrl()}?op=newPost&sendTrackbacks=1&postText='+encodeURIComponent('<p>'+bm+' ... '+'<a href="'+window.location.href+'">'+'{$locale->tr("original_post")}'+'</a></p>'),'ltbm','toolbar=1,status=1,location=1,scrollbars=1,menubar=1,resizable=1'))" onclick="window.alert('{$locale->tr("bookmarklet_help")}');">{$locale->tr("blogit_to_lifetype")}</a> 
+		<a href="javascript:bm=document.selection?document.selection.createRange().text:document.getSelection();void(ltbm=window.open('{$url->getAdminUrl()}?op=newPost&sendTrackbacks=1&postText='+encodeURIComponent('<p>'+bm+' ... '+'<a href="'+window.location.href+'">'+'{$locale->tr("original_post")}'+'</a></p>'),'ltbm','toolbar=1,status=1,location=1,scrollbars=1,menubar=1,resizable=1'))" onclick="window.alert('{$locale->tr("bookmarklet_help")}');">{$locale->tr("blogit_to_lifetype")}</a>
       </div>
 
 	</div>

Modified: plog/trunk/templates/default/commentform.template
===================================================================
--- plog/trunk/templates/default/commentform.template	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/templates/default/commentform.template	2012-02-21 14:33:00 UTC (rev 7170)
@@ -2,76 +2,38 @@
 <div id="CommentForm">
 <form id="NewComment" action="{$url->getIndexUrl()}" method="post">
 <fieldset>
-<legend id="add_comment_title">{$locale->tr("add_comment")}</legend>
-<table border="0">
-<tr id="add_comment_topic">
- <td><label for="commentTopic">{$locale->pr("comment_topic")}</label></td>
- <td><input type="text" name="commentTopic" id="commentTopic" value="{$topic}" /></td>
-</tr>
-<tr id="add_comment_text">
-  <td><label for="commentText">{$locale->pr("comment_text")}<sup class="required">*</sup></label></td>
-  <td><textarea rows="10" cols="50" name="commentText" id="commentText"></textarea></td>
- </tr>
-
-{if $smileys && $smileys->isEnabled()}
-  <script type="text/javascript" src="{$url->getBaseUrl()}/plugins/smileys/js/smileys/smileys.js"></script>
-  <tr id="add_comment_smileys">
-    <td> </td><td>{$smileys->generateSmileysBar()}</td>
-  </tr>
-{/if}
-
-<tr id="add_comment_username">
-  <td><label for="userName">{$locale->pr("comment_username")}<sup class="required">*</sup></label></td>
-  <td>
-   {dynamic}
+<legend>{$locale->tr("add_comment")}</legend>
+{nocache}
+<div><label for="commentTopic">{$locale->pr("comment_topic")}</label><input type="text" name="commentTopic" id="commentTopic" value="{$topic}" /></div>
+<div><label for="commentText">{$locale->pr("comment_text")} ({$locale->tr("required")})</label><textarea rows="10" cols="30" name="commentText" id="commentText"></textarea></div>
+<div><label for="userName">{$locale->pr("comment_username")} ({$locale->tr("required")})</label>
 	{if $authuser}
-     <span id="AuthUser">{$authuser->getUsername()} ({$locale->tr("form_authenticated")})</span>
-	 <input type="hidden" name="userName" id="userNameHidden" value="{if $authuser}{$authuser->getUsername()}{/if}" />
+	<span id="AuthUser">{$authuser->getUsername()} ({$locale->tr("form_authenticated")})</span>
+	<input type="hidden" name="userName" id="userNameHidden" value="{if $authuser}{$authuser->getUsername()}{/if}" /></div>
 	{else}
-	 <input type="text" name="userName" id="userName" value="" />
+	<input type="text" name="userName" id="userName" value="" /></div>
 	{/if}
-   {/dynamic}
-  </td>
-</tr>
-
-<tr id="add_comment_useremail">
-  <td><label for="userEmail">{$locale->tr("comment_email")}</label></td>
-  <td><input type="text" name="userEmail" id="userEmail" value="" /></td>
-</tr>
-<tr id="add_comment_userurl">
-  <td><label for="userUrl">{$locale->tr("comment_url")}</label></td>
-  <td><input type="text" name="userUrl" id="userUrl" value="" /></td>
-</tr>
-
+<div><label for="userEmail">{$locale->tr("comment_email")}</label><input type="text" name="userEmail" id="userEmail" value="" /></div>
+<div><label for="userUrl">{$locale->tr("comment_url")}</label><input type="text" name="userUrl" id="userUrl" value="" /></div>
+{/nocache}
   {if $authimage && $authimage->isEnabled()}
-   <tr id="add_comment_authimage">
-     <td><label for="authImage">{$locale->tr("authimage_type_code")}</label></td>
-     <td><input type="text" name="authImage" id="authImage" value="" /> {$authimage->show()}</td>
-   </tr>
+   <div><label for="authImage">{$locale->tr("authimage_type_code")}</label>
+    <input type="text" name="authImage" id="authImage" value="" /> {$authimage->show()}
+   </div>
   {/if}
   {if $subscribe && $subscribe->isEnabled()}
-   <tr id="add_comment_subscribe">
-     <td colspan="2"><input type="checkbox" name="subscribe" /> E-mail me when comments occur on this article</td>
-   </tr>
+   <input type="checkbox" name="subscribe" />
+      E-mail me when comments occur on this article
   {/if}
   {if $hiddeninput && $hiddeninput->isEnabled()}
-   <tr id="add_comment_hiddeninput">
-    <td>{$hiddeninput->printHiddenFields()}</td>
-   </tr>
+   {$hiddeninput->printHiddenFields()}
   {/if}
 
-<tr id="add_comment_submit">
- <td colspan="2">
-  <input id="Add" type="submit" value="{$locale->pr("comment_send")}" name="Add" />
- <input type="hidden" name="op" value="AddComment" />
- <input type="hidden" name="articleId" value="{$post->getId()}" />
- <input type="hidden" name="blogId" value="{$blog->getId()}" />
- <input type="hidden" name="parentId" value="{$parentId}" />
- </td>
-</tr>
-
-</table>
-
+<div id="Submit"><input id="Add" type="submit" value="{$locale->pr("comment_send")}" name="Add" />
+<input type="hidden" name="op" value="AddComment" />
+<input type="hidden" name="articleId" value="{$post->getId()}" />
+<input type="hidden" name="blogId" value="{$blog->getId()}" />
+<input type="hidden" name="parentId" value="{$parentId}" /></div>
 </fieldset>
 </form>
 </div>

Modified: plog/trunk/templates/rss/atom.template
===================================================================
--- plog/trunk/templates/rss/atom.template	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/templates/rss/atom.template	2012-02-21 14:33:00 UTC (rev 7170)
@@ -4,7 +4,6 @@
       xml:lang="{$locale->getLanguageId()|lower}">
 <title>{$blog->getBlog()|escape}</title> 
 <link rel="alternate" type="text/html" href="{$url->blogLink()}" /> 
-<link href="{$url->rssLink("atom")}" rel="self" type="application/rss+xml" />
 {if $posts}
 	{assign var="newestDate" value=$posts[0]->getDateObject()} 
 	<updated>{$locale->formatDate($newestDate, "%Y-%m-%dT%H:%M:%S%G", $blog)}</updated> 

Modified: plog/trunk/templates/rss/rss20.template
===================================================================
--- plog/trunk/templates/rss/rss20.template	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/templates/rss/rss20.template	2012-02-21 14:33:00 UTC (rev 7170)
@@ -6,15 +6,14 @@
     xmlns:atom="http://www.w3.org/2005/Atom"
 >
  <channel>
-  <atom:link href="{$url->rssLink("rss20")}" rel="self" type="application/rss+xml" />
-  <title>{$blog->getBlog()|escape:hexentity}</title>
+  <title>{$blog->getBlog()|escape}</title>
   <link>{$url->blogLink()}</link>
   <description>{$blog->getAbout()|strip_tags}</description>
   <pubDate>{$locale->formatDateAsRFC822($now)}</pubDate>
-  <generator>http://lifetype.net</generator>
+  <generator>http://www.lifetype.net</generator>
   {foreach from=$posts item=post}
   <item>
-   <title>{$post->getTopic()|escape:hexentity}</title>
+   <title>{$post->getTopic()|escape}</title>
    <description>
     {$post->getText()|escape}
    </description>

Modified: plog/trunk/wizard
===================================================================
--- plog/trunk/wizard	2012-02-21 09:13:03 UTC (rev 7169)
+++ plog/trunk/wizard	2012-02-21 14:33:00 UTC (rev 7170)
@@ -33,7 +33,7 @@
     lt_include( PLOG_CLASS_PATH."class/controller/controller.class.php" );
     lt_include( PLOG_CLASS_PATH."class/template/templateservice.class.php" );
     lt_include( PLOG_CLASS_PATH."class/action/action.class.php" );
-    lt_include( PLOG_CLASS_PATH."class/database/ltdb.class.php" );
+    lt_include( PLOG_CLASS_PATH."class/database/db.class.php" );
     lt_include( PLOG_CLASS_PATH."class/template/template.class.php" );
     lt_include( PLOG_CLASS_PATH."class/view/view.class.php" );
     lt_include( PLOG_CLASS_PATH."class/data/validator/usernamevalidator.class.php" );
@@ -365,18 +365,18 @@
     {
         function WizardTokenizerFunctionsAvailableValidator()
         {
-            $this->WizardValidator( "Checking if <b>Tokenizer</b> functions are available",
+            $this->WizardValidator( "Checking if <b>Tokenizer</b> functions are available", 
                                     "LifeType requires support for the Tokenizer to be part of your PHP installation",
                                     true );
-        }
-
+        }    
+    
         function validate()
         {
             $this->_valid = function_exists( "token_get_all" );
-            return( parent::validate());
-        }
+            return( parent::validate());                            
+        }        
     }
-
+    
     class WizardSafeModeValidator extends WizardValidator
     {
         function WizardSafeModeValidator()
@@ -611,7 +611,7 @@
         function perform()
         {
             WizardTools::cleanTmpFolder();
-
+            
                 // we can detect whether plog is already installed or not and direct users to the right
             // place
             if( WizardTools::isNewInstallation())
@@ -942,7 +942,7 @@
                                  $config->getValue( "db_database" ));
 
             // create a data dictionary to give us the right sql code needed to create the tables
-            $dict = $this->_db->getDriverDataDictionary();
+            $dict = NewPDbDataDictionary( $this->_db );
 
            // create the tables
             $errors = false;
@@ -1190,12 +1190,12 @@
 			}
 
 			// add the default friend group for user
-
+            
             $friendGroups = new FriendGroups();
-            $friendGroup = new FriendGroup( $userId,
-                                            "General",
+            $friendGroup = new FriendGroup( $userId, 
+                                            "General", 
                                             "General" );
-            $friendGroups->addFriendGroup( $friendGroup );
+            $friendGroups->addFriendGroup( $friendGroup );            
 
 			// add the default private message boxes for user
 		    $privateMessageBoxes = new PrivateMessageBoxes();
@@ -1351,6 +1351,8 @@
                 }
             }
 
+            $this->Execute("DROP TABLE ".Db::getPrefix()."tmp_users_permissions");
+
             // clean the data cache to avoid problems when we're done
             lt_include( PLOG_CLASS_PATH."class/cache/cachemanager.class.php" );
             $cache =& CacheManager::getCache();
@@ -1505,7 +1507,7 @@
 			$curTable = $tablesArray[$this->page-1];
 
 			$db =& Db::getDb();
-            $dict = $db->getDriverDataDictionary();
+            $dict = NewPDbDataDictionary( $db );
             $errors = false;
 
 			$this->message = "Performing changes to the dabase schema, please wait (step %s of %s)<br/>";
@@ -1593,7 +1595,7 @@
 						}
 					}
 				}
-
+				
 				$this->updatedRecords++;
             }
 



More information about the pLog-svn mailing list